From caf0e7692a2f3cf0f2d0957c30a404e6c706d3df Mon Sep 17 00:00:00 2001 From: Scot Breitenfeld Date: Tue, 11 Aug 2015 09:35:30 -0500 Subject: [svn-r27493] Trying again to merge the F2003_v1.10 branch to the trunk. Tested: h5committest --PASSED-- --- CMakeLists.txt | 1 + MANIFEST | 174 +- Makefile.in | 27 +- c++/Makefile.in | 27 +- c++/examples/Makefile.in | 27 +- c++/src/Makefile.in | 29 +- c++/test/Makefile.in | 29 +- config/cmake/ConfigureChecks.cmake | 11 + config/cmake/H5pubconf.h.in | 12 + config/cmake/HDF518_Examples.cmake.in | 3 +- config/cmake/HDF5UseFortran.cmake | 491 + config/cmake/hdf5-config.cmake.in | 1 - config/cmake/libhdf5.settings.cmake.in | 1 - config/cmake/mccacheinit.cmake | 2 - configure | 32195 ++++++++++--------- configure.ac | 295 +- examples/Makefile.in | 27 +- fortran/Makefile.in | 27 +- fortran/doc/DevelGuide/masterindex.html | 589 - fortran/doc/DevelGuide/robo_functions.html | 39 - fortran/doc/DevelGuide/robo_modules.html | 117 - fortran/doc/DevelGuide/robo_programs.html | 39 - fortran/doc/DevelGuide/robo_sourcefiles.html | 309 - fortran/doc/DevelGuide/robo_subroutines.html | 421 - fortran/doc/DevelGuide/robodoc.css | 302 - fortran/doc/DevelGuide/src/H5Af_c.html | 41 - fortran/doc/DevelGuide/src/H5Aff_F03_f90.html | 130 - fortran/doc/DevelGuide/src/H5Aff_F90_f90.html | 56 - fortran/doc/DevelGuide/src/H5Aff_f90.html | 1102 - fortran/doc/DevelGuide/src/H5Df_c.html | 41 - fortran/doc/DevelGuide/src/H5Dff_F03_f90.html | 138 - fortran/doc/DevelGuide/src/H5Dff_F90_f90.html | 116 - fortran/doc/DevelGuide/src/H5Dff_f90.html | 506 - fortran/doc/DevelGuide/src/H5Ef_c.html | 41 - fortran/doc/DevelGuide/src/H5Eff_f90.html | 197 - fortran/doc/DevelGuide/src/H5FDmpiof_c.html | 41 - fortran/doc/DevelGuide/src/H5FDmpioff_f90.html | 253 - fortran/doc/DevelGuide/src/H5Ff_c.html | 41 - fortran/doc/DevelGuide/src/H5Fff_f90.html | 653 - fortran/doc/DevelGuide/src/H5Gf_c.html | 41 - fortran/doc/DevelGuide/src/H5Gff_f90.html | 840 - fortran/doc/DevelGuide/src/H5If_c.html | 41 - fortran/doc/DevelGuide/src/H5Iff_f90.html | 304 - fortran/doc/DevelGuide/src/H5Lf_c.html | 41 - fortran/doc/DevelGuide/src/H5Lff_F03_f90.html | 181 - fortran/doc/DevelGuide/src/H5Lff_F90_f90.html | 50 - fortran/doc/DevelGuide/src/H5Lff_f90.html | 637 - fortran/doc/DevelGuide/src/H5Of_c.html | 41 - fortran/doc/DevelGuide/src/H5Off_f90.html | 198 - fortran/doc/DevelGuide/src/H5Pf_c.html | 41 - fortran/doc/DevelGuide/src/H5Pff_F03_f90.html | 832 - fortran/doc/DevelGuide/src/H5Pff_F90_f90.html | 715 - fortran/doc/DevelGuide/src/H5Pff_f90.html | 4752 --- fortran/doc/DevelGuide/src/H5Rf_c.html | 41 - fortran/doc/DevelGuide/src/H5Rff_F03_f90.html | 492 - fortran/doc/DevelGuide/src/H5Rff_F90_f90.html | 305 - fortran/doc/DevelGuide/src/H5Rff_f90.html | 148 - fortran/doc/DevelGuide/src/H5Sf_c.html | 41 - fortran/doc/DevelGuide/src/H5Sff_f90.html | 1165 - fortran/doc/DevelGuide/src/H5Tf_c.html | 41 - fortran/doc/DevelGuide/src/H5Tff_f90.html | 2378 -- fortran/doc/DevelGuide/src/H5Zf_c.html | 41 - fortran/doc/DevelGuide/src/H5Zff_f90.html | 173 - .../src/H5_DBLE_InterfaceExclude_f90.html | 53 - .../src/H5_DBLE_InterfaceInclude_f90.html | 54 - fortran/doc/DevelGuide/src/H5_f_c.html | 41 - fortran/doc/DevelGuide/src/H5_ff_F03_f90.html | 83 - fortran/doc/DevelGuide/src/H5_ff_F90_f90.html | 48 - fortran/doc/DevelGuide/src/H5_ff_f90.html | 269 - fortran/doc/DevelGuide/src/H5f90global_f90.html | 61 - fortran/doc/DevelGuide/src/H5f90kit_c.html | 44 - fortran/doc/DevelGuide/src/H5match_types_c.html | 49 - .../doc/DevelGuide/src/H5test_kind_SIZEOF_f90.html | 61 - fortran/doc/DevelGuide/src/H5test_kind_f90.html | 62 - fortran/doc/DevelGuide/src/HDF5_f90.html | 47 - fortran/doc/DevelGuide/src/HDF5mpio_f90.html | 45 - fortran/doc/DevelGuide/test/fflush1_f90.html | 47 - fortran/doc/DevelGuide/test/fflush2_f90.html | 47 - .../DevelGuide/test/fortranlib_test_1_8_f90.html | 44 - .../DevelGuide/test/fortranlib_test_F03_f90.html | 45 - .../doc/DevelGuide/test/fortranlib_test_f90.html | 44 - fortran/doc/DevelGuide/test/tF2003_f90.html | 53 - fortran/doc/DevelGuide/test/tH5A_1_8_f90.html | 51 - fortran/doc/DevelGuide/test/tH5A_f90.html | 47 - fortran/doc/DevelGuide/test/tH5D_f90.html | 52 - fortran/doc/DevelGuide/test/tH5E_f90.html | 51 - fortran/doc/DevelGuide/test/tH5F_f90.html | 47 - fortran/doc/DevelGuide/test/tH5G_1_8_f90.html | 49 - fortran/doc/DevelGuide/test/tH5G_f90.html | 47 - fortran/doc/DevelGuide/test/tH5I_f90.html | 47 - fortran/doc/DevelGuide/test/tH5O_f90.html | 47 - fortran/doc/DevelGuide/test/tH5P_f90.html | 47 - fortran/doc/DevelGuide/test/tH5R_f90.html | 51 - fortran/doc/DevelGuide/test/tH5S_f90.html | 54 - fortran/doc/DevelGuide/test/tH5Sselect_f90.html | 56 - fortran/doc/DevelGuide/test/tH5T_f90.html | 47 - fortran/doc/DevelGuide/test/tH5VL_f90.html | 47 - fortran/doc/DevelGuide/test/tH5Z_f90.html | 47 - fortran/doc/DevelGuide/test/t_c.html | 44 - fortran/doc/DevelGuide/test/tf_f90.html | 48 - fortran/doc/DevelGuide/toc_index.html | 552 - fortran/examples/CMakeLists.txt | 54 +- fortran/examples/Makefile.am | 12 +- fortran/examples/Makefile.in | 51 +- fortran/examples/nested_derived_type.f90 | 12 +- fortran/examples/rwdset_fortran2003.f90 | 24 +- fortran/src/CMakeLists.txt | 239 +- fortran/src/H5Af.c | 1478 +- fortran/src/H5Aff.F90 | 1873 ++ fortran/src/H5Aff.f90 | 1673 - fortran/src/H5Aff_F03.f90 | 1267 - fortran/src/H5Aff_F90.f90 | 1618 - fortran/src/H5Df.c | 1658 +- fortran/src/H5Dff.F90 | 1878 ++ fortran/src/H5Dff.f90 | 1035 - fortran/src/H5Dff_F03.f90 | 2389 -- fortran/src/H5Dff_F90.f90 | 3004 -- fortran/src/H5Ef.c | 65 +- fortran/src/H5Eff.F90 | 302 + fortran/src/H5Eff.f90 | 251 - fortran/src/H5Eff_F03.f90 | 108 - fortran/src/H5Eff_F90.f90 | 89 - fortran/src/H5FDmpiof.c | 258 - fortran/src/H5FDmpioff.f90 | 212 - fortran/src/H5Ff.c | 238 +- fortran/src/H5Fff.F90 | 871 + fortran/src/H5Fff.f90 | 834 - fortran/src/H5Fff_F03.f90 | 99 - fortran/src/H5Fff_F90.f90 | 43 - fortran/src/H5Gf.c | 393 +- fortran/src/H5Gff.F90 | 1272 + fortran/src/H5Gff.f90 | 1331 - fortran/src/H5If.c | 104 +- fortran/src/H5Iff.F90 | 345 + fortran/src/H5Iff.f90 | 352 - fortran/src/H5Lf.c | 324 +- fortran/src/H5Lff.F90 | 1478 + fortran/src/H5Lff.f90 | 1300 - fortran/src/H5Lff_F03.f90 | 242 - fortran/src/H5Lff_F90.f90 | 39 - fortran/src/H5Of.c | 86 +- fortran/src/H5Off.F90 | 1149 + fortran/src/H5Off.f90 | 775 - fortran/src/H5Off_F03.f90 | 435 - fortran/src/H5Off_F90.f90 | 39 - fortran/src/H5Pf.c | 2655 +- fortran/src/H5Pff.F90 | 7327 +++++ fortran/src/H5Pff.f90 | 6400 ---- fortran/src/H5Pff_F03.f90 | 1267 - fortran/src/H5Pff_F90.f90 | 949 - fortran/src/H5Rf.c | 338 +- fortran/src/H5Rff.F90 | 792 + fortran/src/H5Rff.f90 | 128 - fortran/src/H5Rff_F03.f90 | 719 - fortran/src/H5Rff_F90.f90 | 514 - fortran/src/H5Sf.c | 554 +- fortran/src/H5Sff.F90 | 1754 + fortran/src/H5Sff.f90 | 1875 -- fortran/src/H5Tf.c | 681 +- fortran/src/H5Tff.F90 | 3082 ++ fortran/src/H5Tff.f90 | 3105 -- fortran/src/H5Tff_F03.f90 | 223 - fortran/src/H5Tff_F90.f90 | 95 - fortran/src/H5Zf.c | 44 +- fortran/src/H5Zff.F90 | 189 + fortran/src/H5Zff.f90 | 198 - fortran/src/H5_DBLE_InterfaceExclude.f90 | 39 - fortran/src/H5_DBLE_InterfaceInclude.f90 | 1859 -- fortran/src/H5_buildiface.F90 | 1024 + fortran/src/H5_f.c | 275 +- fortran/src/H5_ff.F90 | 451 + fortran/src/H5_ff.f90 | 409 - fortran/src/H5_ff_F03.f90 | 75 - fortran/src/H5_ff_F90.f90 | 34 - fortran/src/H5config_f.inc.cmake | 84 + fortran/src/H5config_f.inc.in | 59 + fortran/src/H5f90global.F90 | 1040 + fortran/src/H5f90global.f90 | 947 - fortran/src/H5f90kit.c | 32 +- fortran/src/H5f90proto.h | 1468 +- fortran/src/H5fort_type_defines.h.in | 16 + fortran/src/H5match_types.c | 577 +- fortran/src/H5test_kind.f90 | 269 - fortran/src/H5test_kind_SIZEOF.f90 | 228 - fortran/src/H5test_kind_STORAGE_SIZE.f90 | 230 - fortran/src/HDF5.F90 | 46 + fortran/src/HDF5.f90 | 56 - fortran/src/HDF5mpio.f90 | 55 - fortran/src/Makefile.am | 157 +- fortran/src/Makefile.in | 306 +- fortran/src/hdf5_fortrandll.def.in | 272 +- fortran/test/CMakeLists.txt | 143 +- fortran/test/H5_test_buildiface.F90 | 306 + fortran/test/Makefile.am | 61 +- fortran/test/Makefile.in | 224 +- fortran/test/fflush2.f90 | 297 +- fortran/test/tH5A.f90 | 19 +- fortran/test/tH5A_1_8.f90 | 177 +- fortran/test/tH5D.f90 | 950 +- fortran/test/tH5E_F03.f90 | 19 +- fortran/test/tH5F_F03.f90 | 13 +- fortran/test/tH5G_1_8.f90 | 207 +- fortran/test/tH5I.f90 | 10 +- fortran/test/tH5L_F03.f90 | 27 +- fortran/test/tH5MISC_1_8.f90 | 53 +- fortran/test/tH5O.f90 | 56 +- fortran/test/tH5O_F03.f90 | 4 +- fortran/test/tH5P.f90 | 71 +- fortran/test/tH5P_F03.f90 | 65 +- fortran/test/tH5R.f90 | 37 +- fortran/test/tH5S.f90 | 6 +- fortran/test/tH5Sselect.f90 | 219 +- fortran/test/tH5T.f90 | 259 +- fortran/test/tH5T_F03.F90 | 3425 ++ fortran/test/tH5T_F03.f90 | 3453 -- fortran/test/tH5VL.f90 | 30 +- fortran/test/tHDF5.f90 | 1 + fortran/test/tf.F90 | 412 + fortran/test/tf.f90 | 393 - fortran/test/tf_F03.f90 | 128 - fortran/test/tf_F08.f90 | 128 - fortran/test/tf_F90.f90 | 33 - fortran/testpar/Makefile.in | 29 +- hl/Makefile.in | 27 +- hl/c++/Makefile.in | 27 +- hl/c++/examples/Makefile.in | 27 +- hl/c++/src/Makefile.in | 29 +- hl/c++/test/Makefile.in | 29 +- hl/examples/Makefile.in | 27 +- hl/fortran/Makefile.in | 27 +- hl/fortran/examples/Makefile.in | 27 +- hl/fortran/src/CMakeLists.txt | 72 +- hl/fortran/src/H5DSfc.c | 36 +- hl/fortran/src/H5DSff.F90 | 518 + hl/fortran/src/H5DSff.f90 | 545 - hl/fortran/src/H5HL_buildiface.F90 | 683 + hl/fortran/src/H5IMfc.c | 24 +- hl/fortran/src/H5IMff.F90 | 667 + hl/fortran/src/H5IMff.f90 | 783 - hl/fortran/src/H5LTf90proto.h | 1380 +- hl/fortran/src/H5LTfc.c | 1428 +- hl/fortran/src/H5LTff.F90 | 1912 ++ hl/fortran/src/H5LTff.f90 | 6490 ---- hl/fortran/src/H5TBfc.c | 307 +- hl/fortran/src/H5TBff.F90 | 848 + hl/fortran/src/H5TBff.f90 | 1900 -- hl/fortran/src/Makefile.am | 36 +- hl/fortran/src/Makefile.in | 148 +- hl/fortran/src/hdf5_hl_fortrandll.def.in | 88 + hl/fortran/test/CMakeLists.txt | 16 +- hl/fortran/test/Makefile.am | 8 +- hl/fortran/test/Makefile.in | 68 +- hl/fortran/test/tstds.F90 | 353 + hl/fortran/test/tstds.f90 | 353 - hl/fortran/test/tstimage.F90 | 339 + hl/fortran/test/tstimage.f90 | 339 - hl/fortran/test/tstlite.F90 | 1719 + hl/fortran/test/tstlite.f90 | 1628 - hl/fortran/test/tsttable.F90 | 534 + hl/fortran/test/tsttable.f90 | 466 - hl/src/Makefile.in | 29 +- hl/test/Makefile.in | 29 +- hl/tools/Makefile.in | 27 +- hl/tools/gif2h5/Makefile.in | 29 +- m4/aclocal_fc.m4 | 345 +- src/H5config.h.in | 54 + src/Makefile.in | 28 +- src/libhdf5.settings.in | 1 - test/Makefile.in | 29 +- testpar/Makefile.in | 29 +- tools/Makefile.in | 27 +- tools/h5copy/Makefile.in | 29 +- tools/h5diff/Makefile.in | 29 +- tools/h5dump/Makefile.in | 29 +- tools/h5import/Makefile.in | 29 +- tools/h5jam/Makefile.in | 29 +- tools/h5ls/Makefile.in | 29 +- tools/h5repack/Makefile.in | 29 +- tools/h5stat/Makefile.in | 29 +- tools/lib/Makefile.in | 29 +- tools/misc/Makefile.in | 29 +- tools/perform/Makefile.in | 29 +- 282 files changed, 61292 insertions(+), 103731 deletions(-) create mode 100644 config/cmake/HDF5UseFortran.cmake delete mode 100644 fortran/doc/DevelGuide/masterindex.html delete mode 100644 fortran/doc/DevelGuide/robo_functions.html delete mode 100644 fortran/doc/DevelGuide/robo_modules.html delete mode 100644 fortran/doc/DevelGuide/robo_programs.html delete mode 100644 fortran/doc/DevelGuide/robo_sourcefiles.html delete mode 100644 fortran/doc/DevelGuide/robo_subroutines.html delete mode 100644 fortran/doc/DevelGuide/robodoc.css delete mode 100644 fortran/doc/DevelGuide/src/H5Af_c.html delete mode 100644 fortran/doc/DevelGuide/src/H5Aff_F03_f90.html delete mode 100644 fortran/doc/DevelGuide/src/H5Aff_F90_f90.html delete mode 100644 fortran/doc/DevelGuide/src/H5Aff_f90.html delete mode 100644 fortran/doc/DevelGuide/src/H5Df_c.html delete mode 100644 fortran/doc/DevelGuide/src/H5Dff_F03_f90.html delete mode 100644 fortran/doc/DevelGuide/src/H5Dff_F90_f90.html delete mode 100644 fortran/doc/DevelGuide/src/H5Dff_f90.html delete mode 100644 fortran/doc/DevelGuide/src/H5Ef_c.html delete mode 100644 fortran/doc/DevelGuide/src/H5Eff_f90.html delete mode 100644 fortran/doc/DevelGuide/src/H5FDmpiof_c.html delete mode 100644 fortran/doc/DevelGuide/src/H5FDmpioff_f90.html delete mode 100644 fortran/doc/DevelGuide/src/H5Ff_c.html delete mode 100644 fortran/doc/DevelGuide/src/H5Fff_f90.html delete mode 100644 fortran/doc/DevelGuide/src/H5Gf_c.html delete mode 100644 fortran/doc/DevelGuide/src/H5Gff_f90.html delete mode 100644 fortran/doc/DevelGuide/src/H5If_c.html delete mode 100644 fortran/doc/DevelGuide/src/H5Iff_f90.html delete mode 100644 fortran/doc/DevelGuide/src/H5Lf_c.html delete mode 100644 fortran/doc/DevelGuide/src/H5Lff_F03_f90.html delete mode 100644 fortran/doc/DevelGuide/src/H5Lff_F90_f90.html delete mode 100644 fortran/doc/DevelGuide/src/H5Lff_f90.html delete mode 100644 fortran/doc/DevelGuide/src/H5Of_c.html delete mode 100644 fortran/doc/DevelGuide/src/H5Off_f90.html delete mode 100644 fortran/doc/DevelGuide/src/H5Pf_c.html delete mode 100644 fortran/doc/DevelGuide/src/H5Pff_F03_f90.html delete mode 100644 fortran/doc/DevelGuide/src/H5Pff_F90_f90.html delete mode 100644 fortran/doc/DevelGuide/src/H5Pff_f90.html delete mode 100644 fortran/doc/DevelGuide/src/H5Rf_c.html delete mode 100644 fortran/doc/DevelGuide/src/H5Rff_F03_f90.html delete mode 100644 fortran/doc/DevelGuide/src/H5Rff_F90_f90.html delete mode 100644 fortran/doc/DevelGuide/src/H5Rff_f90.html delete mode 100644 fortran/doc/DevelGuide/src/H5Sf_c.html delete mode 100644 fortran/doc/DevelGuide/src/H5Sff_f90.html delete mode 100644 fortran/doc/DevelGuide/src/H5Tf_c.html delete mode 100644 fortran/doc/DevelGuide/src/H5Tff_f90.html delete mode 100644 fortran/doc/DevelGuide/src/H5Zf_c.html delete mode 100644 fortran/doc/DevelGuide/src/H5Zff_f90.html delete mode 100644 fortran/doc/DevelGuide/src/H5_DBLE_InterfaceExclude_f90.html delete mode 100644 fortran/doc/DevelGuide/src/H5_DBLE_InterfaceInclude_f90.html delete mode 100644 fortran/doc/DevelGuide/src/H5_f_c.html delete mode 100644 fortran/doc/DevelGuide/src/H5_ff_F03_f90.html delete mode 100644 fortran/doc/DevelGuide/src/H5_ff_F90_f90.html delete mode 100644 fortran/doc/DevelGuide/src/H5_ff_f90.html delete mode 100644 fortran/doc/DevelGuide/src/H5f90global_f90.html delete mode 100644 fortran/doc/DevelGuide/src/H5f90kit_c.html delete mode 100644 fortran/doc/DevelGuide/src/H5match_types_c.html delete mode 100644 fortran/doc/DevelGuide/src/H5test_kind_SIZEOF_f90.html delete mode 100644 fortran/doc/DevelGuide/src/H5test_kind_f90.html delete mode 100644 fortran/doc/DevelGuide/src/HDF5_f90.html delete mode 100644 fortran/doc/DevelGuide/src/HDF5mpio_f90.html delete mode 100644 fortran/doc/DevelGuide/test/fflush1_f90.html delete mode 100644 fortran/doc/DevelGuide/test/fflush2_f90.html delete mode 100644 fortran/doc/DevelGuide/test/fortranlib_test_1_8_f90.html delete mode 100644 fortran/doc/DevelGuide/test/fortranlib_test_F03_f90.html delete mode 100644 fortran/doc/DevelGuide/test/fortranlib_test_f90.html delete mode 100644 fortran/doc/DevelGuide/test/tF2003_f90.html delete mode 100644 fortran/doc/DevelGuide/test/tH5A_1_8_f90.html delete mode 100644 fortran/doc/DevelGuide/test/tH5A_f90.html delete mode 100644 fortran/doc/DevelGuide/test/tH5D_f90.html delete mode 100644 fortran/doc/DevelGuide/test/tH5E_f90.html delete mode 100644 fortran/doc/DevelGuide/test/tH5F_f90.html delete mode 100644 fortran/doc/DevelGuide/test/tH5G_1_8_f90.html delete mode 100644 fortran/doc/DevelGuide/test/tH5G_f90.html delete mode 100644 fortran/doc/DevelGuide/test/tH5I_f90.html delete mode 100644 fortran/doc/DevelGuide/test/tH5O_f90.html delete mode 100644 fortran/doc/DevelGuide/test/tH5P_f90.html delete mode 100644 fortran/doc/DevelGuide/test/tH5R_f90.html delete mode 100644 fortran/doc/DevelGuide/test/tH5S_f90.html delete mode 100644 fortran/doc/DevelGuide/test/tH5Sselect_f90.html delete mode 100644 fortran/doc/DevelGuide/test/tH5T_f90.html delete mode 100644 fortran/doc/DevelGuide/test/tH5VL_f90.html delete mode 100644 fortran/doc/DevelGuide/test/tH5Z_f90.html delete mode 100644 fortran/doc/DevelGuide/test/t_c.html delete mode 100644 fortran/doc/DevelGuide/test/tf_f90.html delete mode 100644 fortran/doc/DevelGuide/toc_index.html create mode 100644 fortran/src/H5Aff.F90 delete mode 100644 fortran/src/H5Aff.f90 delete mode 100644 fortran/src/H5Aff_F03.f90 delete mode 100644 fortran/src/H5Aff_F90.f90 create mode 100644 fortran/src/H5Dff.F90 delete mode 100644 fortran/src/H5Dff.f90 delete mode 100644 fortran/src/H5Dff_F03.f90 delete mode 100644 fortran/src/H5Dff_F90.f90 create mode 100644 fortran/src/H5Eff.F90 delete mode 100644 fortran/src/H5Eff.f90 delete mode 100644 fortran/src/H5Eff_F03.f90 delete mode 100644 fortran/src/H5Eff_F90.f90 delete mode 100644 fortran/src/H5FDmpiof.c delete mode 100644 fortran/src/H5FDmpioff.f90 create mode 100644 fortran/src/H5Fff.F90 delete mode 100644 fortran/src/H5Fff.f90 delete mode 100644 fortran/src/H5Fff_F03.f90 delete mode 100644 fortran/src/H5Fff_F90.f90 create mode 100644 fortran/src/H5Gff.F90 delete mode 100644 fortran/src/H5Gff.f90 create mode 100644 fortran/src/H5Iff.F90 delete mode 100644 fortran/src/H5Iff.f90 create mode 100644 fortran/src/H5Lff.F90 delete mode 100644 fortran/src/H5Lff.f90 delete mode 100644 fortran/src/H5Lff_F03.f90 delete mode 100644 fortran/src/H5Lff_F90.f90 create mode 100644 fortran/src/H5Off.F90 delete mode 100644 fortran/src/H5Off.f90 delete mode 100644 fortran/src/H5Off_F03.f90 delete mode 100644 fortran/src/H5Off_F90.f90 create mode 100644 fortran/src/H5Pff.F90 delete mode 100644 fortran/src/H5Pff.f90 delete mode 100644 fortran/src/H5Pff_F03.f90 delete mode 100644 fortran/src/H5Pff_F90.f90 create mode 100644 fortran/src/H5Rff.F90 delete mode 100644 fortran/src/H5Rff.f90 delete mode 100644 fortran/src/H5Rff_F03.f90 delete mode 100644 fortran/src/H5Rff_F90.f90 create mode 100644 fortran/src/H5Sff.F90 delete mode 100644 fortran/src/H5Sff.f90 create mode 100644 fortran/src/H5Tff.F90 delete mode 100644 fortran/src/H5Tff.f90 delete mode 100644 fortran/src/H5Tff_F03.f90 delete mode 100644 fortran/src/H5Tff_F90.f90 create mode 100644 fortran/src/H5Zff.F90 delete mode 100644 fortran/src/H5Zff.f90 delete mode 100644 fortran/src/H5_DBLE_InterfaceExclude.f90 delete mode 100644 fortran/src/H5_DBLE_InterfaceInclude.f90 create mode 100644 fortran/src/H5_buildiface.F90 create mode 100644 fortran/src/H5_ff.F90 delete mode 100644 fortran/src/H5_ff.f90 delete mode 100644 fortran/src/H5_ff_F03.f90 delete mode 100644 fortran/src/H5_ff_F90.f90 create mode 100644 fortran/src/H5config_f.inc.cmake create mode 100644 fortran/src/H5config_f.inc.in create mode 100644 fortran/src/H5f90global.F90 delete mode 100644 fortran/src/H5f90global.f90 create mode 100644 fortran/src/H5fort_type_defines.h.in delete mode 100644 fortran/src/H5test_kind.f90 delete mode 100644 fortran/src/H5test_kind_SIZEOF.f90 delete mode 100644 fortran/src/H5test_kind_STORAGE_SIZE.f90 create mode 100644 fortran/src/HDF5.F90 delete mode 100644 fortran/src/HDF5.f90 delete mode 100644 fortran/src/HDF5mpio.f90 create mode 100644 fortran/test/H5_test_buildiface.F90 create mode 100644 fortran/test/tH5T_F03.F90 delete mode 100644 fortran/test/tH5T_F03.f90 create mode 100644 fortran/test/tf.F90 delete mode 100644 fortran/test/tf.f90 delete mode 100644 fortran/test/tf_F03.f90 delete mode 100644 fortran/test/tf_F08.f90 delete mode 100644 fortran/test/tf_F90.f90 create mode 100644 hl/fortran/src/H5DSff.F90 delete mode 100644 hl/fortran/src/H5DSff.f90 create mode 100644 hl/fortran/src/H5HL_buildiface.F90 create mode 100644 hl/fortran/src/H5IMff.F90 delete mode 100644 hl/fortran/src/H5IMff.f90 create mode 100644 hl/fortran/src/H5LTff.F90 delete mode 100644 hl/fortran/src/H5LTff.f90 create mode 100644 hl/fortran/src/H5TBff.F90 delete mode 100644 hl/fortran/src/H5TBff.f90 create mode 100644 hl/fortran/src/hdf5_hl_fortrandll.def.in create mode 100644 hl/fortran/test/tstds.F90 delete mode 100644 hl/fortran/test/tstds.f90 create mode 100644 hl/fortran/test/tstimage.F90 delete mode 100644 hl/fortran/test/tstimage.f90 create mode 100644 hl/fortran/test/tstlite.F90 delete mode 100644 hl/fortran/test/tstlite.f90 create mode 100644 hl/fortran/test/tsttable.F90 delete mode 100644 hl/fortran/test/tsttable.f90 diff --git a/CMakeLists.txt b/CMakeLists.txt index fda7d75..799c1da 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -673,6 +673,7 @@ if (EXISTS "${HDF5_SOURCE_DIR}/fortran" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/for endif (BUILD_SHARED_LIBS AND APPLE) option (HDF5_ENABLE_F2003 "Enable FORTRAN 2003 Standard" ON) include (${HDF_RESOURCES_EXT_DIR}/HDFUseFortran.cmake) + include (${HDF_RESOURCES_DIR}/HDF5UseFortran.cmake) if (HDF5_ENABLE_F2003) if (NOT FORTRAN_HAVE_ISO_C_BINDING) set (HDF5_ENABLE_F2003 OFF) diff --git a/MANIFEST b/MANIFEST index e5c002f..3629e3c 100644 --- a/MANIFEST +++ b/MANIFEST @@ -162,89 +162,6 @@ ./fortran/Makefile.in ./fortran/robodoc.rc -./fortran/doc/DevelGuide/toc_index.html -./fortran/doc/DevelGuide/masterindex.html -./fortran/doc/DevelGuide/robo_subroutines.html -./fortran/doc/DevelGuide/robo_sourcefiles.html -./fortran/doc/DevelGuide/robo_functions.html -./fortran/doc/DevelGuide/robo_modules.html -./fortran/doc/DevelGuide/robo_programs.html -./fortran/doc/DevelGuide/robodoc.css -./fortran/doc/DevelGuide/test/fortranlib_test_f90.html -./fortran/doc/DevelGuide/test/tH5A_f90.html -./fortran/doc/DevelGuide/test/tH5VL_f90.html -./fortran/doc/DevelGuide/test/tH5D_f90.html -./fortran/doc/DevelGuide/test/tH5E_f90.html -./fortran/doc/DevelGuide/test/tH5F_f90.html -./fortran/doc/DevelGuide/test/tH5G_f90.html -./fortran/doc/DevelGuide/test/fflush1_f90.html -./fortran/doc/DevelGuide/test/fortranlib_test_1_8_f90.html -./fortran/doc/DevelGuide/test/tH5A_1_8_f90.html -./fortran/doc/DevelGuide/test/tf_f90.html -./fortran/doc/DevelGuide/test/fflush2_f90.html -./fortran/doc/DevelGuide/test/fortranlib_test_F03_f90.html -./fortran/doc/DevelGuide/test/tH5I_f90.html -./fortran/doc/DevelGuide/test/tH5G_1_8_f90.html -./fortran/doc/DevelGuide/test/tF2003_f90.html -./fortran/doc/DevelGuide/test/tH5O_f90.html -./fortran/doc/DevelGuide/test/tH5P_f90.html -./fortran/doc/DevelGuide/test/tH5R_f90.html -./fortran/doc/DevelGuide/test/tH5S_f90.html -./fortran/doc/DevelGuide/test/tH5Sselect_f90.html -./fortran/doc/DevelGuide/test/tH5T_f90.html -./fortran/doc/DevelGuide/test/t_c.html -./fortran/doc/DevelGuide/test/tH5Z_f90.html -./fortran/doc/DevelGuide/src/H5Fff_f90.html -./fortran/doc/DevelGuide/src/H5Zf_c.html -./fortran/doc/DevelGuide/src/H5Pff_F90_f90.html -./fortran/doc/DevelGuide/src/H5Aff_F03_f90.html -./fortran/doc/DevelGuide/src/H5match_types_c.html -./fortran/doc/DevelGuide/src/H5Rff_F90_f90.html -./fortran/doc/DevelGuide/src/H5Lff_f90.html -./fortran/doc/DevelGuide/src/H5FDmpiof_c.html -./fortran/doc/DevelGuide/src/H5_f_c.html -./fortran/doc/DevelGuide/src/H5Pff_f90.html -./fortran/doc/DevelGuide/src/H5Rff_f90.html -./fortran/doc/DevelGuide/src/H5Tff_f90.html -./fortran/doc/DevelGuide/src/H5test_kind_f90.html -./fortran/doc/DevelGuide/src/H5Aff_F90_f90.html -./fortran/doc/DevelGuide/src/H5Zff_f90.html -./fortran/doc/DevelGuide/src/HDF5_f90.html -./fortran/doc/DevelGuide/src/H5_DBLE_InterfaceInclude_f90.html -./fortran/doc/DevelGuide/src/H5f90kit_c.html -./fortran/doc/DevelGuide/src/H5Aff_f90.html -./fortran/doc/DevelGuide/src/H5_DBLE_InterfaceExclude_f90.html -./fortran/doc/DevelGuide/src/H5Eff_f90.html -./fortran/doc/DevelGuide/src/H5_ff_F03_f90.html -./fortran/doc/DevelGuide/src/H5Gff_f90.html -./fortran/doc/DevelGuide/src/H5test_kind_SIZEOF_f90.html -./fortran/doc/DevelGuide/src/H5Iff_f90.html -./fortran/doc/DevelGuide/src/H5Dff_F03_f90.html -./fortran/doc/DevelGuide/src/H5Af_c.html -./fortran/doc/DevelGuide/src/H5Off_f90.html -./fortran/doc/DevelGuide/src/H5Df_c.html -./fortran/doc/DevelGuide/src/H5Sff_f90.html -./fortran/doc/DevelGuide/src/H5Ef_c.html -./fortran/doc/DevelGuide/src/HDF5mpio_f90.html -./fortran/doc/DevelGuide/src/H5Lff_F03_f90.html -./fortran/doc/DevelGuide/src/H5Ff_c.html -./fortran/doc/DevelGuide/src/H5f90global_f90.html -./fortran/doc/DevelGuide/src/H5Gf_c.html -./fortran/doc/DevelGuide/src/H5If_c.html -./fortran/doc/DevelGuide/src/H5Pff_F03_f90.html -./fortran/doc/DevelGuide/src/H5_ff_F90_f90.html -./fortran/doc/DevelGuide/src/H5Rff_F03_f90.html -./fortran/doc/DevelGuide/src/H5Lf_c.html -./fortran/doc/DevelGuide/src/H5Of_c.html -./fortran/doc/DevelGuide/src/H5Dff_F90_f90.html -./fortran/doc/DevelGuide/src/H5Pf_c.html -./fortran/doc/DevelGuide/src/H5FDmpioff_f90.html -./fortran/doc/DevelGuide/src/H5_ff_f90.html -./fortran/doc/DevelGuide/src/H5Rf_c.html -./fortran/doc/DevelGuide/src/H5Sf_c.html -./fortran/doc/DevelGuide/src/H5Tf_c.html -./fortran/doc/DevelGuide/src/H5Dff_f90.html -./fortran/doc/DevelGuide/src/H5Lff_F90_f90.html ./fortran/examples/Makefile.am ./fortran/examples/Makefile.in @@ -272,68 +189,44 @@ ./fortran/examples/rwdset_fortran2003.f90 ./fortran/src/H5_f.c -./fortran/src/H5_ff.f90 -./fortran/src/H5_ff_F90.f90 -./fortran/src/H5_ff_F03.f90 -./fortran/src/H5_DBLE_InterfaceInclude.f90 -./fortran/src/H5_DBLE_InterfaceExclude.f90 +./fortran/src/H5_ff.F90 ./fortran/src/H5Af.c -./fortran/src/H5Aff.f90 -./fortran/src/H5Aff_F90.f90 -./fortran/src/H5Aff_F03.f90 +./fortran/src/H5Aff.F90 ./fortran/src/H5Df.c -./fortran/src/H5Dff.f90 -./fortran/src/H5Dff_F90.f90 -./fortran/src/H5Dff_F03.f90 +./fortran/src/H5Dff.F90 ./fortran/src/H5Ef.c -./fortran/src/H5Eff.f90 -./fortran/src/H5Eff_F90.f90 -./fortran/src/H5Eff_F03.f90 -./fortran/src/H5FDmpiof.c -./fortran/src/H5FDmpioff.f90 +./fortran/src/H5Eff.F90 ./fortran/src/H5Ff.c -./fortran/src/H5Fff.f90 -./fortran/src/H5Fff_F90.f90 -./fortran/src/H5Fff_F03.f90 +./fortran/src/H5Fff.F90 ./fortran/src/H5Gf.c -./fortran/src/H5Gff.f90 +./fortran/src/H5Gff.F90 ./fortran/src/H5If.c -./fortran/src/H5Iff.f90 +./fortran/src/H5Iff.F90 ./fortran/src/H5Lf.c -./fortran/src/H5Lff.f90 -./fortran/src/H5Lff_F90.f90 -./fortran/src/H5Lff_F03.f90 +./fortran/src/H5Lff.F90 ./fortran/src/H5Of.c -./fortran/src/H5Off.f90 -./fortran/src/H5Off_F90.f90 -./fortran/src/H5Off_F03.f90 +./fortran/src/H5Off.F90 ./fortran/src/H5Pf.c -./fortran/src/H5Pff.f90 -./fortran/src/H5Pff_F90.f90 -./fortran/src/H5Pff_F03.f90 +./fortran/src/H5Pff.F90 ./fortran/src/H5Rf.c -./fortran/src/H5Rff.f90 -./fortran/src/H5Rff_F90.f90 -./fortran/src/H5Rff_F03.f90 +./fortran/src/H5Rff.F90 ./fortran/src/H5Sf.c -./fortran/src/H5Sff.f90 +./fortran/src/H5Sff.F90 ./fortran/src/H5Tf.c -./fortran/src/H5Tff.f90 -./fortran/src/H5Tff_F90.f90 -./fortran/src/H5Tff_F03.f90 +./fortran/src/H5Tff.F90 ./fortran/src/H5Zf.c -./fortran/src/H5Zff.f90 +./fortran/src/H5Zff.F90 ./fortran/src/H5f90.h -./fortran/src/H5f90global.f90 +./fortran/src/H5f90global.F90 ./fortran/src/H5f90i.h ./fortran/src/H5f90kit.c ./fortran/src/H5f90proto.h -./fortran/src/H5test_kind.f90 -./fortran/src/H5test_kind_SIZEOF.f90 -./fortran/src/H5test_kind_STORAGE_SIZE.f90 +./fortran/src/H5_buildiface.F90 ./fortran/src/H5match_types.c -./fortran/src/HDF5.f90 -./fortran/src/HDF5mpio.f90 +./fortran/src/HDF5.F90 +./fortran/src/H5config_f.inc.in +./fortran/src/H5config_f.inc.cmake +./fortran/src/H5fort_type_defines.h.in ./fortran/src/Makefile.am ./fortran/src/Makefile.in ./fortran/src/README @@ -348,12 +241,10 @@ ./fortran/test/fortranlib_test.f90 ./fortran/test/fortranlib_test_1_8.f90 ./fortran/test/fortranlib_test_F03.f90 +./fortran/test/H5_test_buildiface.F90 ./fortran/test/t.c ./fortran/test/t.h -./fortran/test/tf.f90 -./fortran/test/tf_F90.f90 -./fortran/test/tf_F03.f90 -./fortran/test/tf_F08.f90 +./fortran/test/tf.F90 ./fortran/test/tH5A.f90 ./fortran/test/tH5A_1_8.f90 ./fortran/test/tH5D.f90 @@ -373,7 +264,7 @@ ./fortran/test/tH5R.f90 ./fortran/test/tH5S.f90 ./fortran/test/tH5Sselect.f90 -./fortran/test/tH5T_F03.f90 +./fortran/test/tH5T_F03.F90 ./fortran/test/tH5T.f90 ./fortran/test/tH5VL.f90 ./fortran/test/tH5Z.f90 @@ -2354,25 +2245,27 @@ ./hl/fortran/examples/ex_ds1.f90 ./hl/fortran/examples/exlite.f90 ./hl/fortran/examples/run-hlfortran-ex.sh.in +./hl/fortran/src/hdf5_hl_fortrandll.def.in ./hl/fortran/src/H5DSfc.c -./hl/fortran/src/H5DSff.f90 +./hl/fortran/src/H5DSff.F90 ./hl/fortran/src/H5IMcc.c ./hl/fortran/src/H5IMcc.h ./hl/fortran/src/H5IMfc.c -./hl/fortran/src/H5IMff.f90 +./hl/fortran/src/H5IMff.F90 +./hl/fortran/src/H5HL_buildiface.F90 ./hl/fortran/src/H5LTf90proto.h ./hl/fortran/src/H5LTfc.c -./hl/fortran/src/H5LTff.f90 +./hl/fortran/src/H5LTff.F90 ./hl/fortran/src/H5TBfc.c -./hl/fortran/src/H5TBff.f90 +./hl/fortran/src/H5TBff.F90 ./hl/fortran/src/Makefile.am ./hl/fortran/src/Makefile.in ./hl/fortran/test/Makefile.am ./hl/fortran/test/Makefile.in -./hl/fortran/test/tstds.f90 -./hl/fortran/test/tstimage.f90 -./hl/fortran/test/tstlite.f90 -./hl/fortran/test/tsttable.f90 +./hl/fortran/test/tstds.F90 +./hl/fortran/test/tstimage.F90 +./hl/fortran/test/tstlite.F90 +./hl/fortran/test/tsttable.F90 # hl c++ ./hl/c++/COPYING @@ -2404,6 +2297,7 @@ ./config/cmake/hdf5-config-version.cmake.in ./config/cmake/HDFCompilerFlags.cmake ./config/cmake/HDF5Macros.cmake +./config/cmake/HDF5UseFortran.cmake ./config/cmake/libhdf5.settings.cmake.in ./config/cmake/mccacheinit.cmake ./config/cmake/patch.xml diff --git a/Makefile.in b/Makefile.in index edee230..ce0c833 100644 --- a/Makefile.in +++ b/Makefile.in @@ -128,7 +128,8 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(SHELL) $(top_srcdir)/bin/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/src/H5config.h +CONFIG_HEADER = $(top_builddir)/src/H5config.h \ + $(top_builddir)/fortran/src/H5config_f.inc CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) @@ -288,14 +289,21 @@ F9XMODEXT = @F9XMODEXT@ F9XMODFLAG = @F9XMODFLAG@ F9XSUFFIXFLAG = @F9XSUFFIXFLAG@ FC = @FC@ -FC2003 = @FC2003@ FCFLAGS = @FCFLAGS@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ +FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ +FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ +FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ +H5CONFIG_F_IKIND = @H5CONFIG_F_IKIND@ +H5CONFIG_F_NUM_IKIND = @H5CONFIG_F_NUM_IKIND@ +H5CONFIG_F_NUM_RKIND = @H5CONFIG_F_NUM_RKIND@ +H5CONFIG_F_RKIND = @H5CONFIG_F_RKIND@ +H5CONFIG_F_RKIND_SIZEOF = @H5CONFIG_F_RKIND_SIZEOF@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ @@ -305,13 +313,12 @@ H5_LDFLAGS = @H5_LDFLAGS@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ -HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_Fortran_INTEGER_SIZEOF_16 = @HAVE_Fortran_INTEGER_SIZEOF_16@ HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ HDF_FORTRAN = @HDF_FORTRAN@ -HDF_FORTRAN2003 = @HDF_FORTRAN2003@ HID_T = @HID_T@ HL = @HL@ HL_FOR = @HL_FOR@ @@ -353,6 +360,18 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PAC_C_MAX_REAL_PRECISION = @PAC_C_MAX_REAL_PRECISION@ +PAC_FC_ALL_INTEGER_KINDS = @PAC_FC_ALL_INTEGER_KINDS@ +PAC_FC_ALL_INTEGER_KINDS_SIZEOF = @PAC_FC_ALL_INTEGER_KINDS_SIZEOF@ +PAC_FC_ALL_REAL_KINDS = @PAC_FC_ALL_REAL_KINDS@ +PAC_FC_ALL_REAL_KINDS_SIZEOF = @PAC_FC_ALL_REAL_KINDS_SIZEOF@ +PAC_FC_MAX_REAL_PRECISION = @PAC_FC_MAX_REAL_PRECISION@ +PAC_FORTRAN_NATIVE_DOUBLE_KIND = @PAC_FORTRAN_NATIVE_DOUBLE_KIND@ +PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF = @PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF@ +PAC_FORTRAN_NATIVE_INTEGER_KIND = @PAC_FORTRAN_NATIVE_INTEGER_KIND@ +PAC_FORTRAN_NATIVE_INTEGER_SIZEOF = @PAC_FORTRAN_NATIVE_INTEGER_SIZEOF@ +PAC_FORTRAN_NATIVE_REAL_KIND = @PAC_FORTRAN_NATIVE_REAL_KIND@ +PAC_FORTRAN_NATIVE_REAL_SIZEOF = @PAC_FORTRAN_NATIVE_REAL_SIZEOF@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ diff --git a/c++/Makefile.in b/c++/Makefile.in index c964e95..2315cc2 100644 --- a/c++/Makefile.in +++ b/c++/Makefile.in @@ -106,7 +106,8 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/aclocal_cxx.m4 \ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/bin/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/src/H5config.h +CONFIG_HEADER = $(top_builddir)/src/H5config.h \ + $(top_builddir)/fortran/src/H5config_f.inc CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) @@ -448,14 +449,21 @@ F9XMODEXT = @F9XMODEXT@ F9XMODFLAG = @F9XMODFLAG@ F9XSUFFIXFLAG = @F9XSUFFIXFLAG@ FC = @FC@ -FC2003 = @FC2003@ FCFLAGS = @FCFLAGS@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ +FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ +FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ +FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ +H5CONFIG_F_IKIND = @H5CONFIG_F_IKIND@ +H5CONFIG_F_NUM_IKIND = @H5CONFIG_F_NUM_IKIND@ +H5CONFIG_F_NUM_RKIND = @H5CONFIG_F_NUM_RKIND@ +H5CONFIG_F_RKIND = @H5CONFIG_F_RKIND@ +H5CONFIG_F_RKIND_SIZEOF = @H5CONFIG_F_RKIND_SIZEOF@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ @@ -465,13 +473,12 @@ H5_LDFLAGS = @H5_LDFLAGS@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ -HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_Fortran_INTEGER_SIZEOF_16 = @HAVE_Fortran_INTEGER_SIZEOF_16@ HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ HDF_FORTRAN = @HDF_FORTRAN@ -HDF_FORTRAN2003 = @HDF_FORTRAN2003@ HID_T = @HID_T@ HL = @HL@ HL_FOR = @HL_FOR@ @@ -513,6 +520,18 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PAC_C_MAX_REAL_PRECISION = @PAC_C_MAX_REAL_PRECISION@ +PAC_FC_ALL_INTEGER_KINDS = @PAC_FC_ALL_INTEGER_KINDS@ +PAC_FC_ALL_INTEGER_KINDS_SIZEOF = @PAC_FC_ALL_INTEGER_KINDS_SIZEOF@ +PAC_FC_ALL_REAL_KINDS = @PAC_FC_ALL_REAL_KINDS@ +PAC_FC_ALL_REAL_KINDS_SIZEOF = @PAC_FC_ALL_REAL_KINDS_SIZEOF@ +PAC_FC_MAX_REAL_PRECISION = @PAC_FC_MAX_REAL_PRECISION@ +PAC_FORTRAN_NATIVE_DOUBLE_KIND = @PAC_FORTRAN_NATIVE_DOUBLE_KIND@ +PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF = @PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF@ +PAC_FORTRAN_NATIVE_INTEGER_KIND = @PAC_FORTRAN_NATIVE_INTEGER_KIND@ +PAC_FORTRAN_NATIVE_INTEGER_SIZEOF = @PAC_FORTRAN_NATIVE_INTEGER_SIZEOF@ +PAC_FORTRAN_NATIVE_REAL_KIND = @PAC_FORTRAN_NATIVE_REAL_KIND@ +PAC_FORTRAN_NATIVE_REAL_SIZEOF = @PAC_FORTRAN_NATIVE_REAL_SIZEOF@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ diff --git a/c++/examples/Makefile.in b/c++/examples/Makefile.in index 03bd135..6b0f894 100644 --- a/c++/examples/Makefile.in +++ b/c++/examples/Makefile.in @@ -112,7 +112,8 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/aclocal_cxx.m4 \ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/bin/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/src/H5config.h +CONFIG_HEADER = $(top_builddir)/src/H5config.h \ + $(top_builddir)/fortran/src/H5config_f.inc CONFIG_CLEAN_FILES = run-c++-ex.sh testh5c++.sh CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) @@ -396,14 +397,21 @@ F9XMODEXT = @F9XMODEXT@ F9XMODFLAG = @F9XMODFLAG@ F9XSUFFIXFLAG = @F9XSUFFIXFLAG@ FC = @FC@ -FC2003 = @FC2003@ FCFLAGS = @FCFLAGS@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ +FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ +FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ +FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ +H5CONFIG_F_IKIND = @H5CONFIG_F_IKIND@ +H5CONFIG_F_NUM_IKIND = @H5CONFIG_F_NUM_IKIND@ +H5CONFIG_F_NUM_RKIND = @H5CONFIG_F_NUM_RKIND@ +H5CONFIG_F_RKIND = @H5CONFIG_F_RKIND@ +H5CONFIG_F_RKIND_SIZEOF = @H5CONFIG_F_RKIND_SIZEOF@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ @@ -413,13 +421,12 @@ H5_LDFLAGS = @H5_LDFLAGS@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ -HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_Fortran_INTEGER_SIZEOF_16 = @HAVE_Fortran_INTEGER_SIZEOF_16@ HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ HDF_FORTRAN = @HDF_FORTRAN@ -HDF_FORTRAN2003 = @HDF_FORTRAN2003@ HID_T = @HID_T@ HL = @HL@ HL_FOR = @HL_FOR@ @@ -461,6 +468,18 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PAC_C_MAX_REAL_PRECISION = @PAC_C_MAX_REAL_PRECISION@ +PAC_FC_ALL_INTEGER_KINDS = @PAC_FC_ALL_INTEGER_KINDS@ +PAC_FC_ALL_INTEGER_KINDS_SIZEOF = @PAC_FC_ALL_INTEGER_KINDS_SIZEOF@ +PAC_FC_ALL_REAL_KINDS = @PAC_FC_ALL_REAL_KINDS@ +PAC_FC_ALL_REAL_KINDS_SIZEOF = @PAC_FC_ALL_REAL_KINDS_SIZEOF@ +PAC_FC_MAX_REAL_PRECISION = @PAC_FC_MAX_REAL_PRECISION@ +PAC_FORTRAN_NATIVE_DOUBLE_KIND = @PAC_FORTRAN_NATIVE_DOUBLE_KIND@ +PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF = @PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF@ +PAC_FORTRAN_NATIVE_INTEGER_KIND = @PAC_FORTRAN_NATIVE_INTEGER_KIND@ +PAC_FORTRAN_NATIVE_INTEGER_SIZEOF = @PAC_FORTRAN_NATIVE_INTEGER_SIZEOF@ +PAC_FORTRAN_NATIVE_REAL_KIND = @PAC_FORTRAN_NATIVE_REAL_KIND@ +PAC_FORTRAN_NATIVE_REAL_SIZEOF = @PAC_FORTRAN_NATIVE_REAL_SIZEOF@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ diff --git a/c++/src/Makefile.in b/c++/src/Makefile.in index 5dff737..c2daa56 100644 --- a/c++/src/Makefile.in +++ b/c++/src/Makefile.in @@ -111,7 +111,8 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/aclocal_cxx.m4 \ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/bin/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/src/H5config.h +CONFIG_HEADER = $(top_builddir)/src/H5config.h \ + $(top_builddir)/fortran/src/H5config_f.inc CONFIG_CLEAN_FILES = h5c++ CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; @@ -174,7 +175,7 @@ AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = -DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src -I$(top_builddir)/fortran/src depcomp = $(SHELL) $(top_srcdir)/bin/depcomp am__depfiles_maybe = depfiles am__mv = mv -f @@ -459,14 +460,21 @@ F9XMODEXT = @F9XMODEXT@ F9XMODFLAG = @F9XMODFLAG@ F9XSUFFIXFLAG = @F9XSUFFIXFLAG@ FC = @FC@ -FC2003 = @FC2003@ FCFLAGS = @FCFLAGS@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ +FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ +FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ +FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ +H5CONFIG_F_IKIND = @H5CONFIG_F_IKIND@ +H5CONFIG_F_NUM_IKIND = @H5CONFIG_F_NUM_IKIND@ +H5CONFIG_F_NUM_RKIND = @H5CONFIG_F_NUM_RKIND@ +H5CONFIG_F_RKIND = @H5CONFIG_F_RKIND@ +H5CONFIG_F_RKIND_SIZEOF = @H5CONFIG_F_RKIND_SIZEOF@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ @@ -476,13 +484,12 @@ H5_LDFLAGS = @H5_LDFLAGS@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ -HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_Fortran_INTEGER_SIZEOF_16 = @HAVE_Fortran_INTEGER_SIZEOF_16@ HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ HDF_FORTRAN = @HDF_FORTRAN@ -HDF_FORTRAN2003 = @HDF_FORTRAN2003@ HID_T = @HID_T@ HL = @HL@ HL_FOR = @HL_FOR@ @@ -524,6 +531,18 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PAC_C_MAX_REAL_PRECISION = @PAC_C_MAX_REAL_PRECISION@ +PAC_FC_ALL_INTEGER_KINDS = @PAC_FC_ALL_INTEGER_KINDS@ +PAC_FC_ALL_INTEGER_KINDS_SIZEOF = @PAC_FC_ALL_INTEGER_KINDS_SIZEOF@ +PAC_FC_ALL_REAL_KINDS = @PAC_FC_ALL_REAL_KINDS@ +PAC_FC_ALL_REAL_KINDS_SIZEOF = @PAC_FC_ALL_REAL_KINDS_SIZEOF@ +PAC_FC_MAX_REAL_PRECISION = @PAC_FC_MAX_REAL_PRECISION@ +PAC_FORTRAN_NATIVE_DOUBLE_KIND = @PAC_FORTRAN_NATIVE_DOUBLE_KIND@ +PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF = @PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF@ +PAC_FORTRAN_NATIVE_INTEGER_KIND = @PAC_FORTRAN_NATIVE_INTEGER_KIND@ +PAC_FORTRAN_NATIVE_INTEGER_SIZEOF = @PAC_FORTRAN_NATIVE_INTEGER_SIZEOF@ +PAC_FORTRAN_NATIVE_REAL_KIND = @PAC_FORTRAN_NATIVE_REAL_KIND@ +PAC_FORTRAN_NATIVE_REAL_SIZEOF = @PAC_FORTRAN_NATIVE_REAL_SIZEOF@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ diff --git a/c++/test/Makefile.in b/c++/test/Makefile.in index 8711eef..0da1d86 100644 --- a/c++/test/Makefile.in +++ b/c++/test/Makefile.in @@ -108,7 +108,8 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/aclocal_cxx.m4 \ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/bin/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/src/H5config.h +CONFIG_HEADER = $(top_builddir)/src/H5config.h \ + $(top_builddir)/fortran/src/H5config_f.inc CONFIG_CLEAN_FILES = H5srcdir_str.h CONFIG_CLEAN_VPATH_FILES = am__EXEEXT_1 = testhdf5$(EXEEXT) @@ -136,7 +137,7 @@ AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = -DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src -I$(top_builddir)/fortran/src depcomp = $(SHELL) $(top_srcdir)/bin/depcomp am__depfiles_maybe = depfiles am__mv = mv -f @@ -450,14 +451,21 @@ F9XMODEXT = @F9XMODEXT@ F9XMODFLAG = @F9XMODFLAG@ F9XSUFFIXFLAG = @F9XSUFFIXFLAG@ FC = @FC@ -FC2003 = @FC2003@ FCFLAGS = @FCFLAGS@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ +FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ +FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ +FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ +H5CONFIG_F_IKIND = @H5CONFIG_F_IKIND@ +H5CONFIG_F_NUM_IKIND = @H5CONFIG_F_NUM_IKIND@ +H5CONFIG_F_NUM_RKIND = @H5CONFIG_F_NUM_RKIND@ +H5CONFIG_F_RKIND = @H5CONFIG_F_RKIND@ +H5CONFIG_F_RKIND_SIZEOF = @H5CONFIG_F_RKIND_SIZEOF@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ @@ -467,13 +475,12 @@ H5_LDFLAGS = @H5_LDFLAGS@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ -HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_Fortran_INTEGER_SIZEOF_16 = @HAVE_Fortran_INTEGER_SIZEOF_16@ HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ HDF_FORTRAN = @HDF_FORTRAN@ -HDF_FORTRAN2003 = @HDF_FORTRAN2003@ HID_T = @HID_T@ HL = @HL@ HL_FOR = @HL_FOR@ @@ -515,6 +522,18 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PAC_C_MAX_REAL_PRECISION = @PAC_C_MAX_REAL_PRECISION@ +PAC_FC_ALL_INTEGER_KINDS = @PAC_FC_ALL_INTEGER_KINDS@ +PAC_FC_ALL_INTEGER_KINDS_SIZEOF = @PAC_FC_ALL_INTEGER_KINDS_SIZEOF@ +PAC_FC_ALL_REAL_KINDS = @PAC_FC_ALL_REAL_KINDS@ +PAC_FC_ALL_REAL_KINDS_SIZEOF = @PAC_FC_ALL_REAL_KINDS_SIZEOF@ +PAC_FC_MAX_REAL_PRECISION = @PAC_FC_MAX_REAL_PRECISION@ +PAC_FORTRAN_NATIVE_DOUBLE_KIND = @PAC_FORTRAN_NATIVE_DOUBLE_KIND@ +PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF = @PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF@ +PAC_FORTRAN_NATIVE_INTEGER_KIND = @PAC_FORTRAN_NATIVE_INTEGER_KIND@ +PAC_FORTRAN_NATIVE_INTEGER_SIZEOF = @PAC_FORTRAN_NATIVE_INTEGER_SIZEOF@ +PAC_FORTRAN_NATIVE_REAL_KIND = @PAC_FORTRAN_NATIVE_REAL_KIND@ +PAC_FORTRAN_NATIVE_REAL_SIZEOF = @PAC_FORTRAN_NATIVE_REAL_SIZEOF@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ diff --git a/config/cmake/ConfigureChecks.cmake b/config/cmake/ConfigureChecks.cmake index 09f1caf..b9f18a9 100644 --- a/config/cmake/ConfigureChecks.cmake +++ b/config/cmake/ConfigureChecks.cmake @@ -158,6 +158,17 @@ if (NOT WINDOWS) endif (HDF5_ENABLE_DIRECT_VFD) endif (NOT WINDOWS) +#----------------------------------------------------------------------------- +# Check if C has __float128 extension +#----------------------------------------------------------------------------- + +CHECK_TYPE_SIZE("__float128" SIZEOF___FLOAT128) +if(${HAVE_SIZEOF___FLOAT128}) + SET(H5_HAVE_FLOAT128 1) +else (${HAVE_SIZEOF___FLOAT128}) + SET(H5_HAVE_FLOAT128 0) + SET(SIZEOF___FLOAT128 0) +endif(${HAVE_SIZEOF___FLOAT128}) #----------------------------------------------------------------------------- # Macro to determine the various conversion capabilities diff --git a/config/cmake/H5pubconf.h.in b/config/cmake/H5pubconf.h.in index af9afde..37bcfbf 100644 --- a/config/cmake/H5pubconf.h.in +++ b/config/cmake/H5pubconf.h.in @@ -45,6 +45,18 @@ /* As FC_FUNC, but for C identifiers containing underscores. */ #define @H5_FC_FUNC_@ +/* Define Fortran Maximum Real Decimal Precision */ +#cmakedefine H5_PAC_FC_MAX_REAL_PRECISION @H5_PAC_FC_MAX_REAL_PRECISION@ + +/* Define C Maximum Real Decimal Precision */ +#cmakedefine H5_PAC_C_MAX_REAL_PRECISION @H5_PAC_C_MAX_REAL_PRECISION@ + +/* Define if we have Fortran C_LONG_DOUBLE */ +#cmakedefine H5_FORTRAN_HAVE_C_LONG_DOUBLE @H5_FORTRAN_HAVE_C_LONG_DOUBLE@ + +/* Determine if __float128 is available */ +#cmakedefine H5_HAVE_FLOAT128 @H5_HAVE_FLOAT128@ + /* Define to 1 if you have the `alarm' function. */ #cmakedefine H5_HAVE_ALARM @H5_HAVE_ALARM@ diff --git a/config/cmake/HDF518_Examples.cmake.in b/config/cmake/HDF518_Examples.cmake.in index febf20a..c82fcf2 100644 --- a/config/cmake/HDF518_Examples.cmake.in +++ b/config/cmake/HDF518_Examples.cmake.in @@ -13,7 +13,6 @@ set(CTEST_DASHBOARD_ROOT ${CTEST_SCRIPT_DIRECTORY}) set(CTEST_BUILD_CONFIGURATION "Release") #set(NO_MAC_FORTRAN "true") #set(BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF_BUILD_FORTRAN:BOOL=ON") -set(BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF_ENABLE_F2003:BOOL=ON") #set(CTEST_USE_TAR_SOURCE "${CTEST_SCRIPT_ARG}") ############################################################################################################### @@ -123,4 +122,4 @@ if(res GREATER 0) endif(res GREATER 0) #----------------------------------------------------------------------------- ############################################################################################################## -message(STATUS "DONE") \ No newline at end of file +message(STATUS "DONE") diff --git a/config/cmake/HDF5UseFortran.cmake b/config/cmake/HDF5UseFortran.cmake new file mode 100644 index 0000000..b3dec14 --- /dev/null +++ b/config/cmake/HDF5UseFortran.cmake @@ -0,0 +1,491 @@ + +## Check for non-standard extenstion quadmath.h + +CHECK_INCLUDE_FILES(quadmath.h C_HAVE_QUADMATH) + +if (${C_HAVE_QUADMATH}) + set(HAVE_QUADMATH 1) +else () + set(HAVE_QUADMATH 0) +endif() + +# +# This file provides functions for HDF5 specific Fortran support. +# +#------------------------------------------------------------------------------- +ENABLE_LANGUAGE (Fortran) + +# The provided CMake Fortran macros don't provide a general compile/run function +# so this one is used. +#----------------------------------------------------------------------------- +MACRO (FORTRAN_RUN FUNCTION CODE RUN_RESULT_VAR1 COMPILE_RESULT_VAR RETURN) +# MSB CHECK WHY THIS CHECK? +# if (NOT DEFINED ${RUN_RESULT_VAR}) + message (STATUS "Detecting Fortran ${FUNCTION}") + if (CMAKE_REQUIRED_LIBRARIES) + set (CHECK_FUNCTION_EXISTS_ADD_LIBRARIES + "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}") + else (CMAKE_REQUIRED_LIBRARIES) + set (CHECK_FUNCTION_EXISTS_ADD_LIBRARIES) + endif (CMAKE_REQUIRED_LIBRARIES) + file (WRITE + ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompiler1.f90 + "${CODE}" + ) + TRY_RUN (RUN_RESULT_VAR COMPILE_RESULT_VAR + ${CMAKE_BINARY_DIR} + ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompiler1.f90 + CMAKE_FLAGS "${CHECK_FUNCTION_EXISTS_ADD_LIBRARIES}" + RUN_OUTPUT_VARIABLE OUTPUT + ) + + + + set(${RETURN} ${OUTPUT}) + + #message ( "Test result1 ${RETURN} ") + #message ( "Test result3 ${RESULT} ") + #message ( "Test result2 ${CMAKE_MATCH_0} ") + #message ( "Test result4 ${CMAKE_MATCH_1} ") + #message ( "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ") + #message ( "Test result2 ${COMPILE_RESULT_VAR} ") + #message ( "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ") + #message ( "Test result1 ${RUN_RESULT_VAR} ") + #message ( "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ") + + if (${COMPILE_RESULT_VAR}) + if (${RUN_RESULT_VAR} MATCHES 0) + message (STATUS "Testing Fortran ${FUNCTION} - OK") + file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + "Determining if the Fortran ${FUNCTION} exists passed with the following output:\n" + "${OUTPUT}\n\n" + ) + else () + message (STATUS "Testing Fortran ${FUNCTION} - Fail") + file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log + "Determining if the Fortran ${FUNCTION} exists failed with the following output:\n" + "${OUTPUT}\n\n") + endif () + endif () +# endif (NOT DEFINED ${RUN_RESULT_VAR}) +ENDMACRO (FORTRAN_RUN) + +#----------------------------------------------------------------------------- +# Check to see C_LONG_DOUBLE is available +CHECK_FORTRAN_FEATURE(c_long_double + " + PROGRAM main + USE ISO_C_BINDING + REAL(KIND=C_LONG_DOUBLE) :: d + END PROGRAM + " + FORTRAN_HAVE_C_LONG_DOUBLE +) +if (${FORTRAN_HAVE_C_LONG_DOUBLE}) + set(FORTRAN_HAVE_C_LONG_DOUBLE 1) +else () + set(FORTRAN_HAVE_C_LONG_DOUBLE 0) +endif() + +# Check to see C_LONG_DOUBLE is different from C_DOUBLE + +CHECK_FORTRAN_FEATURE(c_long_double + " + MODULE type_mod + USE ISO_C_BINDING + INTERFACE h5t + MODULE PROCEDURE h5t_c_double + MODULE PROCEDURE h5t_c_long_double + END INTERFACE + CONTAINS + SUBROUTINE h5t_c_double(r) + REAL(KIND=C_DOUBLE) :: r + END SUBROUTINE h5t_c_double + SUBROUTINE h5t_c_long_double(d) + REAL(KIND=C_LONG_DOUBLE) :: d + END SUBROUTINE h5t_c_long_double + END MODULE type_mod + PROGRAM main + USE ISO_C_BINDING + USE type_mod + REAL(KIND=C_DOUBLE) :: r + REAL(KIND=C_LONG_DOUBLE) :: d + CALL h5t(r) + CALL h5t(d) + END PROGRAM main + " + FORTRAN_C_LONG_DOUBLE_IS_UNIQUE +) +if (${FORTRAN_C_LONG_DOUBLE_IS_UNIQUE}) + set(FORTRAN_C_LONG_DOUBLE_IS_UNIQUE 1) +else () + set(FORTRAN_C_LONG_DOUBLE_IS_UNIQUE 0) +endif() + +## Set the sizeof function for use later in the fortran tests +if(FORTRAN_HAVE_STORAGE_SIZE) + set(FC_SIZEOF_A "STORAGE_SIZE(a, c_size_t)/STORAGE_SIZE(c_char_'a',c_size_t)") + set(FC_SIZEOF_B "STORAGE_SIZE(b, c_size_t)/STORAGE_SIZE(c_char_'a',c_size_t)") + set(FC_SIZEOF_C "STORAGE_SIZE(c, c_size_t)/STORAGE_SIZE(c_char_'a',c_size_t)") +elseif(FORTRAN_HAVE_C_SIZEOF) + set(FC_SIZEOF_A "SIZEOF(a)") + set(FC_SIZEOF_B "SIZEOF(b)") + set(FC_SIZEOF_C "SIZEOF(c)") +else(FORTRAN_HAVE_STORAGE_SIZE) + message (FATAL_ERROR "Fortran compiler requires either intrinsic functions SIZEOF or STORAGE_SIZE") +endif(FORTRAN_HAVE_STORAGE_SIZE) + +#----------------------------------------------------------------------------- +# Determine the available KINDs for REALs and INTEGERs +#----------------------------------------------------------------------------- + +FORTRAN_RUN("REAL and INTEGER KINDs" + " + PROGRAM main + IMPLICIT NONE + INTEGER :: ik, k, lastkind, max_decimal_prec + INTEGER :: num_rkinds, num_ikinds + num_ikinds = 0 + lastkind=SELECTED_INT_KIND(1) + ! Find integer KINDs + DO ik=2,36 + k = SELECTED_INT_KIND(ik) + IF (k .NE. lastkind) THEN + num_ikinds = num_ikinds + 1 + WRITE(*,'(I0)',ADVANCE='NO') lastkind + lastkind = k + IF(k.GT.0) WRITE(*,'(A)',ADVANCE='NO') ',' + ENDIF + IF (k .LE. 0) EXIT + ENDDO + IF (lastkind.NE.-1) THEN + num_ikinds = num_ikinds + 1 + WRITE(*,'(I0)') lastkind + ELSE + WRITE(*,'()') + ENDIF + ! Find real KINDs + num_rkinds = 0 + lastkind=SELECTED_REAL_KIND(1) + max_decimal_prec = 1 + DO ik=2,36 + k = SELECTED_REAL_KIND(ik) + IF (k .NE. lastkind) THEN + num_rkinds = num_rkinds + 1 + WRITE(*,'(I0)',ADVANCE='NO') lastkind + lastkind = k + IF(k.GT.0) WRITE(*,'(A)',ADVANCE='NO') ',' + max_decimal_prec = ik + ENDIF + IF (k .LE. 0) EXIT + ENDDO + IF (lastkind.NE.-1)THEN + num_rkinds = num_rkinds + 1 + WRITE(*,'(I0)') lastkind + ELSE + WRITE(*,'()') + ENDIF + WRITE(*,'(I0)') max_decimal_prec + WRITE(*,'(I0)') num_ikinds + WRITE(*,'(I0)') num_rkinds + END + " + XX + YY + PROG_OUTPUT +) +# dnl The output from the above program will be: +# dnl -- LINE 1 -- valid integer kinds (comma seperated list) +# dnl -- LINE 2 -- valid real kinds (comma seperated list) +# dnl -- LINE 3 -- max decimal precision for reals +# dnl -- LINE 4 -- number of valid integer kinds +# dnl -- LINE 5 -- number of valid real kinds + +# Convert the string to a list of strings by replacing the carriage return with a semicolon +string(REGEX REPLACE "\n" ";" PROG_OUTPUT "${PROG_OUTPUT}") + +list(GET PROG_OUTPUT 0 pac_validIntKinds) +list(GET PROG_OUTPUT 1 pac_validRealKinds) +list(GET PROG_OUTPUT 2 H5_PAC_FC_MAX_REAL_PRECISION) + +set(PAC_FC_ALL_INTEGER_KINDS "\{${pac_validIntKinds}\}") +set(PAC_FC_ALL_REAL_KINDS "\{${pac_validRealKinds}\}") + +list(GET PROG_OUTPUT 3 NUM_IKIND) +list(GET PROG_OUTPUT 4 NUM_RKIND) + +set(H5CONFIG_F_NUM_IKIND "INTEGER, PARAMETER :: num_ikinds = ${NUM_IKIND}") +set(H5CONFIG_F_IKIND "INTEGER, DIMENSION(1:num_ikinds) :: ikind = (/${pac_validIntKinds}/)") + +message ( " ........REAL KINDS FOUND ${PAC_FC_ALL_REAL_KINDS}") +message ( " ........INTEGER KINDS FOUND ${PAC_FC_ALL_REAL_KINDS}") +message ( " ........MAX DECIMAL PRECISION ${H5_PAC_FC_MAX_REAL_PRECISION}") + +#----------------------------------------------------------------------------- +# Determine the available KINDs for REALs and INTEGERs +#----------------------------------------------------------------------------- +# ********** +# INTEGERS +# ********** +string(REGEX REPLACE "," ";" VAR_KIND "${pac_validIntKinds}") + +foreach( KIND ${VAR_KIND} ) + set(PROG_SRC + " + PROGRAM main + USE ISO_C_BINDING + IMPLICIT NONE + INTEGER (KIND=${KIND}) a + WRITE(*,'(I0)') ${FC_SIZEOF_A} + END + " + ) + FORTRAN_RUN("INTEGER KIND SIZEOF" ${PROG_SRC} + XX + YY + PROG_OUTPUT1 + ) + string(REGEX REPLACE "\n" "" PROG_OUTPUT1 "${PROG_OUTPUT1}") + set(pack_int_sizeof "${pack_int_sizeof} ${PROG_OUTPUT1},") +endforeach(KIND) +string(STRIP ${pack_int_sizeof} pack_int_sizeof) + + +#Remove trailing comma +string(REGEX REPLACE ",$" "" pack_int_sizeof "${pack_int_sizeof}") +#Remove spaces +string(REGEX REPLACE " " "" pack_int_sizeof "${pack_int_sizeof}") + +set(PAC_FC_ALL_INTEGER_KINDS_SIZEOF "\{${pack_int_sizeof}\}") + +message("...FOUND SIZEOF for INTEGER KINDs ${PAC_FC_ALL_INTEGER_KINDS_SIZEOF}") +# ********** +# REALS +# ********** +string(REGEX REPLACE "," ";" VAR_KIND "${pac_validRealKinds}") + +#find the maximum kind of the real +list(LENGTH VAR_KIND LEN_VAR_KIND) +MATH (EXPR _LEN "${LEN_VAR_KIND} - 1") +list(GET VAR_KIND ${_LEN} max_real_fortran_kind) + +foreach( KIND ${VAR_KIND} ) + set(PROG_SRC + " + PROGRAM main + USE ISO_C_BINDING + IMPLICIT NONE + REAL (KIND=${KIND}) a + WRITE(*,'(I0)') ${FC_SIZEOF_A} + END + " + ) + FORTRAN_RUN("REAL KIND SIZEOF" ${PROG_SRC} + XX + YY + PROG_OUTPUT1 + ) + string(REGEX REPLACE "\n" "" PROG_OUTPUT1 "${PROG_OUTPUT1}") + set(pack_real_sizeof "${pack_real_sizeof} ${PROG_OUTPUT1},") +endforeach(KIND) +string(STRIP ${pack_real_sizeof} pack_real_sizeof) + +#Remove trailing comma +string(REGEX REPLACE ",$" "" pack_real_sizeof "${pack_real_sizeof}") +#Remove spaces +string(REGEX REPLACE " " "" pack_real_sizeof "${pack_real_sizeof}") + +set(H5CONFIG_F_RKIND_SIZEOF "INTEGER, DIMENSION(1:num_rkinds) :: rkind_sizeof = (/${pack_real_sizeof}/)") + +message("...FOUND SIZEOF for REAL KINDs \{${pack_real_sizeof}\}") + +#find the maximum kind of the real +list(LENGTH VAR_KIND LEN_VAR_KIND) +MATH (EXPR _LEN "${LEN_VAR_KIND} - 1") +list(GET VAR_KIND ${_LEN} max_real_fortran_sizeof) + +set(PAC_FC_ALL_REAL_KINDS_SIZEOF "\{${pack_real_sizeof}\}") +#----------------------------------------------------------------------------- +# Find sizeof of native kinds +#----------------------------------------------------------------------------- +FORTRAN_RUN("SIZEOF NATIVE KINDs" + " + PROGRAM main + USE ISO_C_BINDING + IMPLICIT NONE + INTEGER a + REAL b + DOUBLE PRECISION c + WRITE(*,*) ${FC_SIZEOF_A} + WRITE(*,*) kind(a) + WRITE(*,*) ${FC_SIZEOF_B} + WRITE(*,*) kind(b) + WRITE(*,*) ${FC_SIZEOF_C} + WRITE(*,*) kind(c) + END + " + XX + YY + PROG_OUTPUT +) +# dnl The output from the above program will be: +# dnl -- LINE 1 -- sizeof INTEGER +# dnl -- LINE 2 -- kind of INTEGER +# dnl -- LINE 3 -- sizeof REAL +# dnl -- LINE 4 -- kind of REAL +# dnl -- LINE 5 -- sizeof DOUBLE PRECISION +# dnl -- LINE 6 -- kind of DOUBLE PRECISION + +# Convert the string to a list of strings by replacing the carriage return with a semicolon +string(REGEX REPLACE "\n" ";" PROG_OUTPUT "${PROG_OUTPUT}") + +list(GET PROG_OUTPUT 0 PAC_FORTRAN_NATIVE_INTEGER_SIZEOF) +list(GET PROG_OUTPUT 1 PAC_FORTRAN_NATIVE_INTEGER_KIND) +list(GET PROG_OUTPUT 2 PAC_FORTRAN_NATIVE_REAL_SIZEOF) +list(GET PROG_OUTPUT 3 PAC_FORTRAN_NATIVE_REAL_KIND) +list(GET PROG_OUTPUT 4 PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF) +list(GET PROG_OUTPUT 5 PAC_FORTRAN_NATIVE_DOUBLE_KIND) + +set(FORTRAN_SIZEOF_LONG_DOUBLE ${${HDF_PREFIX}_SIZEOF_LONG_DOUBLE}) +#set(H5_SIZEOF_LONG_DOUBLE ${${HDF_PREFIX}_SIZEOF_LONG_DOUBLE}) + +# remove the invalid kind from the list +if(NOT(${SIZEOF___FLOAT128} EQUAL 0)) + if(NOT(${SIZEOF___FLOAT128} EQUAL ${max_real_fortran_sizeof}) AND NOT(${FORTRAN_SIZEOF_LONG_DOUBLE} EQUAL ${max_real_fortran_sizeof})) + message(WARNING " + Fortran REAL(KIND=${max_real_fortran_kind}) is $max_real_fortran_sizeof Bytes, but no corresponding C float type exists of that size + !!! Fortran interfaces will not be generated for REAL(KIND=${max_real_fortran_kind}) !!!") + string(REGEX REPLACE ",[0-9]+}" "}" PAC_FC_ALL_REAL_KINDS ${PAC_FC_ALL_REAL_KINDS}) + string(REGEX REPLACE ",[0-9]+}" "}" PAC_FC_ALL_REAL_KINDS_SIZEOF ${PAC_FC_ALL_REAL_KINDS_SIZEOF}) + MATH (EXPR NUM_RKIND "${NUM_RKIND} - 1") + endif(NOT(${SIZEOF___FLOAT128} EQUAL ${max_real_fortran_sizeof}) AND NOT(${FORTRAN_SIZEOF_LONG_DOUBLE} EQUAL ${max_real_fortran_sizeof})) +endif(NOT(${SIZEOF___FLOAT128} EQUAL 0)) + +set(H5CONFIG_F_NUM_RKIND "INTEGER, PARAMETER :: num_rkinds = ${NUM_RKIND}") + +string(REGEX REPLACE "{" "" OUT_VAR ${PAC_FC_ALL_REAL_KINDS}) +string(REGEX REPLACE "}" "" OUT_VAR ${OUT_VAR}) +set(H5CONFIG_F_RKIND "INTEGER, DIMENSION(1:num_rkinds) :: rkind = (/${OUT_VAR}/)") + +string(REGEX REPLACE "{" "" OUT_VAR ${PAC_FC_ALL_REAL_KINDS_SIZEOF}) +string(REGEX REPLACE "}" "" OUT_VAR ${OUT_VAR}) +set(H5CONFIG_F_RKIND_SIZEOF "INTEGER, DIMENSION(1:num_rkinds) :: rkind_sizeof = (/${OUT_VAR}/)") + +ENABLE_LANGUAGE (C) + +#----------------------------------------------------------------------------- +# The provided CMake C macros don't provide a general compile/run function +# so this one is used. +#----------------------------------------------------------------------------- +MACRO (C_RUN FUNCTION CODE RUN_RESULT_VAR COMPILE_RESULT_VAR RETURN) +# MSB CHECK WHY THIS CHECK? +# if (NOT DEFINED ${RUN_RESULT_VAR}) + message (STATUS "Detecting C ${FUNCTION}") + if (CMAKE_REQUIRED_LIBRARIES) + set (CHECK_FUNCTION_EXISTS_ADD_LIBRARIES + "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}") + else (CMAKE_REQUIRED_LIBRARIES) + set (CHECK_FUNCTION_EXISTS_ADD_LIBRARIES) + endif (CMAKE_REQUIRED_LIBRARIES) + file (WRITE + ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testCCompiler1.c + ${CODE} + ) + TRY_RUN (${RUN_RESULT_VAR} ${COMPILE_RESULT_VAR} + ${CMAKE_BINARY_DIR} + ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testCCompiler1.c + CMAKE_FLAGS "${CHECK_FUNCTION_EXISTS_ADD_LIBRARIES}" + RUN_OUTPUT_VARIABLE OUTPUT + ) + + set(${RETURN} ${OUTPUT}) + + #message ( "Test result1 ${RETURN} ") + #message ( "Test result3 ${RESULT} ") + #message ( "Test result2 ${CMAKE_MATCH_0} ") + #message ( "Test result4 ${CMAKE_MATCH_1} ") + #message ( "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ") + #message ( "Test result ${COMPILE_RESULT_VAR} ") + #message ( "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ") + #message ( "Test result ${RUN_RESULT_VAR} ") + #message ( "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ") + + if (${COMPILE_RESULT_VAR}) + if (${RUN_RESULT_VAR} MATCHES 0) + set (${RUN_RESULT_VAR} 1 CACHE INTERNAL "Have C function ${FUNCTION}") + message (STATUS "Testing C ${FUNCTION} - OK") + file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + "Determining if the C ${FUNCTION} exists passed with the following output:\n" + "${OUTPUT}\n\n" + ) + else () + message (STATUS "Testing C ${FUNCTION} - Fail") + set (${RUN_RESULT_VAR} "" CACHE INTERNAL "Have C function ${FUNCTION}") + file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log + "Determining if the C ${FUNCTION} exists failed with the following output:\n" + "${OUTPUT}\n\n") + endif () + endif() +# endif (NOT DEFINED ${RUN_RESULT_VAR}) +ENDMACRO (C_RUN) + +set(PROG_SRC + " +#include +#include +#define CHECK_FLOAT128 ${SIZEOF___FLOAT128} +#if CHECK_FLOAT128!=0 +# if ${HAVE_QUADMATH}!=0 +#include +# endif +# ifdef FLT128_DIG +#define C_FLT128_DIG FLT128_DIG +# else +#define C_FLT128_DIG 0 +# endif +#else +#define C_FLT128_DIG 0 +#endif +#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L +#define C_LDBL_DIG DECIMAL_DIG +#else +#define C_LDBL_DIG LDBL_DIG +#endif + void main() { + printf(\"%d\\\\n%d\\\\n\", C_LDBL_DIG, C_FLT128_DIG)\\\; + } + " + ) + +C_RUN("maximum decimal precision for C" ${PROG_SRC} + XX + YY + PROG_OUTPUT +) + +# dnl The output from the above program will be: +# dnl -- LINE 1 -- long double decimal precision +# dnl -- LINE 2 -- __float128 decimal precision + +# Convert the string to a list of strings by replacing the carriage return with a semicolon +string(REGEX REPLACE "\n" ";" PROG_OUTPUT "${PROG_OUTPUT}") + +list(GET PROG_OUTPUT 0 LDBL_DIG) +list(GET PROG_OUTPUT 1 FLT128_DIG) + +if(SIZEOF___FLOAT128 EQUAL 0 OR FLT128_DIG EQUAL 0) + SET(H5_HAVE_FLOAT128 0) + SET(SIZEOF___FLOAT128 0) + set(H5_PAC_C_MAX_REAL_PRECISION ${LDBL_DIG}) +else () + set(H5_PAC_C_MAX_REAL_PRECISION ${FLT128_DIG}) +endif() + + +# Setting definition if there is a 16 byte fortran integer +string(FIND ${PAC_FC_ALL_INTEGER_KINDS_SIZEOF} "16" pos) +if(${pos} EQUAL -1) + set(HAVE_Fortran_INTEGER_SIZEOF_16 0) +else () + set(HAVE_Fortran_INTEGER_SIZEOF_16 1) +endif () diff --git a/config/cmake/hdf5-config.cmake.in b/config/cmake/hdf5-config.cmake.in index 321267f..adeec55 100644 --- a/config/cmake/hdf5-config.cmake.in +++ b/config/cmake/hdf5-config.cmake.in @@ -22,7 +22,6 @@ set (${HDF5_PACKAGE_NAME}_VALID_COMPONENTS #----------------------------------------------------------------------------- set (${HDF5_PACKAGE_NAME}_ENABLE_PARALLEL @HDF5_ENABLE_PARALLEL@) set (${HDF5_PACKAGE_NAME}_BUILD_FORTRAN @HDF5_BUILD_FORTRAN@) -set (${HDF5_PACKAGE_NAME}_ENABLE_F2003 @HDF5_ENABLE_F2003@) set (${HDF5_PACKAGE_NAME}_BUILD_CPP_LIB @HDF5_BUILD_CPP_LIB@) set (${HDF5_PACKAGE_NAME}_BUILD_TOOLS @HDF5_BUILD_TOOLS@) set (${HDF5_PACKAGE_NAME}_BUILD_HL_LIB @HDF5_BUILD_HL_LIB@) diff --git a/config/cmake/libhdf5.settings.cmake.in b/config/cmake/libhdf5.settings.cmake.in index 8ef67a5..ba764a4 100644 --- a/config/cmake/libhdf5.settings.cmake.in +++ b/config/cmake/libhdf5.settings.cmake.in @@ -38,7 +38,6 @@ Languages: ---------- Fortran: @HDF5_BUILD_FORTRAN@ @BUILD_FORTRAN_CONDITIONAL_TRUE@ Fortran Compiler: @CMAKE_Fortran_COMPILER@ -@BUILD_FORTRAN_CONDITIONAL_TRUE@ Fortran 2003 Compiler: @HDF5_ENABLE_F2003@ @BUILD_FORTRAN_CONDITIONAL_TRUE@ Fortran Flags: @CMAKE_Fortran_FLAGS@ @BUILD_FORTRAN_CONDITIONAL_TRUE@ H5 Fortran Flags: @H5_FCFLAGS@ @BUILD_FORTRAN_CONDITIONAL_TRUE@ AM Fortran Flags: @AM_FCFLAGS@ diff --git a/config/cmake/mccacheinit.cmake b/config/cmake/mccacheinit.cmake index af506e6..39ec124 100644 --- a/config/cmake/mccacheinit.cmake +++ b/config/cmake/mccacheinit.cmake @@ -16,8 +16,6 @@ set (HDF5_BUILD_EXAMPLES ON CACHE BOOL "Build HDF5 Library Examples" FORCE) set (HDF5_BUILD_FORTRAN ON CACHE BOOL "Build FORTRAN support" FORCE) -set (HDF5_ENABLE_F2003 ON CACHE BOOL "Enable FORTRAN 2003 Standard" FORCE) - set (HDF5_BUILD_HL_LIB ON CACHE BOOL "Build HIGH Level HDF5 Library" FORCE) set (HDF5_BUILD_TOOLS ON CACHE BOOL "Build HDF5 Tools" FORCE) diff --git a/configure b/configure index 860f480..fe13186 100755 --- a/configure +++ b/configure @@ -199,6 +199,7 @@ test -x / || exit 1" as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 +test \$(( 1 + 1 )) = 2 || exit 1 test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' @@ -206,8 +207,7 @@ test -x / || exit 1" ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ - || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1 -test \$(( 1 + 1 )) = 2 || exit 1" + || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else @@ -682,7 +682,6 @@ AM_MAKEFLAGS LT_STATIC_EXEC USE_PLUGINS_CONDITIONAL_FALSE USE_PLUGINS_CONDITIONAL_TRUE -CPP OTOOL64 OTOOL LIPO @@ -699,8 +698,6 @@ ac_ct_DUMPBIN DUMPBIN LD FGREP -EGREP -GREP SED LIBTOOL FORTRAN_SHARED_CONDITIONAL_FALSE @@ -713,7 +710,6 @@ PARALLEL TIME TR AR -PERL HL_FOR HL CXXCPP @@ -722,16 +718,26 @@ am__fastdepCXX_TRUE CXXDEPMODE ac_ct_CXX CXXFLAGS -FORTRAN_DEFAULT_REALisDBLE_F_FALSE -FORTRAN_DEFAULT_REALisDBLE_F_TRUE -FORTRAN_2003_CONDITIONAL_F_FALSE -FORTRAN_2003_CONDITIONAL_F_TRUE -FORTRAN_HAVE_STORAGE_SIZE_FALSE -FORTRAN_HAVE_STORAGE_SIZE_TRUE -FORTRAN_HAVE_C_SIZEOF_FALSE -FORTRAN_HAVE_C_SIZEOF_TRUE -FORTRAN_HAVE_SIZEOF_FALSE -FORTRAN_HAVE_SIZEOF_TRUE +H5CONFIG_F_IKIND +H5CONFIG_F_NUM_IKIND +H5CONFIG_F_RKIND_SIZEOF +H5CONFIG_F_RKIND +H5CONFIG_F_NUM_RKIND +FORTRAN_SIZEOF_LONG_DOUBLE +FORTRAN_C_LONG_DOUBLE_IS_UNIQUE +FORTRAN_HAVE_C_LONG_DOUBLE +HAVE_Fortran_INTEGER_SIZEOF_16 +PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF +PAC_FORTRAN_NATIVE_DOUBLE_KIND +PAC_FORTRAN_NATIVE_REAL_SIZEOF +PAC_FORTRAN_NATIVE_REAL_KIND +PAC_FORTRAN_NATIVE_INTEGER_SIZEOF +PAC_FORTRAN_NATIVE_INTEGER_KIND +PAC_FC_ALL_INTEGER_KINDS_SIZEOF +PAC_FC_ALL_REAL_KINDS_SIZEOF +PAC_FC_ALL_INTEGER_KINDS +PAC_FC_MAX_REAL_PRECISION +PAC_FC_ALL_REAL_KINDS FCLIBS F9XMODEXT F9XMODFLAG @@ -748,8 +754,10 @@ HSIZE_T HADDR_T R_INTEGER R_LARGE -HAVE_FORTRAN_2003 HDF5_INTERFACES +EGREP +GREP +CPP am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE @@ -766,6 +774,7 @@ ac_ct_CC LDFLAGS CFLAGS CC +PAC_C_MAX_REAL_PRECISION UNAME_INFO enable_static enable_shared @@ -778,9 +787,7 @@ INSTRUMENT HDF5_HL CXX HDF_CXX -FC2003 FC -HDF_FORTRAN2003 HDF_FORTRAN STATIC_EXEC MPE @@ -834,6 +841,7 @@ am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM +PERL target_alias host_alias build_alias @@ -880,7 +888,6 @@ enable_maintainer_mode enable_dependency_tracking enable_unsupported enable_fortran -enable_fortran2003 enable_cxx enable_hl enable_shared @@ -926,13 +933,13 @@ CFLAGS LDFLAGS LIBS CPPFLAGS +CPP FC FCFLAGS CXX CXXFLAGS CCC -CXXCPP -CPP' +CXXCPP' # Initialize some variables set by options. @@ -1561,9 +1568,7 @@ Optional Features: --disable-dependency-tracking speeds up one-time build --enable-unsupported Allow unsupported combinations of configure options - --enable-fortran Compile the Fortran 90/95 interface [default=no] - --enable-fortran2003 Compile the Fortran 2003 interface, must also - specify --enable-fortran [default=no] + --enable-fortran Compile the Fortran interface [default=no] --enable-cxx Compile the C++ interface [default=no] --enable-hl Enable the high level library [default=yes] --enable-shared[=PKGS] build shared libraries [default=yes] @@ -1661,12 +1666,12 @@ Some influential environment variables: LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory + CPP C preprocessor FC Fortran compiler command FCFLAGS Fortran compiler flags CXX C++ compiler command CXXFLAGS C++ compiler flags CXXCPP C++ preprocessor - CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. @@ -1786,59 +1791,74 @@ fi } # ac_fn_c_try_compile -# ac_fn_fc_try_compile LINENO -# --------------------------- -# Try to compile conftest.$ac_ext, and return whether this succeeded. -ac_fn_fc_try_compile () +# ac_fn_c_check_type LINENO TYPE VAR INCLUDES +# ------------------------------------------- +# Tests whether TYPE exists after having included INCLUDES, setting cache +# variable VAR accordingly. +ac_fn_c_check_type () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext - if { { ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compile") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { - test -z "$ac_fc_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then : - ac_retval=0 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + eval "$3=no" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +if (sizeof ($2)) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +if (sizeof (($2))) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : - ac_retval=1 +else + eval "$3=yes" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval -} # ac_fn_fc_try_compile +} # ac_fn_c_check_type -# ac_fn_c_try_link LINENO -# ----------------------- -# Try to link conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_link () +# ac_fn_c_try_cpp LINENO +# ---------------------- +# Try to preprocess conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext conftest$ac_exeext - if { { ac_try="$ac_link" + if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>conftest.err + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 @@ -1846,37 +1866,29 @@ $as_echo "$ac_try_echo"; } >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { - test -z "$ac_c_werror_flag" || + test $ac_status = 0; } > conftest.i && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_retval=1 + ac_retval=1 fi - # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information - # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would - # interfere with the next link command; also delete a directory that is - # left behind by Apple's compiler. We do this before executing the actions. - rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval -} # ac_fn_c_try_link +} # ac_fn_c_try_cpp -# ac_fn_fc_try_link LINENO -# ------------------------ -# Try to link conftest.$ac_ext, and return whether this succeeded. -ac_fn_fc_try_link () +# ac_fn_c_try_run LINENO +# ---------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes +# that executables *can* be run. +ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; @@ -1884,204 +1896,354 @@ case "(($ac_try" in esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>conftest.err + (eval "$ac_link") 2>&5 ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { - test -z "$ac_fc_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - test -x conftest$ac_exeext - }; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information - # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would - # interfere with the next link command; also delete a directory that is - # left behind by Apple's compiler. We do this before executing the actions. - rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_fc_try_link - -# ac_fn_cxx_try_compile LINENO -# ---------------------------- -# Try to compile conftest.$ac_ext, and return whether this succeeded. -ac_fn_cxx_try_compile () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext - if { { ac_try="$ac_compile" -case "(($ac_try" in + test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' + { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compile") 2>conftest.err + (eval "$ac_try") 2>&5 ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then : + test $ac_status = 0; }; }; then : ac_retval=0 else - $as_echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_retval=1 + ac_retval=$ac_status fi + rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval -} # ac_fn_cxx_try_compile +} # ac_fn_c_try_run -# ac_fn_cxx_try_cpp LINENO -# ------------------------ -# Try to preprocess conftest.$ac_ext, and return whether this succeeded. -ac_fn_cxx_try_cpp () +# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists and can be compiled using the include files in +# INCLUDES, setting the cache variable VAR accordingly. +ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { { ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } > conftest.i && { - test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || - test ! -s conftest.err - }; then : - ac_retval=0 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval -} # ac_fn_cxx_try_cpp +} # ac_fn_c_check_header_compile -# ac_fn_cxx_try_link LINENO -# ------------------------- -# Try to link conftest.$ac_ext, and return whether this succeeded. -ac_fn_cxx_try_link () +# ac_fn_c_compute_int LINENO EXPR VAR INCLUDES +# -------------------------------------------- +# Tries to find the compile-time value of EXPR in a program that includes +# INCLUDES, setting VAR accordingly. Returns whether the value could be +# computed +ac_fn_c_compute_int () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext conftest$ac_exeext - if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - test -x conftest$ac_exeext - }; then : - ac_retval=0 + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) >= 0)]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_lo=0 ac_mid=0 + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) <= $ac_mid)]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_hi=$ac_mid; break else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + as_fn_arith $ac_mid + 1 && ac_lo=$as_val + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) < 0)]; +test_array [0] = 0; +return test_array [0]; - ac_retval=1 + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_hi=-1 ac_mid=-1 + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) >= $ac_mid)]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_lo=$ac_mid; break +else + as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val fi - # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information - # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would - # interfere with the next link command; also delete a directory that is - # left behind by Apple's compiler. We do this before executing the actions. - rm -rf conftest.dSYM conftest_ipa8_conftest.oo +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + ac_lo= ac_hi= +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) <= $ac_mid)]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_hi=$ac_mid +else + as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in #(( +?*) eval "$3=\$ac_lo"; ac_retval=0 ;; +'') ac_retval=1 ;; +esac + else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +static long int longval () { return $2; } +static unsigned long int ulongval () { return $2; } +#include +#include +int +main () +{ + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + return 1; + if (($2) < 0) + { + long int i = longval (); + if (i != ($2)) + return 1; + fprintf (f, "%ld", i); + } + else + { + unsigned long int i = ulongval (); + if (i != ($2)) + return 1; + fprintf (f, "%lu", i); + } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + echo >>conftest.val; read $3 &5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + # Is the header compilable? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 +$as_echo_n "checking $2 usability... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : - eval "$3=yes" + ac_header_compiler=yes else - eval "$3=no" + ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } -} # ac_fn_c_check_header_compile +# Is the header present? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 +$as_echo_n "checking $2 presence... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <$2> +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + ac_header_preproc=yes +else + ac_header_preproc=no +fi +rm -f conftest.err conftest.i conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } -# ac_fn_c_try_cpp LINENO -# ---------------------- -# Try to preprocess conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_cpp () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { { ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( + yes:no: ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} + ;; + no:yes:* ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} +( $as_echo "## -------------------------------- ## +## Report this to help@hdfgroup.org ## +## -------------------------------- ##" + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=\$ac_header_compiler" +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_header_mongrel + +# ac_fn_fc_try_compile LINENO +# --------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_fc_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err + (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 @@ -2089,27 +2251,119 @@ $as_echo "$ac_try_echo"; } >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } > conftest.i && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test $ac_status = 0; } && { + test -z "$ac_fc_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_fc_try_compile + +# ac_fn_fc_try_link LINENO +# ------------------------ +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_fc_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_fc_werror_flag" || test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_retval=1 + ac_retval=1 fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval -} # ac_fn_c_try_cpp +} # ac_fn_fc_try_link -# ac_fn_c_try_run LINENO -# ---------------------- +# ac_fn_c_try_link LINENO +# ----------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + test -x conftest$ac_exeext + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_link + +# ac_fn_fc_try_run LINENO +# ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. -ac_fn_c_try_run () +ac_fn_fc_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" @@ -2145,179 +2399,133 @@ fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval -} # ac_fn_c_try_run +} # ac_fn_fc_try_run -# ac_fn_c_check_func LINENO FUNC VAR -# ---------------------------------- -# Tests whether FUNC exists, setting the cache variable VAR accordingly -ac_fn_c_check_func () +# ac_fn_cxx_try_compile LINENO +# ---------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_cxx_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 + rm -f conftest.$ac_objext + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then : + ac_retval=0 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -/* Define $2 to an innocuous variant, in case declares $2. - For example, HP-UX 11i declares gettimeofday. */ -#define $2 innocuous_$2 - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $2 (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $2 - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $2 (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$2 || defined __stub___$2 -choke me -#endif + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus - extern "C" -# endif - int FC_DUMMY_MAIN() { return 1; } -#endif -#endif -int -main () -{ -return $2 (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - eval "$3=yes" -else - eval "$3=no" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext + ac_retval=1 fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval -} # ac_fn_c_check_func +} # ac_fn_cxx_try_compile -# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES -# ------------------------------------------------------- -# Tests whether HEADER exists, giving a warning if it cannot be compiled using -# the include files in INCLUDES and setting the cache variable VAR -# accordingly. -ac_fn_c_check_header_mongrel () +# ac_fn_cxx_try_cpp LINENO +# ------------------------ +# Try to preprocess conftest.$ac_ext, and return whether this succeeded. +ac_fn_cxx_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if eval \${$3+:} false; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 -$as_echo_n "checking $2 usability... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -#include <$2> -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_header_compiler=yes + if { { ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } > conftest.i && { + test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || + test ! -s conftest.err + }; then : + ac_retval=0 else - ac_header_compiler=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -# Is the header present? -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 -$as_echo_n "checking $2 presence... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <$2> -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - ac_header_preproc=yes -else - ac_header_preproc=no + ac_retval=1 fi -rm -f conftest.err conftest.i conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( - yes:no: ) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} - ;; - no:yes:* ) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} -( $as_echo "## -------------------------------- ## -## Report this to help@hdfgroup.org ## -## -------------------------------- ##" - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; +} # ac_fn_cxx_try_cpp + +# ac_fn_cxx_try_link LINENO +# ------------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_cxx_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; esac - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + test -x conftest$ac_exeext + }; then : + ac_retval=0 else - eval "$3=\$ac_header_compiler" -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval -} # ac_fn_c_check_header_mongrel +} # ac_fn_cxx_try_link -# ac_fn_c_check_type LINENO TYPE VAR INCLUDES -# ------------------------------------------- -# Tests whether TYPE exists after having included INCLUDES, setting cache -# variable VAR accordingly. -ac_fn_c_check_type () +# ac_fn_c_check_func LINENO FUNC VAR +# ---------------------------------- +# Tests whether FUNC exists, setting the cache variable VAR accordingly +ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 @@ -2325,10 +2533,39 @@ $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else - eval "$3=no" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -$4 +/* Define $2 to an innocuous variant, in case declares $2. + For example, HP-UX 11i declares gettimeofday. */ +#define $2 innocuous_$2 + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $2 (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $2 + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $2 (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$2 || defined __stub___$2 +choke me +#endif + #ifdef FC_DUMMY_MAIN #ifndef FC_DUMMY_MAIN_EQ_F77 # ifdef __cplusplus @@ -2340,13 +2577,40 @@ $4 int main () { -if (sizeof ($2)) - return 0; +return $2 (); ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_link "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_func + +# ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES +# --------------------------------------------- +# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR +# accordingly. +ac_fn_c_check_decl () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + as_decl_name=`echo $2|sed 's/ *(.*//'` + as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 +$as_echo_n "checking whether $as_decl_name is declared... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 @@ -2361,18 +2625,22 @@ $4 int main () { -if (sizeof (($2))) - return 0; +#ifndef $as_decl_name +#ifdef __cplusplus + (void) $as_decl_use; +#else + (void) $as_decl_name; +#endif +#endif + ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : - -else eval "$3=yes" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +else + eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi @@ -2381,347 +2649,62 @@ eval ac_res=\$$3 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno -} # ac_fn_c_check_type +} # ac_fn_c_check_decl +cat >config.log <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. -# ac_fn_c_compute_int LINENO EXPR VAR INCLUDES -# -------------------------------------------- -# Tries to find the compile-time value of EXPR in a program that includes -# INCLUDES, setting VAR accordingly. Returns whether the value could be -# computed -ac_fn_c_compute_int () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if test "$cross_compiling" = yes; then - # Depending upon the size, compute the lo and hi bounds. -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus - extern "C" -# endif - int FC_DUMMY_MAIN() { return 1; } -#endif -#endif -int -main () -{ -static int test_array [1 - 2 * !(($2) >= 0)]; -test_array [0] = 0; -return test_array [0]; +It was created by HDF5 $as_me 1.9.227, which was +generated by GNU Autoconf 2.69. Invocation command line was - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_lo=0 ac_mid=0 - while :; do - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus - extern "C" -# endif - int FC_DUMMY_MAIN() { return 1; } -#endif -#endif -int -main () -{ -static int test_array [1 - 2 * !(($2) <= $ac_mid)]; -test_array [0] = 0; -return test_array [0]; + $ $0 $@ - ; - return 0; -} _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_hi=$ac_mid; break -else - as_fn_arith $ac_mid + 1 && ac_lo=$as_val - if test $ac_lo -le $ac_mid; then - ac_lo= ac_hi= - break - fi - as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - done -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus - extern "C" -# endif - int FC_DUMMY_MAIN() { return 1; } -#endif -#endif -int -main () +exec 5>>config.log { -static int test_array [1 - 2 * !(($2) < 0)]; -test_array [0] = 0; -return test_array [0]; +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_hi=-1 ac_mid=-1 - while :; do - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus - extern "C" -# endif - int FC_DUMMY_MAIN() { return 1; } -#endif -#endif -int -main () -{ -static int test_array [1 - 2 * !(($2) >= $ac_mid)]; -test_array [0] = 0; -return test_array [0]; +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_lo=$ac_mid; break -else - as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val - if test $ac_mid -le $ac_hi; then - ac_lo= ac_hi= - break - fi - as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + $as_echo "PATH: $as_dir" done -else - ac_lo= ac_hi= -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -# Binary search between lo and hi bounds. -while test "x$ac_lo" != "x$ac_hi"; do - as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus - extern "C" -# endif - int FC_DUMMY_MAIN() { return 1; } -#endif -#endif -int -main () -{ -static int test_array [1 - 2 * !(($2) <= $ac_mid)]; -test_array [0] = 0; -return test_array [0]; +IFS=$as_save_IFS - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_hi=$ac_mid -else - as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -done -case $ac_lo in #(( -?*) eval "$3=\$ac_lo"; ac_retval=0 ;; -'') ac_retval=1 ;; -esac - else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -static long int longval () { return $2; } -static unsigned long int ulongval () { return $2; } -#include -#include -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus - extern "C" -# endif - int FC_DUMMY_MAIN() { return 1; } -#endif -#endif -int -main () -{ +} >&5 - FILE *f = fopen ("conftest.val", "w"); - if (! f) - return 1; - if (($2) < 0) - { - long int i = longval (); - if (i != ($2)) - return 1; - fprintf (f, "%ld", i); - } - else - { - unsigned long int i = ulongval (); - if (i != ($2)) - return 1; - fprintf (f, "%lu", i); - } - /* Do not output a trailing newline, as this causes \r\n confusion - on some platforms. */ - return ferror (f) || fclose (f) != 0; +cat >&5 <<_ACEOF - ; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - echo >>conftest.val; read $3 &5 -$as_echo_n "checking whether $as_decl_name is declared... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus - extern "C" -# endif - int FC_DUMMY_MAIN() { return 1; } -#endif -#endif -int -main () -{ -#ifndef $as_decl_name -#ifdef __cplusplus - (void) $as_decl_use; -#else - (void) $as_decl_name; -#endif -#endif - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - eval "$3=yes" -else - eval "$3=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_check_decl -cat >config.log <<_ACEOF -This file contains any messages produced by compilers while -running configure, to aid debugging if configure makes a mistake. - -It was created by HDF5 $as_me 1.9.227, which was -generated by GNU Autoconf 2.69. Invocation command line was - - $ $0 $@ - -_ACEOF -exec 5>>config.log -{ -cat <<_ASUNAME -## --------- ## -## Platform. ## -## --------- ## - -hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` -uname -m = `(uname -m) 2>/dev/null || echo unknown` -uname -r = `(uname -r) 2>/dev/null || echo unknown` -uname -s = `(uname -s) 2>/dev/null || echo unknown` -uname -v = `(uname -v) 2>/dev/null || echo unknown` - -/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` -/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` - -/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` -/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` -/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` -/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` -/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` -/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` -/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` - -_ASUNAME - -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - $as_echo "PATH: $as_dir" - done -IFS=$as_save_IFS - -} >&5 - -cat >&5 <<_ACEOF - - -## ----------- ## -## Core tests. ## -## ----------- ## - -_ACEOF +_ACEOF # Keep a trace of the command line. @@ -3020,6 +3003,54 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu +## PLACE CHECKS FOR REQUIRED PACKAGES NEEDED TO INSTALL HDF5 AT THE BEGINNING +## -------------------------------------------------------------------------- +## Requirement #1: Check if Perl is installed. +## + PERL="" +# Extract the first word of "perl", so it can be a program name with args. +set dummy perl; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_PERL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$PERL"; then + ac_cv_prog_PERL="$PERL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_PERL="" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_prog_PERL" && ac_cv_prog_PERL="$PATH" +fi +fi +PERL=$ac_cv_prog_PERL +if test -n "$PERL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PERL" >&5 +$as_echo "$PERL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +if test "x$PERL" = "xfalse"; then + as_fn_error $? "*** Perl is required for installing HDF5, but Perl could not be found!" "$LINENO" 5 +fi + + ac_config_headers="$ac_config_headers src/H5config.h" @@ -3864,7 +3895,6 @@ $as_echo "done" >&6; } ## MPE: whether MPE option is enabled. Default no. ## STATIC_EXEC: whether static-exec is enabled. Default no. ## HDF_FORTRAN: whether Fortran is enabled. Default no. -## HDF_FORTRAN2003: whether Fortran 2003 is enabled. Default no. ## FC: Fortran compiler. ## HDF_CXX: whether C++ is enabled. Default no. ## CXX: C++ compiler. @@ -3872,6 +3902,7 @@ $as_echo "done" >&6; } ## INSTRUMENT: whether INSTRUMENT is enabled. No default set here. ## CODESTACK: whether CODESTACK is enabled. Default no. ## HAVE_DMALLOC: whether system has dmalloc support. Default no. +## HAVE_FLOAT128: whether system has Quad-Precision Math Library. Default no. ## DIRECT_VFD: whether DIRECT_VFD is enabled. Default no. ## THREADSAFE: whether THREADSAFE is enabled. Default no. ## STATIC_SHARED: whether static and/or shared libraries are requested. @@ -3883,9 +3914,7 @@ $as_echo "done" >&6; } MPE=no STATIC_EXEC=no HDF_FORTRAN=no - HDF_FORTRAN2003=no HDF_FORTRAN=no - HDF_FORTRAN2003=no HDF_CXX=no HDF_CXX=no HDF5_HL=yes @@ -3899,6 +3928,7 @@ $as_echo "done" >&6; } UNAME_INFO=`uname -a` + ## ---------------------------------------------------------------------- ## Some platforms have broken basename, and/or xargs programs. Check ## that it actually does what it's supposed to do. Catch this early @@ -5122,1583 +5152,1236 @@ $as_echo "yes" >&6; } esac ## ---------------------------------------------------------------------- -## Check if they would like the Fortran interface compiled +## Data types and their sizes. ## - HDF5_INTERFACES="" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if Fortran interface enabled" >&5 -$as_echo_n "checking if Fortran interface enabled... " >&6; } -# Check whether --enable-fortran was given. -if test "${enable_fortran+set}" = set; then : - enableval=$enable_fortran; HDF_FORTRAN=$enableval -fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 +$as_echo_n "checking how to run the C preprocessor... " >&6; } +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if ${ac_cv_prog_CPP+:} false; then : + $as_echo_n "(cached) " >&6 +else + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : -if test "X$HDF_FORTRAN" = "Xyes"; then - echo "yes" else - echo "no" + # Broken: fails on valid input. +continue fi +rm -f conftest.err conftest.i conftest.$ac_ext - -## ---------------------------------------------------------------------- -## Check if they would like the Fortran 2003 interface compiled -## -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if Fortran 2003 interface enabled" >&5 -$as_echo_n "checking if Fortran 2003 interface enabled... " >&6; } -# Check whether --enable-fortran2003 was given. -if test "${enable_fortran2003+set}" = set; then : - enableval=$enable_fortran2003; HDF_FORTRAN2003=$enableval + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break fi +rm -f conftest.err conftest.i conftest.$ac_ext +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + break +fi -## ---------------------------------------------------------------------- -## Check to make sure --enable-fortran is present if --enable-fortran2003 -## was specified + done + ac_cv_prog_CPP=$CPP -if test "X$HDF_FORTRAN2003" = "Xyes" && test "X$HDF_FORTRAN" = "Xno"; then - echo "no" - as_fn_error $? "--enable-fortran must be used with --enable-fortran2003" "$LINENO" 5 +fi + CPP=$ac_cv_prog_CPP else - if test "X$HDF_FORTRAN2003" = "Xyes" && test "X$HDF_FORTRAN" = "Xyes"; then - echo "yes" - else - echo "no" - fi + ac_cv_prog_CPP=$CPP fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 +$as_echo "$CPP" >&6; } +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : -if test "X$HDF_FORTRAN" = "Xyes"; then - - HDF_FORTRAN=yes - - - HDF5_INTERFACES="$HDF5_INTERFACES fortran" - - ## -------------------------------------------------------------------- - ## HDF5 integer variables for the H5fortran_types.f90 file. - ## - - - +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details" "$LINENO" 5; } +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu - ## -------------------------------------------------------------------- - ## Fortran source extention - ## - ac_ext=${ac_fc_srcext-f} -ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5' -ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_fc_compiler_gnu -if test -n "$ac_tool_prefix"; then - for ac_prog in gfortran g95 xlf95 f95 fort ifort ifc efc pgfortran pgf95 lf95 ftn nagfor xlf90 f90 pgf90 pghpf epcf90 g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77 - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_FC+:} false; then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 +$as_echo_n "checking for grep that handles long lines and -e... " >&6; } +if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$FC"; then - ac_cv_prog_FC="$FC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH + if test -z "$GREP"; then + ac_path_GREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_FC="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_GREP" || continue +# Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break done -IFS=$as_save_IFS + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac -fi -fi -FC=$ac_cv_prog_FC -if test -n "$FC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FC" >&5 -$as_echo "$FC" >&6; } + $ac_path_GREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_GREP"; then + as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + ac_cv_path_GREP=$GREP fi - - test -n "$FC" && break - done fi -if test -z "$FC"; then - ac_ct_FC=$FC - for ac_prog in gfortran g95 xlf95 f95 fort ifort ifc efc pgfortran pgf95 lf95 ftn nagfor xlf90 f90 pgf90 pghpf epcf90 g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77 -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_FC+:} false; then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 +$as_echo "$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 +$as_echo_n "checking for egrep... " >&6; } +if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$ac_ct_FC"; then - ac_cv_prog_ac_ct_FC="$ac_ct_FC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + if test -z "$EGREP"; then + ac_path_EGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_FC="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_EGREP" || continue +# Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break done -IFS=$as_save_IFS + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac -fi -fi -ac_ct_FC=$ac_cv_prog_ac_ct_FC -if test -n "$ac_ct_FC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_FC" >&5 -$as_echo "$ac_ct_FC" >&6; } + $ac_path_EGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP"; then + as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + ac_cv_path_EGREP=$EGREP fi + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 +$as_echo "$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" - test -n "$ac_ct_FC" && break -done - if test "x$ac_ct_FC" = x; then - FC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - FC=$ac_ct_FC - fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if ${ac_cv_header_stdc+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_stdc=yes +else + ac_cv_header_stdc=no fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include -# Provide some information about the compiler. -$as_echo "$as_me:${as_lineno-$LINENO}: checking for Fortran compiler version" >&5 -set X $ac_compile -ac_compiler=$2 -for ac_option in --version -v -V -qversion; do - { { ac_try="$ac_compiler $ac_option >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compiler $ac_option >&5") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - sed '10a\ -... rest of stderr output deleted ... - 10q' conftest.err >conftest.er1 - cat conftest.er1 >&5 - fi - rm -f conftest.er1 conftest.err - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } -done -rm -f a.out +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then : -# If we don't use `.F' as extension, the preprocessor is not run on the -# input file. (Note that this only needs to work for GNU compilers.) -ac_save_ext=$ac_ext -ac_ext=F -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU Fortran compiler" >&5 -$as_echo_n "checking whether we are using the GNU Fortran compiler... " >&6; } -if ${ac_cv_fc_compiler_gnu+:} false; then : - $as_echo_n "(cached) " >&6 else - cat > conftest.$ac_ext <<_ACEOF - program main -#ifndef __GNUC__ - choke me -#endif + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include - end _ACEOF -if ac_fn_fc_try_compile "$LINENO"; then : - ac_compiler_gnu=yes +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then : + else - ac_compiler_gnu=no + ac_cv_header_stdc=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -ac_cv_fc_compiler_gnu=$ac_compiler_gnu +rm -f conftest* fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_fc_compiler_gnu" >&5 -$as_echo "$ac_cv_fc_compiler_gnu" >&6; } -ac_ext=$ac_save_ext -ac_test_FCFLAGS=${FCFLAGS+set} -ac_save_FCFLAGS=$FCFLAGS -FCFLAGS= -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $FC accepts -g" >&5 -$as_echo_n "checking whether $FC accepts -g... " >&6; } -if ${ac_cv_prog_fc_g+:} false; then : - $as_echo_n "(cached) " >&6 + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then : + : else - FCFLAGS=-g -cat > conftest.$ac_ext <<_ACEOF - program main + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif - end +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + return 2; + return 0; +} _ACEOF -if ac_fn_fc_try_compile "$LINENO"; then : - ac_cv_prog_fc_g=yes +if ac_fn_c_try_run "$LINENO"; then : + else - ac_cv_prog_fc_g=no + ac_cv_header_stdc=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_fc_g" >&5 -$as_echo "$ac_cv_prog_fc_g" >&6; } -if test "$ac_test_FCFLAGS" = set; then - FCFLAGS=$ac_save_FCFLAGS -elif test $ac_cv_prog_fc_g = yes; then - if test "x$ac_cv_fc_compiler_gnu" = xyes; then - FCFLAGS="-g -O2" - else - FCFLAGS="-g" - fi -else - if test "x$ac_cv_fc_compiler_gnu" = xyes; then - FCFLAGS="-O2" - else - FCFLAGS= - fi fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +$as_echo "#define STDC_HEADERS 1" >>confdefs.h -if test $ac_compiler_gnu = yes; then - GFC=yes -else - GFC= fi -ac_ext=${ac_fc_srcext-f} -ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5' -ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_fc_compiler_gnu +# On IRIX 5.3, sys/types and inttypes.h are conflicting. +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default +" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +ac_fn_c_check_type "$LINENO" "off_t" "ac_cv_type_off_t" "$ac_includes_default" +if test "x$ac_cv_type_off_t" = xyes; then : -ac_ext=${ac_fc_srcext-f} -ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5' -ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_fc_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Fortran flag to compile .f90 files" >&5 -$as_echo_n "checking for Fortran flag to compile .f90 files... " >&6; } -if ${ac_cv_fc_srcext_f90+:} false; then : - $as_echo_n "(cached) " >&6 else - ac_ext=f90 -ac_fcflags_srcext_save=$ac_fcflags_srcext -ac_fcflags_srcext= -ac_cv_fc_srcext_f90=unknown -case $ac_ext in #( - [fF]77) ac_try=f77;; #( - *) ac_try=f95;; -esac -for ac_flag in none -qsuffix=f=f90 -Tf "-x $ac_try"; do - test "x$ac_flag" != xnone && ac_fcflags_srcext="$ac_flag" - cat > conftest.$ac_ext <<_ACEOF - program main - end +cat >>confdefs.h <<_ACEOF +#define off_t long int _ACEOF -if ac_fn_fc_try_compile "$LINENO"; then : - ac_cv_fc_srcext_f90=$ac_flag; break + fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -done -rm -f conftest.$ac_objext conftest.f90 -ac_fcflags_srcext=$ac_fcflags_srcext_save + +ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" +if test "x$ac_cv_type_size_t" = xyes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define size_t unsigned long +_ACEOF fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_fc_srcext_f90" >&5 -$as_echo "$ac_cv_fc_srcext_f90" >&6; } -if test "x$ac_cv_fc_srcext_f90" = xunknown; then - as_fn_error $? "Fortran could not compile .f90 files" "$LINENO" 5 + +ac_fn_c_check_type "$LINENO" "ssize_t" "ac_cv_type_ssize_t" "$ac_includes_default" +if test "x$ac_cv_type_ssize_t" = xyes; then : + else - ac_fc_srcext=f90 - if test "x$ac_cv_fc_srcext_f90" = xnone; then - ac_fcflags_srcext="" - FCFLAGS_f90="" - else - ac_fcflags_srcext=$ac_cv_fc_srcext_f90 - FCFLAGS_f90=$ac_cv_fc_srcext_f90 - fi +cat >>confdefs.h <<_ACEOF +#define ssize_t long +_ACEOF fi -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu +ac_fn_c_check_type "$LINENO" "ptrdiff_t" "ac_cv_type_ptrdiff_t" "$ac_includes_default" +if test "x$ac_cv_type_ptrdiff_t" = xyes; then : +else +cat >>confdefs.h <<_ACEOF +#define ptrdiff_t long +_ACEOF +fi - ## -------------------------------------------------------------------- - ## Check for a Fortran compiler and how to include modules. - ## - ac_ext=${ac_fc_srcext-f} -ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5' -ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_fc_compiler_gnu -if test -n "$ac_tool_prefix"; then - for ac_prog in gfortran ifort pgf90 pathf90 pathf95 xlf90 xlf95 xlf2003 f90 epcf90 f95 fort lf95 g95 ifc efc gfc - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_FC+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 +$as_echo_n "checking whether byte ordering is bigendian... " >&6; } +if ${ac_cv_c_bigendian+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$FC"; then - ac_cv_prog_FC="$FC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_FC="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -FC=$ac_cv_prog_FC -if test -n "$FC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FC" >&5 -$as_echo "$FC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$FC" && break - done -fi -if test -z "$FC"; then - ac_ct_FC=$FC - for ac_prog in gfortran ifort pgf90 pathf90 pathf95 xlf90 xlf95 xlf2003 f90 epcf90 f95 fort lf95 g95 ifc efc gfc -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_FC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_FC"; then - ac_cv_prog_ac_ct_FC="$ac_ct_FC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_FC="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_FC=$ac_cv_prog_ac_ct_FC -if test -n "$ac_ct_FC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_FC" >&5 -$as_echo "$ac_ct_FC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - + ac_cv_c_bigendian=unknown + # See if we're dealing with a universal compiler. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __APPLE_CC__ + not a universal capable compiler + #endif + typedef int dummy; - test -n "$ac_ct_FC" && break -done +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : - if test "x$ac_ct_FC" = x; then - FC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - FC=$ac_ct_FC - fi + # Check for potential -arch flags. It is not universal unless + # there are at least two -arch flags with different values. + ac_arch= + ac_prev= + for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do + if test -n "$ac_prev"; then + case $ac_word in + i?86 | x86_64 | ppc | ppc64) + if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then + ac_arch=$ac_word + else + ac_cv_c_bigendian=universal + break + fi + ;; + esac + ac_prev= + elif test "x$ac_word" = "x-arch"; then + ac_prev=arch + fi + done fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + if test $ac_cv_c_bigendian = unknown; then + # See if sys/param.h defines the BYTE_ORDER macro. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include +int +main () +{ +#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ + && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ + && LITTLE_ENDIAN) + bogus endian macros + #endif -# Provide some information about the compiler. -$as_echo "$as_me:${as_lineno-$LINENO}: checking for Fortran compiler version" >&5 -set X $ac_compile -ac_compiler=$2 -for ac_option in --version -v -V -qversion; do - { { ac_try="$ac_compiler $ac_option >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compiler $ac_option >&5") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - sed '10a\ -... rest of stderr output deleted ... - 10q' conftest.err >conftest.er1 - cat conftest.er1 >&5 - fi - rm -f conftest.er1 conftest.err - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } -done -rm -f a.out + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + # It does; now see whether it defined to BIG_ENDIAN or not. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include -# If we don't use `.F' as extension, the preprocessor is not run on the -# input file. (Note that this only needs to work for GNU compilers.) -ac_save_ext=$ac_ext -ac_ext=F -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU Fortran compiler" >&5 -$as_echo_n "checking whether we are using the GNU Fortran compiler... " >&6; } -if ${ac_cv_fc_compiler_gnu+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat > conftest.$ac_ext <<_ACEOF - program main -#ifndef __GNUC__ - choke me -#endif +int +main () +{ +#if BYTE_ORDER != BIG_ENDIAN + not big endian + #endif - end + ; + return 0; +} _ACEOF -if ac_fn_fc_try_compile "$LINENO"; then : - ac_compiler_gnu=yes +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_bigendian=yes else - ac_compiler_gnu=no + ac_cv_c_bigendian=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -ac_cv_fc_compiler_gnu=$ac_compiler_gnu - fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_fc_compiler_gnu" >&5 -$as_echo "$ac_cv_fc_compiler_gnu" >&6; } -ac_ext=$ac_save_ext -ac_test_FCFLAGS=${FCFLAGS+set} -ac_save_FCFLAGS=$FCFLAGS -FCFLAGS= -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $FC accepts -g" >&5 -$as_echo_n "checking whether $FC accepts -g... " >&6; } -if ${ac_cv_prog_fc_g+:} false; then : - $as_echo_n "(cached) " >&6 -else - FCFLAGS=-g -cat > conftest.$ac_ext <<_ACEOF - program main +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include - end +int +main () +{ +#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) + bogus endian macros + #endif + + ; + return 0; +} _ACEOF -if ac_fn_fc_try_compile "$LINENO"; then : - ac_cv_prog_fc_g=yes +if ac_fn_c_try_compile "$LINENO"; then : + # It does; now see whether it defined to _BIG_ENDIAN or not. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main () +{ +#ifndef _BIG_ENDIAN + not big endian + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_bigendian=yes else - ac_cv_prog_fc_g=no + ac_cv_c_bigendian=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_fc_g" >&5 -$as_echo "$ac_cv_prog_fc_g" >&6; } -if test "$ac_test_FCFLAGS" = set; then - FCFLAGS=$ac_save_FCFLAGS -elif test $ac_cv_prog_fc_g = yes; then - if test "x$ac_cv_fc_compiler_gnu" = xyes; then - FCFLAGS="-g -O2" - else - FCFLAGS="-g" - fi -else - if test "x$ac_cv_fc_compiler_gnu" = xyes; then - FCFLAGS="-O2" - else - FCFLAGS= - fi fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # Compile a test program. + if test "$cross_compiling" = yes; then : + # Try to guess by grepping values from an object file. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +short int ascii_mm[] = + { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; + short int ascii_ii[] = + { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; + int use_ascii (int i) { + return ascii_mm[i] + ascii_ii[i]; + } + short int ebcdic_ii[] = + { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; + short int ebcdic_mm[] = + { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; + int use_ebcdic (int i) { + return ebcdic_mm[i] + ebcdic_ii[i]; + } + extern int foo; -if test $ac_compiler_gnu = yes; then - GFC=yes -else - GFC= +int +main () +{ +return use_ascii (foo) == use_ebcdic (foo); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then + ac_cv_c_bigendian=yes + fi + if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then + if test "$ac_cv_c_bigendian" = unknown; then + ac_cv_c_bigendian=no + else + # finding both strings is unlikely to happen, but who knows? + ac_cv_c_bigendian=unknown + fi + fi fi -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ - { $as_echo "$as_me:${as_lineno-$LINENO}: checking what $FC does with modules" >&5 -$as_echo_n "checking what $FC does with modules... " >&6; } -ac_ext=${ac_fc_srcext-f} -ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5' -ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_fc_compiler_gnu + /* Are we little or big endian? From Harbison&Steele. */ + union + { + long int l; + char c[sizeof (long int)]; + } u; + u.l = 1; + return u.c[sizeof (long int) - 1] == 1; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_c_bigendian=no +else + ac_cv_c_bigendian=yes +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi -test -d conftestdir || mkdir conftestdir -cd conftestdir -rm -rf * + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 +$as_echo "$ac_cv_c_bigendian" >&6; } + case $ac_cv_c_bigendian in #( + yes) + $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h +;; #( + no) + ;; #( + universal) -cat >conftest.$ac_ext <>confdefs.h -eval $ac_compile -modfiles="" -F9XMODEXT="" + ;; #( + *) + as_fn_error $? "unknown endianness + presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; + esac -for f in conftest.o module.mod MODULE.mod module.M MODULE.M; do - if test -f "$f" ; then - modfiles="$f" +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of char" >&5 +$as_echo_n "checking size of char... " >&6; } +if ${ac_cv_sizeof_char+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (char))" "ac_cv_sizeof_char" "$ac_includes_default"; then : - case "$f" in - *.o) F9XMODEXT="o" ;; - *.mod) F9XMODEXT="mod" ;; - *.M) F9XMODEXT="M" ;; - esac - fi -done +else + if test "$ac_cv_type_char" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (char) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_char=0 + fi +fi -echo $modfiles 6>&1 -if test "$modfiles" = file.o; then - echo $ac_n "checking whether $FC -em is saner""... $ac_c" 1>&6 - OLD_FCFLAGS=$FCFLAGS - FCFLAGS="$FCFLAGS -em" - eval $ac_compile - modfiles="" - for f in file.o module.mod MODULE.mod module.M MODULE.M; do - test -f $f && modfiles="$f" - done - if test "$modfiles" = "file.o"; then - FCFLAGS=$OLD_FCFLAGS - echo no 6>&1 - else - echo yes 6>&1 - fi fi -cd .. +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_char" >&5 +$as_echo "$ac_cv_sizeof_char" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how $FC finds modules" >&5 -$as_echo_n "checking how $FC finds modules... " >&6; } -for flag in "-I" "-M" "-p"; do - cat >conftest.$ac_ext <>confdefs.h <<_ACEOF +#define SIZEOF_CHAR $ac_cv_sizeof_char +_ACEOF - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - F9XMODFLAG=$flag - break - fi -done -if test -n "$F9XMODFLAG"; then - echo $F9XMODFLAG 1>&6 - FCFLAGS="$F9XMODFLAG. $FCFLAGS" +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of short" >&5 +$as_echo_n "checking size of short... " >&6; } +if ${ac_cv_sizeof_short+:} false; then : + $as_echo_n "(cached) " >&6 else - echo unknown 1>&6 -fi + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (short))" "ac_cv_sizeof_short" "$ac_includes_default"; then : +else + if test "$ac_cv_type_short" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (short) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_short=0 + fi +fi -rm -rf conftest* -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_short" >&5 +$as_echo "$ac_cv_sizeof_short" >&6; } - ## Change to the Fortran 90 language - ac_ext=${ac_fc_srcext-f} -ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5' -ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_fc_compiler_gnu +cat >>confdefs.h <<_ACEOF +#define SIZEOF_SHORT $ac_cv_sizeof_short +_ACEOF - ## -------------------------------------------------------------------- - ## Define wrappers for the C compiler to use Fortran function names - ## - ac_ext=${ac_fc_srcext-f} -ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5' -ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_fc_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to get verbose linking output from $FC" >&5 -$as_echo_n "checking how to get verbose linking output from $FC... " >&6; } -if ${ac_cv_prog_fc_v+:} false; then : +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of int" >&5 +$as_echo_n "checking size of int... " >&6; } +if ${ac_cv_sizeof_int+:} false; then : $as_echo_n "(cached) " >&6 else - cat > conftest.$ac_ext <<_ACEOF - program main + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (int))" "ac_cv_sizeof_int" "$ac_includes_default"; then : - end -_ACEOF -if ac_fn_fc_try_compile "$LINENO"; then : - ac_cv_prog_fc_v= -# Try some options frequently used verbose output -for ac_verb in -v -verbose --verbose -V -\#\#\#; do - cat > conftest.$ac_ext <<_ACEOF - program main +else + if test "$ac_cv_type_int" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (int) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_int=0 + fi +fi - end +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_int" >&5 +$as_echo "$ac_cv_sizeof_int" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_INT $ac_cv_sizeof_int _ACEOF -# Compile and link our simple test program by passing a flag (argument -# 1 to this macro) to the Fortran compiler in order to get -# "verbose" output that we can then parse for the Fortran linker -# flags. -ac_save_FCFLAGS=$FCFLAGS -FCFLAGS="$FCFLAGS $ac_verb" -eval "set x $ac_link" -shift -$as_echo "$as_me:${as_lineno-$LINENO}: $*" >&5 -# gfortran 4.3 outputs lines setting COLLECT_GCC_OPTIONS, COMPILER_PATH, -# LIBRARY_PATH; skip all such settings. -ac_fc_v_output=`eval $ac_link 5>&1 2>&1 | - sed '/^Driving:/d; /^Configured with:/d; - '"/^[_$as_cr_Letters][_$as_cr_alnum]*=/d"` -$as_echo "$ac_fc_v_output" >&5 -FCFLAGS=$ac_save_FCFLAGS -rm -rf conftest* +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of unsigned" >&5 +$as_echo_n "checking size of unsigned... " >&6; } +if ${ac_cv_sizeof_unsigned+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (unsigned))" "ac_cv_sizeof_unsigned" "$ac_includes_default"; then : -# On HP/UX there is a line like: "LPATH is: /foo:/bar:/baz" where -# /foo, /bar, and /baz are search directories for the Fortran linker. -# Here, we change these into -L/foo -L/bar -L/baz (and put it first): -ac_fc_v_output="`echo $ac_fc_v_output | - grep 'LPATH is:' | - sed 's|.*LPATH is\(: *[^ ]*\).*|\1|;s|: */| -L/|g'` $ac_fc_v_output" +else + if test "$ac_cv_type_unsigned" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (unsigned) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_unsigned=0 + fi +fi -# FIXME: we keep getting bitten by quoted arguments; a more general fix -# that detects unbalanced quotes in FLIBS should be implemented -# and (ugh) tested at some point. -case $ac_fc_v_output in - # With xlf replace commas with spaces, - # and remove "-link" and closing parenthesis. - *xlfentry*) - ac_fc_v_output=`echo $ac_fc_v_output | - sed ' - s/,/ /g - s/ -link / /g - s/) *$// - ' - ` ;; +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_unsigned" >&5 +$as_echo "$ac_cv_sizeof_unsigned" >&6; } - # With Intel ifc, ignore the quoted -mGLOB_options_string stuff (quoted - # $LIBS confuse us, and the libraries appear later in the output anyway). - *mGLOB_options_string*) - ac_fc_v_output=`echo $ac_fc_v_output | sed 's/"-mGLOB[^"]*"/ /g'` ;; - # Portland Group compiler has singly- or doubly-quoted -cmdline argument - # Singly-quoted arguments were reported for versions 5.2-4 and 6.0-4. - # Doubly-quoted arguments were reported for "PGF90/x86 Linux/x86 5.0-2". - *-cmdline\ * | *-ignore\ * | *-def\ *) - ac_fc_v_output=`echo $ac_fc_v_output | sed "\ - s/-cmdline *'[^']*'/ /g; s/-cmdline *\"[^\"]*\"/ /g - s/-ignore *'[^']*'/ /g; s/-ignore *\"[^\"]*\"/ /g - s/-def *'[^']*'/ /g; s/-def *\"[^\"]*\"/ /g"` ;; - # If we are using fort77 (the f2c wrapper) then filter output and delete quotes. - *fort77*f2c*gcc*) - ac_fc_v_output=`echo "$ac_fc_v_output" | sed -n ' - /:[ ]\+Running[ ]\{1,\}"gcc"/{ - /"-c"/d - /[.]c"*/d - s/^.*"gcc"/"gcc"/ - s/"//gp - }'` ;; +cat >>confdefs.h <<_ACEOF +#define SIZEOF_UNSIGNED $ac_cv_sizeof_unsigned +_ACEOF - # If we are using Cray Fortran then delete quotes. - *cft90*) - ac_fc_v_output=`echo $ac_fc_v_output | sed 's/"//g'` ;; -esac +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long" >&5 +$as_echo_n "checking size of long... " >&6; } +if ${ac_cv_sizeof_long+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long" "$ac_includes_default"; then : - # look for -l* and *.a constructs in the output - for ac_arg in $ac_fc_v_output; do - case $ac_arg in - [\\/]*.a | ?:[\\/]*.a | -[lLRu]*) - ac_cv_prog_fc_v=$ac_verb - break 2 ;; - esac - done -done -if test -z "$ac_cv_prog_fc_v"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cannot determine how to obtain linking information from $FC" >&5 -$as_echo "$as_me: WARNING: cannot determine how to obtain linking information from $FC" >&2;} -fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: compilation failed" >&5 -$as_echo "$as_me: WARNING: compilation failed" >&2;} + if test "$ac_cv_type_long" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (long) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_long=0 + fi fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_fc_v" >&5 -$as_echo "$ac_cv_prog_fc_v" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Fortran libraries of $FC" >&5 -$as_echo_n "checking for Fortran libraries of $FC... " >&6; } -if ${ac_cv_fc_libs+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "x$FCLIBS" != "x"; then - ac_cv_fc_libs="$FCLIBS" # Let the user override the test. -else +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long" >&5 +$as_echo "$ac_cv_sizeof_long" >&6; } -cat > conftest.$ac_ext <<_ACEOF - program main - end -_ACEOF -# Compile and link our simple test program by passing a flag (argument -# 1 to this macro) to the Fortran compiler in order to get -# "verbose" output that we can then parse for the Fortran linker -# flags. -ac_save_FCFLAGS=$FCFLAGS -FCFLAGS="$FCFLAGS $ac_cv_prog_fc_v" -eval "set x $ac_link" -shift -$as_echo "$as_me:${as_lineno-$LINENO}: $*" >&5 -# gfortran 4.3 outputs lines setting COLLECT_GCC_OPTIONS, COMPILER_PATH, -# LIBRARY_PATH; skip all such settings. -ac_fc_v_output=`eval $ac_link 5>&1 2>&1 | - sed '/^Driving:/d; /^Configured with:/d; - '"/^[_$as_cr_Letters][_$as_cr_alnum]*=/d"` -$as_echo "$ac_fc_v_output" >&5 -FCFLAGS=$ac_save_FCFLAGS +cat >>confdefs.h <<_ACEOF +#define SIZEOF_LONG $ac_cv_sizeof_long +_ACEOF -rm -rf conftest* -# On HP/UX there is a line like: "LPATH is: /foo:/bar:/baz" where -# /foo, /bar, and /baz are search directories for the Fortran linker. -# Here, we change these into -L/foo -L/bar -L/baz (and put it first): -ac_fc_v_output="`echo $ac_fc_v_output | - grep 'LPATH is:' | - sed 's|.*LPATH is\(: *[^ ]*\).*|\1|;s|: */| -L/|g'` $ac_fc_v_output" +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long long" >&5 +$as_echo_n "checking size of long long... " >&6; } +if ${ac_cv_sizeof_long_long+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long long))" "ac_cv_sizeof_long_long" "$ac_includes_default"; then : -# FIXME: we keep getting bitten by quoted arguments; a more general fix -# that detects unbalanced quotes in FLIBS should be implemented -# and (ugh) tested at some point. -case $ac_fc_v_output in - # With xlf replace commas with spaces, - # and remove "-link" and closing parenthesis. - *xlfentry*) - ac_fc_v_output=`echo $ac_fc_v_output | - sed ' - s/,/ /g - s/ -link / /g - s/) *$// - ' - ` ;; +else + if test "$ac_cv_type_long_long" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (long long) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_long_long=0 + fi +fi - # With Intel ifc, ignore the quoted -mGLOB_options_string stuff (quoted - # $LIBS confuse us, and the libraries appear later in the output anyway). - *mGLOB_options_string*) - ac_fc_v_output=`echo $ac_fc_v_output | sed 's/"-mGLOB[^"]*"/ /g'` ;; +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long_long" >&5 +$as_echo "$ac_cv_sizeof_long_long" >&6; } - # Portland Group compiler has singly- or doubly-quoted -cmdline argument - # Singly-quoted arguments were reported for versions 5.2-4 and 6.0-4. - # Doubly-quoted arguments were reported for "PGF90/x86 Linux/x86 5.0-2". - *-cmdline\ * | *-ignore\ * | *-def\ *) - ac_fc_v_output=`echo $ac_fc_v_output | sed "\ - s/-cmdline *'[^']*'/ /g; s/-cmdline *\"[^\"]*\"/ /g - s/-ignore *'[^']*'/ /g; s/-ignore *\"[^\"]*\"/ /g - s/-def *'[^']*'/ /g; s/-def *\"[^\"]*\"/ /g"` ;; - # If we are using fort77 (the f2c wrapper) then filter output and delete quotes. - *fort77*f2c*gcc*) - ac_fc_v_output=`echo "$ac_fc_v_output" | sed -n ' - /:[ ]\+Running[ ]\{1,\}"gcc"/{ - /"-c"/d - /[.]c"*/d - s/^.*"gcc"/"gcc"/ - s/"//gp - }'` ;; - # If we are using Cray Fortran then delete quotes. - *cft90*) - ac_fc_v_output=`echo $ac_fc_v_output | sed 's/"//g'` ;; -esac +cat >>confdefs.h <<_ACEOF +#define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long +_ACEOF +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of __int64" >&5 +$as_echo_n "checking size of __int64... " >&6; } +if ${ac_cv_sizeof___int64+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (__int64))" "ac_cv_sizeof___int64" "$ac_includes_default"; then : -ac_cv_fc_libs= +else + if test "$ac_cv_type___int64" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (__int64) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof___int64=0 + fi +fi -# Save positional arguments (if any) -ac_save_positional="$@" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof___int64" >&5 +$as_echo "$ac_cv_sizeof___int64" >&6; } -set X $ac_fc_v_output -while test $# != 1; do - shift - ac_arg=$1 - case $ac_arg in - [\\/]*.a | ?:[\\/]*.a) - ac_exists=false - for ac_i in $ac_cv_fc_libs; do - if test x"$ac_arg" = x"$ac_i"; then - ac_exists=true - break - fi - done - if test x"$ac_exists" = xtrue; then : -else - ac_cv_fc_libs="$ac_cv_fc_libs $ac_arg" -fi - ;; - -bI:*) - ac_exists=false - for ac_i in $ac_cv_fc_libs; do - if test x"$ac_arg" = x"$ac_i"; then - ac_exists=true - break - fi - done +cat >>confdefs.h <<_ACEOF +#define SIZEOF___INT64 $ac_cv_sizeof___int64 +_ACEOF - if test x"$ac_exists" = xtrue; then : +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of float" >&5 +$as_echo_n "checking size of float... " >&6; } +if ${ac_cv_sizeof_float+:} false; then : + $as_echo_n "(cached) " >&6 else - if test "$ac_compiler_gnu" = yes; then - for ac_link_opt in $ac_arg; do - ac_cv_fc_libs="$ac_cv_fc_libs -Xlinker $ac_link_opt" - done + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (float))" "ac_cv_sizeof_float" "$ac_includes_default"; then : + else - ac_cv_fc_libs="$ac_cv_fc_libs $ac_arg" + if test "$ac_cv_type_float" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (float) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_float=0 + fi fi + fi - ;; - # Ignore these flags. - -lang* | -lcrt*.o | -lc | -lgcc* | -lSystem | -libmil | -little \ - |-LANG:=* | -LIST:* | -LNO:* | -link) - ;; - -lkernel32) - case $host_os in - *cygwin*) ;; - *) ac_cv_fc_libs="$ac_cv_fc_libs $ac_arg" - ;; - esac - ;; - -[LRuYz]) - # These flags, when seen by themselves, take an argument. - # We remove the space between option and argument and re-iterate - # unless we find an empty arg or a new option (starting with -) - case $2 in - "" | -*);; - *) - ac_arg="$ac_arg$2" - shift; shift - set X $ac_arg "$@" - ;; - esac - ;; - -YP,*) - for ac_j in `$as_echo "$ac_arg" | sed -e 's/-YP,/-L/;s/:/ -L/g'`; do - ac_exists=false - for ac_i in $ac_cv_fc_libs; do - if test x"$ac_j" = x"$ac_i"; then - ac_exists=true - break - fi - done +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_float" >&5 +$as_echo "$ac_cv_sizeof_float" >&6; } - if test x"$ac_exists" = xtrue; then : -else - ac_arg="$ac_arg $ac_j" - ac_cv_fc_libs="$ac_cv_fc_libs $ac_j" -fi - done - ;; - -[lLR]*) - ac_exists=false - for ac_i in $ac_cv_fc_libs; do - if test x"$ac_arg" = x"$ac_i"; then - ac_exists=true - break - fi - done - if test x"$ac_exists" = xtrue; then : +cat >>confdefs.h <<_ACEOF +#define SIZEOF_FLOAT $ac_cv_sizeof_float +_ACEOF + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of double" >&5 +$as_echo_n "checking size of double... " >&6; } +if ${ac_cv_sizeof_double+:} false; then : + $as_echo_n "(cached) " >&6 else - ac_cv_fc_libs="$ac_cv_fc_libs $ac_arg" -fi - ;; - -zallextract*| -zdefaultextract) - ac_cv_fc_libs="$ac_cv_fc_libs $ac_arg" - ;; - # Ignore everything else. - esac -done -# restore positional arguments -set X $ac_save_positional; shift + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (double))" "ac_cv_sizeof_double" "$ac_includes_default"; then : -# We only consider "LD_RUN_PATH" on Solaris systems. If this is seen, -# then we insist that the "run path" must be an absolute path (i.e. it -# must begin with a "/"). -case `(uname -sr) 2>/dev/null` in - "SunOS 5"*) - ac_ld_run_path=`$as_echo "$ac_fc_v_output" | - sed -n 's,^.*LD_RUN_PATH *= *\(/[^ ]*\).*$,-R\1,p'` - test "x$ac_ld_run_path" != x && - if test "$ac_compiler_gnu" = yes; then - for ac_link_opt in $ac_ld_run_path; do - ac_cv_fc_libs="$ac_cv_fc_libs -Xlinker $ac_link_opt" - done else - ac_cv_fc_libs="$ac_cv_fc_libs $ac_ld_run_path" + if test "$ac_cv_type_double" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (double) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_double=0 + fi fi - ;; -esac -fi # test "x$[]_AC_LANG_PREFIX[]LIBS" = "x" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_fc_libs" >&5 -$as_echo "$ac_cv_fc_libs" >&6; } -FCLIBS="$ac_cv_fc_libs" +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_double" >&5 +$as_echo "$ac_cv_sizeof_double" >&6; } -ac_ext=${ac_fc_srcext-f} -ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5' -ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_fc_compiler_gnu +cat >>confdefs.h <<_ACEOF +#define SIZEOF_DOUBLE $ac_cv_sizeof_double +_ACEOF -ac_ext=${ac_fc_srcext-f} -ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5' -ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_fc_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dummy main to link with Fortran libraries" >&5 -$as_echo_n "checking for dummy main to link with Fortran libraries... " >&6; } -if ${ac_cv_fc_dummy_main+:} false; then : +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long double" >&5 +$as_echo_n "checking size of long double... " >&6; } +if ${ac_cv_sizeof_long_double+:} false; then : $as_echo_n "(cached) " >&6 else - ac_fc_dm_save_LIBS=$LIBS - LIBS="$LIBS $FCLIBS" - ac_fortran_dm_var=FC_DUMMY_MAIN - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long double))" "ac_cv_sizeof_long_double" "$ac_includes_default"; then : - # First, try linking without a dummy main: - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ +else + if test "$ac_cv_type_long_double" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (long double) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_long_double=0 + fi +fi -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus - extern "C" -# endif - int FC_DUMMY_MAIN() { return 1; } -#endif -#endif -int -main () -{ +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long_double" >&5 +$as_echo "$ac_cv_sizeof_long_double" >&6; } - ; - return 0; -} + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_LONG_DOUBLE $ac_cv_sizeof_long_double _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_fortran_dummy_main=none -else - ac_cv_fortran_dummy_main=unknown -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - if test $ac_cv_fortran_dummy_main = unknown; then - for ac_func in MAIN__ MAIN_ __main MAIN _MAIN __MAIN main_ main__ _main; do - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#define $ac_fortran_dm_var $ac_func -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus - extern "C" -# endif - int FC_DUMMY_MAIN() { return 1; } -#endif -#endif -int -main () -{ - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_fortran_dummy_main=$ac_func; break + +## Check for non-standard extenstion __FLOAT128 +HAVE_FLOAT128=0 +HAVE_QUADMATH=0 +FLT128_DIG=0 +LDBL_DIG=0 + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of __float128" >&5 +$as_echo_n "checking size of __float128... " >&6; } +if ${ac_cv_sizeof___float128+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (__float128))" "ac_cv_sizeof___float128" "$ac_includes_default"; then : + +else + if test "$ac_cv_type___float128" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (__float128) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof___float128=0 + fi fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - done - fi - ac_ext=${ac_fc_srcext-f} -ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5' -ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_fc_compiler_gnu - ac_cv_fc_dummy_main=$ac_cv_fortran_dummy_main - rm -rf conftest* - LIBS=$ac_fc_dm_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_fc_dummy_main" >&5 -$as_echo "$ac_cv_fc_dummy_main" >&6; } -FC_DUMMY_MAIN=$ac_cv_fc_dummy_main -if test "$FC_DUMMY_MAIN" != unknown; then : - if test $FC_DUMMY_MAIN != none; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof___float128" >&5 +$as_echo "$ac_cv_sizeof___float128" >&6; } + + cat >>confdefs.h <<_ACEOF -#define FC_DUMMY_MAIN $FC_DUMMY_MAIN +#define SIZEOF___FLOAT128 $ac_cv_sizeof___float128 _ACEOF - if test "x$ac_cv_fc_dummy_main" = "x$ac_cv_f77_dummy_main"; then -$as_echo "#define FC_DUMMY_MAIN_EQ_F77 1" >>confdefs.h +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of _Quad" >&5 +$as_echo_n "checking size of _Quad... " >&6; } +if ${ac_cv_sizeof__Quad+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (_Quad))" "ac_cv_sizeof__Quad" "$ac_includes_default"; then : - fi -fi else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 + if test "$ac_cv_type__Quad" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "linking to Fortran libraries from C fails +as_fn_error 77 "cannot compute sizeof (_Quad) See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof__Quad=0 + fi fi -ac_ext=${ac_fc_srcext-f} -ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5' -ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_fc_compiler_gnu +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof__Quad" >&5 +$as_echo "$ac_cv_sizeof__Quad" >&6; } -ac_ext=${ac_fc_srcext-f} -ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5' -ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_fc_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Fortran name-mangling scheme" >&5 -$as_echo_n "checking for Fortran name-mangling scheme... " >&6; } -if ${ac_cv_fc_mangling+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat > conftest.$ac_ext <<_ACEOF - subroutine foobar() - return - end - subroutine foo_bar() - return - end -_ACEOF -if ac_fn_fc_try_compile "$LINENO"; then : - mv conftest.$ac_objext cfortran_test.$ac_objext - ac_save_LIBS=$LIBS - LIBS="cfortran_test.$ac_objext $LIBS $FCLIBS" - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - ac_success=no - for ac_foobar in foobar FOOBAR; do - for ac_underscore in "" "_"; do - ac_func="$ac_foobar$ac_underscore" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ +cat >>confdefs.h <<_ACEOF +#define SIZEOF__QUAD $ac_cv_sizeof__Quad +_ACEOF -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus - extern "C" -# endif - int FC_DUMMY_MAIN() { return 1; } -#endif -#endif -int -main () -{ -return $ac_func (); - ; - return 0; -} + +for ac_header in quadmath.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "quadmath.h" "ac_cv_header_quadmath_h" "$ac_includes_default" +if test "x$ac_cv_header_quadmath_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_QUADMATH_H 1 _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_success=yes; break 2 + HAVE_QUADMATH=1 fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - done - done - ac_ext=${ac_fc_srcext-f} -ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5' -ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_fc_compiler_gnu - if test "$ac_success" = "yes"; then - case $ac_foobar in - foobar) - ac_case=lower - ac_foo_bar=foo_bar - ;; - FOOBAR) - ac_case=upper - ac_foo_bar=FOO_BAR - ;; - esac +done - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - ac_success_extra=no - for ac_extra in "" "_"; do - ac_func="$ac_foo_bar$ac_underscore$ac_extra" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking maximum decimal precision for C" >&5 +$as_echo_n "checking maximum decimal precision for C... " >&6; } +rm -f pac_Cconftest.out + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus - extern "C" -# endif - int FC_DUMMY_MAIN() { return 1; } -#endif -#endif + + #include + #include + #define CHECK_FLOAT128 $ac_cv_sizeof___float128 + #if CHECK_FLOAT128!=0 + # if $HAVE_QUADMATH!=0 + #include + # endif + # ifdef FLT128_DIG + #define C_FLT128_DIG FLT128_DIG + # else + #define C_FLT128_DIG 0 + # endif + #else + #define C_FLT128_DIG 0 + #endif + #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define C_LDBL_DIG DECIMAL_DIG + #else + #define C_LDBL_DIG LDBL_DIG + #endif + int main () { -return $ac_func (); + + FILE * pFile; + pFile = fopen("pac_Cconftest.out","w"); + fprintf(pFile, "%d\n%d\n", C_LDBL_DIG, C_FLT128_DIG); + ; return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_success_extra=yes; break -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - done - ac_ext=${ac_fc_srcext-f} -ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5' -ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_fc_compiler_gnu - - if test "$ac_success_extra" = "yes"; then - ac_cv_fc_mangling="$ac_case case" - if test -z "$ac_underscore"; then - ac_cv_fc_mangling="$ac_cv_fc_mangling, no underscore" - else - ac_cv_fc_mangling="$ac_cv_fc_mangling, underscore" - fi - if test -z "$ac_extra"; then - ac_cv_fc_mangling="$ac_cv_fc_mangling, no extra underscore" - else - ac_cv_fc_mangling="$ac_cv_fc_mangling, extra underscore" - fi - else - ac_cv_fc_mangling="unknown" - fi - else - ac_cv_fc_mangling="unknown" - fi - LIBS=$ac_save_LIBS - rm -rf conftest* - rm -f cfortran_test* -else +_ACEOF + if test "$cross_compiling" = yes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot compile a simple Fortran program +as_fn_error $? "cannot run test program while cross compiling See \`config.log' for more details" "$LINENO" 5; } -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +else + if ac_fn_c_try_run "$LINENO"; then : -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_fc_mangling" >&5 -$as_echo "$ac_cv_fc_mangling" >&6; } + if test -s pac_Cconftest.out ; then + LDBL_DIG="`perl -ne '$. == 1 && print && exit' pac_Cconftest.out`" + FLT128_DIG="`perl -ne '$. == 2 && print && exit' pac_Cconftest.out`" + else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: No output from test program!" >&5 +$as_echo "$as_me: WARNING: No output from test program!" >&2;} + fi + rm -f pac_Cconftest.out -ac_ext=${ac_fc_srcext-f} -ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5' -ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_fc_compiler_gnu +else -ac_ext=${ac_fc_srcext-f} -ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5' -ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_fc_compiler_gnu -case $ac_cv_fc_mangling in - "lower case, no underscore, no extra underscore") - $as_echo "#define FC_FUNC(name,NAME) name" >>confdefs.h + as_fn_error $? "C program fails to build or run!" "$LINENO" 5 - $as_echo "#define FC_FUNC_(name,NAME) name" >>confdefs.h - ;; - "lower case, no underscore, extra underscore") - $as_echo "#define FC_FUNC(name,NAME) name" >>confdefs.h +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam +fi - $as_echo "#define FC_FUNC_(name,NAME) name ## _" >>confdefs.h - ;; - "lower case, underscore, no extra underscore") - $as_echo "#define FC_FUNC(name,NAME) name ## _" >>confdefs.h - $as_echo "#define FC_FUNC_(name,NAME) name ## _" >>confdefs.h - ;; - "lower case, underscore, extra underscore") - $as_echo "#define FC_FUNC(name,NAME) name ## _" >>confdefs.h - - $as_echo "#define FC_FUNC_(name,NAME) name ## __" >>confdefs.h - ;; - "upper case, no underscore, no extra underscore") - $as_echo "#define FC_FUNC(name,NAME) NAME" >>confdefs.h - - $as_echo "#define FC_FUNC_(name,NAME) NAME" >>confdefs.h - ;; - "upper case, no underscore, extra underscore") - $as_echo "#define FC_FUNC(name,NAME) NAME" >>confdefs.h - - $as_echo "#define FC_FUNC_(name,NAME) NAME ## _" >>confdefs.h - ;; - "upper case, underscore, no extra underscore") - $as_echo "#define FC_FUNC(name,NAME) NAME ## _" >>confdefs.h - - $as_echo "#define FC_FUNC_(name,NAME) NAME ## _" >>confdefs.h - ;; - "upper case, underscore, extra underscore") - $as_echo "#define FC_FUNC(name,NAME) NAME ## _" >>confdefs.h - - $as_echo "#define FC_FUNC_(name,NAME) NAME ## __" >>confdefs.h - ;; - *) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unknown Fortran name-mangling scheme" >&5 -$as_echo "$as_me: WARNING: unknown Fortran name-mangling scheme" >&2;} - ;; -esac -ac_ext=${ac_fc_srcext-f} -ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5' -ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_fc_compiler_gnu - - - ## -------------------------------------------------------------------- - ## See if the fortran compiler supports the intrinsic function "SIZEOF" +if test "$ac_cv_sizeof___float128" != 0 && test "$FLT128_DIG" != 0 ; then - HAVE_SIZEOF_FORTRAN="no" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if Fortran compiler supports intrinsic SIZEOF" >&5 -$as_echo_n "checking if Fortran compiler supports intrinsic SIZEOF... " >&6; } - cat > conftest.$ac_ext <<_ACEOF - - PROGRAM main - i = sizeof(x) - END PROGRAM +$as_echo "#define HAVE_FLOAT128 1" >>confdefs.h -_ACEOF -if ac_fn_fc_try_link "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - HAVE_SIZEOF_FORTRAN="yes" + PAC_C_MAX_REAL_PRECISION=$FLT128_DIG else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + PAC_C_MAX_REAL_PRECISION=$LDBL_DIG fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - - - ## See if the fortran compiler supports the intrinsic function "C_SIZEOF" - - HAVE_C_SIZEOF_FORTRAN="no" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if Fortran compiler supports intrinsic C_SIZEOF" >&5 -$as_echo_n "checking if Fortran compiler supports intrinsic C_SIZEOF... " >&6; } - cat > conftest.$ac_ext <<_ACEOF - - PROGRAM main - USE ISO_C_BINDING - INTEGER(C_INT) :: a - INTEGER(C_SIZE_T) :: result - result = C_SIZEOF(a) - END PROGRAM +cat >>confdefs.h <<_ACEOF +#define PAC_C_MAX_REAL_PRECISION $PAC_C_MAX_REAL_PRECISION _ACEOF -if ac_fn_fc_try_link "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - HAVE_C_SIZEOF_FORTRAN="yes" -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - - - ## See if the fortran compiler supports the intrinsic function "STORAGE_SIZE" - - HAVE_STORAGE_SIZE_FORTRAN="no" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if Fortran compiler supports intrinsic STORAGE_SIZE" >&5 -$as_echo_n "checking if Fortran compiler supports intrinsic STORAGE_SIZE... " >&6; } - cat > conftest.$ac_ext <<_ACEOF - - PROGRAM main - INTEGER :: a - INTEGER :: result - result = STORAGE_SIZE(a) - END PROGRAM -_ACEOF -if ac_fn_fc_try_link "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - HAVE_STORAGE_SIZE_FORTRAN="yes" -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $PAC_C_MAX_REAL_PRECISION" >&5 +$as_echo "$PAC_C_MAX_REAL_PRECISION" >&6; } +## ---------------------------------------------------------------------- +## Check if they would like the Fortran interface compiled +## + HDF5_INTERFACES="" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if Fortran interface enabled" >&5 +$as_echo_n "checking if Fortran interface enabled... " >&6; } +# Check whether --enable-fortran was given. +if test "${enable_fortran+set}" = set; then : + enableval=$enable_fortran; HDF_FORTRAN=$enableval fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - - - - ## Check to see if -r8 was specified to determine if we need to - ## compile the DOUBLE PRECISION interfaces. - - FORTRAN_DEFAULT_REALisDBLE="no" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if Fortran default REAL is DOUBLE PRECISION" >&5 -$as_echo_n "checking if Fortran default REAL is DOUBLE PRECISION... " >&6; } - cat > conftest.$ac_ext <<_ACEOF - - MODULE type_mod - INTERFACE h5t - MODULE PROCEDURE h5t_real - MODULE PROCEDURE h5t_dble - END INTERFACE - CONTAINS - SUBROUTINE h5t_real(r) - REAL :: r - END SUBROUTINE h5t_real - SUBROUTINE h5t_dble(d) - DOUBLE PRECISION :: d - END SUBROUTINE h5t_dble - END MODULE type_mod - PROGRAM main - USE type_mod - REAL :: r - DOUBLE PRECISION :: d - CALL h5t(r) - CALL h5t(d) - END PROGRAM main -_ACEOF -if ac_fn_fc_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +if test "X$HDF_FORTRAN" = "Xyes"; then + echo "yes" else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - FORTRAN_DEFAULT_REALisDBLE="yes" + echo "no" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - - - if test "X$HDF_FORTRAN2003" = "Xyes"; then - ## Checking if the compiler supports the required Fortran 2003 features and - ## disable Fortran 2003 if it does not. - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if Fortran compiler version compatible with Fortran 2003 HDF" >&5 -$as_echo_n "checking if Fortran compiler version compatible with Fortran 2003 HDF... " >&6; } - HAVE_FORTRAN_2003="no" - HAVE_F2003_REQUIREMENTS="no" - cat > conftest.$ac_ext <<_ACEOF - program main - - - USE iso_c_binding - IMPLICIT NONE - TYPE(C_PTR) :: ptr - TYPE(C_FUNPTR) :: funptr - CHARACTER(LEN=80, KIND=c_char), TARGET :: ichr +if test "X$HDF_FORTRAN" = "Xyes"; then - ptr = C_LOC(ichr(1:1)) +## We will output an include file for Fortran, H5config_f.inc which +## contains various configure definitions used by the Fortran Library. +## Prepend H5_ to all macro names. This avoids name conflict between HDF5 macro +## names and those generated by another software package that uses the HDF5 library. + ac_config_headers="$ac_config_headers fortran/src/H5config_f.inc" - end -_ACEOF -if ac_fn_fc_try_link "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - HAVE_F2003_REQUIREMENTS=yes -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext + HDF_FORTRAN=yes + HDF5_INTERFACES="$HDF5_INTERFACES fortran" - if test "X$HAVE_F2003_REQUIREMENTS" = "Xno"; then - as_fn_error $? "Fortran compiler lacks required Fortran 2003 features; unsupported Fortran 2003 compiler, remove --enable-fortran2003" "$LINENO" 5 - else - HAVE_FORTRAN_2003="yes" - fi - fi -else - FC="no" -fi + ## -------------------------------------------------------------------- + ## HDF5 integer variables for the H5fortran_types.f90 file. + ## -## Change back to the C language -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - if test "X$HAVE_SIZEOF_FORTRAN" = "Xyes"; then - FORTRAN_HAVE_SIZEOF_TRUE= - FORTRAN_HAVE_SIZEOF_FALSE='#' -else - FORTRAN_HAVE_SIZEOF_TRUE='#' - FORTRAN_HAVE_SIZEOF_FALSE= -fi - if test "X$HAVE_C_SIZEOF_FORTRAN" = "Xyes"; then - FORTRAN_HAVE_C_SIZEOF_TRUE= - FORTRAN_HAVE_C_SIZEOF_FALSE='#' -else - FORTRAN_HAVE_C_SIZEOF_TRUE='#' - FORTRAN_HAVE_C_SIZEOF_FALSE= -fi - if test "X$HAVE_STORAGE_SIZE_FORTRAN" = "Xyes"; then - FORTRAN_HAVE_STORAGE_SIZE_TRUE= - FORTRAN_HAVE_STORAGE_SIZE_FALSE='#' -else - FORTRAN_HAVE_STORAGE_SIZE_TRUE='#' - FORTRAN_HAVE_STORAGE_SIZE_FALSE= -fi - if test "X$HAVE_FORTRAN_2003" = "Xyes"; then - FORTRAN_2003_CONDITIONAL_F_TRUE= - FORTRAN_2003_CONDITIONAL_F_FALSE='#' -else - FORTRAN_2003_CONDITIONAL_F_TRUE='#' - FORTRAN_2003_CONDITIONAL_F_FALSE= -fi - if test "X$FORTRAN_DEFAULT_REALisDBLE" = "Xyes"; then - FORTRAN_DEFAULT_REALisDBLE_F_TRUE= - FORTRAN_DEFAULT_REALisDBLE_F_FALSE='#' -else - FORTRAN_DEFAULT_REALisDBLE_F_TRUE='#' - FORTRAN_DEFAULT_REALisDBLE_F_FALSE= -fi -## ---------------------------------------------------------------------- -## Check if they would like the C++ interface compiled -## -## We need to check for a C++ compiler unconditionally, since -## AC_PROG_CXX defines some macros that Automake 1.9.x uses and will -## miss even if c++ is not enabled. - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -if test -z "$CXX"; then - if test -n "$CCC"; then - CXX=$CCC - else - if test -n "$ac_tool_prefix"; then - for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC + ## -------------------------------------------------------------------- + ## Fortran source extention + ## + ac_ext=${ac_fc_srcext-f} +ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5' +ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_fc_compiler_gnu +if test -n "$ac_tool_prefix"; then + for ac_prog in gfortran g95 xlf95 f95 fort ifort ifc efc pgfortran pgf95 lf95 ftn nagfor xlf90 f90 pgf90 pghpf epcf90 g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77 do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CXX+:} false; then : +if ${ac_cv_prog_FC+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$CXX"; then - ac_cv_prog_CXX="$CXX" # Let the user override the test. + if test -n "$FC"; then + ac_cv_prog_FC="$FC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -6707,7 +6390,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" + ac_cv_prog_FC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -6717,32 +6400,32 @@ IFS=$as_save_IFS fi fi -CXX=$ac_cv_prog_CXX -if test -n "$CXX"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 -$as_echo "$CXX" >&6; } +FC=$ac_cv_prog_FC +if test -n "$FC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FC" >&5 +$as_echo "$FC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - test -n "$CXX" && break + test -n "$FC" && break done fi -if test -z "$CXX"; then - ac_ct_CXX=$CXX - for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC +if test -z "$FC"; then + ac_ct_FC=$FC + for ac_prog in gfortran g95 xlf95 f95 fort ifort ifc efc pgfortran pgf95 lf95 ftn nagfor xlf90 f90 pgf90 pghpf epcf90 g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77 do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CXX+:} false; then : +if ${ac_cv_prog_ac_ct_FC+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$ac_ct_CXX"; then - ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. + if test -n "$ac_ct_FC"; then + ac_cv_prog_ac_ct_FC="$ac_ct_FC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -6751,7 +6434,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CXX="$ac_prog" + ac_cv_prog_ac_ct_FC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -6761,21 +6444,21 @@ IFS=$as_save_IFS fi fi -ac_ct_CXX=$ac_cv_prog_ac_ct_CXX -if test -n "$ac_ct_CXX"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 -$as_echo "$ac_ct_CXX" >&6; } +ac_ct_FC=$ac_cv_prog_ac_ct_FC +if test -n "$ac_ct_FC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_FC" >&5 +$as_echo "$ac_ct_FC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - test -n "$ac_ct_CXX" && break + test -n "$ac_ct_FC" && break done - if test "x$ac_ct_CXX" = x; then - CXX="g++" + if test "x$ac_ct_FC" = x; then + FC="" else case $cross_compiling:$ac_tool_warned in yes:) @@ -6783,14 +6466,13 @@ yes:) $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac - CXX=$ac_ct_CXX + FC=$ac_ct_FC fi fi - fi -fi + # Provide some information about the compiler. -$as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 +$as_echo "$as_me:${as_lineno-$LINENO}: checking for Fortran compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do @@ -6813,153 +6495,136 @@ $as_echo "$ac_try_echo"; } >&5 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done +rm -f a.out -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 -$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } -if ${ac_cv_cxx_compiler_gnu+:} false; then : +# If we don't use `.F' as extension, the preprocessor is not run on the +# input file. (Note that this only needs to work for GNU compilers.) +ac_save_ext=$ac_ext +ac_ext=F +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU Fortran compiler" >&5 +$as_echo_n "checking whether we are using the GNU Fortran compiler... " >&6; } +if ${ac_cv_fc_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus - extern "C" -# endif - int FC_DUMMY_MAIN() { return 1; } -#endif -#endif -int -main () -{ + cat > conftest.$ac_ext <<_ACEOF + program main #ifndef __GNUC__ choke me #endif - ; - return 0; -} + end _ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : +if ac_fn_fc_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -ac_cv_cxx_compiler_gnu=$ac_compiler_gnu +ac_cv_fc_compiler_gnu=$ac_compiler_gnu fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 -$as_echo "$ac_cv_cxx_compiler_gnu" >&6; } -if test $ac_compiler_gnu = yes; then - GXX=yes -else - GXX= -fi -ac_test_CXXFLAGS=${CXXFLAGS+set} -ac_save_CXXFLAGS=$CXXFLAGS -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 -$as_echo_n "checking whether $CXX accepts -g... " >&6; } -if ${ac_cv_prog_cxx_g+:} false; then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_fc_compiler_gnu" >&5 +$as_echo "$ac_cv_fc_compiler_gnu" >&6; } +ac_ext=$ac_save_ext +ac_test_FCFLAGS=${FCFLAGS+set} +ac_save_FCFLAGS=$FCFLAGS +FCFLAGS= +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $FC accepts -g" >&5 +$as_echo_n "checking whether $FC accepts -g... " >&6; } +if ${ac_cv_prog_fc_g+:} false; then : $as_echo_n "(cached) " >&6 else - ac_save_cxx_werror_flag=$ac_cxx_werror_flag - ac_cxx_werror_flag=yes - ac_cv_prog_cxx_g=no - CXXFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus - extern "C" -# endif - int FC_DUMMY_MAIN() { return 1; } -#endif -#endif -int -main () -{ + FCFLAGS=-g +cat > conftest.$ac_ext <<_ACEOF + program main - ; - return 0; -} + end _ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - ac_cv_prog_cxx_g=yes +if ac_fn_fc_try_compile "$LINENO"; then : + ac_cv_prog_fc_g=yes else - CXXFLAGS="" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus - extern "C" -# endif - int FC_DUMMY_MAIN() { return 1; } -#endif -#endif -int -main () -{ + ac_cv_prog_fc_g=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_fc_g" >&5 +$as_echo "$ac_cv_prog_fc_g" >&6; } +if test "$ac_test_FCFLAGS" = set; then + FCFLAGS=$ac_save_FCFLAGS +elif test $ac_cv_prog_fc_g = yes; then + if test "x$ac_cv_fc_compiler_gnu" = xyes; then + FCFLAGS="-g -O2" + else + FCFLAGS="-g" + fi +else + if test "x$ac_cv_fc_compiler_gnu" = xyes; then + FCFLAGS="-O2" + else + FCFLAGS= + fi +fi +if test $ac_compiler_gnu = yes; then + GFC=yes else - ac_cxx_werror_flag=$ac_save_cxx_werror_flag - CXXFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + GFC= +fi +ac_ext=${ac_fc_srcext-f} +ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5' +ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_fc_compiler_gnu -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus - extern "C" -# endif - int FC_DUMMY_MAIN() { return 1; } -#endif -#endif -int -main () -{ - ; - return 0; -} +ac_ext=${ac_fc_srcext-f} +ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5' +ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_fc_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Fortran flag to compile .f90 files" >&5 +$as_echo_n "checking for Fortran flag to compile .f90 files... " >&6; } +if ${ac_cv_fc_srcext_f90+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_ext=f90 +ac_fcflags_srcext_save=$ac_fcflags_srcext +ac_fcflags_srcext= +ac_cv_fc_srcext_f90=unknown +case $ac_ext in #( + [fF]77) ac_try=f77;; #( + *) ac_try=f95;; +esac +for ac_flag in none -qsuffix=f=f90 -Tf "-x $ac_try"; do + test "x$ac_flag" != xnone && ac_fcflags_srcext="$ac_flag" + cat > conftest.$ac_ext <<_ACEOF + program main + + end _ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - ac_cv_prog_cxx_g=yes -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +if ac_fn_fc_try_compile "$LINENO"; then : + ac_cv_fc_srcext_f90=$ac_flag; break fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_cxx_werror_flag=$ac_save_cxx_werror_flag +done +rm -f conftest.$ac_objext conftest.f90 +ac_fcflags_srcext=$ac_fcflags_srcext_save + fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 -$as_echo "$ac_cv_prog_cxx_g" >&6; } -if test "$ac_test_CXXFLAGS" = set; then - CXXFLAGS=$ac_save_CXXFLAGS -elif test $ac_cv_prog_cxx_g = yes; then - if test "$GXX" = yes; then - CXXFLAGS="-g -O2" - else - CXXFLAGS="-g" - fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_fc_srcext_f90" >&5 +$as_echo "$ac_cv_fc_srcext_f90" >&6; } +if test "x$ac_cv_fc_srcext_f90" = xunknown; then + as_fn_error $? "Fortran could not compile .f90 files" "$LINENO" 5 else - if test "$GXX" = yes; then - CXXFLAGS="-O2" + ac_fc_srcext=f90 + if test "x$ac_cv_fc_srcext_f90" = xnone; then + ac_fcflags_srcext="" + FCFLAGS_f90="" else - CXXFLAGS= + ac_fcflags_srcext=$ac_cv_fc_srcext_f90 + FCFLAGS_f90=$ac_cv_fc_srcext_f90 fi + + fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' @@ -6967,389 +6632,348 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -depcc="$CXX" am_compiler_list= -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 -$as_echo_n "checking dependency style of $depcc... " >&6; } -if ${am_cv_CXX_dependencies_compiler_type+:} false; then : + + + + ## -------------------------------------------------------------------- + ## Check for a Fortran compiler and how to include modules. + ## + ac_ext=${ac_fc_srcext-f} +ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5' +ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_fc_compiler_gnu +if test -n "$ac_tool_prefix"; then + for ac_prog in gfortran ifort pgf90 pathf90 pathf95 xlf90 xlf95 xlf2003 f90 epcf90 f95 fort lf95 g95 ifc efc gfc + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_FC+:} false; then : $as_echo_n "(cached) " >&6 else - if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then - # We make a subdir and do the tests there. Otherwise we can end up - # making bogus files that we don't know about and never remove. For - # instance it was reported that on HP-UX the gcc test will end up - # making a dummy file named 'D' -- because '-MD' means "put the output - # in D". - rm -rf conftest.dir - mkdir conftest.dir - # Copy depcomp to subdir because otherwise we won't find it if we're - # using a relative directory. - cp "$am_depcomp" conftest.dir - cd conftest.dir - # We will build objects and dependencies in a subdirectory because - # it helps to detect inapplicable dependency modes. For instance - # both Tru64's cc and ICC support -MD to output dependencies as a - # side effect of compilation, but ICC will put the dependencies in - # the current directory while Tru64 will put them in the object - # directory. - mkdir sub - - am_cv_CXX_dependencies_compiler_type=none - if test "$am_compiler_list" = ""; then - am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + if test -n "$FC"; then + ac_cv_prog_FC="$FC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_FC="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 fi - am__universal=false - case " $depcc " in #( - *\ -arch\ *\ -arch\ *) am__universal=true ;; - esac - - for depmode in $am_compiler_list; do - # Setup a source with many dependencies, because some compilers - # like to wrap large dependency lists on column 80 (with \), and - # we should not choose a depcomp mode which is confused by this. - # - # We need to recreate these files for each test, as the compiler may - # overwrite some of them when testing with obscure command lines. - # This happens at least with the AIX C compiler. - : > sub/conftest.c - for i in 1 2 3 4 5 6; do - echo '#include "conftst'$i'.h"' >> sub/conftest.c - # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with - # Solaris 10 /bin/sh. - echo '/* dummy */' > sub/conftst$i.h - done - echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf - - # We check with '-c' and '-o' for the sake of the "dashmstdout" - # mode. It turns out that the SunPro C++ compiler does not properly - # handle '-M -o', and we need to detect this. Also, some Intel - # versions had trouble with output in subdirs. - am__obj=sub/conftest.${OBJEXT-o} - am__minus_obj="-o $am__obj" - case $depmode in - gcc) - # This depmode causes a compiler race in universal mode. - test "$am__universal" = false || continue - ;; - nosideeffect) - # After this tag, mechanisms are not by side-effect, so they'll - # only be used when explicitly requested. - if test "x$enable_dependency_tracking" = xyes; then - continue - else - break - fi - ;; - msvc7 | msvc7msys | msvisualcpp | msvcmsys) - # This compiler won't grok '-c -o', but also, the minuso test has - # not run yet. These depmodes are late enough in the game, and - # so weak that their functioning should not be impacted. - am__obj=conftest.${OBJEXT-o} - am__minus_obj= - ;; - none) break ;; - esac - if depmode=$depmode \ - source=sub/conftest.c object=$am__obj \ - depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ - $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ - >/dev/null 2>conftest.err && - grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && - grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && - grep $am__obj sub/conftest.Po > /dev/null 2>&1 && - ${MAKE-make} -s -f confmf > /dev/null 2>&1; then - # icc doesn't choke on unknown options, it will just issue warnings - # or remarks (even with -Werror). So we grep stderr for any message - # that says an option was ignored or not supported. - # When given -MP, icc 7.0 and 7.1 complain thusly: - # icc: Command line warning: ignoring option '-M'; no argument required - # The diagnosis changed in icc 8.0: - # icc: Command line remark: option '-MP' not supported - if (grep 'ignoring option' conftest.err || - grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else - am_cv_CXX_dependencies_compiler_type=$depmode - break - fi - fi +done done +IFS=$as_save_IFS - cd .. - rm -rf conftest.dir -else - am_cv_CXX_dependencies_compiler_type=none fi - fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5 -$as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; } -CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type - - if - test "x$enable_dependency_tracking" != xno \ - && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then - am__fastdepCXX_TRUE= - am__fastdepCXX_FALSE='#' +FC=$ac_cv_prog_FC +if test -n "$FC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FC" >&5 +$as_echo "$FC" >&6; } else - am__fastdepCXX_TRUE='#' - am__fastdepCXX_FALSE= + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5 -$as_echo_n "checking how to run the C++ preprocessor... " >&6; } -if test -z "$CXXCPP"; then - if ${ac_cv_prog_CXXCPP+:} false; then : + test -n "$FC" && break + done +fi +if test -z "$FC"; then + ac_ct_FC=$FC + for ac_prog in gfortran ifort pgf90 pathf90 pathf95 xlf90 xlf95 xlf2003 f90 epcf90 f95 fort lf95 g95 ifc efc gfc +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_FC+:} false; then : $as_echo_n "(cached) " >&6 else - # Double quotes because CXXCPP needs to be expanded - for CXXCPP in "$CXX -E" "/lib/cpp" - do - ac_preproc_ok=false -for ac_cxx_preproc_warn_flag in '' yes + if test -n "$ac_ct_FC"; then + ac_cv_prog_ac_ct_FC="$ac_ct_FC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if ac_fn_cxx_try_cpp "$LINENO"; then : + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_FC="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS -else - # Broken: fails on valid input. -continue fi -rm -f conftest.err conftest.i conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if ac_fn_cxx_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue +fi +ac_ct_FC=$ac_cv_prog_ac_ct_FC +if test -n "$ac_ct_FC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_FC" >&5 +$as_echo "$ac_ct_FC" >&6; } else - # Passes both tests. -ac_preproc_ok=: -break + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -rm -f conftest.err conftest.i conftest.$ac_ext + + test -n "$ac_ct_FC" && break done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : - break + + if test "x$ac_ct_FC" = x; then + FC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + FC=$ac_ct_FC + fi fi - done - ac_cv_prog_CXXCPP=$CXXCPP -fi - CXXCPP=$ac_cv_prog_CXXCPP -else - ac_cv_prog_CXXCPP=$CXXCPP -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5 -$as_echo "$CXXCPP" >&6; } -ac_preproc_ok=false -for ac_cxx_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for Fortran compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done +rm -f a.out + +# If we don't use `.F' as extension, the preprocessor is not run on the +# input file. (Note that this only needs to work for GNU compilers.) +ac_save_ext=$ac_ext +ac_ext=F +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU Fortran compiler" >&5 +$as_echo_n "checking whether we are using the GNU Fortran compiler... " >&6; } +if ${ac_cv_fc_compiler_gnu+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat > conftest.$ac_ext <<_ACEOF + program main +#ifndef __GNUC__ + choke me #endif - Syntax error -_ACEOF -if ac_fn_cxx_try_cpp "$LINENO"; then : + end +_ACEOF +if ac_fn_fc_try_compile "$LINENO"; then : + ac_compiler_gnu=yes else - # Broken: fails on valid input. -continue + ac_compiler_gnu=no fi -rm -f conftest.err conftest.i conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_fc_compiler_gnu=$ac_compiler_gnu - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_fc_compiler_gnu" >&5 +$as_echo "$ac_cv_fc_compiler_gnu" >&6; } +ac_ext=$ac_save_ext +ac_test_FCFLAGS=${FCFLAGS+set} +ac_save_FCFLAGS=$FCFLAGS +FCFLAGS= +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $FC accepts -g" >&5 +$as_echo_n "checking whether $FC accepts -g... " >&6; } +if ${ac_cv_prog_fc_g+:} false; then : + $as_echo_n "(cached) " >&6 +else + FCFLAGS=-g +cat > conftest.$ac_ext <<_ACEOF + program main + + end _ACEOF -if ac_fn_cxx_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue +if ac_fn_fc_try_compile "$LINENO"; then : + ac_cv_prog_fc_g=yes else - # Passes both tests. -ac_preproc_ok=: -break + ac_cv_prog_fc_g=no fi -rm -f conftest.err conftest.i conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_fc_g" >&5 +$as_echo "$ac_cv_prog_fc_g" >&6; } +if test "$ac_test_FCFLAGS" = set; then + FCFLAGS=$ac_save_FCFLAGS +elif test $ac_cv_prog_fc_g = yes; then + if test "x$ac_cv_fc_compiler_gnu" = xyes; then + FCFLAGS="-g -O2" + else + FCFLAGS="-g" + fi else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check -See \`config.log' for more details" "$LINENO" 5; } + if test "x$ac_cv_fc_compiler_gnu" = xyes; then + FCFLAGS="-O2" + else + FCFLAGS= + fi fi +if test $ac_compiler_gnu = yes; then + GFC=yes +else + GFC= +fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu - ## this is checked for when AC_HEADER_STDC is done -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if c++ interface enabled" >&5 -$as_echo_n "checking if c++ interface enabled... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking what $FC does with modules" >&5 +$as_echo_n "checking what $FC does with modules... " >&6; } +ac_ext=${ac_fc_srcext-f} +ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5' +ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_fc_compiler_gnu -# Check whether --enable-cxx was given. -if test "${enable_cxx+set}" = set; then : - enableval=$enable_cxx; HDF_CXX=$enableval -fi +test -d conftestdir || mkdir conftestdir +cd conftestdir +rm -rf * -if test "X$HDF_CXX" = "Xyes"; then - echo "yes" - HDF5_INTERFACES="$HDF5_INTERFACES c++" +cat >conftest.$ac_ext <&1 +if test "$modfiles" = file.o; then + echo $ac_n "checking whether $FC -em is saner""... $ac_c" 1>&6 + OLD_FCFLAGS=$FCFLAGS + FCFLAGS="$FCFLAGS -em" + eval $ac_compile + modfiles="" + for f in file.o module.mod MODULE.mod module.M MODULE.M; do + test -f $f && modfiles="$f" + done + if test "$modfiles" = "file.o"; then + FCFLAGS=$OLD_FCFLAGS + echo no 6>&1 + else + echo yes 6>&1 + fi +fi +cd .. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CXX needs old style header files in includes" >&5 -$as_echo_n "checking if $CXX needs old style header files in includes... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how $FC finds modules" >&5 +$as_echo_n "checking how $FC finds modules... " >&6; } -#include +for flag in "-I" "-M" "-p"; do + cat >conftest.$ac_ext <&5 -$as_echo "no" >&6; } + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + F9XMODFLAG=$flag + break + fi +done + +if test -n "$F9XMODFLAG"; then + echo $F9XMODFLAG 1>&6 + FCFLAGS="$F9XMODFLAG. $FCFLAGS" else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - CXXFLAGS="${CXXFLAGS} -DOLD_HEADER_FILENAME" - AM_CXXFLAGS="${AM_CXXFLAGS} -DOLD_HEADER_FILENAME" + echo unknown 1>&6 fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - # Checking if C++ can handle namespaces - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CXX can handle namespaces" >&5 -$as_echo_n "checking if $CXX can handle namespaces... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ +rm -rf conftest* +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu -namespace H5 { -int fnord; -} -int main(void) { - using namespace H5; - fnord = 37; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - CXXFLAGS="${CXXFLAGS} -DH5_NO_NAMESPACE" - AM_CXXFLAGS="${AM_CXXFLAGS} -DH5_NO_NAMESPACE" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext + ## Change to the Fortran 90 language + ac_ext=${ac_fc_srcext-f} +ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5' +ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_fc_compiler_gnu - # Checking if C++ has offsetof extension + ## Checking if the compiler supports the required Fortran 2003 features and + ## stopping if it does not. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CXX has offsetof extension" >&5 -$as_echo_n "checking if $CXX has offsetof extension... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if Fortran compiler version compatible with Fortran 2003 HDF" >&5 +$as_echo_n "checking if Fortran compiler version compatible with Fortran 2003 HDF... " >&6; } + HAVE_F2003_REQUIREMENTS="no" + cat > conftest.$ac_ext <<_ACEOF + program main - #include - #include -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus - extern "C" -# endif - int FC_DUMMY_MAIN() { return 1; } -#endif -#endif -int -main () -{ + USE iso_c_binding + IMPLICIT NONE + TYPE(C_PTR) :: ptr + TYPE(C_FUNPTR) :: funptr + CHARACTER(LEN=80, KIND=c_char), TARGET :: ichr - struct index_st - { - unsigned char type; - unsigned char num; - unsigned int len; - }; - typedef struct index_st index_t; - int x,y; - x = offsetof(struct index_st, len); - y = offsetof(index_t, num) + ptr = C_LOC(ichr(1:1)) - ; - return 0; -} + + end _ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : +if ac_fn_fc_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } - -$as_echo "#define CXX_HAVE_OFFSETOF 1" >>confdefs.h - + HAVE_F2003_REQUIREMENTS=yes else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } @@ -7358,1452 +6982,1542 @@ rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext - # if C++ can handle static cast - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CXX can handle static cast" >&5 -$as_echo_n "checking if $CXX can handle static cast... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int main(void) { - float test_float; - int test_int; - test_float = 37.0; - test_int = static_cast (test_float); - return 0; -} + if test "X$HAVE_F2003_REQUIREMENTS" = "Xno"; then + as_fn_error $? "Fortran compiler lacks required Fortran 2003 features; unsupported Fortran 2003 compiler, remove --enable-fortran" "$LINENO" 5 + fi -_ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + ## -------------------------------------------------------------------- + ## Define wrappers for the C compiler to use Fortran function names + ## + ac_ext=${ac_fc_srcext-f} +ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5' +ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_fc_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to get verbose linking output from $FC" >&5 +$as_echo_n "checking how to get verbose linking output from $FC... " >&6; } +if ${ac_cv_prog_fc_v+:} false; then : + $as_echo_n "(cached) " >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - CXXFLAGS="${CXXFLAGS} -DNO_STATIC_CAST" - AM_CXXFLAGS="${AM_CXXFLAGS} -DNO_STATIC_CAST" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext + cat > conftest.$ac_ext <<_ACEOF + program main + end +_ACEOF +if ac_fn_fc_try_compile "$LINENO"; then : + ac_cv_prog_fc_v= +# Try some options frequently used verbose output +for ac_verb in -v -verbose --verbose -V -\#\#\#; do + cat > conftest.$ac_ext <<_ACEOF + program main -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - CXX="no" -fi + end +_ACEOF -## Change back to the C language -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu +# Compile and link our simple test program by passing a flag (argument +# 1 to this macro) to the Fortran compiler in order to get +# "verbose" output that we can then parse for the Fortran linker +# flags. +ac_save_FCFLAGS=$FCFLAGS +FCFLAGS="$FCFLAGS $ac_verb" +eval "set x $ac_link" +shift +$as_echo "$as_me:${as_lineno-$LINENO}: $*" >&5 +# gfortran 4.3 outputs lines setting COLLECT_GCC_OPTIONS, COMPILER_PATH, +# LIBRARY_PATH; skip all such settings. +ac_fc_v_output=`eval $ac_link 5>&1 2>&1 | + sed '/^Driving:/d; /^Configured with:/d; + '"/^[_$as_cr_Letters][_$as_cr_alnum]*=/d"` +$as_echo "$ac_fc_v_output" >&5 +FCFLAGS=$ac_save_FCFLAGS +rm -rf conftest* +# On HP/UX there is a line like: "LPATH is: /foo:/bar:/baz" where +# /foo, /bar, and /baz are search directories for the Fortran linker. +# Here, we change these into -L/foo -L/bar -L/baz (and put it first): +ac_fc_v_output="`echo $ac_fc_v_output | + grep 'LPATH is:' | + sed 's|.*LPATH is\(: *[^ ]*\).*|\1|;s|: */| -L/|g'` $ac_fc_v_output" -## ---------------------------------------------------------------------- -## Check if they would like the High Level library compiled -## +# FIXME: we keep getting bitten by quoted arguments; a more general fix +# that detects unbalanced quotes in FLIBS should be implemented +# and (ugh) tested at some point. +case $ac_fc_v_output in + # With xlf replace commas with spaces, + # and remove "-link" and closing parenthesis. + *xlfentry*) + ac_fc_v_output=`echo $ac_fc_v_output | + sed ' + s/,/ /g + s/ -link / /g + s/) *$// + ' + ` ;; - HL="" -## name of fortran folder inside "hl", if FORTRAN compile is requested - HL_FOR="" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if high level library is enabled" >&5 -$as_echo_n "checking if high level library is enabled... " >&6; } -# Check whether --enable-hl was given. -if test "${enable_hl+set}" = set; then : - enableval=$enable_hl; HDF5_HL=$enableval -else - HDF5_HL=yes -fi + # With Intel ifc, ignore the quoted -mGLOB_options_string stuff (quoted + # $LIBS confuse us, and the libraries appear later in the output anyway). + *mGLOB_options_string*) + ac_fc_v_output=`echo $ac_fc_v_output | sed 's/"-mGLOB[^"]*"/ /g'` ;; + # Portland Group compiler has singly- or doubly-quoted -cmdline argument + # Singly-quoted arguments were reported for versions 5.2-4 and 6.0-4. + # Doubly-quoted arguments were reported for "PGF90/x86 Linux/x86 5.0-2". + *-cmdline\ * | *-ignore\ * | *-def\ *) + ac_fc_v_output=`echo $ac_fc_v_output | sed "\ + s/-cmdline *'[^']*'/ /g; s/-cmdline *\"[^\"]*\"/ /g + s/-ignore *'[^']*'/ /g; s/-ignore *\"[^\"]*\"/ /g + s/-def *'[^']*'/ /g; s/-def *\"[^\"]*\"/ /g"` ;; -if test "X$HDF5_HL" = "Xyes"; then - echo "yes" - HL="hl" + # If we are using fort77 (the f2c wrapper) then filter output and delete quotes. + *fort77*f2c*gcc*) + ac_fc_v_output=`echo "$ac_fc_v_output" | sed -n ' + /:[ ]\+Running[ ]\{1,\}"gcc"/{ + /"-c"/d + /[.]c"*/d + s/^.*"gcc"/"gcc"/ + s/"//gp + }'` ;; -$as_echo "#define INCLUDE_HL 1" >>confdefs.h + # If we are using Cray Fortran then delete quotes. + *cft90*) + ac_fc_v_output=`echo $ac_fc_v_output | sed 's/"//g'` ;; +esac - ## If Fortran's default real is double precision and HL is being built then configure - ## should fail due to bug HDFFV-889. - if test "X$FORTRAN_DEFAULT_REALisDBLE" = "Xyes"; then - as_fn_error $? "Fortran high-level routines are not supported when the default REAL is DOUBLE PRECISION, use configure option --disable-hl." "$LINENO" 5 - fi + # look for -l* and *.a constructs in the output + for ac_arg in $ac_fc_v_output; do + case $ac_arg in + [\\/]*.a | ?:[\\/]*.a | -[lLRu]*) + ac_cv_prog_fc_v=$ac_verb + break 2 ;; + esac + done +done +if test -z "$ac_cv_prog_fc_v"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cannot determine how to obtain linking information from $FC" >&5 +$as_echo "$as_me: WARNING: cannot determine how to obtain linking information from $FC" >&2;} +fi else - echo "no" + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: compilation failed" >&5 +$as_echo "$as_me: WARNING: compilation failed" >&2;} fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -## ---------------------------------------------------------------------- -## Check if they have Perl installed on their system. We only need Perl -## if they're using a GNU compiler. -## - PERL="" -if test "X$GCC" = "Xyes"; then - for ac_prog in perl -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_PERL+:} false; then : +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_fc_v" >&5 +$as_echo "$ac_cv_prog_fc_v" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Fortran libraries of $FC" >&5 +$as_echo_n "checking for Fortran libraries of $FC... " >&6; } +if ${ac_cv_fc_libs+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$PERL"; then - ac_cv_prog_PERL="$PERL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_PERL="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -PERL=$ac_cv_prog_PERL -if test -n "$PERL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PERL" >&5 -$as_echo "$PERL" >&6; } + if test "x$FCLIBS" != "x"; then + ac_cv_fc_libs="$FCLIBS" # Let the user override the test. else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi +cat > conftest.$ac_ext <<_ACEOF + program main - test -n "$PERL" && break -done + end +_ACEOF -fi - -## ---------------------------------------------------------------------- -## Check which archiving tool to use. This needs to be done before -## the AM_PROG_LIBTOOL macro. -## - -if test -z "$AR"; then - for ac_prog in ar xar -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_AR+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$AR"; then - ac_cv_prog_AR="$AR" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_AR="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS +# Compile and link our simple test program by passing a flag (argument +# 1 to this macro) to the Fortran compiler in order to get +# "verbose" output that we can then parse for the Fortran linker +# flags. +ac_save_FCFLAGS=$FCFLAGS +FCFLAGS="$FCFLAGS $ac_cv_prog_fc_v" +eval "set x $ac_link" +shift +$as_echo "$as_me:${as_lineno-$LINENO}: $*" >&5 +# gfortran 4.3 outputs lines setting COLLECT_GCC_OPTIONS, COMPILER_PATH, +# LIBRARY_PATH; skip all such settings. +ac_fc_v_output=`eval $ac_link 5>&1 2>&1 | + sed '/^Driving:/d; /^Configured with:/d; + '"/^[_$as_cr_Letters][_$as_cr_alnum]*=/d"` +$as_echo "$ac_fc_v_output" >&5 +FCFLAGS=$ac_save_FCFLAGS -fi -fi -AR=$ac_cv_prog_AR -if test -n "$AR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 -$as_echo "$AR" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi +rm -rf conftest* +# On HP/UX there is a line like: "LPATH is: /foo:/bar:/baz" where +# /foo, /bar, and /baz are search directories for the Fortran linker. +# Here, we change these into -L/foo -L/bar -L/baz (and put it first): +ac_fc_v_output="`echo $ac_fc_v_output | + grep 'LPATH is:' | + sed 's|.*LPATH is\(: *[^ ]*\).*|\1|;s|: */| -L/|g'` $ac_fc_v_output" - test -n "$AR" && break -done -test -n "$AR" || AR=":" +# FIXME: we keep getting bitten by quoted arguments; a more general fix +# that detects unbalanced quotes in FLIBS should be implemented +# and (ugh) tested at some point. +case $ac_fc_v_output in + # With xlf replace commas with spaces, + # and remove "-link" and closing parenthesis. + *xlfentry*) + ac_fc_v_output=`echo $ac_fc_v_output | + sed ' + s/,/ /g + s/ -link / /g + s/) *$// + ' + ` ;; -fi + # With Intel ifc, ignore the quoted -mGLOB_options_string stuff (quoted + # $LIBS confuse us, and the libraries appear later in the output anyway). + *mGLOB_options_string*) + ac_fc_v_output=`echo $ac_fc_v_output | sed 's/"-mGLOB[^"]*"/ /g'` ;; + # Portland Group compiler has singly- or doubly-quoted -cmdline argument + # Singly-quoted arguments were reported for versions 5.2-4 and 6.0-4. + # Doubly-quoted arguments were reported for "PGF90/x86 Linux/x86 5.0-2". + *-cmdline\ * | *-ignore\ * | *-def\ *) + ac_fc_v_output=`echo $ac_fc_v_output | sed "\ + s/-cmdline *'[^']*'/ /g; s/-cmdline *\"[^\"]*\"/ /g + s/-ignore *'[^']*'/ /g; s/-ignore *\"[^\"]*\"/ /g + s/-def *'[^']*'/ /g; s/-def *\"[^\"]*\"/ /g"` ;; -## Export the AR macro so that it will be placed in the libtool file -## correctly. -export AR + # If we are using fort77 (the f2c wrapper) then filter output and delete quotes. + *fort77*f2c*gcc*) + ac_fc_v_output=`echo "$ac_fc_v_output" | sed -n ' + /:[ ]\+Running[ ]\{1,\}"gcc"/{ + /"-c"/d + /[.]c"*/d + s/^.*"gcc"/"gcc"/ + s/"//gp + }'` ;; -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 -$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } -set x ${MAKE-make} -ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` -if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat >conftest.make <<\_ACEOF -SHELL = /bin/sh -all: - @echo '@@@%%%=$(MAKE)=@@@%%%' -_ACEOF -# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. -case `${MAKE-make} -f conftest.make 2>/dev/null` in - *@@@%%%=?*=@@@%%%*) - eval ac_cv_prog_make_${ac_make}_set=yes;; - *) - eval ac_cv_prog_make_${ac_make}_set=no;; + # If we are using Cray Fortran then delete quotes. + *cft90*) + ac_fc_v_output=`echo $ac_fc_v_output | sed 's/"//g'` ;; esac -rm -f conftest.make -fi -if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - SET_MAKE= -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - SET_MAKE="MAKE=${MAKE-make}" -fi +ac_cv_fc_libs= -## ---------------------------------------------------------------------- -## Set up ${TR} which is used to process DEBUG_PKG. +# Save positional arguments (if any) +ac_save_positional="$@" -# Extract the first word of "tr", so it can be a program name with args. -set dummy tr; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_TR+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $TR in - [\\/]* | ?:[\\/]*) - ac_cv_path_TR="$TR" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_TR="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done +set X $ac_fc_v_output +while test $# != 1; do + shift + ac_arg=$1 + case $ac_arg in + [\\/]*.a | ?:[\\/]*.a) + ac_exists=false + for ac_i in $ac_cv_fc_libs; do + if test x"$ac_arg" = x"$ac_i"; then + ac_exists=true + break + fi done -IFS=$as_save_IFS - ;; -esac -fi -TR=$ac_cv_path_TR -if test -n "$TR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TR" >&5 -$as_echo "$TR" >&6; } + if test x"$ac_exists" = xtrue; then : + else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + ac_cv_fc_libs="$ac_cv_fc_libs $ac_arg" fi + ;; + -bI:*) + ac_exists=false + for ac_i in $ac_cv_fc_libs; do + if test x"$ac_arg" = x"$ac_i"; then + ac_exists=true + break + fi + done + if test x"$ac_exists" = xtrue; then : - - -## ---------------------------------------------------------------------- -## Check that time can be used with srcdir. This is okay on most systems, -## but seems to cause problems on Cygwin. -## The solution on Cygwin is not to record execution time for tests. -## -## Note: This is still true as of Cygwin 1.7.32 (Aug 2014) on both 32- -## and 64-bit platforms. Given how long this has been true, it seems -## unlikely to change, but we should probably re-test this periodically. - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if srcdir= and time commands work together" >&5 -$as_echo_n "checking if srcdir= and time commands work together... " >&6; } - - -TIME=time -TIME_TEST=`foo="bar" ${TIME} echo 'baz' 2> /dev/null | grep baz` - -if test "X${TIME_TEST}" = "Xbaz"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - TIME= + if test "$ac_compiler_gnu" = yes; then + for ac_link_opt in $ac_arg; do + ac_cv_fc_libs="$ac_cv_fc_libs -Xlinker $ac_link_opt" + done +else + ac_cv_fc_libs="$ac_cv_fc_libs $ac_arg" fi +fi + ;; + # Ignore these flags. + -lang* | -lcrt*.o | -lc | -lgcc* | -lSystem | -libmil | -little \ + |-LANG:=* | -LIST:* | -LNO:* | -link) + ;; + -lkernel32) + case $host_os in + *cygwin*) ;; + *) ac_cv_fc_libs="$ac_cv_fc_libs $ac_arg" + ;; + esac + ;; + -[LRuYz]) + # These flags, when seen by themselves, take an argument. + # We remove the space between option and argument and re-iterate + # unless we find an empty arg or a new option (starting with -) + case $2 in + "" | -*);; + *) + ac_arg="$ac_arg$2" + shift; shift + set X $ac_arg "$@" + ;; + esac + ;; + -YP,*) + for ac_j in `$as_echo "$ac_arg" | sed -e 's/-YP,/-L/;s/:/ -L/g'`; do + ac_exists=false + for ac_i in $ac_cv_fc_libs; do + if test x"$ac_j" = x"$ac_i"; then + ac_exists=true + break + fi + done + if test x"$ac_exists" = xtrue; then : -## The following variables are used to distinguish between building a -## serial and parallel library. -## -## HAVE_PARALLEL -- defined in H5config.h if we are building -## a parallel library even if configure wasn't -## able to find some header file or library that -## might be required. This is defined if the -## user explicitly states -## that a parallel library is being built by supplying -## the `--enable-parallel' configure switch. -## -## PARALLEL -- This variable is set to a non-null value if -## we're building a parallel version of the library. -## -## RUNSERIAL -- This is a command which will be prepended to -## the executable name to run the executable using -## a single process. For serial versions of the -## library this will normally be empty. For parallel -## versions it might be something like `mpiexec -n 1'. -## The value of this variable is substituted in *.in -## files. -## -## RUNPARALLEL -- This is a command which will be prepended to -## the executable name to run the executable on -## multiple processors. For the serial library the -## value will normally be the empty string. For -## parallel library it should be something like -## "mpiexec -n \$\${NPROCS:=6}" where NPROCS will -## eventually contain the number of processors on which -## to run the executable (the double dollarsigns are to -## protect the expansion until make executes the -## command). The value of this variable is -## substituted in *.in files. -## - - - - +else + ac_arg="$ac_arg $ac_j" + ac_cv_fc_libs="$ac_cv_fc_libs $ac_j" +fi + done + ;; + -[lLR]*) + ac_exists=false + for ac_i in $ac_cv_fc_libs; do + if test x"$ac_arg" = x"$ac_i"; then + ac_exists=true + break + fi + done -## ---------------------------------------------------------------------- -## Disable shared libraries on CYGWIN. (LK - 04/16/15) -## A number of tests run by "make check" fail on CYGWIN, so for HDF5 v1.8.15 -## we will change the default for shared libraries to disabled. + if test x"$ac_exists" = xtrue; then : +else + ac_cv_fc_libs="$ac_cv_fc_libs $ac_arg" +fi + ;; + -zallextract*| -zdefaultextract) + ac_cv_fc_libs="$ac_cv_fc_libs $ac_arg" + ;; + # Ignore everything else. + esac +done +# restore positional arguments +set X $ac_save_positional; shift -case "`uname`" in - CYGWIN*) - enable_shared="no" - CHECK_WARN="Shared libraries are not currently supported on CYGWIN." - ;; +# We only consider "LD_RUN_PATH" on Solaris systems. If this is seen, +# then we insist that the "run path" must be an absolute path (i.e. it +# must begin with a "/"). +case `(uname -sr) 2>/dev/null` in + "SunOS 5"*) + ac_ld_run_path=`$as_echo "$ac_fc_v_output" | + sed -n 's,^.*LD_RUN_PATH *= *\(/[^ ]*\).*$,-R\1,p'` + test "x$ac_ld_run_path" != x && + if test "$ac_compiler_gnu" = yes; then + for ac_link_opt in $ac_ld_run_path; do + ac_cv_fc_libs="$ac_cv_fc_libs -Xlinker $ac_link_opt" + done +else + ac_cv_fc_libs="$ac_cv_fc_libs $ac_ld_run_path" +fi + ;; esac +fi # test "x$[]_AC_LANG_PREFIX[]LIBS" = "x" -## ---------------------------------------------------------------------- -## Fortran libraries are not currently supported on Mac. Disable them. -## (this is overridable with --enable-unsupported). -## +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_fc_libs" >&5 +$as_echo "$ac_cv_fc_libs" >&6; } +FCLIBS="$ac_cv_fc_libs" -H5_FORTRAN_SHARED="no" -if test "X${HDF_FORTRAN}" = "Xyes" && test "X${enable_shared}" != "Xno"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if shared Fortran libraries are supported" >&5 -$as_echo_n "checking if shared Fortran libraries are supported... " >&6; } - H5_FORTRAN_SHARED="yes" - ## Disable fortran shared libraries on Mac. (MAM - 03/30/11) +ac_ext=${ac_fc_srcext-f} +ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5' +ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_fc_compiler_gnu - case "`uname`" in - Darwin*) - H5_FORTRAN_SHARED="no" - CHECK_WARN="Shared Fortran libraries not currently supported on Mac." - ;; - esac +ac_ext=${ac_fc_srcext-f} +ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5' +ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_fc_compiler_gnu - ## Report results of check(s) +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dummy main to link with Fortran libraries" >&5 +$as_echo_n "checking for dummy main to link with Fortran libraries... " >&6; } +if ${ac_cv_fc_dummy_main+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_fc_dm_save_LIBS=$LIBS + LIBS="$LIBS $FCLIBS" + ac_fortran_dm_var=FC_DUMMY_MAIN + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu - if test "X${H5_FORTRAN_SHARED}" = "Xno"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $CHECK_WARN" >&5 -$as_echo "$as_me: WARNING: $CHECK_WARN" >&2;} - if test "X${ALLOW_UNSUPPORTED}" != "Xyes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Disabling shared Fortran libraries." >&5 -$as_echo "$as_me: WARNING: Disabling shared Fortran libraries." >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: To override this behavior, please use --enable-unsupported configure option." >&5 -$as_echo "$as_me: WARNING: To override this behavior, please use --enable-unsupported configure option." >&2;} - if test "X${enable_static}" = "Xno"; then - as_fn_error $? "both static and shared Fortran libraries are disabled" "$LINENO" 5 - fi - else - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Allowing unsupported Fortran shared libraries due to use of --enable-unsupported flag" >&5 -$as_echo "$as_me: WARNING: Allowing unsupported Fortran shared libraries due to use of --enable-unsupported flag" >&2;} - H5_FORTRAN_SHARED="yes" - fi - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - fi -fi + # First, try linking without a dummy main: + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ - if test "X$H5_FORTRAN_SHARED" = "Xyes"; then - FORTRAN_SHARED_CONDITIONAL_TRUE= - FORTRAN_SHARED_CONDITIONAL_FALSE='#' +#ifdef FC_DUMMY_MAIN +#ifndef FC_DUMMY_MAIN_EQ_F77 +# ifdef __cplusplus + extern "C" +# endif + int FC_DUMMY_MAIN() { return 1; } +#endif +#endif +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_fortran_dummy_main=none else - FORTRAN_SHARED_CONDITIONAL_TRUE='#' - FORTRAN_SHARED_CONDITIONAL_FALSE= + ac_cv_fortran_dummy_main=unknown fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test $ac_cv_fortran_dummy_main = unknown; then + for ac_func in MAIN__ MAIN_ __main MAIN _MAIN __MAIN main_ main__ _main; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#define $ac_fortran_dm_var $ac_func +#ifdef FC_DUMMY_MAIN +#ifndef FC_DUMMY_MAIN_EQ_F77 +# ifdef __cplusplus + extern "C" +# endif + int FC_DUMMY_MAIN() { return 1; } +#endif +#endif +int +main () +{ -## ---------------------------------------------------------------------- -## Create libtool. If shared/static libraries are going to be enabled -## or disabled, it should happen before these macros. - - -## ---------------------------------------------------------------------- -## dlopen - This will use an improved version of libtool -## win32-dll - This will build clean dlls on win32 platforms. -case `pwd` in - *\ * | *\ *) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 -$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; -esac - - - -macro_version='2.4.2' -macro_revision='1.3337' - - - - - + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_fortran_dummy_main=$ac_func; break +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + done + fi + ac_ext=${ac_fc_srcext-f} +ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5' +ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_fc_compiler_gnu + ac_cv_fc_dummy_main=$ac_cv_fortran_dummy_main + rm -rf conftest* + LIBS=$ac_fc_dm_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_fc_dummy_main" >&5 +$as_echo "$ac_cv_fc_dummy_main" >&6; } +FC_DUMMY_MAIN=$ac_cv_fc_dummy_main +if test "$FC_DUMMY_MAIN" != unknown; then : + if test $FC_DUMMY_MAIN != none; then +cat >>confdefs.h <<_ACEOF +#define FC_DUMMY_MAIN $FC_DUMMY_MAIN +_ACEOF + if test "x$ac_cv_fc_dummy_main" = "x$ac_cv_f77_dummy_main"; then +$as_echo "#define FC_DUMMY_MAIN_EQ_F77 1" >>confdefs.h + fi +fi +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "linking to Fortran libraries from C fails +See \`config.log' for more details" "$LINENO" 5; } +fi +ac_ext=${ac_fc_srcext-f} +ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5' +ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_fc_compiler_gnu +ac_ext=${ac_fc_srcext-f} +ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5' +ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_fc_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Fortran name-mangling scheme" >&5 +$as_echo_n "checking for Fortran name-mangling scheme... " >&6; } +if ${ac_cv_fc_mangling+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat > conftest.$ac_ext <<_ACEOF + subroutine foobar() + return + end + subroutine foo_bar() + return + end +_ACEOF +if ac_fn_fc_try_compile "$LINENO"; then : + mv conftest.$ac_objext cfortran_test.$ac_objext -ltmain="$ac_aux_dir/ltmain.sh" + ac_save_LIBS=$LIBS + LIBS="cfortran_test.$ac_objext $LIBS $FCLIBS" -# Backslashify metacharacters that are still active within -# double-quoted strings. -sed_quote_subst='s/\(["`$\\]\)/\\\1/g' + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + ac_success=no + for ac_foobar in foobar FOOBAR; do + for ac_underscore in "" "_"; do + ac_func="$ac_foobar$ac_underscore" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -# Same as above, but do not quote variable references. -double_quote_subst='s/\(["`\\]\)/\\\1/g' +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $ac_func (); +#ifdef FC_DUMMY_MAIN +#ifndef FC_DUMMY_MAIN_EQ_F77 +# ifdef __cplusplus + extern "C" +# endif + int FC_DUMMY_MAIN() { return 1; } +#endif +#endif +int +main () +{ +return $ac_func (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_success=yes; break 2 +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + done + done + ac_ext=${ac_fc_srcext-f} +ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5' +ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_fc_compiler_gnu -# Sed substitution to delay expansion of an escaped shell variable in a -# double_quote_subst'ed string. -delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + if test "$ac_success" = "yes"; then + case $ac_foobar in + foobar) + ac_case=lower + ac_foo_bar=foo_bar + ;; + FOOBAR) + ac_case=upper + ac_foo_bar=FOO_BAR + ;; + esac -# Sed substitution to delay expansion of an escaped single quote. -delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + ac_success_extra=no + for ac_extra in "" "_"; do + ac_func="$ac_foo_bar$ac_underscore$ac_extra" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -# Sed substitution to avoid accidental globbing in evaled expressions -no_glob_subst='s/\*/\\\*/g' +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $ac_func (); +#ifdef FC_DUMMY_MAIN +#ifndef FC_DUMMY_MAIN_EQ_F77 +# ifdef __cplusplus + extern "C" +# endif + int FC_DUMMY_MAIN() { return 1; } +#endif +#endif +int +main () +{ +return $ac_func (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_success_extra=yes; break +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + done + ac_ext=${ac_fc_srcext-f} +ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5' +ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_fc_compiler_gnu -ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO -ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO + if test "$ac_success_extra" = "yes"; then + ac_cv_fc_mangling="$ac_case case" + if test -z "$ac_underscore"; then + ac_cv_fc_mangling="$ac_cv_fc_mangling, no underscore" + else + ac_cv_fc_mangling="$ac_cv_fc_mangling, underscore" + fi + if test -z "$ac_extra"; then + ac_cv_fc_mangling="$ac_cv_fc_mangling, no extra underscore" + else + ac_cv_fc_mangling="$ac_cv_fc_mangling, extra underscore" + fi + else + ac_cv_fc_mangling="unknown" + fi + else + ac_cv_fc_mangling="unknown" + fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 -$as_echo_n "checking how to print strings... " >&6; } -# Test print first, because it will be a builtin if present. -if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ - test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then - ECHO='print -r --' -elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then - ECHO='printf %s\n' + LIBS=$ac_save_LIBS + rm -rf conftest* + rm -f cfortran_test* else - # Use this function as a fallback that always works. - func_fallback_echo () - { - eval 'cat <<_LTECHO_EOF -$1 -_LTECHO_EOF' - } - ECHO='func_fallback_echo' + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compile a simple Fortran program +See \`config.log' for more details" "$LINENO" 5; } fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -# func_echo_all arg... -# Invoke $ECHO with all args, space-separated. -func_echo_all () -{ - $ECHO "" -} - -case "$ECHO" in - printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 -$as_echo "printf" >&6; } ;; - print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 -$as_echo "print -r" >&6; } ;; - *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 -$as_echo "cat" >&6; } ;; -esac - +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_fc_mangling" >&5 +$as_echo "$ac_cv_fc_mangling" >&6; } +ac_ext=${ac_fc_srcext-f} +ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5' +ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_fc_compiler_gnu +ac_ext=${ac_fc_srcext-f} +ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5' +ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_fc_compiler_gnu +case $ac_cv_fc_mangling in + "lower case, no underscore, no extra underscore") + $as_echo "#define FC_FUNC(name,NAME) name" >>confdefs.h + $as_echo "#define FC_FUNC_(name,NAME) name" >>confdefs.h + ;; + "lower case, no underscore, extra underscore") + $as_echo "#define FC_FUNC(name,NAME) name" >>confdefs.h + $as_echo "#define FC_FUNC_(name,NAME) name ## _" >>confdefs.h + ;; + "lower case, underscore, no extra underscore") + $as_echo "#define FC_FUNC(name,NAME) name ## _" >>confdefs.h + $as_echo "#define FC_FUNC_(name,NAME) name ## _" >>confdefs.h + ;; + "lower case, underscore, extra underscore") + $as_echo "#define FC_FUNC(name,NAME) name ## _" >>confdefs.h + $as_echo "#define FC_FUNC_(name,NAME) name ## __" >>confdefs.h + ;; + "upper case, no underscore, no extra underscore") + $as_echo "#define FC_FUNC(name,NAME) NAME" >>confdefs.h + $as_echo "#define FC_FUNC_(name,NAME) NAME" >>confdefs.h + ;; + "upper case, no underscore, extra underscore") + $as_echo "#define FC_FUNC(name,NAME) NAME" >>confdefs.h + $as_echo "#define FC_FUNC_(name,NAME) NAME ## _" >>confdefs.h + ;; + "upper case, underscore, no extra underscore") + $as_echo "#define FC_FUNC(name,NAME) NAME ## _" >>confdefs.h + $as_echo "#define FC_FUNC_(name,NAME) NAME ## _" >>confdefs.h + ;; + "upper case, underscore, extra underscore") + $as_echo "#define FC_FUNC(name,NAME) NAME ## _" >>confdefs.h + $as_echo "#define FC_FUNC_(name,NAME) NAME ## __" >>confdefs.h + ;; + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unknown Fortran name-mangling scheme" >&5 +$as_echo "$as_me: WARNING: unknown Fortran name-mangling scheme" >&2;} + ;; +esac +ac_ext=${ac_fc_srcext-f} +ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5' +ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_fc_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 -$as_echo_n "checking for a sed that does not truncate output... " >&6; } -if ${ac_cv_path_SED+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ - for ac_i in 1 2 3 4 5 6 7; do - ac_script="$ac_script$as_nl$ac_script" - done - echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed - { ac_script=; unset ac_script;} - if test -z "$SED"; then - ac_path_SED_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in sed gsed; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_SED" || continue -# Check for GNU ac_path_SED and select it if it is found. - # Check for GNU $ac_path_SED -case `"$ac_path_SED" --version 2>&1` in -*GNU*) - ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo '' >> "conftest.nl" - "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_SED_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_SED="$ac_path_SED" - ac_path_SED_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac + ## -------------------------------------------------------------------- + ## See if the fortran compiler supports the intrinsic function "SIZEOF" - $ac_path_SED_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_SED"; then - as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 - fi + HAVE_SIZEOF_FORTRAN="no" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if Fortran compiler supports intrinsic SIZEOF" >&5 +$as_echo_n "checking if Fortran compiler supports intrinsic SIZEOF... " >&6; } + cat > conftest.$ac_ext <<_ACEOF + + PROGRAM main + i = sizeof(x) + END PROGRAM + +_ACEOF +if ac_fn_fc_try_link "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + HAVE_SIZEOF_FORTRAN="yes" else - ac_cv_path_SED=$SED + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 -$as_echo "$ac_cv_path_SED" >&6; } - SED="$ac_cv_path_SED" - rm -f conftest.sed -test -z "$SED" && SED=sed -Xsed="$SED -e 1s/^X//" + ## See if the fortran compiler supports the intrinsic function "C_SIZEOF" + HAVE_C_SIZEOF_FORTRAN="no" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if Fortran compiler supports intrinsic C_SIZEOF" >&5 +$as_echo_n "checking if Fortran compiler supports intrinsic C_SIZEOF... " >&6; } + cat > conftest.$ac_ext <<_ACEOF + PROGRAM main + USE ISO_C_BINDING + INTEGER(C_INT) :: a + INTEGER(C_SIZE_T) :: result + result = C_SIZEOF(a) + END PROGRAM +_ACEOF +if ac_fn_fc_try_link "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + HAVE_C_SIZEOF_FORTRAN="yes" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + ## See if the fortran compiler supports the intrinsic function "STORAGE_SIZE" + HAVE_STORAGE_SIZE_FORTRAN="no" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if Fortran compiler supports intrinsic STORAGE_SIZE" >&5 +$as_echo_n "checking if Fortran compiler supports intrinsic STORAGE_SIZE... " >&6; } + cat > conftest.$ac_ext <<_ACEOF + PROGRAM main + INTEGER :: a + INTEGER :: result + result = STORAGE_SIZE(a) + END PROGRAM +_ACEOF +if ac_fn_fc_try_link "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + HAVE_STORAGE_SIZE_FORTRAN="yes" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 -$as_echo_n "checking for grep that handles long lines and -e... " >&6; } -if ${ac_cv_path_GREP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -z "$GREP"; then - ac_path_GREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in grep ggrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_GREP" || continue -# Check for GNU ac_path_GREP and select it if it is found. - # Check for GNU $ac_path_GREP -case `"$ac_path_GREP" --version 2>&1` in -*GNU*) - ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'GREP' >> "conftest.nl" - "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_GREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_GREP="$ac_path_GREP" - ac_path_GREP_max=$ac_count + ## Set the sizeof function for use later in the fortran tests + if test "X$HAVE_STORAGE_SIZE_FORTRAN" = "Xyes";then + FC_SIZEOF_A="STORAGE_SIZE(a, c_size_t)/STORAGE_SIZE(c_char_'a',c_size_t)" + FC_SIZEOF_B="STORAGE_SIZE(b, c_size_t)/STORAGE_SIZE(c_char_'a',c_size_t)" + FC_SIZEOF_C="STORAGE_SIZE(c, c_size_t)/STORAGE_SIZE(c_char_'a',c_size_t)" + else + if test "X$HAVE_SIZEOF_FORTRAN" = "Xyes";then + FC_SIZEOF_A="SIZEOF(a)" + FC_SIZEOF_B="SIZEOF(b)" + FC_SIZEOF_C="SIZEOF(c)" + else + ## If neither intrinsic functions SIZEOF or STORAGE_SIZE is available then stop configure with an error + as_fn_error $? "Fortran compiler requires either intrinsic functions SIZEOF or STORAGE_SIZE" "$LINENO" 5 fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_GREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_GREP"; then - as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi + + ## See if the fortran compiler supports the intrinsic module "ISO_FORTRAN_ENV" + + HAVE_ISO_FORTRAN_ENV="no" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if Fortran compiler supports intrinsic module ISO_FORTRAN_ENV" >&5 +$as_echo_n "checking if Fortran compiler supports intrinsic module ISO_FORTRAN_ENV... " >&6; } + cat > conftest.$ac_ext <<_ACEOF + + PROGRAM main + USE, INTRINSIC :: ISO_FORTRAN_ENV + END PROGRAM + +_ACEOF +if ac_fn_fc_try_link "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + HAVE_ISO_FORTRAN_ENV="yes" else - ac_cv_path_GREP=$GREP + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 -$as_echo "$ac_cv_path_GREP" >&6; } - GREP="$ac_cv_path_GREP" + ## Check KIND and size of native integer +ac_ext=${ac_fc_srcext-f} +ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5' +ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_fc_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 -$as_echo_n "checking for egrep... " >&6; } -if ${ac_cv_path_EGREP+:} false; then : - $as_echo_n "(cached) " >&6 +rm -f pac_fconftest.out + +if test "$cross_compiling" = yes; then : + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run test program while cross compiling +See \`config.log' for more details" "$LINENO" 5; } else - if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 - then ac_cv_path_EGREP="$GREP -E" - else - if test -z "$EGREP"; then - ac_path_EGREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in egrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_EGREP" || continue -# Check for GNU ac_path_EGREP and select it if it is found. - # Check for GNU $ac_path_EGREP -case `"$ac_path_EGREP" --version 2>&1` in -*GNU*) - ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'EGREP' >> "conftest.nl" - "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_EGREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_EGREP="$ac_path_EGREP" - ac_path_EGREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac + cat > conftest.$ac_ext <<_ACEOF - $ac_path_EGREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_EGREP"; then - as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_EGREP=$EGREP -fi - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 -$as_echo "$ac_cv_path_EGREP" >&6; } - EGREP="$ac_cv_path_EGREP" + PROGRAM main + IMPLICIT NONE + INTEGER :: ik, k, lastkind, max_decimal_prec + INTEGER :: num_rkinds, num_ikinds + num_ikinds = 0 + lastkind=SELECTED_INT_KIND(1) + OPEN(8, FILE='pac_fconftest.out', form='formatted') + ! Find integer KINDs + DO ik=2,36 + k = SELECTED_INT_KIND(ik) + IF (k .NE. lastkind) THEN + num_ikinds = num_ikinds + 1 + WRITE(8,'(I0)',ADVANCE='NO') lastkind + lastkind = k + IF(k.GT.0) WRITE(8,'(A)',ADVANCE='NO') ',' + ENDIF + IF (k .LE. 0) EXIT + ENDDO + IF (lastkind.NE.-1) THEN + num_ikinds = num_ikinds + 1 + WRITE(8,'(I0)') lastkind + ELSE + WRITE(8,'()') + ENDIF + ! Find real KINDs + num_rkinds = 0 + lastkind=SELECTED_REAL_KIND(1) + max_decimal_prec = 1 + DO ik=2,36 + k = SELECTED_REAL_KIND(ik) + IF (k .NE. lastkind) THEN + num_rkinds = num_rkinds + 1 + WRITE(8,'(I0)',ADVANCE='NO') lastkind + lastkind = k + IF(k.GT.0) WRITE(8,'(A)',ADVANCE='NO') ',' + max_decimal_prec = ik + ENDIF + IF (k .LE. 0) EXIT + ENDDO + IF (lastkind.NE.-1)THEN + num_rkinds = num_rkinds + 1 + WRITE(8,'(I0)') lastkind + ELSE + WRITE(8,'()') + ENDIF + WRITE(8,'(I0)') max_decimal_prec + WRITE(8,'(I0)') num_ikinds + WRITE(8,'(I0)') num_rkinds + END + + +_ACEOF +if ac_fn_fc_try_run "$LINENO"; then : + + if test -s pac_fconftest.out ; then + + + pac_validIntKinds="`perl -ne '$. == 1 && print && exit' pac_fconftest.out`" + pac_validRealKinds="`perl -ne '$. == 2 && print && exit' pac_fconftest.out`" + PAC_FC_MAX_REAL_PRECISION="`perl -ne '$. == 3 && print && exit' pac_fconftest.out`" +cat >>confdefs.h <<_ACEOF +#define PAC_FC_MAX_REAL_PRECISION $PAC_FC_MAX_REAL_PRECISION +_ACEOF -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 -$as_echo_n "checking for fgrep... " >&6; } -if ${ac_cv_path_FGREP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 - then ac_cv_path_FGREP="$GREP -F" - else - if test -z "$FGREP"; then - ac_path_FGREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in fgrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_FGREP" || continue -# Check for GNU ac_path_FGREP and select it if it is found. - # Check for GNU $ac_path_FGREP -case `"$ac_path_FGREP" --version 2>&1` in -*GNU*) - ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'FGREP' >> "conftest.nl" - "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_FGREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_FGREP="$ac_path_FGREP" - ac_path_FGREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - $ac_path_FGREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_FGREP"; then - as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_FGREP=$FGREP -fi + PAC_FC_ALL_INTEGER_KINDS="{`echo $pac_validIntKinds`}" + PAC_FC_ALL_REAL_KINDS="{`echo $pac_validRealKinds`}" - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 -$as_echo "$ac_cv_path_FGREP" >&6; } - FGREP="$ac_cv_path_FGREP" + H5CONFIG_F_NUM_IKIND="INTEGER, PARAMETER :: num_ikinds = `perl -ne '$. == 4 && print && exit' pac_fconftest.out`" + H5CONFIG_F_IKIND="INTEGER, DIMENSION(1:num_ikinds) :: ikind = (/`echo $pac_validIntKinds`/)" + H5CONFIG_F_NUM_RKIND="INTEGER, PARAMETER :: num_rkinds = `perl -ne '$. == 5 && print && exit' pac_fconftest.out`" + H5CONFIG_F_RKIND="INTEGER, DIMENSION(1:num_rkinds) :: rkind = (/`echo $pac_validRealKinds`/)" -test -z "$GREP" && GREP=grep +cat >>confdefs.h <<_ACEOF +#define H5CONFIG_F_NUM_RKIND $H5CONFIG_F_NUM_RKIND +_ACEOF +cat >>confdefs.h <<_ACEOF +#define H5CONFIG_F_NUM_IKIND $H5CONFIG_F_NUM_IKIND +_ACEOF +cat >>confdefs.h <<_ACEOF +#define H5CONFIG_F_RKIND $H5CONFIG_F_RKIND +_ACEOF +cat >>confdefs.h <<_ACEOF +#define H5CONFIG_F_IKIND $H5CONFIG_F_IKIND +_ACEOF + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Fortran INTEGER KINDs" >&5 +$as_echo_n "checking for Fortran INTEGER KINDs... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PAC_FC_ALL_INTEGER_KINDS" >&5 +$as_echo "$PAC_FC_ALL_INTEGER_KINDS" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Fortran REAL KINDs" >&5 +$as_echo_n "checking for Fortran REAL KINDs... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PAC_FC_ALL_REAL_KINDS" >&5 +$as_echo "$PAC_FC_ALL_REAL_KINDS" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Fortran REALs maximum decimal precision" >&5 +$as_echo_n "checking for Fortran REALs maximum decimal precision... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PAC_FC_MAX_REAL_PRECISION" >&5 +$as_echo "$PAC_FC_MAX_REAL_PRECISION" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: Error" >&5 +$as_echo "Error" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: No output from test program!" >&5 +$as_echo "$as_me: WARNING: No output from test program!" >&2;} + fi + rm -f pac_fconftest.out +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: Error" >&5 +$as_echo "Error" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Failed to run program to determine available KINDs" >&5 +$as_echo "$as_me: WARNING: Failed to run program to determine available KINDs" >&2;} +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +ac_ext=${ac_fc_srcext-f} +ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5' +ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_fc_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking sizeof of native KINDS" >&5 +$as_echo_n "checking sizeof of native KINDS... " >&6; } +ac_ext=${ac_fc_srcext-f} +ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5' +ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_fc_compiler_gnu +pack_int_sizeof="" +rm -f pac_fconftest.out + cat > conftest.$ac_ext <<_ACEOF + PROGRAM main + USE ISO_C_BINDING + IMPLICIT NONE + INTEGER a + REAL b + DOUBLE PRECISION c + OPEN(8, FILE='pac_fconftest.out', FORM='formatted') + WRITE(8,*) $FC_SIZEOF_A + WRITE(8,*) kind(a) + WRITE(8,*) $FC_SIZEOF_B + WRITE(8,*) kind(b) + WRITE(8,*) $FC_SIZEOF_C + WRITE(8,*) kind(c) + CLOSE(8) + END -# Check whether --with-gnu-ld was given. -if test "${with_gnu_ld+set}" = set; then : - withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes -else - with_gnu_ld=no -fi -ac_prog=ld -if test "$GCC" = yes; then - # Check if gcc -print-prog-name=ld gives a path. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 -$as_echo_n "checking for ld used by $CC... " >&6; } - case $host in - *-*-mingw*) - # gcc leaves a trailing carriage return which upsets mingw - ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; - *) - ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; - esac - case $ac_prog in - # Accept absolute paths. - [\\/]* | ?:[\\/]*) - re_direlt='/[^/][^/]*/\.\./' - # Canonicalize the pathname of ld - ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` - while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do - ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` - done - test -z "$LD" && LD="$ac_prog" - ;; - "") - # If it fails, then pretend we aren't using GCC. - ac_prog=ld - ;; - *) - # If it is relative, then search for the first ld in PATH. - with_gnu_ld=unknown - ;; - esac -elif test "$with_gnu_ld" = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 -$as_echo_n "checking for GNU ld... " >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 -$as_echo_n "checking for non-GNU ld... " >&6; } -fi -if ${lt_cv_path_LD+:} false; then : - $as_echo_n "(cached) " >&6 +_ACEOF + if test "$cross_compiling" = yes; then : + + pack_int_sizeof="" + else - if test -z "$LD"; then - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for ac_dir in $PATH; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then - lt_cv_path_LD="$ac_dir/$ac_prog" - # Check to see if the program is GNU ld. I'd rather use --version, - # but apparently some variants of GNU ld only accept -v. - # Break only if it was the GNU/non-GNU ld that we prefer. - case `"$lt_cv_path_LD" -v 2>&1 &5 +$as_echo "$as_me: WARNING: No output from test program!" >&2;} + fi + rm -f pac_fconftest.out + else - lt_cv_path_LD="$LD" # Let the user override the test with a path. + + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Fortran program fails to build or run!" >&5 +$as_echo "$as_me: WARNING: Fortran program fails to build or run!" >&2;} + fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam fi -LD="$lt_cv_path_LD" -if test -n "$LD"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5 -$as_echo "$LD" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi -test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 -$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } -if ${lt_cv_prog_gnu_ld+:} false; then : - $as_echo_n "(cached) " >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pack_int_sizeof" >&5 +$as_echo "$pack_int_sizeof" >&6; } +ac_ext=${ac_fc_srcext-f} +ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5' +ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_fc_compiler_gnu + + + + ## Find all available KINDs + +ac_ext=${ac_fc_srcext-f} +ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5' +ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_fc_compiler_gnu + +rm -f pac_fconftest.out + +if test "$cross_compiling" = yes; then : + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run test program while cross compiling +See \`config.log' for more details" "$LINENO" 5; } else - # I'd rather use --version here, but apparently some GNU lds only accept -v. -case `$LD -v 2>&1 &5 -$as_echo "$lt_cv_prog_gnu_ld" >&6; } -with_gnu_ld=$lt_cv_prog_gnu_ld + cat > conftest.$ac_ext <<_ACEOF + PROGRAM main + IMPLICIT NONE + INTEGER :: ik, k, lastkind, max_decimal_prec + INTEGER :: num_rkinds, num_ikinds + num_ikinds = 0 + lastkind=SELECTED_INT_KIND(1) + OPEN(8, FILE='pac_fconftest.out', form='formatted') + ! Find integer KINDs + DO ik=2,36 + k = SELECTED_INT_KIND(ik) + IF (k .NE. lastkind) THEN + num_ikinds = num_ikinds + 1 + WRITE(8,'(I0)',ADVANCE='NO') lastkind + lastkind = k + IF(k.GT.0) WRITE(8,'(A)',ADVANCE='NO') ',' + ENDIF + IF (k .LE. 0) EXIT + ENDDO + IF (lastkind.NE.-1) THEN + num_ikinds = num_ikinds + 1 + WRITE(8,'(I0)') lastkind + ELSE + WRITE(8,'()') + ENDIF + ! Find real KINDs + num_rkinds = 0 + lastkind=SELECTED_REAL_KIND(1) + max_decimal_prec = 1 + DO ik=2,36 + k = SELECTED_REAL_KIND(ik) + IF (k .NE. lastkind) THEN + num_rkinds = num_rkinds + 1 + WRITE(8,'(I0)',ADVANCE='NO') lastkind + lastkind = k + IF(k.GT.0) WRITE(8,'(A)',ADVANCE='NO') ',' + max_decimal_prec = ik + ENDIF + IF (k .LE. 0) EXIT + ENDDO + IF (lastkind.NE.-1)THEN + num_rkinds = num_rkinds + 1 + WRITE(8,'(I0)') lastkind + ELSE + WRITE(8,'()') + ENDIF + WRITE(8,'(I0)') max_decimal_prec + WRITE(8,'(I0)') num_ikinds + WRITE(8,'(I0)') num_rkinds + END + + +_ACEOF +if ac_fn_fc_try_run "$LINENO"; then : + + if test -s pac_fconftest.out ; then + + + pac_validIntKinds="`perl -ne '$. == 1 && print && exit' pac_fconftest.out`" + pac_validRealKinds="`perl -ne '$. == 2 && print && exit' pac_fconftest.out`" + PAC_FC_MAX_REAL_PRECISION="`perl -ne '$. == 3 && print && exit' pac_fconftest.out`" +cat >>confdefs.h <<_ACEOF +#define PAC_FC_MAX_REAL_PRECISION $PAC_FC_MAX_REAL_PRECISION +_ACEOF + PAC_FC_ALL_INTEGER_KINDS="{`echo $pac_validIntKinds`}" + PAC_FC_ALL_REAL_KINDS="{`echo $pac_validRealKinds`}" + H5CONFIG_F_NUM_IKIND="INTEGER, PARAMETER :: num_ikinds = `perl -ne '$. == 4 && print && exit' pac_fconftest.out`" + H5CONFIG_F_IKIND="INTEGER, DIMENSION(1:num_ikinds) :: ikind = (/`echo $pac_validIntKinds`/)" + H5CONFIG_F_NUM_RKIND="INTEGER, PARAMETER :: num_rkinds = `perl -ne '$. == 5 && print && exit' pac_fconftest.out`" + H5CONFIG_F_RKIND="INTEGER, DIMENSION(1:num_rkinds) :: rkind = (/`echo $pac_validRealKinds`/)" +cat >>confdefs.h <<_ACEOF +#define H5CONFIG_F_NUM_RKIND $H5CONFIG_F_NUM_RKIND +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define H5CONFIG_F_NUM_IKIND $H5CONFIG_F_NUM_IKIND +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define H5CONFIG_F_RKIND $H5CONFIG_F_RKIND +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define H5CONFIG_F_IKIND $H5CONFIG_F_IKIND +_ACEOF + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Fortran INTEGER KINDs" >&5 +$as_echo_n "checking for Fortran INTEGER KINDs... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PAC_FC_ALL_INTEGER_KINDS" >&5 +$as_echo "$PAC_FC_ALL_INTEGER_KINDS" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Fortran REAL KINDs" >&5 +$as_echo_n "checking for Fortran REAL KINDs... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PAC_FC_ALL_REAL_KINDS" >&5 +$as_echo "$PAC_FC_ALL_REAL_KINDS" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Fortran REALs maximum decimal precision" >&5 +$as_echo_n "checking for Fortran REALs maximum decimal precision... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PAC_FC_MAX_REAL_PRECISION" >&5 +$as_echo "$PAC_FC_MAX_REAL_PRECISION" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: Error" >&5 +$as_echo "Error" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: No output from test program!" >&5 +$as_echo "$as_me: WARNING: No output from test program!" >&2;} + fi + rm -f pac_fconftest.out -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 -$as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } -if ${lt_cv_path_NM+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$NM"; then - # Let the user override the test. - lt_cv_path_NM="$NM" else - lt_nm_to_check="${ac_tool_prefix}nm" - if test -n "$ac_tool_prefix" && test "$build" = "$host"; then - lt_nm_to_check="$lt_nm_to_check nm" - fi - for lt_tmp_nm in $lt_nm_to_check; do - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - tmp_nm="$ac_dir/$lt_tmp_nm" - if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then - # Check to see if the nm accepts a BSD-compat flag. - # Adding the `sed 1q' prevents false positives on HP-UX, which says: - # nm: unknown option "B" ignored - # Tru64's nm complains that /dev/null is an invalid object file - case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in - */dev/null* | *'Invalid file or object type'*) - lt_cv_path_NM="$tmp_nm -B" - break - ;; - *) - case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in - */dev/null*) - lt_cv_path_NM="$tmp_nm -p" - break - ;; - *) - lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but - continue # so that we can try to find one that supports BSD flags - ;; - esac - ;; - esac - fi - done - IFS="$lt_save_ifs" - done - : ${lt_cv_path_NM=no} + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: Error" >&5 +$as_echo "Error" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Failed to run program to determine available KINDs" >&5 +$as_echo "$as_me: WARNING: Failed to run program to determine available KINDs" >&2;} + fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 -$as_echo "$lt_cv_path_NM" >&6; } -if test "$lt_cv_path_NM" != "no"; then - NM="$lt_cv_path_NM" -else - # Didn't find any BSD compatible name lister, look for dumpbin. - if test -n "$DUMPBIN"; then : - # Let the user override the test. - else - if test -n "$ac_tool_prefix"; then - for ac_prog in dumpbin "link -dump" - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_DUMPBIN+:} false; then : - $as_echo_n "(cached) " >&6 + + +ac_ext=${ac_fc_srcext-f} +ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5' +ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_fc_compiler_gnu + + + ## Find all sizeofs for available KINDs + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking sizeof of available INTEGER KINDs" >&5 +$as_echo_n "checking sizeof of available INTEGER KINDs... " >&6; } +ac_ext=${ac_fc_srcext-f} +ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5' +ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_fc_compiler_gnu + +pack_int_sizeof="" +rm -f pac_fconftest.out + +for kind in `echo $pac_validIntKinds | perl -pe 's/,/ /g'`; do + cat > conftest.$ac_ext <<_ACEOF + + + PROGRAM main + USE ISO_C_BINDING + IMPLICIT NONE + INTEGER (KIND=$kind) a + OPEN(8, FILE='pac_fconftest.out', FORM='formatted') + WRITE(8,'(I0)') $FC_SIZEOF_A + CLOSE(8) + END + + +_ACEOF + if test "$cross_compiling" = yes; then : + + pack_int_sizeof="" + else - if test -n "$DUMPBIN"; then - ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. + if ac_fn_fc_try_run "$LINENO"; then : + + if test -s pac_fconftest.out ; then + sizes="`cat pac_fconftest.out`" + pack_int_sizeof="$pack_int_sizeof $sizes," + else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: No output from test program!" >&5 +$as_echo "$as_me: WARNING: No output from test program!" >&2;} + fi + rm -f pac_fconftest.out + else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS + + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Fortran program fails to build or run!" >&5 +$as_echo "$as_me: WARNING: Fortran program fails to build or run!" >&2;} fi -fi -DUMPBIN=$ac_cv_prog_DUMPBIN -if test -n "$DUMPBIN"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 -$as_echo "$DUMPBIN" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam fi +done +PAC_FC_ALL_INTEGER_KINDS_SIZEOF="{`echo $pack_int_sizeof | perl -pe 's/,$//' | perl -pe 's/ //g'`}" +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $PAC_FC_ALL_INTEGER_KINDS_SIZEOF" >&5 +$as_echo "$PAC_FC_ALL_INTEGER_KINDS_SIZEOF" >&6; } +ac_ext=${ac_fc_srcext-f} +ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5' +ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_fc_compiler_gnu + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking sizeof of available REAL KINDs" >&5 +$as_echo_n "checking sizeof of available REAL KINDs... " >&6; } +ac_ext=${ac_fc_srcext-f} +ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5' +ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_fc_compiler_gnu + +pack_real_sizeof="" +rm -f pac_fconftest.out +for kind in `echo $pac_validRealKinds| perl -pe 's/,/ /g'`; do + cat > conftest.$ac_ext <<_ACEOF + + + PROGRAM main + USE ISO_C_BINDING + IMPLICIT NONE + REAL (KIND=$kind) :: a + OPEN(8, FILE='pac_fconftest.out', FORM='formatted') + WRITE(8,'(I0)') $FC_SIZEOF_A + CLOSE(8) + END + + +_ACEOF + if test "$cross_compiling" = yes; then : + + pack_real_sizeof="" - test -n "$DUMPBIN" && break - done -fi -if test -z "$DUMPBIN"; then - ac_ct_DUMPBIN=$DUMPBIN - for ac_prog in dumpbin "link -dump" -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then : - $as_echo_n "(cached) " >&6 else - if test -n "$ac_ct_DUMPBIN"; then - ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. + if ac_fn_fc_try_run "$LINENO"; then : + + if test -s pac_fconftest.out ; then + sizes="`cat pac_fconftest.out`" + pack_real_sizeof="$pack_real_sizeof $sizes," + else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: No output from test program!" >&5 +$as_echo "$as_me: WARNING: No output from test program!" >&2;} + fi + rm -f pac_fconftest.out + else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS + + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Fortran program fails to build or run!" >&5 +$as_echo "$as_me: WARNING: Fortran program fails to build or run!" >&2;} fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam fi -ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN -if test -n "$ac_ct_DUMPBIN"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 -$as_echo "$ac_ct_DUMPBIN" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - test -n "$ac_ct_DUMPBIN" && break done +PAC_FC_ALL_REAL_KINDS_SIZEOF="{`echo $pack_real_sizeof | perl -pe 's/,$//' | perl -pe 's/ //g'`}" +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $PAC_FC_ALL_REAL_KINDS_SIZEOF" >&5 +$as_echo "$PAC_FC_ALL_REAL_KINDS_SIZEOF" >&6; } +ac_ext=${ac_fc_srcext-f} +ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5' +ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_fc_compiler_gnu + + + + + + + + + + + + + + + + + + + + + + + + + ## Setting definition if there is a 16 byte fortran integer + if `echo $PAC_FC_ALL_INTEGER_KINDS_SIZEOF | grep '16' >/dev/null`; then + HAVE_Fortran_INTEGER_SIZEOF_16="1" + +$as_echo "#define HAVE_Fortran_INTEGER_SIZEOF_16 1" >>confdefs.h - if test "x$ac_ct_DUMPBIN" = x; then - DUMPBIN=":" else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - DUMPBIN=$ac_ct_DUMPBIN - fi -fi + HAVE_Fortran_INTEGER_SIZEOF_16="0" + +$as_echo "#define HAVE_Fortran_INTEGER_SIZEOF_16 0" >>confdefs.h - case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in - *COFF*) - DUMPBIN="$DUMPBIN -symbols" - ;; - *) - DUMPBIN=: - ;; - esac fi - if test "$DUMPBIN" != ":"; then - NM="$DUMPBIN" + if test "X$HAVE_STORAGE_SIZE_FORTRAN" = "Xyes"; then + +$as_echo "#define FORTRAN_HAVE_STORAGE_SIZE 1" >>confdefs.h + fi -fi -test -z "$NM" && NM=nm + if test "X$HAVE_C_SIZEOF_FORTRAN" = "Xyes"; then +$as_echo "#define FORTRAN_HAVE_C_SIZEOF 1" >>confdefs.h + fi + if test "X$HAVE_SIZEOF_FORTRAN" = "Xyes"; then +$as_echo "#define FORTRAN_HAVE_SIZEOF 1" >>confdefs.h -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 -$as_echo_n "checking the name lister ($NM) interface... " >&6; } -if ${lt_cv_nm_interface+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_nm_interface="BSD nm" - echo "int some_variable = 0;" > conftest.$ac_ext - (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) - (eval "$ac_compile" 2>conftest.err) - cat conftest.err >&5 - (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) - (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) - cat conftest.err >&5 - (eval echo "\"\$as_me:$LINENO: output\"" >&5) - cat conftest.out >&5 - if $GREP 'External.*some_variable' conftest.out > /dev/null; then - lt_cv_nm_interface="MS dumpbin" fi - rm -f conftest* -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 -$as_echo "$lt_cv_nm_interface" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 -$as_echo_n "checking whether ln -s works... " >&6; } -LN_S=$as_ln_s -if test "$LN_S" = "ln -s"; then + ## See if C_LONG_DOUBLE is available + + HAVE_C_LONG_DOUBLE_FORTRAN="no" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if Fortran compiler supports intrinsic C_LONG_DOUBLE" >&5 +$as_echo_n "checking if Fortran compiler supports intrinsic C_LONG_DOUBLE... " >&6; } + cat > conftest.$ac_ext <<_ACEOF + + PROGRAM main + USE ISO_C_BINDING + REAL(KIND=C_LONG_DOUBLE) :: d + END PROGRAM + +_ACEOF +if ac_fn_fc_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } + HAVE_C_LONG_DOUBLE_FORTRAN="yes" else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 -$as_echo "no, using $LN_S" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext -# find the maximum length of command line arguments -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 -$as_echo_n "checking the maximum length of command line arguments... " >&6; } -if ${lt_cv_sys_max_cmd_len+:} false; then : - $as_echo_n "(cached) " >&6 -else - i=0 - teststring="ABCD" - - case $build_os in - msdosdjgpp*) - # On DJGPP, this test can blow up pretty badly due to problems in libc - # (any single argument exceeding 2000 bytes causes a buffer overrun - # during glob expansion). Even if it were fixed, the result of this - # check would be larger than it should be. - lt_cv_sys_max_cmd_len=12288; # 12K is about right - ;; - - gnu*) - # Under GNU Hurd, this test is not required because there is - # no limit to the length of command line arguments. - # Libtool will interpret -1 as no limit whatsoever - lt_cv_sys_max_cmd_len=-1; - ;; - - cygwin* | mingw* | cegcc*) - # On Win9x/ME, this test blows up -- it succeeds, but takes - # about 5 minutes as the teststring grows exponentially. - # Worse, since 9x/ME are not pre-emptively multitasking, - # you end up with a "frozen" computer, even though with patience - # the test eventually succeeds (with a max line length of 256k). - # Instead, let's just punt: use the minimum linelength reported by - # all of the supported platforms: 8192 (on NT/2K/XP). - lt_cv_sys_max_cmd_len=8192; - ;; - mint*) - # On MiNT this can take a long time and run out of memory. - lt_cv_sys_max_cmd_len=8192; - ;; + FORTRAN_HAVE_C_LONG_DOUBLE="0" + if test "X$HAVE_C_LONG_DOUBLE_FORTRAN" = "Xyes"; then + FORTRAN_HAVE_C_LONG_DOUBLE="1" - amigaos*) - # On AmigaOS with pdksh, this test takes hours, literally. - # So we just punt and use a minimum line length of 8192. - lt_cv_sys_max_cmd_len=8192; - ;; +$as_echo "#define FORTRAN_HAVE_C_LONG_DOUBLE 1" >>confdefs.h - netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) - # This has been around since 386BSD, at least. Likely further. - if test -x /sbin/sysctl; then - lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` - elif test -x /usr/sbin/sysctl; then - lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` - else - lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs - fi - # And add a safety zone - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` - ;; + fi - interix*) - # We know the value 262144 and hardcode it with a safety zone (like BSD) - lt_cv_sys_max_cmd_len=196608 - ;; + ## Is C_LONG_DOUBLE different from C_DOUBLE + FORTRAN_C_LONG_DOUBLE_IS_UNIQUE="0" + if test "X$FORTRAN_HAVE_C_LONG_DOUBLE"; then - os2*) - # The test takes a long time on OS/2. - lt_cv_sys_max_cmd_len=8192 - ;; + C_LONG_DOUBLE_IS_UNIQUE_FORTRAN="no" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if Fortran C_LONG_DOUBLE is different from C_DOUBLE" >&5 +$as_echo_n "checking if Fortran C_LONG_DOUBLE is different from C_DOUBLE... " >&6; } - osf*) - # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure - # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not - # nice to cause kernel panics so lets avoid the loop below. - # First set a reasonable default. - lt_cv_sys_max_cmd_len=16384 - # - if test -x /sbin/sysconfig; then - case `/sbin/sysconfig -q proc exec_disable_arg_limit` in - *1*) lt_cv_sys_max_cmd_len=-1 ;; - esac - fi - ;; - sco3.2v5*) - lt_cv_sys_max_cmd_len=102400 - ;; - sysv5* | sco5v6* | sysv4.2uw2*) - kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` - if test -n "$kargmax"; then - lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` - else - lt_cv_sys_max_cmd_len=32768 - fi - ;; - *) - lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` - if test -n "$lt_cv_sys_max_cmd_len"; then - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` - else - # Make teststring a little bigger before we do anything with it. - # a 1K string should be a reasonable start. - for i in 1 2 3 4 5 6 7 8 ; do - teststring=$teststring$teststring - done - SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} - # If test is not a shell built-in, we'll probably end up computing a - # maximum length that is only half of the actual maximum length, but - # we can't tell. - while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ - = "X$teststring$teststring"; } >/dev/null 2>&1 && - test $i != 17 # 1/2 MB should be enough - do - i=`expr $i + 1` - teststring=$teststring$teststring - done - # Only check the string length outside the loop. - lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` - teststring= - # Add a significant safety factor because C++ compilers can tack on - # massive amounts of additional arguments before passing them to the - # linker. It appears as though 1/2 is a usable value. - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` - fi - ;; - esac + cat > conftest.$ac_ext <<_ACEOF -fi + MODULE type_mod + USE ISO_C_BINDING + INTERFACE h5t + MODULE PROCEDURE h5t_c_double + MODULE PROCEDURE h5t_c_long_double + END INTERFACE + CONTAINS + SUBROUTINE h5t_c_double(r) + REAL(KIND=C_DOUBLE) :: r + END SUBROUTINE h5t_c_double + SUBROUTINE h5t_c_long_double(d) + REAL(KIND=C_LONG_DOUBLE) :: d + END SUBROUTINE h5t_c_long_double + END MODULE type_mod + PROGRAM main + USE ISO_C_BINDING + USE type_mod + REAL(KIND=C_DOUBLE) :: r + REAL(KIND=C_LONG_DOUBLE) :: d + CALL h5t(r) + CALL h5t(d) + END PROGRAM main -if test -n $lt_cv_sys_max_cmd_len ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 -$as_echo "$lt_cv_sys_max_cmd_len" >&6; } +_ACEOF +if ac_fn_fc_try_compile "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + C_LONG_DOUBLE_IS_UNIQUE_FORTRAN="yes" else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 -$as_echo "none" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -max_cmd_len=$lt_cv_sys_max_cmd_len - - - - - +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -: ${CP="cp -f"} -: ${MV="mv -f"} -: ${RM="rm -f"} + if test "X$C_LONG_DOUBLE_IS_UNIQUE_FORTRAN" = "Xyes"; then + FORTRAN_C_LONG_DOUBLE_IS_UNIQUE="1" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5 -$as_echo_n "checking whether the shell understands some XSI constructs... " >&6; } -# Try some XSI features -xsi_shell=no -( _lt_dummy="a/b/c" - test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ - = c,a/b,b/c, \ - && eval 'test $(( 1 + 1 )) -eq 2 \ - && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ - && xsi_shell=yes -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5 -$as_echo "$xsi_shell" >&6; } +$as_echo "#define FORTRAN_C_LONG_DOUBLE_IS_UNIQUE 1" >>confdefs.h + else + FORTRAN_C_LONG_DOUBLE_IS_UNIQUE="0" + fi + fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5 -$as_echo_n "checking whether the shell understands \"+=\"... " >&6; } -lt_shell_append=no -( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \ - >/dev/null 2>&1 \ - && lt_shell_append=yes -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5 -$as_echo "$lt_shell_append" >&6; } + FORTRAN_SIZEOF_LONG_DOUBLE=${ac_cv_sizeof_long_double} +cat >>confdefs.h <<_ACEOF +#define FORTRAN_SIZEOF_LONG_DOUBLE "${ac_cv_sizeof_long_double}" +_ACEOF -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - lt_unset=unset -else - lt_unset=false -fi + max_real_fortran_sizeof="`echo \"$PAC_FC_ALL_REAL_KINDS_SIZEOF\" | perl -ne '/,(\d+)\}/; print $1'`" + max_real_fortran_kind="`echo \"$PAC_FC_ALL_REAL_KINDS\" | perl -ne '/,(\d+)\}/; print $1'`" + if test "$ac_cv_sizeof___float128" != 0;then + if test "$ac_cv_sizeof___float128" != "$max_real_fortran_sizeof" && test "${ac_cv_sizeof_long_double}" != "$max_real_fortran_sizeof"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: + Fortran REAL(KIND=$max_real_fortran_kind) is $max_real_fortran_sizeof Bytes, but no corresponding C float type exists of that size + !!! Fortran interfaces will not be generated for REAL(KIND=$max_real_fortran_kind) !!! + " >&5 +$as_echo "$as_me: WARNING: + Fortran REAL(KIND=$max_real_fortran_kind) is $max_real_fortran_sizeof Bytes, but no corresponding C float type exists of that size + !!! Fortran interfaces will not be generated for REAL(KIND=$max_real_fortran_kind) !!! + " >&2;} + PAC_FC_ALL_REAL_KINDS="`echo \"$PAC_FC_ALL_REAL_KINDS\" | perl -pe 's/,\d+}/}/g;'`" + PAC_FC_ALL_REAL_KINDS_SIZEOF="`echo \"$PAC_FC_ALL_REAL_KINDS_SIZEOF\" | perl -pe 's/,\d+}/}/g;'`" + fi + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Fortran interoperable KINDS with C" >&5 +$as_echo_n "checking for Fortran interoperable KINDS with C... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PAC_FC_ALL_REAL_KINDS" >&5 +$as_echo "$PAC_FC_ALL_REAL_KINDS" >&6; } -# test EBCDIC or ASCII -case `echo X|tr X '\101'` in - A) # ASCII based system - # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr - lt_SP2NL='tr \040 \012' - lt_NL2SP='tr \015\012 \040\040' - ;; - *) # EBCDIC based system - lt_SP2NL='tr \100 \n' - lt_NL2SP='tr \r\n \100\100' - ;; -esac + H5CONFIG_F_NUM_RKIND="INTEGER, PARAMETER :: num_rkinds = `echo \"$PAC_FC_ALL_REAL_KINDS\" | perl -e '$count = ( =~ tr/,//);print $count+1'`" + H5CONFIG_F_RKIND="INTEGER, DIMENSION(1:num_rkinds) :: rkind = (/`echo \"$PAC_FC_ALL_REAL_KINDS\" | perl -pe 's/{//g' | perl -pe 's/}//g' | perl -pe 's/ /,/g'`/)" + H5CONFIG_F_RKIND_SIZEOF="INTEGER, DIMENSION(1:num_rkinds) :: rkind_sizeof = (/`echo \"$PAC_FC_ALL_REAL_KINDS_SIZEOF\" | perl -pe 's/{//g' | perl -pe 's/}//g'| perl -pe 's/ /,/g'`/)" +cat >>confdefs.h <<_ACEOF +#define H5CONFIG_F_NUM_RKIND $H5CONFIG_F_NUM_RKIND +_ACEOF +cat >>confdefs.h <<_ACEOF +#define H5CONFIG_F_RKIND $H5CONFIG_F_RKIND +_ACEOF +cat >>confdefs.h <<_ACEOF +#define H5CONFIG_F_RKIND_SIZEOF $H5CONFIG_F_RKIND_SIZEOF +_ACEOF +## Change back to the C language + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 -$as_echo_n "checking how to convert $build file names to $host format... " >&6; } -if ${lt_cv_to_host_file_cmd+:} false; then : - $as_echo_n "(cached) " >&6 else - case $host in - *-*-mingw* ) - case $build in - *-*-mingw* ) # actually msys - lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 - ;; - *-*-cygwin* ) - lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 - ;; - * ) # otherwise, assume *nix - lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 - ;; - esac - ;; - *-*-cygwin* ) - case $build in - *-*-mingw* ) # actually msys - lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin - ;; - *-*-cygwin* ) - lt_cv_to_host_file_cmd=func_convert_file_noop - ;; - * ) # otherwise, assume *nix - lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin - ;; - esac - ;; - * ) # unhandled hosts (and "normal" native builds) - lt_cv_to_host_file_cmd=func_convert_file_noop - ;; -esac - -fi - -to_host_file_cmd=$lt_cv_to_host_file_cmd -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 -$as_echo "$lt_cv_to_host_file_cmd" >&6; } - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 -$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } -if ${lt_cv_to_tool_file_cmd+:} false; then : - $as_echo_n "(cached) " >&6 -else - #assume ordinary cross tools, or native build. -lt_cv_to_tool_file_cmd=func_convert_file_noop -case $host in - *-*-mingw* ) - case $build in - *-*-mingw* ) # actually msys - lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 - ;; - esac - ;; -esac - -fi - -to_tool_file_cmd=$lt_cv_to_tool_file_cmd -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 -$as_echo "$lt_cv_to_tool_file_cmd" >&6; } - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 -$as_echo_n "checking for $LD option to reload object files... " >&6; } -if ${lt_cv_ld_reload_flag+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_ld_reload_flag='-r' + FC="no" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 -$as_echo "$lt_cv_ld_reload_flag" >&6; } -reload_flag=$lt_cv_ld_reload_flag -case $reload_flag in -"" | " "*) ;; -*) reload_flag=" $reload_flag" ;; -esac -reload_cmds='$LD$reload_flag -o $output$reload_objs' -case $host_os in - cygwin* | mingw* | pw32* | cegcc*) - if test "$GCC" != yes; then - reload_cmds=false - fi - ;; - darwin*) - if test "$GCC" = yes; then - reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' - else - reload_cmds='$LD$reload_flag -o $output$reload_objs' - fi - ;; -esac - - - - - - - - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. -set dummy ${ac_tool_prefix}objdump; ac_word=$2 +## ---------------------------------------------------------------------- +## Check if they would like the C++ interface compiled +## +## We need to check for a C++ compiler unconditionally, since +## AC_PROG_CXX defines some macros that Automake 1.9.x uses and will +## miss even if c++ is not enabled. + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +if test -z "$CXX"; then + if test -n "$CCC"; then + CXX=$CCC + else + if test -n "$ac_tool_prefix"; then + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_OBJDUMP+:} false; then : +if ${ac_cv_prog_CXX+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$OBJDUMP"; then - ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. + if test -n "$CXX"; then + ac_cv_prog_CXX="$CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -8812,7 +8526,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" + ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -8822,28 +8536,32 @@ IFS=$as_save_IFS fi fi -OBJDUMP=$ac_cv_prog_OBJDUMP -if test -n "$OBJDUMP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 -$as_echo "$OBJDUMP" >&6; } +CXX=$ac_cv_prog_CXX +if test -n "$CXX"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 +$as_echo "$CXX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi + test -n "$CXX" && break + done fi -if test -z "$ac_cv_prog_OBJDUMP"; then - ac_ct_OBJDUMP=$OBJDUMP - # Extract the first word of "objdump", so it can be a program name with args. -set dummy objdump; ac_word=$2 +if test -z "$CXX"; then + ac_ct_CXX=$CXX + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : +if ${ac_cv_prog_ac_ct_CXX+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$ac_ct_OBJDUMP"; then - ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. + if test -n "$ac_ct_CXX"; then + ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -8852,7 +8570,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_OBJDUMP="objdump" + ac_cv_prog_ac_ct_CXX="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -8862,17 +8580,21 @@ IFS=$as_save_IFS fi fi -ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP -if test -n "$ac_ct_OBJDUMP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 -$as_echo "$ac_ct_OBJDUMP" >&6; } +ac_ct_CXX=$ac_cv_prog_ac_ct_CXX +if test -n "$ac_ct_CXX"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 +$as_echo "$ac_ct_CXX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - if test "x$ac_ct_OBJDUMP" = x; then - OBJDUMP="false" + + test -n "$ac_ct_CXX" && break +done + + if test "x$ac_ct_CXX" = x; then + CXX="g++" else case $cross_compiling:$ac_tool_warned in yes:) @@ -8880,529 +8602,540 @@ yes:) $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac - OBJDUMP=$ac_ct_OBJDUMP + CXX=$ac_ct_CXX fi -else - OBJDUMP="$ac_cv_prog_OBJDUMP" fi -test -z "$OBJDUMP" && OBJDUMP=objdump - - - - - + fi +fi +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 +$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } +if ${ac_cv_cxx_compiler_gnu+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef FC_DUMMY_MAIN +#ifndef FC_DUMMY_MAIN_EQ_F77 +# ifdef __cplusplus + extern "C" +# endif + int FC_DUMMY_MAIN() { return 1; } +#endif +#endif +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_cxx_compiler_gnu=$ac_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 -$as_echo_n "checking how to recognize dependent libraries... " >&6; } -if ${lt_cv_deplibs_check_method+:} false; then : - $as_echo_n "(cached) " >&6 +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 +$as_echo "$ac_cv_cxx_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GXX=yes else - lt_cv_file_magic_cmd='$MAGIC_CMD' -lt_cv_file_magic_test_file= -lt_cv_deplibs_check_method='unknown' -# Need to set the preceding variable on all platforms that support -# interlibrary dependencies. -# 'none' -- dependencies not supported. -# `unknown' -- same as none, but documents that we really don't know. -# 'pass_all' -- all dependencies passed with no checks. -# 'test_compile' -- check by making test program. -# 'file_magic [[regex]]' -- check by looking for files in library path -# which responds to the $file_magic_cmd with a given extended regex. -# If you have `file' or equivalent on your system and you're not sure -# whether `pass_all' will *always* work, you probably want this one. - -case $host_os in -aix[4-9]*) - lt_cv_deplibs_check_method=pass_all - ;; + GXX= +fi +ac_test_CXXFLAGS=${CXXFLAGS+set} +ac_save_CXXFLAGS=$CXXFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 +$as_echo_n "checking whether $CXX accepts -g... " >&6; } +if ${ac_cv_prog_cxx_g+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_save_cxx_werror_flag=$ac_cxx_werror_flag + ac_cxx_werror_flag=yes + ac_cv_prog_cxx_g=no + CXXFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -beos*) - lt_cv_deplibs_check_method=pass_all - ;; +#ifdef FC_DUMMY_MAIN +#ifndef FC_DUMMY_MAIN_EQ_F77 +# ifdef __cplusplus + extern "C" +# endif + int FC_DUMMY_MAIN() { return 1; } +#endif +#endif +int +main () +{ -bsdi[45]*) - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' - lt_cv_file_magic_cmd='/usr/bin/file -L' - lt_cv_file_magic_test_file=/shlib/libc.so - ;; + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_prog_cxx_g=yes +else + CXXFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -cygwin*) - # func_win32_libid is a shell function defined in ltmain.sh - lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' - lt_cv_file_magic_cmd='func_win32_libid' - ;; +#ifdef FC_DUMMY_MAIN +#ifndef FC_DUMMY_MAIN_EQ_F77 +# ifdef __cplusplus + extern "C" +# endif + int FC_DUMMY_MAIN() { return 1; } +#endif +#endif +int +main () +{ -mingw* | pw32*) - # Base MSYS/MinGW do not provide the 'file' command needed by - # func_win32_libid shell function, so use a weaker test based on 'objdump', - # unless we find 'file', for example because we are cross-compiling. - # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin. - if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then - lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' - lt_cv_file_magic_cmd='func_win32_libid' - else - # Keep this pattern in sync with the one in func_win32_libid. - lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' - lt_cv_file_magic_cmd='$OBJDUMP -f' - fi - ;; + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : -cegcc*) - # use the weaker test based on 'objdump'. See mingw*. - lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' - lt_cv_file_magic_cmd='$OBJDUMP -f' - ;; +else + ac_cxx_werror_flag=$ac_save_cxx_werror_flag + CXXFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -darwin* | rhapsody*) - lt_cv_deplibs_check_method=pass_all - ;; +#ifdef FC_DUMMY_MAIN +#ifndef FC_DUMMY_MAIN_EQ_F77 +# ifdef __cplusplus + extern "C" +# endif + int FC_DUMMY_MAIN() { return 1; } +#endif +#endif +int +main () +{ -freebsd* | dragonfly*) - if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then - case $host_cpu in - i*86 ) - # Not sure whether the presence of OpenBSD here was a mistake. - # Let's accept both of them until this is cleared up. - lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` - ;; - esac + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_prog_cxx_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cxx_werror_flag=$ac_save_cxx_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 +$as_echo "$ac_cv_prog_cxx_g" >&6; } +if test "$ac_test_CXXFLAGS" = set; then + CXXFLAGS=$ac_save_CXXFLAGS +elif test $ac_cv_prog_cxx_g = yes; then + if test "$GXX" = yes; then + CXXFLAGS="-g -O2" else - lt_cv_deplibs_check_method=pass_all + CXXFLAGS="-g" fi - ;; - -gnu*) - lt_cv_deplibs_check_method=pass_all - ;; - -haiku*) - lt_cv_deplibs_check_method=pass_all - ;; - -hpux10.20* | hpux11*) - lt_cv_file_magic_cmd=/usr/bin/file - case $host_cpu in - ia64*) - lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' - lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so - ;; - hppa*64*) - lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]' - lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl - ;; - *) - lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library' - lt_cv_file_magic_test_file=/usr/lib/libc.sl - ;; - esac - ;; - -interix[3-9]*) - # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here - lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' - ;; - -irix5* | irix6* | nonstopux*) - case $LD in - *-32|*"-32 ") libmagic=32-bit;; - *-n32|*"-n32 ") libmagic=N32;; - *-64|*"-64 ") libmagic=64-bit;; - *) libmagic=never-match;; - esac - lt_cv_deplibs_check_method=pass_all - ;; - -# This must be glibc/ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu) - lt_cv_deplibs_check_method=pass_all - ;; - -netbsd*) - if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then - lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' +else + if test "$GXX" = yes; then + CXXFLAGS="-O2" else - lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' + CXXFLAGS= fi - ;; +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu -newos6*) - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=/usr/lib/libnls.so - ;; +depcc="$CXX" am_compiler_list= -*nto* | *qnx*) - lt_cv_deplibs_check_method=pass_all - ;; +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if ${am_cv_CXX_dependencies_compiler_type+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub -openbsd*) - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' - else - lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' + am_cv_CXX_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi - ;; - -osf3* | osf4* | osf5*) - lt_cv_deplibs_check_method=pass_all - ;; - -rdos*) - lt_cv_deplibs_check_method=pass_all - ;; - -solaris*) - lt_cv_deplibs_check_method=pass_all - ;; - -sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) - lt_cv_deplibs_check_method=pass_all - ;; + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac -sysv4 | sysv4.3*) - case $host_vendor in - motorola) - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` - ;; - ncr) - lt_cv_deplibs_check_method=pass_all - ;; - sequent) - lt_cv_file_magic_cmd='/bin/file' - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' - ;; - sni) - lt_cv_file_magic_cmd='/bin/file' - lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" - lt_cv_file_magic_test_file=/lib/libc.so - ;; - siemens) - lt_cv_deplibs_check_method=pass_all - ;; - pc) - lt_cv_deplibs_check_method=pass_all - ;; - esac - ;; + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf -tpf*) - lt_cv_deplibs_check_method=pass_all - ;; -esac + # We check with '-c' and '-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok '-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CXX_dependencies_compiler_type=$depmode + break + fi + fi + done + cd .. + rm -rf conftest.dir +else + am_cv_CXX_dependencies_compiler_type=none fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 -$as_echo "$lt_cv_deplibs_check_method" >&6; } -file_magic_glob= -want_nocaseglob=no -if test "$build" = "$host"; then - case $host_os in - mingw* | pw32*) - if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then - want_nocaseglob=yes - else - file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` - fi - ;; - esac fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5 +$as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; } +CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type -file_magic_cmd=$lt_cv_file_magic_cmd -deplibs_check_method=$lt_cv_deplibs_check_method -test -z "$deplibs_check_method" && deplibs_check_method=unknown - - - - - - - - - - - - - - - - - - - - + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then + am__fastdepCXX_TRUE= + am__fastdepCXX_FALSE='#' +else + am__fastdepCXX_TRUE='#' + am__fastdepCXX_FALSE= +fi -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. -set dummy ${ac_tool_prefix}dlltool; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_DLLTOOL+:} false; then : + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5 +$as_echo_n "checking how to run the C++ preprocessor... " >&6; } +if test -z "$CXXCPP"; then + if ${ac_cv_prog_CXXCPP+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$DLLTOOL"; then - ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH + # Double quotes because CXXCPP needs to be expanded + for CXXCPP in "$CXX -E" "/lib/cpp" + do + ac_preproc_ok=false +for ac_cxx_preproc_warn_flag in '' yes do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO"; then : -fi -fi -DLLTOOL=$ac_cv_prog_DLLTOOL -if test -n "$DLLTOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 -$as_echo "$DLLTOOL" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + # Broken: fails on valid input. +continue fi +rm -f conftest.err conftest.i conftest.$ac_ext - + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break fi -if test -z "$ac_cv_prog_DLLTOOL"; then - ac_ct_DLLTOOL=$DLLTOOL - # Extract the first word of "dlltool", so it can be a program name with args. -set dummy dlltool; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_DLLTOOL"; then - ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_DLLTOOL="dlltool" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi +rm -f conftest.err conftest.i conftest.$ac_ext + done - done -IFS=$as_save_IFS +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + break +fi + + done + ac_cv_prog_CXXCPP=$CXXCPP fi + CXXCPP=$ac_cv_prog_CXXCPP +else + ac_cv_prog_CXXCPP=$CXXCPP fi -ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL -if test -n "$ac_ct_DLLTOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 -$as_echo "$ac_ct_DLLTOOL" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5 +$as_echo "$CXXCPP" >&6; } +ac_preproc_ok=false +for ac_cxx_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO"; then : + else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + # Broken: fails on valid input. +continue fi +rm -f conftest.err conftest.i conftest.$ac_ext - if test "x$ac_ct_DLLTOOL" = x; then - DLLTOOL="false" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - DLLTOOL=$ac_ct_DLLTOOL - fi + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue else - DLLTOOL="$ac_cv_prog_DLLTOOL" + # Passes both tests. +ac_preproc_ok=: +break fi +rm -f conftest.err conftest.i conftest.$ac_ext -test -z "$DLLTOOL" && DLLTOOL=dlltool +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check +See \`config.log' for more details" "$LINENO" 5; } +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + ## this is checked for when AC_HEADER_STDC is done +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if c++ interface enabled" >&5 +$as_echo_n "checking if c++ interface enabled... " >&6; } +# Check whether --enable-cxx was given. +if test "${enable_cxx+set}" = set; then : + enableval=$enable_cxx; HDF_CXX=$enableval +fi +if test "X$HDF_CXX" = "Xyes"; then + echo "yes" + HDF5_INTERFACES="$HDF5_INTERFACES c++" + ## Change to the C++ language + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + # Checking if C++ needs old style header files in includes -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 -$as_echo_n "checking how to associate runtime and link libraries... " >&6; } -if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_sharedlib_from_linklib_cmd='unknown' -case $host_os in -cygwin* | mingw* | pw32* | cegcc*) - # two different shell functions defined in ltmain.sh - # decide which to use based on capabilities of $DLLTOOL - case `$DLLTOOL --help 2>&1` in - *--identify-strict*) - lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib - ;; - *) - lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback - ;; - esac - ;; -*) - # fallback: assume linklib IS sharedlib - lt_cv_sharedlib_from_linklib_cmd="$ECHO" - ;; -esac + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CXX needs old style header files in includes" >&5 +$as_echo_n "checking if $CXX needs old style header files in includes... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 -$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } -sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd -test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO +#include +int main(void) { return 0; } +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + CXXFLAGS="${CXXFLAGS} -DOLD_HEADER_FILENAME" + AM_CXXFLAGS="${AM_CXXFLAGS} -DOLD_HEADER_FILENAME" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + # Checking if C++ can handle namespaces + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CXX can handle namespaces" >&5 +$as_echo_n "checking if $CXX can handle namespaces... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +namespace H5 { +int fnord; +} -if test -n "$ac_tool_prefix"; then - for ac_prog in ar - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_AR+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$AR"; then - ac_cv_prog_AR="$AR" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_AR="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS +int main(void) { + using namespace H5; + fnord = 37; + return 0; +} -fi -fi -AR=$ac_cv_prog_AR -if test -n "$AR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 -$as_echo "$AR" >&6; } +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } + CXXFLAGS="${CXXFLAGS} -DH5_NO_NAMESPACE" + AM_CXXFLAGS="${AM_CXXFLAGS} -DH5_NO_NAMESPACE" fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext - test -n "$AR" && break - done -fi -if test -z "$AR"; then - ac_ct_AR=$AR - for ac_prog in ar -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_AR+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_AR"; then - ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_AR="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS + # Checking if C++ has offsetof extension -fi -fi -ac_ct_AR=$ac_cv_prog_ac_ct_AR -if test -n "$ac_ct_AR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 -$as_echo "$ac_ct_AR" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$ac_ct_AR" && break -done - - if test "x$ac_ct_AR" = x; then - AR="false" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - AR=$ac_ct_AR - fi -fi - -: ${AR=ar} -: ${AR_FLAGS=cru} - - - - - - - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 -$as_echo_n "checking for archiver @FILE support... " >&6; } -if ${lt_cv_ar_at_file+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_ar_at_file=no - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CXX has offsetof extension" >&5 +$as_echo_n "checking if $CXX has offsetof extension... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ + #include + #include + #ifdef FC_DUMMY_MAIN #ifndef FC_DUMMY_MAIN_EQ_F77 # ifdef __cplusplus @@ -9415,160 +9148,124 @@ int main () { + struct index_st + { + unsigned char type; + unsigned char num; + unsigned int len; + }; + typedef struct index_st index_t; + int x,y; + x = offsetof(struct index_st, len); + y = offsetof(index_t, num) + ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - echo conftest.$ac_objext > conftest.lst - lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' - { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 - (eval $lt_ar_try) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - if test "$ac_status" -eq 0; then - # Ensure the archiver fails upon bogus file names. - rm -f conftest.$ac_objext libconftest.a - { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 - (eval $lt_ar_try) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - if test "$ac_status" -ne 0; then - lt_cv_ar_at_file=@ - fi - fi - rm -f conftest.* libconftest.a - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +if ac_fn_cxx_try_link "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 -$as_echo "$lt_cv_ar_at_file" >&6; } +$as_echo "#define CXX_HAVE_OFFSETOF 1" >>confdefs.h -if test "x$lt_cv_ar_at_file" = xno; then - archiver_list_spec= else - archiver_list_spec=$lt_cv_ar_at_file + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + # if C++ can handle static cast + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CXX can handle static cast" >&5 +$as_echo_n "checking if $CXX can handle static cast... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int main(void) { + float test_float; + int test_int; + test_float = 37.0; + test_int = static_cast (test_float); + return 0; +} - - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. -set dummy ${ac_tool_prefix}strip; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_STRIP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$STRIP"; then - ac_cv_prog_STRIP="$STRIP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_STRIP="${ac_tool_prefix}strip" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -STRIP=$ac_cv_prog_STRIP -if test -n "$STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 -$as_echo "$STRIP" >&6; } +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } + CXXFLAGS="${CXXFLAGS} -DNO_STATIC_CAST" + AM_CXXFLAGS="${AM_CXXFLAGS} -DNO_STATIC_CAST" fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext -fi -if test -z "$ac_cv_prog_STRIP"; then - ac_ct_STRIP=$STRIP - # Extract the first word of "strip", so it can be a program name with args. -set dummy strip; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_STRIP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_STRIP"; then - ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_STRIP="strip" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP -if test -n "$ac_ct_STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 -$as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } + CXX="no" fi - if test "x$ac_ct_STRIP" = x; then - STRIP=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - STRIP=$ac_ct_STRIP - fi +## Change back to the C language +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + +## ---------------------------------------------------------------------- +## Check if they would like the High Level library compiled +## + + HL="" +## name of fortran folder inside "hl", if FORTRAN compile is requested + HL_FOR="" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if high level library is enabled" >&5 +$as_echo_n "checking if high level library is enabled... " >&6; } +# Check whether --enable-hl was given. +if test "${enable_hl+set}" = set; then : + enableval=$enable_hl; HDF5_HL=$enableval else - STRIP="$ac_cv_prog_STRIP" + HDF5_HL=yes fi -test -z "$STRIP" && STRIP=: +if test "X$HDF5_HL" = "Xyes"; then + echo "yes" + HL="hl" +$as_echo "#define INCLUDE_HL 1" >>confdefs.h +else + echo "no" +fi +## ---------------------------------------------------------------------- +## Check which archiving tool to use. This needs to be done before +## the AM_PROG_LIBTOOL macro. +## -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. -set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +if test -z "$AR"; then + for ac_prog in ar xar +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_RANLIB+:} false; then : +if ${ac_cv_prog_AR+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$RANLIB"; then - ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -9577,7 +9274,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + ac_cv_prog_AR="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -9587,37 +9284,84 @@ IFS=$as_save_IFS fi fi -RANLIB=$ac_cv_prog_RANLIB -if test -n "$RANLIB"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 -$as_echo "$RANLIB" >&6; } +AR=$ac_cv_prog_AR +if test -n "$AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +$as_echo "$AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi + test -n "$AR" && break +done +test -n "$AR" || AR=":" + fi -if test -z "$ac_cv_prog_RANLIB"; then - ac_ct_RANLIB=$RANLIB - # Extract the first word of "ranlib", so it can be a program name with args. -set dummy ranlib; ac_word=$2 + + +## Export the AR macro so that it will be placed in the libtool file +## correctly. +export AR + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + SET_MAKE= +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" +fi + + + + +## ---------------------------------------------------------------------- +## Set up ${TR} which is used to process DEBUG_PKG. + +# Extract the first word of "tr", so it can be a program name with args. +set dummy tr; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : +if ${ac_cv_path_TR+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$ac_ct_RANLIB"; then - ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + case $TR in + [\\/]* | ?:[\\/]*) + ac_cv_path_TR="$TR" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_RANLIB="ranlib" + ac_cv_path_TR="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -9625,84 +9369,172 @@ done done IFS=$as_save_IFS + ;; +esac fi -fi -ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB -if test -n "$ac_ct_RANLIB"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 -$as_echo "$ac_ct_RANLIB" >&6; } +TR=$ac_cv_path_TR +if test -n "$TR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TR" >&5 +$as_echo "$TR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - if test "x$ac_ct_RANLIB" = x; then - RANLIB=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - RANLIB=$ac_ct_RANLIB - fi -else - RANLIB="$ac_cv_prog_RANLIB" -fi - -test -z "$RANLIB" && RANLIB=: +## ---------------------------------------------------------------------- +## Check that time can be used with srcdir. This is okay on most systems, +## but seems to cause problems on Cygwin. +## The solution on Cygwin is not to record execution time for tests. +## +## Note: This is still true as of Cygwin 1.7.32 (Aug 2014) on both 32- +## and 64-bit platforms. Given how long this has been true, it seems +## unlikely to change, but we should probably re-test this periodically. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if srcdir= and time commands work together" >&5 +$as_echo_n "checking if srcdir= and time commands work together... " >&6; } -# Determine commands to create old-style static archives. -old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' -old_postinstall_cmds='chmod 644 $oldlib' -old_postuninstall_cmds= +TIME=time +TIME_TEST=`foo="bar" ${TIME} echo 'baz' 2> /dev/null | grep baz` -if test -n "$RANLIB"; then - case $host_os in - openbsd*) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" - ;; - *) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" - ;; - esac - old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" +if test "X${TIME_TEST}" = "Xbaz"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + TIME= fi -case $host_os in - darwin*) - lock_old_archive_extraction=yes ;; - *) - lock_old_archive_extraction=no ;; -esac +## The following variables are used to distinguish between building a +## serial and parallel library. +## +## HAVE_PARALLEL -- defined in H5config.h if we are building +## a parallel library even if configure wasn't +## able to find some header file or library that +## might be required. This is defined if the +## user explicitly states +## that a parallel library is being built by supplying +## the `--enable-parallel' configure switch. +## +## PARALLEL -- This variable is set to a non-null value if +## we're building a parallel version of the library. +## +## RUNSERIAL -- This is a command which will be prepended to +## the executable name to run the executable using +## a single process. For serial versions of the +## library this will normally be empty. For parallel +## versions it might be something like `mpiexec -n 1'. +## The value of this variable is substituted in *.in +## files. +## +## RUNPARALLEL -- This is a command which will be prepended to +## the executable name to run the executable on +## multiple processors. For the serial library the +## value will normally be the empty string. For +## parallel library it should be something like +## "mpiexec -n \$\${NPROCS:=6}" where NPROCS will +## eventually contain the number of processors on which +## to run the executable (the double dollarsigns are to +## protect the expansion until make executes the +## command). The value of this variable is +## substituted in *.in files. +## +## ---------------------------------------------------------------------- +## Disable shared libraries on CYGWIN. (LK - 04/16/15) +## A number of tests run by "make check" fail on CYGWIN, so for HDF5 v1.8.15 +## we will change the default for shared libraries to disabled. +case "`uname`" in + CYGWIN*) + enable_shared="no" + CHECK_WARN="Shared libraries are not currently supported on CYGWIN." + ;; +esac +## ---------------------------------------------------------------------- +## Fortran libraries are not currently supported on Mac. Disable them. +## (this is overridable with --enable-unsupported). +## +H5_FORTRAN_SHARED="no" +if test "X${HDF_FORTRAN}" = "Xyes" && test "X${enable_shared}" != "Xno"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if shared Fortran libraries are supported" >&5 +$as_echo_n "checking if shared Fortran libraries are supported... " >&6; } + H5_FORTRAN_SHARED="yes" + ## Disable fortran shared libraries on Mac. (MAM - 03/30/11) + case "`uname`" in + Darwin*) + H5_FORTRAN_SHARED="no" + CHECK_WARN="Shared Fortran libraries not currently supported on Mac." + ;; + esac + ## Report results of check(s) + if test "X${H5_FORTRAN_SHARED}" = "Xno"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $CHECK_WARN" >&5 +$as_echo "$as_me: WARNING: $CHECK_WARN" >&2;} + if test "X${ALLOW_UNSUPPORTED}" != "Xyes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Disabling shared Fortran libraries." >&5 +$as_echo "$as_me: WARNING: Disabling shared Fortran libraries." >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: To override this behavior, please use --enable-unsupported configure option." >&5 +$as_echo "$as_me: WARNING: To override this behavior, please use --enable-unsupported configure option." >&2;} + if test "X${enable_static}" = "Xno"; then + as_fn_error $? "both static and shared Fortran libraries are disabled" "$LINENO" 5 + fi + else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Allowing unsupported Fortran shared libraries due to use of --enable-unsupported flag" >&5 +$as_echo "$as_me: WARNING: Allowing unsupported Fortran shared libraries due to use of --enable-unsupported flag" >&2;} + H5_FORTRAN_SHARED="yes" + fi + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + fi +fi + if test "X$H5_FORTRAN_SHARED" = "Xyes"; then + FORTRAN_SHARED_CONDITIONAL_TRUE= + FORTRAN_SHARED_CONDITIONAL_FALSE='#' +else + FORTRAN_SHARED_CONDITIONAL_TRUE='#' + FORTRAN_SHARED_CONDITIONAL_FALSE= +fi +## ---------------------------------------------------------------------- +## Create libtool. If shared/static libraries are going to be enabled +## or disabled, it should happen before these macros. +## ---------------------------------------------------------------------- +## dlopen - This will use an improved version of libtool +## win32-dll - This will build clean dlls on win32 platforms. +case `pwd` in + *\ * | *\ *) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 +$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; +esac +macro_version='2.4.2' +macro_revision='1.3337' @@ -9716,277 +9548,227 @@ esac +ltmain="$ac_aux_dir/ltmain.sh" +# Backslashify metacharacters that are still active within +# double-quoted strings. +sed_quote_subst='s/\(["`$\\]\)/\\\1/g' +# Same as above, but do not quote variable references. +double_quote_subst='s/\(["`\\]\)/\\\1/g' +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' -# If no C compiler was specified, use CC. -LTCC=${LTCC-"$CC"} +# Sed substitution to delay expansion of an escaped single quote. +delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' -# If no C compiler flags were specified, use CFLAGS. -LTCFLAGS=${LTCFLAGS-"$CFLAGS"} - -# Allow CC to be a program name with arguments. -compiler=$CC +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' +ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO -# Check for command to grab the raw symbol name followed by C symbol from nm. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 -$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } -if ${lt_cv_sys_global_symbol_pipe+:} false; then : - $as_echo_n "(cached) " >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 +$as_echo_n "checking how to print strings... " >&6; } +# Test print first, because it will be a builtin if present. +if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ + test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='print -r --' +elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='printf %s\n' else + # Use this function as a fallback that always works. + func_fallback_echo () + { + eval 'cat <<_LTECHO_EOF +$1 +_LTECHO_EOF' + } + ECHO='func_fallback_echo' +fi -# These are sane defaults that work on at least a few old systems. -# [They come from Ultrix. What could be older than Ultrix?!! ;)] +# func_echo_all arg... +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "" +} -# Character class describing NM global symbol codes. -symcode='[BCDEGRST]' +case "$ECHO" in + printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 +$as_echo "printf" >&6; } ;; + print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 +$as_echo "print -r" >&6; } ;; + *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 +$as_echo "cat" >&6; } ;; +esac -# Regexp to match symbols that can be accessed directly from C. -sympat='\([_A-Za-z][_A-Za-z0-9]*\)' -# Define system-specific variables. -case $host_os in -aix*) - symcode='[BCDT]' - ;; -cygwin* | mingw* | pw32* | cegcc*) - symcode='[ABCDGISTW]' - ;; -hpux*) - if test "$host_cpu" = ia64; then - symcode='[ABCDEGRST]' - fi - ;; -irix* | nonstopux*) - symcode='[BCDEGRST]' - ;; -osf*) - symcode='[BCDEGQRST]' - ;; -solaris*) - symcode='[BDRT]' - ;; -sco3.2v5*) - symcode='[DT]' - ;; -sysv4.2uw2*) - symcode='[DT]' - ;; -sysv5* | sco5v6* | unixware* | OpenUNIX*) - symcode='[ABDT]' - ;; -sysv4) - symcode='[DFNSTU]' - ;; -esac -# If we're using GNU nm, then use its standard symbol codes. -case `$NM -V 2>&1` in -*GNU* | *'with BFD'*) - symcode='[ABCDGIRSTW]' ;; -esac -# Transform an extracted symbol line into a proper C declaration. -# Some systems (esp. on ia64) link data and code symbols differently, -# so use this general approach. -lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" -# Transform an extracted symbol line into symbol name and symbol address -lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" -# Handle CRLF in mingw tool chain -opt_cr= -case $build_os in -mingw*) - opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp - ;; -esac -# Try without a prefix underscore, then with it. -for ac_symprfx in "" "_"; do - # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. - symxfrm="\\1 $ac_symprfx\\2 \\2" - # Write the raw and C identifiers. - if test "$lt_cv_nm_interface" = "MS dumpbin"; then - # Fake it for dumpbin and say T for any non-static function - # and D for any global variable. - # Also find C++ and __fastcall symbols from MSVC++, - # which start with @ or ?. - lt_cv_sys_global_symbol_pipe="$AWK '"\ -" {last_section=section; section=\$ 3};"\ -" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ -" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ -" \$ 0!~/External *\|/{next};"\ -" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ -" {if(hide[section]) next};"\ -" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ -" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ -" s[1]~/^[@?]/{print s[1], s[1]; next};"\ -" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ -" ' prfx=^$ac_symprfx" - else - lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" - fi - lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" - # Check to see that the pipe works correctly. - pipe_works=no - rm -f conftest* - cat > conftest.$ac_ext <<_LT_EOF -#ifdef __cplusplus -extern "C" { -#endif -char nm_test_var; -void nm_test_func(void); -void nm_test_func(void){} -#ifdef __cplusplus -} -#endif -int main(){nm_test_var='a';nm_test_func();return(0);} -_LT_EOF - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - # Now try to grab the symbols. - nlist=conftest.nm - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 - (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && test -s "$nlist"; then - # Try sorting and uniquifying the output. - if sort "$nlist" | uniq > "$nlist"T; then - mv -f "$nlist"T "$nlist" - else - rm -f "$nlist"T - fi - # Make sure that we snagged all the symbols we need. - if $GREP ' nm_test_var$' "$nlist" >/dev/null; then - if $GREP ' nm_test_func$' "$nlist" >/dev/null; then - cat <<_LT_EOF > conftest.$ac_ext -/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ -#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) -/* DATA imports from DLLs on WIN32 con't be const, because runtime - relocations are performed -- see ld's documentation on pseudo-relocs. */ -# define LT_DLSYM_CONST -#elif defined(__osf__) -/* This system does not cope well with relocations in const data. */ -# define LT_DLSYM_CONST -#else -# define LT_DLSYM_CONST const -#endif -#ifdef __cplusplus -extern "C" { -#endif +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 +$as_echo_n "checking for a sed that does not truncate output... " >&6; } +if ${ac_cv_path_SED+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ + for ac_i in 1 2 3 4 5 6 7; do + ac_script="$ac_script$as_nl$ac_script" + done + echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed + { ac_script=; unset ac_script;} + if test -z "$SED"; then + ac_path_SED_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_SED" || continue +# Check for GNU ac_path_SED and select it if it is found. + # Check for GNU $ac_path_SED +case `"$ac_path_SED" --version 2>&1` in +*GNU*) + ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo '' >> "conftest.nl" + "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_SED_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_SED="$ac_path_SED" + ac_path_SED_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac -_LT_EOF - # Now generate the symbol file. - eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' + $ac_path_SED_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_SED"; then + as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 + fi +else + ac_cv_path_SED=$SED +fi - cat <<_LT_EOF >> conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 +$as_echo "$ac_cv_path_SED" >&6; } + SED="$ac_cv_path_SED" + rm -f conftest.sed -/* The mapping between symbol names and symbols. */ -LT_DLSYM_CONST struct { - const char *name; - void *address; -} -lt__PROGRAM__LTX_preloaded_symbols[] = -{ - { "@PROGRAM@", (void *) 0 }, -_LT_EOF - $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext - cat <<\_LT_EOF >> conftest.$ac_ext - {0, (void *) 0} -}; +test -z "$SED" && SED=sed +Xsed="$SED -e 1s/^X//" -/* This works around a problem in FreeBSD linker */ -#ifdef FREEBSD_WORKAROUND -static const void *lt_preloaded_setup() { - return lt__PROGRAM__LTX_preloaded_symbols; -} -#endif -#ifdef __cplusplus -} -#endif -_LT_EOF - # Now try linking the two files. - mv conftest.$ac_objext conftstm.$ac_objext - lt_globsym_save_LIBS=$LIBS - lt_globsym_save_CFLAGS=$CFLAGS - LIBS="conftstm.$ac_objext" - CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 - (eval $ac_link) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && test -s conftest${ac_exeext}; then - pipe_works=yes - fi - LIBS=$lt_globsym_save_LIBS - CFLAGS=$lt_globsym_save_CFLAGS - else - echo "cannot find nm_test_func in $nlist" >&5 - fi - else - echo "cannot find nm_test_var in $nlist" >&5 - fi - else - echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 - fi - else - echo "$progname: failed program was:" >&5 - cat conftest.$ac_ext >&5 - fi - rm -rf conftest* conftst* - # Do not use the global_symbol_pipe unless it works. - if test "$pipe_works" = yes; then - break - else - lt_cv_sys_global_symbol_pipe= - fi -done -fi -if test -z "$lt_cv_sys_global_symbol_pipe"; then - lt_cv_sys_global_symbol_to_cdecl= -fi -if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 -$as_echo "failed" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 -$as_echo "ok" >&6; } -fi -# Response file support. -if test "$lt_cv_nm_interface" = "MS dumpbin"; then - nm_file_list_spec='@' -elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then - nm_file_list_spec='@' -fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 +$as_echo_n "checking for fgrep... " >&6; } +if ${ac_cv_path_FGREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 + then ac_cv_path_FGREP="$GREP -F" + else + if test -z "$FGREP"; then + ac_path_FGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in fgrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_FGREP" || continue +# Check for GNU ac_path_FGREP and select it if it is found. + # Check for GNU $ac_path_FGREP +case `"$ac_path_FGREP" --version 2>&1` in +*GNU*) + ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'FGREP' >> "conftest.nl" + "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_FGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_FGREP="$ac_path_FGREP" + ac_path_FGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + $ac_path_FGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_FGREP"; then + as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_FGREP=$FGREP +fi + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 +$as_echo "$ac_cv_path_FGREP" >&6; } + FGREP="$ac_cv_path_FGREP" +test -z "$GREP" && GREP=grep @@ -10005,387 +9787,188 @@ fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 -$as_echo_n "checking for sysroot... " >&6; } -# Check whether --with-sysroot was given. -if test "${with_sysroot+set}" = set; then : - withval=$with_sysroot; +# Check whether --with-gnu-ld was given. +if test "${with_gnu_ld+set}" = set; then : + withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes else - with_sysroot=no + with_gnu_ld=no fi - -lt_sysroot= -case ${with_sysroot} in #( - yes) - if test "$GCC" = yes; then - lt_sysroot=`$CC --print-sysroot 2>/dev/null` - fi - ;; #( - /*) - lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` - ;; #( - no|'') - ;; #( - *) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5 -$as_echo "${with_sysroot}" >&6; } - as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 - ;; -esac - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 -$as_echo "${lt_sysroot:-no}" >&6; } - - - - - -# Check whether --enable-libtool-lock was given. -if test "${enable_libtool_lock+set}" = set; then : - enableval=$enable_libtool_lock; +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 +$as_echo_n "checking for ld used by $CC... " >&6; } + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [\\/]* | ?:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` + while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do + ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 +$as_echo_n "checking for GNU ld... " >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 +$as_echo_n "checking for non-GNU ld... " >&6; } fi - -test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes - -# Some flags need to be propagated to the compiler or linker for good -# libtool support. -case $host in -ia64-*-hpux*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - case `/usr/bin/file conftest.$ac_objext` in - *ELF-32*) - HPUX_IA64_MODE="32" +if ${lt_cv_path_LD+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$LD"; then + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 conftest.$ac_ext - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - if test "$lt_cv_prog_gnu_ld" = yes; then - case `/usr/bin/file conftest.$ac_objext` in - *32-bit*) - LD="${LD-ld} -melf32bsmip" - ;; - *N32*) - LD="${LD-ld} -melf32bmipn32" - ;; - *64-bit*) - LD="${LD-ld} -melf64bmip" - ;; - esac - else - case `/usr/bin/file conftest.$ac_objext` in - *32-bit*) - LD="${LD-ld} -32" - ;; - *N32*) - LD="${LD-ld} -n32" - ;; - *64-bit*) - LD="${LD-ld} -64" - ;; esac fi - fi - rm -rf conftest* - ;; - -x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ -s390*-*linux*|s390*-*tpf*|sparc*-*linux*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - case `/usr/bin/file conftest.o` in - *32-bit*) - case $host in - x86_64-*kfreebsd*-gnu) - LD="${LD-ld} -m elf_i386_fbsd" - ;; - x86_64-*linux*) - LD="${LD-ld} -m elf_i386" - ;; - ppc64-*linux*|powerpc64-*linux*) - LD="${LD-ld} -m elf32ppclinux" - ;; - s390x-*linux*) - LD="${LD-ld} -m elf_s390" - ;; - sparc64-*linux*) - LD="${LD-ld} -m elf32_sparc" - ;; - esac - ;; - *64-bit*) - case $host in - x86_64-*kfreebsd*-gnu) - LD="${LD-ld} -m elf_x86_64_fbsd" - ;; - x86_64-*linux*) - LD="${LD-ld} -m elf_x86_64" - ;; - ppc*-*linux*|powerpc*-*linux*) - LD="${LD-ld} -m elf64ppc" - ;; - s390*-*linux*|s390*-*tpf*) - LD="${LD-ld} -m elf64_s390" - ;; - sparc*-*linux*) - LD="${LD-ld} -m elf64_sparc" - ;; - esac - ;; - esac - fi - rm -rf conftest* - ;; - -*-*-sco3.2v5*) - # On SCO OpenServer 5, we need -belf to get full-featured binaries. - SAVE_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -belf" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 -$as_echo_n "checking whether the C compiler needs -belf... " >&6; } -if ${lt_cv_cc_needs_belf+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus - extern "C" -# endif - int FC_DUMMY_MAIN() { return 1; } -#endif -#endif -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - lt_cv_cc_needs_belf=yes + done + IFS="$lt_save_ifs" else - lt_cv_cc_needs_belf=no + lt_cv_path_LD="$LD" # Let the user override the test with a path. +fi fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu +LD="$lt_cv_path_LD" +if test -n "$LD"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5 +$as_echo "$LD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 -$as_echo "$lt_cv_cc_needs_belf" >&6; } - if test x"$lt_cv_cc_needs_belf" != x"yes"; then - # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf - CFLAGS="$SAVE_CFLAGS" - fi +test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 +$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } +if ${lt_cv_prog_gnu_ld+:} false; then : + $as_echo_n "(cached) " >&6 +else + # I'd rather use --version here, but apparently some GNU lds only accept -v. +case `$LD -v 2>&1 conftest.$ac_ext - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - case `/usr/bin/file conftest.o` in - *64-bit*) - case $lt_cv_prog_gnu_ld in - yes*) - case $host in - i?86-*-solaris*) - LD="${LD-ld} -m elf_x86_64" - ;; - sparc*-*-solaris*) - LD="${LD-ld} -m elf64_sparc" - ;; - esac - # GNU ld 2.21 introduced _sol2 emulations. Use them if available. - if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then - LD="${LD-ld}_sol2" - fi - ;; - *) - if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then - LD="${LD-ld} -64" - fi - ;; - esac - ;; - esac - fi - rm -rf conftest* +*) + lt_cv_prog_gnu_ld=no ;; esac +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_gnu_ld" >&5 +$as_echo "$lt_cv_prog_gnu_ld" >&6; } +with_gnu_ld=$lt_cv_prog_gnu_ld -need_locks="$enable_libtool_lock" -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. -set dummy ${ac_tool_prefix}mt; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_MANIFEST_TOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$MANIFEST_TOOL"; then - ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS -fi -fi -MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL -if test -n "$MANIFEST_TOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 -$as_echo "$MANIFEST_TOOL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi -fi -if test -z "$ac_cv_prog_MANIFEST_TOOL"; then - ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL - # Extract the first word of "mt", so it can be a program name with args. -set dummy mt; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then : + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 +$as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } +if ${lt_cv_path_NM+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$ac_ct_MANIFEST_TOOL"; then - ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 + if test -n "$NM"; then + # Let the user override the test. + lt_cv_path_NM="$NM" +else + lt_nm_to_check="${ac_tool_prefix}nm" + if test -n "$ac_tool_prefix" && test "$build" = "$host"; then + lt_nm_to_check="$lt_nm_to_check nm" fi -done + for lt_tmp_nm in $lt_nm_to_check; do + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + tmp_nm="$ac_dir/$lt_tmp_nm" + if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then + # Check to see if the nm accepts a BSD-compat flag. + # Adding the `sed 1q' prevents false positives on HP-UX, which says: + # nm: unknown option "B" ignored + # Tru64's nm complains that /dev/null is an invalid object file + case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in + */dev/null* | *'Invalid file or object type'*) + lt_cv_path_NM="$tmp_nm -B" + break + ;; + *) + case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + */dev/null*) + lt_cv_path_NM="$tmp_nm -p" + break + ;; + *) + lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but + continue # so that we can try to find one that supports BSD flags + ;; + esac + ;; + esac + fi + done + IFS="$lt_save_ifs" done -IFS=$as_save_IFS - + : ${lt_cv_path_NM=no} fi fi -ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL -if test -n "$ac_ct_MANIFEST_TOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 -$as_echo "$ac_ct_MANIFEST_TOOL" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 +$as_echo "$lt_cv_path_NM" >&6; } +if test "$lt_cv_path_NM" != "no"; then + NM="$lt_cv_path_NM" else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_MANIFEST_TOOL" = x; then - MANIFEST_TOOL=":" + # Didn't find any BSD compatible name lister, look for dumpbin. + if test -n "$DUMPBIN"; then : + # Let the user override the test. else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL - fi -else - MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" -fi - -test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 -$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } -if ${lt_cv_path_mainfest_tool+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_path_mainfest_tool=no - echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 - $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out - cat conftest.err >&5 - if $GREP 'Manifest Tool' conftest.out > /dev/null; then - lt_cv_path_mainfest_tool=yes - fi - rm -f conftest* -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 -$as_echo "$lt_cv_path_mainfest_tool" >&6; } -if test "x$lt_cv_path_mainfest_tool" != xyes; then - MANIFEST_TOOL=: -fi - - - - - - - case $host_os in - rhapsody* | darwin*) if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. -set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 + for ac_prog in dumpbin "link -dump" + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_DSYMUTIL+:} false; then : +if ${ac_cv_prog_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$DSYMUTIL"; then - ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. + if test -n "$DUMPBIN"; then + ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -10394,7 +9977,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" + ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -10404,28 +9987,32 @@ IFS=$as_save_IFS fi fi -DSYMUTIL=$ac_cv_prog_DSYMUTIL -if test -n "$DSYMUTIL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 -$as_echo "$DSYMUTIL" >&6; } +DUMPBIN=$ac_cv_prog_DUMPBIN +if test -n "$DUMPBIN"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 +$as_echo "$DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi + test -n "$DUMPBIN" && break + done fi -if test -z "$ac_cv_prog_DSYMUTIL"; then - ac_ct_DSYMUTIL=$DSYMUTIL - # Extract the first word of "dsymutil", so it can be a program name with args. -set dummy dsymutil; ac_word=$2 +if test -z "$DUMPBIN"; then + ac_ct_DUMPBIN=$DUMPBIN + for ac_prog in dumpbin "link -dump" +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then : +if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$ac_ct_DSYMUTIL"; then - ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. + if test -n "$ac_ct_DUMPBIN"; then + ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -10434,7 +10021,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" + ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -10444,17 +10031,21 @@ IFS=$as_save_IFS fi fi -ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL -if test -n "$ac_ct_DSYMUTIL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 -$as_echo "$ac_ct_DSYMUTIL" >&6; } +ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN +if test -n "$ac_ct_DUMPBIN"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 +$as_echo "$ac_ct_DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - if test "x$ac_ct_DSYMUTIL" = x; then - DSYMUTIL=":" + + test -n "$ac_ct_DUMPBIN" && break +done + + if test "x$ac_ct_DUMPBIN" = x; then + DUMPBIN=":" else case $cross_compiling:$ac_tool_warned in yes:) @@ -10462,390 +10053,259 @@ yes:) $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac - DSYMUTIL=$ac_ct_DSYMUTIL + DUMPBIN=$ac_ct_DUMPBIN fi -else - DSYMUTIL="$ac_cv_prog_DSYMUTIL" fi - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. -set dummy ${ac_tool_prefix}nmedit; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_NMEDIT+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$NMEDIT"; then - ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 + case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in + *COFF*) + DUMPBIN="$DUMPBIN -symbols" + ;; + *) + DUMPBIN=: + ;; + esac fi -done - done -IFS=$as_save_IFS + if test "$DUMPBIN" != ":"; then + NM="$DUMPBIN" + fi fi -fi -NMEDIT=$ac_cv_prog_NMEDIT -if test -n "$NMEDIT"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 -$as_echo "$NMEDIT" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi +test -z "$NM" && NM=nm -fi -if test -z "$ac_cv_prog_NMEDIT"; then - ac_ct_NMEDIT=$NMEDIT - # Extract the first word of "nmedit", so it can be a program name with args. -set dummy nmedit; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_NMEDIT"; then - ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_NMEDIT="nmedit" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS -fi -fi -ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT -if test -n "$ac_ct_NMEDIT"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 -$as_echo "$ac_ct_NMEDIT" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - if test "x$ac_ct_NMEDIT" = x; then - NMEDIT=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - NMEDIT=$ac_ct_NMEDIT - fi -else - NMEDIT="$ac_cv_prog_NMEDIT" -fi - - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. -set dummy ${ac_tool_prefix}lipo; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_LIPO+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$LIPO"; then - ac_cv_prog_LIPO="$LIPO" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_LIPO="${ac_tool_prefix}lipo" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -LIPO=$ac_cv_prog_LIPO -if test -n "$LIPO"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 -$as_echo "$LIPO" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi -fi -if test -z "$ac_cv_prog_LIPO"; then - ac_ct_LIPO=$LIPO - # Extract the first word of "lipo", so it can be a program name with args. -set dummy lipo; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_LIPO+:} false; then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 +$as_echo_n "checking the name lister ($NM) interface... " >&6; } +if ${lt_cv_nm_interface+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$ac_ct_LIPO"; then - ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_LIPO="lipo" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 + lt_cv_nm_interface="BSD nm" + echo "int some_variable = 0;" > conftest.$ac_ext + (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) + (eval "$ac_compile" 2>conftest.err) + cat conftest.err >&5 + (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) + (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) + cat conftest.err >&5 + (eval echo "\"\$as_me:$LINENO: output\"" >&5) + cat conftest.out >&5 + if $GREP 'External.*some_variable' conftest.out > /dev/null; then + lt_cv_nm_interface="MS dumpbin" fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO -if test -n "$ac_ct_LIPO"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 -$as_echo "$ac_ct_LIPO" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + rm -f conftest* fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 +$as_echo "$lt_cv_nm_interface" >&6; } - if test "x$ac_ct_LIPO" = x; then - LIPO=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - LIPO=$ac_ct_LIPO - fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 +$as_echo_n "checking whether ln -s works... " >&6; } +LN_S=$as_ln_s +if test "$LN_S" = "ln -s"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } else - LIPO="$ac_cv_prog_LIPO" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 +$as_echo "no, using $LN_S" >&6; } fi - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. -set dummy ${ac_tool_prefix}otool; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_OTOOL+:} false; then : +# find the maximum length of command line arguments +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 +$as_echo_n "checking the maximum length of command line arguments... " >&6; } +if ${lt_cv_sys_max_cmd_len+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$OTOOL"; then - ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_OTOOL="${ac_tool_prefix}otool" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS + i=0 + teststring="ABCD" -fi -fi -OTOOL=$ac_cv_prog_OTOOL -if test -n "$OTOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 -$as_echo "$OTOOL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi + case $build_os in + msdosdjgpp*) + # On DJGPP, this test can blow up pretty badly due to problems in libc + # (any single argument exceeding 2000 bytes causes a buffer overrun + # during glob expansion). Even if it were fixed, the result of this + # check would be larger than it should be. + lt_cv_sys_max_cmd_len=12288; # 12K is about right + ;; + gnu*) + # Under GNU Hurd, this test is not required because there is + # no limit to the length of command line arguments. + # Libtool will interpret -1 as no limit whatsoever + lt_cv_sys_max_cmd_len=-1; + ;; -fi -if test -z "$ac_cv_prog_OTOOL"; then - ac_ct_OTOOL=$OTOOL - # Extract the first word of "otool", so it can be a program name with args. -set dummy otool; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_OTOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_OTOOL"; then - ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_OTOOL="otool" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS + cygwin* | mingw* | cegcc*) + # On Win9x/ME, this test blows up -- it succeeds, but takes + # about 5 minutes as the teststring grows exponentially. + # Worse, since 9x/ME are not pre-emptively multitasking, + # you end up with a "frozen" computer, even though with patience + # the test eventually succeeds (with a max line length of 256k). + # Instead, let's just punt: use the minimum linelength reported by + # all of the supported platforms: 8192 (on NT/2K/XP). + lt_cv_sys_max_cmd_len=8192; + ;; -fi -fi -ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL -if test -n "$ac_ct_OTOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 -$as_echo "$ac_ct_OTOOL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi + mint*) + # On MiNT this can take a long time and run out of memory. + lt_cv_sys_max_cmd_len=8192; + ;; - if test "x$ac_ct_OTOOL" = x; then - OTOOL=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - OTOOL=$ac_ct_OTOOL - fi -else - OTOOL="$ac_cv_prog_OTOOL" -fi + amigaos*) + # On AmigaOS with pdksh, this test takes hours, literally. + # So we just punt and use a minimum line length of 8192. + lt_cv_sys_max_cmd_len=8192; + ;; - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. -set dummy ${ac_tool_prefix}otool64; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_OTOOL64+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$OTOOL64"; then - ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS + netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) + # This has been around since 386BSD, at least. Likely further. + if test -x /sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` + elif test -x /usr/sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` + else + lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs + fi + # And add a safety zone + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + ;; -fi -fi -OTOOL64=$ac_cv_prog_OTOOL64 -if test -n "$OTOOL64"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 -$as_echo "$OTOOL64" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi + interix*) + # We know the value 262144 and hardcode it with a safety zone (like BSD) + lt_cv_sys_max_cmd_len=196608 + ;; + os2*) + # The test takes a long time on OS/2. + lt_cv_sys_max_cmd_len=8192 + ;; -fi -if test -z "$ac_cv_prog_OTOOL64"; then - ac_ct_OTOOL64=$OTOOL64 - # Extract the first word of "otool64", so it can be a program name with args. -set dummy otool64; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_OTOOL64"; then - ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_OTOOL64="otool64" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS + osf*) + # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure + # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not + # nice to cause kernel panics so lets avoid the loop below. + # First set a reasonable default. + lt_cv_sys_max_cmd_len=16384 + # + if test -x /sbin/sysconfig; then + case `/sbin/sysconfig -q proc exec_disable_arg_limit` in + *1*) lt_cv_sys_max_cmd_len=-1 ;; + esac + fi + ;; + sco3.2v5*) + lt_cv_sys_max_cmd_len=102400 + ;; + sysv5* | sco5v6* | sysv4.2uw2*) + kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` + if test -n "$kargmax"; then + lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` + else + lt_cv_sys_max_cmd_len=32768 + fi + ;; + *) + lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` + if test -n "$lt_cv_sys_max_cmd_len"; then + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + else + # Make teststring a little bigger before we do anything with it. + # a 1K string should be a reasonable start. + for i in 1 2 3 4 5 6 7 8 ; do + teststring=$teststring$teststring + done + SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} + # If test is not a shell built-in, we'll probably end up computing a + # maximum length that is only half of the actual maximum length, but + # we can't tell. + while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ + = "X$teststring$teststring"; } >/dev/null 2>&1 && + test $i != 17 # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring + done + # Only check the string length outside the loop. + lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` + teststring= + # Add a significant safety factor because C++ compilers can tack on + # massive amounts of additional arguments before passing them to the + # linker. It appears as though 1/2 is a usable value. + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` + fi + ;; + esac fi -fi -ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 -if test -n "$ac_ct_OTOOL64"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 -$as_echo "$ac_ct_OTOOL64" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - if test "x$ac_ct_OTOOL64" = x; then - OTOOL64=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - OTOOL64=$ac_ct_OTOOL64 - fi +if test -n $lt_cv_sys_max_cmd_len ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 +$as_echo "$lt_cv_sys_max_cmd_len" >&6; } else - OTOOL64="$ac_cv_prog_OTOOL64" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 +$as_echo "none" >&6; } fi +max_cmd_len=$lt_cv_sys_max_cmd_len + + +: ${CP="cp -f"} +: ${MV="mv -f"} +: ${RM="rm -f"} + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5 +$as_echo_n "checking whether the shell understands some XSI constructs... " >&6; } +# Try some XSI features +xsi_shell=no +( _lt_dummy="a/b/c" + test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ + = c,a/b,b/c, \ + && eval 'test $(( 1 + 1 )) -eq 2 \ + && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ + && xsi_shell=yes +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5 +$as_echo "$xsi_shell" >&6; } + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5 +$as_echo_n "checking whether the shell understands \"+=\"... " >&6; } +lt_shell_append=no +( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \ + >/dev/null 2>&1 \ + && lt_shell_append=yes +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5 +$as_echo "$lt_shell_append" >&6; } +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + lt_unset=unset +else + lt_unset=false +fi +# test EBCDIC or ASCII +case `echo X|tr X '\101'` in + A) # ASCII based system + # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr + lt_SP2NL='tr \040 \012' + lt_NL2SP='tr \015\012 \040\040' + ;; + *) # EBCDIC based system + lt_SP2NL='tr \100 \n' + lt_NL2SP='tr \r\n \100\100' + ;; +esac @@ -10855,523 +10315,445 @@ fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 +$as_echo_n "checking how to convert $build file names to $host format... " >&6; } +if ${lt_cv_to_host_file_cmd+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 + ;; + esac + ;; + *-*-cygwin* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin + ;; + esac + ;; + * ) # unhandled hosts (and "normal" native builds) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; +esac +fi +to_host_file_cmd=$lt_cv_to_host_file_cmd +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 +$as_echo "$lt_cv_to_host_file_cmd" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 -$as_echo_n "checking for -single_module linker flag... " >&6; } -if ${lt_cv_apple_cc_single_mod+:} false; then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 +$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } +if ${lt_cv_to_tool_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else - lt_cv_apple_cc_single_mod=no - if test -z "${LT_MULTI_MODULE}"; then - # By default we will add the -single_module flag. You can override - # by either setting the environment variable LT_MULTI_MODULE - # non-empty at configure time, or by adding -multi_module to the - # link flags. - rm -rf libconftest.dylib* - echo "int foo(void){return 1;}" > conftest.c - echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ --dynamiclib -Wl,-single_module conftest.c" >&5 - $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ - -dynamiclib -Wl,-single_module conftest.c 2>conftest.err - _lt_result=$? - # If there is a non-empty error log, and "single_module" - # appears in it, assume the flag caused a linker warning - if test -s conftest.err && $GREP single_module conftest.err; then - cat conftest.err >&5 - # Otherwise, if the output was created with a 0 exit code from - # the compiler, it worked. - elif test -f libconftest.dylib && test $_lt_result -eq 0; then - lt_cv_apple_cc_single_mod=yes - else - cat conftest.err >&5 - fi - rm -rf libconftest.dylib* - rm -f conftest.* - fi + #assume ordinary cross tools, or native build. +lt_cv_to_tool_file_cmd=func_convert_file_noop +case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 + ;; + esac + ;; +esac + fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 -$as_echo "$lt_cv_apple_cc_single_mod" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 -$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } -if ${lt_cv_ld_exported_symbols_list+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_ld_exported_symbols_list=no - save_LDFLAGS=$LDFLAGS - echo "_main" > conftest.sym - LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ +to_tool_file_cmd=$lt_cv_to_tool_file_cmd +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 +$as_echo "$lt_cv_to_tool_file_cmd" >&6; } -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus - extern "C" -# endif - int FC_DUMMY_MAIN() { return 1; } -#endif -#endif -int -main () -{ - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - lt_cv_ld_exported_symbols_list=yes -else - lt_cv_ld_exported_symbols_list=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - LDFLAGS="$save_LDFLAGS" -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 -$as_echo "$lt_cv_ld_exported_symbols_list" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 -$as_echo_n "checking for -force_load linker flag... " >&6; } -if ${lt_cv_ld_force_load+:} false; then : + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 +$as_echo_n "checking for $LD option to reload object files... " >&6; } +if ${lt_cv_ld_reload_flag+:} false; then : $as_echo_n "(cached) " >&6 else - lt_cv_ld_force_load=no - cat > conftest.c << _LT_EOF -int forced_loaded() { return 2;} -_LT_EOF - echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 - $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 - echo "$AR cru libconftest.a conftest.o" >&5 - $AR cru libconftest.a conftest.o 2>&5 - echo "$RANLIB libconftest.a" >&5 - $RANLIB libconftest.a 2>&5 - cat > conftest.c << _LT_EOF -int main() { return 0;} -_LT_EOF - echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 - $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err - _lt_result=$? - if test -s conftest.err && $GREP force_load conftest.err; then - cat conftest.err >&5 - elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then - lt_cv_ld_force_load=yes - else - cat conftest.err >&5 - fi - rm -f conftest.err libconftest.a conftest conftest.c - rm -rf conftest.dSYM - + lt_cv_ld_reload_flag='-r' fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 -$as_echo "$lt_cv_ld_force_load" >&6; } - case $host_os in - rhapsody* | darwin1.[012]) - _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; - darwin1.*) - _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; - darwin*) # darwin 5.x on - # if running on 10.5 or later, the deployment target defaults - # to the OS version, if on x86, and 10.4, the deployment - # target defaults to 10.4. Don't you love it? - case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in - 10.0,*86*-darwin8*|10.0,*-darwin[91]*) - _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; - 10.[012]*) - _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; - 10.*) - _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; - esac - ;; - esac - if test "$lt_cv_apple_cc_single_mod" = "yes"; then - _lt_dar_single_mod='$single_module' - fi - if test "$lt_cv_ld_exported_symbols_list" = "yes"; then - _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' - else - _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 +$as_echo "$lt_cv_ld_reload_flag" >&6; } +reload_flag=$lt_cv_ld_reload_flag +case $reload_flag in +"" | " "*) ;; +*) reload_flag=" $reload_flag" ;; +esac +reload_cmds='$LD$reload_flag -o $output$reload_objs' +case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + if test "$GCC" != yes; then + reload_cmds=false fi - if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then - _lt_dsymutil='~$DSYMUTIL $lib || :' + ;; + darwin*) + if test "$GCC" = yes; then + reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' else - _lt_dsymutil= + reload_cmds='$LD$reload_flag -o $output$reload_objs' fi ;; - esac +esac -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 -$as_echo_n "checking how to run the C preprocessor... " >&6; } -# On Suns, sometimes $CPP names a directory. -if test -n "$CPP" && test -d "$CPP"; then - CPP= -fi -if test -z "$CPP"; then - if ${ac_cv_prog_CPP+:} false; then : + + + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. +set dummy ${ac_tool_prefix}objdump; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else - # Double quotes because CPP needs to be expanded - for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" - do - ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes + if test -n "$OBJDUMP"; then + ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS -else - # Broken: fails on valid input. -continue fi -rm -f conftest.err conftest.i conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue -else - # Passes both tests. -ac_preproc_ok=: -break fi -rm -f conftest.err conftest.i conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : - break +OBJDUMP=$ac_cv_prog_OBJDUMP +if test -n "$OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 +$as_echo "$OBJDUMP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi - done - ac_cv_prog_CPP=$CPP fi - CPP=$ac_cv_prog_CPP -else - ac_cv_prog_CPP=$CPP -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 -$as_echo "$CPP" >&6; } -ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes +if test -z "$ac_cv_prog_OBJDUMP"; then + ac_ct_OBJDUMP=$OBJDUMP + # Extract the first word of "objdump", so it can be a program name with args. +set dummy objdump; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OBJDUMP"; then + ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_OBJDUMP="objdump" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS -else - # Broken: fails on valid input. -continue fi -rm -f conftest.err conftest.i conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue +fi +ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP +if test -n "$ac_ct_OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 +$as_echo "$ac_ct_OBJDUMP" >&6; } else - # Passes both tests. -ac_preproc_ok=: -break + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -rm -f conftest.err conftest.i conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : + if test "x$ac_ct_OBJDUMP" = x; then + OBJDUMP="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OBJDUMP=$ac_ct_OBJDUMP + fi else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details" "$LINENO" 5; } + OBJDUMP="$ac_cv_prog_OBJDUMP" fi -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 -$as_echo_n "checking for ANSI C header files... " >&6; } -if ${ac_cv_header_stdc+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#include -#include +test -z "$OBJDUMP" && OBJDUMP=objdump -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus - extern "C" -# endif - int FC_DUMMY_MAIN() { return 1; } -#endif -#endif -int -main () -{ - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_header_stdc=yes -else - ac_cv_header_stdc=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then : -else - ac_cv_header_stdc=no -fi -rm -f conftest* -fi -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 +$as_echo_n "checking how to recognize dependent libraries... " >&6; } +if ${lt_cv_deplibs_check_method+:} false; then : + $as_echo_n "(cached) " >&6 else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi + lt_cv_file_magic_cmd='$MAGIC_CMD' +lt_cv_file_magic_test_file= +lt_cv_deplibs_check_method='unknown' +# Need to set the preceding variable on all platforms that support +# interlibrary dependencies. +# 'none' -- dependencies not supported. +# `unknown' -- same as none, but documents that we really don't know. +# 'pass_all' -- all dependencies passed with no checks. +# 'test_compile' -- check by making test program. +# 'file_magic [[regex]]' -- check by looking for files in library path +# which responds to the $file_magic_cmd with a given extended regex. +# If you have `file' or equivalent on your system and you're not sure +# whether `pass_all' will *always* work, you probably want this one. -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then : - : -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#if ((' ' & 0x0FF) == 0x020) -# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#else -# define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) -# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) -#endif +case $host_os in +aix[4-9]*) + lt_cv_deplibs_check_method=pass_all + ;; -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int -main () -{ - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - return 2; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : +beos*) + lt_cv_deplibs_check_method=pass_all + ;; -else - ac_cv_header_stdc=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi +bsdi[45]*) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' + lt_cv_file_magic_cmd='/usr/bin/file -L' + lt_cv_file_magic_test_file=/shlib/libc.so + ;; -fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 -$as_echo "$ac_cv_header_stdc" >&6; } -if test $ac_cv_header_stdc = yes; then +cygwin*) + # func_win32_libid is a shell function defined in ltmain.sh + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + ;; -$as_echo "#define STDC_HEADERS 1" >>confdefs.h +mingw* | pw32*) + # Base MSYS/MinGW do not provide the 'file' command needed by + # func_win32_libid shell function, so use a weaker test based on 'objdump', + # unless we find 'file', for example because we are cross-compiling. + # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin. + if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + else + # Keep this pattern in sync with the one in func_win32_libid. + lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' + lt_cv_file_magic_cmd='$OBJDUMP -f' + fi + ;; -fi +cegcc*) + # use the weaker test based on 'objdump'. See mingw*. + lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + ;; -# On IRIX 5.3, sys/types and inttypes.h are conflicting. -for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ - inttypes.h stdint.h unistd.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default -" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - -for ac_header in dlfcn.h -do : - ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default -" -if test "x$ac_cv_header_dlfcn_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_DLFCN_H 1 -_ACEOF - -fi +darwin* | rhapsody*) + lt_cv_deplibs_check_method=pass_all + ;; -done +freebsd* | dragonfly*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + case $host_cpu in + i*86 ) + # Not sure whether the presence of OpenBSD here was a mistake. + # Let's accept both of them until this is cleared up. + lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + ;; + esac + else + lt_cv_deplibs_check_method=pass_all + fi + ;; +gnu*) + lt_cv_deplibs_check_method=pass_all + ;; +haiku*) + lt_cv_deplibs_check_method=pass_all + ;; -func_stripname_cnf () -{ - case ${2} in - .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; - *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; +hpux10.20* | hpux11*) + lt_cv_file_magic_cmd=/usr/bin/file + case $host_cpu in + ia64*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' + lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so + ;; + hppa*64*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]' + lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl + ;; + *) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library' + lt_cv_file_magic_test_file=/usr/lib/libc.sl + ;; esac -} # func_stripname_cnf - + ;; +interix[3-9]*) + # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' + ;; +irix5* | irix6* | nonstopux*) + case $LD in + *-32|*"-32 ") libmagic=32-bit;; + *-n32|*"-n32 ") libmagic=N32;; + *-64|*"-64 ") libmagic=64-bit;; + *) libmagic=never-match;; + esac + lt_cv_deplibs_check_method=pass_all + ;; +# This must be glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu) + lt_cv_deplibs_check_method=pass_all + ;; -# Set options -enable_dlopen=yes +netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' + fi + ;; +newos6*) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=/usr/lib/libnls.so + ;; +*nto* | *qnx*) + lt_cv_deplibs_check_method=pass_all + ;; +openbsd*) + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' + fi + ;; - enable_win32_dll=no +osf3* | osf4* | osf5*) + lt_cv_deplibs_check_method=pass_all + ;; +rdos*) + lt_cv_deplibs_check_method=pass_all + ;; - # Check whether --enable-shared was given. -if test "${enable_shared+set}" = set; then : - enableval=$enable_shared; p=${PACKAGE-default} - case $enableval in - yes) enable_shared=yes ;; - no) enable_shared=no ;; - *) - enable_shared=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for pkg in $enableval; do - IFS="$lt_save_ifs" - if test "X$pkg" = "X$p"; then - enable_shared=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac -else - enable_shared=yes -fi +solaris*) + lt_cv_deplibs_check_method=pass_all + ;; +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; +sysv4 | sysv4.3*) + case $host_vendor in + motorola) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + ;; + ncr) + lt_cv_deplibs_check_method=pass_all + ;; + sequent) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' + ;; + sni) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" + lt_cv_file_magic_test_file=/lib/libc.so + ;; + siemens) + lt_cv_deplibs_check_method=pass_all + ;; + pc) + lt_cv_deplibs_check_method=pass_all + ;; + esac + ;; +tpf*) + lt_cv_deplibs_check_method=pass_all + ;; +esac +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 +$as_echo "$lt_cv_deplibs_check_method" >&6; } +file_magic_glob= +want_nocaseglob=no +if test "$build" = "$host"; then + case $host_os in + mingw* | pw32*) + if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then + want_nocaseglob=yes + else + file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` + fi + ;; + esac +fi +file_magic_cmd=$lt_cv_file_magic_cmd +deplibs_check_method=$lt_cv_deplibs_check_method +test -z "$deplibs_check_method" && deplibs_check_method=unknown - # Check whether --enable-static was given. -if test "${enable_static+set}" = set; then : - enableval=$enable_static; p=${PACKAGE-default} - case $enableval in - yes) enable_static=yes ;; - no) enable_static=no ;; - *) - enable_static=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for pkg in $enableval; do - IFS="$lt_save_ifs" - if test "X$pkg" = "X$p"; then - enable_static=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac -else - enable_static=yes -fi @@ -11382,30 +10764,8 @@ fi -# Check whether --with-pic was given. -if test "${with_pic+set}" = set; then : - withval=$with_pic; lt_p=${PACKAGE-default} - case $withval in - yes|no) pic_mode=$withval ;; - *) - pic_mode=default - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for lt_pkg in $withval; do - IFS="$lt_save_ifs" - if test "X$lt_pkg" = "X$lt_p"; then - pic_mode=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac -else - pic_mode=default -fi -test -z "$pic_mode" && pic_mode=default @@ -11413,51 +10773,99 @@ test -z "$pic_mode" && pic_mode=default - # Check whether --enable-fast-install was given. -if test "${enable_fast_install+set}" = set; then : - enableval=$enable_fast_install; p=${PACKAGE-default} - case $enableval in - yes) enable_fast_install=yes ;; - no) enable_fast_install=no ;; - *) - enable_fast_install=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for pkg in $enableval; do - IFS="$lt_save_ifs" - if test "X$pkg" = "X$p"; then - enable_fast_install=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. +set dummy ${ac_tool_prefix}dlltool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_DLLTOOL+:} false; then : + $as_echo_n "(cached) " >&6 else - enable_fast_install=yes -fi - - - - - - - - - - - -# This can be used to rebuild libtool when needed -LIBTOOL_DEPS="$ltmain" - -# Always use our own libtool. -LIBTOOL='$(SHELL) $(top_builddir)/libtool' - + if test -n "$DLLTOOL"; then + ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS +fi +fi +DLLTOOL=$ac_cv_prog_DLLTOOL +if test -n "$DLLTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 +$as_echo "$DLLTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +fi +if test -z "$ac_cv_prog_DLLTOOL"; then + ac_ct_DLLTOOL=$DLLTOOL + # Extract the first word of "dlltool", so it can be a program name with args. +set dummy dlltool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DLLTOOL"; then + ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_DLLTOOL="dlltool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS +fi +fi +ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL +if test -n "$ac_ct_DLLTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 +$as_echo "$ac_ct_DLLTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + if test "x$ac_ct_DLLTOOL" = x; then + DLLTOOL="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DLLTOOL=$ac_ct_DLLTOOL + fi +else + DLLTOOL="$ac_cv_prog_DLLTOOL" +fi +test -z "$DLLTOOL" && DLLTOOL=dlltool @@ -11468,8 +10876,37 @@ LIBTOOL='$(SHELL) $(top_builddir)/libtool' +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 +$as_echo_n "checking how to associate runtime and link libraries... " >&6; } +if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_sharedlib_from_linklib_cmd='unknown' +case $host_os in +cygwin* | mingw* | pw32* | cegcc*) + # two different shell functions defined in ltmain.sh + # decide which to use based on capabilities of $DLLTOOL + case `$DLLTOOL --help 2>&1` in + *--identify-strict*) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib + ;; + *) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback + ;; + esac + ;; +*) + # fallback: assume linklib IS sharedlib + lt_cv_sharedlib_from_linklib_cmd="$ECHO" + ;; +esac +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 +$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } +sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd +test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO @@ -11477,15 +10914,108 @@ LIBTOOL='$(SHELL) $(top_builddir)/libtool' +if test -n "$ac_tool_prefix"; then + for ac_prog in ar + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AR+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AR="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS +fi +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +$as_echo "$AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + test -n "$AR" && break + done +fi +if test -z "$AR"; then + ac_ct_AR=$AR + for ac_prog in ar +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_AR+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_AR"; then + ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_AR="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS -test -z "$LN_S" && LN_S="ln -s" +fi +fi +ac_ct_AR=$ac_cv_prog_ac_ct_AR +if test -n "$ac_ct_AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 +$as_echo "$ac_ct_AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + test -n "$ac_ct_AR" && break +done + if test "x$ac_ct_AR" = x; then + AR="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + AR=$ac_ct_AR + fi +fi +: ${AR=ar} +: ${AR_FLAGS=cru} @@ -11496,768 +11026,590 @@ test -z "$LN_S" && LN_S="ln -s" -if test -n "${ZSH_VERSION+set}" ; then - setopt NO_GLOB_SUBST -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 -$as_echo_n "checking for objdir... " >&6; } -if ${lt_cv_objdir+:} false; then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 +$as_echo_n "checking for archiver @FILE support... " >&6; } +if ${lt_cv_ar_at_file+:} false; then : $as_echo_n "(cached) " >&6 else - rm -f .libs 2>/dev/null -mkdir .libs 2>/dev/null -if test -d .libs; then - lt_cv_objdir=.libs -else - # MS-DOS does not allow filenames that begin with a dot. - lt_cv_objdir=_libs -fi -rmdir .libs 2>/dev/null -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 -$as_echo "$lt_cv_objdir" >&6; } -objdir=$lt_cv_objdir - - - + lt_cv_ar_at_file=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef FC_DUMMY_MAIN +#ifndef FC_DUMMY_MAIN_EQ_F77 +# ifdef __cplusplus + extern "C" +# endif + int FC_DUMMY_MAIN() { return 1; } +#endif +#endif +int +main () +{ -cat >>confdefs.h <<_ACEOF -#define LT_OBJDIR "$lt_cv_objdir/" + ; + return 0; +} _ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + echo conftest.$ac_objext > conftest.lst + lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 + (eval $lt_ar_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if test "$ac_status" -eq 0; then + # Ensure the archiver fails upon bogus file names. + rm -f conftest.$ac_objext libconftest.a + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 + (eval $lt_ar_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if test "$ac_status" -ne 0; then + lt_cv_ar_at_file=@ + fi + fi + rm -f conftest.* libconftest.a +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 +$as_echo "$lt_cv_ar_at_file" >&6; } +if test "x$lt_cv_ar_at_file" = xno; then + archiver_list_spec= +else + archiver_list_spec=$lt_cv_ar_at_file +fi -case $host_os in -aix3*) - # AIX sometimes has problems with the GCC collect2 program. For some - # reason, if we set the COLLECT_NAMES environment variable, the problems - # vanish in a puff of smoke. - if test "X${COLLECT_NAMES+set}" != Xset; then - COLLECT_NAMES= - export COLLECT_NAMES - fi - ;; -esac -# Global variables: -ofile=libtool -can_build_shared=yes -# All known linkers require a `.a' archive for static linking (except MSVC, -# which needs '.lib'). -libext=a -with_gnu_ld="$lt_cv_prog_gnu_ld" -old_CC="$CC" -old_CFLAGS="$CFLAGS" -# Set sane defaults for various variables -test -z "$CC" && CC=cc -test -z "$LTCC" && LTCC=$CC -test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS -test -z "$LD" && LD=ld -test -z "$ac_objext" && ac_objext=o -for cc_temp in $compiler""; do - case $cc_temp in - compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; - distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; - \-*) ;; - *) break;; - esac +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi done -cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` - + done +IFS=$as_save_IFS -# Only perform the check for file, if the check method requires it -test -z "$MAGIC_CMD" && MAGIC_CMD=file -case $deplibs_check_method in -file_magic*) - if test "$file_magic_cmd" = '$MAGIC_CMD'; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 -$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } -if ${lt_cv_path_MAGIC_CMD+:} false; then : - $as_echo_n "(cached) " >&6 +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } else - case $MAGIC_CMD in -[\\/*] | ?:[\\/]*) - lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. - ;; -*) - lt_save_MAGIC_CMD="$MAGIC_CMD" - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" - for ac_dir in $ac_dummy; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/${ac_tool_prefix}file; then - lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" - if test -n "$file_magic_test_file"; then - case $deplibs_check_method in - "file_magic "*) - file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` - MAGIC_CMD="$lt_cv_path_MAGIC_CMD" - if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | - $EGREP "$file_magic_regex" > /dev/null; then - : - else - cat <<_LT_EOF 1>&2 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi -*** Warning: the command libtool uses to detect shared libraries, -*** $file_magic_cmd, produces output that libtool cannot recognize. -*** The result is that libtool may fail to recognize shared libraries -*** as such. This will affect the creation of libtool libraries that -*** depend on shared libraries, but programs linked with such libtool -*** libraries will work regardless of this problem. Nevertheless, you -*** may want to report the problem to your system manager and/or to -*** bug-libtool@gnu.org -_LT_EOF - fi ;; - esac - fi - break - fi - done - IFS="$lt_save_ifs" - MAGIC_CMD="$lt_save_MAGIC_CMD" - ;; -esac fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_STRIP="strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS -MAGIC_CMD="$lt_cv_path_MAGIC_CMD" -if test -n "$MAGIC_CMD"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 -$as_echo "$MAGIC_CMD" >&6; } +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +test -z "$STRIP" && STRIP=: -if test -z "$lt_cv_path_MAGIC_CMD"; then - if test -n "$ac_tool_prefix"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 -$as_echo_n "checking for file... " >&6; } -if ${lt_cv_path_MAGIC_CMD+:} false; then : + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else - case $MAGIC_CMD in -[\\/*] | ?:[\\/]*) - lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. - ;; -*) - lt_save_MAGIC_CMD="$MAGIC_CMD" - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" - for ac_dir in $ac_dummy; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/file; then - lt_cv_path_MAGIC_CMD="$ac_dir/file" - if test -n "$file_magic_test_file"; then - case $deplibs_check_method in - "file_magic "*) - file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` - MAGIC_CMD="$lt_cv_path_MAGIC_CMD" - if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | - $EGREP "$file_magic_regex" > /dev/null; then - : - else - cat <<_LT_EOF 1>&2 + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 +$as_echo "$RANLIB" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi -*** Warning: the command libtool uses to detect shared libraries, -*** $file_magic_cmd, produces output that libtool cannot recognize. -*** The result is that libtool may fail to recognize shared libraries -*** as such. This will affect the creation of libtool libraries that -*** depend on shared libraries, but programs linked with such libtool -*** libraries will work regardless of this problem. Nevertheless, you -*** may want to report the problem to your system manager and/or to -*** bug-libtool@gnu.org -_LT_EOF - fi ;; - esac - fi - break - fi - done - IFS="$lt_save_ifs" - MAGIC_CMD="$lt_save_MAGIC_CMD" - ;; -esac fi +if test -z "$ac_cv_prog_RANLIB"; then + ac_ct_RANLIB=$RANLIB + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS -MAGIC_CMD="$lt_cv_path_MAGIC_CMD" -if test -n "$MAGIC_CMD"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 -$as_echo "$MAGIC_CMD" >&6; } +fi +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 +$as_echo "$ac_ct_RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - + if test "x$ac_ct_RANLIB" = x; then + RANLIB=":" else - MAGIC_CMD=: + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + RANLIB=$ac_ct_RANLIB fi +else + RANLIB="$ac_cv_prog_RANLIB" fi - fi - ;; -esac +test -z "$RANLIB" && RANLIB=: -# Use C for the default configuration in the libtool script -lt_save_CC="$CC" -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -# Source file extension for C test sources. -ac_ext=c -# Object file extension for compiled C test sources. -objext=o -objext=$objext -# Code to be used in simple compile tests -lt_simple_compile_test_code="int some_variable = 0;" +# Determine commands to create old-style static archives. +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' +old_postinstall_cmds='chmod 644 $oldlib' +old_postuninstall_cmds= -# Code to be used in simple link tests -lt_simple_link_test_code='int main(){return(0);}' +if test -n "$RANLIB"; then + case $host_os in + openbsd*) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" + ;; + *) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" +fi +case $host_os in + darwin*) + lock_old_archive_extraction=yes ;; + *) + lock_old_archive_extraction=no ;; +esac -# If no C compiler was specified, use CC. -LTCC=${LTCC-"$CC"} -# If no C compiler flags were specified, use CFLAGS. -LTCFLAGS=${LTCFLAGS-"$CFLAGS"} -# Allow CC to be a program name with arguments. -compiler=$CC -# Save the default compiler, since it gets overwritten when the other -# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. -compiler_DEFAULT=$CC -# save warnings/boilerplate of simple test code -ac_outfile=conftest.$ac_objext -echo "$lt_simple_compile_test_code" >conftest.$ac_ext -eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err -_lt_compiler_boilerplate=`cat conftest.err` -$RM conftest* -ac_outfile=conftest.$ac_objext -echo "$lt_simple_link_test_code" >conftest.$ac_ext -eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err -_lt_linker_boilerplate=`cat conftest.err` -$RM -r conftest* -if test -n "$compiler"; then -lt_prog_compiler_no_builtin_flag= -if test "$GCC" = yes; then - case $cc_basename in - nvcc*) - lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; - *) - lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; - esac - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 -$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } -if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_prog_compiler_rtti_exceptions=no - ac_outfile=conftest.$ac_objext - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="-fno-rtti -fno-exceptions" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - # The option is referenced via a variable to avoid confusing sed. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s "$ac_outfile"; then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings other than the usual output. - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then - lt_cv_prog_compiler_rtti_exceptions=yes - fi - fi - $RM conftest* -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 -$as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } -if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then - lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" -else - : -fi -fi - lt_prog_compiler_wl= -lt_prog_compiler_pic= -lt_prog_compiler_static= - if test "$GCC" = yes; then - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_static='-static' - case $host_os in - aix*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - lt_prog_compiler_static='-Bstatic' - fi - ;; - amigaos*) - case $host_cpu in - powerpc) - # see comment about AmigaOS4 .so support - lt_prog_compiler_pic='-fPIC' - ;; - m68k) - # FIXME: we need at least 68020 code to build shared libraries, but - # adding the `-m68020' flag to GCC prevents building anything better, - # like `-m68040'. - lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' - ;; - esac - ;; - beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; - mingw* | cygwin* | pw32* | os2* | cegcc*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - # Although the cygwin gcc ignores -fPIC, still need this for old-style - # (--disable-auto-import) libraries - lt_prog_compiler_pic='-DDLL_EXPORT' - ;; - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - lt_prog_compiler_pic='-fno-common' - ;; - haiku*) - # PIC is the default for Haiku. - # The "-static" flag exists, but is broken. - lt_prog_compiler_static= - ;; - hpux*) - # PIC is the default for 64-bit PA HP-UX, but not for 32-bit - # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag - # sets the default TLS model and affects inlining. - case $host_cpu in - hppa*64*) - # +Z the default - ;; - *) - lt_prog_compiler_pic='-fPIC' - ;; - esac - ;; - interix[3-9]*) - # Interix 3.x gcc -fpic/-fPIC options generate broken code. - # Instead, we relocate shared libraries at runtime. - ;; - msdosdjgpp*) - # Just because we use GCC doesn't mean we suddenly get shared libraries - # on systems that don't support them. - lt_prog_compiler_can_build_shared=no - enable_shared=no - ;; - *nto* | *qnx*) - # QNX uses GNU C++, but need to define -shared option too, otherwise - # it will coredump. - lt_prog_compiler_pic='-fPIC -shared' - ;; - sysv4*MP*) - if test -d /usr/nec; then - lt_prog_compiler_pic=-Kconform_pic - fi - ;; - *) - lt_prog_compiler_pic='-fPIC' - ;; - esac +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} - case $cc_basename in - nvcc*) # Cuda Compiler Driver 2.2 - lt_prog_compiler_wl='-Xlinker ' - if test -n "$lt_prog_compiler_pic"; then - lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" - fi - ;; - esac - else - # PORTME Check for flag to pass linker flags through the system compiler. - case $host_os in - aix*) - lt_prog_compiler_wl='-Wl,' - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - lt_prog_compiler_static='-Bstatic' - else - lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' - fi - ;; +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} - mingw* | cygwin* | pw32* | os2* | cegcc*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - lt_prog_compiler_pic='-DDLL_EXPORT' - ;; +# Allow CC to be a program name with arguments. +compiler=$CC - hpux9* | hpux10* | hpux11*) - lt_prog_compiler_wl='-Wl,' - # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but - # not for PA HP-UX. - case $host_cpu in - hppa*64*|ia64*) - # +Z the default - ;; - *) - lt_prog_compiler_pic='+Z' - ;; - esac - # Is there a better lt_prog_compiler_static that works with the bundled CC? - lt_prog_compiler_static='${wl}-a ${wl}archive' - ;; - irix5* | irix6* | nonstopux*) - lt_prog_compiler_wl='-Wl,' - # PIC (with -KPIC) is the default. - lt_prog_compiler_static='-non_shared' - ;; +# Check for command to grab the raw symbol name followed by C symbol from nm. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 +$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } +if ${lt_cv_sys_global_symbol_pipe+:} false; then : + $as_echo_n "(cached) " >&6 +else - linux* | k*bsd*-gnu | kopensolaris*-gnu) - case $cc_basename in - # old Intel for x86_64 which still supported -KPIC. - ecc*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-static' - ;; - # icc used to be incompatible with GCC. - # ICC 10 doesn't accept -KPIC any more. - icc* | ifort*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-fPIC' - lt_prog_compiler_static='-static' - ;; - # Lahey Fortran 8.1. - lf95*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='--shared' - lt_prog_compiler_static='--static' - ;; - nagfor*) - # NAG Fortran compiler - lt_prog_compiler_wl='-Wl,-Wl,,' - lt_prog_compiler_pic='-PIC' - lt_prog_compiler_static='-Bstatic' - ;; - pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) - # Portland Group compilers (*not* the Pentium gcc compiler, - # which looks to be a dead project) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-fpic' - lt_prog_compiler_static='-Bstatic' - ;; - ccc*) - lt_prog_compiler_wl='-Wl,' - # All Alpha code is PIC. - lt_prog_compiler_static='-non_shared' - ;; - xl* | bgxl* | bgf* | mpixl*) - # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-qpic' - lt_prog_compiler_static='-qstaticlink' - ;; - *) - case `$CC -V 2>&1 | sed 5q` in - *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) - # Sun Fortran 8.3 passes all unrecognized flags to the linker - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - lt_prog_compiler_wl='' - ;; - *Sun\ F* | *Sun*Fortran*) - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - lt_prog_compiler_wl='-Qoption ld ' - ;; - *Sun\ C*) - # Sun C 5.9 - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - lt_prog_compiler_wl='-Wl,' - ;; - *Intel*\ [CF]*Compiler*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-fPIC' - lt_prog_compiler_static='-static' - ;; - *Portland\ Group*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-fpic' - lt_prog_compiler_static='-Bstatic' - ;; - esac - ;; - esac - ;; +# These are sane defaults that work on at least a few old systems. +# [They come from Ultrix. What could be older than Ultrix?!! ;)] - newsos6) - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - ;; +# Character class describing NM global symbol codes. +symcode='[BCDEGRST]' - *nto* | *qnx*) - # QNX uses GNU C++, but need to define -shared option too, otherwise - # it will coredump. - lt_prog_compiler_pic='-fPIC -shared' - ;; +# Regexp to match symbols that can be accessed directly from C. +sympat='\([_A-Za-z][_A-Za-z0-9]*\)' - osf3* | osf4* | osf5*) - lt_prog_compiler_wl='-Wl,' - # All OSF/1 code is PIC. - lt_prog_compiler_static='-non_shared' - ;; +# Define system-specific variables. +case $host_os in +aix*) + symcode='[BCDT]' + ;; +cygwin* | mingw* | pw32* | cegcc*) + symcode='[ABCDGISTW]' + ;; +hpux*) + if test "$host_cpu" = ia64; then + symcode='[ABCDEGRST]' + fi + ;; +irix* | nonstopux*) + symcode='[BCDEGRST]' + ;; +osf*) + symcode='[BCDEGQRST]' + ;; +solaris*) + symcode='[BDRT]' + ;; +sco3.2v5*) + symcode='[DT]' + ;; +sysv4.2uw2*) + symcode='[DT]' + ;; +sysv5* | sco5v6* | unixware* | OpenUNIX*) + symcode='[ABDT]' + ;; +sysv4) + symcode='[DFNSTU]' + ;; +esac - rdos*) - lt_prog_compiler_static='-non_shared' - ;; +# If we're using GNU nm, then use its standard symbol codes. +case `$NM -V 2>&1` in +*GNU* | *'with BFD'*) + symcode='[ABCDGIRSTW]' ;; +esac - solaris*) - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - case $cc_basename in - f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) - lt_prog_compiler_wl='-Qoption ld ';; - *) - lt_prog_compiler_wl='-Wl,';; - esac - ;; +# Transform an extracted symbol line into a proper C declaration. +# Some systems (esp. on ia64) link data and code symbols differently, +# so use this general approach. +lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" - sunos4*) - lt_prog_compiler_wl='-Qoption ld ' - lt_prog_compiler_pic='-PIC' - lt_prog_compiler_static='-Bstatic' - ;; - - sysv4 | sysv4.2uw2* | sysv4.3*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - ;; - - sysv4*MP*) - if test -d /usr/nec ;then - lt_prog_compiler_pic='-Kconform_pic' - lt_prog_compiler_static='-Bstatic' - fi - ;; - - sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - ;; - - unicos*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_can_build_shared=no - ;; - - uts4*) - lt_prog_compiler_pic='-pic' - lt_prog_compiler_static='-Bstatic' - ;; - - *) - lt_prog_compiler_can_build_shared=no - ;; - esac - fi +# Transform an extracted symbol line into symbol name and symbol address +lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" -case $host_os in - # For platforms which do not support PIC, -DPIC is meaningless: - *djgpp*) - lt_prog_compiler_pic= - ;; - *) - lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" - ;; +# Handle CRLF in mingw tool chain +opt_cr= +case $build_os in +mingw*) + opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp + ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 -$as_echo_n "checking for $compiler option to produce PIC... " >&6; } -if ${lt_cv_prog_compiler_pic+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_prog_compiler_pic=$lt_prog_compiler_pic -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 -$as_echo "$lt_cv_prog_compiler_pic" >&6; } -lt_prog_compiler_pic=$lt_cv_prog_compiler_pic +# Try without a prefix underscore, then with it. +for ac_symprfx in "" "_"; do -# -# Check to make sure the PIC flag actually works. -# -if test -n "$lt_prog_compiler_pic"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 -$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } -if ${lt_cv_prog_compiler_pic_works+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_prog_compiler_pic_works=no - ac_outfile=conftest.$ac_objext - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="$lt_prog_compiler_pic -DPIC" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - # The option is referenced via a variable to avoid confusing sed. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s "$ac_outfile"; then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings other than the usual output. - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then - lt_cv_prog_compiler_pic_works=yes - fi - fi - $RM conftest* + # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. + symxfrm="\\1 $ac_symprfx\\2 \\2" -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 -$as_echo "$lt_cv_prog_compiler_pic_works" >&6; } + # Write the raw and C identifiers. + if test "$lt_cv_nm_interface" = "MS dumpbin"; then + # Fake it for dumpbin and say T for any non-static function + # and D for any global variable. + # Also find C++ and __fastcall symbols from MSVC++, + # which start with @ or ?. + lt_cv_sys_global_symbol_pipe="$AWK '"\ +" {last_section=section; section=\$ 3};"\ +" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ +" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ +" \$ 0!~/External *\|/{next};"\ +" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ +" {if(hide[section]) next};"\ +" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ +" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ +" s[1]~/^[@?]/{print s[1], s[1]; next};"\ +" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ +" ' prfx=^$ac_symprfx" + else + lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + fi + lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" -if test x"$lt_cv_prog_compiler_pic_works" = xyes; then - case $lt_prog_compiler_pic in - "" | " "*) ;; - *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; - esac -else - lt_prog_compiler_pic= - lt_prog_compiler_can_build_shared=no -fi + # Check to see that the pipe works correctly. + pipe_works=no -fi + rm -f conftest* + cat > conftest.$ac_ext <<_LT_EOF +#ifdef __cplusplus +extern "C" { +#endif +char nm_test_var; +void nm_test_func(void); +void nm_test_func(void){} +#ifdef __cplusplus +} +#endif +int main(){nm_test_var='a';nm_test_func();return(0);} +_LT_EOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + # Now try to grab the symbols. + nlist=conftest.nm + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 + (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s "$nlist"; then + # Try sorting and uniquifying the output. + if sort "$nlist" | uniq > "$nlist"T; then + mv -f "$nlist"T "$nlist" + else + rm -f "$nlist"T + fi + # Make sure that we snagged all the symbols we need. + if $GREP ' nm_test_var$' "$nlist" >/dev/null; then + if $GREP ' nm_test_func$' "$nlist" >/dev/null; then + cat <<_LT_EOF > conftest.$ac_ext +/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ +#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) +/* DATA imports from DLLs on WIN32 con't be const, because runtime + relocations are performed -- see ld's documentation on pseudo-relocs. */ +# define LT_DLSYM_CONST +#elif defined(__osf__) +/* This system does not cope well with relocations in const data. */ +# define LT_DLSYM_CONST +#else +# define LT_DLSYM_CONST const +#endif +#ifdef __cplusplus +extern "C" { +#endif +_LT_EOF + # Now generate the symbol file. + eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' + cat <<_LT_EOF >> conftest.$ac_ext +/* The mapping between symbol names and symbols. */ +LT_DLSYM_CONST struct { + const char *name; + void *address; +} +lt__PROGRAM__LTX_preloaded_symbols[] = +{ + { "@PROGRAM@", (void *) 0 }, +_LT_EOF + $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext + cat <<\_LT_EOF >> conftest.$ac_ext + {0, (void *) 0} +}; +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt__PROGRAM__LTX_preloaded_symbols; +} +#endif +#ifdef __cplusplus +} +#endif +_LT_EOF + # Now try linking the two files. + mv conftest.$ac_objext conftstm.$ac_objext + lt_globsym_save_LIBS=$LIBS + lt_globsym_save_CFLAGS=$CFLAGS + LIBS="conftstm.$ac_objext" + CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest${ac_exeext}; then + pipe_works=yes + fi + LIBS=$lt_globsym_save_LIBS + CFLAGS=$lt_globsym_save_CFLAGS + else + echo "cannot find nm_test_func in $nlist" >&5 + fi + else + echo "cannot find nm_test_var in $nlist" >&5 + fi + else + echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 + fi + else + echo "$progname: failed program was:" >&5 + cat conftest.$ac_ext >&5 + fi + rm -rf conftest* conftst* + # Do not use the global_symbol_pipe unless it works. + if test "$pipe_works" = yes; then + break + else + lt_cv_sys_global_symbol_pipe= + fi +done +fi -# -# Check to make sure the static flag actually works. -# -wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 -$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } -if ${lt_cv_prog_compiler_static_works+:} false; then : - $as_echo_n "(cached) " >&6 +if test -z "$lt_cv_sys_global_symbol_pipe"; then + lt_cv_sys_global_symbol_to_cdecl= +fi +if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 +$as_echo "failed" >&6; } else - lt_cv_prog_compiler_static_works=no - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS $lt_tmp_static_flag" - echo "$lt_simple_link_test_code" > conftest.$ac_ext - if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then - # The linker can only warn and ignore the option if not recognized - # So say no if there are warnings - if test -s conftest.err; then - # Append any errors to the config.log. - cat conftest.err 1>&5 - $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if diff conftest.exp conftest.er2 >/dev/null; then - lt_cv_prog_compiler_static_works=yes - fi - else - lt_cv_prog_compiler_static_works=yes - fi - fi - $RM -r conftest* - LDFLAGS="$save_LDFLAGS" - + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +$as_echo "ok" >&6; } fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 -$as_echo "$lt_cv_prog_compiler_static_works" >&6; } -if test x"$lt_cv_prog_compiler_static_works" = xyes; then - : -else - lt_prog_compiler_static= +# Response file support. +if test "$lt_cv_nm_interface" = "MS dumpbin"; then + nm_file_list_spec='@' +elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then + nm_file_list_spec='@' fi @@ -12266,1412 +11618,1087 @@ fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 -$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } -if ${lt_cv_prog_compiler_c_o+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_prog_compiler_c_o=no - $RM -r conftest 2>/dev/null - mkdir conftest - cd conftest - mkdir out - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="-o out/conftest2.$ac_objext" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) - (eval "$lt_compile" 2>out/conftest.err) - ac_status=$? - cat out/conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s out/conftest2.$ac_objext - then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp - $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 - if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then - lt_cv_prog_compiler_c_o=yes - fi - fi - chmod u+w . 2>&5 - $RM conftest* - # SGI C++ compiler will create directory out/ii_files/ for - # template instantiation - test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files - $RM out/* && rmdir out - cd .. - $RM -r conftest - $RM conftest* -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 -$as_echo "$lt_cv_prog_compiler_c_o" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 -$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } -if ${lt_cv_prog_compiler_c_o+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_prog_compiler_c_o=no - $RM -r conftest 2>/dev/null - mkdir conftest - cd conftest - mkdir out - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="-o out/conftest2.$ac_objext" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) - (eval "$lt_compile" 2>out/conftest.err) - ac_status=$? - cat out/conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s out/conftest2.$ac_objext - then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp - $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 - if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then - lt_cv_prog_compiler_c_o=yes - fi - fi - chmod u+w . 2>&5 - $RM conftest* - # SGI C++ compiler will create directory out/ii_files/ for - # template instantiation - test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files - $RM out/* && rmdir out - cd .. - $RM -r conftest - $RM conftest* -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 -$as_echo "$lt_cv_prog_compiler_c_o" >&6; } -hard_links="nottested" -if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then - # do not overwrite the value of need_locks provided by the user - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 -$as_echo_n "checking if we can lock with hard links... " >&6; } - hard_links=yes - $RM conftest* - ln conftest.a conftest.b 2>/dev/null && hard_links=no - touch conftest.a - ln conftest.a conftest.b 2>&5 || hard_links=no - ln conftest.a conftest.b 2>/dev/null && hard_links=no - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 -$as_echo "$hard_links" >&6; } - if test "$hard_links" = no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 -$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} - need_locks=warn - fi -else - need_locks=no -fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 +$as_echo_n "checking for sysroot... " >&6; } - runpath_var= - allow_undefined_flag= - always_export_symbols=no - archive_cmds= - archive_expsym_cmds= - compiler_needs_object=no - enable_shared_with_static_runtimes=no - export_dynamic_flag_spec= - export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - hardcode_automatic=no - hardcode_direct=no - hardcode_direct_absolute=no - hardcode_libdir_flag_spec= - hardcode_libdir_separator= - hardcode_minus_L=no - hardcode_shlibpath_var=unsupported - inherit_rpath=no - link_all_deplibs=unknown - module_cmds= - module_expsym_cmds= - old_archive_from_new_cmds= - old_archive_from_expsyms_cmds= - thread_safe_flag_spec= - whole_archive_flag_spec= - # include_expsyms should be a list of space-separated symbols to be *always* - # included in the symbol list - include_expsyms= - # exclude_expsyms can be an extended regexp of symbols to exclude - # it will be wrapped by ` (' and `)$', so one must not match beginning or - # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', - # as well as any symbol that contains `d'. - exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' - # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out - # platforms (ab)use it in PIC code, but their linkers get confused if - # the symbol is explicitly referenced. Since portable code cannot - # rely on this symbol name, it's probably fine to never include it in - # preloaded symbol tables. - # Exclude shared library initialization/finalization symbols. - extract_expsyms_cmds= +# Check whether --with-sysroot was given. +if test "${with_sysroot+set}" = set; then : + withval=$with_sysroot; +else + with_sysroot=no +fi - case $host_os in - cygwin* | mingw* | pw32* | cegcc*) - # FIXME: the MSVC++ port hasn't been tested in a loooong time - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - if test "$GCC" != yes; then - with_gnu_ld=no - fi - ;; - interix*) - # we just hope/assume this is gcc and not c89 (= MSVC++) - with_gnu_ld=yes - ;; - openbsd*) - with_gnu_ld=no - ;; - esac - ld_shlibs=yes +lt_sysroot= +case ${with_sysroot} in #( + yes) + if test "$GCC" = yes; then + lt_sysroot=`$CC --print-sysroot 2>/dev/null` + fi + ;; #( + /*) + lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` + ;; #( + no|'') + ;; #( + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5 +$as_echo "${with_sysroot}" >&6; } + as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 + ;; +esac - # On some targets, GNU ld is compatible enough with the native linker - # that we're better off using the native interface for both. - lt_use_gnu_ld_interface=no - if test "$with_gnu_ld" = yes; then - case $host_os in - aix*) - # The AIX port of GNU ld has always aspired to compatibility - # with the native linker. However, as the warning in the GNU ld - # block says, versions before 2.19.5* couldn't really create working - # shared libraries, regardless of the interface used. - case `$LD -v 2>&1` in - *\ \(GNU\ Binutils\)\ 2.19.5*) ;; - *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; - *\ \(GNU\ Binutils\)\ [3-9]*) ;; - *) - lt_use_gnu_ld_interface=yes + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 +$as_echo "${lt_sysroot:-no}" >&6; } + + + + + +# Check whether --enable-libtool-lock was given. +if test "${enable_libtool_lock+set}" = set; then : + enableval=$enable_libtool_lock; +fi + +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes + +# Some flags need to be propagated to the compiler or linker for good +# libtool support. +case $host in +ia64-*-hpux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `/usr/bin/file conftest.$ac_objext` in + *ELF-32*) + HPUX_IA64_MODE="32" + ;; + *ELF-64*) + HPUX_IA64_MODE="64" + ;; + esac + fi + rm -rf conftest* + ;; +*-*-irix6*) + # Find out which ABI we are using. + echo '#line '$LINENO' "configure"' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + if test "$lt_cv_prog_gnu_ld" = yes; then + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -melf32bsmip" + ;; + *N32*) + LD="${LD-ld} -melf32bmipn32" + ;; + *64-bit*) + LD="${LD-ld} -melf64bmip" + ;; + esac + else + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -32" + ;; + *N32*) + LD="${LD-ld} -n32" + ;; + *64-bit*) + LD="${LD-ld} -64" + ;; + esac + fi + fi + rm -rf conftest* + ;; + +x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ +s390*-*linux*|s390*-*tpf*|sparc*-*linux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `/usr/bin/file conftest.o` in + *32-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_i386_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_i386" + ;; + ppc64-*linux*|powerpc64-*linux*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) + LD="${LD-ld} -m elf_s390" + ;; + sparc64-*linux*) + LD="${LD-ld} -m elf32_sparc" ;; esac ;; - *) - lt_use_gnu_ld_interface=yes + *64-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_x86_64_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; + ppc*-*linux*|powerpc*-*linux*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*|s390*-*tpf*) + LD="${LD-ld} -m elf64_s390" + ;; + sparc*-*linux*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac ;; esac fi + rm -rf conftest* + ;; - if test "$lt_use_gnu_ld_interface" = yes; then - # If archive_cmds runs LD, not CC, wlarc should be empty - wlarc='${wl}' +*-*-sco3.2v5*) + # On SCO OpenServer 5, we need -belf to get full-featured binaries. + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -belf" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 +$as_echo_n "checking whether the C compiler needs -belf... " >&6; } +if ${lt_cv_cc_needs_belf+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu - # Set some defaults for GNU ld with shared library support. These - # are reset later if shared libraries are not supported. Putting them - # here allows them to be overridden if necessary. - runpath_var=LD_RUN_PATH - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - export_dynamic_flag_spec='${wl}--export-dynamic' - # ancient GNU ld didn't support --whole-archive et. al. - if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then - whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - whole_archive_flag_spec= - fi - supports_anon_versioning=no - case `$LD -v 2>&1` in - *GNU\ gold*) supports_anon_versioning=yes ;; - *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 - *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... - *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... - *\ 2.11.*) ;; # other 2.11 versions - *) supports_anon_versioning=yes ;; - esac + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ - # See if GNU ld supports shared libraries. - case $host_os in - aix[3-9]*) - # On AIX/PPC, the GNU linker is very broken - if test "$host_cpu" != ia64; then - ld_shlibs=no - cat <<_LT_EOF 1>&2 +#ifdef FC_DUMMY_MAIN +#ifndef FC_DUMMY_MAIN_EQ_F77 +# ifdef __cplusplus + extern "C" +# endif + int FC_DUMMY_MAIN() { return 1; } +#endif +#endif +int +main () +{ -*** Warning: the GNU linker, at least up to release 2.19, is reported -*** to be unable to reliably create shared libraries on AIX. -*** Therefore, libtool is disabling shared libraries support. If you -*** really care for shared libraries, you may want to install binutils -*** 2.20 or above, or modify your PATH so that a non-GNU linker is found. -*** You will then need to restart the configuration process. + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + lt_cv_cc_needs_belf=yes +else + lt_cv_cc_needs_belf=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu -_LT_EOF - fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 +$as_echo "$lt_cv_cc_needs_belf" >&6; } + if test x"$lt_cv_cc_needs_belf" != x"yes"; then + # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf + CFLAGS="$SAVE_CFLAGS" + fi + ;; +*-*solaris*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `/usr/bin/file conftest.o` in + *64-bit*) + case $lt_cv_prog_gnu_ld in + yes*) + case $host in + i?86-*-solaris*) + LD="${LD-ld} -m elf_x86_64" + ;; + sparc*-*-solaris*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + # GNU ld 2.21 introduced _sol2 emulations. Use them if available. + if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then + LD="${LD-ld}_sol2" + fi + ;; + *) + if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then + LD="${LD-ld} -64" + fi + ;; + esac ;; + esac + fi + rm -rf conftest* + ;; +esac - amigaos*) - case $host_cpu in - powerpc) - # see comment about AmigaOS4 .so support - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='' - ;; - m68k) - archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - ;; - esac - ;; +need_locks="$enable_libtool_lock" - beos*) - if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - allow_undefined_flag=unsupported - # Joseph Beckenbach says some releases of gcc - # support --undefined. This deserves some investigation. FIXME - archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - else - ld_shlibs=no - fi - ;; +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. +set dummy ${ac_tool_prefix}mt; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_MANIFEST_TOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$MANIFEST_TOOL"; then + ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS - cygwin* | mingw* | pw32* | cegcc*) - # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, - # as there is no search path for DLLs. - hardcode_libdir_flag_spec='-L$libdir' - export_dynamic_flag_spec='${wl}--export-all-symbols' - allow_undefined_flag=unsupported - always_export_symbols=no - enable_shared_with_static_runtimes=yes - export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' - exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' +fi +fi +MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL +if test -n "$MANIFEST_TOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 +$as_echo "$MANIFEST_TOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi - if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is; otherwise, prepend... - archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - else - ld_shlibs=no - fi - ;; - haiku*) - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - link_all_deplibs=yes - ;; +fi +if test -z "$ac_cv_prog_MANIFEST_TOOL"; then + ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL + # Extract the first word of "mt", so it can be a program name with args. +set dummy mt; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_MANIFEST_TOOL"; then + ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS - interix[3-9]*) - hardcode_direct=no - hardcode_shlibpath_var=no - hardcode_libdir_flag_spec='${wl}-rpath,$libdir' - export_dynamic_flag_spec='${wl}-E' - # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. - # Instead, shared libraries are loaded at an image base (0x10000000 by - # default) and relocated if they conflict, which is a slow very memory - # consuming and fragmenting process. To avoid this, we pick a random, - # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link - # time. Moving up from 0x10000000 also allows more sbrk(2) space. - archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - ;; +fi +fi +ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL +if test -n "$ac_ct_MANIFEST_TOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 +$as_echo "$ac_ct_MANIFEST_TOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi - gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) - tmp_diet=no - if test "$host_os" = linux-dietlibc; then - case $cc_basename in - diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) - esac - fi - if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ - && test "$tmp_diet" = no - then - tmp_addflag=' $pic_flag' - tmp_sharedflag='-shared' - case $cc_basename,$host_cpu in - pgcc*) # Portland Group C compiler - whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' - tmp_addflag=' $pic_flag' - ;; - pgf77* | pgf90* | pgf95* | pgfortran*) - # Portland Group f77 and f90 compilers - whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' - tmp_addflag=' $pic_flag -Mnomain' ;; - ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 - tmp_addflag=' -i_dynamic' ;; - efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 - tmp_addflag=' -i_dynamic -nofor_main' ;; - ifc* | ifort*) # Intel Fortran compiler - tmp_addflag=' -nofor_main' ;; - lf95*) # Lahey Fortran 8.1 - whole_archive_flag_spec= - tmp_sharedflag='--shared' ;; - xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) - tmp_sharedflag='-qmkshrobj' - tmp_addflag= ;; - nvcc*) # Cuda Compiler Driver 2.2 - whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' - compiler_needs_object=yes - ;; - esac - case `$CC -V 2>&1 | sed 5q` in - *Sun\ C*) # Sun C 5.9 - whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' - compiler_needs_object=yes - tmp_sharedflag='-G' ;; - *Sun\ F*) # Sun Fortran 8.3 - tmp_sharedflag='-G' ;; - esac - archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + if test "x$ac_ct_MANIFEST_TOOL" = x; then + MANIFEST_TOOL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL + fi +else + MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" +fi - if test "x$supports_anon_versioning" = xyes; then - archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' - fi +test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 +$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } +if ${lt_cv_path_mainfest_tool+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_path_mainfest_tool=no + echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 + $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out + cat conftest.err >&5 + if $GREP 'Manifest Tool' conftest.out > /dev/null; then + lt_cv_path_mainfest_tool=yes + fi + rm -f conftest* +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 +$as_echo "$lt_cv_path_mainfest_tool" >&6; } +if test "x$lt_cv_path_mainfest_tool" != xyes; then + MANIFEST_TOOL=: +fi - case $cc_basename in - xlf* | bgf* | bgxlf* | mpixlf*) - # IBM XL Fortran 10.1 on PPC cannot create shared libs itself - whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' - if test "x$supports_anon_versioning" = xyes; then - archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - echo "local: *; };" >> $output_objdir/$libname.ver~ - $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' - fi - ;; - esac - else - ld_shlibs=no - fi - ;; - netbsd*) - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' - wlarc= - else - archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - fi - ;; - solaris*) - if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then - ld_shlibs=no - cat <<_LT_EOF 1>&2 -*** Warning: The releases 2.8.* of the GNU linker cannot reliably -*** create shared libraries on Solaris systems. Therefore, libtool -*** is disabling shared libraries support. We urge you to upgrade GNU -*** binutils to release 2.9.1 or newer. Another option is to modify -*** your PATH or compiler configuration so that the native linker is -*** used, and then restart. -_LT_EOF - elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs=no - fi - ;; - sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) - case `$LD -v 2>&1` in - *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) - ld_shlibs=no - cat <<_LT_EOF 1>&2 + case $host_os in + rhapsody* | darwin*) + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. +set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_DSYMUTIL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DSYMUTIL"; then + ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS -*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not -*** reliably create shared libraries on SCO systems. Therefore, libtool -*** is disabling shared libraries support. We urge you to upgrade GNU -*** binutils to release 2.16.91.0.3 or newer. Another option is to modify -*** your PATH or compiler configuration so that the native linker is -*** used, and then restart. +fi +fi +DSYMUTIL=$ac_cv_prog_DSYMUTIL +if test -n "$DSYMUTIL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 +$as_echo "$DSYMUTIL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi -_LT_EOF - ;; - *) - # For security reasons, it is highly recommended that you always - # use absolute paths for naming shared libraries, and exclude the - # DT_RUNPATH tag from executables and libraries. But doing so - # requires that you compile everything twice, which is a pain. - if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs=no - fi - ;; - esac - ;; - sunos4*) - archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' - wlarc= - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; +fi +if test -z "$ac_cv_prog_DSYMUTIL"; then + ac_ct_DSYMUTIL=$DSYMUTIL + # Extract the first word of "dsymutil", so it can be a program name with args. +set dummy dsymutil; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DSYMUTIL"; then + ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS - *) - if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs=no - fi - ;; - esac +fi +fi +ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL +if test -n "$ac_ct_DSYMUTIL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 +$as_echo "$ac_ct_DSYMUTIL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi - if test "$ld_shlibs" = no; then - runpath_var= - hardcode_libdir_flag_spec= - export_dynamic_flag_spec= - whole_archive_flag_spec= - fi + if test "x$ac_ct_DSYMUTIL" = x; then + DSYMUTIL=":" else - # PORTME fill in a description of your system's linker (not GNU ld) - case $host_os in - aix3*) - allow_undefined_flag=unsupported - always_export_symbols=yes - archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' - # Note: this linker hardcodes the directories in LIBPATH if there - # are no directories specified by -L. - hardcode_minus_L=yes - if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then - # Neither direct hardcoding nor static linking is supported with a - # broken collect2. - hardcode_direct=unsupported - fi - ;; - - aix[4-9]*) - if test "$host_cpu" = ia64; then - # On IA64, the linker does run time linking by default, so we don't - # have to do anything special. - aix_use_runtimelinking=no - exp_sym_flag='-Bexport' - no_entry_flag="" - else - # If we're using GNU nm, then we don't want the "-C" option. - # -C means demangle to AIX nm, but means don't demangle with GNU nm - # Also, AIX nm treats weak defined symbols like other global - # defined symbols, whereas GNU nm marks them as "W". - if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then - export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' - else - export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' - fi - aix_use_runtimelinking=no - - # Test if we are trying to use run time linking or normal - # AIX style linking. If -brtl is somewhere in LDFLAGS, we - # need to do runtime linking. - case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) - for ld_flag in $LDFLAGS; do - if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then - aix_use_runtimelinking=yes - break - fi - done - ;; - esac + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DSYMUTIL=$ac_ct_DSYMUTIL + fi +else + DSYMUTIL="$ac_cv_prog_DSYMUTIL" +fi - exp_sym_flag='-bexport' - no_entry_flag='-bnoentry' - fi + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. +set dummy ${ac_tool_prefix}nmedit; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_NMEDIT+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$NMEDIT"; then + ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS - # When large executables or shared objects are built, AIX ld can - # have problems creating the table of contents. If linking a library - # or program results in "error TOC overflow" add -mminimal-toc to - # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not - # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. +fi +fi +NMEDIT=$ac_cv_prog_NMEDIT +if test -n "$NMEDIT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 +$as_echo "$NMEDIT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi - archive_cmds='' - hardcode_direct=yes - hardcode_direct_absolute=yes - hardcode_libdir_separator=':' - link_all_deplibs=yes - file_list_spec='${wl}-f,' - if test "$GCC" = yes; then - case $host_os in aix4.[012]|aix4.[012].*) - # We only want to do this on AIX 4.2 and lower, the check - # below for broken collect2 doesn't work under 4.3+ - collect2name=`${CC} -print-prog-name=collect2` - if test -f "$collect2name" && - strings "$collect2name" | $GREP resolve_lib_name >/dev/null - then - # We have reworked collect2 - : - else - # We have old collect2 - hardcode_direct=unsupported - # It fails to find uninstalled libraries when the uninstalled - # path is not listed in the libpath. Setting hardcode_minus_L - # to unsupported forces relinking - hardcode_minus_L=yes - hardcode_libdir_flag_spec='-L$libdir' - hardcode_libdir_separator= - fi - ;; - esac - shared_flag='-shared' - if test "$aix_use_runtimelinking" = yes; then - shared_flag="$shared_flag "'${wl}-G' - fi - else - # not using gcc - if test "$host_cpu" = ia64; then - # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release - # chokes on -Wl,-G. The following line is correct: - shared_flag='-G' - else - if test "$aix_use_runtimelinking" = yes; then - shared_flag='${wl}-G' - else - shared_flag='${wl}-bM:SRE' - fi - fi - fi - - export_dynamic_flag_spec='${wl}-bexpall' - # It seems that -bexpall does not export symbols beginning with - # underscore (_), so it is better to generate a list of symbols to export. - always_export_symbols=yes - if test "$aix_use_runtimelinking" = yes; then - # Warning - without using the other runtime loading flags (-brtl), - # -berok will link without error, but may produce a broken library. - allow_undefined_flag='-berok' - # Determine the default libpath from the value encoded in an - # empty executable. - if test "${lt_cv_aix_libpath+set}" = set; then - aix_libpath=$lt_cv_aix_libpath -else - if ${lt_cv_aix_libpath_+:} false; then : +fi +if test -z "$ac_cv_prog_NMEDIT"; then + ac_ct_NMEDIT=$NMEDIT + # Extract the first word of "nmedit", so it can be a program name with args. +set dummy nmedit; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus - extern "C" -# endif - int FC_DUMMY_MAIN() { return 1; } -#endif -#endif -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - - lt_aix_libpath_sed=' - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\([^ ]*\) *$/\1/ - p - } - }' - lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - # Check for a 64-bit object if we didn't find anything. - if test -z "$lt_cv_aix_libpath_"; then - lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - fi -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - if test -z "$lt_cv_aix_libpath_"; then - lt_cv_aix_libpath_="/usr/lib:/lib" + if test -n "$ac_ct_NMEDIT"; then + ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_NMEDIT="nmedit" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 fi +done + done +IFS=$as_save_IFS fi - - aix_libpath=$lt_cv_aix_libpath_ +fi +ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT +if test -n "$ac_ct_NMEDIT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 +$as_echo "$ac_ct_NMEDIT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi - hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" - archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" - else - if test "$host_cpu" = ia64; then - hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' - allow_undefined_flag="-z nodefs" - archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" - else - # Determine the default libpath from the value encoded in an - # empty executable. - if test "${lt_cv_aix_libpath+set}" = set; then - aix_libpath=$lt_cv_aix_libpath + if test "x$ac_ct_NMEDIT" = x; then + NMEDIT=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + NMEDIT=$ac_ct_NMEDIT + fi else - if ${lt_cv_aix_libpath_+:} false; then : + NMEDIT="$ac_cv_prog_NMEDIT" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. +set dummy ${ac_tool_prefix}lipo; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + if test -n "$LIPO"; then + ac_cv_prog_LIPO="$LIPO" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_LIPO="${ac_tool_prefix}lipo" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus - extern "C" -# endif - int FC_DUMMY_MAIN() { return 1; } -#endif -#endif -int -main () -{ +fi +fi +LIPO=$ac_cv_prog_LIPO +if test -n "$LIPO"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 +$as_echo "$LIPO" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - lt_aix_libpath_sed=' - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\([^ ]*\) *$/\1/ - p - } - }' - lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - # Check for a 64-bit object if we didn't find anything. - if test -z "$lt_cv_aix_libpath_"; then - lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - fi fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - if test -z "$lt_cv_aix_libpath_"; then - lt_cv_aix_libpath_="/usr/lib:/lib" +if test -z "$ac_cv_prog_LIPO"; then + ac_ct_LIPO=$LIPO + # Extract the first word of "lipo", so it can be a program name with args. +set dummy lipo; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_LIPO+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_LIPO"; then + ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_LIPO="lipo" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 fi +done + done +IFS=$as_save_IFS fi - - aix_libpath=$lt_cv_aix_libpath_ +fi +ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO +if test -n "$ac_ct_LIPO"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 +$as_echo "$ac_ct_LIPO" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi - hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" - # Warning - without using the other run time loading flags, - # -berok will link without error, but may produce a broken library. - no_undefined_flag=' ${wl}-bernotok' - allow_undefined_flag=' ${wl}-berok' - if test "$with_gnu_ld" = yes; then - # We only use this code for GNU lds that support --whole-archive. - whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive' - else - # Exported symbols can be pulled into shared objects from archives - whole_archive_flag_spec='$convenience' - fi - archive_cmds_need_lc=yes - # This is similar to how AIX traditionally builds its shared libraries. - archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' - fi - fi - ;; - - amigaos*) - case $host_cpu in - powerpc) - # see comment about AmigaOS4 .so support - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='' - ;; - m68k) - archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - ;; - esac - ;; + if test "x$ac_ct_LIPO" = x; then + LIPO=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + LIPO=$ac_ct_LIPO + fi +else + LIPO="$ac_cv_prog_LIPO" +fi - bsdi[45]*) - export_dynamic_flag_spec=-rdynamic - ;; + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. +set dummy ${ac_tool_prefix}otool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_OTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OTOOL"; then + ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_OTOOL="${ac_tool_prefix}otool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS - cygwin* | mingw* | pw32* | cegcc*) - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - # hardcode_libdir_flag_spec is actually meaningless, as there is - # no search path for DLLs. - case $cc_basename in - cl*) - # Native MSVC - hardcode_libdir_flag_spec=' ' - allow_undefined_flag=unsupported - always_export_symbols=yes - file_list_spec='@' - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" - # FIXME: Setting linknames here is a bad hack. - archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' - archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; - else - sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; - fi~ - $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ - linknames=' - # The linker will not automatically build a static lib if we build a DLL. - # _LT_TAGVAR(old_archive_from_new_cmds, )='true' - enable_shared_with_static_runtimes=yes - exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' - export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' - # Don't use ranlib - old_postinstall_cmds='chmod 644 $oldlib' - postlink_cmds='lt_outputfile="@OUTPUT@"~ - lt_tool_outputfile="@TOOL_OUTPUT@"~ - case $lt_outputfile in - *.exe|*.EXE) ;; - *) - lt_outputfile="$lt_outputfile.exe" - lt_tool_outputfile="$lt_tool_outputfile.exe" - ;; - esac~ - if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then - $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; - $RM "$lt_outputfile.manifest"; - fi' - ;; - *) - # Assume MSVC wrapper - hardcode_libdir_flag_spec=' ' - allow_undefined_flag=unsupported - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" - # FIXME: Setting linknames here is a bad hack. - archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' - # The linker will automatically build a .lib file if we build a DLL. - old_archive_from_new_cmds='true' - # FIXME: Should let the user specify the lib program. - old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' - enable_shared_with_static_runtimes=yes - ;; - esac - ;; +fi +fi +OTOOL=$ac_cv_prog_OTOOL +if test -n "$OTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 +$as_echo "$OTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi - darwin* | rhapsody*) +fi +if test -z "$ac_cv_prog_OTOOL"; then + ac_ct_OTOOL=$OTOOL + # Extract the first word of "otool", so it can be a program name with args. +set dummy otool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_OTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OTOOL"; then + ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_OTOOL="otool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS - archive_cmds_need_lc=no - hardcode_direct=no - hardcode_automatic=yes - hardcode_shlibpath_var=unsupported - if test "$lt_cv_ld_force_load" = "yes"; then - whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' +fi +fi +ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL +if test -n "$ac_ct_OTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 +$as_echo "$ac_ct_OTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + if test "x$ac_ct_OTOOL" = x; then + OTOOL=":" else - whole_archive_flag_spec='' + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OTOOL=$ac_ct_OTOOL fi - link_all_deplibs=yes - allow_undefined_flag="$_lt_dar_allow_undefined" - case $cc_basename in - ifort*) _lt_dar_can_shared=yes ;; - *) _lt_dar_can_shared=$GCC ;; - esac - if test "$_lt_dar_can_shared" = "yes"; then - output_verbose_link_cmd=func_echo_all - archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" - module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" - archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" - module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" +else + OTOOL="$ac_cv_prog_OTOOL" +fi - else - ld_shlibs=no + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. +set dummy ${ac_tool_prefix}otool64; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_OTOOL64+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OTOOL64"; then + ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 fi +done + done +IFS=$as_save_IFS - ;; +fi +fi +OTOOL64=$ac_cv_prog_OTOOL64 +if test -n "$OTOOL64"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 +$as_echo "$OTOOL64" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi - dgux*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_shlibpath_var=no - ;; - # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor - # support. Future versions do this automatically, but an explicit c++rt0.o - # does not break anything, and helps significantly (at the cost of a little - # extra space). - freebsd2.2*) - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; +fi +if test -z "$ac_cv_prog_OTOOL64"; then + ac_ct_OTOOL64=$OTOOL64 + # Extract the first word of "otool64", so it can be a program name with args. +set dummy otool64; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OTOOL64"; then + ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_OTOOL64="otool64" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS - # Unfortunately, older versions of FreeBSD 2 do not have this feature. - freebsd2.*) - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=yes - hardcode_minus_L=yes - hardcode_shlibpath_var=no - ;; +fi +fi +ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 +if test -n "$ac_ct_OTOOL64"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 +$as_echo "$ac_ct_OTOOL64" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi - # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd* | dragonfly*) - archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; + if test "x$ac_ct_OTOOL64" = x; then + OTOOL64=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OTOOL64=$ac_ct_OTOOL64 + fi +else + OTOOL64="$ac_cv_prog_OTOOL64" +fi - hpux9*) - if test "$GCC" = yes; then - archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - else - archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - fi - hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' - hardcode_libdir_separator=: - hardcode_direct=yes - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L=yes - export_dynamic_flag_spec='${wl}-E' - ;; - hpux10*) - if test "$GCC" = yes && test "$with_gnu_ld" = no; then - archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' - fi - if test "$with_gnu_ld" = no; then - hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' - hardcode_libdir_separator=: - hardcode_direct=yes - hardcode_direct_absolute=yes - export_dynamic_flag_spec='${wl}-E' - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L=yes - fi - ;; - hpux11*) - if test "$GCC" = yes && test "$with_gnu_ld" = no; then - case $host_cpu in - hppa*64*) - archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - ia64*) - archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - else - case $host_cpu in - hppa*64*) - archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - ia64*) - archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - # Older versions of the 11.00 compiler do not understand -b yet - # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 -$as_echo_n "checking if $CC understands -b... " >&6; } -if ${lt_cv_prog_compiler__b+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_prog_compiler__b=no - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS -b" - echo "$lt_simple_link_test_code" > conftest.$ac_ext - if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then - # The linker can only warn and ignore the option if not recognized - # So say no if there are warnings - if test -s conftest.err; then - # Append any errors to the config.log. - cat conftest.err 1>&5 - $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if diff conftest.exp conftest.er2 >/dev/null; then - lt_cv_prog_compiler__b=yes - fi - else - lt_cv_prog_compiler__b=yes - fi - fi - $RM -r conftest* - LDFLAGS="$save_LDFLAGS" -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 -$as_echo "$lt_cv_prog_compiler__b" >&6; } -if test x"$lt_cv_prog_compiler__b" = xyes; then - archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' -else - archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' -fi - ;; - esac - fi - if test "$with_gnu_ld" = no; then - hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' - hardcode_libdir_separator=: - case $host_cpu in - hppa*64*|ia64*) - hardcode_direct=no - hardcode_shlibpath_var=no - ;; - *) - hardcode_direct=yes - hardcode_direct_absolute=yes - export_dynamic_flag_spec='${wl}-E' - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L=yes - ;; - esac - fi - ;; - irix5* | irix6* | nonstopux*) - if test "$GCC" = yes; then - archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - # Try to use the -exported_symbol ld option, if it does not - # work, assume that -exports_file does not work either and - # implicitly export all symbols. - # This should be the same for all languages, so no per-tag cache variable. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 -$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } -if ${lt_cv_irix_exported_symbol+:} false; then : - $as_echo_n "(cached) " >&6 -else - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int foo (void) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - lt_cv_irix_exported_symbol=yes -else - lt_cv_irix_exported_symbol=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - LDFLAGS="$save_LDFLAGS" -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 -$as_echo "$lt_cv_irix_exported_symbol" >&6; } - if test "$lt_cv_irix_exported_symbol" = yes; then - archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' - fi - else - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' - fi - archive_cmds_need_lc='no' - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator=: - inherit_rpath=yes - link_all_deplibs=yes - ;; - netbsd*) - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out - else - archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF - fi - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - newsos6) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=yes - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator=: - hardcode_shlibpath_var=no - ;; - *nto* | *qnx*) - ;; - openbsd*) - if test -f /usr/libexec/ld.so; then - hardcode_direct=yes - hardcode_shlibpath_var=no - hardcode_direct_absolute=yes - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' - hardcode_libdir_flag_spec='${wl}-rpath,$libdir' - export_dynamic_flag_spec='${wl}-E' - else - case $host_os in - openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec='-R$libdir' - ;; - *) - archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec='${wl}-rpath,$libdir' - ;; - esac - fi - else - ld_shlibs=no - fi - ;; - os2*) - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - allow_undefined_flag=unsupported - archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' - old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' - ;; - osf3*) - if test "$GCC" = yes; then - allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - allow_undefined_flag=' -expect_unresolved \*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' - fi - archive_cmds_need_lc='no' - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator=: - ;; - osf4* | osf5*) # as osf3* with the addition of -msym flag - if test "$GCC" = yes; then - allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - else - allow_undefined_flag=' -expect_unresolved \*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' - archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ - $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' - # Both c and cxx compiler support -rpath directly - hardcode_libdir_flag_spec='-rpath $libdir' - fi - archive_cmds_need_lc='no' - hardcode_libdir_separator=: - ;; - solaris*) - no_undefined_flag=' -z defs' - if test "$GCC" = yes; then - wlarc='${wl}' - archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' - else - case `$CC -V 2>&1` in - *"Compilers 5.0"*) - wlarc='' - archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' - ;; - *) - wlarc='${wl}' - archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' - ;; - esac - fi - hardcode_libdir_flag_spec='-R$libdir' - hardcode_shlibpath_var=no - case $host_os in - solaris2.[0-5] | solaris2.[0-5].*) ;; - *) - # The compiler driver will combine and reorder linker options, - # but understands `-z linker_flag'. GCC discards it without `$wl', - # but is careful enough not to reorder. - # Supported since Solaris 2.6 (maybe 2.5.1?) - if test "$GCC" = yes; then - whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' - else - whole_archive_flag_spec='-z allextract$convenience -z defaultextract' - fi - ;; - esac - link_all_deplibs=yes - ;; - sunos4*) - if test "x$host_vendor" = xsequent; then - # Use $CC to link under sequent, because it throws in some extra .o - # files that make .init and .fini sections work. - archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' - fi - hardcode_libdir_flag_spec='-L$libdir' - hardcode_direct=yes - hardcode_minus_L=yes - hardcode_shlibpath_var=no - ;; - sysv4) - case $host_vendor in - sni) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=yes # is this really true??? - ;; - siemens) - ## LD is ld it makes a PLAMLIB - ## CC just makes a GrossModule. - archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' - reload_cmds='$CC -r -o $output$reload_objs' - hardcode_direct=no - ;; - motorola) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=no #Motorola manual says yes, but my tests say they lie - ;; - esac - runpath_var='LD_RUN_PATH' - hardcode_shlibpath_var=no - ;; - sysv4.3*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var=no - export_dynamic_flag_spec='-Bexport' - ;; - sysv4*MP*) - if test -d /usr/nec; then - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var=no - runpath_var=LD_RUN_PATH - hardcode_runpath_var=yes - ld_shlibs=yes - fi - ;; - sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) - no_undefined_flag='${wl}-z,text' - archive_cmds_need_lc=no - hardcode_shlibpath_var=no - runpath_var='LD_RUN_PATH' - if test "$GCC" = yes; then - archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 +$as_echo_n "checking for -single_module linker flag... " >&6; } +if ${lt_cv_apple_cc_single_mod+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_apple_cc_single_mod=no + if test -z "${LT_MULTI_MODULE}"; then + # By default we will add the -single_module flag. You can override + # by either setting the environment variable LT_MULTI_MODULE + # non-empty at configure time, or by adding -multi_module to the + # link flags. + rm -rf libconftest.dylib* + echo "int foo(void){return 1;}" > conftest.c + echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ +-dynamiclib -Wl,-single_module conftest.c" >&5 + $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ + -dynamiclib -Wl,-single_module conftest.c 2>conftest.err + _lt_result=$? + # If there is a non-empty error log, and "single_module" + # appears in it, assume the flag caused a linker warning + if test -s conftest.err && $GREP single_module conftest.err; then + cat conftest.err >&5 + # Otherwise, if the output was created with a 0 exit code from + # the compiler, it worked. + elif test -f libconftest.dylib && test $_lt_result -eq 0; then + lt_cv_apple_cc_single_mod=yes + else + cat conftest.err >&5 + fi + rm -rf libconftest.dylib* + rm -f conftest.* fi - ;; +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 +$as_echo "$lt_cv_apple_cc_single_mod" >&6; } - sysv5* | sco3.2v5* | sco5v6*) - # Note: We can NOT use -z defs as we might desire, because we do not - # link with -lc, and that would cause any symbols used from libc to - # always be unresolved, which means just about no library would - # ever link correctly. If we're not using GNU ld we use -z text - # though, which does catch some bad symbols but isn't as heavy-handed - # as -z defs. - no_undefined_flag='${wl}-z,text' - allow_undefined_flag='${wl}-z,nodefs' - archive_cmds_need_lc=no - hardcode_shlibpath_var=no - hardcode_libdir_flag_spec='${wl}-R,$libdir' - hardcode_libdir_separator=':' - link_all_deplibs=yes - export_dynamic_flag_spec='${wl}-Bexport' - runpath_var='LD_RUN_PATH' + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 +$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } +if ${lt_cv_ld_exported_symbols_list+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ld_exported_symbols_list=no + save_LDFLAGS=$LDFLAGS + echo "_main" > conftest.sym + LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ - if test "$GCC" = yes; then - archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - ;; +#ifdef FC_DUMMY_MAIN +#ifndef FC_DUMMY_MAIN_EQ_F77 +# ifdef __cplusplus + extern "C" +# endif + int FC_DUMMY_MAIN() { return 1; } +#endif +#endif +int +main () +{ - uts4*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_shlibpath_var=no - ;; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + lt_cv_ld_exported_symbols_list=yes +else + lt_cv_ld_exported_symbols_list=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS="$save_LDFLAGS" - *) - ld_shlibs=no - ;; - esac +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 +$as_echo "$lt_cv_ld_exported_symbols_list" >&6; } - if test x$host_vendor = xsni; then - case $host in - sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - export_dynamic_flag_spec='${wl}-Blargedynsym' - ;; + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 +$as_echo_n "checking for -force_load linker flag... " >&6; } +if ${lt_cv_ld_force_load+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ld_force_load=no + cat > conftest.c << _LT_EOF +int forced_loaded() { return 2;} +_LT_EOF + echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 + $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 + echo "$AR cru libconftest.a conftest.o" >&5 + $AR cru libconftest.a conftest.o 2>&5 + echo "$RANLIB libconftest.a" >&5 + $RANLIB libconftest.a 2>&5 + cat > conftest.c << _LT_EOF +int main() { return 0;} +_LT_EOF + echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 + $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err + _lt_result=$? + if test -s conftest.err && $GREP force_load conftest.err; then + cat conftest.err >&5 + elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then + lt_cv_ld_force_load=yes + else + cat conftest.err >&5 + fi + rm -f conftest.err libconftest.a conftest conftest.c + rm -rf conftest.dSYM + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 +$as_echo "$lt_cv_ld_force_load" >&6; } + case $host_os in + rhapsody* | darwin1.[012]) + _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; + darwin1.*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + darwin*) # darwin 5.x on + # if running on 10.5 or later, the deployment target defaults + # to the OS version, if on x86, and 10.4, the deployment + # target defaults to 10.4. Don't you love it? + case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in + 10.0,*86*-darwin8*|10.0,*-darwin[91]*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + 10.[012]*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + 10.*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; esac + ;; + esac + if test "$lt_cv_apple_cc_single_mod" = "yes"; then + _lt_dar_single_mod='$single_module' fi - fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 -$as_echo "$ld_shlibs" >&6; } -test "$ld_shlibs" = no && can_build_shared=no - -with_gnu_ld=$with_gnu_ld + if test "$lt_cv_ld_exported_symbols_list" = "yes"; then + _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' + else + _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' + fi + if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then + _lt_dsymutil='~$DSYMUTIL $lib || :' + else + _lt_dsymutil= + fi + ;; + esac +for ac_header in dlfcn.h +do : + ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default +" +if test "x$ac_cv_header_dlfcn_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_DLFCN_H 1 +_ACEOF +fi +done +func_stripname_cnf () +{ + case ${2} in + .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; + *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; + esac +} # func_stripname_cnf +# Set options +enable_dlopen=yes -# -# Do we need to explicitly link libc? -# -case "x$archive_cmds_need_lc" in -x|xyes) - # Assume -lc should be added - archive_cmds_need_lc=yes + enable_win32_dll=no - if test "$enable_shared" = yes && test "$GCC" = yes; then - case $archive_cmds in - *'~'*) - # FIXME: we may have to deal with multi-command sequences. - ;; - '$CC '*) - # Test whether the compiler implicitly links with -lc since on some - # systems, -lgcc has to come before -lc. If gcc already passes -lc - # to ld, don't add -lc before -lgcc. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 -$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } -if ${lt_cv_archive_cmds_need_lc+:} false; then : - $as_echo_n "(cached) " >&6 -else - $RM conftest* - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } 2>conftest.err; then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$lt_prog_compiler_wl - pic_flag=$lt_prog_compiler_pic - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - lt_save_allow_undefined_flag=$allow_undefined_flag - allow_undefined_flag= - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 - (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - then - lt_cv_archive_cmds_need_lc=no - else - lt_cv_archive_cmds_need_lc=yes - fi - allow_undefined_flag=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 + # Check whether --enable-shared was given. +if test "${enable_shared+set}" = set; then : + enableval=$enable_shared; p=${PACKAGE-default} + case $enableval in + yes) enable_shared=yes ;; + no) enable_shared=no ;; + *) + enable_shared=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_shared=yes fi - $RM conftest* - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 -$as_echo "$lt_cv_archive_cmds_need_lc" >&6; } - archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc + done + IFS="$lt_save_ifs" ;; esac - fi - ;; -esac - - - - - - - - - - - - - - +else + enable_shared=yes +fi @@ -13681,6 +12708,28 @@ esac + # Check whether --enable-static was given. +if test "${enable_static+set}" = set; then : + enableval=$enable_static; p=${PACKAGE-default} + case $enableval in + yes) enable_static=yes ;; + no) enable_static=no ;; + *) + enable_static=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac +else + enable_static=yes +fi @@ -13691,8 +12740,30 @@ esac +# Check whether --with-pic was given. +if test "${with_pic+set}" = set; then : + withval=$with_pic; lt_p=${PACKAGE-default} + case $withval in + yes|no) pic_mode=$withval ;; + *) + pic_mode=default + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for lt_pkg in $withval; do + IFS="$lt_save_ifs" + if test "X$lt_pkg" = "X$lt_p"; then + pic_mode=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac +else + pic_mode=default +fi +test -z "$pic_mode" && pic_mode=default @@ -13700,6 +12771,28 @@ esac + # Check whether --enable-fast-install was given. +if test "${enable_fast_install+set}" = set; then : + enableval=$enable_fast_install; p=${PACKAGE-default} + case $enableval in + yes) enable_fast_install=yes ;; + no) enable_fast_install=no ;; + *) + enable_fast_install=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_fast_install=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac +else + enable_fast_install=yes +fi @@ -13711,7 +12804,11 @@ esac +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS="$ltmain" +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' @@ -13742,6 +12839,7 @@ esac +test -z "$LN_S" && LN_S="ln -s" @@ -13756,45 +12854,246 @@ esac +if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 +$as_echo_n "checking for objdir... " >&6; } +if ${lt_cv_objdir+:} false; then : + $as_echo_n "(cached) " >&6 +else + rm -f .libs 2>/dev/null +mkdir .libs 2>/dev/null +if test -d .libs; then + lt_cv_objdir=.libs +else + # MS-DOS does not allow filenames that begin with a dot. + lt_cv_objdir=_libs +fi +rmdir .libs 2>/dev/null +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 +$as_echo "$lt_cv_objdir" >&6; } +objdir=$lt_cv_objdir +cat >>confdefs.h <<_ACEOF +#define LT_OBJDIR "$lt_cv_objdir/" +_ACEOF +case $host_os in +aix3*) + # AIX sometimes has problems with the GCC collect2 program. For some + # reason, if we set the COLLECT_NAMES environment variable, the problems + # vanish in a puff of smoke. + if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES + fi + ;; +esac +# Global variables: +ofile=libtool +can_build_shared=yes +# All known linkers require a `.a' archive for static linking (except MSVC, +# which needs '.lib'). +libext=a +with_gnu_ld="$lt_cv_prog_gnu_ld" +old_CC="$CC" +old_CFLAGS="$CFLAGS" +# Set sane defaults for various variables +test -z "$CC" && CC=cc +test -z "$LTCC" && LTCC=$CC +test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS +test -z "$LD" && LD=ld +test -z "$ac_objext" && ac_objext=o +for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` +# Only perform the check for file, if the check method requires it +test -z "$MAGIC_CMD" && MAGIC_CMD=file +case $deplibs_check_method in +file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 +$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } +if ${lt_cv_path_MAGIC_CMD+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $MAGIC_CMD in +[\\/*] | ?:[\\/]*) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" + for ac_dir in $ac_dummy; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/${ac_tool_prefix}file; then + lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <<_LT_EOF 1>&2 +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org +_LT_EOF + fi ;; + esac + fi + break + fi + done + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" + ;; +esac +fi +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 +$as_echo "$MAGIC_CMD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 +$as_echo_n "checking for file... " >&6; } +if ${lt_cv_path_MAGIC_CMD+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $MAGIC_CMD in +[\\/*] | ?:[\\/]*) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" + for ac_dir in $ac_dummy; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/file; then + lt_cv_path_MAGIC_CMD="$ac_dir/file" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <<_LT_EOF 1>&2 +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org +_LT_EOF + fi ;; + esac + fi + break + fi + done + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" + ;; +esac +fi +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 +$as_echo "$MAGIC_CMD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + else + MAGIC_CMD=: + fi +fi + fi + ;; +esac +# Use C for the default configuration in the libtool script +lt_save_CC="$CC" +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +# Source file extension for C test sources. +ac_ext=c +# Object file extension for compiled C test sources. +objext=o +objext=$objext +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;" +# Code to be used in simple link tests +lt_simple_link_test_code='int main(){return(0);}' @@ -13802,771 +13101,522 @@ esac +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} +# Allow CC to be a program name with arguments. +compiler=$CC +# Save the default compiler, since it gets overwritten when the other +# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. +compiler_DEFAULT=$CC +# save warnings/boilerplate of simple test code +ac_outfile=conftest.$ac_objext +echo "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$RM conftest* +ac_outfile=conftest.$ac_objext +echo "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$RM -r conftest* +if test -n "$compiler"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 -$as_echo_n "checking dynamic linker characteristics... " >&6; } +lt_prog_compiler_no_builtin_flag= if test "$GCC" = yes; then - case $host_os in - darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; - *) lt_awk_arg="/^libraries:/" ;; - esac - case $host_os in - mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;; - *) lt_sed_strip_eq="s,=/,/,g" ;; - esac - lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` - case $lt_search_path_spec in - *\;*) - # if the path contains ";" then we assume it to be the separator - # otherwise default to the standard path separator (i.e. ":") - it is - # assumed that no part of a normal pathname contains ";" but that should - # okay in the real world where ";" in dirpaths is itself problematic. - lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` - ;; + case $cc_basename in + nvcc*) + lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; *) - lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` - ;; + lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; esac - # Ok, now we have the path, separated by spaces, we can step through it - # and add multilib dir if necessary. - lt_tmp_lt_search_path_spec= - lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` - for lt_sys_path in $lt_search_path_spec; do - if test -d "$lt_sys_path/$lt_multi_os_dir"; then - lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" - else - test -d "$lt_sys_path" && \ - lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" - fi - done - lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' -BEGIN {RS=" "; FS="/|\n";} { - lt_foo=""; - lt_count=0; - for (lt_i = NF; lt_i > 0; lt_i--) { - if ($lt_i != "" && $lt_i != ".") { - if ($lt_i == "..") { - lt_count++; - } else { - if (lt_count == 0) { - lt_foo="/" $lt_i lt_foo; - } else { - lt_count--; - } - } - } - } - if (lt_foo != "") { lt_freq[lt_foo]++; } - if (lt_freq[lt_foo] == 1) { print lt_foo; } -}'` - # AWK program above erroneously prepends '/' to C:/dos/paths - # for these hosts. - case $host_os in - mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ - $SED 's,/\([A-Za-z]:\),\1,g'` ;; - esac - sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 +$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } +if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then : + $as_echo_n "(cached) " >&6 else - sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" + lt_cv_prog_compiler_rtti_exceptions=no + ac_outfile=conftest.$ac_objext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="-fno-rtti -fno-exceptions" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_rtti_exceptions=yes + fi + fi + $RM conftest* + fi -library_names_spec= -libname_spec='lib$name' -soname_spec= -shrext_cmds=".so" -postinstall_cmds= -postuninstall_cmds= -finish_cmds= -finish_eval= -shlibpath_var= -shlibpath_overrides_runpath=unknown -version_type=none -dynamic_linker="$host_os ld.so" -sys_lib_dlsearch_path_spec="/lib /usr/lib" -need_lib_prefix=unknown -hardcode_into_libs=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 +$as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } -# when you set need_version to no, make sure it does not cause -set_version -# flags to be left without arguments -need_version=unknown +if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then + lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" +else + : +fi -case $host_os in -aix3*) - version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' - shlibpath_var=LIBPATH +fi - # AIX 3 has no versioning support, so we append a major version to the name. - soname_spec='${libname}${release}${shared_ext}$major' - ;; -aix[4-9]*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - hardcode_into_libs=yes - if test "$host_cpu" = ia64; then - # AIX 5 supports IA64 - library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - else - # With GCC up to 2.95.x, collect2 would create an import file - # for dependence libraries. The import file would start with - # the line `#! .'. This would cause the generated library to - # depend on `.', always an invalid library. This was fixed in - # development snapshots of GCC prior to 3.0. - case $host_os in - aix4 | aix4.[01] | aix4.[01].*) - if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' - echo ' yes ' - echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then - : - else - can_build_shared=no - fi - ;; - esac - # AIX (on Power*) has no versioning support, so currently we can not hardcode correct - # soname into executable. Probably we can add versioning support to - # collect2, so additional links can be useful in future. - if test "$aix_use_runtimelinking" = yes; then - # If using run time linking (on AIX 4.2 or later) use lib.so - # instead of lib.a to let people know that these are not - # typical AIX shared libraries. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - else - # We preserve .a as extension for shared libraries through AIX4.2 - # and later when we are not doing run time linking. - library_names_spec='${libname}${release}.a $libname.a' - soname_spec='${libname}${release}${shared_ext}$major' - fi - shlibpath_var=LIBPATH - fi - ;; -amigaos*) - case $host_cpu in - powerpc) - # Since July 2007 AmigaOS4 officially supports .so libraries. - # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - ;; - m68k) - library_names_spec='$libname.ixlibrary $libname.a' - # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' - ;; - esac - ;; -beos*) - library_names_spec='${libname}${shared_ext}' - dynamic_linker="$host_os ld.so" - shlibpath_var=LIBRARY_PATH - ;; -bsdi[45]*) - version_type=linux # correct to gnu/linux during the next big refactor - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" - sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" - # the default ld.so.conf also contains /usr/contrib/lib and - # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow - # libtool to hard-code these into programs - ;; -cygwin* | mingw* | pw32* | cegcc*) - version_type=windows - shrext_cmds=".dll" - need_version=no - need_lib_prefix=no + lt_prog_compiler_wl= +lt_prog_compiler_pic= +lt_prog_compiler_static= - case $GCC,$cc_basename in - yes,*) - # gcc - library_names_spec='$libname.dll.a' - # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \${file}`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog $dir/$dlname \$dldir/$dlname~ - chmod a+x \$dldir/$dlname~ - if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then - eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; - fi' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ - dlpath=$dir/\$dldll~ - $RM \$dlpath' - shlibpath_overrides_runpath=yes + + if test "$GCC" = yes; then + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_static='-static' case $host_os in - cygwin*) - # Cygwin DLLs use 'cyg' prefix rather than 'lib' - soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static='-Bstatic' + fi + ;; - sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + lt_prog_compiler_pic='-fPIC' + ;; + m68k) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' + ;; + esac ;; - mingw* | cegcc*) - # MinGW DLLs use traditional 'lib' prefix - soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. ;; - pw32*) - # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + lt_prog_compiler_pic='-DDLL_EXPORT' ;; - esac - dynamic_linker='Win32 ld.exe' - ;; - *,cl*) - # Native MSVC - libname_spec='$name' - soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - library_names_spec='${libname}.dll.lib' - - case $build_os in - mingw*) - sys_lib_search_path_spec= - lt_save_ifs=$IFS - IFS=';' - for lt_path in $LIB - do - IFS=$lt_save_ifs - # Let DOS variable expansion print the short 8.3 style file name. - lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` - sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" - done - IFS=$lt_save_ifs - # Convert to MSYS style. - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic='-fno-common' ;; - cygwin*) - # Convert to unix form, then to dos form, then back to unix form - # but this time dos style (no spaces!) so that the unix form looks - # like /cygdrive/c/PROGRA~1:/cygdr... - sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` - sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` - sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + lt_prog_compiler_static= ;; - *) - sys_lib_search_path_spec="$LIB" - if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then - # It is most probably a Windows format PATH. - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi - # FIXME: find the short name or the path components, as spaces are - # common. (e.g. "Program Files" -> "PROGRA~1") + + hpux*) + # PIC is the default for 64-bit PA HP-UX, but not for 32-bit + # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + case $host_cpu in + hppa*64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac ;; - esac - # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \${file}`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog $dir/$dlname \$dldir/$dlname' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ - dlpath=$dir/\$dldll~ - $RM \$dlpath' - shlibpath_overrides_runpath=yes - dynamic_linker='Win32 link.exe' - ;; + interix[3-9]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; - *) - # Assume MSVC wrapper - library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' - dynamic_linker='Win32 ld.exe' - ;; - esac - # FIXME: first we should search . and the directory the executable is in - shlibpath_var=PATH - ;; + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + lt_prog_compiler_can_build_shared=no + enable_shared=no + ;; -darwin* | rhapsody*) - dynamic_linker="$host_os dyld" - version_type=darwin - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' - soname_spec='${libname}${release}${major}$shared_ext' - shlibpath_overrides_runpath=yes - shlibpath_var=DYLD_LIBRARY_PATH - shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic='-fPIC -shared' + ;; - sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" - sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' - ;; + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic=-Kconform_pic + fi + ;; -dgux*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - ;; + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac -freebsd* | dragonfly*) - # DragonFly does not have aout. When/if they implement a new - # versioning mechanism, adjust this. - if test -x /usr/bin/objformat; then - objformat=`/usr/bin/objformat` + case $cc_basename in + nvcc*) # Cuda Compiler Driver 2.2 + lt_prog_compiler_wl='-Xlinker ' + if test -n "$lt_prog_compiler_pic"; then + lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" + fi + ;; + esac else + # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in - freebsd[23].*) objformat=aout ;; - *) objformat=elf ;; - esac - fi - version_type=freebsd-$objformat - case $version_type in - freebsd-elf*) - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' - need_version=no - need_lib_prefix=no + aix*) + lt_prog_compiler_wl='-Wl,' + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static='-Bstatic' + else + lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' + fi ;; - freebsd-*) - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' - need_version=yes + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic='-DDLL_EXPORT' ;; - esac - shlibpath_var=LD_LIBRARY_PATH - case $host_os in - freebsd2.*) - shlibpath_overrides_runpath=yes - ;; - freebsd3.[01]* | freebsdelf3.[01]*) - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ - freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - *) # from 4.6 on, and DragonFly - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - esac - ;; -gnu*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; + hpux9* | hpux10* | hpux11*) + lt_prog_compiler_wl='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + lt_prog_compiler_static='${wl}-a ${wl}archive' + ;; -haiku*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - dynamic_linker="$host_os runtime_loader" - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LIBRARY_PATH - shlibpath_overrides_runpath=yes - sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' - hardcode_into_libs=yes - ;; + irix5* | irix6* | nonstopux*) + lt_prog_compiler_wl='-Wl,' + # PIC (with -KPIC) is the default. + lt_prog_compiler_static='-non_shared' + ;; -hpux9* | hpux10* | hpux11*) - # Give a soname corresponding to the major version so that dld.sl refuses to - # link against other versions. - version_type=sunos - need_lib_prefix=no - need_version=no - case $host_cpu in - ia64*) - shrext_cmds='.so' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.so" - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - if test "X$HPUX_IA64_MODE" = X32; then - sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" - else - sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" - fi - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - hppa*64*) - shrext_cmds='.sl' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.sl" - shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - *) - shrext_cmds='.sl' - dynamic_linker="$host_os dld.sl" - shlibpath_var=SHLIB_PATH - shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - ;; - esac - # HP-UX runs *really* slowly unless shared libraries are mode 555, ... - postinstall_cmds='chmod 555 $lib' - # or fails outright, so override atomically: - install_override_mode=555 - ;; + linux* | k*bsd*-gnu | kopensolaris*-gnu) + case $cc_basename in + # old Intel for x86_64 which still supported -KPIC. + ecc*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-static' + ;; + # icc used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + icc* | ifort*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; + # Lahey Fortran 8.1. + lf95*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='--shared' + lt_prog_compiler_static='--static' + ;; + nagfor*) + # NAG Fortran compiler + lt_prog_compiler_wl='-Wl,-Wl,,' + lt_prog_compiler_pic='-PIC' + lt_prog_compiler_static='-Bstatic' + ;; + pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fpic' + lt_prog_compiler_static='-Bstatic' + ;; + ccc*) + lt_prog_compiler_wl='-Wl,' + # All Alpha code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + xl* | bgxl* | bgf* | mpixl*) + # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-qpic' + lt_prog_compiler_static='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) + # Sun Fortran 8.3 passes all unrecognized flags to the linker + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='' + ;; + *Sun\ F* | *Sun*Fortran*) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='-Qoption ld ' + ;; + *Sun\ C*) + # Sun C 5.9 + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='-Wl,' + ;; + *Intel*\ [CF]*Compiler*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; + *Portland\ Group*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fpic' + lt_prog_compiler_static='-Bstatic' + ;; + esac + ;; + esac + ;; -interix[3-9]*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; + newsos6) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; -irix5* | irix6* | nonstopux*) - case $host_os in - nonstopux*) version_type=nonstopux ;; - *) - if test "$lt_cv_prog_gnu_ld" = yes; then - version_type=linux # correct to gnu/linux during the next big refactor - else - version_type=irix - fi ;; - esac - need_lib_prefix=no - need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' - case $host_os in - irix5* | nonstopux*) - libsuff= shlibsuff= - ;; - *) - case $LD in # libtool.m4 will add one of these switches to LD - *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") - libsuff= shlibsuff= libmagic=32-bit;; - *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") - libsuff=32 shlibsuff=N32 libmagic=N32;; - *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") - libsuff=64 shlibsuff=64 libmagic=64-bit;; - *) libsuff= shlibsuff= libmagic=never-match;; - esac - ;; - esac - shlibpath_var=LD_LIBRARY${shlibsuff}_PATH - shlibpath_overrides_runpath=no - sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" - sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" - hardcode_into_libs=yes - ;; + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic='-fPIC -shared' + ;; -# No shared lib support for Linux oldld, aout, or coff. -linux*oldld* | linux*aout* | linux*coff*) - dynamic_linker=no - ;; + osf3* | osf4* | osf5*) + lt_prog_compiler_wl='-Wl,' + # All OSF/1 code is PIC. + lt_prog_compiler_static='-non_shared' + ;; -# This must be glibc/ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no + rdos*) + lt_prog_compiler_static='-non_shared' + ;; - # Some binutils ld are patched to set DT_RUNPATH - if ${lt_cv_shlibpath_overrides_runpath+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_shlibpath_overrides_runpath=no - save_LDFLAGS=$LDFLAGS - save_libdir=$libdir - eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ - LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + solaris*) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + case $cc_basename in + f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) + lt_prog_compiler_wl='-Qoption ld ';; + *) + lt_prog_compiler_wl='-Wl,';; + esac + ;; -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus - extern "C" -# endif - int FC_DUMMY_MAIN() { return 1; } -#endif -#endif -int -main () -{ + sunos4*) + lt_prog_compiler_wl='-Qoption ld ' + lt_prog_compiler_pic='-PIC' + lt_prog_compiler_static='-Bstatic' + ;; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : - lt_cv_shlibpath_overrides_runpath=yes -fi -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - LDFLAGS=$save_LDFLAGS - libdir=$save_libdir + sysv4 | sysv4.2uw2* | sysv4.3*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; -fi + sysv4*MP*) + if test -d /usr/nec ;then + lt_prog_compiler_pic='-Kconform_pic' + lt_prog_compiler_static='-Bstatic' + fi + ;; - shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; - # This implies no fast_install, which is unacceptable. - # Some rework will be needed to allow for fast_install - # before this can be enabled. - hardcode_into_libs=yes + unicos*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_can_build_shared=no + ;; - # Append ld.so.conf contents to the search path - if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` - sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + uts4*) + lt_prog_compiler_pic='-pic' + lt_prog_compiler_static='-Bstatic' + ;; + + *) + lt_prog_compiler_can_build_shared=no + ;; + esac fi - # We used to test for /lib/ld.so.1 and disable shared libraries on - # powerpc, because MkLinux only supported shared libraries with the - # GNU dynamic linker. Since this was broken with cross compilers, - # most powerpc-linux boxes support dynamic linking these days and - # people can always --disable-shared, the test was removed, and we - # assume the GNU/Linux dynamic linker is in use. - dynamic_linker='GNU/Linux ld.so' - ;; +case $host_os in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + lt_prog_compiler_pic= + ;; + *) + lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" + ;; +esac -netbsd*) - version_type=sunos - need_lib_prefix=no - need_version=no - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - dynamic_linker='NetBSD (a.out) ld.so' - else - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - dynamic_linker='NetBSD ld.elf_so' - fi - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 +$as_echo_n "checking for $compiler option to produce PIC... " >&6; } +if ${lt_cv_prog_compiler_pic+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_pic=$lt_prog_compiler_pic +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 +$as_echo "$lt_cv_prog_compiler_pic" >&6; } +lt_prog_compiler_pic=$lt_cv_prog_compiler_pic -newsos6) - version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 +$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } +if ${lt_cv_prog_compiler_pic_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_pic_works=no + ac_outfile=conftest.$ac_objext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic -DPIC" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_pic_works=yes + fi + fi + $RM conftest* -*nto* | *qnx*) - version_type=qnx - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='ldqnx.so' - ;; +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 +$as_echo "$lt_cv_prog_compiler_pic_works" >&6; } -openbsd*) - version_type=sunos - sys_lib_dlsearch_path_spec="/usr/lib" - need_lib_prefix=no - # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. - case $host_os in - openbsd3.3 | openbsd3.3.*) need_version=yes ;; - *) need_version=no ;; - esac - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - shlibpath_var=LD_LIBRARY_PATH - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - case $host_os in - openbsd2.[89] | openbsd2.[89].*) - shlibpath_overrides_runpath=no - ;; - *) - shlibpath_overrides_runpath=yes - ;; - esac - else - shlibpath_overrides_runpath=yes - fi - ;; +if test x"$lt_cv_prog_compiler_pic_works" = xyes; then + case $lt_prog_compiler_pic in + "" | " "*) ;; + *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; + esac +else + lt_prog_compiler_pic= + lt_prog_compiler_can_build_shared=no +fi -os2*) - libname_spec='$name' - shrext_cmds=".dll" - need_lib_prefix=no - library_names_spec='$libname${shared_ext} $libname.a' - dynamic_linker='OS/2 ld.exe' - shlibpath_var=LIBPATH - ;; +fi -osf3* | osf4* | osf5*) - version_type=osf - need_lib_prefix=no - need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" - sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" - ;; -rdos*) - dynamic_linker=no - ;; -solaris*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - # ldd complains unless libraries are executable - postinstall_cmds='chmod +x $lib' - ;; -sunos4*) - version_type=sunos - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - if test "$with_gnu_ld" = yes; then - need_lib_prefix=no - fi - need_version=yes - ;; -sysv4 | sysv4.3*) - version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - case $host_vendor in - sni) - shlibpath_overrides_runpath=no - need_lib_prefix=no - runpath_var=LD_RUN_PATH - ;; - siemens) - need_lib_prefix=no - ;; - motorola) - need_lib_prefix=no - need_version=no - shlibpath_overrides_runpath=no - sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' - ;; - esac - ;; -sysv4*MP*) - if test -d /usr/nec ;then - version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' - soname_spec='$libname${shared_ext}.$major' - shlibpath_var=LD_LIBRARY_PATH - fi - ;; -sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) - version_type=freebsd-elf - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - if test "$with_gnu_ld" = yes; then - sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' - else - sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' - case $host_os in - sco3.2v5*) - sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" - ;; - esac - fi - sys_lib_dlsearch_path_spec='/usr/lib' - ;; -tpf*) - # TPF is a cross-target only. Preferred cross-host = GNU/Linux. - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; -uts4*) - version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - ;; -*) - dynamic_linker=no - ;; -esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 -$as_echo "$dynamic_linker" >&6; } -test "$dynamic_linker" = no && can_build_shared=no -variables_saved_for_relink="PATH $shlibpath_var $runpath_var" -if test "$GCC" = yes; then - variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" -fi +# +# Check to make sure the static flag actually works. +# +wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } +if ${lt_cv_prog_compiler_static_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_static_works=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $lt_tmp_static_flag" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_static_works=yes + fi + else + lt_cv_prog_compiler_static_works=yes + fi + fi + $RM -r conftest* + LDFLAGS="$save_LDFLAGS" -if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then - sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" -fi -if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then - sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 +$as_echo "$lt_cv_prog_compiler_static_works" >&6; } +if test x"$lt_cv_prog_compiler_static_works" = xyes; then + : +else + lt_prog_compiler_static= +fi @@ -14574,177 +13624,632 @@ fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if ${lt_cv_prog_compiler_c_o+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_c_o=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 +$as_echo "$lt_cv_prog_compiler_c_o" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if ${lt_cv_prog_compiler_c_o+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_c_o=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 +$as_echo "$lt_cv_prog_compiler_c_o" >&6; } +hard_links="nottested" +if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 +$as_echo_n "checking if we can lock with hard links... " >&6; } + hard_links=yes + $RM conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 +$as_echo "$hard_links" >&6; } + if test "$hard_links" = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 +$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} + need_locks=warn + fi +else + need_locks=no +fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } + runpath_var= + allow_undefined_flag= + always_export_symbols=no + archive_cmds= + archive_expsym_cmds= + compiler_needs_object=no + enable_shared_with_static_runtimes=no + export_dynamic_flag_spec= + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + hardcode_automatic=no + hardcode_direct=no + hardcode_direct_absolute=no + hardcode_libdir_flag_spec= + hardcode_libdir_separator= + hardcode_minus_L=no + hardcode_shlibpath_var=unsupported + inherit_rpath=no + link_all_deplibs=unknown + module_cmds= + module_expsym_cmds= + old_archive_from_new_cmds= + old_archive_from_expsyms_cmds= + thread_safe_flag_spec= + whole_archive_flag_spec= + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + include_expsyms= + # exclude_expsyms can be an extended regexp of symbols to exclude + # it will be wrapped by ` (' and `)$', so one must not match beginning or + # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', + # as well as any symbol that contains `d'. + exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' + # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out + # platforms (ab)use it in PIC code, but their linkers get confused if + # the symbol is explicitly referenced. Since portable code cannot + # rely on this symbol name, it's probably fine to never include it in + # preloaded symbol tables. + # Exclude shared library initialization/finalization symbols. + extract_expsyms_cmds= + case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd*) + with_gnu_ld=no + ;; + esac + ld_shlibs=yes + # On some targets, GNU ld is compatible enough with the native linker + # that we're better off using the native interface for both. + lt_use_gnu_ld_interface=no + if test "$with_gnu_ld" = yes; then + case $host_os in + aix*) + # The AIX port of GNU ld has always aspired to compatibility + # with the native linker. However, as the warning in the GNU ld + # block says, versions before 2.19.5* couldn't really create working + # shared libraries, regardless of the interface used. + case `$LD -v 2>&1` in + *\ \(GNU\ Binutils\)\ 2.19.5*) ;; + *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; + *\ \(GNU\ Binutils\)\ [3-9]*) ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + fi + if test "$lt_use_gnu_ld_interface" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + export_dynamic_flag_spec='${wl}--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + whole_archive_flag_spec= + fi + supports_anon_versioning=no + case `$LD -v 2>&1` in + *GNU\ gold*) supports_anon_versioning=yes ;; + *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + # See if GNU ld supports shared libraries. + case $host_os in + aix[3-9]*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + ld_shlibs=no + cat <<_LT_EOF 1>&2 +*** Warning: the GNU linker, at least up to release 2.19, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to install binutils +*** 2.20 or above, or modify your PATH so that a non-GNU linker is found. +*** You will then need to restart the configuration process. +_LT_EOF + fi + ;; + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='' + ;; + m68k) + archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + ;; + esac + ;; + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + ld_shlibs=no + fi + ;; + cygwin* | mingw* | pw32* | cegcc*) + # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec='-L$libdir' + export_dynamic_flag_spec='${wl}--export-all-symbols' + allow_undefined_flag=unsupported + always_export_symbols=no + enable_shared_with_static_runtimes=yes + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' + exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs=no + fi + ;; + haiku*) + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + link_all_deplibs=yes + ;; + interix[3-9]*) + hardcode_direct=no + hardcode_shlibpath_var=no + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + export_dynamic_flag_spec='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) + tmp_diet=no + if test "$host_os" = linux-dietlibc; then + case $cc_basename in + diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) + esac + fi + if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ + && test "$tmp_diet" = no + then + tmp_addflag=' $pic_flag' + tmp_sharedflag='-shared' + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group f77 and f90 compilers + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + lf95*) # Lahey Fortran 8.1 + whole_archive_flag_spec= + tmp_sharedflag='--shared' ;; + xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) + tmp_sharedflag='-qmkshrobj' + tmp_addflag= ;; + nvcc*) # Cuda Compiler Driver 2.2 + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + compiler_needs_object=yes + ;; + esac + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) # Sun C 5.9 + whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + compiler_needs_object=yes + tmp_sharedflag='-G' ;; + *Sun\ F*) # Sun Fortran 8.3 + tmp_sharedflag='-G' ;; + esac + archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + if test "x$supports_anon_versioning" = xyes; then + archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + case $cc_basename in + xlf* | bgf* | bgxlf* | mpixlf*) + # IBM XL Fortran 10.1 on PPC cannot create shared libs itself + whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' + if test "x$supports_anon_versioning" = xyes; then + archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + fi + ;; + esac + else + ld_shlibs=no + fi + ;; + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + solaris*) + if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then + ld_shlibs=no + cat <<_LT_EOF 1>&2 +*** Warning: The releases 2.8.* of the GNU linker cannot reliably +*** create shared libraries on Solaris systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.9.1 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. +_LT_EOF + elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) + ld_shlibs=no + cat <<_LT_EOF 1>&2 +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. +_LT_EOF + ;; + *) + # For security reasons, it is highly recommended that you always + # use absolute paths for naming shared libraries, and exclude the + # DT_RUNPATH tag from executables and libraries. But doing so + # requires that you compile everything twice, which is a pain. + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + esac + ;; + sunos4*) + archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + *) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + esac - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 -$as_echo_n "checking how to hardcode library paths into programs... " >&6; } -hardcode_action= -if test -n "$hardcode_libdir_flag_spec" || - test -n "$runpath_var" || - test "X$hardcode_automatic" = "Xyes" ; then - - # We can hardcode non-existent directories. - if test "$hardcode_direct" != no && - # If the only mechanism to avoid hardcoding is shlibpath_var, we - # have to relink, otherwise we might link with an installed library - # when we should be linking with a yet-to-be-installed one - ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no && - test "$hardcode_minus_L" != no; then - # Linking always hardcodes the temporary library directory. - hardcode_action=relink + if test "$ld_shlibs" = no; then + runpath_var= + hardcode_libdir_flag_spec= + export_dynamic_flag_spec= + whole_archive_flag_spec= + fi else - # We can link without hardcoding, and we can hardcode nonexisting dirs. - hardcode_action=immediate - fi -else - # We cannot hardcode anything, or else we can only hardcode existing - # directories. - hardcode_action=unsupported -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 -$as_echo "$hardcode_action" >&6; } + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + allow_undefined_flag=unsupported + always_export_symbols=yes + archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + hardcode_minus_L=yes + if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + hardcode_direct=unsupported + fi + ;; -if test "$hardcode_action" = relink || - test "$inherit_rpath" = yes; then - # Fast installation is not supported - enable_fast_install=no -elif test "$shlibpath_overrides_runpath" = yes || - test "$enable_shared" = no; then - # Fast installation is not necessary - enable_fast_install=needless -fi + aix[4-9]*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + # Also, AIX nm treats weak defined symbols like other global + # defined symbols, whereas GNU nm marks them as "W". + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + ;; + esac + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + archive_cmds='' + hardcode_direct=yes + hardcode_direct_absolute=yes + hardcode_libdir_separator=':' + link_all_deplibs=yes + file_list_spec='${wl}-f,' + if test "$GCC" = yes; then + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && + strings "$collect2name" | $GREP resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + hardcode_direct=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + hardcode_minus_L=yes + hardcode_libdir_flag_spec='-L$libdir' + hardcode_libdir_separator= + fi + ;; + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi - if test "x$enable_dlopen" != xyes; then - enable_dlopen=unknown - enable_dlopen_self=unknown - enable_dlopen_self_static=unknown + export_dynamic_flag_spec='${wl}-bexpall' + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + always_export_symbols=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + allow_undefined_flag='-berok' + # Determine the default libpath from the value encoded in an + # empty executable. + if test "${lt_cv_aix_libpath+set}" = set; then + aix_libpath=$lt_cv_aix_libpath else - lt_cv_dlopen=no - lt_cv_dlopen_libs= - - case $host_os in - beos*) - lt_cv_dlopen="load_add_on" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes - ;; - - mingw* | pw32* | cegcc*) - lt_cv_dlopen="LoadLibrary" - lt_cv_dlopen_libs= - ;; - - cygwin*) - lt_cv_dlopen="dlopen" - lt_cv_dlopen_libs= - ;; - - darwin*) - # if libdl is installed we need to link against it - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 -$as_echo_n "checking for dlopen in -ldl... " >&6; } -if ${ac_cv_lib_dl_dlopen+:} false; then : + if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldl $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dlopen (); #ifdef FC_DUMMY_MAIN #ifndef FC_DUMMY_MAIN_EQ_F77 # ifdef __cplusplus @@ -14756,107 +14261,56 @@ char dlopen (); int main () { -return dlopen (); + ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_dl_dlopen=yes -else - ac_cv_lib_dl_dlopen=no + + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 -$as_echo "$ac_cv_lib_dl_dlopen" >&6; } -if test "x$ac_cv_lib_dl_dlopen" = xyes; then : - lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" -else - - lt_cv_dlopen="dyld" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_="/usr/lib:/lib" + fi fi - ;; + aix_libpath=$lt_cv_aix_libpath_ +fi - *) - ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" -if test "x$ac_cv_func_shl_load" = xyes; then : - lt_cv_dlopen="shl_load" -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 -$as_echo_n "checking for shl_load in -ldld... " >&6; } -if ${ac_cv_lib_dld_shl_load+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldld $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char shl_load (); -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus - extern "C" -# endif - int FC_DUMMY_MAIN() { return 1; } -#endif -#endif -int -main () -{ -return shl_load (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_dld_shl_load=yes -else - ac_cv_lib_dld_shl_load=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 -$as_echo "$ac_cv_lib_dld_shl_load" >&6; } -if test "x$ac_cv_lib_dld_shl_load" = xyes; then : - lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" -else - ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" -if test "x$ac_cv_func_dlopen" = xyes; then : - lt_cv_dlopen="dlopen" + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' + allow_undefined_flag="-z nodefs" + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + if test "${lt_cv_aix_libpath+set}" = set; then + aix_libpath=$lt_cv_aix_libpath else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 -$as_echo_n "checking for dlopen in -ldl... " >&6; } -if ${ac_cv_lib_dl_dlopen+:} false; then : + if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldl $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dlopen (); #ifdef FC_DUMMY_MAIN #ifndef FC_DUMMY_MAIN_EQ_F77 # ifdef __cplusplus @@ -14868,858 +14322,728 @@ char dlopen (); int main () { -return dlopen (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_dl_dlopen=yes -else - ac_cv_lib_dl_dlopen=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 -$as_echo "$ac_cv_lib_dl_dlopen" >&6; } -if test "x$ac_cv_lib_dl_dlopen" = xyes; then : - lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 -$as_echo_n "checking for dlopen in -lsvld... " >&6; } -if ${ac_cv_lib_svld_dlopen+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lsvld $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dlopen (); -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus - extern "C" -# endif - int FC_DUMMY_MAIN() { return 1; } -#endif -#endif -int -main () -{ -return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_svld_dlopen=yes -else - ac_cv_lib_svld_dlopen=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 -$as_echo "$ac_cv_lib_svld_dlopen" >&6; } -if test "x$ac_cv_lib_svld_dlopen" = xyes; then : - lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 -$as_echo_n "checking for dld_link in -ldld... " >&6; } -if ${ac_cv_lib_dld_dld_link+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldld $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dld_link (); -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus - extern "C" -# endif - int FC_DUMMY_MAIN() { return 1; } -#endif -#endif -int -main () -{ -return dld_link (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_dld_dld_link=yes -else - ac_cv_lib_dld_dld_link=no + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 -$as_echo "$ac_cv_lib_dld_dld_link" >&6; } -if test "x$ac_cv_lib_dld_dld_link" = xyes; then : - lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" -fi - - -fi - - -fi - - -fi - + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_="/usr/lib:/lib" + fi fi - + aix_libpath=$lt_cv_aix_libpath_ fi - ;; - esac - - if test "x$lt_cv_dlopen" != xno; then - enable_dlopen=yes - else - enable_dlopen=no - fi + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + no_undefined_flag=' ${wl}-bernotok' + allow_undefined_flag=' ${wl}-berok' + if test "$with_gnu_ld" = yes; then + # We only use this code for GNU lds that support --whole-archive. + whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec='$convenience' + fi + archive_cmds_need_lc=yes + # This is similar to how AIX traditionally builds its shared libraries. + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; - case $lt_cv_dlopen in - dlopen) - save_CPPFLAGS="$CPPFLAGS" - test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='' + ;; + m68k) + archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + ;; + esac + ;; - save_LDFLAGS="$LDFLAGS" - wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + bsdi[45]*) + export_dynamic_flag_spec=-rdynamic + ;; - save_LIBS="$LIBS" - LIBS="$lt_cv_dlopen_libs $LIBS" - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 -$as_echo_n "checking whether a program can dlopen itself... " >&6; } -if ${lt_cv_dlopen_self+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : - lt_cv_dlopen_self=cross -else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF -#line $LINENO "configure" -#include "confdefs.h" - -#if HAVE_DLFCN_H -#include -#endif - -#include - -#ifdef RTLD_GLOBAL -# define LT_DLGLOBAL RTLD_GLOBAL -#else -# ifdef DL_GLOBAL -# define LT_DLGLOBAL DL_GLOBAL -# else -# define LT_DLGLOBAL 0 -# endif -#endif + cygwin* | mingw* | pw32* | cegcc*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + case $cc_basename in + cl*) + # Native MSVC + hardcode_libdir_flag_spec=' ' + allow_undefined_flag=unsupported + always_export_symbols=yes + file_list_spec='@' + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' + archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; + else + sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, )='true' + enable_shared_with_static_runtimes=yes + exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' + # Don't use ranlib + old_postinstall_cmds='chmod 644 $oldlib' + postlink_cmds='lt_outputfile="@OUTPUT@"~ + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile="$lt_outputfile.exe" + lt_tool_outputfile="$lt_tool_outputfile.exe" + ;; + esac~ + if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' + ;; + *) + # Assume MSVC wrapper + hardcode_libdir_flag_spec=' ' + allow_undefined_flag=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + old_archive_from_new_cmds='true' + # FIXME: Should let the user specify the lib program. + old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' + enable_shared_with_static_runtimes=yes + ;; + esac + ;; -/* We may have to define LT_DLLAZY_OR_NOW in the command line if we - find out it does not work in some platform. */ -#ifndef LT_DLLAZY_OR_NOW -# ifdef RTLD_LAZY -# define LT_DLLAZY_OR_NOW RTLD_LAZY -# else -# ifdef DL_LAZY -# define LT_DLLAZY_OR_NOW DL_LAZY -# else -# ifdef RTLD_NOW -# define LT_DLLAZY_OR_NOW RTLD_NOW -# else -# ifdef DL_NOW -# define LT_DLLAZY_OR_NOW DL_NOW -# else -# define LT_DLLAZY_OR_NOW 0 -# endif -# endif -# endif -# endif -#endif + darwin* | rhapsody*) -/* When -fvisbility=hidden is used, assume the code has been annotated - correspondingly for the symbols needed. */ -#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) -int fnord () __attribute__((visibility("default"))); -#endif -int fnord () { return 42; } -int main () -{ - void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); - int status = $lt_dlunknown; + archive_cmds_need_lc=no + hardcode_direct=no + hardcode_automatic=yes + hardcode_shlibpath_var=unsupported + if test "$lt_cv_ld_force_load" = "yes"; then + whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' - if (self) - { - if (dlsym (self,"fnord")) status = $lt_dlno_uscore; - else - { - if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; - else puts (dlerror ()); - } - /* dlclose (self); */ - } else - puts (dlerror ()); + whole_archive_flag_spec='' + fi + link_all_deplibs=yes + allow_undefined_flag="$_lt_dar_allow_undefined" + case $cc_basename in + ifort*) _lt_dar_can_shared=yes ;; + *) _lt_dar_can_shared=$GCC ;; + esac + if test "$_lt_dar_can_shared" = "yes"; then + output_verbose_link_cmd=func_echo_all + archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" + module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" + archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" + module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" - return status; -} -_LT_EOF - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 - (eval $ac_link) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then - (./conftest; exit; ) >&5 2>/dev/null - lt_status=$? - case x$lt_status in - x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; - x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; - x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; - esac - else : - # compilation failed - lt_cv_dlopen_self=no + else + ld_shlibs=no fi -fi -rm -fr conftest* + ;; -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 -$as_echo "$lt_cv_dlopen_self" >&6; } + dgux*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; - if test "x$lt_cv_dlopen_self" = xyes; then - wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 -$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } -if ${lt_cv_dlopen_self_static+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : - lt_cv_dlopen_self_static=cross -else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF -#line $LINENO "configure" -#include "confdefs.h" + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; -#if HAVE_DLFCN_H -#include -#endif + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2.*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes + hardcode_minus_L=yes + hardcode_shlibpath_var=no + ;; -#include + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | dragonfly*) + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; -#ifdef RTLD_GLOBAL -# define LT_DLGLOBAL RTLD_GLOBAL -#else -# ifdef DL_GLOBAL -# define LT_DLGLOBAL DL_GLOBAL -# else -# define LT_DLGLOBAL 0 -# endif -#endif + hpux9*) + if test "$GCC" = yes; then + archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + fi + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes -/* We may have to define LT_DLLAZY_OR_NOW in the command line if we - find out it does not work in some platform. */ -#ifndef LT_DLLAZY_OR_NOW -# ifdef RTLD_LAZY -# define LT_DLLAZY_OR_NOW RTLD_LAZY -# else -# ifdef DL_LAZY -# define LT_DLLAZY_OR_NOW DL_LAZY -# else -# ifdef RTLD_NOW -# define LT_DLLAZY_OR_NOW RTLD_NOW -# else -# ifdef DL_NOW -# define LT_DLLAZY_OR_NOW DL_NOW -# else -# define LT_DLLAZY_OR_NOW 0 -# endif -# endif -# endif -# endif -#endif - -/* When -fvisbility=hidden is used, assume the code has been annotated - correspondingly for the symbols needed. */ -#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) -int fnord () __attribute__((visibility("default"))); -#endif - -int fnord () { return 42; } -int main () -{ - void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); - int status = $lt_dlunknown; + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + export_dynamic_flag_spec='${wl}-E' + ;; - if (self) - { - if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + hpux10*) + if test "$GCC" = yes && test "$with_gnu_ld" = no; then + archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else - { - if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; - else puts (dlerror ()); - } - /* dlclose (self); */ - } - else - puts (dlerror ()); + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + hardcode_direct_absolute=yes + export_dynamic_flag_spec='${wl}-E' + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + fi + ;; - return status; -} -_LT_EOF - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 - (eval $ac_link) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then - (./conftest; exit; ) >&5 2>/dev/null - lt_status=$? - case x$lt_status in - x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; - x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; - x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; - esac - else : - # compilation failed - lt_cv_dlopen_self_static=no - fi -fi -rm -fr conftest* + hpux11*) + if test "$GCC" = yes && test "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*) + archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) + archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + # Older versions of the 11.00 compiler do not understand -b yet + # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 +$as_echo_n "checking if $CC understands -b... " >&6; } +if ${lt_cv_prog_compiler__b+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler__b=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -b" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler__b=yes + fi + else + lt_cv_prog_compiler__b=yes + fi + fi + $RM -r conftest* + LDFLAGS="$save_LDFLAGS" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 -$as_echo "$lt_cv_dlopen_self_static" >&6; } - fi - - CPPFLAGS="$save_CPPFLAGS" - LDFLAGS="$save_LDFLAGS" - LIBS="$save_LIBS" - ;; - esac - - case $lt_cv_dlopen_self in - yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; - *) enable_dlopen_self=unknown ;; - esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 +$as_echo "$lt_cv_prog_compiler__b" >&6; } - case $lt_cv_dlopen_self_static in - yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; - *) enable_dlopen_self_static=unknown ;; - esac +if test x"$lt_cv_prog_compiler__b" = xyes; then + archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' +else + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi + ;; + esac + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + case $host_cpu in + hppa*64*|ia64*) + hardcode_direct=no + hardcode_shlibpath_var=no + ;; + *) + hardcode_direct=yes + hardcode_direct_absolute=yes + export_dynamic_flag_spec='${wl}-E' + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + ;; + esac + fi + ;; + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + # Try to use the -exported_symbol ld option, if it does not + # work, assume that -exports_file does not work either and + # implicitly export all symbols. + # This should be the same for all languages, so no per-tag cache variable. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 +$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } +if ${lt_cv_irix_exported_symbol+:} false; then : + $as_echo_n "(cached) " >&6 +else + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int foo (void) { return 0; } +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + lt_cv_irix_exported_symbol=yes +else + lt_cv_irix_exported_symbol=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS="$save_LDFLAGS" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 +$as_echo "$lt_cv_irix_exported_symbol" >&6; } + if test "$lt_cv_irix_exported_symbol" = yes; then + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' + fi + else + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' + fi + archive_cmds_need_lc='no' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + inherit_rpath=yes + link_all_deplibs=yes + ;; + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + newsos6) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_shlibpath_var=no + ;; + *nto* | *qnx*) + ;; + openbsd*) + if test -f /usr/libexec/ld.so; then + hardcode_direct=yes + hardcode_shlibpath_var=no + hardcode_direct_absolute=yes + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + export_dynamic_flag_spec='${wl}-E' + else + case $host_os in + openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-R$libdir' + ;; + *) + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + ;; + esac + fi + else + ld_shlibs=no + fi + ;; + + os2*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + allow_undefined_flag=unsupported + archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + ;; + osf3*) + if test "$GCC" = yes; then + allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + fi + archive_cmds_need_lc='no' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + ;; + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ + $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' + # Both c and cxx compiler support -rpath directly + hardcode_libdir_flag_spec='-rpath $libdir' + fi + archive_cmds_need_lc='no' + hardcode_libdir_separator=: + ;; + solaris*) + no_undefined_flag=' -z defs' + if test "$GCC" = yes; then + wlarc='${wl}' + archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + else + case `$CC -V 2>&1` in + *"Compilers 5.0"*) + wlarc='' + archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' + ;; + *) + wlarc='${wl}' + archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + ;; + esac + fi + hardcode_libdir_flag_spec='-R$libdir' + hardcode_shlibpath_var=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands `-z linker_flag'. GCC discards it without `$wl', + # but is careful enough not to reorder. + # Supported since Solaris 2.6 (maybe 2.5.1?) + if test "$GCC" = yes; then + whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + else + whole_archive_flag_spec='-z allextract$convenience -z defaultextract' + fi + ;; + esac + link_all_deplibs=yes + ;; + sunos4*) + if test "x$host_vendor" = xsequent; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + hardcode_libdir_flag_spec='-L$libdir' + hardcode_direct=yes + hardcode_minus_L=yes + hardcode_shlibpath_var=no + ;; + sysv4) + case $host_vendor in + sni) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' + reload_cmds='$CC -r -o $output$reload_objs' + hardcode_direct=no + ;; + motorola) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + hardcode_shlibpath_var=no + ;; + sysv4.3*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + export_dynamic_flag_spec='-Bexport' + ;; + sysv4*MP*) + if test -d /usr/nec; then + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + ld_shlibs=yes + fi + ;; -striplib= -old_striplib= -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 -$as_echo_n "checking whether stripping libraries is possible... " >&6; } -if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then - test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" - test -z "$striplib" && striplib="$STRIP --strip-unneeded" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else -# FIXME - insert some real tests, host_os isn't really good enough - case $host_os in - darwin*) - if test -n "$STRIP" ; then - striplib="$STRIP -x" - old_striplib="$STRIP -S" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - fi - ;; - *) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - ;; - esac -fi - - - - - - - - - + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) + no_undefined_flag='${wl}-z,text' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no + runpath_var='LD_RUN_PATH' + if test "$GCC" = yes; then + archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + no_undefined_flag='${wl}-z,text' + allow_undefined_flag='${wl}-z,nodefs' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no + hardcode_libdir_flag_spec='${wl}-R,$libdir' + hardcode_libdir_separator=':' + link_all_deplibs=yes + export_dynamic_flag_spec='${wl}-Bexport' + runpath_var='LD_RUN_PATH' - # Report which library types will actually be built - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 -$as_echo_n "checking if libtool supports shared libraries... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 -$as_echo "$can_build_shared" >&6; } + if test "$GCC" = yes; then + archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 -$as_echo_n "checking whether to build shared libraries... " >&6; } - test "$can_build_shared" = "no" && enable_shared=no + uts4*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; - # On AIX, shared libraries and static libraries use the same namespace, and - # are all built from PIC. - case $host_os in - aix3*) - test "$enable_shared" = yes && enable_static=no - if test -n "$RANLIB"; then - archive_cmds="$archive_cmds~\$RANLIB \$lib" - postinstall_cmds='$RANLIB $lib' - fi - ;; + *) + ld_shlibs=no + ;; + esac - aix[4-9]*) - if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then - test "$enable_shared" = yes && enable_static=no + if test x$host_vendor = xsni; then + case $host in + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + export_dynamic_flag_spec='${wl}-Blargedynsym' + ;; + esac fi - ;; - esac - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 -$as_echo "$enable_shared" >&6; } - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 -$as_echo_n "checking whether to build static libraries... " >&6; } - # Make sure either enable_shared or enable_static is yes. - test "$enable_shared" = yes || enable_static=yes - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 -$as_echo "$enable_static" >&6; } + fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 +$as_echo "$ld_shlibs" >&6; } +test "$ld_shlibs" = no && can_build_shared=no +with_gnu_ld=$with_gnu_ld -fi -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -CC="$lt_save_CC" - if test -n "$CXX" && ( test "X$CXX" != "Xno" && - ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || - (test "X$CXX" != "Xg++"))) ; then - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5 -$as_echo_n "checking how to run the C++ preprocessor... " >&6; } -if test -z "$CXXCPP"; then - if ${ac_cv_prog_CXXCPP+:} false; then : - $as_echo_n "(cached) " >&6 -else - # Double quotes because CXXCPP needs to be expanded - for CXXCPP in "$CXX -E" "/lib/cpp" - do - ac_preproc_ok=false -for ac_cxx_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if ac_fn_cxx_try_cpp "$LINENO"; then : -else - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.i conftest.$ac_ext - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if ac_fn_cxx_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue -else - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.i conftest.$ac_ext -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : - break -fi - done - ac_cv_prog_CXXCPP=$CXXCPP -fi - CXXCPP=$ac_cv_prog_CXXCPP -else - ac_cv_prog_CXXCPP=$CXXCPP -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5 -$as_echo "$CXXCPP" >&6; } -ac_preproc_ok=false -for ac_cxx_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if ac_fn_cxx_try_cpp "$LINENO"; then : -else - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.i conftest.$ac_ext - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if ac_fn_cxx_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue -else - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.i conftest.$ac_ext -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check -See \`config.log' for more details" "$LINENO" 5; } -fi -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu +# +# Do we need to explicitly link libc? +# +case "x$archive_cmds_need_lc" in +x|xyes) + # Assume -lc should be added + archive_cmds_need_lc=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $archive_cmds in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 +$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } +if ${lt_cv_archive_cmds_need_lc+:} false; then : + $as_echo_n "(cached) " >&6 else - _lt_caught_CXX_error=yes + $RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl + pic_flag=$lt_prog_compiler_pic + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag + allow_undefined_flag= + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 + (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + then + lt_cv_archive_cmds_need_lc=no + else + lt_cv_archive_cmds_need_lc=yes + fi + allow_undefined_flag=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 +$as_echo "$lt_cv_archive_cmds_need_lc" >&6; } + archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc + ;; + esac + fi + ;; +esac -ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -archive_cmds_need_lc_CXX=no -allow_undefined_flag_CXX= -always_export_symbols_CXX=no -archive_expsym_cmds_CXX= -compiler_needs_object_CXX=no -export_dynamic_flag_spec_CXX= -hardcode_direct_CXX=no -hardcode_direct_absolute_CXX=no -hardcode_libdir_flag_spec_CXX= -hardcode_libdir_separator_CXX= -hardcode_minus_L_CXX=no -hardcode_shlibpath_var_CXX=unsupported -hardcode_automatic_CXX=no -inherit_rpath_CXX=no -module_cmds_CXX= -module_expsym_cmds_CXX= -link_all_deplibs_CXX=unknown -old_archive_cmds_CXX=$old_archive_cmds -reload_flag_CXX=$reload_flag -reload_cmds_CXX=$reload_cmds -no_undefined_flag_CXX= -whole_archive_flag_spec_CXX= -enable_shared_with_static_runtimes_CXX=no -# Source file extension for C++ test sources. -ac_ext=cpp -# Object file extension for compiled C++ test sources. -objext=o -objext_CXX=$objext -# No sense in running all these tests if we already determined that -# the CXX compiler isn't working. Some variables (like enable_shared) -# are currently assumed to apply to all compilers on this platform, -# and will be corrupted by setting them based on a non-working compiler. -if test "$_lt_caught_CXX_error" != yes; then - # Code to be used in simple compile tests - lt_simple_compile_test_code="int some_variable = 0;" - # Code to be used in simple link tests - lt_simple_link_test_code='int main(int, char *[]) { return(0); }' - # ltmain only uses $CC for tagged configurations so make sure $CC is set. -# If no C compiler was specified, use CC. -LTCC=${LTCC-"$CC"} -# If no C compiler flags were specified, use CFLAGS. -LTCFLAGS=${LTCFLAGS-"$CFLAGS"} -# Allow CC to be a program name with arguments. -compiler=$CC - # save warnings/boilerplate of simple test code - ac_outfile=conftest.$ac_objext -echo "$lt_simple_compile_test_code" >conftest.$ac_ext -eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err -_lt_compiler_boilerplate=`cat conftest.err` -$RM conftest* - ac_outfile=conftest.$ac_objext -echo "$lt_simple_link_test_code" >conftest.$ac_ext -eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err -_lt_linker_boilerplate=`cat conftest.err` -$RM -r conftest* - # Allow CC to be a program name with arguments. - lt_save_CC=$CC - lt_save_CFLAGS=$CFLAGS - lt_save_LD=$LD - lt_save_GCC=$GCC - GCC=$GXX - lt_save_with_gnu_ld=$with_gnu_ld - lt_save_path_LD=$lt_cv_path_LD - if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then - lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx - else - $as_unset lt_cv_prog_gnu_ld - fi - if test -n "${lt_cv_path_LDCXX+set}"; then - lt_cv_path_LD=$lt_cv_path_LDCXX - else - $as_unset lt_cv_path_LD - fi - test -z "${LDCXX+set}" || LD=$LDCXX - CC=${CXX-"c++"} - CFLAGS=$CXXFLAGS - compiler=$CC - compiler_CXX=$CC - for cc_temp in $compiler""; do - case $cc_temp in - compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; - distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; - \-*) ;; - *) break;; - esac -done -cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` - if test -n "$compiler"; then - # We don't want -fno-exception when compiling C++ code, so set the - # no_builtin_flag separately - if test "$GXX" = yes; then - lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin' - else - lt_prog_compiler_no_builtin_flag_CXX= - fi - if test "$GXX" = yes; then - # Set up default GNU C++ configuration -# Check whether --with-gnu-ld was given. -if test "${with_gnu_ld+set}" = set; then : - withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes -else - with_gnu_ld=no -fi -ac_prog=ld -if test "$GCC" = yes; then - # Check if gcc -print-prog-name=ld gives a path. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 -$as_echo_n "checking for ld used by $CC... " >&6; } - case $host in - *-*-mingw*) - # gcc leaves a trailing carriage return which upsets mingw - ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; - *) - ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; - esac - case $ac_prog in - # Accept absolute paths. - [\\/]* | ?:[\\/]*) - re_direlt='/[^/][^/]*/\.\./' - # Canonicalize the pathname of ld - ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` - while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do - ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` - done - test -z "$LD" && LD="$ac_prog" - ;; - "") - # If it fails, then pretend we aren't using GCC. - ac_prog=ld - ;; - *) - # If it is relative, then search for the first ld in PATH. - with_gnu_ld=unknown - ;; - esac -elif test "$with_gnu_ld" = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 -$as_echo_n "checking for GNU ld... " >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 -$as_echo_n "checking for non-GNU ld... " >&6; } -fi -if ${lt_cv_path_LD+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -z "$LD"; then - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for ac_dir in $PATH; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then - lt_cv_path_LD="$ac_dir/$ac_prog" - # Check to see if the program is GNU ld. I'd rather use --version, - # but apparently some variants of GNU ld only accept -v. - # Break only if it was the GNU/non-GNU ld that we prefer. - case `"$lt_cv_path_LD" -v 2>&1 &5 -$as_echo "$LD" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi -test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 -$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } -if ${lt_cv_prog_gnu_ld+:} false; then : - $as_echo_n "(cached) " >&6 -else - # I'd rather use --version here, but apparently some GNU lds only accept -v. -case `$LD -v 2>&1 &5 -$as_echo "$lt_cv_prog_gnu_ld" >&6; } -with_gnu_ld=$lt_cv_prog_gnu_ld @@ -15727,1270 +15051,103 @@ with_gnu_ld=$lt_cv_prog_gnu_ld - # Check if GNU C++ uses GNU ld as the underlying linker, since the - # archiving commands below assume that GNU ld is being used. - if test "$with_gnu_ld" = yes; then - archive_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' - export_dynamic_flag_spec_CXX='${wl}--export-dynamic' - # If archive_cmds runs LD, not CC, wlarc should be empty - # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to - # investigate it a little bit more. (MM) - wlarc='${wl}' - # ancient GNU ld didn't support --whole-archive et. al. - if eval "`$CC -print-prog-name=ld` --help 2>&1" | - $GREP 'no-whole-archive' > /dev/null; then - whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - whole_archive_flag_spec_CXX= - fi - else - with_gnu_ld=no - wlarc= - # A generic and very simple default shared library creation - # command for GNU C++ for the case where it uses the native - # linker, instead of GNU ld. If possible, this setting should - # overridden to take advantage of the native linker features on - # the platform it is being used on. - archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' - fi - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' - else - GXX=no - with_gnu_ld=no - wlarc= - fi - # PORTME: fill in a description of your system's C++ link characteristics - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } - ld_shlibs_CXX=yes - case $host_os in - aix3*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - aix[4-9]*) - if test "$host_cpu" = ia64; then - # On IA64, the linker does run time linking by default, so we don't - # have to do anything special. - aix_use_runtimelinking=no - exp_sym_flag='-Bexport' - no_entry_flag="" - else - aix_use_runtimelinking=no - # Test if we are trying to use run time linking or normal - # AIX style linking. If -brtl is somewhere in LDFLAGS, we - # need to do runtime linking. - case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) - for ld_flag in $LDFLAGS; do - case $ld_flag in - *-brtl*) - aix_use_runtimelinking=yes - break - ;; - esac - done - ;; - esac - exp_sym_flag='-bexport' - no_entry_flag='-bnoentry' - fi - # When large executables or shared objects are built, AIX ld can - # have problems creating the table of contents. If linking a library - # or program results in "error TOC overflow" add -mminimal-toc to - # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not - # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. - archive_cmds_CXX='' - hardcode_direct_CXX=yes - hardcode_direct_absolute_CXX=yes - hardcode_libdir_separator_CXX=':' - link_all_deplibs_CXX=yes - file_list_spec_CXX='${wl}-f,' - if test "$GXX" = yes; then - case $host_os in aix4.[012]|aix4.[012].*) - # We only want to do this on AIX 4.2 and lower, the check - # below for broken collect2 doesn't work under 4.3+ - collect2name=`${CC} -print-prog-name=collect2` - if test -f "$collect2name" && - strings "$collect2name" | $GREP resolve_lib_name >/dev/null - then - # We have reworked collect2 - : - else - # We have old collect2 - hardcode_direct_CXX=unsupported - # It fails to find uninstalled libraries when the uninstalled - # path is not listed in the libpath. Setting hardcode_minus_L - # to unsupported forces relinking - hardcode_minus_L_CXX=yes - hardcode_libdir_flag_spec_CXX='-L$libdir' - hardcode_libdir_separator_CXX= - fi - esac - shared_flag='-shared' - if test "$aix_use_runtimelinking" = yes; then - shared_flag="$shared_flag "'${wl}-G' - fi - else - # not using gcc - if test "$host_cpu" = ia64; then - # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release - # chokes on -Wl,-G. The following line is correct: - shared_flag='-G' - else - if test "$aix_use_runtimelinking" = yes; then - shared_flag='${wl}-G' - else - shared_flag='${wl}-bM:SRE' - fi - fi - fi - export_dynamic_flag_spec_CXX='${wl}-bexpall' - # It seems that -bexpall does not export symbols beginning with - # underscore (_), so it is better to generate a list of symbols to - # export. - always_export_symbols_CXX=yes - if test "$aix_use_runtimelinking" = yes; then - # Warning - without using the other runtime loading flags (-brtl), - # -berok will link without error, but may produce a broken library. - allow_undefined_flag_CXX='-berok' - # Determine the default libpath from the value encoded in an empty - # executable. - if test "${lt_cv_aix_libpath+set}" = set; then - aix_libpath=$lt_cv_aix_libpath -else - if ${lt_cv_aix_libpath__CXX+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus - extern "C" -# endif - int FC_DUMMY_MAIN() { return 1; } -#endif -#endif -int -main () -{ - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : - lt_aix_libpath_sed=' - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\([^ ]*\) *$/\1/ - p - } - }' - lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - # Check for a 64-bit object if we didn't find anything. - if test -z "$lt_cv_aix_libpath__CXX"; then - lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - fi -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - if test -z "$lt_cv_aix_libpath__CXX"; then - lt_cv_aix_libpath__CXX="/usr/lib:/lib" - fi -fi - aix_libpath=$lt_cv_aix_libpath__CXX -fi - hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" - archive_expsym_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" - else - if test "$host_cpu" = ia64; then - hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib' - allow_undefined_flag_CXX="-z nodefs" - archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" - else - # Determine the default libpath from the value encoded in an - # empty executable. - if test "${lt_cv_aix_libpath+set}" = set; then - aix_libpath=$lt_cv_aix_libpath -else - if ${lt_cv_aix_libpath__CXX+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus - extern "C" -# endif - int FC_DUMMY_MAIN() { return 1; } -#endif -#endif -int -main () -{ - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : - lt_aix_libpath_sed=' - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\([^ ]*\) *$/\1/ - p - } - }' - lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - # Check for a 64-bit object if we didn't find anything. - if test -z "$lt_cv_aix_libpath__CXX"; then - lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - fi -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - if test -z "$lt_cv_aix_libpath__CXX"; then - lt_cv_aix_libpath__CXX="/usr/lib:/lib" - fi -fi - aix_libpath=$lt_cv_aix_libpath__CXX -fi - hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" - # Warning - without using the other run time loading flags, - # -berok will link without error, but may produce a broken library. - no_undefined_flag_CXX=' ${wl}-bernotok' - allow_undefined_flag_CXX=' ${wl}-berok' - if test "$with_gnu_ld" = yes; then - # We only use this code for GNU lds that support --whole-archive. - whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive' - else - # Exported symbols can be pulled into shared objects from archives - whole_archive_flag_spec_CXX='$convenience' - fi - archive_cmds_need_lc_CXX=yes - # This is similar to how AIX traditionally builds its shared - # libraries. - archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' - fi - fi - ;; - beos*) - if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - allow_undefined_flag_CXX=unsupported - # Joseph Beckenbach says some releases of gcc - # support --undefined. This deserves some investigation. FIXME - archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - else - ld_shlibs_CXX=no - fi - ;; - chorus*) - case $cc_basename in - *) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - esac - ;; - cygwin* | mingw* | pw32* | cegcc*) - case $GXX,$cc_basename in - ,cl* | no,cl*) - # Native MSVC - # hardcode_libdir_flag_spec is actually meaningless, as there is - # no search path for DLLs. - hardcode_libdir_flag_spec_CXX=' ' - allow_undefined_flag_CXX=unsupported - always_export_symbols_CXX=yes - file_list_spec_CXX='@' - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" - # FIXME: Setting linknames here is a bad hack. - archive_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' - archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; - else - $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; - fi~ - $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ - linknames=' - # The linker will not automatically build a static lib if we build a DLL. - # _LT_TAGVAR(old_archive_from_new_cmds, CXX)='true' - enable_shared_with_static_runtimes_CXX=yes - # Don't use ranlib - old_postinstall_cmds_CXX='chmod 644 $oldlib' - postlink_cmds_CXX='lt_outputfile="@OUTPUT@"~ - lt_tool_outputfile="@TOOL_OUTPUT@"~ - case $lt_outputfile in - *.exe|*.EXE) ;; - *) - lt_outputfile="$lt_outputfile.exe" - lt_tool_outputfile="$lt_tool_outputfile.exe" - ;; - esac~ - func_to_tool_file "$lt_outputfile"~ - if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then - $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; - $RM "$lt_outputfile.manifest"; - fi' - ;; - *) - # g++ - # _LT_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, - # as there is no search path for DLLs. - hardcode_libdir_flag_spec_CXX='-L$libdir' - export_dynamic_flag_spec_CXX='${wl}--export-all-symbols' - allow_undefined_flag_CXX=unsupported - always_export_symbols_CXX=no - enable_shared_with_static_runtimes_CXX=yes - if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then - archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is; otherwise, prepend... - archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - else - ld_shlibs_CXX=no - fi - ;; - esac - ;; - darwin* | rhapsody*) - archive_cmds_need_lc_CXX=no - hardcode_direct_CXX=no - hardcode_automatic_CXX=yes - hardcode_shlibpath_var_CXX=unsupported - if test "$lt_cv_ld_force_load" = "yes"; then - whole_archive_flag_spec_CXX='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' - else - whole_archive_flag_spec_CXX='' - fi - link_all_deplibs_CXX=yes - allow_undefined_flag_CXX="$_lt_dar_allow_undefined" - case $cc_basename in - ifort*) _lt_dar_can_shared=yes ;; - *) _lt_dar_can_shared=$GCC ;; - esac - if test "$_lt_dar_can_shared" = "yes"; then - output_verbose_link_cmd=func_echo_all - archive_cmds_CXX="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" - module_cmds_CXX="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" - archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" - module_expsym_cmds_CXX="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" - if test "$lt_cv_apple_cc_single_mod" != "yes"; then - archive_cmds_CXX="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" - archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" - fi - else - ld_shlibs_CXX=no - fi - ;; - dgux*) - case $cc_basename in - ec++*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - ghcx*) - # Green Hills C++ Compiler - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - *) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - esac - ;; - freebsd2.*) - # C++ shared libraries reported to be fairly broken before - # switch to ELF - ld_shlibs_CXX=no - ;; - freebsd-elf*) - archive_cmds_need_lc_CXX=no - ;; - freebsd* | dragonfly*) - # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF - # conventions - ld_shlibs_CXX=yes - ;; - gnu*) - ;; - haiku*) - archive_cmds_CXX='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - link_all_deplibs_CXX=yes - ;; - hpux9*) - hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' - hardcode_libdir_separator_CXX=: - export_dynamic_flag_spec_CXX='${wl}-E' - hardcode_direct_CXX=yes - hardcode_minus_L_CXX=yes # Not in the search PATH, - # but as the default - # location of the library. - case $cc_basename in - CC*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - aCC*) - archive_cmds_CXX='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' - ;; - *) - if test "$GXX" = yes; then - archive_cmds_CXX='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - else - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - fi - ;; - esac - ;; - hpux10*|hpux11*) - if test $with_gnu_ld = no; then - hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' - hardcode_libdir_separator_CXX=: - case $host_cpu in - hppa*64*|ia64*) - ;; - *) - export_dynamic_flag_spec_CXX='${wl}-E' - ;; - esac - fi - case $host_cpu in - hppa*64*|ia64*) - hardcode_direct_CXX=no - hardcode_shlibpath_var_CXX=no - ;; - *) - hardcode_direct_CXX=yes - hardcode_direct_absolute_CXX=yes - hardcode_minus_L_CXX=yes # Not in the search PATH, - # but as the default - # location of the library. - ;; - esac - case $cc_basename in - CC*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - aCC*) - case $host_cpu in - hppa*64*) - archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - ia64*) - archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - *) - archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - esac - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' - ;; - *) - if test "$GXX" = yes; then - if test $with_gnu_ld = no; then - case $host_cpu in - hppa*64*) - archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - ia64*) - archive_cmds_CXX='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - *) - archive_cmds_CXX='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - esac - fi - else - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - fi - ;; - esac - ;; - interix[3-9]*) - hardcode_direct_CXX=no - hardcode_shlibpath_var_CXX=no - hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' - export_dynamic_flag_spec_CXX='${wl}-E' - # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. - # Instead, shared libraries are loaded at an image base (0x10000000 by - # default) and relocated if they conflict, which is a slow very memory - # consuming and fragmenting process. To avoid this, we pick a random, - # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link - # time. Moving up from 0x10000000 also allows more sbrk(2) space. - archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - archive_expsym_cmds_CXX='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - ;; - irix5* | irix6*) - case $cc_basename in - CC*) - # SGI C++ - archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' - # Archives containing C++ object files must be created using - # "CC -ar", where "CC" is the IRIX C++ compiler. This is - # necessary to make sure instantiated templates are included - # in the archive. - old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs' - ;; - *) - if test "$GXX" = yes; then - if test "$with_gnu_ld" = no; then - archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib' - fi - fi - link_all_deplibs_CXX=yes - ;; - esac - hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_CXX=: - inherit_rpath_CXX=yes - ;; - linux* | k*bsd*-gnu | kopensolaris*-gnu) - case $cc_basename in - KCC*) - # Kuck and Associates, Inc. (KAI) C++ Compiler - # KCC will only create a shared library if the output file - # ends with ".so" (or ".sl" for HP-UX), so rename the library - # to its proper name (with version) after linking. - archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' - hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' - export_dynamic_flag_spec_CXX='${wl}--export-dynamic' - # Archives containing C++ object files must be created using - # "CC -Bstatic", where "CC" is the KAI C++ compiler. - old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' - ;; - icpc* | ecpc* ) - # Intel C++ - with_gnu_ld=yes - # version 8.0 and above of icpc choke on multiply defined symbols - # if we add $predep_objects and $postdep_objects, however 7.1 and - # earlier do not add the objects themselves. - case `$CC -V 2>&1` in - *"Version 7."*) - archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - ;; - *) # Version 8.0 or newer - tmp_idyn= - case $host_cpu in - ia64*) tmp_idyn=' -i_dynamic';; - esac - archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - ;; - esac - archive_cmds_need_lc_CXX=no - hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' - export_dynamic_flag_spec_CXX='${wl}--export-dynamic' - whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive' - ;; - pgCC* | pgcpp*) - # Portland Group C++ compiler - case `$CC -V` in - *pgCC\ [1-5].* | *pgcpp\ [1-5].*) - prelink_cmds_CXX='tpldir=Template.dir~ - rm -rf $tpldir~ - $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ - compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' - old_archive_cmds_CXX='tpldir=Template.dir~ - rm -rf $tpldir~ - $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ - $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ - $RANLIB $oldlib' - archive_cmds_CXX='tpldir=Template.dir~ - rm -rf $tpldir~ - $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ - $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' - archive_expsym_cmds_CXX='tpldir=Template.dir~ - rm -rf $tpldir~ - $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ - $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' - ;; - *) # Version 6 and above use weak symbols - archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' - archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' - ;; - esac - hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' - export_dynamic_flag_spec_CXX='${wl}--export-dynamic' - whole_archive_flag_spec_CXX='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' - ;; - cxx*) - # Compaq C++ - archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' - runpath_var=LD_RUN_PATH - hardcode_libdir_flag_spec_CXX='-rpath $libdir' - hardcode_libdir_separator_CXX=: - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' - ;; - xl* | mpixl* | bgxl*) - # IBM XL 8.0 on PPC, with GNU ld - hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' - export_dynamic_flag_spec_CXX='${wl}--export-dynamic' - archive_cmds_CXX='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - if test "x$supports_anon_versioning" = xyes; then - archive_expsym_cmds_CXX='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' - fi - ;; - *) - case `$CC -V 2>&1 | sed 5q` in - *Sun\ C*) - # Sun C++ 5.9 - no_undefined_flag_CXX=' -zdefs' - archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - archive_expsym_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' - hardcode_libdir_flag_spec_CXX='-R$libdir' - whole_archive_flag_spec_CXX='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' - compiler_needs_object_CXX=yes - # Not sure whether something based on - # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 - # would be better. - output_verbose_link_cmd='func_echo_all' - # Archives containing C++ object files must be created using - # "CC -xar", where "CC" is the Sun C++ compiler. This is - # necessary to make sure instantiated templates are included - # in the archive. - old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' - ;; - esac - ;; - esac - ;; - lynxos*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - m88k*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - mvs*) - case $cc_basename in - cxx*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - *) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - esac - ;; - netbsd*) - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' - wlarc= - hardcode_libdir_flag_spec_CXX='-R$libdir' - hardcode_direct_CXX=yes - hardcode_shlibpath_var_CXX=no - fi - # Workaround some broken pre-1.5 toolchains - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' - ;; - *nto* | *qnx*) - ld_shlibs_CXX=yes - ;; - openbsd2*) - # C++ shared libraries are fairly broken - ld_shlibs_CXX=no - ;; - openbsd*) - if test -f /usr/libexec/ld.so; then - hardcode_direct_CXX=yes - hardcode_shlibpath_var_CXX=no - hardcode_direct_absolute_CXX=yes - archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' - hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' - export_dynamic_flag_spec_CXX='${wl}-E' - whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - fi - output_verbose_link_cmd=func_echo_all - else - ld_shlibs_CXX=no - fi - ;; - osf3* | osf4* | osf5*) - case $cc_basename in - KCC*) - # Kuck and Associates, Inc. (KAI) C++ Compiler - # KCC will only create a shared library if the output file - # ends with ".so" (or ".sl" for HP-UX), so rename the library - # to its proper name (with version) after linking. - archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' - hardcode_libdir_separator_CXX=: - # Archives containing C++ object files must be created using - # the KAI C++ compiler. - case $host in - osf3*) old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; - *) old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' ;; - esac - ;; - RCC*) - # Rational C++ 2.4.1 - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - cxx*) - case $host in - osf3*) - allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' - hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' - ;; - *) - allow_undefined_flag_CXX=' -expect_unresolved \*' - archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' - archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ - echo "-hidden">> $lib.exp~ - $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~ - $RM $lib.exp' - hardcode_libdir_flag_spec_CXX='-rpath $libdir' - ;; - esac - hardcode_libdir_separator_CXX=: - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' - ;; - *) - if test "$GXX" = yes && test "$with_gnu_ld" = no; then - allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' - case $host in - osf3*) - archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - ;; - *) - archive_cmds_CXX='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - ;; - esac - hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_CXX=: - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' - else - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - fi - ;; - esac - ;; - psos*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - sunos4*) - case $cc_basename in - CC*) - # Sun C++ 4.x - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - lcc*) - # Lucid - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - *) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - esac - ;; - solaris*) - case $cc_basename in - CC* | sunCC*) - # Sun C++ 4.2, 5.x and Centerline C++ - archive_cmds_need_lc_CXX=yes - no_undefined_flag_CXX=' -zdefs' - archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' - hardcode_libdir_flag_spec_CXX='-R$libdir' - hardcode_shlibpath_var_CXX=no - case $host_os in - solaris2.[0-5] | solaris2.[0-5].*) ;; - *) - # The compiler driver will combine and reorder linker options, - # but understands `-z linker_flag'. - # Supported since Solaris 2.6 (maybe 2.5.1?) - whole_archive_flag_spec_CXX='-z allextract$convenience -z defaultextract' - ;; - esac - link_all_deplibs_CXX=yes - output_verbose_link_cmd='func_echo_all' - # Archives containing C++ object files must be created using - # "CC -xar", where "CC" is the Sun C++ compiler. This is - # necessary to make sure instantiated templates are included - # in the archive. - old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' - ;; - gcx*) - # Green Hills C++ Compiler - archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - # The C++ compiler must be used to create the archive. - old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs' - ;; - *) - # GNU C++ compiler with Solaris linker - if test "$GXX" = yes && test "$with_gnu_ld" = no; then - no_undefined_flag_CXX=' ${wl}-z ${wl}defs' - if $CC --version | $GREP -v '^2\.7' > /dev/null; then - archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' - else - # g++ 2.7 appears to require `-G' NOT `-shared' on this - # platform. - archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' - fi - hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir' - case $host_os in - solaris2.[0-5] | solaris2.[0-5].*) ;; - *) - whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' - ;; - esac - fi - ;; - esac - ;; - sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) - no_undefined_flag_CXX='${wl}-z,text' - archive_cmds_need_lc_CXX=no - hardcode_shlibpath_var_CXX=no - runpath_var='LD_RUN_PATH' - case $cc_basename in - CC*) - archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - ;; - sysv5* | sco3.2v5* | sco5v6*) - # Note: We can NOT use -z defs as we might desire, because we do not - # link with -lc, and that would cause any symbols used from libc to - # always be unresolved, which means just about no library would - # ever link correctly. If we're not using GNU ld we use -z text - # though, which does catch some bad symbols but isn't as heavy-handed - # as -z defs. - no_undefined_flag_CXX='${wl}-z,text' - allow_undefined_flag_CXX='${wl}-z,nodefs' - archive_cmds_need_lc_CXX=no - hardcode_shlibpath_var_CXX=no - hardcode_libdir_flag_spec_CXX='${wl}-R,$libdir' - hardcode_libdir_separator_CXX=':' - link_all_deplibs_CXX=yes - export_dynamic_flag_spec_CXX='${wl}-Bexport' - runpath_var='LD_RUN_PATH' - case $cc_basename in - CC*) - archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - old_archive_cmds_CXX='$CC -Tprelink_objects $oldobjs~ - '"$old_archive_cmds_CXX" - reload_cmds_CXX='$CC -Tprelink_objects $reload_objs~ - '"$reload_cmds_CXX" - ;; - *) - archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - ;; - tandem*) - case $cc_basename in - NCC*) - # NonStop-UX NCC 3.20 - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - *) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - esac - ;; - vxworks*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - *) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - esac - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 -$as_echo "$ld_shlibs_CXX" >&6; } - test "$ld_shlibs_CXX" = no && can_build_shared=no - GCC_CXX="$GXX" - LD_CXX="$LD" - ## CAVEAT EMPTOR: - ## There is no encapsulation within the following macros, do not change - ## the running order or otherwise move them around unless you know exactly - ## what you are doing... - # Dependencies to place before and after the object being linked: -predep_objects_CXX= -postdep_objects_CXX= -predeps_CXX= -postdeps_CXX= -compiler_lib_search_path_CXX= -cat > conftest.$ac_ext <<_LT_EOF -class Foo -{ -public: - Foo (void) { a = 0; } -private: - int a; -}; -_LT_EOF -_lt_libdeps_save_CFLAGS=$CFLAGS -case "$CC $CFLAGS " in #( -*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; -*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; -*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; -esac -if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - # Parse the compiler output and extract the necessary - # objects, libraries and library flags. - - # Sentinel used to keep track of whether or not we are before - # the conftest object file. - pre_test_object_deps_done=no - - for p in `eval "$output_verbose_link_cmd"`; do - case ${prev}${p} in - - -L* | -R* | -l*) - # Some compilers place space between "-{L,R}" and the path. - # Remove the space. - if test $p = "-L" || - test $p = "-R"; then - prev=$p - continue - fi - - # Expand the sysroot to ease extracting the directories later. - if test -z "$prev"; then - case $p in - -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; - -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; - -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; - esac - fi - case $p in - =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; - esac - if test "$pre_test_object_deps_done" = no; then - case ${prev} in - -L | -R) - # Internal compiler library paths should come after those - # provided the user. The postdeps already come after the - # user supplied libs so there is no need to process them. - if test -z "$compiler_lib_search_path_CXX"; then - compiler_lib_search_path_CXX="${prev}${p}" - else - compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${prev}${p}" - fi - ;; - # The "-l" case would never come before the object being - # linked, so don't bother handling this case. - esac - else - if test -z "$postdeps_CXX"; then - postdeps_CXX="${prev}${p}" - else - postdeps_CXX="${postdeps_CXX} ${prev}${p}" - fi - fi - prev= - ;; - - *.lto.$objext) ;; # Ignore GCC LTO objects - *.$objext) - # This assumes that the test object file only shows up - # once in the compiler output. - if test "$p" = "conftest.$objext"; then - pre_test_object_deps_done=yes - continue - fi - - if test "$pre_test_object_deps_done" = no; then - if test -z "$predep_objects_CXX"; then - predep_objects_CXX="$p" - else - predep_objects_CXX="$predep_objects_CXX $p" - fi - else - if test -z "$postdep_objects_CXX"; then - postdep_objects_CXX="$p" - else - postdep_objects_CXX="$postdep_objects_CXX $p" - fi - fi - ;; - - *) ;; # Ignore the rest. - - esac - done - - # Clean up. - rm -f a.out a.exe -else - echo "libtool.m4: error: problem compiling CXX test program" -fi - -$RM -f confest.$objext -CFLAGS=$_lt_libdeps_save_CFLAGS - -# PORTME: override above test on systems where it is broken -case $host_os in -interix[3-9]*) - # Interix 3.5 installs completely hosed .la files for C++, so rather than - # hack all around it, let's just trust "g++" to DTRT. - predep_objects_CXX= - postdep_objects_CXX= - postdeps_CXX= - ;; - -linux*) - case `$CC -V 2>&1 | sed 5q` in - *Sun\ C*) - # Sun C++ 5.9 - - # The more standards-conforming stlport4 library is - # incompatible with the Cstd library. Avoid specifying - # it if it's in CXXFLAGS. Ignore libCrun as - # -library=stlport4 depends on it. - case " $CXX $CXXFLAGS " in - *" -library=stlport4 "*) - solaris_use_stlport4=yes - ;; - esac - - if test "$solaris_use_stlport4" != yes; then - postdeps_CXX='-library=Cstd -library=Crun' - fi - ;; - esac - ;; - -solaris*) - case $cc_basename in - CC* | sunCC*) - # The more standards-conforming stlport4 library is - # incompatible with the Cstd library. Avoid specifying - # it if it's in CXXFLAGS. Ignore libCrun as - # -library=stlport4 depends on it. - case " $CXX $CXXFLAGS " in - *" -library=stlport4 "*) - solaris_use_stlport4=yes - ;; - esac - - # Adding this requires a known-good setup of shared libraries for - # Sun compiler versions before 5.6, else PIC objects from an old - # archive will be linked into the output, leading to subtle bugs. - if test "$solaris_use_stlport4" != yes; then - postdeps_CXX='-library=Cstd -library=Crun' - fi - ;; - esac - ;; -esac - - -case " $postdeps_CXX " in -*" -lc "*) archive_cmds_need_lc_CXX=no ;; -esac - compiler_lib_search_dirs_CXX= -if test -n "${compiler_lib_search_path_CXX}"; then - compiler_lib_search_dirs_CXX=`echo " ${compiler_lib_search_path_CXX}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` -fi @@ -17011,704 +15168,777 @@ fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 +$as_echo_n "checking dynamic linker characteristics... " >&6; } +if test "$GCC" = yes; then + case $host_os in + darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; + *) lt_awk_arg="/^libraries:/" ;; + esac + case $host_os in + mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;; + *) lt_sed_strip_eq="s,=/,/,g" ;; + esac + lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` + case $lt_search_path_spec in + *\;*) + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` + ;; + *) + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` + ;; + esac + # Ok, now we have the path, separated by spaces, we can step through it + # and add multilib dir if necessary. + lt_tmp_lt_search_path_spec= + lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` + for lt_sys_path in $lt_search_path_spec; do + if test -d "$lt_sys_path/$lt_multi_os_dir"; then + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" + else + test -d "$lt_sys_path" && \ + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" + fi + done + lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' +BEGIN {RS=" "; FS="/|\n";} { + lt_foo=""; + lt_count=0; + for (lt_i = NF; lt_i > 0; lt_i--) { + if ($lt_i != "" && $lt_i != ".") { + if ($lt_i == "..") { + lt_count++; + } else { + if (lt_count == 0) { + lt_foo="/" $lt_i lt_foo; + } else { + lt_count--; + } + } + } + } + if (lt_foo != "") { lt_freq[lt_foo]++; } + if (lt_freq[lt_foo] == 1) { print lt_foo; } +}'` + # AWK program above erroneously prepends '/' to C:/dos/paths + # for these hosts. + case $host_os in + mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ + $SED 's,/\([A-Za-z]:\),\1,g'` ;; + esac + sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +need_lib_prefix=unknown +hardcode_into_libs=no +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown +case $host_os in +aix3*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; +aix[4-9]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; +amigaos*) + case $host_cpu in + powerpc) + # Since July 2007 AmigaOS4 officially supports .so libraries. + # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + ;; + m68k) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + esac + ;; +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; +bsdi[45]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; +cygwin* | mingw* | pw32* | cegcc*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + case $GCC,$cc_basename in + yes,*) + # gcc + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes - lt_prog_compiler_wl_CXX= -lt_prog_compiler_pic_CXX= -lt_prog_compiler_static_CXX= + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" + ;; + mingw* | cegcc*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + esac + dynamic_linker='Win32 ld.exe' + ;; - # C++ specific cases for pic, static, wl, etc. - if test "$GXX" = yes; then - lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_static_CXX='-static' + *,cl*) + # Native MSVC + libname_spec='$name' + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + library_names_spec='${libname}.dll.lib' - case $host_os in - aix*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - lt_prog_compiler_static_CXX='-Bstatic' - fi - ;; - - amigaos*) - case $host_cpu in - powerpc) - # see comment about AmigaOS4 .so support - lt_prog_compiler_pic_CXX='-fPIC' - ;; - m68k) - # FIXME: we need at least 68020 code to build shared libraries, but - # adding the `-m68020' flag to GCC prevents building anything better, - # like `-m68040'. - lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4' - ;; - esac - ;; - - beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; - mingw* | cygwin* | os2* | pw32* | cegcc*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - # Although the cygwin gcc ignores -fPIC, still need this for old-style - # (--disable-auto-import) libraries - lt_prog_compiler_pic_CXX='-DDLL_EXPORT' - ;; - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - lt_prog_compiler_pic_CXX='-fno-common' - ;; - *djgpp*) - # DJGPP does not support shared libraries at all - lt_prog_compiler_pic_CXX= - ;; - haiku*) - # PIC is the default for Haiku. - # The "-static" flag exists, but is broken. - lt_prog_compiler_static_CXX= - ;; - interix[3-9]*) - # Interix 3.x gcc -fpic/-fPIC options generate broken code. - # Instead, we relocate shared libraries at runtime. - ;; - sysv4*MP*) - if test -d /usr/nec; then - lt_prog_compiler_pic_CXX=-Kconform_pic - fi - ;; - hpux*) - # PIC is the default for 64-bit PA HP-UX, but not for 32-bit - # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag - # sets the default TLS model and affects inlining. - case $host_cpu in - hppa*64*) - ;; - *) - lt_prog_compiler_pic_CXX='-fPIC' - ;; - esac + case $build_os in + mingw*) + sys_lib_search_path_spec= + lt_save_ifs=$IFS + IFS=';' + for lt_path in $LIB + do + IFS=$lt_save_ifs + # Let DOS variable expansion print the short 8.3 style file name. + lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` + sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" + done + IFS=$lt_save_ifs + # Convert to MSYS style. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ;; - *qnx* | *nto*) - # QNX uses GNU C++, but need to define -shared option too, otherwise - # it will coredump. - lt_prog_compiler_pic_CXX='-fPIC -shared' + cygwin*) + # Convert to unix form, then to dos form, then back to unix form + # but this time dos style (no spaces!) so that the unix form looks + # like /cygdrive/c/PROGRA~1:/cygdr... + sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` + sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` + sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) - lt_prog_compiler_pic_CXX='-fPIC' + sys_lib_search_path_spec="$LIB" + if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + # FIXME: find the short name or the path components, as spaces are + # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac + + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + dynamic_linker='Win32 link.exe' + ;; + + *) + # Assume MSVC wrapper + library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' + dynamic_linker='Win32 ld.exe' + ;; + esac + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' + + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` else case $host_os in - aix[4-9]*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - lt_prog_compiler_static_CXX='-Bstatic' - else - lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp' - fi - ;; - chorus*) - case $cc_basename in - cxch68*) - # Green Hills C++ Compiler - # _LT_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" - ;; - esac - ;; - mingw* | cygwin* | os2* | pw32* | cegcc*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - lt_prog_compiler_pic_CXX='-DDLL_EXPORT' - ;; - dgux*) - case $cc_basename in - ec++*) - lt_prog_compiler_pic_CXX='-KPIC' - ;; - ghcx*) - # Green Hills C++ Compiler - lt_prog_compiler_pic_CXX='-pic' - ;; - *) - ;; - esac - ;; - freebsd* | dragonfly*) - # FreeBSD uses GNU C++ - ;; - hpux9* | hpux10* | hpux11*) - case $cc_basename in - CC*) - lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' - if test "$host_cpu" != ia64; then - lt_prog_compiler_pic_CXX='+Z' - fi - ;; - aCC*) - lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' - case $host_cpu in - hppa*64*|ia64*) - # +Z the default - ;; - *) - lt_prog_compiler_pic_CXX='+Z' - ;; - esac - ;; - *) - ;; - esac - ;; - interix*) - # This is c89, which is MS Visual C++ (no shared libs) - # Anyone wants to do a port? - ;; - irix5* | irix6* | nonstopux*) - case $cc_basename in - CC*) - lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_static_CXX='-non_shared' - # CC pic flag -KPIC is the default. - ;; - *) - ;; - esac - ;; - linux* | k*bsd*-gnu | kopensolaris*-gnu) - case $cc_basename in - KCC*) - # KAI C++ Compiler - lt_prog_compiler_wl_CXX='--backend -Wl,' - lt_prog_compiler_pic_CXX='-fPIC' - ;; - ecpc* ) - # old Intel C++ for x86_64 which still supported -KPIC. - lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_pic_CXX='-KPIC' - lt_prog_compiler_static_CXX='-static' - ;; - icpc* ) - # Intel C++, used to be incompatible with GCC. - # ICC 10 doesn't accept -KPIC any more. - lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_pic_CXX='-fPIC' - lt_prog_compiler_static_CXX='-static' - ;; - pgCC* | pgcpp*) - # Portland Group C++ compiler - lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_pic_CXX='-fpic' - lt_prog_compiler_static_CXX='-Bstatic' - ;; - cxx*) - # Compaq C++ - # Make sure the PIC flag is empty. It appears that all Alpha - # Linux and Compaq Tru64 Unix objects are PIC. - lt_prog_compiler_pic_CXX= - lt_prog_compiler_static_CXX='-non_shared' - ;; - xlc* | xlC* | bgxl[cC]* | mpixl[cC]*) - # IBM XL 8.0, 9.0 on PPC and BlueGene - lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_pic_CXX='-qpic' - lt_prog_compiler_static_CXX='-qstaticlink' - ;; - *) - case `$CC -V 2>&1 | sed 5q` in - *Sun\ C*) - # Sun C++ 5.9 - lt_prog_compiler_pic_CXX='-KPIC' - lt_prog_compiler_static_CXX='-Bstatic' - lt_prog_compiler_wl_CXX='-Qoption ld ' - ;; - esac - ;; - esac - ;; - lynxos*) - ;; - m88k*) - ;; - mvs*) - case $cc_basename in - cxx*) - lt_prog_compiler_pic_CXX='-W c,exportall' - ;; - *) - ;; - esac - ;; - netbsd*) - ;; - *qnx* | *nto*) - # QNX uses GNU C++, but need to define -shared option too, otherwise - # it will coredump. - lt_prog_compiler_pic_CXX='-fPIC -shared' - ;; - osf3* | osf4* | osf5*) - case $cc_basename in - KCC*) - lt_prog_compiler_wl_CXX='--backend -Wl,' - ;; - RCC*) - # Rational C++ 2.4.1 - lt_prog_compiler_pic_CXX='-pic' - ;; - cxx*) - # Digital/Compaq C++ - lt_prog_compiler_wl_CXX='-Wl,' - # Make sure the PIC flag is empty. It appears that all Alpha - # Linux and Compaq Tru64 Unix objects are PIC. - lt_prog_compiler_pic_CXX= - lt_prog_compiler_static_CXX='-non_shared' - ;; - *) - ;; - esac - ;; - psos*) - ;; - solaris*) - case $cc_basename in - CC* | sunCC*) - # Sun C++ 4.2, 5.x and Centerline C++ - lt_prog_compiler_pic_CXX='-KPIC' - lt_prog_compiler_static_CXX='-Bstatic' - lt_prog_compiler_wl_CXX='-Qoption ld ' - ;; - gcx*) - # Green Hills C++ Compiler - lt_prog_compiler_pic_CXX='-PIC' - ;; - *) - ;; - esac - ;; - sunos4*) - case $cc_basename in - CC*) - # Sun C++ 4.x - lt_prog_compiler_pic_CXX='-pic' - lt_prog_compiler_static_CXX='-Bstatic' - ;; - lcc*) - # Lucid - lt_prog_compiler_pic_CXX='-pic' - ;; - *) - ;; - esac - ;; - sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) - case $cc_basename in - CC*) - lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_pic_CXX='-KPIC' - lt_prog_compiler_static_CXX='-Bstatic' - ;; - esac - ;; - tandem*) - case $cc_basename in - NCC*) - # NonStop-UX NCC 3.20 - lt_prog_compiler_pic_CXX='-KPIC' - ;; - *) - ;; - esac - ;; - vxworks*) - ;; - *) - lt_prog_compiler_can_build_shared_CXX=no - ;; + freebsd[23].*) objformat=aout ;; + *) objformat=elf ;; esac fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2.*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ + freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + *) # from 4.6 on, and DragonFly + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; -case $host_os in - # For platforms which do not support PIC, -DPIC is meaningless: - *djgpp*) - lt_prog_compiler_pic_CXX= +gnu*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +haiku*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + dynamic_linker="$host_os runtime_loader" + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LIBRARY_PATH + shlibpath_overrides_runpath=yes + sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) - lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC" + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' ;; -esac + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555, ... + postinstall_cmds='chmod 555 $lib' + # or fails outright, so override atomically: + install_override_mode=555 + ;; -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 -$as_echo_n "checking for $compiler option to produce PIC... " >&6; } -if ${lt_cv_prog_compiler_pic_CXX+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_prog_compiler_pic_CXX=$lt_prog_compiler_pic_CXX -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_CXX" >&5 -$as_echo "$lt_cv_prog_compiler_pic_CXX" >&6; } -lt_prog_compiler_pic_CXX=$lt_cv_prog_compiler_pic_CXX +interix[3-9]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; -# -# Check to make sure the PIC flag actually works. -# -if test -n "$lt_prog_compiler_pic_CXX"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 -$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... " >&6; } -if ${lt_cv_prog_compiler_pic_works_CXX+:} false; then : +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux # correct to gnu/linux during the next big refactor + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + + # Some binutils ld are patched to set DT_RUNPATH + if ${lt_cv_shlibpath_overrides_runpath+:} false; then : $as_echo_n "(cached) " >&6 else - lt_cv_prog_compiler_pic_works_CXX=no - ac_outfile=conftest.$ac_objext - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - # The option is referenced via a variable to avoid confusing sed. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s "$ac_outfile"; then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings other than the usual output. - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then - lt_cv_prog_compiler_pic_works_CXX=yes - fi - fi - $RM conftest* + lt_cv_shlibpath_overrides_runpath=no + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ + LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works_CXX" >&5 -$as_echo "$lt_cv_prog_compiler_pic_works_CXX" >&6; } +#ifdef FC_DUMMY_MAIN +#ifndef FC_DUMMY_MAIN_EQ_F77 +# ifdef __cplusplus + extern "C" +# endif + int FC_DUMMY_MAIN() { return 1; } +#endif +#endif +int +main () +{ -if test x"$lt_cv_prog_compiler_pic_works_CXX" = xyes; then - case $lt_prog_compiler_pic_CXX in - "" | " "*) ;; - *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;; - esac -else - lt_prog_compiler_pic_CXX= - lt_prog_compiler_can_build_shared_CXX=no + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : + lt_cv_shlibpath_overrides_runpath=yes fi - fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir +fi + shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + fi -# -# Check to make sure the static flag actually works. -# -wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 -$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } -if ${lt_cv_prog_compiler_static_works_CXX+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_prog_compiler_static_works_CXX=no - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS $lt_tmp_static_flag" - echo "$lt_simple_link_test_code" > conftest.$ac_ext - if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then - # The linker can only warn and ignore the option if not recognized - # So say no if there are warnings - if test -s conftest.err; then - # Append any errors to the config.log. - cat conftest.err 1>&5 - $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if diff conftest.exp conftest.er2 >/dev/null; then - lt_cv_prog_compiler_static_works_CXX=yes - fi - else - lt_cv_prog_compiler_static_works_CXX=yes - fi - fi - $RM -r conftest* - LDFLAGS="$save_LDFLAGS" + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works_CXX" >&5 -$as_echo "$lt_cv_prog_compiler_static_works_CXX" >&6; } +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; -if test x"$lt_cv_prog_compiler_static_works_CXX" = xyes; then - : -else - lt_prog_compiler_static_CXX= -fi +newsos6) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; +*nto* | *qnx*) + version_type=qnx + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='ldqnx.so' + ;; +openbsd*) + version_type=sunos + sys_lib_dlsearch_path_spec="/usr/lib" + need_lib_prefix=no + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[89] | openbsd2.[89].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; +os2*) + libname_spec='$name' + shrext_cmds=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 -$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } -if ${lt_cv_prog_compiler_c_o_CXX+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_prog_compiler_c_o_CXX=no - $RM -r conftest 2>/dev/null - mkdir conftest - cd conftest - mkdir out - echo "$lt_simple_compile_test_code" > conftest.$ac_ext +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; - lt_compiler_flag="-o out/conftest2.$ac_objext" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) - (eval "$lt_compile" 2>out/conftest.err) - ac_status=$? - cat out/conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s out/conftest2.$ac_objext - then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp - $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 - if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then - lt_cv_prog_compiler_c_o_CXX=yes - fi - fi - chmod u+w . 2>&5 - $RM conftest* - # SGI C++ compiler will create directory out/ii_files/ for - # template instantiation - test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files - $RM out/* && rmdir out - cd .. - $RM -r conftest - $RM conftest* +rdos*) + dynamic_linker=no + ;; -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 -$as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; } +solaris*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; +sysv4 | sysv4.3*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 -$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } -if ${lt_cv_prog_compiler_c_o_CXX+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_prog_compiler_c_o_CXX=no - $RM -r conftest 2>/dev/null - mkdir conftest - cd conftest - mkdir out - echo "$lt_simple_compile_test_code" > conftest.$ac_ext +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; - lt_compiler_flag="-o out/conftest2.$ac_objext" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) - (eval "$lt_compile" 2>out/conftest.err) - ac_status=$? - cat out/conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s out/conftest2.$ac_objext - then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp - $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 - if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then - lt_cv_prog_compiler_c_o_CXX=yes - fi - fi - chmod u+w . 2>&5 - $RM conftest* - # SGI C++ compiler will create directory out/ii_files/ for - # template instantiation - test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files - $RM out/* && rmdir out - cd .. - $RM -r conftest - $RM conftest* +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 -$as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; } +tpf*) + # TPF is a cross-target only. Preferred cross-host = GNU/Linux. + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; +uts4*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; +*) + dynamic_linker=no + ;; +esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 +$as_echo "$dynamic_linker" >&6; } +test "$dynamic_linker" = no && can_build_shared=no +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi -hard_links="nottested" -if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then - # do not overwrite the value of need_locks provided by the user - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 -$as_echo_n "checking if we can lock with hard links... " >&6; } - hard_links=yes - $RM conftest* - ln conftest.a conftest.b 2>/dev/null && hard_links=no - touch conftest.a - ln conftest.a conftest.b 2>&5 || hard_links=no - ln conftest.a conftest.b 2>/dev/null && hard_links=no - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 -$as_echo "$hard_links" >&6; } - if test "$hard_links" = no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 -$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} - need_locks=warn - fi -else - need_locks=no +if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then + sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" +fi +if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then + sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } - export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' - case $host_os in - aix[4-9]*) - # If we're using GNU nm, then we don't want the "-C" option. - # -C means demangle to AIX nm, but means don't demangle with GNU nm - # Also, AIX nm treats weak defined symbols like other global defined - # symbols, whereas GNU nm marks them as "W". - if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then - export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' - else - export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' - fi - ;; - pw32*) - export_symbols_cmds_CXX="$ltdll_cmds" - ;; - cygwin* | mingw* | cegcc*) - case $cc_basename in - cl*) - exclude_expsyms_CXX='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' - ;; - *) - export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' - exclude_expsyms_CXX='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' - ;; - esac - ;; - *) - export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - ;; - esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 -$as_echo "$ld_shlibs_CXX" >&6; } -test "$ld_shlibs_CXX" = no && can_build_shared=no -with_gnu_ld_CXX=$with_gnu_ld -# -# Do we need to explicitly link libc? -# -case "x$archive_cmds_need_lc_CXX" in -x|xyes) - # Assume -lc should be added - archive_cmds_need_lc_CXX=yes - if test "$enable_shared" = yes && test "$GCC" = yes; then - case $archive_cmds_CXX in - *'~'*) - # FIXME: we may have to deal with multi-command sequences. - ;; - '$CC '*) - # Test whether the compiler implicitly links with -lc since on some - # systems, -lgcc has to come before -lc. If gcc already passes -lc - # to ld, don't add -lc before -lgcc. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 -$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } -if ${lt_cv_archive_cmds_need_lc_CXX+:} false; then : - $as_echo_n "(cached) " >&6 -else - $RM conftest* - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } 2>conftest.err; then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$lt_prog_compiler_wl_CXX - pic_flag=$lt_prog_compiler_pic_CXX - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - lt_save_allow_undefined_flag=$allow_undefined_flag_CXX - allow_undefined_flag_CXX= - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 - (eval $archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - then - lt_cv_archive_cmds_need_lc_CXX=no - else - lt_cv_archive_cmds_need_lc_CXX=yes - fi - allow_undefined_flag_CXX=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $RM conftest* -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc_CXX" >&5 -$as_echo "$lt_cv_archive_cmds_need_lc_CXX" >&6; } - archive_cmds_need_lc_CXX=$lt_cv_archive_cmds_need_lc_CXX - ;; - esac - fi - ;; -esac @@ -17771,443 +16001,169 @@ esac - { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 -$as_echo_n "checking dynamic linker characteristics... " >&6; } -library_names_spec= -libname_spec='lib$name' -soname_spec= -shrext_cmds=".so" -postinstall_cmds= -postuninstall_cmds= -finish_cmds= -finish_eval= -shlibpath_var= -shlibpath_overrides_runpath=unknown -version_type=none -dynamic_linker="$host_os ld.so" -sys_lib_dlsearch_path_spec="/lib /usr/lib" -need_lib_prefix=unknown -hardcode_into_libs=no -# when you set need_version to no, make sure it does not cause -set_version -# flags to be left without arguments -need_version=unknown -case $host_os in -aix3*) - version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' - shlibpath_var=LIBPATH - # AIX 3 has no versioning support, so we append a major version to the name. - soname_spec='${libname}${release}${shared_ext}$major' - ;; -aix[4-9]*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - hardcode_into_libs=yes - if test "$host_cpu" = ia64; then - # AIX 5 supports IA64 - library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - else - # With GCC up to 2.95.x, collect2 would create an import file - # for dependence libraries. The import file would start with - # the line `#! .'. This would cause the generated library to - # depend on `.', always an invalid library. This was fixed in - # development snapshots of GCC prior to 3.0. - case $host_os in - aix4 | aix4.[01] | aix4.[01].*) - if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' - echo ' yes ' - echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then - : - else - can_build_shared=no - fi - ;; - esac - # AIX (on Power*) has no versioning support, so currently we can not hardcode correct - # soname into executable. Probably we can add versioning support to - # collect2, so additional links can be useful in future. - if test "$aix_use_runtimelinking" = yes; then - # If using run time linking (on AIX 4.2 or later) use lib.so - # instead of lib.a to let people know that these are not - # typical AIX shared libraries. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - else - # We preserve .a as extension for shared libraries through AIX4.2 - # and later when we are not doing run time linking. - library_names_spec='${libname}${release}.a $libname.a' - soname_spec='${libname}${release}${shared_ext}$major' - fi - shlibpath_var=LIBPATH - fi - ;; -amigaos*) - case $host_cpu in - powerpc) - # Since July 2007 AmigaOS4 officially supports .so libraries. - # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - ;; - m68k) - library_names_spec='$libname.ixlibrary $libname.a' - # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' - ;; - esac - ;; -beos*) - library_names_spec='${libname}${shared_ext}' - dynamic_linker="$host_os ld.so" - shlibpath_var=LIBRARY_PATH - ;; -bsdi[45]*) - version_type=linux # correct to gnu/linux during the next big refactor - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" - sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" - # the default ld.so.conf also contains /usr/contrib/lib and - # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow - # libtool to hard-code these into programs - ;; -cygwin* | mingw* | pw32* | cegcc*) - version_type=windows - shrext_cmds=".dll" - need_version=no - need_lib_prefix=no - case $GCC,$cc_basename in - yes,*) - # gcc - library_names_spec='$libname.dll.a' - # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \${file}`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog $dir/$dlname \$dldir/$dlname~ - chmod a+x \$dldir/$dlname~ - if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then - eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; - fi' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ - dlpath=$dir/\$dldll~ - $RM \$dlpath' - shlibpath_overrides_runpath=yes - case $host_os in - cygwin*) - # Cygwin DLLs use 'cyg' prefix rather than 'lib' - soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - ;; - mingw* | cegcc*) - # MinGW DLLs use traditional 'lib' prefix - soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - ;; - pw32*) - # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - ;; - esac - dynamic_linker='Win32 ld.exe' - ;; - *,cl*) - # Native MSVC - libname_spec='$name' - soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - library_names_spec='${libname}.dll.lib' - case $build_os in - mingw*) - sys_lib_search_path_spec= - lt_save_ifs=$IFS - IFS=';' - for lt_path in $LIB - do - IFS=$lt_save_ifs - # Let DOS variable expansion print the short 8.3 style file name. - lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` - sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" - done - IFS=$lt_save_ifs - # Convert to MSYS style. - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` - ;; - cygwin*) - # Convert to unix form, then to dos form, then back to unix form - # but this time dos style (no spaces!) so that the unix form looks - # like /cygdrive/c/PROGRA~1:/cygdr... - sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` - sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` - sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - ;; - *) - sys_lib_search_path_spec="$LIB" - if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then - # It is most probably a Windows format PATH. - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi - # FIXME: find the short name or the path components, as spaces are - # common. (e.g. "Program Files" -> "PROGRA~1") - ;; - esac - # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \${file}`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog $dir/$dlname \$dldir/$dlname' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ - dlpath=$dir/\$dldll~ - $RM \$dlpath' - shlibpath_overrides_runpath=yes - dynamic_linker='Win32 link.exe' - ;; + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 +$as_echo_n "checking how to hardcode library paths into programs... " >&6; } +hardcode_action= +if test -n "$hardcode_libdir_flag_spec" || + test -n "$runpath_var" || + test "X$hardcode_automatic" = "Xyes" ; then - *) - # Assume MSVC wrapper - library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' - dynamic_linker='Win32 ld.exe' - ;; - esac - # FIXME: first we should search . and the directory the executable is in - shlibpath_var=PATH - ;; + # We can hardcode non-existent directories. + if test "$hardcode_direct" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no && + test "$hardcode_minus_L" != no; then + # Linking always hardcodes the temporary library directory. + hardcode_action=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action=unsupported +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 +$as_echo "$hardcode_action" >&6; } -darwin* | rhapsody*) - dynamic_linker="$host_os dyld" - version_type=darwin - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' - soname_spec='${libname}${release}${major}$shared_ext' - shlibpath_overrides_runpath=yes - shlibpath_var=DYLD_LIBRARY_PATH - shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' +if test "$hardcode_action" = relink || + test "$inherit_rpath" = yes; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi - sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' - ;; -dgux*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - ;; -freebsd* | dragonfly*) - # DragonFly does not have aout. When/if they implement a new - # versioning mechanism, adjust this. - if test -x /usr/bin/objformat; then - objformat=`/usr/bin/objformat` - else - case $host_os in - freebsd[23].*) objformat=aout ;; - *) objformat=elf ;; - esac - fi - version_type=freebsd-$objformat - case $version_type in - freebsd-elf*) - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' - need_version=no - need_lib_prefix=no - ;; - freebsd-*) - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' - need_version=yes - ;; - esac - shlibpath_var=LD_LIBRARY_PATH + + + + if test "x$enable_dlopen" != xyes; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown +else + lt_cv_dlopen=no + lt_cv_dlopen_libs= + case $host_os in - freebsd2.*) - shlibpath_overrides_runpath=yes - ;; - freebsd3.[01]* | freebsdelf3.[01]*) - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes + beos*) + lt_cv_dlopen="load_add_on" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes ;; - freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ - freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) - shlibpath_overrides_runpath=no - hardcode_into_libs=yes + + mingw* | pw32* | cegcc*) + lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen_libs= ;; - *) # from 4.6 on, and DragonFly - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes + + cygwin*) + lt_cv_dlopen="dlopen" + lt_cv_dlopen_libs= ;; - esac - ;; -gnu*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; + darwin*) + # if libdl is installed we need to link against it + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } +if ${ac_cv_lib_dl_dlopen+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -haiku*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - dynamic_linker="$host_os runtime_loader" - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LIBRARY_PATH - shlibpath_overrides_runpath=yes - sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' - hardcode_into_libs=yes - ;; +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +#ifdef FC_DUMMY_MAIN +#ifndef FC_DUMMY_MAIN_EQ_F77 +# ifdef __cplusplus + extern "C" +# endif + int FC_DUMMY_MAIN() { return 1; } +#endif +#endif +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dl_dlopen=yes +else + ac_cv_lib_dl_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = xyes; then : + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" +else + + lt_cv_dlopen="dyld" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + +fi -hpux9* | hpux10* | hpux11*) - # Give a soname corresponding to the major version so that dld.sl refuses to - # link against other versions. - version_type=sunos - need_lib_prefix=no - need_version=no - case $host_cpu in - ia64*) - shrext_cmds='.so' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.so" - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - if test "X$HPUX_IA64_MODE" = X32; then - sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" - else - sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" - fi - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - hppa*64*) - shrext_cmds='.sl' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.sl" - shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; + *) - shrext_cmds='.sl' - dynamic_linker="$host_os dld.sl" - shlibpath_var=SHLIB_PATH - shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - ;; - esac - # HP-UX runs *really* slowly unless shared libraries are mode 555, ... - postinstall_cmds='chmod 555 $lib' - # or fails outright, so override atomically: - install_override_mode=555 - ;; - -interix[3-9]*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - -irix5* | irix6* | nonstopux*) - case $host_os in - nonstopux*) version_type=nonstopux ;; - *) - if test "$lt_cv_prog_gnu_ld" = yes; then - version_type=linux # correct to gnu/linux during the next big refactor - else - version_type=irix - fi ;; - esac - need_lib_prefix=no - need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' - case $host_os in - irix5* | nonstopux*) - libsuff= shlibsuff= - ;; - *) - case $LD in # libtool.m4 will add one of these switches to LD - *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") - libsuff= shlibsuff= libmagic=32-bit;; - *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") - libsuff=32 shlibsuff=N32 libmagic=N32;; - *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") - libsuff=64 shlibsuff=64 libmagic=64-bit;; - *) libsuff= shlibsuff= libmagic=never-match;; - esac - ;; - esac - shlibpath_var=LD_LIBRARY${shlibsuff}_PATH - shlibpath_overrides_runpath=no - sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" - sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" - hardcode_into_libs=yes - ;; - -# No shared lib support for Linux oldld, aout, or coff. -linux*oldld* | linux*aout* | linux*coff*) - dynamic_linker=no - ;; - -# This must be glibc/ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - - # Some binutils ld are patched to set DT_RUNPATH - if ${lt_cv_shlibpath_overrides_runpath+:} false; then : + ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" +if test "x$ac_cv_func_shl_load" = xyes; then : + lt_cv_dlopen="shl_load" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 +$as_echo_n "checking for shl_load in -ldld... " >&6; } +if ${ac_cv_lib_dld_shl_load+:} false; then : $as_echo_n "(cached) " >&6 else - lt_cv_shlibpath_overrides_runpath=no - save_LDFLAGS=$LDFLAGS - save_libdir=$libdir - eval "libdir=/foo; wl=\"$lt_prog_compiler_wl_CXX\"; \ - LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec_CXX\"" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char shl_load (); #ifdef FC_DUMMY_MAIN #ifndef FC_DUMMY_MAIN_EQ_F77 # ifdef __cplusplus @@ -18219,270 +16175,433 @@ else int main () { - +return shl_load (); ; return 0; } _ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : - if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : - lt_cv_shlibpath_overrides_runpath=yes -fi +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dld_shl_load=yes +else + ac_cv_lib_dld_shl_load=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext - LDFLAGS=$save_LDFLAGS - libdir=$save_libdir - +LIBS=$ac_check_lib_save_LIBS fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 +$as_echo "$ac_cv_lib_dld_shl_load" >&6; } +if test "x$ac_cv_lib_dld_shl_load" = xyes; then : + lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" +else + ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" +if test "x$ac_cv_func_dlopen" = xyes; then : + lt_cv_dlopen="dlopen" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } +if ${ac_cv_lib_dl_dlopen+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ - shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath - - # This implies no fast_install, which is unacceptable. - # Some rework will be needed to allow for fast_install - # before this can be enabled. - hardcode_into_libs=yes - - # Append ld.so.conf contents to the search path - if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` - sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" - fi +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +#ifdef FC_DUMMY_MAIN +#ifndef FC_DUMMY_MAIN_EQ_F77 +# ifdef __cplusplus + extern "C" +# endif + int FC_DUMMY_MAIN() { return 1; } +#endif +#endif +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dl_dlopen=yes +else + ac_cv_lib_dl_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = xyes; then : + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 +$as_echo_n "checking for dlopen in -lsvld... " >&6; } +if ${ac_cv_lib_svld_dlopen+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsvld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ - # We used to test for /lib/ld.so.1 and disable shared libraries on - # powerpc, because MkLinux only supported shared libraries with the - # GNU dynamic linker. Since this was broken with cross compilers, - # most powerpc-linux boxes support dynamic linking these days and - # people can always --disable-shared, the test was removed, and we - # assume the GNU/Linux dynamic linker is in use. - dynamic_linker='GNU/Linux ld.so' - ;; +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +#ifdef FC_DUMMY_MAIN +#ifndef FC_DUMMY_MAIN_EQ_F77 +# ifdef __cplusplus + extern "C" +# endif + int FC_DUMMY_MAIN() { return 1; } +#endif +#endif +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_svld_dlopen=yes +else + ac_cv_lib_svld_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 +$as_echo "$ac_cv_lib_svld_dlopen" >&6; } +if test "x$ac_cv_lib_svld_dlopen" = xyes; then : + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 +$as_echo_n "checking for dld_link in -ldld... " >&6; } +if ${ac_cv_lib_dld_dld_link+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -netbsd*) - version_type=sunos - need_lib_prefix=no - need_version=no - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - dynamic_linker='NetBSD (a.out) ld.so' - else - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - dynamic_linker='NetBSD ld.elf_so' - fi - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dld_link (); +#ifdef FC_DUMMY_MAIN +#ifndef FC_DUMMY_MAIN_EQ_F77 +# ifdef __cplusplus + extern "C" +# endif + int FC_DUMMY_MAIN() { return 1; } +#endif +#endif +int +main () +{ +return dld_link (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dld_dld_link=yes +else + ac_cv_lib_dld_dld_link=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 +$as_echo "$ac_cv_lib_dld_dld_link" >&6; } +if test "x$ac_cv_lib_dld_dld_link" = xyes; then : + lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" +fi -newsos6) - version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; -*nto* | *qnx*) - version_type=qnx - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='ldqnx.so' - ;; +fi -openbsd*) - version_type=sunos - sys_lib_dlsearch_path_spec="/usr/lib" - need_lib_prefix=no - # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. - case $host_os in - openbsd3.3 | openbsd3.3.*) need_version=yes ;; - *) need_version=no ;; - esac - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - shlibpath_var=LD_LIBRARY_PATH - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - case $host_os in - openbsd2.[89] | openbsd2.[89].*) - shlibpath_overrides_runpath=no - ;; - *) - shlibpath_overrides_runpath=yes - ;; - esac - else - shlibpath_overrides_runpath=yes - fi - ;; -os2*) - libname_spec='$name' - shrext_cmds=".dll" - need_lib_prefix=no - library_names_spec='$libname${shared_ext} $libname.a' - dynamic_linker='OS/2 ld.exe' - shlibpath_var=LIBPATH - ;; +fi -osf3* | osf4* | osf5*) - version_type=osf - need_lib_prefix=no - need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" - sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" - ;; -rdos*) - dynamic_linker=no - ;; +fi -solaris*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - # ldd complains unless libraries are executable - postinstall_cmds='chmod +x $lib' - ;; -sunos4*) - version_type=sunos - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - if test "$with_gnu_ld" = yes; then - need_lib_prefix=no - fi - need_version=yes - ;; +fi -sysv4 | sysv4.3*) - version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - case $host_vendor in - sni) - shlibpath_overrides_runpath=no - need_lib_prefix=no - runpath_var=LD_RUN_PATH - ;; - siemens) - need_lib_prefix=no - ;; - motorola) - need_lib_prefix=no - need_version=no - shlibpath_overrides_runpath=no - sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' - ;; - esac - ;; -sysv4*MP*) - if test -d /usr/nec ;then - version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' - soname_spec='$libname${shared_ext}.$major' - shlibpath_var=LD_LIBRARY_PATH - fi - ;; +fi -sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) - version_type=freebsd-elf - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - if test "$with_gnu_ld" = yes; then - sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + ;; + esac + + if test "x$lt_cv_dlopen" != xno; then + enable_dlopen=yes else - sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' - case $host_os in - sco3.2v5*) - sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" - ;; - esac + enable_dlopen=no fi - sys_lib_dlsearch_path_spec='/usr/lib' - ;; -tpf*) - # TPF is a cross-target only. Preferred cross-host = GNU/Linux. - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; + case $lt_cv_dlopen in + dlopen) + save_CPPFLAGS="$CPPFLAGS" + test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" -uts4*) - version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - ;; + save_LDFLAGS="$LDFLAGS" + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" -*) - dynamic_linker=no - ;; -esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 -$as_echo "$dynamic_linker" >&6; } -test "$dynamic_linker" = no && can_build_shared=no + save_LIBS="$LIBS" + LIBS="$lt_cv_dlopen_libs $LIBS" -variables_saved_for_relink="PATH $shlibpath_var $runpath_var" -if test "$GCC" = yes; then - variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" -fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 +$as_echo_n "checking whether a program can dlopen itself... " >&6; } +if ${lt_cv_dlopen_self+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + lt_cv_dlopen_self=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +#line $LINENO "configure" +#include "confdefs.h" -if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then - sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" -fi -if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then - sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" -fi +#if HAVE_DLFCN_H +#include +#endif +#include +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +/* When -fvisbility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +int fnord () __attribute__((visibility("default"))); +#endif +int fnord () { return 42; } +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else + { + if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + else puts (dlerror ()); + } + /* dlclose (self); */ + } + else + puts (dlerror ()); + return status; +} +_LT_EOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&5 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; + x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self=no + fi +fi +rm -fr conftest* +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 +$as_echo "$lt_cv_dlopen_self" >&6; } + if test "x$lt_cv_dlopen_self" = xyes; then + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 +$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } +if ${lt_cv_dlopen_self_static+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + lt_cv_dlopen_self_static=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +#line $LINENO "configure" +#include "confdefs.h" +#if HAVE_DLFCN_H +#include +#endif +#include +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif +/* When -fvisbility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +int fnord () __attribute__((visibility("default"))); +#endif +int fnord () { return 42; } +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else + { + if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + else puts (dlerror ()); + } + /* dlclose (self); */ + } + else + puts (dlerror ()); + return status; +} +_LT_EOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&5 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self_static=no + fi +fi +rm -fr conftest* +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 +$as_echo "$lt_cv_dlopen_self_static" >&6; } + fi + CPPFLAGS="$save_CPPFLAGS" + LDFLAGS="$save_LDFLAGS" + LIBS="$save_LIBS" + ;; + esac + case $lt_cv_dlopen_self in + yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; + *) enable_dlopen_self=unknown ;; + esac + case $lt_cv_dlopen_self_static in + yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; + *) enable_dlopen_self_static=unknown ;; + esac +fi @@ -18499,42 +16618,35 @@ fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 -$as_echo_n "checking how to hardcode library paths into programs... " >&6; } -hardcode_action_CXX= -if test -n "$hardcode_libdir_flag_spec_CXX" || - test -n "$runpath_var_CXX" || - test "X$hardcode_automatic_CXX" = "Xyes" ; then - # We can hardcode non-existent directories. - if test "$hardcode_direct_CXX" != no && - # If the only mechanism to avoid hardcoding is shlibpath_var, we - # have to relink, otherwise we might link with an installed library - # when we should be linking with a yet-to-be-installed one - ## test "$_LT_TAGVAR(hardcode_shlibpath_var, CXX)" != no && - test "$hardcode_minus_L_CXX" != no; then - # Linking always hardcodes the temporary library directory. - hardcode_action_CXX=relink - else - # We can link without hardcoding, and we can hardcode nonexisting dirs. - hardcode_action_CXX=immediate - fi +striplib= +old_striplib= +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 +$as_echo_n "checking whether stripping libraries is possible... " >&6; } +if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then + test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" + test -z "$striplib" && striplib="$STRIP --strip-unneeded" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } else - # We cannot hardcode anything, or else we can only hardcode existing - # directories. - hardcode_action_CXX=unsupported -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action_CXX" >&5 -$as_echo "$hardcode_action_CXX" >&6; } - -if test "$hardcode_action_CXX" = relink || - test "$inherit_rpath_CXX" = yes; then - # Fast installation is not supported - enable_fast_install=no -elif test "$shlibpath_overrides_runpath" = yes || - test "$enable_shared" = no; then - # Fast installation is not necessary - enable_fast_install=needless +# FIXME - insert some real tests, host_os isn't really good enough + case $host_os in + darwin*) + if test -n "$STRIP" ; then + striplib="$STRIP -x" + old_striplib="$STRIP -S" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + fi + ;; + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + ;; + esac fi @@ -18543,316 +16655,429 @@ fi - fi # test -n "$compiler" - CC=$lt_save_CC - CFLAGS=$lt_save_CFLAGS - LDCXX=$LD - LD=$lt_save_LD - GCC=$lt_save_GCC - with_gnu_ld=$lt_save_with_gnu_ld - lt_cv_path_LDCXX=$lt_cv_path_LD - lt_cv_path_LD=$lt_save_path_LD - lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld - lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld -fi # test "$_lt_caught_CXX_error" != yes - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu + # Report which library types will actually be built + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 +$as_echo_n "checking if libtool supports shared libraries... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 +$as_echo "$can_build_shared" >&6; } - ac_ext=${ac_fc_srcext-f} -ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5' -ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_fc_compiler_gnu + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 +$as_echo_n "checking whether to build shared libraries... " >&6; } + test "$can_build_shared" = "no" && enable_shared=no + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; -if test -z "$FC" || test "X$FC" = "Xno"; then - _lt_disable_FC=yes -fi + aix[4-9]*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; + esac + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 +$as_echo "$enable_shared" >&6; } -archive_cmds_need_lc_FC=no -allow_undefined_flag_FC= -always_export_symbols_FC=no -archive_expsym_cmds_FC= -export_dynamic_flag_spec_FC= -hardcode_direct_FC=no -hardcode_direct_absolute_FC=no -hardcode_libdir_flag_spec_FC= -hardcode_libdir_separator_FC= -hardcode_minus_L_FC=no -hardcode_automatic_FC=no -inherit_rpath_FC=no -module_cmds_FC= -module_expsym_cmds_FC= -link_all_deplibs_FC=unknown -old_archive_cmds_FC=$old_archive_cmds -reload_flag_FC=$reload_flag -reload_cmds_FC=$reload_cmds -no_undefined_flag_FC= -whole_archive_flag_spec_FC= -enable_shared_with_static_runtimes_FC=no + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 +$as_echo_n "checking whether to build static libraries... " >&6; } + # Make sure either enable_shared or enable_static is yes. + test "$enable_shared" = yes || enable_static=yes + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 +$as_echo "$enable_static" >&6; } -# Source file extension for fc test sources. -ac_ext=${ac_fc_srcext-f} -# Object file extension for compiled fc test sources. -objext=o -objext_FC=$objext -# No sense in running all these tests if we already determined that -# the FC compiler isn't working. Some variables (like enable_shared) -# are currently assumed to apply to all compilers on this platform, -# and will be corrupted by setting them based on a non-working compiler. -if test "$_lt_disable_FC" != yes; then - # Code to be used in simple compile tests - lt_simple_compile_test_code="\ - subroutine t - return - end -" - # Code to be used in simple link tests - lt_simple_link_test_code="\ - program t - end -" +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu - # ltmain only uses $CC for tagged configurations so make sure $CC is set. +CC="$lt_save_CC" + if test -n "$CXX" && ( test "X$CXX" != "Xno" && + ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || + (test "X$CXX" != "Xg++"))) ; then + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5 +$as_echo_n "checking how to run the C++ preprocessor... " >&6; } +if test -z "$CXXCPP"; then + if ${ac_cv_prog_CXXCPP+:} false; then : + $as_echo_n "(cached) " >&6 +else + # Double quotes because CXXCPP needs to be expanded + for CXXCPP in "$CXX -E" "/lib/cpp" + do + ac_preproc_ok=false +for ac_cxx_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO"; then : +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + break +fi + done + ac_cv_prog_CXXCPP=$CXXCPP -# If no C compiler was specified, use CC. -LTCC=${LTCC-"$CC"} +fi + CXXCPP=$ac_cv_prog_CXXCPP +else + ac_cv_prog_CXXCPP=$CXXCPP +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5 +$as_echo "$CXXCPP" >&6; } +ac_preproc_ok=false +for ac_cxx_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO"; then : -# If no C compiler flags were specified, use CFLAGS. -LTCFLAGS=${LTCFLAGS-"$CFLAGS"} +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext -# Allow CC to be a program name with arguments. -compiler=$CC + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : - # save warnings/boilerplate of simple test code - ac_outfile=conftest.$ac_objext -echo "$lt_simple_compile_test_code" >conftest.$ac_ext -eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err -_lt_compiler_boilerplate=`cat conftest.err` -$RM conftest* +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check +See \`config.log' for more details" "$LINENO" 5; } +fi - ac_outfile=conftest.$ac_objext -echo "$lt_simple_link_test_code" >conftest.$ac_ext -eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err -_lt_linker_boilerplate=`cat conftest.err` -$RM -r conftest* +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +else + _lt_caught_CXX_error=yes +fi - # Allow CC to be a program name with arguments. - lt_save_CC="$CC" - lt_save_GCC=$GCC - lt_save_CFLAGS=$CFLAGS - CC=${FC-"f95"} - CFLAGS=$FCFLAGS - compiler=$CC - GCC=$ac_cv_fc_compiler_gnu +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - compiler_FC=$CC - for cc_temp in $compiler""; do - case $cc_temp in - compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; - distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; - \-*) ;; - *) break;; - esac -done -cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` +archive_cmds_need_lc_CXX=no +allow_undefined_flag_CXX= +always_export_symbols_CXX=no +archive_expsym_cmds_CXX= +compiler_needs_object_CXX=no +export_dynamic_flag_spec_CXX= +hardcode_direct_CXX=no +hardcode_direct_absolute_CXX=no +hardcode_libdir_flag_spec_CXX= +hardcode_libdir_separator_CXX= +hardcode_minus_L_CXX=no +hardcode_shlibpath_var_CXX=unsupported +hardcode_automatic_CXX=no +inherit_rpath_CXX=no +module_cmds_CXX= +module_expsym_cmds_CXX= +link_all_deplibs_CXX=unknown +old_archive_cmds_CXX=$old_archive_cmds +reload_flag_CXX=$reload_flag +reload_cmds_CXX=$reload_cmds +no_undefined_flag_CXX= +whole_archive_flag_spec_CXX= +enable_shared_with_static_runtimes_CXX=no +# Source file extension for C++ test sources. +ac_ext=cpp - if test -n "$compiler"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 -$as_echo_n "checking if libtool supports shared libraries... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 -$as_echo "$can_build_shared" >&6; } +# Object file extension for compiled C++ test sources. +objext=o +objext_CXX=$objext - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 -$as_echo_n "checking whether to build shared libraries... " >&6; } - test "$can_build_shared" = "no" && enable_shared=no +# No sense in running all these tests if we already determined that +# the CXX compiler isn't working. Some variables (like enable_shared) +# are currently assumed to apply to all compilers on this platform, +# and will be corrupted by setting them based on a non-working compiler. +if test "$_lt_caught_CXX_error" != yes; then + # Code to be used in simple compile tests + lt_simple_compile_test_code="int some_variable = 0;" - # On AIX, shared libraries and static libraries use the same namespace, and - # are all built from PIC. - case $host_os in - aix3*) - test "$enable_shared" = yes && enable_static=no - if test -n "$RANLIB"; then - archive_cmds="$archive_cmds~\$RANLIB \$lib" - postinstall_cmds='$RANLIB $lib' - fi - ;; - aix[4-9]*) - if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then - test "$enable_shared" = yes && enable_static=no - fi - ;; - esac - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 -$as_echo "$enable_shared" >&6; } + # Code to be used in simple link tests + lt_simple_link_test_code='int main(int, char *[]) { return(0); }' - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 -$as_echo_n "checking whether to build static libraries... " >&6; } - # Make sure either enable_shared or enable_static is yes. - test "$enable_shared" = yes || enable_static=yes - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 -$as_echo "$enable_static" >&6; } + # ltmain only uses $CC for tagged configurations so make sure $CC is set. - GCC_FC="$ac_cv_fc_compiler_gnu" - LD_FC="$LD" - ## CAVEAT EMPTOR: - ## There is no encapsulation within the following macros, do not change - ## the running order or otherwise move them around unless you know exactly - ## what you are doing... - # Dependencies to place before and after the object being linked: -predep_objects_FC= -postdep_objects_FC= -predeps_FC= -postdeps_FC= -compiler_lib_search_path_FC= -cat > conftest.$ac_ext <<_LT_EOF - subroutine foo - implicit none - integer a - a=0 - return - end -_LT_EOF -_lt_libdeps_save_CFLAGS=$CFLAGS -case "$CC $CFLAGS " in #( -*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; -*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; -*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; -esac -if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - # Parse the compiler output and extract the necessary - # objects, libraries and library flags. +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} - # Sentinel used to keep track of whether or not we are before - # the conftest object file. - pre_test_object_deps_done=no +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} - for p in `eval "$output_verbose_link_cmd"`; do - case ${prev}${p} in +# Allow CC to be a program name with arguments. +compiler=$CC - -L* | -R* | -l*) - # Some compilers place space between "-{L,R}" and the path. - # Remove the space. - if test $p = "-L" || - test $p = "-R"; then - prev=$p - continue - fi - # Expand the sysroot to ease extracting the directories later. - if test -z "$prev"; then - case $p in - -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; - -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; - -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; - esac - fi - case $p in - =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; - esac - if test "$pre_test_object_deps_done" = no; then - case ${prev} in - -L | -R) - # Internal compiler library paths should come after those - # provided the user. The postdeps already come after the - # user supplied libs so there is no need to process them. - if test -z "$compiler_lib_search_path_FC"; then - compiler_lib_search_path_FC="${prev}${p}" - else - compiler_lib_search_path_FC="${compiler_lib_search_path_FC} ${prev}${p}" - fi - ;; - # The "-l" case would never come before the object being - # linked, so don't bother handling this case. - esac - else - if test -z "$postdeps_FC"; then - postdeps_FC="${prev}${p}" - else - postdeps_FC="${postdeps_FC} ${prev}${p}" - fi - fi - prev= - ;; + # save warnings/boilerplate of simple test code + ac_outfile=conftest.$ac_objext +echo "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$RM conftest* - *.lto.$objext) ;; # Ignore GCC LTO objects - *.$objext) - # This assumes that the test object file only shows up - # once in the compiler output. - if test "$p" = "conftest.$objext"; then - pre_test_object_deps_done=yes - continue - fi + ac_outfile=conftest.$ac_objext +echo "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$RM -r conftest* - if test "$pre_test_object_deps_done" = no; then - if test -z "$predep_objects_FC"; then - predep_objects_FC="$p" - else - predep_objects_FC="$predep_objects_FC $p" - fi - else - if test -z "$postdep_objects_FC"; then - postdep_objects_FC="$p" - else - postdep_objects_FC="$postdep_objects_FC $p" - fi - fi - ;; - *) ;; # Ignore the rest. + # Allow CC to be a program name with arguments. + lt_save_CC=$CC + lt_save_CFLAGS=$CFLAGS + lt_save_LD=$LD + lt_save_GCC=$GCC + GCC=$GXX + lt_save_with_gnu_ld=$with_gnu_ld + lt_save_path_LD=$lt_cv_path_LD + if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then + lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx + else + $as_unset lt_cv_prog_gnu_ld + fi + if test -n "${lt_cv_path_LDCXX+set}"; then + lt_cv_path_LD=$lt_cv_path_LDCXX + else + $as_unset lt_cv_path_LD + fi + test -z "${LDCXX+set}" || LD=$LDCXX + CC=${CXX-"c++"} + CFLAGS=$CXXFLAGS + compiler=$CC + compiler_CXX=$CC + for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` - esac - done - # Clean up. - rm -f a.out a.exe -else - echo "libtool.m4: error: problem compiling FC test program" -fi + if test -n "$compiler"; then + # We don't want -fno-exception when compiling C++ code, so set the + # no_builtin_flag separately + if test "$GXX" = yes; then + lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin' + else + lt_prog_compiler_no_builtin_flag_CXX= + fi -$RM -f confest.$objext -CFLAGS=$_lt_libdeps_save_CFLAGS + if test "$GXX" = yes; then + # Set up default GNU C++ configuration -# PORTME: override above test on systems where it is broken -case " $postdeps_FC " in -*" -lc "*) archive_cmds_need_lc_FC=no ;; -esac - compiler_lib_search_dirs_FC= -if test -n "${compiler_lib_search_path_FC}"; then - compiler_lib_search_dirs_FC=`echo " ${compiler_lib_search_path_FC}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` +# Check whether --with-gnu-ld was given. +if test "${with_gnu_ld+set}" = set; then : + withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes +else + with_gnu_ld=no fi +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 +$as_echo_n "checking for ld used by $CC... " >&6; } + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [\\/]* | ?:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` + while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do + ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 +$as_echo_n "checking for GNU ld... " >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 +$as_echo_n "checking for non-GNU ld... " >&6; } +fi +if ${lt_cv_path_LD+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$LD"; then + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &5 +$as_echo "$LD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 +$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } +if ${lt_cv_prog_gnu_ld+:} false; then : + $as_echo_n "(cached) " >&6 +else + # I'd rather use --version here, but apparently some GNU lds only accept -v. +case `$LD -v 2>&1 &5 +$as_echo "$lt_cv_prog_gnu_ld" >&6; } +with_gnu_ld=$lt_cv_prog_gnu_ld @@ -18860,1745 +17085,1293 @@ fi + # Check if GNU C++ uses GNU ld as the underlying linker, since the + # archiving commands below assume that GNU ld is being used. + if test "$with_gnu_ld" = yes; then + archive_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' + export_dynamic_flag_spec_CXX='${wl}--export-dynamic' + # If archive_cmds runs LD, not CC, wlarc should be empty + # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to + # investigate it a little bit more. (MM) + wlarc='${wl}' + # ancient GNU ld didn't support --whole-archive et. al. + if eval "`$CC -print-prog-name=ld` --help 2>&1" | + $GREP 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + whole_archive_flag_spec_CXX= + fi + else + with_gnu_ld=no + wlarc= - lt_prog_compiler_wl_FC= -lt_prog_compiler_pic_FC= -lt_prog_compiler_static_FC= + # A generic and very simple default shared library creation + # command for GNU C++ for the case where it uses the native + # linker, instead of GNU ld. If possible, this setting should + # overridden to take advantage of the native linker features on + # the platform it is being used on. + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + fi + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' - if test "$GCC" = yes; then - lt_prog_compiler_wl_FC='-Wl,' - lt_prog_compiler_static_FC='-static' + else + GXX=no + with_gnu_ld=no + wlarc= + fi + # PORTME: fill in a description of your system's C++ link characteristics + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } + ld_shlibs_CXX=yes case $host_os in - aix*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - lt_prog_compiler_static_FC='-Bstatic' - fi - ;; - - amigaos*) - case $host_cpu in - powerpc) - # see comment about AmigaOS4 .so support - lt_prog_compiler_pic_FC='-fPIC' - ;; - m68k) - # FIXME: we need at least 68020 code to build shared libraries, but - # adding the `-m68020' flag to GCC prevents building anything better, - # like `-m68040'. - lt_prog_compiler_pic_FC='-m68020 -resident32 -malways-restore-a4' + aix3*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no ;; - esac - ;; - - beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; - - mingw* | cygwin* | pw32* | os2* | cegcc*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - # Although the cygwin gcc ignores -fPIC, still need this for old-style - # (--disable-auto-import) libraries - lt_prog_compiler_pic_FC='-DDLL_EXPORT' - ;; - - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - lt_prog_compiler_pic_FC='-fno-common' - ;; - - haiku*) - # PIC is the default for Haiku. - # The "-static" flag exists, but is broken. - lt_prog_compiler_static_FC= - ;; + aix[4-9]*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + aix_use_runtimelinking=no - hpux*) - # PIC is the default for 64-bit PA HP-UX, but not for 32-bit - # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag - # sets the default TLS model and affects inlining. - case $host_cpu in - hppa*64*) - # +Z the default - ;; - *) - lt_prog_compiler_pic_FC='-fPIC' - ;; - esac - ;; + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) + for ld_flag in $LDFLAGS; do + case $ld_flag in + *-brtl*) + aix_use_runtimelinking=yes + break + ;; + esac + done + ;; + esac - interix[3-9]*) - # Interix 3.x gcc -fpic/-fPIC options generate broken code. - # Instead, we relocate shared libraries at runtime. - ;; + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi - msdosdjgpp*) - # Just because we use GCC doesn't mean we suddenly get shared libraries - # on systems that don't support them. - lt_prog_compiler_can_build_shared_FC=no - enable_shared=no - ;; + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. - *nto* | *qnx*) - # QNX uses GNU C++, but need to define -shared option too, otherwise - # it will coredump. - lt_prog_compiler_pic_FC='-fPIC -shared' - ;; + archive_cmds_CXX='' + hardcode_direct_CXX=yes + hardcode_direct_absolute_CXX=yes + hardcode_libdir_separator_CXX=':' + link_all_deplibs_CXX=yes + file_list_spec_CXX='${wl}-f,' - sysv4*MP*) - if test -d /usr/nec; then - lt_prog_compiler_pic_FC=-Kconform_pic - fi - ;; + if test "$GXX" = yes; then + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && + strings "$collect2name" | $GREP resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + hardcode_direct_CXX=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + hardcode_minus_L_CXX=yes + hardcode_libdir_flag_spec_CXX='-L$libdir' + hardcode_libdir_separator_CXX= + fi + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi - *) - lt_prog_compiler_pic_FC='-fPIC' - ;; - esac + export_dynamic_flag_spec_CXX='${wl}-bexpall' + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to + # export. + always_export_symbols_CXX=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + allow_undefined_flag_CXX='-berok' + # Determine the default libpath from the value encoded in an empty + # executable. + if test "${lt_cv_aix_libpath+set}" = set; then + aix_libpath=$lt_cv_aix_libpath +else + if ${lt_cv_aix_libpath__CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ - case $cc_basename in - nvcc*) # Cuda Compiler Driver 2.2 - lt_prog_compiler_wl_FC='-Xlinker ' - if test -n "$lt_prog_compiler_pic_FC"; then - lt_prog_compiler_pic_FC="-Xcompiler $lt_prog_compiler_pic_FC" - fi - ;; - esac - else - # PORTME Check for flag to pass linker flags through the system compiler. - case $host_os in - aix*) - lt_prog_compiler_wl_FC='-Wl,' - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - lt_prog_compiler_static_FC='-Bstatic' - else - lt_prog_compiler_static_FC='-bnso -bI:/lib/syscalls.exp' - fi - ;; +#ifdef FC_DUMMY_MAIN +#ifndef FC_DUMMY_MAIN_EQ_F77 +# ifdef __cplusplus + extern "C" +# endif + int FC_DUMMY_MAIN() { return 1; } +#endif +#endif +int +main () +{ - mingw* | cygwin* | pw32* | os2* | cegcc*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - lt_prog_compiler_pic_FC='-DDLL_EXPORT' - ;; + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : - hpux9* | hpux10* | hpux11*) - lt_prog_compiler_wl_FC='-Wl,' - # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but - # not for PA HP-UX. - case $host_cpu in - hppa*64*|ia64*) - # +Z the default - ;; - *) - lt_prog_compiler_pic_FC='+Z' - ;; - esac - # Is there a better lt_prog_compiler_static that works with the bundled CC? - lt_prog_compiler_static_FC='${wl}-a ${wl}archive' - ;; + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$lt_cv_aix_libpath__CXX"; then + lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test -z "$lt_cv_aix_libpath__CXX"; then + lt_cv_aix_libpath__CXX="/usr/lib:/lib" + fi - irix5* | irix6* | nonstopux*) - lt_prog_compiler_wl_FC='-Wl,' - # PIC (with -KPIC) is the default. - lt_prog_compiler_static_FC='-non_shared' - ;; +fi - linux* | k*bsd*-gnu | kopensolaris*-gnu) - case $cc_basename in - # old Intel for x86_64 which still supported -KPIC. - ecc*) - lt_prog_compiler_wl_FC='-Wl,' - lt_prog_compiler_pic_FC='-KPIC' - lt_prog_compiler_static_FC='-static' - ;; - # icc used to be incompatible with GCC. - # ICC 10 doesn't accept -KPIC any more. - icc* | ifort*) - lt_prog_compiler_wl_FC='-Wl,' - lt_prog_compiler_pic_FC='-fPIC' - lt_prog_compiler_static_FC='-static' - ;; - # Lahey Fortran 8.1. - lf95*) - lt_prog_compiler_wl_FC='-Wl,' - lt_prog_compiler_pic_FC='--shared' - lt_prog_compiler_static_FC='--static' - ;; - nagfor*) - # NAG Fortran compiler - lt_prog_compiler_wl_FC='-Wl,-Wl,,' - lt_prog_compiler_pic_FC='-PIC' - lt_prog_compiler_static_FC='-Bstatic' - ;; - pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) - # Portland Group compilers (*not* the Pentium gcc compiler, - # which looks to be a dead project) - lt_prog_compiler_wl_FC='-Wl,' - lt_prog_compiler_pic_FC='-fpic' - lt_prog_compiler_static_FC='-Bstatic' - ;; - ccc*) - lt_prog_compiler_wl_FC='-Wl,' - # All Alpha code is PIC. - lt_prog_compiler_static_FC='-non_shared' - ;; - xl* | bgxl* | bgf* | mpixl*) - # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene - lt_prog_compiler_wl_FC='-Wl,' - lt_prog_compiler_pic_FC='-qpic' - lt_prog_compiler_static_FC='-qstaticlink' - ;; - *) - case `$CC -V 2>&1 | sed 5q` in - *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) - # Sun Fortran 8.3 passes all unrecognized flags to the linker - lt_prog_compiler_pic_FC='-KPIC' - lt_prog_compiler_static_FC='-Bstatic' - lt_prog_compiler_wl_FC='' - ;; - *Sun\ F* | *Sun*Fortran*) - lt_prog_compiler_pic_FC='-KPIC' - lt_prog_compiler_static_FC='-Bstatic' - lt_prog_compiler_wl_FC='-Qoption ld ' - ;; - *Sun\ C*) - # Sun C 5.9 - lt_prog_compiler_pic_FC='-KPIC' - lt_prog_compiler_static_FC='-Bstatic' - lt_prog_compiler_wl_FC='-Wl,' - ;; - *Intel*\ [CF]*Compiler*) - lt_prog_compiler_wl_FC='-Wl,' - lt_prog_compiler_pic_FC='-fPIC' - lt_prog_compiler_static_FC='-static' - ;; - *Portland\ Group*) - lt_prog_compiler_wl_FC='-Wl,' - lt_prog_compiler_pic_FC='-fpic' - lt_prog_compiler_static_FC='-Bstatic' - ;; - esac - ;; - esac - ;; + aix_libpath=$lt_cv_aix_libpath__CXX +fi - newsos6) - lt_prog_compiler_pic_FC='-KPIC' - lt_prog_compiler_static_FC='-Bstatic' - ;; + hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" - *nto* | *qnx*) - # QNX uses GNU C++, but need to define -shared option too, otherwise - # it will coredump. - lt_prog_compiler_pic_FC='-fPIC -shared' - ;; + archive_expsym_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib' + allow_undefined_flag_CXX="-z nodefs" + archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + if test "${lt_cv_aix_libpath+set}" = set; then + aix_libpath=$lt_cv_aix_libpath +else + if ${lt_cv_aix_libpath__CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ - osf3* | osf4* | osf5*) - lt_prog_compiler_wl_FC='-Wl,' - # All OSF/1 code is PIC. - lt_prog_compiler_static_FC='-non_shared' - ;; - - rdos*) - lt_prog_compiler_static_FC='-non_shared' - ;; - - solaris*) - lt_prog_compiler_pic_FC='-KPIC' - lt_prog_compiler_static_FC='-Bstatic' - case $cc_basename in - f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) - lt_prog_compiler_wl_FC='-Qoption ld ';; - *) - lt_prog_compiler_wl_FC='-Wl,';; - esac - ;; - - sunos4*) - lt_prog_compiler_wl_FC='-Qoption ld ' - lt_prog_compiler_pic_FC='-PIC' - lt_prog_compiler_static_FC='-Bstatic' - ;; - - sysv4 | sysv4.2uw2* | sysv4.3*) - lt_prog_compiler_wl_FC='-Wl,' - lt_prog_compiler_pic_FC='-KPIC' - lt_prog_compiler_static_FC='-Bstatic' - ;; - - sysv4*MP*) - if test -d /usr/nec ;then - lt_prog_compiler_pic_FC='-Kconform_pic' - lt_prog_compiler_static_FC='-Bstatic' - fi - ;; - - sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) - lt_prog_compiler_wl_FC='-Wl,' - lt_prog_compiler_pic_FC='-KPIC' - lt_prog_compiler_static_FC='-Bstatic' - ;; - - unicos*) - lt_prog_compiler_wl_FC='-Wl,' - lt_prog_compiler_can_build_shared_FC=no - ;; +#ifdef FC_DUMMY_MAIN +#ifndef FC_DUMMY_MAIN_EQ_F77 +# ifdef __cplusplus + extern "C" +# endif + int FC_DUMMY_MAIN() { return 1; } +#endif +#endif +int +main () +{ - uts4*) - lt_prog_compiler_pic_FC='-pic' - lt_prog_compiler_static_FC='-Bstatic' - ;; + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : - *) - lt_prog_compiler_can_build_shared_FC=no - ;; - esac + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$lt_cv_aix_libpath__CXX"; then + lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi - -case $host_os in - # For platforms which do not support PIC, -DPIC is meaningless: - *djgpp*) - lt_prog_compiler_pic_FC= - ;; - *) - lt_prog_compiler_pic_FC="$lt_prog_compiler_pic_FC" - ;; -esac - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 -$as_echo_n "checking for $compiler option to produce PIC... " >&6; } -if ${lt_cv_prog_compiler_pic_FC+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_prog_compiler_pic_FC=$lt_prog_compiler_pic_FC -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_FC" >&5 -$as_echo "$lt_cv_prog_compiler_pic_FC" >&6; } -lt_prog_compiler_pic_FC=$lt_cv_prog_compiler_pic_FC - -# -# Check to make sure the PIC flag actually works. -# -if test -n "$lt_prog_compiler_pic_FC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic_FC works" >&5 -$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_FC works... " >&6; } -if ${lt_cv_prog_compiler_pic_works_FC+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_prog_compiler_pic_works_FC=no - ac_outfile=conftest.$ac_objext - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="$lt_prog_compiler_pic_FC" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - # The option is referenced via a variable to avoid confusing sed. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s "$ac_outfile"; then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings other than the usual output. - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then - lt_cv_prog_compiler_pic_works_FC=yes - fi - fi - $RM conftest* - fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works_FC" >&5 -$as_echo "$lt_cv_prog_compiler_pic_works_FC" >&6; } +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test -z "$lt_cv_aix_libpath__CXX"; then + lt_cv_aix_libpath__CXX="/usr/lib:/lib" + fi -if test x"$lt_cv_prog_compiler_pic_works_FC" = xyes; then - case $lt_prog_compiler_pic_FC in - "" | " "*) ;; - *) lt_prog_compiler_pic_FC=" $lt_prog_compiler_pic_FC" ;; - esac -else - lt_prog_compiler_pic_FC= - lt_prog_compiler_can_build_shared_FC=no fi + aix_libpath=$lt_cv_aix_libpath__CXX fi + hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + no_undefined_flag_CXX=' ${wl}-bernotok' + allow_undefined_flag_CXX=' ${wl}-berok' + if test "$with_gnu_ld" = yes; then + # We only use this code for GNU lds that support --whole-archive. + whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec_CXX='$convenience' + fi + archive_cmds_need_lc_CXX=yes + # This is similar to how AIX traditionally builds its shared + # libraries. + archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag_CXX=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + ld_shlibs_CXX=no + fi + ;; + chorus*) + case $cc_basename in + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + cygwin* | mingw* | pw32* | cegcc*) + case $GXX,$cc_basename in + ,cl* | no,cl*) + # Native MSVC + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec_CXX=' ' + allow_undefined_flag_CXX=unsupported + always_export_symbols_CXX=yes + file_list_spec_CXX='@' + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' + archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; + else + $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, CXX)='true' + enable_shared_with_static_runtimes_CXX=yes + # Don't use ranlib + old_postinstall_cmds_CXX='chmod 644 $oldlib' + postlink_cmds_CXX='lt_outputfile="@OUTPUT@"~ + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile="$lt_outputfile.exe" + lt_tool_outputfile="$lt_tool_outputfile.exe" + ;; + esac~ + func_to_tool_file "$lt_outputfile"~ + if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' + ;; + *) + # g++ + # _LT_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec_CXX='-L$libdir' + export_dynamic_flag_spec_CXX='${wl}--export-all-symbols' + allow_undefined_flag_CXX=unsupported + always_export_symbols_CXX=no + enable_shared_with_static_runtimes_CXX=yes -# -# Check to make sure the static flag actually works. -# -wl=$lt_prog_compiler_wl_FC eval lt_tmp_static_flag=\"$lt_prog_compiler_static_FC\" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 -$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } -if ${lt_cv_prog_compiler_static_works_FC+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_prog_compiler_static_works_FC=no - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS $lt_tmp_static_flag" - echo "$lt_simple_link_test_code" > conftest.$ac_ext - if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then - # The linker can only warn and ignore the option if not recognized - # So say no if there are warnings - if test -s conftest.err; then - # Append any errors to the config.log. - cat conftest.err 1>&5 - $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if diff conftest.exp conftest.er2 >/dev/null; then - lt_cv_prog_compiler_static_works_FC=yes - fi - else - lt_cv_prog_compiler_static_works_FC=yes - fi - fi - $RM -r conftest* - LDFLAGS="$save_LDFLAGS" - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works_FC" >&5 -$as_echo "$lt_cv_prog_compiler_static_works_FC" >&6; } - -if test x"$lt_cv_prog_compiler_static_works_FC" = xyes; then - : -else - lt_prog_compiler_static_FC= -fi + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs_CXX=no + fi + ;; + esac + ;; + darwin* | rhapsody*) + archive_cmds_need_lc_CXX=no + hardcode_direct_CXX=no + hardcode_automatic_CXX=yes + hardcode_shlibpath_var_CXX=unsupported + if test "$lt_cv_ld_force_load" = "yes"; then + whole_archive_flag_spec_CXX='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' + else + whole_archive_flag_spec_CXX='' + fi + link_all_deplibs_CXX=yes + allow_undefined_flag_CXX="$_lt_dar_allow_undefined" + case $cc_basename in + ifort*) _lt_dar_can_shared=yes ;; + *) _lt_dar_can_shared=$GCC ;; + esac + if test "$_lt_dar_can_shared" = "yes"; then + output_verbose_link_cmd=func_echo_all + archive_cmds_CXX="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" + module_cmds_CXX="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" + archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" + module_expsym_cmds_CXX="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" + if test "$lt_cv_apple_cc_single_mod" != "yes"; then + archive_cmds_CXX="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" + archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" + fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 -$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } -if ${lt_cv_prog_compiler_c_o_FC+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_prog_compiler_c_o_FC=no - $RM -r conftest 2>/dev/null - mkdir conftest - cd conftest - mkdir out - echo "$lt_simple_compile_test_code" > conftest.$ac_ext + else + ld_shlibs_CXX=no + fi - lt_compiler_flag="-o out/conftest2.$ac_objext" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) - (eval "$lt_compile" 2>out/conftest.err) - ac_status=$? - cat out/conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s out/conftest2.$ac_objext - then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp - $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 - if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then - lt_cv_prog_compiler_c_o_FC=yes - fi - fi - chmod u+w . 2>&5 - $RM conftest* - # SGI C++ compiler will create directory out/ii_files/ for - # template instantiation - test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files - $RM out/* && rmdir out - cd .. - $RM -r conftest - $RM conftest* + ;; -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_FC" >&5 -$as_echo "$lt_cv_prog_compiler_c_o_FC" >&6; } + dgux*) + case $cc_basename in + ec++*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + ghcx*) + # Green Hills C++ Compiler + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + freebsd2.*) + # C++ shared libraries reported to be fairly broken before + # switch to ELF + ld_shlibs_CXX=no + ;; + freebsd-elf*) + archive_cmds_need_lc_CXX=no + ;; - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 -$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } -if ${lt_cv_prog_compiler_c_o_FC+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_prog_compiler_c_o_FC=no - $RM -r conftest 2>/dev/null - mkdir conftest - cd conftest - mkdir out - echo "$lt_simple_compile_test_code" > conftest.$ac_ext + freebsd* | dragonfly*) + # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF + # conventions + ld_shlibs_CXX=yes + ;; - lt_compiler_flag="-o out/conftest2.$ac_objext" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) - (eval "$lt_compile" 2>out/conftest.err) - ac_status=$? - cat out/conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s out/conftest2.$ac_objext - then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp - $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 - if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then - lt_cv_prog_compiler_c_o_FC=yes - fi - fi - chmod u+w . 2>&5 - $RM conftest* - # SGI C++ compiler will create directory out/ii_files/ for - # template instantiation - test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files - $RM out/* && rmdir out - cd .. - $RM -r conftest - $RM conftest* + gnu*) + ;; -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_FC" >&5 -$as_echo "$lt_cv_prog_compiler_c_o_FC" >&6; } + haiku*) + archive_cmds_CXX='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + link_all_deplibs_CXX=yes + ;; + hpux9*) + hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_CXX=: + export_dynamic_flag_spec_CXX='${wl}-E' + hardcode_direct_CXX=yes + hardcode_minus_L_CXX=yes # Not in the search PATH, + # but as the default + # location of the library. + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + aCC*) + archive_cmds_CXX='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + ;; + *) + if test "$GXX" = yes; then + archive_cmds_CXX='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + fi + ;; + esac + ;; + hpux10*|hpux11*) + if test $with_gnu_ld = no; then + hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_CXX=: -hard_links="nottested" -if test "$lt_cv_prog_compiler_c_o_FC" = no && test "$need_locks" != no; then - # do not overwrite the value of need_locks provided by the user - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 -$as_echo_n "checking if we can lock with hard links... " >&6; } - hard_links=yes - $RM conftest* - ln conftest.a conftest.b 2>/dev/null && hard_links=no - touch conftest.a - ln conftest.a conftest.b 2>&5 || hard_links=no - ln conftest.a conftest.b 2>/dev/null && hard_links=no - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 -$as_echo "$hard_links" >&6; } - if test "$hard_links" = no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 -$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} - need_locks=warn - fi -else - need_locks=no -fi + case $host_cpu in + hppa*64*|ia64*) + ;; + *) + export_dynamic_flag_spec_CXX='${wl}-E' + ;; + esac + fi + case $host_cpu in + hppa*64*|ia64*) + hardcode_direct_CXX=no + hardcode_shlibpath_var_CXX=no + ;; + *) + hardcode_direct_CXX=yes + hardcode_direct_absolute_CXX=yes + hardcode_minus_L_CXX=yes # Not in the search PATH, + # but as the default + # location of the library. + ;; + esac + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + aCC*) + case $host_cpu in + hppa*64*) + archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + ;; + *) + if test "$GXX" = yes; then + if test $with_gnu_ld = no; then + case $host_cpu in + hppa*64*) + archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + archive_cmds_CXX='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + archive_cmds_CXX='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + fi + else + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + fi + ;; + esac + ;; + interix[3-9]*) + hardcode_direct_CXX=no + hardcode_shlibpath_var_CXX=no + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' + export_dynamic_flag_spec_CXX='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds_CXX='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + irix5* | irix6*) + case $cc_basename in + CC*) + # SGI C++ + archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } + # Archives containing C++ object files must be created using + # "CC -ar", where "CC" is the IRIX C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs' + ;; + *) + if test "$GXX" = yes; then + if test "$with_gnu_ld" = no; then + archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib' + fi + fi + link_all_deplibs_CXX=yes + ;; + esac + hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_CXX=: + inherit_rpath_CXX=yes + ;; - runpath_var= - allow_undefined_flag_FC= - always_export_symbols_FC=no - archive_cmds_FC= - archive_expsym_cmds_FC= - compiler_needs_object_FC=no - enable_shared_with_static_runtimes_FC=no - export_dynamic_flag_spec_FC= - export_symbols_cmds_FC='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - hardcode_automatic_FC=no - hardcode_direct_FC=no - hardcode_direct_absolute_FC=no - hardcode_libdir_flag_spec_FC= - hardcode_libdir_separator_FC= - hardcode_minus_L_FC=no - hardcode_shlibpath_var_FC=unsupported - inherit_rpath_FC=no - link_all_deplibs_FC=unknown - module_cmds_FC= - module_expsym_cmds_FC= - old_archive_from_new_cmds_FC= - old_archive_from_expsyms_cmds_FC= - thread_safe_flag_spec_FC= - whole_archive_flag_spec_FC= - # include_expsyms should be a list of space-separated symbols to be *always* - # included in the symbol list - include_expsyms_FC= - # exclude_expsyms can be an extended regexp of symbols to exclude - # it will be wrapped by ` (' and `)$', so one must not match beginning or - # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', - # as well as any symbol that contains `d'. - exclude_expsyms_FC='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' - # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out - # platforms (ab)use it in PIC code, but their linkers get confused if - # the symbol is explicitly referenced. Since portable code cannot - # rely on this symbol name, it's probably fine to never include it in - # preloaded symbol tables. - # Exclude shared library initialization/finalization symbols. - extract_expsyms_cmds= + linux* | k*bsd*-gnu | kopensolaris*-gnu) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler - case $host_os in - cygwin* | mingw* | pw32* | cegcc*) - # FIXME: the MSVC++ port hasn't been tested in a loooong time - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - if test "$GCC" != yes; then - with_gnu_ld=no - fi - ;; - interix*) - # we just hope/assume this is gcc and not c89 (= MSVC++) - with_gnu_ld=yes - ;; - openbsd*) - with_gnu_ld=no - ;; - esac + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' - ld_shlibs_FC=yes + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' + export_dynamic_flag_spec_CXX='${wl}--export-dynamic' - # On some targets, GNU ld is compatible enough with the native linker - # that we're better off using the native interface for both. - lt_use_gnu_ld_interface=no - if test "$with_gnu_ld" = yes; then - case $host_os in - aix*) - # The AIX port of GNU ld has always aspired to compatibility - # with the native linker. However, as the warning in the GNU ld - # block says, versions before 2.19.5* couldn't really create working - # shared libraries, regardless of the interface used. - case `$LD -v 2>&1` in - *\ \(GNU\ Binutils\)\ 2.19.5*) ;; - *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; - *\ \(GNU\ Binutils\)\ [3-9]*) ;; - *) - lt_use_gnu_ld_interface=yes + # Archives containing C++ object files must be created using + # "CC -Bstatic", where "CC" is the KAI C++ compiler. + old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; - esac - ;; - *) - lt_use_gnu_ld_interface=yes - ;; - esac - fi - - if test "$lt_use_gnu_ld_interface" = yes; then - # If archive_cmds runs LD, not CC, wlarc should be empty - wlarc='${wl}' - - # Set some defaults for GNU ld with shared library support. These - # are reset later if shared libraries are not supported. Putting them - # here allows them to be overridden if necessary. - runpath_var=LD_RUN_PATH - hardcode_libdir_flag_spec_FC='${wl}-rpath ${wl}$libdir' - export_dynamic_flag_spec_FC='${wl}--export-dynamic' - # ancient GNU ld didn't support --whole-archive et. al. - if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then - whole_archive_flag_spec_FC="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - whole_archive_flag_spec_FC= - fi - supports_anon_versioning=no - case `$LD -v 2>&1` in - *GNU\ gold*) supports_anon_versioning=yes ;; - *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 - *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... - *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... - *\ 2.11.*) ;; # other 2.11 versions - *) supports_anon_versioning=yes ;; - esac - - # See if GNU ld supports shared libraries. - case $host_os in - aix[3-9]*) - # On AIX/PPC, the GNU linker is very broken - if test "$host_cpu" != ia64; then - ld_shlibs_FC=no - cat <<_LT_EOF 1>&2 - -*** Warning: the GNU linker, at least up to release 2.19, is reported -*** to be unable to reliably create shared libraries on AIX. -*** Therefore, libtool is disabling shared libraries support. If you -*** really care for shared libraries, you may want to install binutils -*** 2.20 or above, or modify your PATH so that a non-GNU linker is found. -*** You will then need to restart the configuration process. + icpc* | ecpc* ) + # Intel C++ + with_gnu_ld=yes + # version 8.0 and above of icpc choke on multiply defined symbols + # if we add $predep_objects and $postdep_objects, however 7.1 and + # earlier do not add the objects themselves. + case `$CC -V 2>&1` in + *"Version 7."*) + archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + ;; + *) # Version 8.0 or newer + tmp_idyn= + case $host_cpu in + ia64*) tmp_idyn=' -i_dynamic';; + esac + archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + ;; + esac + archive_cmds_need_lc_CXX=no + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' + export_dynamic_flag_spec_CXX='${wl}--export-dynamic' + whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + ;; + pgCC* | pgcpp*) + # Portland Group C++ compiler + case `$CC -V` in + *pgCC\ [1-5].* | *pgcpp\ [1-5].*) + prelink_cmds_CXX='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ + compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' + old_archive_cmds_CXX='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ + $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ + $RANLIB $oldlib' + archive_cmds_CXX='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + archive_expsym_cmds_CXX='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' + ;; + *) # Version 6 and above use weak symbols + archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' + ;; + esac -_LT_EOF - fi - ;; + hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' + export_dynamic_flag_spec_CXX='${wl}--export-dynamic' + whole_archive_flag_spec_CXX='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + ;; + cxx*) + # Compaq C++ + archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' - amigaos*) - case $host_cpu in - powerpc) - # see comment about AmigaOS4 .so support - archive_cmds_FC='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_FC='' - ;; - m68k) - archive_cmds_FC='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - hardcode_libdir_flag_spec_FC='-L$libdir' - hardcode_minus_L_FC=yes - ;; - esac - ;; + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec_CXX='-rpath $libdir' + hardcode_libdir_separator_CXX=: - beos*) - if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - allow_undefined_flag_FC=unsupported - # Joseph Beckenbach says some releases of gcc - # support --undefined. This deserves some investigation. FIXME - archive_cmds_FC='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - else - ld_shlibs_FC=no - fi - ;; + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' + ;; + xl* | mpixl* | bgxl*) + # IBM XL 8.0 on PPC, with GNU ld + hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' + export_dynamic_flag_spec_CXX='${wl}--export-dynamic' + archive_cmds_CXX='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + if test "x$supports_anon_versioning" = xyes; then + archive_expsym_cmds_CXX='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + no_undefined_flag_CXX=' -zdefs' + archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + archive_expsym_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' + hardcode_libdir_flag_spec_CXX='-R$libdir' + whole_archive_flag_spec_CXX='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + compiler_needs_object_CXX=yes - cygwin* | mingw* | pw32* | cegcc*) - # _LT_TAGVAR(hardcode_libdir_flag_spec, FC) is actually meaningless, - # as there is no search path for DLLs. - hardcode_libdir_flag_spec_FC='-L$libdir' - export_dynamic_flag_spec_FC='${wl}--export-all-symbols' - allow_undefined_flag_FC=unsupported - always_export_symbols_FC=no - enable_shared_with_static_runtimes_FC=yes - export_symbols_cmds_FC='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' - exclude_expsyms_FC='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' + # Not sure whether something based on + # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 + # would be better. + output_verbose_link_cmd='func_echo_all' - if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then - archive_cmds_FC='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is; otherwise, prepend... - archive_expsym_cmds_FC='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - else - ld_shlibs_FC=no - fi - ;; + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' + ;; + esac + ;; + esac + ;; - haiku*) - archive_cmds_FC='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - link_all_deplibs_FC=yes - ;; + lynxos*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; - interix[3-9]*) - hardcode_direct_FC=no - hardcode_shlibpath_var_FC=no - hardcode_libdir_flag_spec_FC='${wl}-rpath,$libdir' - export_dynamic_flag_spec_FC='${wl}-E' - # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. - # Instead, shared libraries are loaded at an image base (0x10000000 by - # default) and relocated if they conflict, which is a slow very memory - # consuming and fragmenting process. To avoid this, we pick a random, - # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link - # time. Moving up from 0x10000000 also allows more sbrk(2) space. - archive_cmds_FC='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - archive_expsym_cmds_FC='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - ;; + m88k*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; - gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) - tmp_diet=no - if test "$host_os" = linux-dietlibc; then - case $cc_basename in - diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) - esac - fi - if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ - && test "$tmp_diet" = no - then - tmp_addflag=' $pic_flag' - tmp_sharedflag='-shared' - case $cc_basename,$host_cpu in - pgcc*) # Portland Group C compiler - whole_archive_flag_spec_FC='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' - tmp_addflag=' $pic_flag' - ;; - pgf77* | pgf90* | pgf95* | pgfortran*) - # Portland Group f77 and f90 compilers - whole_archive_flag_spec_FC='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' - tmp_addflag=' $pic_flag -Mnomain' ;; - ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 - tmp_addflag=' -i_dynamic' ;; - efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 - tmp_addflag=' -i_dynamic -nofor_main' ;; - ifc* | ifort*) # Intel Fortran compiler - tmp_addflag=' -nofor_main' ;; - lf95*) # Lahey Fortran 8.1 - whole_archive_flag_spec_FC= - tmp_sharedflag='--shared' ;; - xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) - tmp_sharedflag='-qmkshrobj' - tmp_addflag= ;; - nvcc*) # Cuda Compiler Driver 2.2 - whole_archive_flag_spec_FC='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' - compiler_needs_object_FC=yes - ;; - esac - case `$CC -V 2>&1 | sed 5q` in - *Sun\ C*) # Sun C 5.9 - whole_archive_flag_spec_FC='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' - compiler_needs_object_FC=yes - tmp_sharedflag='-G' ;; - *Sun\ F*) # Sun Fortran 8.3 - tmp_sharedflag='-G' ;; + mvs*) + case $cc_basename in + cxx*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; esac - archive_cmds_FC='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + ;; - if test "x$supports_anon_versioning" = xyes; then - archive_expsym_cmds_FC='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' - fi - - case $cc_basename in - xlf* | bgf* | bgxlf* | mpixlf*) - # IBM XL Fortran 10.1 on PPC cannot create shared libs itself - whole_archive_flag_spec_FC='--whole-archive$convenience --no-whole-archive' - hardcode_libdir_flag_spec_FC='${wl}-rpath ${wl}$libdir' - archive_cmds_FC='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' - if test "x$supports_anon_versioning" = xyes; then - archive_expsym_cmds_FC='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - echo "local: *; };" >> $output_objdir/$libname.ver~ - $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' - fi - ;; - esac - else - ld_shlibs_FC=no - fi - ;; - - netbsd*) - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - archive_cmds_FC='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' - wlarc= - else - archive_cmds_FC='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_FC='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - fi - ;; - - solaris*) - if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then - ld_shlibs_FC=no - cat <<_LT_EOF 1>&2 - -*** Warning: The releases 2.8.* of the GNU linker cannot reliably -*** create shared libraries on Solaris systems. Therefore, libtool -*** is disabling shared libraries support. We urge you to upgrade GNU -*** binutils to release 2.9.1 or newer. Another option is to modify -*** your PATH or compiler configuration so that the native linker is -*** used, and then restart. - -_LT_EOF - elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - archive_cmds_FC='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_FC='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs_FC=no - fi - ;; - - sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) - case `$LD -v 2>&1` in - *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) - ld_shlibs_FC=no - cat <<_LT_EOF 1>&2 + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' + wlarc= + hardcode_libdir_flag_spec_CXX='-R$libdir' + hardcode_direct_CXX=yes + hardcode_shlibpath_var_CXX=no + fi + # Workaround some broken pre-1.5 toolchains + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' + ;; -*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not -*** reliably create shared libraries on SCO systems. Therefore, libtool -*** is disabling shared libraries support. We urge you to upgrade GNU -*** binutils to release 2.16.91.0.3 or newer. Another option is to modify -*** your PATH or compiler configuration so that the native linker is -*** used, and then restart. + *nto* | *qnx*) + ld_shlibs_CXX=yes + ;; -_LT_EOF + openbsd2*) + # C++ shared libraries are fairly broken + ld_shlibs_CXX=no ;; - *) - # For security reasons, it is highly recommended that you always - # use absolute paths for naming shared libraries, and exclude the - # DT_RUNPATH tag from executables and libraries. But doing so - # requires that you compile everything twice, which is a pain. - if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - hardcode_libdir_flag_spec_FC='${wl}-rpath ${wl}$libdir' - archive_cmds_FC='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_FC='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs_FC=no + + openbsd*) + if test -f /usr/libexec/ld.so; then + hardcode_direct_CXX=yes + hardcode_shlibpath_var_CXX=no + hardcode_direct_absolute_CXX=yes + archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' + export_dynamic_flag_spec_CXX='${wl}-E' + whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi + output_verbose_link_cmd=func_echo_all + else + ld_shlibs_CXX=no + fi ;; - esac - ;; - sunos4*) - archive_cmds_FC='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' - wlarc= - hardcode_direct_FC=yes - hardcode_shlibpath_var_FC=no - ;; + osf3* | osf4* | osf5*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler - *) - if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - archive_cmds_FC='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_FC='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs_FC=no - fi - ;; - esac + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - if test "$ld_shlibs_FC" = no; then - runpath_var= - hardcode_libdir_flag_spec_FC= - export_dynamic_flag_spec_FC= - whole_archive_flag_spec_FC= - fi - else - # PORTME fill in a description of your system's linker (not GNU ld) - case $host_os in - aix3*) - allow_undefined_flag_FC=unsupported - always_export_symbols_FC=yes - archive_expsym_cmds_FC='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' - # Note: this linker hardcodes the directories in LIBPATH if there - # are no directories specified by -L. - hardcode_minus_L_FC=yes - if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then - # Neither direct hardcoding nor static linking is supported with a - # broken collect2. - hardcode_direct_FC=unsupported - fi - ;; + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' + hardcode_libdir_separator_CXX=: - aix[4-9]*) - if test "$host_cpu" = ia64; then - # On IA64, the linker does run time linking by default, so we don't - # have to do anything special. - aix_use_runtimelinking=no - exp_sym_flag='-Bexport' - no_entry_flag="" - else - # If we're using GNU nm, then we don't want the "-C" option. - # -C means demangle to AIX nm, but means don't demangle with GNU nm - # Also, AIX nm treats weak defined symbols like other global - # defined symbols, whereas GNU nm marks them as "W". - if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then - export_symbols_cmds_FC='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' - else - export_symbols_cmds_FC='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' - fi - aix_use_runtimelinking=no + # Archives containing C++ object files must be created using + # the KAI C++ compiler. + case $host in + osf3*) old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; + *) old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' ;; + esac + ;; + RCC*) + # Rational C++ 2.4.1 + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + cxx*) + case $host in + osf3*) + allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' + ;; + *) + allow_undefined_flag_CXX=' -expect_unresolved \*' + archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ + echo "-hidden">> $lib.exp~ + $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~ + $RM $lib.exp' + hardcode_libdir_flag_spec_CXX='-rpath $libdir' + ;; + esac - # Test if we are trying to use run time linking or normal - # AIX style linking. If -brtl is somewhere in LDFLAGS, we - # need to do runtime linking. - case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) - for ld_flag in $LDFLAGS; do - if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then - aix_use_runtimelinking=yes - break - fi - done - ;; - esac + hardcode_libdir_separator_CXX=: - exp_sym_flag='-bexport' - no_entry_flag='-bnoentry' - fi + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + ;; + *) + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' + case $host in + osf3*) + archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + ;; + *) + archive_cmds_CXX='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + ;; + esac - # When large executables or shared objects are built, AIX ld can - # have problems creating the table of contents. If linking a library - # or program results in "error TOC overflow" add -mminimal-toc to - # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not - # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_CXX=: - archive_cmds_FC='' - hardcode_direct_FC=yes - hardcode_direct_absolute_FC=yes - hardcode_libdir_separator_FC=':' - link_all_deplibs_FC=yes - file_list_spec_FC='${wl}-f,' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' - if test "$GCC" = yes; then - case $host_os in aix4.[012]|aix4.[012].*) - # We only want to do this on AIX 4.2 and lower, the check - # below for broken collect2 doesn't work under 4.3+ - collect2name=`${CC} -print-prog-name=collect2` - if test -f "$collect2name" && - strings "$collect2name" | $GREP resolve_lib_name >/dev/null - then - # We have reworked collect2 - : - else - # We have old collect2 - hardcode_direct_FC=unsupported - # It fails to find uninstalled libraries when the uninstalled - # path is not listed in the libpath. Setting hardcode_minus_L - # to unsupported forces relinking - hardcode_minus_L_FC=yes - hardcode_libdir_flag_spec_FC='-L$libdir' - hardcode_libdir_separator_FC= - fi - ;; - esac - shared_flag='-shared' - if test "$aix_use_runtimelinking" = yes; then - shared_flag="$shared_flag "'${wl}-G' - fi - else - # not using gcc - if test "$host_cpu" = ia64; then - # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release - # chokes on -Wl,-G. The following line is correct: - shared_flag='-G' - else - if test "$aix_use_runtimelinking" = yes; then - shared_flag='${wl}-G' - else - shared_flag='${wl}-bM:SRE' - fi - fi - fi + else + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + fi + ;; + esac + ;; - export_dynamic_flag_spec_FC='${wl}-bexpall' - # It seems that -bexpall does not export symbols beginning with - # underscore (_), so it is better to generate a list of symbols to export. - always_export_symbols_FC=yes - if test "$aix_use_runtimelinking" = yes; then - # Warning - without using the other runtime loading flags (-brtl), - # -berok will link without error, but may produce a broken library. - allow_undefined_flag_FC='-berok' - # Determine the default libpath from the value encoded in an - # empty executable. - if test "${lt_cv_aix_libpath+set}" = set; then - aix_libpath=$lt_cv_aix_libpath -else - if ${lt_cv_aix_libpath__FC+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat > conftest.$ac_ext <<_ACEOF - program main + psos*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; - end -_ACEOF -if ac_fn_fc_try_link "$LINENO"; then : + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + lcc*) + # Lucid + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; - lt_aix_libpath_sed=' - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\([^ ]*\) *$/\1/ - p - } - }' - lt_cv_aix_libpath__FC=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - # Check for a 64-bit object if we didn't find anything. - if test -z "$lt_cv_aix_libpath__FC"; then - lt_cv_aix_libpath__FC=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - fi -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - if test -z "$lt_cv_aix_libpath__FC"; then - lt_cv_aix_libpath__FC="/usr/lib:/lib" - fi + solaris*) + case $cc_basename in + CC* | sunCC*) + # Sun C++ 4.2, 5.x and Centerline C++ + archive_cmds_need_lc_CXX=yes + no_undefined_flag_CXX=' -zdefs' + archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' -fi + hardcode_libdir_flag_spec_CXX='-R$libdir' + hardcode_shlibpath_var_CXX=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands `-z linker_flag'. + # Supported since Solaris 2.6 (maybe 2.5.1?) + whole_archive_flag_spec_CXX='-z allextract$convenience -z defaultextract' + ;; + esac + link_all_deplibs_CXX=yes - aix_libpath=$lt_cv_aix_libpath__FC -fi + output_verbose_link_cmd='func_echo_all' - hardcode_libdir_flag_spec_FC='${wl}-blibpath:$libdir:'"$aix_libpath" - archive_expsym_cmds_FC='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" - else - if test "$host_cpu" = ia64; then - hardcode_libdir_flag_spec_FC='${wl}-R $libdir:/usr/lib:/lib' - allow_undefined_flag_FC="-z nodefs" - archive_expsym_cmds_FC="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" - else - # Determine the default libpath from the value encoded in an - # empty executable. - if test "${lt_cv_aix_libpath+set}" = set; then - aix_libpath=$lt_cv_aix_libpath -else - if ${lt_cv_aix_libpath__FC+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat > conftest.$ac_ext <<_ACEOF - program main + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' + ;; + gcx*) + # Green Hills C++ Compiler + archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - end -_ACEOF -if ac_fn_fc_try_link "$LINENO"; then : + # The C++ compiler must be used to create the archive. + old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs' + ;; + *) + # GNU C++ compiler with Solaris linker + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + no_undefined_flag_CXX=' ${wl}-z ${wl}defs' + if $CC --version | $GREP -v '^2\.7' > /dev/null; then + archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' - lt_aix_libpath_sed=' - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\([^ ]*\) *$/\1/ - p - } - }' - lt_cv_aix_libpath__FC=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - # Check for a 64-bit object if we didn't find anything. - if test -z "$lt_cv_aix_libpath__FC"; then - lt_cv_aix_libpath__FC=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - fi -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - if test -z "$lt_cv_aix_libpath__FC"; then - lt_cv_aix_libpath__FC="/usr/lib:/lib" - fi + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + else + # g++ 2.7 appears to require `-G' NOT `-shared' on this + # platform. + archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' -fi + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + fi - aix_libpath=$lt_cv_aix_libpath__FC -fi + hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir' + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + ;; + esac + fi + ;; + esac + ;; - hardcode_libdir_flag_spec_FC='${wl}-blibpath:$libdir:'"$aix_libpath" - # Warning - without using the other run time loading flags, - # -berok will link without error, but may produce a broken library. - no_undefined_flag_FC=' ${wl}-bernotok' - allow_undefined_flag_FC=' ${wl}-berok' - if test "$with_gnu_ld" = yes; then - # We only use this code for GNU lds that support --whole-archive. - whole_archive_flag_spec_FC='${wl}--whole-archive$convenience ${wl}--no-whole-archive' - else - # Exported symbols can be pulled into shared objects from archives - whole_archive_flag_spec_FC='$convenience' - fi - archive_cmds_need_lc_FC=yes - # This is similar to how AIX traditionally builds its shared libraries. - archive_expsym_cmds_FC="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' - fi - fi - ;; + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) + no_undefined_flag_CXX='${wl}-z,text' + archive_cmds_need_lc_CXX=no + hardcode_shlibpath_var_CXX=no + runpath_var='LD_RUN_PATH' - amigaos*) - case $host_cpu in - powerpc) - # see comment about AmigaOS4 .so support - archive_cmds_FC='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_FC='' - ;; - m68k) - archive_cmds_FC='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - hardcode_libdir_flag_spec_FC='-L$libdir' - hardcode_minus_L_FC=yes - ;; + case $cc_basename in + CC*) + archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; esac ;; - bsdi[45]*) - export_dynamic_flag_spec_FC=-rdynamic - ;; + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + no_undefined_flag_CXX='${wl}-z,text' + allow_undefined_flag_CXX='${wl}-z,nodefs' + archive_cmds_need_lc_CXX=no + hardcode_shlibpath_var_CXX=no + hardcode_libdir_flag_spec_CXX='${wl}-R,$libdir' + hardcode_libdir_separator_CXX=':' + link_all_deplibs_CXX=yes + export_dynamic_flag_spec_CXX='${wl}-Bexport' + runpath_var='LD_RUN_PATH' - cygwin* | mingw* | pw32* | cegcc*) - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - # hardcode_libdir_flag_spec is actually meaningless, as there is - # no search path for DLLs. - case $cc_basename in - cl*) - # Native MSVC - hardcode_libdir_flag_spec_FC=' ' - allow_undefined_flag_FC=unsupported - always_export_symbols_FC=yes - file_list_spec_FC='@' - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" - # FIXME: Setting linknames here is a bad hack. - archive_cmds_FC='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' - archive_expsym_cmds_FC='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; - else - sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; - fi~ - $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ - linknames=' - # The linker will not automatically build a static lib if we build a DLL. - # _LT_TAGVAR(old_archive_from_new_cmds, FC)='true' - enable_shared_with_static_runtimes_FC=yes - exclude_expsyms_FC='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' - export_symbols_cmds_FC='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' - # Don't use ranlib - old_postinstall_cmds_FC='chmod 644 $oldlib' - postlink_cmds_FC='lt_outputfile="@OUTPUT@"~ - lt_tool_outputfile="@TOOL_OUTPUT@"~ - case $lt_outputfile in - *.exe|*.EXE) ;; - *) - lt_outputfile="$lt_outputfile.exe" - lt_tool_outputfile="$lt_tool_outputfile.exe" - ;; - esac~ - if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then - $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; - $RM "$lt_outputfile.manifest"; - fi' - ;; - *) - # Assume MSVC wrapper - hardcode_libdir_flag_spec_FC=' ' - allow_undefined_flag_FC=unsupported - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" - # FIXME: Setting linknames here is a bad hack. - archive_cmds_FC='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' - # The linker will automatically build a .lib file if we build a DLL. - old_archive_from_new_cmds_FC='true' - # FIXME: Should let the user specify the lib program. - old_archive_cmds_FC='lib -OUT:$oldlib$oldobjs$old_deplibs' - enable_shared_with_static_runtimes_FC=yes - ;; - esac + case $cc_basename in + CC*) + archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + old_archive_cmds_CXX='$CC -Tprelink_objects $oldobjs~ + '"$old_archive_cmds_CXX" + reload_cmds_CXX='$CC -Tprelink_objects $reload_objs~ + '"$reload_cmds_CXX" + ;; + *) + archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac ;; - darwin* | rhapsody*) + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + vxworks*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; - archive_cmds_need_lc_FC=no - hardcode_direct_FC=no - hardcode_automatic_FC=yes - hardcode_shlibpath_var_FC=unsupported - if test "$lt_cv_ld_force_load" = "yes"; then - whole_archive_flag_spec_FC='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' - compiler_needs_object_FC=yes - else - whole_archive_flag_spec_FC='' - fi - link_all_deplibs_FC=yes - allow_undefined_flag_FC="$_lt_dar_allow_undefined" - case $cc_basename in - ifort*) _lt_dar_can_shared=yes ;; - *) _lt_dar_can_shared=$GCC ;; - esac - if test "$_lt_dar_can_shared" = "yes"; then - output_verbose_link_cmd=func_echo_all - archive_cmds_FC="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" - module_cmds_FC="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" - archive_expsym_cmds_FC="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" - module_expsym_cmds_FC="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac - else - ld_shlibs_FC=no - fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 +$as_echo "$ld_shlibs_CXX" >&6; } + test "$ld_shlibs_CXX" = no && can_build_shared=no - ;; + GCC_CXX="$GXX" + LD_CXX="$LD" - dgux*) - archive_cmds_FC='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec_FC='-L$libdir' - hardcode_shlibpath_var_FC=no - ;; + ## CAVEAT EMPTOR: + ## There is no encapsulation within the following macros, do not change + ## the running order or otherwise move them around unless you know exactly + ## what you are doing... + # Dependencies to place before and after the object being linked: +predep_objects_CXX= +postdep_objects_CXX= +predeps_CXX= +postdeps_CXX= +compiler_lib_search_path_CXX= - # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor - # support. Future versions do this automatically, but an explicit c++rt0.o - # does not break anything, and helps significantly (at the cost of a little - # extra space). - freebsd2.2*) - archive_cmds_FC='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' - hardcode_libdir_flag_spec_FC='-R$libdir' - hardcode_direct_FC=yes - hardcode_shlibpath_var_FC=no - ;; +cat > conftest.$ac_ext <<_LT_EOF +class Foo +{ +public: + Foo (void) { a = 0; } +private: + int a; +}; +_LT_EOF - # Unfortunately, older versions of FreeBSD 2 do not have this feature. - freebsd2.*) - archive_cmds_FC='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct_FC=yes - hardcode_minus_L_FC=yes - hardcode_shlibpath_var_FC=no - ;; - # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd* | dragonfly*) - archive_cmds_FC='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec_FC='-R$libdir' - hardcode_direct_FC=yes - hardcode_shlibpath_var_FC=no - ;; +_lt_libdeps_save_CFLAGS=$CFLAGS +case "$CC $CFLAGS " in #( +*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; +*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; +*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; +esac - hpux9*) - if test "$GCC" = yes; then - archive_cmds_FC='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - else - archive_cmds_FC='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - fi - hardcode_libdir_flag_spec_FC='${wl}+b ${wl}$libdir' - hardcode_libdir_separator_FC=: - hardcode_direct_FC=yes +if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + # Parse the compiler output and extract the necessary + # objects, libraries and library flags. - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L_FC=yes - export_dynamic_flag_spec_FC='${wl}-E' - ;; + # Sentinel used to keep track of whether or not we are before + # the conftest object file. + pre_test_object_deps_done=no - hpux10*) - if test "$GCC" = yes && test "$with_gnu_ld" = no; then - archive_cmds_FC='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds_FC='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' - fi - if test "$with_gnu_ld" = no; then - hardcode_libdir_flag_spec_FC='${wl}+b ${wl}$libdir' - hardcode_libdir_separator_FC=: - hardcode_direct_FC=yes - hardcode_direct_absolute_FC=yes - export_dynamic_flag_spec_FC='${wl}-E' - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L_FC=yes - fi - ;; + for p in `eval "$output_verbose_link_cmd"`; do + case ${prev}${p} in - hpux11*) - if test "$GCC" = yes && test "$with_gnu_ld" = no; then - case $host_cpu in - hppa*64*) - archive_cmds_FC='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - ia64*) - archive_cmds_FC='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - archive_cmds_FC='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - else - case $host_cpu in - hppa*64*) - archive_cmds_FC='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - ia64*) - archive_cmds_FC='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - archive_cmds_FC='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - fi - if test "$with_gnu_ld" = no; then - hardcode_libdir_flag_spec_FC='${wl}+b ${wl}$libdir' - hardcode_libdir_separator_FC=: + -L* | -R* | -l*) + # Some compilers place space between "-{L,R}" and the path. + # Remove the space. + if test $p = "-L" || + test $p = "-R"; then + prev=$p + continue + fi - case $host_cpu in - hppa*64*|ia64*) - hardcode_direct_FC=no - hardcode_shlibpath_var_FC=no - ;; - *) - hardcode_direct_FC=yes - hardcode_direct_absolute_FC=yes - export_dynamic_flag_spec_FC='${wl}-E' + # Expand the sysroot to ease extracting the directories later. + if test -z "$prev"; then + case $p in + -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; + -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; + -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; + esac + fi + case $p in + =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; + esac + if test "$pre_test_object_deps_done" = no; then + case ${prev} in + -L | -R) + # Internal compiler library paths should come after those + # provided the user. The postdeps already come after the + # user supplied libs so there is no need to process them. + if test -z "$compiler_lib_search_path_CXX"; then + compiler_lib_search_path_CXX="${prev}${p}" + else + compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${prev}${p}" + fi + ;; + # The "-l" case would never come before the object being + # linked, so don't bother handling this case. + esac + else + if test -z "$postdeps_CXX"; then + postdeps_CXX="${prev}${p}" + else + postdeps_CXX="${postdeps_CXX} ${prev}${p}" + fi + fi + prev= + ;; - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L_FC=yes - ;; - esac - fi - ;; + *.lto.$objext) ;; # Ignore GCC LTO objects + *.$objext) + # This assumes that the test object file only shows up + # once in the compiler output. + if test "$p" = "conftest.$objext"; then + pre_test_object_deps_done=yes + continue + fi - irix5* | irix6* | nonstopux*) - if test "$GCC" = yes; then - archive_cmds_FC='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - # Try to use the -exported_symbol ld option, if it does not - # work, assume that -exports_file does not work either and - # implicitly export all symbols. - # This should be the same for all languages, so no per-tag cache variable. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 -$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } -if ${lt_cv_irix_exported_symbol+:} false; then : - $as_echo_n "(cached) " >&6 -else - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" - cat > conftest.$ac_ext <<_ACEOF + if test "$pre_test_object_deps_done" = no; then + if test -z "$predep_objects_CXX"; then + predep_objects_CXX="$p" + else + predep_objects_CXX="$predep_objects_CXX $p" + fi + else + if test -z "$postdep_objects_CXX"; then + postdep_objects_CXX="$p" + else + postdep_objects_CXX="$postdep_objects_CXX $p" + fi + fi + ;; - subroutine foo - end -_ACEOF -if ac_fn_fc_try_link "$LINENO"; then : - lt_cv_irix_exported_symbol=yes + *) ;; # Ignore the rest. + + esac + done + + # Clean up. + rm -f a.out a.exe else - lt_cv_irix_exported_symbol=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - LDFLAGS="$save_LDFLAGS" + echo "libtool.m4: error: problem compiling CXX test program" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 -$as_echo "$lt_cv_irix_exported_symbol" >&6; } - if test "$lt_cv_irix_exported_symbol" = yes; then - archive_expsym_cmds_FC='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' - fi - else - archive_cmds_FC='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' - archive_expsym_cmds_FC='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' - fi - archive_cmds_need_lc_FC='no' - hardcode_libdir_flag_spec_FC='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_FC=: - inherit_rpath_FC=yes - link_all_deplibs_FC=yes - ;; - netbsd*) - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - archive_cmds_FC='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out - else - archive_cmds_FC='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF - fi - hardcode_libdir_flag_spec_FC='-R$libdir' - hardcode_direct_FC=yes - hardcode_shlibpath_var_FC=no - ;; +$RM -f confest.$objext +CFLAGS=$_lt_libdeps_save_CFLAGS - newsos6) - archive_cmds_FC='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct_FC=yes - hardcode_libdir_flag_spec_FC='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_FC=: - hardcode_shlibpath_var_FC=no - ;; +# PORTME: override above test on systems where it is broken +case $host_os in +interix[3-9]*) + # Interix 3.5 installs completely hosed .la files for C++, so rather than + # hack all around it, let's just trust "g++" to DTRT. + predep_objects_CXX= + postdep_objects_CXX= + postdeps_CXX= + ;; - *nto* | *qnx*) - ;; +linux*) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 - openbsd*) - if test -f /usr/libexec/ld.so; then - hardcode_direct_FC=yes - hardcode_shlibpath_var_FC=no - hardcode_direct_absolute_FC=yes - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - archive_cmds_FC='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_FC='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' - hardcode_libdir_flag_spec_FC='${wl}-rpath,$libdir' - export_dynamic_flag_spec_FC='${wl}-E' - else - case $host_os in - openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) - archive_cmds_FC='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec_FC='-R$libdir' - ;; - *) - archive_cmds_FC='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec_FC='${wl}-rpath,$libdir' - ;; - esac - fi - else - ld_shlibs_FC=no - fi + # The more standards-conforming stlport4 library is + # incompatible with the Cstd library. Avoid specifying + # it if it's in CXXFLAGS. Ignore libCrun as + # -library=stlport4 depends on it. + case " $CXX $CXXFLAGS " in + *" -library=stlport4 "*) + solaris_use_stlport4=yes ;; + esac - os2*) - hardcode_libdir_flag_spec_FC='-L$libdir' - hardcode_minus_L_FC=yes - allow_undefined_flag_FC=unsupported - archive_cmds_FC='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' - old_archive_from_new_cmds_FC='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + if test "$solaris_use_stlport4" != yes; then + postdeps_CXX='-library=Cstd -library=Crun' + fi + ;; + esac + ;; + +solaris*) + case $cc_basename in + CC* | sunCC*) + # The more standards-conforming stlport4 library is + # incompatible with the Cstd library. Avoid specifying + # it if it's in CXXFLAGS. Ignore libCrun as + # -library=stlport4 depends on it. + case " $CXX $CXXFLAGS " in + *" -library=stlport4 "*) + solaris_use_stlport4=yes ;; + esac - osf3*) - if test "$GCC" = yes; then - allow_undefined_flag_FC=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds_FC='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - allow_undefined_flag_FC=' -expect_unresolved \*' - archive_cmds_FC='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' - fi - archive_cmds_need_lc_FC='no' - hardcode_libdir_flag_spec_FC='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_FC=: - ;; + # Adding this requires a known-good setup of shared libraries for + # Sun compiler versions before 5.6, else PIC objects from an old + # archive will be linked into the output, leading to subtle bugs. + if test "$solaris_use_stlport4" != yes; then + postdeps_CXX='-library=Cstd -library=Crun' + fi + ;; + esac + ;; +esac - osf4* | osf5*) # as osf3* with the addition of -msym flag - if test "$GCC" = yes; then - allow_undefined_flag_FC=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds_FC='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - hardcode_libdir_flag_spec_FC='${wl}-rpath ${wl}$libdir' - else - allow_undefined_flag_FC=' -expect_unresolved \*' - archive_cmds_FC='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' - archive_expsym_cmds_FC='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ - $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' - # Both c and cxx compiler support -rpath directly - hardcode_libdir_flag_spec_FC='-rpath $libdir' - fi - archive_cmds_need_lc_FC='no' - hardcode_libdir_separator_FC=: - ;; +case " $postdeps_CXX " in +*" -lc "*) archive_cmds_need_lc_CXX=no ;; +esac + compiler_lib_search_dirs_CXX= +if test -n "${compiler_lib_search_path_CXX}"; then + compiler_lib_search_dirs_CXX=`echo " ${compiler_lib_search_path_CXX}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` +fi - solaris*) - no_undefined_flag_FC=' -z defs' - if test "$GCC" = yes; then - wlarc='${wl}' - archive_cmds_FC='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_FC='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' - else - case `$CC -V 2>&1` in - *"Compilers 5.0"*) - wlarc='' - archive_cmds_FC='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - archive_expsym_cmds_FC='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' - ;; - *) - wlarc='${wl}' - archive_cmds_FC='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_FC='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' - ;; - esac - fi - hardcode_libdir_flag_spec_FC='-R$libdir' - hardcode_shlibpath_var_FC=no - case $host_os in - solaris2.[0-5] | solaris2.[0-5].*) ;; - *) - # The compiler driver will combine and reorder linker options, - # but understands `-z linker_flag'. GCC discards it without `$wl', - # but is careful enough not to reorder. - # Supported since Solaris 2.6 (maybe 2.5.1?) - if test "$GCC" = yes; then - whole_archive_flag_spec_FC='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' - else - whole_archive_flag_spec_FC='-z allextract$convenience -z defaultextract' - fi - ;; - esac - link_all_deplibs_FC=yes - ;; - sunos4*) - if test "x$host_vendor" = xsequent; then - # Use $CC to link under sequent, because it throws in some extra .o - # files that make .init and .fini sections work. - archive_cmds_FC='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds_FC='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' - fi - hardcode_libdir_flag_spec_FC='-L$libdir' - hardcode_direct_FC=yes - hardcode_minus_L_FC=yes - hardcode_shlibpath_var_FC=no - ;; - sysv4) - case $host_vendor in - sni) - archive_cmds_FC='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct_FC=yes # is this really true??? - ;; - siemens) - ## LD is ld it makes a PLAMLIB - ## CC just makes a GrossModule. - archive_cmds_FC='$LD -G -o $lib $libobjs $deplibs $linker_flags' - reload_cmds_FC='$CC -r -o $output$reload_objs' - hardcode_direct_FC=no - ;; - motorola) - archive_cmds_FC='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct_FC=no #Motorola manual says yes, but my tests say they lie - ;; - esac - runpath_var='LD_RUN_PATH' - hardcode_shlibpath_var_FC=no - ;; - sysv4.3*) - archive_cmds_FC='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var_FC=no - export_dynamic_flag_spec_FC='-Bexport' - ;; - sysv4*MP*) - if test -d /usr/nec; then - archive_cmds_FC='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var_FC=no - runpath_var=LD_RUN_PATH - hardcode_runpath_var=yes - ld_shlibs_FC=yes - fi - ;; - sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) - no_undefined_flag_FC='${wl}-z,text' - archive_cmds_need_lc_FC=no - hardcode_shlibpath_var_FC=no - runpath_var='LD_RUN_PATH' - if test "$GCC" = yes; then - archive_cmds_FC='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_FC='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds_FC='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_FC='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - ;; - sysv5* | sco3.2v5* | sco5v6*) - # Note: We can NOT use -z defs as we might desire, because we do not - # link with -lc, and that would cause any symbols used from libc to - # always be unresolved, which means just about no library would - # ever link correctly. If we're not using GNU ld we use -z text - # though, which does catch some bad symbols but isn't as heavy-handed - # as -z defs. - no_undefined_flag_FC='${wl}-z,text' - allow_undefined_flag_FC='${wl}-z,nodefs' - archive_cmds_need_lc_FC=no - hardcode_shlibpath_var_FC=no - hardcode_libdir_flag_spec_FC='${wl}-R,$libdir' - hardcode_libdir_separator_FC=':' - link_all_deplibs_FC=yes - export_dynamic_flag_spec_FC='${wl}-Bexport' - runpath_var='LD_RUN_PATH' - if test "$GCC" = yes; then - archive_cmds_FC='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_FC='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds_FC='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_FC='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - ;; - uts4*) - archive_cmds_FC='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec_FC='-L$libdir' - hardcode_shlibpath_var_FC=no - ;; - *) - ld_shlibs_FC=no - ;; - esac - if test x$host_vendor = xsni; then - case $host in - sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - export_dynamic_flag_spec_FC='${wl}-Blargedynsym' - ;; - esac - fi - fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_FC" >&5 -$as_echo "$ld_shlibs_FC" >&6; } -test "$ld_shlibs_FC" = no && can_build_shared=no -with_gnu_ld_FC=$with_gnu_ld -# -# Do we need to explicitly link libc? -# -case "x$archive_cmds_need_lc_FC" in -x|xyes) - # Assume -lc should be added - archive_cmds_need_lc_FC=yes - if test "$enable_shared" = yes && test "$GCC" = yes; then - case $archive_cmds_FC in - *'~'*) - # FIXME: we may have to deal with multi-command sequences. - ;; - '$CC '*) - # Test whether the compiler implicitly links with -lc since on some - # systems, -lgcc has to come before -lc. If gcc already passes -lc - # to ld, don't add -lc before -lgcc. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 -$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } -if ${lt_cv_archive_cmds_need_lc_FC+:} false; then : - $as_echo_n "(cached) " >&6 -else - $RM conftest* - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } 2>conftest.err; then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$lt_prog_compiler_wl_FC - pic_flag=$lt_prog_compiler_pic_FC - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - lt_save_allow_undefined_flag=$allow_undefined_flag_FC - allow_undefined_flag_FC= - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds_FC 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 - (eval $archive_cmds_FC 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - then - lt_cv_archive_cmds_need_lc_FC=no - else - lt_cv_archive_cmds_need_lc_FC=yes - fi - allow_undefined_flag_FC=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $RM conftest* -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc_FC" >&5 -$as_echo "$lt_cv_archive_cmds_need_lc_FC" >&6; } - archive_cmds_need_lc_FC=$lt_cv_archive_cmds_need_lc_FC - ;; - esac - fi - ;; -esac @@ -20607,752 +18380,3583 @@ esac + lt_prog_compiler_wl_CXX= +lt_prog_compiler_pic_CXX= +lt_prog_compiler_static_CXX= + # C++ specific cases for pic, static, wl, etc. + if test "$GXX" = yes; then + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='-static' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 -$as_echo_n "checking dynamic linker characteristics... " >&6; } - -library_names_spec= -libname_spec='lib$name' -soname_spec= -shrext_cmds=".so" -postinstall_cmds= -postuninstall_cmds= -finish_cmds= -finish_eval= -shlibpath_var= -shlibpath_overrides_runpath=unknown -version_type=none -dynamic_linker="$host_os ld.so" -sys_lib_dlsearch_path_spec="/lib /usr/lib" -need_lib_prefix=unknown -hardcode_into_libs=no - -# when you set need_version to no, make sure it does not cause -set_version -# flags to be left without arguments -need_version=unknown - -case $host_os in -aix3*) - version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' - shlibpath_var=LIBPATH - - # AIX 3 has no versioning support, so we append a major version to the name. - soname_spec='${libname}${release}${shared_ext}$major' - ;; - -aix[4-9]*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - hardcode_into_libs=yes - if test "$host_cpu" = ia64; then - # AIX 5 supports IA64 - library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - else - # With GCC up to 2.95.x, collect2 would create an import file - # for dependence libraries. The import file would start with - # the line `#! .'. This would cause the generated library to - # depend on `.', always an invalid library. This was fixed in - # development snapshots of GCC prior to 3.0. case $host_os in - aix4 | aix4.[01] | aix4.[01].*) - if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' - echo ' yes ' - echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then - : - else - can_build_shared=no + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_CXX='-Bstatic' fi ;; - esac - # AIX (on Power*) has no versioning support, so currently we can not hardcode correct - # soname into executable. Probably we can add versioning support to - # collect2, so additional links can be useful in future. - if test "$aix_use_runtimelinking" = yes; then - # If using run time linking (on AIX 4.2 or later) use lib.so - # instead of lib.a to let people know that these are not - # typical AIX shared libraries. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - else - # We preserve .a as extension for shared libraries through AIX4.2 - # and later when we are not doing run time linking. - library_names_spec='${libname}${release}.a $libname.a' - soname_spec='${libname}${release}${shared_ext}$major' - fi - shlibpath_var=LIBPATH - fi - ;; - -amigaos*) - case $host_cpu in - powerpc) - # Since July 2007 AmigaOS4 officially supports .so libraries. - # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - ;; - m68k) - library_names_spec='$libname.ixlibrary $libname.a' - # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' - ;; - esac - ;; - -beos*) - library_names_spec='${libname}${shared_ext}' - dynamic_linker="$host_os ld.so" - shlibpath_var=LIBRARY_PATH - ;; - -bsdi[45]*) - version_type=linux # correct to gnu/linux during the next big refactor - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" - sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" - # the default ld.so.conf also contains /usr/contrib/lib and - # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow - # libtool to hard-code these into programs - ;; - -cygwin* | mingw* | pw32* | cegcc*) - version_type=windows - shrext_cmds=".dll" - need_version=no - need_lib_prefix=no - - case $GCC,$cc_basename in - yes,*) - # gcc - library_names_spec='$libname.dll.a' - # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \${file}`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog $dir/$dlname \$dldir/$dlname~ - chmod a+x \$dldir/$dlname~ - if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then - eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; - fi' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ - dlpath=$dir/\$dldll~ - $RM \$dlpath' - shlibpath_overrides_runpath=yes - case $host_os in - cygwin*) - # Cygwin DLLs use 'cyg' prefix rather than 'lib' - soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + lt_prog_compiler_pic_CXX='-fPIC' + ;; + m68k) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4' + ;; + esac + ;; + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. ;; - mingw* | cegcc*) - # MinGW DLLs use traditional 'lib' prefix - soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + mingw* | cygwin* | os2* | pw32* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + lt_prog_compiler_pic_CXX='-DDLL_EXPORT' ;; - pw32*) - # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic_CXX='-fno-common' ;; - esac - dynamic_linker='Win32 ld.exe' - ;; - - *,cl*) - # Native MSVC - libname_spec='$name' - soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - library_names_spec='${libname}.dll.lib' - - case $build_os in - mingw*) - sys_lib_search_path_spec= - lt_save_ifs=$IFS - IFS=';' - for lt_path in $LIB - do - IFS=$lt_save_ifs - # Let DOS variable expansion print the short 8.3 style file name. - lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` - sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" - done - IFS=$lt_save_ifs - # Convert to MSYS style. - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` + *djgpp*) + # DJGPP does not support shared libraries at all + lt_prog_compiler_pic_CXX= ;; - cygwin*) - # Convert to unix form, then to dos form, then back to unix form - # but this time dos style (no spaces!) so that the unix form looks - # like /cygdrive/c/PROGRA~1:/cygdr... - sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` - sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` - sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + lt_prog_compiler_static_CXX= ;; - *) - sys_lib_search_path_spec="$LIB" - if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then - # It is most probably a Windows format PATH. - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + interix[3-9]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic_CXX=-Kconform_pic fi - # FIXME: find the short name or the path components, as spaces are - # common. (e.g. "Program Files" -> "PROGRA~1") ;; - esac - - # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \${file}`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog $dir/$dlname \$dldir/$dlname' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ - dlpath=$dir/\$dldll~ - $RM \$dlpath' - shlibpath_overrides_runpath=yes - dynamic_linker='Win32 link.exe' - ;; - - *) - # Assume MSVC wrapper - library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' - dynamic_linker='Win32 ld.exe' - ;; - esac - # FIXME: first we should search . and the directory the executable is in - shlibpath_var=PATH - ;; - -darwin* | rhapsody*) - dynamic_linker="$host_os dyld" - version_type=darwin - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' - soname_spec='${libname}${release}${major}$shared_ext' - shlibpath_overrides_runpath=yes - shlibpath_var=DYLD_LIBRARY_PATH - shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' - - sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' - ;; - -dgux*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -freebsd* | dragonfly*) - # DragonFly does not have aout. When/if they implement a new - # versioning mechanism, adjust this. - if test -x /usr/bin/objformat; then - objformat=`/usr/bin/objformat` - else - case $host_os in - freebsd[23].*) objformat=aout ;; - *) objformat=elf ;; - esac - fi - version_type=freebsd-$objformat - case $version_type in - freebsd-elf*) - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' - need_version=no - need_lib_prefix=no + hpux*) + # PIC is the default for 64-bit PA HP-UX, but not for 32-bit + # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + case $host_cpu in + hppa*64*) + ;; + *) + lt_prog_compiler_pic_CXX='-fPIC' + ;; + esac ;; - freebsd-*) - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' - need_version=yes + *qnx* | *nto*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic_CXX='-fPIC -shared' ;; - esac - shlibpath_var=LD_LIBRARY_PATH - case $host_os in - freebsd2.*) - shlibpath_overrides_runpath=yes - ;; - freebsd3.[01]* | freebsdelf3.[01]*) - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ - freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - *) # from 4.6 on, and DragonFly - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - esac - ;; - -gnu*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - -haiku*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - dynamic_linker="$host_os runtime_loader" - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LIBRARY_PATH - shlibpath_overrides_runpath=yes - sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' - hardcode_into_libs=yes - ;; - -hpux9* | hpux10* | hpux11*) - # Give a soname corresponding to the major version so that dld.sl refuses to - # link against other versions. - version_type=sunos - need_lib_prefix=no - need_version=no - case $host_cpu in - ia64*) - shrext_cmds='.so' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.so" - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - if test "X$HPUX_IA64_MODE" = X32; then - sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" - else - sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" - fi - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - hppa*64*) - shrext_cmds='.sl' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.sl" - shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - *) - shrext_cmds='.sl' - dynamic_linker="$host_os dld.sl" - shlibpath_var=SHLIB_PATH - shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - ;; - esac - # HP-UX runs *really* slowly unless shared libraries are mode 555, ... - postinstall_cmds='chmod 555 $lib' - # or fails outright, so override atomically: - install_override_mode=555 - ;; - -interix[3-9]*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - -irix5* | irix6* | nonstopux*) - case $host_os in - nonstopux*) version_type=nonstopux ;; *) - if test "$lt_cv_prog_gnu_ld" = yes; then - version_type=linux # correct to gnu/linux during the next big refactor - else - version_type=irix - fi ;; - esac - need_lib_prefix=no - need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' - case $host_os in - irix5* | nonstopux*) - libsuff= shlibsuff= - ;; - *) - case $LD in # libtool.m4 will add one of these switches to LD - *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") - libsuff= shlibsuff= libmagic=32-bit;; - *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") - libsuff=32 shlibsuff=N32 libmagic=N32;; - *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") - libsuff=64 shlibsuff=64 libmagic=64-bit;; - *) libsuff= shlibsuff= libmagic=never-match;; + lt_prog_compiler_pic_CXX='-fPIC' + ;; esac - ;; - esac - shlibpath_var=LD_LIBRARY${shlibsuff}_PATH - shlibpath_overrides_runpath=no - sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" - sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" - hardcode_into_libs=yes - ;; + else + case $host_os in + aix[4-9]*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_CXX='-Bstatic' + else + lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp' + fi + ;; + chorus*) + case $cc_basename in + cxch68*) + # Green Hills C++ Compiler + # _LT_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" + ;; + esac + ;; + mingw* | cygwin* | os2* | pw32* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic_CXX='-DDLL_EXPORT' + ;; + dgux*) + case $cc_basename in + ec++*) + lt_prog_compiler_pic_CXX='-KPIC' + ;; + ghcx*) + # Green Hills C++ Compiler + lt_prog_compiler_pic_CXX='-pic' + ;; + *) + ;; + esac + ;; + freebsd* | dragonfly*) + # FreeBSD uses GNU C++ + ;; + hpux9* | hpux10* | hpux11*) + case $cc_basename in + CC*) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' + if test "$host_cpu" != ia64; then + lt_prog_compiler_pic_CXX='+Z' + fi + ;; + aCC*) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic_CXX='+Z' + ;; + esac + ;; + *) + ;; + esac + ;; + interix*) + # This is c89, which is MS Visual C++ (no shared libs) + # Anyone wants to do a port? + ;; + irix5* | irix6* | nonstopux*) + case $cc_basename in + CC*) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='-non_shared' + # CC pic flag -KPIC is the default. + ;; + *) + ;; + esac + ;; + linux* | k*bsd*-gnu | kopensolaris*-gnu) + case $cc_basename in + KCC*) + # KAI C++ Compiler + lt_prog_compiler_wl_CXX='--backend -Wl,' + lt_prog_compiler_pic_CXX='-fPIC' + ;; + ecpc* ) + # old Intel C++ for x86_64 which still supported -KPIC. + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-static' + ;; + icpc* ) + # Intel C++, used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-fPIC' + lt_prog_compiler_static_CXX='-static' + ;; + pgCC* | pgcpp*) + # Portland Group C++ compiler + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-fpic' + lt_prog_compiler_static_CXX='-Bstatic' + ;; + cxx*) + # Compaq C++ + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + lt_prog_compiler_pic_CXX= + lt_prog_compiler_static_CXX='-non_shared' + ;; + xlc* | xlC* | bgxl[cC]* | mpixl[cC]*) + # IBM XL 8.0, 9.0 on PPC and BlueGene + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-qpic' + lt_prog_compiler_static_CXX='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-Bstatic' + lt_prog_compiler_wl_CXX='-Qoption ld ' + ;; + esac + ;; + esac + ;; + lynxos*) + ;; + m88k*) + ;; + mvs*) + case $cc_basename in + cxx*) + lt_prog_compiler_pic_CXX='-W c,exportall' + ;; + *) + ;; + esac + ;; + netbsd*) + ;; + *qnx* | *nto*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic_CXX='-fPIC -shared' + ;; + osf3* | osf4* | osf5*) + case $cc_basename in + KCC*) + lt_prog_compiler_wl_CXX='--backend -Wl,' + ;; + RCC*) + # Rational C++ 2.4.1 + lt_prog_compiler_pic_CXX='-pic' + ;; + cxx*) + # Digital/Compaq C++ + lt_prog_compiler_wl_CXX='-Wl,' + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + lt_prog_compiler_pic_CXX= + lt_prog_compiler_static_CXX='-non_shared' + ;; + *) + ;; + esac + ;; + psos*) + ;; + solaris*) + case $cc_basename in + CC* | sunCC*) + # Sun C++ 4.2, 5.x and Centerline C++ + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-Bstatic' + lt_prog_compiler_wl_CXX='-Qoption ld ' + ;; + gcx*) + # Green Hills C++ Compiler + lt_prog_compiler_pic_CXX='-PIC' + ;; + *) + ;; + esac + ;; + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + lt_prog_compiler_pic_CXX='-pic' + lt_prog_compiler_static_CXX='-Bstatic' + ;; + lcc*) + # Lucid + lt_prog_compiler_pic_CXX='-pic' + ;; + *) + ;; + esac + ;; + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + case $cc_basename in + CC*) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-Bstatic' + ;; + esac + ;; + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + lt_prog_compiler_pic_CXX='-KPIC' + ;; + *) + ;; + esac + ;; + vxworks*) + ;; + *) + lt_prog_compiler_can_build_shared_CXX=no + ;; + esac + fi + +case $host_os in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + lt_prog_compiler_pic_CXX= + ;; + *) + lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC" + ;; +esac + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 +$as_echo_n "checking for $compiler option to produce PIC... " >&6; } +if ${lt_cv_prog_compiler_pic_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_pic_CXX=$lt_prog_compiler_pic_CXX +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_CXX" >&5 +$as_echo "$lt_cv_prog_compiler_pic_CXX" >&6; } +lt_prog_compiler_pic_CXX=$lt_cv_prog_compiler_pic_CXX + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic_CXX"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 +$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... " >&6; } +if ${lt_cv_prog_compiler_pic_works_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_pic_works_CXX=no + ac_outfile=conftest.$ac_objext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_pic_works_CXX=yes + fi + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works_CXX" >&5 +$as_echo "$lt_cv_prog_compiler_pic_works_CXX" >&6; } + +if test x"$lt_cv_prog_compiler_pic_works_CXX" = xyes; then + case $lt_prog_compiler_pic_CXX in + "" | " "*) ;; + *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;; + esac +else + lt_prog_compiler_pic_CXX= + lt_prog_compiler_can_build_shared_CXX=no +fi + +fi + + + + + +# +# Check to make sure the static flag actually works. +# +wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } +if ${lt_cv_prog_compiler_static_works_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_static_works_CXX=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $lt_tmp_static_flag" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_static_works_CXX=yes + fi + else + lt_cv_prog_compiler_static_works_CXX=yes + fi + fi + $RM -r conftest* + LDFLAGS="$save_LDFLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works_CXX" >&5 +$as_echo "$lt_cv_prog_compiler_static_works_CXX" >&6; } + +if test x"$lt_cv_prog_compiler_static_works_CXX" = xyes; then + : +else + lt_prog_compiler_static_CXX= +fi + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if ${lt_cv_prog_compiler_c_o_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_c_o_CXX=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o_CXX=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 +$as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; } + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if ${lt_cv_prog_compiler_c_o_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_c_o_CXX=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o_CXX=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 +$as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; } + + + + +hard_links="nottested" +if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 +$as_echo_n "checking if we can lock with hard links... " >&6; } + hard_links=yes + $RM conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 +$as_echo "$hard_links" >&6; } + if test "$hard_links" = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 +$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} + need_locks=warn + fi +else + need_locks=no +fi + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } + + export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' + case $host_os in + aix[4-9]*) + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + # Also, AIX nm treats weak defined symbols like other global defined + # symbols, whereas GNU nm marks them as "W". + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + fi + ;; + pw32*) + export_symbols_cmds_CXX="$ltdll_cmds" + ;; + cygwin* | mingw* | cegcc*) + case $cc_basename in + cl*) + exclude_expsyms_CXX='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' + ;; + *) + export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' + exclude_expsyms_CXX='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' + ;; + esac + ;; + *) + export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + ;; + esac + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 +$as_echo "$ld_shlibs_CXX" >&6; } +test "$ld_shlibs_CXX" = no && can_build_shared=no + +with_gnu_ld_CXX=$with_gnu_ld + + + + + + +# +# Do we need to explicitly link libc? +# +case "x$archive_cmds_need_lc_CXX" in +x|xyes) + # Assume -lc should be added + archive_cmds_need_lc_CXX=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $archive_cmds_CXX in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 +$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } +if ${lt_cv_archive_cmds_need_lc_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + $RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl_CXX + pic_flag=$lt_prog_compiler_pic_CXX + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag_CXX + allow_undefined_flag_CXX= + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 + (eval $archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + then + lt_cv_archive_cmds_need_lc_CXX=no + else + lt_cv_archive_cmds_need_lc_CXX=yes + fi + allow_undefined_flag_CXX=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc_CXX" >&5 +$as_echo "$lt_cv_archive_cmds_need_lc_CXX" >&6; } + archive_cmds_need_lc_CXX=$lt_cv_archive_cmds_need_lc_CXX + ;; + esac + fi + ;; +esac + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 +$as_echo_n "checking dynamic linker characteristics... " >&6; } + +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + +case $host_os in +aix3*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; + +aix[4-9]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + case $host_cpu in + powerpc) + # Since July 2007 AmigaOS4 officially supports .so libraries. + # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + ;; + m68k) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + esac + ;; + +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[45]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32* | cegcc*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$cc_basename in + yes,*) + # gcc + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + + ;; + mingw* | cegcc*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + esac + dynamic_linker='Win32 ld.exe' + ;; + + *,cl*) + # Native MSVC + libname_spec='$name' + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + library_names_spec='${libname}.dll.lib' + + case $build_os in + mingw*) + sys_lib_search_path_spec= + lt_save_ifs=$IFS + IFS=';' + for lt_path in $LIB + do + IFS=$lt_save_ifs + # Let DOS variable expansion print the short 8.3 style file name. + lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` + sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" + done + IFS=$lt_save_ifs + # Convert to MSYS style. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` + ;; + cygwin*) + # Convert to unix form, then to dos form, then back to unix form + # but this time dos style (no spaces!) so that the unix form looks + # like /cygdrive/c/PROGRA~1:/cygdr... + sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` + sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` + sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + ;; + *) + sys_lib_search_path_spec="$LIB" + if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + # FIXME: find the short name or the path components, as spaces are + # common. (e.g. "Program Files" -> "PROGRA~1") + ;; + esac + + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + dynamic_linker='Win32 link.exe' + ;; + + *) + # Assume MSVC wrapper + library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' + dynamic_linker='Win32 ld.exe' + ;; + esac + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' + + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[23].*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2.*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ + freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + *) # from 4.6 on, and DragonFly + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +haiku*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + dynamic_linker="$host_os runtime_loader" + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LIBRARY_PATH + shlibpath_overrides_runpath=yes + sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555, ... + postinstall_cmds='chmod 555 $lib' + # or fails outright, so override atomically: + install_override_mode=555 + ;; + +interix[3-9]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux # correct to gnu/linux during the next big refactor + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + + # Some binutils ld are patched to set DT_RUNPATH + if ${lt_cv_shlibpath_overrides_runpath+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_shlibpath_overrides_runpath=no + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$lt_prog_compiler_wl_CXX\"; \ + LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec_CXX\"" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#ifdef FC_DUMMY_MAIN +#ifndef FC_DUMMY_MAIN_EQ_F77 +# ifdef __cplusplus + extern "C" +# endif + int FC_DUMMY_MAIN() { return 1; } +#endif +#endif +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : + lt_cv_shlibpath_overrides_runpath=yes +fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir + +fi + + shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath + + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +*nto* | *qnx*) + version_type=qnx + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='ldqnx.so' + ;; + +openbsd*) + version_type=sunos + sys_lib_dlsearch_path_spec="/usr/lib" + need_lib_prefix=no + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[89] | openbsd2.[89].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext_cmds=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +rdos*) + dynamic_linker=no + ;; + +solaris*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +tpf*) + # TPF is a cross-target only. Preferred cross-host = GNU/Linux. + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +uts4*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 +$as_echo "$dynamic_linker" >&6; } +test "$dynamic_linker" = no && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then + sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" +fi +if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then + sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 +$as_echo_n "checking how to hardcode library paths into programs... " >&6; } +hardcode_action_CXX= +if test -n "$hardcode_libdir_flag_spec_CXX" || + test -n "$runpath_var_CXX" || + test "X$hardcode_automatic_CXX" = "Xyes" ; then + + # We can hardcode non-existent directories. + if test "$hardcode_direct_CXX" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_TAGVAR(hardcode_shlibpath_var, CXX)" != no && + test "$hardcode_minus_L_CXX" != no; then + # Linking always hardcodes the temporary library directory. + hardcode_action_CXX=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action_CXX=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action_CXX=unsupported +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action_CXX" >&5 +$as_echo "$hardcode_action_CXX" >&6; } + +if test "$hardcode_action_CXX" = relink || + test "$inherit_rpath_CXX" = yes; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi + + + + + + + + fi # test -n "$compiler" + + CC=$lt_save_CC + CFLAGS=$lt_save_CFLAGS + LDCXX=$LD + LD=$lt_save_LD + GCC=$lt_save_GCC + with_gnu_ld=$lt_save_with_gnu_ld + lt_cv_path_LDCXX=$lt_cv_path_LD + lt_cv_path_LD=$lt_save_path_LD + lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld + lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld +fi # test "$_lt_caught_CXX_error" != yes + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + + + + ac_ext=${ac_fc_srcext-f} +ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5' +ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_fc_compiler_gnu + + +if test -z "$FC" || test "X$FC" = "Xno"; then + _lt_disable_FC=yes +fi + +archive_cmds_need_lc_FC=no +allow_undefined_flag_FC= +always_export_symbols_FC=no +archive_expsym_cmds_FC= +export_dynamic_flag_spec_FC= +hardcode_direct_FC=no +hardcode_direct_absolute_FC=no +hardcode_libdir_flag_spec_FC= +hardcode_libdir_separator_FC= +hardcode_minus_L_FC=no +hardcode_automatic_FC=no +inherit_rpath_FC=no +module_cmds_FC= +module_expsym_cmds_FC= +link_all_deplibs_FC=unknown +old_archive_cmds_FC=$old_archive_cmds +reload_flag_FC=$reload_flag +reload_cmds_FC=$reload_cmds +no_undefined_flag_FC= +whole_archive_flag_spec_FC= +enable_shared_with_static_runtimes_FC=no + +# Source file extension for fc test sources. +ac_ext=${ac_fc_srcext-f} + +# Object file extension for compiled fc test sources. +objext=o +objext_FC=$objext + +# No sense in running all these tests if we already determined that +# the FC compiler isn't working. Some variables (like enable_shared) +# are currently assumed to apply to all compilers on this platform, +# and will be corrupted by setting them based on a non-working compiler. +if test "$_lt_disable_FC" != yes; then + # Code to be used in simple compile tests + lt_simple_compile_test_code="\ + subroutine t + return + end +" + + # Code to be used in simple link tests + lt_simple_link_test_code="\ + program t + end +" + + # ltmain only uses $CC for tagged configurations so make sure $CC is set. + + + + + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + + # save warnings/boilerplate of simple test code + ac_outfile=conftest.$ac_objext +echo "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$RM conftest* + + ac_outfile=conftest.$ac_objext +echo "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$RM -r conftest* + + + # Allow CC to be a program name with arguments. + lt_save_CC="$CC" + lt_save_GCC=$GCC + lt_save_CFLAGS=$CFLAGS + CC=${FC-"f95"} + CFLAGS=$FCFLAGS + compiler=$CC + GCC=$ac_cv_fc_compiler_gnu + + compiler_FC=$CC + for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` + + + if test -n "$compiler"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 +$as_echo_n "checking if libtool supports shared libraries... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 +$as_echo "$can_build_shared" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 +$as_echo_n "checking whether to build shared libraries... " >&6; } + test "$can_build_shared" = "no" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + aix[4-9]*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; + esac + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 +$as_echo "$enable_shared" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 +$as_echo_n "checking whether to build static libraries... " >&6; } + # Make sure either enable_shared or enable_static is yes. + test "$enable_shared" = yes || enable_static=yes + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 +$as_echo "$enable_static" >&6; } + + GCC_FC="$ac_cv_fc_compiler_gnu" + LD_FC="$LD" + + ## CAVEAT EMPTOR: + ## There is no encapsulation within the following macros, do not change + ## the running order or otherwise move them around unless you know exactly + ## what you are doing... + # Dependencies to place before and after the object being linked: +predep_objects_FC= +postdep_objects_FC= +predeps_FC= +postdeps_FC= +compiler_lib_search_path_FC= + +cat > conftest.$ac_ext <<_LT_EOF + subroutine foo + implicit none + integer a + a=0 + return + end +_LT_EOF + + +_lt_libdeps_save_CFLAGS=$CFLAGS +case "$CC $CFLAGS " in #( +*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; +*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; +*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; +esac + +if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + # Parse the compiler output and extract the necessary + # objects, libraries and library flags. + + # Sentinel used to keep track of whether or not we are before + # the conftest object file. + pre_test_object_deps_done=no + + for p in `eval "$output_verbose_link_cmd"`; do + case ${prev}${p} in + + -L* | -R* | -l*) + # Some compilers place space between "-{L,R}" and the path. + # Remove the space. + if test $p = "-L" || + test $p = "-R"; then + prev=$p + continue + fi + + # Expand the sysroot to ease extracting the directories later. + if test -z "$prev"; then + case $p in + -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; + -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; + -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; + esac + fi + case $p in + =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; + esac + if test "$pre_test_object_deps_done" = no; then + case ${prev} in + -L | -R) + # Internal compiler library paths should come after those + # provided the user. The postdeps already come after the + # user supplied libs so there is no need to process them. + if test -z "$compiler_lib_search_path_FC"; then + compiler_lib_search_path_FC="${prev}${p}" + else + compiler_lib_search_path_FC="${compiler_lib_search_path_FC} ${prev}${p}" + fi + ;; + # The "-l" case would never come before the object being + # linked, so don't bother handling this case. + esac + else + if test -z "$postdeps_FC"; then + postdeps_FC="${prev}${p}" + else + postdeps_FC="${postdeps_FC} ${prev}${p}" + fi + fi + prev= + ;; + + *.lto.$objext) ;; # Ignore GCC LTO objects + *.$objext) + # This assumes that the test object file only shows up + # once in the compiler output. + if test "$p" = "conftest.$objext"; then + pre_test_object_deps_done=yes + continue + fi + + if test "$pre_test_object_deps_done" = no; then + if test -z "$predep_objects_FC"; then + predep_objects_FC="$p" + else + predep_objects_FC="$predep_objects_FC $p" + fi + else + if test -z "$postdep_objects_FC"; then + postdep_objects_FC="$p" + else + postdep_objects_FC="$postdep_objects_FC $p" + fi + fi + ;; + + *) ;; # Ignore the rest. + + esac + done + + # Clean up. + rm -f a.out a.exe +else + echo "libtool.m4: error: problem compiling FC test program" +fi + +$RM -f confest.$objext +CFLAGS=$_lt_libdeps_save_CFLAGS + +# PORTME: override above test on systems where it is broken + + +case " $postdeps_FC " in +*" -lc "*) archive_cmds_need_lc_FC=no ;; +esac + compiler_lib_search_dirs_FC= +if test -n "${compiler_lib_search_path_FC}"; then + compiler_lib_search_dirs_FC=`echo " ${compiler_lib_search_path_FC}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` +fi + + + + + + + + + + + + + + lt_prog_compiler_wl_FC= +lt_prog_compiler_pic_FC= +lt_prog_compiler_static_FC= + + + if test "$GCC" = yes; then + lt_prog_compiler_wl_FC='-Wl,' + lt_prog_compiler_static_FC='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_FC='-Bstatic' + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + lt_prog_compiler_pic_FC='-fPIC' + ;; + m68k) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + lt_prog_compiler_pic_FC='-m68020 -resident32 -malways-restore-a4' + ;; + esac + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + lt_prog_compiler_pic_FC='-DDLL_EXPORT' + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic_FC='-fno-common' + ;; + + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + lt_prog_compiler_static_FC= + ;; + + hpux*) + # PIC is the default for 64-bit PA HP-UX, but not for 32-bit + # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + case $host_cpu in + hppa*64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic_FC='-fPIC' + ;; + esac + ;; + + interix[3-9]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + lt_prog_compiler_can_build_shared_FC=no + enable_shared=no + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic_FC='-fPIC -shared' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic_FC=-Kconform_pic + fi + ;; + + *) + lt_prog_compiler_pic_FC='-fPIC' + ;; + esac + + case $cc_basename in + nvcc*) # Cuda Compiler Driver 2.2 + lt_prog_compiler_wl_FC='-Xlinker ' + if test -n "$lt_prog_compiler_pic_FC"; then + lt_prog_compiler_pic_FC="-Xcompiler $lt_prog_compiler_pic_FC" + fi + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + lt_prog_compiler_wl_FC='-Wl,' + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_FC='-Bstatic' + else + lt_prog_compiler_static_FC='-bnso -bI:/lib/syscalls.exp' + fi + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic_FC='-DDLL_EXPORT' + ;; + + hpux9* | hpux10* | hpux11*) + lt_prog_compiler_wl_FC='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic_FC='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + lt_prog_compiler_static_FC='${wl}-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + lt_prog_compiler_wl_FC='-Wl,' + # PIC (with -KPIC) is the default. + lt_prog_compiler_static_FC='-non_shared' + ;; + + linux* | k*bsd*-gnu | kopensolaris*-gnu) + case $cc_basename in + # old Intel for x86_64 which still supported -KPIC. + ecc*) + lt_prog_compiler_wl_FC='-Wl,' + lt_prog_compiler_pic_FC='-KPIC' + lt_prog_compiler_static_FC='-static' + ;; + # icc used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + icc* | ifort*) + lt_prog_compiler_wl_FC='-Wl,' + lt_prog_compiler_pic_FC='-fPIC' + lt_prog_compiler_static_FC='-static' + ;; + # Lahey Fortran 8.1. + lf95*) + lt_prog_compiler_wl_FC='-Wl,' + lt_prog_compiler_pic_FC='--shared' + lt_prog_compiler_static_FC='--static' + ;; + nagfor*) + # NAG Fortran compiler + lt_prog_compiler_wl_FC='-Wl,-Wl,,' + lt_prog_compiler_pic_FC='-PIC' + lt_prog_compiler_static_FC='-Bstatic' + ;; + pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + lt_prog_compiler_wl_FC='-Wl,' + lt_prog_compiler_pic_FC='-fpic' + lt_prog_compiler_static_FC='-Bstatic' + ;; + ccc*) + lt_prog_compiler_wl_FC='-Wl,' + # All Alpha code is PIC. + lt_prog_compiler_static_FC='-non_shared' + ;; + xl* | bgxl* | bgf* | mpixl*) + # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene + lt_prog_compiler_wl_FC='-Wl,' + lt_prog_compiler_pic_FC='-qpic' + lt_prog_compiler_static_FC='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) + # Sun Fortran 8.3 passes all unrecognized flags to the linker + lt_prog_compiler_pic_FC='-KPIC' + lt_prog_compiler_static_FC='-Bstatic' + lt_prog_compiler_wl_FC='' + ;; + *Sun\ F* | *Sun*Fortran*) + lt_prog_compiler_pic_FC='-KPIC' + lt_prog_compiler_static_FC='-Bstatic' + lt_prog_compiler_wl_FC='-Qoption ld ' + ;; + *Sun\ C*) + # Sun C 5.9 + lt_prog_compiler_pic_FC='-KPIC' + lt_prog_compiler_static_FC='-Bstatic' + lt_prog_compiler_wl_FC='-Wl,' + ;; + *Intel*\ [CF]*Compiler*) + lt_prog_compiler_wl_FC='-Wl,' + lt_prog_compiler_pic_FC='-fPIC' + lt_prog_compiler_static_FC='-static' + ;; + *Portland\ Group*) + lt_prog_compiler_wl_FC='-Wl,' + lt_prog_compiler_pic_FC='-fpic' + lt_prog_compiler_static_FC='-Bstatic' + ;; + esac + ;; + esac + ;; + + newsos6) + lt_prog_compiler_pic_FC='-KPIC' + lt_prog_compiler_static_FC='-Bstatic' + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic_FC='-fPIC -shared' + ;; + + osf3* | osf4* | osf5*) + lt_prog_compiler_wl_FC='-Wl,' + # All OSF/1 code is PIC. + lt_prog_compiler_static_FC='-non_shared' + ;; + + rdos*) + lt_prog_compiler_static_FC='-non_shared' + ;; + + solaris*) + lt_prog_compiler_pic_FC='-KPIC' + lt_prog_compiler_static_FC='-Bstatic' + case $cc_basename in + f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) + lt_prog_compiler_wl_FC='-Qoption ld ';; + *) + lt_prog_compiler_wl_FC='-Wl,';; + esac + ;; + + sunos4*) + lt_prog_compiler_wl_FC='-Qoption ld ' + lt_prog_compiler_pic_FC='-PIC' + lt_prog_compiler_static_FC='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3*) + lt_prog_compiler_wl_FC='-Wl,' + lt_prog_compiler_pic_FC='-KPIC' + lt_prog_compiler_static_FC='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec ;then + lt_prog_compiler_pic_FC='-Kconform_pic' + lt_prog_compiler_static_FC='-Bstatic' + fi + ;; + + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + lt_prog_compiler_wl_FC='-Wl,' + lt_prog_compiler_pic_FC='-KPIC' + lt_prog_compiler_static_FC='-Bstatic' + ;; + + unicos*) + lt_prog_compiler_wl_FC='-Wl,' + lt_prog_compiler_can_build_shared_FC=no + ;; + + uts4*) + lt_prog_compiler_pic_FC='-pic' + lt_prog_compiler_static_FC='-Bstatic' + ;; + + *) + lt_prog_compiler_can_build_shared_FC=no + ;; + esac + fi + +case $host_os in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + lt_prog_compiler_pic_FC= + ;; + *) + lt_prog_compiler_pic_FC="$lt_prog_compiler_pic_FC" + ;; +esac + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 +$as_echo_n "checking for $compiler option to produce PIC... " >&6; } +if ${lt_cv_prog_compiler_pic_FC+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_pic_FC=$lt_prog_compiler_pic_FC +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_FC" >&5 +$as_echo "$lt_cv_prog_compiler_pic_FC" >&6; } +lt_prog_compiler_pic_FC=$lt_cv_prog_compiler_pic_FC + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic_FC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic_FC works" >&5 +$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_FC works... " >&6; } +if ${lt_cv_prog_compiler_pic_works_FC+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_pic_works_FC=no + ac_outfile=conftest.$ac_objext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic_FC" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_pic_works_FC=yes + fi + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works_FC" >&5 +$as_echo "$lt_cv_prog_compiler_pic_works_FC" >&6; } + +if test x"$lt_cv_prog_compiler_pic_works_FC" = xyes; then + case $lt_prog_compiler_pic_FC in + "" | " "*) ;; + *) lt_prog_compiler_pic_FC=" $lt_prog_compiler_pic_FC" ;; + esac +else + lt_prog_compiler_pic_FC= + lt_prog_compiler_can_build_shared_FC=no +fi + +fi + + + + + +# +# Check to make sure the static flag actually works. +# +wl=$lt_prog_compiler_wl_FC eval lt_tmp_static_flag=\"$lt_prog_compiler_static_FC\" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } +if ${lt_cv_prog_compiler_static_works_FC+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_static_works_FC=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $lt_tmp_static_flag" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_static_works_FC=yes + fi + else + lt_cv_prog_compiler_static_works_FC=yes + fi + fi + $RM -r conftest* + LDFLAGS="$save_LDFLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works_FC" >&5 +$as_echo "$lt_cv_prog_compiler_static_works_FC" >&6; } + +if test x"$lt_cv_prog_compiler_static_works_FC" = xyes; then + : +else + lt_prog_compiler_static_FC= +fi + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if ${lt_cv_prog_compiler_c_o_FC+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_c_o_FC=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o_FC=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_FC" >&5 +$as_echo "$lt_cv_prog_compiler_c_o_FC" >&6; } + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if ${lt_cv_prog_compiler_c_o_FC+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_c_o_FC=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o_FC=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_FC" >&5 +$as_echo "$lt_cv_prog_compiler_c_o_FC" >&6; } + + + + +hard_links="nottested" +if test "$lt_cv_prog_compiler_c_o_FC" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 +$as_echo_n "checking if we can lock with hard links... " >&6; } + hard_links=yes + $RM conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 +$as_echo "$hard_links" >&6; } + if test "$hard_links" = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 +$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} + need_locks=warn + fi +else + need_locks=no +fi + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } + + runpath_var= + allow_undefined_flag_FC= + always_export_symbols_FC=no + archive_cmds_FC= + archive_expsym_cmds_FC= + compiler_needs_object_FC=no + enable_shared_with_static_runtimes_FC=no + export_dynamic_flag_spec_FC= + export_symbols_cmds_FC='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + hardcode_automatic_FC=no + hardcode_direct_FC=no + hardcode_direct_absolute_FC=no + hardcode_libdir_flag_spec_FC= + hardcode_libdir_separator_FC= + hardcode_minus_L_FC=no + hardcode_shlibpath_var_FC=unsupported + inherit_rpath_FC=no + link_all_deplibs_FC=unknown + module_cmds_FC= + module_expsym_cmds_FC= + old_archive_from_new_cmds_FC= + old_archive_from_expsyms_cmds_FC= + thread_safe_flag_spec_FC= + whole_archive_flag_spec_FC= + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + include_expsyms_FC= + # exclude_expsyms can be an extended regexp of symbols to exclude + # it will be wrapped by ` (' and `)$', so one must not match beginning or + # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', + # as well as any symbol that contains `d'. + exclude_expsyms_FC='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' + # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out + # platforms (ab)use it in PIC code, but their linkers get confused if + # the symbol is explicitly referenced. Since portable code cannot + # rely on this symbol name, it's probably fine to never include it in + # preloaded symbol tables. + # Exclude shared library initialization/finalization symbols. + extract_expsyms_cmds= + + case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd*) + with_gnu_ld=no + ;; + esac + + ld_shlibs_FC=yes + + # On some targets, GNU ld is compatible enough with the native linker + # that we're better off using the native interface for both. + lt_use_gnu_ld_interface=no + if test "$with_gnu_ld" = yes; then + case $host_os in + aix*) + # The AIX port of GNU ld has always aspired to compatibility + # with the native linker. However, as the warning in the GNU ld + # block says, versions before 2.19.5* couldn't really create working + # shared libraries, regardless of the interface used. + case `$LD -v 2>&1` in + *\ \(GNU\ Binutils\)\ 2.19.5*) ;; + *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; + *\ \(GNU\ Binutils\)\ [3-9]*) ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + fi + + if test "$lt_use_gnu_ld_interface" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' + + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec_FC='${wl}-rpath ${wl}$libdir' + export_dynamic_flag_spec_FC='${wl}--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec_FC="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + whole_archive_flag_spec_FC= + fi + supports_anon_versioning=no + case `$LD -v 2>&1` in + *GNU\ gold*) supports_anon_versioning=yes ;; + *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + + # See if GNU ld supports shared libraries. + case $host_os in + aix[3-9]*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + ld_shlibs_FC=no + cat <<_LT_EOF 1>&2 + +*** Warning: the GNU linker, at least up to release 2.19, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to install binutils +*** 2.20 or above, or modify your PATH so that a non-GNU linker is found. +*** You will then need to restart the configuration process. + +_LT_EOF + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + archive_cmds_FC='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_FC='' + ;; + m68k) + archive_cmds_FC='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec_FC='-L$libdir' + hardcode_minus_L_FC=yes + ;; + esac + ;; + + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag_FC=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds_FC='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + ld_shlibs_FC=no + fi + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # _LT_TAGVAR(hardcode_libdir_flag_spec, FC) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec_FC='-L$libdir' + export_dynamic_flag_spec_FC='${wl}--export-all-symbols' + allow_undefined_flag_FC=unsupported + always_export_symbols_FC=no + enable_shared_with_static_runtimes_FC=yes + export_symbols_cmds_FC='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' + exclude_expsyms_FC='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + archive_cmds_FC='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + archive_expsym_cmds_FC='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs_FC=no + fi + ;; + + haiku*) + archive_cmds_FC='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + link_all_deplibs_FC=yes + ;; + + interix[3-9]*) + hardcode_direct_FC=no + hardcode_shlibpath_var_FC=no + hardcode_libdir_flag_spec_FC='${wl}-rpath,$libdir' + export_dynamic_flag_spec_FC='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + archive_cmds_FC='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds_FC='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + + gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) + tmp_diet=no + if test "$host_os" = linux-dietlibc; then + case $cc_basename in + diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) + esac + fi + if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ + && test "$tmp_diet" = no + then + tmp_addflag=' $pic_flag' + tmp_sharedflag='-shared' + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + whole_archive_flag_spec_FC='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group f77 and f90 compilers + whole_archive_flag_spec_FC='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + lf95*) # Lahey Fortran 8.1 + whole_archive_flag_spec_FC= + tmp_sharedflag='--shared' ;; + xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) + tmp_sharedflag='-qmkshrobj' + tmp_addflag= ;; + nvcc*) # Cuda Compiler Driver 2.2 + whole_archive_flag_spec_FC='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + compiler_needs_object_FC=yes + ;; + esac + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) # Sun C 5.9 + whole_archive_flag_spec_FC='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + compiler_needs_object_FC=yes + tmp_sharedflag='-G' ;; + *Sun\ F*) # Sun Fortran 8.3 + tmp_sharedflag='-G' ;; + esac + archive_cmds_FC='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + + if test "x$supports_anon_versioning" = xyes; then + archive_expsym_cmds_FC='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + + case $cc_basename in + xlf* | bgf* | bgxlf* | mpixlf*) + # IBM XL Fortran 10.1 on PPC cannot create shared libs itself + whole_archive_flag_spec_FC='--whole-archive$convenience --no-whole-archive' + hardcode_libdir_flag_spec_FC='${wl}-rpath ${wl}$libdir' + archive_cmds_FC='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' + if test "x$supports_anon_versioning" = xyes; then + archive_expsym_cmds_FC='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + fi + ;; + esac + else + ld_shlibs_FC=no + fi + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + archive_cmds_FC='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + archive_cmds_FC='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_FC='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris*) + if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then + ld_shlibs_FC=no + cat <<_LT_EOF 1>&2 + +*** Warning: The releases 2.8.* of the GNU linker cannot reliably +*** create shared libraries on Solaris systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.9.1 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + archive_cmds_FC='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_FC='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs_FC=no + fi + ;; + + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) + ld_shlibs_FC=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + ;; + *) + # For security reasons, it is highly recommended that you always + # use absolute paths for naming shared libraries, and exclude the + # DT_RUNPATH tag from executables and libraries. But doing so + # requires that you compile everything twice, which is a pain. + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + hardcode_libdir_flag_spec_FC='${wl}-rpath ${wl}$libdir' + archive_cmds_FC='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_FC='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs_FC=no + fi + ;; + esac + ;; + + sunos4*) + archive_cmds_FC='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + hardcode_direct_FC=yes + hardcode_shlibpath_var_FC=no + ;; + + *) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + archive_cmds_FC='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_FC='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs_FC=no + fi + ;; + esac + + if test "$ld_shlibs_FC" = no; then + runpath_var= + hardcode_libdir_flag_spec_FC= + export_dynamic_flag_spec_FC= + whole_archive_flag_spec_FC= + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + allow_undefined_flag_FC=unsupported + always_export_symbols_FC=yes + archive_expsym_cmds_FC='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + hardcode_minus_L_FC=yes + if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + hardcode_direct_FC=unsupported + fi + ;; + + aix[4-9]*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + # Also, AIX nm treats weak defined symbols like other global + # defined symbols, whereas GNU nm marks them as "W". + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + export_symbols_cmds_FC='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds_FC='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + archive_cmds_FC='' + hardcode_direct_FC=yes + hardcode_direct_absolute_FC=yes + hardcode_libdir_separator_FC=':' + link_all_deplibs_FC=yes + file_list_spec_FC='${wl}-f,' + + if test "$GCC" = yes; then + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && + strings "$collect2name" | $GREP resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + hardcode_direct_FC=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + hardcode_minus_L_FC=yes + hardcode_libdir_flag_spec_FC='-L$libdir' + hardcode_libdir_separator_FC= + fi + ;; + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + export_dynamic_flag_spec_FC='${wl}-bexpall' + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + always_export_symbols_FC=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + allow_undefined_flag_FC='-berok' + # Determine the default libpath from the value encoded in an + # empty executable. + if test "${lt_cv_aix_libpath+set}" = set; then + aix_libpath=$lt_cv_aix_libpath +else + if ${lt_cv_aix_libpath__FC+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat > conftest.$ac_ext <<_ACEOF + program main + + end +_ACEOF +if ac_fn_fc_try_link "$LINENO"; then : + + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath__FC=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$lt_cv_aix_libpath__FC"; then + lt_cv_aix_libpath__FC=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test -z "$lt_cv_aix_libpath__FC"; then + lt_cv_aix_libpath__FC="/usr/lib:/lib" + fi + +fi + + aix_libpath=$lt_cv_aix_libpath__FC +fi + + hardcode_libdir_flag_spec_FC='${wl}-blibpath:$libdir:'"$aix_libpath" + archive_expsym_cmds_FC='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec_FC='${wl}-R $libdir:/usr/lib:/lib' + allow_undefined_flag_FC="-z nodefs" + archive_expsym_cmds_FC="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + if test "${lt_cv_aix_libpath+set}" = set; then + aix_libpath=$lt_cv_aix_libpath +else + if ${lt_cv_aix_libpath__FC+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat > conftest.$ac_ext <<_ACEOF + program main + + end +_ACEOF +if ac_fn_fc_try_link "$LINENO"; then : + + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath__FC=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$lt_cv_aix_libpath__FC"; then + lt_cv_aix_libpath__FC=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test -z "$lt_cv_aix_libpath__FC"; then + lt_cv_aix_libpath__FC="/usr/lib:/lib" + fi + +fi + + aix_libpath=$lt_cv_aix_libpath__FC +fi + + hardcode_libdir_flag_spec_FC='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + no_undefined_flag_FC=' ${wl}-bernotok' + allow_undefined_flag_FC=' ${wl}-berok' + if test "$with_gnu_ld" = yes; then + # We only use this code for GNU lds that support --whole-archive. + whole_archive_flag_spec_FC='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec_FC='$convenience' + fi + archive_cmds_need_lc_FC=yes + # This is similar to how AIX traditionally builds its shared libraries. + archive_expsym_cmds_FC="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + archive_cmds_FC='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_FC='' + ;; + m68k) + archive_cmds_FC='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec_FC='-L$libdir' + hardcode_minus_L_FC=yes + ;; + esac + ;; + + bsdi[45]*) + export_dynamic_flag_spec_FC=-rdynamic + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + case $cc_basename in + cl*) + # Native MSVC + hardcode_libdir_flag_spec_FC=' ' + allow_undefined_flag_FC=unsupported + always_export_symbols_FC=yes + file_list_spec_FC='@' + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds_FC='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' + archive_expsym_cmds_FC='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; + else + sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, FC)='true' + enable_shared_with_static_runtimes_FC=yes + exclude_expsyms_FC='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' + export_symbols_cmds_FC='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' + # Don't use ranlib + old_postinstall_cmds_FC='chmod 644 $oldlib' + postlink_cmds_FC='lt_outputfile="@OUTPUT@"~ + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile="$lt_outputfile.exe" + lt_tool_outputfile="$lt_tool_outputfile.exe" + ;; + esac~ + if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' + ;; + *) + # Assume MSVC wrapper + hardcode_libdir_flag_spec_FC=' ' + allow_undefined_flag_FC=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds_FC='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + old_archive_from_new_cmds_FC='true' + # FIXME: Should let the user specify the lib program. + old_archive_cmds_FC='lib -OUT:$oldlib$oldobjs$old_deplibs' + enable_shared_with_static_runtimes_FC=yes + ;; + esac + ;; -# No shared lib support for Linux oldld, aout, or coff. -linux*oldld* | linux*aout* | linux*coff*) - dynamic_linker=no - ;; + darwin* | rhapsody*) -# This must be glibc/ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - # Some binutils ld are patched to set DT_RUNPATH - if ${lt_cv_shlibpath_overrides_runpath+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_shlibpath_overrides_runpath=no - save_LDFLAGS=$LDFLAGS - save_libdir=$libdir - eval "libdir=/foo; wl=\"$lt_prog_compiler_wl_FC\"; \ - LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec_FC\"" - cat > conftest.$ac_ext <<_ACEOF - program main + archive_cmds_need_lc_FC=no + hardcode_direct_FC=no + hardcode_automatic_FC=yes + hardcode_shlibpath_var_FC=unsupported + if test "$lt_cv_ld_force_load" = "yes"; then + whole_archive_flag_spec_FC='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' + compiler_needs_object_FC=yes + else + whole_archive_flag_spec_FC='' + fi + link_all_deplibs_FC=yes + allow_undefined_flag_FC="$_lt_dar_allow_undefined" + case $cc_basename in + ifort*) _lt_dar_can_shared=yes ;; + *) _lt_dar_can_shared=$GCC ;; + esac + if test "$_lt_dar_can_shared" = "yes"; then + output_verbose_link_cmd=func_echo_all + archive_cmds_FC="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" + module_cmds_FC="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" + archive_expsym_cmds_FC="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" + module_expsym_cmds_FC="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" - end -_ACEOF -if ac_fn_fc_try_link "$LINENO"; then : - if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : - lt_cv_shlibpath_overrides_runpath=yes -fi -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - LDFLAGS=$save_LDFLAGS - libdir=$save_libdir + else + ld_shlibs_FC=no + fi -fi + ;; - shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath + dgux*) + archive_cmds_FC='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec_FC='-L$libdir' + hardcode_shlibpath_var_FC=no + ;; - # This implies no fast_install, which is unacceptable. - # Some rework will be needed to allow for fast_install - # before this can be enabled. - hardcode_into_libs=yes + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + archive_cmds_FC='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + hardcode_libdir_flag_spec_FC='-R$libdir' + hardcode_direct_FC=yes + hardcode_shlibpath_var_FC=no + ;; - # Append ld.so.conf contents to the search path - if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` - sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" - fi + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2.*) + archive_cmds_FC='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_FC=yes + hardcode_minus_L_FC=yes + hardcode_shlibpath_var_FC=no + ;; - # We used to test for /lib/ld.so.1 and disable shared libraries on - # powerpc, because MkLinux only supported shared libraries with the - # GNU dynamic linker. Since this was broken with cross compilers, - # most powerpc-linux boxes support dynamic linking these days and - # people can always --disable-shared, the test was removed, and we - # assume the GNU/Linux dynamic linker is in use. - dynamic_linker='GNU/Linux ld.so' - ;; + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | dragonfly*) + archive_cmds_FC='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec_FC='-R$libdir' + hardcode_direct_FC=yes + hardcode_shlibpath_var_FC=no + ;; -netbsd*) - version_type=sunos - need_lib_prefix=no - need_version=no - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - dynamic_linker='NetBSD (a.out) ld.so' - else - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - dynamic_linker='NetBSD ld.elf_so' - fi - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; + hpux9*) + if test "$GCC" = yes; then + archive_cmds_FC='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + archive_cmds_FC='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + fi + hardcode_libdir_flag_spec_FC='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_FC=: + hardcode_direct_FC=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L_FC=yes + export_dynamic_flag_spec_FC='${wl}-E' + ;; + + hpux10*) + if test "$GCC" = yes && test "$with_gnu_ld" = no; then + archive_cmds_FC='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds_FC='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec_FC='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_FC=: + hardcode_direct_FC=yes + hardcode_direct_absolute_FC=yes + export_dynamic_flag_spec_FC='${wl}-E' + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L_FC=yes + fi + ;; + + hpux11*) + if test "$GCC" = yes && test "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*) + archive_cmds_FC='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds_FC='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds_FC='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) + archive_cmds_FC='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds_FC='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds_FC='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec_FC='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_FC=: + + case $host_cpu in + hppa*64*|ia64*) + hardcode_direct_FC=no + hardcode_shlibpath_var_FC=no + ;; + *) + hardcode_direct_FC=yes + hardcode_direct_absolute_FC=yes + export_dynamic_flag_spec_FC='${wl}-E' -newsos6) - version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L_FC=yes + ;; + esac + fi + ;; -*nto* | *qnx*) - version_type=qnx - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='ldqnx.so' - ;; + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then + archive_cmds_FC='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + # Try to use the -exported_symbol ld option, if it does not + # work, assume that -exports_file does not work either and + # implicitly export all symbols. + # This should be the same for all languages, so no per-tag cache variable. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 +$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } +if ${lt_cv_irix_exported_symbol+:} false; then : + $as_echo_n "(cached) " >&6 +else + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" + cat > conftest.$ac_ext <<_ACEOF -openbsd*) - version_type=sunos - sys_lib_dlsearch_path_spec="/usr/lib" - need_lib_prefix=no - # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. - case $host_os in - openbsd3.3 | openbsd3.3.*) need_version=yes ;; - *) need_version=no ;; - esac - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - shlibpath_var=LD_LIBRARY_PATH - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - case $host_os in - openbsd2.[89] | openbsd2.[89].*) - shlibpath_overrides_runpath=no - ;; - *) - shlibpath_overrides_runpath=yes - ;; - esac - else - shlibpath_overrides_runpath=yes - fi - ;; + subroutine foo + end +_ACEOF +if ac_fn_fc_try_link "$LINENO"; then : + lt_cv_irix_exported_symbol=yes +else + lt_cv_irix_exported_symbol=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS="$save_LDFLAGS" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 +$as_echo "$lt_cv_irix_exported_symbol" >&6; } + if test "$lt_cv_irix_exported_symbol" = yes; then + archive_expsym_cmds_FC='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' + fi + else + archive_cmds_FC='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds_FC='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' + fi + archive_cmds_need_lc_FC='no' + hardcode_libdir_flag_spec_FC='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_FC=: + inherit_rpath_FC=yes + link_all_deplibs_FC=yes + ;; -os2*) - libname_spec='$name' - shrext_cmds=".dll" - need_lib_prefix=no - library_names_spec='$libname${shared_ext} $libname.a' - dynamic_linker='OS/2 ld.exe' - shlibpath_var=LIBPATH - ;; + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + archive_cmds_FC='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + archive_cmds_FC='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + hardcode_libdir_flag_spec_FC='-R$libdir' + hardcode_direct_FC=yes + hardcode_shlibpath_var_FC=no + ;; -osf3* | osf4* | osf5*) - version_type=osf - need_lib_prefix=no - need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" - sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" - ;; + newsos6) + archive_cmds_FC='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_FC=yes + hardcode_libdir_flag_spec_FC='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_FC=: + hardcode_shlibpath_var_FC=no + ;; -rdos*) - dynamic_linker=no - ;; + *nto* | *qnx*) + ;; -solaris*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - # ldd complains unless libraries are executable - postinstall_cmds='chmod +x $lib' - ;; + openbsd*) + if test -f /usr/libexec/ld.so; then + hardcode_direct_FC=yes + hardcode_shlibpath_var_FC=no + hardcode_direct_absolute_FC=yes + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + archive_cmds_FC='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_FC='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + hardcode_libdir_flag_spec_FC='${wl}-rpath,$libdir' + export_dynamic_flag_spec_FC='${wl}-E' + else + case $host_os in + openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) + archive_cmds_FC='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec_FC='-R$libdir' + ;; + *) + archive_cmds_FC='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec_FC='${wl}-rpath,$libdir' + ;; + esac + fi + else + ld_shlibs_FC=no + fi + ;; -sunos4*) - version_type=sunos - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - if test "$with_gnu_ld" = yes; then - need_lib_prefix=no - fi - need_version=yes - ;; + os2*) + hardcode_libdir_flag_spec_FC='-L$libdir' + hardcode_minus_L_FC=yes + allow_undefined_flag_FC=unsupported + archive_cmds_FC='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + old_archive_from_new_cmds_FC='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + ;; -sysv4 | sysv4.3*) - version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - case $host_vendor in - sni) - shlibpath_overrides_runpath=no - need_lib_prefix=no - runpath_var=LD_RUN_PATH + osf3*) + if test "$GCC" = yes; then + allow_undefined_flag_FC=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds_FC='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + allow_undefined_flag_FC=' -expect_unresolved \*' + archive_cmds_FC='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + fi + archive_cmds_need_lc_FC='no' + hardcode_libdir_flag_spec_FC='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_FC=: ;; - siemens) - need_lib_prefix=no + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + allow_undefined_flag_FC=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds_FC='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec_FC='${wl}-rpath ${wl}$libdir' + else + allow_undefined_flag_FC=' -expect_unresolved \*' + archive_cmds_FC='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds_FC='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ + $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' + + # Both c and cxx compiler support -rpath directly + hardcode_libdir_flag_spec_FC='-rpath $libdir' + fi + archive_cmds_need_lc_FC='no' + hardcode_libdir_separator_FC=: ;; - motorola) - need_lib_prefix=no - need_version=no - shlibpath_overrides_runpath=no - sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + + solaris*) + no_undefined_flag_FC=' -z defs' + if test "$GCC" = yes; then + wlarc='${wl}' + archive_cmds_FC='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_FC='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + else + case `$CC -V 2>&1` in + *"Compilers 5.0"*) + wlarc='' + archive_cmds_FC='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + archive_expsym_cmds_FC='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' + ;; + *) + wlarc='${wl}' + archive_cmds_FC='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_FC='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + ;; + esac + fi + hardcode_libdir_flag_spec_FC='-R$libdir' + hardcode_shlibpath_var_FC=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands `-z linker_flag'. GCC discards it without `$wl', + # but is careful enough not to reorder. + # Supported since Solaris 2.6 (maybe 2.5.1?) + if test "$GCC" = yes; then + whole_archive_flag_spec_FC='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + else + whole_archive_flag_spec_FC='-z allextract$convenience -z defaultextract' + fi + ;; + esac + link_all_deplibs_FC=yes ;; - esac - ;; -sysv4*MP*) - if test -d /usr/nec ;then - version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' - soname_spec='$libname${shared_ext}.$major' - shlibpath_var=LD_LIBRARY_PATH - fi - ;; + sunos4*) + if test "x$host_vendor" = xsequent; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + archive_cmds_FC='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds_FC='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + hardcode_libdir_flag_spec_FC='-L$libdir' + hardcode_direct_FC=yes + hardcode_minus_L_FC=yes + hardcode_shlibpath_var_FC=no + ;; -sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) - version_type=freebsd-elf - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - if test "$with_gnu_ld" = yes; then - sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' - else - sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' - case $host_os in - sco3.2v5*) - sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + sysv4) + case $host_vendor in + sni) + archive_cmds_FC='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_FC=yes # is this really true??? ;; - esac - fi - sys_lib_dlsearch_path_spec='/usr/lib' - ;; - -tpf*) - # TPF is a cross-target only. Preferred cross-host = GNU/Linux. - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + archive_cmds_FC='$LD -G -o $lib $libobjs $deplibs $linker_flags' + reload_cmds_FC='$CC -r -o $output$reload_objs' + hardcode_direct_FC=no + ;; + motorola) + archive_cmds_FC='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_FC=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + hardcode_shlibpath_var_FC=no + ;; -uts4*) - version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - ;; + sysv4.3*) + archive_cmds_FC='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var_FC=no + export_dynamic_flag_spec_FC='-Bexport' + ;; -*) - dynamic_linker=no - ;; -esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 -$as_echo "$dynamic_linker" >&6; } -test "$dynamic_linker" = no && can_build_shared=no + sysv4*MP*) + if test -d /usr/nec; then + archive_cmds_FC='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var_FC=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + ld_shlibs_FC=yes + fi + ;; -variables_saved_for_relink="PATH $shlibpath_var $runpath_var" -if test "$GCC" = yes; then - variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" -fi + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) + no_undefined_flag_FC='${wl}-z,text' + archive_cmds_need_lc_FC=no + hardcode_shlibpath_var_FC=no + runpath_var='LD_RUN_PATH' -if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then - sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" -fi -if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then - sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" -fi + if test "$GCC" = yes; then + archive_cmds_FC='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_FC='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds_FC='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_FC='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + no_undefined_flag_FC='${wl}-z,text' + allow_undefined_flag_FC='${wl}-z,nodefs' + archive_cmds_need_lc_FC=no + hardcode_shlibpath_var_FC=no + hardcode_libdir_flag_spec_FC='${wl}-R,$libdir' + hardcode_libdir_separator_FC=':' + link_all_deplibs_FC=yes + export_dynamic_flag_spec_FC='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + if test "$GCC" = yes; then + archive_cmds_FC='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_FC='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds_FC='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_FC='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + uts4*) + archive_cmds_FC='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec_FC='-L$libdir' + hardcode_shlibpath_var_FC=no + ;; + *) + ld_shlibs_FC=no + ;; + esac + if test x$host_vendor = xsni; then + case $host in + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + export_dynamic_flag_spec_FC='${wl}-Blargedynsym' + ;; + esac + fi + fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_FC" >&5 +$as_echo "$ld_shlibs_FC" >&6; } +test "$ld_shlibs_FC" = no && can_build_shared=no +with_gnu_ld_FC=$with_gnu_ld +# +# Do we need to explicitly link libc? +# +case "x$archive_cmds_need_lc_FC" in +x|xyes) + # Assume -lc should be added + archive_cmds_need_lc_FC=yes + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $archive_cmds_FC in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 +$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } +if ${lt_cv_archive_cmds_need_lc_FC+:} false; then : + $as_echo_n "(cached) " >&6 +else + $RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl_FC + pic_flag=$lt_prog_compiler_pic_FC + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag_FC + allow_undefined_flag_FC= + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds_FC 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 + (eval $archive_cmds_FC 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + then + lt_cv_archive_cmds_need_lc_FC=no + else + lt_cv_archive_cmds_need_lc_FC=yes + fi + allow_undefined_flag_FC=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc_FC" >&5 +$as_echo "$lt_cv_archive_cmds_need_lc_FC" >&6; } + archive_cmds_need_lc_FC=$lt_cv_archive_cmds_need_lc_FC + ;; + esac + fi + ;; +esac @@ -21375,43 +21979,8 @@ fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 -$as_echo_n "checking how to hardcode library paths into programs... " >&6; } -hardcode_action_FC= -if test -n "$hardcode_libdir_flag_spec_FC" || - test -n "$runpath_var_FC" || - test "X$hardcode_automatic_FC" = "Xyes" ; then - # We can hardcode non-existent directories. - if test "$hardcode_direct_FC" != no && - # If the only mechanism to avoid hardcoding is shlibpath_var, we - # have to relink, otherwise we might link with an installed library - # when we should be linking with a yet-to-be-installed one - ## test "$_LT_TAGVAR(hardcode_shlibpath_var, FC)" != no && - test "$hardcode_minus_L_FC" != no; then - # Linking always hardcodes the temporary library directory. - hardcode_action_FC=relink - else - # We can link without hardcoding, and we can hardcode nonexisting dirs. - hardcode_action_FC=immediate - fi -else - # We cannot hardcode anything, or else we can only hardcode existing - # directories. - hardcode_action_FC=unsupported -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action_FC" >&5 -$as_echo "$hardcode_action_FC" >&6; } -if test "$hardcode_action_FC" = relink || - test "$inherit_rpath_FC" = yes; then - # Fast installation is not supported - enable_fast_install=no -elif test "$shlibpath_overrides_runpath" = yes || - test "$enable_shared" = no; then - # Fast installation is not necessary - enable_fast_install=needless -fi @@ -21419,18 +21988,8 @@ fi - fi # test -n "$compiler" - GCC=$lt_save_GCC - CC=$lt_save_CC - CFLAGS=$lt_save_CFLAGS -fi # test "$_lt_disable_FC" != yes -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu @@ -21442,1066 +22001,994 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu - ac_config_commands="$ac_config_commands libtool" -# Only expand once: -## ---------------------------------------------------------------------- -## Check if we should install only statically linked executables. -## This check needs to occur after libtool is initialized because -## we check a libtool cache value and may issue a warning based -## on its result. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we should install only statically linked executables" >&5 -$as_echo_n "checking if we should install only statically linked executables... " >&6; } -# Check whether --enable-static_exec was given. -if test "${enable_static_exec+set}" = set; then : - enableval=$enable_static_exec; STATIC_EXEC=$enableval -fi -if test "X$STATIC_EXEC" = "Xyes"; then - echo "yes" - ## Issue a warning if -static flag is not supported. - if test "X$lt_cv_prog_compiler_static_works" = "Xno"; then - echo " warning: -static flag not supported on this system; executable won't statically link shared system libraries." - LT_STATIC_EXEC="" - else - LT_STATIC_EXEC="-all-static" - fi -else - echo "no" - LT_STATIC_EXEC="" -fi - if test "X$LT_STATIC_EXEC" = X; then - USE_PLUGINS_CONDITIONAL_TRUE= - USE_PLUGINS_CONDITIONAL_FALSE='#' -else - USE_PLUGINS_CONDITIONAL_TRUE='#' - USE_PLUGINS_CONDITIONAL_FALSE= -fi -## Fix up the INSTALL macro if it's a relative path. We want the -## full-path to the binary instead. -case "$INSTALL" in - *install-sh*) - INSTALL='\${top_srcdir}/bin/install-sh -c' - ;; -esac -## ---------------------------------------------------------------------- -## Some users have reported problems with libtool's use of '-Wl,-rpath' to -## link shared libraries in nondefault directories. Allow users to -## disable embedding the rpath information in the executables and to -## instead solely rely on the information in LD_LIBRARY_PATH. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if -Wl,-rpath should be used to link shared libs in nondefault directories" >&5 -$as_echo_n "checking if -Wl,-rpath should be used to link shared libs in nondefault directories... " >&6; } -# Check whether --enable-sharedlib-rpath was given. -if test "${enable_sharedlib_rpath+set}" = set; then : - enableval=$enable_sharedlib_rpath; RPATH=$enableval -fi -case "X-$RPATH" in - X-no) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - runpath_var= - hardcode_libdir_flag_spec= - hardcode_libdir_flag_spec_ld= - hardcode_into_libs=no - ;; - X-|X-yes) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - ;; - *) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: error" >&5 -$as_echo "error" >&6; } - as_fn_error $? "\'$enableval\' is not a valid rpath type" "$LINENO" 5 - ;; -esac + { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 +$as_echo_n "checking dynamic linker characteristics... " >&6; } -## ---------------------------------------------------------------------- -## pmake will throw an error if variables are undefined in a Makefile. -## These errors can be changed to warnings using the -V flag. -## - AM_MAKEFLAGS="" +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +need_lib_prefix=unknown +hardcode_into_libs=no -## Don't run test if MAKE is defined but is the empty string -if test -n "${MAKE-make}"; then +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether make will build with undefined variables" >&5 -$as_echo_n "checking whether make will build with undefined variables... " >&6; } +case $host_os in +aix3*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH - cat >maketest </dev/null 2>&1; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +aix[4-9]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, setting -V flag" >&5 -$as_echo "no, setting -V flag" >&6; } - AM_MAKEFLAGS="\-V" + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH fi + ;; - rm maketest -fi - -## ---------------------------------------------------------------------- -## Production flags? Save the value in $CONFIG_MODE so we have it for -## the record. -## -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for production mode" >&5 -$as_echo_n "checking for production mode... " >&6; } -# Check whether --enable-production was given. -if test "${enable_production+set}" = set; then : - enableval=$enable_production; -fi - - -case "X-$enable_production" in - X-yes) - enable_production="yes" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: production" >&5 -$as_echo "production" >&6; } - CONFIG_MODE=production - H5_CFLAGS="$H5_CFLAGS $PROD_CFLAGS" - H5_CPPFLAGS="$H5_CPPFLAGS $PROD_CPPFLAGS" - H5_CXXFLAGS="$H5_CXXFLAGS $PROD_CXXFLAGS" - H5_FCFLAGS="$H5_FCFLAGS $PROD_FCFLAGS" - ;; - X-|X-no) - enable_production="no" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: development" >&5 -$as_echo "development" >&6; } - CONFIG_MODE=development - H5_CFLAGS="$H5_CFLAGS $DEBUG_CFLAGS" - H5_CPPFLAGS="$H5_CPPFLAGS $DEBUG_CPPFLAGS" - H5_CXXFLAGS="$H5_CXXFLAGS $DEBUG_CXXFLAGS" - H5_FCFLAGS="$H5_FCFLAGS $DEBUG_FCFLAGS" - ;; - X-pg|X-profile) - enable_production="profile" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: profile" >&5 -$as_echo "profile" >&6; } - CONFIG_MODE=profile - H5_CFLAGS="$H5_CFLAGS $PROFILE_CFLAGS" - H5_CPPFLAGS="$H5_CPPFLAGS $PROFILE_CPPFLAGS" - H5_CXXFLAGS="$H5_CXXFLAGS $PROFILE_CXXFLAGS" - H5_FCFLAGS="$H5_FCFLAGS $PROFILE_FCFLAGS" +amigaos*) + case $host_cpu in + powerpc) + # Since July 2007 AmigaOS4 officially supports .so libraries. + # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; - *) - enable_production="user-defined" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: user-defined" >&5 -$as_echo "user-defined" >&6; } - CONFIG_MODE="$enableval" + m68k) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; -esac + esac + ;; -## ---------------------------------------------------------------------- -## Check for system libraries. "dl" stands for dynamically loaded library -## -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ceil in -lm" >&5 -$as_echo_n "checking for ceil in -lm... " >&6; } -if ${ac_cv_lib_m_ceil+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lm $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char ceil (); -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus - extern "C" -# endif - int FC_DUMMY_MAIN() { return 1; } -#endif -#endif -int -main () -{ -return ceil (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_m_ceil=yes -else - ac_cv_lib_m_ceil=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_ceil" >&5 -$as_echo "$ac_cv_lib_m_ceil" >&6; } -if test "x$ac_cv_lib_m_ceil" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBM 1 -_ACEOF +bsdi[45]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; - LIBS="-lm $LIBS" +cygwin* | mingw* | pw32* | cegcc*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no -fi + case $GCC,$cc_basename in + yes,*) + # gcc + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 -$as_echo_n "checking for dlopen in -ldl... " >&6; } -if ${ac_cv_lib_dl_dlopen+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldl $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dlopen (); -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus - extern "C" -# endif - int FC_DUMMY_MAIN() { return 1; } -#endif -#endif -int -main () -{ -return dlopen (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_dl_dlopen=yes -else - ac_cv_lib_dl_dlopen=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 -$as_echo "$ac_cv_lib_dl_dlopen" >&6; } -if test "x$ac_cv_lib_dl_dlopen" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBDL 1 -_ACEOF + ;; + mingw* | cegcc*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + esac + dynamic_linker='Win32 ld.exe' + ;; - LIBS="-ldl $LIBS" + *,cl*) + # Native MSVC + libname_spec='$name' + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + library_names_spec='${libname}.dll.lib' -fi + case $build_os in + mingw*) + sys_lib_search_path_spec= + lt_save_ifs=$IFS + IFS=';' + for lt_path in $LIB + do + IFS=$lt_save_ifs + # Let DOS variable expansion print the short 8.3 style file name. + lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` + sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" + done + IFS=$lt_save_ifs + # Convert to MSYS style. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` + ;; + cygwin*) + # Convert to unix form, then to dos form, then back to unix form + # but this time dos style (no spaces!) so that the unix form looks + # like /cygdrive/c/PROGRA~1:/cygdr... + sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` + sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` + sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + ;; + *) + sys_lib_search_path_spec="$LIB" + if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + # FIXME: find the short name or the path components, as spaces are + # common. (e.g. "Program Files" -> "PROGRA~1") + ;; + esac + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + dynamic_linker='Win32 link.exe' + ;; -if test "`uname`" = "SunOS" -o "`uname -sr`" = "HP-UX B.11.00"; then - ## ...for Solaris - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for socket in -lsocket" >&5 -$as_echo_n "checking for socket in -lsocket... " >&6; } -if ${ac_cv_lib_socket_socket+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lsocket $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + *) + # Assume MSVC wrapper + library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' + dynamic_linker='Win32 ld.exe' + ;; + esac + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' + + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char socket (); -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus - extern "C" -# endif - int FC_DUMMY_MAIN() { return 1; } -#endif -#endif -int -main () -{ -return socket (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_socket_socket=yes -else - ac_cv_lib_socket_socket=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_socket" >&5 -$as_echo "$ac_cv_lib_socket_socket" >&6; } -if test "x$ac_cv_lib_socket_socket" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBSOCKET 1 -_ACEOF +dgux*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; - LIBS="-lsocket $LIBS" +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[23].*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2.*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ + freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + *) # from 4.6 on, and DragonFly + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; -fi +gnu*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for xdr_int in -lnsl" >&5 -$as_echo_n "checking for xdr_int in -lnsl... " >&6; } -if ${ac_cv_lib_nsl_xdr_int+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lnsl $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ +haiku*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + dynamic_linker="$host_os runtime_loader" + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LIBRARY_PATH + shlibpath_overrides_runpath=yes + sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' + hardcode_into_libs=yes + ;; -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char xdr_int (); -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus - extern "C" -# endif - int FC_DUMMY_MAIN() { return 1; } -#endif -#endif -int -main () -{ -return xdr_int (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_nsl_xdr_int=yes -else - ac_cv_lib_nsl_xdr_int=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_xdr_int" >&5 -$as_echo "$ac_cv_lib_nsl_xdr_int" >&6; } -if test "x$ac_cv_lib_nsl_xdr_int" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBNSL 1 -_ACEOF +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555, ... + postinstall_cmds='chmod 555 $lib' + # or fails outright, so override atomically: + install_override_mode=555 + ;; - LIBS="-lnsl $LIBS" +interix[3-9]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux # correct to gnu/linux during the next big refactor + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; -fi +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; -fi +# This must be glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no -## ---------------------------------------------------------------------- -## Check for system header files. -## -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 -$as_echo_n "checking for ANSI C header files... " >&6; } -if ${ac_cv_header_stdc+:} false; then : + # Some binutils ld are patched to set DT_RUNPATH + if ${lt_cv_shlibpath_overrides_runpath+:} false; then : $as_echo_n "(cached) " >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#include -#include - -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus - extern "C" -# endif - int FC_DUMMY_MAIN() { return 1; } -#endif -#endif -int -main () -{ + lt_cv_shlibpath_overrides_runpath=no + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$lt_prog_compiler_wl_FC\"; \ + LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec_FC\"" + cat > conftest.$ac_ext <<_ACEOF + program main - ; - return 0; -} + end _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_header_stdc=yes -else - ac_cv_header_stdc=no +if ac_fn_fc_try_link "$LINENO"; then : + if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : + lt_cv_shlibpath_overrides_runpath=yes fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then : - -else - ac_cv_header_stdc=no fi -rm -f conftest* +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir fi -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include + shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then : + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes -else - ac_cv_header_stdc=no -fi -rm -f conftest* + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + fi -fi + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then : - : -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#if ((' ' & 0x0FF) == 0x020) -# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#else -# define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) -# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) -#endif +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int -main () -{ - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - return 2; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : +newsos6) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; -else - ac_cv_header_stdc=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi +*nto* | *qnx*) + version_type=qnx + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='ldqnx.so' + ;; -fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 -$as_echo "$ac_cv_header_stdc" >&6; } -if test $ac_cv_header_stdc = yes; then +openbsd*) + version_type=sunos + sys_lib_dlsearch_path_spec="/usr/lib" + need_lib_prefix=no + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[89] | openbsd2.[89].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; -$as_echo "#define STDC_HEADERS 1" >>confdefs.h +os2*) + libname_spec='$name' + shrext_cmds=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; -fi +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5 -$as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; } -if ${ac_cv_header_time+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#include +rdos*) + dynamic_linker=no + ;; + +solaris*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus - extern "C" -# endif - int FC_DUMMY_MAIN() { return 1; } -#endif -#endif -int -main () -{ -if ((struct tm *) 0) -return 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_header_time=yes -else - ac_cv_header_time=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_time" >&5 -$as_echo "$ac_cv_header_time" >&6; } -if test $ac_cv_header_time = yes; then +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; -$as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h +sysv4 | sysv4.3*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; -fi +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; -## Unix -for ac_header in sys/resource.h sys/time.h unistd.h sys/ioctl.h sys/stat.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF +tpf*) + # TPF is a cross-target only. Preferred cross-host = GNU/Linux. + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; -fi +uts4*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; -done +*) + dynamic_linker=no + ;; +esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 +$as_echo "$dynamic_linker" >&6; } +test "$dynamic_linker" = no && can_build_shared=no -for ac_header in sys/socket.h sys/types.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi +if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then + sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" +fi +if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then + sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi -done -for ac_header in stddef.h setjmp.h features.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF -fi -done -for ac_header in dirent.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "dirent.h" "ac_cv_header_dirent_h" "$ac_includes_default" -if test "x$ac_cv_header_dirent_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_DIRENT_H 1 -_ACEOF -fi -done -for ac_header in stdint.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "stdint.h" "ac_cv_header_stdint_h" "$ac_includes_default" -if test "x$ac_cv_header_stdint_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_STDINT_H 1 -_ACEOF - C9x=yes -fi -done -## Darwin -for ac_header in mach/mach_time.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "mach/mach_time.h" "ac_cv_header_mach_mach_time_h" "$ac_includes_default" -if test "x$ac_cv_header_mach_mach_time_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_MACH_MACH_TIME_H 1 -_ACEOF -fi -done -## Also need to detect Darwin for pubconf -case $host_os in - darwin*) -$as_echo "#define HAVE_DARWIN 1" >>confdefs.h - ;; -esac -## Windows -case "`uname`" in - CYGWIN*) - for ac_header in io.h sys/timeb.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF -fi -done - ;; - MINGW*) - for ac_header in io.h winsock2.h sys/timeb.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF -fi -done - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lws2_32" >&5 -$as_echo_n "checking for main in -lws2_32... " >&6; } -if ${ac_cv_lib_ws2_32_main+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lws2_32 $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus - extern "C" -# endif - int FC_DUMMY_MAIN() { return 1; } -#endif -#endif -int -main () -{ -return main (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_ws2_32_main=yes -else - ac_cv_lib_ws2_32_main=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ws2_32_main" >&5 -$as_echo "$ac_cv_lib_ws2_32_main" >&6; } -if test "x$ac_cv_lib_ws2_32_main" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBWS2_32 1 -_ACEOF - LIBS="-lws2_32 $LIBS" -fi -ac_cv_lib_ws2_32=ac_cv_lib_ws2_32_main - ;; - *) - for ac_header in io.h winsock2.h sys/timeb.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF -fi -done - ;; -esac -case "$host" in - alpha*-dec*-osf*) - ## The and are needed on the DEC - ## Alpha to turn off UAC fixing. We do *not* attempt to - ## locate these files on other systems because there are too - ## many problems with including them. - for ac_header in sys/sysinfo.h sys/proc.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF -fi -done - ;; - mips*-sgi*) - ## The is needed on the SGI machines to turn off - ## denormalized floating-point values going to zero. We do *not* - ## attempt to locate these files on other systems because there - ## may be problems with including them. - for ac_header in sys/fpu.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "sys/fpu.h" "ac_cv_header_sys_fpu_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_fpu_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_SYS_FPU_H 1 -_ACEOF -fi -done - for ac_func in get_fpc_csr -do : - ac_fn_c_check_func "$LINENO" "get_fpc_csr" "ac_cv_func_get_fpc_csr" -if test "x$ac_cv_func_get_fpc_csr" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_GET_FPC_CSR 1 -_ACEOF + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 +$as_echo_n "checking how to hardcode library paths into programs... " >&6; } +hardcode_action_FC= +if test -n "$hardcode_libdir_flag_spec_FC" || + test -n "$runpath_var_FC" || + test "X$hardcode_automatic_FC" = "Xyes" ; then + # We can hardcode non-existent directories. + if test "$hardcode_direct_FC" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_TAGVAR(hardcode_shlibpath_var, FC)" != no && + test "$hardcode_minus_L_FC" != no; then + # Linking always hardcodes the temporary library directory. + hardcode_action_FC=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action_FC=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action_FC=unsupported fi -done - - ;; -esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action_FC" >&5 +$as_echo "$hardcode_action_FC" >&6; } -## ---------------------------------------------------------------------- -## Some platforms require that all symbols are resolved when a library -## is linked. We can use the -no-undefined flag to tell libtool that -## it will be able to build shared libraries on these architectures, -## as it will not do so by default. -## -if test "X${enable_shared}" = "Xyes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool needs -no-undefined flag to build shared libraries" >&5 -$as_echo_n "checking if libtool needs -no-undefined flag to build shared libraries... " >&6; } - case "`uname`" in - CYGWIN*|MINGW*|AIX*) - ## Add in the -no-undefined flag to LDFLAGS for libtool. - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - H5_LDFLAGS="$H5_LDFLAGS -no-undefined" - ;; - *) - ## Don't add in anything. - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - ;; - esac +if test "$hardcode_action_FC" = relink || + test "$inherit_rpath_FC" = yes; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless fi -## ---------------------------------------------------------------------- -## Use the macro _AC_SYS_LARGEFILE_MACRO_VALUE to test defines -## that might need to be set for largefile support to behave -## correctly. This macro is defined in acsite.m4 and overrides -## the version provided by Autoconf (as of v2.65). The custom -## macro additionally adds the appropriate defines to AM_CPPFLAGS -## so that later configure checks have them visible. -## Check for _FILE_OFFSET_BITS -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5 -$as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; } -if ${ac_cv_sys_file_offset_bits+:} false; then : - $as_echo_n "(cached) " >&6 -else - while :; do - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - /* Check that off_t can represent 2**63 - 1 correctly. - We can't simply define LARGE_OFF_T to be 9223372036854775807, - since some C++ compilers masquerading as C compilers - incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) - int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 - && LARGE_OFF_T % 2147483647 == 1) - ? 1 : -1]; -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus - extern "C" -# endif - int FC_DUMMY_MAIN() { return 1; } -#endif -#endif -int -main () -{ - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_sys_file_offset_bits=no; break -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#define _FILE_OFFSET_BITS 64 -#include - /* Check that off_t can represent 2**63 - 1 correctly. - We can't simply define LARGE_OFF_T to be 9223372036854775807, - since some C++ compilers masquerading as C compilers - incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) - int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 - && LARGE_OFF_T % 2147483647 == 1) - ? 1 : -1]; -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus - extern "C" -# endif - int FC_DUMMY_MAIN() { return 1; } -#endif -#endif -int -main () -{ - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_sys_file_offset_bits=64; break -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_cv_sys_file_offset_bits=unknown - break -done -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5 -$as_echo "$ac_cv_sys_file_offset_bits" >&6; } -case $ac_cv_sys_file_offset_bits in #( - no | unknown) ;; - *) -cat >>confdefs.h <<_ACEOF -#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits -_ACEOF - AM_CPPFLAGS="-D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits $AM_CPPFLAGS";; -esac -rm -rf conftest* -## Check for _LARGE_FILES -if test "$ac_cv_sys_file_offset_bits" = unknown; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5 -$as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; } -if ${ac_cv_sys_large_files+:} false; then : - $as_echo_n "(cached) " >&6 -else - while :; do - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - /* Check that off_t can represent 2**63 - 1 correctly. - We can't simply define LARGE_OFF_T to be 9223372036854775807, - since some C++ compilers masquerading as C compilers - incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) - int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 - && LARGE_OFF_T % 2147483647 == 1) - ? 1 : -1]; -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus - extern "C" -# endif - int FC_DUMMY_MAIN() { return 1; } -#endif -#endif -int -main () -{ - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_sys_large_files=no; break + fi # test -n "$compiler" + + GCC=$lt_save_GCC + CC=$lt_save_CC + CFLAGS=$lt_save_CFLAGS +fi # test "$_lt_disable_FC" != yes + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + + + + + + + + + + ac_config_commands="$ac_config_commands libtool" + + + + +# Only expand once: + + + + + +## ---------------------------------------------------------------------- +## Check if we should install only statically linked executables. +## This check needs to occur after libtool is initialized because +## we check a libtool cache value and may issue a warning based +## on its result. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we should install only statically linked executables" >&5 +$as_echo_n "checking if we should install only statically linked executables... " >&6; } +# Check whether --enable-static_exec was given. +if test "${enable_static_exec+set}" = set; then : + enableval=$enable_static_exec; STATIC_EXEC=$enableval fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#define _LARGE_FILES 1 -#include - /* Check that off_t can represent 2**63 - 1 correctly. - We can't simply define LARGE_OFF_T to be 9223372036854775807, - since some C++ compilers masquerading as C compilers - incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) - int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 - && LARGE_OFF_T % 2147483647 == 1) - ? 1 : -1]; -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus - extern "C" -# endif - int FC_DUMMY_MAIN() { return 1; } -#endif -#endif -int -main () -{ - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_sys_large_files=1; break + +if test "X$STATIC_EXEC" = "Xyes"; then + echo "yes" + ## Issue a warning if -static flag is not supported. + if test "X$lt_cv_prog_compiler_static_works" = "Xno"; then + echo " warning: -static flag not supported on this system; executable won't statically link shared system libraries." + LT_STATIC_EXEC="" + else + LT_STATIC_EXEC="-all-static" + fi +else + echo "no" + LT_STATIC_EXEC="" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_cv_sys_large_files=unknown - break -done + if test "X$LT_STATIC_EXEC" = X; then + USE_PLUGINS_CONDITIONAL_TRUE= + USE_PLUGINS_CONDITIONAL_FALSE='#' +else + USE_PLUGINS_CONDITIONAL_TRUE='#' + USE_PLUGINS_CONDITIONAL_FALSE= fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5 -$as_echo "$ac_cv_sys_large_files" >&6; } -case $ac_cv_sys_large_files in #( - no | unknown) ;; - *) -cat >>confdefs.h <<_ACEOF -#define _LARGE_FILES $ac_cv_sys_large_files -_ACEOF - AM_CPPFLAGS="-D_LARGE_FILES=$ac_cv_sys_large_files $AM_CPPFLAGS";; + + + +## Fix up the INSTALL macro if it's a relative path. We want the +## full-path to the binary instead. +case "$INSTALL" in + *install-sh*) + INSTALL='\${top_srcdir}/bin/install-sh -c' + ;; esac -rm -rf conftest* + +## ---------------------------------------------------------------------- +## Some users have reported problems with libtool's use of '-Wl,-rpath' to +## link shared libraries in nondefault directories. Allow users to +## disable embedding the rpath information in the executables and to +## instead solely rely on the information in LD_LIBRARY_PATH. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if -Wl,-rpath should be used to link shared libs in nondefault directories" >&5 +$as_echo_n "checking if -Wl,-rpath should be used to link shared libs in nondefault directories... " >&6; } +# Check whether --enable-sharedlib-rpath was given. +if test "${enable_sharedlib_rpath+set}" = set; then : + enableval=$enable_sharedlib_rpath; RPATH=$enableval fi + +case "X-$RPATH" in + X-no) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + runpath_var= + hardcode_libdir_flag_spec= + hardcode_libdir_flag_spec_ld= + hardcode_into_libs=no + ;; + X-|X-yes) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + ;; + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: error" >&5 +$as_echo "error" >&6; } + as_fn_error $? "\'$enableval\' is not a valid rpath type" "$LINENO" 5 + ;; +esac + ## ---------------------------------------------------------------------- -## Add necessary defines for Linux Systems. +## pmake will throw an error if variables are undefined in a Makefile. +## These errors can be changed to warnings using the -V flag. ## -case "$host_cpu-$host_vendor-$host_os" in - *linux*) - ## Make available various LFS-related routines using the following - ## _LARGEFILE*_SOURCE macros. - AM_CPPFLAGS="-D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE $AM_CPPFLAGS" + AM_MAKEFLAGS="" - ## Add POSIX support on Linux systems, so defines - ## __USE_POSIX, which is required to get the prototype for fdopen - ## defined correctly in . - ## - ## This flag was removed from h5cc as of 2009-10-17 when it was found - ## that the flag broke compiling netCDF-4 code with h5cc, but kept in - ## H5_CPPFLAGS because fdopen and HDfdopen fail without it. HDfdopen - ## is used only by H5_debug_mask which is used only when debugging in - ## H5_init_library (all in H5.c). When the flag was removed this was - ## the only compile failure noted. - ## - ## This was originally defined as _POSIX_SOURCE which was updated to - ## _POSIX_C_SOURCE=199506L to expose a greater amount of POSIX - ## functionality so clock_gettime and CLOCK_MONOTONIC are defined - ## correctly. This was later updated to 200112L so that - ## posix_memalign() is visible for the direct VFD code on Linux - ## systems. - ## - ## POSIX feature information can be found in the gcc manual at: - ## http://www.gnu.org/s/libc/manual/html_node/Feature-Test-Macros.html - H5_CPPFLAGS="-D_POSIX_C_SOURCE=200112L $H5_CPPFLAGS" +## Don't run test if MAKE is defined but is the empty string +if test -n "${MAKE-make}"; then - ## Need to add this so that O_DIRECT is visible for the direct - ## VFD on Linux systems. - H5_CPPFLAGS="-D_GNU_SOURCE $H5_CPPFLAGS" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether make will build with undefined variables" >&5 +$as_echo_n "checking whether make will build with undefined variables... " >&6; } - ## Also add BSD support on Linux systems, so defines - ## __USE_BSD, which is required to get the prototype for strdup - ## defined correctly in and snprintf & vsnprintf defined - ## correctly in - ## Linking to the bsd-compat library is required as per the gcc manual: - ## http://www.gnu.org/s/libc/manual/html_node/Feature-Test-Macros.html - ## however, we do not do this since it breaks the big test on some - ## older platforms. - H5_CPPFLAGS="-D_BSD_SOURCE $H5_CPPFLAGS" + cat >maketest </dev/null 2>&1; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, setting -V flag" >&5 +$as_echo "no, setting -V flag" >&6; } + AM_MAKEFLAGS="\-V" + fi + + rm maketest +fi + +## ---------------------------------------------------------------------- +## Production flags? Save the value in $CONFIG_MODE so we have it for +## the record. +## +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for production mode" >&5 +$as_echo_n "checking for production mode... " >&6; } +# Check whether --enable-production was given. +if test "${enable_production+set}" = set; then : + enableval=$enable_production; +fi + + +case "X-$enable_production" in + X-yes) + enable_production="yes" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: production" >&5 +$as_echo "production" >&6; } + CONFIG_MODE=production + H5_CFLAGS="$H5_CFLAGS $PROD_CFLAGS" + H5_CPPFLAGS="$H5_CPPFLAGS $PROD_CPPFLAGS" + H5_CXXFLAGS="$H5_CXXFLAGS $PROD_CXXFLAGS" + H5_FCFLAGS="$H5_FCFLAGS $PROD_FCFLAGS" + ;; + X-|X-no) + enable_production="no" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: development" >&5 +$as_echo "development" >&6; } + CONFIG_MODE=development + H5_CFLAGS="$H5_CFLAGS $DEBUG_CFLAGS" + H5_CPPFLAGS="$H5_CPPFLAGS $DEBUG_CPPFLAGS" + H5_CXXFLAGS="$H5_CXXFLAGS $DEBUG_CXXFLAGS" + H5_FCFLAGS="$H5_FCFLAGS $DEBUG_FCFLAGS" + ;; + X-pg|X-profile) + enable_production="profile" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: profile" >&5 +$as_echo "profile" >&6; } + CONFIG_MODE=profile + H5_CFLAGS="$H5_CFLAGS $PROFILE_CFLAGS" + H5_CPPFLAGS="$H5_CPPFLAGS $PROFILE_CPPFLAGS" + H5_CXXFLAGS="$H5_CXXFLAGS $PROFILE_CXXFLAGS" + H5_FCFLAGS="$H5_FCFLAGS $PROFILE_FCFLAGS" + ;; + *) + enable_production="user-defined" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: user-defined" >&5 +$as_echo "user-defined" >&6; } + CONFIG_MODE="$enableval" ;; esac -## Need to add the AM_ and H5_ into CFLAGS/CPPFLAGS to make them visible -## for configure checks. -## Note: Both will be restored by the end of configure. -CPPFLAGS="$H5_CPPFLAGS $AM_CPPFLAGS $CPPFLAGS" -CFLAGS="$H5_CFLAGS $AM_CFLAGS $CFLAGS" - +## ---------------------------------------------------------------------- +## Check for system libraries. "dl" stands for dynamically loaded library +## +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ceil in -lm" >&5 +$as_echo_n "checking for ceil in -lm... " >&6; } +if ${ac_cv_lib_m_ceil+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lm $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char ceil (); #ifdef FC_DUMMY_MAIN #ifndef FC_DUMMY_MAIN_EQ_F77 # ifdef __cplusplus @@ -22513,46 +23000,48 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext int main () { -off64_t n = 0; +return ceil (); ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - for ac_func in lseek64 fseeko64 ftello64 ftruncate64 -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_m_ceil=yes else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: skipping test for lseek64(), fseeko64 , ftello64, ftruncate64() because off64_t is not defined" >&5 -$as_echo "skipping test for lseek64(), fseeko64 , ftello64, ftruncate64() because off64_t is not defined" >&6; } + ac_cv_lib_m_ceil=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -for ac_func in fseeko ftello -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_ceil" >&5 +$as_echo "$ac_cv_lib_m_ceil" >&6; } +if test "x$ac_cv_lib_m_ceil" = xyes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define HAVE_LIBM 1 _ACEOF + LIBS="-lm $LIBS" + fi -done +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } +if ${ac_cv_lib_dl_dlopen+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include -#include +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); #ifdef FC_DUMMY_MAIN #ifndef FC_DUMMY_MAIN_EQ_F77 # ifdef __cplusplus @@ -22564,186 +23053,51 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext int main () { -struct stat64 sb; +return dlopen (); ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - for ac_func in stat64 fstat64 -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dl_dlopen=yes else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: skipping test for stat64() and fstat64()" >&5 -$as_echo "skipping test for stat64() and fstat64()" >&6; } + ac_cv_lib_dl_dlopen=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -## ---------------------------------------------------------------------- -## Data types and their sizes. -## -ac_fn_c_check_type "$LINENO" "off_t" "ac_cv_type_off_t" "$ac_includes_default" -if test "x$ac_cv_type_off_t" = xyes; then : - -else - -cat >>confdefs.h <<_ACEOF -#define off_t long int -_ACEOF - +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS fi - -ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" -if test "x$ac_cv_type_size_t" = xyes; then : - -else - -cat >>confdefs.h <<_ACEOF -#define size_t unsigned long +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBDL 1 _ACEOF -fi - -ac_fn_c_check_type "$LINENO" "ssize_t" "ac_cv_type_ssize_t" "$ac_includes_default" -if test "x$ac_cv_type_ssize_t" = xyes; then : - -else - -cat >>confdefs.h <<_ACEOF -#define ssize_t long -_ACEOF + LIBS="-ldl $LIBS" fi -ac_fn_c_check_type "$LINENO" "ptrdiff_t" "ac_cv_type_ptrdiff_t" "$ac_includes_default" -if test "x$ac_cv_type_ptrdiff_t" = xyes; then : - -else - -cat >>confdefs.h <<_ACEOF -#define ptrdiff_t long -_ACEOF - -fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 -$as_echo_n "checking whether byte ordering is bigendian... " >&6; } -if ${ac_cv_c_bigendian+:} false; then : +if test "`uname`" = "SunOS" -o "`uname -sr`" = "HP-UX B.11.00"; then + ## ...for Solaris + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for socket in -lsocket" >&5 +$as_echo_n "checking for socket in -lsocket... " >&6; } +if ${ac_cv_lib_socket_socket+:} false; then : $as_echo_n "(cached) " >&6 else - ac_cv_c_bigendian=unknown - # See if we're dealing with a universal compiler. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifndef __APPLE_CC__ - not a universal capable compiler - #endif - typedef int dummy; - -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - - # Check for potential -arch flags. It is not universal unless - # there are at least two -arch flags with different values. - ac_arch= - ac_prev= - for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do - if test -n "$ac_prev"; then - case $ac_word in - i?86 | x86_64 | ppc | ppc64) - if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then - ac_arch=$ac_word - else - ac_cv_c_bigendian=universal - break - fi - ;; - esac - ac_prev= - elif test "x$ac_word" = "x-arch"; then - ac_prev=arch - fi - done -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - if test $ac_cv_c_bigendian = unknown; then - # See if sys/param.h defines the BYTE_ORDER macro. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - #include - -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus - extern "C" -# endif - int FC_DUMMY_MAIN() { return 1; } -#endif -#endif -int -main () -{ -#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ - && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ - && LITTLE_ENDIAN) - bogus endian macros - #endif - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - # It does; now see whether it defined to BIG_ENDIAN or not. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsocket $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include - #include -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus - extern "C" -# endif - int FC_DUMMY_MAIN() { return 1; } -#endif +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" #endif -int -main () -{ -#if BYTE_ORDER != BIG_ENDIAN - not big endian - #endif - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_c_bigendian=yes -else - ac_cv_c_bigendian=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - fi - if test $ac_cv_c_bigendian = unknown; then - # See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - +char socket (); #ifdef FC_DUMMY_MAIN #ifndef FC_DUMMY_MAIN_EQ_F77 # ifdef __cplusplus @@ -22755,20 +23109,48 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext int main () { -#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) - bogus endian macros - #endif - +return socket (); ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - # It does; now see whether it defined to _BIG_ENDIAN or not. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_socket_socket=yes +else + ac_cv_lib_socket_socket=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_socket" >&5 +$as_echo "$ac_cv_lib_socket_socket" >&6; } +if test "x$ac_cv_lib_socket_socket" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBSOCKET 1 +_ACEOF + + LIBS="-lsocket $LIBS" + +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for xdr_int in -lnsl" >&5 +$as_echo_n "checking for xdr_int in -lnsl... " >&6; } +if ${ac_cv_lib_nsl_xdr_int+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lnsl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char xdr_int (); #ifdef FC_DUMMY_MAIN #ifndef FC_DUMMY_MAIN_EQ_F77 # ifdef __cplusplus @@ -22780,44 +23162,47 @@ if ac_fn_c_try_compile "$LINENO"; then : int main () { -#ifndef _BIG_ENDIAN - not big endian - #endif - +return xdr_int (); ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_c_bigendian=yes +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_nsl_xdr_int=yes else - ac_cv_c_bigendian=no + ac_cv_lib_nsl_xdr_int=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - fi - if test $ac_cv_c_bigendian = unknown; then - # Compile a test program. - if test "$cross_compiling" = yes; then : - # Try to guess by grepping values from an object file. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_xdr_int" >&5 +$as_echo "$ac_cv_lib_nsl_xdr_int" >&6; } +if test "x$ac_cv_lib_nsl_xdr_int" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBNSL 1 +_ACEOF + + LIBS="-lnsl $LIBS" + +fi + +fi + +## ---------------------------------------------------------------------- +## Check for system header files. +## +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if ${ac_cv_header_stdc+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -short int ascii_mm[] = - { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; - short int ascii_ii[] = - { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; - int use_ascii (int i) { - return ascii_mm[i] + ascii_ii[i]; - } - short int ebcdic_ii[] = - { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; - short int ebcdic_mm[] = - { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; - int use_ebcdic (int i) { - return ebcdic_mm[i] + ebcdic_ii[i]; - } - extern int foo; +#include +#include +#include +#include #ifdef FC_DUMMY_MAIN #ifndef FC_DUMMY_MAIN_EQ_F77 @@ -22830,29 +23215,114 @@ short int ascii_mm[] = int main () { -return use_ascii (foo) == use_ebcdic (foo); + ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : - if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then - ac_cv_c_bigendian=yes - fi - if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then - if test "$ac_cv_c_bigendian" = unknown; then - ac_cv_c_bigendian=no - else - # finding both strings is unlikely to happen, but who knows? - ac_cv_c_bigendian=unknown - fi - fi + ac_cv_header_stdc=yes +else + ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then : + else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -$ac_includes_default +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + return 2; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + +else + ac_cv_header_stdc=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +$as_echo "#define STDC_HEADERS 1" >>confdefs.h + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5 +$as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; } +if ${ac_cv_header_time+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include + #ifdef FC_DUMMY_MAIN #ifndef FC_DUMMY_MAIN_EQ_F77 # ifdef __cplusplus @@ -22864,379 +23334,617 @@ $ac_includes_default int main () { - - /* Are we little or big endian? From Harbison&Steele. */ - union - { - long int l; - char c[sizeof (long int)]; - } u; - u.l = 1; - return u.c[sizeof (long int) - 1] == 1; - +if ((struct tm *) 0) +return 0; ; return 0; } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : - ac_cv_c_bigendian=no +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_time=yes else - ac_cv_c_bigendian=yes + ac_cv_header_time=no fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_time" >&5 +$as_echo "$ac_cv_header_time" >&6; } +if test $ac_cv_header_time = yes; then + +$as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h + +fi + + +## Unix +for ac_header in sys/resource.h sys/time.h unistd.h sys/ioctl.h sys/stat.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + fi - fi +done + +for ac_header in sys/socket.h sys/types.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 -$as_echo "$ac_cv_c_bigendian" >&6; } - case $ac_cv_c_bigendian in #( - yes) - $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h -;; #( - no) - ;; #( - universal) -$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h +done - ;; #( - *) - as_fn_error $? "unknown endianness - presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; - esac +for ac_header in stddef.h setjmp.h features.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF -# The cast to long int works around a bug in the HP C Compiler -# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. -# This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of char" >&5 -$as_echo_n "checking size of char... " >&6; } -if ${ac_cv_sizeof_char+:} false; then : - $as_echo_n "(cached) " >&6 -else - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (char))" "ac_cv_sizeof_char" "$ac_includes_default"; then : +fi + +done + +for ac_header in dirent.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "dirent.h" "ac_cv_header_dirent_h" "$ac_includes_default" +if test "x$ac_cv_header_dirent_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_DIRENT_H 1 +_ACEOF -else - if test "$ac_cv_type_char" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error 77 "cannot compute sizeof (char) -See \`config.log' for more details" "$LINENO" 5; } - else - ac_cv_sizeof_char=0 - fi fi +done + +for ac_header in stdint.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "stdint.h" "ac_cv_header_stdint_h" "$ac_includes_default" +if test "x$ac_cv_header_stdint_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_STDINT_H 1 +_ACEOF + C9x=yes fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_char" >&5 -$as_echo "$ac_cv_sizeof_char" >&6; } +done -cat >>confdefs.h <<_ACEOF -#define SIZEOF_CHAR $ac_cv_sizeof_char +## Darwin +for ac_header in mach/mach_time.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "mach/mach_time.h" "ac_cv_header_mach_mach_time_h" "$ac_includes_default" +if test "x$ac_cv_header_mach_mach_time_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_MACH_MACH_TIME_H 1 _ACEOF +fi -# The cast to long int works around a bug in the HP C Compiler -# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. -# This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of short" >&5 -$as_echo_n "checking size of short... " >&6; } -if ${ac_cv_sizeof_short+:} false; then : - $as_echo_n "(cached) " >&6 -else - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (short))" "ac_cv_sizeof_short" "$ac_includes_default"; then : +done -else - if test "$ac_cv_type_short" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error 77 "cannot compute sizeof (short) -See \`config.log' for more details" "$LINENO" 5; } - else - ac_cv_sizeof_short=0 - fi -fi +## Also need to detect Darwin for pubconf +case $host_os in + darwin*) -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_short" >&5 -$as_echo "$ac_cv_sizeof_short" >&6; } +$as_echo "#define HAVE_DARWIN 1" >>confdefs.h + + ;; +esac + +## Windows +case "`uname`" in + CYGWIN*) + for ac_header in io.h sys/timeb.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF +fi +done -cat >>confdefs.h <<_ACEOF -#define SIZEOF_SHORT $ac_cv_sizeof_short + ;; + MINGW*) + for ac_header in io.h winsock2.h sys/timeb.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF +fi -# The cast to long int works around a bug in the HP C Compiler -# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. -# This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of int" >&5 -$as_echo_n "checking size of int... " >&6; } -if ${ac_cv_sizeof_int+:} false; then : +done + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lws2_32" >&5 +$as_echo_n "checking for main in -lws2_32... " >&6; } +if ${ac_cv_lib_ws2_32_main+:} false; then : $as_echo_n "(cached) " >&6 else - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (int))" "ac_cv_sizeof_int" "$ac_includes_default"; then : + ac_check_lib_save_LIBS=$LIBS +LIBS="-lws2_32 $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#ifdef FC_DUMMY_MAIN +#ifndef FC_DUMMY_MAIN_EQ_F77 +# ifdef __cplusplus + extern "C" +# endif + int FC_DUMMY_MAIN() { return 1; } +#endif +#endif +int +main () +{ +return main (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_ws2_32_main=yes else - if test "$ac_cv_type_int" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error 77 "cannot compute sizeof (int) -See \`config.log' for more details" "$LINENO" 5; } - else - ac_cv_sizeof_int=0 - fi + ac_cv_lib_ws2_32_main=no fi - +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_int" >&5 -$as_echo "$ac_cv_sizeof_int" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ws2_32_main" >&5 +$as_echo "$ac_cv_lib_ws2_32_main" >&6; } +if test "x$ac_cv_lib_ws2_32_main" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBWS2_32 1 +_ACEOF + LIBS="-lws2_32 $LIBS" +fi +ac_cv_lib_ws2_32=ac_cv_lib_ws2_32_main -cat >>confdefs.h <<_ACEOF -#define SIZEOF_INT $ac_cv_sizeof_int + ;; + *) + for ac_header in io.h winsock2.h sys/timeb.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF +fi -# The cast to long int works around a bug in the HP C Compiler -# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. -# This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of unsigned" >&5 -$as_echo_n "checking size of unsigned... " >&6; } -if ${ac_cv_sizeof_unsigned+:} false; then : - $as_echo_n "(cached) " >&6 -else - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (unsigned))" "ac_cv_sizeof_unsigned" "$ac_includes_default"; then : +done -else - if test "$ac_cv_type_unsigned" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error 77 "cannot compute sizeof (unsigned) -See \`config.log' for more details" "$LINENO" 5; } - else - ac_cv_sizeof_unsigned=0 - fi -fi + ;; +esac + +case "$host" in + alpha*-dec*-osf*) + ## The and are needed on the DEC + ## Alpha to turn off UAC fixing. We do *not* attempt to + ## locate these files on other systems because there are too + ## many problems with including them. + for ac_header in sys/sysinfo.h sys/proc.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_unsigned" >&5 -$as_echo "$ac_cv_sizeof_unsigned" >&6; } - +done -cat >>confdefs.h <<_ACEOF -#define SIZEOF_UNSIGNED $ac_cv_sizeof_unsigned + ;; + mips*-sgi*) + ## The is needed on the SGI machines to turn off + ## denormalized floating-point values going to zero. We do *not* + ## attempt to locate these files on other systems because there + ## may be problems with including them. + for ac_header in sys/fpu.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "sys/fpu.h" "ac_cv_header_sys_fpu_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_fpu_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SYS_FPU_H 1 _ACEOF +fi -# The cast to long int works around a bug in the HP C Compiler -# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. -# This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long" >&5 -$as_echo_n "checking size of long... " >&6; } -if ${ac_cv_sizeof_long+:} false; then : - $as_echo_n "(cached) " >&6 -else - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long" "$ac_includes_default"; then : +done -else - if test "$ac_cv_type_long" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error 77 "cannot compute sizeof (long) -See \`config.log' for more details" "$LINENO" 5; } - else - ac_cv_sizeof_long=0 - fi -fi + for ac_func in get_fpc_csr +do : + ac_fn_c_check_func "$LINENO" "get_fpc_csr" "ac_cv_func_get_fpc_csr" +if test "x$ac_cv_func_get_fpc_csr" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_GET_FPC_CSR 1 +_ACEOF fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long" >&5 -$as_echo "$ac_cv_sizeof_long" >&6; } - +done + ;; +esac -cat >>confdefs.h <<_ACEOF -#define SIZEOF_LONG $ac_cv_sizeof_long -_ACEOF +## ---------------------------------------------------------------------- +## Some platforms require that all symbols are resolved when a library +## is linked. We can use the -no-undefined flag to tell libtool that +## it will be able to build shared libraries on these architectures, +## as it will not do so by default. +## +if test "X${enable_shared}" = "Xyes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool needs -no-undefined flag to build shared libraries" >&5 +$as_echo_n "checking if libtool needs -no-undefined flag to build shared libraries... " >&6; } + case "`uname`" in + CYGWIN*|MINGW*|AIX*) + ## Add in the -no-undefined flag to LDFLAGS for libtool. + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + H5_LDFLAGS="$H5_LDFLAGS -no-undefined" + ;; + *) + ## Don't add in anything. + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + ;; + esac +fi +## ---------------------------------------------------------------------- +## Use the macro _AC_SYS_LARGEFILE_MACRO_VALUE to test defines +## that might need to be set for largefile support to behave +## correctly. This macro is defined in acsite.m4 and overrides +## the version provided by Autoconf (as of v2.65). The custom +## macro additionally adds the appropriate defines to AM_CPPFLAGS +## so that later configure checks have them visible. -# The cast to long int works around a bug in the HP C Compiler -# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. -# This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long long" >&5 -$as_echo_n "checking size of long long... " >&6; } -if ${ac_cv_sizeof_long_long+:} false; then : +## Check for _FILE_OFFSET_BITS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5 +$as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; } +if ${ac_cv_sys_file_offset_bits+:} false; then : $as_echo_n "(cached) " >&6 else - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long long))" "ac_cv_sizeof_long_long" "$ac_includes_default"; then : + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +#ifdef FC_DUMMY_MAIN +#ifndef FC_DUMMY_MAIN_EQ_F77 +# ifdef __cplusplus + extern "C" +# endif + int FC_DUMMY_MAIN() { return 1; } +#endif +#endif +int +main () +{ -else - if test "$ac_cv_type_long_long" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error 77 "cannot compute sizeof (long long) -See \`config.log' for more details" "$LINENO" 5; } - else - ac_cv_sizeof_long_long=0 - fi + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_sys_file_offset_bits=no; break fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#define _FILE_OFFSET_BITS 64 +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +#ifdef FC_DUMMY_MAIN +#ifndef FC_DUMMY_MAIN_EQ_F77 +# ifdef __cplusplus + extern "C" +# endif + int FC_DUMMY_MAIN() { return 1; } +#endif +#endif +int +main () +{ + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_sys_file_offset_bits=64; break fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long_long" >&5 -$as_echo "$ac_cv_sizeof_long_long" >&6; } - - - +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cv_sys_file_offset_bits=unknown + break +done +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5 +$as_echo "$ac_cv_sys_file_offset_bits" >&6; } +case $ac_cv_sys_file_offset_bits in #( + no | unknown) ;; + *) cat >>confdefs.h <<_ACEOF -#define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long +#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits _ACEOF + AM_CPPFLAGS="-D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits $AM_CPPFLAGS";; +esac +rm -rf conftest* -# The cast to long int works around a bug in the HP C Compiler -# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. -# This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of __int64" >&5 -$as_echo_n "checking size of __int64... " >&6; } -if ${ac_cv_sizeof___int64+:} false; then : +## Check for _LARGE_FILES +if test "$ac_cv_sys_file_offset_bits" = unknown; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5 +$as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; } +if ${ac_cv_sys_large_files+:} false; then : $as_echo_n "(cached) " >&6 else - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (__int64))" "ac_cv_sizeof___int64" "$ac_includes_default"; then : + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +#ifdef FC_DUMMY_MAIN +#ifndef FC_DUMMY_MAIN_EQ_F77 +# ifdef __cplusplus + extern "C" +# endif + int FC_DUMMY_MAIN() { return 1; } +#endif +#endif +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_sys_large_files=no; break +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#define _LARGE_FILES 1 +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +#ifdef FC_DUMMY_MAIN +#ifndef FC_DUMMY_MAIN_EQ_F77 +# ifdef __cplusplus + extern "C" +# endif + int FC_DUMMY_MAIN() { return 1; } +#endif +#endif +int +main () +{ -else - if test "$ac_cv_type___int64" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error 77 "cannot compute sizeof (__int64) -See \`config.log' for more details" "$LINENO" 5; } - else - ac_cv_sizeof___int64=0 - fi + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_sys_large_files=1; break fi - +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cv_sys_large_files=unknown + break +done fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof___int64" >&5 -$as_echo "$ac_cv_sizeof___int64" >&6; } - - - +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5 +$as_echo "$ac_cv_sys_large_files" >&6; } +case $ac_cv_sys_large_files in #( + no | unknown) ;; + *) cat >>confdefs.h <<_ACEOF -#define SIZEOF___INT64 $ac_cv_sizeof___int64 +#define _LARGE_FILES $ac_cv_sys_large_files _ACEOF - -# The cast to long int works around a bug in the HP C Compiler -# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. -# This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of float" >&5 -$as_echo_n "checking size of float... " >&6; } -if ${ac_cv_sizeof_float+:} false; then : - $as_echo_n "(cached) " >&6 -else - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (float))" "ac_cv_sizeof_float" "$ac_includes_default"; then : - -else - if test "$ac_cv_type_float" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error 77 "cannot compute sizeof (float) -See \`config.log' for more details" "$LINENO" 5; } - else - ac_cv_sizeof_float=0 - fi -fi - + AM_CPPFLAGS="-D_LARGE_FILES=$ac_cv_sys_large_files $AM_CPPFLAGS";; +esac +rm -rf conftest* fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_float" >&5 -$as_echo "$ac_cv_sizeof_float" >&6; } - - - -cat >>confdefs.h <<_ACEOF -#define SIZEOF_FLOAT $ac_cv_sizeof_float -_ACEOF +## ---------------------------------------------------------------------- +## Add necessary defines for Linux Systems. +## +case "$host_cpu-$host_vendor-$host_os" in + *linux*) + ## Make available various LFS-related routines using the following + ## _LARGEFILE*_SOURCE macros. + AM_CPPFLAGS="-D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE $AM_CPPFLAGS" -# The cast to long int works around a bug in the HP C Compiler -# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. -# This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of double" >&5 -$as_echo_n "checking size of double... " >&6; } -if ${ac_cv_sizeof_double+:} false; then : - $as_echo_n "(cached) " >&6 -else - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (double))" "ac_cv_sizeof_double" "$ac_includes_default"; then : + ## Add POSIX support on Linux systems, so defines + ## __USE_POSIX, which is required to get the prototype for fdopen + ## defined correctly in . + ## + ## This flag was removed from h5cc as of 2009-10-17 when it was found + ## that the flag broke compiling netCDF-4 code with h5cc, but kept in + ## H5_CPPFLAGS because fdopen and HDfdopen fail without it. HDfdopen + ## is used only by H5_debug_mask which is used only when debugging in + ## H5_init_library (all in H5.c). When the flag was removed this was + ## the only compile failure noted. + ## + ## This was originally defined as _POSIX_SOURCE which was updated to + ## _POSIX_C_SOURCE=199506L to expose a greater amount of POSIX + ## functionality so clock_gettime and CLOCK_MONOTONIC are defined + ## correctly. This was later updated to 200112L so that + ## posix_memalign() is visible for the direct VFD code on Linux + ## systems. + ## + ## POSIX feature information can be found in the gcc manual at: + ## http://www.gnu.org/s/libc/manual/html_node/Feature-Test-Macros.html +##SCOT H5_CPPFLAGS="-D_POSIX_C_SOURCE=200112L $H5_CPPFLAGS" -else - if test "$ac_cv_type_double" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error 77 "cannot compute sizeof (double) -See \`config.log' for more details" "$LINENO" 5; } - else - ac_cv_sizeof_double=0 - fi -fi + ## Need to add this so that O_DIRECT is visible for the direct + ## VFD on Linux systems. + H5_CPPFLAGS="-D_GNU_SOURCE $H5_CPPFLAGS" -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_double" >&5 -$as_echo "$ac_cv_sizeof_double" >&6; } + ## Also add BSD support on Linux systems, so defines + ## __USE_BSD, which is required to get the prototype for strdup + ## defined correctly in and snprintf & vsnprintf defined + ## correctly in + ## Linking to the bsd-compat library is required as per the gcc manual: + ## http://www.gnu.org/s/libc/manual/html_node/Feature-Test-Macros.html + ## however, we do not do this since it breaks the big test on some + ## older platforms. + H5_CPPFLAGS="-D_BSD_SOURCE $H5_CPPFLAGS" + ## _BSD_SOURCE is deprecated as of glibc 2.20, in favor of _DEFAULT_SOURCE. + ## To avoid warnings, we define _DEFAULT_SOURCE in addition to _BSD_SOURCE, + ## which should work for all versions of glibc. + H5_CPPFLAGS="-D_DEFAULT_SOURCE $H5_CPPFLAGS" + ;; +esac +## Need to add the AM_ and H5_ into CFLAGS/CPPFLAGS to make them visible +## for configure checks. +## Note: Both will be restored by the end of configure. +CPPFLAGS="$H5_CPPFLAGS $AM_CPPFLAGS $CPPFLAGS" +CFLAGS="$H5_CFLAGS $AM_CFLAGS $CFLAGS" -cat >>confdefs.h <<_ACEOF -#define SIZEOF_DOUBLE $ac_cv_sizeof_double +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#ifdef FC_DUMMY_MAIN +#ifndef FC_DUMMY_MAIN_EQ_F77 +# ifdef __cplusplus + extern "C" +# endif + int FC_DUMMY_MAIN() { return 1; } +#endif +#endif +int +main () +{ +off64_t n = 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + for ac_func in lseek64 fseeko64 ftello64 ftruncate64 +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF - -# The cast to long int works around a bug in the HP C Compiler -# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. -# This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long double" >&5 -$as_echo_n "checking size of long double... " >&6; } -if ${ac_cv_sizeof_long_double+:} false; then : - $as_echo_n "(cached) " >&6 -else - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long double))" "ac_cv_sizeof_long_double" "$ac_includes_default"; then : +fi +done else - if test "$ac_cv_type_long_double" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error 77 "cannot compute sizeof (long double) -See \`config.log' for more details" "$LINENO" 5; } - else - ac_cv_sizeof_long_double=0 - fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: skipping test for lseek64(), fseeko64 , ftello64, ftruncate64() because off64_t is not defined" >&5 +$as_echo "skipping test for lseek64(), fseeko64 , ftello64, ftruncate64() because off64_t is not defined" >&6; } fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +for ac_func in fseeko ftello +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long_double" >&5 -$as_echo "$ac_cv_sizeof_long_double" >&6; } - +done +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -cat >>confdefs.h <<_ACEOF -#define SIZEOF_LONG_DOUBLE $ac_cv_sizeof_long_double +#include +#include +#ifdef FC_DUMMY_MAIN +#ifndef FC_DUMMY_MAIN_EQ_F77 +# ifdef __cplusplus + extern "C" +# endif + int FC_DUMMY_MAIN() { return 1; } +#endif +#endif +int +main () +{ +struct stat64 sb; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + for ac_func in stat64 fstat64 +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF +fi +done +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: skipping test for stat64() and fstat64()" >&5 +$as_echo "skipping test for stat64() and fstat64()" >&6; } +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ## Checkpoint the cache cat >confcache <<\_ACEOF @@ -26528,13 +27236,13 @@ all_packages="ac,b,b2,d,e,f,g,hg,hl,i,mf,mm,o,p,s,t,v,z" case "X-$DEBUG_PKG" in X-yes) DEBUG_PKG="d,e,f,g,hg,i,mm,o,p,s,t,v,z" - H5_CPPFLAGS="$H5_CPPFLAGS -UNDEBUG" +## H5_CPPFLAGS="$H5_CPPFLAGS -UNDEBUG" { $as_echo "$as_me:${as_lineno-$LINENO}: result: default ($DEBUG_PKG)" >&5 $as_echo "default ($DEBUG_PKG)" >&6; } ;; X-all) DEBUG_PKG=$all_packages - H5_CPPFLAGS="$H5_CPPFLAGS -UNDEBUG" +## H5_CPPFLAGS="$H5_CPPFLAGS -UNDEBUG" { $as_echo "$as_me:${as_lineno-$LINENO}: result: all ($DEBUG_PKG)" >&5 $as_echo "all ($DEBUG_PKG)" >&6; } ;; @@ -26542,7 +27250,7 @@ $as_echo "all ($DEBUG_PKG)" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 $as_echo "none" >&6; } DEBUG_PKG= - H5_CPPFLAGS="$H5_CPPFLAGS -DNDEBUG" +## H5_CPPFLAGS="$H5_CPPFLAGS -DNDEBUG" ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DEBUG_PKG" >&5 @@ -30317,7 +31025,7 @@ else fi -ac_config_files="$ac_config_files src/libhdf5.settings Makefile src/Makefile test/Makefile test/testcheck_version.sh test/testerror.sh test/H5srcdir_str.h test/testlibinfo.sh test/testlinks_env.sh test/test_plugin.sh testpar/Makefile tools/Makefile tools/h5dump/Makefile tools/h5dump/testh5dump.sh tools/h5dump/testh5dumppbits.sh tools/h5dump/testh5dumpxml.sh tools/h5ls/testh5ls.sh tools/h5import/Makefile tools/h5import/h5importtestutil.sh tools/h5diff/Makefile tools/h5diff/testh5diff.sh tools/h5diff/testph5diff.sh tools/h5jam/Makefile tools/h5jam/testh5jam.sh tools/h5repack/Makefile tools/h5repack/h5repack.sh tools/h5repack/h5repack_plugin.sh tools/h5ls/Makefile tools/h5copy/Makefile tools/h5copy/testh5copy.sh tools/lib/Makefile tools/misc/Makefile tools/misc/h5cc tools/misc/testh5mkgrp.sh tools/misc/testh5repart.sh tools/h5stat/testh5stat.sh tools/h5stat/Makefile tools/perform/Makefile examples/Makefile examples/run-c-ex.sh examples/testh5cc.sh c++/Makefile c++/src/Makefile c++/src/h5c++ c++/test/Makefile c++/test/H5srcdir_str.h c++/examples/Makefile c++/examples/run-c++-ex.sh c++/examples/testh5c++.sh fortran/Makefile fortran/src/h5fc fortran/src/Makefile fortran/test/Makefile fortran/testpar/Makefile fortran/examples/Makefile fortran/examples/run-fortran-ex.sh fortran/examples/testh5fc.sh hl/Makefile hl/src/Makefile hl/test/Makefile hl/test/H5srcdir_str.h hl/tools/Makefile hl/tools/gif2h5/Makefile hl/tools/gif2h5/h52giftest.sh hl/examples/Makefile hl/examples/run-hlc-ex.sh hl/c++/Makefile hl/c++/src/Makefile hl/c++/test/Makefile hl/c++/examples/Makefile hl/c++/examples/run-hlc++-ex.sh hl/fortran/Makefile hl/fortran/src/Makefile hl/fortran/test/Makefile hl/fortran/examples/Makefile hl/fortran/examples/run-hlfortran-ex.sh" +ac_config_files="$ac_config_files src/libhdf5.settings Makefile src/Makefile test/Makefile test/testcheck_version.sh test/testerror.sh test/H5srcdir_str.h test/testlibinfo.sh test/testlinks_env.sh test/test_plugin.sh testpar/Makefile tools/Makefile tools/h5dump/Makefile tools/h5dump/testh5dump.sh tools/h5dump/testh5dumppbits.sh tools/h5dump/testh5dumpxml.sh tools/h5ls/testh5ls.sh tools/h5import/Makefile tools/h5import/h5importtestutil.sh tools/h5diff/Makefile tools/h5diff/testh5diff.sh tools/h5diff/testph5diff.sh tools/h5jam/Makefile tools/h5jam/testh5jam.sh tools/h5repack/Makefile tools/h5repack/h5repack.sh tools/h5repack/h5repack_plugin.sh tools/h5ls/Makefile tools/h5copy/Makefile tools/h5copy/testh5copy.sh tools/lib/Makefile tools/misc/Makefile tools/misc/h5cc tools/misc/testh5mkgrp.sh tools/misc/testh5repart.sh tools/h5stat/testh5stat.sh tools/h5stat/Makefile tools/perform/Makefile examples/Makefile examples/run-c-ex.sh examples/testh5cc.sh c++/Makefile c++/src/Makefile c++/src/h5c++ c++/test/Makefile c++/test/H5srcdir_str.h c++/examples/Makefile c++/examples/run-c++-ex.sh c++/examples/testh5c++.sh fortran/Makefile fortran/src/h5fc fortran/src/Makefile fortran/src/H5fort_type_defines.h fortran/test/Makefile fortran/testpar/Makefile fortran/examples/Makefile fortran/examples/run-fortran-ex.sh fortran/examples/testh5fc.sh hl/Makefile hl/src/Makefile hl/test/Makefile hl/test/H5srcdir_str.h hl/tools/Makefile hl/tools/gif2h5/Makefile hl/tools/gif2h5/h52giftest.sh hl/examples/Makefile hl/examples/run-hlc-ex.sh hl/c++/Makefile hl/c++/src/Makefile hl/c++/test/Makefile hl/c++/examples/Makefile hl/c++/examples/run-hlc++-ex.sh hl/fortran/Makefile hl/fortran/src/Makefile hl/fortran/test/Makefile hl/fortran/examples/Makefile hl/fortran/examples/run-hlfortran-ex.sh" cat >confcache <<\_ACEOF @@ -30457,26 +31165,7 @@ if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${FORTRAN_HAVE_SIZEOF_TRUE}" && test -z "${FORTRAN_HAVE_SIZEOF_FALSE}"; then - as_fn_error $? "conditional \"FORTRAN_HAVE_SIZEOF\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${FORTRAN_HAVE_C_SIZEOF_TRUE}" && test -z "${FORTRAN_HAVE_C_SIZEOF_FALSE}"; then - as_fn_error $? "conditional \"FORTRAN_HAVE_C_SIZEOF\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${FORTRAN_HAVE_STORAGE_SIZE_TRUE}" && test -z "${FORTRAN_HAVE_STORAGE_SIZE_FALSE}"; then - as_fn_error $? "conditional \"FORTRAN_HAVE_STORAGE_SIZE\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${FORTRAN_2003_CONDITIONAL_F_TRUE}" && test -z "${FORTRAN_2003_CONDITIONAL_F_FALSE}"; then - as_fn_error $? "conditional \"FORTRAN_2003_CONDITIONAL_F\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${FORTRAN_DEFAULT_REALisDBLE_F_TRUE}" && test -z "${FORTRAN_DEFAULT_REALisDBLE_F_FALSE}"; then - as_fn_error $? "conditional \"FORTRAN_DEFAULT_REALisDBLE_F\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi + if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -30489,7 +31178,6 @@ if test -z "${USE_PLUGINS_CONDITIONAL_TRUE}" && test -z "${USE_PLUGINS_CONDITION as_fn_error $? "conditional \"USE_PLUGINS_CONDITIONAL\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi - if test -z "${BUILD_SHARED_SZIP_CONDITIONAL_TRUE}" && test -z "${BUILD_SHARED_SZIP_CONDITIONAL_FALSE}"; then as_fn_error $? "conditional \"BUILD_SHARED_SZIP_CONDITIONAL\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -31579,6 +32267,7 @@ do "src/H5config.h") CONFIG_HEADERS="$CONFIG_HEADERS src/H5config.h" ;; "pubconf") CONFIG_COMMANDS="$CONFIG_COMMANDS pubconf" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "fortran/src/H5config_f.inc") CONFIG_HEADERS="$CONFIG_HEADERS fortran/src/H5config_f.inc" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "src/libhdf5.settings") CONFIG_FILES="$CONFIG_FILES src/libhdf5.settings" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; @@ -31632,6 +32321,7 @@ do "fortran/Makefile") CONFIG_FILES="$CONFIG_FILES fortran/Makefile" ;; "fortran/src/h5fc") CONFIG_FILES="$CONFIG_FILES fortran/src/h5fc" ;; "fortran/src/Makefile") CONFIG_FILES="$CONFIG_FILES fortran/src/Makefile" ;; + "fortran/src/H5fort_type_defines.h") CONFIG_FILES="$CONFIG_FILES fortran/src/H5fort_type_defines.h" ;; "fortran/test/Makefile") CONFIG_FILES="$CONFIG_FILES fortran/test/Makefile" ;; "fortran/testpar/Makefile") CONFIG_FILES="$CONFIG_FILES fortran/testpar/Makefile" ;; "fortran/examples/Makefile") CONFIG_FILES="$CONFIG_FILES fortran/examples/Makefile" ;; @@ -32361,6 +33051,7 @@ $as_echo X"$file" | done } ;; + "fortran/src/H5config_f.inc":H) cat fortran/src/H5config_f.inc | sed '1d;s%^/\* \(.*\) \*/%\1%;s/#define /#define H5_/;s/#undef /#undef H5_/' >fortran/src/H5config_f.inc.tmp; mv -f fortran/src/H5config_f.inc.tmp fortran/src/H5config_f.inc ;; "libtool":C) # See if we are running on zsh, and set the options which allow our diff --git a/configure.ac b/configure.ac index 1e67f39..c37a1c4 100644 --- a/configure.ac +++ b/configure.ac @@ -27,6 +27,17 @@ AC_PREREQ([2.69]) ## release!!! ## AC_INIT([HDF5], [1.9.227], [help@hdfgroup.org]) + +## PLACE CHECKS FOR REQUIRED PACKAGES NEEDED TO INSTALL HDF5 AT THE BEGINNING +## -------------------------------------------------------------------------- +## Requirement #1: Check if Perl is installed. +## +AC_SUBST([PERL]) PERL="" +AC_CHECK_PROG([PERL], [perl],, [$PATH]) +if test "x$PERL" = "xfalse"; then + AC_MSG_ERROR([*** Perl is required for installing HDF5, but Perl could not be found!]) +fi + AC_CONFIG_SRCDIR([src/H5.c]) AC_CONFIG_HEADER([src/H5config.h]) @@ -149,7 +160,6 @@ AC_MSG_RESULT([done]) ## MPE: whether MPE option is enabled. Default no. ## STATIC_EXEC: whether static-exec is enabled. Default no. ## HDF_FORTRAN: whether Fortran is enabled. Default no. -## HDF_FORTRAN2003: whether Fortran 2003 is enabled. Default no. ## FC: Fortran compiler. ## HDF_CXX: whether C++ is enabled. Default no. ## CXX: C++ compiler. @@ -157,6 +167,7 @@ AC_MSG_RESULT([done]) ## INSTRUMENT: whether INSTRUMENT is enabled. No default set here. ## CODESTACK: whether CODESTACK is enabled. Default no. ## HAVE_DMALLOC: whether system has dmalloc support. Default no. +## HAVE_FLOAT128: whether system has Quad-Precision Math Library. Default no. ## DIRECT_VFD: whether DIRECT_VFD is enabled. Default no. ## THREADSAFE: whether THREADSAFE is enabled. Default no. ## STATIC_SHARED: whether static and/or shared libraries are requested. @@ -168,9 +179,7 @@ AC_SUBST([EXTERNAL_FILTERS]) AC_SUBST([MPE]) MPE=no AC_SUBST([STATIC_EXEC]) STATIC_EXEC=no AC_SUBST([HDF_FORTRAN]) HDF_FORTRAN=no -AC_SUBST([HDF_FORTRAN2003]) HDF_FORTRAN2003=no AC_SUBST([FC]) HDF_FORTRAN=no -AC_SUBST([FC2003]) HDF_FORTRAN2003=no AC_SUBST([HDF_CXX]) HDF_CXX=no AC_SUBST([CXX]) HDF_CXX=no AC_SUBST([HDF5_HL]) HDF5_HL=yes @@ -183,6 +192,7 @@ AC_SUBST([STATIC_SHARED]) AC_SUBST([enable_shared]) AC_SUBST([enable_static]) AC_SUBST([UNAME_INFO]) UNAME_INFO=`uname -a` +AC_SUBST([PAC_C_MAX_REAL_PRECISION]) ## ---------------------------------------------------------------------- ## Some platforms have broken basename, and/or xargs programs. Check @@ -347,13 +357,57 @@ case "X-$ALLOW_UNSUPPORTED" in esac ## ---------------------------------------------------------------------- +## Data types and their sizes. +## +AC_TYPE_OFF_T +AC_CHECK_TYPE([size_t], [], + [AC_DEFINE_UNQUOTED([size_t], [unsigned long], + [Define to `unsigned long' if does not define.])]) +AC_CHECK_TYPE([ssize_t], [], + [AC_DEFINE_UNQUOTED([ssize_t], [long], + [Define to `long' if does not define.])]) +AC_CHECK_TYPE([ptrdiff_t], [], + [AC_DEFINE_UNQUOTED([ptrdiff_t], [long], + [Define to `long' if does not define.])]) +AC_C_BIGENDIAN +AC_CHECK_SIZEOF([char], [1]) +AC_CHECK_SIZEOF([short], [2]) +AC_CHECK_SIZEOF([int], [4]) +AC_CHECK_SIZEOF([unsigned], [4]) +AC_CHECK_SIZEOF([long], [4]) +AC_CHECK_SIZEOF([long long], [8]) +AC_CHECK_SIZEOF([__int64], [8]) +AC_CHECK_SIZEOF([float], [4]) +AC_CHECK_SIZEOF([double], [8]) +AC_CHECK_SIZEOF([long double], [8]) + +## Check for non-standard extenstion __FLOAT128 +HAVE_FLOAT128=0 +HAVE_QUADMATH=0 +FLT128_DIG=0 +LDBL_DIG=0 + +AC_CHECK_SIZEOF([__float128]) +AC_CHECK_SIZEOF([_Quad]) +AC_CHECK_HEADERS([quadmath.h], [HAVE_QUADMATH=1], []) +PAC_FC_LDBL_DIG + +if test "$ac_cv_sizeof___float128" != 0 && test "$FLT128_DIG" != 0 ; then + AC_DEFINE([HAVE_FLOAT128], [1], [Determine if __float128 is available]) + PAC_C_MAX_REAL_PRECISION=$FLT128_DIG +else + PAC_C_MAX_REAL_PRECISION=$LDBL_DIG +fi +AC_DEFINE_UNQUOTED([PAC_C_MAX_REAL_PRECISION], $PAC_C_MAX_REAL_PRECISION, [Determine the maximum decimal precision in C]) +AC_MSG_RESULT([$PAC_C_MAX_REAL_PRECISION]) +## ---------------------------------------------------------------------- ## Check if they would like the Fortran interface compiled ## AC_SUBST([HDF5_INTERFACES]) HDF5_INTERFACES="" AC_MSG_CHECKING([if Fortran interface enabled]) AC_ARG_ENABLE([fortran], [AS_HELP_STRING([--enable-fortran], - [Compile the Fortran 90/95 interface [default=no]])], + [Compile the Fortran interface [default=no]])], [HDF_FORTRAN=$enableval]) if test "X$HDF_FORTRAN" = "Xyes"; then @@ -362,35 +416,16 @@ else echo "no" fi - -## ---------------------------------------------------------------------- -## Check if they would like the Fortran 2003 interface compiled -## -AC_MSG_CHECKING([if Fortran 2003 interface enabled]) -AC_ARG_ENABLE([fortran2003], - [AS_HELP_STRING([--enable-fortran2003], - [Compile the Fortran 2003 interface, must also specify --enable-fortran [default=no]])], - [HDF_FORTRAN2003=$enableval]) - -## ---------------------------------------------------------------------- -## Check to make sure --enable-fortran is present if --enable-fortran2003 -## was specified - -if test "X$HDF_FORTRAN2003" = "Xyes" && test "X$HDF_FORTRAN" = "Xno"; then - echo "no" - AC_MSG_ERROR([--enable-fortran must be used with --enable-fortran2003]) -else - if test "X$HDF_FORTRAN2003" = "Xyes" && test "X$HDF_FORTRAN" = "Xyes"; then - echo "yes" - else - echo "no" - fi -fi - if test "X$HDF_FORTRAN" = "Xyes"; then +## We will output an include file for Fortran, H5config_f.inc which +## contains various configure definitions used by the Fortran Library. +## Prepend H5_ to all macro names. This avoids name conflict between HDF5 macro +## names and those generated by another software package that uses the HDF5 library. + AC_CONFIG_HEADERS([fortran/src/H5config_f.inc], + [cat fortran/src/H5config_f.inc | sed '1d;s%^/\* \(.*\) \*/%\1%;s/#define /#define H5_/;s/#undef /#undef H5_/' >fortran/src/H5config_f.inc.tmp; mv -f fortran/src/H5config_f.inc.tmp fortran/src/H5config_f.inc]) + AC_SUBST([FC]) HDF_FORTRAN=yes - AC_SUBST([HAVE_FORTRAN_2003]) HDF5_INTERFACES="$HDF5_INTERFACES fortran" @@ -423,6 +458,14 @@ if test "X$HDF_FORTRAN" = "Xyes"; then ## Change to the Fortran 90 language AC_LANG_PUSH(Fortran) + ## Checking if the compiler supports the required Fortran 2003 features and + ## stopping if it does not. + PAC_PROG_FC_HAVE_F2003_REQUIREMENTS + + if test "X$HAVE_F2003_REQUIREMENTS" = "Xno"; then + AC_MSG_ERROR([Fortran compiler lacks required Fortran 2003 features; unsupported Fortran 2003 compiler, remove --enable-fortran]) + fi + ## -------------------------------------------------------------------- ## Define wrappers for the C compiler to use Fortran function names ## @@ -434,39 +477,138 @@ if test "X$HDF_FORTRAN" = "Xyes"; then ## See if the fortran compiler supports the intrinsic function "C_SIZEOF" PAC_PROG_FC_C_SIZEOF - + ## See if the fortran compiler supports the intrinsic function "STORAGE_SIZE" - PAC_PROG_FC_STORAGE_SIZE + PAC_PROG_FC_STORAGE_SIZE + + ## Set the sizeof function for use later in the fortran tests + if test "X$HAVE_STORAGE_SIZE_FORTRAN" = "Xyes";then + FC_SIZEOF_A="STORAGE_SIZE(a, c_size_t)/STORAGE_SIZE(c_char_'a',c_size_t)" + FC_SIZEOF_B="STORAGE_SIZE(b, c_size_t)/STORAGE_SIZE(c_char_'a',c_size_t)" + FC_SIZEOF_C="STORAGE_SIZE(c, c_size_t)/STORAGE_SIZE(c_char_'a',c_size_t)" + else + if test "X$HAVE_SIZEOF_FORTRAN" = "Xyes";then + FC_SIZEOF_A="SIZEOF(a)" + FC_SIZEOF_B="SIZEOF(b)" + FC_SIZEOF_C="SIZEOF(c)" + else + ## If neither intrinsic functions SIZEOF or STORAGE_SIZE is available then stop configure with an error + AC_MSG_ERROR([Fortran compiler requires either intrinsic functions SIZEOF or STORAGE_SIZE]) + fi + fi - ## Check to see if -r8 was specified to determine if we need to - ## compile the DOUBLE PRECISION interfaces. - PAC_PROG_FC_DEFAULT_REALisDBLE + ## See if the fortran compiler supports the intrinsic module "ISO_FORTRAN_ENV" + PAC_PROG_FC_ISO_FORTRAN_ENV + ## Check KIND and size of native integer + PAC_FC_NATIVE_INTEGER + + ## Find all available KINDs + PAC_FC_AVAIL_KINDS + ## Find all sizeofs for available KINDs + PAC_FC_SIZEOF_INT_KINDS + PAC_FC_SIZEOF_REAL_KINDS + + AC_SUBST([PAC_FC_ALL_REAL_KINDS]) + AC_SUBST([PAC_FC_MAX_REAL_PRECISION]) + AC_SUBST([PAC_FC_ALL_INTEGER_KINDS]) + AC_SUBST([PAC_FC_ALL_REAL_KINDS_SIZEOF]) + AC_SUBST([PAC_FC_ALL_INTEGER_KINDS_SIZEOF]) + AC_SUBST([PAC_FORTRAN_NATIVE_INTEGER_KIND]) + AC_SUBST([PAC_FORTRAN_NATIVE_INTEGER_SIZEOF]) + AC_SUBST([PAC_FORTRAN_NATIVE_REAL_KIND]) + AC_SUBST([PAC_FORTRAN_NATIVE_REAL_SIZEOF]) + AC_SUBST([PAC_FORTRAN_NATIVE_DOUBLE_KIND]) + AC_SUBST([PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF]) + AC_SUBST([HAVE_Fortran_INTEGER_SIZEOF_16]) + AC_SUBST([FORTRAN_HAVE_C_LONG_DOUBLE]) + AC_SUBST([FORTRAN_C_LONG_DOUBLE_IS_UNIQUE]) + AC_SUBST([FORTRAN_SIZEOF_LONG_DOUBLE]) + AC_SUBST([H5CONFIG_F_NUM_RKIND]) + AC_SUBST([H5CONFIG_F_RKIND]) + AC_SUBST([H5CONFIG_F_RKIND_SIZEOF]) + AC_SUBST([H5CONFIG_F_NUM_IKIND]) + AC_SUBST([H5CONFIG_F_IKIND]) + + ## Setting definition if there is a 16 byte fortran integer + if `echo $PAC_FC_ALL_INTEGER_KINDS_SIZEOF | grep '16' >/dev/null`; then + HAVE_Fortran_INTEGER_SIZEOF_16="1" + AC_DEFINE([HAVE_Fortran_INTEGER_SIZEOF_16], [1], [Determine if INTEGER*16 is available]) + else + HAVE_Fortran_INTEGER_SIZEOF_16="0" + AC_DEFINE([HAVE_Fortran_INTEGER_SIZEOF_16], [0], [Determine if INTEGER*16 is available]) + fi - if test "X$HDF_FORTRAN2003" = "Xyes"; then + if test "X$HAVE_STORAGE_SIZE_FORTRAN" = "Xyes"; then + AC_DEFINE([FORTRAN_HAVE_STORAGE_SIZE], [1], [Define if we have Fortran intrinsic STORAGE_SIZE]) + fi - ## Checking if the compiler supports the required Fortran 2003 features and - ## disable Fortran 2003 if it does not. - PAC_PROG_FC_HAVE_F2003_REQUIREMENTS - - if test "X$HAVE_F2003_REQUIREMENTS" = "Xno"; then - AC_MSG_ERROR([Fortran compiler lacks required Fortran 2003 features; unsupported Fortran 2003 compiler, remove --enable-fortran2003]) + if test "X$HAVE_C_SIZEOF_FORTRAN" = "Xyes"; then + AC_DEFINE([FORTRAN_HAVE_C_SIZEOF], [1], [Define if we have Fortran intrinsic C_SIZEOF]) + fi + + if test "X$HAVE_SIZEOF_FORTRAN" = "Xyes"; then + AC_DEFINE([FORTRAN_HAVE_SIZEOF], [1], [Define if we have Fortran intrinsic SIZEOF]) + fi + + ## See if C_LONG_DOUBLE is available + PAC_PROG_FC_HAVE_C_LONG_DOUBLE + + FORTRAN_HAVE_C_LONG_DOUBLE="0" + if test "X$HAVE_C_LONG_DOUBLE_FORTRAN" = "Xyes"; then + FORTRAN_HAVE_C_LONG_DOUBLE="1" + AC_DEFINE([FORTRAN_HAVE_C_LONG_DOUBLE], [1], [Define if we have Fortran C_LONG_DOUBLE]) + fi + + ## Is C_LONG_DOUBLE different from C_DOUBLE + FORTRAN_C_LONG_DOUBLE_IS_UNIQUE="0" + if test "X$FORTRAN_HAVE_C_LONG_DOUBLE"; then + PAC_PROG_FC_C_LONG_DOUBLE_EQ_C_DOUBLE + if test "X$C_LONG_DOUBLE_IS_UNIQUE_FORTRAN" = "Xyes"; then + FORTRAN_C_LONG_DOUBLE_IS_UNIQUE="1" + AC_DEFINE([FORTRAN_C_LONG_DOUBLE_IS_UNIQUE], [1], [Define if Fortran C_LONG_DOUBLE is different from C_DOUBLE]) else - HAVE_FORTRAN_2003="yes" + FORTRAN_C_LONG_DOUBLE_IS_UNIQUE="0" + fi + fi + + FORTRAN_SIZEOF_LONG_DOUBLE=${ac_cv_sizeof_long_double} + AC_DEFINE_UNQUOTED([FORTRAN_SIZEOF_LONG_DOUBLE], ["${ac_cv_sizeof_long_double}"], [Determine the size of C long double]) + + + dnl get the largest sizeof for REAL kinds + + max_real_fortran_sizeof="`echo \"[$]PAC_FC_ALL_REAL_KINDS_SIZEOF\" | perl -ne '/,(\d+)\}/; print $1'`" + max_real_fortran_kind="`echo \"[$]PAC_FC_ALL_REAL_KINDS\" | perl -ne '/,(\d+)\}/; print $1'`" + + dnl remove the invalid kind from the list + if test "$ac_cv_sizeof___float128" != 0;then + if test "$ac_cv_sizeof___float128" != "$max_real_fortran_sizeof" && test "${ac_cv_sizeof_long_double}" != "$max_real_fortran_sizeof"; then + AC_MSG_WARN([ + Fortran REAL(KIND=$max_real_fortran_kind) is $max_real_fortran_sizeof Bytes, but no corresponding C float type exists of that size + !!! Fortran interfaces will not be generated for REAL(KIND=$max_real_fortran_kind) !!! + ]) + PAC_FC_ALL_REAL_KINDS="`echo \"[$]PAC_FC_ALL_REAL_KINDS\" | perl -pe 's/,\d+}/}/g;'`" + PAC_FC_ALL_REAL_KINDS_SIZEOF="`echo \"[$]PAC_FC_ALL_REAL_KINDS_SIZEOF\" | perl -pe 's/,\d+}/}/g;'`" fi fi + AC_MSG_CHECKING([for Fortran interoperable KINDS with C]) + AC_MSG_RESULT([$PAC_FC_ALL_REAL_KINDS]) + + dnl count the number of real kinds + H5CONFIG_F_NUM_RKIND="INTEGER, PARAMETER :: num_rkinds = `echo \"[$]PAC_FC_ALL_REAL_KINDS\" | perl -e '$count = ( =~ tr/,//);print $count+1'`" + H5CONFIG_F_RKIND="INTEGER, DIMENSION(1:num_rkinds) :: rkind = (/`echo \"[$]PAC_FC_ALL_REAL_KINDS\" | perl -pe 's/{//g' | perl -pe 's/}//g' | perl -pe 's/ /,/g'`/)" + H5CONFIG_F_RKIND_SIZEOF="INTEGER, DIMENSION(1:num_rkinds) :: rkind_sizeof = (/`echo \"[$]PAC_FC_ALL_REAL_KINDS_SIZEOF\" | perl -pe 's/{//g' | perl -pe 's/}//g'| perl -pe 's/ /,/g'`/)" + + AC_DEFINE_UNQUOTED([H5CONFIG_F_NUM_RKIND], $H5CONFIG_F_NUM_RKIND, [Define number of valid Fortran REAL KINDs]) + AC_DEFINE_UNQUOTED([H5CONFIG_F_RKIND], $H5CONFIG_F_RKIND, [Define valid Fortran REAL KINDs]) + AC_DEFINE_UNQUOTED([H5CONFIG_F_RKIND_SIZEOF], $H5CONFIG_F_RKIND_SIZEOF, [Define valid Fortran REAL KINDs Sizeof]) + +## Change back to the C language + AC_LANG_POP(Fortran) else FC="no" fi -## Change back to the C language -AC_LANG_POP(Fortran) - -AM_CONDITIONAL([FORTRAN_HAVE_SIZEOF], [test "X$HAVE_SIZEOF_FORTRAN" = "Xyes"]) -AM_CONDITIONAL([FORTRAN_HAVE_C_SIZEOF], [test "X$HAVE_C_SIZEOF_FORTRAN" = "Xyes"]) -AM_CONDITIONAL([FORTRAN_HAVE_STORAGE_SIZE], [test "X$HAVE_STORAGE_SIZE_FORTRAN" = "Xyes"]) -AM_CONDITIONAL([FORTRAN_2003_CONDITIONAL_F], [test "X$HAVE_FORTRAN_2003" = "Xyes"]) -AM_CONDITIONAL([FORTRAN_DEFAULT_REALisDBLE_F], [test "X$FORTRAN_DEFAULT_REALisDBLE" = "Xyes"]) - ## ---------------------------------------------------------------------- ## Check if they would like the C++ interface compiled ## @@ -530,27 +672,12 @@ if test "X$HDF5_HL" = "Xyes"; then HL="hl" AC_DEFINE([INCLUDE_HL], [1], [Define if HDF5's high-level library headers should be included in hdf5.h]) - - ## If Fortran's default real is double precision and HL is being built then configure - ## should fail due to bug HDFFV-889. - if test "X$FORTRAN_DEFAULT_REALisDBLE" = "Xyes"; then - AC_MSG_ERROR([Fortran high-level routines are not supported when the default REAL is DOUBLE PRECISION, use configure option --disable-hl.]) - fi else echo "no" fi ## ---------------------------------------------------------------------- -## Check if they have Perl installed on their system. We only need Perl -## if they're using a GNU compiler. -## -AC_SUBST([PERL]) PERL="" -if test "X$GCC" = "Xyes"; then - AC_CHECK_PROGS([PERL], [perl],, [$PATH]) -fi - -## ---------------------------------------------------------------------- ## Check which archiving tool to use. This needs to be done before ## the AM_PROG_LIBTOOL macro. ## @@ -975,7 +1102,7 @@ case "$host_cpu-$host_vendor-$host_os" in ## ## POSIX feature information can be found in the gcc manual at: ## http://www.gnu.org/s/libc/manual/html_node/Feature-Test-Macros.html - H5_CPPFLAGS="-D_POSIX_C_SOURCE=200112L $H5_CPPFLAGS" +##SCOT H5_CPPFLAGS="-D_POSIX_C_SOURCE=200112L $H5_CPPFLAGS" ## Need to add this so that O_DIRECT is visible for the direct ## VFD on Linux systems. @@ -1016,31 +1143,6 @@ AC_TRY_COMPILE([ [AC_CHECK_FUNCS([stat64 fstat64])], [AC_MSG_RESULT([skipping test for stat64() and fstat64()])]) -## ---------------------------------------------------------------------- -## Data types and their sizes. -## -AC_TYPE_OFF_T -AC_CHECK_TYPE([size_t], [], - [AC_DEFINE_UNQUOTED([size_t], [unsigned long], - [Define to `unsigned long' if does not define.])]) -AC_CHECK_TYPE([ssize_t], [], - [AC_DEFINE_UNQUOTED([ssize_t], [long], - [Define to `long' if does not define.])]) -AC_CHECK_TYPE([ptrdiff_t], [], - [AC_DEFINE_UNQUOTED([ptrdiff_t], [long], - [Define to `long' if does not define.])]) -AC_C_BIGENDIAN -AC_CHECK_SIZEOF([char], [1]) -AC_CHECK_SIZEOF([short], [2]) -AC_CHECK_SIZEOF([int], [4]) -AC_CHECK_SIZEOF([unsigned], [4]) -AC_CHECK_SIZEOF([long], [4]) -AC_CHECK_SIZEOF([long long], [8]) -AC_CHECK_SIZEOF([__int64], [8]) -AC_CHECK_SIZEOF([float], [4]) -AC_CHECK_SIZEOF([double], [8]) -AC_CHECK_SIZEOF([long double], [8]) - ## Checkpoint the cache AC_CACHE_SAVE @@ -1804,18 +1906,18 @@ all_packages="ac,b,b2,d,e,f,g,hg,hl,i,mf,mm,o,p,s,t,v,z" case "X-$DEBUG_PKG" in X-yes) DEBUG_PKG="d,e,f,g,hg,i,mm,o,p,s,t,v,z" - H5_CPPFLAGS="$H5_CPPFLAGS -UNDEBUG" +## H5_CPPFLAGS="$H5_CPPFLAGS -UNDEBUG" AC_MSG_RESULT([default ($DEBUG_PKG)]) ;; X-all) DEBUG_PKG=$all_packages - H5_CPPFLAGS="$H5_CPPFLAGS -UNDEBUG" +## H5_CPPFLAGS="$H5_CPPFLAGS -UNDEBUG" AC_MSG_RESULT([all ($DEBUG_PKG)]) ;; X-no|X-none) AC_MSG_RESULT([none]) DEBUG_PKG= - H5_CPPFLAGS="$H5_CPPFLAGS -DNDEBUG" +## H5_CPPFLAGS="$H5_CPPFLAGS -DNDEBUG" ;; *) AC_MSG_RESULT([$DEBUG_PKG]) @@ -3040,6 +3142,7 @@ AC_CONFIG_FILES([src/libhdf5.settings fortran/Makefile fortran/src/h5fc fortran/src/Makefile + fortran/src/H5fort_type_defines.h fortran/test/Makefile fortran/testpar/Makefile fortran/examples/Makefile diff --git a/examples/Makefile.in b/examples/Makefile.in index 5d76be3..79232ae 100644 --- a/examples/Makefile.in +++ b/examples/Makefile.in @@ -112,7 +112,8 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/aclocal_cxx.m4 \ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/bin/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/src/H5config.h +CONFIG_HEADER = $(top_builddir)/src/H5config.h \ + $(top_builddir)/fortran/src/H5config_f.inc CONFIG_CLEAN_FILES = run-c-ex.sh testh5cc.sh CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) @@ -396,14 +397,21 @@ F9XMODEXT = @F9XMODEXT@ F9XMODFLAG = @F9XMODFLAG@ F9XSUFFIXFLAG = @F9XSUFFIXFLAG@ FC = @FC@ -FC2003 = @FC2003@ FCFLAGS = @FCFLAGS@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ +FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ +FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ +FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ +H5CONFIG_F_IKIND = @H5CONFIG_F_IKIND@ +H5CONFIG_F_NUM_IKIND = @H5CONFIG_F_NUM_IKIND@ +H5CONFIG_F_NUM_RKIND = @H5CONFIG_F_NUM_RKIND@ +H5CONFIG_F_RKIND = @H5CONFIG_F_RKIND@ +H5CONFIG_F_RKIND_SIZEOF = @H5CONFIG_F_RKIND_SIZEOF@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ @@ -413,13 +421,12 @@ H5_LDFLAGS = @H5_LDFLAGS@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ -HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_Fortran_INTEGER_SIZEOF_16 = @HAVE_Fortran_INTEGER_SIZEOF_16@ HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ HDF_FORTRAN = @HDF_FORTRAN@ -HDF_FORTRAN2003 = @HDF_FORTRAN2003@ HID_T = @HID_T@ HL = @HL@ HL_FOR = @HL_FOR@ @@ -461,6 +468,18 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PAC_C_MAX_REAL_PRECISION = @PAC_C_MAX_REAL_PRECISION@ +PAC_FC_ALL_INTEGER_KINDS = @PAC_FC_ALL_INTEGER_KINDS@ +PAC_FC_ALL_INTEGER_KINDS_SIZEOF = @PAC_FC_ALL_INTEGER_KINDS_SIZEOF@ +PAC_FC_ALL_REAL_KINDS = @PAC_FC_ALL_REAL_KINDS@ +PAC_FC_ALL_REAL_KINDS_SIZEOF = @PAC_FC_ALL_REAL_KINDS_SIZEOF@ +PAC_FC_MAX_REAL_PRECISION = @PAC_FC_MAX_REAL_PRECISION@ +PAC_FORTRAN_NATIVE_DOUBLE_KIND = @PAC_FORTRAN_NATIVE_DOUBLE_KIND@ +PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF = @PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF@ +PAC_FORTRAN_NATIVE_INTEGER_KIND = @PAC_FORTRAN_NATIVE_INTEGER_KIND@ +PAC_FORTRAN_NATIVE_INTEGER_SIZEOF = @PAC_FORTRAN_NATIVE_INTEGER_SIZEOF@ +PAC_FORTRAN_NATIVE_REAL_KIND = @PAC_FORTRAN_NATIVE_REAL_KIND@ +PAC_FORTRAN_NATIVE_REAL_SIZEOF = @PAC_FORTRAN_NATIVE_REAL_SIZEOF@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ diff --git a/fortran/Makefile.in b/fortran/Makefile.in index 55ede05..8585623 100644 --- a/fortran/Makefile.in +++ b/fortran/Makefile.in @@ -110,7 +110,8 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/aclocal_cxx.m4 \ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/bin/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/src/H5config.h +CONFIG_HEADER = $(top_builddir)/src/H5config.h \ + $(top_builddir)/fortran/src/H5config_f.inc CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) @@ -452,14 +453,21 @@ F9XMODEXT = @F9XMODEXT@ F9XMODFLAG = @F9XMODFLAG@ F9XSUFFIXFLAG = @F9XSUFFIXFLAG@ FC = @FC@ -FC2003 = @FC2003@ FCFLAGS = @FCFLAGS@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ +FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ +FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ +FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ +H5CONFIG_F_IKIND = @H5CONFIG_F_IKIND@ +H5CONFIG_F_NUM_IKIND = @H5CONFIG_F_NUM_IKIND@ +H5CONFIG_F_NUM_RKIND = @H5CONFIG_F_NUM_RKIND@ +H5CONFIG_F_RKIND = @H5CONFIG_F_RKIND@ +H5CONFIG_F_RKIND_SIZEOF = @H5CONFIG_F_RKIND_SIZEOF@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ @@ -469,13 +477,12 @@ H5_LDFLAGS = @H5_LDFLAGS@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ -HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_Fortran_INTEGER_SIZEOF_16 = @HAVE_Fortran_INTEGER_SIZEOF_16@ HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ HDF_FORTRAN = @HDF_FORTRAN@ -HDF_FORTRAN2003 = @HDF_FORTRAN2003@ HID_T = @HID_T@ HL = @HL@ HL_FOR = @HL_FOR@ @@ -517,6 +524,18 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PAC_C_MAX_REAL_PRECISION = @PAC_C_MAX_REAL_PRECISION@ +PAC_FC_ALL_INTEGER_KINDS = @PAC_FC_ALL_INTEGER_KINDS@ +PAC_FC_ALL_INTEGER_KINDS_SIZEOF = @PAC_FC_ALL_INTEGER_KINDS_SIZEOF@ +PAC_FC_ALL_REAL_KINDS = @PAC_FC_ALL_REAL_KINDS@ +PAC_FC_ALL_REAL_KINDS_SIZEOF = @PAC_FC_ALL_REAL_KINDS_SIZEOF@ +PAC_FC_MAX_REAL_PRECISION = @PAC_FC_MAX_REAL_PRECISION@ +PAC_FORTRAN_NATIVE_DOUBLE_KIND = @PAC_FORTRAN_NATIVE_DOUBLE_KIND@ +PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF = @PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF@ +PAC_FORTRAN_NATIVE_INTEGER_KIND = @PAC_FORTRAN_NATIVE_INTEGER_KIND@ +PAC_FORTRAN_NATIVE_INTEGER_SIZEOF = @PAC_FORTRAN_NATIVE_INTEGER_SIZEOF@ +PAC_FORTRAN_NATIVE_REAL_KIND = @PAC_FORTRAN_NATIVE_REAL_KIND@ +PAC_FORTRAN_NATIVE_REAL_SIZEOF = @PAC_FORTRAN_NATIVE_REAL_SIZEOF@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ diff --git a/fortran/doc/DevelGuide/masterindex.html b/fortran/doc/DevelGuide/masterindex.html deleted file mode 100644 index 9765ea0..0000000 --- a/fortran/doc/DevelGuide/masterindex.html +++ /dev/null @@ -1,589 +0,0 @@ - - - - - - - -Index - - - - -
-
- -
-

Index

-

A - B - C - D - E - F - G - H - I - J - K - L - M - N - O - P - Q - R - S - T - U - V - W - X - Y - Z - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9

- h5pget_double - h5pget_hyper_vector_size_f - h5pset_family_offset_f - h5pset_fapl_family_f - h5pset_meta_block_size_f -

F

fflush1.f90 -fflush2.f90 -fortran/test/fflush1.f90 -fortran/test/fflush2.f90 -fortran/test/fortranlib_test.f90 -fortran/test/fortranlib_test_1_8.f90 -fortran/test/fortranlib_test_F03.f90 -fortran/test/tc.c -fortran/test/tf.f90 -fortran/test/tH5A.f90 -fortran/test/tH5A_1_8.f90 -fortran/test/tH5D.f90 -fortran/test/tH5E.f90 -fortran/test/tH5E_F03.f90 -fortran/test/tH5F.f90 -fortran/test/tH5G.f90 -fortran/test/tH5G_1_8.f90 -fortran/test/tH5I.f90 -fortran/test/tH5L_F03.f90 -fortran/test/tH5O.f90 -fortran/test/tH5P.f90 -fortran/test/tH5P_F03.f90 -fortran/test/tH5R.f90 -fortran/test/tH5S.f90 -fortran/test/tH5Sselect.f90 -fortran/test/tH5T.f90 -fortran/test/tH5T_F03.f90 -fortran/test/tH5VL.f90 -fortran/test/tH5Z.f90 -fortranlib_test.f90 -fortranlib_test_1_8.f90 -fortranlib_test_F03.f90 -

H

H5_DBLE_InterfaceExclude.f90 -H5_DBLE_InterfaceInclude.f90 -H5_ff.f90 -H5_ff_F03.f90 -H5_ff_F90.f90 -H5A -H5A (F03) -H5A (F90) -h5aclose_f -h5acreate_by_name_f -h5acreate_f -h5adelete_by_idx_f -h5adelete_by_name_f -h5adelete_f -H5Aexists_by_name_f -H5Aexists_f -H5Af -H5Af.c -H5Aff.f90 -H5Aff_F03.f90 -H5Aff_F90.f90 -h5aget_create_plist_f -h5aget_info_by_idx_f -h5aget_info_by_name_f -h5aget_info_f -h5aget_name_by_idx_f -h5aget_name_f -h5aget_num_attrs_f -h5aget_space_f -h5aget_storage_size_f -h5aget_type_f -h5aopen_by_idx_f -H5Aopen_by_name_f -h5aopen_f -h5aopen_idx_f -h5aopen_name_f -h5aread_f -h5arename_by_name_f -h5arename_f -h5check_version_f -h5close_f -H5D -H5D (F03) -H5D (F90) -h5dclose_f -h5dcreate_anon_f -h5dcreate_f -H5Df -H5Df.c -H5Dff.f90 -H5Dff_F03.f90 -H5Dff_F90.f90 -h5dget_access_plist_f -h5dget_create_plist_f -h5dget_space_f -h5dget_space_status_f -h5dget_storage_size_f -h5dget_type_f -h5dont_atexit_f -h5dopen_f -h5dread_f -h5dset_extent -h5dvlen_get_max_len_f -h5dvlen_reclaim -H5E -H5E (F03) -H5E (F90) -h5eclear_f -H5Ef -H5Ef.c -H5Eff.f90 -H5Eff_F03.f90 -H5Eff_F90.f90 -h5eget_auto_f -h5eget_major_f -h5eget_minor_f -h5eprint_f -h5eset_auto2_f -h5eset_auto_f -H5F -H5f90global.f90 -H5f90kit -H5f90kit.c -h5fclose_f -h5fcreate_f -H5FDMPIO -H5FDmpiof -H5FDmpiof.c -H5FDmpioff.f90 -H5Ff -H5Ff.c -H5Fff.f90 -h5fflush_f -h5fget_access_plist_f -h5fget_create_plist_f -h5fget_filesize_f -h5fget_freespace_f -h5fget_name_f -h5fget_obj_count_f -h5fget_obj_ids_f -h5fis_hdf5_f -h5fmount_f -h5fopen_f -h5freopen_f -h5funmount_f -H5G -h5garbage_collect_f -h5gclose_f -H5Gcreate_anon_f -h5gcreate_f -h5get_libversion_f -H5Gf -H5Gf.c -H5Gff.f90 -h5gget_comment_f -H5Gget_create_plist_f -h5gget_info_by_idx_f -h5gget_info_by_name_f -h5gget_info_f -h5gget_linkval_f -h5gget_obj_info_idx_f -h5glink2_f -h5glink_f -H5GLOBAL -h5gmove2_f -h5gmove_f -h5gn_members_f -h5gopen_f -h5gset_comment_f -h5gunlink_f -H5I -h5idec_ref_f -H5If -H5If.c -H5Iff.f90 -h5iget_file_id_f -h5iget_name_f -h5iget_ref_f -h5iget_type_f -h5iinc_ref_f -h5iis_valid_f -h5kind_to_type -H5L -H5L (F03) -H5L (F90) -h5lcopy_f -H5Lcreate_external_f -H5Lcreate_hard_f -H5Lcreate_soft_f -h5ldelete_by_idx_f -h5ldelete_f -H5Lexists_f -H5Lf -H5Lf.c -H5Lff.f90 -H5Lff_F03.f90 -H5Lff_F90.f90 -h5lget_info_by_idx_f -h5lget_info_f -h5lget_name_by_idx_f -H5LIB -H5LIB_PROVISIONAL -H5LIB_PROVISIONAL (F90) -h5lis_registered_f -h5literate_by_name_f -h5literate_f -h5lmove_f -H5match_types -H5match_types.c -H5O -H5O (F03) -H5O (F90) -h5oclose_f -H5Of -H5Of.c -H5Off.f90 -H5Off_F03.f90 -H5Off_F90.f90 -h5offsetof -h5olink_f -h5oopen_f -h5open_by_addr_f -h5open_f -h5ovisit_f -H5P (_F90) -H5P (F03) -H5P (F90) -h5pall_filters_avail_f -h5pclose_class_f -h5pclose_f -h5pcopy_f -h5pcopy_prop_f -h5pcreate_class_f -h5pcreate_class_f -h5pcreate_f -h5pequal_f -h5pexist_f -H5Pf -H5Pf.c -H5Pff.f90 -H5Pff_F03.f90 -H5Pff_F90.f90 -h5pfill_value_defined_f -h5pget_alignment_f -h5pget_alloc_time_f -H5Pget_attr_creation_order_f -H5Pget_attr_phase_change_f -h5pget_btree_ratios_f -h5pget_buffer_f -h5pget_cache_f -h5pget_char -h5pget_char -H5Pget_char_encoding_f -H5Pget_chunk_cache_f -h5pget_chunk_f -h5pget_class_f -h5pget_class_name_f -h5pget_class_parent_f -h5pget_copy_object_f -H5Pget_create_inter_group_f -h5pget_data_transform_f -h5pget_double -h5pget_driver_f -h5pget_dxpl_mpio_f -h5pget_edc_check_f -H5Pget_est_link_info_f -h5pget_external_count_f -h5pget_external_f -h5pget_fapl_core_f -h5pget_fapl_direct_f -h5pget_fapl_family_f -h5pget_fapl_mpio_f -h5pget_fapl_mpiposix_f -h5pget_fapl_multi_f -h5pget_fclose_degree_f -h5pget_fill_time_f -h5pget_filter_by_id_f -h5pget_filter_f -h5pget_gc_references_f -h5pget_integer -h5pget_integer -h5pget_istore_k_f -h5pget_layout_f -H5Pget_link_creation_order_f -H5Pget_link_phase_change_f -H5Pget_local_heap_size_hint_f -h5pget_meta_block_size_f -h5pget_nfilters_f -h5pget_nlinks_f -h5pget_npros_f -H5Pget_obj_track_times_f -h5pget_preserve_f -h5pget_real -h5pget_real -h5pget_sec2_f -h5pget_sieve_buf_size_f -h5pget_size_f -h5pget_sizes_f -h5pget_small_data_block_size_f -h5pget_split_f -h5pget_stdio_f -h5pget_sym_k_f -h5pget_userblock_f -h5pget_version_f -h5pinsert_char -h5pinsert_char -h5pinsert_double -h5pinsert_double -h5pinsert_integer -h5pinsert_integer -h5pinsert_ptr -h5pinsert_real -h5pinsert_real -h5pisa_class_f -h5pmodify_filter_f -h5pregister_char -h5pregister_char -h5pregister_double -h5pregister_double -h5pregister_integer -h5pregister_integer -h5pregister_ptr -h5pregister_real -h5pregister_real -h5premove_f -h5premove_filter_f -h5pset(get)fill_value_f -h5pset(get)fill_value_f -h5pset_alignment_f -h5pset_alloc_time_f -H5Pset_attr_creation_order_f -H5Pset_attr_phase_change_f -h5pset_btree_ratios_f -h5pset_buffer_f -h5pset_cache_f -h5pset_char -h5pset_char -H5Pset_char_encoding_f -H5Pset_chunk_cache_f -h5pset_chunk_f -h5pset_copy_object_f -H5Pset_create_inter_group_f -h5pset_data_transform_f -h5pset_deflate_f -h5pset_double -h5pset_double -h5pset_dxpl_mpio_f -h5pset_edc_check_f -h5pset_est_link_info_f -h5pset_external_f -h5pset_fapl_core_f -h5pset_fapl_direct_f -h5pset_fapl_mpio_f -h5pset_fapl_mpiposix_f -h5pset_fapl_multi_l -h5pset_fapl_multi_s -h5pset_fapl_sec2_f -h5pset_fapl_split_f -h5pset_fapl_stdio_f -h5pset_fclose_degree_f -h5pset_fill_time_f -h5pset_filter_f -h5pset_fletcher32_f -h5pset_gc_references_f -h5pset_hyper_vector_size_f -h5pset_integer -h5pset_integer -h5pset_istore_k_f -h5pset_layout_f -H5Pset_libver_bounds_f -H5Pset_link_creation_order_f -h5pset_link_phase_change_f -H5Pset_local_heap_size_hint_f -H5Pset_nbit_f -h5pset_nlinks_f -H5Pset_obj_track_times_f -h5pset_preserve_f -h5pset_real -h5pset_real -h5pset_scaleoffset_f -H5Pset_shared_mesg_index_f -H5Pset_shared_mesg_nindexes_f -h5pset_shuffle_f -h5pset_sieve_buf_size_f -h5pset_sizes_f -h5pset_small_data_block_size_f -h5pset_sym_k_f -h5pset_szip_f -h5pset_userblock_f -h5punregister_f -H5R -H5R (F03) -H5R (F90) -h5rcreate_object_f -h5rcreate_object_f -h5rcreate_ptr_f -h5rcreate_region_f -h5rcreate_region_f -h5rdereference_object_f -h5rdereference_object_f -h5rdereference_ptr_f -h5rdereference_region_f -h5rdereference_region_f -H5Rf -H5Rf.c -H5Rff.f90 -H5Rff_F03.f90 -H5Rff_F90.f90 -h5rget_name_object_f -h5rget_name_object_f -h5rget_name_ptr_f -h5rget_name_region_f -h5rget_name_region_f -h5rget_obj_type_f -h5rget_object_type_obj_f -h5rget_region_region_f -H5S -h5sclose_f -h5scopy_f -h5screate_f -h5screate_simple_f -H5Sdecode_f -H5Sencode_f -h5sextent_copy_f -h5sextent_equal_f -H5Sf -H5Sf.c -H5Sff.f90 -h5sget_select_bounds_f -h5sget_select_elem_npoints_f -h5sget_select_elem_pointlist_f -h5sget_select_hyper_blocklist_f -h5sget_select_hyper_nblocks_f -h5sget_select_npoints_f -h5sget_select_type_f -h5sget_simple_extent_dims_f -h5sget_simple_extent_ndims_f -h5sget_simple_extent_npoints_f -h5sget_simple_extent_type_f -h5sis_simple_f -h5soffset_simple_f -h5sselect_all_f -h5sselect_elements_f -h5sselect_hyperslab_f -h5sselect_none_f -h5sselect_valid_f -h5sset_extent_none_f -h5sset_extent_simple_f -H5T -H5T (F03) -H5T (F90) -h5tarray_create_f -h5tclose_f -h5tcommit_anon_f -h5tcommit_f -h5tcommitted_f -h5tcompiler_conv_f -H5Tconvert_f -h5tcopy_f -h5tcreate_f -H5Tdecode_f -h5tenaum_insert_f -H5Tencode_f -h5tenum_create_f -h5tenum_nameof_f -h5tenum_valuof_f -h5tequal_f -H5test_kind -H5test_kind.f90 -H5test_kind_SIZEOF -H5test_kind_SIZEOF.f90 -H5Tf -H5Tf.c -H5Tff.f90 -H5Tff_F03.f90 -H5Tff_F90.f90 -h5tget_array_dims_f -h5tget_array_ndims_f -h5tget_class_f -h5tget_create_plist_f -h5tget_cset_f -h5tget_ebias_f -h5tget_fields_f -h5tget_inpad_f -h5tget_member_class_f -h5tget_member_index_f -h5tget_member_name_f -h5tget_member_offset_f -h5tget_member_type_f -h5tget_member_value_f -h5tget_native_type_f -h5tget_nmembers_f -h5tget_norm_f -h5tget_offset_f -h5tget_order_f -h5tget_pad_f -h5tget_precision_f -h5tget_sign_f -h5tget_size_f -h5tget_strpad_f -h5tget_super_f -h5tget_tag_f -h5tinsert_f -h5tis_variable_str_f -h5topen_f -h5tpack_f -h5tset_cset_f -h5tset_ebias_f -h5tset_fields_f -h5tset_inpad_f -h5tset_norm_f -h5tset_offset_f -h5tset_order_f -h5tset_pad_f -h5tset_precision_f -h5tset_sign_f -h5tset_size_f -h5tset_strpad_f -h5tset_tag_f -h5tvlen_create_f -H5Z -H5Zf -H5Zf.c -H5Zff.f90 -h5zfilter_avail_f -h5zget_filter_info_f -h5zunregister_f -HDF5 -HDF5 (mpio) -HDF5.f90 -HDF5mpio.f90 -

S

src/H5_DBLE_InterfaceExclude.f90 -src/H5_DBLE_InterfaceInclude.f90 -

T

t.c -tf.f90 -tH5A.f90 -tH5A_1_8.f90 -tH5D.f90 -tH5E.f90 -tH5E_F03.f90 -tH5F.f90 -tH5G.f90 -tH5G_1_8.f90 -tH5I.f90 -tH5L_F03.f90 -tH5O.f90 -tH5P.f90 -tH5P_F03.f90 -tH5R.f90 -tH5S.f90 -tH5Sselect.f90 -tH5T.f90 -tH5T_F03.f90 -tH5VL.f90 -tH5Z.f90 -

A - B - C - D - E - F - G - H - I - J - K - L - M - N - O - P - Q - R - S - T - U - V - W - X - Y - Z - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9

-
- - - diff --git a/fortran/doc/DevelGuide/robo_functions.html b/fortran/doc/DevelGuide/robo_functions.html deleted file mode 100644 index e4f253a..0000000 --- a/fortran/doc/DevelGuide/robo_functions.html +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - -Functions - - - - -
-
- -
-

Functions

-

A - B - C - D - E - F - G - H - I - J - K - L - M - N - O - P - Q - R - S - T - U - V - W - X - Y - Z - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9

-

H

h5kind_to_type -h5offsetof -

A - B - C - D - E - F - G - H - I - J - K - L - M - N - O - P - Q - R - S - T - U - V - W - X - Y - Z - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9

-
- - - diff --git a/fortran/doc/DevelGuide/robo_modules.html b/fortran/doc/DevelGuide/robo_modules.html deleted file mode 100644 index 8e57f38..0000000 --- a/fortran/doc/DevelGuide/robo_modules.html +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - - -Modules - - - - -
-
- - - - - diff --git a/fortran/doc/DevelGuide/robo_programs.html b/fortran/doc/DevelGuide/robo_programs.html deleted file mode 100644 index 8c35230..0000000 --- a/fortran/doc/DevelGuide/robo_programs.html +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - -Programs - - - - -
-
- -
-

Programs

-

A - B - C - D - E - F - G - H - I - J - K - L - M - N - O - P - Q - R - S - T - U - V - W - X - Y - Z - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9

-

H

H5test_kind -H5test_kind_SIZEOF -

A - B - C - D - E - F - G - H - I - J - K - L - M - N - O - P - Q - R - S - T - U - V - W - X - Y - Z - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9

-
- - - diff --git a/fortran/doc/DevelGuide/robo_sourcefiles.html b/fortran/doc/DevelGuide/robo_sourcefiles.html deleted file mode 100644 index 63a8637..0000000 --- a/fortran/doc/DevelGuide/robo_sourcefiles.html +++ /dev/null @@ -1,309 +0,0 @@ - - - - - - - -Sourcefiles - - - - -
-
- - - - - diff --git a/fortran/doc/DevelGuide/robo_subroutines.html b/fortran/doc/DevelGuide/robo_subroutines.html deleted file mode 100644 index 0846c77..0000000 --- a/fortran/doc/DevelGuide/robo_subroutines.html +++ /dev/null @@ -1,421 +0,0 @@ - - - - - - - -Subroutines - - - - -
-
- -
-

Subroutines

-

A - B - C - D - E - F - G - H - I - J - K - L - M - N - O - P - Q - R - S - T - U - V - W - X - Y - Z - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9

- h5pget_double - h5pget_hyper_vector_size_f - h5pset_family_offset_f - h5pset_fapl_family_f - h5pset_meta_block_size_f -

H

h5aclose_f -h5acreate_by_name_f -h5acreate_f -h5adelete_by_idx_f -h5adelete_by_name_f -h5adelete_f -H5Aexists_by_name_f -H5Aexists_f -h5aget_create_plist_f -h5aget_info_by_idx_f -h5aget_info_by_name_f -h5aget_info_f -h5aget_name_by_idx_f -h5aget_name_f -h5aget_num_attrs_f -h5aget_space_f -h5aget_storage_size_f -h5aget_type_f -h5aopen_by_idx_f -H5Aopen_by_name_f -h5aopen_f -h5aopen_idx_f -h5aopen_name_f -h5aread_f -h5arename_by_name_f -h5arename_f -h5check_version_f -h5close_f -h5dclose_f -h5dcreate_anon_f -h5dcreate_f -h5dget_access_plist_f -h5dget_create_plist_f -h5dget_space_f -h5dget_space_status_f -h5dget_storage_size_f -h5dget_type_f -h5dont_atexit_f -h5dopen_f -h5dread_f -h5dset_extent -h5dvlen_get_max_len_f -h5dvlen_reclaim -h5eclear_f -h5eget_auto_f -h5eget_major_f -h5eget_minor_f -h5eprint_f -h5eset_auto2_f -h5eset_auto_f -h5fclose_f -h5fcreate_f -h5fflush_f -h5fget_access_plist_f -h5fget_create_plist_f -h5fget_filesize_f -h5fget_freespace_f -h5fget_name_f -h5fget_obj_count_f -h5fget_obj_ids_f -h5fis_hdf5_f -h5fmount_f -h5fopen_f -h5freopen_f -h5funmount_f -h5garbage_collect_f -h5gclose_f -H5Gcreate_anon_f -h5gcreate_f -h5get_libversion_f -h5gget_comment_f -H5Gget_create_plist_f -h5gget_info_by_idx_f -h5gget_info_by_name_f -h5gget_info_f -h5gget_linkval_f -h5gget_obj_info_idx_f -h5glink2_f -h5glink_f -h5gmove2_f -h5gmove_f -h5gn_members_f -h5gopen_f -h5gset_comment_f -h5gunlink_f -h5idec_ref_f -h5iget_file_id_f -h5iget_name_f -h5iget_ref_f -h5iget_type_f -h5iinc_ref_f -h5iis_valid_f -h5lcopy_f -H5Lcreate_external_f -H5Lcreate_hard_f -H5Lcreate_soft_f -h5ldelete_by_idx_f -h5ldelete_f -H5Lexists_f -h5lget_info_by_idx_f -h5lget_info_f -h5lget_name_by_idx_f -h5lis_registered_f -h5literate_by_name_f -h5literate_f -h5lmove_f -h5oclose_f -h5olink_f -h5oopen_f -h5open_by_addr_f -h5open_f -h5ovisit_f -h5pall_filters_avail_f -h5pclose_class_f -h5pclose_f -h5pcopy_f -h5pcopy_prop_f -h5pcreate_class_f -h5pcreate_class_f -h5pcreate_f -h5pequal_f -h5pexist_f -h5pfill_value_defined_f -h5pget_alignment_f -h5pget_alloc_time_f -H5Pget_attr_creation_order_f -H5Pget_attr_phase_change_f -h5pget_btree_ratios_f -h5pget_buffer_f -h5pget_cache_f -h5pget_char -h5pget_char -H5Pget_char_encoding_f -H5Pget_chunk_cache_f -h5pget_chunk_f -h5pget_class_f -h5pget_class_name_f -h5pget_class_parent_f -h5pget_copy_object_f -H5Pget_create_inter_group_f -h5pget_data_transform_f -h5pget_double -h5pget_driver_f -h5pget_dxpl_mpio_f -h5pget_edc_check_f -H5Pget_est_link_info_f -h5pget_external_count_f -h5pget_external_f -h5pget_fapl_core_f -h5pget_fapl_direct_f -h5pget_fapl_family_f -h5pget_fapl_mpio_f -h5pget_fapl_mpiposix_f -h5pget_fapl_multi_f -h5pget_fclose_degree_f -h5pget_fill_time_f -h5pget_filter_by_id_f -h5pget_filter_f -h5pget_gc_references_f -h5pget_integer -h5pget_integer -h5pget_istore_k_f -h5pget_layout_f -H5Pget_link_creation_order_f -H5Pget_link_phase_change_f -H5Pget_local_heap_size_hint_f -h5pget_meta_block_size_f -h5pget_nfilters_f -h5pget_nlinks_f -h5pget_npros_f -H5Pget_obj_track_times_f -h5pget_preserve_f -h5pget_real -h5pget_real -h5pget_sec2_f -h5pget_sieve_buf_size_f -h5pget_size_f -h5pget_sizes_f -h5pget_small_data_block_size_f -h5pget_split_f -h5pget_stdio_f -h5pget_sym_k_f -h5pget_userblock_f -h5pget_version_f -h5pinsert_char -h5pinsert_char -h5pinsert_double -h5pinsert_double -h5pinsert_integer -h5pinsert_integer -h5pinsert_ptr -h5pinsert_real -h5pinsert_real -h5pisa_class_f -h5pmodify_filter_f -h5pregister_char -h5pregister_char -h5pregister_double -h5pregister_double -h5pregister_integer -h5pregister_integer -h5pregister_ptr -h5pregister_real -h5pregister_real -h5premove_f -h5premove_filter_f -h5pset(get)fill_value_f -h5pset(get)fill_value_f -h5pset_alignment_f -h5pset_alloc_time_f -H5Pset_attr_creation_order_f -H5Pset_attr_phase_change_f -h5pset_btree_ratios_f -h5pset_buffer_f -h5pset_cache_f -h5pset_char -h5pset_char -H5Pset_char_encoding_f -H5Pset_chunk_cache_f -h5pset_chunk_f -h5pset_copy_object_f -H5Pset_create_inter_group_f -h5pset_data_transform_f -h5pset_deflate_f -h5pset_double -h5pset_double -h5pset_dxpl_mpio_f -h5pset_edc_check_f -h5pset_est_link_info_f -h5pset_external_f -h5pset_fapl_core_f -h5pset_fapl_direct_f -h5pset_fapl_mpio_f -h5pset_fapl_mpiposix_f -h5pset_fapl_multi_l -h5pset_fapl_multi_s -h5pset_fapl_sec2_f -h5pset_fapl_split_f -h5pset_fapl_stdio_f -h5pset_fclose_degree_f -h5pset_fill_time_f -h5pset_filter_f -h5pset_fletcher32_f -h5pset_gc_references_f -h5pset_hyper_vector_size_f -h5pset_integer -h5pset_integer -h5pset_istore_k_f -h5pset_layout_f -H5Pset_libver_bounds_f -H5Pset_link_creation_order_f -h5pset_link_phase_change_f -H5Pset_local_heap_size_hint_f -H5Pset_nbit_f -h5pset_nlinks_f -H5Pset_obj_track_times_f -h5pset_preserve_f -h5pset_real -h5pset_real -h5pset_scaleoffset_f -H5Pset_shared_mesg_index_f -H5Pset_shared_mesg_nindexes_f -h5pset_shuffle_f -h5pset_sieve_buf_size_f -h5pset_sizes_f -h5pset_small_data_block_size_f -h5pset_sym_k_f -h5pset_szip_f -h5pset_userblock_f -h5punregister_f -h5rcreate_object_f -h5rcreate_object_f -h5rcreate_ptr_f -h5rcreate_region_f -h5rcreate_region_f -h5rdereference_object_f -h5rdereference_object_f -h5rdereference_ptr_f -h5rdereference_region_f -h5rdereference_region_f -h5rget_name_object_f -h5rget_name_object_f -h5rget_name_ptr_f -h5rget_name_region_f -h5rget_name_region_f -h5rget_obj_type_f -h5rget_object_type_obj_f -h5rget_region_region_f -h5sclose_f -h5scopy_f -h5screate_f -h5screate_simple_f -H5Sdecode_f -H5Sencode_f -h5sextent_copy_f -h5sextent_equal_f -h5sget_select_bounds_f -h5sget_select_elem_npoints_f -h5sget_select_elem_pointlist_f -h5sget_select_hyper_blocklist_f -h5sget_select_hyper_nblocks_f -h5sget_select_npoints_f -h5sget_select_type_f -h5sget_simple_extent_dims_f -h5sget_simple_extent_ndims_f -h5sget_simple_extent_npoints_f -h5sget_simple_extent_type_f -h5sis_simple_f -h5soffset_simple_f -h5sselect_all_f -h5sselect_elements_f -h5sselect_hyperslab_f -h5sselect_none_f -h5sselect_valid_f -h5sset_extent_none_f -h5sset_extent_simple_f -h5tarray_create_f -h5tclose_f -h5tcommit_anon_f -h5tcommit_f -h5tcommitted_f -h5tcompiler_conv_f -H5Tconvert_f -h5tcopy_f -h5tcreate_f -H5Tdecode_f -h5tenaum_insert_f -H5Tencode_f -h5tenum_create_f -h5tenum_nameof_f -h5tenum_valuof_f -h5tequal_f -h5tget_array_dims_f -h5tget_array_ndims_f -h5tget_class_f -h5tget_create_plist_f -h5tget_cset_f -h5tget_ebias_f -h5tget_fields_f -h5tget_inpad_f -h5tget_member_class_f -h5tget_member_index_f -h5tget_member_name_f -h5tget_member_offset_f -h5tget_member_type_f -h5tget_member_value_f -h5tget_native_type_f -h5tget_nmembers_f -h5tget_norm_f -h5tget_offset_f -h5tget_order_f -h5tget_pad_f -h5tget_precision_f -h5tget_sign_f -h5tget_size_f -h5tget_strpad_f -h5tget_super_f -h5tget_tag_f -h5tinsert_f -h5tis_variable_str_f -h5topen_f -h5tpack_f -h5tset_cset_f -h5tset_ebias_f -h5tset_fields_f -h5tset_inpad_f -h5tset_norm_f -h5tset_offset_f -h5tset_order_f -h5tset_pad_f -h5tset_precision_f -h5tset_sign_f -h5tset_size_f -h5tset_strpad_f -h5tset_tag_f -h5tvlen_create_f -h5zfilter_avail_f -h5zget_filter_info_f -h5zunregister_f -

A - B - C - D - E - F - G - H - I - J - K - L - M - N - O - P - Q - R - S - T - U - V - W - X - Y - Z - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9

-
- - - diff --git a/fortran/doc/DevelGuide/robodoc.css b/fortran/doc/DevelGuide/robodoc.css deleted file mode 100644 index 207a172..0000000 --- a/fortran/doc/DevelGuide/robodoc.css +++ /dev/null @@ -1,302 +0,0 @@ -/****h* ROBODoc/ROBODoc Cascading Style Sheet - * FUNCTION - * This is the default cascading style sheet for documentation - * generated with ROBODoc. - * You can edit this file to your own liking and then use - * it with the option - * --css - * - * This style-sheet defines the following layout - * +----------------------------------------+ - * | logo | - * +----------------------------------------+ - * | extra | - * +----------------------------------------+ - * | | navi- | - * | | gation | - * | content | | - * | | | - * +----------------------------------------+ - * | footer | - * +----------------------------------------+ - * - * This style-sheet is based on a style-sheet that was automatically - * generated with the Strange Banana stylesheet generator. - * See http://www.strangebanana.com/generator.aspx - * - ****** - * $Id: html_generator.c,v 1.94 2008/06/17 11:49:27 gumpu Exp $ - */ - -body -{ - background-color: rgb(255,255,255); - color: rgb(98,84,55); - font-family: Arial, serif; - border-color: rgb(226,199,143); -} - -pre -{ - font-family: monospace; - margin: 15px; - padding: 5px; - white-space: pre; - color: #000; -} - -pre.source -{ - background-color: #ffe; - border: dashed #aa9 1px; -} - -p -{ - margin:15px; -} - -p.item_name -{ - font-weight: bolder; - margin:5px; - font-size: 120%; -} - -#content -{ - font-size: 100%; - color: rgb(0,0,0); - background-color: rgb(255,255,255); - border-left-width: 0px; - border-right-width: 0px; - border-top-width: 0px; - border-bottom-width: 0px; - border-left-style: none; - border-right-style: none; - border-top-style: none; - border-bottom-style: none; - padding: 40px 31px 14px 17px; - border-color: rgb(0,0,0); - text-align: justify; -} - -#navigation -{ - background-color: rgb(98,84,55); - color: rgb(230,221,202); - font-family: "Times New Roman", serif; - font-style: normal; - border-color: rgb(0,0,0); -} - -a.menuitem -{ - font-size: 120%; - background-color: rgb(0,0,0); - color: rgb(195,165,100); - font-variant: normal; - text-transform: none; - font-weight: normal; - padding: 1px 8px 3px 1px; - margin-left: 5px; - margin-right: 5px; - margin-top: 5px; - margin-bottom: 5px; - border-color: rgb(159,126,57); - text-align: right; -} - -#logo, #logo a -{ - font-size: 130%; - background-color: rgb(198,178,135); - color: rgb(98,84,55); - font-family: Georgia, serif; - font-style: normal; - font-variant: normal; - text-transform: none; - font-weight: bold; - padding: 20px 18px 20px 18px; - border-color: rgb(255,255,255); - text-align: right; -} - -#extra, #extra a -{ - font-size: 128%; - background-color: rgb(0,0,0); - color: rgb(230,221,202); - font-style: normal; - font-variant: normal; - text-transform: none; - font-weight: normal; - border-left-width: 0px; - border-right-width: 0px; - border-top-width: 0px; - border-bottom-width: 0px; - border-left-style: none; - border-right-style: none; - border-top-style: none; - border-bottom-style: none; - padding: 12px 12px 12px 12px; - border-color: rgb(195,165,100); - text-align: center; -} - -#content a -{ - color: rgb(159,126,57); - text-decoration: none; -} - -#content a:hover, #content a:active -{ - color: rgb(255,255,255); - background-color: rgb(159,126,57); -} - -a.indexitem -{ - display: block; -} - -h1, h2, h3, h4, h5, h6 -{ - background-color: rgb(221,221,221); - font-family: Arial, serif; - font-style: normal; - font-variant: normal; - text-transform: none; - font-weight: normal; -} - -h1 -{ - font-size: 151%; -} - -h2 -{ - font-size: 142%; -} - -h3 -{ - font-size: 133%; -} - -h4 -{ - font-size: 124%; -} - -h5 -{ - font-size: 115%; -} - -h6 -{ - font-size: 106%; -} - -#navigation a -{ - text-decoration: none; -} - -.menuitem:hover -{ - background-color: rgb(195,165,100); - color: rgb(0,0,0); -} - -#extra a -{ - text-decoration: none; -} - -#logo a -{ - text-decoration: none; -} - -#extra a:hover -{ -} - -/* layout */ -#navigation -{ - width: 22%; - position: relative; - top: 0; - right: 0; - float: right; - text-align: center; - margin-left: 10px; -} - -.menuitem {width: auto;} -#content {width: auto;} -.menuitem {display: block;} - - -div#footer -{ - background-color: rgb(198,178,135); - color: rgb(98,84,55); - clear: left; - width: 100%; - font-size: 71%; -} - -div#footer a -{ - background-color: rgb(198,178,135); - color: rgb(98,84,55); -} - -div#footer p -{ - margin:0; - padding:5px 10px -} - -span.keyword -{ - color: #00F; -} - -span.comment -{ - color: #080; -} - -span.quote -{ - color: #F00; -} - -span.squote -{ - color: #F0F; -} - -span.sign -{ - color: #008B8B; -} - -span.line_number -{ - color: #808080; -} - -@media print -{ - #navigation {display: none;} - #content {padding: 0px;} - #content a {text-decoration: underline;} -} diff --git a/fortran/doc/DevelGuide/src/H5Af_c.html b/fortran/doc/DevelGuide/src/H5Af_c.html deleted file mode 100644 index 7fcecc1..0000000 --- a/fortran/doc/DevelGuide/src/H5Af_c.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - -./src/H5Af.c - - - - - -
-
- -

H5Af

- -

[ Top ] [ Modules ]

-

PURPOSE

-
   This file contains C stubs for H5A Fortran APIs
-
- -
- - - diff --git a/fortran/doc/DevelGuide/src/H5Aff_F03_f90.html b/fortran/doc/DevelGuide/src/H5Aff_F03_f90.html deleted file mode 100644 index 9e503f4..0000000 --- a/fortran/doc/DevelGuide/src/H5Aff_F03_f90.html +++ /dev/null @@ -1,130 +0,0 @@ - - - - - - - -./src/H5Aff_F03.f90 - - - - - -
-
- -

H5A (F03)

- -

[ Top ] [ Modules ]

-

NAME

-
  H5A_PROVISIONAL
-
-

FILE

-
  src/fortran/src/H5Aff_F03.f90
-
-

PURPOSE

-
  This file contains Fortran 90 and Fortran 2003 interfaces for H5A functions.
-  It contains the same functions as H5Aff_F90.f90 but includes the
-  Fortran 2003 functions and the interface listings. This file will be compiled
-  instead of H5Aff_F90.f90 if Fortran 2003 functions are enabled.
-
-

NOTES

-
  (A) C_LOC and character strings according to the Fortran 2003 standard:
-
-  15.1.2.5 C_LOC(X)
-
-  Argument. X shall either
-
-  (1) have interoperable type and type parameters and be
-    (a) a variable that has the TARGET attribute and is interoperable,
-    (b) an allocated allocatable variable that has the TARGET attribute
-        and is not an array of zero size, or
-    (c) an associated scalar pointer, or
-  (2) be a nonpolymorphic scalar, have no length type parameters, and be
-    (a) a nonallocatable, nonpointer variable that has the TARGET attribute,
-    (b) an allocated allocatable variable that has the TARGET attribute, or
-    (c) an associated pointer.
-
-  - When X is a character, for interoperability the standard is:
-
-  15.2.1 Interoperability of intrinsic types
-
-  ...if the type is character, interoperability also requires that the length type parameter
-  be omitted or be specified by an initialization expression whose value is one.
-
-  THEREFORE compilers that have not extended the standard  require
-
-  CHARACTER(LEN=1), TARGET :: chr
-  or
-  CHARACTER, TARGET :: chr
-
-  (B)
-                         *** IMPORTANT ***
-  If you add a new H5A function you must add the function name to the
-  Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory.
-  This is needed for Windows based operating systems.
-
- -
- -

h5aread_f

- -

[ Top ] [ H5A (F03) ] [ Subroutines ]

-

NAME

-
  h5aread_f
-
-

PURPOSE

-
  Reads an attribute.
-
-

INPUTS

-
  attr_id       - attribute identifier
-  memtype_id    - attribute memory type identifier
-  dims          - 1D array of size 7, stores sizes of the
-                - buf array dimensions.
-
-

OUTPUTS

-
  buf           - buffer to read attribute data in
-  hdferr        - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces are added for
-  called C functions (it is needed for Windows
-  port).  February 27, 2001
-
-  dims parameter was added to make code portable;
-  Aprile 4, 2001
-
-  Changed buf intent to INOUT to be consistant
-  with how the C functions handles it. The pg
-  compiler will return 0 if a buf value is not set.
-  February, 2008
-
-

NOTES

-
  This function is overloaded to write INTEGER,
-  REAL, DOUBLE PRECISION and CHARACTER buffers
-  up to 7 dimensions.
-
- -
- - - diff --git a/fortran/doc/DevelGuide/src/H5Aff_F90_f90.html b/fortran/doc/DevelGuide/src/H5Aff_F90_f90.html deleted file mode 100644 index aa01b49..0000000 --- a/fortran/doc/DevelGuide/src/H5Aff_F90_f90.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - - -./src/H5Aff_F90.f90 - - - - - -
-
- -

H5A (F90)

- -

[ Top ] [ Modules ]

-

NAME

-
  H5A_PROVISIONAL
-
-

FILE

-
  fortran/src/H5Aff_F90.f90
-
-

PURPOSE

-
  This file contains Fortran 90 interfaces for H5A functions. It contains
-  the same functions as H5Aff_F03.f90 but excludes the Fortran 2003 functions
-  and the interface listings. This file will be compiled instead of H5Aff_F03.f90
-  if Fortran 2003 functions are not enabled.
-
-

NOTES

-
                         *** IMPORTANT ***
-  If you add a new H5A function you must add the function name to the
-  Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory.
-  This is needed for Windows based operating systems.
-
- -
- - - diff --git a/fortran/doc/DevelGuide/src/H5Aff_f90.html b/fortran/doc/DevelGuide/src/H5Aff_f90.html deleted file mode 100644 index 268c1db..0000000 --- a/fortran/doc/DevelGuide/src/H5Aff_f90.html +++ /dev/null @@ -1,1102 +0,0 @@ - - - - - - - -./src/H5Aff.f90 - - - - - -
-
- -

H5A

- -

[ Top ] [ Modules ]

-

NAME

-
  MODULE H5A
-
-

PURPOSE

-
  This file contains Fortran interfaces for H5A functions. It includes
-  all the functions that are independent on whether the Fortran 2003 functions
-  are enabled or disabled.
-
-

NOTES

-
                         *** IMPORTANT ***
-  If you add a new H5A function you must add the function name to the
-  Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory.
-  This is needed for Windows based operating systems.
-
- -
- -

h5aclose_f

- -

[ Top ] [ H5A ] [ Subroutines ]

-

NAME

-
  h5aclose_f
-
-

PURPOSE

-
  Closes the specified attribute.
-
-

INPUTS

-
  attr_id  - attribute identifier
-
-

OUTPUTS

-
  hdferr   - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces are added for
-  called C functions (it is needed for Windows
-  port).  February 27, 2001
-
-

SOURCE

-
  SUBROUTINE h5aclose_f(attr_id, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: attr_id  ! Attribute identifier
-    INTEGER, INTENT(OUT) :: hdferr         ! Error code
-
- -
- -

h5acreate_by_name_f

- -

[ Top ] [ H5A ] [ Subroutines ]

-

NAME

-
  h5acreate_by_name_f
-
-

PURPOSE

-
  Creates an attribute attached to a specified object
-
-

INPUTS

-
  loc_id        - Location or object identifier; may be dataset or group
-  obj_name      - Name, relative to loc_id, of object that attribute is to be attached to
-  attr_name     - Attribute name
-  type_id       - Attribute datatype identifier
-  space_id      - Attribute dataspace identifier
-
-

OUTPUTS

-
  attr          - an attribute identifier
-  hdferr        - Returns 0 if successful and -1 if fails
-
-

OPTIONAL PARAMETERS

-
  acpl_id       - Attribute creation property list identifier (Currently not used.)
-  aapl_id       - Attribute access property list identifier (Currently not used.)
-  lapl_id       - Link access property list
-
-

AUTHOR

-
  M. Scot Breitenfeld
-  February, 2008
-
-

SOURCE

-
  SUBROUTINE h5acreate_by_name_f(loc_id, obj_name, attr_name, type_id, space_id, attr, hdferr, &
-       acpl_id, aapl_id, lapl_id)
-    IMPLICIT NONE
-    INTEGER(HID_T),   INTENT(IN)  :: loc_id
-    CHARACTER(LEN=*), INTENT(IN)  :: obj_name
-    CHARACTER(LEN=*), INTENT(IN)  :: attr_name
-    INTEGER(HID_T),   INTENT(IN)  :: type_id
-    INTEGER(HID_T),   INTENT(IN)  :: space_id
-    INTEGER(HID_T),   INTENT(OUT) :: attr
-    INTEGER,          INTENT(OUT) :: hdferr
-
-    INTEGER(HID_T),   INTENT(IN), OPTIONAL :: acpl_id
-    INTEGER(HID_T),   INTENT(IN), OPTIONAL :: aapl_id
-    INTEGER(HID_T),   INTENT(IN), OPTIONAL :: lapl_id
-
- -
- -

h5acreate_f

- -

[ Top ] [ H5A ] [ Subroutines ]

-

NAME

-
  h5acreate_f
-
-

PURPOSE

-
  Creates a dataset as an attribute of a group, dataset, or named datatype
-
-

INPUTS

-
  loc_id        - identifier of an object (group, dataset,
-                  or named datatype) attribute is attached to
-  name          - attribute name
-  type_id       - attribute datatype identifier
-  space_id      - attribute dataspace identifier
-
-

OUTPUTS

-
  attr_id       - attribute identifier
-  hdferr        - Returns 0 if successful and -1 if fails
-
-

OPTIONAL PARAMETERS

-
  acpl_id       - Attribute creation property list identifier
-  appl_id       - Attribute access property list identifier
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces are added for
-  called C functions (it is needed for Windows
-  port).  February 27, 2001
-
-

SOURCE

-
  SUBROUTINE h5acreate_f(loc_id, name, type_id, space_id, attr_id, &
-                                 hdferr, acpl_id, aapl_id )
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: loc_id   ! Object identifier
-    CHARACTER(LEN=*), INTENT(IN) :: name   ! Attribute name
-    INTEGER(HID_T), INTENT(IN) :: type_id  ! Attribute datatype identifier
-    INTEGER(HID_T), INTENT(IN) :: space_id ! Attribute dataspace identifier
-    INTEGER(HID_T), INTENT(OUT) :: attr_id ! Attribute identifier
-    INTEGER, INTENT(OUT) :: hdferr         ! Error code:
-                                           ! 0 on success and -1 on failure
-
- -
- -

h5adelete_by_idx_f

- -

[ Top ] [ H5A ] [ Subroutines ]

-

NAME

-
  h5adelete_by_idx_f
-
-

PURPOSE

-
  Deletes an attribute from an object according to index order
-
-

INPUTS

-
  loc_id        - Location or object identifier; may be dataset or group
-  obj_name      - Name of object, relative to location, from which attribute is to be removed
-  idx_type      - Type of index; Possible values are:
-                   H5_INDEX_UNKNOWN_F = -1  - Unknown index type
-                   H5_INDEX_NAME_F          - Index on names
-                   H5_INDEX_CRT_ORDER_F     - Index on creation order
-                   H5_INDEX_N_F             - Number of indices defined
-
-  order         - Order in which to iterate over index; Possible values are:
-                   H5_ITER_UNKNOWN_F    - Unknown order
-                   H5_ITER_INC_F        - Increasing order
-                   H5_ITER_DEC_F        - Decreasing order
-                   H5_ITER_NATIVE_F     - No particular order, whatever is fastest
-                   H5_ITER_N_F          - Number of iteration orders
-
-  n             - Offset within index
-
-

OUTPUTS

-
  hdferr        - Returns 0 if successful and -1 if fails
-
-

OPTIONAL PARAMETERS

-
  lapl_id       - Link access property list
-
-

AUTHOR

-
  M. Scot Breitenfeld
-  January, 2008
-
-

SOURCE

-
  SUBROUTINE h5adelete_by_idx_f(loc_id, obj_name, idx_type, order, n, hdferr, lapl_id)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: loc_id      ! Identifer for object to which attribute is attached
-    CHARACTER(LEN=*), INTENT(IN) :: obj_name  ! Name of object, relative to location,
-                                              !  from which attribute is to be removed
-    INTEGER, INTENT(IN) :: idx_type           ! Type of index; Possible values are:
-                                              !    H5_INDEX_UNKNOWN_F   - Unknown index type
-                                              !    H5_INDEX_NAME_F      - Index on names
-                                              !    H5_INDEX_CRT_ORDER_F - Index on creation order
-                                              !    H5_INDEX_N_F       - Number of indices defined
-
-    INTEGER, INTENT(IN) :: order              ! Order in which to iterate over index; Possible values are:
-                                              !    H5_ITER_UNKNOWN_F  - Unknown order
-                                              !    H5_ITER_INC_F      - Increasing order
-                                              !    H5_ITER_DEC_F      - Decreasing order
-                                              !    H5_ITER_NATIVE_F   - No particular order, whatever is fastest
-                                              !    H5_ITER_N_F      - Number of iteration orders
-    INTEGER(HSIZE_T), INTENT(IN) :: n         ! Offset within index
-    INTEGER, INTENT(OUT) :: hdferr         ! Error code:
-                                           ! 0 on success and -1 on failure
-    INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list
-
- -
- -

h5adelete_by_name_f

- -

[ Top ] [ H5A ] [ Subroutines ]

-

NAME

-
  h5adelete_by_name_f
-
-

PURPOSE

-
  Removes an attribute from a specified location
-
-

INPUTS

-
  loc_id        - Identifer for object to which attribute is attached
-  obj_name      - Name of attribute to open
-  attr_name     - Attribute access property list
-  lapl_id       - Link access property list
-
-

OUTPUTS

-
  hdferr        - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  M. Scot Breitenfeld
-  January, 2008
-
-

SOURCE

-
  SUBROUTINE h5adelete_by_name_f(loc_id, obj_name, attr_name, hdferr, lapl_id)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: loc_id      ! Identifer for object to which attribute is attached
-    CHARACTER(LEN=*), INTENT(IN) :: obj_name  ! Name of object, relative to location,
-                                              !  from which attribute is to be removed
-    CHARACTER(LEN=*), INTENT(IN) :: attr_name ! Name of attribute to delete
-    INTEGER, INTENT(OUT) :: hdferr            ! Error code:
-                                              ! 0 on success and -1 on failure
-    INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list
-
- -
- -

h5adelete_f

- -

[ Top ] [ H5A ] [ Subroutines ]

-

NAME

-
  h5adelete_f
-
-

PURPOSE

-
  Deletes an attribute of an object (group, dataset or
-  named datatype)
-
-

INPUTS

-
  obj_id        - object identifier
-  name          - attribute name
-
-

OUTPUTS

-
  hdferr        - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces are added for
-  called C functions (it is needed for Windows
-  port).  February 27, 2001
-
-

SOURCE

-
  SUBROUTINE h5adelete_f(obj_id, name, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: obj_id  ! Object identifier
-    CHARACTER(LEN=*), INTENT(IN) :: name  ! Attribute name
-    INTEGER, INTENT(OUT) :: hdferr        ! Error code
-
- -
- -

H5Aexists_by_name_f

- -

[ Top ] [ H5A ] [ Subroutines ]

-

NAME

-
  H5Aexists_by_name_f
-
-

PURPOSE

-
  Determines whether an attribute with a given name exists on an object
-
-

INPUTS

-
  loc_id        - Location identifier
-  obj_name      - Object name either relative to loc_id, absolute from the file’s root group, or '.' (a dot)
-  attr_name     - Attribute name
-
-

OUTPUTS

-
  attr_exists   - attribute exists status
-  hdferr        - Returns 0 if successful and -1 if fails
-
-

OPTIONAL PARAMETERS

-
  lapl_id       - Link access property list identifier
-
-

AUTHOR

-
  M. Scot Breitenfeld
-  February, 2008
-
-

SOURCE

-
  SUBROUTINE h5aexists_by_name_f(loc_id, obj_name, attr_name, attr_exists, hdferr, lapl_id)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: loc_id     ! Location identifier
-    CHARACTER(LEN=*), INTENT(IN) :: obj_name ! Object name either relative to loc_id,
-                                             ! absolute from the fileâs root group, or '.'
-    CHARACTER(LEN=*), INTENT(IN) :: attr_name ! Attribute name
-    LOGICAL, INTENT(OUT) :: attr_exists ! .TRUE. if exists, .FALSE. otherwise
-    INTEGER, INTENT(OUT) :: hdferr      ! Error code:
-                                        ! 0 on success and -1 on failure
-    INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list identifier
-
- -
- -

H5Aexists_f

- -

[ Top ] [ H5A ] [ Subroutines ]

-

NAME

-
  H5Aexists_f
-
-

PURPOSE

-
  Determines whether an attribute with a given name exists on an object
-
-

INPUTS

-
  obj_id        - Object identifier
-  attr_name     - Attribute name
-
-

OUTPUTS

-
  attr_exists   - attribute exists status
-  hdferr        - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  M. Scot Breitenfeld
-  February, 2008
-
-

SOURCE

-
  SUBROUTINE h5aexists_f(obj_id, attr_name, attr_exists, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: obj_id      ! Object identifier
-    CHARACTER(LEN=*), INTENT(IN) :: attr_name ! Attribute name
-    LOGICAL, INTENT(OUT) :: attr_exists  ! .TRUE. if exists, .FALSE. otherwise
-    INTEGER, INTENT(OUT) :: hdferr       ! Error code:
-                                         ! 0 on success and -1 on failure
-
- -
- -

h5aget_create_plist_f

- -

[ Top ] [ H5A ] [ Subroutines ]

-

NAME

-
  h5aget_create_plist_f
-
-

PURPOSE

-
  Gets an attribute creation property list identifier
-
-

INPUTS

-
  attr_id          - Identifier of the attribute
-
-

OUTPUTS

-
  creation_prop_id - Identifier for the attribute’s creation property
-  hdferr           - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  M. Scot Breitenfeld
-  January, 2008
-
-

SOURCE

-
  SUBROUTINE h5aget_create_plist_f(attr_id, creation_prop_id, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: attr_id  ! Identifier of the attribute
-    INTEGER(HID_T), INTENT(OUT) :: creation_prop_id   ! Identifier for the attributeâs creation property
-    INTEGER, INTENT(OUT) :: hdferr       ! Error code
-                                         ! 0 on success and -1 on failure
-
- -
- -

h5aget_info_by_idx_f

- -

[ Top ] [ H5A ] [ Subroutines ]

-

NAME

-
  h5aget_info_by_idx_f
-
-

PURPOSE

-
  Retrieves attribute information, by attribute index position
-
-

INPUTS

-
  loc_id        - Location of object to which attribute is attached
-  obj_name      - Name of object to which attribute is attached, relative to location
-  idx_type      - Type of index
-  order         - Index traversal order
-  n             - Attribute’s position in index
-
- OUTPUTS  NOTE: In C it is defined as a structure: H5A_info_t
-  corder_valid  - indicates whether the creation order data is valid for this attribute
-  corder        - is a positive integer containing the creation order of the attribute
-  cset          - indicates the character set used for the attribute’s name
-  data_size     - indicates the size, in the number of characters, of the attribute
-  hdferr        - Returns 0 if successful and -1 if fails
-
-

OPTIONAL PARAMETERS

-
  lapl_id       - Link access property list
-
-

AUTHOR

-
  M. Scot Breitenfeld
-  January, 2008
-
-

SOURCE

-
  SUBROUTINE h5aget_info_by_idx_f(loc_id, obj_name, idx_type, order, n, &
-       f_corder_valid, corder, cset, data_size, hdferr, lapl_id)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: loc_id      ! Object identifier
-    CHARACTER(LEN=*), INTENT(IN) :: obj_name  ! Name of object to which attribute is attached
-    INTEGER, INTENT(IN) :: idx_type           ! Type of index; Possible values are:
-                                              !    H5_INDEX_UNKNOWN_F   - Unknown index type
-                                              !    H5_INDEX_NAME_F      - Index on names
-                                              !    H5_INDEX_CRT_ORDER_F - Index on creation order
-                                              !    H5_INDEX_N_F       - Number of indices defined
-    INTEGER, INTENT(IN) :: order              ! Order in which to iterate over index; Possible values are:
-                                              !    H5_ITER_UNKNOWN_F  - Unknown order
-                                              !    H5_ITER_INC_F      - Increasing order
-                                              !    H5_ITER_DEC_F      - Decreasing order
-                                              !    H5_ITER_NATIVE_F   - No particular order, whatever is fastest
-
-    INTEGER(HSIZE_T), INTENT(IN) :: n         ! Attributeâs position in index
-
-
-    LOGICAL, INTENT(OUT) :: f_corder_valid ! Indicates whether the creation order data is valid for this attribute
-    INTEGER, INTENT(OUT) :: corder ! Is a positive integer containing the creation order of the attribute
-    INTEGER, INTENT(OUT) :: cset   ! Indicates the character set used for the attributeâs name
-    INTEGER(HSIZE_T), INTENT(OUT) :: data_size ! Indicates the size, in the number of characters, of the attribute
-    INTEGER, INTENT(OUT) :: hdferr       ! Error code:
-                                         ! 0 on success and -1 on failure
-    INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id  ! Link access property list
-
- -
- -

h5aget_info_by_name_f

- -

[ Top ] [ H5A ] [ Subroutines ]

-

NAME

-
  h5aget_info_by_name_f
-
-

PURPOSE

-
  Retrieves attribute information, by attribute name
-
-

INPUTS

-
  loc_id        - Location of object to which attribute is attached
-  obj_name      - Name of object to which attribute is attached, relative to location
-  attr_name     - Attribute name
-
- OUTPUTS  NOTE: In C it is defined as a structure: H5A_info_t
-  corder_valid  - indicates whether the creation order data is valid for this attribute
-  corder        - is a positive integer containing the creation order of the attribute
-  cset          - indicates the character set used for the attribute’s name
-  data_size     - indicates the size, in the number of characters, of the attribute
-  hdferr        - Returns 0 if successful and -1 if fails
-
-

OPTIONAL PARAMETERS

-
  lapl_id       - Link access property list
-
-

AUTHOR

-
  M. Scot Breitenfeld
-  January, 2008
-
-

SOURCE

-
  SUBROUTINE h5aget_info_by_name_f(loc_id, obj_name, attr_name, &
-       f_corder_valid, corder, cset, data_size, hdferr, lapl_id)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: loc_id    ! Object identifier
-    CHARACTER(LEN=*), INTENT(IN) :: obj_name ! Name of object to which attribute is attached
-    CHARACTER(LEN=*), INTENT(IN) :: attr_name ! Attribute name
-
-
-    LOGICAL, INTENT(OUT) :: f_corder_valid ! Indicates whether the creation order data is valid for this attribute
-    INTEGER, INTENT(OUT) :: corder ! Is a positive integer containing the creation order of the attribute
-    INTEGER, INTENT(OUT) :: cset ! Indicates the character set used for the attributeâs name
-    INTEGER(HSIZE_T), INTENT(OUT) :: data_size   ! Indicates the size, in the number of characters, of the attribute
-    INTEGER, INTENT(OUT) :: hdferr         ! Error code:
-                                           ! 0 on success and -1 on failure
-    INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id  ! Link access property list
-
- -
- -

h5aget_info_f

- -

[ Top ] [ H5A ] [ Subroutines ]

-

NAME

-
  h5aget_info_f
-
-

PURPOSE

-
  Retrieves attribute information, by attribute identifier
-
-

INPUTS

-
  attr_id       - attribute identifier
-
-

OUTPUTS

-
  NOTE: In C it is defined as a structure: H5A_info_t
-
-  corder_valid  - indicates whether the creation order data is valid for this attribute
-  corder        - is a positive integer containing the creation order of the attribute
-  cset          - indicates the character set used for the attribute’s name
-  data_size     - indicates the size, in the number of characters, of the attribute
-  hdferr        - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  M. Scot Breitenfeld
-  January, 2008
-
-

SOURCE

-
  SUBROUTINE h5aget_info_f(attr_id, f_corder_valid, corder, cset, data_size, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: attr_id  ! Attribute identifier
-
-    LOGICAL, INTENT(OUT) :: f_corder_valid ! Indicates whether the creation order data is valid for this attribute
-    INTEGER, INTENT(OUT) :: corder ! Is a positive integer containing the creation order of the attribute
-    INTEGER, INTENT(OUT) :: cset   ! Indicates the character set used for the attributeâs name
-    INTEGER(HSIZE_T), INTENT(OUT) :: data_size ! Indicates the size, in the number of characters, of the attribute
-    INTEGER, INTENT(OUT) :: hdferr       ! Error code:
-                                         ! 0 on success and -1 on failure
-
- -
- -

h5aget_name_by_idx_f

- -

[ Top ] [ H5A ] [ Subroutines ]

-

NAME

-
  h5aget_name_by_idx_f
-
-

PURPOSE

-
  Gets an attribute name, by attribute index position.
-
-

INPUTS

-
  loc_id        - Location of object to which attribute is attached
-  obj_name      - Name of object to which attribute is attached, relative to location
-  idx_type      - Type of index; Possible values are:
-                   H5_INDEX_UNKNOWN_F = -1  - Unknown index type
-                   H5_INDEX_NAME_F          - Index on names
-                   H5_INDEX_CRT_ORDER_F     - Index on creation order
-                   H5_INDEX_N_F             - Number of indices defined
-
-  order         - Order in which to iterate over index; Possible values are:
-                   H5_ITER_UNKNOWN_F    - Unknown order
-                   H5_ITER_INC_F        - Increasing order
-                   H5_ITER_DEC_F        - Decreasing order
-                   H5_ITER_NATIVE_F     - No particular order, whatever is fastest
-                   H5_ITER_N_F          - Number of iteration orders
-  order         - Index traversal order
-  n             - Attribute’s position in index
-
-

OUTPUTS

-
  name          - Attribute name
-  hdferr        - Returns 0 if successful and -1 if fails
-
-

OPTIONAL PARAMETERS

-
  lapl_id       - Link access property list
-  size          - Size, in bytes, of attribute name
-
-

AUTHOR

-
  M. Scot Breitenfeld
-  January, 2008
-
-

SOURCE

-
  SUBROUTINE h5aget_name_by_idx_f(loc_id, obj_name, idx_type, order, &
-       n, name, hdferr, size, lapl_id)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: loc_id      ! Identifer for object to which attribute is attached
-    CHARACTER(LEN=*), INTENT(IN) :: obj_name  ! Name of object, relative to location,
-                                              !  from which attribute is to be removed *TEST* check NULL
-    INTEGER, INTENT(IN) :: idx_type ! Type of index; Possible values are:
-                                    !    H5_INDEX_UNKNOWN_F   - Unknown index type
-                                    !    H5_INDEX_NAME_F       - Index on names
-                                    !    H5_INDEX_CRT_ORDER_F  - Index on creation order
-                                    !    H5_INDEX_N_F         - Number of indices defined
-
-    INTEGER, INTENT(IN) :: order    ! Order in which to iterate over index; Possible values are:
-                                    !    H5_ITER_UNKNOWN_F   - Unknown order
-                                    !    H5_ITER_INC_F      - Increasing order
-                                    !    H5_ITER_DEC_F       - Decreasing order
-                                    !    H5_ITER_NATIVE_F    - No particular order, whatever is fastest
-                                    !    H5_ITER_N_F        - Number of iteration orders
-    INTEGER(HSIZE_T), INTENT(IN) :: n !  Attributeâs position in index
-    CHARACTER(LEN=*), INTENT(OUT) :: name ! Attribute name
-    INTEGER, INTENT(OUT) :: hdferr    ! Error code:
-                                      ! Returns attribute name size,
-                                      ! -1 if fail
-    INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list
-    INTEGER(SIZE_T), OPTIONAL, INTENT(OUT) :: size  ! Indicates the size, in the number of characters, 
-                                                    ! of the attribute
-
- -
- -

h5aget_name_f

- -

[ Top ] [ H5A ] [ Subroutines ]

-

NAME

-
  h5aget_name_f
-
-

PURPOSE

-
  Gets an attribute name.
-
-

INPUTS

-
  attr_id       - attribute identifier
-  size          - size of a buffer to read name in
-
-

OUTPUTS

-
  buf           - buffer to read name in
-  hdferr        - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces are added for
-  called C functions (it is needed for Windows
-  port).  February 27, 2001
-
-

SOURCE

-
  SUBROUTINE h5aget_name_f(attr_id, size, buf, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: attr_id  ! Attribute identifier
-    INTEGER(SIZE_T), INTENT(IN) :: size    ! Buffer size
-    CHARACTER(LEN=*), INTENT(INOUT) :: buf ! Buffer to hold attribute name
-    INTEGER, INTENT(OUT) :: hdferr ! Error code:
-                                   ! name length is successful, -1 if fail
-
- -
- -

h5aget_num_attrs_f

- -

[ Top ] [ H5A ] [ Subroutines ]

-

NAME

-
  h5aget_num_attrs_f
-
-

PURPOSE

-
  Determines the number of attributes attached to an object.
-
-

INPUTS

-
  obj_id        - object (group, dataset, or named datatype)
-  identifier
-
-

OUTPUTS

-
  attr_num      - number of attributes attached to the object
-  hdferr        - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces are added for
-  called C functions (it is needed for Windows
-  port).  February 27, 2001
-
-

SOURCE

-
  SUBROUTINE h5aget_num_attrs_f(obj_id, attr_num, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: obj_id  ! Object identifier
-    INTEGER, INTENT(OUT) :: attr_num      ! Number of attributes of the object
-    INTEGER, INTENT(OUT) :: hdferr        ! Error code
-
- -
- -

h5aget_space_f

- -

[ Top ] [ H5A ] [ Subroutines ]

-

NAME

-
  h5aget_space_f
-
-

PURPOSE

-
  Gets a copy of the dataspace for an attribute.
-
-

INPUTS

-
  attr_id       - attribute identifier
-
-

OUTPUTS

-
  space_id      - attribite dataspace identifier
-  hdferr        - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces are added for
-  called C functions (it is needed for Windows
-  port).  February 27, 2001
-
-

SOURCE

-
  SUBROUTINE h5aget_space_f(attr_id, space_id, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: attr_id   ! Attribute identifier
-    INTEGER(HID_T), INTENT(OUT) :: space_id ! Attribute dataspace identifier
-    INTEGER, INTENT(OUT) :: hdferr          ! Error code
-
- -
- -

h5aget_storage_size_f

- -

[ Top ] [ H5A ] [ Subroutines ]

-

NAME

-
  h5aget_storage_size_f
-
-

PURPOSE

-
  Returns the amount of storage required for an attribute.
-
-

INPUTS

-
  attr_id       - attribute identifier
-
-

OUTPUTS

-
  size          - attribute storage size
-  hdferr        - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  M. Scot Breitenfeld
-  January, 2008
-
-

SOURCE

-
  SUBROUTINE h5aget_storage_size_f(attr_id, size, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: attr_id  ! Attribute identifier
-    INTEGER(HSIZE_T), INTENT(OUT) :: size  ! Attribute storage requirement
-    INTEGER, INTENT(OUT) :: hdferr         ! Error code
-
- -
- -

h5aget_type_f

- -

[ Top ] [ H5A ] [ Subroutines ]

-

NAME

-
  h5aget_type_f
-
-

PURPOSE

-
  Gets an attribute datatype.
-
-

INPUTS

-
  attr_id       - attribute identifier
-
-

OUTPUTS

-
  type_id       - attribute datatype identifier
-  hdferr        - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces are added for
-  called C functions (it is needed for Windows
-  port).  February 27, 2001
-
-

SOURCE

-
  SUBROUTINE h5aget_type_f(attr_id, type_id, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: attr_id  ! Attribute identifier
-    INTEGER(HID_T), INTENT(OUT) :: type_id ! Attribute datatype identifier
-    INTEGER, INTENT(OUT) :: hdferr         ! Error code
-
- -
- -

h5aopen_by_idx_f

- -

[ Top ] [ H5A ] [ Subroutines ]

-

NAME

-
  h5aopen_by_idx_f
-
-

PURPOSE

-
  Opens an existing attribute that is attached to an object specified by location and name
-
-

INPUTS

-
  loc_id        - Location of object to which attribute is attached
-  obj_name      - Name of object to which attribute is attached, relative to location
-  idx_type      - Type of index
-  order         - Index traversal order
-  n             - Attribute’s position in index
-
-

OUTPUTS

-
  hdferr        - Returns 0 if successful and -1 if fails
-
-

OPTIONAL PARAMETERS

-
  aapl_id       - Attribute access property list
-  lapl_id       - Link access property list
-
-

AUTHOR

-
  M. Scot Breitenfeld
-  January, 2008
-
-

SOURCE

-
  SUBROUTINE h5aopen_by_idx_f(loc_id, obj_name, idx_type, order, n, attr_id, hdferr, aapl_id, lapl_id)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: loc_id      ! Object identifier
-    CHARACTER(LEN=*), INTENT(IN) :: obj_name  ! Name of object to which attribute is attached
-    INTEGER, INTENT(IN) :: idx_type           ! Type of index; Possible values are:
-                                              !    H5_INDEX_UNKNOWN_F   - Unknown index type
-                                              !    H5_INDEX_NAME_F      - Index on names
-                                              !    H5_INDEX_CRT_ORDER_F - Index on creation order
-                                              !    H5_INDEX_N_F       - Number of indices defined
-    INTEGER, INTENT(IN) :: order              ! Order in which to iterate over index; Possible values are:
-                                              !    H5_ITER_UNKNOWN_F  - Unknown order
-                                              !    H5_ITER_INC_F      - Increasing order
-                                              !    H5_ITER_DEC_F      - Decreasing order
-                                              !    H5_ITER_NATIVE_F   - No particular order, whatever is fastest
-
-    INTEGER(HSIZE_T), INTENT(IN) :: n       ! Attributeâs position in index
-
-    INTEGER(HID_T), INTENT(OUT) :: attr_id  ! Attribute identifier
-    INTEGER, INTENT(OUT) :: hdferr          ! Error code:
-                                            ! 0 on success and -1 on failure
-    INTEGER(HID_T), OPTIONAL, INTENT(IN) :: aapl_id  ! Attribute access property list
-    INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id  ! Link access property list
-
- -
- -

H5Aopen_by_name_f

- -

[ Top ] [ H5A ] [ Subroutines ]

-

NAME

-
  H5Aopen_by_name_f
-
-

PURPOSE

-
  Opens an attribute for an object by object name and attribute name.
-
-

INPUTS

-
  loc_id        - Location from which to find object to which attribute is attached
-  obj_name      - Object name either relative to loc_id, absolute from the file’s root group, or '.' (a dot)
-  attr_name     - Attribute name
-
-

OUTPUTS

-
  attr_id       - attribute identifier
-  hdferr        - Returns 0 if successful and -1 if fails
-
-

OPTIONAL PARAMETERS

-
  aapl_id       - Attribute access property list (Currently unused; should be passed in as H5P_DEFAULT.)
-  lapl_id       - Link access property list identifier
-
-

AUTHOR

-
  M. Scot Breitenfeld
-  February, 2008
-
-

SOURCE

-
  SUBROUTINE h5aopen_by_name_f(loc_id, obj_name, attr_name, attr_id, hdferr, aapl_id, lapl_id)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: loc_id    ! Location identifier
-    CHARACTER(LEN=*), INTENT(IN) :: obj_name ! Object name either relative to loc_id,
-                                             ! absolute from the fileâs root group, or '.'
-    CHARACTER(LEN=*), INTENT(IN) :: attr_name ! Attribute name
-    INTEGER(HID_T), INTENT(OUT) :: attr_id ! Attribute identifier
-    INTEGER, INTENT(OUT) :: hdferr         ! Error code:
-                                           ! 0 on success and -1 on failure
-    INTEGER(HID_T), OPTIONAL, INTENT(IN) :: aapl_id ! Attribute access property list
-                                                    ! (Currently unused; should be passed in as H5P_DEFAULT_F)
-    INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list identifier
-
- -
- -

h5aopen_f

- -

[ Top ] [ H5A ] [ Subroutines ]

-

NAME

-
  h5aopen_f
-
-

PURPOSE

-
  Opens an attribute for an object specified by object
-  identifier and attribute name
-
-

INPUTS

-
  obj_id        - Identifer for object to which attribute is attached
-  attr_name     - Name of attribute to open
-
-

OUTPUTS

-
  attr_id       - attribute identifier
-
-

OPTIONAL PARAMETERS

-
  aapl_id       - Attribute access property list
-  hdferr        - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  M. Scot Breitenfeld
-  January, 2008
-
-

SOURCE

-
  SUBROUTINE h5aopen_f(obj_id, attr_name, attr_id, hdferr, aapl_id)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: obj_id      ! Object identifier
-    CHARACTER(LEN=*), INTENT(IN) :: attr_name ! Attribute name
-    INTEGER(HID_T), INTENT(OUT) :: attr_id    ! Attribute identifier
-    INTEGER, INTENT(OUT) :: hdferr            ! Error code
-                                              !   Success:  0
-                                              !   Failure: -1
-    INTEGER(HID_T), OPTIONAL, INTENT(IN) :: aapl_id     ! Attribute access property list
-
- -
- -

h5aopen_idx_f

- -

[ Top ] [ H5A ] [ Subroutines ]

-

NAME

-
  h5aopen_idx_f
-
-

PURPOSE

-
  Opens the attribute specified by its index.
-
-

INPUTS

-
  obj_id        - identifier of a group, dataset, or named
-                  datatype an attribute to be attached to
-  index         - index of the attribute to open (zero-based)
-
-

OUTPUTS

-
  attr_id       - attribute identifier
-  hdferr        - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces are added for
-  called C functions (it is needed for Windows
-  port).  February 27, 2001
-
-

SOURCE

-
  SUBROUTINE h5aopen_idx_f(obj_id, index, attr_id, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: obj_id    ! Object identifier
-    INTEGER, INTENT(IN) :: index            ! Attribute index
-    INTEGER(HID_T), INTENT(OUT) :: attr_id  ! Attribute identifier
-    INTEGER, INTENT(OUT) :: hdferr          ! Error code
-
- -
- -

h5aopen_name_f

- -

[ Top ] [ H5A ] [ Subroutines ]

-

NAME

-
  h5aopen_name_f
-
-

PURPOSE

-
  Opens an attribute specified by name.
-
-

INPUTS

-
  obj_id        - identifier of a group, dataset, or named
-                  datatype atttribute to be attached to
-  name          - attribute name
-
-

OUTPUTS

-
  attr_id       - attribute identifier
-  hdferr        - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces are added for
-  called C functions (it is needed for Windows
-  port).  February 27, 2001
-
-

SOURCE

-
  SUBROUTINE h5aopen_name_f(obj_id, name, attr_id, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: obj_id    ! Object identifier
-    CHARACTER(LEN=*), INTENT(IN) :: name    ! Attribute name
-    INTEGER(HID_T), INTENT(OUT) :: attr_id  ! Attribute identifier
-    INTEGER, INTENT(OUT) :: hdferr          ! Error code
-
- -
- -

h5arename_by_name_f

- -

[ Top ] [ H5A ] [ Subroutines ]

-

NAME

-
  h5arename_by_name_f
-
-

PURPOSE

-
  Renames an attribute
-
-

INPUTS

-
  loc_id        - Location or object identifier; may be dataset or group
-  obj_name      - Name of object, relative to location,
-                  whose attribute is to be renamed
-  old_attr_name - Prior attribute name
-  new_attr_name - New attribute name
-  lapl_id       - Link access property list identifier
-
-

OUTPUTS

-
  hdferr        - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  M. Scot Breitenfeld
-  January, 2008
-
-

SOURCE

-
  SUBROUTINE h5arename_by_name_f(loc_id, obj_name, old_attr_name, new_attr_name, &
-        hdferr, lapl_id)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: loc_id    ! Object identifier
-    CHARACTER(LEN=*), INTENT(IN) :: obj_name  ! Name of object, relative to location,
-                                              !  whose attribute is to be renamed
-    CHARACTER(LEN=*), INTENT(IN) :: old_attr_name ! Prior attribute name
-    CHARACTER(LEN=*), INTENT(IN) :: new_attr_name ! New attribute name
-
-    INTEGER, INTENT(OUT) :: hdferr       ! Error code:
-                                         ! 0 on success and -1 on failure
-    INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list identifier
-
- -
- -

h5arename_f

- -

[ Top ] [ H5A ] [ Subroutines ]

-

NAME

-
  h5arename_f
-
-

PURPOSE

-
  Renames an attribute
-
-

INPUTS

-
  loc_id        - Location or object identifier; may be dataset or group
-  old_attr_name - Prior attribute name
-  new_attr_name - New attribute name
-
-

OUTPUTS

-
  hdferr        - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  M. Scot Breitenfeld
-  January, 2008
-
-

HISTORY

-
  N/A
-
-

SOURCE

-
  SUBROUTINE h5arename_f(loc_id, old_attr_name, new_attr_name, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: loc_id    ! Object identifier
-    CHARACTER(LEN=*), INTENT(IN) :: old_attr_name ! Prior attribute name
-    CHARACTER(LEN=*), INTENT(IN) :: new_attr_name ! New attribute name
-    INTEGER, INTENT(OUT) :: hdferr       ! Error code:
-                                         ! 0 on success and -1 on failure
-
- -
- - - diff --git a/fortran/doc/DevelGuide/src/H5Df_c.html b/fortran/doc/DevelGuide/src/H5Df_c.html deleted file mode 100644 index 1e163f2..0000000 --- a/fortran/doc/DevelGuide/src/H5Df_c.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - -./src/H5Df.c - - - - - -
-
- -

H5Df

- -

[ Top ] [ Modules ]

-

PURPOSE

-
   This file contains C stubs for H5D Fortran APIs
-
- -
- - - diff --git a/fortran/doc/DevelGuide/src/H5Dff_F03_f90.html b/fortran/doc/DevelGuide/src/H5Dff_F03_f90.html deleted file mode 100644 index 0bb4173..0000000 --- a/fortran/doc/DevelGuide/src/H5Dff_F03_f90.html +++ /dev/null @@ -1,138 +0,0 @@ - - - - - - - -./src/H5Dff_F03.f90 - - - - - -
-
- -

H5D (F03)

- -

[ Top ] [ Modules ]

-

NAME

-
  H5D_PROVISIONAL
-
-

PURPOSE

-
  This file contains Fortran 90 and Fortran 2003 interfaces for H5D functions.
-  It contains the same functions as H5Dff_DEPRECIATE.f90 but includes the
-  Fortran 2003 functions and the interface listings. This file will be compiled
-  instead of H5Dff_DEPRECIATE.f90 if Fortran 2003 functions are enabled.
-
-

NOTES

-
  (1) The maximum rank of an array allowed in Fortran is 7, therefore
-  we only provide an interface for arrays up to and including rank 7.
-
-  (2) Unfortunately we are using a generic interface and one of the factors
-  used in determining the proper routine to select is that of the array
-  rank being passed. Therefore, we can not create just one subroutine for
-  each array type (integer, real, etc...) and use a
-  rank 1 array of assumed size to handle multiple ranks, i.e.
-  (i.e. integer, dimension(*) :: ... )
-  (i.e. real   , dimension(*) :: ... ) etc...
-
-  (3) Could not place the USE ISO_C_BINDING in the module header because it may
-  conflict with the USE ISO_C_BINDING included in the user's program. Moved
-  the statement instead to each subroutine.
-
-
-  (4) C_LOC and character strings according to the Fortran 2003 standard:
-
-  15.1.2.5 C_LOC(X)
-
-  Argument. X shall either
-
-  (A) have interoperable type and type parameters and be
-  (a) a variable that has the TARGET attribute and is interoperable,
-  (b) an allocated allocatable variable that has the TARGET attribute
-  and is not an array of zero size, or
-  (c) an associated scalar pointer, or
-  (B) be a nonpolymorphic scalar, have no length type parameters, and be
-  (a) a nonallocatable, nonpointer variable that has the TARGET attribute,
-  (b) an allocated allocatable variable that has the TARGET attribute, or
-  (c) an associated pointer.
-
-        - When X is a character, for interoperability the standard is:
-
-  15.2.1 Interoperability of intrinsic types
-
-  ...if the type is character, interoperability also requires that the length type parameter
-  be omitted or be specified by an initialization expression whose value is one.
-
-  THEREFORE compilers that have not extended the standard require the
-  argument in C_LOC to be of the variant:
-
-  CHARACTER(LEN=1), TARGET :: chr
-  or
-  CHARACTER, TARGET :: chr
-  (B)
-                         *** IMPORTANT ***
-  If you add a new H5D function you must add the function name to the
-  Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory.
-  This is needed for Windows based operating systems.
-
- -
- -

h5dvlen_reclaim

- -

[ Top ] [ H5D ] [ Subroutines ]

-

NAME

-
  h5dvlen_reclaim
-
-

PURPOSE

-
  Reclaims VL datatype memory buffers. 
-
-

INPUTS

-
  type_id  - Identifier of the datatype. 
-  space_id - Identifier of the dataspace. 
-  plist_id - Identifier of the property list used to create the buffer. 
-       buf - Pointer to the buffer to be reclaimed. 
-
-

OUTPUTS

-
  hdferr   - error code
-               Success:  0
-               Failure: -1
-
-

AUTHOR

-
 M. Scot Breitenfeld
- January 11, 2011
-
-

SOURCE

-
  SUBROUTINE H5Dvlen_reclaim_f(type_id, space_id, plist_id, buf, hdferr)
-
-    USE ISO_C_BINDING
-    IMPLICIT NONE
-
-    INTEGER(HID_T), INTENT(IN) :: type_id   ! Identifier of the datatype. 
-    INTEGER(HID_T), INTENT(IN) :: space_id  ! Identifier of the dataspace. 
-    INTEGER(HID_T), INTENT(IN) :: plist_id  ! Identifier of the property list used to create the buffer. 
-    TYPE(C_PTR), INTENT(INOUT) :: buf       ! Pointer to the buffer to be reclaimed. 
-    INTEGER, INTENT(OUT) :: hdferr          ! Error code.
-
- -
- - - diff --git a/fortran/doc/DevelGuide/src/H5Dff_F90_f90.html b/fortran/doc/DevelGuide/src/H5Dff_F90_f90.html deleted file mode 100644 index afebdd8..0000000 --- a/fortran/doc/DevelGuide/src/H5Dff_F90_f90.html +++ /dev/null @@ -1,116 +0,0 @@ - - - - - - - -./src/H5Dff_F90.f90 - - - - - -
-
- -

H5D (F90)

- -

[ Top ] [ Modules ]

-

NAME

-
  H5D_PROVISIONAL
-
-

PURPOSE

-
  This file contains Fortran 90 interfaces for H5D functions. It contains
-  the same functions as H5Dff_F03.f90 but excludes the Fortran 2003 functions
-  and the interface listings. This file will be compiled instead of H5Dff_F03.f90
-  if Fortran 2003 functions are not enabled.
-
-

NOTES

-
  (1) The maximum rank of an array allowed in Fortran is 7, therefore
-  we only provide an interface for arrays up to and including rank 7.
-
-  (2) Unfortunately we are using a generic interface and one of the factors
-  used in determining the proper routine to select is that of the array
-  rank being passed, therefore we can not create just one subroutine for
-  each array type (integer, real, etc...) of various ranks and then use a
-  rank 1 array of assumed size in the just one subroutine,
-  (i.e. integer, dimension(*) :: ... )
-  (i.e. real   , dimension(*) :: ... ) etc...
-
-  (3)
-                         *** IMPORTANT ***
-  If you add a new H5D function you must add the function name to the
-  Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory.
-  This is needed for Windows based operating systems.
-
- -
- -

h5dread_f

- -

[ Top ] [ H5D ] [ Subroutines ]

-

NAME

-
  h5dread_f
-
-

PURPOSE

-
  Reads raw data from the specified dataset into buf,
-  converting from file datatype and dataspace to memory
-  datatype and dataspace.
-
-

INPUTS

-
  dset_id       - dataset identifier
-  mem_type_id   - memory type identifier
-  dims          - 1-dim array of size 7; dims(k) has the size
-                  of k-th dimension of the buf array
-
-

OUTPUTS

-
  buf     - buffer to read data in
-  hdferr: - error code
-             Success:  0
-             Failure: -1
-
-

OPTIONAL PARAMETERS

-
  mem_space_id  - memory dataspace identifier
-  file_space_id - file dataspace identifier
-  xfer_prp      - trasfer property list identifier
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces were added for
-  called C functions (it is needed for Windows
-  port).  February 28, 2001
-
-  dims parameter was added to make code portable;
-  n parameter was replaced with dims parameter in
-  the h5dwrite_reference_obj and h5dwrite_reference_dsetreg
-  functions.  April 2, 2001
-
-

NOTES

-
  This function is overloaded to read INTEGER,
-  REAL, DOUBLE PRECISION and CHARACTER buffers
-  up to 7 dimensions, and one dimensional buffers
-  of the TYPE(hobj_ref_t_f) and TYPE(hdset_reg_ref_t_f) types.
-
- -
- - - diff --git a/fortran/doc/DevelGuide/src/H5Dff_f90.html b/fortran/doc/DevelGuide/src/H5Dff_f90.html deleted file mode 100644 index 5444a93..0000000 --- a/fortran/doc/DevelGuide/src/H5Dff_f90.html +++ /dev/null @@ -1,506 +0,0 @@ - - - - - - - -./src/H5Dff.f90 - - - - - -
-
- -

H5D

- -

[ Top ] [ Modules ]

-

NAME

-
  MODULE H5D
-
-

FILE

-
  fortran/src/H5Dff.f90
-
-

PURPOSE

-
  This file contains Fortran interfaces for H5D functions. It includes
-  all the functions that are independent on whether the Fortran 2003 functions
-  are enabled or disabled.
-
-

NOTES

-
                         *** IMPORTANT ***
-  If you add a new H5D function you must add the function name to the
-  Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory.
-  This is needed for Windows based operating systems.
-
- -
- -

h5dclose_f

- -

[ Top ] [ H5D ] [ Subroutines ]

-

NAME

-
  h5dclose_f
-
-

PURPOSE

-
  Closes a dataset.
-
-

INPUTS

-
  dset_id       - dataset identifier
-
-

OUTPUTS

-
  hdferr        - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces were added for
-  called C functions (it is needed for Windows
-  port).  February 28, 2001
-
-

SOURCE

-
  SUBROUTINE h5dclose_f(dset_id, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier
-    INTEGER, INTENT(OUT) :: hdferr        ! Error code
-
- -
- -

h5dcreate_anon_f

- -

[ Top ] [ H5D ] [ Subroutines ]

-

NAME

-
  h5dcreate_anon_f
-
-

PURPOSE

-
  Creates a dataset in a file without linking it into the file structure
-
-

INPUTS

-
  loc_id        - Identifier of the file or group within which to create the dataset.
-  type_id       - Identifier of the datatype to use when creating the dataset.
-  space_id      - Identifier of the dataspace to use when creating the dataset.
-
-

OUTPUTS

-
  dset_id       - dataset identifier
-  hdferr        - Returns 0 if successful and -1 if fails
-
-

OPTIONAL PARAMETERS

-
  dcpl_id       - Dataset creation property list identifier.
-  dapl_id       - Dataset access property list identifier.
-
-

AUTHOR

-
  M. Scot Breitenfeld
-  February 11, 2008
-
-

SOURCE

-
  SUBROUTINE h5dcreate_anon_f(loc_id, type_id, space_id, dset_id, hdferr, dcpl_id, dapl_id)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: loc_id   ! File or group identifier.
-    INTEGER(HID_T), INTENT(IN) :: type_id  ! Datatype identifier.
-    INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier.
-    INTEGER(HID_T), INTENT(OUT) :: dset_id ! Dataset identifier.
-    INTEGER, INTENT(OUT) :: hdferr         ! Error code.
-    INTEGER(HID_T), OPTIONAL, INTENT(IN) :: dcpl_id  ! Dataset creation property list identifier.
-    INTEGER(HID_T), OPTIONAL, INTENT(IN) :: dapl_id  ! Dataset access property list identifier.
-
- -
- -

h5dcreate_f

- -

[ Top ] [ H5D ] [ Subroutines ]

-

NAME

-
  h5dcreate_f
-
-

PURPOSE

-
  Creates a dataset at the specified location
-
-

INPUTS

-
  loc_id        - file or group identifier
-  name          - dataset name
-  type_id       - dataset datatype identifier
-  space_id      - dataset dataspace identifier
-
-

OUTPUTS

-
  dset_id       - dataset identifier
-  hdferr        - Returns 0 if successful and -1 if fails
-
-

OPTIONAL PARAMETERS

-
  creation_prp  - Dataset creation property list
-  lcpl_id       - Link creation property list
-  dapl_id       - Dataset access property list
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  - Explicit Fortran interfaces were added for
-    called C functions (it is needed for Windows
-    port).  February 28, 2001
-
-  - Added version's 1.8 new optional parameters
-    February, 2008
-
-

SOURCE

-
  SUBROUTINE h5dcreate_f(loc_id, name, type_id, space_id, dset_id, &
-       hdferr, dcpl_id, lcpl_id, dapl_id)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: loc_id   ! File or group identifier
-    CHARACTER(LEN=*), INTENT(IN) :: name   ! Name of the dataset
-    INTEGER(HID_T), INTENT(IN) :: type_id  ! Datatype identifier
-    INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier
-    INTEGER(HID_T), INTENT(OUT) :: dset_id ! Dataset identifier
-    INTEGER, INTENT(OUT) :: hdferr         ! Error code
-
- -
- -

h5dget_access_plist_f

- -

[ Top ] [ H5D ] [ Subroutines ]

-

NAME

-
  h5dget_access_plist_f
-
-

PURPOSE

-
  Returns a copy of the dataset creation property list.
-
-

INPUTS

-
  dset_id       - Dataset identifier
-
-

OUTPUTS

-
  plist_id      - Dataset access property list identifier
-  hdferr        - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  M. Scot Breitenfeld
-  April 13, 2009
-
-

SOURCE

-
SUBROUTINE h5dget_access_plist_f(dset_id, plist_id, hdferr)
-  IMPLICIT NONE
-  INTEGER(HID_T), INTENT(IN)  :: dset_id
-  INTEGER(HID_T), INTENT(OUT) :: plist_id 
-  INTEGER       , INTENT(OUT) :: hdferr  
-
- -
- -

h5dget_create_plist_f

- -

[ Top ] [ H5D ] [ Subroutines ]

-

NAME

-
  h5dget_create_plist_f
-
-

PURPOSE

-
  Returns an identifier for a copy of the dataset creation
-  property list for a dataset.
-
-

INPUTS

-
  dataset_id    - dataset identifier
-
-

OUTPUTS

-
  plist_id      - creation property list identifier
-  hdferr        - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces were added for
-  called C functions (it is needed for Windows
-  port).  February 28, 2001
-
-

SOURCE

-
  SUBROUTINE h5dget_create_plist_f(dataset_id, plist_id, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: dataset_id   ! Dataset identifier
-    INTEGER(HID_T), INTENT(OUT) :: plist_id    ! Dataset creation
-                                               ! property list identifier
-    INTEGER, INTENT(OUT) :: hdferr             ! Error code
-
- -
- -

h5dget_space_f

- -

[ Top ] [ H5D ] [ Subroutines ]

-

NAME

-
  h5dget_space_f
-
-

PURPOSE

-
  Returns an identifier for a copy of the dataspace for a
-  dataset.
-
-

INPUTS

-
  dataset_id    - dataset identifier
-
-

OUTPUTS

-
  dataspace_id  - dataspace identifier
-  hdferr        - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces were added for
-  called C functions (it is needed for Windows
-  port).  February 28, 2001
-
-

SOURCE

-
  SUBROUTINE h5dget_space_f(dataset_id, dataspace_id, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: dataset_id      ! Dataset identifier
-    INTEGER(HID_T), INTENT(OUT) :: dataspace_id   ! Dataspace identifier
-    INTEGER, INTENT(OUT) :: hdferr                ! Error code
-
- -
- -

h5dget_space_status_f

- -

[ Top ] [ H5D ] [ Subroutines ]

-

NAME

-
  h5dget_space_status_f
-
-

PURPOSE

-
  Returns the status of data space allocation.
-
-

INPUTS

-
  dset_id       - dataset identifier
-
-

OUTPUTS

-
  flag          - status; may have one of the following values:
-                   H5D_SPACE_STS_ERROR_F
-                   H5D_SPACE_STS_NOT_ALLOCATED_F
-                   H5D_SPACE_STS_PART_ALLOCATED_F
-                   H5D_SPACE_STS_ALLOCATED_F
-  hdferr        - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  Elena Pourmal
-  March 12, 2003
-
-

SOURCE

-
  SUBROUTINE h5dget_space_status_f(dset_id, flag, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: dset_id  ! Dataspace identifier
-    INTEGER, INTENT(IN)        :: flag     ! Memory buffer to fill in
-    INTEGER, INTENT(OUT)       :: hdferr   ! Error code
-
- -
- -

h5dget_storage_size_f

- -

[ Top ] [ H5D ] [ Subroutines ]

-

NAME

-
  h5dget_storage_size_f
-
-

PURPOSE

-
  Returns the amount of storage requires by a dataset
-
-

INPUTS

-
  dataset_id    - dataset identifier
-
-

OUTPUTS

-
  size          - datastorage size
-  hdferr        - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  Elena Pourmal
-  October 15, 2002
-
-

SOURCE

-
  SUBROUTINE h5dget_storage_size_f(dataset_id, size, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: dataset_id ! Dataset identifier
-    INTEGER(HSIZE_T),  INTENT(OUT)  :: size  ! Amount of storage
-                                             ! allocated for dataset
-    INTEGER, INTENT(OUT) :: hdferr           ! Error code
-
- -
- -

h5dget_type_f

- -

[ Top ] [ H5D ] [ Subroutines ]

-

NAME

-
  h5dget_type_f
-
-

PURPOSE

-
  Returns an identifier for a copy of the datatype for a
-  dataset.
-
-

INPUTS

-
  dataset_id    - dataset identifier
-
-

OUTPUTS

-
  datatype_id   - dataspace identifier
-  hdferr        - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces were added for
-  called C functions (it is needed for Windows
-  port).  February 28, 2001
-
-

NOTES

-

SOURCE

-
  SUBROUTINE h5dget_type_f(dataset_id, datatype_id, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: dataset_id      ! Dataset identifier
-    INTEGER(HID_T), INTENT(OUT) :: datatype_id    ! Datatype identifier
-    INTEGER, INTENT(OUT) :: hdferr                ! Error code
-
- -
- -

h5dopen_f

- -

[ Top ] [ H5D ] [ Subroutines ]

-

NAME

-
  h5dopen_f
-
-

PURPOSE

-
  Opens an existing dataset.
-
-

INPUTS

-
  loc_id        - file or group identifier
-  name          - dataset name
-
-

OUTPUTS

-
  dset_id       - dataset identifier
-  hdferr        - Returns 0 if successful and -1 if fails
-
-

OPTIONAL PARAMETERS

-
  dapl_id       - Dataset access property list
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  -Explicit Fortran interfaces were added for
-   called C functions (it is needed for Windows
-   port).  February 28, 2001
-
-  -Added 1.8 (optional) parameter dapl_id
-   February, 2008, M. Scot Breitenfeld
-
-

SOURCE

-
  SUBROUTINE h5dopen_f(loc_id, name, dset_id, hdferr, dapl_id)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: loc_id   ! File or group identifier
-    CHARACTER(LEN=*), INTENT(IN) :: name   ! Name of the dataset
-    INTEGER(HID_T), INTENT(OUT) :: dset_id ! Dataset identifier
-    INTEGER, INTENT(OUT) :: hdferr         ! Error code
-    INTEGER(HID_T), OPTIONAL, INTENT(IN) :: dapl_id ! Dataset access property list
-
- -
- -

h5dset_extent

- -

[ Top ] [ H5D ] [ Subroutines ]

-

NAME

-
  h5dset_extent (instead of obsolete name: h5dextend_f)
-
-

PURPOSE

-
  Extends a dataset with unlimited dimension.
-
-

INPUTS

-
  dataset_id    - dataset identifier
-  size          - array containing the new magnitude of
-                  each dimension
-
-

OUTPUTS

-
  hdferr        - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces were added for
-  called C functions (it is needed for Windows
-  port).  February 28, 2001
-
-  Changed name from the now obsolete h5dextend_f
-  to h5dset_extent_f. Provided interface to old name
-  for backward compatability. -MSB- March 14, 2008
-
-

SOURCE

-
  SUBROUTINE h5dset_extent_f(dataset_id, size, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: dataset_id      ! Dataset identifier
-    INTEGER(HSIZE_T), DIMENSION(*), INTENT(IN)  :: size
-    ! Array containing
-    ! dimensions' sizes
-    INTEGER, INTENT(OUT) :: hdferr                ! Error code
-
- -
- -

h5dvlen_get_max_len_f

- -

[ Top ] [ H5D ] [ Subroutines ]

-

NAME

-
  h5dvlen_get_max_len_f
-
-

PURPOSE

-
  Returns maximum length of the VL array elements
-
-

INPUTS

-
  dataset_id    - dataset identifier
-  type_id       - datatype identifier
-  space_id      - dataspace identifier
-
-

OUTPUTS

-
  size          - buffer size
-  hdferr        - Returns 0 if successful and -1 if fails
-
-

OPTIONAL PARAMETERS

-
  NONE
-
-

AUTHOR

-
  Elena Pourmal
-  October 15, 2002
-
-

SOURCE

-
  SUBROUTINE h5dvlen_get_max_len_f(dataset_id, type_id, space_id, len,  hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: dataset_id      ! Dataset identifier
-    INTEGER(HID_T), INTENT(IN) :: type_id         ! Datatype identifier
-    INTEGER(HID_T), INTENT(IN) :: space_id        ! Dataspace identifier
-    INTEGER(SIZE_T),  INTENT(OUT)  :: len         ! Maximum length of the element
-    INTEGER, INTENT(OUT) :: hdferr                ! Error code
-
- -
- - - diff --git a/fortran/doc/DevelGuide/src/H5Ef_c.html b/fortran/doc/DevelGuide/src/H5Ef_c.html deleted file mode 100644 index 79b7914..0000000 --- a/fortran/doc/DevelGuide/src/H5Ef_c.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - -./src/H5Ef.c - - - - - -
-
- -

H5Ef

- -

[ Top ] [ Modules ]

-

PURPOSE

-
   This file contains C stubs for H5E Fortran APIs
-
- -
- - - diff --git a/fortran/doc/DevelGuide/src/H5Eff_f90.html b/fortran/doc/DevelGuide/src/H5Eff_f90.html deleted file mode 100644 index 7eb95e6..0000000 --- a/fortran/doc/DevelGuide/src/H5Eff_f90.html +++ /dev/null @@ -1,197 +0,0 @@ - - - - - - - -./src/H5Eff.f90 - - - - - -
-
- -

H5E

- -

[ Top ] [ Modules ]

-

NAME

-
  MODULE H5E
-
-

FILE

-
  fortran/src/H5Eff.f90
-
-

PURPOSE

-
  This Module contains Fortran interfaces for H5E functions.
-
-

NOTES

-
                         *** IMPORTANT ***
-  If you add a new H5E function to the module you must add the function name
-  to the Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory.
-  This is needed for Windows based operating systems.
-
- -
- -

h5eclear_f

- -

[ Top ] [ H5E ] [ Subroutines ]

-

NAME

-
  h5eclear_f
-
-

PURPOSE

-
  Clears the error stack for the current thread.
-
-

OUTPUTS

-
  hdferr        - Returns 0 if successful and -1 if fails
-
-

OPTIONAL PARAMETERS

-
  estack_id     - Error Stack id
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces were added for
-  called C functions (it is needed for Windows
-  port).  April 6, 2001
-
-  Added optional error stack identifier in order to bring
-  the function in line with the h5eclear2 routine.
-  MSB, July 9, 2009
-
-

SOURCE

-
  SUBROUTINE h5eclear_f(hdferr, estack_id)
-    IMPLICIT NONE
-    INTEGER, INTENT(OUT) :: hdferr  ! Error code
-    INTEGER(HID_T), OPTIONAL, INTENT(IN) :: estack_id
-
- -
- -

h5eget_major_f

- -

[ Top ] [ H5E ] [ Subroutines ]

-

NAME

-
  h5eget_major_f
-
-

PURPOSE

-
  Returns a character string describing an error specified
-  by a major error number.
-
-

INPUTS

-
  error_no      - major error number
-
-

OUTPUTS

-
  name          - character string describing the error
-  namelen       - number of characters in the name buffer
-  hdferr        - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces were added for
-  called C functions (it is needed for Windows
-  port).  April 6, 2001
-
-

SOURCE

-
  SUBROUTINE h5eget_major_f(error_no, name, namelen, hdferr)
-    INTEGER, INTENT(IN) :: error_no        ! Major error number
-    CHARACTER(LEN=*), INTENT(OUT) :: name  ! Character string describing
-                                           ! the error.
-    INTEGER(SIZE_T), INTENT(IN) :: namelen ! Anticipated number of characters
-                                           ! in name.
-    INTEGER, INTENT(OUT) :: hdferr         ! Error code
-
- -
- -

h5eget_minor_f

- -

[ Top ] [ H5E ] [ Subroutines ]

-

NAME

-
  h5eget_minor_f
-
-

PURPOSE

-
  Returns a character string describing an error specified
-  by a minor error number.
-
-

INPUTS

-
  error_no      - minor error number
-
-

OUTPUTS

-
  name          - character string describing the error
-  hdferr        - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces were added for
-  called C functions (it is needed for Windows
-  port).  April 6, 2001
-
-

SOURCE

-
  SUBROUTINE h5eget_minor_f(error_no, name, hdferr)
-    INTEGER, INTENT(IN) :: error_no       ! Major error number
-    CHARACTER(LEN=*), INTENT(OUT) :: name ! Character string describing
-                                          ! the error
-    INTEGER, INTENT(OUT) :: hdferr        ! Error code
-
- -
- -

h5eprint_f

- -

[ Top ] [ H5E ] [ Subroutines ]

-

NAME

-
  h5eprint_f
-
-

PURPOSE

-
  Prints the error stack in a default manner.
-
-

OUTPUTS

-
  hdferr        - Returns 0 if successful and -1 if fails
-
-

OPTIONAL PARAMETERS

-
  name          - name of the file that contains print output
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces were added for
-  called C functions (it is needed for Windows
-  port).  April 6, 2001
-
-

SOURCE

-
  SUBROUTINE h5eprint_f(hdferr, name)
-    CHARACTER(LEN=*), OPTIONAL, INTENT(IN) :: name ! File name
-    INTEGER, INTENT(OUT) :: hdferr          ! Error code
-
- -
- - - diff --git a/fortran/doc/DevelGuide/src/H5FDmpiof_c.html b/fortran/doc/DevelGuide/src/H5FDmpiof_c.html deleted file mode 100644 index 74143d2..0000000 --- a/fortran/doc/DevelGuide/src/H5FDmpiof_c.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - -./src/H5FDmpiof.c - - - - - -
-
- -

H5FDmpiof

- -

[ Top ] [ Modules ]

-

PURPOSE

-
   This file contains C stubs for Parallel Fortran APIs
-
- -
- - - diff --git a/fortran/doc/DevelGuide/src/H5FDmpioff_f90.html b/fortran/doc/DevelGuide/src/H5FDmpioff_f90.html deleted file mode 100644 index 473b5db..0000000 --- a/fortran/doc/DevelGuide/src/H5FDmpioff_f90.html +++ /dev/null @@ -1,253 +0,0 @@ - - - - - - - -./src/H5FDmpioff.f90 - - - - - -
-
- -

H5FDMPIO

- -

[ Top ] [ Modules ]

-

NAME

-
  MODULE H5FDMPIO
-
-

PURPOSE

-
  This file contains Fortran interfaces for H5P functions needed by
-  parallel MPI programs.
-
-

NOTES

-
                         *** IMPORTANT ***
-  If you add a new H5P function you must add the function name to the
-  Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory.
-  This is needed for Windows based operating systems.
-
- -
- -

h5pget_dxpl_mpio_f

- -

[ Top ] [ H5FDMPIO ] [ Subroutines ]

-

NAME

-
  h5pget_dxpl_mpio_f
-
-

PURPOSE

-
  Returns the data transfer mode.
-
-

INPUTS

-
  prp_id        - data transfer property list identifier
-
-

OUTPUTS

-
  data_xfer_mode- transfer mode; possible values are:
-                     H5FD_MPIO_INDEPENDENT_F
-                     H5FD_MPIO_COLLECTIVE_F
-  hdferr        - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  Elena Pourmal
-  November, 2000
-
-

SOURCE

-
  SUBROUTINE h5pget_dxpl_mpio_f(prp_id, data_xfer_mode, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: prp_id   ! Property list identifier
-    INTEGER, INTENT(OUT) :: data_xfer_mode ! Data transfer mode. Possible values are:
-                                           ! H5FD_MPIO_INDEPENDENT_F
-                                           ! H5FD_MPIO_COLLECTIVE_F
-    INTEGER, INTENT(OUT) :: hdferr         ! Error code
-
- -
- -

h5pget_fapl_mpio_f

- -

[ Top ] [ H5FDMPIO ] [ Subroutines ]

-

NAME

-
  h5pget_fapl_mpio_f
-
-

PURPOSE

-
  Returns MPI communicator information.
-
-

INPUTS

-
  prp_id        - file access property list identifier
-
-

OUTPUTS

-
  comm          - MPI-2 communicator
-  info          - MPI-2 info object
-  hdferr        - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  Elena Pourmal
-  November, 2000
-
-

SOURCE

-
  SUBROUTINE h5pget_fapl_mpio_f(prp_id, comm, info, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier
-    INTEGER, INTENT(OUT) :: comm ! buffer to return communicator
-    INTEGER, INTENT(OUT) :: info ! buffer to return info object
-                                 ! as defined in MPI_FILE_OPEN of MPI-2
-    INTEGER, INTENT(OUT) :: hdferr  ! Error code
-
- -
- -

h5pget_fapl_mpiposix_f

- -

[ Top ] [ H5FDMPIO ] [ Subroutines ]

-

NAME

-
  h5pget_fapl_mpiposix_f
-
-

PURPOSE

-
  Returns MPI communicator information.
-
-

INPUTS

-
  prp_id        - file access property list identifier
-
-

OUTPUTS

-
  comm          - MPI-2 communicator
-  use_gpfs      - flag to use GPFS hints
-  hdferr        - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  Elena Pourmal
-  May 6, 2003
-
-

SOURCE

-
  SUBROUTINE h5pget_fapl_mpiposix_f(prp_id, comm, use_gpfs, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier
-    INTEGER, INTENT(OUT) :: comm         ! Buffer to return communicator
-    LOGICAL, INTENT(OUT) :: use_gpfs
-    INTEGER, INTENT(OUT) :: hdferr       ! Error code
-
- -
- -

h5pset_dxpl_mpio_f

- -

[ Top ] [ H5FDMPIO ] [ Subroutines ]

-

NAME

-
  h5pset_dxpl_mpio_f
-
-

PURPOSE

-
  Sets data transfer mode.
-
-

INPUTS

-
  prp_id         - data transfer property list identifier
-  data_xfer_mode - transfer mode; possible values are:
-                     H5FD_MPIO_INDEPENDENT_F
-                     H5FD_MPIO_COLLECTIVE_F
-
-

OUTPUTS

-
  hdferr        - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  Elena Pourmal
-  November, 2000
-
-

SOURCE

-
  SUBROUTINE h5pset_dxpl_mpio_f(prp_id, data_xfer_mode, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: prp_id  ! Property list identifier
-    INTEGER, INTENT(IN) :: data_xfer_mode ! Data transfer mode. Possible values are:
-                                          ! H5FD_MPIO_INDEPENDENT_F
-                                          ! H5FD_MPIO_COLLECTIVE_F
-    INTEGER, INTENT(OUT) :: hdferr        ! Error code
-
- -
- -

h5pset_fapl_mpio_f

- -

[ Top ] [ H5FDMPIO ] [ Subroutines ]

-

NAME

-
  h5pset_fapl_mpio_f
-
-

PURPOSE

-
  Stores MPI IO communicator information to the file
-  access property list.
-
-

INPUTS

-
  prp_id        - file access property list identifier
-  comm          - MPI-2 communicator
-  info          - MPI-2 info object
-
-

OUTPUTS

-
  hdferr        - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  Elena Pourmal
-  November, 2000
-
-

SOURCE

-
  SUBROUTINE h5pset_fapl_mpio_f(prp_id, comm, info, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier
-    INTEGER, INTENT(IN) :: comm ! MPI communicator to be used for file open
-                                ! as defined in MPI_FILE_OPEN of MPI-2
-    INTEGER, INTENT(IN) :: info ! MPI info object to be used for file open
-                                ! as defined in MPI_FILE_OPEN of MPI-2
-    INTEGER, INTENT(OUT) :: hdferr ! Error code
-
- -
- -

h5pset_fapl_mpiposix_f

- -

[ Top ] [ H5FDMPIO ] [ Subroutines ]

-

NAME

-
  h5pset_fapl_mpiposix_f
-
-

PURPOSE

-
  Stores MPI IO communicator information to the file
-  access property list.
-
-

INPUTS

-
  prp_id        - file access property list identifier
-  comm          - MPI-2 communicator
-  use_gpfs      - logical flag to use the GPFS hints
-
-

OUTPUTS

-
  hdferr        - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  Elena Pourmal
-  May 6, 2003
-
-

SOURCE

-
  SUBROUTINE h5pset_fapl_mpiposix_f(prp_id, comm, use_gpfs, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier
-    INTEGER, INTENT(IN) :: comm ! MPI communicator to be used for file open
-                                ! as defined in MPI_FILE_OPEN of MPI-2
-    LOGICAL, INTENT(IN) :: use_gpfs
-    INTEGER, INTENT(OUT) :: hdferr  ! Error code
-
- -
- - - diff --git a/fortran/doc/DevelGuide/src/H5Ff_c.html b/fortran/doc/DevelGuide/src/H5Ff_c.html deleted file mode 100644 index c91a62d..0000000 --- a/fortran/doc/DevelGuide/src/H5Ff_c.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - -./src/H5Ff.c - - - - - -
-
- -

H5Ff

- -

[ Top ] [ Modules ]

-

PURPOSE

-
   This file contains C stubs for H5F Fortran APIs
-
- -
- - - diff --git a/fortran/doc/DevelGuide/src/H5Fff_f90.html b/fortran/doc/DevelGuide/src/H5Fff_f90.html deleted file mode 100644 index b0164c9..0000000 --- a/fortran/doc/DevelGuide/src/H5Fff_f90.html +++ /dev/null @@ -1,653 +0,0 @@ - - - - - - - -./src/H5Fff.f90 - - - - - -
-
- -

H5F

- -

[ Top ] [ Modules ]

-

NAME

-
  MODULE H5F
-
-

FILE

-
  H5Fff.f90
-
-

PURPOSE

-
  This file contains Fortran interfaces for H5F functions.
-
-

NOTES

-
                         *** IMPORTANT ***
-  If you add a new H5F function you must add the function name to the
-  Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory.
-  This is needed for Windows based operating systems.
-
- -
- -

h5fclose_f

- -

[ Top ] [ H5F ] [ Subroutines ]

-

NAME

-
  h5fclose_f
-
-

PURPOSE

-
  Closes HDF5 file.
-
-

INPUTS

-
  file_id       - file identifier
-
-

OUTPUTS

-
  hdferr        - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces were added for
-  called C functions (it is needed for Windows
-  port).  February 28, 2001
-
-

SOURCE

-
  SUBROUTINE h5fclose_f(file_id, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: file_id ! File identifier
-    INTEGER, INTENT(OUT) :: hdferr        ! Error code
-
- -
- -

h5fcreate_f

- -

[ Top ] [ H5F ] [ Subroutines ]

-

NAME

-
  h5fcreate_f
-
-

PURPOSE

-
  Creates HDF5 files.
-
-

INPUTS

-
  name          - name of the file to create
-  access_flags  - File access flags. Allowable values are:
-                   H5F_ACC_TRUNC_F
-                   H5F_ACC_EXCL_F
-
-

OUTPUTS

-
  file_id       - file identifier
-  hdferr        - Returns 0 if successful and -1 if fails
-
-

OPTIONAL PARAMETERS

-
  creation_prp  - file creation property list identifier
-  access_prp    - file access property list identifier
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces were added for
-  called C functions (it is needed for Windows
-  port).  February 28, 2001
-
-

SOURCE

-
  SUBROUTINE h5fcreate_f(name, access_flags, file_id, hdferr, &
-       creation_prp, access_prp)
-    IMPLICIT NONE
-    CHARACTER(LEN=*), INTENT(IN) :: name   ! Name of the file
-    INTEGER, INTENT(IN) :: access_flags    ! File access flags
-    INTEGER(HID_T), INTENT(OUT) :: file_id ! File identifier
-    INTEGER, INTENT(OUT) :: hdferr         ! Error code
-    INTEGER(HID_T), OPTIONAL, INTENT(IN) :: creation_prp
-                                           ! File creation propertly
-                                           ! list identifier
-    INTEGER(HID_T), OPTIONAL, INTENT(IN) :: access_prp
-                                           ! File access property list
-                                           ! identifier
-
- -
- -

h5fflush_f

- -

[ Top ] [ H5F ] [ Subroutines ]

-

NAME

-
  h5fflush_f
-
-

PURPOSE

-
  Flushes all buffers associated WITH a file to disk
-
-

INPUTS

-
  object_id     - identifier of object used to identify the file.
-  scope         - specifies the scope of the flushing action.
-                  Possible values are:
-                    H5F_SCOPE_GLOBAL_F
-                    H5F_SCOPE_LOCAL_F
-
-

OUTPUTS

-
  hdferr        - Returns 0 if successful and -1 if fails
-
-

OPTIONAL PARAMETERS

-
  creation_prp  - file creation property list identifier
-  access_prp    - file access property list identifier
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces were added for
-  called C functions (it is needed for Windows
-  port).  February 28, 2001
-
-

SOURCE

-
  SUBROUTINE h5fflush_f(object_id, scope, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: object_id !identifier for any object
-                                            !associate with a file,
-                                            !including the file itself,
-                                            !a dataset, a group, an
-                                            !attribute, or a named
-                                            !data type
-
-    INTEGER, INTENT(IN) :: scope            !scope of the flushing
-                                            !action, possible values
-                                            !are: H5F_SCOPE_GLOBAL_F
-                                            ! which flushes the entire
-                                            !virtual file,
-                                            !and H5F_SCOPE_LOCAL_F
-                                            !which flushes only the
-                                            !specified file.
-
-    INTEGER, INTENT(OUT) :: hdferr          ! Error code
-
- -
- -

h5fget_access_plist_f

- -

[ Top ] [ H5F ] [ Subroutines ]

-

NAME

-
  h5fget_access_plist_f
-
-

PURPOSE

-
  Returns a file access property list identifier.
-
-

INPUTS

-
  file_id       - identifier of a file to creation property list of
-
-

OUTPUTS

-
  access_id     - access property list identifier
-  hdferr        - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces were added for
-  called C functions (it is needed for Windows
-  port).  February 28, 2001
-
-

SOURCE

-
  SUBROUTINE h5fget_access_plist_f(file_id, access_id, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: file_id      ! File identifier
-    INTEGER(HID_T), INTENT(OUT) :: access_id   ! File access property
-                                               ! list identifier
-    INTEGER, INTENT(OUT) :: hdferr             ! Error code
-
- -
- -

h5fget_create_plist_f

- -

[ Top ] [ H5F ] [ Subroutines ]

-

NAME

-
  h5fget_create_plist_f
-
-

PURPOSE

-
  Returns a file creation property list identifier.
-
-

INPUTS

-
  file_id       - identifier of a file to creation property list of
-
-

OUTPUTS

-
  prop_id       - creation property list identifier
-  hdferr        - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces were added for
-  called C functions (it is needed for Windows
-  port).  February 28, 2001
-
-

SOURCE

-
  SUBROUTINE h5fget_create_plist_f(file_id, prop_id, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: file_id    ! File identifier
-    INTEGER(HID_T), INTENT(OUT) :: prop_id   ! File creation property
-                                             ! list identifier
-    INTEGER, INTENT(OUT) :: hdferr           ! Error code
-
- -
- -

h5fget_filesize_f

- -

[ Top ] [ H5F ] [ Subroutines ]

-

NAME

-
  h5fget_filesize_f
-
-

PURPOSE

-
  Retrieves the file size of the HDF5 file.
-
-

INPUTS

-
  file_id       - file identifier
-
-

OUTPUTS

-
  size          - file size
-  hdferr        - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  Elena Pourmal
-  July 7, 2004
-
-

SOURCE

-
  SUBROUTINE h5fget_filesize_f(file_id, size, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: file_id  ! file identifier
-    INTEGER(HSIZE_T), INTENT(OUT) :: size  ! Size of the file
-    INTEGER, INTENT(OUT) :: hdferr         ! Error code: 0 on success,
-                                           !     -1 if fail
-
- -
- -

h5fget_freespace_f

- -

[ Top ] [ H5F ] [ Subroutines ]

-

NAME

-
  h5fget_freespace_f
-
-

PURPOSE

-
  Get amount of free space within a file
-
-

INPUTS

-
  file_id       - file identifier
-
-

OUTPUTS

-
  free_space    - amount of free space in file
-  hdferr        - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  Quincey Koziol
-  October 7, 2003
-
-

SOURCE

-
  SUBROUTINE h5fget_freespace_f(file_id, free_space, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: file_id ! File identifier
-    INTEGER(HSSIZE_T), INTENT(OUT) :: free_space
-                                          ! amount of free space in file
-    INTEGER, INTENT(OUT) :: hdferr        ! Error code
-
- -
- -

h5fget_name_f

- -

[ Top ] [ H5F ] [ Subroutines ]

-

NAME

-
  h5fget_name_f
-
-

PURPOSE

-
  Gets the name of the file from the object identifier
-
-

INPUTS

-
  obj_id        - object identifier
-
-

OUTPUTS

-
  buf           - buffer to store the read name
-  size          - actual size of the name
-  hdferr        - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  Elena Pourmal
-  July 6, 2004
-
-

SOURCE

-
  SUBROUTINE h5fget_name_f(obj_id, buf, size, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: obj_id   ! Object identifier
-    CHARACTER(LEN=*), INTENT(INOUT) :: buf
-                                           ! Buffer to hold file name
-    INTEGER(SIZE_T), INTENT(OUT) :: size   ! Size of the file name
-    INTEGER, INTENT(OUT) :: hdferr         ! Error code: 0 on success,
-                                           !     -1 if fail
-
- -
- -

h5fget_obj_count_f

- -

[ Top ] [ H5F ] [ Subroutines ]

-

NAME

-
  h5fget_obj_count_f
-
-

PURPOSE

-
  Gets number of the objects open within a file
-
-

INPUTS

-
  file_id       - file identifier
-  obj_type      - type of the object; possible values are:
-                    H5F_OBJ_FILE_F
-                    H5F_OBJ_DATASET_F
-                    H5F_OBJ_GROUP_F
-                    H5F_OBJ_DATATYPE_F
-                    H5F_OBJ_ALL_F
-
-

OUTPUTS

-
  obj_count     - number of open objects
-  hdferr        - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  Elena Pourmal
-  September 30, 2002
-
-

HISTORY

-
  Changed the type of obj_count to INTEGER(SIZE_T)
-  September 25, 2008 EIP
-
-

SOURCE

-
  SUBROUTINE h5fget_obj_count_f(file_id, obj_type, obj_count, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: file_id ! File identifier
-    INTEGER, INTENT(IN)  :: obj_type      ! Object type
-    INTEGER(SIZE_T), INTENT(OUT) :: obj_count
-                                          ! Number of open objects
-    INTEGER, INTENT(OUT) :: hdferr        ! Error code
-
- -
- -

h5fget_obj_ids_f

- -

[ Top ] [ H5F ] [ Subroutines ]

-

NAME

-
  h5fget_obj_ids_f
-
-

PURPOSE

-
  Get list of open objects identifiers within a file
-
-

INPUTS

-
  file_id       - file identifier
-  obj_type      - type of the object; possible values are:
-                    H5F_OBJ_FILE_F
-                    H5F_OBJ_DATASET_F
-                    H5F_OBJ_GROUP_F
-                    H5F_OBJ_DATATYPE_F
-                    H5F_OBJ_ALL_F
-
-

OUTPUTS

-
  obj_ids       - array of open object identifiers
-  hdferr        - Returns 0 if successful and -1 if fails
-
-

OPTIONAL PARAMETERS

-
  num_objs      - number of open objects
-
-

AUTHOR

-
  Elena Pourmal
-  September 30, 2002
-
-

HISTORY

-
  Added optional parameter num_objs for number of open objects
-  of the specified type and changed type of max_obj to
-  INTEGER(SIZE_T)
-  September 25, 2008 EIP
-
-

SOURCE

-
  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      ! File identifier
-    INTEGER, INTENT(IN)  :: obj_type           ! Object type
-    INTEGER(SIZE_T), INTENT(IN)  :: max_objs   ! Maximum # of objects to retrieve
-    INTEGER(HID_T), DIMENSION(*), INTENT(INOUT) :: obj_ids
-                                               ! Array of open objects iidentifiers
-    INTEGER, INTENT(OUT) :: hdferr             ! Error code
-    INTEGER(SIZE_T), INTENT(OUT), OPTIONAL :: num_objs ! number of open objects
-
- -
- -

h5fis_hdf5_f

- -

[ Top ] [ H5F ] [ Subroutines ]

-

NAME

-
  h5fis_hdf5_f
-
-

PURPOSE

-
  Determines whether a file is in the HDF5 format.
-
-

INPUTS

-
  name          - name of the file to check
-
-

OUTPUTS

-
  status        - indicates if file is and HDF5 file
-  hdferr        - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces were added for
-  called C functions (it is needed for Windows
-  port).  February 28, 2001
-
-

SOURCE

-
  SUBROUTINE h5fis_hdf5_f(name, status, hdferr)
-    IMPLICIT NONE
-    CHARACTER(LEN=*), INTENT(IN) :: name   ! Name of the file
-    LOGICAL, INTENT(OUT) :: status         ! Indicates if file
-                                           ! is an HDF5 file
-    INTEGER, INTENT(OUT) :: hdferr         ! Error code
-
- -
- -

h5fmount_f

- -

[ Top ] [ H5F ] [ Subroutines ]

-

NAME

-
  h5fmount_f
-
-

PURPOSE

-
  Mounts a file.
-
-

INPUTS

-
  loc_id        - the identifier for of file or group in
-                  which name is defined
-  name          - the name of the group onto which the file
-                  specified by child_id is to be mounted.
-  child_id      - the identifier of the file to be mounted.
-
-

OUTPUTS

-
  hdferr        - Returns 0 if successful and -1 if fails
-
-

OPTIONAL PARAMETERS

-
  access_prp    - the identifier of the property list to be used
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces were added for
-  called C functions (it is needed for Windows
-  port).  February 28, 2001
-
-

SOURCE

-
  SUBROUTINE h5fmount_f(loc_id, name, child_id, hdferr, access_prp)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: loc_id   ! Identifier for file or group
-                                           ! in which dsetname is defined
-    CHARACTER(LEN=*), INTENT(IN) :: name   ! Name of the group
-    INTEGER(HID_T), INTENT(IN) :: child_id ! File identifier for the
-                                           ! file to be mounted
-    INTEGER, INTENT(OUT) :: hdferr         ! Error code
-    INTEGER(HID_T), OPTIONAL, INTENT(IN) :: access_prp
-                                           ! File access property list
-                                           ! identifier
-
- -
- -

h5fopen_f

- -

[ Top ] [ H5F ] [ Subroutines ]

-

NAME

-
  h5fopen_f
-
-

PURPOSE

-
  Opens HDF5 file.
-
-

INPUTS

-
  name          - name of the file to acecss
-  access_flags  - File access flags. Allowable values are:
-                   H5F_ACC_RDWR_F
-                   H5F_ACC_RDONLY_F
-
-

OUTPUTS

-
  file_id       - file identifier
-  hdferr        - Returns 0 if successful and -1 if fails
-
-

OPTIONAL PARAMETERS

-
  access_prp    - file access property list identifier
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces were added for
-  called C functions (it is needed for Windows
-  port).  February 28, 2001
-
-

SOURCE

-
  SUBROUTINE h5fopen_f(name, access_flags, file_id, hdferr, access_prp)
-    IMPLICIT NONE
-    CHARACTER(LEN=*), INTENT(IN) :: name   ! Name of the file
-    INTEGER, INTENT(IN) :: access_flags    ! File access flags
-    INTEGER(HID_T), INTENT(OUT) :: file_id ! File identifier
-    INTEGER, INTENT(OUT) :: hdferr         ! Error code
-    INTEGER(HID_T), OPTIONAL, INTENT(IN) :: access_prp
-                                           ! File access property list
-                                           ! identifier
-
- -
- -

h5freopen_f

- -

[ Top ] [ H5F ] [ Subroutines ]

-

NAME

-
  h5freopen_f
-
-

PURPOSE

-
  Reopens HDF5 file.
-
-

INPUTS

-
  file_id       - identifier of a file for which an
-                  additional identifier is required
-
-

OUTPUTS

-
  ret_file_id   - new file identifier
-  hdferr        - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces were added for
-  called C functions (it is needed for Windows
-  port).  February 28, 2001
-
-

SOURCE

-
  SUBROUTINE h5freopen_f(file_id, ret_file_id, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: file_id      ! File identifier
-    INTEGER(HID_T), INTENT(OUT) :: ret_file_id ! New File identifier
-    INTEGER, INTENT(OUT) :: hdferr             ! Error code
-
- -
- -

h5funmount_f

- -

[ Top ] [ H5F ] [ Subroutines ]

-

NAME

-
  h5funmount_f
-
-

PURPOSE

-
  Unmounts a file.
-
-

INPUTS

-
  loc_id        - the identifier for of file or group in
-                  which name is defined
-  name          - the name of the mount point
-
-

OUTPUTS

-
  hdferr        - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces were added for
-  called C functions (it is needed for Windows
-  port).  February 28, 2001
-
-

SOURCE

-
  SUBROUTINE h5funmount_f(loc_id, name, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: loc_id   ! Identifier for file or group
-                                           ! at which the specified file
-                                           ! is to be unmounted
-    CHARACTER(LEN=*), INTENT(IN) :: name   ! Name of the mount point
-    INTEGER, INTENT(OUT) :: hdferr         ! Error code
-
- -
- - - diff --git a/fortran/doc/DevelGuide/src/H5Gf_c.html b/fortran/doc/DevelGuide/src/H5Gf_c.html deleted file mode 100644 index a71f0e8..0000000 --- a/fortran/doc/DevelGuide/src/H5Gf_c.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - -./src/H5Gf.c - - - - - -
-
- -

H5Gf

- -

[ Top ] [ Modules ]

-

PURPOSE

-
   This file contains C stubs for H5G Fortran APIs
-
- -
- - - diff --git a/fortran/doc/DevelGuide/src/H5Gff_f90.html b/fortran/doc/DevelGuide/src/H5Gff_f90.html deleted file mode 100644 index 74ec2f4..0000000 --- a/fortran/doc/DevelGuide/src/H5Gff_f90.html +++ /dev/null @@ -1,840 +0,0 @@ - - - - - - - -./src/H5Gff.f90 - - - - - -
-
- -

H5G

- -

[ Top ] [ Modules ]

-

NAME

-
  MODULE H5G
-
-

FILE

-
  fortran/src/H5Gff.f90
-
-

PURPOSE

-
  This file contains Fortran interfaces for H5G functions.
-
-

NOTES

-
                         *** IMPORTANT ***
-  If you add a new H5G function you must add the function name to the
-  Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory.
-  This is needed for Windows based operating systems.
-
- -
- -

h5gclose_f

- -

[ Top ] [ H5G ] [ Subroutines ]

-

NAME

-
  h5gclose_f
-
-

PURPOSE

-
  Closes the specified group.
-
-

INPUTS

-
  grp_id        - group identifier
-
-

OUTPUTS

-
  hdferr        - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces were added for
-  called C functions (it is needed for Windows
-  port).  March 5, 2001
-
-

SOURCE

-
  SUBROUTINE h5gclose_f(grp_id, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: grp_id  ! Group identifier
-    INTEGER, INTENT(OUT) :: hdferr        ! Error code
-
- -
- -

H5Gcreate_anon_f

- -

[ Top ] [ H5G ] [ Subroutines ]

-

NAME

-
  H5Gcreate_anon_f
-
-

PURPOSE

-
  Creates a new empty group without linking it into the file structure.
-
-

INPUTS

-
  loc_id        - Location identifier
-
-

OUTPUTS

-
  grp_id        - group identifier
-  hdferr        - Returns 0 if successful and -1 if fails
-
-

OPTIONAL PARAMETERS

-
  gcpl_id       - Group creation property list identifier
-  gapl_id       - Group access property list identifier
-
-

AUTHOR

-
  M. Scot Breitenfeld
-  February 15, 2008
-
-

SOURCE

-
  SUBROUTINE h5Gcreate_anon_f(loc_id, grp_id, hdferr, gcpl_id, gapl_id)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: loc_id   ! File or group identifier
-    INTEGER(HID_T), INTENT(OUT) :: grp_id  ! Group identifier
-    INTEGER, INTENT(OUT) :: hdferr         ! Error code
-    INTEGER(HID_T), OPTIONAL, INTENT(IN) :: gcpl_id  ! Property list for group creation
-    INTEGER(HID_T), OPTIONAL, INTENT(IN) :: gapl_id  ! Property list for group access
-
- -
- -

h5gcreate_f

- -

[ Top ] [ H5G ] [ Subroutines ]

-

NAME

-
  h5gcreate_f
-
-

PURPOSE

-
  Creates a new group.
-
-

INPUTS

-
  loc_id        - location identifier
-  name          - group name at the specified location
-
-

OUTPUTS

-
  grp_id        - group identifier
-  hdferr        - Returns 0 if successful and -1 if fails
-
-

OPTIONAL PARAMETERS

-
  size_hint     - a parameter indicating the number of bytes to
-                  reserve for the names that will appear in the group
-  lcpl_id       - Property list for link creation
-  gcpl_id       - Property list for group creation
-  gapl_id       - Property list for group access
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces were added for
-  called C functions (it is needed for Windows
-  port).  March 5, 2001
-
-  Added additional optional paramaters in 1.8
-  MSB - February 27, 2008
-
-

SOURCE

-
  SUBROUTINE h5gcreate_f(loc_id, name, grp_id, hdferr, size_hint, lcpl_id, gcpl_id, gapl_id)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: loc_id   ! File or group identifier
-    CHARACTER(LEN=*), INTENT(IN) :: name   ! Name of the group
-    INTEGER(HID_T), INTENT(OUT) :: grp_id  ! Group identifier
-    INTEGER, INTENT(OUT) :: hdferr         ! Error code
-    INTEGER(SIZE_T), OPTIONAL, INTENT(IN) :: size_hint
-                                           ! Parameter indicating
-                                           ! the number of bytes
-                                           ! to reserve for the
-                                           ! names that will appear
-                                           ! in the group. Set to OBJECT_NAMELEN_DEFAULT_F
-                                           ! if using any of the optional
-                                           ! parameters lcpl_id, gcpl_id, and/or gapl_id when not
-                                           ! using keywords in specifying the optional parameters
-    INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lcpl_id  ! Property list for link creation
-    INTEGER(HID_T), OPTIONAL, INTENT(IN) :: gcpl_id  ! Property list for group creation
-    INTEGER(HID_T), OPTIONAL, INTENT(IN) :: gapl_id  ! Property list for group access
-
- -
- -

h5gget_comment_f

- -

[ Top ] [ H5G ] [ Subroutines ]

-

NAME

-
  h5gget_comment_f
-
-

PURPOSE

-
  Retrieves comment for specified object.
-
-

INPUTS

-
  loc_id        - location identifier
-  name          - name of the object at specified location
-  size          - size of the buffer required to hold comment
-
-

OUTPUTS

-
  buffer        - buffer to hold object's comment
-  hdferr        - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces were added for
-  called C functions (it is needed for Windows
-  port).  March 5, 2001
-
-

SOURCE

-
  SUBROUTINE h5gget_comment_f(loc_id, name, size, buffer, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: loc_id   ! File or group identifier
-    CHARACTER(LEN=*), INTENT(IN) :: name   ! Current name of an object
-    INTEGER(SIZE_T), INTENT(IN) :: size    ! Maximum number of buffer
-    CHARACTER(LEN=size), INTENT(OUT) :: buffer
-                                           ! Buffer to hold a comment
-    INTEGER, INTENT(OUT) :: hdferr         ! Error code
-
- -
- -

H5Gget_create_plist_f

- -

[ Top ] [ H5G ] [ Subroutines ]

-

NAME

-
  H5Gget_create_plist_f
-
-

PURPOSE

-
  Gets a group creation property list identifier.
-
-

INPUTS

-
  grp_id        - group identifier
-
-

OUTPUTS

-
  gcpl_id       - Group creation property list identifier
-  hdferr        - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  M. Scot Breitenfeld
-  February 15, 2008
-
-

SOURCE

-
  SUBROUTINE h5gget_create_plist_f(grp_id, gcpl_id, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN)  :: grp_id  ! Group identifier
-    INTEGER(HID_T), INTENT(OUT) :: gcpl_id ! Property list for group creation
-    INTEGER, INTENT(OUT) :: hdferr         ! Error code
-
- -
- -

h5gget_info_by_idx_f

- -

[ Top ] [ H5G ] [ Subroutines ]

-

NAME

-
  h5gget_info_by_idx_f
-
-

PURPOSE

-
  Retrieves information about a group, according to the group’s position within an index.
-
-

INPUTS

-
  loc_id        - File or group identifier
-  group_name    - Name of group containing group for which information is to be retrieved
-  index_type    - Index type
-  order         - Order of the count in the index
-  n             - Position in the index of the group for which information is retrieved
-
-

OUTPUTS

-
  storage_type  - Type of storage for links in group
-                    H5G_STORAGE_TYPE_COMPACT: Compact storage
-                    H5G_STORAGE_TYPE_DENSE: Indexed storage
-                    H5G_STORAGE_TYPE_SYMBOL_TABLE: Symbol tables, the original HDF5 structure
-  nlinks        - Number of links in group
-  max_corder    - Current maximum creation order value for group
-  hdferr        - Returns 0 if successful and -1 if fails
-
-

OPTIONAL PARAMETERS

-
  lapl_id       - Link access property list
-  mounted       - Whether group has a file mounted on it
-
-

NOTES

-
  In C the output is defined as a structure: H5G_info_t
-
-

AUTHOR

-
  M. Scot Breitenfeld
-  February 18, 2008
-
-

HISTORY

-
  Added 'mounted' paramater
-  M. Scot Breitenfeld
-  July 16, 2008
-
-

SOURCE

-
  SUBROUTINE h5gget_info_by_idx_f(loc_id, group_name, index_type, order, n, &
-       storage_type, nlinks, max_corder, hdferr, lapl_id, mounted)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: loc_id       ! File or group identifier
-    CHARACTER(LEN=*), INTENT(IN) :: group_name ! Name of group containing group for which information is to be retrieved
-    INTEGER, INTENT(IN) :: index_type ! Index type
-    INTEGER, INTENT(IN) :: order      ! Order of the count in the index
-    INTEGER(HSIZE_T), INTENT(IN) :: n ! Position in the index of the group for which information is retrieved
-
-    INTEGER, INTENT(OUT) :: storage_type ! Type of storage for links in group:
-                                         !   H5G_STORAGE_TYPE_COMPACT_F: Compact storage
-                                         !   H5G_STORAGE_TYPE_DENSE_F: Indexed storage
-                                         !   H5G_STORAGE_TYPE_SYMBOL_TABLE_F: Symbol tables, the original HDF5 structure
-    INTEGER, INTENT(OUT) :: nlinks      ! Number of links in group
-    INTEGER, INTENT(OUT) :: max_corder  ! Current maximum creation order value for group
-    INTEGER, INTENT(OUT) :: hdferr      ! Error code:
-                                        ! 0 on success and -1 on failure
-    INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list
-    LOGICAL, INTENT(OUT), OPTIONAL :: mounted       ! Whether group has a file mounted on it
-
- -
- -

h5gget_info_by_name_f

- -

[ Top ] [ H5G ] [ Subroutines ]

-

NAME

-
  h5gget_info_by_name_f
-
-

PURPOSE

-
  Retrieves information about a group.
-
-

INPUTS

-
  loc_id        - File or group identifier
-  group_name    - Name of group containing group for which information is to be retrieved
-
-

OUTPUTS

-
  storage_type  - Type of storage for links in group
-                    H5G_STORAGE_TYPE_COMPACT: Compact storage
-                    H5G_STORAGE_TYPE_DENSE: Indexed storage
-                    H5G_STORAGE_TYPE_SYMBOL_TABLE: Symbol tables, the original HDF5 structure
-  nlinks        - Number of links in group
-  max_corder    - Current maximum creation order value for group
-  hdferr        - Returns 0 if successful and -1 if fails
-
-

OPTIONAL PARAMETERS

-
  lapl_id       - Link access property list
-  mounted       - Whether group has a file mounted on it
-
-

NOTES

-
  In C the output is defined as a structure: H5G_info_t
-
-

AUTHOR

-
  M. Scot Breitenfeld
-  February 18, 2008
-
-

HISTORY

-
  Added 'mounted' paramater
-  M. Scot Breitenfeld
-  July 16, 2008
-
-

SOURCE

-
  SUBROUTINE h5gget_info_by_name_f(loc_id, group_name, &
-       storage_type, nlinks, max_corder, hdferr, lapl_id, mounted)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: loc_id       ! File or group identifier
-    CHARACTER(LEN=*), INTENT(IN) :: group_name ! Name of group containing group for which information is to be retrieved
-
-    INTEGER, INTENT(OUT) :: storage_type  ! Type of storage for links in group:
-                                          ! H5G_STORAGE_TYPE_COMPACT_F: Compact storage
-                                          ! H5G_STORAGE_TYPE_DENSE_F: Indexed storage
-                                          ! H5G_STORAGE_TYPE_SYMBOL_TABLE_F: Symbol tables, the original HDF5 structure
-    INTEGER, INTENT(OUT) :: nlinks        ! Number of links in group
-    INTEGER, INTENT(OUT) :: max_corder    ! Current maximum creation order value for group
-    INTEGER, INTENT(OUT) :: hdferr        ! Error code:
-                                          !   0 on success and -1 on failure
-    INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list
-    LOGICAL, INTENT(OUT), OPTIONAL :: mounted       ! Whether group has a file mounted on it
-
- -
- -

h5gget_info_f

- -

[ Top ] [ H5G ] [ Subroutines ]

-

NAME

-
  h5gget_info_f
-
-

PURPOSE

-
  Retrieves information about a group
-
-

INPUTS

-
  group_id      - Group identifier
-
-

OUTPUTS

-
  storage_type  - Type of storage for links in group
-                    H5G_STORAGE_TYPE_COMPACT: Compact storage
-                    H5G_STORAGE_TYPE_DENSE: Indexed storage
-                    H5G_STORAGE_TYPE_SYMBOL_TABLE: Symbol tables, the original HDF5 structure
-  nlinks        - Number of links in group
-  max_corder    - Current maximum creation order value for group
-  hdferr        - Returns 0 if successful and -1 if fails
-
-

OPTIONAL PARAMETERS

-
  mounted       - Whether group has a file mounted on it
-
-

AUTHOR

-
  M. Scot Breitenfeld
-  February 15, 2008
-
-

NOTES

-
  In C the output is defined as a structure: H5G_info_t
-
-

HISTORY

-
  - Added 'mounted' paramater
-    M. Scot Breitenfeld
-    July 16, 2008
-
-

SOURCE

-
  SUBROUTINE h5gget_info_f(group_id, storage_type, nlinks, max_corder, hdferr, mounted)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: group_id ! Group identifier
-
-    INTEGER, INTENT(OUT) :: storage_type  ! Type of storage for links in group:
-                                          ! H5G_STORAGE_TYPE_COMPACT_F: Compact storage
-                                          ! H5G_STORAGE_TYPE_DENSE_F: Indexed storage
-                                          ! H5G_STORAGE_TYPE_SYMBOL_TABLE_F: Symbol tables, the original HDF5 structure
-    INTEGER, INTENT(OUT) :: nlinks        ! Number of links in group
-    INTEGER, INTENT(OUT) :: max_corder    ! Current maximum creation order value for group
-    INTEGER, INTENT(OUT) :: hdferr        ! Error code:
-                                          ! 0 on success and -1 on failure
-    LOGICAL, INTENT(OUT), OPTIONAL :: mounted  ! Whether group has a file mounted on it
-
- -
- -

h5gget_linkval_f

- -

[ Top ] [ H5G ] [ Subroutines ]

-

NAME

-
  h5gget_linkval_f
-
-

PURPOSE

-
  Returns the name of the object that the symbolic link
-  points to.
-
-

INPUTS

-
  loc_id        - location identifier
-  name          - symbolic link to the object whose name
-                  is to be returned.
-  size          - maximum number of characters to be returned
-
-

OUTPUTS

-
  buffer        - a buffer to hold the name of the object
-  being sought
-  hdferr        - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces were added for
-  called C functions (it is needed for Windows
-  port).  March 5, 2001
-
-

SOURCE

-
  SUBROUTINE h5gget_linkval_f(loc_id, name, size, buffer, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: loc_id   ! File or group identifier
-    CHARACTER(LEN=*), INTENT(IN) :: name   ! Current name of an object
-    INTEGER(SIZE_T), INTENT(IN) :: size    ! Maximum number of buffer
-    CHARACTER(LEN=size), INTENT(OUT) :: buffer
-                                           ! Buffer to hold a name of
-                                           ! the object symbolic link
-                                           ! points to
-    INTEGER, INTENT(OUT) :: hdferr         ! Error code
-
- -
- -

h5gget_obj_info_idx_f

- -

[ Top ] [ H5G ] [ Subroutines ]

-

NAME

-
  h5gget_obj_info_idx_f
-
-

PURPOSE

-
  Returns name and type of the group member identified by
-  its index.
-
-

INPUTS

-
  loc_id        - location identifier
-  name          - name of the group at the specified location
-  idx           - object index (zero-based)
-
-

OUTPUTS

-
  obj_name      - object name
-  obj_type      - object type
-  hdferr        - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces were added for
-  called C functions (it is needed for Windows
-  port).  March 5, 2001
-
-

SOURCE

-
  SUBROUTINE h5gget_obj_info_idx_f(loc_id, name, idx, &
-       obj_name, obj_type, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: loc_id   ! File or group identifier
-    CHARACTER(LEN=*), INTENT(IN) :: name   ! Name of the group
-    INTEGER, INTENT(IN) :: idx             ! Index of member object
-    CHARACTER(LEN=*), INTENT(OUT) :: obj_name   ! Name of the object
-    INTEGER, INTENT(OUT) :: obj_type       ! Object type
-    INTEGER, INTENT(OUT) :: hdferr         ! Error code
-
- -
- -

h5glink2_f

- -

[ Top ] [ H5G ] [ Subroutines ]

-

NAME

-
  h5glink2_f
-
-

PURPOSE

-
  Creates a link of the specified type from new_name
-  to current_name. current_name and new_name are interpreted
-  releative to current and new location identifiers.
-
-

INPUTS

-
  cur_loc_id    - location identifier
-  cur_name      - name of the existing object if link is a
-                  hard link. Can be anything for the soft link.
-  link_type     - link type; possible values are:
-                    H5G_LINK_HARD_F (0)
-                    H5G_LINK_SOFT_F (1)
-  new_loc_id    - new location identifier
-  new_name      - new name for the object
-
-

OUTPUTS

-
  hdferr        - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  Elena Pourmal
-  September 25, 2002
-
-

SOURCE

-
  SUBROUTINE h5glink2_f(cur_loc_id, cur_name, link_type, new_loc_id, &
-       new_name, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: cur_loc_id ! File or group identifier
-    CHARACTER(LEN=*), INTENT(IN) :: cur_name
-                                             ! Current name of an object
-    INTEGER, INTENT(IN) :: link_type         ! link type
-                                                 ! Possible values are:
-                                                 ! H5G_LINK_HARD_F (0) or
-                                                 ! H5G_LINK_SOFT_F (1)
-
-    INTEGER(HID_T), INTENT(IN) :: new_loc_id ! File or group identifier
-    CHARACTER(LEN=*), INTENT(IN) :: new_name ! New name of an object
-    INTEGER, INTENT(OUT) :: hdferr           ! Error code
-
- -
- -

h5glink_f

- -

[ Top ] [ H5G ] [ Subroutines ]

-

NAME

-
  h5glink_f
-
-

PURPOSE

-
  Creates a link of the specified type from new_name
-  to current_name.
-
-

INPUTS

-
  loc_id        - location identifier
-  link_type     - link type; possible values are:
-                    H5G_LINK_HARD_F (0)
-                    H5G_LINK_SOFT_F (1)
-  current_name  - name of the existing object if link is a
-                  hard link. Can be anything for the soft link
-  new_name      - new name for the object
-
-

OUTPUTS

-
  hdferr        - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces were added for
-  called C functions (it is needed for Windows
-  port).  March 5, 2001
-
-

SOURCE

-
  SUBROUTINE h5glink_f(loc_id, link_type, current_name, &
-       new_name, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: loc_id   ! File or group identifier
-    INTEGER, INTENT(IN) :: link_type       ! link type
-                                                   ! Possible values are:
-                                                   ! H5G_LINK_HARD_F (0) or
-                                                   ! H5G_LINK_SOFT_F (1)
-
-    CHARACTER(LEN=*), INTENT(IN) :: current_name
-                                                   ! Current name of an object
-    CHARACTER(LEN=*), INTENT(IN) :: new_name ! New name of an object
-    INTEGER, INTENT(OUT) :: hdferr         ! Error code
-
- -
- -

h5gmove2_f

- -

[ Top ] [ H5G ] [ Subroutines ]

-

NAME

-
  h5gmove2_f
-
-

PURPOSE

-
  Renames an object within an HDF5 file.
-
-

INPUTS

-
  src_loc_id    - original location identifier
-  src_name      - object's name at specified original location
-  dst_loc_id    - original location identifier
-  dst_name      - object's new name
-
-

OUTPUTS

-
  hdferr        - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  Elena Pourmal
-  September 25, 2002
-
-

SOURCE

-
  SUBROUTINE h5gmove2_f(src_loc_id, src_name, dst_loc_id, dst_name, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN)   :: src_loc_id  ! File or group identifier
-    CHARACTER(LEN=*), INTENT(IN) :: src_name    ! Original name of an object
-    INTEGER(HID_T), INTENT(IN)   :: dst_loc_id  ! File or group identifier
-    CHARACTER(LEN=*), INTENT(IN) :: dst_name    ! New name of an object
-    INTEGER, INTENT(OUT)         :: hdferr      ! Error code
-
- -
- -

h5gmove_f

- -

[ Top ] [ H5G ] [ Subroutines ]

-

NAME

-
  h5gmove_f
-
-

PURPOSE

-
  Renames an object within an HDF5 file.
-
-

INPUTS

-
  loc_id        - location identifier
-  name          - object's name at specified location
-  new_name      - object's new name
-
-

OUTPUTS

-
  hdferr        - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces were added for
-  called C functions (it is needed for Windows
-  port).  March 5, 2001
-
-

SOURCE

-
  SUBROUTINE h5gmove_f(loc_id, name, new_name, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: loc_id     ! File or group identifier
-    CHARACTER(LEN=*), INTENT(IN) :: name     ! Current name of an object
-    CHARACTER(LEN=*), INTENT(IN) :: new_name ! New name of an object
-    INTEGER, INTENT(OUT) :: hdferr           ! Error code
-
- -
- -

h5gn_members_f

- -

[ Top ] [ H5G ] [ Subroutines ]

-

NAME

-
  h5gn_members_f
-
-

PURPOSE

-
  Returns the number of group members.
-
-

INPUTS

-
  loc_id        - location identifier
-  name          - name of the group at the specified location
-
-

OUTPUTS

-
  nmembers      - number of group members
-  hdferr        - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces were added for
-  called C functions (it is needed for Windows
-  port).  March 5, 2001
-
-

SOURCE

-
  SUBROUTINE h5gn_members_f(loc_id, name, nmembers, hdferr)
-            IMPLICIT NONE
-            INTEGER(HID_T), INTENT(IN) :: loc_id   ! File or group identifier
-            CHARACTER(LEN=*), INTENT(IN) :: name   ! Name of the group
-            INTEGER, INTENT(OUT) :: nmembers       ! Number of members in the
-                                                   ! group
-            INTEGER, INTENT(OUT) :: hdferr         ! Error code
-
- -
- -

h5gopen_f

- -

[ Top ] [ H5G ] [ Subroutines ]

-

NAME

-
  h5gopen_f
-
-

PURPOSE

-
  Opens an existing group.
-
-

INPUTS

-
  loc_id        - location identifier
-  name          - name of the group to open
-
-

OUTPUTS

-
  grp_id        - group identifier
-  hdferr        - Returns 0 if successful and -1 if fails
-
-

OPTIONAL PARAMETERS

-
  gapl_id       - Group access property list identifier
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces were added for
-  called C functions (it is needed for Windows
-  port).  March 5, 2001
-
-  Added 1.8 (optional) parameter gapl_id
-  February, 2008 M. Scot Breitenfeld
-
-

SOURCE

-
  SUBROUTINE h5gopen_f(loc_id, name, grp_id, hdferr, gapl_id)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: loc_id   ! File or group identifier
-    CHARACTER(LEN=*), INTENT(IN) :: name   ! Name of the group
-    INTEGER(HID_T), INTENT(OUT) :: grp_id  ! File identifier
-    INTEGER, INTENT(OUT) :: hdferr         ! Error code
-    INTEGER(HID_T), OPTIONAL, INTENT(IN) :: gapl_id  ! Group access property list identifier
-
- -
- -

h5gset_comment_f

- -

[ Top ] [ H5G ] [ Subroutines ]

-

NAME

-
  h5gset_comment_f
-
-

PURPOSE

-
  Sets comment for specified object.
-
-

INPUTS

-
  loc_id        - location identifier
-  name          - name of the object
-  comment       - comment to set for the object
-
-

OUTPUTS

-
  hdferr        - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces were added for
-  called C functions (it is needed for Windows
-  port).  March 5, 2001
-
-

SOURCE

-
  SUBROUTINE h5gset_comment_f(loc_id, name, comment, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: loc_id   ! File or group identifier
-    CHARACTER(LEN=*), INTENT(IN) :: name   ! Current name of an object
-    CHARACTER(LEN=*), INTENT(IN) :: comment ! New name of an object
-    INTEGER, INTENT(OUT) :: hdferr         ! Error code
-
- -
- -

h5gunlink_f

- -

[ Top ] [ H5G ] [ Subroutines ]

-

NAME

-
  h5gunlink_f
-
-

PURPOSE

-
  Removes the specified name from the group graph and
-  decrements the link count for the object to which name
-  points
-
-

INPUTS

-
  loc_id        - location identifier
-  name          - name of the object to unlink
-
-

OUTPUTS

-
  hdferr        - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces were added for
-  called C functions (it is needed for Windows
-  port).  March 5, 2001
-
-

SOURCE

-
  SUBROUTINE h5gunlink_f(loc_id, name, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: loc_id   ! File or group identifier
-    CHARACTER(LEN=*), INTENT(IN) :: name   ! Name of an object
-    INTEGER, INTENT(OUT) :: hdferr         ! Error code
-
- -
- - - diff --git a/fortran/doc/DevelGuide/src/H5If_c.html b/fortran/doc/DevelGuide/src/H5If_c.html deleted file mode 100644 index 8dccce7..0000000 --- a/fortran/doc/DevelGuide/src/H5If_c.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - -./src/H5If.c - - - - - -
-
- -

H5If

- -

[ Top ] [ Modules ]

-

PURPOSE

-
   This file contains C stubs for H5I Fortran APIs
-
- -
- - - diff --git a/fortran/doc/DevelGuide/src/H5Iff_f90.html b/fortran/doc/DevelGuide/src/H5Iff_f90.html deleted file mode 100644 index 5987581..0000000 --- a/fortran/doc/DevelGuide/src/H5Iff_f90.html +++ /dev/null @@ -1,304 +0,0 @@ - - - - - - - -./src/H5Iff.f90 - - - - - -
-
- -

H5I

- -

[ Top ] [ Modules ]

-

NAME

-
  MODULE H5I
-
-

FILE

-
  fortran/src/H5Iff.f90
-
-

PURPOSE

-
  This file contains Fortran interfaces for H5I functions.
-
-

NOTES

-
                         *** IMPORTANT ***
-  If you add a new H5I function you must add the function name to the
-  Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory.
-  This is needed for Windows based operating systems.
-
- -
- -

h5idec_ref_f

- -

[ Top ] [ H5I ] [ Subroutines ]

-

NAME

-
  h5idec_ref_f
-
-

PURPOSE

-
  Decrements the reference count of an ID
-
-

INPUTS

-
  obj_id        - Object identifier
-
-

OUTPUTS

-
  ref_count     - Current reference count of the ID
-  hdferr:       - Error code
-                   Success:  0
-                   Failure: -1
-
-

AUTHOR

-
  Quincey Koziol
-  December  9, 2003
-
-

SOURCE

-
  SUBROUTINE h5idec_ref_f(obj_id, ref_count, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: obj_id ! Object identifier
-    INTEGER, INTENT(OUT) :: ref_count    ! Current reference count of ID
-    INTEGER, INTENT(OUT) :: hdferr       ! Error code
-
- -
- -

h5iget_file_id_f

- -

[ Top ] [ H5I ] [ Subroutines ]

-

NAME

-
  h5iget_file_id_f
-
-

PURPOSE

-
  Obtains file identifier from the object identifier
-
-

INPUTS

-
  obj_id        - object identifier
-
-

OUTPUTS

-
  file_id       - file identifier
-  hdferr:       - error code
-                    Success:  0
-                    Failure: -1
-
-

AUTHOR

-
  Elena Pourmal
-  August 23, 2004
-
-

SOURCE

-
  SUBROUTINE h5iget_file_id_f(obj_id, file_id, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN)  :: obj_id   ! Object identifier
-    INTEGER(HID_T), INTENT(OUT) :: file_id  ! File identifier
-    INTEGER, INTENT(OUT) :: hdferr          ! Error code
-
- -
- -

h5iget_name_f

- -

[ Top ] [ H5I ] [ Subroutines ]

-

NAME

-
  h5iget_name_f
-
-

PURPOSE

-
  Gets a name of an object specified by its idetifier.
-
-

INPUTS

-
  obj_id    - attribute identifier
-  buf_size  - size of a buffer to read name in
-
-

OUTPUTS

-
  buf       - buffer to read name in, name will be truncated if
-              buffer is not big enough
-  name_size - name size
-  hdferr:   - error code
-               Success:  0
-               Failure: -1
-
-

AUTHOR

-
  Elena Pourmal
-  March 12, 2003
-
-

SOURCE

-
  SUBROUTINE h5iget_name_f(obj_id, buf, buf_size, name_size, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: obj_id      ! Object identifier
-    INTEGER(SIZE_T), INTENT(IN) :: buf_size   ! Buffer size
-    CHARACTER(LEN=*), INTENT(OUT) :: buf      ! Buffer to hold object name
-    INTEGER(SIZE_T), INTENT(OUT) :: name_size ! Actual name size
-    INTEGER, INTENT(OUT) :: hdferr            ! Error code:
-                                              !   0 if successful,
-                                              !   -1 if fail
-
- -
- -

h5iget_ref_f

- -

[ Top ] [ H5I ] [ Subroutines ]

-

NAME

-
  h5iget_ref_f
-
-

PURPOSE

-
  Retrieves the reference count of an ID
-
-

INPUTS

-
  obj_id        - object identifier
-
-

OUTPUTS

-
  ref_count     - Current reference count of the ID
-  hdferr:         - error code
-  Success:  0
-  Failure: -1
-
-

AUTHOR

-
  Quincey Koziol
-  December  9, 2003
-
-

SOURCE

-
  SUBROUTINE h5iget_ref_f(obj_id, ref_count, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: obj_id ! Object identifier
-    INTEGER, INTENT(OUT) :: ref_count    ! Current reference count of ID
-    INTEGER, INTENT(OUT) :: hdferr       ! Error code
-
- -
- -

h5iget_type_f

- -

[ Top ] [ H5I ] [ Subroutines ]

-

NAME

-
  h5iget_type_f
-
-

PURPOSE

-
  Retrieves the type of an object.
-
-

INPUTS

-
  obj_id   - object identifier
-
-

OUTPUTS

-
  type     - type of the object, possible values:
-              H5I_FILE_F
-              H5I_GROUP_F
-              H5I_DATATYPE_F
-              H5I_DATASPACE_F
-              H5I_DATASET_F
-              H5I_ATTR_F
-              H5I_BADID_F
-  hdferr:  - error code
-              Success:  0
-              Failure: -1
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces were added for
-  called C functions (it is needed for Windows
-  port).  March 5, 2001
-
-

SOURCE

-
  SUBROUTINE h5iget_type_f(obj_id, TYPE, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: obj_id  ! Object identifier
-    INTEGER, INTENT(OUT) :: TYPE ! type of an object.
-                                 ! possible values are:
-                                 !   H5I_FILE_F
-                                 !   H5I_GROUP_F
-                                 !   H5I_DATATYPE_F
-                                 !   H5I_DATASPACE_F
-                                 !   H5I_DATASET_F
-                                 !   H5I_ATTR_F
-                                 !   H5I_BADID_F
-    INTEGER, INTENT(OUT) :: hdferr  ! Error code
-
- -
- -

h5iinc_ref_f

- -

[ Top ] [ H5I ] [ Subroutines ]

-

NAME

-
  h5iinc_ref_f
-
-

PURPOSE

-
  Increments the reference count of an ID
-
-

INPUTS

-
  obj_id        - object identifier
-
-

OUTPUTS

-
  ref_count     - Current reference count of the ID
-  hdferr:              - error code
-  Success:  0
-  Failure: -1
-
-

AUTHOR

-
  Quincey Koziol
-  December  9, 2003
-
-

SOURCE

-
  SUBROUTINE h5iinc_ref_f(obj_id, ref_count, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: obj_id ! Object identifier
-    INTEGER, INTENT(OUT) :: ref_count    ! Current reference count of ID
-    INTEGER, INTENT(OUT) :: hdferr       ! Error code
-
- -
- -

h5iis_valid_f

- -

[ Top ] [ H5I ] [ Subroutines ]

-

NAME

-
  h5iget_file_id_f
-
-

PURPOSE

-
  Check if an ID is valid without producing an error message
-
-

INPUTS

-
  id           - identifier 
-
-

OUTPUTS

-
  valid        - status of id as a valid identifier
-  hdferr:      - error code            
-                  Success:  0
-                  Failure: -1
-
-

AUTHOR

-
  M. Scot Breitenfeld
-  April 13, 2009
-
-

SOURCE

-
  SUBROUTINE h5iis_valid_f(id, valid, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN)  :: id ! Identifier 
-    LOGICAL, INTENT(OUT) :: valid     ! Status of id as a valid identifier
-    INTEGER, INTENT(OUT) :: hdferr    ! Error code
-
- -
- - - diff --git a/fortran/doc/DevelGuide/src/H5Lf_c.html b/fortran/doc/DevelGuide/src/H5Lf_c.html deleted file mode 100644 index 9adb759..0000000 --- a/fortran/doc/DevelGuide/src/H5Lf_c.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - -./src/H5Lf.c - - - - - -
-
- -

H5Lf

- -

[ Top ] [ Modules ]

-

PURPOSE

-
   This file contains C stubs for H5L Fortran APIs
-
- -
- - - diff --git a/fortran/doc/DevelGuide/src/H5Lff_F03_f90.html b/fortran/doc/DevelGuide/src/H5Lff_F03_f90.html deleted file mode 100644 index 6b9640b..0000000 --- a/fortran/doc/DevelGuide/src/H5Lff_F03_f90.html +++ /dev/null @@ -1,181 +0,0 @@ - - - - - - - -./src/H5Lff_F03.f90 - - - - - -
-
- -

H5L (F03)

- -

[ Top ] [ Modules ]

-

NAME

-
  H5L_PROVISIONAL
-
-

FILE

-
  src/fortran/src/H5Lff_F03.f90
-
-

PURPOSE

-
  This file contains Fortran 90 and Fortran 2003 interfaces for H5L functions.
-  It contains the same functions as H5Lff_DEPRECIATE.f90 but includes the
-  Fortran 2003 functions and the interface listings. This file will be compiled
-  instead of H5Lff_DEPRECIATE.f90 if Fortran 2003 functions are enabled.
-
-

NOTES

-
                         *** IMPORTANT ***
-  If you add a new H5A function you must add the function name to the
-  Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory.
-  This is needed for Windows based operating systems.
-
- -
- -

h5literate_by_name_f

- -

[ Top ] [ H5L (F03) ] [ Subroutines ]

-

NAME

-
  h5literate_by_name_f
-
-

PURPOSE

-
  Iterates through links in a group.
-
-

INPUTS

-
  loc_id        - File or group identifier specifying location of subject group
-  group_name    - Name of subject group
-  index_type    - Type of index which determines the order
-  order         - Order within index
-  idx           - Iteration position at which to start
-  op            - Callback function passing data regarding the link to the calling application
-  op_data       - User-defined pointer to data required by the application for its processing of the link
-
-

OUTPUTS

-
  idx      - Position at which an interrupted iteration may be restarted
-  hdferr   - Error code:
-               Success:  0
-               Failure: -1
-
-

OPTIONAL PARAMETERS

-
  lapl_id  - Link access property list
-
-

AUTHOR

-
  M. Scot Breitenfeld
-  Augest 18, 2008
-
-

SOURCE

-
  SUBROUTINE h5literate_by_name_f(loc_id, group_name, index_type, order, idx, op, op_data, return_value, hdferr, lapl_id)
-    USE ISO_C_BINDING
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: loc_id    ! Identifier specifying subject group
-    CHARACTER(LEN=*) :: group_name          ! Name of subject group
-    INTEGER, INTENT(IN) :: index_type       ! Type of index which determines the order:
-                                                ! H5_INDEX_NAME_F - Alpha-numeric index on name
-                                                ! H5_INDEX_CRT_ORDER_F - Index on creation order
-    INTEGER, INTENT(IN) :: order            ! Order within index:
-                                                ! H5_ITER_INC_F - Increasing order
-                                                ! H5_ITER_DEC_F - Decreasing order
-                                                ! H5_ITER_NATIVE_F - Fastest available order
-    INTEGER(HSIZE_T), INTENT(INOUT) :: idx  ! IN : Iteration position at which to start
-                                            ! OUT: Position at which an interrupted iteration may be restarted
-
-    TYPE(C_FUNPTR):: op      ! Callback function passing data regarding the link to the calling application
-    TYPE(C_PTR)   :: op_data ! User-defined pointer to data required by the application for its processing of the link
-
-    INTEGER, INTENT(OUT) :: return_value ! Success:   The return value of the first operator that
-                                         !            returns non-zero, or zero if all members were
-                                         !            processed with no operator returning non-zero.
-
-                                         ! Failure:   Negative if something goes wrong within the
-                                         !            library, or the negative value returned by one
-                                         !            of the operators.
-
-    INTEGER, INTENT(OUT) :: hdferr       ! Error code:
-                                         ! 0 on success and -1 on failure
-
-    INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list
-
- -
- -

h5literate_f

- -

[ Top ] [ H5L (F03) ] [ Subroutines ]

-

NAME

-
  h5literate_f
-
-

PURPOSE

-
  Iterates through links in a group.
-
-

INPUTS

-
  group_id      - Identifier specifying subject group
-  index_type    - Type of index which determines the order
-  order         - Order within index
-  idx           - Iteration position at which to start
-  op            - Callback function passing data regarding the link to the calling application
-  op_data       - User-defined pointer to data required by the application for its processing of the link
-
-

OUTPUTS

-
  idx           - Position at which an interrupted iteration may be restarted
-  hdferr        - Error code:
-                    Success:  0
-                    Failure: -1
-
-

AUTHOR

-
  M. Scot Breitenfeld
-  July 8, 2008
-
-

SOURCE

-
  SUBROUTINE h5literate_f(group_id, index_type, order, idx, op, op_data, return_value, hdferr)
-    USE ISO_C_BINDING
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: group_id  ! Identifier specifying subject group
-    INTEGER, INTENT(IN) :: index_type       ! Type of index which determines the order:
-                                                ! H5_INDEX_NAME_F - Alpha-numeric index on name
-                                                ! H5_INDEX_CRT_ORDER_F - Index on creation order
-    INTEGER, INTENT(IN) :: order            ! Order within index:
-                                                ! H5_ITER_INC_F - Increasing order
-                                                ! H5_ITER_DEC_F - Decreasing order
-                                                ! H5_ITER_NATIVE_F - Fastest available order
-    INTEGER(HSIZE_T), INTENT(INOUT) :: idx  ! IN : Iteration position at which to start
-                                            ! OUT: Position at which an interrupted iteration may be restarted
-
-    TYPE(C_FUNPTR):: op      ! Callback function passing data regarding the link to the calling application
-    TYPE(C_PTR)   :: op_data ! User-defined pointer to data required by the application for its processing of the link
-
-    INTEGER, INTENT(OUT) :: return_value ! Success:   The return value of the first operator that
-                                         !            returns non-zero, or zero if all members were
-                                         !            processed with no operator returning non-zero.
-
-                                         ! Failure:   Negative if something goes wrong within the
-                                         !            library, or the negative value returned by one
-                                         !            of the operators.
-
-    INTEGER, INTENT(OUT) :: hdferr       ! Error code:
-                                         ! 0 on success and -1 on failure
-
- -
- - - diff --git a/fortran/doc/DevelGuide/src/H5Lff_F90_f90.html b/fortran/doc/DevelGuide/src/H5Lff_F90_f90.html deleted file mode 100644 index 6d1a9bb..0000000 --- a/fortran/doc/DevelGuide/src/H5Lff_F90_f90.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - -./src/H5Lff_F90.f90 - - - - - -
-
- -

H5L (F90)

- -

[ Top ] [ Modules ]

-

NAME

-
  MODULE H5L_PROVISIONAL
-
-

PURPOSE

-
  This file contains Fortran 90 interfaces for H5L functions. It contains
-  the same functions as H5Lff_F03.f90 but excludes the Fortran 2003 functions
-  and the interface listings. This file will be compiled instead of H5Lff_F03.f90
-  if Fortran 2003 functions are not enabled.
-
- NOTE
-  Currently contains no functions.
-
- -
- - - diff --git a/fortran/doc/DevelGuide/src/H5Lff_f90.html b/fortran/doc/DevelGuide/src/H5Lff_f90.html deleted file mode 100644 index 1a209f2..0000000 --- a/fortran/doc/DevelGuide/src/H5Lff_f90.html +++ /dev/null @@ -1,637 +0,0 @@ - - - - - - - -./src/H5Lff.f90 - - - - - -
-
- -

H5L

- -

[ Top ] [ Modules ]

-

NAME

-
  MODULE H5L
-
-

PURPOSE

-
  This file contains Fortran interfaces for H5L functions. It includes
-  all the functions that are independent on whether the Fortran 2003 functions
-  are enabled or disabled.
-
-

NOTES

-
                         *** IMPORTANT ***
-  If you add a new H5L function you must add the function name to the
-  Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory.
-  This is needed for Windows based operating systems.
-
- -
- -

h5lcopy_f

- -

[ Top ] [ H5L ] [ Subroutines ]

-

NAME

-
  h5lcopy_f
-
-

PURPOSE

-
  Copies a link from one location to another.
-
-

INPUTS

-
  src_loc_id    - Location identifier of the source link
-  src_name      - Name of the link to be copied
-  dest_loc_id   - Location identifier specifying the destination of the copy
-  dest_name     - Name to be assigned to the NEW copy
-  loc_id        - Identifier of the file or group containing the object
-  name          - Name of the link to delete
-
-

OUTPUTS

-
  hdferr        - Returns 0 if successful and -1 if fails
-
-

OPTIONAL PARAMETERS

-
  lcpl_id       - Link creation property list identifier
-  lapl_id       - Link access property list identifier
-
-

AUTHOR

-
  M. Scot Breitenfeld
-  February 27, 2008
-
-

SOURCE

-
  SUBROUTINE h5lcopy_f(src_loc_id, src_name, dest_loc_id, dest_name, hdferr, &
-       lcpl_id, lapl_id)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: src_loc_id  ! Location identifier of the source link
-    CHARACTER(LEN=*), INTENT(IN) :: src_name   ! Name of the link to be copied
-    INTEGER(HID_T), INTENT(IN) :: dest_loc_id ! Location identifier specifying the destination of the copy
-    CHARACTER(LEN=*), INTENT(IN) :: dest_name ! Name to be assigned to the NEW copy
-
-    INTEGER, INTENT(OUT) :: hdferr        ! Error code:
-                                          ! 0 on success and -1 on failure
-    INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lcpl_id ! Link creation property list identifier
-    INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list identifier
-
- -
- -

H5Lcreate_external_f

- -

[ Top ] [ H5L ] [ Subroutines ]

-

NAME

-
  H5Lcreate_external_f
-
-

PURPOSE

-
  Creates a soft link to an object in a different file.
-
-

INPUTS

-
  file_name     - Name of the file containing the target object. Neither the file nor the target object is
-  required to exist. May be the file the link is being created in.
-  obj_name      - Path within the target file to the target object.
-  link_loc_id   - The file or group identifier for the new link.
-  link_name     - The name of the new link.
-
-

OUTPUTS

-
  hdferr        - Returns 0 if successful and -1 if fails
-
-

OPTIONAL PARAMETERS

-
  lcpl_id       - Link creation property list identifier.
-  lapl_id       - Link access property list identifier.
-
-

AUTHOR

-
  M. Scot Breitenfeld
-  February 27, 2008
-
-

SOURCE

-
  SUBROUTINE h5lcreate_external_f(file_name, obj_name, link_loc_id, link_name, hdferr, lcpl_id, lapl_id)
-    IMPLICIT NONE
-    CHARACTER(LEN=*), INTENT(IN) :: file_name ! Name of the file containing the target object. Neither
-                                              ! the file nor the target object is required to exist.
-                                              ! May be the file the link is being created in.
-    CHARACTER(LEN=*), INTENT(IN) :: obj_name  ! Name of the target object, which must already exist.
-    INTEGER(HID_T), INTENT(IN) :: link_loc_id ! The file or group identifier for the new link.
-    CHARACTER(LEN=*), INTENT(IN) :: link_name ! The name of the new link.
-
-    INTEGER, INTENT(OUT) :: hdferr        ! Error code:
-                                          ! 0 on success and -1 on failure
-
-    INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lcpl_id ! Link creation property list identifier.
-    INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list identifier.
-
- -
- -

H5Lcreate_hard_f

- -

[ Top ] [ H5L ] [ Subroutines ]

-

NAME

-
  H5Lcreate_hard_f
-
-

PURPOSE

-
  Creates a hard link to an object.
-
-

INPUTS

-
  obj_loc_id    - The file or group identifier for the target object.
-  obj_name      - Name of the target object, which must already exist.
-  link_loc_id   - The file or group identifier for the new link.
-  link_name     - The name of the new link.
-
-

OUTPUTS

-
  hdferr        - Returns 0 if successful and -1 if fails
-
-

OPTIONAL PARAMETERS

-
  lcpl_id       - Link creation property list identifier.
-  lapl_id       - Link access property list identifier.
-
-

AUTHOR

-
  M. Scot Breitenfeld
-  February 27, 2008
-
-

SOURCE

-
  SUBROUTINE h5lcreate_hard_f(obj_loc_id, obj_name, link_loc_id, link_name, hdferr, lcpl_id, lapl_id)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: obj_loc_id  ! The file or group identifier for the target object.
-    CHARACTER(LEN=*), INTENT(IN) :: obj_name  ! Name of the target object, which must already exist.
-    INTEGER(HID_T), INTENT(IN) :: link_loc_id ! The file or group identifier for the new link.
-    CHARACTER(LEN=*), INTENT(IN) :: link_name ! The name of the new link.
-
-    INTEGER, INTENT(OUT) :: hdferr        ! Error code:
-                                          ! 0 on success and -1 on failure
-
-    INTEGER(HID_T), OPTIONAL, INTENT(IN) ::   lcpl_id         ! Link creation property list identifier.
-    INTEGER(HID_T), OPTIONAL, INTENT(IN) ::   lapl_id         ! Link access property list identifier.
-
- -
- -

H5Lcreate_soft_f

- -

[ Top ] [ H5L ] [ Subroutines ]

-

NAME

-
  H5Lcreate_soft_f
-
-

PURPOSE

-
  Creates a soft link to an object.
-
-

INPUTS

-
  target_path   - Path to the target object, which is not required to exist.
-  link_loc_id   - The file or group identifier for the new link.
-  link_name     - The name of the new link.
-
-

OUTPUTS

-
  hdferr        - Returns 0 if successful and -1 if fails
-
-

OPTIONAL PARAMETERS

-
  lcpl_id       - Link creation property list identifier.
-  lapl_id       - Link access property list identifier.
-
-

AUTHOR

-
  M. Scot Breitenfeld
-  February 20, 2008
-
-

SOURCE

-
  SUBROUTINE h5lcreate_soft_f(target_path, link_loc_id, link_name, hdferr, lcpl_id, lapl_id)
-    IMPLICIT NONE
-    CHARACTER(LEN=*), INTENT(IN) :: target_path   ! Path to the target object, which is not required to exist.
-    INTEGER(HID_T), INTENT(IN) :: link_loc_id     ! The file or group identifier for the new link.
-    CHARACTER(LEN=*), INTENT(IN) :: link_name     ! The name of the new link.
-    INTEGER, INTENT(OUT) :: hdferr                ! Error code:
-                                                  !   0 on success and -1 on failure
-    INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lcpl_id ! Link creation property list identifier.
-    INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list identifier.
-
- -
- -

h5ldelete_by_idx_f

- -

[ Top ] [ H5L ] [ Subroutines ]

-

NAME

-
  h5ldelete_by_idx_f
-
-

PURPOSE

-
  Removes the nth link in a group.
-
-

INPUTS

-
  loc_id        - File or group identifier specifying location of subject group
-  group_name    - Name of subject group
-  index_field   - Type of index; Possible values are:
-                    H5_INDEX_UNKNOWN_F = -1  - Unknown index type
-                    H5_INDEX_NAME_F          - Index on names
-                    H5_INDEX_CRT_ORDER_F     - Index on creation order
-                    H5_INDEX_N_F             - Number of indices defined
-
-  order         - Order within field or index; Possible values are:
-                    H5_ITER_UNKNOWN_F   - Unknown order
-                    H5_ITER_INC_F       - Increasing order
-                    H5_ITER_DEC_F       - Decreasing order
-                    H5_ITER_NATIVE_F    - No particular order, whatever is fastest
-                    H5_ITER_N_F         - Number of iteration orders
-
-  n             - Link for which to retrieve information
-
-

OUTPUTS

-
  hdferr        - Returns 0 if successful and -1 if fails
-
-

OPTIONAL PARAMETERS

-
  lapl_id       - Link access property list
-
-

AUTHOR

-
  M. Scot Breitenfeld
-  February 29, 2008
-
-

SOURCE

-
  SUBROUTINE h5ldelete_by_idx_f(loc_id, group_name, index_field, order, n, hdferr, lapl_id)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: loc_id       ! Identifer for object to which attribute is attached
-    CHARACTER(LEN=*), INTENT(IN) :: group_name ! Name of object, relative to location,
-                                               !  from which attribute is to be removed
-    INTEGER, INTENT(IN) :: index_field         ! Type of index; Possible values are:
-                                               !    H5_INDEX_UNKNOWN_F   - Unknown index type
-                                               !    H5_INDEX_NAME_F      - Index on names
-                                               !    H5_INDEX_CRT_ORDER_F - Index on creation order
-                                               !    H5_INDEX_N_F              - Number of indices defined
-    INTEGER, INTENT(IN) :: order               ! Order in which to iterate over index; Possible values are:
-                                               !    H5_ITER_UNKNOWN_F  - Unknown order
-                                               !    H5_ITER_INC_F      - Increasing order
-                                               !    H5_ITER_DEC_F      - Decreasing order
-                                               !    H5_ITER_NATIVE_F   - No particular order, whatever is fastest
-                                               !    H5_ITER_N_F     - Number of iteration orders
-    INTEGER(HSIZE_T), INTENT(IN) :: n      ! Offset within index
-    INTEGER, INTENT(OUT) :: hdferr         ! Error code:
-                                           ! 0 on success and -1 on failure
-    INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id     ! Link access property list
-
- -
- -

h5ldelete_f

- -

[ Top ] [ H5L ] [ Subroutines ]

-

NAME

-
  h5ldelete_f
-
-

PURPOSE

-
  Removes a link from a group.
-
-

INPUTS

-
  loc_id        - Identifier of the file or group containing the object
-  name          - Name of the link to delete
-
-

OUTPUTS

-
  hdferr        - Returns 0 if successful and -1 if fails
-
-

OPTIONAL PARAMETERS

-
  lapl_id       - Link access property list identifier
-
-

AUTHOR

-
  M. Scot Breitenfeld
-  January, 2008
-
-

SOURCE

-
  SUBROUTINE h5ldelete_f(loc_id, name, hdferr, lapl_id)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: loc_id  ! Identifier of the file or group containing the object
-    CHARACTER(LEN=*), INTENT(IN) :: name  ! Name of the link to delete
-    INTEGER, INTENT(OUT) :: hdferr        ! Error code:
-                                          ! 0 on success and -1 on failure
-    INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list identifier
-
- -
- -

H5Lexists_f

- -

[ Top ] [ H5L ] [ Subroutines ]

-

NAME

-
  H5Lexists_f
-
-

PURPOSE

-
  Check if a link with a particular name exists in a group.
-
-

INPUTS

-
  loc_id        - Identifier of the file or group to query.
-  name          - Link name to check
-
-

OUTPUTS

-
  link_exists   - link exists status (.TRUE.,.FALSE.)
-  hdferr        - Returns 0 if successful and -1 if fails
-
-

OPTIONAL PARAMETERS

-
  lapl_id       - Link access property list identifier.
-
-

AUTHOR

-
  M. Scot Breitenfeld
-  February 29, 2008
-
-

SOURCE

-
  SUBROUTINE h5lexists_f(loc_id, name, link_exists, hdferr, lapl_id)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: loc_id  ! Identifier of the file or group to query.
-    CHARACTER(LEN=*), INTENT(IN) :: name  ! Link name to check.
-    LOGICAL, INTENT(OUT) :: link_exists   ! .TRUE. if exists, .FALSE. otherwise
-    INTEGER, INTENT(OUT) :: hdferr        ! Error code:
-                                          ! 0 on success and -1 on failure
-    INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id
-                                          ! Link access property list identifier.
-
- -
- -

h5lget_info_by_idx_f

- -

[ Top ] [ H5L ] [ Subroutines ]

-

NAME

-
  h5lget_info_by_idx_f
-
-

PURPOSE

-
  Retrieves metadata for a link in a group, according to the order within a field or index.
-
-

INPUTS

-
  loc_id        - File or group identifier specifying location of subject group
-  group_name    - Name of subject group
-  index_field   - Index or field which determines the order
-  order         - Order within field or index
-  n             - Link for which to retrieve information
-
-

OUTPUTS

-
            NOTE: In C these are defined as a structure: H5L_info_t
-  corder_valid  - Indicates whether the creation order data is valid for this attribute
-  corder        - Is a positive integer containing the creation order of the attribute
-  cset          - Indicates the character set used for the attribute’s name 
- address        - If the link is a hard link, address specifies the file address that the link points to
- val_size       - If the link is a symbolic link, val_size will be the length of the link value, e.g., 
-                  the length of the name of the pointed-to object with a null terminator.
- hdferr         - Returns 0 if successful and -1 if fails
-
-

OPTIONAL PARAMETERS

-
  lapl_id       - Link access property list
-
-

AUTHOR

-
  M. Scot Breitenfeld
-  February 29, 2008
-
-

HISTORY

-
   Changed the link_type names to match those in C (bug 1720) from,
-   H5L_LINK_HARD_F, H5L_LINK_SOFT_F,H5L_LINK_EXTERNAL_F,H5L_LINK_ERROR_F
-   to
-   H5L_TYPE_HARD_F, H5L_TYPE_SOFT_F,H5L_TYPE_EXTERNAL_F,H5L_TYPE_ERROR_F
-   MSB January 8, 2010.  
-
-

SOURCE

-
  SUBROUTINE h5lget_info_by_idx_f(loc_id, group_name, index_field, order, n, &
-       link_type, f_corder_valid, corder, cset, address, val_size, hdferr, lapl_id)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: loc_id       ! File or group identifier specifying location of subject group  
-    CHARACTER(LEN=*), INTENT(IN) :: group_name ! Name of subject group
-    INTEGER, INTENT(IN) :: index_field  ! Index or field which determines the order
-                                        !    H5_INDEX_UNKNOWN_F   - Unknown index type
-                                        !    H5_INDEX_NAME_F      - Index on names
-                                        !    H5_INDEX_CRT_ORDER_F - Index on creation order
-                                        !    H5_INDEX_N_F             - Number of indices defined
-    INTEGER, INTENT(IN) :: order        ! Order in which to iterate over index; Possible values are:
-                                        !    H5_ITER_UNKNOWN_F  - Unknown order
-                                        !    H5_ITER_INC_F      - Increasing order
-                                        !    H5_ITER_DEC_F      - Decreasing order
-                                        !    H5_ITER_NATIVE_F   - No particular order, whatever is fastest
-    INTEGER(HSIZE_T), INTENT(IN) :: n   ! Attributeâs position in index
-    INTEGER, INTENT(OUT) :: link_type ! Specifies the link class:
-                                      !  H5L_TYPE_HARD_F      - Hard link
-                                      !  H5L_TYPE_SOFT_F      - Soft link
-                                      !  H5L_TYPE_EXTERNAL_F  - External link
-                                      !  H5L_TYPE_ERROR _F    - Error
-    LOGICAL, INTENT(OUT) :: f_corder_valid ! Indicates whether the creation order data is valid for this attribute 
-    INTEGER, INTENT(OUT) :: corder         ! Is a positive integer containing the creation order of the attribute
-    INTEGER, INTENT(OUT) :: cset           ! Indicates the character set used for the attributeâs name
-    INTEGER(HADDR_T), INTENT(OUT) :: address  ! If the link is a hard link, address specifies the file address that the link points to
-    INTEGER(SIZE_T), INTENT(OUT) :: val_size  ! If the link is a symbolic link, val_size will be the length of the link value, e.g., 
-                                              ! the length of the name of the pointed-to object with a null terminator. 
-    INTEGER, INTENT(OUT) :: hdferr       ! Error code:
-                                         ! 0 on success and -1 on failure
-    INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id  ! Link access property list
-
- -
- -

h5lget_info_f

- -

[ Top ] [ H5L ] [ Subroutines ]

-

NAME

-
  h5lget_info_f
-
-

PURPOSE

-
  Returns information about a link.
-
-

INPUTS

-
  link_loc_id   - File or group identifier.
-  link_name     - Name of the link for which information is being sought
-
-

OUTPUTS

-
            NOTE: In C these are contained in the structure H5L_info_t
-
-  cset          - indicates the character set used for link’s name.
-  corder        - specifies the link’s creation order position.
-  corder_valid  - indicates whether the value in corder is valid.
-  link_type     - specifies the link class:
-                    H5L_TYPE_HARD_F     - Hard link
-                    H5L_TYPE_SOFT_F     - Soft link
-                    H5L_TYPE_EXTERNAL_F - External link
-                    H5L_TYPE_ERROR_ F   - Error
-  address       - If the link is a hard link, address specifies the file address that the link points to
-  val_size      - If the link is a symbolic link, val_size will be the length of the link value, e.g., 
-                  the length of the name of the pointed-to object with a null terminator. 
-  hdferr        - Returns 0 if successful and -1 if fails
-
-

OPTIONAL PARAMETERS

-
  lapl_id       - Link access property list
-
-

AUTHOR

-
  M. Scot Breitenfeld
-  February 29, 2008
-
-

HISTORY

-
   Changed the link_type names to match those in C (bug 1720) from,
-   H5L_LINK_HARD_F, H5L_LINK_SOFT_F,H5L_LINK_EXTERNAL_F,H5L_LINK_ERROR_F
-   to
-   H5L_TYPE_HARD_F, H5L_TYPE_SOFT_F,H5L_TYPE_EXTERNAL_F,H5L_TYPE_ERROR_F
-   MSB January 8, 2010.
-
-

SOURCE

-
  SUBROUTINE h5lget_info_f(link_loc_id, link_name, &
-       cset, corder, f_corder_valid, link_type, address, val_size, &
-       hdferr, lapl_id)
-    IMPLICIT NONE
-
-    INTEGER(HID_T), INTENT(IN) :: link_loc_id ! File or group identifier.
-    CHARACTER(LEN=*), INTENT(IN) :: link_name ! Name of the link for which information is being sought
-
-! OUTPUTS  NOTE: In C these are contained in the structure H5L_info_t
-    INTEGER, INTENT(OUT) :: cset ! Indicates the character set used for the linkâs name.
-    INTEGER, INTENT(OUT) :: corder ! Specifies the linkâs creation order position.
-    LOGICAL, INTENT(OUT) :: f_corder_valid ! Indicates whether the value in corder is valid.
-    INTEGER, INTENT(OUT) :: link_type ! Specifies the link class:
-                                      !  H5L_TYPE_HARD_F      - Hard link
-                                      !  H5L_TYPE_SOFT_F      - Soft link
-                                      !  H5L_TYPE_EXTERNAL_F  - External link
-                                      !  H5L_TYPE_ERROR _F    - Error
-    INTEGER(HADDR_T), INTENT(OUT) :: address ! If the link is a hard link, address specifies the file address that the link points to
-    INTEGER(SIZE_T), INTENT(OUT) :: val_size ! If the link is a symbolic link, val_size will be the length of the link value, e.g., 
-                                             ! the length of the name of the pointed-to object with a null terminator. 
-    INTEGER, INTENT(OUT) :: hdferr       ! Error code:
-                                         ! 0 on success and -1 on failure
-    INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id  ! Link access property list
-
- -
- -

h5lget_name_by_idx_f

- -

[ Top ] [ H5L ] [ Subroutines ]

-

NAME

-
  h5lget_name_by_idx_f
-
-

PURPOSE

-
  Retrieves name of the nth link in a group, according to the order within a specified field or index.
-
-

INPUTS

-
  loc_id        - File or group identifier specifying location of subject group
-  group_name    - Name of subject group
-  index_field   - Index or field which determines the order
-  order         - Order within field or index
-  n             - Link for which to retrieve information
-
-

OUTPUTS

-
  name          - Buffer in which link value is returned
-  hdferr        - Returns 0 if successful and -1 if fails
-
-

OPTIONAL PARAMETERS

-
  lapl_id       - List access property list identifier.
-  size          - Maximum number of characters of link value to be returned.
-
-

AUTHOR

-
  M. Scot Breitenfeld
-  March 10, 2008
-
-

SOURCE

-
  SUBROUTINE h5lget_name_by_idx_f(loc_id, group_name, index_field, order, n, &
-        name, hdferr, size, lapl_id)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: loc_id       ! File or group identifier specifying location of subject group
-    CHARACTER(LEN=*), INTENT(IN) :: group_name ! Name of subject group
-    INTEGER, INTENT(IN) :: index_field  ! Index or field which determines the order
-                                        !    H5_INDEX_UNKNOWN_F   - Unknown index type
-                                        !    H5_INDEX_NAME_F      - Index on names
-                                        !    H5_INDEX_CRT_ORDER_F - Index on creation order
-                                        !    H5_INDEX_N_F             - Number of indices defined
-    INTEGER, INTENT(IN) :: order        ! Order in which to iterate over index; Possible values are:
-                                        !    H5_ITER_UNKNOWN_F  - Unknown order
-                                        !    H5_ITER_INC_F      - Increasing order
-                                        !    H5_ITER_DEC_F      - Decreasing order
-                                        !    H5_ITER_NATIVE_F   - No particular order, whatever is fastest
-    INTEGER(HSIZE_T), INTENT(IN) :: n   ! Attributeâs position in index
-    CHARACTER(LEN=*), INTENT(OUT) :: name ! Buffer in which link value is returned
-    INTEGER, INTENT(OUT) :: hdferr        ! Error code:
-                                          ! 0 on success and -1 on failure
-
- -
- -

h5lis_registered_f

- -

[ Top ] [ H5L ] [ Subroutines ]

-

NAME

-
  h5lis_registered_f
-
-

PURPOSE

-
  Determines whether a class of user-defined links is registered.
-
-

INPUTS

-
  link_cls_id   - User-defined link class identifier
-
-

OUTPUTS

-
  registered    - .TRUE.  - if the link class has been registered
-                  .FALSE. - if it is unregistered
-  hdferr        - Error code
-  Success:  0
-  Failure: -1
-
-

AUTHOR

-
  M. Scot Breitenfeld
-  February 29, 2008
-
-

SOURCE

-
  SUBROUTINE h5lis_registered_f(link_cls_id, registered, hdferr)
-    IMPLICIT NONE
-    INTEGER, INTENT(IN) :: link_cls_id  ! User-defined link class identifier
-    LOGICAL, INTENT(OUT) :: registered  ! .TRUE. - if the link class has been registered and
-                                        ! .FALSE. - if it is unregistered
-    INTEGER, INTENT(OUT) :: hdferr      ! Error code:
-                                        ! 0 on success and -1 on failure
-
- -
- -

h5lmove_f

- -

[ Top ] [ H5L ] [ Subroutines ]

-

NAME

-
  h5lmove_f
-
-

PURPOSE

-
  Renames a link within an HDF5 file.
-
-

INPUTS

-
  src_loc_id    - Original file or group identifier.
-  src_name      - Original link name.
-  dest_loc_id   - Destination file or group identifier.
-  dest_name     - NEW link name.
-
-

OUTPUTS

-
  hdferr        - Error code:
-                   0 on success and -1 on failure
-
-

OPTIONAL PARAMETERS

-
  lcpl_id       - Link creation property list identifier to be associated WITH the NEW link.
-  lapl_id       - Link access property list identifier to be associated WITH the NEW link.
-
-

AUTHOR

-
  M. Scot Breitenfeld
-  March 3, 2008
-
-

SOURCE

-
  SUBROUTINE h5lmove_f(src_loc_id, src_name, dest_loc_id, dest_name, hdferr, lcpl_id, lapl_id)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: src_loc_id  ! Original file or group identifier.
-    CHARACTER(LEN=*), INTENT(IN) :: src_name  ! Original link name.
-    INTEGER(HID_T), INTENT(IN) :: dest_loc_id ! Destination file or group identifier.
-    CHARACTER(LEN=*), INTENT(IN) :: dest_name ! NEW link name.
-    INTEGER, INTENT(OUT) :: hdferr     ! Error code:
-                                              ! 0 on success and -1 on failure
-    INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lcpl_id ! Link creation property list identifier
-                                                    ! to be associated WITH the NEW link.
-    INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list identifier
-                                                    ! to be associated WITH the NEW link.
-
- -
- - - diff --git a/fortran/doc/DevelGuide/src/H5Of_c.html b/fortran/doc/DevelGuide/src/H5Of_c.html deleted file mode 100644 index e4a97e9..0000000 --- a/fortran/doc/DevelGuide/src/H5Of_c.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - -./src/H5Of.c - - - - - -
-
- -

H5Of

- -

[ Top ] [ Modules ]

-

PURPOSE

-
   This file contains C stubs for H5O Fortran APIs
-
- -
- - - diff --git a/fortran/doc/DevelGuide/src/H5Off_f90.html b/fortran/doc/DevelGuide/src/H5Off_f90.html deleted file mode 100644 index 790810e..0000000 --- a/fortran/doc/DevelGuide/src/H5Off_f90.html +++ /dev/null @@ -1,198 +0,0 @@ - - - - - - - -./src/H5Off.f90 - - - - - -
-
- -

H5O

- -

[ Top ] [ Modules ]

-

NAME

-
  MODULE H5O
-
-

FILE

-
  fortran/src/H5Off.f90
-
-

PURPOSE

-
  This file contains Fortran interfaces for H5O functions. It includes
-  all the functions that are independent on whether the Fortran 2003 functions
-  are enabled or disabled.
-
-

NOTES

-
                         *** IMPORTANT ***
-  If you add a new H5O function you must add the function name to the
-  Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory.
-  This is needed for Windows based operating systems.
-
- -
- -

h5oclose_f

- -

[ Top ] [ H5O ] [ Subroutines ]

-

NAME

-
  h5oclose_f
-
-

PURPOSE

-
  Closes an object in an HDF5 file.
-
-

INPUTS

-
  object_id     - Object identifier
-
-

OUTPUTS

-
  hdferr        - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  M. Scot Breitenfeld
-  December 17, 2008
-
-

SOURCE

-
  SUBROUTINE h5oclose_f(object_id, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN)  :: object_id
-    INTEGER,        INTENT(OUT) :: hdferr
-
- -
- -

h5olink_f

- -

[ Top ] [ H5O ] [ Subroutines ]

-

NAME

-
  h5olink_f
-
-

PURPOSE

-
  Creates a hard link to an object in an HDF5 file.
-
-

INPUTS

-
  object_id     - Object to be linked.
-  new_loc_id    - File or group identifier specifying location at which object is to be linked.
-  new_link_name - Name of link to be created, relative to new_loc_id.
-
-

OUTPUTS

-
  hdferr:       - error code
-                   Success:  0
-                   Failure: -1
-
-

OPTIONAL PARAMETERS

-
  lcpl_id       - Link creation property list identifier.
-  lapl_id       - Link access property list identifier.
-
-

AUTHOR

-
  M. Scot Breitenfeld
-  April 21, 2008
-
-

SOURCE

-
  SUBROUTINE h5olink_f(object_id, new_loc_id, new_link_name, hdferr, lcpl_id, lapl_id)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: object_id  ! Object to be linked
-    INTEGER(HID_T), INTENT(IN) :: new_loc_id ! File or group identifier specifying
-                                             ! location at which object is to be linked.
-    CHARACTER(LEN=*), INTENT(IN) :: new_link_name ! Name of link to be created, relative to new_loc_id.
-    INTEGER, INTENT(OUT) :: hdferr        ! Error code
-                                          !   Success:  0
-                                          !   Failure: -1
-    INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lcpl_id ! Link creation property list identifier.
-    INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link creation property list identifier.
-
- -
- -

h5oopen_f

- -

[ Top ] [ H5O ] [ Subroutines ]

-

NAME

-
  h5oopen_f
-
-

PURPOSE

-
  Opens an object in an HDF5 file by location identifier and path name.
-
-

INPUTS

-
  loc_id        - File or group identifier
-  name          - Path to the object, relative to loc_id.
-
-

OUTPUTS

-
  obj_id        - Object identifier for the opened object
-  hdferr:       - error code
-                   Success:  0
-                   Failure: -1
-
-

OPTIONAL PARAMETERS

-
  lapl_id       - Access property list identifier for the link pointing to the object
-
-

AUTHOR

-
  M. Scot Breitenfeld
-  April 18, 2008
-
-

SOURCE

-
  SUBROUTINE h5oopen_f(loc_id, name, obj_id, hdferr, lapl_id)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: loc_id  ! File or group identifier
-    CHARACTER(LEN=*), INTENT(IN) :: name  ! Path to the object, relative to loc_id
-    INTEGER(HID_T), INTENT(OUT) :: obj_id ! Object identifier for the opened object
-    INTEGER, INTENT(OUT) :: hdferr        ! Error code
-                                          !   Success:  0
-                                          !   Failure: -1
-    INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id  ! Attribute access property list
-
- -
- -

h5open_by_addr_f

- -

[ Top ] [ H5O ] [ Subroutines ]

-

NAME

-
  h5oopen_by_addr_f 
-
-

PURPOSE

-
  Opens an object using its address within an HDF5 file. 
-
-

INPUTS

-
    loc_id - File or group identifier
-    addr   - Object’s address in the file
- OUTPUTS: 
-    obj_id - Object identifier for the opened object
-    hdferr - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  M. Scot Breitenfeld
-  September 14, 2009
-
-

SOURCE

-
  SUBROUTINE h5oopen_by_addr_f(loc_id, addr, obj_id, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: loc_id  ! File or group identifier
-    INTEGER(HADDR_T), INTENT(IN) :: addr  ! Objectâs address in the file
-    INTEGER(HID_T), INTENT(OUT) :: obj_id ! Object identifier for the opened object
-    INTEGER, INTENT(OUT) :: hdferr        ! Error code:
-                                          ! 0 on success and -1 on failure
-
- -
- - - diff --git a/fortran/doc/DevelGuide/src/H5Pf_c.html b/fortran/doc/DevelGuide/src/H5Pf_c.html deleted file mode 100644 index 6b8079a..0000000 --- a/fortran/doc/DevelGuide/src/H5Pf_c.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - -./src/H5Pf.c - - - - - -
-
- -

H5Pf

- -

[ Top ] [ Modules ]

-

PURPOSE

-
   This file contains C stubs for H5P Fortran APIs
-
- -
- - - diff --git a/fortran/doc/DevelGuide/src/H5Pff_F03_f90.html b/fortran/doc/DevelGuide/src/H5Pff_F03_f90.html deleted file mode 100644 index 51882ba..0000000 --- a/fortran/doc/DevelGuide/src/H5Pff_F03_f90.html +++ /dev/null @@ -1,832 +0,0 @@ - - - - - - - -./src/H5Pff_F03.f90 - - - - - -
-
- -

H5P (F03)

- -

[ Top ] [ Modules ]

-

NAME

-
  H5P_PROVISIONAL
-
-

PURPOSE

-
  This file contains Fortran 90 and Fortran 2003 interfaces for H5P functions.
-  It contains the same functions as H5Pff_DEPRECIATE.f90 but includes the
-  Fortran 2003 functions and the interface listings. This file will be compiled
-  instead of H5Pff_DEPRECIATE.f90 if Fortran 2003 functions are enabled.
-
-

NOTES

-
                         *** IMPORTANT ***
-  If you add a new H5P function you must add the function name to the
-  Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory.
-  This is needed for Windows based operating systems.
-
- -
- -

h5pget_double

- -

[ Top ] [ H5P (F03) ] [ Subroutines ]

-

NAME

-
  h5pget_double
-
-

PURPOSE

-
  Gets a property list value
-
-

INPUTS

-
  prp_id        - iproperty list identifier to modify
-  name          - name of property to modify
-
-

OUTPUTS

-
  value         - value of property
-  hdferr:       - error code
-                   Success:  0
-                   Failure: -1
-
-

AUTHOR

-
  Elena Pourmal
-  October 9, 2002
-
-

SOURCE

-
  SUBROUTINE h5pget_double(prp_id, name, value, hdferr)
-    USE, INTRINSIC :: ISO_C_BINDING
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: prp_id  ! Property list identifier
-    CHARACTER(LEN=*), INTENT(IN) :: name  ! Name of property to modify
-    DOUBLE PRECISION,   INTENT(OUT), TARGET :: value ! Property value
-    INTEGER, INTENT(OUT) :: hdferr        ! Error code
-
- -
- -

h5pcreate_class_f

- -

[ Top ] [ H5P (F03) ] [ Subroutines ]

-

NAME

-
  h5pcreate_class_f
-
-

PURPOSE

-
  Create a new property list class
-
-

INPUTS

-
  parent        - Property list identifier of the parent class
-                  Possible values include:
-                   H5P_ROOT_F
-                   H5P_FILE_CREATE_F
-                   H5P_FILE_ACCESS_F
-                   H5P_DATASET_CREATE_F
-                   H5P_DATASET_XFER_F
-                   H5P_FILE_MOUNT_F
-  name          - name of the class we are creating
-
-

OUTPUTS

-
  class         - porperty list class identifier
-  hdferr:       - error code
-
-  Success: 0
-  Failure: -1
-
-

OPTIONAL PARAMETERS

-
  H5P_cls_create_func_t (create) - Callback routine called when a property list is created
-  create_data                    - User pointer to any class creation information needed
-  H5P_cls_copy_func_t   (copy)   - Callback routine called when a property list is copied
-  copy_data                      - User pointer to any class copy information needed
-  H5P_cls_close_func_t  (close)  - Callback routine called when a property list is being closed
-  close_data                     - User pointer to any class close information needed
-
-

AUTHOR

-
  Elena Pourmal
-  October 9, 2002
-
-

HISTORY

-
  Added callback arguments
-  M. Scot Breitenfeld, July 3, 2008
-
-

SOURCE

-
  SUBROUTINE h5pcreate_class_f(parent, name, class, hdferr, create, create_data, copy, copy_data, close, close_data)
-    USE iso_c_binding
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: parent  ! parent property list class identifier
-    CHARACTER(LEN=*), INTENT(IN) :: name  ! name of property tocreate
-    INTEGER(HID_T), INTENT(OUT) :: class  ! property list class identifier
-    INTEGER, INTENT(OUT) :: hdferr        ! Error code
-    TYPE(C_PTR), OPTIONAL :: create_data, copy_data, close_data
-    TYPE(C_FUNPTR), OPTIONAL :: create, copy, close
-
- -
- -

h5pget_char

- -

[ Top ] [ H5P (F03) ] [ Subroutines ]

-

NAME

-
  h5pget_char
-
-

PURPOSE

-
  Gets a property list value
-
-

INPUTS

-
  prp_id        - iproperty list identifier to modify
-  name          - name of property to modify
-
-

OUTPUTS

-
  value         - value of property
-  hdferr:       - error code
-                   Success:  0
-                   Failure: -1
-
-

AUTHOR

-
  Elena Pourmal
-  October 9, 2002
-
-

SOURCE

-
  SUBROUTINE h5pget_char(prp_id, name, value, hdferr)
-    USE, INTRINSIC :: ISO_C_BINDING
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: prp_id   ! Property list identifier
-    CHARACTER(LEN=*), INTENT(IN) :: name   ! Name of property to modify
-    CHARACTER(LEN=*), INTENT(OUT) :: value ! Property value
-    INTEGER, INTENT(OUT) :: hdferr         ! Error code
-
- -
- -

h5pget_integer

- -

[ Top ] [ H5P (F03) ] [ Subroutines ]

-

NAME

-
  h5pget_integer
-
-

PURPOSE

-
  Gets a property list value
-
-

INPUTS

-
  prp_id        - iproperty list identifier to modify
-  name          - name of property to modify
-
-

OUTPUTS

-
  value         - value of property
-  hdferr:       - error code
-                   Success:  0
-                   Failure: -1
-
-

AUTHOR

-
  Elena Pourmal
-  October 9, 2002
-
-

SOURCE

-
  SUBROUTINE h5pget_integer(prp_id, name, value, hdferr)
-    USE, INTRINSIC :: ISO_C_BINDING
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: prp_id    ! Property list identifier
-    CHARACTER(LEN=*), INTENT(IN) :: name    ! Name of property to modify
-    INTEGER,   INTENT(OUT), TARGET :: value ! Property value
-    INTEGER, INTENT(OUT) :: hdferr          ! Error code
-
- -
- -

h5pget_real

- -

[ Top ] [ H5P (F03) ] [ Subroutines ]

-

NAME

-
  h5pget_real
-
-

PURPOSE

-
  Gets a property list value
-
-

INPUTS

-
  prp_id        - iproperty list identifier to modify
-  name          - name of property to modify
-
-

OUTPUTS

-
  value         - value of property
-  hdferr:       - error code
-                   Success:  0
-                   Failure: -1
-
-

AUTHOR

-
  Elena Pourmal
-  October 9, 2002
-
-

SOURCE

-
  SUBROUTINE h5pget_real(prp_id, name, value, hdferr)
-    USE, INTRINSIC :: ISO_C_BINDING
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier
-    CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to modify
-    REAL,   INTENT(OUT), TARGET :: value ! Property value
-    INTEGER, INTENT(OUT) :: hdferr       ! Error code
-
- -
- -

h5pinsert_char

- -

[ Top ] [ H5P (F03) ] [ Subroutines ]

-

NAME

-
  h5pinsert_char
-
-

PURPOSE

-
  Registers a temporary property with a property list class.
-
-

INPUTS

-
  plist         - property list identifier
-                  permanent property within
-  name          - name of property to insert
-  size          - size of property in bytes
-  value         - initial value for the property
-
-

OUTPUTS

-
  hdferr:       - error code
-                   Success:  0
-                   Failure: -1
-
-

AUTHOR

-
  Elena Pourmal
-  October 10, 2002
-
-

SOURCE

-
  SUBROUTINE h5pinsert_char(plist, name, size, value, hdferr)
-    USE iso_c_binding
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: plist      ! Property list identifier
-    CHARACTER(LEN=*), INTENT(IN) :: name     ! Name of property to insert
-    INTEGER(SIZE_T), INTENT(IN) :: size      ! Size of property value
-    CHARACTER(LEN=*),   INTENT(IN) :: value  ! Property value
-    INTEGER, INTENT(OUT) :: hdferr           ! Error code
-
- -
- -

h5pinsert_double

- -

[ Top ] [ H5P (F03) ] [ Subroutines ]

-

NAME

-
  h5pinsert_double
-
-

PURPOSE

-
  Registers a temporary property with a property list class.
-
-

INPUTS

-
  plist         - property list identifier
-                  permanent property within
-  name          - name of property to insert
-  size          - size of property in bytes
-  value         - initial value for the property
-
-

OUTPUTS

-
  hdferr:       - error code
-                   Success:  0
-                   Failure: -1
-
-

OPTIONAL PARAMETERS

-
  NONE
-
-

AUTHOR

-
  Elena Pourmal
-  October 10, 2002
-
-

SOURCE

-
  SUBROUTINE h5pinsert_double(plist, name, size, value, hdferr)
-    USE iso_c_binding
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: plist   ! Property list identifier
-    CHARACTER(LEN=*), INTENT(IN) :: name  ! Name of property to insert
-    INTEGER(SIZE_T), INTENT(IN) :: size   ! Size of the property value
-    DOUBLE PRECISION, INTENT(IN), TARGET :: value ! Property value
-    INTEGER, INTENT(OUT) :: hdferr        ! Error code
-
- -
- -

h5pinsert_integer

- -

[ Top ] [ H5P (F03) ] [ Subroutines ]

-

NAME

-
  h5pinsert_integer
-
-

PURPOSE

-
  Registers a temporary property with a property list class.
-
-

INPUTS

-
  plist         - property list identifier
-  name          - name of property to insert
-  size          - size of property in bytes
-  value         - initial value for the property
-
-

OUTPUTS

-
  hdferr:       - error code
-                   Success:  0
-                   Failure: -1
-
-

AUTHOR

-
  Elena Pourmal
-  October 10, 2002
-
-

SOURCE

-
  SUBROUTINE h5pinsert_integer(plist, name, size, value, hdferr)
-    USE iso_c_binding
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: plist    ! Property list identifier
-    CHARACTER(LEN=*), INTENT(IN) :: name   ! Name of property to insert
-    INTEGER(SIZE_T), INTENT(IN) :: size    ! Size of the property value
-    INTEGER,   INTENT(IN), TARGET :: value ! Property value
-    INTEGER, INTENT(OUT) :: hdferr         ! Error code
-
- -
- -

h5pinsert_ptr

- -

[ Top ] [ H5P (F03) ] [ Subroutines ]

-

NAME

-
  h5pinsert_ptr
-
-

PURPOSE

-
  Registers a temporary property with a property list class.
-
-

INPUTS

-
  plist         - property list identifier
-                  permanent property within
-  name          - name of property to insert
-  size          - size of property in bytes
-  value         - initial value for the property
-
-

OUTPUTS

-
  hdferr:       - error code
-                   Success:  0
-                   Failure: -1
-
-

AUTHOR

-
  M. Scot Breitenfeld
-  June 24, 2008
-
-

SOURCE

-
  SUBROUTINE h5pinsert_ptr(plist, name, size, value, hdferr)
-    USE iso_c_binding
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: plist  ! Property list identifier
-    CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to insert
-    INTEGER(SIZE_T), INTENT(IN) :: size  ! Size of property value
-    TYPE(c_ptr),   INTENT(IN) :: value   ! Property value
-    INTEGER, INTENT(OUT) :: hdferr       ! Error code
-
- -
- -

h5pinsert_real

- -

[ Top ] [ H5P (F03) ] [ Subroutines ]

-

NAME

-
  h5pinsert_real
-
-

PURPOSE

-
  Registers a temporary property with a property list class.
-
-

INPUTS

-
  plist         - property list identifier
-                  permanent property within
-  name          - name of property to insert
-  size          - size of property in bytes
-  value         - initial value for the property
-
-

OUTPUTS

-
  hdferr:       - error code
-                   Success:  0
-                   Failure: -1
-
-

AUTHOR

-
  Elena Pourmal
-  October 10, 2002
-
-

SOURCE

-
  SUBROUTINE h5pinsert_real(plist, name, size, value, hdferr)
-    USE iso_c_binding
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: plist   ! Property list identifier
-    CHARACTER(LEN=*), INTENT(IN) :: name  ! Name of property to insert
-    INTEGER(SIZE_T), INTENT(IN) :: size   ! Size of the property value
-    REAL,   INTENT(IN), TARGET :: value   ! Property value
-    INTEGER, INTENT(OUT) :: hdferr        ! Error code
-
- -
- -

h5pregister_char

- -

[ Top ] [ H5P (F03) ] [ Subroutines ]

-

NAME

-
  h5pregister_char
-
-

PURPOSE

-
  Registers a permanent property with a property list class.
-
-

INPUTS

-
  class         - property list class to register
-                  permanent property within
-  name          - name of property to register
-  size          - size of property in bytes
-  value         - default value for property in newly
-                  created property lists
-
-

OUTPUTS

-
  hdferr:       - error code
-                   Success:  0
-                   Failure: -1
-
-

AUTHOR

-
  Elena Pourmal
-  October 10, 2002
-
-

SOURCE

-
  SUBROUTINE h5pregister_char(class, name, size, value, hdferr)
-    USE ISO_C_BINDING
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: class     ! Property list class identifier
-    CHARACTER(LEN=*), INTENT(IN) :: name    ! Name of property to register
-    INTEGER(SIZE_T), INTENT(IN) :: size     ! size of the property value
-    CHARACTER(LEN=*),   INTENT(IN) :: value ! Property value
-    INTEGER, INTENT(OUT) :: hdferr          ! Error code
-
- -
- -

h5pregister_double

- -

[ Top ] [ H5P (F03) ] [ Subroutines ]

-

NAME

-
  h5pregister_double
-
-

PURPOSE

-
  Registers a permanent property with a property list class.
-
-

INPUTS

-
  class         - property list class to register
-                  permanent property within
-  name          - name of property to register
-  size          - size of property in bytes
-  value         - default value for property in newly
-                  created property lists
-
-

OUTPUTS

-
  hdferr:       - error code
-                   Success:  0
-                   Failure: -1
-
-

AUTHOR

-
  Elena Pourmal
-  October 10, 2002
-
-

SOURCE

-
  SUBROUTINE h5pregister_double(class, name, size, value, hdferr)
-    USE ISO_C_BINDING
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: class  ! Property list class identifier
-    CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to register
-    INTEGER(SIZE_T), INTENT(IN) :: size  ! size of the property value
-    DOUBLE PRECISION,   INTENT(IN), TARGET :: value ! Property value
-    INTEGER, INTENT(OUT) :: hdferr       ! Error code
-
- -
- -

h5pregister_integer

- -

[ Top ] [ H5P (F03) ] [ Subroutines ]

-

NAME

-
  h5pregister_integer
-
-

PURPOSE

-
  Registers a permanent property with a property list class.
-
-

INPUTS

-
  class         - property list class to register
-                  permanent property within
-  name          - name of property to register
-  size          - size of property in bytes
-  value         - default value for property in newly
-                  created property lists
-
-

OUTPUTS

-
  hdferr:       - error code
-                   Success:  0
-                   Failure: -1
-
-

AUTHOR

-
  Elena Pourmal
-  October 10, 2002
-
-

SOURCE

-
  SUBROUTINE h5pregister_integer(class, name, size, value, hdferr)
-    USE ISO_C_BINDING
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: class    ! Property list class identifier
-    CHARACTER(LEN=*), INTENT(IN) :: name   ! Name of property to register
-    INTEGER(SIZE_T), INTENT(IN) :: size    ! Size of the property value
-    INTEGER,   INTENT(IN), TARGET :: value ! Property value
-    INTEGER, INTENT(OUT) :: hdferr         ! Error code
-
- -
- -

h5pregister_ptr

- -

[ Top ] [ H5P (F03) ] [ Subroutines ]

-

NAME

-
  h5pregister_ptr
-
-

PURPOSE

-
  Registers a permanent property with a property list class.
-
-

INPUTS

-
  class         - property list class to register
-                  permanent property within
-  name          - name of property to register
-  size          - size of property in bytes
-  value         - default value for property in newly
-                  created property lists
-
-

OUTPUTS

-
  hdferr:       - error code
-                   Success:  0
-                   Failure: -1
-
-

AUTHOR

-
  M. Scot Breitenfeld
-  June 24, 2008
-
-

SOURCE

-
  SUBROUTINE h5pregister_ptr(class, name, size, value, hdferr)
-    USE ISO_C_BINDING
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: class   ! Property list class identifier
-    CHARACTER(LEN=*), INTENT(IN) :: name  ! Name of property to register
-    INTEGER(SIZE_T), INTENT(IN) :: size   ! Size of the property value
-    TYPE(C_PTR), INTENT(IN) :: value      ! Property value
-    INTEGER, INTENT(OUT) :: hdferr        ! Error code
-
- -
- -

h5pregister_real

- -

[ Top ] [ H5P (F03) ] [ Subroutines ]

-

NAME

-
  h5pregister_real
-
-

PURPOSE

-
  Registers a permanent property with a property list class.
-
-

INPUTS

-
  class         - property list class to register
-                  permanent property within
-  name          - name of property to register
-  size          - size of property in bytes
-  value         - default value for property in newly
-                  created property lists
-
-

OUTPUTS

-
  hdferr:       - error code
-                   Success:  0
-                   Failure: -1
-
-

AUTHOR

-
  Elena Pourmal
-  October 10, 2002
-
-

SOURCE

-
  SUBROUTINE h5pregister_real(class, name, size, value, hdferr)
-    USE ISO_C_BINDING
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: class   ! Property list class identifier
-    CHARACTER(LEN=*), INTENT(IN) :: name  ! Name of property to register
-    INTEGER(SIZE_T), INTENT(IN) :: size   ! size of the property value
-    REAL,   INTENT(IN), TARGET :: value   ! Property value
-    INTEGER, INTENT(OUT) :: hdferr        ! Error code
-
- -
- -

h5pset(get)fill_value_f

- -

[ Top ] [ H5P (F03) ] [ Subroutines ]

-

NAME

-
  h5pset(get)fill_value_f
-
-

PURPOSE

-
  Sets(gets) fill value for a dataset creation property list
-
-

INPUTS

-
  prp_id        - dataset creation property list identifier
-  type_id       - datatype identifier for fill value
-  fillvalue     - fill value
-
-

OUTPUTS

-
  type_id       - datatype identifier for fill value
-  fillvalue     - fill value
-  hdferr:       - error code
-                   Success:  0
-                   Failure: -1
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces were added for
-  called C functions (it is needed for Windows
-  port).  March 14, 2001
-
-  Added the recommended way of passing fillvalue
-  and that is by passing the C address, all other
-  ways are obsolete and should be avoided. June, 2008 MSB
-
-

NOTES

-
  h5pset(get)fill_value_f function is overloaded to support
-  INTEGER, REAL, DOUBLE PRECISION and CHARACTER dtatypes.
-
-

SOURCE

-
  SUBROUTINE h5pset_fill_value_integer(prp_id, type_id, fillvalue, hdferr)
-    USE, INTRINSIC :: ISO_C_BINDING
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: prp_id  ! Property list identifier
-    INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier of
-                                          ! of fillvalue datatype
-                                          ! (in memory)
-    INTEGER, INTENT(IN), TARGET :: fillvalue   ! Fillvalue
-    INTEGER, INTENT(OUT) :: hdferr  ! Error code
-
- -
- -

h5pset_char

- -

[ Top ] [ H5P (F03) ] [ Subroutines ]

-

NAME

-
  h5pset_char
-
-

PURPOSE

-
  Sets a property list value
-
-

INPUTS

-
  prp_id        - iproperty list identifier to modify
-  name          - name of property to modify
-  value         - value to set property to
-
-

OUTPUTS

-
  hdferr:       - error code
-                   Success:  0
-                   Failure: -1
-
-

OPTIONAL PARAMETERS

-
  NONE
-
-

AUTHOR

-
  Elena Pourmal
-  October 9, 2002
-
-

SOURCE

-
  SUBROUTINE h5pset_char(prp_id, name, value, hdferr)
-    USE, INTRINSIC :: ISO_C_BINDING
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: prp_id    ! Property list identifier
-    CHARACTER(LEN=*), INTENT(IN) :: name    ! Name of property to modify
-    CHARACTER(LEN=*),   INTENT(IN) :: value ! Property value
-    INTEGER, INTENT(OUT) :: hdferr          ! Error code
-
- -
- -

h5pset_double

- -

[ Top ] [ H5P (F03) ] [ Subroutines ]

-

NAME

-
  h5pset_double
-
-

PURPOSE

-
  Sets a property list value
-
-

INPUTS

-
  prp_id        - iproperty list identifier to modify
-  name          - name of property to modify
-  value         - value to set property to
-
-

OUTPUTS

-
  hdferr:       - error code
-                    Success:  0
-                    Failure: -1
-
-

AUTHOR

-
  Elena Pourmal
-  October 9, 2002
-
-

SOURCE

-
  SUBROUTINE h5pset_double(prp_id, name, value, hdferr)
-    USE, INTRINSIC :: ISO_C_BINDING
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: prp_id  ! Property list identifier
-    CHARACTER(LEN=*), INTENT(IN) :: name  ! Name of property to modify
-    DOUBLE PRECISION,   INTENT(IN), TARGET :: value ! Property value
-    INTEGER, INTENT(OUT) :: hdferr                  ! Error code
-
- -
- -

h5pset_integer

- -

[ Top ] [ H5P (F03) ] [ Subroutines ]

-

NAME

-
  h5pset_integer
-
-

PURPOSE

-
  Sets a property list value
-
-

INPUTS

-
  prp_id        - iproperty list identifier to modify
-  name          - name of property to modify
-  value         - value to set property to
-
-

OUTPUTS

-
  hdferr:       - error code
-                   Success:  0
-                   Failure: -1
-
-

AUTHOR

-
  Elena Pourmal
-  October 9, 2002
-
-

SOURCE

-
  SUBROUTINE h5pset_integer(prp_id, name, value, hdferr)
-    USE, INTRINSIC :: ISO_C_BINDING
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: prp_id   ! Property list identifier
-    CHARACTER(LEN=*), INTENT(IN) :: name   ! Name of property to modify
-    INTEGER,   INTENT(IN), TARGET :: value ! Property value
-    INTEGER, INTENT(OUT) :: hdferr         ! Error code
-
- -
- -

h5pset_real

- -

[ Top ] [ H5P (F03) ] [ Subroutines ]

-

NAME

-
  h5pset_real
-
-

PURPOSE

-
  Sets a property list value
-
-

INPUTS

-
  prp_id        - iproperty list identifier to modify
-  name          - name of property to modify
-  value         - value to set property to
-
-

OUTPUTS

-
  hdferr:       - error code
-                   Success:  0
-                    Failure: -1
-
-

AUTHOR

-
  Elena Pourmal
-  October 9, 2002
-
-

SOURCE

-
  SUBROUTINE h5pset_real(prp_id, name, value, hdferr)
-    USE, INTRINSIC :: ISO_C_BINDING
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier
-    CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to modify
-    REAL,   INTENT(IN), TARGET :: value  ! Property value
-    INTEGER, INTENT(OUT) :: hdferr       ! Error code
-
- -
- - - diff --git a/fortran/doc/DevelGuide/src/H5Pff_F90_f90.html b/fortran/doc/DevelGuide/src/H5Pff_F90_f90.html deleted file mode 100644 index 5f8d579..0000000 --- a/fortran/doc/DevelGuide/src/H5Pff_F90_f90.html +++ /dev/null @@ -1,715 +0,0 @@ - - - - - - - -./src/H5Pff_F90.f90 - - - - - -
-
- -

H5P (_F90)

- -

[ Top ] [ Modules ]

-

NAME

-
  H5P_PROVISIONAL
-
-

PURPOSE

-
  This file contains Fortran 90 interfaces for H5P functions. It contains
-  the same functions as H5Pff_F03.f90 but excludes the Fortran 2003 functions
-  and the interface listings. This file will be compiled instead of H5Pff_F03.f90
-  if Fortran 2003 functions are not enabled.
-
-

NOTES

-
                         *** IMPORTANT ***
-  If you add a new H5P function you must add the function name to the
-  Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory.
-  This is needed for Windows based operating systems.
-
- -
- -

h5pcreate_class_f

- -

[ Top ] [ H5P (F90) ] [ Subroutines ]

-

NAME

-
  h5pcreate_class_f
-
-

PURPOSE

-
  Create a new property list class
-
-

INPUTS

-
  parent        - Property list identifier of the parent class
-                  Possible values include:
-                    H5P_ROOT_F
-                    H5P_FILE_CREATE_F
-                    H5P_FILE_ACCESS_F
-                    H5P_DATASET_CREATE_F
-                    H5P_DATASET_XFER_F
-                    H5P_FILE_MOUNT_F
-  name          - name of the class we are creating
-
-

OUTPUTS

-
  class         - property list class identifier
-  hdferr        - error code
-                   Success: 0
-                   Failure: -1
-
-

AUTHOR

-
  Elena Pourmal
-  October 9, 2002
-
-

SOURCE

-
  SUBROUTINE h5pcreate_class_f(parent, name, class, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: parent  ! parent property list class
-                                          ! identifier
-    CHARACTER(LEN=*), INTENT(IN) :: name  ! name of property tocreate
-    INTEGER(HID_T), INTENT(OUT) :: class  ! property list class identifier
-    INTEGER, INTENT(OUT) :: hdferr        ! Error code
-
- -
- -

h5pget_char

- -

[ Top ] [ H5P (F90) ] [ Subroutines ]

-

NAME

-
  h5pget_char
-
-

PURPOSE

-
  Gets a property list value
-
-

INPUTS

-
  prp_id        - iproperty list identifier to modify
-  name          - name of property to modify
-
-

OUTPUTS

-
  value         - value of property
-  hdferr        - error code
-                   Success:  0
-                   Failure: -1
-
-

AUTHOR

-
  Elena Pourmal
-  October 9, 2002
-
-

SOURCE

-
  SUBROUTINE h5pget_char(prp_id, name, value, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: prp_id     ! Property list identifier
-    CHARACTER(LEN=*), INTENT(IN) :: name     ! Name of property to modify
-    CHARACTER(LEN=*),   INTENT(OUT) :: value ! Property value
-    INTEGER, INTENT(OUT) :: hdferr           ! Error code
-
- -
- -

h5pget_double

- -

[ Top ] [ H5P (F90) ] [ Subroutines ]

-

NAME

-
  h5pget_double
-
-

PURPOSE

-
  Gets a property list value
-
-

INPUTS

-
  prp_id        - iproperty list identifier to modify
-  name          - name of property to modify
-
-

OUTPUTS

-
  value         - value of property
-  hdferr        - error code
-                   Success:  0
-                   Failure: -1
-
-

AUTHOR

-
  Elena Pourmal
-  October 9, 2002
-
-

SOURCE

-
  SUBROUTINE h5pget_double(prp_id, name, value, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: prp_id     ! Property list identifier
-    CHARACTER(LEN=*), INTENT(IN) :: name     ! Name of property to modify
-    DOUBLE PRECISION,   INTENT(OUT) :: value ! Property value
-    INTEGER, INTENT(OUT) :: hdferr           ! Error code
-
- -
- -

h5pget_integer

- -

[ Top ] [ H5P (F90) ] [ Subroutines ]

-

NAME

-
  h5pget_integer
-
-

PURPOSE

-
  Gets a property list value
-
-

INPUTS

-
  prp_id        - iproperty list identifier to modify
-  name          - name of property to modify
-
-

OUTPUTS

-
  value         - value of property
-  hdferr        - error code
-                   Success:  0
-                   Failure: -1
-
-

AUTHOR

-
  Elena Pourmal
-  October 9, 2002
-
-

SOURCE

-
  SUBROUTINE h5pget_integer(prp_id, name, value, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: prp_id  ! Property list identifier
-    CHARACTER(LEN=*), INTENT(IN) :: name  ! Name of property to modify
-    INTEGER,   INTENT(OUT) :: value       ! Property value
-    INTEGER, INTENT(OUT) :: hdferr        ! Error code
-
- -
- -

h5pget_real

- -

[ Top ] [ H5P (F90) ] [ Subroutines ]

-

NAME

-
  h5pget_real
-
-

PURPOSE

-
  Gets a property list value
-
-

INPUTS

-
  prp_id        - iproperty list identifier to modify
-  name          - name of property to modify
-
-

OUTPUTS

-
  value         - value of property
-  hdferr        - error code
-                   Success:  0
-                   Failure: -1
-
-

AUTHOR

-
  Elena Pourmal
-  October 9, 2002
-
-

SOURCE

-
  SUBROUTINE h5pget_real(prp_id, name, value, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: prp_id  ! Property list identifier
-    CHARACTER(LEN=*), INTENT(IN) :: name  ! Name of property to modify
-    REAL,   INTENT(OUT) :: value          ! Property value
-    INTEGER, INTENT(OUT) :: hdferr        ! Error code
-
- -
- -

h5pinsert_char

- -

[ Top ] [ H5P (F90) ] [ Subroutines ]

-

NAME

-
  h5pinsert_char
-
-

PURPOSE

-
  Registers a temporary property with a property list class.
-
-

INPUTS

-
  plist         - property list identifier
-                  permanent property within
-  name          - name of property to insert
-  size          - size of property in bytes
-  value         - initial value for the property
-
-

OUTPUTS

-
  hdferr        - error code
-                   Success:  0
-                   Failure: -1
-
-

AUTHOR

-
  Elena Pourmal
-  October 10, 2002
-
-

SOURCE

-
SUBROUTINE h5pinsert_char(plist, name, size, value, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: plist      ! Property list identifier
-    CHARACTER(LEN=*), INTENT(IN) :: name     ! Name of property to insert
-    INTEGER(SIZE_T), INTENT(IN) :: size      ! Size of property value
-    CHARACTER(LEN=*),   INTENT(IN) :: value  ! Property value
-    INTEGER, INTENT(OUT) :: hdferr           ! Error code
-
- -
- -

h5pinsert_double

- -

[ Top ] [ H5P (F90) ] [ Subroutines ]

-

NAME

-
  h5pinsert_double
-
-

PURPOSE

-
  Registers a temporary property with a property list class.
-
-

INPUTS

-
  plist         - property list identifier
-                  permanent property within
-  name          - name of property to insert
-  size          - size of property in bytes
-  value         - initial value for the property
-
-

OUTPUTS

-
  hdferr        - error code
-                   Success:  0
-                   Failure: -1
-
-

AUTHOR

-
  Elena Pourmal
-  October 10, 2002
-
-

SOURCE

-
  SUBROUTINE h5pinsert_double(plist, name, size, value, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: plist   ! Property list identifier
-    CHARACTER(LEN=*), INTENT(IN) :: name  ! Name of property to insert
-    INTEGER(SIZE_T), INTENT(IN) :: size   ! Size of the property value
-    DOUBLE PRECISION, INTENT(IN) :: value ! Property value
-    INTEGER, INTENT(OUT) :: hdferr        ! Error code
-
- -
- -

h5pinsert_integer

- -

[ Top ] [ H5P (F90) ] [ Subroutines ]

-

NAME

-
  h5pinsert_integer
-
-

PURPOSE

-
  Registers a temporary property with a property list class.
-
-

INPUTS

-
  plist         - property list identifier
-  name          - name of property to insert
-  size          - size of property in bytes
-  value         - initial value for the property
-
-

OUTPUTS

-
  hdferr        - error code
-                   Success:  0
-                   Failure: -1
-
-

AUTHOR

-
  Elena Pourmal
-  October 10, 2002
-
-

SOURCE

-
  SUBROUTINE h5pinsert_integer(plist, name, size, value, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: plist   ! Property list identifier
-    CHARACTER(LEN=*), INTENT(IN) :: name  ! Name of property to insert
-    INTEGER(SIZE_T), INTENT(IN) :: size   ! Size of the property value
-    INTEGER,   INTENT(IN) :: value        ! Property value
-    INTEGER, INTENT(OUT) :: hdferr        ! Error code
-
- -
- -

h5pinsert_real

- -

[ Top ] [ H5P (F90) ] [ Subroutines ]

-

NAME

-
  h5pinsert_real
-
-

PURPOSE

-
  Registers a temporary property with a property list class.
-
-

INPUTS

-
  plist         - property list identifier
-                  permanent property within
-  name          - name of property to insert
-  size          - size of property in bytes
-  value         - initial value for the property
-
-

OUTPUTS

-
  hdferr        - error code
-                   Success:  0
-                   Failure: -1
-
-

AUTHOR

-
  Elena Pourmal
-  October 10, 2002
-
-

SOURCE

-
  SUBROUTINE h5pinsert_real(plist, name, size, value, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: plist   ! Property list identifier
-    CHARACTER(LEN=*), INTENT(IN) :: name  ! Name of property to insert
-    INTEGER(SIZE_T), INTENT(IN) :: size   ! Size of the property value
-    REAL,   INTENT(IN) :: value           ! Property value
-    INTEGER, INTENT(OUT) :: hdferr        ! Error code
-
- -
- -

h5pregister_char

- -

[ Top ] [ H5P (F90) ] [ Subroutines ]

-

NAME

-
  h5pregister_char
-
-

PURPOSE

-
  Registers a permanent property with a property list class.
-
-

INPUTS

-
  class         - property list class to register
-                  permanent property within
-  name          - name of property to register
-  size          - size of property in bytes
-  value         - default value for property in newly
-                  created property lists
-
-

OUTPUTS

-
  hdferr        - error code
-                   Success:  0
-                   Failure: -1
-
-

AUTHOR

-
  Elena Pourmal
-  October 10, 2002
-
-

SOURCE

-
  SUBROUTINE h5pregister_char(class, name, size, value, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: class     ! Property list class identifier
-    CHARACTER(LEN=*), INTENT(IN) :: name    ! Name of property to register
-    INTEGER(SIZE_T), INTENT(IN) :: size     ! size of the property value
-    CHARACTER(LEN=*),   INTENT(IN) :: value ! Property value
-    INTEGER, INTENT(OUT) :: hdferr          ! Error code
-
- -
- -

h5pregister_double

- -

[ Top ] [ H5P (F90) ] [ Subroutines ]

-

NAME

-
  h5pregister_double
-
-

PURPOSE

-
  Registers a permanent property with a property list class.
-
-

INPUTS

-
  class         - property list class to register
-                  permanent property within
-  name          - name of property to register
-  size          - size of property in bytes
-  value         - default value for property in newly
-                  created property lists
-
-

OUTPUTS

-
  hdferr        - error code
-                   Success:  0
-                   Failure: -1
-
-

AUTHOR

-
  Elena Pourmal
-  October 10, 2002
-
-

SOURCE

-
  SUBROUTINE h5pregister_double(class, name, size, value, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: class     ! Property list class identifier
-    CHARACTER(LEN=*), INTENT(IN) :: name    ! Name of property to register
-    INTEGER(SIZE_T), INTENT(IN) :: size     ! Size of the property value
-    DOUBLE PRECISION,   INTENT(IN) :: value ! Property value
-    INTEGER, INTENT(OUT) :: hdferr          ! Error code
-
- -
- -

h5pregister_integer

- -

[ Top ] [ H5P (F90) ] [ Subroutines ]

-

NAME

-
  h5pregister_integer
-
-

PURPOSE

-
  Registers a permanent property with a property list class.
-
-

INPUTS

-
  class         - property list class to register
-  permanent property within
-  name          - name of property to register
-  size          - size of property in bytes
-  value         - default value for property in newly
-  created property lists
-
-

OUTPUTS

-
  hdferr        - error code
-                   Success:  0
-                   Failure: -1
-
-

AUTHOR

-
  Elena Pourmal
-  October 10, 2002
-
-

SOURCE

-
  SUBROUTINE h5pregister_integer(class, name, size, value, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: class   ! Property list class identifier
-    CHARACTER(LEN=*), INTENT(IN) :: name  ! Name of property to register
-    INTEGER(SIZE_T), INTENT(IN) :: size   ! Size of the property value
-    INTEGER,   INTENT(IN) :: value        ! Property value
-    INTEGER, INTENT(OUT) :: hdferr        ! Error code
-
- -
- -

h5pregister_real

- -

[ Top ] [ H5P (F90) ] [ Subroutines ]

-

NAME

-
  h5pregister_real
-
- PURPOSE       Registers a permanent property with a property list class.
-
-

INPUTS

-
  class         - property list class to register
-                  permanent property within
-  name          - name of property to register
-  size          - size of property in bytes
-  value         - default value for property in newly
-                  created property lists
-
-

OUTPUTS

-
  hdferr        - error code
-                   Success:  0
-                   Failure: -1
-
-

AUTHOR

-
  Elena Pourmal
-  October 10, 2002
-
-

SOURCE

-
  SUBROUTINE h5pregister_real(class, name, size, value, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: class   ! Property list class identifier
-    CHARACTER(LEN=*), INTENT(IN) :: name  ! Name of property to register
-    INTEGER(SIZE_T), INTENT(IN) :: size   ! size of the property value
-    REAL,   INTENT(IN) :: value           ! Property value
-    INTEGER, INTENT(OUT) :: hdferr        ! Error code
-
- -
- -

h5pset(get)fill_value_f

- -

[ Top ] [ H5P (F90) ] [ Subroutines ]

-

NAME

-
  h5pset(get)fill_value_f
-
-

PURPOSE

-
  Sets(gets) fill value for a dataset creation property list
-
-

INPUTS

-
  prp_id        - dataset creation property list identifier
-  type_id       - datatype identifier for fill value
-  fillvalue     - fill value
-
-

OUTPUTS

-
  type_id      - datatype identifier for fill value
-  fillvalue    - fill value
-  hdferr       - error code
-                  Success:  0
-                  Failure: -1
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces were added for
-  called C functions (it is needed for Windows
-  port).  March 14, 2001
-
-

NOTES

-
  h5pset(get)fill_value_f function is overloaded to support
-  INTEGER, REAL, DOUBLE PRECISION and CHARACTER dtatypes.
-
-

SOURCE

-
  SUBROUTINE h5pset_fill_value_integer(prp_id, type_id, fillvalue, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: prp_id  ! Property list identifier
-    INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier of
-                                          ! of fillvalue datatype
-                                          ! (in memory)
-    INTEGER, INTENT(IN) :: fillvalue      ! Fillvalue
-    INTEGER, INTENT(OUT) :: hdferr        ! Error code
-
- -
- -

h5pset_char

- -

[ Top ] [ H5P (F90) ] [ Subroutines ]

-

NAME

-
  h5pset_char
-
-

PURPOSE

-
  Sets a property list value
-
-

INPUTS

-
  prp_id        - iproperty list identifier to modify
-  name          - name of property to modify
-  value         - value to set property to
-
-

OUTPUTS

-
  hdferr        - error code
-                   Success:  0
-                   Failure: -1
-
-

OPTIONAL PARAMETERS

-
  NONE
-
-

AUTHOR

-
  Elena Pourmal
-  October 9, 2002
-
-

SOURCE

-
  SUBROUTINE h5pset_char(prp_id, name, value, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: prp_id    ! Property list identifier
-    CHARACTER(LEN=*), INTENT(IN) :: name    ! Name of property to modify
-    CHARACTER(LEN=*),   INTENT(IN) :: value ! Property value
-    INTEGER, INTENT(OUT) :: hdferr          ! Error code
-
- -
- -

h5pset_double

- -

[ Top ] [ H5P (F90) ] [ Subroutines ]

-

NAME

-
  h5pset_double
-
-

PURPOSE

-
  Sets a property list value
-
-

INPUTS

-
  prp_id        - iproperty list identifier to modify
-  name          - name of property to modify
-  value         - value to set property to
-
-

OUTPUTS

-
  hdferr:       - error code
-                   Success:  0
-                   Failure: -1
-
-

AUTHOR

-
  Elena Pourmal
-  October 9, 2002
-
-

SOURCE

-
  SUBROUTINE h5pset_double(prp_id, name, value, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: prp_id    ! Property list identifier
-    CHARACTER(LEN=*), INTENT(IN) :: name    ! Name of property to modify
-    DOUBLE PRECISION,   INTENT(IN) :: value ! Property value
-    INTEGER, INTENT(OUT) :: hdferr          ! Error code
-
- -
- -

h5pset_integer

- -

[ Top ] [ H5P (F90) ] [ Subroutines ]

-

NAME

-
  h5pset_integer
-
-

PURPOSE

-
  Sets a property list value
-
-

INPUTS

-
  prp_id        - iproperty list identifier to modify
-  name          - name of property to modify
-  value         - value to set property to
-
-

OUTPUTS

-
  hdferr:       - error code
-                   Success:  0
-                   Failure: -1
-
-

AUTHOR

-
  Elena Pourmal
-  October 9, 2002
-
-

SOURCE

-
  SUBROUTINE h5pset_integer(prp_id, name, value, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: prp_id  ! Property list identifier
-    CHARACTER(LEN=*), INTENT(IN) :: name  ! Name of property to modify
-    INTEGER, INTENT(IN) :: value          ! Property value
-    INTEGER, INTENT(OUT) :: hdferr        ! Error code
-
- -
- -

h5pset_real

- -

[ Top ] [ H5P (F90) ] [ Subroutines ]

-

NAME

-
  h5pset_real
-
-

PURPOSE

-
  Sets a property list value
-
-

INPUTS

-
  prp_id        - iproperty list identifier to modify
-  name          - name of property to modify
-  value         - value to set property to
-
-

OUTPUTS

-
  hdferr:       - error code
-                   Success:  0
-                   Failure: -1
-
-

AUTHOR

-
  Elena Pourmal
-  October 9, 2002
-
-

SOURCE

-
  SUBROUTINE h5pset_real(prp_id, name, value, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: prp_id  ! Property list identifier
-    CHARACTER(LEN=*), INTENT(IN) :: name  ! Name of property to modify
-    REAL, INTENT(IN) :: value             ! Property value
-    INTEGER, INTENT(OUT) :: hdferr        ! Error code
-
- -
- - - diff --git a/fortran/doc/DevelGuide/src/H5Pff_f90.html b/fortran/doc/DevelGuide/src/H5Pff_f90.html deleted file mode 100644 index 0e9ff5c..0000000 --- a/fortran/doc/DevelGuide/src/H5Pff_f90.html +++ /dev/null @@ -1,4752 +0,0 @@ - - - - - - - -./src/H5Pff.f90 - - - - - -
-
- -

H5P (F90)

- -

[ Top ] [ Modules ]

-

NAME

-
  H5P_PROVISIONAL
-
-

PURPOSE

-
  This file contains Fortran interfaces for H5P functions. It includes
-  all the functions that are independent on whether the Fortran 2003 functions
-  are enabled or disabled.
-
-

NOTES

-
                         *** IMPORTANT ***
-  If you add a new H5P function you must add the function name to the
-  Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory.
-  This is needed for Windows based operating systems.
-
- -
- -

h5pget_hyper_vector_size_f

- -

[ Top ] [ Subroutines ]

-

NAME

-
  h5pget_hyper_vector_size_f 
-
-

PURPOSE

-
  Get the number of "I/O" vectors (vector size)
-
-

INPUTS

-
  plist_id     - dataset transfer property list identifier
-
-

OUTPUTS

-
  size         - vector size
-  hdferr       - error code            
-                  Success:  0
-                  Failure: -1
-
-

AUTHOR

-
  Elena Pourmal
-  October 7, 2002      
-
-

SOURCE

-
  SUBROUTINE h5pget_hyper_vector_size_f(plist_id, size, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: plist_id ! Dataset transfer property list identifier 
-    INTEGER(SIZE_T), INTENT(OUT) :: size   ! Vector size
-    INTEGER, INTENT(OUT) :: hdferr         ! Error code
-                                           ! 0 on success and -1 on failure
-
- -
- -

h5pset_family_offset_f

- -

[ Top ] [ Subroutines ]

-

NAME

-
  h5pset_family_offset_f 
-
-

PURPOSE

-
  Sets offset for family file driver.
-
-

INPUTS

-
  prp_id       - file creation property list identifier
-  offset       - file offset
-
-

OUTPUTS

-
  hdferr       - error code            
-                  Success:  0
-                  Failure: -1   
-
-

AUTHOR

-
  Elena Pourmal
-  19 March 2003
-
-

SOURCE

-
  SUBROUTINE h5pset_family_offset_f(prp_id, offset, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: prp_id   ! Property list identifier 
-    INTEGER(HSIZE_T), INTENT(IN) :: offset ! Offset in bytes
-    INTEGER, INTENT(OUT) :: hdferr         ! Error code
-                                           ! 0 on success and -1 on failure
-
- -
- -

h5pset_fapl_family_f

- -

[ Top ] [ Subroutines ]

-

NAME

-
   h5pset_fapl_family_f 
-
-

PURPOSE

-
  Sets the file access property list to use the family driver. 
-
-

INPUTS

-
  prp_id       - file access property list identifier
-  memb_size    - size in bytes of each file member 
-  memb_plist   - identifier of the file access property 
-                 list to be used for each family member
-
-

OUTPUTS

-
  hdferr  - error code         
-             Success:  0
-             Failure: -1   
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999      
-
-

HISTORY

-
  Explicit Fortran interfaces were added for 
-  called C functions (it is needed for Windows
-  port).  March 14, 2001 
-               
-
-

SOURCE

-
  SUBROUTINE h5pset_fapl_family_f(prp_id, memb_size, memb_plist , hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: prp_id      ! Property list identifier 
-    INTEGER(HSIZE_T), INTENT(IN) :: memb_size ! Logical size, in bytes,
-                                              ! of each family member
-    INTEGER(HID_T), INTENT(IN) :: memb_plist  ! Identifier of the file 
-                                              ! access property list for 
-                                              ! each member of the family
-    INTEGER, INTENT(OUT) :: hdferr            ! Error code
-                                              ! 0 on success and -1 on failure
-
- -
- -

h5pset_meta_block_size_f

- -

[ Top ] [ Subroutines ]

-

NAME

-
  h5pset_meta_block_size_f 
-
-

PURPOSE

-
  Sets the minimum size of metadata block allocations 
-
-

INPUTS

-
  plist_id     - file access property list identifier
-  size         - metatdata block size
-
-

OUTPUTS

-
  hdferr       - error code            
-                  Success:  0
-                  Failure: -1
-
-

AUTHOR

-
  Elena Pourmal
-  October 7, 2002      
-
-

SOURCE

-
  SUBROUTINE h5pset_meta_block_size_f(plist_id, size, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: plist_id  ! File access property list identifier 
-    INTEGER(HSIZE_T), INTENT(IN) :: size    ! Block size in bytes; 
-    INTEGER, INTENT(OUT) :: hdferr          ! Error code
-                                            ! 0 on success and -1 on failure
-
- -
- -

h5pall_filters_avail_f

- -

[ Top ] [ Subroutines ]

-

NAME

-
  h5pall_filters_avail_f 
-
-

PURPOSE

-
  Checks if all filters set in the dataset creation
-  property list are available
-
-

INPUTS

-
  prp_id       - data creation property list identifier
-
-

OUTPUTS

-
  flag         - .TRUE. if all filters are available
-                 .FALSE. otherwise
-  hdferr       - error code            
-                  Success:  0
-                  Failure: -1   
-
-

AUTHOR

-
  Elena Pourmal
-  April 10 2003
-
-

SOURCE

-
  SUBROUTINE h5pall_filters_avail_f(prp_id, flag, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: prp_id ! Dataset creation property 
-                                         !  list identifier 
-    LOGICAL, INTENT(OUT) :: flag         ! .TRUE. if all filters are available
-                                         ! .FALSE. otherwise
-    INTEGER, INTENT(OUT) :: hdferr       ! Error code
-                                         ! 0 on success and -1 on failure
-
- -
- -

h5pclose_class_f

- -

[ Top ] [ Subroutines ]

-

NAME

-
  h5pclose_class_f 
-
-

PURPOSE

-
  Closes an existing property list class.
-
-

INPUTS

-
  class        - Property list class identifier
-
-

OUTPUTS

-
  hdferr       - error code         
-                  Success: 0 
-                  Failure: -1   
-
-

AUTHOR

-
  Elena Pourmal
-  October 9, 2002      
-
-

SOURCE

-
  SUBROUTINE h5pclose_class_f(class, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: class ! Property list class identifier
-    INTEGER, INTENT(OUT) :: hdferr      ! Error code
-                                        ! 0 on success and -1 on failure
-
- -
- -

h5pclose_f

- -

[ Top ] [ Subroutines ]

-

NAME

-
  h5pclose_f 
-
-

PURPOSE

-
  Terminates access to a property list. 
-
-

INPUTS

-
  prp_id - identifier of the property list to 
-           terminate access to. 
-
-

OUTPUTS

-
  hdferr - error code          
-           Success:  0
-           Failure: -1
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999      
-
-

HISTORY

-
  Explicit Fortran interfaces were added for 
-  called C functions (it is needed for Windows
-  port).  March 14, 2001 
-               
-
-

SOURCE

-
  SUBROUTINE h5pclose_f(prp_id, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: prp_id  ! Property list identifier 
-    INTEGER, INTENT(OUT) :: hdferr        ! Error code
-                                          ! 0 on success and -1 on failure
-
- -
- -

h5pcopy_f

- -

[ Top ] [ Subroutines ]

-

NAME

-
  h5pcopy_f 
-
-

PURPOSE

-
  Copies an existing property list to create a new 
-  property list
-
-

INPUTS

-
  prp_id       - property list identifier
-
-

OUTPUTS

-
  new_prp_id   - new property list identifier
-  hdferr:      - error code            
-                  Success:  0
-                  Failure: -1
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999      
-
-

HISTORY

-
  Explicit Fortran interfaces were added for 
-  called C functions (it is needed for Windows
-  port).  March 14, 2001
-
-

SOURCE

-
  SUBROUTINE h5pcopy_f(prp_id, new_prp_id, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: prp_id      ! Property list identifier 
-    INTEGER(HID_T), INTENT(OUT) :: new_prp_id ! Identifier of property list
-    INTEGER, INTENT(OUT) :: hdferr            ! Error code
-                                              ! 0 on success and -1 on failure
-
- -
- -

h5pcopy_prop_f

- -

[ Top ] [ Subroutines ]

-

NAME

-
   h5pcopy_prop_f 
-
-

PURPOSE

-
  Copies a property from one list or class to another.
-
-

INPUTS

-
  dst_id               - Identifier of the destination property list
-  src_id               - Identifier of the source property list 
-  name                 - name of the property to copy
-
-

OUTPUTS

-
  hdferr:              - error code
-                          Success: 0 
-                          Failure: -1   
-
-

AUTHOR

-
  Elena Pourmal
-  October 9, 2002      
-
-

SOURCE

-
  SUBROUTINE h5pcopy_prop_f(dst_id, src_id, name, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: dst_id  ! Destination property list 
-                                          ! identifier 
-    INTEGER(HID_T), INTENT(IN) :: src_id  ! Source property list identifier 
-    CHARACTER(LEN=*), INTENT(IN) :: name  ! Property name
-    INTEGER, INTENT(OUT) :: hdferr        ! Error code
-                                          ! 0 on success and -1 on failure
-
- -
- -

h5pcreate_f

- -

[ Top ] [ Subroutines ]

-

NAME

-
   h5pcreate_f 
-
-

PURPOSE

-
       Creates a new property as an instance of a property 
-       list class.
-
-

INPUTS

-
  class  - type of the property class to be created.
-           Possible values are:
-             H5P_FILE_CREATE_F
-             H5P_FILE_ACCESS_F
-             H5P_DATASET_CREATE_F
-             H5P_DATASET_XFER_F
-             H5P_FILE_MOUNT_F
-
-

OUTPUTS

-
  prp_id - property list identifier
-  hdferr - error code          
-            Success:  0
-            Failure: -1 
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999      
-
-

HISTORY

-
  Explicit Fortran interfaces were added for 
-  called C functions (it is needed for Windows
-  port).  March 14, 2001 
-
-

SOURCE

-
  SUBROUTINE h5pcreate_f(class, prp_id, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: class   ! The type of the property list 
-                                          ! to be created. Possible values are: 
-                                          !  H5P_FILE_CREATE_F
-                                          !  H5P_FILE_ACCESS_F
-                                          !  H5P_DATASET_CREATE_F
-                                          !  H5P_DATASET_XFER_F
-                                          !  H5P_FILE_MOUNT_F
-    INTEGER(HID_T), INTENT(OUT) :: prp_id ! Property list identifier 
-    INTEGER, INTENT(OUT) :: hdferr        ! Error code
-                                          ! 0 on success and -1 on failure
-
- -
- -

h5pequal_f

- -

[ Top ] [ Subroutines ]

-

NAME

-
  h5pequal_f 
-
-

PURPOSE

-
  Checks if two property lists are eqaul
-
-

INPUTS

-
  plist1_id    - property list identifier
-  plist2_id    - property list identifier
-
-

OUTPUTS

-
  flag         - flag, possible values
-                   .TRUE. or .FALSE.
-  hdferr:      - error code            
-                  Success:  0
-                  Failure: -1, flag is set to .FALSE.   
-
-

AUTHOR

-
  Elena Pourmal
-  September 30, 2002   
-
-

SOURCE

-
  SUBROUTINE h5pequal_f(plist1_id, plist2_id, flag, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: plist1_id ! Property list identifier 
-    INTEGER(HID_T), INTENT(IN) :: plist2_id ! Property list identifier 
-    LOGICAL, INTENT(OUT)       :: flag      ! Flag
-    INTEGER, INTENT(OUT)       :: hdferr    ! Error code
-                                            !  0 on success and -1 on failure
-
- -
- -

h5pexist_f

- -

[ Top ] [ Subroutines ]

-

NAME

-
   h5pexist_f 
-
-

PURPOSE

-
  Queries whether a property name exists in a property list or class. 
-
-

INPUTS

-
  prp_id       - property list identifier to query
-  name         - name of property to check for
-
-

OUTPUTS

-
  flag         - logical flag
-  hdferr       - error code            
-                  Success:  0
-                  Failure: -1   
-
-

AUTHOR

-
  Elena Pourmal
-  October 9, 2002      
-
-

SOURCE

-
  SUBROUTINE h5pexist_f(prp_id, name, flag, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: prp_id  ! Property list identifier 
-    CHARACTER(LEN=*), INTENT(IN) :: name  ! Name of property to modify
-    LOGICAL, INTENT(OUT) :: flag          ! .TRUE. if exists, .FALSE. otherwise
-    INTEGER, INTENT(OUT) :: hdferr  ! Error code
-                                    ! 0 on success and -1 on failure
-
- -
- -

h5pfill_value_defined_f

- -

[ Top ] [ Subroutines ]

-

NAME

-
  h5pfill_value_defined_f
-
-

PURPOSE

-
  Check if fill value is defined.
-
-

INPUTS

-
  plist_id     - dataset creation property list identifier
-
-

OUTPUTS

-
  flag         - fill value status flag
-                 Possible values are:
-                   H5D_FILL_VALUE_ERROR_F
-                   H5D_FILL_VALUE_UNDEFINED_F
-                   H5D_FILL_VALUE_DEFAULT_F
-                   H5D_FILL_VALUE_USER_DEFINED_F
-  hdferr       - error code            
-                   Success:  0
-                   Failure: -1
-
-

AUTHOR

-
  Elena Pourmal
-  October 4, 2002
-
-

SOURCE

-
  SUBROUTINE h5pfill_value_defined_f(plist_id, flag, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: plist_id  ! Dataset creation property list identifier
-    INTEGER, INTENT(OUT) :: flag            ! Fill value status flag
-                                            !  H5D_FILL_VALUE_ERROR_F
-                                            !  H5D_FILL_VALUE_UNDEFINED_F
-                                            !  H5D_FILL_VALUE_DEFAULT_F
-                                            !  H5D_FILL_VALUE_USER_DEFINED_F
-    INTEGER, INTENT(OUT) :: hdferr          ! Error code
-                                            ! 0 on success and -1 on failure
-
- -
- -

h5pget_alignment_f

- -

[ Top ] [ Subroutines ]

-

NAME

-
   h5pget_alignment_f 
-
-

PURPOSE

-
  Retrieves the current settings for alignment 
-  properties from a file access property list. 
-
-

INPUTS

-
  prp_id       - file access property list identifier
-
-

OUTPUTS

-
  threshold    - threshold value       
-  alignment    - alignment value
-  hdferr       - error code            
-                  Success:  0
-                  Failure: -1   
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999      
-
-

HISTORY

-
  Explicit Fortran interfaces were added for 
-  called C functions (it is needed for Windows
-  port).  March 14, 2001 
-               
-
-

SOURCE

-
  SUBROUTINE h5pget_alignment_f(prp_id, threshold,  alignment, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: prp_id       ! Property list identifier 
-    INTEGER(HSIZE_T), INTENT(OUT) :: threshold ! Threshold value
-    INTEGER(HSIZE_T), INTENT(OUT) :: alignment ! alignment value
-    INTEGER, INTENT(OUT) :: hdferr             ! Error code
-                                             ! 0 on success and -1 on failure
-
- -
- -

h5pget_alloc_time_f

- -

[ Top ] [ Subroutines ]

-

NAME

-
  h5pget_alloc_time_f
-
-

PURPOSE

-
  Get space allocation time for dataset during creation.
-
-

INPUTS

-
  plist_id     - dataset creation property list identifier
-
-

OUTPUTS

-
  flag         - allocation time flag:
-                   H5D_ALLOC_TIME_ERROR_F
-                   H5D_ALLOC_TIME_DEFAULT_F
-                   H5D_ALLOC_TIME_EARLY_F
-                   H5D_ALLOC_TIME_LATE_F
-                   H5D_ALLOC_TIME_INCR_F
-  hdferr:      - error code            
-                   Success:  0
-                   Failure: -1
-
-

AUTHOR

-
  Elena Pourmal
-  October 4, 2002      
-
-

SOURCE

-
  SUBROUTINE h5pget_alloc_time_f(plist_id, flag, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: plist_id  ! Dataset creation property list identifier
-    INTEGER, INTENT(OUT) :: flag   ! Allocation time flag:
-                                   !  H5D_ALLOC_TIME_ERROR_F
-                                   !  H5D_ALLOC_TIME_DEFAULT_F
-                                   !  H5D_ALLOC_TIME_EARLY_F
-                                   !  H5D_ALLOC_TIME_LATE_F
-                                   !  H5D_ALLOC_TIME_INCR_F
-    INTEGER, INTENT(OUT) :: hdferr ! Error code
-                                   ! 0 on success and -1 on failure
-
- -
- -

H5Pget_attr_creation_order_f

- -

[ Top ] [ Subroutines ]

-

NAME

-
  H5Pget_attr_creation_order_f
-
-

PURPOSE

-
  Retrieves tracking and indexing settings for attribute creation order
-
-

INPUTS

-
  ocpl_id         - Object (group or dataset) creation property list identifier
-
-

OUTPUTS

-
  crt_order_flags - Flags specifying whether to track and index attribute creation order
-  hdferr          - Error code         
-                       Success:  0
-                       Failure: -1   
-
-

AUTHOR

-
  M. Scot Breitenfeld
-  February, 2008
-
-

SOURCE

-
  SUBROUTINE h5pget_attr_creation_order_f(ocpl_id, crt_order_flags, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: ocpl_id   ! Object (group or dataset) creation property list identifier 
-    INTEGER, INTENT(OUT) :: crt_order_flags ! Flags specifying whether to track and index attribute creation order 
-    INTEGER, INTENT(OUT) :: hdferr   ! Error code
-                                     ! 0 on success and -1 on failure
-
- -
- -

H5Pget_attr_phase_change_f

- -

[ Top ] [ Subroutines ]

-

NAME

-
  H5Pget_attr_phase_change_f 
-
-

PURPOSE

-
  Retrieves attribute storage phase change thresholds 
-
-

INPUTS

-
  ocpl_id         - Object (dataset or group) creation property list identifier
-
-

OUTPUTS

-
  max_compact     - Maximum number of attributes to be stored in compact storage
-                    (Default: 8)
-  min_dense       - Minimum number of attributes to be stored in dense storage
-                    (Default: 6)
-  hdferr          - Error code         
-                     Success:  0
-                     Failure: -1   
-
-

AUTHOR

-
  M. Scot Breitenfeld
-  January, 2008
-
-

SOURCE

-
  SUBROUTINE h5pget_attr_phase_change_f(ocpl_id, max_compact, min_dense, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: ocpl_id ! Object (dataset or group) creation property list identifier
-    INTEGER, INTENT(OUT) :: max_compact   ! Maximum number of attributes to be stored in compact storage
-                                          ! (Default: 8)
-    INTEGER, INTENT(OUT) :: min_dense     ! Minimum number of attributes to be stored in dense storage
-                                          ! (Default: 6)
-    INTEGER, INTENT(OUT) :: hdferr        ! Error code
-                                          ! 0 on success and -1 on failure
-
- -
- -

h5pget_btree_ratios_f

- -

[ Top ] [ Subroutines ]

-

NAME

-
  h5pget_btree_ratios_f
-
-

PURPOSE

-
  Gets B-tree split ratios for a dataset transfer property list
-
-

INPUTS

-
  prp_id       - the dataset transfer property list 
-                 identifier 
-
-

OUTPUTS

-
  left         - the B-tree split ratio for left-most nodes 
-  middle       - the B-tree split ratio for all other nodes
-  right        - the B-tree split ratio for right-most nodes
-  hdferr       - error code            
-                  Success:  0
-                  Failure: -1   
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999      
-
-

HISTORY

-
  Explicit Fortran interfaces were added for 
-  called C functions (it is needed for Windows
-  port).  March 14, 2001 
-
-

SOURCE

-
  SUBROUTINE h5pget_btree_ratios_f(prp_id, left, middle, right, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier
-    REAL, INTENT(OUT) :: left   ! The B-tree split ratio for left-most nodes.
-    REAL, INTENT(OUT) :: middle ! The B-tree split ratio for all other nodes 
-    REAL, INTENT(OUT) :: right  ! The B-tree split ratio for right-most 
-                                !  nodes and lone nodes.
-    INTEGER, INTENT(OUT) :: hdferr  ! Error code
-                                    ! 0 on success and -1 on failure
-
- -
- -

h5pget_buffer_f

- -

[ Top ] [ Subroutines ]

-

NAME

-
  h5pget_buffer_f 
-
-

PURPOSE

-
  Gets size for conversion buffer
-
-

INPUTS

-
  plist_id     - data transfer property list identifier
-
-

OUTPUTS

-
  size         - buffer size 
-  hdferr       - error code            
-                  Success:  0
-                  Failure: -1
-
-

AUTHOR

-
  Elena Pourmal
-  October 2, 2002      
-
-

SOURCE

-
  SUBROUTINE h5pget_buffer_f(plist_id, size, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: plist_id ! Data transfer property list identifier 
-    INTEGER(HSIZE_T), INTENT(OUT) :: size  ! Buffer size in bytes; 
-                                           !  buffer is allocated and freed by 
-                                           !  the library.
-    INTEGER, INTENT(OUT)       :: hdferr   ! Error code
-                                           ! 0 on success and -1 on failure
-
- -
- -

h5pget_cache_f

- -

[ Top ] [ Subroutines ]

-

NAME

-
   h5pget_cache_f 
-
-

PURPOSE

-
  Queries the meta data cache and raw data chunk cache 
-  parameters.  
-
-

INPUTS

-
  prp_id       - file access property list identifier
-
-

OUTPUTS

-
  mdc_nelmts   - number of elements (objects) in the meta 
-                 data cache 
-  rdcc_nelmts  - number of elements (objects) in the raw 
-                 data chunk cache 
-  rdcc_nbytes  - total size of the raw data chunk cache, in bytes 
-  rdcc_w0      - preemption policy (0 or 1)
-  hdferr       - error code            
-                  Success:  0
-                  Failure: -1   
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999      
-
-

HISTORY

-
  Explicit Fortran interfaces were added for 
-  called C functions (it is needed for Windows
-  port).  March 14, 2001 
-
-  Bug fix: type of the rdcc_nelmts parameter should be INTEGER
-  instead of INTEGER(SIZE_T) October 10, 2003 
-               
-
-

SOURCE

-
  SUBROUTINE h5pget_cache_f(prp_id, mdc_nelmts, rdcc_nelmts, rdcc_nbytes, rdcc_w0, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier 
-    INTEGER, INTENT(OUT) :: mdc_nelmts   ! Number of elements (objects)
-                                         !  in the meta data cache
-    INTEGER(SIZE_T), INTENT(OUT) :: rdcc_nelmts  ! Number of elements (objects)
-                                                 !  in the meta data cache
-    INTEGER(SIZE_T), INTENT(OUT) :: rdcc_nbytes  ! Total size of the raw data 
-                                                 !  chunk cache, in bytes 
-    REAL, INTENT(OUT) :: rdcc_w0                 ! Preemption policy
-    INTEGER, INTENT(OUT) :: hdferr               ! Error code
-                                                 ! 0 on success and -1 on failure
-
- -
- -

H5Pget_char_encoding_f

- -

[ Top ] [ Subroutines ]

-

NAME

-
  H5Pget_char_encoding_f
-
-

PURPOSE

-
  Retrieves the character encoding used to create a string
-
-

INPUTS

-
  plist_id - Property list identifier
-
-

OUTPUTS

-
  encoding - Valid values for encoding are:
-               H5T_CSET_ASCII_F -> US ASCII
-               H5T_CSET_UTF8_F -> UTF-8 Unicode encoding
-  hdferr   - Error code                
-               Success:  0
-               Failure: -1   
-
-

AUTHOR

-
  M. Scot Breitenfeld
-  March 3, 2008
-
-

SOURCE

-
  SUBROUTINE  h5pget_char_encoding_f(plist_id, encoding, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: plist_id ! Property list identifier
-
-    INTEGER, INTENT(OUT) :: encoding       ! Valid values for encoding are:
-                                           !  H5T_CSET_ASCII_F -> US ASCII
-                                           !  H5T_CSET_UTF8_F  -> UTF-8 Unicode encoding
-    INTEGER, INTENT(OUT) :: hdferr   ! Error code
-                                     ! 0 on success and -1 on failure
-
- -
- -

H5Pget_chunk_cache_f

- -

[ Top ] [ Subroutines ]

-

NAME

-
  H5Pget_chunk_cache_f
-
-

PURPOSE

-
  Retrieves the maximum possible number of elements in the meta
-  data cache and the maximum possible number of elements and
-  bytes and the RDCC_W0 value in the raw data chunk cache.  Any
-  (or all) arguments may be null pointers in which case the
-  corresponding datum is not returned.  If these properties have
-  not been set on this property list, the default values for a
-  file access property list are returned.
-
-

INPUTS

-
  dapl_id            - Dataset access property list identifier.
-
-

OUTPUTS

-
  rdcc_nslots        - Number of chunk slots in the raw data chunk cache hash table. 
-  rdcc_nbytes        - Total size of the raw data chunk cache, in bytes. 
-  rdcc_w0            - Preemption policy. 
-  hdferr             - Error code              
-                        Success:  0
-                        Failure: -1   
-
-

AUTHOR

-
  M. Scot Breitenfeld
-  April 13, 2009
-
-

HISTORY

-

SOURCE

-
  SUBROUTINE h5pget_chunk_cache_f(dapl_id, rdcc_nslots, rdcc_nbytes, rdcc_w0, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: dapl_id       ! Dataset access property list identifier.
-    INTEGER(SIZE_T), INTENT(OUT) :: rdcc_nslots ! Number of chunk slots in the raw data chunk cache hash table.
-    INTEGER(SIZE_T), INTENT(OUT) :: rdcc_nbytes ! Total size of the raw data chunk cache, in bytes. 
-    REAL, INTENT(OUT) :: rdcc_w0                ! Preemption policy.
-    INTEGER, INTENT(OUT) :: hdferr              ! Error code:
-                                                ! 0 on success and -1 on failure
-
- -
- -

h5pget_chunk_f

- -

[ Top ] [ Subroutines ]

-

NAME

-
   h5pget_chunk_f 
-
-

PURPOSE

-
  Retrieves the size of chunks for the raw data of a 
-  chunked layout dataset
-
-

INPUTS

-
  prp_id       - property list identifier
-  ndims        - size of dims array
-
-

OUTPUTS

-
  dims         - array with dimension sizes for each chunk
-  hdferr       - error code            
-                  Success:  number of chunk dimensions
-                  Failure: -1
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999      
-
-

HISTORY

-
  Explicit Fortran interfaces were added for 
-  called C functions (it is needed for Windows
-  port).  March 14, 2001 
-               
-
-

SOURCE

-
  SUBROUTINE h5pget_chunk_f(prp_id, ndims, dims, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier 
-    INTEGER, INTENT(IN) :: ndims         ! Number of chunk dimensions to
-                                         ! to return
-    INTEGER(HSIZE_T), DIMENSION(ndims), INTENT(OUT) :: dims    
-                                         ! Array containing sizes of
-                                         ! chunk dimensions
-    INTEGER, INTENT(OUT) :: hdferr       ! Error code:
-                                         !  number of chunk dimensions on success,
-                                         !  -1 on failure
-
- -
- -

h5pget_class_f

- -

[ Top ] [ Subroutines ]

-

NAME

-
  h5pget_class_f 
-
-

PURPOSE

-
  Returns the property list class for a property list.
-
-

INPUTS

-
  prp_id       - property list identifier
-
-

OUTPUTS

-
  classtype    - property list class
-                 Possible values are:
-                  H5P_ROOT_F
-                  H5P_FILE_CREATE_F
-                  H5P_FILE_ACCESS_F
-                  H5PE_DATASET_CREATE_F
-                  H5P_DATASET_XFER_F
-                  H5P_FILE_MOUNT_F
-  hdferr:      - error code            
-                  Success:  0
-                  Failure: -1 
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999      
-
-

HISTORY

-
  Explicit Fortran interfaces were added for 
-  called C functions (it is needed for Windows
-  port).  March 14, 2001 
-
-

SOURCE

-
  SUBROUTINE h5pget_class_f(prp_id, classtype, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier 
-    INTEGER, INTENT(OUT) :: classtype    ! The type of the property list 
-                                         ! to be created. Possible values are: 
-                                         !  H5P_ROOT_F
-                                         !  H5P_FILE_CREATE_F
-                                         !  H5P_FILE_ACCESS_F
-                                         !  H5PE_DATASET_CREATE_F 
-                                         !  H5P_DATASET_XFER_F
-                                         !  H5P_FILE_MOUNT_F
-    INTEGER, INTENT(OUT) :: hdferr       ! Error code
-                                         ! 0 on success and -1 on failure
-
- -
- -

h5pget_class_name_f

- -

[ Top ] [ Subroutines ]

-

NAME

-
  h5pget_class_name_f 
-
-

PURPOSE

-
  Queries the name of a class.
-
-

INPUTS

-
  prp_id       - property list identifier to query
-
-

OUTPUTS

-
  name         - name of a class
-  size         - Actual length of the class name
-                   NOTE: If provided buffer "name" is smaller,
-                   than name will be truncated to fit into
-                   provided user buffer
-  hdferr:      - error code
-                  Success: 0
-                  Failure: -1   
-
-

AUTHOR

-
  Elena Pourmal
-  October 9, 2002      
-
-

HISTORY

-
 Returned the size of name as an argument      
-
-

SOURCE

-
  SUBROUTINE h5pget_class_name_f(prp_id, name, size, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: prp_id  ! Property list identifier 
-    CHARACTER(LEN=*), INTENT(OUT) :: name ! Buffer to retireve class name
-    INTEGER, INTENT(OUT) :: size          ! Actual length of the class name
-    INTEGER, INTENT(OUT) :: hdferr        ! Error code
-                                          ! 0 on success and -1 on failure
-
- -
- -

h5pget_class_parent_f

- -

[ Top ] [ Subroutines ]

-

NAME

-
  h5pget_class_parent_f 
-
-

PURPOSE

-
  Retrieves the parent class of a genric property class. 
-
-

INPUTS

-
  prp_id       - property list identifier to query
-
-

OUTPUTS

-
  parent_id    - identifier of the parent class
-  hdferr:      - error code          
-                  Success:  0
-                  Failure: -1   
-
-

AUTHOR

-
  Elena Pourmal
-  October 9, 2002      
-
-

SOURCE

-
  SUBROUTINE h5pget_class_parent_f(prp_id, parent_id, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: prp_id     ! Property list identifier 
-    INTEGER(HID_T), INTENT(OUT) :: parent_id ! Parent class property list 
-                                             ! identifier 
-    INTEGER, INTENT(OUT) :: hdferr  ! Error code
-                                    ! 0 on success and -1 on failure
-
- -
- -

h5pget_copy_object_f

- -

[ Top ] [ Subroutines ]

-

NAME

-
  h5pget_copy_object_f 
-
-

PURPOSE

-
  Retrieves the properties to be used when an object is copied.
-
-

INPUTS

-
  ocp_plist_id - Object copy property list identifier
-
-

OUTPUTS

-
  copy_options - Copy option(s) to be get
-  hdferr       - Error code            
-                  Success:  0
-                  Failure: -1   
-
-

AUTHOR

-
  M. Scot Breitenfeld
-  March 3, 2008
-
-

HISTORY

-

SOURCE

-
  SUBROUTINE h5pget_copy_object_f(ocp_plist_id, copy_options, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: ocp_plist_id ! Object copy property list identifier
-    INTEGER, INTENT(OUT) :: copy_options       ! Valid copy options returned are:
-                                               !   H5O_COPY_SHALLOW_HIERARCHY_F
-                                               !   H5O_COPY_EXPAND_SOFT_LINK_F 
-                                               !   H5O_COPY_EXPAND_EXT_LINK_F
-                                               !   H5O_COPY_EXPAND_REFERENCE_F
-                                               !   H5O_COPY_WITHOUT_ATTR_FLAG_F
-    INTEGER, INTENT(OUT) :: hdferr             ! Error code
-                                               ! 0 on success and -1 on failure
-
- -
- -

H5Pget_create_inter_group_f

- -

[ Top ] [ Subroutines ]

-

NAME

-
  H5Pget_create_inter_group_f
-
-

PURPOSE

-
  Determines whether property is set to enable creating missing intermediate groups.
-
-

INPUTS

-
  lcpl_id            - Link creation property list identifier
-  crt_intermed_group - Specifying whether to create intermediate groups upon 
-                       the creation of an object
-
-

OUTPUTS

-
  hdferr             - Error code              
-                        Success:  0
-                        Failure: -1   
-
-

AUTHOR

-
  M. Scot Breitenfeld
-  April 4, 2008
-
-

HISTORY

-
 The long subroutine name (>31) on older f90 compilers causes problems
-          so the name was shortened
-
-

SOURCE

-
  SUBROUTINE h5pget_create_inter_group_f(lcpl_id, crt_intermed_group, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: lcpl_id      ! Link creation property list identifier
-    INTEGER, INTENT(IN) :: crt_intermed_group  ! Flag specifying whether to create intermediate groups
-                                               ! upon creation of an object
-    INTEGER, INTENT(OUT) :: hdferr             ! Error code
-                                               ! 0 on success and -1 on failure
-
- -
- -

h5pget_data_transform_f

- -

[ Top ] [ Subroutines ]

-

NAME

-
  h5pget_data_transform_f 
-
-

PURPOSE

-
  Retrieves a data transform expression.
-
-

INPUTS

-
  plist_id   - Identifier of the property list or class
-
-

OUTPUTS

-
  expression - buffer to hold transform expression
-  hdferr     - Error code
-                 Success:  Actual lenght of the expression
-                           If provided buffer "expression" is 
-                           smaller, than expression will be 
-                           truncated to fit into
-                           provided user buffer
-                 Failure: -1
-
-

AUTHOR

-
  M. Scot Breitenfeld
-  March 19, 2008
-
-

HISTORY

-
 Should hdferr return just 0 or 1 and add another arguement for the size?
-
-

SOURCE

-
SUBROUTINE h5pget_data_transform_f(plist_id, expression, hdferr, size)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: plist_id         ! Identifier of the property list or class
-    CHARACTER(LEN=*), INTENT(OUT) :: expression    ! Buffer to hold transform expression
-    INTEGER(SIZE_T), INTENT(OUT), OPTIONAL :: size ! Registered size of the transform expression
-    INTEGER, INTENT(OUT) :: hdferr                 ! Error code
-                                                   !  0 on success and -1 on failure
-
- -
- -

h5pget_driver_f

- -

[ Top ] [ Subroutines ]

-

NAME

-
  h5pget_driver_f 
-
-

PURPOSE

-
  Returns low-lever driver identifier. 
-
-

INPUTS

-
  prp_id  - file access or data transfer property 
-            list identifier. 
-
-

OUTPUTS

-
  driver  - low-level driver identifier
-  hdferr  - error code         
-             Success:  0
-             Failure: -1   
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999      
-
-

HISTORY

-
  Explicit Fortran interfaces were added for 
-  called C functions (it is needed for Windows
-  port).  March 14, 2001 
-               
-
-

SOURCE

-
  SUBROUTINE h5pget_driver_f(prp_id, driver, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: prp_id  ! Property list identifier 
-    INTEGER(HID_T), INTENT(OUT) :: driver ! Low-level file driver identifier
-    INTEGER, INTENT(OUT) :: hdferr        ! Error code
-                                          ! 0 on success and -1 on failure
-
- -
- -

h5pget_edc_check_f

- -

[ Top ] [ Subroutines ]

-

NAME

-
  h5pget_edc_check_f 
-
-

PURPOSE

-
  Queries error detecting  
-
-

INPUTS

-
  prp_id       - dataset creation property list identifier
-
-

OUTPUTS

-
  hdferr       - error code            
-                  Success:  0
-                  Failure: -1   
-
-

AUTHOR

-
  Elena Pourmal
-  March 13, 2003
-
-

SOURCE

-
  SUBROUTINE h5pget_edc_check_f(prp_id, flag, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: prp_id ! Dataset transfer property list identifier 
-    INTEGER, INTENT(OUT) :: flag         ! Checksum filter flag
-                                         ! May have one of the following values:
-                                         !  H5Z_ERROR_EDC_F
-                                         !  H5Z_DISABLE_EDC_F
-                                         !  H5Z_ENABLE_EDC_F
-                                         !  H5Z_NO_EDC_F
-    INTEGER, INTENT(OUT) :: hdferr       ! Error code
-                                         ! 0 on success and -1 on failure
-
- -
- -

H5Pget_est_link_info_f

- -

[ Top ] [ Subroutines ]

-

NAME

-
  H5Pget_est_link_info_f 
-
-

PURPOSE

-
  Queries data required to estimate required local heap or object header size.
-
-

INPUTS

-
  gcpl_id         - Group creation property list identifier
-
-

OUTPUTS

-
  est_num_entries - Estimated number of links to be inserted into group
-  est_name_len    - Estimated average length of link names
-  hdferr          - Error code
-                     Success:  0
-                     Failure: -1
-
-

AUTHOR

-
  M. Scot Breitenfeld
-  March 21, 2008
-
-

HISTORY

-

SOURCE

-
  SUBROUTINE h5pget_est_link_info_f(gcpl_id, est_num_entries, est_name_len, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: gcpl_id   ! Group creation property list identifier  
-    INTEGER, INTENT(OUT) :: est_num_entries ! Estimated number of links to be inserted into group
-    INTEGER, INTENT(OUT) :: est_name_len    ! Estimated average length of link names
-    INTEGER, INTENT(OUT) :: hdferr          ! Error code
-                                            ! 0 on success and -1 on failure
-
- -
- -

h5pget_external_count_f

- -

[ Top ] [ Subroutines ]

-

NAME

-
   h5pget_external_count_f 
-
-

PURPOSE

-
  Returns the number of external files for a dataset. 
-
-

INPUTS

-
  prp_id       - dataset creation property list identifier
-
-

OUTPUTS

-
  count        - number of external files for the 
-                 specified dataset
-  hdferr       - error code            
-                   Success:  0
-                   Failure: -1   
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999      
-
-

HISTORY

-
  Explicit Fortran interfaces were added for 
-  called C functions (it is needed for Windows
-  port).  March 14, 2001 
-
-

SOURCE

-
  SUBROUTINE h5pget_external_count_f (prp_id, count, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier 
-    INTEGER, INTENT(OUT) :: count        ! Number of external files for the 
-                                         ! Specified dataset
-    INTEGER, INTENT(OUT) :: hdferr       ! Error code
-                                         ! 0 on success and -1 on failure
-
- -
- -

h5pget_external_f

- -

[ Top ] [ Subroutines ]

-

NAME

-
  h5pget_external_f 
-
-

PURPOSE

-
  Returns information about an external file. 
-
-

INPUTS

-
  prp_id       - dataset creation property list identifier
-
-

OUTPUTS

-
  idx          - external file index 
-  name_size    - maximum size of name array
-  name         - name of the external file     
-  name         - name of external file
-  offset       - offset in bytes from the beginning of the 
-                 file to the location in the file
-                 where the data starts
-  bytes        - size of the external file data
-  hdferr       - error code            
-                  Success:  0
-                   Failure: -1   
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999      
-
-

HISTORY

-
  Explicit Fortran interfaces were added for 
-  called C functions (it is needed for Windows
-  port).  March 14, 2001 
-
-

SOURCE

-
  SUBROUTINE h5pget_external_f(prp_id, idx, name_size, name, offset,bytes, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier
-    INTEGER, INTENT(IN) :: idx           ! External file index.
-    INTEGER(SIZE_T), INTENT(IN) :: name_size ! Maximum length of name array 
-    CHARACTER(LEN=*), INTENT(OUT) :: name    ! Name of an external file
-    INTEGER, INTENT(OUT) :: offset           ! Offset, in bytes, from the beginning 
-                                             !  of the file to the location in the file 
-                                             !  where the data starts.
-    INTEGER(HSIZE_T), INTENT(OUT) :: bytes   ! Number of bytes reserved in the 
-                                             !  file for the data
-    INTEGER, INTENT(OUT) :: hdferr           ! Error code
-                                             ! 0 on success and -1 on failure
-
- -
- -

h5pget_fapl_core_f

- -

[ Top ] [ Subroutines ]

-

NAME

-
   h5pget_fapl_core_f 
-
-

PURPOSE

-
  Queries core file driver properties. 
-
-

INPUTS

-
  prp_id        - file access property list identifier
-
-

OUTPUTS

-
  increment     - size, in bytes, of memory increments 
-  backing_store - boolean flag indicating whether to write 
-                  the file contents to disk when the file is closed. 
-  hdferr        - error code           
-                   Success:  0
-                   Failure: -1   
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999      
-
-

HISTORY

-
  Explicit Fortran interfaces were added for 
-  called C functions (it is needed for Windows
-  port).  March 14, 2001 
-               
-
-

SOURCE

-
  SUBROUTINE h5pget_fapl_core_f(prp_id, increment, backing_store, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: prp_id      ! Property list identifier 
-    INTEGER(SIZE_T), INTENT(OUT) :: increment ! File block size in bytes.
-    LOGICAL, INTENT(OUT) :: backing_store   ! Flag to indicate that
-                                            ! entire file contents are flushed to a file 
-                                            ! with the same name as this core file.
-    INTEGER, INTENT(OUT) :: hdferr          ! Error code
-                                            ! 0 on success and -1 on failure
-
- -
- -

h5pget_fapl_direct_f

- -

[ Top ] [ Subroutines ]

-

NAME

-
  h5pget_fapl_direct_f
-
-

PURPOSE

-
  Gets up use of the direct I/O driver.
-
-

INPUTS

-
  fapl_id      - File access property list identifier
-
-

OUTPUTS

-
  alignment    - Required memory alignment boundary
-  block_size   - File system block size
-  cbuf_size    - Copy buffer size
-  hdferr       - error code            
-                  Success:  0
-                  Failure: -1   
-
-

AUTHOR

-
  M. Scot Breitenfeld
-  March 21, 2008
-
-

SOURCE

-
  SUBROUTINE h5pget_fapl_direct_f(fapl_id, alignment, block_size, cbuf_size, hdferr)
-    IMPLICIT NONE  
-    INTEGER(HID_T), INTENT(IN) :: fapl_id       ! File access property list identifier
-    INTEGER(SIZE_T), INTENT(OUT) :: alignment   ! Required memory alignment boundary!
-    INTEGER(SIZE_T), INTENT(OUT) :: block_size  ! File system block size
-    INTEGER(SIZE_T), INTENT(OUT) :: cbuf_size   ! Copy buffer size
-    INTEGER, INTENT(OUT) :: hdferr              ! Error code
-                                                ! 0 on success and -1 on failure
-
- -
- -

h5pget_fapl_family_f

- -

[ Top ] [ Subroutines ]

-

NAME

-
  h5pget_fapl_family_f 
-
-

PURPOSE

-
  Returns file access property list information.       
-
-

INPUTS

-
  prp_id       - file access property list identifier
-
-

OUTPUTS

-
  memb_size    - size in bytes of each file member 
-  memb_plist   - identifier of the file access property 
-                 list to be used for each family member
-  hdferr       - error code            
-                  Success:  0
-                  Failure: -1   
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999      
-
-

HISTORY

-
  Explicit Fortran interfaces were added for 
-  called C functions (it is needed for Windows
-  port).  March 14, 2001 
-               
-
-

SOURCE

-
  SUBROUTINE h5pget_fapl_family_f(prp_id, memb_size, memb_plist , hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: prp_id       ! Property list identifier 
-    INTEGER(HSIZE_T), INTENT(OUT) :: memb_size ! Logical size, in bytes,
-                                               ! of each family member
-    INTEGER(HID_T), INTENT(OUT) :: memb_plist  ! Identifier of the file 
-                                               ! access property list for 
-                                               ! each member of the family
-    INTEGER, INTENT(OUT) :: hdferr             ! Error code
-                                               ! 0 on success and -1 on failure
-
- -
- -

h5pget_fapl_multi_f

- -

[ Top ] [ Subroutines ]

-

NAME

-
  h5pget_fapl_multi_f 
-
-

PURPOSE

-
  Sets up use of the multi-file driver. 
-
-

INPUTS

-
  prp_id       - file creation property list identifier
-
-

OUTPUTS

-
  mem_map      - mapping array
-  memb_fapl    - property list for each memory usage type
-  memb_name    - names of member file
-  relax        - flag 
-  hdferr       - error code            
-                  Success:  0
-                  Failure: -1
-
-

OPTIONAL PARAMETERS

-
  maxlen_out   - maximum length for memb_name array element 
-
-

AUTHOR

-
  Elena Pourmal
-  24 March 2003
-
-

SOURCE

-
  SUBROUTINE h5pget_fapl_multi_f(prp_id, memb_map, memb_fapl, memb_name, memb_addr, relax, hdferr, maxlen_out)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: prp_id ! File creation property list identifier 
-    INTEGER, DIMENSION(0:H5FD_MEM_NTYPES_F-1), INTENT(OUT) :: memb_map
-    INTEGER(HID_T), DIMENSION(0:H5FD_MEM_NTYPES_F-1), INTENT(OUT) :: memb_fapl
-    CHARACTER(LEN=*), DIMENSION(0:H5FD_MEM_NTYPES_F-1), INTENT(OUT) :: memb_name
-    !INTEGER(HADDR_T), DIMENSION(0:H5FD_MEM_NTYPES_F-1), INTENT(OUT) :: memb_addr
-    REAL, DIMENSION(0:H5FD_MEM_NTYPES_F-1), INTENT(OUT) :: memb_addr
-    INTEGER, OPTIONAL, INTENT(OUT) :: maxlen_out 
-    LOGICAL, INTENT(OUT) :: relax
-    INTEGER, INTENT(OUT) :: hdferr       ! Error code
-                                         ! 0 on success and -1 on failure
-
- -
- -

h5pget_fclose_degree_f

- -

[ Top ] [ Subroutines ]

-

NAME

-
  h5pget_fclose_degree_f 
-
-

PURPOSE

-
  Returns the degree for the file close behavior.
-
-

INPUTS

-
  fapl_id      - File access property list identifier
-
-

OUTPUTS

-
  degree       - Possible values are:
-                  H5F_CLOSE_DEFAULT_F
-                  H5F_CLOSE_WEAK_F
-                  H5F_CLOSE_SEMI_F
-                  H5F_CLOSE_STRONG_F
-  hdferr       - error code            
-                  Success:  0
-                  Failure: -1   
-
-

AUTHOR

-
  Elena Pourmal
-  September 26, 2002   
-
-

HISTORY

-

SOURCE

-
  SUBROUTINE h5pget_fclose_degree_f(fapl_id, degree, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: fapl_id ! File Access Property list identifier 
-    INTEGER, INTENT(OUT) :: degree        ! Possible values are: 
-                                          !  H5F_CLOSE_DEFAULT_F
-                                          !  H5F_CLOSE_WEAK_F
-                                          !  H5F_CLOSE_SEMI_F
-                                          !  H5F_CLOSE_STRONG_F
-    INTEGER, INTENT(OUT) :: hdferr        ! Error code
-                                          ! 0 on success and -1 on failure
-
- -
- -

h5pget_fill_time_f

- -

[ Top ] [ Subroutines ]

-

NAME

-
   h5pget_fill_time_f
-
-

PURPOSE

-
  Get fill value writing time for dataset
-
-

INPUTS

-
  plist_id     - dataset creation property list identifier
-
-

OUTPUTS

-
  hdferr:      - error code            
-                  Success:  0
-                  Failure: -1
-
-

OPTIONAL PARAMETERS

-
  flag         - fill time flag:
-                  H5D_FILL_TIME_ERROR_F
-                  H5D_FILL_TIME_ALLOC_F
-                  H5D_FILL_TIME_NEVER_F
-
-

AUTHOR

-
  Elena Pourmal
-  October 4, 2002      
-
-

SOURCE

-
  SUBROUTINE h5pget_fill_time_f(plist_id, flag, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: plist_id  ! Dataset creation property list identifier
-    INTEGER, INTENT(OUT) :: flag   ! Fill time flag:
-                                   !  H5D_FILL_TIME_ERROR_F
-                                   !  H5D_FILL_TIME_ALLOC_F
-                                   !  H5D_FILL_TIME_NEVER_F
-    INTEGER, INTENT(OUT) :: hdferr ! Error code
-                                   ! 0 on success and -1 on failure
-
- -
- -

h5pget_filter_by_id_f

- -

[ Top ] [ Subroutines ]

-

NAME

-
  h5pget_filter_by_id_f 
-
-

PURPOSE

-
  Returns information about a filter in a pipeline
-
-

INPUTS

-
  prp_id       - data creation or transfer property list 
-                 identifier
-
-

OUTPUTS

-
  filter_id    - filter identifier
-  flags        - bit vector specifying certain general
-                 properties of the filter
-  cd_nelmts    - number of elements in cd_values
-  cd_values    - auxiliary data for the filter
-  namelen      - number of characters in the name buffer
-  name         - buffer to retrieve filter name
-  hdferr       - error code            
-                  Success:  0
-                  Failure: -1   
-
-

AUTHOR

-
  Elena Pourmal
-  April 10 2003
-
-

SOURCE

-
  SUBROUTINE h5pget_filter_by_id_f(prp_id, filter_id, flags, cd_nelmts, cd_values, namelen, name, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: prp_id   ! Property list identifier 
-    INTEGER, INTENT(IN) :: filter_id       ! Filter identifier
-    INTEGER(SIZE_T), INTENT(INOUT) :: cd_nelmts     ! Number of elements in cd_values.
-    INTEGER, DIMENSION(*), INTENT(OUT) :: cd_values ! Auxiliary data for the filter.
-    INTEGER, INTENT(OUT) :: flags          ! Bit vector specifying certain general
-                                           ! properties of the filter.
-    INTEGER(SIZE_T), INTENT(IN) :: namelen ! Anticipated number of characters in name.
-    CHARACTER(LEN=*), INTENT(OUT) :: name  ! Name of the filter
-    INTEGER, INTENT(OUT) :: hdferr         ! Error code
-                                           ! 0 on success and -1 on failure
-
- -
- -

h5pget_filter_f

- -

[ Top ] [ Subroutines ]

-

NAME

-
   h5pget_filter_f 
-
-

PURPOSE

-
  Returns information about a filter in a pipeline
-
-

INPUTS

-
  prp_id        - data creation or transfer property list 
-                  identifier
-  filter_number - sequence number within the filter
-                  pipeline of the filter for which 
-                  information is sought
-
-

OUTPUTS

-
  filter_id    - filter identification number
-  flags        - bit vector specifying certain general
-                 properties of the filter
-  cd_nelmts    - number of elements in cd_values
-  cd_values    - auxiliary data for the filter
-  namelen      - number of characters in the name buffer
-  name         - buffer to retrieve filter name
-  hdferr       - error code            
-                  Success:  0
-                  Failure: -1   
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999      
-
-

HISTORY

-
  Explicit Fortran interfaces were added for 
-  called C functions (it is needed for Windows
-  port).  March 14, 2001 
-
-

SOURCE

-
  SUBROUTINE h5pget_filter_f(prp_id, filter_number, flags, cd_nelmts, cd_values, namelen, name, filter_id, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier 
-    INTEGER, INTENT(IN) :: filter_number ! Sequence number within the filter
-                                         !  pipeline of the filter for which 
-                                         !  information is sought
-    INTEGER, DIMENSION(*), INTENT(OUT) :: cd_values  ! Auxiliary data for the filter.
-    INTEGER, INTENT(OUT) :: flags        ! Bit vector specifying certain general
-                                         !  properties of the filter.
-    INTEGER(SIZE_T), INTENT(INOUT) :: cd_nelmts  ! Number of elements in cd_values.
-    INTEGER(SIZE_T), INTENT(IN) :: namelen       ! Anticipated number of characters in name.
-    CHARACTER(LEN=*), INTENT(OUT) :: name        ! Name of the filter
-    INTEGER, INTENT(OUT) :: filter_id            ! Filter identification number  
-    INTEGER, INTENT(OUT) :: hdferr               ! Error code
-                                                 ! 0 on success and -1 on failure
-
- -
- -

h5pget_gc_references_f

- -

[ Top ] [ Subroutines ]

-

NAME

-
   h5pget_gc_references_f 
-
-

PURPOSE

-
  Returns garbage collecting references setting.       
-
-

INPUTS

-
  prp_id       - file access property list identifier
-
-

OUTPUTS

-
  gc_reference - flag for stting garbage collection on 
-                 and off (1 or 0)
-  hdferr       - error code            
-                  Success:  0
-                  Failure: -1   
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999      
-
-

HISTORY

-
  Explicit Fortran interfaces were added for 
-  called C functions (it is needed for Windows
-  port).  March 14, 2001 
-               
-
-

SOURCE

-
  SUBROUTINE h5pget_gc_references_f(prp_id, gc_reference, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier 
-    INTEGER, INTENT(OUT) :: gc_reference ! The flag for garbage collecting
-                                         !  references for the file
-    INTEGER, INTENT(OUT) :: hdferr       ! Error code
-                                         ! 0 on success and -1 on failure
-
- -
- -

h5pget_istore_k_f

- -

[ Top ] [ Subroutines ]

-

NAME

-
  h5pget_istore_k_f 
-
-

PURPOSE

-
  Queries the 1/2 rank of an indexed storage B-tree. 
-
-

INPUTS

-
  prp_id       - file creation property list identifier
-
-

OUTPUTS

-
  ik           - 1/2 rank of chunked storage B-tree
-  hdferr       - error code            
-                  Success:  0
-                  Failure: -1   
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999      
-
-

HISTORY

-
  Explicit Fortran interfaces were added for 
-  called C functions (it is needed for Windows
-  port).  March 14, 2001 
-               
-
-

SOURCE

-
  SUBROUTINE h5pget_istore_k_f(prp_id, ik, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier 
-    INTEGER, INTENT(OUT) :: ik           ! 1/2 rank of chunked storage B-tree
-    INTEGER, INTENT(OUT) :: hdferr       ! Error code
-                                         ! 0 on success and -1 on failure
-
- -
- -

h5pget_layout_f

- -

[ Top ] [ Subroutines ]

-

NAME

-
   h5pget_layout_f 
-
-

PURPOSE

-
  Returns the layout of the raw data for a dataset. 
-
-

INPUTS

-
  prp_id       - data creation property list identifier
-
-

OUTPUTS

-
  layout       - type of storage layout for raw data
-                 possible values are:
-                  H5D_COMPACT_F
-                  H5D_CONTIGUOUS_F
-                  H5D_CHUNKED_F
-  hdferr       - error code            
-                  Success:  0
-                  Failure: -1   
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999      
-
-

HISTORY

-
  Explicit Fortran interfaces were added for 
-  called C functions (it is needed for Windows
-  port).  March 14, 2001 
-
-

SOURCE

-
  SUBROUTINE h5pget_layout_f (prp_id, layout, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier 
-    INTEGER, INTENT(OUT) :: layout       ! Type of storage layout for raw data
-                                         ! possible values are:
-                                         !  H5D_COMPACT_F(0)
-                                         !  H5D_CONTIGUOUS_F(1)
-                                         !  H5D_CHUNKED_F(2)
-    INTEGER, INTENT(OUT) :: hdferr       ! Error code
-                                         ! 0 on success and -1 on failure
-
- -
- -

H5Pget_link_creation_order_f

- -

[ Top ] [ Subroutines ]

-

NAME

-
  H5Pget_link_creation_order_f
-
-

PURPOSE

-
  Queries whether link creation order is tracked and/or indexed in a group.
-
-

INPUTS

-
  gcpl_id - Group creation property list identifier
-
-

OUTPUTS

-
  crt_order_flags - Creation order flag(s)
-  hdferr          - Error code         
-                     Success:  0
-                     Failure: -1   
-
-

AUTHOR

-
  M. Scot Breitenfeld
-  March 3, 2008
-
-

SOURCE

-
  SUBROUTINE h5pget_link_creation_order_f(gcpl_id, crt_order_flags, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: gcpl_id   ! Group creation property list identifier
-    INTEGER, INTENT(OUT) :: crt_order_flags ! Creation order flag(s)
-    INTEGER, INTENT(OUT) :: hdferr          ! Error code
-                                            ! 0 on success and -1 on failure
-
- -
- -

H5Pget_link_phase_change_f

- -

[ Top ] [ Subroutines ]

-

NAME

-
  H5Pget_link_phase_change_f
-
-

PURPOSE

-
  Queries the settings for conversion between compact and dense groups.
-
-

INPUTS

-
  gcpl_id      - Group creation property list identifier
-
-

OUTPUTS

-
  max_compact  - Maximum number of attributes to be stored in compact storage
-  min_dense    - Minimum number of attributes to be stored in dense storage
-  hdferr       - Error code            
-                  Success:  0
-                  Failure: -1   
-
-

AUTHOR

-
  M. Scot Breitenfeld
-  February 20, 2008
-
-

SOURCE

-
  SUBROUTINE h5pget_link_phase_change_f(gcpl_id, max_compact, min_dense, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: gcpl_id ! Group creation property list identifier
-    INTEGER, INTENT(OUT) :: max_compact   ! Maximum number of attributes to be stored in compact storage
-    INTEGER, INTENT(OUT) :: min_dense     ! Minimum number of attributes to be stored in dense storage
-    INTEGER, INTENT(OUT) :: hdferr        ! Error code
-                                          ! 0 on success and -1 on failure
-
- -
- -

H5Pget_local_heap_size_hint_f

- -

[ Top ] [ Subroutines ]

-

NAME

-
  H5Pget_local_heap_size_hint_f 
-
-

PURPOSE

-
  Queries the local heap size hint for original-style groups.
-
-

INPUTS

-
  gcpl_id   - Group creation property list identifier
-
-

OUTPUTS

-
  size_hint - Hint for size of local heap
-  hdferr    - Error code
-               Success:  0
-               Failure: -1
-
-

AUTHOR

-
  M. Scot Breitenfeld
-  March 21, 2008
-
-

SOURCE

-
  SUBROUTINE h5pget_local_heap_size_hint_f(gcpl_id, size_hint, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: gcpl_id     ! Group creation property list identifier
-    INTEGER(SIZE_T), INTENT(OUT) :: size_hint ! Hint for size of local heap
-    INTEGER, INTENT(OUT) :: hdferr            ! Error code
-                                              ! 0 on success and -1 on failure
-
- -
- -

h5pget_meta_block_size_f

- -

[ Top ] [ Subroutines ]

-

NAME

-
  h5pget_meta_block_size_f 
-
-

PURPOSE

-
  Gets the minimum size of metadata block allocations 
-
-

INPUTS

-
  plist_id     - file access property list identifier
-
-

OUTPUTS

-
  size         - metatdata block size
-  hdferr       - error code            
-                  Success:  0
-                  Failure: -1
-
-

AUTHOR

-
  Elena Pourmal
-  October 7, 2002      
-
-

SOURCE

-
  SUBROUTINE h5pget_meta_block_size_f(plist_id, size, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: plist_id  ! File access property list identifier 
-    INTEGER(HSIZE_T), INTENT(OUT) :: size   ! Block size in bytes; 
-    INTEGER, INTENT(OUT) :: hdferr          ! Error code
-                                            ! 0 on success and -1 on failure
-
- -
- -

h5pget_nfilters_f

- -

[ Top ] [ Subroutines ]

-

NAME

-
   h5pget_nfilters_f 
-
-

PURPOSE

-
  Returns the number of filters in the pipeline. 
-
-

INPUTS

-
  prp_id       - data creation or transfer property list 
-                 identifier
-
-

OUTPUTS

-
  nfilters     - number of filters in the pipeline
-  hdferr       - error code            
-                  Success:  0
-                  Failure: -1   
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999      
-
-

HISTORY

-
  Explicit Fortran interfaces were added for 
-  called C functions (it is needed for Windows
-  port).  March 14, 2001 
-
-

SOURCE

-
  SUBROUTINE h5pget_nfilters_f (prp_id, nfilters, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier 
-    INTEGER, INTENT(OUT) :: nfilters     ! The number of filters in the pipeline
-    INTEGER, INTENT(OUT) :: hdferr       ! Error code
-                                         ! 0 on success and -1 on failure
-
- -
- -

h5pget_nlinks_f

- -

[ Top ] [ Subroutines ]

-

NAME

-
  h5pget_nlinks_f 
-
-

PURPOSE

-
  Gets maximum number of soft or user-defined link traversals.
-
-

INPUTS

-
  lapl_id - File access property list identifier
-  nlinks  - Maximum number of links to traverse
-
-

OUTPUTS

-
  hdferr  - error code
-             Success:  0
-             Failure: -1
-
-

AUTHOR

-
  M. Scot Breitenfeld
-  March 24, 2008
-
-

SOURCE

-
  SUBROUTINE h5pget_nlinks_f(lapl_id, nlinks, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: lapl_id  ! File access property list identifier
-    INTEGER(SIZE_T), INTENT(OUT) :: nlinks ! Maximum number of links to traverse
-    INTEGER, INTENT(OUT) :: hdferr         ! Error code
-                                           ! 0 on success and -1 on failure
-
- -
- -

h5pget_npros_f

- -

[ Top ] [ Subroutines ]

-

NAME

-
   h5pget_npros_f 
-
-

PURPOSE

-
  Queries number of properties in property list or class
-
-

INPUTS

-
  prp_id       - iproperty list identifier to query
-
-

OUTPUTS

-
  nprops       - number of properties in property object
-  hdferr       - error code            
-                  Success:  0
-                  Failure: -1   
-
-

AUTHOR

-
  Elena Pourmal
-  October 9, 2002      
-
-

SOURCE

-
  SUBROUTINE h5pget_nprops_f(prp_id, nprops, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: prp_id    ! Property list identifier 
-    INTEGER(SIZE_T), INTENT(OUT) :: nprops  ! Number of properties
-    INTEGER, INTENT(OUT) :: hdferr          ! Error code
-                                            ! 0 on success and -1 on failure
-
- -
- -

H5Pget_obj_track_times_f

- -

[ Top ] [ Subroutines ]

-

NAME

-
  H5Pget_obj_track_times_f 
-
-

PURPOSE

-
  Returns whether times are tracked for an object.
-
-

INPUTS

-
  plist_id     - property list id
-  flag         - object timestamp setting
-                 .TRUE.,.FALSE.
-
-

OUTPUTS

-
  hdferr       - error code            
-                 Success:  0
-                 Failure: -1   
-
-

AUTHOR

-
  M. Scot Breitenfeld
-  February 22, 2008
-
-

SOURCE

-
  SUBROUTINE h5pget_obj_track_times_f(plist_id, flag, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: plist_id ! Dataset creation property 
-                                           ! list identifier 
-    LOGICAL, INTENT(OUT) :: flag   ! Object timestamp setting
-    INTEGER, INTENT(OUT) :: hdferr ! Error code
-                                   ! 0 on success and -1 on failure
-
- -
- -

h5pget_preserve_f

- -

[ Top ] [ Subroutines ]

-

NAME

-
  h5pget_preserve_f 
-
-

PURPOSE

-
  Checks status of the dataset transfer property list.
-
-

INPUTS

-
  prp_id  - property list identifier
-
-

OUTPUTS

-
  flag    - status flag
-  hdferr  - error code         
-       Success:  0
-       Failure: -1
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999      
-
-

HISTORY

-
  Explicit Fortran interfaces were added for 
-  called C functions (it is needed for Windows
-  port).  March 14, 2001
- 
-  Datatype of the flag parameter is changed from 
-  INTEGER to LOGICAL 
-  June 4, 2003 
-
-

SOURCE

-
  SUBROUTINE h5pget_preserve_f(prp_id, flag, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier 
-    LOGICAL, INTENT(OUT) ::  flag        ! TRUE/FALSE flag. Shows status of the dataset's
-                                         ! transfer property for partial writing/reading
-                                         ! compound datatype
-    INTEGER, INTENT(OUT) :: hdferr       ! Error code
-                                         ! 0 on success and -1 on failure
-
- -
- -

h5pget_sec2_f

- -

[ Top ] [ Subroutines ]

-

NAME

-
   h5pget_sec2_f 
-
-

PURPOSE

-
  NOT AVAILABLE
-
-

INPUTS

-

OUTPUTS

-
  hdferr  - error code         
-             Success:  0
-             Failure: -1   
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999      
-
-

HISTORY

-
  Explicit Fortran interfaces were added for 
-  called C functions (it is needed for Windows
-  port).  March 14, 2001 
-               
- SOURCE!          SUBROUTINE h5pget_sec2_f (prp_id, sec2, hdferr) 
-            IMPLICIT NONE
-            INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier
-            INTEGER, INTENT(OUT) :: sec2   ! value indicates whether the file
-            INTEGER, INTENT(OUT) :: hdferr  ! Error code
- 0 on success and -1 on failure
-
- -
- -

h5pget_sieve_buf_size_f

- -

[ Top ] [ Subroutines ]

-

NAME

-
  h5pget_sieve_buf_size_f 
-
-

PURPOSE

-
  Gets the maximum size of the data sieve buffer
-
-

INPUTS

-
  plist_id     - file access property list identifier
-
-

OUTPUTS

-
  size         - sieve buffer size
-  hdferr       - error code            
-                  Success:  0
-                  Failure: -1
-
-

AUTHOR

-
  Elena Pourmal
-  October 7, 2002      
-
-

SOURCE

-
  SUBROUTINE h5pget_sieve_buf_size_f(plist_id, size, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: plist_id ! File access property list identifier 
-    INTEGER(SIZE_T), INTENT(OUT) :: size   ! Buffer size in bytes 
-    INTEGER, INTENT(OUT)       :: hdferr   ! Error code
-                                           ! 0 on success and -1 on failure
-
- -
- -

h5pget_size_f

- -

[ Top ] [ Subroutines ]

-

NAME

-
  h5pget_size_f 
-
-

PURPOSE

-
  Queries the size of a property value in bytes.
-
-

INPUTS

-
  prp_id       - property list identifier to query
-  name         - name of property to query
-
-

OUTPUTS

-
  size         - size of property in bytes
-  hdferr       - error code            
-                  Success:  0
-                  Failure: -1   
-
-

AUTHOR

-
  Elena Pourmal
-  October 9, 2002      
-
-

HISTORY

-

SOURCE

-
  SUBROUTINE h5pget_size_f(prp_id, name, size, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: prp_id  ! Property list identifier 
-    CHARACTER(LEN=*), INTENT(IN) :: name  ! Name of property to query
-    INTEGER(SIZE_T), INTENT(OUT) :: size  ! Size in bytes
-    INTEGER, INTENT(OUT) :: hdferr        ! Error code
-                                          ! 0 on success and -1 on failure
-
- -
- -

h5pget_sizes_f

- -

[ Top ] [ Subroutines ]

-

NAME

-
  h5pget_sizes_f 
-
-

PURPOSE

-
  Retrieves the size of the offsets and lengths used 
-  in an HDF5 file
-
-

INPUTS

-
  prp_id       - file creation property list identifier
-
-

OUTPUTS

-
  sizeof_addr  - size of an object offset in bytes 
-  sizeof_size  - size of an object length in bytes
-  hdferr       - error code            
-                  Success:  0
-                  Failure: -1   
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999      
-
-

HISTORY

-
  Explicit Fortran interfaces were added for 
-  called C functions (it is needed for Windows
-  port).  March 14, 2001 
-               
-
-

SOURCE

-
  SUBROUTINE h5pget_sizes_f(prp_id, sizeof_addr, sizeof_size, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: prp_id        ! Property list identifier 
-    INTEGER(SIZE_T), INTENT(OUT) :: sizeof_addr ! Size of an object
-                                                ! offset in bytes 
-    INTEGER(SIZE_T), INTENT(OUT) :: sizeof_size ! Size of an object
-                                                ! length in bytes 
-    INTEGER, INTENT(OUT) :: hdferr              ! Error code
-                                                ! 0 on success and -1 on failure
-
- -
- -

h5pget_small_data_block_size_f

- -

[ Top ] [ Subroutines ]

-

NAME

-
  h5pget_small_data_block_size_f 
-
-

PURPOSE

-
  Gets the minimum size of "small" raw data block
-
-

INPUTS

-
  plist_id     - file access property list identifier
-
-

OUTPUTS

-
  size         - small raw data block size
-  hdferr       - error code            
-                  Success:  0
-                  Failure: -1
-
-

AUTHOR

-
  Elena Pourmal
-  October 7, 2002      
-
-

SOURCE

-
  SUBROUTINE h5pget_small_data_block_size_f(plist_id, size, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: plist_id  ! File access property list identifier 
-    INTEGER(HSIZE_T), INTENT(OUT) :: size   ! Small raw data block size
-    INTEGER, INTENT(OUT) :: hdferr          ! Error code
-                                            ! 0 on success and -1 on failure
-
- -
- -

h5pget_split_f

- -

[ Top ] [ Subroutines ]

-

NAME

-
   h5pget_split_f 
-
-

PURPOSE

-
  NOT AVAILABLE
-
-

INPUTS

-

OUTPUTS

-
  hdferr  - error code         
-             Success:  0
-             Failure: -1   
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999      
-
-

HISTORY

-
  Explicit Fortran interfaces were added for 
-  called C functions (it is needed for Windows
-  port).  March 14, 2001 
-               
-
-

SOURCE

-
!          SUBROUTINE h5pget_split_f(prp_id, meta_ext_size, meta_ext, meta_plist,raw_ext_size,&
-!                                     raw_ext, raw_plist, hdferr)
-!            IMPLICIT NONE
-!            INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier
-!            INTEGER(SIZE_T), INTENT(IN) :: meta_ext_size ! Number of characters of the meta
-                                                         ! file extension to be copied to the
-                                                         ! meta_ext buffer
-
-!            CHARACTER(LEN=*), INTENT(OUT) :: meta_ext  !Name of the extension for
-                                                      !the metafile filename
-!            INTEGER(HID_T), INTENT(OUT) :: meta_plist  ! Identifier of the meta file
-                                                      ! access property list
-!            INTEGER(SIZE_T), INTENT(IN) :: raw_ext_size ! Number of characters of the raw
-                                                         ! file extension to be copied to the
-                                                         ! raw_ext buffer
-!            CHARACTER(LEN=*), INTENT(OUT) :: raw_ext  !Name extension for the raw file filename
-!            INTEGER(HID_T), INTENT(OUT) :: raw_plist  !Identifier of the raw file
-                                                     !access property list
-!            INTEGER, INTENT(OUT) :: hdferr  ! Error code
-                                     ! 0 on success and -1 on failure
-
- -
- -

h5pget_stdio_f

- -

[ Top ] [ Subroutines ]

-

NAME

-
  h5pget_stdio_f 
-
-

PURPOSE

-
  NOT AVAILABLE
-
-

INPUTS

-

OUTPUTS

-
  hdferr  - error code         
-             Success:  0
-             Failure: -1   
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999      
-
-

HISTORY

-
  Explicit Fortran interfaces were added for 
-  called C functions (it is needed for Windows
-  port).  March 14, 2001 
-               
-
-

SOURCE

-
!          SUBROUTINE h5pget_stdio_f (prp_id, io, hdferr)
-!
-!            IMPLICIT NONE
-!            INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier
-!            INTEGER, INTENT(OUT) :: io   ! value indicates that the file
-                                         !access property list is set to
-                                         !the stdio driver
-!            INTEGER, INTENT(OUT) :: hdferr  ! Error code
-                                     ! 0 on success and -1 on failure
-
- -
- -

h5pget_sym_k_f

- -

[ Top ] [ Subroutines ]

-

NAME

-
  h5pget_sym_k_f 
-
-

PURPOSE

-
  Retrieves the size of the symbol table B-tree 1/2 rank
-  and the symbol table leaf node 1/2 size. 
-
-

INPUTS

-
  prp_id       - file creation property list identifier
-
-

OUTPUTS

-
  ik           - symbol table tree 1/2 rank
-  lk           - symbol table node 1/2 size
-  hdferr       - error code            
-                  Success:  0
-                  Failure: -1   
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999      
-
-

HISTORY

-
  Explicit Fortran interfaces were added for 
-  called C functions (it is needed for Windows
-  port).  March 14, 2001 
-               
-
-

SOURCE

-
  SUBROUTINE h5pget_sym_k_f(prp_id, ik, lk, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier 
-    INTEGER, INTENT(OUT) :: ik           ! Symbol table tree rank
-    INTEGER, INTENT(OUT) :: lk           ! Symbol table node size
-    INTEGER, INTENT(OUT) :: hdferr       ! Error code
-                                         ! 0 on success and -1 on failure
-
- -
- -

h5pget_userblock_f

- -

[ Top ] [ Subroutines ]

-

NAME

-
  h5pget_userblock_f 
-
-

PURPOSE

-
  Gets user block size.
-
-

INPUTS

-
  prp_id       - file creation property list identifier
-
-

OUTPUTS

-
  block_size   - size of the user block in bytes
-  hdferr       - error code            
-                  Success:  0
-                  Failure: -1   
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999      
-
-

HISTORY

-
  Explicit Fortran interfaces were added for 
-  called C functions (it is needed for Windows
-  port).  March 14, 2001 
-               
-
-

SOURCE

-
  SUBROUTINE h5pget_userblock_f(prp_id, block_size, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: prp_id         ! Property list identifier 
-    INTEGER(HSIZE_T), INTENT(OUT) ::  block_size ! Size of the 
-                                                 ! user-block in bytes 
-    INTEGER, INTENT(OUT) :: hdferr               ! Error code
-                                                 ! 0 on success and -1 on failure
-
- -
- -

h5pget_version_f

- -

[ Top ] [ Subroutines ]

-

NAME

-
  h5pget_version_f 
-
-

PURPOSE

-
  Retrieves the version information of various objects 
-  for a file creation property list
-
-

INPUTS

-
  prp_id       - file createion property list identifier
-
-

OUTPUTS

-
  boot         - super block version number
-  freelist     - global freelist version number
-  stab         - symbol table version number
-  shhdr        - shared object header version number
-  hdferr       - error code            
-                  Success:  0
-                  Failure: -1   
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999      
-
-

HISTORY

-
  Explicit Fortran interfaces were added for 
-  called C functions (it is needed for Windows
-  port).  March 14, 2001 
-               
-
-

SOURCE

-
  SUBROUTINE h5pget_version_f(prp_id, boot, freelist, &
-       stab, shhdr, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: prp_id        ! Property list identifier 
-    INTEGER, DIMENSION(:), INTENT(OUT) :: boot  ! Array to put boot
-                                                ! block version number
-    INTEGER, DIMENSION(:), INTENT(OUT) :: freelist  ! Array to put global
-                                                    ! Freelist version number
-
-    INTEGER, DIMENSION(:), INTENT(OUT) :: stab  ! Array to put symbol
-                                                ! table version number
-    INTEGER, DIMENSION(:), INTENT(OUT) :: shhdr ! Array to put shared
-                                                ! object header version number
-    INTEGER, INTENT(OUT) :: hdferr              ! Error code
-                                                ! 0 on success and -1 on failure
-
- -
- -

h5pisa_class_f

- -

[ Top ] [ Subroutines ]

-

NAME

-
   h5pisa_class_f 
-
-

PURPOSE

-
  Determines whether a property list is a member of a class. 
-
-

INPUTS

-
  plist        - property list identifier 
-  pclass       - identifier of the property class
-
-

OUTPUTS

-
  flag         - .TRUE. if a member, .FALSE. otherwise
-  hdferr:      - error code           
-                  Success:  0
-                  Failure: -1   
-
-

AUTHOR

-
  Elena Pourmal
-  October 9, 2002      
-
-

SOURCE

-
  SUBROUTINE h5pisa_class_f(plist, pclass, flag, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: plist     ! Property list identifier 
-    INTEGER(HID_T), INTENT(IN) :: pclass    ! Class identifier
-    LOGICAL, INTENT(OUT) :: flag            ! logical flag
-    INTEGER, INTENT(OUT) :: hdferr  ! Error code
-                                    ! 0 on success and -1 on failure
-
- -
- -

h5pmodify_filter_f

- -

[ Top ] [ Subroutines ]

-

NAME

-
  h5pmodify_filter_f 
-
-

PURPOSE

-
  Adds a filter to the filter pipeline. 
-
-

INPUTS

-
  prp_id       - data creation or transfer property list 
-                 identifier
-  filter       - filter to be modified
-  flags        - bit vector specifying certain general
-                 properties of the filter
-  cd_nelmts    - number of elements in cd_values
-  cd_values    - auxiliary data for the filter
-
-

OUTPUTS

-
  hdferr       - error code            
-                  Success:  0
-                  Failure: -1   
-
-

AUTHOR

-
  Elena Pourmal
-  April 10 2003
-
-

SOURCE

-
  SUBROUTINE h5pmodify_filter_f(prp_id, filter, flags, cd_nelmts, cd_values,  hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier 
-    INTEGER, INTENT(IN) :: filter        ! Filter to be modified
-    INTEGER, INTENT(IN) :: flags         ! Bit vector specifying certain general
-                                         !  properties of the filter
-    INTEGER(SIZE_T), INTENT(IN) :: cd_nelmts       ! Number of elements in cd_values
-    INTEGER, DIMENSION(*), INTENT(IN) :: cd_values ! Auxiliary data for the filter
-    INTEGER, INTENT(OUT) :: hdferr       ! Error code
-                                         ! 0 on success and -1 on failure
-
- -
- -

h5premove_f

- -

[ Top ] [ Subroutines ]

-

NAME

-
   h5premove_f 
-
-

PURPOSE

-
  Removes a property from a property list. 
-
-

INPUTS

-
  plid         - Property list identofoer
-  name         - name of the property to remove
-
-

OUTPUTS

-
  hdferr:      - error code
-                  Success: 0 
-                  Failure: -1   
-
-

AUTHOR

-
  Elena Pourmal
-  October 9, 2002      
-
-

SOURCE

-
  SUBROUTINE h5premove_f(plid, name, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: plid   ! Property list identifier
-    CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to remove
-    INTEGER, INTENT(OUT) :: hdferr       ! Error code
-                                         !  0 on success and -1 on failure
-
- -
- -

h5premove_filter_f

- -

[ Top ] [ Subroutines ]

-

NAME

-
  h5premove_filter_f 
-
-

PURPOSE

-
  Delete one or more filters from the filter pipeline. 
-
-

INPUTS

-
  prp_id       - data creation or transfer property list 
-                 identifier
-  filter       - filter to be removed
-
-

OUTPUTS

-
  hdferr       - error code            
-                  Success:  0
-                  Failure: -1   
-
-

AUTHOR

-
  Quincey Koziol
-  January 27 2004
-
-

SOURCE

-
  SUBROUTINE h5premove_filter_f(prp_id, filter, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: prp_id ! Dataset creation property list
-                                         ! identifier
-    INTEGER, INTENT(IN) :: filter        ! Filter to be removed
-    INTEGER, INTENT(OUT) :: hdferr       ! Error code
-                                         ! 0 on success and -1 on failure
-
- -
- -

h5pset_alignment_f

- -

[ Top ] [ Subroutines ]

-

NAME

-
  h5pset_alignment_f 
-
-

PURPOSE

-
  Sets alignment properties of a file access property list. 
-
-

INPUTS

-
  prp_id       - file access property list identifier
-  threshold    - threshold value       
-  alignment    - alignment value
-
-

OUTPUTS

-
  hdferr       - error code            
-                  Success:  0
-                  Failure: -1   
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999      
-
-

HISTORY

-
  Explicit Fortran interfaces were added for 
-  called C functions (it is needed for Windows
-  port).  March 14, 2001 
-               
-
-

SOURCE

-
  SUBROUTINE h5pset_alignment_f(prp_id, threshold,  alignment, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: prp_id      ! Property list identifier 
-    INTEGER(HSIZE_T), INTENT(IN) :: threshold ! Threshold value
-    INTEGER(HSIZE_T), INTENT(IN) :: alignment ! alignment value
-    INTEGER, INTENT(OUT) :: hdferr            ! Error code
-                                              ! 0 on success and -1 on failure
-
- -
- -

h5pset_alloc_time_f

- -

[ Top ] [ Subroutines ]

-

NAME

-
  h5pset_alloc_time_f
-
-

PURPOSE

-
  Set space allocation time for dataset during creation.
-
-

INPUTS

-
  plist_id     - dataset creation property list identifier
-  flag         - allocation time flag:
-                   H5D_ALLOC_TIME_ERROR_F
-                   H5D_ALLOC_TIME_DEFAULT_F
-                   H5D_ALLOC_TIME_EARLY_F
-                   H5D_ALLOC_TIME_LATE_F
-                   H5D_ALLOC_TIME_INCR_F
-
-

OUTPUTS

-
  hdferr       - error code            
-                  Success:  0
-                  Failure: -1
-
-

AUTHOR

-
  Elena Pourmal
-  October 4, 2002      
-
-

SOURCE

-
  SUBROUTINE h5pset_alloc_time_f(plist_id, flag, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: plist_id  ! Dataset creation property list identifier
-    INTEGER, INTENT(IN) :: flag             ! Allocation time flag:
-                                            !  H5D_ALLOC_TIME_ERROR_F
-                                            !  H5D_ALLOC_TIME_DEFAULT_F
-                                            !  H5D_ALLOC_TIME_EARLY_F
-                                            !  H5D_ALLOC_TIME_LATE_F
-                                            !  H5D_ALLOC_TIME_INCR_F
-    INTEGER, INTENT(OUT) :: hdferr          ! Error code
-                                            ! 0 on success and -1 on failure
-
- -
- -

H5Pset_attr_creation_order_f

- -

[ Top ] [ Subroutines ]

-

NAME

-
  H5Pset_attr_creation_order_f 
-
-

PURPOSE

-
  Sets tracking and indexing of attribute creation order
-
-

INPUTS

-
  ocpl_id         - Object creation property list identifier
-  crt_order_flags - Flags specifying whether to track and index attribute creation order
-
-

OUTPUTS

-
  hdferr          - Error code         
-                     Success:  0
-                     Failure: -1   
-
-

AUTHOR

-
  M. Scot Breitenfeld
-  January, 2008
-
-

SOURCE

-
  SUBROUTINE h5pset_attr_creation_order_f(ocpl_id, crt_order_flags , hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: ocpl_id   ! Object (dataset or group) creation property list identifier
-    INTEGER, INTENT(IN) :: crt_order_flags  ! Flags specifying whether to track and index attribute creation order
-    INTEGER, INTENT(OUT) :: hdferr          ! Error code
-                                            ! 0 on success and -1 on failure
-
- -
- -

H5Pset_attr_phase_change_f

- -

[ Top ] [ Subroutines ]

-

NAME

-
  H5Pset_attr_phase_change_f 
-
-

PURPOSE

-
  Sets attribute storage phase change thresholds.
-
-

INPUTS

-
  ocpl_id - Object (dataset or group) creation property list identifier
-
-

OUTPUTS

-
  max_compact     - Maximum number of attributes to be stored in compact storage
-                    (Default: 8)
-  min_dense       - Minimum number of attributes to be stored in dense storage
-                    (Default: 6)
-  hdferr          - Error code         
-                     Success:  0
-                     Failure: -1   
-
-

AUTHOR

-
  M. Scot Breitenfeld
-  January, 2008
-
-

SOURCE

-
SUBROUTINE h5pset_attr_phase_change_f(ocpl_id, max_compact, min_dense, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: ocpl_id ! Object (dataset or group) creation property list identifier
-    INTEGER, INTENT(IN) :: max_compact    ! Maximum number of attributes to be stored in compact storage
-                                          !(Default: 8)
-    INTEGER, INTENT(IN) :: min_dense      ! Minimum number of attributes to be stored in dense storage
-                                          ! (Default: 6)
-    INTEGER, INTENT(OUT) :: hdferr        ! Error code
-                                          ! 0 on success and -1 on failure
-
- -
- -

h5pset_btree_ratios_f

- -

[ Top ] [ Subroutines ]

-

NAME

-
   h5pset_btree_ratios_f 
-
-

PURPOSE

-
  Sets B-tree split ratios for a dataset transfer 
-  property list. 
-
-

INPUTS

-
  prp_id       - the dataset transfer property list 
-                 identifier 
-  left         - the B-tree split ratio for left-most nodes 
-  middle       - the B-tree split ratio for all other nodes
-  right        - the B-tree split ratio for right-most nodes
-
-

OUTPUTS

-
  hdferr       - error code            
-                  Success:  0
-                  Failure: -1   
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999      
-
-

HISTORY

-
  Explicit Fortran interfaces were added for 
-  called C functions (it is needed for Windows
-  port).  March 14, 2001 
-
-

SOURCE

-
  SUBROUTINE h5pset_btree_ratios_f(prp_id, left, middle, right, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier
-    REAL, INTENT(IN) :: left   ! The B-tree split ratio for left-most nodes.
-    REAL, INTENT(IN) :: middle ! The B-tree split ratio for all other nodes 
-    REAL, INTENT(IN) :: right  ! The B-tree split ratio for right-most 
-                               !  nodes and lone nodes. 
-    INTEGER, INTENT(OUT) :: hdferr  ! Error code
-                                    ! 0 on success and -1 on failure
-
- -
- -

h5pset_buffer_f

- -

[ Top ] [ Subroutines ]

-

NAME

-
  h5pset_buffer_f 
-
-

PURPOSE

-
  Sets sixe for conversion buffer
-
-

INPUTS

-
  plist_id     - data transfer property list identifier
-  size         - buffer size 
-
-

OUTPUTS

-
  hdferr:      - error code            
-                  Success:  0
-                  Failure: -1
-
-

AUTHOR

-
  Elena Pourmal
-  October 2, 2002      
-
-

SOURCE

-
  SUBROUTINE h5pset_buffer_f(plist_id, size, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: plist_id ! Data transfer property list identifier 
-    INTEGER(HSIZE_T), INTENT(IN) :: size   ! Buffer size in bytes; 
-                                           ! buffer is allocated and freed by 
-                                           ! the library.
-    INTEGER, INTENT(OUT)       :: hdferr   ! Error code
-                                           ! 0 on success and -1 on failure
-
- -
- -

h5pset_cache_f

- -

[ Top ] [ Subroutines ]

-

NAME

-
   h5pset_cache_f 
-
-

PURPOSE

-
  Sets the meta data cache and raw data chunk 
-  cache parameters
-
-

INPUTS

-
  prp_id       - file access property list identifier
-  mdc_nelmts   - number of elements (objects) in the meta 
-                 data cache 
-  rdcc_nelmts  - number of elements (objects) in the raw 
-                 data chunk cache 
-  rdcc_nbytes  - total size of the raw data chunk cache, in bytes 
-  rdcc_w0      - preemption policy (0 or 1)
-
-

OUTPUTS

-
  hdferr       - error code            
-                  Success:  0
-                  Failure: -1   
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999      
-
-

HISTORY

-
  Explicit Fortran interfaces were added for 
-  called C functions (it is needed for Windows
-  port).  March 14, 2001 
-               
-
-

SOURCE

-
  SUBROUTINE h5pset_cache_f(prp_id, mdc_nelmts,rdcc_nelmts, rdcc_nbytes, rdcc_w0, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier 
-    INTEGER, INTENT(IN) :: mdc_nelmts    ! Number of elements (objects)
-                                         !  in the meta data cache
-    INTEGER(SIZE_T), INTENT(IN) :: rdcc_nelmts ! Number of elements (objects)
-                                               !  in the meta data cache
-    INTEGER(SIZE_T), INTENT(IN) :: rdcc_nbytes ! Total size of the raw data 
-                                               !  chunk cache, in bytes 
-    REAL, INTENT(IN) :: rdcc_w0                ! Preemption policy
-    INTEGER, INTENT(OUT) :: hdferr             ! Error code
-                                               !  0 on success and -1 on failure
-
- -
- -

H5Pset_char_encoding_f

- -

[ Top ] [ Subroutines ]

-

NAME

-
  H5Pset_char_encoding_f
-
-

PURPOSE

-
  Sets the character encoding used to encode a string.
-
-

INPUTS

-
  plist_id - Property list identifier
-  encoding - Valid values for encoding are:
-               H5T_CSET_ASCII_F -> US ASCII
-               H5T_CSET_UTF8_F -> UTF-8 Unicode encoding
-
-

OUTPUTS

-
  hdferr   - Error code                
-               Success:  0
-               Failure: -1   
-
-

AUTHOR

-
  M. Scot Breitenfeld
-  March 3, 2008
-
-

SOURCE

-
  SUBROUTINE h5pset_char_encoding_f(plist_id, encoding, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: plist_id ! Property list identifier
-    INTEGER, INTENT(IN) :: encoding        ! String encoding character set:
-                                           !   H5T_CSET_ASCII_F -> US ASCII
-                                           !   H5T_CSET_UTF8_F  -> UTF-8 Unicode encoding
-    INTEGER, INTENT(OUT) :: hdferr         ! Error code
-                                           ! 0 on success and -1 on failure
-
- -
- -

H5Pset_chunk_cache_f

- -

[ Top ] [ Subroutines ]

-

NAME

-
  H5Pset_chunk_cache_f
-
-

PURPOSE

-
  Set the number of objects in the meta data cache and the
-  maximum number of chunks and bytes in the raw data chunk cache.
-  Once set, these values will override the values in the file access
-  property list.  Each of these values can be individually unset
-  (or not set at all) by passing the macros:
-    H5D_CHUNK_CACHE_NSLOTS_DFLT_F,
-    H5D_CHUNK_CACHE_NBYTES_DFLT_F, and/or
-    H5D_CHUNK_CACHE_W0_DFLT_F
-    as appropriate.
-
-  The RDCC_W0 value should be between 0 and 1 inclusive and
-  indicates how much chunks that have been fully read or fully
-  written are favored for preemption.  A value of zero means
-  fully read or written chunks are treated no differently than
-  other chunks (the preemption is strictly LRU) while a value
-  of one means fully read chunks are always preempted before
-  other chunks.
-
-

INPUTS

-
  dapl_id          - Dataset access property list identifier.
-  rdcc_nslots      - The number of chunk slots in the raw data chunk cache for this dataset.
-  rdcc_nbytes      - The total size of the raw data chunk cache for this dataset.
-  rdcc_w0          - The chunk preemption policy for this dataset.
-
-

OUTPUTS

-
  hdferr           - Error code                
-                       Success:  0
-                       Failure: -1   
-
-

AUTHOR

-
  M. Scot Breitenfeld
-  April 13, 2009
-
-

HISTORY

-

SOURCE

-
  SUBROUTINE h5pset_chunk_cache_f(dapl_id, rdcc_nslots, rdcc_nbytes, rdcc_w0, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: dapl_id      ! Dataset access property list identifier.
-    INTEGER(SIZE_T), INTENT(IN) :: rdcc_nslots ! The number of chunk slots in the raw data 
-                                               ! chunk cache for this dataset.
-    INTEGER(SIZE_T), INTENT(IN) :: rdcc_nbytes ! The total size of the raw data chunk cache 
-                                               ! for this dataset.
-    REAL, INTENT(IN) :: rdcc_w0                ! The chunk preemption policy for this dataset.
-    INTEGER, INTENT(OUT) :: hdferr             ! Error code
-                                               ! 0 on success and -1 on failure
-
- -
- -

h5pset_chunk_f

- -

[ Top ] [ Subroutines ]

-

NAME

-
   h5pset_chunk_f 
-
-

PURPOSE

-
  Sets the size of the chunks used to store 
-  a chunked layout dataset. 
-
-

INPUTS

-
  prp_id  - datatset creation property list identifier
-  ndims   - number of dimensions for each chunk
-  dims    - array with dimension sizes for each chunk
-
-

OUTPUTS

-
  hdferr  - error code         
-             Success:  0
-             Failure: -1
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999      
-
-

HISTORY

-
   Explicit Fortran interfaces were added for 
-   called C functions (it is needed for Windows
-   port).  March 14, 2001 
-               
-
-

SOURCE

-
  SUBROUTINE h5pset_chunk_f(prp_id, ndims, dims, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier 
-    INTEGER, INTENT(IN) :: ndims         ! Number of chunk dimensions
-    INTEGER(HSIZE_T), DIMENSION(ndims), INTENT(IN) :: dims    
-                                         ! Array containing sizes of
-                                         ! chunk dimensions
-    INTEGER, INTENT(OUT) :: hdferr       ! Error code
-                                         ! 0 on success and -1 on failure
-
- -
- -

h5pset_copy_object_f

- -

[ Top ] [ Subroutines ]

-

NAME

-
  h5pset_copy_object_f 
-
-

PURPOSE

-
  Sets properties to be used when an object is copied.
-
-

INPUTS

-
  ocp_plist_id - Object copy property list identifier
-  copy_options - Copy option(s) to be set
-
-

OUTPUTS

-
  hdferr       - error code            
-                  Success:  0
-                  Failure: -1   
-
-

AUTHOR

-
  M. Scot Breitenfeld
-  March 3, 2008
-
-

HISTORY

-

SOURCE

-
  SUBROUTINE h5pset_copy_object_f(ocp_plist_id, copy_options, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: ocp_plist_id ! Object copy property list identifier
-    INTEGER, INTENT(IN) :: copy_options ! Copy option(s) to be set, valid options are:
-                                        !   H5O_COPY_SHALLOW_HIERARCHY_F
-                                        !   H5O_COPY_EXPAND_SOFT_LINK_F
-                                        !   H5O_COPY_EXPAND_EXT_LINK_F
-                                        !   H5O_COPY_EXPAND_REFERENCE_F
-                                        !   H5O_COPY_WITHOUT_ATTR_FLAG_F
-    INTEGER, INTENT(OUT) :: hdferr      ! Error code
-                                        ! 0 on success and -1 on failure
-
- -
- -

H5Pset_create_inter_group_f

- -

[ Top ] [ Subroutines ]

-

NAME

-
  H5Pset_create_inter_group_f
-
-

PURPOSE

-
  Specifies in property list whether to create missing intermediate groups.
-
-

INPUTS

-
  lcpl_id            - Link creation property list identifier
-  crt_intermed_group - crt_intermed_group specifying whether 
-                       to create intermediate groups upon the creation 
-                       of an object
-
-

OUTPUTS

-
  hdferr             - Error code              
-                         Success:  0
-                         Failure: -1   
-
-

AUTHOR

-
  M. Scot Breitenfeld
-  February 22, 2008
-
-

HISTORY

-
 The long subroutine name (>31) on older f90 compilers causes problems
-          so had to shorten the name
-
-

SOURCE

-
  SUBROUTINE h5pset_create_inter_group_f(lcpl_id, crt_intermed_group, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: lcpl_id      ! Link creation property list identifier
-    INTEGER, INTENT(IN) :: crt_intermed_group  ! specifying whether to create intermediate groups
-                                               ! upon the creation of an object
-    INTEGER, INTENT(OUT) :: hdferr ! Error code
-                                   ! 0 on success and -1 on failure
-
- -
- -

h5pset_data_transform_f

- -

[ Top ] [ Subroutines ]

-

NAME

-
  h5pset_data_transform_f 
-
-

PURPOSE

-
  Sets a data transform expression.
-
-

INPUTS

-
  plist_id   - Identifier of the property list or class 
-  expression - Buffer to hold transform expression
-
-

OUTPUTS

-
  hdferr     - error code
-                 Success:  0
-                 Failure: -1
-
-

AUTHOR

-
  M. Scot Breitenfeld
-  March 19, 2008
-
-

SOURCE

-
  SUBROUTINE h5pset_data_transform_f(plist_id, expression, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: plist_id     ! Identifier of the property list or class
-    CHARACTER(LEN=*), INTENT(IN) :: expression ! Buffer to hold transform expression
-    INTEGER, INTENT(OUT) :: hdferr             ! Error code
-                                               ! 0 on success and -1 on failure
-
- -
- -

h5pset_deflate_f

- -

[ Top ] [ Subroutines ]

-

NAME

-
   h5pset_deflate_f 
-
-

PURPOSE

-
   Sets compression method and compression level. 
-
-

INPUTS

-
   prp_id  - property list identifier
-   level   - compression level
-
-

OUTPUTS

-
  hdferr  - error code         
-             Success:  0
-             Failure: -1
-
-

AUTHOR

-
       Elena Pourmal
-               August 12, 1999
-
-

HISTORY

-
       Explicit Fortran interfaces were added for 
-                       called C functions (it is needed for Windows
-                       port).  March 14, 2001
-               
-
-

SOURCE

-
  SUBROUTINE h5pset_deflate_f(prp_id, level, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier 
-    INTEGER, INTENT(IN) :: level         ! Compression level 
-    INTEGER, INTENT(OUT) :: hdferr       ! Error code
-                                         ! 0 on success and -1 on failure
-
- -
- -

h5pset_edc_check_f

- -

[ Top ] [ Subroutines ]

-

NAME

-
  h5pset_edc_check_f 
-
-

PURPOSE

-
  Enables/disables error detecting  
-
-

INPUTS

-
  prp_id       - dataset creation property list identifier
-  flag         - EDC flag; possible values:
-                   H5Z_DISABLE_EDC_F
-                   H5Z_ENABLE_EDC_F
-
-

OUTPUTS

-
  hdferr       - error code            
-                  Success:  0
-                  Failure: -1   
-
-

AUTHOR

-
  Elena Pourmal
-  March 13, 2003
-
-

SOURCE

-
  SUBROUTINE h5pset_edc_check_f(prp_id, flag, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier 
-    INTEGER, INTENT(IN) :: flag          ! Checksum filter flag
-    INTEGER, INTENT(OUT) :: hdferr       ! Error code
-                                         ! 0 on success and -1 on failure
-
- -
- -

h5pset_est_link_info_f

- -

[ Top ] [ Subroutines ]

-

NAME

-
  h5pset_est_link_info_f 
-
-

PURPOSE

-
  Sets estimated number of links and length of link names in a group.
-
-

INPUTS

-
 gcpl_id         - Group creation property list identifier  
- est_num_entries - Estimated number of links to be inserted into group
- est_name_len    - Estimated average length of link names
-
-

OUTPUTS

-
  hdferr         - Error code
-                    Success:  0
-                    Failure: -1
-
-

AUTHOR

-
  M. Scot Breitenfeld
-  March 21, 2008
-
-

SOURCE

-
  SUBROUTINE h5pset_est_link_info_f(gcpl_id, est_num_entries, est_name_len, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: gcpl_id  ! Group creation property list identifier  
-    INTEGER, INTENT(IN) :: est_num_entries ! Estimated number of links to be inserted into group
-    INTEGER, INTENT(IN) :: est_name_len    ! Estimated average length of link names
-    INTEGER, INTENT(OUT) :: hdferr         ! Error code
-                                           ! 0 on success and -1 on failure
-
- -
- -

h5pset_external_f

- -

[ Top ] [ Subroutines ]

-

NAME

-
   h5pset_external_f 
-
-

PURPOSE

-
  Adds an external file to the list of external files. 
-
-

INPUTS

-
  prp_id       - dataset creation property list identifier
-  name         - name of external file
-  offset       - offset in bytes from the beginning of the 
-                 file to the location in the file
-                 where the data starts
-  bytes        - size of the external file data. 
-
-

OUTPUTS

-
  hdferr       - error code            
-                  Success:  0
-                  Failure: -1   
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999      
-
-

HISTORY

-
  Explicit Fortran interfaces were added for 
-  called C functions (it is needed for Windows
-  port).  March 14, 2001 
-
-

SOURCE

-
  SUBROUTINE h5pset_external_f(prp_id, name, offset,bytes, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: prp_id  ! Property list identifier
-    CHARACTER(LEN=*), INTENT(IN) :: name  ! Name of an external file
-    INTEGER, INTENT(IN) :: offset         ! Offset, in bytes, from the beginning 
-                                          !  of the file to the location in the file 
-                                          !  where the data starts.
-    INTEGER(HSIZE_T), INTENT(IN) :: bytes ! Number of bytes reserved in the 
-                                          !  file for the data
-    INTEGER, INTENT(OUT) :: hdferr        ! Error code
-                                          ! 0 on success and -1 on failure
-
- -
- -

h5pset_fapl_core_f

- -

[ Top ] [ Subroutines ]

-

NAME

-
   h5pset_fapl_core_f 
-
-

PURPOSE

-
  Modifies the file access property list to use the 
-  H5FD_CORE driver. 
-
-

INPUTS

-
  prp_id           - file access property list identifier
-  increment        - size, in bytes, of memory increments 
-  backing_store    - boolean flag indicating whether to write 
-                     the file contents to disk when the file is closed. 
-
-

OUTPUTS

-
  hdferr           - error code                
-                       Success:  0
-                       Failure: -1   
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999      
-
-

HISTORY

-
  Explicit Fortran interfaces were added for 
-  called C functions (it is needed for Windows
-  port).  March 14, 2001 
-               
-
-

SOURCE

-
  SUBROUTINE h5pset_fapl_core_f(prp_id, increment, backing_store, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: prp_id     ! Property list identifier 
-    INTEGER(SIZE_T), INTENT(IN) :: increment ! File block size in bytes.
-    LOGICAL, INTENT(IN) :: backing_store ! Flag to indicate that
-                                         ! entire file contents are flushed to a file 
-                                         ! with the same name as this core file.
-    INTEGER, INTENT(OUT) :: hdferr       ! Error code
-                                         ! 0 on success and -1 on failure
-
- -
- -

h5pset_fapl_direct_f

- -

[ Top ] [ Subroutines ]

-

NAME

-
  h5pset_fapl_direct_f
-
-

PURPOSE

-
  Sets up use of the direct I/O driver.
-
-

INPUTS

-
  fapl_id      - File access property list identifier
-  alignment    - Required memory alignment boundary
-  block_size   - File system block size
-  cbuf_size    - Copy buffer size
-
-

OUTPUTS

-
  hdferr       - error code            
-                  Success:  0
-                  Failure: -1   
-
-

AUTHOR

-
  M. Scot Breitenfeld
-  March 21, 2008
-
-

SOURCE

-
SUBROUTINE h5pset_fapl_direct_f(fapl_id, alignment, block_size, cbuf_size, hdferr)
-    IMPLICIT NONE  
-    INTEGER(HID_T), INTENT(IN) :: fapl_id     ! File access property list identifier
-    INTEGER(SIZE_T), INTENT(IN) :: alignment  ! Required memory alignment boundary!
-    INTEGER(SIZE_T), INTENT(IN) :: block_size ! File system block size
-    INTEGER(SIZE_T), INTENT(IN) :: cbuf_size  ! Copy buffer size
-    INTEGER, INTENT(OUT) :: hdferr            ! Error code
-                                              ! 0 on success and -1 on failure
-
- -
- -

h5pset_fapl_multi_l

- -

[ Top ] [ Subroutines ]

-

NAME

-
  h5pset_fapl_multi_l 
-
-

PURPOSE

-
  Sets up use of the multi-file driver. 
-
-

INPUTS

-
  prp_id       - file creation property list identifier
-  mem_map      - mapping array
-  memb_fapl    - property list for each memory usage type
-  memb_name    - names of member file
-  relax        - flag 
-
-

OUTPUTS

-
  hdferr       - error code            
-                  Success:  0
-                  Failure: -1   
-
-

AUTHOR

-
  Elena Pourmal
-  20 March 2003
-
-

SOURCE

-
  SUBROUTINE h5pset_fapl_multi_l(prp_id, memb_map, memb_fapl, memb_name, memb_addr, relax, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: prp_id ! File creation property list identifier 
-    INTEGER, DIMENSION(0:H5FD_MEM_NTYPES_F-1), INTENT(IN) :: memb_map ! Mapping array
-    INTEGER(HID_T), DIMENSION(0:H5FD_MEM_NTYPES_F-1), INTENT(IN) :: memb_fapl ! Property list for each memory usage type
-    CHARACTER(LEN=*), DIMENSION(0:H5FD_MEM_NTYPES_F-1), INTENT(IN) :: memb_name ! Names of member file
-    REAL, DIMENSION(0:H5FD_MEM_NTYPES_F-1), INTENT(IN) :: memb_addr 
-    LOGICAL, INTENT(IN) :: relax     ! Flag
-    INTEGER, INTENT(OUT) :: hdferr   ! Error code
-                                     ! 0 on success and -1 on failure
-
- -
- -

h5pset_fapl_multi_s

- -

[ Top ] [ Subroutines ]

-

NAME

-
  h5pset_fapl_multi_s 
-
-

PURPOSE

-
  Sets up use of the multi-file driver. 
-
-

INPUTS

-
  prp_id       - file creation property list identifier
-  relax        - flag 
-
-

OUTPUTS

-
  hdferr       - error code            
-                  Success:  0
-                  Failure: -1   
-
-

AUTHOR

-
  Elena Pourmal
-  31 March 2003
-
-

SOURCE

-
  SUBROUTINE h5pset_fapl_multi_s(prp_id, relax, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: prp_id ! File creation property list identifier 
-    LOGICAL, INTENT(IN) :: relax
-    INTEGER, INTENT(OUT) :: hdferr       ! Error code
-                                         ! 0 on success and -1 on failure
-
- -
- -

h5pset_fapl_sec2_f

- -

[ Top ] [ Subroutines ]

-

NAME

-
  h5pset_fapl_sec2_f 
-
-

PURPOSE

-
  Sets the sec2 driver. 
-
-

INPUTS

-
  prp_id  - file access property list identifier
-
-

OUTPUTS

-
  hdferr  - error code         
-             Success:  0
-             Failure: -1   
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999      
-
-

HISTORY

-
  Explicit Fortran interfaces were added for 
-  called C functions (it is needed for Windows
-  port).  March 14, 2001 
-               
-
-

SOURCE

-
  SUBROUTINE h5pset_fapl_sec2_f (prp_id, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier 
-    INTEGER, INTENT(OUT) :: hdferr       ! Error code
-                                         ! 0 on success and -1 on failure
-
- -
- -

h5pset_fapl_split_f

- -

[ Top ] [ Subroutines ]

-

NAME

-
   h5pset_fapl_split_f 
-
-

PURPOSE

-
  Emulates the old split file driver. 
-
-

INPUTS

-
  prp_id       - file access property list identifier
-  meta_ext     - name of the extension for the metafile 
-                 filename
-  meta_plist   - identifier of the meta file access property 
-                 list
-  raw_ext      - name extension for the raw file filename
-  raw_plist    - identifier of the raw file access property list
-
-

OUTPUTS

-
  hdferr       - error code            
-                   Success:  0
-                   Failure: -1   
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999      
-
-

HISTORY

-
  Explicit Fortran interfaces were added for 
-  called C functions (it is needed for Windows
-  port).  March 14, 2001 
-               
-
-

SOURCE

-
  SUBROUTINE h5pset_fapl_split_f(prp_id, meta_ext, meta_plist, raw_ext, raw_plist, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: prp_id     ! Property list identifier 
-    CHARACTER(LEN=*), INTENT(IN) :: meta_ext ! Name of the extension for
-                                             !  the metafile filename
-    INTEGER(HID_T), INTENT(IN) :: meta_plist ! Identifier of the meta file
-                                             !  access property list
-    CHARACTER(LEN=*), INTENT(IN) :: raw_ext  ! Name extension for the raw file filename
-    INTEGER(HID_T), INTENT(IN) :: raw_plist  ! Identifier of the raw file 
-                                             !  access property list
-    INTEGER, INTENT(OUT) :: hdferr           ! Error code
-                                             ! 0 on success and -1 on failure
-
- -
- -

h5pset_fapl_stdio_f

- -

[ Top ] [ Subroutines ]

-

NAME

-
  h5pset_fapl_stdio_f 
-
-

PURPOSE

-
  Sets the standard I/O driver. 
-
-

INPUTS

-
  prp_id  - file access property list identifier
-
-

OUTPUTS

-
  hdferr  - error code         
-             Success:  0
-             Failure: -1   
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999      
-
-

HISTORY

-
  Explicit Fortran interfaces were added for 
-  called C functions (it is needed for Windows
-  port).  March 14, 2001 
-               
-
-

SOURCE

-
  SUBROUTINE h5pset_fapl_stdio_f (prp_id, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier 
-    INTEGER, INTENT(OUT) :: hdferr       ! Error code
-                                         ! 0 on success and -1 on failure
-
- -
- -

h5pset_fclose_degree_f

- -

[ Top ] [ Subroutines ]

-

NAME

-
  h5pset_fclose_degree_f 
-
-

PURPOSE

-
  Sets the degree for the file close behavior.
-
-

INPUTS

-
  fapl_id      - file access property list identifier
-  degree       - Possible values are:
-                   H5F_CLOSE_DEFAULT_F
-                   H5F_CLOSE_WEAK_F
-                   H5F_CLOSE_SEMI_F
-                   H5F_CLOSE_STRONG_F
-
-

OUTPUTS

-
  hdferr       - error code            
-                  Success:  0
-                  Failure: -1   
-
-

AUTHOR

-
  Elena Pourmal
-  September 26, 2002   
-
-

SOURCE

-
  SUBROUTINE h5pset_fclose_degree_f(fapl_id, degree, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: fapl_id ! File Access Property list identifier 
-    INTEGER, INTENT(IN) :: degree         ! Possible values are: 
-                                          !  H5F_CLOSE_DEFAULT_F
-                                          !  H5F_CLOSE_WEAK_F
-                                          !  H5F_CLOSE_SEMI_F
-                                          !  H5F_CLOSE_STRONG_F
-    INTEGER, INTENT(OUT) :: hdferr        ! Error code
-                                          ! 0 on success and -1 on failure
-
- -
- -

h5pset_fill_time_f

- -

[ Top ] [ Subroutines ]

-

NAME

-
  h5pset_fill_time_f
-
-

PURPOSE

-
  Set fill value writing time for dataset
-
-

INPUTS

-
  plist_id     - dataset creation property list identifier
-  flag         - fill time flag:
-                   H5D_FILL_TIME_ERROR_F
-                   H5D_FILL_TIME_ALLOC_F
-                   H5D_FILL_TIME_NEVER_F
-
-

OUTPUTS

-
  hdferr       - error code            
-                  Success:  0
-                  Failure: -1
-
-

AUTHOR

-
  Elena Pourmal
-  October 4, 2002      
-
-

SOURCE

-
  SUBROUTINE h5pset_fill_time_f(plist_id, flag, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: plist_id  ! Dataset creation property list identifier
-    INTEGER, INTENT(IN) :: flag             ! Fill time flag:
-                                            !  H5D_FILL_TIME_ERROR_F
-                                            !  H5D_FILL_TIME_ALLOC_F
-                                            !  H5D_FILL_TIME_NEVER_F
-    INTEGER, INTENT(OUT) :: hdferr          ! Error code
-                                            ! 0 on success and -1 on failure
-
- -
- -

h5pset_filter_f

- -

[ Top ] [ Subroutines ]

-

NAME

-
  h5pset_filter_f 
-
-

PURPOSE

-
  Adds a filter to the filter pipeline. 
-
-

INPUTS

-
  prp_id       - data creation or transfer property list 
-                 identifier
-  filter       - filter to be added to the pipeline 
-  flags        - bit vector specifying certain general
-                 properties of the filter
-  cd_nelmts    - number of elements in cd_values
-  cd_values    - auxiliary data for the filter
-
-

OUTPUTS

-
  hdferr       - error code            
-                  Success:  0
-                  Failure: -1   
-
-

AUTHOR

-
  Elena Pourmal
-  February, 2003
-
-

SOURCE

-
  SUBROUTINE h5pset_filter_f(prp_id, filter, flags, cd_nelmts, cd_values,  hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier 
-    INTEGER, INTENT(IN) :: filter        ! Filter to be added to the pipeline.
-    INTEGER, INTENT(IN) :: flags         ! Bit vector specifying certain general
-                                       !  properties of the filter.
-    INTEGER(SIZE_T), INTENT(IN) :: cd_nelmts       ! Number of elements in cd_values.
-    INTEGER, DIMENSION(*), INTENT(IN) :: cd_values ! Auxiliary data for the filter.
-    INTEGER, INTENT(OUT) :: hdferr                 ! Error code
-                                                 ! 0 on success and -1 on failure
-
- -
- -

h5pset_fletcher32_f

- -

[ Top ] [ Subroutines ]

-

NAME

-
  h5pset_fletcher32_f 
-
-

PURPOSE

-
  Sets Fletcher32 checksum of EDC for a dataset creation 
-  property list.
-
-

INPUTS

-
  prp_id       - dataset creation property list identifier
-
-

OUTPUTS

-
  hdferr       - error code            
-                  Success:  0
-                  Failure: -1   
-
-

AUTHOR

-
  Elena Pourmal
-  March 13, 2003
-
-

SOURCE

-
  SUBROUTINE h5pset_fletcher32_f(prp_id, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier 
-    INTEGER, INTENT(OUT) :: hdferr       ! Error code
-                                         ! 0 on success and -1 on failure
-
- -
- -

h5pset_gc_references_f

- -

[ Top ] [ Subroutines ]

-

NAME

-
   h5pset_gc_references_f 
-
-

PURPOSE

-
  Sets garbage collecting references flag. 
-
-

INPUTS

-
  prp_id       - file access property list identifier
-  gc_reference - flag for stting garbage collection on 
-                 and off (1 or 0)
-
-

OUTPUTS

-
  hdferr       - error code            
-                  Success:  0
-                  Failure: -1   
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999      
-
-

HISTORY

-
  Explicit Fortran interfaces were added for 
-  called C functions (it is needed for Windows
-  port).  March 14, 2001 
-               
-
-

SOURCE

-
  SUBROUTINE h5pset_gc_references_f (prp_id, gc_reference, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier 
-    INTEGER, INTENT(IN) :: gc_reference  ! The flag for garbage collecting
-                                         !  references for the file
-    INTEGER, INTENT(OUT) :: hdferr       ! Error code
-                                         ! 0 on success and -1 on failure
-
- -
- -

h5pset_hyper_vector_size_f

- -

[ Top ] [ Subroutines ]

-

NAME

-
  h5pset_hyper_vector_size_f 
-
-

PURPOSE

-
  Set the number of "I/O" vectors (vector size)
-
-

INPUTS

-
  plist_id     - dataset transfer property list identifier
-  size         - vector size
-
-

OUTPUTS

-
  hdferr       - error code            
-                  Success:  0
-                  Failure: -1
-
-

AUTHOR

-
  Elena Pourmal
-  October 7, 2002      
-
-

SOURCE

-
  SUBROUTINE h5pset_hyper_vector_size_f(plist_id, size, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: plist_id ! Dataset transfer property list identifier 
-    INTEGER(SIZE_T), INTENT(IN) :: size    ! Vector size
-    INTEGER, INTENT(OUT) :: hdferr         ! Error code
-                                           ! 0 on success and -1 on failure
-
- -
- -

h5pset_istore_k_f

- -

[ Top ] [ Subroutines ]

-

NAME

-
  h5pset_istore_k_f 
-
-

PURPOSE

-
  Sets the size of the parameter used to control the 
-  B-trees for indexing chunked datasets
-
-

INPUTS

-
  prp_id       - file creation property list identifier
-  ik           - 1/2 rank of chunked storage B-tree
-
-

OUTPUTS

-
  hdferr       - error code            
-                  Success:  0
-                  Failure: -1   
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999      
-
-

HISTORY

-
  Explicit Fortran interfaces were added for 
-  called C functions (it is needed for Windows
-  port).  March 14, 2001 
-               
-
-

SOURCE

-
  SUBROUTINE h5pset_istore_k_f (prp_id, ik, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier 
-    INTEGER, INTENT(IN) :: ik            ! 1/2 rank of chunked storage B-tree
-    INTEGER, INTENT(OUT) :: hdferr       ! Error code
-                                         ! 0 on success and -1 on failure
-
- -
- -

h5pset_layout_f

- -

[ Top ] [ Subroutines ]

-

NAME

-
   h5pset_layout_f 
-
-

PURPOSE

-
  Sets the type of storage used store the raw data 
-  for a dataset. 
-
-

INPUTS

-
  prp_id       - data creation property list identifier
-  layout       - type of storage layout for raw data
-                 possible values are:
-                   H5D_COMPACT_F
-                   H5D_CONTIGUOUS_F
-                   H5D_CHUNKED_F
-
-

OUTPUTS

-
  hdferr      - error code             
-                 Success:  0
-                 Failure: -1   
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999      
-
-

HISTORY

-
  Explicit Fortran interfaces were added for 
-  called C functions (it is needed for Windows
-  port).  March 14, 2001 
-
-

SOURCE

-
  SUBROUTINE h5pset_layout_f (prp_id, layout, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier 
-    INTEGER, INTENT(IN) :: layout        ! Type of storage layout for raw data
-                                         ! possible values are:
-                                         !   H5D_COMPACT_F
-                                         !   H5D_CONTIGUOUS_F
-                                         !   H5D_CHUNKED_F
-    INTEGER, INTENT(OUT) :: hdferr       ! Error code
-                                         ! 0 on success and -1 on failure
-
- -
- -

H5Pset_libver_bounds_f

- -

[ Top ] [ Subroutines ]

-

NAME

-
             H5Pset_libver_bounds_f
-
-

PURPOSE

-
    Sets bounds on library versions, and indirectly format versions, to be used when creating objects.
-
-

INPUTS

-
  fapl_id - File access property list identifier
-  low     - The earliest version of the library that will be used for writing objects.
-  high    - The latest version of the library that will be used for writing objects.
-
-

OUTPUTS

-
  hdferr  - error code         
-             Success:  0
-             Failure: -1   
-
-

AUTHOR

-
  M. Scot Breitenfeld
-  February 18, 2008
-
-

SOURCE

-
  SUBROUTINE h5pset_libver_bounds_f(fapl_id, low, high, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: fapl_id ! File access property list identifier
-    INTEGER, INTENT(IN) :: low   ! The earliest version of the library that will be used for writing objects.
-                                 ! Currently, low must be one of two pre-defined values:
-                                 !            HDF_LIBVER_EARLIEST_F
-                                 !            HDF_LIBVER_LATEST_F
-    INTEGER, INTENT(IN) :: high  ! The latest version of the library that will be used for writing objects.
-                                 ! Currently, low must set to the pre-defined value:
-                                 !            HDF_LIBVER_LATEST_F
-    INTEGER, INTENT(OUT) :: hdferr  ! Error code
-                                    ! 0 on success and -1 on failure
-
- -
- -

H5Pset_link_creation_order_f

- -

[ Top ] [ Subroutines ]

-

NAME

-
  H5Pset_link_creation_order_f 
-
-

PURPOSE

-
    Sets creation order tracking and indexing for links in a group.
-
-

INPUTS

-
  gcpl_id         - Group creation property list identifier
-  crt_order_flags - Creation order flag(s)
-
-

OUTPUTS

-
  hdferr           - Error code                
-                       Success:  0
-                       Failure: -1   
-
-

AUTHOR

-
  M. Scot Breitenfeld
-  February 18, 2008
-
-

SOURCE

-
  SUBROUTINE h5pset_link_creation_order_f(gcpl_id, crt_order_flags, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: gcpl_id  ! File access property list identifier
-    INTEGER, INTENT(IN) :: crt_order_flags ! Creation order flag(s)
-    INTEGER, INTENT(OUT) :: hdferr   ! Error code
-                                     ! 0 on success and -1 on failure
-
- -
- -

h5pset_link_phase_change_f

- -

[ Top ] [ Subroutines ]

-

NAME

-
  h5pset_link_phase_change_f
-
-

PURPOSE

-
  Sets the parameters for conversion between compact and dense groups.
-
-

INPUTS

-
  gcpl_id         - Group creation property list identifier  
-  max_compact     - Maximum number of attributes to be stored in compact storage
-  min_dense       - Minimum number of attributes to be stored in dense storage
-
-

OUTPUTS

-
  hdferr          - error code         
-                     Success:  0
-                     Failure: -1   
-
-

AUTHOR

-
  M. Scot Breitenfeld
-  March 21, 2008
-
-

SOURCE

-
SUBROUTINE h5pset_link_phase_change_f(gcpl_id, max_compact, min_dense, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: gcpl_id ! Group creation property list identifier
-    INTEGER, INTENT(IN) :: max_compact    ! Maximum number of attributes to be stored in compact storage
-    INTEGER, INTENT(IN) :: min_dense      ! Minimum number of attributes to be stored in dense storage
-    INTEGER, INTENT(OUT) :: hdferr        ! Error code
-                                          ! 0 on success and -1 on failure
-
- -
- -

H5Pset_local_heap_size_hint_f

- -

[ Top ] [ Subroutines ]

-

NAME

-
  H5Pset_local_heap_size_hint_f 
-
-

PURPOSE

-
  Sets the local heap size hint for original-style groups.
-
-

INPUTS

-
  gcpl_id   - Group creation property list identifier
-  size_hint - Hint for size of local heap
-
-

OUTPUTS

-
  hdferr    - Error code
-               Success:  0
-               Failure: -1
-
-

AUTHOR

-
  M. Scot Breitenfeld
-  March 21, 2008
-
-

SOURCE

-
  SUBROUTINE h5pset_local_heap_size_hint_f(gcpl_id, size_hint, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: gcpl_id    ! Group creation property list identifier
-    INTEGER(SIZE_T), INTENT(IN) :: size_hint ! Hint for size of local heap
-    INTEGER, INTENT(OUT) :: hdferr           ! Error code
-                                             ! 0 on success and -1 on failure
-
- -
- -

H5Pset_nbit_f

- -

[ Top ] [ Subroutines ]

-

NAME

-
  H5Pset_nbit_f 
-
-

PURPOSE

-
  Sets up the use of the N-Bit filter.
-
-

INPUTS

-
  plist_id - Dataset creation property list identifier.
-
-

OUTPUTS

-
  hdferr   - Error code
-              Success:  0
-              Failure: -1
-
-

AUTHOR

-
  M. Scot Breitenfeld
-  March 21, 2008
-
-

HISTORY

-

SOURCE

-
  SUBROUTINE h5pset_nbit_f(plist_id, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: plist_id ! Dataset creation property list identifier
-    INTEGER, INTENT(OUT) :: hdferr         ! Error code
-                                           ! 0 on success and -1 on failure
-
- -
- -

h5pset_nlinks_f

- -

[ Top ] [ Subroutines ]

-

NAME

-
  h5pset_nlinks_f 
-
-

PURPOSE

-
  Sets maximum number of soft or user-defined link traversals.
-
-

INPUTS

-
  lapl_id - File access property list identifier
-   nlinks - Maximum number of links to traverse
-
-

OUTPUTS

-
  hdferr  - Error code
-             Success:  0
-             Failure: -1
-
-

AUTHOR

-
  M. Scot Breitenfeld
-  March 24, 2008
-
-

HISTORY

-

SOURCE

-
  SUBROUTINE h5pset_nlinks_f(lapl_id, nlinks, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: lapl_id ! File access property list identifier
-    INTEGER(SIZE_T), INTENT(IN) :: nlinks ! Maximum number of links to traverse
-    INTEGER, INTENT(OUT) :: hdferr        ! Error code   
-                                          ! 0 on success and -1 on failure
-
- -
- -

H5Pset_obj_track_times_f

- -

[ Top ] [ Subroutines ]

-

NAME

-
  H5Pset_obj_track_times_f 
-
-

PURPOSE

-
  Set whether the birth, access, modification & change times for
-  an object are stored.
-
-  Birth time is the time the object was created.  Access time is
-  the last time that metadata or raw data was read from this
-  object.  Modification time is the last time the data for
-  this object was changed (either writing raw data to a dataset
-  or inserting/modifying/deleting a link in a group).  Change
-  time is the last time the metadata for this object was written
-  (adding/modifying/deleting an attribute on an object, extending
-  the size of a dataset, etc).
-
-   If these times are not tracked, they will be reported as
-   12:00 AM UDT, Jan. 1, 1970 (i.e. 0 seconds past the UNIX
-   epoch) when queried.
-
-

INPUTS

-
  plist_id     - property list id
-  flag         - object timestamp setting
-                 .TRUE.,.FALSE.
-
-

OUTPUTS

-
  hdferr       - error code            
-                  Success:  0
-                  Failure: -1   
-
-

AUTHOR

-
  M. Scot Breitenfeld
-  February 22, 2008
-       
-
-

SOURCE

-
  SUBROUTINE h5pset_obj_track_times_f(plist_id, flag, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: plist_id ! Dataset creation property
-                                           ! list identifier
-    LOGICAL, INTENT(IN) :: flag    ! Object timestamp setting
-    INTEGER, INTENT(OUT) :: hdferr ! Error code
-                                   ! 0 on success and -1 on failure
-
- -
- -

h5pset_preserve_f

- -

[ Top ] [ Subroutines ]

-

NAME

-
   h5pset_preserve_f 
-
-

PURPOSE

-
  Sets the dataset transfer property list status to 
-  TRUE or FALSE for initializing compound datatype
-  members during write/read operations.
-
-

INPUTS

-
  prp_id       - property list identifier
-  flag         - status flag
-
-

OUTPUTS

-
  hdferr       - Returns 0 if successful and -1 if fails
-
-

OPTIONAL PARAMETERS

-
  NONE
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999      
-
-

HISTORY

-
  Explicit Fortran interfaces were added for 
-  called C functions (it is needed for Windows
-  port).  March 14, 2001 
-                       
-  Datatype of the flag parameter is changed from 
-  INTEGER to LOGICAL June 4, 2003
-
-

SOURCE

-
  SUBROUTINE h5pset_preserve_f(prp_id, flag, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier 
-    LOGICAL, INTENT(IN) ::  flag         ! TRUE/FALSE flag to set the dataset
-                                         ! transfer property for partila writing/reading
-                                         ! compound datatype
-    INTEGER, INTENT(OUT) :: hdferr       ! Error code
-                                         ! 0 on success and -1 on failure
-
- -
- -

h5pset_scaleoffset_f

- -

[ Top ] [ Subroutines ]

-

NAME

-
  h5pset_scaleoffset_f 
-
-

PURPOSE

-
  Sets up the use of the Scale-Offset filter.
-
-

INPUTS

-
  plist_id     - Dataset creation property list identifier.
-  scale_type   - Flag indicating compression method.
-  scale_factor - Parameter related to scale.
-
-

OUTPUTS

-
  hdferr        - Error code
-                   Success:  0
-                   Failure: -1
-
-

AUTHOR

-
  M. Scot Breitenfeld
-  March 21, 2008
-
-

HISTORY

-

SOURCE

-
  SUBROUTINE h5pset_scaleoffset_f(plist_id, scale_type, scale_factor, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: plist_id ! Dataset creation property list identifier
-    INTEGER, INTENT(IN) :: scale_type      ! Flag indicating compression method.
-    INTEGER, INTENT(IN) :: scale_factor    ! Parameter related to scale.
-    INTEGER, INTENT(OUT) :: hdferr         ! Error code
-                                           ! 0 on success and -1 on failure
-
- -
- -

H5Pset_shared_mesg_index_f

- -

[ Top ] [ Subroutines ]

-

NAME

-
  H5Pset_shared_mesg_index_f
-
-

PURPOSE

-
  Configures the specified shared object header message index
-
-

INPUTS

-
  fcpl_id         - File creation property list identifier.
-  index_num       - Index being configured.
-  mesg_type_flags - Types of messages that should be stored in this index.
-  min_mesg_size   - Minimum message size.
-
-

OUTPUTS

-
  hdferr  - error code         
-             Success:  0
-             Failure: -1   
-
-

AUTHOR

-
  M. Scot Breitenfeld
-  January, 2008
-
-

SOURCE

-
  SUBROUTINE h5pset_shared_mesg_index_f(fcpl_id, index_num, mesg_type_flags, min_mesg_size, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: fcpl_id  ! file creation property list
-    INTEGER, INTENT(IN) :: index_num       ! Index being configured.
-    INTEGER, INTENT(IN) :: mesg_type_flags ! Types of messages that should be stored in this index.
-    INTEGER, INTENT(IN) :: min_mesg_size   ! Minimum message size.
-    INTEGER, INTENT(OUT) :: hdferr         ! Error code
-                                           ! 0 on success and -1 on failure
-
- -
- -

H5Pset_shared_mesg_nindexes_f

- -

[ Top ] [ Subroutines ]

-

NAME

-
  H5Pset_shared_mesg_nindexes_f 
-
-

PURPOSE

-
  Sets number of shared object header message indexes 
-
-

INPUTS

-
  plist_id - file creation property list
-  nindexes - Number of shared object header message indexes to be available in files created with this property list
-
-

OUTPUTS

-
  hdferr  - error code         
-             Success:  0
-             Failure: -1   
-
-

AUTHOR

-
  M. Scot Breitenfeld
-  January, 2008
-
-

SOURCE

-
  SUBROUTINE h5pset_shared_mesg_nindexes_f( plist_id, nindexes, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: plist_id ! File creation property list
-    INTEGER, INTENT(IN) :: nindexes  ! Number of shared object header message indexes 
-                                     !  available in files created WITH this property list
-    INTEGER, INTENT(OUT) :: hdferr   ! Error code
-                                     ! 0 on success and -1 on failure
-
- -
- -

h5pset_shuffle_f

- -

[ Top ] [ Subroutines ]

-

NAME

-
  h5pset_shuffle_f 
-
-

PURPOSE

-
  Sets shuffling filter
-
-

INPUTS

-
  prp_id       - dataset creation property list identifier
-
-

OUTPUTS

-
  hdferr       - error code            
-                  Success:  0
-                  Failure: -1   
-
-

AUTHOR

-
  Elena Pourmal
-  March 12, 2003
-
-

SOURCE

-
  SUBROUTINE h5pset_shuffle_f(prp_id, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier 
-    INTEGER, INTENT(OUT) :: hdferr       ! Error code
-                                         ! 0 on success and -1 on failure
-
- -
- -

h5pset_sieve_buf_size_f

- -

[ Top ] [ Subroutines ]

-

NAME

-
  h5pset_sieve_buf_size_f 
-
-

PURPOSE

-
  Sets the maximum size of the data sieve buffer
-
-

INPUTS

-
  plist_id     - file access property list identifier
-  size         - sieve buffer size
-
-

OUTPUTS

-
  hdferr       - error code            
-                  Success:  0
-                  Failure: -1
-
-

AUTHOR

-
  Elena Pourmal
-  October 7, 2002      
-
-

SOURCE

-
  SUBROUTINE h5pset_sieve_buf_size_f(plist_id, size, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: plist_id ! File access property list identifier 
-    INTEGER(SIZE_T), INTENT(IN) :: size    ! Buffer size in bytes; 
-    INTEGER, INTENT(OUT) :: hdferr         ! Error code
-                                           ! 0 on success and -1 on failure
-
- -
- -

h5pset_sizes_f

- -

[ Top ] [ Subroutines ]

-

NAME

-
  h5pset_sizes_f 
-
-

PURPOSE

-
  Sets the byte size of the offsets and lengths used 
-  to address objects in an HDF5 file.
-
-

INPUTS

-
  prp_id       - file creation property list identifier
-  sizeof_addr  - size of an object offset in bytes 
-  sizeof_size  - size of an object length in bytes
-
-

OUTPUTS

-
  hdferr       - error code            
-                  Success:  0
-                  Failure: -1   
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999      
-
-

HISTORY

-
  Explicit Fortran interfaces were added for 
-  called C functions (it is needed for Windows
-  port).  March 14, 2001 
-               
-
-

SOURCE

-
  SUBROUTINE h5pset_sizes_f (prp_id, sizeof_addr, sizeof_size, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: prp_id       ! Property list identifier 
-    INTEGER(SIZE_T), INTENT(IN) :: sizeof_addr ! Size of an object 
-                                               !  offset in bytes 
-    INTEGER(SIZE_T), INTENT(IN) :: sizeof_size ! Size of an object 
-                                               !  length in bytes 
-    INTEGER, INTENT(OUT) :: hdferr             ! Error code
-                                               ! 0 on success and -1 on failure
-
- -
- -

h5pset_small_data_block_size_f

- -

[ Top ] [ Subroutines ]

-

NAME

-
  h5pset_small_data_block_size_f 
-
-

PURPOSE

-
  Sets the minimum size of "small" raw data block
-
-

INPUTS

-
  plist_id     - file access property list identifier
-  size         - small raw data block size
-
-

OUTPUTS

-
  hdferr       - error code            
-                  Success:  0
-                  Failure: -1
-
-

AUTHOR

-
  Elena Pourmal
-  October 7, 2002      
-
-

SOURCE

-
  SUBROUTINE h5pset_small_data_block_size_f(plist_id, size, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: plist_id ! File access property list identifier 
-    INTEGER(HSIZE_T), INTENT(IN) :: size   ! Small raw data block size
-    INTEGER, INTENT(OUT) :: hdferr         ! Error code
-                                           ! 0 on success and -1 on failure
-
- -
- -

h5pset_sym_k_f

- -

[ Top ] [ Subroutines ]

-

NAME

-
  h5pset_sym_k_f 
-
-

PURPOSE

-
  Sets the size of parameters used to control the 
-
-

INPUTS

-
  prp_id  - file creation property list identifier
-  ik      - symbol table tree rank
-  lk      - symbol table node size
-
-

OUTPUTS

-
  hdferr  - error code         
-             Success:  0
-             Failure: -1   
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999      
-
-

HISTORY

-
  Explicit Fortran interfaces were added for 
-  called C functions (it is needed for Windows
-  port).  March 14, 2001 
-               
-
-

SOURCE

-
  SUBROUTINE h5pset_sym_k_f (prp_id, ik, lk, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier 
-    INTEGER, INTENT(IN) :: ik            ! Symbol table tree rank 
-    INTEGER, INTENT(IN) :: lk            ! Symbol table node size 
-    INTEGER, INTENT(OUT) :: hdferr       ! Error code
-                                         ! 0 on success and -1 on failure
-
- -
- -

h5pset_szip_f

- -

[ Top ] [ Subroutines ]

-

NAME

-
  h5pset_szip_f 
-
-

PURPOSE

-
  Sets up use of szip compression
-
-

INPUTS

-
  prp_id           - dataset creation property list identifier
-  options_mask     - A bit-mask conveying the desired SZIP options.
-                     Current valid values in Fortran are:
-                        H5_SZIP_EC_OM_F
-                        H5_SZIP_NN_OM_F
-  pixels_per_block - szip parameters
-
-

OUTPUTS

-
  hdferr           - error code                
-                       Success:  0
-                       Failure: -1   
-
-

AUTHOR

-
  Elena Pourmal
-  April 10 2003
-
-

SOURCE

-
  SUBROUTINE h5pset_szip_f(prp_id, options_mask, pixels_per_block, hdferr) 
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: prp_id ! Dataset creation property 
-                                         ! list identifier 
-    INTEGER, INTENT(IN) :: options_mask  ! A bit-mask conveying the desired
-                                         ! SZIP options
-                                         ! Current valid values in Fortran are:
-                                         !    H5_SZIP_EC_OM_F
-                                         !    H5_SZIP_NN_OM_F
-    INTEGER, INTENT(IN) :: pixels_per_block ! The number of pixels or data elements 
-                                            ! in each data block
-    INTEGER, INTENT(OUT) :: hdferr       ! Error code
-                                         ! 0 on success and -1 on failure
-
- -
- -

h5pset_userblock_f

- -

[ Top ] [ Subroutines ]

-

NAME

-
  h5pset_userblock_f 
-
-

PURPOSE

-
   Sets user block size
-
-

INPUTS

-
   prp_id - file creation property list to modify
-   size   - size of the user-block in bytes
-
-

OUTPUTS

-
  hdferr  - error code         
-             Success:  0
-             Failure: -1   
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999      
-
-

HISTORY

-
  Explicit Fortran interfaces were added for 
-  called C functions (it is needed for Windows
-  port).  March 14, 2001 
-
-

SOURCE

-
  SUBROUTINE h5pset_userblock_f (prp_id, size, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier 
-    INTEGER(HSIZE_T), INTENT(IN) :: size ! Size of the user-block in bytes 
-    INTEGER, INTENT(OUT) :: hdferr       ! Error code
-                                         ! 0 on success and -1 on failure
-
- -
- -

h5punregister_f

- -

[ Top ] [ Subroutines ]

-

NAME

-
  h5punregister_f 
-
-

PURPOSE

-
  Removes a property from a property list class. 
-
-

INPUTS

-
  class        - Property list class identifier
-  name         - name of the property to remove
-
-

OUTPUTS

-
  hdferr:      - error code
-                  Success: 0 
-                  Failure: -1   
-
-

AUTHOR

-
  Elena Pourmal
-  October 9, 2002      
-
-

SOURCE

-
  SUBROUTINE h5punregister_f(class, name, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: class  ! property list class identifier
-    CHARACTER(LEN=*), INTENT(IN) :: name ! name of property to remove
-    INTEGER, INTENT(OUT) :: hdferr       ! Error code
-                                         ! 0 on success and -1 on failure
-
- -
- - - diff --git a/fortran/doc/DevelGuide/src/H5Rf_c.html b/fortran/doc/DevelGuide/src/H5Rf_c.html deleted file mode 100644 index bba197e..0000000 --- a/fortran/doc/DevelGuide/src/H5Rf_c.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - -./src/H5Rf.c - - - - - -
-
- -

H5Rf

- -

[ Top ] [ Modules ]

-

PURPOSE

-
   This file contains C stubs for H5R Fortran APIs
-
- -
- - - diff --git a/fortran/doc/DevelGuide/src/H5Rff_F03_f90.html b/fortran/doc/DevelGuide/src/H5Rff_F03_f90.html deleted file mode 100644 index 3202540..0000000 --- a/fortran/doc/DevelGuide/src/H5Rff_F03_f90.html +++ /dev/null @@ -1,492 +0,0 @@ - - - - - - - -./src/H5Rff_F03.f90 - - - - - -
-
- -

H5R (F03)

- -

[ Top ] [ Modules ]

-

NAME

-
  MODULE H5R_PROVISIONAL
-
-

FILE

-
  fortran/src/H5Rff_F03.f90
-
-

PURPOSE

-
  This file contains Fortran 90 and Fortran 2003 interfaces for H5R functions.
-  It contains the same functions as H5Rff_DEPRECIATE.f90 but includes the
-  Fortran 2003 functions and the interface listings. This file will be compiled
-  instead of H5Rff_DEPRECIATE.f90 if Fortran 2003 functions are enabled.
-
-

NOTES

-
                         *** IMPORTANT ***
-  If you add a new H5R function you must add the function name to the
-  Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory.
-  This is needed for Windows based operating systems.
-
- -
- -

h5rcreate_object_f

- -

[ Top ] [ H5R (F03) ] [ Subroutines ]

-

NAME

-
  h5rcreate_object_f
-
-

PURPOSE

-
  Creates reference to the object
-
-

INPUTS

-
  loc_id    - location identifier
-  name      - name of the object at the specified location
-
-

OUTPUTS

-
  ref       - reference to the specified object
-  hdferr:   - error code
-               Success:  0
-               Failure: -1
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces were added for
-  called C functions (it is needed for Windows
-  port).  February 28, 2001
-
-

NOTES

-
  This is a module procedure for the h5rcreate_f subroutine.
-
-

SOURCE

-
  SUBROUTINE h5rcreate_object_f(loc_id, name, ref, hdferr)
-    USE, INTRINSIC :: ISO_C_BINDING
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: loc_id   ! Location identifier
-    CHARACTER(LEN=*), INTENT(IN) :: name   ! Name of the object at location specified
-                                           ! by loc_id identifier
-    TYPE(hobj_ref_t_f), INTENT(INOUT), TARGET :: ref   ! Object reference
-    INTEGER, INTENT(OUT) :: hdferr         ! Error code
-
- -
- -

h5rcreate_ptr_f

- -

[ Top ] [ H5R (F03) ] [ Subroutines ]

-

NAME

-
  h5rcreate_ptr_f
-
-

PURPOSE

-
  Creates a reference.
-
-

INPUTS

-
  loc_id     - location identifier
-  name       - name of the dataset at the specified location
-  ref_type   - type of reference:
-                H5R_OBJECT
-                H5T_STD_REF_DSETREG
-
-

OUTPUTS

-
  ref        - reference created by the function call.
-  hdferr     - error code
-                  Success:  0
-                  Failure: -1
- OPTIONAL
-  space_id   - dataspace identifier that describes selected region
-
-

AUTHOR

-
  M. Scot Breitenfeld
-  June 20, 2008
-
-

NOTES

-
  This is a module procedure for the h5rcreate_f
-  subroutine where the output is a pointer.
-
-

SOURCE

-
  SUBROUTINE h5rcreate_ptr_f(loc_id, name, ref_type, ref, hdferr, space_id)
-    USE, INTRINSIC :: ISO_C_BINDING
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: loc_id     ! Location identifier
-    CHARACTER(LEN=*), INTENT(IN) :: name     ! Name of the dataset at location specified
-                                             ! by loc_id identifier
-    INTEGER, INTENT(IN) :: ref_type          ! type of reference
-    TYPE(C_PTR), INTENT(INOUT) :: ref        ! Reference created by the function call
-    INTEGER, INTENT(OUT) :: hdferr           ! Error code
-    INTEGER(HID_T), INTENT(IN), OPTIONAL :: space_id ! Dataset's dataspace identifier
-
- -
- -

h5rcreate_region_f

- -

[ Top ] [ H5R (F03) ] [ Subroutines ]

-

NAME

-
  h5rcreate_region_f
-
-

PURPOSE

-
  Creates reference to the dataset region
-
-

INPUTS

-
  loc_id        - location identifier
-  name          - name of the dataset at the specified location
-  space_id      - dataspace identifier that describes selected region
-
-

OUTPUTS

-
  ref           - reference to the dataset region
-  hdferr:       - error code
-                   Success:  0
-                   Failure: -1
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces were added for
-  called C functions (it is needed for Windows
-  port).  February 28, 2001
-
-

NOTES

-
  This is a module procedure for the h5rcreate_f subroutine.
-
-

SOURCE

-
  SUBROUTINE h5rcreate_region_f(loc_id, name, space_id, ref, hdferr)
-    USE, INTRINSIC :: ISO_C_BINDING
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: loc_id   ! Location identifier
-    CHARACTER(LEN=*), INTENT(IN) :: name   ! Name of the dataset at location specified
-                                           ! by loc_id identifier
-    INTEGER(HID_T), INTENT(IN) :: space_id ! Dataset's dataspace identifier
-    TYPE(hdset_reg_ref_t_f), INTENT(INOUT), TARGET :: ref ! Dataset region reference
-    INTEGER, INTENT(OUT) :: hdferr         ! Error code
-
- -
- -

h5rdereference_object_f

- -

[ Top ] [ H5R (F03) ] [ Subroutines ]

-

NAME

-
  h5rdereference_object_f
-
-

PURPOSE

-
  Opens the HDF5 object referenced
-
-

INPUTS

-
  dset_id  - identifier of the dataset containing
-             reference
-  ref      - reference to open
-
-

OUTPUTS

-
  obj_id   - object_identifier
-  hdferr:  - error code
-              Success:  0
-              Failure: -1
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces were added for
-  called C functions (it is needed for Windows
-  port).  February 28, 2001
-
-

NOTES

-
  This is a module procedure for the h5rdereference_f subroutine.
-
-

SOURCE

-
  SUBROUTINE h5rdereference_object_f(obj_id, ref, ref_obj_id, hdferr)
-    USE, INTRINSIC :: ISO_C_BINDING
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: obj_id          ! Dataset identifier
-    TYPE(hobj_ref_t_f), INTENT(IN), TARGET :: ref ! Object reference
-    INTEGER(HID_T), INTENT(OUT) :: ref_obj_id     ! Object identifier
-    INTEGER, INTENT(OUT) :: hdferr                ! Error code
-
- -
- -

h5rdereference_ptr_f

- -

[ Top ] [ H5R (F03) ] [ Subroutines ]

-

NAME

-
  h5rdereference_ptr_f
-
-

PURPOSE

-
  Opens the HDF5 object referenced.
-
-

INPUTS

-
  obj_id     - valid identifier for the file containing the
-               referenced object or any object in that file.
-  ref_type   - the reference type of ref.
-  ref        - Reference to open.
-
-

OUTPUTS

-
  ref_obj_id - identifier of referenced object
-  hdferr     - error code
-                Success:  0
-                Failure: -1
-
-

AUTHOR

-
  M. Scot Breitenfeld
-  June 20, 2008
-
-

NOTES

-
  This is a module procedure for the h5rdereference_f
-  subroutine using pointers.
-
-

SOURCE

-
  SUBROUTINE h5rdereference_ptr_f(obj_id, ref_type, ref, ref_obj_id, hdferr)
-    USE, INTRINSIC :: ISO_C_BINDING
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: obj_id  ! Valid identifier for the file containing the
-                                          !  referenced object or any object in that file.
-    INTEGER, INTENT(IN) :: ref_type       ! The reference type of ref.
-    TYPE(C_PTR), INTENT(IN) :: ref        ! Object reference
-    INTEGER(HID_T), INTENT(OUT) :: ref_obj_id
-                                          ! Identifier of referenced object
-    INTEGER, INTENT(OUT) :: hdferr        ! Error code
-
- -
- -

h5rdereference_region_f

- -

[ Top ] [ H5R (F03) ] [ Subroutines ]

-

NAME

-
  h5rdereference_region_f
-
-

PURPOSE

-
  Opens the dataset region
-
-

INPUTS

-
  dset_id       - identifier of the dataset containing
-                  reference to teh regions
-  ref           - reference to open
-
-

OUTPUTS

-
  obj_id        - dataspace identifier
-  hdferr:       - error code
-                   Success:  0
-                   Failure: -1
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces were added for
-  called C functions (it is needed for Windows
-  port).  February 28, 2001
-
-

NOTES

-
  This is a module procedure for the h5rdereference_f subroutine.
-
-

SOURCE

-
  SUBROUTINE h5rdereference_region_f(obj_id, ref, ref_obj_id, hdferr)
-    USE, INTRINSIC :: ISO_C_BINDING
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: obj_id   ! Dataset identifier
-    TYPE(hdset_reg_ref_t_f), INTENT(IN), TARGET :: ref   ! Object reference
-    INTEGER(HID_T), INTENT(OUT) :: ref_obj_id  ! Dataspace identifier
-    INTEGER, INTENT(OUT) :: hdferr          ! Error code
-
- -
- -

h5rget_name_object_f

- -

[ Top ] [ H5R (F03) ] [ Subroutines ]

-

NAME

-
  h5rget_name_object_f
-
-

PURPOSE

-
  Retrieves a name of a referenced object.
-
-

INPUTS

-
  loc_id    - Identifier for the dataset containing the reference or for the group that dataset is in.
-  ref       - An object or dataset region reference.
-
-

OUTPUTS

-
  name      - A name associated with the referenced object or dataset region.
-
-  hdferr:   - error code
-               Success:  0
-               Failure: -1
-
-

OPTIONAL PARAMETERS

-
  size     - The size of the name buffer.
-
-

AUTHOR

-
  M. Scot Breitenfeld
-  March 28, 2008
-
- SOURCES
- or for the group that dataset is in.
- returning 0 (zero) if no name is associated
- with the identifier
-
- -
- -

h5rget_name_ptr_f

- -

[ Top ] [ H5R (F03) ] [ Subroutines ]

-

NAME

-
  h5rget_name_ptr_f
-
-

PURPOSE

-
  Retrieves a name of a referenced object.
-
-

INPUTS

-
  loc_id   - Identifier for the dataset containing the reference or
-             for the group that dataset is in.
-  ref_type - Type of reference.
-  ref      - An object or dataset region reference.
-
-

OUTPUTS

-
  name     - A name associated with the referenced object or dataset ptr.
-
-  hdferr   - error code
-               Success:  0
-               Failure: -1
-
-

OPTIONAL PARAMETERS

-
   size   - The size of the name buffer.
-
-

AUTHOR

-
  M. Scot Breitenfeld
-  March 28, 2008
-
-

SOURCE

-
  SUBROUTINE h5rget_name_ptr_f(loc_id, ref_type, ref, name, hdferr, size)
-    USE, INTRINSIC :: ISO_C_BINDING
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: loc_id   ! Identifier for the dataset containing the reference
-                                           !  or for the group that dataset is in.
-    INTEGER, INTENT(IN) :: ref_type ! Type of reference.
-    TYPE(C_PTR), INTENT(IN) :: ref  ! An object or dataset region reference.
-    CHARACTER(LEN=*), INTENT(OUT) :: name  ! A name associated with the referenced object or dataset ptr.
-    INTEGER, INTENT(OUT) :: hdferr         ! Error code
-    INTEGER(SIZE_T), OPTIONAL, INTENT(OUT) :: size   ! The size of the name buffer,
-                                                     ! returning 0 (zero) if no name is associated
-                                                     ! with the identifier
-
- -
- -

h5rget_name_region_f

- -

[ Top ] [ H5R (F03) ] [ Subroutines ]

-

NAME

-
  h5rget_name_region_f
-
-

PURPOSE

-
  Retrieves a name of a dataset region.
-
-

INPUTS

-
  loc_id  - Identifier for the dataset containing the reference or
-            for the group that dataset is in.
-  ref     - An object or dataset region reference.
-
-

OUTPUTS

-
  name    - A name associated with the referenced object or dataset region.
-  hdferr  - error code
-              Success:  0
-              Failure: -1
-
-

OPTIONAL PARAMETERS

-
  size    - The size of the name buffer.
-
-

AUTHOR

-
  M. Scot Breitenfeld
-  March 28, 2008
-
-

SOURCE

-
  SUBROUTINE h5rget_name_region_f(loc_id, ref, name, hdferr, size)
-    USE, INTRINSIC :: ISO_C_BINDING
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: loc_id   ! Identifier for the dataset containing the reference
-                                           ! or for the group that dataset is in.
-    TYPE(hdset_reg_ref_t_f), INTENT(IN), TARGET :: ref ! Object reference
-    INTEGER(SIZE_T), OPTIONAL, INTENT(OUT) :: size     ! The size of the name buffer,
-                                                       ! returning 0 (zero) if no name is associated with the identifier
-    CHARACTER(LEN=*), INTENT(OUT) :: name  ! A name associated with the referenced object or dataset region.
-    INTEGER, INTENT(OUT) :: hdferr         ! Error code
-
- -
- -

h5rget_obj_type_f

- -

[ Top ] [ H5R (F03) ] [ Subroutines ]

-

NAME

-
  h5rget_obj_type_f
-
-

PURPOSE

-
  Retrieves the type of object that an object reference points to.
-
-

INPUTS

-
  loc_id   - Identifier for the dataset containing the reference or
-             for the group that dataset is in.
-  ref_type - Type of reference to query.
-  ref      - Reference to query.
-
-

OUTPUTS

-
  obj_type - Type of referenced object. 
-               H5G_UNKNOWN_F (-1)
-               H5G_LINK_F      0
-               H5G_GROUP_F     1
-               H5G_DATASET_F   2
-               H5G_TYPE_F      3
-              
-  hdferr   - error code
-               Success:  0
-               Failure: -1
-
-

AUTHOR

-
  M. Scot Breitenfeld
-  Decemeber 17, 2008
-
-

SOURCE

-
  SUBROUTINE h5rget_obj_type_f(loc_id, ref_type, ref, obj_type, hdferr)
-    USE, INTRINSIC :: ISO_C_BINDING
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: loc_id
-    INTEGER, INTENT(IN) :: ref_type
-    TYPE(C_PTR), INTENT(IN) :: ref
-    INTEGER, INTENT(OUT) :: obj_type
-    INTEGER, INTENT(OUT) :: hdferr
-
- -
- - - diff --git a/fortran/doc/DevelGuide/src/H5Rff_F90_f90.html b/fortran/doc/DevelGuide/src/H5Rff_F90_f90.html deleted file mode 100644 index 7d20d0c..0000000 --- a/fortran/doc/DevelGuide/src/H5Rff_F90_f90.html +++ /dev/null @@ -1,305 +0,0 @@ - - - - - - - -./src/H5Rff_F90.f90 - - - - - -
-
- -

H5R (F90)

- -

[ Top ] [ Modules ]

-

NAME

-
  MODULE H5R_PROVISIONAL
-
-

FILE

-
  fortran/src/H5Rff_F90.f90
-
-

PURPOSE

-
  This file contains Fortran 90 interfaces for H5R functions. It contains
-  the same functions as H5Rff_F03.f90 but excludes the Fortran 2003 functions
-  and the interface listings. This file will be compiled instead of H5Rff_F03.f90
-  if Fortran 2003 functions are not enabled.
-
-

NOTES

-
                         *** IMPORTANT ***
-  If you add a new H5R function you must add the function name to the
-  Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory.
-  This is needed for Windows based operating systems.
-
- -
- -

h5rcreate_object_f

- -

[ Top ] [ H5R (F90) ] [ Subroutines ]

-

NAME

-
  h5rcreate_object_f
-
-

PURPOSE

-
  Creates reference to the object
-
-

INPUTS

-
  loc_id        - location identifier
-  name          - name of the object at the specified location
-
-

OUTPUTS

-
  ref           - reference to the specified object
-  hdferr:       - error code
-                   Success:  0
-                   Failure: -1
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces were added for
-  called C functions (it is needed for Windows
-  port).  February 28, 2001
-
-

NOTES

-
  This is a module procedure for the h5rcreate_f subroutine.
-
-

SOURCE

-
  SUBROUTINE h5rcreate_object_f(loc_id, name, ref, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: loc_id   ! Location identifier
-    CHARACTER(LEN=*), INTENT(IN) :: name   ! Name of the object at location specified
-                                           ! by loc_id identifier
-    TYPE(hobj_ref_t_f), INTENT(OUT) :: ref ! Object reference
-    INTEGER, INTENT(OUT) :: hdferr         ! Error code
-
- -
- -

h5rcreate_region_f

- -

[ Top ] [ H5R (F90) ] [ Subroutines ]

-

NAME

-
  h5rcreate_region_f
-
-

PURPOSE

-
  Creates reference to the dataset region
-
-

INPUTS

-
  loc_id        - location identifier
-  name          - name of the dataset at the specified location
-  space_id      - dataspace identifier that describes selected region
-
-

OUTPUTS

-
  ref           - reference to the dataset region
-  hdferr:       - error code
-                   Success:  0
-                   Failure: -1
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces were added for
-  called C functions (it is needed for Windows
-  port).  February 28, 2001
-
-

NOTES

-
  This is a module procedure for the h5rcreate_f subroutine.
-
-

SOURCE

-
  SUBROUTINE h5rcreate_region_f(loc_id, name, space_id, ref, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: loc_id   ! Location identifier
-    CHARACTER(LEN=*), INTENT(IN) :: name   ! Name of the dataset at location specified
-                                           ! by loc_id identifier
-    INTEGER(HID_T), INTENT(IN) :: space_id ! Dataset's dataspace identifier
-    TYPE(hdset_reg_ref_t_f), INTENT(OUT) :: ref ! Dataset region reference
-    INTEGER, INTENT(OUT) :: hdferr         ! Error code
-
- -
- -

h5rdereference_object_f

- -

[ Top ] [ H5R (F90) ] [ Subroutines ]

-

NAME

-
  h5rdereference_object_f
-
-

PURPOSE

-
  Opens the HDF5 object referenced
-
-

INPUTS

-
  dset_id  - identifier of the dataset containing reference
-  ref      - reference to open
-
-

OUTPUTS

-
  obj_id   - object_identifier
-  hdferr   - error code
-              Success:  0
-              Failure: -1
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces were added for
-  called C functions (it is needed for Windows
-  port).  February 28, 2001
-
-

NOTES

-
  This is a module procedure for the h5rdereference_f subroutine.
-
-

SOURCE

-
  SUBROUTINE h5rdereference_object_f(dset_id, ref, obj_id, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: dset_id   ! Dataset identifier
-    TYPE(hobj_ref_t_f), INTENT(IN) :: ref   ! Object reference
-    INTEGER(HID_T), INTENT(OUT) :: obj_id   ! Object identifier
-    INTEGER, INTENT(OUT) :: hdferr          ! Error code
-
- -
- -

h5rdereference_region_f

- -

[ Top ] [ H5R (F90) ] [ Subroutines ]

-

NAME

-
  h5rdereference_region_f
-
-

PURPOSE

-
  Opens the dataset region
-
-

INPUTS

-
  dset_id       - identifier of the dataset containing
-                  reference to teh regions
-  ref           - reference to open
-
-

OUTPUTS

-
  obj_id        - dataspace identifier
-  hdferr        - error code
-                   Success:  0
-                   Failure: -1
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces were added for
-  called C functions (it is needed for Windows
-  port).  February 28, 2001
-
-

NOTES

-
  This is a module procedure for the h5rdereference_f subroutine.
-
-

SOURCE

-
  SUBROUTINE h5rdereference_region_f(dset_id, ref, obj_id, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: dset_id      ! Dataset identifier
-    TYPE(hdset_reg_ref_t_f), INTENT(IN) :: ref ! Object reference
-    INTEGER(HID_T), INTENT(OUT) :: obj_id   ! Dataspace identifier
-    INTEGER, INTENT(OUT) :: hdferr          ! Error code
-
- -
- -

h5rget_name_object_f

- -

[ Top ] [ H5R (F90) ] [ Subroutines ]

-

NAME

-
  h5rget_name_object_f
-
-

PURPOSE

-
  Retrieves a name of a referenced object.
-
-

INPUTS

-
  loc_id  - Identifier for the dataset containing the reference or for the group that dataset is in.
-  ref     - An object or dataset region reference.
-
-

OUTPUTS

-
  name    - A name associated with the referenced object or dataset region.
-
-  hdferr  - error code
-             Success:  0
-             Failure: -1
-
-

OPTIONAL PARAMETERS

-
  size    - The size of the name buffer.
-
-

AUTHOR

-
  M. Scot Breitenfeld
-  March 28, 2008
-
- SOURCES
- or for the group that dataset is in.
- returning 0 (zero) if no name is associated with the identifier
-
- -
- -

h5rget_name_region_f

- -

[ Top ] [ H5R (F90) ] [ Subroutines ]

-

NAME

-
  h5rget_name_region_f
-
-

PURPOSE

-
  Retrieves a name of a dataset region.
-
-

INPUTS

-
  loc_id        - Identifier for the dataset containing the reference or
-                  for the group that dataset is in.
-  ref           - An object or dataset region reference.
-
-

OUTPUTS

-
  name          - A name associated with the referenced object or dataset region.
-  hdferr        - error code
-                   Success:  0
-                   Failure: -1
-
-

OPTIONAL PARAMETERS

-
  size          - The size of the name buffer.
-
-

AUTHOR

-
  M. Scot Breitenfeld
-  March 28, 2008
-
-

SOURCE

-
  SUBROUTINE h5rget_name_region_f(loc_id, ref, name, hdferr, size)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: loc_id   ! Identifier for the dataset containing the reference
-                                           ! or for the group that dataset is in.
-    TYPE(hdset_reg_ref_t_f), INTENT(IN) :: ref       ! Object reference
-    INTEGER(SIZE_T), OPTIONAL, INTENT(OUT) :: size   ! The size of the name buffer,
-                                                     ! returning 0 (zero) if no name is associated 
-                                                     ! with the identifier
-    CHARACTER(LEN=*), INTENT(OUT) :: name  ! A name associated with the referenced object or dataset region.
-    INTEGER, INTENT(OUT) :: hdferr         ! Error code
-
- -
- - - diff --git a/fortran/doc/DevelGuide/src/H5Rff_f90.html b/fortran/doc/DevelGuide/src/H5Rff_f90.html deleted file mode 100644 index 2b60b08..0000000 --- a/fortran/doc/DevelGuide/src/H5Rff_f90.html +++ /dev/null @@ -1,148 +0,0 @@ - - - - - - - -./src/H5Rff.f90 - - - - - -
-
- -

H5R

- -

[ Top ] [ Modules ]

-

NAME

-
  MODULE H5R
-
-

FILE

-
  fortran/src/H5Rff.f90
-
-

PURPOSE

-
  This file contains Fortran interfaces for H5R functions. It includes
-  all the functions that are independent on whether the Fortran 2003 functions
-  are enabled or disabled.
-
-

NOTES

-
                         *** IMPORTANT ***
-  If you add a new H5R function you must add the function name to the
-  Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory.
-  This is needed for Windows based operating systems.
-
- -
- -

h5rget_object_type_obj_f

- -

[ Top ] [ H5R ] [ Subroutines ]

-

NAME

-
  h5rget_object_type_obj_f
-
-

PURPOSE

-
  Retrieves the type of object that an object reference points to.
-
-

INPUTS

-
  dset_id       - identifier of the dataset containing
-                  reference to the objects
-  ref           - reference to open
-
-

OUTPUTS

-
  obj_type      - object_type, possible values:
-                    H5G_UNKNOWN_F     (-1)
-                    H5G_GROUP_F        0
-                    H5G_DATASET_F      1
-                    H5G_TYPE_F         2
-                    H5G_LINK_F         3
-  hdferr        - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces were added for
-  called C functions (it is needed for Windows
-  port).  February 28, 2001
-
-

NOTES

-
  This is a module procedure for the h5rget_object_type_f
-  subroutine.
-
-

SOURCE

-
  SUBROUTINE h5rget_object_type_obj_f(dset_id, ref, obj_type, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: dset_id   ! Dataset identifier
-    TYPE(hobj_ref_t_f), INTENT(IN) :: ref   ! Object reference
-    INTEGER, INTENT(OUT) :: obj_type     ! Object type
-                                         !  H5G_UNKNOWN_F     (-1)
-                                         !  H5G_GROUP_F        0
-                                         !  H5G_DATASET_F      1
-                                         !  H5G_TYPE_F         2
-                                         !  H5G_LINK_F         3
-    INTEGER, INTENT(OUT) :: hdferr       ! Error code
-
- -
- -

h5rget_region_region_f

- -

[ Top ] [ H5R ] [ Subroutines ]

-

NAME

-
  h5rget_region_region_f
-
-

PURPOSE

-
  Retrieves a dataspace with the specified region selected
-
-

INPUTS

-
  dset_id       - identifier of the dataset containing
-                  reference to the regions
-  ref           - reference to open
-
-

OUTPUTS

-
  space_id      - dataspace identifier
-  hdferr        - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces were added for
-  called C functions (it is needed for Windows
-  port).  February 28, 2001
-
-

NOTES

-
  This is a module procedure for the h5rget_region_f subroutine.
-
-

SOURCE

-
  SUBROUTINE h5rget_region_region_f(dset_id, ref, space_id, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: dset_id      ! Dataset identifier
-    TYPE(hdset_reg_ref_t_f), INTENT(IN) :: ref ! Dataset region reference
-    INTEGER(HID_T), INTENT(OUT) :: space_id    ! Space identifier
-    INTEGER, INTENT(OUT) :: hdferr             ! Error code
-
- -
- - - diff --git a/fortran/doc/DevelGuide/src/H5Sf_c.html b/fortran/doc/DevelGuide/src/H5Sf_c.html deleted file mode 100644 index ebdedf7..0000000 --- a/fortran/doc/DevelGuide/src/H5Sf_c.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - -./src/H5Sf.c - - - - - -
-
- -

H5Sf

- -

[ Top ] [ Modules ]

-

PURPOSE

-
   This file contains C stubs for H5S Fortran APIs
-
- -
- - - diff --git a/fortran/doc/DevelGuide/src/H5Sff_f90.html b/fortran/doc/DevelGuide/src/H5Sff_f90.html deleted file mode 100644 index c26b191..0000000 --- a/fortran/doc/DevelGuide/src/H5Sff_f90.html +++ /dev/null @@ -1,1165 +0,0 @@ - - - - - - - -./src/H5Sff.f90 - - - - - -
-
- -

H5S

- -

[ Top ] [ Modules ]

-

NAME

-
  MODULE H5S
-
-

FILE

-
  fortran/src/H5Sff.f90
-
-

PURPOSE

-
  This file contains Fortran interfaces for H5S functions. It includes
-  all the functions that are independent on whether the Fortran 2003 functions
-  are enabled or disabled.
-
-

NOTES

-
                         *** IMPORTANT ***
-  If you add a new H5S function you must add the function name to the
-  Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory.
-  This is needed for Windows based operating systems.
-
- -
- -

h5sclose_f

- -

[ Top ] [ H5S ] [ Subroutines ]

-

NAME

-
  h5sclose_f
-
-

PURPOSE

-
  Releases and terminates access to a dataspace.
-
-

INPUTS

-
  space_id    - identifier of dataspace to release
-
-

OUTPUTS

-
  hdferr      - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces were added for
-  called C functions (it is needed for Windows
-  port).  March 6, 2001
-
-

SOURCE

-
          SUBROUTINE h5sclose_f(space_id, hdferr)
-            IMPLICIT NONE
-            INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier
-            INTEGER, INTENT(OUT) :: hdferr         ! Error code
-
- -
- -

h5scopy_f

- -

[ Top ] [ H5S ] [ Subroutines ]

-

NAME

-
  h5scopy_f
-
-

PURPOSE

-
  Creates an exact copy of a dataspace.
-
-

INPUTS

-
  space_id      - dataspace identifier
-
-

OUTPUTS

-
  new_space_id  - identifier of dataspace's copy
-  hdferr        - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces were added for
-  called C functions (it is needed for Windows
-  port).  March 6, 2001
-
-

NOTES

-

SOURCE

-
          SUBROUTINE h5scopy_f(space_id, new_space_id, hdferr)
-            IMPLICIT NONE
-            INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier
-            INTEGER(HID_T), INTENT(OUT) :: new_space_id
-                                             ! Identifier of dataspace's copy
-            INTEGER, INTENT(OUT) :: hdferr   ! Error code
-
- -
- -

h5screate_f

- -

[ Top ] [ H5S ] [ Subroutines ]

-

NAME

-
  h5screate_f
-
-

PURPOSE

-
  Creates a new dataspace of a specified type.
-
-

INPUTS

-
  classtype   - the type of the dataspace to be created
-
-

OUTPUTS

-
  space_id    - dataspace identifier
-  hdferr      - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces were added for
-  called C functions (it is needed for Windows
-  port).  March 6, 2001
-
-

NOTES

-

SOURCE

-
          SUBROUTINE h5screate_f(classtype, space_id, hdferr)
-            IMPLICIT NONE
-            INTEGER, INTENT(IN) :: classtype     ! The type of the dataspace
-                                                 ! to be created.
-                                                 ! Possible values are:
-                                                 !  H5S_SCALAR_F (0)
-                                                 !  H5S_SIMPLE_F(1)
-                                                 !  H5S_NULL_F(2)
-            INTEGER(HID_T), INTENT(OUT) :: space_id ! Dataspace identifier
-            INTEGER, INTENT(OUT) :: hdferr          ! Error code
-
- -
- -

h5screate_simple_f

- -

[ Top ] [ H5S ] [ Subroutines ]

-

NAME

-
  h5screate_simple_f
-
-

PURPOSE

-
  Creates a new simple data space and opens it for access      .
-
-

INPUTS

-
  rank        - number of dimensions
-  dims        - an array of the size of each dimension
-
-

OUTPUTS

-
  space_id    - dataspace identifier
-  hdferr      - Returns 0 if successful and -1 if fails
-
-

OPTIONAL PARAMETERS

-
  maxdims     - an array of the maximum size of each dimension
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces were added for
-  called C functions (it is needed for Windows
-  port).  March 6, 2001
-
-

SOURCE

-
          SUBROUTINE h5screate_simple_f(rank, dims, space_id, hdferr, maxdims)
-
-            IMPLICIT NONE
-            INTEGER, INTENT(IN) :: rank             ! Number of dataspace dimensions
-            INTEGER(HSIZE_T), INTENT(IN) :: dims(rank)
-                                                    ! Array with the dimension
-                                                    ! sizes
-            INTEGER(HID_T), INTENT(OUT) :: space_id ! Dataspace identifier
-            INTEGER, INTENT(OUT) :: hdferr          ! Error code
-            INTEGER(HSIZE_T), OPTIONAL, INTENT(IN) :: maxdims(rank)
-                                                    ! Array with the maximum
-                                                    ! dimension sizes
-
- -
- -

H5Sdecode_f

- -

[ Top ] [ H5S ] [ Subroutines ]

-

NAME

-
  H5Sdecode_f
-
-

PURPOSE

-
  Decode a binary object description of data space and return a new object handle.
-
-

INPUTS

-
  buf   -  Buffer for the data space object to be decoded.
-  obj_id        - Object ID
-
-

OUTPUTS

-
  hdferr      - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  M. Scot Breitenfeld
-  March 26, 2008
-
-

SOURCE

-
  SUBROUTINE h5sdecode_f(buf, obj_id, hdferr)
-    IMPLICIT NONE
-    CHARACTER(LEN=*), INTENT(IN) :: buf ! Buffer for the data space object to be decoded.
-    INTEGER(HID_T), INTENT(OUT) :: obj_id  ! Object ID
-    INTEGER, INTENT(OUT) :: hdferr     ! Error code
-
- -
- -

H5Sencode_f

- -

[ Top ] [ H5S ] [ Subroutines ]

-

NAME

-
  H5Sencode_f
-
-

PURPOSE

-
  Encode a data space object description into a binary buffer.
-
-

INPUTS

-
  obj_id        - Identifier of the object to be encoded.
-  buf   - Buffer for the object to be encoded into.
-  nalloc        - The size of the allocated buffer.
-
-

OUTPUTS

-
  nalloc        - The size of the buffer needed.
-  hdferr      - Returns 0 if successful and -1 if fails.
-
-

AUTHOR

-
  M. Scot Breitenfeld
-  March 26, 2008
-
-

SOURCE

-
  SUBROUTINE h5sencode_f(obj_id, buf, nalloc, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: obj_id ! Identifier of the object to be encoded.
-    CHARACTER(LEN=*), INTENT(OUT) :: buf ! Buffer for the object to be encoded into.
-    INTEGER(SIZE_T), INTENT(INOUT) :: nalloc ! The size of the allocated buffer.
-    INTEGER, INTENT(OUT) :: hdferr     ! Error code
-
- -
- -

h5sextent_copy_f

- -

[ Top ] [ H5S ] [ Subroutines ]

-

NAME

-
  h5sextent_copy_f
-
-

PURPOSE

-
  Copies the extent of a dataspace.
-
-

INPUTS

-
  dest_space_id         - the identifier for the dataspace to which
-  the extent is copied
-  source_space_id       - the identifier for the dataspace from
-  which the extent is copied
-
-

OUTPUTS

-
  hdferr      - Returns 0 if successful and -1 if fails
-
-

OPTIONAL PARAMETERS

-
  NONE
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces were added for
-  called C functions (it is needed for Windows
-  port).  March 6, 2001
-
-

NOTES

-

SOURCE

-
          SUBROUTINE h5sextent_copy_f(dest_space_id, source_space_id, hdferr)
-            IMPLICIT NONE
-            INTEGER(HID_T), INTENT(IN) :: dest_space_id  ! Identifier of destination
-                                                         ! dataspace
-            INTEGER(HID_T), INTENT(IN) :: source_space_id ! Identifier of source
-                                                          ! dataspace
-            INTEGER, INTENT(OUT) :: hdferr                ! Error code
-
- -
- -

h5sextent_equal_f

- -

[ Top ] [ H5S ] [ Subroutines ]

-

NAME

-
  h5sextent_equal_f
-
-

PURPOSE

-
  Determines whether two dataspace extents are equal.
-
-

INPUTS

-
  space1_id     - First dataspace identifier.
-  space2_id     - Second dataspace identifier.
-
-

OUTPUTS

-
  Equal         - .TRUE. if equal, .FALSE. if unequal.
-  hdferr      - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  M. Scot Breitenfeld
-  April 2, 2008
-
-

SOURCE

-
  SUBROUTINE h5sextent_equal_f(space1_id, space2_id, equal, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: space1_id ! First dataspace identifier.
-    INTEGER(HID_T), INTENT(IN) :: space2_id ! Second dataspace identifier.
-    LOGICAL, INTENT(OUT) :: Equal ! .TRUE. if equal, .FALSE. if unequal.
-    INTEGER, INTENT(OUT) :: hdferr                ! Error code
-
- -
- -

h5sget_select_bounds_f

- -

[ Top ] [ H5S ] [ Subroutines ]

-

NAME

-
  h5sget_select_bounds_f
-
-

PURPOSE

-
  Gets the bounding box containing the current selection.
-
-

INPUTS

-
  space_id    - dataspace identifier
-
-

OUTPUTS

-
  start       - starting coordinates of bounding box
-  end         - ending coordinates of bounding box
-  hdferr      - Returns 0 if successful and -1 if fails
-
-

OPTIONAL PARAMETERS

-
  NONE
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces were added for
-  called C functions (it is needed for Windows
-  port).  March 6, 2001
-
-

SOURCE

-
  SUBROUTINE  h5sget_select_bounds_f(space_id, start, END, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier
-    INTEGER(HSIZE_T), DIMENSION(*), INTENT(OUT) :: start
-                                           ! Starting coordinates of the bounding box.
-    INTEGER(HSIZE_T), DIMENSION(*), INTENT(OUT) :: END
-                                           !Ending coordinates of the bounding box,
-                                           !i.e., the coordinates of the diagonally
-                                           !opposite corner
-    INTEGER, INTENT(OUT) :: hdferr         ! Error code
-
- -
- -

h5sget_select_elem_npoints_f

- -

[ Top ] [ H5S ] [ Subroutines ]

-

NAME

-
  h5sget_select_elem_npoints_f
-
-

PURPOSE

-
  Gets the number of element points in the current selection
-
-

INPUTS

-
  space_id      - dataspace identifier
-
-

OUTPUTS

-
  num_points    - number of element points in the current
-                  dataspace selection
-  hdferr        - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces were added for
-  called C functions (it is needed for Windows
-  port).  March 6, 2001
-
-

SOURCE

-
          SUBROUTINE h5sget_select_elem_npoints_f(space_id, num_points, hdferr)
-            IMPLICIT NONE
-            INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier
-            INTEGER(HSSIZE_T), INTENT(OUT) :: num_points
-                                             !number of element points
-                                             !in the current dataspace
-                                             !selection
-            INTEGER, INTENT(OUT) :: hdferr   ! Error code
-
- -
- -

h5sget_select_elem_pointlist_f

- -

[ Top ] [ H5S ] [ Subroutines ]

-

NAME

-
  h5sget_select_elem_pointlist_f
-
-

PURPOSE

-
  Gets the list of element points currently selected.
-
-

INPUTS

-
  space_id    - dataspace identifier
-  startpoint  - element point to start with
-  num_points  - number of elemnt points to get
-
-

OUTPUTS

-
  buf         - buffer with element points selected
-  hdferr      - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces were added for
-  called C functions (it is needed for Windows
-  port).  March 6, 2001
-
-

SOURCE

-
          SUBROUTINE h5sget_select_elem_pointlist_f(space_id, startpoint, &
-                                                    num_points, buf, hdferr)
-            IMPLICIT NONE
-            INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier
-            INTEGER(HSIZE_T), INTENT(IN) :: startpoint
-                                             !Element point to start with.
-            INTEGER(HSIZE_T), INTENT(IN) :: num_points
-                                             !Number of element points to get
-            INTEGER(HSIZE_T), DIMENSION(*), INTENT(OUT) :: buf
-                                             !List of element points selected
-            INTEGER, INTENT(OUT) :: hdferr   ! Error code
-
- -
- -

h5sget_select_hyper_blocklist_f

- -

[ Top ] [ H5S ] [ Subroutines ]

-

NAME

-
  h5sget_select_hyper_blocklist_f
-
-

PURPOSE

-
  Gets the list of hyperslab blocks currently selected.
-
-

INPUTS

-
  space_id    - dataspace identifier
-  startblock  - hyperslab block to start with
-  num_blocks  - number of blocks to get
-
-

OUTPUTS

-
  buf         - buffer to hold block list
-  hdferr      - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces were added for
-  called C functions (it is needed for Windows
-  port).  March 6, 2001
-
-

SOURCE

-
          SUBROUTINE h5sget_select_hyper_blocklist_f(space_id, startblock, &
-                                                    num_blocks, buf, hdferr)
-            IMPLICIT NONE
-            INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier
-            INTEGER(HSIZE_T), INTENT(IN) :: startblock
-                                             !Hyperslab block to start with.
-            INTEGER(HSIZE_T), INTENT(IN) :: num_blocks
-                                             !number of hyperslab blocks
-                                             !to get in the current dataspace
-                                             !selection
-            INTEGER(HSIZE_T), DIMENSION(*), INTENT(OUT) :: buf
-                                             !List of hyperslab blocks selected
-            INTEGER, INTENT(OUT) :: hdferr   ! Error code
-
- -
- -

h5sget_select_hyper_nblocks_f

- -

[ Top ] [ H5S ] [ Subroutines ]

-

NAME

-
  h5sget_select_hyper_nblocks_f
-
-

PURPOSE

-
  Get number of hyperslab blocks.
-
-

INPUTS

-
  space_id    - dataspace identifier
-
-

OUTPUTS

-
  num_blocks  - number of hyperslab blocks in the current
-                hyperslab selection
-  hdferr      - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces were added for
-  called C functions (it is needed for Windows
-  port).  March 6, 2001
-
-

SOURCE

-
          SUBROUTINE h5sget_select_hyper_nblocks_f(space_id, num_blocks, hdferr)
-            IMPLICIT NONE
-            INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier
-            INTEGER(HSSIZE_T), INTENT(OUT) :: num_blocks
-                                             !number of hyperslab blocks
-                                             !in the current dataspace
-                                             !selection
-            INTEGER, INTENT(OUT) :: hdferr   ! Error code
-
- -
- -

h5sget_select_npoints_f

- -

[ Top ] [ H5S ] [ Subroutines ]

-

NAME

-
  h5sget_select_npoints_f
-
-

PURPOSE

-
  Determines the number of elements in a dataspace selection.
-
-

INPUTS

-
  space_id      - dataspace identifier
-
-

OUTPUTS

-
  npoints       - number of points in the dataspace selection
-  hdferr      - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces were added for
-  called C functions (it is needed for Windows
-  port).  March 6, 2001
-
-

SOURCE

-
          SUBROUTINE h5sget_select_npoints_f(space_id, npoints, hdferr)
-            IMPLICIT NONE
-            INTEGER(HID_T), INTENT(IN) :: space_id     ! Dataspace identifier
-            INTEGER(HSSIZE_T), INTENT(OUT) :: npoints  ! Number of elements in the
-                                                       ! selection
-            INTEGER, INTENT(OUT) :: hdferr             ! Error code
-
- -
- -

h5sget_select_type_f

- -

[ Top ] [ H5S ] [ Subroutines ]

-

NAME

-
  h5sget_select_type_f
-
-

PURPOSE

-
  Retrieve the type of selection
-
-

INPUTS

-
  space_id      - dataspace iidentifier with selection
-
-

OUTPUTS

-
  type          - flag, valid values are:
-                    H5S_SEL_ERROR_F
-                    H5S_SEL_NONE_F
-                    H5S_SEL_POINTS_F
-                    H5S_SEL_HYPERSLABS_F
-                    H5S_SEL_ALL_F
-  hdferr      - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  Elena Pourmal
-  October 7, 2002
-
-

SOURCE

-
          SUBROUTINE h5sget_select_type_f(space_id, type, hdferr)
-            IMPLICIT NONE
-            INTEGER(HID_T), INTENT(INOUT) :: space_id ! Dataspace identifier to
-            INTEGER, INTENT(OUT) :: type        ! Selection type
-                                                !  H5S_SEL_ERROR_F
-                                                !  H5S_SEL_NONE_F
-                                                !  H5S_SEL_POINTS_F
-                                                !  H5S_SEL_HYPERSLABS_F
-                                                !  H5S_SEL_ALL_F
-            INTEGER, INTENT(OUT) :: hdferr     ! Error code
-
- -
- -

h5sget_simple_extent_dims_f

- -

[ Top ] [ H5S ] [ Subroutines ]

-

NAME

-
  h5sget_simple_extent_dims_f
-
-

PURPOSE

-
  Retrieves dataspace dimension size and maximum size.
-
-

INPUTS

-
  space_id      - dataspace identifier
-
-

OUTPUTS

-
  dims          - array to store size of each dimension
-  maxdims       - array to store maximum size of each
-  dimension
-  hdferr      - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces were added for
-  called C functions (it is needed for Windows
-  port).  March 6, 2001
-
-

SOURCE

-
          SUBROUTINE h5sget_simple_extent_dims_f(space_id, dims, maxdims, hdferr)
-            IMPLICIT NONE
-            INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier
-            INTEGER(HSIZE_T), DIMENSION(*), INTENT(OUT) :: dims
-                                                   ! Array to store dimension sizes
-            INTEGER(HSIZE_T), DIMENSION(*), INTENT(OUT) :: maxdims
-                                                   ! Array to store max dimension
-                                                   ! sizes
-            INTEGER, INTENT(OUT) :: hdferr         ! Error code: -1 on failure,
-                                                   ! number of dimensions on
-                                                   ! on success
-
- -
- -

h5sget_simple_extent_ndims_f

- -

[ Top ] [ H5S ] [ Subroutines ]

-

NAME

-
  h5sget_simple_extent_ndims_f
-
-

PURPOSE

-
  Determines the dimensionality of a dataspace
-
-

INPUTS

-
  space_id      - dataspace identifier
-
-

OUTPUTS

-
  rank          - number of dataspace dimensions
-  hdferr      - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces were added for
-  called C functions (it is needed for Windows
-  port).  March 6, 2001
-
-

SOURCE

-
          SUBROUTINE h5sget_simple_extent_ndims_f(space_id, rank, hdferr)
-            IMPLICIT NONE
-            INTEGER(HID_T), INTENT(IN) :: space_id     ! Dataspace identifier
-            INTEGER, INTENT(OUT) :: rank               ! Number of dimensions
-            INTEGER, INTENT(OUT) :: hdferr             ! Error code
-
- -
- -

h5sget_simple_extent_npoints_f

- -

[ Top ] [ H5S ] [ Subroutines ]

-

NAME

-
  h5sget_simple_extent_npoints_f
-
-

PURPOSE

-
  Determines the number of elements in a dataspace.
-
-

INPUTS

-
  space_id      - dataspace identifier
-
-

OUTPUTS

-
  npoints       - number of elements in the dataspace
-  hdferr      - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces were added for
-  called C functions (it is needed for Windows
-  port).  March 6, 2001
-
-

SOURCE

-
          SUBROUTINE h5sget_simple_extent_npoints_f(space_id, npoints, hdferr)
-            IMPLICIT NONE
-            INTEGER(HID_T), INTENT(IN) :: space_id     ! Dataspace identifier
-            INTEGER(HSIZE_T), INTENT(OUT) :: npoints  ! Number of elements in
-                                                       ! dataspace
-            INTEGER, INTENT(OUT) :: hdferr             ! Error code
-
- -
- -

h5sget_simple_extent_type_f

- -

[ Top ] [ H5S ] [ Subroutines ]

-

NAME

-
  h5sget_simple_extent_type_f
-
-

PURPOSE

-
  Determine the current class of a dataspace
-
-

INPUTS

-
  space_id      - dataspace identifier
-
-

OUTPUTS

-
  classtype     - class type, possible values are:
-  H5S_NO_CLASS_F (-1)
-  H5S_SCALAR_F (0)
-  H5S_SIMPLE_F (1)
-  H5S_NULL_F   (2)
-  hdferr      - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces were added for
-  called C functions (it is needed for Windows
-  port).  March 6, 2001
-
-

SOURCE

-
          SUBROUTINE h5sget_simple_extent_type_f(space_id, classtype, hdferr)
-            IMPLICIT NONE
-            INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier
-            INTEGER, INTENT(OUT) :: classtype      ! Class type , possible values
-                                                   ! are:
-                                                   !  H5S_NO_CLASS_F (-1)
-                                                   !  H5S_SCALAR_F (0)
-                                                   !  H5S_SIMPLE_F (1)
-                                                   !  H5S_NULL_F   (2)
-            INTEGER, INTENT(OUT) :: hdferr         ! Error code
-
- -
- -

h5sis_simple_f

- -

[ Top ] [ H5S ] [ Subroutines ]

-

NAME

-
  h5sis_simple_f
-
-

PURPOSE

-
  Determines whether a dataspace is a simple dataspace.
-
-

INPUTS

-
  space_id      - dataspace identifier
-
-

OUTPUTS

-
  status        - flag to indicate if dataspace
-  is simple or not
-  hdferr      - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces were added for
-  called C functions (it is needed for Windows
-  port).  March 6, 2001
-
-

SOURCE

-
          SUBROUTINE h5sis_simple_f(space_id, status, hdferr)
-            IMPLICIT NONE
-            INTEGER(HID_T), INTENT(IN) :: space_id  ! Dataspace identifier
-            LOGICAL, INTENT(OUT) :: status      ! Flag, idicates if dataspace
-                                                ! is simple or not ( TRUE or
-                                                ! FALSE)
-            INTEGER, INTENT(OUT) :: hdferr      ! Error code
-
- -
- -

h5soffset_simple_f

- -

[ Top ] [ H5S ] [ Subroutines ]

-

NAME

-
  h5soffset_simple_f
-
-

PURPOSE

-
  Sets the offset of a simple dataspace.
-
-

INPUTS

-
  space_id      - dataspace identifier
-  offset        - the offset at which to position the
-  selection
-
-

OUTPUTS

-
  hdferr      - Returns 0 if successful and -1 if fails
-
-

OPTIONAL PARAMETERS

-
  NONE
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces were added for
-  called C functions (it is needed for Windows
-  port).  March 6, 2001
-
-

SOURCE

-
          SUBROUTINE h5soffset_simple_f(space_id, offset, hdferr)
-            IMPLICIT NONE
-            INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier
-            INTEGER(HSSIZE_T), DIMENSION(*), INTENT(IN) ::  offset
-                                                   ! The offset at which to position
-                                                   ! the selection
-            INTEGER, INTENT(OUT) :: hdferr         ! Error code
-
- -
- -

h5sselect_all_f

- -

[ Top ] [ H5S ] [ Subroutines ]

-

NAME

-
  h5sselect_all_f
-
-

PURPOSE

-
  Selects the entire dataspace.
-
-

INPUTS

-
  space_id    - Identifier for the dataspace in which
-                selection being made
-
-

OUTPUTS

-
  hdferr      - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces were added for
-  called C functions (it is needed for Windows
-  port).  March 6, 2001
-
-

SOURCE

-
          SUBROUTINE h5sselect_all_f(space_id, hdferr)
-            IMPLICIT NONE
-            INTEGER(HID_T), INTENT(IN) :: space_id  ! Dataspace identifier
-            INTEGER, INTENT(OUT) :: hdferr          ! Error code
-
- -
- -

h5sselect_elements_f

- -

[ Top ] [ H5S ] [ Subroutines ]

-

NAME

-
  h5sselect_elements_f
-
-

PURPOSE

-
  Selects elements to be included in the selection for
-  a dataspace
-
-

INPUTS

-
  space_id      - dataspace identifier
-  operator      - flag, valid values are:
-                   H5S_SELECT_SET_F 
-                   H5S_SELECT_APPEND_F 
-                   H5S_SELECT_PREPEND_F
-  rank          - number of dataspace dimensions
-  num_elements  - number of elements to be selected
-  coord         - 2D (rank x num_elements) array with the
-                  elements coordinates ( 1-based); in C the
-                  array is stored in 2D as (num_element x rank)
-
-

OUTPUTS

-
  hdferr        - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces were added for
-  called C functions (it is needed for Windows
-  port).  March 6, 2001
-
-

SOURCE

-
  SUBROUTINE h5sselect_elements_f(space_id, OPERATOR, rank, &
-       num_elements, coord, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T),   INTENT(IN)                                :: space_id
-    INTEGER,          INTENT(IN)                                :: OPERATOR
-    INTEGER,          INTENT(IN)                                :: rank
-    INTEGER(SIZE_T),  INTENT(IN)                                :: num_elements
-    INTEGER(HSIZE_T), INTENT(IN) , DIMENSION(rank,num_elements) :: coord
-    INTEGER,          INTENT(OUT)                               :: hdferr 
-
- -
- -

h5sselect_hyperslab_f

- -

[ Top ] [ H5S ] [ Subroutines ]

-

NAME

-
  h5sselect_hyperslab_f
-
-

PURPOSE

-
  Selects a hyperslab region to add to the current selected
-  region
-
-

INPUTS

-
  space_id      - dataspace identifier
-  operator      - flag, valid values are:
-  H5S_SELECT_SET_F (0)
-  H5S_SELECT_OR_F (1)
-  start         - array with hyperslab offsets
-  count         - number of blocks included in the
-  hyperslab
-
-

OUTPUTS

-
  hdferr      - Returns 0 if successful and -1 if fails
-
-

OPTIONAL PARAMETERS

-
  stride        - array with hyperslab strides
-  block         - array with hyperslab block sizes
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces were added for
-  called C functions (it is needed for Windows
-  port).  March 6, 2001
-
-

SOURCE

-
          SUBROUTINE h5sselect_hyperslab_f(space_id, operator, start, count, &
-                                           hdferr, stride, block)
-            IMPLICIT NONE
-            INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier
-            INTEGER, INTENT(IN) :: operator     ! Flag, valid values are:
-                                                ! H5S_SELECT_SET_F (0)
-                                                ! H5S_SELECT_OR_F (1)
-                                                !
-            INTEGER(HSIZE_T), DIMENSION(*), INTENT(IN) :: start
-                                          ! Starting coordinates of the hyperslab
-            INTEGER(HSIZE_T), DIMENSION(*), INTENT(IN) :: count
-                                          ! Number of blocks to select
-                                          ! from dataspace
-            INTEGER, INTENT(OUT) :: hdferr     ! Error code
-            INTEGER(HSIZE_T), DIMENSION(:), OPTIONAL, INTENT(IN) :: stride
-                                          ! Array of how many elements to move
-                                          ! in each direction
-            INTEGER(HSIZE_T), DIMENSION(:), OPTIONAL, INTENT(IN) :: block
-                                          ! Sizes of element block
-
- -
- -

h5sselect_none_f

- -

[ Top ] [ H5S ] [ Subroutines ]

-

NAME

-
  h5sselect_none_f
-
-

PURPOSE

-
  Resets the selection region to include no elements.
-
-

INPUTS

-
  space_id    - the identifier for the dataspace in which
-                the selection is being reset.
-
-

OUTPUTS

-
  hdferr      - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces were added for
-  called C functions (it is needed for Windows
-  port).  March 6, 2001
-
-

SOURCE

-
          SUBROUTINE h5sselect_none_f(space_id, hdferr)
-            IMPLICIT NONE
-            INTEGER(HID_T), INTENT(IN) :: space_id  ! Dataspace identifier
-            INTEGER, INTENT(OUT) :: hdferr          ! Error code
-
- -
- -

h5sselect_valid_f

- -

[ Top ] [ H5S ] [ Subroutines ]

-

NAME

-
  h5sselect_valid_f
-
-

PURPOSE

-
  Verifies that the selection is within the extent of
-  the dataspace.
-
-

INPUTS

-
  space_id      - identifier for the dataspace for which
-  selection is verified
-
-

OUTPUTS

-
  hdferr      - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces were added for
-  called C functions (it is needed for Windows
-  port).  March 6, 2001
-
-

SOURCE

-
          SUBROUTINE h5sselect_valid_f(space_id, status, hdferr)
-            IMPLICIT NONE
-            INTEGER(HID_T), INTENT(IN) :: space_id  ! Dataspace identifier
-            LOGICAL, INTENT(OUT) :: status          ! TRUE if the selection is
-                                                    ! contained within the extent,
-                                                    ! FALSE otherwise.
-            INTEGER, INTENT(OUT) :: hdferr          ! Error code
-
- -
- -

h5sset_extent_none_f

- -

[ Top ] [ H5S ] [ Subroutines ]

-

NAME

-
  h5sset_extent_none_f
-
-

PURPOSE

-
  Removes the extent from a dataspace.
-
-

INPUTS

-
  space_id      - dataspace identifier
-
-

OUTPUTS

-
  hdferr      - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces were added for
-  called C functions (it is needed for Windows
-  port).  March 6, 2001
-
-

SOURCE

-
          SUBROUTINE h5sset_extent_none_f(space_id, hdferr)
-            IMPLICIT NONE
-            INTEGER(HID_T), INTENT(IN) :: space_id  ! Dataspace identifier
-            INTEGER, INTENT(OUT) :: hdferr          ! Error code
-
- -
- -

h5sset_extent_simple_f

- -

[ Top ] [ H5S ] [ Subroutines ]

-

NAME

-
  h5sset_extent_simple_f
-
-

PURPOSE

-
  Sets or resets the size of an existing dataspace.
-
-

INPUTS

-
  space_id      - dataspace identifier
-  rank          - dataspace number of dimensions
-  current_size          - array with the new sizes of dimensions
-  maximum_size          - array with the new maximum sizes of
-  dimensions
-
-

OUTPUTS

-
  hdferr      - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces were added for
-  called C functions (it is needed for Windows
-  port).  March 6, 2001
-
-

SOURCE

-
          SUBROUTINE h5sset_extent_simple_f(space_id, rank, current_size, &
-                                            maximum_size, hdferr)
-            IMPLICIT NONE
-            INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier
-            INTEGER, INTENT(IN) :: rank            ! Dataspace rank
-            INTEGER(HSIZE_T), DIMENSION(rank), INTENT(IN) :: current_size
-                                                   ! Array with the new sizes
-                                                   ! of dimensions
-            INTEGER(HSIZE_T), DIMENSION(rank), INTENT(IN) :: maximum_size
-                                                   ! Array with the new maximum
-                                                   ! sizes of dimensions
-                                                   ! sizes
-            INTEGER, INTENT(OUT) :: hdferr         ! Error code
-
- -
- - - diff --git a/fortran/doc/DevelGuide/src/H5Tf_c.html b/fortran/doc/DevelGuide/src/H5Tf_c.html deleted file mode 100644 index b36c2a5..0000000 --- a/fortran/doc/DevelGuide/src/H5Tf_c.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - -./src/H5Tf.c - - - - - -
-
- -

H5Tf

- -

[ Top ] [ Modules ]

-

PURPOSE

-
   This file contains C stubs for H5T Fortran APIs
-
- -
- - - diff --git a/fortran/doc/DevelGuide/src/H5Tff_f90.html b/fortran/doc/DevelGuide/src/H5Tff_f90.html deleted file mode 100644 index 3b7dfe8..0000000 --- a/fortran/doc/DevelGuide/src/H5Tff_f90.html +++ /dev/null @@ -1,2378 +0,0 @@ - - - - - - - -./src/H5Tff.f90 - - - - - -
-
- -

H5T

- -

[ Top ] [ Modules ]

-

NAME

-
  MODULE H5T
-
-

PURPOSE

-
  This file contains Fortran interfaces for H5T functions. It includes
-  all the functions that are independent on whether the Fortran 2003 functions
-  are enabled or disabled.
-
-

NOTES

-
                         *** IMPORTANT ***
-  If you add a new H5T function you must add the function name to the
-  Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory.
-  This is needed for Windows based operating systems.
-
- -
- -

h5tarray_create_f

- -

[ Top ] [ H5T ] [ Subroutines ]

-

NAME

-
  h5tarray_create_f
-
-

PURPOSE

-
  Creates an array datatype object.
-
-

INPUTS

-
  base_id       - datatype identifier for the array
-                  base datatype
-  rank          - rank of the array
-  dims          - array dimension sizes
-
-

OUTPUTS

-
  type_id       - array datatype identifier
-  hdferr        - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces were added for
-  called C functions (it is needed for Windows
-  port).  March 7, 2001
-
-

SOURCE

-
  SUBROUTINE h5tarray_create_f(base_id, rank, dims, type_id, hdferr)
-            IMPLICIT NONE
-            INTEGER(HID_T), INTENT(IN) :: base_id ! identifier of array base datatype
-            INTEGER, INTENT(IN) ::  rank ! Rank of the array
-            INTEGER(HSIZE_T), DIMENSION(*), INTENT(IN) :: dims !Sizes of each array dimension
-            INTEGER(HID_T), INTENT(OUT) :: type_id ! identifier of the array datatype
-            INTEGER, INTENT(OUT) :: hdferr        ! Error code
-
- -
- -

h5tclose_f

- -

[ Top ] [ H5T ] [ Subroutines ]

-

NAME

-
  h5tclose_f
-
-

PURPOSE

-
  Releases a datatype.
-
-

INPUTS

-
  type_id       - datatype identifier
-
-

OUTPUTS

-
  hdferr        - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces were added for
-  called C functions (it is needed for Windows
-  port).  March 7, 2001
-
-

SOURCE

-
  SUBROUTINE h5tclose_f(type_id, hdferr)
-            IMPLICIT NONE
-            INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
-            INTEGER, INTENT(OUT) :: hdferr        ! Error code
-
- -
- -

h5tcommit_anon_f

- -

[ Top ] [ H5T ] [ Subroutines ]

-

NAME

-
  h5tcommit_anon_f
-
-

PURPOSE

-
  Commits a transient datatype to a file,
-  creating a new named datatype,
-  but does not link it into the file structure.
-
-

INPUTS

-
  loc_id        - A file or group identifier specifying the file
-                  in which the new named datatype is to be created.
-  dtype_id      - A datatype identifier.
-
-

OUTPUTS

-
  hdferr        - Returns 0 if successful and -1 if fails
-
-

OPTIONAL PARAMETERS

-
  tcpl_id       - A datatype creation property list identifier.
-                  (H5P_DEFAULT_F for the default property list.)
-  tapl_id       - A datatype access property list identifier.
-                  should always be passed as the value H5P_DEFAULT_F.
-
-

AUTHOR

-
  M. Scot Breitenfeld
-  February 25, 2008
-
-

SOURCE

-
  SUBROUTINE h5tcommit_anon_f(loc_id, dtype_id, hdferr, tcpl_id, tapl_id)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: loc_id  ! A file or group identifier specifying
-                                          ! the file in which the new named datatype
-                                          ! is to be created.
-    INTEGER(HID_T), INTENT(IN) :: dtype_id  ! Datatype identifier
-    INTEGER, INTENT(OUT) :: hdferr          ! Error code
-    INTEGER(HID_T), OPTIONAL, INTENT(IN) :: tcpl_id ! A datatype creation property
-                                                    ! list identifier.
-                                                    ! (H5P_DEFAULT_F for the default property list.)
-    INTEGER(HID_T), OPTIONAL, INTENT(IN) :: tapl_id ! A datatype access property list identifier.
-                                                    ! should always be passed as the value H5P_DEFAULT_F.
-
- -
- -

h5tcommit_f

- -

[ Top ] [ H5T ] [ Subroutines ]

-

NAME

-
  h5tcommit_f
-
-

PURPOSE

-
  Commits a transient datatype to a file, creating a
-  new named datatype.
-
-

INPUTS

-
  loc_id        - location identifier
-  name          - name of the datatype to be stored
-                  at the specified location
-  type_id       - identifier of a datatype to be stored
-
-

OUTPUTS

-
  hdferr        - Returns 0 if successful and -1 if fails
-
-

OPTIONAL PARAMETERS

-
  lcpl_id       - Link creation property list
-  tcpl_id       - Datatype creation property list
-  tapl_id       - Datatype access property list
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
        - Explicit Fortran interfaces were added for
-          called C functions (it is needed for Windows
-          port).  March 7, 2001
-
-        - Added optional parameters introduced in version 1.8
-          M. Scot Breitenfeld
-
-

SOURCE

-
  SUBROUTINE h5tcommit_f(loc_id, name, type_id, hdferr, &
-       lcpl_id, tcpl_id, tapl_id  )
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: loc_id  ! File or group identifier
-    CHARACTER(LEN=*), INTENT(IN) :: name
-                                  ! Datatype name within file or group
-    INTEGER(HID_T), INTENT(IN) :: type_id  ! Datatype identifier
-    INTEGER, INTENT(OUT) :: hdferr          ! Error code
-    INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lcpl_id ! Link creation property list
-    INTEGER(HID_T), OPTIONAL, INTENT(IN) :: tcpl_id ! Datatype creation property list
-    INTEGER(HID_T), OPTIONAL, INTENT(IN) :: tapl_id ! Datatype access property list
-
- -
- -

h5tcommitted_f

- -

[ Top ] [ H5T ] [ Subroutines ]

-

NAME

-
  h5tcommitted_f
-
-

PURPOSE

-
  Determines whether a datatype is a named type or a transient type.
-
-

INPUTS

-
  dtype_id      - A datatype identifier.
-
-

OUTPUTS

-
  committed     - .TRUE., if the datatype has been committed
-                  .FALSE., if the datatype has not been committed.
-  hdferr        - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  M. Scot Breitenfeld
-  February 25, 2008
-
-

SOURCE

-
  SUBROUTINE h5tcommitted_f(dtype_id, committed, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: dtype_id  ! A datatype identifier
-    LOGICAL, INTENT(OUT) :: committed ! .TRUE., if the datatype has been committed
-                                      !.FALSE., if the datatype has not been committed.
-    INTEGER, INTENT(OUT) :: hdferr     ! Error code:
-!  Success:  0
-!  Failure: -1
-
- -
- -

h5tcompiler_conv_f

- -

[ Top ] [ H5T ] [ Subroutines ]

-

NAME

-
  h5tcompiler_conv_f
-
-

PURPOSE

-
  Check whether the library’s default conversion is hard conversion.R
-
-

INPUTS

-
  src_id        - Identifier for the source datatype.
-  dst_id        - Identifier for the destination datatype.
-
-

OUTPUTS

-
  flag          - TRUE for compiler conversion, FALSE for library conversion
-  hdferr        - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  M. Scot Breitenfeld
-  April 9, 2008
-
-

SOURCE

-
  SUBROUTINE h5tcompiler_conv_f( src_id, dst_id, flag, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: src_id ! Identifier for the source datatype.
-    INTEGER(HID_T), INTENT(IN) :: dst_id ! Identifier for the destination datatype.
-    LOGICAL, INTENT(OUT) :: flag  ! .TRUE. for compiler conversion, .FALSE. for library conversion
-    INTEGER, INTENT(OUT) :: hdferr  ! Error code:
-                                    ! 0 on success and -1 on failure
-
- -
- -

h5tcopy_f

- -

[ Top ] [ H5T ] [ Subroutines ]

-

NAME

-
  h5tcopy_f
-
-

PURPOSE

-
  Creates a copy of exisiting datatype.
-
-

INPUTS

-
  type_id       - datatype identifier
-
-

OUTPUTS

-
  new_type_id   - identifier of datatype's copy
-  hdferr        - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces were added for
-  called C functions (it is needed for Windows
-  port).  March 7, 2001
-
-

SOURCE

-
  SUBROUTINE h5tcopy_f(type_id, new_type_id, hdferr)
-            IMPLICIT NONE
-            INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
-            INTEGER(HID_T), INTENT(OUT) :: new_type_id
-                                 ! Identifier of datatype's copy
-            INTEGER, INTENT(OUT) :: hdferr        ! Error code
-
- -
- -

h5tcreate_f

- -

[ Top ] [ H5T ] [ Subroutines ]

-

NAME

-
  h5tcreate_f
-
-

PURPOSE

-
  Creates a new dataype
-
-

INPUTS

-
  class         - datatype class, possible values are:
-                    H5T_COMPOUND_F
-                    H5T_ENUM_F
-                    H5T_OPAQUE_F
-  size          - datattype size
-
-

OUTPUTS

-
  type_id       - datatype identifier
-  hdferr        - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces were added for
-  called C functions (it is needed for Windows
-  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
-
- -
- -

H5Tdecode_f

- -

[ Top ] [ H5T ] [ Subroutines ]

-

NAME

-
  H5Tdecode_f
-
-

PURPOSE

-
  Decode a binary object description of data type and return a new object handle.
-
-

INPUTS

-
  buf           -  Buffer for the data space object to be decoded.
-  obj_id        - Object ID
-
-

OUTPUTS

-
  hdferr        - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  M. Scot Breitenfeld
-  April 9, 2008
-
-

SOURCE

-
  SUBROUTINE h5tdecode_f(buf, obj_id, hdferr)
-    IMPLICIT NONE
-    CHARACTER(LEN=*), INTENT(IN) :: buf ! Buffer for the data space object to be decoded.
-    INTEGER(HID_T), INTENT(OUT) :: obj_id  ! Object ID
-    INTEGER, INTENT(OUT) :: hdferr     ! Error code
-
- -
- -

h5tenaum_insert_f

- -

[ Top ] [ H5T ] [ Subroutines ]

-

NAME

-
  h5tenaum_insert_f
-
-

PURPOSE

-
  Inserts a new enumeration datatype member.
-
-

INPUTS

-
  type_id       - datatype identifier
-
-

OUTPUTS

-
  hdferr        - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces were added for
-  called C functions (it is needed for Windows
-  port).  March 7, 2001
-
-

SOURCE

-
  SUBROUTINE h5tenum_insert_f(type_id,  name, value, hdferr)
-            IMPLICIT NONE
-            INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
-            CHARACTER(LEN=*), INTENT(IN) :: name  !Name of  the new member
-            INTEGER, INTENT(IN) :: value !value of the new member
-            INTEGER, INTENT(OUT) :: hdferr        ! Error code
-
- -
- -

H5Tencode_f

- -

[ Top ] [ H5T ] [ Subroutines ]

-

NAME

-
  H5Tencode_f
-
-

PURPOSE

-
  Encode a data type object description into a binary buffer.
-
-

INPUTS

-
  obj_id        - Identifier of the object to be encoded.
-  buf           - Buffer for the object to be encoded into.
-  nalloc        - The size of the allocated buffer.
-
-

OUTPUTS

-
  nalloc        - The size of the buffer needed.
-  hdferr        - Returns 0 if successful and -1 if fails.
-
-

AUTHOR

-
  M. Scot Breitenfeld
-  April 9, 2008
-
-

SOURCE

-
  SUBROUTINE h5tencode_f(obj_id, buf, nalloc, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: obj_id ! Identifier of the object to be encoded.
-    CHARACTER(LEN=*), INTENT(OUT) :: buf ! Buffer for the object to be encoded into.
-    INTEGER(SIZE_T), INTENT(INOUT) :: nalloc ! The size of the allocated buffer.
-    INTEGER, INTENT(OUT) :: hdferr     ! Error code
-
- -
- -

h5tenum_create_f

- -

[ Top ] [ H5T ] [ Subroutines ]

-

NAME

-
  h5tenum_create_f
-
-

PURPOSE

-
  Creates a new enumeration datatype.
-
-

INPUTS

-
  parent_id     - datatype identifier for base datatype
-
-

OUTPUTS

-
  new_type_id   - datatype identifier for the enumeration datatype
-  hdferr        - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces were added for
-  called C functions (it is needed for Windows
-  port).  March 7, 2001
-
-

SOURCE

-
  SUBROUTINE h5tenum_create_f(parent_id, new_type_id, hdferr)
-            IMPLICIT NONE
-            INTEGER(HID_T), INTENT(IN) :: parent_id  ! Datatype identifier for
-                                                     ! the  base datatype
-            INTEGER(HID_T), INTENT(OUT) :: new_type_id
-                                                     !datatype identifier for the
-                                                     ! new enumeration datatype
-            INTEGER, INTENT(OUT) :: hdferr        ! Error code
-
- -
- -

h5tenum_nameof_f

- -

[ Top ] [ H5T ] [ Subroutines ]

-

NAME

-
  h5tenum_nameof_f
-
-

PURPOSE

-
  Returns the symbol name corresponding to a specified
-  member of an enumeration datatype.
-
-

INPUTS

-
  type_id       - datatype identifier
-  value         - value of the enumeration datatype
-  namelen       - name buffer size
-
-

OUTPUTS

-
  name          - buffer to hold symbol name
-  hdferr        - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces were added for
-  called C functions (it is needed for Windows
-  port).  March 7, 2001
-
- NOTE
-   According to the standard: Because an INTENT(OUT) variable is considered undefined 
-   on entry to the procedure, any default initialization specified for its type will 
-   be applied. So we need to blank out the "name" to be portable and eliminate any 
-   characters the "name' may contain upon entry, depending on compiler implementation.
-
-

SOURCE

-
  SUBROUTINE h5tenum_nameof_f(type_id,  value, namelen, name, hdferr)
-            IMPLICIT NONE
-            INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
-            CHARACTER(LEN=*), INTENT(OUT) :: name  !Name of the  enumeration datatype.
-            INTEGER(SIZE_T), INTENT(IN) :: namelen !length of the name
-            INTEGER, INTENT(IN) :: value !value of the  enumeration datatype.
-            INTEGER, INTENT(OUT) :: hdferr        ! Error code
-
- -
- -

h5tenum_valuof_f

- -

[ Top ] [ H5T ] [ Subroutines ]

-

NAME

-
  h5tenum_valuof_f
-
-

PURPOSE

-
  Returns the value corresponding to a specified
-  member of an enumeration datatype.
-
-

INPUTS

-
  type_id       - datatype identifier
-  name          - symbol name
-
-

OUTPUTS

-
  value         - value of the enumeration datatype
-  hdferr        - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces were added for
-  called C functions (it is needed for Windows
-  port).  March 7, 2001
-
-

SOURCE

-
  SUBROUTINE h5tenum_valueof_f(type_id,  name, value, hdferr)
-            IMPLICIT NONE
-            INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
-            CHARACTER(LEN=*), INTENT(IN) :: name  !Name of the  enumeration datatype.
-            INTEGER, INTENT(OUT) :: value !value of the  enumeration datatype.
-            INTEGER, INTENT(OUT) :: hdferr        ! Error code
-
- -
- -

h5tequal_f

- -

[ Top ] [ H5T ] [ Subroutines ]

-

NAME

-
  h5tequal_f
-
-

PURPOSE

-
  Determines whether two datatype identifiers refer
-  to the same datatype.
-
-

INPUTS

-
  type1_id      - datatype identifier
-  type2_id      - datatype identifier
-
-

OUTPUTS

-
  flag          - TRUE/FALSE flag to indicate
-                  if two datatypes are equal
-  hdferr        - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces were added for
-  called C functions (it is needed for Windows
-  port).  March 7, 2001
-
-

SOURCE

-
  SUBROUTINE h5tequal_f(type1_id, type2_id, flag, hdferr)
-            IMPLICIT NONE
-            INTEGER(HID_T), INTENT(IN) :: type1_id ! Datatype identifier
-            INTEGER(HID_T), INTENT(IN) :: type2_id ! Datatype identifier
-            LOGICAL, INTENT(OUT) :: flag ! TRUE/FALSE flag to indicate if two
-                                         ! datatypes are equal
-            INTEGER, INTENT(OUT) :: hdferr        ! Error code
-
- -
- -

h5tget_array_dims_f

- -

[ Top ] [ H5T ] [ Subroutines ]

-

NAME

-
  h5tget_array_dims_f
-
-

PURPOSE

-
  Returns sizes of array dimensions.
-
-

INPUTS

-
  type_id       - array datatype identifier
-
-

OUTPUTS

-
  dims          - buffer to store array datatype dimensions
-  hdferr        - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces were added for
-  called C functions (it is needed for Windows
-  port).  March 7, 2001
-
-

SOURCE

-
  SUBROUTINE h5tget_array_dims_f(type_id, dims, hdferr)
-            IMPLICIT NONE
-            INTEGER(HID_T), INTENT(IN) :: type_id ! Array datatype identifier
-            INTEGER(HSIZE_T),DIMENSION(*), INTENT(OUT) ::  dims !buffer to store array datatype
-                                                                ! dimensions
-            INTEGER, INTENT(OUT) :: hdferr        ! Error code
-
- -
- -

h5tget_array_ndims_f

- -

[ Top ] [ H5T ] [ Subroutines ]

-

NAME

-
  h5tget_array_ndims_f
-
-

PURPOSE

-
  Returns the rank of an array datatype.
-
-

INPUTS

-
  type_id       - array datatype identifier
-
-

OUTPUTS

-
  ndims         - number of array dimensions
-  hdferr        - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces were added for
-  called C functions (it is needed for Windows
-  port).  March 7, 2001
-
-

SOURCE

-
  SUBROUTINE h5tget_array_ndims_f(type_id, ndims, hdferr)
-            IMPLICIT NONE
-            INTEGER(HID_T), INTENT(IN) :: type_id ! Array datatype identifier
-            INTEGER, INTENT(OUT) ::  ndims ! number of array dimensions
-            INTEGER, INTENT(OUT) :: hdferr        ! Error code
-
- -
- -

h5tget_class_f

- -

[ Top ] [ H5T ] [ Subroutines ]

-

NAME

-
  h5tget_class_f
-
-

PURPOSE

-
  Returns the datatype class identifier.
-
-

INPUTS

-
  type_id       - datatype identifier
-
-

OUTPUTS

-
  class         - class, possible values are:
-                   H5T_NO_CLASS_F (-1)
-                   H5T_INTEGER_F  (0)
-                   H5T_FLOAT_F (1)
-                   H5T_TIME_F  (2)
-                   H5T_STRING_F (3)
-                   H5T_BITFIELD_F (4)
-                   H5T_OPAQUE_F (5)
-                   H5T_COMPOUND_F (6)
-                   H5T_REFERENCE_F (7)
-                   H5T_ENUM_F (8)
-  hdferr        - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces were added for
-  called C functions (it is needed for Windows
-  port).  March 7, 2001
-
-

SOURCE

-
  SUBROUTINE h5tget_class_f(type_id, class, hdferr)
-            IMPLICIT NONE
-            INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
-            INTEGER, INTENT(OUT) :: class
-                           ! Datatype class, possible values are:
-                                          ! H5T_NO_CLASS_F (-1)
-                                          ! H5T_INTEGER_F  (0)
-                                          ! H5T_FLOAT_F (1)
-                                          ! H5T_TIME_F  (2)
-                                          ! H5T_STRING_F (3)
-                                          ! H5T_BITFIELD_F (4)
-                                          ! H5T_OPAQUE_F (5)
-                                          ! H5T_COMPOUND_F (6)
-                                          ! H5T_REFERENCE_F (7)
-                                          ! H5T_ENUM_F (8)
-          INTEGER, INTENT(OUT) :: hdferr        ! Error code
-
- -
- -

h5tget_create_plist_f

- -

[ Top ] [ H5T ] [ Subroutines ]

-

NAME

-
  h5tget_create_plist_f
-
-

PURPOSE

-
  Returns a copy of a datatype creation property list.
-
-

INPUTS

-
  dtype_id      - Datatype identifier
-
-

OUTPUTS

-
  dtpl_id       - Datatype property list identifier
-  hdferr        - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  M. Scot Breitenfeld
-  April 9, 2008
-
-

SOURCE

-
  SUBROUTINE h5tget_create_plist_f(dtype_id, dtpl_id, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: dtype_id  ! Datatype identifier
-    INTEGER(HID_T), INTENT(OUT) :: dtpl_id  ! Datatype property list identifier.
-    INTEGER, INTENT(OUT) :: hdferr       ! Error code:
-                                         ! 0 on success and -1 on failure
-
- -
- -

h5tget_cset_f

- -

[ Top ] [ H5T ] [ Subroutines ]

-

NAME

-
  h5tget_cset_f
-
-

PURPOSE

-
  Retrieves the character set type of a string datatype.
-
-

INPUTS

-
  type_id  - Datatype identifier
-
-

OUTPUTS

-
  cset     - Character set type of a string datatype
-              Possible values are:
-              H5T_CSET_ASCII_F = 0
-              H5T_CSET_UTF8_F
-  hdferr   - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces were added for
-  called C functions (it is needed for Windows
-  port).  March 7, 2001
-
-

SOURCE

-
  SUBROUTINE h5tget_cset_f(type_id, cset, hdferr)
-            IMPLICIT NONE
-            INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
-            INTEGER, INTENT(OUT) :: cset   ! character set type of a string datatype
-                                           !  Possible values are:
-                                           !  H5T_CSET_ASCII_F = 0
-                                           !  H5T_CSET_UTF8_F
-            INTEGER, INTENT(OUT) :: hdferr ! Error code
-
- -
- -

h5tget_ebias_f

- -

[ Top ] [ H5T ] [ Subroutines ]

-

NAME

-
  h5tget_ebias_f
-
-

PURPOSE

-
  Retrieves the exponent bias of a floating-point type.
-
-

INPUTS

-
  type_id       - datatype identifier
-
-

OUTPUTS

-
  ebias         - datatype exponent bias
-  hdferr        - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces were added for
-  called C functions (it is needed for Windows
-  port).  March 7, 2001
-
-

SOURCE

-
  SUBROUTINE h5tget_ebias_f(type_id, ebias, hdferr)
-            IMPLICIT NONE
-            INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
-            INTEGER(SIZE_T), INTENT(OUT) :: ebias ! Datatype exponent bias of a floating-point type
-            INTEGER, INTENT(OUT) :: hdferr        ! Error code
-
- -
- -

h5tget_fields_f

- -

[ Top ] [ H5T ] [ Subroutines ]

-

NAME

-
  h5tget_fields_f
-
-

PURPOSE

-
  Retrieves floating point datatype bit field information.
-
-

INPUTS

-
  type_id       - datatype identifier
-
-

OUTPUTS

-
  spos          - sign bit-position
-  epos          - exponent bit-position
-  esize         - size of exponent in bits
-  mpos          - mantissa position
-  msize         - size of mantissa in bits
-  hdferr        - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces were added for
-  called C functions (it is needed for Windows
-  port).  March 7, 2001
-
-

SOURCE

-
  SUBROUTINE h5tget_fields_f(type_id, spos, epos, esize, mpos, msize, hdferr)
-            IMPLICIT NONE
-            INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
-            INTEGER(SIZE_T), INTENT(OUT) :: spos   ! sign bit-position
-            INTEGER(SIZE_T), INTENT(OUT) :: epos   ! exponent bit-position
-            INTEGER(SIZE_T), INTENT(OUT) :: esize  ! size of exponent in bits
-            INTEGER(SIZE_T), INTENT(OUT) :: mpos   ! mantissa bit-position
-            INTEGER(SIZE_T), INTENT(OUT) :: msize  ! size of mantissa in bits
-            INTEGER, INTENT(OUT) :: hdferr        ! Error code
-
- -
- -

h5tget_inpad_f

- -

[ Top ] [ H5T ] [ Subroutines ]

-

NAME

-
  h5tget_inpad_f
-
-

PURPOSE

-
  Retrieves the internal padding type for unused bits
-  in floating-point datatypes.
-
-

INPUTS

-
  type_id       - datatype identifier
-
-

OUTPUTS

-
  padtype       - padding type for unused bits
-                  Possible values of padding type are:
-                    H5T_PAD_ZERO_F = 0
-                    H5T_PAD_ONE_F = 1
-                    H5T_PAD_BACKGROUND_F = 2
-  hdferr        - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces were added for
-  called C functions (it is needed for Windows
-  port).  March 7, 2001
-
-

SOURCE

-
  SUBROUTINE h5tget_inpad_f(type_id, padtype, hdferr)
-            IMPLICIT NONE
-            INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
-            INTEGER, INTENT(OUT) :: padtype ! padding type for unused bits
-                                            ! in floating-point datatypes.
-                                            ! Possible values of padding type are:
-                                            ! H5T__PAD_ZERO_F = 0
-                                            ! H5T__PAD_ONE_F = 1
-                                            ! H5T__PAD_BACKGROUND_F = 2
-
-            INTEGER, INTENT(OUT) :: hdferr        ! Error code
-
- -
- -

h5tget_member_class_f

- -

[ Top ] [ H5T ] [ Subroutines ]

-

NAME

-
  h5tget_member_class_f
-
-

PURPOSE

-
  Returns datatype class of compound datatype member.
-
-

INPUTS

-
  type_id       - datartpe identifier
-  member_no     - index of compound datatype member
-
-

OUTPUTS

-
  class         - class type for compound dadtype member
-                  Valid classes:
-                    H5T_NO_CLASS_F (error)
-                    H5T_INTEGER_F
-                    H5T_FLOAT_F
-                    H5T_TIME_F
-                    H5T_STRING_F
-                    H5T_BITFIELD_F
-                    H5T_OPAQUE_F
-                    H5T_COMPOUND_F
-                    H5T_REFERENCE_F
-                    H5T_ENUM_F
-                    H5T_VLEN_F
-                    H5T_ARRAY_F
-  hdferr        - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  Elena Pourmal
-  April 6, 2005
-
-

SOURCE

-
  SUBROUTINE h5tget_member_class_f(type_id, member_no, class, hdferr)
-            IMPLICIT NONE
-            INTEGER(HID_T), INTENT(IN) :: type_id  ! Datatype identifier
-            INTEGER, INTENT(IN)       :: member_no  ! Member number
-            INTEGER, INTENT(OUT)     :: class      ! Member class
-            INTEGER, INTENT(OUT) :: hdferr      ! Error code
-
- -
- -

h5tget_member_index_f

- -

[ Top ] [ H5T ] [ Subroutines ]

-

NAME

-
  h5tget_member_index_f
-
-

PURPOSE

-
  Retrieves the index of a compound or enumeration datatype member.
-
-

INPUTS

-
  type_id       - datatype identifier
-  name          - name of the field or member whose index to
-  to be retrieved from the datatype.
-
-

OUTPUTS

-
  index         - 0-based index of the filed or member (0 to N-1)
-  hdferr        - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  Elena Pourmal
-  September 26, 2002
-
-

SOURCE

-
  SUBROUTINE h5tget_member_index_f(type_id, name, index, hdferr)
-            IMPLICIT NONE
-            INTEGER(HID_T), INTENT(IN) :: type_id  ! Datatype identifier
-            CHARACTER(LEN=*), INTENT(IN) :: name   ! Field or member name
-            INTEGER, INTENT(OUT) :: index          ! Field or member index
-            INTEGER, INTENT(OUT) :: hdferr          ! Error code
-
- -
- -

h5tget_member_name_f

- -

[ Top ] [ H5T ] [ Subroutines ]

-

NAME

-
  h5tget_member_name_f
-
-

PURPOSE

-
  Retrieves the name of a field of a compound datatype.
-
-

INPUTS

-
  type_id       - datatype identifier
-  index         - filed index (0-based)
-
-

OUTPUTS

-
  member_name   - buffer to hold member's name
-  namelen       - name length
-  hdferr        - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces were added for
-  called C functions (it is needed for Windows
-  port).  March 7, 2001
-
-

SOURCE

-
  SUBROUTINE h5tget_member_name_f(type_id, index, member_name,  namelen, hdferr)
-            IMPLICIT NONE
-            INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
-            INTEGER, INTENT(IN) :: index !Field index (0-based) of the field name to retrieve
-            CHARACTER(LEN=*), INTENT(OUT) :: member_name !name of a field of
-                                                         !a compound datatype
-            INTEGER, INTENT(OUT) :: namelen ! Length of the name
-            INTEGER, INTENT(OUT) :: hdferr        ! Error code
-
- -
- -

h5tget_member_offset_f

- -

[ Top ] [ H5T ] [ Subroutines ]

-

NAME

-
  h5tget_member_offset_f
-
-

PURPOSE

-
  Retrieves the offset of a field of a compound datatype.
-
-

INPUTS

-
  type_id       - datatype identifier
-  member_no     - number of the field
-
-

OUTPUTS

-
  offset        - byte offset of the requested field
-  hdferr        - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces were added for
-  called C functions (it is needed for Windows
-  port).  March 7, 2001
-
-

SOURCE

-
  SUBROUTINE h5tget_member_offset_f(type_id, member_no, offset, hdferr)
-            IMPLICIT NONE
-            INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
-            INTEGER, INTENT(IN) :: member_no !Number of the field
-                                                       !whose offset is requested
-            INTEGER(SIZE_T), INTENT(OUT) :: offset !byte offset of the beginning of the field
-            INTEGER, INTENT(OUT) :: hdferr        ! Error code
-
- -
- -

h5tget_member_type_f

- -

[ Top ] [ H5T ] [ Subroutines ]

-

NAME

-
  h5tget_member_type_f
-
-

PURPOSE

-
  Returns the datatype of the specified member.
-
-

INPUTS

-
  type_id       - compound datatype identifier
-  field_idx     - field index (0-based)
-
-

OUTPUTS

-
  datatype      - idnetifier of the member's datatype
-  hdferr        - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces were added for
-  called C functions (it is needed for Windows
-  port).  March 7, 2001
-
-

SOURCE

-
  SUBROUTINE h5tget_member_type_f(type_id,  field_idx, datatype, hdferr)
-            IMPLICIT NONE
-            INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
-            INTEGER, INTENT(IN) :: field_idx !Field index (0-based) of the field type to retrieve
-            INTEGER(HID_T), INTENT(OUT) :: datatype !identifier of a copy of
-                                                    !the datatype of the field
-            INTEGER, INTENT(OUT) :: hdferr        ! Error code
-
- -
- -

h5tget_member_value_f

- -

[ Top ] [ H5T ] [ Subroutines ]

-

NAME

-
  h5tget_member_value_f
-
-

PURPOSE

-
  Returns the value of an enumeration datatype member.
-
-

INPUTS

-
  type_id       - datatype identifier
-  member_no     - number of the enumeration datatype member
-
-

OUTPUTS

-
  value         - value of the enumeration datatype
-  hdferr        - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces were added for
-  called C functions (it is needed for Windows
-  port).  March 7, 2001
-
-

SOURCE

-
  SUBROUTINE h5tget_member_value_f(type_id,  member_no, value, hdferr)
-            IMPLICIT NONE
-            INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
-            INTEGER, INTENT(IN) :: member_no !Number of the enumeration datatype member
-            INTEGER, INTENT(OUT) :: value !value of the  enumeration datatype.
-            INTEGER, INTENT(OUT) :: hdferr        ! Error code
-
- -
- -

h5tget_native_type_f

- -

[ Top ] [ H5T ] [ Subroutines ]

-

NAME

-
  h5tget_native_type_f
-
-

PURPOSE

-
  Returns the native datatype of a specified datatype.
-
-

INPUTS

-
  dtype_id      - Datatype identifier for the dataset datatype.
-  
-  direction     - Direction of search:
-                  H5T_DIR_DEFAULT     = 0,    /*default direction is inscendent */
-                  H5T_DIR_ASCEND      = 1,    /*in inscendent order             */
-                  H5T_DIR_DESCEND     = 2     /*in descendent order             */
-  * NOTE: In C it is defined as a structure: H5T_direction_t
-
-

OUTPUTS

-
  native_dtype_id - The native datatype identifier for the specified dataset datatype
-  hdferr          - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  M. Scot Breitenfeld
-  June 18, 2008
-
-

SOURCE

-
  SUBROUTINE h5tget_native_type_f(dtype_id, direction, native_dtype_id, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: dtype_id  ! Datatype identifier
-    INTEGER, INTENT(IN) :: direction  ! Direction of search:
-                                      ! H5T_DIR_ASCEND_F      = 1  in inscendent order
-                                      ! H5T_DIR_DESCEND_F     = 2  in descendent order
-    INTEGER(HID_T), INTENT(OUT) :: native_dtype_id  ! The native datatype identifier
-    INTEGER, INTENT(OUT) :: hdferr    ! Error code:
-                                      ! 0 on success and -1 on failure
-
- -
- -

h5tget_nmembers_f

- -

[ Top ] [ H5T ] [ Subroutines ]

-

NAME

-
  h5tget_nmembers_f
-
-

PURPOSE

-
  Retrieves the number of fields in a compound datatype.
-
-

INPUTS

-
  type_id       - datatype identifier
-
-

OUTPUTS

-
  num_members   - number of members
-  hdferr        - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces were added for
-  called C functions (it is needed for Windows
-  port).  March 7, 2001
-
-

SOURCE

-
  SUBROUTINE h5tget_nmembers_f(type_id, num_members, hdferr)
-            IMPLICIT NONE
-            INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
-            INTEGER, INTENT(OUT) :: num_members !number of fields in a compound datatype
-            INTEGER, INTENT(OUT) :: hdferr        ! Error code
-
- -
- -

h5tget_norm_f

- -

[ Top ] [ H5T ] [ Subroutines ]

-

NAME

-
  h5tget_norm_f
-
-

PURPOSE

-
  Retrieves mantissa normalization of a floating-point
-  datatype.
-
-

INPUTS

-
  type_id       - datatype identifier
-
-

OUTPUTS

-
  norm          - normalization types, valid values are:
-                    H5T_NORM_IMPLIED_F(0)
-                    H5T_NORM_MSBSET_F(1)
-                    H5T_NORM_NONE_F(2)
-  hdferr        - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces were added for
-  called C functions (it is needed for Windows
-  port).  March 7, 2001
-
-

SOURCE

-
  SUBROUTINE h5tget_norm_f(type_id, norm, hdferr)
-            IMPLICIT NONE
-            INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
-            INTEGER, INTENT(OUT) :: norm !mantissa normalization of a floating-point datatype
-                                         !Valid normalization types are:
-                                         !H5T_NORM_IMPLIED_F(0),MSB of mantissa is not
-                                         !stored, always 1,  H5T_NORM_MSBSET_F(1), MSB of
-                                         !mantissa is always 1, H5T_NORM_NONE_F(2)
-                                         !Mantissa is not normalize
-            INTEGER, INTENT(OUT) :: hdferr        ! Error code
-
- -
- -

h5tget_offset_f

- -

[ Top ] [ H5T ] [ Subroutines ]

-

NAME

-
  h5tget_offset_f
-
-

PURPOSE

-
  Retrieves the bit offset of the first significant bit.
-
-

INPUTS

-
  type_id       - datatype identifier
-
-

OUTPUTS

-
  offset        - offset value
-  hdferr        - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces were added for
-  called C functions (it is needed for Windows
-  port).  March 7, 2001
-
-

SOURCE

-
  SUBROUTINE h5tget_offset_f(type_id, offset, hdferr)
-            IMPLICIT NONE
-            INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
-            INTEGER(SIZE_T), INTENT(OUT) :: offset ! Datatype bit offset of the
-                                           ! first significant bit
-            INTEGER, INTENT(OUT) :: hdferr        ! Error code
-
- -
- -

h5tget_order_f

- -

[ Top ] [ H5T ] [ Subroutines ]

-

NAME

-
  h5tget_order_f
-
-

PURPOSE

-
  Returns the byte order of an atomic datatype.
-
-

INPUTS

-
  type_id       - datatype identifier
-
-

OUTPUTS

-
  order         - byte order for the datatype, possible
-                  values are:
-                    H5T_ORDER_LE_F
-                    H5T_ORDER_BE_F
-                    H5T_ORDER_VAX_F (not implemented yet)
-  hdferr        - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces were added for
-  called C functions (it is needed for Windows
-  port).  March 7, 2001
-
-

SOURCE

-
  SUBROUTINE h5tget_order_f(type_id, order, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
-    INTEGER, INTENT(OUT) :: order
-                                    ! Datatype byte order, possible values are:
-                                    ! H5T_ORDER_LE_F
-                                    ! H5T_ORDER_BE_F
-                                    ! H5T_ORDER_VAX_F
-    INTEGER, INTENT(OUT) :: hdferr  ! Error code
-
- -
- -

h5tget_pad_f

- -

[ Top ] [ H5T ] [ Subroutines ]

-

NAME

-
  h5tget_pad_f
-
-

PURPOSE

-
  Retrieves the padding type of the least and
-  most          -significant bit padding.
-
-

INPUTS

-
  type_id       - datatype identifier
-
-

OUTPUTS

-
  lsbpad        - least-significant bit padding type
-  msbpad        - most-significant bit padding type
-                  Possible values of padding type are:
-                    H5T_PAD_ERROR_F      = -1
-                    H5T_PAD_ZERO_F = 0
-                    H5T_PAD_ONE_F = 1
-                    H5T_PAD_BACKGROUND_F = 2
-                    H5T_PAD_NPAD_F      = 3
-  hdferr        - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces were added for
-  called C functions (it is needed for Windows
-  port).  March 7, 2001
-
-

SOURCE

-
  SUBROUTINE h5tget_pad_f(type_id, lsbpad, msbpad, hdferr)
-            IMPLICIT NONE
-            INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
-            INTEGER, INTENT(OUT) :: lsbpad ! padding type of the
-                                           ! least significant bit
-            INTEGER, INTENT(OUT) :: msbpad ! padding type of the
-                                           ! most significant bit
-                                           ! Possible values of padding type are:
-                                           ! H5T__PAD_ZERO_F = 0
-                                           ! H5T__PAD_ONE_F = 1
-                                           ! H5T__PAD_BACKGROUND_F = 2
-                                           ! H5T_PAD_ERROR_F      = -1
-                                           ! H5T_PAD_NPAD_F      = 3
-
-            INTEGER, INTENT(OUT) :: hdferr        ! Error code
-
- -
- -

h5tget_precision_f

- -

[ Top ] [ H5T ] [ Subroutines ]

-

NAME

-
  h5tget_precision_f
-
-

PURPOSE

-
  Returns the precision of an atomic datatype.
-
-

INPUTS

-
  type_id       - datatype identifier
-
-

OUTPUTS

-
  precision     - precision of the datatype
-  hdferr        - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces were added for
-  called C functions (it is needed for Windows
-  port).  March 7, 2001
-
-

SOURCE

-
  SUBROUTINE h5tget_precision_f(type_id, precision, hdferr)
-            IMPLICIT NONE
-            INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
-            INTEGER(SIZE_T), INTENT(OUT) :: precision ! Datatype precision
-            INTEGER, INTENT(OUT) :: hdferr        ! Error code
-
- -
- -

h5tget_sign_f

- -

[ Top ] [ H5T ] [ Subroutines ]

-

NAME

-
  h5tget_sign_f
-
-

PURPOSE

-
  Retrieves the sign type for an integer type.
-
-

INPUTS

-
  type_id       - datatype identifier
-
-

OUTPUTS

-
  sign          - sign type
-                  Possible values are:
-                    - Unsigned integer type 
-                        H5T_SGN_NONE_F = 0
-                    - Two's complement signed integer type
-                        H5T_SGN_2_F = 1
-                    - error value: H5T_SGN_ERROR_F=-1
-  hdferr        - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces were added for
-  called C functions (it is needed for Windows
-  port).  March 7, 2001
-
-

SOURCE

-
  SUBROUTINE h5tget_sign_f(type_id, sign, hdferr)
-            IMPLICIT NONE
-            INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
-            INTEGER, INTENT(OUT) :: sign ! sign type for an integer type
-                                         !possible values are:
-                                         !Unsigned integer type H5T_SGN_NONE_F = 0
-                                         !Two's complement signed integer type
-                                         !H5T_SGN_2_F = 1
-                                         !or error value: H5T_SGN_ERROR_F=-1
-            INTEGER, INTENT(OUT) :: hdferr        ! Error code
-
- -
- -

h5tget_size_f

- -

[ Top ] [ H5T ] [ Subroutines ]

-

NAME

-
  h5tget_size_f
-
-

PURPOSE

-
  Returns the size of a datatype.
-
-

INPUTS

-
  type_id       - datatype identifier
-
-

OUTPUTS

-
  size          - datatype size
-  hdferr        - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces were added for
-  called C functions (it is needed for Windows
-  port).  March 7, 2001
-
-

SOURCE

-
  SUBROUTINE h5tget_size_f(type_id, size, hdferr)
-            IMPLICIT NONE
-            INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
-            INTEGER(SIZE_T), INTENT(OUT) :: size ! Datatype size
-            INTEGER, INTENT(OUT) :: hdferr        ! Error code
-
- -
- -

h5tget_strpad_f

- -

[ Top ] [ H5T ] [ Subroutines ]

-

NAME

-
  h5tget_strpad_f
-
-

PURPOSE

-
  Retrieves the storage mechanism for a string datatype.
-
-

INPUTS

-
  type_id       - datatype identifier
-
-

OUTPUTS

-
  strpad        - storage method for a string datatype
-                  Possible values are:
-                    H5T_STR_NULLTERM_F,
-                    H5T_STR_NULLPAD_F,
-                    H5T_STR_SPACEPAD_F
-                    H5T_STR_ERROR_F
-  hdferr        - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces were added for
-  called C functions (it is needed for Windows
-  port).  March 7, 2001
-
-

SOURCE

-
  SUBROUTINE h5tget_strpad_f(type_id, strpad, hdferr)
-            IMPLICIT NONE
-            INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
-            INTEGER, INTENT(OUT) :: strpad
-            INTEGER, INTENT(OUT) :: hdferr        ! Error code
-
- -
- -

h5tget_super_f

- -

[ Top ] [ H5T ] [ Subroutines ]

-

NAME

-
  h5tget_super_f
-
-

PURPOSE

-
  Returns the base datatype from which a datatype is derived.
-
-

INPUTS

-
  type_id       - datatype identifier
-
-

OUTPUTS

-
  base_type_id          - identifier of the base type
-  hdferr        - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces were added for
-  called C functions (it is needed for Windows
-  port).  March 7, 2001
-
-

SOURCE

-
  SUBROUTINE h5tget_super_f(type_id, base_type_id, hdferr)
-            IMPLICIT NONE
-            INTEGER(HID_T), INTENT(IN) :: type_id ! datatype identifier
-            INTEGER(HID_T), INTENT(OUT) :: base_type_id ! identifier of the datatype
-                                           ! from which datatype (type_id) was derived
-            INTEGER, INTENT(OUT) :: hdferr        ! Error code
-
- -
- -

h5tget_tag_f

- -

[ Top ] [ H5T ] [ Subroutines ]

-

NAME

-
  h5tget_tag_f
-
-

PURPOSE

-
  Gets the tag associated with an opaque datatype.
-
-

INPUTS

-
  type_id       - identifier for opaque datatype
-
-

OUTPUTS

-
  tag           - unique ASCII string associated with opaque
-                  datatype
-  hdferr        - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces were added for
-  called C functions (it is needed for Windows
-  port).  March 7, 2001
-
-

SOURCE

-
  SUBROUTINE h5tget_tag_f(type_id, tag,taglen, hdferr)
-            IMPLICIT NONE
-            INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
-            CHARACTER(LEN=*), INTENT(OUT) :: tag  ! Unique ASCII string with which
-                                                  !  the opaque datatype is to be tagged
-            INTEGER, INTENT(OUT) :: taglen        ! Length of tag
-            INTEGER(SIZE_T)      :: tag_size      ! Declared character length of tab 
-            INTEGER, INTENT(OUT) :: hdferr        ! Error code
-
- -
- -

h5tinsert_f

- -

[ Top ] [ H5T ] [ Subroutines ]

-

NAME

-
  h5tinsert_f
-
-

PURPOSE

-
  Adds a new member to a compound datatype.
-
-

INPUTS

-
  type_id       - compound dattype identifier
-  name          - name of the field to insert
-  offset        - start of the member in an instance of
-                  the compound datatype
-  field_id      - datatype identifier of the field to insert
-
-

OUTPUTS

-
  hdferr        - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces were added for
-  called C functions (it is needed for Windows
-  port).  March 7, 2001
-
-

SOURCE

-
  SUBROUTINE h5tinsert_f(type_id,  name, offset, field_id, hdferr)
-            IMPLICIT NONE
-            INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
-            CHARACTER(LEN=*), INTENT(IN) :: name !Name of the field to insert
-            INTEGER(SIZE_T), INTENT(IN) :: offset !start of the member in an instance of
-                                                   !the compound datatype
-            INTEGER(HID_T), INTENT(IN) :: field_id !datatype identifier of the new member
-
-            INTEGER, INTENT(OUT) :: hdferr        ! Error code
-
- -
- -

h5tis_variable_str_f

- -

[ Top ] [ H5T ] [ Subroutines ]

-

NAME

-
  h5tis_variable_str_f
-
-

PURPOSE

-
  Determines whether a dattype is a variable string.
-
-

INPUTS

-
  type_id       - datartpe identifier
-
-

OUTPUTS

-
  status        - flag to indicate if datatype
-                  is a variable string
-  hdferr        - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  Elena Pourmal
-  March 12, 2003
-
-

SOURCE

-
  SUBROUTINE h5tis_variable_str_f(type_id, status, hdferr)
-            IMPLICIT NONE
-            INTEGER(HID_T), INTENT(IN) :: type_id  ! Datatype identifier
-            LOGICAL, INTENT(OUT) :: status      ! Flag, idicates if datatype
-                                                ! is a variable string or not ( TRUE or
-                                                ! FALSE)
-            INTEGER, INTENT(OUT) :: hdferr      ! Error code
-
- -
- -

h5topen_f

- -

[ Top ] [ H5T ] [ Subroutines ]

-

NAME

-
  h5topen_f
-
-

PURPOSE

-
  Opens named datatype.
-
-

INPUTS

-
  loc_id        - location identifier
-  name          - a datatype name
-
-

OUTPUTS

-
  type_id       - datatype identifier
-  hdferr        - Returns 0 if successful and -1 if fails
-
-

OPTIONAL PARAMETERS

-
  tapl_id       - datatype access property list identifier.
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces were added for
-  called C functions (it is needed for Windows
-  port).  March 7, 2001
-
-  Added optional parameter 'tapl_id' for compatability
-  with H5Topen2. April 9, 2009.
-
-

SOURCE

-
  SUBROUTINE h5topen_f(loc_id, name, type_id, hdferr, tapl_id)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: loc_id  ! File or group identifier
-    CHARACTER(LEN=*), INTENT(IN) :: name ! Datatype name within file or group
-    INTEGER(HID_T), INTENT(OUT) :: type_id  ! Datatype identifier
-    INTEGER, INTENT(OUT) :: hdferr ! Error code
-    INTEGER(HID_T), OPTIONAL, INTENT(IN) :: tapl_id ! datatype access property list identifier
-
- -
- -

h5tpack_f

- -

[ Top ] [ H5T ] [ Subroutines ]

-

NAME

-
  h5tpack_f
-
-

PURPOSE

-
  Recursively removes padding from within a compound datatype.
-
-

INPUTS

-
  type_id       - compound datatype identifier
-
-

OUTPUTS

-
  hdferr        - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces were added for
-  called C functions (it is needed for Windows
-  port).  March 7, 2001
-
-

SOURCE

-
  SUBROUTINE h5tpack_f(type_id, hdferr)
-            IMPLICIT NONE
-            INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
-            INTEGER, INTENT(OUT) :: hdferr        ! Error code
-
- -
- -

h5tset_cset_f

- -

[ Top ] [ H5T ] [ Subroutines ]

-

NAME

-
  h5tset_cset_f
-
-

PURPOSE

-
  Sets character set to be used.
-
-

INPUTS

-
  type_id       - datatype identifier
-  cset          - character set type of a string datatype
-                    Possible values are:
-                     H5T_CSET_ASCII_F = 0
-                     H5T_CSET_UTF8_F
-
-

OUTPUTS

-
  hdferr        - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces were added for
-  called C functions (it is needed for Windows
-  port).  March 7, 2001
-
-

SOURCE

-
  SUBROUTINE h5tset_cset_f(type_id, cset, hdferr)
-            IMPLICIT NONE
-            INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
-            INTEGER, INTENT(IN) :: cset !character set type of a string datatype
-                                           ! Possible values of padding type are:
-                                           ! H5T_CSET_ASCII_F = 0
-                                           ! H5T_CSET_UTF8_F
-            INTEGER, INTENT(OUT) :: hdferr        ! Error code
-
- -
- -

h5tset_ebias_f

- -

[ Top ] [ H5T ] [ Subroutines ]

-

NAME

-
  h5tset_ebias_f
-
-

PURPOSE

-
  Sets the exponent bias of a floating-point type.
-
-

INPUTS

-
  type_id       - datatype identifier
-  ebias         - datatype exponent bias
-
-

OUTPUTS

-
  hdferr        - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces were added for
-  called C functions (it is needed for Windows
-  port).  March 7, 2001
-
-

SOURCE

-
  SUBROUTINE h5tset_ebias_f(type_id, ebias, hdferr)
-            IMPLICIT NONE
-            INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
-            INTEGER(SIZE_T), INTENT(IN) :: ebias !Datatype exponent bias of a floating-point type
-            INTEGER, INTENT(OUT) :: hdferr        ! Error code
-
- -
- -

h5tset_fields_f

- -

[ Top ] [ H5T ] [ Subroutines ]

-

NAME

-
  h5tset_fields_f
-
-

PURPOSE

-
  Sets locations and sizes of floating point bit fields.
-
-

INPUTS

-
  type_id       - datatype identifier
-  spos          - sign bit-position
-  epos          - exponent bit-position
-  esize         - size of exponent in bits
-  mpos          - mantissa position
-  msize         - size of mantissa in bits
-
-

OUTPUTS

-
  hdferr        - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces were added for
-  called C functions (it is needed for Windows
-  port).  March 7, 2001
-
-

SOURCE

-
  SUBROUTINE h5tset_fields_f(type_id, spos, epos, esize, mpos, msize, hdferr)
-            IMPLICIT NONE
-            INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
-            INTEGER(SIZE_T), INTENT(IN) :: spos   ! sign bit-position
-            INTEGER(SIZE_T), INTENT(IN) :: epos   ! exponent bit-position
-            INTEGER(SIZE_T), INTENT(IN) :: esize  ! size of exponent in bits
-            INTEGER(SIZE_T), INTENT(IN) :: mpos   ! mantissa bit-position
-            INTEGER(SIZE_T), INTENT(IN) :: msize  ! size of mantissa in bits
-            INTEGER, INTENT(OUT) :: hdferr        ! Error code
-
- -
- -

h5tset_inpad_f

- -

[ Top ] [ H5T ] [ Subroutines ]

-

NAME

-
  h5tset_inpad_f
-
-

PURPOSE

-
  Fills unused internal floating point bits.
-
-

INPUTS

-
  type_id       - datatype identifier
-  padtype       - padding type for unused bits
-                  Possible values of padding type are:
-                    H5T_PAD_ZERO_F = 0
-                    H5T_PAD_ONE_F = 1
-                    H5T_PAD_BACKGROUND_F = 2
-
-

OUTPUTS

-
  hdferr        - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces were added for
-  called C functions (it is needed for Windows
-  port).  March 7, 2001
-
-

SOURCE

-
  SUBROUTINE h5tset_inpad_f(type_id, padtype, hdferr)
-            IMPLICIT NONE
-            INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
-            INTEGER, INTENT(IN) :: padtype ! padding type for unused bits
-                                           ! in floating-point datatypes.
-                                           ! Possible values of padding type are:
-                                           ! H5T__PAD_ZERO_F = 0
-                                           ! H5T__PAD_ONE_F = 1
-                                           ! H5T__PAD_BACKGROUND_F = 2
-            INTEGER, INTENT(OUT) :: hdferr        ! Error code
-
- -
- -

h5tset_norm_f

- -

[ Top ] [ H5T ] [ Subroutines ]

-

NAME

-
  h5tset_norm_f
-
-

PURPOSE

-
  Sets the mantissa normalization of a floating-point datatype.
-
-

INPUTS

-
  type_id       - datatype identifier
-  norm          - normalization types, valid values are:
-                    H5T_NORM_IMPLIED_F(0)
-                    H5T_NORM_MSBSET_F(1)
-                    H5T_NORM_NONE_F(2)
-
-

OUTPUTS

-
  hdferr        - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces were added for
-  called C functions (it is needed for Windows
-  port).  March 7, 2001
-
-

SOURCE

-
  SUBROUTINE h5tset_norm_f(type_id, norm, hdferr)
-            IMPLICIT NONE
-            INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
-            INTEGER, INTENT(IN) :: norm !mantissa normalization of a floating-point datatype
-                                         !Valid normalization types are:
-                                         !H5T_NORM_IMPLIED_F(0),MSB of mantissa is not
-                                         !stored, always 1,  H5T_NORM_MSBSET_F(1), MSB of
-                                         !mantissa is always 1, H5T_NORM_NONE_F(2)
-                                         !Mantissa is not normalize
-            INTEGER, INTENT(OUT) :: hdferr        ! Error code
-
- -
- -

h5tset_offset_f

- -

[ Top ] [ H5T ] [ Subroutines ]

-

NAME

-
  h5tset_offset_f
-
-

PURPOSE

-
  Sets the bit offset of the first significant bit.
-
-

INPUTS

-
  type_id       - datatype identifier
-  offset        - offset value
-
-

OUTPUTS

-
  hdferr        - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces were added for
-  called C functions (it is needed for Windows
-  port).  March 7, 2001
-
-

SOURCE

-
  SUBROUTINE h5tset_offset_f(type_id, offset, hdferr)
-            IMPLICIT NONE
-            INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
-            INTEGER(SIZE_T), INTENT(IN) :: offset ! Datatype bit offset of the
-                                           ! first significant bit
-            INTEGER, INTENT(OUT) :: hdferr        ! Error code
-
- -
- -

h5tset_order_f

- -

[ Top ] [ H5T ] [ Subroutines ]

-

NAME

-
  h5tset_order_f
-
-

PURPOSE

-
  Sets the byte ordering of an atomic datatype.
-
-

INPUTS

-
  type_id       - datatype identifier
-  order         - datatype byte order Possible values are:
-                    H5T_ORDER_LE_F
-                    H5T_ORDER_BE_F
-                    H5T_ORDER_VAX_F (not implemented yet)
-
-

OUTPUTS

-
  hdferr        - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces were added for
-  called C functions (it is needed for Windows
-  port).  March 7, 2001
-
-

SOURCE

-
  SUBROUTINE h5tset_order_f(type_id, order, hdferr)
-    IMPLICIT NONE
-    INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
-    INTEGER, INTENT(IN) :: order   ! Datatype byte order, possible values
-                                   ! are:
-                                   ! H5T_ORDER_LE_F
-                                   ! H5T_ORDER_BE_F
-                                   ! H5T_ORDER_VAX_F
-    INTEGER, INTENT(OUT) :: hdferr ! Error code
-
- -
- -

h5tset_pad_f

- -

[ Top ] [ H5T ] [ Subroutines ]

-

NAME

-
  h5tset_pad_f
-
-

PURPOSE

-
  Sets the least and most-significant bits padding types.
-
-

INPUTS

-
  type_id       - datatype identifier
-  lsbpad        - least-significant bit padding type
-  msbpad        - most-significant bit padding type
-                  Possible values of padding type are:
-                    H5T_PAD_ERROR_F      = -1
-                    H5T_PAD_ZERO_F = 0
-                    H5T_PAD_ONE_F = 1
-                    H5T_PAD_BACKGROUND_F = 2
-                    H5T_PAD_NPAD_F      = 3
-
-

OUTPUTS

-
  hdferr        - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces were added for
-  called C functions (it is needed for Windows
-  port).  March 7, 2001
-
-

SOURCE

-
  SUBROUTINE h5tset_pad_f(type_id, lsbpad, msbpad, hdferr)
-            IMPLICIT NONE
-            INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
-            INTEGER, INTENT(IN) :: lsbpad ! padding type of the
-                                           ! least significant bit
-            INTEGER, INTENT(IN) :: msbpad ! padding type of the
-                                           ! most significant bit
-                                           ! Possible values of padding type are:
-                                           ! H5T_PAD_ZERO_F = 0
-                                           ! H5T_PAD_ONE_F = 1
-                                           ! H5T_PAD_BACKGROUND_F = 2
-                                           ! H5T_PAD_ERROR_F      = -1
-                                           ! H5T_PAD_NPAD_F      = 3
-            INTEGER, INTENT(OUT) :: hdferr        ! Error code
-
- -
- -

h5tset_precision_f

- -

[ Top ] [ H5T ] [ Subroutines ]

-

NAME

-
  h5tset_precision_f
-
-

PURPOSE

-
  Sets the precision of an atomic datatype.
-
-

INPUTS

-
  type_id       - datatype identifier
-  precision     - datatype precision
-
-

OUTPUTS

-
  hdferr        - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces were added for
-  called C functions (it is needed for Windows
-  port).  March 7, 2001
-
-

SOURCE

-
  SUBROUTINE h5tset_precision_f(type_id, precision, hdferr)
-            IMPLICIT NONE
-            INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
-            INTEGER(SIZE_T), INTENT(IN) :: precision ! Datatype precision
-            INTEGER, INTENT(OUT) :: hdferr        ! Error code
-
- -
- -

h5tset_sign_f

- -

[ Top ] [ H5T ] [ Subroutines ]

-

NAME

-
  h5tset_sign_f
-
-

PURPOSE

-
  Sets the sign proprety for an integer type.
-
-

INPUTS

-
  type_id       - datatype identifier
-  sign          - sign type
-                  Possible values are:
-                    - Unsigned integer type 
-                        H5T_SGN_NONE_F = 0
-                    - Two's complement signed integer type
-                        H5T_SGN_2_F = 1
-                    - error value: H5T_SGN_ERROR_F=-1
-
-

OUTPUTS

-
  hdferr        - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces were added for
-  called C functions (it is needed for Windows
-  port).  March 7, 2001
-
-

SOURCE

-
  SUBROUTINE h5tset_sign_f(type_id, sign, hdferr)
-            IMPLICIT NONE
-            INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
-            INTEGER, INTENT(IN) :: sign !sign type for an integer type
-                                         !possible values are:
-                                         !Unsigned integer type H5T_SGN_NONE_F = 0
-                                         !Two's complement signed integer type
-                                         !H5T_SGN_2_F = 1
-                                         !or error value: H5T_SGN_ERROR_F=-1
-            INTEGER, INTENT(OUT) :: hdferr        ! Error code
-
- -
- -

h5tset_size_f

- -

[ Top ] [ H5T ] [ Subroutines ]

-

NAME

-
  h5tset_size_f
-
-

PURPOSE

-
  Sets the total size for an atomic datatype.
-
-

INPUTS

-
  type_id       - datatype identifier
-  size          - size of the datatype
-
-

OUTPUTS

-
  hdferr        - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces were added for
-  called C functions (it is needed for Windows
-  port).  March 7, 2001
-
-

SOURCE

-
  SUBROUTINE h5tset_size_f(type_id, size, hdferr)
-            IMPLICIT NONE
-            INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
-            INTEGER(SIZE_T), INTENT(IN) :: size ! Datatype size
-            INTEGER, INTENT(OUT) :: hdferr        ! Error code
-
- -
- -

h5tset_strpad_f

- -

[ Top ] [ H5T ] [ Subroutines ]

-

NAME

-
  h5tset_strpad_f
-
-

PURPOSE

-
  Defines the storage mechanism for character strings.
-
-

INPUTS

-
  type_id       - datatype identifier
-  strpad        - storage method for a string datatype
-                  Possible values are:
-                    H5T_STR_NULLTERM_F,
-                    H5T_STR_NULLPAD_F,
-                    H5T_STR_SPACEPAD_F
-                    H5T_STR_ERROR_F
-
-

OUTPUTS

-
  hdferr        - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces were added for
-  called C functions (it is needed for Windows
-  port).  March 7, 2001
-
-

SOURCE

-
  SUBROUTINE h5tset_strpad_f(type_id, strpad, hdferr)
-            IMPLICIT NONE
-            INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
-            INTEGER, INTENT(IN) :: strpad ! string padding method for a string datatype
-            INTEGER, INTENT(OUT) :: hdferr        ! Error code
-
- -
- -

h5tset_tag_f

- -

[ Top ] [ H5T ] [ Subroutines ]

-

NAME

-
  h5tset_tag_f
-
-

PURPOSE

-
  Tags an opaque datatype.
-
-

INPUTS

-
  type_id       - identifier for opaque datatype
-  tag           - unique ASCII string with which the opaque
-                  datatype is to be tagged.
-
-

OUTPUTS

-
  hdferr        - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces were added for
-  called C functions (it is needed for Windows
-  port).  March 7, 2001
-
-

SOURCE

-
  SUBROUTINE h5tset_tag_f(type_id, tag, hdferr)
-            IMPLICIT NONE
-            INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
-            CHARACTER(LEN=*), INTENT(IN) :: tag !Unique ASCII string with which
-                                                !the opaque datatype is to be tagged
-            INTEGER, INTENT(OUT) :: hdferr        ! Error code
-
- -
- -

h5tvlen_create_f

- -

[ Top ] [ H5T ] [ Subroutines ]

-

NAME

-
  h5tvlen_create_f
-
-

PURPOSE

-
  Creates a new variable-length datatype.
-
-

INPUTS

-
  type_id       - identifier iof base datatype
-
-

OUTPUTS

-
  vltype_id     - identifier for VL datatype
-  hdferr        - Returns 0 if successful and -1 if fails
-
-

AUTHOR

-
  Elena Pourmal
-  Wednesday, October 23, 2002
-
-

NOTES

-
  Only basic Fortran base datatypes are supported
-
-

SOURCE

-
  SUBROUTINE h5tvlen_create_f(type_id, vltype_id, hdferr)
-            IMPLICIT NONE
-            INTEGER(HID_T), INTENT(IN)  :: type_id    ! Datatype identifier
-            INTEGER(HID_T), INTENT(OUT) :: vltype_id  ! VL datatype identifier
-            INTEGER, INTENT(OUT) :: hdferr            ! Error code
-
- -
- - - diff --git a/fortran/doc/DevelGuide/src/H5Zf_c.html b/fortran/doc/DevelGuide/src/H5Zf_c.html deleted file mode 100644 index 2973548..0000000 --- a/fortran/doc/DevelGuide/src/H5Zf_c.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - -./src/H5Zf.c - - - - - -
-
- -

H5Zf

- -

[ Top ] [ Modules ]

-

PURPOSE

-
   This file contains C stubs for H5Z Fortran APIs
-
- -
- - - diff --git a/fortran/doc/DevelGuide/src/H5Zff_f90.html b/fortran/doc/DevelGuide/src/H5Zff_f90.html deleted file mode 100644 index 8ccd0ae..0000000 --- a/fortran/doc/DevelGuide/src/H5Zff_f90.html +++ /dev/null @@ -1,173 +0,0 @@ - - - - - - - -./src/H5Zff.f90 - - - - - -
-
- -

H5Z

- -

[ Top ] [ Modules ]

-

NAME

-
  MODULE H5Z
-
-

PURPOSE

-
  This file contains Fortran interfaces for H5Z functions. It includes
-  all the functions that are independent on whether the Fortran 2003 functions
-  are enabled or disabled.
-
-

NOTES

-
                         *** IMPORTANT ***
-  If you add a new H5Z function you must add the function name to the
-  Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory.
-  This is needed for Windows based operating systems.
-
- -
- -

h5zfilter_avail_f

- -

[ Top ] [ H5Z ] [ Subroutines ]

-

NAME

-
  h5zfilter_avail_f
-
-

PURPOSE

-
  Queries if filter is available
-
-

INPUTS

-
  filter        - filter
-
-

OUTPUTS

-
  status        - status; .TRUE. if filter is available,
-                  .FALSE. otherwise
-  hdferr:       - error code
-                   Success:  0
-                   Failure: -1
-
-

AUTHOR

-
  Elena Pourmal
-  March 12, 2003
-
-

SOURCE

-
  SUBROUTINE h5zfilter_avail_f(filter, status, hdferr)
-    IMPLICIT NONE
-    INTEGER, INTENT(IN)  :: filter      ! Filter; may be one of the following:
-                                        !   H5Z_FILTER_DEFLATE_F
-                                        !   H5Z_FILTER_SZIP_F
-                                        !   H5Z_FILTER_NBIT_F
-                                        !   H5Z_FILTER_SCALEOFFSET_F
-                                        !   H5Z_FILTER_SHUFFLE_F
-                                        !   H5Z_FILTER_FLETCHER32_F
-    LOGICAL, INTENT(OUT) :: status      ! Flag, idicates if filter
-                                        ! is availble  not ( TRUE or
-                                        ! FALSE)
-    INTEGER, INTENT(OUT) :: hdferr      ! Error code
-
- -
- -

h5zget_filter_info_f

- -

[ Top ] [ H5Z ] [ Subroutines ]

-

NAME

-
  h5zget_filter_info_f
-
-

PURPOSE

-
  Queries if filter has its encoder and/or decoder
-  available
-
-

INPUTS

-
  filter        - filter
-
-

OUTPUTS

-
  config_flags  - Bit vector possibly containing the
-                  following values:
-                     H5Z_FILTER_ENCODE_ENABLED_F
-                     H5Z_FILTER_DECODE_ENABLED_F
-  hdferr:       - error code
-                   Success:  0
-                   Failure: -1
-
-

AUTHOR

-
  Nat Furrer and James Laird
-  June 16, 2004
-
-

SOURCE

-
  SUBROUTINE h5zget_filter_info_f(filter, config_flags, hdferr)
-    IMPLICIT NONE
-    INTEGER, INTENT(IN)  :: filter      ! Filter; may be one of the following:
-                                        !   H5Z_FILTER_DEFLATE_F
-                                        !   H5Z_FILTER_SZIP_F
-                                        !   H5Z_FILTER_NBIT_F
-                                        !   H5Z_FILTER_SCALEOFFSET_F
-                                        !   H5Z_FILTER_SHUFFLE_F
-                                        !   H5Z_FILTER_FLETCHER32_F
-    INTEGER, INTENT(OUT) :: config_flags! Flag, indicates if filter
-                                        ! has its encoder and/or decoder
-                                        ! available
-    INTEGER, INTENT(OUT) :: hdferr      ! Error code
-
- -
- -

h5zunregister_f

- -

[ Top ] [ H5Z ] [ Subroutines ]

-

NAME

-
  h5zunregister_f
-
-

PURPOSE

-
  Unregisters specified filetr
-
-

INPUTS

-
  filter - filter; may have one of the following values:
-            H5Z_FILTER_DEFLATE_F
-            H5Z_FILTER_SZIP_F
-            H5Z_FILTER_NBIT_F
-            H5Z_FILTER_SCALEOFFSET_F
-            H5Z_FILTER_SHUFFLE_F
-            H5Z_FILTER_FLETCHER32_F
-
-

OUTPUTS

-
  hdferr - error code
-            Success:  0
-            Failure: -1
-
-

AUTHOR

-
  Elena Pourmal
-  March 12, 2003
-
-

SOURCE

-
  SUBROUTINE h5zunregister_f(filter, hdferr)
-    IMPLICIT NONE
-    INTEGER, INTENT(IN)  :: filter
-    INTEGER, INTENT(OUT) :: hdferr  ! Error code
-
- -
- - - diff --git a/fortran/doc/DevelGuide/src/H5_DBLE_InterfaceExclude_f90.html b/fortran/doc/DevelGuide/src/H5_DBLE_InterfaceExclude_f90.html deleted file mode 100644 index 4e51e7f..0000000 --- a/fortran/doc/DevelGuide/src/H5_DBLE_InterfaceExclude_f90.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - - -./src/H5_DBLE_InterfaceExclude.f90 - - - - - -
-
- -

src/H5_DBLE_InterfaceExclude.f90

- -

[ Top ] [ Modules ]

-

NAME

-
   H5_DBLE_INTERFACE
-
-

FUNCTION

-
   This module is used for when the default REAL is of type DOUBLE PRECISION.
-   We do not include the double precision interfaces if the defaut REAL is
-   DOUBLE PRECISION since this would lead to a non-unique conflict with the
-   generic interfaces declared as REAL and those declared as DOUBLE PRECISION.
-
-

NOTES

-
   Empty module.
-
-

AUTHOR

-
  M. Scot Breitenfeld
-
- -
- - - diff --git a/fortran/doc/DevelGuide/src/H5_DBLE_InterfaceInclude_f90.html b/fortran/doc/DevelGuide/src/H5_DBLE_InterfaceInclude_f90.html deleted file mode 100644 index 5a71d52..0000000 --- a/fortran/doc/DevelGuide/src/H5_DBLE_InterfaceInclude_f90.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - - -./src/H5_DBLE_InterfaceInclude.f90 - - - - - -
-
- -

src/H5_DBLE_InterfaceInclude.f90

- -

[ Top ] [ Modules ]

-

NAME

-
   H5_DBLE_INTERFACE
-
-

FUNCTION

-
   This module is used for when the default REAL is not of the type DOUBLE PRECISION.
-   We only do not include the double precision interfaces if the defaut REAL is
-   DOUBLE PRECISION since this would lead to a non-unique conflict with the
-   generic interfaces declared as REAL. Otherwise it is okay to include the interfaces.
-
-

NOTES

-
   This module contains all the DOUBLE PRECISION interfaces and corresponding subroutines
-   from the HDF function catagory H5A, H5D and H5P.
-
-

AUTHOR

-
  M. Scot Breitenfeld
-
- -
- - - diff --git a/fortran/doc/DevelGuide/src/H5_f_c.html b/fortran/doc/DevelGuide/src/H5_f_c.html deleted file mode 100644 index 2bdbce1..0000000 --- a/fortran/doc/DevelGuide/src/H5_f_c.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - -./src/H5_f.c - - - - - -
-
- -

fortran/src/H5_f.c

- -

[ Top ] [ Modules ]

-

FUNCTION

-
   This file contains C stubs for H5 Fortran APIs
-
- -
- - - diff --git a/fortran/doc/DevelGuide/src/H5_ff_F03_f90.html b/fortran/doc/DevelGuide/src/H5_ff_F03_f90.html deleted file mode 100644 index 17f07c1..0000000 --- a/fortran/doc/DevelGuide/src/H5_ff_F03_f90.html +++ /dev/null @@ -1,83 +0,0 @@ - - - - - - - -./src/H5_ff_F03.f90 - - - - - -
-
- -

H5LIB_PROVISIONAL

- -

[ Top ] [ Modules ]

-

NAME

-
  MODULE H5LIB_PROVISIONAL
-
-

PURPOSE

-
  This file contains helper functions for Fortran 2003 features and is
-  only compiled when Fortran 2003 features are enabled, otherwise
-  the file H5_ff_F90.f90 is compiled.
-
-

NOTES

-
                         *** IMPORTANT ***
-  If you add a new function you must add the function name to the
-  Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory.
-  This is needed for Windows based operating systems.
-
- -
- -

h5offsetof

- -

[ Top ] [ H5LIB_PROVISIONAL ] [ Functions ]

-

NAME

-
  h5offsetof
-
-

PURPOSE

-
  Computes the offset in memory
-
-

INPUTS

-
  start - starting pointer address
-  end   - ending pointer address
-
-

OUTPUTS

-
  offset - offset
-
-

AUTHOR

-
  M. Scot Breitenfeld
-  Augest 25, 2008
-
-

SOURCE

-
  FUNCTION h5offsetof(start,end) RESULT(offset)
-    USE, INTRINSIC :: ISO_C_BINDING
-    USE H5GLOBAL
-    IMPLICIT NONE
-    INTEGER(SIZE_T) :: offset
-    TYPE(C_PTR), VALUE, INTENT(IN) :: start, end
-
- -
- - - diff --git a/fortran/doc/DevelGuide/src/H5_ff_F90_f90.html b/fortran/doc/DevelGuide/src/H5_ff_F90_f90.html deleted file mode 100644 index c310ef2..0000000 --- a/fortran/doc/DevelGuide/src/H5_ff_F90_f90.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - -./src/H5_ff_F90.f90 - - - - - -
-
- -

H5LIB_PROVISIONAL (F90)

- -

[ Top ] [ Modules ]

-

NAME

-
  MODULE H5LIB_PROVISIONAL
-
-

FILE

-
  fortran/src/H5_ff_F90.f90
-
-

PURPOSE

-
  This file is a dummy module for when Fortran 2003 features are not enabled.
-  It is compiled in place of H5_ff_F03.f90 and is empty.
-
- -
- - - diff --git a/fortran/doc/DevelGuide/src/H5_ff_f90.html b/fortran/doc/DevelGuide/src/H5_ff_f90.html deleted file mode 100644 index 021c7c5..0000000 --- a/fortran/doc/DevelGuide/src/H5_ff_f90.html +++ /dev/null @@ -1,269 +0,0 @@ - - - - - - - -./src/H5_ff.f90 - - - - - -
-
- -

H5LIB

- -

[ Top ] [ Modules ]

-

NAME

-
  MODULE H5LIB
-
-

PURPOSE

-
  This module provides fortran specific helper functions for the HDF library
-
-

USES

-
  H5LIB_PROVISIONAL - This module provides helper functions for Fortran 2003
-                      only features. If Fortran 2003 functions are enabled then
-                      H5_ff_F03.f90 is compiled, else H5_ff_F90.f90,
-                      which is just a place holder blank module, is compiled.
-
-

NOTES

-
                         *** IMPORTANT ***
-  If you add a new function you must add the function name to the
-  Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory.
-  This is needed for Windows based operating systems.
-
- -
- -

h5check_version_f

- -

[ Top ] [ H5LIB ] [ Subroutines ]

-

NAME

-
  h5check_version_f
-
-

PURPOSE

-
  Verifies that library versions are consistent.
-
-

INPUTS

-
  majnum               - major version of the library
-  minum                - minor version of the library
-  relnum               - release version of the library
-
-

OUTPUTS

-
  error                - error code
-                          Success:  0
-                          Failure:  application aborts
-
-

AUTHOR

-
  Elena Pourmal
-  September 24, 2002
-
-

SOURCE

-
  SUBROUTINE h5check_version_f(majnum, minnum, relnum, error)
-    USE H5GLOBAL
-    IMPLICIT NONE
-    INTEGER, INTENT(IN) :: majnum, minnum, relnum
-    INTEGER, INTENT(OUT) :: error
-
- -
- -

h5close_f

- -

[ Top ] [ H5LIB ] [ Subroutines ]

-

NAME

-
  h5close_f
-
-

PURPOSE

-
  Closes the HDF5 library and Fortran90 interface.
-
-

OUTPUTS

-
  error - error code
-            Success:  0
-            Failure: -1
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces were added for
-  called C functions (it is needed for Windows
-  port).  February 28, 2001
-
-

SOURCE

-
  SUBROUTINE h5close_f(error)
-    USE H5GLOBAL
-    IMPLICIT NONE
-    INTEGER, INTENT(OUT) :: error
-
- -
- -

h5dont_atexit_f

- -

[ Top ] [ H5LIB ] [ Subroutines ]

-

NAME

-
  h5dont_atexit_f
-
-

PURPOSE

-
  Instructs library not to install atexit cleanup routine.
-
-

OUTPUTS

-
  error  - error code
-             Success:  0
-             Failure: -1
-
-

AUTHOR

-
  Elena Pourmal
-  September 24, 2002
-
-

SOURCE

-
  SUBROUTINE h5dont_atexit_f(error)
-    USE H5GLOBAL
-    IMPLICIT NONE
-    INTEGER, INTENT(OUT) :: error
-
- -
- -

h5garbage_collect_f

- -

[ Top ] [ H5LIB ] [ Subroutines ]

-

NAME

-
  h5garbage_collect_f
-
-

PURPOSE

-
  Garbage collects on all free-lists of all types.
-
-

OUTPUTS

-
  error  - error code
-             Success:  0
-             Failure: -1
-
-

AUTHOR

-
  Elena Pourmal
-  September 24, 2002
-
-

SOURCE

-
  SUBROUTINE h5garbage_collect_f(error)
-    USE H5GLOBAL
-    IMPLICIT NONE
-    INTEGER, INTENT(OUT) :: error
-
- -
- -

h5get_libversion_f

- -

[ Top ] [ H5LIB ] [ Subroutines ]

-

NAME

-
  h5get_libversion_f
-
-

PURPOSE

-
  Returns the HDF5 LIbrary release number
-
-

OUTPUTS

-
  majnum               - major version of the library
-  minum                - minor version of the library
-  relnum               - release version of the library
-  error                - error code
-                           Success:  0
-                           Failure: -1
-
-

AUTHOR

-
  Elena Pourmal
-  September 24, 2002
-
-

SOURCE

-
  SUBROUTINE h5get_libversion_f(majnum, minnum, relnum, error)
-    USE H5GLOBAL
-    IMPLICIT NONE
-    INTEGER, INTENT(OUT) :: majnum, minnum, relnum, error
-
- -
- -

h5kind_to_type

- -

[ Top ] [ H5LIB ] [ Functions ]

-

NAME

-
  h5kind_to_type
-
-

PURPOSE

-
  Converts the KIND to the correct HDF type
-
-

INPUTS

-
  kind    - Fortran KIND parameter
-  flag    - whether KIND is of type INTEGER or REAL:
-              H5_INTEGER_KIND - integer
-              H5_REAL_KIND    - real
-
-

OUTPUTS

-
  h5_type - returns the type
-
-

AUTHOR

-
  M. Scot Breitenfeld
-  Augest 25, 2008
-
-

SOURCE

-
  INTEGER(HID_T) FUNCTION h5kind_to_type(kind, flag) RESULT(h5_type)
-    USE H5GLOBAL
-    IMPLICIT NONE
-    INTEGER, INTENT(IN) :: kind
-    INTEGER, INTENT(IN) :: flag
-
- -
- -

h5open_f

- -

[ Top ] [ H5LIB ] [ Subroutines ]

-

NAME

-
  h5open_f
-
-

PURPOSE

-
  Initializes the HDF5 library and Fortran90 interface.
-
-

OUTPUTS

-
  error - error code
-            Success:  0
-            Failure: -1
-
-

AUTHOR

-
  Elena Pourmal
-  August 12, 1999
-
-

HISTORY

-
  Explicit Fortran interfaces were added for
-  called C functions (it is needed for Windows
-  port).  February 28, 2001
-
-

SOURCE

-
  SUBROUTINE h5open_f(error)
-    USE H5GLOBAL
-    IMPLICIT NONE
-    INTEGER, INTENT(OUT) :: error
-
- -
- - - diff --git a/fortran/doc/DevelGuide/src/H5f90global_f90.html b/fortran/doc/DevelGuide/src/H5f90global_f90.html deleted file mode 100644 index 587b6d0..0000000 --- a/fortran/doc/DevelGuide/src/H5f90global_f90.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - - -./src/H5f90global.f90 - - - - - -
-
- -

H5GLOBAL

- -

[ Top ] [ Modules ]

-

NAME

-
  MODULE H5GLOBAL
-
-

FILE

-
  src/fortran/H5f90global.f90
-
-

PURPOSE

-
  This module is used to pass C stubs for H5 Fortran APIs. The C stubs are
-  packed into arrays in H5_f.c and these arrays are then passed to Fortran.
-  This module then uses EQUIVALENCE to assign elements of the arrays to
-  Fortran equivalent C stubs.
-
-

NOTES

-
  The size of the C arrays in H5_f.c has to match the values of the variables
-  declared as PARAMETER, hence if the size of an array in H5_f.c is changed
-  then the PARAMETER of that corresponding array in Fortran must also be changed.
-
-

USES

-
  H5FORTRAN_TYPES       - This module is generated at run time. See
-
-

AUTHOR

-
  Elena Pourmal
-
- -
- - - diff --git a/fortran/doc/DevelGuide/src/H5f90kit_c.html b/fortran/doc/DevelGuide/src/H5f90kit_c.html deleted file mode 100644 index 1329a87..0000000 --- a/fortran/doc/DevelGuide/src/H5f90kit_c.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - -./src/H5f90kit.c - - - - - -
-
- -

H5f90kit

- -

[ Top ] [ Modules ]

-

PURPOSE

-
   Routines from HDF4 to deal with C-FORTRAN issues:
-
-   HD5f2cstring   -- convert a Fortran string to a C string
-   HD5packFstring -- convert a C string into a Fortran string
-
- -
- - - diff --git a/fortran/doc/DevelGuide/src/H5match_types_c.html b/fortran/doc/DevelGuide/src/H5match_types_c.html deleted file mode 100644 index 083319a..0000000 --- a/fortran/doc/DevelGuide/src/H5match_types_c.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - -./src/H5match_types.c - - - - - -
-
- -

H5match_types

- -

[ Top ] [ Procedures ]

-

NAME

-
  Executable: H5match_types
-
-

FILE

-
  fortran/src/H5match_types.c
-
-

PURPOSE

-
  C Program to match C types to Fortran types.
-  Creates the files H5f90i_gen.h for the C code and
-  H5fortran_types.f90 for the Fortran code.
-
- -
- - - diff --git a/fortran/doc/DevelGuide/src/H5test_kind_SIZEOF_f90.html b/fortran/doc/DevelGuide/src/H5test_kind_SIZEOF_f90.html deleted file mode 100644 index 3494db0..0000000 --- a/fortran/doc/DevelGuide/src/H5test_kind_SIZEOF_f90.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - - -./src/H5test_kind_SIZEOF.f90 - - - - - -
-
- -

H5test_kind_SIZEOF

- -

[ Top ] [ Procedures ]

-

NAME

-
  Executable: H5test_kind
-
-

FILE

-
  fortran/src/H5test_kind_SIZEOF.f90
-
-

PURPOSE

-
  This stand alone program is used at build time to generate the program
-  H5fortran_detect.f90. It cycles through all the available KIND parameters for
-  integers and reals. The appropriate program and subroutines are then generated
-  depending on which of the KIND values are found.
-
-

NOTES

-
  This program is used in place of H5test_kind.f90 when the Fortran intrinsic
-  function SIZEOF is available. It generates code that makes use of SIZEOF in
-  H5fortran_detect.f90 which is a portable solution.
-
-  The availability of SIZEOF is checked at configure time and the TRUE/FALSE
-  condition is set in the configure variable "FORTRAN_HAVE_SIZEOF".
-
-

AUTHOR

-
  M. Scot Breitenfeld
-
- -
- - - diff --git a/fortran/doc/DevelGuide/src/H5test_kind_f90.html b/fortran/doc/DevelGuide/src/H5test_kind_f90.html deleted file mode 100644 index c08e488..0000000 --- a/fortran/doc/DevelGuide/src/H5test_kind_f90.html +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - - -./src/H5test_kind.f90 - - - - - -
-
- -

H5test_kind

- -

[ Top ] [ Procedures ]

-

NAME

-
  Executable: H5test_kind
-
-

FILE

-
  fortran/src/H5test_kind.f90
-
-

PURPOSE

-
  This stand alone program is used at build time to generate the program
-  H5fortran_detect.f90. It cycles through all the available KIND parameters for
-  integers and reals. The appropriate program and subroutines are then generated
-  depending on which of the KIND values are found.
-
-

NOTES

-
  This program is depreciated in favor of H5test_kind_SIZEOF.f90 and is only
-  used when the Fortran intrinsic function SIZEOF is not available. It generates
-  code that does not make use of SIZEOF in H5fortran_detect.f90 which is less
-  portable in comparison to using SIZEOF.
-
-  The availability of SIZEOF is checked at configure time and the TRUE/FALSE
-  condition is set in the configure variable "FORTRAN_HAVE_SIZEOF".
-
-

AUTHOR

-
  Elena Pourma
-
- -
- - - diff --git a/fortran/doc/DevelGuide/src/HDF5_f90.html b/fortran/doc/DevelGuide/src/HDF5_f90.html deleted file mode 100644 index 1490c7c..0000000 --- a/fortran/doc/DevelGuide/src/HDF5_f90.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - -./src/HDF5.f90 - - - - - -
-
- -

HDF5

- -

[ Top ] [ Modules ]

-

NAME

-
  MODULE HDF5
-
-

FILE

-
  src/fortran/src/HDF5.f90
-
-

PURPOSE

-
  This is the main module used for linking to the Fortran HDF library.
-
- -
- - - diff --git a/fortran/doc/DevelGuide/src/HDF5mpio_f90.html b/fortran/doc/DevelGuide/src/HDF5mpio_f90.html deleted file mode 100644 index 9ef5f32..0000000 --- a/fortran/doc/DevelGuide/src/HDF5mpio_f90.html +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - -./src/HDF5mpio.f90 - - - - - -
-
- -

HDF5 (mpio)

- -

[ Top ] [ Modules ]

-

NAME

-
  HDF5
-
-

PURPOSE

-
  This is the main module used for linking to the Fortran parallel HDF library.
-  This file replaces HDF5.f90 when compiling the parallel library.
-
- -
- - - diff --git a/fortran/doc/DevelGuide/test/fflush1_f90.html b/fortran/doc/DevelGuide/test/fflush1_f90.html deleted file mode 100644 index eaab841..0000000 --- a/fortran/doc/DevelGuide/test/fflush1_f90.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - -./test/fflush1.f90 - - - - - -
-
- -

fortran/test/fflush1.f90

- -

[ Top ] [ Modules ]

-

NAME

-
  FFLUSH1EXAMPLE
-
-

FUNCTION

-
  This is the first half of a two-part test that makes sure
-  that a file can be read after an application crashes as long
-  as the file was flushed first.  We simulate by exit the 
-  the program using stop statement
-
- -
- - - diff --git a/fortran/doc/DevelGuide/test/fflush2_f90.html b/fortran/doc/DevelGuide/test/fflush2_f90.html deleted file mode 100644 index 23b7797..0000000 --- a/fortran/doc/DevelGuide/test/fflush2_f90.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - -./test/fflush2.f90 - - - - - -
-
- -

fortran/test/fflush2.f90

- -

[ Top ] [ Modules ]

-

NAME

-
  fflush2.f90
-
-

FUNCTION

-
  This is the second half of a two-part test that makes sure
-  that a file can be read after an application crashes as long
-  as the file was flushed first.  This half tries to read the
-  file created by the first half.
-
- -
- - - diff --git a/fortran/doc/DevelGuide/test/fortranlib_test_1_8_f90.html b/fortran/doc/DevelGuide/test/fortranlib_test_1_8_f90.html deleted file mode 100644 index 3ce387d..0000000 --- a/fortran/doc/DevelGuide/test/fortranlib_test_1_8_f90.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - -./test/fortranlib_test_1_8.f90 - - - - - -
-
- -

fortran/test/fortranlib_test_1_8.f90

- -

[ Top ] [ Modules ]

-

NAME

-
  fortranlib_test_1_8.f90
-
-

FUNCTION

-
  Basic testing of Fortran API's introduced in 1.8 release.
-
- -
- - - diff --git a/fortran/doc/DevelGuide/test/fortranlib_test_F03_f90.html b/fortran/doc/DevelGuide/test/fortranlib_test_F03_f90.html deleted file mode 100644 index 1a0c7be..0000000 --- a/fortran/doc/DevelGuide/test/fortranlib_test_F03_f90.html +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - -./test/fortranlib_test_F03.f90 - - - - - -
-
- -

fortran/test/fortranlib_test_F03.f90

- -

[ Top ] [ Modules ]

-

NAME

-
  fortranlib_test_F03.f90
-
-

FUNCTION

-
  Basic testing of Fortran API's requiring Fortran 2003
-  compliance.
-
- -
- - - diff --git a/fortran/doc/DevelGuide/test/fortranlib_test_f90.html b/fortran/doc/DevelGuide/test/fortranlib_test_f90.html deleted file mode 100644 index 29fb2f1..0000000 --- a/fortran/doc/DevelGuide/test/fortranlib_test_f90.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - -./test/fortranlib_test.f90 - - - - - -
-
- -

fortran/test/fortranlib_test.f90

- -

[ Top ] [ Modules ]

-

NAME

-
  fortranlib_test.f90
-
-

FUNCTION

-
  Basic testing of Fortran API's functionality.
-
- -
- - - diff --git a/fortran/doc/DevelGuide/test/tF2003_f90.html b/fortran/doc/DevelGuide/test/tF2003_f90.html deleted file mode 100644 index 8101411..0000000 --- a/fortran/doc/DevelGuide/test/tF2003_f90.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - - -./test/tF2003.f90 - - - - - -
-
- -

fortran/test/tF2003.f90

- -

[ Top ] [ Modules ]

-

NAME

-
  tF2003.f90
-
-

FUNCTION

-
  Test FORTRAN HDF5 APIs which are dependent on the FORTRAN 2003
-  features. Tests H5L, H5P, H5T APIs. 
-
-

USES

-
  liter_cb_mod, test_genprop_cls_cb1_mod
-
-

CONTAINS SUBROUTINES

-
  test_iter_group, test_create, test_genprop_class_callback,
-  test_array_compound_atomic, test_array_compound_array,
-  test_array_bkg 
-
- -
- - - diff --git a/fortran/doc/DevelGuide/test/tH5A_1_8_f90.html b/fortran/doc/DevelGuide/test/tH5A_1_8_f90.html deleted file mode 100644 index c217d99..0000000 --- a/fortran/doc/DevelGuide/test/tH5A_1_8_f90.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - - -./test/tH5A_1_8.f90 - - - - - -
-
- -

fortran/test/tH5A_1_8.f90

- -

[ Top ] [ Modules ]

-

NAME

-
  tH5A_1_8.f90
-
-

FUNCTION

-
  Basic testing of Fortran H5A APIs introduced in 1.8.
-
-

CONTAINS SUBROUTINES

-
  attribute_test_1_8, test_attr_corder_create_compact, test_attr_null_space,
-  test_attr_create_by_name, test_attr_info_by_idx, attr_info_by_idx_check,
-  test_attr_shared_rename, test_attr_delete_by_idx, test_attr_shared_delete,
-  test_attr_dense_open, test_attr_dense_verify, test_attr_corder_create_basic,
-  test_attr_basic_write, test_attr_many, attr_open_check, 
-
- -
- - - diff --git a/fortran/doc/DevelGuide/test/tH5A_f90.html b/fortran/doc/DevelGuide/test/tH5A_f90.html deleted file mode 100644 index 87c5a45..0000000 --- a/fortran/doc/DevelGuide/test/tH5A_f90.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - -./test/tH5A.f90 - - - - - -
-
- -

fortran/test/tH5A.f90

- -

[ Top ] [ Modules ]

-

NAME

-
  tH5A.f90
-
-

FUNCTION

-
  Basic testing of Fortran H5A APIs.
-
-

CONTAINS SUBROUTINES

-
  attribute_test 
-
- -
- - - diff --git a/fortran/doc/DevelGuide/test/tH5D_f90.html b/fortran/doc/DevelGuide/test/tH5D_f90.html deleted file mode 100644 index c840425..0000000 --- a/fortran/doc/DevelGuide/test/tH5D_f90.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - - -./test/tH5D.f90 - - - - - -
-
- -

fortran/test/tH5D.f90

- -

[ Top ] [ Modules ]

-

NAME

-
  tH5D.f90
-
-

FUNCTION

-
  Basic testing of Fortran H5D APIs.
-
-

NOTES

-
  Tests the H5D APIs functionalities of:
-   h5dcreate_f, h5dopen_f, h5dclose_f, h5dget_space_f, h5dget_type_f,
-   h5dread_f, and h5dwrite_f
-
-

CONTAINS SUBROUTINES

-
  datasettest, extenddsettest
-
- -
- - - diff --git a/fortran/doc/DevelGuide/test/tH5E_f90.html b/fortran/doc/DevelGuide/test/tH5E_f90.html deleted file mode 100644 index 6a1ef56..0000000 --- a/fortran/doc/DevelGuide/test/tH5E_f90.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - - -./test/tH5E.f90 - - - - - -
-
- -

fortran/test/tH5E.f90

- -

[ Top ] [ Modules ]

-

NAME

-
  tH5E.f90
-
-

FUNCTION

-
  Basic testing of Fortran H5E APIs.
-
-

NOTES

-
  Tests the H5D APIs functionalities of:
-   h5eprint_f
-
-

CONTAINS SUBROUTINES

-
  error_report_test
-
- -
- - - diff --git a/fortran/doc/DevelGuide/test/tH5F_f90.html b/fortran/doc/DevelGuide/test/tH5F_f90.html deleted file mode 100644 index d1aff59..0000000 --- a/fortran/doc/DevelGuide/test/tH5F_f90.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - -./test/tH5F.f90 - - - - - -
-
- -

fortran/test/tH5F.f90

- -

[ Top ] [ Modules ]

-

NAME

-
  tH5F.f90
-
-

FUNCTION

-
  Basic testing of Fortran H5F APIs.
-
-

CONTAINS SUBROUTINES

-
  mountingtest, reopentest, plisttest, file_close, file_space
-
- -
- - - diff --git a/fortran/doc/DevelGuide/test/tH5G_1_8_f90.html b/fortran/doc/DevelGuide/test/tH5G_1_8_f90.html deleted file mode 100644 index 81fdd3c..0000000 --- a/fortran/doc/DevelGuide/test/tH5G_1_8_f90.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - -./test/tH5G_1_8.f90 - - - - - -
-
- -

fortran/test/tH5G_1_8.f90

- -

[ Top ] [ Modules ]

-

NAME

-
  tH5G_1_8.f90
-
-

FUNCTION

-
  Basic testing of Fortran H5G APIs introduced in 1.8.
-
-

CONTAINS SUBROUTINES

-
  group_test, group_info, timestamps, mklinks, test_move_preserves, lifecycle
-  cklinks, delete_by_idx, link_info_by_idx_check, test_lcpl, objcopy, 
-  lapl_nlinks
-
- -
- - - diff --git a/fortran/doc/DevelGuide/test/tH5G_f90.html b/fortran/doc/DevelGuide/test/tH5G_f90.html deleted file mode 100644 index 6c60a3c..0000000 --- a/fortran/doc/DevelGuide/test/tH5G_f90.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - -./test/tH5G.f90 - - - - - -
-
- -

fortran/test/tH5G.f90

- -

[ Top ] [ Modules ]

-

NAME

-
  tH5G.f90
-
-

FUNCTION

-
  Basic testing of Fortran H5G APIs.
-
-

CONTAINS SUBROUTINES

-
  group_test
-
- -
- - - diff --git a/fortran/doc/DevelGuide/test/tH5I_f90.html b/fortran/doc/DevelGuide/test/tH5I_f90.html deleted file mode 100644 index 52e21fc..0000000 --- a/fortran/doc/DevelGuide/test/tH5I_f90.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - -./test/tH5I.f90 - - - - - -
-
- -

fortran/test/tH5I.f90

- -

[ Top ] [ Modules ]

-

NAME

-
  tH5I.f90
-
-

FUNCTION

-
  Basic testing of Fortran H5I APIs.
-
-

CONTAINS SUBROUTINES

-
  identifier_test
-
- -
- - - diff --git a/fortran/doc/DevelGuide/test/tH5O_f90.html b/fortran/doc/DevelGuide/test/tH5O_f90.html deleted file mode 100644 index a128da5..0000000 --- a/fortran/doc/DevelGuide/test/tH5O_f90.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - -./test/tH5O.f90 - - - - - -
-
- -

fortran/test/tH5O.f90

- -

[ Top ] [ Modules ]

-

NAME

-
  tH5O.f90
-
-

FUNCTION

-
  Basic testing of Fortran H5O APIs.
-
-

CONTAINS SUBROUTINES

-
  test_h5o, test_h5o_link, test_h5o_plist
-
- -
- - - diff --git a/fortran/doc/DevelGuide/test/tH5P_f90.html b/fortran/doc/DevelGuide/test/tH5P_f90.html deleted file mode 100644 index edc0787..0000000 --- a/fortran/doc/DevelGuide/test/tH5P_f90.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - -./test/tH5P.f90 - - - - - -
-
- -

fortran/test/tH5P.f90

- -

[ Top ] [ Modules ]

-

NAME

-
  tH5P.f90
-
-

FUNCTION

-
  Basic testing of Fortran H5P APIs.
-
-

CONTAINS SUBROUTINES

-
  external_test, multi_file_test
-
- -
- - - diff --git a/fortran/doc/DevelGuide/test/tH5R_f90.html b/fortran/doc/DevelGuide/test/tH5R_f90.html deleted file mode 100644 index fd44062..0000000 --- a/fortran/doc/DevelGuide/test/tH5R_f90.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - - -./test/tH5R.f90 - - - - - -
-
- -

fortran/test/tH5R.f90

- -

[ Top ] [ Modules ]

-

NAME

-
  tH5R.f90
-
-

FUNCTION

-
  Basic testing of Fortran H5R, Reference Interface, APIs.
-
-

NOTES

-
  Tests h5rcreate_f, h5rdereference_f, h5rget_name_f 
-  and H5Rget_object_type functions
-
-

CONTAINS SUBROUTINES

-
  refobjtest, refregtest
-
- -
- - - diff --git a/fortran/doc/DevelGuide/test/tH5S_f90.html b/fortran/doc/DevelGuide/test/tH5S_f90.html deleted file mode 100644 index 5879d28..0000000 --- a/fortran/doc/DevelGuide/test/tH5S_f90.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - - -./test/tH5S.f90 - - - - - -
-
- -

fortran/test/tH5S.f90

- -

[ Top ] [ Modules ]

-

NAME

-
  tH5S.f90
-
-

FUNCTION

-
  Basic testing of Fortran H5S, Dataspace Interface, APIs.
-
-

NOTES

-
  Tests the following functionalities:
-   h5screate_f, h5scopy_f, h5screate_simple_f, h5sis_simple_f,
-   h5sget_simple_extent_dims_f,h5sget_simple_extent_ndims_f
-   h5sget_simple_extent_npoints_f, h5sget_simple_extent_type_f,
-   h5sextent_copy_f, h5sset_extent_simple_f, h5sset_extent_none_f
-
-

CONTAINS SUBROUTINES

-
  dataspace_basic_test
-
- -
- - - diff --git a/fortran/doc/DevelGuide/test/tH5Sselect_f90.html b/fortran/doc/DevelGuide/test/tH5Sselect_f90.html deleted file mode 100644 index e8eaa73..0000000 --- a/fortran/doc/DevelGuide/test/tH5Sselect_f90.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - - -./test/tH5Sselect.f90 - - - - - -
-
- -

fortran/test/tH5Sselect.f90

- -

[ Top ] [ Modules ]

-

NAME

-
  tH5Sselect.f90
-
-

FUNCTION

-
  Basic testing of Fortran H5S, Selection-related Dataspace Interface, APIs.
-
-

NOTES

-
  Tests the following functionalities:
-    h5sget_select_npoints_f, h5sselect_elements_f, h5sselect_all_f,
-    h5sselect_none_f, h5sselect_valid_f, h5sselect_hyperslab_f,
-    h5sget_select_bounds_f, h5sget_select_elem_pointlist_f,
-    h5sget_select_elem_npoints_f, h5sget_select_hyper_blocklist_f,
-    h5sget_select_hyper_nblocks_f, h5sget_select_npoints_f   
-
-

CONTAINS SUBROUTINES

-
  test_select_hyperslab, test_select_element, test_basic_select,
-  test_select_point, test_select_combine, test_select_bounds
-
- -
- - - diff --git a/fortran/doc/DevelGuide/test/tH5T_f90.html b/fortran/doc/DevelGuide/test/tH5T_f90.html deleted file mode 100644 index 35006b3..0000000 --- a/fortran/doc/DevelGuide/test/tH5T_f90.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - -./test/tH5T.f90 - - - - - -
-
- -

fortran/test/tH5T.f90

- -

[ Top ] [ Modules ]

-

NAME

-
  tH5T.f90
-
-

FUNCTION

-
  Basic testing of Fortran H5T APIs.
-
-

CONTAINS SUBROUTINES

-
  compoundtest, basic_data_type_test, enumtest, test_derived_flt
-
- -
- - - diff --git a/fortran/doc/DevelGuide/test/tH5VL_f90.html b/fortran/doc/DevelGuide/test/tH5VL_f90.html deleted file mode 100644 index a34a01d..0000000 --- a/fortran/doc/DevelGuide/test/tH5VL_f90.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - -./test/tH5VL.f90 - - - - - -
-
- -

fortran/test/tH5VL.f90

- -

[ Top ] [ Modules ]

-

NAME

-
  tH5VL.f90
-
-

FUNCTION

-
  Basic testing of Fortran Variable_length datatypes APIs.
-
-

CONTAINS SUBROUTINES

-
  vl_test_integer, vl_test_real, vl_test_string 
-
- -
- - - diff --git a/fortran/doc/DevelGuide/test/tH5Z_f90.html b/fortran/doc/DevelGuide/test/tH5Z_f90.html deleted file mode 100644 index 94325b9..0000000 --- a/fortran/doc/DevelGuide/test/tH5Z_f90.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - -./test/tH5Z.f90 - - - - - -
-
- -

fortran/test/tH5Z.f90

- -

[ Top ] [ Modules ]

-

NAME

-
  tH5Z.f90
-
-

FUNCTION

-
  Basic testing of Fortran H5Z szip APIs.
-
-

CONTAINS SUBROUTINES

-
  filters_test, szip_test
-
- -
- - - diff --git a/fortran/doc/DevelGuide/test/t_c.html b/fortran/doc/DevelGuide/test/t_c.html deleted file mode 100644 index c9512a7..0000000 --- a/fortran/doc/DevelGuide/test/t_c.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - -./test/t.c - - - - - -
-
- -

fortran/test/tc.c

- -

[ Top ] [ Modules ]

-

NAME

-
   tc.c
-
-

FUNCTION

-
   This file contains C routines needed for the test programs.
-
- -
- - - diff --git a/fortran/doc/DevelGuide/test/tf_f90.html b/fortran/doc/DevelGuide/test/tf_f90.html deleted file mode 100644 index e3c51f4..0000000 --- a/fortran/doc/DevelGuide/test/tf_f90.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - -./test/tf.f90 - - - - - -
-
- -

fortran/test/tf.f90

- -

[ Top ] [ Modules ]

-

NAME

-
  tf.f90
-
-

FUNCTION

-
  Contains subroutines which are needed in all the hdf5 fortran tests
-
-

CONTAINS SUBROUTINES

-
  write_test_status, check, verify, verifyLogical, verifyString, h5_fixname_f,
-  h5_cleanup_f, h5_exit_f, h5_env_nocleanup_f
-
- -
- - - diff --git a/fortran/doc/DevelGuide/toc_index.html b/fortran/doc/DevelGuide/toc_index.html deleted file mode 100644 index 94a2792..0000000 --- a/fortran/doc/DevelGuide/toc_index.html +++ /dev/null @@ -1,552 +0,0 @@ - - - - - - - -Table of Contents - - - - -
-
- -
-

TABLE OF CONTENTS

- -
- - - diff --git a/fortran/examples/CMakeLists.txt b/fortran/examples/CMakeLists.txt index fabc5cd..f2dc896 100644 --- a/fortran/examples/CMakeLists.txt +++ b/fortran/examples/CMakeLists.txt @@ -69,38 +69,36 @@ foreach (example ${examples}) endif (BUILD_SHARED_LIBS) endforeach (example ${examples}) -if (HDF5_ENABLE_F2003) - foreach (example ${F2003_examples}) - add_executable (f03_ex_${example} ${HDF5_F90_EXAMPLES_SOURCE_DIR}/${example}.f90) - TARGET_NAMING (f03_ex_${example} STATIC) - TARGET_FORTRAN_PROPERTIES (f03_ex_${example} STATIC " " " ") - target_link_libraries (f03_ex_${example} - ${HDF5_F90_LIB_TARGET} - ${HDF5_LIB_TARGET} +foreach (example ${F2003_examples}) + add_executable (f03_ex_${example} ${HDF5_F90_EXAMPLES_SOURCE_DIR}/${example}.f90) + TARGET_NAMING (f03_ex_${example} STATIC) + TARGET_FORTRAN_PROPERTIES (f03_ex_${example} STATIC " " " ") + target_link_libraries (f03_ex_${example} + ${HDF5_F90_LIB_TARGET} + ${HDF5_LIB_TARGET} + ) + target_include_directories (f03_ex_${example} PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/static) + set_target_properties (f03_ex_${example} PROPERTIES + LINKER_LANGUAGE Fortran + FOLDER examples/fortran03 + Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY} + ) + if (BUILD_SHARED_LIBS) + add_executable (f03_ex_${example}-shared ${HDF5_F90_EXAMPLES_SOURCE_DIR}/${example}.f90) + TARGET_NAMING (f03_ex_${example}-shared SHARED) + TARGET_FORTRAN_PROPERTIES (f03_ex_${example}-shared SHARED " " " ") + target_link_libraries (f03_ex_${example}-shared + ${HDF5_F90_LIBSH_TARGET} + ${HDF5_LIBSH_TARGET} ) - target_include_directories (f03_ex_${example} PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/static) - set_target_properties (f03_ex_${example} PROPERTIES + target_include_directories (f03_ex_${example}-shared PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/shared) + set_target_properties (f03_ex_${example}-shared PROPERTIES LINKER_LANGUAGE Fortran FOLDER examples/fortran03 - Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/static + Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/shared ) - if (BUILD_SHARED_LIBS) - add_executable (f03_ex_${example}-shared ${HDF5_F90_EXAMPLES_SOURCE_DIR}/${example}.f90) - TARGET_NAMING (f03_ex_${example}-shared SHARED) - TARGET_FORTRAN_PROPERTIES (f03_ex_${example}-shared SHARED " " " ") - target_link_libraries (f03_ex_${example}-shared - ${HDF5_F90_LIBSH_TARGET} - ${HDF5_LIBSH_TARGET} - ) - target_include_directories (f03_ex_${example}-shared PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/shared) - set_target_properties (f03_ex_${example}-shared PROPERTIES - LINKER_LANGUAGE Fortran - FOLDER examples/fortran03 - Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/shared - ) - endif (BUILD_SHARED_LIBS) - endforeach (example ${F2003_examples}) -endif (HDF5_ENABLE_F2003) + endif (BUILD_SHARED_LIBS) +endforeach (example ${F2003_examples}) if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) add_executable (f90_ex_ph5example ${HDF5_F90_EXAMPLES_SOURCE_DIR}/ph5example.f90) diff --git a/fortran/examples/Makefile.am b/fortran/examples/Makefile.am index caaa08c..cdd9317 100644 --- a/fortran/examples/Makefile.am +++ b/fortran/examples/Makefile.am @@ -46,12 +46,10 @@ INSTALL_FILES=h5_crtdat.f90 h5_rdwt.f90 \ # Add attention tests for Fortran 2003 features -if FORTRAN_2003_CONDITIONAL_F - EXAMPLE_PROG += rwdset_fortran2003 nested_derived_type \ - compound_fortran2003 compound_complex_fortran2003 - INSTALL_FILES += rwdset_fortran2003.f90 nested_derived_type.f90 \ - compound_fortran2003.f90 compound_complex_fortran2003.f90 -endif +EXAMPLE_PROG += rwdset_fortran2003 nested_derived_type \ + compound_fortran2003 compound_complex_fortran2003 +INSTALL_FILES += rwdset_fortran2003.f90 nested_derived_type.f90 \ + compound_fortran2003.f90 compound_complex_fortran2003.f90 TEST_SCRIPT=testh5fc.sh TEST_EXAMPLES_SCRIPT=$(INSTALL_SCRIPT_FILES) @@ -103,12 +101,10 @@ refregexample: refregexample.f90 mountexample: mountexample.f90 compound: compound.f90 ph5example: ph5example.f90 -if FORTRAN_2003_CONDITIONAL_F rwdset_fortran2003: rwdset_fortran2003.f90 nested_derived_type: nested_derived_type.f90 compound_fortran2003: compound_fortran2003.f90 compound_complex_fortran2003: compound_complex_fortran2003.f90 -endif include $(top_srcdir)/config/examples.am include $(top_srcdir)/config/conclude.am diff --git a/fortran/examples/Makefile.in b/fortran/examples/Makefile.in index c894b75..f97fdc8 100644 --- a/fortran/examples/Makefile.in +++ b/fortran/examples/Makefile.in @@ -104,14 +104,6 @@ DIST_COMMON = $(top_srcdir)/config/commence.am \ $(srcdir)/Makefile.am $(top_srcdir)/bin/mkinstalldirs \ $(srcdir)/run-fortran-ex.sh.in $(srcdir)/testh5fc.sh.in \ $(top_srcdir)/bin/test-driver - -# Add attention tests for Fortran 2003 features -@FORTRAN_2003_CONDITIONAL_F_TRUE@am__append_1 = rwdset_fortran2003 nested_derived_type \ -@FORTRAN_2003_CONDITIONAL_F_TRUE@ compound_fortran2003 compound_complex_fortran2003 - -@FORTRAN_2003_CONDITIONAL_F_TRUE@am__append_2 = rwdset_fortran2003.f90 nested_derived_type.f90 \ -@FORTRAN_2003_CONDITIONAL_F_TRUE@ compound_fortran2003.f90 compound_complex_fortran2003.f90 - TESTS = $(TEST_SCRIPT) subdir = fortran/examples ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 @@ -120,7 +112,8 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/aclocal_cxx.m4 \ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/bin/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/src/H5config.h +CONFIG_HEADER = $(top_builddir)/src/H5config.h \ + $(top_builddir)/fortran/src/H5config_f.inc CONFIG_CLEAN_FILES = run-fortran-ex.sh testh5fc.sh CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) @@ -404,14 +397,21 @@ F9XMODEXT = @F9XMODEXT@ F9XMODFLAG = @F9XMODFLAG@ F9XSUFFIXFLAG = @F9XSUFFIXFLAG@ FC = @FC@ -FC2003 = @FC2003@ FCFLAGS = @FCFLAGS@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ +FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ +FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ +FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ +H5CONFIG_F_IKIND = @H5CONFIG_F_IKIND@ +H5CONFIG_F_NUM_IKIND = @H5CONFIG_F_NUM_IKIND@ +H5CONFIG_F_NUM_RKIND = @H5CONFIG_F_NUM_RKIND@ +H5CONFIG_F_RKIND = @H5CONFIG_F_RKIND@ +H5CONFIG_F_RKIND_SIZEOF = @H5CONFIG_F_RKIND_SIZEOF@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ @@ -421,13 +421,12 @@ H5_LDFLAGS = @H5_LDFLAGS@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ -HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_Fortran_INTEGER_SIZEOF_16 = @HAVE_Fortran_INTEGER_SIZEOF_16@ HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ HDF_FORTRAN = @HDF_FORTRAN@ -HDF_FORTRAN2003 = @HDF_FORTRAN2003@ HID_T = @HID_T@ HL = @HL@ HL_FOR = @HL_FOR@ @@ -469,6 +468,18 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PAC_C_MAX_REAL_PRECISION = @PAC_C_MAX_REAL_PRECISION@ +PAC_FC_ALL_INTEGER_KINDS = @PAC_FC_ALL_INTEGER_KINDS@ +PAC_FC_ALL_INTEGER_KINDS_SIZEOF = @PAC_FC_ALL_INTEGER_KINDS_SIZEOF@ +PAC_FC_ALL_REAL_KINDS = @PAC_FC_ALL_REAL_KINDS@ +PAC_FC_ALL_REAL_KINDS_SIZEOF = @PAC_FC_ALL_REAL_KINDS_SIZEOF@ +PAC_FC_MAX_REAL_PRECISION = @PAC_FC_MAX_REAL_PRECISION@ +PAC_FORTRAN_NATIVE_DOUBLE_KIND = @PAC_FORTRAN_NATIVE_DOUBLE_KIND@ +PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF = @PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF@ +PAC_FORTRAN_NATIVE_INTEGER_KIND = @PAC_FORTRAN_NATIVE_INTEGER_KIND@ +PAC_FORTRAN_NATIVE_INTEGER_SIZEOF = @PAC_FORTRAN_NATIVE_INTEGER_SIZEOF@ +PAC_FORTRAN_NATIVE_REAL_KIND = @PAC_FORTRAN_NATIVE_REAL_KIND@ +PAC_FORTRAN_NATIVE_REAL_SIZEOF = @PAC_FORTRAN_NATIVE_REAL_SIZEOF@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ @@ -619,17 +630,21 @@ INSTALL_SCRIPT_FILES = run-fortran-ex.sh # be run. # We don't tell automake about these programs so that it doesn't try to # compile them with the regular fortran compiler. + +# Add attention tests for Fortran 2003 features EXAMPLE_PROG = h5_crtdat h5_rdwt h5_crtatt h5_crtgrp h5_crtgrpar \ h5_crtgrpd h5_extend h5_subset h5_cmprss hyperslab selectele \ refobjexample refregexample mountexample compound \ - $(am__append_1) + rwdset_fortran2003 nested_derived_type compound_fortran2003 \ + compound_complex_fortran2003 # List files to be installed here INSTALL_FILES = h5_crtdat.f90 h5_rdwt.f90 h5_crtatt.f90 h5_crtgrp.f90 \ h5_crtgrpar.f90 h5_crtgrpd.f90 h5_extend.f90 h5_subset.f90 \ h5_cmprss.f90 hyperslab.f90 selectele.f90 refobjexample.f90 \ refregexample.f90 mountexample.f90 compound.f90 ph5example.f90 \ - $(am__append_2) + rwdset_fortran2003.f90 nested_derived_type.f90 \ + compound_fortran2003.f90 compound_complex_fortran2003.f90 TEST_SCRIPT = testh5fc.sh TEST_EXAMPLES_SCRIPT = $(INSTALL_SCRIPT_FILES) @@ -1067,10 +1082,10 @@ refregexample: refregexample.f90 mountexample: mountexample.f90 compound: compound.f90 ph5example: ph5example.f90 -@FORTRAN_2003_CONDITIONAL_F_TRUE@rwdset_fortran2003: rwdset_fortran2003.f90 -@FORTRAN_2003_CONDITIONAL_F_TRUE@nested_derived_type: nested_derived_type.f90 -@FORTRAN_2003_CONDITIONAL_F_TRUE@compound_fortran2003: compound_fortran2003.f90 -@FORTRAN_2003_CONDITIONAL_F_TRUE@compound_complex_fortran2003: compound_complex_fortran2003.f90 +rwdset_fortran2003: rwdset_fortran2003.f90 +nested_derived_type: nested_derived_type.f90 +compound_fortran2003: compound_fortran2003.f90 +compound_complex_fortran2003: compound_complex_fortran2003.f90 # How to create EXAMPLEDIR if it doesn't already exist $(EXAMPLEDIR): diff --git a/fortran/examples/nested_derived_type.f90 b/fortran/examples/nested_derived_type.f90 index f806110..65e7e75 100644 --- a/fortran/examples/nested_derived_type.f90 +++ b/fortran/examples/nested_derived_type.f90 @@ -23,13 +23,13 @@ PROGRAM main IMPLICIT NONE ! KIND parameters - INTEGER, PARAMETER :: int_k1 = SELECTED_INT_KIND(Fortran_INTEGER_1) ! This should map to INTEGER*1 on most modern processors - INTEGER, PARAMETER :: int_k4 = SELECTED_INT_KIND(Fortran_INTEGER_2) ! This should map to INTEGER*2 on most modern processors - INTEGER, PARAMETER :: int_k8 = SELECTED_INT_KIND(Fortran_INTEGER_4) ! This should map to INTEGER*4 on most modern processors - INTEGER, PARAMETER :: int_k16 = SELECTED_INT_KIND(Fortran_INTEGER_8) ! This should map to INTEGER*8 on most modern processors + INTEGER, PARAMETER :: int_k1 = SELECTED_INT_KIND(2) ! This should map to INTEGER*1 on most modern processors + INTEGER, PARAMETER :: int_k4 = SELECTED_INT_KIND(4) ! This should map to INTEGER*2 on most modern processors + INTEGER, PARAMETER :: int_k8 = SELECTED_INT_KIND(9) ! This should map to INTEGER*4 on most modern processors + INTEGER, PARAMETER :: int_k16 = SELECTED_INT_KIND(18) ! This should map to INTEGER*8 on most modern processors - INTEGER, PARAMETER :: r_k4 = SELECTED_REAL_KIND(Fortran_REAL_4) ! This should map to REAL*4 on most modern processors - INTEGER, PARAMETER :: r_k8 = SELECTED_REAL_KIND(Fortran_REAL_8) ! This should map to REAL*8 on most modern processors + INTEGER, PARAMETER :: r_k4 = SELECTED_REAL_KIND(6,37) ! This should map to REAL*4 on most modern processors + INTEGER, PARAMETER :: r_k8 = SELECTED_REAL_KIND(15,307) ! This should map to REAL*8 on most modern processors ! FILES diff --git a/fortran/examples/rwdset_fortran2003.f90 b/fortran/examples/rwdset_fortran2003.f90 index d65db9e..682676f 100644 --- a/fortran/examples/rwdset_fortran2003.f90 +++ b/fortran/examples/rwdset_fortran2003.f90 @@ -28,13 +28,13 @@ PROGRAM RWDSET_FORTRAN2003 IMPLICIT NONE - INTEGER, PARAMETER :: int_kind_1 = SELECTED_INT_KIND(Fortran_INTEGER_1) !should map to INTEGER*1 on most modern processors - INTEGER, PARAMETER :: int_kind_4 = SELECTED_INT_KIND(Fortran_INTEGER_2) !should map to INTEGER*2 on most modern processors - INTEGER, PARAMETER :: int_kind_8 = SELECTED_INT_KIND(Fortran_INTEGER_4) !should map to INTEGER*4 on most modern processors - INTEGER, PARAMETER :: int_kind_16 = SELECTED_INT_KIND(Fortran_INTEGER_8) !should map to INTEGER*8 on most modern processors + INTEGER, PARAMETER :: int_kind_1 = SELECTED_INT_KIND(2) !should map to INTEGER*1 on most modern processors + INTEGER, PARAMETER :: int_kind_4 = SELECTED_INT_KIND(4) !should map to INTEGER*2 on most modern processors + INTEGER, PARAMETER :: int_kind_8 = SELECTED_INT_KIND(9) !should map to INTEGER*4 on most modern processors + INTEGER, PARAMETER :: int_kind_16 = SELECTED_INT_KIND(18) !should map to INTEGER*8 on most modern processors - INTEGER, PARAMETER :: real_kind_7 = SELECTED_REAL_KIND(Fortran_REAL_4) !should map to REAL*4 on most modern processors - INTEGER, PARAMETER :: real_kind_15 = SELECTED_REAL_KIND(Fortran_REAL_8) !should map to REAL*8 on most modern processors + INTEGER, PARAMETER :: real_kind_7 = SELECTED_REAL_KIND(6,37) !should map to REAL*4 on most modern processors + INTEGER, PARAMETER :: real_kind_15 = SELECTED_REAL_KIND(15,307) !should map to REAL*8 on most modern processors CHARACTER(LEN=8), PARAMETER :: filename = "dsetf.h5" ! File name CHARACTER(LEN=5), PARAMETER :: dsetname1 = "dset1" ! Dataset name @@ -148,12 +148,12 @@ PROGRAM RWDSET_FORTRAN2003 CALL h5dread_f(dset_idr8, h5kind_to_type(real_kind_15,H5_REAL_KIND), f_ptr, error) ! memory type - WRITE(*,'(A,4i8)' )'SELECTED_INT_KIND(Fortran_INTEGER_1): ',data_out_i8a - WRITE(*,'(A,4i8)' )'SELECTED_INT_KIND(Fortran_INTEGER_4): ',data_out_i4 - WRITE(*,'(A,4i8)' )'SELECTED_INT_KIND(Fortran_INTEGER_8): ',data_out_i8 - WRITE(*,'(A,4i8)' )'SELECTED_INT_KIND(Fortran_INTEGER_16): ',data_out_i16 - WRITE(*,'(A,4(1x,f9.4))' )'SELECTED_REAL_KIND(Fortran_REAL_7): ',data_out_r7 - WRITE(*,'(A,4(1x,f16.10))' )'SELECTED_REAL_KIND(Fortran_REAL_15): ',data_out_r15 + WRITE(*,'(A,4i8)' )'SELECTED_INT_KIND(2): ',data_out_i8a + WRITE(*,'(A,4i8)' )'SELECTED_INT_KIND(4): ',data_out_i4 + WRITE(*,'(A,4i8)' )'SELECTED_INT_KIND(9): ',data_out_i8 + WRITE(*,'(A,4i8)' )'SELECTED_INT_KIND(18): ',data_out_i16 + WRITE(*,'(A,4(1x,f9.4))' )'SELECTED_REAL_KIND(6,37): ',data_out_r7 + WRITE(*,'(A,4(1x,f16.10))' )'SELECTED_REAL_KIND(15,307): ',data_out_r15 ! ! Close the dataset. ! diff --git a/fortran/src/CMakeLists.txt b/fortran/src/CMakeLists.txt index bb171d4..8f63b3c 100644 --- a/fortran/src/CMakeLists.txt +++ b/fortran/src/CMakeLists.txt @@ -19,100 +19,47 @@ if (WIN32) endif (BUILD_SHARED_LIBS) endif (WIN32) +# configure for Fortran preprocessor + +# Define Parallel variable for passing to H5config_f.inc.cmake +set (CMAKE_H5_HAVE_PARALLEL 0) +if (H5_HAVE_PARALLEL) + set (CMAKE_H5_HAVE_PARALLEL 1) +endif (H5_HAVE_PARALLEL) + +set (CMAKE_H5_HAVE_FLOAT128 0) +if (HAVE_FLOAT128) + set (CMAKE_H5_HAVE_FLOAT128 1) +endif(HAVE_FLOAT128) + +configure_file (${HDF5_F90_SRC_SOURCE_DIR}/H5config_f.inc.cmake ${CMAKE_BINARY_DIR}/H5config_f.inc @ONLY) +configure_file (${HDF5_F90_SRC_SOURCE_DIR}/H5fort_type_defines.h.in ${HDF5_F90_BINARY_DIR}/H5fort_type_defines.h @ONLY) + #----------------------------------------------------------------------------- # Setup the Fortran auto-detection utilities -# H5test_kind(_SIZEOF,_STORAGE_SIZE).f90 used to generate H5fortran_detect.f90 -# H5fortran_detect.f90 used to generate H5fort_type_defines.h -# H5fort_type_defines.h used to generate H5f90i_gen.h + H5fortran_types.f90 +# H5_buildiface.F90 used to generate various KIND interfaces +# H5fort_type_defines.h used to generate H5f90i_gen.h + H5fortran_types.F90 #----------------------------------------------------------------------------- -if (FORTRAN_HAVE_STORAGE_SIZE) - add_executable (H5test_FortranHavekind - ${HDF5_F90_SRC_SOURCE_DIR}/H5test_kind_STORAGE_SIZE.f90 - ) - if (BUILD_SHARED_LIBS) - add_executable (H5test_FortranHavekind-shared - ${HDF5_F90_SRC_SOURCE_DIR}/H5test_kind_STORAGE_SIZE.f90 - ) - endif (BUILD_SHARED_LIBS) - set (H5_TEST_KIND_NAME "h5test_kind_storage_size_mod") -else (FORTRAN_HAVE_STORAGE_SIZE) - if (FORTRAN_HAVE_SIZEOF) - add_executable (H5test_FortranHavekind - ${HDF5_F90_SRC_SOURCE_DIR}/H5test_kind_SIZEOF.f90 - ) - if (BUILD_SHARED_LIBS) - add_executable (H5test_FortranHavekind-shared - ${HDF5_F90_SRC_SOURCE_DIR}/H5test_kind_SIZEOF.f90 - ) - endif (BUILD_SHARED_LIBS) - set (H5_TEST_KIND_NAME "h5test_kind_sizeof_mod") - else (FORTRAN_HAVE_SIZEOF) - add_executable (H5test_FortranHavekind - ${HDF5_F90_SRC_SOURCE_DIR}/H5test_kind.f90 - ) - if (BUILD_SHARED_LIBS) - add_executable (H5test_FortranHavekind-shared - ${HDF5_F90_SRC_SOURCE_DIR}/H5test_kind.f90 - ) - endif (BUILD_SHARED_LIBS) - endif (FORTRAN_HAVE_SIZEOF) -endif (FORTRAN_HAVE_STORAGE_SIZE) -if (WIN32 AND MSVC) - if (BUILD_SHARED_LIBS) - set_target_properties (H5test_FortranHavekind-shared - PROPERTIES - COMPILE_FLAGS "/MT" - ) - endif (BUILD_SHARED_LIBS) - set_target_properties (H5test_FortranHavekind - PROPERTIES - LINK_FLAGS "/SUBSYSTEM:CONSOLE" - ) -endif (WIN32 AND MSVC) -set_target_properties (H5test_FortranHavekind PROPERTIES - LINKER_LANGUAGE Fortran - Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/static -) -if (BUILD_SHARED_LIBS) - set_target_properties (H5test_FortranHavekind-shared PROPERTIES - LINKER_LANGUAGE Fortran - Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/shared + +add_executable (H5_buildiface + ${HDF5_F90_SRC_SOURCE_DIR}/H5_buildiface.F90 ) -endif (BUILD_SHARED_LIBS) -set (CMD $) -add_custom_command ( - OUTPUT ${HDF5_F90_BINARY_DIR}/H5fortran_detect.f90 - COMMAND ${CMD} - ARGS > ${HDF5_F90_BINARY_DIR}/H5fortran_detect.f90 - WORKING_DIRECTORY ${HDF5_F90_BINARY_DIR} - DEPENDS H5test_FortranHavekind -) -#----------------------------------------------------------------------------- -add_executable (H5fortran_detect - ${HDF5_F90_BINARY_DIR}/H5fortran_detect.f90 -) if (WIN32 AND MSVC) if (BUILD_SHARED_LIBS) - set_target_properties (H5fortran_detect + set_target_properties (H5_buildiface PROPERTIES COMPILE_FLAGS "/MT" ) endif (BUILD_SHARED_LIBS) - set_target_properties (H5fortran_detect + set_target_properties (H5_buildiface PROPERTIES LINK_FLAGS "/SUBSYSTEM:CONSOLE" ) endif (WIN32 AND MSVC) -set_target_properties (H5fortran_detect PROPERTIES LINKER_LANGUAGE Fortran) - -set (CMD $) -add_custom_command ( - OUTPUT ${HDF5_F90_BINARY_DIR}/H5fort_type_defines.h - COMMAND ${CMD} - ARGS > ${HDF5_F90_BINARY_DIR}/H5fort_type_defines.h - WORKING_DIRECTORY ${HDF5_F90_BINARY_DIR} - DEPENDS H5fortran_detect +set_target_properties (H5_buildiface PROPERTIES + LINKER_LANGUAGE Fortran + Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY} ) INCLUDE_DIRECTORIES (${HDF5_F90_BINARY_DIR} ${CMAKE_Fortran_MODULE_DIRECTORY}) @@ -124,7 +71,7 @@ add_executable (H5match_types set (CMD $) add_custom_command ( OUTPUT ${HDF5_F90_BINARY_DIR}/H5f90i_gen.h - ${HDF5_F90_BINARY_DIR}/H5fortran_types.f90 + ${HDF5_F90_BINARY_DIR}/H5fortran_types.F90 COMMAND ${CMD} WORKING_DIRECTORY ${HDF5_F90_BINARY_DIR} DEPENDS H5match_types @@ -152,12 +99,6 @@ set (f90CStub_C_SRCS ${HDF5_F90_SRC_SOURCE_DIR}/H5Zf.c ) -if (H5_HAVE_PARALLEL) - set (f90CStub_C_SRCS - ${f90CStub_C_SRCS} - ${HDF5_F90_SRC_SOURCE_DIR}/H5FDmpiof.c - ) -endif (H5_HAVE_PARALLEL) set_source_files_properties (${f90CStub_C_SRCS} PROPERTIES LANGUAGE C) set (f90CStub_C_HDRS @@ -193,79 +134,51 @@ if (BUILD_SHARED_LIBS) set (install_targets ${install_targets} ${HDF5_F90_C_LIBSH_TARGET}) endif (BUILD_SHARED_LIBS) -#----------------------------------------------------------------------------- -# Fortran 2003 standard -#----------------------------------------------------------------------------- -if (HDF5_ENABLE_F2003) - # F2003 features are enabled - set (F_STATUS "_F03") -else (HDF5_ENABLE_F2003) - # F2003 features are not enabled - set (F_STATUS "_F90") -endif (HDF5_ENABLE_F2003) - -#----------------------------------------------------------------------------- -# Fortran Real Size -#----------------------------------------------------------------------------- -if (FORTRAN_DEFAULT_REAL_NOT_DOUBLE) - # default real is 4 bytes, so include double signatures - set (F_DBLE "Include") -else (FORTRAN_DEFAULT_REAL_NOT_DOUBLE) - # default real is 8 bytes, so exclude double signatures - set (F_DBLE "Exclude") -endif (FORTRAN_DEFAULT_REAL_NOT_DOUBLE) +set_source_files_properties (${HDF5_F90_BINARY_DIR}/H5_gen.F90 PROPERTIES GENERATED TRUE) #----------------------------------------------------------------------------- # Fortran Modules #----------------------------------------------------------------------------- -set (f90_F_SRCS +set (f90_F_BASE_SRCS # generated files - ${HDF5_F90_BINARY_DIR}/H5fortran_types.f90 + ${HDF5_F90_BINARY_DIR}/H5fortran_types.F90 # normal distribution - ${HDF5_F90_SRC_SOURCE_DIR}/H5f90global.f90 - ${HDF5_F90_SRC_SOURCE_DIR}/H5_ff${F_STATUS}.f90 - ${HDF5_F90_SRC_SOURCE_DIR}/H5_ff.f90 - ${HDF5_F90_SRC_SOURCE_DIR}/H5Aff.f90 - ${HDF5_F90_SRC_SOURCE_DIR}/H5Dff.f90 - ${HDF5_F90_SRC_SOURCE_DIR}/H5Eff.f90 - ${HDF5_F90_SRC_SOURCE_DIR}/H5Fff.f90 - ${HDF5_F90_SRC_SOURCE_DIR}/H5Gff.f90 - ${HDF5_F90_SRC_SOURCE_DIR}/H5Iff.f90 - ${HDF5_F90_SRC_SOURCE_DIR}/H5Lff.f90 - ${HDF5_F90_SRC_SOURCE_DIR}/H5Off.f90 - ${HDF5_F90_SRC_SOURCE_DIR}/H5Pff.f90 - ${HDF5_F90_SRC_SOURCE_DIR}/H5Rff.f90 - ${HDF5_F90_SRC_SOURCE_DIR}/H5Sff.f90 - ${HDF5_F90_SRC_SOURCE_DIR}/H5Tff.f90 - ${HDF5_F90_SRC_SOURCE_DIR}/H5Zff.f90 - ${HDF5_F90_SRC_SOURCE_DIR}/H5Aff${F_STATUS}.f90 - ${HDF5_F90_SRC_SOURCE_DIR}/H5Dff${F_STATUS}.f90 - ${HDF5_F90_SRC_SOURCE_DIR}/H5Eff${F_STATUS}.f90 - ${HDF5_F90_SRC_SOURCE_DIR}/H5Fff${F_STATUS}.f90 - ${HDF5_F90_SRC_SOURCE_DIR}/H5Lff${F_STATUS}.f90 - ${HDF5_F90_SRC_SOURCE_DIR}/H5Off${F_STATUS}.f90 - ${HDF5_F90_SRC_SOURCE_DIR}/H5Pff${F_STATUS}.f90 - ${HDF5_F90_SRC_SOURCE_DIR}/H5Rff${F_STATUS}.f90 - ${HDF5_F90_SRC_SOURCE_DIR}/H5Tff${F_STATUS}.f90 - ${HDF5_F90_SRC_SOURCE_DIR}/H5_DBLE_Interface${F_DBLE}.f90 + ${HDF5_F90_SRC_SOURCE_DIR}/H5f90global.F90 + ${HDF5_F90_SRC_SOURCE_DIR}/H5_ff.F90 + ${HDF5_F90_SRC_SOURCE_DIR}/H5Aff.F90 + ${HDF5_F90_SRC_SOURCE_DIR}/H5Dff.F90 + ${HDF5_F90_SRC_SOURCE_DIR}/H5Eff.F90 + ${HDF5_F90_SRC_SOURCE_DIR}/H5Fff.F90 + ${HDF5_F90_SRC_SOURCE_DIR}/H5Gff.F90 + ${HDF5_F90_SRC_SOURCE_DIR}/H5Iff.F90 + ${HDF5_F90_SRC_SOURCE_DIR}/H5Lff.F90 + ${HDF5_F90_SRC_SOURCE_DIR}/H5Off.F90 + ${HDF5_F90_SRC_SOURCE_DIR}/H5Pff.F90 + ${HDF5_F90_SRC_SOURCE_DIR}/H5Rff.F90 + ${HDF5_F90_SRC_SOURCE_DIR}/H5Sff.F90 + ${HDF5_F90_SRC_SOURCE_DIR}/H5Tff.F90 + ${HDF5_F90_SRC_SOURCE_DIR}/H5Zff.F90 +) + +set (f90_F_SRCS + ${f90_F_BASE_SRCS} + + # generated file + ${HDF5_F90_BINARY_DIR}/H5_gen.F90 + + # normal distribution + ${HDF5_F90_SRC_SOURCE_DIR}/HDF5.F90 +) + +set (CMD $) +add_custom_target (H5gen ALL + COMMAND ${CMD} +#v3.2 BYPRODUCT ${HDF5_F90_BINARY_DIR}/H5_gen.F90 + WORKING_DIRECTORY ${HDF5_F90_BINARY_DIR} + DEPENDS ${f90_F_BASE_SRCS} ) -#----------------------------------------------------------------------------- -# Add H5FDMPIO if parallel -#----------------------------------------------------------------------------- -if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) - set (f90_F_SRCS - ${f90_F_SRCS} - ${HDF5_F90_SRC_SOURCE_DIR}/HDF5mpio.f90 - ${HDF5_F90_SRC_SOURCE_DIR}/H5FDmpioff.f90 - ) -else (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) - set (f90_F_SRCS - ${f90_F_SRCS} - ${HDF5_F90_SRC_SOURCE_DIR}/HDF5.f90 - ) -endif (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) set_source_files_properties (${f90_F_SRCS} PROPERTIES LANGUAGE Fortran) #----------------------------------------------------------------------------- @@ -326,15 +239,15 @@ endif (BUILD_SHARED_LIBS) # Add file(s) to CMake Install #----------------------------------------------------------------------------- install ( - FILES - ${HDF5_F90_SRC_SOURCE_DIR}/H5f90.h - ${HDF5_F90_SRC_SOURCE_DIR}/H5f90i.h - ${HDF5_F90_SRC_SOURCE_DIR}/H5f90proto.h + FILES + ${HDF5_F90_SRC_SOURCE_DIR}/H5f90.h + ${HDF5_F90_SRC_SOURCE_DIR}/H5f90i.h + ${HDF5_F90_SRC_SOURCE_DIR}/H5f90proto.h ${HDF5_F90_BINARY_DIR}/H5f90i_gen.h - ${HDF5_F90_BINARY_DIR}/H5fortran_types.f90 - DESTINATION + ${HDF5_F90_BINARY_DIR}/H5fortran_types.F90 + DESTINATION ${HDF5_INSTALL_INCLUDE_DIR} - COMPONENT + COMPONENT fortheaders ) @@ -370,17 +283,7 @@ set (mod_files ${MOD_BUILD_DIR}/h5s.mod ${MOD_BUILD_DIR}/h5t.mod ${MOD_BUILD_DIR}/h5z.mod - ${MOD_BUILD_DIR}/h5a_provisional.mod - ${MOD_BUILD_DIR}/h5d_provisional.mod - ${MOD_BUILD_DIR}/h5e_provisional.mod - ${MOD_BUILD_DIR}/h5f_provisional.mod - ${MOD_BUILD_DIR}/h5l_provisional.mod - ${MOD_BUILD_DIR}/h5lib_provisional.mod - ${MOD_BUILD_DIR}/h5o_provisional.mod - ${MOD_BUILD_DIR}/h5p_provisional.mod - ${MOD_BUILD_DIR}/h5r_provisional.mod - ${MOD_BUILD_DIR}/h5t_provisional.mod - ${MOD_BUILD_DIR}/h5_dble_interface.mod + ${MOD_BUILD_DIR}/h5_gen.mod ) install ( FILES diff --git a/fortran/src/H5Af.c b/fortran/src/H5Af.c index bc2e9f1..8f012cf 100644 --- a/fortran/src/H5Af.c +++ b/fortran/src/H5Af.c @@ -1,6 +1,6 @@ /****h* H5Af/H5Af * PURPOSE - * This file contains C stubs for H5A Fortran APIs + * This file contains C stubs for H5A Fortran APIs * * COPYRIGHT * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * @@ -26,942 +26,31 @@ /****if* H5Af/h5acreate_c * NAME - * h5acreate_c + * h5acreate_c * PURPOSE - * Call H5Acreate2 to create an attribute + * Call H5Acreate2 to create an attribute * INPUTS - * obj_id - object identifier - * name - name of the attribute - * namelen - name length - * type_id - datatype identifier - * space_id - dataspace identifier - * crt_pr - identifier of creation property list + * obj_id - object identifier + * name - name of the attribute + * namelen - name length + * type_id - datatype identifier + * space_id - dataspace identifier + * crt_pr - identifier of creation property list * OUTPUTS - * attr_id - attribute identifier + * attr_id - attribute identifier * RETURNS - * 0 on success, -1 on failure - * AUTHOR - * Elena Pourmal - * Thursday, August 12, 1999 - * HISTORY - * - * SOURCE -*/ -int_f -nh5acreate_c(hid_t_f *obj_id, _fcd name, size_t_f *namelen, hid_t_f *type_id, - hid_t_f *space_id, hid_t_f *crt_prp, hid_t_f *aapl, hid_t_f *attr_id) -/*******/ -{ - char *c_name = NULL; /* Buffer to hold C string */ - int_f ret_value = 0; /* Return value */ - - /* - * Convert FORTRAN name to C name - */ - if(NULL == (c_name = HD5f2cstring(name, (size_t)*namelen))) - HGOTO_DONE(FAIL); - - /* - * Call H5Acreate2 function. - */ - if((*attr_id = (hid_t_f)H5Acreate2((hid_t)*obj_id, c_name, (hid_t)*type_id, (hid_t)*space_id, (hid_t)*crt_prp, (hid_t)*aapl)) < 0) - HGOTO_DONE(FAIL); - -done: - if(c_name) - HDfree(c_name); - return ret_value; -} - -/****if* H5Af/h5aopen_name_c - * NAME - * h5aopen_name_c - * PURPOSE - * Call H5Aopen to open an attribute - * INPUTS - * obj_id - object identifier - * name - name of the attribute - * namelen - name length - * OUTPUTS - * attr_id - dataset identifier - * RETURNS - * 0 on success, -1 on failure - * AUTHOR - * Elena Pourmal - * Thursday, August 12, 1999 - * HISTORY - * - * SOURCE -*/ -int_f -nh5aopen_name_c (hid_t_f *obj_id, _fcd name, size_t_f *namelen, hid_t_f *attr_id) -/*******/ -{ - char *c_name = NULL; /* Buffer to hold C string */ - int_f ret_value = 0; /* Return value */ - - /* - * Convert FORTRAN name to C name - */ - if((c_name = HD5f2cstring(name, (size_t)*namelen)) == NULL) - HGOTO_DONE(FAIL); - - /* - * Call H5Aopen function. - */ - if((*attr_id = (hid_t_f)H5Aopen((hid_t)*obj_id, c_name, H5P_DEFAULT)) < 0) - HGOTO_DONE(FAIL); - -done: - if(c_name) - HDfree(c_name); - return ret_value; -} - -/****if* H5Af/h5awritec_c - * NAME - * h5awritec_c - * PURPOSE - * Call h5awrite_c to write a character attribute - * INPUTS - * attr_id - dataset identifier - * mem_type_id - memory datatype identifier - * buf - character data buffer - * dims - array to store dimensions sizes of buf; used only - * by Fortran routine. - * RETURNS - * 0 on success, -1 on failure - * AUTHOR - * Elena Pourmal - * Thursday , August 12, 1999 - * HISTORY - * dims paramete added. - * April 4, 2001 - * SOURCE -*/ -int_f -nh5awritec_c (hid_t_f *attr_id, hid_t_f *mem_type_id, _fcd buf, void *dims) -/******/ -{ - /* - * Call h5awrite_c function. - */ - return nh5awrite_c(attr_id, mem_type_id, _fcdtocp(buf), dims); -} -int_f -nh5awritec_s_c (hid_t_f *attr_id, hid_t_f *mem_type_id, _fcd buf, void *dims) -/******/ -{ - /* - * Call h5awrite_c function. - */ - return nh5awrite_c(attr_id, mem_type_id, _fcdtocp(buf), dims); -} - -int_f -nh5awritec_1_c (hid_t_f *attr_id, hid_t_f *mem_type_id, _fcd buf, void *dims) -/******/ -{ - /* - * Call h5awrite_c function. - */ - return nh5awrite_c(attr_id, mem_type_id, _fcdtocp(buf), dims); -} - -int_f -nh5awritec_2_c (hid_t_f *attr_id, hid_t_f *mem_type_id, _fcd buf, void *dims) -/******/ -{ - /* - * Call h5awrite_c function. - */ - return nh5awrite_c(attr_id, mem_type_id, _fcdtocp(buf), dims); -} - -int_f -nh5awritec_3_c (hid_t_f *attr_id, hid_t_f *mem_type_id, _fcd buf, void *dims) -/******/ -{ - /* - * Call h5awrite_c function. - */ - return nh5awrite_c(attr_id, mem_type_id, _fcdtocp(buf), dims); -} - -int_f -nh5awritec_4_c (hid_t_f *attr_id, hid_t_f *mem_type_id, _fcd buf, void *dims) -/******/ -{ - /* - * Call h5awrite_c function. - */ - return nh5awrite_c(attr_id, mem_type_id, _fcdtocp(buf), dims); -} - -int_f -nh5awritec_5_c (hid_t_f *attr_id, hid_t_f *mem_type_id, _fcd buf, void *dims) -/******/ -{ - /* - * Call h5awrite_c function. - */ - return nh5awrite_c(attr_id, mem_type_id, _fcdtocp(buf), dims); -} - -int_f -nh5awritec_6_c (hid_t_f *attr_id, hid_t_f *mem_type_id, _fcd buf, void *dims) -/******/ -{ - /* - * Call h5awrite_c function. - */ - return nh5awrite_c(attr_id, mem_type_id, _fcdtocp(buf), dims); -} - -int_f -nh5awritec_7_c (hid_t_f *attr_id, hid_t_f *mem_type_id, _fcd buf, void *dims) -/******/ -{ - /* - * Call h5awrite_c function. - */ - return nh5awrite_c(attr_id, mem_type_id, _fcdtocp(buf), dims); -} - - - -/****if* H5Af/h5awrite_c - * NAME - * h5awrite_c - * PURPOSE - * Call H5Awrite to write a attribute - * INPUTS - * attr_id - attribute identifier - * mem_type_id - memory datatype identifier - * buf - data buffer - * dims - array to store dimensions sizes of buf; used only - * by Fortran routine. - * RETURNS - * 0 on success, -1 on failure - * AUTHOR - * Elena Pourmal - * Thursday, August 12, 1999 - * HISTORY - * dims parameter added - * April 4, 2001 - * Added nh5awrite_integer(real,double)_s,1-7 functions to eliminate - * complains about wrong parameters types in h5awrite_c function - * called by Fortran routines. - * October 9, 2006 EIP - * SOURCE -*/ -int_f -nh5awrite_integer_s_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED *dims) -/******/ -{ - /* - * Call h5awrite_c function. - */ - return nh5awrite_c(attr_id, mem_type_id, buf, dims); -} - -int_f -nh5awrite_integer_1_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED *dims) -/******/ -{ - /* - * Call h5awrite_c function. - */ - return nh5awrite_c(attr_id, mem_type_id, buf, dims); -} - -int_f -nh5awrite_integer_2_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED *dims) -/******/ -{ - /* - * Call h5awrite_c function. - */ - return nh5awrite_c(attr_id, mem_type_id, buf, dims); -} - -int_f -nh5awrite_integer_3_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED *dims) -/******/ -{ - /* - * Call h5awrite_c function. - */ - return nh5awrite_c(attr_id, mem_type_id, buf, dims); -} - -int_f -nh5awrite_integer_4_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED *dims) -/******/ -{ - /* - * Call h5awrite_c function. - */ - return nh5awrite_c(attr_id, mem_type_id, buf, dims); -} - -int_f -nh5awrite_integer_5_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED *dims) -/******/ -{ - /* - * Call h5awrite_c function. - */ - return nh5awrite_c(attr_id, mem_type_id, buf, dims); -} - -int_f -nh5awrite_integer_6_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED *dims) -/******/ -{ - /* - * Call h5awrite_c function. - */ - return nh5awrite_c(attr_id, mem_type_id, buf, dims); -} - -int_f -nh5awrite_integer_7_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED *dims) -/******/ -{ - /* - * Call h5awrite_c function. - */ - return nh5awrite_c(attr_id, mem_type_id, buf, dims); -} - -int_f -nh5awrite_real_s_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED *dims) -/******/ -{ - /* - * Call h5awrite_c function. - */ - return nh5awrite_c(attr_id, mem_type_id, buf, dims); -} - -int_f -nh5awrite_real_1_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED *dims) -/******/ -{ - /* - * Call h5awrite_c function. - */ - return nh5awrite_c(attr_id, mem_type_id, buf, dims); -} - -int_f -nh5awrite_real_2_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED *dims) -/******/ -{ - /* - * Call h5awrite_c function. - */ - return nh5awrite_c(attr_id, mem_type_id, buf, dims); -} - -int_f -nh5awrite_real_3_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED *dims) -/******/ -{ - /* - * Call h5awrite_c function. - */ - return nh5awrite_c(attr_id, mem_type_id, buf, dims); -} - -int_f -nh5awrite_real_4_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED *dims) -/******/ -{ - /* - * Call h5awrite_c function. - */ - return nh5awrite_c(attr_id, mem_type_id, buf, dims); -} - -int_f -nh5awrite_real_5_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED *dims) -/******/ -{ - /* - * Call h5awrite_c function. - */ - return nh5awrite_c(attr_id, mem_type_id, buf, dims); -} - -int_f -nh5awrite_real_6_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED *dims) -/******/ -{ - /* - * Call h5awrite_c function. - */ - return nh5awrite_c(attr_id, mem_type_id, buf, dims); -} - -int_f -nh5awrite_real_7_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED *dims) -/******/ -{ - /* - * Call h5awrite_c function. - */ - return nh5awrite_c(attr_id, mem_type_id, buf, dims); -} - -int_f -nh5awrite_double_s_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED *dims) -/******/ -{ - /* - * Call h5awrite_c function. - */ - return nh5awrite_c(attr_id, mem_type_id, buf, dims); -} - -int_f -nh5awrite_double_1_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED *dims) -/******/ -{ - /* - * Call h5awrite_c function. - */ - return nh5awrite_c(attr_id, mem_type_id, buf, dims); -} - -int_f -nh5awrite_double_2_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED *dims) -/******/ -{ - /* - * Call h5awrite_c function. - */ - return nh5awrite_c(attr_id, mem_type_id, buf, dims); -} - -int_f -nh5awrite_double_3_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED *dims) -/******/ -{ - /* - * Call h5awrite_c function. - */ - return nh5awrite_c(attr_id, mem_type_id, buf, dims); -} - -int_f -nh5awrite_double_4_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED *dims) -/******/ -{ - /* - * Call h5awrite_c function. - */ - return nh5awrite_c(attr_id, mem_type_id, buf, dims); -} - -int_f -nh5awrite_double_5_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED *dims) -/******/ -{ - /* - * Call h5awrite_c function. - */ - return nh5awrite_c(attr_id, mem_type_id, buf, dims); -} - -int_f -nh5awrite_double_6_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED *dims) -/******/ -{ - /* - * Call h5awrite_c function. - */ - return nh5awrite_c(attr_id, mem_type_id, buf, dims); -} - -int_f -nh5awrite_double_7_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED *dims) -/******/ -{ - /* - * Call h5awrite_c function. - */ - return nh5awrite_c(attr_id, mem_type_id, buf, dims); -} - -int_f -nh5awrite_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED *dims) -/******/ -{ - int_f ret_value=0; /* Return value */ - - /* - * Call H5Awrite function. - */ - if (H5Awrite((hid_t)*attr_id, (hid_t)*mem_type_id, buf) < 0) - HGOTO_DONE(FAIL); - -done: - return ret_value; -} - - -/****if* H5Af/h5areadc_c - * NAME - * h5areadc_c - * PURPOSE - * Call h5aread_c to read character attribute - * INPUTS - * dset_id - dataset identifier - * mem_type_id - memory datatype identifier - * dims - array to store dimensions sizes of buf; used only - * by Fortran routine. - * OUTPUTS - * buf - character data buffer - * RETURNS - * 0 on success, -1 on failure - * AUTHOR - * Elena Pourmal - * Thursday, August 12, 1999 - * HISTORY - * dims parameter added. - * April 4, 2001 - * Added nh5areadc_s,1-7 functions to eliminate - * complains about wrong parameters types in h5awrite_c function - * called by Fortran routines. - * October 9, 2006 EIP - * SOURCE -*/ -int_f -nh5areadc_c (hid_t_f *attr_id, hid_t_f *mem_type_id, _fcd buf, void *dims) -/******/ -{ - /* - * Call h5aread_c function. - */ - return nh5aread_c(attr_id, mem_type_id, _fcdtocp(buf), dims); -} -int_f -nh5areadc_s_c (hid_t_f *attr_id, hid_t_f *mem_type_id, _fcd buf, void *dims) -/******/ -{ - /* - * Call h5aread_c function. - */ - return nh5aread_c(attr_id, mem_type_id, _fcdtocp(buf), dims); -} - -int_f -nh5areadc_1_c (hid_t_f *attr_id, hid_t_f *mem_type_id, _fcd buf, void *dims) -/******/ -{ - /* - * Call h5aread_c function. - */ - return nh5aread_c(attr_id, mem_type_id, _fcdtocp(buf), dims); -} - -int_f -nh5areadc_2_c (hid_t_f *attr_id, hid_t_f *mem_type_id, _fcd buf, void *dims) -/******/ -{ - /* - * Call h5aread_c function. - */ - return nh5aread_c(attr_id, mem_type_id, _fcdtocp(buf), dims); -} - -int_f -nh5areadc_3_c (hid_t_f *attr_id, hid_t_f *mem_type_id, _fcd buf, void *dims) -/******/ -{ - /* - * Call h5aread_c function. - */ - return nh5aread_c(attr_id, mem_type_id, _fcdtocp(buf), dims); -} - -int_f -nh5areadc_4_c (hid_t_f *attr_id, hid_t_f *mem_type_id, _fcd buf, void *dims) -/******/ -{ - /* - * Call h5aread_c function. - */ - return nh5aread_c(attr_id, mem_type_id, _fcdtocp(buf), dims); -} - -int_f -nh5areadc_5_c (hid_t_f *attr_id, hid_t_f *mem_type_id, _fcd buf, void *dims) -/******/ -{ - /* - * Call h5aread_c function. - */ - return nh5aread_c(attr_id, mem_type_id, _fcdtocp(buf), dims); -} - -int_f -nh5areadc_6_c (hid_t_f *attr_id, hid_t_f *mem_type_id, _fcd buf, void *dims) -/******/ -{ - /* - * Call h5aread_c function. - */ - return nh5aread_c(attr_id, mem_type_id, _fcdtocp(buf), dims); -} -int_f -nh5areadc_7_c (hid_t_f *attr_id, hid_t_f *mem_type_id, _fcd buf, void *dims) -/******/ -{ - /* - * Call h5aread_c function. - */ - return nh5aread_c(attr_id, mem_type_id, _fcdtocp(buf), dims); -} - - - -/****if* H5Af/h5aread_c - * NAME - * h5aread_c - * PURPOSE - * Call H5Aread to read an attribute - * INPUTS - * dset_id - dataset identifier - * mem_type_id - memory datatype identifier - * dims - array to store dimensions sizes of buf; used only - * by Fortran routine. - * OUTPUTS - * buf - data buffer - * RETURNS - * 0 on success, -1 on failure - * AUTHOR - * Elena Pourmal - * Thursday, August 12, 1999 - * HISTORY - * dims paramete added. - * April 4, 2001 - * Added nh5aread_integer(real,double)_s,1-7 functions to eliminate - * complains about wrong parameters types in h5awrite_c function - * called by Fortran routines. - * October 9, 2006 EIP - * SOURCE -*/ -int_f -nh5aread_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED * dims) -/******/ -{ - int_f ret_value=0; /* Return value */ - - /* - * Call H5Aread function. - */ - if (H5Aread((hid_t)*attr_id, (hid_t)*mem_type_id, buf) < 0) - HGOTO_DONE(FAIL); - -done: - return ret_value; -} - -int_f -nh5aread_integer_s_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED * dims) -/******/ -{ - /* - * Call h5aread_c function. - */ - return nh5aread_c(attr_id, mem_type_id, buf, dims); -} - -int_f -nh5aread_integer_1_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED * dims) -/******/ -{ - /* - * Call h5aread_c function. - */ - return nh5aread_c(attr_id, mem_type_id, buf, dims); -} - -int_f -nh5aread_integer_2_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED * dims) -/******/ -{ - /* - * Call h5aread_c function. - */ - return nh5aread_c(attr_id, mem_type_id, buf, dims); -} - -int_f -nh5aread_integer_3_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED * dims) -/******/ -{ - /* - * Call h5aread_c function. - */ - return nh5aread_c(attr_id, mem_type_id, buf, dims); -} - -int_f -nh5aread_integer_4_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED * dims) -/******/ -{ - /* - * Call h5aread_c function. - */ - return nh5aread_c(attr_id, mem_type_id, buf, dims); -} - -int_f -nh5aread_integer_5_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED * dims) -/******/ -{ - /* - * Call h5aread_c function. - */ - return nh5aread_c(attr_id, mem_type_id, buf, dims); -} - -int_f -nh5aread_integer_6_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED * dims) -/******/ -{ - /* - * Call h5aread_c function. - */ - return nh5aread_c(attr_id, mem_type_id, buf, dims); -} - -int_f -nh5aread_integer_7_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED * dims) -/******/ -{ - /* - * Call h5aread_c function. - */ - return nh5aread_c(attr_id, mem_type_id, buf, dims); -} - -int_f -nh5aread_real_s_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED * dims) -/******/ -{ - /* - * Call h5aread_c function. - */ - return nh5aread_c(attr_id, mem_type_id, buf, dims); -} - -int_f -nh5aread_real_1_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED * dims) -/******/ -{ - /* - * Call h5aread_c function. - */ - return nh5aread_c(attr_id, mem_type_id, buf, dims); -} - -int_f -nh5aread_real_2_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED * dims) -/******/ -{ - /* - * Call h5aread_c function. - */ - return nh5aread_c(attr_id, mem_type_id, buf, dims); -} - -int_f -nh5aread_real_3_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED * dims) -/******/ -{ - /* - * Call h5aread_c function. - */ - return nh5aread_c(attr_id, mem_type_id, buf, dims); -} - -int_f -nh5aread_real_4_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED * dims) -/******/ -{ - /* - * Call h5aread_c function. - */ - return nh5aread_c(attr_id, mem_type_id, buf, dims); -} - -int_f -nh5aread_real_5_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED * dims) -/******/ -{ - /* - * Call h5aread_c function. - */ - return nh5aread_c(attr_id, mem_type_id, buf, dims); -} - -int_f -nh5aread_real_6_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED * dims) -/******/ -{ - /* - * Call h5aread_c function. - */ - return nh5aread_c(attr_id, mem_type_id, buf, dims); -} - -int_f -nh5aread_real_7_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED * dims) -/******/ -{ - /* - * Call h5aread_c function. - */ - return nh5aread_c(attr_id, mem_type_id, buf, dims); -} - -int_f -nh5aread_double_s_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED * dims) -/******/ -{ - /* - * Call h5aread_c function. - */ - return nh5aread_c(attr_id, mem_type_id, buf, dims); -} - -int_f -nh5aread_double_1_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED * dims) -/******/ -{ - /* - * Call h5aread_c function. - */ - return nh5aread_c(attr_id, mem_type_id, buf, dims); -} - -int_f -nh5aread_double_2_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED * dims) -/******/ -{ - /* - * Call h5aread_c function. - */ - return nh5aread_c(attr_id, mem_type_id, buf, dims); -} - -int_f -nh5aread_double_3_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED * dims) -/******/ -{ - /* - * Call h5aread_c function. - */ - return nh5aread_c(attr_id, mem_type_id, buf, dims); -} - -int_f -nh5aread_double_4_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED * dims) -/******/ -{ - /* - * Call h5aread_c function. - */ - return nh5aread_c(attr_id, mem_type_id, buf, dims); -} - -int_f -nh5aread_double_5_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED * dims) -/******/ -{ - /* - * Call h5aread_c function. - */ - return nh5aread_c(attr_id, mem_type_id, buf, dims); -} - -int_f -nh5aread_double_6_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED * dims) -/******/ -{ - /* - * Call h5aread_c function. - */ - return nh5aread_c(attr_id, mem_type_id, buf, dims); -} - -int_f -nh5aread_double_7_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED * dims) -/******/ -{ - /* - * Call h5aread_c function. - */ - return nh5aread_c(attr_id, mem_type_id, buf, dims); -} - - -/****if* H5Af/h5aclose_c - * NAME - * h5aclose_c - * PURPOSE - * Call H5Aclose to close an attribute - * INPUTS - * attr_id - identifier of an attribute to be closed - * RETURNS - * 0 on success, -1 on failure - * AUTHOR - * Elena Pourmal - * Thursday, August 12, 1999 - * HISTORY - * - * SOURCE -*/ - -int_f -nh5aclose_c ( hid_t_f *attr_id ) -/******/ -{ - int_f ret_value=0; /* Return value */ - - if (H5Aclose((hid_t)*attr_id) < 0) - HGOTO_DONE(FAIL); - -done: - return ret_value; -} - -/****if* H5Af/h5adelete_c - * NAME - * h5adelete_c - * PURPOSE - * Call H5Adelete to delete an attribute - * INPUTS - * obj_id - object identifier - * name - name of the attribute - * namelen - name length - * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * Thursday, August 12, 1999 + * Thursday, August 12, 1999 * HISTORY * * SOURCE */ int_f -nh5adelete_c (hid_t_f *obj_id, _fcd name, size_t_f *namelen) -/******/ +h5acreate_c(hid_t_f *obj_id, _fcd name, size_t_f *namelen, hid_t_f *type_id, + hid_t_f *space_id, hid_t_f *crt_prp, hid_t_f *aapl, hid_t_f *attr_id) +/*******/ { char *c_name = NULL; /* Buffer to hold C string */ int_f ret_value = 0; /* Return value */ @@ -969,147 +58,85 @@ nh5adelete_c (hid_t_f *obj_id, _fcd name, size_t_f *namelen) /* * Convert FORTRAN name to C name */ - if((c_name = HD5f2cstring(name, (size_t)*namelen)) == NULL) + if(NULL == (c_name = HD5f2cstring(name, (size_t)*namelen))) HGOTO_DONE(FAIL); /* - * Call H5Adelete function. + * Call H5Acreate2 function. */ - if(H5Adelete((hid_t)*obj_id, c_name) < 0) - HGOTO_DONE(FAIL); + if((*attr_id = (hid_t_f)H5Acreate2((hid_t)*obj_id, c_name, (hid_t)*type_id, (hid_t)*space_id, (hid_t)*crt_prp, (hid_t)*aapl)) < 0) + HGOTO_DONE(FAIL); done: if(c_name) HDfree(c_name); - return ret_value; } - -/****if* H5Af/h5aopen_idx_c +/****if* H5Af/h5adelete_c * NAME - * h5aopen_idx_c + * h5adelete_c * PURPOSE - * Call H5Aopen_by_idx to open an attribute + * Call H5Adelete to delete an attribute * INPUTS - * obj_id - object identifier - * idx - attribute index ( zero based) - * OUTPUTS - * attr_id - attribute identifier + * obj_id - object identifier + * name - name of the attribute + * namelen - name length * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * Thursday, August 12, 1999 + * Thursday, August 12, 1999 * HISTORY * * SOURCE */ int_f -nh5aopen_idx_c (hid_t_f *obj_id, int_f *idx, hid_t_f *attr_id) +h5adelete_c (hid_t_f *obj_id, _fcd name, size_t_f *namelen) /******/ { - int_f ret_value = 0; /* Return value */ + char *c_name = NULL; /* Buffer to hold C string */ + int_f ret_value = 0; /* Return value */ /* - * Call H5Aopen_by_idx function. + * Convert FORTRAN name to C name */ - if((*attr_id = (hid_t_f)H5Aopen_by_idx((hid_t)*obj_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, (hsize_t)*idx, H5P_DEFAULT, H5P_DEFAULT)) < 0) + if((c_name = HD5f2cstring(name, (size_t)*namelen)) == NULL) HGOTO_DONE(FAIL); -done: - return ret_value; -} - - -/****if* H5Af/h5aget_space_c - * NAME - * h5aget_space_c - * PURPOSE - * Call H5Aget_space to get attribute's dataspace - * INPUTS - * attr_id - attribute identifier - * OUTPUTS - * space_id - dataspace identifier - * RETURNS - * 0 on success, -1 on failure - * AUTHOR - * Elena Pourmal - * Thursday, August 12, 1999 - * HISTORY - * - * SOURCE -*/ -int_f -nh5aget_space_c (hid_t_f *attr_id, hid_t_f *space_id) -/******/ -{ - int_f ret_value=0; /* Return value */ - /* - * Call H5Aget_space function. + * Call H5Adelete function. */ - if ((*space_id = (hid_t_f)H5Aget_space((hid_t)*attr_id)) < 0) + if(H5Adelete((hid_t)*obj_id, c_name) < 0) HGOTO_DONE(FAIL); done: - return ret_value; -} - -/****if* H5Af/h5aget_type_c - * NAME - * h5aget_type_c - * PURPOSE - * Call H5Aget_space to get attribute's datatype - * INPUTS - * attr_id - attribute identifier - * OUTPUTS - * type_id - datatype identifier - * RETURNS - * 0 on success, -1 on failure - * AUTHOR - * Elena Pourmal - * Thursday, August 12, 1999 - * HISTORY - * - * SOURCE -*/ -int_f -nh5aget_type_c (hid_t_f *attr_id, hid_t_f *type_id) -/******/ -{ - int_f ret_value=0; /* Return value */ - - /* - * Call H5Aget_type function. - */ - if ((*type_id = (hid_t_f)H5Aget_type((hid_t)*attr_id)) < 0) - HGOTO_DONE(FAIL); + if(c_name) + HDfree(c_name); -done: - return ret_value; + return ret_value; } /****if* H5Af/h5aget_num_attrs_c * NAME - * h5aget_num_attrs_c + * h5aget_num_attrs_c * PURPOSE - * Call H5Oget_info to determine number of - * attributes of an object + * Call H5Oget_info to determine number of + * attributes of an object * INPUTS - * obj_id - object identifier - * attr_num - number of attributes + * obj_id - object identifier + * attr_num - number of attributes * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * Thursday, August 12, 1999 + * Thursday, August 12, 1999 * HISTORY * * SOURCE */ int_f -nh5aget_num_attrs_c (hid_t_f *obj_id, int_f *attr_num) +h5aget_num_attrs_c (hid_t_f *obj_id, int_f *attr_num) /******/ { H5O_info_t oinfo; /* Object info */ @@ -1130,25 +157,25 @@ done: /****if* H5Af/h5aget_name_c * NAME - * h5aget_name_c + * h5aget_name_c * PURPOSE - * Call H5Aget_name to get attribute's name + * Call H5Aget_name to get attribute's name * INPUTS - * attr_id - attribute identifier - * bufsize - size of the buffer + * attr_id - attribute identifier + * bufsize - size of the buffer * OUTPUTS - * buf - buffer to hold the name + * buf - buffer to hold the name * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * Thursday, August 12, 1999 + * Thursday, August 12, 1999 * HISTORY * * SOURCE */ int_f -nh5aget_name_c(hid_t_f *attr_id, size_t_f *bufsize, _fcd buf) +h5aget_name_c(hid_t_f *attr_id, size_t_f *bufsize, _fcd buf) /******/ { size_t c_bufsize; @@ -1179,99 +206,36 @@ done: return ret_value; } -/****if* H5Af/h5aget_storage_size_c - * NAME - * h5aget_storage_size_c - * PURPOSE - * Call H5Aget_storage_size - * INPUTS - * attr_id - identifier of an attribute - * OUTPUTS - * size - attributes storage requirements - * RETURNS - * 0 on success, -1 on failure - * AUTHOR - * M. Scot Breitenfeld - * January, 2008 - * HISTORY - * N/A - * SOURCE -*/ - -int_f -nh5aget_storage_size_c ( hid_t_f *attr_id, hsize_t_f *size) -/******/ -{ - int_f ret_value=0; /* Return value */ - - if ((*size = (hsize_t_f)H5Aget_storage_size((hid_t)*attr_id)) < 0) - HGOTO_DONE(FAIL); - -done: - return ret_value; -} - -/****if* H5Af/h5aget_create_plist_c - * NAME - * h5aget_create_plist_c - * PURPOSE - * Call H5Aget_create_plist - * INPUTS - * attr_id - identifier of an attribute - * OUTPUTS - * creation_prop_id - Identifier for the attribute’s creation property - * RETURNS - * 0 on success, -1 on failure - * AUTHOR - * M. Scot Breitenfeld - * January, 2008 - * HISTORY - * N/A - * SOURCE -*/ - -int_f -nh5aget_create_plist_c ( hid_t_f *attr_id, hid_t_f *creation_prop_id) -/******/ -{ - int_f ret_value=0; /* Return value */ - - if ((*creation_prop_id = (hid_t_f)H5Aget_create_plist((hid_t)*attr_id)) < 0) - HGOTO_DONE(FAIL); - -done: - return ret_value; -} /****if* H5Af/h5arename_by_name_c * NAME - * h5arename_by_name_c + * h5arename_by_name_c * PURPOSE - * Calls H5Arename_by_name + * Calls H5Arename_by_name * INPUTS - * loc_id - Object identifier - * obj_name - Name of object, relative to location, - * whose attribute is to be renamed - * obj_name_len - Object name length - * old_attr_name - Prior attribute name - * old_attr_name_len - Prior attribute name length - * new_attr_name - New attribute name - * new_attr_name_len - New attribute name length - * lapl_id - Link access property list identifier + * loc_id - Object identifier + * obj_name - Name of object, relative to location, + * whose attribute is to be renamed + * obj_name_len - Object name length + * old_attr_name - Prior attribute name + * old_attr_name_len - Prior attribute name length + * new_attr_name - New attribute name + * new_attr_name_len - New attribute name length + * lapl_id - Link access property list identifier * OUTPUTS * N/A * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * M. Scot Breitenfeld - * January, 2008 + * January, 2008 * HISTORY * N/A * SOURCE */ int_f -nh5arename_by_name_c( hid_t_f *loc_id, _fcd obj_name, size_t_f *obj_namelen, +h5arename_by_name_c( hid_t_f *loc_id, _fcd obj_name, size_t_f *obj_namelen, _fcd old_attr_name, size_t_f *old_attr_namelen, _fcd new_attr_name, size_t_f *new_attr_namelen, hid_t_f *lapl_id ) @@ -1306,27 +270,27 @@ done: /****if* H5Af/h5aopen_c * NAME - * h5aopen_c + * h5aopen_c * PURPOSE - * Call H5Aopen to open an attribute + * Call H5Aopen to open an attribute * INPUTS - * obj_id - Identifer for object to which attribute is attached + * obj_id - Identifer for object to which attribute is attached * attr_name - Attribute access property list - * attr_namelen - size of attr_name - * aapl_id - Link access property list + * attr_namelen - size of attr_name + * aapl_id - Link access property list * OUTPUTS - * attr_id - dataset identifier + * attr_id - dataset identifier * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * M. Scot Breitenfeld - * January, 2008 + * January, 2008 * HISTORY * * SOURCE */ int_f -nh5aopen_c (hid_t_f *obj_id, _fcd attr_name, size_t_f *attr_namelen, hid_t_f *aapl_id, hid_t_f *attr_id) +h5aopen_c (hid_t_f *obj_id, _fcd attr_name, size_t_f *attr_namelen, hid_t_f *aapl_id, hid_t_f *attr_id) /******/ { char *c_attr_name = NULL; /* Buffer to hold C string */ @@ -1351,30 +315,30 @@ done: } /****if* H5Af/h5adelete_by_name_c * NAME - * h5adelete_by_name_c + * h5adelete_by_name_c * PURPOSE - * Call h5adelete_by_name to remove an attribute from a specified location + * Call h5adelete_by_name to remove an attribute from a specified location * INPUTS - * loc_id - identifer for object to which attribute is attached - * obj_name - object identifier - * obj_namelen - name length - * attr_name - name of the attribute - * attr_namelen - name length - * lapl_id - link access property list + * loc_id - identifer for object to which attribute is attached + * obj_name - object identifier + * obj_namelen - name length + * attr_name - name of the attribute + * attr_namelen - name length + * lapl_id - link access property list * * OUTPUTS * N/A * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * M. Scot Breitenfeld - * January, 2008 + * January, 2008 * HISTORY * N/A * SOURCE */ int_f -nh5adelete_by_name_c (hid_t_f *loc_id, _fcd obj_name, size_t_f *obj_namelen, _fcd attr_name, size_t_f *attr_namelen, hid_t_f *lapl_id) +h5adelete_by_name_c (hid_t_f *loc_id, _fcd obj_name, size_t_f *obj_namelen, _fcd attr_name, size_t_f *attr_namelen, hid_t_f *lapl_id) /******/ { char *c_obj_name = NULL; /* Buffer to hold C string */ @@ -1404,30 +368,30 @@ done: } /****if* H5Af/h5adelete_by_idx_c * NAME - * h5adelete_by_idx_c + * h5adelete_by_idx_c * PURPOSE - * Call h5adelete_by_idx + * Call h5adelete_by_idx * INPUTS - * loc_id - Location or object identifier; may be dataset or group - * obj_name - object identifier - * obj_namelen - name length - * attr_name - name of the attribute - * attr_namelen - name length - * lapl_id - link access property list + * loc_id - Location or object identifier; may be dataset or group + * obj_name - object identifier + * obj_namelen - name length + * attr_name - name of the attribute + * attr_namelen - name length + * lapl_id - link access property list * * OUTPUTS * N/A * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * M. Scot Breitenfeld - * January, 2008 + * January, 2008 * HISTORY * N/A * SOURCE */ int_f -nh5adelete_by_idx_c (hid_t_f *loc_id, _fcd obj_name, size_t_f *obj_namelen, +h5adelete_by_idx_c (hid_t_f *loc_id, _fcd obj_name, size_t_f *obj_namelen, int_f *idx_type, int_f *order, hsize_t_f *n, hid_t_f *lapl_id) /******/ { @@ -1454,50 +418,50 @@ done: } /****if* H5Af/h5aget_name_by_idx_c * NAME - * h5aget_name_by_idx_c + * h5aget_name_by_idx_c * PURPOSE - * Call h5aget_name_by_idx + * Call h5aget_name_by_idx * INPUTS * * - * loc_id - Identifer for object to which attribute is attached - * obj_name - Name of object, relative to location, - * from which attribute is to be removed *TEST* check NULL - * idx_type - Type of index; Possible values are: + * loc_id - Identifer for object to which attribute is attached + * obj_name - Name of object, relative to location, + * from which attribute is to be removed *TEST* check NULL + * idx_type - Type of index; Possible values are: * H5_INDEX_UNKNOWN - Unknown index type * H5_INDEX_NAME - Index on names * H5_INDEX_CRT_ORDER - Index on creation order * H5_INDEX_N - Number of indices defined * - * order - Order in which to iterate over index; Possible values are: + * order - Order in which to iterate over index; Possible values are: * H5_ITER_UNKNOWN - Unknown order * H5_ITER_INC - Increasing order * H5_ITER_DEC - Decreasing order * H5_ITER_NATIVE - No particular order, whatever is fastest * H5_ITER_N - Number of iteration orders * - * n - Attribute’s position in index - * attr_id - Attribute identifier - * size - Buffer size ! *TEST* check for 0 value *CHECK* should this return the correct value + * n - Attribute’s position in index + * attr_id - Attribute identifier + * size - Buffer size ! *TEST* check for 0 value *CHECK* should this return the correct value * - * lapl_id - Link access property list - * hdferr - Error code: - * Returns attribute name size, -1 if fail + * lapl_id - Link access property list + * hdferr - Error code: + * Returns attribute name size, -1 if fail * * OUTPUTS - * name - Attribute name + * name - Attribute name * * RETURNS - * Size of buffer on success, -1 on failure + * Size of buffer on success, -1 on failure * AUTHOR * M. Scot Breitenfeld - * January, 2008 + * January, 2008 * HISTORY * N/A * SOURCE */ int_f -nh5aget_name_by_idx_c (hid_t_f *loc_id, _fcd obj_name, size_t_f *obj_namelen, +h5aget_name_by_idx_c (hid_t_f *loc_id, _fcd obj_name, size_t_f *obj_namelen, int_f *idx_type, int_f *order, hsize_t_f *n, _fcd name, size_t_f *size, hid_t_f *lapl_id) /******/ @@ -1545,42 +509,42 @@ done: /****if* H5Af/h5aopen_by_idx_c * NAME - * h5aopen_by_idx_c + * h5aopen_by_idx_c * PURPOSE - * Call H5Aopen_by_idx + * Call H5Aopen_by_idx * INPUTS - * loc_id - Object identifier - * obj_name - Name of object to which attribute is attached - * obj_namelen - name length - * idx_type - Type of index; Possible values are: + * loc_id - Object identifier + * obj_name - Name of object to which attribute is attached + * obj_namelen - name length + * idx_type - Type of index; Possible values are: * H5_INDEX_UNKNOWN - Unknown index type * H5_INDEX_NAME - Index on names * H5_INDEX_CRT_ORDER - Index on creation order * H5_INDEX_N - Number of indices defined * - * order - Order in which to iterate over index; Possible values are: + * order - Order in which to iterate over index; Possible values are: * H5_ITER_UNKNOWN - Unknown order * H5_ITER_INC - Increasing order * H5_ITER_DEC - Decreasing order * H5_ITER_NATIVE - No particular order, whatever is fastest * H5_ITER_N - Number of iteration orders * - * n - Attribute’s position in index - * aapl_id - Attribute access property list - * lapl_id - Link access property list + * n - Attribute’s position in index + * aapl_id - Attribute access property list + * lapl_id - Link access property list * OUTPUTS - * attr_id - attribute identifer + * attr_id - attribute identifer * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * M. Scot Breitenfeld - * January, 2008 + * January, 2008 * HISTORY * N/A * SOURCE */ int_f -nh5aopen_by_idx_c (hid_t_f *loc_id, _fcd obj_name, size_t_f *obj_namelen, +h5aopen_by_idx_c (hid_t_f *loc_id, _fcd obj_name, size_t_f *obj_namelen, int_f *idx_type, int_f *order, hsize_t_f *n, hid_t_f *aapl_id, hid_t_f *lapl_id, hid_t_f *attr_id ) /******/ { @@ -1608,29 +572,29 @@ done: /****if* H5Af/h5aget_info_c * NAME - * h5aget_info_c + * h5aget_info_c * PURPOSE - * Call H5Aget_info + * Call H5Aget_info * INPUTS - * loc_id - Object identifier + * loc_id - Object identifier * OUTPUTS * - * corder_valid - Indicates whether the the creation order data is valid for this attribute - * corder - Is a positive integer containing the creation order of the attribute - * cset - Indicates the character set used for the attribute’s name - * data_size - indicates the size, in the number of characters, of the attribute + * corder_valid - Indicates whether the the creation order data is valid for this attribute + * corder - Is a positive integer containing the creation order of the attribute + * cset - Indicates the character set used for the attribute’s name + * data_size - indicates the size, in the number of characters, of the attribute * * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * M. Scot Breitenfeld - * January, 2008 + * January, 2008 * HISTORY * N/A * SOURCE */ int_f -nh5aget_info_c (hid_t_f *loc_id, int_f *corder_valid, int_f *corder, +h5aget_info_c (hid_t_f *loc_id, int_f *corder_valid, int_f *corder, int_f *cset, hsize_t_f *data_size ) /******/ { @@ -1660,46 +624,46 @@ done: /****if* H5Af/h5aget_info_by_idx_c * NAME - * h5aget_info_by_idx_c + * h5aget_info_by_idx_c * PURPOSE - * Call H5Aget_info_by_idx + * Call H5Aget_info_by_idx * INPUTS - * loc_id - Object identifier - * obj_name - Name of object to which attribute is attached - * obj_namelen - name length - * idx_type - Type of index; Possible values are: + * loc_id - Object identifier + * obj_name - Name of object to which attribute is attached + * obj_namelen - name length + * idx_type - Type of index; Possible values are: * H5_INDEX_UNKNOWN - Unknown index type * H5_INDEX_NAME - Index on names * H5_INDEX_CRT_ORDER - Index on creation order * H5_INDEX_N - Number of indices defined * - * order - Order in which to iterate over index; Possible values are: + * order - Order in which to iterate over index; Possible values are: * H5_ITER_UNKNOWN - Unknown order * H5_ITER_INC - Increasing order * H5_ITER_DEC - Decreasing order * H5_ITER_NATIVE - No particular order, whatever is fastest * H5_ITER_N - Number of iteration orders * - * n - Attribute’s position in index - * lapl_id - Link access property list + * n - Attribute’s position in index + * lapl_id - Link access property list * OUTPUTS * - * corder_valid - Indicates whether the the creation order data is valid for this attribute - * corder - Is a positive integer containing the creation order of the attribute - * cset - Indicates the character set used for the attribute’s name - * data_size - indicates the size, in the number of characters, of the attribute + * corder_valid - Indicates whether the the creation order data is valid for this attribute + * corder - Is a positive integer containing the creation order of the attribute + * cset - Indicates the character set used for the attribute’s name + * data_size - indicates the size, in the number of characters, of the attribute * * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * M. Scot Breitenfeld - * January, 2008 + * January, 2008 * HISTORY * N/A * SOURCE */ int_f -nh5aget_info_by_idx_c (hid_t_f *loc_id, _fcd obj_name, size_t_f *obj_namelen, +h5aget_info_by_idx_c (hid_t_f *loc_id, _fcd obj_name, size_t_f *obj_namelen, int_f *idx_type, int_f *order, hsize_t_f *n, hid_t_f *lapl_id, int_f *corder_valid, int_f *corder, int_f *cset, hsize_t_f *data_size ) @@ -1739,34 +703,34 @@ done: /****if* H5Af/h5aget_info_by_name_c * NAME - * h5aget_info_by_name_c + * h5aget_info_by_name_c * PURPOSE - * Call H5Aget_info_by_name + * Call H5Aget_info_by_name * INPUTS - * loc_id - Object identifier - * obj_name - Name of object to which attribute is attached - * obj_namelen - name length - * attr_name - Attribute name - * attr_namelen - attribute name length - * lapl_id - Link access property list + * loc_id - Object identifier + * obj_name - Name of object to which attribute is attached + * obj_namelen - name length + * attr_name - Attribute name + * attr_namelen - attribute name length + * lapl_id - Link access property list * OUTPUTS * - * corder_valid - Indicates whether the the creation order data is valid for this attribute - * corder - Is a positive integer containing the creation order of the attribute - * cset - Indicates the character set used for the attribute’s name - * data_size - indicates the size, in the number of characters, of the attribute + * corder_valid - Indicates whether the the creation order data is valid for this attribute + * corder - Is a positive integer containing the creation order of the attribute + * cset - Indicates the character set used for the attribute’s name + * data_size - indicates the size, in the number of characters, of the attribute * * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * M. Scot Breitenfeld - * January, 2008 + * January, 2008 * HISTORY * N/A * SOURCE */ int_f -nh5aget_info_by_name_c (hid_t_f *loc_id, _fcd obj_name, size_t_f *obj_namelen, +h5aget_info_by_name_c (hid_t_f *loc_id, _fcd obj_name, size_t_f *obj_namelen, _fcd attr_name, size_t_f *attr_namelen, hid_t_f *lapl_id, int_f *corder_valid, int_f *corder, int_f *cset, hsize_t_f *data_size ) @@ -1810,38 +774,38 @@ done: /****if* H5Af/h5acreate_by_name_c * NAME - * h5acreate_by_name_c + * h5acreate_by_name_c * PURPOSE - * Call h5acreate_by_name + * Call h5acreate_by_name * INPUTS * - * loc_id - Object identifier - * obj_name - Name of object to which attribute is attached - * obj_namelen - name length - * attr_name - Attribute name - * attr_namelen - attribute name length - * type_id - Attribute datatype identifier - * space_id - Attribute dataspace identifier - * acpl_id - Attribute creation property list identifier (Currently not used.) - * aapl_id - Attribute access property list identifier (Currently not used.) - * lapl_id - Link access property list + * loc_id - Object identifier + * obj_name - Name of object to which attribute is attached + * obj_namelen - name length + * attr_name - Attribute name + * attr_namelen - attribute name length + * type_id - Attribute datatype identifier + * space_id - Attribute dataspace identifier + * acpl_id - Attribute creation property list identifier (Currently not used.) + * aapl_id - Attribute access property list identifier (Currently not used.) + * lapl_id - Link access property list * * OUTPUTS * - * attr - an attribute identifier + * attr - an attribute identifier * * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * M. Scot Breitenfeld - * February, 2008 + * February, 2008 * HISTORY * N/A * SOURCE */ int_f -nh5acreate_by_name_c(hid_t_f *loc_id, _fcd obj_name, size_t_f *obj_namelen, +h5acreate_by_name_c(hid_t_f *loc_id, _fcd obj_name, size_t_f *obj_namelen, _fcd attr_name, size_t_f *attr_namelen, hid_t_f *type_id, hid_t_f *space_id, hid_t_f *acpl_id, hid_t_f *aapl_id, hid_t_f *lapl_id, hid_t_f *attr_id ) @@ -1876,27 +840,27 @@ done: /****if* H5Af/h5aexists_c * NAME - * h5aexists_c + * h5aexists_c * PURPOSE * CAll h5aexists * INPUTS * - * obj_id - Object identifier - * attr_name - Attribute name + * obj_id - Object identifier + * attr_name - Attribute name * OUTPUTS * - * attr_exists_c - returns a positive value, for TRUE, or 0 (zero), for FALSE. + * attr_exists_c - returns a positive value, for TRUE, or 0 (zero), for FALSE. * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * M. Scot Breitenfeld - * February, 2008 + * February, 2008 * HISTORY * * SOURCE */ int_f -nh5aexists_c (hid_t_f *obj_id, _fcd name, size_t_f *namelen, hid_t_f *attr_exists) +h5aexists_c (hid_t_f *obj_id, _fcd name, size_t_f *namelen, hid_t_f *attr_exists) /******/ { char *c_name = NULL; /* Buffer to hold C string */ @@ -1922,29 +886,29 @@ done: /****if* H5Af/h5aexists_by_name_c * NAME - * h5aexists_by_name_c + * h5aexists_by_name_c * PURPOSE * CAll H5Aexists_by_name * INPUTS * - * loc_id - Location identifier - * obj_name - Object name either relative to loc_id, absolute from the file’s root group, or '.' (a dot) + * loc_id - Location identifier + * obj_name - Object name either relative to loc_id, absolute from the file’s root group, or '.' (a dot) * attr_name - Attribute name - * lapl_id - Link access property list identifier + * lapl_id - Link access property list identifier * OUTPUTS * - * attr_exists_c - returns a positive value, for TRUE, or 0 (zero), for FALSE. + * attr_exists_c - returns a positive value, for TRUE, or 0 (zero), for FALSE. * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * M. Scot Breitenfeld - * February, 2008 + * February, 2008 * HISTORY * * SOURCE */ int_f -nh5aexists_by_name_c (hid_t_f *loc_id, _fcd obj_name, size_t_f *obj_namelen, _fcd attr_name, size_t_f *attr_namelen, +h5aexists_by_name_c (hid_t_f *loc_id, _fcd obj_name, size_t_f *obj_namelen, _fcd attr_name, size_t_f *attr_namelen, hid_t_f *lapl_id, int_f *attr_exists) /******/ { @@ -1976,30 +940,30 @@ done: /****if* H5Af/h5aopen_by_name_c * NAME - * h5aopen_by_name_c + * h5aopen_by_name_c * PURPOSE - * Call H5Aopen_by_name + * Call H5Aopen_by_name * INPUTS * - * loc_id - Location identifier - * obj_name - Object name either relative to loc_id, absolute from the file’s root group, or '.' (a dot) + * loc_id - Location identifier + * obj_name - Object name either relative to loc_id, absolute from the file’s root group, or '.' (a dot) * attr_name - Attribute name - * aapl_id - Attribute access property list (Currently unused; should be passed in as H5P_DEFAULT.) - * lapl_id - Link access property list identifier + * aapl_id - Attribute access property list (Currently unused; should be passed in as H5P_DEFAULT.) + * lapl_id - Link access property list identifier * OUTPUTS * - * attr_id - attribute identifier + * attr_id - attribute identifier * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * M. Scot Breitenfeld - * February, 2008 + * February, 2008 * HISTORY * * SOURCE */ int_f -nh5aopen_by_name_c (hid_t_f *loc_id, _fcd obj_name, size_t_f *obj_namelen, _fcd attr_name, size_t_f *attr_namelen, +h5aopen_by_name_c (hid_t_f *loc_id, _fcd obj_name, size_t_f *obj_namelen, _fcd attr_name, size_t_f *attr_namelen, hid_t_f *aapl_id, hid_t_f *lapl_id, hid_t_f *attr_id) /******/ { @@ -2031,29 +995,29 @@ nh5aopen_by_name_c (hid_t_f *loc_id, _fcd obj_name, size_t_f *obj_namelen, _fcd /****if* H5Af/h5arename_c * NAME - * h5arename_c + * h5arename_c * PURPOSE - * Calls H5Arename + * Calls H5Arename * INPUTS - * loc_id - Object identifier - * old_attr_name - Prior attribute name - * old_attr_name_len - Prior attribute name length - * new_attr_name - New attribute name - * new_attr_name_len - New attribute name length + * loc_id - Object identifier + * old_attr_name - Prior attribute name + * old_attr_name_len - Prior attribute name length + * new_attr_name - New attribute name + * new_attr_name_len - New attribute name length * OUTPUTS * N/A * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * M. Scot Breitenfeld - * January, 2008 + * January, 2008 * HISTORY * N/A * SOURCE */ int_f -nh5arename_c( hid_t_f *loc_id, +h5arename_c( hid_t_f *loc_id, _fcd old_attr_name, size_t_f *old_attr_namelen, _fcd new_attr_name, size_t_f *new_attr_namelen) /******/ diff --git a/fortran/src/H5Aff.F90 b/fortran/src/H5Aff.F90 new file mode 100644 index 0000000..132bf41 --- /dev/null +++ b/fortran/src/H5Aff.F90 @@ -0,0 +1,1873 @@ +!****h* ROBODoc/H5A +! +! NAME +! MODULE H5A +! +! PURPOSE +! This file contains Fortran interfaces for H5A functions. It includes +! all the functions that are independent on whether the Fortran 2003 functions +! are enabled or disabled. +! +! +! 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. * +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! +! NOTES +! +! (A) C_LOC and character strings according to the Fortran 2003 standard: +! +! 15.1.2.5 C_LOC(X) +! +! Argument. X shall either +! +! (1) have interoperable type and type parameters and be +! (a) a variable that has the TARGET attribute and is interoperable, +! (b) an allocated allocatable variable that has the TARGET attribute +! and is not an array of zero size, or +! (c) an associated scalar pointer, or +! (2) be a nonpolymorphic scalar, have no length type parameters, and be +! (a) a nonallocatable, nonpointer variable that has the TARGET attribute, +! (b) an allocated allocatable variable that has the TARGET attribute, or +! (c) an associated pointer. +! +! - When X is a character, for interoperability the standard is: +! +! 15.2.1 Interoperability of intrinsic types +! +! ...if the type is character, interoperability also requires that the length type parameter +! be omitted or be specified by an initialization expression whose value is one. +! +! THEREFORE compilers that have not extended the standard require +! +! CHARACTER(LEN=1), TARGET :: chr +! or +! CHARACTER, TARGET :: chr +! +! (B) +! _____ __ __ _____ ____ _____ _______ _ _ _______ +! |_ _| \/ | __ \ / __ \| __ \__ __|/\ | \ | |__ __| +! **** | | | \ / | |__) | | | | |__) | | | / \ | \| | | | **** +! **** | | | |\/| | ___/| | | | _ / | | / /\ \ | . ` | | | **** +! **** _| |_| | | | | | |__| | | \ \ | |/ ____ \| |\ | | | **** +! |_____|_| |_|_| \____/|_| \_\ |_/_/ \_\_| \_| |_| +! +! If you add a new H5A function you must add the function name to the +! Windows dll file 'hdf5_fortrandll.def.in' in the fortran/src directory. +! This is needed for Windows based operating systems. +! +!***** + +#include + +MODULE H5A + + USE, INTRINSIC :: ISO_C_BINDING + + USE H5GLOBAL + + INTERFACE h5awrite_f + MODULE PROCEDURE h5awrite_char_scalar + ! This is the preferred way to call h5awrite + ! by passing an address + MODULE PROCEDURE h5awrite_ptr + END INTERFACE + + INTERFACE h5aread_f + MODULE PROCEDURE h5aread_char_scalar + ! This is the preferred way to call h5aread + ! by passing an address + MODULE PROCEDURE h5aread_ptr + END INTERFACE + +! Interface for the function used to pass the C pointer of the buffer +! to the C H5Awrite routine + INTERFACE + INTEGER FUNCTION h5awrite_f_c(attr_id, mem_type_id, buf) BIND(C, NAME='h5awrite_f_c') + IMPORT :: c_ptr + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id + INTEGER(HID_T), INTENT(IN) :: mem_type_id + TYPE(C_PTR), VALUE :: buf + END FUNCTION h5awrite_f_c + END INTERFACE + +! Interface for the function used to pass the C pointer of the buffer +! to the C H5Aread routine + INTERFACE + INTEGER FUNCTION h5aread_f_c(attr_id, mem_type_id, buf) BIND(C, NAME='h5aread_f_c') + IMPORT :: c_ptr + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id + INTEGER(HID_T), INTENT(IN) :: mem_type_id + TYPE(C_PTR), VALUE :: buf + END FUNCTION h5aread_f_c + END INTERFACE + +CONTAINS + +! +!****s* H5A/h5acreate_f +! +! NAME +! h5acreate_f +! +! PURPOSE +! Creates a dataset as an attribute of a group, dataset, or named datatype +! +! INPUTS +! loc_id - identifier of an object (group, dataset, +! or named datatype) attribute is attached to +! name - attribute name +! type_id - attribute datatype identifier +! space_id - attribute dataspace identifier +! +! OUTPUTS +! attr_id - attribute identifier +! hdferr - Returns 0 if successful and -1 if fails +! OPTIONAL PARAMETERS +! acpl_id - Attribute creation property list identifier +! appl_id - Attribute access property list identifier +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces are added for +! called C functions (it is needed for Windows +! port). February 27, 2001 +! +! +! SOURCE + SUBROUTINE h5acreate_f(loc_id, name, type_id, space_id, attr_id, & + hdferr, acpl_id, aapl_id ) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id ! Object identifier + CHARACTER(LEN=*), INTENT(IN) :: name ! Attribute name + INTEGER(HID_T), INTENT(IN) :: type_id ! Attribute datatype identifier + INTEGER(HID_T), INTENT(IN) :: space_id ! Attribute dataspace identifier + INTEGER(HID_T), INTENT(OUT) :: attr_id ! Attribute identifier + INTEGER, INTENT(OUT) :: hdferr ! Error code: + ! 0 on success and -1 on failure +!***** + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: acpl_id ! Attribute creation property list identifier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: aapl_id ! Attribute access property list identifier + + INTEGER(HID_T) :: acpl_id_default + INTEGER(HID_T) :: aapl_id_default + CHARACTER(LEN=LEN_TRIM(name)+1,KIND=C_CHAR) :: c_name + INTERFACE + INTEGER(HID_T) FUNCTION H5Acreate2(loc_id, name, type_id, & + space_id, acpl_id_default, aapl_id_default) BIND(C,NAME='H5Acreate2') + IMPORT :: C_CHAR + IMPORT :: HID_T + INTEGER(HID_T), INTENT(IN), VALUE :: loc_id + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: name + INTEGER(HID_T), INTENT(IN), VALUE :: type_id + INTEGER(HID_T), INTENT(IN), VALUE :: space_id + INTEGER(HID_T), INTENT(IN), VALUE :: acpl_id_default + INTEGER(HID_T), INTENT(IN), VALUE :: aapl_id_default + END FUNCTION H5Acreate2 + END INTERFACE + + acpl_id_default = H5P_DEFAULT_F + aapl_id_default = H5P_DEFAULT_F + IF (PRESENT(acpl_id)) acpl_id_default = acpl_id + IF (PRESENT(aapl_id)) aapl_id_default = aapl_id + + c_name = TRIM(name)//C_NULL_CHAR + attr_id = h5acreate2(loc_id, c_name, type_id, space_id, & + acpl_id_default, aapl_id_default) + + hdferr = 0 + IF(attr_id.LT.0) hdferr = -1 + + END SUBROUTINE h5acreate_f + +! +!****s* H5A/h5aopen_name_f +! +! NAME +! h5aopen_name_f +! +! PURPOSE +! Opens an attribute specified by name. +! +! INPUTS +! obj_id - identifier of a group, dataset, or named +! datatype atttribute to be attached to +! name - attribute name +! OUTPUTS +! attr_id - attribute identifier +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces are added for +! called C functions (it is needed for Windows +! port). February 27, 2001 +! +! SOURCE + SUBROUTINE H5Aopen_name_f(obj_id, name, attr_id, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: obj_id ! Object identifier + CHARACTER(LEN=*), INTENT(IN) :: name ! Attribute name + INTEGER(HID_T), INTENT(OUT) :: attr_id ! Attribute identifier + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + CHARACTER(LEN=LEN_TRIM(name)+1,KIND=C_CHAR) :: c_name + +! H5Aopen_name is deprecated + INTERFACE + INTEGER(HID_T) FUNCTION H5Aopen(obj_id, name, aapl_id) BIND(C,NAME='H5Aopen') + IMPORT :: C_CHAR + IMPORT :: HID_T + INTEGER(HID_T), INTENT(IN), VALUE :: obj_id + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: name + INTEGER(HID_T), INTENT(IN), VALUE :: aapl_id + END FUNCTION H5Aopen + END INTERFACE + + c_name = TRIM(name)//C_NULL_CHAR + attr_id = H5Aopen(obj_id, c_name, H5P_DEFAULT_F) + + hdferr = 0 + IF(attr_id.LT.0) hdferr = -1 + + END SUBROUTINE H5Aopen_name_f +! +!****s* H5A/H5Aopen_idx_f +! +! NAME +! H5Aopen_idx_f +! +! PURPOSE +! Opens the attribute specified by its index. +! +! INPUTS +! obj_id - identifier of a group, dataset, or named +! datatype an attribute to be attached to +! index - index of the attribute to open (zero-based) +! OUTPUTS +! attr_id - attribute identifier +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces are added for +! called C functions (it is needed for Windows +! port). February 27, 2001 +! +! SOURCE + SUBROUTINE H5Aopen_idx_f(obj_id, index, attr_id, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: obj_id ! Object identifier + INTEGER, INTENT(IN) :: index ! Attribute index + INTEGER(HID_T), INTENT(OUT) :: attr_id ! Attribute identifier + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** +! H5Aopen_idx is deprecated in favor of the function H5Aopen_by_idx. + INTERFACE + INTEGER(HID_T) FUNCTION H5Aopen_by_idx(obj_id, index) BIND(C,NAME='H5Aopen_by_idx') + IMPORT :: HID_T + IMPORT :: C_INT + INTEGER(HID_T), INTENT(IN) :: obj_id + INTEGER(C_INT), INTENT(IN) :: index + END FUNCTION H5Aopen_by_idx + END INTERFACE + + attr_id = H5Aopen_by_idx(obj_id, INT(index, C_INT)) + + hdferr = 0 + IF(attr_id.LT.0) hdferr = -1 + + END SUBROUTINE H5Aopen_idx_f +! +!****s* H5A/H5Aget_space_f +! +! NAME +! H5Aget_space_f +! +! PURPOSE +! Gets a copy of the dataspace for an attribute. +! +! INPUTS +! attr_id - attribute identifier +! +! OUTPUTS +! space_id - attribite dataspace identifier +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces are added for +! called C functions (it is needed for Windows +! port). February 27, 2001 +! +! +! SOURCE + SUBROUTINE H5Aget_space_f(attr_id, space_id, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier + INTEGER(HID_T), INTENT(OUT) :: space_id ! Attribute dataspace identifier + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + INTERFACE + INTEGER(HID_T) FUNCTION H5Aget_space(attr_id) BIND(C,NAME='H5Aget_space') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN), VALUE :: attr_id + END FUNCTION H5Aget_space + END INTERFACE + + space_id = H5Aget_space(attr_id) + + hdferr = 0 + IF(space_id.LT.0) hdferr = -1 + + END SUBROUTINE H5Aget_space_f +! +!****s* H5A/H5Aget_type_f +! +! NAME +! H5Aget_type_f +! +! PURPOSE +! Gets an attribute datatype. +! +! INPUTS +! attr_id - attribute identifier +! OUTPUTS +! type_id - attribute datatype identifier +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces are added for +! called C functions (it is needed for Windows +! port). February 27, 2001 +! +! SOURCE + SUBROUTINE H5Aget_type_f(attr_id, type_id, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier + INTEGER(HID_T), INTENT(OUT) :: type_id ! Attribute datatype identifier + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + INTERFACE + INTEGER(HID_T) FUNCTION H5Aget_type(attr_id) BIND(C,NAME='H5Aget_type') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN), VALUE :: attr_id + END FUNCTION H5Aget_type + END INTERFACE + + type_id = H5Aget_type(attr_id) + + hdferr = 0 + IF(type_id.LT.0) hdferr = -1 + + END SUBROUTINE H5Aget_type_f +! +!****s* H5A/H5Aget_name_f +! +! NAME +! H5Aget_name_f +! +! PURPOSE +! Gets an attribute name. +! +! INPUTS +! attr_id - attribute identifier +! size - size of a buffer to read name in +! OUTPUTS +! buf - buffer to read name in +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces are added for +! called C functions (it is needed for Windows +! port). February 27, 2001 +! +! +! SOURCE + SUBROUTINE h5aget_name_f(attr_id, size, buf, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier + INTEGER(SIZE_T), INTENT(IN) :: size ! Buffer size + CHARACTER(LEN=*), INTENT(INOUT) :: buf ! Buffer to hold attribute name + INTEGER, INTENT(OUT) :: hdferr ! Error code: + ! name length is successful, -1 if fail +!***** + INTERFACE + INTEGER FUNCTION h5aget_name_c(attr_id, size, buf) & + BIND(C,NAME='h5aget_name_c') + IMPORT :: C_CHAR + IMPORT :: HID_T, SIZE_T + INTEGER(HID_T), INTENT(IN) :: attr_id + INTEGER(SIZE_T), INTENT(IN) :: size + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(OUT) :: buf + END FUNCTION h5aget_name_c + END INTERFACE + + hdferr = h5aget_name_c(attr_id, size, buf) + END SUBROUTINE h5aget_name_f +! +!****s* H5A/H5Aget_name_by_idx_f +! +! NAME +! H5Aget_name_by_idx_f +! +! PURPOSE +! Gets an attribute name, by attribute index position. +! +! INPUTS +! loc_id - Location of object to which attribute is attached +! obj_name - Name of object to which attribute is attached, relative to location +! idx_type - Type of index; Possible values are: +! H5_INDEX_UNKNOWN_F = -1 - Unknown index type +! H5_INDEX_NAME_F - Index on names +! H5_INDEX_CRT_ORDER_F - Index on creation order +! H5_INDEX_N_F - Number of indices defined +! +! order - Order in which to iterate over index; Possible values are: +! H5_ITER_UNKNOWN_F - Unknown order +! H5_ITER_INC_F - Increasing order +! H5_ITER_DEC_F - Decreasing order +! H5_ITER_NATIVE_F - No particular order, whatever is fastest +! H5_ITER_N_F - Number of iteration orders +! order - Index traversal order +! n - Attribute’s position in index +! +! OUTPUTS +! name - Attribute name +! hdferr - Returns 0 if successful and -1 if fails +! +! OPTIONAL PARAMETERS +! lapl_id - Link access property list +! size - Size, in bytes, of attribute name +! +! AUTHOR +! M. Scot Breitenfeld +! January, 2008 +! +! SOURCE + SUBROUTINE h5aget_name_by_idx_f(loc_id, obj_name, idx_type, order, & + n, name, hdferr, size, lapl_id) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id ! Identifer for object to which attribute is attached + CHARACTER(LEN=*), INTENT(IN) :: obj_name ! Name of object, relative to location, + ! from which attribute is to be removed *TEST* check NULL + INTEGER, INTENT(IN) :: idx_type ! Type of index; Possible values are: + ! H5_INDEX_UNKNOWN_F - Unknown index type + ! H5_INDEX_NAME_F - Index on names + ! H5_INDEX_CRT_ORDER_F - Index on creation order + ! H5_INDEX_N_F - Number of indices defined + + INTEGER, INTENT(IN) :: order ! Order in which to iterate over index; Possible values are: + ! H5_ITER_UNKNOWN_F - Unknown order + ! H5_ITER_INC_F - Increasing order + ! H5_ITER_DEC_F - Decreasing order + ! H5_ITER_NATIVE_F - No particular order, whatever is fastest + ! H5_ITER_N_F - Number of iteration orders + INTEGER(HSIZE_T), INTENT(IN) :: n ! Attribute’s position in index + CHARACTER(LEN=*), INTENT(OUT) :: name ! Attribute name + INTEGER, INTENT(OUT) :: hdferr ! Error code: + ! Returns attribute name size, + ! -1 if fail + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list + INTEGER(SIZE_T), OPTIONAL, INTENT(OUT) :: size ! Indicates the size, in the number of characters, + ! of the attribute +!***** + INTEGER(HID_T) :: lapl_id_default + INTEGER(SIZE_T) :: obj_namelen + INTEGER(SIZE_T) :: size_default + + INTERFACE + INTEGER FUNCTION h5aget_name_by_idx_c(loc_id, obj_name, obj_namelen, idx_type, order, & + n, name, size_default, lapl_id_default) BIND(C,NAME='h5aget_name_by_idx_c') + IMPORT :: C_CHAR + IMPORT :: HID_T, SIZE_T, HSIZE_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: obj_name + INTEGER, INTENT(IN) :: idx_type + INTEGER, INTENT(IN) :: order + INTEGER(HSIZE_T), INTENT(IN) :: n + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(OUT) :: name + INTEGER(SIZE_T) :: size_default + INTEGER(HID_T) :: lapl_id_default + INTEGER(SIZE_T) :: obj_namelen + END FUNCTION h5aget_name_by_idx_c + END INTERFACE + + obj_namelen = LEN(obj_name) + lapl_id_default = H5P_DEFAULT_F + IF(PRESENT(lapl_id)) lapl_id_default = lapl_id + + size_default = LEN(name) + + hdferr = h5aget_name_by_idx_c(loc_id, obj_name, obj_namelen, idx_type, order, & + n, name, size_default, lapl_id_default) + + IF(PRESENT(size)) size = size_default + + + END SUBROUTINE h5aget_name_by_idx_f +! +!****s* H5A/H5Aget_num_attrs_f +! +! NAME +! H5Aget_num_attrs_f +! +! PURPOSE +! Determines the number of attributes attached to an object. +! +! INPUTS +! obj_id - object (group, dataset, or named datatype) +! identifier +! OUTPUTS +! attr_num - number of attributes attached to the object +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces are added for +! called C functions (it is needed for Windows +! port). February 27, 2001 +! +! SOURCE + SUBROUTINE h5aget_num_attrs_f(obj_id, attr_num, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: obj_id ! Object identifier + INTEGER, INTENT(OUT) :: attr_num ! Number of attributes of the object + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + + INTERFACE + INTEGER FUNCTION h5aget_num_attrs_c(obj_id, attr_num) BIND(C,name='h5aget_num_attrs_c') + IMPORT :: HID_T + INTEGER(HID_T), INTENT(IN) :: obj_id + INTEGER, INTENT(OUT) :: attr_num + END FUNCTION h5aget_num_attrs_c + END INTERFACE + + hdferr = h5aget_num_attrs_c(obj_id, attr_num) + END SUBROUTINE h5aget_num_attrs_f + +! +!****s* H5A/H5Adelete_f +! +! NAME +! H5Adelete_f +! +! PURPOSE +! Deletes an attribute of an object (group, dataset or +! named datatype) +! +! INPUTS +! obj_id - object identifier +! name - attribute name +! OUTPUTS +! +! hdferr - Returns 0 if successful and -1 if fails +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces are added for +! called C functions (it is needed for Windows +! port). February 27, 2001 +! +! SOURCE + SUBROUTINE H5Adelete_f(obj_id, name, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: obj_id ! Object identifier + CHARACTER(LEN=*), INTENT(IN) :: name ! Attribute name + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + INTEGER(SIZE_T) :: namelen + + INTERFACE + INTEGER FUNCTION H5Adelete_c(obj_id, name, namelen) BIND(C,NAME='h5adelete_c') + IMPORT :: C_CHAR + IMPORT :: HID_T, SIZE_T + INTEGER(HID_T), INTENT(IN) :: obj_id + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: name + INTEGER(SIZE_T) :: namelen + END FUNCTION H5Adelete_c + END INTERFACE + + namelen = LEN(name) + hdferr = H5Adelete_c(obj_id, name, namelen) + END SUBROUTINE H5Adelete_f + +! +!****s* H5A/H5Aclose_f +! +! NAME +! H5Aclose_f +! +! PURPOSE +! Closes the specified attribute. +! +! INPUTS +! attr_id - attribute identifier +! OUTPUTS +! +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces are added for +! called C functions (it is needed for Windows +! port). February 27, 2001 +! SOURCE + + SUBROUTINE H5Aclose_f(attr_id, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + + INTERFACE + INTEGER FUNCTION H5Aclose(attr_id) BIND(C, NAME='H5Aclose') + IMPORT :: HID_T + INTEGER(HID_T), INTENT(IN), VALUE :: attr_id + END FUNCTION H5Aclose + END INTERFACE + + hdferr = INT(H5Aclose(attr_id)) + END SUBROUTINE H5Aclose_f + +! +!****s* H5A/H5Aget_storage_size_f +! +! NAME +! H5Aget_storage_size_f +! +! PURPOSE +! Returns the amount of storage required for an attribute. +! +! INPUTS +! attr_id - attribute identifier +! OUTPUTS +! size - attribute storage size +! hdferr - Returns 0 if successful and -1 if fails +! AUTHOR +! M. Scot Breitenfeld +! January, 2008 +! +! SOURCE + SUBROUTINE H5Aget_storage_size_f(attr_id, size, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier + INTEGER(HSIZE_T), INTENT(OUT) :: size ! Attribute storage requirement + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + + INTERFACE + INTEGER(HSIZE_T) FUNCTION H5Aget_storage_size(attr_id) BIND(C,NAME='H5Aget_storage_size') + IMPORT :: HID_T, HSIZE_T + INTEGER(HID_T), INTENT(IN), VALUE :: attr_id + END FUNCTION H5Aget_storage_size + END INTERFACE + + size = H5Aget_storage_size(attr_id) + + hdferr = 0 + IF(size.LT.0) hdferr = -1 + + END SUBROUTINE H5Aget_storage_size_f + +! +!****s* H5A/H5Aget_create_plist_f +! +! NAME +! H5Aget_create_plist_f +! +! PURPOSE +! Gets an attribute creation property list identifier +! +! INPUTS +! attr_id - Identifier of the attribute +! OUTPUTS +! creation_prop_id - Identifier for the attribute’s creation property +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! M. Scot Breitenfeld +! January, 2008 +! +! SOURCE + SUBROUTINE H5Aget_create_plist_f(attr_id, creation_prop_id, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id ! Identifier of the attribute + INTEGER(HID_T), INTENT(OUT) :: creation_prop_id ! Identifier for the attribute’s creation property + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + INTERFACE + INTEGER(HID_T) FUNCTION H5Aget_create_plist(attr_id) BIND(C,NAME='H5Aget_create_plist') + IMPORT :: HID_T + INTEGER(HID_T), INTENT(IN), VALUE :: attr_id + END FUNCTION H5Aget_create_plist + END INTERFACE + + creation_prop_id = H5Aget_create_plist(attr_id) + + hdferr = 0 + IF(creation_prop_id.LT.0) hdferr = -1 + + END SUBROUTINE H5Aget_create_plist_f + +! +!****s* H5A/H5Arename_by_name_f +! +! NAME +! H5Arename_by_name_f +! +! PURPOSE +! Renames an attribute +! +! INPUTS +! loc_id - Location or object identifier; may be dataset or group +! obj_name - Name of object, relative to location, +! whose attribute is to be renamed +! old_attr_name - Prior attribute name +! new_attr_name - New attribute name +! lapl_id - Link access property list identifier +! +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! M. Scot Breitenfeld +! January, 2008 +! +! SOURCE + SUBROUTINE H5Arename_by_name_f(loc_id, obj_name, old_attr_name, new_attr_name, & + hdferr, lapl_id) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id ! Object identifier + CHARACTER(LEN=*), INTENT(IN) :: obj_name ! Name of object, relative to location, + ! whose attribute is to be renamed + CHARACTER(LEN=*), INTENT(IN) :: old_attr_name ! Prior attribute name + CHARACTER(LEN=*), INTENT(IN) :: new_attr_name ! New attribute name + + INTEGER, INTENT(OUT) :: hdferr ! Error code: + ! 0 on success and -1 on failure + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list identifier +!***** + INTEGER(HID_T) :: lapl_id_default + INTEGER(SIZE_T) :: obj_namelen + INTEGER(SIZE_T) :: old_attr_namelen + INTEGER(SIZE_T) :: new_attr_namelen + + INTERFACE + INTEGER FUNCTION H5Arename_by_name_c(loc_id, obj_name, obj_namelen, & + old_attr_name, old_attr_namelen, new_attr_name, new_attr_namelen, & + lapl_id_default) BIND(C,NAME='h5arename_by_name_c') + IMPORT :: C_CHAR + IMPORT :: HID_T, SIZE_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: obj_name + INTEGER(SIZE_T) :: obj_namelen + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: old_attr_name + INTEGER(SIZE_T) :: old_attr_namelen + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: new_attr_name + INTEGER(SIZE_T) :: new_attr_namelen + INTEGER(HID_T) :: lapl_id_default + + END FUNCTION H5Arename_by_name_c + END INTERFACE + + obj_namelen = LEN(obj_name) + old_attr_namelen = LEN(old_attr_name) + new_attr_namelen = LEN(new_attr_name) + + lapl_id_default = H5P_DEFAULT_F + IF(PRESENT(lapl_id)) lapl_id_default=lapl_id + + hdferr = H5Arename_by_name_c(loc_id, obj_name, obj_namelen, & + old_attr_name, old_attr_namelen, new_attr_name, new_attr_namelen, & + lapl_id_default) + + END SUBROUTINE H5Arename_by_name_f + +! +!****s* H5A/H5Aopen_f +! +! NAME +! H5Aopen_f +! +! PURPOSE +! Opens an attribute for an object specified by object +! identifier and attribute name +! +! INPUTS +! obj_id - Identifer for object to which attribute is attached +! attr_name - Name of attribute to open +! OUTPUTS +! attr_id - attribute identifier + +! OPTIONAL PARAMETERS +! aapl_id - Attribute access property list +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! M. Scot Breitenfeld +! January, 2008 +! +! SOURCE + SUBROUTINE H5Aopen_f(obj_id, attr_name, attr_id, hdferr, aapl_id) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: obj_id ! Object identifier + CHARACTER(LEN=*), INTENT(IN) :: attr_name ! Attribute name + INTEGER(HID_T), INTENT(OUT) :: attr_id ! Attribute identifier + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! Success: 0 + ! Failure: -1 + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: aapl_id ! Attribute access property list +!***** + INTEGER(HID_T) :: aapl_id_default + + INTEGER(SIZE_T) :: attr_namelen + + INTERFACE + INTEGER FUNCTION H5Aopen_c(obj_id, attr_name, attr_namelen, aapl_id_default, attr_id) & + BIND(C,NAME='h5aopen_c') + IMPORT :: C_CHAR + IMPORT :: HID_T, SIZE_T + INTEGER(HID_T), INTENT(IN) :: obj_id + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: attr_name + INTEGER(HID_T) :: aapl_id_default + INTEGER(SIZE_T) :: attr_namelen + INTEGER(HID_T), INTENT(OUT) :: attr_id + END FUNCTION H5Aopen_c + END INTERFACE + + attr_namelen = LEN(attr_name) + + aapl_id_default = H5P_DEFAULT_F + IF(PRESENT(aapl_id)) aapl_id_default = aapl_id + + hdferr = H5Aopen_c(obj_id, attr_name, attr_namelen, aapl_id_default, attr_id) + + END SUBROUTINE H5Aopen_f + +! +!****s* H5A/H5Adelete_by_idx_f +! +! NAME +! H5Adelete_by_idx_f +! +! PURPOSE +! Deletes an attribute from an object according to index order +! +! INPUTS +! loc_id - Location or object identifier; may be dataset or group +! obj_name - Name of object, relative to location, from which attribute is to be removed +! idx_type - Type of index; Possible values are: +! H5_INDEX_UNKNOWN_F = -1 - Unknown index type +! H5_INDEX_NAME_F - Index on names +! H5_INDEX_CRT_ORDER_F - Index on creation order +! H5_INDEX_N_F - Number of indices defined +! +! order - Order in which to iterate over index; Possible values are: +! H5_ITER_UNKNOWN_F - Unknown order +! H5_ITER_INC_F - Increasing order +! H5_ITER_DEC_F - Decreasing order +! H5_ITER_NATIVE_F - No particular order, whatever is fastest +! H5_ITER_N_F - Number of iteration orders +! +! n - Offset within index +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails +! OPTIONAL PARAMETERS +! lapl_id - Link access property list +! +! AUTHOR +! M. Scot Breitenfeld +! January, 2008 +! +! SOURCE + SUBROUTINE H5Adelete_by_idx_f(loc_id, obj_name, idx_type, order, n, hdferr, lapl_id) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id ! Identifer for object to which attribute is attached + CHARACTER(LEN=*), INTENT(IN) :: obj_name ! Name of object, relative to location, + ! from which attribute is to be removed + INTEGER, INTENT(IN) :: idx_type ! Type of index; Possible values are: + ! H5_INDEX_UNKNOWN_F - Unknown index type + ! H5_INDEX_NAME_F - Index on names + ! H5_INDEX_CRT_ORDER_F - Index on creation order + ! H5_INDEX_N_F - Number of indices defined + + INTEGER, INTENT(IN) :: order ! Order in which to iterate over index; Possible values are: + ! H5_ITER_UNKNOWN_F - Unknown order + ! H5_ITER_INC_F - Increasing order + ! H5_ITER_DEC_F - Decreasing order + ! H5_ITER_NATIVE_F - No particular order, whatever is fastest + ! H5_ITER_N_F - Number of iteration orders + INTEGER(HSIZE_T), INTENT(IN) :: n ! Offset within index + INTEGER, INTENT(OUT) :: hdferr ! Error code: + ! 0 on success and -1 on failure + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list +!***** + INTEGER(SIZE_T) :: obj_namelen + INTEGER(HID_T) :: lapl_id_default + + INTERFACE + INTEGER FUNCTION H5Adelete_by_idx_c(loc_id, obj_name, obj_namelen, idx_type, order, n, lapl_id_default) & + BIND(C,NAME='h5adelete_by_idx_c') + IMPORT :: C_CHAR + IMPORT :: HID_T, SIZE_T, HSIZE_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: obj_name + INTEGER, INTENT(IN) :: idx_type + INTEGER, INTENT(IN) :: order + INTEGER(HSIZE_T), INTENT(IN) :: n + INTEGER(HID_T) :: lapl_id_default + INTEGER(SIZE_T) :: obj_namelen + END FUNCTION H5Adelete_by_idx_c + END INTERFACE + + lapl_id_default = H5P_DEFAULT_F + IF(PRESENT(lapl_id)) lapl_id_default = lapl_id + + obj_namelen = LEN(obj_name) + hdferr = H5Adelete_by_idx_c(loc_id, obj_name, obj_namelen, idx_type, order, n, lapl_id_default) + + END SUBROUTINE H5Adelete_by_idx_f + +! +!****s* H5A/H5Adelete_by_name_f +! +! NAME +! H5Adelete_by_name_f +! +! PURPOSE +! Removes an attribute from a specified location +! +! INPUTS +! loc_id - Identifer for object to which attribute is attached +! obj_name - Name of attribute to open +! attr_name - Attribute access property list +! lapl_id - Link access property list +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! M. Scot Breitenfeld +! January, 2008 +! +! SOURCE + SUBROUTINE H5Adelete_by_name_f(loc_id, obj_name, attr_name, hdferr, lapl_id) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id ! Identifer for object to which attribute is attached + CHARACTER(LEN=*), INTENT(IN) :: obj_name ! Name of object, relative to location, + ! from which attribute is to be removed + CHARACTER(LEN=*), INTENT(IN) :: attr_name ! Name of attribute to delete + INTEGER, INTENT(OUT) :: hdferr ! Error code: + ! 0 on success and -1 on failure + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list +!***** + INTEGER(SIZE_T) :: attr_namelen + INTEGER(SIZE_T) :: obj_namelen + + INTEGER(HID_T) :: lapl_id_default + + INTERFACE + INTEGER FUNCTION H5Adelete_by_name_c(loc_id, obj_name, obj_namelen, attr_name, attr_namelen, lapl_id_default) & + BIND(C,NAME='h5adelete_by_name_c') + IMPORT :: C_CHAR + IMPORT :: HID_T, SIZE_T + INTEGER(HID_T), INTENT(IN) :: loc_id + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: obj_name + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: attr_name + INTEGER(HID_T) :: lapl_id_default + INTEGER(SIZE_T) :: attr_namelen + INTEGER(SIZE_T) :: obj_namelen + END FUNCTION H5Adelete_by_name_c + END INTERFACE + + obj_namelen = LEN(obj_name) + attr_namelen = LEN(attr_name) + + lapl_id_default = H5P_DEFAULT_F + IF(PRESENT(lapl_id)) lapl_id_default = lapl_id + + hdferr = H5Adelete_by_name_c(loc_id, obj_name, obj_namelen, attr_name, attr_namelen, lapl_id_default) + + END SUBROUTINE H5Adelete_by_name_f + +! +!****s* H5A/H5Aopen_by_idx_f +! +! NAME +! H5Aopen_by_idx_f +! +! PURPOSE +! Opens an existing attribute that is attached to an object specified by location and name +! +! INPUTS +! loc_id - Location of object to which attribute is attached +! obj_name - Name of object to which attribute is attached, relative to location +! idx_type - Type of index +! order - Index traversal order +! n - Attribute’s position in index +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails +! OPTIONAL PARAMETERS +! aapl_id - Attribute access property list +! lapl_id - Link access property list +! +! AUTHOR +! M. Scot Breitenfeld +! January, 2008 +! +! SOURCE + SUBROUTINE H5Aopen_by_idx_f(loc_id, obj_name, idx_type, order, n, attr_id, hdferr, aapl_id, lapl_id) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id ! Object identifier + CHARACTER(LEN=*), INTENT(IN) :: obj_name ! Name of object to which attribute is attached + INTEGER, INTENT(IN) :: idx_type ! Type of index; Possible values are: + ! H5_INDEX_UNKNOWN_F - Unknown index type + ! H5_INDEX_NAME_F - Index on names + ! H5_INDEX_CRT_ORDER_F - Index on creation order + ! H5_INDEX_N_F - Number of indices defined + INTEGER, INTENT(IN) :: order ! Order in which to iterate over index; Possible values are: + ! H5_ITER_UNKNOWN_F - Unknown order + ! H5_ITER_INC_F - Increasing order + ! H5_ITER_DEC_F - Decreasing order + ! H5_ITER_NATIVE_F - No particular order, whatever is fastest + + INTEGER(HSIZE_T), INTENT(IN) :: n ! Attribute’s position in index + + INTEGER(HID_T), INTENT(OUT) :: attr_id ! Attribute identifier + INTEGER, INTENT(OUT) :: hdferr ! Error code: + ! 0 on success and -1 on failure + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: aapl_id ! Attribute access property list + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list +!***** + INTEGER(SIZE_T) :: obj_namelen + INTEGER(HID_T) :: aapl_id_default + INTEGER(HID_T) :: lapl_id_default + + INTERFACE + INTEGER FUNCTION H5Aopen_by_idx_c(loc_id, obj_name, obj_namelen, idx_type, order, n, & + aapl_id_default, lapl_id_default, attr_id) BIND(C,NAME='h5aopen_by_idx_c') + IMPORT :: C_CHAR + IMPORT :: HID_T, SIZE_T, HSIZE_T + INTEGER(HID_T), INTENT(IN) :: loc_id + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: obj_name + INTEGER, INTENT(IN) :: idx_type + INTEGER, INTENT(IN) :: order + INTEGER(HSIZE_T), INTENT(IN) :: n + INTEGER(HID_T) :: aapl_id_default + INTEGER(HID_T) :: lapl_id_default + INTEGER(SIZE_T) :: obj_namelen + INTEGER(HID_T), INTENT(OUT) :: attr_id ! Attribute identifier + END FUNCTION H5Aopen_by_idx_c + END INTERFACE + + obj_namelen = LEN(obj_name) + + aapl_id_default = H5P_DEFAULT_F + IF(PRESENT(aapl_id)) aapl_id_default = aapl_id + lapl_id_default = H5P_DEFAULT_F + IF(PRESENT(lapl_id)) lapl_id_default = lapl_id + + hdferr = H5Aopen_by_idx_c(loc_id, obj_name, obj_namelen, idx_type, order, n, & + aapl_id_default, lapl_id_default, attr_id) + + END SUBROUTINE H5Aopen_by_idx_f + +! +!****s* H5A/H5Aget_info_f +! +! NAME +! H5Aget_info_f +! +! PURPOSE +! Retrieves attribute information, by attribute identifier +! +! INPUTS +! attr_id - attribute identifier +! +! OUTPUTS +! NOTE: In C it is defined as a structure: H5A_info_t +! +! corder_valid - indicates whether the creation order data is valid for this attribute +! corder - is a positive integer containing the creation order of the attribute +! cset - indicates the character set used for the attribute’s name +! data_size - indicates the size, in the number of characters, of the attribute +! hdferr - Returns 0 if successful and -1 if fails +! AUTHOR +! M. Scot Breitenfeld +! January, 2008 +! SOURCE + SUBROUTINE H5Aget_info_f(attr_id, f_corder_valid, corder, cset, data_size, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier + + LOGICAL, INTENT(OUT) :: f_corder_valid ! Indicates whether the creation order data is valid for this attribute + INTEGER, INTENT(OUT) :: corder ! Is a positive integer containing the creation order of the attribute + INTEGER, INTENT(OUT) :: cset ! Indicates the character set used for the attribute’s name + INTEGER(HSIZE_T), INTENT(OUT) :: data_size ! Indicates the size, in the number of characters, of the attribute + INTEGER, INTENT(OUT) :: hdferr ! Error code: + ! 0 on success and -1 on failure +!***** + INTEGER :: corder_valid + + INTERFACE + INTEGER FUNCTION H5Aget_info_c(attr_id, corder_valid, corder, cset, data_size) BIND(C,NAME='h5aget_info_c') + IMPORT :: HID_T, HSIZE_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id + + INTEGER, INTENT(OUT) :: corder_valid + INTEGER, INTENT(OUT) :: corder + INTEGER, INTENT(OUT) :: cset + INTEGER(HSIZE_T), INTENT(OUT) :: data_size + END FUNCTION H5Aget_info_c + END INTERFACE + + hdferr = H5Aget_info_c(attr_id, corder_valid, corder, cset, data_size) + + f_corder_valid =.FALSE. + IF (corder_valid .EQ. 1) f_corder_valid =.TRUE. + + + END SUBROUTINE H5Aget_info_f + +! +!****s* H5A/H5Aget_info_by_idx_f +! +! NAME +! H5Aget_info_by_idx_f +! +! PURPOSE +! Retrieves attribute information, by attribute index position +! +! INPUTS +! loc_id - Location of object to which attribute is attached +! obj_name - Name of object to which attribute is attached, relative to location +! idx_type - Type of index +! order - Index traversal order +! n - Attribute’s position in index +! +! OUTPUTS NOTE: In C it is defined as a structure: H5A_info_t +! corder_valid - indicates whether the creation order data is valid for this attribute +! corder - is a positive integer containing the creation order of the attribute +! cset - indicates the character set used for the attribute’s name +! data_size - indicates the size, in the number of characters, of the attribute +! hdferr - Returns 0 if successful and -1 if fails +! OPTIONAL PARAMETERS +! lapl_id - Link access property list +! +! AUTHOR +! M. Scot Breitenfeld +! January, 2008 +! +! SOURCE + SUBROUTINE H5Aget_info_by_idx_f(loc_id, obj_name, idx_type, order, n, & + f_corder_valid, corder, cset, data_size, hdferr, lapl_id) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id ! Object identifier + CHARACTER(LEN=*), INTENT(IN) :: obj_name ! Name of object to which attribute is attached + INTEGER, INTENT(IN) :: idx_type ! Type of index; Possible values are: + ! H5_INDEX_UNKNOWN_F - Unknown index type + ! H5_INDEX_NAME_F - Index on names + ! H5_INDEX_CRT_ORDER_F - Index on creation order + ! H5_INDEX_N_F - Number of indices defined + INTEGER, INTENT(IN) :: order ! Order in which to iterate over index; Possible values are: + ! H5_ITER_UNKNOWN_F - Unknown order + ! H5_ITER_INC_F - Increasing order + ! H5_ITER_DEC_F - Decreasing order + ! H5_ITER_NATIVE_F - No particular order, whatever is fastest + + INTEGER(HSIZE_T), INTENT(IN) :: n ! Attribute’s position in index + + + LOGICAL, INTENT(OUT) :: f_corder_valid ! Indicates whether the creation order data is valid for this attribute + INTEGER, INTENT(OUT) :: corder ! Is a positive integer containing the creation order of the attribute + INTEGER, INTENT(OUT) :: cset ! Indicates the character set used for the attribute’s name + INTEGER(HSIZE_T), INTENT(OUT) :: data_size ! Indicates the size, in the number of characters, of the attribute + INTEGER, INTENT(OUT) :: hdferr ! Error code: + ! 0 on success and -1 on failure + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list +!***** + INTEGER :: corder_valid + INTEGER(SIZE_T) :: obj_namelen + INTEGER(HID_T) :: lapl_id_default + + INTERFACE + INTEGER FUNCTION h5aget_info_by_idx_c(loc_id, obj_name, obj_namelen, idx_type, order, n, lapl_id_default, & + corder_valid, corder, cset, data_size) BIND(C,NAME='h5aget_info_by_idx_c') + IMPORT :: C_CHAR + IMPORT :: HID_T, SIZE_T, HSIZE_T + INTEGER(HID_T), INTENT(IN) :: loc_id + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: obj_name + INTEGER, INTENT(IN) :: idx_type + INTEGER, INTENT(IN) :: order + INTEGER(HSIZE_T), INTENT(IN) :: n + INTEGER(HID_T) :: lapl_id_default + INTEGER, INTENT(OUT) :: corder_valid + INTEGER, INTENT(OUT) :: corder + INTEGER, INTENT(OUT) :: cset + INTEGER(HSIZE_T), INTENT(OUT) :: data_size + + INTEGER(SIZE_T) :: obj_namelen + END FUNCTION H5Aget_info_by_idx_c + END INTERFACE + + obj_namelen = LEN(obj_name) + + lapl_id_default = H5P_DEFAULT_F + IF(present(lapl_id)) lapl_id_default = lapl_id + + hdferr = H5Aget_info_by_idx_c(loc_id, obj_name, obj_namelen, idx_type, order, n, lapl_id_default, & + corder_valid, corder, cset, data_size) + + f_corder_valid =.FALSE. + IF (corder_valid .EQ. 1) f_corder_valid =.TRUE. + + END SUBROUTINE H5Aget_info_by_idx_f + +! +!****s* H5A/H5Aget_info_by_name_f +! +! NAME +! H5Aget_info_by_name_f +! +! PURPOSE +! Retrieves attribute information, by attribute name +! +! INPUTS +! loc_id - Location of object to which attribute is attached +! obj_name - Name of object to which attribute is attached, relative to location +! attr_name - Attribute name +! +! OUTPUTS NOTE: In C it is defined as a structure: H5A_info_t +! corder_valid - indicates whether the creation order data is valid for this attribute +! corder - is a positive integer containing the creation order of the attribute +! cset - indicates the character set used for the attribute’s name +! data_size - indicates the size, in the number of characters, of the attribute +! hdferr - Returns 0 if successful and -1 if fails +! OPTIONAL PARAMETERS +! lapl_id - Link access property list +! +! AUTHOR +! M. Scot Breitenfeld +! January, 2008 +! +! SOURCE + SUBROUTINE H5Aget_info_by_name_f(loc_id, obj_name, attr_name, & + f_corder_valid, corder, cset, data_size, hdferr, lapl_id) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id ! Object identifier + CHARACTER(LEN=*), INTENT(IN) :: obj_name ! Name of object to which attribute is attached + CHARACTER(LEN=*), INTENT(IN) :: attr_name ! Attribute name + + + LOGICAL, INTENT(OUT) :: f_corder_valid ! Indicates whether the creation order data is valid for this attribute + INTEGER, INTENT(OUT) :: corder ! Is a positive integer containing the creation order of the attribute + INTEGER, INTENT(OUT) :: cset ! Indicates the character set used for the attribute’s name + INTEGER(HSIZE_T), INTENT(OUT) :: data_size ! Indicates the size, in the number of characters, of the attribute + INTEGER, INTENT(OUT) :: hdferr ! Error code: + ! 0 on success and -1 on failure + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list +!***** + INTEGER :: corder_valid + INTEGER(SIZE_T) :: obj_namelen + INTEGER(SIZE_T) :: attr_namelen + INTEGER(HID_T) :: lapl_id_default + + INTERFACE + INTEGER FUNCTION H5Aget_info_by_name_c(loc_id, obj_name, obj_namelen, attr_name, attr_namelen, lapl_id_default, & + corder_valid, corder, cset, data_size) BIND(C,NAME='h5aget_info_by_name_c') + IMPORT :: C_CHAR + IMPORT :: HID_T, SIZE_T, HSIZE_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: obj_name + INTEGER(SIZE_T), INTENT(IN) :: obj_namelen + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: attr_name + INTEGER(SIZE_T), INTENT(IN) :: attr_namelen + INTEGER(HID_T) :: lapl_id_default + INTEGER, INTENT(OUT) :: corder_valid + INTEGER, INTENT(OUT) :: corder + INTEGER, INTENT(OUT) :: cset + INTEGER(HSIZE_T), INTENT(OUT) :: data_size + + END FUNCTION H5Aget_info_by_name_c + END INTERFACE + + obj_namelen = LEN(obj_name) + attr_namelen = LEN(attr_name) + + lapl_id_default = H5P_DEFAULT_F + IF(PRESENT(lapl_id)) lapl_id_default = lapl_id + + hdferr = H5Aget_info_by_name_c(loc_id, obj_name, obj_namelen, attr_name, attr_namelen, lapl_id_default, & + corder_valid, corder, cset, data_size) + + f_corder_valid =.FALSE. + IF (corder_valid .EQ. 1) f_corder_valid =.TRUE. + + END SUBROUTINE H5Aget_info_by_name_f + +! +!****s* H5A/H5Acreate_by_name_f +! +! NAME +! H5Acreate_by_name_f +! +! PURPOSE +! Creates an attribute attached to a specified object +! +! INPUTS +! loc_id - Location or object identifier; may be dataset or group +! obj_name - Name, relative to loc_id, of object that attribute is to be attached to +! attr_name - Attribute name +! type_id - Attribute datatype identifier +! space_id - Attribute dataspace identifier +! +! OUTPUTS +! attr - an attribute identifier +! hdferr - Returns 0 if successful and -1 if fails +! OPTIONAL PARAMETERS +! acpl_id - Attribute creation property list identifier (Currently not used.) +! aapl_id - Attribute access property list identifier (Currently not used.) +! lapl_id - Link access property list +! +! AUTHOR +! M. Scot Breitenfeld +! February, 2008 +! SOURCE + SUBROUTINE H5Acreate_by_name_f(loc_id, obj_name, attr_name, type_id, space_id, attr, hdferr, & + acpl_id, aapl_id, lapl_id) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id + CHARACTER(LEN=*), INTENT(IN) :: obj_name + CHARACTER(LEN=*), INTENT(IN) :: attr_name + INTEGER(HID_T), INTENT(IN) :: type_id + INTEGER(HID_T), INTENT(IN) :: space_id + INTEGER(HID_T), INTENT(OUT) :: attr + INTEGER, INTENT(OUT) :: hdferr + + INTEGER(HID_T), INTENT(IN), OPTIONAL :: acpl_id + INTEGER(HID_T), INTENT(IN), OPTIONAL :: aapl_id + INTEGER(HID_T), INTENT(IN), OPTIONAL :: lapl_id +!***** + INTEGER(SIZE_T) :: obj_namelen + INTEGER(SIZE_T) :: attr_namelen + + INTEGER(HID_T) :: acpl_id_default + INTEGER(HID_T) :: aapl_id_default + INTEGER(HID_T) :: lapl_id_default + + INTERFACE + INTEGER FUNCTION H5Acreate_by_name_c(loc_id, obj_name, obj_namelen, attr_name, attr_namelen, & + type_id, space_id, acpl_id_default, aapl_id_default, lapl_id_default, attr) & + BIND(C,NAME='h5acreate_by_name_c') + IMPORT :: C_CHAR + IMPORT :: HID_T, SIZE_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: obj_name + INTEGER(SIZE_T), INTENT(IN) :: obj_namelen + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: attr_name + INTEGER(SIZE_T), INTENT(IN) :: attr_namelen + INTEGER(HID_T), INTENT(IN) :: type_id + INTEGER(HID_T), INTENT(IN) :: space_id + INTEGER(HID_T) :: acpl_id_default + INTEGER(HID_T) :: aapl_id_default + INTEGER(HID_T) :: lapl_id_default + INTEGER(HID_T), INTENT(OUT) :: attr + + END FUNCTION H5Acreate_by_name_c + END INTERFACE + + obj_namelen = LEN(obj_name) + attr_namelen = LEN(attr_name) + + acpl_id_default = H5P_DEFAULT_F + aapl_id_default = H5P_DEFAULT_F + lapl_id_default = H5P_DEFAULT_F + + IF(PRESENT(acpl_id)) acpl_id_default = acpl_id + IF(PRESENT(aapl_id)) aapl_id_default = aapl_id + IF(PRESENT(lapl_id)) lapl_id_default = lapl_id + + hdferr = H5Acreate_by_name_c(loc_id, obj_name, obj_namelen, attr_name, attr_namelen, & + type_id, space_id, acpl_id_default, aapl_id_default, lapl_id_default, attr) + END SUBROUTINE H5Acreate_by_name_f + +! +!****s* H5A/H5Aexists_f +! +! NAME +! H5Aexists_f +! +! PURPOSE +! Determines whether an attribute with a given name exists on an object +! +! INPUTS +! obj_id - Object identifier +! attr_name - Attribute name +! +! OUTPUTS +! attr_exists - attribute exists status +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! M. Scot Breitenfeld +! February, 2008 +! +! SOURCE + SUBROUTINE H5Aexists_f(obj_id, attr_name, attr_exists, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: obj_id ! Object identifier + CHARACTER(LEN=*), INTENT(IN) :: attr_name ! Attribute name + LOGICAL, INTENT(OUT) :: attr_exists ! .TRUE. if exists, .FALSE. otherwise + INTEGER, INTENT(OUT) :: hdferr ! Error code: + ! 0 on success and -1 on failure +!***** + INTEGER(HID_T) :: attr_exists_c + INTEGER(SIZE_T) :: attr_namelen + + INTERFACE + INTEGER FUNCTION H5Aexists_c(obj_id, attr_name, attr_namelen, attr_exists_c) BIND(C,NAME='h5aexists_c') + IMPORT :: C_CHAR + IMPORT :: HID_T, SIZE_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: obj_id + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: attr_name + INTEGER(SIZE_T) :: attr_namelen + INTEGER(HID_T) :: attr_exists_c + END FUNCTION H5Aexists_c + END INTERFACE + + attr_namelen = LEN(attr_name) + + hdferr = H5Aexists_c(obj_id, attr_name, attr_namelen, attr_exists_c) + + attr_exists = .FALSE. + IF(attr_exists_c.GT.0) attr_exists = .TRUE. + + END SUBROUTINE H5Aexists_f + +! +!****s* H5A/H5Aexists_by_name_f +! +! NAME +! H5Aexists_by_name_f +! +! PURPOSE +! Determines whether an attribute with a given name exists on an object +! +! INPUTS +! loc_id - Location identifier +! obj_name - Object name either relative to loc_id, absolute from the file’s root group, or '.' (a dot) +! attr_name - Attribute name +! +! OUTPUTS +! attr_exists - attribute exists status +! hdferr - Returns 0 if successful and -1 if fails +! OPTIONAL PARAMETERS +! lapl_id - Link access property list identifier +! +! AUTHOR +! M. Scot Breitenfeld +! February, 2008 +! +! SOURCE + SUBROUTINE H5Aexists_by_name_f(loc_id, obj_name, attr_name, attr_exists, hdferr, lapl_id) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id ! Location identifier + CHARACTER(LEN=*), INTENT(IN) :: obj_name ! Object name either relative to loc_id, + ! absolute from the file’s root group, or '.' + CHARACTER(LEN=*), INTENT(IN) :: attr_name ! Attribute name + LOGICAL, INTENT(OUT) :: attr_exists ! .TRUE. if exists, .FALSE. otherwise + INTEGER, INTENT(OUT) :: hdferr ! Error code: + ! 0 on success and -1 on failure + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list identifier +!***** + INTEGER :: attr_exists_c + INTEGER(SIZE_T) :: obj_namelen + INTEGER(SIZE_T) :: attr_namelen + + INTEGER(HID_T) :: lapl_id_default + + INTERFACE + INTEGER FUNCTION H5Aexists_by_name_c(loc_id, obj_name, obj_namelen, attr_name, attr_namelen, & + lapl_id_default, attr_exists_c) BIND(C,NAME='h5aexists_by_name_c') + IMPORT :: C_CHAR + IMPORT :: HID_T, SIZE_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: obj_name + INTEGER(SIZE_T), INTENT(IN) :: obj_namelen + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: attr_name + INTEGER(SIZE_T), INTENT(IN) :: attr_namelen + INTEGER(HID_T), INTENT(IN) :: lapl_id_default + INTEGER, INTENT(OUT) :: attr_exists_c + END FUNCTION H5Aexists_by_name_c + END INTERFACE + + attr_namelen = LEN(attr_name) + obj_namelen = LEN(obj_name) + + lapl_id_default = H5P_DEFAULT_F + IF(PRESENT(lapl_id)) lapl_id_default = lapl_id + + hdferr = H5Aexists_by_name_c(loc_id, obj_name, obj_namelen, attr_name, attr_namelen, lapl_id_default, attr_exists_c) + + attr_exists = .FALSE. + IF(attr_exists_c.GT.0) attr_exists = .TRUE. + + END SUBROUTINE H5Aexists_by_name_f +! +!****s* H5A/H5Aopen_by_name_f +! +! NAME +! H5Aopen_by_name_f +! +! PURPOSE +! Opens an attribute for an object by object name and attribute name. +! +! INPUTS +! loc_id - Location from which to find object to which attribute is attached +! obj_name - Object name either relative to loc_id, absolute from the file’s root group, or '.' (a dot) +! attr_name - Attribute name +! +! OUTPUTS +! attr_id - attribute identifier +! hdferr - Returns 0 if successful and -1 if fails +! OPTIONAL PARAMETERS +! aapl_id - Attribute access property list (Currently unused; should be passed in as H5P_DEFAULT.) +! lapl_id - Link access property list identifier +! +! AUTHOR +! M. Scot Breitenfeld +! February, 2008 +! SOURCE + SUBROUTINE H5Aopen_by_name_f(loc_id, obj_name, attr_name, attr_id, hdferr, aapl_id, lapl_id) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id ! Location identifier + CHARACTER(LEN=*), INTENT(IN) :: obj_name ! Object name either relative to loc_id, + ! absolute from the file’s root group, or '.' + CHARACTER(LEN=*), INTENT(IN) :: attr_name ! Attribute name + INTEGER(HID_T), INTENT(OUT) :: attr_id ! Attribute identifier + INTEGER, INTENT(OUT) :: hdferr ! Error code: + ! 0 on success and -1 on failure + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: aapl_id ! Attribute access property list + ! (Currently unused; should be passed in as H5P_DEFAULT_F) + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list identifier +!***** + INTEGER(HID_T) :: aapl_id_default + INTEGER(HID_T) :: lapl_id_default + + INTEGER(SIZE_T) :: obj_namelen + INTEGER(SIZE_T) :: attr_namelen + + INTERFACE + INTEGER FUNCTION H5Aopen_by_name_c(loc_id, obj_name, obj_namelen, attr_name, attr_namelen, & + aapl_id_default, lapl_id_default, attr_id) BIND(C,NAME='h5aopen_by_name_c') + IMPORT :: C_CHAR + IMPORT :: HID_T, SIZE_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: obj_name + INTEGER(SIZE_T), INTENT(IN) :: obj_namelen + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: attr_name + INTEGER(SIZE_T), INTENT(IN) :: attr_namelen + INTEGER(HID_T) :: aapl_id_default + INTEGER(HID_T) :: lapl_id_default + INTEGER(HID_T), INTENT(OUT) :: attr_id + END FUNCTION H5Aopen_by_name_c + END INTERFACE + + attr_namelen = LEN(attr_name) + obj_namelen = LEN(obj_name) + + aapl_id_default = H5P_DEFAULT_F + lapl_id_default = H5P_DEFAULT_F + IF(PRESENT(aapl_id)) aapl_id_default = aapl_id + IF(PRESENT(lapl_id)) lapl_id_default = lapl_id + + hdferr = H5Aopen_by_name_c(loc_id, obj_name, obj_namelen, attr_name, attr_namelen, & + aapl_id_default, lapl_id_default, attr_id) + + END SUBROUTINE H5Aopen_by_name_f + +! +!****s* H5A/H5Arename_f +! +! NAME +! H5Arename_f +! +! PURPOSE +! Renames an attribute +! +! INPUTS +! loc_id - Location or object identifier; may be dataset or group +! old_attr_name - Prior attribute name +! new_attr_name - New attribute name +! +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! M. Scot Breitenfeld +! January, 2008 +! +! HISTORY +! N/A +! +! + +! SOURCE + SUBROUTINE H5Arename_f(loc_id, old_attr_name, new_attr_name, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id ! Object identifier + CHARACTER(LEN=*), INTENT(IN) :: old_attr_name ! Prior attribute name + CHARACTER(LEN=*), INTENT(IN) :: new_attr_name ! New attribute name + INTEGER, INTENT(OUT) :: hdferr ! Error code: + ! 0 on success and -1 on failure +!***** + INTEGER(SIZE_T) :: old_attr_namelen + INTEGER(SIZE_T) :: new_attr_namelen + + INTERFACE + INTEGER FUNCTION H5Arename_c(loc_id, & + old_attr_name, old_attr_namelen, new_attr_name, new_attr_namelen) BIND(C,NAME='h5arename_c') + IMPORT :: C_CHAR + IMPORT :: HID_T, SIZE_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: old_attr_name + INTEGER(SIZE_T) :: old_attr_namelen + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: new_attr_name + INTEGER(SIZE_T) :: new_attr_namelen + END FUNCTION H5Arename_c + END INTERFACE + + old_attr_namelen = LEN(old_attr_name) + new_attr_namelen = LEN(new_attr_name) + + hdferr = H5Arename_c(loc_id, & + old_attr_name, old_attr_namelen, new_attr_name, new_attr_namelen) + + END SUBROUTINE H5Arename_f + + SUBROUTINE H5Awrite_char_scalar(attr_id, memtype_id, buf, dims, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier + INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype + ! identifier (in memory) + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes + CHARACTER(LEN=*), INTENT(IN) :: buf ! Attribute data + INTEGER, INTENT(OUT) :: hdferr ! Error code + + CALL H5Awrite_char_scalar_fix(attr_id, memtype_id, buf, LEN(buf), dims, hdferr) + + END SUBROUTINE H5Awrite_char_scalar + + SUBROUTINE H5Awrite_char_scalar_fix(attr_id, memtype_id, buf, buf_len, dims, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier + INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype + ! identifier (in memory) + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes + INTEGER, INTENT(IN) :: buf_len + CHARACTER(LEN=buf_len), INTENT(IN), TARGET :: buf ! Attribute data + INTEGER, INTENT(OUT) :: hdferr ! Error code + TYPE(C_PTR) :: f_ptr + + f_ptr = C_LOC(buf(1:1)) + + hdferr = H5Awrite_f_c(attr_id, memtype_id, f_ptr) + + END SUBROUTINE H5Awrite_char_scalar_fix + + +!****s* H5A (F03)/H5Awrite_f_F03 +! +! NAME +! H5Awrite_f_F03 +! +! PURPOSE +! Writes an attribute. +! +! Inputs: +! attr_id - Attribute identifier +! memtype_id - Attribute datatype identifier (in memory) +! buf - Data buffer; may be a scalar or an array +! +! Outputs: +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces are added for +! called C functions (it is needed for Windows +! port). February 27, 2001 +! +! NOTES +! This function is overloaded to write INTEGER, +! REAL, REAL(KIND=C_DOUBLE) and CHARACTER buffers +! up to 7 dimensions. +! +! Fortran2003 Interface: +!! SUBROUTINE H5Awrite_f(attr_id, memtype_id, buf, hdferr) +!! INTEGER(HID_T) , INTENT(IN) :: attr_id +!! INTEGER(HID_T) , INTENT(IN) :: memtype_id +!! TYPE(C_PTR) , INTENT(IN) :: buf +!! INTEGER , INTENT(OUT) :: hdferr +!***** + + SUBROUTINE H5Awrite_ptr(attr_id, mem_type_id, buf, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + TYPE(C_PTR), INTENT(IN), TARGET :: buf + INTEGER, INTENT(OUT) :: hdferr ! Error code + + hdferr = H5Awrite_f_c(attr_id, mem_type_id, buf) + + END SUBROUTINE H5Awrite_ptr + + SUBROUTINE H5Aread_char_scalar(attr_id, memtype_id, buf, dims, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier + INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype + ! identifier (in memory) + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes + CHARACTER(LEN=*), INTENT(INOUT) :: buf ! Attribute data + INTEGER, INTENT(OUT) :: hdferr ! Error code + + CALL H5Aread_char_scalar_fix(attr_id, memtype_id, buf, LEN(buf), hdferr) + + END SUBROUTINE H5Aread_char_scalar + + SUBROUTINE H5Aread_char_scalar_fix(attr_id, memtype_id, buf, buf_len, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier + INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype + ! identifier (in memory) + INTEGER, INTENT(IN) :: buf_len + CHARACTER(LEN=buf_len), INTENT(INOUT), TARGET :: buf ! Attribute data + INTEGER, INTENT(OUT) :: hdferr ! Error code + TYPE(C_PTR) :: f_ptr + + f_ptr = C_LOC(buf(1:1)) + + hdferr = H5Aread_f_c(attr_id, memtype_id, f_ptr) + + END SUBROUTINE H5Aread_char_scalar_fix + +!****s* H5A (F03)/H5Aread_f_F03 +! +! NAME +! H5Aread_f_F03 +! +! PURPOSE +! Reads an attribute. +! +! Inputs: +! attr_id - Attribute identifier +! memtype_id - Attribute datatype identifier (in memory) +! +! Outputs: +! buf - Data buffer; may be a scalar or an array +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces are added for +! called C functions (it is needed for Windows +! port). February 27, 2001 +! +! dims parameter was added to make code portable; +! Aprile 4, 2001 +! +! Changed buf intent to INOUT to be consistant +! with how the C functions handles it. The pg +! compiler will return 0 if a buf value is not set. +! February, 2008 +! +! NOTES +! This function is overloaded to write INTEGER, +! REAL, REAL(KIND=C_DOUBLE) and CHARACTER buffers +! up to 7 dimensions. +! Fortran2003 Interface: +!! SUBROUTINE H5Aread_f(attr_id, memtype_id, buf, hdferr) +!! INTEGER(HID_T) , INTENT(IN) :: attr_id +!! INTEGER(HID_T) , INTENT(IN) :: memtype_id +!! TYPE(C_PTR) , INTENT(INOUT) :: buf +!! INTEGER , INTENT(OUT) :: hdferr +!***** + + SUBROUTINE H5Aread_ptr(attr_id, mem_type_id, buf, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + TYPE(C_PTR), INTENT(INOUT), TARGET :: buf + INTEGER, INTENT(OUT) :: hdferr ! Error code + + hdferr = H5Aread_f_c(attr_id, mem_type_id, buf) + + END SUBROUTINE H5Aread_ptr + +END MODULE H5A + + diff --git a/fortran/src/H5Aff.f90 b/fortran/src/H5Aff.f90 deleted file mode 100644 index 25f7fa7..0000000 --- a/fortran/src/H5Aff.f90 +++ /dev/null @@ -1,1673 +0,0 @@ -!****h* ROBODoc/H5A -! -! NAME -! MODULE H5A -! -! PURPOSE -! This file contains Fortran interfaces for H5A functions. It includes -! all the functions that are independent on whether the Fortran 2003 functions -! are enabled or disabled. -! -! -! 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. * -! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -! -! NOTES -! *** IMPORTANT *** -! If you add a new H5A function you must add the function name to the -! Windows dll file 'hdf5_fortrandll.def.in' in the fortran/src directory. -! This is needed for Windows based operating systems. -! -!***** - -MODULE H5A - - USE H5GLOBAL -! -! On Windows there are no big (integer*8) integers, so overloading -! for bug #670 does not work. I have to use DEC compilation directives to make -! Windows DEC Visual Fortran and OSF compilers happy and do right things. -! 05/01/02 EP -! - -CONTAINS - -! -!****s* H5A/h5acreate_f -! -! NAME -! h5acreate_f -! -! PURPOSE -! Creates a dataset as an attribute of a group, dataset, or named datatype -! -! INPUTS -! loc_id - identifier of an object (group, dataset, -! or named datatype) attribute is attached to -! name - attribute name -! type_id - attribute datatype identifier -! space_id - attribute dataspace identifier -! -! OUTPUTS -! attr_id - attribute identifier -! hdferr - Returns 0 if successful and -1 if fails -! OPTIONAL PARAMETERS -! acpl_id - Attribute creation property list identifier -! appl_id - Attribute access property list identifier -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces are added for -! called C functions (it is needed for Windows -! port). February 27, 2001 -! -! -! SOURCE - SUBROUTINE h5acreate_f(loc_id, name, type_id, space_id, attr_id, & - hdferr, acpl_id, aapl_id ) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id ! Object identifier - CHARACTER(LEN=*), INTENT(IN) :: name ! Attribute name - INTEGER(HID_T), INTENT(IN) :: type_id ! Attribute datatype identifier - INTEGER(HID_T), INTENT(IN) :: space_id ! Attribute dataspace identifier - INTEGER(HID_T), INTENT(OUT) :: attr_id ! Attribute identifier - INTEGER, INTENT(OUT) :: hdferr ! Error code: - ! 0 on success and -1 on failure -!***** - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: acpl_id ! Attribute creation property list identifier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: aapl_id ! Attribute access property list identifier - - INTEGER(HID_T) :: acpl_id_default - INTEGER(HID_T) :: aapl_id_default - INTEGER(SIZE_T) :: namelen - INTERFACE - INTEGER FUNCTION h5acreate_c(loc_id, name, namelen, type_id, & - space_id, acpl_id_default, aapl_id_default, attr_id) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5ACREATE_C'::h5acreate_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: name - INTEGER(HID_T), INTENT(IN) :: loc_id - CHARACTER(LEN=*), INTENT(IN) :: name - INTEGER(SIZE_T) :: namelen - INTEGER(HID_T), INTENT(IN) :: type_id - INTEGER(HID_T), INTENT(IN) :: space_id - INTEGER(HID_T) :: acpl_id_default - INTEGER(HID_T) :: aapl_id_default - INTEGER(HID_T), INTENT(OUT) :: attr_id - END FUNCTION h5acreate_c - END INTERFACE - - acpl_id_default = H5P_DEFAULT_F - aapl_id_default = H5P_DEFAULT_F - namelen = LEN(name) - IF (PRESENT(acpl_id)) acpl_id_default = acpl_id - IF (PRESENT(aapl_id)) aapl_id_default = aapl_id - - hdferr = h5acreate_c(loc_id, name, namelen, type_id, space_id, & - acpl_id_default, aapl_id_default, attr_id) - - END SUBROUTINE h5acreate_f - - -! -!****s* H5A/h5aopen_name_f -! -! NAME -! h5aopen_name_f -! -! PURPOSE -! Opens an attribute specified by name. -! -! INPUTS -! obj_id - identifier of a group, dataset, or named -! datatype atttribute to be attached to -! name - attribute name -! OUTPUTS -! attr_id - attribute identifier -! hdferr - Returns 0 if successful and -1 if fails -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces are added for -! called C functions (it is needed for Windows -! port). February 27, 2001 -! -! SOURCE - SUBROUTINE h5aopen_name_f(obj_id, name, attr_id, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: obj_id ! Object identifier - CHARACTER(LEN=*), INTENT(IN) :: name ! Attribute name - INTEGER(HID_T), INTENT(OUT) :: attr_id ! Attribute identifier - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTEGER(SIZE_T) :: namelen - - INTERFACE - INTEGER FUNCTION h5aopen_name_c(obj_id, name, namelen, attr_id) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AOPEN_NAME_C'::h5aopen_name_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: name - INTEGER(HID_T), INTENT(IN) :: obj_id - CHARACTER(LEN=*), INTENT(IN) :: name - INTEGER(SIZE_T) :: namelen - INTEGER(HID_T), INTENT(OUT) :: attr_id - END FUNCTION h5aopen_name_c - END INTERFACE - - namelen = LEN(name) - hdferr = h5aopen_name_c(obj_id, name, namelen, attr_id) - END SUBROUTINE h5aopen_name_f -! -!****s* H5A/h5aopen_idx_f -! -! NAME -! h5aopen_idx_f -! -! PURPOSE -! Opens the attribute specified by its index. -! -! INPUTS -! obj_id - identifier of a group, dataset, or named -! datatype an attribute to be attached to -! index - index of the attribute to open (zero-based) -! OUTPUTS -! attr_id - attribute identifier -! hdferr - Returns 0 if successful and -1 if fails -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces are added for -! called C functions (it is needed for Windows -! port). February 27, 2001 -! -! SOURCE - SUBROUTINE h5aopen_idx_f(obj_id, index, attr_id, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: obj_id ! Object identifier - INTEGER, INTENT(IN) :: index ! Attribute index - INTEGER(HID_T), INTENT(OUT) :: attr_id ! Attribute identifier - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - - INTERFACE - INTEGER FUNCTION h5aopen_idx_c(obj_id, index, attr_id) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AOPEN_IDX_C'::h5aopen_idx_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: obj_id - INTEGER, INTENT(IN) :: index - INTEGER(HID_T), INTENT(OUT) :: attr_id - END FUNCTION h5aopen_idx_c - END INTERFACE - - hdferr = h5aopen_idx_c(obj_id, index, attr_id) - END SUBROUTINE h5aopen_idx_f -! -!****s* H5A/h5aget_space_f -! -! NAME -! h5aget_space_f -! -! PURPOSE -! Gets a copy of the dataspace for an attribute. -! -! INPUTS -! attr_id - attribute identifier -! -! OUTPUTS -! space_id - attribite dataspace identifier -! hdferr - Returns 0 if successful and -1 if fails -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces are added for -! called C functions (it is needed for Windows -! port). February 27, 2001 -! -! -! SOURCE - SUBROUTINE h5aget_space_f(attr_id, space_id, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(OUT) :: space_id ! Attribute dataspace identifier - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTERFACE - INTEGER FUNCTION h5aget_space_c(attr_id, space_id) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AGET_SPACE_C'::h5aget_space_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: attr_id - INTEGER(HID_T), INTENT(OUT) :: space_id - END FUNCTION h5aget_space_c - END INTERFACE - - hdferr = h5aget_space_c(attr_id, space_id) - END SUBROUTINE h5aget_space_f -! -!****s* H5A/h5aget_type_f -! -! NAME -! h5aget_type_f -! -! PURPOSE -! Gets an attribute datatype. -! -! INPUTS -! attr_id - attribute identifier -! OUTPUTS -! type_id - attribute datatype identifier -! hdferr - Returns 0 if successful and -1 if fails -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces are added for -! called C functions (it is needed for Windows -! port). February 27, 2001 -! -! SOURCE - SUBROUTINE h5aget_type_f(attr_id, type_id, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(OUT) :: type_id ! Attribute datatype identifier - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTERFACE - INTEGER FUNCTION h5aget_type_c(attr_id, type_id) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AGET_TYPE_C'::h5aget_type_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: attr_id - INTEGER(HID_T), INTENT(OUT) :: type_id - END FUNCTION h5aget_type_c - END INTERFACE - - hdferr = h5aget_type_c(attr_id, type_id) - END SUBROUTINE h5aget_type_f -! -!****s* H5A/h5aget_name_f -! -! NAME -! h5aget_name_f -! -! PURPOSE -! Gets an attribute name. -! -! INPUTS -! attr_id - attribute identifier -! size - size of a buffer to read name in -! OUTPUTS -! buf - buffer to read name in -! hdferr - Returns 0 if successful and -1 if fails -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces are added for -! called C functions (it is needed for Windows -! port). February 27, 2001 -! -! -! SOURCE - SUBROUTINE h5aget_name_f(attr_id, size, buf, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(SIZE_T), INTENT(IN) :: size ! Buffer size - CHARACTER(LEN=*), INTENT(INOUT) :: buf ! Buffer to hold attribute name - INTEGER, INTENT(OUT) :: hdferr ! Error code: - ! name length is successful, -1 if fail -!***** - INTERFACE - INTEGER FUNCTION h5aget_name_c(attr_id, size, buf) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AGET_NAME_C'::h5aget_name_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: buf - INTEGER(HID_T), INTENT(IN) :: attr_id - INTEGER(SIZE_T), INTENT(IN) :: size - CHARACTER(LEN=*), INTENT(OUT) :: buf - END FUNCTION h5aget_name_c - END INTERFACE - - hdferr = h5aget_name_c(attr_id, size, buf) - END SUBROUTINE h5aget_name_f - -! -!****s* H5A/h5aget_name_by_idx_f -! -! NAME -! h5aget_name_by_idx_f -! -! PURPOSE -! Gets an attribute name, by attribute index position. -! -! INPUTS -! loc_id - Location of object to which attribute is attached -! obj_name - Name of object to which attribute is attached, relative to location -! idx_type - Type of index; Possible values are: -! H5_INDEX_UNKNOWN_F = -1 - Unknown index type -! H5_INDEX_NAME_F - Index on names -! H5_INDEX_CRT_ORDER_F - Index on creation order -! H5_INDEX_N_F - Number of indices defined -! -! order - Order in which to iterate over index; Possible values are: -! H5_ITER_UNKNOWN_F - Unknown order -! H5_ITER_INC_F - Increasing order -! H5_ITER_DEC_F - Decreasing order -! H5_ITER_NATIVE_F - No particular order, whatever is fastest -! H5_ITER_N_F - Number of iteration orders -! order - Index traversal order -! n - Attribute’s position in index -! -! OUTPUTS -! name - Attribute name -! hdferr - Returns 0 if successful and -1 if fails -! -! OPTIONAL PARAMETERS -! lapl_id - Link access property list -! size - Size, in bytes, of attribute name -! -! AUTHOR -! M. Scot Breitenfeld -! January, 2008 -! -! SOURCE - SUBROUTINE h5aget_name_by_idx_f(loc_id, obj_name, idx_type, order, & - n, name, hdferr, size, lapl_id) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id ! Identifer for object to which attribute is attached - CHARACTER(LEN=*), INTENT(IN) :: obj_name ! Name of object, relative to location, - ! from which attribute is to be removed *TEST* check NULL - INTEGER, INTENT(IN) :: idx_type ! Type of index; Possible values are: - ! H5_INDEX_UNKNOWN_F - Unknown index type - ! H5_INDEX_NAME_F - Index on names - ! H5_INDEX_CRT_ORDER_F - Index on creation order - ! H5_INDEX_N_F - Number of indices defined - - INTEGER, INTENT(IN) :: order ! Order in which to iterate over index; Possible values are: - ! H5_ITER_UNKNOWN_F - Unknown order - ! H5_ITER_INC_F - Increasing order - ! H5_ITER_DEC_F - Decreasing order - ! H5_ITER_NATIVE_F - No particular order, whatever is fastest - ! H5_ITER_N_F - Number of iteration orders - INTEGER(HSIZE_T), INTENT(IN) :: n ! Attribute’s position in index - CHARACTER(LEN=*), INTENT(OUT) :: name ! Attribute name - INTEGER, INTENT(OUT) :: hdferr ! Error code: - ! Returns attribute name size, - ! -1 if fail - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list - INTEGER(SIZE_T), OPTIONAL, INTENT(OUT) :: size ! Indicates the size, in the number of characters, - ! of the attribute -!***** - INTEGER(HID_T) :: lapl_id_default - INTEGER(SIZE_T) :: obj_namelen - INTEGER(SIZE_T) :: size_default - - INTERFACE - INTEGER FUNCTION h5aget_name_by_idx_c(loc_id, obj_name, obj_namelen, idx_type, order, & - n, name, size_default, lapl_id_default) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AGET_NAME_BY_IDX_C'::h5aget_name_by_idx_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: obj_name, name - INTEGER(HID_T), INTENT(IN) :: loc_id - CHARACTER(LEN=*), INTENT(IN) :: obj_name - INTEGER, INTENT(IN) :: idx_type - INTEGER, INTENT(IN) :: order - INTEGER(HSIZE_T), INTENT(IN) :: n - - CHARACTER(LEN=*), INTENT(OUT) :: name - INTEGER(SIZE_T) :: size_default - INTEGER(HID_T) :: lapl_id_default - INTEGER(SIZE_T) :: obj_namelen - END FUNCTION h5aget_name_by_idx_c - END INTERFACE - - obj_namelen = LEN(obj_name) - lapl_id_default = H5P_DEFAULT_F - IF(PRESENT(lapl_id)) lapl_id_default = lapl_id - - size_default = LEN(name) - - hdferr = h5aget_name_by_idx_c(loc_id, obj_name, obj_namelen, idx_type, order, & - n, name, size_default, lapl_id_default) - - IF(PRESENT(size)) size = size_default - - - END SUBROUTINE h5aget_name_by_idx_f -! -!****s* H5A/h5aget_num_attrs_f -! -! NAME -! h5aget_num_attrs_f -! -! PURPOSE -! Determines the number of attributes attached to an object. -! -! INPUTS -! obj_id - object (group, dataset, or named datatype) -! identifier -! OUTPUTS -! attr_num - number of attributes attached to the object -! hdferr - Returns 0 if successful and -1 if fails -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces are added for -! called C functions (it is needed for Windows -! port). February 27, 2001 -! -! SOURCE - SUBROUTINE h5aget_num_attrs_f(obj_id, attr_num, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: obj_id ! Object identifier - INTEGER, INTENT(OUT) :: attr_num ! Number of attributes of the object - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - - INTERFACE - INTEGER FUNCTION h5aget_num_attrs_c(obj_id, attr_num) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AGET_NUM_ATTRS_C'::h5aget_num_attrs_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: obj_id - INTEGER, INTENT(OUT) :: attr_num - END FUNCTION h5aget_num_attrs_c - END INTERFACE - - hdferr = h5aget_num_attrs_c(obj_id, attr_num) - END SUBROUTINE h5aget_num_attrs_f - -! -!****s* H5A/h5adelete_f -! -! NAME -! h5adelete_f -! -! PURPOSE -! Deletes an attribute of an object (group, dataset or -! named datatype) -! -! INPUTS -! obj_id - object identifier -! name - attribute name -! OUTPUTS -! -! hdferr - Returns 0 if successful and -1 if fails -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces are added for -! called C functions (it is needed for Windows -! port). February 27, 2001 -! -! SOURCE - SUBROUTINE h5adelete_f(obj_id, name, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: obj_id ! Object identifier - CHARACTER(LEN=*), INTENT(IN) :: name ! Attribute name - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTEGER(SIZE_T) :: namelen - - INTERFACE - INTEGER FUNCTION h5adelete_c(obj_id, name, namelen) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5ADELETE_C'::h5adelete_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: name - INTEGER(HID_T), INTENT(IN) :: obj_id - CHARACTER(LEN=*), INTENT(IN) :: name - INTEGER(SIZE_T) :: namelen - END FUNCTION h5adelete_c - END INTERFACE - - namelen = LEN(name) - hdferr = h5adelete_c(obj_id, name, namelen) - END SUBROUTINE h5adelete_f - -! -!****s* H5A/h5aclose_f -! -! NAME -! h5aclose_f -! -! PURPOSE -! Closes the specified attribute. -! -! INPUTS -! attr_id - attribute identifier -! OUTPUTS -! -! hdferr - Returns 0 if successful and -1 if fails -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces are added for -! called C functions (it is needed for Windows -! port). February 27, 2001 -! SOURCE - SUBROUTINE h5aclose_f(attr_id, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - - INTERFACE - INTEGER FUNCTION h5aclose_c(attr_id) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5ACLOSE_C'::h5aclose_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: attr_id - END FUNCTION h5aclose_c - END INTERFACE - - hdferr = h5aclose_c(attr_id) - END SUBROUTINE h5aclose_f - -! -!****s* H5A/h5aget_storage_size_f -! -! NAME -! h5aget_storage_size_f -! -! PURPOSE -! Returns the amount of storage required for an attribute. -! -! INPUTS -! attr_id - attribute identifier -! OUTPUTS -! size - attribute storage size -! hdferr - Returns 0 if successful and -1 if fails -! AUTHOR -! M. Scot Breitenfeld -! January, 2008 -! -! SOURCE - SUBROUTINE h5aget_storage_size_f(attr_id, size, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HSIZE_T), INTENT(OUT) :: size ! Attribute storage requirement - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - - INTERFACE - INTEGER FUNCTION h5aget_storage_size_c(attr_id, size) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AGET_STORAGE_SIZE_C'::h5aget_storage_size_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: attr_id - INTEGER(HSIZE_T), INTENT(OUT) :: size - END FUNCTION h5aget_storage_size_c - END INTERFACE - - hdferr = h5aget_storage_size_c(attr_id, size) - END SUBROUTINE h5aget_storage_size_f - -! -!****s* H5A/h5aget_create_plist_f -! -! NAME -! h5aget_create_plist_f -! -! PURPOSE -! Gets an attribute creation property list identifier -! -! INPUTS -! attr_id - Identifier of the attribute -! OUTPUTS -! creation_prop_id - Identifier for the attribute’s creation property -! hdferr - Returns 0 if successful and -1 if fails -! -! AUTHOR -! M. Scot Breitenfeld -! January, 2008 -! -! SOURCE - SUBROUTINE h5aget_create_plist_f(attr_id, creation_prop_id, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Identifier of the attribute - INTEGER(HID_T), INTENT(OUT) :: creation_prop_id ! Identifier for the attribute’s creation property - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! 0 on success and -1 on failure -!***** - - INTERFACE - INTEGER FUNCTION h5aget_create_plist_c(attr_id, creation_prop_id) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AGET_CREATE_PLIST_C'::h5aget_create_plist_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: attr_id - INTEGER(HID_T), INTENT(OUT) :: creation_prop_id - END FUNCTION h5aget_create_plist_c - END INTERFACE - - hdferr = h5aget_create_plist_c(attr_id, creation_prop_id) - END SUBROUTINE h5aget_create_plist_f - -! -!****s* H5A/h5arename_by_name_f -! -! NAME -! h5arename_by_name_f -! -! PURPOSE -! Renames an attribute -! -! INPUTS -! loc_id - Location or object identifier; may be dataset or group -! obj_name - Name of object, relative to location, -! whose attribute is to be renamed -! old_attr_name - Prior attribute name -! new_attr_name - New attribute name -! lapl_id - Link access property list identifier -! -! OUTPUTS -! hdferr - Returns 0 if successful and -1 if fails -! -! AUTHOR -! M. Scot Breitenfeld -! January, 2008 -! -! SOURCE - SUBROUTINE h5arename_by_name_f(loc_id, obj_name, old_attr_name, new_attr_name, & - hdferr, lapl_id) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id ! Object identifier - CHARACTER(LEN=*), INTENT(IN) :: obj_name ! Name of object, relative to location, - ! whose attribute is to be renamed - CHARACTER(LEN=*), INTENT(IN) :: old_attr_name ! Prior attribute name - CHARACTER(LEN=*), INTENT(IN) :: new_attr_name ! New attribute name - - INTEGER, INTENT(OUT) :: hdferr ! Error code: - ! 0 on success and -1 on failure - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list identifier -!***** - INTEGER(HID_T) :: lapl_id_default - INTEGER(SIZE_T) :: obj_namelen - INTEGER(SIZE_T) :: old_attr_namelen - INTEGER(SIZE_T) :: new_attr_namelen - - INTERFACE - INTEGER FUNCTION h5arename_by_name_c(loc_id, obj_name, obj_namelen, & - old_attr_name, old_attr_namelen, new_attr_name, new_attr_namelen, & - lapl_id_default) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5ARENAME_BY_NAME_C'::h5arename_by_name_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: obj_name, old_attr_name, new_attr_name - INTEGER(HID_T), INTENT(IN) :: loc_id - CHARACTER(LEN=*), INTENT(IN) :: obj_name - INTEGER(SIZE_T) :: obj_namelen - CHARACTER(LEN=*), INTENT(IN) :: old_attr_name - INTEGER(SIZE_T) :: old_attr_namelen - CHARACTER(LEN=*), INTENT(IN) :: new_attr_name - INTEGER(SIZE_T) :: new_attr_namelen - INTEGER(HID_T) :: lapl_id_default - - END FUNCTION h5arename_by_name_c - END INTERFACE - - obj_namelen = LEN(obj_name) - old_attr_namelen = LEN(old_attr_name) - new_attr_namelen = LEN(new_attr_name) - - lapl_id_default = H5P_DEFAULT_F - IF(PRESENT(lapl_id)) lapl_id_default=lapl_id - - hdferr = h5arename_by_name_c(loc_id, obj_name, obj_namelen, & - old_attr_name, old_attr_namelen, new_attr_name, new_attr_namelen, & - lapl_id_default) - - END SUBROUTINE h5arename_by_name_f - -! -!****s* H5A/h5aopen_f -! -! NAME -! h5aopen_f -! -! PURPOSE -! Opens an attribute for an object specified by object -! identifier and attribute name -! -! INPUTS -! obj_id - Identifer for object to which attribute is attached -! attr_name - Name of attribute to open -! OUTPUTS -! attr_id - attribute identifier - -! OPTIONAL PARAMETERS -! aapl_id - Attribute access property list -! hdferr - Returns 0 if successful and -1 if fails -! -! AUTHOR -! M. Scot Breitenfeld -! January, 2008 -! -! SOURCE - SUBROUTINE h5aopen_f(obj_id, attr_name, attr_id, hdferr, aapl_id) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: obj_id ! Object identifier - CHARACTER(LEN=*), INTENT(IN) :: attr_name ! Attribute name - INTEGER(HID_T), INTENT(OUT) :: attr_id ! Attribute identifier - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! Success: 0 - ! Failure: -1 - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: aapl_id ! Attribute access property list -!***** - INTEGER(HID_T) :: aapl_id_default - - INTEGER(SIZE_T) :: attr_namelen - - INTERFACE - INTEGER FUNCTION h5aopen_c(obj_id, attr_name, attr_namelen, aapl_id_default, attr_id) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AOPEN_C'::h5aopen_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: attr_name - INTEGER(HID_T), INTENT(IN) :: obj_id - CHARACTER(LEN=*), INTENT(IN) :: attr_name - INTEGER(HID_T) :: aapl_id_default - INTEGER(SIZE_T) :: attr_namelen - INTEGER(HID_T), INTENT(OUT) :: attr_id - END FUNCTION h5aopen_c - END INTERFACE - - attr_namelen = LEN(attr_name) - - aapl_id_default = H5P_DEFAULT_F - IF(PRESENT(aapl_id)) aapl_id_default = aapl_id - - hdferr = h5aopen_c(obj_id, attr_name, attr_namelen, aapl_id_default, attr_id) - - END SUBROUTINE h5aopen_f - -! -!****s* H5A/h5adelete_by_idx_f -! -! NAME -! h5adelete_by_idx_f -! -! PURPOSE -! Deletes an attribute from an object according to index order -! -! INPUTS -! loc_id - Location or object identifier; may be dataset or group -! obj_name - Name of object, relative to location, from which attribute is to be removed -! idx_type - Type of index; Possible values are: -! H5_INDEX_UNKNOWN_F = -1 - Unknown index type -! H5_INDEX_NAME_F - Index on names -! H5_INDEX_CRT_ORDER_F - Index on creation order -! H5_INDEX_N_F - Number of indices defined -! -! order - Order in which to iterate over index; Possible values are: -! H5_ITER_UNKNOWN_F - Unknown order -! H5_ITER_INC_F - Increasing order -! H5_ITER_DEC_F - Decreasing order -! H5_ITER_NATIVE_F - No particular order, whatever is fastest -! H5_ITER_N_F - Number of iteration orders -! -! n - Offset within index -! OUTPUTS -! hdferr - Returns 0 if successful and -1 if fails -! OPTIONAL PARAMETERS -! lapl_id - Link access property list -! -! AUTHOR -! M. Scot Breitenfeld -! January, 2008 -! -! SOURCE - SUBROUTINE h5adelete_by_idx_f(loc_id, obj_name, idx_type, order, n, hdferr, lapl_id) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id ! Identifer for object to which attribute is attached - CHARACTER(LEN=*), INTENT(IN) :: obj_name ! Name of object, relative to location, - ! from which attribute is to be removed - INTEGER, INTENT(IN) :: idx_type ! Type of index; Possible values are: - ! H5_INDEX_UNKNOWN_F - Unknown index type - ! H5_INDEX_NAME_F - Index on names - ! H5_INDEX_CRT_ORDER_F - Index on creation order - ! H5_INDEX_N_F - Number of indices defined - - INTEGER, INTENT(IN) :: order ! Order in which to iterate over index; Possible values are: - ! H5_ITER_UNKNOWN_F - Unknown order - ! H5_ITER_INC_F - Increasing order - ! H5_ITER_DEC_F - Decreasing order - ! H5_ITER_NATIVE_F - No particular order, whatever is fastest - ! H5_ITER_N_F - Number of iteration orders - INTEGER(HSIZE_T), INTENT(IN) :: n ! Offset within index - INTEGER, INTENT(OUT) :: hdferr ! Error code: - ! 0 on success and -1 on failure - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list -!***** - INTEGER(SIZE_T) :: obj_namelen - INTEGER(HID_T) :: lapl_id_default - - INTERFACE - INTEGER FUNCTION h5adelete_by_idx_c(loc_id, obj_name, obj_namelen, idx_type, order, n, lapl_id_default) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5ADELETE_BY_IDX_C'::h5adelete_by_idx_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: obj_name - INTEGER(HID_T), INTENT(IN) :: loc_id - CHARACTER(LEN=*), INTENT(IN) :: obj_name - INTEGER, INTENT(IN) :: idx_type - INTEGER, INTENT(IN) :: order - INTEGER(HSIZE_T), INTENT(IN) :: n - INTEGER(HID_T) :: lapl_id_default - INTEGER(SIZE_T) :: obj_namelen - END FUNCTION h5adelete_by_idx_c - END INTERFACE - - lapl_id_default = H5P_DEFAULT_F - IF(PRESENT(lapl_id)) lapl_id_default = lapl_id - - obj_namelen = LEN(obj_name) - hdferr = h5adelete_by_idx_c(loc_id, obj_name, obj_namelen, idx_type, order, n, lapl_id_default) - - END SUBROUTINE h5adelete_by_idx_f - -! -!****s* H5A/h5adelete_by_name_f -! -! NAME -! h5adelete_by_name_f -! -! PURPOSE -! Removes an attribute from a specified location -! -! INPUTS -! loc_id - Identifer for object to which attribute is attached -! obj_name - Name of attribute to open -! attr_name - Attribute access property list -! lapl_id - Link access property list -! OUTPUTS -! hdferr - Returns 0 if successful and -1 if fails -! -! AUTHOR -! M. Scot Breitenfeld -! January, 2008 -! -! SOURCE - SUBROUTINE h5adelete_by_name_f(loc_id, obj_name, attr_name, hdferr, lapl_id) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id ! Identifer for object to which attribute is attached - CHARACTER(LEN=*), INTENT(IN) :: obj_name ! Name of object, relative to location, - ! from which attribute is to be removed - CHARACTER(LEN=*), INTENT(IN) :: attr_name ! Name of attribute to delete - INTEGER, INTENT(OUT) :: hdferr ! Error code: - ! 0 on success and -1 on failure - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list -!***** - INTEGER(SIZE_T) :: attr_namelen - INTEGER(SIZE_T) :: obj_namelen - - INTEGER(HID_T) :: lapl_id_default - - INTERFACE - INTEGER FUNCTION h5adelete_by_name_c(loc_id, obj_name, obj_namelen, attr_name, attr_namelen, lapl_id_default) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5ADELETE_BY_NAME_C'::h5adelete_by_name_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: obj_name, attr_name - INTEGER(HID_T), INTENT(IN) :: loc_id - CHARACTER(LEN=*), INTENT(IN) :: obj_name - CHARACTER(LEN=*), INTENT(IN) :: attr_name - INTEGER(HID_T) :: lapl_id_default - INTEGER(SIZE_T) :: attr_namelen - INTEGER(SIZE_T) :: obj_namelen - END FUNCTION h5adelete_by_name_c - END INTERFACE - - obj_namelen = LEN(obj_name) - attr_namelen = LEN(attr_name) - - lapl_id_default = H5P_DEFAULT_F - IF(PRESENT(lapl_id)) lapl_id_default = lapl_id - - hdferr = h5adelete_by_name_c(loc_id, obj_name, obj_namelen, attr_name, attr_namelen, lapl_id_default) - - END SUBROUTINE h5adelete_by_name_f - -! -!****s* H5A/h5aopen_by_idx_f -! -! NAME -! h5aopen_by_idx_f -! -! PURPOSE -! Opens an existing attribute that is attached to an object specified by location and name -! -! INPUTS -! loc_id - Location of object to which attribute is attached -! obj_name - Name of object to which attribute is attached, relative to location -! idx_type - Type of index -! order - Index traversal order -! n - Attribute’s position in index -! OUTPUTS -! hdferr - Returns 0 if successful and -1 if fails -! OPTIONAL PARAMETERS -! aapl_id - Attribute access property list -! lapl_id - Link access property list -! -! AUTHOR -! M. Scot Breitenfeld -! January, 2008 -! -! SOURCE - SUBROUTINE h5aopen_by_idx_f(loc_id, obj_name, idx_type, order, n, attr_id, hdferr, aapl_id, lapl_id) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id ! Object identifier - CHARACTER(LEN=*), INTENT(IN) :: obj_name ! Name of object to which attribute is attached - INTEGER, INTENT(IN) :: idx_type ! Type of index; Possible values are: - ! H5_INDEX_UNKNOWN_F - Unknown index type - ! H5_INDEX_NAME_F - Index on names - ! H5_INDEX_CRT_ORDER_F - Index on creation order - ! H5_INDEX_N_F - Number of indices defined - INTEGER, INTENT(IN) :: order ! Order in which to iterate over index; Possible values are: - ! H5_ITER_UNKNOWN_F - Unknown order - ! H5_ITER_INC_F - Increasing order - ! H5_ITER_DEC_F - Decreasing order - ! H5_ITER_NATIVE_F - No particular order, whatever is fastest - - INTEGER(HSIZE_T), INTENT(IN) :: n ! Attribute’s position in index - - INTEGER(HID_T), INTENT(OUT) :: attr_id ! Attribute identifier - INTEGER, INTENT(OUT) :: hdferr ! Error code: - ! 0 on success and -1 on failure - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: aapl_id ! Attribute access property list - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list -!***** - INTEGER(SIZE_T) :: obj_namelen - INTEGER(HID_T) :: aapl_id_default - INTEGER(HID_T) :: lapl_id_default - - INTERFACE - INTEGER FUNCTION h5aopen_by_idx_c(loc_id, obj_name, obj_namelen, idx_type, order, n, & - aapl_id_default, lapl_id_default, attr_id) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AOPEN_BY_IDX_C'::h5aopen_by_idx_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: obj_name - INTEGER(HID_T), INTENT(IN) :: loc_id - CHARACTER(LEN=*), INTENT(IN) :: obj_name - INTEGER, INTENT(IN) :: idx_type - INTEGER, INTENT(IN) :: order - INTEGER(HSIZE_T), INTENT(IN) :: n - INTEGER(HID_T) :: aapl_id_default - INTEGER(HID_T) :: lapl_id_default - INTEGER(SIZE_T) :: obj_namelen - INTEGER(HID_T), INTENT(OUT) :: attr_id ! Attribute identifier - END FUNCTION h5aopen_by_idx_c - END INTERFACE - - obj_namelen = LEN(obj_name) - - aapl_id_default = H5P_DEFAULT_F - IF(PRESENT(aapl_id)) aapl_id_default = aapl_id - lapl_id_default = H5P_DEFAULT_F - IF(PRESENT(lapl_id)) lapl_id_default = lapl_id - - hdferr = h5aopen_by_idx_c(loc_id, obj_name, obj_namelen, idx_type, order, n, & - aapl_id_default, lapl_id_default, attr_id) - - END SUBROUTINE h5aopen_by_idx_f - -! -!****s* H5A/h5aget_info_f -! -! NAME -! h5aget_info_f -! -! PURPOSE -! Retrieves attribute information, by attribute identifier -! -! INPUTS -! attr_id - attribute identifier -! -! OUTPUTS -! NOTE: In C it is defined as a structure: H5A_info_t -! -! corder_valid - indicates whether the creation order data is valid for this attribute -! corder - is a positive integer containing the creation order of the attribute -! cset - indicates the character set used for the attribute’s name -! data_size - indicates the size, in the number of characters, of the attribute -! hdferr - Returns 0 if successful and -1 if fails -! AUTHOR -! M. Scot Breitenfeld -! January, 2008 -! SOURCE - SUBROUTINE h5aget_info_f(attr_id, f_corder_valid, corder, cset, data_size, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - - LOGICAL, INTENT(OUT) :: f_corder_valid ! Indicates whether the creation order data is valid for this attribute - INTEGER, INTENT(OUT) :: corder ! Is a positive integer containing the creation order of the attribute - INTEGER, INTENT(OUT) :: cset ! Indicates the character set used for the attribute’s name - INTEGER(HSIZE_T), INTENT(OUT) :: data_size ! Indicates the size, in the number of characters, of the attribute - INTEGER, INTENT(OUT) :: hdferr ! Error code: - ! 0 on success and -1 on failure -!***** - INTEGER :: corder_valid - - INTERFACE - INTEGER FUNCTION h5aget_info_c(attr_id, corder_valid, corder, cset, data_size) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AGET_INFO_C'::h5aget_info_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: attr_id - - INTEGER, INTENT(OUT) :: corder_valid - INTEGER, INTENT(OUT) :: corder - INTEGER, INTENT(OUT) :: cset - INTEGER(HSIZE_T), INTENT(OUT) :: data_size - END FUNCTION h5aget_info_c - END INTERFACE - - hdferr = h5aget_info_c(attr_id, corder_valid, corder, cset, data_size) - - f_corder_valid =.FALSE. - IF (corder_valid .EQ. 1) f_corder_valid =.TRUE. - - - END SUBROUTINE h5aget_info_f - -! -!****s* H5A/h5aget_info_by_idx_f -! -! NAME -! h5aget_info_by_idx_f -! -! PURPOSE -! Retrieves attribute information, by attribute index position -! -! INPUTS -! loc_id - Location of object to which attribute is attached -! obj_name - Name of object to which attribute is attached, relative to location -! idx_type - Type of index -! order - Index traversal order -! n - Attribute’s position in index -! -! OUTPUTS NOTE: In C it is defined as a structure: H5A_info_t -! corder_valid - indicates whether the creation order data is valid for this attribute -! corder - is a positive integer containing the creation order of the attribute -! cset - indicates the character set used for the attribute’s name -! data_size - indicates the size, in the number of characters, of the attribute -! hdferr - Returns 0 if successful and -1 if fails -! OPTIONAL PARAMETERS -! lapl_id - Link access property list -! -! AUTHOR -! M. Scot Breitenfeld -! January, 2008 -! -! SOURCE - SUBROUTINE h5aget_info_by_idx_f(loc_id, obj_name, idx_type, order, n, & - f_corder_valid, corder, cset, data_size, hdferr, lapl_id) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id ! Object identifier - CHARACTER(LEN=*), INTENT(IN) :: obj_name ! Name of object to which attribute is attached - INTEGER, INTENT(IN) :: idx_type ! Type of index; Possible values are: - ! H5_INDEX_UNKNOWN_F - Unknown index type - ! H5_INDEX_NAME_F - Index on names - ! H5_INDEX_CRT_ORDER_F - Index on creation order - ! H5_INDEX_N_F - Number of indices defined - INTEGER, INTENT(IN) :: order ! Order in which to iterate over index; Possible values are: - ! H5_ITER_UNKNOWN_F - Unknown order - ! H5_ITER_INC_F - Increasing order - ! H5_ITER_DEC_F - Decreasing order - ! H5_ITER_NATIVE_F - No particular order, whatever is fastest - - INTEGER(HSIZE_T), INTENT(IN) :: n ! Attribute’s position in index - - - LOGICAL, INTENT(OUT) :: f_corder_valid ! Indicates whether the creation order data is valid for this attribute - INTEGER, INTENT(OUT) :: corder ! Is a positive integer containing the creation order of the attribute - INTEGER, INTENT(OUT) :: cset ! Indicates the character set used for the attribute’s name - INTEGER(HSIZE_T), INTENT(OUT) :: data_size ! Indicates the size, in the number of characters, of the attribute - INTEGER, INTENT(OUT) :: hdferr ! Error code: - ! 0 on success and -1 on failure - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list -!***** - INTEGER :: corder_valid - INTEGER(SIZE_T) :: obj_namelen - INTEGER(HID_T) :: lapl_id_default - - INTERFACE - INTEGER FUNCTION h5aget_info_by_idx_c(loc_id, obj_name, obj_namelen, idx_type, order, n, lapl_id_default, & - corder_valid, corder, cset, data_size) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AGET_INFO_BY_IDX_C'::h5aget_info_by_idx_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: obj_name - INTEGER(HID_T), INTENT(IN) :: loc_id - CHARACTER(LEN=*), INTENT(IN) :: obj_name - INTEGER, INTENT(IN) :: idx_type - INTEGER, INTENT(IN) :: order - INTEGER(HSIZE_T), INTENT(IN) :: n - INTEGER(HID_T) :: lapl_id_default - INTEGER, INTENT(OUT) :: corder_valid - INTEGER, INTENT(OUT) :: corder - INTEGER, INTENT(OUT) :: cset - INTEGER(HSIZE_T), INTENT(OUT) :: data_size - - INTEGER(SIZE_T) :: obj_namelen - END FUNCTION h5aget_info_by_idx_c - END INTERFACE - - obj_namelen = LEN(obj_name) - - lapl_id_default = H5P_DEFAULT_F - IF(present(lapl_id)) lapl_id_default = lapl_id - - hdferr = h5aget_info_by_idx_c(loc_id, obj_name, obj_namelen, idx_type, order, n, lapl_id_default, & - corder_valid, corder, cset, data_size) - - f_corder_valid =.FALSE. - IF (corder_valid .EQ. 1) f_corder_valid =.TRUE. - - END SUBROUTINE h5aget_info_by_idx_f - -! -!****s* H5A/h5aget_info_by_name_f -! -! NAME -! h5aget_info_by_name_f -! -! PURPOSE -! Retrieves attribute information, by attribute name -! -! INPUTS -! loc_id - Location of object to which attribute is attached -! obj_name - Name of object to which attribute is attached, relative to location -! attr_name - Attribute name -! -! OUTPUTS NOTE: In C it is defined as a structure: H5A_info_t -! corder_valid - indicates whether the creation order data is valid for this attribute -! corder - is a positive integer containing the creation order of the attribute -! cset - indicates the character set used for the attribute’s name -! data_size - indicates the size, in the number of characters, of the attribute -! hdferr - Returns 0 if successful and -1 if fails -! OPTIONAL PARAMETERS -! lapl_id - Link access property list -! -! AUTHOR -! M. Scot Breitenfeld -! January, 2008 -! -! SOURCE - SUBROUTINE h5aget_info_by_name_f(loc_id, obj_name, attr_name, & - f_corder_valid, corder, cset, data_size, hdferr, lapl_id) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id ! Object identifier - CHARACTER(LEN=*), INTENT(IN) :: obj_name ! Name of object to which attribute is attached - CHARACTER(LEN=*), INTENT(IN) :: attr_name ! Attribute name - - - LOGICAL, INTENT(OUT) :: f_corder_valid ! Indicates whether the creation order data is valid for this attribute - INTEGER, INTENT(OUT) :: corder ! Is a positive integer containing the creation order of the attribute - INTEGER, INTENT(OUT) :: cset ! Indicates the character set used for the attribute’s name - INTEGER(HSIZE_T), INTENT(OUT) :: data_size ! Indicates the size, in the number of characters, of the attribute - INTEGER, INTENT(OUT) :: hdferr ! Error code: - ! 0 on success and -1 on failure - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list -!***** - INTEGER :: corder_valid - INTEGER(SIZE_T) :: obj_namelen - INTEGER(SIZE_T) :: attr_namelen - INTEGER(HID_T) :: lapl_id_default - - INTERFACE - INTEGER FUNCTION h5aget_info_by_name_c(loc_id, obj_name, obj_namelen, attr_name, attr_namelen, lapl_id_default, & - corder_valid, corder, cset, data_size) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AGET_INFO_BY_NAME_C'::h5aget_info_by_name_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: obj_name, attr_name - INTEGER(HID_T), INTENT(IN) :: loc_id - CHARACTER(LEN=*), INTENT(IN) :: obj_name - INTEGER(SIZE_T), INTENT(IN) :: obj_namelen - CHARACTER(LEN=*), INTENT(IN) :: attr_name - INTEGER(SIZE_T), INTENT(IN) :: attr_namelen - INTEGER(HID_T) :: lapl_id_default - INTEGER, INTENT(OUT) :: corder_valid - INTEGER, INTENT(OUT) :: corder - INTEGER, INTENT(OUT) :: cset - INTEGER(HSIZE_T), INTENT(OUT) :: data_size - - END FUNCTION h5aget_info_by_name_c - END INTERFACE - - obj_namelen = LEN(obj_name) - attr_namelen = LEN(attr_name) - - lapl_id_default = H5P_DEFAULT_F - IF(PRESENT(lapl_id)) lapl_id_default = lapl_id - - hdferr = h5aget_info_by_name_c(loc_id, obj_name, obj_namelen, attr_name, attr_namelen, lapl_id_default, & - corder_valid, corder, cset, data_size) - - f_corder_valid =.FALSE. - IF (corder_valid .EQ. 1) f_corder_valid =.TRUE. - - END SUBROUTINE h5aget_info_by_name_f - -! -!****s* H5A/h5acreate_by_name_f -! -! NAME -! h5acreate_by_name_f -! -! PURPOSE -! Creates an attribute attached to a specified object -! -! INPUTS -! loc_id - Location or object identifier; may be dataset or group -! obj_name - Name, relative to loc_id, of object that attribute is to be attached to -! attr_name - Attribute name -! type_id - Attribute datatype identifier -! space_id - Attribute dataspace identifier -! -! OUTPUTS -! attr - an attribute identifier -! hdferr - Returns 0 if successful and -1 if fails -! OPTIONAL PARAMETERS -! acpl_id - Attribute creation property list identifier (Currently not used.) -! aapl_id - Attribute access property list identifier (Currently not used.) -! lapl_id - Link access property list -! -! AUTHOR -! M. Scot Breitenfeld -! February, 2008 -! SOURCE - SUBROUTINE h5acreate_by_name_f(loc_id, obj_name, attr_name, type_id, space_id, attr, hdferr, & - acpl_id, aapl_id, lapl_id) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id - CHARACTER(LEN=*), INTENT(IN) :: obj_name - CHARACTER(LEN=*), INTENT(IN) :: attr_name - INTEGER(HID_T), INTENT(IN) :: type_id - INTEGER(HID_T), INTENT(IN) :: space_id - INTEGER(HID_T), INTENT(OUT) :: attr - INTEGER, INTENT(OUT) :: hdferr - - INTEGER(HID_T), INTENT(IN), OPTIONAL :: acpl_id - INTEGER(HID_T), INTENT(IN), OPTIONAL :: aapl_id - INTEGER(HID_T), INTENT(IN), OPTIONAL :: lapl_id -!***** - INTEGER(SIZE_T) :: obj_namelen - INTEGER(SIZE_T) :: attr_namelen - - INTEGER(HID_T) :: acpl_id_default - INTEGER(HID_T) :: aapl_id_default - INTEGER(HID_T) :: lapl_id_default - - INTERFACE - INTEGER FUNCTION h5acreate_by_name_c(loc_id, obj_name, obj_namelen, attr_name, attr_namelen, & - type_id, space_id, acpl_id_default, aapl_id_default, lapl_id_default, attr) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5ACREATE_BY_NAME_C'::h5acreate_by_name_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: obj_name, attr_name - INTEGER(HID_T), INTENT(IN) :: loc_id - CHARACTER(LEN=*), INTENT(IN) :: obj_name - INTEGER(SIZE_T), INTENT(IN) :: obj_namelen - CHARACTER(LEN=*), INTENT(IN) :: attr_name - INTEGER(SIZE_T), INTENT(IN) :: attr_namelen - INTEGER(HID_T), INTENT(IN) :: type_id - INTEGER(HID_T), INTENT(IN) :: space_id - INTEGER(HID_T) :: acpl_id_default - INTEGER(HID_T) :: aapl_id_default - INTEGER(HID_T) :: lapl_id_default - INTEGER(HID_T), INTENT(OUT) :: attr - - END FUNCTION h5acreate_by_name_c - END INTERFACE - - obj_namelen = LEN(obj_name) - attr_namelen = LEN(attr_name) - - acpl_id_default = H5P_DEFAULT_F - aapl_id_default = H5P_DEFAULT_F - lapl_id_default = H5P_DEFAULT_F - - IF(PRESENT(acpl_id)) acpl_id_default = acpl_id - IF(PRESENT(aapl_id)) aapl_id_default = aapl_id - IF(PRESENT(lapl_id)) lapl_id_default = lapl_id - - hdferr = h5acreate_by_name_c(loc_id, obj_name, obj_namelen, attr_name, attr_namelen, & - type_id, space_id, acpl_id_default, aapl_id_default, lapl_id_default, attr) - END SUBROUTINE h5acreate_by_name_f - -! -!****s* H5A/H5Aexists_f -! -! NAME -! H5Aexists_f -! -! PURPOSE -! Determines whether an attribute with a given name exists on an object -! -! INPUTS -! obj_id - Object identifier -! attr_name - Attribute name -! -! OUTPUTS -! attr_exists - attribute exists status -! hdferr - Returns 0 if successful and -1 if fails -! -! AUTHOR -! M. Scot Breitenfeld -! February, 2008 -! -! SOURCE - SUBROUTINE h5aexists_f(obj_id, attr_name, attr_exists, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: obj_id ! Object identifier - CHARACTER(LEN=*), INTENT(IN) :: attr_name ! Attribute name - LOGICAL, INTENT(OUT) :: attr_exists ! .TRUE. if exists, .FALSE. otherwise - INTEGER, INTENT(OUT) :: hdferr ! Error code: - ! 0 on success and -1 on failure -!***** - INTEGER(HID_T) :: attr_exists_c - INTEGER(SIZE_T) :: attr_namelen - - INTERFACE - INTEGER FUNCTION h5aexists_c(obj_id, attr_name, attr_namelen, attr_exists_c) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AEXISTS_C'::h5aexists_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: attr_name - INTEGER(HID_T), INTENT(IN) :: obj_id - CHARACTER(LEN=*), INTENT(IN) :: attr_name - INTEGER(SIZE_T) :: attr_namelen - INTEGER(HID_T) :: attr_exists_c - END FUNCTION h5aexists_c - END INTERFACE - - attr_namelen = LEN(attr_name) - - hdferr = h5aexists_c(obj_id, attr_name, attr_namelen, attr_exists_c) - - attr_exists = .FALSE. - IF(attr_exists_c.GT.0) attr_exists = .TRUE. - - END SUBROUTINE h5aexists_f - -! -!****s* H5A/H5Aexists_by_name_f -! -! NAME -! H5Aexists_by_name_f -! -! PURPOSE -! Determines whether an attribute with a given name exists on an object -! -! INPUTS -! loc_id - Location identifier -! obj_name - Object name either relative to loc_id, absolute from the file’s root group, or '.' (a dot) -! attr_name - Attribute name -! -! OUTPUTS -! attr_exists - attribute exists status -! hdferr - Returns 0 if successful and -1 if fails -! OPTIONAL PARAMETERS -! lapl_id - Link access property list identifier -! -! AUTHOR -! M. Scot Breitenfeld -! February, 2008 -! -! SOURCE - SUBROUTINE h5aexists_by_name_f(loc_id, obj_name, attr_name, attr_exists, hdferr, lapl_id) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id ! Location identifier - CHARACTER(LEN=*), INTENT(IN) :: obj_name ! Object name either relative to loc_id, - ! absolute from the file’s root group, or '.' - CHARACTER(LEN=*), INTENT(IN) :: attr_name ! Attribute name - LOGICAL, INTENT(OUT) :: attr_exists ! .TRUE. if exists, .FALSE. otherwise - INTEGER, INTENT(OUT) :: hdferr ! Error code: - ! 0 on success and -1 on failure - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list identifier -!***** - INTEGER :: attr_exists_c - INTEGER(SIZE_T) :: obj_namelen - INTEGER(SIZE_T) :: attr_namelen - - INTEGER(HID_T) :: lapl_id_default - - INTERFACE - INTEGER FUNCTION h5aexists_by_name_c(loc_id, obj_name, obj_namelen, attr_name, attr_namelen, lapl_id_default, attr_exists_c) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AEXISTS_BY_NAME_C'::h5aexists_by_name_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: obj_name, attr_name - INTEGER(HID_T), INTENT(IN) :: loc_id - CHARACTER(LEN=*), INTENT(IN) :: obj_name - INTEGER(SIZE_T), INTENT(IN) :: obj_namelen - CHARACTER(LEN=*), INTENT(IN) :: attr_name - INTEGER(SIZE_T), INTENT(IN) :: attr_namelen - INTEGER(HID_T), INTENT(IN) :: lapl_id_default - INTEGER, INTENT(OUT) :: attr_exists_c - END FUNCTION h5aexists_by_name_c - END INTERFACE - - attr_namelen = LEN(attr_name) - obj_namelen = LEN(obj_name) - - lapl_id_default = H5P_DEFAULT_F - IF(PRESENT(lapl_id)) lapl_id_default = lapl_id - - hdferr = h5aexists_by_name_c(loc_id, obj_name, obj_namelen, attr_name, attr_namelen, lapl_id_default, attr_exists_c) - - attr_exists = .FALSE. - IF(attr_exists_c.GT.0) attr_exists = .TRUE. - - END SUBROUTINE h5aexists_by_name_f -! -!****s* H5A/H5Aopen_by_name_f -! -! NAME -! H5Aopen_by_name_f -! -! PURPOSE -! Opens an attribute for an object by object name and attribute name. -! -! INPUTS -! loc_id - Location from which to find object to which attribute is attached -! obj_name - Object name either relative to loc_id, absolute from the file’s root group, or '.' (a dot) -! attr_name - Attribute name -! -! OUTPUTS -! attr_id - attribute identifier -! hdferr - Returns 0 if successful and -1 if fails -! OPTIONAL PARAMETERS -! aapl_id - Attribute access property list (Currently unused; should be passed in as H5P_DEFAULT.) -! lapl_id - Link access property list identifier -! -! AUTHOR -! M. Scot Breitenfeld -! February, 2008 -! SOURCE - SUBROUTINE h5aopen_by_name_f(loc_id, obj_name, attr_name, attr_id, hdferr, aapl_id, lapl_id) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id ! Location identifier - CHARACTER(LEN=*), INTENT(IN) :: obj_name ! Object name either relative to loc_id, - ! absolute from the file’s root group, or '.' - CHARACTER(LEN=*), INTENT(IN) :: attr_name ! Attribute name - INTEGER(HID_T), INTENT(OUT) :: attr_id ! Attribute identifier - INTEGER, INTENT(OUT) :: hdferr ! Error code: - ! 0 on success and -1 on failure - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: aapl_id ! Attribute access property list - ! (Currently unused; should be passed in as H5P_DEFAULT_F) - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list identifier -!***** - INTEGER(HID_T) :: aapl_id_default - INTEGER(HID_T) :: lapl_id_default - - INTEGER(SIZE_T) :: obj_namelen - INTEGER(SIZE_T) :: attr_namelen - - INTERFACE - INTEGER FUNCTION h5aopen_by_name_c(loc_id, obj_name, obj_namelen, attr_name, attr_namelen, & - aapl_id_default, lapl_id_default, attr_id) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AOPEN_BY_NAME_C'::h5aopen_by_name_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: obj_name, attr_name - INTEGER(HID_T), INTENT(IN) :: loc_id - CHARACTER(LEN=*), INTENT(IN) :: obj_name - INTEGER(SIZE_T), INTENT(IN) :: obj_namelen - CHARACTER(LEN=*), INTENT(IN) :: attr_name - INTEGER(SIZE_T), INTENT(IN) :: attr_namelen - INTEGER(HID_T) :: aapl_id_default - INTEGER(HID_T) :: lapl_id_default - INTEGER(HID_T), INTENT(OUT) :: attr_id - END FUNCTION h5aopen_by_name_c - END INTERFACE - - attr_namelen = LEN(attr_name) - obj_namelen = LEN(obj_name) - - aapl_id_default = H5P_DEFAULT_F - lapl_id_default = H5P_DEFAULT_F - IF(PRESENT(aapl_id)) aapl_id_default = aapl_id - IF(PRESENT(lapl_id)) lapl_id_default = lapl_id - - hdferr = h5aopen_by_name_c(loc_id, obj_name, obj_namelen, attr_name, attr_namelen, & - aapl_id_default, lapl_id_default, attr_id) - - END SUBROUTINE h5aopen_by_name_f - -! -!****s* H5A/h5arename_f -! -! NAME -! h5arename_f -! -! PURPOSE -! Renames an attribute -! -! INPUTS -! loc_id - Location or object identifier; may be dataset or group -! old_attr_name - Prior attribute name -! new_attr_name - New attribute name -! -! OUTPUTS -! hdferr - Returns 0 if successful and -1 if fails -! -! AUTHOR -! M. Scot Breitenfeld -! January, 2008 -! -! HISTORY -! N/A -! -! - -! SOURCE - SUBROUTINE h5arename_f(loc_id, old_attr_name, new_attr_name, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id ! Object identifier - CHARACTER(LEN=*), INTENT(IN) :: old_attr_name ! Prior attribute name - CHARACTER(LEN=*), INTENT(IN) :: new_attr_name ! New attribute name - INTEGER, INTENT(OUT) :: hdferr ! Error code: - ! 0 on success and -1 on failure -!***** - INTEGER(SIZE_T) :: old_attr_namelen - INTEGER(SIZE_T) :: new_attr_namelen - - INTERFACE - INTEGER FUNCTION h5arename_c(loc_id, & - old_attr_name, old_attr_namelen, new_attr_name, new_attr_namelen) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5ARENAME_C'::h5arename_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: old_attr_name, new_attr_name - INTEGER(HID_T), INTENT(IN) :: loc_id - CHARACTER(LEN=*), INTENT(IN) :: old_attr_name - INTEGER(SIZE_T) :: old_attr_namelen - CHARACTER(LEN=*), INTENT(IN) :: new_attr_name - INTEGER(SIZE_T) :: new_attr_namelen - - END FUNCTION h5arename_c - END INTERFACE - - old_attr_namelen = LEN(old_attr_name) - new_attr_namelen = LEN(new_attr_name) - - hdferr = h5arename_c(loc_id, & - old_attr_name, old_attr_namelen, new_attr_name, new_attr_namelen) - - END SUBROUTINE h5arename_f - -END MODULE H5A - - diff --git a/fortran/src/H5Aff_F03.f90 b/fortran/src/H5Aff_F03.f90 deleted file mode 100644 index 5278280..0000000 --- a/fortran/src/H5Aff_F03.f90 +++ /dev/null @@ -1,1267 +0,0 @@ -!****h* ROBODoc/H5A (F03) -! NAME -! H5A_PROVISIONAL -! -! FILE -! src/fortran/src/H5Aff_F03.f90 -! -! PURPOSE -! This file contains Fortran 90 and Fortran 2003 interfaces for H5A functions. -! It contains the same functions as H5Aff_F90.f90 but includes the -! Fortran 2003 functions and the interface listings. This file will be compiled -! instead of H5Aff_F90.f90 if Fortran 2003 functions are enabled. -! -! 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. * -! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -! -! NOTES -! -! (A) C_LOC and character strings according to the Fortran 2003 standard: -! -! 15.1.2.5 C_LOC(X) -! -! Argument. X shall either -! -! (1) have interoperable type and type parameters and be -! (a) a variable that has the TARGET attribute and is interoperable, -! (b) an allocated allocatable variable that has the TARGET attribute -! and is not an array of zero size, or -! (c) an associated scalar pointer, or -! (2) be a nonpolymorphic scalar, have no length type parameters, and be -! (a) a nonallocatable, nonpointer variable that has the TARGET attribute, -! (b) an allocated allocatable variable that has the TARGET attribute, or -! (c) an associated pointer. -! -! - When X is a character, for interoperability the standard is: -! -! 15.2.1 Interoperability of intrinsic types -! -! ...if the type is character, interoperability also requires that the length type parameter -! be omitted or be specified by an initialization expression whose value is one. -! -! THEREFORE compilers that have not extended the standard require -! -! CHARACTER(LEN=1), TARGET :: chr -! or -! CHARACTER, TARGET :: chr -! -! (B) -! *** IMPORTANT *** -! If you add a new H5A function you must add the function name to the -! Windows dll file 'hdf5_fortrandll.def.in' in the fortran/src directory. -! This is needed for Windows based operating systems. -! -!***** - -MODULE H5A_PROVISIONAL - - USE H5GLOBAL -! -! On Windows there are no big (integer*8) integers, so overloading -! for bug #670 does not work. I have to use DEC compilation directives to make -! Windows DEC Visual Fortran and OSF compilers happy and do right things. -! 05/01/02 EP -! - INTERFACE h5awrite_f - MODULE PROCEDURE h5awrite_integer_scalar - MODULE PROCEDURE h5awrite_integer_1 - MODULE PROCEDURE h5awrite_integer_2 - MODULE PROCEDURE h5awrite_integer_3 - MODULE PROCEDURE h5awrite_integer_4 - MODULE PROCEDURE h5awrite_integer_5 - MODULE PROCEDURE h5awrite_integer_6 - MODULE PROCEDURE h5awrite_integer_7 - MODULE PROCEDURE h5awrite_char_scalar - MODULE PROCEDURE h5awrite_char_1 - MODULE PROCEDURE h5awrite_char_2 - MODULE PROCEDURE h5awrite_char_3 - MODULE PROCEDURE h5awrite_char_4 - MODULE PROCEDURE h5awrite_char_5 - MODULE PROCEDURE h5awrite_char_6 - MODULE PROCEDURE h5awrite_char_7 - MODULE PROCEDURE h5awrite_real_scalar - MODULE PROCEDURE h5awrite_real_1 - MODULE PROCEDURE h5awrite_real_2 - MODULE PROCEDURE h5awrite_real_3 - MODULE PROCEDURE h5awrite_real_4 - MODULE PROCEDURE h5awrite_real_5 - MODULE PROCEDURE h5awrite_real_6 - MODULE PROCEDURE h5awrite_real_7 - ! This is the preferred way to call h5awrite - ! by passing an address - MODULE PROCEDURE h5awrite_ptr - - END INTERFACE - - INTERFACE h5aread_f - - MODULE PROCEDURE h5aread_integer_scalar - MODULE PROCEDURE h5aread_integer_1 - MODULE PROCEDURE h5aread_integer_2 - MODULE PROCEDURE h5aread_integer_3 - MODULE PROCEDURE h5aread_integer_4 - MODULE PROCEDURE h5aread_integer_5 - MODULE PROCEDURE h5aread_integer_6 - MODULE PROCEDURE h5aread_integer_7 - MODULE PROCEDURE h5aread_char_scalar - MODULE PROCEDURE h5aread_char_1 - MODULE PROCEDURE h5aread_char_2 - MODULE PROCEDURE h5aread_char_3 - MODULE PROCEDURE h5aread_char_4 - MODULE PROCEDURE h5aread_char_5 - MODULE PROCEDURE h5aread_char_6 - MODULE PROCEDURE h5aread_char_7 - MODULE PROCEDURE h5aread_real_scalar - MODULE PROCEDURE h5aread_real_1 - MODULE PROCEDURE h5aread_real_2 - MODULE PROCEDURE h5aread_real_3 - MODULE PROCEDURE h5aread_real_4 - MODULE PROCEDURE h5aread_real_5 - MODULE PROCEDURE h5aread_real_6 - MODULE PROCEDURE h5aread_real_7 - - ! This is the preferred way to call h5aread - ! by passing an address - MODULE PROCEDURE h5aread_ptr - - END INTERFACE - -! Interface for the function used to pass the C pointer of the buffer -! to the C H5Awrite routine - - INTERFACE - INTEGER FUNCTION h5awrite_f_c(attr_id, mem_type_id, buf) BIND(C, NAME='h5awrite_f_c') - USE, INTRINSIC :: ISO_C_BINDING, ONLY : c_ptr - USE H5GLOBAL - INTEGER(HID_T), INTENT(IN) :: attr_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - TYPE(C_PTR), VALUE :: buf - END FUNCTION h5awrite_f_c - END INTERFACE - -! Interface for the function used to pass the C pointer of the buffer -! to the C H5Aread routine - - INTERFACE - INTEGER FUNCTION h5aread_f_c(attr_id, mem_type_id, buf) BIND(C, NAME='h5aread_f_c') - USE, INTRINSIC :: ISO_C_BINDING, ONLY : c_ptr - USE H5GLOBAL - INTEGER(HID_T), INTENT(IN) :: attr_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - TYPE(C_PTR), VALUE :: buf - END FUNCTION h5aread_f_c - END INTERFACE - -CONTAINS - -!****s* H5A (F03)/h5awrite_f_F90 -! -! NAME -! h5awrite_f_F90 -! -! PURPOSE -! Writes an attribute. -! -! Inputs: -! attr_id - Attribute identifier -! memtype_id - Attribute datatype identifier (in memory) -! dims - Array to hold corresponding dimension sizes of data buffer buf; -! dim(k) has value of the k-th dimension of buffer buf; -! values are ignored if buf is a scalar -! buf - Data buffer; may be a scalar or an array -! -! Outputs: -! hdferr - Returns 0 if successful and -1 if fails -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces are added for -! called C functions (it is needed for Windows -! port). February 27, 2001 -! -! dims parameter was added to make code portable; -! Aprile 4, 2001 -! -! Changed buf intent to INOUT to be consistant -! with how the C functions handles it. The pg -! compiler will return 0 if a buf value is not set. -! February, 2008 -! -! NOTES -! This function is overloaded to write INTEGER, -! REAL, DOUBLE PRECISION and CHARACTER buffers -! up to 7 dimensions. -! -! Fortran90 Interface: -!! SUBROUTINE h5awrite_f(attr_id, memtype_id, buf, dims, hdferr) -!! INTEGER(HID_T) , INTENT(IN) :: attr_id -!! INTEGER(HID_T) , INTENT(IN) :: memtype_id -!! TYPE , INTENT(IN) :: buf -!! INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims -!! INTEGER , INTENT(OUT) :: hdferr -!***** - - - SUBROUTINE h5awrite_integer_scalar(attr_id, memtype_id, buf, dims, hdferr) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - INTEGER, INTENT(IN), TARGET :: buf ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - TYPE(C_PTR) :: f_ptr - - f_ptr = C_LOC(buf) - - hdferr = h5awrite_f_c(attr_id, memtype_id, f_ptr) - - END SUBROUTINE h5awrite_integer_scalar - - SUBROUTINE h5awrite_integer_1(attr_id, memtype_id, buf, dims, hdferr) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - INTEGER, INTENT(IN) , & - DIMENSION(dims(1)), TARGET :: buf ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - TYPE(C_PTR) :: f_ptr - - f_ptr = C_LOC(buf(1)) - - hdferr = h5awrite_f_c(attr_id, memtype_id, f_ptr) - END SUBROUTINE h5awrite_integer_1 - - - SUBROUTINE h5awrite_integer_2(attr_id, memtype_id, buf, dims, hdferr) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - INTEGER, INTENT(IN) , & - DIMENSION(dims(1),dims(2)), TARGET :: buf - ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - TYPE(C_PTR) :: f_ptr - - f_ptr = C_LOC(buf(1,1)) - - hdferr = h5awrite_f_c(attr_id, memtype_id, f_ptr) - - END SUBROUTINE h5awrite_integer_2 - - SUBROUTINE h5awrite_integer_3(attr_id, memtype_id, buf, dims, hdferr) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - INTEGER, INTENT(IN), DIMENSION(dims(1),dims(2),dims(3)), TARGET :: buf ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - TYPE(C_PTR) :: f_ptr - - f_ptr = C_LOC(buf(1,1,1)) - - hdferr = h5awrite_f_c(attr_id, memtype_id, f_ptr) - - END SUBROUTINE h5awrite_integer_3 - - - SUBROUTINE h5awrite_integer_4(attr_id, memtype_id, buf, dims, hdferr) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims! Array to story buf dimension sizes - INTEGER, INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4)), TARGET :: buf ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - TYPE(C_PTR) :: f_ptr - - f_ptr = C_LOC(buf(1,1,1,1)) - - hdferr = h5awrite_f_c(attr_id, memtype_id, f_ptr) - - END SUBROUTINE h5awrite_integer_4 - - - SUBROUTINE h5awrite_integer_5(attr_id, memtype_id, buf, dims, hdferr) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - INTEGER, INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)), TARGET :: buf ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - TYPE(C_PTR) :: f_ptr - - f_ptr = C_LOC(buf(1,1,1,1,1)) - - hdferr = h5awrite_f_c(attr_id, memtype_id, f_ptr) - - END SUBROUTINE h5awrite_integer_5 - - - SUBROUTINE h5awrite_integer_6(attr_id, memtype_id, buf, dims, hdferr) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - INTEGER, INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)), TARGET :: buf ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - TYPE(C_PTR) :: f_ptr - - f_ptr = C_LOC(buf(1,1,1,1,1,1)) - - hdferr = h5awrite_f_c(attr_id, memtype_id, f_ptr) - END SUBROUTINE h5awrite_integer_6 - - - SUBROUTINE h5awrite_integer_7(attr_id, memtype_id, buf, dims, hdferr) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - INTEGER, INTENT(IN), DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)), & - TARGET :: buf ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - TYPE(C_PTR) :: f_ptr - - f_ptr = C_LOC(buf(1,1,1,1,1,1,1)) - - hdferr = h5awrite_f_c(attr_id, memtype_id, f_ptr) - - END SUBROUTINE h5awrite_integer_7 - - - SUBROUTINE h5awrite_real_scalar(attr_id, memtype_id, buf, dims, hdferr) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - REAL, INTENT(IN), TARGET :: buf ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - TYPE(C_PTR) :: f_ptr - - f_ptr = C_LOC(buf) - - hdferr = h5awrite_f_c(attr_id, memtype_id, f_ptr) - END SUBROUTINE h5awrite_real_scalar - - SUBROUTINE h5awrite_real_1(attr_id, memtype_id, buf, dims, hdferr) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - REAL, INTENT(IN), & - DIMENSION(dims(1)), TARGET :: buf ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - TYPE(C_PTR) :: f_ptr - - f_ptr = C_LOC(buf(1)) - - hdferr = h5awrite_f_c(attr_id, memtype_id, f_ptr) - - END SUBROUTINE h5awrite_real_1 - - - SUBROUTINE h5awrite_real_2(attr_id, memtype_id, buf, dims, hdferr) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - REAL, INTENT(IN), & - DIMENSION(dims(1),dims(2)), TARGET :: buf - ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - TYPE(C_PTR) :: f_ptr - - f_ptr = C_LOC(buf(1,1)) - - hdferr = h5awrite_f_c(attr_id, memtype_id, f_ptr) - - END SUBROUTINE h5awrite_real_2 - - - SUBROUTINE h5awrite_real_3(attr_id, memtype_id, buf, dims, hdferr) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - REAL, INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3)), TARGET :: buf - ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - TYPE(C_PTR) :: f_ptr - - f_ptr = C_LOC(buf(1,1,1)) - - hdferr = h5awrite_f_c(attr_id, memtype_id, f_ptr) - END SUBROUTINE h5awrite_real_3 - - - SUBROUTINE h5awrite_real_4(attr_id, memtype_id, buf, dims, hdferr) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - REAL, INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4)), TARGET :: buf - ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - TYPE(C_PTR) :: f_ptr - - f_ptr = C_LOC(buf(1,1,1,1)) - - hdferr = h5awrite_f_c(attr_id, memtype_id, f_ptr) - END SUBROUTINE h5awrite_real_4 - - - SUBROUTINE h5awrite_real_5(attr_id, memtype_id, buf, dims, hdferr) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - REAL, INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)), TARGET :: buf - ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - TYPE(C_PTR) :: f_ptr - - f_ptr = C_LOC(buf) - - hdferr = h5awrite_f_c(attr_id, memtype_id, f_ptr) - END SUBROUTINE h5awrite_real_5 - - - SUBROUTINE h5awrite_real_6(attr_id, memtype_id, buf, dims, hdferr) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - REAL, INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)), TARGET :: buf - ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - TYPE(C_PTR) :: f_ptr - - f_ptr = C_LOC(buf(1,1,1,1,1,1)) - - hdferr = h5awrite_f_c(attr_id, memtype_id, f_ptr) - END SUBROUTINE h5awrite_real_6 - - - SUBROUTINE h5awrite_real_7(attr_id, memtype_id, buf, dims, hdferr) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - REAL, INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)), TARGET :: buf ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - TYPE(C_PTR) :: f_ptr - - f_ptr = C_LOC(buf(1,1,1,1,1,1,1)) - - hdferr = h5awrite_f_c(attr_id, memtype_id, f_ptr) - END SUBROUTINE h5awrite_real_7 - - SUBROUTINE h5awrite_char_scalar(attr_id, memtype_id, buf, dims, hdferr) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - CHARACTER(LEN=*), INTENT(IN) :: buf ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - - CALL h5awrite_char_scalar_fix(attr_id, memtype_id, buf, LEN(buf), dims, hdferr) - - END SUBROUTINE h5awrite_char_scalar - - SUBROUTINE h5awrite_char_scalar_fix(attr_id, memtype_id, buf, buf_len, dims, hdferr) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - INTEGER, INTENT(IN) :: buf_len - CHARACTER(LEN=buf_len), INTENT(IN), TARGET :: buf ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - TYPE(C_PTR) :: f_ptr - - f_ptr = C_LOC(buf(1:1)) - - hdferr = h5awrite_f_c(attr_id, memtype_id, f_ptr) - - END SUBROUTINE h5awrite_char_scalar_fix - - SUBROUTINE h5awrite_char_1(attr_id, memtype_id, buf, dims, hdferr) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - CHARACTER(LEN=*), INTENT(IN), DIMENSION(dims(1)), TARGET :: buf ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - TYPE(C_PTR) :: f_ptr - - f_ptr = C_LOC(buf(1)(1:1)) - - hdferr = h5awrite_f_c(attr_id, memtype_id, f_ptr) - - END SUBROUTINE h5awrite_char_1 - - SUBROUTINE h5awrite_char_2(attr_id, memtype_id, buf, dims, hdferr) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - CHARACTER(LEN=*), INTENT(IN), & - DIMENSION(dims(1),dims(2)), TARGET :: buf ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - TYPE(C_PTR) :: f_ptr - - f_ptr = C_LOC(buf(1,1)(1:1)) - hdferr = h5awrite_f_c(attr_id, memtype_id, f_ptr) - - END SUBROUTINE h5awrite_char_2 - - SUBROUTINE h5awrite_char_3(attr_id, memtype_id, buf, dims, hdferr) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - CHARACTER(LEN=*), INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3)), TARGET :: buf ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - TYPE(C_PTR) :: f_ptr - - f_ptr = C_LOC(buf(1,1,1)(1:1)) - - hdferr = h5awrite_f_c(attr_id, memtype_id, f_ptr) - - END SUBROUTINE h5awrite_char_3 - - SUBROUTINE h5awrite_char_4(attr_id, memtype_id, buf, dims, hdferr) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - CHARACTER(LEN=*), INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4)), TARGET :: buf ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - TYPE(C_PTR) :: f_ptr - - f_ptr = C_LOC(buf(1,1,1,1)(1:1)) - - hdferr = h5awrite_f_c(attr_id, memtype_id, f_ptr) - - END SUBROUTINE h5awrite_char_4 - - SUBROUTINE h5awrite_char_5(attr_id, memtype_id, buf, dims, hdferr) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - CHARACTER(LEN=*), INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)), TARGET :: buf ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - TYPE(C_PTR) :: f_ptr - - f_ptr = C_LOC(buf(1,1,1,1,1)(1:1)) - - hdferr = h5awrite_f_c(attr_id, memtype_id, f_ptr) - - END SUBROUTINE h5awrite_char_5 - - - SUBROUTINE h5awrite_char_6(attr_id, memtype_id, buf, dims, hdferr) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - CHARACTER(LEN=*), INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)), TARGET :: buf ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - TYPE(C_PTR) :: f_ptr - - f_ptr = C_LOC(buf(1,1,1,1,1,1)(1:1)) - - hdferr = h5awrite_f_c(attr_id, memtype_id, f_ptr) - - END SUBROUTINE h5awrite_char_6 - - SUBROUTINE h5awrite_char_7(attr_id, memtype_id, buf, dims, hdferr) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - CHARACTER(LEN=*), INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)), TARGET :: buf ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - TYPE(C_PTR) :: f_ptr - - f_ptr = C_LOC(buf(1,1,1,1,1,1,1)(1:1)) - hdferr = h5awrite_f_c(attr_id, memtype_id, f_ptr) - - END SUBROUTINE h5awrite_char_7 - -!****s* H5A (F03)/h5awrite_f_F03 -! -! NAME -! h5awrite_f_F03 -! -! PURPOSE -! Writes an attribute. -! -! Inputs: -! attr_id - Attribute identifier -! memtype_id - Attribute datatype identifier (in memory) -! buf - Data buffer; may be a scalar or an array -! -! Outputs: -! hdferr - Returns 0 if successful and -1 if fails -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces are added for -! called C functions (it is needed for Windows -! port). February 27, 2001 -! -! NOTES -! This function is overloaded to write INTEGER, -! REAL, DOUBLE PRECISION and CHARACTER buffers -! up to 7 dimensions. -! -! Fortran2003 Interface: -!! SUBROUTINE h5awrite_f(attr_id, memtype_id, buf, hdferr) -!! INTEGER(HID_T) , INTENT(IN) :: attr_id -!! INTEGER(HID_T) , INTENT(IN) :: memtype_id -!! TYPE(C_PTR) , INTENT(IN) :: buf -!! INTEGER , INTENT(OUT) :: hdferr -!***** - - SUBROUTINE h5awrite_ptr(attr_id, mem_type_id, buf, hdferr) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - TYPE(C_PTR), INTENT(IN), TARGET :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - - hdferr = h5awrite_f_c(attr_id, mem_type_id, buf) - - END SUBROUTINE h5awrite_ptr - -!****s* H5A (F03)/h5aread_f_F90 -! -! NAME -! h5aread_f_F90 -! -! PURPOSE -! Reads an attribute. -! -! Inputs: -! attr_id - Attribute identifier -! memtype_id - Attribute datatype identifier (in memory) -! dims - Array to hold corresponding dimension sizes of data buffer buf; -! dim(k) has value of the k-th dimension of buffer buf; -! values are ignored if buf is a scalar -! -! Outputs: -! buf - Data buffer; may be a scalar or an array -! hdferr - Returns 0 if successful and -1 if fails -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces are added for -! called C functions (it is needed for Windows -! port). February 27, 2001 -! -! dims parameter was added to make code portable; -! Aprile 4, 2001 -! -! Changed buf intent to INOUT to be consistant -! with how the C functions handles it. The pg -! compiler will return 0 if a buf value is not set. -! February, 2008 -! -! NOTES -! This function is overloaded to write INTEGER, -! REAL, DOUBLE PRECISION and CHARACTER buffers -! up to 7 dimensions. -! Fortran90 Interface: -!! SUBROUTINE h5aread_f(attr_id, memtype_id, buf, dims, hdferr) -!! INTEGER(HID_T) , INTENT(IN) :: attr_id -!! INTEGER(HID_T) , INTENT(IN) :: memtype_id -!! TYPE , INTENT(INOUT) :: buf -!! INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims -!! INTEGER , INTENT(OUT) :: hdferr -!***** - SUBROUTINE h5aread_integer_scalar(attr_id, memtype_id, buf, dims, hdferr) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - INTEGER, INTENT(INOUT), TARGET :: buf ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - TYPE(C_PTR) :: f_ptr - - f_ptr = C_LOC(buf) - - hdferr = h5aread_f_c(attr_id, memtype_id, f_ptr) - END SUBROUTINE h5aread_integer_scalar - - SUBROUTINE h5aread_integer_1(attr_id, memtype_id, buf, dims, hdferr) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - INTEGER, INTENT(INOUT), DIMENSION(dims(1)), TARGET :: buf ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - TYPE(C_PTR) :: f_ptr - - f_ptr = C_LOC(buf(1)) - - hdferr = h5aread_f_c(attr_id, memtype_id, f_ptr) - END SUBROUTINE h5aread_integer_1 - - - SUBROUTINE h5aread_integer_2(attr_id, memtype_id, buf, dims, hdferr) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - INTEGER, INTENT(INOUT),DIMENSION(dims(1),dims(2)), TARGET :: buf ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - TYPE(C_PTR) :: f_ptr - - f_ptr = C_LOC(buf(1,1)) - - hdferr = h5aread_f_c(attr_id, memtype_id, f_ptr) - END SUBROUTINE h5aread_integer_2 - - - SUBROUTINE h5aread_integer_3(attr_id, memtype_id, buf, dims, hdferr) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - INTEGER, INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3)), TARGET :: buf ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - TYPE(C_PTR) :: f_ptr - - f_ptr = C_LOC(buf(1,1,1)) - - hdferr = h5aread_f_c(attr_id, memtype_id, f_ptr) - END SUBROUTINE h5aread_integer_3 - - - SUBROUTINE h5aread_integer_4(attr_id, memtype_id, buf, dims, hdferr) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - INTEGER, INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4)), TARGET :: buf ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - TYPE(C_PTR) :: f_ptr - - f_ptr = C_LOC(buf(1,1,1,1)) - - hdferr = h5aread_f_c(attr_id, memtype_id, f_ptr) - END SUBROUTINE h5aread_integer_4 - - - SUBROUTINE h5aread_integer_5(attr_id, memtype_id, buf, dims, hdferr) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - INTEGER, INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)), TARGET :: buf ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - TYPE(C_PTR) :: f_ptr - - f_ptr = C_LOC(buf(1,1,1,1,1)) - - hdferr = h5aread_f_c(attr_id, memtype_id, f_ptr) - END SUBROUTINE h5aread_integer_5 - - - SUBROUTINE h5aread_integer_6(attr_id, memtype_id, buf, dims, hdferr) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - INTEGER, INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)), TARGET :: buf ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - TYPE(C_PTR) :: f_ptr - - f_ptr = C_LOC(buf(1,1,1,1,1,1)) - - hdferr = h5aread_f_c(attr_id, memtype_id, f_ptr) - END SUBROUTINE h5aread_integer_6 - - - SUBROUTINE h5aread_integer_7(attr_id, memtype_id, buf, dims, hdferr) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - INTEGER, INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)), TARGET :: buf ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - TYPE(C_PTR) :: f_ptr - - f_ptr = C_LOC(buf(1,1,1,1,1,1,1)) - - hdferr = h5aread_f_c(attr_id, memtype_id, f_ptr) - END SUBROUTINE h5aread_integer_7 - - - SUBROUTINE h5aread_real_scalar(attr_id, memtype_id, buf, dims, hdferr) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - REAL, INTENT(INOUT), TARGET :: buf ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - TYPE(C_PTR) :: f_ptr - - f_ptr = C_LOC(buf) - - hdferr = h5aread_f_c(attr_id, memtype_id, f_ptr) - END SUBROUTINE h5aread_real_scalar - - SUBROUTINE h5aread_real_1(attr_id, memtype_id, buf, dims, hdferr) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - REAL, INTENT(INOUT), & - DIMENSION(dims(1)), TARGET :: buf ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - TYPE(C_PTR) :: f_ptr - - f_ptr = C_LOC(buf(1)) - - hdferr = h5aread_f_c(attr_id, memtype_id, f_ptr) - END SUBROUTINE h5aread_real_1 - - - SUBROUTINE h5aread_real_2(attr_id, memtype_id, buf, dims, hdferr) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - REAL, INTENT(INOUT), & - DIMENSION(dims(1),dims(2)), TARGET :: buf ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - TYPE(C_PTR) :: f_ptr - - f_ptr = C_LOC(buf(1,1)) - - hdferr = h5aread_f_c(attr_id, memtype_id, f_ptr) - END SUBROUTINE h5aread_real_2 - - - SUBROUTINE h5aread_real_3(attr_id, memtype_id, buf, dims, hdferr) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - REAL, INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3)), TARGET :: buf - ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - TYPE(C_PTR) :: f_ptr - - f_ptr = C_LOC(buf(1,1,1)) - - hdferr = h5aread_f_c(attr_id, memtype_id, f_ptr) - END SUBROUTINE h5aread_real_3 - - - SUBROUTINE h5aread_real_4(attr_id, memtype_id, buf, dims, hdferr) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - REAL, INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4)), TARGET :: buf ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - TYPE(C_PTR) :: f_ptr - - f_ptr = C_LOC(buf(1,1,1,1)) - - hdferr = h5aread_f_c(attr_id, memtype_id, f_ptr) - END SUBROUTINE h5aread_real_4 - - - SUBROUTINE h5aread_real_5(attr_id, memtype_id, buf, dims, hdferr) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - REAL, INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)), TARGET :: buf ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - TYPE(C_PTR) :: f_ptr - - f_ptr = C_LOC(buf(1,1,1,1,1)) - - hdferr = h5aread_f_c(attr_id, memtype_id, f_ptr) - END SUBROUTINE h5aread_real_5 - - - SUBROUTINE h5aread_real_6(attr_id, memtype_id, buf, dims, hdferr) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - REAL, INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)), TARGET :: buf ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - TYPE(C_PTR) :: f_ptr - - f_ptr = C_LOC(buf(1,1,1,1,1,1)) - - hdferr = h5aread_f_c(attr_id, memtype_id, f_ptr) - END SUBROUTINE h5aread_real_6 - - - SUBROUTINE h5aread_real_7(attr_id, memtype_id, buf, dims, hdferr) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - REAL, INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)), TARGET :: buf ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - TYPE(C_PTR) :: f_ptr - - f_ptr = C_LOC(buf(1,1,1,1,1,1,1)) - - hdferr = h5aread_f_c(attr_id, memtype_id, f_ptr) - END SUBROUTINE h5aread_real_7 - - SUBROUTINE h5aread_char_scalar(attr_id, memtype_id, buf, dims, hdferr) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - CHARACTER(LEN=*), INTENT(INOUT) :: buf ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - - CALL h5aread_char_scalar_fix(attr_id, memtype_id, buf, LEN(buf), hdferr) - - END SUBROUTINE h5aread_char_scalar - - SUBROUTINE h5aread_char_scalar_fix(attr_id, memtype_id, buf, buf_len, hdferr) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER, INTENT(IN) :: buf_len - CHARACTER(LEN=buf_len), INTENT(INOUT), TARGET :: buf ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - TYPE(C_PTR) :: f_ptr - - f_ptr = C_LOC(buf(1:1)) - - hdferr = h5aread_f_c(attr_id, memtype_id, f_ptr) - - END SUBROUTINE h5aread_char_scalar_fix - - SUBROUTINE h5aread_char_1(attr_id, memtype_id, buf, dims, hdferr) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - CHARACTER(LEN=*), INTENT(INOUT), & - DIMENSION(dims(1)), TARGET :: buf ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - TYPE(C_PTR) :: f_ptr - - f_ptr = C_LOC(buf(1)(1:1)) - hdferr = h5aread_f_c(attr_id, memtype_id, f_ptr) - - END SUBROUTINE h5aread_char_1 - - - SUBROUTINE h5aread_char_2(attr_id, memtype_id, buf, dims, hdferr) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - CHARACTER(LEN=*), INTENT(INOUT), & - DIMENSION(dims(1),dims(2)), TARGET :: buf ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - TYPE(C_PTR) :: f_ptr - - f_ptr = C_LOC(buf(1,1)(1:1)) - hdferr = h5aread_f_c(attr_id, memtype_id, f_ptr) - - END SUBROUTINE h5aread_char_2 - - - SUBROUTINE h5aread_char_3(attr_id, memtype_id, buf, dims, hdferr) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - CHARACTER(LEN=*), INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3)), TARGET :: buf ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - TYPE(C_PTR) :: f_ptr - - f_ptr = C_LOC(buf(1,1,1)(1:1)) - hdferr = h5aread_f_c(attr_id, memtype_id, f_ptr) - - END SUBROUTINE h5aread_char_3 - - SUBROUTINE h5aread_char_4(attr_id, memtype_id, buf, dims, hdferr) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - CHARACTER(LEN=*), INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4)), TARGET :: buf ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - TYPE(C_PTR) :: f_ptr - - f_ptr = C_LOC(buf(1,1,1,1)(1:1)) - - hdferr = h5aread_f_c(attr_id, memtype_id, f_ptr) - - END SUBROUTINE h5aread_char_4 - - SUBROUTINE h5aread_char_5(attr_id, memtype_id, buf, dims, hdferr) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - CHARACTER(LEN=*), INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)), TARGET :: buf ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - TYPE(C_PTR) :: f_ptr - - f_ptr = C_LOC(buf(1,1,1,1,1)(1:1)) - hdferr = h5aread_f_c(attr_id, memtype_id, f_ptr) - - END SUBROUTINE h5aread_char_5 - - - SUBROUTINE h5aread_char_6(attr_id, memtype_id, buf, dims, hdferr) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - CHARACTER(LEN=*), INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)), TARGET :: buf ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - TYPE(C_PTR) :: f_ptr - - f_ptr = C_LOC(buf(1,1,1,1,1,1)(1:1)) - hdferr = h5aread_f_c(attr_id, memtype_id, f_ptr) - - END SUBROUTINE h5aread_char_6 - - - SUBROUTINE h5aread_char_7(attr_id, memtype_id, buf, dims, hdferr) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - CHARACTER(LEN=*), INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)), TARGET :: buf ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - TYPE(C_PTR) :: f_ptr - - f_ptr = C_LOC(buf(1,1,1,1,1,1,1)(1:1)) - hdferr = h5aread_f_c(attr_id, memtype_id, f_ptr) - - END SUBROUTINE h5aread_char_7 - - -!****s* H5A (F03)/h5aread_f_F03 -! -! NAME -! h5aread_f_F03 -! -! PURPOSE -! Reads an attribute. -! -! Inputs: -! attr_id - Attribute identifier -! memtype_id - Attribute datatype identifier (in memory) -! -! Outputs: -! buf - Data buffer; may be a scalar or an array -! hdferr - Returns 0 if successful and -1 if fails -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces are added for -! called C functions (it is needed for Windows -! port). February 27, 2001 -! -! dims parameter was added to make code portable; -! Aprile 4, 2001 -! -! Changed buf intent to INOUT to be consistant -! with how the C functions handles it. The pg -! compiler will return 0 if a buf value is not set. -! February, 2008 -! -! NOTES -! This function is overloaded to write INTEGER, -! REAL, DOUBLE PRECISION and CHARACTER buffers -! up to 7 dimensions. -! Fortran2003 Interface: -!! SUBROUTINE h5aread_f(attr_id, memtype_id, buf, hdferr) -!! INTEGER(HID_T) , INTENT(IN) :: attr_id -!! INTEGER(HID_T) , INTENT(IN) :: memtype_id -!! TYPE(C_PTR) , INTENT(INOUT) :: buf -!! INTEGER , INTENT(OUT) :: hdferr -!***** - - SUBROUTINE h5aread_ptr(attr_id, mem_type_id, buf, hdferr) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - TYPE(C_PTR), INTENT(INOUT), TARGET :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - - hdferr = h5aread_f_c(attr_id, mem_type_id, buf) - - END SUBROUTINE h5aread_ptr - -END MODULE H5A_PROVISIONAL - - diff --git a/fortran/src/H5Aff_F90.f90 b/fortran/src/H5Aff_F90.f90 deleted file mode 100644 index 974b023..0000000 --- a/fortran/src/H5Aff_F90.f90 +++ /dev/null @@ -1,1618 +0,0 @@ -!****h* ROBODoc/H5A (F90) -! -! NAME -! H5A_PROVISIONAL -! -! FILE -! fortran/src/H5Aff_F90.f90 -! -! PURPOSE -! -! This file contains Fortran 90 interfaces for H5A functions. It contains -! the same functions as H5Aff_F03.f90 but excludes the Fortran 2003 functions -! and the interface listings. This file will be compiled instead of H5Aff_F03.f90 -! if Fortran 2003 functions are not enabled. -! -! -! 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. * -! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -! -! NOTES -! *** IMPORTANT *** -! If you add a new H5A function you must add the function name to the -! Windows dll file 'hdf5_fortrandll.def.in' in the fortran/src directory. -! This is needed for Windows based operating systems. -! -!***** - -MODULE H5A_PROVISIONAL - - USE H5GLOBAL - ! - !On Windows there are no big (integer*8) integers, so overloading - !for bug #670 does not work. I have to use DEC compilation directives to make - !Windows DEC Visual Fortran and OSF compilers happy and do right things. - ! 05/01/02 EP - ! - INTERFACE h5awrite_f - - MODULE PROCEDURE h5awrite_integer_scalar - MODULE PROCEDURE h5awrite_integer_1 - MODULE PROCEDURE h5awrite_integer_2 - MODULE PROCEDURE h5awrite_integer_3 - MODULE PROCEDURE h5awrite_integer_4 - MODULE PROCEDURE h5awrite_integer_5 - MODULE PROCEDURE h5awrite_integer_6 - MODULE PROCEDURE h5awrite_integer_7 - MODULE PROCEDURE h5awrite_char_scalar - MODULE PROCEDURE h5awrite_char_1 - MODULE PROCEDURE h5awrite_char_2 - MODULE PROCEDURE h5awrite_char_3 - MODULE PROCEDURE h5awrite_char_4 - MODULE PROCEDURE h5awrite_char_5 - MODULE PROCEDURE h5awrite_char_6 - MODULE PROCEDURE h5awrite_char_7 - MODULE PROCEDURE h5awrite_real_scalar - MODULE PROCEDURE h5awrite_real_1 - MODULE PROCEDURE h5awrite_real_2 - MODULE PROCEDURE h5awrite_real_3 - MODULE PROCEDURE h5awrite_real_4 - MODULE PROCEDURE h5awrite_real_5 - MODULE PROCEDURE h5awrite_real_6 - MODULE PROCEDURE h5awrite_real_7 - - END INTERFACE - - INTERFACE h5aread_f - - MODULE PROCEDURE h5aread_integer_scalar - MODULE PROCEDURE h5aread_integer_1 - MODULE PROCEDURE h5aread_integer_2 - MODULE PROCEDURE h5aread_integer_3 - MODULE PROCEDURE h5aread_integer_4 - MODULE PROCEDURE h5aread_integer_5 - MODULE PROCEDURE h5aread_integer_6 - MODULE PROCEDURE h5aread_integer_7 - MODULE PROCEDURE h5aread_char_scalar - MODULE PROCEDURE h5aread_char_1 - MODULE PROCEDURE h5aread_char_2 - MODULE PROCEDURE h5aread_char_3 - MODULE PROCEDURE h5aread_char_4 - MODULE PROCEDURE h5aread_char_5 - MODULE PROCEDURE h5aread_char_6 - MODULE PROCEDURE h5aread_char_7 - MODULE PROCEDURE h5aread_real_scalar - MODULE PROCEDURE h5aread_real_1 - MODULE PROCEDURE h5aread_real_2 - MODULE PROCEDURE h5aread_real_3 - MODULE PROCEDURE h5aread_real_4 - MODULE PROCEDURE h5aread_real_5 - MODULE PROCEDURE h5aread_real_6 - MODULE PROCEDURE h5aread_real_7 - END INTERFACE - -CONTAINS - - SUBROUTINE h5awrite_integer_scalar(attr_id, memtype_id, buf, dims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - INTEGER, INTENT(IN) :: buf ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - - INTERFACE - INTEGER FUNCTION h5awrite_integer_s_c(attr_id, memtype_id, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AWRITE_INTEGER_S_C'::h5awrite_integer_s_c - !DEC$ENDIF - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - INTEGER(HID_T), INTENT(IN) :: attr_id - INTEGER(HID_T), INTENT(IN) :: memtype_id - INTEGER, INTENT(IN)::buf - END FUNCTION h5awrite_integer_s_c - END INTERFACE - - hdferr = h5awrite_integer_s_c(attr_id, memtype_id, buf, dims) - END SUBROUTINE h5awrite_integer_scalar - - SUBROUTINE h5awrite_integer_1(attr_id, memtype_id, buf, dims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - INTEGER, INTENT(IN) , & - DIMENSION(dims(1)) :: buf ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! INTEGER, EXTERNAL :: h5awrite_integer_1_c - ! MS FORTRAN needs explicit interface for C functions called here. - ! - INTERFACE - INTEGER FUNCTION h5awrite_integer_1_c(attr_id, memtype_id, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AWRITE_INTEGER_1_C'::h5awrite_integer_1_c - !DEC$ENDIF - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - INTEGER(HID_T), INTENT(IN) :: attr_id - INTEGER(HID_T), INTENT(IN) :: memtype_id - INTEGER, INTENT(IN), DIMENSION(dims(1)) :: buf - END FUNCTION h5awrite_integer_1_c - END INTERFACE - - hdferr = h5awrite_integer_1_c(attr_id, memtype_id, buf, dims) - - END SUBROUTINE h5awrite_integer_1 - - - SUBROUTINE h5awrite_integer_2(attr_id, memtype_id, buf, dims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - INTEGER, INTENT(IN) , & - DIMENSION(dims(1),dims(2)) :: buf ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - - ! INTEGER, EXTERNAL :: h5awrite_integer_2_c - ! MS FORTRAN needs explicit interface for C functions called here. - ! - INTERFACE - INTEGER FUNCTION h5awrite_integer_2_c(attr_id, memtype_id, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AWRITE_INTEGER_2_C'::h5awrite_integer_2_c - !DEC$ENDIF - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - INTEGER(HID_T), INTENT(IN) :: attr_id - INTEGER(HID_T), INTENT(IN) :: memtype_id - INTEGER, INTENT(IN), DIMENSION(dims(1),dims(2)) :: buf - END FUNCTION h5awrite_integer_2_c - END INTERFACE - - hdferr = h5awrite_integer_2_c(attr_id, memtype_id, buf, dims) - END SUBROUTINE h5awrite_integer_2 - - - SUBROUTINE h5awrite_integer_3(attr_id, memtype_id, buf, dims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - INTEGER, INTENT(IN), DIMENSION(dims(1),dims(2),dims(3)) :: buf ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - - ! INTEGER, EXTERNAL :: h5awrite_integer_3_c - ! MS FORTRAN needs explicit interface for C functions called here. - ! - INTERFACE - INTEGER FUNCTION h5awrite_integer_3_c(attr_id, memtype_id, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AWRITE_INTEGER_3_C'::h5awrite_integer_3_c - !DEC$ENDIF - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - INTEGER(HID_T), INTENT(IN) :: attr_id - INTEGER(HID_T), INTENT(IN) :: memtype_id - INTEGER, INTENT(IN), DIMENSION(dims(1),dims(2),dims(3)) :: buf - END FUNCTION h5awrite_integer_3_c - END INTERFACE - - hdferr = h5awrite_integer_3_c(attr_id, memtype_id, buf, dims) - END SUBROUTINE h5awrite_integer_3 - - - SUBROUTINE h5awrite_integer_4(attr_id, memtype_id, buf, dims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - INTEGER, INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4)) :: buf ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - - ! INTEGER, EXTERNAL :: h5awrite_integer_4_c - ! MS FORTRAN needs explicit interface for C functions called here. - ! - INTERFACE - INTEGER FUNCTION h5awrite_integer_4_c(attr_id, memtype_id, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AWRITE_INTEGER_4_C'::h5awrite_integer_4_c - !DEC$ENDIF - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - INTEGER(HID_T), INTENT(IN) :: attr_id - INTEGER(HID_T), INTENT(IN) :: memtype_id - INTEGER, INTENT(IN), DIMENSION(dims(1),dims(2),dims(3),dims(4)) :: buf - END FUNCTION h5awrite_integer_4_c - END INTERFACE - - hdferr = h5awrite_integer_4_c(attr_id, memtype_id, buf, dims) - END SUBROUTINE h5awrite_integer_4 - - - SUBROUTINE h5awrite_integer_5(attr_id, memtype_id, buf, dims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - INTEGER, INTENT(IN), DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) :: buf ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - - ! INTEGER, EXTERNAL :: h5awrite_integer_5_c - ! MS FORTRAN needs explicit interface for C functions called here. - ! - INTERFACE - INTEGER FUNCTION h5awrite_integer_5_c(attr_id, memtype_id, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AWRITE_INTEGER_5_C'::h5awrite_integer_5_c - !DEC$ENDIF - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - INTEGER(HID_T), INTENT(IN) :: attr_id - INTEGER(HID_T), INTENT(IN) :: memtype_id - INTEGER, INTENT(IN), DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) :: buf - END FUNCTION h5awrite_integer_5_c - END INTERFACE - - hdferr = h5awrite_integer_5_c(attr_id, memtype_id, buf, dims) - END SUBROUTINE h5awrite_integer_5 - - - SUBROUTINE h5awrite_integer_6(attr_id, memtype_id, buf, dims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - INTEGER, INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)) :: buf ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - - ! INTEGER, EXTERNAL :: h5awrite_integer_6_c - ! MS FORTRAN needs explicit interface for C functions called here. - ! - INTERFACE - INTEGER FUNCTION h5awrite_integer_6_c(attr_id, memtype_id, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AWRITE_INTEGER_6_C'::h5awrite_integer_6_c - !DEC$ENDIF - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - INTEGER(HID_T), INTENT(IN) :: attr_id - INTEGER(HID_T), INTENT(IN) :: memtype_id - INTEGER, INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)) :: buf - END FUNCTION h5awrite_integer_6_c - END INTERFACE - - hdferr = h5awrite_integer_6_c(attr_id, memtype_id, buf, dims) - END SUBROUTINE h5awrite_integer_6 - - - SUBROUTINE h5awrite_integer_7(attr_id, memtype_id, buf, dims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - INTEGER, INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)) :: buf ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - - ! INTEGER, EXTERNAL :: h5awrite_integer_7_c - ! MS FORTRAN needs explicit interface for C functions called here. - ! - INTERFACE - INTEGER FUNCTION h5awrite_integer_7_c(attr_id, memtype_id, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AWRITE_INTEGER_7_C'::h5awrite_integer_7_c - !DEC$ENDIF - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - INTEGER(HID_T), INTENT(IN) :: attr_id - INTEGER(HID_T), INTENT(IN) :: memtype_id - INTEGER, INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)) :: buf - END FUNCTION h5awrite_integer_7_c - END INTERFACE - - hdferr = h5awrite_integer_7_c(attr_id, memtype_id, buf, dims) - END SUBROUTINE h5awrite_integer_7 - - - SUBROUTINE h5awrite_real_scalar(attr_id, memtype_id, buf, dims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - REAL, INTENT(IN) :: buf ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - - ! INTEGER, EXTERNAL :: h5awrite_real_s_c - ! MS FORTRAN needs explicit interface for C functions called here. - ! - INTERFACE - INTEGER FUNCTION h5awrite_real_s_c(attr_id, memtype_id, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AWRITE_REAL_S_C'::h5awrite_real_s_c - !DEC$ENDIF - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - INTEGER(HID_T), INTENT(IN) :: attr_id - INTEGER(HID_T), INTENT(IN) :: memtype_id - REAL, INTENT(IN)::buf - END FUNCTION h5awrite_real_s_c - END INTERFACE - - hdferr = h5awrite_real_s_c(attr_id, memtype_id, buf, dims) - END SUBROUTINE h5awrite_real_scalar - - SUBROUTINE h5awrite_real_1(attr_id, memtype_id, buf, dims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - REAL, INTENT(IN), & - DIMENSION(dims(1)) :: buf ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - - ! INTEGER, EXTERNAL :: h5awrite_real_1_c - ! MS FORTRAN needs explicit interface for C functions called here. - ! - INTERFACE - INTEGER FUNCTION h5awrite_real_1_c(attr_id, memtype_id, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AWRITE_REAL_1_C'::h5awrite_real_1_c - !DEC$ENDIF - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - INTEGER(HID_T), INTENT(IN) :: attr_id - INTEGER(HID_T), INTENT(IN) :: memtype_id - REAL, INTENT(IN), & - DIMENSION(dims(1)) :: buf - END FUNCTION h5awrite_real_1_c - END INTERFACE - - hdferr = h5awrite_real_1_c(attr_id, memtype_id, buf, dims) - END SUBROUTINE h5awrite_real_1 - - - SUBROUTINE h5awrite_real_2(attr_id, memtype_id, buf, dims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - REAL, INTENT(IN), & - DIMENSION(dims(1),dims(2)) :: buf ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - - ! INTEGER, EXTERNAL :: h5awrite_real_2_c - ! MS FORTRAN needs explicit interface for C functions called here. - ! - INTERFACE - INTEGER FUNCTION h5awrite_real_2_c(attr_id, memtype_id, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AWRITE_REAL_2_C'::h5awrite_real_2_c - !DEC$ENDIF - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - INTEGER(HID_T), INTENT(IN) :: attr_id - INTEGER(HID_T), INTENT(IN) :: memtype_id - REAL, INTENT(IN), & - DIMENSION(dims(1),dims(2)) :: buf - END FUNCTION h5awrite_real_2_c - END INTERFACE - - hdferr = h5awrite_real_2_c(attr_id, memtype_id, buf, dims) - END SUBROUTINE h5awrite_real_2 - - - SUBROUTINE h5awrite_real_3(attr_id, memtype_id, buf, dims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - REAL, INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3)) :: buf ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - - ! INTEGER, EXTERNAL :: h5awrite_real_3_c - ! MS FORTRAN needs explicit interface for C functions called here. - ! - INTERFACE - INTEGER FUNCTION h5awrite_real_3_c(attr_id, memtype_id, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AWRITE_REAL_3_C'::h5awrite_real_3_c - !DEC$ENDIF - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - INTEGER(HID_T), INTENT(IN) :: attr_id - INTEGER(HID_T), INTENT(IN) :: memtype_id - REAL, INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3)) :: buf - END FUNCTION h5awrite_real_3_c - END INTERFACE - - hdferr = h5awrite_real_3_c(attr_id, memtype_id, buf, dims) - END SUBROUTINE h5awrite_real_3 - - - SUBROUTINE h5awrite_real_4(attr_id, memtype_id, buf, dims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - REAL, INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4)) :: buf ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - - ! INTEGER, EXTERNAL :: h5awrite_real_4_c - ! MS FORTRAN needs explicit interface for C functions called here. - ! - INTERFACE - INTEGER FUNCTION h5awrite_real_4_c(attr_id, memtype_id, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AWRITE_REAL_4_C'::h5awrite_real_4_c - !DEC$ENDIF - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - INTEGER(HID_T), INTENT(IN) :: attr_id - INTEGER(HID_T), INTENT(IN) :: memtype_id - REAL, INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4)) :: buf - END FUNCTION h5awrite_real_4_c - END INTERFACE - - hdferr = h5awrite_real_4_c(attr_id, memtype_id, buf, dims) - END SUBROUTINE h5awrite_real_4 - - - SUBROUTINE h5awrite_real_5(attr_id, memtype_id, buf, dims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - REAL, INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) :: buf ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - - ! INTEGER, EXTERNAL :: h5awrite_real_5_c - ! MS FORTRAN needs explicit interface for C functions called here. - ! - INTERFACE - INTEGER FUNCTION h5awrite_real_5_c(attr_id, memtype_id, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AWRITE_REAL_5_C'::h5awrite_real_5_c - !DEC$ENDIF - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - INTEGER(HID_T), INTENT(IN) :: attr_id - INTEGER(HID_T), INTENT(IN) :: memtype_id - REAL, INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) :: buf - END FUNCTION h5awrite_real_5_c - END INTERFACE - - hdferr = h5awrite_real_5_c(attr_id, memtype_id, buf, dims) - END SUBROUTINE h5awrite_real_5 - - - SUBROUTINE h5awrite_real_6(attr_id, memtype_id, buf, dims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - REAL, INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)) :: buf ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - - ! INTEGER, EXTERNAL :: h5awrite_real_6_c - ! MS FORTRAN needs explicit interface for C functions called here. - ! - INTERFACE - INTEGER FUNCTION h5awrite_real_6_c(attr_id, memtype_id, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AWRITE_REAL_6_C'::h5awrite_real_6_c - !DEC$ENDIF - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - INTEGER(HID_T), INTENT(IN) :: attr_id - INTEGER(HID_T), INTENT(IN) :: memtype_id - REAL, INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)) :: buf - END FUNCTION h5awrite_real_6_c - END INTERFACE - - hdferr = h5awrite_real_6_c(attr_id, memtype_id, buf, dims) - END SUBROUTINE h5awrite_real_6 - - - SUBROUTINE h5awrite_real_7(attr_id, memtype_id, buf, dims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - REAL, INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)) :: buf ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - - ! INTEGER, EXTERNAL :: h5awrite_real_7_c - ! MS FORTRAN needs explicit interface for C functions called here. - ! - INTERFACE - INTEGER FUNCTION h5awrite_real_7_c(attr_id, memtype_id, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AWRITE_REAL_7_C'::h5awrite_real_7_c - !DEC$ENDIF - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - INTEGER(HID_T), INTENT(IN) :: attr_id - INTEGER(HID_T), INTENT(IN) :: memtype_id - REAL, INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)) :: buf - END FUNCTION h5awrite_real_7_c - END INTERFACE - - hdferr = h5awrite_real_7_c(attr_id, memtype_id, buf, dims) - END SUBROUTINE h5awrite_real_7 - - SUBROUTINE h5awrite_char_scalar(attr_id, memtype_id, buf, dims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - CHARACTER(LEN=*),INTENT(IN) :: buf - ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! INTEGER, EXTERNAL :: h5awritec_s_c - ! MS FORTRAN needs explicit interface for C functions called here. - ! - INTERFACE - INTEGER FUNCTION h5awritec_s_c(attr_id, memtype_id, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AWRITEC_S_C'::h5awritec_s_c - !DEC$ENDIF - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - !DEC$ATTRIBUTES reference :: buf - INTEGER(HID_T), INTENT(IN) :: attr_id - INTEGER(HID_T), INTENT(IN) :: memtype_id - CHARACTER(LEN=*), INTENT(IN)::buf - END FUNCTION h5awritec_s_c - END INTERFACE - - hdferr = h5awritec_s_c(attr_id, memtype_id, buf, dims) - END SUBROUTINE h5awrite_char_scalar - - SUBROUTINE h5awrite_char_1(attr_id, memtype_id, buf, dims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - CHARACTER(LEN=*), INTENT(IN), & - DIMENSION(dims(1)) :: buf ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! INTEGER, EXTERNAL :: h5awritec_1_c - ! MS FORTRAN needs explicit interface for C functions called here. - ! - INTERFACE - INTEGER FUNCTION h5awritec_1_c(attr_id, memtype_id, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AWRITEC_1_C'::h5awritec_1_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: buf - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - INTEGER(HID_T), INTENT(IN) :: attr_id - INTEGER(HID_T), INTENT(IN) :: memtype_id - CHARACTER(LEN=*), INTENT(IN), DIMENSION(dims(1))::buf - END FUNCTION h5awritec_1_c - END INTERFACE - - hdferr = h5awritec_1_c(attr_id, memtype_id, buf, dims) - END SUBROUTINE h5awrite_char_1 - - - SUBROUTINE h5awrite_char_2(attr_id, memtype_id, buf, dims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - CHARACTER(LEN=*), INTENT(IN), & - DIMENSION(dims(1),dims(2)) :: buf ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - - ! INTEGER, EXTERNAL :: h5awritec_2_c - ! MS FORTRAN needs explicit interface for C functions called here. - ! - INTERFACE - INTEGER FUNCTION h5awritec_2_c(attr_id, memtype_id, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AWRITEC_2_C'::h5awritec_2_c - !DEC$ENDIF - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - !DEC$ATTRIBUTES reference :: buf - INTEGER(HID_T), INTENT(IN) :: attr_id - INTEGER(HID_T), INTENT(IN) :: memtype_id - CHARACTER(LEN=*), INTENT(IN), & - DIMENSION(dims(1),dims(2)) :: buf - END FUNCTION h5awritec_2_c - END INTERFACE - - hdferr = h5awritec_2_c(attr_id, memtype_id, buf, dims) - END SUBROUTINE h5awrite_char_2 - - - SUBROUTINE h5awrite_char_3(attr_id, memtype_id, buf, dims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - CHARACTER(LEN=*), INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3)) :: buf ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! INTEGER, EXTERNAL :: h5awritec_3_c - ! MS FORTRAN needs explicit interface for C functions called here. - ! - INTERFACE - INTEGER FUNCTION h5awritec_3_c(attr_id, memtype_id, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AWRITEC_3_C'::h5awritec_3_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: buf - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - INTEGER(HID_T), INTENT(IN) :: attr_id - INTEGER(HID_T), INTENT(IN) :: memtype_id - CHARACTER(LEN=*), INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3)) :: buf - END FUNCTION h5awritec_3_c - END INTERFACE - - hdferr = h5awritec_3_c(attr_id, memtype_id, buf, dims) - END SUBROUTINE h5awrite_char_3 - - - SUBROUTINE h5awrite_char_4(attr_id, memtype_id, buf, dims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - CHARACTER(LEN=*), INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4)) :: buf ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! INTEGER, EXTERNAL :: h5awritec_4_c - ! MS FORTRAN needs explicit interface for C functions called here. - ! - INTERFACE - INTEGER FUNCTION h5awritec_4_c(attr_id, memtype_id, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AWRITEC_4_C'::h5awritec_4_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: buf - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - INTEGER(HID_T), INTENT(IN) :: attr_id - INTEGER(HID_T), INTENT(IN) :: memtype_id - CHARACTER(LEN=*), INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4)) :: buf - END FUNCTION h5awritec_4_c - END INTERFACE - - hdferr = h5awritec_4_c(attr_id, memtype_id, buf, dims) - END SUBROUTINE h5awrite_char_4 - - - SUBROUTINE h5awrite_char_5(attr_id, memtype_id, buf, dims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - CHARACTER(LEN=*), INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) :: buf ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! INTEGER, EXTERNAL :: h5awritec_5_c - ! MS FORTRAN needs explicit interface for C functions called here. - ! - INTERFACE - INTEGER FUNCTION h5awritec_5_c(attr_id, memtype_id, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AWRITEC_5_C'::h5awritec_5_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: buf - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - INTEGER(HID_T), INTENT(IN) :: attr_id - INTEGER(HID_T), INTENT(IN) :: memtype_id - CHARACTER(LEN=*), INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) :: buf - END FUNCTION h5awritec_5_c - END INTERFACE - - hdferr = h5awritec_5_c(attr_id, memtype_id, buf, dims) - END SUBROUTINE h5awrite_char_5 - - - SUBROUTINE h5awrite_char_6(attr_id, memtype_id, buf, dims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - CHARACTER(LEN=*), INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)) :: buf ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! INTEGER, EXTERNAL :: h5awritec_6_c - ! MS FORTRAN needs explicit interface for C functions called here. - ! - INTERFACE - INTEGER FUNCTION h5awritec_6_c(attr_id, memtype_id, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AWRITEC_6_C'::h5awritec_6_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: buf - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - INTEGER(HID_T), INTENT(IN) :: attr_id - INTEGER(HID_T), INTENT(IN) :: memtype_id - CHARACTER(LEN=*), INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)) :: buf - END FUNCTION h5awritec_6_c - END INTERFACE - - hdferr = h5awritec_6_c(attr_id, memtype_id, buf, dims) - END SUBROUTINE h5awrite_char_6 - - - SUBROUTINE h5awrite_char_7(attr_id, memtype_id, buf, dims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - CHARACTER(LEN=*), INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)) :: buf ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! INTEGER, EXTERNAL :: h5awritec_7_c - ! MS FORTRAN needs explicit interface for C functions called here. - ! - INTERFACE - INTEGER FUNCTION h5awritec_7_c(attr_id, memtype_id, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AWRITEC_7_C'::h5awritec_7_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: buf - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - INTEGER(HID_T), INTENT(IN) :: attr_id - INTEGER(HID_T), INTENT(IN) :: memtype_id - CHARACTER(LEN=*), INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)) :: buf - END FUNCTION h5awritec_7_c - END INTERFACE - - hdferr = h5awritec_7_c(attr_id, memtype_id, buf, dims) - END SUBROUTINE h5awrite_char_7 - -! -! NAME -! h5aread_f -! -! PURPOSE -! Reads an attribute. -! -! INPUTS -! attr_id - attribute identifier -! memtype_id - attribute memory type identifier -! dims - 1D array of size 7, stores sizes of the -! - buf array dimensions. -! OUTPUTS -! buf - buffer to read attribute data in -! hdferr: - error code -! Success: 0 -! Failure: -1 -! OPTIONAL PARAMETERS -! NONE -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! -! Explicit Fortran interfaces are added for -! called C functions (it is needed for Windows -! port). February 27, 2001 -! -! dims parameter was added to make code portable; -! April 4, 2001 -! -! Changed buf intent to INOUT to be consistant -! with how the C functions handles it. The pg -! compiler will return 0 if a buf value is not set. -! February, 2008 -! -! NOTES -! This function is overloaded to write INTEGER, -! REAL, DOUBLE PRECISION and CHARACTER buffers -! up to 7 dimensions. -! - - SUBROUTINE h5aread_integer_scalar(attr_id, memtype_id, buf, dims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - INTEGER, INTENT(INOUT) :: buf ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - - ! INTEGER, EXTERNAL :: h5aread_integer_s_c - ! MS FORTRAN needs explicit interface for C functions called here. - ! - INTERFACE - INTEGER FUNCTION h5aread_integer_s_c(attr_id, memtype_id, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AREAD_INTEGER_S_C'::h5aread_integer_s_c - !DEC$ENDIF - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - INTEGER(HID_T), INTENT(IN) :: attr_id - INTEGER(HID_T), INTENT(IN) :: memtype_id - INTEGER, INTENT(INOUT)::buf - END FUNCTION h5aread_integer_s_c - END INTERFACE - hdferr = h5aread_integer_s_c(attr_id, memtype_id, buf, dims) - END SUBROUTINE h5aread_integer_scalar - - SUBROUTINE h5aread_integer_1(attr_id, memtype_id, buf, dims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - INTEGER, INTENT(INOUT), DIMENSION(dims(1)) :: buf ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - - ! INTEGER, EXTERNAL :: h5aread_integer_1_c - ! MS FORTRAN needs explicit interface for C functions called here. - ! - INTERFACE - INTEGER FUNCTION h5aread_integer_1_c(attr_id, memtype_id, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AREAD_INTEGER_1_C'::h5aread_integer_1_c - !DEC$ENDIF - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - INTEGER(HID_T), INTENT(IN) :: attr_id - INTEGER(HID_T), INTENT(IN) :: memtype_id - INTEGER, INTENT(INOUT), DIMENSION(dims(1)) :: buf - END FUNCTION h5aread_integer_1_c - END INTERFACE - - hdferr = h5aread_integer_1_c(attr_id, memtype_id, buf, dims) - END SUBROUTINE h5aread_integer_1 - - - SUBROUTINE h5aread_integer_2(attr_id, memtype_id, buf, dims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - INTEGER, INTENT(INOUT),DIMENSION(dims(1),dims(2)) :: buf ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - - ! INTEGER, EXTERNAL :: h5aread_integer_2_c - ! MS FORTRAN needs explicit interface for C functions called here. - ! - INTERFACE - INTEGER FUNCTION h5aread_integer_2_c(attr_id, memtype_id, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AREAD_INTEGER_2_C'::h5aread_integer_2_c - !DEC$ENDIF - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - INTEGER(HID_T), INTENT(IN) :: attr_id - INTEGER(HID_T), INTENT(IN) :: memtype_id - INTEGER, INTENT(INOUT), DIMENSION(dims(1),dims(2)) :: buf - END FUNCTION h5aread_integer_2_c - END INTERFACE - - hdferr = h5aread_integer_2_c(attr_id, memtype_id, buf, dims) - END SUBROUTINE h5aread_integer_2 - - - SUBROUTINE h5aread_integer_3(attr_id, memtype_id, buf, dims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - INTEGER, INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3)) :: buf ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - - ! INTEGER, EXTERNAL :: h5aread_integer_3_c - ! MS FORTRAN needs explicit interface for C functions called here. - ! - INTERFACE - INTEGER FUNCTION h5aread_integer_3_c(attr_id, memtype_id, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AREAD_INTEGER_3_C'::h5aread_integer_3_c - !DEC$ENDIF - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - INTEGER(HID_T), INTENT(IN) :: attr_id - INTEGER(HID_T), INTENT(IN) :: memtype_id - INTEGER, INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3)) :: buf - END FUNCTION h5aread_integer_3_c - END INTERFACE - - hdferr = h5aread_integer_3_c(attr_id, memtype_id, buf, dims) - END SUBROUTINE h5aread_integer_3 - - - SUBROUTINE h5aread_integer_4(attr_id, memtype_id, buf, dims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - INTEGER, INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4)) :: buf ! Attribute data - ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - - ! INTEGER, EXTERNAL :: h5aread_integer_4_c - ! MS FORTRAN needs explicit interface for C functions called here. - ! - INTERFACE - INTEGER FUNCTION h5aread_integer_4_c(attr_id, memtype_id, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AREAD_INTEGER_4_C'::h5aread_integer_4_c - !DEC$ENDIF - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - INTEGER(HID_T), INTENT(IN) :: attr_id - INTEGER(HID_T), INTENT(IN) :: memtype_id - INTEGER, INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4)) :: buf - END FUNCTION h5aread_integer_4_c - END INTERFACE - - hdferr = h5aread_integer_4_c(attr_id, memtype_id, buf, dims) - END SUBROUTINE h5aread_integer_4 - - - SUBROUTINE h5aread_integer_5(attr_id, memtype_id, buf, dims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - INTEGER, INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) :: buf ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - - ! INTEGER, EXTERNAL :: h5aread_integer_5_c - ! MS FORTRAN needs explicit interface for C functions called here. - ! - INTERFACE - INTEGER FUNCTION h5aread_integer_5_c(attr_id, memtype_id, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AREAD_INTEGER_5_C'::h5aread_integer_5_c - !DEC$ENDIF - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - INTEGER(HID_T), INTENT(IN) :: attr_id - INTEGER(HID_T), INTENT(IN) :: memtype_id - INTEGER, INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) :: buf - END FUNCTION h5aread_integer_5_c - END INTERFACE - - hdferr = h5aread_integer_5_c(attr_id, memtype_id, buf, dims) - END SUBROUTINE h5aread_integer_5 - - - SUBROUTINE h5aread_integer_6(attr_id, memtype_id, buf, dims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - INTEGER, INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)) :: buf ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - - ! INTEGER, EXTERNAL :: h5aread_integer_6_c - ! MS FORTRAN needs explicit interface for C functions called here. - ! - INTERFACE - INTEGER FUNCTION h5aread_integer_6_c(attr_id, memtype_id, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AREAD_INTEGER_6_C'::h5aread_integer_6_c - !DEC$ENDIF - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - INTEGER(HID_T), INTENT(IN) :: attr_id - INTEGER(HID_T), INTENT(IN) :: memtype_id - INTEGER, INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)) :: buf - END FUNCTION h5aread_integer_6_c - END INTERFACE - - hdferr = h5aread_integer_6_c(attr_id, memtype_id, buf, dims) - END SUBROUTINE h5aread_integer_6 - - - SUBROUTINE h5aread_integer_7(attr_id, memtype_id, buf, dims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - INTEGER, INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)) :: buf ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - - ! INTEGER, EXTERNAL :: h5aread_integer_7_c - ! MS FORTRAN needs explicit interface for C functions called here. - ! - INTERFACE - INTEGER FUNCTION h5aread_integer_7_c(attr_id, memtype_id, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AREAD_INTEGER_7_C'::h5aread_integer_7_c - !DEC$ENDIF - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - INTEGER(HID_T), INTENT(IN) :: attr_id - INTEGER(HID_T), INTENT(IN) :: memtype_id - INTEGER, INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)) :: buf - END FUNCTION h5aread_integer_7_c - END INTERFACE - - hdferr = h5aread_integer_7_c(attr_id, memtype_id, buf, dims) - END SUBROUTINE h5aread_integer_7 - - - SUBROUTINE h5aread_real_scalar(attr_id, memtype_id, buf, dims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - REAL, INTENT(INOUT) :: buf ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - - ! INTEGER, EXTERNAL :: h5aread_real_s_c - ! MS FORTRAN needs explicit interface for C functions called here. - ! - INTERFACE - INTEGER FUNCTION h5aread_real_s_c(attr_id, memtype_id, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AREAD_REAL_S_C'::h5aread_real_s_c - !DEC$ENDIF - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - INTEGER(HID_T), INTENT(IN) :: attr_id - INTEGER(HID_T), INTENT(IN) :: memtype_id - REAL, INTENT(INOUT)::buf - END FUNCTION h5aread_real_s_c - END INTERFACE - - hdferr = h5aread_real_s_c(attr_id, memtype_id, buf, dims) - END SUBROUTINE h5aread_real_scalar - - SUBROUTINE h5aread_real_1(attr_id, memtype_id, buf, dims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - REAL, INTENT(INOUT), & - DIMENSION(dims(1)) :: buf ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - - ! INTEGER, EXTERNAL :: h5aread_real_1_c - ! MS FORTRAN needs explicit interface for C functions called here. - ! - INTERFACE - INTEGER FUNCTION h5aread_real_1_c(attr_id, memtype_id, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AREAD_REAL_1_C'::h5aread_real_1_c - !DEC$ENDIF - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - INTEGER(HID_T), INTENT(IN) :: attr_id - INTEGER(HID_T), INTENT(IN) :: memtype_id - REAL, INTENT(INOUT), & - DIMENSION(dims(1)) :: buf - END FUNCTION h5aread_real_1_c - END INTERFACE - - hdferr = h5aread_real_1_c(attr_id, memtype_id, buf, dims) - END SUBROUTINE h5aread_real_1 - - - SUBROUTINE h5aread_real_2(attr_id, memtype_id, buf, dims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - REAL, INTENT(INOUT), & - DIMENSION(dims(1),dims(2)) :: buf ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - - ! INTEGER, EXTERNAL :: h5aread_real_2_c - ! MS FORTRAN needs explicit interface for C functions called here. - ! - INTERFACE - INTEGER FUNCTION h5aread_real_2_c(attr_id, memtype_id, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AREAD_REAL_2_C'::h5aread_real_2_c - !DEC$ENDIF - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - INTEGER(HID_T), INTENT(IN) :: attr_id - INTEGER(HID_T), INTENT(IN) :: memtype_id - REAL, INTENT(INOUT), & - DIMENSION(dims(1),dims(2)) :: buf - END FUNCTION h5aread_real_2_c - END INTERFACE - - hdferr = h5aread_real_2_c(attr_id, memtype_id, buf, dims) - END SUBROUTINE h5aread_real_2 - - - SUBROUTINE h5aread_real_3(attr_id, memtype_id, buf, dims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - REAL, INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3)) :: buf ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - - ! INTEGER, EXTERNAL :: h5aread_real_3_c - ! MS FORTRAN needs explicit interface for C functions called here. - ! - INTERFACE - INTEGER FUNCTION h5aread_real_3_c(attr_id, memtype_id, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AREAD_REAL_3_C'::h5aread_real_3_c - !DEC$ENDIF - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - INTEGER(HID_T), INTENT(IN) :: attr_id - INTEGER(HID_T), INTENT(IN) :: memtype_id - REAL, INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3)) :: buf - END FUNCTION h5aread_real_3_c - END INTERFACE - - hdferr = h5aread_real_3_c(attr_id, memtype_id, buf, dims) - END SUBROUTINE h5aread_real_3 - - - SUBROUTINE h5aread_real_4(attr_id, memtype_id, buf, dims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - REAL, INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4)) :: buf ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - - ! INTEGER, EXTERNAL :: h5aread_real_4_c - ! MS FORTRAN needs explicit interface for C functions called here. - ! - INTERFACE - INTEGER FUNCTION h5aread_real_4_c(attr_id, memtype_id, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AREAD_REAL_4_C'::h5aread_real_4_c - !DEC$ENDIF - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - INTEGER(HID_T), INTENT(IN) :: attr_id - INTEGER(HID_T), INTENT(IN) :: memtype_id - REAL, INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4)) :: buf - END FUNCTION h5aread_real_4_c - END INTERFACE - - hdferr = h5aread_real_4_c(attr_id, memtype_id, buf, dims) - END SUBROUTINE h5aread_real_4 - - - SUBROUTINE h5aread_real_5(attr_id, memtype_id, buf, dims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - REAL, INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) :: buf ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - - ! INTEGER, EXTERNAL :: h5aread_real_5_c - ! MS FORTRAN needs explicit interface for C functions called here. - ! - INTERFACE - INTEGER FUNCTION h5aread_real_5_c(attr_id, memtype_id, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AREAD_REAL_5_C'::h5aread_real_5_c - !DEC$ENDIF - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - INTEGER(HID_T), INTENT(IN) :: attr_id - INTEGER(HID_T), INTENT(IN) :: memtype_id - REAL, INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) :: buf - END FUNCTION h5aread_real_5_c - END INTERFACE - - hdferr = h5aread_real_5_c(attr_id, memtype_id, buf, dims) - END SUBROUTINE h5aread_real_5 - - - SUBROUTINE h5aread_real_6(attr_id, memtype_id, buf, dims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - REAL, INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)) :: buf ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - - ! INTEGER, EXTERNAL :: h5aread_real_6_c - ! MS FORTRAN needs explicit interface for C functions called here. - ! - INTERFACE - INTEGER FUNCTION h5aread_real_6_c(attr_id, memtype_id, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AREAD_REAL_6_C'::h5aread_real_6_c - !DEC$ENDIF - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - INTEGER(HID_T), INTENT(IN) :: attr_id - INTEGER(HID_T), INTENT(IN) :: memtype_id - REAL, INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)) :: buf - END FUNCTION h5aread_real_6_c - END INTERFACE - - hdferr = h5aread_real_6_c(attr_id, memtype_id, buf, dims) - END SUBROUTINE h5aread_real_6 - - - SUBROUTINE h5aread_real_7(attr_id, memtype_id, buf, dims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - REAL, INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)) :: buf ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - - ! INTEGER, EXTERNAL :: h5aread_real_7_c - ! MS FORTRAN needs explicit interface for C functions called here. - ! - INTERFACE - INTEGER FUNCTION h5aread_real_7_c(attr_id, memtype_id, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AREAD_REAL_7_C'::h5aread_real_7_c - !DEC$ENDIF - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - INTEGER(HID_T), INTENT(IN) :: attr_id - INTEGER(HID_T), INTENT(IN) :: memtype_id - REAL, INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)) :: buf - END FUNCTION h5aread_real_7_c - END INTERFACE - - hdferr = h5aread_real_7_c(attr_id, memtype_id, buf, dims) - END SUBROUTINE h5aread_real_7 - - SUBROUTINE h5aread_char_scalar(attr_id, memtype_id, buf, dims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - CHARACTER(LEN=*), INTENT(INOUT) :: buf - ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - - ! INTEGER, EXTERNAL :: h5areadc_s_c - ! MS FORTRAN needs explicit interface for C functions called here. - ! - INTERFACE - INTEGER FUNCTION h5areadc_s_c(attr_id, memtype_id, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AREADC_S_C'::h5areadc_s_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: buf - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - INTEGER(HID_T), INTENT(IN) :: attr_id - INTEGER(HID_T), INTENT(IN) :: memtype_id - CHARACTER(LEN=*), INTENT(INOUT) :: buf - END FUNCTION h5areadc_s_c - END INTERFACE - - hdferr = h5areadc_s_c(attr_id, memtype_id, buf, dims) - END SUBROUTINE h5aread_char_scalar - - SUBROUTINE h5aread_char_1(attr_id, memtype_id, buf, dims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - CHARACTER(LEN=*), INTENT(INOUT), & - DIMENSION(dims(1)) :: buf ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - - ! INTEGER, EXTERNAL :: h5areadc_1_c - ! MS FORTRAN needs explicit interface for C functions called here. - ! - INTERFACE - INTEGER FUNCTION h5areadc_1_c(attr_id, memtype_id, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AREADC_1_C'::h5areadc_1_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: buf - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - INTEGER(HID_T), INTENT(IN) :: attr_id - INTEGER(HID_T), INTENT(IN) :: memtype_id - CHARACTER(LEN=*), INTENT(INOUT), & - DIMENSION(dims(1)) :: buf - END FUNCTION h5areadc_1_c - END INTERFACE - - hdferr = h5areadc_1_c(attr_id, memtype_id, buf, dims) - END SUBROUTINE h5aread_char_1 - - - SUBROUTINE h5aread_char_2(attr_id, memtype_id, buf, dims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - CHARACTER(LEN=*), INTENT(INOUT), & - DIMENSION(dims(1),dims(2)) :: buf ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - - ! INTEGER, EXTERNAL :: h5areadc_2_c - ! MS FORTRAN needs explicit interface for C functions called here. - ! - INTERFACE - INTEGER FUNCTION h5areadc_2_c(attr_id, memtype_id, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AREADC_2_C'::h5areadc_2_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: buf - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - INTEGER(HID_T), INTENT(IN) :: attr_id - INTEGER(HID_T), INTENT(IN) :: memtype_id - CHARACTER(LEN=*), INTENT(INOUT), & - DIMENSION(dims(1),dims(2)) :: buf - END FUNCTION h5areadc_2_c - END INTERFACE - - hdferr = h5areadc_2_c(attr_id, memtype_id, buf, dims) - END SUBROUTINE h5aread_char_2 - - - SUBROUTINE h5aread_char_3(attr_id, memtype_id, buf, dims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - CHARACTER(LEN=*), INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3)) :: buf ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - - ! INTEGER, EXTERNAL :: h5areadc_3_c - ! MS FORTRAN needs explicit interface for C functions called here. - ! - INTERFACE - INTEGER FUNCTION h5areadc_3_c(attr_id, memtype_id, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AREADC_3_C'::h5areadc_3_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: buf - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - INTEGER(HID_T), INTENT(IN) :: attr_id - INTEGER(HID_T), INTENT(IN) :: memtype_id - CHARACTER(LEN=*), INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3)) :: buf - END FUNCTION h5areadc_3_c - END INTERFACE - - hdferr = h5areadc_3_c(attr_id, memtype_id, buf, dims) - END SUBROUTINE h5aread_char_3 - - - SUBROUTINE h5aread_char_4(attr_id, memtype_id, buf, dims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - CHARACTER(LEN=*), INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4)) :: buf ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - - ! INTEGER, EXTERNAL :: h5areadc_4_c - ! MS FORTRAN needs explicit interface for C functions called here. - ! - INTERFACE - INTEGER FUNCTION h5areadc_4_c(attr_id, memtype_id, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AREADC_4_C'::h5areadc_4_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: buf - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - INTEGER(HID_T), INTENT(IN) :: attr_id - INTEGER(HID_T), INTENT(IN) :: memtype_id - CHARACTER(LEN=*), INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4)) :: buf - END FUNCTION h5areadc_4_c - END INTERFACE - - hdferr = h5areadc_4_c(attr_id, memtype_id, buf, dims) - END SUBROUTINE h5aread_char_4 - - - SUBROUTINE h5aread_char_5(attr_id, memtype_id, buf, dims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - CHARACTER(LEN=*), INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) :: buf - ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - - ! INTEGER, EXTERNAL :: h5areadc_5_c - ! MS FORTRAN needs explicit interface for C functions called here. - ! - INTERFACE - INTEGER FUNCTION h5areadc_5_c(attr_id, memtype_id, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AREADC_5_C'::h5areadc_5_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: buf - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - INTEGER(HID_T), INTENT(IN) :: attr_id - INTEGER(HID_T), INTENT(IN) :: memtype_id - CHARACTER(LEN=*), INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) :: buf - END FUNCTION h5areadc_5_c - END INTERFACE - - hdferr = h5areadc_5_c(attr_id, memtype_id, buf, dims) - END SUBROUTINE h5aread_char_5 - - - SUBROUTINE h5aread_char_6(attr_id, memtype_id, buf, dims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - CHARACTER(LEN=*), INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)) :: buf ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - - ! INTEGER, EXTERNAL :: h5areadc_6_c - ! MS FORTRAN needs explicit interface for C functions called here. - ! - INTERFACE - INTEGER FUNCTION h5areadc_6_c(attr_id, memtype_id, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AREADC_6_C'::h5areadc_6_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: buf - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - INTEGER(HID_T), INTENT(IN) :: attr_id - INTEGER(HID_T), INTENT(IN) :: memtype_id - CHARACTER(LEN=*), INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)) :: buf - END FUNCTION h5areadc_6_c - END INTERFACE - - hdferr = h5areadc_6_c(attr_id, memtype_id, buf, dims) - END SUBROUTINE h5aread_char_6 - - - SUBROUTINE h5aread_char_7(attr_id, memtype_id, buf, dims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - CHARACTER(LEN=*), INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)) :: buf ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - - ! INTEGER, EXTERNAL :: h5areadc_7_c - ! MS FORTRAN needs explicit interface for C functions called here. - ! - INTERFACE - INTEGER FUNCTION h5areadc_7_c(attr_id, memtype_id, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AREADC_7_C'::h5areadc_7_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: buf - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - INTEGER(HID_T), INTENT(IN) :: attr_id - INTEGER(HID_T), INTENT(IN) :: memtype_id - CHARACTER(LEN=*), INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)) :: buf - END FUNCTION h5areadc_7_c - END INTERFACE - - hdferr = h5areadc_7_c(attr_id, memtype_id, buf, dims) - END SUBROUTINE h5aread_char_7 - -END MODULE H5A_PROVISIONAL - - diff --git a/fortran/src/H5Df.c b/fortran/src/H5Df.c index 0d32dac..57b4d4d 100644 --- a/fortran/src/H5Df.c +++ b/fortran/src/H5Df.c @@ -1,6 +1,6 @@ /****h* H5Df/H5Df * PURPOSE - * This file contains C stubs for H5D Fortran APIs + * This file contains C stubs for H5D Fortran APIs * * COPYRIGHT * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * @@ -48,7 +48,7 @@ * SOURCE */ int_f -nh5dcreate_c (hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *type_id, hid_t_f *space_id, +h5dcreate_c (hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *type_id, hid_t_f *space_id, hid_t_f *lcpl_id, hid_t_f *dcpl_id, hid_t_f *dapl_id, hid_t_f *dset_id) /******/ { @@ -84,1161 +84,118 @@ DONE: * PURPOSE * Call H5Dopen2 to open a dataset * INPUTS - * loc_id - file or group identifier - * name - name of the dataset - * namelen - name length - * dapl_id - Dataset access property list + * loc_id - file or group identifier + * name - name of the dataset + * namelen - name length + * dapl_id - Dataset access property list * OUTPUTS - * dset_id - dataset identifier + * dset_id - dataset identifier * RETURNS - * 0 on success, -1 on failure - * AUTHOR - * Elena Pourmal - * Wednesday, August 4, 1999 - * HISTORY - * Added 1.8 parameter: dapl_id - * SOURCE -*/ -int_f -nh5dopen_c(hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *dapl_id, hid_t_f *dset_id) -/******/ -{ - char *c_name = NULL; - hid_t c_dset_id; - int ret_value = -1; - - /* - * Convert FORTRAN name to C name - */ - if(NULL == (c_name = (char *)HD5f2cstring(name, (size_t)*namelen))) - goto DONE; - - /* - * Call H5Dopen2 function. - */ - if((c_dset_id = H5Dopen2((hid_t)*loc_id, c_name, (hid_t)*dapl_id)) < 0) - goto DONE; - - *dset_id = (hid_t_f)c_dset_id; - ret_value = 0; - -DONE: - if(c_name) - HDfree(c_name); - return ret_value; -} - - -/****if* H5Df/h5dwritec_c - * NAME - * h5dwritec_c - * PURPOSE - * Call h5dwrite_c to write a dataset of characters - * INPUTS - * dset_id - dataset identifier - * mem_type_id - memory datatype identifier - * mem_space_id - memory dataspace identifier - * file_space_id - memory dataspace identifier - * xfer_pr - identifier of transfer property list - * buf - character data buffer - * RETURNS - * 0 on success, -1 on failure - * AUTHOR - * Elena Pourmal - * Tuesday, May 14, 2002 - * HISTORY - * This function is added to accomodate oveloaded h5dwrite_f - * with the dims argument being of INTEGER(HSIZE_T) type - - * SOURCE -*/ -int_f -nh5dwritec_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, _fcd buf, hsize_t_f *dims) -/******/ -{ - int ret_value = -1; - - /* - * Call h5dwrite_c function. - */ - ret_value = nh5dwrite_c(dset_id, mem_type_id, mem_space_id, file_space_id, xfer_prp, _fcdtocp(buf), dims); - - return ret_value; -} - -int_f -nh5dwritec_s_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, _fcd buf, hsize_t_f *dims) - -{ - int ret_value = -1; - - /* - * Call h5dwrite_c function. - */ - ret_value = nh5dwrite_c(dset_id, mem_type_id, mem_space_id, file_space_id, xfer_prp, _fcdtocp(buf), dims); - - return ret_value; -} - -int_f -nh5dwritec_1_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, _fcd buf, hsize_t_f *dims) - -{ - int ret_value = -1; - - /* - * Call h5dwrite_c function. - */ - ret_value = nh5dwrite_c(dset_id, mem_type_id, mem_space_id, file_space_id, xfer_prp, _fcdtocp(buf), dims); - - return ret_value; -} - -int_f -nh5dwritec_2_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, _fcd buf, hsize_t_f *dims) - -{ - int ret_value = -1; - - /* - * Call h5dwrite_c function. - */ - ret_value = nh5dwrite_c(dset_id, mem_type_id, mem_space_id, file_space_id, xfer_prp, _fcdtocp(buf), dims); - - return ret_value; -} - -int_f -nh5dwritec_3_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, _fcd buf, hsize_t_f *dims) - -{ - int ret_value = -1; - - /* - * Call h5dwrite_c function. - */ - ret_value = nh5dwrite_c(dset_id, mem_type_id, mem_space_id, file_space_id, xfer_prp, _fcdtocp(buf), dims); - - return ret_value; -} - -int_f -nh5dwritec_4_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, _fcd buf, hsize_t_f *dims) - -{ - int ret_value = -1; - - /* - * Call h5dwrite_c function. - */ - ret_value = nh5dwrite_c(dset_id, mem_type_id, mem_space_id, file_space_id, xfer_prp, _fcdtocp(buf), dims); - - return ret_value; -} - -int_f -nh5dwritec_5_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, _fcd buf, hsize_t_f *dims) - -{ - int ret_value = -1; - - /* - * Call h5dwrite_c function. - */ - ret_value = nh5dwrite_c(dset_id, mem_type_id, mem_space_id, file_space_id, xfer_prp, _fcdtocp(buf), dims); - - return ret_value; -} - -int_f -nh5dwritec_6_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, _fcd buf, hsize_t_f *dims) - -{ - int ret_value = -1; - - /* - * Call h5dwrite_c function. - */ - ret_value = nh5dwrite_c(dset_id, mem_type_id, mem_space_id, file_space_id, xfer_prp, _fcdtocp(buf), dims); - - return ret_value; -} - -int_f -nh5dwritec_7_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, _fcd buf, hsize_t_f *dims) - -{ - int ret_value = -1; - - /* - * Call h5dwrite_c function. - */ - ret_value = nh5dwrite_c(dset_id, mem_type_id, mem_space_id, file_space_id, xfer_prp, _fcdtocp(buf), dims); - - return ret_value; -} - -/****if* H5Df/h5dwrite_c - * NAME - * h5dwrite_c - * PURPOSE - * Call H5Dwrite to write a dataset - * INPUTS - * dset_id - dataset identifier - * mem_type_id - memory datatype identifier - * mem_space_id - memory dataspace identifier - * file_space_id - memory dataspace identifier - * xfer_pr - identifier of transfer property list - * buf - data buffer - * RETURNS - * 0 on success, -1 on failure - * AUTHOR - * Elena Pourmal - * Tuesday, May 14, 2002 - * HISTORY - * This function is added to accomodate oveloaded h5dwrite_f - * with the dims argument being of INTEGER(HSIZE_T) type - * - * Added nh5dwrite_integer(real,double)_s,1-7_c functions to eliminate - * complains about wrong parameter types in h5dwrite_c function - * called by Fortran rouitnes - * October 10, 2006 EIP - * - * SOURCE -*/ -int_f -nh5dwrite_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf, hsize_t_f H5_ATTR_UNUSED *dims) -/******/ -{ - int ret_value = -1; - herr_t ret; - hid_t c_dset_id; - hid_t c_mem_type_id; - hid_t c_mem_space_id; - hid_t c_file_space_id; - hid_t c_xfer_prp; - - /* - * Define transfer property - */ - c_xfer_prp = (hid_t)*xfer_prp; - - /* - * Call H5Dwrite function. - */ - 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; - c_file_space_id = (hid_t)*file_space_id; - ret = H5Dwrite(c_dset_id, c_mem_type_id, c_mem_space_id, c_file_space_id, c_xfer_prp, buf); - - if (ret < 0) return ret_value; - ret_value = 0; - return ret_value; -} - -int_f -nh5dwrite_integer_s_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf, hsize_t_f *dims) - -{ - /* - * Call h5dwrite_c function. - */ - return nh5dwrite_c(dset_id, mem_type_id, mem_space_id, file_space_id, xfer_prp, buf, dims); -} - - -int_f -nh5dwrite_integer_1_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf, hsize_t_f *dims) - -{ - /* - * Call h5dwrite_c function. - */ - return nh5dwrite_c(dset_id, mem_type_id, mem_space_id, file_space_id, xfer_prp, buf, dims); -} - - -int_f -nh5dwrite_integer_2_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf, hsize_t_f *dims) - -{ - /* - * Call h5dwrite_c function. - */ - return nh5dwrite_c(dset_id, mem_type_id, mem_space_id, file_space_id, xfer_prp, buf, dims); -} - - -int_f -nh5dwrite_integer_3_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf, hsize_t_f *dims) - -{ - /* - * Call h5dwrite_c function. - */ - return nh5dwrite_c(dset_id, mem_type_id, mem_space_id, file_space_id, xfer_prp, buf, dims); -} - - -int_f -nh5dwrite_integer_4_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf, hsize_t_f *dims) - -{ - /* - * Call h5dwrite_c function. - */ - return nh5dwrite_c(dset_id, mem_type_id, mem_space_id, file_space_id, xfer_prp, buf, dims); -} - - -int_f -nh5dwrite_integer_5_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf, hsize_t_f *dims) - -{ - /* - * Call h5dwrite_c function. - */ - return nh5dwrite_c(dset_id, mem_type_id, mem_space_id, file_space_id, xfer_prp, buf, dims); -} - - -int_f -nh5dwrite_integer_6_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf, hsize_t_f *dims) - -{ - /* - * Call h5dwrite_c function. - */ - return nh5dwrite_c(dset_id, mem_type_id, mem_space_id, file_space_id, xfer_prp, buf, dims); -} - - -int_f -nh5dwrite_integer_7_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf, hsize_t_f *dims) - -{ - /* - * Call h5dwrite_c function. - */ - return nh5dwrite_c(dset_id, mem_type_id, mem_space_id, file_space_id, xfer_prp, buf, dims); -} - - -int_f -nh5dwrite_real_s_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf, hsize_t_f *dims) - -{ - /* - * Call h5dwrite_c function. - */ - return nh5dwrite_c(dset_id, mem_type_id, mem_space_id, file_space_id, xfer_prp, buf, dims); -} - -int_f -nh5dwrite_real_1_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf, hsize_t_f *dims) - -{ - /* - * Call h5dwrite_c function. - */ - return nh5dwrite_c(dset_id, mem_type_id, mem_space_id, file_space_id, xfer_prp, buf, dims); -} - -int_f -nh5dwrite_real_2_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf, hsize_t_f *dims) - -{ - /* - * Call h5dwrite_c function. - */ - return nh5dwrite_c(dset_id, mem_type_id, mem_space_id, file_space_id, xfer_prp, buf, dims); -} - -int_f -nh5dwrite_real_3_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf, hsize_t_f *dims) - -{ - /* - * Call h5dwrite_c function. - */ - return nh5dwrite_c(dset_id, mem_type_id, mem_space_id, file_space_id, xfer_prp, buf, dims); -} - -int_f -nh5dwrite_real_4_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf, hsize_t_f *dims) - -{ - /* - * Call h5dwrite_c function. - */ - return nh5dwrite_c(dset_id, mem_type_id, mem_space_id, file_space_id, xfer_prp, buf, dims); -} - -int_f -nh5dwrite_real_5_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf, hsize_t_f *dims) - -{ - /* - * Call h5dwrite_c function. - */ - return nh5dwrite_c(dset_id, mem_type_id, mem_space_id, file_space_id, xfer_prp, buf, dims); -} - -int_f -nh5dwrite_real_6_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf, hsize_t_f *dims) - -{ - /* - * Call h5dwrite_c function. - */ - return nh5dwrite_c(dset_id, mem_type_id, mem_space_id, file_space_id, xfer_prp, buf, dims); -} - -int_f -nh5dwrite_real_7_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf, hsize_t_f *dims) - -{ - /* - * Call h5dwrite_c function. - */ - return nh5dwrite_c(dset_id, mem_type_id, mem_space_id, file_space_id, xfer_prp, buf, dims); -} - -int_f -nh5dwrite_double_s_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf, hsize_t_f *dims) - -{ - /* - * Call h5dwrite_c function. - */ - return nh5dwrite_c(dset_id, mem_type_id, mem_space_id, file_space_id, xfer_prp, buf, dims); -} - -int_f -nh5dwrite_double_1_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf, hsize_t_f *dims) - -{ - /* - * Call h5dwrite_c function. - */ - return nh5dwrite_c(dset_id, mem_type_id, mem_space_id, file_space_id, xfer_prp, buf, dims); -} - -int_f -nh5dwrite_double_2_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf, hsize_t_f *dims) - -{ - /* - * Call h5dwrite_c function. - */ - return nh5dwrite_c(dset_id, mem_type_id, mem_space_id, file_space_id, xfer_prp, buf, dims); -} - -int_f -nh5dwrite_double_3_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf, hsize_t_f *dims) - -{ - /* - * Call h5dwrite_c function. - */ - return nh5dwrite_c(dset_id, mem_type_id, mem_space_id, file_space_id, xfer_prp, buf, dims); -} - -int_f -nh5dwrite_double_4_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf, hsize_t_f *dims) - -{ - /* - * Call h5dwrite_c function. - */ - return nh5dwrite_c(dset_id, mem_type_id, mem_space_id, file_space_id, xfer_prp, buf, dims); -} - -int_f -nh5dwrite_double_5_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf, hsize_t_f *dims) - -{ - /* - * Call h5dwrite_c function. - */ - return nh5dwrite_c(dset_id, mem_type_id, mem_space_id, file_space_id, xfer_prp, buf, dims); -} - -int_f -nh5dwrite_double_6_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf, hsize_t_f *dims) - -{ - /* - * Call h5dwrite_c function. - */ - return nh5dwrite_c(dset_id, mem_type_id, mem_space_id, file_space_id, xfer_prp, buf, dims); -} - -int_f -nh5dwrite_double_7_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf, hsize_t_f *dims) - -{ - /* - * Call h5dwrite_c function. - */ - return nh5dwrite_c(dset_id, mem_type_id, mem_space_id, file_space_id, xfer_prp, buf, dims); -} - - -/****if* H5Df/h5dwrite_ref_obj_c - * NAME - * h5dwrite_ref_obj_c - * PURPOSE - * Call H5Dwrite to write a dataset of object references - * INPUTS - * dset_id - dataset identifier - * mem_type_id - memory datatype identifier - * mem_space_id - memory dataspace identifier - * file_space_id - memory dataspace identifier - * xfer_pr - identifier of transfer property list - * buf - data buffer with references to the objects. - * n - number of references to be stored. - * RETURNS - * 0 on success,e-1 on failure - * AUTHOR - * Elena Pourmal - * Tuesday, May 14, 2002 - * HISTORY - * This function was added to accomodate h5dwrite_f with the - * dims argumnet being of INTEGER(HSIZE_T) type. - * SOURCE -*/ -int_f -nh5dwrite_ref_obj_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, haddr_t_f *buf, hsize_t_f *dims) -/******/ -{ - int ret_value = -1; - herr_t ret; - hid_t c_dset_id; - hid_t c_mem_type_id; - hid_t c_mem_space_id; - hid_t c_file_space_id; - hid_t c_xfer_prp; - hobj_ref_t *buf_c; - unsigned int i, n; - - /* - * Define transfer property - */ - c_xfer_prp = (hid_t)*xfer_prp; - - /* - * Allocate temporary buffer and copy references from Fortran. - */ - n = (unsigned int)*dims; - buf_c = (hobj_ref_t*)HDmalloc(sizeof(hobj_ref_t)*n); - if ( buf_c != NULL ) { - for (i = 0; i < n; i++) - HDmemcpy(&buf_c[i], &buf[i], sizeof(haddr_t)); - } - else return ret_value; - - /* - * Call H5Dwrite function. - */ - 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; - c_file_space_id = (hid_t)*file_space_id; - ret = H5Dwrite(c_dset_id, c_mem_type_id, c_mem_space_id, c_file_space_id, c_xfer_prp, buf_c); - HDfree(buf_c); - if (ret < 0) return ret_value; - ret_value = 0; - return ret_value; -} - -/****if* H5Df/h5dwrite_ref_reg_c - * NAME - * h5dwrite_ref_reg_c - * PURPOSE - * Call H5Dwrite to write a dataset of dataset region references - * INPUTS - * dset_id - dataset identifier - * mem_type_id - memory datatype identifier - * mem_space_id - memory dataspace identifier - * file_space_id - memory dataspace identifier - * xfer_pr - identifier of transfer property list - * buf - data buffer with references to the objects. - * n - number of references to be stored. - * RETURNS - * 0 on success, -1 on failure - * AUTHOR - * Elena Pourmal - * Tuesday, May 14, 2002 - * HISTORY - * This function was added to accomodate h5dwrite_f with the - * dims argument being of INTEGER(HSIZE_T) type - * SOURCE -*/ -int_f -nh5dwrite_ref_reg_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, int_f *buf, hsize_t_f *dims) -/******/ -{ - int ret_value = -1; - herr_t ret; - hid_t c_dset_id; - hid_t c_mem_type_id; - hid_t c_mem_space_id; - hid_t c_file_space_id; - hid_t c_xfer_prp; - hdset_reg_ref_t *buf_c = NULL; - unsigned int i, n; - - n = (unsigned int)*dims; - /* - * Define transfer property - */ - c_xfer_prp = (hid_t)*xfer_prp; - - /* - * Allocate temporary buffer and copy references from Fortran. - */ - buf_c = (hdset_reg_ref_t *)HDmalloc(sizeof(hdset_reg_ref_t)*n); - if ( buf_c != NULL ) { - for (i = 0; i < n; i++) { - HDmemcpy(&buf_c[i], buf, H5R_DSET_REG_REF_BUF_SIZE); - buf = buf + REF_REG_BUF_LEN_F; - } - } - else return ret_value; - - - /* - * Call H5Dwrite function. - */ - 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; - c_file_space_id = (hid_t)*file_space_id; - ret = H5Dwrite(c_dset_id, c_mem_type_id, c_mem_space_id, c_file_space_id, c_xfer_prp, buf_c); - HDfree(buf_c); - if (ret < 0) return ret_value; - ret_value = 0; - return ret_value; -} - - - -/****if* H5Df/h5dreadc_c - * NAME - * h5dreadc_c - * PURPOSE - * Call h5dread_c to read a dataset of characters - * INPUTS - * dset_id - dataset identifier - * mem_type_id - memory datatype identifier - * mem_space_id - memory dataspace identifier - * file_space_id - memory dataspace identifier - * xfer_pr - identifier of transfer property list - * OUTPUTS - * buf - character data buffer - * RETURNS - * 0 on success, -1 on failure - * AUTHOR - * Elena Pourmal - * Wednesday, May 15, 2002 - * HISTORY - * This function was added to accomodate h5dread_f subroutine - * with the dims parameter being of INTEGER(HSIZE_T_F) size. - * SOURCE -*/ -int_f -nh5dreadc_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, _fcd buf, hsize_t_f *dims) -/******/ -{ - int ret_value = -1; - - /* - * Call h5dread_c function. - */ - ret_value = nh5dread_c(dset_id, mem_type_id, mem_space_id, file_space_id, xfer_prp, _fcdtocp(buf), dims); - - return ret_value; -} - -int_f -nh5dreadc_s_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, _fcd buf, hsize_t_f *dims) - -{ - int ret_value = -1; - - /* - * Call h5dread_c function. - */ - ret_value = nh5dread_c(dset_id, mem_type_id, mem_space_id, file_space_id, xfer_prp, _fcdtocp(buf), dims); - - return ret_value; -} - -int_f -nh5dreadc_1_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, _fcd buf, hsize_t_f *dims) - -{ - int ret_value = -1; - - /* - * Call h5dread_c function. - */ - ret_value = nh5dread_c(dset_id, mem_type_id, mem_space_id, file_space_id, xfer_prp, _fcdtocp(buf), dims); - - return ret_value; -} - -int_f -nh5dreadc_2_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, _fcd buf, hsize_t_f *dims) - -{ - int ret_value = -1; - - /* - * Call h5dread_c function. - */ - ret_value = nh5dread_c(dset_id, mem_type_id, mem_space_id, file_space_id, xfer_prp, _fcdtocp(buf), dims); - - return ret_value; -} - -int_f -nh5dreadc_3_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, _fcd buf, hsize_t_f *dims) - -{ - int ret_value = -1; - - /* - * Call h5dread_c function. - */ - ret_value = nh5dread_c(dset_id, mem_type_id, mem_space_id, file_space_id, xfer_prp, _fcdtocp(buf), dims); - - return ret_value; -} - -int_f -nh5dreadc_4_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, _fcd buf, hsize_t_f *dims) - -{ - int ret_value = -1; - - /* - * Call h5dread_c function. - */ - ret_value = nh5dread_c(dset_id, mem_type_id, mem_space_id, file_space_id, xfer_prp, _fcdtocp(buf), dims); - - return ret_value; -} - -int_f -nh5dreadc_5_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, _fcd buf, hsize_t_f *dims) - -{ - int ret_value = -1; - - /* - * Call h5dread_c function. - */ - ret_value = nh5dread_c(dset_id, mem_type_id, mem_space_id, file_space_id, xfer_prp, _fcdtocp(buf), dims); - - return ret_value; -} - -int_f -nh5dreadc_6_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, _fcd buf, hsize_t_f *dims) - -{ - int ret_value = -1; - - /* - * Call h5dread_c function. - */ - ret_value = nh5dread_c(dset_id, mem_type_id, mem_space_id, file_space_id, xfer_prp, _fcdtocp(buf), dims); - - return ret_value; -} - -int_f -nh5dreadc_7_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, _fcd buf, hsize_t_f *dims) - -{ - int ret_value = -1; - - /* - * Call h5dread_c function. - */ - ret_value = nh5dread_c(dset_id, mem_type_id, mem_space_id, file_space_id, xfer_prp, _fcdtocp(buf), dims); - - return ret_value; -} - -/****if* H5Df/h5dread_c - * NAME - * h5dread_c - * PURPOSE - * Call H5Draed to read a dataset - * INPUTS - * dset_id - dataset identifier - * mem_type_id - memory datatype identifier - * mem_space_id - memory dataspace identifier - * file_space_id - memory dataspace identifier - * xfer_pr - identifier of transfer property list - * OUTPUTS - * buf - data buffer - * RETURNS - * 0 on success, -1 on failure - * AUTHOR - * Elena Pourmal - * Wednesday, May 15, 2002 - * HISTORY - * This function was added to accomodate h5dread_f subroutine - * with the dims parameter being of INTEGER(HSIZE_T_F) size. - * - * Added nh5dread_integer(real,double)_s,1-7_c functions to eliminate - * complains about wrong parameter types in h5dwrite_c function - * called by Fortran rouitnes - * October 10, 2006 EIP - * - * SOURCE -*/ -int_f -nh5dread_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf, hsize_t_f H5_ATTR_UNUSED *dims) -/******/ -{ - int ret_value = -1; - herr_t ret; - hid_t c_dset_id; - hid_t c_mem_type_id; - hid_t c_mem_space_id; - hid_t c_file_space_id; - hid_t c_xfer_prp; - - /* - * Define transfer property - */ - c_xfer_prp = (hid_t)*xfer_prp; - - /* - * Call H5Dread function. - */ - 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; - c_file_space_id = (hid_t)*file_space_id; - ret = H5Dread(c_dset_id, c_mem_type_id, c_mem_space_id, c_file_space_id, c_xfer_prp, buf); - - if (ret < 0) return ret_value; - ret_value = 0; - return ret_value; -} - -int_f -nh5dread_integer_s_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf, hsize_t_f *dims) - -{ - /* - * Call h5dread_c function. - */ - return nh5dread_c(dset_id, mem_type_id, mem_space_id, file_space_id, xfer_prp, buf, dims); -} - -int_f -nh5dread_integer_1_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf, hsize_t_f *dims) - -{ - /* - * Call h5dread_c function. - */ - return nh5dread_c(dset_id, mem_type_id, mem_space_id, file_space_id, xfer_prp, buf, dims); -} - -int_f -nh5dread_integer_2_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf, hsize_t_f *dims) - -{ - /* - * Call h5dread_c function. - */ - return nh5dread_c(dset_id, mem_type_id, mem_space_id, file_space_id, xfer_prp, buf, dims); -} - -int_f -nh5dread_integer_3_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf, hsize_t_f *dims) - -{ - /* - * Call h5dread_c function. - */ - return nh5dread_c(dset_id, mem_type_id, mem_space_id, file_space_id, xfer_prp, buf, dims); -} - -int_f -nh5dread_integer_4_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf, hsize_t_f *dims) - -{ - /* - * Call h5dread_c function. - */ - return nh5dread_c(dset_id, mem_type_id, mem_space_id, file_space_id, xfer_prp, buf, dims); -} - -int_f -nh5dread_integer_5_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf, hsize_t_f *dims) - -{ - /* - * Call h5dread_c function. - */ - return nh5dread_c(dset_id, mem_type_id, mem_space_id, file_space_id, xfer_prp, buf, dims); -} - -int_f -nh5dread_integer_6_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf, hsize_t_f *dims) - -{ - /* - * Call h5dread_c function. - */ - return nh5dread_c(dset_id, mem_type_id, mem_space_id, file_space_id, xfer_prp, buf, dims); -} - -int_f -nh5dread_integer_7_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf, hsize_t_f *dims) - -{ - /* - * Call h5dread_c function. - */ - return nh5dread_c(dset_id, mem_type_id, mem_space_id, file_space_id, xfer_prp, buf, dims); -} - -int_f -nh5dread_real_s_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf, hsize_t_f *dims) - -{ - /* - * Call h5dread_c function. - */ - return nh5dread_c(dset_id, mem_type_id, mem_space_id, file_space_id, xfer_prp, buf, dims); -} - -int_f -nh5dread_real_1_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf, hsize_t_f *dims) - -{ - /* - * Call h5dread_c function. - */ - return nh5dread_c(dset_id, mem_type_id, mem_space_id, file_space_id, xfer_prp, buf, dims); -} - -int_f -nh5dread_real_2_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf, hsize_t_f *dims) - -{ - /* - * Call h5dread_c function. - */ - return nh5dread_c(dset_id, mem_type_id, mem_space_id, file_space_id, xfer_prp, buf, dims); -} - -int_f -nh5dread_real_3_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf, hsize_t_f *dims) - -{ - /* - * Call h5dread_c function. - */ - return nh5dread_c(dset_id, mem_type_id, mem_space_id, file_space_id, xfer_prp, buf, dims); -} - -int_f -nh5dread_real_4_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf, hsize_t_f *dims) - -{ - /* - * Call h5dread_c function. - */ - return nh5dread_c(dset_id, mem_type_id, mem_space_id, file_space_id, xfer_prp, buf, dims); -} - -int_f -nh5dread_real_5_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf, hsize_t_f *dims) - -{ - /* - * Call h5dread_c function. - */ - return nh5dread_c(dset_id, mem_type_id, mem_space_id, file_space_id, xfer_prp, buf, dims); -} - -int_f -nh5dread_real_6_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf, hsize_t_f *dims) - -{ - /* - * Call h5dread_c function. - */ - return nh5dread_c(dset_id, mem_type_id, mem_space_id, file_space_id, xfer_prp, buf, dims); -} - -int_f -nh5dread_real_7_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf, hsize_t_f *dims) - -{ - /* - * Call h5dread_c function. - */ - return nh5dread_c(dset_id, mem_type_id, mem_space_id, file_space_id, xfer_prp, buf, dims); -} - -int_f -nh5dread_double_s_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf, hsize_t_f *dims) - -{ - /* - * Call h5dread_c function. - */ - return nh5dread_c(dset_id, mem_type_id, mem_space_id, file_space_id, xfer_prp, buf, dims); -} - -int_f -nh5dread_double_1_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf, hsize_t_f *dims) - -{ - /* - * Call h5dread_c function. - */ - return nh5dread_c(dset_id, mem_type_id, mem_space_id, file_space_id, xfer_prp, buf, dims); -} - -int_f -nh5dread_double_2_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf, hsize_t_f *dims) - -{ - /* - * Call h5dread_c function. - */ - return nh5dread_c(dset_id, mem_type_id, mem_space_id, file_space_id, xfer_prp, buf, dims); -} - -int_f -nh5dread_double_3_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf, hsize_t_f *dims) - -{ - /* - * Call h5dread_c function. - */ - return nh5dread_c(dset_id, mem_type_id, mem_space_id, file_space_id, xfer_prp, buf, dims); -} - + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal + * Wednesday, August 4, 1999 + * HISTORY + * Added 1.8 parameter: dapl_id + * SOURCE +*/ int_f -nh5dread_double_4_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf, hsize_t_f *dims) - +h5dopen_c(hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *dapl_id, hid_t_f *dset_id) +/******/ { - /* - * Call h5dread_c function. - */ - return nh5dread_c(dset_id, mem_type_id, mem_space_id, file_space_id, xfer_prp, buf, dims); -} - -int_f -nh5dread_double_5_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf, hsize_t_f *dims) + char *c_name = NULL; + hid_t c_dset_id; + int ret_value = -1; -{ /* - * Call h5dread_c function. + * Convert FORTRAN name to C name */ - return nh5dread_c(dset_id, mem_type_id, mem_space_id, file_space_id, xfer_prp, buf, dims); -} - -int_f -nh5dread_double_6_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf, hsize_t_f *dims) + if(NULL == (c_name = (char *)HD5f2cstring(name, (size_t)*namelen))) + goto DONE; -{ /* - * Call h5dread_c function. + * Call H5Dopen2 function. */ - return nh5dread_c(dset_id, mem_type_id, mem_space_id, file_space_id, xfer_prp, buf, dims); -} + if((c_dset_id = H5Dopen2((hid_t)*loc_id, c_name, (hid_t)*dapl_id)) < 0) + goto DONE; -int_f -nh5dread_double_7_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf, hsize_t_f *dims) + *dset_id = (hid_t_f)c_dset_id; + ret_value = 0; -{ - /* - * Call h5dread_c function. - */ - return nh5dread_c(dset_id, mem_type_id, mem_space_id, file_space_id, xfer_prp, buf, dims); +DONE: + if(c_name) + HDfree(c_name); + return ret_value; } -/****if* H5Df/h5dread_ref_obj_c +/****if* H5Df/h5dwrite_ref_reg_c * NAME - * h5dread_ref_obj_c + * h5dwrite_ref_reg_c * PURPOSE - * Call H5Dread to read a dataset of object references + * Call H5Dwrite to write a dataset of dataset region references * INPUTS - * dset_id - dataset identifier - * mem_type_id - memory datatype identifier - * mem_space_id - memory dataspace identifier - * file_space_id - memory dataspace identifier - * xfer_pr - identifier of transfer property list - * buf - data buffer to store references to the objects. - * n - number of references to be stored. + * dset_id - dataset identifier + * mem_type_id - memory datatype identifier + * mem_space_id - memory dataspace identifier + * file_space_id - memory dataspace identifier + * xfer_pr - identifier of transfer property list + * buf - data buffer with references to the objects. + * n - number of references to be stored. * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * Wednesday, May 15, 2002 + * Tuesday, May 14, 2002 * HISTORY - * This function was added to accomodate h5dread_f subroutine - * with the dims parameter being of INTEGER(HSIZE_T_F) size. + * This function was added to accomodate h5dwrite_f with the + * dims argument being of INTEGER(HSIZE_T) type * SOURCE */ int_f -nh5dread_ref_obj_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, haddr_t_f * buf, hsize_t_f *dims) +h5dwrite_ref_reg_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, int_f *buf, hsize_t_f *dims) /******/ { - int ret_value = -1; - herr_t ret = -1; - hid_t c_dset_id; - hid_t c_mem_type_id; - hid_t c_mem_space_id; - hid_t c_file_space_id; - hid_t c_xfer_prp; - hobj_ref_t *buf_c = NULL; - hsize_t i,n; - - /* - * Define transfer property - */ - c_xfer_prp = (hid_t)*xfer_prp; - - /* - * Allocate temporary buffer. - */ - n = (hsize_t)*dims; - buf_c = (hobj_ref_t*)HDmalloc(sizeof(hobj_ref_t)*(size_t)n); - if ( buf_c != NULL ) { - /* - * Call H5Dread function. - */ - 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; - c_file_space_id = (hid_t)*file_space_id; - ret = H5Dread(c_dset_id, c_mem_type_id, c_mem_space_id, c_file_space_id, c_xfer_prp, buf_c); - if (ret >=0) { - for (i = 0; i < n; i++) - HDmemcpy(&buf[i], &buf_c[i], sizeof(haddr_t)); - } - if ( buf_c != NULL ) HDfree(buf_c); - } - if (ret < 0) return ret_value; - ret_value = 0; - return ret_value; + int ret_value = -1; + herr_t ret; + hid_t c_dset_id; + hid_t c_mem_type_id; + hid_t c_mem_space_id; + hid_t c_file_space_id; + hid_t c_xfer_prp; + hdset_reg_ref_t *buf_c = NULL; + unsigned int i, n; + + n = (unsigned int)*dims; + /* + * Define transfer property + */ + c_xfer_prp = (hid_t)*xfer_prp; + + /* + * Allocate temporary buffer and copy references from Fortran. + */ + buf_c = (hdset_reg_ref_t *)HDmalloc(sizeof(hdset_reg_ref_t)*n); + if ( buf_c != NULL ) { + for (i = 0; i < n; i++) { + HDmemcpy(&buf_c[i], buf, H5R_DSET_REG_REF_BUF_SIZE); + buf = buf + REF_REG_BUF_LEN_F; + } + } + else return ret_value; + + + /* + * Call H5Dwrite function. + */ + 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; + c_file_space_id = (hid_t)*file_space_id; + ret = H5Dwrite(c_dset_id, c_mem_type_id, c_mem_space_id, c_file_space_id, c_xfer_prp, buf_c); + HDfree(buf_c); + if (ret < 0) return ret_value; + ret_value = 0; + return ret_value; } /****if* H5Df/h5dread_ref_reg_c @@ -1247,25 +204,25 @@ nh5dread_ref_obj_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_i * PURPOSE * Call H5Dread to read a dataset of dataset region references * INPUTS - * dset_id - dataset identifier - * mem_type_id - memory datatype identifier - * mem_space_id - memory dataspace identifier - * file_space_id - memory dataspace identifier - * xfer_pr - identifier of transfer property list - * buf - data buffer to store references to the objects. - * n - number of references to be stored. + * dset_id - dataset identifier + * mem_type_id - memory datatype identifier + * mem_space_id - memory dataspace identifier + * file_space_id - memory dataspace identifier + * xfer_pr - identifier of transfer property list + * buf - data buffer to store references to the objects. + * n - number of references to be stored. * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * Wednesday, May 15, 2002 + * Wednesday, May 15, 2002 * HISTORY - * This function was added to accomodate h5dread_f subroutine - * with the dims parameter being of INTEGER(HSIZE_T_F) size. + * This function was added to accomodate h5dread_f subroutine + * with the dims parameter being of INTEGER(HSIZE_T_F) size. * SOURCE */ int_f -nh5dread_ref_reg_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, int_f * buf, hsize_t_f *dims) +h5dread_ref_reg_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, int_f * buf, hsize_t_f *dims) /******/ { int ret_value = -1; @@ -1317,19 +274,19 @@ nh5dread_ref_reg_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_i * PURPOSE * Call H5Dclose to close a dataset * INPUTS - * dset_id - identifier of the dataset to be closed + * dset_id - identifier of the dataset to be closed * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * Wednesday, August 4, 1999 + * Wednesday, August 4, 1999 * HISTORY * * SOURCE */ int_f -nh5dclose_c ( hid_t_f *dset_id ) +h5dclose_c ( hid_t_f *dset_id ) /******/ { int ret_value = 0; @@ -1345,21 +302,21 @@ nh5dclose_c ( hid_t_f *dset_id ) * PURPOSE * Call H5Dget_space to obtain dataspace of a dataset * INPUTS - * dset_id - identifier of the dataset + * dset_id - identifier of the dataset * OUTPUTS - * space_id - identifier of the dataset's dataspace + * space_id - identifier of the dataset's dataspace * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * Thursday, August 19, 1999 + * Thursday, August 19, 1999 * HISTORY * * SOURCE */ int_f -nh5dget_space_c ( hid_t_f *dset_id , hid_t_f *space_id) +h5dget_space_c ( hid_t_f *dset_id , hid_t_f *space_id) /******/ { int ret_value = -1; @@ -1380,21 +337,21 @@ nh5dget_space_c ( hid_t_f *dset_id , hid_t_f *space_id) * PURPOSE * Call H5Dget_type to obtain datatype of a dataset * INPUTS - * dset_id - identifier of the dataset + * dset_id - identifier of the dataset * OUTPUTS - * type_id - identifier of the dataset's datatype + * type_id - identifier of the dataset's datatype * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * Thursday, August 19, 1999 + * Thursday, August 19, 1999 * HISTORY * * SOURCE */ int_f -nh5dget_type_c ( hid_t_f *dset_id , hid_t_f *type_id) +h5dget_type_c ( hid_t_f *dset_id , hid_t_f *type_id) /******/ { int ret_value = -1; @@ -1416,23 +373,23 @@ nh5dget_type_c ( hid_t_f *dset_id , hid_t_f *type_id) * h5dget_create_plist_c * PURPOSE * Call H5Dget_create_plist to obtain creation property list - * of a dataset + * of a dataset * INPUTS - * dset_id - identifier of the dataset + * dset_id - identifier of the dataset * OUTPUTS - * plist_id - identifier of he dataset creation property list + * plist_id - identifier of he dataset creation property list * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * Thursday, August 19, 1999 + * Thursday, August 19, 1999 * HISTORY * * SOURCE */ int_f -nh5dget_create_plist_c ( hid_t_f *dset_id , hid_t_f *plist_id) +h5dget_create_plist_c ( hid_t_f *dset_id , hid_t_f *plist_id) /******/ { int ret_value = -1; @@ -1456,24 +413,24 @@ nh5dget_create_plist_c ( hid_t_f *dset_id , hid_t_f *plist_id) * PURPOSE * Call H5Dset_extent to extend dataset with unlimited dimensions * INPUTS - * dset_id - identifier of the dataset + * dset_id - identifier of the dataset * OUTPUTS - * dims - array with the dimension sizes + * dims - array with the dimension sizes * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * Thursday, August 19, 1999 + * Thursday, August 19, 1999 * * HISTORY - * Changed name from the now obsolete h5dextend - * to h5dset_extent in order to match new fortran interface. + * Changed name from the now obsolete h5dextend + * to h5dset_extent in order to match new fortran interface. * -MSB- March 14, 2008 * SOURCE */ int_f -nh5dset_extent_c ( hid_t_f *dset_id , hsize_t_f *dims) +h5dset_extent_c ( hid_t_f *dset_id , hsize_t_f *dims) /******/ { hid_t c_space_id; @@ -1503,28 +460,28 @@ nh5dset_extent_c ( hid_t_f *dset_id , hsize_t_f *dims) return ret_value; } -/****if* H5Df/nh5dget_storage_size_c +/****if* H5Df/h5dget_storage_size_c * NAME - * nh5dget_storage_size_c + * h5dget_storage_size_c * PURPOSE * Call H5Dget_storage_size to return the amount of storage - * required for a dataset + * required for a dataset * INPUTS - * dset_id - identifier of the dataset + * dset_id - identifier of the dataset * OUTPUTS - * size - the amount of storage required for a dataset + * size - the amount of storage required for a dataset * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * Tuesday, October 22, 2002 + * Tuesday, October 22, 2002 * HISTORY * * SOURCE */ int_f -nh5dget_storage_size_c ( hid_t_f *dset_id , hsize_t_f *size) +h5dget_storage_size_c ( hid_t_f *dset_id , hsize_t_f *size) /******/ { int ret_value = -1; @@ -1539,29 +496,29 @@ nh5dget_storage_size_c ( hid_t_f *dset_id , hsize_t_f *size) return ret_value; } -/****if* H5Df/nh5dvlen_get_max_len_c +/****if* H5Df/h5dvlen_get_max_len_c * NAME - * nh5dvlen_get_max_len_c + * h5dvlen_get_max_len_c * PURPOSE * Get the maximum size of the VL dataset element * INPUTS - * dset_id - identifier of the dataset - * type_id - datatype identifier - * space_id - dataspace identifier + * dset_id - identifier of the dataset + * type_id - datatype identifier + * space_id - dataspace identifier * OUTPUTS - * len - maximum length of the VL dataset element + * len - maximum length of the VL dataset element * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * Tuesday, October 22, 2002 + * Tuesday, October 22, 2002 * HISTORY * * SOURCE */ int_f -nh5dvlen_get_max_len_c ( hid_t_f *dset_id , hid_t_f *type_id, hid_t_f *space_id, size_t_f *len) +h5dvlen_get_max_len_c ( hid_t_f *dset_id , hid_t_f *type_id, hid_t_f *space_id, size_t_f *len) /******/ { int ret_value = -1; @@ -1597,34 +554,34 @@ DONE: HDfree(c_buf); return ret_value; } -/****if* H5Df/nh5dwrite_vl_integer_c +/****if* H5Df/h5dwrite_vl_integer_c * NAME - * nh5dwrite_vl_integer_c + * h5dwrite_vl_integer_c * PURPOSE * Write variable length dataset * INPUTS - * dset_id - identifier of the dataset - * mem_type_id - datatype identifier - * mem_space_id - dataspace identifier - * file_space_id - file dataspace identifier - * xfer - file transfer property - * buf - data buffer - * dims - one-demnsional array of size 2 - * dims[0] = MAXLENGTH - * dims[1] = number of elements of VL type - * len - array element lenghts + * dset_id - identifier of the dataset + * mem_type_id - datatype identifier + * mem_space_id - dataspace identifier + * file_space_id - file dataspace identifier + * xfer - file transfer property + * buf - data buffer + * dims - one-demnsional array of size 2 + * dims[0] = MAXLENGTH + * dims[1] = number of elements of VL type + * len - array element lenghts * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * Wednesday, October 23, 2002 + * Wednesday, October 23, 2002 * HISTORY * * SOURCE */ int_f -nh5dwrite_vl_integer_c ( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, int_f *buf, hsize_t_f *dims, size_t_f *len) +h5dwrite_vl_integer_c ( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, int_f *buf, hsize_t_f *dims, size_t_f *len) /******/ { int ret_value = -1; @@ -1670,35 +627,35 @@ DONE: return ret_value; } -/****if* H5Df/nh5dread_vl_integer_c +/****if* H5Df/h5dread_vl_integer_c * NAME - * nh5dread_vl_integer_c + * h5dread_vl_integer_c * PURPOSE * Read variable length dataset * INPUTS - * dset_id - identifier of the dataset - * mem_type_id - datatype identifier - * mem_space_id - dataspace identifier - * file_space_id - file dataspace identifier - * xfer - file transfer property - * dims - one-demnsional array of size 2 - * dims[0] = MAXLENGTH - * dims[1] = number of elements of VL type + * dset_id - identifier of the dataset + * mem_type_id - datatype identifier + * mem_space_id - dataspace identifier + * file_space_id - file dataspace identifier + * xfer - file transfer property + * dims - one-demnsional array of size 2 + * dims[0] = MAXLENGTH + * dims[1] = number of elements of VL type * OUTPUTS - * buf - data buffer - * len - array element lenghts + * buf - data buffer + * len - array element lenghts * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * Wednesday, October 24, 2002 + * Wednesday, October 24, 2002 * HISTORY * * SOURCE */ int_f -nh5dread_vl_integer_c ( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, int_f *buf, hsize_t_f *dims, size_t_f *len) +h5dread_vl_integer_c ( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, int_f *buf, hsize_t_f *dims, size_t_f *len) /******/ { int ret_value = -1; @@ -1742,33 +699,33 @@ DONE: return ret_value; } -/****if* H5Df/nh5dwrite_vl_string_c +/****if* H5Df/h5dwrite_vl_string_c * NAME - * nh5dwrite_vl_string_c + * h5dwrite_vl_string_c * PURPOSE * Write variable length strings from Fortran program * INPUTS - * dset_id - identifier of the dataset - * mem_type_id - datatype identifier - * mem_space_id - dataspace identifier - * file_space_id - file dataspace identifier - * xfer - file transfer property - * buf - data buffer - * dims - one-demnsional array of size 2 - * dims[0] = number of strings of size max_len - * len - array of strings lengths + * dset_id - identifier of the dataset + * mem_type_id - datatype identifier + * mem_space_id - dataspace identifier + * file_space_id - file dataspace identifier + * xfer - file transfer property + * buf - data buffer + * dims - one-demnsional array of size 2 + * dims[0] = number of strings of size max_len + * len - array of strings lengths * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * Monday, October 28, 2002 + * Monday, October 28, 2002 * HISTORY * * SOURCE */ int_f -nh5dwrite_vl_string_c( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, _fcd buf, hsize_t_f *dims, size_t_f *len) +h5dwrite_vl_string_c( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, _fcd buf, hsize_t_f *dims, size_t_f *len) /******/ { int ret_value = -1; @@ -1829,33 +786,33 @@ DONE: HDfree(tmp); return ret_value; } -/****if* H5Df/nh5dread_vl_string_c +/****if* H5Df/h5dread_vl_string_c * NAME - * nh5dread_vl_string_c + * h5dread_vl_string_c * PURPOSE * Read variable length strings from Fortran program * INPUTS - * dset_id - identifier of the dataset - * mem_type_id - datatype identifier - * mem_space_id - dataspace identifier - * file_space_id - file dataspace identifier - * xfer - file transfer property - * dims - one-demnsional array of size 2 - * dims[0] = number of strings of size max_len - * Output: buf - data buffer - * len - array of strings lengths + * dset_id - identifier of the dataset + * mem_type_id - datatype identifier + * mem_space_id - dataspace identifier + * file_space_id - file dataspace identifier + * xfer - file transfer property + * dims - one-demnsional array of size 2 + * dims[0] = number of strings of size max_len + * Output: buf - data buffer + * len - array of strings lengths * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * Friday, November 1, 2002 + * Friday, November 1, 2002 * HISTORY * * SOURCE */ int_f -nh5dread_vl_string_c( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, _fcd buf, hsize_t_f *dims, size_t_f *len) +h5dread_vl_string_c( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, _fcd buf, hsize_t_f *dims, size_t_f *len) /******/ { int ret_value = -1; @@ -1912,34 +869,34 @@ nh5dread_vl_string_c( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_spa return ret_value; } -/****if* H5Df/nh5dwrite_vl_real_c +/****if* H5Df/h5dwrite_vl_real_c * NAME - * nh5dwrite_vl_real_c + * h5dwrite_vl_real_c * PURPOSE * Write variable length dataset * INPUTS - * dset_id - identifier of the dataset - * mem_type_id - datatype identifier - * mem_space_id - dataspace identifier - * file_space_id - file dataspace identifier - * xfer - file transfer property - * buf - data buffer - * dims - one-demnsional array of size 2 - * dims[0] = MAXLENGTH - * dims[1] = number of elements of VL type - * len - array element lenghts + * dset_id - identifier of the dataset + * mem_type_id - datatype identifier + * mem_space_id - dataspace identifier + * file_space_id - file dataspace identifier + * xfer - file transfer property + * buf - data buffer + * dims - one-demnsional array of size 2 + * dims[0] = MAXLENGTH + * dims[1] = number of elements of VL type + * len - array element lenghts * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * Monday, November 11, 2002 + * Monday, November 11, 2002 * HISTORY * * SOURCE */ int_f -nh5dwrite_vl_real_c ( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, real_f *buf, hsize_t_f *dims, size_t_f *len) +h5dwrite_vl_real_c ( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, real_f *buf, hsize_t_f *dims, size_t_f *len) /******/ { int ret_value = -1; @@ -1985,35 +942,35 @@ DONE: return ret_value; } -/****if* H5Df/nh5dread_vl_real_c +/****if* H5Df/h5dread_vl_real_c * NAME - * nh5dread_vl_real_c + * h5dread_vl_real_c * PURPOSE * Read variable length dataset * INPUTS - * dset_id - identifier of the dataset - * mem_type_id - datatype identifier - * mem_space_id - dataspace identifier - * file_space_id - file dataspace identifier - * xfer - file transfer property - * dims - one-demnsional array of size 2 - * dims[0] = MAXLENGTH - * dims[1] = number of elements of VL type + * dset_id - identifier of the dataset + * mem_type_id - datatype identifier + * mem_space_id - dataspace identifier + * file_space_id - file dataspace identifier + * xfer - file transfer property + * dims - one-demnsional array of size 2 + * dims[0] = MAXLENGTH + * dims[1] = number of elements of VL type * OUTPUTS - * buf - data buffer - * len - array element lenghts + * buf - data buffer + * len - array element lenghts * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * Monday, November 11, 2002 + * Monday, November 11, 2002 * HISTORY * * SOURCE */ int_f -nh5dread_vl_real_c ( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, real_f *buf, hsize_t_f *dims, size_t_f *len) +h5dread_vl_real_c ( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, real_f *buf, hsize_t_f *dims, size_t_f *len) /******/ { int ret_value = -1; @@ -2058,39 +1015,6 @@ DONE: return ret_value; } -/****if* H5Df/h5dfillc_c - * NAME - * h5dfillc_c - * PURPOSE - * Call h5fill_c to fill memory buffer with a fill value - * INPUTS - * fill_value - fill value - * fill_type_id - fill value datatype identifier - * space_id - memory space selection identifier - * buf - memory buffer to fill - * mem_type_id - memory buffer dtatype identifier - * RETURNS - * 0 on success, -1 on failure - * AUTHOR - * Elena Pourmal - * Wednesday, March 12, 2003 - * HISTORY - * - * SOURCE -*/ -int_f -nh5dfillc_c (_fcd fill_value, hid_t_f *fill_type_id, hid_t_f *space_id, _fcd buf, hid_t_f *mem_type_id) -/******/ -{ - int ret_value = -1; - - /* - * Call h5dfill_c function. - */ - ret_value = h5dfill_c(_fcdtocp(fill_value), fill_type_id, space_id, _fcdtocp(buf), mem_type_id); - - return ret_value; -} /****if* H5Df/h5dfill_c * NAME * h5dfill_c @@ -2135,98 +1059,26 @@ h5dfill_c (void * fill_value, hid_t_f *fill_type_id, hid_t_f *space_id, void * b return ret_value; } -int_f -nh5dfill_integer_c (void * fill_value, hid_t_f *fill_type_id, hid_t_f *space_id, void * buf, hid_t_f *mem_type_id) - -{ - int ret_value = -1; - herr_t ret; - hid_t c_fill_type_id; - hid_t c_mem_type_id; - hid_t c_space_id; - - c_fill_type_id = (hid_t)*fill_type_id; - c_mem_type_id = (hid_t)*mem_type_id; - c_space_id = (hid_t)*space_id; - - /* - * Call H5Dfill function. - */ - ret = H5Dfill(fill_value, c_fill_type_id, buf, c_mem_type_id, c_space_id); - - if (ret < 0) return ret_value; - ret_value = 0; - return ret_value; -} - -int_f -nh5dfill_real_c (void * fill_value, hid_t_f *fill_type_id, hid_t_f *space_id, void * buf, hid_t_f *mem_type_id) - -{ - int ret_value = -1; - herr_t ret; - hid_t c_fill_type_id; - hid_t c_mem_type_id; - hid_t c_space_id; - - c_fill_type_id = (hid_t)*fill_type_id; - c_mem_type_id = (hid_t)*mem_type_id; - c_space_id = (hid_t)*space_id; - - /* - * Call H5Dfill function. - */ - ret = H5Dfill(fill_value, c_fill_type_id, buf, c_mem_type_id, c_space_id); - - if (ret < 0) return ret_value; - ret_value = 0; - return ret_value; -} - -int_f -nh5dfill_double_c (void * fill_value, hid_t_f *fill_type_id, hid_t_f *space_id, void * buf, hid_t_f *mem_type_id) - -{ - int ret_value = -1; - herr_t ret; - hid_t c_fill_type_id; - hid_t c_mem_type_id; - hid_t c_space_id; - - c_fill_type_id = (hid_t)*fill_type_id; - c_mem_type_id = (hid_t)*mem_type_id; - c_space_id = (hid_t)*space_id; - - /* - * Call H5Dfill function. - */ - ret = H5Dfill(fill_value, c_fill_type_id, buf, c_mem_type_id, c_space_id); - - if (ret < 0) return ret_value; - ret_value = 0; - return ret_value; -} - /****if* H5Df/h5dget_space_status_c * NAME * h5dget_space_status_c * PURPOSE * Call H5Dget_space_status to request dataspace allocation status * INPUTS - * dset_id - dataset identifier + * dset_id - dataset identifier * OUTPUTS - * flag - status flag + * flag - status flag * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * Wednesday, March 12, 2003 + * Wednesday, March 12, 2003 * HISTORY * * SOURCE */ int_f -nh5dget_space_status_c ( hid_t_f *dset_id, int_f *flag) +h5dget_space_status_c ( hid_t_f *dset_id, int_f *flag) /******/ { int ret_value = -1; @@ -2256,21 +1108,21 @@ nh5dget_space_status_c ( hid_t_f *dset_id, int_f *flag) * loc_id - Identifier of the file or group within which to create the dataset. * type_id - Identifier of the datatype to use when creating the dataset. * space_id - Identifier of the dataspace to use when creating the dataset. - * dcpl_id - Dataset creation property list identifier. - * dapl_id - Dataset access property list identifier. + * dcpl_id - Dataset creation property list identifier. + * dapl_id - Dataset access property list identifier. * OUTPUTS * - * dset_id - dataset identifier + * dset_id - dataset identifier * * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * M. Scot Breitenfeld - * February, 2008 + * February, 2008 * SOURCE */ int_f -nh5dcreate_anon_c (hid_t_f *loc_id, hid_t_f *type_id, hid_t_f *space_id, +h5dcreate_anon_c (hid_t_f *loc_id, hid_t_f *type_id, hid_t_f *space_id, hid_t_f *dcpl_id, hid_t_f *dapl_id, hid_t_f *dset_id) /******/ { @@ -2355,8 +1207,8 @@ h5dwrite_f_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, * file_space_id - file dataspace identifier * xfer - file transfer property * dims - one-demnsional array of size 2 - * dims[0] = MAXLENGTH - * dims[1] = number of elements of VL type + * dims[0] = MAXLENGTH + * dims[1] = number of elements of VL type * OUTPUTS * buf - data buffer * len - array element lenghts @@ -2396,9 +1248,9 @@ h5dread_f_c ( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_space_id, ret_value = 0; return ret_value; } -/****if* H5Df/nh5dget_access_plist_c +/****if* H5Df/h5dget_access_plist_c * NAME - * nh5dget_access_plist_c + * h5dget_access_plist_c * PURPOSE * Call H5Dget_access_plist * INPUTS @@ -2414,7 +1266,7 @@ h5dread_f_c ( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_space_id, * SOURCE */ int_f -nh5dget_access_plist_c (hid_t_f *dset_id, hid_t_f *plist_id) +h5dget_access_plist_c (hid_t_f *dset_id, hid_t_f *plist_id) /******/ { int ret_value = -1; @@ -2430,22 +1282,22 @@ nh5dget_access_plist_c (hid_t_f *dset_id, hid_t_f *plist_id) return ret_value; } -/****if* H5Df/nh5dvlen_reclaim_c +/****if* H5Df/h5dvlen_reclaim_c * NAME * h5dvlen_reclaim_c * PURPOSE * Call H5Dvlen_reclaim * INPUTS - * type_id - Identifier of the datatype. - * space_id - Identifier of the dataspace. - * plist_id - Identifier of the property list used to create the buffer. - * buf - Pointer to the buffer to be reclaimed. + * type_id - Identifier of the datatype. + * space_id - Identifier of the dataspace. + * plist_id - Identifier of the property list used to create the buffer. + * buf - Pointer to the buffer to be reclaimed. * * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * M. Scot Breitenfeld - * January 15, 2011 + * January 15, 2011 * * SOURCE */ diff --git a/fortran/src/H5Dff.F90 b/fortran/src/H5Dff.F90 new file mode 100644 index 0000000..afdb5ba --- /dev/null +++ b/fortran/src/H5Dff.F90 @@ -0,0 +1,1878 @@ +!****h* ROBODoc/H5D +! +! NAME +! MODULE H5D +! +! FILE +! fortran/src/H5Dff.f90 +! +! PURPOSE +! This file contains Fortran interfaces for H5D functions. +! +! 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. * +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! +! NOTES +! (1) The maximum rank of an array allowed in Fortran is 7, therefore +! we only provide an interface for arrays up to and including rank 7. +! +! (2) Unfortunately we are using a generic interface and one of the factors +! used in determining the proper routine to select is that of the array +! rank being passed. Therefore, we can not create just one subroutine for +! each array type (integer, real, etc...) and use a +! rank 1 array of assumed size to handle multiple ranks, i.e. +! (i.e. integer, dimension(*) :: ... ) +! (i.e. real , dimension(*) :: ... ) etc... +! +! (3) Could not place the USE, INTRINSIC :: ISO_C_BINDING in the module header because it may +! conflict with the USE, INTRINSIC :: ISO_C_BINDING included in the user's program. Moved +! the statement instead to each subroutine. +! +! +! (4) C_LOC and character strings according to the Fortran 2003 standard: +! +! 15.1.2.5 C_LOC(X) +! +! Argument. X shall either +! +! (A) have interoperable type and type parameters and be +! (a) a variable that has the TARGET attribute and is interoperable, +! (b) an allocated allocatable variable that has the TARGET attribute +! and is not an array of zero size, or +! (c) an associated scalar pointer, or +! (B) be a nonpolymorphic scalar, have no length type parameters, and be +! (a) a nonallocatable, nonpointer variable that has the TARGET attribute, +! (b) an allocated allocatable variable that has the TARGET attribute, or +! (c) an associated pointer. +! +! - When X is a character, for interoperability the standard is: +! +! 15.2.1 Interoperability of intrinsic types +! +! ...if the type is character, interoperability also requires that the length type parameter +! be omitted or be specified by an initialization expression whose value is one. +! +! THEREFORE compilers that have not extended the standard require the +! argument in C_LOC to be of the variant: +! +! CHARACTER(LEN=1), TARGET :: chr +! or +! CHARACTER, TARGET :: chr +! +! _____ __ __ _____ ____ _____ _______ _ _ _______ +! |_ _| \/ | __ \ / __ \| __ \__ __|/\ | \ | |__ __| +! **** | | | \ / | |__) | | | | |__) | | | / \ | \| | | | **** +! **** | | | |\/| | ___/| | | | _ / | | / /\ \ | . ` | | | **** +! **** _| |_| | | | | | |__| | | \ \ | |/ ____ \| |\ | | | **** +! |_____|_| |_|_| \____/|_| \_\ |_/_/ \_\_| \_| |_| +! +! If you add a new H5D function you must add the function name to the +! Windows dll file 'hdf5_fortrandll.def.in' in the fortran/src directory. +! This is needed for Windows based operating systems. +! +!***** + +#include + +MODULE H5D + + USE, INTRINSIC :: ISO_C_BINDING + USE H5GLOBAL + + INTERFACE h5dextend_f + MODULE PROCEDURE h5dset_extent_f + END INTERFACE + + INTERFACE h5dread_vl_f + MODULE PROCEDURE h5dread_vl_integer + MODULE PROCEDURE h5dread_vl_real + MODULE PROCEDURE h5dread_vl_string + END INTERFACE + + INTERFACE h5dwrite_vl_f + MODULE PROCEDURE h5dwrite_vl_integer + MODULE PROCEDURE h5dwrite_vl_real + MODULE PROCEDURE h5dwrite_vl_string + END INTERFACE + + INTERFACE h5dwrite_f + MODULE PROCEDURE h5dwrite_reference_obj + MODULE PROCEDURE h5dwrite_reference_dsetreg + MODULE PROCEDURE h5dwrite_char_scalar + ! This is the preferred way to call h5dwrite + ! by passing an address + MODULE PROCEDURE h5dwrite_ptr + END INTERFACE + + INTERFACE h5dread_f + MODULE PROCEDURE h5dread_reference_obj + MODULE PROCEDURE h5dread_reference_dsetreg + MODULE PROCEDURE h5dread_char_scalar + ! This is the preferred way to call h5dread + ! by passing an address + MODULE PROCEDURE h5dread_ptr + + END INTERFACE + + +! Interface for the function used to pass the C pointer of the buffer +! to the C H5Dwrite routine + + INTERFACE + INTEGER FUNCTION h5dwrite_f_c(dset_id, mem_type_id, & + mem_space_id_default , & + file_space_id_default, & + xfer_prp_default, buf ) BIND(C, NAME='h5dwrite_f_c') + IMPORT :: c_ptr + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id + INTEGER(HID_T), INTENT(IN) :: mem_type_id + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + INTEGER(HID_T) :: xfer_prp_default + TYPE(C_PTR), VALUE :: buf + END FUNCTION h5dwrite_f_c + END INTERFACE + +! Interface for the function used to pass the C pointer of the buffer +! to the C H5Dread routine + + INTERFACE + INTEGER FUNCTION h5dread_f_c(dset_id, mem_type_id, & + mem_space_id_default, & + file_space_id_default, & + xfer_prp_default, buf) BIND(C, NAME='h5dread_f_c') + IMPORT :: c_ptr + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id + INTEGER(HID_T), INTENT(IN) :: mem_type_id + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + INTEGER(HID_T) :: xfer_prp_default + TYPE(C_PTR), VALUE :: buf + END FUNCTION h5dread_f_c + END INTERFACE + + INTERFACE h5dfill_f + MODULE PROCEDURE h5dfill_integer + MODULE PROCEDURE h5dfill_c_float + MODULE PROCEDURE h5dfill_c_double +#ifdef H5_FORTRAN_HAVE_C_LONG_DOUBLE + MODULE PROCEDURE h5dfill_c_long_double +#endif + MODULE PROCEDURE h5dfill_char + END INTERFACE + +! Interface for the function used to pass the C pointer of the buffer +! to the C H5Dfill routine + + INTERFACE + INTEGER FUNCTION h5dfill_c(f_ptr_fill_value, fill_type_id, space_id, & + f_ptr_buf, mem_type_id) BIND(C, NAME='h5dfill_c') + IMPORT :: c_ptr + IMPORT :: HID_T + IMPLICIT NONE + TYPE(C_PTR), VALUE :: f_ptr_fill_value + INTEGER(HID_T) :: fill_type_id ! Fill value datatype identifier + INTEGER(HID_T), INTENT(IN) :: space_id ! Memory dataspace selection identifier + TYPE(C_PTR), VALUE :: f_ptr_buf + INTEGER(HID_T) :: mem_type_id + END FUNCTION h5dfill_c + END INTERFACE + +CONTAINS + +! +!****s* H5D/h5dcreate_f +! +! NAME +! h5dcreate_f +! +! PURPOSE +! Creates a dataset at the specified location +! +! INPUTS +! loc_id - file or group identifier +! name - dataset name +! type_id - dataset datatype identifier +! space_id - dataset dataspace identifier +! OUTPUTS +! dset_id - dataset identifier +! hdferr - Returns 0 if successful and -1 if fails +! OPTIONAL PARAMETERS +! creation_prp - Dataset creation property list +! lcpl_id - Link creation property list +! dapl_id - Dataset access property list +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! +! - Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). February 28, 2001 +! +! - Added version's 1.8 new optional parameters +! February, 2008 +! +! SOURCE + SUBROUTINE h5dcreate_f(loc_id, name, type_id, space_id, dset_id, & + hdferr, dcpl_id, lcpl_id, dapl_id) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier + CHARACTER(LEN=*), INTENT(IN) :: name ! Name of the dataset + INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier + INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier + INTEGER(HID_T), INTENT(OUT) :: dset_id ! Dataset identifier + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: dcpl_id ! Dataset creation property list + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lcpl_id ! Link creation property list + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: dapl_id ! Dataset access property list + + INTEGER(HID_T) :: lcpl_id_default + INTEGER(HID_T) :: dcpl_id_default + INTEGER(HID_T) :: dapl_id_default + + INTEGER :: namelen ! Name length + + INTERFACE + INTEGER FUNCTION h5dcreate_c(loc_id, name, namelen, type_id, & + space_id, lcpl_id_default, dcpl_id_default, dapl_id_default, dset_id) & + BIND(C,NAME='h5dcreate_c') + IMPORT :: C_CHAR + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: name + INTEGER :: namelen + INTEGER(HID_T), INTENT(IN) :: type_id + INTEGER(HID_T), INTENT(IN) :: space_id + + INTEGER(HID_T) :: lcpl_id_default + INTEGER(HID_T) :: dcpl_id_default + INTEGER(HID_T) :: dapl_id_default + + INTEGER(HID_T), INTENT(OUT) :: dset_id + END FUNCTION h5dcreate_c + END INTERFACE + + lcpl_id_default = H5P_DEFAULT_F + dcpl_id_default = H5P_DEFAULT_F + dapl_id_default = H5P_DEFAULT_F + + IF(PRESENT(lcpl_id)) lcpl_id_default = lcpl_id + IF(PRESENT(dcpl_id)) dcpl_id_default = dcpl_id + IF(PRESENT(dapl_id)) dapl_id_default = dapl_id + + namelen = LEN(name) + hdferr = h5dcreate_c(loc_id, name, namelen, type_id, space_id, & + lcpl_id_default, dcpl_id_default, dapl_id_default, dset_id) + + END SUBROUTINE h5dcreate_f + +! +!****s* H5D/h5dopen_f +! +! NAME +! h5dopen_f +! +! PURPOSE +! Opens an existing dataset. +! +! INPUTS +! loc_id - file or group identifier +! name - dataset name +! OUTPUTS +! dset_id - dataset identifier +! hdferr - Returns 0 if successful and -1 if fails +! OPTIONAL PARAMETERS +! dapl_id - Dataset access property list +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! -Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). February 28, 2001 +! +! -Added 1.8 (optional) parameter dapl_id +! February, 2008, M. Scot Breitenfeld +! +! SOURCE + SUBROUTINE h5dopen_f(loc_id, name, dset_id, hdferr, dapl_id) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier + CHARACTER(LEN=*), INTENT(IN) :: name ! Name of the dataset + INTEGER(HID_T), INTENT(OUT) :: dset_id ! Dataset identifier + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: dapl_id ! Dataset access property list +!***** + INTEGER :: namelen ! Name length + + INTEGER(HID_T) :: dapl_id_default + + INTERFACE + INTEGER FUNCTION h5dopen_c(loc_id, name, namelen, dapl_id_default, dset_id) & + BIND(C,NAME='h5dopen_c') + IMPORT :: C_CHAR + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: name + INTEGER :: namelen + INTEGER(HID_T), INTENT(IN) :: dapl_id_default + INTEGER(HID_T), INTENT(OUT) :: dset_id + END FUNCTION h5dopen_c + END INTERFACE + + dapl_id_default = H5P_DEFAULT_F + IF(PRESENT(dapl_id)) dapl_id_default = dapl_id + + namelen = LEN(name) + hdferr = h5dopen_c(loc_id, name, namelen, dapl_id_default, dset_id) + + END SUBROUTINE h5dopen_f + +! +!****s* H5D/h5dclose_f +! +! NAME +! h5dclose_f +! +! PURPOSE +! Closes a dataset. +! +! INPUTS +! dset_id - dataset identifier +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). February 28, 2001 +! +! SOURCE + SUBROUTINE h5dclose_f(dset_id, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + INTERFACE + INTEGER FUNCTION h5dclose_c(dset_id) & + BIND(C,NAME='h5dclose_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id + END FUNCTION h5dclose_c + END INTERFACE + + hdferr = h5dclose_c(dset_id) + + END SUBROUTINE h5dclose_f + +! +!****s* H5D/h5dget_type_f +! +! NAME +! h5dget_type_f +! +! PURPOSE +! Returns an identifier for a copy of the datatype for a +! dataset. +! +! INPUTS +! dataset_id - dataset identifier +! OUTPUTS +! datatype_id - dataspace identifier +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). February 28, 2001 +! +! NOTES +! +! SOURCE + SUBROUTINE h5dget_type_f(dataset_id, datatype_id, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dataset_id ! Dataset identifier + INTEGER(HID_T), INTENT(OUT) :: datatype_id ! Datatype identifier + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + INTERFACE + INTEGER FUNCTION h5dget_type_c(dataset_id, datatype_id) & + BIND(C,NAME='h5dget_type_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dataset_id + INTEGER(HID_T), INTENT(OUT) :: datatype_id + END FUNCTION h5dget_type_c + END INTERFACE + + hdferr = h5dget_type_c (dataset_id, datatype_id) + END SUBROUTINE h5dget_type_f + +! +!****s* H5D/h5dset_extent +! +! NAME +! h5dset_extent (instead of obsolete name: h5dextend_f) +! +! PURPOSE +! Extends a dataset with unlimited dimension. +! +! INPUTS +! dataset_id - dataset identifier +! size - array containing the new magnitude of +! each dimension +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). February 28, 2001 +! +! Changed name from the now obsolete h5dextend_f +! to h5dset_extent_f. Provided interface to old name +! for backward compatability. -MSB- March 14, 2008 +! +! SOURCE + SUBROUTINE h5dset_extent_f(dataset_id, size, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dataset_id ! Dataset identifier + INTEGER(HSIZE_T), DIMENSION(*), INTENT(IN) :: size + ! Array containing + ! dimensions' sizes + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + INTERFACE + INTEGER FUNCTION h5dset_extent_c(dataset_id, size) & + BIND(C,NAME='h5dset_extent_c') + IMPORT :: HID_T, HSIZE_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dataset_id + INTEGER(HSIZE_T), DIMENSION(*), INTENT(IN) :: size + END FUNCTION h5dset_extent_c + END INTERFACE + + hdferr = H5Dset_extent_c(dataset_id, size) + END SUBROUTINE h5dset_extent_f + +!****s* H5D/h5dget_create_plist_f +! +! NAME +! h5dget_create_plist_f +! +! PURPOSE +! Returns an identifier for a copy of the dataset creation +! property list for a dataset. +! +! INPUTS +! dataset_id - dataset identifier +! OUTPUTS +! plist_id - creation property list identifier +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). February 28, 2001 +! SOURCE + SUBROUTINE h5dget_create_plist_f(dataset_id, plist_id, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dataset_id ! Dataset identifier + INTEGER(HID_T), INTENT(OUT) :: plist_id ! Dataset creation + ! property list identifier + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + INTERFACE + INTEGER FUNCTION h5dget_create_plist_c(dataset_id, plist_id) & + BIND(C,NAME='h5dget_create_plist_c') + IMPORT :: HID_T + INTEGER(HID_T), INTENT(IN) :: dataset_id + INTEGER(HID_T), INTENT(OUT) :: plist_id + END FUNCTION h5dget_create_plist_c + END INTERFACE + + hdferr = h5dget_create_plist_c(dataset_id, plist_id) + END SUBROUTINE h5dget_create_plist_f + +! +!****s* H5D/h5dget_storage_size_f +! +! NAME +! h5dget_storage_size_f +! +! PURPOSE +! Returns the amount of storage requires by a dataset +! +! INPUTS +! dataset_id - dataset identifier +! OUTPUTS +! size - datastorage size +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! October 15, 2002 +! SOURCE + SUBROUTINE h5dget_storage_size_f(dataset_id, size, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dataset_id ! Dataset identifier + INTEGER(HSIZE_T), INTENT(OUT) :: size ! Amount of storage + ! allocated for dataset + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + INTERFACE + INTEGER FUNCTION h5dget_storage_size_c(dataset_id, size) & + BIND(C,NAME='h5dget_storage_size_c') + IMPORT :: HID_T, HSIZE_T + INTEGER(HID_T), INTENT(IN) :: dataset_id + INTEGER(HSIZE_T), INTENT(OUT) :: size + END FUNCTION h5dget_storage_size_c + END INTERFACE + + hdferr = h5dget_storage_size_c(dataset_id, size) + END SUBROUTINE h5dget_storage_size_f + +! +!****s* H5D/h5dvlen_get_max_len_f +! +! NAME +! h5dvlen_get_max_len_f +! +! PURPOSE +! Returns maximum length of the VL array elements +! +! INPUTS +! dataset_id - dataset identifier +! type_id - datatype identifier +! space_id - dataspace identifier +! OUTPUTS +! size - buffer size +! hdferr - Returns 0 if successful and -1 if fails +! OPTIONAL PARAMETERS +! NONE +! +! AUTHOR +! Elena Pourmal +! October 15, 2002 +! +! SOURCE + SUBROUTINE h5dvlen_get_max_len_f(dataset_id, type_id, space_id, len, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dataset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier + INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier + INTEGER(SIZE_T), INTENT(OUT) :: len ! Maximum length of the element + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + INTERFACE + INTEGER FUNCTION h5dvlen_get_max_len_c(dataset_id, type_id, space_id, len) & + BIND(C,NAME='h5dvlen_get_max_len_c') + IMPORT :: HID_T, SIZE_T + INTEGER(HID_T), INTENT(IN) :: dataset_id + INTEGER(HID_T), INTENT(IN) :: type_id + INTEGER(HID_T), INTENT(IN) :: space_id + INTEGER(SIZE_T), INTENT(OUT) :: len + END FUNCTION h5dvlen_get_max_len_c + END INTERFACE + + hdferr = h5dvlen_get_max_len_c(dataset_id, type_id, space_id, len) + END SUBROUTINE h5dvlen_get_max_len_f + +! +!****s* H5D/h5dget_space_status_f +! +! NAME +! h5dget_space_status_f +! +! PURPOSE +! Returns the status of data space allocation. +! +! INPUTS +! dset_id - dataset identifier +! OUTPUTS +! flag - status; may have one of the following values: +! H5D_SPACE_STS_ERROR_F +! H5D_SPACE_STS_NOT_ALLOCATED_F +! H5D_SPACE_STS_PART_ALLOCATED_F +! H5D_SPACE_STS_ALLOCATED_F +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! March 12, 2003 +! +! SOURCE + SUBROUTINE h5dget_space_status_f(dset_id, flag, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataspace identifier + INTEGER, INTENT(OUT) :: flag ! Memory buffer to fill in + INTEGER, INTENT(OUT) :: hdferr ! Error code + !***** + INTERFACE + INTEGER FUNCTION h5dget_space_status_c(dset_id, flag) & + BIND(C,NAME='h5dget_space_status_c') + IMPORT :: HID_T + INTEGER(HID_T) :: dset_id + INTEGER :: flag + END FUNCTION h5dget_space_status_c + END INTERFACE + + hdferr = h5dget_space_status_c(dset_id, flag) + END SUBROUTINE h5dget_space_status_f + +! +!****s* H5D/h5dcreate_anon_f +! +! NAME +! h5dcreate_anon_f +! +! PURPOSE +! Creates a dataset in a file without linking it into the file structure +! +! INPUTS +! loc_id - Identifier of the file or group within which to create the dataset. +! type_id - Identifier of the datatype to use when creating the dataset. +! space_id - Identifier of the dataspace to use when creating the dataset. +! OUTPUTS +! dset_id - dataset identifier +! hdferr - Returns 0 if successful and -1 if fails +! OPTIONAL PARAMETERS +! dcpl_id - Dataset creation property list identifier. +! dapl_id - Dataset access property list identifier. +! +! AUTHOR +! M. Scot Breitenfeld +! February 11, 2008 +! +! SOURCE + SUBROUTINE h5dcreate_anon_f(loc_id, type_id, space_id, dset_id, hdferr, dcpl_id, dapl_id) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier. + INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier. + INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier. + INTEGER(HID_T), INTENT(OUT) :: dset_id ! Dataset identifier. + INTEGER, INTENT(OUT) :: hdferr ! Error code. + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: dcpl_id ! Dataset creation property list identifier. + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: dapl_id ! Dataset access property list identifier. +!***** + INTEGER(HID_T) :: dcpl_id_default + INTEGER(HID_T) :: dapl_id_default + + ! + ! MS FORTRAN needs explicit interface for C functions called here. + ! + INTERFACE + INTEGER FUNCTION h5dcreate_anon_c(loc_id, type_id, space_id, dcpl_id_default, dapl_id_default, dset_id) & + BIND(C,NAME='h5dcreate_anon_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id + INTEGER(HID_T), INTENT(IN) :: type_id + INTEGER(HID_T), INTENT(IN) :: space_id + INTEGER(HID_T) :: dcpl_id_default + INTEGER(HID_T) :: dapl_id_default + INTEGER(HID_T), INTENT(OUT) :: dset_id + END FUNCTION h5dcreate_anon_c + END INTERFACE + + dcpl_id_default = H5P_DEFAULT_F + dapl_id_default = H5P_DEFAULT_F + + IF(PRESENT(dcpl_id)) dcpl_id_default = dcpl_id + IF(PRESENT(dapl_id)) dapl_id_default = dapl_id + + hdferr = h5dcreate_anon_c(loc_id, type_id, space_id, dcpl_id_default, dapl_id_default, dset_id) + + END SUBROUTINE h5dcreate_anon_f + + SUBROUTINE h5dwrite_vl_integer(dset_id, mem_type_id, buf, dims, len, & + hdferr, & + mem_space_id, file_space_id, xfer_prp) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(2) :: dims ! MAX len x num_elem + INTEGER(SIZE_T), INTENT(IN), DIMENSION(*) :: len ! Array to store + ! the length of each + ! element + INTEGER, INTENT(IN), DIMENSION(dims(1),dims(2)), TARGET :: buf ! Data buffer + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + + INTERFACE + INTEGER FUNCTION h5dwrite_vl_integer_c(dset_id, mem_type_id, & + mem_space_id_default, & + file_space_id_default, & + xfer_prp_default, buf, dims, len) & + BIND(C,NAME='h5dwrite_vl_integer_c') + IMPORT :: HID_T, HSIZE_T, SIZE_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id + INTEGER(HID_T), INTENT(IN) :: mem_type_id + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + INTEGER(SIZE_T), INTENT(IN), DIMENSION(*) :: len + INTEGER, INTENT(IN), DIMENSION(dims(1),dims(2)) :: buf + END FUNCTION h5dwrite_vl_integer_c + END INTERFACE + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF (PRESENT(file_space_id)) file_space_id_default = file_space_id + + hdferr = h5dwrite_vl_integer_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, & + buf, dims, len) + + END SUBROUTINE h5dwrite_vl_integer + + SUBROUTINE h5dread_vl_integer(dset_id, mem_type_id, buf, dims, len, & + hdferr, & + mem_space_id, file_space_id, xfer_prp) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(2) :: dims ! MAX len x num_elem + INTEGER(SIZE_T), INTENT(INOUT), DIMENSION(*) :: len ! Array to store + ! the length of each + ! element + INTEGER, INTENT(INOUT), & + DIMENSION(dims(1),dims(2)), TARGET :: buf ! Data buffer + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! -1 if failed, 0 otherwise + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + INTEGER(HID_T) :: tmp + INTEGER :: error + + INTERFACE + INTEGER FUNCTION h5dread_vl_integer_c(dset_id, mem_type_id, & + mem_space_id_default, & + file_space_id_default, & + xfer_prp_default, buf, dims, len) & + BIND(C,NAME='h5dread_vl_integer_c') + IMPORT :: HID_T, HSIZE_T, SIZE_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id + INTEGER(HID_T), INTENT(IN) :: mem_type_id + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + INTEGER(SIZE_T), INTENT(INOUT), DIMENSION(*) :: len + INTEGER, INTENT(INOUT), DIMENSION(dims(1),dims(2)) :: buf + END FUNCTION h5dread_vl_integer_c + END INTERFACE + + CALL h5dget_space_f(dset_id, tmp, error) + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = tmp + file_space_id_default = tmp + + IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF (PRESENT(file_space_id)) file_space_id_default = file_space_id + + hdferr = h5dread_vl_integer_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, & + buf, dims, len) + + END SUBROUTINE h5dread_vl_integer + + SUBROUTINE h5dwrite_vl_real(dset_id, mem_type_id, buf, dims, len, & + hdferr, & + mem_space_id, file_space_id, xfer_prp) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(2) :: dims ! MAX len x num_elem + INTEGER(SIZE_T), INTENT(IN), DIMENSION(*) :: len ! Array to store + ! the length of each + ! element + REAL, INTENT(IN), & + DIMENSION(dims(1),dims(2)) :: buf ! Data buffer + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + + INTERFACE + INTEGER FUNCTION h5dwrite_vl_real_c(dset_id, mem_type_id, & + mem_space_id_default, & + file_space_id_default, & + xfer_prp_default, buf, dims, len) & + BIND(C,NAME='h5dwrite_vl_real_c') + IMPORT :: HID_T, HSIZE_T, SIZE_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id + INTEGER(HID_T), INTENT(IN) :: mem_type_id + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + INTEGER(SIZE_T), INTENT(IN), DIMENSION(*) :: len + REAL, INTENT(IN), & + DIMENSION(dims(1),dims(2)) :: buf + END FUNCTION h5dwrite_vl_real_c + END INTERFACE + + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF (PRESENT(file_space_id)) file_space_id_default = file_space_id + + hdferr = h5dwrite_vl_real_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, & + buf, dims, len) + + END SUBROUTINE h5dwrite_vl_real + + SUBROUTINE h5dread_vl_real(dset_id, mem_type_id, buf, dims, len, & + hdferr, & + mem_space_id, file_space_id, xfer_prp) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(2) :: dims ! MAX len x num_elem + INTEGER(SIZE_T), INTENT(INOUT), DIMENSION(*) :: len ! Array to store the length of each element + REAL, INTENT(INOUT), & + DIMENSION(dims(1),dims(2)) :: buf ! Data buffer + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! -1 if failed, 0 otherwise + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + INTEGER(HID_T) :: tmp + INTEGER :: error + + INTERFACE + INTEGER FUNCTION h5dread_vl_real_c(dset_id, mem_type_id, & + mem_space_id_default, & + file_space_id_default, & + xfer_prp_default, buf, dims, len) & + BIND(C,NAME='h5dread_vl_real_c') + IMPORT :: HID_T, HSIZE_T, SIZE_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id + INTEGER(HID_T), INTENT(IN) :: mem_type_id + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + INTEGER(SIZE_T), INTENT(INOUT), DIMENSION(*) :: len + REAL, INTENT(INOUT), & + DIMENSION(dims(1),dims(2)) :: buf + END FUNCTION h5dread_vl_real_c + END INTERFACE + + CALL h5dget_space_f(dset_id, tmp, error) + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = tmp + file_space_id_default = tmp + + IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF (PRESENT(file_space_id)) file_space_id_default = file_space_id + + hdferr = h5dread_vl_real_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, & + buf, dims, len) + + END SUBROUTINE h5dread_vl_real + + SUBROUTINE h5dwrite_vl_string(dset_id, mem_type_id, buf, dims, str_len, & + hdferr, & + mem_space_id, file_space_id, xfer_prp) + USE, INTRINSIC :: ISO_C_BINDING, ONLY : c_char + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(2) :: dims ! Number of strings + INTEGER(SIZE_T), INTENT(IN), DIMENSION(*) :: str_len ! Array to store the length of each element + CHARACTER(LEN=*), INTENT(IN), DIMENSION(dims(2)) :: buf ! Data buffer + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + + INTERFACE + INTEGER FUNCTION h5dwrite_vl_string_c(dset_id, mem_type_id, & + mem_space_id_default, & + file_space_id_default, & + ! xfer_prp_default, tmp_buf, dims, str_len) + xfer_prp_default, buf, dims, str_len) & + BIND(C,NAME='h5dwrite_vl_string_c') + IMPORT :: C_CHAR + IMPORT :: HID_T, HSIZE_T, SIZE_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id + INTEGER(HID_T), INTENT(IN) :: mem_type_id + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(2) :: dims + INTEGER(SIZE_T), INTENT(IN), DIMENSION(*) :: str_len + CHARACTER(KIND=C_CHAR), DIMENSION(dims(2)) :: buf + END FUNCTION + END INTERFACE + + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF (PRESENT(file_space_id)) file_space_id_default = file_space_id + + hdferr = h5dwrite_vl_string_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, & + buf, dims, str_len) + + END SUBROUTINE h5dwrite_vl_string + + SUBROUTINE h5dread_vl_string(dset_id, mem_type_id, buf, dims, str_len, & + hdferr, mem_space_id, file_space_id, xfer_prp) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(2) :: dims ! number of strings + INTEGER(SIZE_T), INTENT(OUT), DIMENSION(*) :: str_len ! Array to store + ! the length of each + ! element + CHARACTER(LEN=*), INTENT(OUT), & + DIMENSION(dims(2)) :: buf ! Data buffer + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + + INTERFACE + INTEGER FUNCTION h5dread_vl_string_c(dset_id, mem_type_id, & + mem_space_id_default, & + file_space_id_default, & + xfer_prp_default, buf, dims, str_len) & + BIND(C,NAME='h5dread_vl_string_c') + IMPORT :: c_char + IMPORT :: HID_T, HSIZE_T, SIZE_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id + INTEGER(HID_T), INTENT(IN) :: mem_type_id + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(2) :: dims + INTEGER(SIZE_T), INTENT(OUT), DIMENSION(*) :: str_len + CHARACTER(KIND=C_CHAR), DIMENSION(dims(2)) :: buf + END FUNCTION h5dread_vl_string_c + END INTERFACE + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF (PRESENT(file_space_id)) file_space_id_default = file_space_id + + hdferr = h5dread_vl_string_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, & + buf, dims, str_len) + RETURN + END SUBROUTINE h5dread_vl_string + +! +!****s* H5D/h5dget_offset_f +! +! NAME +! h5dget_offset_f +! +! PURPOSE +! Returns dataset address in file. +! +! INPUTS +! dataset_id - Dataset identifier. +! OUTPUTS +! offset - The offset in bytes. +! hdferr - Returns 0 if successful and -1 if fails. +! +! AUTHOR +! M. Scot Breitenfeld +! April 16, 2015 +! +! SOURCE + SUBROUTINE h5dget_offset_f(dset_id, offset, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id + INTEGER(HADDR_T), INTENT(OUT) :: offset + INTEGER, INTENT(OUT) :: hdferr +!***** + INTERFACE + INTEGER(HADDR_T) FUNCTION h5dget_offset(dset_id) BIND(C,NAME='H5Dget_offset') + IMPORT :: HID_T, HADDR_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN), VALUE :: dset_id + END FUNCTION h5dget_offset + END INTERFACE + + offset = h5dget_offset(dset_id) + + hdferr = 0 + IF(offset .LT. 0) hdferr = -1 + + END SUBROUTINE h5dget_offset_f + +! +!****s* H5D/h5dget_space_f +! +! NAME +! h5dget_space_f +! +! PURPOSE +! Returns an identifier for a copy of the dataspace for a +! dataset. +! +! INPUTS +! dataset_id - dataset identifier +! OUTPUTS +! dataspace_id - dataspace identifier +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). February 28, 2001 +! +! SOURCE + SUBROUTINE h5dget_space_f(dataset_id, dataspace_id, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dataset_id ! Dataset identifier + INTEGER(HID_T), INTENT(OUT) :: dataspace_id ! Dataspace identifier + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + INTERFACE + INTEGER FUNCTION h5dget_space_c(dataset_id, dataspace_id) BIND(C,NAME='h5dget_space_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dataset_id + INTEGER(HID_T), INTENT(OUT) :: dataspace_id + END FUNCTION h5dget_space_c + END INTERFACE + + hdferr = h5dget_space_c(dataset_id, dataspace_id) + END SUBROUTINE h5dget_space_f + +!****s* H5D/h5dget_access_plist_f +! +! NAME +! h5dget_access_plist_f +! +! PURPOSE +! Returns a copy of the dataset creation property list. +! +! INPUTS +! dset_id - Dataset identifier +! +! OUTPUTS +! plist_id - Dataset access property list identifier +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! M. Scot Breitenfeld +! April 13, 2009 +! +! SOURCE + SUBROUTINE h5dget_access_plist_f(dset_id, plist_id, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id + INTEGER(HID_T), INTENT(OUT) :: plist_id + INTEGER , INTENT(OUT) :: hdferr + !***** + INTERFACE + INTEGER FUNCTION h5dget_access_plist_c(dset_id, plist_id) BIND(C,NAME='h5dget_access_plist_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id + INTEGER(HID_T), INTENT(OUT) :: plist_id + END FUNCTION h5dget_access_plist_c + END INTERFACE + + hdferr = h5dget_access_plist_c(dset_id, plist_id) + + END SUBROUTINE h5dget_access_plist_f + + + SUBROUTINE h5dwrite_reference_obj(dset_id, mem_type_id, buf, dims, hdferr, & + mem_space_id, file_space_id, xfer_prp) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), DIMENSION(*), INTENT(IN) :: dims ! size of the bufffer buf + TYPE(hobj_ref_t_f), DIMENSION(dims(1)), INTENT(IN), TARGET :: buf ! Data buffer + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + TYPE(C_PTR) :: f_ptr + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF(PRESENT(file_space_id)) file_space_id_default = file_space_id + f_ptr = C_LOC(buf(1)) + + hdferr = h5dwrite_f_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, f_ptr) + + END SUBROUTINE h5dwrite_reference_obj + + SUBROUTINE h5dwrite_reference_dsetreg(dset_id, mem_type_id, buf, dims, hdferr, & + mem_space_id, file_space_id, xfer_prp) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), DIMENSION(*), INTENT(IN) :: dims ! size of the bufffer buf + TYPE(hdset_reg_ref_t_f), DIMENSION(dims(1)), INTENT(IN), TARGET :: buf ! Data buffer + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + INTEGER, ALLOCATABLE, DIMENSION(:) :: ref_buf + INTEGER :: i + INTEGER(HSIZE_T) :: j + TYPE(C_PTR) :: f_ptr + INTERFACE + INTEGER FUNCTION h5dwrite_ref_reg_c(dset_id, mem_type_id,& + mem_space_id_default, & + file_space_id_default, xfer_prp_default, ref_buf, dims) & + BIND(C,NAME='h5dwrite_ref_reg_c') + IMPORT :: HID_T, HSIZE_T, SIZE_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id + INTEGER(HID_T), INTENT(IN) :: mem_type_id + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + INTEGER, DIMENSION(*) :: ref_buf + INTEGER(HSIZE_T), DIMENSION(*) :: dims + END FUNCTION h5dwrite_ref_reg_c + END INTERFACE + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF(PRESENT(file_space_id)) file_space_id_default = file_space_id + f_ptr = C_LOC(buf(1)) + + ALLOCATE(ref_buf(REF_REG_BUF_LEN*dims(1)), stat=hdferr) + IF (hdferr .NE. 0 ) THEN + hdferr = -1 + RETURN + ELSE + DO j = 1, dims(1) + DO i = 1, REF_REG_BUF_LEN + ref_buf(REF_REG_BUF_LEN*(j-1) + i) = buf(j)%ref(i) + ENDDO + ENDDO + ENDIF + hdferr = h5dwrite_ref_reg_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, ref_buf, dims) + DEALLOCATE(ref_buf) + + END SUBROUTINE h5dwrite_reference_dsetreg + + SUBROUTINE h5dwrite_char_scalar(dset_id, mem_type_id, buf, dims, hdferr, & + mem_space_id, file_space_id, xfer_prp) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + CHARACTER(*), INTENT(IN), TARGET :: buf ! Data buffer + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + + CALL h5dwrite_char_scalar_fix(dset_id, mem_type_id, buf, LEN(buf), dims, hdferr, & + mem_space_id, file_space_id, xfer_prp) + + END SUBROUTINE h5dwrite_char_scalar + + SUBROUTINE h5dwrite_char_scalar_fix(dset_id, mem_type_id, buf, buf_len, dims, hdferr, & + mem_space_id, file_space_id, xfer_prp) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + INTEGER, INTENT(IN) :: buf_len + CHARACTER(LEN=buf_len), INTENT(IN), TARGET :: buf ! Data buffer + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + TYPE(C_PTR) :: f_ptr + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF(PRESENT(file_space_id)) file_space_id_default = file_space_id + + f_ptr = C_LOC(buf(1:1)) + + hdferr = h5dwrite_f_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, f_ptr) + + END SUBROUTINE h5dwrite_char_scalar_fix + + SUBROUTINE h5dread_reference_obj(dset_id, mem_type_id, buf, dims, hdferr, & + mem_space_id, file_space_id, xfer_prp) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + TYPE(hobj_ref_t_f), INTENT(INOUT) , & + DIMENSION(dims(1)), TARGET :: buf + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + TYPE(C_PTR) :: f_ptr + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF(PRESENT(file_space_id)) file_space_id_default = file_space_id + f_ptr = C_LOC(buf(1)) + + hdferr = h5dread_f_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, f_ptr) + + END SUBROUTINE h5dread_reference_obj + + SUBROUTINE h5dread_reference_dsetreg(dset_id, mem_type_id, buf, dims, hdferr, & + mem_space_id, file_space_id, xfer_prp) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + TYPE(hdset_reg_ref_t_f), INTENT(INOUT), & + DIMENSION(dims(1)), TARGET :: buf + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + + INTEGER, ALLOCATABLE, DIMENSION(:) :: ref_buf + INTEGER :: i + INTEGER(HSIZE_T) :: j + INTERFACE + INTEGER FUNCTION h5dread_ref_reg_c(dset_id, mem_type_id,& + mem_space_id_default, & + file_space_id_default, xfer_prp_default, ref_buf, dims) & + BIND(C,NAME='h5dread_ref_reg_c') + IMPORT :: HID_T, HSIZE_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id + INTEGER(HID_T), INTENT(IN) :: mem_type_id + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + INTEGER, DIMENSION(*) :: ref_buf + END FUNCTION h5dread_ref_reg_c + END INTERFACE + + ALLOCATE(ref_buf(REF_REG_BUF_LEN*dims(1)), stat=hdferr) + IF (hdferr .NE. 0) THEN + hdferr = -1 + RETURN + ENDIF + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF(PRESENT(file_space_id)) file_space_id_default = file_space_id + + hdferr = h5dread_ref_reg_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, ref_buf, dims) + + DO j = 1, dims(1) + DO i = 1, REF_REG_BUF_LEN + buf(j)%ref(i) = ref_buf(REF_REG_BUF_LEN*(j-1) + i) + ENDDO + ENDDO + DEALLOCATE(ref_buf) + + END SUBROUTINE h5dread_reference_dsetreg + + SUBROUTINE h5dread_char_scalar(dset_id, mem_type_id, buf, dims, hdferr, & + mem_space_id, file_space_id, xfer_prp) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + CHARACTER(LEN=*), INTENT(INOUT) :: buf ! Data buffer + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF(PRESENT(file_space_id)) file_space_id_default = file_space_id + + CALL h5dread_char_scalar_fix(dset_id, mem_type_id, buf, LEN(buf), hdferr, & + mem_space_id_default, file_space_id_default, xfer_prp_default) + + END SUBROUTINE h5dread_char_scalar + + SUBROUTINE h5dread_char_scalar_fix(dset_id, mem_type_id, buf, buf_len, hdferr, & + mem_space_id, file_space_id, xfer_prp) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER, INTENT(IN) :: buf_len + CHARACTER(LEN=buf_len), INTENT(INOUT), TARGET :: buf ! Data buffer + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + + TYPE(C_PTR) :: f_ptr + + f_ptr = C_LOC(buf(1:1)) + + hdferr = h5dread_f_c(dset_id, mem_type_id, mem_space_id, & + file_space_id, xfer_prp, f_ptr) + + END SUBROUTINE h5dread_char_scalar_fix + +!****s* H5D (F03)/h5dwrite_f_F03 +! +! NAME +! h5dwrite_f_F03 +! +! PURPOSE +! Writes raw data from a dataset into a buffer. +! +! Inputs: +! dset_id - Identifier of the dataset to write to. +! mem_type_id - Identifier of the memory datatype. +! buf - Buffer with data to be written to the file. +! +! Outputs: +! hdferr - Returns 0 if successful and -1 if fails +! +! Optional parameters: +! mem_space_id - Identifier of the memory dataspace. +! file_space_id - Identifier of the dataset's dataspace in the file. +! xfer_prp - Identifier of a transfer property list for this I/O operation. +! +! AUTHOR +! M. Scot Breitenfeld +! September 17, 2011 +! +! Fortran2003 Interface: +!! SUBROUTINE h5dwrite_f(dset_id, mem_type_id, buf, hdferr, & +!! mem_space_id, file_space_id, xfer_prp) +!! INTEGER(HID_T), INTENT(IN) :: dset_id +!! INTEGER(HID_T), INTENT(IN) :: mem_type_id +!! TYPE(C_PTR) , INTENT(IN) :: buf +!! INTEGER , INTENT(OUT) :: hdferr +!! INTEGER(HID_T), INTENT(IN) , OPTIONAL :: mem_space_id +!! INTEGER(HID_T), INTENT(IN) , OPTIONAL :: file_space_id +!! INTEGER(HID_T), INTENT(IN) , OPTIONAL :: xfer_prp +!***** + SUBROUTINE h5dwrite_ptr(dset_id, mem_type_id, buf, hdferr, & + mem_space_id, file_space_id, xfer_prp) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + TYPE(C_PTR), INTENT(IN) :: buf + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF (PRESENT(file_space_id)) file_space_id_default = file_space_id + + hdferr = h5dwrite_f_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, buf) + + END SUBROUTINE h5dwrite_ptr + +!****s* H5D (F03)/h5dread_f_F03 +! +! NAME +! h5dread_f_F03 +! +! PURPOSE +! Reads raw data from a dataset into a buffer. +! +! Inputs: +! dset_id - Identifier of the dataset read from. +! mem_type_id - Identifier of the memory datatype. +! +! Outputs: +! buf - Buffer to receive data read from file. +! hdferr - Returns 0 if successful and -1 if fails +! +! Optional parameters: +! mem_space_id - Identifier of the memory dataspace. +! file_space_id - Identifier of the dataset's dataspace in the file. +! xfer_prp - Identifier of a transfer property list for this I/O operation. +! +! AUTHOR +! M. Scot Breitenfeld +! September 17, 2011 +! +! Fortran2003 Interface: +!! SUBROUTINE h5dread_f(dset_id, mem_type_id, buf, hdferr, & +!! mem_space_id, file_space_id, xfer_prp) +!! INTEGER(HID_T), INTENT(IN) :: dset_id +!! INTEGER(HID_T), INTENT(IN) :: mem_type_id +!! TYPE(C_PTR) , INTENT(INOUT) :: buf +!! INTEGER , INTENT(OUT) :: hdferr +!! INTEGER(HID_T), INTENT(IN) , OPTIONAL :: mem_space_id +!! INTEGER(HID_T), INTENT(IN) , OPTIONAL :: file_space_id +!! INTEGER(HID_T), INTENT(IN) , OPTIONAL :: xfer_prp +!***** + SUBROUTINE h5dread_ptr(dset_id, mem_type_id, buf, hdferr, & + mem_space_id, file_space_id, xfer_prp) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + TYPE(C_PTR), INTENT(INOUT) :: buf + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF (PRESENT(file_space_id)) file_space_id_default = file_space_id + + hdferr = h5dread_f_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, buf) + + END SUBROUTINE h5dread_ptr + +! +! NAME +! h5dfill_integer +! +! PURPOSE +! Fills dataspace elements with a fill value in a memory buffer. +! Only INTEGER, CHARACTER, REAL and DOUBLE PRECISION datatypes +! of the fillvalues and buffers are supported. Buffer and fillvalue +! are assumed to have the same datatype. +! Only one-dimesional buffers are supported. +! +! Inputs: +! fill_value - fill value +! space_id - memory space selection identifier +! buf - data buffer iin memory ro apply selection to +! - of k-th dimension of the buf array +! Outputs: +! hdferr: - error code +! Success: 0 +! Failure: -1 +! AUTHOR +! Elena Pourmal +! March 12, 2003 +! +! + + SUBROUTINE h5dfill_integer(fill_value, space_id, buf, hdferr) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER, INTENT(IN), TARGET :: fill_value ! Fill value + INTEGER(HID_T), INTENT(IN) :: space_id ! Memory dataspace selection identifier + INTEGER, INTENT(IN), DIMENSION(*), TARGET :: buf ! Memory buffer to fill in + INTEGER, INTENT(OUT) :: hdferr ! Error code + + INTEGER(HID_T) :: fill_type_id ! Fill value datatype identifier + INTEGER(HID_T) :: mem_type_id ! Buffer dadtype identifier + + TYPE(C_PTR) :: f_ptr_fill_value ! C pointer to fill_value + TYPE(C_PTR) :: f_ptr_buf ! C pointer to buf + + f_ptr_fill_value = C_LOC(fill_value) + f_ptr_buf = C_LOC(buf(1)) + + fill_type_id = H5T_NATIVE_INTEGER + mem_type_id = H5T_NATIVE_INTEGER + + hdferr = h5dfill_c(f_ptr_fill_value, fill_type_id, space_id, & + f_ptr_buf, mem_type_id) + + END SUBROUTINE h5dfill_integer + +! +! NAME +! h5dfill_c_float +! +! PURPOSE +! Fills dataspace elements with a fill value in a memory buffer. +! Only INTEGER, CHARACTER, REAL and DOUBLE PRECISION datatypes +! of the fillvalues and buffers are supported. Buffer and fillvalue +! are assumed to have the same datatype. +! Only one-dimesional buffers are supported. +! +! Inputs: +! fill_value - fill value +! space_id - memory space selection identifier +! buf - data buffer iin memory ro apply selection to +! - of k-th dimension of the buf array +! Outputs: +! hdferr: - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! March 12, 2003 +! + SUBROUTINE h5dfill_c_float(fill_valuer, space_id, buf, hdferr) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + REAL(KIND=C_FLOAT), INTENT(IN), TARGET :: fill_valuer ! Fill value + INTEGER(HID_T), INTENT(IN) :: space_id ! Memory dataspace selection identifier + REAL(KIND=C_FLOAT), INTENT(IN), DIMENSION(*), TARGET :: buf ! Memory buffer to fill in + INTEGER, INTENT(OUT) :: hdferr ! Error code + + INTEGER(HID_T) :: fill_type_id ! Fill value datatype identifier + INTEGER(HID_T) :: mem_type_id ! Buffer dadtype identifier + + TYPE(C_PTR) :: f_ptr_fill_valuer ! C pointer to fill_value + TYPE(C_PTR) :: f_ptr_buf ! C pointer to buf + + f_ptr_fill_valuer = C_LOC(fill_valuer) + f_ptr_buf = C_LOC(buf(1)) + + fill_type_id = H5T_NATIVE_REAL + mem_type_id = H5T_NATIVE_REAL + + hdferr = h5dfill_c(f_ptr_fill_valuer, fill_type_id, space_id, & + f_ptr_buf, mem_type_id) + + END SUBROUTINE h5dfill_c_float + + !---------------------------------------------------------------------- + ! Name: h5dfill_c_double + ! + ! Purpose: Fills dataspace elements with a fill value in a memory buffer. + ! Only INTEGER, CHARACTER, REAL and DOUBLE PRECISION datatypes + ! of the fillvalues and buffers are supported. Buffer and fillvalue + ! are assumed to have the same datatype. + ! Only one-dimesional buffers are supported. + ! + ! Inputs: + ! fill_value - fill value + ! space_id - memory space selection identifier + ! buf - data buffer iin memory ro apply selection to + ! - of k-th dimension of the buf array + ! Outputs: + ! hdferr: - error code + ! Success: 0 + ! Failure: -1 + ! + ! Programmer: Elena Pourmal + ! March 12, 2003 + ! + !---------------------------------------------------------------------- + + SUBROUTINE h5dfill_c_double(fill_value, space_id, buf, hdferr) + IMPLICIT NONE + REAL(KIND=C_DOUBLE), INTENT(IN), TARGET :: fill_value ! Fill value + INTEGER(HID_T), INTENT(IN) :: space_id ! Memory dataspace selection identifier + REAL(KIND=C_DOUBLE), INTENT(IN), DIMENSION(*), TARGET :: buf ! Memory buffer to fill in + INTEGER, INTENT(OUT) :: hdferr ! Error code + + INTEGER(HID_T) :: fill_type_id ! Fill value datatype identifier + INTEGER(HID_T) :: mem_type_id ! Buffer dadtype identifier + + TYPE(C_PTR) :: f_ptr_fill_valuer ! C pointer to fill_value + TYPE(C_PTR) :: f_ptr_buf ! C pointer to buf + + f_ptr_fill_valuer = C_LOC(fill_value) + f_ptr_buf = C_LOC(buf(1)) + + fill_type_id = H5T_NATIVE_DOUBLE + mem_type_id = H5T_NATIVE_DOUBLE + + hdferr = h5dfill_c(f_ptr_fill_valuer, fill_type_id, space_id, & + f_ptr_buf, mem_type_id) + + END SUBROUTINE h5dfill_c_double + +#ifdef H5_FORTRAN_HAVE_C_LONG_DOUBLE + SUBROUTINE h5dfill_c_long_double(fill_value, space_id, buf, hdferr) + IMPLICIT NONE + REAL(KIND=C_LONG_DOUBLE), INTENT(IN), TARGET :: fill_value ! Fill value + INTEGER(HID_T), INTENT(IN) :: space_id ! Memory dataspace selection identifier + REAL(KIND=C_LONG_DOUBLE), INTENT(IN), DIMENSION(*), TARGET :: buf ! Memory buffer to fill in + INTEGER, INTENT(OUT) :: hdferr ! Error code + + INTEGER(HID_T) :: fill_type_id ! Fill value datatype identifier + INTEGER(HID_T) :: mem_type_id ! Buffer dadtype identifier + + TYPE(C_PTR) :: f_ptr_fill_valuer ! C pointer to fill_value + TYPE(C_PTR) :: f_ptr_buf ! C pointer to buf + + f_ptr_fill_valuer = C_LOC(fill_value) + f_ptr_buf = C_LOC(buf(1)) + + fill_type_id = H5T_NATIVE_DOUBLE + mem_type_id = H5T_NATIVE_DOUBLE + + hdferr = h5dfill_c(f_ptr_fill_valuer, fill_type_id, space_id, & + f_ptr_buf, mem_type_id) + + END SUBROUTINE h5dfill_c_long_double +#endif +! +! NAME +! h5dfill_char +! +! PURPOSE +! Fills dataspace elements with a fill value in a memory buffer. +! Only INTEGER, CHARACTER, REAL and DOUBLE PRECISION datatypes +! of the fillvalues and buffers are supported. Buffer and fillvalue +! are assumed to have the same datatype. +! Only one-dimesional buffers are supported. +! +! Inputs: +! fill_value - fill value +! space_id - memory space selection identifier +! buf - data buffer iin memory ro apply selection to +! - of k-th dimension of the buf array +! Outputs: +! hdferr: - error code +! Success: 0 +! Failure: -1 +! AUTHOR +! Elena Pourmal +! March 12, 2003 +! + SUBROUTINE h5dfill_char(fill_value, space_id, buf, hdferr) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + CHARACTER, INTENT(IN), TARGET :: fill_value ! Fill value + INTEGER(HID_T), INTENT(IN) :: space_id ! Memory dataspace selection identifier + CHARACTER, INTENT(IN), DIMENSION(*), TARGET :: buf ! Memory buffer to fill in + INTEGER, INTENT(OUT) :: hdferr ! Error code + + INTEGER(HID_T) :: fill_type_id ! Fill value datatype identifier + INTEGER(HID_T) :: mem_type_id ! Buffer dadtype identifier + + TYPE(C_PTR) :: f_ptr_fill_value ! C pointer to fill_value + TYPE(C_PTR) :: f_ptr_buf ! C pointer to buf + + f_ptr_fill_value = C_LOC(fill_value) + f_ptr_buf = C_LOC(buf(1)) + + hdferr = h5dfill_c(f_ptr_fill_value, fill_type_id, space_id, & + f_ptr_buf, mem_type_id) + + END SUBROUTINE h5dfill_char +! +!****s* H5D (F03)/h5dvlen_reclaim_f +! NAME +! h5dvlen_reclaim_f +! +! PURPOSE +! Reclaims VL datatype memory buffers. +! +! Inputs: +! +! type_id - Identifier of the datatype. +! space_id - Identifier of the dataspace. +! plist_id - Identifier of the property list used to create the buffer. +! buf - Pointer to the buffer to be reclaimed. +! +! Outputs: +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! M. Scot Breitenfeld +! January 11, 2011 +! +! Fortran2003 Interface: + SUBROUTINE h5dvlen_reclaim_f(type_id, space_id, plist_id, buf, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: type_id + INTEGER(HID_T), INTENT(IN) :: space_id + INTEGER(HID_T), INTENT(IN) :: plist_id + TYPE(C_PTR) , INTENT(INOUT) :: buf + INTEGER , INTENT(OUT) :: hdferr +!***** + + INTERFACE + INTEGER FUNCTION h5dvlen_reclaim_c(type_id, space_id, plist_id, buf) BIND(C, NAME='h5dvlen_reclaim_c') + IMPORT :: C_PTR + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T) :: type_id + INTEGER(HID_T) :: space_id + INTEGER(HID_T) :: plist_id + TYPE(C_PTR), VALUE :: buf + END FUNCTION h5dvlen_reclaim_c + END INTERFACE + + hdferr = H5Dvlen_reclaim_c(type_id, space_id, plist_id, buf) + + END SUBROUTINE H5Dvlen_reclaim_f + + +END MODULE H5D + + diff --git a/fortran/src/H5Dff.f90 b/fortran/src/H5Dff.f90 deleted file mode 100644 index 3ad868c..0000000 --- a/fortran/src/H5Dff.f90 +++ /dev/null @@ -1,1035 +0,0 @@ -!****h* ROBODoc/H5D -! -! NAME -! MODULE H5D -! -! FILE -! fortran/src/H5Dff.f90 -! -! PURPOSE -! This file contains Fortran interfaces for H5D functions. It includes -! all the functions that are independent on whether the Fortran 2003 functions -! are enabled or disabled. -! -! 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. * -! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -! -! NOTES -! *** IMPORTANT *** -! If you add a new H5D function you must add the function name to the -! Windows dll file 'hdf5_fortrandll.def.in' in the fortran/src directory. -! This is needed for Windows based operating systems. -! -!***** - -MODULE H5D - USE H5GLOBAL - - INTERFACE h5dextend_f - MODULE PROCEDURE h5dset_extent_f - END INTERFACE - - INTERFACE h5dread_vl_f - MODULE PROCEDURE h5dread_vl_integer - MODULE PROCEDURE h5dread_vl_real - MODULE PROCEDURE h5dread_vl_string - END INTERFACE - - INTERFACE h5dwrite_vl_f - MODULE PROCEDURE h5dwrite_vl_integer - MODULE PROCEDURE h5dwrite_vl_real - MODULE PROCEDURE h5dwrite_vl_string - END INTERFACE - -CONTAINS - -! -!****s* H5D/h5dcreate_f -! -! NAME -! h5dcreate_f -! -! PURPOSE -! Creates a dataset at the specified location -! -! INPUTS -! loc_id - file or group identifier -! name - dataset name -! type_id - dataset datatype identifier -! space_id - dataset dataspace identifier -! OUTPUTS -! dset_id - dataset identifier -! hdferr - Returns 0 if successful and -1 if fails -! OPTIONAL PARAMETERS -! creation_prp - Dataset creation property list -! lcpl_id - Link creation property list -! dapl_id - Dataset access property list -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! -! - Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). February 28, 2001 -! -! - Added version's 1.8 new optional parameters -! February, 2008 -! -! SOURCE - SUBROUTINE h5dcreate_f(loc_id, name, type_id, space_id, dset_id, & - hdferr, dcpl_id, lcpl_id, dapl_id) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier - CHARACTER(LEN=*), INTENT(IN) :: name ! Name of the dataset - INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier - INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier - INTEGER(HID_T), INTENT(OUT) :: dset_id ! Dataset identifier - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: dcpl_id ! Dataset creation property list - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lcpl_id ! Link creation property list - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: dapl_id ! Dataset access property list - - INTEGER(HID_T) :: lcpl_id_default - INTEGER(HID_T) :: dcpl_id_default - INTEGER(HID_T) :: dapl_id_default - - INTEGER :: namelen ! Name length - -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5dcreate_c(loc_id, name, namelen, type_id, & - space_id, lcpl_id_default, dcpl_id_default, dapl_id_default, dset_id) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DCREATE_C'::h5dcreate_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: name - INTEGER(HID_T), INTENT(IN) :: loc_id - CHARACTER(LEN=*), INTENT(IN) :: name - INTEGER :: namelen - INTEGER(HID_T), INTENT(IN) :: type_id - INTEGER(HID_T), INTENT(IN) :: space_id - - INTEGER(HID_T) :: lcpl_id_default - INTEGER(HID_T) :: dcpl_id_default - INTEGER(HID_T) :: dapl_id_default - - INTEGER(HID_T), INTENT(OUT) :: dset_id - END FUNCTION h5dcreate_c - END INTERFACE - - lcpl_id_default = H5P_DEFAULT_F - dcpl_id_default = H5P_DEFAULT_F - dapl_id_default = H5P_DEFAULT_F - - IF(PRESENT(lcpl_id)) lcpl_id_default = lcpl_id - IF(PRESENT(dcpl_id)) dcpl_id_default = dcpl_id - IF(PRESENT(dapl_id)) dapl_id_default = dapl_id - - namelen = LEN(name) - hdferr = h5dcreate_c(loc_id, name, namelen, type_id, space_id, & - lcpl_id_default, dcpl_id_default, dapl_id_default, dset_id) - - END SUBROUTINE h5dcreate_f - -! -!****s* H5D/h5dopen_f -! -! NAME -! h5dopen_f -! -! PURPOSE -! Opens an existing dataset. -! -! INPUTS -! loc_id - file or group identifier -! name - dataset name -! OUTPUTS -! dset_id - dataset identifier -! hdferr - Returns 0 if successful and -1 if fails -! OPTIONAL PARAMETERS -! dapl_id - Dataset access property list -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! -Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). February 28, 2001 -! -! -Added 1.8 (optional) parameter dapl_id -! February, 2008, M. Scot Breitenfeld -! -! SOURCE - SUBROUTINE h5dopen_f(loc_id, name, dset_id, hdferr, dapl_id) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier - CHARACTER(LEN=*), INTENT(IN) :: name ! Name of the dataset - INTEGER(HID_T), INTENT(OUT) :: dset_id ! Dataset identifier - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: dapl_id ! Dataset access property list -!***** - INTEGER :: namelen ! Name length - - INTEGER(HID_T) :: dapl_id_default - - INTERFACE - INTEGER FUNCTION h5dopen_c(loc_id, name, namelen, dapl_id_default, dset_id) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DOPEN_C'::h5dopen_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: name - INTEGER(HID_T), INTENT(IN) :: loc_id - CHARACTER(LEN=*), INTENT(IN) :: name - INTEGER :: namelen - INTEGER(HID_T), INTENT(IN) :: dapl_id_default - INTEGER(HID_T), INTENT(OUT) :: dset_id - END FUNCTION h5dopen_c - END INTERFACE - - dapl_id_default = H5P_DEFAULT_F - IF(PRESENT(dapl_id)) dapl_id_default = dapl_id - - namelen = LEN(name) - hdferr = h5dopen_c(loc_id, name, namelen, dapl_id_default, dset_id) - - END SUBROUTINE h5dopen_f - -! -!****s* H5D/h5dclose_f -! -! NAME -! h5dclose_f -! -! PURPOSE -! Closes a dataset. -! -! INPUTS -! dset_id - dataset identifier -! OUTPUTS -! hdferr - Returns 0 if successful and -1 if fails -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). February 28, 2001 -! -! SOURCE - SUBROUTINE h5dclose_f(dset_id, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTERFACE - INTEGER FUNCTION h5dclose_c(dset_id) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DCLOSE_C'::h5dclose_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: dset_id - END FUNCTION h5dclose_c - END INTERFACE - - hdferr = h5dclose_c(dset_id) - - END SUBROUTINE h5dclose_f - -! -!****s* H5D/h5dget_type_f -! -! NAME -! h5dget_type_f -! -! PURPOSE -! Returns an identifier for a copy of the datatype for a -! dataset. -! -! INPUTS -! dataset_id - dataset identifier -! OUTPUTS -! datatype_id - dataspace identifier -! hdferr - Returns 0 if successful and -1 if fails -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). February 28, 2001 -! -! NOTES -! -! SOURCE - SUBROUTINE h5dget_type_f(dataset_id, datatype_id, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dataset_id ! Dataset identifier - INTEGER(HID_T), INTENT(OUT) :: datatype_id ! Datatype identifier - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTERFACE - INTEGER FUNCTION h5dget_type_c (dataset_id, datatype_id) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DGET_TYPE_C'::h5dget_type_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: dataset_id - INTEGER(HID_T), INTENT(OUT) :: datatype_id - END FUNCTION h5dget_type_c - END INTERFACE - - hdferr = h5dget_type_c (dataset_id, datatype_id) - END SUBROUTINE h5dget_type_f - -! -!****s* H5D/h5dset_extent -! -! NAME -! h5dset_extent (instead of obsolete name: h5dextend_f) -! -! PURPOSE -! Extends a dataset with unlimited dimension. -! -! INPUTS -! dataset_id - dataset identifier -! size - array containing the new magnitude of -! each dimension -! OUTPUTS -! hdferr - Returns 0 if successful and -1 if fails -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). February 28, 2001 -! -! Changed name from the now obsolete h5dextend_f -! to h5dset_extent_f. Provided interface to old name -! for backward compatability. -MSB- March 14, 2008 -! -! SOURCE - SUBROUTINE h5dset_extent_f(dataset_id, size, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dataset_id ! Dataset identifier - INTEGER(HSIZE_T), DIMENSION(*), INTENT(IN) :: size - ! Array containing - ! dimensions' sizes - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTERFACE - INTEGER FUNCTION h5dset_extent_c(dataset_id, size) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DSET_EXTENT_C'::h5dset_extent_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: dataset_id - INTEGER(HSIZE_T), DIMENSION(*), INTENT(IN) :: size - END FUNCTION h5dset_extent_c - END INTERFACE - - hdferr = H5Dset_extent_c(dataset_id, size) - END SUBROUTINE h5dset_extent_f - -!****s* H5D/h5dget_create_plist_f -! -! NAME -! h5dget_create_plist_f -! -! PURPOSE -! Returns an identifier for a copy of the dataset creation -! property list for a dataset. -! -! INPUTS -! dataset_id - dataset identifier -! OUTPUTS -! plist_id - creation property list identifier -! hdferr - Returns 0 if successful and -1 if fails -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). February 28, 2001 -! SOURCE - SUBROUTINE h5dget_create_plist_f(dataset_id, plist_id, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dataset_id ! Dataset identifier - INTEGER(HID_T), INTENT(OUT) :: plist_id ! Dataset creation - ! property list identifier - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTERFACE - INTEGER FUNCTION h5dget_create_plist_c(dataset_id, plist_id) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DGET_CREATE_PLIST_C'::h5dget_create_plist_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: dataset_id - INTEGER(HID_T), INTENT(OUT) :: plist_id - END FUNCTION h5dget_create_plist_c - END INTERFACE - - hdferr = h5dget_create_plist_c(dataset_id, plist_id) - END SUBROUTINE h5dget_create_plist_f - -! -!****s* H5D/h5dget_storage_size_f -! -! NAME -! h5dget_storage_size_f -! -! PURPOSE -! Returns the amount of storage requires by a dataset -! -! INPUTS -! dataset_id - dataset identifier -! OUTPUTS -! size - datastorage size -! hdferr - Returns 0 if successful and -1 if fails -! -! AUTHOR -! Elena Pourmal -! October 15, 2002 -! SOURCE - SUBROUTINE h5dget_storage_size_f(dataset_id, size, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dataset_id ! Dataset identifier - INTEGER(HSIZE_T), INTENT(OUT) :: size ! Amount of storage - ! allocated for dataset - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTERFACE - INTEGER FUNCTION h5dget_storage_size_c(dataset_id, size) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DGET_STORAGE_SIZE_C'::h5dget_storage_size_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: dataset_id - INTEGER(HSIZE_T), INTENT(OUT) :: size - END FUNCTION h5dget_storage_size_c - END INTERFACE - - hdferr = h5dget_storage_size_c(dataset_id, size) - END SUBROUTINE h5dget_storage_size_f - -! -!****s* H5D/h5dvlen_get_max_len_f -! -! NAME -! h5dvlen_get_max_len_f -! -! PURPOSE -! Returns maximum length of the VL array elements -! -! INPUTS -! dataset_id - dataset identifier -! type_id - datatype identifier -! space_id - dataspace identifier -! OUTPUTS -! size - buffer size -! hdferr - Returns 0 if successful and -1 if fails -! OPTIONAL PARAMETERS -! NONE -! -! AUTHOR -! Elena Pourmal -! October 15, 2002 -! -! SOURCE - SUBROUTINE h5dvlen_get_max_len_f(dataset_id, type_id, space_id, len, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dataset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier - INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier - INTEGER(SIZE_T), INTENT(OUT) :: len ! Maximum length of the element - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTERFACE - INTEGER FUNCTION h5dvlen_get_max_len_c(dataset_id, type_id, space_id, len) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DVLEN_GET_MAX_LEN_C'::h5dvlen_get_max_len_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: dataset_id - INTEGER(HID_T), INTENT(IN) :: type_id - INTEGER(HID_T), INTENT(IN) :: space_id - INTEGER(SIZE_T), INTENT(OUT) :: len - END FUNCTION h5dvlen_get_max_len_c - END INTERFACE - - hdferr = h5dvlen_get_max_len_c(dataset_id, type_id, space_id, len) - END SUBROUTINE h5dvlen_get_max_len_f - -! -!****s* H5D/h5dget_space_status_f -! -! NAME -! h5dget_space_status_f -! -! PURPOSE -! Returns the status of data space allocation. -! -! INPUTS -! dset_id - dataset identifier -! OUTPUTS -! flag - status; may have one of the following values: -! H5D_SPACE_STS_ERROR_F -! H5D_SPACE_STS_NOT_ALLOCATED_F -! H5D_SPACE_STS_PART_ALLOCATED_F -! H5D_SPACE_STS_ALLOCATED_F -! hdferr - Returns 0 if successful and -1 if fails -! -! AUTHOR -! Elena Pourmal -! March 12, 2003 -! -! SOURCE - SUBROUTINE h5dget_space_status_f(dset_id, flag, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataspace identifier - INTEGER, INTENT(OUT) :: flag ! Memory buffer to fill in - INTEGER, INTENT(OUT) :: hdferr ! Error code - !***** - INTERFACE - INTEGER FUNCTION h5dget_space_status_c(dset_id, flag) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DGET_SPACE_STATUS_C'::h5dget_space_status_c - !DEC$ENDIF - INTEGER(HID_T) :: dset_id - INTEGER :: flag - END FUNCTION h5dget_space_status_c - END INTERFACE - - hdferr = h5dget_space_status_c(dset_id, flag) - END SUBROUTINE h5dget_space_status_f - -! -!****s* H5D/h5dcreate_anon_f -! -! NAME -! h5dcreate_anon_f -! -! PURPOSE -! Creates a dataset in a file without linking it into the file structure -! -! INPUTS -! loc_id - Identifier of the file or group within which to create the dataset. -! type_id - Identifier of the datatype to use when creating the dataset. -! space_id - Identifier of the dataspace to use when creating the dataset. -! OUTPUTS -! dset_id - dataset identifier -! hdferr - Returns 0 if successful and -1 if fails -! OPTIONAL PARAMETERS -! dcpl_id - Dataset creation property list identifier. -! dapl_id - Dataset access property list identifier. -! -! AUTHOR -! M. Scot Breitenfeld -! February 11, 2008 -! -! SOURCE - SUBROUTINE h5dcreate_anon_f(loc_id, type_id, space_id, dset_id, hdferr, dcpl_id, dapl_id) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier. - INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier. - INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier. - INTEGER(HID_T), INTENT(OUT) :: dset_id ! Dataset identifier. - INTEGER, INTENT(OUT) :: hdferr ! Error code. - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: dcpl_id ! Dataset creation property list identifier. - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: dapl_id ! Dataset access property list identifier. -!***** - INTEGER(HID_T) :: dcpl_id_default - INTEGER(HID_T) :: dapl_id_default - - ! - ! MS FORTRAN needs explicit interface for C functions called here. - ! - INTERFACE - INTEGER FUNCTION h5dcreate_anon_c(loc_id, type_id, space_id, dcpl_id_default, dapl_id_default, dset_id) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DCREATE_ANON_C'::h5dcreate_anon_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: loc_id - INTEGER(HID_T), INTENT(IN) :: type_id - INTEGER(HID_T), INTENT(IN) :: space_id - INTEGER(HID_T) :: dcpl_id_default - INTEGER(HID_T) :: dapl_id_default - INTEGER(HID_T), INTENT(OUT) :: dset_id - END FUNCTION h5dcreate_anon_c - END INTERFACE - - dcpl_id_default = H5P_DEFAULT_F - dapl_id_default = H5P_DEFAULT_F - - IF(PRESENT(dcpl_id)) dcpl_id_default = dcpl_id - IF(PRESENT(dapl_id)) dapl_id_default = dapl_id - - hdferr = h5dcreate_anon_c(loc_id, type_id, space_id, dcpl_id_default, dapl_id_default, dset_id) - - END SUBROUTINE h5dcreate_anon_f - - SUBROUTINE h5dwrite_vl_integer(dset_id, mem_type_id, buf, dims, len, & - hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(2) :: dims ! MAX len x num_elem - INTEGER(SIZE_T), INTENT(IN), DIMENSION(*) :: len ! Array to store - ! the length of each - ! element - INTEGER, INTENT(IN), & - DIMENSION(dims(1),dims(2)), TARGET :: buf ! Data buffer - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - - INTERFACE - INTEGER FUNCTION h5dwrite_vl_integer_c(dset_id, mem_type_id, & - mem_space_id_default, & - file_space_id_default, & - xfer_prp_default, buf, dims, len) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DWRITE_VL_INTEGER_C'::h5dwrite_vl_integer_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - INTEGER(SIZE_T), INTENT(IN), DIMENSION(*) :: len - INTEGER, INTENT(IN), & - DIMENSION(dims(1),dims(2)) :: buf - END FUNCTION h5dwrite_vl_integer_c - END INTERFACE - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp - IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id - IF (PRESENT(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dwrite_vl_integer_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, & - buf, dims, len) - - END SUBROUTINE h5dwrite_vl_integer - - SUBROUTINE h5dread_vl_integer(dset_id, mem_type_id, buf, dims, len, & - hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(2) :: dims ! MAX len x num_elem - INTEGER(SIZE_T), INTENT(INOUT), DIMENSION(*) :: len ! Array to store - ! the length of each - ! element - INTEGER, INTENT(INOUT), & - DIMENSION(dims(1),dims(2)), TARGET :: buf ! Data buffer - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! -1 if failed, 0 otherwise - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: tmp - INTEGER :: error - - INTERFACE - INTEGER FUNCTION h5dread_vl_integer_c(dset_id, mem_type_id, & - mem_space_id_default, & - file_space_id_default, & - xfer_prp_default, buf, dims, len) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DREAD_VL_INTEGER_C'::h5dread_vl_integer_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - INTEGER(SIZE_T), INTENT(INOUT), DIMENSION(*) :: len - INTEGER, INTENT(INOUT), & - DIMENSION(dims(1),dims(2)) :: buf - END FUNCTION h5dread_vl_integer_c - END INTERFACE - - CALL h5dget_space_f(dset_id, tmp, error) - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = tmp - file_space_id_default = tmp - - IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp - IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id - IF (PRESENT(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dread_vl_integer_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, & - buf, dims, len) - - END SUBROUTINE h5dread_vl_integer - - SUBROUTINE h5dwrite_vl_real(dset_id, mem_type_id, buf, dims, len, & - hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(2) :: dims ! MAX len x num_elem - INTEGER(SIZE_T), INTENT(IN), DIMENSION(*) :: len ! Array to store - ! the length of each - ! element - REAL, INTENT(IN), & - DIMENSION(dims(1),dims(2)) :: buf ! Data buffer - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - - INTERFACE - INTEGER FUNCTION h5dwrite_vl_real_c(dset_id, mem_type_id, & - mem_space_id_default, & - file_space_id_default, & - xfer_prp_default, buf, dims, len) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DWRITE_VL_REAL_C'::h5dwrite_vl_real_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - INTEGER(SIZE_T), INTENT(IN), DIMENSION(*) :: len - REAL, INTENT(IN), & - DIMENSION(dims(1),dims(2)) :: buf - END FUNCTION h5dwrite_vl_real_c - END INTERFACE - - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp - IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id - IF (PRESENT(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dwrite_vl_real_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, & - buf, dims, len) - - END SUBROUTINE h5dwrite_vl_real - - SUBROUTINE h5dread_vl_real(dset_id, mem_type_id, buf, dims, len, & - hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(2) :: dims ! MAX len x num_elem - INTEGER(SIZE_T), INTENT(INOUT), DIMENSION(*) :: len ! Array to store the length of each element - REAL, INTENT(INOUT), & - DIMENSION(dims(1),dims(2)) :: buf ! Data buffer - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! -1 if failed, 0 otherwise - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: tmp - INTEGER :: error - - INTERFACE - INTEGER FUNCTION h5dread_vl_real_c(dset_id, mem_type_id, & - mem_space_id_default, & - file_space_id_default, & - xfer_prp_default, buf, dims, len) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DREAD_VL_REAL_C'::h5dread_vl_real_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - INTEGER(SIZE_T), INTENT(INOUT), DIMENSION(*) :: len - REAL, INTENT(INOUT), & - DIMENSION(dims(1),dims(2)) :: buf - END FUNCTION h5dread_vl_real_c - END INTERFACE - - CALL h5dget_space_f(dset_id, tmp, error) - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = tmp - file_space_id_default = tmp - - IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp - IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id - IF (PRESENT(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dread_vl_real_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, & - buf, dims, len) - - END SUBROUTINE h5dread_vl_real - - SUBROUTINE h5dwrite_vl_string(dset_id, mem_type_id, buf, dims, str_len, & - hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(2) :: dims ! Number of strings - INTEGER(SIZE_T), INTENT(IN), DIMENSION(*) :: str_len ! Array to store the length of each element - CHARACTER(LEN=*), INTENT(IN), & - DIMENSION(dims(2)) :: buf ! Data buffer - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - - INTERFACE - INTEGER FUNCTION h5dwrite_vl_string_c(dset_id, mem_type_id, & - mem_space_id_default, & - file_space_id_default, & - ! xfer_prp_default, tmp_buf, dims, str_len) - xfer_prp_default, buf, dims, str_len) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DWRITE_VL_STRING_C'::h5dwrite_vl_string_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: buf - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(2) :: dims - INTEGER(SIZE_T), INTENT(IN), DIMENSION(*) :: str_len - CHARACTER(LEN=*), DIMENSION(dims(2)) :: buf - END FUNCTION - END INTERFACE - - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp - IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id - IF (PRESENT(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dwrite_vl_string_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, & - buf, dims, str_len) - - END SUBROUTINE h5dwrite_vl_string - - SUBROUTINE h5dread_vl_string(dset_id, mem_type_id, buf, dims, str_len, & - hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(2) :: dims ! number of strings - INTEGER(SIZE_T), INTENT(OUT), DIMENSION(*) :: str_len ! Array to store - ! the length of each - ! element - CHARACTER(LEN=*), INTENT(OUT), & - DIMENSION(dims(2)) :: buf ! Data buffer - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - - INTERFACE - INTEGER FUNCTION h5dread_vl_string_c(dset_id, mem_type_id, & - mem_space_id_default, & - file_space_id_default, & - xfer_prp_default, buf, dims, str_len) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DREAD_VL_STRING_C'::h5dread_vl_string_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: buf - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(2) :: dims - INTEGER(SIZE_T), INTENT(OUT), DIMENSION(*) :: str_len - CHARACTER(LEN=*), DIMENSION(dims(2)) :: buf - END FUNCTION h5dread_vl_string_c - END INTERFACE - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp - IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id - IF (PRESENT(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dread_vl_string_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, & - buf, dims, str_len) - RETURN - END SUBROUTINE h5dread_vl_string - -! -!****s* H5D/h5dget_space_f -! -! NAME -! h5dget_space_f -! -! PURPOSE -! Returns an identifier for a copy of the dataspace for a -! dataset. -! -! INPUTS -! dataset_id - dataset identifier -! OUTPUTS -! dataspace_id - dataspace identifier -! hdferr - Returns 0 if successful and -1 if fails -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). February 28, 2001 -! -! SOURCE - SUBROUTINE h5dget_space_f(dataset_id, dataspace_id, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dataset_id ! Dataset identifier - INTEGER(HID_T), INTENT(OUT) :: dataspace_id ! Dataspace identifier - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTERFACE - INTEGER FUNCTION h5dget_space_c(dataset_id, dataspace_id) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DGET_SPACE_C'::h5dget_space_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: dataset_id - INTEGER(HID_T), INTENT(OUT) :: dataspace_id - END FUNCTION h5dget_space_c - END INTERFACE - - hdferr = h5dget_space_c(dataset_id, dataspace_id) -END SUBROUTINE h5dget_space_f - -!****s* H5D/h5dget_access_plist_f -! -! NAME -! h5dget_access_plist_f -! -! PURPOSE -! Returns a copy of the dataset creation property list. -! -! INPUTS -! dset_id - Dataset identifier -! -! OUTPUTS -! plist_id - Dataset access property list identifier -! hdferr - Returns 0 if successful and -1 if fails -! -! AUTHOR -! M. Scot Breitenfeld -! April 13, 2009 -! -! SOURCE -SUBROUTINE h5dget_access_plist_f(dset_id, plist_id, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(OUT) :: plist_id - INTEGER , INTENT(OUT) :: hdferr -!***** - INTERFACE - INTEGER FUNCTION h5dget_access_plist_c(dset_id, plist_id) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DGET_ACCESS_PLIST_C'::h5dget_access_plist_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(OUT) :: plist_id - END FUNCTION h5dget_access_plist_c - END INTERFACE - - hdferr = h5dget_access_plist_c(dset_id, plist_id) - -END SUBROUTINE h5dget_access_plist_f - -END MODULE H5D - - diff --git a/fortran/src/H5Dff_F03.f90 b/fortran/src/H5Dff_F03.f90 deleted file mode 100644 index 7026ae3..0000000 --- a/fortran/src/H5Dff_F03.f90 +++ /dev/null @@ -1,2389 +0,0 @@ -!****h* ROBODoc/H5D (F03) -! -! NAME -! H5D_PROVISIONAL -! -! PURPOSE -! This file contains Fortran 90 and Fortran 2003 interfaces for H5D functions. -! It contains the same functions as H5Dff_F90.f90 but includes the -! Fortran 2003 functions and the interface listings. This file will be compiled -! instead of H5Dff_F90.f90 if Fortran 2003 functions are enabled. -! -! 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. * -! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -! -! NOTES -! (1) The maximum rank of an array allowed in Fortran is 7, therefore -! we only provide an interface for arrays up to and including rank 7. -! -! (2) Unfortunately we are using a generic interface and one of the factors -! used in determining the proper routine to select is that of the array -! rank being passed. Therefore, we can not create just one subroutine for -! each array type (integer, real, etc...) and use a -! rank 1 array of assumed size to handle multiple ranks, i.e. -! (i.e. integer, dimension(*) :: ... ) -! (i.e. real , dimension(*) :: ... ) etc... -! -! (3) Could not place the USE, INTRINSIC :: ISO_C_BINDING in the module header because it may -! conflict with the USE, INTRINSIC :: ISO_C_BINDING included in the user's program. Moved -! the statement instead to each subroutine. -! -! -! (4) C_LOC and character strings according to the Fortran 2003 standard: -! -! 15.1.2.5 C_LOC(X) -! -! Argument. X shall either -! -! (A) have interoperable type and type parameters and be -! (a) a variable that has the TARGET attribute and is interoperable, -! (b) an allocated allocatable variable that has the TARGET attribute -! and is not an array of zero size, or -! (c) an associated scalar pointer, or -! (B) be a nonpolymorphic scalar, have no length type parameters, and be -! (a) a nonallocatable, nonpointer variable that has the TARGET attribute, -! (b) an allocated allocatable variable that has the TARGET attribute, or -! (c) an associated pointer. -! -! - When X is a character, for interoperability the standard is: -! -! 15.2.1 Interoperability of intrinsic types -! -! ...if the type is character, interoperability also requires that the length type parameter -! be omitted or be specified by an initialization expression whose value is one. -! -! THEREFORE compilers that have not extended the standard require the -! argument in C_LOC to be of the variant: -! -! CHARACTER(LEN=1), TARGET :: chr -! or -! CHARACTER, TARGET :: chr -! -! *** IMPORTANT *** -! If you add a new H5D function you must add the function name to the -! Windows dll file 'hdf5_fortrandll.def.in' in the fortran/src directory. -! This is needed for Windows based operating systems. -! -!***** - -MODULE H5D_PROVISIONAL - USE H5GLOBAL - - INTERFACE h5dwrite_f - - MODULE PROCEDURE h5dwrite_reference_obj - MODULE PROCEDURE h5dwrite_reference_dsetreg - MODULE PROCEDURE h5dwrite_integer_scalar - MODULE PROCEDURE h5dwrite_integer_1 - MODULE PROCEDURE h5dwrite_integer_2 - MODULE PROCEDURE h5dwrite_integer_3 - MODULE PROCEDURE h5dwrite_integer_4 - MODULE PROCEDURE h5dwrite_integer_5 - MODULE PROCEDURE h5dwrite_integer_6 - MODULE PROCEDURE h5dwrite_integer_7 - MODULE PROCEDURE h5dwrite_char_scalar - MODULE PROCEDURE h5dwrite_char_1 - MODULE PROCEDURE h5dwrite_char_2 - MODULE PROCEDURE h5dwrite_char_3 - MODULE PROCEDURE h5dwrite_char_4 - MODULE PROCEDURE h5dwrite_char_5 - MODULE PROCEDURE h5dwrite_char_6 - MODULE PROCEDURE h5dwrite_char_7 - MODULE PROCEDURE h5dwrite_real_scalar - MODULE PROCEDURE h5dwrite_real_1 - MODULE PROCEDURE h5dwrite_real_2 - MODULE PROCEDURE h5dwrite_real_3 - MODULE PROCEDURE h5dwrite_real_4 - MODULE PROCEDURE h5dwrite_real_5 - MODULE PROCEDURE h5dwrite_real_6 - MODULE PROCEDURE h5dwrite_real_7 - - ! This is the preferred way to call h5dwrite - ! by passing an address - MODULE PROCEDURE h5dwrite_ptr - - END INTERFACE - - INTERFACE h5dread_f - - MODULE PROCEDURE h5dread_reference_obj - MODULE PROCEDURE h5dread_reference_dsetreg - MODULE PROCEDURE h5dread_integer_scalar - MODULE PROCEDURE h5dread_integer_1 - MODULE PROCEDURE h5dread_integer_2 - MODULE PROCEDURE h5dread_integer_3 - MODULE PROCEDURE h5dread_integer_4 - MODULE PROCEDURE h5dread_integer_5 - MODULE PROCEDURE h5dread_integer_6 - MODULE PROCEDURE h5dread_integer_7 - MODULE PROCEDURE h5dread_char_scalar - MODULE PROCEDURE h5dread_char_1 - MODULE PROCEDURE h5dread_char_2 - MODULE PROCEDURE h5dread_char_3 - MODULE PROCEDURE h5dread_char_4 - MODULE PROCEDURE h5dread_char_5 - MODULE PROCEDURE h5dread_char_6 - MODULE PROCEDURE h5dread_char_7 - MODULE PROCEDURE h5dread_real_scalar - MODULE PROCEDURE h5dread_real_1 - MODULE PROCEDURE h5dread_real_2 - MODULE PROCEDURE h5dread_real_3 - MODULE PROCEDURE h5dread_real_4 - MODULE PROCEDURE h5dread_real_5 - MODULE PROCEDURE h5dread_real_6 - MODULE PROCEDURE h5dread_real_7 - - ! This is the preferred way to call h5dread - ! by passing an address - MODULE PROCEDURE h5dread_ptr - - END INTERFACE - -! Interface for the function used to pass the C pointer of the buffer -! to the C H5Dwrite routine - - INTERFACE - INTEGER FUNCTION h5dwrite_f_c(dset_id, mem_type_id, & - mem_space_id_default , & - file_space_id_default, & - xfer_prp_default, buf ) BIND(C, NAME='h5dwrite_f_c') - USE H5GLOBAL - USE, INTRINSIC :: ISO_C_BINDING, ONLY : c_ptr - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - TYPE(C_PTR), VALUE :: buf - END FUNCTION h5dwrite_f_c - END INTERFACE - -! Interface for the function used to pass the C pointer of the buffer -! to the C H5Dread routine - - INTERFACE - INTEGER FUNCTION h5dread_f_c(dset_id, mem_type_id, & - mem_space_id_default, & - file_space_id_default, & - xfer_prp_default, buf) BIND(C, NAME='h5dread_f_c') - USE H5GLOBAL - USE, INTRINSIC :: ISO_C_BINDING, ONLY : c_ptr - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - TYPE(C_PTR), VALUE :: buf - END FUNCTION h5dread_f_c - END INTERFACE - - INTERFACE h5dfill_f - MODULE PROCEDURE h5dfill_integer - MODULE PROCEDURE h5dfill_real - MODULE PROCEDURE h5dfill_char - END INTERFACE - -! Interface for the function used to pass the C pointer of the buffer -! to the C H5Dfill routine - - INTERFACE - INTEGER FUNCTION h5dfill_c(f_ptr_fill_value, fill_type_id, space_id, & - f_ptr_buf, mem_type_id) BIND(C, NAME='h5dfill_c') - USE H5GLOBAL - USE, INTRINSIC :: ISO_C_BINDING, ONLY : c_ptr - TYPE(C_PTR), VALUE :: f_ptr_fill_value - INTEGER(HID_T) :: fill_type_id ! Fill value datatype identifier - INTEGER(HID_T), INTENT(IN) :: space_id ! Memory dataspace selection identifier - TYPE(C_PTR), VALUE :: f_ptr_buf - INTEGER(HID_T) :: mem_type_id - END FUNCTION h5dfill_c - END INTERFACE - -CONTAINS - - SUBROUTINE h5dwrite_reference_obj(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), DIMENSION(*), INTENT(IN) :: dims ! size of the bufffer buf - TYPE(hobj_ref_t_f), DIMENSION(dims(1)), INTENT(IN), TARGET :: buf ! Data buffer - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - TYPE(C_PTR) :: f_ptr - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp - IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id - IF(PRESENT(file_space_id)) file_space_id_default = file_space_id - f_ptr = C_LOC(buf(1)) - - hdferr = h5dwrite_f_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, f_ptr) - - - END SUBROUTINE h5dwrite_reference_obj - - SUBROUTINE h5dwrite_reference_dsetreg(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), DIMENSION(*), INTENT(IN) :: dims ! size of the bufffer buf - TYPE(hdset_reg_ref_t_f), DIMENSION(dims(1)), INTENT(IN), TARGET :: buf ! Data buffer - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER, ALLOCATABLE, DIMENSION(:) :: ref_buf - INTEGER :: i - INTEGER(HSIZE_T) :: j - TYPE(C_PTR) :: f_ptr - INTERFACE - INTEGER FUNCTION h5dwrite_ref_reg_c(dset_id, mem_type_id,& - mem_space_id_default, & - file_space_id_default, xfer_prp_default, ref_buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DWRITE_REF_REG_C'::h5dwrite_ref_reg_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER, DIMENSION(*) :: ref_buf - INTEGER(HSIZE_T), DIMENSION(*) :: dims - END FUNCTION h5dwrite_ref_reg_c - END INTERFACE - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp - IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id - IF(PRESENT(file_space_id)) file_space_id_default = file_space_id - f_ptr = C_LOC(buf(1)) - - ALLOCATE(ref_buf(REF_REG_BUF_LEN*dims(1)), stat=hdferr) - IF (hdferr .NE. 0 ) THEN - hdferr = -1 - RETURN - ELSE - DO j = 1, dims(1) - DO i = 1, REF_REG_BUF_LEN - ref_buf(REF_REG_BUF_LEN*(j-1) + i) = buf(j)%ref(i) - ENDDO - ENDDO - ENDIF - hdferr = h5dwrite_ref_reg_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, ref_buf, dims) - DEALLOCATE(ref_buf) - - END SUBROUTINE h5dwrite_reference_dsetreg - - - SUBROUTINE h5dwrite_integer_scalar(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER, INTENT(IN), TARGET :: buf ! Data buffer - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - TYPE(C_PTR) :: f_ptr - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp - IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id - IF(PRESENT(file_space_id)) file_space_id_default = file_space_id - f_ptr = C_LOC(buf) - - hdferr = h5dwrite_f_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, f_ptr) - - END SUBROUTINE h5dwrite_integer_scalar - - SUBROUTINE h5dwrite_integer_1(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - INTEGER, INTENT(IN), & - DIMENSION(dims(1)), TARGET :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - TYPE(C_PTR) :: f_ptr - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp - IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id - IF(PRESENT(file_space_id)) file_space_id_default = file_space_id - f_ptr = C_LOC(buf(1)) - - hdferr = h5dwrite_f_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, f_ptr) - - END SUBROUTINE h5dwrite_integer_1 - - SUBROUTINE h5dwrite_integer_2(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - INTEGER, INTENT(IN), & - DIMENSION(dims(1),dims(2)),TARGET :: buf ! Data buffer - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - TYPE(C_PTR) :: f_ptr - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp - IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id - IF(PRESENT(file_space_id)) file_space_id_default = file_space_id - f_ptr = C_LOC(buf(1,1)) - - hdferr = h5dwrite_f_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, f_ptr) - - END SUBROUTINE h5dwrite_integer_2 - - SUBROUTINE h5dwrite_integer_3(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - INTEGER, INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3)), TARGET :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - TYPE(C_PTR) :: f_ptr - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp - IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id - IF(PRESENT(file_space_id)) file_space_id_default = file_space_id - f_ptr = C_LOC(buf(1,1,1)) - - hdferr = h5dwrite_f_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, f_ptr) - - END SUBROUTINE h5dwrite_integer_3 - - SUBROUTINE h5dwrite_integer_4(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - INTEGER, INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4)), TARGET :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - TYPE(C_PTR) :: f_ptr - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp - IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id - IF(PRESENT(file_space_id)) file_space_id_default = file_space_id - f_ptr = C_LOC(buf(1,1,1,1)) - - hdferr = h5dwrite_f_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, f_ptr) - - END SUBROUTINE h5dwrite_integer_4 - - SUBROUTINE h5dwrite_integer_5(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - INTEGER, INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)), TARGET :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - TYPE(C_PTR) :: f_ptr - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp - IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id - IF(PRESENT(file_space_id)) file_space_id_default = file_space_id - f_ptr = C_LOC(buf(1,1,1,1,1)) - - hdferr = h5dwrite_f_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, f_ptr) - - END SUBROUTINE h5dwrite_integer_5 - - SUBROUTINE h5dwrite_integer_6(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - INTEGER, INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)), TARGET :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - TYPE(C_PTR) :: f_ptr - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp - IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id - IF(PRESENT(file_space_id)) file_space_id_default = file_space_id - f_ptr = C_LOC(buf(1,1,1,1,1,1)) - - hdferr = h5dwrite_f_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, f_ptr) - - END SUBROUTINE h5dwrite_integer_6 - - SUBROUTINE h5dwrite_integer_7(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - INTEGER, INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)), TARGET :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - TYPE(C_PTR) :: f_ptr - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp - IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id - IF(PRESENT(file_space_id)) file_space_id_default = file_space_id - f_ptr = C_LOC(buf(1,1,1,1,1,1,1)) - - hdferr = h5dwrite_f_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, f_ptr) - - END SUBROUTINE h5dwrite_integer_7 - - SUBROUTINE h5dwrite_char_scalar(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - CHARACTER(*), INTENT(IN), TARGET :: buf ! Data buffer - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - - CALL h5dwrite_char_scalar_fix(dset_id, mem_type_id, buf, LEN(buf), dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - - END SUBROUTINE h5dwrite_char_scalar - - SUBROUTINE h5dwrite_char_scalar_fix(dset_id, mem_type_id, buf, buf_len, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - INTEGER, INTENT(IN) :: buf_len - CHARACTER(LEN=buf_len), INTENT(IN), TARGET :: buf ! Data buffer - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - TYPE(C_PTR) :: f_ptr - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp - IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id - IF(PRESENT(file_space_id)) file_space_id_default = file_space_id - - f_ptr = C_LOC(buf(1:1)) - - hdferr = h5dwrite_f_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, f_ptr) - - END SUBROUTINE h5dwrite_char_scalar_fix - - SUBROUTINE h5dwrite_char_1(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - CHARACTER(LEN=*), INTENT(IN), DIMENSION(dims(1)), TARGET :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - TYPE(C_PTR) :: f_ptr - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp - IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id - IF(PRESENT(file_space_id)) file_space_id_default = file_space_id - - f_ptr = C_LOC(buf(1)(1:1)) - - hdferr = h5dwrite_f_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, f_ptr) - - END SUBROUTINE h5dwrite_char_1 - - SUBROUTINE h5dwrite_char_2(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - CHARACTER(LEN=*), INTENT(IN), & - DIMENSION(dims(1),dims(2)), TARGET :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - TYPE(C_PTR) :: f_ptr - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp - IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id - IF(PRESENT(file_space_id)) file_space_id_default = file_space_id - - f_ptr = C_LOC(buf(1,1)(1:1)) - - hdferr = h5dwrite_f_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, f_ptr) - - END SUBROUTINE h5dwrite_char_2 - - SUBROUTINE h5dwrite_char_3(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - CHARACTER(LEN=*), INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3)), TARGET :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - TYPE(C_PTR) :: f_ptr - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp - IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id - IF(PRESENT(file_space_id)) file_space_id_default = file_space_id - - f_ptr = C_LOC(buf(1,1,1)(1:1)) - - hdferr = h5dwrite_f_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, f_ptr) - - END SUBROUTINE h5dwrite_char_3 - - SUBROUTINE h5dwrite_char_4(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - CHARACTER(LEN=*), INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4)), TARGET :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - TYPE(C_PTR) :: f_ptr - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp - IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id - IF(PRESENT(file_space_id)) file_space_id_default = file_space_id - - f_ptr = C_LOC(buf(1,1,1,1)(1:1)) - - hdferr = h5dwrite_f_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, f_ptr) - - END SUBROUTINE h5dwrite_char_4 - - SUBROUTINE h5dwrite_char_5(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - CHARACTER(LEN=*), INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)), TARGET :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - TYPE(C_PTR) :: f_ptr - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp - IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id - IF(PRESENT(file_space_id)) file_space_id_default = file_space_id - - f_ptr = C_LOC(buf(1,1,1,1,1)(1:1)) - hdferr = h5dwrite_f_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, f_ptr) - - END SUBROUTINE h5dwrite_char_5 - - SUBROUTINE h5dwrite_char_6(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - CHARACTER(LEN=*), INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)), TARGET :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - TYPE(C_PTR) :: f_ptr - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp - IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id - IF(PRESENT(file_space_id)) file_space_id_default = file_space_id - - f_ptr = C_LOC(buf(1,1,1,1,1,1)(1:1)) - - hdferr = h5dwrite_f_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, f_ptr) - - END SUBROUTINE h5dwrite_char_6 - - SUBROUTINE h5dwrite_char_7(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - CHARACTER(LEN=*), INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)), TARGET :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - TYPE(C_PTR) :: f_ptr - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp - IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id - IF(PRESENT(file_space_id)) file_space_id_default = file_space_id - - f_ptr = C_LOC(buf(1,1,1,1,1,1,1)(1:1)) - - hdferr = h5dwrite_f_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, f_ptr) - - END SUBROUTINE h5dwrite_char_7 - - - SUBROUTINE h5dwrite_real_scalar(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - REAL, INTENT(IN), TARGET :: buf ! Data buffer - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - TYPE(C_PTR) :: f_ptr - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp - IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id - IF(PRESENT(file_space_id)) file_space_id_default = file_space_id - f_ptr = C_LOC(buf) - - hdferr = h5dwrite_f_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, f_ptr) - - END SUBROUTINE h5dwrite_real_scalar - - - SUBROUTINE h5dwrite_real_1(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - REAL, INTENT(IN), & - DIMENSION(dims(1)), TARGET :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - TYPE(C_PTR) :: f_ptr - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp - IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id - IF(PRESENT(file_space_id)) file_space_id_default = file_space_id - f_ptr = C_LOC(buf(1)) - - hdferr = h5dwrite_f_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, f_ptr) - - END SUBROUTINE h5dwrite_real_1 - - SUBROUTINE h5dwrite_real_2(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - REAL, INTENT(IN), & - DIMENSION(dims(1),dims(2)), TARGET :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - TYPE(C_PTR) :: f_ptr - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp - IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id - IF(PRESENT(file_space_id)) file_space_id_default = file_space_id - f_ptr = C_LOC(buf(1,1)) - - hdferr = h5dwrite_f_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, f_ptr) - - END SUBROUTINE h5dwrite_real_2 - - SUBROUTINE h5dwrite_real_3(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - REAL, INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3)), TARGET :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - TYPE(C_PTR) :: f_ptr - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp - IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id - IF(PRESENT(file_space_id)) file_space_id_default = file_space_id - f_ptr = C_LOC(buf(1,1,1)) - - hdferr = h5dwrite_f_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, f_ptr) - - END SUBROUTINE h5dwrite_real_3 - - SUBROUTINE h5dwrite_real_4(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - REAL, INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4)), TARGET :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - TYPE(C_PTR) :: f_ptr - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp - IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id - IF(PRESENT(file_space_id)) file_space_id_default = file_space_id - f_ptr = C_LOC(buf(1,1,1,1)) - - hdferr = h5dwrite_f_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, f_ptr) - - END SUBROUTINE h5dwrite_real_4 - - SUBROUTINE h5dwrite_real_5(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - REAL, INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)), TARGET :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - TYPE(C_PTR) :: f_ptr - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp - IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id - IF(PRESENT(file_space_id)) file_space_id_default = file_space_id - f_ptr = C_LOC(buf(1,1,1,1,1)) - - hdferr = h5dwrite_f_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, f_ptr) - - END SUBROUTINE h5dwrite_real_5 - - SUBROUTINE h5dwrite_real_6(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - REAL, INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)), TARGET :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - TYPE(C_PTR) :: f_ptr - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp - IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id - IF(PRESENT(file_space_id)) file_space_id_default = file_space_id - f_ptr = C_LOC(buf(1,1,1,1,1,1)) - - hdferr = h5dwrite_f_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, f_ptr) - - END SUBROUTINE h5dwrite_real_6 - - SUBROUTINE h5dwrite_real_7(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - REAL, INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)), TARGET :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - TYPE(C_PTR) :: f_ptr - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp - IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id - IF(PRESENT(file_space_id)) file_space_id_default = file_space_id - f_ptr = C_LOC(buf(1,1,1,1,1,1,1)) - - hdferr = h5dwrite_f_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, f_ptr) - - END SUBROUTINE h5dwrite_real_7 - -! -! NAME -! h5dread_f -! -! PURPOSE -! Reads raw data from the specified dataset into buf, -! converting from file datatype and dataspace to memory -! datatype and dataspace. -! -! Inputs: -! dset_id - dataset identifier -! mem_type_id - memory type identifier -! dims - 1-dim array of size 7; dims(k) has the size -! - of k-th dimension of the buf array -! Outputs: -! buf - buffer to read data in -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! mem_space_id - memory dataspace identifier -! file_space_id - file dataspace identifier -! xfer_prp - trasfer property list identifier -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). February 28, 2001 -! -! dims parameter was added to make code portable; -! n parameter was replaced with dims parameter in -! the h5dwrite_reference_obj and h5dwrite_reference_dsetreg -! functions. April 2, 2001 -! -! NOTES -! This function is overloaded to read INTEGER, -! REAL, DOUBLE PRECISION and CHARACTER buffers -! up to 7 dimensions, and one dimensional buffers -! of the TYPE(hobj_ref_t_f) and TYPE(hdset_reg_ref_t_f) -! types. -! - SUBROUTINE h5dread_reference_obj(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - TYPE(hobj_ref_t_f), INTENT(INOUT) , & - DIMENSION(dims(1)), TARGET :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - TYPE(C_PTR) :: f_ptr - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp - IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id - IF(PRESENT(file_space_id)) file_space_id_default = file_space_id - f_ptr = C_LOC(buf(1)) - - hdferr = h5dread_f_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, f_ptr) - - END SUBROUTINE h5dread_reference_obj - - SUBROUTINE h5dread_reference_dsetreg(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - TYPE(hdset_reg_ref_t_f), INTENT(INOUT), & - DIMENSION(dims(1)), TARGET :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - - INTEGER, ALLOCATABLE, DIMENSION(:) :: ref_buf - INTEGER :: i - INTEGER(HSIZE_T) :: j - INTERFACE - INTEGER FUNCTION h5dread_ref_reg_c(dset_id, mem_type_id,& - mem_space_id_default, & - file_space_id_default, xfer_prp_default, ref_buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DREAD_REF_REG_C'::h5dread_ref_reg_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - INTEGER, DIMENSION(*) :: ref_buf - END FUNCTION h5dread_ref_reg_c - END INTERFACE - - ALLOCATE(ref_buf(REF_REG_BUF_LEN*dims(1)), stat=hdferr) - IF (hdferr .NE. 0) THEN - hdferr = -1 - RETURN - ENDIF - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp - IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id - IF(PRESENT(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dread_ref_reg_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, ref_buf, dims) - - DO j = 1, dims(1) - DO i = 1, REF_REG_BUF_LEN - buf(j)%ref(i) = ref_buf(REF_REG_BUF_LEN*(j-1) + i) - ENDDO - ENDDO - DEALLOCATE(ref_buf) - - END SUBROUTINE h5dread_reference_dsetreg - - - SUBROUTINE h5dread_integer_scalar(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - INTEGER, INTENT(INOUT) , TARGET :: buf ! Data buffer - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - TYPE(C_PTR) :: f_ptr - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp - IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id - IF(PRESENT(file_space_id)) file_space_id_default = file_space_id - f_ptr = C_LOC(buf) - - hdferr = h5dread_f_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, f_ptr) - - - END SUBROUTINE h5dread_integer_scalar - - SUBROUTINE h5dread_integer_1(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - INTEGER, INTENT(INOUT), & - DIMENSION(dims(1)) , TARGET :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - TYPE(C_PTR) :: f_ptr - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp - IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id - IF(PRESENT(file_space_id)) file_space_id_default = file_space_id - f_ptr = C_LOC(buf(1)) - - hdferr = h5dread_f_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, f_ptr) - - END SUBROUTINE h5dread_integer_1 - - SUBROUTINE h5dread_integer_2(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - INTEGER, INTENT(INOUT), & - DIMENSION(dims(1),dims(2)) , TARGET :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - TYPE(C_PTR) :: f_ptr - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp - IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id - IF(PRESENT(file_space_id)) file_space_id_default = file_space_id - f_ptr = C_LOC(buf(1,1)) - - hdferr = h5dread_f_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, f_ptr) - - END SUBROUTINE h5dread_integer_2 - - SUBROUTINE h5dread_integer_3(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - INTEGER, INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3)) , TARGET :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - TYPE(C_PTR) :: f_ptr - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp - IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id - IF(PRESENT(file_space_id)) file_space_id_default = file_space_id - f_ptr = C_LOC(buf(1,1,1)) - - hdferr = h5dread_f_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, f_ptr) - - END SUBROUTINE h5dread_integer_3 - - SUBROUTINE h5dread_integer_4(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - INTEGER, INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4)) , TARGET :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - TYPE(C_PTR) :: f_ptr - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp - IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id - IF(PRESENT(file_space_id)) file_space_id_default = file_space_id - f_ptr = C_LOC(buf(1,1,1,1)) - - hdferr = h5dread_f_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, f_ptr) - - END SUBROUTINE h5dread_integer_4 - - SUBROUTINE h5dread_integer_5(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - INTEGER, INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) , TARGET :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - TYPE(C_PTR) :: f_ptr - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp - IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id - IF(PRESENT(file_space_id)) file_space_id_default = file_space_id - f_ptr = C_LOC(buf(1,1,1,1,1)) - - hdferr = h5dread_f_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, f_ptr) - - END SUBROUTINE h5dread_integer_5 - - SUBROUTINE h5dread_integer_6(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - INTEGER, INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)) , TARGET :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - TYPE(C_PTR) :: f_ptr - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp - IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id - IF(PRESENT(file_space_id)) file_space_id_default = file_space_id - f_ptr = C_LOC(buf(1,1,1,1,1,1)) - - hdferr = h5dread_f_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, f_ptr) - - END SUBROUTINE h5dread_integer_6 - - SUBROUTINE h5dread_integer_7(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - INTEGER, INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)) , TARGET :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - TYPE(C_PTR) :: f_ptr - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp - IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id - IF(PRESENT(file_space_id)) file_space_id_default = file_space_id - f_ptr = C_LOC(buf(1,1,1,1,1,1,1)) - - hdferr = h5dread_f_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, f_ptr) - - END SUBROUTINE h5dread_integer_7 - - SUBROUTINE h5dread_char_scalar(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - CHARACTER(LEN=*), INTENT(INOUT) :: buf ! Data buffer - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp - IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id - IF(PRESENT(file_space_id)) file_space_id_default = file_space_id - - CALL h5dread_char_scalar_fix(dset_id, mem_type_id, buf, LEN(buf), hdferr, & - mem_space_id_default, file_space_id_default, xfer_prp_default) - - END SUBROUTINE h5dread_char_scalar - - SUBROUTINE h5dread_char_scalar_fix(dset_id, mem_type_id, buf, buf_len, hdferr, & - mem_space_id, file_space_id, xfer_prp) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER, INTENT(IN) :: buf_len - CHARACTER(LEN=buf_len), INTENT(INOUT), TARGET :: buf ! Data buffer - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - - TYPE(C_PTR) :: f_ptr - - f_ptr = C_LOC(buf(1:1)) - - hdferr = h5dread_f_c(dset_id, mem_type_id, mem_space_id, & - file_space_id, xfer_prp, f_ptr) - - END SUBROUTINE h5dread_char_scalar_fix - - SUBROUTINE h5dread_char_1(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - CHARACTER(LEN=*), INTENT(INOUT), & - DIMENSION(dims(1)), TARGET :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - TYPE(C_PTR) :: f_ptr - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp - IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id - IF(PRESENT(file_space_id)) file_space_id_default = file_space_id - - f_ptr = C_LOC(buf(1)(1:1)) - hdferr = h5dread_f_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, f_ptr) - - END SUBROUTINE h5dread_char_1 - - SUBROUTINE h5dread_char_2(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - CHARACTER(LEN=*), INTENT(INOUT), & - DIMENSION(dims(1),dims(2)), TARGET :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - TYPE(C_PTR) :: f_ptr - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp - IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id - IF(PRESENT(file_space_id)) file_space_id_default = file_space_id - - f_ptr = C_LOC(buf(1,1)(1:1)) - - hdferr = h5dread_f_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, f_ptr) - - END SUBROUTINE h5dread_char_2 - - SUBROUTINE h5dread_char_3(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - CHARACTER(LEN=*), INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3)), TARGET :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - TYPE(C_PTR) :: f_ptr - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp - IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id - IF(PRESENT(file_space_id)) file_space_id_default = file_space_id - - f_ptr = C_LOC(buf(1,1,1)(1:1)) - hdferr = h5dread_f_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, f_ptr) - - END SUBROUTINE h5dread_char_3 - - SUBROUTINE h5dread_char_4(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - CHARACTER(LEN=*), INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4)), TARGET :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - TYPE(C_PTR) :: f_ptr - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp - IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id - IF(PRESENT(file_space_id)) file_space_id_default = file_space_id - - f_ptr = C_LOC(buf(1,1,1,1)(1:1)) - - hdferr = h5dread_f_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, f_ptr) - - END SUBROUTINE h5dread_char_4 - - SUBROUTINE h5dread_char_5(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - CHARACTER(LEN=*), INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)), TARGET :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - TYPE(C_PTR) :: f_ptr - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp - IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id - IF(PRESENT(file_space_id)) file_space_id_default = file_space_id - - f_ptr = C_LOC(buf(1,1,1,1,1)(1:1)) - - hdferr = h5dread_f_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, f_ptr) - - END SUBROUTINE h5dread_char_5 - - SUBROUTINE h5dread_char_6(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - CHARACTER(LEN=*), INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)), TARGET :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - TYPE(C_PTR) :: f_ptr - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp - IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id - IF(PRESENT(file_space_id)) file_space_id_default = file_space_id - - f_ptr = C_LOC(buf(1,1,1,1,1,1)(1:1)) - - hdferr = h5dread_f_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, f_ptr) - - END SUBROUTINE h5dread_char_6 - - SUBROUTINE h5dread_char_7(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - CHARACTER(LEN=*), INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)), TARGET :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - TYPE(C_PTR) :: f_ptr - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp - IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id - IF(PRESENT(file_space_id)) file_space_id_default = file_space_id - - f_ptr = C_LOC(buf(1,1,1,1,1,1,1)(1:1)) - - hdferr = h5dread_f_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, f_ptr) - - END SUBROUTINE h5dread_char_7 - - SUBROUTINE h5dread_real_scalar(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - REAL, INTENT(INOUT) , TARGET :: buf ! Data buffer - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - TYPE(C_PTR) :: f_ptr - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp - IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id - IF(PRESENT(file_space_id)) file_space_id_default = file_space_id - f_ptr = C_LOC(buf) - - hdferr = h5dread_f_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, f_ptr) - - END SUBROUTINE h5dread_real_scalar - - SUBROUTINE h5dread_real_1(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - REAL, INTENT(INOUT), & - DIMENSION(dims(1)) , TARGET :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - TYPE(C_PTR) :: f_ptr - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp - IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id - IF(PRESENT(file_space_id)) file_space_id_default = file_space_id - f_ptr = C_LOC(buf(1)) - - hdferr = h5dread_f_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, f_ptr) - - END SUBROUTINE h5dread_real_1 - - SUBROUTINE h5dread_real_2(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - REAL, INTENT(INOUT), & - DIMENSION(dims(1),dims(2)) , TARGET :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - TYPE(C_PTR) :: f_ptr - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp - IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id - IF(PRESENT(file_space_id)) file_space_id_default = file_space_id - f_ptr = C_LOC(buf(1,1)) - - hdferr = h5dread_f_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, f_ptr) - - END SUBROUTINE h5dread_real_2 - - SUBROUTINE h5dread_real_3(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - REAL, INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3)) , TARGET :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - TYPE(C_PTR) :: f_ptr - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp - IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id - IF(PRESENT(file_space_id)) file_space_id_default = file_space_id - f_ptr = C_LOC(buf(1,1,1)) - - hdferr = h5dread_f_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, f_ptr) - - END SUBROUTINE h5dread_real_3 - - SUBROUTINE h5dread_real_4(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - REAL, INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3), dims(4)) , TARGET :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - TYPE(C_PTR) :: f_ptr - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp - IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id - IF(PRESENT(file_space_id)) file_space_id_default = file_space_id - f_ptr = C_LOC(buf(1,1,1,1)) - - hdferr = h5dread_f_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, f_ptr) - - END SUBROUTINE h5dread_real_4 - - SUBROUTINE h5dread_real_5(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - REAL, INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) , TARGET :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - TYPE(C_PTR) :: f_ptr - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp - IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id - IF(PRESENT(file_space_id)) file_space_id_default = file_space_id - f_ptr = C_LOC(buf(1,1,1,1,1)) - - hdferr = h5dread_f_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, f_ptr) - - END SUBROUTINE h5dread_real_5 - - SUBROUTINE h5dread_real_6(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - REAL, INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)) , TARGET :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - TYPE(C_PTR) :: f_ptr - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp - IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id - IF(PRESENT(file_space_id)) file_space_id_default = file_space_id - f_ptr = C_LOC(buf(1,1,1,1,1,1)) - - hdferr = h5dread_f_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, f_ptr) - - END SUBROUTINE h5dread_real_6 - - SUBROUTINE h5dread_real_7(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - REAL, INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)) , TARGET :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - TYPE(C_PTR) :: f_ptr - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp - IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id - IF(PRESENT(file_space_id)) file_space_id_default = file_space_id - f_ptr = C_LOC(buf(1,1,1,1,1,1,1)) - - hdferr = h5dread_f_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, f_ptr) - - END SUBROUTINE h5dread_real_7 - -!****s* H5D (F03)/h5dwrite_f_F03 -! -! NAME -! h5dwrite_f_F03 -! -! PURPOSE -! Writes raw data from a dataset into a buffer. -! -! Inputs: -! dset_id - Identifier of the dataset to write to. -! mem_type_id - Identifier of the memory datatype. -! buf - Buffer with data to be written to the file. -! -! Outputs: -! hdferr - Returns 0 if successful and -1 if fails -! -! Optional parameters: -! mem_space_id - Identifier of the memory dataspace. -! file_space_id - Identifier of the dataset's dataspace in the file. -! xfer_prp - Identifier of a transfer property list for this I/O operation. -! -! AUTHOR -! M. Scot Breitenfeld -! September 17, 2011 -! -! Fortran2003 Interface: -!! SUBROUTINE h5dwrite_f(dset_id, mem_type_id, buf, hdferr, & -!! mem_space_id, file_space_id, xfer_prp) -!! INTEGER(HID_T), INTENT(IN) :: dset_id -!! INTEGER(HID_T), INTENT(IN) :: mem_type_id -!! TYPE(C_PTR) , INTENT(IN) :: buf -!! INTEGER , INTENT(OUT) :: hdferr -!! INTEGER(HID_T), INTENT(IN) , OPTIONAL :: mem_space_id -!! INTEGER(HID_T), INTENT(IN) , OPTIONAL :: file_space_id -!! INTEGER(HID_T), INTENT(IN) , OPTIONAL :: xfer_prp -!***** - SUBROUTINE h5dwrite_ptr(dset_id, mem_type_id, buf, hdferr, & - mem_space_id, file_space_id, xfer_prp) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - TYPE(C_PTR), INTENT(IN) :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp - IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id - IF (PRESENT(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dwrite_f_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, buf) - - END SUBROUTINE h5dwrite_ptr -!****s* H5D (F03)/h5dread_f_F03 -! -! NAME -! h5dread_f_F03 -! -! PURPOSE -! Reads raw data from a dataset into a buffer. -! -! Inputs: -! dset_id - Identifier of the dataset read from. -! mem_type_id - Identifier of the memory datatype. -! -! Outputs: -! buf - Buffer to receive data read from file. -! hdferr - Returns 0 if successful and -1 if fails -! -! Optional parameters: -! mem_space_id - Identifier of the memory dataspace. -! file_space_id - Identifier of the dataset's dataspace in the file. -! xfer_prp - Identifier of a transfer property list for this I/O operation. -! -! AUTHOR -! M. Scot Breitenfeld -! September 17, 2011 -! -! Fortran2003 Interface: -!! SUBROUTINE h5dread_f(dset_id, mem_type_id, buf, hdferr, & -!! mem_space_id, file_space_id, xfer_prp) -!! INTEGER(HID_T), INTENT(IN) :: dset_id -!! INTEGER(HID_T), INTENT(IN) :: mem_type_id -!! TYPE(C_PTR) , INTENT(INOUT) :: buf -!! INTEGER , INTENT(OUT) :: hdferr -!! INTEGER(HID_T), INTENT(IN) , OPTIONAL :: mem_space_id -!! INTEGER(HID_T), INTENT(IN) , OPTIONAL :: file_space_id -!! INTEGER(HID_T), INTENT(IN) , OPTIONAL :: xfer_prp -!***** - SUBROUTINE h5dread_ptr(dset_id, mem_type_id, buf, hdferr, & - mem_space_id, file_space_id, xfer_prp) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - TYPE(C_PTR), INTENT(INOUT) :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp - IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id - IF (PRESENT(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dread_f_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, buf) - - END SUBROUTINE h5dread_ptr - -! -! NAME -! h5dfill_integer -! -! PURPOSE -! Fills dataspace elements with a fill value in a memory buffer. -! Only INTEGER, CHARACTER, REAL and DOUBLE PRECISION datatypes -! of the fillvalues and buffers are supported. Buffer and fillvalue -! are assumed to have the same datatype. -! Only one-dimesional buffers are supported. -! -! Inputs: -! fill_value - fill value -! space_id - memory space selection identifier -! buf - data buffer iin memory ro apply selection to -! - of k-th dimension of the buf array -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! AUTHOR -! Elena Pourmal -! March 12, 2003 -! -! - - SUBROUTINE h5dfill_integer(fill_value, space_id, buf, hdferr) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER, INTENT(IN), TARGET :: fill_value ! Fill value - INTEGER(HID_T), INTENT(IN) :: space_id ! Memory dataspace selection identifier - INTEGER, INTENT(IN), DIMENSION(*), TARGET :: buf ! Memory buffer to fill in - INTEGER, INTENT(OUT) :: hdferr ! Error code - - INTEGER(HID_T) :: fill_type_id ! Fill value datatype identifier - INTEGER(HID_T) :: mem_type_id ! Buffer dadtype identifier - - TYPE(C_PTR) :: f_ptr_fill_value ! C pointer to fill_value - TYPE(C_PTR) :: f_ptr_buf ! C pointer to buf - - f_ptr_fill_value = C_LOC(fill_value) - f_ptr_buf = C_LOC(buf(1)) - - fill_type_id = H5T_NATIVE_INTEGER - mem_type_id = H5T_NATIVE_INTEGER - - hdferr = h5dfill_c(f_ptr_fill_value, fill_type_id, space_id, & - f_ptr_buf, mem_type_id) - - END SUBROUTINE h5dfill_integer - -! -! NAME -! h5dfill_real -! -! PURPOSE -! Fills dataspace elements with a fill value in a memory buffer. -! Only INTEGER, CHARACTER, REAL and DOUBLE PRECISION datatypes -! of the fillvalues and buffers are supported. Buffer and fillvalue -! are assumed to have the same datatype. -! Only one-dimesional buffers are supported. -! -! Inputs: -! fill_value - fill value -! space_id - memory space selection identifier -! buf - data buffer iin memory ro apply selection to -! - of k-th dimension of the buf array -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! Elena Pourmal -! March 12, 2003 -! - SUBROUTINE h5dfill_real(fill_valuer, space_id, buf, hdferr) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - REAL, INTENT(IN), TARGET :: fill_valuer ! Fill value - INTEGER(HID_T), INTENT(IN) :: space_id ! Memory dataspace selection identifier - REAL, INTENT(IN), DIMENSION(*), TARGET :: buf ! Memory buffer to fill in - INTEGER, INTENT(OUT) :: hdferr ! Error code - - INTEGER(HID_T) :: fill_type_id ! Fill value datatype identifier - INTEGER(HID_T) :: mem_type_id ! Buffer dadtype identifier - - TYPE(C_PTR) :: f_ptr_fill_valuer ! C pointer to fill_value - TYPE(C_PTR) :: f_ptr_buf ! C pointer to buf - - f_ptr_fill_valuer = C_LOC(fill_valuer) - f_ptr_buf = C_LOC(buf(1)) - - fill_type_id = H5T_NATIVE_REAL - mem_type_id = H5T_NATIVE_REAL - - hdferr = h5dfill_c(f_ptr_fill_valuer, fill_type_id, space_id, & - f_ptr_buf, mem_type_id) - - END SUBROUTINE h5dfill_real - -! -! NAME -! h5dfill_char -! -! PURPOSE -! Fills dataspace elements with a fill value in a memory buffer. -! Only INTEGER, CHARACTER, REAL and DOUBLE PRECISION datatypes -! of the fillvalues and buffers are supported. Buffer and fillvalue -! are assumed to have the same datatype. -! Only one-dimesional buffers are supported. -! -! Inputs: -! fill_value - fill value -! space_id - memory space selection identifier -! buf - data buffer iin memory ro apply selection to -! - of k-th dimension of the buf array -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! AUTHOR -! Elena Pourmal -! March 12, 2003 -! - SUBROUTINE h5dfill_char(fill_value, space_id, buf, hdferr) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - CHARACTER, INTENT(IN), TARGET :: fill_value ! Fill value - INTEGER(HID_T), INTENT(IN) :: space_id ! Memory dataspace selection identifier - CHARACTER, INTENT(IN), DIMENSION(*), TARGET :: buf ! Memory buffer to fill in - INTEGER, INTENT(OUT) :: hdferr ! Error code - - INTEGER(HID_T) :: fill_type_id ! Fill value datatype identifier - INTEGER(HID_T) :: mem_type_id ! Buffer dadtype identifier - - TYPE(C_PTR) :: f_ptr_fill_value ! C pointer to fill_value - TYPE(C_PTR) :: f_ptr_buf ! C pointer to buf - - f_ptr_fill_value = C_LOC(fill_value) - f_ptr_buf = C_LOC(buf(1)) - - hdferr = h5dfill_c(f_ptr_fill_value, fill_type_id, space_id, & - f_ptr_buf, mem_type_id) - - END SUBROUTINE h5dfill_char -! -!****s* H5D (F03)/h5dvlen_reclaim_f -! NAME -! h5dvlen_reclaim_f -! -! PURPOSE -! Reclaims VL datatype memory buffers. -! -! Inputs: -! -! type_id - Identifier of the datatype. -! space_id - Identifier of the dataspace. -! plist_id - Identifier of the property list used to create the buffer. -! buf - Pointer to the buffer to be reclaimed. -! -! Outputs: -! hdferr - Returns 0 if successful and -1 if fails -! -! AUTHOR -! M. Scot Breitenfeld -! January 11, 2011 -! -! Fortran2003 Interface: - SUBROUTINE h5dvlen_reclaim_f(type_id, space_id, plist_id, buf, hdferr) - USE, INTRINSIC :: ISO_C_BINDING, ONLY : C_PTR - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: type_id - INTEGER(HID_T), INTENT(IN) :: space_id - INTEGER(HID_T), INTENT(IN) :: plist_id - TYPE(C_PTR) , INTENT(INOUT) :: buf - INTEGER , INTENT(OUT) :: hdferr -!***** - - INTERFACE - INTEGER FUNCTION h5dvlen_reclaim_c(type_id, space_id, plist_id, buf) BIND(C, NAME='h5dvlen_reclaim_c') - USE H5GLOBAL - USE, INTRINSIC :: ISO_C_BINDING, ONLY : C_PTR - INTEGER(HID_T) :: type_id - INTEGER(HID_T) :: space_id - INTEGER(HID_T) :: plist_id - TYPE(C_PTR), VALUE :: buf - END FUNCTION h5dvlen_reclaim_c - END INTERFACE - - hdferr = H5Dvlen_reclaim_c(type_id, space_id, plist_id, buf) - - END SUBROUTINE H5Dvlen_reclaim_f - -END MODULE H5D_PROVISIONAL - - diff --git a/fortran/src/H5Dff_F90.f90 b/fortran/src/H5Dff_F90.f90 deleted file mode 100644 index 66cfe62..0000000 --- a/fortran/src/H5Dff_F90.f90 +++ /dev/null @@ -1,3004 +0,0 @@ -!****h* ROBODoc/H5D (F90) -! -! NAME -! -! H5D_PROVISIONAL -! -! PURPOSE -! -! This file contains Fortran 90 interfaces for H5D functions. It contains -! the same functions as H5Dff_F03.f90 but excludes the Fortran 2003 functions -! and the interface listings. This file will be compiled instead of H5Dff_F03.f90 -! if Fortran 2003 functions are not enabled. -! -! 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. * -! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -! -! NOTES -! (1) The maximum rank of an array allowed in Fortran is 7, therefore -! we only provide an interface for arrays up to and including rank 7. -! -! (2) Unfortunately we are using a generic interface and one of the factors -! used in determining the proper routine to select is that of the array -! rank being passed, therefore we can not create just one subroutine for -! each array type (integer, real, etc...) of various ranks and then use a -! rank 1 array of assumed size in the just one subroutine, -! (i.e. integer, dimension(*) :: ... ) -! (i.e. real , dimension(*) :: ... ) etc... -! -! (3) -! *** IMPORTANT *** -! If you add a new H5D function you must add the function name to the -! Windows dll file 'hdf5_fortrandll.def.in' in the fortran/src directory. -! This is needed for Windows based operating systems. -!***** - -MODULE H5D_PROVISIONAL - USE H5GLOBAL - - INTERFACE h5dwrite_f - - MODULE PROCEDURE h5dwrite_reference_obj - MODULE PROCEDURE h5dwrite_reference_dsetreg - MODULE PROCEDURE h5dwrite_integer_scalar - MODULE PROCEDURE h5dwrite_integer_1 - MODULE PROCEDURE h5dwrite_integer_2 - MODULE PROCEDURE h5dwrite_integer_3 - MODULE PROCEDURE h5dwrite_integer_4 - MODULE PROCEDURE h5dwrite_integer_5 - MODULE PROCEDURE h5dwrite_integer_6 - MODULE PROCEDURE h5dwrite_integer_7 - MODULE PROCEDURE h5dwrite_char_scalar - MODULE PROCEDURE h5dwrite_char_1 - MODULE PROCEDURE h5dwrite_char_2 - MODULE PROCEDURE h5dwrite_char_3 - MODULE PROCEDURE h5dwrite_char_4 - MODULE PROCEDURE h5dwrite_char_5 - MODULE PROCEDURE h5dwrite_char_6 - MODULE PROCEDURE h5dwrite_char_7 - MODULE PROCEDURE h5dwrite_real_scalar - MODULE PROCEDURE h5dwrite_real_1 - MODULE PROCEDURE h5dwrite_real_2 - MODULE PROCEDURE h5dwrite_real_3 - MODULE PROCEDURE h5dwrite_real_4 - MODULE PROCEDURE h5dwrite_real_5 - MODULE PROCEDURE h5dwrite_real_6 - MODULE PROCEDURE h5dwrite_real_7 - - END INTERFACE - - INTERFACE h5dread_f - - MODULE PROCEDURE h5dread_reference_obj - MODULE PROCEDURE h5dread_reference_dsetreg - MODULE PROCEDURE h5dread_integer_scalar - MODULE PROCEDURE h5dread_integer_1 - MODULE PROCEDURE h5dread_integer_2 - MODULE PROCEDURE h5dread_integer_3 - MODULE PROCEDURE h5dread_integer_4 - MODULE PROCEDURE h5dread_integer_5 - MODULE PROCEDURE h5dread_integer_6 - MODULE PROCEDURE h5dread_integer_7 - MODULE PROCEDURE h5dread_char_scalar - MODULE PROCEDURE h5dread_char_1 - MODULE PROCEDURE h5dread_char_2 - MODULE PROCEDURE h5dread_char_3 - MODULE PROCEDURE h5dread_char_4 - MODULE PROCEDURE h5dread_char_5 - MODULE PROCEDURE h5dread_char_6 - MODULE PROCEDURE h5dread_char_7 - MODULE PROCEDURE h5dread_real_scalar - MODULE PROCEDURE h5dread_real_1 - MODULE PROCEDURE h5dread_real_2 - MODULE PROCEDURE h5dread_real_3 - MODULE PROCEDURE h5dread_real_4 - MODULE PROCEDURE h5dread_real_5 - MODULE PROCEDURE h5dread_real_6 - MODULE PROCEDURE h5dread_real_7 - END INTERFACE - - INTERFACE h5dfill_f - MODULE PROCEDURE h5dfill_integer - MODULE PROCEDURE h5dfill_real - MODULE PROCEDURE h5dfill_char - END INTERFACE - -CONTAINS - -!****s* H5D/h5dread_f -! -! NAME -! h5dread_f -! -! PURPOSE -! Reads raw data from the specified dataset into buf, -! converting from file datatype and dataspace to memory -! datatype and dataspace. -! -! INPUTS -! dset_id - dataset identifier -! mem_type_id - memory type identifier -! dims - 1-dim array of size 7; dims(k) has the size -! of k-th dimension of the buf array -! OUTPUTS -! buf - buffer to read data in -! hdferr: - error code -! Success: 0 -! Failure: -1 -! -! OPTIONAL PARAMETERS -! mem_space_id - memory dataspace identifier -! file_space_id - file dataspace identifier -! xfer_prp - trasfer property list identifier -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). February 28, 2001 -! -! dims parameter was added to make code portable; -! n parameter was replaced with dims parameter in -! the h5dwrite_reference_obj and h5dwrite_reference_dsetreg -! functions. April 2, 2001 -! -! NOTES -! This function is overloaded to read INTEGER, -! REAL, DOUBLE PRECISION and CHARACTER buffers -! up to 7 dimensions, and one dimensional buffers -! of the TYPE(hobj_ref_t_f) and TYPE(hdset_reg_ref_t_f) types. -!***** - SUBROUTINE h5dread_reference_obj(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - TYPE(hobj_ref_t_f), INTENT(INOUT) , & - DIMENSION(dims(1)) :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HADDR_T), ALLOCATABLE, DIMENSION(:) :: ref_buf - INTEGER(HSIZE_T) :: j - - INTERFACE - INTEGER FUNCTION h5dread_ref_obj_c(dset_id, mem_type_id,& - mem_space_id_default, & - file_space_id_default, xfer_prp_default, ref_buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DREAD_REF_OBJ_C'::h5dread_ref_obj_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - INTEGER(HADDR_T), DIMENSION(*) :: ref_buf - END FUNCTION h5dread_ref_obj_c - END INTERFACE - - ALLOCATE(ref_buf(dims(1)), stat=hdferr) - IF (hdferr .NE. 0) THEN - hdferr = -1 - RETURN - ENDIF - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp - IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id - IF (PRESENT(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dread_ref_obj_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, ref_buf, dims) - DO j = 1, dims(1) - buf(j)%ref = ref_buf(j) - ENDDO - DEALLOCATE(ref_buf) - END SUBROUTINE h5dread_reference_obj - - SUBROUTINE h5dread_reference_dsetreg(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - TYPE(hdset_reg_ref_t_f), INTENT(INOUT), & - DIMENSION(dims(1)) :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER, ALLOCATABLE, DIMENSION(:) :: ref_buf - INTEGER :: i - INTEGER(HSIZE_T) :: j - - INTERFACE - INTEGER FUNCTION h5dread_ref_reg_c(dset_id, mem_type_id,& - mem_space_id_default, & - file_space_id_default, xfer_prp_default, ref_buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DREAD_REF_REG_C'::h5dread_ref_reg_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - INTEGER, DIMENSION(*) :: ref_buf - END FUNCTION h5dread_ref_reg_c - END INTERFACE - - ALLOCATE(ref_buf(REF_REG_BUF_LEN*dims(1)), stat=hdferr) - IF (hdferr .NE. 0) THEN - hdferr = -1 - RETURN - ENDIF - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp - IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id - IF (PRESENT(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dread_ref_reg_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, ref_buf, dims) - - DO j = 1, dims(1) - DO i = 1, REF_REG_BUF_LEN - buf(j)%ref(i) = ref_buf(REF_REG_BUF_LEN*(j-1) + i) - ENDDO - ENDDO - DEALLOCATE(ref_buf) - END SUBROUTINE h5dread_reference_dsetreg - - SUBROUTINE h5dread_integer_scalar(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - INTEGER, INTENT(INOUT) :: buf ! Data buffer - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - - INTERFACE - INTEGER FUNCTION h5dread_integer_s_c(dset_id, mem_type_id, & - mem_space_id_default, & - file_space_id_default, & - xfer_prp_default, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DREAD_INTEGER_S_C'::h5dread_integer_s_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - INTEGER, INTENT(OUT) :: buf - END FUNCTION h5dread_integer_s_c - END INTERFACE - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp - IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id - IF (PRESENT(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dread_integer_s_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, buf, dims) - - END SUBROUTINE h5dread_integer_scalar - - SUBROUTINE h5dread_integer_1(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - INTEGER, INTENT(INOUT), DIMENSION(dims(1)) :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - - INTERFACE - INTEGER FUNCTION h5dread_integer_1_c(dset_id, mem_type_id, & - mem_space_id_default, & - file_space_id_default, & - xfer_prp_default, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DREAD_INTEGER_1_C'::h5dread_integer_1_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - INTEGER, INTENT(OUT), DIMENSION(dims(1)) :: buf - END FUNCTION h5dread_integer_1_c - END INTERFACE - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp - IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id - IF (PRESENT(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dread_integer_1_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, buf, dims) - - END SUBROUTINE h5dread_integer_1 - - SUBROUTINE h5dread_integer_2(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - INTEGER, INTENT(INOUT), DIMENSION(dims(1),dims(2)) :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - - INTERFACE - INTEGER FUNCTION h5dread_integer_2_c(dset_id, mem_type_id, & - mem_space_id_default, & - file_space_id_default, & - xfer_prp_default, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DREAD_INTEGER_2_C'::h5dread_integer_2_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - INTEGER, INTENT(OUT), DIMENSION(dims(1),dims(2)) :: buf - END FUNCTION h5dread_integer_2_c - END INTERFACE - - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp - IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id - IF (PRESENT(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dread_integer_2_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, & - buf, dims) - - END SUBROUTINE h5dread_integer_2 - - SUBROUTINE h5dread_integer_3(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - INTEGER, INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3)) :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - - ! - ! MS FORTRAN needs explicit interface for C functions called here. - ! - INTERFACE - INTEGER FUNCTION h5dread_integer_3_c(dset_id, mem_type_id, & - mem_space_id_default, & - file_space_id_default, & - xfer_prp_default, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DREAD_INTEGER_3_C'::h5dread_integer_3_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - INTEGER, INTENT(OUT), DIMENSION(dims(1),dims(2),dims(3)) :: buf - END FUNCTION h5dread_integer_3_c - END INTERFACE - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp - IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id - IF (PRESENT(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dread_integer_3_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, & - buf, dims) - - END SUBROUTINE h5dread_integer_3 - - SUBROUTINE h5dread_integer_4(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - INTEGER, INTENT(INOUT), DIMENSION(dims(1),dims(2),dims(3),dims(4)) :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - - ! - ! MS FORTRAN needs explicit interface for C functions called here. - ! - INTERFACE - INTEGER FUNCTION h5dread_integer_4_c(dset_id, mem_type_id, & - mem_space_id_default, & - file_space_id_default, & - xfer_prp_default, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DREAD_INTEGER_4_C'::h5dread_integer_4_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - INTEGER, INTENT(OUT), DIMENSION(dims(1),dims(2),dims(3),dims(4)) :: buf - END FUNCTION h5dread_integer_4_c - END INTERFACE - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp - IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id - IF (PRESENT(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dread_integer_4_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, & - buf, dims) - - END SUBROUTINE h5dread_integer_4 - - SUBROUTINE h5dread_integer_5(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - INTEGER, INTENT(INOUT), DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - - ! - ! MS FORTRAN needs explicit interface for C functions called here. - ! - INTERFACE - INTEGER FUNCTION h5dread_integer_5_c(dset_id, mem_type_id, & - mem_space_id_default, & - file_space_id_default, & - xfer_prp_default, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DREAD_INTEGER_5_C'::h5dread_integer_5_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - INTEGER, INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) :: buf - END FUNCTION h5dread_integer_5_c - END INTERFACE - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp - IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id - IF (PRESENT(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dread_integer_5_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, & - buf, dims) - - END SUBROUTINE h5dread_integer_5 - - SUBROUTINE h5dread_integer_6(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - INTEGER, INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)) :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - - - INTERFACE - INTEGER FUNCTION h5dread_integer_6_c(dset_id, mem_type_id, & - mem_space_id_default, & - file_space_id_default, & - xfer_prp_default, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DREAD_INTEGER_6_C'::h5dread_integer_6_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - INTEGER, INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)) :: buf - END FUNCTION h5dread_integer_6_c - END INTERFACE - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp - IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id - IF (PRESENT(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dread_integer_6_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, & - buf, dims) - - END SUBROUTINE h5dread_integer_6 - - SUBROUTINE h5dread_integer_7(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - INTEGER, INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)) :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - - INTERFACE - INTEGER FUNCTION h5dread_integer_7_c(dset_id, mem_type_id, & - mem_space_id_default, & - file_space_id_default, & - xfer_prp_default, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DREAD_INTEGER_7_C'::h5dread_integer_7_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - INTEGER, INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)) :: buf - END FUNCTION h5dread_integer_7_c - END INTERFACE - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp - IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id - IF (PRESENT(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dread_integer_7_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, & - buf, dims) - - END SUBROUTINE h5dread_integer_7 - - SUBROUTINE h5dread_char_scalar(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - CHARACTER(LEN=*), INTENT(INOUT) :: buf ! Data buffer - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - - INTERFACE - INTEGER FUNCTION h5dreadc_s_c(dset_id, mem_type_id, & - mem_space_id_default, & - file_space_id_default, & - xfer_prp_default, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DREADC_S_C'::h5dreadc_s_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: buf - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - CHARACTER(LEN=*), INTENT(OUT) :: buf - END FUNCTION h5dreadc_s_c - END INTERFACE - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp - IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id - IF (PRESENT(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dreadc_s_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, buf, dims) - - END SUBROUTINE h5dread_char_scalar - - SUBROUTINE h5dread_char_1(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - CHARACTER(LEN=*), INTENT(INOUT), & - DIMENSION(dims(1)) :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - - INTERFACE - INTEGER FUNCTION h5dreadc_1_c(dset_id, mem_type_id, & - mem_space_id_default, & - file_space_id_default, & - xfer_prp_default, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DREADC_1_C'::h5dreadc_1_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: buf - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - CHARACTER(LEN=*), INTENT(INOUT), & - DIMENSION(dims(1)) :: buf - END FUNCTION h5dreadc_1_c - END INTERFACE - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp - IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id - IF (PRESENT(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dreadc_1_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, buf, dims) - - END SUBROUTINE h5dread_char_1 - - SUBROUTINE h5dread_char_2(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - CHARACTER(LEN=*), INTENT(INOUT), & - DIMENSION(dims(1),dims(2)) :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - - - INTERFACE - INTEGER FUNCTION h5dreadc_2_c(dset_id, mem_type_id, & - mem_space_id_default, & - file_space_id_default, & - xfer_prp_default, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DREADC_2_C'::h5dreadc_2_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: buf - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - CHARACTER(LEN=*), INTENT(INOUT), & - DIMENSION(dims(1),dims(2)) :: buf - END FUNCTION h5dreadc_2_c - END INTERFACE - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp - IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id - IF (PRESENT(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dreadc_2_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, buf, dims) - - END SUBROUTINE h5dread_char_2 - - SUBROUTINE h5dread_char_3(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - CHARACTER(LEN=*), INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3)) :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - - INTERFACE - INTEGER FUNCTION h5dreadc_3_c(dset_id, mem_type_id, & - mem_space_id_default, & - file_space_id_default, & - xfer_prp_default, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DREADC_3_C'::h5dreadc_3_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: buf - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - CHARACTER(LEN=*), INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3)) :: buf - END FUNCTION h5dreadc_3_c - END INTERFACE - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp - IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id - IF (PRESENT(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dreadc_3_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, buf, dims) - - END SUBROUTINE h5dread_char_3 - - SUBROUTINE h5dread_char_4(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - CHARACTER(LEN=*), INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4)) :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - - INTERFACE - INTEGER FUNCTION h5dreadc_4_c(dset_id, mem_type_id, & - mem_space_id_default, & - file_space_id_default, & - xfer_prp_default, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DREADC_4_C'::h5dreadc_4_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: buf - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - CHARACTER(LEN=*), INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4)) :: buf - END FUNCTION h5dreadc_4_c - END INTERFACE - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp - IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id - IF (PRESENT(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dreadc_4_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, buf, dims) - - END SUBROUTINE h5dread_char_4 - - SUBROUTINE h5dread_char_5(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - CHARACTER(LEN=*), INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - - INTERFACE - INTEGER FUNCTION h5dreadc_5_c(dset_id, mem_type_id, & - mem_space_id_default, & - file_space_id_default, & - xfer_prp_default, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DREADC_5_C'::h5dreadc_5_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: buf - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - CHARACTER(LEN=*), INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) :: buf - END FUNCTION h5dreadc_5_c - END INTERFACE - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp - IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id - IF (PRESENT(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dreadc_5_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, buf, dims) - - END SUBROUTINE h5dread_char_5 - - SUBROUTINE h5dread_char_6(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - CHARACTER(LEN=*), INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)) :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - - INTERFACE - INTEGER FUNCTION h5dreadc_6_c(dset_id, mem_type_id, & - mem_space_id_default, & - file_space_id_default, & - xfer_prp_default, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DREADC_6_C'::h5dreadc_6_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: buf - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - CHARACTER(LEN=*), INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)) :: buf - END FUNCTION h5dreadc_6_c - END INTERFACE - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp - IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id - IF (PRESENT(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dreadc_6_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, buf, dims) - - END SUBROUTINE h5dread_char_6 - - SUBROUTINE h5dread_char_7(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - CHARACTER(LEN=*), INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)) :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - - INTERFACE - INTEGER FUNCTION h5dreadc_7_c(dset_id, mem_type_id, & - mem_space_id_default, & - file_space_id_default, & - xfer_prp_default, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DREADC_7_C'::h5dreadc_7_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: buf - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - CHARACTER(LEN=*), INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)) :: buf - END FUNCTION h5dreadc_7_c - END INTERFACE - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp - IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id - IF (PRESENT(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dreadc_7_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, buf, dims) - - END SUBROUTINE h5dread_char_7 - - SUBROUTINE h5dread_real_scalar(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - REAL, INTENT(INOUT) :: buf ! Data buffer - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - - INTERFACE - INTEGER FUNCTION h5dread_real_s_c(dset_id, mem_type_id, & - mem_space_id_default, & - file_space_id_default, & - xfer_prp_default, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DREAD_REAL_S_C'::h5dread_real_s_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - REAL, INTENT(OUT) :: buf - END FUNCTION h5dread_real_s_c - END INTERFACE - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp - IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id - IF (PRESENT(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dread_real_s_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, buf, dims) - - END SUBROUTINE h5dread_real_scalar - - SUBROUTINE h5dread_real_1(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - REAL, INTENT(INOUT), & - DIMENSION(dims(1)) :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - - ! INTEGER, EXTERNAL :: h5dread_real_1_c - ! MS FORTRAN needs explicit interface for C functions called here. - ! - INTERFACE - INTEGER FUNCTION h5dread_real_1_c(dset_id, mem_type_id, & - mem_space_id_default, & - file_space_id_default, & - xfer_prp_default, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DREAD_REAL_1_C'::h5dread_real_1_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - REAL, INTENT(INOUT), & - DIMENSION(dims(1)) :: buf - END FUNCTION h5dread_real_1_c - END INTERFACE - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp - IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id - IF (PRESENT(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dread_real_1_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, buf, dims) - - END SUBROUTINE h5dread_real_1 - - SUBROUTINE h5dread_real_2(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - REAL, INTENT(INOUT), & - DIMENSION(dims(1),dims(2)) :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - - INTERFACE - INTEGER FUNCTION h5dread_real_2_c(dset_id, mem_type_id, & - mem_space_id_default, & - file_space_id_default, & - xfer_prp_default, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DREAD_REAL_2_C'::h5dread_real_2_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - REAL, INTENT(INOUT), & - DIMENSION(dims(1),dims(2)) :: buf - END FUNCTION h5dread_real_2_c - END INTERFACE - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp - IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id - IF (PRESENT(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dread_real_2_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, buf, dims) - - END SUBROUTINE h5dread_real_2 - - SUBROUTINE h5dread_real_3(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - REAL, INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3)) :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - - INTERFACE - INTEGER FUNCTION h5dread_real_3_c(dset_id, mem_type_id, & - mem_space_id_default, & - file_space_id_default, & - xfer_prp_default, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DREAD_REAL_3_C'::h5dread_real_3_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - REAL, INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3)) :: buf - END FUNCTION h5dread_real_3_c - END INTERFACE - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp - IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id - IF (PRESENT(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dread_real_3_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, buf, dims) - - END SUBROUTINE h5dread_real_3 - - SUBROUTINE h5dread_real_4(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - REAL, INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3), dims(4)) :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - - INTERFACE - INTEGER FUNCTION h5dread_real_4_c(dset_id, mem_type_id, & - mem_space_id_default, & - file_space_id_default, & - xfer_prp_default, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DREAD_REAL_4_C'::h5dread_real_4_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - REAL, INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3), dims(4)) :: buf - END FUNCTION h5dread_real_4_c - END INTERFACE - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp - IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id - IF (PRESENT(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dread_real_4_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, buf, dims) - - END SUBROUTINE h5dread_real_4 - - SUBROUTINE h5dread_real_5(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - REAL, INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - - INTERFACE - INTEGER FUNCTION h5dread_real_5_c(dset_id, mem_type_id, & - mem_space_id_default, & - file_space_id_default, & - xfer_prp_default, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DREAD_REAL_5_C'::h5dread_real_5_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - REAL, INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) :: buf - END FUNCTION h5dread_real_5_c - END INTERFACE - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp - IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id - IF (PRESENT(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dread_real_5_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, buf, dims) - - END SUBROUTINE h5dread_real_5 - - SUBROUTINE h5dread_real_6(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - REAL, INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)) :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - - INTERFACE - INTEGER FUNCTION h5dread_real_6_c(dset_id, mem_type_id, & - mem_space_id_default, & - file_space_id_default, & - xfer_prp_default, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DREAD_REAL_6_C'::h5dread_real_6_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - REAL, INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)) :: buf - END FUNCTION h5dread_real_6_c - END INTERFACE - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp - IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id - IF (PRESENT(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dread_real_6_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, buf, dims) - - END SUBROUTINE h5dread_real_6 - - SUBROUTINE h5dread_real_7(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - REAL, INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)) :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - - INTERFACE - INTEGER FUNCTION h5dread_real_7_c(dset_id, mem_type_id, & - mem_space_id_default, & - file_space_id_default, & - xfer_prp_default, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DREAD_REAL_7_C'::h5dread_real_7_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - REAL, INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)) :: buf - END FUNCTION h5dread_real_7_c - END INTERFACE - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp - IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id - IF (PRESENT(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dread_real_7_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, buf, dims) - - END SUBROUTINE h5dread_real_7 - - SUBROUTINE h5dwrite_reference_obj(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), DIMENSION(*), INTENT(IN) :: dims ! size of the bufffer buf - TYPE(hobj_ref_t_f), DIMENSION(dims(1)), INTENT(IN) :: buf ! Data buffer - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HADDR_T), ALLOCATABLE, DIMENSION(:) :: ref_buf - INTEGER(HSIZE_T) :: j - - INTERFACE - INTEGER FUNCTION h5dwrite_ref_obj_c(dset_id, mem_type_id,& - mem_space_id_default, & - file_space_id_default, xfer_prp_default, ref_buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DWRITE_REF_OBJ_C'::h5dwrite_ref_obj_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HADDR_T), DIMENSION(*) :: ref_buf - INTEGER(HSIZE_T), DIMENSION(*) :: dims - END FUNCTION h5dwrite_ref_obj_c - END INTERFACE - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp - IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id - IF (PRESENT(file_space_id)) file_space_id_default = file_space_id - - ALLOCATE(ref_buf(dims(1)), stat=hdferr) - IF (hdferr .NE. 0 ) THEN - hdferr = -1 - RETURN - ELSE - DO j = 1, dims(1) - ref_buf(j) = buf(j)%ref - ENDDO - ENDIF - hdferr = h5dwrite_ref_obj_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, ref_buf, dims(1)) - DEALLOCATE(ref_buf) - - END SUBROUTINE h5dwrite_reference_obj - - SUBROUTINE h5dwrite_reference_dsetreg(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), DIMENSION(*), INTENT(IN) :: dims ! size of the bufffer buf - TYPE(hdset_reg_ref_t_f), DIMENSION(dims(1)), INTENT(IN) :: buf ! Data buffer - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER, ALLOCATABLE, DIMENSION(:) :: ref_buf - INTEGER :: i - INTEGER(HSIZE_T) :: j - - INTERFACE - INTEGER FUNCTION h5dwrite_ref_reg_c(dset_id, mem_type_id,& - mem_space_id_default, & - file_space_id_default, xfer_prp_default, ref_buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DWRITE_REF_REG_C'::h5dwrite_ref_reg_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER, DIMENSION(*) :: ref_buf - INTEGER(HSIZE_T), DIMENSION(*) :: dims - END FUNCTION h5dwrite_ref_reg_c - END INTERFACE - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp - IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id - IF (PRESENT(file_space_id)) file_space_id_default = file_space_id - - ALLOCATE(ref_buf(REF_REG_BUF_LEN*dims(1)), stat=hdferr) - IF (hdferr .NE. 0 ) THEN - hdferr = -1 - RETURN - ELSE - DO j = 1, dims(1) - DO i = 1, REF_REG_BUF_LEN - ref_buf(REF_REG_BUF_LEN*(j-1) + i) = buf(j)%ref(i) - ENDDO - ENDDO - ENDIF - hdferr = h5dwrite_ref_reg_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, ref_buf, dims) - DEALLOCATE(ref_buf) - - END SUBROUTINE h5dwrite_reference_dsetreg - - SUBROUTINE h5dwrite_integer_scalar(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER, INTENT(IN) :: buf ! Data buffer - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - - INTERFACE - INTEGER FUNCTION h5dwrite_integer_s_c(dset_id, mem_type_id, & - mem_space_id_default, & - file_space_id_default, & - xfer_prp_default, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DWRITE_INTEGER_S_C'::h5dwrite_integer_s_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - INTEGER, INTENT(IN) :: buf - END FUNCTION h5dwrite_integer_s_c - END INTERFACE - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp - IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id - IF (PRESENT(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dwrite_integer_s_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, buf, dims) - - END SUBROUTINE h5dwrite_integer_scalar - - SUBROUTINE h5dwrite_integer_1(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - INTEGER, INTENT(IN), & - DIMENSION(dims(1)) :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - - INTERFACE - INTEGER FUNCTION h5dwrite_integer_1_c(dset_id, mem_type_id, & - mem_space_id_default, & - file_space_id_default, & - xfer_prp_default, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DWRITE_INTEGER_1_C'::h5dwrite_integer_1_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - INTEGER, INTENT(IN), & - DIMENSION(dims(1)) :: buf - END FUNCTION h5dwrite_integer_1_c - END INTERFACE - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp - IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id - IF (PRESENT(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dwrite_integer_1_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, buf, dims) - - END SUBROUTINE h5dwrite_integer_1 - - SUBROUTINE h5dwrite_integer_2(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - INTEGER, INTENT(IN), & - DIMENSION(dims(1),dims(2)) :: buf ! Data buffer - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - - INTERFACE - INTEGER FUNCTION h5dwrite_integer_2_c(dset_id, mem_type_id, & - mem_space_id_default, & - file_space_id_default, & - xfer_prp_default, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DWRITE_INTEGER_2_C'::h5dwrite_integer_2_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - INTEGER, INTENT(IN), & - DIMENSION(dims(1),dims(2)) :: buf - END FUNCTION h5dwrite_integer_2_c - END INTERFACE - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp - IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id - IF (PRESENT(file_space_id)) file_space_id_default = file_space_id - hdferr = h5dwrite_integer_2_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, & - buf, dims) - - END SUBROUTINE h5dwrite_integer_2 - - SUBROUTINE h5dwrite_integer_3(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - INTEGER, INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3)) :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - - INTERFACE - INTEGER FUNCTION h5dwrite_integer_3_c(dset_id, mem_type_id, & - mem_space_id_default, & - file_space_id_default, & - xfer_prp_default, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DWRITE_INTEGER_3_C'::h5dwrite_integer_3_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - INTEGER, INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3)) :: buf - END FUNCTION h5dwrite_integer_3_c - END INTERFACE - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp - IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id - IF (PRESENT(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dwrite_integer_3_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, & - buf, dims) - - END SUBROUTINE h5dwrite_integer_3 - - SUBROUTINE h5dwrite_integer_4(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - INTEGER, INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4)) :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - - INTERFACE - INTEGER FUNCTION h5dwrite_integer_4_c(dset_id, mem_type_id, & - mem_space_id_default, & - file_space_id_default, & - xfer_prp_default, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DWRITE_INTEGER_4_C'::h5dwrite_integer_4_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - INTEGER, INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4)) :: buf - END FUNCTION h5dwrite_integer_4_c - END INTERFACE - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp - IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id - IF (PRESENT(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dwrite_integer_4_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, & - buf, dims) - - END SUBROUTINE h5dwrite_integer_4 - - SUBROUTINE h5dwrite_integer_5(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - INTEGER, INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - - INTERFACE - INTEGER FUNCTION h5dwrite_integer_5_c(dset_id, mem_type_id, & - mem_space_id_default, & - file_space_id_default, & - xfer_prp_default, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DWRITE_INTEGER_5_C'::h5dwrite_integer_5_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - INTEGER, INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) :: buf - END FUNCTION h5dwrite_integer_5_c - END INTERFACE - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - - IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp - IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id - IF (PRESENT(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dwrite_integer_5_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, & - buf, dims) - - END SUBROUTINE h5dwrite_integer_5 - - SUBROUTINE h5dwrite_integer_6(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - INTEGER, INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)) :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - - INTERFACE - INTEGER FUNCTION h5dwrite_integer_6_c(dset_id, mem_type_id, & - mem_space_id_default, & - file_space_id_default, & - xfer_prp_default, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DWRITE_INTEGER_6_C'::h5dwrite_integer_6_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - INTEGER, INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)) :: buf - END FUNCTION h5dwrite_integer_6_c - END INTERFACE - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp - IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id - IF (PRESENT(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dwrite_integer_6_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, & - buf, dims) - - END SUBROUTINE h5dwrite_integer_6 - - SUBROUTINE h5dwrite_integer_7(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - INTEGER, INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)) :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - - INTERFACE - INTEGER FUNCTION h5dwrite_integer_7_c(dset_id, mem_type_id, & - mem_space_id_default, & - file_space_id_default, & - xfer_prp_default, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DWRITE_INTEGER_7_C'::h5dwrite_integer_7_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - INTEGER, INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)) :: buf - END FUNCTION h5dwrite_integer_7_c - END INTERFACE - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp - IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id - IF (PRESENT(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dwrite_integer_7_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, & - buf, dims) - - END SUBROUTINE h5dwrite_integer_7 - - - SUBROUTINE h5dwrite_char_scalar(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - CHARACTER(LEN=*), INTENT(IN) :: buf ! Data buffer - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - - INTERFACE - INTEGER FUNCTION h5dwritec_s_c(dset_id, mem_type_id, & - mem_space_id_default, & - file_space_id_default, & - xfer_prp_default, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DWRITEC_S_C'::h5dwritec_s_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: buf - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - CHARACTER(LEN=*), INTENT(IN) :: buf - END FUNCTION h5dwritec_s_c - END INTERFACE - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp - IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id - IF (PRESENT(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dwritec_s_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, buf, dims) - - END SUBROUTINE h5dwrite_char_scalar - - SUBROUTINE h5dwrite_char_1(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - CHARACTER(LEN=*), INTENT(IN), & - DIMENSION(dims(1)) :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - - INTERFACE - INTEGER FUNCTION h5dwritec_1_c(dset_id, mem_type_id, & - mem_space_id_default, & - file_space_id_default, & - xfer_prp_default, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DWRITEC_1_C'::h5dwritec_1_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: buf - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - CHARACTER(LEN=*), INTENT(IN), & - DIMENSION(dims(1)) :: buf - END FUNCTION h5dwritec_1_c - END INTERFACE - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp - IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id - IF (PRESENT(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dwritec_1_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, buf, dims) - - END SUBROUTINE h5dwrite_char_1 - - SUBROUTINE h5dwrite_char_2(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - CHARACTER(LEN=*), INTENT(IN), & - DIMENSION(dims(1),dims(2)) :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - - INTERFACE - INTEGER FUNCTION h5dwritec_2_c(dset_id, mem_type_id, & - mem_space_id_default, & - file_space_id_default, & - xfer_prp_default, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DWRITEC_2_C'::h5dwritec_2_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: buf - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - CHARACTER(LEN=*), INTENT(IN), & - DIMENSION(dims(1),dims(2)) :: buf - END FUNCTION h5dwritec_2_c - END INTERFACE - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp - IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id - IF (PRESENT(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dwritec_2_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, buf, dims) - - END SUBROUTINE h5dwrite_char_2 - - SUBROUTINE h5dwrite_char_3(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - CHARACTER(LEN=*), INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3)) :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - - INTERFACE - INTEGER FUNCTION h5dwritec_3_c(dset_id, mem_type_id, & - mem_space_id_default, & - file_space_id_default, & - xfer_prp_default, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DWRITEC_3_C'::h5dwritec_3_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: buf - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - CHARACTER(LEN=*), INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3)) :: buf - END FUNCTION h5dwritec_3_c - END INTERFACE - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp - IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id - IF (PRESENT(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dwritec_3_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, buf, dims) - - END SUBROUTINE h5dwrite_char_3 - - SUBROUTINE h5dwrite_char_4(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - CHARACTER(LEN=*), INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4)) :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - - INTERFACE - INTEGER FUNCTION h5dwritec_4_c(dset_id, mem_type_id, & - mem_space_id_default, & - file_space_id_default, & - xfer_prp_default, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DWRITEC_4_C'::h5dwritec_4_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: buf - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - CHARACTER(LEN=*), INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4)) :: buf - END FUNCTION h5dwritec_4_c - END INTERFACE - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp - IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id - IF (PRESENT(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dwritec_4_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, buf, dims) - - END SUBROUTINE h5dwrite_char_4 - - SUBROUTINE h5dwrite_char_5(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - CHARACTER(LEN=*), INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - - INTERFACE - INTEGER FUNCTION h5dwritec_5_c(dset_id, mem_type_id, & - mem_space_id_default, & - file_space_id_default, & - xfer_prp_default, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DWRITEC_5_C'::h5dwritec_5_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: buf - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - CHARACTER(LEN=*), INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) :: buf - END FUNCTION h5dwritec_5_c - END INTERFACE - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp - IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id - IF (PRESENT(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dwritec_5_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, buf, dims) - - END SUBROUTINE h5dwrite_char_5 - - SUBROUTINE h5dwrite_char_6(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - CHARACTER(LEN=*), INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)) :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - - INTERFACE - INTEGER FUNCTION h5dwritec_6_c(dset_id, mem_type_id, & - mem_space_id_default, & - file_space_id_default, & - xfer_prp_default, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DWRITEC_6_C'::h5dwritec_6_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: buf - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - CHARACTER(LEN=*), INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)) :: buf - END FUNCTION h5dwritec_6_c - END INTERFACE - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp - IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id - IF (PRESENT(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dwritec_6_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, buf, dims) - - END SUBROUTINE h5dwrite_char_6 - - SUBROUTINE h5dwrite_char_7(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - CHARACTER(LEN=*), INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)) :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - - INTERFACE - INTEGER FUNCTION h5dwritec_7_c(dset_id, mem_type_id, & - mem_space_id_default, & - file_space_id_default, & - xfer_prp_default, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DWRITEC_7_C'::h5dwritec_7_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: buf - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - CHARACTER(LEN=*), INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)) :: buf - END FUNCTION h5dwritec_7_c - END INTERFACE - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp - IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id - IF (PRESENT(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dwritec_7_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, buf, dims) - - END SUBROUTINE h5dwrite_char_7 - - SUBROUTINE h5dwrite_real_scalar(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - REAL, INTENT(IN) :: buf ! Data buffer - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - - INTERFACE - INTEGER FUNCTION h5dwrite_real_s_c(dset_id, mem_type_id, & - mem_space_id_default, & - file_space_id_default, & - xfer_prp_default, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DWRITE_REAL_S_C'::h5dwrite_real_s_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - REAL, INTENT(IN) :: buf - END FUNCTION h5dwrite_real_s_c - END INTERFACE - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp - IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id - IF (PRESENT(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dwrite_real_s_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, buf, dims) - - END SUBROUTINE h5dwrite_real_scalar - - SUBROUTINE h5dwrite_real_1(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - REAL, INTENT(IN), & - DIMENSION(dims(1)) :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - - INTERFACE - INTEGER FUNCTION h5dwrite_real_1_c(dset_id, mem_type_id, & - mem_space_id_default, & - file_space_id_default, & - xfer_prp_default, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DWRITE_REAL_1_C'::h5dwrite_real_1_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - REAL, INTENT(IN), & - DIMENSION(dims(1)) :: buf - END FUNCTION h5dwrite_real_1_c - END INTERFACE - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp - IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id - IF (PRESENT(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dwrite_real_1_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, buf, dims) - - END SUBROUTINE h5dwrite_real_1 - - SUBROUTINE h5dwrite_real_2(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - REAL, INTENT(IN), & - DIMENSION(dims(1),dims(2)) :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - - INTERFACE - INTEGER FUNCTION h5dwrite_real_2_c(dset_id, mem_type_id, & - mem_space_id_default, & - file_space_id_default, & - xfer_prp_default, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DWRITE_REAL_2_C'::h5dwrite_real_2_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - REAL, INTENT(IN), & - DIMENSION(dims(1),dims(2)) :: buf - END FUNCTION h5dwrite_real_2_c - END INTERFACE - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp - IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id - IF (PRESENT(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dwrite_real_2_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, buf, dims) - - END SUBROUTINE h5dwrite_real_2 - - SUBROUTINE h5dwrite_real_3(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - REAL, INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3)) :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - - INTERFACE - INTEGER FUNCTION h5dwrite_real_3_c(dset_id, mem_type_id, & - mem_space_id_default, & - file_space_id_default, & - xfer_prp_default, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DWRITE_REAL_3_C'::h5dwrite_real_3_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - REAL, INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3)) :: buf - END FUNCTION h5dwrite_real_3_c - END INTERFACE - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp - IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id - IF (PRESENT(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dwrite_real_3_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, buf, dims) - - END SUBROUTINE h5dwrite_real_3 - - SUBROUTINE h5dwrite_real_4(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - REAL, INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4)) :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - - INTERFACE - INTEGER FUNCTION h5dwrite_real_4_c(dset_id, mem_type_id, & - mem_space_id_default, & - file_space_id_default, & - xfer_prp_default, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DWRITE_REAL_4_C'::h5dwrite_real_4_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - REAL, INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4)) :: buf - END FUNCTION h5dwrite_real_4_c - END INTERFACE - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp - IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id - IF (PRESENT(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dwrite_real_4_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, buf, dims) - - END SUBROUTINE h5dwrite_real_4 - - SUBROUTINE h5dwrite_real_5(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - REAL, INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - - INTERFACE - INTEGER FUNCTION h5dwrite_real_5_c(dset_id, mem_type_id, & - mem_space_id_default, & - file_space_id_default, & - xfer_prp_default, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DWRITE_REAL_5_C'::h5dwrite_real_5_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - REAL, INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) :: buf - END FUNCTION h5dwrite_real_5_c - END INTERFACE - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp - IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id - IF (PRESENT(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dwrite_real_5_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, buf, dims) - - END SUBROUTINE h5dwrite_real_5 - - SUBROUTINE h5dwrite_real_6(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - REAL, INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)) :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - - INTERFACE - INTEGER FUNCTION h5dwrite_real_6_c(dset_id, mem_type_id, & - mem_space_id_default, & - file_space_id_default, & - xfer_prp_default, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DWRITE_REAL_6_C'::h5dwrite_real_6_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - REAL, INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)) :: buf - END FUNCTION h5dwrite_real_6_c - END INTERFACE - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp - IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id - IF (PRESENT(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dwrite_real_6_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, buf, dims) - - END SUBROUTINE h5dwrite_real_6 - - SUBROUTINE h5dwrite_real_7(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - REAL, INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)) :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - - INTERFACE - INTEGER FUNCTION h5dwrite_real_7_c(dset_id, mem_type_id, & - mem_space_id_default, & - file_space_id_default, & - xfer_prp_default, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DWRITE_REAL_7_C'::h5dwrite_real_7_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - REAL, INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)) :: buf - END FUNCTION h5dwrite_real_7_c - END INTERFACE - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp - IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id - IF (PRESENT(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dwrite_real_7_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, buf, dims) - - END SUBROUTINE h5dwrite_real_7 - -! -! NAME -! h5dfill_integer -! -! PURPOSE -! Fills dataspace elements with a fill value in a memory buffer. -! Only INTEGER, CHARACTER, REAL and DOUBLE PRECISION datatypes -! of the fillvalues and buffers are supported. Buffer and fillvalue -! are assumed to have the same datatype. -! Only one-dimesional buffers are supported. -! -! INPUTS -! fill_value - fill value -! space_id - memory space selection identifier -! buf - data buffer iin memory ro apply selection to -! - of k-th dimension of the buf array -! OUTPUTS -! hdferr: - error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! Elena Pourmal -! March 12, 2003 -! -! - - SUBROUTINE h5dfill_integer(fill_value, space_id, buf, hdferr) - IMPLICIT NONE - INTEGER, INTENT(IN) :: fill_value ! Fill value - INTEGER(HID_T), INTENT(IN) :: space_id ! Memory dataspace selection identifier - INTEGER, INTENT(IN), DIMENSION(*) :: buf ! Memory buffer to fill in - INTEGER, INTENT(OUT) :: hdferr ! Error code - - INTEGER(HID_T) :: fill_type_id ! Fill value datatype identifier - INTEGER(HID_T) :: mem_type_id ! Buffer dadtype identifier - - ! INTEGER, EXTERNAL :: h5dfill_integer_c - ! MS FORTRAN needs explicit interface for C functions called here. - ! - INTERFACE - INTEGER FUNCTION h5dfill_integer_c(fill_value, fill_type_id, space_id, & - buf, mem_type_id) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DFILL_INTEGER_C'::h5dfill_integer_c - !DEC$ENDIF - INTEGER, INTENT(IN) :: fill_value ! Fill value - INTEGER(HID_T) :: fill_type_id ! Fill value datatype identifier - INTEGER(HID_T), INTENT(IN) :: space_id ! Memory dataspace selection identifier - INTEGER, INTENT(IN), DIMENSION(*) :: buf ! Memory buffer to fill in - INTEGER(HID_T) :: mem_type_id ! Buffer dadtype identifier - END FUNCTION h5dfill_integer_c - END INTERFACE - fill_type_id = H5T_NATIVE_INTEGER - mem_type_id = H5T_NATIVE_INTEGER - - hdferr = h5dfill_integer_c(fill_value, fill_type_id, space_id, & - buf, mem_type_id) - - END SUBROUTINE h5dfill_integer - -! -! NAME -! h5dfill_real -! -! PURPOSE -! Fills dataspace elements with a fill value in a memory buffer. -! Only INTEGER, CHARACTER, REAL and DOUBLE PRECISION datatypes -! of the fillvalues and buffers are supported. Buffer and fillvalue -! are assumed to have the same datatype. -! Only one-dimesional buffers are supported. -! -! INPUTS -! fill_value - fill value -! space_id - memory space selection identifier -! buf - data buffer iin memory ro apply selection to -! - of k-th dimension of the buf array -! OUTPUTS -! hdferr: - error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! Elena Pourmal -! March 12, 2003 -! -! - - SUBROUTINE h5dfill_real(fill_valuer, space_id, buf, hdferr) - IMPLICIT NONE - REAL, INTENT(IN) :: fill_valuer ! Fill value - INTEGER(HID_T), INTENT(IN) :: space_id ! Memory dataspace selection identifier - REAL, INTENT(IN), DIMENSION(*) :: buf ! Memory buffer to fill in - INTEGER, INTENT(OUT) :: hdferr ! Error code - - INTEGER(HID_T) :: fill_type_id ! Fill value datatype identifier - INTEGER(HID_T) :: mem_type_id ! Buffer dadtype identifier - - ! INTEGER, EXTERNAL :: h5dfill_real_c - ! MS FORTRAN needs explicit interface for C functions called here. - ! - INTERFACE - INTEGER FUNCTION h5dfill_real_c(fill_valuer, fill_type_id, space_id, & - buf, mem_type_id) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DFILL_REAL_C'::h5dfill_real_c - !DEC$ENDIF - REAL, INTENT(IN) :: fill_valuer ! Fill value - INTEGER(HID_T) :: fill_type_id ! Fill value datatype identifier - INTEGER(HID_T), INTENT(IN) :: space_id ! Memory dataspace selection identifier - REAL, INTENT(IN), DIMENSION(*) :: buf ! Memory buffer to fill in - INTEGER(HID_T) :: mem_type_id ! Buffer dadtype identifier - END FUNCTION h5dfill_real_c - END INTERFACE - fill_type_id = H5T_NATIVE_REAL - mem_type_id = H5T_NATIVE_REAL - - hdferr = h5dfill_real_c(fill_valuer, fill_type_id, space_id, & - buf, mem_type_id) - END SUBROUTINE h5dfill_real - -! -! NAME -! h5dfill_char -! -! PURPOSE -! Fills dataspace elements with a fill value in a memory buffer. -! Only INTEGER, CHARACTER, REAL and DOUBLE PRECISION datatypes -! of the fillvalues and buffers are supported. Buffer and fillvalue -! are assumed to have the same datatype. -! Only one-dimesional buffers are supported. -! -! INPUTS -! fill_value - fill value -! space_id - memory space selection identifier -! buf - data buffer iin memory ro apply selection to -! - of k-th dimension of the buf array -! OUTPUTS -! hdferr: - error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! Elena Pourmal -! March 12, 2003 -! -! - - SUBROUTINE h5dfill_char(fill_value, space_id, buf, hdferr) - IMPLICIT NONE - CHARACTER, INTENT(IN) :: fill_value ! Fill value - INTEGER(HID_T), INTENT(IN) :: space_id ! Memory dataspace selection identifier - CHARACTER, INTENT(IN), DIMENSION(*) :: buf ! Memory buffer to fill in - INTEGER, INTENT(OUT) :: hdferr ! Error code - - INTEGER(HID_T) :: fill_type_id ! Fill value datatype identifier - INTEGER(HID_T) :: mem_type_id ! Buffer dadtype identifier - - ! INTEGER, EXTERNAL :: h5dfillc_c - ! MS FORTRAN needs explicit interface for C functions called here. - ! - INTERFACE - INTEGER FUNCTION h5dfillc_c(fill_value, fill_type_id, space_id, & - buf, mem_type_id) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DFILLC_C'::h5dfillc_c - !DEC$ENDIF - CHARACTER, INTENT(IN) :: fill_value ! Fill value - INTEGER(HID_T) :: fill_type_id ! Fill value datatype identifier - INTEGER(HID_T), INTENT(IN) :: space_id ! Memory dataspace selection identifier - CHARACTER, INTENT(IN), DIMENSION(*) :: buf ! Memory buffer to fill in - INTEGER(HID_T) :: mem_type_id ! Buffer dadtype identifier - END FUNCTION h5dfillc_c - END INTERFACE - fill_type_id = H5T_NATIVE_CHARACTER - mem_type_id = H5T_NATIVE_CHARACTER - - hdferr = h5dfillc_c(fill_value, fill_type_id, space_id, & - buf, mem_type_id) - - END SUBROUTINE h5dfill_char - - -END MODULE H5D_PROVISIONAL diff --git a/fortran/src/H5Ef.c b/fortran/src/H5Ef.c index f5c0c45..4b1d4c9 100644 --- a/fortran/src/H5Ef.c +++ b/fortran/src/H5Ef.c @@ -1,6 +1,6 @@ /****h* H5Ef/H5Ef * PURPOSE - * This file contains C stubs for H5E Fortran APIs + * This file contains C stubs for H5E Fortran APIs * * COPYRIGHT * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * @@ -42,7 +42,7 @@ * SOURCE */ int_f -nh5eclear_c(hid_t_f *estack_id ) +h5eclear_c(hid_t_f *estack_id ) /******/ { int_f ret_value = 0; @@ -78,7 +78,7 @@ done: * SOURCE */ int_f -nh5eprint_c1(_fcd name, int_f* namelen) +h5eprint_c1(_fcd name, int_f* namelen) /******/ { FILE *file = NULL; @@ -124,7 +124,7 @@ done: * SOURCE */ int_f -nh5eprint_c2(void) +h5eprint_c2(void) /******/ { int_f ret_value = 0; @@ -159,7 +159,7 @@ done: * SOURCE */ int_f -nh5eget_major_c(int_f* error_no, _fcd name, size_t_f* namelen) +h5eget_major_c(int_f* error_no, _fcd name, size_t_f* namelen) /******/ { char *c_name = NULL; @@ -207,7 +207,7 @@ done: * SOURCE */ int_f -nh5eget_minor_c(int_f* error_no, _fcd name, size_t_f* namelen) +h5eget_minor_c(int_f* error_no, _fcd name, size_t_f* namelen) /******/ { char *c_name = NULL; @@ -235,62 +235,25 @@ done: return ret_value; } -/****if* H5Ef/h5eset_auto_c - * NAME - * h5eset_auto_c - * PURPOSE - * Call H5Eset_auto to turn automatic error printing on or off. - * INPUTS - * printflag - flag to turn automatic error printing on or off. - * OUTPUTS - * - * RETURNS - * 0 on success, -1 on failure - * AUTHOR - * Elena Pourmal - * Friday, November 17, 2000 - * HISTORY - * Major bug fix: Function never disabled printing. - * SOURCE -*/ -int_f -nh5eset_auto_c(int_f* printflag) -/******/ -{ - herr_t status = -1; - int_f ret_value = 0; - - if(*printflag == 1) - status = H5Eset_auto2(H5E_DEFAULT, (H5E_auto2_t)H5Eprint2, stderr); - else if(*printflag == 0) - status = H5Eset_auto2(H5E_DEFAULT, NULL, NULL); - if(status < 0) - HGOTO_DONE(FAIL) - -done: - return ret_value; -} - - /****if* H5Ef/h5eset_auto2_c * NAME - * h5eset_auto2_c + * h5eset_auto2_c * PURPOSE - * Calls H5Eset_auto2 + * Calls H5Eset_auto2 * INPUTS - * estack_id - Error stack identifier. - * func - Function to be called upon an error condition. - * client_data - Data passed to the error function. + * estack_id - Error stack identifier. + * func - Function to be called upon an error condition. + * client_data - Data passed to the error function. * * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * M. Scot Breitenfeld - * July 22, 2009 + * July 22, 2009 * SOURCE */ /* int_f */ -/* nh5eset_auto2_c(hid_t_f *estack_id, H5E_auto2_t *func, void *client_data) */ +/* h5eset_auto2_c(hid_t_f *estack_id, H5E_auto2_t *func, void *client_data) */ /* /\******\/ */ /* { */ /* int ret_val = -1; */ diff --git a/fortran/src/H5Eff.F90 b/fortran/src/H5Eff.F90 new file mode 100644 index 0000000..a2efe61 --- /dev/null +++ b/fortran/src/H5Eff.F90 @@ -0,0 +1,302 @@ +!****h* ROBODoc/H5E +! +! NAME +! MODULE H5E +! +! FILE +! fortran/src/H5Eff.f90 +! +! PURPOSE +! This Module contains Fortran interfaces for H5E functions. +! +! 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. * +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! +! NOTES +! _____ __ __ _____ ____ _____ _______ _ _ _______ +! |_ _| \/ | __ \ / __ \| __ \__ __|/\ | \ | |__ __| +! **** | | | \ / | |__) | | | | |__) | | | / \ | \| | | | **** +! **** | | | |\/| | ___/| | | | _ / | | / /\ \ | . ` | | | **** +! **** _| |_| | | | | | |__| | | \ \ | |/ ____ \| |\ | | | **** +! |_____|_| |_|_| \____/|_| \_\ |_/_/ \_\_| \_| |_| +! +! If you add a new H5E function to the module you must add the function name +! to the Windows dll file 'hdf5_fortrandll.def.in' in the fortran/src directory. +! This is needed for Windows based operating systems. +! +!***** + +MODULE H5E + + USE, INTRINSIC :: ISO_C_BINDING, ONLY : C_PTR, C_FUNPTR, C_CHAR + USE H5GLOBAL + + !Turn on automatic printing of errors + INTEGER, PARAMETER :: PRINTON = 1 + + !Turn off automatic printing of errors + INTEGER, PARAMETER :: PRINTOFF = 0 + +CONTAINS + +!****s* H5E/h5eclear_f +! +! NAME +! h5eclear_f +! +! PURPOSE +! Clears the error stack for the current thread. +! +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails +! OPTIONAL PARAMETERS +! estack_id - Error Stack id +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). April 6, 2001 +! +! Added optional error stack identifier in order to bring +! the function in line with the h5eclear2 routine. +! MSB, July 9, 2009 +! +! SOURCE + SUBROUTINE h5eclear_f(hdferr, estack_id) + IMPLICIT NONE + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: estack_id +!***** + INTEGER(HID_T) :: estack_id_default + + INTERFACE + INTEGER FUNCTION h5eclear_c(estack_id_default) BIND(C,NAME='h5eclear_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T) :: estack_id_default + END FUNCTION h5eclear_c + END INTERFACE + + estack_id_default = H5E_DEFAULT_F + IF(PRESENT(estack_id)) estack_id_default = estack_id + + hdferr = h5eclear_c(estack_id_default) + END SUBROUTINE h5eclear_f + +!****s* H5E/h5eprint_f +! +! NAME +! h5eprint_f +! +! PURPOSE +! Prints the error stack in a default manner. +! +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails +! +! OPTIONAL PARAMETERS +! name - name of the file that contains print output +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). April 6, 2001 +! +! SOURCE + SUBROUTINE h5eprint_f(hdferr, name) + CHARACTER(LEN=*), OPTIONAL, INTENT(IN) :: name + INTEGER, INTENT(OUT) :: hdferr +!***** + INTEGER :: namelen + + INTERFACE + INTEGER FUNCTION h5eprint_c1(name, namelen) BIND(C,NAME='h5eprint_c1') + IMPORT :: C_CHAR + IMPLICIT NONE + INTEGER :: namelen + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: name + END FUNCTION h5eprint_c1 + END INTERFACE + + INTERFACE + INTEGER FUNCTION h5eprint_c2() BIND(C,NAME='h5eprint_c2') + END FUNCTION h5eprint_c2 + END INTERFACE + namelen = LEN(NAME) + IF (PRESENT(name)) THEN + hdferr = h5eprint_c1(name, namelen) + ELSE + hdferr = h5eprint_c2() + ENDIF + END SUBROUTINE h5eprint_f +!****s* H5E/h5eget_major_f +! +! NAME +! h5eget_major_f +! +! PURPOSE +! Returns a character string describing an error specified +! by a major error number. +! +! INPUTS +! error_no - major error number +! +! OUTPUTS +! name - character string describing the error +! namelen - number of characters in the name buffer +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). April 6, 2001 +! +! SOURCE + SUBROUTINE h5eget_major_f(error_no, name, namelen, hdferr) + INTEGER, INTENT(IN) :: error_no ! Major error number + CHARACTER(LEN=*), INTENT(OUT) :: name ! Character string describing + ! the error. + INTEGER(SIZE_T), INTENT(IN) :: namelen ! Anticipated number of characters + ! in name. + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + INTERFACE + INTEGER FUNCTION h5eget_major_c(error_no, name, namelen) BIND(C,NAME='h5eget_major_c') + IMPORT :: C_CHAR + IMPORT :: SIZE_T + IMPLICIT NONE + INTEGER :: error_no + CHARACTER(KIND=C_CHAR), DIMENSION(*) :: name + INTEGER(SIZE_T), INTENT(IN) :: namelen + END FUNCTION h5eget_major_c + END INTERFACE + + hdferr = h5eget_major_c(error_no, name, namelen) + END SUBROUTINE h5eget_major_f +!****s* H5E/h5eget_minor_f +! +! NAME +! h5eget_minor_f +! +! PURPOSE +! Returns a character string describing an error specified +! by a minor error number. +! +! INPUTS +! error_no - minor error number +! +! OUTPUTS +! name - character string describing the error +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). April 6, 2001 +! +! SOURCE + SUBROUTINE h5eget_minor_f(error_no, name, hdferr) + INTEGER, INTENT(IN) :: error_no ! Major error number + CHARACTER(LEN=*), INTENT(OUT) :: name ! Character string describing + ! the error + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + INTERFACE + INTEGER FUNCTION h5eget_minor_c(error_no, name) BIND(C,NAME='h5eget_minor_c') + IMPORT :: C_CHAR + INTEGER :: error_no + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(OUT) :: name + END FUNCTION h5eget_minor_c + END INTERFACE + + hdferr = h5eget_minor_c(error_no, name) + END SUBROUTINE h5eget_minor_f + +!****s* H5E/h5eset_auto_f +! +! NAME +! h5eset_auto_f +! +! PURPOSE +! Returns settings for automatic error stack traversal function and its data. +! +! Inputs: +! printflag - Flag to turn automatic error printing on or off; +! possible values are: +! printon (1) +! printoff(0) +! estack_id - Error stack identifier. +! func - Function to be called upon an error condition. +! client_data - Data passed to the error function +! +! Outputs: +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! M. Scot Breitenfeld +! July 10, 2009 +! +! Fortran2003 Interface: + SUBROUTINE h5eset_auto_f(printflag, hdferr, estack_id, func, client_data) + USE, INTRINSIC :: ISO_C_BINDING + INTEGER , INTENT(IN) :: printflag + INTEGER , INTENT(OUT) :: hdferr + INTEGER(HID_T), INTENT(IN) , OPTIONAL :: estack_id + TYPE(C_FUNPTR), INTENT(IN) , OPTIONAL :: func + TYPE(C_PTR) , INTENT(IN) , OPTIONAL :: client_data +!***** + INTEGER(HID_T) :: estack_id_default + TYPE(C_FUNPTR) :: func_default + TYPE(C_PTR) :: client_data_default + INTERFACE + INTEGER FUNCTION h5eset_auto2_c(printflag, estack_id, func, client_data) & + BIND(C, NAME='h5eset_auto2_c') + IMPORT :: c_ptr, c_funptr + IMPORT :: HID_T + INTEGER :: printflag + INTEGER(HID_T) :: estack_id + TYPE(C_FUNPTR), VALUE :: func + TYPE(C_PTR), VALUE :: client_data + END FUNCTION h5eset_auto2_c + END INTERFACE + + estack_id_default = -1 + func_default = C_NULL_FUNPTR + client_data_default = C_NULL_PTR + + IF(PRESENT(estack_id)) estack_id_default = estack_id + IF(PRESENT(func)) func_default = func + IF(PRESENT(client_data)) client_data_default = client_data + + hdferr = h5eset_auto2_c(printflag, estack_id_default, func_default, client_data_default) + END SUBROUTINE h5eset_auto_f + +END MODULE H5E + diff --git a/fortran/src/H5Eff.f90 b/fortran/src/H5Eff.f90 deleted file mode 100644 index 7b56376..0000000 --- a/fortran/src/H5Eff.f90 +++ /dev/null @@ -1,251 +0,0 @@ -!****h* ROBODoc/H5E -! -! NAME -! MODULE H5E -! -! FILE -! fortran/src/H5Eff.f90 -! -! PURPOSE -! This Module contains Fortran interfaces for H5E functions. -! -! 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. * -! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -! -! NOTES -! *** IMPORTANT *** -! If you add a new H5E function to the module you must add the function name -! to the Windows dll file 'hdf5_fortrandll.def.in' in the fortran/src directory. -! This is needed for Windows based operating systems. -! -!***** - -MODULE H5E - - USE H5GLOBAL - - !Turn on automatic printing of errors - INTEGER, PARAMETER :: PRINTON = 1 - - !Turn off automatic printing of errors - INTEGER, PARAMETER :: PRINTOFF = 0 - -CONTAINS - -!****s* H5E/h5eclear_f -! -! NAME -! h5eclear_f -! -! PURPOSE -! Clears the error stack for the current thread. -! -! OUTPUTS -! hdferr - Returns 0 if successful and -1 if fails -! OPTIONAL PARAMETERS -! estack_id - Error Stack id -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). April 6, 2001 -! -! Added optional error stack identifier in order to bring -! the function in line with the h5eclear2 routine. -! MSB, July 9, 2009 -! -! SOURCE - SUBROUTINE h5eclear_f(hdferr, estack_id) - IMPLICIT NONE - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: estack_id -!***** - INTEGER(HID_T) :: estack_id_default - - INTERFACE - INTEGER FUNCTION h5eclear_c(estack_id_default) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5ECLEAR_C'::h5eclear_c - !DEC$ENDIF - INTEGER(HID_T) :: estack_id_default - END FUNCTION h5eclear_c - END INTERFACE - - estack_id_default = H5E_DEFAULT_F - IF(PRESENT(estack_id)) estack_id_default = estack_id - - hdferr = h5eclear_c(estack_id_default) - END SUBROUTINE h5eclear_f - -!****s* H5E/h5eprint_f -! -! NAME -! h5eprint_f -! -! PURPOSE -! Prints the error stack in a default manner. -! -! OUTPUTS -! hdferr - Returns 0 if successful and -1 if fails -! -! OPTIONAL PARAMETERS -! name - name of the file that contains print output -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). April 6, 2001 -! -! SOURCE - SUBROUTINE h5eprint_f(hdferr, name) - CHARACTER(LEN=*), OPTIONAL, INTENT(IN) :: name ! File name - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTEGER :: namelen - - INTERFACE - INTEGER FUNCTION h5eprint_c1(name, namelen) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5EPRINT_C1'::h5eprint_c1 - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: name - INTEGER :: namelen - CHARACTER(LEN=*),INTENT(IN) :: name - END FUNCTION h5eprint_c1 - END INTERFACE - - INTERFACE - INTEGER FUNCTION h5eprint_c2() - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5EPRINT_C2'::h5eprint_c2 - !DEC$ENDIF - END FUNCTION h5eprint_c2 - END INTERFACE - namelen = LEN(NAME) - IF (PRESENT(name)) THEN - hdferr = h5eprint_c1(name, namelen) - ELSE - hdferr = h5eprint_c2() - ENDIF - END SUBROUTINE h5eprint_f -!****s* H5E/h5eget_major_f -! -! NAME -! h5eget_major_f -! -! PURPOSE -! Returns a character string describing an error specified -! by a major error number. -! -! INPUTS -! error_no - major error number -! -! OUTPUTS -! name - character string describing the error -! namelen - number of characters in the name buffer -! hdferr - Returns 0 if successful and -1 if fails -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). April 6, 2001 -! -! SOURCE - SUBROUTINE h5eget_major_f(error_no, name, namelen, hdferr) - INTEGER, INTENT(IN) :: error_no ! Major error number - CHARACTER(LEN=*), INTENT(OUT) :: name ! Character string describing - ! the error. - INTEGER(SIZE_T), INTENT(IN) :: namelen ! Anticipated number of characters - ! in name. - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTERFACE - INTEGER FUNCTION h5eget_major_c(error_no, name, namelen) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5EGET_MAJOR_C'::h5eget_major_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: name - INTEGER :: error_no - CHARACTER(LEN=*) :: name - INTEGER(SIZE_T), INTENT(IN) :: namelen - END FUNCTION h5eget_major_c - END INTERFACE - - hdferr = h5eget_major_c(error_no, name, namelen) - END SUBROUTINE h5eget_major_f -!****s* H5E/h5eget_minor_f -! -! NAME -! h5eget_minor_f -! -! PURPOSE -! Returns a character string describing an error specified -! by a minor error number. -! -! INPUTS -! error_no - minor error number -! -! OUTPUTS -! name - character string describing the error -! hdferr - Returns 0 if successful and -1 if fails -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). April 6, 2001 -! -! SOURCE - SUBROUTINE h5eget_minor_f(error_no, name, hdferr) - INTEGER, INTENT(IN) :: error_no ! Major error number - CHARACTER(LEN=*), INTENT(OUT) :: name ! Character string describing - ! the error - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTERFACE - INTEGER FUNCTION h5eget_minor_c(error_no, name) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5EGET_MINOR_C'::h5eget_minor_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: name - INTEGER :: error_no - CHARACTER(LEN=*) :: name - END FUNCTION h5eget_minor_c - END INTERFACE - - hdferr = h5eget_minor_c(error_no, name) - END SUBROUTINE h5eget_minor_f - -END MODULE H5E - diff --git a/fortran/src/H5Eff_F03.f90 b/fortran/src/H5Eff_F03.f90 deleted file mode 100644 index ff8d11c..0000000 --- a/fortran/src/H5Eff_F03.f90 +++ /dev/null @@ -1,108 +0,0 @@ -!****h* ROBODoc/H5E (F03) -! -! NAME -! H5E_PROVISIONAL -! -! FILE -! src/fortran/src/H5Eff_F03.f90 -! -! PURPOSE -! -! This file contains Fortran 90 and Fortran 2003 interfaces for H5E functions. -! It contains the same functions as H5Eff_F90.f90 but includes the -! Fortran 2003 functions and the interface listings. This file will be compiled -! instead of H5Eff_F90.f90 if Fortran 2003 functions are enabled. -! -! -! 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. * -! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -! -! NOTES -! *** IMPORTANT *** -! If you add a new H5E function to the module you must add the function name -! to the Windows dll file 'hdf5_fortrandll.def.in' in the fortran/src directory. -! This is needed for Windows based operating systems. -! -!***** - -MODULE H5E_PROVISIONAL - - USE H5GLOBAL - -CONTAINS - -!****s* H5E/h5eset_auto_f -! -! NAME -! h5eset_auto_f -! -! PURPOSE -! Returns settings for automatic error stack traversal function and its data. -! -! Inputs: -! printflag - Flag to turn automatic error printing on or off; -! possible values are: -! printon (1) -! printoff(0) -! estack_id - Error stack identifier. -! func - Function to be called upon an error condition. -! client_data - Data passed to the error function -! -! Outputs: -! hdferr - Returns 0 if successful and -1 if fails -! -! AUTHOR -! M. Scot Breitenfeld -! July 10, 2009 -! -! Fortran2003 Interface: - SUBROUTINE h5eset_auto_f(printflag, hdferr, estack_id, func, client_data) - USE, INTRINSIC :: ISO_C_BINDING - INTEGER , INTENT(IN) :: printflag - INTEGER , INTENT(OUT) :: hdferr - INTEGER(HID_T), INTENT(IN) , OPTIONAL :: estack_id - TYPE(C_FUNPTR), INTENT(IN) , OPTIONAL :: func - TYPE(C_PTR) , INTENT(IN) , OPTIONAL :: client_data -!***** - INTEGER(HID_T) :: estack_id_default - TYPE(C_FUNPTR) :: func_default - TYPE(C_PTR) :: client_data_default - INTERFACE - INTEGER FUNCTION h5eset_auto2_c(printflag, estack_id, func, client_data) & - BIND(C, NAME='h5eset_auto2_c') - USE, INTRINSIC :: ISO_C_BINDING, ONLY : c_ptr, c_funptr - USE H5GLOBAL - INTEGER :: printflag - INTEGER(HID_T) :: estack_id -!!$ TYPE(C_FUNPTR) :: func -!!$ TYPE(C_PTR), VALUE :: client_data - TYPE(C_FUNPTR), VALUE :: func - TYPE(C_PTR), VALUE :: client_data - END FUNCTION h5eset_auto2_c - END INTERFACE - - estack_id_default = -1 - func_default = C_NULL_FUNPTR - client_data_default = C_NULL_PTR - - IF(PRESENT(estack_id)) estack_id_default = estack_id - IF(PRESENT(func)) func_default = func - IF(PRESENT(client_data)) client_data_default = client_data - - hdferr = h5eset_auto2_c(printflag, estack_id_default, func_default, client_data_default) - END SUBROUTINE h5eset_auto_f - -END MODULE H5E_PROVISIONAL diff --git a/fortran/src/H5Eff_F90.f90 b/fortran/src/H5Eff_F90.f90 deleted file mode 100644 index 158ec12..0000000 --- a/fortran/src/H5Eff_F90.f90 +++ /dev/null @@ -1,89 +0,0 @@ -!****h* ROBODoc/H5E (F90) -! -! NAME -! MODULE H5E_PROVISIONAL -! -! PURPOSE -! This file contains Fortran 90 interfaces for H5E functions. It contains -! the same functions as H5Eff_F03.f90 but excludes the Fortran 2003 functions -! and the interface listings. This file will be compiled instead of H5Eff_F03.f90 -! if Fortran 2003 functions are not enabled. -! -! -! 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. * -! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -! -! *** IMPORTANT *** -! If you add a new H5D function you must add the function name to the -! Windows dll file 'hdf5_fortrandll.def.in' in the fortran/src directory. -! This is needed for Windows based operating systems. -!***** - -MODULE H5E_PROVISIONAL - - USE H5GLOBAL - -CONTAINS - -!****s* H5E/h5eset_auto_f -! -! NAME -! h5eset_auto_f -! -! PURPOSE -! Turns automatic error printing on or off. -! -! INPUTS -! printflag - Flag to turn automatic error printing on or off; -! possible values are: -! printon (1) -! printoff(0) -! OUTPUTS -! hdferr - Returns 0 if successful and -1 if fails -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). April 6, 2001 -! -! SOURCE - SUBROUTINE h5eset_auto_f(printflag, hdferr) - INTEGER, INTENT(IN) :: printflag ! flag to turn automatic error - ! printing on or off - ! possible values are: - ! printon (1) - ! printoff(0) - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTERFACE - INTEGER FUNCTION h5eset_auto_c(printflag) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5ESET_AUTO_C'::h5eset_auto_c - !DEC$ENDIF - INTEGER :: printflag - END FUNCTION h5eset_auto_c - END INTERFACE - - hdferr = h5eset_auto_c(printflag) - END SUBROUTINE h5eset_auto_f - - -END MODULE H5E_PROVISIONAL diff --git a/fortran/src/H5FDmpiof.c b/fortran/src/H5FDmpiof.c deleted file mode 100644 index bbdb170..0000000 --- a/fortran/src/H5FDmpiof.c +++ /dev/null @@ -1,258 +0,0 @@ -/****h* H5FDmpiof/H5FDmpiof - * - * PURPOSE - * This file contains C stubs for Parallel Fortran 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. * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * - ****** -*/ - -#include "H5f90.h" -#include -#include "H5public.h" - - -/* Support for C to Fortran translation in MPI */ -#ifndef H5_HAVE_MPI_MULTI_LANG_Comm -#define MPI_Comm_c2f(comm) (int_f)(comm) -#define MPI_Comm_f2c(comm) (MPI_Comm)(comm) -#endif /*MPI Comm*/ -#ifndef H5_HAVE_MPI_MULTI_LANG_Info -#define MPI_Info_c2f(info) (int_f)(info) -#define MPI_Info_f2c(info) (MPI_Info)(info) -#endif /*MPI Info*/ - -/****if* H5FDmpiof/h5pset_fapl_mpio_c - * NAME - * h5pset_fapl_mpio_c - * PURPOSE - * Call H5Pset_fapl_mpio to set mode for parallel I/O and the user - * supplied communicator and info object - * INPUTS - * prp_id - property list identifier - * comm - MPI communicator - * info - MPI info object - * RETURNS - * 0 on success, -1 on failure - * AUTHOR - * Elena Pourmal - * Thursday, October 26, 2000 - * HISTORY - * - * SOURCE -*/ -int_f -nh5pset_fapl_mpio_c(hid_t_f *prp_id, int_f* comm, int_f* info) -/******/ -{ - int ret_value = -1; - hid_t c_prp_id; - herr_t ret; - MPI_Comm c_comm; - MPI_Info c_info; - c_comm = MPI_Comm_f2c(*comm); - c_info = MPI_Info_f2c(*info); - - /* - * Call H5Pset_mpi function. - */ - c_prp_id = *prp_id; - ret = H5Pset_fapl_mpio(c_prp_id, c_comm, c_info); - if (ret < 0) return ret_value; - ret_value = 0; - return ret_value; -} -/****if* H5FDmpiof/h5pget_fapl_mpio_c - * NAME - * h5pget_fapl_mpio_c - * PURPOSE - * Call H5Pget_fapl_mpio to retrieve communicator and info object - * INPUTS - * prp_id - property list identifier - * comm - buffer to return MPI communicator - * info - buffer to return MPI info object - * RETURNS - * 0 on success, -1 on failure - * AUTHOR - * Elena Pourmal - * Thursday, October 26, 2000 - * HISTORY - * - * SOURCE -*/ -int_f -nh5pget_fapl_mpio_c(hid_t_f *prp_id, int_f* comm, int_f* info) -/******/ -{ - int ret_value = -1; - hid_t c_prp_id; - herr_t ret; - MPI_Comm c_comm; - MPI_Info c_info; - - /* - * Call H5Pget_mpi function. - */ - c_prp_id = *prp_id; - ret = H5Pget_fapl_mpio(c_prp_id, &c_comm, &c_info); - if (ret < 0) return ret_value; - *comm = (int_f) MPI_Comm_c2f(c_comm); - *info = (int_f) MPI_Info_c2f(c_info); - ret_value = 0; - return ret_value; -} -/****if* H5FDmpiof/h5pset_dxpl_mpio_c - * NAME - * h5pset_dxpl_mpio_c - * PURPOSE - * Call H5Pset_dxpl_mpio to set transfer mode of the dataset - * trasfer property list - * INPUTS - * prp_id - property list identifier - * data_xfer_mode - transfer mode - * RETURNS - * 0 on success, -1 on failure - * AUTHOR - * Elena Pourmal - * Thursday, October 26, 2000 - * HISTORY - * - * SOURCE -*/ -int_f -nh5pset_dxpl_mpio_c(hid_t_f *prp_id, int_f* data_xfer_mode) -/******/ -{ - int ret_value = -1; - hid_t c_prp_id; - herr_t ret; - H5FD_mpio_xfer_t c_data_xfer_mode; -/* - switch (*data_xfer_mode) { - - case H5FD_MPIO_INDEPENDENT_F: - c_data_xfer_mode = H5FD_MPIO_INDEPENDENT; - break; - - case H5FD_MPIO_COLLECTIVE_F: - c_data_xfer_mode = H5FD_MPIO_COLLECTIVE; - break; - default: - return ret_value; - } -*/ - c_data_xfer_mode = (H5FD_mpio_xfer_t)*data_xfer_mode; - /* - * Call H5Pset_dxpl_mpio function. - */ - c_prp_id = *prp_id; - ret = H5Pset_dxpl_mpio(c_prp_id, c_data_xfer_mode); - if (ret < 0) return ret_value; - ret_value = 0; - return ret_value; -} - -/****if* H5FDmpiof/h5pget_dxpl_mpio_c - * NAME - * h5pget_dxpl_mpio_c - * PURPOSE - * Call H5Pget_dxpl_mpio to get transfer mode of the dataset - * trasfer property list - * INPUTS - * prp_id - property list identifier - * data_xfer_mode - buffer to retrieve transfer mode - * RETURNS - * 0 on success, -1 on failure - * AUTHOR - * Elena Pourmal - * Thursday, June 15, 2000 - * HISTORY - * - * SOURCE -*/ -int_f -nh5pget_dxpl_mpio_c(hid_t_f *prp_id, int_f* data_xfer_mode) -/******/ -{ - int ret_value = -1; - hid_t c_prp_id; - herr_t ret; - H5FD_mpio_xfer_t c_data_xfer_mode; - - /* - * Call H5Pget_xfer function. - */ - c_prp_id = *prp_id; - ret = H5Pget_dxpl_mpio(c_prp_id, &c_data_xfer_mode); - if (ret < 0) return ret_value; - *data_xfer_mode = (int_f)c_data_xfer_mode; -/* - switch (c_data_xfer_mode) { - - case H5FD_MPIO_INDEPENDENT: - *data_xfer_mode = H5FD_MPIO_INDEPENDENT_F; - break; - - case H5FD_MPIO_COLLECTIVE: - *data_xfer_mode = H5FD_MPIO_COLLECTIVE_F; - break; - - default: - return ret_value; - } -*/ - ret_value = 0; - return ret_value; -} - -/****if* H5Pf/h5pget_mpio_actual_io_mode_c - * NAME - * h5pget_mpio_actual_io_mode_c - * PURPOSE - * Calls H5Pget_mpio_actual_io_mode - * - * INPUTS - * dxpl_id - Dataset transfer property list identifier. - * OUTPUTS - * actual_io_mode - The type of I/O performed by this process. - * - * RETURNS - * 0 on success, -1 on failure - * AUTHOR - * M. Scot Breitenfeld - * July 27, 2012 - * SOURCE -*/ -int_f -nh5pget_mpio_actual_io_mode_c(hid_t_f *dxpl_id, int_f *actual_io_mode) -/******/ -{ - int ret_value = -1; - H5D_mpio_actual_io_mode_t c_actual_io_mode; - - /* - * Call H5Pget_mpio_actual_io_mode_f function. - */ - if( (H5Pget_mpio_actual_io_mode((hid_t)*dxpl_id, &c_actual_io_mode)) <0 ) - return ret_value; /* error occurred */ - - *actual_io_mode =(int_f)c_actual_io_mode; - - ret_value = 0; - return ret_value; -} diff --git a/fortran/src/H5FDmpioff.f90 b/fortran/src/H5FDmpioff.f90 deleted file mode 100644 index 50a77d9..0000000 --- a/fortran/src/H5FDmpioff.f90 +++ /dev/null @@ -1,212 +0,0 @@ -!****h* ROBODoc/H5FDMPIO -! -! NAME -! MODULE H5FDMPIO -! -! PURPOSE -! This file contains Fortran interfaces for H5P functions needed by -! parallel MPI programs. -! -! 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. * -! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -! -! NOTES -! *** IMPORTANT *** -! If you add a new H5P function you must add the function name to the -! Windows dll file 'hdf5_fortrandll.def.in' in the fortran/src directory. -! This is needed for Windows based operating systems. -! -!***** - -MODULE H5FDMPIO - USE H5GLOBAL -CONTAINS - -!****s* H5FDMPIO/h5pset_fapl_mpio_f -! -! NAME -! h5pset_fapl_mpio_f -! -! PURPOSE -! Stores MPI IO communicator information to the file -! access property list. -! -! INPUTS -! prp_id - file access property list identifier -! comm - MPI-2 communicator -! info - MPI-2 info object -! OUTPUTS -! hdferr - Returns 0 if successful and -1 if fails -! AUTHOR -! Elena Pourmal -! November, 2000 -! -! SOURCE - SUBROUTINE h5pset_fapl_mpio_f(prp_id, comm, info, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER, INTENT(IN) :: comm ! MPI communicator to be used for file open - ! as defined in MPI_FILE_OPEN of MPI-2 - INTEGER, INTENT(IN) :: info ! MPI info object to be used for file open - ! as defined in MPI_FILE_OPEN of MPI-2 - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTEGER, EXTERNAL :: h5pset_fapl_mpio_c - hdferr = h5pset_fapl_mpio_c(prp_id, comm, info) - END SUBROUTINE h5pset_fapl_mpio_f - -!****s* H5FDMPIO/h5pget_fapl_mpio_f -! -! NAME -! h5pget_fapl_mpio_f -! -! PURPOSE -! Returns MPI communicator information. -! -! INPUTS -! prp_id - file access property list identifier -! OUTPUTS -! comm - MPI-2 communicator -! info - MPI-2 info object -! hdferr - Returns 0 if successful and -1 if fails -! -! AUTHOR -! Elena Pourmal -! November, 2000 -! -! SOURCE - SUBROUTINE h5pget_fapl_mpio_f(prp_id, comm, info, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER, INTENT(OUT) :: comm ! buffer to return communicator - INTEGER, INTENT(OUT) :: info ! buffer to return info object - ! as defined in MPI_FILE_OPEN of MPI-2 - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTEGER, EXTERNAL :: h5pget_fapl_mpio_c - hdferr = h5pget_fapl_mpio_c(prp_id, comm, info) - END SUBROUTINE h5pget_fapl_mpio_f - -!****s* H5FDMPIO/h5pset_dxpl_mpio_f -! -! NAME -! h5pset_dxpl_mpio_f -! -! PURPOSE -! Sets data transfer mode. -! -! INPUTS -! prp_id - data transfer property list identifier -! data_xfer_mode - transfer mode; possible values are: -! H5FD_MPIO_INDEPENDENT_F -! H5FD_MPIO_COLLECTIVE_F -! OUTPUTS -! hdferr - Returns 0 if successful and -1 if fails -! AUTHOR -! Elena Pourmal -! November, 2000 -! -! SOURCE - SUBROUTINE h5pset_dxpl_mpio_f(prp_id, data_xfer_mode, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER, INTENT(IN) :: data_xfer_mode ! Data transfer mode. Possible values are: - ! H5FD_MPIO_INDEPENDENT_F - ! H5FD_MPIO_COLLECTIVE_F - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTEGER, EXTERNAL :: h5pset_dxpl_mpio_c - hdferr = h5pset_dxpl_mpio_c(prp_id, data_xfer_mode) - END SUBROUTINE h5pset_dxpl_mpio_f - -!****s* H5FDMPIO/h5pget_dxpl_mpio_f -! -! NAME -! h5pget_dxpl_mpio_f -! -! PURPOSE -! Returns the data transfer mode. -! -! INPUTS -! prp_id - data transfer property list identifier -! OUTPUTS -! data_xfer_mode- transfer mode; possible values are: -! H5FD_MPIO_INDEPENDENT_F -! H5FD_MPIO_COLLECTIVE_F -! hdferr - Returns 0 if successful and -1 if fails -! -! AUTHOR -! Elena Pourmal -! November, 2000 -! -! SOURCE - SUBROUTINE h5pget_dxpl_mpio_f(prp_id, data_xfer_mode, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER, INTENT(OUT) :: data_xfer_mode ! Data transfer mode. Possible values are: - ! H5FD_MPIO_INDEPENDENT_F - ! H5FD_MPIO_COLLECTIVE_F - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTEGER, EXTERNAL :: h5pget_dxpl_mpio_c - hdferr = h5pget_dxpl_mpio_c(prp_id, data_xfer_mode) - END SUBROUTINE h5pget_dxpl_mpio_f - -!****s* H5P/h5pget_mpio_actual_io_mode_f -! NAME -! h5pget_mpio_actual_io_mode_f -! -! PURPOSE -! Retrieves the type of I/O that HDF5 actually performed on the last -! parallel I/O call. This is not necessarily the type of I/O requested. -! -! INPUTS -! dxpl_id - Dataset transfer property list identifier. -! OUTPUTS -! actual_io_mode - The type of I/O performed by this process. -! hdferr - Returns 0 if successful and -1 if fails. -! -! AUTHOR -! M. Scot Breitenfeld -! July 27, 2012 -! -! HISTORY -! -! Fortran90 Interface: - SUBROUTINE h5pget_mpio_actual_io_mode_f(dxpl_id, actual_io_mode, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dxpl_id - INTEGER , INTENT(OUT) :: actual_io_mode - INTEGER , INTENT(OUT) :: hdferr -!***** - INTERFACE - INTEGER FUNCTION h5pget_mpio_actual_io_mode_c(dxpl_id, actual_io_mode) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGET_MPIO_ACTUAL_IO_MODE_C'::h5pget_mpio_actual_io_mode_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: dxpl_id - INTEGER , INTENT(OUT) :: actual_io_mode - END FUNCTION h5pget_mpio_actual_io_mode_c - END INTERFACE - - actual_io_mode = -1 - - hdferr = h5pget_mpio_actual_io_mode_c(dxpl_id, actual_io_mode) - - END SUBROUTINE h5pget_mpio_actual_io_mode_f - -END MODULE H5FDMPIO diff --git a/fortran/src/H5Ff.c b/fortran/src/H5Ff.c index 1696672..c1cdb91 100644 --- a/fortran/src/H5Ff.c +++ b/fortran/src/H5Ff.c @@ -1,6 +1,6 @@ /****h* H5Ff/H5Ff * PURPOSE - * This file contains C stubs for H5F Fortran APIs + * This file contains C stubs for H5F Fortran APIs * * COPYRIGHT * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * @@ -26,26 +26,26 @@ /****if* H5Ff/h5fcreate_c * NAME - * h5fcreate_c + * h5fcreate_c * PURPOSE - * Call H5Fcreate to create the file + * Call H5Fcreate to create the file * INPUTS - * name - name of the file - * namelen - name length - * access_flags - file access flags - * crt_pr - identifier of creation property list - * acc_prp - identifier of access property list + * name - name of the file + * namelen - name length + * access_flags - file access flags + * crt_pr - identifier of creation property list + * acc_prp - identifier of access property list * OUTPUTS - * file_id - file identifier + * file_id - file identifier * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * Monday, July 26, 1999 + * Monday, July 26, 1999 * SOURCE */ int_f -nh5fcreate_c(_fcd name, int_f *namelen, int_f *access_flags, hid_t_f* crt_prp, hid_t_f *acc_prp, hid_t_f *file_id) +h5fcreate_c(_fcd name, int_f *namelen, int_f *access_flags, hid_t_f* crt_prp, hid_t_f *acc_prp, hid_t_f *file_id) /******/ { int ret_value = -1; @@ -95,23 +95,23 @@ nh5fcreate_c(_fcd name, int_f *namelen, int_f *access_flags, hid_t_f* crt_prp, h /****if* H5Ff/h5fflush_c * NAME - * h5fflush_c + * h5fflush_c * PURPOSE - * Call H5Fflush to flush the object + * Call H5Fflush to flush the object * INPUTS - * object_id - identifier of either a file, a dataset, - * a group, an attribute or a named data type - * scope - integer to specify the flushing action, either + * object_id - identifier of either a file, a dataset, + * a group, an attribute or a named data type + * scope - integer to specify the flushing action, either * H5F_SCOPE_GLOBAL or H5F_SCOPE_LOCAL * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Xiangyang Su - * Friday, November 5, 1999 + * Friday, November 5, 1999 * SOURCE */ int_f -nh5fflush_c (hid_t_f *object_id, int_f *scope) +h5fflush_c (hid_t_f *object_id, int_f *scope) /******/ { int ret_value = -1; @@ -136,24 +136,24 @@ nh5fflush_c (hid_t_f *object_id, int_f *scope) /****if* H5Ff/h5fmount_c * NAME - * h5fmount_c + * h5fmount_c * PURPOSE - * Call H5Fmount to mount the file + * Call H5Fmount to mount the file * INPUTS - * loc_id - Identifier for file or group - * dsetname - name of dataset - * namelen - dsetname length - * file_id - file identifier for the file to be mounted - * acc_prp - identifier of access property list + * loc_id - Identifier for file or group + * dsetname - name of dataset + * namelen - dsetname length + * file_id - file identifier for the file to be mounted + * acc_prp - identifier of access property list * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Xiangyang Su - * Monday, October 25, 1999 + * Monday, October 25, 1999 * HISTORY */ int_f -nh5fmount_c (hid_t_f *loc_id, _fcd dsetname, int_f *namelen, hid_t_f *file_id, hid_t_f *acc_prp) +h5fmount_c (hid_t_f *loc_id, _fcd dsetname, int_f *namelen, hid_t_f *file_id, hid_t_f *acc_prp) /******/ { int ret_value = -1; @@ -194,22 +194,22 @@ nh5fmount_c (hid_t_f *loc_id, _fcd dsetname, int_f *namelen, hid_t_f *file_id, h /****if* H5Ff/h5funmount_c * NAME - * h5funmount_c + * h5funmount_c * PURPOSE - * Call H5Funmount to unmount the file + * Call H5Funmount to unmount the file * INPUTS - * loc_id - Identifier for file or group - * dsetname - name of dataset - * namelen - dsetname length + * loc_id - Identifier for file or group + * dsetname - name of dataset + * namelen - dsetname length * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Xiangyang Su - * Monday, October 25, 1999 + * Monday, October 25, 1999 * SOURCE */ int_f -nh5funmount_c (hid_t_f *loc_id, _fcd dsetname, int_f *namelen) +h5funmount_c (hid_t_f *loc_id, _fcd dsetname, int_f *namelen) /******/ { int ret_value = -1; @@ -242,25 +242,25 @@ nh5funmount_c (hid_t_f *loc_id, _fcd dsetname, int_f *namelen) /****if* H5Ff/h5fopen_c * NAME - * h5fopen_c + * h5fopen_c * PURPOSE - * Call H5Fopen to open the file + * Call H5Fopen to open the file * INPUTS - * name - name of the file - * namelen - name length - * access_flags - file access flags - * acc_prp - identifier of access property list + * name - name of the file + * namelen - name length + * access_flags - file access flags + * acc_prp - identifier of access property list * OUTPUTS - * file_id - file identifier + * file_id - file identifier * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * Tuesday, August 3, 1999 + * Tuesday, August 3, 1999 * SOURCE */ int_f -nh5fopen_c (_fcd name, int_f *namelen, int_f *access_flags, hid_t_f *acc_prp, hid_t_f *file_id) +h5fopen_c (_fcd name, int_f *namelen, int_f *access_flags, hid_t_f *acc_prp, hid_t_f *file_id) /******/ { int ret_value = -1; @@ -305,22 +305,22 @@ nh5fopen_c (_fcd name, int_f *namelen, int_f *access_flags, hid_t_f *acc_prp, hi /****if* H5Ff/h5freopen_c * NAME - * h5freopen_c + * h5freopen_c * PURPOSE - * Call H5Freopen to open the file + * Call H5Freopen to open the file * INPUTS - * file_id1 - file identifier + * file_id1 - file identifier * OUTPUTS - * file_id2 - file identifier + * file_id2 - file identifier * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Xiangyang Su - * Wednesday, November 3, 1999 + * Wednesday, November 3, 1999 * SOURCE */ int_f -nh5freopen_c (hid_t_f *file_id1, hid_t_f *file_id2) +h5freopen_c (hid_t_f *file_id1, hid_t_f *file_id2) /******/ { int ret_value = -1; @@ -338,22 +338,22 @@ nh5freopen_c (hid_t_f *file_id1, hid_t_f *file_id2) /****if* H5Ff/h5fget_create_plist_c * NAME - * h5fget_create_plist_c + * h5fget_create_plist_c * PURPOSE - * Call H5Fget_create_plist to get the file creation property list + * Call H5Fget_create_plist to get the file creation property list * INPUTS - * file_id - file identifier + * file_id - file identifier * OUTPUTS - * prop_id - creation property list identifier + * prop_id - creation property list identifier * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal, Xiangyang Su - * Wednesday, November 3, 1999 + * Wednesday, November 3, 1999 * SOURCE */ int_f -nh5fget_create_plist_c (hid_t_f *file_id, hid_t_f *prop_id) +h5fget_create_plist_c (hid_t_f *file_id, hid_t_f *prop_id) /******/ { int ret_value = -1; @@ -371,24 +371,24 @@ nh5fget_create_plist_c (hid_t_f *file_id, hid_t_f *prop_id) /****if* H5Ff/h5fget_access_plist_c * NAME - * h5fget_access_plist_c + * h5fget_access_plist_c * PURPOSE - * Call H5Fget_access_plist to get the file access property list + * Call H5Fget_access_plist to get the file access property list * INPUTS - * file_id - file identifier + * file_id - file identifier * OUTPUTS - * access_id - access property list identifier + * access_id - access property list identifier * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * Monday, September 30, 2002 + * Monday, September 30, 2002 * HISTORY * * SOURCE */ int_f -nh5fget_access_plist_c (hid_t_f *file_id, hid_t_f *access_id) +h5fget_access_plist_c (hid_t_f *file_id, hid_t_f *access_id) /******/ { int ret_value = -1; @@ -406,26 +406,26 @@ nh5fget_access_plist_c (hid_t_f *file_id, hid_t_f *access_id) /****if* H5Ff/h5fis_hdf5_c * NAME - * h5fis_hdf5_c + * h5fis_hdf5_c * PURPOSE - * Call H5Fis_hdf5 to determone if the file is an HDF5 file + * Call H5Fis_hdf5 to determone if the file is an HDF5 file * INPUTS - * name - name of the file - * namelen - name length + * name - name of the file + * namelen - name length * OUTPUTS - * flag - 0 if file is not HDF5 file , positive if a file - * is an HDF5 file, and negative on failure. + * flag - 0 if file is not HDF5 file , positive if a file + * is an HDF5 file, and negative on failure. * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * Tuesday, August 3, 1999 + * Tuesday, August 3, 1999 * HISTORY * * SOURCE */ int_f -nh5fis_hdf5_c (_fcd name, int_f *namelen, int_f *flag) +h5fis_hdf5_c (_fcd name, int_f *namelen, int_f *flag) /******/ { int ret_value = -1; @@ -452,23 +452,23 @@ nh5fis_hdf5_c (_fcd name, int_f *namelen, int_f *flag) } /****if* H5Ff/h5fclose_c * NAME - * h5fclose_c + * h5fclose_c * PURPOSE - * Call H5Fclose to close the file + * Call H5Fclose to close the file * INPUTS - * file_id - identifier of the file to be closed + * file_id - identifier of the file to be closed * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * Monday, July 26, 1999 + * Monday, July 26, 1999 * HISTORY * * SOURCE */ int_f -nh5fclose_c ( hid_t_f *file_id ) +h5fclose_c ( hid_t_f *file_id ) /******/ { int ret_value = 0; @@ -480,27 +480,27 @@ nh5fclose_c ( hid_t_f *file_id ) } /****if* H5Ff/h5fget_obj_count_c * NAME - * h5fget_obj_count_c + * h5fget_obj_count_c * PURPOSE - * Call H5Fget_obj_count to get number of open objects within a file + * Call H5Fget_obj_count to get number of open objects within a file * INPUTS - * file_id - identifier of the file to be closed - * obj_type - type of the object + * file_id - identifier of the file to be closed + * obj_type - type of the object * RETURNS - * obj_count - number of objects - * 0 on success, -1 on failure + * obj_count - number of objects + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * Monday, September 30, 2002 + * Monday, September 30, 2002 * HISTORY * - * Changed type of obj_count to size_t_f - * Thursday, September 25, 2008 + * Changed type of obj_count to size_t_f + * Thursday, September 25, 2008 * SOURCE */ int_f -nh5fget_obj_count_c ( hid_t_f *file_id , int_f *obj_type, size_t_f * obj_count) +h5fget_obj_count_c ( hid_t_f *file_id , int_f *obj_type, size_t_f * obj_count) /******/ { int ret_value = 0; @@ -525,7 +525,7 @@ nh5fget_obj_count_c ( hid_t_f *file_id , int_f *obj_type, size_t_f * obj_count) * obj_type - type of the object * RETURNS * obj_ids - iarray of open objects identifiers - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal * Monday, September 30, 2002 @@ -538,7 +538,7 @@ nh5fget_obj_count_c ( hid_t_f *file_id , int_f *obj_type, size_t_f * obj_count) * SOURCE */ int_f -nh5fget_obj_ids_c ( hid_t_f *file_id , int_f *obj_type, size_t_f *max_objs, +h5fget_obj_ids_c ( hid_t_f *file_id , int_f *obj_type, size_t_f *max_objs, hid_t_f *obj_ids, size_t_f *num_objs) /******/ { @@ -569,22 +569,22 @@ nh5fget_obj_ids_c ( hid_t_f *file_id , int_f *obj_type, size_t_f *max_objs, /****if* H5Ff/h5fget_freespace_c * NAME - * h5fget_freespace_c + * h5fget_freespace_c * PURPOSE - * Call H5Fget_freespace to get amount of free space within a file + * Call H5Fget_freespace to get amount of free space within a file * INPUTS - * file_id - identifier of the file to query + * file_id - identifier of the file to query * RETURNS - * free_space - amount of free space in file - * 0 on success, -1 on failure + * free_space - amount of free space in file + * 0 on success, -1 on failure * AUTHOR * Quincey Koziol - * Tuesday, October 7, 2003 + * Tuesday, October 7, 2003 * SOURCE */ int_f -nh5fget_freespace_c ( hid_t_f *file_id , hssize_t_f *free_space) +h5fget_freespace_c ( hid_t_f *file_id , hssize_t_f *free_space) /******/ { int ret_value = 0; @@ -599,24 +599,24 @@ nh5fget_freespace_c ( hid_t_f *file_id , hssize_t_f *free_space) /****if* H5Ff/h5fget_name_c * NAME - * h5fget_name_c + * h5fget_name_c * PURPOSE - * Call H5Fget_name to get file's name + * Call H5Fget_name to get file's name * INPUTS - * obj_id - object identifier - * buflen -size of the buffer + * obj_id - object identifier + * buflen -size of the buffer * OUTPUTS - * buf - buffer to hold the name - * size - size of the file's name + * buf - buffer to hold the name + * size - size of the file's name * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * Tuesday, July 6, 2004 + * Tuesday, July 6, 2004 * SOURCE */ int_f -nh5fget_name_c(hid_t_f *obj_id, size_t_f *size, _fcd buf, size_t_f *buflen) +h5fget_name_c(hid_t_f *obj_id, size_t_f *size, _fcd buf, size_t_f *buflen) /******/ { char *c_buf = NULL; /* Buffer to hold C string */ @@ -648,22 +648,22 @@ done: /****if* H5Ff/h5fget_filesize_c * NAME - * h5fget_filesize_c + * h5fget_filesize_c * PURPOSE - * Call H5Fget_filesize to get file size + * Call H5Fget_filesize to get file size * INPUTS - * file_id - file identifier + * file_id - file identifier * OUTPUTS - * size - size of the file + * size - size of the file * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * Wednesday, July 7, 2004 + * Wednesday, July 7, 2004 * SOURCE */ int_f -nh5fget_filesize_c(hid_t_f *file_id, hsize_t_f *size) +h5fget_filesize_c(hid_t_f *file_id, hsize_t_f *size) /******/ { hsize_t size_c; diff --git a/fortran/src/H5Fff.F90 b/fortran/src/H5Fff.F90 new file mode 100644 index 0000000..c69ad82 --- /dev/null +++ b/fortran/src/H5Fff.F90 @@ -0,0 +1,871 @@ +!****h* ROBODoc/H5F +! +! NAME +! MODULE H5F +! +! FILE +! H5Fff.f90 +! +! PURPOSE +! This file contains Fortran interfaces for H5F functions. +! +! 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. * +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! +! NOTES +! _____ __ __ _____ ____ _____ _______ _ _ _______ +! |_ _| \/ | __ \ / __ \| __ \__ __|/\ | \ | |__ __| +! **** | | | \ / | |__) | | | | |__) | | | / \ | \| | | | **** +! **** | | | |\/| | ___/| | | | _ / | | / /\ \ | . ` | | | **** +! **** _| |_| | | | | | |__| | | \ \ | |/ ____ \| |\ | | | **** +! |_____|_| |_|_| \____/|_| \_\ |_/_/ \_\_| \_| |_| +! +! If you add a new H5F function you must add the function name to the +! Windows dll file 'hdf5_fortrandll.def.in' in the fortran/src directory. +! This is needed for Windows based operating systems. +! +!***** + +MODULE H5F + USE, INTRINSIC :: ISO_C_BINDING, ONLY : C_PTR, C_CHAR, C_NULL_PTR + USE H5GLOBAL + IMPLICIT NONE + +CONTAINS +!****s* H5F/h5fcreate_f +! +! NAME +! h5fcreate_f +! +! PURPOSE +! Creates HDF5 files. +! +! INPUTS +! name - name of the file to create +! access_flags - File access flags. Allowable values are: +! H5F_ACC_TRUNC_F +! H5F_ACC_EXCL_F +! OUTPUTS +! file_id - file identifier +! hdferr - Returns 0 if successful and -1 if fails +! +! OPTIONAL PARAMETERS +! creation_prp - file creation property list identifier +! access_prp - file access property list identifier +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). February 28, 2001 +! +! SOURCE + SUBROUTINE h5fcreate_f(name, access_flags, file_id, hdferr, & + creation_prp, access_prp) + IMPLICIT NONE + CHARACTER(LEN=*), INTENT(IN) :: name ! Name of the file + INTEGER, INTENT(IN) :: access_flags ! File access flags + INTEGER(HID_T), INTENT(OUT) :: file_id ! File identifier + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: creation_prp + ! File creation propertly + ! list identifier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: access_prp + ! File access property list + ! identifier +!***** + INTEGER(HID_T) :: creation_prp_default + INTEGER(HID_T) :: access_prp_default + INTEGER :: namelen ! Length of the name character string + + INTERFACE + INTEGER FUNCTION h5fcreate_c(name, namelen, access_flags, & + creation_prp_default, access_prp_default, file_id) BIND(C,NAME='h5fcreate_c') + IMPORT :: C_CHAR + IMPORT :: HID_T + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: name + INTEGER, INTENT(IN) :: access_flags + INTEGER(HID_T), INTENT(OUT) :: file_id + INTEGER(HID_T), INTENT(IN) :: creation_prp_default + INTEGER(HID_T), INTENT(IN) :: access_prp_default + INTEGER :: namelen + END FUNCTION h5fcreate_c + END INTERFACE + + creation_prp_default = H5P_DEFAULT_F + access_prp_default = H5P_DEFAULT_F + + IF (PRESENT(creation_prp)) creation_prp_default = creation_prp + IF (PRESENT(access_prp)) access_prp_default = access_prp + namelen = LEN_TRIM(name) + hdferr = h5fcreate_c(name, namelen, access_flags, & + creation_prp_default, access_prp_default, file_id) + + END SUBROUTINE h5fcreate_f +!****s* H5F/h5fflush_f +! +! NAME +! h5fflush_f +! +! PURPOSE +! Flushes all buffers associated WITH a file to disk +! +! INPUTS +! object_id - identifier of object used to identify the file. +! scope - specifies the scope of the flushing action. +! Possible values are: +! H5F_SCOPE_GLOBAL_F +! H5F_SCOPE_LOCAL_F +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails +! +! OPTIONAL PARAMETERS +! creation_prp - file creation property list identifier +! access_prp - file access property list identifier +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). February 28, 2001 +! +! SOURCE + SUBROUTINE h5fflush_f(object_id, scope, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: object_id !identifier for any object + !associate with a file, + !including the file itself, + !a dataset, a group, an + !attribute, or a named + !data type + + INTEGER, INTENT(IN) :: scope !scope of the flushing + !action, possible values + !are: H5F_SCOPE_GLOBAL_F + ! which flushes the entire + !virtual file, + !and H5F_SCOPE_LOCAL_F + !which flushes only the + !specified file. + + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + INTERFACE + INTEGER FUNCTION h5fflush_c(object_id, scope) BIND(C,NAME='h5fflush_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: object_id + INTEGER, INTENT(IN) :: scope + END FUNCTION h5fflush_c + END INTERFACE + + hdferr = h5fflush_c(object_id, scope) + + END SUBROUTINE h5fflush_f +!****s* H5F/h5fmount_f +! +! NAME +! h5fmount_f +! +! PURPOSE +! Mounts a file. +! +! INPUTS +! loc_id - the identifier for of file or group in +! which name is defined +! name - the name of the group onto which the file +! specified by child_id is to be mounted. +! child_id - the identifier of the file to be mounted. +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails +! OPTIONAL PARAMETERS +! access_prp - the identifier of the property list to be used +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). February 28, 2001 +! +! SOURCE + SUBROUTINE h5fmount_f(loc_id, name, child_id, hdferr, access_prp) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id ! Identifier for file or group + ! in which dsetname is defined + CHARACTER(LEN=*), INTENT(IN) :: name ! Name of the group + INTEGER(HID_T), INTENT(IN) :: child_id ! File identifier for the + ! file to be mounted + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: access_prp + ! File access property list + ! identifier +!***** + INTEGER(HID_T) :: access_prp_default + INTEGER :: namelen ! Length of the name character string + + INTERFACE + INTEGER FUNCTION h5fmount_c(loc_id, name, namelen, & + child_id, access_prp_default) BIND(C,NAME='h5fmount_c') + IMPORT :: C_CHAR + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: name + INTEGER(HID_T), INTENT(IN) :: child_id + INTEGER(HID_T), INTENT(IN) :: access_prp_default + INTEGER :: namelen + END FUNCTION h5fmount_c + END INTERFACE + + access_prp_default = H5P_DEFAULT_F + IF (PRESENT(access_prp)) access_prp_default = access_prp + namelen = LEN_TRIM(name) + hdferr = h5fmount_c(loc_id, name, namelen, child_id, access_prp_default) + + END SUBROUTINE h5fmount_f + +!****s* H5F/h5funmount_f +! +! NAME +! h5funmount_f +! +! PURPOSE +! Unmounts a file. +! +! INPUTS +! loc_id - the identifier for of file or group in +! which name is defined +! name - the name of the mount point +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). February 28, 2001 +! +! SOURCE + SUBROUTINE h5funmount_f(loc_id, name, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id ! Identifier for file or group + ! at which the specified file + ! is to be unmounted + CHARACTER(LEN=*), INTENT(IN) :: name ! Name of the mount point + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + INTEGER :: namelen ! Length of the name character string + + INTERFACE + INTEGER FUNCTION h5funmount_c(loc_id, name, namelen) BIND(C,NAME='h5funmount_c') + IMPORT :: C_CHAR + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: name + INTEGER :: namelen + END FUNCTION h5funmount_c + END INTERFACE + + namelen = LEN_TRIM(name) + hdferr = h5funmount_c(loc_id, name, namelen) + + END SUBROUTINE h5funmount_f +!****s* H5F/h5fopen_f +! +! NAME +! h5fopen_f +! +! PURPOSE +! Opens HDF5 file. +! +! INPUTS +! name - name of the file to acecss +! access_flags - File access flags. Allowable values are: +! H5F_ACC_RDWR_F +! H5F_ACC_RDONLY_F +! OUTPUTS +! file_id - file identifier +! hdferr - Returns 0 if successful and -1 if fails +! OPTIONAL PARAMETERS +! access_prp - file access property list identifier +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). February 28, 2001 +! +! SOURCE + SUBROUTINE h5fopen_f(name, access_flags, file_id, hdferr, access_prp) + IMPLICIT NONE + CHARACTER(LEN=*), INTENT(IN) :: name ! Name of the file + INTEGER, INTENT(IN) :: access_flags ! File access flags + INTEGER(HID_T), INTENT(OUT) :: file_id ! File identifier + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: access_prp + ! File access property list + ! identifier +!***** + INTEGER(HID_T) :: access_prp_default + INTEGER :: namelen ! Length of the name character string + + INTERFACE + INTEGER FUNCTION h5fopen_c(name, namelen, access_flags, & + access_prp_default, file_id) BIND(C,NAME='h5fopen_c') + IMPORT :: C_CHAR + IMPORT :: HID_T + IMPLICIT NONE + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: name + INTEGER :: namelen + INTEGER, INTENT(IN) :: access_flags + INTEGER(HID_T), INTENT(IN) :: access_prp_default + INTEGER(HID_T), INTENT(OUT) :: file_id + END FUNCTION h5fopen_c + END INTERFACE + + access_prp_default = H5P_DEFAULT_F + IF (PRESENT(access_prp)) access_prp_default = access_prp + namelen = LEN_TRIM(name) + hdferr = h5fopen_c(name, namelen, access_flags, & + access_prp_default, file_id) + END SUBROUTINE h5fopen_f +!****s* H5F/h5freopen_f +! +! NAME +! h5freopen_f +! +! PURPOSE +! Reopens HDF5 file. +! +! INPUTS +! file_id - identifier of a file for which an +! additional identifier is required +! OUTPUTS +! ret_file_id - new file identifier +! hdferr - Returns 0 if successful and -1 if fails +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). February 28, 2001 +! +! SOURCE + SUBROUTINE h5freopen_f(file_id, ret_file_id, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: file_id ! File identifier + INTEGER(HID_T), INTENT(OUT) :: ret_file_id ! New File identifier + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + INTERFACE + INTEGER FUNCTION h5freopen_c(file_id, ret_file_id) BIND(C,NAME='h5freopen_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: file_id + INTEGER(HID_T), INTENT(OUT) :: ret_file_id + END FUNCTION h5freopen_c + END INTERFACE + + hdferr = h5freopen_c(file_id, ret_file_id) + + END SUBROUTINE h5freopen_f +!****s* H5F/h5fget_create_plist_f +! +! NAME +! h5fget_create_plist_f +! +! PURPOSE +! Returns a file creation property list identifier. +! +! INPUTS +! file_id - identifier of a file to creation property list of +! OUTPUTS +! prop_id - creation property list identifier +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). February 28, 2001 +! +! SOURCE + SUBROUTINE h5fget_create_plist_f(file_id, prop_id, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: file_id ! File identifier + INTEGER(HID_T), INTENT(OUT) :: prop_id ! File creation property + ! list identifier + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + INTERFACE + INTEGER FUNCTION h5fget_create_plist_c(file_id, prop_id) BIND(C,NAME='h5fget_create_plist_c') + 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 + END INTERFACE + + hdferr = h5fget_create_plist_c(file_id, prop_id) + + END SUBROUTINE h5fget_create_plist_f +!****s* H5F/h5fget_access_plist_f +! +! NAME +! h5fget_access_plist_f +! +! PURPOSE +! Returns a file access property list identifier. +! +! INPUTS +! file_id - identifier of a file to creation property list of +! OUTPUTS +! access_id - access property list identifier +! hdferr - Returns 0 if successful and -1 if fails +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). February 28, 2001 +! +! SOURCE + SUBROUTINE h5fget_access_plist_f(file_id, access_id, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: file_id ! File identifier + INTEGER(HID_T), INTENT(OUT) :: access_id ! File access property + ! list identifier + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + INTERFACE + INTEGER FUNCTION h5fget_access_plist_c(file_id, access_id) BIND(C,NAME='h5fget_access_plist_c') + 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 + END INTERFACE + + hdferr = h5fget_access_plist_c(file_id, access_id) + + END SUBROUTINE h5fget_access_plist_f + +!****s* H5F/h5fis_hdf5_f +! +! NAME +! h5fis_hdf5_f +! +! PURPOSE +! Determines whether a file is in the HDF5 format. +! +! INPUTS +! name - name of the file to check +! OUTPUTS +! status - indicates if file is and HDF5 file +! hdferr - Returns 0 if successful and -1 if fails +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). February 28, 2001 +! +! SOURCE + SUBROUTINE h5fis_hdf5_f(name, status, hdferr) + IMPLICIT NONE + CHARACTER(LEN=*), INTENT(IN) :: name ! Name of the file + LOGICAL, INTENT(OUT) :: status ! Indicates if file + ! is an HDF5 file + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + INTEGER :: namelen ! Length of the name character string + INTEGER :: flag ! "TRUE/FALSE" flag from C routine + ! to define status value. + + INTERFACE + INTEGER FUNCTION h5fis_hdf5_c(name, namelen, flag) BIND(C,NAME='h5fis_hdf5_c') + IMPORT :: C_CHAR + IMPLICIT NONE + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: name + INTEGER :: namelen + INTEGER :: flag + END FUNCTION h5fis_hdf5_c + END INTERFACE + + namelen = LEN_TRIM(name) + hdferr = h5fis_hdf5_c(name, namelen, flag) + status = .TRUE. + IF (flag .EQ. 0) status = .FALSE. + + END SUBROUTINE h5fis_hdf5_f +!****s* H5F/h5fclose_f +! +! NAME +! h5fclose_f +! +! PURPOSE +! Closes HDF5 file. +! +! INPUTS +! file_id - file identifier +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). February 28, 2001 +! +! SOURCE + SUBROUTINE h5fclose_f(file_id, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: file_id ! File identifier + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + INTERFACE + INTEGER FUNCTION h5fclose_c(file_id) BIND(C,NAME='h5fclose_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: file_id + END FUNCTION h5fclose_c + END INTERFACE + + hdferr = h5fclose_c(file_id) + + END SUBROUTINE h5fclose_f + +!****s* H5F/h5fget_obj_count_f +! +! NAME +! h5fget_obj_count_f +! +! PURPOSE +! Gets number of the objects open within a file +! +! INPUTS +! file_id - file identifier +! obj_type - type of the object; possible values are: +! H5F_OBJ_FILE_F +! H5F_OBJ_DATASET_F +! H5F_OBJ_GROUP_F +! H5F_OBJ_DATATYPE_F +! H5F_OBJ_ALL_F +! OUTPUTS +! obj_count - number of open objects +! hdferr - Returns 0 if successful and -1 if fails +! AUTHOR +! Elena Pourmal +! September 30, 2002 +! +! HISTORY +! Changed the type of obj_count to INTEGER(SIZE_T) +! September 25, 2008 EIP +! +! SOURCE + 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(SIZE_T), INTENT(OUT) :: obj_count + INTEGER, INTENT(OUT) :: hdferr +!***** + INTERFACE + INTEGER FUNCTION h5fget_obj_count_c(file_id, obj_type, obj_count) BIND(C,NAME='h5fget_obj_count_c') + 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 + END INTERFACE + + hdferr = h5fget_obj_count_c(file_id, obj_type, obj_count) + + END SUBROUTINE h5fget_obj_count_f + +!****s* H5F/h5fget_obj_ids_f +! +! NAME +! h5fget_obj_ids_f +! +! PURPOSE +! Get list of open objects identifiers within a file +! +! INPUTS +! file_id - file identifier +! obj_type - type of the object; possible values are: +! H5F_OBJ_FILE_F +! H5F_OBJ_DATASET_F +! H5F_OBJ_GROUP_F +! H5F_OBJ_DATATYPE_F +! H5F_OBJ_ALL_F +! OUTPUTS +! obj_ids - array of open object identifiers +! hdferr - Returns 0 if successful and -1 if fails +! +! OPTIONAL PARAMETERS +! num_objs - number of open objects +! +! AUTHOR +! Elena Pourmal +! September 30, 2002 +! +! HISTORY +! Added optional parameter num_objs for number of open objects +! of the specified type and changed type of max_obj to +! INTEGER(SIZE_T) +! September 25, 2008 EIP +! +! SOURCE + 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 ! File identifier + INTEGER, INTENT(IN) :: obj_type ! Object type + INTEGER(SIZE_T), INTENT(IN) :: max_objs ! Maximum # of objects to retrieve + INTEGER(HID_T), DIMENSION(*), INTENT(INOUT) :: obj_ids + ! Array of open objects iidentifiers + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(SIZE_T), INTENT(OUT), OPTIONAL :: num_objs ! number of open objects +!***** + 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') + 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 + END INTERFACE + + hdferr = h5fget_obj_ids_c(file_id, obj_type, max_objs, obj_ids, c_num_objs) + IF (PRESENT(num_objs)) num_objs= c_num_objs + + END SUBROUTINE h5fget_obj_ids_f +!****s* H5F/h5fget_freespace_f +! +! NAME +! h5fget_freespace_f +! +! PURPOSE +! Get amount of free space within a file +! +! INPUTS +! file_id - file identifier +! OUTPUTS +! free_space - amount of free space in file +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Quincey Koziol +! October 7, 2003 +! +! SOURCE + SUBROUTINE h5fget_freespace_f(file_id, free_space, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: file_id ! File identifier + INTEGER(HSSIZE_T), INTENT(OUT) :: free_space + ! amount of free space in file + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + INTERFACE + INTEGER FUNCTION h5fget_freespace_c(file_id, free_space) & + BIND(C,NAME='h5fget_freespace_c') + IMPORT :: HID_T, HSSIZE_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: file_id + INTEGER(HSSIZE_T), INTENT(OUT) :: free_space + END FUNCTION h5fget_freespace_c + END INTERFACE + + hdferr = h5fget_freespace_c(file_id, free_space) + + END SUBROUTINE h5fget_freespace_f +!****s* H5F/h5fget_name_f +! +! NAME +! h5fget_name_f +! +! PURPOSE +! Gets the name of the file from the object identifier +! +! INPUTS +! obj_id - object identifier +! OUTPUTS +! buf - buffer to store the read name +! size - actual size of the name +! hdferr - Returns 0 if successful and -1 if fails +! AUTHOR +! Elena Pourmal +! July 6, 2004 +! +! SOURCE + SUBROUTINE h5fget_name_f(obj_id, buf, size, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: obj_id ! Object identifier + CHARACTER(LEN=*), INTENT(INOUT) :: buf + ! Buffer to hold file name + INTEGER(SIZE_T), INTENT(OUT) :: size ! Size of the file name + INTEGER, INTENT(OUT) :: hdferr ! Error code: 0 on success, + ! -1 if fail +!***** + INTEGER(SIZE_T) :: buflen + + INTERFACE + INTEGER FUNCTION h5fget_name_c(obj_id, size, buf, buflen) & + BIND(C,NAME='h5fget_name_c') + IMPORT :: C_CHAR + IMPORT :: HID_T, SIZE_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: obj_id + INTEGER(SIZE_T), INTENT(OUT) :: size + INTEGER(SIZE_T) :: buflen + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(OUT) :: buf + END FUNCTION h5fget_name_c + END INTERFACE + buflen = LEN_TRIM(buf) + hdferr = h5fget_name_c(obj_id, size, buf, buflen) + END SUBROUTINE h5fget_name_f +!****s* H5F/h5fget_filesize_f +! +! NAME +! h5fget_filesize_f +! +! PURPOSE +! Retrieves the file size of the HDF5 file. +! +! INPUTS +! file_id - file identifier +! OUTPUTS +! size - file size +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! July 7, 2004 +! +! SOURCE + SUBROUTINE h5fget_filesize_f(file_id, size, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: file_id ! file identifier + INTEGER(HSIZE_T), INTENT(OUT) :: size ! Size of the file + INTEGER, INTENT(OUT) :: hdferr ! Error code: 0 on success, + ! -1 if fail +!***** + INTERFACE + INTEGER FUNCTION h5fget_filesize_c(file_id, size) & + BIND(C,NAME='h5fget_filesize_c') + IMPORT :: HID_T, HSIZE_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: file_id + INTEGER(HSIZE_T), INTENT(OUT) :: size + END FUNCTION h5fget_filesize_c + END INTERFACE + hdferr = h5fget_filesize_c(file_id, size) + END SUBROUTINE h5fget_filesize_f + +!****s* H5F (F03)/h5fget_file_image_f_F03 +! +! NAME +! h5fget_file_image_f +! +! PURPOSE +! Retrieves a copy of the image of an existing, open file. +! +! INPUTS +! file_id - Target file identifier. +! buf_ptr - Pointer to the buffer into which the image of the HDF5 file is to be copied. +! buf_len - Size of the supplied buffer. +! +! OUTPUTS +! hdferr - error code: +! 0 on success and -1 on failure +! OPTIONAL PARAMETERS +! buf_size - Returns the size in bytes of the buffer required to store the file image, +! no data will be copied. +! +! AUTHOR +! M. Scot Breitenfeld +! November 26, 2012 +! +! Fortran2003 Interface: + SUBROUTINE h5fget_file_image_f(file_id, buf_ptr, buf_len, hdferr, buf_size) + IMPLICIT NONE + INTEGER(HID_T) , INTENT(IN) :: file_id + TYPE(C_PTR) , INTENT(INOUT) :: buf_ptr + INTEGER(SIZE_T), INTENT(IN) :: buf_len + INTEGER , INTENT(OUT) :: hdferr + INTEGER(SIZE_T), INTENT(OUT) , OPTIONAL :: buf_size +!***** + + INTEGER(SIZE_T) :: buf_size_default + + INTERFACE + INTEGER FUNCTION h5fget_file_image_c(file_id, buf_ptr, buf_len, buf_size) BIND(C, NAME='h5fget_file_image_c') + IMPORT :: C_PTR + IMPORT :: HID_T, SIZE_T + IMPLICIT NONE + INTEGER(HID_T) , INTENT(IN) :: file_id + TYPE(C_PTR) , VALUE :: buf_ptr + INTEGER(SIZE_T), INTENT(IN) :: buf_len + INTEGER(SIZE_T), INTENT(IN) :: buf_size + END FUNCTION h5fget_file_image_c + END INTERFACE + + IF(PRESENT(buf_size))THEN + buf_ptr = C_NULL_PTR + ENDIF + + hdferr = h5fget_file_image_c(file_id, buf_ptr, buf_len, buf_size_default) + + IF(PRESENT(buf_size))THEN + buf_size = buf_size_default + ENDIF + + END SUBROUTINE h5fget_file_image_f + +END MODULE H5F diff --git a/fortran/src/H5Fff.f90 b/fortran/src/H5Fff.f90 deleted file mode 100644 index faa1967..0000000 --- a/fortran/src/H5Fff.f90 +++ /dev/null @@ -1,834 +0,0 @@ -!****h* ROBODoc/H5F -! -! NAME -! MODULE H5F -! -! FILE -! H5Fff.f90 -! -! PURPOSE -! This file contains Fortran interfaces for H5F functions. -! -! 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. * -! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -! -! NOTES -! *** IMPORTANT *** -! If you add a new H5F function you must add the function name to the -! Windows dll file 'hdf5_fortrandll.def.in' in the fortran/src directory. -! This is needed for Windows based operating systems. -! -!***** - -MODULE H5F - USE H5GLOBAL - -CONTAINS -!****s* H5F/h5fcreate_f -! -! NAME -! h5fcreate_f -! -! PURPOSE -! Creates HDF5 files. -! -! INPUTS -! name - name of the file to create -! access_flags - File access flags. Allowable values are: -! H5F_ACC_TRUNC_F -! H5F_ACC_EXCL_F -! OUTPUTS -! file_id - file identifier -! hdferr - Returns 0 if successful and -1 if fails -! -! OPTIONAL PARAMETERS -! creation_prp - file creation property list identifier -! access_prp - file access property list identifier -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). February 28, 2001 -! -! SOURCE - SUBROUTINE h5fcreate_f(name, access_flags, file_id, hdferr, & - creation_prp, access_prp) - IMPLICIT NONE - CHARACTER(LEN=*), INTENT(IN) :: name ! Name of the file - INTEGER, INTENT(IN) :: access_flags ! File access flags - INTEGER(HID_T), INTENT(OUT) :: file_id ! File identifier - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: creation_prp - ! File creation propertly - ! list identifier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: access_prp - ! File access property list - ! identifier -!***** - INTEGER(HID_T) :: creation_prp_default - INTEGER(HID_T) :: access_prp_default - INTEGER :: namelen ! Length of the name character string - - INTERFACE - INTEGER FUNCTION h5fcreate_c(name, namelen, access_flags, & - creation_prp_default, access_prp_default, file_id) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5FCREATE_C':: h5fcreate_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: name - CHARACTER(LEN=*), INTENT(IN) :: name - INTEGER, INTENT(IN) :: access_flags - INTEGER(HID_T), INTENT(OUT) :: file_id - INTEGER(HID_T), INTENT(IN) :: creation_prp_default - INTEGER(HID_T), INTENT(IN) :: access_prp_default - INTEGER :: namelen - END FUNCTION h5fcreate_c - END INTERFACE - - creation_prp_default = H5P_DEFAULT_F - access_prp_default = H5P_DEFAULT_F - - IF (PRESENT(creation_prp)) creation_prp_default = creation_prp - IF (PRESENT(access_prp)) access_prp_default = access_prp - namelen = LEN_TRIM(name) - hdferr = h5fcreate_c(name, namelen, access_flags, & - creation_prp_default, access_prp_default, file_id) - - END SUBROUTINE h5fcreate_f -!****s* H5F/h5fflush_f -! -! NAME -! h5fflush_f -! -! PURPOSE -! Flushes all buffers associated WITH a file to disk -! -! INPUTS -! object_id - identifier of object used to identify the file. -! scope - specifies the scope of the flushing action. -! Possible values are: -! H5F_SCOPE_GLOBAL_F -! H5F_SCOPE_LOCAL_F -! OUTPUTS -! hdferr - Returns 0 if successful and -1 if fails -! -! OPTIONAL PARAMETERS -! creation_prp - file creation property list identifier -! access_prp - file access property list identifier -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). February 28, 2001 -! -! SOURCE - SUBROUTINE h5fflush_f(object_id, scope, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: object_id !identifier for any object - !associate with a file, - !including the file itself, - !a dataset, a group, an - !attribute, or a named - !data type - - INTEGER, INTENT(IN) :: scope !scope of the flushing - !action, possible values - !are: H5F_SCOPE_GLOBAL_F - ! which flushes the entire - !virtual file, - !and H5F_SCOPE_LOCAL_F - !which flushes only the - !specified file. - - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTERFACE - INTEGER FUNCTION h5fflush_c(object_id, scope) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5FFLUSH_C':: h5fflush_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: object_id - INTEGER, INTENT(IN) :: scope - END FUNCTION h5fflush_c - END INTERFACE - - hdferr = h5fflush_c(object_id, scope) - - END SUBROUTINE h5fflush_f -!****s* H5F/h5fmount_f -! -! NAME -! h5fmount_f -! -! PURPOSE -! Mounts a file. -! -! INPUTS -! loc_id - the identifier for of file or group in -! which name is defined -! name - the name of the group onto which the file -! specified by child_id is to be mounted. -! child_id - the identifier of the file to be mounted. -! OUTPUTS -! hdferr - Returns 0 if successful and -1 if fails -! OPTIONAL PARAMETERS -! access_prp - the identifier of the property list to be used -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). February 28, 2001 -! -! SOURCE - SUBROUTINE h5fmount_f(loc_id, name, child_id, hdferr, access_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id ! Identifier for file or group - ! in which dsetname is defined - CHARACTER(LEN=*), INTENT(IN) :: name ! Name of the group - INTEGER(HID_T), INTENT(IN) :: child_id ! File identifier for the - ! file to be mounted - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: access_prp - ! File access property list - ! identifier -!***** - INTEGER(HID_T) :: access_prp_default - INTEGER :: namelen ! Length of the name character string - - INTERFACE - INTEGER FUNCTION h5fmount_c(loc_id, name, namelen, & - child_id, access_prp_default) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5FMOUNT_C':: h5fmount_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: name - INTEGER(HID_T), INTENT(IN) :: loc_id - CHARACTER(LEN=*), INTENT(IN) :: name - INTEGER(HID_T), INTENT(IN) :: child_id - INTEGER(HID_T), INTENT(IN) :: access_prp_default - INTEGER :: namelen - END FUNCTION h5fmount_c - END INTERFACE - - access_prp_default = H5P_DEFAULT_F - IF (PRESENT(access_prp)) access_prp_default = access_prp - namelen = LEN_TRIM(name) - hdferr = h5fmount_c(loc_id, name, namelen, child_id, access_prp_default) - - END SUBROUTINE h5fmount_f - -!****s* H5F/h5funmount_f -! -! NAME -! h5funmount_f -! -! PURPOSE -! Unmounts a file. -! -! INPUTS -! loc_id - the identifier for of file or group in -! which name is defined -! name - the name of the mount point -! OUTPUTS -! hdferr - Returns 0 if successful and -1 if fails -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). February 28, 2001 -! -! SOURCE - SUBROUTINE h5funmount_f(loc_id, name, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id ! Identifier for file or group - ! at which the specified file - ! is to be unmounted - CHARACTER(LEN=*), INTENT(IN) :: name ! Name of the mount point - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTEGER :: namelen ! Length of the name character string - - INTERFACE - INTEGER FUNCTION h5funmount_c(loc_id, name, namelen) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5FUNMOUNT_C':: h5funmount_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: name - INTEGER(HID_T), INTENT(IN) :: loc_id - CHARACTER(LEN=*), INTENT(IN) :: name - INTEGER :: namelen - END FUNCTION h5funmount_c - END INTERFACE - - namelen = LEN_TRIM(name) - hdferr = h5funmount_c(loc_id, name, namelen) - - END SUBROUTINE h5funmount_f -!****s* H5F/h5fopen_f -! -! NAME -! h5fopen_f -! -! PURPOSE -! Opens HDF5 file. -! -! INPUTS -! name - name of the file to acecss -! access_flags - File access flags. Allowable values are: -! H5F_ACC_RDWR_F -! H5F_ACC_RDONLY_F -! OUTPUTS -! file_id - file identifier -! hdferr - Returns 0 if successful and -1 if fails -! OPTIONAL PARAMETERS -! access_prp - file access property list identifier -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). February 28, 2001 -! -! SOURCE - SUBROUTINE h5fopen_f(name, access_flags, file_id, hdferr, access_prp) - IMPLICIT NONE - CHARACTER(LEN=*), INTENT(IN) :: name ! Name of the file - INTEGER, INTENT(IN) :: access_flags ! File access flags - INTEGER(HID_T), INTENT(OUT) :: file_id ! File identifier - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: access_prp - ! File access property list - ! identifier -!***** - INTEGER(HID_T) :: access_prp_default - INTEGER :: namelen ! Length of the name character string - - INTERFACE - INTEGER FUNCTION h5fopen_c(name, namelen, access_flags, & - access_prp_default, file_id) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5FOPEN_C':: h5fopen_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: name - CHARACTER(LEN=*), INTENT(IN) :: name - INTEGER :: namelen - INTEGER, INTENT(IN) :: access_flags - INTEGER(HID_T), INTENT(IN) :: access_prp_default - INTEGER(HID_T), INTENT(OUT) :: file_id - END FUNCTION h5fopen_c - END INTERFACE - - access_prp_default = H5P_DEFAULT_F - IF (PRESENT(access_prp)) access_prp_default = access_prp - namelen = LEN_TRIM(name) - hdferr = h5fopen_c(name, namelen, access_flags, & - access_prp_default, file_id) - END SUBROUTINE h5fopen_f -!****s* H5F/h5freopen_f -! -! NAME -! h5freopen_f -! -! PURPOSE -! Reopens HDF5 file. -! -! INPUTS -! file_id - identifier of a file for which an -! additional identifier is required -! OUTPUTS -! ret_file_id - new file identifier -! hdferr - Returns 0 if successful and -1 if fails -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). February 28, 2001 -! -! SOURCE - SUBROUTINE h5freopen_f(file_id, ret_file_id, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: file_id ! File identifier - INTEGER(HID_T), INTENT(OUT) :: ret_file_id ! New File identifier - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTERFACE - INTEGER FUNCTION h5freopen_c(file_id, ret_file_id) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5FREOPEN_C':: h5freopen_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: file_id - INTEGER(HID_T), INTENT(OUT) :: ret_file_id - END FUNCTION h5freopen_c - END INTERFACE - - hdferr = h5freopen_c(file_id, ret_file_id) - - END SUBROUTINE h5freopen_f -!****s* H5F/h5fget_create_plist_f -! -! NAME -! h5fget_create_plist_f -! -! PURPOSE -! Returns a file creation property list identifier. -! -! INPUTS -! file_id - identifier of a file to creation property list of -! OUTPUTS -! prop_id - creation property list identifier -! hdferr - Returns 0 if successful and -1 if fails -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). February 28, 2001 -! -! SOURCE - SUBROUTINE h5fget_create_plist_f(file_id, prop_id, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: file_id ! File identifier - INTEGER(HID_T), INTENT(OUT) :: prop_id ! File creation property - ! list identifier - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTERFACE - INTEGER FUNCTION h5fget_create_plist_c(file_id, prop_id) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5FGET_CREATE_PLIST_C':: h5fget_create_plist_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: file_id - INTEGER(HID_T), INTENT(OUT) :: prop_id - END FUNCTION h5fget_create_plist_c - END INTERFACE - - hdferr = h5fget_create_plist_c(file_id, prop_id) - - END SUBROUTINE h5fget_create_plist_f -!****s* H5F/h5fget_access_plist_f -! -! NAME -! h5fget_access_plist_f -! -! PURPOSE -! Returns a file access property list identifier. -! -! INPUTS -! file_id - identifier of a file to creation property list of -! OUTPUTS -! access_id - access property list identifier -! hdferr - Returns 0 if successful and -1 if fails -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). February 28, 2001 -! -! SOURCE - SUBROUTINE h5fget_access_plist_f(file_id, access_id, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: file_id ! File identifier - INTEGER(HID_T), INTENT(OUT) :: access_id ! File access property - ! list identifier - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTERFACE - INTEGER FUNCTION h5fget_access_plist_c(file_id, access_id) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5FGET_CREATE_PLIST_C':: h5fget_access_plist_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: file_id - INTEGER(HID_T), INTENT(OUT) :: access_id - END FUNCTION h5fget_access_plist_c - END INTERFACE - - hdferr = h5fget_access_plist_c(file_id, access_id) - - END SUBROUTINE h5fget_access_plist_f - -!****s* H5F/h5fis_hdf5_f -! -! NAME -! h5fis_hdf5_f -! -! PURPOSE -! Determines whether a file is in the HDF5 format. -! -! INPUTS -! name - name of the file to check -! OUTPUTS -! status - indicates if file is and HDF5 file -! hdferr - Returns 0 if successful and -1 if fails -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). February 28, 2001 -! -! SOURCE - SUBROUTINE h5fis_hdf5_f(name, status, hdferr) - IMPLICIT NONE - CHARACTER(LEN=*), INTENT(IN) :: name ! Name of the file - LOGICAL, INTENT(OUT) :: status ! Indicates if file - ! is an HDF5 file - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTEGER :: namelen ! Length of the name character string - INTEGER :: flag ! "TRUE/FALSE" flag from C routine - ! to define status value. - - INTERFACE - INTEGER FUNCTION h5fis_hdf5_c(name, namelen, flag) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5FIS_HDF5_C':: h5fis_hdf5_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: name - CHARACTER(LEN=*), INTENT(IN) :: name - INTEGER :: namelen - INTEGER :: flag - END FUNCTION h5fis_hdf5_c - END INTERFACE - - namelen = LEN_TRIM(name) - hdferr = h5fis_hdf5_c(name, namelen, flag) - status = .TRUE. - IF (flag .EQ. 0) status = .FALSE. - - END SUBROUTINE h5fis_hdf5_f -!****s* H5F/h5fclose_f -! -! NAME -! h5fclose_f -! -! PURPOSE -! Closes HDF5 file. -! -! INPUTS -! file_id - file identifier -! OUTPUTS -! hdferr - Returns 0 if successful and -1 if fails -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). February 28, 2001 -! -! SOURCE - SUBROUTINE h5fclose_f(file_id, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: file_id ! File identifier - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTERFACE - INTEGER FUNCTION h5fclose_c(file_id) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5FCLOSE_C':: h5fclose_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: file_id - END FUNCTION h5fclose_c - END INTERFACE - - hdferr = h5fclose_c(file_id) - - END SUBROUTINE h5fclose_f - -!****s* H5F/h5fget_obj_count_f -! -! NAME -! h5fget_obj_count_f -! -! PURPOSE -! Gets number of the objects open within a file -! -! INPUTS -! file_id - file identifier -! obj_type - type of the object; possible values are: -! H5F_OBJ_FILE_F -! H5F_OBJ_DATASET_F -! H5F_OBJ_GROUP_F -! H5F_OBJ_DATATYPE_F -! H5F_OBJ_ALL_F -! OUTPUTS -! obj_count - number of open objects -! hdferr - Returns 0 if successful and -1 if fails -! AUTHOR -! Elena Pourmal -! September 30, 2002 -! -! HISTORY -! Changed the type of obj_count to INTEGER(SIZE_T) -! September 25, 2008 EIP -! -! SOURCE - SUBROUTINE h5fget_obj_count_f(file_id, obj_type, obj_count, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: file_id ! File identifier - INTEGER, INTENT(IN) :: obj_type ! Object type - INTEGER(SIZE_T), INTENT(OUT) :: obj_count - ! Number of open objects - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTERFACE - INTEGER FUNCTION h5fget_obj_count_c(file_id, obj_type, obj_count) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5FGET_OBJ_COUNT_C':: h5fget_obj_count_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: file_id - INTEGER, INTENT(IN) :: obj_type ! Object type - INTEGER(SIZE_T), INTENT(OUT) :: obj_count - ! Number of open objects - END FUNCTION h5fget_obj_count_c - END INTERFACE - - hdferr = h5fget_obj_count_c(file_id, obj_type, obj_count) - - END SUBROUTINE h5fget_obj_count_f - -!****s* H5F/h5fget_obj_ids_f -! -! NAME -! h5fget_obj_ids_f -! -! PURPOSE -! Get list of open objects identifiers within a file -! -! INPUTS -! file_id - file identifier -! obj_type - type of the object; possible values are: -! H5F_OBJ_FILE_F -! H5F_OBJ_DATASET_F -! H5F_OBJ_GROUP_F -! H5F_OBJ_DATATYPE_F -! H5F_OBJ_ALL_F -! OUTPUTS -! obj_ids - array of open object identifiers -! hdferr - Returns 0 if successful and -1 if fails -! -! OPTIONAL PARAMETERS -! num_objs - number of open objects -! -! AUTHOR -! Elena Pourmal -! September 30, 2002 -! -! HISTORY -! Added optional parameter num_objs for number of open objects -! of the specified type and changed type of max_obj to -! INTEGER(SIZE_T) -! September 25, 2008 EIP -! -! SOURCE - 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 ! File identifier - INTEGER, INTENT(IN) :: obj_type ! Object type - INTEGER(SIZE_T), INTENT(IN) :: max_objs ! Maximum # of objects to retrieve - INTEGER(HID_T), DIMENSION(*), INTENT(INOUT) :: obj_ids - ! Array of open objects iidentifiers - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(SIZE_T), INTENT(OUT), OPTIONAL :: num_objs ! number of open objects -!***** - 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) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5FGET_OBJ_IDS_C':: h5fget_obj_ids_c - !DEC$ENDIF - 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 - END INTERFACE - - hdferr = h5fget_obj_ids_c(file_id, obj_type, max_objs, obj_ids, c_num_objs) - IF (PRESENT(num_objs)) num_objs= c_num_objs - - END SUBROUTINE h5fget_obj_ids_f -!****s* H5F/h5fget_freespace_f -! -! NAME -! h5fget_freespace_f -! -! PURPOSE -! Get amount of free space within a file -! -! INPUTS -! file_id - file identifier -! OUTPUTS -! free_space - amount of free space in file -! hdferr - Returns 0 if successful and -1 if fails -! -! AUTHOR -! Quincey Koziol -! October 7, 2003 -! -! SOURCE - SUBROUTINE h5fget_freespace_f(file_id, free_space, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: file_id ! File identifier - INTEGER(HSSIZE_T), INTENT(OUT) :: free_space - ! amount of free space in file - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTERFACE - INTEGER FUNCTION h5fget_freespace_c(file_id, free_space) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5FGET_FREESPACE_C':: h5fget_freespace_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: file_id - INTEGER(HSSIZE_T), INTENT(OUT) :: free_space - END FUNCTION h5fget_freespace_c - END INTERFACE - - hdferr = h5fget_freespace_c(file_id, free_space) - - END SUBROUTINE h5fget_freespace_f -!****s* H5F/h5fget_name_f -! -! NAME -! h5fget_name_f -! -! PURPOSE -! Gets the name of the file from the object identifier -! -! INPUTS -! obj_id - object identifier -! OUTPUTS -! buf - buffer to store the read name -! size - actual size of the name -! hdferr - Returns 0 if successful and -1 if fails -! AUTHOR -! Elena Pourmal -! July 6, 2004 -! -! SOURCE - SUBROUTINE h5fget_name_f(obj_id, buf, size, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: obj_id ! Object identifier - CHARACTER(LEN=*), INTENT(INOUT) :: buf - ! Buffer to hold file name - INTEGER(SIZE_T), INTENT(OUT) :: size ! Size of the file name - INTEGER, INTENT(OUT) :: hdferr ! Error code: 0 on success, - ! -1 if fail -!***** - INTEGER(SIZE_T) :: buflen - - INTERFACE - INTEGER FUNCTION h5fget_name_c(obj_id, size, buf, buflen) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5FGET_NAME_C'::h5fget_name_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: buf - INTEGER(HID_T), INTENT(IN) :: obj_id - INTEGER(SIZE_T), INTENT(OUT) :: size - INTEGER(SIZE_T) :: buflen - CHARACTER(LEN=*), INTENT(OUT) :: buf - END FUNCTION h5fget_name_c - END INTERFACE - buflen = LEN_TRIM(buf) - hdferr = h5fget_name_c(obj_id, size, buf, buflen) - END SUBROUTINE h5fget_name_f -!****s* H5F/h5fget_filesize_f -! -! NAME -! h5fget_filesize_f -! -! PURPOSE -! Retrieves the file size of the HDF5 file. -! -! INPUTS -! file_id - file identifier -! OUTPUTS -! size - file size -! hdferr - Returns 0 if successful and -1 if fails -! -! AUTHOR -! Elena Pourmal -! July 7, 2004 -! -! SOURCE - SUBROUTINE h5fget_filesize_f(file_id, size, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: file_id ! file identifier - INTEGER(HSIZE_T), INTENT(OUT) :: size ! Size of the file - INTEGER, INTENT(OUT) :: hdferr ! Error code: 0 on success, - ! -1 if fail -!***** - INTERFACE - INTEGER FUNCTION h5fget_filesize_c(file_id, size) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5FGET_FILESIZE_C'::h5fget_filesize_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: file_id - INTEGER(HSIZE_T), INTENT(OUT) :: size - END FUNCTION h5fget_filesize_c - END INTERFACE - hdferr = h5fget_filesize_c(file_id, size) - END SUBROUTINE h5fget_filesize_f - - -END MODULE H5F diff --git a/fortran/src/H5Fff_F03.f90 b/fortran/src/H5Fff_F03.f90 deleted file mode 100644 index 8544870..0000000 --- a/fortran/src/H5Fff_F03.f90 +++ /dev/null @@ -1,99 +0,0 @@ -!****h* ROBODoc/H5F (F03) -! -! NAME -! H5F_PROVISIONAL -! -! PURPOSE -! This file contains Fortran 2003 interfaces for H5F functions. -! -! 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. * -! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -! -! NOTES -! *** IMPORTANT *** -! If you add a new H5T function you must add the function name to the -! Windows dll file 'hdf5_fortrandll.def.in' in the fortran/src directory. -! This is needed for Windows based operating systems. -! -!***** - -MODULE H5F_PROVISIONAL - - USE H5GLOBAL - USE, INTRINSIC :: ISO_C_BINDING - -CONTAINS -!****s* H5F (F03)/h5fget_file_image_f_F03 -! -! NAME -! h5fget_file_image_f -! -! PURPOSE -! Retrieves a copy of the image of an existing, open file. -! -! INPUTS -! file_id - Target file identifier. -! buf_ptr - Pointer to the buffer into which the image of the HDF5 file is to be copied. -! buf_len - Size of the supplied buffer. -! -! OUTPUTS -! hdferr - error code: -! 0 on success and -1 on failure -! OPTIONAL PARAMETERS -! buf_size - Returns the size in bytes of the buffer required to store the file image, -! no data will be copied. -! -! AUTHOR -! M. Scot Breitenfeld -! November 26, 2012 -! -! Fortran2003 Interface: - SUBROUTINE h5fget_file_image_f(file_id, buf_ptr, buf_len, hdferr, buf_size) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T) , INTENT(IN) :: file_id - TYPE(C_PTR) , INTENT(INOUT) :: buf_ptr - INTEGER(SIZE_T), INTENT(IN) :: buf_len - INTEGER , INTENT(OUT) :: hdferr - INTEGER(SIZE_T), INTENT(OUT) , OPTIONAL :: buf_size -!***** - - INTEGER(SIZE_T) :: buf_size_default - - INTERFACE - INTEGER FUNCTION h5fget_file_image_c(file_id, buf_ptr, buf_len, buf_size) BIND(C, NAME='h5fget_file_image_c') - USE, INTRINSIC :: ISO_C_BINDING, ONLY : C_PTR - USE H5GLOBAL - INTEGER(HID_T) , INTENT(IN) :: file_id - TYPE(C_PTR) , VALUE :: buf_ptr - INTEGER(SIZE_T), INTENT(IN) :: buf_len - INTEGER(SIZE_T), INTENT(IN) :: buf_size - END FUNCTION h5fget_file_image_c - END INTERFACE - - IF(PRESENT(buf_size))THEN - buf_ptr = C_NULL_PTR - ENDIF - - hdferr = h5fget_file_image_c(file_id, buf_ptr, buf_len, buf_size_default) - - IF(PRESENT(buf_size))THEN - buf_size = buf_size_default - ENDIF - - END SUBROUTINE h5fget_file_image_f - -END MODULE H5F_PROVISIONAL diff --git a/fortran/src/H5Fff_F90.f90 b/fortran/src/H5Fff_F90.f90 deleted file mode 100644 index b6e659b..0000000 --- a/fortran/src/H5Fff_F90.f90 +++ /dev/null @@ -1,43 +0,0 @@ -!****h* ROBODoc/H5F (F90) -! -! NAME -! H5F_PROVISIONAL -! -! PURPOSE -! This file contains Fortran 90 interfaces for H5F functions. It -! containsthe same functions as H5Fff_F03.f90, when applicable, -! but excludes the Fortran 2003 functions and the interface listings. -! This file will be compiled instead of H5Fff_F03.f90 if Fortran 2003 -! functions are not enabled. -! -! 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. * -! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -! -! NOTES -! *** IMPORTANT *** -! If you add a new H5F function you must add the function name to the -! Windows dll file 'hdf5_fortrandll.def.in' in the fortran/src directory. -! This is needed for Windows based operating systems. -! -!***** - - -MODULE H5F_PROVISIONAL - - USE H5GLOBAL - IMPLICIT NONE - -END MODULE H5F_PROVISIONAL diff --git a/fortran/src/H5Gf.c b/fortran/src/H5Gf.c index 7f755b3..b9c44bb 100644 --- a/fortran/src/H5Gf.c +++ b/fortran/src/H5Gf.c @@ -1,6 +1,6 @@ /****h* H5Gf/H5Gf * PURPOSE - * This file contains C stubs for H5G Fortran APIs + * This file contains C stubs for H5G Fortran APIs * * COPYRIGHT * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * @@ -26,30 +26,29 @@ /****if* H5Gf/h5gcreate_c * NAME - * h5gcreate_c + * h5gcreate_c * PURPOSE - * Call H5Gcreate to create a group + * Call H5Gcreate to create a group * INPUTS - * loc_id - file or group identifier - * name - name of the group - * namelen - name length - * size_hint - length of names in the group + * loc_id - file or group identifier + * name - name of the group + * namelen - name length + * size_hint - length of names in the group * OUTPUTS - * grp_id - group identifier + * grp_id - group identifier * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * Wednesday, August 5, 1999 + * Wednesday, August 5, 1999 * HISTORY - * - * Changed to call H5Gcreate2 because H5Gcreate flip-flops and - * H5Gcreate1 can be compiled out of the library - * QAK - 2007/08/23 + * Changed to call H5Gcreate2 because H5Gcreate flip-flops and + * H5Gcreate1 can be compiled out of the library + * QAK - 2007/08/23 * SOURCE */ int_f -nh5gcreate_c(hid_t_f *loc_id, _fcd name, int_f *namelen, size_t_f *size_hint, +h5gcreate_c(hid_t_f *loc_id, _fcd name, int_f *namelen, size_t_f *size_hint, hid_t_f *grp_id, hid_t_f *lcpl_id, hid_t_f *gcpl_id, hid_t_f *gapl_id ) /******/ { @@ -98,26 +97,26 @@ DONE: /****if* H5Gf/h5gopen_c * NAME - * h5gopen_c + * h5gopen_c * PURPOSE - * Call H5Gopen to open a dataset + * Call H5Gopen to open a dataset * INPUTS - * loc_id - file or group identifier - * name - name of the group - * namelen - name length - * gapl_id - Group access property list identifier + * loc_id - file or group identifier + * name - name of the group + * namelen - name length + * gapl_id - Group access property list identifier * OUTPUTS - * grp_id - group identifier + * grp_id - group identifier * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * Wednesday, August 5, 1999 + * Wednesday, August 5, 1999 * * SOURCE */ int_f -nh5gopen_c(hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *gapl_id, hid_t_f *grp_id) +h5gopen_c(hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *gapl_id, hid_t_f *grp_id) /******/ { char *c_name = NULL; @@ -148,28 +147,28 @@ DONE: /****if* H5Gf/h5gget_obj_info_idx_c * NAME - * h5gget_obj_info_idx_c + * h5gget_obj_info_idx_c * PURPOSE - * Call H5Gget_obj_info to return name and the type of group - * member + * Call H5Gget_obj_info to return name and the type of group + * member * INPUTS - * loc_id - file or group identifier - * name - name of the group - * namelen - name length - * idx - index of the group member + * loc_id - file or group identifier + * name - name of the group + * namelen - name length + * idx - index of the group member * OUTPUTS - * obj_name - buffer to store member's name - * obj_namelen - length of the buffer - * obj_type - type of the object + * obj_name - buffer to store member's name + * obj_namelen - length of the buffer + * obj_type - type of the object * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * Wednesday, August 5, 1999 + * Wednesday, August 5, 1999 * SOURCE */ int_f -nh5gget_obj_info_idx_c(hid_t_f *loc_id, _fcd name, int_f *namelen, int_f *idx, +h5gget_obj_info_idx_c(hid_t_f *loc_id, _fcd name, int_f *namelen, int_f *idx, _fcd obj_name, int_f *obj_namelen, int_f *obj_type) /******/ { @@ -207,7 +206,7 @@ nh5gget_obj_info_idx_c(hid_t_f *loc_id, _fcd name, int_f *namelen, int_f *idx, goto DONE; /* XXX: Switch from using H5Gget_objtype_by_idx() means that this routine won't - * work on non-hard links - QAK + * work on non-hard links - QAK */ *obj_type = oinfo.type; @@ -231,24 +230,24 @@ DONE: /****if* H5Gf/h5gn_members_c * NAME - * h5gn_members_c + * h5gn_members_c * PURPOSE - * Call H5Gget_info_by_name to find number of objects in the group + * Call H5Gget_info_by_name to find number of objects in the group * INPUTS - * loc_id - file or group identifier - * name - name of the group - * namelen - name length + * loc_id - file or group identifier + * name - name of the group + * namelen - name length * OUTPUTS - * nmemebers - number of members + * nmemebers - number of members * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * Wednesday, August 5, 1999 + * Wednesday, August 5, 1999 * SOURCE */ int_f -nh5gn_members_c(hid_t_f *loc_id, _fcd name, int_f *namelen, int_f *nmembers) +h5gn_members_c(hid_t_f *loc_id, _fcd name, int_f *namelen, int_f *nmembers) /******/ { char *c_name = NULL; @@ -276,21 +275,21 @@ DONE: /****if* H5Gf/h5gclose_c * NAME - * h5gclose_c + * h5gclose_c * PURPOSE - * Call H5Gclose to close the group + * Call H5Gclose to close the group * INPUTS - * grp_id - identifier of the group to be closed + * grp_id - identifier of the group to be closed * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * Wednesday, August 5, 1999 + * Wednesday, August 5, 1999 * SOURCE */ int_f -nh5gclose_c(hid_t_f *grp_id) +h5gclose_c(hid_t_f *grp_id) /******/ { int ret_value = 0; @@ -303,19 +302,19 @@ nh5gclose_c(hid_t_f *grp_id) /****if* H5Gf/h5glink_c * NAME - * h5glink_c + * h5glink_c * PURPOSE - * Call H5Glink to link the specified type + * Call H5Glink to link the specified type * INPUTS - * loc_id - identifier of file or group - * link_type - link type - * current_name - name of the existing object for hard link, - * anything for the soft link - * current_namelen - current name lenghth - * new_name - new name for the object - * new_namelen - new_name lenghth + * loc_id - identifier of file or group + * link_type - link type + * current_name - name of the existing object for hard link, + * anything for the soft link + * current_namelen - current name lenghth + * new_name - new name for the object + * new_namelen - new_name lenghth * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Mingshi Chen * Friday, August 6, 1999 @@ -323,7 +322,7 @@ nh5gclose_c(hid_t_f *grp_id) */ int_f -nh5glink_c(hid_t_f *loc_id, int_f *link_type, _fcd current_name, +h5glink_c(hid_t_f *loc_id, int_f *link_type, _fcd current_name, int_f *current_namelen, _fcd new_name, int_f *new_namelen) /******/ { @@ -385,32 +384,32 @@ DONE: /****if* H5Gf/h5glink2_c * NAME - * h5glink2_c + * h5glink2_c * PURPOSE - * Call H5Glink2 to link the specified type + * Call H5Glink2 to link the specified type * INPUTS - * cur_loc_id - identifier of file or group - * cur_name - name of the existing object for hard link releative - * to cur_loc_id location, - * anything for the soft link - * current_namelen - current name lenghth - * link_type - link type - * new_loc_id - location identifier - * new_name - new name for the object releative to the new_loc_id - * location - * new_namelen - new_name lenghth + * cur_loc_id - identifier of file or group + * cur_name - name of the existing object for hard link releative + * to cur_loc_id location, + * anything for the soft link + * current_namelen - current name lenghth + * link_type - link type + * new_loc_id - location identifier + * new_name - new name for the object releative to the new_loc_id + * location + * new_namelen - new_name lenghth * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * Wednesday, September 25, 2002 + * Wednesday, September 25, 2002 * HISTORY * * SOURCE */ int_f -nh5glink2_c(hid_t_f *cur_loc_id, _fcd cur_name, int_f *cur_namelen, +h5glink2_c(hid_t_f *cur_loc_id, _fcd cur_name, int_f *cur_namelen, int_f *link_type, hid_t_f *new_loc_id, _fcd new_name, int_f *new_namelen) /******/ { @@ -470,14 +469,14 @@ DONE: /****if* H5Gf/h5gunlink_c * NAME - * h5gunlink_c + * h5gunlink_c * PURPOSE - * Call H5Gunlink to remove the specified name + * Call H5Gunlink to remove the specified name * INPUTS - * loc_id - identifier of file or group - * name - name of the object to unlink + * loc_id - identifier of file or group + * name - name of the object to unlink * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Mingshi Chen * Friday, August 6, 1999 @@ -485,7 +484,7 @@ DONE: */ int_f -nh5gunlink_c(hid_t_f *loc_id, _fcd name, int_f *namelen) +h5gunlink_c(hid_t_f *loc_id, _fcd name, int_f *namelen) /******/ { char *c_name = NULL; @@ -512,17 +511,17 @@ DONE: /****if* H5Gf/h5gmove_c * NAME - * h5gmove_c + * h5gmove_c * PURPOSE - * Call H5Gmove to rename an object within an HDF5 file + * Call H5Gmove to rename an object within an HDF5 file * INPUTS - * loc_id - identifier of file or group - * src_name - name of the original object - * src_namelen - original name lenghth - * dst_name - new name for the object - * dst_namelen - new name lenghth + * loc_id - identifier of file or group + * src_name - name of the original object + * src_namelen - original name lenghth + * dst_name - new name for the object + * dst_namelen - new name lenghth * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Mingshi Chen * Friday, August 6, 1999 @@ -530,7 +529,7 @@ DONE: */ int_f -nh5gmove_c(hid_t_f *loc_id, _fcd src_name, int_f *src_namelen, _fcd dst_name, int_f*dst_namelen) +h5gmove_c(hid_t_f *loc_id, _fcd src_name, int_f *src_namelen, _fcd dst_name, int_f*dst_namelen) /******/ { char *c_src_name = NULL, *c_dst_name = NULL; @@ -562,18 +561,18 @@ DONE: /****if* H5Gf/h5gmove2_c * NAME - * h5gmove2_c + * h5gmove2_c * PURPOSE - * Call H5Gmove2 to rename an object within an HDF5 file + * Call H5Gmove2 to rename an object within an HDF5 file * INPUTS - * src_loc_id - identifier of file or group - * src_name - name of the original object relative to src_loc_id - * src_namelen - original name lenghth - * dst_loc_id - new location identifier - * dst_name - new name for the object relative to dst_loc_id - * dst_namelen - new name lenghth + * src_loc_id - identifier of file or group + * src_name - name of the original object relative to src_loc_id + * src_namelen - original name lenghth + * dst_loc_id - new location identifier + * dst_name - new name for the object relative to dst_loc_id + * dst_namelen - new name lenghth * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal * Wednesday, September 25, 2002 @@ -582,7 +581,7 @@ DONE: */ int_f -nh5gmove2_c(hid_t_f *src_loc_id, _fcd src_name, int_f *src_namelen, hid_t_f *dst_loc_id, _fcd dst_name, int_f*dst_namelen) +h5gmove2_c(hid_t_f *src_loc_id, _fcd src_name, int_f *src_namelen, hid_t_f *dst_loc_id, _fcd dst_name, int_f*dst_namelen) /******/ { char *c_src_name = NULL, *c_dst_name = NULL; @@ -614,18 +613,18 @@ DONE: /****if* H5Gf/h5gget_linkval_c * NAME - * h5gget_linkval_c + * h5gget_linkval_c * PURPOSE - * Call H5Gget_linkval to return the name of object + * Call H5Gget_linkval to return the name of object * INPUTS - * loc_id - identifier of file or group - * name - name of the object that symbolic link points to - * namelen - the name lenghth - * size - lenghth of retrurned value + * loc_id - identifier of file or group + * name - name of the object that symbolic link points to + * namelen - the name lenghth + * size - lenghth of retrurned value * OUTPUTS - * value - name to be returned + * value - name to be returned * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Mingshi Chen * Friday, August 6, 1999 @@ -633,7 +632,7 @@ DONE: */ int_f -nh5gget_linkval_c(hid_t_f *loc_id, _fcd name, int_f *namelen, size_t_f *size, +h5gget_linkval_c(hid_t_f *loc_id, _fcd name, int_f *namelen, size_t_f *size, _fcd value) /******/ { @@ -678,26 +677,26 @@ DONE: /****if* H5Gf/h5gset_comment_c * NAME - * h5gset_comment_c + * h5gset_comment_c * PURPOSE - * Call H5Oset_comment_by_name to set comments for the specified object + * Call H5Oset_comment_by_name to set comments for the specified object * INPUTS - * loc_id - identifier of file or group - * name - name of object whose comment is to be set or reset - * namelen - the name lenghth - * comment - the new comment - * commentlen - new comment lenghth + * loc_id - identifier of file or group + * name - name of object whose comment is to be set or reset + * namelen - the name lenghth + * comment - the new comment + * commentlen - new comment lenghth * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Mingshi Chen - * Friday, August 6, 1999 + * Friday, August 6, 1999 * HISTORY - * Elena Pourmal + * Elena Pourmal * SOURCE */ int_f -nh5gset_comment_c(hid_t_f *loc_id, _fcd name, int_f *namelen, _fcd comment, +h5gset_comment_c(hid_t_f *loc_id, _fcd name, int_f *namelen, _fcd comment, int_f *commentlen) /******/ { @@ -729,24 +728,24 @@ DONE: /****if* H5Gf/h5gget_comment_c * NAME - * h5gget_comment_c + * h5gget_comment_c * PURPOSE - * Call H5Oget_comment_by_name to retrieve comments for the specified object + * Call H5Oget_comment_by_name to retrieve comments for the specified object * INPUTS - * loc_id - identifier of file or group - * name - name of object whose comment is to be set or reset - * namelen - the name lenghth - * bufsize - at most bufsize characters - * comment - the new comment + * loc_id - identifier of file or group + * name - name of object whose comment is to be set or reset + * namelen - the name lenghth + * bufsize - at most bufsize characters + * comment - the new comment * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Mingshi Chen - * Friday, August 6, 1999 + * Friday, August 6, 1999 * SOURCE */ int_f -nh5gget_comment_c(hid_t_f *loc_id, _fcd name, int_f *namelen, size_t_f *bufsize, +h5gget_comment_c(hid_t_f *loc_id, _fcd name, int_f *namelen, size_t_f *bufsize, _fcd comment) /******/ { @@ -791,26 +790,26 @@ DONE: /****if* H5Gf/h5gcreate_anon_c * NAME - * h5gcreate_anon_c + * h5gcreate_anon_c * PURPOSE - * Call H5Gcreate_anon + * Call H5Gcreate_anon * INPUTS * - * loc_id - Location identifier - * gcpl_id - Group creation property list identifier - * gapl_id - Group access property list identifier + * loc_id - Location identifier + * gcpl_id - Group creation property list identifier + * gapl_id - Group access property list identifier * * OUTPUTS - * grp_id - group identifier + * grp_id - group identifier * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * M. Scot Breitenfeld * February 15, 2008 * SOURCE */ int_f -nh5gcreate_anon_c(hid_t_f *loc_id, hid_t_f *gcpl_id, hid_t_f *gapl_id, hid_t_f *grp_id) +h5gcreate_anon_c(hid_t_f *loc_id, hid_t_f *gcpl_id, hid_t_f *gapl_id, hid_t_f *grp_id) /******/ { @@ -825,24 +824,24 @@ done: /****if* H5Gf/h5gget_create_plist_c * NAME - * h5gget_create_plist_c + * h5gget_create_plist_c * PURPOSE - * Call H5Gget_create_plist + * Call H5Gget_create_plist * INPUTS * - * grp_id - group identifier + * grp_id - group identifier * * OUTPUTS - * gcpl_id - Group creation property list identifier + * gcpl_id - Group creation property list identifier * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * M. Scot Breitenfeld * February 15, 2008 * SOURCE */ int_f -nh5gget_create_plist_c(hid_t_f *grp_id, hid_t_f *gcpl_id ) +h5gget_create_plist_c(hid_t_f *grp_id, hid_t_f *gcpl_id ) /******/ { int_f ret_value=0; /* Return value */ @@ -857,36 +856,36 @@ done: /****if* H5Gf/h5gget_info_c * NAME - * h5gget_info_c + * h5gget_info_c * PURPOSE - * Call H5Gget_info + * Call H5Gget_info * INPUTS - * group_id - Group identifier + * group_id - Group identifier * OUTPUTS * - * storage_type - Type of storage for links in group: + * storage_type - Type of storage for links in group: * H5G_STORAGE_TYPE_COMPACT: Compact storage * H5G_STORAGE_TYPE_DENSE: Indexed storage * H5G_STORAGE_TYPE_SYMBOL_TABLE: Symbol tables, the original HDF5 structure * - * nlinks - Number of links in group - * max_corder - Current maximum creation order value for group - * mounted - Whether group has a file mounted on it (0 = false, 1 = true) + * nlinks - Number of links in group + * max_corder - Current maximum creation order value for group + * mounted - Whether group has a file mounted on it (0 = false, 1 = true) * * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * M. Scot Breitenfeld - * February 15, 2008 + * February 15, 2008 * HISTORY * - * - Added 'mounted' paramater - * M. Scot Breitenfeld - * July 16, 2008 + * - Added 'mounted' paramater + * M. Scot Breitenfeld + * July 16, 2008 * SOURCE */ int_f -nh5gget_info_c (hid_t_f *group_id, int_f *storage_type, int_f *nlinks, int_f *max_corder, int_f *mounted ) +h5gget_info_c (hid_t_f *group_id, int_f *storage_type, int_f *nlinks, int_f *max_corder, int_f *mounted ) /******/ { @@ -914,43 +913,43 @@ done: /****if* H5Gf/h5gget_info_by_idx_c * NAME - * h5gget_info_by_idx_c + * h5gget_info_by_idx_c * PURPOSE - * Call H5Gget_info_by_idx + * Call H5Gget_info_by_idx * INPUTS * - * loc_id - File or group identifier - * group_name - Name of group containing group for which information is to be retrieved - * group_namelen - name length - * index_type - Index type - * order - Order of the count in the index - * n - Position in the index of the group for which information is retrieved - * lapl_id - Link access property list + * loc_id - File or group identifier + * group_name - Name of group containing group for which information is to be retrieved + * group_namelen - name length + * index_type - Index type + * order - Order of the count in the index + * n - Position in the index of the group for which information is retrieved + * lapl_id - Link access property list * OUTPUTS * - * storage_type - Type of storage for links in group: + * storage_type - Type of storage for links in group: * H5G_STORAGE_TYPE_COMPACT: Compact storage * H5G_STORAGE_TYPE_DENSE: Indexed storage * H5G_STORAGE_TYPE_SYMBOL_TABLE: Symbol tables, the original HDF5 structure * - * nlinks - Number of links in group - * max_corder - Current maximum creation order value for group - * mounted - Whether group has a file mounted on it (0 = false, 1 = true) + * nlinks - Number of links in group + * max_corder - Current maximum creation order value for group + * mounted - Whether group has a file mounted on it (0 = false, 1 = true) * * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * M. Scot Breitenfeld - * February 18, 2008 + * February 18, 2008 * HISTORY * - * - Added 'mounted' paramater - * M. Scot Breitenfeld - * July 16, 2008 + * - Added 'mounted' parameter + * M. Scot Breitenfeld + * July 16, 2008 * SOURCE */ int_f -nh5gget_info_by_idx_c(hid_t_f *loc_id, _fcd group_name, size_t_f *group_namelen, +h5gget_info_by_idx_c(hid_t_f *loc_id, _fcd group_name, size_t_f *group_namelen, int_f *index_type, int_f *order, hsize_t_f *n, hid_t_f *lapl_id, int_f *storage_type, int_f *nlinks, int_f *max_corder, int_f *mounted ) /******/ @@ -987,40 +986,40 @@ nh5gget_info_by_idx_c(hid_t_f *loc_id, _fcd group_name, size_t_f *group_namelen, /****if* H5Gf/h5gget_info_by_name_c * NAME - * h5gget_info_by_name_c + * h5gget_info_by_name_c * PURPOSE - * Call H5Gget_info_by_name + * Call H5Gget_info_by_name * INPUTS * - * loc_id - File or group identifier - * group_name - Name of group containing group for which information is to be retrieved - * group_namelen - name length - * lapl_id - Link access property list + * loc_id - File or group identifier + * group_name - Name of group containing group for which information is to be retrieved + * group_namelen - name length + * lapl_id - Link access property list * OUTPUTS * - * storage_type - Type of storage for links in group: + * storage_type - Type of storage for links in group: * H5G_STORAGE_TYPE_COMPACT: Compact storage * H5G_STORAGE_TYPE_DENSE: Indexed storage * H5G_STORAGE_TYPE_SYMBOL_TABLE: Symbol tables, the original HDF5 structure * - * nlinks - Number of links in group - * max_corder - Current maximum creation order value for group - * mounted - Whether group has a file mounted on it (0 = false, 1 = true) + * nlinks - Number of links in group + * max_corder - Current maximum creation order value for group + * mounted - Whether group has a file mounted on it (0 = false, 1 = true) * * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * M. Scot Breitenfeld - * February 18, 2008 + * February 18, 2008 * HISTORY * - * - Added 'mounted' paramater - * M. Scot Breitenfeld - * July 16, 2008 + * - Added 'mounted' paramater + * M. Scot Breitenfeld + * July 16, 2008 * SOURCE */ int_f -nh5gget_info_by_name_c(hid_t_f *loc_id, _fcd group_name, size_t_f *group_namelen, hid_t_f *lapl_id, +h5gget_info_by_name_c(hid_t_f *loc_id, _fcd group_name, size_t_f *group_namelen, hid_t_f *lapl_id, int_f *storage_type, int_f *nlinks, int_f *max_corder, int_f *mounted) /******/ { diff --git a/fortran/src/H5Gff.F90 b/fortran/src/H5Gff.F90 new file mode 100644 index 0000000..2e002b5 --- /dev/null +++ b/fortran/src/H5Gff.F90 @@ -0,0 +1,1272 @@ +!****h* ROBODoc/H5G +! +! NAME +! MODULE H5G +! +! FILE +! fortran/src/H5Gff.f90 +! +! PURPOSE +! This file contains Fortran interfaces for H5G functions. +! +! 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. * +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! +! NOTES +! _____ __ __ _____ ____ _____ _______ _ _ _______ +! |_ _| \/ | __ \ / __ \| __ \__ __|/\ | \ | |__ __| +! **** | | | \ / | |__) | | | | |__) | | | / \ | \| | | | **** +! **** | | | |\/| | ___/| | | | _ / | | / /\ \ | . ` | | | **** +! **** _| |_| | | | | | |__| | | \ \ | |/ ____ \| |\ | | | **** +! |_____|_| |_|_| \____/|_| \_\ |_/_/ \_\_| \_| |_| +! +! If you add a new H5G function you must add the function name to the +! Windows dll file 'hdf5_fortrandll.def.in' in the fortran/src directory. +! This is needed for Windows based operating systems. +! +!***** + +MODULE H5G + USE, INTRINSIC :: ISO_C_BINDING, ONLY : C_CHAR + USE H5GLOBAL + +CONTAINS + +!****s* H5G/h5gcreate_f +! +! NAME +! h5gcreate_f +! +! PURPOSE +! Creates a new group. +! +! INPUTS +! loc_id - location identifier +! name - group name at the specified location +! OUTPUTS +! grp_id - group identifier +! hdferr - Returns 0 if successful and -1 if fails +! OPTIONAL PARAMETERS +! size_hint - a parameter indicating the number of bytes to +! reserve for the names that will appear in the group +! lcpl_id - Property list for link creation +! gcpl_id - Property list for group creation +! gapl_id - Property list for group access +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 5, 2001 +! +! Added additional optional paramaters in 1.8 +! MSB - February 27, 2008 +! +! SOURCE + SUBROUTINE h5gcreate_f(loc_id, name, grp_id, hdferr, size_hint, lcpl_id, gcpl_id, gapl_id) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier + CHARACTER(LEN=*), INTENT(IN) :: name ! Name of the group + INTEGER(HID_T), INTENT(OUT) :: grp_id ! Group identifier + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(SIZE_T), OPTIONAL, INTENT(IN) :: size_hint + ! Parameter indicating + ! the number of bytes + ! to reserve for the + ! names that will appear + ! in the group. Set to OBJECT_NAMELEN_DEFAULT_F + ! if using any of the optional + ! parameters lcpl_id, gcpl_id, and/or gapl_id when not + ! using keywords in specifying the optional parameters + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lcpl_id ! Property list for link creation + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: gcpl_id ! Property list for group creation + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: gapl_id ! Property list for group access +!***** + INTEGER(HID_T) :: lcpl_id_default + INTEGER(HID_T) :: gcpl_id_default + INTEGER(HID_T) :: gapl_id_default + + INTEGER :: namelen ! Length of the name character string + INTEGER(SIZE_T) :: size_hint_default + + INTERFACE + INTEGER FUNCTION h5gcreate_c(loc_id, name, namelen, & + size_hint_default, grp_id, lcpl_id_default, gcpl_id_default, gapl_id_default) & + BIND(C,NAME='h5gcreate_c') + IMPORT :: C_CHAR + IMPORT :: HID_T, SIZE_T + INTEGER(HID_T), INTENT(IN) :: loc_id + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: name + INTEGER :: namelen + INTEGER(SIZE_T) :: size_hint_default + INTEGER(HID_T), INTENT(OUT) :: grp_id + INTEGER(HID_T) :: lcpl_id_default + INTEGER(HID_T) :: gcpl_id_default + INTEGER(HID_T) :: gapl_id_default + END FUNCTION h5gcreate_c + END INTERFACE + + size_hint_default = OBJECT_NAMELEN_DEFAULT_F + IF (PRESENT(size_hint)) size_hint_default = size_hint + lcpl_id_default = H5P_DEFAULT_F + IF(PRESENT(lcpl_id)) lcpl_id_default = lcpl_id + gcpl_id_default = H5P_DEFAULT_F + IF(PRESENT(gcpl_id)) gcpl_id_default = gcpl_id + gapl_id_default = H5P_DEFAULT_F + IF(PRESENT(gapl_id)) gapl_id_default = gapl_id + + namelen = LEN(name) + + hdferr = h5gcreate_c(loc_id, name, namelen, size_hint_default, grp_id, & + lcpl_id_default, gcpl_id_default, gapl_id_default) + + END SUBROUTINE h5gcreate_f + +!!$! +!!$!****s* H5G/ +!!$! +!!$! NAME +!!$! h5gcreate2_f +!!$! +!!$! PURPOSE +!!$! Creates a new group. +!!$! +!!$! INPUTS +!!$! loc_id - location identifier +!!$! name - group name at the specified location +!!$! OUTPUTS +!!$! grp_id - group identifier +!!$! hdferr: - error code +!!$! Success: 0 +!!$! Failure: -1 +!!$! OPTIONAL PARAMETERS +!!$! +!!$! lcpl_id - Property list for link creation +!!$! gcpl_id - Property list for group creation +!!$! gapl_id - Property list for group access +!!$! +!!$! AUTHOR M. Scot Breitenfeld +!!$! February 27, 2008 +!!$! +!!$! HISTORY +!!$! +!!$! NOTES Needed to switch the first 2 arguments to avoid conflect +!!$! with h5gcreate1_f +!!$! +!!$ +!!$ SUBROUTINE h5gcreate2_f(name, loc_id, grp_id, hdferr, & +!!$ lcpl_id, gcpl_id, gapl_id) +!!$ IMPLICIT NONE +!!$ CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: name ! Name of the group +!!$ INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier +!!$ INTEGER, INTENT(OUT) :: hdferr ! Error code +!!$ INTEGER(HID_T), INTENT(OUT) :: grp_id ! Group identifier +!!$ +!!$ INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lcpl_id ! Property list for link creation +!!$ INTEGER(HID_T), OPTIONAL, INTENT(IN) :: gcpl_id ! Property list for group creation +!!$ INTEGER(HID_T), OPTIONAL, INTENT(IN) :: gapl_id ! Property list for group access +!!$ +!!$ INTEGER(HID_T) :: lcpl_id_default +!!$ INTEGER(HID_T) :: gcpl_id_default +!!$ INTEGER(HID_T) :: gapl_id_default +!!$ +!!$ INTEGER(SIZE_T) :: OBJECT_NAME +! LEN_DEFAULT ! Dummy argument to pass to c call +!!$ INTEGER :: namelen ! Length of the name character string +!!$ +!!$! MS FORTRAN needs explicit interface for C functions called here. +!!$! +!!$ INTERFACE +!!$ INTEGER FUNCTION h5gcreate_c(loc_id, name, namelen, & +!!$ OBJECT_NAME +! LEN_DEFAULT, grp_id, lcpl_id_default, gcpl_id_default, gapl_id_default) +!!$ USE H5GLOBAL +!!$ !DEC$IF DEFINED(HDF5F90_WINDOWS) +!!$ !DEC$ATTRIBUTES C,reference,decorate,alias:'H5GCREATE_C'::h5gcreate_c +!!$ !DEC$ENDIF +!!$ !DEC$ATTRIBUTES reference :: name +!!$ INTEGER(HID_T), INTENT(IN) :: loc_id +!!$ CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: name +!!$ INTEGER :: namelen +!!$ INTEGER(SIZE_T) :: OBJECT_NAME +! LEN_DEFAULT +!!$ INTEGER(HID_T) :: lcpl_id_default +!!$ INTEGER(HID_T) :: gcpl_id_default +!!$ INTEGER(HID_T) :: gapl_id_default +!!$ INTEGER(HID_T), INTENT(OUT) :: grp_id +!!$ END FUNCTION h5gcreate_c +!!$ END INTERFACE +!!$ +!!$ namelen = LEN(name) +!!$ OBJECT_NAME +! LEN_DEFAULT = OBJECT_NAME +! LEN_DEFAULT_F +!!$ +!!$ lcpl_id_default = H5P_DEFAULT_F +!!$ IF(PRESENT(lcpl_id)) lcpl_id_default = lcpl_id +!!$ gcpl_id_default = H5P_DEFAULT_F +!!$ IF(PRESENT(gcpl_id)) gcpl_id_default = gcpl_id +!!$ gapl_id_default = H5P_DEFAULT_F +!!$ IF(PRESENT(gapl_id)) gapl_id_default = gapl_id +!!$ +!!$ +!!$ hdferr = h5gcreate_c(loc_id, name, namelen, OBJECT_NAME +! LEN_DEFAULT, grp_id, & +!!$ lcpl_id_default, gcpl_id_default, gapl_id_default) +!!$ +!!$ END SUBROUTINE h5gcreate2_f + +! +!****s* H5G/h5gopen_f +! +! NAME +! h5gopen_f +! +! PURPOSE +! Opens an existing group. +! +! INPUTS +! loc_id - location identifier +! name - name of the group to open +! OUTPUTS +! grp_id - group identifier +! hdferr - Returns 0 if successful and -1 if fails +! OPTIONAL PARAMETERS +! gapl_id - Group access property list identifier +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 5, 2001 +! +! Added 1.8 (optional) parameter gapl_id +! February, 2008 M. Scot Breitenfeld +! +! SOURCE + SUBROUTINE h5gopen_f(loc_id, name, grp_id, hdferr, gapl_id) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier + CHARACTER(LEN=*), INTENT(IN) :: name ! Name of the group + INTEGER(HID_T), INTENT(OUT) :: grp_id ! File identifier + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: gapl_id ! Group access property list identifier +!***** + INTEGER(HID_T) :: gapl_id_default + INTEGER :: namelen ! Length of the name character string + + INTERFACE + INTEGER FUNCTION h5gopen_c(loc_id, name, namelen, gapl_id_default, grp_id) & + BIND(C,NAME='h5gopen_c') + IMPORT :: C_CHAR + IMPORT :: HID_T + INTEGER(HID_T), INTENT(IN) :: loc_id + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: name + INTEGER :: namelen + INTEGER(HID_T), INTENT(IN) :: gapl_id_default + INTEGER(HID_T), INTENT(OUT) :: grp_id + END FUNCTION h5gopen_c + END INTERFACE + + gapl_id_default = H5P_DEFAULT_F + IF(PRESENT(gapl_id)) gapl_id_default = gapl_id + + namelen = LEN(name) + hdferr = h5gopen_c(loc_id, name, namelen, gapl_id_default, grp_id) + + END SUBROUTINE h5gopen_f +! +!****s* H5G/h5gclose_f +! +! NAME +! h5gclose_f +! +! PURPOSE +! Closes the specified group. +! +! INPUTS +! grp_id - group identifier +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 5, 2001 +! +! SOURCE + SUBROUTINE h5gclose_f(grp_id, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: grp_id ! Group identifier + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + INTERFACE + INTEGER FUNCTION h5gclose_c(grp_id) BIND(C,NAME='h5gclose_c') + IMPORT :: HID_T + INTEGER(HID_T), INTENT(IN) :: grp_id + END FUNCTION h5gclose_c + END INTERFACE + + hdferr = h5gclose_c(grp_id) + + END SUBROUTINE h5gclose_f +! +!****s* H5G/h5gget_obj_info_idx_f +! +! NAME +! h5gget_obj_info_idx_f +! +! PURPOSE +! Returns name and type of the group member identified by +! its index. +! +! INPUTS +! loc_id - location identifier +! name - name of the group at the specified location +! idx - object index (zero-based) +! OUTPUTS +! obj_name - object name +! obj_type - object type +! hdferr - Returns 0 if successful and -1 if fails +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 5, 2001 +! +! SOURCE + SUBROUTINE h5gget_obj_info_idx_f(loc_id, name, idx, & + obj_name, obj_type, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier + CHARACTER(LEN=*), INTENT(IN) :: name ! Name of the group + INTEGER, INTENT(IN) :: idx ! Index of member object + CHARACTER(LEN=*), INTENT(OUT) :: obj_name ! Name of the object + INTEGER, INTENT(OUT) :: obj_type ! Object type + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + INTEGER :: namelen ! Length of the name character string + INTEGER :: obj_namelen ! Length of the obj_name character string + + INTERFACE + INTEGER FUNCTION h5gget_obj_info_idx_c(loc_id, name, & + namelen, idx, & + obj_name, obj_namelen, obj_type) BIND(C,NAME='h5gget_obj_info_idx_c') + IMPORT :: C_CHAR + IMPORT :: HID_T + INTEGER(HID_T), INTENT(IN) :: loc_id + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: name + INTEGER :: namelen + INTEGER, INTENT(IN) :: idx + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(OUT) :: obj_name + INTEGER :: obj_namelen + INTEGER, INTENT(OUT) :: obj_type + END FUNCTION h5gget_obj_info_idx_c + END INTERFACE + + namelen = LEN(name) + obj_namelen = LEN(obj_name) + hdferr = h5gget_obj_info_idx_c(loc_id, name, namelen, idx, & + obj_name, obj_namelen, obj_type) + END SUBROUTINE h5gget_obj_info_idx_f + +! +!****s* H5G/h5gn_members_f +! +! NAME +! h5gn_members_f +! +! PURPOSE +! Returns the number of group members. +! +! INPUTS +! loc_id - location identifier +! name - name of the group at the specified location +! OUTPUTS +! nmembers - number of group members +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 5, 2001 +! +! SOURCE + SUBROUTINE h5gn_members_f(loc_id, name, nmembers, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier + CHARACTER(LEN=*), INTENT(IN) :: name ! Name of the group + INTEGER, INTENT(OUT) :: nmembers ! Number of members in the + ! group + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + INTEGER :: namelen ! Length of the name character string + + INTERFACE + INTEGER FUNCTION h5gn_members_c(loc_id, name, namelen, nmembers) & + BIND(C,NAME='h5gn_members_c') + IMPORT :: C_CHAR + IMPORT :: HID_T + INTEGER(HID_T), INTENT(IN) :: loc_id + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: name + INTEGER :: namelen + INTEGER, INTENT(OUT) :: nmembers + END FUNCTION h5gn_members_c + END INTERFACE + + namelen = LEN(name) + hdferr = h5gn_members_c(loc_id, name, namelen, nmembers) + + END SUBROUTINE h5gn_members_f +! +!****s* H5G/h5glink_f +! +! NAME +! h5glink_f +! +! PURPOSE +! Creates a link of the specified type from new_name +! to current_name. +! +! INPUTS +! loc_id - location identifier +! link_type - link type; possible values are: +! H5G_LINK_HARD_F (0) +! H5G_LINK_SOFT_F (1) +! current_name - name of the existing object if link is a +! hard link. Can be anything for the soft link +! new_name - new name for the object +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 5, 2001 +! +! SOURCE + SUBROUTINE h5glink_f(loc_id, link_type, current_name, & + new_name, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier + INTEGER, INTENT(IN) :: link_type ! link type + ! Possible values are: + ! H5G_LINK_HARD_F (0) or + ! H5G_LINK_SOFT_F (1) + + CHARACTER(LEN=*), INTENT(IN) :: current_name + ! Current name of an object + CHARACTER(LEN=*), INTENT(IN) :: new_name ! New name of an object + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + + INTEGER :: current_namelen ! Lenghth of the current_name string + INTEGER :: new_namelen ! Lenghth of the new_name string + + INTERFACE + INTEGER FUNCTION h5glink_c(loc_id, link_type, current_name, & + current_namelen, new_name, new_namelen) & + BIND(C,NAME='h5glink_c') + IMPORT :: C_CHAR + IMPORT :: HID_T + INTEGER(HID_T), INTENT(IN) :: loc_id + INTEGER, INTENT(IN) :: link_type + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: current_name + INTEGER :: current_namelen + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: new_name + INTEGER :: new_namelen + END FUNCTION h5glink_c + END INTERFACE + + current_namelen = LEN(current_name) + new_namelen = LEN(new_name) + hdferr = h5glink_c(loc_id, link_type, current_name, & + current_namelen, new_name, new_namelen) + END SUBROUTINE h5glink_f + +! +!****s* H5G/h5glink2_f +! +! NAME +! h5glink2_f +! +! PURPOSE +! Creates a link of the specified type from new_name +! to current_name. current_name and new_name are interpreted +! releative to current and new location identifiers. +! +! INPUTS +! cur_loc_id - location identifier +! cur_name - name of the existing object if link is a +! hard link. Can be anything for the soft link. +! link_type - link type; possible values are: +! H5G_LINK_HARD_F (0) +! H5G_LINK_SOFT_F (1) +! new_loc_id - new location identifier +! new_name - new name for the object +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! September 25, 2002 +! +! SOURCE + SUBROUTINE h5glink2_f(cur_loc_id, cur_name, link_type, new_loc_id, & + new_name, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: cur_loc_id ! File or group identifier + CHARACTER(LEN=*), INTENT(IN) :: cur_name + ! Current name of an object + INTEGER, INTENT(IN) :: link_type ! link type + ! Possible values are: + ! H5G_LINK_HARD_F (0) or + ! H5G_LINK_SOFT_F (1) + + INTEGER(HID_T), INTENT(IN) :: new_loc_id ! File or group identifier + CHARACTER(LEN=*), INTENT(IN) :: new_name ! New name of an object + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + + INTEGER :: cur_namelen ! Lenghth of the current_name string + INTEGER :: new_namelen ! Lenghth of the new_name string + + INTERFACE + INTEGER FUNCTION h5glink2_c(cur_loc_id, cur_name, cur_namelen, & + link_type, new_loc_id, & + new_name, new_namelen) BIND(C,NAME='h5glink2_c') + IMPORT :: C_CHAR + IMPORT :: HID_T + INTEGER(HID_T), INTENT(IN) :: cur_loc_id + INTEGER(HID_T), INTENT(IN) :: new_loc_id + INTEGER, INTENT(IN) :: link_type + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: cur_name + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: new_name + INTEGER :: cur_namelen + INTEGER :: new_namelen + END FUNCTION h5glink2_c + END INTERFACE + + cur_namelen = LEN(cur_name) + new_namelen = LEN(new_name) + hdferr = h5glink2_c(cur_loc_id, cur_name, cur_namelen, link_type, & + new_loc_id, new_name, new_namelen) + END SUBROUTINE h5glink2_f + +! +!****s* H5G/h5gunlink_f +! +! NAME +! h5gunlink_f +! +! PURPOSE +! Removes the specified name from the group graph and +! decrements the link count for the object to which name +! points +! +! INPUTS +! loc_id - location identifier +! name - name of the object to unlink +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 5, 2001 +! +! SOURCE + SUBROUTINE h5gunlink_f(loc_id, name, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier + CHARACTER(LEN=*), INTENT(IN) :: name ! Name of an object + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + INTEGER :: namelen ! Lenghth of the name character string + + INTERFACE + INTEGER FUNCTION h5gunlink_c(loc_id, name, namelen) BIND(C,NAME='h5gunlink_c') + IMPORT :: C_CHAR + IMPORT :: HID_T + INTEGER(HID_T), INTENT(IN) :: loc_id + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: name + INTEGER :: namelen + END FUNCTION h5gunlink_c + END INTERFACE + + namelen = LEN(name) + hdferr = h5gunlink_c(loc_id, name, namelen) + END SUBROUTINE h5gunlink_f + +! +!****s* H5G/h5gmove_f +! +! NAME +! h5gmove_f +! +! PURPOSE +! Renames an object within an HDF5 file. +! +! INPUTS +! loc_id - location identifier +! name - object's name at specified location +! new_name - object's new name +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 5, 2001 +! +! SOURCE + SUBROUTINE h5gmove_f(loc_id, name, new_name, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier + CHARACTER(LEN=*), INTENT(IN) :: name ! Current name of an object + CHARACTER(LEN=*), INTENT(IN) :: new_name ! New name of an object + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + INTEGER :: namelen ! Lenghth of the current_name string + INTEGER :: new_namelen ! Lenghth of the new_name string + + INTERFACE + INTEGER FUNCTION h5gmove_c(loc_id, name, namelen, new_name, new_namelen) BIND(C,NAME='h5gmove_c') + IMPORT :: C_CHAR + IMPORT :: HID_T + INTEGER(HID_T), INTENT(IN) :: loc_id + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: name + INTEGER :: namelen + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: new_name + INTEGER :: new_namelen + END FUNCTION h5gmove_c + END INTERFACE + + namelen = LEN(name) + new_namelen = LEN(new_name) + hdferr = h5gmove_c(loc_id, name, namelen, new_name, new_namelen) + END SUBROUTINE h5gmove_f +! +!****s* H5G/h5gmove2_f +! +! NAME +! h5gmove2_f +! +! PURPOSE +! Renames an object within an HDF5 file. +! +! INPUTS +! src_loc_id - original location identifier +! src_name - object's name at specified original location +! dst_loc_id - original location identifier +! dst_name - object's new name +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails +! AUTHOR +! Elena Pourmal +! September 25, 2002 +! +! SOURCE + SUBROUTINE h5gmove2_f(src_loc_id, src_name, dst_loc_id, dst_name, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: src_loc_id ! File or group identifier + CHARACTER(LEN=*), INTENT(IN) :: src_name ! Original name of an object + INTEGER(HID_T), INTENT(IN) :: dst_loc_id ! File or group identifier + CHARACTER(LEN=*), INTENT(IN) :: dst_name ! New name of an object + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + INTEGER :: src_namelen ! Length of the current_name string + INTEGER :: dst_namelen ! Lenghth of the new_name string + + INTERFACE + INTEGER FUNCTION h5gmove2_c(src_loc_id, src_name, src_namelen, & + dst_loc_id, dst_name, dst_namelen) BIND(C,NAME='h5gmove2_c') + IMPORT :: C_CHAR + IMPORT :: HID_T + INTEGER(HID_T), INTENT(IN) :: src_loc_id + INTEGER(HID_T), INTENT(IN) :: dst_loc_id + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: src_name + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: dst_name + INTEGER :: src_namelen + INTEGER :: dst_namelen + END FUNCTION h5gmove2_c + END INTERFACE + + src_namelen = LEN(src_name) + dst_namelen = LEN(dst_name) + hdferr = h5gmove2_c(src_loc_id, src_name, src_namelen, dst_loc_id, dst_name, dst_namelen) + END SUBROUTINE h5gmove2_f +! +!****s* H5G/h5gget_linkval_f +! +! NAME +! h5gget_linkval_f +! +! PURPOSE +! Returns the name of the object that the symbolic link +! points to. +! +! INPUTS +! loc_id - location identifier +! name - symbolic link to the object whose name +! is to be returned. +! size - maximum number of characters to be returned +! OUTPUTS +! buffer - a buffer to hold the name of the object +! being sought +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 5, 2001 +! +! SOURCE + SUBROUTINE h5gget_linkval_f(loc_id, name, size, buffer, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier + CHARACTER(LEN=*), INTENT(IN) :: name ! Current name of an object + INTEGER(SIZE_T), INTENT(IN) :: size ! Maximum number of buffer + CHARACTER(LEN=size), INTENT(OUT) :: buffer + ! Buffer to hold a name of + ! the object symbolic link + ! points to + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + INTEGER :: namelen ! Lenghth of the current_name string + + INTERFACE + INTEGER FUNCTION h5gget_linkval_c(loc_id, name, namelen, size, buffer) BIND(C,NAME='h5gget_linkval_c') + IMPORT :: C_CHAR, SIZE_T + IMPORT :: HID_T + INTEGER(HID_T), INTENT(IN) :: loc_id + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: name + INTEGER :: namelen + INTEGER(SIZE_T), INTENT(IN) :: size + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(OUT) :: buffer + END FUNCTION h5gget_linkval_c + END INTERFACE + + namelen = LEN(name) + hdferr = h5gget_linkval_c(loc_id, name, namelen, size, buffer) + END SUBROUTINE h5gget_linkval_f + +! +!****s* H5G/h5gset_comment_f +! +! NAME +! h5gset_comment_f +! +! PURPOSE +! Sets comment for specified object. +! +! INPUTS +! loc_id - location identifier +! name - name of the object +! comment - comment to set for the object +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 5, 2001 +! +! SOURCE + SUBROUTINE h5gset_comment_f(loc_id, name, comment, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier + CHARACTER(LEN=*), INTENT(IN) :: name ! Current name of an object + CHARACTER(LEN=*), INTENT(IN) :: comment ! New name of an object + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + INTEGER :: namelen ! Lenghth of the current_name string + INTEGER :: commentlen ! Lenghth of the comment string + + INTERFACE + INTEGER FUNCTION h5gset_comment_c(loc_id, name, namelen, & + comment, commentlen) BIND(C,NAME='h5gset_comment_c') + IMPORT :: C_CHAR + IMPORT :: HID_T + INTEGER(HID_T), INTENT(IN) :: loc_id + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: name + INTEGER :: namelen + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: comment + INTEGER :: commentlen + END FUNCTION h5gset_comment_c + END INTERFACE + + namelen = LEN(name) + commentlen = LEN(comment) + hdferr = h5gset_comment_c(loc_id, name, namelen, comment, commentlen) + END SUBROUTINE h5gset_comment_f +! +!****s* H5G/h5gget_comment_f +! +! NAME +! h5gget_comment_f +! +! PURPOSE +! Retrieves comment for specified object. +! +! INPUTS +! loc_id - location identifier +! name - name of the object at specified location +! size - size of the buffer required to hold comment +! OUTPUTS +! buffer - buffer to hold object's comment +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 5, 2001 +! +! SOURCE + SUBROUTINE h5gget_comment_f(loc_id, name, size, buffer, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier + CHARACTER(LEN=*), INTENT(IN) :: name ! Current name of an object + INTEGER(SIZE_T), INTENT(IN) :: size ! Maximum number of buffer + CHARACTER(LEN=size), INTENT(OUT) :: buffer + ! Buffer to hold a comment + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + INTEGER :: namelen ! Length of the current_name string + + INTERFACE + INTEGER FUNCTION h5gget_comment_c(loc_id, name, namelen, size, buffer) BIND(C,NAME='h5gget_comment_c') + IMPORT :: C_CHAR + IMPORT :: HID_T, SIZE_T + INTEGER(HID_T), INTENT(IN) :: loc_id + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: name + INTEGER :: namelen + INTEGER(SIZE_T), INTENT(IN) :: size + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(OUT) :: buffer + END FUNCTION h5gget_comment_c + END INTERFACE + + namelen = LEN(name) + hdferr = h5gget_comment_c(loc_id, name, namelen, size, buffer) + + END SUBROUTINE h5gget_comment_f +! +!****s* H5G/H5Gcreate_anon_f +! +! NAME +! H5Gcreate_anon_f +! +! PURPOSE +! Creates a new empty group without linking it into the file structure. +! +! INPUTS +! loc_id - Location identifier +! OUTPUTS +! grp_id - group identifier +! hdferr - Returns 0 if successful and -1 if fails +! OPTIONAL PARAMETERS +! gcpl_id - Group creation property list identifier +! gapl_id - Group access property list identifier +! +! AUTHOR +! M. Scot Breitenfeld +! February 15, 2008 +! +! SOURCE + SUBROUTINE h5Gcreate_anon_f(loc_id, grp_id, hdferr, gcpl_id, gapl_id) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier + INTEGER(HID_T), INTENT(OUT) :: grp_id ! Group identifier + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: gcpl_id ! Property list for group creation + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: gapl_id ! Property list for group access +!***** + INTEGER(HID_T) :: gcpl_id_default + INTEGER(HID_T) :: gapl_id_default + + INTERFACE + INTEGER FUNCTION h5gcreate_anon_c(loc_id, gcpl_id_default, gapl_id_default, grp_id) & + BIND(C,NAME='h5gcreate_anon_c') + IMPORT :: HID_T + INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier + INTEGER(HID_T), INTENT(IN) :: gcpl_id_default ! Property list for group creation + INTEGER(HID_T), INTENT(IN) :: gapl_id_default ! Property list for group access + INTEGER(HID_T), INTENT(OUT) :: grp_id ! Group identifier + END FUNCTION h5gcreate_anon_c + END INTERFACE + + gcpl_id_default = H5P_DEFAULT_F + gapl_id_default = H5P_DEFAULT_F + + IF(PRESENT(gcpl_id)) gcpl_id_default = gcpl_id + IF(PRESENT(gapl_id)) gapl_id_default = gapl_id + + hdferr = h5gcreate_anon_c(loc_id, gcpl_id_default, gapl_id_default, grp_id) + + END SUBROUTINE h5Gcreate_anon_f +! +!****s* H5G/H5Gget_create_plist_f +! +! NAME +! H5Gget_create_plist_f +! +! PURPOSE +! Gets a group creation property list identifier. +! +! INPUTS +! grp_id - group identifier +! OUTPUTS +! gcpl_id - Group creation property list identifier +! hdferr - Returns 0 if successful and -1 if fails +! AUTHOR +! M. Scot Breitenfeld +! February 15, 2008 +! +! SOURCE + SUBROUTINE h5gget_create_plist_f(grp_id, gcpl_id, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: grp_id ! Group identifier + INTEGER(HID_T), INTENT(OUT) :: gcpl_id ! Property list for group creation + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + INTERFACE + INTEGER FUNCTION h5gget_create_plist_c(grp_id, gcpl_id ) BIND(C,NAME='h5gget_create_plist_c') + IMPORT :: HID_T + INTEGER(HID_T), INTENT(IN) :: grp_id + INTEGER(HID_T), INTENT(OUT) :: gcpl_id + END FUNCTION h5gget_create_plist_c + END INTERFACE + + hdferr = h5gget_create_plist_c(grp_id, gcpl_id ) + + END SUBROUTINE h5gget_create_plist_f + +! +!****s* H5G/h5gget_info_f +! +! NAME +! h5gget_info_f +! +! PURPOSE +! Retrieves information about a group +! +! INPUTS +! group_id - Group identifier +! +! OUTPUTS +! storage_type - Type of storage for links in group +! H5G_STORAGE_TYPE_COMPACT: Compact storage +! H5G_STORAGE_TYPE_DENSE: Indexed storage +! H5G_STORAGE_TYPE_SYMBOL_TABLE: Symbol tables, the original HDF5 structure +! nlinks - Number of links in group +! max_corder - Current maximum creation order value for group +! hdferr - Returns 0 if successful and -1 if fails +! OPTIONAL PARAMETERS +! mounted - Whether group has a file mounted on it +! +! AUTHOR +! M. Scot Breitenfeld +! February 15, 2008 +! +! NOTES +! In C the output is defined as a structure: H5G_info_t +! +! HISTORY +! +! - Added 'mounted' paramater +! M. Scot Breitenfeld +! July 16, 2008 +! +! SOURCE + SUBROUTINE h5gget_info_f(group_id, storage_type, nlinks, max_corder, hdferr, mounted) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: group_id ! Group identifier + + INTEGER, INTENT(OUT) :: storage_type ! Type of storage for links in group: + ! H5G_STORAGE_TYPE_COMPACT_F: Compact storage + ! H5G_STORAGE_TYPE_DENSE_F: Indexed storage + ! H5G_STORAGE_TYPE_SYMBOL_TABLE_F: Symbol tables, the original HDF5 structure + INTEGER, INTENT(OUT) :: nlinks ! Number of links in group + INTEGER, INTENT(OUT) :: max_corder ! Current maximum creation order value for group + INTEGER, INTENT(OUT) :: hdferr ! Error code: + ! 0 on success and -1 on failure + LOGICAL, INTENT(OUT), OPTIONAL :: mounted ! Whether group has a file mounted on it +!***** + INTEGER :: mounted_c + + INTERFACE + INTEGER FUNCTION h5gget_info_c(group_id, storage_type, nlinks, max_corder, mounted_c) & + BIND(C,NAME='h5gget_info_c') + IMPORT :: HID_T + INTEGER(HID_T), INTENT(IN) :: group_id + INTEGER, INTENT(OUT) :: storage_type + INTEGER, INTENT(OUT) :: nlinks + INTEGER, INTENT(OUT) :: max_corder + INTEGER :: mounted_c + END FUNCTION h5gget_info_c + END INTERFACE + + hdferr = h5gget_info_c(group_id, storage_type, nlinks, max_corder, mounted_c) + + IF(PRESENT(mounted))THEN + IF(mounted_c.EQ.0) THEN + mounted = .FALSE. + ELSE + mounted = .TRUE. + ENDIF + ENDIF + + END SUBROUTINE h5gget_info_f +! +!****s* H5G/h5gget_info_by_idx_f +! +! NAME +! h5gget_info_by_idx_f +! +! PURPOSE +! Retrieves information about a group, according to the group’s position within an index. +! +! INPUTS +! loc_id - File or group identifier +! group_name - Name of group containing group for which information is to be retrieved +! index_type - Index type +! order - Order of the count in the index +! n - Position in the index of the group for which information is retrieved +! +! OUTPUTS +! storage_type - Type of storage for links in group +! H5G_STORAGE_TYPE_COMPACT: Compact storage +! H5G_STORAGE_TYPE_DENSE: Indexed storage +! H5G_STORAGE_TYPE_SYMBOL_TABLE: Symbol tables, the original HDF5 structure +! nlinks - Number of links in group +! max_corder - Current maximum creation order value for group +! hdferr - Returns 0 if successful and -1 if fails +! OPTIONAL PARAMETERS +! lapl_id - Link access property list +! mounted - Whether group has a file mounted on it +! +! NOTES +! In C the output is defined as a structure: H5G_info_t +! +! AUTHOR +! M. Scot Breitenfeld +! February 18, 2008 +! +! HISTORY +! Added 'mounted' paramater +! M. Scot Breitenfeld +! July 16, 2008 +! +! SOURCE + SUBROUTINE h5gget_info_by_idx_f(loc_id, group_name, index_type, order, n, & + storage_type, nlinks, max_corder, hdferr, lapl_id, mounted) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier + CHARACTER(LEN=*), INTENT(IN) :: group_name ! Name of group containing group for which information is to be retrieved + INTEGER, INTENT(IN) :: index_type ! Index type + INTEGER, INTENT(IN) :: order ! Order of the count in the index + INTEGER(HSIZE_T), INTENT(IN) :: n ! Position in the index of the group for which information is retrieved + + INTEGER, INTENT(OUT) :: storage_type ! Type of storage for links in group: + ! H5G_STORAGE_TYPE_COMPACT_F: Compact storage + ! H5G_STORAGE_TYPE_DENSE_F: Indexed storage + ! H5G_STORAGE_TYPE_SYMBOL_TABLE_F: Symbol tables, the original HDF5 structure + INTEGER, INTENT(OUT) :: nlinks ! Number of links in group + INTEGER, INTENT(OUT) :: max_corder ! Current maximum creation order value for group + INTEGER, INTENT(OUT) :: hdferr ! Error code: + ! 0 on success and -1 on failure + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list + LOGICAL, INTENT(OUT), OPTIONAL :: mounted ! Whether group has a file mounted on it +!***** + INTEGER :: mounted_c + INTEGER(HID_T) :: lapl_id_default + INTEGER(SIZE_T) :: group_name_len ! length of group name + + INTERFACE + INTEGER FUNCTION h5gget_info_by_idx_c(loc_id, group_name, group_name_len, index_type, order, n, lapl_id_default, & + storage_type, nlinks, max_corder, mounted_c) BIND(C,NAME='h5gget_info_by_idx_c') + IMPORT :: C_CHAR + IMPORT :: HID_T, SIZE_T, HSIZE_T + INTEGER(HID_T), INTENT(IN) :: loc_id + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: group_name + INTEGER, INTENT(IN) :: index_type + INTEGER, INTENT(IN) :: order + INTEGER(HSIZE_T), INTENT(IN) :: n + INTEGER(HID_T) :: lapl_id_default + INTEGER, INTENT(OUT) :: storage_type + INTEGER, INTENT(OUT) :: nlinks + INTEGER, INTENT(OUT) :: max_corder + + INTEGER(SIZE_T) :: group_name_len + INTEGER :: mounted_c + + END FUNCTION h5gget_info_by_idx_c + END INTERFACE + + group_name_len = LEN(group_name) + + lapl_id_default = H5P_DEFAULT_F + IF(PRESENT(lapl_id)) lapl_id_default = lapl_id + + hdferr = h5gget_info_by_idx_c(loc_id, group_name, group_name_len, & + index_type, order, n, lapl_id_default, & + storage_type, nlinks, max_corder, mounted_c) + + IF(PRESENT(mounted))THEN + IF(mounted_c.EQ.0) THEN + mounted = .FALSE. + ELSE + mounted = .TRUE. + ENDIF + ENDIF + + END SUBROUTINE h5gget_info_by_idx_f +! +!****s* H5G/h5gget_info_by_name_f +! +! NAME +! h5gget_info_by_name_f +! +! PURPOSE +! Retrieves information about a group. +! +! INPUTS +! loc_id - File or group identifier +! group_name - Name of group containing group for which information is to be retrieved +! +! OUTPUTS +! +! storage_type - Type of storage for links in group +! H5G_STORAGE_TYPE_COMPACT: Compact storage +! H5G_STORAGE_TYPE_DENSE: Indexed storage +! H5G_STORAGE_TYPE_SYMBOL_TABLE: Symbol tables, the original HDF5 structure +! nlinks - Number of links in group +! max_corder - Current maximum creation order value for group +! hdferr - Returns 0 if successful and -1 if fails +! OPTIONAL PARAMETERS +! lapl_id - Link access property list +! mounted - Whether group has a file mounted on it +! +! NOTES +! In C the output is defined as a structure: H5G_info_t +! +! AUTHOR +! M. Scot Breitenfeld +! February 18, 2008 +! +! HISTORY +! Added 'mounted' paramater +! M. Scot Breitenfeld +! July 16, 2008 +! SOURCE + SUBROUTINE h5gget_info_by_name_f(loc_id, group_name, & + storage_type, nlinks, max_corder, hdferr, lapl_id, mounted) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier + CHARACTER(LEN=*), INTENT(IN) :: group_name ! Name of group containing group for which information is to be retrieved + + INTEGER, INTENT(OUT) :: storage_type ! Type of storage for links in group: + ! H5G_STORAGE_TYPE_COMPACT_F: Compact storage + ! H5G_STORAGE_TYPE_DENSE_F: Indexed storage + ! H5G_STORAGE_TYPE_SYMBOL_TABLE_F: Symbol tables, the original HDF5 structure + INTEGER, INTENT(OUT) :: nlinks ! Number of links in group + INTEGER, INTENT(OUT) :: max_corder ! Current maximum creation order value for group + INTEGER, INTENT(OUT) :: hdferr ! Error code: + ! 0 on success and -1 on failure + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list + LOGICAL, INTENT(OUT), OPTIONAL :: mounted ! Whether group has a file mounted on it +!***** + INTEGER :: mounted_c + INTEGER(HID_T) :: lapl_id_default + INTEGER(SIZE_T) :: group_name_len ! length of group name + + INTERFACE + INTEGER FUNCTION h5gget_info_by_name_c(loc_id, group_name, group_name_len, lapl_id_default, & + storage_type, nlinks, max_corder, mounted_c) BIND(C,NAME='h5gget_info_by_name_c') + IMPORT :: C_CHAR + IMPORT :: HID_T, SIZE_T + INTEGER(HID_T), INTENT(IN) :: loc_id + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: group_name + INTEGER(HID_T), INTENT(IN) :: lapl_id_default + INTEGER, INTENT(OUT) :: storage_type + INTEGER, INTENT(OUT) :: nlinks + INTEGER, INTENT(OUT) :: max_corder + + INTEGER(SIZE_T) :: group_name_len + INTEGER :: mounted_c + + END FUNCTION h5gget_info_by_name_c + END INTERFACE + + group_name_len = LEN(group_name) + + lapl_id_default = H5P_DEFAULT_F + IF(PRESENT(lapl_id)) lapl_id_default = lapl_id + + hdferr = h5gget_info_by_name_c(loc_id, group_name, group_name_len, lapl_id_default, & + storage_type, nlinks, max_corder, mounted_c) + + IF(PRESENT(mounted))THEN + IF(mounted_c.EQ.0) THEN + mounted = .FALSE. + ELSE + mounted = .TRUE. + ENDIF + ENDIF + + END SUBROUTINE h5gget_info_by_name_f + +END MODULE H5G diff --git a/fortran/src/H5Gff.f90 b/fortran/src/H5Gff.f90 deleted file mode 100644 index d4d7496..0000000 --- a/fortran/src/H5Gff.f90 +++ /dev/null @@ -1,1331 +0,0 @@ -!****h* ROBODoc/H5G -! -! NAME -! MODULE H5G -! -! FILE -! fortran/src/H5Gff.f90 -! -! PURPOSE -! This file contains Fortran interfaces for H5G functions. -! -! 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. * -! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -! -! NOTES -! *** IMPORTANT *** -! If you add a new H5G function you must add the function name to the -! Windows dll file 'hdf5_fortrandll.def.in' in the fortran/src directory. -! This is needed for Windows based operating systems. -! -!***** - -MODULE H5G - USE H5GLOBAL - -! PRIVATE :: h5gcreate1_f -! PRIVATE :: h5gcreate2_f - -! INTERFACE h5gcreate_f -! MODULE PROCEDURE h5gcreate1_f -! MODULE PROCEDURE h5gcreate2_f -! END INTERFACE - -CONTAINS - -!****s* H5G/h5gcreate_f -! -! NAME -! h5gcreate_f -! -! PURPOSE -! Creates a new group. -! -! INPUTS -! loc_id - location identifier -! name - group name at the specified location -! OUTPUTS -! grp_id - group identifier -! hdferr - Returns 0 if successful and -1 if fails -! OPTIONAL PARAMETERS -! size_hint - a parameter indicating the number of bytes to -! reserve for the names that will appear in the group -! lcpl_id - Property list for link creation -! gcpl_id - Property list for group creation -! gapl_id - Property list for group access -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 5, 2001 -! -! Added additional optional paramaters in 1.8 -! MSB - February 27, 2008 -! -! SOURCE - SUBROUTINE h5gcreate_f(loc_id, name, grp_id, hdferr, size_hint, lcpl_id, gcpl_id, gapl_id) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier - CHARACTER(LEN=*), INTENT(IN) :: name ! Name of the group - INTEGER(HID_T), INTENT(OUT) :: grp_id ! Group identifier - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(SIZE_T), OPTIONAL, INTENT(IN) :: size_hint - ! Parameter indicating - ! the number of bytes - ! to reserve for the - ! names that will appear - ! in the group. Set to OBJECT_NAMELEN_DEFAULT_F - ! if using any of the optional - ! parameters lcpl_id, gcpl_id, and/or gapl_id when not - ! using keywords in specifying the optional parameters - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lcpl_id ! Property list for link creation - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: gcpl_id ! Property list for group creation - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: gapl_id ! Property list for group access -!***** - INTEGER(HID_T) :: lcpl_id_default - INTEGER(HID_T) :: gcpl_id_default - INTEGER(HID_T) :: gapl_id_default - - INTEGER :: namelen ! Length of the name character string - INTEGER(SIZE_T) :: size_hint_default - - INTERFACE - INTEGER FUNCTION h5gcreate_c(loc_id, name, namelen, & - size_hint_default, grp_id, lcpl_id_default, gcpl_id_default, gapl_id_default) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5GCREATE_C'::h5gcreate_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: name - INTEGER(HID_T), INTENT(IN) :: loc_id - CHARACTER(LEN=*), INTENT(IN) :: name - INTEGER :: namelen - INTEGER(SIZE_T) :: size_hint_default - INTEGER(HID_T), INTENT(OUT) :: grp_id - INTEGER(HID_T) :: lcpl_id_default - INTEGER(HID_T) :: gcpl_id_default - INTEGER(HID_T) :: gapl_id_default - END FUNCTION h5gcreate_c - END INTERFACE - - size_hint_default = OBJECT_NAMELEN_DEFAULT_F - IF (PRESENT(size_hint)) size_hint_default = size_hint - lcpl_id_default = H5P_DEFAULT_F - IF(PRESENT(lcpl_id)) lcpl_id_default = lcpl_id - gcpl_id_default = H5P_DEFAULT_F - IF(PRESENT(gcpl_id)) gcpl_id_default = gcpl_id - gapl_id_default = H5P_DEFAULT_F - IF(PRESENT(gapl_id)) gapl_id_default = gapl_id - - namelen = LEN(name) - - hdferr = h5gcreate_c(loc_id, name, namelen, size_hint_default, grp_id, & - lcpl_id_default, gcpl_id_default, gapl_id_default) - - END SUBROUTINE h5gcreate_f - -!!$! -!!$!****s* H5G/ -!!$! -!!$! NAME -!!$! h5gcreate2_f -!!$! -!!$! PURPOSE -!!$! Creates a new group. -!!$! -!!$! INPUTS -!!$! loc_id - location identifier -!!$! name - group name at the specified location -!!$! OUTPUTS -!!$! grp_id - group identifier -!!$! hdferr: - error code -!!$! Success: 0 -!!$! Failure: -1 -!!$! OPTIONAL PARAMETERS -!!$! -!!$! lcpl_id - Property list for link creation -!!$! gcpl_id - Property list for group creation -!!$! gapl_id - Property list for group access -!!$! -!!$! AUTHOR M. Scot Breitenfeld -!!$! February 27, 2008 -!!$! -!!$! HISTORY -!!$! -!!$! NOTES Needed to switch the first 2 arguments to avoid conflect -!!$! with h5gcreate1_f -!!$! -!!$ -!!$ SUBROUTINE h5gcreate2_f(name, loc_id, grp_id, hdferr, & -!!$ lcpl_id, gcpl_id, gapl_id) -!!$ IMPLICIT NONE -!!$ CHARACTER(LEN=*), INTENT(IN) :: name ! Name of the group -!!$ INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier -!!$ INTEGER, INTENT(OUT) :: hdferr ! Error code -!!$ INTEGER(HID_T), INTENT(OUT) :: grp_id ! Group identifier -!!$ -!!$ INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lcpl_id ! Property list for link creation -!!$ INTEGER(HID_T), OPTIONAL, INTENT(IN) :: gcpl_id ! Property list for group creation -!!$ INTEGER(HID_T), OPTIONAL, INTENT(IN) :: gapl_id ! Property list for group access -!!$ -!!$ INTEGER(HID_T) :: lcpl_id_default -!!$ INTEGER(HID_T) :: gcpl_id_default -!!$ INTEGER(HID_T) :: gapl_id_default -!!$ -!!$ INTEGER(SIZE_T) :: OBJECT_NAME -! LEN_DEFAULT ! Dummy argument to pass to c call -!!$ INTEGER :: namelen ! Length of the name character string -!!$ -!!$! MS FORTRAN needs explicit interface for C functions called here. -!!$! -!!$ INTERFACE -!!$ INTEGER FUNCTION h5gcreate_c(loc_id, name, namelen, & -!!$ OBJECT_NAME -! LEN_DEFAULT, grp_id, lcpl_id_default, gcpl_id_default, gapl_id_default) -!!$ USE H5GLOBAL -!!$ !DEC$IF DEFINED(HDF5F90_WINDOWS) -!!$ !DEC$ATTRIBUTES C,reference,decorate,alias:'H5GCREATE_C'::h5gcreate_c -!!$ !DEC$ENDIF -!!$ !DEC$ATTRIBUTES reference :: name -!!$ INTEGER(HID_T), INTENT(IN) :: loc_id -!!$ CHARACTER(LEN=*), INTENT(IN) :: name -!!$ INTEGER :: namelen -!!$ INTEGER(SIZE_T) :: OBJECT_NAME -! LEN_DEFAULT -!!$ INTEGER(HID_T) :: lcpl_id_default -!!$ INTEGER(HID_T) :: gcpl_id_default -!!$ INTEGER(HID_T) :: gapl_id_default -!!$ INTEGER(HID_T), INTENT(OUT) :: grp_id -!!$ END FUNCTION h5gcreate_c -!!$ END INTERFACE -!!$ -!!$ namelen = LEN(name) -!!$ OBJECT_NAME -! LEN_DEFAULT = OBJECT_NAME -! LEN_DEFAULT_F -!!$ -!!$ lcpl_id_default = H5P_DEFAULT_F -!!$ IF(PRESENT(lcpl_id)) lcpl_id_default = lcpl_id -!!$ gcpl_id_default = H5P_DEFAULT_F -!!$ IF(PRESENT(gcpl_id)) gcpl_id_default = gcpl_id -!!$ gapl_id_default = H5P_DEFAULT_F -!!$ IF(PRESENT(gapl_id)) gapl_id_default = gapl_id -!!$ -!!$ -!!$ hdferr = h5gcreate_c(loc_id, name, namelen, OBJECT_NAME -! LEN_DEFAULT, grp_id, & -!!$ lcpl_id_default, gcpl_id_default, gapl_id_default) -!!$ -!!$ END SUBROUTINE h5gcreate2_f - -! -!****s* H5G/h5gopen_f -! -! NAME -! h5gopen_f -! -! PURPOSE -! Opens an existing group. -! -! INPUTS -! loc_id - location identifier -! name - name of the group to open -! OUTPUTS -! grp_id - group identifier -! hdferr - Returns 0 if successful and -1 if fails -! OPTIONAL PARAMETERS -! gapl_id - Group access property list identifier -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 5, 2001 -! -! Added 1.8 (optional) parameter gapl_id -! February, 2008 M. Scot Breitenfeld -! -! SOURCE - SUBROUTINE h5gopen_f(loc_id, name, grp_id, hdferr, gapl_id) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier - CHARACTER(LEN=*), INTENT(IN) :: name ! Name of the group - INTEGER(HID_T), INTENT(OUT) :: grp_id ! File identifier - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: gapl_id ! Group access property list identifier -!***** - INTEGER(HID_T) :: gapl_id_default - INTEGER :: namelen ! Length of the name character string - - INTERFACE - INTEGER FUNCTION h5gopen_c(loc_id, name, namelen, gapl_id_default, grp_id) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5GOPEN_C'::h5gopen_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: name - INTEGER(HID_T), INTENT(IN) :: loc_id - CHARACTER(LEN=*), INTENT(IN) :: name - INTEGER :: namelen - INTEGER(HID_T), INTENT(IN) :: gapl_id_default - INTEGER(HID_T), INTENT(OUT) :: grp_id - END FUNCTION h5gopen_c - END INTERFACE - - gapl_id_default = H5P_DEFAULT_F - IF(PRESENT(gapl_id)) gapl_id_default = gapl_id - - namelen = LEN(name) - hdferr = h5gopen_c(loc_id, name, namelen, gapl_id_default, grp_id) - - END SUBROUTINE h5gopen_f -! -!****s* H5G/h5gclose_f -! -! NAME -! h5gclose_f -! -! PURPOSE -! Closes the specified group. -! -! INPUTS -! grp_id - group identifier -! OUTPUTS -! hdferr - Returns 0 if successful and -1 if fails -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 5, 2001 -! -! SOURCE - SUBROUTINE h5gclose_f(grp_id, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: grp_id ! Group identifier - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTERFACE - INTEGER FUNCTION h5gclose_c(grp_id) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5GCLOSE_C'::h5gclose_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: grp_id - END FUNCTION h5gclose_c - END INTERFACE - - hdferr = h5gclose_c(grp_id) - - END SUBROUTINE h5gclose_f -! -!****s* H5G/h5gget_obj_info_idx_f -! -! NAME -! h5gget_obj_info_idx_f -! -! PURPOSE -! Returns name and type of the group member identified by -! its index. -! -! INPUTS -! loc_id - location identifier -! name - name of the group at the specified location -! idx - object index (zero-based) -! OUTPUTS -! obj_name - object name -! obj_type - object type -! hdferr - Returns 0 if successful and -1 if fails -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 5, 2001 -! -! SOURCE - SUBROUTINE h5gget_obj_info_idx_f(loc_id, name, idx, & - obj_name, obj_type, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier - CHARACTER(LEN=*), INTENT(IN) :: name ! Name of the group - INTEGER, INTENT(IN) :: idx ! Index of member object - CHARACTER(LEN=*), INTENT(OUT) :: obj_name ! Name of the object - INTEGER, INTENT(OUT) :: obj_type ! Object type - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTEGER :: namelen ! Length of the name character string - INTEGER :: obj_namelen ! Length of the obj_name character string - - INTERFACE - INTEGER FUNCTION h5gget_obj_info_idx_c(loc_id, name, & - namelen, idx, & - obj_name, obj_namelen, obj_type) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5GGET_OBJ_INFO_IDX_C'::h5gget_obj_info_idx_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: name - !DEC$ATTRIBUTES reference :: obj_name - INTEGER(HID_T), INTENT(IN) :: loc_id - CHARACTER(LEN=*), INTENT(IN) :: name - INTEGER :: namelen - INTEGER, INTENT(IN) :: idx - CHARACTER(LEN=*), INTENT(OUT) :: obj_name - INTEGER :: obj_namelen - INTEGER, INTENT(OUT) :: obj_type - END FUNCTION h5gget_obj_info_idx_c - END INTERFACE - - namelen = LEN(name) - obj_namelen = LEN(obj_name) - hdferr = h5gget_obj_info_idx_c(loc_id, name, namelen, idx, & - obj_name, obj_namelen, obj_type) - END SUBROUTINE h5gget_obj_info_idx_f - -! -!****s* H5G/h5gn_members_f -! -! NAME -! h5gn_members_f -! -! PURPOSE -! Returns the number of group members. -! -! INPUTS -! loc_id - location identifier -! name - name of the group at the specified location -! OUTPUTS -! nmembers - number of group members -! hdferr - Returns 0 if successful and -1 if fails -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 5, 2001 -! -! SOURCE - SUBROUTINE h5gn_members_f(loc_id, name, nmembers, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier - CHARACTER(LEN=*), INTENT(IN) :: name ! Name of the group - INTEGER, INTENT(OUT) :: nmembers ! Number of members in the - ! group - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTEGER :: namelen ! Length of the name character string - - INTERFACE - INTEGER FUNCTION h5gn_members_c(loc_id, name, namelen, nmembers) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5GN_MEMBERS_C'::h5gn_members_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: name - INTEGER(HID_T), INTENT(IN) :: loc_id - CHARACTER(LEN=*), INTENT(IN) :: name - INTEGER :: namelen - INTEGER, INTENT(OUT) :: nmembers - END FUNCTION h5gn_members_c - END INTERFACE - - namelen = LEN(name) - hdferr = h5gn_members_c(loc_id, name, namelen, nmembers) - - END SUBROUTINE h5gn_members_f -! -!****s* H5G/h5glink_f -! -! NAME -! h5glink_f -! -! PURPOSE -! Creates a link of the specified type from new_name -! to current_name. -! -! INPUTS -! loc_id - location identifier -! link_type - link type; possible values are: -! H5G_LINK_HARD_F (0) -! H5G_LINK_SOFT_F (1) -! current_name - name of the existing object if link is a -! hard link. Can be anything for the soft link -! new_name - new name for the object -! OUTPUTS -! hdferr - Returns 0 if successful and -1 if fails -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 5, 2001 -! -! SOURCE - SUBROUTINE h5glink_f(loc_id, link_type, current_name, & - new_name, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier - INTEGER, INTENT(IN) :: link_type ! link type - ! Possible values are: - ! H5G_LINK_HARD_F (0) or - ! H5G_LINK_SOFT_F (1) - - CHARACTER(LEN=*), INTENT(IN) :: current_name - ! Current name of an object - CHARACTER(LEN=*), INTENT(IN) :: new_name ! New name of an object - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - - INTEGER :: current_namelen ! Lenghth of the current_name string - INTEGER :: new_namelen ! Lenghth of the new_name string - - INTERFACE - INTEGER FUNCTION h5glink_c(loc_id, link_type, current_name, & - current_namelen, new_name, new_namelen) - - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5GLINK_C'::h5glink_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: current_name - !DEC$ATTRIBUTES reference :: new_name - INTEGER(HID_T), INTENT(IN) :: loc_id - INTEGER, INTENT(IN) :: link_type - CHARACTER(LEN=*), INTENT(IN) :: current_name - INTEGER :: current_namelen - CHARACTER(LEN=*), INTENT(IN) :: new_name - INTEGER :: new_namelen - END FUNCTION h5glink_c - END INTERFACE - - current_namelen = LEN(current_name) - new_namelen = LEN(new_name) - hdferr = h5glink_c(loc_id, link_type, current_name, & - current_namelen, new_name, new_namelen) - END SUBROUTINE h5glink_f - -! -!****s* H5G/h5glink2_f -! -! NAME -! h5glink2_f -! -! PURPOSE -! Creates a link of the specified type from new_name -! to current_name. current_name and new_name are interpreted -! releative to current and new location identifiers. -! -! INPUTS -! cur_loc_id - location identifier -! cur_name - name of the existing object if link is a -! hard link. Can be anything for the soft link. -! link_type - link type; possible values are: -! H5G_LINK_HARD_F (0) -! H5G_LINK_SOFT_F (1) -! new_loc_id - new location identifier -! new_name - new name for the object -! OUTPUTS -! hdferr - Returns 0 if successful and -1 if fails -! -! AUTHOR -! Elena Pourmal -! September 25, 2002 -! -! SOURCE - SUBROUTINE h5glink2_f(cur_loc_id, cur_name, link_type, new_loc_id, & - new_name, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: cur_loc_id ! File or group identifier - CHARACTER(LEN=*), INTENT(IN) :: cur_name - ! Current name of an object - INTEGER, INTENT(IN) :: link_type ! link type - ! Possible values are: - ! H5G_LINK_HARD_F (0) or - ! H5G_LINK_SOFT_F (1) - - INTEGER(HID_T), INTENT(IN) :: new_loc_id ! File or group identifier - CHARACTER(LEN=*), INTENT(IN) :: new_name ! New name of an object - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - - INTEGER :: cur_namelen ! Lenghth of the current_name string - INTEGER :: new_namelen ! Lenghth of the new_name string - - INTERFACE - INTEGER FUNCTION h5glink2_c(cur_loc_id, cur_name, cur_namelen, & - link_type, new_loc_id, & - new_name, new_namelen) - - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5GLINK2_C'::h5glink2_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: cur_name - !DEC$ATTRIBUTES reference :: new_name - INTEGER(HID_T), INTENT(IN) :: cur_loc_id - INTEGER(HID_T), INTENT(IN) :: new_loc_id - INTEGER, INTENT(IN) :: link_type - CHARACTER(LEN=*), INTENT(IN) :: cur_name - CHARACTER(LEN=*), INTENT(IN) :: new_name - INTEGER :: cur_namelen - INTEGER :: new_namelen - END FUNCTION h5glink2_c - END INTERFACE - - cur_namelen = LEN(cur_name) - new_namelen = LEN(new_name) - hdferr = h5glink2_c(cur_loc_id, cur_name, cur_namelen, link_type, & - new_loc_id, new_name, new_namelen) - END SUBROUTINE h5glink2_f - -! -!****s* H5G/h5gunlink_f -! -! NAME -! h5gunlink_f -! -! PURPOSE -! Removes the specified name from the group graph and -! decrements the link count for the object to which name -! points -! -! INPUTS -! loc_id - location identifier -! name - name of the object to unlink -! OUTPUTS -! hdferr - Returns 0 if successful and -1 if fails -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 5, 2001 -! -! SOURCE - SUBROUTINE h5gunlink_f(loc_id, name, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier - CHARACTER(LEN=*), INTENT(IN) :: name ! Name of an object - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTEGER :: namelen ! Lenghth of the name character string - - INTERFACE - INTEGER FUNCTION h5gunlink_c(loc_id, name, namelen) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5GUNLINK_C'::h5gunlink_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: name - INTEGER(HID_T), INTENT(IN) :: loc_id - CHARACTER(LEN=*), INTENT(IN) :: name - INTEGER :: namelen - END FUNCTION h5gunlink_c - END INTERFACE - - namelen = LEN(name) - hdferr = h5gunlink_c(loc_id, name, namelen) - END SUBROUTINE h5gunlink_f - -! -!****s* H5G/h5gmove_f -! -! NAME -! h5gmove_f -! -! PURPOSE -! Renames an object within an HDF5 file. -! -! INPUTS -! loc_id - location identifier -! name - object's name at specified location -! new_name - object's new name -! OUTPUTS -! hdferr - Returns 0 if successful and -1 if fails -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 5, 2001 -! -! SOURCE - SUBROUTINE h5gmove_f(loc_id, name, new_name, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier - CHARACTER(LEN=*), INTENT(IN) :: name ! Current name of an object - CHARACTER(LEN=*), INTENT(IN) :: new_name ! New name of an object - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTEGER :: namelen ! Lenghth of the current_name string - INTEGER :: new_namelen ! Lenghth of the new_name string - - INTERFACE - INTEGER FUNCTION h5gmove_c(loc_id, name, namelen, new_name, new_namelen) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5GMOVE_C'::h5gmove_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: name - !DEC$ATTRIBUTES reference :: new_name - INTEGER(HID_T), INTENT(IN) :: loc_id - CHARACTER(LEN=*), INTENT(IN) :: name - INTEGER :: namelen - CHARACTER(LEN=*), INTENT(IN) :: new_name - INTEGER :: new_namelen - END FUNCTION h5gmove_c - END INTERFACE - - namelen = LEN(name) - new_namelen = LEN(new_name) - hdferr = h5gmove_c(loc_id, name, namelen, new_name, new_namelen) - END SUBROUTINE h5gmove_f -! -!****s* H5G/h5gmove2_f -! -! NAME -! h5gmove2_f -! -! PURPOSE -! Renames an object within an HDF5 file. -! -! INPUTS -! src_loc_id - original location identifier -! src_name - object's name at specified original location -! dst_loc_id - original location identifier -! dst_name - object's new name -! OUTPUTS -! hdferr - Returns 0 if successful and -1 if fails -! AUTHOR -! Elena Pourmal -! September 25, 2002 -! -! SOURCE - SUBROUTINE h5gmove2_f(src_loc_id, src_name, dst_loc_id, dst_name, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: src_loc_id ! File or group identifier - CHARACTER(LEN=*), INTENT(IN) :: src_name ! Original name of an object - INTEGER(HID_T), INTENT(IN) :: dst_loc_id ! File or group identifier - CHARACTER(LEN=*), INTENT(IN) :: dst_name ! New name of an object - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTEGER :: src_namelen ! Length of the current_name string - INTEGER :: dst_namelen ! Lenghth of the new_name string - - INTERFACE - INTEGER FUNCTION h5gmove2_c(src_loc_id, src_name, src_namelen, & - dst_loc_id, dst_name, dst_namelen) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5GMOVE2_C'::h5gmove2_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: src_name - !DEC$ATTRIBUTES reference :: dst_name - INTEGER(HID_T), INTENT(IN) :: src_loc_id - INTEGER(HID_T), INTENT(IN) :: dst_loc_id - CHARACTER(LEN=*), INTENT(IN) :: src_name - CHARACTER(LEN=*), INTENT(IN) :: dst_name - INTEGER :: src_namelen - INTEGER :: dst_namelen - END FUNCTION h5gmove2_c - END INTERFACE - - src_namelen = LEN(src_name) - dst_namelen = LEN(dst_name) - hdferr = h5gmove2_c(src_loc_id, src_name, src_namelen, dst_loc_id, dst_name, dst_namelen) - END SUBROUTINE h5gmove2_f -! -!****s* H5G/h5gget_linkval_f -! -! NAME -! h5gget_linkval_f -! -! PURPOSE -! Returns the name of the object that the symbolic link -! points to. -! -! INPUTS -! loc_id - location identifier -! name - symbolic link to the object whose name -! is to be returned. -! size - maximum number of characters to be returned -! OUTPUTS -! buffer - a buffer to hold the name of the object -! being sought -! hdferr - Returns 0 if successful and -1 if fails -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 5, 2001 -! -! SOURCE - SUBROUTINE h5gget_linkval_f(loc_id, name, size, buffer, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier - CHARACTER(LEN=*), INTENT(IN) :: name ! Current name of an object - INTEGER(SIZE_T), INTENT(IN) :: size ! Maximum number of buffer - CHARACTER(LEN=size), INTENT(OUT) :: buffer - ! Buffer to hold a name of - ! the object symbolic link - ! points to - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTEGER :: namelen ! Lenghth of the current_name string - - INTERFACE - INTEGER FUNCTION h5gget_linkval_c(loc_id, name, namelen, size, buffer) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5GGET_LINKVAL_C'::h5gget_linkval_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: name - !DEC$ATTRIBUTES reference :: buffer - INTEGER(HID_T), INTENT(IN) :: loc_id - CHARACTER(LEN=*), INTENT(IN) :: name - INTEGER :: namelen - INTEGER(SIZE_T), INTENT(IN) :: size - CHARACTER(LEN=*), INTENT(OUT) :: buffer - END FUNCTION h5gget_linkval_c - END INTERFACE - - namelen = LEN(name) - hdferr = h5gget_linkval_c(loc_id, name, namelen, size, buffer) - END SUBROUTINE h5gget_linkval_f - -! -!****s* H5G/h5gset_comment_f -! -! NAME -! h5gset_comment_f -! -! PURPOSE -! Sets comment for specified object. -! -! INPUTS -! loc_id - location identifier -! name - name of the object -! comment - comment to set for the object -! OUTPUTS -! hdferr - Returns 0 if successful and -1 if fails -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 5, 2001 -! -! SOURCE - SUBROUTINE h5gset_comment_f(loc_id, name, comment, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier - CHARACTER(LEN=*), INTENT(IN) :: name ! Current name of an object - CHARACTER(LEN=*), INTENT(IN) :: comment ! New name of an object - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTEGER :: namelen ! Lenghth of the current_name string - INTEGER :: commentlen ! Lenghth of the comment string - - INTERFACE - INTEGER FUNCTION h5gset_comment_c(loc_id, name, namelen, & - comment, commentlen) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5GSET_COMMENT_C'::h5gset_comment_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: name - !DEC$ATTRIBUTES reference :: comment - INTEGER(HID_T), INTENT(IN) :: loc_id - CHARACTER(LEN=*), INTENT(IN) :: name - INTEGER :: namelen - CHARACTER(LEN=*), INTENT(IN) :: comment - INTEGER :: commentlen - END FUNCTION h5gset_comment_c - END INTERFACE - - namelen = LEN(name) - commentlen = LEN(comment) - hdferr = h5gset_comment_c(loc_id, name, namelen, comment, commentlen) - END SUBROUTINE h5gset_comment_f -! -!****s* H5G/h5gget_comment_f -! -! NAME -! h5gget_comment_f -! -! PURPOSE -! Retrieves comment for specified object. -! -! INPUTS -! loc_id - location identifier -! name - name of the object at specified location -! size - size of the buffer required to hold comment -! OUTPUTS -! buffer - buffer to hold object's comment -! hdferr - Returns 0 if successful and -1 if fails -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 5, 2001 -! -! SOURCE - SUBROUTINE h5gget_comment_f(loc_id, name, size, buffer, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier - CHARACTER(LEN=*), INTENT(IN) :: name ! Current name of an object - INTEGER(SIZE_T), INTENT(IN) :: size ! Maximum number of buffer - CHARACTER(LEN=size), INTENT(OUT) :: buffer - ! Buffer to hold a comment - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTEGER :: namelen ! Length of the current_name string - - INTERFACE - INTEGER FUNCTION h5gget_comment_c(loc_id, name, namelen, size, buffer) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5GGET_COMMENT_C'::h5gget_comment_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: name, buffer - INTEGER(HID_T), INTENT(IN) :: loc_id - CHARACTER(LEN=*), INTENT(IN) :: name - INTEGER :: namelen - INTEGER(SIZE_T), INTENT(IN) :: size - CHARACTER(LEN=*), INTENT(OUT) :: buffer - END FUNCTION h5gget_comment_c - END INTERFACE - - namelen = LEN(name) - hdferr = h5gget_comment_c(loc_id, name, namelen, size, buffer) - - END SUBROUTINE h5gget_comment_f -! -!****s* H5G/H5Gcreate_anon_f -! -! NAME -! H5Gcreate_anon_f -! -! PURPOSE -! Creates a new empty group without linking it into the file structure. -! -! INPUTS -! loc_id - Location identifier -! OUTPUTS -! grp_id - group identifier -! hdferr - Returns 0 if successful and -1 if fails -! OPTIONAL PARAMETERS -! gcpl_id - Group creation property list identifier -! gapl_id - Group access property list identifier -! -! AUTHOR -! M. Scot Breitenfeld -! February 15, 2008 -! -! SOURCE - SUBROUTINE h5Gcreate_anon_f(loc_id, grp_id, hdferr, gcpl_id, gapl_id) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier - INTEGER(HID_T), INTENT(OUT) :: grp_id ! Group identifier - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: gcpl_id ! Property list for group creation - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: gapl_id ! Property list for group access -!***** - INTEGER(HID_T) :: gcpl_id_default - INTEGER(HID_T) :: gapl_id_default - - INTERFACE - INTEGER FUNCTION h5gcreate_anon_c(loc_id, gcpl_id_default, gapl_id_default, grp_id) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5GCREATE_ANON_C'::h5gcreate_anon_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier - INTEGER(HID_T), INTENT(IN) :: gcpl_id_default ! Property list for group creation - INTEGER(HID_T), INTENT(IN) :: gapl_id_default ! Property list for group access - INTEGER(HID_T), INTENT(OUT) :: grp_id ! Group identifier - END FUNCTION h5gcreate_anon_c - END INTERFACE - - gcpl_id_default = H5P_DEFAULT_F - gapl_id_default = H5P_DEFAULT_F - - IF(PRESENT(gcpl_id)) gcpl_id_default = gcpl_id - IF(PRESENT(gapl_id)) gapl_id_default = gapl_id - - hdferr = h5gcreate_anon_c(loc_id, gcpl_id_default, gapl_id_default, grp_id) - - END SUBROUTINE h5Gcreate_anon_f -! -!****s* H5G/H5Gget_create_plist_f -! -! NAME -! H5Gget_create_plist_f -! -! PURPOSE -! Gets a group creation property list identifier. -! -! INPUTS -! grp_id - group identifier -! OUTPUTS -! gcpl_id - Group creation property list identifier -! hdferr - Returns 0 if successful and -1 if fails -! AUTHOR -! M. Scot Breitenfeld -! February 15, 2008 -! -! SOURCE - SUBROUTINE h5gget_create_plist_f(grp_id, gcpl_id, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: grp_id ! Group identifier - INTEGER(HID_T), INTENT(OUT) :: gcpl_id ! Property list for group creation - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTERFACE - INTEGER FUNCTION h5gget_create_plist_c(grp_id, gcpl_id ) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5GGET_CREATE_PLIST_C'::h5gget_create_plist_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: grp_id - INTEGER(HID_T), INTENT(OUT) :: gcpl_id - END FUNCTION h5gget_create_plist_c - END INTERFACE - - hdferr = h5gget_create_plist_c(grp_id, gcpl_id ) - - END SUBROUTINE h5gget_create_plist_f - -! -!****s* H5G/h5gget_info_f -! -! NAME -! h5gget_info_f -! -! PURPOSE -! Retrieves information about a group -! -! INPUTS -! group_id - Group identifier -! -! OUTPUTS -! storage_type - Type of storage for links in group -! H5G_STORAGE_TYPE_COMPACT: Compact storage -! H5G_STORAGE_TYPE_DENSE: Indexed storage -! H5G_STORAGE_TYPE_SYMBOL_TABLE: Symbol tables, the original HDF5 structure -! nlinks - Number of links in group -! max_corder - Current maximum creation order value for group -! hdferr - Returns 0 if successful and -1 if fails -! OPTIONAL PARAMETERS -! mounted - Whether group has a file mounted on it -! -! AUTHOR -! M. Scot Breitenfeld -! February 15, 2008 -! -! NOTES -! In C the output is defined as a structure: H5G_info_t -! -! HISTORY -! -! - Added 'mounted' paramater -! M. Scot Breitenfeld -! July 16, 2008 -! -! SOURCE - SUBROUTINE h5gget_info_f(group_id, storage_type, nlinks, max_corder, hdferr, mounted) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: group_id ! Group identifier - - INTEGER, INTENT(OUT) :: storage_type ! Type of storage for links in group: - ! H5G_STORAGE_TYPE_COMPACT_F: Compact storage - ! H5G_STORAGE_TYPE_DENSE_F: Indexed storage - ! H5G_STORAGE_TYPE_SYMBOL_TABLE_F: Symbol tables, the original HDF5 structure - INTEGER, INTENT(OUT) :: nlinks ! Number of links in group - INTEGER, INTENT(OUT) :: max_corder ! Current maximum creation order value for group - INTEGER, INTENT(OUT) :: hdferr ! Error code: - ! 0 on success and -1 on failure - LOGICAL, INTENT(OUT), OPTIONAL :: mounted ! Whether group has a file mounted on it -!***** - INTEGER :: mounted_c - - INTERFACE - INTEGER FUNCTION h5gget_info_c(group_id, storage_type, nlinks, max_corder, mounted_c) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5GGET_INFO_C'::h5gget_info_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: group_id - INTEGER, INTENT(OUT) :: storage_type - INTEGER, INTENT(OUT) :: nlinks - INTEGER, INTENT(OUT) :: max_corder - INTEGER :: mounted_c - END FUNCTION h5gget_info_c - END INTERFACE - - hdferr = h5gget_info_c(group_id, storage_type, nlinks, max_corder, mounted_c) - - IF(PRESENT(mounted))THEN - IF(mounted_c.EQ.0) THEN - mounted = .FALSE. - ELSE - mounted = .TRUE. - ENDIF - ENDIF - - END SUBROUTINE h5gget_info_f -! -!****s* H5G/h5gget_info_by_idx_f -! -! NAME -! h5gget_info_by_idx_f -! -! PURPOSE -! Retrieves information about a group, according to the group’s position within an index. -! -! INPUTS -! loc_id - File or group identifier -! group_name - Name of group containing group for which information is to be retrieved -! index_type - Index type -! order - Order of the count in the index -! n - Position in the index of the group for which information is retrieved -! -! OUTPUTS -! storage_type - Type of storage for links in group -! H5G_STORAGE_TYPE_COMPACT: Compact storage -! H5G_STORAGE_TYPE_DENSE: Indexed storage -! H5G_STORAGE_TYPE_SYMBOL_TABLE: Symbol tables, the original HDF5 structure -! nlinks - Number of links in group -! max_corder - Current maximum creation order value for group -! hdferr - Returns 0 if successful and -1 if fails -! OPTIONAL PARAMETERS -! lapl_id - Link access property list -! mounted - Whether group has a file mounted on it -! -! NOTES -! In C the output is defined as a structure: H5G_info_t -! -! AUTHOR -! M. Scot Breitenfeld -! February 18, 2008 -! -! HISTORY -! Added 'mounted' paramater -! M. Scot Breitenfeld -! July 16, 2008 -! -! SOURCE - SUBROUTINE h5gget_info_by_idx_f(loc_id, group_name, index_type, order, n, & - storage_type, nlinks, max_corder, hdferr, lapl_id, mounted) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier - CHARACTER(LEN=*), INTENT(IN) :: group_name ! Name of group containing group for which information is to be retrieved - INTEGER, INTENT(IN) :: index_type ! Index type - INTEGER, INTENT(IN) :: order ! Order of the count in the index - INTEGER(HSIZE_T), INTENT(IN) :: n ! Position in the index of the group for which information is retrieved - - INTEGER, INTENT(OUT) :: storage_type ! Type of storage for links in group: - ! H5G_STORAGE_TYPE_COMPACT_F: Compact storage - ! H5G_STORAGE_TYPE_DENSE_F: Indexed storage - ! H5G_STORAGE_TYPE_SYMBOL_TABLE_F: Symbol tables, the original HDF5 structure - INTEGER, INTENT(OUT) :: nlinks ! Number of links in group - INTEGER, INTENT(OUT) :: max_corder ! Current maximum creation order value for group - INTEGER, INTENT(OUT) :: hdferr ! Error code: - ! 0 on success and -1 on failure - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list - LOGICAL, INTENT(OUT), OPTIONAL :: mounted ! Whether group has a file mounted on it -!***** - INTEGER :: mounted_c - INTEGER(HID_T) :: lapl_id_default - INTEGER(SIZE_T) :: group_name_len ! length of group name - - INTERFACE - INTEGER FUNCTION h5gget_info_by_idx_c(loc_id, group_name, group_name_len, index_type, order, n, lapl_id_default, & - storage_type, nlinks, max_corder, mounted_c) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5GGET_INFO_BY_IDX_C'::h5gget_info_by_idx_c - !DEC$ENDIF - - !DEC$ATTRIBUTES reference :: group_name - INTEGER(HID_T), INTENT(IN) :: loc_id - CHARACTER(LEN=*), INTENT(IN) :: group_name - INTEGER, INTENT(IN) :: index_type - INTEGER, INTENT(IN) :: order - INTEGER(HSIZE_T), INTENT(IN) :: n - INTEGER(HID_T) :: lapl_id_default - INTEGER, INTENT(OUT) :: storage_type - INTEGER, INTENT(OUT) :: nlinks - INTEGER, INTENT(OUT) :: max_corder - - INTEGER(SIZE_T) :: group_name_len - INTEGER :: mounted_c - - END FUNCTION h5gget_info_by_idx_c - END INTERFACE - - group_name_len = LEN(group_name) - - lapl_id_default = H5P_DEFAULT_F - IF(PRESENT(lapl_id)) lapl_id_default = lapl_id - - hdferr = h5gget_info_by_idx_c(loc_id, group_name, group_name_len, & - index_type, order, n, lapl_id_default, & - storage_type, nlinks, max_corder, mounted_c) - - IF(PRESENT(mounted))THEN - IF(mounted_c.EQ.0) THEN - mounted = .FALSE. - ELSE - mounted = .TRUE. - ENDIF - ENDIF - - END SUBROUTINE h5gget_info_by_idx_f -! -!****s* H5G/h5gget_info_by_name_f -! -! NAME -! h5gget_info_by_name_f -! -! PURPOSE -! Retrieves information about a group. -! -! INPUTS -! loc_id - File or group identifier -! group_name - Name of group containing group for which information is to be retrieved -! -! OUTPUTS -! -! storage_type - Type of storage for links in group -! H5G_STORAGE_TYPE_COMPACT: Compact storage -! H5G_STORAGE_TYPE_DENSE: Indexed storage -! H5G_STORAGE_TYPE_SYMBOL_TABLE: Symbol tables, the original HDF5 structure -! nlinks - Number of links in group -! max_corder - Current maximum creation order value for group -! hdferr - Returns 0 if successful and -1 if fails -! OPTIONAL PARAMETERS -! lapl_id - Link access property list -! mounted - Whether group has a file mounted on it -! -! NOTES -! In C the output is defined as a structure: H5G_info_t -! -! AUTHOR -! M. Scot Breitenfeld -! February 18, 2008 -! -! HISTORY -! Added 'mounted' paramater -! M. Scot Breitenfeld -! July 16, 2008 -! SOURCE - SUBROUTINE h5gget_info_by_name_f(loc_id, group_name, & - storage_type, nlinks, max_corder, hdferr, lapl_id, mounted) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier - CHARACTER(LEN=*), INTENT(IN) :: group_name ! Name of group containing group for which information is to be retrieved - - INTEGER, INTENT(OUT) :: storage_type ! Type of storage for links in group: - ! H5G_STORAGE_TYPE_COMPACT_F: Compact storage - ! H5G_STORAGE_TYPE_DENSE_F: Indexed storage - ! H5G_STORAGE_TYPE_SYMBOL_TABLE_F: Symbol tables, the original HDF5 structure - INTEGER, INTENT(OUT) :: nlinks ! Number of links in group - INTEGER, INTENT(OUT) :: max_corder ! Current maximum creation order value for group - INTEGER, INTENT(OUT) :: hdferr ! Error code: - ! 0 on success and -1 on failure - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list - LOGICAL, INTENT(OUT), OPTIONAL :: mounted ! Whether group has a file mounted on it -!***** - INTEGER :: mounted_c - INTEGER(HID_T) :: lapl_id_default - INTEGER(SIZE_T) :: group_name_len ! length of group name - - INTERFACE - INTEGER FUNCTION h5gget_info_by_name_c(loc_id, group_name, group_name_len, lapl_id_default, & - storage_type, nlinks, max_corder, mounted_c) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5GGET_INFO_BY_NAME_C'::h5gget_info_by_name_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: group_name - INTEGER(HID_T), INTENT(IN) :: loc_id - CHARACTER(LEN=*), INTENT(IN) :: group_name - INTEGER(HID_T), INTENT(IN) :: lapl_id_default - INTEGER, INTENT(OUT) :: storage_type - INTEGER, INTENT(OUT) :: nlinks - INTEGER, INTENT(OUT) :: max_corder - - INTEGER(SIZE_T) :: group_name_len - INTEGER :: mounted_c - - END FUNCTION h5gget_info_by_name_c - END INTERFACE - - group_name_len = LEN(group_name) - - lapl_id_default = H5P_DEFAULT_F - IF(PRESENT(lapl_id)) lapl_id_default = lapl_id - - hdferr = h5gget_info_by_name_c(loc_id, group_name, group_name_len, lapl_id_default, & - storage_type, nlinks, max_corder, mounted_c) - - IF(PRESENT(mounted))THEN - IF(mounted_c.EQ.0) THEN - mounted = .FALSE. - ELSE - mounted = .TRUE. - ENDIF - ENDIF - - END SUBROUTINE h5gget_info_by_name_f - -END MODULE H5G diff --git a/fortran/src/H5If.c b/fortran/src/H5If.c index 55868dd..fdab0b6 100644 --- a/fortran/src/H5If.c +++ b/fortran/src/H5If.c @@ -1,6 +1,6 @@ /****h* H5If/H5If * PURPOSE - * This file contains C stubs for H5I Fortran APIs + * This file contains C stubs for H5I Fortran APIs * * COPYRIGHT * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * @@ -25,15 +25,15 @@ /****if* H5If/h5iget_type_c * NAME - * h5iget_type_c + * h5iget_type_c * PURPOSE - * Call H5Iget_type to get the type of an object + * Call H5Iget_type to get the type of an object * INPUTS - * obj_id - object identifier + * obj_id - object identifier * OUTPUTS - * type - object type + * type - object type * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Xiangyang Su * Thursday, March 24, 2000 @@ -42,7 +42,7 @@ * SOURCE */ int_f -nh5iget_type_c (hid_t_f *obj_id, int_f *type) +h5iget_type_c (hid_t_f *obj_id, int_f *type) /******/ { int ret_value = -1; @@ -61,29 +61,29 @@ nh5iget_type_c (hid_t_f *obj_id, int_f *type) } /****if* H5If/h5iget_name_c * NAME - * h5iget_name_c + * h5iget_name_c * PURPOSE - * Call H5Iget_name to get object's name + * Call H5Iget_name to get object's name * INPUTS - * obj_id - object identifier - * buf_size - size of the buffer + * obj_id - object identifier + * buf_size - size of the buffer * OUTPUTS - * buf - buffer to hold the name + * buf - buffer to hold the name * RETURNS - * length of the name on success, -1 on failure + * length of the name on success, -1 on failure * AUTHOR * Elena Pourmal - * Wednesday, March 12, 2003 + * Wednesday, March 12, 2003 * HISTORY * - * Changed the size of c_buf_size to c_buf_size + 1, which - * fixes the problem of truncating the string by 1 if the - * exact size of the string (buf_size) is passed in. + * Changed the size of c_buf_size to c_buf_size + 1, which + * fixes the problem of truncating the string by 1 if the + * exact size of the string (buf_size) is passed in. * M. Scot Breitenfeld, April 21, 2008 * SOURCE */ int_f -nh5iget_name_c(hid_t_f *obj_id, _fcd buf, size_t_f *buf_size, size_t_f *name_size) +h5iget_name_c(hid_t_f *obj_id, _fcd buf, size_t_f *buf_size, size_t_f *name_size) /******/ { int ret_value = -1; @@ -120,22 +120,22 @@ DONE: /****if* H5If/h5iinc_ref_c * NAME - * h5iinc_ref_c + * h5iinc_ref_c * PURPOSE - * Call H5Iinc_ref to increment object's reference count + * Call H5Iinc_ref to increment object's reference count * INPUTS - * obj_id - object identifier + * obj_id - object identifier * OUTPUTS - * ref_count - Reference count of ID + * ref_count - Reference count of ID * RETURNS - * current reference count on success, -1 on failure + * current reference count on success, -1 on failure * AUTHOR * Quincey Koziol * Tuesday, December 9, 2003 * SOURCE */ int_f -nh5iinc_ref_c(hid_t_f *obj_id, int_f *ref_count) +h5iinc_ref_c(hid_t_f *obj_id, int_f *ref_count) /******/ { int ret_value; @@ -156,22 +156,22 @@ done: /****if* H5If/h5idec_ref_c * NAME - * h5idec_ref_c + * h5idec_ref_c * PURPOSE - * Call H5Idec_ref to decrement object's reference count + * Call H5Idec_ref to decrement object's reference count * INPUTS - * obj_id - object identifier + * obj_id - object identifier * OUTPUTS - * ref_count - Reference count of ID + * ref_count - Reference count of ID * RETURNS - * current reference count on success, -1 on failure + * current reference count on success, -1 on failure * AUTHOR * Quincey Koziol - * Tuesday, December 9, 2003 + * Tuesday, December 9, 2003 * SOURCE */ int_f -nh5idec_ref_c(hid_t_f *obj_id, int_f *ref_count) +h5idec_ref_c(hid_t_f *obj_id, int_f *ref_count) /******/ { int ret_value; @@ -192,15 +192,15 @@ done: /****if* H5If/h5iget_ref_c * NAME - * h5iget_ref_c + * h5iget_ref_c * PURPOSE - * Call H5Iget_ref to retrieve object's reference count + * Call H5Iget_ref to retrieve object's reference count * INPUTS - * obj_id - object identifier + * obj_id - object identifier * OUTPUTS - * ref_count - Reference count of ID + * ref_count - Reference count of ID * RETURNS - * current reference count on success, -1 on failure + * current reference count on success, -1 on failure * AUTHOR * Quincey Koziol * Tuesday, December 9, 2003 @@ -208,7 +208,7 @@ done: * SOURCE */ int_f -nh5iget_ref_c(hid_t_f *obj_id, int_f *ref_count) +h5iget_ref_c(hid_t_f *obj_id, int_f *ref_count) /******/ { int ret_value; @@ -229,15 +229,15 @@ done: /****if* H5If/h5iget_file_id_c * NAME - * h5iget_file_id_c + * h5iget_file_id_c * PURPOSE - * Call H5Iget_file_id to obtain file identifier from object identifier + * Call H5Iget_file_id to obtain file identifier from object identifier * INPUTS - * obj_id - object identifier + * obj_id - object identifier * OUTPUTS - * file_id - file identifier + * file_id - file identifier * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal * Tuesday, August 24, 2004 @@ -245,7 +245,7 @@ done: * SOURCE */ int_f -nh5iget_file_id_c(hid_t_f *obj_id, hid_t_f *file_id) +h5iget_file_id_c(hid_t_f *obj_id, hid_t_f *file_id) /******/ { int ret_value; @@ -266,17 +266,17 @@ done: } /*---------------------------------------------------------------------------- - * Name: h5iis_valid_c - * Purpose: Calls H5Iis_valid - * Inputs: obj_id - object identifier - * Outputs: 0 = false, 1 = true - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal - * Tuesday, August 24, 2004 - * Modifications: + * Name: h5iis_valid_c + * Purpose: Calls H5Iis_valid + * Inputs: obj_id - object identifier + * Outputs: 0 = false, 1 = true + * Returns: 0 on success, -1 on failure + * Programmer: Elena Pourmal + * Tuesday, August 24, 2004 + * Modifications: *---------------------------------------------------------------------------*/ int_f -nh5iis_valid_c(hid_t_f *obj_id, int_f *c_valid) +h5iis_valid_c(hid_t_f *obj_id, int_f *c_valid) { int ret_value; htri_t c_ret_value; diff --git a/fortran/src/H5Iff.F90 b/fortran/src/H5Iff.F90 new file mode 100644 index 0000000..c91a8aa --- /dev/null +++ b/fortran/src/H5Iff.F90 @@ -0,0 +1,345 @@ +!****h* ROBODoc/H5I +! +! NAME +! MODULE H5I +! +! FILE +! fortran/src/H5Iff.F90 +! +! PURPOSE +! This file contains Fortran interfaces for H5I functions. +! +! 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. * +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! +! NOTES +! _____ __ __ _____ ____ _____ _______ _ _ _______ +! |_ _| \/ | __ \ / __ \| __ \__ __|/\ | \ | |__ __| +! **** | | | \ / | |__) | | | | |__) | | | / \ | \| | | | **** +! **** | | | |\/| | ___/| | | | _ / | | / /\ \ | . ` | | | **** +! **** _| |_| | | | | | |__| | | \ \ | |/ ____ \| |\ | | | **** +! |_____|_| |_|_| \____/|_| \_\ |_/_/ \_\_| \_| |_| +! +! If you add a new H5I function you must add the function name to the +! Windows dll file 'hdf5_fortrandll.def.in' in the fortran/src directory. +! This is needed for Windows based operating systems. +! +!***** + +MODULE H5I + + USE, INTRINSIC :: ISO_C_BINDING, ONLY : C_PTR, C_CHAR + USE H5GLOBAL + +CONTAINS + +!****s* H5I/h5iget_type_f +! +! NAME +! h5iget_type_f +! +! PURPOSE +! Retrieves the type of an object. +! +! INPUTS +! obj_id - object identifier +! OUTPUTS +! type - type of the object, possible values: +! H5I_FILE_F +! H5I_GROUP_F +! H5I_DATATYPE_F +! H5I_DATASPACE_F +! H5I_DATASET_F +! H5I_ATTR_F +! H5I_BADID_F +! hdferr: - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 5, 2001 +! +! SOURCE + SUBROUTINE h5iget_type_f(obj_id, TYPE, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: obj_id ! Object identifier + INTEGER, INTENT(OUT) :: TYPE ! type of an object. + ! possible values are: + ! H5I_FILE_F + ! H5I_GROUP_F + ! H5I_DATATYPE_F + ! H5I_DATASPACE_F + ! H5I_DATASET_F + ! H5I_ATTR_F + ! H5I_BADID_F + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + INTERFACE + INTEGER FUNCTION h5iget_type_c(obj_id, TYPE) BIND(C, NAME='h5iget_type_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: obj_id + INTEGER, INTENT(OUT) :: TYPE + END FUNCTION h5iget_type_c + END INTERFACE + hdferr = h5iget_type_c(obj_id, TYPE) + END SUBROUTINE h5iget_type_f + +!****s* H5I/h5iget_name_f +! +! NAME +! h5iget_name_f +! +! PURPOSE +! Gets a name of an object specified by its idetifier. +! +! INPUTS +! obj_id - attribute identifier +! buf_size - size of a buffer to read name in +! OUTPUTS +! buf - buffer to read name in, name will be truncated if +! buffer is not big enough +! name_size - name size +! hdferr: - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! March 12, 2003 +! SOURCE + SUBROUTINE h5iget_name_f(obj_id, buf, buf_size, name_size, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: obj_id ! Object identifier + INTEGER(SIZE_T), INTENT(IN) :: buf_size ! Buffer size + CHARACTER(LEN=*), INTENT(OUT) :: buf ! Buffer to hold object name + INTEGER(SIZE_T), INTENT(OUT) :: name_size ! Actual name size + INTEGER, INTENT(OUT) :: hdferr ! Error code: + ! 0 if successful, + ! -1 if fail +!***** + INTERFACE + INTEGER FUNCTION h5iget_name_c(obj_id, buf, buf_size, name_size) BIND(C, NAME='h5iget_name_c') + IMPORT :: C_CHAR + IMPORT :: HID_T, SIZE_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: obj_id + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(OUT) :: buf + INTEGER(SIZE_T), INTENT(IN) :: buf_size + INTEGER(SIZE_T), INTENT(OUT) :: name_size + END FUNCTION h5iget_name_c + END INTERFACE + + hdferr = h5iget_name_c(obj_id, buf, buf_size, name_size) + END SUBROUTINE h5iget_name_f + +!****s* H5I/h5iinc_ref_f +! +! NAME +! h5iinc_ref_f +! +! PURPOSE +! Increments the reference count of an ID +! +! INPUTS +! obj_id - object identifier +! OUTPUTS +! ref_count - Current reference count of the ID +! hdferr: - error code +! Success: 0 +! Failure: -1 +! AUTHOR +! Quincey Koziol +! December 9, 2003 +! +! SOURCE + SUBROUTINE h5iinc_ref_f(obj_id, ref_count, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: obj_id ! Object identifier + INTEGER, INTENT(OUT) :: ref_count ! Current reference count of ID + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + INTERFACE + INTEGER FUNCTION h5iinc_ref_c(obj_id, ref_count) BIND(C, NAME='h5iinc_ref_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: obj_id + INTEGER, INTENT(OUT) :: ref_count + END FUNCTION h5iinc_ref_c + END INTERFACE + hdferr = h5iinc_ref_c(obj_id, ref_count) + END SUBROUTINE h5iinc_ref_f + +!****s* H5I/h5idec_ref_f +! +! NAME +! h5idec_ref_f +! +! PURPOSE +! Decrements the reference count of an ID +! +! INPUTS +! obj_id - Object identifier +! OUTPUTS +! ref_count - Current reference count of the ID +! hdferr: - Error code +! Success: 0 +! Failure: -1 +! AUTHOR +! Quincey Koziol +! December 9, 2003 +! +! SOURCE + SUBROUTINE h5idec_ref_f(obj_id, ref_count, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: obj_id ! Object identifier + INTEGER, INTENT(OUT) :: ref_count ! Current reference count of ID + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + INTERFACE + INTEGER FUNCTION h5idec_ref_c(obj_id, ref_count) BIND(C, NAME='h5idec_ref_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: obj_id + INTEGER, INTENT(OUT) :: ref_count + END FUNCTION h5idec_ref_c + END INTERFACE + hdferr = h5idec_ref_c(obj_id, ref_count) + END SUBROUTINE h5idec_ref_f + +!****s* H5I/h5iget_ref_f +! NAME +! h5iget_ref_f +! +! PURPOSE +! Retrieves the reference count of an ID +! +! INPUTS +! obj_id - object identifier +! +! OUTPUTS +! ref_count - Current reference count of the ID +! hdferr: - error code +! Success: 0 +! Failure: -1 +! AUTHOR +! Quincey Koziol +! December 9, 2003 +! +! SOURCE + SUBROUTINE h5iget_ref_f(obj_id, ref_count, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: obj_id ! Object identifier + INTEGER, INTENT(OUT) :: ref_count ! Current reference count of ID + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + INTERFACE + INTEGER FUNCTION h5iget_ref_c(obj_id, ref_count) BIND(C, NAME='h5iget_ref_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: obj_id + INTEGER, INTENT(OUT) :: ref_count + END FUNCTION h5iget_ref_c + END INTERFACE + hdferr = h5iget_ref_c(obj_id, ref_count) + END SUBROUTINE h5iget_ref_f +! +!****s* H5I/h5iget_file_id_f +! NAME +! h5iget_file_id_f +! +! PURPOSE +! Obtains file identifier from the object identifier +! +! INPUTS +! obj_id - object identifier +! OUTPUTS +! file_id - file identifier +! hdferr: - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! August 23, 2004 +! SOURCE + SUBROUTINE h5iget_file_id_f(obj_id, file_id, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: obj_id ! Object identifier + INTEGER(HID_T), INTENT(OUT) :: file_id ! File identifier + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + INTERFACE + INTEGER FUNCTION h5iget_file_id_c(obj_id, file_id) BIND(C, NAME='h5iget_file_id_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: obj_id + INTEGER(HID_T), INTENT(OUT) :: file_id + END FUNCTION h5iget_file_id_c + END INTERFACE + hdferr = h5iget_file_id_c(obj_id, file_id) + END SUBROUTINE h5iget_file_id_f +! +!****s* H5I/h5iis_valid_f +! NAME +! h5iget_file_id_f +! +! PURPOSE +! Check if an ID is valid without producing an error message +! +! INPUTS +! id - identifier +! OUTPUTS +! valid - status of id as a valid identifier +! hdferr: - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! M. Scot Breitenfeld +! April 13, 2009 +! SOURCE + SUBROUTINE h5iis_valid_f(id, valid, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: id ! Identifier + LOGICAL, INTENT(OUT) :: valid ! Status of id as a valid identifier + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + INTEGER :: c_valid ! 0 = .false, 1 = .true. + + INTERFACE + INTEGER FUNCTION h5iis_valid_c(id, c_valid) BIND(C, NAME='h5iis_valid_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: id ! Identifier + INTEGER :: c_valid + END FUNCTION h5iis_valid_c + END INTERFACE + + hdferr = h5iis_valid_c(id, c_valid) + + valid = .FALSE. ! Default + IF(c_valid.EQ.1) valid = .TRUE. + + END SUBROUTINE h5iis_valid_f +END MODULE H5I + diff --git a/fortran/src/H5Iff.f90 b/fortran/src/H5Iff.f90 deleted file mode 100644 index 7c9a843..0000000 --- a/fortran/src/H5Iff.f90 +++ /dev/null @@ -1,352 +0,0 @@ -!****h* ROBODoc/H5I -! -! NAME -! MODULE H5I -! -! FILE -! fortran/src/H5Iff.f90 -! -! PURPOSE -! This file contains Fortran interfaces for H5I functions. -! -! 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. * -! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -! -! NOTES -! *** IMPORTANT *** -! If you add a new H5I function you must add the function name to the -! Windows dll file 'hdf5_fortrandll.def.in' in the fortran/src directory. -! This is needed for Windows based operating systems. -! -!***** - -MODULE H5I - - USE H5GLOBAL - -CONTAINS - -!****s* H5I/h5iget_type_f -! -! NAME -! h5iget_type_f -! -! PURPOSE -! Retrieves the type of an object. -! -! INPUTS -! obj_id - object identifier -! OUTPUTS -! type - type of the object, possible values: -! H5I_FILE_F -! H5I_GROUP_F -! H5I_DATATYPE_F -! H5I_DATASPACE_F -! H5I_DATASET_F -! H5I_ATTR_F -! H5I_BADID_F -! hdferr: - error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 5, 2001 -! -! SOURCE - SUBROUTINE h5iget_type_f(obj_id, TYPE, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: obj_id ! Object identifier - INTEGER, INTENT(OUT) :: TYPE ! type of an object. - ! possible values are: - ! H5I_FILE_F - ! H5I_GROUP_F - ! H5I_DATATYPE_F - ! H5I_DATASPACE_F - ! H5I_DATASET_F - ! H5I_ATTR_F - ! H5I_BADID_F - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTERFACE - INTEGER FUNCTION h5iget_type_c(obj_id, TYPE) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5IGET_TYPE_C':: h5iget_type_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: obj_id - INTEGER, INTENT(OUT) :: TYPE - END FUNCTION h5iget_type_c - END INTERFACE - hdferr = h5iget_type_c(obj_id, TYPE) - END SUBROUTINE h5iget_type_f - -!****s* H5I/h5iget_name_f -! -! NAME -! h5iget_name_f -! -! PURPOSE -! Gets a name of an object specified by its idetifier. -! -! INPUTS -! obj_id - attribute identifier -! buf_size - size of a buffer to read name in -! OUTPUTS -! buf - buffer to read name in, name will be truncated if -! buffer is not big enough -! name_size - name size -! hdferr: - error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! Elena Pourmal -! March 12, 2003 -! SOURCE - SUBROUTINE h5iget_name_f(obj_id, buf, buf_size, name_size, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: obj_id ! Object identifier - INTEGER(SIZE_T), INTENT(IN) :: buf_size ! Buffer size - CHARACTER(LEN=*), INTENT(OUT) :: buf ! Buffer to hold object name - INTEGER(SIZE_T), INTENT(OUT) :: name_size ! Actual name size - INTEGER, INTENT(OUT) :: hdferr ! Error code: - ! 0 if successful, - ! -1 if fail -!***** - INTERFACE - INTEGER FUNCTION h5iget_name_c(obj_id, buf, buf_size, name_size) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5IGET_NAME_C'::h5iget_name_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: buf - INTEGER(HID_T), INTENT(IN) :: obj_id - CHARACTER(LEN=*), INTENT(OUT) :: buf - INTEGER(SIZE_T), INTENT(IN) :: buf_size - INTEGER(SIZE_T), INTENT(OUT) :: name_size - END FUNCTION h5iget_name_c - END INTERFACE - - hdferr = h5iget_name_c(obj_id, buf, buf_size, name_size) - END SUBROUTINE h5iget_name_f - -!****s* H5I/h5iinc_ref_f -! -! NAME -! h5iinc_ref_f -! -! PURPOSE -! Increments the reference count of an ID -! -! INPUTS -! obj_id - object identifier -! OUTPUTS -! ref_count - Current reference count of the ID -! hdferr: - error code -! Success: 0 -! Failure: -1 -! AUTHOR -! Quincey Koziol -! December 9, 2003 -! -! SOURCE - SUBROUTINE h5iinc_ref_f(obj_id, ref_count, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: obj_id ! Object identifier - INTEGER, INTENT(OUT) :: ref_count ! Current reference count of ID - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTERFACE - INTEGER FUNCTION h5iinc_ref_c(obj_id, ref_count) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5IINC_REF_C':: h5iinc_ref_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: obj_id - INTEGER, INTENT(OUT) :: ref_count - END FUNCTION h5iinc_ref_c - END INTERFACE - hdferr = h5iinc_ref_c(obj_id, ref_count) - END SUBROUTINE h5iinc_ref_f - -!****s* H5I/h5idec_ref_f -! -! NAME -! h5idec_ref_f -! -! PURPOSE -! Decrements the reference count of an ID -! -! INPUTS -! obj_id - Object identifier -! OUTPUTS -! ref_count - Current reference count of the ID -! hdferr: - Error code -! Success: 0 -! Failure: -1 -! AUTHOR -! Quincey Koziol -! December 9, 2003 -! -! SOURCE - SUBROUTINE h5idec_ref_f(obj_id, ref_count, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: obj_id ! Object identifier - INTEGER, INTENT(OUT) :: ref_count ! Current reference count of ID - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTERFACE - INTEGER FUNCTION h5idec_ref_c(obj_id, ref_count) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5IDEC_REF_C':: h5idec_ref_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: obj_id - INTEGER, INTENT(OUT) :: ref_count - END FUNCTION h5idec_ref_c - END INTERFACE - hdferr = h5idec_ref_c(obj_id, ref_count) - END SUBROUTINE h5idec_ref_f - -!****s* H5I/h5iget_ref_f -! NAME -! h5iget_ref_f -! -! PURPOSE -! Retrieves the reference count of an ID -! -! INPUTS -! obj_id - object identifier -! -! OUTPUTS -! ref_count - Current reference count of the ID -! hdferr: - error code -! Success: 0 -! Failure: -1 -! AUTHOR -! Quincey Koziol -! December 9, 2003 -! -! SOURCE - SUBROUTINE h5iget_ref_f(obj_id, ref_count, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: obj_id ! Object identifier - INTEGER, INTENT(OUT) :: ref_count ! Current reference count of ID - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTERFACE - INTEGER FUNCTION h5iget_ref_c(obj_id, ref_count) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5IGET_REF_C':: h5iget_ref_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: obj_id - INTEGER, INTENT(OUT) :: ref_count - END FUNCTION h5iget_ref_c - END INTERFACE - hdferr = h5iget_ref_c(obj_id, ref_count) - END SUBROUTINE h5iget_ref_f -! -!****s* H5I/h5iget_file_id_f -! NAME -! h5iget_file_id_f -! -! PURPOSE -! Obtains file identifier from the object identifier -! -! INPUTS -! obj_id - object identifier -! OUTPUTS -! file_id - file identifier -! hdferr: - error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! Elena Pourmal -! August 23, 2004 -! SOURCE - SUBROUTINE h5iget_file_id_f(obj_id, file_id, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: obj_id ! Object identifier - INTEGER(HID_T), INTENT(OUT) :: file_id ! File identifier - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTERFACE - INTEGER FUNCTION h5iget_file_id_c(obj_id, file_id) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5IGET_FILE_ID_C':: h5iget_file_id_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: obj_id - INTEGER(HID_T), INTENT(OUT) :: file_id - END FUNCTION h5iget_file_id_c - END INTERFACE - hdferr = h5iget_file_id_c(obj_id, file_id) - END SUBROUTINE h5iget_file_id_f -! -!****s* H5I/h5iis_valid_f -! NAME -! h5iget_file_id_f -! -! PURPOSE -! Check if an ID is valid without producing an error message -! -! INPUTS -! id - identifier -! OUTPUTS -! valid - status of id as a valid identifier -! hdferr: - error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! M. Scot Breitenfeld -! April 13, 2009 -! SOURCE - SUBROUTINE h5iis_valid_f(id, valid, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: id ! Identifier - LOGICAL, INTENT(OUT) :: valid ! Status of id as a valid identifier - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTEGER :: c_valid ! 0 = .false, 1 = .true. - - INTERFACE - INTEGER FUNCTION h5iis_valid_c(id, c_valid) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5IIS_VALID_C':: h5iis_valid_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: id ! Identifier - INTEGER :: c_valid - END FUNCTION h5iis_valid_c - END INTERFACE - - hdferr = h5iis_valid_c(id, c_valid) - - valid = .FALSE. ! Default - IF(c_valid.EQ.1) valid = .TRUE. - - END SUBROUTINE h5iis_valid_f -END MODULE H5I - diff --git a/fortran/src/H5Lf.c b/fortran/src/H5Lf.c index 6523ab4..0d3aac2 100644 --- a/fortran/src/H5Lf.c +++ b/fortran/src/H5Lf.c @@ -1,6 +1,6 @@ /****h* H5Lf/H5Lf * PURPOSE - * This file contains C stubs for H5L Fortran APIs + * This file contains C stubs for H5L Fortran APIs * * COPYRIGHT * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * @@ -26,34 +26,34 @@ /****if* H5Lf/h5lcopy_c * NAME - * h5lcopy_c + * h5lcopy_c * PURPOSE - * Call H5Lcopy + * Call H5Lcopy * INPUTS * - * src_loc_id - Location identifier of the source link - * src_name - Name of the link to be copied - * src_namelen - length of the name - * dest_loc_id - Location identifier specifying the destination of the copy - * dest_name - Name to be assigned to the NEW copy - * dest_namelen - Length of the name - * loc_id - Identifier of the file or group containing the object - * name - Name of the link to delete - * lcpl_id - Link creation property list identifier - * lapl_id - Link access property list identifier + * src_loc_id - Location identifier of the source link + * src_name - Name of the link to be copied + * src_namelen - length of the name + * dest_loc_id - Location identifier specifying the destination of the copy + * dest_name - Name to be assigned to the NEW copy + * dest_namelen - Length of the name + * loc_id - Identifier of the file or group containing the object + * name - Name of the link to delete + * lcpl_id - Link creation property list identifier + * lapl_id - Link access property list identifier * * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * M. Scot Breitenfeld - * January, 2008 + * January, 2008 * HISTORY * * SOURCE */ int_f -nh5lcopy_c(hid_t_f *src_loc_id, _fcd src_name, size_t_f *src_namelen, hid_t_f *dest_loc_id, +h5lcopy_c(hid_t_f *src_loc_id, _fcd src_name, size_t_f *src_namelen, hid_t_f *dest_loc_id, _fcd dest_name, size_t_f *dest_namelen, hid_t_f *lcpl_id, hid_t_f *lapl_id) /******/ @@ -88,21 +88,21 @@ done: /****if* H5Lf/h5lcreate_external_c * NAME - * h5lcreate_external_c + * h5lcreate_external_c * PURPOSE - * Call H5Lcreate_external_c + * Call H5Lcreate_external_c * INPUTS * - * file_name - Name of the file containing the target object. Neither the file nor the target object is - * required to exist. May be the file the link is being created in. - * obj_name - Path within the target file to the target object. + * file_name - Name of the file containing the target object. Neither the file nor the target object is + * required to exist. May be the file the link is being created in. + * obj_name - Path within the target file to the target object. * link_loc_id - The file or group identifier for the new link. - * link_name - The name of the new link. - * lcpl_id - Link creation property list identifier. - * lapl_id - Link access property list identifier. + * link_name - The name of the new link. + * lcpl_id - Link creation property list identifier. + * lapl_id - Link access property list identifier. * * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * M. Scot Breitenfeld * February 29, 2008 @@ -110,7 +110,7 @@ done: */ int_f -nh5lcreate_external_c(_fcd file_name, size_t_f *file_namelen, _fcd obj_name, size_t_f *obj_namelen, +h5lcreate_external_c(_fcd file_name, size_t_f *file_namelen, _fcd obj_name, size_t_f *obj_namelen, hid_t_f *link_loc_id, _fcd link_name, size_t_f *link_namelen, hid_t_f *lcpl_id, hid_t_f *lapl_id) /******/ @@ -150,27 +150,27 @@ done: /****if* H5Lf/h5ldelete_c * NAME - * h5ldelete_c + * h5ldelete_c * PURPOSE - * Call H5Ldelete + * Call H5Ldelete * INPUTS * * - * loc_id - Identifier of the file or group containing the object - * name - Name of the link to delete - * lapl_id - Link access property list identifier - * namelen - length of name + * loc_id - Identifier of the file or group containing the object + * name - Name of the link to delete + * lapl_id - Link access property list identifier + * namelen - length of name * * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * M. Scot Breitenfeld - * January, 2008 + * January, 2008 * SOURCE */ int_f -nh5ldelete_c ( hid_t_f *loc_id, _fcd name, size_t_f *namelen, hid_t_f *lapl_id ) +h5ldelete_c ( hid_t_f *loc_id, _fcd name, size_t_f *namelen, hid_t_f *lapl_id ) /******/ { char *c_name = NULL; @@ -197,28 +197,28 @@ done: /****if* H5Lf/h5lcreate_soft_c * NAME - * h5lcreate_soft_c + * h5lcreate_soft_c * PURPOSE - * Call H5Lcreate_soft + * Call H5Lcreate_soft * INPUTS * * - * target_path - Path to the target object, which is not required to exist. - * link_loc_id - The file or group identifier for the new link. - * link_name - The name of the new link. - * lcpl_id - Link creation property list identifier. - * lapl_id - Link access property list identifier. + * target_path - Path to the target object, which is not required to exist. + * link_loc_id - The file or group identifier for the new link. + * link_name - The name of the new link. + * lcpl_id - Link creation property list identifier. + * lapl_id - Link access property list identifier. * * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * M. Scot Breitenfeld - * February 20, 2008 + * February 20, 2008 * SOURCE */ int_f -nh5lcreate_soft_c(_fcd target_path, size_t_f *target_path_len, +h5lcreate_soft_c(_fcd target_path, size_t_f *target_path_len, hid_t_f *link_loc_id, _fcd link_name, size_t_f *link_name_len, hid_t_f *lcpl_id, hid_t_f *lapl_id ) @@ -253,29 +253,29 @@ nh5lcreate_soft_c(_fcd target_path, size_t_f *target_path_len, /****if* H5Lf/h5lcreate_hard_c * NAME - * h5lcreate_hard_c + * h5lcreate_hard_c * PURPOSE - * Call H5Lcreate_hard + * Call H5Lcreate_hard * INPUTS * - * obj_loc_id - The file or group identifier for the target object. - * obj_name - Name of the target object, which must already exist. - * obj_namelen - Name length - * link_loc_id - The file or group identifier for the new link. - * link_name - The name of the new link. - * link_namelen- Name length - * lcpl_id - Link creation property list identifier. - * lapl_id - Link access property list identifier. + * obj_loc_id - The file or group identifier for the target object. + * obj_name - Name of the target object, which must already exist. + * obj_namelen - Name length + * link_loc_id - The file or group identifier for the new link. + * link_name - The name of the new link. + * link_namelen- Name length + * lcpl_id - Link creation property list identifier. + * lapl_id - Link access property list identifier. * * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * M. Scot Breitenfeld * February 27, 2008 * SOURCE */ int_f -nh5lcreate_hard_c(hid_t_f *obj_loc_id, _fcd obj_name, size_t_f *obj_namelen, +h5lcreate_hard_c(hid_t_f *obj_loc_id, _fcd obj_name, size_t_f *obj_namelen, hid_t_f *link_loc_id, _fcd link_name, size_t_f *link_namelen, hid_t_f *lcpl_id, hid_t_f *lapl_id ) @@ -310,41 +310,41 @@ nh5lcreate_hard_c(hid_t_f *obj_loc_id, _fcd obj_name, size_t_f *obj_namelen, /****if* H5Lf/h5ldelete_by_idx_c * NAME - * h5ldelete_by_idx_c + * h5ldelete_by_idx_c * PURPOSE - * Calls h5ldelete_by_idx + * Calls h5ldelete_by_idx * INPUTS * - * loc_id - File or group identifier specifying location of subject group - * group_name - Name of subject group - * group_namelen - Name length - * index_field - Type of index; Possible values are: + * loc_id - File or group identifier specifying location of subject group + * group_name - Name of subject group + * group_namelen - Name length + * index_field - Type of index; Possible values are: * H5_INDEX_UNKNOWN_F = -1 - Unknown index type * H5_INDEX_NAME_F - Index on names * H5_INDEX_CRT_ORDER_F - Index on creation order * H5_INDEX_N_F - Number of indices defined - * order - Order within field or index; Possible values are: + * order - Order within field or index; Possible values are: * H5_ITER_UNKNOWN_F - Unknown order * H5_ITER_INC_F - Increasing order * H5_ITER_DEC_F - Decreasing order * H5_ITER_NATIVE_F - No particular order, whatever is fastest * H5_ITER_N_F - Number of iteration orders - * n - Link for which to retrieve information - * lapl_id - Link access property list + * n - Link for which to retrieve information + * lapl_id - Link access property list * * OUTPUTS * N/A * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * M. Scot Breitenfeld - * February 29, 2008 + * February 29, 2008 * HISTORY * N/A * SOURCE */ int_f -nh5ldelete_by_idx_c (hid_t_f *loc_id, _fcd group_name, size_t_f *group_namelen, +h5ldelete_by_idx_c (hid_t_f *loc_id, _fcd group_name, size_t_f *group_namelen, int_f *index_field, int_f *order, hsize_t_f *n, hid_t_f *lapl_id) /******/ { @@ -376,28 +376,28 @@ done: /****if* H5Lf/h5lexists_c * NAME - * h5lexists_c + * h5lexists_c * PURPOSE - * Calls H5Lexists + * Calls H5Lexists * INPUTS * - * loc_id - Identifier of the file or group to query. - * name - Link name to check - * lapl_id - Link access property list identifier. + * loc_id - Identifier of the file or group to query. + * name - Link name to check + * lapl_id - Link access property list identifier. * OUTPUTS * - * link_exists_c - returns a positive value, for TRUE, or 0 (zero), for FALSE. + * link_exists_c - returns a positive value, for TRUE, or 0 (zero), for FALSE. * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * M. Scot Breitenfeld - * February 29, 2008 + * February 29, 2008 * HISTORY * * SOURCE */ int_f -nh5lexists_c (hid_t_f *loc_id, _fcd name, size_t_f *namelen, hid_t_f *lapl_id, int_f *link_exists) +h5lexists_c (hid_t_f *loc_id, _fcd name, size_t_f *namelen, hid_t_f *lapl_id, int_f *link_exists) /******/ { char *c_name = NULL; /* Buffer to hold C string */ @@ -423,40 +423,40 @@ done: /****if* H5Lf/h5lget_info_c * NAME - * h5lget_info_c + * h5lget_info_c * PURPOSE - * Call H5Lget_info + * Call H5Lget_info * INPUTS * * link_loc_id - File or group identifier. - * link_name - Name of the link for which information is being sought - * link_namelen - Name length - * lapl_id - Link access property list + * link_name - Name of the link for which information is being sought + * link_namelen - Name length + * lapl_id - Link access property list * OUTPUTS * * - * cset - indicates the character set used for link’s name. - * corder - specifies the link’s creation order position. - * corder_valid - indicates whether the value in corder is valid. - * link_type - specifies the link class: + * cset - indicates the character set used for link’s name. + * corder - specifies the link’s creation order position. + * corder_valid - indicates whether the value in corder is valid. + * link_type - specifies the link class: * H5L_LINK_HARD_F - Hard link * H5L_LINK_SOFT_F - Soft link * H5L_LINK_EXTERNAL_F - External link * H5L_LINK_ERROR_F - Error - * address - If the link is a hard link, address specifies the file address that the link points to - * val_size - If the link is a symbolic link, val_size will be the length of the link value + * address - If the link is a hard link, address specifies the file address that the link points to + * val_size - If the link is a symbolic link, val_size will be the length of the link value * * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * M. Scot Breitenfeld - * January, 2008 + * January, 2008 * HISTORY * N/A * SOURCE */ int_f -nh5lget_info_c(hid_t_f *link_loc_id, _fcd link_name, size_t_f *link_namelen, +h5lget_info_c(hid_t_f *link_loc_id, _fcd link_name, size_t_f *link_namelen, int_f *cset, int_f *corder, int_f *corder_valid, int_f *link_type, haddr_t_f *address, size_t_f *val_size, hid_t_f *lapl_id) @@ -496,36 +496,36 @@ done: /****if* H5Lf/h5lget_info_by_idx_c * NAME - * h5lget_info_by_idx_c + * h5lget_info_by_idx_c * PURPOSE - * Call H5Lget_info_by_idx + * Call H5Lget_info_by_idx * INPUTS * * loc_id - File or group identifier specifying location of subject group - * group_name - Name of subject group - *group_namelen - Name length + * group_name - Name of subject group + * group_namelen - Name length * index_field - Index or field which determines the order - * order - Order within field or index - * n - Link for which to retrieve information - * lapl_id - Link access property list + * order - Order within field or index + * n - Link for which to retrieve information + * lapl_id - Link access property list * OUTPUTS * - * corder_valid - Indicates whether the the creation order data is valid for this attribute - * corder - Is a positive integer containing the creation order of the attribute - * cset - Indicates the character set used for the attribute’s name - * data_size - indicates the size, in the number of characters, of the attribute + * corder_valid - Indicates whether the the creation order data is valid for this attribute + * corder - Is a positive integer containing the creation order of the attribute + * cset - Indicates the character set used for the attribute’s name + * data_size - indicates the size, in the number of characters, of the attribute * * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * M. Scot Breitenfeld - * January, 2008 + * January, 2008 * HISTORY * N/A * SOURCE */ int_f -nh5lget_info_by_idx_c(hid_t_f *loc_id, _fcd group_name, size_t_f *group_namelen, +h5lget_info_by_idx_c(hid_t_f *loc_id, _fcd group_name, size_t_f *group_namelen, int_f *index_field, int_f *order, hsize_t_f *n, int_f *link_type, int_f *corder_valid, int_f *corder, int_f *cset, haddr_t_f *address, size_t_f *val_size, hid_t_f *lapl_id) /******/ @@ -570,7 +570,7 @@ done: * NAME * H5Lis_registered_c * PURPOSE - * Call H5Lis_registered + * Call H5Lis_registered * INPUTS * * link_cls_id - User-defined link class identifier @@ -578,17 +578,17 @@ done: * NONE * * RETURNS - * Returns a positive value if the link class has been registered - * and zero if it is unregistered. Otherwise returns a negative value + * Returns a positive value if the link class has been registered + * and zero if it is unregistered. Otherwise returns a negative value * AUTHOR * M. Scot Breitenfeld - * March 3, 2008 + * March 3, 2008 * HISTORY * N/A * SOURCE */ int_f -nh5lis_registered_c(int_f *link_cls_id) +h5lis_registered_c(int_f *link_cls_id) /******/ { int_f ret_value; /* Return value */ @@ -621,29 +621,29 @@ nh5lis_registered_c(int_f *link_cls_id) /****if* H5Lf/h5lmove_c * NAME - * h5lmove_c + * h5lmove_c * PURPOSE - * Call H5Lmove + * Call H5Lmove * INPUTS * - * src_loc_id - Original file or group identifier. - * src_name - Original link name. - * src_namelen - name length - * dest_loc_id - Destination file or group identifier. - * dest_name - NEW link name. - * dest_namelen - name length + * src_loc_id - Original file or group identifier. + * src_name - Original link name. + * src_namelen - name length + * dest_loc_id - Destination file or group identifier. + * dest_name - NEW link name. + * dest_namelen - name length * OUTPUTS * * * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * M. Scot Breitenfeld - * March 3, 2008 + * March 3, 2008 * SOURCE */ int_f -nh5lmove_c(hid_t_f *src_loc_id, _fcd src_name, size_t_f *src_namelen, hid_t_f *dest_loc_id, +h5lmove_c(hid_t_f *src_loc_id, _fcd src_name, size_t_f *src_namelen, hid_t_f *dest_loc_id, _fcd dest_name, size_t_f *dest_namelen, hid_t_f *lcpl_id, hid_t_f *lapl_id) /******/ { @@ -682,17 +682,17 @@ done: * Call H5Lget_name_by_idx * INPUTS * - * loc_id - File or group identifier specifying location of subject group - * group_name - Name of subject group - * index_field - Index or field which determines the order - * order - Order within field or index - * n - Link for which to retrieve information - * size - Maximum number of characters of link value to be returned. - * lapl_id - Link access property list + * loc_id - File or group identifier specifying location of subject group + * group_name - Name of subject group + * index_field - Index or field which determines the order + * order - Order within field or index + * n - Link for which to retrieve information + * size - Maximum number of characters of link value to be returned. + * lapl_id - Link access property list * OUTPUTS * - * name - Buffer in which link value is returned - * size - The size of the link name on success + * name - Buffer in which link value is returned + * size - The size of the link name on success * RETURNS * 0 on success, -1 on failure * AUTHOR @@ -701,7 +701,7 @@ done: * SOURCE */ int_f -nh5lget_name_by_idx_c(hid_t_f *loc_id, _fcd group_name, size_t_f *group_namelen, +h5lget_name_by_idx_c(hid_t_f *loc_id, _fcd group_name, size_t_f *group_namelen, int_f *index_field, int_f *order, hsize_t_f *n, size_t_f *size, _fcd name, hid_t_f *lapl_id) /******/ @@ -774,7 +774,7 @@ done: /* * SOURCE */ /* *\/ */ /* int_f */ -/* nh5lget_val_c (hid_t_f *link_loc_id, _fcd link_name, size_t_f *link_namelen, */ +/* h5lget_val_c (hid_t_f *link_loc_id, _fcd link_name, size_t_f *link_namelen, */ /* size_t_f *size, _fcd linkval_buff, */ /* hid_t_f *lapl_id) */ /* { */ @@ -842,7 +842,7 @@ done: /* int_f */ -/* nh5lregistered_c(int_f *version, int_f *class_id, */ +/* h5lregistered_c(int_f *version, int_f *class_id, */ /* _fcd comment, size_t_f *comment_len, */ /* _fcd create_func, size_t_f *create_func_len, */ /* _fcd move_func, size_t_f *move_func_len, */ @@ -916,29 +916,29 @@ done: /****if* H5Lf/h5lget_val_c * NAME - * h5lget_val_c + * h5lget_val_c * PURPOSE - * Call H5Lget_val + * Call H5Lget_val * INPUTS * - * link_loc_id - File or group identifier. - * link_name - Link whose value is to be returned. - * link_name_len - length of link_name - * size - Maximum number of characters of link value to be returned. - * lapl_id - List access property list identifier + * link_loc_id - File or group identifier. + * link_name - Link whose value is to be returned. + * link_name_len - length of link_name + * size - Maximum number of characters of link value to be returned. + * lapl_id - List access property list identifier * OUTPUTS * - * linkval_buff - The buffer to hold the returned link value. + * linkval_buff - The buffer to hold the returned link value. * * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * M. Scot Breitenfeld - * April 11, 2008 + * April 11, 2008 * SOURCE */ int_f -nh5lget_val_c(hid_t_f *link_loc_id, _fcd link_name, size_t_f *link_namelen, size_t_f *size, +h5lget_val_c(hid_t_f *link_loc_id, _fcd link_name, size_t_f *link_namelen, size_t_f *size, void *linkval_buff, hid_t_f *lapl_id) /******/ { @@ -971,16 +971,16 @@ done: * Calls H5Literate * INPUTS * - * group_id - Identifier specifying subject group - * index_type - Type of index which determines the order - * order - Order within index - * idx - Iteration position at which to start - * op - Callback function passing data regarding the link to the calling application - * op_data - User-defined pointer to data required by the application for its processing of the link + * group_id - Identifier specifying subject group + * index_type - Type of index which determines the order + * order - Order within index + * idx - Iteration position at which to start + * op - Callback function passing data regarding the link to the calling application + * op_data - User-defined pointer to data required by the application for its processing of the link * * OUTPUTS * - * idx - Position at which an interrupted iteration may be restarted + * idx - Position at which an interrupted iteration may be restarted * * RETURNS * >0 on success, 0< on failure @@ -1018,19 +1018,19 @@ h5literate_c(hid_t_f *group_id, int_f *index_type, int_f *order, hsize_t_f *idx, * Call H5Literate_by_name * INPUTS * - * loc_id - Identifier specifying subject group - * name - Name of subject group - * namelen - Name length - * index_type - Type of index which determines the order - * order - Order within index - * idx - Iteration position at which to start - * op - Callback function passing data regarding the link to the calling application - * op_data - User-defined pointer to data required by the application for its processing of the link - * lapl_id - List access property list identifier + * loc_id - Identifier specifying subject group + * name - Name of subject group + * namelen - Name length + * index_type - Type of index which determines the order + * order - Order within index + * idx - Iteration position at which to start + * op - Callback function passing data regarding the link to the calling application + * op_data - User-defined pointer to data required by the application for its processing of the link + * lapl_id - List access property list identifier * * OUTPUTS * - * idx - Position at which an interrupted iteration may be restarted + * idx - Position at which an interrupted iteration may be restarted * * RETURNS * >0 on success, 0< on failure diff --git a/fortran/src/H5Lff.F90 b/fortran/src/H5Lff.F90 new file mode 100644 index 0000000..bc91072 --- /dev/null +++ b/fortran/src/H5Lff.F90 @@ -0,0 +1,1478 @@ +!****h* ROBODoc/H5L +! +! NAME +! MODULE H5L +! +! PURPOSE +! This file contains Fortran interfaces for H5L functions. +! +! 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. * +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! +! NOTES +! _____ __ __ _____ ____ _____ _______ _ _ _______ +! |_ _| \/ | __ \ / __ \| __ \__ __|/\ | \ | |__ __| +! **** | | | \ / | |__) | | | | |__) | | | / \ | \| | | | **** +! **** | | | |\/| | ___/| | | | _ / | | / /\ \ | . ` | | | **** +! **** _| |_| | | | | | |__| | | \ \ | |/ ____ \| |\ | | | **** +! |_____|_| |_|_| \____/|_| \_\ |_/_/ \_\_| \_| |_| +! +! If you add a new H5L function you must add the function name to the +! Windows dll file 'hdf5_fortrandll.def.in' in the fortran/src directory. +! This is needed for Windows based operating systems. +! +!***** + +MODULE H5L + + USE, INTRINSIC :: ISO_C_BINDING, ONLY : C_PTR, C_FUNPTR, C_CHAR, C_INT64_T, C_INT + USE H5GLOBAL + + IMPLICIT NONE + +!****t* H5L (F03)/h5l_info_t +! +! Fortran2003 Derived Type: +! + TYPE, bind(c) :: union_t + INTEGER(haddr_t) :: address + INTEGER(size_t) :: val_size + END TYPE union_t + + TYPE, bind(c) :: h5l_info_t + INTEGER(c_int) :: type ! H5L_type_t type +! LOGICAL(c_bool) :: corder_valid ! hbool_t corder_valid + INTEGER(c_int64_t) :: corder ! int64_t corder; + INTEGER(c_int) :: cset ! H5T_cset_t cset; + TYPE(union_t) :: u + END TYPE h5l_info_t + +!***** + +!type specifies the link class. Valid values include the following: +! H5L_TYPE_HARD Hard link +! H5L_TYPE_SOFT Soft link +! H5L_TYPE_EXTERNAL External link +! H5L_TYPE_ERROR Error +!cset specifies the character set in which the link name is encoded. Valid values include the following: +! H5T_CSET_ASCII US ASCII +! H5T_CSET_UTF8 UTF-8 Unicode encoding + +CONTAINS + +! +!****s* H5L/h5lcopy_f +! +! NAME +! h5lcopy_f +! +! PURPOSE +! Copies a link from one location to another. +! +! INPUTS +! src_loc_id - Location identifier of the source link +! src_name - Name of the link to be copied +! dest_loc_id - Location identifier specifying the destination of the copy +! dest_name - Name to be assigned to the NEW copy +! loc_id - Identifier of the file or group containing the object +! name - Name of the link to delete +! +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails +! OPTIONAL PARAMETERS +! lcpl_id - Link creation property list identifier +! lapl_id - Link access property list identifier +! +! AUTHOR +! M. Scot Breitenfeld +! February 27, 2008 +! +! SOURCE + SUBROUTINE h5lcopy_f(src_loc_id, src_name, dest_loc_id, dest_name, hdferr, & + lcpl_id, lapl_id) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: src_loc_id ! Location identifier of the source link + CHARACTER(LEN=*), INTENT(IN) :: src_name ! Name of the link to be copied + INTEGER(HID_T), INTENT(IN) :: dest_loc_id ! Location identifier specifying the destination of the copy + CHARACTER(LEN=*), INTENT(IN) :: dest_name ! Name to be assigned to the NEW copy + + INTEGER, INTENT(OUT) :: hdferr ! Error code: + ! 0 on success and -1 on failure + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lcpl_id ! Link creation property list identifier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list identifier +!***** + INTEGER(HID_T) :: lcpl_id_default + INTEGER(HID_T) :: lapl_id_default + + INTEGER(SIZE_T) :: src_namelen + INTEGER(SIZE_T) :: dest_namelen + + INTERFACE + INTEGER FUNCTION h5lcopy_c(src_loc_id, src_name, src_namelen, dest_loc_id, dest_name, dest_namelen, & + lcpl_id_default, lapl_id_default) BIND(C,name='h5lcopy_c') + IMPORT :: c_char + IMPORT :: HID_T, SIZE_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: src_loc_id + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: src_name + INTEGER(HID_T), INTENT(IN) :: dest_loc_id + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: dest_name + + INTEGER(HID_T) :: lcpl_id_default + INTEGER(HID_T) :: lapl_id_default + + INTEGER(SIZE_T) :: src_namelen + INTEGER(SIZE_T) :: dest_namelen + END FUNCTION h5lcopy_c + END INTERFACE + + src_namelen = LEN(src_name) + dest_namelen = LEN(dest_name) + + lcpl_id_default = H5P_DEFAULT_F + IF(PRESENT(lcpl_id)) lcpl_id_default = lcpl_id + lapl_id_default = H5P_DEFAULT_F + IF(PRESENT(lapl_id)) lapl_id_default = lapl_id + + hdferr = h5lcopy_c(src_loc_id, src_name, src_namelen, dest_loc_id, dest_name, dest_namelen, & + lcpl_id_default, lapl_id_default) + + END SUBROUTINE h5lcopy_f + +! +!****s* H5L/h5ldelete_f +! +! NAME +! h5ldelete_f +! +! PURPOSE +! Removes a link from a group. +! +! INPUTS +! loc_id - Identifier of the file or group containing the object +! name - Name of the link to delete +! +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails +! OPTIONAL PARAMETERS +! lapl_id - Link access property list identifier +! +! AUTHOR +! M. Scot Breitenfeld +! January, 2008 +! +! SOURCE + SUBROUTINE h5ldelete_f(loc_id, name, hdferr, lapl_id) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id ! Identifier of the file or group containing the object + CHARACTER(LEN=*), INTENT(IN) :: name ! Name of the link to delete + INTEGER, INTENT(OUT) :: hdferr ! Error code: + ! 0 on success and -1 on failure + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list identifier +!***** + INTEGER(HID_T) :: lapl_id_default + INTEGER(SIZE_T) :: namelen + + INTERFACE + INTEGER FUNCTION h5ldelete_c(loc_id, name, namelen, lapl_id_default) BIND(C,name='h5ldelete_c') + IMPORT :: c_char + IMPORT :: HID_T, SIZE_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: name + INTEGER(HID_T) :: lapl_id_default + INTEGER(SIZE_T) :: namelen + END FUNCTION h5ldelete_c + END INTERFACE + + namelen = LEN(name) + + lapl_id_default = H5P_DEFAULT_F + IF(PRESENT(lapl_id)) lapl_id_default = lapl_id + + hdferr = h5ldelete_c(loc_id, name, namelen, lapl_id_default) + + END SUBROUTINE h5ldelete_f + +! +!****s* H5L/H5Lcreate_soft_f +! +! NAME +! H5Lcreate_soft_f +! +! PURPOSE +! Creates a soft link to an object. +! +! INPUTS +! target_path - Path to the target object, which is not required to exist. +! link_loc_id - The file or group identifier for the new link. +! link_name - The name of the new link. +! +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails +! OPTIONAL PARAMETERS +! lcpl_id - Link creation property list identifier. +! lapl_id - Link access property list identifier. +! +! AUTHOR +! M. Scot Breitenfeld +! February 20, 2008 +! +! SOURCE + SUBROUTINE h5lcreate_soft_f(target_path, link_loc_id, link_name, hdferr, lcpl_id, lapl_id) + IMPLICIT NONE + CHARACTER(LEN=*), INTENT(IN) :: target_path ! Path to the target object, which is not required to exist. + INTEGER(HID_T), INTENT(IN) :: link_loc_id ! The file or group identifier for the new link. + CHARACTER(LEN=*), INTENT(IN) :: link_name ! The name of the new link. + INTEGER, INTENT(OUT) :: hdferr ! Error code: + ! 0 on success and -1 on failure + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lcpl_id ! Link creation property list identifier. + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list identifier. +!***** + INTEGER(HID_T) :: lcpl_id_default + INTEGER(HID_T) :: lapl_id_default + INTEGER(SIZE_T) :: target_path_len + INTEGER(SIZE_T) :: link_name_len + + INTERFACE + INTEGER FUNCTION h5lcreate_soft_c(target_path, target_path_len, & + link_loc_id, & + link_name,link_name_len, & + lcpl_id_default, lapl_id_default ) BIND(C,NAME='h5lcreate_soft_c') + IMPORT :: c_char + IMPORT :: HID_T, SIZE_T + IMPLICIT NONE + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: target_path + INTEGER(SIZE_T) :: target_path_len + INTEGER(HID_T), INTENT(IN) :: link_loc_id + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: link_name + INTEGER(SIZE_T) :: link_name_len + INTEGER(HID_T) :: lcpl_id_default + INTEGER(HID_T) :: lapl_id_default + END FUNCTION h5lcreate_soft_c + END INTERFACE + + target_path_len = LEN(target_path) + link_name_len = LEN(link_name) + + lcpl_id_default = H5P_DEFAULT_F + IF(PRESENT(lcpl_id)) lcpl_id_default = lcpl_id + lapl_id_default = H5P_DEFAULT_F + IF(PRESENT(lapl_id)) lapl_id_default = lapl_id + + hdferr = h5lcreate_soft_c(target_path, target_path_len,& + link_loc_id, & + link_name, link_name_len, & + lcpl_id_default, lapl_id_default ) + + END SUBROUTINE h5lcreate_soft_f + +! +!****s* H5L/H5Lcreate_hard_f +! +! NAME +! H5Lcreate_hard_f +! +! PURPOSE +! Creates a hard link to an object. +! +! INPUTS +! +! obj_loc_id - The file or group identifier for the target object. +! obj_name - Name of the target object, which must already exist. +! link_loc_id - The file or group identifier for the new link. +! link_name - The name of the new link. +! +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails +! OPTIONAL PARAMETERS +! lcpl_id - Link creation property list identifier. +! lapl_id - Link access property list identifier. +! +! AUTHOR +! M. Scot Breitenfeld +! February 27, 2008 +! +! SOURCE + SUBROUTINE h5lcreate_hard_f(obj_loc_id, obj_name, link_loc_id, link_name, hdferr, lcpl_id, lapl_id) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: obj_loc_id ! The file or group identifier for the target object. + CHARACTER(LEN=*), INTENT(IN) :: obj_name ! Name of the target object, which must already exist. + INTEGER(HID_T), INTENT(IN) :: link_loc_id ! The file or group identifier for the new link. + CHARACTER(LEN=*), INTENT(IN) :: link_name ! The name of the new link. + + INTEGER, INTENT(OUT) :: hdferr ! Error code: + ! 0 on success and -1 on failure + + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lcpl_id ! Link creation property list identifier. + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list identifier. +!***** + INTEGER(HID_T) :: lcpl_id_default + INTEGER(HID_T) :: lapl_id_default + + INTEGER(SIZE_T) :: obj_namelen + INTEGER(SIZE_T) :: link_namelen + + INTERFACE + INTEGER FUNCTION h5lcreate_hard_c(obj_loc_id, obj_name, obj_namelen, & + link_loc_id, link_name, link_namelen, lcpl_id_default, lapl_id_default) BIND(C,NAME='h5lcreate_hard_c') + IMPORT :: c_char + IMPORT :: HID_T, SIZE_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: obj_loc_id + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: obj_name + INTEGER(HID_T), INTENT(IN) :: link_loc_id + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: link_name + INTEGER(SIZE_T) :: obj_namelen + INTEGER(SIZE_T) :: link_namelen + INTEGER(HID_T) :: lcpl_id_default + INTEGER(HID_T) :: lapl_id_default + END FUNCTION h5lcreate_hard_c + END INTERFACE + obj_namelen = LEN(obj_name) + link_namelen = LEN(link_name) + + lcpl_id_default = H5P_DEFAULT_F + IF(PRESENT(lcpl_id)) lcpl_id_default = lcpl_id + lapl_id_default = H5P_DEFAULT_F + IF(PRESENT(lapl_id)) lapl_id_default = lapl_id + + hdferr = h5lcreate_hard_c(obj_loc_id, obj_name, obj_namelen, & + link_loc_id, link_name, link_namelen, lcpl_id_default, lapl_id_default) + + END SUBROUTINE h5lcreate_hard_f + +! +!****s* H5L/H5Lcreate_external_f +! +! NAME +! H5Lcreate_external_f +! +! PURPOSE +! Creates a soft link to an object in a different file. +! +! INPUTS +! +! file_name - Name of the file containing the target object. Neither the file nor the target object is +! required to exist. May be the file the link is being created in. +! obj_name - Path within the target file to the target object. +! link_loc_id - The file or group identifier for the new link. +! link_name - The name of the new link. +! +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails +! OPTIONAL PARAMETERS +! lcpl_id - Link creation property list identifier. +! lapl_id - Link access property list identifier. +! +! AUTHOR +! M. Scot Breitenfeld +! February 27, 2008 +! SOURCE + SUBROUTINE h5lcreate_external_f(file_name, obj_name, link_loc_id, link_name, hdferr, lcpl_id, lapl_id) + IMPLICIT NONE + CHARACTER(LEN=*), INTENT(IN) :: file_name ! Name of the file containing the target object. Neither + ! the file nor the target object is required to exist. + ! May be the file the link is being created in. + CHARACTER(LEN=*), INTENT(IN) :: obj_name ! Name of the target object, which must already exist. + INTEGER(HID_T), INTENT(IN) :: link_loc_id ! The file or group identifier for the new link. + CHARACTER(LEN=*), INTENT(IN) :: link_name ! The name of the new link. + + INTEGER, INTENT(OUT) :: hdferr ! Error code: + ! 0 on success and -1 on failure + + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lcpl_id ! Link creation property list identifier. + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list identifier. +!***** + INTEGER(HID_T) :: lcpl_id_default + INTEGER(HID_T) :: lapl_id_default + + INTEGER(SIZE_T) :: file_namelen + INTEGER(SIZE_T) :: obj_namelen + INTEGER(SIZE_T) :: link_namelen + + INTERFACE + INTEGER FUNCTION h5lcreate_external_c(file_name, file_namelen, obj_name, obj_namelen, & + link_loc_id, link_name, link_namelen, lcpl_id_default, lapl_id_default) BIND(C,NAME='h5lcreate_external_c') + IMPORT :: c_char + IMPORT :: HID_T, SIZE_T + IMPLICIT NONE + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: file_name + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: obj_name + INTEGER(HID_T), INTENT(IN) :: link_loc_id + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: link_name + INTEGER(SIZE_T) :: file_namelen + INTEGER(SIZE_T) :: obj_namelen + INTEGER(SIZE_T) :: link_namelen + INTEGER(HID_T) :: lcpl_id_default + INTEGER(HID_T) :: lapl_id_default + END FUNCTION h5lcreate_external_c + END INTERFACE + file_namelen = LEN(file_name) + obj_namelen = LEN(obj_name) + link_namelen = LEN(link_name) + + lcpl_id_default = H5P_DEFAULT_F + IF(PRESENT(lcpl_id)) lcpl_id_default = lcpl_id + lapl_id_default = H5P_DEFAULT_F + IF(PRESENT(lapl_id)) lapl_id_default = lapl_id + + hdferr = h5lcreate_external_c(file_name, file_namelen, obj_name, obj_namelen, & + link_loc_id, link_name, link_namelen, lcpl_id_default, lapl_id_default) + + END SUBROUTINE h5lcreate_external_f + +! +!****s* H5L/h5ldelete_by_idx_f +! +! NAME +! h5ldelete_by_idx_f +! +! PURPOSE +! Removes the nth link in a group. +! INPUTS +! loc_id - File or group identifier specifying location of subject group +! group_name - Name of subject group +! index_field - Type of index; Possible values are: +! H5_INDEX_UNKNOWN_F = -1 - Unknown index type +! H5_INDEX_NAME_F - Index on names +! H5_INDEX_CRT_ORDER_F - Index on creation order +! H5_INDEX_N_F - Number of indices defined +! +! order - Order within field or index; Possible values are: +! H5_ITER_UNKNOWN_F - Unknown order +! H5_ITER_INC_F - Increasing order +! H5_ITER_DEC_F - Decreasing order +! H5_ITER_NATIVE_F - No particular order, whatever is fastest +! H5_ITER_N_F - Number of iteration orders +! +! n - Link for which to retrieve information +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails +! OPTIONAL PARAMETERS +! lapl_id - Link access property list +! +! AUTHOR +! M. Scot Breitenfeld +! February 29, 2008 +! SOURCE + SUBROUTINE h5ldelete_by_idx_f(loc_id, group_name, index_field, order, n, hdferr, lapl_id) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id ! Identifer for object to which attribute is attached + CHARACTER(LEN=*), INTENT(IN) :: group_name ! Name of object, relative to location, + ! from which attribute is to be removed + INTEGER, INTENT(IN) :: index_field ! Type of index; Possible values are: + ! H5_INDEX_UNKNOWN_F - Unknown index type + ! H5_INDEX_NAME_F - Index on names + ! H5_INDEX_CRT_ORDER_F - Index on creation order + ! H5_INDEX_N_F - Number of indices defined + INTEGER, INTENT(IN) :: order ! Order in which to iterate over index; Possible values are: + ! H5_ITER_UNKNOWN_F - Unknown order + ! H5_ITER_INC_F - Increasing order + ! H5_ITER_DEC_F - Decreasing order + ! H5_ITER_NATIVE_F - No particular order, whatever is fastest + ! H5_ITER_N_F - Number of iteration orders + INTEGER(HSIZE_T), INTENT(IN) :: n ! Offset within index + INTEGER, INTENT(OUT) :: hdferr ! Error code: + ! 0 on success and -1 on failure + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list +!***** + INTEGER(HID_T) :: lapl_id_default + INTEGER(SIZE_T) :: group_namelen + + INTERFACE + INTEGER FUNCTION h5ldelete_by_idx_c(loc_id, group_name, group_namelen, index_field, order, n, lapl_id_default) & + BIND(C,NAME='h5ldelete_by_idx_c') + IMPORT :: c_char + IMPORT :: HID_T, SIZE_T, HSIZE_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: group_name + INTEGER, INTENT(IN) :: index_field + INTEGER, INTENT(IN) :: order + INTEGER(HSIZE_T), INTENT(IN) :: n + INTEGER(HID_T) :: lapl_id_default + INTEGER(SIZE_T) :: group_namelen + END FUNCTION h5ldelete_by_idx_c + END INTERFACE + + lapl_id_default = H5P_DEFAULT_F + IF(PRESENT(lapl_id)) lapl_id_default = lapl_id + + group_namelen = LEN(group_name) + hdferr = h5ldelete_by_idx_c(loc_id, group_name, group_namelen, index_field, order, n, lapl_id_default) + + END SUBROUTINE h5ldelete_by_idx_f + +! +!****s* H5L/H5Lexists_f +! +! NAME +! H5Lexists_f +! +! PURPOSE +! Check if a link with a particular name exists in a group. +! +! INPUTS +! loc_id - Identifier of the file or group to query. +! name - Link name to check +! +! OUTPUTS +! link_exists - link exists status (.TRUE.,.FALSE.) +! hdferr - Returns 0 if successful and -1 if fails +! OPTIONAL PARAMETERS +! lapl_id - Link access property list identifier. +! +! AUTHOR +! M. Scot Breitenfeld +! February 29, 2008 +! +! SOURCE + SUBROUTINE h5lexists_f(loc_id, name, link_exists, hdferr, lapl_id) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id ! Identifier of the file or group to query. + CHARACTER(LEN=*), INTENT(IN) :: name ! Link name to check. + LOGICAL, INTENT(OUT) :: link_exists ! .TRUE. if exists, .FALSE. otherwise + INTEGER, INTENT(OUT) :: hdferr ! Error code: + ! 0 on success and -1 on failure + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id + ! Link access property list identifier. +!***** + INTEGER :: link_exists_c + INTEGER(HID_T) :: lapl_id_default + INTEGER(SIZE_T) :: namelen + + INTERFACE + INTEGER FUNCTION h5lexists_c(loc_id, name, namelen, lapl_id_default, link_exists_c) & + BIND(C,NAME='h5lexists_c') + IMPORT :: c_char + IMPORT :: HID_T, SIZE_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: name + INTEGER(SIZE_T), INTENT(IN) :: namelen + INTEGER, INTENT(OUT) :: link_exists_c + INTEGER(HID_T) :: lapl_id_default + + END FUNCTION h5lexists_c + END INTERFACE + + namelen = LEN(name) + + lapl_id_default = H5P_DEFAULT_F + IF(PRESENT(lapl_id)) lapl_id_default = lapl_id + + hdferr = h5lexists_c(loc_id, name, namelen, lapl_id_default, link_exists_c) + + link_exists = .FALSE. + IF(link_exists_c.GT.0) link_exists = .TRUE. + + END SUBROUTINE h5lexists_f + +! +!****s* H5L/h5lget_info_f +! +! NAME +! h5lget_info_f +! +! PURPOSE +! Returns information about a link. +! +! INPUTS +! link_loc_id - File or group identifier. +! link_name - Name of the link for which information is being sought +! +! OUTPUTS +! NOTE: In C these are contained in the structure H5L_info_t +! +! cset - indicates the character set used for link’s name. +! corder - specifies the link’s creation order position. +! corder_valid - indicates whether the value in corder is valid. +! link_type - specifies the link class: +! H5L_TYPE_HARD_F - Hard link +! H5L_TYPE_SOFT_F - Soft link +! H5L_TYPE_EXTERNAL_F - External link +! H5L_TYPE_ERROR_ F - Error +! address - If the link is a hard link, address specifies the file address that the link points to +! val_size - If the link is a symbolic link, val_size will be the length of the link value, e.g., +! the length of the name of the pointed-to object with a null terminator. +! hdferr - Returns 0 if successful and -1 if fails +! +! OPTIONAL PARAMETERS +! lapl_id - Link access property list +! +! AUTHOR +! M. Scot Breitenfeld +! February 29, 2008 +! +! HISTORY +! Changed the link_type names to match those in C (bug 1720) from, +! H5L_LINK_HARD_F, H5L_LINK_SOFT_F,H5L_LINK_EXTERNAL_F,H5L_LINK_ERROR_F +! to +! H5L_TYPE_HARD_F, H5L_TYPE_SOFT_F,H5L_TYPE_EXTERNAL_F,H5L_TYPE_ERROR_F +! MSB January 8, 2010. +! +! SOURCE + SUBROUTINE h5lget_info_f(link_loc_id, link_name, & + cset, corder, f_corder_valid, link_type, address, val_size, & + hdferr, lapl_id) + IMPLICIT NONE + + INTEGER(HID_T), INTENT(IN) :: link_loc_id ! File or group identifier. + CHARACTER(LEN=*), INTENT(IN) :: link_name ! Name of the link for which information is being sought + +! OUTPUTS NOTE: In C these are contained in the structure H5L_info_t + INTEGER, INTENT(OUT) :: cset ! Indicates the character set used for the link’s name. + INTEGER, INTENT(OUT) :: corder ! Specifies the link’s creation order position. + LOGICAL, INTENT(OUT) :: f_corder_valid ! Indicates whether the value in corder is valid. + INTEGER, INTENT(OUT) :: link_type ! Specifies the link class: + ! H5L_TYPE_HARD_F - Hard link + ! H5L_TYPE_SOFT_F - Soft link + ! H5L_TYPE_EXTERNAL_F - External link + ! H5L_TYPE_ERROR _F - Error + INTEGER(HADDR_T), INTENT(OUT) :: address ! If the link is a hard link, address specifies the file address that the link points to + INTEGER(SIZE_T), INTENT(OUT) :: val_size ! If the link is a symbolic link, val_size will be the length of the link value, e.g., + ! the length of the name of the pointed-to object with a null terminator. + INTEGER, INTENT(OUT) :: hdferr ! Error code: + ! 0 on success and -1 on failure + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list +!***** + INTEGER(SIZE_T) :: link_namelen + INTEGER(HID_T) :: lapl_id_default + INTEGER :: corder_valid + + INTERFACE + INTEGER FUNCTION h5lget_info_c(link_loc_id, link_name, link_namelen, & + cset, corder, corder_valid, link_type, address, val_size, & + lapl_id_default) BIND(C,NAME='h5lget_info_c') + IMPORT :: c_char + IMPORT :: HID_T, SIZE_T, HADDR_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: link_loc_id + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: link_name + INTEGER, INTENT(OUT) :: cset + INTEGER, INTENT(OUT) :: corder + INTEGER, INTENT(OUT) :: link_type + INTEGER(HADDR_T), INTENT(OUT) :: address + INTEGER(SIZE_T), INTENT(OUT) :: val_size + INTEGER(HID_T) :: lapl_id_default + INTEGER(SIZE_T) :: link_namelen + INTEGER :: corder_valid + END FUNCTION h5lget_info_c + END INTERFACE + + link_namelen = LEN(link_name) + + lapl_id_default = H5P_DEFAULT_F + IF(PRESENT(lapl_id)) lapl_id_default = lapl_id + + hdferr = h5lget_info_c(link_loc_id, link_name, link_namelen, & + cset, corder, corder_valid, link_type, & + address, val_size, & + lapl_id_default) + + f_corder_valid =.FALSE. + IF(corder_valid .EQ. 1) f_corder_valid =.TRUE. + + END SUBROUTINE h5lget_info_f + +! +!****s* H5L/h5lget_info_by_idx_f +! +! NAME +! h5lget_info_by_idx_f +! +! PURPOSE +! Retrieves metadata for a link in a group, according to the order within a field or index. +! +! INPUTS +! loc_id - File or group identifier specifying location of subject group +! group_name - Name of subject group +! index_field - Index or field which determines the order +! order - Order within field or index +! n - Link for which to retrieve information +! +! OUTPUTS +! NOTE: In C these are defined as a structure: H5L_info_t +! corder_valid - Indicates whether the creation order data is valid for this attribute +! corder - Is a positive integer containing the creation order of the attribute +! cset - Indicates the character set used for the attribute’s name +! address - If the link is a hard link, address specifies the file address that the link points to +! val_size - If the link is a symbolic link, val_size will be the length of the link value, e.g., +! the length of the name of the pointed-to object with a null terminator. +! hdferr - Returns 0 if successful and -1 if fails +! +! OPTIONAL PARAMETERS +! lapl_id - Link access property list +! +! AUTHOR +! M. Scot Breitenfeld +! February 29, 2008 +! +! HISTORY +! Changed the link_type names to match those in C (bug 1720) from, +! H5L_LINK_HARD_F, H5L_LINK_SOFT_F,H5L_LINK_EXTERNAL_F,H5L_LINK_ERROR_F +! to +! H5L_TYPE_HARD_F, H5L_TYPE_SOFT_F,H5L_TYPE_EXTERNAL_F,H5L_TYPE_ERROR_F +! MSB January 8, 2010. +! +! SOURCE + SUBROUTINE h5lget_info_by_idx_f(loc_id, group_name, index_field, order, n, & + link_type, f_corder_valid, corder, cset, address, val_size, hdferr, lapl_id) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier specifying location of subject group + CHARACTER(LEN=*), INTENT(IN) :: group_name ! Name of subject group + INTEGER, INTENT(IN) :: index_field ! Index or field which determines the order + ! H5_INDEX_UNKNOWN_F - Unknown index type + ! H5_INDEX_NAME_F - Index on names + ! H5_INDEX_CRT_ORDER_F - Index on creation order + ! H5_INDEX_N_F - Number of indices defined + INTEGER, INTENT(IN) :: order ! Order in which to iterate over index; Possible values are: + ! H5_ITER_UNKNOWN_F - Unknown order + ! H5_ITER_INC_F - Increasing order + ! H5_ITER_DEC_F - Decreasing order + ! H5_ITER_NATIVE_F - No particular order, whatever is fastest + INTEGER(HSIZE_T), INTENT(IN) :: n ! Attribute’s position in index + INTEGER, INTENT(OUT) :: link_type ! Specifies the link class: + ! H5L_TYPE_HARD_F - Hard link + ! H5L_TYPE_SOFT_F - Soft link + ! H5L_TYPE_EXTERNAL_F - External link + ! H5L_TYPE_ERROR _F - Error + LOGICAL, INTENT(OUT) :: f_corder_valid ! Indicates whether the creation order data is valid for this attribute + INTEGER, INTENT(OUT) :: corder ! Is a positive integer containing the creation order of the attribute + INTEGER, INTENT(OUT) :: cset ! Indicates the character set used for the attribute’s name + INTEGER(HADDR_T), INTENT(OUT) :: address ! If the link is a hard link, address specifies the file address that the link points to + INTEGER(SIZE_T), INTENT(OUT) :: val_size ! If the link is a symbolic link, val_size will be the length of the link value, e.g., + ! the length of the name of the pointed-to object with a null terminator. + INTEGER, INTENT(OUT) :: hdferr ! Error code: + ! 0 on success and -1 on failure + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list +!***** + INTEGER :: corder_valid + INTEGER(SIZE_T) :: group_namelen + INTEGER(HID_T) :: lapl_id_default + +! MS FORTRAN needs explicit interface for C functions called here. +! + INTERFACE + INTEGER FUNCTION h5lget_info_by_idx_c(loc_id, group_name, group_namelen, index_field, order, n, & + link_type, corder_valid, corder, cset, address, val_size, lapl_id_default) & + BIND(C,NAME='h5lget_info_by_idx_c') + IMPORT :: c_char + IMPORT :: HID_T, SIZE_T, HSIZE_T, HADDR_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: group_name + INTEGER(SIZE_T) :: group_namelen + INTEGER, INTENT(IN) :: index_field + INTEGER, INTENT(IN) :: order + INTEGER(HSIZE_T), INTENT(IN) :: n + INTEGER, INTENT(OUT) :: link_type + INTEGER :: corder_valid + INTEGER, INTENT(OUT) :: corder + INTEGER, INTENT(OUT) :: cset + INTEGER(HADDR_T), INTENT(OUT) :: address + INTEGER(SIZE_T), INTENT(OUT) :: val_size + INTEGER(HID_T) :: lapl_id_default + END FUNCTION h5lget_info_by_idx_c + END INTERFACE + + group_namelen = LEN(group_name) + + lapl_id_default = H5P_DEFAULT_F + IF(PRESENT(lapl_id)) lapl_id_default = lapl_id + + hdferr = h5lget_info_by_idx_c(loc_id, group_name, group_namelen, index_field, order, n, & + link_type, corder_valid, corder, cset, address, val_size, lapl_id_default) + + f_corder_valid =.FALSE. + IF (corder_valid .EQ. 1) f_corder_valid =.TRUE. + + END SUBROUTINE h5lget_info_by_idx_f + +! +!****s* H5L/h5lis_registered_f +! +! NAME +! h5lis_registered_f +! +! PURPOSE +! Determines whether a class of user-defined links is registered. +! +! INPUTS +! link_cls_id - User-defined link class identifier +! +! OUTPUTS +! registered - .TRUE. - if the link class has been registered +! .FALSE. - if it is unregistered +! hdferr - Error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! M. Scot Breitenfeld +! February 29, 2008 +! +! SOURCE + SUBROUTINE h5lis_registered_f(link_cls_id, registered, hdferr) + IMPLICIT NONE + INTEGER, INTENT(IN) :: link_cls_id ! User-defined link class identifier + LOGICAL, INTENT(OUT) :: registered ! .TRUE. - if the link class has been registered and + ! .FALSE. - if it is unregistered + INTEGER, INTENT(OUT) :: hdferr ! Error code: + ! 0 on success and -1 on failure +!***** + INTERFACE + INTEGER FUNCTION h5lis_registered_c(link_cls_id) BIND(C,NAME='h5lis_registered_c') + IMPLICIT NONE + INTEGER, INTENT(IN) :: link_cls_id ! User-defined link class identifier + END FUNCTION h5lis_registered_c + END INTERFACE + + hdferr = h5lis_registered_c(link_cls_id) + + IF(hdferr.GT.0)THEN + registered = .TRUE. + ELSE IF(hdferr.EQ.0)THEN + registered = .FALSE. + ENDIF + + END SUBROUTINE h5lis_registered_f + +! +!****s* H5L/h5lmove_f +! +! NAME +! h5lmove_f +! +! PURPOSE +! Renames a link within an HDF5 file. +! +! INPUTS +! src_loc_id - Original file or group identifier. +! src_name - Original link name. +! dest_loc_id - Destination file or group identifier. +! dest_name - NEW link name. +! +! OUTPUTS +! hdferr - Error code: +! 0 on success and -1 on failure +! +! OPTIONAL PARAMETERS +! lcpl_id - Link creation property list identifier to be associated WITH the NEW link. +! lapl_id - Link access property list identifier to be associated WITH the NEW link. +! +! AUTHOR +! M. Scot Breitenfeld +! March 3, 2008 +! +! SOURCE + SUBROUTINE h5lmove_f(src_loc_id, src_name, dest_loc_id, dest_name, hdferr, lcpl_id, lapl_id) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: src_loc_id ! Original file or group identifier. + CHARACTER(LEN=*), INTENT(IN) :: src_name ! Original link name. + INTEGER(HID_T), INTENT(IN) :: dest_loc_id ! Destination file or group identifier. + CHARACTER(LEN=*), INTENT(IN) :: dest_name ! NEW link name. + INTEGER, INTENT(OUT) :: hdferr ! Error code: + ! 0 on success and -1 on failure + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lcpl_id ! Link creation property list identifier + ! to be associated WITH the NEW link. + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list identifier + ! to be associated WITH the NEW link. +!***** + INTEGER(SIZE_T) :: src_namelen + INTEGER(SIZE_T) :: dest_namelen + + INTEGER(HID_T) :: lcpl_id_default + INTEGER(HID_T) :: lapl_id_default + + INTERFACE + INTEGER FUNCTION h5lmove_c(src_loc_id, src_name, src_namelen, dest_loc_id, & + dest_name, dest_namelen, lcpl_id_default, lapl_id_default) BIND(C,NAME='h5lmove_c') + IMPORT :: c_char + IMPORT :: HID_T, SIZE_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: src_loc_id + + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: src_name + INTEGER(SIZE_T) :: src_namelen + INTEGER(HID_T), INTENT(IN) :: dest_loc_id + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: dest_name + INTEGER(SIZE_T) :: dest_namelen + + INTEGER(HID_T) :: lcpl_id_default + INTEGER(HID_T) :: lapl_id_default + + END FUNCTION h5lmove_c + END INTERFACE + + lcpl_id_default = H5P_DEFAULT_F + IF(PRESENT(lcpl_id)) lcpl_id_default = lcpl_id + lapl_id_default = H5P_DEFAULT_F + IF(PRESENT(lapl_id)) lapl_id_default = lapl_id + + src_namelen = LEN(src_name) + dest_namelen = LEN(dest_name) + + hdferr = H5Lmove_c(src_loc_id, src_name, src_namelen, dest_loc_id, & + dest_name, dest_namelen, lcpl_id_default, lapl_id_default) + + END SUBROUTINE h5lmove_f + +! +!****s* H5L/h5lget_name_by_idx_f +! +! NAME +! h5lget_name_by_idx_f +! +! PURPOSE +! Retrieves name of the nth link in a group, according to the order within a specified field or index. +! +! INPUTS +! loc_id - File or group identifier specifying location of subject group +! group_name - Name of subject group +! index_field - Index or field which determines the order +! order - Order within field or index +! n - Link for which to retrieve information +! +! OUTPUTS +! name - Buffer in which link value is returned +! hdferr - Returns 0 if successful and -1 if fails +! +! OPTIONAL PARAMETERS +! lapl_id - List access property list identifier. +! size - Maximum number of characters of link value to be returned. +! +! AUTHOR +! M. Scot Breitenfeld +! March 10, 2008 +! +! SOURCE + SUBROUTINE h5lget_name_by_idx_f(loc_id, group_name, index_field, order, n, & + name, hdferr, size, lapl_id) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier specifying location of subject group + CHARACTER(LEN=*), INTENT(IN) :: group_name ! Name of subject group + INTEGER, INTENT(IN) :: index_field ! Index or field which determines the order + ! H5_INDEX_UNKNOWN_F - Unknown index type + ! H5_INDEX_NAME_F - Index on names + ! H5_INDEX_CRT_ORDER_F - Index on creation order + ! H5_INDEX_N_F - Number of indices defined + INTEGER, INTENT(IN) :: order ! Order in which to iterate over index; Possible values are: + ! H5_ITER_UNKNOWN_F - Unknown order + ! H5_ITER_INC_F - Increasing order + ! H5_ITER_DEC_F - Decreasing order + ! H5_ITER_NATIVE_F - No particular order, whatever is fastest + INTEGER(HSIZE_T), INTENT(IN) :: n ! Attribute’s position in index + CHARACTER(LEN=*), INTENT(OUT) :: name ! Buffer in which link value is returned + INTEGER, INTENT(OUT) :: hdferr ! Error code: + ! 0 on success and -1 on failure +!***** + INTEGER(SIZE_T) :: group_namelen + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list + INTEGER(HID_T) :: lapl_id_default + INTEGER(SIZE_T), OPTIONAL, INTENT(OUT) :: size ! Indicates the size, in the number of characters, of the link + INTEGER(SIZE_T) :: size_default + + INTERFACE + INTEGER FUNCTION h5lget_name_by_idx_c(loc_id, group_name, group_namelen, index_field, order, n, & + size_default, name, lapl_id_default) BIND(C,NAME='h5lget_name_by_idx_c') + IMPORT :: c_char + IMPORT :: HID_T, SIZE_T, HSIZE_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id + + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: group_name + INTEGER(SIZE_T) :: group_namelen + INTEGER, INTENT(IN) :: index_field + INTEGER, INTENT(IN) :: order + INTEGER(HSIZE_T), INTENT(IN) :: n + INTEGER(SIZE_T) :: size_default + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(OUT) :: name + INTEGER(HID_T) :: lapl_id_default + END FUNCTION h5lget_name_by_idx_c + END INTERFACE + + group_namelen = LEN(group_name) + + lapl_id_default = H5P_DEFAULT_F + IF(PRESENT(lapl_id)) lapl_id_default = lapl_id + + size_default = LEN(name) + + hdferr = h5lget_name_by_idx_c(loc_id, group_name, group_namelen, index_field, order, n, & + size_default, name, lapl_id_default) + + IF(PRESENT(size)) size = size_default + + + END SUBROUTINE h5lget_name_by_idx_f + + +! HAS PROBLEM WITH void pointer in C +!!$! +!!$!****s* H5L/ +!!$! +!!$! NAME +!!$! h5lget_val_by_idx_f +!!$! +!!$! PURPOSE +!!$! Returns the link value of a link, according to the order of +!!$! an index. For symbolic links, this is the path to which the +!!$! link points, including the null terminator. For user-defined +!!$! links, it is the link buffer. +!!$! INPUTS +!!$! loc_id - File or group identifier specifying location of subject group +!!$! group_name - Name of subject group +!!$! index_field - Index or field which determines the order +!!$! order - Order within field or index +!!$! n - Link for which to retrieve information +!!$! size - Maximum number of characters of link value to be returned. +!!$! +!!$! OUTPUTS NOTE: In C these are defined as a structure: H5L_info_t +!!$! corder_valid - indicates whether the creation order data is valid for this attribute +!!$! corder - is a positive integer containing the creation order of the attribute +!!$! cset - indicates the character set used for the attribute’s name +!!$! data_size - indicates the size, in the number of characters, of the attribute +!!$! hdferr - error code +!!$! Success: 0 +!!$! Failure: -1 +!!$! OPTIONAL PARAMETERS +!!$! lapl_id - List access property list identifier. +!!$! +!!$! AUTHOR +!!$! M. Scot Breitenfeld +!!$! March 3, 2008 +!!$! +!!$! HISTORY N/A +!!$! +!!$! +!!$! SOURCE +!!$ SUBROUTINE h5lget_val_by_idx_f(loc_id, group_name, index_field, order, n, & +!!$ f_corder_valid, corder, cset, data_size, hdferr, lapl_id) +!!$ IMPLICIT NONE +!!$ INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier specifying location of subject group +!!$ CHARACTER(LEN=*), INTENT(IN) :: group_name ! Name of subject group +!!$ INTEGER, INTENT(IN) :: index_field ! Index or field which determines the order +!!$ ! H5_INDEX_UNKNOWN_F - Unknown index type +!!$ ! H5_INDEX_NAME_F - Index on names +!!$ ! H5_INDEX_CRT_ORDER_F - Index on creation order +!!$ ! H5_INDEX_N_F - Number of indices defined +!!$ INTEGER, INTENT(IN) :: order ! Order in which to iterate over index; Possible values are: +!!$ ! H5_ITER_UNKNOWN_F - Unknown order +!!$ ! H5_ITER_INC_F - Increasing order +!!$ ! H5_ITER_DEC_F - Decreasing order +!!$ ! H5_ITER_NATIVE_F - No particular order, whatever is fastest +!!$ INTEGER(HSIZE_T), INTENT(IN) :: n ! Attribute’s position in index +!!$ LOGICAL, INTENT(OUT) :: f_corder_valid ! Indicates whether the creation order data is valid for this attribute +!!$ INTEGER, INTENT(OUT) :: corder ! Is a positive integer containing the creation order of the attribute +!!$ INTEGER, INTENT(OUT) :: cset ! Indicates the character set used for the attribute’s name +!!$ INTEGER(HSIZE_T), INTENT(OUT) :: data_size ! Indicates the size, in the number of characters, of the attribute +!!$ INTEGER, INTENT(OUT) :: hdferr ! Error code: +!!$ ! 0 on success and -1 on failure +!!$ INTEGER :: corder_valid +!!$ INTEGER(SIZE_T) :: group_namelen +!!$ INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list +!!$ INTEGER(HID_T) :: lapl_id_default +!!$ +!!$ INTERFACE +!!$ INTEGER FUNCTION h5lget_val_by_idx_c(loc_id, group_name, group_namelen, index_field, order, n, & +!!$ corder_valid, corder, cset, data_size, lapl_id_default) +!!$ USE H5GLOBAL +!!$ !DEC$IF DEFINED(HDF5F90_WINDOWS) +!!$ !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LGET_VAL_BY_IDX_C'::h5lget_val_by_idx_c +!!$ !DEC$ENDIF +!!$ INTEGER(HID_T), INTENT(IN) :: loc_id +!!$ CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: group_name +!!$ INTEGER(SIZE_T) :: group_namelen +!!$ INTEGER, INTENT(IN) :: index_field +!!$ INTEGER, INTENT(IN) :: order +!!$ INTEGER(HSIZE_T), INTENT(IN) :: n +!!$ INTEGER :: corder_valid +!!$ INTEGER, INTENT(OUT) :: corder +!!$ INTEGER, INTENT(OUT) :: cset +!!$ INTEGER(HSIZE_T), INTENT(OUT) :: data_size +!!$ INTEGER(HID_T) :: lapl_id_default +!!$ END FUNCTION h5lget_val_by_idx_c +!!$ END INTERFACE +!!$ +!!$ group_namelen = LEN(group_name) +!!$ +!!$ lapl_id_default = H5P_DEFAULT_F +!!$ IF(PRESENT(lapl_id)) lapl_id_default = lapl_id +!!$ +!!$ hdferr = h5lget_info_by_idx_c(loc_id, group_name, group_namelen, index_field, order, n, & +!!$ corder_valid, corder, cset, data_size, lapl_id_default) +!!$ +!!$ f_corder_valid =.FALSE. +!!$ IF (corder_valid .EQ. 1) f_corder_valid =.TRUE. +!!$ +!!$ END SUBROUTINE h5lget_val_by_idx_f + +!!$! +!!$!****s* H5L/h5lget_val_f +!!$! +!!$! NAME +!!$! h5lget_val_f +!!$! +!!$! PURPOSE +!!$! Returns the value of a symbolic link. +!!$! +!!$! INPUTS +!!$! link_loc_id - File or group identifier. +!!$! link_name - Link whose value is to be returned. +!!$! size - Maximum number of characters of link value to be returned. +!!$! +!!$! OUTPUTS +!!$! linkval_buff - The buffer to hold the returned link value. +!!$! hdferr - error code +!!$! Success: 0 +!!$! Failure: -1 +!!$! OPTIONAL PARAMETERS +!!$! lapl_id - List access property list identifier. +!!$! +!!$! AUTHOR +!!$! M. Scot Breitenfeld +!!$! March 3, 2008 +!!$! SOURCE +!!$ SUBROUTINE h5lget_val_f(link_loc_id, link_name, size, linkval_buff, & +!!$ hdferr, lapl_id) +!!$ IMPLICIT NONE +!!$ INTEGER(HID_T), INTENT(IN) :: link_loc_id ! File or group identifier. +!!$ CHARACTER(LEN=*), INTENT(IN) :: link_name ! Link whose value is to be returned. +!!$ INTEGER(SIZE_T), INTENT(IN) :: size ! Maximum number of characters of link value to be returned. +!!$ +!!$ CHARACTER(LEN=size), INTENT(OUT) :: linkval_buff ! The buffer to hold the returned link value. +!!$ INTEGER, INTENT(OUT) :: hdferr ! Error code: +!!$ ! 0 on success and -1 on failure +!!$ INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list +!!$ +!!$ INTEGER :: link_namelen +!!$ INTEGER(HID_T) :: lapl_id_default +!!$ INTEGER :: corder_valid +!!$ +!!$ INTEGER :: link_namelen +!!$ INTEGER(HID_T) :: lapl_id_default +!!$ +!!$! MS FORTRAN needs explicit interface for C functions called here. +!!$! +!!$ INTERFACE +!!$ INTEGER FUNCTION h5lget_val_c(link_loc_id, link_name, link_namelen, size, linkval_buff, & +!!$ lapl_id_default) +!!$ USE H5GLOBAL +!!$ !DEC$IF DEFINED(HDF5F90_WINDOWS) +!!$ !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LGET_VAL_C'::h5lget_val_c +!!$ !DEC$ENDIF +!!$ INTEGER(HID_T), INTENT(IN) :: link_loc_id ! File or group identifier. +!!$ CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: link_name ! Link whose value is to be returned. +!!$ INTEGER :: link_namelen +!!$ INTEGER(SIZE_T), INTENT(IN) :: size ! Maximum number of characters of link value to be returned. +!!$ +!!$ CHARACTER(LEN=size), INTENT(OUT) :: linkval_buff ! The buffer to hold the returned link value. +!!$ +!!$ INTEGER :: link_namelen +!!$ INTEGER(HID_T) :: lapl_id_default +!!$ +!!$ END FUNCTION h5lget_val_c +!!$ END INTERFACE +!!$ +!!$ link_namelen = LEN(link_name) +!!$ +!!$ lapl_id_default = H5P_DEFAULT_F +!!$ IF(PRESENT(lapl_id)) lapl_id_default = lapl_id +!!$ +!!$ hdferr = h5lget_val_c(link_loc_id, link_name, link_namelen, size, linkval_buff, & +!!$ lapl_id_default) +!!$ +!!$ END SUBROUTINE h5lget_val_f + +!!$! +!!$!****s* H5L/H5Lregistered_f +!!$! +!!$! NAME +!!$! H5Lregistered_f +!!$! +!!$! PURPOSE +!!$! Registers user-defined link class or changes behavior of existing class. +!!$! +!!$! INPUTS NOTE: In C the following represents struct H5L_class_t: +!!$! version - Version number of this struct +!!$! class_id - Link class identifier +!!$! comment - Comment for debugging +!!$! create_func - Callback during link creation +!!$! move_func - Callback after moving link +!!$! copy_func - Callback after copying link +!!$! trav_func - The main traversal function +!!$! del_func - Callback for link deletion +!!$! query_func - Callback for queries +!!$! +!!$! OUTPUTS +!!$! hdferr - Error code +!!$! Success: 0 +!!$! Failure: -1 +!!$! OPTIONAL PARAMETERS +!!$! None +!!$! +!!$! AUTHOR +!!$! M. Scot Breitenfeld +!!$! February 29, 2008 +!!$! +!!$! HISTORY N/A +!!$! +!!$! +!!$! SOURCE +!!$ SUBROUTINE H5Lregistered_f(version, class_id, comment, create_func, & +!!$ move_func, copy_func, trav_func, del_func, query_func, hdferr) +!!$ IMPLICIT NONE +!!$ INTEGER, INTENT(IN) :: version ! Version number of this struct +!!$ INTEGER, INTENT(IN) :: class_id ! Link class identifier +!!$ CHARACTER(LEN=*), INTENT(IN) :: comment ! Comment for debugging +!!$ CHARACTER(LEN=*), INTENT(IN) :: create_func ! Callback during link creation +!!$ CHARACTER(LEN=*), INTENT(IN) :: move_func ! Callback after moving link +!!$ CHARACTER(LEN=*), INTENT(IN) :: copy_func ! Callback after copying link +!!$ CHARACTER(LEN=*), INTENT(IN) :: trav_func ! The main traversal function +!!$ CHARACTER(LEN=*), INTENT(IN) :: del_func ! Callback for link deletion +!!$ CHARACTER(LEN=*), INTENT(IN) :: query_func ! Callback for queries +!!$ INTEGER, INTENT(OUT) :: hdferr ! Error code: +!!$ ! 0 on success and -1 on failure +!!$ INTEGER :: comment_len +!!$ INTEGER :: create_func_len +!!$ INTEGER :: move_func_len +!!$ INTEGER :: copy_func_len +!!$ INTEGER :: trav_func_len +!!$ INTEGER :: del_func_len +!!$ INTEGER :: query_func_len +!!$ +!!$ INTERFACE +!!$ INTEGER FUNCTION H5Lregistered_c(version, class_id, comment, & +!!$ create_func, create_func_len, & +!!$ move_func, move_func_len, & +!!$ copy_func, copy_func_len, & +!!$ trav_func, trav_func_len, & +!!$ del_func, del_func_len, & +!!$ query_func,query_func_len) +!!$ USE H5GLOBAL +!!$ !DEC$IF DEFINED(HDF5F90_WINDOWS) +!!$ !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LREGISTERED_C'::H5Lregistered_c +!!$ !DEC$ENDIF +!!$ INTEGER, INTENT(IN) :: version ! Version number of this struct +!!$ INTEGER, INTENT(IN) :: class_id ! Link class identifier +!!$ CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: comment ! Comment for debugging +!!$ CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: create_func ! Callback during link creation +!!$ CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: move_func ! Callback after moving link +!!$ CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: copy_func ! Callback after copying link +!!$ CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: trav_func ! The main traversal function +!!$ CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: del_func ! Callback for link deletion +!!$ CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: query_func ! Callback for queries +!!$ INTEGER, INTENT(OUT) :: hdferr ! Error code: +!!$ ! 0 on success and -1 on failure +!!$ INTEGER :: comment_len +!!$ INTEGER :: create_func_len +!!$ INTEGER :: move_func_len +!!$ INTEGER :: copy_func_len +!!$ INTEGER :: trav_func_len +!!$ INTEGER :: del_func_len +!!$ INTEGER :: query_func_len +!!$ +!!$ END FUNCTION H5Lregistered_c +!!$ END INTERFACE +!!$ +!!$ comment_len = LEN(comment) +!!$ create_func_len = LEN(create_func) +!!$ move_func_len = LEN(move_func) +!!$ copy_func_len = LEN(copy_func) +!!$ trav_func_len = LEN(trav_func) +!!$ del_func_len = LEN(del_func) +!!$ query_func_len = LEN(query_func) +!!$ +!!$ hdferr = H5Lregistered_c(version, class_id, comment, & +!!$ create_func, create_func_len, & +!!$ move_func, move_func_len, & +!!$ copy_func, copy_func_len, & +!!$ trav_func, trav_func_len, & +!!$ del_func, del_func_len, & +!!$ query_func, query_func_len) +!!$ +!!$ END SUBROUTINE H5Lregistered_f + +!****s* H5L (F03)/h5literate_f +! +! NAME +! h5literate_f +! +! PURPOSE +! Iterates through links in a group. +! +! Inputs: +! group_id - Identifier specifying subject group +! index_type - Type of index which determines the order: +! H5_INDEX_NAME_F - Alpha-numeric index on name +! H5_INDEX_CRT_ORDER_F - Index on creation order +! order - Order within index: +! H5_ITER_INC_F - Increasing order +! H5_ITER_DEC_F - Decreasing order +! H5_ITER_NATIVE_F - Fastest available order +! idx - IN: Iteration position at which to start +! op - Callback function passing data regarding the link to the calling application +! op_data - User-defined pointer to data required by the application for its processing of the link +! +! Outputs: +! idx - OUT: Position at which an interrupted iteration may be restarted +! return_value - Success: The return value of the first operator that +! returns non-zero, or zero if all members were +! processed with no operator returning non-zero. +! +! Failure: Negative if something goes wrong within the +! library, or the negative value returned by one +! of the operators. +! +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! M. Scot Breitenfeld +! July 8, 2008 +! +! Fortran2003 Interface: + SUBROUTINE h5literate_f(group_id, index_type, order, idx, op, op_data, return_value, hdferr) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T) , INTENT(IN) :: group_id + INTEGER , INTENT(IN) :: index_type + INTEGER , INTENT(IN) :: order + INTEGER(HSIZE_T), INTENT(INOUT) :: idx + TYPE(C_FUNPTR) , INTENT(IN) :: op + TYPE(C_PTR) , INTENT(IN) :: op_data + INTEGER , INTENT(OUT) :: return_value + INTEGER , INTENT(OUT) :: hdferr +!***** + INTERFACE + INTEGER FUNCTION h5literate_c(group_id, index_type, order, idx, op, op_data) & + BIND(C, NAME='h5literate_c') + IMPORT :: c_ptr, c_funptr + IMPORT :: HID_T, HSIZE_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: group_id + INTEGER, INTENT(IN) :: index_type + INTEGER, INTENT(IN) :: order + INTEGER(HSIZE_T), INTENT(INOUT) :: idx + TYPE(C_FUNPTR), VALUE :: op + TYPE(C_PTR), VALUE :: op_data + END FUNCTION h5literate_c + END INTERFACE + + return_value = h5literate_c(group_id, index_type, order, idx, op, op_data) + + IF(return_value.GE.0)THEN + hdferr = 0 + ELSE + hdferr = -1 + END IF + + END SUBROUTINE h5literate_f + +!****s* H5L (F03)/h5literate_by_name_f +! +! NAME +! h5literate_by_name_f +! +! PURPOSE +! Iterates through links in a group. +! +! Inputs: +! loc_id - File or group identifier specifying location of subject group +! group_name - Name of subject group +! index_type - Type of index which determines the order: +! H5_INDEX_NAME_F - Alpha-numeric index on name +! H5_INDEX_CRT_ORDER_F - Index on creation order +! order - Order within index: +! H5_ITER_INC_F - Increasing order +! H5_ITER_DEC_F - Decreasing order +! H5_ITER_NATIVE_F - Fastest available order +! idx - IN: Iteration position at which to start +! op - Callback function passing data regarding the link to the calling application +! op_data - User-defined pointer to data required by the application for its processing of the link +! +! Outputs: +! idx - OUT: Position at which an interrupted iteration may be restarted +! return_value - Success: The return value of the first operator that +! returns non-zero, or zero if all members were +! processed with no operator returning non-zero. +! +! Failure: Negative if something goes wrong within the +! library, or the negative value returned by one +! of the operators. +! +! hdferr - Returns 0 if successful and -1 if fails +! +! Optional parameters: +! lapl_id - Link access property list +! +! AUTHOR +! M. Scot Breitenfeld +! Augest 18, 2008 +! +! Fortran2003 Interface: + SUBROUTINE h5literate_by_name_f(loc_id, group_name, index_type, order, & + idx, op, op_data, return_value, hdferr, lapl_id) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T) , INTENT(IN) :: loc_id + CHARACTER(LEN=*), INTENT(IN) :: group_name + INTEGER , INTENT(IN) :: index_type + INTEGER , INTENT(IN) :: order + INTEGER(HSIZE_T), INTENT(INOUT) :: idx + TYPE(C_FUNPTR) , INTENT(IN) :: op + TYPE(C_PTR) , INTENT(IN) :: op_data + INTEGER , INTENT(OUT) :: return_value + INTEGER , INTENT(OUT) :: hdferr + INTEGER(HID_T) , INTENT(IN), OPTIONAL :: lapl_id +!***** + INTEGER(HID_T) :: lapl_id_default + INTEGER(SIZE_T) :: namelen + + INTERFACE + INTEGER FUNCTION h5literate_by_name_c(loc_id, name, namelen, index_type, order,& + idx, op, op_data, lapl_id_default) BIND(C, NAME='h5literate_by_name_c') + IMPORT :: c_char, c_ptr, c_funptr + IMPORT :: HID_T, SIZE_T, HSIZE_T + IMPLICIT NONE + INTEGER(HID_T) , INTENT(IN) :: loc_id + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: name + INTEGER(SIZE_T) , INTENT(IN) :: namelen + INTEGER , INTENT(IN) :: index_type + INTEGER , INTENT(IN) :: order + INTEGER(HSIZE_T), INTENT(INOUT) :: idx + TYPE(C_FUNPTR), VALUE :: op + TYPE(C_PTR), VALUE :: op_data + INTEGER(HID_T) , INTENT(IN) :: lapl_id_default + END FUNCTION + END INTERFACE + + namelen = LEN(group_name) + lapl_id_default = H5P_DEFAULT_F + IF(PRESENT(lapl_id)) lapl_id_default = lapl_id + + return_value = h5literate_by_name_c(loc_id, group_name, namelen, index_type, order, idx, op, op_data, lapl_id_default) + + IF(return_value.GE.0)THEN + hdferr = 0 + ELSE + hdferr = -1 + END IF + + END SUBROUTINE h5literate_by_name_f + +END MODULE H5L diff --git a/fortran/src/H5Lff.f90 b/fortran/src/H5Lff.f90 deleted file mode 100644 index 4660e52..0000000 --- a/fortran/src/H5Lff.f90 +++ /dev/null @@ -1,1300 +0,0 @@ -!****h* ROBODoc/H5L -! -! NAME -! MODULE H5L -! -! PURPOSE -! This file contains Fortran interfaces for H5L functions. It includes -! all the functions that are independent on whether the Fortran 2003 functions -! are enabled or disabled. -! -! 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. * -! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -! -! NOTES -! *** IMPORTANT *** -! If you add a new H5L function you must add the function name to the -! Windows dll file 'hdf5_fortrandll.def.in' in the fortran/src directory. -! This is needed for Windows based operating systems. -! -!***** - -MODULE H5L - - USE H5GLOBAL - -CONTAINS - -! -!****s* H5L/h5lcopy_f -! -! NAME -! h5lcopy_f -! -! PURPOSE -! Copies a link from one location to another. -! -! INPUTS -! src_loc_id - Location identifier of the source link -! src_name - Name of the link to be copied -! dest_loc_id - Location identifier specifying the destination of the copy -! dest_name - Name to be assigned to the NEW copy -! loc_id - Identifier of the file or group containing the object -! name - Name of the link to delete -! -! OUTPUTS -! hdferr - Returns 0 if successful and -1 if fails -! OPTIONAL PARAMETERS -! lcpl_id - Link creation property list identifier -! lapl_id - Link access property list identifier -! -! AUTHOR -! M. Scot Breitenfeld -! February 27, 2008 -! -! SOURCE - SUBROUTINE h5lcopy_f(src_loc_id, src_name, dest_loc_id, dest_name, hdferr, & - lcpl_id, lapl_id) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: src_loc_id ! Location identifier of the source link - CHARACTER(LEN=*), INTENT(IN) :: src_name ! Name of the link to be copied - INTEGER(HID_T), INTENT(IN) :: dest_loc_id ! Location identifier specifying the destination of the copy - CHARACTER(LEN=*), INTENT(IN) :: dest_name ! Name to be assigned to the NEW copy - - INTEGER, INTENT(OUT) :: hdferr ! Error code: - ! 0 on success and -1 on failure - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lcpl_id ! Link creation property list identifier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list identifier -!***** - INTEGER(HID_T) :: lcpl_id_default - INTEGER(HID_T) :: lapl_id_default - - INTEGER(SIZE_T) :: src_namelen - INTEGER(SIZE_T) :: dest_namelen - - INTERFACE - INTEGER FUNCTION h5lcopy_c(src_loc_id, src_name, src_namelen, dest_loc_id, dest_name, dest_namelen, & - lcpl_id_default, lapl_id_default) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LCOPY_C'::h5lcopy_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: src_name, dest_name - INTEGER(HID_T), INTENT(IN) :: src_loc_id - CHARACTER(LEN=*), INTENT(IN) :: src_name - INTEGER(HID_T), INTENT(IN) :: dest_loc_id - CHARACTER(LEN=*), INTENT(IN) :: dest_name - - INTEGER(HID_T) :: lcpl_id_default - INTEGER(HID_T) :: lapl_id_default - - INTEGER(SIZE_T) :: src_namelen - INTEGER(SIZE_T) :: dest_namelen - END FUNCTION h5lcopy_c - END INTERFACE - - src_namelen = LEN(src_name) - dest_namelen = LEN(dest_name) - - lcpl_id_default = H5P_DEFAULT_F - IF(PRESENT(lcpl_id)) lcpl_id_default = lcpl_id - lapl_id_default = H5P_DEFAULT_F - IF(PRESENT(lapl_id)) lapl_id_default = lapl_id - - hdferr = h5lcopy_c(src_loc_id, src_name, src_namelen, dest_loc_id, dest_name, dest_namelen, & - lcpl_id_default, lapl_id_default) - - END SUBROUTINE h5lcopy_f - -! -!****s* H5L/h5ldelete_f -! -! NAME -! h5ldelete_f -! -! PURPOSE -! Removes a link from a group. -! -! INPUTS -! loc_id - Identifier of the file or group containing the object -! name - Name of the link to delete -! -! OUTPUTS -! hdferr - Returns 0 if successful and -1 if fails -! OPTIONAL PARAMETERS -! lapl_id - Link access property list identifier -! -! AUTHOR -! M. Scot Breitenfeld -! January, 2008 -! -! SOURCE - SUBROUTINE h5ldelete_f(loc_id, name, hdferr, lapl_id) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id ! Identifier of the file or group containing the object - CHARACTER(LEN=*), INTENT(IN) :: name ! Name of the link to delete - INTEGER, INTENT(OUT) :: hdferr ! Error code: - ! 0 on success and -1 on failure - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list identifier -!***** - INTEGER(HID_T) :: lapl_id_default - INTEGER(SIZE_T) :: namelen - - INTERFACE - INTEGER FUNCTION h5ldelete_c(loc_id, name, namelen, lapl_id_default) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LDELETE_C'::h5ldelete_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: name - INTEGER(HID_T), INTENT(IN) :: loc_id - CHARACTER(LEN=*), INTENT(IN) :: name - INTEGER(HID_T) :: lapl_id_default - INTEGER(SIZE_T) :: namelen - END FUNCTION h5ldelete_c - END INTERFACE - - namelen = LEN(name) - - lapl_id_default = H5P_DEFAULT_F - IF(PRESENT(lapl_id)) lapl_id_default = lapl_id - - hdferr = h5ldelete_c(loc_id, name, namelen, lapl_id_default) - - END SUBROUTINE h5ldelete_f - -! -!****s* H5L/H5Lcreate_soft_f -! -! NAME -! H5Lcreate_soft_f -! -! PURPOSE -! Creates a soft link to an object. -! -! INPUTS -! target_path - Path to the target object, which is not required to exist. -! link_loc_id - The file or group identifier for the new link. -! link_name - The name of the new link. -! -! OUTPUTS -! hdferr - Returns 0 if successful and -1 if fails -! OPTIONAL PARAMETERS -! lcpl_id - Link creation property list identifier. -! lapl_id - Link access property list identifier. -! -! AUTHOR -! M. Scot Breitenfeld -! February 20, 2008 -! -! SOURCE - SUBROUTINE h5lcreate_soft_f(target_path, link_loc_id, link_name, hdferr, lcpl_id, lapl_id) - IMPLICIT NONE - CHARACTER(LEN=*), INTENT(IN) :: target_path ! Path to the target object, which is not required to exist. - INTEGER(HID_T), INTENT(IN) :: link_loc_id ! The file or group identifier for the new link. - CHARACTER(LEN=*), INTENT(IN) :: link_name ! The name of the new link. - INTEGER, INTENT(OUT) :: hdferr ! Error code: - ! 0 on success and -1 on failure - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lcpl_id ! Link creation property list identifier. - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list identifier. -!***** - INTEGER(HID_T) :: lcpl_id_default - INTEGER(HID_T) :: lapl_id_default - INTEGER(SIZE_T) :: target_path_len - INTEGER(SIZE_T) :: link_name_len - - INTERFACE - INTEGER FUNCTION h5lcreate_soft_c(target_path, target_path_len, & - link_loc_id, & - link_name,link_name_len, & - lcpl_id_default, lapl_id_default ) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LCREATE_SOFT_C'::h5lcreate_soft_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: target_path, link_name - CHARACTER(LEN=*), INTENT(IN) :: target_path - INTEGER(SIZE_T) :: target_path_len - INTEGER(HID_T), INTENT(IN) :: link_loc_id - CHARACTER(LEN=*), INTENT(IN) :: link_name - INTEGER(SIZE_T) :: link_name_len - INTEGER(HID_T) :: lcpl_id_default - INTEGER(HID_T) :: lapl_id_default - END FUNCTION h5lcreate_soft_c - END INTERFACE - - target_path_len = LEN(target_path) - link_name_len = LEN(link_name) - - lcpl_id_default = H5P_DEFAULT_F - IF(PRESENT(lcpl_id)) lcpl_id_default = lcpl_id - lapl_id_default = H5P_DEFAULT_F - IF(PRESENT(lapl_id)) lapl_id_default = lapl_id - - hdferr = h5lcreate_soft_c(target_path, target_path_len,& - link_loc_id, & - link_name, link_name_len, & - lcpl_id_default, lapl_id_default ) - - END SUBROUTINE h5lcreate_soft_f - -! -!****s* H5L/H5Lcreate_hard_f -! -! NAME -! H5Lcreate_hard_f -! -! PURPOSE -! Creates a hard link to an object. -! -! INPUTS -! -! obj_loc_id - The file or group identifier for the target object. -! obj_name - Name of the target object, which must already exist. -! link_loc_id - The file or group identifier for the new link. -! link_name - The name of the new link. -! -! OUTPUTS -! hdferr - Returns 0 if successful and -1 if fails -! OPTIONAL PARAMETERS -! lcpl_id - Link creation property list identifier. -! lapl_id - Link access property list identifier. -! -! AUTHOR -! M. Scot Breitenfeld -! February 27, 2008 -! -! SOURCE - SUBROUTINE h5lcreate_hard_f(obj_loc_id, obj_name, link_loc_id, link_name, hdferr, lcpl_id, lapl_id) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: obj_loc_id ! The file or group identifier for the target object. - CHARACTER(LEN=*), INTENT(IN) :: obj_name ! Name of the target object, which must already exist. - INTEGER(HID_T), INTENT(IN) :: link_loc_id ! The file or group identifier for the new link. - CHARACTER(LEN=*), INTENT(IN) :: link_name ! The name of the new link. - - INTEGER, INTENT(OUT) :: hdferr ! Error code: - ! 0 on success and -1 on failure - - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lcpl_id ! Link creation property list identifier. - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list identifier. -!***** - INTEGER(HID_T) :: lcpl_id_default - INTEGER(HID_T) :: lapl_id_default - - INTEGER(SIZE_T) :: obj_namelen - INTEGER(SIZE_T) :: link_namelen - - INTERFACE - INTEGER FUNCTION h5lcreate_hard_c(obj_loc_id, obj_name, obj_namelen, & - link_loc_id, link_name, link_namelen, lcpl_id_default, lapl_id_default) - - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LCREATE_HARD_C'::h5lcreate_hard_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: obj_name, link_name - INTEGER(HID_T), INTENT(IN) :: obj_loc_id - CHARACTER(LEN=*), INTENT(IN) :: obj_name - INTEGER(HID_T), INTENT(IN) :: link_loc_id - CHARACTER(LEN=*), INTENT(IN) :: link_name - INTEGER(SIZE_T) :: obj_namelen - INTEGER(SIZE_T) :: link_namelen - INTEGER(HID_T) :: lcpl_id_default - INTEGER(HID_T) :: lapl_id_default - END FUNCTION h5lcreate_hard_c - END INTERFACE - obj_namelen = LEN(obj_name) - link_namelen = LEN(link_name) - - lcpl_id_default = H5P_DEFAULT_F - IF(PRESENT(lcpl_id)) lcpl_id_default = lcpl_id - lapl_id_default = H5P_DEFAULT_F - IF(PRESENT(lapl_id)) lapl_id_default = lapl_id - - hdferr = h5lcreate_hard_c(obj_loc_id, obj_name, obj_namelen, & - link_loc_id, link_name, link_namelen, lcpl_id_default, lapl_id_default) - - END SUBROUTINE h5lcreate_hard_f - -! -!****s* H5L/H5Lcreate_external_f -! -! NAME -! H5Lcreate_external_f -! -! PURPOSE -! Creates a soft link to an object in a different file. -! -! INPUTS -! -! file_name - Name of the file containing the target object. Neither the file nor the target object is -! required to exist. May be the file the link is being created in. -! obj_name - Path within the target file to the target object. -! link_loc_id - The file or group identifier for the new link. -! link_name - The name of the new link. -! -! OUTPUTS -! hdferr - Returns 0 if successful and -1 if fails -! OPTIONAL PARAMETERS -! lcpl_id - Link creation property list identifier. -! lapl_id - Link access property list identifier. -! -! AUTHOR -! M. Scot Breitenfeld -! February 27, 2008 -! SOURCE - SUBROUTINE h5lcreate_external_f(file_name, obj_name, link_loc_id, link_name, hdferr, lcpl_id, lapl_id) - IMPLICIT NONE - CHARACTER(LEN=*), INTENT(IN) :: file_name ! Name of the file containing the target object. Neither - ! the file nor the target object is required to exist. - ! May be the file the link is being created in. - CHARACTER(LEN=*), INTENT(IN) :: obj_name ! Name of the target object, which must already exist. - INTEGER(HID_T), INTENT(IN) :: link_loc_id ! The file or group identifier for the new link. - CHARACTER(LEN=*), INTENT(IN) :: link_name ! The name of the new link. - - INTEGER, INTENT(OUT) :: hdferr ! Error code: - ! 0 on success and -1 on failure - - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lcpl_id ! Link creation property list identifier. - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list identifier. -!***** - INTEGER(HID_T) :: lcpl_id_default - INTEGER(HID_T) :: lapl_id_default - - INTEGER(SIZE_T) :: file_namelen - INTEGER(SIZE_T) :: obj_namelen - INTEGER(SIZE_T) :: link_namelen - - INTERFACE - INTEGER FUNCTION h5lcreate_external_c(file_name, file_namelen, obj_name, obj_namelen, & - link_loc_id, link_name, link_namelen, lcpl_id_default, lapl_id_default) - - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LCREATE_EXTERNAL_C'::h5lcreate_external_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: file_name, obj_name, link_name - CHARACTER(LEN=*), INTENT(IN) :: file_name - CHARACTER(LEN=*), INTENT(IN) :: obj_name - INTEGER(HID_T), INTENT(IN) :: link_loc_id - CHARACTER(LEN=*), INTENT(IN) :: link_name - INTEGER(SIZE_T) :: file_namelen - INTEGER(SIZE_T) :: obj_namelen - INTEGER(SIZE_T) :: link_namelen - INTEGER(HID_T) :: lcpl_id_default - INTEGER(HID_T) :: lapl_id_default - END FUNCTION h5lcreate_external_c - END INTERFACE - file_namelen = LEN(file_name) - obj_namelen = LEN(obj_name) - link_namelen = LEN(link_name) - - lcpl_id_default = H5P_DEFAULT_F - IF(PRESENT(lcpl_id)) lcpl_id_default = lcpl_id - lapl_id_default = H5P_DEFAULT_F - IF(PRESENT(lapl_id)) lapl_id_default = lapl_id - - hdferr = h5lcreate_external_c(file_name, file_namelen, obj_name, obj_namelen, & - link_loc_id, link_name, link_namelen, lcpl_id_default, lapl_id_default) - - END SUBROUTINE h5lcreate_external_f - -! -!****s* H5L/h5ldelete_by_idx_f -! -! NAME -! h5ldelete_by_idx_f -! -! PURPOSE -! Removes the nth link in a group. -! INPUTS -! loc_id - File or group identifier specifying location of subject group -! group_name - Name of subject group -! index_field - Type of index; Possible values are: -! H5_INDEX_UNKNOWN_F = -1 - Unknown index type -! H5_INDEX_NAME_F - Index on names -! H5_INDEX_CRT_ORDER_F - Index on creation order -! H5_INDEX_N_F - Number of indices defined -! -! order - Order within field or index; Possible values are: -! H5_ITER_UNKNOWN_F - Unknown order -! H5_ITER_INC_F - Increasing order -! H5_ITER_DEC_F - Decreasing order -! H5_ITER_NATIVE_F - No particular order, whatever is fastest -! H5_ITER_N_F - Number of iteration orders -! -! n - Link for which to retrieve information -! OUTPUTS -! hdferr - Returns 0 if successful and -1 if fails -! OPTIONAL PARAMETERS -! lapl_id - Link access property list -! -! AUTHOR -! M. Scot Breitenfeld -! February 29, 2008 -! SOURCE - SUBROUTINE h5ldelete_by_idx_f(loc_id, group_name, index_field, order, n, hdferr, lapl_id) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id ! Identifer for object to which attribute is attached - CHARACTER(LEN=*), INTENT(IN) :: group_name ! Name of object, relative to location, - ! from which attribute is to be removed - INTEGER, INTENT(IN) :: index_field ! Type of index; Possible values are: - ! H5_INDEX_UNKNOWN_F - Unknown index type - ! H5_INDEX_NAME_F - Index on names - ! H5_INDEX_CRT_ORDER_F - Index on creation order - ! H5_INDEX_N_F - Number of indices defined - INTEGER, INTENT(IN) :: order ! Order in which to iterate over index; Possible values are: - ! H5_ITER_UNKNOWN_F - Unknown order - ! H5_ITER_INC_F - Increasing order - ! H5_ITER_DEC_F - Decreasing order - ! H5_ITER_NATIVE_F - No particular order, whatever is fastest - ! H5_ITER_N_F - Number of iteration orders - INTEGER(HSIZE_T), INTENT(IN) :: n ! Offset within index - INTEGER, INTENT(OUT) :: hdferr ! Error code: - ! 0 on success and -1 on failure - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list -!***** - INTEGER(HID_T) :: lapl_id_default - INTEGER(SIZE_T) :: group_namelen - - INTERFACE - INTEGER FUNCTION h5ldelete_by_idx_c(loc_id, group_name, group_namelen, index_field, order, n, lapl_id_default) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LDELETE_BY_IDX_C'::h5ldelete_by_idx_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: group_name - INTEGER(HID_T), INTENT(IN) :: loc_id - CHARACTER(LEN=*), INTENT(IN) :: group_name - INTEGER, INTENT(IN) :: index_field - INTEGER, INTENT(IN) :: order - INTEGER(HSIZE_T), INTENT(IN) :: n - INTEGER(HID_T) :: lapl_id_default - INTEGER(SIZE_T) :: group_namelen - END FUNCTION h5ldelete_by_idx_c - END INTERFACE - - lapl_id_default = H5P_DEFAULT_F - IF(PRESENT(lapl_id)) lapl_id_default = lapl_id - - group_namelen = LEN(group_name) - hdferr = h5ldelete_by_idx_c(loc_id, group_name, group_namelen, index_field, order, n, lapl_id_default) - - END SUBROUTINE h5ldelete_by_idx_f - -! -!****s* H5L/H5Lexists_f -! -! NAME -! H5Lexists_f -! -! PURPOSE -! Check if a link with a particular name exists in a group. -! -! INPUTS -! loc_id - Identifier of the file or group to query. -! name - Link name to check -! -! OUTPUTS -! link_exists - link exists status (.TRUE.,.FALSE.) -! hdferr - Returns 0 if successful and -1 if fails -! OPTIONAL PARAMETERS -! lapl_id - Link access property list identifier. -! -! AUTHOR -! M. Scot Breitenfeld -! February 29, 2008 -! -! SOURCE - SUBROUTINE h5lexists_f(loc_id, name, link_exists, hdferr, lapl_id) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id ! Identifier of the file or group to query. - CHARACTER(LEN=*), INTENT(IN) :: name ! Link name to check. - LOGICAL, INTENT(OUT) :: link_exists ! .TRUE. if exists, .FALSE. otherwise - INTEGER, INTENT(OUT) :: hdferr ! Error code: - ! 0 on success and -1 on failure - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id - ! Link access property list identifier. -!***** - INTEGER :: link_exists_c - INTEGER(HID_T) :: lapl_id_default - INTEGER(SIZE_T) :: namelen - - INTERFACE - INTEGER FUNCTION h5lexists_c(loc_id, name, namelen, lapl_id_default, link_exists_c) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LEXISTS_C'::h5lexists_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: name - INTEGER(HID_T), INTENT(IN) :: loc_id - CHARACTER(LEN=*), INTENT(IN) :: name - INTEGER(SIZE_T), INTENT(IN) :: namelen - INTEGER, INTENT(OUT) :: link_exists_c - INTEGER(HID_T) :: lapl_id_default - - END FUNCTION h5lexists_c - END INTERFACE - - namelen = LEN(name) - - lapl_id_default = H5P_DEFAULT_F - IF(PRESENT(lapl_id)) lapl_id_default = lapl_id - - hdferr = h5lexists_c(loc_id, name, namelen, lapl_id_default, link_exists_c) - - link_exists = .FALSE. - IF(link_exists_c.GT.0) link_exists = .TRUE. - - END SUBROUTINE h5lexists_f - -! -!****s* H5L/h5lget_info_f -! -! NAME -! h5lget_info_f -! -! PURPOSE -! Returns information about a link. -! -! INPUTS -! link_loc_id - File or group identifier. -! link_name - Name of the link for which information is being sought -! -! OUTPUTS -! NOTE: In C these are contained in the structure H5L_info_t -! -! cset - indicates the character set used for link’s name. -! corder - specifies the link’s creation order position. -! corder_valid - indicates whether the value in corder is valid. -! link_type - specifies the link class: -! H5L_TYPE_HARD_F - Hard link -! H5L_TYPE_SOFT_F - Soft link -! H5L_TYPE_EXTERNAL_F - External link -! H5L_TYPE_ERROR_ F - Error -! address - If the link is a hard link, address specifies the file address that the link points to -! val_size - If the link is a symbolic link, val_size will be the length of the link value, e.g., -! the length of the name of the pointed-to object with a null terminator. -! hdferr - Returns 0 if successful and -1 if fails -! -! OPTIONAL PARAMETERS -! lapl_id - Link access property list -! -! AUTHOR -! M. Scot Breitenfeld -! February 29, 2008 -! -! HISTORY -! Changed the link_type names to match those in C (bug 1720) from, -! H5L_LINK_HARD_F, H5L_LINK_SOFT_F,H5L_LINK_EXTERNAL_F,H5L_LINK_ERROR_F -! to -! H5L_TYPE_HARD_F, H5L_TYPE_SOFT_F,H5L_TYPE_EXTERNAL_F,H5L_TYPE_ERROR_F -! MSB January 8, 2010. -! -! SOURCE - SUBROUTINE h5lget_info_f(link_loc_id, link_name, & - cset, corder, f_corder_valid, link_type, address, val_size, & - hdferr, lapl_id) - IMPLICIT NONE - - INTEGER(HID_T), INTENT(IN) :: link_loc_id ! File or group identifier. - CHARACTER(LEN=*), INTENT(IN) :: link_name ! Name of the link for which information is being sought - -! OUTPUTS NOTE: In C these are contained in the structure H5L_info_t - INTEGER, INTENT(OUT) :: cset ! Indicates the character set used for the link’s name. - INTEGER, INTENT(OUT) :: corder ! Specifies the link’s creation order position. - LOGICAL, INTENT(OUT) :: f_corder_valid ! Indicates whether the value in corder is valid. - INTEGER, INTENT(OUT) :: link_type ! Specifies the link class: - ! H5L_TYPE_HARD_F - Hard link - ! H5L_TYPE_SOFT_F - Soft link - ! H5L_TYPE_EXTERNAL_F - External link - ! H5L_TYPE_ERROR _F - Error - INTEGER(HADDR_T), INTENT(OUT) :: address ! If the link is a hard link, address specifies the file address that the link points to - INTEGER(SIZE_T), INTENT(OUT) :: val_size ! If the link is a symbolic link, val_size will be the length of the link value, e.g., - ! the length of the name of the pointed-to object with a null terminator. - INTEGER, INTENT(OUT) :: hdferr ! Error code: - ! 0 on success and -1 on failure - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list -!***** - INTEGER(SIZE_T) :: link_namelen - INTEGER(HID_T) :: lapl_id_default - INTEGER :: corder_valid - - INTERFACE - INTEGER FUNCTION h5lget_info_c(link_loc_id, link_name, link_namelen, & - cset, corder, corder_valid, link_type, address, val_size, & - lapl_id_default) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LGET_INFO_C'::h5lget_info_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: link_name - INTEGER(HID_T), INTENT(IN) :: link_loc_id - CHARACTER(LEN=*), INTENT(IN) :: link_name - INTEGER, INTENT(OUT) :: cset - INTEGER, INTENT(OUT) :: corder - INTEGER, INTENT(OUT) :: link_type - INTEGER(HADDR_T), INTENT(OUT) :: address - INTEGER(SIZE_T), INTENT(OUT) :: val_size - INTEGER(HID_T) :: lapl_id_default - INTEGER(SIZE_T) :: link_namelen - INTEGER :: corder_valid - END FUNCTION h5lget_info_c - END INTERFACE - - link_namelen = LEN(link_name) - - lapl_id_default = H5P_DEFAULT_F - IF(PRESENT(lapl_id)) lapl_id_default = lapl_id - - hdferr = h5lget_info_c(link_loc_id, link_name, link_namelen, & - cset, corder, corder_valid, link_type, & - address, val_size, & - lapl_id_default) - - f_corder_valid =.FALSE. - IF(corder_valid .EQ. 1) f_corder_valid =.TRUE. - - END SUBROUTINE h5lget_info_f - -! -!****s* H5L/h5lget_info_by_idx_f -! -! NAME -! h5lget_info_by_idx_f -! -! PURPOSE -! Retrieves metadata for a link in a group, according to the order within a field or index. -! -! INPUTS -! loc_id - File or group identifier specifying location of subject group -! group_name - Name of subject group -! index_field - Index or field which determines the order -! order - Order within field or index -! n - Link for which to retrieve information -! -! OUTPUTS -! NOTE: In C these are defined as a structure: H5L_info_t -! corder_valid - Indicates whether the creation order data is valid for this attribute -! corder - Is a positive integer containing the creation order of the attribute -! cset - Indicates the character set used for the attribute’s name -! address - If the link is a hard link, address specifies the file address that the link points to -! val_size - If the link is a symbolic link, val_size will be the length of the link value, e.g., -! the length of the name of the pointed-to object with a null terminator. -! hdferr - Returns 0 if successful and -1 if fails -! -! OPTIONAL PARAMETERS -! lapl_id - Link access property list -! -! AUTHOR -! M. Scot Breitenfeld -! February 29, 2008 -! -! HISTORY -! Changed the link_type names to match those in C (bug 1720) from, -! H5L_LINK_HARD_F, H5L_LINK_SOFT_F,H5L_LINK_EXTERNAL_F,H5L_LINK_ERROR_F -! to -! H5L_TYPE_HARD_F, H5L_TYPE_SOFT_F,H5L_TYPE_EXTERNAL_F,H5L_TYPE_ERROR_F -! MSB January 8, 2010. -! -! SOURCE - SUBROUTINE h5lget_info_by_idx_f(loc_id, group_name, index_field, order, n, & - link_type, f_corder_valid, corder, cset, address, val_size, hdferr, lapl_id) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier specifying location of subject group - CHARACTER(LEN=*), INTENT(IN) :: group_name ! Name of subject group - INTEGER, INTENT(IN) :: index_field ! Index or field which determines the order - ! H5_INDEX_UNKNOWN_F - Unknown index type - ! H5_INDEX_NAME_F - Index on names - ! H5_INDEX_CRT_ORDER_F - Index on creation order - ! H5_INDEX_N_F - Number of indices defined - INTEGER, INTENT(IN) :: order ! Order in which to iterate over index; Possible values are: - ! H5_ITER_UNKNOWN_F - Unknown order - ! H5_ITER_INC_F - Increasing order - ! H5_ITER_DEC_F - Decreasing order - ! H5_ITER_NATIVE_F - No particular order, whatever is fastest - INTEGER(HSIZE_T), INTENT(IN) :: n ! Attribute’s position in index - INTEGER, INTENT(OUT) :: link_type ! Specifies the link class: - ! H5L_TYPE_HARD_F - Hard link - ! H5L_TYPE_SOFT_F - Soft link - ! H5L_TYPE_EXTERNAL_F - External link - ! H5L_TYPE_ERROR _F - Error - LOGICAL, INTENT(OUT) :: f_corder_valid ! Indicates whether the creation order data is valid for this attribute - INTEGER, INTENT(OUT) :: corder ! Is a positive integer containing the creation order of the attribute - INTEGER, INTENT(OUT) :: cset ! Indicates the character set used for the attribute’s name - INTEGER(HADDR_T), INTENT(OUT) :: address ! If the link is a hard link, address specifies the file address that the link points to - INTEGER(SIZE_T), INTENT(OUT) :: val_size ! If the link is a symbolic link, val_size will be the length of the link value, e.g., - ! the length of the name of the pointed-to object with a null terminator. - INTEGER, INTENT(OUT) :: hdferr ! Error code: - ! 0 on success and -1 on failure - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list -!***** - INTEGER :: corder_valid - INTEGER(SIZE_T) :: group_namelen - INTEGER(HID_T) :: lapl_id_default - -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5lget_info_by_idx_c(loc_id, group_name, group_namelen, index_field, order, n, & - link_type, corder_valid, corder, cset, address, val_size, lapl_id_default) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LGET_INFO_BY_IDX_C'::h5lget_info_by_idx_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: group_name - INTEGER(HID_T), INTENT(IN) :: loc_id - CHARACTER(LEN=*), INTENT(IN) :: group_name - INTEGER(SIZE_T) :: group_namelen - INTEGER, INTENT(IN) :: index_field - INTEGER, INTENT(IN) :: order - INTEGER(HSIZE_T), INTENT(IN) :: n - INTEGER, INTENT(OUT) :: link_type - INTEGER :: corder_valid - INTEGER, INTENT(OUT) :: corder - INTEGER, INTENT(OUT) :: cset - INTEGER(HADDR_T), INTENT(OUT) :: address - INTEGER(SIZE_T), INTENT(OUT) :: val_size - INTEGER(HID_T) :: lapl_id_default - END FUNCTION h5lget_info_by_idx_c - END INTERFACE - - group_namelen = LEN(group_name) - - lapl_id_default = H5P_DEFAULT_F - IF(PRESENT(lapl_id)) lapl_id_default = lapl_id - - hdferr = h5lget_info_by_idx_c(loc_id, group_name, group_namelen, index_field, order, n, & - link_type, corder_valid, corder, cset, address, val_size, lapl_id_default) - - f_corder_valid =.FALSE. - IF (corder_valid .EQ. 1) f_corder_valid =.TRUE. - - END SUBROUTINE h5lget_info_by_idx_f - -! -!****s* H5L/h5lis_registered_f -! -! NAME -! h5lis_registered_f -! -! PURPOSE -! Determines whether a class of user-defined links is registered. -! -! INPUTS -! link_cls_id - User-defined link class identifier -! -! OUTPUTS -! registered - .TRUE. - if the link class has been registered -! .FALSE. - if it is unregistered -! hdferr - Error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! M. Scot Breitenfeld -! February 29, 2008 -! -! SOURCE - SUBROUTINE h5lis_registered_f(link_cls_id, registered, hdferr) - IMPLICIT NONE - INTEGER, INTENT(IN) :: link_cls_id ! User-defined link class identifier - LOGICAL, INTENT(OUT) :: registered ! .TRUE. - if the link class has been registered and - ! .FALSE. - if it is unregistered - INTEGER, INTENT(OUT) :: hdferr ! Error code: - ! 0 on success and -1 on failure -!***** - INTERFACE - INTEGER FUNCTION h5lis_registered_c(link_cls_id) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LIS_REGISTERED_C'::h5lis_registered_c - !DEC$ENDIF - INTEGER, INTENT(IN) :: link_cls_id ! User-defined link class identifier - END FUNCTION h5lis_registered_c - END INTERFACE - - hdferr = h5lis_registered_c(link_cls_id) - - IF(hdferr.GT.0)THEN - registered = .TRUE. - ELSE IF(hdferr.EQ.0)THEN - registered = .FALSE. - ENDIF - - END SUBROUTINE h5lis_registered_f - -! -!****s* H5L/h5lmove_f -! -! NAME -! h5lmove_f -! -! PURPOSE -! Renames a link within an HDF5 file. -! -! INPUTS -! src_loc_id - Original file or group identifier. -! src_name - Original link name. -! dest_loc_id - Destination file or group identifier. -! dest_name - NEW link name. -! -! OUTPUTS -! hdferr - Error code: -! 0 on success and -1 on failure -! -! OPTIONAL PARAMETERS -! lcpl_id - Link creation property list identifier to be associated WITH the NEW link. -! lapl_id - Link access property list identifier to be associated WITH the NEW link. -! -! AUTHOR -! M. Scot Breitenfeld -! March 3, 2008 -! -! SOURCE - SUBROUTINE h5lmove_f(src_loc_id, src_name, dest_loc_id, dest_name, hdferr, lcpl_id, lapl_id) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: src_loc_id ! Original file or group identifier. - CHARACTER(LEN=*), INTENT(IN) :: src_name ! Original link name. - INTEGER(HID_T), INTENT(IN) :: dest_loc_id ! Destination file or group identifier. - CHARACTER(LEN=*), INTENT(IN) :: dest_name ! NEW link name. - INTEGER, INTENT(OUT) :: hdferr ! Error code: - ! 0 on success and -1 on failure - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lcpl_id ! Link creation property list identifier - ! to be associated WITH the NEW link. - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list identifier - ! to be associated WITH the NEW link. -!***** - INTEGER(SIZE_T) :: src_namelen - INTEGER(SIZE_T) :: dest_namelen - - INTEGER(HID_T) :: lcpl_id_default - INTEGER(HID_T) :: lapl_id_default - - INTERFACE - INTEGER FUNCTION h5lmove_c(src_loc_id, src_name, src_namelen, dest_loc_id, & - dest_name, dest_namelen, lcpl_id_default, lapl_id_default) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LMOVE_C'::h5lmove_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: src_name, dest_name - INTEGER(HID_T), INTENT(IN) :: src_loc_id - - CHARACTER(LEN=*), INTENT(IN) :: src_name - INTEGER(SIZE_T) :: src_namelen - INTEGER(HID_T), INTENT(IN) :: dest_loc_id - CHARACTER(LEN=*), INTENT(IN) :: dest_name - INTEGER(SIZE_T) :: dest_namelen - - INTEGER(HID_T) :: lcpl_id_default - INTEGER(HID_T) :: lapl_id_default - - END FUNCTION h5lmove_c - END INTERFACE - - lcpl_id_default = H5P_DEFAULT_F - IF(PRESENT(lcpl_id)) lcpl_id_default = lcpl_id - lapl_id_default = H5P_DEFAULT_F - IF(PRESENT(lapl_id)) lapl_id_default = lapl_id - - src_namelen = LEN(src_name) - dest_namelen = LEN(dest_name) - - hdferr = H5Lmove_c(src_loc_id, src_name, src_namelen, dest_loc_id, & - dest_name, dest_namelen, lcpl_id_default, lapl_id_default) - - END SUBROUTINE h5lmove_f - -! -!****s* H5L/h5lget_name_by_idx_f -! -! NAME -! h5lget_name_by_idx_f -! -! PURPOSE -! Retrieves name of the nth link in a group, according to the order within a specified field or index. -! -! INPUTS -! loc_id - File or group identifier specifying location of subject group -! group_name - Name of subject group -! index_field - Index or field which determines the order -! order - Order within field or index -! n - Link for which to retrieve information -! -! OUTPUTS -! name - Buffer in which link value is returned -! hdferr - Returns 0 if successful and -1 if fails -! -! OPTIONAL PARAMETERS -! lapl_id - List access property list identifier. -! size - Maximum number of characters of link value to be returned. -! -! AUTHOR -! M. Scot Breitenfeld -! March 10, 2008 -! -! SOURCE - SUBROUTINE h5lget_name_by_idx_f(loc_id, group_name, index_field, order, n, & - name, hdferr, size, lapl_id) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier specifying location of subject group - CHARACTER(LEN=*), INTENT(IN) :: group_name ! Name of subject group - INTEGER, INTENT(IN) :: index_field ! Index or field which determines the order - ! H5_INDEX_UNKNOWN_F - Unknown index type - ! H5_INDEX_NAME_F - Index on names - ! H5_INDEX_CRT_ORDER_F - Index on creation order - ! H5_INDEX_N_F - Number of indices defined - INTEGER, INTENT(IN) :: order ! Order in which to iterate over index; Possible values are: - ! H5_ITER_UNKNOWN_F - Unknown order - ! H5_ITER_INC_F - Increasing order - ! H5_ITER_DEC_F - Decreasing order - ! H5_ITER_NATIVE_F - No particular order, whatever is fastest - INTEGER(HSIZE_T), INTENT(IN) :: n ! Attribute’s position in index - CHARACTER(LEN=*), INTENT(OUT) :: name ! Buffer in which link value is returned - INTEGER, INTENT(OUT) :: hdferr ! Error code: - ! 0 on success and -1 on failure -!***** - INTEGER(SIZE_T) :: group_namelen - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list - INTEGER(HID_T) :: lapl_id_default - INTEGER(SIZE_T), OPTIONAL, INTENT(OUT) :: size ! Indicates the size, in the number of characters, of the link - INTEGER(SIZE_T) :: size_default - - INTERFACE - INTEGER FUNCTION h5lget_name_by_idx_c(loc_id, group_name, group_namelen, index_field, order, n, & - size_default, name, lapl_id_default) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LGET_NAME_BY_IDX_C'::h5lget_name_by_idx_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: group_name, name - INTEGER(HID_T), INTENT(IN) :: loc_id - - CHARACTER(LEN=*), INTENT(IN) :: group_name - INTEGER(SIZE_T) :: group_namelen - INTEGER, INTENT(IN) :: index_field - INTEGER, INTENT(IN) :: order - INTEGER(HSIZE_T), INTENT(IN) :: n - INTEGER(SIZE_T) :: size_default - CHARACTER(LEN=*), INTENT(OUT) :: name - INTEGER(HID_T) :: lapl_id_default - END FUNCTION h5lget_name_by_idx_c - END INTERFACE - - group_namelen = LEN(group_name) - - lapl_id_default = H5P_DEFAULT_F - IF(PRESENT(lapl_id)) lapl_id_default = lapl_id - - size_default = LEN(name) - - hdferr = h5lget_name_by_idx_c(loc_id, group_name, group_namelen, index_field, order, n, & - size_default, name, lapl_id_default) - - IF(PRESENT(size)) size = size_default - - - END SUBROUTINE h5lget_name_by_idx_f - - -! HAS PROBLEM WITH void pointer in C -!!$! -!!$!****s* H5L/ -!!$! -!!$! NAME -!!$! h5lget_val_by_idx_f -!!$! -!!$! PURPOSE -!!$! Returns the link value of a link, according to the order of -!!$! an index. For symbolic links, this is the path to which the -!!$! link points, including the null terminator. For user-defined -!!$! links, it is the link buffer. -!!$! INPUTS -!!$! loc_id - File or group identifier specifying location of subject group -!!$! group_name - Name of subject group -!!$! index_field - Index or field which determines the order -!!$! order - Order within field or index -!!$! n - Link for which to retrieve information -!!$! size - Maximum number of characters of link value to be returned. -!!$! -!!$! OUTPUTS NOTE: In C these are defined as a structure: H5L_info_t -!!$! corder_valid - indicates whether the creation order data is valid for this attribute -!!$! corder - is a positive integer containing the creation order of the attribute -!!$! cset - indicates the character set used for the attribute’s name -!!$! data_size - indicates the size, in the number of characters, of the attribute -!!$! hdferr - error code -!!$! Success: 0 -!!$! Failure: -1 -!!$! OPTIONAL PARAMETERS -!!$! lapl_id - List access property list identifier. -!!$! -!!$! AUTHOR -!!$! M. Scot Breitenfeld -!!$! March 3, 2008 -!!$! -!!$! HISTORY N/A -!!$! -!!$! -!!$! SOURCE -!!$ SUBROUTINE h5lget_val_by_idx_f(loc_id, group_name, index_field, order, n, & -!!$ f_corder_valid, corder, cset, data_size, hdferr, lapl_id) -!!$ IMPLICIT NONE -!!$ INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier specifying location of subject group -!!$ CHARACTER(LEN=*), INTENT(IN) :: group_name ! Name of subject group -!!$ INTEGER, INTENT(IN) :: index_field ! Index or field which determines the order -!!$ ! H5_INDEX_UNKNOWN_F - Unknown index type -!!$ ! H5_INDEX_NAME_F - Index on names -!!$ ! H5_INDEX_CRT_ORDER_F - Index on creation order -!!$ ! H5_INDEX_N_F - Number of indices defined -!!$ INTEGER, INTENT(IN) :: order ! Order in which to iterate over index; Possible values are: -!!$ ! H5_ITER_UNKNOWN_F - Unknown order -!!$ ! H5_ITER_INC_F - Increasing order -!!$ ! H5_ITER_DEC_F - Decreasing order -!!$ ! H5_ITER_NATIVE_F - No particular order, whatever is fastest -!!$ INTEGER(HSIZE_T), INTENT(IN) :: n ! Attribute’s position in index -!!$ LOGICAL, INTENT(OUT) :: f_corder_valid ! Indicates whether the creation order data is valid for this attribute -!!$ INTEGER, INTENT(OUT) :: corder ! Is a positive integer containing the creation order of the attribute -!!$ INTEGER, INTENT(OUT) :: cset ! Indicates the character set used for the attribute’s name -!!$ INTEGER(HSIZE_T), INTENT(OUT) :: data_size ! Indicates the size, in the number of characters, of the attribute -!!$ INTEGER, INTENT(OUT) :: hdferr ! Error code: -!!$ ! 0 on success and -1 on failure -!!$ INTEGER :: corder_valid -!!$ INTEGER(SIZE_T) :: group_namelen -!!$ INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list -!!$ INTEGER(HID_T) :: lapl_id_default -!!$ -!!$ INTERFACE -!!$ INTEGER FUNCTION h5lget_val_by_idx_c(loc_id, group_name, group_namelen, index_field, order, n, & -!!$ corder_valid, corder, cset, data_size, lapl_id_default) -!!$ USE H5GLOBAL -!!$ !DEC$IF DEFINED(HDF5F90_WINDOWS) -!!$ !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LGET_VAL_BY_IDX_C'::h5lget_val_by_idx_c -!!$ !DEC$ENDIF -!!$ INTEGER(HID_T), INTENT(IN) :: loc_id -!!$ CHARACTER(LEN=*), INTENT(IN) :: group_name -!!$ INTEGER(SIZE_T) :: group_namelen -!!$ INTEGER, INTENT(IN) :: index_field -!!$ INTEGER, INTENT(IN) :: order -!!$ INTEGER(HSIZE_T), INTENT(IN) :: n -!!$ INTEGER :: corder_valid -!!$ INTEGER, INTENT(OUT) :: corder -!!$ INTEGER, INTENT(OUT) :: cset -!!$ INTEGER(HSIZE_T), INTENT(OUT) :: data_size -!!$ INTEGER(HID_T) :: lapl_id_default -!!$ END FUNCTION h5lget_val_by_idx_c -!!$ END INTERFACE -!!$ -!!$ group_namelen = LEN(group_name) -!!$ -!!$ lapl_id_default = H5P_DEFAULT_F -!!$ IF(PRESENT(lapl_id)) lapl_id_default = lapl_id -!!$ -!!$ hdferr = h5lget_info_by_idx_c(loc_id, group_name, group_namelen, index_field, order, n, & -!!$ corder_valid, corder, cset, data_size, lapl_id_default) -!!$ -!!$ f_corder_valid =.FALSE. -!!$ IF (corder_valid .EQ. 1) f_corder_valid =.TRUE. -!!$ -!!$ END SUBROUTINE h5lget_val_by_idx_f - -!!$! -!!$!****s* H5L/h5lget_val_f -!!$! -!!$! NAME -!!$! h5lget_val_f -!!$! -!!$! PURPOSE -!!$! Returns the value of a symbolic link. -!!$! -!!$! INPUTS -!!$! link_loc_id - File or group identifier. -!!$! link_name - Link whose value is to be returned. -!!$! size - Maximum number of characters of link value to be returned. -!!$! -!!$! OUTPUTS -!!$! linkval_buff - The buffer to hold the returned link value. -!!$! hdferr - error code -!!$! Success: 0 -!!$! Failure: -1 -!!$! OPTIONAL PARAMETERS -!!$! lapl_id - List access property list identifier. -!!$! -!!$! AUTHOR -!!$! M. Scot Breitenfeld -!!$! March 3, 2008 -!!$! SOURCE -!!$ SUBROUTINE h5lget_val_f(link_loc_id, link_name, size, linkval_buff, & -!!$ hdferr, lapl_id) -!!$ IMPLICIT NONE -!!$ INTEGER(HID_T), INTENT(IN) :: link_loc_id ! File or group identifier. -!!$ CHARACTER(LEN=*), INTENT(IN) :: link_name ! Link whose value is to be returned. -!!$ INTEGER(SIZE_T), INTENT(IN) :: size ! Maximum number of characters of link value to be returned. -!!$ -!!$ CHARACTER(LEN=size), INTENT(OUT) :: linkval_buff ! The buffer to hold the returned link value. -!!$ INTEGER, INTENT(OUT) :: hdferr ! Error code: -!!$ ! 0 on success and -1 on failure -!!$ INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list -!!$ -!!$ INTEGER :: link_namelen -!!$ INTEGER(HID_T) :: lapl_id_default -!!$ INTEGER :: corder_valid -!!$ -!!$ INTEGER :: link_namelen -!!$ INTEGER(HID_T) :: lapl_id_default -!!$ -!!$! MS FORTRAN needs explicit interface for C functions called here. -!!$! -!!$ INTERFACE -!!$ INTEGER FUNCTION h5lget_val_c(link_loc_id, link_name, link_namelen, size, linkval_buff, & -!!$ lapl_id_default) -!!$ USE H5GLOBAL -!!$ !DEC$IF DEFINED(HDF5F90_WINDOWS) -!!$ !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LGET_VAL_C'::h5lget_val_c -!!$ !DEC$ENDIF -!!$ INTEGER(HID_T), INTENT(IN) :: link_loc_id ! File or group identifier. -!!$ CHARACTER(LEN=*), INTENT(IN) :: link_name ! Link whose value is to be returned. -!!$ INTEGER :: link_namelen -!!$ INTEGER(SIZE_T), INTENT(IN) :: size ! Maximum number of characters of link value to be returned. -!!$ -!!$ CHARACTER(LEN=size), INTENT(OUT) :: linkval_buff ! The buffer to hold the returned link value. -!!$ -!!$ INTEGER :: link_namelen -!!$ INTEGER(HID_T) :: lapl_id_default -!!$ -!!$ END FUNCTION h5lget_val_c -!!$ END INTERFACE -!!$ -!!$ link_namelen = LEN(link_name) -!!$ -!!$ lapl_id_default = H5P_DEFAULT_F -!!$ IF(PRESENT(lapl_id)) lapl_id_default = lapl_id -!!$ -!!$ hdferr = h5lget_val_c(link_loc_id, link_name, link_namelen, size, linkval_buff, & -!!$ lapl_id_default) -!!$ -!!$ END SUBROUTINE h5lget_val_f - -!!$! -!!$!****s* H5L/H5Lregistered_f -!!$! -!!$! NAME -!!$! H5Lregistered_f -!!$! -!!$! PURPOSE -!!$! Registers user-defined link class or changes behavior of existing class. -!!$! -!!$! INPUTS NOTE: In C the following represents struct H5L_class_t: -!!$! version - Version number of this struct -!!$! class_id - Link class identifier -!!$! comment - Comment for debugging -!!$! create_func - Callback during link creation -!!$! move_func - Callback after moving link -!!$! copy_func - Callback after copying link -!!$! trav_func - The main traversal function -!!$! del_func - Callback for link deletion -!!$! query_func - Callback for queries -!!$! -!!$! OUTPUTS -!!$! hdferr - Error code -!!$! Success: 0 -!!$! Failure: -1 -!!$! OPTIONAL PARAMETERS -!!$! None -!!$! -!!$! AUTHOR -!!$! M. Scot Breitenfeld -!!$! February 29, 2008 -!!$! -!!$! HISTORY N/A -!!$! -!!$! -!!$! SOURCE -!!$ SUBROUTINE H5Lregistered_f(version, class_id, comment, create_func, & -!!$ move_func, copy_func, trav_func, del_func, query_func, hdferr) -!!$ IMPLICIT NONE -!!$ INTEGER, INTENT(IN) :: version ! Version number of this struct -!!$ INTEGER, INTENT(IN) :: class_id ! Link class identifier -!!$ CHARACTER(LEN=*), INTENT(IN) :: comment ! Comment for debugging -!!$ CHARACTER(LEN=*), INTENT(IN) :: create_func ! Callback during link creation -!!$ CHARACTER(LEN=*), INTENT(IN) :: move_func ! Callback after moving link -!!$ CHARACTER(LEN=*), INTENT(IN) :: copy_func ! Callback after copying link -!!$ CHARACTER(LEN=*), INTENT(IN) :: trav_func ! The main traversal function -!!$ CHARACTER(LEN=*), INTENT(IN) :: del_func ! Callback for link deletion -!!$ CHARACTER(LEN=*), INTENT(IN) :: query_func ! Callback for queries -!!$ INTEGER, INTENT(OUT) :: hdferr ! Error code: -!!$ ! 0 on success and -1 on failure -!!$ INTEGER :: comment_len -!!$ INTEGER :: create_func_len -!!$ INTEGER :: move_func_len -!!$ INTEGER :: copy_func_len -!!$ INTEGER :: trav_func_len -!!$ INTEGER :: del_func_len -!!$ INTEGER :: query_func_len -!!$ -!!$ INTERFACE -!!$ INTEGER FUNCTION H5Lregistered_c(version, class_id, comment, & -!!$ create_func, create_func_len, & -!!$ move_func, move_func_len, & -!!$ copy_func, copy_func_len, & -!!$ trav_func, trav_func_len, & -!!$ del_func, del_func_len, & -!!$ query_func,query_func_len) -!!$ USE H5GLOBAL -!!$ !DEC$IF DEFINED(HDF5F90_WINDOWS) -!!$ !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LREGISTERED_C'::H5Lregistered_c -!!$ !DEC$ENDIF -!!$ INTEGER, INTENT(IN) :: version ! Version number of this struct -!!$ INTEGER, INTENT(IN) :: class_id ! Link class identifier -!!$ CHARACTER(LEN=*), INTENT(IN) :: comment ! Comment for debugging -!!$ CHARACTER(LEN=*), INTENT(IN) :: create_func ! Callback during link creation -!!$ CHARACTER(LEN=*), INTENT(IN) :: move_func ! Callback after moving link -!!$ CHARACTER(LEN=*), INTENT(IN) :: copy_func ! Callback after copying link -!!$ CHARACTER(LEN=*), INTENT(IN) :: trav_func ! The main traversal function -!!$ CHARACTER(LEN=*), INTENT(IN) :: del_func ! Callback for link deletion -!!$ CHARACTER(LEN=*), INTENT(IN) :: query_func ! Callback for queries -!!$ INTEGER, INTENT(OUT) :: hdferr ! Error code: -!!$ ! 0 on success and -1 on failure -!!$ INTEGER :: comment_len -!!$ INTEGER :: create_func_len -!!$ INTEGER :: move_func_len -!!$ INTEGER :: copy_func_len -!!$ INTEGER :: trav_func_len -!!$ INTEGER :: del_func_len -!!$ INTEGER :: query_func_len -!!$ -!!$ END FUNCTION H5Lregistered_c -!!$ END INTERFACE -!!$ -!!$ comment_len = LEN(comment) -!!$ create_func_len = LEN(create_func) -!!$ move_func_len = LEN(move_func) -!!$ copy_func_len = LEN(copy_func) -!!$ trav_func_len = LEN(trav_func) -!!$ del_func_len = LEN(del_func) -!!$ query_func_len = LEN(query_func) -!!$ -!!$ hdferr = H5Lregistered_c(version, class_id, comment, & -!!$ create_func, create_func_len, & -!!$ move_func, move_func_len, & -!!$ copy_func, copy_func_len, & -!!$ trav_func, trav_func_len, & -!!$ del_func, del_func_len, & -!!$ query_func, query_func_len) -!!$ -!!$ END SUBROUTINE H5Lregistered_f - -END MODULE H5L diff --git a/fortran/src/H5Lff_F03.f90 b/fortran/src/H5Lff_F03.f90 deleted file mode 100644 index fa95717..0000000 --- a/fortran/src/H5Lff_F03.f90 +++ /dev/null @@ -1,242 +0,0 @@ -!****h* ROBODoc/H5L (F03) -! -! NAME -! H5L_PROVISIONAL -! -! FILE -! src/fortran/src/H5Lff_F03.f90 -! -! PURPOSE -! -! This file contains Fortran 90 and Fortran 2003 interfaces for H5L functions. -! It contains the same functions as H5Lff_F90.f90 but includes the -! Fortran 2003 functions and the interface listings. This file will be compiled -! instead of H5Lff_F90.f90 if Fortran 2003 functions are enabled. -! -! 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. * -! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -! -! NOTES -! *** IMPORTANT *** -! If you add a new H5A function you must add the function name to the -! Windows dll file 'hdf5_fortrandll.def.in' in the fortran/src directory. -! This is needed for Windows based operating systems. -! -!***** - -MODULE H5L_PROVISIONAL - - USE H5GLOBAL - USE ISO_C_BINDING - - IMPLICIT NONE - -!****t* H5L (F03)/h5l_info_t -! -! Fortran2003 Derived Type: -! - TYPE, bind(c) :: union_t - INTEGER(haddr_t) :: address - INTEGER(size_t) :: val_size - END TYPE union_t - - TYPE, bind(c) :: h5l_info_t - INTEGER(c_int) :: type ! H5L_type_t type -! LOGICAL(c_bool) :: corder_valid ! hbool_t corder_valid - INTEGER(c_int64_t) :: corder ! int64_t corder; - INTEGER(c_int) :: cset ! H5T_cset_t cset; - TYPE(union_t) :: u - END TYPE h5l_info_t - -!***** - -!type specifies the link class. Valid values include the following: -! H5L_TYPE_HARD Hard link -! H5L_TYPE_SOFT Soft link -! H5L_TYPE_EXTERNAL External link -! H5L_TYPE_ERROR Error -!cset specifies the character set in which the link name is encoded. Valid values include the following: -! H5T_CSET_ASCII US ASCII -! H5T_CSET_UTF8 UTF-8 Unicode encoding - -CONTAINS - -!****s* H5L (F03)/h5literate_f -! -! NAME -! h5literate_f -! -! PURPOSE -! Iterates through links in a group. -! -! Inputs: -! group_id - Identifier specifying subject group -! index_type - Type of index which determines the order: -! H5_INDEX_NAME_F - Alpha-numeric index on name -! H5_INDEX_CRT_ORDER_F - Index on creation order -! order - Order within index: -! H5_ITER_INC_F - Increasing order -! H5_ITER_DEC_F - Decreasing order -! H5_ITER_NATIVE_F - Fastest available order -! idx - IN: Iteration position at which to start -! op - Callback function passing data regarding the link to the calling application -! op_data - User-defined pointer to data required by the application for its processing of the link -! -! Outputs: -! idx - OUT: Position at which an interrupted iteration may be restarted -! return_value - Success: The return value of the first operator that -! returns non-zero, or zero if all members were -! processed with no operator returning non-zero. -! -! Failure: Negative if something goes wrong within the -! library, or the negative value returned by one -! of the operators. -! -! hdferr - Returns 0 if successful and -1 if fails -! -! AUTHOR -! M. Scot Breitenfeld -! July 8, 2008 -! -! Fortran2003 Interface: - SUBROUTINE h5literate_f(group_id, index_type, order, idx, op, op_data, return_value, hdferr) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T) , INTENT(IN) :: group_id - INTEGER , INTENT(IN) :: index_type - INTEGER , INTENT(IN) :: order - INTEGER(HSIZE_T), INTENT(INOUT) :: idx - TYPE(C_FUNPTR) , INTENT(IN) :: op - TYPE(C_PTR) , INTENT(IN) :: op_data - INTEGER , INTENT(OUT) :: return_value - INTEGER , INTENT(OUT) :: hdferr -!***** - INTERFACE - INTEGER FUNCTION h5literate_c(group_id, index_type, order, idx, op, op_data) & - BIND(C, NAME='h5literate_c') - USE, INTRINSIC :: ISO_C_BINDING, ONLY : c_ptr, c_funptr - USE H5GLOBAL - INTEGER(HID_T), INTENT(IN) :: group_id - INTEGER, INTENT(IN) :: index_type - INTEGER, INTENT(IN) :: order - INTEGER(HSIZE_T), INTENT(INOUT) :: idx - TYPE(C_FUNPTR), VALUE :: op - TYPE(C_PTR), VALUE :: op_data - END FUNCTION h5literate_c - END INTERFACE - - return_value = h5literate_c(group_id, index_type, order, idx, op, op_data) - - IF(return_value.GE.0)THEN - hdferr = 0 - ELSE - hdferr = -1 - END IF - - END SUBROUTINE h5literate_f - -!****s* H5L (F03)/h5literate_by_name_f -! -! NAME -! h5literate_by_name_f -! -! PURPOSE -! Iterates through links in a group. -! -! Inputs: -! loc_id - File or group identifier specifying location of subject group -! group_name - Name of subject group -! index_type - Type of index which determines the order: -! H5_INDEX_NAME_F - Alpha-numeric index on name -! H5_INDEX_CRT_ORDER_F - Index on creation order -! order - Order within index: -! H5_ITER_INC_F - Increasing order -! H5_ITER_DEC_F - Decreasing order -! H5_ITER_NATIVE_F - Fastest available order -! idx - IN: Iteration position at which to start -! op - Callback function passing data regarding the link to the calling application -! op_data - User-defined pointer to data required by the application for its processing of the link -! -! Outputs: -! idx - OUT: Position at which an interrupted iteration may be restarted -! return_value - Success: The return value of the first operator that -! returns non-zero, or zero if all members were -! processed with no operator returning non-zero. -! -! Failure: Negative if something goes wrong within the -! library, or the negative value returned by one -! of the operators. -! -! hdferr - Returns 0 if successful and -1 if fails -! -! Optional parameters: -! lapl_id - Link access property list -! -! AUTHOR -! M. Scot Breitenfeld -! Augest 18, 2008 -! -! Fortran2003 Interface: - SUBROUTINE h5literate_by_name_f(loc_id, group_name, index_type, order, & - idx, op, op_data, return_value, hdferr, lapl_id) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T) , INTENT(IN) :: loc_id - CHARACTER(LEN=*), INTENT(IN) :: group_name - INTEGER , INTENT(IN) :: index_type - INTEGER , INTENT(IN) :: order - INTEGER(HSIZE_T), INTENT(INOUT) :: idx - TYPE(C_FUNPTR) , INTENT(IN) :: op - TYPE(C_PTR) , INTENT(IN) :: op_data - INTEGER , INTENT(OUT) :: return_value - INTEGER , INTENT(OUT) :: hdferr - INTEGER(HID_T) , INTENT(IN), OPTIONAL :: lapl_id -!***** - INTEGER(HID_T) :: lapl_id_default - INTEGER(SIZE_T) :: namelen - - INTERFACE - INTEGER FUNCTION h5literate_by_name_c(loc_id, name, namelen, index_type, order,& - idx, op, op_data, lapl_id_default) BIND(C, NAME='h5literate_by_name_c') - USE, INTRINSIC :: ISO_C_BINDING, ONLY : c_char, c_ptr, c_funptr - USE H5GLOBAL - INTEGER(HID_T) , INTENT(IN) :: loc_id - CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: name - INTEGER(SIZE_T) , INTENT(IN) :: namelen - INTEGER , INTENT(IN) :: index_type - INTEGER , INTENT(IN) :: order - INTEGER(HSIZE_T), INTENT(INOUT) :: idx - TYPE(C_FUNPTR), VALUE :: op - TYPE(C_PTR), VALUE :: op_data - INTEGER(HID_T) , INTENT(IN) :: lapl_id_default - END FUNCTION - END INTERFACE - - namelen = LEN(group_name) - lapl_id_default = H5P_DEFAULT_F - IF(PRESENT(lapl_id)) lapl_id_default = lapl_id - - return_value = h5literate_by_name_c(loc_id, group_name, namelen, index_type, order, idx, op, op_data, lapl_id_default) - - IF(return_value.GE.0)THEN - hdferr = 0 - ELSE - hdferr = -1 - END IF - - END SUBROUTINE h5literate_by_name_f - -END MODULE H5L_PROVISIONAL diff --git a/fortran/src/H5Lff_F90.f90 b/fortran/src/H5Lff_F90.f90 deleted file mode 100644 index dd62b7b..0000000 --- a/fortran/src/H5Lff_F90.f90 +++ /dev/null @@ -1,39 +0,0 @@ -!****h* ROBODoc/H5L (F90) -! -! NAME -! MODULE H5L_PROVISIONAL -! -! PURPOSE -! This file contains Fortran 90 interfaces for H5L functions. It contains -! the same functions as H5Lff_F03.f90 but excludes the Fortran 2003 functions -! and the interface listings. This file will be compiled instead of H5Lff_F03.f90 -! if Fortran 2003 functions are not enabled. -! -! NOTE -! Currently contains no functions. -! -! 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. * -! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -! -! *** IMPORTANT *** -! If you add a new H5D function you must add the function name to the -! Windows dll file 'hdf5_fortrandll.def.in' in the fortran/src directory. -! This is needed for Windows based operating systems. -!***** - -MODULE H5L_PROVISIONAL - -END MODULE H5L_PROVISIONAL diff --git a/fortran/src/H5Of.c b/fortran/src/H5Of.c index ae344a5..4801f7d 100644 --- a/fortran/src/H5Of.c +++ b/fortran/src/H5Of.c @@ -1,6 +1,6 @@ /****h* H5Of/H5Of * PURPOSE - * This file contains C stubs for H5O Fortran APIs + * This file contains C stubs for H5O Fortran APIs * * COPYRIGHT * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * @@ -109,12 +109,12 @@ fill_h5o_info_t_f(H5O_info_t Oinfo, H5O_info_t_f *object_info) { * PURPOSE * Calls H5Olink * INPUTS - * object_id - Object to be linked. - * new_loc_id - File or group identifier specifying location at which object is to be linked. - * name - Name of link to be created, relative to new_loc_id. - * namelen - Length of buffer for link to be created. - * lcpl_id - Link creation property list identifier. - * lapl_id - Link access property list identifier. + * object_id - Object to be linked. + * new_loc_id - File or group identifier specifying location at which object is to be linked. + * name - Name of link to be created, relative to new_loc_id. + * namelen - Length of buffer for link to be created. + * lcpl_id - Link creation property list identifier. + * lapl_id - Link access property list identifier. * RETURNS * 0 on success, -1 on failure * AUTHOR @@ -123,7 +123,7 @@ fill_h5o_info_t_f(H5O_info_t Oinfo, H5O_info_t_f *object_info) { * SOURCE */ int_f -nh5olink_c (hid_t_f *object_id, hid_t_f *new_loc_id, _fcd name, size_t_f *namelen, +h5olink_c (hid_t_f *object_id, hid_t_f *new_loc_id, _fcd name, size_t_f *namelen, hid_t_f *lcpl_id, hid_t_f *lapl_id) /******/ { @@ -169,7 +169,7 @@ nh5olink_c (hid_t_f *object_id, hid_t_f *new_loc_id, _fcd name, size_t_f *namele * SOURCE */ int_f -nh5oopen_c (hid_t_f *loc_id, _fcd name, size_t_f *namelen, hid_t_f *lapl_id, hid_t_f *obj_id) +h5oopen_c (hid_t_f *loc_id, _fcd name, size_t_f *namelen, hid_t_f *lapl_id, hid_t_f *obj_id) /******/ { char *c_name = NULL; /* Buffer to hold C string */ @@ -194,20 +194,20 @@ nh5oopen_c (hid_t_f *loc_id, _fcd name, size_t_f *namelen, hid_t_f *lapl_id, hid } /****if* H5Of/h5oclose_c * NAME - * h5oclose_c + * h5oclose_c * PURPOSE - * Call H5Oclose + * Call H5Oclose * INPUTS - * object_id - Object identifier + * object_id - Object identifier * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * M. Scot Breitenfeld - * December 17, 2008 + * December 17, 2008 * SOURCE */ int_f -nh5oclose_c ( hid_t_f *object_id ) +h5oclose_c ( hid_t_f *object_id ) /******/ { int_f ret_value=0; /* Return value */ @@ -225,15 +225,15 @@ nh5oclose_c ( hid_t_f *object_id ) * PURPOSE * Calls H5Ovisit * INPUTS - * object_id - Identifier specifying subject group - * index_type - Type of index which determines the order - * order - Order within index - * idx - Iteration position at which to start - * op - Callback function passing data regarding the link to the calling application - * op_data - User-defined pointer to data required by the application for its processing of the link + * object_id - Identifier specifying subject group + * index_type - Type of index which determines the order + * order - Order within index + * idx - Iteration position at which to start + * op - Callback function passing data regarding the link to the calling application + * op_data - User-defined pointer to data required by the application for its processing of the link * * OUTPUTS - * idx - Position at which an interrupted iteration may be restarted + * idx - Position at which an interrupted iteration may be restarted * * RETURNS * >0 on success, 0< on failure @@ -266,20 +266,20 @@ h5ovisit_c(hid_t_f *group_id, int_f *index_type, int_f *order, H5O_iterate_t op, * Calls H5open_by_addr * INPUTS * loc_id - File or group identifier - * addr - Object’s address in the file + * addr - Object’s address in the file * * OUTPUTS * obj_id - Dataset identifier * * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * M. Scot Breitenfeld * September 14, 2009 * SOURCE */ int_f -nh5oopen_by_addr_c (hid_t_f *loc_id, haddr_t_f *addr, hid_t_f *obj_id) +h5oopen_by_addr_c (hid_t_f *loc_id, haddr_t_f *addr, hid_t_f *obj_id) /******/ { int_f ret_value = 0; /* Return value */ @@ -458,7 +458,7 @@ h5oget_info_c (hid_t_f *object_id, H5O_info_t_f *object_info) * SOURCE */ int_f -nh5ocopy_c (hid_t_f *src_loc_id, _fcd src_name, size_t_f *src_name_len, +h5ocopy_c (hid_t_f *src_loc_id, _fcd src_name, size_t_f *src_name_len, hid_t_f *dst_loc_id, _fcd dst_name, size_t_f *dst_name_len, hid_t_f *ocpypl_id, hid_t_f *lcpl_id ) /******/ @@ -499,15 +499,15 @@ nh5ocopy_c (hid_t_f *src_loc_id, _fcd src_name, size_t_f *src_name_len, * PURPOSE * Calls H5Ovisit_by_name * INPUTS - * object_id - Identifier specifying subject group - * index_type - Type of index which determines the order - * order - Order within index - * idx - Iteration position at which to start - * op - Callback function passing data regarding the link to the calling application - * op_data - User-defined pointer to data required by the application for its processing of the link + * object_id - Identifier specifying subject group + * index_type - Type of index which determines the order + * order - Order within index + * idx - Iteration position at which to start + * op - Callback function passing data regarding the link to the calling application + * op_data - User-defined pointer to data required by the application for its processing of the link * * OUTPUTS - * idx - Position at which an interrupted iteration may be restarted + * idx - Position at which an interrupted iteration may be restarted * * RETURNS * >0 on success, 0< on failure @@ -560,7 +560,7 @@ h5ovisit_by_name_c(hid_t_f *loc_id, _fcd object_name, size_t_f *namelen, int_f * SOURCE */ int_f -nh5odecr_refcount_c (hid_t_f *object_id) +h5odecr_refcount_c (hid_t_f *object_id) /******/ { int_f ret_value = 0; /* Return value */ @@ -594,7 +594,7 @@ nh5odecr_refcount_c (hid_t_f *object_id) * SOURCE */ int_f -nh5oexists_by_name_c (hid_t_f *loc_id, _fcd name, size_t_f *namelen, hid_t_f *lapl_id) +h5oexists_by_name_c (hid_t_f *loc_id, _fcd name, size_t_f *namelen, hid_t_f *lapl_id) /******/ { char *c_name = NULL; /* Buffer to hold C string */ @@ -633,7 +633,7 @@ nh5oexists_by_name_c (hid_t_f *loc_id, _fcd name, size_t_f *namelen, hid_t_f *la * SOURCE */ int_f -nh5oincr_refcount_c (hid_t_f *object_id) +h5oincr_refcount_c (hid_t_f *object_id) /******/ { int_f ret_value = 0; /* Return value */ @@ -665,7 +665,7 @@ nh5oincr_refcount_c (hid_t_f *object_id) * SOURCE */ int_f -nh5oset_comment_c (hid_t_f *object_id, _fcd comment, size_t_f *commentlen) +h5oset_comment_c (hid_t_f *object_id, _fcd comment, size_t_f *commentlen) /******/ { char *c_comment = NULL; /* Buffer to hold C string */ @@ -697,7 +697,7 @@ nh5oset_comment_c (hid_t_f *object_id, _fcd comment, size_t_f *commentlen) * INPUTS * object_id - Identifier of the target object. * name - Name of the object whose comment is to be set or reset, - * specified as a path relative to loc_id. + * specified as a path relative to loc_id. * namelen - Length of the name. * comment - The new comment. * commentlen - Length of the comment. @@ -710,7 +710,7 @@ nh5oset_comment_c (hid_t_f *object_id, _fcd comment, size_t_f *commentlen) * SOURCE */ int_f -nh5oset_comment_by_name_c (hid_t_f *object_id, _fcd name, size_t_f *namelen, _fcd comment, size_t_f *commentlen, hid_t_f *lapl_id) +h5oset_comment_by_name_c (hid_t_f *object_id, _fcd name, size_t_f *namelen, _fcd comment, size_t_f *commentlen, hid_t_f *lapl_id) /******/ { char *c_comment = NULL; /* Buffer to hold C string */ @@ -755,7 +755,7 @@ nh5oset_comment_by_name_c (hid_t_f *object_id, _fcd name, size_t_f *namelen, _f * n - Object to open. * lapl_id - Link access property list. * OUTPUTS - * obj_id - An object identifier for the opened object. + * obj_id - An object identifier for the opened object. * RETURNS * 0 on success, -1 on failure * AUTHOR @@ -764,7 +764,7 @@ nh5oset_comment_by_name_c (hid_t_f *object_id, _fcd name, size_t_f *namelen, _f * SOURCE */ int_f -nh5oopen_by_idx_c (hid_t_f *loc_id, _fcd group_name, size_t_f *group_namelen, +h5oopen_by_idx_c (hid_t_f *loc_id, _fcd group_name, size_t_f *group_namelen, int_f *index_type, int_f *order, hsize_t_f *n, hid_t_f *obj_id, hid_t_f *lapl_id) /******/ { @@ -813,7 +813,7 @@ nh5oopen_by_idx_c (hid_t_f *loc_id, _fcd group_name, size_t_f *group_namelen, * SOURCE */ int_f -nh5oget_comment_c (hid_t_f *object_id, _fcd comment, size_t_f *commentsize, hssize_t_f *bufsize) +h5oget_comment_c (hid_t_f *object_id, _fcd comment, size_t_f *commentsize, hssize_t_f *bufsize) /******/ { char *c_comment = NULL; /* Buffer to hold C string */ @@ -869,7 +869,7 @@ nh5oget_comment_c (hid_t_f *object_id, _fcd comment, size_t_f *commentsize, hss * SOURCE */ int_f -nh5oget_comment_by_name_c (hid_t_f *loc_id, _fcd name, size_t_f *name_size, +h5oget_comment_by_name_c (hid_t_f *loc_id, _fcd name, size_t_f *name_size, _fcd comment, size_t_f *commentsize, size_t_f *bufsize, hid_t_f *lapl_id) /******/ { diff --git a/fortran/src/H5Off.F90 b/fortran/src/H5Off.F90 new file mode 100644 index 0000000..da940df --- /dev/null +++ b/fortran/src/H5Off.F90 @@ -0,0 +1,1149 @@ +!****h* ROBODoc/H5O +! +! NAME +! MODULE H5O +! +! FILE +! fortran/src/H5Off.f90 +! +! PURPOSE +! This file contains Fortran interfaces for H5O functions. +! +! +! 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. * +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! +! NOTES +! _____ __ __ _____ ____ _____ _______ _ _ _______ +! |_ _| \/ | __ \ / __ \| __ \__ __|/\ | \ | |__ __| +! **** | | | \ / | |__) | | | | |__) | | | / \ | \| | | | **** +! **** | | | |\/| | ___/| | | | _ / | | / /\ \ | . ` | | | **** +! **** _| |_| | | | | | |__| | | \ \ | |/ ____ \| |\ | | | **** +! |_____|_| |_|_| \____/|_| \_\ |_/_/ \_\_| \_| |_| +! +! If you add a new H5O function you must add the function name to the +! Windows dll file 'hdf5_fortrandll.def.in' in the fortran/src directory. +! This is needed for Windows based operating systems. +! +!***** + +MODULE H5O + + USE, INTRINSIC :: ISO_C_BINDING, ONLY : C_PTR, C_FUNPTR, C_CHAR, C_INT64_T, C_LONG, C_INT, C_LOC + USE H5GLOBAL + IMPLICIT NONE + +!****t* H5T (F03)/h5o_info_t +! +! Fortran2003 Derived Type: +! + TYPE, BIND(C) :: space_t + INTEGER(hsize_t) :: total ! Total space for storing object header in file + INTEGER(hsize_t) :: meta ! Space within header for object header metadata information + INTEGER(hsize_t) :: mesg ! Space within header for actual message information + INTEGER(hsize_t) :: free ! Free space within object header + END TYPE space_t + + TYPE, BIND(C) :: mesg_t + INTEGER(c_int64_t) :: present ! Flags to indicate presence of message type in header + INTEGER(c_int64_t) :: shared ! Flags to indicate message type is shared in header + END TYPE mesg_t + + TYPE, BIND(C) :: hdr_t + INTEGER :: version ! Version number of header format in file + INTEGER :: nmesgs ! Number of object header messages + INTEGER :: nchunks ! Number of object header chunks + INTEGER :: flags ! Object header status flags + TYPE(space_t) :: space + TYPE(mesg_t) :: mesg + END TYPE hdr_t + + ! Extra metadata storage for obj & attributes + TYPE, BIND(C) :: H5_ih_info_t + INTEGER(hsize_t) :: index_size ! btree and/or list + INTEGER(hsize_t) :: heap_size + END TYPE H5_ih_info_t + + TYPE, BIND(C) :: meta_size_t + TYPE(H5_ih_info_t) :: obj ! v1/v2 B-tree & local/fractal heap for groups, B-tree for chunked datasets + TYPE(H5_ih_info_t) :: attr ! v2 B-tree & heap for attributes + ENDTYPE meta_size_t + + TYPE, BIND(C) :: h5o_info_t + INTEGER(C_LONG) :: fileno ! File number that object is located in + INTEGER(haddr_t) :: addr ! Object address in file + INTEGER(C_INT) :: type ! Basic object type (group, dataset, etc.) + INTEGER :: rc ! Reference count of object + + INTEGER, DIMENSION(8) :: atime ! Access time ! -- NOTE -- + INTEGER, DIMENSION(8) :: mtime ! Modification time ! Returns an integer array + INTEGER, DIMENSION(8) :: ctime ! Change time ! as specified in the Fortran + INTEGER, DIMENSION(8) :: btime ! Birth time ! intrinsic DATE_AND_TIME(VALUES) + + INTEGER(hsize_t) :: num_attrs ! # of attributes attached to object + + TYPE(hdr_t) :: hdr + + TYPE(meta_size_t) :: meta_size + END TYPE h5o_info_t + +!***** + +CONTAINS + +!****s* H5O/h5olink_f +! +! NAME +! h5olink_f +! +! PURPOSE +! Creates a hard link to an object in an HDF5 file. +! +! Inputs: +! object_id - Object to be linked. +! new_loc_id - File or group identifier specifying location at which object is to be linked. +! new_link_name - Name of link to be created, relative to new_loc_id. +! +! Outputs: +! hdferr - Returns 0 if successful and -1 if fails. +! +! Optional parameters: +! lcpl_id - Link creation property list identifier. +! lapl_id - Link access property list identifier. +! +! AUTHOR +! M. Scot Breitenfeld +! April 21, 2008 +! +! Fortran90 Interface: + SUBROUTINE h5olink_f(object_id, new_loc_id, new_link_name, hdferr, lcpl_id, lapl_id) + IMPLICIT NONE + INTEGER(HID_T) , INTENT(IN) :: object_id + INTEGER(HID_T) , INTENT(IN) :: new_loc_id + CHARACTER(LEN=*), INTENT(IN) :: new_link_name + INTEGER , INTENT(OUT) :: hdferr + INTEGER(HID_T) , INTENT(IN), OPTIONAL :: lcpl_id + INTEGER(HID_T) , INTENT(IN), OPTIONAL :: lapl_id +!***** + INTEGER(HID_T) :: lapl_id_default + INTEGER(HID_T) :: lcpl_id_default + + INTEGER(SIZE_T) :: new_link_namelen + + INTERFACE + INTEGER FUNCTION h5olink_c(object_id, new_loc_id, new_link_name, new_link_namelen, & + lcpl_id_default, lapl_id_default) BIND(C,NAME='h5olink_c') + IMPORT :: C_CHAR + IMPORT :: HID_T, SIZE_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: object_id + INTEGER(HID_T), INTENT(IN) :: new_loc_id + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: new_link_name + INTEGER(SIZE_T) :: new_link_namelen + INTEGER(HID_T) :: lapl_id_default + INTEGER(HID_T) :: lcpl_id_default + END FUNCTION h5olink_c + END INTERFACE + + new_link_namelen = LEN(new_link_name) + + lapl_id_default = H5P_DEFAULT_F + IF(PRESENT(lapl_id)) lapl_id_default = lapl_id + lcpl_id_default = H5P_DEFAULT_F + IF(PRESENT(lcpl_id)) lcpl_id_default = lcpl_id + + hdferr = h5olink_c(object_id, new_loc_id, new_link_name, new_link_namelen, & + lcpl_id_default, lapl_id_default) + + END SUBROUTINE h5olink_f + +!****s* H5O/h5oopen_f +! +! NAME +! h5oopen_f +! +! PURPOSE +! Opens an object in an HDF5 file by location identifier and path name. +! +! Inputs: +! loc_id - File or group identifier. +! name - Path to the object, relative to loc_id. +! +! Outputs: +! obj_id - Object identifier for the opened object. +! hdferr - Returns 0 if successful and -1 if fails. +! +! Optional parameters: +! lapl_id - Access property list identifier for the link pointing to the object. +! +! AUTHOR +! M. Scot Breitenfeld +! April 18, 2008 +! +! Fortran90 Interface: + SUBROUTINE h5oopen_f(loc_id, name, obj_id, hdferr, lapl_id) + IMPLICIT NONE + INTEGER(HID_T) , INTENT(IN) :: loc_id + CHARACTER(LEN=*), INTENT(IN) :: name + INTEGER(HID_T) , INTENT(OUT) :: obj_id + INTEGER , INTENT(OUT) :: hdferr + INTEGER(HID_T) , INTENT(IN), OPTIONAL :: lapl_id +!***** + INTEGER(HID_T) :: lapl_id_default + INTEGER(SIZE_T) :: namelen + + INTERFACE + INTEGER FUNCTION h5oopen_c(loc_id, name, namelen, lapl_id_default, obj_id) BIND(C,NAME='h5oopen_c') + IMPORT :: C_CHAR + IMPORT :: HID_T, SIZE_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: name + INTEGER(HID_T) :: lapl_id_default + INTEGER(SIZE_T) :: namelen + INTEGER(HID_T), INTENT(OUT) :: obj_id + END FUNCTION h5oopen_c + END INTERFACE + + namelen = LEN(name) + + lapl_id_default = H5P_DEFAULT_F + IF(PRESENT(lapl_id)) lapl_id_default = lapl_id + + hdferr = h5oopen_c(loc_id, name, namelen, lapl_id_default, obj_id) + + END SUBROUTINE h5oopen_f +! +!****s* H5O/h5oclose_f +! +! NAME +! h5oclose_f +! +! PURPOSE +! Closes an object in an HDF5 file. +! +! Inputs: +! object_id - Object identifier. +! +! Outputs: +! hdferr - Returns 0 if successful and -1 if fails. +! +! AUTHOR +! M. Scot Breitenfeld +! December 17, 2008 +! +! Fortran90 Interface: + SUBROUTINE h5oclose_f(object_id, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: object_id + INTEGER , INTENT(OUT) :: hdferr +!***** + INTERFACE + INTEGER FUNCTION h5oclose_c(object_id) BIND(C,NAME='h5oclose_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: object_id + END FUNCTION h5oclose_c + END INTERFACE + + hdferr = h5oclose_c(object_id) + END SUBROUTINE h5oclose_f + +! +!****s* H5O/h5open_by_addr_f +! NAME +! h5oopen_by_addr_f +! +! PURPOSE +! Opens an object using its address within an HDF5 file. +! +! Inputs: +! loc_id - File or group identifier. +! addr - Object’s address in the file. +! +! Outputs: +! obj_id - Object identifier for the opened object. +! hdferr - Returns 0 if successful and -1 if fails. +! +! AUTHOR +! M. Scot Breitenfeld +! September 14, 2009 +! +! Fortran90 Interface: + SUBROUTINE h5oopen_by_addr_f(loc_id, addr, obj_id, hdferr) + IMPLICIT NONE + INTEGER(HID_T) , INTENT(IN) :: loc_id + INTEGER(HADDR_T), INTENT(IN) :: addr + INTEGER(HID_T) , INTENT(OUT) :: obj_id + INTEGER , INTENT(OUT) :: hdferr +!***** + INTERFACE + INTEGER FUNCTION h5oopen_by_addr_c(loc_id, addr, obj_id) BIND(C,NAME='h5oopen_by_addr_c') + IMPORT :: HID_T, HADDR_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id + INTEGER(HADDR_T), INTENT(IN) :: addr + INTEGER(HID_T), INTENT(OUT) :: obj_id + END FUNCTION h5oopen_by_addr_c + END INTERFACE + + hdferr = h5oopen_by_addr_c(loc_id, addr, obj_id) + + END SUBROUTINE h5oopen_by_addr_f +! +!****s* H5O/h5ocopy_f +! NAME +! h5ocopy_f +! +! PURPOSE +! Copies an object in an HDF5 file. +! +! Inputs: +! src_loc_id - Object identifier indicating the location of the source object to be copied. +! src_name - Name of the source object to be copied. +! dst_loc_id - Location identifier specifying the destination. +! dst_name - Name to be assigned to the new copy. +! +! Optional parameters: +! ocpypl_id - Object copy property list. +! lcpl_id - Link creation property list for the new hard link. +! +! Outputs: +! hdferr - Returns 0 if successful and -1 if fails. +! +! AUTHOR +! M. Scot Breitenfeld +! March 14, 2012 +! +! Fortran90 Interface: + SUBROUTINE h5ocopy_f(src_loc_id, src_name, dst_loc_id, dst_name, hdferr, ocpypl_id, lcpl_id) + IMPLICIT NONE + INTEGER(HID_T) , INTENT(IN) :: src_loc_id + CHARACTER(LEN=*), INTENT(IN) :: src_name + INTEGER(HID_T) , INTENT(IN) :: dst_loc_id + CHARACTER(LEN=*), INTENT(IN) :: dst_name + INTEGER , INTENT(OUT) :: hdferr + INTEGER(HID_T) , INTENT(IN), OPTIONAL :: ocpypl_id + INTEGER(HID_T) , INTENT(IN), OPTIONAL :: lcpl_id +!***** + + INTEGER(SIZE_T) :: src_name_len, dst_name_len + INTEGER(HID_T) :: ocpypl_id_default, lcpl_id_default + + INTERFACE + INTEGER FUNCTION h5ocopy_c(src_loc_id, src_name, src_name_len, & + dst_loc_id, dst_name, dst_name_len, ocpypl_id_default, lcpl_id_default) & + BIND(C,NAME='h5ocopy_c') + IMPORT :: C_CHAR + IMPORT :: HID_T, SIZE_T + IMPLICIT NONE + INTEGER(HID_T) , INTENT(IN) :: src_loc_id + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: src_name + INTEGER(HID_T) , INTENT(IN) :: dst_loc_id + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: dst_name + INTEGER(HID_T) , INTENT(IN) :: ocpypl_id_default + INTEGER(HID_T) , INTENT(IN) :: lcpl_id_default + INTEGER(SIZE_T) :: src_name_len, dst_name_len + + END FUNCTION h5ocopy_c + END INTERFACE + + src_name_len = LEN(src_name) + dst_name_len = LEN(dst_name) + + ocpypl_id_default = H5P_DEFAULT_F + IF(PRESENT(ocpypl_id)) ocpypl_id_default = ocpypl_id + lcpl_id_default = H5P_DEFAULT_F + IF(PRESENT(lcpl_id)) lcpl_id_default = lcpl_id + + hdferr = h5ocopy_c(src_loc_id, src_name, src_name_len, & + dst_loc_id, dst_name, dst_name_len, ocpypl_id_default, lcpl_id_default) + + END SUBROUTINE h5ocopy_f + +!****s* H5O/h5odecr_refcount_f +! NAME +! h5odecr_refcount_f +! +! PURPOSE +! Decrements an object reference count. +! +! Inputs: +! object_id - Object identifier. +! +! Outputs: +! hdferr - Returns 0 if successful and -1 if fails. +! +! AUTHOR +! M. Scot Breitenfeld +! May 11, 2012 +! +! Fortran90 Interface: + SUBROUTINE h5odecr_refcount_f(object_id, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: object_id + INTEGER , INTENT(OUT) :: hdferr +!***** + + INTERFACE + INTEGER FUNCTION h5odecr_refcount_c(object_id) BIND(C,NAME='h5odecr_refcount_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T) , INTENT(IN) :: object_id + END FUNCTION h5odecr_refcount_c + END INTERFACE + + hdferr = h5odecr_refcount_c(object_id) + + END SUBROUTINE h5odecr_refcount_f + +!****s* H5O/h5oexists_by_name_f +! NAME +! h5oexists_by_name_f +! +! PURPOSE +! Determines whether a link resolves to an actual object. +! +! Inputs: +! loc_id - Identifier of the file or group to query. +! name - The name of the link to check. +! +! +! Optional parameters: +! lapl_id - Link access property list identifier. +! +! Outputs: +! link_exists - Existing link resolves to an object. +! hdferr - Returns 0 if successful and -1 if fails. +! +! AUTHOR +! M. Scot Breitenfeld +! May 11, 2012 +! +! Fortran90 Interface: + SUBROUTINE h5oexists_by_name_f(loc_id, name, link_exists, hdferr, lapl_id) + IMPLICIT NONE + INTEGER(HID_T) , INTENT(IN) :: loc_id + CHARACTER(LEN=*), INTENT(IN) :: name + LOGICAL , INTENT(OUT) :: link_exists + INTEGER , INTENT(OUT) :: hdferr + INTEGER(HID_T) , INTENT(IN), OPTIONAL :: lapl_id +!***** + + INTEGER(size_t) :: namelen + INTEGER :: status + INTEGER(HID_T) :: lapl_id_default + + INTERFACE + INTEGER FUNCTION h5oexists_by_name_c(loc_id, name, namelen, lapl_id) & + BIND(C,NAME='h5oexists_by_name_c') + IMPORT :: C_CHAR + IMPORT :: HID_T, SIZE_T + IMPLICIT NONE + INTEGER(HID_T) , INTENT(IN) :: loc_id + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: name + INTEGER(SIZE_T) , INTENT(IN) :: namelen + INTEGER(HID_T) , INTENT(IN) :: lapl_id + + END FUNCTION h5oexists_by_name_c + END INTERFACE + + namelen = LEN(name) + + lapl_id_default = H5P_DEFAULT_F + IF(PRESENT(lapl_id)) lapl_id_default = lapl_id + + status = h5oexists_by_name_c(loc_id, name, namelen, lapl_id_default) + + link_exists = .FALSE. + IF(status.EQ.1)THEN + link_exists = .TRUE. + ENDIF + + hdferr = 0 + IF(status.LT.0)THEN + hdferr = -1 + ENDIF + + END SUBROUTINE h5oexists_by_name_f + +!****s* H5O/h5oget_comment_f +! NAME +! h5oget_comment_f +! +! PURPOSE +! Retrieves comment for specified object. +! +! Inputs: +! obj_id - Identifier for the target object. +! +! Optional parameters: +! bufsize - Size of the comment buffer. +! +! Outputs: +! comment - The comment. +! hdferr - Returns 0 if successful and -1 if fails. +! +! AUTHOR +! M. Scot Breitenfeld +! May 11, 2012 +! +! Fortran90 Interface: + SUBROUTINE h5oget_comment_f(obj_id, comment, hdferr, bufsize) + IMPLICIT NONE + INTEGER(HID_T) , INTENT(IN) :: obj_id + CHARACTER(LEN=*) , INTENT(OUT) :: comment + INTEGER , INTENT(OUT) :: hdferr + INTEGER(HSSIZE_T), INTENT(OUT), OPTIONAL :: bufsize +!***** + + INTEGER(SIZE_T) :: commentsize_default + INTEGER(HSSIZE_T) :: bufsize_default + + INTERFACE + INTEGER FUNCTION h5oget_comment_c(obj_id, comment, commentsize_default, bufsize) & + BIND(C,NAME='h5oget_comment_c') + IMPORT :: C_CHAR + IMPORT :: HID_T, SIZE_T, HSSIZE_T + IMPLICIT NONE + INTEGER(HID_T) , INTENT(IN) :: obj_id + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(OUT) :: comment + INTEGER(SIZE_T) , INTENT(IN) :: commentsize_default + INTEGER(HSSIZE_T) , INTENT(OUT) :: bufsize + END FUNCTION h5oget_comment_c + END INTERFACE + + commentsize_default = LEN(comment) + + hdferr = h5oget_comment_c(obj_id, comment, commentsize_default, bufsize_default) + + IF(PRESENT(bufsize)) bufsize = bufsize_default + + END SUBROUTINE h5oget_comment_f + +!****s* H5O/h5oget_comment_by_name_f +! NAME +! h5oget_comment_by_name_f +! +! PURPOSE +! Retrieves comment for specified object. +! +! Inputs: +! loc_id - Identifier of a file, group, dataset, or named datatype. +! name - Name of the object whose comment is to be retrieved, +! specified as a path relative to loc_id. +! +! Optional parameters: +! bufsize - Size of the comment buffer. +! +! Outputs: +! comment - The comment. +! hdferr - Returns 0 if successful and -1 if fails. +! +! AUTHOR +! M. Scot Breitenfeld +! July 6, 2012 +! +! Fortran90 Interface: + SUBROUTINE h5oget_comment_by_name_f(loc_id, name, comment, hdferr, bufsize, lapl_id) + IMPLICIT NONE + INTEGER(HID_T) , INTENT(IN) :: loc_id + CHARACTER(LEN=*), INTENT(IN) :: name + CHARACTER(LEN=*), INTENT(OUT) :: comment + INTEGER , INTENT(OUT) :: hdferr + INTEGER(SIZE_T) , INTENT(OUT), OPTIONAL :: bufsize + INTEGER(HID_T) , INTENT(IN) , OPTIONAL :: lapl_id +!***** + + INTEGER(SIZE_T) :: commentsize_default + INTEGER(SIZE_T) :: name_size + INTEGER(SIZE_T) :: bufsize_default + INTEGER(HID_T) :: lapl_id_default + INTERFACE + INTEGER FUNCTION h5oget_comment_by_name_c(loc_id, name, name_size, & + comment, commentsize_default, bufsize_default, lapl_id) BIND(C,NAME='h5oget_comment_by_name_c') + IMPORT :: C_CHAR + IMPORT :: HID_T, SIZE_T + IMPLICIT NONE + INTEGER(HID_T) , INTENT(IN) :: loc_id + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: name + INTEGER(SIZE_T) , INTENT(IN) :: name_size + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(OUT) :: comment + INTEGER(SIZE_T) , INTENT(IN) :: commentsize_default + INTEGER(SIZE_T) , INTENT(OUT) :: bufsize_default + INTEGER(HID_T) , INTENT(IN) :: lapl_id + END FUNCTION h5oget_comment_by_name_c + END INTERFACE + + commentsize_default = LEN(comment) + name_size = LEN(name) + + lapl_id_default = H5P_DEFAULT_F + IF(PRESENT(lapl_id)) lapl_id_default = lapl_id + + hdferr = h5oget_comment_by_name_c(loc_id, name, name_size, & + comment, commentsize_default, bufsize_default, lapl_id_default) + + IF(PRESENT(bufsize)) bufsize = bufsize_default + + END SUBROUTINE h5oget_comment_by_name_f + +!****s* H5O/h5oincr_refcount_f +! NAME +! h5oincr_refcount_f +! +! PURPOSE +! Increments an object reference count. +! +! Inputs: +! obj_id - Object identifier. +! +! Outputs: +! hdferr - Returns 0 if successful and -1 if fails. +! +! AUTHOR +! M. Scot Breitenfeld +! May 15, 2012 +! +! Fortran90 Interface: + SUBROUTINE h5oincr_refcount_f(obj_id, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: obj_id + INTEGER , INTENT(OUT) :: hdferr +!***** + + INTERFACE + INTEGER FUNCTION h5oincr_refcount_c(obj_id) BIND(C,NAME='h5oincr_refcount_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T) , INTENT(IN) :: obj_id + END FUNCTION h5oincr_refcount_c + END INTERFACE + + hdferr = h5oincr_refcount_c(obj_id) + + END SUBROUTINE h5oincr_refcount_f + +!****s* H5O/h5oopen_by_idx_f +! +! NAME +! h5oopen_by_idx_f +! +! PURPOSE +! Open the nth object in a group. +! +! Inputs: +! loc_id - A file or group identifier. +! group_name - Name of group, relative to loc_id, in which object is located. +! index_type - Type of index by which objects are ordered. +! order - Order of iteration within index, NOTE: zero-based. +! n - Object to open. +! +! Outputs: +! obj_id - An object identifier for the opened object. +! hdferr - Returns 0 if successful and -1 if fails. +! +! Optional parameters: +! lapl_id - Link access property list. +! +! AUTHOR +! M. Scot Breitenfeld +! May 17, 2012 +! +! Fortran90 Interface: + SUBROUTINE h5oopen_by_idx_f(loc_id, group_name, index_type, order, n, obj_id, & + hdferr, lapl_id) + IMPLICIT NONE + INTEGER(HID_T) , INTENT(IN) :: loc_id + CHARACTER(LEN=*), INTENT(IN) :: group_name + INTEGER , INTENT(IN) :: index_type + INTEGER , INTENT(IN) :: order + INTEGER(HSIZE_T), INTENT(IN) :: n + INTEGER(HID_T) , INTENT(OUT) :: obj_id + INTEGER , INTENT(OUT) :: hdferr + INTEGER(HID_T) , INTENT(IN) , OPTIONAL :: lapl_id +!***** + INTEGER(SIZE_T) :: group_namelen + INTEGER(HID_T) :: lapl_id_default + + INTERFACE + INTEGER FUNCTION h5oopen_by_idx_c(loc_id, group_name, group_namelen, index_type, order, n, obj_id, lapl_id_default) & + BIND(C,NAME='h5oopen_by_idx_c') + IMPORT :: C_CHAR + IMPORT :: HID_T, SIZE_T, HSIZE_T + IMPLICIT NONE + INTEGER(HID_T) , INTENT(IN) :: loc_id + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: group_name + INTEGER(SIZE_T) , INTENT(IN) :: group_namelen + INTEGER , INTENT(IN) :: index_type + INTEGER , INTENT(IN) :: order + INTEGER(HSIZE_T), INTENT(IN) :: n + INTEGER(HID_T) , INTENT(OUT) :: obj_id + INTEGER(HID_T) , INTENT(IN) :: lapl_id_default + + END FUNCTION h5oopen_by_idx_c + END INTERFACE + + group_namelen = LEN(group_name) + + lapl_id_default = H5P_DEFAULT_F + IF(PRESENT(lapl_id)) lapl_id_default = lapl_id + + hdferr = h5oopen_by_idx_c(loc_id, group_name, group_namelen, index_type, order, n, obj_id, lapl_id_default) + + END SUBROUTINE H5Oopen_by_idx_f + +!****s* H5O/h5oset_comment_f +! NAME +! h5oset_comment_f +! +! PURPOSE +! Sets comment for specified object. +! +! Inputs: +! obj_id - Identifier of the target object. +! comment - The new comment. +! +! Outputs: +! hdferr - Returns 0 if successful and -1 if fails. +! +! AUTHOR +! M. Scot Breitenfeld +! May 15, 2012 +! +! Fortran90 Interface: + SUBROUTINE h5oset_comment_f(obj_id, comment, hdferr) + IMPLICIT NONE + INTEGER(HID_T) , INTENT(IN) :: obj_id + CHARACTER(LEN=*), INTENT(IN) :: comment + INTEGER , INTENT(OUT) :: hdferr +!***** + INTEGER(SIZE_T) :: commentlen + + INTERFACE + INTEGER FUNCTION h5oset_comment_c(obj_id, comment, commentlen) BIND(C,NAME='h5oset_comment_c') + IMPORT :: C_CHAR + IMPORT :: HID_T, SIZE_T + IMPLICIT NONE + INTEGER(HID_T) , INTENT(IN) :: obj_id + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: comment + INTEGER(SIZE_T) , INTENT(IN) :: commentlen + + END FUNCTION h5oset_comment_c + END INTERFACE + + commentlen = LEN(comment) + + hdferr = h5oset_comment_c(obj_id, comment, commentlen) + + END SUBROUTINE h5oset_comment_f + +!****s* H5O/h5oset_comment_by_name_f +! NAME +! h5oset_comment_by_name_f +! +! PURPOSE +! Sets comment for specified object. +! +! Inputs: +! loc_id - Identifier of a file, group, dataset, or named datatype. +! name - Name of the object whose comment is to be set or reset, +! specified as a path relative to loc_id. +! comment - The new comment. +! +! Outputs: +! hdferr - Returns 0 if successful and -1 if fails. +! +! Optional parameters: +! lapl_id - Link access property list identifier. +! +! AUTHOR +! M. Scot Breitenfeld +! May 15, 2012 +! +! Fortran90 Interface: + SUBROUTINE h5oset_comment_by_name_f(loc_id, name, comment, hdferr, lapl_id) + IMPLICIT NONE + INTEGER(HID_T) , INTENT(IN) :: loc_id + CHARACTER(LEN=*), INTENT(IN) :: name + CHARACTER(LEN=*), INTENT(IN) :: comment + INTEGER , INTENT(OUT) :: hdferr + INTEGER(HID_T) , INTENT(IN), OPTIONAL :: lapl_id +!***** + INTEGER(SIZE_T) :: commentlen + INTEGER(SIZE_T) :: namelen + INTEGER(HID_T) :: lapl_id_default + + INTERFACE + INTEGER FUNCTION h5oset_comment_by_name_c(loc_id, name, namelen, comment, commentlen, lapl_id) & + BIND(C,NAME='h5oset_comment_by_name_c') + IMPORT :: C_CHAR + IMPORT :: HID_T, SIZE_T + IMPLICIT NONE + INTEGER(HID_T) , INTENT(IN) :: loc_id + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: comment + INTEGER(SIZE_T) , INTENT(IN) :: commentlen + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: name + INTEGER(SIZE_T) , INTENT(IN) :: namelen + INTEGER(HID_T) , INTENT(IN) :: lapl_id + END FUNCTION h5oset_comment_by_name_c + END INTERFACE + + commentlen = LEN(comment) + namelen = LEN(name) + + lapl_id_default = H5P_DEFAULT_F + IF(PRESENT(lapl_id)) lapl_id_default = lapl_id + + hdferr = h5oset_comment_by_name_c(loc_id, name, namelen, comment, commentlen, lapl_id_default) + + END SUBROUTINE h5oset_comment_by_name_f + +!****s* H5O (F03)/h5ovisit_f_F03 +! +! NAME +! h5ovisit_f +! +! PURPOSE +! Recursively visits all objects starting from a specified object. +! +! Inputs: +! object_id - Identifier of the object at which the recursive iteration begins. +! index_type - Type of index; valid values include: +! H5_INDEX_NAME_F +! H5_INDEX_CRT_ORDER_F +! order - Order in which index is traversed; valid values include: +! H5_ITER_DEC_F +! H5_ITER_INC_F +! H5_ITER_NATIVE_F +! op - Callback function passing data regarding the group to the calling application +! op_data - User-defined pointer to data required by the application for its processing of the group +! +! Outputs: +! return_value - returns the return value of the first operator that returns a positive value, or +! zero if all members were processed with no operator returning non-zero. +! hdferr - Returns 0 if successful and -1 if fails +! AUTHOR +! M. Scot Breitenfeld +! November 19, 2008 +! +! Fortran2003 Interface: + SUBROUTINE h5ovisit_f(object_id, index_type, order, op, op_data, return_value, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: object_id + INTEGER, INTENT(IN) :: index_type + INTEGER, INTENT(IN) :: order + + TYPE(C_FUNPTR):: op + TYPE(C_PTR) :: op_data + INTEGER, INTENT(OUT) :: return_value + INTEGER, INTENT(OUT) :: hdferr +!***** + + INTERFACE + INTEGER FUNCTION h5ovisit_c(object_id, index_type, order, op, op_data) & + BIND(C, NAME='h5ovisit_c') + IMPORT :: C_FUNPTR, C_PTR + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: object_id + INTEGER, INTENT(IN) :: index_type + INTEGER, INTENT(IN) :: order + TYPE(C_FUNPTR), VALUE :: op + TYPE(C_PTR), VALUE :: op_data + END FUNCTION h5ovisit_c + END INTERFACE + + return_value = h5ovisit_c(object_id, index_type, order, op, op_data) + + IF(return_value.GE.0)THEN + hdferr = 0 + ELSE + hdferr = -1 + END IF + + END SUBROUTINE h5ovisit_f + +!****s* H5O (F03)/h5oget_info_by_name_f_F03 +! +! NAME +! h5oget_info_by_name_f +! +! PURPOSE +! Retrieves the metadata for an object, identifying the object by location and relative name. +! +! Inputs: +! loc_id - File or group identifier specifying location of group +! in which object is located. +! name - Name of group, relative to loc_id. +! +! Outputs: +! object_info - Buffer in which to return object information. +! hdferr - Returns 0 if successful and -1 if fails. +! +! Optional parameters: +! lapl_id - Link access property list. +! +! AUTHOR +! M. Scot Breitenfeld +! December 1, 2008 +! +! Fortran2003 Interface: + SUBROUTINE h5oget_info_by_name_f(loc_id, name, object_info, hdferr, lapl_id) + IMPLICIT NONE + INTEGER(HID_T) , INTENT(IN) :: loc_id + CHARACTER(LEN=*), INTENT(IN) :: name + TYPE(h5o_info_t), INTENT(OUT), TARGET :: object_info + INTEGER , INTENT(OUT) :: hdferr + INTEGER(HID_T) , INTENT(IN) , OPTIONAL :: lapl_id +!***** + INTEGER(SIZE_T) :: namelen + INTEGER(HID_T) :: lapl_id_default + TYPE(C_PTR) :: ptr + + INTERFACE + INTEGER FUNCTION h5oget_info_by_name_c(loc_id, name, namelen, lapl_id_default, object_info) & + BIND(C, NAME='h5oget_info_by_name_c') + IMPORT :: c_char, c_ptr + IMPORT :: HID_T, SIZE_T + IMPLICIT NONE + INTEGER(HID_T) , INTENT(IN) :: loc_id + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: name + INTEGER(SIZE_T) , INTENT(IN) :: namelen + INTEGER(HID_T) , INTENT(IN) :: lapl_id_default + TYPE(C_PTR),VALUE :: object_info + + END FUNCTION h5oget_info_by_name_c + END INTERFACE + + namelen = LEN(name) + + lapl_id_default = H5P_DEFAULT_F + IF(PRESENT(lapl_id)) lapl_id_default = lapl_id + + ptr = C_LOC(object_info) + + hdferr = H5Oget_info_by_name_c(loc_id, name, namelen, lapl_id_default, ptr) + + END SUBROUTINE H5Oget_info_by_name_f + +!****s* H5O (F03)/h5oget_info_f_F03 +! +! NAME +! h5oget_info_f +! +! PURPOSE +! Retrieves the metadata for an object specified by an identifier. +! +! Inputs: +! object_id - Identifier for target object. +! +! Outputs: +! object_info - Buffer in which to return object information. +! hdferr - Returns 0 if successful and -1 if fails. +! +! AUTHOR +! M. Scot Breitenfeld +! May 11, 2012 +! +! Fortran2003 Interface: + SUBROUTINE h5oget_info_f(object_id, object_info, hdferr) + + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T) , INTENT(IN) :: object_id + TYPE(h5o_info_t), INTENT(OUT), TARGET :: object_info + INTEGER , INTENT(OUT) :: hdferr +!***** + TYPE(C_PTR) :: ptr + + INTERFACE + INTEGER FUNCTION h5oget_info_c(object_id, object_info) & + BIND(C, NAME='h5oget_info_c') + IMPORT :: C_PTR + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: object_id + TYPE(C_PTR), VALUE :: object_info + END FUNCTION h5oget_info_c + END INTERFACE + + ptr = C_LOC(object_info) + hdferr = H5Oget_info_c(object_id, ptr) + + END SUBROUTINE H5Oget_info_f + +!****s* H5O (F03)/h5oget_info_by_idx_f_F03 +! +! NAME +! h5oget_info_by_idx_f +! +! PURPOSE +! Retrieves the metadata for an object, identifying the object by an index position. +! +! Inputs: +! loc_id - File or group identifier specifying location of group +! in which object is located. +! group_name - Name of group in which object is located. +! index_field - Index or field that determines the order. +! order - Order within field or index. +! n - Object for which information is to be returned +! +! Outputs: +! object_info - Buffer in which to return object information. +! hdferr - Returns 0 if successful and -1 if fails. +! +! Optional parameters: +! lapl_id - Link access property list. (Not currently used.) +! +! AUTHOR +! M. Scot Breitenfeld +! May 11, 2012 +! +! Fortran2003 Interface: + SUBROUTINE h5oget_info_by_idx_f(loc_id, group_name, index_field, order, n, & + object_info, hdferr, lapl_id) + + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T) , INTENT(IN) :: loc_id + CHARACTER(LEN=*), INTENT(IN) :: group_name + INTEGER , INTENT(IN) :: index_field + INTEGER , INTENT(IN) :: order + INTEGER(HSIZE_T), INTENT(IN) :: n + TYPE(h5o_info_t), INTENT(OUT), TARGET :: object_info + INTEGER , INTENT(OUT) :: hdferr + INTEGER(HID_T) , INTENT(IN) , OPTIONAL :: lapl_id +!***** + INTEGER(SIZE_T) :: namelen + INTEGER(HID_T) :: lapl_id_default + TYPE(C_PTR) :: ptr + + INTERFACE + INTEGER FUNCTION h5oget_info_by_idx_c(loc_id, group_name, namelen, & + index_field, order, n, lapl_id_default, object_info) BIND(C, NAME='h5oget_info_by_idx_c') + IMPORT :: c_char, c_ptr, c_funptr + IMPORT :: HID_T, SIZE_T, HSIZE_T + INTEGER(HID_T) , INTENT(IN) :: loc_id + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: group_name + INTEGER(SIZE_T) , INTENT(IN) :: namelen + INTEGER , INTENT(IN) :: index_field + INTEGER , INTENT(IN) :: order + INTEGER(HSIZE_T), INTENT(IN) :: n + INTEGER(HID_T) , INTENT(IN) :: lapl_id_default + TYPE(C_PTR), VALUE :: object_info + + END FUNCTION h5oget_info_by_idx_c + END INTERFACE + + namelen = LEN(group_name) + + lapl_id_default = H5P_DEFAULT_F + IF(PRESENT(lapl_id)) lapl_id_default = lapl_id + + ptr = C_LOC(object_info) + hdferr = H5Oget_info_by_idx_c(loc_id, group_name, namelen, index_field, order, n, lapl_id_default, ptr) + + END SUBROUTINE H5Oget_info_by_idx_f + + +!****s* H5O (F03)/h5ovisit_by_name_f_F03 +! +! NAME +! h5ovisit_by_name_f +! +! PURPOSE +! Recursively visits all objects starting from a specified object. +! +! Inputs: +! loc_id - Identifier of a file or group. +! object_name - Name of the object, generally relative to loc_id, that will serve as root of the iteration +! index_type - Type of index; valid values include: +! H5_INDEX_NAME_F +! H5_INDEX_CRT_ORDER_F +! order - Order in which index is traversed; valid values include: +! H5_ITER_DEC_F +! H5_ITER_INC_F +! H5_ITER_NATIVE_F +! op - Callback function passing data regarding the group to the calling application +! op_data - User-defined pointer to data required by the application for its processing of the group +! +! Outputs: +! return_value - Returns the return value of the first operator that returns a positive value, or +! zero if all members were processed with no operator returning non-zero. +! hdferr - Returns 0 if successful and -1 if fails +! +! Optional parameters: +! lapl_id - Link access property list identifier. +! +! AUTHOR +! M. Scot Breitenfeld +! November 19, 2008 +! +! Fortran2003 Interface: + SUBROUTINE h5ovisit_by_name_f(loc_id, object_name, index_type, order, op, op_data, & + return_value, hdferr, lapl_id) + IMPLICIT NONE + INTEGER(HID_T) , INTENT(IN) :: loc_id + CHARACTER(LEN=*), INTENT(IN) :: object_name + INTEGER , INTENT(IN) :: index_type + INTEGER , INTENT(IN) :: order + + TYPE(C_FUNPTR) :: op + TYPE(C_PTR) :: op_data + INTEGER , INTENT(OUT) :: return_value + INTEGER , INTENT(OUT) :: hdferr + INTEGER(HID_T) , INTENT(IN) , OPTIONAL :: lapl_id +!***** + + INTEGER(SIZE_T) :: namelen + INTEGER(HID_T) :: lapl_id_default + + INTERFACE + INTEGER FUNCTION h5ovisit_by_name_c(loc_id, object_name, namelen, index_type, order, & + op, op_data, lapl_id) BIND(C, NAME='h5ovisit_by_name_c') + IMPORT :: C_CHAR, C_PTR, C_FUNPTR + IMPORT :: HID_T, SIZE_T + IMPLICIT NONE + INTEGER(HID_T) , INTENT(IN) :: loc_id + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: object_name + INTEGER(SIZE_T) :: namelen + INTEGER , INTENT(IN) :: index_type + INTEGER , INTENT(IN) :: order + TYPE(C_FUNPTR) , VALUE :: op + TYPE(C_PTR) , VALUE :: op_data + INTEGER(HID_T) , INTENT(IN) :: lapl_id + END FUNCTION h5ovisit_by_name_c + END INTERFACE + + namelen = LEN(object_name) + + lapl_id_default = H5P_DEFAULT_F + IF(PRESENT(lapl_id)) lapl_id_default = lapl_id + + return_value = h5ovisit_by_name_c(loc_id, object_name, namelen, index_type, order, & + op, op_data, lapl_id_default) + + IF(return_value.GE.0)THEN + hdferr = 0 + ELSE + hdferr = -1 + END IF + + END SUBROUTINE h5ovisit_by_name_f + +END MODULE H5O + diff --git a/fortran/src/H5Off.f90 b/fortran/src/H5Off.f90 deleted file mode 100644 index 8a40079..0000000 --- a/fortran/src/H5Off.f90 +++ /dev/null @@ -1,775 +0,0 @@ -!****h* ROBODoc/H5O -! -! NAME -! MODULE H5O -! -! FILE -! fortran/src/H5Off.f90 -! -! PURPOSE -! This file contains Fortran interfaces for H5O functions. It includes -! all the functions that are independent on whether the Fortran 2003 functions -! are enabled or disabled. -! -! -! 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. * -! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -! -! NOTES -! *** IMPORTANT *** -! If you add a new H5O function you must add the function name to the -! Windows dll file 'hdf5_fortrandll.def.in' in the fortran/src directory. -! This is needed for Windows based operating systems. -! -!***** - -MODULE H5O - - USE H5GLOBAL - -CONTAINS - -!****s* H5O/h5olink_f -! -! NAME -! h5olink_f -! -! PURPOSE -! Creates a hard link to an object in an HDF5 file. -! -! Inputs: -! object_id - Object to be linked. -! new_loc_id - File or group identifier specifying location at which object is to be linked. -! new_link_name - Name of link to be created, relative to new_loc_id. -! -! Outputs: -! hdferr - Returns 0 if successful and -1 if fails. -! -! Optional parameters: -! lcpl_id - Link creation property list identifier. -! lapl_id - Link access property list identifier. -! -! AUTHOR -! M. Scot Breitenfeld -! April 21, 2008 -! -! Fortran90 Interface: - SUBROUTINE h5olink_f(object_id, new_loc_id, new_link_name, hdferr, lcpl_id, lapl_id) - IMPLICIT NONE - INTEGER(HID_T) , INTENT(IN) :: object_id - INTEGER(HID_T) , INTENT(IN) :: new_loc_id - CHARACTER(LEN=*), INTENT(IN) :: new_link_name - INTEGER , INTENT(OUT) :: hdferr - INTEGER(HID_T) , INTENT(IN), OPTIONAL :: lcpl_id - INTEGER(HID_T) , INTENT(IN), OPTIONAL :: lapl_id -!***** - INTEGER(HID_T) :: lapl_id_default - INTEGER(HID_T) :: lcpl_id_default - - INTEGER(SIZE_T) :: new_link_namelen - - INTERFACE - INTEGER FUNCTION h5olink_c(object_id, new_loc_id, new_link_name, new_link_namelen, & - lcpl_id_default, lapl_id_default) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5OLINK_C'::h5olink_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: new_link_name - INTEGER(HID_T), INTENT(IN) :: object_id - INTEGER(HID_T), INTENT(IN) :: new_loc_id - CHARACTER(LEN=*), INTENT(IN) :: new_link_name - INTEGER(SIZE_T) :: new_link_namelen - INTEGER(HID_T) :: lapl_id_default - INTEGER(HID_T) :: lcpl_id_default - END FUNCTION h5olink_c - END INTERFACE - - new_link_namelen = LEN(new_link_name) - - lapl_id_default = H5P_DEFAULT_F - IF(PRESENT(lapl_id)) lapl_id_default = lapl_id - lcpl_id_default = H5P_DEFAULT_F - IF(PRESENT(lcpl_id)) lcpl_id_default = lcpl_id - - hdferr = h5olink_c(object_id, new_loc_id, new_link_name, new_link_namelen, & - lcpl_id_default, lapl_id_default) - - END SUBROUTINE h5olink_f - -!****s* H5O/h5oopen_f -! -! NAME -! h5oopen_f -! -! PURPOSE -! Opens an object in an HDF5 file by location identifier and path name. -! -! Inputs: -! loc_id - File or group identifier. -! name - Path to the object, relative to loc_id. -! -! Outputs: -! obj_id - Object identifier for the opened object. -! hdferr - Returns 0 if successful and -1 if fails. -! -! Optional parameters: -! lapl_id - Access property list identifier for the link pointing to the object. -! -! AUTHOR -! M. Scot Breitenfeld -! April 18, 2008 -! -! Fortran90 Interface: - SUBROUTINE h5oopen_f(loc_id, name, obj_id, hdferr, lapl_id) - IMPLICIT NONE - INTEGER(HID_T) , INTENT(IN) :: loc_id - CHARACTER(LEN=*), INTENT(IN) :: name - INTEGER(HID_T) , INTENT(OUT) :: obj_id - INTEGER , INTENT(OUT) :: hdferr - INTEGER(HID_T) , INTENT(IN), OPTIONAL :: lapl_id -!***** - INTEGER(HID_T) :: lapl_id_default - INTEGER(SIZE_T) :: namelen - - INTERFACE - INTEGER FUNCTION h5oopen_c(loc_id, name, namelen, lapl_id_default, obj_id) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5OOPEN_C'::h5oopen_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: name - INTEGER(HID_T), INTENT(IN) :: loc_id - CHARACTER(LEN=*), INTENT(IN) :: name - INTEGER(HID_T) :: lapl_id_default - INTEGER(SIZE_T) :: namelen - INTEGER(HID_T), INTENT(OUT) :: obj_id - END FUNCTION h5oopen_c - END INTERFACE - - namelen = LEN(name) - - lapl_id_default = H5P_DEFAULT_F - IF(PRESENT(lapl_id)) lapl_id_default = lapl_id - - hdferr = h5oopen_c(loc_id, name, namelen, lapl_id_default, obj_id) - - END SUBROUTINE h5oopen_f -! -!****s* H5O/h5oclose_f -! -! NAME -! h5oclose_f -! -! PURPOSE -! Closes an object in an HDF5 file. -! -! Inputs: -! object_id - Object identifier. -! -! Outputs: -! hdferr - Returns 0 if successful and -1 if fails. -! -! AUTHOR -! M. Scot Breitenfeld -! December 17, 2008 -! -! Fortran90 Interface: - SUBROUTINE h5oclose_f(object_id, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: object_id - INTEGER , INTENT(OUT) :: hdferr -!***** - INTERFACE - INTEGER FUNCTION h5oclose_c(object_id) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5OCLOSE_C'::h5oclose_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: object_id - END FUNCTION h5oclose_c - END INTERFACE - - hdferr = h5oclose_c(object_id) - END SUBROUTINE h5oclose_f - -! -!****s* H5O/h5open_by_addr_f -! NAME -! h5oopen_by_addr_f -! -! PURPOSE -! Opens an object using its address within an HDF5 file. -! -! Inputs: -! loc_id - File or group identifier. -! addr - Object’s address in the file. -! -! Outputs: -! obj_id - Object identifier for the opened object. -! hdferr - Returns 0 if successful and -1 if fails. -! -! AUTHOR -! M. Scot Breitenfeld -! September 14, 2009 -! -! Fortran90 Interface: - SUBROUTINE h5oopen_by_addr_f(loc_id, addr, obj_id, hdferr) - IMPLICIT NONE - INTEGER(HID_T) , INTENT(IN) :: loc_id - INTEGER(HADDR_T), INTENT(IN) :: addr - INTEGER(HID_T) , INTENT(OUT) :: obj_id - INTEGER , INTENT(OUT) :: hdferr -!***** - INTERFACE - INTEGER FUNCTION h5oopen_by_addr_c(loc_id, addr, obj_id) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5OOPEN_BY_ADDR_C'::h5oopen_by_addr_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: loc_id - INTEGER(HADDR_T), INTENT(IN) :: addr - INTEGER(HID_T), INTENT(OUT) :: obj_id - END FUNCTION h5oopen_by_addr_c - END INTERFACE - - hdferr = h5oopen_by_addr_c(loc_id, addr, obj_id) - - END SUBROUTINE h5oopen_by_addr_f -! -!****s* H5O/h5ocopy_f -! NAME -! h5ocopy_f -! -! PURPOSE -! Copies an object in an HDF5 file. -! -! Inputs: -! src_loc_id - Object identifier indicating the location of the source object to be copied. -! src_name - Name of the source object to be copied. -! dst_loc_id - Location identifier specifying the destination. -! dst_name - Name to be assigned to the new copy. -! -! Optional parameters: -! ocpypl_id - Object copy property list. -! lcpl_id - Link creation property list for the new hard link. -! -! Outputs: -! hdferr - Returns 0 if successful and -1 if fails. -! -! AUTHOR -! M. Scot Breitenfeld -! March 14, 2012 -! -! Fortran90 Interface: - SUBROUTINE h5ocopy_f(src_loc_id, src_name, dst_loc_id, dst_name, hdferr, ocpypl_id, lcpl_id) - IMPLICIT NONE - INTEGER(HID_T) , INTENT(IN) :: src_loc_id - CHARACTER(LEN=*), INTENT(IN) :: src_name - INTEGER(HID_T) , INTENT(IN) :: dst_loc_id - CHARACTER(LEN=*), INTENT(IN) :: dst_name - INTEGER , INTENT(OUT) :: hdferr - INTEGER(HID_T) , INTENT(IN), OPTIONAL :: ocpypl_id - INTEGER(HID_T) , INTENT(IN), OPTIONAL :: lcpl_id -!***** - - INTEGER(SIZE_T) :: src_name_len, dst_name_len - INTEGER(HID_T) :: ocpypl_id_default, lcpl_id_default - - INTERFACE - INTEGER FUNCTION h5ocopy_c(src_loc_id, src_name, src_name_len, & - dst_loc_id, dst_name, dst_name_len, ocpypl_id_default, lcpl_id_default) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5OCOPY_C'::h5ocopy_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: src_name, dst_name - INTEGER(HID_T) , INTENT(IN) :: src_loc_id - CHARACTER(LEN=*), INTENT(IN) :: src_name - INTEGER(HID_T) , INTENT(IN) :: dst_loc_id - CHARACTER(LEN=*), INTENT(IN) :: dst_name - INTEGER(HID_T) , INTENT(IN) :: ocpypl_id_default - INTEGER(HID_T) , INTENT(IN) :: lcpl_id_default - INTEGER(SIZE_T) :: src_name_len, dst_name_len - - END FUNCTION h5ocopy_c - END INTERFACE - - src_name_len = LEN(src_name) - dst_name_len = LEN(dst_name) - - ocpypl_id_default = H5P_DEFAULT_F - IF(PRESENT(ocpypl_id)) ocpypl_id_default = ocpypl_id - lcpl_id_default = H5P_DEFAULT_F - IF(PRESENT(lcpl_id)) lcpl_id_default = lcpl_id - - hdferr = h5ocopy_c(src_loc_id, src_name, src_name_len, & - dst_loc_id, dst_name, dst_name_len, ocpypl_id_default, lcpl_id_default) - - END SUBROUTINE h5ocopy_f - -!****s* H5O/h5odecr_refcount_f -! NAME -! h5odecr_refcount_f -! -! PURPOSE -! Decrements an object reference count. -! -! Inputs: -! object_id - Object identifier. -! -! Outputs: -! hdferr - Returns 0 if successful and -1 if fails. -! -! AUTHOR -! M. Scot Breitenfeld -! May 11, 2012 -! -! Fortran90 Interface: - SUBROUTINE h5odecr_refcount_f(object_id, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: object_id - INTEGER , INTENT(OUT) :: hdferr -!***** - - INTERFACE - INTEGER FUNCTION h5odecr_refcount_c(object_id) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5ODECR_REFCOUNT_C'::h5odecr_refcount_c - !DEC$ENDIF - INTEGER(HID_T) , INTENT(IN) :: object_id - END FUNCTION h5odecr_refcount_c - END INTERFACE - - hdferr = h5odecr_refcount_c(object_id) - - END SUBROUTINE h5odecr_refcount_f - -!****s* H5O/h5oexists_by_name_f -! NAME -! h5oexists_by_name_f -! -! PURPOSE -! Determines whether a link resolves to an actual object. -! -! Inputs: -! loc_id - Identifier of the file or group to query. -! name - The name of the link to check. -! -! -! Optional parameters: -! lapl_id - Link access property list identifier. -! -! Outputs: -! link_exists - Existing link resolves to an object. -! hdferr - Returns 0 if successful and -1 if fails. -! -! AUTHOR -! M. Scot Breitenfeld -! May 11, 2012 -! -! Fortran90 Interface: - SUBROUTINE h5oexists_by_name_f(loc_id, name, link_exists, hdferr, lapl_id) - IMPLICIT NONE - INTEGER(HID_T) , INTENT(IN) :: loc_id - CHARACTER(LEN=*), INTENT(IN) :: name - LOGICAL , INTENT(OUT) :: link_exists - INTEGER , INTENT(OUT) :: hdferr - INTEGER(HID_T) , INTENT(IN), OPTIONAL :: lapl_id -!***** - - INTEGER(size_t) :: namelen - INTEGER :: status - INTEGER(HID_T) :: lapl_id_default - - INTERFACE - INTEGER FUNCTION h5oexists_by_name_c(loc_id, name, namelen, lapl_id) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5OEXISTS_BY_NAME_C'::h5oexists_by_name_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: name - INTEGER(HID_T) , INTENT(IN) :: loc_id - CHARACTER(LEN=*), INTENT(IN) :: name - INTEGER(SIZE_T) , INTENT(IN) :: namelen - INTEGER(HID_T) , INTENT(IN) :: lapl_id - - END FUNCTION h5oexists_by_name_c - END INTERFACE - - namelen = LEN(name) - - lapl_id_default = H5P_DEFAULT_F - IF(PRESENT(lapl_id)) lapl_id_default = lapl_id - - status = h5oexists_by_name_c(loc_id, name, namelen, lapl_id_default) - - link_exists = .FALSE. - IF(status.EQ.1)THEN - link_exists = .TRUE. - ENDIF - - hdferr = 0 - IF(status.LT.0)THEN - hdferr = -1 - ENDIF - - END SUBROUTINE h5oexists_by_name_f - -!****s* H5O/h5oget_comment_f -! NAME -! h5oget_comment_f -! -! PURPOSE -! Retrieves comment for specified object. -! -! Inputs: -! obj_id - Identifier for the target object. -! -! Optional parameters: -! bufsize - Size of the comment buffer. -! -! Outputs: -! comment - The comment. -! hdferr - Returns 0 if successful and -1 if fails. -! -! AUTHOR -! M. Scot Breitenfeld -! May 11, 2012 -! -! Fortran90 Interface: - SUBROUTINE h5oget_comment_f(obj_id, comment, hdferr, bufsize) - IMPLICIT NONE - INTEGER(HID_T) , INTENT(IN) :: obj_id - CHARACTER(LEN=*) , INTENT(OUT) :: comment - INTEGER , INTENT(OUT) :: hdferr - INTEGER(HSSIZE_T), INTENT(OUT), OPTIONAL :: bufsize -!***** - - INTEGER(SIZE_T) :: commentsize_default - INTEGER(HSSIZE_T) :: bufsize_default - - INTERFACE - INTEGER FUNCTION h5oget_comment_c(obj_id, comment, commentsize_default, bufsize) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5OGET_COMMENT_C'::h5oget_comment_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: comment - INTEGER(HID_T) , INTENT(IN) :: obj_id - CHARACTER(LEN=*), INTENT(OUT) :: comment - INTEGER(SIZE_T) , INTENT(IN) :: commentsize_default - INTEGER(HSSIZE_T) , INTENT(OUT) :: bufsize - END FUNCTION h5oget_comment_c - END INTERFACE - - commentsize_default = LEN(comment) - - hdferr = h5oget_comment_c(obj_id, comment, commentsize_default, bufsize_default) - - IF(PRESENT(bufsize)) bufsize = bufsize_default - - END SUBROUTINE h5oget_comment_f - -!****s* H5O/h5oget_comment_by_name_f -! NAME -! h5oget_comment_by_name_f -! -! PURPOSE -! Retrieves comment for specified object. -! -! Inputs: -! loc_id - Identifier of a file, group, dataset, or named datatype. -! name - Name of the object whose comment is to be retrieved, -! specified as a path relative to loc_id. -! -! Optional parameters: -! bufsize - Size of the comment buffer. -! -! Outputs: -! comment - The comment. -! hdferr - Returns 0 if successful and -1 if fails. -! -! AUTHOR -! M. Scot Breitenfeld -! July 6, 2012 -! -! Fortran90 Interface: - SUBROUTINE h5oget_comment_by_name_f(loc_id, name, comment, hdferr, bufsize, lapl_id) - IMPLICIT NONE - INTEGER(HID_T) , INTENT(IN) :: loc_id - CHARACTER(LEN=*), INTENT(IN) :: name - CHARACTER(LEN=*), INTENT(OUT) :: comment - INTEGER , INTENT(OUT) :: hdferr - INTEGER(SIZE_T) , INTENT(OUT), OPTIONAL :: bufsize - INTEGER(HID_T) , INTENT(IN) , OPTIONAL :: lapl_id -!***** - - INTEGER(SIZE_T) :: commentsize_default - INTEGER(SIZE_T) :: name_size - INTEGER(SIZE_T) :: bufsize_default - INTEGER(HID_T) :: lapl_id_default - INTERFACE - INTEGER FUNCTION h5oget_comment_by_name_c(loc_id, name, name_size, & - comment, commentsize_default, bufsize_default, lapl_id) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5OGET_COMMENT_BY_NAME_C'::h5oget_comment_by_name_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: comment, name - INTEGER(HID_T) , INTENT(IN) :: loc_id - CHARACTER(LEN=*), INTENT(IN) :: name - INTEGER(SIZE_T) , INTENT(IN) :: name_size - CHARACTER(LEN=*), INTENT(OUT) :: comment - INTEGER(SIZE_T) , INTENT(IN) :: commentsize_default - INTEGER(SIZE_T) , INTENT(OUT) :: bufsize_default - INTEGER(HID_T) , INTENT(IN) :: lapl_id - END FUNCTION h5oget_comment_by_name_c - END INTERFACE - - commentsize_default = LEN(comment) - name_size = LEN(name) - - lapl_id_default = H5P_DEFAULT_F - IF(PRESENT(lapl_id)) lapl_id_default = lapl_id - - hdferr = h5oget_comment_by_name_c(loc_id, name, name_size, & - comment, commentsize_default, bufsize_default, lapl_id_default) - - IF(PRESENT(bufsize)) bufsize = bufsize_default - - END SUBROUTINE h5oget_comment_by_name_f - -!****s* H5O/h5oincr_refcount_f -! NAME -! h5oincr_refcount_f -! -! PURPOSE -! Increments an object reference count. -! -! Inputs: -! obj_id - Object identifier. -! -! Outputs: -! hdferr - Returns 0 if successful and -1 if fails. -! -! AUTHOR -! M. Scot Breitenfeld -! May 15, 2012 -! -! Fortran90 Interface: - SUBROUTINE h5oincr_refcount_f(obj_id, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: obj_id - INTEGER , INTENT(OUT) :: hdferr -!***** - - INTERFACE - INTEGER FUNCTION h5oincr_refcount_c(obj_id) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5OINCR_REFCOUNT_C'::h5oincr_refcount_c - !DEC$ENDIF - INTEGER(HID_T) , INTENT(IN) :: obj_id - END FUNCTION h5oincr_refcount_c - END INTERFACE - - hdferr = h5oincr_refcount_c(obj_id) - - END SUBROUTINE h5oincr_refcount_f - -!****s* H5O/h5oopen_by_idx_f -! -! NAME -! h5oopen_by_idx_f -! -! PURPOSE -! Open the nth object in a group. -! -! Inputs: -! loc_id - A file or group identifier. -! group_name - Name of group, relative to loc_id, in which object is located. -! index_type - Type of index by which objects are ordered. -! order - Order of iteration within index, NOTE: zero-based. -! n - Object to open. -! -! Outputs: -! obj_id - An object identifier for the opened object. -! hdferr - Returns 0 if successful and -1 if fails. -! -! Optional parameters: -! lapl_id - Link access property list. -! -! AUTHOR -! M. Scot Breitenfeld -! May 17, 2012 -! -! Fortran90 Interface: - SUBROUTINE h5oopen_by_idx_f(loc_id, group_name, index_type, order, n, obj_id, & - hdferr, lapl_id) - IMPLICIT NONE - INTEGER(HID_T) , INTENT(IN) :: loc_id - CHARACTER(LEN=*), INTENT(IN) :: group_name - INTEGER , INTENT(IN) :: index_type - INTEGER , INTENT(IN) :: order - INTEGER(HSIZE_T), INTENT(IN) :: n - INTEGER(HID_T) , INTENT(OUT) :: obj_id - INTEGER , INTENT(OUT) :: hdferr - INTEGER(HID_T) , INTENT(IN) , OPTIONAL :: lapl_id -!***** - INTEGER(SIZE_T) :: group_namelen - INTEGER(HID_T) :: lapl_id_default - - INTERFACE - INTEGER FUNCTION h5oopen_by_idx_c(loc_id, group_name, group_namelen, index_type, order, n, obj_id, lapl_id_default) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5OOPEN_BY_IDX_C'::h5oopen_by_idx_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: group_name - INTEGER(HID_T) , INTENT(IN) :: loc_id - CHARACTER(LEN=*), INTENT(IN) :: group_name - INTEGER(SIZE_T) , INTENT(IN) :: group_namelen - INTEGER , INTENT(IN) :: index_type - INTEGER , INTENT(IN) :: order - INTEGER(HSIZE_T), INTENT(IN) :: n - INTEGER(HID_T) , INTENT(OUT) :: obj_id - INTEGER(HID_T) , INTENT(IN) :: lapl_id_default - - END FUNCTION h5oopen_by_idx_c - END INTERFACE - - group_namelen = LEN(group_name) - - lapl_id_default = H5P_DEFAULT_F - IF(PRESENT(lapl_id)) lapl_id_default = lapl_id - - hdferr = h5oopen_by_idx_c(loc_id, group_name, group_namelen, index_type, order, n, obj_id, lapl_id_default) - - END SUBROUTINE H5Oopen_by_idx_f - -!****s* H5O/h5oset_comment_f -! NAME -! h5oset_comment_f -! -! PURPOSE -! Sets comment for specified object. -! -! Inputs: -! obj_id - Identifier of the target object. -! comment - The new comment. -! -! Outputs: -! hdferr - Returns 0 if successful and -1 if fails. -! -! AUTHOR -! M. Scot Breitenfeld -! May 15, 2012 -! -! Fortran90 Interface: - SUBROUTINE h5oset_comment_f(obj_id, comment, hdferr) - IMPLICIT NONE - INTEGER(HID_T) , INTENT(IN) :: obj_id - CHARACTER(LEN=*), INTENT(IN) :: comment - INTEGER , INTENT(OUT) :: hdferr -!***** - INTEGER(SIZE_T) :: commentlen - - INTERFACE - INTEGER FUNCTION h5oset_comment_c(obj_id, comment, commentlen) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5OSET_COMMENT_C'::h5oset_comment_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: comment - INTEGER(HID_T) , INTENT(IN) :: obj_id - CHARACTER(LEN=*), INTENT(IN) :: comment - INTEGER(SIZE_T) , INTENT(IN) :: commentlen - - END FUNCTION h5oset_comment_c - END INTERFACE - - commentlen = LEN(comment) - - hdferr = h5oset_comment_c(obj_id, comment, commentlen) - - END SUBROUTINE h5oset_comment_f - -!****s* H5O/h5oset_comment_by_name_f -! NAME -! h5oset_comment_by_name_f -! -! PURPOSE -! Sets comment for specified object. -! -! Inputs: -! loc_id - Identifier of a file, group, dataset, or named datatype. -! name - Name of the object whose comment is to be set or reset, -! specified as a path relative to loc_id. -! comment - The new comment. -! -! Outputs: -! hdferr - Returns 0 if successful and -1 if fails. -! -! Optional parameters: -! lapl_id - Link access property list identifier. -! -! AUTHOR -! M. Scot Breitenfeld -! May 15, 2012 -! -! Fortran90 Interface: - SUBROUTINE h5oset_comment_by_name_f(loc_id, name, comment, hdferr, lapl_id) - IMPLICIT NONE - INTEGER(HID_T) , INTENT(IN) :: loc_id - CHARACTER(LEN=*), INTENT(IN) :: name - CHARACTER(LEN=*), INTENT(IN) :: comment - INTEGER , INTENT(OUT) :: hdferr - INTEGER(HID_T) , INTENT(IN), OPTIONAL :: lapl_id -!***** - INTEGER(SIZE_T) :: commentlen - INTEGER(SIZE_T) :: namelen - INTEGER(HID_T) :: lapl_id_default - - INTERFACE - INTEGER FUNCTION h5oset_comment_by_name_c(loc_id, name, namelen, comment, commentlen, lapl_id) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5OSET_COMMENT_BY_NAME_C'::h5oset_comment_by_name_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: name, comment - INTEGER(HID_T) , INTENT(IN) :: loc_id - CHARACTER(LEN=*), INTENT(IN) :: comment - INTEGER(SIZE_T) , INTENT(IN) :: commentlen - CHARACTER(LEN=*), INTENT(IN) :: name - INTEGER(SIZE_T) , INTENT(IN) :: namelen - INTEGER(HID_T) , INTENT(IN) :: lapl_id - END FUNCTION h5oset_comment_by_name_c - END INTERFACE - - commentlen = LEN(comment) - namelen = LEN(name) - - lapl_id_default = H5P_DEFAULT_F - IF(PRESENT(lapl_id)) lapl_id_default = lapl_id - - hdferr = h5oset_comment_by_name_c(loc_id, name, namelen, comment, commentlen, lapl_id_default) - - END SUBROUTINE h5oset_comment_by_name_f - -END MODULE H5O - diff --git a/fortran/src/H5Off_F03.f90 b/fortran/src/H5Off_F03.f90 deleted file mode 100644 index 36b6246..0000000 --- a/fortran/src/H5Off_F03.f90 +++ /dev/null @@ -1,435 +0,0 @@ -!****h* ROBODoc/H5O (F03) -! -! NAME -! H5O_PROVISIONAL -! -! PURPOSE -! This file contains Fortran 90 and Fortran 2003 interfaces for H5O functions. -! It contains the same functions as H5Off_F90.f90 but includes the -! Fortran 2003 functions and the interface listings. This file will be compiled -! instead of H5Off_F90.f90 if Fortran 2003 functions are enabled. -! -! 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. * -! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -! -! NOTES -! *** IMPORTANT *** -! If you add a new H5P function you must add the function name to the -! Windows dll file 'hdf5_fortrandll.def.in' in the fortran/src directory. -! This is needed for Windows based operating systems. -! -!***** - -MODULE H5O_PROVISIONAL - - USE H5GLOBAL - USE, INTRINSIC :: ISO_C_BINDING - - IMPLICIT NONE - -!****t* H5T (F03)/h5o_info_t -! -! Fortran2003 Derived Type: -! - TYPE, BIND(C) :: space_t - INTEGER(hsize_t) :: total ! Total space for storing object header in file - INTEGER(hsize_t) :: meta ! Space within header for object header metadata information - INTEGER(hsize_t) :: mesg ! Space within header for actual message information - INTEGER(hsize_t) :: free ! Free space within object header - END TYPE space_t - - TYPE, BIND(C) :: mesg_t - INTEGER(c_int64_t) :: present ! Flags to indicate presence of message type in header - INTEGER(c_int64_t) :: shared ! Flags to indicate message type is shared in header - END TYPE mesg_t - - TYPE, BIND(C) :: hdr_t - INTEGER :: version ! Version number of header format in file - INTEGER :: nmesgs ! Number of object header messages - INTEGER :: nchunks ! Number of object header chunks - INTEGER :: flags ! Object header status flags - TYPE(space_t) :: space - TYPE(mesg_t) :: mesg - END TYPE hdr_t - - ! Extra metadata storage for obj & attributes - TYPE, BIND(C) :: H5_ih_info_t - INTEGER(hsize_t) :: index_size ! btree and/or list - INTEGER(hsize_t) :: heap_size - END TYPE H5_ih_info_t - - TYPE, BIND(C) :: meta_size_t - TYPE(H5_ih_info_t) :: obj ! v1/v2 B-tree & local/fractal heap for groups, B-tree for chunked datasets - TYPE(H5_ih_info_t) :: attr ! v2 B-tree & heap for attributes - ENDTYPE meta_size_t - - TYPE, BIND(C) :: h5o_info_t - INTEGER(C_LONG) :: fileno ! File number that object is located in - INTEGER(haddr_t) :: addr ! Object address in file - INTEGER(C_INT) :: type ! Basic object type (group, dataset, etc.) - INTEGER :: rc ! Reference count of object - - INTEGER, DIMENSION(8) :: atime ! Access time ! -- NOTE -- - INTEGER, DIMENSION(8) :: mtime ! Modification time ! Returns an integer array - INTEGER, DIMENSION(8) :: ctime ! Change time ! as specified in the Fortran - INTEGER, DIMENSION(8) :: btime ! Birth time ! intrinsic DATE_AND_TIME(VALUES) - - INTEGER(hsize_t) :: num_attrs ! # of attributes attached to object - - TYPE(hdr_t) :: hdr - - TYPE(meta_size_t) :: meta_size - END TYPE h5o_info_t - -!***** - -CONTAINS - -!****s* H5O (F03)/h5ovisit_f_F03 -! -! NAME -! h5ovisit_f -! -! PURPOSE -! Recursively visits all objects starting from a specified object. -! -! Inputs: -! object_id - Identifier of the object at which the recursive iteration begins. -! index_type - Type of index; valid values include: -! H5_INDEX_NAME_F -! H5_INDEX_CRT_ORDER_F -! order - Order in which index is traversed; valid values include: -! H5_ITER_DEC_F -! H5_ITER_INC_F -! H5_ITER_NATIVE_F -! op - Callback function passing data regarding the group to the calling application -! op_data - User-defined pointer to data required by the application for its processing of the group -! -! Outputs: -! return_value - returns the return value of the first operator that returns a positive value, or -! zero if all members were processed with no operator returning non-zero. -! hdferr - Returns 0 if successful and -1 if fails -! AUTHOR -! M. Scot Breitenfeld -! November 19, 2008 -! -! Fortran2003 Interface: - SUBROUTINE h5ovisit_f(object_id, index_type, order, op, op_data, return_value, hdferr) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: object_id - INTEGER, INTENT(IN) :: index_type - INTEGER, INTENT(IN) :: order - - TYPE(C_FUNPTR):: op - TYPE(C_PTR) :: op_data - INTEGER, INTENT(OUT) :: return_value - INTEGER, INTENT(OUT) :: hdferr -!***** - - INTERFACE - INTEGER FUNCTION h5ovisit_c(object_id, index_type, order, op, op_data) & - BIND(C, NAME='h5ovisit_c') - USE, INTRINSIC :: ISO_C_BINDING, ONLY : c_ptr, c_funptr - USE H5GLOBAL - INTEGER(HID_T), INTENT(IN) :: object_id - INTEGER, INTENT(IN) :: index_type - INTEGER, INTENT(IN) :: order - TYPE(C_FUNPTR), VALUE :: op - TYPE(C_PTR), VALUE :: op_data - END FUNCTION h5ovisit_c - END INTERFACE - - return_value = h5ovisit_c(object_id, index_type, order, op, op_data) - - IF(return_value.GE.0)THEN - hdferr = 0 - ELSE - hdferr = -1 - END IF - - END SUBROUTINE h5ovisit_f - -!****s* H5O (F03)/h5oget_info_by_name_f_F03 -! -! NAME -! h5oget_info_by_name_f -! -! PURPOSE -! Retrieves the metadata for an object, identifying the object by location and relative name. -! -! Inputs: -! loc_id - File or group identifier specifying location of group -! in which object is located. -! name - Name of group, relative to loc_id. -! -! Outputs: -! object_info - Buffer in which to return object information. -! hdferr - Returns 0 if successful and -1 if fails. -! -! Optional parameters: -! lapl_id - Link access property list. -! -! AUTHOR -! M. Scot Breitenfeld -! December 1, 2008 -! -! Fortran2003 Interface: - SUBROUTINE h5oget_info_by_name_f(loc_id, name, object_info, hdferr, lapl_id) - - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T) , INTENT(IN) :: loc_id - CHARACTER(LEN=*), INTENT(IN) :: name - TYPE(h5o_info_t), INTENT(OUT), TARGET :: object_info - INTEGER , INTENT(OUT) :: hdferr - INTEGER(HID_T) , INTENT(IN) , OPTIONAL :: lapl_id -!***** - INTEGER(SIZE_T) :: namelen - INTEGER(HID_T) :: lapl_id_default - TYPE(C_PTR) :: ptr - - INTERFACE - INTEGER FUNCTION h5oget_info_by_name_c(loc_id, name, namelen, lapl_id_default, object_info) & - BIND(C, NAME='h5oget_info_by_name_c') - USE, INTRINSIC :: ISO_C_BINDING, ONLY : c_char, c_ptr - USE H5GLOBAL - INTEGER(HID_T) , INTENT(IN) :: loc_id - CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: name - INTEGER(SIZE_T) , INTENT(IN) :: namelen - INTEGER(HID_T) , INTENT(IN) :: lapl_id_default - TYPE(C_PTR),VALUE :: object_info - - END FUNCTION h5oget_info_by_name_c - END INTERFACE - - namelen = LEN(name) - - lapl_id_default = H5P_DEFAULT_F - IF(PRESENT(lapl_id)) lapl_id_default = lapl_id - - ptr = C_LOC(object_info) - - hdferr = H5Oget_info_by_name_c(loc_id, name, namelen, lapl_id_default, ptr) - - END SUBROUTINE H5Oget_info_by_name_f - -!****s* H5O (F03)/h5oget_info_f_F03 -! -! NAME -! h5oget_info_f -! -! PURPOSE -! Retrieves the metadata for an object specified by an identifier. -! -! Inputs: -! object_id - Identifier for target object. -! -! Outputs: -! object_info - Buffer in which to return object information. -! hdferr - Returns 0 if successful and -1 if fails. -! -! AUTHOR -! M. Scot Breitenfeld -! May 11, 2012 -! -! Fortran2003 Interface: - SUBROUTINE h5oget_info_f(object_id, object_info, hdferr) - - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T) , INTENT(IN) :: object_id - TYPE(h5o_info_t), INTENT(OUT), TARGET :: object_info - INTEGER , INTENT(OUT) :: hdferr -!***** - TYPE(C_PTR) :: ptr - - INTERFACE - INTEGER FUNCTION h5oget_info_c(object_id, object_info) & - BIND(C, NAME='h5oget_info_c') - USE H5GLOBAL - USE, INTRINSIC :: ISO_C_BINDING, ONLY : c_ptr - INTEGER(HID_T), INTENT(IN) :: object_id - TYPE(C_PTR), VALUE :: object_info - END FUNCTION h5oget_info_c - END INTERFACE - - ptr = C_LOC(object_info) - hdferr = H5Oget_info_c(object_id, ptr) - - END SUBROUTINE H5Oget_info_f - -!****s* H5O (F03)/h5oget_info_by_idx_f_F03 -! -! NAME -! h5oget_info_by_idx_f -! -! PURPOSE -! Retrieves the metadata for an object, identifying the object by an index position. -! -! Inputs: -! loc_id - File or group identifier specifying location of group -! in which object is located. -! group_name - Name of group in which object is located. -! index_field - Index or field that determines the order. -! order - Order within field or index. -! n - Object for which information is to be returned -! -! Outputs: -! object_info - Buffer in which to return object information. -! hdferr - Returns 0 if successful and -1 if fails. -! -! Optional parameters: -! lapl_id - Link access property list. (Not currently used.) -! -! AUTHOR -! M. Scot Breitenfeld -! May 11, 2012 -! -! Fortran2003 Interface: - SUBROUTINE h5oget_info_by_idx_f(loc_id, group_name, index_field, order, n, & - object_info, hdferr, lapl_id) - - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T) , INTENT(IN) :: loc_id - CHARACTER(LEN=*), INTENT(IN) :: group_name - INTEGER , INTENT(IN) :: index_field - INTEGER , INTENT(IN) :: order - INTEGER(HSIZE_T), INTENT(IN) :: n - TYPE(h5o_info_t), INTENT(OUT), TARGET :: object_info - INTEGER , INTENT(OUT) :: hdferr - INTEGER(HID_T) , INTENT(IN) , OPTIONAL :: lapl_id -!***** - INTEGER(SIZE_T) :: namelen - INTEGER(HID_T) :: lapl_id_default - TYPE(C_PTR) :: ptr - - INTERFACE - INTEGER FUNCTION h5oget_info_by_idx_c(loc_id, group_name, namelen, & - index_field, order, n, lapl_id_default, object_info) BIND(C, NAME='h5oget_info_by_idx_c') - USE H5GLOBAL - USE, INTRINSIC :: ISO_C_BINDING, ONLY : c_char, c_ptr, c_funptr - INTEGER(HID_T) , INTENT(IN) :: loc_id - CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: group_name - INTEGER(SIZE_T) , INTENT(IN) :: namelen - INTEGER , INTENT(IN) :: index_field - INTEGER , INTENT(IN) :: order - INTEGER(HSIZE_T), INTENT(IN) :: n - INTEGER(HID_T) , INTENT(IN) :: lapl_id_default - TYPE(C_PTR), VALUE :: object_info - - END FUNCTION h5oget_info_by_idx_c - END INTERFACE - - namelen = LEN(group_name) - - lapl_id_default = H5P_DEFAULT_F - IF(PRESENT(lapl_id)) lapl_id_default = lapl_id - - ptr = C_LOC(object_info) - hdferr = H5Oget_info_by_idx_c(loc_id, group_name, namelen, index_field, order, n, lapl_id_default, ptr) - - END SUBROUTINE H5Oget_info_by_idx_f - - -!****s* H5O (F03)/h5ovisit_by_name_f_F03 -! -! NAME -! h5ovisit_by_name_f -! -! PURPOSE -! Recursively visits all objects starting from a specified object. -! -! Inputs: -! loc_id - Identifier of a file or group. -! object_name - Name of the object, generally relative to loc_id, that will serve as root of the iteration -! index_type - Type of index; valid values include: -! H5_INDEX_NAME_F -! H5_INDEX_CRT_ORDER_F -! order - Order in which index is traversed; valid values include: -! H5_ITER_DEC_F -! H5_ITER_INC_F -! H5_ITER_NATIVE_F -! op - Callback function passing data regarding the group to the calling application -! op_data - User-defined pointer to data required by the application for its processing of the group -! -! Outputs: -! return_value - Returns the return value of the first operator that returns a positive value, or -! zero if all members were processed with no operator returning non-zero. -! hdferr - Returns 0 if successful and -1 if fails -! -! Optional parameters: -! lapl_id - Link access property list identifier. -! -! AUTHOR -! M. Scot Breitenfeld -! November 19, 2008 -! -! Fortran2003 Interface: - SUBROUTINE h5ovisit_by_name_f(loc_id, object_name, index_type, order, op, op_data, & - return_value, hdferr, lapl_id) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T) , INTENT(IN) :: loc_id - CHARACTER(LEN=*), INTENT(IN) :: object_name - INTEGER , INTENT(IN) :: index_type - INTEGER , INTENT(IN) :: order - - TYPE(C_FUNPTR) :: op - TYPE(C_PTR) :: op_data - INTEGER , INTENT(OUT) :: return_value - INTEGER , INTENT(OUT) :: hdferr - INTEGER(HID_T) , INTENT(IN) , OPTIONAL :: lapl_id -!***** - - INTEGER(SIZE_T) :: namelen - INTEGER(HID_T) :: lapl_id_default - - INTERFACE - INTEGER FUNCTION h5ovisit_by_name_c(loc_id, object_name, namelen, index_type, order, & - op, op_data, lapl_id) BIND(C, NAME='h5ovisit_by_name_c') - USE, INTRINSIC :: ISO_C_BINDING - USE H5GLOBAL - INTEGER(HID_T) , INTENT(IN) :: loc_id - CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: object_name - INTEGER(SIZE_T) :: namelen - INTEGER , INTENT(IN) :: index_type - INTEGER , INTENT(IN) :: order - TYPE(C_FUNPTR) , VALUE :: op - TYPE(C_PTR) , VALUE :: op_data - INTEGER(HID_T) , INTENT(IN) :: lapl_id - END FUNCTION h5ovisit_by_name_c - END INTERFACE - - namelen = LEN(object_name) - - lapl_id_default = H5P_DEFAULT_F - IF(PRESENT(lapl_id)) lapl_id_default = lapl_id - - return_value = h5ovisit_by_name_c(loc_id, object_name, namelen, index_type, order, & - op, op_data, lapl_id_default) - - IF(return_value.GE.0)THEN - hdferr = 0 - ELSE - hdferr = -1 - END IF - - END SUBROUTINE h5ovisit_by_name_f - -END MODULE H5O_PROVISIONAL - diff --git a/fortran/src/H5Off_F90.f90 b/fortran/src/H5Off_F90.f90 deleted file mode 100644 index 5688c5d..0000000 --- a/fortran/src/H5Off_F90.f90 +++ /dev/null @@ -1,39 +0,0 @@ -!****h* ROBODoc/H5O (F90) -! -! NAME -! MODULE H5O_PROVISIONAL -! -! PURPOSE -! This file contains Fortran 90 interfaces for H5O functions. It contains -! the same functions as H5Off_F03.f90 but excludes the Fortran 2003 functions -! and the interface listings. This file will be compiled instead of H5Off_F03.f90 -! if Fortran 2003 functions are not enabled. -! -! NOTE -! Currently contains no functions. -! -! 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. * -! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -! -! *** IMPORTANT *** -! If you add a new H5D function you must add the function name to the -! Windows dll file 'hdf5_fortrandll.def.in' in the fortran/src directory. -! This is needed for Windows based operating systems. -!***** - -MODULE H5O_PROVISIONAL - -END MODULE H5O_PROVISIONAL diff --git a/fortran/src/H5Pf.c b/fortran/src/H5Pf.c index fe2f21a..9735f48 100644 --- a/fortran/src/H5Pf.c +++ b/fortran/src/H5Pf.c @@ -1,6 +1,6 @@ /****h* H5Pf/H5Pf * PURPOSE - * This file contains C stubs for H5P Fortran APIs + * This file contains C stubs for H5P Fortran APIs * * COPYRIGHT * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * @@ -23,18 +23,35 @@ #include "H5f90.h" #include "H5Eprivate.h" +#include "H5public.h" + +#ifdef H5_HAVE_PARALLEL + +#include +/* Support for C to Fortran translation in MPI */ +#ifndef H5_HAVE_MPI_MULTI_LANG_Comm +#define MPI_Comm_c2f(comm) (int_f)(comm) +#define MPI_Comm_f2c(comm) (MPI_Comm)(comm) +#endif /*MPI Comm*/ + +#ifndef H5_HAVE_MPI_MULTI_LANG_Info +#define MPI_Info_c2f(info) (int_f)(info) +#define MPI_Info_f2c(info) (MPI_Info)(info) +#endif /*MPI Info*/ + +#endif /*H5_HAVE_PARALLEL*/ /****if* H5Pf/h5pcreate_c * NAME - * h5pcreate_c + * h5pcreate_c * PURPOSE - * Call H5Pcreate to create a property list + * Call H5Pcreate to create a property list * INPUTS - * cls - property list class identifier + * cls - property list class identifier * OUTPUTS - * prp_id - identifier of the created property list + * prp_id - identifier of the created property list * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal * Wednesday, October 9, 2002 @@ -43,7 +60,7 @@ */ int_f -nh5pcreate_c ( hid_t_f *cls, hid_t_f *prp_id ) +h5pcreate_c ( hid_t_f *cls, hid_t_f *prp_id ) /******/ { hid_t c_prp_id; @@ -61,22 +78,22 @@ done: /****if* H5Pf/h5pclose_c * NAME - * h5pclose_c + * h5pclose_c * PURPOSE - * Call H5Pclose to close property lis + * Call H5Pclose to close property lis * INPUTS - * prp_id - identifier of the property list to be closed + * prp_id - identifier of the property list to be closed * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * Saturday, August 14, 1999 + * Saturday, August 14, 1999 * * SOURCE */ int_f -nh5pclose_c ( hid_t_f *prp_id ) +h5pclose_c ( hid_t_f *prp_id ) /******/ { int_f ret_value = 0; @@ -90,23 +107,23 @@ nh5pclose_c ( hid_t_f *prp_id ) /****if* H5Pf/h5pcopy_c * NAME - * h5pcopy_c + * h5pcopy_c * PURPOSE - * Call H5Pcopy to copy property list + * Call H5Pcopy to copy property list * INPUTS - * prp_id - identifier of the property list to be copied + * prp_id - identifier of the property list to be copied * OUTPUTS - * new_prp_id - identifier of the new property list + * new_prp_id - identifier of the new property list * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * Saturday, August 14, 1999 + * Saturday, August 14, 1999 * * SOURCE */ int_f -nh5pcopy_c ( hid_t_f *prp_id , hid_t_f *new_prp_id) +h5pcopy_c ( hid_t_f *prp_id , hid_t_f *new_prp_id) /******/ { hid_t c_new_prp_id; @@ -124,24 +141,24 @@ done: /****if* H5Pf/h5pequal_c * NAME - * h5pequal_c + * h5pequal_c * PURPOSE - * Call H5Pequal to check if two property lists are equal + * Call H5Pequal to check if two property lists are equal * INPUTS - * plist1_id - property list identifier - * plist2_id - property list identifier + * plist1_id - property list identifier + * plist2_id - property list identifier * OUTPUTS - * c_flag - flag to indicate that lists are eqaul + * c_flag - flag to indicate that lists are eqaul * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * Monday, September 30, 2002 + * Monday, September 30, 2002 * * SOURCE */ int_f -nh5pequal_c ( hid_t_f *plist1_id , hid_t_f *plist2_id, int_f * c_flag) +h5pequal_c ( hid_t_f *plist1_id , hid_t_f *plist2_id, int_f * c_flag) /******/ { htri_t c_c_flag; @@ -176,7 +193,7 @@ done: */ int_f -nh5pget_class_c ( hid_t_f *prp_id , hid_t_f *classtype) +h5pget_class_c ( hid_t_f *prp_id , hid_t_f *classtype) /******/ { hid_t c_classtype; @@ -193,15 +210,15 @@ done: /****if* H5Pf/h5pset_preserve_c * NAME - * h5pset_preserve_c + * h5pset_preserve_c * PURPOSE - * Call H5Pset_preserve to set transfer property for compound - * datatype + * Call H5Pset_preserve to set transfer property for compound + * datatype * INPUTS - * prp_id - property list identifier - * flag - TRUE/FALSE flag + * prp_id - property list identifier + * flag - TRUE/FALSE flag * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal * Thursday, February 17, 2000 @@ -209,7 +226,7 @@ done: */ int_f -nh5pset_preserve_c ( hid_t_f *prp_id , int_f *flag) +h5pset_preserve_c ( hid_t_f *prp_id , int_f *flag) /******/ { int ret_value = 0; @@ -227,16 +244,16 @@ nh5pset_preserve_c ( hid_t_f *prp_id , int_f *flag) /****if* H5Pf/h5pget_preserve_c * NAME - * h5pget_preserve_c + * h5pget_preserve_c * PURPOSE - * Call H5Pget_preserve to set transfer property for compound - * datatype + * Call H5Pget_preserve to set transfer property for compound + * datatype * INPUTS - * prp_id - property list identifier + * prp_id - property list identifier * OUTPUTS - * flag - TRUE/FALSE flag + * flag - TRUE/FALSE flag * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal * Thursday, February 17, 2000 @@ -244,7 +261,7 @@ nh5pset_preserve_c ( hid_t_f *prp_id , int_f *flag) */ int_f -nh5pget_preserve_c ( hid_t_f *prp_id , int_f *flag) +h5pget_preserve_c ( hid_t_f *prp_id , int_f *flag) /******/ { int ret_value = 0; @@ -260,22 +277,22 @@ nh5pget_preserve_c ( hid_t_f *prp_id , int_f *flag) /****if* H5Pf/h5pset_deflate_c * NAME - * h5pset_deflate_c + * h5pset_deflate_c * PURPOSE - * Call H5Pset_deflate to set deflate level + * Call H5Pset_deflate to set deflate level * INPUTS - * prp_id - property list identifier - * level - level of deflation + * prp_id - property list identifier + * level - level of deflation * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * Saturday, August 14, 1999 + * Saturday, August 14, 1999 * SOURCE */ int_f -nh5pset_deflate_c ( hid_t_f *prp_id , int_f *level) +h5pset_deflate_c ( hid_t_f *prp_id , int_f *level) /******/ { int ret_value = 0; @@ -294,24 +311,24 @@ nh5pset_deflate_c ( hid_t_f *prp_id , int_f *level) /****if* H5Pf/h5pset_chunk_c * NAME - * h5pset_chunk_c + * h5pset_chunk_c * PURPOSE - * Call H5Pset_chunk to set the sizes of chunks for a chunked - * layout dataset + * Call H5Pset_chunk to set the sizes of chunks for a chunked + * layout dataset * INPUTS - * prp_id - property list identifier - * rank - number of dimensions of each chunk - * dims - array of the size of each chunk + * prp_id - property list identifier + * rank - number of dimensions of each chunk + * dims - array of the size of each chunk * RETURNS - * 0 on success, -1 on failure - * Saturday, August 14, 1999 + * 0 on success, -1 on failure + * Saturday, August 14, 1999 * AUTHOR * Elena Pourmal * SOURCE */ int_f -nh5pset_chunk_c ( hid_t_f *prp_id, int_f *rank, hsize_t_f *dims ) +h5pset_chunk_c ( hid_t_f *prp_id, int_f *rank, hsize_t_f *dims ) /******/ { int ret_value = -1; @@ -338,24 +355,24 @@ DONE: /****if* H5Pf/h5pget_chunk_c * NAME - * h5pget_chunk_c + * h5pget_chunk_c * PURPOSE - * Call H5Pget_chunk to get the sizes of chunks for a chunked - * layout dataset for at list max_rank number of dimensions + * Call H5Pget_chunk to get the sizes of chunks for a chunked + * layout dataset for at list max_rank number of dimensions * INPUTS - * prp_id - property list identifier - * max rank - maximum number of dimensions to return - * dims - array of the size of each chunk + * prp_id - property list identifier + * max rank - maximum number of dimensions to return + * dims - array of the size of each chunk * RETURNS - * number of chunk's dimnesion on success, -1 on failure - * Saturday, August 14, 1999 + * number of chunk's dimnesion on success, -1 on failure + * Saturday, August 14, 1999 * AUTHOR * Elena Pourmal * SOURCE */ int_f -nh5pget_chunk_c ( hid_t_f *prp_id, int_f *max_rank, hsize_t_f *dims ) +h5pget_chunk_c ( hid_t_f *prp_id, int_f *max_rank, hsize_t_f *dims ) /******/ { int ret_value = -1; @@ -377,36 +394,6 @@ nh5pget_chunk_c ( hid_t_f *prp_id, int_f *max_rank, hsize_t_f *dims ) return ret_value; } -/****if* H5Pf/h5pset_fill_valuec_c - * NAME - * h5pset_fill_valuec_c - * PURPOSE - * Call h5pset_fill_value_c to a character fill value - * INPUTS - * prp_id - property list identifier - * type_id - datatype identifier (fill value is of type type_id) - * fillvalue - character value - * RETURNS - * 0 on success, -1 on failure - * Saturday, August 14, 1999 - * AUTHOR - * Elena Pourmal - * SOURCE -*/ -int_f -nh5pset_fill_valuec_c (hid_t_f *prp_id, hid_t_f *type_id, _fcd fillvalue) -/******/ -{ - int ret_value = -1; - - /* - * Call h5pset_fill_value_c function. - */ - ret_value = h5pset_fill_value_c(prp_id, type_id, _fcdtocp(fillvalue)); - - return ret_value; -} - /****if* H5Pf/h5pset_fill_value_c * NAME * h5pset_fill_value_c @@ -444,68 +431,6 @@ h5pset_fill_value_c (hid_t_f *prp_id, hid_t_f *type_id, void *fillvalue) return ret_value; } -int_f -nh5pset_fill_value_integer_c (hid_t_f *prp_id, hid_t_f *type_id, void *fillvalue) -/******/ -{ - /* - * Call h5pset_fill_value_c function. - */ - return h5pset_fill_value_c(prp_id, type_id, fillvalue); -} - -int_f -nh5pset_fill_value_real_c (hid_t_f *prp_id, hid_t_f *type_id, void *fillvalue) -{ - /* - * Call h5pset_fill_value_c function. - */ - return h5pset_fill_value_c(prp_id, type_id, fillvalue); -} - -int_f -nh5pset_fill_value_double_c (hid_t_f *prp_id, hid_t_f *type_id, void *fillvalue) -{ - /* - * Call h5pset_fill_value_c function. - */ - return h5pset_fill_value_c(prp_id, type_id, fillvalue); -} - -/****if* H5Pf/h5pget_fill_valuec_c - * NAME - * h5pget_fill_valuec_c - * PURPOSE - * Call h5pget_fill_value_c to a character fill value - * INPUTS - * prp_id - property list identifier - * type_id - datatype identifier (fill value is of type type_id) - * fillvalue - character value - * RETURNS - * 0 on success, -1 on failure - * AUTHOR - * Elena Pourmal - * Saturday, August 14, 1999 - * HISTORY - * Fixed wrong call to C wrapper, was nh5pset_fill_value_c, changed - * to nh5pget_fill_value_c. MSB - 7/21/2014 - * - * SOURCE -*/ -int_f -nh5pget_fill_valuec_c (hid_t_f *prp_id, hid_t_f *type_id, _fcd fillvalue) -/******/ -{ - int ret_value = -1; - - /* - * Call h5pget_fill_value_c function. - */ - ret_value = h5pget_fill_value_c(prp_id, type_id, _fcdtocp(fillvalue)); - - return ret_value; -} - /****if* H5Pf/h5pget_fill_value_c * NAME * h5pget_fill_value_c @@ -543,57 +468,30 @@ h5pget_fill_value_c (hid_t_f *prp_id, hid_t_f *type_id, void *fillvalue) return ret_value; } -int_f -nh5pget_fill_value_integer_c (hid_t_f *prp_id, hid_t_f *type_id, void *fillvalue) -{ - /* - * Call h5pget_fill_value_c function. - */ - return h5pget_fill_value_c(prp_id, type_id, fillvalue); -} - -int_f -nh5pget_fill_value_real_c (hid_t_f *prp_id, hid_t_f *type_id, void *fillvalue) -{ - /* - * Call h5pget_fill_value_c function. - */ - return h5pget_fill_value_c(prp_id, type_id, fillvalue); -} - -int_f -nh5pget_fill_value_double_c (hid_t_f *prp_id, hid_t_f *type_id, void *fillvalue) -{ - /* - * Call h5pget_fill_value_c function. - */ - return h5pget_fill_value_c(prp_id, type_id, fillvalue); -} - /****if* H5Pf/h5pget_version_c * NAME - * h5pget_version_c + * h5pget_version_c * PURPOSE - * Call H5Pget_version to get the version information - * of various objects for a file creation property list + * Call H5Pget_version to get the version information + * of various objects for a file creation property list * INPUTS - * prp_id - property list identifier + * prp_id - property list identifier * OUTPUTS - * boot - array to put boot block version number - * freelist - array to put global freelist version number - * stab - array to put symbol table version number - * shhdr - array to put shared object header version number + * boot - array to put boot block version number + * freelist - array to put global freelist version number + * stab - array to put symbol table version number + * shhdr - array to put shared object header version number * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Xiangyang Su - * Wednesday, February 23, 2000 + * Wednesday, February 23, 2000 * HISTORY - * Removed extra length parameters EP 7/6/00 + * Removed extra length parameters EP 7/6/00 * SOURCE */ int_f -nh5pget_version_c (hid_t_f *prp_id, int_f * boot,int_f * freelist, int_f * stab, int_f *shhdr) +h5pget_version_c (hid_t_f *prp_id, int_f * boot,int_f * freelist, int_f * stab, int_f *shhdr) /******/ { int ret_value = -1; @@ -630,22 +528,22 @@ nh5pget_version_c (hid_t_f *prp_id, int_f * boot,int_f * freelist, int_f * stab, /****if* H5Pf/h5pget_userblock_c * NAME - * h5pget_userblock_c + * h5pget_userblock_c * PURPOSE - * Call H5Pget_userblock to get the size of a user block in - * a file creation property list + * Call H5Pget_userblock to get the size of a user block in + * a file creation property list * INPUTS - * prp_id - property list identifier - * Outputs size - Size of the user-block in bytes + * prp_id - property list identifier + * Outputs size - Size of the user-block in bytes * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Xiangyang Su - * Wednesday, February 23, 2000 + * Wednesday, February 23, 2000 * SOURCE */ int_f -nh5pget_userblock_c (hid_t_f *prp_id, hsize_t_f * size) +h5pget_userblock_c (hid_t_f *prp_id, hsize_t_f * size) /******/ { int ret_value = -1; @@ -668,22 +566,22 @@ nh5pget_userblock_c (hid_t_f *prp_id, hsize_t_f * size) /****if* H5Pf/h5pset_userblock_c * NAME - * h5pset_userblock_c + * h5pset_userblock_c * PURPOSE - * Call H5Pset_userblock to set the size of a user block in - * a file creation property list + * Call H5Pset_userblock to set the size of a user block in + * a file creation property list * INPUTS - * prp_id - property list identifier - * size - Size of the user-block in bytes + * prp_id - property list identifier + * size - Size of the user-block in bytes * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Xiangyang Su - * Wednesday, February 23, 2000 + * Wednesday, February 23, 2000 * SOURCE */ int_f -nh5pset_userblock_c (hid_t_f *prp_id, hsize_t_f * size) +h5pset_userblock_c (hid_t_f *prp_id, hsize_t_f * size) /******/ { int ret_value = -1; @@ -705,25 +603,25 @@ nh5pset_userblock_c (hid_t_f *prp_id, hsize_t_f * size) /****if* H5Pf/h5pget_sizes_c * NAME - * h5pget_sizes_c + * h5pget_sizes_c * PURPOSE - * Call H5Pget_sizes to get the size of the offsets - * and lengths used in an HDF5 file + * Call H5Pget_sizes to get the size of the offsets + * and lengths used in an HDF5 file * INPUTS - * prp_id - property list identifier - * Outputs sizeof_addr - Size of an object offset in bytes - * sizeof_size - Size of an object length in bytes + * prp_id - property list identifier + * Outputs sizeof_addr - Size of an object offset in bytes + * sizeof_size - Size of an object length in bytes * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Xiangyang Su - * Wednesday, February 23, 2000 + * Wednesday, February 23, 2000 * HISTORY - * Deleted extra length parameters. EP 6/7/00 + * Deleted extra length parameters. EP 6/7/00 * SOURCE */ int_f -nh5pget_sizes_c (hid_t_f *prp_id, size_t_f * sizeof_addr, size_t_f * sizeof_size) +h5pget_sizes_c (hid_t_f *prp_id, size_t_f * sizeof_addr, size_t_f * sizeof_size) /******/ { int ret_value = -1; @@ -748,24 +646,24 @@ nh5pget_sizes_c (hid_t_f *prp_id, size_t_f * sizeof_addr, size_t_f * sizeof_size /****if* H5Pf/h5pset_sizes_c * NAME - * h5pset_sizes_c + * h5pset_sizes_c * PURPOSE - * Call H5Pset_sizes to set the size of the offsets + * Call H5Pset_sizes to set the size of the offsets * INPUTS - * prp_id - property list identifier - * sizeof_addr - Size of an object offset in bytes - * sizeof_size - Size of an object length in bytes + * prp_id - property list identifier + * sizeof_addr - Size of an object offset in bytes + * sizeof_size - Size of an object length in bytes * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Xiangyang Su - * Wednesday, February 23, 2000 + * Wednesday, February 23, 2000 * HISTORY * * SOURCE */ int_f -nh5pset_sizes_c (hid_t_f *prp_id, size_t_f * sizeof_addr, size_t_f * sizeof_size) +h5pset_sizes_c (hid_t_f *prp_id, size_t_f * sizeof_addr, size_t_f * sizeof_size) /******/ { int ret_value = -1; @@ -788,23 +686,23 @@ nh5pset_sizes_c (hid_t_f *prp_id, size_t_f * sizeof_addr, size_t_f * sizeof_size /****if* H5Pf/h5pset_sym_k_c * NAME - * h5pset_sym_k_c + * h5pset_sym_k_c * PURPOSE - * Call H5Pset_sym_k to set the size of parameters used - * to control the symbol table node + * Call H5Pset_sym_k to set the size of parameters used + * to control the symbol table node * INPUTS - * prp_id - property list identifier - * ik - Symbol table tree rank - * lk - Symbol table node size + * prp_id - property list identifier + * ik - Symbol table tree rank + * lk - Symbol table node size * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Xiangyang Su - * Friday, February 25, 2000 + * Friday, February 25, 2000 * SOURCE */ int_f -nh5pset_sym_k_c (hid_t_f *prp_id, int_f* ik, int_f* lk) +h5pset_sym_k_c (hid_t_f *prp_id, int_f* ik, int_f* lk) /******/ { int ret_value = -1; @@ -828,26 +726,26 @@ nh5pset_sym_k_c (hid_t_f *prp_id, int_f* ik, int_f* lk) /****if* H5Pf/h5pget_sym_k_c * NAME - * h5pget_sym_k_c + * h5pget_sym_k_c * PURPOSE - * Call H5Pget_sym_k to get the size of parameters used - * to control the symbol table node + * Call H5Pget_sym_k to get the size of parameters used + * to control the symbol table node * INPUTS - * prp_id - property list identifier + * prp_id - property list identifier * OUTPUTS - * ik - Symbol table tree rank - * lk - Symbol table node size + * ik - Symbol table tree rank + * lk - Symbol table node size * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Xiangyang Su - * Friday, February 25, 2000 + * Friday, February 25, 2000 * HISTORY * * SOURCE */ int_f -nh5pget_sym_k_c (hid_t_f *prp_id, int_f* ik, int_f* lk) +h5pget_sym_k_c (hid_t_f *prp_id, int_f* ik, int_f* lk) /******/ { int ret_value = -1; @@ -870,24 +768,24 @@ nh5pget_sym_k_c (hid_t_f *prp_id, int_f* ik, int_f* lk) /****if* H5Pf/h5pset_istore_k_c * NAME - * h5pset_istore_k_c + * h5pset_istore_k_c * PURPOSE - * Call H5Pset_istore_k to set the size of the parameter - * used to control the B-trees for indexing chunked datasets + * Call H5Pset_istore_k to set the size of the parameter + * used to control the B-trees for indexing chunked datasets * INPUTS - * prp_id - property list identifier - * ik - Symbol table tree rank + * prp_id - property list identifier + * ik - Symbol table tree rank * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Xiangyang Su - * Friday, February 25, 2000 + * Friday, February 25, 2000 * HISTORY * * SOURCE */ int_f -nh5pset_istore_k_c (hid_t_f *prp_id, int_f* ik) +h5pset_istore_k_c (hid_t_f *prp_id, int_f* ik) /******/ { int ret_value = -1; @@ -909,25 +807,25 @@ nh5pset_istore_k_c (hid_t_f *prp_id, int_f* ik) /****if* H5Pf/h5pget_istore_k_c * NAME - * h5pget_istore_k_c + * h5pget_istore_k_c * PURPOSE - * Call H5Pget_istore_k to get the size of parameters used - * to control the B-trees for indexing chunked datasets + * Call H5Pget_istore_k to get the size of parameters used + * to control the B-trees for indexing chunked datasets * INPUTS - * prp_id - property list identifier + * prp_id - property list identifier * OUTPUTS - * ik - Symbol table tree rank + * ik - Symbol table tree rank * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Xiangyang Su - * Friday, February 25, 2000 + * Friday, February 25, 2000 * HISTORY * * SOURCE */ int_f -nh5pget_istore_k_c (hid_t_f *prp_id, int_f* ik) +h5pget_istore_k_c (hid_t_f *prp_id, int_f* ik) /******/ { int ret_value = -1; @@ -948,24 +846,24 @@ nh5pget_istore_k_c (hid_t_f *prp_id, int_f* ik) /****if* H5Pf/h5pget_driver_c * NAME - * h5pget_driver_c + * h5pget_driver_c * PURPOSE - * Call H5Pget_driver to get low-level file driver identifier + * Call H5Pget_driver to get low-level file driver identifier * INPUTS - * prp_id - property list identifier + * prp_id - property list identifier * OUTPUTS - * driver - low-level file driver identifier + * driver - low-level file driver identifier * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Xiangyang Su - * Friday, February 25, 2000 + * Friday, February 25, 2000 * HISTORY * * SOURCE */ int_f -nh5pget_driver_c (hid_t_f *prp_id, hid_t_f* driver) +h5pget_driver_c (hid_t_f *prp_id, hid_t_f* driver) /******/ { int ret_value = -1; @@ -986,23 +884,23 @@ DONE: /****if* H5Pf/h5pset_fapl_stdio_c * NAME - * h5pset_fapl_stdio_c + * h5pset_fapl_stdio_c * PURPOSE - * Call H5Pset_stdio to set the low level file driver to - * use the functions declared in the stdio.h + * Call H5Pset_stdio to set the low level file driver to + * use the functions declared in the stdio.h * INPUTS - * prp_id - property list identifier + * prp_id - property list identifier * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * March 7, 2001 + * March 7, 2001 * HISTORY * * SOURCE */ int_f -nh5pset_fapl_stdio_c (hid_t_f *prp_id) +h5pset_fapl_stdio_c (hid_t_f *prp_id) /******/ { int ret_value = -1; @@ -1020,26 +918,26 @@ nh5pset_fapl_stdio_c (hid_t_f *prp_id) #ifdef NO_SUCH_F90_FUNCTION /****if* H5Pf/h5pget_fapl_stdio_c * NAME - * h5pget_fapl_stdio_c + * h5pget_fapl_stdio_c * PURPOSE - * Call H5Pget_fapl_stdio to determine whther the low level file driver - * uses the functions declared in the stdio.h + * Call H5Pget_fapl_stdio to determine whther the low level file driver + * uses the functions declared in the stdio.h * INPUTS - * prp_id - property list identifier + * prp_id - property list identifier * OUTPUTS - * io - value indicates whether the file driver uses - * the functions declared in the stdio.h + * io - value indicates whether the file driver uses + * the functions declared in the stdio.h * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * March 9, 2001 + * March 9, 2001 * HISTORY * * SOURCE */ int_f -nh5pget_fapl_stdio_c (hid_t_f *prp_id, int_f* io) +h5pget_fapl_stdio_c (hid_t_f *prp_id, int_f* io) /******/ { int ret_value = -1; @@ -1060,23 +958,23 @@ nh5pget_fapl_stdio_c (hid_t_f *prp_id, int_f* io) /****if* H5Pf/h5pset_fapl_sec2_c * NAME - * h5pset_fapl_sec2_c + * h5pset_fapl_sec2_c * PURPOSE - * Call H5Pset_fapl_sec2 to set the low level file driver to - * use the functions declared in the unistd.h + * Call H5Pset_fapl_sec2 to set the low level file driver to + * use the functions declared in the unistd.h * INPUTS - * prp_id - property list identifier + * prp_id - property list identifier * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * March 9, 2001 + * March 9, 2001 * HISTORY * * SOURCE */ int_f -nh5pset_fapl_sec2_c (hid_t_f *prp_id) +h5pset_fapl_sec2_c (hid_t_f *prp_id) /******/ { int ret_value = -1; @@ -1095,26 +993,26 @@ nh5pset_fapl_sec2_c (hid_t_f *prp_id) #ifdef NO_SUCH_F90_FUNCTION /****if* H5Pf/h5pget_fapl_sec2_c * NAME - * h5pget_fapl_sec2_c + * h5pget_fapl_sec2_c * PURPOSE - * Call H5Pget_fapl_stdio to determine whther the low level file driver - * uses the functions declared in the unistd.h + * Call H5Pget_fapl_stdio to determine whther the low level file driver + * uses the functions declared in the unistd.h * INPUTS - * prp_id - property list identifier + * prp_id - property list identifier * OUTPUTS - * sec2 - value indicates whether the file driver uses - * the functions declared in the unistd.h + * sec2 - value indicates whether the file driver uses + * the functions declared in the unistd.h * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * March 9, 2001 + * March 9, 2001 * HISTORY * * SOURCE */ int_f -nh5pget_fapl_sec2_c (hid_t_f *prp_id, int_f* sec2) +h5pget_fapl_sec2_c (hid_t_f *prp_id, int_f* sec2) /******/ { int ret_value = -1; @@ -1134,25 +1032,25 @@ nh5pget_fapl_sec2_c (hid_t_f *prp_id, int_f* sec2) /****if* H5Pf/h5pset_alignment_c * NAME - * h5pset_alignment_c + * h5pset_alignment_c * PURPOSE - * Call H5Pset_alignment to set alignment properties of - * a file access property list + * Call H5Pset_alignment to set alignment properties of + * a file access property list * INPUTS - * prp_id - property list identifier - * threshold - Threshold value - * alignment - Alignment value + * prp_id - property list identifier + * threshold - Threshold value + * alignment - Alignment value * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Xiangyang Su - * Friday, February 25, 2000 + * Friday, February 25, 2000 * HISTORY * * SOURCE */ int_f -nh5pset_alignment_c (hid_t_f *prp_id, hsize_t_f* threshold, hsize_t_f* alignment) +h5pset_alignment_c (hid_t_f *prp_id, hsize_t_f* threshold, hsize_t_f* alignment) /******/ { int ret_value = -1; @@ -1173,25 +1071,25 @@ nh5pset_alignment_c (hid_t_f *prp_id, hsize_t_f* threshold, hsize_t_f* alignment /****if* H5Pf/h5pget_alignment_c * NAME - * h5pget_alignment_c + * h5pget_alignment_c * PURPOSE - * Call H5Pget_alignment to get alignment properties of - * a file access property list + * Call H5Pget_alignment to get alignment properties of + * a file access property list * INPUTS - * prp_id - property list identifier - * threshold - Threshold value - * alignment - Alignment value + * prp_id - property list identifier + * threshold - Threshold value + * alignment - Alignment value * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Xiangyang Su - * Friday, February 25, 2000 + * Friday, February 25, 2000 * HISTORY * * SOURCE */ int_f -nh5pget_alignment_c (hid_t_f *prp_id, hsize_t_f* threshold, hsize_t_f* alignment) +h5pget_alignment_c (hid_t_f *prp_id, hsize_t_f* threshold, hsize_t_f* alignment) /******/ { int ret_value = -1; @@ -1213,26 +1111,26 @@ nh5pget_alignment_c (hid_t_f *prp_id, hsize_t_f* threshold, hsize_t_f* alignment /****if* H5Pf/h5pset_fapl_core_c * NAME - * h5pset_fapl_core_c + * h5pset_fapl_core_c * PURPOSE - * Call H5Pset_fapl_core to set the low-level file driver - * to use malloc() and free() + * Call H5Pset_fapl_core to set the low-level file driver + * to use malloc() and free() * INPUTS - * prp_id - property list identifier - * increment - File block size in bytes - * flag - Boolean flag indicating whether to write the - * file contents to disk when the file is closed. + * prp_id - property list identifier + * increment - File block size in bytes + * flag - Boolean flag indicating whether to write the + * file contents to disk when the file is closed. * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * March 9, 2001 + * March 9, 2001 * HISTORY * * SOURCE */ int_f -nh5pset_fapl_core_c (hid_t_f *prp_id, size_t_f* increment, int_f *flag) +h5pset_fapl_core_c (hid_t_f *prp_id, size_t_f* increment, int_f *flag) /******/ { int ret_value = -1; @@ -1255,24 +1153,24 @@ nh5pset_fapl_core_c (hid_t_f *prp_id, size_t_f* increment, int_f *flag) /****if* H5Pf/h5pget_fapl_core_c * NAME - * h5pget_fapl_core_c + * h5pget_fapl_core_c * PURPOSE - * Call H5Pget_fapl_core to determine whether the file access - * property list is set to the core drive + * Call H5Pget_fapl_core to determine whether the file access + * property list is set to the core drive * INPUTS - * prp_id - property list identifier - * Outputs increment - File block size in bytes + * prp_id - property list identifier + * Outputs increment - File block size in bytes * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * March 9, 2001 + * March 9, 2001 * HISTORY * * SOURCE */ int_f -nh5pget_fapl_core_c (hid_t_f *prp_id, size_t_f* increment, int_f *flag) +h5pget_fapl_core_c (hid_t_f *prp_id, size_t_f* increment, int_f *flag) /******/ { int ret_value = -1; @@ -1295,26 +1193,26 @@ nh5pget_fapl_core_c (hid_t_f *prp_id, size_t_f* increment, int_f *flag) /****if* H5Pf/h5pset_fapl_family_c * NAME - * h5pset_fapl_family_c + * h5pset_fapl_family_c * PURPOSE - * Call H5Pset_fapl_family to set the file access properties list - * to the family driver + * Call H5Pset_fapl_family to set the file access properties list + * to the family driver * INPUTS - * prp_id - property list identifier - * memb_size - Logical size, in bytes, of each family member. - * memb_plist - Identifier of the file access property list - * for each member of the family + * prp_id - property list identifier + * memb_size - Logical size, in bytes, of each family member. + * memb_plist - Identifier of the file access property list + * for each member of the family * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * March 9, 2001 + * March 9, 2001 * HISTORY * * SOURCE */ int_f -nh5pset_fapl_family_c(hid_t_f *prp_id, hsize_t_f* memb_size, hid_t_f* memb_plist ) +h5pset_fapl_family_c(hid_t_f *prp_id, hsize_t_f* memb_size, hid_t_f* memb_plist ) /******/ { int ret_value = -1; @@ -1336,26 +1234,26 @@ nh5pset_fapl_family_c(hid_t_f *prp_id, hsize_t_f* memb_size, hid_t_f* memb_plist /****if* H5Pf/h5pget_fapl_family_c * NAME - * h5pget_fapl_family_c + * h5pget_fapl_family_c * PURPOSE - * Call H5Pget_fapl_family to determine whether the file access - * property list is set to the family driver + * Call H5Pget_fapl_family to determine whether the file access + * property list is set to the family driver * INPUTS - * prp_id - property list identifier - * memb_size - Logical size, in bytes, of each family member. - * memb_plist - Identifier of the file access property list - * for each member of the family + * prp_id - property list identifier + * memb_size - Logical size, in bytes, of each family member. + * memb_plist - Identifier of the file access property list + * for each member of the family * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * March 9, 2001 + * March 9, 2001 * HISTORY * * SOURCE */ int_f -nh5pget_fapl_family_c(hid_t_f *prp_id, hsize_t_f* memb_size, hid_t_f* memb_plist) +h5pget_fapl_family_c(hid_t_f *prp_id, hsize_t_f* memb_size, hid_t_f* memb_plist) /******/ { int ret_value = -1; @@ -1378,29 +1276,29 @@ nh5pget_fapl_family_c(hid_t_f *prp_id, hsize_t_f* memb_size, hid_t_f* memb_plist /****if* H5Pf/h5pset_cache_c * NAME - * h5pset_cache_c + * h5pset_cache_c * PURPOSE - * Call H5Pset_cache to set he number of elements in - * the meta data cache and the total number of bytes in - * the raw data chunk cache + * Call H5Pset_cache to set he number of elements in + * the meta data cache and the total number of bytes in + * the raw data chunk cache * INPUTS - * prp_id - property list identifier - * mdc_nelmts - Number of elements (objects) in the - * meta data cache - * rdcc_nbytes - Total size of the raw data chunk cache, in bytes - * rdcc_w0 - Preemption policy + * prp_id - property list identifier + * mdc_nelmts - Number of elements (objects) in the + * meta data cache + * rdcc_nbytes - Total size of the raw data chunk cache, in bytes + * rdcc_w0 - Preemption policy * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Xiangyang Su - * Friday, February 25, 2000 + * Friday, February 25, 2000 * HISTORY - * Changed the type of the rdcc_w0 parameter to be real_f EP 7/7/00 - * instead of double + * Changed the type of the rdcc_w0 parameter to be real_f EP 7/7/00 + * instead of double * SOURCE */ int_f -nh5pset_cache_c(hid_t_f *prp_id, int_f* mdc_nelmts, size_t_f* rdcc_nelmts, size_t_f* rdcc_nbytes , real_f* rdcc_w0 ) +h5pset_cache_c(hid_t_f *prp_id, int_f* mdc_nelmts, size_t_f* rdcc_nelmts, size_t_f* rdcc_nbytes , real_f* rdcc_w0 ) /******/ { int ret_value = -1; @@ -1427,32 +1325,32 @@ nh5pset_cache_c(hid_t_f *prp_id, int_f* mdc_nelmts, size_t_f* rdcc_nelmts, size /****if* H5Pf/h5pget_cache_c * NAME - * h5pget_cache_c + * h5pget_cache_c * PURPOSE - * Call H5Pget_cache to get he number of elements in - * the meta data cache and the total number of bytes in - * the raw data chunk cache + * Call H5Pget_cache to get he number of elements in + * the meta data cache and the total number of bytes in + * the raw data chunk cache * INPUTS - * prp_id - property list identifier + * prp_id - property list identifier * OUTPUTS - * mdc_nelmts - Number of elements (objects) in the - * meta data cache - * rdcc_nelmts - Number of elements in the raw data chunk - * rdcc_nbytes - Total size of the raw data chunk cache, in bytes - * rdcc_w0 - Preemption policy + * mdc_nelmts - Number of elements (objects) in the + * meta data cache + * rdcc_nelmts - Number of elements in the raw data chunk + * rdcc_nbytes - Total size of the raw data chunk cache, in bytes + * rdcc_w0 - Preemption policy * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Xiangyang Su - * Friday, February 25, 2000 + * Friday, February 25, 2000 * HISTORY - * Changed type of the rdcc_w0 parameter to be real_f instead of double - * Changed type of the rdcc_nelmts parameter to be int_f. + * Changed type of the rdcc_w0 parameter to be real_f instead of double + * Changed type of the rdcc_nelmts parameter to be int_f. * EIP October 10, 2003 * SOURCE */ int_f -nh5pget_cache_c(hid_t_f *prp_id, int_f* mdc_nelmts, size_t_f* rdcc_nelmts, size_t_f* rdcc_nbytes , real_f* rdcc_w0) +h5pget_cache_c(hid_t_f *prp_id, int_f* mdc_nelmts, size_t_f* rdcc_nelmts, size_t_f* rdcc_nbytes , real_f* rdcc_w0) /******/ { int ret_value = -1; @@ -1479,29 +1377,29 @@ nh5pget_cache_c(hid_t_f *prp_id, int_f* mdc_nelmts, size_t_f* rdcc_nelmts, size_ /****if* H5Pf/h5pset_fapl_split_c * NAME - * h5pset_fapl_split_c + * h5pset_fapl_split_c * PURPOSE - * Call H5Pset_fapl_split to set he low-level driver to split meta data - * from raw data + * Call H5Pset_fapl_split to set he low-level driver to split meta data + * from raw data * INPUTS - * prp_id - property list identifier - * meta_len - Length of meta_ext - * meta_ext - Name of the extension for the metafile filename. - * meta_plist - Identifier of the meta file access property list - * raw_len - Length of raw _ext - * raw_ext - Name of the extension for the raw file filename. - * raw_plist - Identifier of the raw file access property list + * prp_id - property list identifier + * meta_len - Length of meta_ext + * meta_ext - Name of the extension for the metafile filename. + * meta_plist - Identifier of the meta file access property list + * raw_len - Length of raw _ext + * raw_ext - Name of the extension for the raw file filename. + * raw_plist - Identifier of the raw file access property list * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * March 9, 2001 + * March 9, 2001 * HISTORY * * SOURCE */ int_f -nh5pset_fapl_split_c(hid_t_f *prp_id, int_f* meta_len, _fcd meta_ext, hid_t_f* meta_plist, int_f* raw_len, _fcd raw_ext, hid_t_f * raw_plist) +h5pset_fapl_split_c(hid_t_f *prp_id, int_f* meta_len, _fcd meta_ext, hid_t_f* meta_plist, int_f* raw_len, _fcd raw_ext, hid_t_f * raw_plist) /******/ { int ret_value = -1; @@ -1540,32 +1438,32 @@ DONE: #ifdef NO_SUCH_F90_FUNCTION /****if* H5Pf/h5pget_fapl_split_c * NAME - * h5pget_fapl_split_c + * h5pget_fapl_split_c * PURPOSE - * Call H5Pget_fapl_split to determine whether the file access - * property list is set to the split driver + * Call H5Pget_fapl_split to determine whether the file access + * property list is set to the split driver * INPUTS - * prp_id - property list identifier - * meta_ext_size - Number of characters of the meta file extension - * to be copied to the meta_ext buffer - * raw_ext_size - Number of characters of the raw file extension - * to be copied to the raw_ext buffer + * prp_id - property list identifier + * meta_ext_size - Number of characters of the meta file extension + * to be copied to the meta_ext buffer + * raw_ext_size - Number of characters of the raw file extension + * to be copied to the raw_ext buffer *OUTPUT - * meta_ext - Name of the extension for the metafile filename. - * meta_plist - Identifier of the meta file access property list - * raw_ext - Name of the extension for the raw file filename. - * raw_plist - Identifier of the raw file access property list + * meta_ext - Name of the extension for the metafile filename. + * meta_plist - Identifier of the meta file access property list + * raw_ext - Name of the extension for the raw file filename. + * raw_plist - Identifier of the raw file access property list * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * March 9 , 2001 + * March 9 , 2001 * HISTORY * * SOURCE */ int_f -nh5pget_fapl_split_c(hid_t_f *prp_id, size_t_f* meta_ext_size , _fcd meta_ext, hid_t_f* meta_plist, size_t_f* raw_ext_size, _fcd raw_ext, hid_t_f * raw_plist) +h5pget_fapl_split_c(hid_t_f *prp_id, size_t_f* meta_ext_size , _fcd meta_ext, hid_t_f* meta_plist, size_t_f* raw_ext_size, _fcd raw_ext, hid_t_f * raw_plist) /******/ { int ret_value = -1; @@ -1603,25 +1501,25 @@ nh5pget_fapl_split_c(hid_t_f *prp_id, size_t_f* meta_ext_size , _fcd meta_ext, h /****if* H5Pf/h5pset_gc_references_c * NAME - * h5pset_gc_references_c + * h5pset_gc_references_c * PURPOSE - * Call H5Pset_gc_references to set garbage - * collecting references flag + * Call H5Pset_gc_references to set garbage + * collecting references flag * INPUTS - * prp_id - property list identifier - * gc_reference - flag for garbage collecting references - * for the file + * prp_id - property list identifier + * gc_reference - flag for garbage collecting references + * for the file * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Xiangyang Su - * Friday, February 25, 2000 + * Friday, February 25, 2000 * HISTORY * * SOURCE */ int_f -nh5pset_gc_references_c (hid_t_f *prp_id, int_f* gc_references) +h5pset_gc_references_c (hid_t_f *prp_id, int_f* gc_references) /******/ { int ret_value = -1; @@ -1643,25 +1541,25 @@ nh5pset_gc_references_c (hid_t_f *prp_id, int_f* gc_references) /****if* H5Pf/h5pget_gc_references_c * NAME - * h5pget_gc_references_c + * h5pget_gc_references_c * PURPOSE - * Call H5Pget_gc_references to set garbage - * collecting references flag + * Call H5Pget_gc_references to set garbage + * collecting references flag * INPUTS - * prp_id - property list identifier - * Outputs gc_reference - flag for garbage collecting references - * for the file + * prp_id - property list identifier + * Outputs gc_reference - flag for garbage collecting references + * for the file * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Xiangyang Su - * Friday, February 25, 2000 + * Friday, February 25, 2000 * HISTORY * * SOURCE */ int_f -nh5pget_gc_references_c (hid_t_f *prp_id, int_f* gc_references) +h5pget_gc_references_c (hid_t_f *prp_id, int_f* gc_references) /******/ { int ret_value = -1; @@ -1681,24 +1579,24 @@ nh5pget_gc_references_c (hid_t_f *prp_id, int_f* gc_references) /****if* H5Pf/h5pset_layout_c * NAME - * h5pset_layout_c + * h5pset_layout_c * PURPOSE - * Call H5Pset_layout to the type of storage used - * store the raw data for a dataset + * Call H5Pset_layout to the type of storage used + * store the raw data for a dataset * INPUTS - * prp_id - property list identifier - * layout - Type of storage layout for raw data. + * prp_id - property list identifier + * layout - Type of storage layout for raw data. * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Xiangyang Su - * Friday, February 25, 2000 + * Friday, February 25, 2000 * HISTORY * * SOURCE */ int_f -nh5pset_layout_c (hid_t_f *prp_id, int_f* layout) +h5pset_layout_c (hid_t_f *prp_id, int_f* layout) /******/ { int ret_value = -1; @@ -1719,25 +1617,25 @@ nh5pset_layout_c (hid_t_f *prp_id, int_f* layout) /****if* H5Pf/h5pget_layout_c * NAME - * h5pget_layout_c + * h5pget_layout_c * PURPOSE - * Call H5Pget_layout to the type of storage used - * store the raw data for a dataset + * Call H5Pget_layout to the type of storage used + * store the raw data for a dataset * INPUTS - * prp_id - property list identifier + * prp_id - property list identifier * OUTPUTS - * layout - Type of storage layout for raw data. + * layout - Type of storage layout for raw data. * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Xiangyang Su - * Friday, February 25, 2000 + * Friday, February 25, 2000 * HISTORY * * SOURCE */ int_f -nh5pget_layout_c (hid_t_f *prp_id, int_f* layout) +h5pget_layout_c (hid_t_f *prp_id, int_f* layout) /******/ { int ret_value = -1; @@ -1756,27 +1654,27 @@ nh5pget_layout_c (hid_t_f *prp_id, int_f* layout) /****if* H5Pf/h5pset_filter_c * NAME - * h5pset_filter_c + * h5pset_filter_c * PURPOSE - * Call H5Pset_filter to add a filter to the filter pipeline. + * Call H5Pset_filter to add a filter to the filter pipeline. * INPUTS - * prp_id - property list identifier - * filter - Filter to be added to the pipeline. - * flags - Bit vector specifying certain general - * properties of the filter. - * cd_nelmts - Number of elements in cd_values. - * cd_values - Auxiliary data for the filter. + * prp_id - property list identifier + * filter - Filter to be added to the pipeline. + * flags - Bit vector specifying certain general + * properties of the filter. + * cd_nelmts - Number of elements in cd_values. + * cd_values - Auxiliary data for the filter. * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Xiangyang Su - * Wednesday, February 23, 2000 + * Wednesday, February 23, 2000 * HISTORY * * SOURCE */ int_f -nh5pset_filter_c (hid_t_f *prp_id, int_f* filter, int_f* flags, size_t_f* cd_nelmts, int_f* cd_values ) +h5pset_filter_c (hid_t_f *prp_id, int_f* filter, int_f* flags, size_t_f* cd_nelmts, int_f* cd_values ) /******/ { int ret_value = -1; @@ -1824,7 +1722,7 @@ DONE: * SOURCE */ int_f -nh5pget_nfilters_c (hid_t_f *prp_id, int_f* nfilters) +h5pget_nfilters_c (hid_t_f *prp_id, int_f* nfilters) /******/ { int ret_value = -1; @@ -1844,30 +1742,30 @@ nh5pget_nfilters_c (hid_t_f *prp_id, int_f* nfilters) } /*---------------------------------------------------------------------------- - * Name: h5pget_filter_c - * Purpose: Call H5Pget_filter2 to get information about a filter - * in a pipeline - * Inputs: prp_id - property list identifier - * filter_number - Sequence number within the filter - * pipeline of the filter for which - * information is sought. - * namelen - Anticipated number of characters in name. - *Outputs: flags - Bit vector specifying certain general - * properties of the filter. - * cd_nelmts - Number of elements in cd_value - * cd_values - Auxiliary data for the filter. - * name - Name of the filter - * filter_id - filter identification number - * Returns: 0 on success, -1 on failure - * Programmer: Xiangyang Su - * Friday, February 25, 2000 - * Modifications: - * Since cd_nelmts has IN/OUT attributes, fixed the input and - * returned value of cd_nelmnts to satisfy this specification. + * Name: h5pget_filter_c + * Purpose: Call H5Pget_filter2 to get information about a filter + * in a pipeline + * Inputs: prp_id - property list identifier + * filter_number - Sequence number within the filter + * pipeline of the filter for which + * information is sought. + * namelen - Anticipated number of characters in name. + * Outputs: flags - Bit vector specifying certain general + * properties of the filter. + * cd_nelmts - Number of elements in cd_value + * cd_values - Auxiliary data for the filter. + * name - Name of the filter + * filter_id - filter identification number + * Returns: 0 on success, -1 on failure + * Programmer: Xiangyang Su + * Friday, February 25, 2000 + * Modifications: + * Since cd_nelmts has IN/OUT attributes, fixed the input and + * returned value of cd_nelmnts to satisfy this specification. * MSB January 27, 2009 *---------------------------------------------------------------------------*/ int_f -nh5pget_filter_c(hid_t_f *prp_id, int_f* filter_number, int_f* flags, size_t_f* cd_nelmts, int_f* cd_values, size_t_f *namelen, _fcd name, int_f* filter_id) +h5pget_filter_c(hid_t_f *prp_id, int_f* filter_number, int_f* flags, size_t_f* cd_nelmts, int_f* cd_values, size_t_f *namelen, _fcd name, int_f* filter_id) /******/ { unsigned int c_flags; @@ -1921,7 +1819,7 @@ DONE: * name - Name of an external file * namelen - length of name * offset - Offset, in bytes, from the beginning of the file - * to the location in the file where the data starts. + * to the location in the file where the data starts. * bytes - Number of bytes reserved in the file for the data. * RETURNS * 0 on success, -1 on failure @@ -1934,7 +1832,7 @@ DONE: * SOURCE */ int_f -nh5pset_external_c (hid_t_f *prp_id, _fcd name, int_f* namelen, off_t_f* offset, hsize_t_f*bytes) +h5pset_external_c (hid_t_f *prp_id, _fcd name, int_f* namelen, off_t_f* offset, hsize_t_f*bytes) /******/ { int ret_value = -1; @@ -1967,25 +1865,25 @@ DONE: /****if* H5Pf/h5pget_external_count_c * NAME - * h5pget_external_count_c + * h5pget_external_count_c * PURPOSE - * Call H5Pget_external_count to get the number of external - * files for the specified dataset. + * Call H5Pget_external_count to get the number of external + * files for the specified dataset. * INPUTS - * prp_id - property list identifier + * prp_id - property list identifier * OUTPUTS - * count - number of external files + * count - number of external files * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Xiangyang Su - * Friday, February 25, 2000 + * Friday, February 25, 2000 * HISTORY * * SOURCE */ int_f -nh5pget_external_count_c (hid_t_f *prp_id, int_f* count) +h5pget_external_count_c (hid_t_f *prp_id, int_f* count) /******/ { int ret_value = -1; @@ -2008,14 +1906,14 @@ nh5pget_external_count_c (hid_t_f *prp_id, int_f* count) * PURPOSE * Call H5Pget_external to get nformation about an external file. * INPUTS - * prp_id - property list identifier - * name_size - length of name - * idx - External file index. + * prp_id - property list identifier + * name_size - length of name + * idx - External file index. * OUTPUT - * name - Name of an external file - * offset - Offset, in bytes, from the beginning of the file - * to the location in the file where the data starts. - * bytes - Number of bytes reserved in the file for the data. + * name - Name of an external file + * offset - Offset, in bytes, from the beginning of the file + * to the location in the file where the data starts. + * bytes - Number of bytes reserved in the file for the data. * RETURNS * on success, -1 on failure * AUTHOR @@ -2027,7 +1925,7 @@ nh5pget_external_count_c (hid_t_f *prp_id, int_f* count) * SOURCE */ int_f -nh5pget_external_c(hid_t_f *prp_id, int_f *idx, size_t_f* name_size, _fcd name, off_t_f* offset, hsize_t_f*bytes) +h5pget_external_c(hid_t_f *prp_id, int_f *idx, size_t_f* name_size, _fcd name, off_t_f* offset, hsize_t_f*bytes) /******/ { int ret_value = -1; @@ -2071,27 +1969,27 @@ DONE: /****if* H5Pf/h5pset_btree_ratios_c * NAME - * h5pset_btree_ratios_c + * h5pset_btree_ratios_c * PURPOSE - * Call H5Pset_btree_ratios to set B-tree split ratios for B-tree split ratios for a dataset transfer property list. a - * dataset transfer property list. + * Call H5Pset_btree_ratios to set B-tree split ratios for B-tree split ratios for a dataset transfer property list. a + * dataset transfer property list. * INPUTS - * prp_id - property list identifier - * left - The B-tree split ratio for left-most nodes. - * middle - The B-tree split ratio for all other nodes - * right - The B-tree split ratio for right-most nodes - * and lone nodes. + * prp_id - property list identifier + * left - The B-tree split ratio for left-most nodes. + * middle - The B-tree split ratio for all other nodes + * right - The B-tree split ratio for right-most nodes + * and lone nodes. * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Xiangyang Su - * Friday, February 25, 2000 + * Friday, February 25, 2000 * HISTORY - * Changed the type of the last three parameters from double to real_f + * Changed the type of the last three parameters from double to real_f * SOURCE */ int_f -nh5pset_btree_ratios_c(hid_t_f *prp_id, real_f* left, real_f* middle, real_f* right) +h5pset_btree_ratios_c(hid_t_f *prp_id, real_f* left, real_f* middle, real_f* right) /******/ { int ret_value = -1; @@ -2116,27 +2014,27 @@ nh5pset_btree_ratios_c(hid_t_f *prp_id, real_f* left, real_f* middle, real_f* ri /****if* H5Pf/h5pget_btree_ratios_c * NAME - * h5pget_btree_ratios_c + * h5pget_btree_ratios_c * PURPOSE - * Call H5Pget_btree_ratios to Gets B-tree split ratios - * for a dataset transfer property list. + * Call H5Pget_btree_ratios to Gets B-tree split ratios + * for a dataset transfer property list. * INPUTS - * prp_id - property list identifier - * left - The B-tree split ratio for left-most nodes. - * middle - The B-tree split ratio for all other nodes - * right - The B-tree split ratio for right-most nodes - * and lone nodes. + * prp_id - property list identifier + * left - The B-tree split ratio for left-most nodes. + * middle - The B-tree split ratio for all other nodes + * right - The B-tree split ratio for right-most nodes + * and lone nodes. * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Xiangyang Su - * Friday, February 25, 2000 + * Friday, February 25, 2000 * HISTORY - * Changed the type of the last three parameters from double to real_f + * Changed the type of the last three parameters from double to real_f * SOURCE */ int_f -nh5pget_btree_ratios_c(hid_t_f *prp_id, real_f* left, real_f* middle, real_f* right) +h5pget_btree_ratios_c(hid_t_f *prp_id, real_f* left, real_f* middle, real_f* right) /******/ { int ret_value = -1; @@ -2158,30 +2056,30 @@ nh5pget_btree_ratios_c(hid_t_f *prp_id, real_f* left, real_f* middle, real_f* ri } /****if* H5Pf/h5pget_fclose_degree_c * NAME - * h5pget_fclose_degree_c + * h5pget_fclose_degree_c * PURPOSE - * Call H5Pget_fclose_degree to determine file close behavior + * Call H5Pget_fclose_degree to determine file close behavior * INPUTS - * fapl_id - file access identifier + * fapl_id - file access identifier * OUTPUTS * - * degree - possible values are: + * degree - possible values are: * H5F_CLOSE_DEFAULT * H5F_CLOSE_WEAK * H5F_CLOSE_SEMI * H5F_CLOSE_STRONG * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * Thursday, September 26, 2002 + * Thursday, September 26, 2002 * HISTORY * * SOURCE */ int_f -nh5pget_fclose_degree_c ( hid_t_f *fapl_id , int_f *degree) +h5pget_fclose_degree_c ( hid_t_f *fapl_id , int_f *degree) /******/ { int ret_value = -1; @@ -2198,28 +2096,28 @@ nh5pget_fclose_degree_c ( hid_t_f *fapl_id , int_f *degree) /****if* H5Pf/h5pset_fclose_degree_c * NAME - * h5pset_fclose_degree_c + * h5pset_fclose_degree_c * PURPOSE - * Call H5Pset_fclose_degree to set file close behavior + * Call H5Pset_fclose_degree to set file close behavior * INPUTS - * fapl_id - file access identifier - * degree - possible values are: + * fapl_id - file access identifier + * degree - possible values are: * H5F_CLOSE_DEFAULT * H5F_CLOSE_WEAK * H5F_CLOSE_SEMI * H5F_CLOSE_STRONG * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * Thursday, September 26, 2002 + * Thursday, September 26, 2002 * HISTORY * * SOURCE */ int_f -nh5pset_fclose_degree_c ( hid_t_f *fapl_id , int_f *degree) +h5pset_fclose_degree_c ( hid_t_f *fapl_id , int_f *degree) /******/ { int ret_value = -1; @@ -2236,26 +2134,26 @@ nh5pset_fclose_degree_c ( hid_t_f *fapl_id , int_f *degree) /****if* H5Pf/h5pset_buffer_c * NAME - * h5pset_buffer_c + * h5pset_buffer_c * PURPOSE - * Call H5Pset_buffer to set size of conversion buffer + * Call H5Pset_buffer to set size of conversion buffer * INPUTS - * prp_id - t`dataset trasfer property list identifier - * size - size of the buffer + * prp_id - t`dataset trasfer property list identifier + * size - size of the buffer * OUTPUTS * NONE * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * Wednesday, October 2, 2002 + * Wednesday, October 2, 2002 * HISTORY * * SOURCE */ int_f -nh5pset_buffer_c ( hid_t_f *prp_id , hsize_t_f *size) +h5pset_buffer_c ( hid_t_f *prp_id , hsize_t_f *size) /******/ { int ret_value = 0; @@ -2270,25 +2168,25 @@ nh5pset_buffer_c ( hid_t_f *prp_id , hsize_t_f *size) /****if* H5Pf/h5pget_buffer_c * NAME - * h5pget_buffer_c + * h5pget_buffer_c * PURPOSE - * Call H5Pget_buffer to get size of conversion buffer + * Call H5Pget_buffer to get size of conversion buffer * INPUTS - * prp_id - t`dataset trasfer property list identifier + * prp_id - t`dataset trasfer property list identifier * OUTPUTS - * size - size of conversion buffer + * size - size of conversion buffer * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * Wednesday, October 2, 2002 + * Wednesday, October 2, 2002 * HISTORY * * SOURCE */ int_f -nh5pget_buffer_c ( hid_t_f *prp_id , hsize_t_f *size) +h5pget_buffer_c ( hid_t_f *prp_id , hsize_t_f *size) /******/ { int ret_value = -1; @@ -2304,25 +2202,25 @@ nh5pget_buffer_c ( hid_t_f *prp_id , hsize_t_f *size) } /****if* H5Pf/h5pfill_value_defined_c * NAME - * h5pfill_value_defined_c + * h5pfill_value_defined_c * PURPOSE - * Call H5Pfill_value_defined to check if fill value is defined + * Call H5Pfill_value_defined to check if fill value is defined * INPUTS - * prp_id - dataset creation property list identifier + * prp_id - dataset creation property list identifier * OUTPUTS - * flag - fill value status flag + * flag - fill value status flag * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * Friday, October 4, 2002 + * Friday, October 4, 2002 * HISTORY * * SOURCE */ int_f -nh5pfill_value_defined_c ( hid_t_f *prp_id , int_f *flag) +h5pfill_value_defined_c ( hid_t_f *prp_id , int_f *flag) /******/ { int ret_value = -1; @@ -2337,26 +2235,26 @@ nh5pfill_value_defined_c ( hid_t_f *prp_id , int_f *flag) } /****if* H5Pf/h5pget_alloc_time_c * NAME - * h5pget_alloc_time_c + * h5pget_alloc_time_c * PURPOSE - * Call H5Pget_alloc_time to get space allocation - * time for dataset during creation + * Call H5Pget_alloc_time to get space allocation + * time for dataset during creation * INPUTS - * prp_id - dataset creation property list identifier + * prp_id - dataset creation property list identifier * OUTPUTS - * flag - allocation time flag + * flag - allocation time flag * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * Friday, October 4, 2002 + * Friday, October 4, 2002 * HISTORY * * SOURCE */ int_f -nh5pget_alloc_time_c ( hid_t_f *prp_id , int_f *flag) +h5pget_alloc_time_c ( hid_t_f *prp_id , int_f *flag) /******/ { int ret_value = -1; @@ -2371,25 +2269,25 @@ nh5pget_alloc_time_c ( hid_t_f *prp_id , int_f *flag) } /****if* H5Pf/h5pset_alloc_time_c * NAME - * h5pset_alloc_time_c + * h5pset_alloc_time_c * PURPOSE - * Call H5Pset_alloc_time to get space allocation - * time for dataset during creation + * Call H5Pset_alloc_time to get space allocation + * time for dataset during creation * INPUTS - * prp_id - dataset creation property list identifier - * flag - allocation time flag + * prp_id - dataset creation property list identifier + * flag - allocation time flag * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * Friday, October 4, 2002 + * Friday, October 4, 2002 * HISTORY * * SOURCE */ int_f -nh5pset_alloc_time_c ( hid_t_f *prp_id , int_f *flag) +h5pset_alloc_time_c ( hid_t_f *prp_id , int_f *flag) /******/ { int ret_value = -1; @@ -2404,26 +2302,26 @@ nh5pset_alloc_time_c ( hid_t_f *prp_id , int_f *flag) } /****if* H5Pf/h5pget_fill_time_c * NAME - * h5pget_fill_time_c + * h5pget_fill_time_c * PURPOSE - * Call H5Pget_fill_time to get fill value writing - * time for dataset during creation + * Call H5Pget_fill_time to get fill value writing + * time for dataset during creation * INPUTS - * prp_id - dataset creation property list identifier + * prp_id - dataset creation property list identifier * OUTPUTS - * flag - fill value writing time flag + * flag - fill value writing time flag * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * Friday, October 4, 2002 + * Friday, October 4, 2002 * HISTORY * * SOURCE */ int_f -nh5pget_fill_time_c ( hid_t_f *prp_id , int_f *flag) +h5pget_fill_time_c ( hid_t_f *prp_id , int_f *flag) /******/ { int ret_value = -1; @@ -2438,25 +2336,25 @@ nh5pget_fill_time_c ( hid_t_f *prp_id , int_f *flag) } /****if* H5Pf/h5pset_fill_time_c * NAME - * h5pset_fill_time_c + * h5pset_fill_time_c * PURPOSE - * Call H5Pset_fill_time to set fill value writing - * time for dataset during creation + * Call H5Pset_fill_time to set fill value writing + * time for dataset during creation * INPUTS - * prp_id - dataset creation property list identifier - * flag - fill value writing time flag + * prp_id - dataset creation property list identifier + * flag - fill value writing time flag * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * Friday, October 4, 2002 + * Friday, October 4, 2002 * HISTORY * * SOURCE */ int_f -nh5pset_fill_time_c ( hid_t_f *prp_id , int_f *flag) +h5pset_fill_time_c ( hid_t_f *prp_id , int_f *flag) /******/ { int ret_value = -1; @@ -2471,26 +2369,26 @@ nh5pset_fill_time_c ( hid_t_f *prp_id , int_f *flag) } /****if* H5Pf/h5pset_meta_block_size_c * NAME - * h5pset_meta_block_size_c + * h5pset_meta_block_size_c * PURPOSE - * Call H5Pset_meta_block_size to set size of metadata block + * Call H5Pset_meta_block_size to set size of metadata block * INPUTS - * prp_id - file access property list identifier - * size - size of the metadata block + * prp_id - file access property list identifier + * size - size of the metadata block * OUTPUTS * NONE * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * Monday, October 7, 2002 + * Monday, October 7, 2002 * HISTORY * * SOURCE */ int_f -nh5pset_meta_block_size_c ( hid_t_f *prp_id , hsize_t_f *size) +h5pset_meta_block_size_c ( hid_t_f *prp_id , hsize_t_f *size) /******/ { int ret_value = 0; @@ -2504,26 +2402,26 @@ nh5pset_meta_block_size_c ( hid_t_f *prp_id , hsize_t_f *size) } /****if* H5Pf/h5pget_meta_block_size_c * NAME - * h5pget_meta_block_size_c + * h5pget_meta_block_size_c * PURPOSE - * Call H5Pget_meta_block_size to get size of metadata block + * Call H5Pget_meta_block_size to get size of metadata block * INPUTS - * prp_id - file access property list identifier + * prp_id - file access property list identifier * OUTPUTS * - * size - size of the metadata block + * size - size of the metadata block * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * Monday, October 7, 2002 + * Monday, October 7, 2002 * HISTORY * * SOURCE */ int_f -nh5pget_meta_block_size_c ( hid_t_f *prp_id , hsize_t_f *size) +h5pget_meta_block_size_c ( hid_t_f *prp_id , hsize_t_f *size) /******/ { int ret_value = 0; @@ -2537,26 +2435,26 @@ nh5pget_meta_block_size_c ( hid_t_f *prp_id , hsize_t_f *size) } /****if* H5Pf/h5pset_sieve_buf_size_c * NAME - * h5pset_sieve_buf_size_c + * h5pset_sieve_buf_size_c * PURPOSE - * Call H5Pset_sieve_buf_size to set size of datasieve buffer + * Call H5Pset_sieve_buf_size to set size of datasieve buffer * INPUTS - * prp_id - file access property list identifier - * size - size of the buffer + * prp_id - file access property list identifier + * size - size of the buffer * OUTPUTS * NONE * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * Monday, October 7, 2002 + * Monday, October 7, 2002 * HISTORY * * SOURCE */ int_f -nh5pset_sieve_buf_size_c ( hid_t_f *prp_id , size_t_f *size) +h5pset_sieve_buf_size_c ( hid_t_f *prp_id , size_t_f *size) /******/ { int ret_value = 0; @@ -2570,26 +2468,26 @@ nh5pset_sieve_buf_size_c ( hid_t_f *prp_id , size_t_f *size) } /****if* H5Pf/h5pget_sieve_buf_size_c * NAME - * h5pget_sieve_buf_size_c + * h5pget_sieve_buf_size_c * PURPOSE - * Call H5Pget_sieve_buf_size to get size of datasieve buffer + * Call H5Pget_sieve_buf_size to get size of datasieve buffer * INPUTS - * prp_id - file access property list identifier + * prp_id - file access property list identifier * OUTPUTS * - * size - size of the buffer + * size - size of the buffer * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * Monday, October 7, 2002 + * Monday, October 7, 2002 * HISTORY * * SOURCE */ int_f -nh5pget_sieve_buf_size_c ( hid_t_f *prp_id , size_t_f *size) +h5pget_sieve_buf_size_c ( hid_t_f *prp_id , size_t_f *size) /******/ { int ret_value = 0; @@ -2603,26 +2501,26 @@ nh5pget_sieve_buf_size_c ( hid_t_f *prp_id , size_t_f *size) } /****if* H5Pf/h5pset_small_data_block_size_c * NAME - * h5pset_small_data_block_size_c + * h5pset_small_data_block_size_c * PURPOSE - * Call H5Pset_small_data_block_size to set size of raw small data block + * Call H5Pset_small_data_block_size to set size of raw small data block * INPUTS - * prp_id - file access property list identifier - * size - size of the block + * prp_id - file access property list identifier + * size - size of the block * OUTPUTS * NONE * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * Monday, October 7, 2002 + * Monday, October 7, 2002 * HISTORY * * SOURCE */ int_f -nh5pset_small_data_block_size_c ( hid_t_f *prp_id , hsize_t_f *size) +h5pset_small_data_block_size_c ( hid_t_f *prp_id , hsize_t_f *size) /******/ { int ret_value = 0; @@ -2636,26 +2534,26 @@ nh5pset_small_data_block_size_c ( hid_t_f *prp_id , hsize_t_f *size) } /****if* H5Pf/h5pget_small_data_block_size_c * NAME - * h5pget_small_data_block_size_c + * h5pget_small_data_block_size_c * PURPOSE - * Call H5Pget_small_data_block_size to get size of raw small data block + * Call H5Pget_small_data_block_size to get size of raw small data block * INPUTS - * prp_id - file access property list identifier + * prp_id - file access property list identifier * OUTPUTS * - * size - size of the block + * size - size of the block * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * Monday, October 7, 2002 + * Monday, October 7, 2002 * HISTORY * * SOURCE */ int_f -nh5pget_small_data_block_size_c ( hid_t_f *prp_id , hsize_t_f *size) +h5pget_small_data_block_size_c ( hid_t_f *prp_id , hsize_t_f *size) /******/ { int ret_value = 0; @@ -2669,26 +2567,26 @@ nh5pget_small_data_block_size_c ( hid_t_f *prp_id , hsize_t_f *size) } /****if* H5Pf/h5pset_hyper_vector_size_c * NAME - * h5pset_hyper_vector_size_c + * h5pset_hyper_vector_size_c * PURPOSE - * Call H5Pset_hyper_vector_size to set size of the hyper vector + * Call H5Pset_hyper_vector_size to set size of the hyper vector * INPUTS - * prp_id - dataset transfer property list identifier - * size - size of the vector + * prp_id - dataset transfer property list identifier + * size - size of the vector * OUTPUTS * NONE * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * Monday, October 7, 2002 + * Monday, October 7, 2002 * HISTORY * * SOURCE */ int_f -nh5pset_hyper_vector_size_c ( hid_t_f *prp_id , size_t_f *size) +h5pset_hyper_vector_size_c ( hid_t_f *prp_id , size_t_f *size) /******/ { int ret_value = 0; @@ -2702,26 +2600,26 @@ nh5pset_hyper_vector_size_c ( hid_t_f *prp_id , size_t_f *size) } /****if* H5Pf/h5pget_hyper_vector_size_c * NAME - * h5pget_hyper_vector_size_c + * h5pget_hyper_vector_size_c * PURPOSE - * Call H5Pget_hyper_vector_size to get size of the hyper vector + * Call H5Pget_hyper_vector_size to get size of the hyper vector * INPUTS - * prp_id - dataset transfer property list identifier + * prp_id - dataset transfer property list identifier * OUTPUTS * - * size - size of the vector + * size - size of the vector * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * Monday, October 7, 2002 + * Monday, October 7, 2002 * HISTORY * * SOURCE */ int_f -nh5pget_hyper_vector_size_c ( hid_t_f *prp_id , size_t_f *size) +h5pget_hyper_vector_size_c ( hid_t_f *prp_id , size_t_f *size) /******/ { int ret_value = 0; @@ -2733,36 +2631,6 @@ nh5pget_hyper_vector_size_c ( hid_t_f *prp_id , size_t_f *size) *size = (size_t_f)c_size; return ret_value; } -/****if* H5Pf/h5pcreate_class_c - * NAME - * h5pcreate_class_c - * PURPOSE - * Call H5Pcreate_class to create a new property class - * INPUTS - * parent - property list class identifier - * name - name of the new class - * name_len - lenght of the "name" buffer - * OUTPUTS - * cls - new class identifier - * RETURNS - * 0 on success, -1 on failure - * AUTHOR - * Elena Pourmal - * October 11, 2002 - * - * HISTORY - * SOURCE -*/ -int_f -nh5pcreate_class_f90_c(hid_t_f *parent, _fcd name, int_f *name_len, hid_t_f *cls) -/******/ -{ - int ret_value = -1; - - ret_value = h5pcreate_class_c(parent, name, name_len, cls, NULL, NULL, NULL, NULL, NULL, NULL); - return ret_value; -} - /****if* H5Pf/h5pcreate_class_c * NAME @@ -2814,18 +2682,17 @@ DONE: return ret_value; } - -/****if* H5Pf/h5pregisterc_c +/****if* H5Pf/h5pregister_c * NAME - * h5pregisterc_c + * h5pregister_c * PURPOSE - * Call h5pregister_c to registers a permanent property + * Call H5Pregister2 to registers a permanent property * INPUTS * class - property list class identifier * name - name of the new property * name_len - length of the "name" buffer * size - property size - * value - property value of character type + * value - property value * RETURNS * 0 on success, -1 on failure * AUTHOR @@ -2836,54 +2703,21 @@ DONE: * SOURCE */ int_f -nh5pregisterc_c(hid_t_f *cls, _fcd name, int_f *name_len, size_t_f *size, _fcd value, int_f H5_ATTR_UNUSED *value_len) +h5pregister_c(hid_t_f *cls, _fcd name, int_f *name_len, size_t_f *size, void H5_ATTR_UNUSED *value) /******/ { - int ret_value = -1; + char* c_name = NULL; + int_f ret_value = -1; + + if(NULL == (c_name = (char *)HD5f2cstring(name, (size_t)*name_len))) + goto DONE; /* - * Call h5pregister_c function + * Call H5Pregister2 function. */ - ret_value = h5pregister_c(cls, name, name_len, size, _fcdtocp(value)); - return ret_value; -} - -/****if* H5Pf/h5pregister_c - * NAME - * h5pregister_c - * PURPOSE - * Call H5Pregister2 to registers a permanent property - * INPUTS - * class - property list class identifier - * name - name of the new property - * name_len - length of the "name" buffer - * size - property size - * value - property value - * RETURNS - * 0 on success, -1 on failure - * AUTHOR - * Elena Pourmal - * October 11, 2002 - * HISTORY - * - * SOURCE -*/ -int_f -h5pregister_c(hid_t_f *cls, _fcd name, int_f *name_len, size_t_f *size, void H5_ATTR_UNUSED *value) -/******/ -{ - char* c_name = NULL; - int_f ret_value = -1; - - if(NULL == (c_name = (char *)HD5f2cstring(name, (size_t)*name_len))) - goto DONE; - - /* - * Call H5Pregister2 function. - */ - if(H5Pregister2((hid_t)*cls, c_name, (size_t)*size, value, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) - goto DONE; - ret_value = 0; + if(H5Pregister2((hid_t)*cls, c_name, (size_t)*size, value, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) + goto DONE; + ret_value = 0; DONE: if(c_name != NULL) @@ -2891,66 +2725,6 @@ DONE: return ret_value; } -int_f -nh5pregister_integer_c(hid_t_f *cls, _fcd name, int_f *name_len, size_t_f *size, void *value) -{ - /* - * Call h5pregister_c function - */ - return h5pregister_c(cls, name, name_len, size, value); -} - -int_f -nh5pregister_real_c(hid_t_f *cls, _fcd name, int_f *name_len, size_t_f *size, void *value) -{ - /* - * Call h5pregister_c function - */ - return h5pregister_c(cls, name, name_len, size, value); -} - -int_f -nh5pregister_double_c(hid_t_f *cls, _fcd name, int_f *name_len, size_t_f *size, void *value) -{ - /* - * Call h5pregister_c function - */ - return h5pregister_c(cls, name, name_len, size, value); -} - -/****if* H5Pf/h5pinsertc_c - * NAME - * h5pinsertc_c - * PURPOSE - * Call h5pinsert_c to register a temporary property - * INPUTS - * plist - property list identifier - * name - name of the new property - * name_len - length of the "name" buffer - * size - property size - * value - property value of character type - * RETURNS - * 0 on success, -1 on failure - * AUTHOR - * Elena Pourmal - * October 11, 2002 - * HISTORY - * - * SOURCE -*/ -int_f -nh5pinsertc_c(hid_t_f *plist, _fcd name, int_f *name_len, size_t_f *size, _fcd value, int_f H5_ATTR_UNUSED *value_len) -/******/ -{ - int_f ret_value = -1; - - /* - * Call h5pinsert_c function - */ - ret_value = h5pinsert_c(plist, name, name_len, size, _fcdtocp(value)); - return ret_value; -} - /****if* H5Pf/h5pinsert_c * NAME * h5pinsert_c @@ -2994,54 +2768,27 @@ DONE: return ret_value; } -int_f -nh5pinsert_integer_c(hid_t_f *plist, _fcd name, int_f *name_len, size_t_f *size, void *value) -{ - /* - * Call h5pinsert_c function - */ - return h5pinsert_c(plist, name, name_len, size, value); -} - -int_f -nh5pinsert_real_c(hid_t_f *plist, _fcd name, int_f *name_len, size_t_f *size, void *value) -{ - /* - * Call h5pinsert_c function - */ - return h5pinsert_c(plist, name, name_len, size, value); -} - -int_f -nh5pinsert_double_c(hid_t_f *plist, _fcd name, int_f *name_len, size_t_f *size, void *value) -{ - /* - * Call h5pinsert_c function - */ - return h5pinsert_c(plist, name, name_len, size, value); -} - /****if* H5Pf/h5pexist_c * NAME - * h5pexist_c + * h5pexist_c * PURPOSE - * Call H5Pexist to querie whether a property name exists - * in a property list or class + * Call H5Pexist to querie whether a property name exists + * in a property list or class * INPUTS - * plist - property list or property class identifier - * name - name of the new property - * name_len - length of the "name" buffer + * plist - property list or property class identifier + * name - name of the new property + * name_len - length of the "name" buffer * RETURNS - * nonnegative on success, -1 on failure + * nonnegative on success, -1 on failure * AUTHOR * Elena Pourmal - * October 11, 2002 + * October 11, 2002 * HISTORY * * SOURCE */ int_f -nh5pexist_c(hid_t_f *cls, _fcd name, int_f *name_len) +h5pexist_c(hid_t_f *cls, _fcd name, int_f *name_len) /******/ { int_f ret_value = -1; @@ -3065,24 +2812,24 @@ DONE: } /****if* H5Pf/h5pisa_class_c * NAME - * h5pisa_class_c + * h5pisa_class_c * PURPOSE - * Call H5Pisa_class to querie whether a property is a - * member of a class + * Call H5Pisa_class to querie whether a property is a + * member of a class * INPUTS - * plist - property list identifier - * cls - property class identifier + * plist - property list identifier + * cls - property class identifier * RETURNS - * nonnegative on success, -1 on failure + * nonnegative on success, -1 on failure * AUTHOR * Elena Pourmal - * October 11, 2002 + * October 11, 2002 * HISTORY * * SOURCE */ int_f -nh5pisa_class_c(hid_t_f *plist, hid_t_f *cls) +h5pisa_class_c(hid_t_f *plist, hid_t_f *cls) /******/ { int_f ret_value = -1; @@ -3102,26 +2849,26 @@ nh5pisa_class_c(hid_t_f *plist, hid_t_f *cls) } /****if* H5Pf/h5pget_size_c * NAME - * h5pget_size_c + * h5pget_size_c * PURPOSE - * Call H5Pget_size to querie the size of the property + * Call H5Pget_size to querie the size of the property * INPUTS - * plist - property list to query - * name - name of the property - * name_len - length of the "name" buffer + * plist - property list to query + * name - name of the property + * name_len - length of the "name" buffer * OUTPUTS - * size - size of the property in bytes + * size - size of the property in bytes * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * October 11, 2002 + * October 11, 2002 * HISTORY * * SOURCE */ int_f -nh5pget_size_c(hid_t_f *plist, _fcd name, int_f *name_len, size_t_f *size) +h5pget_size_c(hid_t_f *plist, _fcd name, int_f *name_len, size_t_f *size) /******/ { int_f ret_value = -1; @@ -3146,24 +2893,24 @@ DONE: } /****if* H5Pf/h5pget_nprops_c * NAME - * h5pget_nprops_c + * h5pget_nprops_c * PURPOSE - * Call H5Pget_nporps to get number of the properties in the list + * Call H5Pget_nporps to get number of the properties in the list * INPUTS - * plist - property list to query + * plist - property list to query * OUTPUTS - * nprops - number of properties in the list + * nprops - number of properties in the list * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * October 11, 2002 + * October 11, 2002 * HISTORY * * SOURCE */ int_f -nh5pget_nprops_c(hid_t_f *plist, size_t_f *nprops) +h5pget_nprops_c(hid_t_f *plist, size_t_f *nprops) /******/ { int_f ret_value = -1; @@ -3183,25 +2930,25 @@ nh5pget_nprops_c(hid_t_f *plist, size_t_f *nprops) } /****if* H5Pf/h5pget_class_parent_c * NAME - * h5pget_class_parent_c + * h5pget_class_parent_c * PURPOSE - * Call H5Pget_class_parent to get the parent class of - * a genereic property class + * Call H5Pget_class_parent to get the parent class of + * a genereic property class * INPUTS - * prp_id - property list to query + * prp_id - property list to query * OUTPUTS - * parent_id - parent classs identifier + * parent_id - parent classs identifier * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * October 11, 2002 + * October 11, 2002 * HISTORY * * SOURCE */ int_f -nh5pget_class_parent_c(hid_t_f *prp_id, hid_t_f *parent_id) +h5pget_class_parent_c(hid_t_f *prp_id, hid_t_f *parent_id) /******/ { int_f ret_value = -1; @@ -3222,26 +2969,26 @@ nh5pget_class_parent_c(hid_t_f *prp_id, hid_t_f *parent_id) } /****if* H5Pf/h5pcopy_prop_c * NAME - * h5pcopy_prop_c + * h5pcopy_prop_c * PURPOSE - * Call H5Pcopy_prop to copy a property from one list or - * class to another + * Call H5Pcopy_prop to copy a property from one list or + * class to another * INPUTS - * dst_id - identifier of destination property list - * src_id - identifier of source property list - * name - name of the property - * name_len - length of the "name" buffer + * dst_id - identifier of destination property list + * src_id - identifier of source property list + * name - name of the property + * name_len - length of the "name" buffer * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * October 11, 2002 + * October 11, 2002 * HISTORY * * SOURCE */ int_f -nh5pcopy_prop_c(hid_t_f *dst_id, hid_t_f *src_id, _fcd name, int_f *name_len) +h5pcopy_prop_c(hid_t_f *dst_id, hid_t_f *src_id, _fcd name, int_f *name_len) /******/ { int_f ret_value = -1; @@ -3265,24 +3012,24 @@ DONE: } /****if* H5Pf/h5premove_c * NAME - * h5premove_c + * h5premove_c * PURPOSE - * Call H5Premove to remove a property from a list + * Call H5Premove to remove a property from a list * INPUTS - * plid - identifier of property list - * name - name of the property to remove - * name_len - length of the "name" buffer + * plid - identifier of property list + * name - name of the property to remove + * name_len - length of the "name" buffer * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * October 11, 2002 + * October 11, 2002 * HISTORY * * SOURCE */ int_f -nh5premove_c(hid_t_f *plid, _fcd name, int_f *name_len) +h5premove_c(hid_t_f *plid, _fcd name, int_f *name_len) /******/ { int_f ret_value = -1; @@ -3305,15 +3052,15 @@ DONE: } /****if* H5Pf/h5punregister_c * NAME - * h5punregister_c + * h5punregister_c * PURPOSE - * Call H5Punregister to remove a property from a property class + * Call H5Punregister to remove a property from a property class * INPUTS - * cls - identifier of property class - * name - name of the property to unregister - * name_len - length of the "name" buffer + * cls - identifier of property class + * name - name of the property to unregister + * name_len - length of the "name" buffer * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal * October 11, 2002 @@ -3322,7 +3069,7 @@ DONE: * SOURCE */ int_f -nh5punregister_c(hid_t_f *cls, _fcd name, int_f *name_len) +h5punregister_c(hid_t_f *cls, _fcd name, int_f *name_len) /******/ { int_f ret_value = -1; @@ -3345,13 +3092,13 @@ DONE: } /****if* H5Pf/h5pclose_class_c * NAME - * h5pclose_class_c + * h5pclose_class_c * PURPOSE - * Call H5Pclose_class to close property class + * Call H5Pclose_class to close property class * INPUTS - * class - identifier of property class to close + * class - identifier of property class to close * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal * October 11, 2002 @@ -3360,7 +3107,7 @@ DONE: * SOURCE */ int_f -nh5pclose_class_c(hid_t_f *cls) +h5pclose_class_c(hid_t_f *cls) /******/ { int_f ret_value = -1; @@ -3377,15 +3124,15 @@ nh5pclose_class_c(hid_t_f *cls) /****if* H5Pf/h5pget_class_name_c * NAME - * h5pget_class_name_c + * h5pget_class_name_c * PURPOSE - * Call H5Pget_class_name to get property class name + * Call H5Pget_class_name to get property class name * INPUTS - * cls - identifier of property class - * name - buffer to retrieve name in - * name_len - length of the "name" buffer + * cls - identifier of property class + * name - buffer to retrieve name in + * name_len - length of the "name" buffer * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal * October 11, 2002 @@ -3394,7 +3141,7 @@ nh5pclose_class_c(hid_t_f *cls) * SOURCE */ int_f -nh5pget_class_name_c(hid_t_f *cls, _fcd name, int_f *name_len) +h5pget_class_name_c(hid_t_f *cls, _fcd name, int_f *name_len) /******/ { int_f ret_value = -1; @@ -3417,38 +3164,6 @@ DONE: return ret_value; } -/****if* H5Pf/h5psetc_c - * NAME - * h5psetc_c - * PURPOSE - * Call h5setc_c to set property with the character string value - * INPUTS - * plist - property list identifier - * name - name of property - * name_len - length of the "name" buffer - * value - property value of character type - * RETURNS - * 0 on success, -1 on failure - * AUTHOR - * Elena Pourmal - * October 11, 2002 - * HISTORY - * - * SOURCE -*/ -int_f -nh5psetc_c(hid_t_f *plist, _fcd name, int_f *name_len, _fcd value, int_f H5_ATTR_UNUSED *value_len) -/******/ -{ - int_f ret_value = -1; - - /* - * Call h5pset_c function - */ - ret_value = h5pset_c(plist, name, name_len, _fcdtocp(value)); - return ret_value; -} - /****if* H5Pf/h5pset_c * NAME * h5pset_c @@ -3489,64 +3204,6 @@ DONE: return ret_value; } -int_f -nh5pset_integer_c(hid_t_f *plist, _fcd name, int_f *name_len, void *value) -{ - /* - * Call h5pset_c function - */ - return h5pset_c(plist, name, name_len, value); -} - -int_f -nh5pset_real_c(hid_t_f *plist, _fcd name, int_f *name_len, void *value) -{ - /* - * Call h5pset_c function - */ - return h5pset_c(plist, name, name_len, value); -} - -int_f -nh5pset_double_c(hid_t_f *plist, _fcd name, int_f *name_len, void *value) -{ - /* - * Call h5pset_c function - */ - return h5pset_c(plist, name, name_len, value); -} -/****if* H5Pf/h5pgetc_c - * NAME - * h5pgetc_c - * PURPOSE - * Call h5set_c to set property with the character string value - * INPUTS - * plist - property list identifier - * name - name of property - * name_len - length of the "name" buffer - * Output: value - property value of character type - * RETURNS - * 0 on success, -1 on failure - * AUTHOR - * Elena Pourmal - * October 11, 2002 - * HISTORY - * - * SOURCE -*/ -int_f -nh5pgetc_c(hid_t_f *plist, _fcd name, int_f *name_len, _fcd value, int_f H5_ATTR_UNUSED *value_len) -/******/ -{ - int_f ret_value = -1; - - /* - * Call h5pget_c function - */ - ret_value = h5pget_c(plist, name, name_len, _fcdtocp(value)); - return ret_value; -} - /****if* H5Pf/h5pget_c * NAME * h5pget_c @@ -3556,7 +3213,7 @@ nh5pgetc_c(hid_t_f *plist, _fcd name, int_f *name_len, _fcd value, int_f H5_ATTR * plist - property list class identifier * name - name of the new property * name_len - length of the "name" buffer - * Output: + * Output: * value - property value * RETURNS * 0 on success, -1 on failure @@ -3588,54 +3245,26 @@ DONE: return ret_value; } -int_f -nh5pget_integer_c(hid_t_f *plist, _fcd name, int_f *name_len, void *value) -{ - /* - * Call h5pget_c function - */ - return h5pget_c(plist, name, name_len, value); -} - -int_f -nh5pget_real_c(hid_t_f *plist, _fcd name, int_f *name_len, void *value) -{ - /* - * Call h5pget_c function - */ - return h5pget_c(plist, name, name_len, value); -} - -int_f -nh5pget_double_c(hid_t_f *plist, _fcd name, int_f *name_len, void *value) -{ - /* - * Call h5pget_c function - */ - return h5pget_c(plist, name, name_len, value); -} - - /****if* H5Pf/h5pset_shuffle_c * NAME - * h5pset_shuffle_c + * h5pset_shuffle_c * PURPOSE - * Call H5Pset_shuffle + * Call H5Pset_shuffle * INPUTS - * prp_id - property list identifier - * type_size - size of the datatype in bytes + * prp_id - property list identifier + * type_size - size of the datatype in bytes * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * Wednesday, March 12, 2003 + * Wednesday, March 12, 2003 * HISTORY * * SOURCE */ int_f -nh5pset_shuffle_c ( hid_t_f *prp_id ) +h5pset_shuffle_c ( hid_t_f *prp_id ) /******/ { int_f ret_value = 0; @@ -3649,23 +3278,23 @@ nh5pset_shuffle_c ( hid_t_f *prp_id ) } /****if* H5Pf/h5pset_fletcher32_c * NAME - * h5pset_fletcher32_c + * h5pset_fletcher32_c * PURPOSE - * Call H5Pset_fletcher32 to enable EDC + * Call H5Pset_fletcher32 to enable EDC * INPUTS - * prp_id - dataset creation property list identifier + * prp_id - dataset creation property list identifier * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * Thursday, March 13, 2003 + * Thursday, March 13, 2003 * HISTORY * * SOURCE */ int_f -nh5pset_fletcher32_c ( hid_t_f *prp_id ) +h5pset_fletcher32_c ( hid_t_f *prp_id ) /******/ { int_f ret_value = 0; @@ -3680,24 +3309,24 @@ nh5pset_fletcher32_c ( hid_t_f *prp_id ) /****if* H5Pf/h5pset_edc_check_c * NAME - * h5pset_edc_check_c + * h5pset_edc_check_c * PURPOSE - * Call H5Pset_edc_check to enable EDC + * Call H5Pset_edc_check to enable EDC * INPUTS - * prp_id - dataset transfer property list identifier - * flag - EDC flag + * prp_id - dataset transfer property list identifier + * flag - EDC flag * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * Thursday, March 13, 2003 + * Thursday, March 13, 2003 * HISTORY * * SOURCE */ int_f -nh5pset_edc_check_c ( hid_t_f *prp_id, int_f *flag ) +h5pset_edc_check_c ( hid_t_f *prp_id, int_f *flag ) /******/ { int_f ret_value = 0; @@ -3714,24 +3343,24 @@ nh5pset_edc_check_c ( hid_t_f *prp_id, int_f *flag ) /****if* H5Pf/h5pget_edc_check_c * NAME - * h5pget_edc_check_c + * h5pget_edc_check_c * PURPOSE - * Call H5Pget_edc_check to query EDC + * Call H5Pget_edc_check to query EDC * INPUTS - * prp_id - dataset transfer property list identifier - * Outouts: flag - EDC flag + * prp_id - dataset transfer property list identifier + * Outouts: flag - EDC flag * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * Thursday, March 13, 2003 + * Thursday, March 13, 2003 * HISTORY * * SOURCE */ int_f -nh5pget_edc_check_c ( hid_t_f *prp_id, int_f *flag ) +h5pget_edc_check_c ( hid_t_f *prp_id, int_f *flag ) /******/ { int_f ret_value = 0; @@ -3746,24 +3375,24 @@ nh5pget_edc_check_c ( hid_t_f *prp_id, int_f *flag ) } /****if* H5Pf/h5pset_family_offset_c * NAME - * h5pset_family_offset_c + * h5pset_family_offset_c * PURPOSE - * Call H5Pset_family_offset to set and offset for family driver + * Call H5Pset_family_offset to set and offset for family driver * INPUTS - * prp_id - property list identifier - * offset - offset in bytes + * prp_id - property list identifier + * offset - offset in bytes * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * Wednesday, 19 March 2003 + * Wednesday, 19 March 2003 * HISTORY * * SOURCE */ int_f -nh5pset_family_offset_c ( hid_t_f *prp_id , hsize_t_f *offset) +h5pset_family_offset_c ( hid_t_f *prp_id , hsize_t_f *offset) /******/ { int_f ret_value = 0; @@ -3780,30 +3409,30 @@ nh5pset_family_offset_c ( hid_t_f *prp_id , hsize_t_f *offset) /****if* H5Pf/h5pset_fapl_multi_c * NAME - * h5pset_fapl_multi_c + * h5pset_fapl_multi_c * PURPOSE - * Call H5Pset_fapl_multi to set multi file dirver + * Call H5Pset_fapl_multi to set multi file dirver * INPUTS - * prp_id - file_creation property list identifier - * mem_map - memory mapping array - * memb_fapl - property list for each memory usage type - * memb_name - array with members names - * len - array with the lenght of each name - * lenmax - lenght of the name a sdeclared in Fortran - * flag - flag allowing partila access when one of the files is missing + * prp_id - file_creation property list identifier + * mem_map - memory mapping array + * memb_fapl - property list for each memory usage type + * memb_name - array with members names + * len - array with the lenght of each name + * lenmax - lenght of the name a sdeclared in Fortran + * flag - flag allowing partila access when one of the files is missing * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * Monday 24, March 2003 + * Monday 24, March 2003 * HISTORY * * SOURCE */ int_f -/*nh5pset_fapl_multi_c ( hid_t_f *prp_id , int_f *memb_map, hid_t_f *memb_fapl, _fcd memb_name, int_f *len, int_f *lenmax, haddr_t_f *memb_addr, int_f *flag) */ -nh5pset_fapl_multi_c ( hid_t_f *prp_id , int_f *memb_map, hid_t_f *memb_fapl, _fcd memb_name, int_f *len, int_f *lenmax, real_f *memb_addr, int_f *flag) +/*h5pset_fapl_multi_c ( hid_t_f *prp_id , int_f *memb_map, hid_t_f *memb_fapl, _fcd memb_name, int_f *len, int_f *lenmax, haddr_t_f *memb_addr, int_f *flag) */ +h5pset_fapl_multi_c ( hid_t_f *prp_id , int_f *memb_map, hid_t_f *memb_fapl, _fcd memb_name, int_f *len, int_f *lenmax, real_f *memb_addr, int_f *flag) /******/ { int_f ret_value = -1; @@ -3821,13 +3450,13 @@ nh5pset_fapl_multi_c ( hid_t_f *prp_id , int_f *memb_map, hid_t_f *memb_fapl, _f c_lenmax = (int)*lenmax; relax = (hbool_t)*flag; /* - * Check that we got correct values from Fortran for memb_addr array + * Check that we got correct values from Fortran for memb_addr array */ for (i=0; i < H5FD_MEM_NTYPES; i++) { if(memb_addr[i] >= 1.0f) return ret_value; } /* - * Take care of names array + * Take care of names array */ tmp = (char *)HD5f2cstring(memb_name, (size_t)c_lenmax*(H5FD_MEM_NTYPES)); @@ -3841,7 +3470,7 @@ nh5pset_fapl_multi_c ( hid_t_f *prp_id , int_f *memb_map, hid_t_f *memb_fapl, _f tmp_p = tmp_p + c_lenmax; } /* - * Take care of othe arguments + * Take care of othe arguments */ tmp_max_addr = (long double)(HADDR_MAX); c_prp_id = (hid_t)*prp_id; @@ -3852,7 +3481,7 @@ nh5pset_fapl_multi_c ( hid_t_f *prp_id , int_f *memb_map, hid_t_f *memb_fapl, _f else c_memb_addr[i] = (haddr_t)(((float)memb_addr[i])*(tmp_max_addr)); } /* - * Call H5Pset_fapl_multi function + * Call H5Pset_fapl_multi function */ status = H5Pset_fapl_multi(c_prp_id, c_memb_map, c_memb_fapl, (const char * const *)c_memb_name, c_memb_addr, relax); @@ -3868,23 +3497,23 @@ DONE: /****if* H5Pf/h5pset_fapl_multi_sc * NAME - * h5pset_fapl_multi_sc + * h5pset_fapl_multi_sc * PURPOSE - * Call H5Pset_fapl_multi to set multi file dirver + * Call H5Pset_fapl_multi to set multi file dirver * INPUTS - * prp_id - file_creation property list identifier + * prp_id - file_creation property list identifier * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * March 31 2003 + * March 31 2003 * HISTORY * * SOURCE */ int_f -nh5pset_fapl_multi_sc ( hid_t_f *prp_id , int_f *flag) +h5pset_fapl_multi_sc ( hid_t_f *prp_id , int_f *flag) /******/ { int_f ret_value = -1; @@ -3895,7 +3524,7 @@ nh5pset_fapl_multi_sc ( hid_t_f *prp_id , int_f *flag) relax = (hbool_t)*flag; c_prp_id = (hid_t)*prp_id; /* - * Call H5Pset_fapl_multi function + * Call H5Pset_fapl_multi function */ status = H5Pset_fapl_multi(c_prp_id, NULL, NULL, NULL, NULL, relax); @@ -3905,30 +3534,30 @@ nh5pset_fapl_multi_sc ( hid_t_f *prp_id , int_f *flag) } /****if* H5Pf/h5pget_fapl_multi_c * NAME - * h5pget_fapl_multi_c + * h5pget_fapl_multi_c * PURPOSE - * Call H5Pget_fapl_multi to set multi file dirver + * Call H5Pget_fapl_multi to set multi file dirver * INPUTS - * prp_id - file_creation property list identifier - * lenmax - lenght of the name a sdeclared in Fortran + * prp_id - file_creation property list identifier + * lenmax - lenght of the name a sdeclared in Fortran * OUTPUTS - * memb_map - memory mapping array - * memb_fapl - property list for each memory usage type - * memb_name - array with members names - * len - array with the lenght of each name - * flag - flag allowing partila access when one of the files is missing + * memb_map - memory mapping array + * memb_fapl - property list for each memory usage type + * memb_name - array with members names + * len - array with the lenght of each name + * flag - flag allowing partila access when one of the files is missing * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * Monday 24, March 2003 + * Monday 24, March 2003 * HISTORY * * SOURCE */ int_f -nh5pget_fapl_multi_c ( hid_t_f *prp_id , int_f *memb_map, hid_t_f *memb_fapl, _fcd memb_name, int_f *len, int_f *lenmax, real_f *memb_addr, int_f *flag, int_f *maxlen_out) +h5pget_fapl_multi_c ( hid_t_f *prp_id , int_f *memb_map, hid_t_f *memb_fapl, _fcd memb_name, int_f *len, int_f *lenmax, real_f *memb_addr, int_f *flag, int_f *maxlen_out) /******/ { int_f ret_value = -1; @@ -3947,14 +3576,14 @@ nh5pget_fapl_multi_c ( hid_t_f *prp_id , int_f *memb_map, hid_t_f *memb_fapl, _f c_prp_id = (hid_t)*prp_id; /* - * Call H5Pget_fapl_multi function + * Call H5Pget_fapl_multi function */ status = H5Pget_fapl_multi(c_prp_id, c_memb_map, c_memb_fapl, c_memb_name, c_memb_addr, &relax); if ( status < 0 ) return ret_value; /* - * Take care of names array + * Take care of names array */ tmp = (char *)HDmalloc(c_lenmax*H5FD_MEM_NTYPES + 1); tmp_p = tmp; @@ -3969,7 +3598,7 @@ nh5pget_fapl_multi_c ( hid_t_f *prp_id , int_f *memb_map, hid_t_f *memb_fapl, _f HD5packFstring(tmp, _fcdtocp(memb_name), (size_t)(c_lenmax*H5FD_MEM_NTYPES)); /* - * Take care of other arguments + * Take care of other arguments */ for (i=0; i < H5FD_MEM_NTYPES; i++) { @@ -3989,25 +3618,25 @@ HD5packFstring(tmp, _fcdtocp(memb_name), (size_t)(c_lenmax*H5FD_MEM_NTYPES)); /****if* H5Pf/h5pset_szip_c * NAME - * h5pset_szip_c + * h5pset_szip_c * PURPOSE - * Call H5Pset_szip to set szip compression + * Call H5Pset_szip to set szip compression * INPUTS - * prp_id - dataset creation property list identifier - * options_mask - * pixels_per_block -szip compression parameters + * prp_id - dataset creation property list identifier + * options_mask + * pixels_per_block -szip compression parameters * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * April 8 2003 + * April 8 2003 * HISTORY * * SOURCE */ int_f -nh5pset_szip_c ( hid_t_f *prp_id , int_f *options_mask, int_f *pixels_per_block) +h5pset_szip_c ( hid_t_f *prp_id , int_f *options_mask, int_f *pixels_per_block) /******/ { int_f ret_value = -1; @@ -4020,7 +3649,7 @@ nh5pset_szip_c ( hid_t_f *prp_id , int_f *options_mask, int_f *pixels_per_block) c_options_mask = (unsigned)*options_mask; c_pixels_per_block = (unsigned)*pixels_per_block; /* - * Call H5Pset_szip function + * Call H5Pset_szip function */ status = H5Pset_szip(c_prp_id, c_options_mask, c_pixels_per_block); @@ -4030,25 +3659,25 @@ nh5pset_szip_c ( hid_t_f *prp_id , int_f *options_mask, int_f *pixels_per_block) } /****if* H5Pf/h5pall_filters_avail_c * NAME - * h5pall_filters_avail_c + * h5pall_filters_avail_c * PURPOSE - * Call H5Pall_filters_avail + * Call H5Pall_filters_avail * INPUTS - * prp_id - dataset creation property list identifier + * prp_id - dataset creation property list identifier * OUTPUTS - * status - logical flag + * status - logical flag * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * April 10 2003 + * April 10 2003 * HISTORY * * SOURCE */ int_f -nh5pall_filters_avail_c ( hid_t_f *prp_id , int_f *status) +h5pall_filters_avail_c ( hid_t_f *prp_id , int_f *status) /******/ { int_f ret_value = -1; @@ -4058,7 +3687,7 @@ nh5pall_filters_avail_c ( hid_t_f *prp_id , int_f *status) c_prp_id = (hid_t)*prp_id; /* - * Call H5Pall_filters_avail function + * Call H5Pall_filters_avail function */ c_status = H5Pall_filters_avail(c_prp_id); @@ -4071,31 +3700,31 @@ nh5pall_filters_avail_c ( hid_t_f *prp_id , int_f *status) /****if* H5Pf/h5pget_filter_by_id_c * NAME - * h5pget_filter_by_id_c + * h5pget_filter_by_id_c * PURPOSE - * Call H5Pget_filter_by_id2 to get information about a filter - * in a pipeline + * Call H5Pget_filter_by_id2 to get information about a filter + * in a pipeline * INPUTS - * prp_id - property list identifier - * filter_id - filter id - * namelen - Anticipated number of characters in name. + * prp_id - property list identifier + * filter_id - filter id + * namelen - Anticipated number of characters in name. *OUTPUT - * flags - Bit vector specifying certain general - * properties of the filter. - * cd_nelmts - Number of elements in cd_value - * cd_values - Auxiliary data for the filter. - * name - Name of the filter + * flags - Bit vector specifying certain general + * properties of the filter. + * cd_nelmts - Number of elements in cd_value + * cd_values - Auxiliary data for the filter. + * name - Name of the filter * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena POurmal - * April 10, 2003 + * April 10, 2003 * HISTORY * * SOURCE */ int_f -nh5pget_filter_by_id_c(hid_t_f *prp_id, int_f* filter_id, int_f* flags, size_t_f* cd_nelmts, int_f* cd_values, size_t_f *namelen, _fcd name) +h5pget_filter_by_id_c(hid_t_f *prp_id, int_f* filter_id, int_f* flags, size_t_f* cd_nelmts, int_f* cd_values, size_t_f *namelen, _fcd name) /******/ { unsigned int c_flags; @@ -4138,27 +3767,27 @@ DONE: /****if* H5Pf/h5pmodify_filter_c * NAME - * h5pmodify_filter_c + * h5pmodify_filter_c * PURPOSE - * Call H5Pmodify_filter to modify a filter + * Call H5Pmodify_filter to modify a filter * INPUTS - * prp_id - property list identifier - * filter - Filter to be modified - * flags - Bit vector specifying certain general - * properties of the filter. - * cd_nelmts - Number of elements in cd_values. - * cd_values - Auxiliary data for the filter. + * prp_id - property list identifier + * filter - Filter to be modified + * flags - Bit vector specifying certain general + * properties of the filter. + * cd_nelmts - Number of elements in cd_values. + * cd_values - Auxiliary data for the filter. * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * April 10 2003 + * April 10 2003 * HISTORY * * SOURCE */ int_f -nh5pmodify_filter_c (hid_t_f *prp_id, int_f* filter, int_f* flags, size_t_f* cd_nelmts, int_f* cd_values ) +h5pmodify_filter_c (hid_t_f *prp_id, int_f* filter, int_f* flags, size_t_f* cd_nelmts, int_f* cd_values ) /******/ { int_f ret_value = -1; @@ -4190,23 +3819,23 @@ DONE: /****if* H5Pf/h5premove_filter_c * NAME - * h5premove_filter_c + * h5premove_filter_c * PURPOSE - * Call H5Premove_filter to delete one or more filters + * Call H5Premove_filter to delete one or more filters * INPUTS - * prp_id - property list identifier - * filter - Filter to be deleted + * prp_id - property list identifier + * filter - Filter to be deleted * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Quincey Koziol - * January 27 2004 + * January 27 2004 * HISTORY * * SOURCE */ int_f -nh5premove_filter_c (hid_t_f *prp_id, int_f* filter) +h5premove_filter_c (hid_t_f *prp_id, int_f* filter) /******/ { int_f ret_value = -1; @@ -4228,25 +3857,25 @@ DONE: /****if* H5Pf/h5pget_attr_phase_change_c * NAME - * h5pget_attr_phase_change_c + * h5pget_attr_phase_change_c * PURPOSE - * Calls H5Pget_attr_phase_change + * Calls H5Pget_attr_phase_change * * INPUTS - * ocpl_id - Object (dataset or group) creation property list identifier - * Outputs max_compact - Maximum number of attributes to be stored in compact storage - * min_dense - Minimum number of attributes to be stored in dense storage + * ocpl_id - Object (dataset or group) creation property list identifier + * Outputs max_compact - Maximum number of attributes to be stored in compact storage + * min_dense - Minimum number of attributes to be stored in dense storage * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * M. Scot Breitenfeld - * January, 2008 + * January, 2008 * HISTORY * * SOURCE */ int_f -nh5pget_attr_phase_change_c(hid_t_f *ocpl_id, int_f *max_compact, int_f *min_dense ) +h5pget_attr_phase_change_c(hid_t_f *ocpl_id, int_f *max_compact, int_f *min_dense ) /******/ { int ret_value = -1; @@ -4269,24 +3898,24 @@ nh5pget_attr_phase_change_c(hid_t_f *ocpl_id, int_f *max_compact, int_f *min_den /****if* H5Pf/h5pset_attr_creation_order_c * NAME - * h5pset_attr_creation_order_c + * h5pset_attr_creation_order_c * PURPOSE - * Calls H5Ppset_attr_creation_order + * Calls H5Ppset_attr_creation_order * * INPUTS - * ocpl_id - Object (dataset or group) creation property list identifier - * Outputs crt_order_flags - Flags specifying whether to track and index attribute creation order + * ocpl_id - Object (dataset or group) creation property list identifier + * Outputs crt_order_flags - Flags specifying whether to track and index attribute creation order * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * M. Scot Breitenfeld - * January, 2008 + * January, 2008 * HISTORY * * SOURCE */ int_f -nh5pset_attr_creation_order_c(hid_t_f *ocpl_id, int_f *crt_order_flags ) +h5pset_attr_creation_order_c(hid_t_f *ocpl_id, int_f *crt_order_flags ) /******/ { int ret_value = -1; @@ -4306,29 +3935,29 @@ nh5pset_attr_creation_order_c(hid_t_f *ocpl_id, int_f *crt_order_flags ) /****if* H5Pf/h5pset_shared_mesg_nindexes_c * NAME - * h5pset_shared_mesg_nindexes_c + * h5pset_shared_mesg_nindexes_c * PURPOSE - * Calls h5pset_shared_mesg_nindexes + * Calls h5pset_shared_mesg_nindexes * * INPUTS * - * plist_id - file creation property list - * nindexes - Number of shared object header message indexes - * available in files created WITH this property list + * plist_id - file creation property list + * nindexes - Number of shared object header message indexes + * available in files created WITH this property list * * OUTPUTS * * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * M. Scot Breitenfeld - * January, 2008 + * January, 2008 * HISTORY * * SOURCE */ int_f -nh5pset_shared_mesg_nindexes_c(hid_t_f *plist_id, int_f *nindexes ) +h5pset_shared_mesg_nindexes_c(hid_t_f *plist_id, int_f *nindexes ) /******/ { int ret_value = -1; @@ -4349,30 +3978,30 @@ nh5pset_shared_mesg_nindexes_c(hid_t_f *plist_id, int_f *nindexes ) /****if* H5Pf/h5pset_shared_mesg_index_c * NAME - * h5pset_shared_mesg_index_c + * h5pset_shared_mesg_index_c * PURPOSE - * Calls H5Pset_shared_mesg_index + * Calls H5Pset_shared_mesg_index * * INPUTS * - * fcpl_id - File creation property list identifier. - * index_num - Index being configured. - * mesg_type_flags - Types of messages that should be stored in this index. - * min_mesg_size - Minimum message size. + * fcpl_id - File creation property list identifier. + * index_num - Index being configured. + * mesg_type_flags - Types of messages that should be stored in this index. + * min_mesg_size - Minimum message size. * * OUTPUTS * * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * M. Scot Breitenfeld - * January, 2008 + * January, 2008 * HISTORY * * SOURCE */ int_f -nh5pset_shared_mesg_index_c(hid_t_f *fcpl_id, int_f *index_num, int_f *mesg_type_flags, int_f *min_mesg_size) +h5pset_shared_mesg_index_c(hid_t_f *fcpl_id, int_f *index_num, int_f *mesg_type_flags, int_f *min_mesg_size) /******/ { int ret_value = -1; @@ -4389,28 +4018,28 @@ nh5pset_shared_mesg_index_c(hid_t_f *fcpl_id, int_f *index_num, int_f *mesg_type /****if* H5Pf/h5pget_attr_creation_order_c * NAME - * h5pget_attr_creation_order_c + * h5pget_attr_creation_order_c * PURPOSE - * Calls H5Pget_attr_creation_order + * Calls H5Pget_attr_creation_order * * INPUTS * - * ocpl_id - Object (group or dataset) creation property list identifier + * ocpl_id - Object (group or dataset) creation property list identifier * OUTPUTS * - * crt_order_flags - Flags specifying whether to track and index attribute creation order + * crt_order_flags - Flags specifying whether to track and index attribute creation order * * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * M. Scot Breitenfeld - * February, 2008 + * February, 2008 * HISTORY * * SOURCE */ int_f -nh5pget_attr_creation_order_c(hid_t_f *ocpl_id, int_f *crt_order_flags) +h5pget_attr_creation_order_c(hid_t_f *ocpl_id, int_f *crt_order_flags) /******/ { int ret_value = -1; @@ -4431,29 +4060,29 @@ nh5pget_attr_creation_order_c(hid_t_f *ocpl_id, int_f *crt_order_flags) } /****if* H5Pf/h5pset_libver_bounds_c * NAME - * h5pset_libver_bounds_c + * h5pset_libver_bounds_c * PURPOSE - * Calls H5Pset_libver_bounds + * Calls H5Pset_libver_bounds * * INPUTS * - * fapl_id - File access property list identifier - * low - The earliest version of the library that will be used for writing objects. - * high - The latest version of the library that will be used for writing objects. + * fapl_id - File access property list identifier + * low - The earliest version of the library that will be used for writing objects. + * high - The latest version of the library that will be used for writing objects. * OUTPUTS * * * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * M. Scot Breitenfeld - * February 18, 2008 + * February 18, 2008 * HISTORY * * SOURCE */ int_f -nh5pset_libver_bounds_c(hid_t_f *fapl_id, int_f *low, int_f *high ) +h5pset_libver_bounds_c(hid_t_f *fapl_id, int_f *low, int_f *high ) /******/ { int ret_value = -1; @@ -4471,26 +4100,26 @@ nh5pset_libver_bounds_c(hid_t_f *fapl_id, int_f *low, int_f *high ) /****if* H5Pf/h5pset_link_creation_order_c * NAME - * h5pset_link_creation_order_c + * h5pset_link_creation_order_c * PURPOSE - * Calls H5Pset_link_creation_order + * Calls H5Pset_link_creation_order * * INPUTS - * gcpl_id - Group creation property list identifier - * crt_order_flags - Creation order flag(s) + * gcpl_id - Group creation property list identifier + * crt_order_flags - Creation order flag(s) * OUTPUTS * * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * M. Scot Breitenfeld - * February 18, 2008 + * February 18, 2008 * HISTORY * * SOURCE */ int_f -nh5pset_link_creation_order_c(hid_t_f *gcpl_id, int_f *crt_order_flags ) +h5pset_link_creation_order_c(hid_t_f *gcpl_id, int_f *crt_order_flags ) /******/ { int ret_value = -1; @@ -4507,25 +4136,25 @@ nh5pset_link_creation_order_c(hid_t_f *gcpl_id, int_f *crt_order_flags ) /****if* H5Pf/h5pget_link_phase_change_c * NAME - * h5pget_link_phase_change_c + * h5pget_link_phase_change_c * PURPOSE - * Calls H5Pget_link_phase_change + * Calls H5Pget_link_phase_change * * INPUTS - * gcpl_id - Group creation property list identifier - * Outputs max_compact - Maximum number of attributes to be stored in compact storage - * min_dense - Minimum number of attributes to be stored in dense storage + * gcpl_id - Group creation property list identifier + * Outputs max_compact - Maximum number of attributes to be stored in compact storage + * min_dense - Minimum number of attributes to be stored in dense storage * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * M. Scot Breitenfeld - * February 20, 2008 + * February 20, 2008 * HISTORY * * SOURCE */ int_f -nh5pget_link_phase_change_c(hid_t_f *gcpl_id, int_f *max_compact, int_f *min_dense ) +h5pget_link_phase_change_c(hid_t_f *gcpl_id, int_f *max_compact, int_f *min_dense ) /******/ { int ret_value = -1; @@ -4547,27 +4176,27 @@ nh5pget_link_phase_change_c(hid_t_f *gcpl_id, int_f *max_compact, int_f *min_den /****if* H5Pf/h5pget_obj_track_times_c * NAME - * h5pget_obj_track_times_c + * h5pget_obj_track_times_c * PURPOSE - * Call H5Pget_obj_track_times + * Call H5Pget_obj_track_times * * INPUTS - * plist_id - property list id + * plist_id - property list id * OUTPUTS * - * flag - TRUE/FALSE flag + * flag - TRUE/FALSE flag * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * M. Scot Breitenfeld - * February 22, 2008 + * February 22, 2008 * HISTORY * * SOURCE */ int_f -nh5pget_obj_track_times_c(hid_t_f *plist_id, int_f *flag) +h5pget_obj_track_times_c(hid_t_f *plist_id, int_f *flag) /******/ { int ret_value = -1; @@ -4589,25 +4218,25 @@ nh5pget_obj_track_times_c(hid_t_f *plist_id, int_f *flag) /****if* H5Pf/h5pset_obj_track_times_c * NAME - * h5pset_obj_track_times_c + * h5pset_obj_track_times_c * PURPOSE - * Call H5Pset_obj_track_times + * Call H5Pset_obj_track_times * * INPUTS - * plist_id - property list id - * flag - TRUE/FALSE flag + * plist_id - property list id + * flag - TRUE/FALSE flag * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * M. Scot Breitenfeld - * February 22, 2008 + * February 22, 2008 * HISTORY * * SOURCE */ int_f -nh5pset_obj_track_times_c(hid_t_f *plist_id, int_f *flag) +h5pset_obj_track_times_c(hid_t_f *plist_id, int_f *flag) /******/ { int ret_value = -1; @@ -4629,28 +4258,28 @@ nh5pset_obj_track_times_c(hid_t_f *plist_id, int_f *flag) /****if* H5Pf/h5pset_create_inter_group_c * NAME - * h5pset_create_inter_group_c + * h5pset_create_inter_group_c * PURPOSE - * Calls H5Pset_create_intermediate_group + * Calls H5Pset_create_intermediate_group * * INPUTS * * lcpl_id - Link creation property list identifier - * crt_intermed_group - crt_intermed_group specifying whether - * to create intermediate groups upon the - * creation of an object + * crt_intermed_group - crt_intermed_group specifying whether + * to create intermediate groups upon the + * creation of an object * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * M. Scot Breitenfeld - * February 22, 2008 + * February 22, 2008 * HISTORY * * SOURCE */ int_f -nh5pset_create_inter_group_c(hid_t_f *lcpl_id, int_f *crt_intermed_group) +h5pset_create_inter_group_c(hid_t_f *lcpl_id, int_f *crt_intermed_group) /******/ { int ret_value = -1; @@ -4668,28 +4297,28 @@ nh5pset_create_inter_group_c(hid_t_f *lcpl_id, int_f *crt_intermed_group) /****if* H5Pf/h5pget_link_creation_order_c * NAME - * h5pget_link_creation_order_c + * h5pget_link_creation_order_c * PURPOSE - * Calls H5Pget_link_creation_order + * Calls H5Pget_link_creation_order * * INPUTS * - * gcpl_id - Group creation property list identifier + * gcpl_id - Group creation property list identifier * OUTPUTS * - * crt_order_flags - Creation order flag(s) + * crt_order_flags - Creation order flag(s) * * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * M. Scot Breitenfeld - * March 3, 2008 + * March 3, 2008 * HISTORY * * SOURCE */ int_f -nh5pget_link_creation_order_c(hid_t_f *gcpl_id, int_f *crt_order_flags) +h5pget_link_creation_order_c(hid_t_f *gcpl_id, int_f *crt_order_flags) /******/ { int ret_value = -1; @@ -4711,30 +4340,30 @@ nh5pget_link_creation_order_c(hid_t_f *gcpl_id, int_f *crt_order_flags) /****if* H5Pf/h5pset_char_encoding_c * NAME - * h5pset_char_encoding_c + * h5pset_char_encoding_c * PURPOSE * Calls H5Pset_char_encoding * * INPUTS * - * plist_id - Property list identifier - * encoding - String encoding character set: + * plist_id - Property list identifier + * encoding - String encoding character set: * H5T_CSET_ASCII_F -> US ASCII * H5T_CSET_UTF8_F -> UTF-8 Unicode encoding * OUTPUTS * NONE * * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * M. Scot Breitenfeld - * March 3, 2008 + * March 3, 2008 * HISTORY * * SOURCE */ int_f -nh5pset_char_encoding_c(hid_t_f *plist_id, int_f *encoding) +h5pset_char_encoding_c(hid_t_f *plist_id, int_f *encoding) /******/ { int ret_value = -1; @@ -4753,30 +4382,30 @@ nh5pset_char_encoding_c(hid_t_f *plist_id, int_f *encoding) /****if* H5Pf/h5pget_char_encoding_c * NAME - * h5pget_char_encoding_c + * h5pget_char_encoding_c * PURPOSE * Calls H5Pget_char_encoding * * INPUTS * - * plist_id - Property list identifier + * plist_id - Property list identifier * OUTPUTS * - * encoding - Encoding character set: + * encoding - Encoding character set: * H5T_CSET_ASCII_F -> US ASCII * H5T_CSET_UTF8_F -> UTF-8 Unicode encoding * * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * M. Scot Breitenfeld - * March 3, 2008 + * March 3, 2008 * HISTORY * * SOURCE */ int_f -nh5pget_char_encoding_c(hid_t_f *plist_id, int_f *encoding) +h5pget_char_encoding_c(hid_t_f *plist_id, int_f *encoding) /******/ { int ret_value = -1; @@ -4796,30 +4425,30 @@ nh5pget_char_encoding_c(hid_t_f *plist_id, int_f *encoding) /****if* H5Pf/h5pset_copy_object_c * NAME - * h5pset_copy_object_c + * h5pset_copy_object_c * PURPOSE * Calls H5Pset_copy_object * * INPUTS * - * ocp_plist_id - Object copy property list identifier - * copy_options - Copy option(s) to be set + * ocp_plist_id - Object copy property list identifier + * copy_options - Copy option(s) to be set * * OUTPUTS * * NONE * * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * M. Scot Breitenfeld - * March 3, 2008 + * March 3, 2008 * HISTORY * * SOURCE */ int_f -nh5pset_copy_object_c(hid_t_f *ocp_plist_id, int_f *copy_options) +h5pset_copy_object_c(hid_t_f *ocp_plist_id, int_f *copy_options) /******/ { int ret_value = -1; @@ -4836,29 +4465,29 @@ nh5pset_copy_object_c(hid_t_f *ocp_plist_id, int_f *copy_options) /****if* H5Pf/h5pget_copy_object_c * NAME - * h5pget_copy_object_c + * h5pget_copy_object_c * PURPOSE * Calls H5Pget_copy_object * * INPUTS * - * ocp_plist_id - Object copy property list identifier + * ocp_plist_id - Object copy property list identifier * * OUTPUTS * - * copy_options - Copy option(s) to be get + * copy_options - Copy option(s) to be get * * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * M. Scot Breitenfeld - * March 3, 2008 + * March 3, 2008 * HISTORY * * SOURCE */ int_f -nh5pget_copy_object_c(hid_t_f *ocp_plist_id, int_f *copy_options) +h5pget_copy_object_c(hid_t_f *ocp_plist_id, int_f *copy_options) /******/ { int ret_value = -1; @@ -4878,31 +4507,31 @@ nh5pget_copy_object_c(hid_t_f *ocp_plist_id, int_f *copy_options) /****if* H5Pf/h5pget_data_transform_c * NAME - * h5pget_data_transform_c + * h5pget_data_transform_c * PURPOSE - * Calls H5Pget_data_transform + * Calls H5Pget_data_transform * INPUTS * - * prp_id - property list identifier to query - * expression_len - buffer size transorm expression + * prp_id - property list identifier to query + * expression_len - buffer size transorm expression * - * Output: - * expression - buffer to hold transform expression + * Output: + * expression - buffer to hold transform expression * * RETURNS * - * Success: 0 + * Success: 0 * Failure: -1 * * AUTHOR * M. Scot Breitenfeld - * March 19, 2008 + * March 19, 2008 * HISTORY * * SOURCE */ int_f -nh5pget_data_transform_c(hid_t_f *plist_id, _fcd expression, int_f *expression_len, size_t_f *size) +h5pget_data_transform_c(hid_t_f *plist_id, _fcd expression, int_f *expression_len, size_t_f *size) /******/ { char *c_expression = NULL; /* Buffer to hold C string */ @@ -4940,31 +4569,31 @@ done: /****if* H5Pf/h5pset_data_transform_c * NAME - * h5pset_data_transform_c + * h5pset_data_transform_c * PURPOSE - * Calls H5Pset_data_transform + * Calls H5Pset_data_transform * INPUTS * - * prp_id - property list identifier to query - * expression - buffer to hold transform expression - * expression_len - buffer size transorm expression + * prp_id - property list identifier to query + * expression - buffer to hold transform expression + * expression_len - buffer size transorm expression * - * Output: + * Output: * * RETURNS * - * Success: 0 + * Success: 0 * Failure: -1 * * AUTHOR * M. Scot Breitenfeld - * March 19, 2008 + * March 19, 2008 * HISTORY * * SOURCE */ int_f -nh5pset_data_transform_c(hid_t_f *plist_id, _fcd expression, int_f *expression_len) +h5pset_data_transform_c(hid_t_f *plist_id, _fcd expression, int_f *expression_len) /******/ { char* c_expression = NULL; /* Buffer to hold C string */ @@ -4991,29 +4620,29 @@ done: /****if* H5Pf/h5pget_local_heap_size_hint_c * NAME - * h5pget_local_heap_size_hint_c + * h5pget_local_heap_size_hint_c * PURPOSE - * Calls H5Pget_local_heap_size_hint + * Calls H5Pget_local_heap_size_hint * INPUTS * - * gcpl_id - Group creation property list identifier + * gcpl_id - Group creation property list identifier * - * Output: - * size_hint - Hint for size of local heap + * Output: + * size_hint - Hint for size of local heap * RETURNS * - * Success: 0 + * Success: 0 * Failure: -1 * * AUTHOR * M. Scot Breitenfeld - * March 21, 2008 + * March 21, 2008 * HISTORY * * SOURCE */ int_f -nh5pget_local_heap_size_hint_c(hid_t_f *gcpl_id, size_t_f *size_hint) +h5pget_local_heap_size_hint_c(hid_t_f *gcpl_id, size_t_f *size_hint) /******/ { int_f ret_value = -1; /* Return value */ @@ -5032,30 +4661,30 @@ nh5pget_local_heap_size_hint_c(hid_t_f *gcpl_id, size_t_f *size_hint) /****if* H5Pf/h5pget_est_link_info_c * NAME - * h5pget_est_link_info_c + * h5pget_est_link_info_c * PURPOSE - * Calls H5Pget_est_link_info + * Calls H5Pget_est_link_info * INPUTS * - * gcpl_id - Group creation property list identifier + * gcpl_id - Group creation property list identifier * - * Output: - * est_num_entries - Estimated number of links to be inserted into group - * est_name_len - Estimated average length of link names + * Output: + * est_num_entries - Estimated number of links to be inserted into group + * est_name_len - Estimated average length of link names * RETURNS * - * Success: 0 + * Success: 0 * Failure: -1 * * AUTHOR * M. Scot Breitenfeld - * March 21, 2008 + * March 21, 2008 * HISTORY * * SOURCE */ int_f -nh5pget_est_link_info_c(hid_t_f *gcpl_id, int_f *est_num_entries, int_f *est_name_len) +h5pget_est_link_info_c(hid_t_f *gcpl_id, int_f *est_num_entries, int_f *est_name_len) /******/ { int_f ret_value = -1; /* Return value */ @@ -5077,30 +4706,30 @@ nh5pget_est_link_info_c(hid_t_f *gcpl_id, int_f *est_num_entries, int_f *est_nam /****if* H5Pf/h5pset_local_heap_size_hint_c * NAME - * h5pset_local_heap_size_hint_c + * h5pset_local_heap_size_hint_c * PURPOSE - * Calls H5Pset_local_heap_size_hint + * Calls H5Pset_local_heap_size_hint * INPUTS * - * gcpl_id - Group creation property list identifier - * size_hint - Hint for size of local heap + * gcpl_id - Group creation property list identifier + * size_hint - Hint for size of local heap * - * Output: + * Output: * * RETURNS * - * Success: 0 + * Success: 0 * Failure: -1 * * AUTHOR * M. Scot Breitenfeld - * March 21, 2008 + * March 21, 2008 * HISTORY * * SOURCE */ int_f -nh5pset_local_heap_size_hint_c(hid_t_f *gcpl_id, size_t_f *size_hint) +h5pset_local_heap_size_hint_c(hid_t_f *gcpl_id, size_t_f *size_hint) /******/ { int_f ret_value = -1; /* Return value */ @@ -5117,30 +4746,30 @@ nh5pset_local_heap_size_hint_c(hid_t_f *gcpl_id, size_t_f *size_hint) /****if* H5Pf/h5pset_est_link_info_c * NAME - * h5pset_est_link_info_c + * h5pset_est_link_info_c * PURPOSE - * Calls H5Pset_est_link_info + * Calls H5Pset_est_link_info * INPUTS * - * gcpl_id - Group creation property list identifier - * est_num_entries - Estimated number of links to be inserted into group - * est_name_len - Estimated average length of link names + * gcpl_id - Group creation property list identifier + * est_num_entries - Estimated number of links to be inserted into group + * est_name_len - Estimated average length of link names * - * Output: + * Output: * RETURNS * - * Success: 0 + * Success: 0 * Failure: -1 * * AUTHOR * M. Scot Breitenfeld - * March 21, 2008 + * March 21, 2008 * HISTORY * * SOURCE */ int_f -nh5pset_est_link_info_c(hid_t_f *gcpl_id, int_f *est_num_entries, int_f *est_name_len) +h5pset_est_link_info_c(hid_t_f *gcpl_id, int_f *est_num_entries, int_f *est_name_len) /******/ { int_f ret_value = -1; /* Return value */ @@ -5157,26 +4786,26 @@ nh5pset_est_link_info_c(hid_t_f *gcpl_id, int_f *est_num_entries, int_f *est_nam /****if* H5Pf/h5pset_link_phase_change_c * NAME - * h5pset_link_phase_change_c + * h5pset_link_phase_change_c * PURPOSE - * Calls H5Pset_link_phase_change + * Calls H5Pset_link_phase_change * * INPUTS - * gcpl_id - Group creation property list identifier - * max_compact - Maximum number of attributes to be stored in compact storage - * min_dense - Minimum number of attributes to be stored in dense storage - * Outputs + * gcpl_id - Group creation property list identifier + * max_compact - Maximum number of attributes to be stored in compact storage + * min_dense - Minimum number of attributes to be stored in dense storage + * Outputs * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * M. Scot Breitenfeld - * March 21, 2008 + * March 21, 2008 * HISTORY * * SOURCE */ int_f -nh5pset_link_phase_change_c(hid_t_f *gcpl_id, int_f *max_compact, int_f *min_dense ) +h5pset_link_phase_change_c(hid_t_f *gcpl_id, int_f *max_compact, int_f *min_dense ) /******/ { int ret_value = -1; @@ -5194,28 +4823,28 @@ nh5pset_link_phase_change_c(hid_t_f *gcpl_id, int_f *max_compact, int_f *min_den /****if* H5Pf/h5pset_fapl_direct_c * NAME - * h5pset_fapl_direct_c + * h5pset_fapl_direct_c * PURPOSE - * Calls H5Pset_fapl_direct + * Calls H5Pset_fapl_direct * * INPUTS * - * fapl_id - File access property list identifier - * alignment - Required memory alignment boundary - * block_size - File system block size - * cbuf_size - Copy buffer size - * Outputs + * fapl_id - File access property list identifier + * alignment - Required memory alignment boundary + * block_size - File system block size + * cbuf_size - Copy buffer size + * Outputs * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * M. Scot Breitenfeld - * March 21, 2008 + * March 21, 2008 * HISTORY * * SOURCE */ int_f -nh5pset_fapl_direct_c(hid_t_f H5_ATTR_UNUSED *fapl_id, size_t_f H5_ATTR_UNUSED *alignment, size_t_f H5_ATTR_UNUSED *block_size, size_t_f H5_ATTR_UNUSED *cbuf_size) +h5pset_fapl_direct_c(hid_t_f H5_ATTR_UNUSED *fapl_id, size_t_f H5_ATTR_UNUSED *alignment, size_t_f H5_ATTR_UNUSED *block_size, size_t_f H5_ATTR_UNUSED *cbuf_size) /******/ { int ret_value = -1; @@ -5236,29 +4865,29 @@ nh5pset_fapl_direct_c(hid_t_f H5_ATTR_UNUSED *fapl_id, size_t_f H5_ATTR_UNUSED * /****if* H5Pf/h5pget_fapl_direct_c * NAME - * h5pget_fapl_direct_c + * h5pget_fapl_direct_c * PURPOSE - * Calls H5Pget_fapl_direct + * Calls H5Pget_fapl_direct * * INPUTS * - * fapl_id - File access property list identifier + * fapl_id - File access property list identifier * OUTPUTS * - * alignment - Required memory alignment boundary - * block_size - File system block size - * cbuf_size - Copy buffer size + * alignment - Required memory alignment boundary + * block_size - File system block size + * cbuf_size - Copy buffer size * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * M. Scot Breitenfeld - * March 21, 2008 + * March 21, 2008 * HISTORY * * SOURCE */ int_f -nh5pget_fapl_direct_c(hid_t_f H5_ATTR_UNUSED *fapl_id, size_t_f H5_ATTR_UNUSED *alignment, size_t_f H5_ATTR_UNUSED *block_size, size_t_f H5_ATTR_UNUSED *cbuf_size) +h5pget_fapl_direct_c(hid_t_f H5_ATTR_UNUSED *fapl_id, size_t_f H5_ATTR_UNUSED *alignment, size_t_f H5_ATTR_UNUSED *block_size, size_t_f H5_ATTR_UNUSED *cbuf_size) /******/ { int ret_value = -1; @@ -5285,27 +4914,27 @@ nh5pget_fapl_direct_c(hid_t_f H5_ATTR_UNUSED *fapl_id, size_t_f H5_ATTR_UNUSED * /****if* H5Pf/h5pset_attr_phase_change_c * NAME - * h5pset_attr_phase_change_c + * h5pset_attr_phase_change_c * PURPOSE - * Calls H5Pset_attr_phase_change + * Calls H5Pset_attr_phase_change * * INPUTS - * ocpl_id - Object (dataset or group) creation property list identifier - * max_compact - Maximum number of attributes to be stored in compact storage - * min_dense - Minimum number of attributes to be stored in dense storage + * ocpl_id - Object (dataset or group) creation property list identifier + * max_compact - Maximum number of attributes to be stored in compact storage + * min_dense - Minimum number of attributes to be stored in dense storage * OUTPUTS * * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * M. Scot Breitenfeld - * March 21, 2008 + * March 21, 2008 * HISTORY * * SOURCE */ int_f -nh5pset_attr_phase_change_c(hid_t_f *ocpl_id, int_f *max_compact, int_f *min_dense ) +h5pset_attr_phase_change_c(hid_t_f *ocpl_id, int_f *max_compact, int_f *min_dense ) /******/ { int ret_value = -1; @@ -5322,25 +4951,25 @@ nh5pset_attr_phase_change_c(hid_t_f *ocpl_id, int_f *max_compact, int_f *min_den /****if* H5Pf/h5pset_nbit_c * NAME - * h5pset_nbit_c + * h5pset_nbit_c * PURPOSE - * Calls H5Pset_nbit + * Calls H5Pset_nbit * * INPUTS - * plist_id - Dataset creation property list identifier + * plist_id - Dataset creation property list identifier * OUTPUTS * * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * M. Scot Breitenfeld - * March 21, 2008 + * March 21, 2008 * HISTORY * * SOURCE */ int_f -nh5pset_nbit_c(hid_t_f *plist_id ) +h5pset_nbit_c(hid_t_f *plist_id ) /******/ { int ret_value = -1; @@ -5373,7 +5002,7 @@ nh5pset_nbit_c(hid_t_f *plist_id ) * SOURCE */ int_f -nh5pset_scaleoffset_c(hid_t_f *plist_id, int_f *scale_type, int_f *scale_factor ) +h5pset_scaleoffset_c(hid_t_f *plist_id, int_f *scale_type, int_f *scale_factor ) /******/ { int ret_value = -1; @@ -5408,7 +5037,7 @@ nh5pset_scaleoffset_c(hid_t_f *plist_id, int_f *scale_type, int_f *scale_factor * SOURCE */ int_f -nh5pset_nlinks_c(hid_t_f *lapl_id, size_t_f *nlinks) +h5pset_nlinks_c(hid_t_f *lapl_id, size_t_f *nlinks) /******/ { int ret_value = -1; @@ -5425,29 +5054,29 @@ nh5pset_nlinks_c(hid_t_f *lapl_id, size_t_f *nlinks) /****if* H5Pf/h5pget_nlinks * NAME - * h5pget_nlinks + * h5pget_nlinks * PURPOSE - * Calls H5Pget_nlinks + * Calls H5Pget_nlinks * * INPUTS * - * lapl_id - File access property list identifier + * lapl_id - File access property list identifier * * OUTPUTS * - * nlinks - Maximum number of links to traverse + * nlinks - Maximum number of links to traverse * * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * M. Scot Breitenfeld - * March 24, 2008 + * March 24, 2008 * HISTORY * * SOURCE */ int_f -nh5pget_nlinks_c(hid_t_f *lapl_id, size_t_f *nlinks) +h5pget_nlinks_c(hid_t_f *lapl_id, size_t_f *nlinks) /******/ { int ret_value = -1; @@ -5466,26 +5095,26 @@ nh5pget_nlinks_c(hid_t_f *lapl_id, size_t_f *nlinks) /****if* H5Pf/h5pget_create_inter_group_c * NAME - * h5pget_create_inter_group_c + * h5pget_create_inter_group_c * PURPOSE - * Calls H5Pget_create_intermediate_group + * Calls H5Pget_create_intermediate_group * * INPUTS * * lcpl_id - Link creation property list identifier - * crt_intermed_group - Specifying whether to create intermediate groups upon - * the creation of an object + * crt_intermed_group - Specifying whether to create intermediate groups upon + * the creation of an object * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * M. Scot Breitenfeld - * April 4, 2008 + * April 4, 2008 * HISTORY * * SOURCE */ int_f -nh5pget_create_inter_group_c(hid_t_f *lcpl_id, int_f *crt_intermed_group) +h5pget_create_inter_group_c(hid_t_f *lcpl_id, int_f *crt_intermed_group) /******/ { int ret_value = -1; @@ -5505,22 +5134,22 @@ nh5pget_create_inter_group_c(hid_t_f *lcpl_id, int_f *crt_intermed_group) } /*---------------------------------------------------------------------------- - * Name: h5pset_chunk_cache_c - * Purpose: Calls H5Pset_chunk_cache - * - * Inputs: dapl_id - Link creation property list identifier - * rdcc_nslots - - * rdcc_nbytes - - * rdcc_w0 - - * - * Returns: 0 on success, -1 on failure - * Programmer: M. Scot Breitenfeld - * April 13, 2009 - * Modifications: + * Name: h5pset_chunk_cache_c + * Purpose: Calls H5Pset_chunk_cache + * + * Inputs: dapl_id - Link creation property list identifier + * rdcc_nslots - + * rdcc_nbytes - + * rdcc_w0 - + * + * Returns: 0 on success, -1 on failure + * Programmer: M. Scot Breitenfeld + * April 13, 2009 + * Modifications: *---------------------------------------------------------------------------*/ int_f -nh5pset_chunk_cache_c(hid_t_f *dapl_id, size_t_f *rdcc_nslots, size_t_f *rdcc_nbytes, real_f *rdcc_w0) +h5pset_chunk_cache_c(hid_t_f *dapl_id, size_t_f *rdcc_nslots, size_t_f *rdcc_nbytes, real_f *rdcc_w0) { int ret_value = -1; @@ -5535,23 +5164,23 @@ nh5pset_chunk_cache_c(hid_t_f *dapl_id, size_t_f *rdcc_nslots, size_t_f *rdcc_nb } /*---------------------------------------------------------------------------- - * Name: h5pget_chunk_cache_c - * Purpose: Calls H5Pget_chunk_cache - * - * Inputs: dapl_id - Link creation property list identifier - * Outputs: - * rdcc_nslots - - * rdcc_nbytes - - * rdcc_w0 - - * - * Returns: 0 on success, -1 on failure - * Programmer: M. Scot Breitenfeld - * April 13, 2009 - * Modifications: + * Name: h5pget_chunk_cache_c + * Purpose: Calls H5Pget_chunk_cache + * + * Inputs: dapl_id - Link creation property list identifier + * Outputs: + * rdcc_nslots - + * rdcc_nbytes - + * rdcc_w0 - + * + * Returns: 0 on success, -1 on failure + * Programmer: M. Scot Breitenfeld + * April 13, 2009 + * Modifications: *---------------------------------------------------------------------------*/ int_f -nh5pget_chunk_cache_c(hid_t_f *dapl_id, size_t_f *rdcc_nslots, size_t_f *rdcc_nbytes, real_f *rdcc_w0) +h5pget_chunk_cache_c(hid_t_f *dapl_id, size_t_f *rdcc_nslots, size_t_f *rdcc_nbytes, real_f *rdcc_w0) { int ret_value = -1; size_t c_rdcc_nslots; @@ -5572,18 +5201,18 @@ nh5pget_chunk_cache_c(hid_t_f *dapl_id, size_t_f *rdcc_nslots, size_t_f *rdcc_nb } /*---------------------------------------------------------------------------- - * Name: h5pset_file_image_c - * Purpose: Calls H5Pset_file_image + * Name: h5pset_file_image_c + * Purpose: Calls H5Pset_file_image * - * Inputs: + * Inputs: * fapl_id - File access property list identifier * buf_ptr - Pointer to the initial file image, - * or NULL if no initial file image is desired + * or NULL if no initial file image is desired * buf_len - Size of the supplied buffer, or 0 (zero) if no initial image is desired * - * Returns: 0 on success, -1 on failure - * Programmer: M. Scot Breitenfeld - * February 19, 2012 + * Returns: 0 on success, -1 on failure + * Programmer: M. Scot Breitenfeld + * February 19, 2012 *---------------------------------------------------------------------------*/ int_f @@ -5601,19 +5230,19 @@ h5pset_file_image_c(hid_t_f *fapl_id, void *buf_ptr, size_t_f *buf_len) } /*---------------------------------------------------------------------------- - * Name: h5pget_file_image_c - * Purpose: Calls H5Pget_file_image + * Name: h5pget_file_image_c + * Purpose: Calls H5Pget_file_image * - * Inputs: + * Inputs: * fapl_id - File access property list identifier - * Outputs: + * Outputs: * buf_ptr - Pointer to the initial file image, - * or NULL if no initial file image is desired + * or NULL if no initial file image is desired * buf_len - Size of the supplied buffer, or 0 (zero) if no initial image is desired * - * Returns: 0 on success, -1 on failure - * Programmer: M. Scot Breitenfeld - * February 19, 2012 + * Returns: 0 on success, -1 on failure + * Programmer: M. Scot Breitenfeld + * February 19, 2012 *---------------------------------------------------------------------------*/ int_f @@ -5640,3 +5269,225 @@ h5pget_file_image_c(hid_t_f *fapl_id, void **buf_ptr, size_t_f *buf_len_ptr) return ret_value; } + +#ifdef H5_HAVE_PARALLEL +/****if* H5Pf/h5pset_fapl_mpio_c + * NAME + * h5pset_fapl_mpio_c + * PURPOSE + * Call H5Pset_fapl_mpio to set mode for parallel I/O and the user + * supplied communicator and info object + * INPUTS + * prp_id - property list identifier + * comm - MPI communicator + * info - MPI info object + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal + * Thursday, October 26, 2000 + * HISTORY + * + * SOURCE +*/ +int_f +h5pset_fapl_mpio_c(hid_t_f *prp_id, int_f* comm, int_f* info) +/******/ +{ + int ret_value = -1; + hid_t c_prp_id; + herr_t ret; + MPI_Comm c_comm; + MPI_Info c_info; + c_comm = MPI_Comm_f2c(*comm); + c_info = MPI_Info_f2c(*info); + + /* + * Call H5Pset_mpi function. + */ + c_prp_id = *prp_id; + ret = H5Pset_fapl_mpio(c_prp_id, c_comm, c_info); + if (ret < 0) return ret_value; + ret_value = 0; + return ret_value; +} +/****if* H5Pf/h5pget_fapl_mpio_c + * NAME + * h5pget_fapl_mpio_c + * PURPOSE + * Call H5Pget_fapl_mpio to retrieve communicator and info object + * INPUTS + * prp_id - property list identifier + * comm - buffer to return MPI communicator + * info - buffer to return MPI info object + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal + * Thursday, October 26, 2000 + * HISTORY + * + * SOURCE +*/ +int_f +h5pget_fapl_mpio_c(hid_t_f *prp_id, int_f* comm, int_f* info) +/******/ +{ + int ret_value = -1; + hid_t c_prp_id; + herr_t ret; + MPI_Comm c_comm; + MPI_Info c_info; + + /* + * Call H5Pget_mpi function. + */ + c_prp_id = *prp_id; + ret = H5Pget_fapl_mpio(c_prp_id, &c_comm, &c_info); + if (ret < 0) return ret_value; + *comm = (int_f) MPI_Comm_c2f(c_comm); + *info = (int_f) MPI_Info_c2f(c_info); + ret_value = 0; + return ret_value; +} +/****if* H5Pf/h5pset_dxpl_mpio_c + * NAME + * h5pset_dxpl_mpio_c + * PURPOSE + * Call H5Pset_dxpl_mpio to set transfer mode of the dataset + * trasfer property list + * INPUTS + * prp_id - property list identifier + * data_xfer_mode - transfer mode + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal + * Thursday, October 26, 2000 + * HISTORY + * + * SOURCE +*/ +int_f +h5pset_dxpl_mpio_c(hid_t_f *prp_id, int_f* data_xfer_mode) +/******/ +{ + int ret_value = -1; + hid_t c_prp_id; + herr_t ret; + H5FD_mpio_xfer_t c_data_xfer_mode; +/* + switch (*data_xfer_mode) { + + case H5FD_MPIO_INDEPENDENT_F: + c_data_xfer_mode = H5FD_MPIO_INDEPENDENT; + break; + + case H5FD_MPIO_COLLECTIVE_F: + c_data_xfer_mode = H5FD_MPIO_COLLECTIVE; + break; + default: + return ret_value; + } +*/ + c_data_xfer_mode = (H5FD_mpio_xfer_t)*data_xfer_mode; + /* + * Call H5Pset_dxpl_mpio function. + */ + c_prp_id = *prp_id; + ret = H5Pset_dxpl_mpio(c_prp_id, c_data_xfer_mode); + if (ret < 0) return ret_value; + ret_value = 0; + return ret_value; +} + +/****if* H5Pf/h5pget_dxpl_mpio_c + * NAME + * h5pget_dxpl_mpio_c + * PURPOSE + * Call H5Pget_dxpl_mpio to get transfer mode of the dataset + * trasfer property list + * INPUTS + * prp_id - property list identifier + * data_xfer_mode - buffer to retrieve transfer mode + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal + * Thursday, June 15, 2000 + * HISTORY + * + * SOURCE +*/ +int_f +h5pget_dxpl_mpio_c(hid_t_f *prp_id, int_f* data_xfer_mode) +/******/ +{ + int ret_value = -1; + hid_t c_prp_id; + herr_t ret; + H5FD_mpio_xfer_t c_data_xfer_mode; + + /* + * Call H5Pget_xfer function. + */ + c_prp_id = *prp_id; + ret = H5Pget_dxpl_mpio(c_prp_id, &c_data_xfer_mode); + if (ret < 0) return ret_value; + *data_xfer_mode = (int_f)c_data_xfer_mode; +/* + switch (c_data_xfer_mode) { + + case H5FD_MPIO_INDEPENDENT: + *data_xfer_mode = H5FD_MPIO_INDEPENDENT_F; + break; + + case H5FD_MPIO_COLLECTIVE: + *data_xfer_mode = H5FD_MPIO_COLLECTIVE_F; + break; + + default: + return ret_value; + } +*/ + ret_value = 0; + return ret_value; +} + +/****if* H5Pf/h5pget_mpio_actual_io_mode_c + * NAME + * h5pget_mpio_actual_io_mode_c + * PURPOSE + * Calls H5Pget_mpio_actual_io_mode + * + * INPUTS + * dxpl_id - Dataset transfer property list identifier. + * OUTPUTS + * actual_io_mode - The type of I/O performed by this process. + * + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * M. Scot Breitenfeld + * July 27, 2012 + * SOURCE +*/ +int_f +h5pget_mpio_actual_io_mode_c(hid_t_f *dxpl_id, int_f *actual_io_mode) +/******/ +{ + int ret_value = -1; + H5D_mpio_actual_io_mode_t c_actual_io_mode; + + /* + * Call H5Pget_mpio_actual_io_mode_f function. + */ + if( (H5Pget_mpio_actual_io_mode((hid_t)*dxpl_id, &c_actual_io_mode)) <0 ) + return ret_value; /* error occurred */ + + *actual_io_mode =(int_f)c_actual_io_mode; + + ret_value = 0; + return ret_value; +} +#endif /*H5_HAVE_PARALLEL*/ diff --git a/fortran/src/H5Pff.F90 b/fortran/src/H5Pff.F90 new file mode 100644 index 0000000..97f907b --- /dev/null +++ b/fortran/src/H5Pff.F90 @@ -0,0 +1,7327 @@ +!****h* ROBODoc/H5Pff +! +! NAME +! H5P +! +! PURPOSE +! This file contains Fortran interfaces for H5P functions. +! +! COPYRIGHT +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! Copyright by The HDF Group. * +! Copyright by the Board of Trustees of the University of Illinois. *S +! 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. * +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! +! NOTES +! +! _____ __ __ _____ ____ _____ _______ _ _ _______ +! |_ _| \/ | __ \ / __ \| __ \__ __|/\ | \ | |__ __| +! **** | | | \ / | |__) | | | | |__) | | | / \ | \| | | | **** +! **** | | | |\/| | ___/| | | | _ / | | / /\ \ | . ` | | | **** +! **** _| |_| | | | | | |__| | | \ \ | |/ ____ \| |\ | | | **** +! |_____|_| |_|_| \____/|_| \_\ |_/_/ \_\_| \_| |_| +! +! If you add a new H5P function you must add the function name to the +! Windows dll file 'hdf5_fortrandll.def.in' in the fortran/src directory. +! This is needed for Windows based operating systems. +!***** + +#include + +MODULE H5P + + USE, INTRINSIC :: ISO_C_BINDING + USE H5GLOBAL + + INTERFACE h5pset_fapl_multi_f + MODULE PROCEDURE h5pset_fapl_multi_l + MODULE PROCEDURE h5pset_fapl_multi_s + END INTERFACE + + INTERFACE h5pset_fill_value_f + MODULE PROCEDURE h5pset_fill_value_integer + MODULE PROCEDURE h5pset_fill_value_char + ! Recommended procedure: + MODULE PROCEDURE h5pset_fill_value_ptr + + END INTERFACE + + INTERFACE h5pget_fill_value_f + MODULE PROCEDURE h5pget_fill_value_integer + MODULE PROCEDURE h5pget_fill_value_char + ! Recommended procedure: + MODULE PROCEDURE h5pget_fill_value_ptr + + END INTERFACE + + INTERFACE h5pset_f + MODULE PROCEDURE h5pset_integer + MODULE PROCEDURE h5pset_char + ! Recommended procedure: + MODULE PROCEDURE h5pset_ptr + + END INTERFACE + + INTERFACE h5pget_f + MODULE PROCEDURE h5pget_integer + MODULE PROCEDURE h5pget_char + ! Recommended procedure: + MODULE PROCEDURE h5pget_ptr + END INTERFACE + + INTERFACE h5pregister_f + MODULE PROCEDURE h5pregister_integer + ! Recommended procedure: + MODULE PROCEDURE h5pregister_ptr + END INTERFACE + + INTERFACE h5pinsert_f + MODULE PROCEDURE h5pinsert_integer + MODULE PROCEDURE h5pinsert_char + ! Recommended procedure: + MODULE PROCEDURE h5pinsert_ptr + END INTERFACE + + INTERFACE + INTEGER FUNCTION h5pget_fill_value_c(prp_id, type_id, fillvalue) & + BIND(C, NAME='h5pget_fill_value_c') + IMPORT :: c_ptr + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id + INTEGER(HID_T), INTENT(IN) :: type_id + TYPE(C_PTR), VALUE :: fillvalue + END FUNCTION h5pget_fill_value_c + END INTERFACE + + INTERFACE + INTEGER FUNCTION h5pset_fill_value_c(prp_id, type_id, fillvalue) & + BIND(C, NAME='h5pset_fill_value_c') + IMPORT :: c_ptr + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id + INTEGER(HID_T), INTENT(IN) :: type_id + TYPE(C_PTR), VALUE :: fillvalue + END FUNCTION h5pset_fill_value_c + END INTERFACE + + INTERFACE + INTEGER FUNCTION h5pset_c(prp_id, name, name_len, value) & + BIND(C, NAME='h5pset_c') + IMPORT :: c_char, c_ptr + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: name + INTEGER :: name_len + TYPE(C_PTR), VALUE :: value + END FUNCTION h5pset_c + END INTERFACE + + INTERFACE + INTEGER FUNCTION h5pget_c(prp_id, name, name_len, value) & + BIND(C, NAME='h5pget_c') + IMPORT :: c_char, c_ptr + IMPORT :: HID_T + INTEGER(HID_T), INTENT(IN) :: prp_id + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: name + INTEGER :: name_len + TYPE(C_PTR), VALUE :: value + END FUNCTION h5pget_c + END INTERFACE + + INTERFACE + INTEGER FUNCTION h5pregister_c(class, name, name_len, size, value) & + BIND(C, NAME='h5pregister_c') + IMPORT :: c_char, c_ptr + IMPORT :: HID_T, SIZE_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: class + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: name + INTEGER, INTENT(IN) :: name_len + INTEGER(SIZE_T), INTENT(IN) :: size + TYPE(C_PTR), INTENT(IN), VALUE :: value + END FUNCTION h5pregister_c + END INTERFACE + + INTERFACE + INTEGER FUNCTION h5pinsert_c(plist, name, name_len, size, value) & + BIND(C, NAME='h5pinsert_c') + IMPORT :: c_char, c_ptr + IMPORT :: HID_T, SIZE_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: plist + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: name + INTEGER, INTENT(IN) :: name_len + INTEGER(SIZE_T), INTENT(IN) :: size + TYPE(C_PTR), INTENT(IN), VALUE :: value + END FUNCTION h5pinsert_c + END INTERFACE + +CONTAINS + +!****s* H5P/h5pcreate_f +! NAME +! h5pcreate_f +! +! PURPOSE +! Creates a new property as an instance of a property +! list class. +! +! INPUTS +! class - type of the property class to be created. +! Possible values are: +! H5P_OBJECT_CREATE_F +! H5P_FILE_CREATE_F +! H5P_FILE_ACCESS_F +! H5P_DATASET_CREATE_F +! H5P_DATASET_ACCESS_F +! H5P_DATASET_XFER_F +! H5P_FILE_MOUNT_F +! H5P_GROUP_CREATE_F +! H5P_GROUP_ACCESS_F +! H5P_DATATYPE_CREATE_F +! H5P_DATATYPE_ACCESS_F +! H5P_STRING_CREATE_F +! H5P_ATTRIBUTE_CREATE _F +! H5P_OBJECT_COPY_F +! H5P_LINK_CREATE_F +! H5P_LINK_ACCESS_F +! +! OUTPUTS +! prp_id - property list identifier +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 14, 2001 +! +! Fortran90 Interface: + SUBROUTINE h5pcreate_f(class, prp_id, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: class + INTEGER(HID_T), INTENT(OUT) :: prp_id + INTEGER , INTENT(OUT) :: hdferr +!***** + INTERFACE + INTEGER FUNCTION h5pcreate_c(class, prp_id) & + BIND(C,NAME='h5pcreate_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: class + INTEGER(HID_T), INTENT(OUT) :: prp_id + END FUNCTION h5pcreate_c + END INTERFACE + + hdferr = h5pcreate_c(class, prp_id) + END SUBROUTINE h5pcreate_f + +!****s* H5P/h5pset_preserve_f +! NAME +! h5pset_preserve_f +! +! PURPOSE +! Sets the dataset transfer property list status to +! TRUE or FALSE for initializing compound datatype +! members during write/read operations. +! +! INPUTS +! prp_id - property list identifier +! flag - status flag +! +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails +! +! OPTIONAL PARAMETERS +! NONE +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 14, 2001 +! +! Datatype of the flag parameter is changed from +! INTEGER to LOGICAL June 4, 2003 +! +! Fortran90 Interface: + SUBROUTINE h5pset_preserve_f(prp_id, flag, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + LOGICAL, INTENT(IN) :: flag ! TRUE/FALSE flag to set the dataset + ! transfer property for partila writing/reading + ! compound datatype + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + INTEGER :: flag_c + + INTERFACE + INTEGER FUNCTION h5pset_preserve_c(prp_id, flag_c) & + BIND(C,NAME='h5pset_preserve_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id + INTEGER :: flag_c + END FUNCTION h5pset_preserve_c + END INTERFACE + flag_c = 0 + IF(flag) flag_c = 1 + hdferr = h5pset_preserve_c(prp_id, flag_c) + END SUBROUTINE h5pset_preserve_f + +!****s* H5P/h5pget_preserve_f +! NAME +! h5pget_preserve_f +! +! PURPOSE +! Checks status of the dataset transfer property list. +! +! INPUTS +! prp_id - property list identifier +! +! OUTPUTS +! flag - status flag +! hdferr - error code +! Success: 0 +! Failure: -1 +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 14, 2001 +! +! Datatype of the flag parameter is changed from +! INTEGER to LOGICAL +! June 4, 2003 +! +! Fortran90 Interface: + SUBROUTINE h5pget_preserve_f(prp_id, flag, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + LOGICAL, INTENT(OUT) :: flag ! TRUE/FALSE flag. Shows status of the dataset's + ! transfer property for partial writing/reading + ! compound datatype + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + INTEGER :: flag_c + + INTERFACE + INTEGER FUNCTION h5pget_preserve_c(prp_id, flag_c) & + BIND(C,NAME='h5pget_preserve_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id + INTEGER :: flag_c + END FUNCTION h5pget_preserve_c + END INTERFACE + + hdferr = h5pget_preserve_c(prp_id, flag_c) + flag = .FALSE. + IF(flag_c .EQ. 1) flag = .TRUE. + END SUBROUTINE h5pget_preserve_f + +!****s* H5P/h5pget_class_f +! NAME +! h5pget_class_f +! +! PURPOSE +! Returns the property list class for a property list. +! +! INPUTS +! prp_id - property list identifier +! +! OUTPUTS +! classtype - property list class +! hdferr: - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 14, 2001 +! +! Fortran90 Interface: + SUBROUTINE h5pget_class_f(prp_id, classtype, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER(HID_T), INTENT(OUT) :: classtype ! The type of the property list + ! to be created. + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + + INTERFACE + INTEGER FUNCTION h5pget_class_c(prp_id, classtype) & + BIND(C,NAME='h5pget_class_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id + INTEGER(HID_T), INTENT(OUT) :: classtype + END FUNCTION h5pget_class_c + END INTERFACE + + hdferr = h5pget_class_c(prp_id, classtype) + END SUBROUTINE h5pget_class_f + +!****s* H5P/h5pcopy_f +! NAME +! h5pcopy_f +! +! PURPOSE +! Copies an existing property list to create a new +! property list +! +! INPUTS +! prp_id - property list identifier +! OUTPUTS +! new_prp_id - new property list identifier +! hdferr: - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 14, 2001 +! +! Fortran90 Interface: + SUBROUTINE h5pcopy_f(prp_id, new_prp_id, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER(HID_T), INTENT(OUT) :: new_prp_id ! Identifier of property list + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + + INTERFACE + INTEGER FUNCTION h5pcopy_c(prp_id, new_prp_id) & + BIND(C,NAME='h5pcopy_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id + INTEGER(HID_T), INTENT(OUT) :: new_prp_id + END FUNCTION h5pcopy_c + END INTERFACE + + hdferr = h5pcopy_c(prp_id, new_prp_id) + END SUBROUTINE h5pcopy_f + +!****s* H5P/h5pclose_f +! NAME +! h5pclose_f +! +! PURPOSE +! Terminates access to a property list. +! +! INPUTS +! prp_id - identifier of the property list to +! terminate access to. +! OUTPUTS +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 14, 2001 +! +! Fortran90 Interface: + SUBROUTINE h5pclose_f(prp_id, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + INTERFACE + INTEGER FUNCTION h5pclose_c(prp_id) & + BIND(C,NAME='h5pclose_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id + END FUNCTION h5pclose_c + END INTERFACE + + hdferr = h5pclose_c(prp_id) + END SUBROUTINE h5pclose_f + +!****s* H5P/h5pset_chunk_f +! NAME +! h5pset_chunk_f +! +! PURPOSE +! Sets the size of the chunks used to store +! a chunked layout dataset. +! +! INPUTS +! prp_id - datatset creation property list identifier +! ndims - number of dimensions for each chunk +! dims - array with dimension sizes for each chunk +! OUTPUTS +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 14, 2001 +! +! Fortran90 Interface: + SUBROUTINE h5pset_chunk_f(prp_id, ndims, dims, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER, INTENT(IN) :: ndims ! Number of chunk dimensions + INTEGER(HSIZE_T), DIMENSION(ndims), INTENT(IN) :: dims + ! Array containing sizes of + ! chunk dimensions + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + INTERFACE + INTEGER FUNCTION h5pset_chunk_c(prp_id, ndims, dims) & + BIND(C,NAME='h5pset_chunk_c') + IMPORT :: HID_T, HSIZE_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id + INTEGER, INTENT(IN) :: ndims + INTEGER(HSIZE_T), DIMENSION(ndims), INTENT(IN) :: dims + END FUNCTION h5pset_chunk_c + END INTERFACE + + hdferr = h5pset_chunk_c(prp_id, ndims, dims) + END SUBROUTINE h5pset_chunk_f + +!****s* H5P/h5pget_chunk_f +! NAME +! h5pget_chunk_f +! +! PURPOSE +! Retrieves the size of chunks for the raw data of a +! chunked layout dataset +! +! INPUTS +! prp_id - property list identifier +! ndims - size of dims array +! OUTPUTS +! dims - array with dimension sizes for each chunk +! hdferr - error code +! Success: number of chunk dimensions +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 14, 2001 +! +! Fortran90 Interface: + SUBROUTINE h5pget_chunk_f(prp_id, ndims, dims, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER, INTENT(IN) :: ndims ! Number of chunk dimensions to + ! to return + INTEGER(HSIZE_T), DIMENSION(ndims), INTENT(OUT) :: dims + ! Array containing sizes of + ! chunk dimensions + INTEGER, INTENT(OUT) :: hdferr ! Error code: + ! number of chunk dimensions on success, + ! -1 on failure +!***** + + INTERFACE + INTEGER FUNCTION h5pget_chunk_c(prp_id, ndims, dims) & + BIND(C,NAME='h5pget_chunk_c') + IMPORT :: HID_T, HSIZE_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id + INTEGER :: ndims + INTEGER(HSIZE_T), DIMENSION(*), INTENT(OUT) :: dims + END FUNCTION h5pget_chunk_c + END INTERFACE + + hdferr = h5pget_chunk_c(prp_id, ndims, dims) + END SUBROUTINE h5pget_chunk_f + +!****s* H5P/h5pset_deflate_f +! NAME +! h5pset_deflate_f +! +! PURPOSE +! Sets compression method and compression level. +! +! INPUTS +! prp_id - property list identifier +! level - compression level +! OUTPUTS +! +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 14, 2001 +! +! Fortran90 Interface: + SUBROUTINE h5pset_deflate_f(prp_id, level, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER, INTENT(IN) :: level ! Compression level + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + +! INTEGER, EXTERNAL :: h5pset_deflate_c +! MS FORTRAN needs explicit interface for C functions called here. +! + INTERFACE + INTEGER FUNCTION h5pset_deflate_c(prp_id, level) & + BIND(C,NAME='h5pset_deflate_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id + INTEGER, INTENT(IN) :: level + END FUNCTION h5pset_deflate_c + END INTERFACE + hdferr = h5pset_deflate_c(prp_id, level) + + END SUBROUTINE h5pset_deflate_f + +!****s* H5P/h5pget_version_f +! NAME +! h5pget_version_f +! +! PURPOSE +! Retrieves the version information of various objects +! for a file creation property list +! +! INPUTS +! prp_id - file createion property list identifier +! OUTPUTS +! boot - super block version number +! freelist - global freelist version number +! stab - symbol table version number +! shhdr - shared object header version number +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 14, 2001 +! +! Fortran90 Interface: + SUBROUTINE h5pget_version_f(prp_id, boot, freelist, & + stab, shhdr, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER, DIMENSION(:), INTENT(OUT) :: boot ! Array to put boot + ! block version number + INTEGER, DIMENSION(:), INTENT(OUT) :: freelist ! Array to put global + ! Freelist version number + + INTEGER, DIMENSION(:), INTENT(OUT) :: stab ! Array to put symbol + ! table version number + INTEGER, DIMENSION(:), INTENT(OUT) :: shhdr ! Array to put shared + ! object header version number + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + + INTERFACE + INTEGER FUNCTION h5pget_version_c(prp_id, boot, freelist, stab, shhdr) & + BIND(C,NAME='h5pget_version_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id + INTEGER, DIMENSION(*), INTENT(OUT) :: boot + INTEGER, DIMENSION(*), INTENT(OUT) :: freelist + INTEGER, DIMENSION(*), INTENT(OUT) :: stab + INTEGER, DIMENSION(*), INTENT(OUT) :: shhdr + END FUNCTION h5pget_version_c + END INTERFACE + + hdferr = h5pget_version_c(prp_id, boot, freelist, stab, shhdr) + END SUBROUTINE h5pget_version_f + +!****s* H5P/h5pset_userblock_f +! NAME +! h5pset_userblock_f +! +! PURPOSE +! Sets user block size +! +! INPUTS +! prp_id - file creation property list to modify +! size - size of the user-block in bytes +! +! OUTPUTS +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 14, 2001 +! +! Fortran90 Interface: + SUBROUTINE h5pset_userblock_f (prp_id, size, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER(HSIZE_T), INTENT(IN) :: size ! Size of the user-block in bytes + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + INTERFACE + INTEGER FUNCTION h5pset_userblock_c(prp_id, size) & + BIND(C,NAME='h5pset_userblock_c') + IMPORT :: HID_T, HSIZE_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id + INTEGER(HSIZE_T), INTENT(IN) :: size + END FUNCTION h5pset_userblock_c + END INTERFACE + + hdferr = h5pset_userblock_c(prp_id, size) + END SUBROUTINE h5pset_userblock_f + +!****s* H5P/h5pget_userblock_f +! NAME +! h5pget_userblock_f +! +! PURPOSE +! Gets user block size. +! +! INPUTS +! +! prp_id - file creation property list identifier +! OUTPUTS +! +! block_size - size of the user block in bytes +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 14, 2001 +! +! Fortran90 Interface: + SUBROUTINE h5pget_userblock_f(prp_id, block_size, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER(HSIZE_T), INTENT(OUT) :: block_size ! Size of the + ! user-block in bytes + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + INTERFACE + INTEGER FUNCTION h5pget_userblock_c(prp_id, block_size) & + BIND(C,NAME='h5pget_userblock_c') + IMPORT :: HID_T, HSIZE_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id + INTEGER(HSIZE_T), INTENT(OUT) :: block_size + END FUNCTION h5pget_userblock_c + END INTERFACE + hdferr = h5pget_userblock_c(prp_id, block_size) + END SUBROUTINE h5pget_userblock_f + +!****s* H5P/h5pset_sizes_f +! NAME +! h5pset_sizes_f +! +! PURPOSE +! Sets the byte size of the offsets and lengths used +! to address objects in an HDF5 file. +! +! INPUTS +! prp_id - file creation property list identifier +! sizeof_addr - size of an object offset in bytes +! sizeof_size - size of an object length in bytes +! OUTPUTS +! +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 14, 2001 +! +! Fortran90 Interface: + SUBROUTINE h5pset_sizes_f (prp_id, sizeof_addr, sizeof_size, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER(SIZE_T), INTENT(IN) :: sizeof_addr ! Size of an object + ! offset in bytes + INTEGER(SIZE_T), INTENT(IN) :: sizeof_size ! Size of an object + ! length in bytes + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + INTERFACE + INTEGER FUNCTION h5pset_sizes_c(prp_id, sizeof_addr, sizeof_size) & + BIND(C,NAME='h5pset_sizes_c') + IMPORT :: HID_T, SIZE_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id + INTEGER(SIZE_T), INTENT(IN) :: sizeof_addr + INTEGER(SIZE_T), INTENT(IN) :: sizeof_size + END FUNCTION h5pset_sizes_c + END INTERFACE + + hdferr = h5pset_sizes_c(prp_id, sizeof_addr, sizeof_size) + END SUBROUTINE h5pset_sizes_f + +!****s* H5P/h5pget_sizes_f +! NAME +! h5pget_sizes_f +! +! PURPOSE +! Retrieves the size of the offsets and lengths used +! in an HDF5 file +! +! INPUTS +! prp_id - file creation property list identifier +! OUTPUTS +! +! sizeof_addr - size of an object offset in bytes +! sizeof_size - size of an object length in bytes +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 14, 2001 +! +! Fortran90 Interface: + SUBROUTINE h5pget_sizes_f(prp_id, sizeof_addr, sizeof_size, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER(SIZE_T), INTENT(OUT) :: sizeof_addr ! Size of an object + ! offset in bytes + INTEGER(SIZE_T), INTENT(OUT) :: sizeof_size ! Size of an object + ! length in bytes + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + INTERFACE + INTEGER FUNCTION h5pget_sizes_c(prp_id, sizeof_addr, sizeof_size) & + BIND(C,NAME='h5pget_sizes_c') + IMPORT :: HID_T, SIZE_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id + INTEGER(SIZE_T), INTENT(OUT) :: sizeof_addr + INTEGER(SIZE_T), INTENT(OUT) :: sizeof_size + END FUNCTION h5pget_sizes_c + END INTERFACE + + hdferr = h5pget_sizes_c(prp_id, sizeof_addr, sizeof_size) + END SUBROUTINE h5pget_sizes_f + +!****s* H5P/h5pset_sym_k_f +! NAME +! h5pset_sym_k_f +! +! PURPOSE +! Sets the size of parameters used to control the +!symbol table nodes +! +! INPUTS +! +! prp_id - file creation property list identifier +! ik - symbol table tree rank +! lk - symbol table node size +! OUTPUTS +! +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 14, 2001 +! +! Fortran90 Interface: + SUBROUTINE h5pset_sym_k_f (prp_id, ik, lk, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER, INTENT(IN) :: ik ! Symbol table tree rank + INTEGER, INTENT(IN) :: lk ! Symbol table node size + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + INTERFACE + INTEGER FUNCTION h5pset_sym_k_c(prp_id, ik, lk) & + BIND(C,NAME='h5pset_sym_k_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id + INTEGER, INTENT(IN) :: ik + INTEGER, INTENT(IN) :: lk + END FUNCTION h5pset_sym_k_c + END INTERFACE + + hdferr = h5pset_sym_k_c(prp_id, ik, lk) + END SUBROUTINE h5pset_sym_k_f +!****s* H5P/h5pget_sym_k_f +! NAME +! h5pget_sym_k_f +! +! PURPOSE +! Retrieves the size of the symbol table B-tree 1/2 rank +! and the symbol table leaf node 1/2 size. +! +! INPUTS +! +! prp_id - file creation property list identifier +! OUTPUTS +! +! ik - symbol table tree 1/2 rank +! lk - symbol table node 1/2 size +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 14, 2001 +! +! Fortran90 Interface: + SUBROUTINE h5pget_sym_k_f(prp_id, ik, lk, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER, INTENT(OUT) :: ik ! Symbol table tree rank + INTEGER, INTENT(OUT) :: lk ! Symbol table node size + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + INTERFACE + INTEGER FUNCTION h5pget_sym_k_c(prp_id, ik, lk) & + BIND(C,NAME='h5pget_sym_k_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id + INTEGER, INTENT(OUT) :: ik + INTEGER, INTENT(OUT) :: lk + END FUNCTION h5pget_sym_k_c + END INTERFACE + + hdferr = h5pget_sym_k_c(prp_id, ik, lk) + END SUBROUTINE h5pget_sym_k_f +!****s* H5P/h5pset_istore_k_f +! NAME +! h5pset_istore_k_f +! +! PURPOSE +! Sets the size of the parameter used to control the +! B-trees for indexing chunked datasets +! +! INPUTS +! +! prp_id - file creation property list identifier +! ik - 1/2 rank of chunked storage B-tree +! OUTPUTS +! +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 14, 2001 +! +! Fortran90 Interface: + SUBROUTINE h5pset_istore_k_f (prp_id, ik, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER, INTENT(IN) :: ik ! 1/2 rank of chunked storage B-tree + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + INTERFACE + INTEGER FUNCTION h5pset_istore_k_c(prp_id, ik) & + BIND(C,NAME='h5pset_istore_k_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id + INTEGER, INTENT(IN) :: ik + END FUNCTION h5pset_istore_k_c + END INTERFACE + + hdferr = h5pset_istore_k_c(prp_id, ik) + END SUBROUTINE h5pset_istore_k_f + +!****s* H5P/h5pget_istore_k_f +! NAME +! h5pget_istore_k_f +! +! PURPOSE +! Queries the 1/2 rank of an indexed storage B-tree. +! +! INPUTS +! +! prp_id - file creation property list identifier +! OUTPUTS +! +! ik - 1/2 rank of chunked storage B-tree +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 14, 2001 +! +! Fortran90 Interface: + SUBROUTINE h5pget_istore_k_f(prp_id, ik, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER, INTENT(OUT) :: ik ! 1/2 rank of chunked storage B-tree + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + INTERFACE + INTEGER FUNCTION h5pget_istore_k_c(prp_id, ik) & + BIND(C,NAME='h5pget_istore_k_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id + INTEGER, INTENT(OUT) :: ik + END FUNCTION h5pget_istore_k_c + END INTERFACE + + hdferr = h5pget_istore_k_c(prp_id, ik) + END SUBROUTINE h5pget_istore_k_f + +!****s* H5P/h5pget_driver_f +! NAME +! h5pget_driver_f +! +! PURPOSE +! Returns low-lever driver identifier. +! +! INPUTS +! +! prp_id - file access or data transfer property +! list identifier. +! OUTPUTS +! +! driver - low-level driver identifier +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 14, 2001 +! +! Fortran90 Interface: + SUBROUTINE h5pget_driver_f(prp_id, driver, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER(HID_T), INTENT(OUT) :: driver ! Low-level file driver identifier + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + INTERFACE + INTEGER FUNCTION h5pget_driver_c(prp_id, driver) & + BIND(C,NAME='h5pget_driver_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id + INTEGER(HID_T), INTENT(OUT) :: driver + END FUNCTION h5pget_driver_c + END INTERFACE + + hdferr = h5pget_driver_c(prp_id, driver) + END SUBROUTINE h5pget_driver_f + +!****s* H5P/h5pset_fapl_stdio_f +! NAME +! h5pset_fapl_stdio_f +! +! PURPOSE +! Sets the standard I/O driver. +! +! INPUTS +! +! prp_id - file access property list identifier +! OUTPUTS +! +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 14, 2001 +! +! Fortran90 Interface: + SUBROUTINE h5pset_fapl_stdio_f (prp_id, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + INTERFACE + INTEGER FUNCTION h5pset_fapl_stdio_c(prp_id) & + BIND(C,NAME='h5pset_fapl_stdio_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id + END FUNCTION h5pset_fapl_stdio_c + END INTERFACE + + hdferr = h5pset_fapl_stdio_c(prp_id) + END SUBROUTINE h5pset_fapl_stdio_f + +!****s* H5P/h5pget_stdio_f +! NAME +! h5pget_stdio_f +! +! PURPOSE +! NOT AVAILABLE +! +! INPUTS +! +! OUTPUTS +! +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 14, 2001 +! +! SOURCE +! SUBROUTINE h5pget_stdio_f (prp_id, io, hdferr) +! +! IMPLICIT NONE +! INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier +! INTEGER, INTENT(OUT) :: io ! value indicates that the file + !access property list is set to + !the stdio driver +! INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** +! INTEGER, EXTERNAL :: h5pget_stdio_c +! hdferr = h5pget_stdio_c(prp_id, io) +! END SUBROUTINE h5pget_stdio_f + +!****s* H5P/h5pset_fapl_sec2_f +! NAME +! h5pset_fapl_sec2_f +! +! PURPOSE +! Sets the sec2 driver. +! +! INPUTS +! +! prp_id - file access property list identifier +! OUTPUTS +! +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 14, 2001 +! +! Fortran90 Interface: + SUBROUTINE h5pset_fapl_sec2_f (prp_id, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + INTERFACE + INTEGER FUNCTION h5pset_fapl_sec2_c(prp_id) & + BIND(C,NAME='h5pset_fapl_sec2_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + END FUNCTION h5pset_fapl_sec2_c + END INTERFACE + + hdferr = h5pset_fapl_sec2_c(prp_id) + END SUBROUTINE h5pset_fapl_sec2_f + +!****s* H5P/h5pget_sec2_f +! NAME +! h5pget_sec2_f +! +! PURPOSE +! NOT AVAILABLE +! +! INPUTS +! +! OUTPUTS +! +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 14, 2001 +! +! SOURCE! SUBROUTINE h5pget_sec2_f (prp_id, sec2, hdferr) +! IMPLICIT NONE +! INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier +! INTEGER, INTENT(OUT) :: sec2 ! value indicates whether the file + !driver uses the functions declared + !in the unistd.h file +! INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** +! INTEGER, EXTERNAL :: h5pget_sec2_c +! hdferr = h5pget_sec2_c(prp_id, sec2) +! END SUBROUTINE h5pget_sec2_f + +!****s* H5P/h5pset_alignment_f +! NAME +! h5pset_alignment_f +! +! PURPOSE +! Sets alignment properties of a file access property list. +! +! INPUTS +! +! prp_id - file access property list identifier +! threshold - threshold value +! alignment - alignment value +! OUTPUTS +! +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 14, 2001 +! +! Fortran90 Interface: + SUBROUTINE h5pset_alignment_f(prp_id, threshold, alignment, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER(HSIZE_T), INTENT(IN) :: threshold ! Threshold value + INTEGER(HSIZE_T), INTENT(IN) :: alignment ! alignment value + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + INTERFACE + INTEGER FUNCTION h5pset_alignment_c(prp_id, threshold, alignment) & + BIND(C,NAME='h5pset_alignment_c') + IMPORT :: HID_T, HSIZE_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id + INTEGER(HSIZE_T), INTENT(IN) :: threshold + INTEGER(HSIZE_T), INTENT(IN) :: alignment + END FUNCTION h5pset_alignment_c + END INTERFACE + + hdferr = h5pset_alignment_c(prp_id, threshold, alignment) + END SUBROUTINE h5pset_alignment_f + +!****s* H5P/h5pget_alignment_f +! NAME +! h5pget_alignment_f +! +! PURPOSE +! Retrieves the current settings for alignment +! properties from a file access property list. +! +! INPUTS +! prp_id - file access property list identifier +! +! OUTPUTS +! threshold - threshold value +! alignment - alignment value +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 14, 2001 +! +! Fortran90 Interface: + SUBROUTINE h5pget_alignment_f(prp_id, threshold, alignment, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER(HSIZE_T), INTENT(OUT) :: threshold ! Threshold value + INTEGER(HSIZE_T), INTENT(OUT) :: alignment ! alignment value + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + INTERFACE + INTEGER FUNCTION h5pget_alignment_c(prp_id, threshold, alignment) & + BIND(C,NAME='h5pget_alignment_c') + IMPORT :: HID_T, HSIZE_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id + INTEGER(HSIZE_T), INTENT(OUT) :: threshold + INTEGER(HSIZE_T), INTENT(OUT) :: alignment + END FUNCTION h5pget_alignment_c + END INTERFACE + + hdferr = h5pget_alignment_c(prp_id, threshold, alignment) + END SUBROUTINE h5pget_alignment_f + +!****s* H5P/h5pset_fapl_core_f +! NAME +! h5pset_fapl_core_f +! +! PURPOSE +! Modifies the file access property list to use the +! H5FD_CORE driver. +! +! INPUTS +! prp_id - file access property list identifier +! increment - size, in bytes, of memory increments +! backing_store - boolean flag indicating whether to write +! the file contents to disk when the file is closed. +! OUTPUTS +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 14, 2001 +! +! Fortran90 Interface: + SUBROUTINE h5pset_fapl_core_f(prp_id, increment, backing_store, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER(SIZE_T), INTENT(IN) :: increment ! File block size in bytes. + LOGICAL, INTENT(IN) :: backing_store ! Flag to indicate that + ! entire file contents are flushed to a file + ! with the same name as this core file. + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + INTEGER :: backing_store_flag + INTERFACE + INTEGER FUNCTION h5pset_fapl_core_c(prp_id, increment, backing_store_flag) & + BIND(C,NAME='h5pset_fapl_core_c') + IMPORT :: HID_T, SIZE_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id + INTEGER(SIZE_T), INTENT(IN) :: increment + INTEGER :: backing_store_flag + END FUNCTION h5pset_fapl_core_c + END INTERFACE + backing_store_flag = 0 + IF(backing_store) backing_store_flag = 1 + hdferr = h5pset_fapl_core_c(prp_id, increment, backing_store_flag) + END SUBROUTINE h5pset_fapl_core_f + +!****s* H5P/h5pget_fapl_core_f +! NAME +! h5pget_fapl_core_f +! +! PURPOSE +! Queries core file driver properties. +! +! INPUTS +! prp_id - file access property list identifier +! OUTPUTS +! +! increment - size, in bytes, of memory increments +! backing_store - boolean flag indicating whether to write +! the file contents to disk when the file is closed. +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 14, 2001 +! +! Fortran90 Interface: + SUBROUTINE h5pget_fapl_core_f(prp_id, increment, backing_store, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER(SIZE_T), INTENT(OUT) :: increment ! File block size in bytes. + LOGICAL, INTENT(OUT) :: backing_store ! Flag to indicate that + ! entire file contents are flushed to a file + ! with the same name as this core file. + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + INTEGER :: backing_store_flag + + INTERFACE + INTEGER FUNCTION h5pget_fapl_core_c(prp_id, increment, backing_store_flag) & + BIND(C,NAME='h5pget_fapl_core_c') + IMPORT :: HID_T,SIZE_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id + INTEGER(SIZE_T), INTENT(OUT) :: increment + INTEGER :: backing_store_flag + END FUNCTION h5pget_fapl_core_c + END INTERFACE + + hdferr = h5pget_fapl_core_c(prp_id, increment, backing_store_flag) + backing_store =.FALSE. + IF (backing_store_flag .EQ. 1) backing_store =.TRUE. + END SUBROUTINE h5pget_fapl_core_f + +!****s* H5P/ h5pset_fapl_family_f +! NAME +! h5pset_fapl_family_f +! +! PURPOSE +! Sets the file access property list to use the family driver. +! +! INPUTS +! prp_id - file access property list identifier +! memb_size - size in bytes of each file member +! memb_plist - identifier of the file access property +! list to be used for each family member +! OUTPUTS +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 14, 2001 +! +! Fortran90 Interface: + SUBROUTINE h5pset_fapl_family_f(prp_id, memb_size, memb_plist , hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER(HSIZE_T), INTENT(IN) :: memb_size ! Logical size, in bytes, + ! of each family member + INTEGER(HID_T), INTENT(IN) :: memb_plist ! Identifier of the file + ! access property list for + ! each member of the family + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + INTERFACE + INTEGER FUNCTION h5pset_fapl_family_c(prp_id, memb_size, memb_plist) & + BIND(C,NAME='h5pset_fapl_family_c') + IMPORT :: HID_T,HSIZE_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id + INTEGER(HSIZE_T), INTENT(IN) :: memb_size + INTEGER(HID_T), INTENT(IN) :: memb_plist + END FUNCTION h5pset_fapl_family_c + END INTERFACE + + hdferr = h5pset_fapl_family_c(prp_id, memb_size, memb_plist) + END SUBROUTINE h5pset_fapl_family_f + +!****s* H5P/h5pget_fapl_family_f +! NAME +! h5pget_fapl_family_f +! +! PURPOSE +! Returns file access property list information. +! +! INPUTS +! prp_id - file access property list identifier +! OUTPUTS +! memb_size - size in bytes of each file member +! memb_plist - identifier of the file access property +! list to be used for each family member +! hdferr - error code +! Success: 0 +! Failure: -1 +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 14, 2001 +! +! Fortran90 Interface: + SUBROUTINE h5pget_fapl_family_f(prp_id, memb_size, memb_plist , hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER(HSIZE_T), INTENT(OUT) :: memb_size ! Logical size, in bytes, + ! of each family member + INTEGER(HID_T), INTENT(OUT) :: memb_plist ! Identifier of the file + ! access property list for + ! each member of the family + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + INTERFACE + INTEGER FUNCTION h5pget_fapl_family_c(prp_id, memb_size, memb_plist) & + BIND(C,NAME='h5pget_fapl_family_c') + IMPORT :: HID_T, HSIZE_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id + INTEGER(HSIZE_T), INTENT(OUT) :: memb_size + INTEGER(HID_T), INTENT(OUT) :: memb_plist + END FUNCTION h5pget_fapl_family_c + END INTERFACE + + hdferr = h5pget_fapl_family_c(prp_id, memb_size, memb_plist) + END SUBROUTINE h5pget_fapl_family_f + +!****s* H5P/h5pset_cache_f +! NAME +! h5pset_cache_f +! +! PURPOSE +! Sets the meta data cache and raw data chunk +! cache parameters +! +! INPUTS +! +! prp_id - file access property list identifier +! mdc_nelmts - number of elements (objects) in the meta +! data cache +! rdcc_nelmts - number of elements (objects) in the raw +! data chunk cache +! rdcc_nbytes - total size of the raw data chunk cache, in bytes +! rdcc_w0 - preemption policy (0 or 1) +! OUTPUTS +! +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 14, 2001 +! +! Fortran90 Interface: + SUBROUTINE h5pset_cache_f(prp_id, mdc_nelmts,rdcc_nelmts, rdcc_nbytes, rdcc_w0, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER, INTENT(IN) :: mdc_nelmts ! Number of elements (objects) + ! in the meta data cache + INTEGER(SIZE_T), INTENT(IN) :: rdcc_nelmts ! Number of elements (objects) + ! in the meta data cache + INTEGER(SIZE_T), INTENT(IN) :: rdcc_nbytes ! Total size of the raw data + ! chunk cache, in bytes + REAL, INTENT(IN) :: rdcc_w0 ! Preemption policy + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + INTERFACE + INTEGER FUNCTION h5pset_cache_c(prp_id,mdc_nelmts,rdcc_nelmts,rdcc_nbytes,rdcc_w0) & + BIND(C,NAME='h5pset_cache_c') + IMPORT :: HID_T, SIZE_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id + INTEGER, INTENT(IN) :: mdc_nelmts + INTEGER(SIZE_T), INTENT(IN) :: rdcc_nelmts + INTEGER(SIZE_T), INTENT(IN) :: rdcc_nbytes + REAL, INTENT(IN) :: rdcc_w0 + END FUNCTION h5pset_cache_c + END INTERFACE + + hdferr = h5pset_cache_c(prp_id, mdc_nelmts, rdcc_nelmts, rdcc_nbytes, rdcc_w0 ) + END SUBROUTINE h5pset_cache_f + +!****s* H5P/h5pget_cache_f +! NAME +! h5pget_cache_f +! +! PURPOSE +! Queries the meta data cache and raw data chunk cache +! parameters. +! +! INPUTS +! prp_id - file access property list identifier +! +! OUTPUTS +! mdc_nelmts - number of elements (objects) in the meta +! data cache +! rdcc_nelmts - number of elements (objects) in the raw +! data chunk cache +! rdcc_nbytes - total size of the raw data chunk cache, in bytes +! rdcc_w0 - preemption policy (0 or 1) +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 14, 2001 +! +! Bug fix: type of the rdcc_nelmts parameter should be INTEGER +! instead of INTEGER(SIZE_T) October 10, 2003 +! +! Fortran90 Interface: + SUBROUTINE h5pget_cache_f(prp_id, mdc_nelmts, rdcc_nelmts, rdcc_nbytes, rdcc_w0, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER, INTENT(OUT) :: mdc_nelmts ! Number of elements (objects) + ! in the meta data cache + INTEGER(SIZE_T), INTENT(OUT) :: rdcc_nelmts ! Number of elements (objects) + ! in the meta data cache + INTEGER(SIZE_T), INTENT(OUT) :: rdcc_nbytes ! Total size of the raw data + ! chunk cache, in bytes + REAL, INTENT(OUT) :: rdcc_w0 ! Preemption policy + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + INTERFACE + INTEGER FUNCTION h5pget_cache_c(prp_id,mdc_nelmts,rdcc_nelmts,rdcc_nbytes,rdcc_w0) & + BIND(C,NAME='h5pget_cache_c') + IMPORT :: HID_T, SIZE_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id + INTEGER, INTENT(OUT) :: mdc_nelmts + INTEGER(SIZE_T), INTENT(OUT) :: rdcc_nelmts + INTEGER(SIZE_T), INTENT(OUT) :: rdcc_nbytes + REAL, INTENT(OUT) :: rdcc_w0 + END FUNCTION h5pget_cache_c + END INTERFACE + + hdferr = h5pget_cache_c(prp_id, mdc_nelmts,rdcc_nelmts, rdcc_nbytes, rdcc_w0 ) + END SUBROUTINE h5pget_cache_f + +!****s* H5P/h5pset_fapl_split_f +! NAME +! h5pset_fapl_split_f +! +! PURPOSE +! Emulates the old split file driver. +! +! INPUTS +! +! prp_id - file access property list identifier +! meta_ext - name of the extension for the metafile +! filename +! meta_plist - identifier of the meta file access property +! list +! raw_ext - name extension for the raw file filename +! raw_plist - identifier of the raw file access property list +! +! OUTPUTS +! +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 14, 2001 +! +! Fortran90 Interface: + SUBROUTINE h5pset_fapl_split_f(prp_id, meta_ext, meta_plist, raw_ext, raw_plist, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + CHARACTER(LEN=*), INTENT(IN) :: meta_ext ! Name of the extension for + ! the metafile filename + INTEGER(HID_T), INTENT(IN) :: meta_plist ! Identifier of the meta file + ! access property list + CHARACTER(LEN=*), INTENT(IN) :: raw_ext ! Name extension for the raw file filename + INTEGER(HID_T), INTENT(IN) :: raw_plist ! Identifier of the raw file + ! access property list + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + INTEGER :: meta_len, raw_len + INTERFACE + INTEGER FUNCTION h5pset_fapl_split_c(prp_id,meta_len,meta_ext,meta_plist,raw_len,raw_ext,raw_plist) & + BIND(C,NAME='h5pset_fapl_split_c') + IMPORT :: C_CHAR + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: meta_ext + INTEGER(HID_T), INTENT(IN) :: meta_plist + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: raw_ext + INTEGER(HID_T), INTENT(IN) :: raw_plist + INTEGER :: meta_len, raw_len + END FUNCTION h5pset_fapl_split_c + END INTERFACE + + meta_len = LEN(meta_ext) + raw_len = LEN(raw_ext) + hdferr = h5pset_fapl_split_c(prp_id,meta_len,meta_ext,meta_plist,raw_len,raw_ext,raw_plist) + END SUBROUTINE h5pset_fapl_split_f + +!****s* H5P/h5pget_split_f +! NAME +! h5pget_split_f +! +! PURPOSE +! NOT AVAILABLE +! +! INPUTS +! +! OUTPUTS +! +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 14, 2001 +! +! SOURCE +! SUBROUTINE h5pget_split_f(prp_id, meta_ext_size, meta_ext, meta_plist,raw_ext_size,& +! raw_ext, raw_plist, hdferr) +! IMPLICIT NONE +! INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier +! INTEGER(SIZE_T), INTENT(IN) :: meta_ext_size ! Number of characters of the meta + ! file extension to be copied to the + ! meta_ext buffer + +! CHARACTER(LEN=*), INTENT(OUT) :: meta_ext !Name of the extension for + !the metafile filename +! INTEGER(HID_T), INTENT(OUT) :: meta_plist ! Identifier of the meta file + ! access property list +! INTEGER(SIZE_T), INTENT(IN) :: raw_ext_size ! Number of characters of the raw + ! file extension to be copied to the + ! raw_ext buffer +! CHARACTER(LEN=*), INTENT(OUT) :: raw_ext !Name extension for the raw file filename +! INTEGER(HID_T), INTENT(OUT) :: raw_plist !Identifier of the raw file + !access property list +! INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + +! INTEGER, EXTERNAL :: h5pget_split_c +! hdferr = h5pget_split_c(prp_id, meta_ext_size, meta_ext, meta_plist, & +! raw_ext_size, raw_ext, raw_plist ) +! END SUBROUTINE h5pget_split_f + +!****s* H5P/h5pset_gc_references_f +! NAME +! h5pset_gc_references_f +! +! PURPOSE +! Sets garbage collecting references flag. +! +! INPUTS +! +! prp_id - file access property list identifier +! gc_reference - flag for stting garbage collection on +! and off (1 or 0) +! OUTPUTS +! +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 14, 2001 +! +! Fortran90 Interface: + SUBROUTINE h5pset_gc_references_f (prp_id, gc_reference, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER, INTENT(IN) :: gc_reference ! The flag for garbage collecting + ! references for the file + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + INTERFACE + INTEGER FUNCTION h5pset_gc_references_c(prp_id, gc_reference) & + BIND(C,NAME='h5pset_gc_references_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id + INTEGER, INTENT(IN) :: gc_reference + END FUNCTION h5pset_gc_references_c + END INTERFACE + + hdferr = h5pset_gc_references_c(prp_id, gc_reference) + END SUBROUTINE h5pset_gc_references_f + +!****s* H5P/h5pget_gc_references_f +! NAME +! h5pget_gc_references_f +! +! PURPOSE +! Returns garbage collecting references setting. +! +! INPUTS +! +! prp_id - file access property list identifier +! OUTPUTS +! +! gc_reference - flag for stting garbage collection on +! and off (1 or 0) +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 14, 2001 +! +! Fortran90 Interface: + SUBROUTINE h5pget_gc_references_f(prp_id, gc_reference, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER, INTENT(OUT) :: gc_reference ! The flag for garbage collecting + ! references for the file + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + INTERFACE + INTEGER FUNCTION h5pget_gc_references_c(prp_id, gc_reference) & + BIND(C,NAME='h5pget_gc_references_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id + INTEGER, INTENT(OUT) :: gc_reference + END FUNCTION h5pget_gc_references_c + END INTERFACE + + hdferr = h5pget_gc_references_c(prp_id, gc_reference) + END SUBROUTINE h5pget_gc_references_f + +!****s* H5P/h5pset_layout_f +! NAME +! h5pset_layout_f +! +! PURPOSE +! Sets the type of storage used store the raw data +! for a dataset. +! +! INPUTS +! +! prp_id - data creation property list identifier +! layout - type of storage layout for raw data +! possible values are: +! H5D_COMPACT_F +! H5D_CONTIGUOUS_F +! H5D_CHUNKED_F +! OUTPUTS +! +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 14, 2001 +! +! Fortran90 Interface: + SUBROUTINE h5pset_layout_f (prp_id, layout, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER, INTENT(IN) :: layout ! Type of storage layout for raw data + ! possible values are: + ! H5D_COMPACT_F + ! H5D_CONTIGUOUS_F + ! H5D_CHUNKED_F + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + INTERFACE + INTEGER FUNCTION h5pset_layout_c(prp_id, layout) & + BIND(C,NAME='h5pset_layout_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id + INTEGER, INTENT(IN) :: layout + END FUNCTION h5pset_layout_c + END INTERFACE + + hdferr = h5pset_layout_c(prp_id, layout) + END SUBROUTINE h5pset_layout_f + +!****s* H5P/h5pget_layout_f +! NAME +! h5pget_layout_f +! +! PURPOSE +! Returns the layout of the raw data for a dataset. +! +! INPUTS +! +! prp_id - data creation property list identifier +! OUTPUTS +! +! layout - type of storage layout for raw data +! possible values are: +! H5D_COMPACT_F +! H5D_CONTIGUOUS_F +! H5D_CHUNKED_F +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 14, 2001 +! +! Fortran90 Interface: + SUBROUTINE h5pget_layout_f (prp_id, layout, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER, INTENT(OUT) :: layout ! Type of storage layout for raw data + ! possible values are: + ! H5D_COMPACT_F(0) + ! H5D_CONTIGUOUS_F(1) + ! H5D_CHUNKED_F(2) + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + INTERFACE + INTEGER FUNCTION h5pget_layout_c(prp_id, layout) & + BIND(C,NAME='h5pget_layout_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id + INTEGER, INTENT(OUT) :: layout + END FUNCTION h5pget_layout_c + END INTERFACE + + hdferr = h5pget_layout_c(prp_id, layout) + END SUBROUTINE h5pget_layout_f + +!****s* H5P/h5pset_filter_f +! NAME +! h5pset_filter_f +! +! PURPOSE +! Adds a filter to the filter pipeline. +! +! INPUTS +! +! prp_id - data creation or transfer property list +! identifier +! filter - filter to be added to the pipeline +! flags - bit vector specifying certain general +! properties of the filter +! cd_nelmts - number of elements in cd_values +! cd_values - auxiliary data for the filter +! OUTPUTS +! +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! February, 2003 +! +! Fortran90 Interface: + SUBROUTINE h5pset_filter_f(prp_id, filter, flags, cd_nelmts, cd_values, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER, INTENT(IN) :: filter ! Filter to be added to the pipeline. + INTEGER, INTENT(IN) :: flags ! Bit vector specifying certain general + ! properties of the filter. + INTEGER(SIZE_T), INTENT(IN) :: cd_nelmts ! Number of elements in cd_values. + INTEGER, DIMENSION(*), INTENT(IN) :: cd_values ! Auxiliary data for the filter. + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + INTERFACE + INTEGER FUNCTION h5pset_filter_c(prp_id, filter, flags, cd_nelmts, cd_values) & + BIND(C,NAME='h5pset_filter_c') + IMPORT :: HID_T, SIZE_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id + INTEGER, INTENT(IN) :: filter + INTEGER, INTENT(IN) :: flags + INTEGER(SIZE_T), INTENT(IN) :: cd_nelmts + INTEGER, DIMENSION(*), INTENT(IN) :: cd_values + END FUNCTION h5pset_filter_c + END INTERFACE + + hdferr = h5pset_filter_c(prp_id, filter, flags, cd_nelmts, cd_values ) + END SUBROUTINE h5pset_filter_f + +!****s* H5P/h5pget_nfilters_f +! NAME +! h5pget_nfilters_f +! +! PURPOSE +! Returns the number of filters in the pipeline. +! +! INPUTS +! +! prp_id - data creation or transfer property list +! identifier +! OUTPUTS +! +! nfilters - number of filters in the pipeline +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 14, 2001 +! +! Fortran90 Interface: + SUBROUTINE h5pget_nfilters_f (prp_id, nfilters, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER, INTENT(OUT) :: nfilters ! The number of filters in the pipeline + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + INTERFACE + INTEGER FUNCTION h5pget_nfilters_c(prp_id, nfilters) & + BIND(C,NAME='h5pget_nfilters_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id + INTEGER, INTENT(OUT) :: nfilters + END FUNCTION h5pget_nfilters_c + END INTERFACE + + hdferr = h5pget_nfilters_c(prp_id, nfilters) + END SUBROUTINE h5pget_nfilters_f + +!****s* H5P/h5pget_filter_f +! NAME +! h5pget_filter_f +! +! PURPOSE +! Returns information about a filter in a pipeline +! +! INPUTS +! +! prp_id - data creation or transfer property list +! identifier +! filter_number - sequence number within the filter +! pipeline of the filter for which +! information is sought +! OUTPUTS +! +! filter_id - filter identification number +! flags - bit vector specifying certain general +! properties of the filter +! cd_nelmts - number of elements in cd_values +! cd_values - auxiliary data for the filter +! namelen - number of characters in the name buffer +! name - buffer to retrieve filter name +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 14, 2001 +! +! Fortran90 Interface: + SUBROUTINE h5pget_filter_f(prp_id, filter_number, flags, cd_nelmts, cd_values, namelen, name, filter_id, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER, INTENT(IN) :: filter_number ! Sequence number within the filter + ! pipeline of the filter for which + ! information is sought + INTEGER, DIMENSION(*), INTENT(OUT) :: cd_values ! Auxiliary data for the filter. + INTEGER, INTENT(OUT) :: flags ! Bit vector specifying certain general + ! properties of the filter. + INTEGER(SIZE_T), INTENT(INOUT) :: cd_nelmts ! Number of elements in cd_values. + INTEGER(SIZE_T), INTENT(IN) :: namelen ! Anticipated number of characters in name. + CHARACTER(LEN=*), INTENT(OUT) :: name ! Name of the filter + INTEGER, INTENT(OUT) :: filter_id ! Filter identification number + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + + +! INTEGER, EXTERNAL :: h5pget_filter_c +! MS FORTRAN needs explicit interface for C functions called here. +! + INTERFACE + INTEGER FUNCTION h5pget_filter_c(prp_id, filter_number, flags, cd_nelmts, & + cd_values, namelen, name, filter_id ) & + BIND(C,NAME='h5pget_filter_c') + IMPORT :: C_CHAR + IMPORT :: HID_T, SIZE_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id + INTEGER, INTENT(IN) :: filter_number + INTEGER, DIMENSION(*), INTENT(OUT) :: cd_values + INTEGER, INTENT(OUT) :: flags + INTEGER(SIZE_T), INTENT(INOUT) :: cd_nelmts + INTEGER(SIZE_T), INTENT(IN) :: namelen + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(OUT) :: name + INTEGER, INTENT(OUT) :: filter_id + END FUNCTION h5pget_filter_c + END INTERFACE + + hdferr = h5pget_filter_c(prp_id, filter_number, flags, cd_nelmts, & + cd_values, namelen, name, filter_id ) + END SUBROUTINE h5pget_filter_f + +!****s* H5P/h5pset_external_f +! NAME +! h5pset_external_f +! +! PURPOSE +! Adds an external file to the list of external files. +! +! INPUTS +! +! prp_id - dataset creation property list identifier +! name - name of external file +! offset - offset in bytes from the beginning of the +! file to the location in the file +! where the data starts +! bytes - size of the external file data. +! OUTPUTS +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 14, 2001 +! +! Changed type of 'offset' from integer to off_t -- MSB January 9, 2012 +! +! Fortran90 Interface: + SUBROUTINE h5pset_external_f(prp_id, name, offset, bytes, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + CHARACTER(LEN=*), INTENT(IN) :: name ! Name of an external file + INTEGER(OFF_T), INTENT(IN) :: offset ! Offset, in bytes, from the beginning + ! of the file to the location in the file + ! where the data starts. + INTEGER(HSIZE_T), INTENT(IN) :: bytes ! Number of bytes reserved in the + ! file for the data + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + INTEGER :: namelen + + INTERFACE + INTEGER FUNCTION h5pset_external_c(prp_id, name,namelen, offset, bytes) & + BIND(C,NAME='h5pset_external_c') + IMPORT :: C_CHAR + IMPORT :: HID_T, OFF_T, HSIZE_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: name + INTEGER :: namelen + INTEGER(OFF_T), INTENT(IN) :: offset + INTEGER(HSIZE_T), INTENT(IN) :: bytes + END FUNCTION h5pset_external_c + END INTERFACE + + namelen = LEN(name) + hdferr = h5pset_external_c(prp_id, name, namelen, offset, bytes) + END SUBROUTINE h5pset_external_f + +!****s* H5P/h5pget_external_count_f +! NAME +! h5pget_external_count_f +! +! PURPOSE +! Returns the number of external files for a dataset. +! +! INPUTS +! +! prp_id - dataset creation property list identifier +! OUTPUTS +! +! count - number of external files for the +! specified dataset +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 14, 2001 +! +! Fortran90 Interface: + SUBROUTINE h5pget_external_count_f (prp_id, count, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER, INTENT(OUT) :: count ! Number of external files for the + ! Specified dataset + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + INTERFACE + INTEGER FUNCTION h5pget_external_count_c(prp_id, count) & + BIND(C,NAME='h5pget_external_count_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id + INTEGER, INTENT(OUT) :: count + END FUNCTION h5pget_external_count_c + END INTERFACE + + hdferr = h5pget_external_count_c(prp_id, count) + END SUBROUTINE h5pget_external_count_f + +!****s* H5P/h5pget_external_f +! NAME +! h5pget_external_f +! +! PURPOSE +! Returns information about an external file. +! +! INPUTS +! +! prp_id - dataset creation property list identifier +! OUTPUTS +! +! idx - external file index +! name_size - maximum size of name array +! name - name of the external file +! name - name of external file +! offset - offset in bytes from the beginning of the +! file to the location in the file +! where the data starts +! bytes - size of the external file data +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 14, 2001 +! +! Changed type of 'offset' from integer to off_t -- MSB January 9, 2012 +! +! Fortran90 Interface: + SUBROUTINE h5pget_external_f(prp_id, idx, name_size, name, offset,bytes, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER, INTENT(IN) :: idx ! External file index. + INTEGER(SIZE_T), INTENT(IN) :: name_size ! Maximum length of name array + CHARACTER(LEN=*), INTENT(OUT) :: name ! Name of an external file + INTEGER(OFF_T), INTENT(OUT) :: offset ! Offset, in bytes, from the beginning + ! of the file to the location in the file + ! where the data starts. + INTEGER(HSIZE_T), INTENT(OUT) :: bytes ! Number of bytes reserved in the + ! file for the data + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + INTERFACE + INTEGER FUNCTION h5pget_external_c(prp_id, idx, name_size, name, offset, bytes) & + BIND(C,NAME='h5pget_external_c') + IMPORT :: C_CHAR + IMPORT :: HID_T, SIZE_T, HSIZE_T, OFF_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id + INTEGER, INTENT(IN) :: idx + INTEGER(SIZE_T), INTENT(IN) :: name_size + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(OUT) :: name + INTEGER(OFF_T), INTENT(OUT) :: offset + INTEGER(HSIZE_T), INTENT(OUT) :: bytes + END FUNCTION h5pget_external_c + END INTERFACE + + hdferr = h5pget_external_c(prp_id, idx, name_size, name, offset, bytes) + END SUBROUTINE h5pget_external_f + +!****s* H5P/h5pset_btree_ratios_f +! NAME +! h5pset_btree_ratios_f +! +! PURPOSE +! Sets B-tree split ratios for a dataset transfer +! property list. +! +! INPUTS +! +! prp_id - the dataset transfer property list +! identifier +! left - the B-tree split ratio for left-most nodes +! middle - the B-tree split ratio for all other nodes +! right - the B-tree split ratio for right-most nodes +! OUTPUTS +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 14, 2001 +! +! Fortran90 Interface: + SUBROUTINE h5pset_btree_ratios_f(prp_id, left, middle, right, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + REAL, INTENT(IN) :: left ! The B-tree split ratio for left-most nodes. + REAL, INTENT(IN) :: middle ! The B-tree split ratio for all other nodes + REAL, INTENT(IN) :: right ! The B-tree split ratio for right-most + ! nodes and lone nodes. + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + INTERFACE + INTEGER FUNCTION h5pset_btree_ratios_c(prp_id, left, middle, right) & + BIND(C,NAME='h5pset_btree_ratios_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id + REAL, INTENT(IN) :: left + REAL, INTENT(IN) :: middle + REAL, INTENT(IN) :: right + END FUNCTION h5pset_btree_ratios_c + END INTERFACE + + hdferr = h5pset_btree_ratios_c(prp_id, left, middle, right) + END SUBROUTINE h5pset_btree_ratios_f + +!****s* H5P/h5pget_btree_ratios_f +! NAME +! h5pget_btree_ratios_f +! +! PURPOSE +! Gets B-tree split ratios for a dataset transfer property list +! +! INPUTS +! +! prp_id - the dataset transfer property list +! identifier +! OUTPUTS +! +! left - the B-tree split ratio for left-most nodes +! middle - the B-tree split ratio for all other nodes +! right - the B-tree split ratio for right-most nodes +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 14, 2001 +! +! Fortran90 Interface: + SUBROUTINE h5pget_btree_ratios_f(prp_id, left, middle, right, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + REAL, INTENT(OUT) :: left ! The B-tree split ratio for left-most nodes. + REAL, INTENT(OUT) :: middle ! The B-tree split ratio for all other nodes + REAL, INTENT(OUT) :: right ! The B-tree split ratio for right-most + ! nodes and lone nodes. + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + INTERFACE + INTEGER FUNCTION h5pget_btree_ratios_c(prp_id, left, middle, right) & + BIND(C,NAME='h5pget_btree_ratios_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id + REAL, INTENT(OUT) :: left + REAL, INTENT(OUT) :: middle + REAL, INTENT(OUT) :: right + END FUNCTION h5pget_btree_ratios_c + END INTERFACE + + hdferr = h5pget_btree_ratios_c(prp_id, left, middle, right) + END SUBROUTINE h5pget_btree_ratios_f + +!****s* H5P/h5pget_fclose_degree_f +! NAME +! h5pget_fclose_degree_f +! +! PURPOSE +! Returns the degree for the file close behavior. +! +! INPUTS +! +! fapl_id - File access property list identifier +! OUTPUTS +! +! degree - Possible values are: +! H5F_CLOSE_DEFAULT_F +! H5F_CLOSE_WEAK_F +! H5F_CLOSE_SEMI_F +! H5F_CLOSE_STRONG_F +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! September 26, 2002 +! +! HISTORY +! +! +! Fortran90 Interface: + SUBROUTINE h5pget_fclose_degree_f(fapl_id, degree, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: fapl_id ! File Access Property list identifier + INTEGER, INTENT(OUT) :: degree ! Possible values are: + ! H5F_CLOSE_DEFAULT_F + ! H5F_CLOSE_WEAK_F + ! H5F_CLOSE_SEMI_F + ! H5F_CLOSE_STRONG_F + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + INTERFACE + INTEGER FUNCTION h5pget_fclose_degree_c(fapl_id, degree) & + BIND(C,NAME='h5pget_fclose_degree_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: fapl_id + INTEGER, INTENT(OUT) :: degree + END FUNCTION h5pget_fclose_degree_c + END INTERFACE + + hdferr = h5pget_fclose_degree_c(fapl_id, degree) + END SUBROUTINE h5pget_fclose_degree_f + +!****s* H5P/h5pset_fclose_degree_f +! NAME +! h5pset_fclose_degree_f +! +! PURPOSE +! Sets the degree for the file close behavior. +! +! INPUTS +! +! fapl_id - file access property list identifier +! degree - Possible values are: +! H5F_CLOSE_DEFAULT_F +! H5F_CLOSE_WEAK_F +! H5F_CLOSE_SEMI_F +! H5F_CLOSE_STRONG_F +! OUTPUTS +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! September 26, 2002 +! +! Fortran90 Interface: + SUBROUTINE h5pset_fclose_degree_f(fapl_id, degree, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: fapl_id ! File Access Property list identifier + INTEGER, INTENT(IN) :: degree ! Possible values are: + ! H5F_CLOSE_DEFAULT_F + ! H5F_CLOSE_WEAK_F + ! H5F_CLOSE_SEMI_F + ! H5F_CLOSE_STRONG_F + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + INTERFACE + INTEGER FUNCTION h5pset_fclose_degree_c(fapl_id, degree) & + BIND(C,NAME='h5pset_fclose_degree_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: fapl_id + INTEGER, INTENT(IN) :: degree + END FUNCTION h5pset_fclose_degree_c + END INTERFACE + + hdferr = h5pset_fclose_degree_c(fapl_id, degree) + END SUBROUTINE h5pset_fclose_degree_f + +!****s* H5P/h5pequal_f +! NAME +! h5pequal_f +! +! PURPOSE +! Checks if two property lists are eqaul +! +! INPUTS +! +! plist1_id - property list identifier +! plist2_id - property list identifier +! OUTPUTS +! +! flag - flag, possible values +! .TRUE. or .FALSE. +! hdferr: - error code +! Success: 0 +! Failure: -1, flag is set to .FALSE. +! +! AUTHOR +! Elena Pourmal +! September 30, 2002 +! +! Fortran90 Interface: + SUBROUTINE h5pequal_f(plist1_id, plist2_id, flag, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: plist1_id ! Property list identifier + INTEGER(HID_T), INTENT(IN) :: plist2_id ! Property list identifier + LOGICAL, INTENT(OUT) :: flag ! Flag + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + INTEGER :: c_flag + + INTERFACE + INTEGER FUNCTION h5pequal_c(plist1_id, plist2_id, c_flag) & + BIND(C,NAME='h5pequal_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: plist1_id + INTEGER(HID_T), INTENT(IN) :: plist2_id + INTEGER, INTENT(OUT) :: c_flag + END FUNCTION h5pequal_c + END INTERFACE + + flag = .FALSE. + hdferr = h5pequal_c(plist1_id, plist2_id, c_flag) + IF (c_flag .GT. 0) flag = .TRUE. + END SUBROUTINE h5pequal_f + +!****s* H5P/h5pset_buffer_f +! NAME +! h5pset_buffer_f +! +! PURPOSE +! Sets sixe for conversion buffer +! +! INPUTS +! plist_id - data transfer property list identifier +! size - buffer size +! OUTPUTS +! +! hdferr: - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! October 2, 2002 +! +! Fortran90 Interface: + SUBROUTINE h5pset_buffer_f(plist_id, size, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: plist_id ! Data transfer property list identifier + INTEGER(HSIZE_T), INTENT(IN) :: size ! Buffer size in bytes; + ! buffer is allocated and freed by + ! the library. + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + + INTERFACE + INTEGER FUNCTION h5pset_buffer_c(plist_id, size) & + BIND(C,NAME='h5pset_buffer_c') + IMPORT :: HID_T, HSIZE_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: plist_id + INTEGER(HSIZE_T), INTENT(IN) :: size + END FUNCTION h5pset_buffer_c + END INTERFACE + + hdferr = h5pset_buffer_c(plist_id, size) + END SUBROUTINE h5pset_buffer_f + +!****s* H5P/h5pget_buffer_f +! NAME +! h5pget_buffer_f +! +! PURPOSE +! Gets size for conversion buffer +! +! INPUTS +! +! plist_id - data transfer property list identifier +! OUTPUTS +! +! size - buffer size +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! October 2, 2002 +! +! Fortran90 Interface: + SUBROUTINE h5pget_buffer_f(plist_id, size, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: plist_id ! Data transfer property list identifier + INTEGER(HSIZE_T), INTENT(OUT) :: size ! Buffer size in bytes; + ! buffer is allocated and freed by + ! the library. + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + + INTERFACE + INTEGER FUNCTION h5pget_buffer_c(plist_id, size) & + BIND(C,NAME='h5pget_buffer_c') + IMPORT :: HID_T, HSIZE_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: plist_id + INTEGER(HSIZE_T), INTENT(OUT) :: size + END FUNCTION h5pget_buffer_c + END INTERFACE + + hdferr = h5pget_buffer_c(plist_id, size) + END SUBROUTINE h5pget_buffer_f + +!****s* H5P/h5pfill_value_defined_f +! NAME +! h5pfill_value_defined_f +! +! PURPOSE +! Check if fill value is defined. +! +! INPUTS +! +! plist_id - dataset creation property list identifier +! OUTPUTS +! +! flag - fill value status flag +! Possible values are: +! H5D_FILL_VALUE_ERROR_F +! H5D_FILL_VALUE_UNDEFINED_F +! H5D_FILL_VALUE_DEFAULT_F +! H5D_FILL_VALUE_USER_DEFINED_F +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! October 4, 2002 +! +! Fortran90 Interface: + SUBROUTINE h5pfill_value_defined_f(plist_id, flag, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: plist_id ! Dataset creation property list identifier + INTEGER, INTENT(OUT) :: flag ! Fill value status flag + ! H5D_FILL_VALUE_ERROR_F + ! H5D_FILL_VALUE_UNDEFINED_F + ! H5D_FILL_VALUE_DEFAULT_F + ! H5D_FILL_VALUE_USER_DEFINED_F + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + INTERFACE + INTEGER FUNCTION h5pfill_value_defined_c(plist_id, flag) & + BIND(C,NAME='h5pfill_value_defined_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: plist_id + INTEGER, INTENT(OUT) :: flag + END FUNCTION h5pfill_value_defined_c + END INTERFACE + + hdferr = h5pfill_value_defined_c(plist_id, flag) + END SUBROUTINE h5pfill_value_defined_f + +!****s* H5P/h5pset_alloc_time_f +! NAME +! h5pset_alloc_time_f +! +! PURPOSE +! Set space allocation time for dataset during creation. +! +! INPUTS +! +! plist_id - dataset creation property list identifier +! flag - allocation time flag: +! H5D_ALLOC_TIME_ERROR_F +! H5D_ALLOC_TIME_DEFAULT_F +! H5D_ALLOC_TIME_EARLY_F +! H5D_ALLOC_TIME_LATE_F +! H5D_ALLOC_TIME_INCR_F +! OUTPUTS +! +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! October 4, 2002 +! +! Fortran90 Interface: + SUBROUTINE h5pset_alloc_time_f(plist_id, flag, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: plist_id ! Dataset creation property list identifier + INTEGER, INTENT(IN) :: flag ! Allocation time flag: + ! H5D_ALLOC_TIME_ERROR_F + ! H5D_ALLOC_TIME_DEFAULT_F + ! H5D_ALLOC_TIME_EARLY_F + ! H5D_ALLOC_TIME_LATE_F + ! H5D_ALLOC_TIME_INCR_F + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + + INTERFACE + INTEGER FUNCTION h5pset_alloc_time_c(plist_id, flag) & + BIND(C,NAME='h5pset_alloc_time_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: plist_id + INTEGER, INTENT(IN) :: flag + END FUNCTION h5pset_alloc_time_c + END INTERFACE + + hdferr = h5pset_alloc_time_c(plist_id, flag) + END SUBROUTINE h5pset_alloc_time_f + +!****s* H5P/h5pget_alloc_time_f +! NAME +! h5pget_alloc_time_f +! +! PURPOSE +! Get space allocation time for dataset during creation. +! +! INPUTS +! +! plist_id - dataset creation property list identifier +! OUTPUTS +! +! flag - allocation time flag: +! H5D_ALLOC_TIME_ERROR_F +! H5D_ALLOC_TIME_DEFAULT_F +! H5D_ALLOC_TIME_EARLY_F +! H5D_ALLOC_TIME_LATE_F +! H5D_ALLOC_TIME_INCR_F +! hdferr: - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! October 4, 2002 +! +! Fortran90 Interface: + SUBROUTINE h5pget_alloc_time_f(plist_id, flag, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: plist_id ! Dataset creation property list identifier + INTEGER, INTENT(OUT) :: flag ! Allocation time flag: + ! H5D_ALLOC_TIME_ERROR_F + ! H5D_ALLOC_TIME_DEFAULT_F + ! H5D_ALLOC_TIME_EARLY_F + ! H5D_ALLOC_TIME_LATE_F + ! H5D_ALLOC_TIME_INCR_F + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + + INTERFACE + INTEGER FUNCTION h5pget_alloc_time_c(plist_id, flag) & + BIND(C,NAME='h5pget_alloc_time_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: plist_id + INTEGER, INTENT(OUT) :: flag + END FUNCTION h5pget_alloc_time_c + END INTERFACE + + hdferr = h5pget_alloc_time_c(plist_id, flag) + END SUBROUTINE h5pget_alloc_time_f + +!****s* H5P/h5pset_fill_time_f +! NAME +! h5pset_fill_time_f +! +! PURPOSE +! Set fill value writing time for dataset +! +! INPUTS +! +! plist_id - dataset creation property list identifier +! flag - fill time flag: +! H5D_FILL_TIME_ERROR_F +! H5D_FILL_TIME_ALLOC_F +! H5D_FILL_TIME_NEVER_F +! OUTPUTS +! +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! October 4, 2002 +! +! Fortran90 Interface: + SUBROUTINE h5pset_fill_time_f(plist_id, flag, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: plist_id ! Dataset creation property list identifier + INTEGER, INTENT(IN) :: flag ! Fill time flag: + ! H5D_FILL_TIME_ERROR_F + ! H5D_FILL_TIME_ALLOC_F + ! H5D_FILL_TIME_NEVER_F + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + + INTERFACE + INTEGER FUNCTION h5pset_fill_time_c(plist_id, flag) & + BIND(C,NAME='h5pset_fill_time_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: plist_id + INTEGER, INTENT(IN) :: flag + END FUNCTION h5pset_fill_time_c + END INTERFACE + + hdferr = h5pset_fill_time_c(plist_id, flag) + END SUBROUTINE h5pset_fill_time_f + +!****s* H5P/h5pget_fill_time_f +! NAME +! h5pget_fill_time_f +! +! PURPOSE +! Get fill value writing time for dataset +! +! INPUTS +! +! plist_id - dataset creation property list identifier +! OUTPUTS +! +! hdferr: - error code +! Success: 0 +! Failure: -1 +! OPTIONAL PARAMETERS +! +! flag - fill time flag: +! H5D_FILL_TIME_ERROR_F +! H5D_FILL_TIME_ALLOC_F +! H5D_FILL_TIME_NEVER_F +! AUTHOR +! Elena Pourmal +! October 4, 2002 +! +! Fortran90 Interface: + SUBROUTINE h5pget_fill_time_f(plist_id, flag, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: plist_id ! Dataset creation property list identifier + INTEGER, INTENT(OUT) :: flag ! Fill time flag: + ! H5D_FILL_TIME_ERROR_F + ! H5D_FILL_TIME_ALLOC_F + ! H5D_FILL_TIME_NEVER_F + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + + INTERFACE + INTEGER FUNCTION h5pget_fill_time_c(plist_id, flag) & + BIND(C,NAME='h5pget_fill_time_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: plist_id + INTEGER, INTENT(OUT) :: flag + END FUNCTION h5pget_fill_time_c + END INTERFACE + + hdferr = h5pget_fill_time_c(plist_id, flag) + END SUBROUTINE h5pget_fill_time_f + +!****s* H5P/ h5pset_meta_block_size_f +! NAME +! h5pset_meta_block_size_f +! +! PURPOSE +! Sets the minimum size of metadata block allocations +! +! INPUTS +! +! plist_id - file access property list identifier +! size - metatdata block size +! OUTPUTS +! +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! October 7, 2002 +! +! Fortran90 Interface: + SUBROUTINE h5pset_meta_block_size_f(plist_id, size, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: plist_id ! File access property list identifier + INTEGER(HSIZE_T), INTENT(IN) :: size ! Block size in bytes; + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + INTERFACE + INTEGER FUNCTION h5pset_meta_block_size_c(plist_id, size) & + BIND(C,NAME='h5pset_meta_block_size_c') + IMPORT :: HID_T, HSIZE_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: plist_id + INTEGER(HSIZE_T), INTENT(IN) :: size + END FUNCTION h5pset_meta_block_size_c + END INTERFACE + + hdferr = h5pset_meta_block_size_c(plist_id, size) + END SUBROUTINE h5pset_meta_block_size_f + +!****s* H5P/h5pget_meta_block_size_f +! NAME +! h5pget_meta_block_size_f +! +! PURPOSE +! Gets the minimum size of metadata block allocations +! +! INPUTS +! +! plist_id - file access property list identifier +! OUTPUTS +! +! size - metatdata block size +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! October 7, 2002 +! +! Fortran90 Interface: + SUBROUTINE h5pget_meta_block_size_f(plist_id, size, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: plist_id ! File access property list identifier + INTEGER(HSIZE_T), INTENT(OUT) :: size ! Block size in bytes; + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + INTERFACE + INTEGER FUNCTION h5pget_meta_block_size_c(plist_id, size) & + BIND(C,NAME='h5pget_meta_block_size_c') + IMPORT :: HID_T, HSIZE_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: plist_id + INTEGER(HSIZE_T), INTENT(OUT) :: size + END FUNCTION h5pget_meta_block_size_c + END INTERFACE + + hdferr = h5pget_meta_block_size_c(plist_id, size) + END SUBROUTINE h5pget_meta_block_size_f + +!****s* H5P/h5pset_sieve_buf_size_f +! NAME +! h5pset_sieve_buf_size_f +! +! PURPOSE +! Sets the maximum size of the data sieve buffer +! +! INPUTS +! +! plist_id - file access property list identifier +! size - sieve buffer size +! OUTPUTS +! +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! October 7, 2002 +! +! Fortran90 Interface: + SUBROUTINE h5pset_sieve_buf_size_f(plist_id, size, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: plist_id ! File access property list identifier + INTEGER(SIZE_T), INTENT(IN) :: size ! Buffer size in bytes; + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + INTERFACE + INTEGER FUNCTION h5pset_sieve_buf_size_c(plist_id, size) & + BIND(C,NAME='h5pset_sieve_buf_size_c') + IMPORT :: HID_T, SIZE_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: plist_id + INTEGER(SIZE_T), INTENT(IN) :: size + END FUNCTION h5pset_sieve_buf_size_c + END INTERFACE + + hdferr = h5pset_sieve_buf_size_c(plist_id, size) + END SUBROUTINE h5pset_sieve_buf_size_f + +!****s* H5P/h5pget_sieve_buf_size_f +! NAME +! h5pget_sieve_buf_size_f +! +! PURPOSE +! Gets the maximum size of the data sieve buffer +! +! INPUTS +! +! plist_id - file access property list identifier +! OUTPUTS +! +! size - sieve buffer size +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! October 7, 2002 +! +! Fortran90 Interface: + SUBROUTINE h5pget_sieve_buf_size_f(plist_id, size, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: plist_id ! File access property list identifier + INTEGER(SIZE_T), INTENT(OUT) :: size ! Buffer size in bytes + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + INTERFACE + INTEGER FUNCTION h5pget_sieve_buf_size_c(plist_id, size) & + BIND(C,NAME='h5pget_sieve_buf_size_c') + IMPORT :: HID_T, SIZE_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: plist_id + INTEGER(SIZE_T), INTENT(OUT) :: size + END FUNCTION h5pget_sieve_buf_size_c + END INTERFACE + + hdferr = h5pget_sieve_buf_size_c(plist_id, size) + END SUBROUTINE h5pget_sieve_buf_size_f + +!****s* H5P/h5pset_small_data_block_size_f +! NAME +! h5pset_small_data_block_size_f +! +! PURPOSE +! Sets the minimum size of "small" raw data block +! +! INPUTS +! +! plist_id - file access property list identifier +! size - small raw data block size +! OUTPUTS +! +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! October 7, 2002 +! +! Fortran90 Interface: + SUBROUTINE h5pset_small_data_block_size_f(plist_id, size, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: plist_id ! File access property list identifier + INTEGER(HSIZE_T), INTENT(IN) :: size ! Small raw data block size + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + INTERFACE + INTEGER FUNCTION h5pset_small_data_block_size_c(plist_id, size) & + BIND(C,NAME='h5pset_small_data_block_size_c') + IMPORT :: HID_T, HSIZE_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: plist_id + INTEGER(HSIZE_T), INTENT(IN) :: size + END FUNCTION h5pset_small_data_block_size_c + END INTERFACE + + hdferr = h5pset_small_data_block_size_c(plist_id, size) + END SUBROUTINE h5pset_small_data_block_size_f + +!****s* H5P/h5pget_small_data_block_size_f +! NAME +! h5pget_small_data_block_size_f +! +! PURPOSE +! Gets the minimum size of "small" raw data block +! +! INPUTS +! +! plist_id - file access property list identifier +! OUTPUTS +! +! size - small raw data block size +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! October 7, 2002 +! +! Fortran90 Interface: + SUBROUTINE h5pget_small_data_block_size_f(plist_id, size, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: plist_id ! File access property list identifier + INTEGER(HSIZE_T), INTENT(OUT) :: size ! Small raw data block size + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + INTERFACE + INTEGER FUNCTION h5pget_small_data_block_size_c(plist_id, size) & + BIND(C,NAME='h5pget_small_data_block_size_c') + IMPORT :: HID_T, HSIZE_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: plist_id + INTEGER(HSIZE_T), INTENT(OUT) :: size + END FUNCTION h5pget_small_data_block_size_c + END INTERFACE + + hdferr = h5pget_small_data_block_size_c(plist_id, size) + END SUBROUTINE h5pget_small_data_block_size_f + +!****s* H5P/h5pset_hyper_vector_size_f +! NAME +! h5pset_hyper_vector_size_f +! +! PURPOSE +! Set the number of "I/O" vectors (vector size) +! +! INPUTS +! +! plist_id - dataset transfer property list identifier +! size - vector size +! OUTPUTS +! +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! October 7, 2002 +! +! Fortran90 Interface: + SUBROUTINE h5pset_hyper_vector_size_f(plist_id, size, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: plist_id ! Dataset transfer property list identifier + INTEGER(SIZE_T), INTENT(IN) :: size ! Vector size + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + INTERFACE + INTEGER FUNCTION h5pset_hyper_vector_size_c(plist_id, size) & + BIND(C,NAME='h5pset_hyper_vector_size_c') + IMPORT :: HID_T, SIZE_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: plist_id + INTEGER(SIZE_T), INTENT(IN) :: size + END FUNCTION h5pset_hyper_vector_size_c + END INTERFACE + + hdferr = h5pset_hyper_vector_size_c(plist_id, size) + END SUBROUTINE h5pset_hyper_vector_size_f + +!****s* H5P/ h5pget_hyper_vector_size_f +! NAME +! h5pget_hyper_vector_size_f +! +! PURPOSE +! Get the number of "I/O" vectors (vector size) +! +! INPUTS +! +! plist_id - dataset transfer property list identifier +! OUTPUTS +! +! size - vector size +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! October 7, 2002 +! +! Fortran90 Interface: + SUBROUTINE h5pget_hyper_vector_size_f(plist_id, size, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: plist_id ! Dataset transfer property list identifier + INTEGER(SIZE_T), INTENT(OUT) :: size ! Vector size + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + INTERFACE + INTEGER FUNCTION h5pget_hyper_vector_size_c(plist_id, size) & + BIND(C,NAME='h5pget_hyper_vector_size_c') + IMPORT :: HID_T, SIZE_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: plist_id + INTEGER(SIZE_T), INTENT(OUT) :: size + END FUNCTION h5pget_hyper_vector_size_c + END INTERFACE + + hdferr = h5pget_hyper_vector_size_c(plist_id, size) + END SUBROUTINE h5pget_hyper_vector_size_f + +!****s* H5P/h5pexist_f +! NAME +! h5pexist_f +! +! PURPOSE +! Queries whether a property name exists in a property list or class. +! +! INPUTS +! +! prp_id - property list identifier to query +! name - name of property to check for +! OUTPUTS +! +! flag - logical flag +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! October 9, 2002 +! +! Fortran90 Interface: + SUBROUTINE h5pexist_f(prp_id, name, flag, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to modify + LOGICAL, INTENT(OUT) :: flag ! .TRUE. if exists, .FALSE. otherwise + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + INTEGER :: name_len + + INTERFACE + INTEGER FUNCTION h5pexist_c(prp_id, name, name_len) & + BIND(C,NAME='h5pexist_c') + IMPORT :: C_CHAR + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: name + INTEGER, INTENT(IN) :: name_len + END FUNCTION h5pexist_c + END INTERFACE + flag = .FALSE. + name_len = LEN(name) + hdferr = h5pexist_c(prp_id, name , name_len) + IF (hdferr > 0) THEN + flag = .TRUE. + hdferr = 0 + ENDIF + END SUBROUTINE h5pexist_f + +!****s* H5P/h5pget_size_f +! +! NAME +! h5pget_size_f +! +! PURPOSE +! Queries the size of a property value in bytes. +! +! INPUTS +! +! prp_id - property list identifier to query +! name - name of property to query +! OUTPUTS +! +! size - size of property in bytes +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! October 9, 2002 +! +! HISTORY +! +! +! Fortran90 Interface: + SUBROUTINE h5pget_size_f(prp_id, name, size, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to query + INTEGER(SIZE_T), INTENT(OUT) :: size ! Size in bytes + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + INTEGER :: name_len + + INTERFACE + INTEGER FUNCTION h5pget_size_c(prp_id, name, name_len, size) & + BIND(C,NAME='h5pget_size_c') + IMPORT :: C_CHAR + IMPORT :: HID_T, SIZE_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: name + INTEGER, INTENT(IN) :: name_len + INTEGER(SIZE_T), INTENT(OUT) :: size + END FUNCTION h5pget_size_c + END INTERFACE + name_len = LEN(name) + hdferr = h5pget_size_c(prp_id, name , name_len, size) + END SUBROUTINE h5pget_size_f + +!****s* H5P/h5pget_npros_f +! NAME +! h5pget_npros_f +! +! PURPOSE +! Queries number of properties in property list or class +! +! INPUTS +! +! prp_id - iproperty list identifier to query +! OUTPUTS +! +! nprops - number of properties in property object +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! October 9, 2002 +! +! Fortran90 Interface: + SUBROUTINE h5pget_nprops_f(prp_id, nprops, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER(SIZE_T), INTENT(OUT) :: nprops ! Number of properties + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + INTERFACE + INTEGER FUNCTION h5pget_nprops_c(prp_id, nprops) & + BIND(C,NAME='h5pget_nprops_c') + IMPORT :: HID_T, SIZE_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id + INTEGER(SIZE_T), INTENT(OUT) :: nprops + END FUNCTION h5pget_nprops_c + END INTERFACE + hdferr = h5pget_nprops_c(prp_id, nprops) + END SUBROUTINE h5pget_nprops_f + +!****s* H5P/h5pget_class_name_f +! NAME +! h5pget_class_name_f +! +! PURPOSE +! Queries the name of a class. +! +! INPUTS +! +! prp_id - property list identifier to query +! OUTPUTS +! +! name - name of a class +! size - Actual length of the class name +! NOTE: If provided buffer "name" is smaller, +! than name will be truncated to fit into +! provided user buffer. +! hdferr: - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! October 9, 2002 +! +! HISTORY +! Returned the size of name as an argument +! +! Fortran90 Interface: + SUBROUTINE h5pget_class_name_f(prp_id, name, size, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + CHARACTER(LEN=*), INTENT(OUT) :: name ! Buffer to retireve class name + INTEGER, INTENT(OUT) :: size ! Actual length of the class name + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + INTEGER :: name_len + + INTERFACE + INTEGER FUNCTION h5pget_class_name_c(prp_id, name, name_len) & + BIND(C,NAME='h5pget_class_name_c') + IMPORT :: C_CHAR + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(INOUT) :: name + INTEGER, INTENT(IN) :: name_len + END FUNCTION h5pget_class_name_c + END INTERFACE + + name_len = LEN(name) + size = h5pget_class_name_c(prp_id, name, name_len) + + hdferr = 0 + IF(size.LT.0) hdferr = -1 + + END SUBROUTINE h5pget_class_name_f + +!****s* H5P/h5pget_class_parent_f +! NAME +! h5pget_class_parent_f +! +! PURPOSE +! Retrieves the parent class of a genric property class. +! +! INPUTS +! +! prp_id - property list identifier to query +! OUTPUTS +! +! parent_id - identifier of the parent class +! hdferr: - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! October 9, 2002 +! +! Fortran90 Interface: + SUBROUTINE h5pget_class_parent_f(prp_id, parent_id, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER(HID_T), INTENT(OUT) :: parent_id ! Parent class property list + ! identifier + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + INTERFACE + INTEGER FUNCTION h5pget_class_parent_c(prp_id, parent_id) & + BIND(C,NAME='h5pget_class_parent_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id + INTEGER(HID_T), INTENT(OUT) :: parent_id + END FUNCTION h5pget_class_parent_c + END INTERFACE + hdferr = h5pget_class_parent_c(prp_id, parent_id) + END SUBROUTINE h5pget_class_parent_f + +!****s* H5P/h5pisa_class_f +! NAME +! h5pisa_class_f +! +! PURPOSE +! Determines whether a property list is a member of a class. +! +! INPUTS +! +! plist - property list identifier +! pclass - identifier of the property class +! OUTPUTS +! +! flag - .TRUE. if a member, .FALSE. otherwise +! hdferr: - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! October 9, 2002 +! +! Fortran90 Interface: + SUBROUTINE h5pisa_class_f(plist, pclass, flag, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: plist ! Property list identifier + INTEGER(HID_T), INTENT(IN) :: pclass ! Class identifier + LOGICAL, INTENT(OUT) :: flag ! logical flag + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + INTERFACE + INTEGER FUNCTION h5pisa_class_c(plist, pclass) & + BIND(C,NAME='h5pisa_class_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: plist + INTEGER(HID_T), INTENT(IN) :: pclass + END FUNCTION h5pisa_class_c + END INTERFACE + flag = .FALSE. + hdferr = h5pisa_class_c(plist, pclass) + IF (hdferr .GT. 0) THEN + flag = .TRUE. + hdferr = 0 + ENDIF + END SUBROUTINE h5pisa_class_f + +!****s* H5P/h5pcopy_prop_f +! NAME +! h5pcopy_prop_f +! +! PURPOSE +! Copies a property from one list or class to another. +! +! INPUTS +! +! dst_id - Identifier of the destination property list +! src_id - Identifier of the source property list +! name - name of the property to copy +! OUTPUTS +! +! hdferr: - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! October 9, 2002 +! +! Fortran90 Interface: + SUBROUTINE h5pcopy_prop_f(dst_id, src_id, name, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dst_id ! Destination property list + ! identifier + INTEGER(HID_T), INTENT(IN) :: src_id ! Source property list identifier + CHARACTER(LEN=*), INTENT(IN) :: name ! Property name + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + INTEGER :: name_len + + INTERFACE + INTEGER FUNCTION h5pcopy_prop_c(dst_id, src_id, name, name_len) & + BIND(C,NAME='h5pcopy_prop_c') + IMPORT :: C_CHAR + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dst_id + INTEGER(HID_T), INTENT(IN) :: src_id + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: name + INTEGER, INTENT(IN) :: name_len + END FUNCTION h5pcopy_prop_c + END INTERFACE + name_len = LEN(name) + hdferr = h5pcopy_prop_c(dst_id, src_id, name , name_len) + END SUBROUTINE h5pcopy_prop_f + +!****s* H5P/h5premove_f +! NAME +! h5premove_f +! +! PURPOSE +! Removes a property from a property list. + +! +! INPUTS +! +! plid - Property list identofoer +! name - name of the property to remove +! OUTPUTS +! +! hdferr: - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! October 9, 2002 +! +! Fortran90 Interface: + SUBROUTINE h5premove_f(plid, name, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: plid ! Property list identifier + CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to remove + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + INTEGER :: name_len + + INTERFACE + INTEGER FUNCTION h5premove_c(plid, name, name_len) & + BIND(C,NAME='h5premove_c') + IMPORT :: C_CHAR + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: plid + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: name + INTEGER, INTENT(IN) :: name_len + END FUNCTION h5premove_c + END INTERFACE + name_len = LEN(name) + hdferr = h5premove_c(plid, name , name_len) + END SUBROUTINE h5premove_f + +!****s* H5P/h5punregister_f +! NAME +! h5punregister_f +! +! PURPOSE +! Removes a property from a property list class. +! +! INPUTS +! +! class - Property list class identifier +! name - name of the property to remove +! OUTPUTS +! +! hdferr: - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! October 9, 2002 +! +! Fortran90 Interface: + SUBROUTINE h5punregister_f(class, name, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: class ! property list class identifier + CHARACTER(LEN=*), INTENT(IN) :: name ! name of property to remove + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + INTEGER :: name_len + + INTERFACE + INTEGER FUNCTION h5punregister_c(class, name, name_len) & + BIND(C,NAME='h5punregister_c') + IMPORT :: C_CHAR + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: class + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: name + INTEGER, INTENT(IN) :: name_len + END FUNCTION h5punregister_c + END INTERFACE + name_len = LEN(name) + hdferr = h5punregister_c(class, name , name_len) + END SUBROUTINE h5punregister_f + +!****s* H5P/h5pclose_class_f +! NAME +! h5pclose_class_f +! +! PURPOSE +! Closes an existing property list class. +! +! INPUTS +! +! class - Property list class identifier +! OUTPUTS +! +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! October 9, 2002 +! +! Fortran90 Interface: + SUBROUTINE h5pclose_class_f(class, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: class ! Property list class identifier + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + INTERFACE + INTEGER FUNCTION h5pclose_class_c(class) & + BIND(C,NAME='h5pclose_class_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: class + END FUNCTION h5pclose_class_c + END INTERFACE + hdferr = h5pclose_class_c(class) + END SUBROUTINE h5pclose_class_f + +!****s* H5P/h5pset_shuffle_f +! NAME +! h5pset_shuffle_f +! +! PURPOSE +! Sets shuffling filter +! +! INPUTS +! prp_id - dataset creation property list identifier +! OUTPUTS +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! March 12, 2003 +! +! Fortran90 Interface: + SUBROUTINE h5pset_shuffle_f(prp_id, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + INTERFACE + INTEGER FUNCTION h5pset_shuffle_c(prp_id) & + BIND(C,NAME='h5pset_shuffle_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id + END FUNCTION h5pset_shuffle_c + END INTERFACE + hdferr = h5pset_shuffle_c(prp_id) + + END SUBROUTINE h5pset_shuffle_f + +!****s* H5P/h5pset_edc_check_f +! NAME +! h5pset_edc_check_f +! +! PURPOSE +! Enables/disables error detecting +! +! INPUTS +! +! prp_id - dataset creation property list identifier +! flag - EDC flag; possible values: +! H5Z_DISABLE_EDC_F +! H5Z_ENABLE_EDC_F +! OUTPUTS +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! March 13, 2003 +! +! Fortran90 Interface: + SUBROUTINE h5pset_edc_check_f(prp_id, flag, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER, INTENT(IN) :: flag ! Checksum filter flag + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + INTERFACE + INTEGER FUNCTION h5pset_edc_check_c(prp_id, flag) & + BIND(C,NAME='h5pset_edc_check_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id + INTEGER, INTENT(IN) :: flag + END FUNCTION h5pset_edc_check_c + END INTERFACE + hdferr = h5pset_edc_check_c(prp_id, flag) + + END SUBROUTINE h5pset_edc_check_f + +!****s* H5P/h5pget_edc_check_f +! NAME +! h5pget_edc_check_f +! +! PURPOSE +! Queries error detecting +! +! INPUTS +! +! prp_id - dataset creation property list identifier +! OUTPUTS +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! March 13, 2003 +! +! Fortran90 Interface: + SUBROUTINE h5pget_edc_check_f(prp_id, flag, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Dataset transfer property list identifier + INTEGER, INTENT(OUT) :: flag ! Checksum filter flag + ! May have one of the following values: + ! H5Z_ERROR_EDC_F + ! H5Z_DISABLE_EDC_F + ! H5Z_ENABLE_EDC_F + ! H5Z_NO_EDC_F + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + INTERFACE + INTEGER FUNCTION h5pget_edc_check_c(prp_id, flag) & + BIND(C,NAME='h5pget_edc_check_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id + INTEGER, INTENT(OUT) :: flag + END FUNCTION h5pget_edc_check_c + END INTERFACE + hdferr = h5pget_edc_check_c(prp_id, flag) + + END SUBROUTINE h5pget_edc_check_f + +!****s* H5P/h5pset_fletcher32_f +! NAME +! h5pset_fletcher32_f +! +! PURPOSE +! Sets Fletcher32 checksum of EDC for a dataset creation +! property list. +! +! INPUTS +! +! prp_id - dataset creation property list identifier +! OUTPUTS +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! March 13, 2003 +! +! Fortran90 Interface: + SUBROUTINE h5pset_fletcher32_f(prp_id, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + INTERFACE + INTEGER FUNCTION h5pset_fletcher32_c(prp_id) & + BIND(C,NAME='h5pset_fletcher32_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id + END FUNCTION h5pset_fletcher32_c + END INTERFACE + hdferr = h5pset_fletcher32_c(prp_id) + + END SUBROUTINE h5pset_fletcher32_f + +!****s* H5P/ h5pset_family_offset_f +! NAME +! h5pset_family_offset_f +! +! PURPOSE +! Sets offset for family file driver. +! +! INPUTS +! +! prp_id - file creation property list identifier +! offset - file offset +! OUTPUTS +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! 19 March 2003 +! +! Fortran90 Interface: + SUBROUTINE h5pset_family_offset_f(prp_id, offset, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER(HSIZE_T), INTENT(IN) :: offset ! Offset in bytes + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + INTERFACE + INTEGER FUNCTION h5pset_family_offset_c(prp_id, offset) & + BIND(C,NAME='h5pset_family_offset_c') + IMPORT :: HID_T, HSIZE_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id + INTEGER(HSIZE_T), INTENT(IN) :: offset + END FUNCTION h5pset_family_offset_c + END INTERFACE + hdferr = h5pset_family_offset_c(prp_id, offset) + + END SUBROUTINE h5pset_family_offset_f + +!****s* H5P/h5pset_fapl_multi_l +! NAME +! h5pset_fapl_multi_l +! +! PURPOSE +! Sets up use of the multi-file driver. +! +! INPUTS +! +! prp_id - file creation property list identifier +! mem_map - mapping array +! memb_fapl - property list for each memory usage type +! memb_name - names of member file +! relax - flag +! OUTPUTS +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! 20 March 2003 +! +! Fortran90 Interface: + SUBROUTINE h5pset_fapl_multi_l(prp_id, memb_map, memb_fapl, memb_name, memb_addr, relax, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id + INTEGER, DIMENSION(*), INTENT(IN) :: memb_map + INTEGER(HID_T), DIMENSION(*), INTENT(IN) :: memb_fapl + CHARACTER(LEN=*), DIMENSION(*), INTENT(IN) :: memb_name + REAL, DIMENSION(*), INTENT(IN) :: memb_addr + LOGICAL, INTENT(IN) :: relax + INTEGER, INTENT(OUT) :: hdferr +!***** + INTEGER, DIMENSION(1:H5FD_MEM_NTYPES_F) :: lenm + INTEGER :: maxlen + INTEGER :: flag = 0 + INTEGER :: i + + INTERFACE + INTEGER FUNCTION h5pset_fapl_multi_c(prp_id, memb_map, memb_fapl, memb_name, lenm, & + maxlen, memb_addr, flag) & + BIND(C,NAME='h5pset_fapl_multi_c') + IMPORT :: C_CHAR + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! File creation property list identifier + INTEGER, DIMENSION(*), INTENT(IN) :: memb_map + INTEGER(HID_T), DIMENSION(*), INTENT(IN) :: memb_fapl + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: memb_name + REAL, DIMENSION(*), INTENT(IN) :: memb_addr + INTEGER, DIMENSION(*) :: lenm + INTEGER :: maxlen + INTEGER, INTENT(IN) :: flag + END FUNCTION h5pset_fapl_multi_c + END INTERFACE + + maxlen = LEN(memb_name(1)) + DO i=1, H5FD_MEM_NTYPES_F + lenm(i) = LEN_TRIM(memb_name(i)) + ENDDO + IF(relax) flag = 1 + hdferr = h5pset_fapl_multi_c(prp_id, memb_map, memb_fapl, memb_name, lenm, maxlen, memb_addr, flag) + + END SUBROUTINE h5pset_fapl_multi_l +!****s* H5P/h5pset_fapl_multi_s +! NAME +! h5pset_fapl_multi_s +! +! PURPOSE +! Sets up use of the multi-file driver. +! +! INPUTS +! +! prp_id - file creation property list identifier +! relax - flag +! OUTPUTS +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! 31 March 2003 +! +! Fortran90 Interface: + SUBROUTINE h5pset_fapl_multi_s(prp_id, relax, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! File creation property list identifier + LOGICAL, INTENT(IN) :: relax + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + INTEGER :: flag + + INTERFACE + INTEGER FUNCTION h5pset_fapl_multi_sc(prp_id,flag) & + BIND(C,NAME='h5pset_fapl_multi_sc') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! File creation property list identifier + INTEGER, INTENT(IN) :: flag + END FUNCTION h5pset_fapl_multi_sc + END INTERFACE + flag = 0 + IF (relax) flag = 1 + hdferr = h5pset_fapl_multi_sc(prp_id, flag) + + END SUBROUTINE h5pset_fapl_multi_s +!****s* H5P/h5pget_fapl_multi_f +! NAME +! h5pget_fapl_multi_f +! +! PURPOSE +! Sets up use of the multi-file driver. +! +! INPUTS +! +! prp_id - file creation property list identifier +! OUTPUTS +! +! mem_map - mapping array +! memb_fapl - property list for each memory usage type +! memb_name - names of member file +! relax - flag +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! OPTIONAL PARAMETERS +! maxlen_out - maximum length for memb_name array element +! +! AUTHOR +! Elena Pourmal +! 24 March 2003 +! +! Fortran90 Interface: + SUBROUTINE h5pget_fapl_multi_f(prp_id, memb_map, memb_fapl, memb_name, memb_addr, relax, hdferr, maxlen_out) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! File creation property list identifier + INTEGER, DIMENSION(*), INTENT(OUT) :: memb_map + INTEGER(HID_T), DIMENSION(*), INTENT(OUT) :: memb_fapl + CHARACTER(LEN=*), DIMENSION(*), INTENT(OUT) :: memb_name + REAL, DIMENSION(*), INTENT(OUT) :: memb_addr + INTEGER, OPTIONAL, INTENT(OUT) :: maxlen_out + LOGICAL, INTENT(OUT) :: relax + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + INTEGER, DIMENSION(1:H5FD_MEM_NTYPES_F) :: lenm + INTEGER :: maxlen + INTEGER :: c_maxlen_out + INTEGER :: flag + INTEGER :: i +! + INTERFACE + INTEGER FUNCTION h5pget_fapl_multi_c(prp_id, memb_map, memb_fapl, memb_name, lenm, & + maxlen, memb_addr, flag, c_maxlen_out) & + BIND(C,NAME='h5pget_fapl_multi_c') + IMPORT :: C_CHAR + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! File creation property list identifier + INTEGER, DIMENSION(*), INTENT(OUT) :: memb_map + INTEGER(HID_T), DIMENSION(*), INTENT(OUT) :: memb_fapl + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(OUT) :: memb_name + REAL, DIMENSION(*), INTENT(OUT) :: memb_addr + INTEGER, DIMENSION(*) :: lenm + INTEGER :: maxlen + INTEGER :: c_maxlen_out + INTEGER, INTENT(OUT) :: flag + END FUNCTION h5pget_fapl_multi_c + END INTERFACE + + maxlen = LEN(memb_name(1)) + DO i=1, H5FD_MEM_NTYPES_F + lenm(i) = LEN_TRIM(memb_name(i)) + ENDDO + hdferr = h5pget_fapl_multi_c(prp_id, memb_map, memb_fapl, memb_name, lenm, maxlen, memb_addr, flag, c_maxlen_out) + + relax = .TRUE. + IF(flag .EQ. 0) relax = .FALSE. + IF(PRESENT(maxlen_out)) maxlen_out = c_maxlen_out + END SUBROUTINE h5pget_fapl_multi_f +!****s* H5P/h5pset_szip_f +! NAME +! h5pset_szip_f +! +! PURPOSE +! Sets up use of szip compression +! +! INPUTS +! +! prp_id - dataset creation property list identifier +! options_mask - A bit-mask conveying the desired SZIP options. +! Current valid values in Fortran are: +! H5_SZIP_EC_OM_F +! H5_SZIP_NN_OM_F +! pixels_per_block - szip parameters +! OUTPUTS +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! April 10 2003 +! +! Fortran90 Interface: + SUBROUTINE h5pset_szip_f(prp_id, options_mask, pixels_per_block, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Dataset creation property + ! list identifier + INTEGER, INTENT(IN) :: options_mask ! A bit-mask conveying the desired + ! SZIP options + ! Current valid values in Fortran are: + ! H5_SZIP_EC_OM_F + ! H5_SZIP_NN_OM_F + INTEGER, INTENT(IN) :: pixels_per_block ! The number of pixels or data elements + ! in each data block + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + INTERFACE + INTEGER FUNCTION h5pset_szip_c(prp_id, options_mask, pixels_per_block) & + BIND(C,NAME='h5pset_szip_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! File creation property list identifier + INTEGER, INTENT(IN) :: options_mask + INTEGER, INTENT(IN) :: pixels_per_block + END FUNCTION h5pset_szip_c + END INTERFACE + hdferr = h5pset_szip_c(prp_id, options_mask, pixels_per_block) + + END SUBROUTINE h5pset_szip_f + +!****s* H5P/h5pall_filters_avail_f +! NAME +! h5pall_filters_avail_f +! +! PURPOSE +! Checks if all filters set in the dataset creation +! property list are available +! +! INPUTS +! +! prp_id - data creation property list identifier +! OUTPUTS +! +! flag - .TRUE. if all filters are available +! .FALSE. otherwise +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! April 10 2003 +! +! Fortran90 Interface: + SUBROUTINE h5pall_filters_avail_f(prp_id, flag, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Dataset creation property + ! list identifier + LOGICAL, INTENT(OUT) :: flag ! .TRUE. if all filters are available + ! .FALSE. otherwise + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + INTEGER :: status + + INTERFACE + INTEGER FUNCTION h5pall_filters_avail_c(prp_id, status) & + BIND(C,NAME='h5pall_filters_avail_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id + INTEGER, INTENT(OUT) :: status + END FUNCTION h5pall_filters_avail_c + END INTERFACE + flag = .TRUE. + hdferr = h5pall_filters_avail_c(prp_id, status) + IF (status .EQ. 0 ) flag = .FALSE. + + END SUBROUTINE h5pall_filters_avail_f + +!****s* H5P/h5pget_filter_by_id_f +! NAME +! h5pget_filter_by_id_f +! +! PURPOSE +! Returns information about a filter in a pipeline +! +! INPUTS +! +! prp_id - data creation or transfer property list +! identifier +! OUTPUTS +! +! filter_id - filter identifier +! flags - bit vector specifying certain general +! properties of the filter +! cd_nelmts - number of elements in cd_values +! cd_values - auxiliary data for the filter +! namelen - number of characters in the name buffer +! name - buffer to retrieve filter name +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! April 10 2003 +! +! Fortran90 Interface: + SUBROUTINE h5pget_filter_by_id_f(prp_id, filter_id, flags, cd_nelmts, cd_values, namelen, name, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER, INTENT(IN) :: filter_id ! Filter identifier + INTEGER(SIZE_T), INTENT(INOUT) :: cd_nelmts ! Number of elements in cd_values. + INTEGER, DIMENSION(*), INTENT(OUT) :: cd_values ! Auxiliary data for the filter. + INTEGER, INTENT(OUT) :: flags ! Bit vector specifying certain general + ! properties of the filter. + INTEGER(SIZE_T), INTENT(IN) :: namelen ! Anticipated number of characters in name. + CHARACTER(LEN=*), INTENT(OUT) :: name ! Name of the filter + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + INTERFACE + INTEGER FUNCTION h5pget_filter_by_id_c(prp_id, filter_id, flags, cd_nelmts, & + cd_values, namelen, name) & + BIND(C,NAME='h5pget_filter_by_id_c') + IMPORT :: C_CHAR + IMPORT :: HID_T, SIZE_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id + INTEGER, INTENT(IN) :: filter_id + INTEGER, DIMENSION(*), INTENT(OUT) :: cd_values + INTEGER, INTENT(OUT) :: flags + INTEGER(SIZE_T), INTENT(INOUT) :: cd_nelmts + INTEGER(SIZE_T), INTENT(IN) :: namelen + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(OUT) :: name + END FUNCTION h5pget_filter_by_id_c + END INTERFACE + + hdferr = h5pget_filter_by_id_c(prp_id, filter_id, flags, cd_nelmts, & + cd_values, namelen, name) + END SUBROUTINE h5pget_filter_by_id_f + +!****s* H5P/h5pmodify_filter_f +! NAME +! h5pmodify_filter_f +! +! PURPOSE +! Adds a filter to the filter pipeline. +! +! INPUTS +! +! prp_id - data creation or transfer property list +! identifier +! filter - filter to be modified +! flags - bit vector specifying certain general +! properties of the filter +! cd_nelmts - number of elements in cd_values +! cd_values - auxiliary data for the filter +! OUTPUTS +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! April 10 2003 +! +! Fortran90 Interface: + SUBROUTINE h5pmodify_filter_f(prp_id, filter, flags, cd_nelmts, cd_values, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER, INTENT(IN) :: filter ! Filter to be modified + INTEGER, INTENT(IN) :: flags ! Bit vector specifying certain general + ! properties of the filter + INTEGER(SIZE_T), INTENT(IN) :: cd_nelmts ! Number of elements in cd_values + INTEGER, DIMENSION(*), INTENT(IN) :: cd_values ! Auxiliary data for the filter + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + INTERFACE + INTEGER FUNCTION h5pmodify_filter_c(prp_id, filter, flags, cd_nelmts, cd_values) & + BIND(C,NAME='h5pmodify_filter_c') + IMPORT :: HID_T, SIZE_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id + INTEGER, INTENT(IN) :: filter + INTEGER, INTENT(IN) :: flags + INTEGER(SIZE_T), INTENT(IN) :: cd_nelmts + INTEGER, DIMENSION(*), INTENT(IN) :: cd_values + END FUNCTION h5pmodify_filter_c + END INTERFACE + + hdferr = h5pmodify_filter_c(prp_id, filter, flags, cd_nelmts, cd_values ) + END SUBROUTINE h5pmodify_filter_f + +!****s* H5P/h5premove_filter_f +! NAME +! h5premove_filter_f +! +! PURPOSE +! Delete one or more filters from the filter pipeline. +! +! INPUTS +! +! prp_id - data creation or transfer property list +! identifier +! filter - filter to be removed +! OUTPUTS +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Quincey Koziol +! January 27 2004 +! +! Fortran90 Interface: + SUBROUTINE h5premove_filter_f(prp_id, filter, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Dataset creation property list + ! identifier + INTEGER, INTENT(IN) :: filter ! Filter to be removed + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + INTERFACE + INTEGER FUNCTION h5premove_filter_c(prp_id, filter) & + BIND(C,NAME='h5premove_filter_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id + INTEGER, INTENT(IN) :: filter + END FUNCTION h5premove_filter_c + END INTERFACE + + hdferr = h5premove_filter_c(prp_id, filter) + END SUBROUTINE h5premove_filter_f + +!****s* H5P/H5Pget_attr_phase_change_f +! NAME +! H5Pget_attr_phase_change_f +! +! PURPOSE +! Retrieves attribute storage phase change thresholds +! +! INPUTS +! +! ocpl_id - Object (dataset or group) creation property list identifier +! OUTPUTS +! +! max_compact - Maximum number of attributes to be stored in compact storage +! (Default: 8) +! min_dense - Minimum number of attributes to be stored in dense storage +! (Default: 6) +! hdferr - Error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! M. Scot Breitenfeld +! January, 2008 +! +! Fortran90 Interface: + SUBROUTINE h5pget_attr_phase_change_f(ocpl_id, max_compact, min_dense, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: ocpl_id ! Object (dataset or group) creation property list identifier + INTEGER, INTENT(OUT) :: max_compact ! Maximum number of attributes to be stored in compact storage + ! (Default: 8) + INTEGER, INTENT(OUT) :: min_dense ! Minimum number of attributes to be stored in dense storage + ! (Default: 6) + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + INTERFACE + INTEGER FUNCTION h5pget_attr_phase_change_c(ocpl_id, max_compact, min_dense) & + BIND(C,NAME='h5pget_attr_phase_change_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: ocpl_id + INTEGER, INTENT(OUT) :: max_compact + INTEGER, INTENT(OUT) :: min_dense + + END FUNCTION h5pget_attr_phase_change_c + END INTERFACE + + hdferr = h5pget_attr_phase_change_c(ocpl_id, max_compact, min_dense) + END SUBROUTINE h5pget_attr_phase_change_f + +!****s* H5P/H5Pset_attr_creation_order_f +! NAME +! H5Pset_attr_creation_order_f +! +! PURPOSE +! Sets tracking and indexing of attribute creation order +! +! INPUTS +! +! ocpl_id - Object creation property list identifier +! crt_order_flags - Flags specifying whether to track and index attribute creation order +! OUTPUTS +! +! hdferr - Error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! M. Scot Breitenfeld +! January, 2008 +! +! Fortran90 Interface: + SUBROUTINE h5pset_attr_creation_order_f(ocpl_id, crt_order_flags , hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: ocpl_id ! Object (dataset or group) creation property list identifier + INTEGER, INTENT(IN) :: crt_order_flags ! Flags specifying whether to track and index attribute creation order + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + INTERFACE + INTEGER FUNCTION H5Pset_attr_creation_order_c(ocpl_id, crt_order_flags) & + BIND(C,NAME='h5pset_attr_creation_order_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: ocpl_id + INTEGER, INTENT(IN) :: crt_order_flags + + END FUNCTION H5Pset_attr_creation_order_c + END INTERFACE + + hdferr = H5Pset_attr_creation_order_c(ocpl_id, crt_order_flags) + END SUBROUTINE h5pset_attr_creation_order_f + +!****s* H5P/H5Pset_shared_mesg_nindexes_f +! NAME +! H5Pset_shared_mesg_nindexes_f +! +! PURPOSE +! Sets number of shared object header message indexes +! +! INPUTS +! +! plist_id - file creation property list +! nindexes - Number of shared object header message indexes to be available in files created with this property list +! OUTPUTS +! +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! M. Scot Breitenfeld +! January, 2008 +! +! Fortran90 Interface: + SUBROUTINE h5pset_shared_mesg_nindexes_f( plist_id, nindexes, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: plist_id ! File creation property list + INTEGER, INTENT(IN) :: nindexes ! Number of shared object header message indexes + ! available in files created WITH this property list + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** +! +! MS FORTRAN needs explicit interface for C functions called here. +! + INTERFACE + INTEGER FUNCTION h5pset_shared_mesg_nindexes_c(plist_id, nindexes) & + BIND(C,NAME='h5pset_shared_mesg_nindexes_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: plist_id + INTEGER, INTENT(IN) :: nindexes + + END FUNCTION H5pset_shared_mesg_nindexes_c + END INTERFACE + + hdferr = h5pset_shared_mesg_nindexes_c(plist_id, nindexes) + + END SUBROUTINE h5pset_shared_mesg_nindexes_f + +!****s* H5P/H5Pset_shared_mesg_index_f +! NAME +! H5Pset_shared_mesg_index_f +! +! PURPOSE +! Configures the specified shared object header message index +! +! INPUTS +! +! fcpl_id - File creation property list identifier. +! index_num - Index being configured. +! mesg_type_flags - Types of messages that should be stored in this index. +! min_mesg_size - Minimum message size. +! +! OUTPUTS +! +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! M. Scot Breitenfeld +! January, 2008 +! +! Fortran90 Interface: + SUBROUTINE h5pset_shared_mesg_index_f(fcpl_id, index_num, mesg_type_flags, min_mesg_size, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: fcpl_id ! file creation property list + INTEGER, INTENT(IN) :: index_num ! Index being configured. + INTEGER, INTENT(IN) :: mesg_type_flags ! Types of messages that should be stored in this index. + INTEGER, INTENT(IN) :: min_mesg_size ! Minimum message size. + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** +! +! MS FORTRAN needs explicit interface for C functions called here. +! + INTERFACE + INTEGER FUNCTION h5pset_shared_mesg_index_c(fcpl_id, index_num, mesg_type_flags, min_mesg_size) & + BIND(C,NAME='h5pset_shared_mesg_index_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: fcpl_id + INTEGER, INTENT(IN) :: index_num + INTEGER, INTENT(IN) :: mesg_type_flags + INTEGER, INTENT(IN) :: min_mesg_size + END FUNCTION H5pset_shared_mesg_index_c + END INTERFACE + + hdferr = h5pset_shared_mesg_index_c(fcpl_id, index_num, mesg_type_flags, min_mesg_size) + + END SUBROUTINE h5pset_shared_mesg_index_f + +!****s* H5P/H5Pget_attr_creation_order_f +! NAME +! H5Pget_attr_creation_order_f +! +! PURPOSE +! Retrieves tracking and indexing settings for attribute creation order +! +! INPUTS +! +! ocpl_id - Object (group or dataset) creation property list identifier +! +! OUTPUTS +! +! crt_order_flags - Flags specifying whether to track and index attribute creation order +! hdferr - Error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! M. Scot Breitenfeld +! February, 2008 +! +! Fortran90 Interface: + SUBROUTINE h5pget_attr_creation_order_f(ocpl_id, crt_order_flags, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: ocpl_id ! Object (group or dataset) creation property list identifier + INTEGER, INTENT(OUT) :: crt_order_flags ! Flags specifying whether to track and index attribute creation order + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** +! +! MS FORTRAN needs explicit interface for C functions called here. +! + INTERFACE + INTEGER FUNCTION h5pget_attr_creation_order_c(ocpl_id, crt_order_flags) & + BIND(C,NAME='h5pget_attr_creation_order_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: ocpl_id + INTEGER, INTENT(OUT) :: crt_order_flags + END FUNCTION H5pget_attr_creation_order_c + END INTERFACE + + hdferr = h5pget_attr_creation_order_c(ocpl_id, crt_order_flags) + + END SUBROUTINE h5pget_attr_creation_order_f + +!****s* H5P/H5Pset_libver_bounds_f +! NAME +! H5Pset_libver_bounds_f +! +! PURPOSE +! Sets bounds on library versions, and indirectly format versions, to be used when creating objects. +! +! INPUTS +! +! fapl_id - File access property list identifier +! low - The earliest version of the library that will be used for writing objects. +! high - The latest version of the library that will be used for writing objects. +! +! OUTPUTS +! +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! M. Scot Breitenfeld +! February 18, 2008 +! +! Fortran90 Interface: + SUBROUTINE h5pset_libver_bounds_f(fapl_id, low, high, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: fapl_id ! File access property list identifier + INTEGER, INTENT(IN) :: low ! The earliest version of the library that will be used for writing objects. + ! Currently, low must be one of two pre-defined values: + ! HDF_LIBVER_EARLIEST_F + ! HDF_LIBVER_LATEST_F + INTEGER, INTENT(IN) :: high ! The latest version of the library that will be used for writing objects. + ! Currently, low must set to the pre-defined value: + ! HDF_LIBVER_LATEST_F + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** +! +! MS FORTRAN needs explicit interface for C functions called here. +! + INTERFACE + INTEGER FUNCTION h5pset_libver_bounds_c(fapl_id, low, high) & + BIND(C,NAME='h5pset_libver_bounds_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: fapl_id + INTEGER, INTENT(IN) :: low + INTEGER, INTENT(IN) :: high + + END FUNCTION H5pset_libver_bounds_c + END INTERFACE + + hdferr = h5pset_libver_bounds_c(fapl_id, low, high) + + END SUBROUTINE h5pset_libver_bounds_f + +!****s* H5P/H5Pset_link_creation_order_f +! NAME +! H5Pset_link_creation_order_f +! +! PURPOSE +! Sets creation order tracking and indexing for links in a group. +! +! INPUTS +! +! gcpl_id - Group creation property list identifier +! crt_order_flags - Creation order flag(s) +! +! OUTPUTS +! +! hdferr - Error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! M. Scot Breitenfeld +! February 18, 2008 +! +! Fortran90 Interface: + SUBROUTINE h5pset_link_creation_order_f(gcpl_id, crt_order_flags, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: gcpl_id ! File access property list identifier + INTEGER, INTENT(IN) :: crt_order_flags ! Creation order flag(s) + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + INTERFACE + INTEGER FUNCTION h5pset_link_creation_order_c(gcpl_id, crt_order_flags) & + BIND(C,NAME='h5pset_link_creation_order_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: gcpl_id + INTEGER, INTENT(IN) :: crt_order_flags + + END FUNCTION H5pset_link_creation_order_c + END INTERFACE + + hdferr = h5pset_link_creation_order_c(gcpl_id, crt_order_flags) + + END SUBROUTINE h5pset_link_creation_order_f + +!****s* H5P/H5Pget_link_phase_change_f +! NAME +! H5Pget_link_phase_change_f +! +! PURPOSE +! Queries the settings for conversion between compact and dense groups. +! +! INPUTS +! +! gcpl_id - Group creation property list identifier +! OUTPUTS +! +! max_compact - Maximum number of attributes to be stored in compact storage +! min_dense - Minimum number of attributes to be stored in dense storage +! hdferr - Error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! M. Scot Breitenfeld +! February 20, 2008 +! +! Fortran90 Interface: + SUBROUTINE h5pget_link_phase_change_f(gcpl_id, max_compact, min_dense, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: gcpl_id ! Group creation property list identifier + INTEGER, INTENT(OUT) :: max_compact ! Maximum number of attributes to be stored in compact storage + INTEGER, INTENT(OUT) :: min_dense ! Minimum number of attributes to be stored in dense storage + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + INTERFACE + INTEGER FUNCTION h5pget_link_phase_change_c(gcpl_id, max_compact, min_dense) & + BIND(C,NAME='h5pget_link_phase_change_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: gcpl_id + INTEGER, INTENT(OUT) :: max_compact + INTEGER, INTENT(OUT) :: min_dense + + END FUNCTION h5pget_link_phase_change_c + END INTERFACE + + hdferr = h5pget_link_phase_change_c(gcpl_id, max_compact, min_dense) + END SUBROUTINE h5pget_link_phase_change_f + +!****s* H5P/H5Pget_obj_track_times_f +! NAME +! H5Pget_obj_track_times_f +! +! PURPOSE +! Returns whether times are tracked for an object. +! +! INPUTS +! +! plist_id - property list id +! flag - object timestamp setting +! .TRUE.,.FALSE. +! OUTPUTS +! +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! M. Scot Breitenfeld +! February 22, 2008 +! +! Fortran90 Interface: + SUBROUTINE h5pget_obj_track_times_f(plist_id, flag, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: plist_id ! Dataset creation property + ! list identifier + LOGICAL, INTENT(OUT) :: flag ! Object timestamp setting + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + INTEGER :: status +! +! MS FORTRAN needs explicit interface for C functions called here. +! + INTERFACE + INTEGER FUNCTION h5pget_obj_track_times_c(plist_id, status) & + BIND(C,NAME='h5pget_obj_track_times_c') + IMPORT :: HID_T + INTEGER(HID_T), INTENT(IN) :: plist_id ! File creation property list identifier + INTEGER, INTENT(OUT) :: status + END FUNCTION h5pget_obj_track_times_c + END INTERFACE + flag = .TRUE. + hdferr = h5pget_obj_track_times_c(plist_id, status) + IF(status.EQ.0) flag = .FALSE. + + END SUBROUTINE h5pget_obj_track_times_f + +!****s* H5P/H5Pset_obj_track_times_f +! NAME +! H5Pset_obj_track_times_f +! +! PURPOSE +! Set whether the birth, access, modification & change times for +! an object are stored. +! +! Birth time is the time the object was created. Access time is +! the last time that metadata or raw data was read from this +! object. Modification time is the last time the data for +! this object was changed (either writing raw data to a dataset +! or inserting/modifying/deleting a link in a group). Change +! time is the last time the metadata for this object was written +! (adding/modifying/deleting an attribute on an object, extending +! the size of a dataset, etc). +! +! If these times are not tracked, they will be reported as +! 12:00 AM UDT, Jan. 1, 1970 (i.e. 0 seconds past the UNIX +! epoch) when queried. +! +! INPUTS +! +! plist_id - property list id +! flag - object timestamp setting +! .TRUE.,.FALSE. +! OUTPUTS +! +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! M. Scot Breitenfeld +! February 22, 2008 +! +! +! Fortran90 Interface: + SUBROUTINE h5pset_obj_track_times_f(plist_id, flag, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: plist_id ! Dataset creation property + ! list identifier + LOGICAL, INTENT(IN) :: flag ! Object timestamp setting + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + INTEGER :: status +! +! MS FORTRAN needs explicit interface for C functions called here. +! + INTERFACE + INTEGER FUNCTION h5pset_obj_track_times_c(plist_id, status) & + BIND(C,NAME='h5pset_obj_track_times_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: plist_id ! File creation property list identifier + INTEGER, INTENT(IN) :: status + END FUNCTION h5pset_obj_track_times_c + END INTERFACE + + status = 0 + IF(flag) status = 1 + + hdferr = h5pset_obj_track_times_c(plist_id, status) + + END SUBROUTINE h5pset_obj_track_times_f + +!****s* H5P/H5Pset_create_inter_group_f +! NAME +! H5Pset_create_inter_group_f +! +! PURPOSE +! Specifies in property list whether to create missing intermediate groups. +! +! INPUTS +! +! lcpl_id - Link creation property list identifier +! crt_intermed_group - crt_intermed_group specifying whether +! to create intermediate groups upon the creation +! of an object +! OUTPUTS +! +! hdferr - Error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! M. Scot Breitenfeld +! February 22, 2008 +! +! HISTORY +! The long subroutine name (>31) on older f90 compilers causes problems +! so had to shorten the name +! Fortran90 Interface: + SUBROUTINE h5pset_create_inter_group_f(lcpl_id, crt_intermed_group, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: lcpl_id ! Link creation property list identifier + INTEGER, INTENT(IN) :: crt_intermed_group ! specifying whether to create intermediate groups + ! upon the creation of an object + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + INTERFACE + INTEGER FUNCTION h5pset_create_inter_group_c(lcpl_id, crt_intermed_group) & + BIND(C,NAME='h5pset_create_inter_group_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: lcpl_id + INTEGER, INTENT(IN) :: crt_intermed_group + END FUNCTION h5pset_create_inter_group_c + END INTERFACE + + hdferr = h5pset_create_inter_group_c(lcpl_id, crt_intermed_group) + + END SUBROUTINE h5pset_create_inter_group_f + +!****s* H5P/H5Pget_link_creation_order_f +! NAME +! H5Pget_link_creation_order_f +! +! PURPOSE +! Queries whether link creation order is tracked and/or indexed in a group. +! +! INPUTS +! +! gcpl_id - Group creation property list identifier +! +! OUTPUTS +! +! crt_order_flags - Creation order flag(s) +! hdferr - Error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! M. Scot Breitenfeld +! March 3, 2008 +! +! Fortran90 Interface: + SUBROUTINE h5pget_link_creation_order_f(gcpl_id, crt_order_flags, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: gcpl_id ! Group creation property list identifier + INTEGER, INTENT(OUT) :: crt_order_flags ! Creation order flag(s) + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + INTERFACE + INTEGER FUNCTION h5pget_link_creation_order_c(gcpl_id, crt_order_flags) & + BIND(C,NAME='h5pget_link_creation_order_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: gcpl_id + INTEGER, INTENT(OUT) :: crt_order_flags + + END FUNCTION H5pget_link_creation_order_c + END INTERFACE + + hdferr = h5pget_link_creation_order_c(gcpl_id, crt_order_flags) + + END SUBROUTINE h5pget_link_creation_order_f + +!****s* H5P/H5Pset_char_encoding_f +! NAME +! H5Pset_char_encoding_f +! +! PURPOSE +! Sets the character encoding used to encode a string. +! +! INPUTS +! +! plist_id - Property list identifier +! encoding - Valid values for encoding are: +! H5T_CSET_ASCII_F -> US ASCII +! H5T_CSET_UTF8_F -> UTF-8 Unicode encoding +! +! OUTPUTS +! hdferr - Error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! M. Scot Breitenfeld +! March 3, 2008 +! +! Fortran90 Interface: + SUBROUTINE h5pset_char_encoding_f(plist_id, encoding, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: plist_id ! Property list identifier + INTEGER, INTENT(IN) :: encoding ! String encoding character set: + ! H5T_CSET_ASCII_F -> US ASCII + ! H5T_CSET_UTF8_F -> UTF-8 Unicode encoding + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + INTERFACE + INTEGER FUNCTION h5pset_char_encoding_c(plist_id, encoding) & + BIND(C,NAME='h5pset_char_encoding_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: plist_id + INTEGER, INTENT(IN) :: encoding + + END FUNCTION H5pset_char_encoding_c + END INTERFACE + + hdferr = h5pset_char_encoding_c(plist_id, encoding) + + END SUBROUTINE h5pset_char_encoding_f + +!****s* H5P/H5Pget_char_encoding_f +! NAME +! H5Pget_char_encoding_f +! +! PURPOSE +! Retrieves the character encoding used to create a string +! +! INPUTS +! +! plist_id - Property list identifier +! +! OUTPUTS +! +! encoding - Valid values for encoding are: +! H5T_CSET_ASCII_F -> US ASCII +! H5T_CSET_UTF8_F -> UTF-8 Unicode encoding +! hdferr - Error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! M. Scot Breitenfeld +! March 3, 2008 +! +! Fortran90 Interface: + SUBROUTINE h5pget_char_encoding_f(plist_id, encoding, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: plist_id ! Property list identifier + + INTEGER, INTENT(OUT) :: encoding ! Valid values for encoding are: + ! H5T_CSET_ASCII_F -> US ASCII + ! H5T_CSET_UTF8_F -> UTF-8 Unicode encoding + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + INTERFACE + INTEGER FUNCTION h5pget_char_encoding_c(plist_id, encoding) & + BIND(C,NAME='h5pget_char_encoding_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: plist_id + INTEGER, INTENT(OUT) :: encoding + + END FUNCTION H5pget_char_encoding_c + END INTERFACE + + hdferr = h5pget_char_encoding_c(plist_id, encoding) + + END SUBROUTINE h5pget_char_encoding_f + +!****s* H5P/h5pset_copy_object_f +! NAME +! h5pset_copy_object_f +! +! PURPOSE +! Sets properties to be used when an object is copied. +! +! INPUTS +! +! ocp_plist_id - Object copy property list identifier +! copy_options - Copy option(s) to be set +! OUTPUTS +! +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! M. Scot Breitenfeld +! March 3, 2008 +! +! HISTORY +! +! +! Fortran90 Interface: + SUBROUTINE h5pset_copy_object_f(ocp_plist_id, copy_options, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: ocp_plist_id ! Object copy property list identifier + INTEGER, INTENT(IN) :: copy_options ! Copy option(s) to be set, valid options are: + ! H5O_COPY_SHALLOW_HIERARCHY_F + ! H5O_COPY_EXPAND_SOFT_LINK_F + ! H5O_COPY_EXPAND_EXT_LINK_F + ! H5O_COPY_EXPAND_REFERENCE_F + ! H5O_COPY_WITHOUT_ATTR_FLAG_F + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + INTERFACE + INTEGER FUNCTION h5pset_copy_object_c(ocp_plist_id, copy_options) & + BIND(C,NAME='h5pset_copy_object_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: ocp_plist_id + INTEGER, INTENT(IN) :: copy_options + END FUNCTION h5pset_copy_object_c + END INTERFACE + hdferr = h5pset_copy_object_c(ocp_plist_id, copy_options) + END SUBROUTINE h5pset_copy_object_f + +!****s* H5P/h5pget_copy_object_f +! NAME +! h5pget_copy_object_f +! +! PURPOSE +! Retrieves the properties to be used when an object is copied. +! +! INPUTS +! +! ocp_plist_id - Object copy property list identifier +! OUTPUTS +! +! copy_options - Copy option(s) to be get +! hdferr - Error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! M. Scot Breitenfeld +! March 3, 2008 +! +! HISTORY +! +! +! Fortran90 Interface: + SUBROUTINE h5pget_copy_object_f(ocp_plist_id, copy_options, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: ocp_plist_id ! Object copy property list identifier + INTEGER, INTENT(OUT) :: copy_options ! Valid copy options returned are: + ! H5O_COPY_SHALLOW_HIERARCHY_F + ! H5O_COPY_EXPAND_SOFT_LINK_F + ! H5O_COPY_EXPAND_EXT_LINK_F + ! H5O_COPY_EXPAND_REFERENCE_F + ! H5O_COPY_WITHOUT_ATTR_FLAG_F + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + INTERFACE + INTEGER FUNCTION h5pget_copy_object_c(ocp_plist_id, copy_options) & + BIND(C,NAME='h5pget_copy_object_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: ocp_plist_id + INTEGER, INTENT(OUT) :: copy_options + END FUNCTION h5pget_copy_object_c + END INTERFACE + hdferr = h5pget_copy_object_c(ocp_plist_id, copy_options) + END SUBROUTINE h5pget_copy_object_f + +!****s* H5P/h5pget_data_transform_f +! NAME +! h5pget_data_transform_f +! +! PURPOSE +! Retrieves a data transform expression. +! +! INPUTS +! +! plist_id - Identifier of the property list or class +! OUTPUTS +! +! expression - buffer to hold transform expression +! hdferr - Error code +! Success: Actual lenght of the expression +! If provided buffer "expression" is +! smaller, than expression will be +! truncated to fit into +! provided user buffer +! Failure: -1 +! +! AUTHOR +! M. Scot Breitenfeld +! March 19, 2008 +! +! HISTORY +! +! Should hdferr return just 0 or 1 and add another arguement for the size? +! Fortran90 Interface: +SUBROUTINE h5pget_data_transform_f(plist_id, expression, hdferr, size) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: plist_id ! Identifier of the property list or class + CHARACTER(LEN=*), INTENT(OUT) :: expression ! Buffer to hold transform expression + INTEGER(SIZE_T), INTENT(OUT), OPTIONAL :: size ! Registered size of the transform expression + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + INTEGER :: expression_len + INTEGER(SIZE_T) :: size_default + + INTERFACE + INTEGER FUNCTION h5pget_data_transform_c(plist_id, expression, expression_len, size_default) & + BIND(C,NAME='h5pget_data_transform_c') + IMPORT :: C_CHAR + IMPORT :: HID_T, SIZE_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: plist_id + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(OUT) :: expression + INTEGER(SIZE_T) :: size_default + INTEGER :: expression_len + END FUNCTION h5pget_data_transform_c + END INTERFACE + + size_default = 0 + expression_len = LEN(expression) + + hdferr = h5pget_data_transform_c(plist_id, expression, expression_len, size_default) + + IF(present(size)) size = size_default + + END SUBROUTINE h5pget_data_transform_f + +!****s* H5P/h5pset_data_transform_f +! NAME +! h5pset_data_transform_f +! +! PURPOSE +! Sets a data transform expression. +! +! INPUTS +! +! plist_id - Identifier of the property list or class +! expression - Buffer to hold transform expression +! OUTPUTS +! +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! M. Scot Breitenfeld +! March 19, 2008 +! +! Fortran90 Interface: + SUBROUTINE h5pset_data_transform_f(plist_id, expression, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: plist_id ! Identifier of the property list or class + CHARACTER(LEN=*), INTENT(IN) :: expression ! Buffer to hold transform expression + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + INTEGER :: expression_len + + INTERFACE + INTEGER FUNCTION h5pset_data_transform_c(plist_id, expression, expression_len) & + BIND(C,NAME='h5pset_data_transform_c') + IMPORT :: C_CHAR + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: plist_id + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: expression + INTEGER :: expression_len + END FUNCTION h5pset_data_transform_c + END INTERFACE + + expression_len = LEN(expression) + hdferr = h5pset_data_transform_c(plist_id, expression, expression_len) + + END SUBROUTINE h5pset_data_transform_f + +!****s* H5P/H5Pget_local_heap_size_hint_f +! NAME +! H5Pget_local_heap_size_hint_f +! +! PURPOSE +! Queries the local heap size hint for original-style groups. +! +! INPUTS +! +! gcpl_id - Group creation property list identifier +! OUTPUTS +! +! size_hint - Hint for size of local heap +! hdferr - Error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! M. Scot Breitenfeld +! March 21, 2008 +! +! Fortran90 Interface: + SUBROUTINE h5pget_local_heap_size_hint_f(gcpl_id, size_hint, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: gcpl_id ! Group creation property list identifier + INTEGER(SIZE_T), INTENT(OUT) :: size_hint ! Hint for size of local heap + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + INTERFACE + INTEGER FUNCTION h5pget_local_heap_size_hint_c(gcpl_id, size_hint) & + BIND(C,NAME='h5pget_local_heap_size_hint_c') + IMPORT :: HID_T, SIZE_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: gcpl_id + INTEGER(SIZE_T), INTENT(OUT) :: size_hint + END FUNCTION H5Pget_local_heap_size_hint_c + END INTERFACE + + hdferr = H5Pget_local_heap_size_hint_c(gcpl_id, size_hint) + + END SUBROUTINE h5pget_local_heap_size_hint_f + +!****s* H5P/H5Pget_est_link_info_f +! NAME +! H5Pget_est_link_info_f +! +! PURPOSE +! Queries data required to estimate required local heap or object header size. +! +! INPUTS +! +! gcpl_id - Group creation property list identifier +! OUTPUTS +! +! est_num_entries - Estimated number of links to be inserted into group +! est_name_len - Estimated average length of link names +! hdferr - Error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! M. Scot Breitenfeld +! March 21, 2008 +! +! HISTORY +! +! +! Fortran90 Interface: + SUBROUTINE h5pget_est_link_info_f(gcpl_id, est_num_entries, est_name_len, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: gcpl_id ! Group creation property list identifier + INTEGER, INTENT(OUT) :: est_num_entries ! Estimated number of links to be inserted into group + INTEGER, INTENT(OUT) :: est_name_len ! Estimated average length of link names + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + INTERFACE + INTEGER FUNCTION h5pget_est_link_info_c(gcpl_id, est_num_entries, est_name_len) & + BIND(C,NAME='h5pget_est_link_info_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: gcpl_id + INTEGER, INTENT(OUT) :: est_num_entries + INTEGER, INTENT(OUT) :: est_name_len + END FUNCTION h5pget_est_link_info_c + END INTERFACE + + hdferr = h5pget_est_link_info_c(gcpl_id, est_num_entries, est_name_len) + + END SUBROUTINE h5pget_est_link_info_f + +!****s* H5P/H5Pset_local_heap_size_hint_f +! NAME +! H5Pset_local_heap_size_hint_f +! +! PURPOSE +! Sets the local heap size hint for original-style groups. +! +! INPUTS +! +! gcpl_id - Group creation property list identifier +! size_hint - Hint for size of local heap +! OUTPUTS +! +! hdferr - Error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! M. Scot Breitenfeld +! March 21, 2008 +! +! Fortran90 Interface: + SUBROUTINE h5pset_local_heap_size_hint_f(gcpl_id, size_hint, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: gcpl_id ! Group creation property list identifier + INTEGER(SIZE_T), INTENT(IN) :: size_hint ! Hint for size of local heap + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + INTERFACE + INTEGER FUNCTION h5pset_local_heap_size_hint_c(gcpl_id, size_hint) & + BIND(C,NAME='h5pset_local_heap_size_hint_c') + IMPORT :: HID_T, SIZE_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: gcpl_id + INTEGER(SIZE_T), INTENT(IN) :: size_hint + END FUNCTION h5pset_local_heap_size_hint_c + END INTERFACE + + hdferr = H5Pset_local_heap_size_hint_c(gcpl_id, size_hint) + + END SUBROUTINE h5pset_local_heap_size_hint_f + +!****s* H5P/h5pset_est_link_info_f +! NAME +! h5pset_est_link_info_f +! +! PURPOSE +! Sets estimated number of links and length of link names in a group. +! +! INPUTS +! +! gcpl_id - Group creation property list identifier +! est_num_entries - Estimated number of links to be inserted into group +! est_name_len - Estimated average length of link names +! OUTPUTS +! +! hdferr - Error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! M. Scot Breitenfeld +! March 21, 2008 +! +! Fortran90 Interface: + SUBROUTINE h5pset_est_link_info_f(gcpl_id, est_num_entries, est_name_len, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: gcpl_id ! Group creation property list identifier + INTEGER, INTENT(IN) :: est_num_entries ! Estimated number of links to be inserted into group + INTEGER, INTENT(IN) :: est_name_len ! Estimated average length of link names + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + INTERFACE + INTEGER FUNCTION h5pset_est_link_info_c(gcpl_id, est_num_entries, est_name_len) & + BIND(C,NAME='h5pset_est_link_info_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: gcpl_id + INTEGER, INTENT(IN) :: est_num_entries + INTEGER, INTENT(IN) :: est_name_len + END FUNCTION h5pset_est_link_info_c + END INTERFACE + + hdferr = H5Pset_est_link_info_c(gcpl_id, est_num_entries, est_name_len) + + END SUBROUTINE h5pset_est_link_info_f + +!****s* H5P/h5pset_link_phase_change_f +! NAME +! h5pset_link_phase_change_f +! +! PURPOSE +! Sets the parameters for conversion between compact and dense groups. +! +! INPUTS +! +! gcpl_id - Group creation property list identifier +! max_compact - Maximum number of attributes to be stored in compact storage +! min_dense - Minimum number of attributes to be stored in dense storage +! OUTPUTS +! +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! M. Scot Breitenfeld +! March 21, 2008 +! +! Fortran90 Interface: +SUBROUTINE h5pset_link_phase_change_f(gcpl_id, max_compact, min_dense, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: gcpl_id ! Group creation property list identifier + INTEGER, INTENT(IN) :: max_compact ! Maximum number of attributes to be stored in compact storage + INTEGER, INTENT(IN) :: min_dense ! Minimum number of attributes to be stored in dense storage + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + INTERFACE + INTEGER FUNCTION h5pset_link_phase_change_c(gcpl_id, max_compact, min_dense) & + BIND(C,NAME='h5pset_link_phase_change_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: gcpl_id + INTEGER, INTENT(IN) :: max_compact + INTEGER, INTENT(IN) :: min_dense + END FUNCTION h5pset_link_phase_change_c + END INTERFACE + + hdferr = h5pset_link_phase_change_c(gcpl_id, max_compact, min_dense) + END SUBROUTINE h5pset_link_phase_change_f + +!****s* H5P/h5pset_fapl_direct_f +! NAME +! h5pset_fapl_direct_f +! +! PURPOSE +! Sets up use of the direct I/O driver. +! +! INPUTS +! +! fapl_id - File access property list identifier +! alignment - Required memory alignment boundary +! block_size - File system block size +! cbuf_size - Copy buffer size +! OUTPUTS +! +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! M. Scot Breitenfeld +! March 21, 2008 +! +! Fortran90 Interface: +SUBROUTINE h5pset_fapl_direct_f(fapl_id, alignment, block_size, cbuf_size, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: fapl_id ! File access property list identifier + INTEGER(SIZE_T), INTENT(IN) :: alignment ! Required memory alignment boundary! + INTEGER(SIZE_T), INTENT(IN) :: block_size ! File system block size + INTEGER(SIZE_T), INTENT(IN) :: cbuf_size ! Copy buffer size + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + INTERFACE + INTEGER FUNCTION h5pset_fapl_direct_c(fapl_id, alignment, block_size, cbuf_size) & + BIND(C,NAME='h5pset_fapl_direct_c') + IMPORT :: HID_T, SIZE_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: fapl_id + INTEGER(SIZE_T), INTENT(IN) :: alignment + INTEGER(SIZE_T), INTENT(IN) :: block_size + INTEGER(SIZE_T), INTENT(IN) :: cbuf_size + END FUNCTION h5pset_fapl_direct_c + END INTERFACE + + hdferr = H5Pset_fapl_direct_c(fapl_id, alignment, block_size, cbuf_size) + END SUBROUTINE h5pset_fapl_direct_f + +!****s* H5P/h5pget_fapl_direct_f +! NAME +! h5pget_fapl_direct_f +! +! PURPOSE +! Gets up use of the direct I/O driver. +! +! INPUTS +! +! fapl_id - File access property list identifier +! OUTPUTS +! +! alignment - Required memory alignment boundary +! block_size - File system block size +! cbuf_size - Copy buffer size +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! M. Scot Breitenfeld +! March 21, 2008 +! +! Fortran90 Interface: + SUBROUTINE h5pget_fapl_direct_f(fapl_id, alignment, block_size, cbuf_size, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: fapl_id ! File access property list identifier + INTEGER(SIZE_T), INTENT(OUT) :: alignment ! Required memory alignment boundary! + INTEGER(SIZE_T), INTENT(OUT) :: block_size ! File system block size + INTEGER(SIZE_T), INTENT(OUT) :: cbuf_size ! Copy buffer size + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + INTERFACE + INTEGER FUNCTION h5pget_fapl_direct_c(fapl_id, alignment, block_size, cbuf_size) & + BIND(C,NAME='h5pget_fapl_direct_c') + IMPORT :: HID_T, SIZE_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: fapl_id + INTEGER(SIZE_T), INTENT(OUT) :: alignment + INTEGER(SIZE_T), INTENT(OUT) :: block_size + INTEGER(SIZE_T), INTENT(OUT) :: cbuf_size + END FUNCTION h5pget_fapl_direct_c + END INTERFACE + + hdferr = H5Pget_fapl_direct_c(fapl_id, alignment, block_size, cbuf_size) + END SUBROUTINE h5pget_fapl_direct_f + +!****s* H5P/H5Pset_attr_phase_change_f +! NAME +! H5Pset_attr_phase_change_f +! +! PURPOSE +! Sets attribute storage phase change thresholds. +! +! INPUTS +! +! ocpl_id - Object (dataset or group) creation property list identifier +! OUTPUTS +! +! max_compact - Maximum number of attributes to be stored in compact storage +! (Default: 8) +! min_dense - Minimum number of attributes to be stored in dense storage +! (Default: 6) +! hdferr - Error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! M. Scot Breitenfeld +! January, 2008 +! +! Fortran90 Interface: +SUBROUTINE h5pset_attr_phase_change_f(ocpl_id, max_compact, min_dense, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: ocpl_id ! Object (dataset or group) creation property list identifier + INTEGER, INTENT(IN) :: max_compact ! Maximum number of attributes to be stored in compact storage + !(Default: 8) + INTEGER, INTENT(IN) :: min_dense ! Minimum number of attributes to be stored in dense storage + ! (Default: 6) + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + INTERFACE + INTEGER FUNCTION h5pset_attr_phase_change_c(ocpl_id, max_compact, min_dense) & + BIND(C,NAME='h5pset_attr_phase_change_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: ocpl_id + INTEGER, INTENT(IN) :: max_compact + INTEGER, INTENT(IN) :: min_dense + + END FUNCTION h5pset_attr_phase_change_c + END INTERFACE + + hdferr = h5pset_attr_phase_change_c(ocpl_id, max_compact, min_dense) + + + END SUBROUTINE h5pset_attr_phase_change_f + +!****s* H5P/H5Pset_nbit_f +! NAME +! H5Pset_nbit_f +! +! PURPOSE +! Sets up the use of the N-Bit filter. +! +! Inputs: +! plist_id - Dataset creation property list identifier. +! +! Outputs: +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! M. Scot Breitenfeld +! March 21, 2008 +! +! Fortran90 Interface: + SUBROUTINE h5pset_nbit_f(plist_id, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: plist_id + INTEGER , INTENT(OUT) :: hdferr +!***** + INTERFACE + INTEGER FUNCTION H5Pset_nbit_c(plist_id) & + BIND(C,NAME='h5pset_nbit_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: plist_id + END FUNCTION H5Pset_nbit_c + END INTERFACE + + hdferr = H5Pset_nbit_c(plist_id) + + END SUBROUTINE h5pset_nbit_f + +!****s* H5P/h5pset_scaleoffset_f +! NAME +! h5pset_scaleoffset_f +! +! PURPOSE +! Sets up the use of the scale-offset filter. +! +! Inputs: +! plist_id - Dataset creation property list identifier. +! scale_type - Flag indicating compression method. Valid values: +! H5Z_SO_FLOAT_DSCALE_F +! H5Z_SO_FLOAT_ESCALE_F +! H5Z_SO_INT_F +! +! scale_factor - Parameter related to scale. +! +! Outputs: +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! M. Scot Breitenfeld +! March 21, 2008 +! +! Fortran90 Interface: + SUBROUTINE h5pset_scaleoffset_f(plist_id, scale_type, scale_factor, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: plist_id + INTEGER , INTENT(IN) :: scale_type + INTEGER , INTENT(IN) :: scale_factor + INTEGER , INTENT(OUT) :: hdferr +!***** + + INTERFACE + INTEGER FUNCTION h5pset_scaleoffset_c(plist_id, scale_type, scale_factor) & + BIND(C,NAME='h5pset_scaleoffset_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: plist_id + INTEGER, INTENT(IN) :: scale_type + INTEGER, INTENT(IN) :: scale_factor + END FUNCTION h5pset_scaleoffset_c + END INTERFACE + + hdferr = H5Pset_scaleoffset_c(plist_id, scale_type, scale_factor) + + END SUBROUTINE h5pset_scaleoffset_f + +!****s* H5P/h5pset_nlinks_f +! NAME +! h5pset_nlinks_f +! +! PURPOSE +! Sets maximum number of soft or user-defined link traversals. +! +! INPUTS +! +! lapl_id - File access property list identifier +! nlinks - Maximum number of links to traverse +! +! OUTPUTS +! +! hdferr - Error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! M. Scot Breitenfeld +! March 24, 2008 +! +! HISTORY +! +! +! Fortran90 Interface: + SUBROUTINE h5pset_nlinks_f(lapl_id, nlinks, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: lapl_id ! File access property list identifier + INTEGER(SIZE_T), INTENT(IN) :: nlinks ! Maximum number of links to traverse + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + INTERFACE + INTEGER FUNCTION h5pset_nlinks_c(lapl_id, nlinks) & + BIND(C,NAME='h5pset_nlinks_c') + IMPORT :: HID_T, SIZE_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: lapl_id + INTEGER(SIZE_T), INTENT(IN) :: nlinks + END FUNCTION h5pset_nlinks_c + END INTERFACE + + hdferr = h5pset_nlinks_c(lapl_id, nlinks) + + END SUBROUTINE h5pset_nlinks_f + +!****s* H5P/h5pget_nlinks_f +! NAME +! h5pget_nlinks_f +! +! PURPOSE +! Gets maximum number of soft or user-defined link traversals. +! +! INPUTS +! +! lapl_id - File access property list identifier +! nlinks - Maximum number of links to traverse +! +! OUTPUTS +! +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! M. Scot Breitenfeld +! March 24, 2008 +! +! Fortran90 Interface: + SUBROUTINE h5pget_nlinks_f(lapl_id, nlinks, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: lapl_id ! File access property list identifier + INTEGER(SIZE_T), INTENT(OUT) :: nlinks ! Maximum number of links to traverse + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + INTERFACE + INTEGER FUNCTION h5pget_nlinks_c(lapl_id, nlinks) & + BIND(C,NAME='h5pget_nlinks_c') + IMPORT :: HID_T, SIZE_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: lapl_id + INTEGER(SIZE_T), INTENT(OUT) :: nlinks + END FUNCTION h5pget_nlinks_c + END INTERFACE + + hdferr = h5pget_nlinks_c(lapl_id, nlinks) + + END SUBROUTINE h5pget_nlinks_f + +!****s* H5P/H5Pget_create_inter_group_f +! NAME +! H5Pget_create_inter_group_f +! +! PURPOSE +! Determines whether property is set to enable creating missing intermediate groups. +! +! INPUTS +! +! lcpl_id - Link creation property list identifier +! crt_intermed_group - Specifying whether to create intermediate groups upon +! the creation of an object +! OUTPUTS +! +! hdferr - Error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! M. Scot Breitenfeld +! April 4, 2008 +! +! HISTORY +! +! The long subroutine name (>31) on older f90 compilers causes problems +! so the name was shortened +! Fortran90 Interface: + SUBROUTINE h5pget_create_inter_group_f(lcpl_id, crt_intermed_group, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: lcpl_id ! Link creation property list identifier + INTEGER, INTENT(IN) :: crt_intermed_group ! Flag specifying whether to create intermediate groups + ! upon creation of an object + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + INTERFACE + INTEGER FUNCTION h5pget_create_inter_group_c(lcpl_id, crt_intermed_group) & + BIND(C,NAME='h5pget_create_inter_group_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: lcpl_id + INTEGER, INTENT(IN) :: crt_intermed_group + END FUNCTION h5pget_create_inter_group_c + END INTERFACE + + hdferr = h5pget_create_inter_group_c(lcpl_id, crt_intermed_group) + + END SUBROUTINE h5pget_create_inter_group_f + +!****s* H5P/H5Pset_chunk_cache_f +! NAME +! H5Pset_chunk_cache_f +! +! PURPOSE +! Set the number of objects in the meta data cache and the +! maximum number of chunks and bytes in the raw data chunk cache. +! Once set, these values will override the values in the file access +! property list. Each of these values can be individually unset +! (or not set at all) by passing the macros: +! H5D_CHUNK_CACHE_NSLOTS_DFLT_F, +! H5D_CHUNK_CACHE_NBYTES_DFLT_F, and/or +! H5D_CHUNK_CACHE_W0_DFLT_F +! as appropriate. +! +! The RDCC_W0 value should be between 0 and 1 inclusive and +! indicates how much chunks that have been fully read or fully +! written are favored for preemption. A value of zero means +! fully read or written chunks are treated no differently than +! other chunks (the preemption is strictly LRU) while a value +! of one means fully read chunks are always preempted before +! other chunks. +! +! INPUTS +! +! dapl_id - Dataset access property list identifier. +! rdcc_nslots - The number of chunk slots in the raw data chunk cache for this dataset. +! rdcc_nbytes - The total size of the raw data chunk cache for this dataset. +! rdcc_w0 - The chunk preemption policy for this dataset. +! OUTPUTS +! +! hdferr - Error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! M. Scot Breitenfeld +! April 13, 2009 +! +! HISTORY +! +! Fortran90 Interface: + SUBROUTINE h5pset_chunk_cache_f(dapl_id, rdcc_nslots, rdcc_nbytes, rdcc_w0, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dapl_id ! Dataset access property list identifier. + INTEGER(SIZE_T), INTENT(IN) :: rdcc_nslots ! The number of chunk slots in the raw data + ! chunk cache for this dataset. + INTEGER(SIZE_T), INTENT(IN) :: rdcc_nbytes ! The total size of the raw data chunk cache + ! for this dataset. + REAL, INTENT(IN) :: rdcc_w0 ! The chunk preemption policy for this dataset. + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + + INTERFACE + INTEGER FUNCTION h5pset_chunk_cache_c(dapl_id, rdcc_nslots, rdcc_nbytes, rdcc_w0) & + BIND(C,NAME='h5pset_chunk_cache_c') + IMPORT :: HID_T, SIZE_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dapl_id + INTEGER(SIZE_T), INTENT(IN) :: rdcc_nslots + INTEGER(SIZE_T), INTENT(IN) :: rdcc_nbytes + REAL, INTENT(IN) :: rdcc_w0 + END FUNCTION h5pset_chunk_cache_c + END INTERFACE + + hdferr = h5pset_chunk_cache_c(dapl_id, rdcc_nslots, rdcc_nbytes, rdcc_w0) + + END SUBROUTINE h5pset_chunk_cache_f + +!****s* H5P/H5Pget_chunk_cache_f +! NAME +! H5Pget_chunk_cache_f +! +! PURPOSE +! Retrieves the maximum possible number of elements in the meta +! data cache and the maximum possible number of elements and +! bytes and the RDCC_W0 value in the raw data chunk cache. Any +! (or all) arguments may be null pointers in which case the +! corresponding datum is not returned. If these properties have +! not been set on this property list, the default values for a +! file access property list are returned. +! +! INPUTS +! +! dapl_id - Dataset access property list identifier. +! OUTPUTS +! +! rdcc_nslots - Number of chunk slots in the raw data chunk cache hash table. +! rdcc_nbytes - Total size of the raw data chunk cache, in bytes. +! rdcc_w0 - Preemption policy. +! hdferr - Error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! M. Scot Breitenfeld +! April 13, 2009 +! +! HISTORY +! +! Fortran90 Interface: + SUBROUTINE h5pget_chunk_cache_f(dapl_id, rdcc_nslots, rdcc_nbytes, rdcc_w0, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dapl_id ! Dataset access property list identifier. + INTEGER(SIZE_T), INTENT(OUT) :: rdcc_nslots ! Number of chunk slots in the raw data chunk cache hash table. + INTEGER(SIZE_T), INTENT(OUT) :: rdcc_nbytes ! Total size of the raw data chunk cache, in bytes. + REAL, INTENT(OUT) :: rdcc_w0 ! Preemption policy. + INTEGER, INTENT(OUT) :: hdferr ! Error code: + ! 0 on success and -1 on failure +!***** + INTERFACE + INTEGER FUNCTION h5pget_chunk_cache_c(dapl_id, rdcc_nslots, rdcc_nbytes, rdcc_w0) & + BIND(C,NAME='h5pget_chunk_cache_c') + IMPORT :: HID_T, SIZE_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dapl_id + INTEGER(SIZE_T), INTENT(OUT) :: rdcc_nslots + INTEGER(SIZE_T), INTENT(OUT) :: rdcc_nbytes + REAL, INTENT(OUT) :: rdcc_w0 + END FUNCTION h5pget_chunk_cache_c + END INTERFACE + + hdferr = h5pget_chunk_cache_c(dapl_id, rdcc_nslots, rdcc_nbytes, rdcc_w0) + + END SUBROUTINE h5pget_chunk_cache_f + +! +!****s* H5P (F03)/h5pset_fill_value_f_F90 +! +! NAME +! h5pset_fill_value_f +! +! PURPOSE +! Sets fill value for a dataset creation property list +! +! Inputs: +! prp_id - Property list identifier +! type_id - Datatype identifier of fill value datatype (in memory) +! fillvalue - Fillvalue +! +! Outputs: +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 14, 2001 +! +! Added the recommended way of passing fillvalue +! and that is by passing the C address, all other +! ways are obsolete and should be avoided. June, 2008 MSB +! +! NOTES +! h5pset(get)fill_value_f function is overloaded to support +! INTEGER, REAL, DOUBLE PRECISION and CHARACTER dtatypes. +! +! Fortran90 Interface: +!! SUBROUTINE h5pset_fill_value_f(prp_id, type_id, fillvalue, hdferr) +!! IMPLICIT NONE +!! INTEGER(HID_T), INTENT(IN) :: prp_id +!! INTEGER(HID_T), INTENT(IN) :: type_id +!! TYPE(VOID) , INTENT(IN) :: fillvalue +!! INTEGER , INTENT(OUT) :: hdferr +!***** + + + SUBROUTINE h5pset_fill_value_integer(prp_id, type_id, fillvalue, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier of + ! of fillvalue datatype + ! (in memory) + INTEGER, INTENT(IN), TARGET :: fillvalue ! Fillvalue + INTEGER, INTENT(OUT) :: hdferr ! Error code + TYPE(C_PTR) :: f_ptr ! C address + + f_ptr = C_LOC(fillvalue) + + hdferr = h5pset_fill_value_c(prp_id, type_id, f_ptr) + + END SUBROUTINE h5pset_fill_value_integer +! +!****s* H5P (F03)/h5pget_fill_value_f_F90 +! +! NAME +! h5pget_fill_value_f +! +! PURPOSE +! Gets fill value for a dataset creation property list +! +! Inputs: +! prp_id - Property list identifier +! type_id - Datatype identifier of fill value datatype (in memory) +! +! Outputs: +! fillvalue - Fillvalue +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 14, 2001 +! +! Added the recommended way of passing fillvalue +! and that is by passing the C address, all other +! ways are obsolete and should be avoided. June, 2008 MSB +! +! NOTES +! h5pget(get)fill_value_f function is overloaded to support +! INTEGER, REAL, DOUBLE PRECISION and CHARACTER dtatypes. +! +! Fortran90 Interface: +!! SUBROUTINE h5pget_fill_value_f(prp_id, type_id, fillvalue, hdferr) +!! INTEGER(HID_T), INTENT(IN) :: prp_id +!! INTEGER(HID_T), INTENT(IN) :: type_id +!! TYPE(VOID) , INTENT(OUT) :: fillvalue +!! INTEGER , INTENT(OUT) :: hdferr +!***** + + SUBROUTINE h5pget_fill_value_integer(prp_id, type_id, fillvalue, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier of + ! of fillvalue datatype + ! (in memory) + INTEGER, INTENT(OUT), TARGET :: fillvalue ! Fillvalue + INTEGER, INTENT(OUT) :: hdferr ! Error code + TYPE(C_PTR) :: f_ptr ! C address + + f_ptr = C_LOC(fillvalue) + + hdferr = h5pget_fill_value_c(prp_id, type_id, f_ptr) + + END SUBROUTINE h5pget_fill_value_integer + + SUBROUTINE h5pset_fill_value_char(prp_id, type_id, fillvalue, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier of + ! of fillvalue datatype + ! (in memory) + CHARACTER, INTENT(IN), TARGET :: fillvalue ! Fillvalue + INTEGER, INTENT(OUT) :: hdferr ! Error code + TYPE(C_PTR) :: f_ptr ! C address + + f_ptr = C_LOC(fillvalue) + hdferr = h5pset_fill_value_c(prp_id, type_id, f_ptr) + + END SUBROUTINE h5pset_fill_value_char + + SUBROUTINE h5pget_fill_value_char(prp_id, type_id, fillvalue, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier of + ! of fillvalue datatype + ! (in memory) + CHARACTER, INTENT(OUT) :: fillvalue ! Fillvalue + INTEGER, INTENT(OUT) :: hdferr ! Error code + + INTEGER :: i + CHARACTER(LEN=1), ALLOCATABLE, DIMENSION(:), TARGET :: chr + INTEGER :: chr_len + + TYPE(C_PTR) :: f_ptr ! C address + ! To resolve Issue #1 outlined in the preamble of this file we + ! need to pack the character string into an array. + + chr_len = LEN(fillvalue) + ALLOCATE(chr(1:chr_len), STAT=hdferr) + IF (hdferr .NE. 0) THEN + hdferr = -1 + RETURN + ENDIF + + f_ptr = C_LOC(chr(1)(1:1)) + hdferr = h5pget_fill_value_c(prp_id, type_id, f_ptr) + + DO i = 1, chr_len + fillvalue(i:i) = chr(i) + ENDDO + DEALLOCATE(chr) + + END SUBROUTINE h5pget_fill_value_char +! +!****s* H5P (F03)/h5pset_fill_value_f_F03 +! +! NAME +! h5pset_fill_value_f +! +! PURPOSE +! Sets fill value for a dataset creation property list +! +! Inputs: +! prp_id - Property list identifier +! type_id - Datatype identifier of fill value datatype (in memory) +! fillvalue - Fillvalue +! +! Outputs: +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 14, 2001 +! +! Added the recommended way of passing fillvalue +! and that is by passing the C address, all other +! ways are obsolete and should be avoided. June, 2008 MSB +! +! NOTES +! h5pset(get)fill_value_f function is overloaded to support +! INTEGER, REAL, DOUBLE PRECISION and CHARACTER dtatypes. +! +! Fortran2003 Interface: +!! SUBROUTINE h5pset_fill_value_f(prp_id, type_id, fillvalue, hdferr) +!! INTEGER(HID_T), INTENT(IN) :: prp_id +!! INTEGER(HID_T), INTENT(IN) :: type_id +!! TYPE(C_PTR) , INTENT(IN) :: fillvalue +!! INTEGER , INTENT(OUT) :: hdferr +!***** + + SUBROUTINE h5pset_fill_value_ptr(prp_id, type_id, fillvalue, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier of + ! of fillvalue datatype + ! (in memory) + TYPE(C_PTR), INTENT(IN) :: fillvalue ! Fillvalue + INTEGER, INTENT(OUT) :: hdferr ! Error code + + hdferr = h5pset_fill_value_c(prp_id, type_id, fillvalue) + + END SUBROUTINE h5pset_fill_value_ptr + +! +!****s* H5P (F03)/h5pget_fill_value_f_F03 +! +! NAME +! h5pget_fill_value_f +! +! PURPOSE +! Gets fill value for a dataset creation property list +! +! Inputs: +! prp_id - Property list identifier +! type_id - Datatype identifier of fill value datatype (in memory) +! +! Outputs: +! fillvalue - Fillvalue +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 14, 2001 +! +! Added the recommended way of passing fillvalue +! and that is by passing the C address, all other +! ways are obsolete and should be avoided. June, 2008 MSB +! +! NOTES +! h5pget(get)fill_value_f function is overloaded to support +! INTEGER, REAL, DOUBLE PRECISION and CHARACTER dtatypes. +! +! Fortran2003 Interface: +!! SUBROUTINE h5pget_fill_value_f(prp_id, type_id, fillvalue, hdferr) +!! INTEGER(HID_T), INTENT(IN) :: prp_id +!! INTEGER(HID_T), INTENT(IN) :: type_id +!! TYPE(C_PTR) , INTENT(OUT) :: fillvalue +!! INTEGER , INTENT(OUT) :: hdferr +!***** + + SUBROUTINE h5pget_fill_value_ptr(prp_id, type_id, fillvalue, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier of + ! of fillvalue datatype + ! (in memory) + TYPE(C_PTR), INTENT(OUT) :: fillvalue ! Fillvalue + INTEGER, INTENT(OUT) :: hdferr ! Error code + + hdferr = h5pget_fill_value_c(prp_id, type_id, fillvalue) + + END SUBROUTINE h5pget_fill_value_ptr + +! +!****s* H5P (F03)/h5pset_f_F90 +! +! NAME +! h5pset_f +! +! PURPOSE +! Sets a property list value +! +! Inputs: +! prp_id - Property list identifier to modify +! name - Name of property to modify +! value - Property value, supported types are: +! INTEGER +! REAL +! DOUBLE PRECISION +! CHARACTER(LEN=*) +! Outputs: +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! October 9, 2002 +! +! Fortran90 Interface: +!! SUBROUTINE h5pset_f(plid, name, value, hdferr) +!! INTEGER(HID_T) , INTENT(IN) :: plid +!! CHARACTER(LEN=*), INTENT(IN) :: name +!! TYPE , INTENT(IN) :: value +!! INTEGER , INTENT(OUT) :: hdferr +!***** + SUBROUTINE h5pset_integer(prp_id, name, value, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to modify + INTEGER, INTENT(IN), TARGET :: value ! Property value + INTEGER, INTENT(OUT) :: hdferr ! Error code + + INTEGER :: name_len + TYPE(C_PTR) :: f_ptr + + f_ptr = C_LOC(value) + + name_len = LEN(name) + hdferr = h5pget_c(prp_id, name, name_len, f_ptr) + + END SUBROUTINE h5pset_integer + + SUBROUTINE h5pset_char(prp_id, name, value, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to modify + CHARACTER(LEN=*), INTENT(IN) :: value ! Property value + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER :: name_len + + INTEGER :: i + CHARACTER(LEN=1), ALLOCATABLE, DIMENSION(:), TARGET :: chr + INTEGER :: chr_len + + TYPE(C_PTR) :: f_ptr + ! To resolve Issue #1 outlined in the preamble of this file we + ! need to pack the character string into an array. + + chr_len = LEN(value) + ALLOCATE(chr(1:chr_len), STAT=hdferr) + IF (hdferr .NE. 0) THEN + hdferr = -1 + RETURN + ENDIF + + DO i = 1, chr_len + chr(i) = value(i:i) + ENDDO + + f_ptr = C_LOC(chr(1)(1:1)) + + name_len = LEN(name) + hdferr = h5pget_c(prp_id, name, name_len, f_ptr) + + DEALLOCATE(chr) + + END SUBROUTINE h5pset_char +! +!****s* H5P (F03)/h5pget_f_F90 +! +! NAME +! h5pget_f +! +! PURPOSE +! Queries the value of a property. +! +! Inputs: +! prp_id - Property list identifier to modify +! name - Name of property to get +! value - Property value, supported types are: +! INTEGER +! REAL +! DOUBLE PRECISION +! CHARACTER(LEN=*) +! Outputs: +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! October 9, 2002 +! +! Fortran90 Interface: +!! SUBROUTINE h5pget_f(plid, name, value, hdferr) +!! INTEGER(HID_T) , INTENT(IN) :: plid +!! CHARACTER(LEN=*), INTENT(IN) :: name +!! TYPE , INTENT(OUT) :: value +!! INTEGER , INTENT(OUT) :: hdferr +!***** + + SUBROUTINE h5pget_integer(prp_id, name, value, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to modify + INTEGER, INTENT(OUT), TARGET :: value ! Property value + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER :: name_len + TYPE(C_PTR) :: f_ptr + + f_ptr = C_LOC(value) + + name_len = LEN(name) + hdferr = h5pget_c(prp_id, name, name_len, f_ptr) + + END SUBROUTINE h5pget_integer + + SUBROUTINE h5pget_char(prp_id, name, value, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to modify + CHARACTER(LEN=*), INTENT(OUT) :: value ! Property value + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER :: name_len + + INTEGER :: i + CHARACTER(LEN=1), ALLOCATABLE, DIMENSION(:), TARGET :: chr + INTEGER :: chr_len + TYPE(C_PTR) :: f_ptr + + chr_len = LEN(value) + ALLOCATE(chr(1:chr_len), STAT=hdferr) + IF (hdferr .NE. 0) THEN + hdferr = -1 + RETURN + ENDIF + f_ptr = C_LOC(chr(1)(1:1)) + + name_len = LEN(name) + hdferr = h5pget_c(prp_id, name, name_len, f_ptr) + + DO i = 1, chr_len + value(i:i) = chr(i) + ENDDO + + DEALLOCATE(chr) + + END SUBROUTINE h5pget_char + +! +!****s* H5P (F03)/h5pset_f_F03 +! +! NAME +! h5pset_f +! +! PURPOSE +! Sets a property list value +! +! Inputs: +! prp_id - Property list identifier to modify +! name - Name of property to modify +! value - Pointer to value to set the property to +! Outputs: +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! October 9, 2002 +! +! Fortran2003 Interface: +!! SUBROUTINE h5pset_f(plid, name, value, hdferr) +!! INTEGER(HID_T) , INTENT(IN) :: plid +!! CHARACTER(LEN=*), INTENT(IN) :: name +!! TYPE(C_PTR) , INTENT(IN) :: value +!! INTEGER , INTENT(OUT) :: hdferr +!***** + SUBROUTINE h5pset_ptr(prp_id, name, value, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to modify + TYPE(C_PTR), INTENT(IN) :: value ! Property value + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER :: name_len + + name_len = LEN(name) + hdferr = h5pset_c(prp_id, name, name_len, value) + + END SUBROUTINE h5pset_ptr +! +!****s* H5P (F03)/h5pget_f_F03 +! +! NAME +! h5pget_f (F03) +! +! PURPOSE +! Queries the value of a property. +! +! Inputs: +! prp_id - Property list identifier to modify +! name - Name of property to get +! value - Pointer to a location to which to copy the value of of the property +! Outputs: +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! October 9, 2002 +! +! Fortran2003 Interface: +!! SUBROUTINE h5pget_f(plid, name, value, hdferr) +!! INTEGER(HID_T) , INTENT(IN) :: plid +!! CHARACTER(LEN=*), INTENT(IN) :: name +!! TYPE(C_PTR) , INTENT(OUT) :: value +!! INTEGER , INTENT(OUT) :: hdferr +!***** + SUBROUTINE h5pget_ptr(prp_id, name, value, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to modify + TYPE(C_PTR), INTENT(OUT) :: value ! Property value + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER :: name_len + + name_len = LEN(name) + hdferr = h5pget_c(prp_id, name, name_len, value) + + END SUBROUTINE h5pget_ptr +! +!****s* H5P (F03)/h5pregister_f_F90 +! +! NAME +! h5pregister +! +! PURPOSE +! Registers a permanent property with a property list class. +! +! Inputs: +! class - Property list class identifier +! name - Name of property to register +! size - Size of the property value +! value - Property value, supported types are: +! INTEGER +! REAL +! DOUBLE PRECISION +! CHARACTER(LEN=*) +! +! Outputs: +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! October 10, 2002 +! +! Fortran90 Interface: +!! SUBROUTINE h5pregister_f(class, name, size, value, hdferr) +!! INTEGER(HID_T) , INTENT(IN) :: class +!! CHARACTER(LEN=*), INTENT(IN) :: name +!! INTEGER(SIZE_T) , INTENT(IN) :: size +!! TYPE , INTENT(IN) :: value +!! INTEGER , INTENT(OUT) :: hdferr +!***** + SUBROUTINE h5pregister_integer(class, name, size, value, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: class ! Property list class identifier + CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to register + INTEGER(SIZE_T), INTENT(IN) :: size ! Size of the property value + INTEGER, INTENT(IN), TARGET :: value ! Property value + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER :: name_len + TYPE(C_PTR) :: f_ptr + + f_ptr = C_LOC(value) + + name_len = LEN(name) + hdferr = h5pregister_c(class, name, name_len, size, f_ptr) + + END SUBROUTINE h5pregister_integer + + + SUBROUTINE h5pregister_char(class, name, size, value, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: class ! Property list class identifier + CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to register + INTEGER(SIZE_T), INTENT(IN) :: size ! size of the property value + CHARACTER(LEN=*), INTENT(IN) :: value ! Property value + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER :: name_len + + INTEGER :: i + CHARACTER(LEN=1), ALLOCATABLE, DIMENSION(:), TARGET :: chr + INTEGER :: chr_len + + TYPE(C_PTR) :: f_ptr + ! To resolve Issue #1 outlined in the preamble of this file we + ! need to pack the character string into an array. + + chr_len = LEN(value) + ALLOCATE(chr(1:chr_len), STAT=hdferr) + IF (hdferr .NE. 0) THEN + hdferr = -1 + RETURN + ENDIF + + DO i = 1, chr_len + chr(i) = value(i:i) + ENDDO + + f_ptr = C_LOC(chr(1)(1:1)) + + name_len = LEN(name) + hdferr = h5pregister_c(class, name, name_len, size, f_ptr) + DEALLOCATE(chr) + END SUBROUTINE h5pregister_char +! +!****s* H5P (F03)/h5pregister_f_F03 +! +! NAME +! h5pregister (F03) +! +! PURPOSE +! Registers a permanent property with a property list class. +! +! Inputs: +! class - Property list class identifier +! name - Name of property to register +! size - Size of the property value +! value - Pointer to value to set the property to +! +! Outputs: +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! M. Scot Breitenfeld +! June 24, 2008 +! +! Fortran2003 Interface: +!! SUBROUTINE h5pregister_f(class, name, size, value, hdferr) +!! INTEGER(HID_T) , INTENT(IN) :: class +!! CHARACTER(LEN=*), INTENT(IN) :: name +!! INTEGER(SIZE_T) , INTENT(IN) :: size +!! TYPE(C_PTR) , INTENT(IN) :: value +!! INTEGER , INTENT(OUT) :: hdferr +!***** + + SUBROUTINE h5pregister_ptr(class, name, size, value, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: class ! Property list class identifier + CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to register + INTEGER(SIZE_T), INTENT(IN) :: size ! Size of the property value + TYPE(C_PTR), INTENT(IN) :: value ! Property value + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER :: name_len + + name_len = LEN(name) + hdferr = h5pregister_c(class, name, name_len, size, value) + END SUBROUTINE h5pregister_ptr + +! +!****s* H5P (F03)/h5pinsert_f_F90 +! +! NAME +! h5pinsert (f90) +! +! PURPOSE +! Registers a temporary property with a property list class. +! +! Inputs: +! plist - Property list class identifier +! name - Name of property to insert +! size - Size of the property value +! value - Property value, supported types are: +! INTEGER +! REAL +! DOUBLE PRECISION +! CHARACTER(LEN=*) +! Outputs: +! hdferr - Returns 0 if successful and -1 if fails +! AUTHOR +! Elena Pourmal +! October 10, 2002 +! +! Fortran90 Interface: +!! SUBROUTINE h5pinsert_f +!! INTEGER(HID_T) , INTENT(IN) :: plist +!! CHARACTER(LEN=*), INTENT(IN) :: name +!! INTEGER(SIZE_T) , INTENT(IN) :: size +!! TYPE , INTENT(IN) :: value +!! INTEGER , INTENT(OUT) :: hdferr +!***** + SUBROUTINE h5pinsert_integer(plist, name, size, value, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: plist ! Property list identifier + CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to insert + INTEGER(SIZE_T), INTENT(IN) :: size ! Size of the property value + INTEGER, INTENT(IN), TARGET :: value ! Property value + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER :: name_len + TYPE(c_ptr) :: f_ptr + + f_ptr = c_loc(value) + + name_len = LEN(name) + hdferr = h5pinsert_c(plist, name , name_len, size, f_ptr) + END SUBROUTINE h5pinsert_integer + + SUBROUTINE h5pinsert_char(plist, name, size, value, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: plist ! Property list identifier + CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to insert + INTEGER(SIZE_T), INTENT(IN) :: size ! Size of property value + CHARACTER(LEN=*), INTENT(IN) :: value ! Property value + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER :: name_len + + INTEGER :: i + CHARACTER(LEN=1), ALLOCATABLE, DIMENSION(:), TARGET :: chr + INTEGER :: chr_len + + TYPE(c_ptr) :: f_ptr + ! To resolve Issue #1 outlined in the preamble of this file we + ! need to pack the character string into an array. + + chr_len = LEN(value) + ALLOCATE(chr(1:chr_len), STAT=hdferr) + IF (hdferr .NE. 0) THEN + hdferr = -1 + RETURN + ENDIF + + DO i = 1, chr_len + chr(i) = value(i:i) + ENDDO + + f_ptr = C_LOC(chr(1)(1:1)) + + name_len = LEN(name) + hdferr = h5pinsert_c(plist, name , name_len, size, f_ptr) + + DEALLOCATE(chr) + + END SUBROUTINE h5pinsert_char + +! +!****s* H5P (F03)/h5pinsert_f_F03 +! +! NAME +! h5pinsert (f03) +! +! PURPOSE +! Registers a temporary property with a property list class. +! +! Inputs: +! plist - Property list class identifier +! name - Name of property to insert +! size - Size of the property value +! value - Pointer to new value pointer for the property being modified +! +! Outputs: +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! M. Scot Breitenfeld +! June 24, 2008 +! +! Fortran90 Interface: +!! SUBROUTINE h5pinsert_f +!! INTEGER(HID_T) , INTENT(IN) :: plist +!! CHARACTER(LEN=*), INTENT(IN) :: name +!! INTEGER(SIZE_T) , INTENT(IN) :: size +!! TYPE(C_PTR) , INTENT(IN) :: value +!! INTEGER , INTENT(OUT) :: hdferr +!***** + SUBROUTINE h5pinsert_ptr(plist, name, size, value, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: plist ! Property list identifier + CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to insert + INTEGER(SIZE_T), INTENT(IN) :: size ! Size of property value + TYPE(c_ptr), INTENT(IN) :: value ! Property value + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER :: name_len + + name_len = LEN(name) + hdferr = h5pinsert_c(plist, name , name_len, size, value) + END SUBROUTINE h5pinsert_ptr +! +!****s* H5P (F03)/h5pcreate_class_f_F03 +! +! NAME +! h5pcreate_class_f +! +! PURPOSE +! Create a new property list class +! +! Inputs: +! parent - Parent property list class identifier +! Possible values include: +! H5P_ROOT_F +! H5P_FILE_CREATE_F +! H5P_FILE_ACCESS_F +! H5P_DATASET_CREATE_F +! H5P_DATASET_XFER_F +! H5P_FILE_MOUNT_F +! name - Name of property to create +! +! Outputs: +! class - Property list class identifier +! hdferr - Returns 0 if successful and -1 if fails +! +! Optional parameters: +! H5P_cls_create_func_t (create) - Callback routine called when a property list is created +! create_data - User pointer to any class creation information needed +! H5P_cls_copy_func_t (copy) - Callback routine called when a property list is copied +! copy_data - User pointer to any class copy information needed +! H5P_cls_close_func_t (close) - Callback routine called when a property list is being closed +! close_data - User pointer to any class close information needed +! +! AUTHOR +! Elena Pourmal +! October 9, 2002 +! +! HISTORY +! Added callback arguments +! M. Scot Breitenfeld, July 3, 2008 +! +! Fortran2003 Interface: + SUBROUTINE h5pcreate_class_f(parent, name, class, hdferr, create, create_data, & + copy, copy_data, CLOSE, close_data) + IMPLICIT NONE + INTEGER(HID_T) , INTENT(IN) :: parent + CHARACTER(LEN=*), INTENT(IN) :: name + INTEGER(HID_T) , INTENT(OUT) :: class + INTEGER , INTENT(OUT) :: hdferr + TYPE(C_PTR) , OPTIONAL :: create_data, copy_data, close_data + TYPE(C_FUNPTR) , OPTIONAL :: create, copy, close +!***** + INTEGER :: name_len + TYPE(C_PTR) :: create_data_default, copy_data_default, close_data_default + TYPE(C_FUNPTR) :: create_default, copy_default, close_default + INTERFACE + INTEGER FUNCTION h5pcreate_class_c(parent, name, name_len, class, & + create, create_data, copy, copy_data, close, close_data) & + BIND(C, NAME='h5pcreate_class_c') + IMPORT :: c_char, c_ptr, c_funptr + IMPORT :: HID_T + INTEGER(HID_T), INTENT(IN) :: parent + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: name + INTEGER, INTENT(IN) :: name_len + INTEGER(HID_T), INTENT(OUT) :: class + TYPE(C_PTR), VALUE :: create_data, copy_data, close_data + TYPE(C_FUNPTR), VALUE :: create, copy, close + END FUNCTION h5pcreate_class_c + END INTERFACE + name_len = LEN(name) + + create_default = c_null_funptr !fix:scot + create_data_default = c_null_ptr + copy_default = c_null_funptr !fix:scot + copy_data_default = c_null_ptr + close_default = c_null_funptr !fix:scot + close_data_default = c_null_ptr + + IF(PRESENT(create)) create_default = create + IF(PRESENT(create_data)) create_data_default = create_data + IF(PRESENT(copy)) copy_default = copy + IF(PRESENT(copy_data)) copy_data_default = copy_data + IF(PRESENT(close)) close_default = close + IF(PRESENT(close_data)) close_data_default = close_data + + hdferr = h5pcreate_class_c(parent, name , name_len, class, & + create_default, create_data_default, & + copy_default, copy_data_default, & + close_default, close_data_default) + + END SUBROUTINE h5pcreate_class_f + +! +!****s* H5P (F03)/h5pset_file_image_f_F03 +! +! NAME +! h5pset_file_image_f +! +! PURPOSE +! Sets an initial file image in a memory buffer. +! +! Inputs: +! fapl_id - File access property list identifier +! buf_ptr - Pointer to the initial file image, +! or C_NULL_PTR if no initial file image is desired +! buf_len - Size of the supplied buffer, or 0 (zero) if no initial image is desired +! +! Outputs: +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! M. Scot Breitenfeld +! February 19, 2012 +! +! Fortran2003 Interface: + SUBROUTINE h5pset_file_image_f(fapl_id, buf_ptr, buf_len, hdferr) + IMPLICIT NONE + INTEGER(HID_T) , INTENT(IN) :: fapl_id + TYPE(C_PTR) , INTENT(IN) :: buf_ptr + INTEGER(SIZE_T), INTENT(IN) :: buf_len + INTEGER , INTENT(OUT) :: hdferr +!***** + INTERFACE + INTEGER FUNCTION h5pset_file_image_c(fapl_id, buf_ptr, buf_len) & + BIND(C, NAME='h5pset_file_image_c') + IMPORT :: c_ptr + IMPORT :: HID_T, SIZE_T + INTEGER(HID_T), INTENT(IN) :: fapl_id + TYPE(C_PTR), VALUE :: buf_ptr + INTEGER(SIZE_T), INTENT(IN) :: buf_len + END FUNCTION h5pset_file_image_c + END INTERFACE + + hdferr = h5pset_file_image_c(fapl_id, buf_ptr, buf_len) + + END SUBROUTINE h5pset_file_image_f +! +!****s* H5P (F03)/h5pget_file_image_f_F03 +! +! NAME +! h5pget_file_image_f +! +! PURPOSE +! Retrieves a copy of the file image designated as the initial content and structure of a file. +! +! Inputs: +! fapl_id - File access property list identifier. +! +! Outputs: +! buf_ptr - Will hold either a C_NULL_PTR or a scalar of type +! c_loc. If buf_ptr is not C_NULL_PTR, on successful +! return, buf_ptr shall contain a C pointer to a copy +! of the initial image provided in the last call to +! H5Pset_file_image_f for the supplied fapl_id, or +! buf_ptr shall contain a C_NULL_PTR if there is no +! initial image set. +! +! buf_len_ptr - Contains the value of the buffer parameter for +! the initial image in the supplied fapl_id. The value +! will be 0 if no initial image is set. +! +! +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! M. Scot Breitenfeld +! February 19, 2012 +! +! Fortran2003 Interface: + SUBROUTINE h5pget_file_image_f(fapl_id, buf_ptr, buf_len_ptr, hdferr) + IMPLICIT NONE + INTEGER(HID_T) , INTENT(IN) :: fapl_id + TYPE(C_PTR) , INTENT(OUT), DIMENSION(*) :: buf_ptr + INTEGER(SIZE_T), INTENT(OUT) :: buf_len_ptr + INTEGER , INTENT(OUT) :: hdferr + +!***** + INTERFACE + INTEGER FUNCTION h5pget_file_image_c(fapl_id, buf_ptr, buf_len_ptr) & + BIND(C, NAME='h5pget_file_image_c') + IMPORT :: c_ptr + IMPORT :: HID_T, SIZE_T + INTEGER(HID_T), INTENT(IN) :: fapl_id + TYPE(C_PTR), DIMENSION(*), INTENT(OUT) :: buf_ptr + INTEGER(SIZE_T), INTENT(OUT) :: buf_len_ptr + END FUNCTION h5pget_file_image_c + END INTERFACE + + hdferr = h5pget_file_image_c(fapl_id, buf_ptr, buf_len_ptr) + + END SUBROUTINE h5pget_file_image_f + +! ********************************************************************* +! Fortran interfaces for H5P functions needed by parallel MPI programs. +! ********************************************************************* + +#ifdef H5_HAVE_PARALLEL +!****s* H5P/h5pset_fapl_mpio_f +! +! NAME +! h5pset_fapl_mpio_f +! +! PURPOSE +! Stores MPI IO communicator information to the file +! access property list. +! +! INPUTS +! prp_id - file access property list identifier +! comm - MPI-2 communicator +! info - MPI-2 info object +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails +! AUTHOR +! Elena Pourmal +! November, 2000 +! +! SOURCE + SUBROUTINE h5pset_fapl_mpio_f(prp_id, comm, info, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER, INTENT(IN) :: comm ! MPI communicator to be used for file open + ! as defined in MPI_FILE_OPEN of MPI-2 + INTEGER, INTENT(IN) :: info ! MPI info object to be used for file open + ! as defined in MPI_FILE_OPEN of MPI-2 + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + INTERFACE + INTEGER FUNCTION h5pset_fapl_mpio_c(prp_id, comm, info) & + BIND(C,NAME='h5pset_fapl_mpio_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id + INTEGER , INTENT(IN) :: comm + INTEGER , INTENT(IN) :: info + END FUNCTION h5pset_fapl_mpio_c + END INTERFACE + + hdferr = h5pset_fapl_mpio_c(prp_id, comm, info) + + END SUBROUTINE h5pset_fapl_mpio_f + +!****s* H5P/h5pget_fapl_mpio_f +! +! NAME +! h5pget_fapl_mpio_f +! +! PURPOSE +! Returns MPI communicator information. +! +! INPUTS +! prp_id - file access property list identifier +! OUTPUTS +! comm - MPI-2 communicator +! info - MPI-2 info object +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! November, 2000 +! +! SOURCE + SUBROUTINE h5pget_fapl_mpio_f(prp_id, comm, info, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER, INTENT(OUT) :: comm ! buffer to return communicator + INTEGER, INTENT(OUT) :: info ! buffer to return info object + ! as defined in MPI_FILE_OPEN of MPI-2 + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + INTERFACE + INTEGER FUNCTION h5pget_fapl_mpio_c(prp_id, comm, info) & + BIND(C,NAME='h5pget_fapl_mpio_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id + INTEGER , INTENT(OUT) :: comm + INTEGER , INTENT(OUT) :: info + END FUNCTION h5pget_fapl_mpio_c + END INTERFACE + + hdferr = h5pget_fapl_mpio_c(prp_id, comm, info) + + END SUBROUTINE h5pget_fapl_mpio_f + +!****s* H5P/h5pset_dxpl_mpio_f +! +! NAME +! h5pset_dxpl_mpio_f +! +! PURPOSE +! Sets data transfer mode. +! +! INPUTS +! prp_id - data transfer property list identifier +! data_xfer_mode - transfer mode; possible values are: +! H5FD_MPIO_INDEPENDENT_F +! H5FD_MPIO_COLLECTIVE_F +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails +! AUTHOR +! Elena Pourmal +! November, 2000 +! +! SOURCE + SUBROUTINE h5pset_dxpl_mpio_f(prp_id, data_xfer_mode, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER, INTENT(IN) :: data_xfer_mode ! Data transfer mode. Possible values are: + ! H5FD_MPIO_INDEPENDENT_F + ! H5FD_MPIO_COLLECTIVE_F + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + INTERFACE + INTEGER FUNCTION h5pset_dxpl_mpio_c(prp_id, data_xfer_mode) & + BIND(C,NAME='h5pset_dxpl_mpio_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id + INTEGER , INTENT(IN) :: data_xfer_mode + END FUNCTION h5pset_dxpl_mpio_c + END INTERFACE + + hdferr = h5pset_dxpl_mpio_c(prp_id, data_xfer_mode) + END SUBROUTINE h5pset_dxpl_mpio_f + +!****s* H5P/h5pget_dxpl_mpio_f +! +! NAME +! h5pget_dxpl_mpio_f +! +! PURPOSE +! Returns the data transfer mode. +! +! INPUTS +! prp_id - data transfer property list identifier +! OUTPUTS +! data_xfer_mode- transfer mode; possible values are: +! H5FD_MPIO_INDEPENDENT_F +! H5FD_MPIO_COLLECTIVE_F +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! November, 2000 +! +! SOURCE + SUBROUTINE h5pget_dxpl_mpio_f(prp_id, data_xfer_mode, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER, INTENT(OUT) :: data_xfer_mode ! Data transfer mode. Possible values are: + ! H5FD_MPIO_INDEPENDENT_F + ! H5FD_MPIO_COLLECTIVE_F + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + INTERFACE + INTEGER FUNCTION h5pget_dxpl_mpio_c(prp_id, data_xfer_mode) & + BIND(C,NAME='h5pget_dxpl_mpio_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id + INTEGER , INTENT(OUT) :: data_xfer_mode + END FUNCTION h5pget_dxpl_mpio_c + END INTERFACE + + hdferr = h5pget_dxpl_mpio_c(prp_id, data_xfer_mode) + END SUBROUTINE h5pget_dxpl_mpio_f + +!****s* H5P/h5pget_mpio_actual_io_mode_f +! NAME +! h5pget_mpio_actual_io_mode_f +! +! PURPOSE +! Retrieves the type of I/O that HDF5 actually performed on the last +! parallel I/O call. This is not necessarily the type of I/O requested. +! +! INPUTS +! dxpl_id - Dataset transfer property list identifier. +! OUTPUTS +! actual_io_mode - The type of I/O performed by this process. +! hdferr - Returns 0 if successful and -1 if fails. +! +! AUTHOR +! M. Scot Breitenfeld +! July 27, 2012 +! +! HISTORY +! +! Fortran90 Interface: + SUBROUTINE h5pget_mpio_actual_io_mode_f(dxpl_id, actual_io_mode, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dxpl_id + INTEGER , INTENT(OUT) :: actual_io_mode + INTEGER , INTENT(OUT) :: hdferr +!***** + INTERFACE + INTEGER FUNCTION h5pget_mpio_actual_io_mode_c(dxpl_id, actual_io_mode) & + BIND(C,NAME='h5pget_mpio_actual_io_mode_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dxpl_id + INTEGER , INTENT(OUT) :: actual_io_mode + END FUNCTION h5pget_mpio_actual_io_mode_c + END INTERFACE + + actual_io_mode = -1 + + hdferr = h5pget_mpio_actual_io_mode_c(dxpl_id, actual_io_mode) + + END SUBROUTINE h5pget_mpio_actual_io_mode_f +#endif + +END MODULE H5P + + + diff --git a/fortran/src/H5Pff.f90 b/fortran/src/H5Pff.f90 deleted file mode 100644 index 3409f15..0000000 --- a/fortran/src/H5Pff.f90 +++ /dev/null @@ -1,6400 +0,0 @@ -!****h* ROBODoc/H5P (F90) -! -! NAME -! H5P_PROVISIONAL -! -! PURPOSE -! This file contains Fortran interfaces for H5P functions. It includes -! all the functions that are independent on whether the Fortran 2003 functions -! are enabled or disabled. -! -! 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. * -! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -! -! NOTES -! *** IMPORTANT *** -! If you add a new H5P function you must add the function name to the -! Windows dll file 'hdf5_fortrandll.def.in' in the fortran/src directory. -! This is needed for Windows based operating systems. -!***** - -MODULE H5P - - USE H5GLOBAL - - INTERFACE h5pset_fapl_multi_f - MODULE PROCEDURE h5pset_fapl_multi_l - MODULE PROCEDURE h5pset_fapl_multi_s - END INTERFACE - -CONTAINS - -!****s* H5P/h5pcreate_f -! NAME -! h5pcreate_f -! -! PURPOSE -! Creates a new property as an instance of a property -! list class. -! -! INPUTS -! class - type of the property class to be created. -! Possible values are: -! H5P_OBJECT_CREATE_F -! H5P_FILE_CREATE_F -! H5P_FILE_ACCESS_F -! H5P_DATASET_CREATE_F -! H5P_DATASET_ACCESS_F -! H5P_DATASET_XFER_F -! H5P_FILE_MOUNT_F -! H5P_GROUP_CREATE_F -! H5P_GROUP_ACCESS_F -! H5P_DATATYPE_CREATE_F -! H5P_DATATYPE_ACCESS_F -! H5P_STRING_CREATE_F -! H5P_ATTRIBUTE_CREATE _F -! H5P_OBJECT_COPY_F -! H5P_LINK_CREATE_F -! H5P_LINK_ACCESS_F -! -! OUTPUTS -! prp_id - property list identifier -! hdferr - error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 14, 2001 -! -! Fortran90 Interface: - SUBROUTINE h5pcreate_f(class, prp_id, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: class - INTEGER(HID_T), INTENT(OUT) :: prp_id - INTEGER , INTENT(OUT) :: hdferr -!***** -! INTEGER, EXTERNAL :: h5pcreate_c -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5pcreate_c(class, prp_id) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PCREATE_C'::h5pcreate_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: class - INTEGER(HID_T), INTENT(OUT) :: prp_id - END FUNCTION h5pcreate_c - END INTERFACE - - hdferr = h5pcreate_c(class, prp_id) - END SUBROUTINE h5pcreate_f - -!****s* H5P/h5pset_preserve_f -! NAME -! h5pset_preserve_f -! -! PURPOSE -! Sets the dataset transfer property list status to -! TRUE or FALSE for initializing compound datatype -! members during write/read operations. -! -! INPUTS -! prp_id - property list identifier -! flag - status flag -! -! OUTPUTS -! hdferr - Returns 0 if successful and -1 if fails -! -! OPTIONAL PARAMETERS -! NONE -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 14, 2001 -! -! Datatype of the flag parameter is changed from -! INTEGER to LOGICAL June 4, 2003 -! -! Fortran90 Interface: - SUBROUTINE h5pset_preserve_f(prp_id, flag, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - LOGICAL, INTENT(IN) :: flag ! TRUE/FALSE flag to set the dataset - ! transfer property for partila writing/reading - ! compound datatype - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! 0 on success and -1 on failure -!***** - INTEGER :: flag_c - -! INTEGER, EXTERNAL :: h5pset_preserve_c -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5pset_preserve_c(prp_id, flag_c) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_PRESERVE_C'::h5pset_preserve_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: prp_id - INTEGER :: flag_c - END FUNCTION h5pset_preserve_c - END INTERFACE - flag_c = 0 - IF(flag) flag_c = 1 - hdferr = h5pset_preserve_c(prp_id, flag_c) - END SUBROUTINE h5pset_preserve_f - -!****s* H5P/h5pget_preserve_f -! NAME -! h5pget_preserve_f -! -! PURPOSE -! Checks status of the dataset transfer property list. -! -! INPUTS -! prp_id - property list identifier -! -! OUTPUTS -! flag - status flag -! hdferr - error code -! Success: 0 -! Failure: -1 -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 14, 2001 -! -! Datatype of the flag parameter is changed from -! INTEGER to LOGICAL -! June 4, 2003 -! -! Fortran90 Interface: - SUBROUTINE h5pget_preserve_f(prp_id, flag, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - LOGICAL, INTENT(OUT) :: flag ! TRUE/FALSE flag. Shows status of the dataset's - ! transfer property for partial writing/reading - ! compound datatype - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! 0 on success and -1 on failure -!***** - INTEGER :: flag_c - -! INTEGER, EXTERNAL :: h5pget_preserve_c -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5pget_preserve_c(prp_id, flag_c) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGET_PRESERVE_C'::h5pget_preserve_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: prp_id - INTEGER :: flag_c - END FUNCTION h5pget_preserve_c - END INTERFACE - - hdferr = h5pget_preserve_c(prp_id, flag_c) - flag = .FALSE. - IF(flag_c .EQ. 1) flag = .TRUE. - END SUBROUTINE h5pget_preserve_f - -!****s* H5P/h5pget_class_f -! NAME -! h5pget_class_f -! -! PURPOSE -! Returns the property list class for a property list. -! -! INPUTS -! prp_id - property list identifier -! -! OUTPUTS -! classtype - property list class -! hdferr: - error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 14, 2001 -! -! Fortran90 Interface: - SUBROUTINE h5pget_class_f(prp_id, classtype, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER(HID_T), INTENT(OUT) :: classtype ! The type of the property list - ! to be created. - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! 0 on success and -1 on failure -!***** - - INTERFACE - INTEGER FUNCTION h5pget_class_c(prp_id, classtype) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGET_CLASS_C'::h5pget_class_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: prp_id - INTEGER(HID_T), INTENT(OUT) :: classtype - END FUNCTION h5pget_class_c - END INTERFACE - - hdferr = h5pget_class_c(prp_id, classtype) - END SUBROUTINE h5pget_class_f - -!****s* H5P/h5pcopy_f -! NAME -! h5pcopy_f -! -! PURPOSE -! Copies an existing property list to create a new -! property list -! -! INPUTS -! prp_id - property list identifier -! OUTPUTS -! new_prp_id - new property list identifier -! hdferr: - error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 14, 2001 -! -! Fortran90 Interface: - SUBROUTINE h5pcopy_f(prp_id, new_prp_id, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER(HID_T), INTENT(OUT) :: new_prp_id ! Identifier of property list - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! 0 on success and -1 on failure -!***** - -! INTEGER, EXTERNAL :: h5pcopy_c -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5pcopy_c(prp_id, new_prp_id) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PCOPY_C'::h5pcopy_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: prp_id - INTEGER(HID_T), INTENT(OUT) :: new_prp_id - END FUNCTION h5pcopy_c - END INTERFACE - - hdferr = h5pcopy_c(prp_id, new_prp_id) - END SUBROUTINE h5pcopy_f - -!****s* H5P/h5pclose_f -! NAME -! h5pclose_f -! -! PURPOSE -! Terminates access to a property list. -! -! INPUTS -! prp_id - identifier of the property list to -! terminate access to. -! OUTPUTS -! hdferr - error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 14, 2001 -! -! Fortran90 Interface: - SUBROUTINE h5pclose_f(prp_id, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! 0 on success and -1 on failure -!***** - -! INTEGER, EXTERNAL :: h5pclose_c -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5pclose_c(prp_id) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PCLOSE_C'::h5pclose_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: prp_id - END FUNCTION h5pclose_c - END INTERFACE - - hdferr = h5pclose_c(prp_id) - END SUBROUTINE h5pclose_f - -!****s* H5P/h5pset_chunk_f -! NAME -! h5pset_chunk_f -! -! PURPOSE -! Sets the size of the chunks used to store -! a chunked layout dataset. -! -! INPUTS -! prp_id - datatset creation property list identifier -! ndims - number of dimensions for each chunk -! dims - array with dimension sizes for each chunk -! OUTPUTS -! hdferr - error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 14, 2001 -! -! Fortran90 Interface: - SUBROUTINE h5pset_chunk_f(prp_id, ndims, dims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER, INTENT(IN) :: ndims ! Number of chunk dimensions - INTEGER(HSIZE_T), DIMENSION(ndims), INTENT(IN) :: dims - ! Array containing sizes of - ! chunk dimensions - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! 0 on success and -1 on failure -!***** - -! INTEGER, EXTERNAL :: h5pset_chunk_c -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5pset_chunk_c(prp_id, ndims, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_CHUNK_C'::h5pset_chunk_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: prp_id - INTEGER, INTENT(IN) :: ndims - INTEGER(HSIZE_T), DIMENSION(ndims), INTENT(IN) :: dims - END FUNCTION h5pset_chunk_c - END INTERFACE - - hdferr = h5pset_chunk_c(prp_id, ndims, dims) - END SUBROUTINE h5pset_chunk_f - -!****s* H5P/h5pget_chunk_f -! NAME -! h5pget_chunk_f -! -! PURPOSE -! Retrieves the size of chunks for the raw data of a -! chunked layout dataset -! -! INPUTS -! prp_id - property list identifier -! ndims - size of dims array -! OUTPUTS -! dims - array with dimension sizes for each chunk -! hdferr - error code -! Success: number of chunk dimensions -! Failure: -1 -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 14, 2001 -! -! Fortran90 Interface: - SUBROUTINE h5pget_chunk_f(prp_id, ndims, dims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER, INTENT(IN) :: ndims ! Number of chunk dimensions to - ! to return - INTEGER(HSIZE_T), DIMENSION(ndims), INTENT(OUT) :: dims - ! Array containing sizes of - ! chunk dimensions - INTEGER, INTENT(OUT) :: hdferr ! Error code: - ! number of chunk dimensions on success, - ! -1 on failure -!***** -! INTEGER, EXTERNAL :: h5pget_chunk_c -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5pget_chunk_c(prp_id, ndims, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGET_CHUNK_C'::h5pget_chunk_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: prp_id - INTEGER :: ndims - INTEGER(HSIZE_T), DIMENSION(*), INTENT(OUT) :: dims - END FUNCTION h5pget_chunk_c - END INTERFACE - - hdferr = h5pget_chunk_c(prp_id, ndims, dims) - END SUBROUTINE h5pget_chunk_f - -!****s* H5P/h5pset_deflate_f -! NAME -! h5pset_deflate_f -! -! PURPOSE -! Sets compression method and compression level. -! -! INPUTS -! prp_id - property list identifier -! level - compression level -! OUTPUTS -! -! hdferr - error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 14, 2001 -! -! Fortran90 Interface: - SUBROUTINE h5pset_deflate_f(prp_id, level, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER, INTENT(IN) :: level ! Compression level - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! 0 on success and -1 on failure -!***** - -! INTEGER, EXTERNAL :: h5pset_deflate_c -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5pset_deflate_c(prp_id, level) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_DEFLATE_C'::h5pset_deflate_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: prp_id - INTEGER, INTENT(IN) :: level - END FUNCTION h5pset_deflate_c - END INTERFACE - hdferr = h5pset_deflate_c(prp_id, level) - - END SUBROUTINE h5pset_deflate_f - -!****s* H5P/h5pget_version_f -! NAME -! h5pget_version_f -! -! PURPOSE -! Retrieves the version information of various objects -! for a file creation property list -! -! INPUTS -! prp_id - file createion property list identifier -! OUTPUTS -! boot - super block version number -! freelist - global freelist version number -! stab - symbol table version number -! shhdr - shared object header version number -! hdferr - error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 14, 2001 -! -! Fortran90 Interface: - SUBROUTINE h5pget_version_f(prp_id, boot, freelist, & - stab, shhdr, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER, DIMENSION(:), INTENT(OUT) :: boot ! Array to put boot - ! block version number - INTEGER, DIMENSION(:), INTENT(OUT) :: freelist ! Array to put global - ! Freelist version number - - INTEGER, DIMENSION(:), INTENT(OUT) :: stab ! Array to put symbol - ! table version number - INTEGER, DIMENSION(:), INTENT(OUT) :: shhdr ! Array to put shared - ! object header version number - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! 0 on success and -1 on failure -!***** - -! INTEGER, EXTERNAL :: h5pget_version_c -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5pget_version_c(prp_id, boot, freelist, stab, shhdr) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGET_VERSION_C'::h5pget_version_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: prp_id - INTEGER, DIMENSION(:), INTENT(OUT) :: boot - INTEGER, DIMENSION(:), INTENT(OUT) :: freelist - INTEGER, DIMENSION(:), INTENT(OUT) :: stab - INTEGER, DIMENSION(:), INTENT(OUT) :: shhdr - END FUNCTION h5pget_version_c - END INTERFACE - - hdferr = h5pget_version_c(prp_id, boot, freelist, stab, shhdr) - END SUBROUTINE h5pget_version_f - -!****s* H5P/h5pset_userblock_f -! NAME -! h5pset_userblock_f -! -! PURPOSE -! Sets user block size -! -! INPUTS -! prp_id - file creation property list to modify -! size - size of the user-block in bytes -! -! OUTPUTS -! hdferr - error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 14, 2001 -! -! Fortran90 Interface: - SUBROUTINE h5pset_userblock_f (prp_id, size, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER(HSIZE_T), INTENT(IN) :: size ! Size of the user-block in bytes - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! 0 on success and -1 on failure -!***** - -! INTEGER, EXTERNAL :: h5pset_userblock_c -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5pset_userblock_c(prp_id, size) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_USERBLOCK_C'::h5pset_userblock_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: prp_id - INTEGER(HSIZE_T), INTENT(IN) :: size - END FUNCTION h5pset_userblock_c - END INTERFACE - - hdferr = h5pset_userblock_c(prp_id, size) - END SUBROUTINE h5pset_userblock_f - -!****s* H5P/h5pget_userblock_f -! NAME -! h5pget_userblock_f -! -! PURPOSE -! Gets user block size. -! -! INPUTS -! -! prp_id - file creation property list identifier -! OUTPUTS -! -! block_size - size of the user block in bytes -! hdferr - error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 14, 2001 -! -! Fortran90 Interface: - SUBROUTINE h5pget_userblock_f(prp_id, block_size, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER(HSIZE_T), INTENT(OUT) :: block_size ! Size of the - ! user-block in bytes - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! 0 on success and -1 on failure -!***** -! INTEGER, EXTERNAL :: h5pget_userblock_c -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5pget_userblock_c(prp_id, block_size) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGET_USERBLOCK_C'::h5pget_userblock_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: prp_id - INTEGER(HSIZE_T), INTENT(OUT) :: block_size - END FUNCTION h5pget_userblock_c - END INTERFACE - hdferr = h5pget_userblock_c(prp_id, block_size) - END SUBROUTINE h5pget_userblock_f - -!****s* H5P/h5pset_sizes_f -! NAME -! h5pset_sizes_f -! -! PURPOSE -! Sets the byte size of the offsets and lengths used -! to address objects in an HDF5 file. -! -! INPUTS -! prp_id - file creation property list identifier -! sizeof_addr - size of an object offset in bytes -! sizeof_size - size of an object length in bytes -! OUTPUTS -! -! hdferr - error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 14, 2001 -! -! Fortran90 Interface: - SUBROUTINE h5pset_sizes_f (prp_id, sizeof_addr, sizeof_size, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER(SIZE_T), INTENT(IN) :: sizeof_addr ! Size of an object - ! offset in bytes - INTEGER(SIZE_T), INTENT(IN) :: sizeof_size ! Size of an object - ! length in bytes - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! 0 on success and -1 on failure -!***** -! INTEGER, EXTERNAL :: h5pset_sizes_c -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5pset_sizes_c(prp_id, sizeof_addr, sizeof_size) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_SIZES_C'::h5pset_sizes_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: prp_id - INTEGER(SIZE_T), INTENT(IN) :: sizeof_addr - INTEGER(SIZE_T), INTENT(IN) :: sizeof_size - END FUNCTION h5pset_sizes_c - END INTERFACE - - hdferr = h5pset_sizes_c(prp_id, sizeof_addr, sizeof_size) - END SUBROUTINE h5pset_sizes_f - -!****s* H5P/h5pget_sizes_f -! NAME -! h5pget_sizes_f -! -! PURPOSE -! Retrieves the size of the offsets and lengths used -! in an HDF5 file -! -! INPUTS -! prp_id - file creation property list identifier -! OUTPUTS -! -! sizeof_addr - size of an object offset in bytes -! sizeof_size - size of an object length in bytes -! hdferr - error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 14, 2001 -! -! Fortran90 Interface: - SUBROUTINE h5pget_sizes_f(prp_id, sizeof_addr, sizeof_size, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER(SIZE_T), INTENT(OUT) :: sizeof_addr ! Size of an object - ! offset in bytes - INTEGER(SIZE_T), INTENT(OUT) :: sizeof_size ! Size of an object - ! length in bytes - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! 0 on success and -1 on failure -!***** -! INTEGER, EXTERNAL :: h5pget_sizes_c -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5pget_sizes_c(prp_id, sizeof_addr, sizeof_size) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGET_SIZES_C'::h5pget_sizes_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: prp_id - INTEGER(SIZE_T), INTENT(OUT) :: sizeof_addr - INTEGER(SIZE_T), INTENT(OUT) :: sizeof_size - END FUNCTION h5pget_sizes_c - END INTERFACE - - hdferr = h5pget_sizes_c(prp_id, sizeof_addr, sizeof_size) - END SUBROUTINE h5pget_sizes_f - -!****s* H5P/h5pset_sym_k_f -! NAME -! h5pset_sym_k_f -! -! PURPOSE -! Sets the size of parameters used to control the -!symbol table nodes -! -! INPUTS -! -! prp_id - file creation property list identifier -! ik - symbol table tree rank -! lk - symbol table node size -! OUTPUTS -! -! hdferr - error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 14, 2001 -! -! Fortran90 Interface: - SUBROUTINE h5pset_sym_k_f (prp_id, ik, lk, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER, INTENT(IN) :: ik ! Symbol table tree rank - INTEGER, INTENT(IN) :: lk ! Symbol table node size - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! 0 on success and -1 on failure -!***** - -! INTEGER, EXTERNAL :: h5pset_sym_k_c -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5pset_sym_k_c(prp_id, ik, lk) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_SYM_K_C'::h5pset_sym_k_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: prp_id - INTEGER, INTENT(IN) :: ik - INTEGER, INTENT(IN) :: lk - END FUNCTION h5pset_sym_k_c - END INTERFACE - - hdferr = h5pset_sym_k_c(prp_id, ik, lk) - END SUBROUTINE h5pset_sym_k_f -!****s* H5P/h5pget_sym_k_f -! NAME -! h5pget_sym_k_f -! -! PURPOSE -! Retrieves the size of the symbol table B-tree 1/2 rank -! and the symbol table leaf node 1/2 size. -! -! INPUTS -! -! prp_id - file creation property list identifier -! OUTPUTS -! -! ik - symbol table tree 1/2 rank -! lk - symbol table node 1/2 size -! hdferr - error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 14, 2001 -! -! Fortran90 Interface: - SUBROUTINE h5pget_sym_k_f(prp_id, ik, lk, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER, INTENT(OUT) :: ik ! Symbol table tree rank - INTEGER, INTENT(OUT) :: lk ! Symbol table node size - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! 0 on success and -1 on failure -!***** - -! INTEGER, EXTERNAL :: h5pget_sym_k_c -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5pget_sym_k_c(prp_id, ik, lk) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGET_SYM_K_C'::h5pget_sym_k_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: prp_id - INTEGER, INTENT(OUT) :: ik - INTEGER, INTENT(OUT) :: lk - END FUNCTION h5pget_sym_k_c - END INTERFACE - - hdferr = h5pget_sym_k_c(prp_id, ik, lk) - END SUBROUTINE h5pget_sym_k_f -!****s* H5P/h5pset_istore_k_f -! NAME -! h5pset_istore_k_f -! -! PURPOSE -! Sets the size of the parameter used to control the -! B-trees for indexing chunked datasets -! -! INPUTS -! -! prp_id - file creation property list identifier -! ik - 1/2 rank of chunked storage B-tree -! OUTPUTS -! -! hdferr - error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 14, 2001 -! -! Fortran90 Interface: - SUBROUTINE h5pset_istore_k_f (prp_id, ik, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER, INTENT(IN) :: ik ! 1/2 rank of chunked storage B-tree - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! 0 on success and -1 on failure -!***** - -! INTEGER, EXTERNAL :: h5pset_istore_k_c -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5pset_istore_k_c(prp_id, ik) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_ISTORE_K_C'::h5pset_istore_k_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: prp_id - INTEGER, INTENT(IN) :: ik - END FUNCTION h5pset_istore_k_c - END INTERFACE - - hdferr = h5pset_istore_k_c(prp_id, ik) - END SUBROUTINE h5pset_istore_k_f - -!****s* H5P/h5pget_istore_k_f -! NAME -! h5pget_istore_k_f -! -! PURPOSE -! Queries the 1/2 rank of an indexed storage B-tree. -! -! INPUTS -! -! prp_id - file creation property list identifier -! OUTPUTS -! -! ik - 1/2 rank of chunked storage B-tree -! hdferr - error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 14, 2001 -! -! Fortran90 Interface: - SUBROUTINE h5pget_istore_k_f(prp_id, ik, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER, INTENT(OUT) :: ik ! 1/2 rank of chunked storage B-tree - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! 0 on success and -1 on failure -!***** - -! INTEGER, EXTERNAL :: h5pget_istore_k_c -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5pget_istore_k_c(prp_id, ik) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGET_ISTORE_K_C'::h5pget_istore_k_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: prp_id - INTEGER, INTENT(OUT) :: ik - END FUNCTION h5pget_istore_k_c - END INTERFACE - - hdferr = h5pget_istore_k_c(prp_id, ik) - END SUBROUTINE h5pget_istore_k_f - -!****s* H5P/h5pget_driver_f -! NAME -! h5pget_driver_f -! -! PURPOSE -! Returns low-lever driver identifier. -! -! INPUTS -! -! prp_id - file access or data transfer property -! list identifier. -! OUTPUTS -! -! driver - low-level driver identifier -! hdferr - error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 14, 2001 -! -! Fortran90 Interface: - SUBROUTINE h5pget_driver_f(prp_id, driver, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER(HID_T), INTENT(OUT) :: driver ! Low-level file driver identifier - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! 0 on success and -1 on failure -!***** -! INTEGER, EXTERNAL :: h5pget_driver_c -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5pget_driver_c(prp_id, driver) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGET_DRIVER_C'::h5pget_driver_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: prp_id - INTEGER(HID_T), INTENT(OUT) :: driver - END FUNCTION h5pget_driver_c - END INTERFACE - - hdferr = h5pget_driver_c(prp_id, driver) - END SUBROUTINE h5pget_driver_f - -!****s* H5P/h5pset_fapl_stdio_f -! NAME -! h5pset_fapl_stdio_f -! -! PURPOSE -! Sets the standard I/O driver. -! -! INPUTS -! -! prp_id - file access property list identifier -! OUTPUTS -! -! hdferr - error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 14, 2001 -! -! Fortran90 Interface: - SUBROUTINE h5pset_fapl_stdio_f (prp_id, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! 0 on success and -1 on failure -!***** - -! INTEGER, EXTERNAL :: h5pset_fapl_stdio_c -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5pset_fapl_stdio_c(prp_id) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_FAPL_STDIO_C'::h5pset_fapl_stdio_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: prp_id - END FUNCTION h5pset_fapl_stdio_c - END INTERFACE - - hdferr = h5pset_fapl_stdio_c(prp_id) - END SUBROUTINE h5pset_fapl_stdio_f - -!****s* H5P/h5pget_stdio_f -! NAME -! h5pget_stdio_f -! -! PURPOSE -! NOT AVAILABLE -! -! INPUTS -! -! OUTPUTS -! -! hdferr - error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 14, 2001 -! -! SOURCE -! SUBROUTINE h5pget_stdio_f (prp_id, io, hdferr) -! -! IMPLICIT NONE -! INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier -! INTEGER, INTENT(OUT) :: io ! value indicates that the file - !access property list is set to - !the stdio driver -! INTEGER, INTENT(OUT) :: hdferr ! Error code - ! 0 on success and -1 on failure -!***** -! INTEGER, EXTERNAL :: h5pget_stdio_c -! hdferr = h5pget_stdio_c(prp_id, io) -! END SUBROUTINE h5pget_stdio_f - -!****s* H5P/h5pset_fapl_sec2_f -! NAME -! h5pset_fapl_sec2_f -! -! PURPOSE -! Sets the sec2 driver. -! -! INPUTS -! -! prp_id - file access property list identifier -! OUTPUTS -! -! hdferr - error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 14, 2001 -! -! Fortran90 Interface: - SUBROUTINE h5pset_fapl_sec2_f (prp_id, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! 0 on success and -1 on failure -!***** - -! INTEGER, EXTERNAL :: h5pset_fapl_sec2_c -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5pset_fapl_sec2_c(prp_id) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_FAPL_SEC2_C'::h5pset_fapl_sec2_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - END FUNCTION h5pset_fapl_sec2_c - END INTERFACE - - hdferr = h5pset_fapl_sec2_c(prp_id) - END SUBROUTINE h5pset_fapl_sec2_f - -!****s* H5P/h5pget_sec2_f -! NAME -! h5pget_sec2_f -! -! PURPOSE -! NOT AVAILABLE -! -! INPUTS -! -! OUTPUTS -! -! hdferr - error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 14, 2001 -! -! SOURCE! SUBROUTINE h5pget_sec2_f (prp_id, sec2, hdferr) -! IMPLICIT NONE -! INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier -! INTEGER, INTENT(OUT) :: sec2 ! value indicates whether the file - !driver uses the functions declared - !in the unistd.h file -! INTEGER, INTENT(OUT) :: hdferr ! Error code - ! 0 on success and -1 on failure -!***** -! INTEGER, EXTERNAL :: h5pget_sec2_c -! hdferr = h5pget_sec2_c(prp_id, sec2) -! END SUBROUTINE h5pget_sec2_f - -!****s* H5P/h5pset_alignment_f -! NAME -! h5pset_alignment_f -! -! PURPOSE -! Sets alignment properties of a file access property list. -! -! INPUTS -! -! prp_id - file access property list identifier -! threshold - threshold value -! alignment - alignment value -! OUTPUTS -! -! hdferr - error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 14, 2001 -! -! Fortran90 Interface: - SUBROUTINE h5pset_alignment_f(prp_id, threshold, alignment, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER(HSIZE_T), INTENT(IN) :: threshold ! Threshold value - INTEGER(HSIZE_T), INTENT(IN) :: alignment ! alignment value - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! 0 on success and -1 on failure -!***** - -! INTEGER, EXTERNAL :: h5pset_alignment_c -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5pset_alignment_c(prp_id, threshold, alignment) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_ALIGNMENT_C'::h5pset_alignment_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: prp_id - INTEGER(HSIZE_T), INTENT(IN) :: threshold - INTEGER(HSIZE_T), INTENT(IN) :: alignment - END FUNCTION h5pset_alignment_c - END INTERFACE - - hdferr = h5pset_alignment_c(prp_id, threshold, alignment) - END SUBROUTINE h5pset_alignment_f - -!****s* H5P/h5pget_alignment_f -! NAME -! h5pget_alignment_f -! -! PURPOSE -! Retrieves the current settings for alignment -! properties from a file access property list. -! -! INPUTS -! prp_id - file access property list identifier -! -! OUTPUTS -! threshold - threshold value -! alignment - alignment value -! hdferr - error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 14, 2001 -! -! Fortran90 Interface: - SUBROUTINE h5pget_alignment_f(prp_id, threshold, alignment, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER(HSIZE_T), INTENT(OUT) :: threshold ! Threshold value - INTEGER(HSIZE_T), INTENT(OUT) :: alignment ! alignment value - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! 0 on success and -1 on failure -!***** -! INTEGER, EXTERNAL :: h5pget_alignment_c -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5pget_alignment_c(prp_id, threshold, alignment) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGET_ALIGNMENT_C'::h5pget_alignment_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: prp_id - INTEGER(HSIZE_T), INTENT(OUT) :: threshold - INTEGER(HSIZE_T), INTENT(OUT) :: alignment - END FUNCTION h5pget_alignment_c - END INTERFACE - - hdferr = h5pget_alignment_c(prp_id, threshold, alignment) - END SUBROUTINE h5pget_alignment_f - -!****s* H5P/h5pset_fapl_core_f -! NAME -! h5pset_fapl_core_f -! -! PURPOSE -! Modifies the file access property list to use the -! H5FD_CORE driver. -! -! INPUTS -! prp_id - file access property list identifier -! increment - size, in bytes, of memory increments -! backing_store - boolean flag indicating whether to write -! the file contents to disk when the file is closed. -! OUTPUTS -! hdferr - error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 14, 2001 -! -! Fortran90 Interface: - SUBROUTINE h5pset_fapl_core_f(prp_id, increment, backing_store, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER(SIZE_T), INTENT(IN) :: increment ! File block size in bytes. - LOGICAL, INTENT(IN) :: backing_store ! Flag to indicate that - ! entire file contents are flushed to a file - ! with the same name as this core file. - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! 0 on success and -1 on failure -!***** - INTEGER :: backing_store_flag - -! INTEGER, EXTERNAL :: h5pset_fapl_core_c -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5pset_fapl_core_c(prp_id, increment, backing_store_flag) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_FAPL_CORE_C'::h5pset_fapl_core_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: prp_id - INTEGER(SIZE_T), INTENT(IN) :: increment - INTEGER :: backing_store_flag - END FUNCTION h5pset_fapl_core_c - END INTERFACE - backing_store_flag = 0 - IF(backing_store) backing_store_flag = 1 - hdferr = h5pset_fapl_core_c(prp_id, increment, backing_store_flag) - END SUBROUTINE h5pset_fapl_core_f - -!****s* H5P/h5pget_fapl_core_f -! NAME -! h5pget_fapl_core_f -! -! PURPOSE -! Queries core file driver properties. -! -! INPUTS -! prp_id - file access property list identifier -! OUTPUTS -! -! increment - size, in bytes, of memory increments -! backing_store - boolean flag indicating whether to write -! the file contents to disk when the file is closed. -! hdferr - error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 14, 2001 -! -! Fortran90 Interface: - SUBROUTINE h5pget_fapl_core_f(prp_id, increment, backing_store, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER(SIZE_T), INTENT(OUT) :: increment ! File block size in bytes. - LOGICAL, INTENT(OUT) :: backing_store ! Flag to indicate that - ! entire file contents are flushed to a file - ! with the same name as this core file. - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! 0 on success and -1 on failure -!***** - INTEGER :: backing_store_flag - - INTERFACE - INTEGER FUNCTION h5pget_fapl_core_c(prp_id, increment, backing_store_flag) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGET_FAPL_CORE_C'::h5pget_fapl_core_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: prp_id - INTEGER(SIZE_T), INTENT(OUT) :: increment - INTEGER :: backing_store_flag - END FUNCTION h5pget_fapl_core_c - END INTERFACE - - hdferr = h5pget_fapl_core_c(prp_id, increment, backing_store_flag) - backing_store =.FALSE. - IF (backing_store_flag .EQ. 1) backing_store =.TRUE. - END SUBROUTINE h5pget_fapl_core_f - -!****s* H5P/ h5pset_fapl_family_f -! NAME -! h5pset_fapl_family_f -! -! PURPOSE -! Sets the file access property list to use the family driver. -! -! INPUTS -! prp_id - file access property list identifier -! memb_size - size in bytes of each file member -! memb_plist - identifier of the file access property -! list to be used for each family member -! OUTPUTS -! hdferr - error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 14, 2001 -! -! Fortran90 Interface: - SUBROUTINE h5pset_fapl_family_f(prp_id, memb_size, memb_plist , hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER(HSIZE_T), INTENT(IN) :: memb_size ! Logical size, in bytes, - ! of each family member - INTEGER(HID_T), INTENT(IN) :: memb_plist ! Identifier of the file - ! access property list for - ! each member of the family - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! 0 on success and -1 on failure -!***** - -! INTEGER, EXTERNAL :: h5pset_fapl_family_f -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5pset_fapl_family_c(prp_id, memb_size, memb_plist) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_FAPL_FAMILY_C'::h5pset_fapl_family_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: prp_id - INTEGER(HSIZE_T), INTENT(IN) :: memb_size - INTEGER(HID_T), INTENT(IN) :: memb_plist - END FUNCTION h5pset_fapl_family_c - END INTERFACE - - hdferr = h5pset_fapl_family_c(prp_id, memb_size, memb_plist) - END SUBROUTINE h5pset_fapl_family_f - -!****s* H5P/h5pget_fapl_family_f -! NAME -! h5pget_fapl_family_f -! -! PURPOSE -! Returns file access property list information. -! -! INPUTS -! prp_id - file access property list identifier -! OUTPUTS -! memb_size - size in bytes of each file member -! memb_plist - identifier of the file access property -! list to be used for each family member -! hdferr - error code -! Success: 0 -! Failure: -1 -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 14, 2001 -! -! Fortran90 Interface: - SUBROUTINE h5pget_fapl_family_f(prp_id, memb_size, memb_plist , hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER(HSIZE_T), INTENT(OUT) :: memb_size ! Logical size, in bytes, - ! of each family member - INTEGER(HID_T), INTENT(OUT) :: memb_plist ! Identifier of the file - ! access property list for - ! each member of the family - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! 0 on success and -1 on failure -!***** - -! INTEGER, EXTERNAL :: h5pget_fapl_family_f -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5pget_fapl_family_c(prp_id, memb_size, memb_plist) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGET_FAPL_FAMILY_C'::h5pget_fapl_family_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: prp_id - INTEGER(HSIZE_T), INTENT(OUT) :: memb_size - INTEGER(HID_T), INTENT(OUT) :: memb_plist - END FUNCTION h5pget_fapl_family_c - END INTERFACE - - hdferr = h5pget_fapl_family_c(prp_id, memb_size, memb_plist) - END SUBROUTINE h5pget_fapl_family_f - -!****s* H5P/h5pset_cache_f -! NAME -! h5pset_cache_f -! -! PURPOSE -! Sets the meta data cache and raw data chunk -! cache parameters -! -! INPUTS -! -! prp_id - file access property list identifier -! mdc_nelmts - number of elements (objects) in the meta -! data cache -! rdcc_nelmts - number of elements (objects) in the raw -! data chunk cache -! rdcc_nbytes - total size of the raw data chunk cache, in bytes -! rdcc_w0 - preemption policy (0 or 1) -! OUTPUTS -! -! hdferr - error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 14, 2001 -! -! Fortran90 Interface: - SUBROUTINE h5pset_cache_f(prp_id, mdc_nelmts,rdcc_nelmts, rdcc_nbytes, rdcc_w0, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER, INTENT(IN) :: mdc_nelmts ! Number of elements (objects) - ! in the meta data cache - INTEGER(SIZE_T), INTENT(IN) :: rdcc_nelmts ! Number of elements (objects) - ! in the meta data cache - INTEGER(SIZE_T), INTENT(IN) :: rdcc_nbytes ! Total size of the raw data - ! chunk cache, in bytes - REAL, INTENT(IN) :: rdcc_w0 ! Preemption policy - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! 0 on success and -1 on failure -!***** - -! INTEGER, EXTERNAL :: h5pset_cache_c -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5pset_cache_c(prp_id,mdc_nelmts,rdcc_nelmts,rdcc_nbytes,rdcc_w0) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_CACHE_C'::h5pset_cache_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: prp_id - INTEGER, INTENT(IN) :: mdc_nelmts - INTEGER(SIZE_T), INTENT(IN) :: rdcc_nelmts - INTEGER(SIZE_T), INTENT(IN) :: rdcc_nbytes - REAL, INTENT(IN) :: rdcc_w0 - END FUNCTION h5pset_cache_c - END INTERFACE - - hdferr = h5pset_cache_c(prp_id, mdc_nelmts, rdcc_nelmts, rdcc_nbytes, rdcc_w0 ) - END SUBROUTINE h5pset_cache_f - -!****s* H5P/h5pget_cache_f -! NAME -! h5pget_cache_f -! -! PURPOSE -! Queries the meta data cache and raw data chunk cache -! parameters. -! -! INPUTS -! prp_id - file access property list identifier -! -! OUTPUTS -! mdc_nelmts - number of elements (objects) in the meta -! data cache -! rdcc_nelmts - number of elements (objects) in the raw -! data chunk cache -! rdcc_nbytes - total size of the raw data chunk cache, in bytes -! rdcc_w0 - preemption policy (0 or 1) -! hdferr - error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 14, 2001 -! -! Bug fix: type of the rdcc_nelmts parameter should be INTEGER -! instead of INTEGER(SIZE_T) October 10, 2003 -! -! Fortran90 Interface: - SUBROUTINE h5pget_cache_f(prp_id, mdc_nelmts, rdcc_nelmts, rdcc_nbytes, rdcc_w0, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER, INTENT(OUT) :: mdc_nelmts ! Number of elements (objects) - ! in the meta data cache - INTEGER(SIZE_T), INTENT(OUT) :: rdcc_nelmts ! Number of elements (objects) - ! in the meta data cache - INTEGER(SIZE_T), INTENT(OUT) :: rdcc_nbytes ! Total size of the raw data - ! chunk cache, in bytes - REAL, INTENT(OUT) :: rdcc_w0 ! Preemption policy - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! 0 on success and -1 on failure -!***** -! INTEGER, EXTERNAL :: h5pget_cache_c -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5pget_cache_c(prp_id,mdc_nelmts,rdcc_nelmts,rdcc_nbytes,rdcc_w0) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGET_CACHE_C'::h5pget_cache_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: prp_id - INTEGER, INTENT(OUT) :: mdc_nelmts - INTEGER(SIZE_T), INTENT(OUT) :: rdcc_nelmts - INTEGER(SIZE_T), INTENT(OUT) :: rdcc_nbytes - REAL, INTENT(OUT) :: rdcc_w0 - END FUNCTION h5pget_cache_c - END INTERFACE - - hdferr = h5pget_cache_c(prp_id, mdc_nelmts,rdcc_nelmts, rdcc_nbytes, rdcc_w0 ) - END SUBROUTINE h5pget_cache_f - -!****s* H5P/h5pset_fapl_split_f -! NAME -! h5pset_fapl_split_f -! -! PURPOSE -! Emulates the old split file driver. -! -! INPUTS -! -! prp_id - file access property list identifier -! meta_ext - name of the extension for the metafile -! filename -! meta_plist - identifier of the meta file access property -! list -! raw_ext - name extension for the raw file filename -! raw_plist - identifier of the raw file access property list -! -! OUTPUTS -! -! hdferr - error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 14, 2001 -! -! Fortran90 Interface: - SUBROUTINE h5pset_fapl_split_f(prp_id, meta_ext, meta_plist, raw_ext, raw_plist, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - CHARACTER(LEN=*), INTENT(IN) :: meta_ext ! Name of the extension for - ! the metafile filename - INTEGER(HID_T), INTENT(IN) :: meta_plist ! Identifier of the meta file - ! access property list - CHARACTER(LEN=*), INTENT(IN) :: raw_ext ! Name extension for the raw file filename - INTEGER(HID_T), INTENT(IN) :: raw_plist ! Identifier of the raw file - ! access property list - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! 0 on success and -1 on failure -!***** - INTEGER :: meta_len, raw_len - -! INTEGER, EXTERNAL :: h5pset_fapl_split_c -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5pset_fapl_split_c(prp_id,meta_len,meta_ext,meta_plist,raw_len,raw_ext,raw_plist) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_FAPL_SPLIT_C'::h5pset_fapl_split_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: meta_ext - !DEC$ATTRIBUTES reference :: raw_ext - INTEGER(HID_T), INTENT(IN) :: prp_id - CHARACTER(LEN=*), INTENT(IN) :: meta_ext - INTEGER(HID_T), INTENT(IN) :: meta_plist - CHARACTER(LEN=*), INTENT(IN) :: raw_ext - INTEGER(HID_T), INTENT(IN) :: raw_plist - INTEGER :: meta_len, raw_len - END FUNCTION h5pset_fapl_split_c - END INTERFACE - - meta_len = LEN(meta_ext) - raw_len = LEN(raw_ext) - hdferr = h5pset_fapl_split_c(prp_id,meta_len,meta_ext,meta_plist,raw_len,raw_ext,raw_plist) - END SUBROUTINE h5pset_fapl_split_f - -!****s* H5P/h5pget_split_f -! NAME -! h5pget_split_f -! -! PURPOSE -! NOT AVAILABLE -! -! INPUTS -! -! OUTPUTS -! -! hdferr - error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 14, 2001 -! -! SOURCE -! SUBROUTINE h5pget_split_f(prp_id, meta_ext_size, meta_ext, meta_plist,raw_ext_size,& -! raw_ext, raw_plist, hdferr) -! IMPLICIT NONE -! INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier -! INTEGER(SIZE_T), INTENT(IN) :: meta_ext_size ! Number of characters of the meta - ! file extension to be copied to the - ! meta_ext buffer - -! CHARACTER(LEN=*), INTENT(OUT) :: meta_ext !Name of the extension for - !the metafile filename -! INTEGER(HID_T), INTENT(OUT) :: meta_plist ! Identifier of the meta file - ! access property list -! INTEGER(SIZE_T), INTENT(IN) :: raw_ext_size ! Number of characters of the raw - ! file extension to be copied to the - ! raw_ext buffer -! CHARACTER(LEN=*), INTENT(OUT) :: raw_ext !Name extension for the raw file filename -! INTEGER(HID_T), INTENT(OUT) :: raw_plist !Identifier of the raw file - !access property list -! INTEGER, INTENT(OUT) :: hdferr ! Error code - ! 0 on success and -1 on failure -!***** - -! INTEGER, EXTERNAL :: h5pget_split_c -! hdferr = h5pget_split_c(prp_id, meta_ext_size, meta_ext, meta_plist, & -! raw_ext_size, raw_ext, raw_plist ) -! END SUBROUTINE h5pget_split_f - -!****s* H5P/h5pset_gc_references_f -! NAME -! h5pset_gc_references_f -! -! PURPOSE -! Sets garbage collecting references flag. -! -! INPUTS -! -! prp_id - file access property list identifier -! gc_reference - flag for stting garbage collection on -! and off (1 or 0) -! OUTPUTS -! -! hdferr - error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 14, 2001 -! -! Fortran90 Interface: - SUBROUTINE h5pset_gc_references_f (prp_id, gc_reference, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER, INTENT(IN) :: gc_reference ! The flag for garbage collecting - ! references for the file - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! 0 on success and -1 on failure -!***** - -! INTEGER, EXTERNAL :: h5pset_gc_references_c -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5pset_gc_references_c(prp_id, gc_reference) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_GC_REFERENCES_C'::h5pset_gc_references_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: prp_id - INTEGER, INTENT(IN) :: gc_reference - END FUNCTION h5pset_gc_references_c - END INTERFACE - - hdferr = h5pset_gc_references_c(prp_id, gc_reference) - END SUBROUTINE h5pset_gc_references_f - -!****s* H5P/h5pget_gc_references_f -! NAME -! h5pget_gc_references_f -! -! PURPOSE -! Returns garbage collecting references setting. -! -! INPUTS -! -! prp_id - file access property list identifier -! OUTPUTS -! -! gc_reference - flag for stting garbage collection on -! and off (1 or 0) -! hdferr - error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 14, 2001 -! -! Fortran90 Interface: - SUBROUTINE h5pget_gc_references_f(prp_id, gc_reference, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER, INTENT(OUT) :: gc_reference ! The flag for garbage collecting - ! references for the file - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! 0 on success and -1 on failure -!***** - -! INTEGER, EXTERNAL :: h5pget_gc_references_c -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5pget_gc_references_c(prp_id, gc_reference) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGET_GC_REFERENCES_C'::h5pget_gc_references_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: prp_id - INTEGER, INTENT(OUT) :: gc_reference - END FUNCTION h5pget_gc_references_c - END INTERFACE - - hdferr = h5pget_gc_references_c(prp_id, gc_reference) - END SUBROUTINE h5pget_gc_references_f - -!****s* H5P/h5pset_layout_f -! NAME -! h5pset_layout_f -! -! PURPOSE -! Sets the type of storage used store the raw data -! for a dataset. -! -! INPUTS -! -! prp_id - data creation property list identifier -! layout - type of storage layout for raw data -! possible values are: -! H5D_COMPACT_F -! H5D_CONTIGUOUS_F -! H5D_CHUNKED_F -! OUTPUTS -! -! hdferr - error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 14, 2001 -! -! Fortran90 Interface: - SUBROUTINE h5pset_layout_f (prp_id, layout, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER, INTENT(IN) :: layout ! Type of storage layout for raw data - ! possible values are: - ! H5D_COMPACT_F - ! H5D_CONTIGUOUS_F - ! H5D_CHUNKED_F - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! 0 on success and -1 on failure -!***** - -! INTEGER, EXTERNAL :: h5pset_layout_c -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5pset_layout_c(prp_id, layout) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_LAYOUT_C'::h5pset_layout_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: prp_id - INTEGER, INTENT(IN) :: layout - END FUNCTION h5pset_layout_c - END INTERFACE - - hdferr = h5pset_layout_c(prp_id, layout) - END SUBROUTINE h5pset_layout_f - -!****s* H5P/h5pget_layout_f -! NAME -! h5pget_layout_f -! -! PURPOSE -! Returns the layout of the raw data for a dataset. -! -! INPUTS -! -! prp_id - data creation property list identifier -! OUTPUTS -! -! layout - type of storage layout for raw data -! possible values are: -! H5D_COMPACT_F -! H5D_CONTIGUOUS_F -! H5D_CHUNKED_F -! hdferr - error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 14, 2001 -! -! Fortran90 Interface: - SUBROUTINE h5pget_layout_f (prp_id, layout, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER, INTENT(OUT) :: layout ! Type of storage layout for raw data - ! possible values are: - ! H5D_COMPACT_F(0) - ! H5D_CONTIGUOUS_F(1) - ! H5D_CHUNKED_F(2) - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! 0 on success and -1 on failure -!***** - -! INTEGER, EXTERNAL :: h5pget_layout_c -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5pget_layout_c(prp_id, layout) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGET_LAYOUT_C'::h5pget_layout_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: prp_id - INTEGER, INTENT(OUT) :: layout - END FUNCTION h5pget_layout_c - END INTERFACE - - hdferr = h5pget_layout_c(prp_id, layout) - END SUBROUTINE h5pget_layout_f - -!****s* H5P/h5pset_filter_f -! NAME -! h5pset_filter_f -! -! PURPOSE -! Adds a filter to the filter pipeline. -! -! INPUTS -! -! prp_id - data creation or transfer property list -! identifier -! filter - filter to be added to the pipeline -! flags - bit vector specifying certain general -! properties of the filter -! cd_nelmts - number of elements in cd_values -! cd_values - auxiliary data for the filter -! OUTPUTS -! -! hdferr - error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! Elena Pourmal -! February, 2003 -! -! Fortran90 Interface: - SUBROUTINE h5pset_filter_f(prp_id, filter, flags, cd_nelmts, cd_values, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER, INTENT(IN) :: filter ! Filter to be added to the pipeline. - INTEGER, INTENT(IN) :: flags ! Bit vector specifying certain general - ! properties of the filter. - INTEGER(SIZE_T), INTENT(IN) :: cd_nelmts ! Number of elements in cd_values. - INTEGER, DIMENSION(*), INTENT(IN) :: cd_values ! Auxiliary data for the filter. - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! 0 on success and -1 on failure -!***** - -! INTEGER, EXTERNAL :: h5pset_filter_c -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5pset_filter_c(prp_id, filter, flags, cd_nelmts, cd_values) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_FILTER_C'::h5pset_filter_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: prp_id - INTEGER, INTENT(IN) :: filter - INTEGER, INTENT(IN) :: flags - INTEGER(SIZE_T), INTENT(IN) :: cd_nelmts - INTEGER, DIMENSION(*), INTENT(IN) :: cd_values - END FUNCTION h5pset_filter_c - END INTERFACE - - hdferr = h5pset_filter_c(prp_id, filter, flags, cd_nelmts, cd_values ) - END SUBROUTINE h5pset_filter_f - -!****s* H5P/h5pget_nfilters_f -! NAME -! h5pget_nfilters_f -! -! PURPOSE -! Returns the number of filters in the pipeline. -! -! INPUTS -! -! prp_id - data creation or transfer property list -! identifier -! OUTPUTS -! -! nfilters - number of filters in the pipeline -! hdferr - error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 14, 2001 -! -! Fortran90 Interface: - SUBROUTINE h5pget_nfilters_f (prp_id, nfilters, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER, INTENT(OUT) :: nfilters ! The number of filters in the pipeline - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! 0 on success and -1 on failure -!***** - -! INTEGER, EXTERNAL :: h5pget_nfilters_c -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5pget_nfilters_c(prp_id, nfilters) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGET_NFILTERS_C'::h5pget_nfilters_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: prp_id - INTEGER, INTENT(OUT) :: nfilters - END FUNCTION h5pget_nfilters_c - END INTERFACE - - hdferr = h5pget_nfilters_c(prp_id, nfilters) - END SUBROUTINE h5pget_nfilters_f - -!****s* H5P/h5pget_filter_f -! NAME -! h5pget_filter_f -! -! PURPOSE -! Returns information about a filter in a pipeline -! -! INPUTS -! -! prp_id - data creation or transfer property list -! identifier -! filter_number - sequence number within the filter -! pipeline of the filter for which -! information is sought -! OUTPUTS -! -! filter_id - filter identification number -! flags - bit vector specifying certain general -! properties of the filter -! cd_nelmts - number of elements in cd_values -! cd_values - auxiliary data for the filter -! namelen - number of characters in the name buffer -! name - buffer to retrieve filter name -! hdferr - error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 14, 2001 -! -! Fortran90 Interface: - SUBROUTINE h5pget_filter_f(prp_id, filter_number, flags, cd_nelmts, cd_values, namelen, name, filter_id, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER, INTENT(IN) :: filter_number ! Sequence number within the filter - ! pipeline of the filter for which - ! information is sought - INTEGER, DIMENSION(*), INTENT(OUT) :: cd_values ! Auxiliary data for the filter. - INTEGER, INTENT(OUT) :: flags ! Bit vector specifying certain general - ! properties of the filter. - INTEGER(SIZE_T), INTENT(INOUT) :: cd_nelmts ! Number of elements in cd_values. - INTEGER(SIZE_T), INTENT(IN) :: namelen ! Anticipated number of characters in name. - CHARACTER(LEN=*), INTENT(OUT) :: name ! Name of the filter - INTEGER, INTENT(OUT) :: filter_id ! Filter identification number - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! 0 on success and -1 on failure -!***** - - -! INTEGER, EXTERNAL :: h5pget_filter_c -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5pget_filter_c(prp_id, filter_number, flags, cd_nelmts, & - cd_values, namelen, name, filter_id ) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGET_FILTER_C'::h5pget_filter_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: name - INTEGER(HID_T), INTENT(IN) :: prp_id - INTEGER, INTENT(IN) :: filter_number - INTEGER, DIMENSION(*), INTENT(OUT) :: cd_values - INTEGER, INTENT(OUT) :: flags - INTEGER(SIZE_T), INTENT(INOUT) :: cd_nelmts - INTEGER(SIZE_T), INTENT(IN) :: namelen - CHARACTER(LEN=*), INTENT(OUT) :: name - INTEGER, INTENT(OUT) :: filter_id - END FUNCTION h5pget_filter_c - END INTERFACE - - hdferr = h5pget_filter_c(prp_id, filter_number, flags, cd_nelmts, & - cd_values, namelen, name, filter_id ) - END SUBROUTINE h5pget_filter_f - -!****s* H5P/h5pset_external_f -! NAME -! h5pset_external_f -! -! PURPOSE -! Adds an external file to the list of external files. -! -! INPUTS -! -! prp_id - dataset creation property list identifier -! name - name of external file -! offset - offset in bytes from the beginning of the -! file to the location in the file -! where the data starts -! bytes - size of the external file data. -! OUTPUTS -! hdferr - error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 14, 2001 -! -! Changed type of 'offset' from integer to off_t -- MSB January 9, 2012 -! -! Fortran90 Interface: - SUBROUTINE h5pset_external_f(prp_id, name, offset, bytes, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - CHARACTER(LEN=*), INTENT(IN) :: name ! Name of an external file - INTEGER(OFF_T), INTENT(IN) :: offset ! Offset, in bytes, from the beginning - ! of the file to the location in the file - ! where the data starts. - INTEGER(HSIZE_T), INTENT(IN) :: bytes ! Number of bytes reserved in the - ! file for the data - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! 0 on success and -1 on failure -!***** - - INTEGER :: namelen - - INTERFACE - INTEGER FUNCTION h5pset_external_c(prp_id, name,namelen, offset, bytes) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_EXTERNAL_C'::h5pset_external_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: name - INTEGER(HID_T), INTENT(IN) :: prp_id - CHARACTER(LEN=*), INTENT(IN) :: name - INTEGER :: namelen - INTEGER(OFF_T), INTENT(IN) :: offset - INTEGER(HSIZE_T), INTENT(IN) :: bytes - END FUNCTION h5pset_external_c - END INTERFACE - - namelen = LEN(name) - hdferr = h5pset_external_c(prp_id, name, namelen, offset, bytes) - END SUBROUTINE h5pset_external_f - -!****s* H5P/h5pget_external_count_f -! NAME -! h5pget_external_count_f -! -! PURPOSE -! Returns the number of external files for a dataset. -! -! INPUTS -! -! prp_id - dataset creation property list identifier -! OUTPUTS -! -! count - number of external files for the -! specified dataset -! hdferr - error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 14, 2001 -! -! Fortran90 Interface: - SUBROUTINE h5pget_external_count_f (prp_id, count, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER, INTENT(OUT) :: count ! Number of external files for the - ! Specified dataset - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! 0 on success and -1 on failure -!***** -! INTEGER, EXTERNAL :: h5pget_external_count_c -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5pget_external_count_c(prp_id, count) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGET_EXTERNAL_COUNT_C'::h5pget_external_count_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: prp_id - INTEGER, INTENT(OUT) :: count - END FUNCTION h5pget_external_count_c - END INTERFACE - - hdferr = h5pget_external_count_c(prp_id, count) - END SUBROUTINE h5pget_external_count_f - -!****s* H5P/h5pget_external_f -! NAME -! h5pget_external_f -! -! PURPOSE -! Returns information about an external file. -! -! INPUTS -! -! prp_id - dataset creation property list identifier -! OUTPUTS -! -! idx - external file index -! name_size - maximum size of name array -! name - name of the external file -! name - name of external file -! offset - offset in bytes from the beginning of the -! file to the location in the file -! where the data starts -! bytes - size of the external file data -! hdferr - error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 14, 2001 -! -! Changed type of 'offset' from integer to off_t -- MSB January 9, 2012 -! -! Fortran90 Interface: - SUBROUTINE h5pget_external_f(prp_id, idx, name_size, name, offset,bytes, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER, INTENT(IN) :: idx ! External file index. - INTEGER(SIZE_T), INTENT(IN) :: name_size ! Maximum length of name array - CHARACTER(LEN=*), INTENT(OUT) :: name ! Name of an external file - INTEGER(OFF_T), INTENT(OUT) :: offset ! Offset, in bytes, from the beginning - ! of the file to the location in the file - ! where the data starts. - INTEGER(HSIZE_T), INTENT(OUT) :: bytes ! Number of bytes reserved in the - ! file for the data - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! 0 on success and -1 on failure -!***** - -! INTEGER, EXTERNAL :: h5pget_external_c -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5pget_external_c(prp_id, idx, name_size, name, offset, bytes) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGET_EXTERNAL_C'::h5pget_external_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: name - INTEGER(HID_T), INTENT(IN) :: prp_id - INTEGER, INTENT(IN) :: idx - INTEGER(SIZE_T), INTENT(IN) :: name_size - CHARACTER(LEN=*), INTENT(OUT) :: name - INTEGER(OFF_T), INTENT(OUT) :: offset - INTEGER(HSIZE_T), INTENT(OUT) :: bytes - END FUNCTION h5pget_external_c - END INTERFACE - - hdferr = h5pget_external_c(prp_id, idx, name_size, name, offset, bytes) - END SUBROUTINE h5pget_external_f - -!****s* H5P/h5pset_btree_ratios_f -! NAME -! h5pset_btree_ratios_f -! -! PURPOSE -! Sets B-tree split ratios for a dataset transfer -! property list. -! -! INPUTS -! -! prp_id - the dataset transfer property list -! identifier -! left - the B-tree split ratio for left-most nodes -! middle - the B-tree split ratio for all other nodes -! right - the B-tree split ratio for right-most nodes -! OUTPUTS -! hdferr - error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 14, 2001 -! -! Fortran90 Interface: - SUBROUTINE h5pset_btree_ratios_f(prp_id, left, middle, right, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - REAL, INTENT(IN) :: left ! The B-tree split ratio for left-most nodes. - REAL, INTENT(IN) :: middle ! The B-tree split ratio for all other nodes - REAL, INTENT(IN) :: right ! The B-tree split ratio for right-most - ! nodes and lone nodes. - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! 0 on success and -1 on failure -!***** - -! INTEGER, EXTERNAL :: h5pset_btree_ratios_c -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5pset_btree_ratios_c(prp_id, left, middle, right) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_BTREE_RATIOS_C'::h5pset_btree_ratios_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: prp_id - REAL, INTENT(IN) :: left - REAL, INTENT(IN) :: middle - REAL, INTENT(IN) :: right - END FUNCTION h5pset_btree_ratios_c - END INTERFACE - - hdferr = h5pset_btree_ratios_c(prp_id, left, middle, right) - END SUBROUTINE h5pset_btree_ratios_f - -!****s* H5P/h5pget_btree_ratios_f -! NAME -! h5pget_btree_ratios_f -! -! PURPOSE -! Gets B-tree split ratios for a dataset transfer property list -! -! INPUTS -! -! prp_id - the dataset transfer property list -! identifier -! OUTPUTS -! -! left - the B-tree split ratio for left-most nodes -! middle - the B-tree split ratio for all other nodes -! right - the B-tree split ratio for right-most nodes -! hdferr - error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 14, 2001 -! -! Fortran90 Interface: - SUBROUTINE h5pget_btree_ratios_f(prp_id, left, middle, right, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - REAL, INTENT(OUT) :: left ! The B-tree split ratio for left-most nodes. - REAL, INTENT(OUT) :: middle ! The B-tree split ratio for all other nodes - REAL, INTENT(OUT) :: right ! The B-tree split ratio for right-most - ! nodes and lone nodes. - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! 0 on success and -1 on failure -!***** - - -! INTEGER, EXTERNAL :: h5pget_btree_ratios_c -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5pget_btree_ratios_c(prp_id, left, middle, right) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGET_BTREE_RATIOS_C'::h5pget_btree_ratios_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: prp_id - REAL, INTENT(OUT) :: left - REAL, INTENT(OUT) :: middle - REAL, INTENT(OUT) :: right - END FUNCTION h5pget_btree_ratios_c - END INTERFACE - - hdferr = h5pget_btree_ratios_c(prp_id, left, middle, right) - END SUBROUTINE h5pget_btree_ratios_f - -!****s* H5P/h5pget_fclose_degree_f -! NAME -! h5pget_fclose_degree_f -! -! PURPOSE -! Returns the degree for the file close behavior. -! -! INPUTS -! -! fapl_id - File access property list identifier -! OUTPUTS -! -! degree - Possible values are: -! H5F_CLOSE_DEFAULT_F -! H5F_CLOSE_WEAK_F -! H5F_CLOSE_SEMI_F -! H5F_CLOSE_STRONG_F -! hdferr - error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! Elena Pourmal -! September 26, 2002 -! -! HISTORY -! -! -! Fortran90 Interface: - SUBROUTINE h5pget_fclose_degree_f(fapl_id, degree, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: fapl_id ! File Access Property list identifier - INTEGER, INTENT(OUT) :: degree ! Possible values are: - ! H5F_CLOSE_DEFAULT_F - ! H5F_CLOSE_WEAK_F - ! H5F_CLOSE_SEMI_F - ! H5F_CLOSE_STRONG_F - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! 0 on success and -1 on failure -!***** - -! INTEGER, EXTERNAL :: h5pget_fclose_degree_c -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5pget_fclose_degree_c(fapl_id, degree) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGET_FCLOSE_DEGREE_C'::h5pget_fclose_degree_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: fapl_id - INTEGER, INTENT(OUT) :: degree - END FUNCTION h5pget_fclose_degree_c - END INTERFACE - - hdferr = h5pget_fclose_degree_c(fapl_id, degree) - END SUBROUTINE h5pget_fclose_degree_f - -!****s* H5P/h5pset_fclose_degree_f -! NAME -! h5pset_fclose_degree_f -! -! PURPOSE -! Sets the degree for the file close behavior. -! -! INPUTS -! -! fapl_id - file access property list identifier -! degree - Possible values are: -! H5F_CLOSE_DEFAULT_F -! H5F_CLOSE_WEAK_F -! H5F_CLOSE_SEMI_F -! H5F_CLOSE_STRONG_F -! OUTPUTS -! hdferr - error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! Elena Pourmal -! September 26, 2002 -! -! Fortran90 Interface: - SUBROUTINE h5pset_fclose_degree_f(fapl_id, degree, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: fapl_id ! File Access Property list identifier - INTEGER, INTENT(IN) :: degree ! Possible values are: - ! H5F_CLOSE_DEFAULT_F - ! H5F_CLOSE_WEAK_F - ! H5F_CLOSE_SEMI_F - ! H5F_CLOSE_STRONG_F - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! 0 on success and -1 on failure -!***** - - INTERFACE - INTEGER FUNCTION h5pset_fclose_degree_c(fapl_id, degree) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_FCLOSE_DEGREE_C'::h5pset_fclose_degree_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: fapl_id - INTEGER, INTENT(IN) :: degree - END FUNCTION h5pset_fclose_degree_c - END INTERFACE - - hdferr = h5pset_fclose_degree_c(fapl_id, degree) - END SUBROUTINE h5pset_fclose_degree_f - -!****s* H5P/h5pequal_f -! NAME -! h5pequal_f -! -! PURPOSE -! Checks if two property lists are eqaul -! -! INPUTS -! -! plist1_id - property list identifier -! plist2_id - property list identifier -! OUTPUTS -! -! flag - flag, possible values -! .TRUE. or .FALSE. -! hdferr: - error code -! Success: 0 -! Failure: -1, flag is set to .FALSE. -! -! AUTHOR -! Elena Pourmal -! September 30, 2002 -! -! Fortran90 Interface: - SUBROUTINE h5pequal_f(plist1_id, plist2_id, flag, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: plist1_id ! Property list identifier - INTEGER(HID_T), INTENT(IN) :: plist2_id ! Property list identifier - LOGICAL, INTENT(OUT) :: flag ! Flag - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! 0 on success and -1 on failure -!***** - INTEGER :: c_flag - - INTERFACE - INTEGER FUNCTION h5pequal_c(plist1_id, plist2_id, c_flag) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PEQUAL_C'::h5pequal_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: plist1_id - INTEGER(HID_T), INTENT(IN) :: plist2_id - INTEGER, INTENT(OUT) :: c_flag - END FUNCTION h5pequal_c - END INTERFACE - - flag = .FALSE. - hdferr = h5pequal_c(plist1_id, plist2_id, c_flag) - IF (c_flag .GT. 0) flag = .TRUE. - END SUBROUTINE h5pequal_f - -!****s* H5P/h5pset_buffer_f -! NAME -! h5pset_buffer_f -! -! PURPOSE -! Sets sixe for conversion buffer -! -! INPUTS -! plist_id - data transfer property list identifier -! size - buffer size -! OUTPUTS -! -! hdferr: - error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! Elena Pourmal -! October 2, 2002 -! -! Fortran90 Interface: - SUBROUTINE h5pset_buffer_f(plist_id, size, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: plist_id ! Data transfer property list identifier - INTEGER(HSIZE_T), INTENT(IN) :: size ! Buffer size in bytes; - ! buffer is allocated and freed by - ! the library. - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! 0 on success and -1 on failure -!***** - - INTERFACE - INTEGER FUNCTION h5pset_buffer_c(plist_id, size) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_BUFFER_C'::h5pset_buffer_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: plist_id - INTEGER(HSIZE_T), INTENT(IN) :: size - END FUNCTION h5pset_buffer_c - END INTERFACE - - hdferr = h5pset_buffer_c(plist_id, size) - END SUBROUTINE h5pset_buffer_f - -!****s* H5P/h5pget_buffer_f -! NAME -! h5pget_buffer_f -! -! PURPOSE -! Gets size for conversion buffer -! -! INPUTS -! -! plist_id - data transfer property list identifier -! OUTPUTS -! -! size - buffer size -! hdferr - error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! Elena Pourmal -! October 2, 2002 -! -! Fortran90 Interface: - SUBROUTINE h5pget_buffer_f(plist_id, size, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: plist_id ! Data transfer property list identifier - INTEGER(HSIZE_T), INTENT(OUT) :: size ! Buffer size in bytes; - ! buffer is allocated and freed by - ! the library. - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! 0 on success and -1 on failure -!***** - - INTERFACE - INTEGER FUNCTION h5pget_buffer_c(plist_id, size) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGET_BUFFER_C'::h5pget_buffer_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: plist_id - INTEGER(HSIZE_T), INTENT(OUT) :: size - END FUNCTION h5pget_buffer_c - END INTERFACE - - hdferr = h5pget_buffer_c(plist_id, size) - END SUBROUTINE h5pget_buffer_f - -!****s* H5P/h5pfill_value_defined_f -! NAME -! h5pfill_value_defined_f -! -! PURPOSE -! Check if fill value is defined. -! -! INPUTS -! -! plist_id - dataset creation property list identifier -! OUTPUTS -! -! flag - fill value status flag -! Possible values are: -! H5D_FILL_VALUE_ERROR_F -! H5D_FILL_VALUE_UNDEFINED_F -! H5D_FILL_VALUE_DEFAULT_F -! H5D_FILL_VALUE_USER_DEFINED_F -! hdferr - error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! Elena Pourmal -! October 4, 2002 -! -! Fortran90 Interface: - SUBROUTINE h5pfill_value_defined_f(plist_id, flag, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: plist_id ! Dataset creation property list identifier - INTEGER, INTENT(OUT) :: flag ! Fill value status flag - ! H5D_FILL_VALUE_ERROR_F - ! H5D_FILL_VALUE_UNDEFINED_F - ! H5D_FILL_VALUE_DEFAULT_F - ! H5D_FILL_VALUE_USER_DEFINED_F - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! 0 on success and -1 on failure -!***** - INTERFACE - INTEGER FUNCTION h5pfill_value_defined_c(plist_id, flag) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PFILL_VALUE_DEFINED_C'::h5pfill_value_defined_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: plist_id - INTEGER, INTENT(OUT) :: flag - END FUNCTION h5pfill_value_defined_c - END INTERFACE - - hdferr = h5pfill_value_defined_c(plist_id, flag) - END SUBROUTINE h5pfill_value_defined_f - -!****s* H5P/h5pset_alloc_time_f -! NAME -! h5pset_alloc_time_f -! -! PURPOSE -! Set space allocation time for dataset during creation. -! -! INPUTS -! -! plist_id - dataset creation property list identifier -! flag - allocation time flag: -! H5D_ALLOC_TIME_ERROR_F -! H5D_ALLOC_TIME_DEFAULT_F -! H5D_ALLOC_TIME_EARLY_F -! H5D_ALLOC_TIME_LATE_F -! H5D_ALLOC_TIME_INCR_F -! OUTPUTS -! -! hdferr - error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! Elena Pourmal -! October 4, 2002 -! -! Fortran90 Interface: - SUBROUTINE h5pset_alloc_time_f(plist_id, flag, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: plist_id ! Dataset creation property list identifier - INTEGER, INTENT(IN) :: flag ! Allocation time flag: - ! H5D_ALLOC_TIME_ERROR_F - ! H5D_ALLOC_TIME_DEFAULT_F - ! H5D_ALLOC_TIME_EARLY_F - ! H5D_ALLOC_TIME_LATE_F - ! H5D_ALLOC_TIME_INCR_F - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! 0 on success and -1 on failure -!***** - - INTERFACE - INTEGER FUNCTION h5pset_alloc_time_c(plist_id, flag) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_ALLOC_TIME_C'::h5pset_alloc_time_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: plist_id - INTEGER, INTENT(IN) :: flag - END FUNCTION h5pset_alloc_time_c - END INTERFACE - - hdferr = h5pset_alloc_time_c(plist_id, flag) - END SUBROUTINE h5pset_alloc_time_f - -!****s* H5P/h5pget_alloc_time_f -! NAME -! h5pget_alloc_time_f -! -! PURPOSE -! Get space allocation time for dataset during creation. -! -! INPUTS -! -! plist_id - dataset creation property list identifier -! OUTPUTS -! -! flag - allocation time flag: -! H5D_ALLOC_TIME_ERROR_F -! H5D_ALLOC_TIME_DEFAULT_F -! H5D_ALLOC_TIME_EARLY_F -! H5D_ALLOC_TIME_LATE_F -! H5D_ALLOC_TIME_INCR_F -! hdferr: - error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! Elena Pourmal -! October 4, 2002 -! -! Fortran90 Interface: - SUBROUTINE h5pget_alloc_time_f(plist_id, flag, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: plist_id ! Dataset creation property list identifier - INTEGER, INTENT(OUT) :: flag ! Allocation time flag: - ! H5D_ALLOC_TIME_ERROR_F - ! H5D_ALLOC_TIME_DEFAULT_F - ! H5D_ALLOC_TIME_EARLY_F - ! H5D_ALLOC_TIME_LATE_F - ! H5D_ALLOC_TIME_INCR_F - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! 0 on success and -1 on failure -!***** - - INTERFACE - INTEGER FUNCTION h5pget_alloc_time_c(plist_id, flag) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGET_ALLOC_TIME_C'::h5pget_alloc_time_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: plist_id - INTEGER, INTENT(OUT) :: flag - END FUNCTION h5pget_alloc_time_c - END INTERFACE - - hdferr = h5pget_alloc_time_c(plist_id, flag) - END SUBROUTINE h5pget_alloc_time_f - -!****s* H5P/h5pset_fill_time_f -! NAME -! h5pset_fill_time_f -! -! PURPOSE -! Set fill value writing time for dataset -! -! INPUTS -! -! plist_id - dataset creation property list identifier -! flag - fill time flag: -! H5D_FILL_TIME_ERROR_F -! H5D_FILL_TIME_ALLOC_F -! H5D_FILL_TIME_NEVER_F -! OUTPUTS -! -! hdferr - error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! Elena Pourmal -! October 4, 2002 -! -! Fortran90 Interface: - SUBROUTINE h5pset_fill_time_f(plist_id, flag, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: plist_id ! Dataset creation property list identifier - INTEGER, INTENT(IN) :: flag ! Fill time flag: - ! H5D_FILL_TIME_ERROR_F - ! H5D_FILL_TIME_ALLOC_F - ! H5D_FILL_TIME_NEVER_F - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! 0 on success and -1 on failure -!***** - - INTERFACE - INTEGER FUNCTION h5pset_fill_time_c(plist_id, flag) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_FILL_TIME_C'::h5pset_fill_time_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: plist_id - INTEGER, INTENT(IN) :: flag - END FUNCTION h5pset_fill_time_c - END INTERFACE - - hdferr = h5pset_fill_time_c(plist_id, flag) - END SUBROUTINE h5pset_fill_time_f - -!****s* H5P/h5pget_fill_time_f -! NAME -! h5pget_fill_time_f -! -! PURPOSE -! Get fill value writing time for dataset -! -! INPUTS -! -! plist_id - dataset creation property list identifier -! OUTPUTS -! -! hdferr: - error code -! Success: 0 -! Failure: -1 -! OPTIONAL PARAMETERS -! -! flag - fill time flag: -! H5D_FILL_TIME_ERROR_F -! H5D_FILL_TIME_ALLOC_F -! H5D_FILL_TIME_NEVER_F -! AUTHOR -! Elena Pourmal -! October 4, 2002 -! -! Fortran90 Interface: - SUBROUTINE h5pget_fill_time_f(plist_id, flag, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: plist_id ! Dataset creation property list identifier - INTEGER, INTENT(OUT) :: flag ! Fill time flag: - ! H5D_FILL_TIME_ERROR_F - ! H5D_FILL_TIME_ALLOC_F - ! H5D_FILL_TIME_NEVER_F - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! 0 on success and -1 on failure -!***** - - INTERFACE - INTEGER FUNCTION h5pget_fill_time_c(plist_id, flag) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGET_FILL_TIME_C'::h5pget_fill_time_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: plist_id - INTEGER, INTENT(OUT) :: flag - END FUNCTION h5pget_fill_time_c - END INTERFACE - - hdferr = h5pget_fill_time_c(plist_id, flag) - END SUBROUTINE h5pget_fill_time_f - -!****s* H5P/ h5pset_meta_block_size_f -! NAME -! h5pset_meta_block_size_f -! -! PURPOSE -! Sets the minimum size of metadata block allocations -! -! INPUTS -! -! plist_id - file access property list identifier -! size - metatdata block size -! OUTPUTS -! -! hdferr - error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! Elena Pourmal -! October 7, 2002 -! -! Fortran90 Interface: - SUBROUTINE h5pset_meta_block_size_f(plist_id, size, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: plist_id ! File access property list identifier - INTEGER(HSIZE_T), INTENT(IN) :: size ! Block size in bytes; - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! 0 on success and -1 on failure -!***** - INTERFACE - INTEGER FUNCTION h5pset_meta_block_size_c(plist_id, size) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_META_BLOCK_SIZE_C'::h5pset_meta_block_size_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: plist_id - INTEGER(HSIZE_T), INTENT(IN) :: size - END FUNCTION h5pset_meta_block_size_c - END INTERFACE - - hdferr = h5pset_meta_block_size_c(plist_id, size) - END SUBROUTINE h5pset_meta_block_size_f - -!****s* H5P/h5pget_meta_block_size_f -! NAME -! h5pget_meta_block_size_f -! -! PURPOSE -! Gets the minimum size of metadata block allocations -! -! INPUTS -! -! plist_id - file access property list identifier -! OUTPUTS -! -! size - metatdata block size -! hdferr - error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! Elena Pourmal -! October 7, 2002 -! -! Fortran90 Interface: - SUBROUTINE h5pget_meta_block_size_f(plist_id, size, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: plist_id ! File access property list identifier - INTEGER(HSIZE_T), INTENT(OUT) :: size ! Block size in bytes; - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! 0 on success and -1 on failure -!***** - INTERFACE - INTEGER FUNCTION h5pget_meta_block_size_c(plist_id, size) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGET_META_BLOCK_SIZE_C'::h5pget_meta_block_size_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: plist_id - INTEGER(HSIZE_T), INTENT(OUT) :: size - END FUNCTION h5pget_meta_block_size_c - END INTERFACE - - hdferr = h5pget_meta_block_size_c(plist_id, size) - END SUBROUTINE h5pget_meta_block_size_f - -!****s* H5P/h5pset_sieve_buf_size_f -! NAME -! h5pset_sieve_buf_size_f -! -! PURPOSE -! Sets the maximum size of the data sieve buffer -! -! INPUTS -! -! plist_id - file access property list identifier -! size - sieve buffer size -! OUTPUTS -! -! hdferr - error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! Elena Pourmal -! October 7, 2002 -! -! Fortran90 Interface: - SUBROUTINE h5pset_sieve_buf_size_f(plist_id, size, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: plist_id ! File access property list identifier - INTEGER(SIZE_T), INTENT(IN) :: size ! Buffer size in bytes; - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! 0 on success and -1 on failure -!***** - - INTERFACE - INTEGER FUNCTION h5pset_sieve_buf_size_c(plist_id, size) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_SIEVE_BUF_SIZE_C'::h5pset_sieve_buf_size_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: plist_id - INTEGER(SIZE_T), INTENT(IN) :: size - END FUNCTION h5pset_sieve_buf_size_c - END INTERFACE - - hdferr = h5pset_sieve_buf_size_c(plist_id, size) - END SUBROUTINE h5pset_sieve_buf_size_f - -!****s* H5P/h5pget_sieve_buf_size_f -! NAME -! h5pget_sieve_buf_size_f -! -! PURPOSE -! Gets the maximum size of the data sieve buffer -! -! INPUTS -! -! plist_id - file access property list identifier -! OUTPUTS -! -! size - sieve buffer size -! hdferr - error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! Elena Pourmal -! October 7, 2002 -! -! Fortran90 Interface: - SUBROUTINE h5pget_sieve_buf_size_f(plist_id, size, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: plist_id ! File access property list identifier - INTEGER(SIZE_T), INTENT(OUT) :: size ! Buffer size in bytes - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! 0 on success and -1 on failure -!***** - - INTERFACE - INTEGER FUNCTION h5pget_sieve_buf_size_c(plist_id, size) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGET_SIEVE_BUF_SIZE_C'::h5pget_sieve_buf_size_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: plist_id - INTEGER(SIZE_T), INTENT(OUT) :: size - END FUNCTION h5pget_sieve_buf_size_c - END INTERFACE - - hdferr = h5pget_sieve_buf_size_c(plist_id, size) - END SUBROUTINE h5pget_sieve_buf_size_f - -!****s* H5P/h5pset_small_data_block_size_f -! NAME -! h5pset_small_data_block_size_f -! -! PURPOSE -! Sets the minimum size of "small" raw data block -! -! INPUTS -! -! plist_id - file access property list identifier -! size - small raw data block size -! OUTPUTS -! -! hdferr - error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! Elena Pourmal -! October 7, 2002 -! -! Fortran90 Interface: - SUBROUTINE h5pset_small_data_block_size_f(plist_id, size, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: plist_id ! File access property list identifier - INTEGER(HSIZE_T), INTENT(IN) :: size ! Small raw data block size - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! 0 on success and -1 on failure -!***** - - INTERFACE - INTEGER FUNCTION h5pset_small_data_block_size_c(plist_id, size) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_SMALL_DATA_BLOCK_SIZE_C'::h5pset_small_data_block_size_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: plist_id - INTEGER(HSIZE_T), INTENT(IN) :: size - END FUNCTION h5pset_small_data_block_size_c - END INTERFACE - - hdferr = h5pset_small_data_block_size_c(plist_id, size) - END SUBROUTINE h5pset_small_data_block_size_f - -!****s* H5P/h5pget_small_data_block_size_f -! NAME -! h5pget_small_data_block_size_f -! -! PURPOSE -! Gets the minimum size of "small" raw data block -! -! INPUTS -! -! plist_id - file access property list identifier -! OUTPUTS -! -! size - small raw data block size -! hdferr - error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! Elena Pourmal -! October 7, 2002 -! -! Fortran90 Interface: - SUBROUTINE h5pget_small_data_block_size_f(plist_id, size, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: plist_id ! File access property list identifier - INTEGER(HSIZE_T), INTENT(OUT) :: size ! Small raw data block size - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! 0 on success and -1 on failure -!***** - - INTERFACE - INTEGER FUNCTION h5pget_small_data_block_size_c(plist_id, size) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGET_SMALL_DATA_BLOCK_SIZE_C'::h5pget_small_data_block_size_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: plist_id - INTEGER(HSIZE_T), INTENT(OUT) :: size - END FUNCTION h5pget_small_data_block_size_c - END INTERFACE - - hdferr = h5pget_small_data_block_size_c(plist_id, size) - END SUBROUTINE h5pget_small_data_block_size_f - -!****s* H5P/h5pset_hyper_vector_size_f -! NAME -! h5pset_hyper_vector_size_f -! -! PURPOSE -! Set the number of "I/O" vectors (vector size) -! -! INPUTS -! -! plist_id - dataset transfer property list identifier -! size - vector size -! OUTPUTS -! -! hdferr - error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! Elena Pourmal -! October 7, 2002 -! -! Fortran90 Interface: - SUBROUTINE h5pset_hyper_vector_size_f(plist_id, size, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: plist_id ! Dataset transfer property list identifier - INTEGER(SIZE_T), INTENT(IN) :: size ! Vector size - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! 0 on success and -1 on failure -!***** - - INTERFACE - INTEGER FUNCTION h5pset_hyper_vector_size_c(plist_id, size) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_HYPER_VECTOR_SIZE_C'::h5pset_hyper_vector_size_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: plist_id - INTEGER(SIZE_T), INTENT(IN) :: size - END FUNCTION h5pset_hyper_vector_size_c - END INTERFACE - - hdferr = h5pset_hyper_vector_size_c(plist_id, size) - END SUBROUTINE h5pset_hyper_vector_size_f - -!****s* H5P/ h5pget_hyper_vector_size_f -! NAME -! h5pget_hyper_vector_size_f -! -! PURPOSE -! Get the number of "I/O" vectors (vector size) -! -! INPUTS -! -! plist_id - dataset transfer property list identifier -! OUTPUTS -! -! size - vector size -! hdferr - error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! Elena Pourmal -! October 7, 2002 -! -! Fortran90 Interface: - SUBROUTINE h5pget_hyper_vector_size_f(plist_id, size, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: plist_id ! Dataset transfer property list identifier - INTEGER(SIZE_T), INTENT(OUT) :: size ! Vector size - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! 0 on success and -1 on failure -!***** - - INTERFACE - INTEGER FUNCTION h5pget_hyper_vector_size_c(plist_id, size) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGET_HYPER_VECTOR_SIZE_C'::h5pget_hyper_vector_size_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: plist_id - INTEGER(SIZE_T), INTENT(OUT) :: size - END FUNCTION h5pget_hyper_vector_size_c - END INTERFACE - - hdferr = h5pget_hyper_vector_size_c(plist_id, size) - END SUBROUTINE h5pget_hyper_vector_size_f - -!****s* H5P/h5pexist_f -! NAME -! h5pexist_f -! -! PURPOSE -! Queries whether a property name exists in a property list or class. -! -! INPUTS -! -! prp_id - property list identifier to query -! name - name of property to check for -! OUTPUTS -! -! flag - logical flag -! hdferr - error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! Elena Pourmal -! October 9, 2002 -! -! Fortran90 Interface: - SUBROUTINE h5pexist_f(prp_id, name, flag, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to modify - LOGICAL, INTENT(OUT) :: flag ! .TRUE. if exists, .FALSE. otherwise - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! 0 on success and -1 on failure -!***** - INTEGER :: name_len - - INTERFACE - INTEGER FUNCTION h5pexist_c(prp_id, name, name_len) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PEXIST_C'::h5pexist_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: name - INTEGER(HID_T), INTENT(IN) :: prp_id - CHARACTER(LEN=*), INTENT(IN) :: name - INTEGER, INTENT(IN) :: name_len - END FUNCTION h5pexist_c - END INTERFACE - flag = .FALSE. - name_len = LEN(name) - hdferr = h5pexist_c(prp_id, name , name_len) - IF (hdferr > 0) THEN - flag = .TRUE. - hdferr = 0 - ENDIF - END SUBROUTINE h5pexist_f - -!****s* H5P/h5pget_size_f -! -! NAME -! h5pget_size_f -! -! PURPOSE -! Queries the size of a property value in bytes. -! -! INPUTS -! -! prp_id - property list identifier to query -! name - name of property to query -! OUTPUTS -! -! size - size of property in bytes -! hdferr - error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! Elena Pourmal -! October 9, 2002 -! -! HISTORY -! -! -! Fortran90 Interface: - SUBROUTINE h5pget_size_f(prp_id, name, size, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to query - INTEGER(SIZE_T), INTENT(OUT) :: size ! Size in bytes - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! 0 on success and -1 on failure -!***** - INTEGER :: name_len - - INTERFACE - INTEGER FUNCTION h5pget_size_c(prp_id, name, name_len, size) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGET_SIZE_C'::h5pget_size_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: name - INTEGER(HID_T), INTENT(IN) :: prp_id - CHARACTER(LEN=*), INTENT(IN) :: name - INTEGER, INTENT(IN) :: name_len - INTEGER(SIZE_T), INTENT(OUT) :: size - END FUNCTION h5pget_size_c - END INTERFACE - name_len = LEN(name) - hdferr = h5pget_size_c(prp_id, name , name_len, size) - END SUBROUTINE h5pget_size_f - -!****s* H5P/h5pget_npros_f -! NAME -! h5pget_npros_f -! -! PURPOSE -! Queries number of properties in property list or class -! -! INPUTS -! -! prp_id - iproperty list identifier to query -! OUTPUTS -! -! nprops - number of properties in property object -! hdferr - error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! Elena Pourmal -! October 9, 2002 -! -! Fortran90 Interface: - SUBROUTINE h5pget_nprops_f(prp_id, nprops, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER(SIZE_T), INTENT(OUT) :: nprops ! Number of properties - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! 0 on success and -1 on failure -!***** - - INTERFACE - INTEGER FUNCTION h5pget_nprops_c(prp_id, nprops) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGET_NPROPS_C'::h5pget_nprops_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: prp_id - INTEGER(SIZE_T), INTENT(OUT) :: nprops - END FUNCTION h5pget_nprops_c - END INTERFACE - hdferr = h5pget_nprops_c(prp_id, nprops) - END SUBROUTINE h5pget_nprops_f - -!****s* H5P/h5pget_class_name_f -! NAME -! h5pget_class_name_f -! -! PURPOSE -! Queries the name of a class. -! -! INPUTS -! -! prp_id - property list identifier to query -! OUTPUTS -! -! name - name of a class -! size - Actual length of the class name -! NOTE: If provided buffer "name" is smaller, -! than name will be truncated to fit into -! provided user buffer. -! hdferr: - error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! Elena Pourmal -! October 9, 2002 -! -! HISTORY -! Returned the size of name as an argument -! -! Fortran90 Interface: - SUBROUTINE h5pget_class_name_f(prp_id, name, size, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - CHARACTER(LEN=*), INTENT(OUT) :: name ! Buffer to retireve class name - INTEGER, INTENT(OUT) :: size ! Actual length of the class name - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! 0 on success and -1 on failure -!***** - INTEGER :: name_len - - INTERFACE - INTEGER FUNCTION h5pget_class_name_c(prp_id, name, name_len) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGET_CLASS_NAME_C'::h5pget_class_name_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: name - INTEGER(HID_T), INTENT(IN) :: prp_id - CHARACTER(LEN=*), INTENT(INOUT) :: name - INTEGER, INTENT(IN) :: name_len - END FUNCTION h5pget_class_name_c - END INTERFACE - - name_len = LEN(name) - size = h5pget_class_name_c(prp_id, name, name_len) - - hdferr = 0 - IF(size.LT.0) hdferr = -1 - - END SUBROUTINE h5pget_class_name_f - -!****s* H5P/h5pget_class_parent_f -! NAME -! h5pget_class_parent_f -! -! PURPOSE -! Retrieves the parent class of a genric property class. -! -! INPUTS -! -! prp_id - property list identifier to query -! OUTPUTS -! -! parent_id - identifier of the parent class -! hdferr: - error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! Elena Pourmal -! October 9, 2002 -! -! Fortran90 Interface: - SUBROUTINE h5pget_class_parent_f(prp_id, parent_id, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER(HID_T), INTENT(OUT) :: parent_id ! Parent class property list - ! identifier - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! 0 on success and -1 on failure -!***** - - INTERFACE - INTEGER FUNCTION h5pget_class_parent_c(prp_id, parent_id) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGET_CLASS_PARENT_C'::h5pget_class_parent_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: prp_id - INTEGER(HID_T), INTENT(OUT) :: parent_id - END FUNCTION h5pget_class_parent_c - END INTERFACE - hdferr = h5pget_class_parent_c(prp_id, parent_id) - END SUBROUTINE h5pget_class_parent_f - -!****s* H5P/h5pisa_class_f -! NAME -! h5pisa_class_f -! -! PURPOSE -! Determines whether a property list is a member of a class. -! -! INPUTS -! -! plist - property list identifier -! pclass - identifier of the property class -! OUTPUTS -! -! flag - .TRUE. if a member, .FALSE. otherwise -! hdferr: - error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! Elena Pourmal -! October 9, 2002 -! -! Fortran90 Interface: - SUBROUTINE h5pisa_class_f(plist, pclass, flag, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: plist ! Property list identifier - INTEGER(HID_T), INTENT(IN) :: pclass ! Class identifier - LOGICAL, INTENT(OUT) :: flag ! logical flag - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! 0 on success and -1 on failure -!***** - INTERFACE - INTEGER FUNCTION h5pisa_class_c(plist, pclass) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PISA_CLASS_C'::h5pisa_class_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: plist - INTEGER(HID_T), INTENT(IN) :: pclass - END FUNCTION h5pisa_class_c - END INTERFACE - flag = .FALSE. - hdferr = h5pisa_class_c(plist, pclass) - IF (hdferr .GT. 0) THEN - flag = .TRUE. - hdferr = 0 - ENDIF - END SUBROUTINE h5pisa_class_f - -!****s* H5P/h5pcopy_prop_f -! NAME -! h5pcopy_prop_f -! -! PURPOSE -! Copies a property from one list or class to another. -! -! INPUTS -! -! dst_id - Identifier of the destination property list -! src_id - Identifier of the source property list -! name - name of the property to copy -! OUTPUTS -! -! hdferr: - error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! Elena Pourmal -! October 9, 2002 -! -! Fortran90 Interface: - SUBROUTINE h5pcopy_prop_f(dst_id, src_id, name, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dst_id ! Destination property list - ! identifier - INTEGER(HID_T), INTENT(IN) :: src_id ! Source property list identifier - CHARACTER(LEN=*), INTENT(IN) :: name ! Property name - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! 0 on success and -1 on failure -!***** - INTEGER :: name_len - - INTERFACE - INTEGER FUNCTION h5pcopy_prop_c(dst_id, src_id, name, name_len) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PCOPY_PROP_C'::h5pcopy_prop_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: name - INTEGER(HID_T), INTENT(IN) :: dst_id - INTEGER(HID_T), INTENT(IN) :: src_id - CHARACTER(LEN=*), INTENT(IN) :: name - INTEGER, INTENT(IN) :: name_len - END FUNCTION h5pcopy_prop_c - END INTERFACE - name_len = LEN(name) - hdferr = h5pcopy_prop_c(dst_id, src_id, name , name_len) - END SUBROUTINE h5pcopy_prop_f - -!****s* H5P/h5premove_f -! NAME -! h5premove_f -! -! PURPOSE -! Removes a property from a property list. - -! -! INPUTS -! -! plid - Property list identofoer -! name - name of the property to remove -! OUTPUTS -! -! hdferr: - error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! Elena Pourmal -! October 9, 2002 -! -! Fortran90 Interface: - SUBROUTINE h5premove_f(plid, name, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: plid ! Property list identifier - CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to remove - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! 0 on success and -1 on failure -!***** - INTEGER :: name_len - - INTERFACE - INTEGER FUNCTION h5premove_c(plid, name, name_len) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PREMOVE_C'::h5premove_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: name - INTEGER(HID_T), INTENT(IN) :: plid - CHARACTER(LEN=*), INTENT(IN) :: name - INTEGER, INTENT(IN) :: name_len - END FUNCTION h5premove_c - END INTERFACE - name_len = LEN(name) - hdferr = h5premove_c(plid, name , name_len) - END SUBROUTINE h5premove_f - -!****s* H5P/h5punregister_f -! NAME -! h5punregister_f -! -! PURPOSE -! Removes a property from a property list class. -! -! INPUTS -! -! class - Property list class identifier -! name - name of the property to remove -! OUTPUTS -! -! hdferr: - error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! Elena Pourmal -! October 9, 2002 -! -! Fortran90 Interface: - SUBROUTINE h5punregister_f(class, name, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: class ! property list class identifier - CHARACTER(LEN=*), INTENT(IN) :: name ! name of property to remove - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! 0 on success and -1 on failure -!***** - INTEGER :: name_len - - INTERFACE - INTEGER FUNCTION h5punregister_c(class, name, name_len) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PUNREGISTER_C'::h5punregister_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: name - INTEGER(HID_T), INTENT(IN) :: class - CHARACTER(LEN=*), INTENT(IN) :: name - INTEGER, INTENT(IN) :: name_len - END FUNCTION h5punregister_c - END INTERFACE - name_len = LEN(name) - hdferr = h5punregister_c(class, name , name_len) - END SUBROUTINE h5punregister_f - -!****s* H5P/h5pclose_class_f -! NAME -! h5pclose_class_f -! -! PURPOSE -! Closes an existing property list class. -! -! INPUTS -! -! class - Property list class identifier -! OUTPUTS -! -! hdferr - error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! Elena Pourmal -! October 9, 2002 -! -! Fortran90 Interface: - SUBROUTINE h5pclose_class_f(class, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: class ! Property list class identifier - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! 0 on success and -1 on failure -!***** - INTERFACE - INTEGER FUNCTION h5pclose_class_c(class) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PCLOSE_CLASS_C'::h5pclose_class_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: class - END FUNCTION h5pclose_class_c - END INTERFACE - hdferr = h5pclose_class_c(class) - END SUBROUTINE h5pclose_class_f - -!****s* H5P/h5pset_shuffle_f -! NAME -! h5pset_shuffle_f -! -! PURPOSE -! Sets shuffling filter -! -! INPUTS -! prp_id - dataset creation property list identifier -! OUTPUTS -! hdferr - error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! Elena Pourmal -! March 12, 2003 -! -! Fortran90 Interface: - SUBROUTINE h5pset_shuffle_f(prp_id, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! 0 on success and -1 on failure -!***** - -! INTEGER, EXTERNAL :: h5pset_shuffle_c -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5pset_shuffle_c(prp_id) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_SHUFFLE_C'::h5pset_shuffle_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: prp_id - END FUNCTION h5pset_shuffle_c - END INTERFACE - hdferr = h5pset_shuffle_c(prp_id) - - END SUBROUTINE h5pset_shuffle_f - -!****s* H5P/h5pset_edc_check_f -! NAME -! h5pset_edc_check_f -! -! PURPOSE -! Enables/disables error detecting -! -! INPUTS -! -! prp_id - dataset creation property list identifier -! flag - EDC flag; possible values: -! H5Z_DISABLE_EDC_F -! H5Z_ENABLE_EDC_F -! OUTPUTS -! hdferr - error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! Elena Pourmal -! March 13, 2003 -! -! Fortran90 Interface: - SUBROUTINE h5pset_edc_check_f(prp_id, flag, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER, INTENT(IN) :: flag ! Checksum filter flag - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! 0 on success and -1 on failure -!***** - -! INTEGER, EXTERNAL :: h5pset_edc_check_c -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5pset_edc_check_c(prp_id, flag) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_EDC_CHECK_C'::h5pset_edc_check_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: prp_id - INTEGER, INTENT(IN) :: flag - END FUNCTION h5pset_edc_check_c - END INTERFACE - hdferr = h5pset_edc_check_c(prp_id, flag) - - END SUBROUTINE h5pset_edc_check_f - -!****s* H5P/h5pget_edc_check_f -! NAME -! h5pget_edc_check_f -! -! PURPOSE -! Queries error detecting -! -! INPUTS -! -! prp_id - dataset creation property list identifier -! OUTPUTS -! hdferr - error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! Elena Pourmal -! March 13, 2003 -! -! Fortran90 Interface: - SUBROUTINE h5pget_edc_check_f(prp_id, flag, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Dataset transfer property list identifier - INTEGER, INTENT(OUT) :: flag ! Checksum filter flag - ! May have one of the following values: - ! H5Z_ERROR_EDC_F - ! H5Z_DISABLE_EDC_F - ! H5Z_ENABLE_EDC_F - ! H5Z_NO_EDC_F - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! 0 on success and -1 on failure -!***** - -! INTEGER, EXTERNAL :: h5pget_edc_check_c -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5pget_edc_check_c(prp_id, flag) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGET_EDC_CHECK_C'::h5pget_edc_check_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: prp_id - INTEGER, INTENT(OUT) :: flag - END FUNCTION h5pget_edc_check_c - END INTERFACE - hdferr = h5pget_edc_check_c(prp_id, flag) - - END SUBROUTINE h5pget_edc_check_f - -!****s* H5P/h5pset_fletcher32_f -! NAME -! h5pset_fletcher32_f -! -! PURPOSE -! Sets Fletcher32 checksum of EDC for a dataset creation -! property list. -! -! INPUTS -! -! prp_id - dataset creation property list identifier -! OUTPUTS -! hdferr - error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! Elena Pourmal -! March 13, 2003 -! -! Fortran90 Interface: - SUBROUTINE h5pset_fletcher32_f(prp_id, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! 0 on success and -1 on failure -!***** - -! INTEGER, EXTERNAL :: h5pset_fletcher32_c -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5pset_fletcher32_c(prp_id) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_FLETCHER32_C'::h5pset_fletcher32_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: prp_id - END FUNCTION h5pset_fletcher32_c - END INTERFACE - hdferr = h5pset_fletcher32_c(prp_id) - - END SUBROUTINE h5pset_fletcher32_f - -!****s* H5P/ h5pset_family_offset_f -! NAME -! h5pset_family_offset_f -! -! PURPOSE -! Sets offset for family file driver. -! -! INPUTS -! -! prp_id - file creation property list identifier -! offset - file offset -! OUTPUTS -! hdferr - error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! Elena Pourmal -! 19 March 2003 -! -! Fortran90 Interface: - SUBROUTINE h5pset_family_offset_f(prp_id, offset, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER(HSIZE_T), INTENT(IN) :: offset ! Offset in bytes - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! 0 on success and -1 on failure -!***** - -! INTEGER, EXTERNAL :: h5pset_family_offset_c -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5pset_family_offset_c(prp_id, offset) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_FAMILY_OFFSET_C'::h5pset_family_offset_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: prp_id - INTEGER(HSIZE_T), INTENT(IN) :: offset - END FUNCTION h5pset_family_offset_c - END INTERFACE - hdferr = h5pset_family_offset_c(prp_id, offset) - - END SUBROUTINE h5pset_family_offset_f - -!****s* H5P/h5pset_fapl_multi_l -! NAME -! h5pset_fapl_multi_l -! -! PURPOSE -! Sets up use of the multi-file driver. -! -! INPUTS -! -! prp_id - file creation property list identifier -! mem_map - mapping array -! memb_fapl - property list for each memory usage type -! memb_name - names of member file -! relax - flag -! OUTPUTS -! hdferr - error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! Elena Pourmal -! 20 March 2003 -! -! Fortran90 Interface: - SUBROUTINE h5pset_fapl_multi_l(prp_id, memb_map, memb_fapl, memb_name, memb_addr, relax, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id - INTEGER, DIMENSION(*), INTENT(IN) :: memb_map - INTEGER(HID_T), DIMENSION(*), INTENT(IN) :: memb_fapl - CHARACTER(LEN=*), DIMENSION(*), INTENT(IN) :: memb_name - REAL, DIMENSION(*), INTENT(IN) :: memb_addr - LOGICAL, INTENT(IN) :: relax - INTEGER, INTENT(OUT) :: hdferr -!***** - INTEGER, DIMENSION(1:H5FD_MEM_NTYPES_F) :: lenm - INTEGER :: maxlen - INTEGER :: flag = 0 - INTEGER :: i - - INTERFACE - INTEGER FUNCTION h5pset_fapl_multi_c(prp_id, memb_map, memb_fapl, memb_name, lenm, & - maxlen, memb_addr, flag) - USE H5GLOBAL - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_FAPL_MULTI_C'::h5pset_fapl_multi_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: memb_name - INTEGER(HID_T), INTENT(IN) :: prp_id ! File creation property list identifier - INTEGER, DIMENSION(*), INTENT(IN) :: memb_map - INTEGER(HID_T), DIMENSION(*), INTENT(IN) :: memb_fapl - CHARACTER(LEN=*), DIMENSION(*), INTENT(IN) :: memb_name - REAL, DIMENSION(*), INTENT(IN) :: memb_addr - INTEGER, DIMENSION(*) :: lenm - INTEGER :: maxlen - INTEGER, INTENT(IN) :: flag - END FUNCTION h5pset_fapl_multi_c - END INTERFACE - - maxlen = LEN(memb_name(1)) - DO i=1, H5FD_MEM_NTYPES_F - lenm(i) = LEN_TRIM(memb_name(i)) - ENDDO - IF(relax) flag = 1 - hdferr = h5pset_fapl_multi_c(prp_id, memb_map, memb_fapl, memb_name, lenm, maxlen, memb_addr, flag) - - END SUBROUTINE h5pset_fapl_multi_l -!****s* H5P/h5pset_fapl_multi_s -! NAME -! h5pset_fapl_multi_s -! -! PURPOSE -! Sets up use of the multi-file driver. -! -! INPUTS -! -! prp_id - file creation property list identifier -! relax - flag -! OUTPUTS -! hdferr - error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! Elena Pourmal -! 31 March 2003 -! -! Fortran90 Interface: - SUBROUTINE h5pset_fapl_multi_s(prp_id, relax, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! File creation property list identifier - LOGICAL, INTENT(IN) :: relax - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! 0 on success and -1 on failure -!***** - INTEGER :: flag - -! INTEGER, EXTERNAL :: h5pset_fapl_multi_sc -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5pset_fapl_multi_sc(prp_id,flag) - USE H5GLOBAL - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_FAPL_MULTI_SC'::h5pset_fapl_multi_sc - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: prp_id ! File creation property list identifier - INTEGER, INTENT(IN) :: flag - END FUNCTION h5pset_fapl_multi_sc - END INTERFACE - flag = 0 - IF (relax) flag = 1 - hdferr = h5pset_fapl_multi_sc(prp_id, flag) - - END SUBROUTINE h5pset_fapl_multi_s -!****s* H5P/h5pget_fapl_multi_f -! NAME -! h5pget_fapl_multi_f -! -! PURPOSE -! Sets up use of the multi-file driver. -! -! INPUTS -! -! prp_id - file creation property list identifier -! OUTPUTS -! -! mem_map - mapping array -! memb_fapl - property list for each memory usage type -! memb_name - names of member file -! relax - flag -! hdferr - error code -! Success: 0 -! Failure: -1 -! -! OPTIONAL PARAMETERS -! maxlen_out - maximum length for memb_name array element -! -! AUTHOR -! Elena Pourmal -! 24 March 2003 -! -! Fortran90 Interface: - SUBROUTINE h5pget_fapl_multi_f(prp_id, memb_map, memb_fapl, memb_name, memb_addr, relax, hdferr, maxlen_out) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! File creation property list identifier - INTEGER, DIMENSION(*), INTENT(OUT) :: memb_map - INTEGER(HID_T), DIMENSION(*), INTENT(OUT) :: memb_fapl - CHARACTER(LEN=*), DIMENSION(*), INTENT(OUT) :: memb_name - REAL, DIMENSION(*), INTENT(OUT) :: memb_addr - INTEGER, OPTIONAL, INTENT(OUT) :: maxlen_out - LOGICAL, INTENT(OUT) :: relax - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! 0 on success and -1 on failure -!***** - INTEGER, DIMENSION(1:H5FD_MEM_NTYPES_F) :: lenm - INTEGER :: maxlen - INTEGER :: c_maxlen_out - INTEGER :: flag - INTEGER :: i -! - INTERFACE - INTEGER FUNCTION h5pget_fapl_multi_c(prp_id, memb_map, memb_fapl, memb_name, lenm, & - maxlen, memb_addr, flag, c_maxlen_out) - USE H5GLOBAL - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGET_FAPL_MULTI_C'::h5pget_fapl_multi_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: memb_name - INTEGER(HID_T), INTENT(IN) :: prp_id ! File creation property list identifier - INTEGER, DIMENSION(*), INTENT(OUT) :: memb_map - INTEGER(HID_T), DIMENSION(*), INTENT(OUT) :: memb_fapl - CHARACTER(LEN=*), DIMENSION(*), INTENT(OUT) :: memb_name - REAL, DIMENSION(*), INTENT(OUT) :: memb_addr - INTEGER, DIMENSION(*) :: lenm - INTEGER :: maxlen - INTEGER :: c_maxlen_out - INTEGER, INTENT(OUT) :: flag - END FUNCTION h5pget_fapl_multi_c - END INTERFACE - - maxlen = LEN(memb_name(1)) - DO i=1, H5FD_MEM_NTYPES_F - lenm(i) = LEN_TRIM(memb_name(i)) - ENDDO - hdferr = h5pget_fapl_multi_c(prp_id, memb_map, memb_fapl, memb_name, lenm, maxlen, memb_addr, flag, c_maxlen_out) - - relax = .TRUE. - IF(flag .EQ. 0) relax = .FALSE. - IF(PRESENT(maxlen_out)) maxlen_out = c_maxlen_out - END SUBROUTINE h5pget_fapl_multi_f -!****s* H5P/h5pset_szip_f -! NAME -! h5pset_szip_f -! -! PURPOSE -! Sets up use of szip compression -! -! INPUTS -! -! prp_id - dataset creation property list identifier -! options_mask - A bit-mask conveying the desired SZIP options. -! Current valid values in Fortran are: -! H5_SZIP_EC_OM_F -! H5_SZIP_NN_OM_F -! pixels_per_block - szip parameters -! OUTPUTS -! hdferr - error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! Elena Pourmal -! April 10 2003 -! -! Fortran90 Interface: - SUBROUTINE h5pset_szip_f(prp_id, options_mask, pixels_per_block, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Dataset creation property - ! list identifier - INTEGER, INTENT(IN) :: options_mask ! A bit-mask conveying the desired - ! SZIP options - ! Current valid values in Fortran are: - ! H5_SZIP_EC_OM_F - ! H5_SZIP_NN_OM_F - INTEGER, INTENT(IN) :: pixels_per_block ! The number of pixels or data elements - ! in each data block - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! 0 on success and -1 on failure -!***** - -! INTEGER, EXTERNAL :: h5pset_szip_c -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5pset_szip_c(prp_id, options_mask, pixels_per_block) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_SZIP_C'::h5pset_szip_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: prp_id ! File creation property list identifier - INTEGER, INTENT(IN) :: options_mask - INTEGER, INTENT(IN) :: pixels_per_block - END FUNCTION h5pset_szip_c - END INTERFACE - hdferr = h5pset_szip_c(prp_id, options_mask, pixels_per_block) - - END SUBROUTINE h5pset_szip_f - -!****s* H5P/h5pall_filters_avail_f -! NAME -! h5pall_filters_avail_f -! -! PURPOSE -! Checks if all filters set in the dataset creation -! property list are available -! -! INPUTS -! -! prp_id - data creation property list identifier -! OUTPUTS -! -! flag - .TRUE. if all filters are available -! .FALSE. otherwise -! hdferr - error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! Elena Pourmal -! April 10 2003 -! -! Fortran90 Interface: - SUBROUTINE h5pall_filters_avail_f(prp_id, flag, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Dataset creation property - ! list identifier - LOGICAL, INTENT(OUT) :: flag ! .TRUE. if all filters are available - ! .FALSE. otherwise - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! 0 on success and -1 on failure -!***** - INTEGER :: status - -! INTEGER, EXTERNAL :: h5pall_filters_avail_c -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5pall_filters_avail_c(prp_id, status) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PALL_FILTERS_AVAIL_C'::h5pall_filters_avail_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: prp_id ! File creation property list identifier - INTEGER, INTENT(OUT) :: status - END FUNCTION h5pall_filters_avail_c - END INTERFACE - flag = .TRUE. - hdferr = h5pall_filters_avail_c(prp_id, status) - IF (status .EQ. 0 ) flag = .FALSE. - - END SUBROUTINE h5pall_filters_avail_f - -!****s* H5P/h5pget_filter_by_id_f -! NAME -! h5pget_filter_by_id_f -! -! PURPOSE -! Returns information about a filter in a pipeline -! -! INPUTS -! -! prp_id - data creation or transfer property list -! identifier -! OUTPUTS -! -! filter_id - filter identifier -! flags - bit vector specifying certain general -! properties of the filter -! cd_nelmts - number of elements in cd_values -! cd_values - auxiliary data for the filter -! namelen - number of characters in the name buffer -! name - buffer to retrieve filter name -! hdferr - error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! Elena Pourmal -! April 10 2003 -! -! Fortran90 Interface: - SUBROUTINE h5pget_filter_by_id_f(prp_id, filter_id, flags, cd_nelmts, cd_values, namelen, name, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER, INTENT(IN) :: filter_id ! Filter identifier - INTEGER(SIZE_T), INTENT(INOUT) :: cd_nelmts ! Number of elements in cd_values. - INTEGER, DIMENSION(*), INTENT(OUT) :: cd_values ! Auxiliary data for the filter. - INTEGER, INTENT(OUT) :: flags ! Bit vector specifying certain general - ! properties of the filter. - INTEGER(SIZE_T), INTENT(IN) :: namelen ! Anticipated number of characters in name. - CHARACTER(LEN=*), INTENT(OUT) :: name ! Name of the filter - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! 0 on success and -1 on failure -!***** - - -! INTEGER, EXTERNAL :: h5pget_filter_by_id_c -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5pget_filter_by_id_c(prp_id, filter_id, flags, cd_nelmts, & - cd_values, namelen, name) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGET_FILTER_BY_ID_C'::h5pget_filter_by_id_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: name - INTEGER(HID_T), INTENT(IN) :: prp_id - INTEGER, INTENT(IN) :: filter_id - INTEGER, DIMENSION(*), INTENT(OUT) :: cd_values - INTEGER, INTENT(OUT) :: flags - INTEGER(SIZE_T), INTENT(INOUT) :: cd_nelmts - INTEGER(SIZE_T), INTENT(IN) :: namelen - CHARACTER(LEN=*), INTENT(OUT) :: name - END FUNCTION h5pget_filter_by_id_c - END INTERFACE - - hdferr = h5pget_filter_by_id_c(prp_id, filter_id, flags, cd_nelmts, & - cd_values, namelen, name) - END SUBROUTINE h5pget_filter_by_id_f - -!****s* H5P/h5pmodify_filter_f -! NAME -! h5pmodify_filter_f -! -! PURPOSE -! Adds a filter to the filter pipeline. -! -! INPUTS -! -! prp_id - data creation or transfer property list -! identifier -! filter - filter to be modified -! flags - bit vector specifying certain general -! properties of the filter -! cd_nelmts - number of elements in cd_values -! cd_values - auxiliary data for the filter -! OUTPUTS -! hdferr - error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! Elena Pourmal -! April 10 2003 -! -! Fortran90 Interface: - SUBROUTINE h5pmodify_filter_f(prp_id, filter, flags, cd_nelmts, cd_values, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER, INTENT(IN) :: filter ! Filter to be modified - INTEGER, INTENT(IN) :: flags ! Bit vector specifying certain general - ! properties of the filter - INTEGER(SIZE_T), INTENT(IN) :: cd_nelmts ! Number of elements in cd_values - INTEGER, DIMENSION(*), INTENT(IN) :: cd_values ! Auxiliary data for the filter - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! 0 on success and -1 on failure -!***** - -! INTEGER, EXTERNAL :: h5pmodify_filter_c -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5pmodify_filter_c(prp_id, filter, flags, cd_nelmts, cd_values) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PMODIFY_FILTER_C'::h5pmodify_filter_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: prp_id - INTEGER, INTENT(IN) :: filter - INTEGER, INTENT(IN) :: flags - INTEGER(SIZE_T), INTENT(IN) :: cd_nelmts - INTEGER, DIMENSION(*), INTENT(IN) :: cd_values - END FUNCTION h5pmodify_filter_c - END INTERFACE - - hdferr = h5pmodify_filter_c(prp_id, filter, flags, cd_nelmts, cd_values ) - END SUBROUTINE h5pmodify_filter_f - -!****s* H5P/h5premove_filter_f -! NAME -! h5premove_filter_f -! -! PURPOSE -! Delete one or more filters from the filter pipeline. -! -! INPUTS -! -! prp_id - data creation or transfer property list -! identifier -! filter - filter to be removed -! OUTPUTS -! hdferr - error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! Quincey Koziol -! January 27 2004 -! -! Fortran90 Interface: - SUBROUTINE h5premove_filter_f(prp_id, filter, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Dataset creation property list - ! identifier - INTEGER, INTENT(IN) :: filter ! Filter to be removed - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! 0 on success and -1 on failure -!***** - -! INTEGER, EXTERNAL :: h5premove_filter_c -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5premove_filter_c(prp_id, filter) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PREMOVE_FILTER_C'::h5premove_filter_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: prp_id - INTEGER, INTENT(IN) :: filter - END FUNCTION h5premove_filter_c - END INTERFACE - - hdferr = h5premove_filter_c(prp_id, filter) - END SUBROUTINE h5premove_filter_f - -!****s* H5P/H5Pget_attr_phase_change_f -! NAME -! H5Pget_attr_phase_change_f -! -! PURPOSE -! Retrieves attribute storage phase change thresholds -! -! INPUTS -! -! ocpl_id - Object (dataset or group) creation property list identifier -! OUTPUTS -! -! max_compact - Maximum number of attributes to be stored in compact storage -! (Default: 8) -! min_dense - Minimum number of attributes to be stored in dense storage -! (Default: 6) -! hdferr - Error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! M. Scot Breitenfeld -! January, 2008 -! -! Fortran90 Interface: - SUBROUTINE h5pget_attr_phase_change_f(ocpl_id, max_compact, min_dense, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: ocpl_id ! Object (dataset or group) creation property list identifier - INTEGER, INTENT(OUT) :: max_compact ! Maximum number of attributes to be stored in compact storage - ! (Default: 8) - INTEGER, INTENT(OUT) :: min_dense ! Minimum number of attributes to be stored in dense storage - ! (Default: 6) - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! 0 on success and -1 on failure -!***** -! -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5pget_attr_phase_change_c(ocpl_id, max_compact, min_dense) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGET_ATTR_PHASE_CHANGE_C'::h5pget_attr_phase_change_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: ocpl_id - INTEGER, INTENT(OUT) :: max_compact - INTEGER, INTENT(OUT) :: min_dense - - END FUNCTION h5pget_attr_phase_change_c - END INTERFACE - - hdferr = h5pget_attr_phase_change_c(ocpl_id, max_compact, min_dense) - END SUBROUTINE h5pget_attr_phase_change_f - -!****s* H5P/H5Pset_attr_creation_order_f -! NAME -! H5Pset_attr_creation_order_f -! -! PURPOSE -! Sets tracking and indexing of attribute creation order -! -! INPUTS -! -! ocpl_id - Object creation property list identifier -! crt_order_flags - Flags specifying whether to track and index attribute creation order -! OUTPUTS -! -! hdferr - Error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! M. Scot Breitenfeld -! January, 2008 -! -! Fortran90 Interface: - SUBROUTINE h5pset_attr_creation_order_f(ocpl_id, crt_order_flags , hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: ocpl_id ! Object (dataset or group) creation property list identifier - INTEGER, INTENT(IN) :: crt_order_flags ! Flags specifying whether to track and index attribute creation order - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! 0 on success and -1 on failure -!***** -! -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION H5Pset_attr_creation_order_c(ocpl_id, crt_order_flags) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_ATTR_CREATION_ORDER_C'::h5pset_attr_creation_order_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: ocpl_id - INTEGER, INTENT(IN) :: crt_order_flags - - END FUNCTION H5Pset_attr_creation_order_c - END INTERFACE - - hdferr = H5Pset_attr_creation_order_c(ocpl_id, crt_order_flags) - END SUBROUTINE h5pset_attr_creation_order_f - -!****s* H5P/H5Pset_shared_mesg_nindexes_f -! NAME -! H5Pset_shared_mesg_nindexes_f -! -! PURPOSE -! Sets number of shared object header message indexes -! -! INPUTS -! -! plist_id - file creation property list -! nindexes - Number of shared object header message indexes to be available in files created with this property list -! OUTPUTS -! -! hdferr - error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! M. Scot Breitenfeld -! January, 2008 -! -! Fortran90 Interface: - SUBROUTINE h5pset_shared_mesg_nindexes_f( plist_id, nindexes, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: plist_id ! File creation property list - INTEGER, INTENT(IN) :: nindexes ! Number of shared object header message indexes - ! available in files created WITH this property list - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! 0 on success and -1 on failure -!***** -! -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5pset_shared_mesg_nindexes_c(plist_id, nindexes) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_SHARED_MESG_NINDEXES_C'::h5pset_shared_mesg_nindexes_c - !DEC$ENDIF - - INTEGER(HID_T), INTENT(IN) :: plist_id - INTEGER, INTENT(IN) :: nindexes - - END FUNCTION H5pset_shared_mesg_nindexes_c - END INTERFACE - - hdferr = h5pset_shared_mesg_nindexes_c(plist_id, nindexes) - - END SUBROUTINE h5pset_shared_mesg_nindexes_f - -!****s* H5P/H5Pset_shared_mesg_index_f -! NAME -! H5Pset_shared_mesg_index_f -! -! PURPOSE -! Configures the specified shared object header message index -! -! INPUTS -! -! fcpl_id - File creation property list identifier. -! index_num - Index being configured. -! mesg_type_flags - Types of messages that should be stored in this index. -! min_mesg_size - Minimum message size. -! -! OUTPUTS -! -! hdferr - error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! M. Scot Breitenfeld -! January, 2008 -! -! Fortran90 Interface: - SUBROUTINE h5pset_shared_mesg_index_f(fcpl_id, index_num, mesg_type_flags, min_mesg_size, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: fcpl_id ! file creation property list - INTEGER, INTENT(IN) :: index_num ! Index being configured. - INTEGER, INTENT(IN) :: mesg_type_flags ! Types of messages that should be stored in this index. - INTEGER, INTENT(IN) :: min_mesg_size ! Minimum message size. - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! 0 on success and -1 on failure -!***** -! -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5pset_shared_mesg_index_c(fcpl_id, index_num, mesg_type_flags, min_mesg_size) - - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_SHARED_MESG_INDEX_C'::h5pset_shared_mesg_index_c - !DEC$ENDIF - - INTEGER(HID_T), INTENT(IN) :: fcpl_id - INTEGER, INTENT(IN) :: index_num - INTEGER, INTENT(IN) :: mesg_type_flags - INTEGER, INTENT(IN) :: min_mesg_size - - END FUNCTION H5pset_shared_mesg_index_c - END INTERFACE - - hdferr = h5pset_shared_mesg_index_c(fcpl_id, index_num, mesg_type_flags, min_mesg_size) - - END SUBROUTINE h5pset_shared_mesg_index_f - -!****s* H5P/H5Pget_attr_creation_order_f -! NAME -! H5Pget_attr_creation_order_f -! -! PURPOSE -! Retrieves tracking and indexing settings for attribute creation order -! -! INPUTS -! -! ocpl_id - Object (group or dataset) creation property list identifier -! -! OUTPUTS -! -! crt_order_flags - Flags specifying whether to track and index attribute creation order -! hdferr - Error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! M. Scot Breitenfeld -! February, 2008 -! -! Fortran90 Interface: - SUBROUTINE h5pget_attr_creation_order_f(ocpl_id, crt_order_flags, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: ocpl_id ! Object (group or dataset) creation property list identifier - INTEGER, INTENT(OUT) :: crt_order_flags ! Flags specifying whether to track and index attribute creation order - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! 0 on success and -1 on failure -!***** -! -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5pget_attr_creation_order_c(ocpl_id, crt_order_flags) - - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGET_ATTR_CREATION_ORDER_C'::h5pget_attr_creation_order_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: ocpl_id - INTEGER, INTENT(OUT) :: crt_order_flags - - END FUNCTION H5pget_attr_creation_order_c - END INTERFACE - - hdferr = h5pget_attr_creation_order_c(ocpl_id, crt_order_flags) - - END SUBROUTINE h5pget_attr_creation_order_f - -!****s* H5P/H5Pset_libver_bounds_f -! NAME -! H5Pset_libver_bounds_f -! -! PURPOSE -! Sets bounds on library versions, and indirectly format versions, to be used when creating objects. -! -! INPUTS -! -! fapl_id - File access property list identifier -! low - The earliest version of the library that will be used for writing objects. -! high - The latest version of the library that will be used for writing objects. -! -! OUTPUTS -! -! hdferr - error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! M. Scot Breitenfeld -! February 18, 2008 -! -! Fortran90 Interface: - SUBROUTINE h5pset_libver_bounds_f(fapl_id, low, high, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: fapl_id ! File access property list identifier - INTEGER, INTENT(IN) :: low ! The earliest version of the library that will be used for writing objects. - ! Currently, low must be one of two pre-defined values: - ! HDF_LIBVER_EARLIEST_F - ! HDF_LIBVER_LATEST_F - INTEGER, INTENT(IN) :: high ! The latest version of the library that will be used for writing objects. - ! Currently, low must set to the pre-defined value: - ! HDF_LIBVER_LATEST_F - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! 0 on success and -1 on failure -!***** -! -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5pset_libver_bounds_c(fapl_id, low, high) - - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_LIBVER_BOUNDS_C'::h5pset_libver_bounds_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: fapl_id - INTEGER, INTENT(IN) :: low - INTEGER, INTENT(IN) :: high - - END FUNCTION H5pset_libver_bounds_c - END INTERFACE - - hdferr = h5pset_libver_bounds_c(fapl_id, low, high) - - END SUBROUTINE h5pset_libver_bounds_f - -!****s* H5P/H5Pset_link_creation_order_f -! NAME -! H5Pset_link_creation_order_f -! -! PURPOSE -! Sets creation order tracking and indexing for links in a group. -! -! INPUTS -! -! gcpl_id - Group creation property list identifier -! crt_order_flags - Creation order flag(s) -! -! OUTPUTS -! -! hdferr - Error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! M. Scot Breitenfeld -! February 18, 2008 -! -! Fortran90 Interface: - SUBROUTINE h5pset_link_creation_order_f(gcpl_id, crt_order_flags, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: gcpl_id ! File access property list identifier - INTEGER, INTENT(IN) :: crt_order_flags ! Creation order flag(s) - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! 0 on success and -1 on failure -!***** -! -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5pset_link_creation_order_c(gcpl_id, crt_order_flags) - - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_LINK_CREATION_ORDER_C'::h5pset_link_creation_order_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: gcpl_id - INTEGER, INTENT(IN) :: crt_order_flags - - END FUNCTION H5pset_link_creation_order_c - END INTERFACE - - hdferr = h5pset_link_creation_order_c(gcpl_id, crt_order_flags) - - END SUBROUTINE h5pset_link_creation_order_f - -!****s* H5P/H5Pget_link_phase_change_f -! NAME -! H5Pget_link_phase_change_f -! -! PURPOSE -! Queries the settings for conversion between compact and dense groups. -! -! INPUTS -! -! gcpl_id - Group creation property list identifier -! OUTPUTS -! -! max_compact - Maximum number of attributes to be stored in compact storage -! min_dense - Minimum number of attributes to be stored in dense storage -! hdferr - Error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! M. Scot Breitenfeld -! February 20, 2008 -! -! Fortran90 Interface: - SUBROUTINE h5pget_link_phase_change_f(gcpl_id, max_compact, min_dense, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: gcpl_id ! Group creation property list identifier - INTEGER, INTENT(OUT) :: max_compact ! Maximum number of attributes to be stored in compact storage - INTEGER, INTENT(OUT) :: min_dense ! Minimum number of attributes to be stored in dense storage - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! 0 on success and -1 on failure -!***** -! -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5pget_link_phase_change_c(gcpl_id, max_compact, min_dense) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGET_LINK_PHASE_CHANGE_C'::h5pget_link_phase_change_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: gcpl_id - INTEGER, INTENT(OUT) :: max_compact - INTEGER, INTENT(OUT) :: min_dense - - END FUNCTION h5pget_link_phase_change_c - END INTERFACE - - hdferr = h5pget_link_phase_change_c(gcpl_id, max_compact, min_dense) - END SUBROUTINE h5pget_link_phase_change_f - -!****s* H5P/H5Pget_obj_track_times_f -! NAME -! H5Pget_obj_track_times_f -! -! PURPOSE -! Returns whether times are tracked for an object. -! -! INPUTS -! -! plist_id - property list id -! flag - object timestamp setting -! .TRUE.,.FALSE. -! OUTPUTS -! -! hdferr - error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! M. Scot Breitenfeld -! February 22, 2008 -! -! Fortran90 Interface: - SUBROUTINE h5pget_obj_track_times_f(plist_id, flag, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: plist_id ! Dataset creation property - ! list identifier - LOGICAL, INTENT(OUT) :: flag ! Object timestamp setting - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! 0 on success and -1 on failure -!***** - INTEGER :: status -! -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5pget_obj_track_times_c(plist_id, status) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGET_OBJ_TRACK_TIMES_C'::h5pget_obj_track_times_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: plist_id ! File creation property list identifier - INTEGER, INTENT(OUT) :: status - END FUNCTION h5pget_obj_track_times_c - END INTERFACE - flag = .TRUE. - hdferr = h5pget_obj_track_times_c(plist_id, status) - IF(status.EQ.0) flag = .FALSE. - - END SUBROUTINE h5pget_obj_track_times_f - -!****s* H5P/H5Pset_obj_track_times_f -! NAME -! H5Pset_obj_track_times_f -! -! PURPOSE -! Set whether the birth, access, modification & change times for -! an object are stored. -! -! Birth time is the time the object was created. Access time is -! the last time that metadata or raw data was read from this -! object. Modification time is the last time the data for -! this object was changed (either writing raw data to a dataset -! or inserting/modifying/deleting a link in a group). Change -! time is the last time the metadata for this object was written -! (adding/modifying/deleting an attribute on an object, extending -! the size of a dataset, etc). -! -! If these times are not tracked, they will be reported as -! 12:00 AM UDT, Jan. 1, 1970 (i.e. 0 seconds past the UNIX -! epoch) when queried. -! -! INPUTS -! -! plist_id - property list id -! flag - object timestamp setting -! .TRUE.,.FALSE. -! OUTPUTS -! -! hdferr - error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! M. Scot Breitenfeld -! February 22, 2008 -! -! -! Fortran90 Interface: - SUBROUTINE h5pset_obj_track_times_f(plist_id, flag, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: plist_id ! Dataset creation property - ! list identifier - LOGICAL, INTENT(IN) :: flag ! Object timestamp setting - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! 0 on success and -1 on failure -!***** - INTEGER :: status -! -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5pset_obj_track_times_c(plist_id, status) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_OBJ_TRACK_TIMES_C'::h5pset_obj_track_times_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: plist_id ! File creation property list identifier - INTEGER, INTENT(IN) :: status - END FUNCTION h5pset_obj_track_times_c - END INTERFACE - - status = 0 - IF(flag) status = 1 - - hdferr = h5pset_obj_track_times_c(plist_id, status) - - END SUBROUTINE h5pset_obj_track_times_f - -!****s* H5P/H5Pset_create_inter_group_f -! NAME -! H5Pset_create_inter_group_f -! -! PURPOSE -! Specifies in property list whether to create missing intermediate groups. -! -! INPUTS -! -! lcpl_id - Link creation property list identifier -! crt_intermed_group - crt_intermed_group specifying whether -! to create intermediate groups upon the creation -! of an object -! OUTPUTS -! -! hdferr - Error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! M. Scot Breitenfeld -! February 22, 2008 -! -! HISTORY -! The long subroutine name (>31) on older f90 compilers causes problems -! so had to shorten the name -! Fortran90 Interface: - SUBROUTINE h5pset_create_inter_group_f(lcpl_id, crt_intermed_group, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: lcpl_id ! Link creation property list identifier - INTEGER, INTENT(IN) :: crt_intermed_group ! specifying whether to create intermediate groups - ! upon the creation of an object - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! 0 on success and -1 on failure -!***** -! -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5pset_create_inter_group_c(lcpl_id, crt_intermed_group) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_CREATE_INTER_GROUP_C'::h5pset_create_inter_group_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: lcpl_id - INTEGER, INTENT(IN) :: crt_intermed_group - END FUNCTION h5pset_create_inter_group_c - END INTERFACE - - hdferr = h5pset_create_inter_group_c(lcpl_id, crt_intermed_group) - - END SUBROUTINE h5pset_create_inter_group_f - -!****s* H5P/H5Pget_link_creation_order_f -! NAME -! H5Pget_link_creation_order_f -! -! PURPOSE -! Queries whether link creation order is tracked and/or indexed in a group. -! -! INPUTS -! -! gcpl_id - Group creation property list identifier -! -! OUTPUTS -! -! crt_order_flags - Creation order flag(s) -! hdferr - Error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! M. Scot Breitenfeld -! March 3, 2008 -! -! Fortran90 Interface: - SUBROUTINE h5pget_link_creation_order_f(gcpl_id, crt_order_flags, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: gcpl_id ! Group creation property list identifier - INTEGER, INTENT(OUT) :: crt_order_flags ! Creation order flag(s) - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! 0 on success and -1 on failure -!***** -! -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5pget_link_creation_order_c(gcpl_id, crt_order_flags) - - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGET_LINK_CREATION_ORDER_C'::h5pget_link_creation_order_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: gcpl_id - INTEGER, INTENT(OUT) :: crt_order_flags - - END FUNCTION H5pget_link_creation_order_c - END INTERFACE - - hdferr = h5pget_link_creation_order_c(gcpl_id, crt_order_flags) - - END SUBROUTINE h5pget_link_creation_order_f - -!****s* H5P/H5Pset_char_encoding_f -! NAME -! H5Pset_char_encoding_f -! -! PURPOSE -! Sets the character encoding used to encode a string. -! -! INPUTS -! -! plist_id - Property list identifier -! encoding - Valid values for encoding are: -! H5T_CSET_ASCII_F -> US ASCII -! H5T_CSET_UTF8_F -> UTF-8 Unicode encoding -! -! OUTPUTS -! hdferr - Error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! M. Scot Breitenfeld -! March 3, 2008 -! -! Fortran90 Interface: - SUBROUTINE h5pset_char_encoding_f(plist_id, encoding, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: plist_id ! Property list identifier - INTEGER, INTENT(IN) :: encoding ! String encoding character set: - ! H5T_CSET_ASCII_F -> US ASCII - ! H5T_CSET_UTF8_F -> UTF-8 Unicode encoding - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! 0 on success and -1 on failure -!***** -! -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5pset_char_encoding_c(plist_id, encoding) - - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_CHAR_ENCODING_C'::h5pset_char_encoding_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: plist_id - INTEGER, INTENT(IN) :: encoding - - END FUNCTION H5pset_char_encoding_c - END INTERFACE - - hdferr = h5pset_char_encoding_c(plist_id, encoding) - - END SUBROUTINE h5pset_char_encoding_f - -!****s* H5P/H5Pget_char_encoding_f -! NAME -! H5Pget_char_encoding_f -! -! PURPOSE -! Retrieves the character encoding used to create a string -! -! INPUTS -! -! plist_id - Property list identifier -! -! OUTPUTS -! -! encoding - Valid values for encoding are: -! H5T_CSET_ASCII_F -> US ASCII -! H5T_CSET_UTF8_F -> UTF-8 Unicode encoding -! hdferr - Error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! M. Scot Breitenfeld -! March 3, 2008 -! -! Fortran90 Interface: - SUBROUTINE h5pget_char_encoding_f(plist_id, encoding, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: plist_id ! Property list identifier - - INTEGER, INTENT(OUT) :: encoding ! Valid values for encoding are: - ! H5T_CSET_ASCII_F -> US ASCII - ! H5T_CSET_UTF8_F -> UTF-8 Unicode encoding - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! 0 on success and -1 on failure -!***** -! -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5pget_char_encoding_c(plist_id, encoding) - - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGET_CHAR_ENCODING_C'::h5pget_char_encoding_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: plist_id - INTEGER, INTENT(OUT) :: encoding - - END FUNCTION H5pget_char_encoding_c - END INTERFACE - - hdferr = h5pget_char_encoding_c(plist_id, encoding) - - END SUBROUTINE h5pget_char_encoding_f - -!****s* H5P/h5pset_copy_object_f -! NAME -! h5pset_copy_object_f -! -! PURPOSE -! Sets properties to be used when an object is copied. -! -! INPUTS -! -! ocp_plist_id - Object copy property list identifier -! copy_options - Copy option(s) to be set -! OUTPUTS -! -! hdferr - error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! M. Scot Breitenfeld -! March 3, 2008 -! -! HISTORY -! -! -! Fortran90 Interface: - SUBROUTINE h5pset_copy_object_f(ocp_plist_id, copy_options, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: ocp_plist_id ! Object copy property list identifier - INTEGER, INTENT(IN) :: copy_options ! Copy option(s) to be set, valid options are: - ! H5O_COPY_SHALLOW_HIERARCHY_F - ! H5O_COPY_EXPAND_SOFT_LINK_F - ! H5O_COPY_EXPAND_EXT_LINK_F - ! H5O_COPY_EXPAND_REFERENCE_F - ! H5O_COPY_WITHOUT_ATTR_FLAG_F - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! 0 on success and -1 on failure -!***** - -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5pset_copy_object_c(ocp_plist_id, copy_options) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_COPY_OBJECT_C'::h5pset_copy_object_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: ocp_plist_id - INTEGER, INTENT(IN) :: copy_options - END FUNCTION h5pset_copy_object_c - END INTERFACE - hdferr = h5pset_copy_object_c(ocp_plist_id, copy_options) - END SUBROUTINE h5pset_copy_object_f - -!****s* H5P/h5pget_copy_object_f -! NAME -! h5pget_copy_object_f -! -! PURPOSE -! Retrieves the properties to be used when an object is copied. -! -! INPUTS -! -! ocp_plist_id - Object copy property list identifier -! OUTPUTS -! -! copy_options - Copy option(s) to be get -! hdferr - Error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! M. Scot Breitenfeld -! March 3, 2008 -! -! HISTORY -! -! -! Fortran90 Interface: - SUBROUTINE h5pget_copy_object_f(ocp_plist_id, copy_options, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: ocp_plist_id ! Object copy property list identifier - INTEGER, INTENT(OUT) :: copy_options ! Valid copy options returned are: - ! H5O_COPY_SHALLOW_HIERARCHY_F - ! H5O_COPY_EXPAND_SOFT_LINK_F - ! H5O_COPY_EXPAND_EXT_LINK_F - ! H5O_COPY_EXPAND_REFERENCE_F - ! H5O_COPY_WITHOUT_ATTR_FLAG_F - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! 0 on success and -1 on failure -!***** - -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5pget_copy_object_c(ocp_plist_id, copy_options) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGET_COPY_OBJECT_C'::h5pget_copy_object_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: ocp_plist_id - INTEGER, INTENT(OUT) :: copy_options - END FUNCTION h5pget_copy_object_c - END INTERFACE - hdferr = h5pget_copy_object_c(ocp_plist_id, copy_options) - END SUBROUTINE h5pget_copy_object_f - -!****s* H5P/h5pget_data_transform_f -! NAME -! h5pget_data_transform_f -! -! PURPOSE -! Retrieves a data transform expression. -! -! INPUTS -! -! plist_id - Identifier of the property list or class -! OUTPUTS -! -! expression - buffer to hold transform expression -! hdferr - Error code -! Success: Actual lenght of the expression -! If provided buffer "expression" is -! smaller, than expression will be -! truncated to fit into -! provided user buffer -! Failure: -1 -! -! AUTHOR -! M. Scot Breitenfeld -! March 19, 2008 -! -! HISTORY -! -! Should hdferr return just 0 or 1 and add another arguement for the size? -! Fortran90 Interface: -SUBROUTINE h5pget_data_transform_f(plist_id, expression, hdferr, size) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: plist_id ! Identifier of the property list or class - CHARACTER(LEN=*), INTENT(OUT) :: expression ! Buffer to hold transform expression - INTEGER(SIZE_T), INTENT(OUT), OPTIONAL :: size ! Registered size of the transform expression - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! 0 on success and -1 on failure -!***** - INTEGER :: expression_len - INTEGER(SIZE_T) :: size_default - - -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5pget_data_transform_c(plist_id, expression, expression_len, size_default) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGET_DATA_TRANSFORM_C'::h5pget_data_transform_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: expression - INTEGER(HID_T), INTENT(IN) :: plist_id - CHARACTER(LEN=*), INTENT(OUT) :: expression - INTEGER(SIZE_T) :: size_default - INTEGER :: expression_len - END FUNCTION h5pget_data_transform_c - END INTERFACE - - size_default = 0 - expression_len = LEN(expression) - - hdferr = h5pget_data_transform_c(plist_id, expression, expression_len, size_default) - - IF(present(size)) size = size_default - - END SUBROUTINE h5pget_data_transform_f - -!****s* H5P/h5pset_data_transform_f -! NAME -! h5pset_data_transform_f -! -! PURPOSE -! Sets a data transform expression. -! -! INPUTS -! -! plist_id - Identifier of the property list or class -! expression - Buffer to hold transform expression -! OUTPUTS -! -! hdferr - error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! M. Scot Breitenfeld -! March 19, 2008 -! -! Fortran90 Interface: - SUBROUTINE h5pset_data_transform_f(plist_id, expression, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: plist_id ! Identifier of the property list or class - CHARACTER(LEN=*), INTENT(IN) :: expression ! Buffer to hold transform expression - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! 0 on success and -1 on failure -!***** - INTEGER :: expression_len - -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5pset_data_transform_c(plist_id, expression, expression_len) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_DATA_TRANSFORM_C'::h5pset_data_transform_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: expression - INTEGER(HID_T), INTENT(IN) :: plist_id - CHARACTER(LEN=*), INTENT(IN) :: expression - INTEGER :: expression_len - END FUNCTION h5pset_data_transform_c - END INTERFACE - - expression_len = LEN(expression) - hdferr = h5pset_data_transform_c(plist_id, expression, expression_len) - - END SUBROUTINE h5pset_data_transform_f - -!****s* H5P/H5Pget_local_heap_size_hint_f -! NAME -! H5Pget_local_heap_size_hint_f -! -! PURPOSE -! Queries the local heap size hint for original-style groups. -! -! INPUTS -! -! gcpl_id - Group creation property list identifier -! OUTPUTS -! -! size_hint - Hint for size of local heap -! hdferr - Error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! M. Scot Breitenfeld -! March 21, 2008 -! -! Fortran90 Interface: - SUBROUTINE h5pget_local_heap_size_hint_f(gcpl_id, size_hint, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: gcpl_id ! Group creation property list identifier - INTEGER(SIZE_T), INTENT(OUT) :: size_hint ! Hint for size of local heap - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! 0 on success and -1 on failure -!***** - -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5pget_local_heap_size_hint_c(gcpl_id, size_hint) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGET_LOCAL_HEAP_SIZE_HINT_C'::h5pget_local_heap_size_hint_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: gcpl_id - INTEGER(SIZE_T), INTENT(OUT) :: size_hint - END FUNCTION H5Pget_local_heap_size_hint_c - END INTERFACE - - hdferr = H5Pget_local_heap_size_hint_c(gcpl_id, size_hint) - - END SUBROUTINE h5pget_local_heap_size_hint_f - -!****s* H5P/H5Pget_est_link_info_f -! NAME -! H5Pget_est_link_info_f -! -! PURPOSE -! Queries data required to estimate required local heap or object header size. -! -! INPUTS -! -! gcpl_id - Group creation property list identifier -! OUTPUTS -! -! est_num_entries - Estimated number of links to be inserted into group -! est_name_len - Estimated average length of link names -! hdferr - Error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! M. Scot Breitenfeld -! March 21, 2008 -! -! HISTORY -! -! -! Fortran90 Interface: - SUBROUTINE h5pget_est_link_info_f(gcpl_id, est_num_entries, est_name_len, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: gcpl_id ! Group creation property list identifier - INTEGER, INTENT(OUT) :: est_num_entries ! Estimated number of links to be inserted into group - INTEGER, INTENT(OUT) :: est_name_len ! Estimated average length of link names - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! 0 on success and -1 on failure -!***** - -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5pget_est_link_info_c(gcpl_id, est_num_entries, est_name_len) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGET_EST_LINK_INFO_C'::h5pget_est_link_info_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: gcpl_id - INTEGER, INTENT(OUT) :: est_num_entries - INTEGER, INTENT(OUT) :: est_name_len - END FUNCTION h5pget_est_link_info_c - END INTERFACE - - hdferr = h5pget_est_link_info_c(gcpl_id, est_num_entries, est_name_len) - - END SUBROUTINE h5pget_est_link_info_f - -!****s* H5P/H5Pset_local_heap_size_hint_f -! NAME -! H5Pset_local_heap_size_hint_f -! -! PURPOSE -! Sets the local heap size hint for original-style groups. -! -! INPUTS -! -! gcpl_id - Group creation property list identifier -! size_hint - Hint for size of local heap -! OUTPUTS -! -! hdferr - Error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! M. Scot Breitenfeld -! March 21, 2008 -! -! Fortran90 Interface: - SUBROUTINE h5pset_local_heap_size_hint_f(gcpl_id, size_hint, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: gcpl_id ! Group creation property list identifier - INTEGER(SIZE_T), INTENT(IN) :: size_hint ! Hint for size of local heap - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! 0 on success and -1 on failure -!***** - -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5pset_local_heap_size_hint_c(gcpl_id, size_hint) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_LOCAL_HEAP_SIZE_HINT_C'::h5pset_local_heap_size_hint_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: gcpl_id - INTEGER(SIZE_T), INTENT(IN) :: size_hint - END FUNCTION h5pset_local_heap_size_hint_c - END INTERFACE - - hdferr = H5Pset_local_heap_size_hint_c(gcpl_id, size_hint) - - END SUBROUTINE h5pset_local_heap_size_hint_f - -!****s* H5P/h5pset_est_link_info_f -! NAME -! h5pset_est_link_info_f -! -! PURPOSE -! Sets estimated number of links and length of link names in a group. -! -! INPUTS -! -! gcpl_id - Group creation property list identifier -! est_num_entries - Estimated number of links to be inserted into group -! est_name_len - Estimated average length of link names -! OUTPUTS -! -! hdferr - Error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! M. Scot Breitenfeld -! March 21, 2008 -! -! Fortran90 Interface: - SUBROUTINE h5pset_est_link_info_f(gcpl_id, est_num_entries, est_name_len, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: gcpl_id ! Group creation property list identifier - INTEGER, INTENT(IN) :: est_num_entries ! Estimated number of links to be inserted into group - INTEGER, INTENT(IN) :: est_name_len ! Estimated average length of link names - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! 0 on success and -1 on failure -!***** - -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5pset_est_link_info_c(gcpl_id, est_num_entries, est_name_len) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_EST_LINK_INFO_C'::h5pset_est_link_info_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: gcpl_id - INTEGER, INTENT(IN) :: est_num_entries - INTEGER, INTENT(IN) :: est_name_len - END FUNCTION h5pset_est_link_info_c - END INTERFACE - - hdferr = H5Pset_est_link_info_c(gcpl_id, est_num_entries, est_name_len) - - END SUBROUTINE h5pset_est_link_info_f - -!****s* H5P/h5pset_link_phase_change_f -! NAME -! h5pset_link_phase_change_f -! -! PURPOSE -! Sets the parameters for conversion between compact and dense groups. -! -! INPUTS -! -! gcpl_id - Group creation property list identifier -! max_compact - Maximum number of attributes to be stored in compact storage -! min_dense - Minimum number of attributes to be stored in dense storage -! OUTPUTS -! -! hdferr - error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! M. Scot Breitenfeld -! March 21, 2008 -! -! Fortran90 Interface: -SUBROUTINE h5pset_link_phase_change_f(gcpl_id, max_compact, min_dense, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: gcpl_id ! Group creation property list identifier - INTEGER, INTENT(IN) :: max_compact ! Maximum number of attributes to be stored in compact storage - INTEGER, INTENT(IN) :: min_dense ! Minimum number of attributes to be stored in dense storage - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! 0 on success and -1 on failure -!***** -! -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5pset_link_phase_change_c(gcpl_id, max_compact, min_dense) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_LINK_PHASE_CHANGE_C'::h5pset_link_phase_change_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: gcpl_id - INTEGER, INTENT(IN) :: max_compact - INTEGER, INTENT(IN) :: min_dense - - END FUNCTION h5pset_link_phase_change_c - END INTERFACE - - hdferr = h5pset_link_phase_change_c(gcpl_id, max_compact, min_dense) - END SUBROUTINE h5pset_link_phase_change_f - -!****s* H5P/h5pset_fapl_direct_f -! NAME -! h5pset_fapl_direct_f -! -! PURPOSE -! Sets up use of the direct I/O driver. -! -! INPUTS -! -! fapl_id - File access property list identifier -! alignment - Required memory alignment boundary -! block_size - File system block size -! cbuf_size - Copy buffer size -! OUTPUTS -! -! hdferr - error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! M. Scot Breitenfeld -! March 21, 2008 -! -! Fortran90 Interface: -SUBROUTINE h5pset_fapl_direct_f(fapl_id, alignment, block_size, cbuf_size, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: fapl_id ! File access property list identifier - INTEGER(SIZE_T), INTENT(IN) :: alignment ! Required memory alignment boundary! - INTEGER(SIZE_T), INTENT(IN) :: block_size ! File system block size - INTEGER(SIZE_T), INTENT(IN) :: cbuf_size ! Copy buffer size - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! 0 on success and -1 on failure -!***** -! -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5pset_fapl_direct_c(fapl_id, alignment, block_size, cbuf_size) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_FAPL_DIRECT_C'::h5pset_fapl_direct_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: fapl_id - INTEGER(SIZE_T), INTENT(IN) :: alignment - INTEGER(SIZE_T), INTENT(IN) :: block_size - INTEGER(SIZE_T), INTENT(IN) :: cbuf_size - END FUNCTION h5pset_fapl_direct_c - END INTERFACE - - hdferr = H5Pset_fapl_direct_c(fapl_id, alignment, block_size, cbuf_size) - END SUBROUTINE h5pset_fapl_direct_f - -!****s* H5P/h5pget_fapl_direct_f -! NAME -! h5pget_fapl_direct_f -! -! PURPOSE -! Gets up use of the direct I/O driver. -! -! INPUTS -! -! fapl_id - File access property list identifier -! OUTPUTS -! -! alignment - Required memory alignment boundary -! block_size - File system block size -! cbuf_size - Copy buffer size -! hdferr - error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! M. Scot Breitenfeld -! March 21, 2008 -! -! Fortran90 Interface: - SUBROUTINE h5pget_fapl_direct_f(fapl_id, alignment, block_size, cbuf_size, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: fapl_id ! File access property list identifier - INTEGER(SIZE_T), INTENT(OUT) :: alignment ! Required memory alignment boundary! - INTEGER(SIZE_T), INTENT(OUT) :: block_size ! File system block size - INTEGER(SIZE_T), INTENT(OUT) :: cbuf_size ! Copy buffer size - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! 0 on success and -1 on failure -!***** -! -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5pget_fapl_direct_c(fapl_id, alignment, block_size, cbuf_size) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGET_FAPL_DIRECT_C'::h5pget_fapl_direct_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: fapl_id - INTEGER(SIZE_T), INTENT(OUT) :: alignment - INTEGER(SIZE_T), INTENT(OUT) :: block_size - INTEGER(SIZE_T), INTENT(OUT) :: cbuf_size - END FUNCTION h5pget_fapl_direct_c - END INTERFACE - - hdferr = H5Pget_fapl_direct_c(fapl_id, alignment, block_size, cbuf_size) - END SUBROUTINE h5pget_fapl_direct_f - -!****s* H5P/H5Pset_attr_phase_change_f -! NAME -! H5Pset_attr_phase_change_f -! -! PURPOSE -! Sets attribute storage phase change thresholds. -! -! INPUTS -! -! ocpl_id - Object (dataset or group) creation property list identifier -! OUTPUTS -! -! max_compact - Maximum number of attributes to be stored in compact storage -! (Default: 8) -! min_dense - Minimum number of attributes to be stored in dense storage -! (Default: 6) -! hdferr - Error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! M. Scot Breitenfeld -! January, 2008 -! -! Fortran90 Interface: -SUBROUTINE h5pset_attr_phase_change_f(ocpl_id, max_compact, min_dense, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: ocpl_id ! Object (dataset or group) creation property list identifier - INTEGER, INTENT(IN) :: max_compact ! Maximum number of attributes to be stored in compact storage - !(Default: 8) - INTEGER, INTENT(IN) :: min_dense ! Minimum number of attributes to be stored in dense storage - ! (Default: 6) - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! 0 on success and -1 on failure -!***** -! -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5pset_attr_phase_change_c(ocpl_id, max_compact, min_dense) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_ATTR_PHASE_CHANGE_C'::h5pset_attr_phase_change_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: ocpl_id - INTEGER, INTENT(IN) :: max_compact - INTEGER, INTENT(IN) :: min_dense - - END FUNCTION h5pset_attr_phase_change_c - END INTERFACE - - hdferr = h5pset_attr_phase_change_c(ocpl_id, max_compact, min_dense) - - - END SUBROUTINE h5pset_attr_phase_change_f - -!****s* H5P/H5Pset_nbit_f -! NAME -! H5Pset_nbit_f -! -! PURPOSE -! Sets up the use of the N-Bit filter. -! -! Inputs: -! plist_id - Dataset creation property list identifier. -! -! Outputs: -! hdferr - Returns 0 if successful and -1 if fails -! -! AUTHOR -! M. Scot Breitenfeld -! March 21, 2008 -! -! Fortran90 Interface: - SUBROUTINE h5pset_nbit_f(plist_id, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: plist_id - INTEGER , INTENT(OUT) :: hdferr -!***** - INTERFACE - INTEGER FUNCTION H5Pset_nbit_c(plist_id) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_NBIT_C'::h5pset_nbit_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: plist_id - END FUNCTION H5Pset_nbit_c - END INTERFACE - - hdferr = H5Pset_nbit_c(plist_id) - - END SUBROUTINE h5pset_nbit_f - -!****s* H5P/h5pset_scaleoffset_f -! NAME -! h5pset_scaleoffset_f -! -! PURPOSE -! Sets up the use of the scale-offset filter. -! -! Inputs: -! plist_id - Dataset creation property list identifier. -! scale_type - Flag indicating compression method. Valid values: -! H5Z_SO_FLOAT_DSCALE_F -! H5Z_SO_FLOAT_ESCALE_F -! H5Z_SO_INT_F -! -! scale_factor - Parameter related to scale. -! -! Outputs: -! hdferr - Returns 0 if successful and -1 if fails -! -! AUTHOR -! M. Scot Breitenfeld -! March 21, 2008 -! -! Fortran90 Interface: - SUBROUTINE h5pset_scaleoffset_f(plist_id, scale_type, scale_factor, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: plist_id - INTEGER , INTENT(IN) :: scale_type - INTEGER , INTENT(IN) :: scale_factor - INTEGER , INTENT(OUT) :: hdferr -!***** - - INTERFACE - INTEGER FUNCTION h5pset_scaleoffset_c(plist_id, scale_type, scale_factor) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_SCALEOFFSET_C'::h5pset_scaleoffset_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: plist_id - INTEGER, INTENT(IN) :: scale_type - INTEGER, INTENT(IN) :: scale_factor - END FUNCTION h5pset_scaleoffset_c - END INTERFACE - - hdferr = H5Pset_scaleoffset_c(plist_id, scale_type, scale_factor) - - END SUBROUTINE h5pset_scaleoffset_f - -!****s* H5P/h5pset_nlinks_f -! NAME -! h5pset_nlinks_f -! -! PURPOSE -! Sets maximum number of soft or user-defined link traversals. -! -! INPUTS -! -! lapl_id - File access property list identifier -! nlinks - Maximum number of links to traverse -! -! OUTPUTS -! -! hdferr - Error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! M. Scot Breitenfeld -! March 24, 2008 -! -! HISTORY -! -! -! Fortran90 Interface: - SUBROUTINE h5pset_nlinks_f(lapl_id, nlinks, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: lapl_id ! File access property list identifier - INTEGER(SIZE_T), INTENT(IN) :: nlinks ! Maximum number of links to traverse - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! 0 on success and -1 on failure -!***** - -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5pset_nlinks_c(lapl_id, nlinks) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_NLINKS_C'::h5pset_nlinks_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: lapl_id - INTEGER(SIZE_T), INTENT(IN) :: nlinks - END FUNCTION h5pset_nlinks_c - END INTERFACE - - hdferr = h5pset_nlinks_c(lapl_id, nlinks) - - END SUBROUTINE h5pset_nlinks_f - -!****s* H5P/h5pget_nlinks_f -! NAME -! h5pget_nlinks_f -! -! PURPOSE -! Gets maximum number of soft or user-defined link traversals. -! -! INPUTS -! -! lapl_id - File access property list identifier -! nlinks - Maximum number of links to traverse -! -! OUTPUTS -! -! hdferr - error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! M. Scot Breitenfeld -! March 24, 2008 -! -! Fortran90 Interface: - SUBROUTINE h5pget_nlinks_f(lapl_id, nlinks, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: lapl_id ! File access property list identifier - INTEGER(SIZE_T), INTENT(OUT) :: nlinks ! Maximum number of links to traverse - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! 0 on success and -1 on failure -!***** -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5pget_nlinks_c(lapl_id, nlinks) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGET_NLINKS_C'::h5pget_nlinks_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: lapl_id - INTEGER(SIZE_T), INTENT(OUT) :: nlinks - END FUNCTION h5pget_nlinks_c - END INTERFACE - - hdferr = h5pget_nlinks_c(lapl_id, nlinks) - - END SUBROUTINE h5pget_nlinks_f - -!****s* H5P/H5Pget_create_inter_group_f -! NAME -! H5Pget_create_inter_group_f -! -! PURPOSE -! Determines whether property is set to enable creating missing intermediate groups. -! -! INPUTS -! -! lcpl_id - Link creation property list identifier -! crt_intermed_group - Specifying whether to create intermediate groups upon -! the creation of an object -! OUTPUTS -! -! hdferr - Error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! M. Scot Breitenfeld -! April 4, 2008 -! -! HISTORY -! -! The long subroutine name (>31) on older f90 compilers causes problems -! so the name was shortened -! Fortran90 Interface: - SUBROUTINE h5pget_create_inter_group_f(lcpl_id, crt_intermed_group, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: lcpl_id ! Link creation property list identifier - INTEGER, INTENT(IN) :: crt_intermed_group ! Flag specifying whether to create intermediate groups - ! upon creation of an object - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! 0 on success and -1 on failure -!***** - INTERFACE - INTEGER FUNCTION h5pget_create_inter_group_c(lcpl_id, crt_intermed_group) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGET_CREATE_INTER_GROUP_C'::h5pget_create_inter_group_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: lcpl_id - INTEGER, INTENT(IN) :: crt_intermed_group - END FUNCTION h5pget_create_inter_group_c - END INTERFACE - - hdferr = h5pget_create_inter_group_c(lcpl_id, crt_intermed_group) - - END SUBROUTINE h5pget_create_inter_group_f - -!****s* H5P/H5Pset_chunk_cache_f -! NAME -! H5Pset_chunk_cache_f -! -! PURPOSE -! Set the number of objects in the meta data cache and the -! maximum number of chunks and bytes in the raw data chunk cache. -! Once set, these values will override the values in the file access -! property list. Each of these values can be individually unset -! (or not set at all) by passing the macros: -! H5D_CHUNK_CACHE_NSLOTS_DFLT_F, -! H5D_CHUNK_CACHE_NBYTES_DFLT_F, and/or -! H5D_CHUNK_CACHE_W0_DFLT_F -! as appropriate. -! -! The RDCC_W0 value should be between 0 and 1 inclusive and -! indicates how much chunks that have been fully read or fully -! written are favored for preemption. A value of zero means -! fully read or written chunks are treated no differently than -! other chunks (the preemption is strictly LRU) while a value -! of one means fully read chunks are always preempted before -! other chunks. -! -! INPUTS -! -! dapl_id - Dataset access property list identifier. -! rdcc_nslots - The number of chunk slots in the raw data chunk cache for this dataset. -! rdcc_nbytes - The total size of the raw data chunk cache for this dataset. -! rdcc_w0 - The chunk preemption policy for this dataset. -! OUTPUTS -! -! hdferr - Error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! M. Scot Breitenfeld -! April 13, 2009 -! -! HISTORY -! -! Fortran90 Interface: - SUBROUTINE h5pset_chunk_cache_f(dapl_id, rdcc_nslots, rdcc_nbytes, rdcc_w0, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dapl_id ! Dataset access property list identifier. - INTEGER(SIZE_T), INTENT(IN) :: rdcc_nslots ! The number of chunk slots in the raw data - ! chunk cache for this dataset. - INTEGER(SIZE_T), INTENT(IN) :: rdcc_nbytes ! The total size of the raw data chunk cache - ! for this dataset. - REAL, INTENT(IN) :: rdcc_w0 ! The chunk preemption policy for this dataset. - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! 0 on success and -1 on failure -!***** - - INTERFACE - INTEGER FUNCTION h5pset_chunk_cache_c(dapl_id, rdcc_nslots, rdcc_nbytes, rdcc_w0) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_CHUNK_CACHE_C'::h5pset_chunk_cache_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: dapl_id - INTEGER(SIZE_T), INTENT(IN) :: rdcc_nslots - INTEGER(SIZE_T), INTENT(IN) :: rdcc_nbytes - REAL, INTENT(IN) :: rdcc_w0 - END FUNCTION h5pset_chunk_cache_c - END INTERFACE - - hdferr = h5pset_chunk_cache_c(dapl_id, rdcc_nslots, rdcc_nbytes, rdcc_w0) - - END SUBROUTINE h5pset_chunk_cache_f - -!****s* H5P/H5Pget_chunk_cache_f -! NAME -! H5Pget_chunk_cache_f -! -! PURPOSE -! Retrieves the maximum possible number of elements in the meta -! data cache and the maximum possible number of elements and -! bytes and the RDCC_W0 value in the raw data chunk cache. Any -! (or all) arguments may be null pointers in which case the -! corresponding datum is not returned. If these properties have -! not been set on this property list, the default values for a -! file access property list are returned. -! -! INPUTS -! -! dapl_id - Dataset access property list identifier. -! OUTPUTS -! -! rdcc_nslots - Number of chunk slots in the raw data chunk cache hash table. -! rdcc_nbytes - Total size of the raw data chunk cache, in bytes. -! rdcc_w0 - Preemption policy. -! hdferr - Error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! M. Scot Breitenfeld -! April 13, 2009 -! -! HISTORY -! -! Fortran90 Interface: - SUBROUTINE h5pget_chunk_cache_f(dapl_id, rdcc_nslots, rdcc_nbytes, rdcc_w0, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dapl_id ! Dataset access property list identifier. - INTEGER(SIZE_T), INTENT(OUT) :: rdcc_nslots ! Number of chunk slots in the raw data chunk cache hash table. - INTEGER(SIZE_T), INTENT(OUT) :: rdcc_nbytes ! Total size of the raw data chunk cache, in bytes. - REAL, INTENT(OUT) :: rdcc_w0 ! Preemption policy. - INTEGER, INTENT(OUT) :: hdferr ! Error code: - ! 0 on success and -1 on failure -!***** - INTERFACE - INTEGER FUNCTION h5pget_chunk_cache_c(dapl_id, rdcc_nslots, rdcc_nbytes, rdcc_w0) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGET_CHUNK_CACHE_C'::h5pget_chunk_cache_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: dapl_id - INTEGER(SIZE_T), INTENT(OUT) :: rdcc_nslots - INTEGER(SIZE_T), INTENT(OUT) :: rdcc_nbytes - REAL, INTENT(OUT) :: rdcc_w0 - END FUNCTION h5pget_chunk_cache_c - END INTERFACE - - hdferr = h5pget_chunk_cache_c(dapl_id, rdcc_nslots, rdcc_nbytes, rdcc_w0) - - END SUBROUTINE h5pget_chunk_cache_f - -END MODULE H5P - - - diff --git a/fortran/src/H5Pff_F03.f90 b/fortran/src/H5Pff_F03.f90 deleted file mode 100644 index 01d1d98..0000000 --- a/fortran/src/H5Pff_F03.f90 +++ /dev/null @@ -1,1267 +0,0 @@ -!****h* ROBODoc/H5P (F03) -! -! NAME -! H5P_PROVISIONAL -! -! PURPOSE -! This file contains Fortran 90 and Fortran 2003 interfaces for H5P functions. -! It contains the same functions as H5Pff_F90.f90 but includes the -! Fortran 2003 functions and the interface listings. This file will be compiled -! instead of H5Pff_F90.f90 if Fortran 2003 functions are enabled. -! -! 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. * -! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -! -! NOTES -! *** IMPORTANT *** -! If you add a new H5P function you must add the function name to the -! Windows dll file 'hdf5_fortrandll.def.in' in the fortran/src directory. -! This is needed for Windows based operating systems. -! -!***** - -MODULE H5P_PROVISIONAL - - USE H5GLOBAL - - INTERFACE h5pset_fill_value_f - MODULE PROCEDURE h5pset_fill_value_integer - MODULE PROCEDURE h5pset_fill_value_real - MODULE PROCEDURE h5pset_fill_value_char - ! Recommended procedure: - MODULE PROCEDURE h5pset_fill_value_ptr - - END INTERFACE - - INTERFACE h5pget_fill_value_f - MODULE PROCEDURE h5pget_fill_value_integer - MODULE PROCEDURE h5pget_fill_value_real - MODULE PROCEDURE h5pget_fill_value_char - ! Recommended procedure: - MODULE PROCEDURE h5pget_fill_value_ptr - - END INTERFACE - - INTERFACE h5pset_f - MODULE PROCEDURE h5pset_integer - MODULE PROCEDURE h5pset_real - MODULE PROCEDURE h5pset_char - ! Recommended procedure: - MODULE PROCEDURE h5pset_ptr - - END INTERFACE - - INTERFACE h5pget_f - MODULE PROCEDURE h5pget_integer - MODULE PROCEDURE h5pget_real - MODULE PROCEDURE h5pget_char - ! Recommended procedure: - MODULE PROCEDURE h5pget_ptr - END INTERFACE - - INTERFACE h5pregister_f - MODULE PROCEDURE h5pregister_integer - MODULE PROCEDURE h5pregister_real - MODULE PROCEDURE h5pregister_char - ! Recommended procedure: - MODULE PROCEDURE h5pregister_ptr - END INTERFACE - - INTERFACE h5pinsert_f - MODULE PROCEDURE h5pinsert_integer - MODULE PROCEDURE h5pinsert_real - MODULE PROCEDURE h5pinsert_char - ! Recommended procedure: - MODULE PROCEDURE h5pinsert_ptr - END INTERFACE - - INTERFACE - INTEGER FUNCTION h5pget_fill_value_c(prp_id, type_id, fillvalue) & - BIND(C, NAME='h5pget_fill_value_c') - USE H5GLOBAL - USE, INTRINSIC :: ISO_C_BINDING, ONLY : c_ptr - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier of - ! of fillvalue datatype - ! (in memory) - TYPE(C_PTR), VALUE :: fillvalue ! Fillvalue - END FUNCTION h5pget_fill_value_c - END INTERFACE - - INTERFACE - INTEGER FUNCTION h5pset_fill_value_c(prp_id, type_id, fillvalue) & - BIND(C, NAME='h5pset_fill_value_c') - USE H5GLOBAL - USE, INTRINSIC :: ISO_C_BINDING, ONLY : c_ptr - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier of - ! of fillvalue datatype - ! (in memory) - TYPE(C_PTR), VALUE :: fillvalue ! Fillvalue - END FUNCTION h5pset_fill_value_c - END INTERFACE - - INTERFACE - INTEGER FUNCTION h5pset_c(prp_id, name, name_len, value) & - BIND(C, NAME='h5pset_c') - USE, INTRINSIC :: ISO_C_BINDING, ONLY : c_char, c_ptr - USE H5GLOBAL - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: name ! Name of property to modify - INTEGER :: name_len - TYPE(C_PTR), VALUE :: value ! Property value - END FUNCTION h5pset_c - END INTERFACE - - INTERFACE - INTEGER FUNCTION h5pget_c(prp_id, name, name_len, value) & - BIND(C, NAME='h5pget_c') - USE, INTRINSIC :: ISO_C_BINDING, ONLY : c_char, c_ptr - USE H5GLOBAL - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: name ! Name of property to modify - INTEGER :: name_len - TYPE(C_PTR), VALUE :: value ! Property value - END FUNCTION h5pget_c - END INTERFACE - - INTERFACE - INTEGER FUNCTION h5pregister_c(class, name, name_len, size, value) & - BIND(C, NAME='h5pregister_c') - USE, INTRINSIC :: ISO_C_BINDING, ONLY : c_char, c_ptr - USE H5GLOBAL - INTEGER(HID_T), INTENT(IN) :: class - CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: name - INTEGER, INTENT(IN) :: name_len - INTEGER(SIZE_T), INTENT(IN) :: size - TYPE(C_PTR), INTENT(IN), VALUE :: value - END FUNCTION h5pregister_c - END INTERFACE - - INTERFACE - INTEGER FUNCTION h5pinsert_c(plist, name, name_len, size, value) & - BIND(C, NAME='h5pinsert_c') - USE, INTRINSIC :: ISO_C_BINDING, ONLY : c_char, c_ptr - USE H5GLOBAL - INTEGER(HID_T), INTENT(IN) :: plist - CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: name - INTEGER, INTENT(IN) :: name_len - INTEGER(SIZE_T), INTENT(IN) :: size - TYPE(C_PTR), INTENT(IN), VALUE :: value - END FUNCTION h5pinsert_c - END INTERFACE - -CONTAINS - -! -!****s* H5P (F03)/h5pset_fill_value_f_F90 -! -! NAME -! h5pset_fill_value_f -! -! PURPOSE -! Sets fill value for a dataset creation property list -! -! Inputs: -! prp_id - Property list identifier -! type_id - Datatype identifier of fill value datatype (in memory) -! fillvalue - Fillvalue -! -! Outputs: -! hdferr - Returns 0 if successful and -1 if fails -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 14, 2001 -! -! Added the recommended way of passing fillvalue -! and that is by passing the C address, all other -! ways are obsolete and should be avoided. June, 2008 MSB -! -! NOTES -! h5pset(get)fill_value_f function is overloaded to support -! INTEGER, REAL, DOUBLE PRECISION and CHARACTER dtatypes. -! -! Fortran90 Interface: -!! SUBROUTINE h5pset_fill_value_f(prp_id, type_id, fillvalue, hdferr) -!! IMPLICIT NONE -!! INTEGER(HID_T), INTENT(IN) :: prp_id -!! INTEGER(HID_T), INTENT(IN) :: type_id -!! TYPE(VOID) , INTENT(IN) :: fillvalue -!! INTEGER , INTENT(OUT) :: hdferr -!***** - - - SUBROUTINE h5pset_fill_value_integer(prp_id, type_id, fillvalue, hdferr) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier of - ! of fillvalue datatype - ! (in memory) - INTEGER, INTENT(IN), TARGET :: fillvalue ! Fillvalue - INTEGER, INTENT(OUT) :: hdferr ! Error code - TYPE(C_PTR) :: f_ptr ! C address - - f_ptr = C_LOC(fillvalue) - - hdferr = h5pset_fill_value_c(prp_id, type_id, f_ptr) - - END SUBROUTINE h5pset_fill_value_integer -! -!****s* H5P (F03)/h5pget_fill_value_f_F90 -! -! NAME -! h5pget_fill_value_f -! -! PURPOSE -! Gets fill value for a dataset creation property list -! -! Inputs: -! prp_id - Property list identifier -! type_id - Datatype identifier of fill value datatype (in memory) -! -! Outputs: -! fillvalue - Fillvalue -! hdferr - Returns 0 if successful and -1 if fails -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 14, 2001 -! -! Added the recommended way of passing fillvalue -! and that is by passing the C address, all other -! ways are obsolete and should be avoided. June, 2008 MSB -! -! NOTES -! h5pget(get)fill_value_f function is overloaded to support -! INTEGER, REAL, DOUBLE PRECISION and CHARACTER dtatypes. -! -! Fortran90 Interface: -!! SUBROUTINE h5pget_fill_value_f(prp_id, type_id, fillvalue, hdferr) -!! INTEGER(HID_T), INTENT(IN) :: prp_id -!! INTEGER(HID_T), INTENT(IN) :: type_id -!! TYPE(VOID) , INTENT(OUT) :: fillvalue -!! INTEGER , INTENT(OUT) :: hdferr -!***** - - SUBROUTINE h5pget_fill_value_integer(prp_id, type_id, fillvalue, hdferr) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier of - ! of fillvalue datatype - ! (in memory) - INTEGER, INTENT(OUT), TARGET :: fillvalue ! Fillvalue - INTEGER, INTENT(OUT) :: hdferr ! Error code - TYPE(C_PTR) :: f_ptr ! C address - - f_ptr = C_LOC(fillvalue) - - hdferr = h5pget_fill_value_c(prp_id, type_id, f_ptr) - - END SUBROUTINE h5pget_fill_value_integer - - - SUBROUTINE h5pset_fill_value_real(prp_id, type_id, fillvalue, hdferr) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier of - ! of fillvalue datatype - ! (in memory) - REAL, INTENT(IN), TARGET :: fillvalue ! Fillvalue - INTEGER, INTENT(OUT) :: hdferr ! Error code - TYPE(C_PTR) :: f_ptr ! C address - - f_ptr = C_LOC(fillvalue) - - hdferr = h5pset_fill_value_c(prp_id, type_id, f_ptr) - - END SUBROUTINE h5pset_fill_value_real - - - SUBROUTINE h5pget_fill_value_real(prp_id, type_id, fillvalue, hdferr) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier of - ! of fillvalue datatype - ! (in memory) - REAL, INTENT(OUT), TARGET :: fillvalue ! Fillvalue - INTEGER, INTENT(OUT) :: hdferr ! Error code - TYPE(C_PTR) :: f_ptr ! C address - - f_ptr = C_LOC(fillvalue) - - hdferr = h5pget_fill_value_c(prp_id, type_id, f_ptr) - - END SUBROUTINE h5pget_fill_value_real - - SUBROUTINE h5pset_fill_value_char(prp_id, type_id, fillvalue, hdferr) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier of - ! of fillvalue datatype - ! (in memory) - CHARACTER, INTENT(IN), TARGET :: fillvalue ! Fillvalue - INTEGER, INTENT(OUT) :: hdferr ! Error code - TYPE(C_PTR) :: f_ptr ! C address - - f_ptr = C_LOC(fillvalue) - - hdferr = h5pset_fill_value_c(prp_id, type_id, f_ptr) - - END SUBROUTINE h5pset_fill_value_char - - SUBROUTINE h5pget_fill_value_char(prp_id, type_id, fillvalue, hdferr) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier of - ! of fillvalue datatype - ! (in memory) - CHARACTER, INTENT(OUT) :: fillvalue ! Fillvalue - INTEGER, INTENT(OUT) :: hdferr ! Error code - - INTEGER :: i - CHARACTER(LEN=1), ALLOCATABLE, DIMENSION(:), TARGET :: chr - INTEGER :: chr_len - - TYPE(C_PTR) :: f_ptr ! C address - ! To resolve Issue #1 outlined in the preamble of this file we - ! need to pack the character string into an array. - - chr_len = LEN(fillvalue) - ALLOCATE(chr(1:chr_len), STAT=hdferr) - IF (hdferr .NE. 0) THEN - hdferr = -1 - RETURN - ENDIF - - f_ptr = C_LOC(chr(1)(1:1)) - - hdferr = h5pget_fill_value_c(prp_id, type_id, f_ptr) - - DO i = 1, chr_len - fillvalue(i:i) = chr(i) - ENDDO - DEALLOCATE(chr) - - END SUBROUTINE h5pget_fill_value_char -! -!****s* H5P (F03)/h5pset_fill_value_f_F03 -! -! NAME -! h5pset_fill_value_f -! -! PURPOSE -! Sets fill value for a dataset creation property list -! -! Inputs: -! prp_id - Property list identifier -! type_id - Datatype identifier of fill value datatype (in memory) -! fillvalue - Fillvalue -! -! Outputs: -! hdferr - Returns 0 if successful and -1 if fails -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 14, 2001 -! -! Added the recommended way of passing fillvalue -! and that is by passing the C address, all other -! ways are obsolete and should be avoided. June, 2008 MSB -! -! NOTES -! h5pset(get)fill_value_f function is overloaded to support -! INTEGER, REAL, DOUBLE PRECISION and CHARACTER dtatypes. -! -! Fortran2003 Interface: -!! SUBROUTINE h5pset_fill_value_f(prp_id, type_id, fillvalue, hdferr) -!! INTEGER(HID_T), INTENT(IN) :: prp_id -!! INTEGER(HID_T), INTENT(IN) :: type_id -!! TYPE(C_PTR) , INTENT(IN) :: fillvalue -!! INTEGER , INTENT(OUT) :: hdferr -!***** - - SUBROUTINE h5pset_fill_value_ptr(prp_id, type_id, fillvalue, hdferr) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier of - ! of fillvalue datatype - ! (in memory) - TYPE(C_PTR), INTENT(IN) :: fillvalue ! Fillvalue - INTEGER, INTENT(OUT) :: hdferr ! Error code - - hdferr = h5pset_fill_value_c(prp_id, type_id, fillvalue) - - END SUBROUTINE h5pset_fill_value_ptr - -! -!****s* H5P (F03)/h5pget_fill_value_f_F03 -! -! NAME -! h5pget_fill_value_f -! -! PURPOSE -! Gets fill value for a dataset creation property list -! -! Inputs: -! prp_id - Property list identifier -! type_id - Datatype identifier of fill value datatype (in memory) -! -! Outputs: -! fillvalue - Fillvalue -! hdferr - Returns 0 if successful and -1 if fails -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 14, 2001 -! -! Added the recommended way of passing fillvalue -! and that is by passing the C address, all other -! ways are obsolete and should be avoided. June, 2008 MSB -! -! NOTES -! h5pget(get)fill_value_f function is overloaded to support -! INTEGER, REAL, DOUBLE PRECISION and CHARACTER dtatypes. -! -! Fortran2003 Interface: -!! SUBROUTINE h5pget_fill_value_f(prp_id, type_id, fillvalue, hdferr) -!! INTEGER(HID_T), INTENT(IN) :: prp_id -!! INTEGER(HID_T), INTENT(IN) :: type_id -!! TYPE(C_PTR) , INTENT(OUT) :: fillvalue -!! INTEGER , INTENT(OUT) :: hdferr -!***** - - SUBROUTINE h5pget_fill_value_ptr(prp_id, type_id, fillvalue, hdferr) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier of - ! of fillvalue datatype - ! (in memory) - TYPE(C_PTR), INTENT(OUT) :: fillvalue ! Fillvalue - INTEGER, INTENT(OUT) :: hdferr ! Error code - - hdferr = h5pget_fill_value_c(prp_id, type_id, fillvalue) - - END SUBROUTINE h5pget_fill_value_ptr - -! -!****s* H5P (F03)/h5pset_f_F90 -! -! NAME -! h5pset_f -! -! PURPOSE -! Sets a property list value -! -! Inputs: -! prp_id - Property list identifier to modify -! name - Name of property to modify -! value - Property value, supported types are: -! INTEGER -! REAL -! DOUBLE PRECISION -! CHARACTER(LEN=*) -! Outputs: -! hdferr - Returns 0 if successful and -1 if fails -! -! AUTHOR -! Elena Pourmal -! October 9, 2002 -! -! Fortran90 Interface: -!! SUBROUTINE h5pset_f(plid, name, value, hdferr) -!! INTEGER(HID_T) , INTENT(IN) :: plid -!! CHARACTER(LEN=*), INTENT(IN) :: name -!! TYPE , INTENT(IN) :: value -!! INTEGER , INTENT(OUT) :: hdferr -!***** - SUBROUTINE h5pset_integer(prp_id, name, value, hdferr) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to modify - INTEGER, INTENT(IN), TARGET :: value ! Property value - INTEGER, INTENT(OUT) :: hdferr ! Error code - - INTEGER :: name_len - TYPE(C_PTR) :: f_ptr - - f_ptr = C_LOC(value) - - name_len = LEN(name) - hdferr = h5pget_c(prp_id, name, name_len, f_ptr) - - END SUBROUTINE h5pset_integer - - SUBROUTINE h5pset_real(prp_id, name, value, hdferr) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to modify - REAL, INTENT(IN), TARGET :: value ! Property value - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER :: name_len - TYPE(C_PTR) :: f_ptr - - f_ptr = C_LOC(value) - - name_len = LEN(name) - hdferr = h5pget_c(prp_id, name, name_len, f_ptr) - - END SUBROUTINE h5pset_real - - SUBROUTINE h5pset_char(prp_id, name, value, hdferr) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to modify - CHARACTER(LEN=*), INTENT(IN) :: value ! Property value - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER :: name_len - - INTEGER :: i - CHARACTER(LEN=1), ALLOCATABLE, DIMENSION(:), TARGET :: chr - INTEGER :: chr_len - - TYPE(C_PTR) :: f_ptr - ! To resolve Issue #1 outlined in the preamble of this file we - ! need to pack the character string into an array. - - chr_len = LEN(value) - ALLOCATE(chr(1:chr_len), STAT=hdferr) - IF (hdferr .NE. 0) THEN - hdferr = -1 - RETURN - ENDIF - - DO i = 1, chr_len - chr(i) = value(i:i) - ENDDO - - f_ptr = C_LOC(chr(1)(1:1)) - - name_len = LEN(name) - hdferr = h5pget_c(prp_id, name, name_len, f_ptr) - - DEALLOCATE(chr) - - END SUBROUTINE h5pset_char -! -!****s* H5P (F03)/h5pget_f_F90 -! -! NAME -! h5pget_f -! -! PURPOSE -! Queries the value of a property. -! -! Inputs: -! prp_id - Property list identifier to modify -! name - Name of property to get -! value - Property value, supported types are: -! INTEGER -! REAL -! DOUBLE PRECISION -! CHARACTER(LEN=*) -! Outputs: -! hdferr - Returns 0 if successful and -1 if fails -! -! AUTHOR -! Elena Pourmal -! October 9, 2002 -! -! Fortran90 Interface: -!! SUBROUTINE h5pget_f(plid, name, value, hdferr) -!! INTEGER(HID_T) , INTENT(IN) :: plid -!! CHARACTER(LEN=*), INTENT(IN) :: name -!! TYPE , INTENT(OUT) :: value -!! INTEGER , INTENT(OUT) :: hdferr -!***** - - SUBROUTINE h5pget_integer(prp_id, name, value, hdferr) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to modify - INTEGER, INTENT(OUT), TARGET :: value ! Property value - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER :: name_len - TYPE(C_PTR) :: f_ptr - - f_ptr = C_LOC(value) - - name_len = LEN(name) - hdferr = h5pget_c(prp_id, name, name_len, f_ptr) - - END SUBROUTINE h5pget_integer - - SUBROUTINE h5pget_real(prp_id, name, value, hdferr) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to modify - REAL, INTENT(OUT), TARGET :: value ! Property value - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER :: name_len - TYPE(C_PTR) :: f_ptr - - f_ptr = C_LOC(value) - - name_len = LEN(name) - hdferr = h5pget_c(prp_id, name, name_len, f_ptr) - END SUBROUTINE h5pget_real - - SUBROUTINE h5pget_char(prp_id, name, value, hdferr) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to modify - CHARACTER(LEN=*), INTENT(OUT) :: value ! Property value - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER :: name_len - - INTEGER :: i - CHARACTER(LEN=1), ALLOCATABLE, DIMENSION(:), TARGET :: chr - INTEGER :: chr_len - TYPE(C_PTR) :: f_ptr - - chr_len = LEN(value) - ALLOCATE(chr(1:chr_len), STAT=hdferr) - IF (hdferr .NE. 0) THEN - hdferr = -1 - RETURN - ENDIF - f_ptr = C_LOC(chr(1)(1:1)) - - name_len = LEN(name) - hdferr = h5pget_c(prp_id, name, name_len, f_ptr) - - DO i = 1, chr_len - value(i:i) = chr(i) - ENDDO - - DEALLOCATE(chr) - - END SUBROUTINE h5pget_char - - -! -!****s* H5P (F03)/h5pset_f_F03 -! -! NAME -! h5pset_f -! -! PURPOSE -! Sets a property list value -! -! Inputs: -! prp_id - Property list identifier to modify -! name - Name of property to modify -! value - Pointer to value to set the property to -! Outputs: -! hdferr - Returns 0 if successful and -1 if fails -! -! AUTHOR -! Elena Pourmal -! October 9, 2002 -! -! Fortran2003 Interface: -!! SUBROUTINE h5pset_f(plid, name, value, hdferr) -!! INTEGER(HID_T) , INTENT(IN) :: plid -!! CHARACTER(LEN=*), INTENT(IN) :: name -!! TYPE(C_PTR) , INTENT(IN) :: value -!! INTEGER , INTENT(OUT) :: hdferr -!***** - SUBROUTINE h5pset_ptr(prp_id, name, value, hdferr) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to modify - TYPE(C_PTR), INTENT(IN) :: value ! Property value - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER :: name_len - - name_len = LEN(name) - hdferr = h5pset_c(prp_id, name, name_len, value) - - END SUBROUTINE h5pset_ptr -! -!****s* H5P (F03)/h5pget_f_F03 -! -! NAME -! h5pget_f (F03) -! -! PURPOSE -! Queries the value of a property. -! -! Inputs: -! prp_id - Property list identifier to modify -! name - Name of property to get -! value - Pointer to a location to which to copy the value of of the property -! Outputs: -! hdferr - Returns 0 if successful and -1 if fails -! -! AUTHOR -! Elena Pourmal -! October 9, 2002 -! -! Fortran2003 Interface: -!! SUBROUTINE h5pget_f(plid, name, value, hdferr) -!! INTEGER(HID_T) , INTENT(IN) :: plid -!! CHARACTER(LEN=*), INTENT(IN) :: name -!! TYPE(C_PTR) , INTENT(OUT) :: value -!! INTEGER , INTENT(OUT) :: hdferr -!***** - SUBROUTINE h5pget_ptr(prp_id, name, value, hdferr) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to modify - TYPE(C_PTR), INTENT(OUT) :: value ! Property value - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER :: name_len - - name_len = LEN(name) - hdferr = h5pget_c(prp_id, name, name_len, value) - - END SUBROUTINE h5pget_ptr - - -! -!****s* H5P (F03)/h5pregister_f_F90 -! -! NAME -! h5pregister -! -! PURPOSE -! Registers a permanent property with a property list class. -! -! Inputs: -! class - Property list class identifier -! name - Name of property to register -! size - Size of the property value -! value - Property value, supported types are: -! INTEGER -! REAL -! DOUBLE PRECISION -! CHARACTER(LEN=*) -! -! Outputs: -! hdferr - Returns 0 if successful and -1 if fails -! -! AUTHOR -! Elena Pourmal -! October 10, 2002 -! -! Fortran90 Interface: -!! SUBROUTINE h5pregister_f(class, name, size, value, hdferr) -!! INTEGER(HID_T) , INTENT(IN) :: class -!! CHARACTER(LEN=*), INTENT(IN) :: name -!! INTEGER(SIZE_T) , INTENT(IN) :: size -!! TYPE , INTENT(IN) :: value -!! INTEGER , INTENT(OUT) :: hdferr -!***** - SUBROUTINE h5pregister_integer(class, name, size, value, hdferr) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: class ! Property list class identifier - CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to register - INTEGER(SIZE_T), INTENT(IN) :: size ! Size of the property value - INTEGER, INTENT(IN), TARGET :: value ! Property value - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER :: name_len - TYPE(C_PTR) :: f_ptr - - f_ptr = C_LOC(value) - - name_len = LEN(name) - hdferr = h5pregister_c(class, name, name_len, size, f_ptr) - - END SUBROUTINE h5pregister_integer - - SUBROUTINE h5pregister_real(class, name, size, value, hdferr) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: class ! Property list class identifier - CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to register - INTEGER(SIZE_T), INTENT(IN) :: size ! size of the property value - REAL, INTENT(IN), TARGET :: value ! Property value - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER :: name_len - TYPE(C_PTR) :: f_ptr - - f_ptr = C_LOC(value) - - name_len = LEN(name) - hdferr = h5pregister_c(class, name, name_len, size, f_ptr) - - END SUBROUTINE h5pregister_real - - SUBROUTINE h5pregister_char(class, name, size, value, hdferr) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: class ! Property list class identifier - CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to register - INTEGER(SIZE_T), INTENT(IN) :: size ! size of the property value - CHARACTER(LEN=*), INTENT(IN) :: value ! Property value - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER :: name_len - - INTEGER :: i - CHARACTER(LEN=1), ALLOCATABLE, DIMENSION(:), TARGET :: chr - INTEGER :: chr_len - - TYPE(C_PTR) :: f_ptr - ! To resolve Issue #1 outlined in the preamble of this file we - ! need to pack the character string into an array. - - chr_len = LEN(value) - ALLOCATE(chr(1:chr_len), STAT=hdferr) - IF (hdferr .NE. 0) THEN - hdferr = -1 - RETURN - ENDIF - - DO i = 1, chr_len - chr(i) = value(i:i) - ENDDO - - f_ptr = C_LOC(chr(1)(1:1)) - - name_len = LEN(name) - hdferr = h5pregister_c(class, name, name_len, size, f_ptr) - DEALLOCATE(chr) - END SUBROUTINE h5pregister_char -! -!****s* H5P (F03)/h5pregister_f_F03 -! -! NAME -! h5pregister (F03) -! -! PURPOSE -! Registers a permanent property with a property list class. -! -! Inputs: -! class - Property list class identifier -! name - Name of property to register -! size - Size of the property value -! value - Pointer to value to set the property to -! -! Outputs: -! hdferr - Returns 0 if successful and -1 if fails -! -! AUTHOR -! M. Scot Breitenfeld -! June 24, 2008 -! -! Fortran2003 Interface: -!! SUBROUTINE h5pregister_f(class, name, size, value, hdferr) -!! INTEGER(HID_T) , INTENT(IN) :: class -!! CHARACTER(LEN=*), INTENT(IN) :: name -!! INTEGER(SIZE_T) , INTENT(IN) :: size -!! TYPE(C_PTR) , INTENT(IN) :: value -!! INTEGER , INTENT(OUT) :: hdferr -!***** - - SUBROUTINE h5pregister_ptr(class, name, size, value, hdferr) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: class ! Property list class identifier - CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to register - INTEGER(SIZE_T), INTENT(IN) :: size ! Size of the property value - TYPE(C_PTR), INTENT(IN) :: value ! Property value - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER :: name_len - - name_len = LEN(name) - hdferr = h5pregister_c(class, name, name_len, size, value) - END SUBROUTINE h5pregister_ptr - -! -!****s* H5P (F03)/h5pinsert_f_F90 -! -! NAME -! h5pinsert (f90) -! -! PURPOSE -! Registers a temporary property with a property list class. -! -! Inputs: -! plist - Property list class identifier -! name - Name of property to insert -! size - Size of the property value -! value - Property value, supported types are: -! INTEGER -! REAL -! DOUBLE PRECISION -! CHARACTER(LEN=*) -! Outputs: -! hdferr - Returns 0 if successful and -1 if fails -! AUTHOR -! Elena Pourmal -! October 10, 2002 -! -! Fortran90 Interface: -!! SUBROUTINE h5pinsert_f -!! INTEGER(HID_T) , INTENT(IN) :: plist -!! CHARACTER(LEN=*), INTENT(IN) :: name -!! INTEGER(SIZE_T) , INTENT(IN) :: size -!! TYPE , INTENT(IN) :: value -!! INTEGER , INTENT(OUT) :: hdferr -!***** - SUBROUTINE h5pinsert_integer(plist, name, size, value, hdferr) - USE iso_c_binding - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: plist ! Property list identifier - CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to insert - INTEGER(SIZE_T), INTENT(IN) :: size ! Size of the property value - INTEGER, INTENT(IN), TARGET :: value ! Property value - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER :: name_len - TYPE(c_ptr) :: f_ptr - - f_ptr = c_loc(value) - - name_len = LEN(name) - hdferr = h5pinsert_c(plist, name , name_len, size, f_ptr) - END SUBROUTINE h5pinsert_integer - - SUBROUTINE h5pinsert_real(plist, name, size, value, hdferr) - USE iso_c_binding - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: plist ! Property list identifier - CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to insert - INTEGER(SIZE_T), INTENT(IN) :: size ! Size of the property value - REAL, INTENT(IN), TARGET :: value ! Property value - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER :: name_len - TYPE(c_ptr) :: f_ptr - - f_ptr = c_loc(value) - - name_len = LEN(name) - hdferr = h5pinsert_c(plist, name , name_len, size, f_ptr) - - END SUBROUTINE h5pinsert_real - - SUBROUTINE h5pinsert_char(plist, name, size, value, hdferr) - USE iso_c_binding - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: plist ! Property list identifier - CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to insert - INTEGER(SIZE_T), INTENT(IN) :: size ! Size of property value - CHARACTER(LEN=*), INTENT(IN) :: value ! Property value - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER :: name_len - - INTEGER :: i - CHARACTER(LEN=1), ALLOCATABLE, DIMENSION(:), TARGET :: chr - INTEGER :: chr_len - - TYPE(c_ptr) :: f_ptr - ! To resolve Issue #1 outlined in the preamble of this file we - ! need to pack the character string into an array. - - chr_len = LEN(value) - ALLOCATE(chr(1:chr_len), STAT=hdferr) - IF (hdferr .NE. 0) THEN - hdferr = -1 - RETURN - ENDIF - - DO i = 1, chr_len - chr(i) = value(i:i) - ENDDO - - f_ptr = C_LOC(chr(1)(1:1)) - - name_len = LEN(name) - hdferr = h5pinsert_c(plist, name , name_len, size, f_ptr) - - DEALLOCATE(chr) - - END SUBROUTINE h5pinsert_char - -! -!****s* H5P (F03)/h5pinsert_f_F03 -! -! NAME -! h5pinsert (f03) -! -! PURPOSE -! Registers a temporary property with a property list class. -! -! Inputs: -! plist - Property list class identifier -! name - Name of property to insert -! size - Size of the property value -! value - Pointer to new value pointer for the property being modified -! -! Outputs: -! hdferr - Returns 0 if successful and -1 if fails -! -! AUTHOR -! M. Scot Breitenfeld -! June 24, 2008 -! -! Fortran90 Interface: -!! SUBROUTINE h5pinsert_f -!! INTEGER(HID_T) , INTENT(IN) :: plist -!! CHARACTER(LEN=*), INTENT(IN) :: name -!! INTEGER(SIZE_T) , INTENT(IN) :: size -!! TYPE(C_PTR) , INTENT(IN) :: value -!! INTEGER , INTENT(OUT) :: hdferr -!***** - SUBROUTINE h5pinsert_ptr(plist, name, size, value, hdferr) - USE iso_c_binding - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: plist ! Property list identifier - CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to insert - INTEGER(SIZE_T), INTENT(IN) :: size ! Size of property value - TYPE(c_ptr), INTENT(IN) :: value ! Property value - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER :: name_len - - name_len = LEN(name) - hdferr = h5pinsert_c(plist, name , name_len, size, value) - END SUBROUTINE h5pinsert_ptr -! -!****s* H5P (F03)/h5pcreate_class_f_F03 -! -! NAME -! h5pcreate_class_f -! -! PURPOSE -! Create a new property list class -! -! Inputs: -! parent - Parent property list class identifier -! Possible values include: -! H5P_ROOT_F -! H5P_FILE_CREATE_F -! H5P_FILE_ACCESS_F -! H5P_DATASET_CREATE_F -! H5P_DATASET_XFER_F -! H5P_FILE_MOUNT_F -! name - Name of property to create -! -! Outputs: -! class - Property list class identifier -! hdferr - Returns 0 if successful and -1 if fails -! -! Optional parameters: -! H5P_cls_create_func_t (create) - Callback routine called when a property list is created -! create_data - User pointer to any class creation information needed -! H5P_cls_copy_func_t (copy) - Callback routine called when a property list is copied -! copy_data - User pointer to any class copy information needed -! H5P_cls_close_func_t (close) - Callback routine called when a property list is being closed -! close_data - User pointer to any class close information needed -! -! AUTHOR -! Elena Pourmal -! October 9, 2002 -! -! HISTORY -! Added callback arguments -! M. Scot Breitenfeld, July 3, 2008 -! -! Fortran2003 Interface: - SUBROUTINE h5pcreate_class_f(parent, name, class, hdferr, create, create_data, copy, copy_data, close, close_data) - USE iso_c_binding - IMPLICIT NONE - INTEGER(HID_T) , INTENT(IN) :: parent - CHARACTER(LEN=*), INTENT(IN) :: name - INTEGER(HID_T) , INTENT(OUT) :: class - INTEGER , INTENT(OUT) :: hdferr - TYPE(C_PTR) , OPTIONAL :: create_data, copy_data, close_data - TYPE(C_FUNPTR) , OPTIONAL :: create, copy, close -!***** - INTEGER :: name_len - TYPE(C_PTR) :: create_data_default, copy_data_default, close_data_default - TYPE(C_FUNPTR) :: create_default, copy_default, close_default - INTERFACE - INTEGER FUNCTION h5pcreate_class_c(parent, name, name_len, class, & - create, create_data, copy, copy_data, close, close_data) & - BIND(C, NAME='h5pcreate_class_c') - USE, INTRINSIC :: ISO_C_BINDING, ONLY : c_char, c_ptr, c_funptr - USE H5GLOBAL - INTEGER(HID_T), INTENT(IN) :: parent - CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: name - INTEGER, INTENT(IN) :: name_len - INTEGER(HID_T), INTENT(OUT) :: class - TYPE(C_PTR), VALUE :: create_data, copy_data, close_data - TYPE(C_FUNPTR), VALUE :: create, copy, close - END FUNCTION h5pcreate_class_c - END INTERFACE - name_len = LEN(name) - - create_default = c_null_funptr !fix:scot - create_data_default = c_null_ptr - copy_default = c_null_funptr !fix:scot - copy_data_default = c_null_ptr - close_default = c_null_funptr !fix:scot - close_data_default = c_null_ptr - - IF(PRESENT(create)) create_default = create - IF(PRESENT(create_data)) create_data_default = create_data - IF(PRESENT(copy)) copy_default = copy - IF(PRESENT(copy_data)) copy_data_default = copy_data - IF(PRESENT(close)) close_default = close - IF(PRESENT(close_data)) close_data_default = close_data - - hdferr = h5pcreate_class_c(parent, name , name_len, class, & - create_default, create_data_default, & - copy_default, copy_data_default, & - close_default, close_data_default) - - END SUBROUTINE h5pcreate_class_f - -! -!****s* H5P (F03)/h5pset_file_image_f_F03 -! -! NAME -! h5pset_file_image_f -! -! PURPOSE -! Sets an initial file image in a memory buffer. -! -! Inputs: -! fapl_id - File access property list identifier -! buf_ptr - Pointer to the initial file image, -! or C_NULL_PTR if no initial file image is desired -! buf_len - Size of the supplied buffer, or 0 (zero) if no initial image is desired -! -! Outputs: -! hdferr - Returns 0 if successful and -1 if fails -! -! AUTHOR -! M. Scot Breitenfeld -! February 19, 2012 -! -! Fortran2003 Interface: - SUBROUTINE h5pset_file_image_f(fapl_id, buf_ptr, buf_len, hdferr) - USE iso_c_binding - IMPLICIT NONE - INTEGER(HID_T) , INTENT(IN) :: fapl_id - TYPE(C_PTR) , INTENT(IN) :: buf_ptr - INTEGER(SIZE_T), INTENT(IN) :: buf_len - INTEGER , INTENT(OUT) :: hdferr -!***** - INTERFACE - INTEGER FUNCTION h5pset_file_image_c(fapl_id, buf_ptr, buf_len) & - BIND(C, NAME='h5pset_file_image_c') - USE, INTRINSIC :: ISO_C_BINDING, ONLY : c_ptr - USE H5GLOBAL - INTEGER(HID_T), INTENT(IN) :: fapl_id - TYPE(C_PTR), VALUE :: buf_ptr - INTEGER(SIZE_T), INTENT(IN) :: buf_len - END FUNCTION h5pset_file_image_c - END INTERFACE - - hdferr = h5pset_file_image_c(fapl_id, buf_ptr, buf_len) - - END SUBROUTINE h5pset_file_image_f -! -!****s* H5P (F03)/h5pget_file_image_f_F03 -! -! NAME -! h5pget_file_image_f -! -! PURPOSE -! Retrieves a copy of the file image designated as the initial content and structure of a file. -! -! Inputs: -! fapl_id - File access property list identifier. -! -! Outputs: -! buf_ptr - Will hold either a C_NULL_PTR or a scalar of type -! c_loc. If buf_ptr is not C_NULL_PTR, on successful -! return, buf_ptr shall contain a C pointer to a copy -! of the initial image provided in the last call to -! H5Pset_file_image_f for the supplied fapl_id, or -! buf_ptr shall contain a C_NULL_PTR if there is no -! initial image set. -! -! buf_len_ptr - Contains the value of the buffer parameter for -! the initial image in the supplied fapl_id. The value -! will be 0 if no initial image is set. -! -! -! hdferr - Returns 0 if successful and -1 if fails -! -! AUTHOR -! M. Scot Breitenfeld -! February 19, 2012 -! -! Fortran2003 Interface: - SUBROUTINE h5pget_file_image_f(fapl_id, buf_ptr, buf_len_ptr, hdferr) - USE iso_c_binding - IMPLICIT NONE - INTEGER(HID_T) , INTENT(IN) :: fapl_id - TYPE(C_PTR) , INTENT(OUT), DIMENSION(*) :: buf_ptr - INTEGER(SIZE_T), INTENT(OUT) :: buf_len_ptr - INTEGER , INTENT(OUT) :: hdferr - -!***** - INTERFACE - INTEGER FUNCTION h5pget_file_image_c(fapl_id, buf_ptr, buf_len_ptr) & - BIND(C, NAME='h5pget_file_image_c') - USE, INTRINSIC :: ISO_C_BINDING, ONLY : c_ptr - USE H5GLOBAL - INTEGER(HID_T), INTENT(IN) :: fapl_id - TYPE(C_PTR), DIMENSION(*), INTENT(OUT) :: buf_ptr - INTEGER(SIZE_T), INTENT(OUT) :: buf_len_ptr - END FUNCTION h5pget_file_image_c - END INTERFACE - - hdferr = h5pget_file_image_c(fapl_id, buf_ptr, buf_len_ptr) - - END SUBROUTINE h5pget_file_image_f - -END MODULE H5P_PROVISIONAL - diff --git a/fortran/src/H5Pff_F90.f90 b/fortran/src/H5Pff_F90.f90 deleted file mode 100644 index b5ea13d..0000000 --- a/fortran/src/H5Pff_F90.f90 +++ /dev/null @@ -1,949 +0,0 @@ -!****h* ROBODoc/H5P (_F90) -! -! NAME -! H5P_PROVISIONAL -! -! PURPOSE -! -! This file contains Fortran 90 interfaces for H5P functions. It contains -! the same functions as H5Pff_F03.f90 but excludes the Fortran 2003 functions -! and the interface listings. This file will be compiled instead of H5Pff_F03.f90 -! if Fortran 2003 functions are not enabled. -! -! 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. * -! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -! -! NOTES -! *** IMPORTANT *** -! If you add a new H5P function you must add the function name to the -! Windows dll file 'hdf5_fortrandll.def.in' in the fortran/src directory. -! This is needed for Windows based operating systems. -!***** - -MODULE H5P_PROVISIONAL - - USE H5GLOBAL - - INTERFACE h5pset_fill_value_f - MODULE PROCEDURE h5pset_fill_value_integer - MODULE PROCEDURE h5pset_fill_value_real - MODULE PROCEDURE h5pset_fill_value_char - END INTERFACE - - INTERFACE h5pget_fill_value_f - MODULE PROCEDURE h5pget_fill_value_integer - MODULE PROCEDURE h5pget_fill_value_real - MODULE PROCEDURE h5pget_fill_value_char - END INTERFACE - - INTERFACE h5pset_f - MODULE PROCEDURE h5pset_integer - MODULE PROCEDURE h5pset_real - MODULE PROCEDURE h5pset_char - END INTERFACE - - INTERFACE h5pget_f - MODULE PROCEDURE h5pget_integer - MODULE PROCEDURE h5pget_real - MODULE PROCEDURE h5pget_char - END INTERFACE - - INTERFACE h5pregister_f - MODULE PROCEDURE h5pregister_integer - MODULE PROCEDURE h5pregister_real - MODULE PROCEDURE h5pregister_char - END INTERFACE - - INTERFACE h5pinsert_f - MODULE PROCEDURE h5pinsert_integer - MODULE PROCEDURE h5pinsert_real - MODULE PROCEDURE h5pinsert_char - END INTERFACE - -CONTAINS -! -!****s* H5P (F90)/h5pset(get)fill_value_f -! -! NAME -! h5pset(get)fill_value_f -! -! PURPOSE -! Sets(gets) fill value for a dataset creation property list -! -! INPUTS -! prp_id - dataset creation property list identifier -! type_id - datatype identifier for fill value -! fillvalue - fill value -! OUTPUTS -! type_id - datatype identifier for fill value -! fillvalue - fill value -! hdferr - error code -! Success: 0 -! Failure: -1 -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 14, 2001 -! -! NOTES -! h5pset(get)fill_value_f function is overloaded to support -! INTEGER, REAL, DOUBLE PRECISION and CHARACTER dtatypes. -! -! SOURCE - SUBROUTINE h5pset_fill_value_integer(prp_id, type_id, fillvalue, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier of - ! of fillvalue datatype - ! (in memory) - INTEGER, INTENT(IN) :: fillvalue ! Fillvalue - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTERFACE - INTEGER FUNCTION h5pset_fill_value_integer_c(prp_id, type_id, fillvalue) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_FILL_VALUE_INTEGER_C'::h5pset_fill_value_integer_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: prp_id - INTEGER(HID_T), INTENT(IN) :: type_id - INTEGER, INTENT(IN) :: fillvalue - END FUNCTION h5pset_fill_value_integer_c - END INTERFACE - - hdferr = h5pset_fill_value_integer_c(prp_id, type_id, fillvalue) - END SUBROUTINE h5pset_fill_value_integer - - - SUBROUTINE h5pget_fill_value_integer(prp_id, type_id, fillvalue, & - hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier of - ! of fillvalue datatype - ! (in memory) - INTEGER, INTENT(IN) :: fillvalue ! Fillvalue - INTEGER, INTENT(OUT) :: hdferr ! Error code - - INTERFACE - INTEGER FUNCTION h5pget_fill_value_integer_c(prp_id, type_id, fillvalue) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGET_FILL_VALUE_INTEGER_C'::h5pget_fill_value_integer_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: prp_id - INTEGER(HID_T), INTENT(IN) :: type_id - INTEGER :: fillvalue - END FUNCTION h5pget_fill_value_integer_c - END INTERFACE - - hdferr = h5pget_fill_value_integer_c(prp_id, type_id, fillvalue) - END SUBROUTINE h5pget_fill_value_integer - - - SUBROUTINE h5pset_fill_value_real(prp_id, type_id, fillvalue, & - hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier of - ! of fillvalue datatype - ! (in memory) - REAL, INTENT(IN) :: fillvalue ! Fillvalue - INTEGER, INTENT(OUT) :: hdferr ! Error code - - INTERFACE - INTEGER FUNCTION h5pset_fill_value_real_c(prp_id, type_id, fillvalue) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_FILL_VALUE_REAL_C'::h5pset_fill_value_real_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: prp_id - INTEGER(HID_T), INTENT(IN) :: type_id - REAL, INTENT(IN) :: fillvalue - END FUNCTION h5pset_fill_value_real_c - END INTERFACE - - hdferr = h5pset_fill_value_real_c(prp_id, type_id, fillvalue) - END SUBROUTINE h5pset_fill_value_real - - - SUBROUTINE h5pget_fill_value_real(prp_id, type_id, fillvalue, & - hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier of - ! of fillvalue datatype - ! (in memory) - REAL, INTENT(IN) :: fillvalue ! Fillvalue - INTEGER, INTENT(OUT) :: hdferr ! Error code - - INTERFACE - INTEGER FUNCTION h5pget_fill_value_real_c(prp_id, type_id, fillvalue) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGET_FILL_VALUE_REAL_C'::h5pget_fill_value_real_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: prp_id - INTEGER(HID_T), INTENT(IN) :: type_id - REAL :: fillvalue - END FUNCTION h5pget_fill_value_real_c - END INTERFACE - - hdferr = h5pget_fill_value_real_c(prp_id, type_id, fillvalue) - END SUBROUTINE h5pget_fill_value_real - - SUBROUTINE h5pset_fill_value_char(prp_id, type_id, fillvalue, & - hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier of - ! of fillvalue datatype - ! (in memory) - CHARACTER, INTENT(IN) :: fillvalue ! Fillvalue - INTEGER, INTENT(OUT) :: hdferr ! Error code - - INTERFACE - INTEGER FUNCTION h5pset_fill_valuec_c(prp_id, type_id, fillvalue) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_FILL_VALUEC_C'::h5pset_fill_valuec_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: fillvalue - INTEGER(HID_T), INTENT(IN) :: prp_id - INTEGER(HID_T), INTENT(IN) :: type_id - CHARACTER, INTENT(IN) :: fillvalue - END FUNCTION h5pset_fill_valuec_c - END INTERFACE - - hdferr = h5pset_fill_valuec_c(prp_id, type_id, fillvalue) - END SUBROUTINE h5pset_fill_value_char - - SUBROUTINE h5pget_fill_value_char(prp_id, type_id, fillvalue, & - hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier of - ! of fillvalue datatype - ! (in memory) - CHARACTER, INTENT(IN) :: fillvalue ! Fillvalue - INTEGER, INTENT(OUT) :: hdferr ! Error code - - INTERFACE - INTEGER FUNCTION h5pget_fill_valuec_c(prp_id, type_id, fillvalue) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGET_FILL_VALUEC_C'::h5pget_fill_valuec_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: fillvalue - INTEGER(HID_T), INTENT(IN) :: prp_id - INTEGER(HID_T), INTENT(IN) :: type_id - CHARACTER :: fillvalue - END FUNCTION h5pget_fill_valuec_c - END INTERFACE - - hdferr = h5pget_fill_valuec_c(prp_id, type_id, fillvalue) - END SUBROUTINE h5pget_fill_value_char -! -!****s* H5P (F90)/h5pset_integer -! -! NAME -! h5pset_integer -! -! PURPOSE -! Sets a property list value -! -! INPUTS -! prp_id - iproperty list identifier to modify -! name - name of property to modify -! value - value to set property to -! OUTPUTS -! hdferr: - error code -! Success: 0 -! Failure: -1 -! AUTHOR -! Elena Pourmal -! October 9, 2002 -! -! SOURCE - SUBROUTINE h5pset_integer(prp_id, name, value, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to modify - INTEGER, INTENT(IN) :: value ! Property value - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTEGER :: name_len - - INTERFACE - INTEGER FUNCTION h5pset_integer_c(prp_id, name, name_len, value) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_INTEGER_C'::h5pset_integer_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: name - INTEGER(HID_T), INTENT(IN) :: prp_id - CHARACTER(LEN=*), INTENT(IN) :: name - INTEGER, INTENT(IN) :: name_len - INTEGER, INTENT(IN) :: value - END FUNCTION h5pset_integer_c - END INTERFACE - - name_len = LEN(name) - hdferr = h5pset_integer_c(prp_id, name , name_len, value) - END SUBROUTINE h5pset_integer - -! -!****s* H5P (F90)/h5pset_real -! -! NAME -! h5pset_real -! -! PURPOSE -! Sets a property list value -! -! INPUTS -! prp_id - iproperty list identifier to modify -! name - name of property to modify -! value - value to set property to -! OUTPUTS -! hdferr: - error code -! Success: 0 -! Failure: -1 -! AUTHOR -! Elena Pourmal -! October 9, 2002 -! -! SOURCE - SUBROUTINE h5pset_real(prp_id, name, value, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to modify - REAL, INTENT(IN) :: value ! Property value - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTEGER :: name_len - - INTERFACE - INTEGER FUNCTION h5pset_real_c(prp_id, name, name_len, value) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_REAL_C'::h5pset_real_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: name - INTEGER(HID_T), INTENT(IN) :: prp_id - CHARACTER(LEN=*), INTENT(IN) :: name - INTEGER, INTENT(IN) :: name_len - REAL, INTENT(IN) :: value - END FUNCTION h5pset_real_c - END INTERFACE - - name_len = LEN(name) - hdferr = h5pset_real_c(prp_id, name , name_len, value) - END SUBROUTINE h5pset_real - -!****s* H5P (F90)/h5pset_char -! -! NAME -! h5pset_char -! -! PURPOSE -! Sets a property list value -! -! INPUTS -! prp_id - iproperty list identifier to modify -! name - name of property to modify -! value - value to set property to -! OUTPUTS -! hdferr - error code -! Success: 0 -! Failure: -1 -! OPTIONAL PARAMETERS -! NONE -! -! AUTHOR -! Elena Pourmal -! October 9, 2002 -! SOURCE - SUBROUTINE h5pset_char(prp_id, name, value, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to modify - CHARACTER(LEN=*), INTENT(IN) :: value ! Property value - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTEGER :: name_len - INTEGER :: value_len - - INTERFACE - INTEGER FUNCTION h5psetc_c(prp_id, name, name_len, value, value_len) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSETC_C'::h5psetc_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: name - !DEC$ATTRIBUTES reference :: value - INTEGER(HID_T), INTENT(IN) :: prp_id - CHARACTER(LEN=*), INTENT(IN) :: name - INTEGER, INTENT(IN) :: name_len - CHARACTER(LEN=*), INTENT(IN) :: value - INTEGER, INTENT(IN) :: value_len - END FUNCTION h5psetc_c - END INTERFACE - - name_len = LEN(name) - value_len = LEN(value) - hdferr = h5psetc_c(prp_id, name , name_len, value, value_len) - END SUBROUTINE h5pset_char - -!****s* H5P (F90)/h5pget_integer -! -! NAME -! h5pget_integer -! -! PURPOSE -! Gets a property list value -! -! INPUTS -! prp_id - iproperty list identifier to modify -! name - name of property to modify -! OUTPUTS -! value - value of property -! hdferr - error code -! Success: 0 -! Failure: -1 -! AUTHOR -! Elena Pourmal -! October 9, 2002 -! -! SOURCE - SUBROUTINE h5pget_integer(prp_id, name, value, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to modify - INTEGER, INTENT(OUT) :: value ! Property value - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTEGER :: name_len - - INTERFACE - INTEGER FUNCTION h5pget_integer_c(prp_id, name, name_len, value) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGET_INTEGER_C'::h5pget_integer_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: name - INTEGER(HID_T), INTENT(IN) :: prp_id - CHARACTER(LEN=*), INTENT(IN) :: name - INTEGER, INTENT(IN) :: name_len - INTEGER, INTENT(OUT) :: value - END FUNCTION h5pget_integer_c - END INTERFACE - - name_len = LEN(name) - hdferr = h5pget_integer_c(prp_id, name , name_len, value) - END SUBROUTINE h5pget_integer - -! -!****s* H5P (F90)/h5pget_real -! -! NAME -! h5pget_real -! -! PURPOSE -! Gets a property list value -! -! INPUTS -! prp_id - iproperty list identifier to modify -! name - name of property to modify -! OUTPUTS -! value - value of property -! hdferr - error code -! Success: 0 -! Failure: -1 -! AUTHOR -! Elena Pourmal -! October 9, 2002 -! SOURCE - SUBROUTINE h5pget_real(prp_id, name, value, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to modify - REAL, INTENT(OUT) :: value ! Property value - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTEGER :: name_len - - INTERFACE - INTEGER FUNCTION h5pget_real_c(prp_id, name, name_len, value) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGET_REAL_C'::h5pget_real_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: name - INTEGER(HID_T), INTENT(IN) :: prp_id - CHARACTER(LEN=*), INTENT(IN) :: name - INTEGER, INTENT(IN) :: name_len - REAL, INTENT(OUT) :: value - END FUNCTION h5pget_real_c - END INTERFACE - - name_len = LEN(name) - hdferr = h5pget_real_c(prp_id, name , name_len, value) - END SUBROUTINE h5pget_real - -! -!****s* H5P (F90)/h5pget_char -! -! NAME -! h5pget_char -! -! PURPOSE -! Gets a property list value -! -! INPUTS -! prp_id - iproperty list identifier to modify -! name - name of property to modify -! OUTPUTS -! value - value of property -! hdferr - error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! Elena Pourmal -! October 9, 2002 -! -! SOURCE - SUBROUTINE h5pget_char(prp_id, name, value, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to modify - CHARACTER(LEN=*), INTENT(OUT) :: value ! Property value - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTEGER :: name_len - INTEGER :: value_len - - INTERFACE - INTEGER FUNCTION h5pgetc_c(prp_id, name, name_len, value, value_len) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGETC_C'::h5pgetc_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: name - !DEC$ATTRIBUTES reference :: value - INTEGER(HID_T), INTENT(IN) :: prp_id - CHARACTER(LEN=*), INTENT(IN) :: name - INTEGER, INTENT(IN) :: name_len - CHARACTER(LEN=*), INTENT(OUT) :: value - INTEGER, INTENT(IN) :: value_len - END FUNCTION h5pgetc_c - END INTERFACE - - name_len = LEN(name) - value_len = LEN(value) - hdferr = h5pgetc_c(prp_id, name , name_len, value, value_len) - END SUBROUTINE h5pget_char - -! -!****s* H5P (F90)/h5pregister_integer -! -! NAME -! h5pregister_integer -! -! PURPOSE -! Registers a permanent property with a property list class. -! -! INPUTS -! class - property list class to register -! permanent property within -! name - name of property to register -! size - size of property in bytes -! value - default value for property in newly -! created property lists -! OUTPUTS -! hdferr - error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! Elena Pourmal -! October 10, 2002 -! -! SOURCE - SUBROUTINE h5pregister_integer(class, name, size, value, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: class ! Property list class identifier - CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to register - INTEGER(SIZE_T), INTENT(IN) :: size ! Size of the property value - INTEGER, INTENT(IN) :: value ! Property value - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTEGER :: name_len - - INTERFACE - INTEGER FUNCTION h5pregister_integer_c(class, name, name_len, size, value) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PREGISTER_INTEGER_C'::h5pregister_integer_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: name - INTEGER(HID_T), INTENT(IN) :: class - CHARACTER(LEN=*), INTENT(IN) :: name - INTEGER, INTENT(IN) :: name_len - INTEGER(SIZE_T), INTENT(IN) :: size - INTEGER, INTENT(IN) :: value - END FUNCTION h5pregister_integer_c - END INTERFACE - - name_len = LEN(name) - hdferr = h5pregister_integer_c(class, name , name_len, size, value) - END SUBROUTINE h5pregister_integer - -!****s* H5P (F90)/h5pregister_real -! -! NAME -! -! h5pregister_real -! -! PURPOSE Registers a permanent property with a property list class. -! -! INPUTS -! class - property list class to register -! permanent property within -! name - name of property to register -! size - size of property in bytes -! value - default value for property in newly -! created property lists -! OUTPUTS -! hdferr - error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! Elena Pourmal -! October 10, 2002 -! SOURCE - SUBROUTINE h5pregister_real(class, name, size, value, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: class ! Property list class identifier - CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to register - INTEGER(SIZE_T), INTENT(IN) :: size ! size of the property value - REAL, INTENT(IN) :: value ! Property value - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTEGER :: name_len - - INTERFACE - INTEGER FUNCTION h5pregister_real_c(class, name, name_len, size, value) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PREGISTER_REAL_C'::h5pregister_real_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: name - INTEGER(HID_T), INTENT(IN) :: class - CHARACTER(LEN=*), INTENT(IN) :: name - INTEGER, INTENT(IN) :: name_len - INTEGER(SIZE_T), INTENT(IN) :: size - REAL, INTENT(IN) :: value - END FUNCTION h5pregister_real_c - END INTERFACE - - name_len = LEN(name) - hdferr = h5pregister_real_c(class, name , name_len, size, value) - END SUBROUTINE h5pregister_real - -! -!****s* H5P (F90)/h5pregister_char -! -! NAME -! h5pregister_char -! -! PURPOSE -! Registers a permanent property with a property list class. -! -! INPUTS -! class - property list class to register -! permanent property within -! name - name of property to register -! size - size of property in bytes -! value - default value for property in newly -! created property lists -! OUTPUTS -! hdferr - error code -! Success: 0 -! Failure: -1 -! AUTHOR -! Elena Pourmal -! October 10, 2002 -! SOURCE - SUBROUTINE h5pregister_char(class, name, size, value, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: class ! Property list class identifier - CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to register - INTEGER(SIZE_T), INTENT(IN) :: size ! size of the property value - CHARACTER(LEN=*), INTENT(IN) :: value ! Property value - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTEGER :: name_len - INTEGER :: value_len - - INTERFACE - INTEGER FUNCTION h5pregisterc_c(class, name, name_len, size, value, & - value_len) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PREGISTERC_C'::h5pregisterc_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: name - !DEC$ATTRIBUTES reference :: value - INTEGER(HID_T), INTENT(IN) :: class - CHARACTER(LEN=*), INTENT(IN) :: name - INTEGER, INTENT(IN) :: name_len - INTEGER(SIZE_T), INTENT(IN) :: size - CHARACTER(LEN=*), INTENT(IN) :: value - INTEGER, INTENT(IN) :: value_len - END FUNCTION h5pregisterc_c - END INTERFACE - - name_len = LEN(name) - value_len = LEN(value) - hdferr = h5pregisterc_c(class, name , name_len, size, value, value_len) - END SUBROUTINE h5pregister_char -! -!****s* H5P (F90)/h5pinsert_integer -! -! NAME -! h5pinsert_integer -! -! PURPOSE -! Registers a temporary property with a property list class. -! -! INPUTS -! plist - property list identifier -! name - name of property to insert -! size - size of property in bytes -! value - initial value for the property -! OUTPUTS -! hdferr - error code -! Success: 0 -! Failure: -1 -! AUTHOR -! Elena Pourmal -! October 10, 2002 -! SOURCE - SUBROUTINE h5pinsert_integer(plist, name, size, value, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: plist ! Property list identifier - CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to insert - INTEGER(SIZE_T), INTENT(IN) :: size ! Size of the property value - INTEGER, INTENT(IN) :: value ! Property value - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTEGER :: name_len - - INTERFACE - INTEGER FUNCTION h5pinsert_integer_c(plist, name, name_len, size, value) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PINSERT_INTEGER_C'::h5pinsert_integer_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: name - INTEGER(HID_T), INTENT(IN) :: plist - CHARACTER(LEN=*), INTENT(IN) :: name - INTEGER, INTENT(IN) :: name_len - INTEGER(SIZE_T), INTENT(IN) :: size - INTEGER, INTENT(IN) :: value - END FUNCTION h5pinsert_integer_c - END INTERFACE - - name_len = LEN(name) - hdferr = h5pinsert_integer_c(plist, name , name_len, size, value) - END SUBROUTINE h5pinsert_integer - -! -!****s* H5P (F90)/h5pinsert_real -! -! NAME -! h5pinsert_real -! -! PURPOSE -! Registers a temporary property with a property list class. -! -! INPUTS -! plist - property list identifier -! permanent property within -! name - name of property to insert -! size - size of property in bytes -! value - initial value for the property -! OUTPUTS -! hdferr - error code -! Success: 0 -! Failure: -1 -! AUTHOR -! Elena Pourmal -! October 10, 2002 -! SOURCE - SUBROUTINE h5pinsert_real(plist, name, size, value, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: plist ! Property list identifier - CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to insert - INTEGER(SIZE_T), INTENT(IN) :: size ! Size of the property value - REAL, INTENT(IN) :: value ! Property value - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTEGER :: name_len - - INTERFACE - INTEGER FUNCTION h5pinsert_real_c(plist, name, name_len, size, value) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PINSERT_REAL_C'::h5pinsert_real_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: name - INTEGER(HID_T), INTENT(IN) :: plist - CHARACTER(LEN=*), INTENT(IN) :: name - INTEGER, INTENT(IN) :: name_len - INTEGER(SIZE_T), INTENT(IN) :: size - REAL, INTENT(IN) :: value - END FUNCTION h5pinsert_real_c - END INTERFACE - - name_len = LEN(name) - hdferr = h5pinsert_real_c(plist, name , name_len, size, value) - END SUBROUTINE h5pinsert_real - - -! -!****s* H5P (F90)/h5pinsert_char -! -! NAME -! h5pinsert_char -! -! PURPOSE -! Registers a temporary property with a property list class. -! -! INPUTS -! plist - property list identifier -! permanent property within -! name - name of property to insert -! size - size of property in bytes -! value - initial value for the property -! OUTPUTS -! hdferr - error code -! Success: 0 -! Failure: -1 -! AUTHOR -! Elena Pourmal -! October 10, 2002 -! SOURCE -SUBROUTINE h5pinsert_char(plist, name, size, value, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: plist ! Property list identifier - CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to insert - INTEGER(SIZE_T), INTENT(IN) :: size ! Size of property value - CHARACTER(LEN=*), INTENT(IN) :: value ! Property value - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTEGER :: name_len - INTEGER :: value_len - - INTERFACE - INTEGER FUNCTION h5pinsertc_c(plist, name, name_len, size, value, value_len) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PINSERTC_C'::h5pinsertc_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: name - !DEC$ATTRIBUTES reference :: value - INTEGER(HID_T), INTENT(IN) :: plist - CHARACTER(LEN=*), INTENT(IN) :: name - INTEGER, INTENT(IN) :: name_len - INTEGER(SIZE_T), INTENT(IN) :: size - CHARACTER(LEN=*), INTENT(IN) :: value - INTEGER, INTENT(IN) :: value_len - END FUNCTION h5pinsertc_c - END INTERFACE - - name_len = LEN(name) - value_len = LEN(value) - hdferr = h5pinsertc_c(plist, name , name_len, size, value, value_len) - END SUBROUTINE h5pinsert_char - -! -!****s* H5P (F90)/h5pcreate_class_f -! -! NAME -! h5pcreate_class_f -! -! PURPOSE -! Create a new property list class -! -! INPUTS -! parent - Property list identifier of the parent class -! Possible values include: -! H5P_ROOT_F -! H5P_FILE_CREATE_F -! H5P_FILE_ACCESS_F -! H5P_DATASET_CREATE_F -! H5P_DATASET_XFER_F -! H5P_FILE_MOUNT_F -! name - name of the class we are creating -! OUTPUTS -! class - property list class identifier -! hdferr - error code -! Success: 0 -! Failure: -1 -! AUTHOR -! Elena Pourmal -! October 9, 2002 -! -! SOURCE - SUBROUTINE h5pcreate_class_f(parent, name, class, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: parent ! parent property list class - ! identifier - CHARACTER(LEN=*), INTENT(IN) :: name ! name of property tocreate - INTEGER(HID_T), INTENT(OUT) :: class ! property list class identifier - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTEGER :: name_len - - INTERFACE - INTEGER FUNCTION h5pcreate_class_f90_c(parent, name, name_len, class) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PCREATE_CLASS_F90_C'::h5pcreate_class_f90_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: name - INTEGER(HID_T), INTENT(IN) :: parent - CHARACTER(LEN=*), INTENT(IN) :: name - INTEGER, INTENT(IN) :: name_len - INTEGER(HID_T), INTENT(OUT) :: class - END FUNCTION h5pcreate_class_f90_c - END INTERFACE - - name_len = LEN(name) - hdferr = h5pcreate_class_f90_c(parent, name, name_len, class) - - END SUBROUTINE h5pcreate_class_f - -END MODULE H5P_PROVISIONAL - diff --git a/fortran/src/H5Rf.c b/fortran/src/H5Rf.c index 068f24e..9cd9950 100644 --- a/fortran/src/H5Rf.c +++ b/fortran/src/H5Rf.c @@ -1,6 +1,6 @@ /****h* H5Rf/H5Rf * PURPOSE - * This file contains C stubs for H5R Fortran APIs + * This file contains C stubs for H5R Fortran APIs * * COPYRIGHT * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * @@ -24,68 +24,21 @@ #include "H5f90.h" #include "H5Eprivate.h" -/****if* H5Rf/h5rcreate_object_c - * NAME - * h5rcreate_object_c - * PURPOSE - * Call H5Rcreate to create a reference to an object - * INPUTS - * loc_id - file or group identifier - * name - name of the dataset - * namelen - name length - * OUTPUTS - * ref - reference to the object - * RETURNS - * 0 on success, -1 on failure - * AUTHOR - * Elena Pourmal - * Wednesday, December 1, 1999 - * SOURCE -*/ -int_f -nh5rcreate_object_c(haddr_t_f *ref, hid_t_f *loc_id, _fcd name, int_f *namelen) -/******/ -{ - char *c_name = NULL; - hobj_ref_t ref_c; - int_f ret_value = 0; - - /* - * Convert FORTRAN name to C name - */ - if(NULL == (c_name = (char *)HD5f2cstring(name, (size_t)*namelen))) - HGOTO_DONE(FAIL) - - /* - * Call H5Rcreate function. - */ - if(H5Rcreate(&ref_c, *loc_id, c_name, H5R_OBJECT, (hid_t)-1) < 0) - HGOTO_DONE(FAIL) - - /* Copy the reference created */ - *ref = (haddr_t_f)ref_c; - -done: - if(c_name) - HDfree(c_name); - return ret_value; -} /* nh5rcreate_object_c() */ - /****if* H5Rf/h5rcreate_region_c * NAME - * h5rcreate_region_c + * h5rcreate_region_c * PURPOSE - * Call H5Rcreate to create a reference to dataset region - * region + * Call H5Rcreate to create a reference to dataset region + * region * INPUTS - * loc_id - file or group identifier - * name - name of the dataset - * namelen - name length - * space_id - dataset space identifier + * loc_id - file or group identifier + * name - name of the dataset + * namelen - name length + * space_id - dataset space identifier * OUTPUTS - * ref - reference to the dataset region + * ref - reference to the dataset region * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal * Wednesday, December 1, 1999 @@ -94,7 +47,7 @@ done: * SOURCE */ int_f -nh5rcreate_region_c(int_f *ref, hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *space_id) +h5rcreate_region_c(int_f *ref, hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *space_id) /******/ { char *c_name = NULL; @@ -120,7 +73,7 @@ done: if(c_name) HDfree(c_name); return ret_value; -} /* end nh5rcreate_region_c() */ +} /* end h5rcreate_region_c() */ /****if* H5Rf/h5rcreate_ptr_c * NAME @@ -165,89 +118,6 @@ h5rcreate_ptr_c (void *ref, hid_t_f *loc_id, _fcd name, int_f *namelen, int_f *r return ret_value; } -/****if* H5Rf/h5rdereference_region_c - * NAME - * h5rdereference_region_c - * PURPOSE - * Call H5Rdereference to dereference to dataset region - * INPUTS - * dset_id - dataset identifier - * ref - reference to the dataset region - * OUTPUTS - * obj_id - dereferenced dataset identifier - * RETURNS - * 0 on success, -1 on failure - * AUTHOR - * Elena Pourmal - * Wednesday, December 1, 1999 - * HISTORY - * - * SOURCE -*/ -int_f -nh5rdereference_region_c(hid_t_f *dset_id, int_f *ref, hid_t_f *obj_id) -/******/ -{ - hdset_reg_ref_t ref_c; - hid_t c_obj_id; - int_f ret_value = 0; - - /* Copy the reference to dereference */ - HDmemcpy(&ref_c, ref, H5R_DSET_REG_REF_BUF_SIZE); - - /* - * Call H5Rdereference function. - */ - if((c_obj_id = H5Rdereference2((hid_t)*dset_id, H5P_DEFAULT, H5R_DATASET_REGION, &ref_c)) < 0) - HGOTO_DONE(FAIL) - - /* Copy the object's ID */ - *obj_id = (hid_t_f)c_obj_id; - -done: - return ret_value; -} /* end nh5rdereference_region_c() */ - -/****if* H5Rf/h5rdereference_object_c - * NAME - * h5rdereference_object_c - * PURPOSE - * Call H5Rdereference to dereference an object - * INPUTS - * dset_id - dataset identifier - * ref - reference to an object - * OUTPUTS - * obj_id - dereferenced object identifier - * RETURNS - * 0 on success, -1 on failure - * AUTHOR - * Elena Pourmal - * Wednesday, December 1, 1999 - * HISTORY - * - * SOURCE -*/ -int_f -nh5rdereference_object_c(hid_t_f *dset_id, haddr_t_f *ref, hid_t_f *obj_id) -/******/ -{ - hid_t c_obj_id; - hobj_ref_t ref_c = (hobj_ref_t)*ref; - int_f ret_value = 0; - - /* - * Call H5Rdereference function. - */ - if((c_obj_id = H5Rdereference2((hid_t)*dset_id, H5P_DEFAULT, H5R_OBJECT, &ref_c)) < 0) - HGOTO_DONE(FAIL) - - /* Copy the object's ID */ - *obj_id = (hid_t_f)c_obj_id; - -done: - return ret_value; -} /* end nh5rdereference_object_c() */ - /****if* H5Rf/h5rdereference_ptr_c * NAME * h5rdereference_ptr_c @@ -255,7 +125,7 @@ done: * Call H5Rdereference * INPUTS * obj_id - Valid identifier for the file containing the - * referenced object or any object in that file. + * referenced object or any object in that file. * ref_typ - The reference type of ref. * ref - Object reference * OUTPUTS @@ -292,8 +162,8 @@ h5rdereference_ptr_c (hid_t_f *obj_id, int_f *ref_type, void *ref, hid_t_f *ref_ * PURPOSE * Call H5Rget_region to dereference dataspace region * INPUTS - * dset_id - dataset identifier - * ref - reference to the dataset region + * dset_id - dataset identifier + * ref - reference to the dataset region * OUTPUTS * space_id - dereferenced dataset dataspace identifier * RETURNS @@ -306,7 +176,7 @@ h5rdereference_ptr_c (hid_t_f *obj_id, int_f *ref_type, void *ref, hid_t_f *ref_ * SOURCE */ int_f -nh5rget_region_region_c(hid_t_f *dset_id, int_f *ref, hid_t_f *space_id) +h5rget_region_region_c(hid_t_f *dset_id, int_f *ref, hid_t_f *space_id) /******/ { hid_t c_space_id; @@ -327,7 +197,7 @@ nh5rget_region_region_c(hid_t_f *dset_id, int_f *ref, hid_t_f *space_id) done: return ret_value; -} /* end nh5rget_region_region_c() */ +} /* end h5rget_region_region_c() */ /****if* H5Rf/h5rget_region_ptr_c * NAME @@ -335,8 +205,8 @@ done: * PURPOSE * Call H5Rget_region to dereference dataspace region * INPUTS - * dset_id - dataset identifier - * ref - reference to the dataset region + * dset_id - dataset identifier + * ref - reference to the dataset region * OUTPUTS * space_id - dereferenced dataset dataspace identifier * RETURNS @@ -366,22 +236,22 @@ h5rget_region_ptr_c(hid_t_f *dset_id, void *ref, hid_t_f *space_id) done: return ret_value; -} /* end nh5rget_region_ptr_c() */ +} /* end h5rget_region_ptr_c() */ /****if* H5Rf/h5rget_object_type_obj_c * NAME - * h5rget_object_type_obj_c + * h5rget_object_type_obj_c * PURPOSE - * Call H5Rget_object_type to retrieve the type of the object reference points - * to + * Call H5Rget_object_type to retrieve the type of the object reference points + * to * INPUTS - * dset_id - dataset identifier - * ref - reference to the dataset region + * dset_id - dataset identifier + * ref - reference to the dataset region * OUTPUTS - * obj_type - type of dereferenced object + * obj_type - type of dereferenced object * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal * Wednesday, December 1, 1999 @@ -390,7 +260,7 @@ done: * SOURCE */ int_f -nh5rget_object_type_obj_c(hid_t_f *dset_id, haddr_t_f *ref, int_f *obj_type) +h5rget_object_type_obj_c(hid_t_f *dset_id, haddr_t_f *ref, int_f *obj_type) /******/ { H5O_type_t c_obj_type; @@ -408,125 +278,7 @@ nh5rget_object_type_obj_c(hid_t_f *dset_id, haddr_t_f *ref, int_f *obj_type) done: return ret_value; -} /* end nh5rget_object_type_obj_c() */ - -/****if* H5Rf/h5rget_name_object_c - * NAME - * h5rget_name_object_c - * PURPOSE - * Call H5Rget_name for an object - * INPUTS - * - * loc_id - Identifier for the dataset containing the reference or for the group that dataset is in. - * ref - An object or dataset region reference. - * - * OUTPUTS - * name - A name associated with the referenced object or dataset region. - * size - The size of the name buffer. - * - * RETURNS - * 0 on success, -1 on failure - * AUTHOR - * M. Scot Breitenfeld - * March 31, 2008 - * HISTORY - * - * SOURCE -*/ -int_f -nh5rget_name_object_c(hid_t_f *loc_id, haddr_t_f *ref, _fcd name, size_t_f *name_len, size_t_f *size_default) -/******/ -{ - hobj_ref_t ref_c = (hobj_ref_t)*ref; - ssize_t c_size; - size_t c_bufsize = (size_t)*name_len + 1; - char *c_buf = NULL; /* Buffer to hold C string */ - int_f ret_value = 0; - - - /* - * Allocate buffer to hold name of an attribute - */ - if(NULL == (c_buf = (char *)HDmalloc(c_bufsize))) - HGOTO_DONE(FAIL) - - /* - * Call H5Rget_name function. - */ - if((c_size = H5Rget_name((hid_t)*loc_id, H5R_OBJECT, &ref_c, c_buf, c_bufsize)) < 0) - HGOTO_DONE(FAIL) - - /* - * Convert C name to FORTRAN and place it in the given buffer - */ - HD5packFstring(c_buf, _fcdtocp(name), c_bufsize-1); - *size_default = (size_t_f)c_size; - -done: - if(c_buf) - HDfree(c_buf); - return ret_value; -} /* end nh5rget_name_object_c() */ - -/****if* H5Rf/h5rget_name_region_c - * NAME - * h5rget_name_region_c - * PURPOSE - * Call H5Rget_name for a dataset region - * INPUTS - * - * loc_id - Identifier for the dataset containing the reference or for the group that dataset is in. - * ref - An object or dataset region reference. - * - * OUTPUTS - * name - A name associated with the referenced object or dataset region. - * size - The size of the name buffer. - * - * RETURNS - * 0 on success, -1 on failure - * AUTHOR - * M. Scot Breitenfeld - * March 31, 2008 - * HISTORY - * - * SOURCE -*/ -int_f -nh5rget_name_region_c(hid_t_f *loc_id, int_f *ref, _fcd name, size_t_f *name_len, size_t_f *size_default) -/******/ -{ - hdset_reg_ref_t ref_c; - ssize_t c_size; - size_t c_bufsize = (size_t)*name_len + 1; - char *c_buf = NULL; /* Buffer to hold C string */ - int_f ret_value = 0; - - /* Copy the reference to query */ - HDmemcpy(&ref_c, ref, H5R_DSET_REG_REF_BUF_SIZE); - - /* - * Allocate buffer to hold name of an attribute - */ - if(NULL == (c_buf = (char *)HDmalloc(c_bufsize))) - HGOTO_DONE(FAIL) - - /* - * Call H5Rget_name function. - */ - if((c_size = H5Rget_name((hid_t)*loc_id, H5R_DATASET_REGION, &ref_c, c_buf, c_bufsize)) < 0) - HGOTO_DONE(FAIL) - - /* - * Convert C name to FORTRAN and place it in the given buffer - */ - HD5packFstring(c_buf, _fcdtocp(name), c_bufsize - 1); - *size_default = (size_t_f)c_size; - -done: - if(c_buf) - HDfree(c_buf); - return ret_value; -} +} /* end h5rget_object_type_obj_c() */ /****if* H5Rf/h5rget_name_ptr_c * NAME @@ -535,13 +287,13 @@ done: * Call H5Rget_name * INPUTS * - * loc_id - Identifier for the dataset containing the reference or for the group that dataset is in. - * ref_type - Type of reference. - * ref - An object or dataset region reference. + * loc_id - Identifier for the dataset containing the reference or for the group that dataset is in. + * ref_type - Type of reference. + * ref - An object or dataset region reference. * * OUTPUTS - * name - A name associated with the referenced object or dataset region. - * size - The size of the name buffer. + * name - A name associated with the referenced object or dataset region. + * size - The size of the name buffer. * * RETURNS * 0 on success, -1 on failure @@ -589,24 +341,24 @@ h5rget_name_ptr_c (hid_t_f *loc_id, int_f *ref_type, void *ref, _fcd name, size_ /****if* H5Rf/h5rget_obj_type_c * NAME - * h5rget_obj_type_c + * h5rget_obj_type_c * PURPOSE - * Call H5Rget_obj_type + * Call H5Rget_obj_type * INPUTS - * loc_id - Identifier for the dataset containing the reference or - * for the group that dataset is in. - * ref_type - Type of reference to query. - * ref - Reference to query. + * loc_id - Identifier for the dataset containing the reference or + * for the group that dataset is in. + * ref_type - Type of reference to query. + * ref - Reference to query. * * OUTPUTS - * obj_type - Type of referenced object. These are defined in H5Opublic.h, - * enum H5O_type_t + * obj_type - Type of referenced object. These are defined in H5Opublic.h, + * enum H5O_type_t * * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR - * M. Scot Breitenfeld - * December 17, 2008 + * M. Scot Breitenfeld + * December 17, 2008 * * SOURCE */ diff --git a/fortran/src/H5Rff.F90 b/fortran/src/H5Rff.F90 new file mode 100644 index 0000000..a90bd9a --- /dev/null +++ b/fortran/src/H5Rff.F90 @@ -0,0 +1,792 @@ +!****h* ROBODoc/H5R +! +! NAME +! MODULE H5R +! +! FILE +! fortran/src/H5Rff.f90 +! +! PURPOSE +! This file contains Fortran interfaces for H5R functions. +! +! 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. * +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! +! NOTES +! +! _____ __ __ _____ ____ _____ _______ _ _ _______ +! |_ _| \/ | __ \ / __ \| __ \__ __|/\ | \ | |__ __| +! **** | | | \ / | |__) | | | | |__) | | | / \ | \| | | | **** +! **** | | | |\/| | ___/| | | | _ / | | / /\ \ | . ` | | | **** +! **** _| |_| | | | | | |__| | | \ \ | |/ ____ \| |\ | | | **** +! |_____|_| |_|_| \____/|_| \_\ |_/_/ \_\_| \_| |_| +! +! If you add a new H5R function you must add the function name to the +! Windows dll file 'hdf5_fortrandll.def.in' in the fortran/src directory. +! This is needed for Windows based operating systems. +! +!***** + +MODULE H5R + USE, INTRINSIC :: ISO_C_BINDING, ONLY : C_PTR, C_CHAR, C_SIGNED_CHAR + USE H5GLOBAL + + ! If you change the value of these parameters, do not forget to change corresponding + ! values in the H5f90.h file. + ! INTEGER, PARAMETER :: REF_OBJ_BUF_LEN = 2 + ! INTEGER, PARAMETER :: REF_REG_BUF_LEN = 3 + ! + ! TYPE hobj_ref_t_f + ! INTEGER ref(REF_OBJ_BUF_LEN) + ! END TYPE + ! + ! TYPE hdset_reg_ref_t_f + ! INTEGER ref(REF_REG_BUF_LEN) + ! END TYPE + ! + + INTERFACE h5rget_object_type_f + + MODULE PROCEDURE h5rget_object_type_obj_f + + END INTERFACE + + TYPE :: hdset_reg_ref_t_f03 + INTEGER(C_SIGNED_CHAR), DIMENSION(1:H5R_DSET_REG_REF_BUF_SIZE_F) :: ref + END TYPE hdset_reg_ref_t_f03 + + INTERFACE h5rget_region_f + + MODULE PROCEDURE h5rget_region_region_f ! obsolete + MODULE PROCEDURE h5rget_region_ptr_f ! F2003 + + END INTERFACE + + + INTERFACE h5rcreate_f + + MODULE PROCEDURE h5rcreate_object_f ! obsolete + MODULE PROCEDURE h5rcreate_region_f ! obsolete + MODULE PROCEDURE h5rcreate_ptr_f ! F2003 + + END INTERFACE + + INTERFACE h5rdereference_f + + MODULE PROCEDURE h5rdereference_object_f ! obsolete + MODULE PROCEDURE h5rdereference_region_f ! obsolete + MODULE PROCEDURE h5rdereference_ptr_f ! F2003 + + END INTERFACE + + INTERFACE h5rget_name_f + + MODULE PROCEDURE h5rget_name_object_f ! obsolete + MODULE PROCEDURE h5rget_name_region_f ! obsolete + MODULE PROCEDURE h5rget_name_ptr_f ! F2003 + + END INTERFACE + + INTERFACE + INTEGER FUNCTION h5rget_name_ptr_c(loc_id, ref_type, ref, name, name_len, size_default) & + BIND(C, NAME='h5rget_name_ptr_c') + IMPORT :: c_char, c_ptr + IMPORT :: HID_T, SIZE_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id + INTEGER, INTENT(IN) :: ref_type + TYPE(C_PTR), INTENT(IN), VALUE :: ref + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: name + INTEGER(SIZE_T) :: name_len + INTEGER(SIZE_T) :: size_default + END FUNCTION h5rget_name_ptr_c + END INTERFACE + + INTERFACE + INTEGER FUNCTION h5rdereference_ptr_c(obj_id, ref_type, ref, ref_obj_id) & + BIND(C, NAME='h5rdereference_ptr_c') + IMPORT :: c_ptr + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: obj_id + INTEGER, INTENT(IN) :: ref_type + TYPE(C_PTR), INTENT(IN), VALUE :: ref + INTEGER(HID_T), INTENT(OUT) :: ref_obj_id + END FUNCTION h5rdereference_ptr_c + END INTERFACE + + INTERFACE + INTEGER FUNCTION h5rcreate_ptr_c(ref, loc_id, name, namelen, ref_type, space_id) & + BIND(C, NAME='h5rcreate_ptr_c') + IMPORT :: c_ptr, c_char + IMPORT :: HID_T + IMPLICIT NONE + TYPE(C_PTR), VALUE :: ref + INTEGER(HID_T), INTENT(IN) :: loc_id + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: name + INTEGER :: namelen + INTEGER, INTENT(IN) :: ref_type + INTEGER(HID_T), INTENT(IN) :: space_id + END FUNCTION h5rcreate_ptr_c + END INTERFACE + + INTERFACE + INTEGER FUNCTION h5rget_region_ptr_c(dset_id, ref, space_id) & + BIND(C, NAME='h5rget_region_ptr_c') + IMPORT :: c_ptr + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id + TYPE(C_PTR), VALUE :: ref + INTEGER(HID_T), INTENT(OUT) :: space_id + END FUNCTION h5rget_region_ptr_c + END INTERFACE + + +CONTAINS + +!****s* H5R/h5rget_object_type_obj_f +! +! NAME +! h5rget_object_type_obj_f +! +! PURPOSE +! Retrieves the type of object that an object reference points to. +! +! INPUTS +! dset_id - identifier of the dataset containing +! reference to the objects +! ref - reference to open +! OUTPUTS +! obj_type - object_type, possible values: +! H5G_UNKNOWN_F +! H5G_GROUP_F +! H5G_DATASET_F +! H5G_TYPE_F +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). February 28, 2001 +! +! NOTES +! This is a module procedure for the h5rget_object_type_f +! subroutine. +! SOURCE + SUBROUTINE h5rget_object_type_obj_f(dset_id, ref, obj_type, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + TYPE(hobj_ref_t_f), INTENT(IN) :: ref ! Object reference + INTEGER, INTENT(OUT) :: obj_type ! Object type + ! H5G_UNKNOWN_F + ! H5G_GROUP_F + ! H5G_DATASET_F + ! H5G_TYPE_F + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + INTEGER(HADDR_T) :: ref_f ! Local buffer to pass reference + + INTERFACE + INTEGER FUNCTION h5rget_object_type_obj_c(dset_id, ref_f, obj_type) BIND(C, NAME='h5rget_object_type_obj_c') + IMPORT :: HID_T, HADDR_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id + INTEGER(HADDR_T) :: ref_f + INTEGER, INTENT(OUT) :: obj_type + END FUNCTION h5rget_object_type_obj_c + END INTERFACE + + ref_f = ref%ref + hdferr = h5rget_object_type_obj_c(dset_id, ref_f, obj_type ) + + END SUBROUTINE h5rget_object_type_obj_f + + +!****s* H5R/h5rget_region_region_f +! +! NAME +! h5rget_region_region_f +! +! PURPOSE +! Retrieves a dataspace with the specified region selected +! +! INPUTS +! dset_id - identifier of the dataset containing +! reference to the regions +! ref - reference to open +! OUTPUTS +! space_id - dataspace identifier +! hdferr - Returns 0 if successful and -1 if fails +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). February 28, 2001 +! +! NOTES +! This is a module procedure for the h5rget_region_f subroutine. +! +! SOURCE + SUBROUTINE h5rget_region_region_f(dset_id, ref, space_id, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + TYPE(hdset_reg_ref_t_f), INTENT(IN) :: ref ! Dataset region reference + INTEGER(HID_T), INTENT(OUT) :: space_id ! Space identifier + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + INTEGER :: ref_f(REF_REG_BUF_LEN) ! Local buffer to pass reference + + INTERFACE + INTEGER FUNCTION h5rget_region_region_c(dset_id, ref_f, space_id) BIND(C, NAME='h5rget_region_region_c') + IMPORT :: HID_T, REF_REG_BUF_LEN + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id + INTEGER :: ref_f(REF_REG_BUF_LEN) + INTEGER(HID_T), INTENT(OUT) :: space_id + END FUNCTION h5rget_region_region_c + END INTERFACE + + ref_f = ref%ref + hdferr = h5rget_region_region_c(dset_id, ref_f, space_id ) + + END SUBROUTINE h5rget_region_region_f + +!****s* H5R/h5rget_region_ptr_f +! +! NAME +! h5rget_region_ptr_f +! +! PURPOSE +! Retrieves a dataspace with the specified region +! selected using pointer +! +! INPUTS +! dset_id - identifier of the dataset containing +! reference to the regions +! ref - reference to open +! OUTPUTS +! space_id - dataspace identifier +! hdferr - Returns 0 if successful and -1 if fails +! AUTHOR +! M. Scot Breitenfeld +! August 4, 2012 +! +! NOTES +! This is a module procedure for the h5rget_region_f subroutine. +! +! SOURCE + SUBROUTINE h5rget_region_ptr_f(dset_id, ref, space_id, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + TYPE(C_PTR), INTENT(IN) :: ref ! Dataset region reference + INTEGER(HID_T), INTENT(OUT) :: space_id ! Space identifier + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + + hdferr = h5rget_region_ptr_c(dset_id, ref, space_id ) + + END SUBROUTINE h5rget_region_ptr_f + + +!****s* H5R (F03)/h5rcreate_object_f +! +! NAME +! h5rcreate_object_f +! +! PURPOSE +! Creates reference to the object +! +! Inputs: +! loc_id - location identifier +! name - name of the object at the specified location +! Outputs: +! ref - reference to the specified object +! hdferr - returns 0 if successful and -1 if fails +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). February 28, 2001 +! +! NOTES +! This is a module procedure for the h5rcreate_f subroutine. +! +! Signature: + SUBROUTINE h5rcreate_object_f(loc_id, name, ref, hdferr) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id ! Location identifier + CHARACTER(LEN=*), INTENT(IN) :: name ! Name of the object at location specified + ! by loc_id identifier + TYPE(hobj_ref_t_f), INTENT(INOUT), TARGET :: ref ! Object reference + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + INTEGER :: namelen ! Name length + TYPE(C_PTR) :: f_ptr + + f_ptr = C_LOC(ref) + + namelen = LEN(name) + + hdferr = h5rcreate_ptr_c(f_ptr, loc_id, name, namelen, INT(0), INT(-1,HID_T)) + + END SUBROUTINE h5rcreate_object_f + +!****s* H5R (F90)/h5rcreate_region_f +! +! NAME +! h5rcreate_region_f +! +! PURPOSE +! Creates reference to the dataset region +! +! INPUTS +! loc_id - location identifier +! name - name of the dataset at the specified location +! space_id - dataspace identifier that describes selected region +! OUTPUTS +! ref - reference to the dataset region +! hdferr - returns 0 if successful and -1 if fails +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). February 28, 2001 +! +! NOTES +! This is a module procedure for the h5rcreate_f subroutine. +! +! SOURCE + SUBROUTINE h5rcreate_region_f(loc_id, name, space_id, ref, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id ! Location identifier + CHARACTER(LEN=*), INTENT(IN) :: name ! Name of the dataset at location specified + ! by loc_id identifier + INTEGER(HID_T), INTENT(IN) :: space_id ! Dataset's dataspace identifier + TYPE(hdset_reg_ref_t_f), INTENT(OUT) :: ref ! Dataset region reference + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + INTEGER :: namelen ! Name length + INTEGER :: ref_f(REF_REG_BUF_LEN) ! Local buffer to pass reference + + INTERFACE + INTEGER FUNCTION h5rcreate_region_c(ref_f, loc_id, name, namelen, space_id) BIND(C,NAME='h5rcreate_region_c') + IMPORT :: HID_T, REF_REG_BUF_LEN + IMPORT :: C_CHAR + IMPLICIT NONE + INTEGER :: ref_f(REF_REG_BUF_LEN) + INTEGER(HID_T), INTENT(IN) :: loc_id + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: name + INTEGER :: namelen + INTEGER(HID_T), INTENT(IN) :: space_id + END FUNCTION h5rcreate_region_c + END INTERFACE + + namelen = LEN(name) + ref_f = 0 + hdferr = h5rcreate_region_c(ref_f, loc_id, name, namelen, space_id ) + ref%ref = ref_f + + END SUBROUTINE h5rcreate_region_f + +!****s* H5R (F03)/h5rcreate_ptr_f +! +! NAME +! h5rcreate_ptr_f +! +! PURPOSE +! Creates a reference. +! +! Inputs: +! loc_id - location identifier +! name - name of the dataset at the specified location +! ref_type - type of reference: +! H5R_OBJECT +! H5T_STD_REF_DSETREG +! Outputs: +! ref - reference created by the function call. +! hdferr - returns 0 if successful and -1 if fails. +! OPTIONAL +! space_id - dataspace identifier that describes selected region +! +! AUTHOR +! M. Scot Breitenfeld +! June 20, 2008 +! +! NOTES +! This is a module procedure for the h5rcreate_f +! subroutine where the output is a pointer. +! +! Signature: + SUBROUTINE h5rcreate_ptr_f(loc_id, name, ref_type, ref, hdferr, space_id) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id ! Location identifier + CHARACTER(LEN=*), INTENT(IN) :: name ! Name of the dataset at location specified + ! by loc_id identifier + INTEGER, INTENT(IN) :: ref_type ! type of reference + TYPE(C_PTR), INTENT(INOUT) :: ref ! Reference created by the function call + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), INTENT(IN), OPTIONAL :: space_id ! Dataset's dataspace identifier +!***** + INTEGER :: namelen ! Name length + INTEGER(HID_T) :: space_id_c + + namelen = LEN(name) + space_id_c = -1 + IF(PRESENT(space_id)) space_id_c = space_id + hdferr = h5rcreate_ptr_c(ref, loc_id, name, namelen, ref_type, space_id_c) + + END SUBROUTINE h5rcreate_ptr_f +!****s* H5R (F03)/h5rdereference_object_f +! +! NAME +! h5rdereference_object_f +! +! PURPOSE +! Opens the HDF5 object referenced +! +! Inputs: +! dset_id - identifier of the dataset containing +! reference +! ref - reference to open +! Outputs: +! obj_id - object_identifier +! hdferr - returns 0 if successful and -1 if fails +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). February 28, 2001 +! +! NOTES +! This is a module procedure for the h5rdereference_f subroutine. +! +! Signature: + SUBROUTINE h5rdereference_object_f(obj_id, ref, ref_obj_id, hdferr) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: obj_id ! Dataset identifier + TYPE(hobj_ref_t_f), INTENT(IN), TARGET :: ref ! Object reference + INTEGER(HID_T), INTENT(OUT) :: ref_obj_id ! Object identifier + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + TYPE(C_PTR) :: f_ptr + + f_ptr = C_LOC(ref) + hdferr = h5rdereference_ptr_c(obj_id, 0, f_ptr, ref_obj_id) + + END SUBROUTINE h5rdereference_object_f +!****s* H5R (F03)/h5rdereference_region_f +! +! NAME +! h5rdereference_region_f +! +! PURPOSE +! Opens the dataset region +! +! Inputs: +! dset_id - identifier of the dataset containing +! reference to teh regions +! ref - reference to open +! Outputs: +! obj_id - dataspace identifier +! hdferr - returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). February 28, 2001 +! +! NOTES +! This is a module procedure for the h5rdereference_f subroutine. +! +! Signature: + SUBROUTINE h5rdereference_region_f(obj_id, ref, ref_obj_id, hdferr) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: obj_id ! Dataset identifier + TYPE(hdset_reg_ref_t_f), INTENT(IN), TARGET :: ref ! Object reference + INTEGER(HID_T), INTENT(OUT) :: ref_obj_id ! Dataspace identifier + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + TYPE(C_PTR) :: f_ptr + + f_ptr = C_LOC(ref) + hdferr = h5rdereference_ptr_c(obj_id, 1, f_ptr, ref_obj_id) + + END SUBROUTINE h5rdereference_region_f + +!****s* H5R (F03)/h5rdereference_ptr_f +! +! NAME +! h5rdereference_ptr_f +! +! PURPOSE +! Opens the HDF5 object referenced. +! +! Inputs: +! obj_id - valid identifier for the file containing the +! referenced object or any object in that file. +! ref_type - the reference type of ref. +! ref - Reference to open. +! Outputs: +! ref_obj_id - identifier of referenced object +! hdferr - returns 0 if successful and -1 if fails +! +! AUTHOR +! M. Scot Breitenfeld +! June 20, 2008 +! +! NOTES +! This is a module procedure for the h5rdereference_f +! subroutine using pointers. +! +! Signature: + SUBROUTINE h5rdereference_ptr_f(obj_id, ref_type, ref, ref_obj_id, hdferr) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: obj_id ! Valid identifier for the file containing the + ! referenced object or any object in that file. + INTEGER, INTENT(IN) :: ref_type ! The reference type of ref. + TYPE(C_PTR), INTENT(IN) :: ref ! Object reference + INTEGER(HID_T), INTENT(OUT) :: ref_obj_id + ! Identifier of referenced object + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + hdferr = h5rdereference_ptr_c(obj_id, ref_type, ref, ref_obj_id) + + END SUBROUTINE h5rdereference_ptr_f +! +!****s* H5R (F03)/h5rget_name_object_f +! +! NAME +! h5rget_name_object_f +! +! PURPOSE +! Retrieves a name of a referenced object. +! +! Inputs: +! loc_id - Identifier for the file containing the reference or for any object in that file. +! ref - An object or dataset region reference. +! +! Outputs: +! name - A name associated with the referenced object or dataset region. +! hdferr - Returns 0 if successful and -1 if fails. +! +! Optional parameters: +! size - The size of the name buffer, returning 0 (zero) if no name is associated +! with the identifier. +! +! AUTHOR +! M. Scot Breitenfeld +! March 28, 2008 +! +! Signature: + SUBROUTINE h5rget_name_object_f(loc_id, ref, name, hdferr, size) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id + TYPE(hobj_ref_t_f), INTENT(IN), TARGET :: ref + INTEGER(SIZE_T), OPTIONAL, INTENT(OUT) :: size + CHARACTER(LEN=*), INTENT(INOUT) :: name + INTEGER, INTENT(OUT) :: hdferr +!***** + + INTEGER(SIZE_T) :: size_default + INTEGER(SIZE_T) :: name_len + TYPE(C_PTR) :: f_ptr + + f_ptr = C_LOC(ref) + + name_len=LEN(name) + + hdferr = h5rget_name_ptr_c(loc_id, 0, f_ptr, name, name_len, size_default) + + IF(PRESENT(size)) size = size_default + + END SUBROUTINE h5rget_name_object_f +!****s* H5R (F03)/h5rget_name_region_f +! +! NAME +! h5rget_name_region_f +! +! PURPOSE +! Retrieves a name of a dataset region. +! +! Inputs: +! loc_id - Identifier for the file containing the reference or for any object in that file. +! ref - An object or dataset region reference. +! +! Outputs: +! name - A name associated with the referenced object or dataset region. +! hdferr - Returns 0 if successful and -1 if fails. +! +! Optional parameters: +! size - The size of the name buffer, returning 0 (zero) if no name is associated with the identifier +! +! AUTHOR +! M. Scot Breitenfeld +! March 28, 2008 +! +! Signature: + SUBROUTINE h5rget_name_region_f(loc_id, ref, name, hdferr, size) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id + TYPE(hdset_reg_ref_t_f), INTENT(IN), TARGET :: ref + INTEGER(SIZE_T), OPTIONAL, INTENT(OUT) :: size + CHARACTER(LEN=*), INTENT(INOUT) :: name + INTEGER, INTENT(OUT) :: hdferr +!***** + INTEGER(SIZE_T) :: size_default + INTEGER(SIZE_T) :: name_len + TYPE(C_PTR) :: f_ptr + + f_ptr = C_LOC(ref) + + name_len=LEN(name) + + hdferr = h5rget_name_ptr_c(loc_id, 1, f_ptr, name, name_len, size_default) + + IF(PRESENT(size)) size = size_default + + END SUBROUTINE h5rget_name_region_f + + !****s* H5R (F03)/h5rget_name_ptr_f + ! + ! NAME + ! h5rget_name_ptr_f + ! + ! PURPOSE + ! Retrieves a name of a referenced object. + ! + ! Inputs: + ! loc_id - Identifier for the file containing the reference or for any object in that file. + ! ref_type - Type of reference. + ! ref - An object or dataset region reference. + ! + ! Outputs: + ! name - A name associated with the referenced object or dataset ptr. + ! hdferr - Returns 0 if successful and -1 if fails. + ! + ! Optional parameters: + ! size - The size of the name buffer, returning 0 (zero) if no name is associated + ! with the identifier + ! + ! AUTHOR + ! M. Scot Breitenfeld + ! March 28, 2008 + ! + ! Signature: + SUBROUTINE h5rget_name_ptr_f(loc_id, ref_type, ref, name, hdferr, size) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id + INTEGER, INTENT(IN) :: ref_type + TYPE(C_PTR), INTENT(IN) :: ref + CHARACTER(LEN=*), INTENT(INOUT) :: name + INTEGER, INTENT(OUT) :: hdferr + INTEGER(SIZE_T), OPTIONAL, INTENT(OUT) :: size +!***** + INTEGER(SIZE_T) :: size_default + INTEGER(SIZE_T) :: name_len + + name_len=LEN(name) + + hdferr = h5rget_name_ptr_c(loc_id, ref_type, ref, name, name_len, size_default) + + IF(PRESENT(size)) size = size_default + + END SUBROUTINE h5rget_name_ptr_f + + !****s* H5R (F03)/h5rget_obj_type_f + ! + ! NAME + ! h5rget_obj_type_f + ! + ! PURPOSE + ! Retrieves the type of object that an object reference points to. + ! + ! Inputs: + ! loc_id - Identifier for the dataset containing the reference or + ! for the group that dataset is in. + ! ref_type - Type of reference to query. + ! ref - Reference to query. + ! + ! Outputs: + ! obj_type - Type of referenced object. + ! H5G_UNKNOWN_F + ! H5G_GROUP_F + ! H5G_DATASET_F + ! H5G_TYPE_F + ! + ! hdferr - Returns 0 if successful and -1 if fails. + ! + ! AUTHOR + ! M. Scot Breitenfeld + ! Decemeber 17, 2008 + ! + ! Signature: + SUBROUTINE h5rget_obj_type_f(loc_id, ref_type, ref, obj_type, hdferr) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id + INTEGER, INTENT(IN) :: ref_type + TYPE(C_PTR), INTENT(IN) :: ref + INTEGER, INTENT(OUT) :: obj_type + INTEGER, INTENT(OUT) :: hdferr + !***** + + INTERFACE + INTEGER FUNCTION h5rget_obj_type_c(loc_id, ref_type, ref, obj_type) & + BIND(C, NAME='h5rget_obj_type_c') + IMPORT :: C_PTR + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id + INTEGER, INTENT(IN) :: ref_type + TYPE(C_PTR), VALUE :: ref + INTEGER :: obj_type + END FUNCTION h5rget_obj_type_c + END INTERFACE + + hdferr = h5rget_obj_type_c(loc_id, ref_type, ref, obj_type) + + END SUBROUTINE h5rget_obj_type_f + +END MODULE H5R diff --git a/fortran/src/H5Rff.f90 b/fortran/src/H5Rff.f90 deleted file mode 100644 index 77a1ff8..0000000 --- a/fortran/src/H5Rff.f90 +++ /dev/null @@ -1,128 +0,0 @@ -!****h* ROBODoc/H5R -! -! NAME -! MODULE H5R -! -! FILE -! fortran/src/H5Rff.f90 -! -! PURPOSE -! This file contains Fortran interfaces for H5R functions. It includes -! all the functions that are independent on whether the Fortran 2003 functions -! are enabled or disabled. -! -! -! 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. * -! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -! -! NOTES -! *** IMPORTANT *** -! If you add a new H5R function you must add the function name to the -! Windows dll file 'hdf5_fortrandll.def.in' in the fortran/src directory. -! This is needed for Windows based operating systems. -! -!***** - -MODULE H5R - USE H5GLOBAL - - ! If you change the value of these parameters, do not forget to change corresponding - ! values in the H5f90.h file. - ! INTEGER, PARAMETER :: REF_OBJ_BUF_LEN = 2 - ! INTEGER, PARAMETER :: REF_REG_BUF_LEN = 3 - ! - ! TYPE hobj_ref_t_f - ! INTEGER ref(REF_OBJ_BUF_LEN) - ! END TYPE - ! - ! TYPE hdset_reg_ref_t_f - ! INTEGER ref(REF_REG_BUF_LEN) - ! END TYPE - ! - - INTERFACE h5rget_object_type_f - - MODULE PROCEDURE h5rget_object_type_obj_f - - END INTERFACE - -CONTAINS - -!****s* H5R/h5rget_object_type_obj_f -! -! NAME -! h5rget_object_type_obj_f -! -! PURPOSE -! Retrieves the type of object that an object reference points to. -! -! INPUTS -! dset_id - identifier of the dataset containing -! reference to the objects -! ref - reference to open -! OUTPUTS -! obj_type - object_type, possible values: -! H5G_UNKNOWN_F -! H5G_GROUP_F -! H5G_DATASET_F -! H5G_TYPE_F -! hdferr - Returns 0 if successful and -1 if fails -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). February 28, 2001 -! -! NOTES -! This is a module procedure for the h5rget_object_type_f -! subroutine. -! SOURCE - SUBROUTINE h5rget_object_type_obj_f(dset_id, ref, obj_type, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - TYPE(hobj_ref_t_f), INTENT(IN) :: ref ! Object reference - INTEGER, INTENT(OUT) :: obj_type ! Object type - ! H5G_UNKNOWN_F - ! H5G_GROUP_F - ! H5G_DATASET_F - ! H5G_TYPE_F - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTEGER(HADDR_T) :: ref_f ! Local buffer to pass reference - - INTERFACE - INTEGER FUNCTION h5rget_object_type_obj_c(dset_id, ref_f, obj_type) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5RGET_OBJECT_TYPE_OBJ_C':: h5rget_object_type_obj_c - !DEC$ENDIF - ! INTEGER, PARAMETER :: REF_OBJ_BUF_LEN = 2 - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HADDR_T) :: ref_f - INTEGER, INTENT(OUT) :: obj_type - END FUNCTION h5rget_object_type_obj_c - END INTERFACE - - ref_f = ref%ref - hdferr = h5rget_object_type_obj_c(dset_id, ref_f, obj_type ) - - END SUBROUTINE h5rget_object_type_obj_f - -END MODULE H5R diff --git a/fortran/src/H5Rff_F03.f90 b/fortran/src/H5Rff_F03.f90 deleted file mode 100644 index 8f40607..0000000 --- a/fortran/src/H5Rff_F03.f90 +++ /dev/null @@ -1,719 +0,0 @@ -!****h* ROBODoc/H5R (F03) -! -! NAME -! MODULE H5R_PROVISIONAL -! -! FILE -! fortran/src/H5Rff_F03.f90 -! -! PURPOSE -! This file contains Fortran 90 and Fortran 2003 interfaces for H5R functions. -! It contains the same functions as H5Rff_DEPRECIATE.f90 but includes the -! Fortran 2003 functions and the interface listings. This file will be compiled -! instead of H5Rff_DEPRECIATE.f90 if Fortran 2003 functions are enabled. -! -! 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. * -! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -! -! NOTES -! *** IMPORTANT *** -! If you add a new H5R function you must add the function name to the -! Windows dll file 'hdf5_fortrandll.def.in' in the fortran/src directory. -! This is needed for Windows based operating systems. -! -!***** -MODULE H5R_PROVISIONAL - USE H5GLOBAL - USE, INTRINSIC :: ISO_C_BINDING - - ! If you change the value of these parameters, do not forget to change corresponding - ! values in the H5f90.h file. - ! INTEGER, PARAMETER :: REF_OBJ_BUF_LEN = 2 - ! INTEGER, PARAMETER :: REF_REG_BUF_LEN = 3 - ! - ! TYPE hobj_ref_t_f - ! INTEGER ref(REF_OBJ_BUF_LEN) - ! END TYPE - ! - ! TYPE hdset_reg_ref_t_f - ! INTEGER ref(REF_REG_BUF_LEN) - ! END TYPE - ! - - TYPE :: hdset_reg_ref_t_f03 - INTEGER(C_SIGNED_CHAR), DIMENSION(1:H5R_DSET_REG_REF_BUF_SIZE_F) :: ref - END TYPE hdset_reg_ref_t_f03 - - INTERFACE h5rget_region_f - - MODULE PROCEDURE h5rget_region_region_f ! obsolete - MODULE PROCEDURE h5rget_region_ptr_f ! F2003 - - END INTERFACE - - - INTERFACE h5rcreate_f - - MODULE PROCEDURE h5rcreate_object_f ! obsolete - MODULE PROCEDURE h5rcreate_region_f ! obsolete - MODULE PROCEDURE h5rcreate_ptr_f ! F2003 - - END INTERFACE - - INTERFACE h5rdereference_f - - MODULE PROCEDURE h5rdereference_object_f ! obsolete - MODULE PROCEDURE h5rdereference_region_f ! obsolete - MODULE PROCEDURE h5rdereference_ptr_f ! F2003 - - END INTERFACE - - INTERFACE h5rget_name_f - - MODULE PROCEDURE h5rget_name_object_f ! obsolete - MODULE PROCEDURE h5rget_name_region_f ! obsolete - MODULE PROCEDURE h5rget_name_ptr_f ! F2003 - - END INTERFACE - - INTERFACE - INTEGER FUNCTION h5rget_name_ptr_c(loc_id, ref_type, ref, name, name_len, size_default) & - BIND(C, NAME='h5rget_name_ptr_c') - USE, INTRINSIC :: ISO_C_BINDING, ONLY : c_char, c_ptr - USE H5GLOBAL - INTEGER(HID_T), INTENT(IN) :: loc_id - INTEGER, INTENT(IN) :: ref_type - TYPE(C_PTR), INTENT(IN), VALUE :: ref - CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: name - INTEGER(SIZE_T) :: name_len - INTEGER(SIZE_T) :: size_default - END FUNCTION h5rget_name_ptr_c - END INTERFACE - - INTERFACE - INTEGER FUNCTION h5rdereference_ptr_c(obj_id, ref_type, ref, ref_obj_id) & - BIND(C, NAME='h5rdereference_ptr_c') - USE, INTRINSIC :: ISO_C_BINDING, ONLY : c_ptr - USE H5GLOBAL - INTEGER(HID_T), INTENT(IN) :: obj_id - INTEGER, INTENT(IN) :: ref_type - TYPE(C_PTR), INTENT(IN), VALUE :: ref - INTEGER(HID_T), INTENT(OUT) :: ref_obj_id - END FUNCTION h5rdereference_ptr_c - END INTERFACE - - INTERFACE - INTEGER FUNCTION h5rcreate_ptr_c(ref, loc_id, name, namelen, ref_type, space_id) & - BIND(C, NAME='h5rcreate_ptr_c') - USE, INTRINSIC :: ISO_C_BINDING, ONLY : c_char, c_ptr - USE H5GLOBAL - TYPE(C_PTR), VALUE :: ref - INTEGER(HID_T), INTENT(IN) :: loc_id - CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: name - INTEGER :: namelen - INTEGER, INTENT(IN) :: ref_type - INTEGER(HID_T), INTENT(IN) :: space_id - END FUNCTION h5rcreate_ptr_c - END INTERFACE - - INTERFACE - INTEGER FUNCTION h5rget_region_ptr_c(dset_id, ref, space_id) & - BIND(C, NAME='h5rget_region_ptr_c') - USE, INTRINSIC :: ISO_C_BINDING, ONLY : c_ptr - USE H5GLOBAL - INTEGER(HID_T), INTENT(IN) :: dset_id - TYPE(C_PTR), VALUE :: ref - INTEGER(HID_T), INTENT(OUT) :: space_id - END FUNCTION h5rget_region_ptr_c - END INTERFACE - -CONTAINS - -!****s* H5R/h5rget_region_region_f -! -! NAME -! h5rget_region_region_f -! -! PURPOSE -! Retrieves a dataspace with the specified region selected -! -! INPUTS -! dset_id - identifier of the dataset containing -! reference to the regions -! ref - reference to open -! OUTPUTS -! space_id - dataspace identifier -! hdferr - Returns 0 if successful and -1 if fails -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). February 28, 2001 -! -! NOTES -! This is a module procedure for the h5rget_region_f subroutine. -! -! SOURCE - SUBROUTINE h5rget_region_region_f(dset_id, ref, space_id, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - TYPE(hdset_reg_ref_t_f), INTENT(IN) :: ref ! Dataset region reference - INTEGER(HID_T), INTENT(OUT) :: space_id ! Space identifier - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTEGER :: ref_f(REF_REG_BUF_LEN) ! Local buffer to pass reference - - INTERFACE - INTEGER FUNCTION h5rget_region_region_c(dset_id, ref_f, space_id) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5RGET_REGION_REGION_C':: h5rget_region_region_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: dset_id - ! INTEGER, PARAMETER :: REF_REG_BUF_LEN = 3 - INTEGER :: ref_f(REF_REG_BUF_LEN) - INTEGER(HID_T), INTENT(OUT) :: space_id - END FUNCTION h5rget_region_region_c - END INTERFACE - - ref_f = ref%ref - hdferr = h5rget_region_region_c(dset_id, ref_f, space_id ) - - END SUBROUTINE h5rget_region_region_f - -!****s* H5R/h5rget_region_ptr_f -! -! NAME -! h5rget_region_ptr_f -! -! PURPOSE -! Retrieves a dataspace with the specified region -! selected using pointer -! -! INPUTS -! dset_id - identifier of the dataset containing -! reference to the regions -! ref - reference to open -! OUTPUTS -! space_id - dataspace identifier -! hdferr - Returns 0 if successful and -1 if fails -! AUTHOR -! M. Scot Breitenfeld -! August 4, 2012 -! -! NOTES -! This is a module procedure for the h5rget_region_f subroutine. -! -! SOURCE - SUBROUTINE h5rget_region_ptr_f(dset_id, ref, space_id, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - TYPE(C_PTR), INTENT(IN) :: ref ! Dataset region reference - INTEGER(HID_T), INTENT(OUT) :: space_id ! Space identifier - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - - hdferr = h5rget_region_ptr_c(dset_id, ref, space_id ) - - END SUBROUTINE h5rget_region_ptr_f - - -!****s* H5R (F03)/h5rcreate_object_f -! -! NAME -! h5rcreate_object_f -! -! PURPOSE -! Creates reference to the object -! -! Inputs: -! loc_id - location identifier -! name - name of the object at the specified location -! Outputs: -! ref - reference to the specified object -! hdferr - returns 0 if successful and -1 if fails -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). February 28, 2001 -! -! NOTES -! This is a module procedure for the h5rcreate_f subroutine. -! -! Signature: - SUBROUTINE h5rcreate_object_f(loc_id, name, ref, hdferr) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id ! Location identifier - CHARACTER(LEN=*), INTENT(IN) :: name ! Name of the object at location specified - ! by loc_id identifier - TYPE(hobj_ref_t_f), INTENT(INOUT), TARGET :: ref ! Object reference - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTEGER :: namelen ! Name length - TYPE(C_PTR) :: f_ptr - - f_ptr = C_LOC(ref) - - namelen = LEN(name) - - hdferr = h5rcreate_ptr_c(f_ptr, loc_id, name, namelen, INT(0), INT(-1,HID_T)) - - END SUBROUTINE h5rcreate_object_f - -!****s* H5R (F90)/h5rcreate_region_f -! -! NAME -! h5rcreate_region_f -! -! PURPOSE -! Creates reference to the dataset region -! -! INPUTS -! loc_id - location identifier -! name - name of the dataset at the specified location -! space_id - dataspace identifier that describes selected region -! OUTPUTS -! ref - reference to the dataset region -! hdferr - returns 0 if successful and -1 if fails -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). February 28, 2001 -! -! NOTES -! This is a module procedure for the h5rcreate_f subroutine. -! -! SOURCE - SUBROUTINE h5rcreate_region_f(loc_id, name, space_id, ref, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id ! Location identifier - CHARACTER(LEN=*), INTENT(IN) :: name ! Name of the dataset at location specified - ! by loc_id identifier - INTEGER(HID_T), INTENT(IN) :: space_id ! Dataset's dataspace identifier - TYPE(hdset_reg_ref_t_f), INTENT(OUT) :: ref ! Dataset region reference - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTEGER :: namelen ! Name length - INTEGER :: ref_f(REF_REG_BUF_LEN) ! Local buffer to pass reference - - INTERFACE - INTEGER FUNCTION h5rcreate_region_c(ref_f, loc_id, name, namelen, space_id) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5RCREATE_REGION_C':: h5rcreate_region_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: name - ! INTEGER, PARAMETER :: REF_REG_BUF_LEN = 3 - INTEGER :: ref_f(REF_REG_BUF_LEN) - INTEGER(HID_T), INTENT(IN) :: loc_id - CHARACTER(LEN=*), INTENT(IN) :: name - INTEGER :: namelen - INTEGER(HID_T), INTENT(IN) :: space_id - END FUNCTION h5rcreate_region_c - END INTERFACE - - namelen = LEN(name) - ref_f = 0 - hdferr = h5rcreate_region_c(ref_f, loc_id, name, namelen, space_id ) - ref%ref = ref_f - - END SUBROUTINE h5rcreate_region_f - -!****s* H5R (F03)/h5rcreate_ptr_f -! -! NAME -! h5rcreate_ptr_f -! -! PURPOSE -! Creates a reference. -! -! Inputs: -! loc_id - location identifier -! name - name of the dataset at the specified location -! ref_type - type of reference: -! H5R_OBJECT -! H5T_STD_REF_DSETREG -! Outputs: -! ref - reference created by the function call. -! hdferr - returns 0 if successful and -1 if fails. -! OPTIONAL -! space_id - dataspace identifier that describes selected region -! -! AUTHOR -! M. Scot Breitenfeld -! June 20, 2008 -! -! NOTES -! This is a module procedure for the h5rcreate_f -! subroutine where the output is a pointer. -! -! Signature: - SUBROUTINE h5rcreate_ptr_f(loc_id, name, ref_type, ref, hdferr, space_id) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id ! Location identifier - CHARACTER(LEN=*), INTENT(IN) :: name ! Name of the dataset at location specified - ! by loc_id identifier - INTEGER, INTENT(IN) :: ref_type ! type of reference - TYPE(C_PTR), INTENT(INOUT) :: ref ! Reference created by the function call - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), INTENT(IN), OPTIONAL :: space_id ! Dataset's dataspace identifier -!***** - INTEGER :: namelen ! Name length - INTEGER(HID_T) :: space_id_c - - namelen = LEN(name) - space_id_c = -1 - IF(PRESENT(space_id)) space_id_c = space_id - hdferr = h5rcreate_ptr_c(ref, loc_id, name, namelen, ref_type, space_id_c) - - END SUBROUTINE h5rcreate_ptr_f -!****s* H5R (F03)/h5rdereference_object_f -! -! NAME -! h5rdereference_object_f -! -! PURPOSE -! Opens the HDF5 object referenced -! -! Inputs: -! dset_id - identifier of the dataset containing -! reference -! ref - reference to open -! Outputs: -! obj_id - object_identifier -! hdferr - returns 0 if successful and -1 if fails -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). February 28, 2001 -! -! NOTES -! This is a module procedure for the h5rdereference_f subroutine. -! -! Signature: - SUBROUTINE h5rdereference_object_f(obj_id, ref, ref_obj_id, hdferr) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: obj_id ! Dataset identifier - TYPE(hobj_ref_t_f), INTENT(IN), TARGET :: ref ! Object reference - INTEGER(HID_T), INTENT(OUT) :: ref_obj_id ! Object identifier - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - TYPE(C_PTR) :: f_ptr - - f_ptr = C_LOC(ref) - hdferr = h5rdereference_ptr_c(obj_id, 0, f_ptr, ref_obj_id) - - END SUBROUTINE h5rdereference_object_f -!****s* H5R (F03)/h5rdereference_region_f -! -! NAME -! h5rdereference_region_f -! -! PURPOSE -! Opens the dataset region -! -! Inputs: -! dset_id - identifier of the dataset containing -! reference to teh regions -! ref - reference to open -! Outputs: -! obj_id - dataspace identifier -! hdferr - returns 0 if successful and -1 if fails -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). February 28, 2001 -! -! NOTES -! This is a module procedure for the h5rdereference_f subroutine. -! -! Signature: - SUBROUTINE h5rdereference_region_f(obj_id, ref, ref_obj_id, hdferr) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: obj_id ! Dataset identifier - TYPE(hdset_reg_ref_t_f), INTENT(IN), TARGET :: ref ! Object reference - INTEGER(HID_T), INTENT(OUT) :: ref_obj_id ! Dataspace identifier - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - TYPE(C_PTR) :: f_ptr - - f_ptr = C_LOC(ref) - hdferr = h5rdereference_ptr_c(obj_id, 1, f_ptr, ref_obj_id) - - END SUBROUTINE h5rdereference_region_f - -!****s* H5R (F03)/h5rdereference_ptr_f -! -! NAME -! h5rdereference_ptr_f -! -! PURPOSE -! Opens the HDF5 object referenced. -! -! Inputs: -! obj_id - valid identifier for the file containing the -! referenced object or any object in that file. -! ref_type - the reference type of ref. -! ref - Reference to open. -! Outputs: -! ref_obj_id - identifier of referenced object -! hdferr - returns 0 if successful and -1 if fails -! -! AUTHOR -! M. Scot Breitenfeld -! June 20, 2008 -! -! NOTES -! This is a module procedure for the h5rdereference_f -! subroutine using pointers. -! -! Signature: - SUBROUTINE h5rdereference_ptr_f(obj_id, ref_type, ref, ref_obj_id, hdferr) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: obj_id ! Valid identifier for the file containing the - ! referenced object or any object in that file. - INTEGER, INTENT(IN) :: ref_type ! The reference type of ref. - TYPE(C_PTR), INTENT(IN) :: ref ! Object reference - INTEGER(HID_T), INTENT(OUT) :: ref_obj_id - ! Identifier of referenced object - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - hdferr = h5rdereference_ptr_c(obj_id, ref_type, ref, ref_obj_id) - - END SUBROUTINE h5rdereference_ptr_f -! -!****s* H5R (F03)/h5rget_name_object_f -! -! NAME -! h5rget_name_object_f -! -! PURPOSE -! Retrieves a name of a referenced object. -! -! Inputs: -! loc_id - Identifier for the file containing the reference or for any object in that file. -! ref - An object or dataset region reference. -! -! Outputs: -! name - A name associated with the referenced object or dataset region. -! hdferr - Returns 0 if successful and -1 if fails. -! -! Optional parameters: -! size - The size of the name buffer, returning 0 (zero) if no name is associated -! with the identifier. -! -! AUTHOR -! M. Scot Breitenfeld -! March 28, 2008 -! -! Signature: - SUBROUTINE h5rget_name_object_f(loc_id, ref, name, hdferr, size) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id - TYPE(hobj_ref_t_f), INTENT(IN), TARGET :: ref - INTEGER(SIZE_T), OPTIONAL, INTENT(OUT) :: size - CHARACTER(LEN=*), INTENT(INOUT) :: name - INTEGER, INTENT(OUT) :: hdferr -!***** - - INTEGER(SIZE_T) :: size_default - INTEGER(SIZE_T) :: name_len - TYPE(C_PTR) :: f_ptr - - f_ptr = C_LOC(ref) - - name_len=LEN(name) - - hdferr = h5rget_name_ptr_c(loc_id, 0, f_ptr, name, name_len, size_default) - - IF(PRESENT(size)) size = size_default - - END SUBROUTINE h5rget_name_object_f -!****s* H5R (F03)/h5rget_name_region_f -! -! NAME -! h5rget_name_region_f -! -! PURPOSE -! Retrieves a name of a dataset region. -! -! Inputs: -! loc_id - Identifier for the file containing the reference or for any object in that file. -! ref - An object or dataset region reference. -! -! Outputs: -! name - A name associated with the referenced object or dataset region. -! hdferr - Returns 0 if successful and -1 if fails. -! -! Optional parameters: -! size - The size of the name buffer, returning 0 (zero) if no name is associated with the identifier -! -! AUTHOR -! M. Scot Breitenfeld -! March 28, 2008 -! -! Signature: - SUBROUTINE h5rget_name_region_f(loc_id, ref, name, hdferr, size) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id - TYPE(hdset_reg_ref_t_f), INTENT(IN), TARGET :: ref - INTEGER(SIZE_T), OPTIONAL, INTENT(OUT) :: size - CHARACTER(LEN=*), INTENT(INOUT) :: name - INTEGER, INTENT(OUT) :: hdferr -!***** - INTEGER(SIZE_T) :: size_default - INTEGER(SIZE_T) :: name_len - TYPE(C_PTR) :: f_ptr - - f_ptr = C_LOC(ref) - - name_len=LEN(name) - - hdferr = h5rget_name_ptr_c(loc_id, 1, f_ptr, name, name_len, size_default) - - IF(PRESENT(size)) size = size_default - - END SUBROUTINE h5rget_name_region_f - - !****s* H5R (F03)/h5rget_name_ptr_f - ! - ! NAME - ! h5rget_name_ptr_f - ! - ! PURPOSE - ! Retrieves a name of a referenced object. - ! - ! Inputs: - ! loc_id - Identifier for the file containing the reference or for any object in that file. - ! ref_type - Type of reference. - ! ref - An object or dataset region reference. - ! - ! Outputs: - ! name - A name associated with the referenced object or dataset ptr. - ! hdferr - Returns 0 if successful and -1 if fails. - ! - ! Optional parameters: - ! size - The size of the name buffer, returning 0 (zero) if no name is associated - ! with the identifier - ! - ! AUTHOR - ! M. Scot Breitenfeld - ! March 28, 2008 - ! - ! Signature: - SUBROUTINE h5rget_name_ptr_f(loc_id, ref_type, ref, name, hdferr, size) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id - INTEGER, INTENT(IN) :: ref_type - TYPE(C_PTR), INTENT(IN) :: ref - CHARACTER(LEN=*), INTENT(INOUT) :: name - INTEGER, INTENT(OUT) :: hdferr - INTEGER(SIZE_T), OPTIONAL, INTENT(OUT) :: size -!***** - INTEGER(SIZE_T) :: size_default - INTEGER(SIZE_T) :: name_len - - name_len=LEN(name) - - hdferr = h5rget_name_ptr_c(loc_id, ref_type, ref, name, name_len, size_default) - - IF(PRESENT(size)) size = size_default - - END SUBROUTINE h5rget_name_ptr_f - - !****s* H5R (F03)/h5rget_obj_type_f - ! - ! NAME - ! h5rget_obj_type_f - ! - ! PURPOSE - ! Retrieves the type of object that an object reference points to. - ! - ! Inputs: - ! loc_id - Identifier for the dataset containing the reference or - ! for the group that dataset is in. - ! ref_type - Type of reference to query. - ! ref - Reference to query. - ! - ! Outputs: - ! obj_type - Type of referenced object. - ! H5G_UNKNOWN_F - ! H5G_GROUP_F - ! H5G_DATASET_F - ! H5G_TYPE_F - ! - ! hdferr - Returns 0 if successful and -1 if fails. - ! - ! AUTHOR - ! M. Scot Breitenfeld - ! Decemeber 17, 2008 - ! - ! Signature: - SUBROUTINE h5rget_obj_type_f(loc_id, ref_type, ref, obj_type, hdferr) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id - INTEGER, INTENT(IN) :: ref_type - TYPE(C_PTR), INTENT(IN) :: ref - INTEGER, INTENT(OUT) :: obj_type - INTEGER, INTENT(OUT) :: hdferr - !***** - - INTERFACE - INTEGER FUNCTION h5rget_obj_type_c(loc_id, ref_type, ref, obj_type) & - BIND(C, NAME='h5rget_obj_type_c') - USE, INTRINSIC :: ISO_C_BINDING, ONLY : c_ptr - USE H5GLOBAL - INTEGER(HID_T), INTENT(IN) :: loc_id - INTEGER, INTENT(IN) :: ref_type - TYPE(C_PTR), VALUE :: ref - INTEGER :: obj_type - END FUNCTION h5rget_obj_type_c - END INTERFACE - - hdferr = h5rget_obj_type_c(loc_id, ref_type, ref, obj_type) - - END SUBROUTINE h5rget_obj_type_f - -END MODULE H5R_PROVISIONAL diff --git a/fortran/src/H5Rff_F90.f90 b/fortran/src/H5Rff_F90.f90 deleted file mode 100644 index ac45857..0000000 --- a/fortran/src/H5Rff_F90.f90 +++ /dev/null @@ -1,514 +0,0 @@ -!****h* ROBODoc/H5R (F90) -! -! NAME -! MODULE H5R_PROVISIONAL -! -! FILE -! fortran/src/H5Rff_F90.f90 -! -! PURPOSE -! This file contains Fortran 90 interfaces for H5R functions. It contains -! the same functions as H5Rff_F03.f90 but excludes the Fortran 2003 functions -! and the interface listings. This file will be compiled instead of H5Rff_F03.f90 -! if Fortran 2003 functions are not enabled. -! -! 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. * -! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -! -! NOTES -! *** IMPORTANT *** -! If you add a new H5R function you must add the function name to the -! Windows dll file 'hdf5_fortrandll.def.in' in the fortran/src directory. -! This is needed for Windows based operating systems. -!***** - -MODULE H5R_PROVISIONAL - USE H5GLOBAL - -! If you change the value of these parameters, do not forget to change corresponding -! values in the H5f90.h file. -! INTEGER, PARAMETER :: REF_OBJ_BUF_LEN = 2 -! INTEGER, PARAMETER :: REF_REG_BUF_LEN = 3 -! -! TYPE hobj_ref_t_f -! INTEGER ref(REF_OBJ_BUF_LEN) -! END TYPE -! -! TYPE hdset_reg_ref_t_f -! INTEGER ref(REF_REG_BUF_LEN) -! END TYPE -! - INTERFACE h5rcreate_f - - MODULE PROCEDURE h5rcreate_object_f - MODULE PROCEDURE h5rcreate_region_f - - END INTERFACE - - INTERFACE h5rdereference_f - - MODULE PROCEDURE h5rdereference_object_f - MODULE PROCEDURE h5rdereference_region_f - - END INTERFACE - - INTERFACE h5rget_name_f - - MODULE PROCEDURE h5rget_name_object_f - MODULE PROCEDURE h5rget_name_region_f - - END INTERFACE - - INTERFACE h5rget_region_f - - MODULE PROCEDURE h5rget_region_region_f - - END INTERFACE - - -CONTAINS - - -!****s* H5R/h5rget_region_region_f -! -! NAME -! h5rget_region_region_f -! -! PURPOSE -! Retrieves a dataspace with the specified region selected -! -! INPUTS -! dset_id - identifier of the dataset containing -! reference to the regions -! ref - reference to open -! OUTPUTS -! space_id - dataspace identifier -! hdferr - Returns 0 if successful and -1 if fails -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). February 28, 2001 -! -! NOTES -! This is a module procedure for the h5rget_region_f subroutine. -! -! SOURCE - SUBROUTINE h5rget_region_region_f(dset_id, ref, space_id, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - TYPE(hdset_reg_ref_t_f), INTENT(IN) :: ref ! Dataset region reference - INTEGER(HID_T), INTENT(OUT) :: space_id ! Space identifier - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTEGER :: ref_f(REF_REG_BUF_LEN) ! Local buffer to pass reference - - INTERFACE - INTEGER FUNCTION h5rget_region_region_c(dset_id, ref_f, space_id) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5RGET_REGION_REGION_C':: h5rget_region_region_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: dset_id - ! INTEGER, PARAMETER :: REF_REG_BUF_LEN = 3 - INTEGER :: ref_f(REF_REG_BUF_LEN) - INTEGER(HID_T), INTENT(OUT) :: space_id - END FUNCTION h5rget_region_region_c - END INTERFACE - - ref_f = ref%ref - hdferr = h5rget_region_region_c(dset_id, ref_f, space_id ) - - END SUBROUTINE h5rget_region_region_f - - - -!****s* H5R (F90)/h5rcreate_object_f -! -! NAME -! h5rcreate_object_f -! -! PURPOSE -! Creates reference to the object -! -! INPUTS -! loc_id - location identifier -! name - name of the object at the specified location -! OUTPUTS -! ref - reference to the specified object -! hdferr: - error code -! Success: 0 -! Failure: -1 -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). February 28, 2001 -! -! NOTES -! This is a module procedure for the h5rcreate_f subroutine. -! -! SOURCE - SUBROUTINE h5rcreate_object_f(loc_id, name, ref, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id ! Location identifier - CHARACTER(LEN=*), INTENT(IN) :: name ! Name of the object at location specified - ! by loc_id identifier - TYPE(hobj_ref_t_f), INTENT(OUT) :: ref ! Object reference - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTEGER :: namelen ! Name length - INTEGER(HADDR_T) :: ref_f ! Local buffer to pass reference - - INTERFACE - INTEGER FUNCTION h5rcreate_object_c(ref_f, loc_id, name, namelen) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5RCREATE_OBJECT_C':: h5rcreate_object_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: name - INTEGER(HADDR_T) :: ref_f - INTEGER(HID_T), INTENT(IN) :: loc_id - CHARACTER(LEN=*), INTENT(IN) :: name - INTEGER :: namelen - END FUNCTION h5rcreate_object_c - END INTERFACE - - namelen = LEN(name) - ref_f = 0 - hdferr = h5rcreate_object_c(ref_f, loc_id, name, namelen ) - ref%ref = ref_f - - END SUBROUTINE h5rcreate_object_f - -!****s* H5R (F90)/h5rcreate_region_f -! -! NAME -! h5rcreate_region_f -! -! PURPOSE -! Creates reference to the dataset region -! -! INPUTS -! loc_id - location identifier -! name - name of the dataset at the specified location -! space_id - dataspace identifier that describes selected region -! OUTPUTS -! ref - reference to the dataset region -! hdferr: - error code -! Success: 0 -! Failure: -1 -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). February 28, 2001 -! -! NOTES -! This is a module procedure for the h5rcreate_f subroutine. -! -! SOURCE - SUBROUTINE h5rcreate_region_f(loc_id, name, space_id, ref, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id ! Location identifier - CHARACTER(LEN=*), INTENT(IN) :: name ! Name of the dataset at location specified - ! by loc_id identifier - INTEGER(HID_T), INTENT(IN) :: space_id ! Dataset's dataspace identifier - TYPE(hdset_reg_ref_t_f), INTENT(OUT) :: ref ! Dataset region reference - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTEGER :: namelen ! Name length - INTEGER :: ref_f(REF_REG_BUF_LEN) ! Local buffer to pass reference - - INTERFACE - INTEGER FUNCTION h5rcreate_region_c(ref_f, loc_id, name, namelen, space_id) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5RCREATE_REGION_C':: h5rcreate_region_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: name - ! INTEGER, PARAMETER :: REF_REG_BUF_LEN = 3 - INTEGER :: ref_f(REF_REG_BUF_LEN) - INTEGER(HID_T), INTENT(IN) :: loc_id - CHARACTER(LEN=*), INTENT(IN) :: name - INTEGER :: namelen - INTEGER(HID_T), INTENT(IN) :: space_id - END FUNCTION h5rcreate_region_c - END INTERFACE - - namelen = LEN(name) - ref_f = 0 - hdferr = h5rcreate_region_c(ref_f, loc_id, name, namelen, space_id ) - ref%ref = ref_f - - END SUBROUTINE h5rcreate_region_f -!****s* H5R (F90)/h5rdereference_object_f -! -! NAME -! h5rdereference_object_f -! -! PURPOSE -! Opens the HDF5 object referenced -! -! INPUTS -! dset_id - identifier of the dataset containing reference -! ref - reference to open -! OUTPUTS -! obj_id - object_identifier -! hdferr - error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). February 28, 2001 -! -! NOTES -! This is a module procedure for the h5rdereference_f subroutine. -! -! SOURCE - SUBROUTINE h5rdereference_object_f(dset_id, ref, obj_id, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - TYPE(hobj_ref_t_f), INTENT(IN) :: ref ! Object reference - INTEGER(HID_T), INTENT(OUT) :: obj_id ! Object identifier - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTEGER(HADDR_T) :: ref_f ! Local buffer to pass reference - - INTERFACE - INTEGER FUNCTION h5rdereference_object_c(dset_id, ref_f, obj_id) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5RDEREFERENCE_OBJECT_C':: h5rdereference_object_c - !DEC$ENDIF - ! INTEGER, PARAMETER :: REF_OBJ_BUF_LEN = 2 - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HADDR_T) :: ref_f - INTEGER(HID_T), INTENT(OUT) :: obj_id - END FUNCTION h5rdereference_object_c - END INTERFACE - - ref_f = ref%ref - hdferr = h5rdereference_object_c(dset_id, ref_f, obj_id ) - - END SUBROUTINE h5rdereference_object_f -!****s* H5R (F90)/h5rdereference_region_f -! -! NAME -! h5rdereference_region_f -! -! PURPOSE -! Opens the dataset region -! -! INPUTS -! dset_id - identifier of the dataset containing -! reference to teh regions -! ref - reference to open -! OUTPUTS -! obj_id - dataspace identifier -! hdferr - error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). February 28, 2001 -! -! NOTES -! This is a module procedure for the h5rdereference_f subroutine. -! -! SOURCE - SUBROUTINE h5rdereference_region_f(dset_id, ref, obj_id, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - TYPE(hdset_reg_ref_t_f), INTENT(IN) :: ref ! Object reference - INTEGER(HID_T), INTENT(OUT) :: obj_id ! Dataspace identifier - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTEGER :: ref_f(REF_REG_BUF_LEN) ! Local buffer to pass reference - - INTERFACE - INTEGER FUNCTION h5rdereference_region_c(dset_id, ref_f, obj_id) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5RDEREFERENCE_REGION_C':: h5rdereference_region_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: dset_id -! INTEGER, PARAMETER :: REF_REG_BUF_LEN = 3 - INTEGER :: ref_f(REF_REG_BUF_LEN) - INTEGER(HID_T), INTENT(OUT) :: obj_id - END FUNCTION h5rdereference_region_c - END INTERFACE - - ref_f = ref%ref - hdferr = h5rdereference_region_c(dset_id, ref_f, obj_id ) - - END SUBROUTINE h5rdereference_region_f -!****s* H5R (F90)/h5rget_name_object_f -! -! NAME -! h5rget_name_object_f -! -! PURPOSE -! Retrieves a name of a referenced object. -! -! INPUTS -! loc_id - Identifier for the file containing the reference or for any object in that file. -! ref - An object or dataset region reference. -! -! OUTPUTS -! name - A name associated with the referenced object or dataset region. -! -! hdferr - error code -! Success: 0 -! Failure: -1 -! -! OPTIONAL PARAMETERS -! size - The size of the name buffer, returning 0 (zero) if -! no name is associated with the identifier -! -! AUTHOR -! M. Scot Breitenfeld -! March 28, 2008 -! -! SOURCES - SUBROUTINE h5rget_name_object_f(loc_id, ref, name, hdferr, size) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id ! Identifier for the file containing the reference or - ! for any object in that file. - ! or for the group that dataset is in. - TYPE(hobj_ref_t_f), INTENT(IN) :: ref ! Object reference - INTEGER(SIZE_T), OPTIONAL, INTENT(OUT) :: size ! The size of the name buffer, - ! returning 0 (zero) if no name is associated with the identifier - CHARACTER(LEN=*), INTENT(OUT) :: name ! A name associated with the referenced object or dataset region. - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTEGER(HADDR_T) :: ref_f ! Local buffer to pass reference - - INTEGER(SIZE_T) :: size_default - INTEGER(SIZE_T) :: name_len - - INTERFACE - INTEGER FUNCTION h5rget_name_object_c(loc_id, ref_f, name, name_len, size_default) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5RGET_NAME_OBJECT_C':: h5rget_name_object_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: name - INTEGER(HID_T), INTENT(IN) :: loc_id - INTEGER(SIZE_T) :: size_default - CHARACTER(LEN=*), INTENT(OUT) :: name - INTEGER(HADDR_T) :: ref_f - - INTEGER(SIZE_T) :: name_len - END FUNCTION h5rget_name_object_c - END INTERFACE - - name_len=LEN(name) - - ref_f = ref%ref - hdferr = h5rget_name_object_c(loc_id, ref_f, name, name_len, size_default) - - IF(PRESENT(size)) size = size_default - - END SUBROUTINE h5rget_name_object_f - -!****s* H5R (F90)/h5rget_name_region_f -! -! NAME -! h5rget_name_region_f -! -! PURPOSE -! Retrieves a name of a dataset region. -! -! INPUTS -! loc_id - Identifier for the file containing the reference or -! for any object in that file. -! ref - An object or dataset region reference. -! -! OUTPUTS -! name - A name associated with the referenced object or dataset region. -! hdferr - error code -! Success: 0 -! Failure: -1 -! -! OPTIONAL PARAMETERS -! size - The size of the name buffer, returning 0 (zero) if no -! name is associated with the identifier -! -! AUTHOR -! M. Scot Breitenfeld -! March 28, 2008 -! -! SOURCE - SUBROUTINE h5rget_name_region_f(loc_id, ref, name, hdferr, size) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id - TYPE(hdset_reg_ref_t_f), INTENT(IN) :: ref - INTEGER(SIZE_T), OPTIONAL, INTENT(OUT) :: size - CHARACTER(LEN=*), INTENT(OUT) :: name - INTEGER, INTENT(OUT) :: hdferr -!***** - INTEGER :: ref_f(REF_REG_BUF_LEN) ! Local buffer to pass reference - INTEGER(SIZE_T) :: size_default - INTEGER(SIZE_T) :: name_len - - INTERFACE - INTEGER FUNCTION h5rget_name_region_c(loc_id, ref_f, name, name_len, size_default) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5RGET_NAME_REGION_C':: h5rget_name_region_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: name - INTEGER(HID_T), INTENT(IN) :: loc_id - INTEGER(SIZE_T) :: size_default - CHARACTER(LEN=*), INTENT(OUT) :: name - INTEGER :: ref_f(REF_REG_BUF_LEN) - - INTEGER(SIZE_T) :: name_len - END FUNCTION h5rget_name_region_c - END INTERFACE - - name_len=LEN(name) - - ref_f = ref%ref - hdferr = h5rget_name_region_c(loc_id, ref_f, name, name_len, size_default) - - IF(PRESENT(size)) size = size_default - - END SUBROUTINE h5rget_name_region_f - -END MODULE H5R_PROVISIONAL diff --git a/fortran/src/H5Sf.c b/fortran/src/H5Sf.c index 6947d64..67427a7 100644 --- a/fortran/src/H5Sf.c +++ b/fortran/src/H5Sf.c @@ -1,6 +1,6 @@ /****h* H5Sf/H5Sf * PURPOSE - * This file contains C stubs for H5S Fortran APIs + * This file contains C stubs for H5S Fortran APIs * * COPYRIGHT * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * @@ -26,27 +26,27 @@ /****if* H5Sf/h5screate_simple_c * NAME - * h5screate_simple_c + * h5screate_simple_c * PURPOSE - * Call H5Screate_simple to create a dataspace + * Call H5Screate_simple to create a dataspace * INPUTS - * rank - number of dimensions of dataspace - * dims - array of the size of each dimension + * rank - number of dimensions of dataspace + * dims - array of the size of each dimension maxdims - an array of the maximum size of each dimension * OUTPUTS - * space_id - identifier of the created dataspace + * space_id - identifier of the created dataspace * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * Wednesday, August 4, 1999 + * Wednesday, August 4, 1999 * HISTORY * * SOURCE */ int_f -nh5screate_simple_c ( int_f *rank, hsize_t_f *dims, hsize_t_f *maxdims, hid_t_f *space_id ) +h5screate_simple_c ( int_f *rank, hsize_t_f *dims, hsize_t_f *maxdims, hid_t_f *space_id ) /******/ { hsize_t c_dims[H5S_MAX_RANK]; @@ -75,23 +75,23 @@ done: /****if* H5Sf/h5sclose_c * NAME - * h5sclose_c + * h5sclose_c * PURPOSE - * Call H5Sclose to close the dataspace + * Call H5Sclose to close the dataspace * INPUTS - * space_id - identifier of the dataspace to be closed + * space_id - identifier of the dataspace to be closed * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * Wednesday, August 4, 1999 + * Wednesday, August 4, 1999 * HISTORY * * SOURCE */ int_f -nh5sclose_c ( hid_t_f *space_id ) +h5sclose_c ( hid_t_f *space_id ) /******/ { int ret_value = 0; @@ -104,25 +104,25 @@ nh5sclose_c ( hid_t_f *space_id ) /****if* H5Sf/h5screate_c * NAME - * h5screate_c + * h5screate_c * PURPOSE - * Call H5Screate to create a dataspace + * Call H5Screate to create a dataspace * INPUTS - * classtype - type of the dataspace class + * classtype - type of the dataspace class * OUTPUTS - * space_id - identifier of the created dataspace + * space_id - identifier of the created dataspace * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * Tuesday, August 10, 1999 + * Tuesday, August 10, 1999 * HISTORY * * SOURCE */ int_f -nh5screate_c ( int_f *classtype, hid_t_f *space_id ) +h5screate_c ( int_f *classtype, hid_t_f *space_id ) /******/ { H5S_class_t c_classtype; @@ -138,25 +138,25 @@ nh5screate_c ( int_f *classtype, hid_t_f *space_id ) /****if* H5Sf/h5scopy_c * NAME - * h5scopy_c + * h5scopy_c * PURPOSE - * Call H5Scopy to copy dataspace + * Call H5Scopy to copy dataspace * INPUTS - * space_id - identifier of the dataspace to be copied + * space_id - identifier of the dataspace to be copied * OUTPUTS - * new_space_id - identifier of the new datspace + * new_space_id - identifier of the new datspace * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * Tuesday, August 10, 1999 + * Tuesday, August 10, 1999 * HISTORY * * SOURCE */ int_f -nh5scopy_c( hid_t_f *space_id , hid_t_f *new_space_id) +h5scopy_c( hid_t_f *space_id , hid_t_f *new_space_id) /******/ { int ret_value = 0; @@ -173,28 +173,28 @@ nh5scopy_c( hid_t_f *space_id , hid_t_f *new_space_id) /****if* H5Sf/h5sget_select_hyper_nblocks_c * NAME - * h5sget_select_hyper_nblocks_c + * h5sget_select_hyper_nblocks_c * PURPOSE - * Call H5SH5Sget_select_hyper_nblocks to - * get the the number of hyperslab blocks in - * the current dataspace selection if successful + * Call H5SH5Sget_select_hyper_nblocks to + * get the the number of hyperslab blocks in + * the current dataspace selection if successful * INPUTS - * space_id - identifier of the dataspace + * space_id - identifier of the dataspace * OUTPUTS - * num_blocks - number of hyperslab blocks in - * the current dataspace selection + * num_blocks - number of hyperslab blocks in + * the current dataspace selection * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Xiangyang Su - * Friday, November 12, 1999 + * Friday, November 12, 1999 * HISTORY * * SOURCE */ int_f -nh5sget_select_hyper_nblocks_c( hid_t_f *space_id , hssize_t_f * num_blocks) +h5sget_select_hyper_nblocks_c( hid_t_f *space_id , hssize_t_f * num_blocks) /******/ { int ret_value = 0; @@ -211,28 +211,28 @@ nh5sget_select_hyper_nblocks_c( hid_t_f *space_id , hssize_t_f * num_blocks) /****if* H5Sf/h5sget_select_elem_npoints_c * NAME - * h5sget_select_elem_npoints_c + * h5sget_select_elem_npoints_c * PURPOSE - * Call H5Sget_select_elem_npoints to - * get the the number of element points in - * the current dataspace selection if successful + * Call H5Sget_select_elem_npoints to + * get the the number of element points in + * the current dataspace selection if successful * INPUTS - * space_id - identifier of the dataspace + * space_id - identifier of the dataspace * OUTPUTS - * num_points - number of element points in - * the current dataspace selection + * num_points - number of element points in + * the current dataspace selection * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Xiangyang Su - * Monday, November 15, 1999 + * Monday, November 15, 1999 * HISTORY * * SOURCE */ int_f -nh5sget_select_elem_npoints_c( hid_t_f *space_id , hssize_t_f * num_points) +h5sget_select_elem_npoints_c( hid_t_f *space_id , hssize_t_f * num_points) /******/ { int ret_value = 0; @@ -249,36 +249,36 @@ nh5sget_select_elem_npoints_c( hid_t_f *space_id , hssize_t_f * num_points) /****if* H5Sf/h5sget_select_hyper_blocklist_c * NAME - * h5sget_select_hyper_blocklist_c + * h5sget_select_hyper_blocklist_c * PURPOSE - * Call H5Sget_select_hyper_blocklist to - * get a list of the hyperslab blocks currently selected - * Starting with the startblock-th block in the - * list of blocks, num_blocks blocks are put into the user's - * buffer. If the user's buffer fills up before numblocks - * blocks are inserted, the buffer - * will contain only as many blocks as fit. + * Call H5Sget_select_hyper_blocklist to + * get a list of the hyperslab blocks currently selected + * Starting with the startblock-th block in the + * list of blocks, num_blocks blocks are put into the user's + * buffer. If the user's buffer fills up before numblocks + * blocks are inserted, the buffer + * will contain only as many blocks as fit. * INPUTS - * space_id - identifier of the dataspace - * startblock - Hyperslab block to start with - * num_blocks - number of hyperslab blocks in - * the current dataspace selection + * space_id - identifier of the dataspace + * startblock - Hyperslab block to start with + * num_blocks - number of hyperslab blocks in + * the current dataspace selection * OUTPUTS - * buf - List of hyperslab blocks selected + * buf - List of hyperslab blocks selected * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Xiangyang Su - * Monday, November 15, 1999 + * Monday, November 15, 1999 * HISTORY * - * Transpose dimension arrays because of C-FORTRAN storage order - * M. Scot Breitenfeld + * Transpose dimension arrays because of C-FORTRAN storage order + * M. Scot Breitenfeld * SOURCE */ int_f -nh5sget_select_hyper_blocklist_c( hid_t_f *space_id ,hsize_t_f *startblock, +h5sget_select_hyper_blocklist_c( hid_t_f *space_id ,hsize_t_f *startblock, hsize_t_f *num_blocks, hsize_t_f *buf) /******/ { @@ -327,31 +327,31 @@ nh5sget_select_hyper_blocklist_c( hid_t_f *space_id ,hsize_t_f *startblock, /****if* H5Sf/h5sget_select_bounds_c * NAME - * h5sget_select_bounds_c + * h5sget_select_bounds_c * PURPOSE - * Call H5Sget_select_bounds to retrieve the coordinates - * of the bounding box containing the current selection - * and places them into user-supplied buffers + * Call H5Sget_select_bounds to retrieve the coordinates + * of the bounding box containing the current selection + * and places them into user-supplied buffers * INPUTS - * space_id - identifier of the dataspace + * space_id - identifier of the dataspace * OUTPUTS - * start - Starting coordinates of the bounding box - * end - Ending coordinates of the bounding box, - * i.e., the coordinates of the diagonally opposite corne + * start - Starting coordinates of the bounding box + * end - Ending coordinates of the bounding box, + * i.e., the coordinates of the diagonally opposite corne * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Xiangyang Su - * Wednesday, November 17, 1999 + * Wednesday, November 17, 1999 * HISTORY - * swapped array bounds to account for C and Fortran reversed - * matrix notation. - * M. Scot Breitenfeld + * swapped array bounds to account for C and Fortran reversed + * matrix notation. + * M. Scot Breitenfeld * SOURCE */ int_f -nh5sget_select_bounds_c( hid_t_f *space_id , hsize_t_f * start, hsize_t_f * end) +h5sget_select_bounds_c( hid_t_f *space_id , hsize_t_f * start, hsize_t_f * end) /******/ { hid_t c_space_id; @@ -379,34 +379,34 @@ done: /****if* H5Sf/h5sget_select_elem_pointlist_c * NAME - * h5sget_select_elem_pointlist_c + * h5sget_select_elem_pointlist_c * PURPOSE - * Call H5Sget_select_elem_pointlist - * get a list of element points in the - * current dataspace selectin. - * Starting with the startpoint-th point in the - * list of points, numpoints points are put into the user's - * buffer. If the user's buffer fills up before numpoints - * points are inserted, the buffer - * will contain only as many points as fit. + * Call H5Sget_select_elem_pointlist + * get a list of element points in the + * current dataspace selectin. + * Starting with the startpoint-th point in the + * list of points, numpoints points are put into the user's + * buffer. If the user's buffer fills up before numpoints + * points are inserted, the buffer + * will contain only as many points as fit. * INPUTS - * space_id - identifier of the dataspace - * startpoint - Element point to start with - * numpoints - Number of element points to get + * space_id - identifier of the dataspace + * startpoint - Element point to start with + * numpoints - Number of element points to get * OUTPUTS - * buf - List of element points selected + * buf - List of element points selected * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Xiangyang Su - * Wednesday, November 17, 1999 + * Wednesday, November 17, 1999 * HISTORY * * SOURCE */ int_f -nh5sget_select_elem_pointlist_c( hid_t_f *space_id ,hsize_t_f * startpoint, +h5sget_select_elem_pointlist_c( hid_t_f *space_id ,hsize_t_f * startpoint, hsize_t_f * numpoints, hsize_t_f * buf) /******/ { @@ -451,23 +451,23 @@ nh5sget_select_elem_pointlist_c( hid_t_f *space_id ,hsize_t_f * startpoint, /****if* H5Sf/h5sselect_all_c * NAME - * h5sselect_all_c + * h5sselect_all_c * PURPOSE - * Call H5Sselect_all to select entire dataspace + * Call H5Sselect_all to select entire dataspace * INPUTS - * space_id - identifier of the dataspace + * space_id - identifier of the dataspace * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * Tuesday, August 10, 1999 + * Tuesday, August 10, 1999 * HISTORY * * SOURCE */ int_f -nh5sselect_all_c ( hid_t_f *space_id ) +h5sselect_all_c ( hid_t_f *space_id ) /******/ { int ret_value = 0; @@ -480,23 +480,23 @@ nh5sselect_all_c ( hid_t_f *space_id ) /****if* H5Sf/h5sselect_none_c * NAME - * h5sselect_none_c + * h5sselect_none_c * PURPOSE - * Call H5Sselect_none to reset the selection region + * Call H5Sselect_none to reset the selection region * INPUTS - * space_id - identifier of the dataspace + * space_id - identifier of the dataspace * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * Tuesday, August 10, 1999 + * Tuesday, August 10, 1999 * HISTORY * * SOURCE */ int_f -nh5sselect_none_c ( hid_t_f *space_id ) +h5sselect_none_c ( hid_t_f *space_id ) /******/ { int ret_value = 0; @@ -509,27 +509,27 @@ nh5sselect_none_c ( hid_t_f *space_id ) /****if* H5Sf/h5sselect_valid_c * NAME - * h5sselect_valid_c + * h5sselect_valid_c * PURPOSE - * Call H5Sselect_valid to verify that selection - * is within dataspace extent. + * Call H5Sselect_valid to verify that selection + * is within dataspace extent. * INPUTS - * space_id - identifier of the dataspace + * space_id - identifier of the dataspace * OUTPUTS - * flag - 0 if not valid selection, 1 if is valid selection, - * and negative on failure. + * flag - 0 if not valid selection, 1 if is valid selection, + * and negative on failure. * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * Tuesday, August 10, 1999 + * Tuesday, August 10, 1999 * HISTORY * * SOURCE */ int_f -nh5sselect_valid_c ( hid_t_f *space_id , int_f *flag ) +h5sselect_valid_c ( hid_t_f *space_id , int_f *flag ) /******/ { int ret_value = 0; @@ -545,26 +545,26 @@ nh5sselect_valid_c ( hid_t_f *space_id , int_f *flag ) /****if* H5Sf/h5sget_simple_extent_npoints_c * NAME - * h5sget_simple_extent_npoints_c + * h5sget_simple_extent_npoints_c * PURPOSE - * Call H5Sget_simple_extent_npoints to determine the number - * of elements in a dataspace + * Call H5Sget_simple_extent_npoints to determine the number + * of elements in a dataspace * INPUTS - * space_id - identifier of the dataspace + * space_id - identifier of the dataspace * OUTPUTS - * npoints - number of points in a dataspace + * npoints - number of points in a dataspace * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * Wednesday, August 11, 1999 + * Wednesday, August 11, 1999 * HISTORY * * SOURCE */ int_f -nh5sget_simple_extent_npoints_c ( hid_t_f *space_id , hsize_t_f *npoints ) +h5sget_simple_extent_npoints_c ( hid_t_f *space_id , hsize_t_f *npoints ) /******/ { int ret_value = 0; @@ -580,26 +580,26 @@ nh5sget_simple_extent_npoints_c ( hid_t_f *space_id , hsize_t_f *npoints ) /****if* H5Sf/h5sget_select_npoints_c * NAME - * h5sget_select_npoints_c + * h5sget_select_npoints_c * PURPOSE - * Call H5Sget_select_npoints to determine the number - * of elements in a dataspace selection + * Call H5Sget_select_npoints to determine the number + * of elements in a dataspace selection * INPUTS - * space_id - identifier of the dataspace + * space_id - identifier of the dataspace * OUTPUTS - * npoints - number of points in a dataspace selection + * npoints - number of points in a dataspace selection * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * Wednesday, August 11, 1999 + * Wednesday, August 11, 1999 * HISTORY * * SOURCE */ int_f -nh5sget_select_npoints_c ( hid_t_f *space_id , hssize_t_f *npoints ) +h5sget_select_npoints_c ( hid_t_f *space_id , hssize_t_f *npoints ) /******/ { int ret_value = 0; @@ -615,26 +615,26 @@ nh5sget_select_npoints_c ( hid_t_f *space_id , hssize_t_f *npoints ) /****if* H5Sf/h5sget_simple_extent_ndims_c * NAME - * h5sget_simple_extent_ndims_c + * h5sget_simple_extent_ndims_c * PURPOSE - * Call H5Sget_simple_extent_ndims to determine the number - * dimensions + * Call H5Sget_simple_extent_ndims to determine the number + * dimensions * INPUTS - * space_id - identifier of the dataspace + * space_id - identifier of the dataspace * OUTPUTS - * rank - number of dataspace dimensions + * rank - number of dataspace dimensions * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * Wednesday, August 11, 1999 + * Wednesday, August 11, 1999 * HISTORY * * SOURCE */ int_f -nh5sget_simple_extent_ndims_c ( hid_t_f *space_id , int_f *ndims ) +h5sget_simple_extent_ndims_c ( hid_t_f *space_id , int_f *ndims ) /******/ { int ret_value = 0; @@ -650,27 +650,27 @@ nh5sget_simple_extent_ndims_c ( hid_t_f *space_id , int_f *ndims ) /****if* H5Sf/h5sget_simple_extent_type_c * NAME - * h5sget_simple_extent_type_c + * h5sget_simple_extent_type_c * PURPOSE - * Call H5Sget_simple_extent_type to determine the class type - * of a dataspace + * Call H5Sget_simple_extent_type to determine the class type + * of a dataspace * INPUTS - * space_id - identifier of the dataspace + * space_id - identifier of the dataspace * OUTPUTS - * classtype - class type; possible values are: + * classtype - class type; possible values are: * H5S_SCALAR_F (0), H5S_SIMPLE_F (1), H5S_NULL_F (2) * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * Wednesday, August 11, 1999 + * Wednesday, August 11, 1999 * HISTORY * * SOURCE */ int_f -nh5sget_simple_extent_type_c ( hid_t_f *space_id , int_f *classtype) +h5sget_simple_extent_type_c ( hid_t_f *space_id , int_f *classtype) /******/ { int ret_value = 0; @@ -691,25 +691,25 @@ nh5sget_simple_extent_type_c ( hid_t_f *space_id , int_f *classtype) /****if* H5Sf/h5soffset_simple_c * NAME - * h5soffset_simple_c + * h5soffset_simple_c * PURPOSE - * Call H5Soffset_simple to set the offset of a simple - * dataspace + * Call H5Soffset_simple to set the offset of a simple + * dataspace * INPUTS - * space_id - identifier of the dataspace - * offset - offset array + * space_id - identifier of the dataspace + * offset - offset array * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * Wednesday, August 11, 1999 + * Wednesday, August 11, 1999 * HISTORY * * SOURCE */ int_f -nh5soffset_simple_c ( hid_t_f *space_id , hssize_t_f *offset) +h5soffset_simple_c ( hid_t_f *space_id , hssize_t_f *offset) /******/ { hid_t c_space_id; @@ -738,27 +738,27 @@ done: /****if* H5Sf/h5sset_extent_simple_c * NAME - * h5sset_extent_simple_c + * h5sset_extent_simple_c * PURPOSE - * Call H5Sset_extent_simple to set or reset size of - * existing dataspace + * Call H5Sset_extent_simple to set or reset size of + * existing dataspace * INPUTS - * space_id - identifier of the dataspace - * rank - dataspace rank - * current_size - array with the new dimension sizes - * maximum_size - aray with maximum sizes of dimensions + * space_id - identifier of the dataspace + * rank - dataspace rank + * current_size - array with the new dimension sizes + * maximum_size - aray with maximum sizes of dimensions * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * Wednesday, August 11, 1999 + * Wednesday, August 11, 1999 * HISTORY * * SOURCE */ int_f -nh5sset_extent_simple_c ( hid_t_f *space_id , int_f *rank, hsize_t_f *current_size, hsize_t_f *maximum_size) +h5sset_extent_simple_c ( hid_t_f *space_id , int_f *rank, hsize_t_f *current_size, hsize_t_f *maximum_size) /******/ { hsize_t c_current_size[H5S_MAX_RANK]; @@ -784,27 +784,27 @@ done: /****if* H5Sf/h5sget_simple_extent_dims_c * NAME - * h5sget_simple_extent_dims_c + * h5sget_simple_extent_dims_c * PURPOSE - * Call H5Sget_simple_extent_dims to retrieve sizes of an - * existing dataspace + * Call H5Sget_simple_extent_dims to retrieve sizes of an + * existing dataspace * INPUTS - * space_id - identifier of the dataspace + * space_id - identifier of the dataspace * OUTPUTS - * dims - array with the dimension sizes - * maxdims - aray with maximum sizes of dimensions + * dims - array with the dimension sizes + * maxdims - aray with maximum sizes of dimensions * RETURNS - * number of dataspace dimensions (rank) on success, -1 on failure + * number of dataspace dimensions (rank) on success, -1 on failure * AUTHOR * Elena Pourmal - * Wednesday, August 11, 1999 + * Wednesday, August 11, 1999 * HISTORY * * SOURCE */ int_f -nh5sget_simple_extent_dims_c ( hid_t_f *space_id , hsize_t_f *dims, hsize_t_f *maxdims) +h5sget_simple_extent_dims_c ( hid_t_f *space_id , hsize_t_f *dims, hsize_t_f *maxdims) /******/ { hid_t c_space_id; @@ -838,27 +838,27 @@ done: /****if* H5Sf/h5sis_simple_c * NAME - * h5sis_simple_c + * h5sis_simple_c * PURPOSE - * Call H5Sis_simple to detrmine if the dataspace - * is simple. + * Call H5Sis_simple to detrmine if the dataspace + * is simple. * INPUTS - * space_id - identifier of the dataspace + * space_id - identifier of the dataspace * OUTPUTS - * flag - 0 if not simple, 1 if is simple, - * and negative on failure. + * flag - 0 if not simple, 1 if is simple, + * and negative on failure. * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * Wednesday, August 11, 1999 + * Wednesday, August 11, 1999 * HISTORY * * SOURCE */ int_f -nh5sis_simple_c ( hid_t_f *space_id , int_f *flag ) +h5sis_simple_c ( hid_t_f *space_id , int_f *flag ) /******/ { int ret_value = 0; @@ -875,24 +875,24 @@ nh5sis_simple_c ( hid_t_f *space_id , int_f *flag ) /****if* H5Sf/h5sextent_copy_c * NAME - * h5sextent_copy_c + * h5sextent_copy_c * PURPOSE - * Call H5Sextent_copy to copy an extent of dataspace + * Call H5Sextent_copy to copy an extent of dataspace * INPUTS - * dest_space_id - identifier of the destination dataspace - * source_space_id - identifier of the source dataspace + * dest_space_id - identifier of the destination dataspace + * source_space_id - identifier of the source dataspace * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * Wednesday, August 11, 1999 + * Wednesday, August 11, 1999 * HISTORY * * SOURCE */ int_f -nh5sextent_copy_c ( hid_t_f *dest_space_id , hid_t_f *source_space_id) +h5sextent_copy_c ( hid_t_f *dest_space_id , hid_t_f *source_space_id) /******/ { int ret_value = 0; @@ -908,23 +908,23 @@ nh5sextent_copy_c ( hid_t_f *dest_space_id , hid_t_f *source_space_id) /****if* H5Sf/h5sset_extent_none_c * NAME - * h5sset_extent_none_c + * h5sset_extent_none_c * PURPOSE - * Call H5Sset_extent_none to remove extent from a dataspace + * Call H5Sset_extent_none to remove extent from a dataspace * INPUTS - * space_id - dataspace identifier + * space_id - dataspace identifier * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * Wednesday, August 11, 1999 + * Wednesday, August 11, 1999 * HISTORY * * SOURCE */ int_f -nh5sset_extent_none_c ( hid_t_f *space_id ) +h5sset_extent_none_c ( hid_t_f *space_id ) /******/ { int ret_value = 0; @@ -939,30 +939,30 @@ nh5sset_extent_none_c ( hid_t_f *space_id ) /****if* H5Sf/h5sselect_hyperslab_c * NAME - * h5sselect_hyperslab_c + * h5sselect_hyperslab_c * PURPOSE - * Call H5Sselect_hyperslab to select a hyperslab + * Call H5Sselect_hyperslab to select a hyperslab * INPUTS - * space_id - identifier of the dataspace - * operator - defines how the new selection is combined - * with the previous one; current values are + * space_id - identifier of the dataspace + * operator - defines how the new selection is combined + * with the previous one; current values are * H5S_SELECT_SET_F (0) and H5S_SELECT_OR_F (1) - * start - offset of start of hyperslab - * count - number of blocks included in the hyperslab - * stride - hyperslab stride (interval between blocks) - * block - size of block in the hyperslab + * start - offset of start of hyperslab + * count - number of blocks included in the hyperslab + * stride - hyperslab stride (interval between blocks) + * block - size of block in the hyperslab * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * Wednesday, August 11, 1999 + * Wednesday, August 11, 1999 * HISTORY * * SOURCE */ int_f -nh5sselect_hyperslab_c ( hid_t_f *space_id , int_f *op, hsize_t_f *start, hsize_t_f *count, hsize_t_f *stride, hsize_t_f *block) +h5sselect_hyperslab_c ( hid_t_f *space_id , int_f *op, hsize_t_f *start, hsize_t_f *count, hsize_t_f *stride, hsize_t_f *block) /******/ { hsize_t c_start[H5S_MAX_RANK]; @@ -1000,30 +1000,30 @@ done: #ifdef NEW_HYPERSLAB_API /****if* H5Sf/h5scombine_hyperslab_c * NAME - * h5scombine_hyperslab_c + * h5scombine_hyperslab_c * PURPOSE - * Call H5Scombine_hyperslab + * Call H5Scombine_hyperslab * INPUTS - * space_id - identifier of the dataspace - * operator - defines how the new selection is combined - * start - offset of start of hyperslab - * count - number of blocks included in the hyperslab - * stride - hyperslab stride (interval between blocks) - * block - size of block in the hyperslab + * space_id - identifier of the dataspace + * operator - defines how the new selection is combined + * start - offset of start of hyperslab + * count - number of blocks included in the hyperslab + * stride - hyperslab stride (interval between blocks) + * block - size of block in the hyperslab * OUTPUTS - * hyper_id - identifier for the new dataspace + * hyper_id - identifier for the new dataspace * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * Monday, October 7, 2002 + * Monday, October 7, 2002 * HISTORY * * SOURCE */ int_f -nh5scombine_hyperslab_c ( hid_t_f *space_id , int_f *op, hsize_t_f *start, hsize_t_f *count, hsize_t_f *stride, hsize_t_f *block, hid_t_f *hyper_id) +h5scombine_hyperslab_c ( hid_t_f *space_id , int_f *op, hsize_t_f *start, hsize_t_f *count, hsize_t_f *stride, hsize_t_f *block, hid_t_f *hyper_id) /******/ { int ret_value = -1; @@ -1082,27 +1082,27 @@ DONE: } /****if* H5Sf/h5scombine_select_c * NAME - * h5scombine_select_c + * h5scombine_select_c * PURPOSE - * Call H5Scombine_ select + * Call H5Scombine_ select * INPUTS - * space1_id - identifier of the first dataspace - * operator - defines how the new selection is combined - * space2_id - identifier of the second dataspace + * space1_id - identifier of the first dataspace + * operator - defines how the new selection is combined + * space2_id - identifier of the second dataspace * OUTPUTS - * ds_id - identifier for the new dataspace + * ds_id - identifier for the new dataspace * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * Monday, October 7, 2002 + * Monday, October 7, 2002 * HISTORY * * SOURCE */ int_f -nh5scombine_select_c ( hid_t_f *space1_id , int_f *op, hid_t_f *space2_id, hid_t_f *ds_id) +h5scombine_select_c ( hid_t_f *space1_id , int_f *op, hid_t_f *space2_id, hid_t_f *ds_id) /******/ { int ret_value = -1; @@ -1123,25 +1123,25 @@ nh5scombine_select_c ( hid_t_f *space1_id , int_f *op, hid_t_f *space2_id, hid_t } /****if* H5Sf/h5sselect_select_c * NAME - * h5sselect_select_c + * h5sselect_select_c * PURPOSE - * Call H5Sselect_ select + * Call H5Sselect_ select * INPUTS - * space1_id - identifier of the first dataspace to modify - * operator - defines how the new selection is combined - * space2_id - identifier of the second dataspace + * space1_id - identifier of the first dataspace to modify + * operator - defines how the new selection is combined + * space2_id - identifier of the second dataspace * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * Monday, October 7, 2002 + * Monday, October 7, 2002 * HISTORY * * SOURCE */ int_f -nh5sselect_select_c ( hid_t_f *space1_id , int_f *op, hid_t_f *space2_id) +h5sselect_select_c ( hid_t_f *space1_id , int_f *op, hid_t_f *space2_id) /******/ { int ret_value = -1; @@ -1160,24 +1160,24 @@ nh5sselect_select_c ( hid_t_f *space1_id , int_f *op, hid_t_f *space2_id) #endif /*NEW_HYPERSLAB_API*/ /****if* H5Sf/h5sget_select_type_c * NAME - * h5sget_select_type_c + * h5sget_select_type_c * PURPOSE - * Call H5Sget_select_type + * Call H5Sget_select_type * INPUTS - * space_id - identifier of the dataspace + * space_id - identifier of the dataspace * OUTPUTS - * type - type of selection + * type - type of selection * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * Monday, October 7, 2002 + * Monday, October 7, 2002 * HISTORY * * SOURCE */ int_f -nh5sget_select_type_c ( hid_t_f *space_id , int_f *type) +h5sget_select_type_c ( hid_t_f *space_id , int_f *type) /******/ { int ret_value = -1; @@ -1195,28 +1195,28 @@ nh5sget_select_type_c ( hid_t_f *space_id , int_f *type) /****if* H5Sf/h5sselect_elements_c * NAME - * h5sselect_elements_c + * h5sselect_elements_c * PURPOSE - * Call H5Sselect_elements to select elements of a dataspace + * Call H5Sselect_elements to select elements of a dataspace * INPUTS - * space_id - identifier of the dataspace - * operator - defines how the new selection is combined - * with the previous one; current values are + * space_id - identifier of the dataspace + * operator - defines how the new selection is combined + * with the previous one; current values are * H5S_SELECT_SET_F (0) - * nelements - number of elements in the selection - * coord - arrays with the elements coordinates + * nelements - number of elements in the selection + * coord - arrays with the elements coordinates * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * Wednesday, August 11, 1999 + * Wednesday, August 11, 1999 * HISTORY * * SOURCE */ int_f -nh5sselect_elements_c ( hid_t_f *space_id , int_f *op, size_t_f *nelements, hsize_t_f *coord) +h5sselect_elements_c ( hid_t_f *space_id , int_f *op, size_t_f *nelements, hsize_t_f *coord) /******/ { int ret_value = -1; @@ -1251,28 +1251,28 @@ nh5sselect_elements_c ( hid_t_f *space_id , int_f *op, size_t_f *nelements, hsi /****if* H5Sf/h5sdecode_c * NAME - * h5sdecode_c + * h5sdecode_c * PURPOSE - * Call H5Sdecode + * Call H5Sdecode * INPUTS * * buf - Buffer for the data space object to be decoded. * OUTPUTS * - * obj_id - Object_id (non-negative) + * obj_id - Object_id (non-negative) * * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * M. Scot Breitenfeld - * March 26, 2008 + * March 26, 2008 * HISTORY * * SOURCE */ int_f -nh5sdecode_c ( _fcd buf, hid_t_f *obj_id ) +h5sdecode_c ( _fcd buf, hid_t_f *obj_id ) /******/ { int ret_value = -1; @@ -1297,26 +1297,26 @@ nh5sdecode_c ( _fcd buf, hid_t_f *obj_id ) /****if* H5Sf/h5sencode_c * NAME - * h5sencode_c + * h5sencode_c * PURPOSE - * Call H5Sencode + * Call H5Sencode * INPUTS * - * obj_id - Identifier of the object to be encoded. + * obj_id - Identifier of the object to be encoded. * buf - Buffer for the object to be encoded into. - * nalloc - The size of the allocated buffer. + * nalloc - The size of the allocated buffer. * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * M. Scot Breitenfeld - * March 26, 2008 + * March 26, 2008 * HISTORY * * SOURCE */ int_f -nh5sencode_c (_fcd buf, hid_t_f *obj_id, size_t_f *nalloc ) +h5sencode_c (_fcd buf, hid_t_f *obj_id, size_t_f *nalloc ) /******/ { int ret_value = -1; @@ -1366,28 +1366,28 @@ nh5sencode_c (_fcd buf, hid_t_f *obj_id, size_t_f *nalloc ) /****if* H5Sf/h5sextent_equal_c * NAME - * h5sextent_equal_c + * h5sextent_equal_c * PURPOSE - * Call H5Sextent_equal + * Call H5Sextent_equal * INPUTS * * space1_id - First dataspace identifier. - * space2_id - Second dataspace identifier. + * space2_id - Second dataspace identifier. * OUTPUTS * - * equal - TRUE if equal, FALSE if unequal. + * equal - TRUE if equal, FALSE if unequal. * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * M. Scot Breitenfeld - * April 4, 2008 + * April 4, 2008 * HISTORY * * SOURCE */ int_f -nh5sextent_equal_c ( hid_t_f * space1_id, hid_t_f *space2_id, hid_t_f *c_equal) +h5sextent_equal_c ( hid_t_f * space1_id, hid_t_f *space2_id, hid_t_f *c_equal) /******/ { int ret_value = -1; diff --git a/fortran/src/H5Sff.F90 b/fortran/src/H5Sff.F90 new file mode 100644 index 0000000..aeb3314 --- /dev/null +++ b/fortran/src/H5Sff.F90 @@ -0,0 +1,1754 @@ +!****h* ROBODoc/H5S +! +! NAME +! MODULE H5S +! +! FILE +! fortran/src/H5Sff.f90 +! +! PURPOSE +! This file contains Fortran interfaces for H5S functions. +! +! 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. * +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! +! NOTES +! +! _____ __ __ _____ ____ _____ _______ _ _ _______ +! |_ _| \/ | __ \ / __ \| __ \__ __|/\ | \ | |__ __| +! **** | | | \ / | |__) | | | | |__) | | | / \ | \| | | | **** +! **** | | | |\/| | ___/| | | | _ / | | / /\ \ | . ` | | | **** +! **** _| |_| | | | | | |__| | | \ \ | |/ ____ \| |\ | | | **** +! |_____|_| |_|_| \____/|_| \_\ |_/_/ \_\_| \_| |_| +! +! If you add a new H5S function you must add the function name to the +! Windows dll file 'hdf5_fortrandll.def.in' in the fortran/src directory. +! This is needed for Windows based operating systems. +! +!***** + +MODULE H5S + USE, INTRINSIC :: ISO_C_BINDING, ONLY : C_PTR, C_CHAR + USE H5GLOBAL + +CONTAINS +! +!****s* H5S/h5screate_simple_f +! +! NAME +! h5screate_simple_f +! +! PURPOSE +! Creates a new simple data space and opens it for access . +! +! INPUTS +! rank - number of dimensions +! dims - an array of the size of each dimension +! OUTPUTS +! space_id - dataspace identifier +! hdferr - Returns 0 if successful and -1 if fails +! OPTIONAL PARAMETERS +! maxdims - an array of the maximum size of each dimension +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 6, 2001 +! SOURCE + SUBROUTINE h5screate_simple_f(rank, dims, space_id, hdferr, maxdims) + + IMPLICIT NONE + INTEGER, INTENT(IN) :: rank + INTEGER(HSIZE_T), INTENT(IN) :: dims(rank) + INTEGER(HID_T), INTENT(OUT) :: space_id + INTEGER, INTENT(OUT) :: hdferr + INTEGER(HSIZE_T), OPTIONAL, INTENT(IN) :: maxdims(rank) +!***** + INTEGER(HSIZE_T), ALLOCATABLE, DIMENSION(:) :: f_maxdims + + INTERFACE + INTEGER FUNCTION h5screate_simple_c(rank, dims, maxdims, space_id) BIND(C,NAME='h5screate_simple_c') + IMPORT :: HID_T, HSIZE_T + IMPLICIT NONE + INTEGER, INTENT(IN) :: rank + INTEGER(HSIZE_T), INTENT(IN) :: dims(rank) + INTEGER(HSIZE_T), DIMENSION(:),INTENT(IN) :: maxdims(rank) + INTEGER(HID_T), INTENT(OUT) :: space_id + END FUNCTION h5screate_simple_c + END INTERFACE + + ALLOCATE (f_maxdims(rank), stat=hdferr) + IF (hdferr .NE. 0) THEN + hdferr = -1 + RETURN + ENDIF + IF (PRESENT(maxdims)) THEN + f_maxdims = maxdims + ELSE + f_maxdims = dims + ENDIF + hdferr = h5screate_simple_c(rank, dims, f_maxdims, space_id) + DEALLOCATE(f_maxdims) + + END SUBROUTINE h5screate_simple_f + +! +!****s* H5S/h5sclose_f +! +! NAME +! h5sclose_f +! +! PURPOSE +! Releases and terminates access to a dataspace. +! +! INPUTS +! space_id - identifier of dataspace to release +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 6, 2001 +! +! SOURCE + SUBROUTINE h5sclose_f(space_id, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + INTERFACE + INTEGER FUNCTION h5sclose_c(space_id) BIND(C,NAME='h5sclose_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: space_id + END FUNCTION h5sclose_c + END INTERFACE + + hdferr = h5sclose_c(space_id) + + END SUBROUTINE h5sclose_f + +! +!****s* H5S/h5screate_f +! +! NAME +! h5screate_f +! +! PURPOSE +! Creates a new dataspace of a specified type. +! +! INPUTS +! classtype - The type of the dataspace to be created +! Possible values are: +! H5S_SCALAR_F +! H5S_SIMPLE_F +! H5S_NULL_F +! OUTPUTS +! space_id - Dataspace identifier +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 6, 2001 +! +! NOTES +! + +! SOURCE + SUBROUTINE h5screate_f(classtype, space_id, hdferr) + IMPLICIT NONE + INTEGER, INTENT(IN) :: classtype + INTEGER(HID_T), INTENT(OUT) :: space_id + INTEGER, INTENT(OUT) :: hdferr +!***** + INTERFACE + INTEGER FUNCTION h5screate_c(classtype, space_id) BIND(C,NAME='h5screate_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER, INTENT(IN) :: classtype + INTEGER(HID_T), INTENT(OUT) :: space_id + END FUNCTION h5screate_c + END INTERFACE + + hdferr = h5screate_c(classtype, space_id) + + END SUBROUTINE h5screate_f + +! +!****s* H5S/h5scopy_f +! +! NAME +! h5scopy_f +! +! PURPOSE +! Creates an exact copy of a dataspace. +! +! INPUTS +! space_id - dataspace identifier +! OUTPUTS +! new_space_id - identifier of dataspace's copy +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 6, 2001 +! +! NOTES +! + +! SOURCE + SUBROUTINE h5scopy_f(space_id, new_space_id, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: space_id + INTEGER(HID_T), INTENT(OUT) :: new_space_id + INTEGER, INTENT(OUT) :: hdferr +!***** + INTERFACE + INTEGER FUNCTION h5scopy_c(space_id, new_space_id) BIND(C,NAME='h5scopy_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: space_id + INTEGER(HID_T), INTENT(OUT):: new_space_id + END FUNCTION h5scopy_c + END INTERFACE + + hdferr = h5scopy_c(space_id, new_space_id) + + END SUBROUTINE h5scopy_f + +! +!****s* H5S/h5sget_select_hyper_nblocks_f +! +! NAME +! h5sget_select_hyper_nblocks_f +! +! PURPOSE +! Get number of hyperslab blocks. +! +! INPUTS +! space_id - dataspace identifier +! OUTPUTS +! num_blocks - number of hyperslab blocks in the current +! hyperslab selection +! hdferr - Returns 0 if successful and -1 if fails +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 6, 2001 +! +! SOURCE + SUBROUTINE h5sget_select_hyper_nblocks_f(space_id, num_blocks, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: space_id + INTEGER(HSSIZE_T), INTENT(OUT) :: num_blocks + INTEGER, INTENT(OUT) :: hdferr +!***** + INTERFACE + INTEGER FUNCTION h5sget_select_hyper_nblocks_c (space_id, num_blocks) & + BIND(C,NAME='h5sget_select_hyper_nblocks_c') + IMPORT :: HID_T, HSSIZE_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: space_id + INTEGER(HSSIZE_T), INTENT(OUT) :: num_blocks + END FUNCTION h5sget_select_hyper_nblocks_c + END INTERFACE + + hdferr = h5sget_select_hyper_nblocks_c (space_id, num_blocks) + + END SUBROUTINE h5sget_select_hyper_nblocks_f + +! +!****s* H5S/h5sget_select_hyper_blocklist_f +! +! NAME +! h5sget_select_hyper_blocklist_f +! +! PURPOSE +! Gets the list of hyperslab blocks currently selected. +! +! INPUTS +! space_id - dataspace identifier +! startblock - hyperslab block to start with +! num_blocks - number of blocks to get +! OUTPUTS +! buf - buffer to hold block list +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 6, 2001 +! SOURCE + SUBROUTINE h5sget_select_hyper_blocklist_f(space_id, startblock, & + num_blocks, buf, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: space_id + INTEGER(HSIZE_T), INTENT(IN) :: startblock + INTEGER(HSIZE_T), INTENT(IN) :: num_blocks + INTEGER(HSIZE_T), DIMENSION(*), INTENT(OUT) :: buf + INTEGER, INTENT(OUT) :: hdferr +!***** + INTERFACE + INTEGER FUNCTION h5sget_select_hyper_blocklist_c(space_id, startblock, & + num_blocks, buf ) BIND(C,NAME='h5sget_select_hyper_blocklist_c') + IMPORT :: HID_T, HSIZE_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: space_id + INTEGER(HSIZE_T), INTENT(IN) :: startblock + INTEGER(HSIZE_T), INTENT(IN) :: num_blocks + INTEGER(HSIZE_T), DIMENSION(*), INTENT(OUT) :: buf + END FUNCTION h5sget_select_hyper_blocklist_c + END INTERFACE + + hdferr = h5sget_select_hyper_blocklist_c(space_id, startblock, num_blocks, buf ) + + END SUBROUTINE h5sget_select_hyper_blocklist_f + +! +!****s* H5S/h5sget_select_bounds_f +! +! NAME +! h5sget_select_bounds_f +! +! PURPOSE +! Gets the bounding box containing the current selection. +! +! INPUTS +! space_id - dataspace identifier +! +! OUTPUTS +! start - starting coordinates of bounding box +! end - ending coordinates of bounding box +! i.e., the coordinates of the diagonally opposite corner +! hdferr - Returns 0 if successful and -1 if fails +! OPTIONAL PARAMETERS +! NONE +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 6, 2001 +! SOURCE + SUBROUTINE h5sget_select_bounds_f(space_id, start, END, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: space_id + INTEGER(HSIZE_T), DIMENSION(*), INTENT(OUT) :: start + INTEGER(HSIZE_T), DIMENSION(*), INTENT(OUT) :: END + INTEGER, INTENT(OUT) :: hdferr +!***** + INTERFACE + INTEGER FUNCTION h5sget_select_bounds_c(space_id, start, end) & + BIND(C,NAME='h5sget_select_bounds_c') + IMPORT :: HID_T, HSIZE_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: space_id + INTEGER(HSIZE_T), DIMENSION(*), INTENT(OUT) :: start + INTEGER(HSIZE_T), DIMENSION(*), INTENT(OUT) :: END + END FUNCTION h5sget_select_bounds_c + END INTERFACE + + hdferr = h5sget_select_bounds_c(space_id, start, END) + + END SUBROUTINE h5sget_select_bounds_f + +! +!****s* H5S/h5sget_select_elem_npoints_f +! +! NAME +! h5sget_select_elem_npoints_f +! +! PURPOSE +! Gets the number of element points in the current selection +! +! INPUTS +! space_id - dataspace identifier +! OUTPUTS +! num_points - number of element points in the current +! dataspace selection +! hdferr - Returns 0 if successful and -1 if fails +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 6, 2001 +! +! SOURCE + SUBROUTINE h5sget_select_elem_npoints_f(space_id, num_points, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: space_id + INTEGER(HSSIZE_T), INTENT(OUT) :: num_points + INTEGER, INTENT(OUT) :: hdferr +!***** + INTERFACE + INTEGER FUNCTION h5sget_select_elem_npoints_c (space_id, num_points) BIND(C,NAME='h5sget_select_elem_npoints_c') + IMPORT :: HID_T, HSSIZE_T + INTEGER(HID_T), INTENT(IN) :: space_id + INTEGER(HSSIZE_T), INTENT(OUT) :: num_points + END FUNCTION h5sget_select_elem_npoints_c + END INTERFACE + + hdferr = h5sget_select_elem_npoints_c (space_id, num_points) + + END SUBROUTINE h5sget_select_elem_npoints_f + +! +!****s* H5S/h5sget_select_elem_pointlist_f +! +! NAME +! h5sget_select_elem_pointlist_f +! +! PURPOSE +! Gets the list of element points currently selected. +! +! INPUTS +! space_id - dataspace identifier +! startpoint - element point to start with +! num_points - number of elemnt points to get +! OUTPUTS +! buf - buffer with element points selected +! hdferr - Returns 0 if successful and -1 if fails +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 6, 2001 +! +! SOURCE + SUBROUTINE h5sget_select_elem_pointlist_f(space_id, startpoint, & + num_points, buf, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: space_id + INTEGER(HSIZE_T), INTENT(IN) :: startpoint + INTEGER(HSIZE_T), INTENT(IN) :: num_points + INTEGER(HSIZE_T), DIMENSION(*), INTENT(OUT) :: buf + INTEGER, INTENT(OUT) :: hdferr +!***** + INTERFACE + INTEGER FUNCTION h5sget_select_elem_pointlist_c(space_id, startpoint, & + num_points, buf ) BIND(C,NAME='h5sget_select_elem_pointlist_c') + IMPORT :: HID_T, HSIZE_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: space_id + INTEGER(HSIZE_T), INTENT(IN) :: startpoint + INTEGER(HSIZE_T), INTENT(IN) :: num_points + INTEGER(HSIZE_T), DIMENSION(*), INTENT(OUT) :: buf + END FUNCTION h5sget_select_elem_pointlist_c + END INTERFACE + + hdferr = h5sget_select_elem_pointlist_c(space_id, startpoint, & + num_points, buf ) + + END SUBROUTINE h5sget_select_elem_pointlist_f + +! +!****s* H5S/h5sselect_elements_f +! +! NAME +! h5sselect_elements_f +! +! PURPOSE +! Selects elements to be included in the selection for +! a dataspace +! +! INPUTS +! space_id - dataspace identifier +! operator - flag, valid values are: +! H5S_SELECT_SET_F +! H5S_SELECT_APPEND_F +! H5S_SELECT_PREPEND_F +! rank - number of dataspace dimensions +! num_elements - number of elements to be selected +! coord - 2D (rank x num_elements) array with the +! elements coordinates ( 1-based); in C the +! array is stored in 2D as (num_element x rank) +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 6, 2001 +! SOURCE + SUBROUTINE h5sselect_elements_f(space_id, OPERATOR, rank, & + num_elements, coord, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: space_id + INTEGER, INTENT(IN) :: OPERATOR + INTEGER, INTENT(IN) :: rank + INTEGER(SIZE_T), INTENT(IN) :: num_elements + INTEGER(HSIZE_T), INTENT(IN) , DIMENSION(rank,num_elements) :: coord + INTEGER, INTENT(OUT) :: hdferr +!***** + INTEGER(HSIZE_T), ALLOCATABLE, DIMENSION(:,:) :: c_coord + INTEGER :: error, i + + INTERFACE + INTEGER FUNCTION h5sselect_elements_c(space_id, OPERATOR,& + num_elements,c_c_coord) BIND(C,NAME='h5sselect_elements_c') + IMPORT :: HID_T, SIZE_T, HSIZE_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: space_id + INTEGER, INTENT(IN) :: OPERATOR + INTEGER(SIZE_T), INTENT(IN) :: num_elements + INTEGER(HSIZE_T),DIMENSION(*) :: c_c_coord + END FUNCTION h5sselect_elements_c + END INTERFACE + + ALLOCATE(c_coord(rank,num_elements), STAT = error) + IF (error.NE. 0) THEN + hdferr = -1 + RETURN + ENDIF + DO i = 1, rank + c_coord(i,:) = coord(rank-i+1, :) - 1 + ENDDO + hdferr = h5sselect_elements_c(space_id, OPERATOR, num_elements, c_coord) + +! ALLOCATE(c_coord(num_elements,rank), stat = error) +! IF (error.NE. 0) THEN +! hdferr = -1 +! RETURN +! ENDIF +! +! c_coord = TRANSPOSE(coord) +! hdferr = h5sselect_elements_c(space_id, OPERATOR, INT(rank,size_t), c_coord) + + + DEALLOCATE(c_coord) + + END SUBROUTINE h5sselect_elements_f + +! +!****s* H5S/h5sselect_all_f +! +! NAME +! h5sselect_all_f +! +! PURPOSE +! Selects the entire dataspace. +! +! INPUTS +! space_id - Identifier for the dataspace in which +! selection being made +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 6, 2001 +! +! SOURCE + SUBROUTINE h5sselect_all_f(space_id, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: space_id + INTEGER, INTENT(OUT) :: hdferr +!***** + INTERFACE + INTEGER FUNCTION h5sselect_all_c(space_id) BIND(C,NAME='h5sselect_all_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: space_id + END FUNCTION h5sselect_all_c + END INTERFACE + + hdferr = h5sselect_all_c(space_id) + + END SUBROUTINE h5sselect_all_f + +! +!****s* H5S/h5sselect_none_f +! +! NAME +! h5sselect_none_f +! +! PURPOSE +! Resets the selection region to include no elements. +! +! INPUTS +! space_id - the identifier for the dataspace in which +! the selection is being reset. +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 6, 2001 +! +! SOURCE + SUBROUTINE h5sselect_none_f(space_id, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: space_id + INTEGER, INTENT(OUT) :: hdferr +!***** + INTERFACE + INTEGER FUNCTION h5sselect_none_c(space_id) BIND(C,NAME='h5sselect_none_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: space_id + END FUNCTION h5sselect_none_c + END INTERFACE + + hdferr = h5sselect_none_c(space_id) + + END SUBROUTINE h5sselect_none_f + +! +!****s* H5S/h5sselect_valid_f +! +! NAME +! h5sselect_valid_f +! +! PURPOSE +! Verifies that the selection is within the extent of +! the dataspace. +! +! INPUTS +! space_id - identifier for the dataspace for which +! selection is verified +! OUTPUTS +! status - TRUE if the selection is contained within +! the extent, FALSE otherwise. +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 6, 2001 +! +! SOURCE + SUBROUTINE h5sselect_valid_f(space_id, status, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: space_id + LOGICAL, INTENT(OUT) :: status + INTEGER, INTENT(OUT) :: hdferr +!***** + INTEGER :: flag ! "TRUE/FALSE/ERROR" flag from C routine + + INTERFACE + INTEGER FUNCTION h5sselect_valid_c(space_id, flag) BIND(C,NAME='h5sselect_valid_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: space_id + INTEGER :: flag + END FUNCTION h5sselect_valid_c + END INTERFACE + + hdferr = h5sselect_valid_c(space_id, flag) + status = .TRUE. + IF (flag .EQ. 0) status = .FALSE. + + END SUBROUTINE h5sselect_valid_f + +! +!****s* H5S/h5sget_simple_extent_npoints_f +! +! NAME +! h5sget_simple_extent_npoints_f +! +! PURPOSE +! Determines the number of elements in a dataspace. +! +! INPUTS +! space_id - dataspace identifier +! OUTPUTS +! npoints - number of elements in the dataspace +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 6, 2001 +! +! SOURCE + SUBROUTINE h5sget_simple_extent_npoints_f(space_id, npoints, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: space_id + INTEGER(HSIZE_T), INTENT(OUT) :: npoints + INTEGER, INTENT(OUT) :: hdferr +!***** + INTERFACE + INTEGER FUNCTION h5sget_simple_extent_npoints_c( space_id, npoints) BIND(C,NAME='h5sget_simple_extent_npoints_c') + IMPORT :: HID_T, HSIZE_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: space_id + INTEGER(HSIZE_T), INTENT(OUT) :: npoints + END FUNCTION h5sget_simple_extent_npoints_c + END INTERFACE + + hdferr = h5sget_simple_extent_npoints_c( space_id, npoints) + + END SUBROUTINE h5sget_simple_extent_npoints_f + +! +!****s* H5S/h5sget_select_npoints_f +! +! NAME +! h5sget_select_npoints_f +! +! PURPOSE +! Determines the number of elements in a dataspace selection. +! +! INPUTS +! space_id - dataspace identifier +! OUTPUTS +! npoints - number of points in the dataspace selection +! hdferr - Returns 0 if successful and -1 if fails +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 6, 2001 +! SOURCE + SUBROUTINE h5sget_select_npoints_f(space_id, npoints, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: space_id + INTEGER(HSSIZE_T), INTENT(OUT) :: npoints + INTEGER, INTENT(OUT) :: hdferr +!***** + INTERFACE + INTEGER FUNCTION h5sget_select_npoints_c(space_id, npoints) BIND(C,NAME='h5sget_select_npoints_c') + IMPORT :: HID_T, HSSIZE_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: space_id + INTEGER(HSSIZE_T), INTENT(OUT) :: npoints + END FUNCTION h5sget_select_npoints_c + END INTERFACE + + hdferr = h5sget_select_npoints_c(space_id, npoints) + + END SUBROUTINE h5sget_select_npoints_f + +! +!****s* H5S/h5sget_simple_extent_ndims_f +! +! NAME +! h5sget_simple_extent_ndims_f +! +! PURPOSE +! Determines the dimensionality of a dataspace +! +! INPUTS +! space_id - dataspace identifier +! OUTPUTS +! rank - number of dataspace dimensions +! hdferr - Returns 0 if successful and -1 if fails +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 6, 2001 +! +! SOURCE + SUBROUTINE h5sget_simple_extent_ndims_f(space_id, rank, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: space_id + INTEGER, INTENT(OUT) :: rank + INTEGER, INTENT(OUT) :: hdferr +!***** + INTERFACE + INTEGER FUNCTION h5sget_simple_extent_ndims_c(space_id, rank) BIND(C,NAME='h5sget_simple_extent_ndims_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: space_id + INTEGER, INTENT(OUT) :: rank + END FUNCTION h5sget_simple_extent_ndims_c + END INTERFACE + + hdferr = h5sget_simple_extent_ndims_c(space_id, rank) + + END SUBROUTINE h5sget_simple_extent_ndims_f +! +!****s* H5S/h5sget_simple_extent_dims_f +! +! NAME +! h5sget_simple_extent_dims_f +! +! PURPOSE +! Retrieves dataspace dimension size and maximum size. +! +! INPUTS +! space_id - dataspace identifier +! +! OUTPUTS +! dims - array to store size of each dimension +! maxdims - array to store maximum size of each dimension +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 6, 2001 +! +! SOURCE + SUBROUTINE h5sget_simple_extent_dims_f(space_id, dims, maxdims, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: space_id + INTEGER(HSIZE_T), DIMENSION(*), INTENT(OUT) :: dims + INTEGER(HSIZE_T), DIMENSION(*), INTENT(OUT) :: maxdims + INTEGER, INTENT(OUT) :: hdferr +!***** + INTERFACE + INTEGER FUNCTION h5sget_simple_extent_dims_c(space_id, dims, maxdims) BIND(C,NAME='h5sget_simple_extent_dims_c') + IMPORT :: HID_T, HSIZE_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: space_id + INTEGER(HSIZE_T), DIMENSION(*), INTENT(OUT) :: dims + INTEGER(HSIZE_T), DIMENSION(*), INTENT(OUT) :: maxdims + END FUNCTION h5sget_simple_extent_dims_c + END INTERFACE + + hdferr = h5sget_simple_extent_dims_c(space_id, dims, maxdims) + + END SUBROUTINE h5sget_simple_extent_dims_f + +! +!****s* H5S/h5sget_simple_extent_type_f +! +! NAME +! h5sget_simple_extent_type_f +! +! PURPOSE +! Determine the current class of a dataspace +! +! INPUTS +! space_id - dataspace identifier +! OUTPUTS +! classtype - class type, possible values are: +! H5S_NO_CLASS_F +! H5S_SCALAR_F +! H5S_SIMPLE_F +! H5S_NULL_F +! hdferr - Returns 0 if successful and -1 if fails +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 6, 2001 +! +! SOURCE + SUBROUTINE h5sget_simple_extent_type_f(space_id, classtype, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: space_id + INTEGER, INTENT(OUT) :: classtype + INTEGER, INTENT(OUT) :: hdferr +!***** + INTERFACE + INTEGER FUNCTION h5sget_simple_extent_type_c(space_id, classtype) BIND(C,NAME='h5sget_simple_extent_type_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: space_id + INTEGER, INTENT(OUT) :: classtype + END FUNCTION h5sget_simple_extent_type_c + END INTERFACE + + hdferr = h5sget_simple_extent_type_c(space_id, classtype) + + END SUBROUTINE h5sget_simple_extent_type_f + ! +!****s* H5S/h5sset_extent_simple_f +! +! NAME +! h5sset_extent_simple_f +! +! PURPOSE +! Sets or resets the size of an existing dataspace. +! +! INPUTS +! space_id - dataspace identifier +! rank - dataspace number of dimensions +! current_size - array with the new sizes of dimensions +! maximum_size - array with the new maximum sizes of +! dimensions +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 6, 2001 +! +! SOURCE + SUBROUTINE h5sset_extent_simple_f(space_id, rank, current_size, & + maximum_size, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: space_id + INTEGER, INTENT(IN) :: rank + INTEGER(HSIZE_T), DIMENSION(rank), INTENT(IN) :: current_size + INTEGER(HSIZE_T), DIMENSION(rank), INTENT(IN) :: maximum_size + INTEGER, INTENT(OUT) :: hdferr +!***** + INTERFACE + INTEGER FUNCTION h5sset_extent_simple_c(space_id, rank, & + current_size, maximum_size) BIND(C,NAME='h5sset_extent_simple_c') + IMPORT :: HID_T, HSIZE_T + INTEGER(HID_T), INTENT(IN) :: space_id + INTEGER, INTENT(IN) :: rank + INTEGER(HSIZE_T), DIMENSION(rank), INTENT(IN) :: current_size + INTEGER(HSIZE_T), DIMENSION(rank), INTENT(IN) :: maximum_size + END FUNCTION h5sset_extent_simple_c + END INTERFACE + + hdferr = h5sset_extent_simple_c(space_id, rank, current_size, & + maximum_size) + + END SUBROUTINE h5sset_extent_simple_f +! +!****s* H5S/h5sis_simple_f +! +! NAME +! h5sis_simple_f +! +! PURPOSE +! Determines whether a dataspace is a simple dataspace. +! +! INPUTS +! space_id - dataspace identifier +! OUTPUTS +! status - flag to indicate if dataspace +! is simple or not (TRUE or FALSE) +! hdferr - Returns 0 if successful and -1 if fails +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 6, 2001 +! +! SOURCE + SUBROUTINE h5sis_simple_f(space_id, status, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: space_id + LOGICAL, INTENT(OUT) :: status + INTEGER, INTENT(OUT) :: hdferr +!***** + INTEGER :: flag ! "TRUE/FALSE/ERROR from C" + + INTERFACE + INTEGER FUNCTION h5sis_simple_c(space_id, flag) BIND(C,NAME='h5sis_simple_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: space_id + INTEGER :: flag + END FUNCTION h5sis_simple_c + END INTERFACE + + hdferr = h5sis_simple_c(space_id, flag) + status = .TRUE. + IF (flag .EQ. 0) status = .FALSE. + + END SUBROUTINE h5sis_simple_f + +! +!****s* H5S/h5soffset_simple_f +! +! NAME +! h5soffset_simple_f +! +! PURPOSE +! Sets the offset of a simple dataspace. +! +! INPUTS +! space_id - dataspace identifier +! offset - the offset at which to position the +! selection +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails +! OPTIONAL PARAMETERS +! NONE +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 6, 2001 +! +! SOURCE + SUBROUTINE h5soffset_simple_f(space_id, offset, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: space_id + INTEGER(HSSIZE_T), DIMENSION(*), INTENT(IN) :: offset + INTEGER, INTENT(OUT) :: hdferr +!***** + INTERFACE + INTEGER FUNCTION h5soffset_simple_c(space_id, offset) BIND(C,NAME='h5soffset_simple_c') + IMPORT :: HID_T, HSSIZE_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: space_id + INTEGER(HSSIZE_T), DIMENSION(*), INTENT(IN) :: offset + END FUNCTION h5soffset_simple_c + END INTERFACE + + hdferr = h5soffset_simple_c(space_id, offset) + + END SUBROUTINE h5soffset_simple_f + +! +!****s* H5S/h5sextent_copy_f +! +! NAME +! h5sextent_copy_f +! +! PURPOSE +! Copies the extent of a dataspace. +! +! INPUTS +! dest_space_id - the identifier for the dataspace to which +! the extent is copied +! source_space_id - the identifier for the dataspace from +! which the extent is copied +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails +! OPTIONAL PARAMETERS +! NONE +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 6, 2001 +! +! NOTES +! + +! SOURCE + SUBROUTINE h5sextent_copy_f(dest_space_id, source_space_id, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dest_space_id + INTEGER(HID_T), INTENT(IN) :: source_space_id + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + INTERFACE + INTEGER FUNCTION h5sextent_copy_c(dest_space_id, source_space_id) BIND(C,NAME='h5sextent_copy_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dest_space_id + INTEGER(HID_T), INTENT(IN) :: source_space_id + END FUNCTION h5sextent_copy_c + END INTERFACE + + hdferr = h5sextent_copy_c(dest_space_id, source_space_id) + + END SUBROUTINE h5sextent_copy_f + +! +!****s* H5S/h5sset_extent_none_f +! +! NAME +! h5sset_extent_none_f +! +! PURPOSE +! Removes the extent from a dataspace. +! +! INPUTS +! space_id - dataspace identifier +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 6, 2001 +! +! SOURCE + SUBROUTINE h5sset_extent_none_f(space_id, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: space_id + INTEGER, INTENT(OUT) :: hdferr +!***** + INTERFACE + INTEGER FUNCTION h5sset_extent_none_c(space_id) BIND(C,NAME='h5sset_extent_none_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: space_id + END FUNCTION h5sset_extent_none_c + END INTERFACE + + hdferr = h5sset_extent_none_c(space_id) + + END SUBROUTINE h5sset_extent_none_f +! +!****s* H5S/h5sselect_hyperslab_f +! +! NAME +! h5sselect_hyperslab_f +! +! PURPOSE +! Selects a hyperslab region to add to the current selected +! region +! +! INPUTS +! space_id - dataspace identifier +! operator - flag, valid values are: +! H5S_SELECT_SET_F +! H5S_SELECT_OR_F +! start - array with hyperslab offsets +! count - number of blocks included in the hyperslab +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails +! OPTIONAL PARAMETERS +! stride - array with hyperslab strides +! block - array with hyperslab block sizes +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 6, 2001 +! +! SOURCE + SUBROUTINE h5sselect_hyperslab_f(space_id, OPERATOR, start, count, & + hdferr, stride, BLOCK) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: space_id + INTEGER, INTENT(IN) :: OPERATOR + INTEGER(HSIZE_T), DIMENSION(*), INTENT(IN) :: start + INTEGER(HSIZE_T), DIMENSION(*), INTENT(IN) :: count + INTEGER, INTENT(OUT) :: hdferr + INTEGER(HSIZE_T), DIMENSION(:), OPTIONAL, INTENT(IN) :: stride + INTEGER(HSIZE_T), DIMENSION(:), OPTIONAL, INTENT(IN) :: BLOCK +!***** + INTEGER(HSIZE_T), DIMENSION(:), ALLOCATABLE :: def_block + INTEGER(HSIZE_T), DIMENSION(:), ALLOCATABLE :: def_stride + INTEGER :: rank + INTEGER :: error1, error2 + + INTERFACE + INTEGER FUNCTION h5sselect_hyperslab_c(space_id, OPERATOR, & + start, count, stride, BLOCK) BIND(C,NAME='h5sselect_hyperslab_c') + IMPORT :: HID_T, HSIZE_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: space_id + INTEGER, INTENT(IN) :: OPERATOR + INTEGER(HSIZE_T), DIMENSION(*), INTENT(IN) :: start + INTEGER(HSIZE_T), DIMENSION(*), INTENT(IN) :: count + INTEGER(HSIZE_T), DIMENSION(*), INTENT(IN) :: stride + INTEGER(HSIZE_T), DIMENSION(*), INTENT(IN) :: BLOCK + END FUNCTION h5sselect_hyperslab_c + END INTERFACE + + IF (PRESENT(stride).AND. PRESENT(BLOCK)) THEN + hdferr = h5sselect_hyperslab_c(space_id, OPERATOR, start, count, & + stride, BLOCK) + RETURN + ENDIF + ! Case of optional parameters. + ! + ! Find the rank of the dataspace to allocate memery for + ! default stride and block arrays. + ! + CALL h5sget_simple_extent_ndims_f(space_id, rank, hdferr) + IF( hdferr .EQ. -1) RETURN + ! + IF (PRESENT(stride).AND. .NOT.PRESENT(BLOCK)) THEN + ALLOCATE(def_block(rank), stat=error1) + IF (error1.NE.0) THEN + hdferr = -1 + RETURN + ENDIF + def_block = 1 + hdferr = h5sselect_hyperslab_c(space_id, OPERATOR, start, count, & + stride, def_block) + DEALLOCATE(def_block) + RETURN + ENDIF + + IF (.NOT.PRESENT(stride).AND. PRESENT(BLOCK)) THEN + ALLOCATE(def_stride(rank), stat=error2) + IF (error2.NE.0) THEN + hdferr = -1 + RETURN + ENDIF + def_stride = 1 + hdferr = h5sselect_hyperslab_c(space_id, OPERATOR, start, count, & + def_stride, BLOCK) + DEALLOCATE(def_stride) + RETURN + ENDIF + ALLOCATE(def_block(rank), stat=error1) + ALLOCATE(def_stride(rank), stat=error2) + IF ((error1.NE.0) .OR. (error2.NE.0)) THEN + hdferr = -1 + RETURN + ENDIF + def_block = 1 + def_stride = 1 + hdferr = h5sselect_hyperslab_c(space_id, OPERATOR, start, count, & + def_stride, def_block) + DEALLOCATE(def_block) + DEALLOCATE(def_stride) + + END SUBROUTINE h5sselect_hyperslab_f +! !$! +! !$!****s* H5S/h5scombine_hyperslab_f +! !$! +! !$! NAME +! !$! h5scombine_hyperslab_f +! !$! +! !$! PURPOSE +! !$! Combine a hyperslab selection with the current +! !$! selection for a dataspace +! !$! +! !$! INPUTS +! !$! space_id - dataspace of selection to use +! !$! operator - flag, valid values are: +! !$! H5S_SELECT_NOOP_F +! !$! H5S_SELECT_SET_F +! !$! H5S_SELECT_OR_F +! !$! H5S_SELECT_AND_F +! !$! H5S_SELECT_XOR_F +! !$! H5S_SELECT_NOTB_F +! !$! H5S_SELECT_NOTA_F +! !$! H5S_SELECT_APPEND_F +! !$! H5S_SELECT_PREPEND_F +! !$! start - array with hyperslab offsets +! !$! count - number of blocks included in the +! !$! hyperslab +! !$! OUTPUTS +! !$! hyper_id - identifier for the new hyperslab +! !$! hdferr: - error code +! !$! Success: 0 +! !$! Failure: -1 +! !$! OPTIONAL PARAMETERS +! !$! stride - array with hyperslab strides +! !$! block - array with hyperslab block sizes +! !$! +! !$! AUTHOR +! !$! Elena Pourmal +! !$! October 7, 2002 +! !$! +! !$! HISTORY +! !$! +! !$! +! !$! NOTES +! !$! Commented out until 1.6 ? 10/08/2002 +! !$! +! !$! SOURCE +! SUBROUTINE h5scombine_hyperslab_f(space_id, operator, start, count, & +! hyper_id, hdferr, stride, block) +! IMPLICIT NONE +! INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier +! INTEGER, INTENT(IN) :: operator ! Flag, valid values are: + ! H5S_SELECT_NOOP_F + ! H5S_SELECT_SET_F + ! H5S_SELECT_OR_F + ! H5S_SELECT_AND_F + ! H5S_SELECT_XOR_F + ! H5S_SELECT_NOTB_F + ! H5S_SELECT_NOTA_F + ! H5S_SELECT_APPEND_F + ! H5S_SELECT_PREPEND_F + ! +! INTEGER(HSIZE_T), DIMENSION(*), INTENT(IN) :: start + ! Starting coordinates of the hyperslab +! INTEGER(HSIZE_T), DIMENSION(*), INTENT(IN) :: count + ! Number of blocks to select + ! from dataspace +! INTEGER(HID_T), INTENT(OUT) :: hyper_id ! New hyperslab identifier +! INTEGER, INTENT(OUT) :: hdferr ! Error code +! INTEGER(HSIZE_T), DIMENSION(:), OPTIONAL, INTENT(IN) :: stride + ! Array of how many elements to move + ! in each direction +! INTEGER(HSIZE_T), DIMENSION(:), OPTIONAL, INTENT(IN) :: block + ! Sizes of element block +! INTEGER(HSIZE_T), DIMENSION(:), ALLOCATABLE :: def_block +! INTEGER(HSIZE_T), DIMENSION(:), ALLOCATABLE :: def_stride +! INTEGER :: rank +! INTEGER :: error1, error2 + +! INTERFACE +! INTEGER FUNCTION h5scombine_hyperslab_c(space_id, operator, & +! start, count, stride, block, hyper_id) +! USE H5GLOBAL +! !DEC$IF DEFINED(HDF5F90_WINDOWS) +! !DEC$ATTRIBUTES C,reference,decorate,alias:'H5SCOMBINE_HYPERSLAB_C'::h5scombine_hyperslab_c +! !DEC$ENDIF +! INTEGER(HID_T), INTENT(IN) :: space_id +! INTEGER, INTENT(IN) :: operator +! INTEGER(HSIZE_T), DIMENSION(*), INTENT(IN) :: start +! INTEGER(HSIZE_T), DIMENSION(*), INTENT(IN) :: count +! INTEGER(HSIZE_T), DIMENSION(*), OPTIONAL, INTENT(IN) :: stride +! INTEGER(HSIZE_T), DIMENSION(*), OPTIONAL, INTENT(IN) :: block +! INTEGER(HID_T), INTENT(OUT) :: hyper_id +! END FUNCTION h5scombine_hyperslab_c +! END INTERFACE + +! if (present(stride).and. present(block)) then +! hdferr = h5scombine_hyperslab_c(space_id, operator, start, count, & +! stride, block, hyper_id) +! return +! endif + ! Case of optional parameters. + ! + ! Find the rank of the dataspace to allocate memery for + ! default stride and block arrays. + ! +! CALL h5sget_simple_extent_ndims_f(space_id, rank, hdferr) +! if( hdferr .EQ. -1) return + ! +! if (present(stride).and. .not.present(block)) then +! allocate(def_block(rank), stat=error1) +! if (error1.NE.0) then +! hdferr = -1 +! return +! endif +! def_block = 1 +! hdferr = h5scombine_hyperslab_c(space_id, operator, start, count, & +! stride, def_block, hyper_id) +! deallocate(def_block) +! return +! endif + +! if (.not.present(stride).and. present(block)) then +! allocate(def_stride(rank), stat=error2) +! if (error2.NE.0) then +! hdferr = -1 +! return +! endif +! def_stride = 1 +! hdferr = h5scombine_hyperslab_c(space_id, operator, start, count, & +! def_stride, block, hyper_id) +! deallocate(def_stride) +! return +! endif +! allocate(def_block(rank), stat=error1) +! allocate(def_stride(rank), stat=error2) +! if ((error1.NE.0) .OR. (error2.NE.0)) then +! hdferr = -1 +! return +! endif +! def_block = 1 +! def_stride = 1 +! hdferr = h5scombine_hyperslab_c(space_id, operator, start, count, & +! def_stride, def_block, hyper_id) +! deallocate(def_block) +! deallocate(def_stride) + +! END SUBROUTINE h5scombine_hyperslab_f + +! !$! +! !$!****s* H5S/ +! !$! +! !$! NAME +! !$! h5scombine_select_f +! !$! +! !$! PURPOSE +! !$! Combine two hyperslab selections with an operation +! !$! and return a dataspace with resulting selection. +! !$! +! !$! INPUTS +! !$! space1_id - dataspace of selection to use +! !$! operator - flag, valid values are: +! !$! H5S_SELECT_NOOP_F +! !$! H5S_SELECT_SET_F +! !$! H5S_SELECT_OR_F +! !$! H5S_SELECT_AND_F +! !$! H5S_SELECT_XOR_F +! !$! H5S_SELECT_NOTB_F +! !$! H5S_SELECT_NOTA_F +! !$! H5S_SELECT_APPEND_F +! !$! H5S_SELECT_PREPEND_F +! !$! space2_id - dataspace of selection to use +! !$! OUTPUTS +! !$! ds_id - idataspace identifier with the new selection +! !$! hdferr: - error code +! !$! Success: 0 +! !$! Failure: -1 +! !$! OPTIONAL PARAMETERS - NONE +! !$! +! !$! AUTHOR +! !$! Elena Pourmal +! !$! October 7, 2002 +! !$! +! !$! HISTORY +! !$! +! !$! +! !$! NOTES commented out until 1.6 release(?) 10/08/2002 +! !$! + +! ! SOURCE +! !$ SUBROUTINE h5scombine_select_f(space1_id, operator, space2_id, & +! ds_id, hdferr) +! IMPLICIT NONE +! INTEGER(HID_T), INTENT(IN) :: space1_id ! First dataspace identifier +! INTEGER(HID_T), INTENT(IN) :: space2_id ! Second dataspace identifier +! INTEGER, INTENT(IN) :: operator ! Flag, valid values are: + ! H5S_SELECT_NOOP_F + ! H5S_SELECT_SET_F + ! H5S_SELECT_OR_F + ! H5S_SELECT_AND_F + ! H5S_SELECT_XOR_F + ! H5S_SELECT_NOTB_F + ! H5S_SELECT_NOTA_F + ! H5S_SELECT_APPEND_F + ! H5S_SELECT_PREPEND_F + ! +! INTEGER(HID_T), INTENT(OUT) :: ds_id ! New dataspace identifier +! INTEGER, INTENT(OUT) :: hdferr ! Error code +! +! INTERFACE +! INTEGER FUNCTION h5scombine_select_c(space1_id, operator, & +! space2_id, ds_id) +! USE H5GLOBAL +! !DEC$IF DEFINED(HDF5F90_WINDOWS) +! !DEC$ATTRIBUTES C,reference,decorate,alias:'H5SCOMBINE_SELECT_C'::h5scombine_select_c +! !DEC$ENDIF +! INTEGER(HID_T), INTENT(IN) :: space1_id +! INTEGER(HID_T), INTENT(IN) :: space2_id +! INTEGER, INTENT(IN) :: operator +! INTEGER(HID_T), INTENT(OUT) :: ds_id +! END FUNCTION h5scombine_select_c +! END INTERFACE + +! hdferr = h5scombine_select_c(space1_id, operator, space2_id, & +! ds_id) +! return + +! END SUBROUTINE h5scombine_select_f + +! !$! +! !$!****s* H5S/ +! !$! +! !$! NAME +! !$! h5sselect_select_f +! !$! +! !$! PURPOSE +! !$! Refine a hyperslab selection with an operation +! !$! using second hyperslab +! !$! +! !$! INPUTS +! !$! space1_id - dataspace of selection to modify +! !$! operator - flag, valid values are: +! !$! H5S_SELECT_NOOP_F +! !$! H5S_SELECT_SET_F +! !$! H5S_SELECT_OR_F +! !$! H5S_SELECT_AND_F +! !$! H5S_SELECT_XOR_F +! !$! H5S_SELECT_NOTB_F +! !$! H5S_SELECT_NOTA_F +! !$! H5S_SELECT_APPEND_F +! !$! H5S_SELECT_PREPEND_F +! !$! space2_id - dataspace of selection to use +! !$! +! !$! OUTPUTS +! !$! hdferr: - error code +! !$! Success: 0 +! !$! Failure: -1 +! !$! OPTIONAL PARAMETERS - NONE +! !$! +! !$! AUTHOR +! !$! Elena Pourmal +! !$! October 7, 2002 +! !$! +! !$! HISTORY +! !$! +! !$! +! !$! NOTESCommented out until 1.6 release(?) 10/08/2002 EIP +! !$! + +! ! SOURCE +! SUBROUTINE h5sselect_select_f(space1_id, operator, space2_id, & +! hdferr) +! IMPLICIT NONE +! INTEGER(HID_T), INTENT(INOUT) :: space1_id ! Dataspace identifier to + ! modify +! INTEGER(HID_T), INTENT(IN) :: space2_id ! Second dataspace identifier +! INTEGER, INTENT(IN) :: operator ! Flag, valid values are: + ! H5S_SELECT_NOOP_F + ! H5S_SELECT_SET_F + ! H5S_SELECT_OR_F + ! H5S_SELECT_AND_F + ! H5S_SELECT_XOR_F + ! H5S_SELECT_NOTB_F + ! H5S_SELECT_NOTA_F + ! H5S_SELECT_APPEND_F + ! H5S_SELECT_PREPEND_F + ! +! INTEGER, INTENT(OUT) :: hdferr ! Error code + +! INTERFACE +! INTEGER FUNCTION h5sselect_select_c(space1_id, operator, & +! space2_id) +! USE H5GLOBAL +! !DEC$IF DEFINED(HDF5F90_WINDOWS) +! !DEC$ATTRIBUTES C,reference,decorate,alias:'H5SSELECT_SELECT_C'::h5sselect_select_c +! !DEC$ENDIF +! INTEGER(HID_T), INTENT(INOUT) :: space1_id +! INTEGER(HID_T), INTENT(IN) :: space2_id +! INTEGER, INTENT(IN) :: operator +! END FUNCTION h5sselect_select_c +! END INTERFACE + +! hdferr = h5sselect_select_c(space1_id, operator, space2_id) +! return + +! END SUBROUTINE h5sselect_select_f + +! +!****s* H5S/h5sget_select_type_f +! +! NAME +! h5sget_select_type_f +! +! PURPOSE +! Retrieve the type of selection +! +! INPUTS +! space_id - dataspace identifier with selection +! OUTPUTS +! type - selection type flag, valid values are: +! H5S_SEL_ERROR_F +! H5S_SEL_NONE_F +! H5S_SEL_POINTS_F +! H5S_SEL_HYPERSLABS_F +! H5S_SEL_ALL_F +! hdferr - Returns 0 if successful and -1 if fails +! AUTHOR +! Elena Pourmal +! October 7, 2002 +! +! SOURCE + SUBROUTINE h5sget_select_type_f(space_id, TYPE, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(INOUT) :: space_id + INTEGER, INTENT(OUT) :: TYPE + INTEGER, INTENT(OUT) :: hdferr +!***** + INTERFACE + INTEGER FUNCTION h5sget_select_type_c(space_id, TYPE) BIND(C,NAME='h5sget_select_type_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: space_id + INTEGER, INTENT(OUT) :: TYPE + END FUNCTION h5sget_select_type_c + END INTERFACE + + hdferr = h5sget_select_type_c(space_id, TYPE) + RETURN + + END SUBROUTINE h5sget_select_type_f + +! +!****s* H5S/H5Sdecode_f +! +! NAME +! H5Sdecode_f +! +! PURPOSE +! Decode a binary object description of data space and return a new object handle. +! +! INPUTS +! buf - Buffer for the data space object to be decoded. +! obj_id - Object ID +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! M. Scot Breitenfeld +! March 26, 2008 +! SOURCE + SUBROUTINE h5sdecode_f(buf, obj_id, hdferr) + IMPLICIT NONE + CHARACTER(LEN=*), INTENT(IN) :: buf + INTEGER(HID_T), INTENT(OUT) :: obj_id + INTEGER, INTENT(OUT) :: hdferr +!***** + INTERFACE + INTEGER FUNCTION h5sdecode_c(buf, obj_id) BIND(C,NAME='h5sdecode_c') + IMPORT :: C_CHAR + IMPORT :: HID_T + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: buf + INTEGER(HID_T), INTENT(OUT) :: obj_id ! Object ID + END FUNCTION h5sdecode_c + END INTERFACE + + hdferr = h5sdecode_c(buf, obj_id) + + END SUBROUTINE h5sdecode_f + +! +!****s* H5S/H5Sencode_f +! +! NAME +! H5Sencode_f +! +! PURPOSE +! Encode a data space object description into a binary buffer. +! +! INPUTS +! obj_id - Identifier of the object to be encoded. +! buf - Buffer for the object to be encoded into. +! nalloc - The size of the allocated buffer. +! OUTPUTS +! nalloc - The size of the buffer needed. +! hdferr - Returns 0 if successful and -1 if fails. +! +! AUTHOR +! M. Scot Breitenfeld +! March 26, 2008 +! SOURCE + SUBROUTINE h5sencode_f(obj_id, buf, nalloc, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: obj_id + CHARACTER(LEN=*), INTENT(OUT) :: buf + INTEGER(SIZE_T), INTENT(INOUT) :: nalloc + INTEGER, INTENT(OUT) :: hdferr +!***** + + INTERFACE + INTEGER FUNCTION h5sencode_c(buf, obj_id, nalloc) BIND(C,NAME='h5sencode_c') + IMPORT :: C_CHAR + IMPORT :: HID_T, SIZE_T + INTEGER(HID_T), INTENT(IN) :: obj_id + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(OUT) :: buf + INTEGER(SIZE_T), INTENT(INOUT) :: nalloc + END FUNCTION h5sencode_c + END INTERFACE + + hdferr = h5sencode_c(buf, obj_id, nalloc) + + END SUBROUTINE h5sencode_f + +!****s* H5S/h5sextent_equal_f +! +! NAME +! h5sextent_equal_f +! +! PURPOSE +! Determines whether two dataspace extents are equal. +! +! INPUTS +! space1_id - First dataspace identifier. +! space2_id - Second dataspace identifier. +! OUTPUTS +! Equal - .TRUE. if equal, .FALSE. if unequal. +! hdferr - Returns 0 if successful and -1 if fails +! AUTHOR +! M. Scot Breitenfeld +! April 2, 2008 +! +! SOURCE + SUBROUTINE h5sextent_equal_f(space1_id, space2_id, equal, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: space1_id + INTEGER(HID_T), INTENT(IN) :: space2_id + LOGICAL, INTENT(OUT) :: Equal + INTEGER, INTENT(OUT) :: hdferr +!***** + INTEGER(HID_T) :: c_equal + + INTERFACE + INTEGER FUNCTION h5sextent_equal_c(space1_id, space2_id, c_equal) BIND(C,NAME='h5sextent_equal_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: space1_id + INTEGER(HID_T), INTENT(IN) :: space2_id + INTEGER(HID_T) :: c_equal + END FUNCTION h5sextent_equal_c + END INTERFACE + + hdferr = h5sextent_equal_c(space1_id, space2_id, c_equal) + equal = .FALSE. + IF(c_equal.GT.0) equal = .TRUE. + + END SUBROUTINE h5sextent_equal_f + +END MODULE H5S diff --git a/fortran/src/H5Sff.f90 b/fortran/src/H5Sff.f90 deleted file mode 100644 index c493d46..0000000 --- a/fortran/src/H5Sff.f90 +++ /dev/null @@ -1,1875 +0,0 @@ -!****h* ROBODoc/H5S -! -! NAME -! MODULE H5S -! -! FILE -! fortran/src/H5Sff.f90 -! -! PURPOSE -! This file contains Fortran interfaces for H5S functions. It includes -! all the functions that are independent on whether the Fortran 2003 functions -! are enabled or disabled. -! -! -! 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. * -! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -! -! NOTES -! *** IMPORTANT *** -! If you add a new H5S function you must add the function name to the -! Windows dll file 'hdf5_fortrandll.def.in' in the fortran/src directory. -! This is needed for Windows based operating systems. -! -!***** - -MODULE H5S - USE H5GLOBAL - -CONTAINS - -! -!****s* H5S/h5screate_simple_f -! -! NAME -! h5screate_simple_f -! -! PURPOSE -! Creates a new simple data space and opens it for access . -! -! INPUTS -! rank - number of dimensions -! dims - an array of the size of each dimension -! OUTPUTS -! space_id - dataspace identifier -! hdferr - Returns 0 if successful and -1 if fails -! OPTIONAL PARAMETERS -! maxdims - an array of the maximum size of each dimension -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 6, 2001 -! SOURCE - SUBROUTINE h5screate_simple_f(rank, dims, space_id, hdferr, maxdims) - - IMPLICIT NONE - INTEGER, INTENT(IN) :: rank ! Number of dataspace dimensions - INTEGER(HSIZE_T), INTENT(IN) :: dims(rank) - ! Array with the dimension - ! sizes - INTEGER(HID_T), INTENT(OUT) :: space_id ! Dataspace identifier - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HSIZE_T), OPTIONAL, INTENT(IN) :: maxdims(rank) - ! Array with the maximum - ! dimension sizes -!***** - INTEGER(HSIZE_T), ALLOCATABLE, DIMENSION(:) :: f_maxdims - - INTERFACE - INTEGER FUNCTION h5screate_simple_c(rank, dims, maxdims, space_id) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5SCREATE_SIMPLE_C'::h5screate_simple_c - !DEC$ENDIF - INTEGER, INTENT(IN) :: rank - INTEGER(HSIZE_T), INTENT(IN) :: dims(rank) - INTEGER(HSIZE_T), DIMENSION(:),INTENT(IN) :: maxdims(rank) - INTEGER(HID_T), INTENT(OUT) :: space_id - END FUNCTION h5screate_simple_c - END INTERFACE - - allocate (f_maxdims(rank), stat=hdferr) - if (hdferr .NE. 0) then - hdferr = -1 - return - endif - if (present(maxdims)) then - f_maxdims = maxdims - else - f_maxdims = dims - endif - hdferr = h5screate_simple_c(rank, dims, f_maxdims, space_id) - deallocate(f_maxdims) - - END SUBROUTINE h5screate_simple_f - -! -!****s* H5S/h5sclose_f -! -! NAME -! h5sclose_f -! -! PURPOSE -! Releases and terminates access to a dataspace. -! -! INPUTS -! space_id - identifier of dataspace to release -! OUTPUTS -! hdferr - Returns 0 if successful and -1 if fails -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 6, 2001 -! -! SOURCE - SUBROUTINE h5sclose_f(space_id, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTERFACE - INTEGER FUNCTION h5sclose_c(space_id) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5SCLOSE_C'::h5sclose_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: space_id - END FUNCTION h5sclose_c - END INTERFACE - - hdferr = h5sclose_c(space_id) - - END SUBROUTINE h5sclose_f - -! -!****s* H5S/h5screate_f -! -! NAME -! h5screate_f -! -! PURPOSE -! Creates a new dataspace of a specified type. -! -! INPUTS -! classtype - the type of the dataspace to be created -! OUTPUTS -! space_id - dataspace identifier -! hdferr - Returns 0 if successful and -1 if fails -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 6, 2001 -! -! NOTES -! - -! SOURCE - SUBROUTINE h5screate_f(classtype, space_id, hdferr) - IMPLICIT NONE - INTEGER, INTENT(IN) :: classtype ! The type of the dataspace - ! to be created. - ! Possible values are: - ! H5S_SCALAR_F (0) - ! H5S_SIMPLE_F(1) - ! H5S_NULL_F(2) - INTEGER(HID_T), INTENT(OUT) :: space_id ! Dataspace identifier - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTERFACE - INTEGER FUNCTION h5screate_c(classtype, space_id) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5SCREATE_C'::h5screate_c - !DEC$ENDIF - INTEGER, INTENT(IN) :: classtype - INTEGER(HID_T), INTENT(OUT) :: space_id - END FUNCTION h5screate_c - END INTERFACE - - hdferr = h5screate_c(classtype, space_id) - - END SUBROUTINE h5screate_f - -! -!****s* H5S/h5scopy_f -! -! NAME -! h5scopy_f -! -! PURPOSE -! Creates an exact copy of a dataspace. -! -! INPUTS -! space_id - dataspace identifier -! OUTPUTS -! new_space_id - identifier of dataspace's copy -! hdferr - Returns 0 if successful and -1 if fails -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 6, 2001 -! -! NOTES -! - -! SOURCE - SUBROUTINE h5scopy_f(space_id, new_space_id, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier - INTEGER(HID_T), INTENT(OUT) :: new_space_id - ! Identifier of dataspace's copy - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTERFACE - INTEGER FUNCTION h5scopy_c(space_id, new_space_id) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5SCOPY_C'::h5scopy_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: space_id - INTEGER(HID_T), INTENT(OUT):: new_space_id - END FUNCTION h5scopy_c - END INTERFACE - - hdferr = h5scopy_c(space_id, new_space_id) - - END SUBROUTINE h5scopy_f - -! -!****s* H5S/h5sget_select_hyper_nblocks_f -! -! NAME -! h5sget_select_hyper_nblocks_f -! -! PURPOSE -! Get number of hyperslab blocks. -! -! INPUTS -! space_id - dataspace identifier -! OUTPUTS -! num_blocks - number of hyperslab blocks in the current -! hyperslab selection -! hdferr - Returns 0 if successful and -1 if fails -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 6, 2001 -! -! SOURCE - SUBROUTINE h5sget_select_hyper_nblocks_f(space_id, num_blocks, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier - INTEGER(HSSIZE_T), INTENT(OUT) :: num_blocks - !number of hyperslab blocks - !in the current dataspace - !selection - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTERFACE - INTEGER FUNCTION h5sget_select_hyper_nblocks_c (space_id, num_blocks) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) -! DEC$ ATTRIBUTES C,reference,decorate,alias:'H5SGET_SELECT_HYPER_NBLOCKS_C'::h5sget_select_hyper_nblocks_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: space_id - INTEGER(HSSIZE_T), INTENT(OUT) :: num_blocks - END FUNCTION h5sget_select_hyper_nblocks_c - END INTERFACE - - hdferr = h5sget_select_hyper_nblocks_c (space_id, num_blocks) - - END SUBROUTINE h5sget_select_hyper_nblocks_f - -! -!****s* H5S/h5sget_select_hyper_blocklist_f -! -! NAME -! h5sget_select_hyper_blocklist_f -! -! PURPOSE -! Gets the list of hyperslab blocks currently selected. -! -! INPUTS -! space_id - dataspace identifier -! startblock - hyperslab block to start with -! num_blocks - number of blocks to get -! OUTPUTS -! buf - buffer to hold block list -! hdferr - Returns 0 if successful and -1 if fails -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 6, 2001 -! SOURCE - SUBROUTINE h5sget_select_hyper_blocklist_f(space_id, startblock, & - num_blocks, buf, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier - INTEGER(HSIZE_T), INTENT(IN) :: startblock - !Hyperslab block to start with. - INTEGER(HSIZE_T), INTENT(IN) :: num_blocks - !number of hyperslab blocks - !to get in the current dataspace - !selection - INTEGER(HSIZE_T), DIMENSION(*), INTENT(OUT) :: buf - !List of hyperslab blocks selected - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - - INTERFACE - INTEGER FUNCTION h5sget_select_hyper_blocklist_c(space_id, startblock, & - num_blocks, buf ) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5SGET_SELECT_HYPER_BLOCKLIST_C'::h5sget_select_hyper_blocklist_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: space_id - INTEGER(HSIZE_T), INTENT(IN) :: startblock - INTEGER(HSIZE_T), INTENT(IN) :: num_blocks - INTEGER(HSIZE_T), DIMENSION(*), INTENT(OUT) :: buf - END FUNCTION h5sget_select_hyper_blocklist_c - END INTERFACE - - - hdferr = h5sget_select_hyper_blocklist_c(space_id, startblock, & - num_blocks, buf ) - - END SUBROUTINE h5sget_select_hyper_blocklist_f - -! -!****s* H5S/h5sget_select_bounds_f -! -! NAME -! h5sget_select_bounds_f -! -! PURPOSE -! Gets the bounding box containing the current selection. -! -! INPUTS -! space_id - dataspace identifier -! -! OUTPUTS -! start - starting coordinates of bounding box -! end - ending coordinates of bounding box -! hdferr - Returns 0 if successful and -1 if fails -! OPTIONAL PARAMETERS -! NONE -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 6, 2001 -! SOURCE - SUBROUTINE h5sget_select_bounds_f(space_id, start, END, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier - INTEGER(HSIZE_T), DIMENSION(*), INTENT(OUT) :: start - ! Starting coordinates of the bounding box. - INTEGER(HSIZE_T), DIMENSION(*), INTENT(OUT) :: END - !Ending coordinates of the bounding box, - !i.e., the coordinates of the diagonally - !opposite corner - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTERFACE - INTEGER FUNCTION h5sget_select_bounds_c(space_id, start, END) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5SGET_SELECT_BOUNDS_C'::h5sget_select_bounds_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: space_id - INTEGER(HSIZE_T), DIMENSION(*), INTENT(OUT) :: start - INTEGER(HSIZE_T), DIMENSION(*), INTENT(OUT) :: END - END FUNCTION h5sget_select_bounds_c - END INTERFACE - - hdferr = h5sget_select_bounds_c(space_id, start, END) - - END SUBROUTINE h5sget_select_bounds_f - -! -!****s* H5S/h5sget_select_elem_npoints_f -! -! NAME -! h5sget_select_elem_npoints_f -! -! PURPOSE -! Gets the number of element points in the current selection -! -! INPUTS -! space_id - dataspace identifier -! OUTPUTS -! num_points - number of element points in the current -! dataspace selection -! hdferr - Returns 0 if successful and -1 if fails -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 6, 2001 -! -! SOURCE - SUBROUTINE h5sget_select_elem_npoints_f(space_id, num_points, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier - INTEGER(HSSIZE_T), INTENT(OUT) :: num_points - !number of element points - !in the current dataspace - !selection - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTERFACE - INTEGER FUNCTION h5sget_select_elem_npoints_c (space_id, num_points) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) -! DEC$ ATTRIBUTES C,reference,decorate,alias:'H5SGET_SELECT_ELEM_NPOINTS_C'::h5sget_select_elem_npoints_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: space_id - INTEGER(HSSIZE_T), INTENT(OUT) :: num_points - END FUNCTION h5sget_select_elem_npoints_c - END INTERFACE - - hdferr = h5sget_select_elem_npoints_c (space_id, num_points) - - END SUBROUTINE h5sget_select_elem_npoints_f - -! -!****s* H5S/h5sget_select_elem_pointlist_f -! -! NAME -! h5sget_select_elem_pointlist_f -! -! PURPOSE -! Gets the list of element points currently selected. -! -! INPUTS -! space_id - dataspace identifier -! startpoint - element point to start with -! num_points - number of elemnt points to get -! OUTPUTS -! buf - buffer with element points selected -! hdferr - Returns 0 if successful and -1 if fails -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 6, 2001 -! -! SOURCE - SUBROUTINE h5sget_select_elem_pointlist_f(space_id, startpoint, & - num_points, buf, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier - INTEGER(HSIZE_T), INTENT(IN) :: startpoint - !Element point to start with. - INTEGER(HSIZE_T), INTENT(IN) :: num_points - !Number of element points to get - INTEGER(HSIZE_T), DIMENSION(*), INTENT(OUT) :: buf - !List of element points selected - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTERFACE - INTEGER FUNCTION h5sget_select_elem_pointlist_c(space_id, startpoint, & - num_points, buf ) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) -! DEC$ ATTRIBUTES C,reference,decorate,alias:'H5SGET_SELECT_ELEM_POINTLIST_C'::h5sget_select_elem_pointlist_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: space_id - INTEGER(HSIZE_T), INTENT(IN) :: startpoint - INTEGER(HSIZE_T), INTENT(IN) :: num_points - INTEGER(HSIZE_T), DIMENSION(*), INTENT(OUT) :: buf - END FUNCTION h5sget_select_elem_pointlist_c - END INTERFACE - - hdferr = h5sget_select_elem_pointlist_c(space_id, startpoint, & - num_points, buf ) - - END SUBROUTINE h5sget_select_elem_pointlist_f - -! -!****s* H5S/h5sselect_elements_f -! -! NAME -! h5sselect_elements_f -! -! PURPOSE -! Selects elements to be included in the selection for -! a dataspace -! -! INPUTS -! space_id - dataspace identifier -! operator - flag, valid values are: -! H5S_SELECT_SET_F -! H5S_SELECT_APPEND_F -! H5S_SELECT_PREPEND_F -! rank - number of dataspace dimensions -! num_elements - number of elements to be selected -! coord - 2D (rank x num_elements) array with the -! elements coordinates ( 1-based); in C the -! array is stored in 2D as (num_element x rank) -! OUTPUTS -! hdferr - Returns 0 if successful and -1 if fails -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 6, 2001 -! SOURCE - SUBROUTINE h5sselect_elements_f(space_id, OPERATOR, rank, & - num_elements, coord, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: space_id - INTEGER, INTENT(IN) :: OPERATOR - INTEGER, INTENT(IN) :: rank - INTEGER(SIZE_T), INTENT(IN) :: num_elements - INTEGER(HSIZE_T), INTENT(IN) , DIMENSION(rank,num_elements) :: coord - INTEGER, INTENT(OUT) :: hdferr -!***** - INTEGER(HSIZE_T), ALLOCATABLE, DIMENSION(:,:) :: c_coord - INTEGER :: error, i - - INTERFACE - INTEGER FUNCTION h5sselect_elements_c(space_id, OPERATOR,& - num_elements,c_c_coord) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5SSELECT_ELEMENTS_C'::h5sselect_elements_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: space_id - INTEGER, INTENT(IN) :: OPERATOR - INTEGER(SIZE_T), INTENT(IN) :: num_elements - INTEGER(HSIZE_T),DIMENSION(*) :: c_c_coord - END FUNCTION h5sselect_elements_c - END INTERFACE - - ALLOCATE(c_coord(rank,num_elements), STAT = error) - IF (error.NE. 0) THEN - hdferr = -1 - RETURN - ENDIF - DO i = 1, rank - c_coord(i,:) = coord(rank-i+1, :) - 1 - ENDDO - hdferr = h5sselect_elements_c(space_id, OPERATOR, num_elements, c_coord) - -! ALLOCATE(c_coord(num_elements,rank), stat = error) -! IF (error.NE. 0) THEN -! hdferr = -1 -! RETURN -! ENDIF -! -! c_coord = TRANSPOSE(coord) -! hdferr = h5sselect_elements_c(space_id, OPERATOR, INT(rank,size_t), c_coord) - - - DEALLOCATE(c_coord) - - END SUBROUTINE h5sselect_elements_f - -! -!****s* H5S/h5sselect_all_f -! -! NAME -! h5sselect_all_f -! -! PURPOSE -! Selects the entire dataspace. -! -! INPUTS -! space_id - Identifier for the dataspace in which -! selection being made -! OUTPUTS -! hdferr - Returns 0 if successful and -1 if fails -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 6, 2001 -! -! SOURCE - SUBROUTINE h5sselect_all_f(space_id, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTERFACE - INTEGER FUNCTION h5sselect_all_c(space_id) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5SSELECT_ALL_C'::h5sselect_all_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: space_id - END FUNCTION h5sselect_all_c - END INTERFACE - - hdferr = h5sselect_all_c(space_id) - - END SUBROUTINE h5sselect_all_f - -! -!****s* H5S/h5sselect_none_f -! -! NAME -! h5sselect_none_f -! -! PURPOSE -! Resets the selection region to include no elements. -! -! INPUTS -! space_id - the identifier for the dataspace in which -! the selection is being reset. -! OUTPUTS -! hdferr - Returns 0 if successful and -1 if fails -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 6, 2001 -! -! SOURCE - SUBROUTINE h5sselect_none_f(space_id, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTERFACE - INTEGER FUNCTION h5sselect_none_c(space_id) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5SSELECT_NONE_C'::h5sselect_none_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: space_id - END FUNCTION h5sselect_none_c - END INTERFACE - - hdferr = h5sselect_none_c(space_id) - - END SUBROUTINE h5sselect_none_f - -! -!****s* H5S/h5sselect_valid_f -! -! NAME -! h5sselect_valid_f -! -! PURPOSE -! Verifies that the selection is within the extent of -! the dataspace. -! -! INPUTS -! space_id - identifier for the dataspace for which -! selection is verified -! OUTPUTS -! hdferr - Returns 0 if successful and -1 if fails -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 6, 2001 -! -! SOURCE - SUBROUTINE h5sselect_valid_f(space_id, status, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier - LOGICAL, INTENT(OUT) :: status ! TRUE if the selection is - ! contained within the extent, - ! FALSE otherwise. - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTEGER :: flag ! "TRUE/FALSE/ERROR" flag from C routine - - INTERFACE - INTEGER FUNCTION h5sselect_valid_c(space_id, flag) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5SSELECT_VALID_C'::h5sselect_valid_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: space_id - INTEGER :: flag - END FUNCTION h5sselect_valid_c - END INTERFACE - - hdferr = h5sselect_valid_c(space_id, flag) - status = .TRUE. - if (flag .EQ. 0) status = .FALSE. - - END SUBROUTINE h5sselect_valid_f - -! -!****s* H5S/h5sget_simple_extent_npoints_f -! -! NAME -! h5sget_simple_extent_npoints_f -! -! PURPOSE -! Determines the number of elements in a dataspace. -! -! INPUTS -! space_id - dataspace identifier -! OUTPUTS -! npoints - number of elements in the dataspace -! hdferr - Returns 0 if successful and -1 if fails -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 6, 2001 -! -! SOURCE - SUBROUTINE h5sget_simple_extent_npoints_f(space_id, npoints, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier - INTEGER(HSIZE_T), INTENT(OUT) :: npoints ! Number of elements in - ! dataspace - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTERFACE - INTEGER FUNCTION h5sget_simple_extent_npoints_c( space_id, npoints) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5SGET_SIMPLE_EXTENT_NPOINTS_C'::h5sget_simple_extent_npoints_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: space_id - INTEGER(HSIZE_T), INTENT(OUT) :: npoints - END FUNCTION h5sget_simple_extent_npoints_c - END INTERFACE - - hdferr = h5sget_simple_extent_npoints_c( space_id, npoints) - - END SUBROUTINE h5sget_simple_extent_npoints_f - -! -!****s* H5S/h5sget_select_npoints_f -! -! NAME -! h5sget_select_npoints_f -! -! PURPOSE -! Determines the number of elements in a dataspace selection. -! -! INPUTS -! space_id - dataspace identifier -! OUTPUTS -! npoints - number of points in the dataspace selection -! hdferr - Returns 0 if successful and -1 if fails -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 6, 2001 -! SOURCE - SUBROUTINE h5sget_select_npoints_f(space_id, npoints, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier - INTEGER(HSSIZE_T), INTENT(OUT) :: npoints ! Number of elements in the - ! selection - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTERFACE - INTEGER FUNCTION h5sget_select_npoints_c(space_id, npoints) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5SGET_SELECT_NPOINTS_C'::h5sget_select_npoints_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: space_id - INTEGER(HSSIZE_T), INTENT(OUT) :: npoints - END FUNCTION h5sget_select_npoints_c - END INTERFACE - - hdferr = h5sget_select_npoints_c(space_id, npoints) - - END SUBROUTINE h5sget_select_npoints_f - -! -!****s* H5S/h5sget_simple_extent_ndims_f -! -! NAME -! h5sget_simple_extent_ndims_f -! -! PURPOSE -! Determines the dimensionality of a dataspace -! -! INPUTS -! space_id - dataspace identifier -! OUTPUTS -! rank - number of dataspace dimensions -! hdferr - Returns 0 if successful and -1 if fails -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 6, 2001 -! -! SOURCE - SUBROUTINE h5sget_simple_extent_ndims_f(space_id, rank, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier - INTEGER, INTENT(OUT) :: rank ! Number of dimensions - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTERFACE - INTEGER FUNCTION h5sget_simple_extent_ndims_c(space_id, rank) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5SGET_SIMPLE_EXTENT_NDIMS_C'::h5sget_simple_extent_ndims_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: space_id - INTEGER, INTENT(OUT) :: rank - END FUNCTION h5sget_simple_extent_ndims_c - END INTERFACE - - hdferr = h5sget_simple_extent_ndims_c(space_id, rank) - - END SUBROUTINE h5sget_simple_extent_ndims_f -! -!****s* H5S/h5sget_simple_extent_dims_f -! -! NAME -! h5sget_simple_extent_dims_f -! -! PURPOSE -! Retrieves dataspace dimension size and maximum size. -! -! INPUTS -! space_id - dataspace identifier -! OUTPUTS -! dims - array to store size of each dimension -! maxdims - array to store maximum size of each -! dimension -! hdferr - Returns 0 if successful and -1 if fails -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 6, 2001 -! -! SOURCE - SUBROUTINE h5sget_simple_extent_dims_f(space_id, dims, maxdims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier - INTEGER(HSIZE_T), DIMENSION(*), INTENT(OUT) :: dims - ! Array to store dimension sizes - INTEGER(HSIZE_T), DIMENSION(*), INTENT(OUT) :: maxdims - ! Array to store max dimension - ! sizes - INTEGER, INTENT(OUT) :: hdferr ! Error code: -1 on failure, - ! number of dimensions on - ! on success -!***** - INTERFACE - INTEGER FUNCTION h5sget_simple_extent_dims_c(space_id, dims, maxdims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5SGET_SIMPLE_EXTENT_DIMS_C'::h5sget_simple_extent_dims_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: space_id - INTEGER(HSIZE_T), DIMENSION(*), INTENT(OUT) :: dims - INTEGER(HSIZE_T), DIMENSION(*), INTENT(OUT) :: maxdims - END FUNCTION h5sget_simple_extent_dims_c - END INTERFACE - - hdferr = h5sget_simple_extent_dims_c(space_id, dims, maxdims) - - END SUBROUTINE h5sget_simple_extent_dims_f - -! -!****s* H5S/h5sget_simple_extent_type_f -! -! NAME -! h5sget_simple_extent_type_f -! -! PURPOSE -! Determine the current class of a dataspace -! -! INPUTS -! space_id - dataspace identifier -! OUTPUTS -! classtype - class type, possible values are: -! H5S_NO_CLASS_F (-1) -! H5S_SCALAR_F (0) -! H5S_SIMPLE_F (1) -! H5S_NULL_F (2) -! hdferr - Returns 0 if successful and -1 if fails -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 6, 2001 -! -! SOURCE - SUBROUTINE h5sget_simple_extent_type_f(space_id, classtype, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier - INTEGER, INTENT(OUT) :: classtype ! Class type , possible values - ! are: - ! H5S_NO_CLASS_F (-1) - ! H5S_SCALAR_F (0) - ! H5S_SIMPLE_F (1) - ! H5S_NULL_F (2) - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTERFACE - INTEGER FUNCTION h5sget_simple_extent_type_c(space_id, classtype) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5SGET_SIMPLE_EXTENT_TYPE_C'::h5sget_simple_extent_type_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: space_id - INTEGER, INTENT(OUT) :: classtype - END FUNCTION h5sget_simple_extent_type_c - END INTERFACE - - hdferr = h5sget_simple_extent_type_c(space_id, classtype) - - END SUBROUTINE h5sget_simple_extent_type_f -! -!****s* H5S/h5sset_extent_simple_f -! -! NAME -! h5sset_extent_simple_f -! -! PURPOSE -! Sets or resets the size of an existing dataspace. -! -! INPUTS -! space_id - dataspace identifier -! rank - dataspace number of dimensions -! current_size - array with the new sizes of dimensions -! maximum_size - array with the new maximum sizes of -! dimensions -! OUTPUTS -! hdferr - Returns 0 if successful and -1 if fails -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 6, 2001 -! -! SOURCE - SUBROUTINE h5sset_extent_simple_f(space_id, rank, current_size, & - maximum_size, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier - INTEGER, INTENT(IN) :: rank ! Dataspace rank - INTEGER(HSIZE_T), DIMENSION(rank), INTENT(IN) :: current_size - ! Array with the new sizes - ! of dimensions - INTEGER(HSIZE_T), DIMENSION(rank), INTENT(IN) :: maximum_size - ! Array with the new maximum - ! sizes of dimensions - ! sizes - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTERFACE - INTEGER FUNCTION h5sset_extent_simple_c(space_id, rank, & - current_size, maximum_size) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5SSET_EXTENT_SIMPLE_C'::h5sset_extent_simple_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: space_id - INTEGER, INTENT(IN) :: rank - INTEGER(HSIZE_T), DIMENSION(rank), INTENT(IN) :: current_size - INTEGER(HSIZE_T), DIMENSION(rank), INTENT(IN) :: maximum_size - END FUNCTION h5sset_extent_simple_c - END INTERFACE - - hdferr = h5sset_extent_simple_c(space_id, rank, current_size, & - maximum_size) - - END SUBROUTINE h5sset_extent_simple_f -! -!****s* H5S/h5sis_simple_f -! -! NAME -! h5sis_simple_f -! -! PURPOSE -! Determines whether a dataspace is a simple dataspace. -! -! INPUTS -! space_id - dataspace identifier -! OUTPUTS -! status - flag to indicate if dataspace -! is simple or not -! hdferr - Returns 0 if successful and -1 if fails -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 6, 2001 -! -! SOURCE - SUBROUTINE h5sis_simple_f(space_id, status, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier - LOGICAL, INTENT(OUT) :: status ! Flag, idicates if dataspace - ! is simple or not ( TRUE or - ! FALSE) - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTEGER :: flag ! "TRUE/FALSE/ERROR from C" - - INTERFACE - INTEGER FUNCTION h5sis_simple_c(space_id, flag) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5SIS_SIMPLE_C'::h5sis_simple_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: space_id - INTEGER :: flag - END FUNCTION h5sis_simple_c - END INTERFACE - - hdferr = h5sis_simple_c(space_id, flag) - status = .TRUE. - if (flag .EQ. 0) status = .FALSE. - - END SUBROUTINE h5sis_simple_f - -! -!****s* H5S/h5soffset_simple_f -! -! NAME -! h5soffset_simple_f -! -! PURPOSE -! Sets the offset of a simple dataspace. -! -! INPUTS -! space_id - dataspace identifier -! offset - the offset at which to position the -! selection -! OUTPUTS -! hdferr - Returns 0 if successful and -1 if fails -! OPTIONAL PARAMETERS -! NONE -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 6, 2001 -! -! SOURCE - SUBROUTINE h5soffset_simple_f(space_id, offset, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier - INTEGER(HSSIZE_T), DIMENSION(*), INTENT(IN) :: offset - ! The offset at which to position - ! the selection - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTERFACE - INTEGER FUNCTION h5soffset_simple_c(space_id, offset) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5SOFFSET_SIMPLE_C'::h5soffset_simple_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: space_id - INTEGER(HSSIZE_T), DIMENSION(*), INTENT(IN) :: offset - END FUNCTION h5soffset_simple_c - END INTERFACE - - hdferr = h5soffset_simple_c(space_id, offset) - - END SUBROUTINE h5soffset_simple_f - -! -!****s* H5S/h5sextent_copy_f -! -! NAME -! h5sextent_copy_f -! -! PURPOSE -! Copies the extent of a dataspace. -! -! INPUTS -! dest_space_id - the identifier for the dataspace to which -! the extent is copied -! source_space_id - the identifier for the dataspace from -! which the extent is copied -! OUTPUTS -! hdferr - Returns 0 if successful and -1 if fails -! OPTIONAL PARAMETERS -! NONE -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 6, 2001 -! -! NOTES -! - -! SOURCE - SUBROUTINE h5sextent_copy_f(dest_space_id, source_space_id, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dest_space_id ! Identifier of destination - ! dataspace - INTEGER(HID_T), INTENT(IN) :: source_space_id ! Identifier of source - ! dataspace - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTERFACE - INTEGER FUNCTION h5sextent_copy_c(dest_space_id, source_space_id) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5SEXTENT_COPY_C'::h5sextent_copy_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: dest_space_id - INTEGER(HID_T), INTENT(IN) :: source_space_id - END FUNCTION h5sextent_copy_c - END INTERFACE - - hdferr = h5sextent_copy_c(dest_space_id, source_space_id) - - END SUBROUTINE h5sextent_copy_f - -! -!****s* H5S/h5sset_extent_none_f -! -! NAME -! h5sset_extent_none_f -! -! PURPOSE -! Removes the extent from a dataspace. -! -! INPUTS -! space_id - dataspace identifier -! OUTPUTS -! hdferr - Returns 0 if successful and -1 if fails -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 6, 2001 -! -! SOURCE - SUBROUTINE h5sset_extent_none_f(space_id, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTERFACE - INTEGER FUNCTION h5sset_extent_none_c(space_id) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5SSET_EXTENT_NONE_C'::h5sset_extent_none_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: space_id - END FUNCTION h5sset_extent_none_c - END INTERFACE - - hdferr = h5sset_extent_none_c(space_id) - - END SUBROUTINE h5sset_extent_none_f - -! -!****s* H5S/h5sselect_hyperslab_f -! -! NAME -! h5sselect_hyperslab_f -! -! PURPOSE -! Selects a hyperslab region to add to the current selected -! region -! -! INPUTS -! space_id - dataspace identifier -! operator - flag, valid values are: -! H5S_SELECT_SET_F (0) -! H5S_SELECT_OR_F (1) -! start - array with hyperslab offsets -! count - number of blocks included in the -! hyperslab -! OUTPUTS -! hdferr - Returns 0 if successful and -1 if fails -! OPTIONAL PARAMETERS -! stride - array with hyperslab strides -! block - array with hyperslab block sizes -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 6, 2001 -! -! SOURCE - SUBROUTINE h5sselect_hyperslab_f(space_id, operator, start, count, & - hdferr, stride, block) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier - INTEGER, INTENT(IN) :: operator ! Flag, valid values are: - ! H5S_SELECT_SET_F (0) - ! H5S_SELECT_OR_F (1) - ! - INTEGER(HSIZE_T), DIMENSION(*), INTENT(IN) :: start - ! Starting coordinates of the hyperslab - INTEGER(HSIZE_T), DIMENSION(*), INTENT(IN) :: count - ! Number of blocks to select - ! from dataspace - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HSIZE_T), DIMENSION(:), OPTIONAL, INTENT(IN) :: stride - ! Array of how many elements to move - ! in each direction - INTEGER(HSIZE_T), DIMENSION(:), OPTIONAL, INTENT(IN) :: block - ! Sizes of element block -!***** - INTEGER(HSIZE_T), DIMENSION(:), ALLOCATABLE :: def_block - INTEGER(HSIZE_T), DIMENSION(:), ALLOCATABLE :: def_stride - INTEGER :: rank - INTEGER :: error1, error2 - - INTERFACE - INTEGER FUNCTION h5sselect_hyperslab_c(space_id, operator, & - start, count, stride, block) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5SSELECT_HYPERSLAB_C'::h5sselect_hyperslab_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: space_id - INTEGER, INTENT(IN) :: operator - INTEGER(HSIZE_T), DIMENSION(*), INTENT(IN) :: start - INTEGER(HSIZE_T), DIMENSION(*), INTENT(IN) :: count - INTEGER(HSIZE_T), DIMENSION(*), INTENT(IN) :: stride - INTEGER(HSIZE_T), DIMENSION(*), INTENT(IN) :: block - END FUNCTION h5sselect_hyperslab_c - END INTERFACE - - if (present(stride).and. present(block)) then - hdferr = h5sselect_hyperslab_c(space_id, operator, start, count, & - stride, block) - return - endif - ! Case of optional parameters. - ! - ! Find the rank of the dataspace to allocate memery for - ! default stride and block arrays. - ! - CALL h5sget_simple_extent_ndims_f(space_id, rank, hdferr) - if( hdferr .EQ. -1) return - ! - if (present(stride).and. .not.present(block)) then - allocate(def_block(rank), stat=error1) - if (error1.NE.0) then - hdferr = -1 - return - endif - def_block = 1 - hdferr = h5sselect_hyperslab_c(space_id, operator, start, count, & - stride, def_block) - deallocate(def_block) - return - endif - - if (.not.present(stride).and. present(block)) then - allocate(def_stride(rank), stat=error2) - if (error2.NE.0) then - hdferr = -1 - return - endif - def_stride = 1 - hdferr = h5sselect_hyperslab_c(space_id, operator, start, count, & - def_stride, block) - deallocate(def_stride) - return - endif - allocate(def_block(rank), stat=error1) - allocate(def_stride(rank), stat=error2) - if ((error1.NE.0) .OR. (error2.NE.0)) then - hdferr = -1 - return - endif - def_block = 1 - def_stride = 1 - hdferr = h5sselect_hyperslab_c(space_id, operator, start, count, & - def_stride, def_block) - deallocate(def_block) - deallocate(def_stride) - - END SUBROUTINE h5sselect_hyperslab_f -! !$! -! !$!****s* H5S/h5scombine_hyperslab_f -! !$! -! !$! NAME -! !$! h5scombine_hyperslab_f -! !$! -! !$! PURPOSE -! !$! Combine a hyperslab selection with the current -! !$! selection for a dataspace -! !$! -! !$! INPUTS -! !$! space_id - dataspace of selection to use -! !$! operator - flag, valid values are: -! !$! H5S_SELECT_NOOP_F -! !$! H5S_SELECT_SET_F -! !$! H5S_SELECT_OR_F -! !$! H5S_SELECT_AND_F -! !$! H5S_SELECT_XOR_F -! !$! H5S_SELECT_NOTB_F -! !$! H5S_SELECT_NOTA_F -! !$! H5S_SELECT_APPEND_F -! !$! H5S_SELECT_PREPEND_F -! !$! start - array with hyperslab offsets -! !$! count - number of blocks included in the -! !$! hyperslab -! !$! OUTPUTS -! !$! hyper_id - identifier for the new hyperslab -! !$! hdferr: - error code -! !$! Success: 0 -! !$! Failure: -1 -! !$! OPTIONAL PARAMETERS -! !$! stride - array with hyperslab strides -! !$! block - array with hyperslab block sizes -! !$! -! !$! AUTHOR -! !$! Elena Pourmal -! !$! October 7, 2002 -! !$! -! !$! HISTORY -! !$! -! !$! -! !$! NOTES -! !$! Commented out until 1.6 ? 10/08/2002 -! !$! -! !$! SOURCE -! SUBROUTINE h5scombine_hyperslab_f(space_id, operator, start, count, & -! hyper_id, hdferr, stride, block) -! IMPLICIT NONE -! INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier -! INTEGER, INTENT(IN) :: operator ! Flag, valid values are: - ! H5S_SELECT_NOOP_F - ! H5S_SELECT_SET_F - ! H5S_SELECT_OR_F - ! H5S_SELECT_AND_F - ! H5S_SELECT_XOR_F - ! H5S_SELECT_NOTB_F - ! H5S_SELECT_NOTA_F - ! H5S_SELECT_APPEND_F - ! H5S_SELECT_PREPEND_F - ! -! INTEGER(HSIZE_T), DIMENSION(*), INTENT(IN) :: start - ! Starting coordinates of the hyperslab -! INTEGER(HSIZE_T), DIMENSION(*), INTENT(IN) :: count - ! Number of blocks to select - ! from dataspace -! INTEGER(HID_T), INTENT(OUT) :: hyper_id ! New hyperslab identifier -! INTEGER, INTENT(OUT) :: hdferr ! Error code -! INTEGER(HSIZE_T), DIMENSION(:), OPTIONAL, INTENT(IN) :: stride - ! Array of how many elements to move - ! in each direction -! INTEGER(HSIZE_T), DIMENSION(:), OPTIONAL, INTENT(IN) :: block - ! Sizes of element block -! INTEGER(HSIZE_T), DIMENSION(:), ALLOCATABLE :: def_block -! INTEGER(HSIZE_T), DIMENSION(:), ALLOCATABLE :: def_stride -! INTEGER :: rank -! INTEGER :: error1, error2 - -! INTERFACE -! INTEGER FUNCTION h5scombine_hyperslab_c(space_id, operator, & -! start, count, stride, block, hyper_id) -! USE H5GLOBAL -! !DEC$IF DEFINED(HDF5F90_WINDOWS) -! !DEC$ATTRIBUTES C,reference,decorate,alias:'H5SCOMBINE_HYPERSLAB_C'::h5scombine_hyperslab_c -! !DEC$ENDIF -! INTEGER(HID_T), INTENT(IN) :: space_id -! INTEGER, INTENT(IN) :: operator -! INTEGER(HSIZE_T), DIMENSION(*), INTENT(IN) :: start -! INTEGER(HSIZE_T), DIMENSION(*), INTENT(IN) :: count -! INTEGER(HSIZE_T), DIMENSION(*), OPTIONAL, INTENT(IN) :: stride -! INTEGER(HSIZE_T), DIMENSION(*), OPTIONAL, INTENT(IN) :: block -! INTEGER(HID_T), INTENT(OUT) :: hyper_id -! END FUNCTION h5scombine_hyperslab_c -! END INTERFACE - -! if (present(stride).and. present(block)) then -! hdferr = h5scombine_hyperslab_c(space_id, operator, start, count, & -! stride, block, hyper_id) -! return -! endif - ! Case of optional parameters. - ! - ! Find the rank of the dataspace to allocate memery for - ! default stride and block arrays. - ! -! CALL h5sget_simple_extent_ndims_f(space_id, rank, hdferr) -! if( hdferr .EQ. -1) return - ! -! if (present(stride).and. .not.present(block)) then -! allocate(def_block(rank), stat=error1) -! if (error1.NE.0) then -! hdferr = -1 -! return -! endif -! def_block = 1 -! hdferr = h5scombine_hyperslab_c(space_id, operator, start, count, & -! stride, def_block, hyper_id) -! deallocate(def_block) -! return -! endif - -! if (.not.present(stride).and. present(block)) then -! allocate(def_stride(rank), stat=error2) -! if (error2.NE.0) then -! hdferr = -1 -! return -! endif -! def_stride = 1 -! hdferr = h5scombine_hyperslab_c(space_id, operator, start, count, & -! def_stride, block, hyper_id) -! deallocate(def_stride) -! return -! endif -! allocate(def_block(rank), stat=error1) -! allocate(def_stride(rank), stat=error2) -! if ((error1.NE.0) .OR. (error2.NE.0)) then -! hdferr = -1 -! return -! endif -! def_block = 1 -! def_stride = 1 -! hdferr = h5scombine_hyperslab_c(space_id, operator, start, count, & -! def_stride, def_block, hyper_id) -! deallocate(def_block) -! deallocate(def_stride) - -! END SUBROUTINE h5scombine_hyperslab_f - -! !$! -! !$!****s* H5S/ -! !$! -! !$! NAME -! !$! h5scombine_select_f -! !$! -! !$! PURPOSE -! !$! Combine two hyperslab selections with an operation -! !$! and return a dataspace with resulting selection. -! !$! -! !$! INPUTS -! !$! space1_id - dataspace of selection to use -! !$! operator - flag, valid values are: -! !$! H5S_SELECT_NOOP_F -! !$! H5S_SELECT_SET_F -! !$! H5S_SELECT_OR_F -! !$! H5S_SELECT_AND_F -! !$! H5S_SELECT_XOR_F -! !$! H5S_SELECT_NOTB_F -! !$! H5S_SELECT_NOTA_F -! !$! H5S_SELECT_APPEND_F -! !$! H5S_SELECT_PREPEND_F -! !$! space2_id - dataspace of selection to use -! !$! OUTPUTS -! !$! ds_id - idataspace identifier with the new selection -! !$! hdferr: - error code -! !$! Success: 0 -! !$! Failure: -1 -! !$! OPTIONAL PARAMETERS - NONE -! !$! -! !$! AUTHOR -! !$! Elena Pourmal -! !$! October 7, 2002 -! !$! -! !$! HISTORY -! !$! -! !$! -! !$! NOTES commented out until 1.6 release(?) 10/08/2002 -! !$! - -! ! SOURCE -! !$ SUBROUTINE h5scombine_select_f(space1_id, operator, space2_id, & -! ds_id, hdferr) -! IMPLICIT NONE -! INTEGER(HID_T), INTENT(IN) :: space1_id ! First dataspace identifier -! INTEGER(HID_T), INTENT(IN) :: space2_id ! Second dataspace identifier -! INTEGER, INTENT(IN) :: operator ! Flag, valid values are: - ! H5S_SELECT_NOOP_F - ! H5S_SELECT_SET_F - ! H5S_SELECT_OR_F - ! H5S_SELECT_AND_F - ! H5S_SELECT_XOR_F - ! H5S_SELECT_NOTB_F - ! H5S_SELECT_NOTA_F - ! H5S_SELECT_APPEND_F - ! H5S_SELECT_PREPEND_F - ! -! INTEGER(HID_T), INTENT(OUT) :: ds_id ! New dataspace identifier -! INTEGER, INTENT(OUT) :: hdferr ! Error code -! -! INTERFACE -! INTEGER FUNCTION h5scombine_select_c(space1_id, operator, & -! space2_id, ds_id) -! USE H5GLOBAL -! !DEC$IF DEFINED(HDF5F90_WINDOWS) -! !DEC$ATTRIBUTES C,reference,decorate,alias:'H5SCOMBINE_SELECT_C'::h5scombine_select_c -! !DEC$ENDIF -! INTEGER(HID_T), INTENT(IN) :: space1_id -! INTEGER(HID_T), INTENT(IN) :: space2_id -! INTEGER, INTENT(IN) :: operator -! INTEGER(HID_T), INTENT(OUT) :: ds_id -! END FUNCTION h5scombine_select_c -! END INTERFACE - -! hdferr = h5scombine_select_c(space1_id, operator, space2_id, & -! ds_id) -! return - -! END SUBROUTINE h5scombine_select_f - -! !$! -! !$!****s* H5S/ -! !$! -! !$! NAME -! !$! h5sselect_select_f -! !$! -! !$! PURPOSE -! !$! Refine a hyperslab selection with an operation -! !$! using second hyperslab -! !$! -! !$! INPUTS -! !$! space1_id - dataspace of selection to modify -! !$! operator - flag, valid values are: -! !$! H5S_SELECT_NOOP_F -! !$! H5S_SELECT_SET_F -! !$! H5S_SELECT_OR_F -! !$! H5S_SELECT_AND_F -! !$! H5S_SELECT_XOR_F -! !$! H5S_SELECT_NOTB_F -! !$! H5S_SELECT_NOTA_F -! !$! H5S_SELECT_APPEND_F -! !$! H5S_SELECT_PREPEND_F -! !$! space2_id - dataspace of selection to use -! !$! -! !$! OUTPUTS -! !$! hdferr: - error code -! !$! Success: 0 -! !$! Failure: -1 -! !$! OPTIONAL PARAMETERS - NONE -! !$! -! !$! AUTHOR -! !$! Elena Pourmal -! !$! October 7, 2002 -! !$! -! !$! HISTORY -! !$! -! !$! -! !$! NOTESCommented out until 1.6 release(?) 10/08/2002 EIP -! !$! - -! ! SOURCE -! SUBROUTINE h5sselect_select_f(space1_id, operator, space2_id, & -! hdferr) -! IMPLICIT NONE -! INTEGER(HID_T), INTENT(INOUT) :: space1_id ! Dataspace identifier to - ! modify -! INTEGER(HID_T), INTENT(IN) :: space2_id ! Second dataspace identifier -! INTEGER, INTENT(IN) :: operator ! Flag, valid values are: - ! H5S_SELECT_NOOP_F - ! H5S_SELECT_SET_F - ! H5S_SELECT_OR_F - ! H5S_SELECT_AND_F - ! H5S_SELECT_XOR_F - ! H5S_SELECT_NOTB_F - ! H5S_SELECT_NOTA_F - ! H5S_SELECT_APPEND_F - ! H5S_SELECT_PREPEND_F - ! -! INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTERFACE -! INTEGER FUNCTION h5sselect_select_c(space1_id, operator, & -! space2_id) -! USE H5GLOBAL -! !DEC$IF DEFINED(HDF5F90_WINDOWS) -! !DEC$ATTRIBUTES C,reference,decorate,alias:'H5SSELECT_SELECT_C'::h5sselect_select_c -! !DEC$ENDIF -! INTEGER(HID_T), INTENT(INOUT) :: space1_id -! INTEGER(HID_T), INTENT(IN) :: space2_id -! INTEGER, INTENT(IN) :: operator -! END FUNCTION h5sselect_select_c -! END INTERFACE - -! hdferr = h5sselect_select_c(space1_id, operator, space2_id) -! return - -! END SUBROUTINE h5sselect_select_f - -! -!****s* H5S/h5sget_select_type_f -! -! NAME -! h5sget_select_type_f -! -! PURPOSE -! Retrieve the type of selection -! -! INPUTS -! space_id - dataspace iidentifier with selection -! OUTPUTS -! type - flag, valid values are: -! H5S_SEL_ERROR_F -! H5S_SEL_NONE_F -! H5S_SEL_POINTS_F -! H5S_SEL_HYPERSLABS_F -! H5S_SEL_ALL_F -! hdferr - Returns 0 if successful and -1 if fails -! AUTHOR -! Elena Pourmal -! October 7, 2002 -! -! SOURCE - SUBROUTINE h5sget_select_type_f(space_id, type, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(INOUT) :: space_id ! Dataspace identifier to - INTEGER, INTENT(OUT) :: type ! Selection type - ! H5S_SEL_ERROR_F - ! H5S_SEL_NONE_F - ! H5S_SEL_POINTS_F - ! H5S_SEL_HYPERSLABS_F - ! H5S_SEL_ALL_F - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTERFACE - INTEGER FUNCTION h5sget_select_type_c(space_id, type) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5SGET_SELECT_TYPE_C'::h5sget_select_type_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: space_id - INTEGER, INTENT(OUT) :: type - END FUNCTION h5sget_select_type_c - END INTERFACE - - hdferr = h5sget_select_type_c(space_id, type) - return - - END SUBROUTINE h5sget_select_type_f - -! -!****s* H5S/H5Sdecode_f -! -! NAME -! H5Sdecode_f -! -! PURPOSE -! Decode a binary object description of data space and return a new object handle. -! -! INPUTS -! buf - Buffer for the data space object to be decoded. -! obj_id - Object ID -! OUTPUTS -! hdferr - Returns 0 if successful and -1 if fails -! -! AUTHOR -! M. Scot Breitenfeld -! March 26, 2008 -! SOURCE - SUBROUTINE h5sdecode_f(buf, obj_id, hdferr) - IMPLICIT NONE - CHARACTER(LEN=*), INTENT(IN) :: buf ! Buffer for the data space object to be decoded. - INTEGER(HID_T), INTENT(OUT) :: obj_id ! Object ID - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTERFACE - INTEGER FUNCTION h5sdecode_c(buf, obj_id) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5SDECODE_C'::h5sdecode_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: buf - CHARACTER(LEN=*), INTENT(IN) :: buf - INTEGER(HID_T), INTENT(OUT) :: obj_id ! Object ID - END FUNCTION h5sdecode_c - END INTERFACE - - hdferr = h5sdecode_c(buf, obj_id) - - END SUBROUTINE h5sdecode_f - -! -!****s* H5S/H5Sencode_f -! -! NAME -! H5Sencode_f -! -! PURPOSE -! Encode a data space object description into a binary buffer. -! -! INPUTS -! obj_id - Identifier of the object to be encoded. -! buf - Buffer for the object to be encoded into. -! nalloc - The size of the allocated buffer. -! OUTPUTS -! nalloc - The size of the buffer needed. -! hdferr - Returns 0 if successful and -1 if fails. -! -! AUTHOR -! M. Scot Breitenfeld -! March 26, 2008 -! SOURCE - SUBROUTINE h5sencode_f(obj_id, buf, nalloc, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: obj_id ! Identifier of the object to be encoded. - CHARACTER(LEN=*), INTENT(OUT) :: buf ! Buffer for the object to be encoded into. - INTEGER(SIZE_T), INTENT(INOUT) :: nalloc ! The size of the allocated buffer. - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - - INTERFACE - INTEGER FUNCTION h5sencode_c(buf, obj_id, nalloc) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5SENCODE_C'::h5sencode_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: buf - INTEGER(HID_T), INTENT(IN) :: obj_id - CHARACTER(LEN=*), INTENT(OUT) :: buf - INTEGER(SIZE_T), INTENT(INOUT) :: nalloc - END FUNCTION h5sencode_c - END INTERFACE - - hdferr = h5sencode_c(buf, obj_id, nalloc) - - END SUBROUTINE h5sencode_f - -!****s* H5S/h5sextent_equal_f -! -! NAME -! h5sextent_equal_f -! -! PURPOSE -! Determines whether two dataspace extents are equal. -! -! INPUTS -! space1_id - First dataspace identifier. -! space2_id - Second dataspace identifier. -! OUTPUTS -! Equal - .TRUE. if equal, .FALSE. if unequal. -! hdferr - Returns 0 if successful and -1 if fails -! AUTHOR -! M. Scot Breitenfeld -! April 2, 2008 -! -! SOURCE - SUBROUTINE h5sextent_equal_f(space1_id, space2_id, equal, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: space1_id ! First dataspace identifier. - INTEGER(HID_T), INTENT(IN) :: space2_id ! Second dataspace identifier. - LOGICAL, INTENT(OUT) :: Equal ! .TRUE. if equal, .FALSE. if unequal. - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTEGER(HID_T) :: c_equal - - INTERFACE - INTEGER FUNCTION h5sextent_equal_c(space1_id, space2_id, c_equal) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5SEXTENT_EQUAL_C'::h5sextent_equal_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: space1_id - INTEGER(HID_T), INTENT(IN) :: space2_id - INTEGER(HID_T) :: c_equal - END FUNCTION h5sextent_equal_c - END INTERFACE - - hdferr = h5sextent_equal_c(space1_id, space2_id, c_equal) - - - equal = .FALSE. - IF(c_equal.GT.0) equal = .TRUE. - - - END SUBROUTINE h5sextent_equal_f - -END MODULE H5S diff --git a/fortran/src/H5Tf.c b/fortran/src/H5Tf.c index 7e1aa42..b6389258 100644 --- a/fortran/src/H5Tf.c +++ b/fortran/src/H5Tf.c @@ -1,6 +1,6 @@ /****h* H5Tf/H5Tf * PURPOSE - * This file contains C stubs for H5T Fortran APIs + * This file contains C stubs for H5T Fortran APIs * * COPYRIGHT * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * @@ -23,30 +23,29 @@ #include "H5f90.h" - /****if* H5Tf/h5topen_c * NAME * h5topen_c * PURPOSE * Call H5Topen2 to open a datatype * INPUTS - * loc_id - file or group identifier - * name - name of the datatype within file or group - * namelen - name length - * tapl_id - datatype access property list identifier + * loc_id - file or group identifier + * name - name of the datatype within file or group + * namelen - name length + * tapl_id - datatype access property list identifier * OUTPUTS - * type_id - dataset identifier + * type_id - dataset identifier * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * Saturday, August 14, 1999 + * Saturday, August 14, 1999 * HISTORY * * SOURCE */ int_f -nh5topen_c (hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *type_id, hid_t_f *tapl_id) +h5topen_c (hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *type_id, hid_t_f *tapl_id) /******/ { char *c_name = NULL; @@ -75,25 +74,24 @@ done: return ret_value; } - /****if* H5Tf/h5tcommit_c * NAME * h5tcommit_c * PURPOSE * Call H5Tcommit2 to commit a datatype * INPUTS - * loc_id - file or group identifier - * name - name of the datatype within file or group - * namelen - name length - * type_id - dataset identifier - * lcpl_id - Link creation property list - * tcpl_id - Datatype creation property list - * tapl_id - Datatype access property list + * loc_id - file or group identifier + * name - name of the datatype within file or group + * namelen - name length + * type_id - dataset identifier + * lcpl_id - Link creation property list + * tcpl_id - Datatype creation property list + * tapl_id - Datatype access property list * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * Saturday, August 14, 1999 + * Saturday, August 14, 1999 * HISTORY * * - Added passing optional parameters for version 1.8 @@ -101,7 +99,7 @@ done: * SOURCE */ int_f -nh5tcommit_c(hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *type_id, +h5tcommit_c(hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *type_id, hid_t_f *lcpl_id, hid_t_f *tcpl_id, hid_t_f *tapl_id) /******/ { @@ -130,19 +128,19 @@ done: * PURPOSE * Call H5Tclose to close the datatype * INPUTS - * type_id - identifier of the datatype to be closed + * type_id - identifier of the datatype to be closed * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * Saturday, August 14, 1999 + * Saturday, August 14, 1999 * HISTORY * * SOURCE */ int_f -nh5tclose_c ( hid_t_f *type_id ) +h5tclose_c ( hid_t_f *type_id ) /******/ { int ret_value = 0; @@ -153,28 +151,27 @@ nh5tclose_c ( hid_t_f *type_id ) return ret_value; } - /****if* H5Tf/h5tcopy_c * NAME * h5tcopy_c * PURPOSE * Call H5Tcopy to copy a datatype * INPUTS - * type_id - identifier of the datatype to be copied + * type_id - identifier of the datatype to be copied * OUTPUTS - * new_type_id - identifier of the new datatype + * new_type_id - identifier of the new datatype * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * Saturday, August 14, 1999 + * Saturday, August 14, 1999 * HISTORY * * SOURCE */ int_f -nh5tcopy_c ( hid_t_f *type_id , hid_t_f *new_type_id) +h5tcopy_c ( hid_t_f *type_id , hid_t_f *new_type_id) /******/ { int ret_value = 0; @@ -194,22 +191,22 @@ nh5tcopy_c ( hid_t_f *type_id , hid_t_f *new_type_id) * PURPOSE * Call H5Tequal to copy a datatype * INPUTS - * type1_id - datatype identifier - * type2_id - datatype identifier + * type1_id - datatype identifier + * type2_id - datatype identifier * OUTPUTS - * c_flag - flag; indicates if two datatypes are equal or not. + * c_flag - flag; indicates if two datatypes are equal or not. * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * Tuesday, February 22, 2000 + * Tuesday, February 22, 2000 * HISTORY * * SOURCE */ int_f -nh5tequal_c ( hid_t_f *type1_id , hid_t_f *type2_id, int_f *c_flag) +h5tequal_c ( hid_t_f *type1_id , hid_t_f *type2_id, int_f *c_flag) /******/ { int ret_value = -1; @@ -257,7 +254,7 @@ nh5tequal_c ( hid_t_f *type1_id , hid_t_f *type2_id, int_f *c_flag) */ int_f -nh5tget_class_c ( hid_t_f *type_id , int_f *classtype) +h5tget_class_c ( hid_t_f *type_id , int_f *classtype) /******/ { int ret_value = 0; @@ -293,24 +290,24 @@ nh5tget_class_c ( hid_t_f *type_id , int_f *classtype) * PURPOSE * Call H5Tget_order to determine byte order * INPUTS - * type_id - identifier of the dataspace + * type_id - identifier of the dataspace * OUTPUTS - * order; possible values are: + * order; possible values are: * H5T_ORDER_LE_F (0) * H5T_ORDER_BE_F (1) * H5T_ORDER_VAX_F (2) * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * Saturday, August 14, 1999 + * Saturday, August 14, 1999 * HISTORY * * SOURCE */ int_f -nh5tget_order_c ( hid_t_f *type_id , int_f *order) +h5tget_order_c ( hid_t_f *type_id , int_f *order) /******/ { int ret_value = -1; @@ -337,23 +334,23 @@ nh5tget_order_c ( hid_t_f *type_id , int_f *order) * PURPOSE * Call H5Tset_order to set byte order * INPUTS - * type_id - identifier of the dataspace - * order; possible values are: + * type_id - identifier of the dataspace + * order; possible values are: * H5T_ORDER_LE_F (0) * H5T_ORDER_BE_F (1) * H5T_ORDER_VAX_F (2) * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * Saturday, August 14, 1999 + * Saturday, August 14, 1999 * HISTORY * * SOURCE */ int_f -nh5tset_order_c ( hid_t_f *type_id , int_f *order) +h5tset_order_c ( hid_t_f *type_id , int_f *order) /******/ { int ret_value = 0; @@ -378,21 +375,21 @@ nh5tset_order_c ( hid_t_f *type_id , int_f *order) * PURPOSE * Call H5Tget_size to get size of the datatype * INPUTS - * type_id - identifier of the dataspace + * type_id - identifier of the dataspace * OUTPUTS - * size (in bytes) + * size (in bytes) * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * Saturday, August 14, 1999 + * Saturday, August 14, 1999 * HISTORY * * SOURCE */ int_f -nh5tget_size_c ( hid_t_f *type_id , size_t_f *size) +h5tget_size_c ( hid_t_f *type_id , size_t_f *size) /******/ { int ret_value = -1; @@ -413,21 +410,21 @@ nh5tget_size_c ( hid_t_f *type_id , size_t_f *size) * PURPOSE * Call H5Tget_size to get size of the datatype * INPUTS - * type_id - identifier of the dataspace + * type_id - identifier of the dataspace * OUTPUTS - * size (in bytes) + * size (in bytes) * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * Saturday, August 14, 1999 + * Saturday, August 14, 1999 * HISTORY * * SOURCE */ int_f -nh5tset_size_c ( hid_t_f *type_id , size_t_f *size) +h5tset_size_c ( hid_t_f *type_id , size_t_f *size) /******/ { int ret_value = -1; @@ -449,21 +446,21 @@ nh5tset_size_c ( hid_t_f *type_id , size_t_f *size) * PURPOSE * Call H5Tget_precision to get precision of the datatype * INPUTS - * type_id - identifier of the dataspace + * type_id - identifier of the dataspace * OUTPUTS - * precision - number of significant bits + * precision - number of significant bits * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * XIANGYANG SU - * Tuesday, January 25, 2000 + * Tuesday, January 25, 2000 * HISTORY * * SOURCE */ int_f -nh5tget_precision_c ( hid_t_f *type_id , size_t_f *precision) +h5tget_precision_c ( hid_t_f *type_id , size_t_f *precision) /******/ { int ret_value = -1; @@ -484,20 +481,20 @@ nh5tget_precision_c ( hid_t_f *type_id , size_t_f *precision) * PURPOSE * Call H5Tset_precision to set precision of the datatype * INPUTS - * type_id - identifier of the dataspace - * precision - number of significant bits + * type_id - identifier of the dataspace + * precision - number of significant bits * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * XIANGYANG SU - * Tuesday, January 25, 2000 + * Tuesday, January 25, 2000 * HISTORY * * SOURCE */ int_f -nh5tset_precision_c ( hid_t_f *type_id , size_t_f *precision) +h5tset_precision_c ( hid_t_f *type_id , size_t_f *precision) /******/ { int ret_value = -1; @@ -518,23 +515,23 @@ nh5tset_precision_c ( hid_t_f *type_id , size_t_f *precision) * h5tget_offset_c * PURPOSE * Call H5Tget_offset to get bit offset of the first - * significant bit of the datatype + * significant bit of the datatype * INPUTS - * type_id - identifier of the dataspace + * type_id - identifier of the dataspace * OUTPUTS - * offset - bit offset of the first significant bit + * offset - bit offset of the first significant bit * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * XIANGYANG SU - * Tuesday, January 25, 2000 + * Tuesday, January 25, 2000 * HISTORY * * SOURCE */ int_f -nh5tget_offset_c ( hid_t_f *type_id , size_t_f *offset) +h5tget_offset_c ( hid_t_f *type_id , size_t_f *offset) /******/ { int ret_value = -1; @@ -555,22 +552,22 @@ nh5tget_offset_c ( hid_t_f *type_id , size_t_f *offset) * h5tset_offset_c * PURPOSE * Call H5Tset_offset to set bit offset of the first - * significant bit of the datatype + * significant bit of the datatype * INPUTS - * type_id - identifier of the dataspace - * offset - bit offset of the first significant bit + * type_id - identifier of the dataspace + * offset - bit offset of the first significant bit * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * XIANGYANG SU - * Tuesday, January 25, 2000 + * Tuesday, January 25, 2000 * HISTORY * * SOURCE */ int_f -nh5tset_offset_c ( hid_t_f *type_id , size_t_f *offset) +h5tset_offset_c ( hid_t_f *type_id , size_t_f *offset) /******/ { int ret_value = -1; @@ -591,25 +588,25 @@ nh5tset_offset_c ( hid_t_f *type_id , size_t_f *offset) * h5tget_pad_c * PURPOSE * Call H5Tget_pad to get the padding type of the least and - * most-significant bit padding + * most-significant bit padding * * INPUTS - * type_id - identifier of the dataspace + * type_id - identifier of the dataspace * OUTPUTS - * lsbpad - padding type of the least significant bit - * msbpad - padding type of the least significant bit + * lsbpad - padding type of the least significant bit + * msbpad - padding type of the least significant bit * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * XIANGYANG SU - * Wednesday, January 26, 2000 + * Wednesday, January 26, 2000 * HISTORY * * SOURCE */ int_f -nh5tget_pad_c ( hid_t_f *type_id , int_f * lsbpad, int_f * msbpad) +h5tget_pad_c ( hid_t_f *type_id , int_f * lsbpad, int_f * msbpad) /******/ { int ret_value = -1; @@ -631,27 +628,27 @@ nh5tget_pad_c ( hid_t_f *type_id , int_f * lsbpad, int_f * msbpad) * NAME * h5tset_pad_c * INPUTS - * type_id - identifier of the dataspace + * type_id - identifier of the dataspace * PURPOSE * Call H5Tset_pad to set the padding type of the least and - * most-significant bit padding + * most-significant bit padding * * INPUTS - * type_id - identifier of the dataspace - * lsbpad - padding type of the least significant bit - * msbpad - padding type of the least significant bit + * type_id - identifier of the dataspace + * lsbpad - padding type of the least significant bit + * msbpad - padding type of the least significant bit * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * XIANGYANG SU - * Wednesday, January 26, 2000 + * Wednesday, January 26, 2000 * HISTORY * * SOURCE */ int_f -nh5tset_pad_c ( hid_t_f *type_id, int_f * lsbpad, int_f* msbpad ) +h5tset_pad_c ( hid_t_f *type_id, int_f * lsbpad, int_f* msbpad ) /******/ { int ret_value = -1; @@ -674,21 +671,21 @@ nh5tset_pad_c ( hid_t_f *type_id, int_f * lsbpad, int_f* msbpad ) * PURPOSE * Call H5Tget_sign to get sign type for an integer type * INPUTS - * type_id - identifier of the dataspace + * type_id - identifier of the dataspace * OUTPUTS - * sign - sign type for an integer type + * sign - sign type for an integer type * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * XIANGYANG SU - * Wednesday, January 26, 2000 + * Wednesday, January 26, 2000 * HISTORY * * SOURCE */ int_f -nh5tget_sign_c ( hid_t_f *type_id , int_f *sign) +h5tget_sign_c ( hid_t_f *type_id , int_f *sign) /******/ { int ret_value = -1; @@ -709,20 +706,20 @@ nh5tget_sign_c ( hid_t_f *type_id , int_f *sign) * PURPOSE * Call H5Tset_sign to set sign type for an integer type * INPUTS - * type_id - identifier of the dataspace - * sign - sign type for an integer typ + * type_id - identifier of the dataspace + * sign - sign type for an integer typ * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * XIANGYANG SU - * Wednesday, January 26, 2000 + * Wednesday, January 26, 2000 * HISTORY * * SOURCE */ int_f -nh5tset_sign_c ( hid_t_f *type_id , int_f* sign) +h5tset_sign_c ( hid_t_f *type_id , int_f* sign) /******/ { int ret_value = -1; @@ -744,26 +741,26 @@ nh5tset_sign_c ( hid_t_f *type_id , int_f* sign) * h5tget_fields_c * PURPOSE * Call H5Tget_fields to get floating point datatype - * bit field information + * bit field information * INPUTS - * type_id - identifier of the dataspace + * type_id - identifier of the dataspace * OUTPUTS - * epos - exponent bit-position - * esize - size of exponent in bits - * mpos - mantissa bit-position - * msize - size of mantissa in bits + * epos - exponent bit-position + * esize - size of exponent in bits + * mpos - mantissa bit-position + * msize - size of mantissa in bits * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * XIANGYANG SU - * Thursday, January 27, 2000 + * Thursday, January 27, 2000 * HISTORY * * SOURCE */ int_f -nh5tget_fields_c ( hid_t_f *type_id , size_t_f *spos, size_t_f *epos, size_t_f* esize, size_t_f* mpos, size_t_f* msize) +h5tget_fields_c ( hid_t_f *type_id , size_t_f *spos, size_t_f *epos, size_t_f* esize, size_t_f* mpos, size_t_f* msize) /******/ { int ret_value = -1; @@ -788,25 +785,25 @@ nh5tget_fields_c ( hid_t_f *type_id , size_t_f *spos, size_t_f *epos, size_t_f* * h5tset_fields_c * PURPOSE * Call H5Tset_fields to set floating point datatype - * bit field information + * bit field information * INPUTS - * type_id - identifier of the dataspace - * epos - exponent bit-position - * esize - size of exponent in bits - * mpos - mantissa bit-position - * msize - size of mantissa in bits + * type_id - identifier of the dataspace + * epos - exponent bit-position + * esize - size of exponent in bits + * mpos - mantissa bit-position + * msize - size of mantissa in bits * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * XIANGYANG SU - * Wednesday, January 26, 2000 + * Wednesday, January 26, 2000 * HISTORY * * SOURCE */ int_f -nh5tset_fields_c ( hid_t_f *type_id, size_t_f *spos, size_t_f *epos, size_t_f* esize, size_t_f* mpos, size_t_f* msize) +h5tset_fields_c ( hid_t_f *type_id, size_t_f *spos, size_t_f *epos, size_t_f* esize, size_t_f* mpos, size_t_f* msize) /******/ { int ret_value = -1; @@ -832,23 +829,23 @@ nh5tset_fields_c ( hid_t_f *type_id, size_t_f *spos, size_t_f *epos, size_t_f* e * h5tget_ebias_c * PURPOSE * Call H5Tget_ebias to get exponent bias of a - * floating-point type of the datatype + * floating-point type of the datatype * INPUTS - * type_id - identifier of the dataspace + * type_id - identifier of the dataspace * OUTPUTS - * ebias - exponent bias of a floating-point type of the datatype + * ebias - exponent bias of a floating-point type of the datatype * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Xiangyang Su - * Friday, January 27, 2000 + * Friday, January 27, 2000 * HISTORY * * SOURCE */ int_f -nh5tget_ebias_c ( hid_t_f *type_id , size_t_f *ebias) +h5tget_ebias_c ( hid_t_f *type_id , size_t_f *ebias) /******/ { int ret_value = -1; @@ -869,22 +866,22 @@ nh5tget_ebias_c ( hid_t_f *type_id , size_t_f *ebias) * h5tset_ebias_c * PURPOSE * Call H5Tset_ebias to set exponent bias of a - * floating-point type of the datatype + * floating-point type of the datatype * INPUTS - * type_id - identifier of the dataspace - * ebias - exponent bias of a floating-point type of the datatyp + * type_id - identifier of the dataspace + * ebias - exponent bias of a floating-point type of the datatyp * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Xiangyang Su - * Friday, January 27, 2000 + * Friday, January 27, 2000 * HISTORY * * SOURCE */ int_f -nh5tset_ebias_c ( hid_t_f *type_id , size_t_f *ebias) +h5tset_ebias_c ( hid_t_f *type_id , size_t_f *ebias) /******/ { int ret_value = -1; @@ -906,23 +903,23 @@ nh5tset_ebias_c ( hid_t_f *type_id , size_t_f *ebias) * h5tget_norm_c * PURPOSE * Call H5Tget_norm to get mantissa normalization - * of a floating-point datatype + * of a floating-point datatype * INPUTS - * type_id - identifier of the dataspace + * type_id - identifier of the dataspace * OUTPUTS - * norm - mantissa normalization of a floating-point type + * norm - mantissa normalization of a floating-point type * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Xiangyang Su - * Friday, January 27, 2000 + * Friday, January 27, 2000 * HISTORY * * SOURCE */ int_f -nh5tget_norm_c ( hid_t_f *type_id , int_f *norm) +h5tget_norm_c ( hid_t_f *type_id , int_f *norm) /******/ { int ret_value = -1; @@ -943,22 +940,22 @@ nh5tget_norm_c ( hid_t_f *type_id , int_f *norm) * h5tset_norm_c * PURPOSE * Call H5Tset_norm to set mantissa normalization of - * floating-point type of the datatype + * floating-point type of the datatype * INPUTS - * type_id - identifier of the dataspace - * norm - mantissa normalization of a floating-point type + * type_id - identifier of the dataspace + * norm - mantissa normalization of a floating-point type * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Xiangyang Su - * Friday, January 27, 2000 + * Friday, January 27, 2000 * HISTORY * * SOURCE */ int_f -nh5tset_norm_c ( hid_t_f *type_id , int_f *norm) +h5tset_norm_c ( hid_t_f *type_id , int_f *norm) /******/ { int ret_value = -1; @@ -980,25 +977,25 @@ nh5tset_norm_c ( hid_t_f *type_id , int_f *norm) * h5tget_inpad_c * PURPOSE * Call H5Tget_inpad to get the padding type for - * unused bits in floating-point datatypes + * unused bits in floating-point datatypes * * INPUTS - * type_id - identifier of the dataspace + * type_id - identifier of the dataspace * OUTPUTS - * padtype - padding type for - * unused bits in floating-point datatype + * padtype - padding type for + * unused bits in floating-point datatype * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * XIANGYANG SU - * Wednesday, January 26, 2000 + * Wednesday, January 26, 2000 * HISTORY * * SOURCE */ int_f -nh5tget_inpad_c ( hid_t_f *type_id , int_f * padtype) +h5tget_inpad_c ( hid_t_f *type_id , int_f * padtype) /******/ { int ret_value = -1; @@ -1018,27 +1015,27 @@ nh5tget_inpad_c ( hid_t_f *type_id , int_f * padtype) * NAME * h5tset_inpad_c * INPUTS - * type_id - identifier of the dataspace + * type_id - identifier of the dataspace * PURPOSE * Call H5Tset_inpad to set the padding type - * unused bits in floating-point datatype + * unused bits in floating-point datatype * * INPUTS - * type_id - identifier of the dataspace - * padtype - padding type for unused bits - * in floating-point datatypes + * type_id - identifier of the dataspace + * padtype - padding type for unused bits + * in floating-point datatypes * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * XIANGYANG SU - * Wednesday, January 26, 2000 + * Wednesday, January 26, 2000 * HISTORY * * SOURCE */ int_f -nh5tset_inpad_c ( hid_t_f *type_id, int_f * padtype) +h5tset_inpad_c ( hid_t_f *type_id, int_f * padtype) /******/ { int ret_value = -1; @@ -1060,24 +1057,24 @@ nh5tset_inpad_c ( hid_t_f *type_id, int_f * padtype) * h5tget_cset_c * PURPOSE * Call H5Tget_cset to get character set - * type of a string datatype + * type of a string datatype * * INPUTS - * type_id - identifier of the dataspace + * type_id - identifier of the dataspace * OUTPUTS - * cset - character set type of a string datatype + * cset - character set type of a string datatype * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * XIANGYANG SU - * Wednesday, January 26, 2000 + * Wednesday, January 26, 2000 * HISTORY * * SOURCE */ int_f -nh5tget_cset_c ( hid_t_f *type_id , int_f * cset) +h5tget_cset_c ( hid_t_f *type_id , int_f * cset) /******/ { int ret_value = -1; @@ -1097,26 +1094,26 @@ nh5tget_cset_c ( hid_t_f *type_id , int_f * cset) * NAME * h5tset_cset_c * INPUTS - * type_id - identifier of the dataspace + * type_id - identifier of the dataspace * PURPOSE * Call H5Tset_cset to set character set - * type of a string datatype + * type of a string datatype * * INPUTS - * type_id - identifier of the dataspace - * cset - character set type of a string datatype + * type_id - identifier of the dataspace + * cset - character set type of a string datatype * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * XIANGYANG SU - * Wednesday, January 26, 2000 + * Wednesday, January 26, 2000 * HISTORY * * SOURCE */ int_f -nh5tset_cset_c ( hid_t_f *type_id, int_f * cset) +h5tset_cset_c ( hid_t_f *type_id, int_f * cset) /******/ { int ret_value = -1; @@ -1138,22 +1135,22 @@ nh5tset_cset_c ( hid_t_f *type_id, int_f * cset) * h5tget_strpad_c * PURPOSE * Call H5Tget_strpad to get string padding method - * for a string datatype + * for a string datatype * INPUTS - * type_id - identifier of the dataspace + * type_id - identifier of the dataspace * OUTPUTS - * strpad - string padding method for a string datatype + * strpad - string padding method for a string datatype * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * XIANGYANG SU - * Wednesday, January 26, 2000 + * Wednesday, January 26, 2000 * HISTORY * * SOURCE */ int_f -nh5tget_strpad_c ( hid_t_f *type_id , int_f * strpad) +h5tget_strpad_c ( hid_t_f *type_id , int_f * strpad) /******/ { int ret_value = -1; @@ -1173,26 +1170,26 @@ nh5tget_strpad_c ( hid_t_f *type_id , int_f * strpad) * NAME * h5tset_strpad_c * INPUTS - * type_id - identifier of the dataspace + * type_id - identifier of the dataspace * PURPOSE * Call H5Tset_strpad to set string padding method - * for a string datatype + * for a string datatype * * INPUTS - * type_id - identifier of the dataspace - * strpad - string padding method for a string datatype + * type_id - identifier of the dataspace + * strpad - string padding method for a string datatype * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * XIANGYANG SU - * Wednesday, January 26, 2000 + * Wednesday, January 26, 2000 * HISTORY * * SOURCE */ int_f -nh5tset_strpad_c ( hid_t_f *type_id, int_f * strpad) +h5tset_strpad_c ( hid_t_f *type_id, int_f * strpad) /******/ { int ret_value = -1; @@ -1214,23 +1211,23 @@ nh5tset_strpad_c ( hid_t_f *type_id, int_f * strpad) * h5tget_nmembers_c * PURPOSE * Call H5Tget_nmembers to get number of fields - * in a compound datatype + * in a compound datatype * INPUTS - * type_id - identifier of the dataspace + * type_id - identifier of the dataspace * OUTPUTS - * num_members - number of fields in a compound datatype + * num_members - number of fields in a compound datatype * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * XIANGYANG SU - * Thursday, February 3, 2000 + * Thursday, February 3, 2000 * HISTORY * * SOURCE */ int_f -nh5tget_nmembers_c ( hid_t_f *type_id , int_f * num_members) +h5tget_nmembers_c ( hid_t_f *type_id , int_f * num_members) /******/ { int ret_value = -1; @@ -1249,24 +1246,24 @@ nh5tget_nmembers_c ( hid_t_f *type_id , int_f * num_members) * h5tget_member_name_c * PURPOSE * Call H5Tget_member_name to get name - * of a compound datatype + * of a compound datatype * INPUTS - * type_id - identifier of the dataspace + * type_id - identifier of the dataspace * OUTPUTS - * member_name - name of a field of a compound datatype + * member_name - name of a field of a compound datatype * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * XIANGYANG SU - * Thursday, February 3, 2000 + * Thursday, February 3, 2000 * HISTORY - * Elena Pourmal - * Added namelen parameter to return length of the name to Fortran user + * Elena Pourmal + * Added namelen parameter to return length of the name to Fortran user * SOURCE */ int_f -nh5tget_member_name_c ( hid_t_f *type_id ,int_f* idx, _fcd member_name, int_f *namelen) +h5tget_member_name_c ( hid_t_f *type_id ,int_f* idx, _fcd member_name, int_f *namelen) /******/ { int ret_value = -1; @@ -1290,15 +1287,15 @@ nh5tget_member_name_c ( hid_t_f *type_id ,int_f* idx, _fcd member_name, int_f *n * h5tget_member_index_c * PURPOSE * Call H5Tget_member_index to get an index of - * the specified datatype filed or member. + * the specified datatype filed or member. * INPUTS - * type_id - datatype identifier - * name - name of the datatype within file or group - * namelen - name length + * type_id - datatype identifier + * name - name of the datatype within file or group + * namelen - name length * OUTPUTS - * index - 0-based index + * index - 0-based index * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal * Thursday, September 26, 2002 @@ -1307,7 +1304,7 @@ nh5tget_member_name_c ( hid_t_f *type_id ,int_f* idx, _fcd member_name, int_f *n * SOURCE */ int_f -nh5tget_member_index_c (hid_t_f *type_id, _fcd name, int_f *namelen, int_f *idx) +h5tget_member_index_c (hid_t_f *type_id, _fcd name, int_f *namelen, int_f *idx) /******/ { int ret_value = -1; @@ -1341,26 +1338,26 @@ DONE: * h5tget_member_offset_c * PURPOSE * Call H5Tget_member_offset to get byte offset of the - * beginning of a field within a compound datatype with - * respect to the beginning of the compound data type datum + * beginning of a field within a compound datatype with + * respect to the beginning of the compound data type datum * INPUTS - * type_id - identifier of the dataspace - * member_no - Number of the field whose offset is requested + * type_id - identifier of the dataspace + * member_no - Number of the field whose offset is requested * OUTPUTS - * offset - byte offset of the the beginning of the field of - * a compound datatype + * offset - byte offset of the the beginning of the field of + * a compound datatype * RETURNS - * always 0 + * always 0 * AUTHOR * XIANGYANG SU - * Thursday, February 3, 2000 + * Thursday, February 3, 2000 * HISTORY * * SOURCE */ int_f -nh5tget_member_offset_c ( hid_t_f *type_id ,int_f* member_no, size_t_f * offset) +h5tget_member_offset_c ( hid_t_f *type_id ,int_f* member_no, size_t_f * offset) /******/ { int ret_value = -1; @@ -1377,23 +1374,23 @@ nh5tget_member_offset_c ( hid_t_f *type_id ,int_f* member_no, size_t_f * offset) * h5tget_array_dims_c * PURPOSE * Call H5Tget_array_dims2 to get - * dimensions of array datatype + * dimensions of array datatype * INPUTS - * type_id - identifier of the array datatype + * type_id - identifier of the array datatype * OUTPUTS - * dims - dimensions(sizes of dimensions) of the array + * dims - dimensions(sizes of dimensions) of the array * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * Thursday, November 16, 2000 + * Thursday, November 16, 2000 * HISTORY * * SOURCE */ int_f -nh5tget_array_dims_c ( hid_t_f *type_id , hsize_t_f * dims) +h5tget_array_dims_c ( hid_t_f *type_id , hsize_t_f * dims) /******/ { hsize_t c_dims[H5S_MAX_RANK]; @@ -1420,23 +1417,23 @@ DONE: * h5tget_array_ndims_c * PURPOSE * Call H5Tget_array_ndims to get number - * of dimensions of array datatype + * of dimensions of array datatype * INPUTS - * type_id - identifier of the array datatype + * type_id - identifier of the array datatype * OUTPUTS - * ndims - number of dimensions of the array + * ndims - number of dimensions of the array * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * Thursday, November 16, 2000 + * Thursday, November 16, 2000 * HISTORY * * SOURCE */ int_f -nh5tget_array_ndims_c ( hid_t_f *type_id , int_f * ndims) +h5tget_array_ndims_c ( hid_t_f *type_id , int_f * ndims) /******/ { int ret_value = -1; @@ -1457,23 +1454,23 @@ nh5tget_array_ndims_c ( hid_t_f *type_id , int_f * ndims) * h5tget_super_c * PURPOSE * Call H5Tget_super to get base datatype from which - * datatype was derived + * datatype was derived * INPUTS - * type_id - identifier of the array datatype + * type_id - identifier of the array datatype * OUTPUTS - * base_type_id - base datatype identifier + * base_type_id - base datatype identifier * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * Thursday, November 16, 2000 + * Thursday, November 16, 2000 * HISTORY * * SOURCE */ int_f -nh5tget_super_c ( hid_t_f *type_id , hid_t_f *base_type_id) +h5tget_super_c ( hid_t_f *type_id , hid_t_f *base_type_id) /******/ { int ret_value = -1; @@ -1495,14 +1492,14 @@ nh5tget_super_c ( hid_t_f *type_id , hid_t_f *base_type_id) * h5tget_member_type_c * PURPOSE * Call H5Tget_member_type to get the identifier of a copy of - * the datatype of the field + * the datatype of the field * INPUTS - * type_id - identifier of the datatype - * field_idx - Field index (0-based) of the field type to retrieve + * type_id - identifier of the datatype + * field_idx - Field index (0-based) of the field type to retrieve * OUTPUTS - * datatype - identifier of a copy of the datatype of the field + * datatype - identifier of a copy of the datatype of the field * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * XIANGYANG SU * Thursday, February 3, 2000 @@ -1512,7 +1509,7 @@ nh5tget_super_c ( hid_t_f *type_id , hid_t_f *base_type_id) */ int_f -nh5tget_member_type_c ( hid_t_f *type_id ,int_f* field_idx, hid_t_f * datatype) +h5tget_member_type_c ( hid_t_f *type_id ,int_f* field_idx, hid_t_f * datatype) /******/ { int ret_value = -1; @@ -1531,10 +1528,10 @@ nh5tget_member_type_c ( hid_t_f *type_id ,int_f* field_idx, hid_t_f * datatype) * PURPOSE * Call H5Tcreate to create a datatype * INPUTS - * cls - class type - * size - size of the class memeber + * cls - class type + * size - size of the class memeber * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal * Thursday, February 17, 2000 @@ -1544,7 +1541,7 @@ nh5tget_member_type_c ( hid_t_f *type_id ,int_f* field_idx, hid_t_f * datatype) */ int_f -nh5tcreate_c(int_f *cls, size_t_f *size, hid_t_f *type_id) +h5tcreate_c(int_f *cls, size_t_f *size, hid_t_f *type_id) /******/ { int ret_value = -1; @@ -1583,7 +1580,7 @@ nh5tcreate_c(int_f *cls, size_t_f *size, hid_t_f *type_id) */ int_f -nh5tinsert_c(hid_t_f *type_id, _fcd name, int_f* namelen, size_t_f *offset, hid_t_f * field_id) +h5tinsert_c(hid_t_f *type_id, _fcd name, int_f* namelen, size_t_f *offset, hid_t_f * field_id) /******/ { int ret_value = -1; @@ -1622,7 +1619,7 @@ nh5tinsert_c(hid_t_f *type_id, _fcd name, int_f* namelen, size_t_f *offset, hid_ */ int_f -nh5tpack_c(hid_t_f * type_id) +h5tpack_c(hid_t_f * type_id) /******/ { int ret_value = -1; @@ -1643,12 +1640,12 @@ nh5tpack_c(hid_t_f * type_id) * PURPOSE * Call H5Tarray_create2 to create array datatype * INPUTS - * base_id - identifier of array base datatype - * rank - array's rank - * dims - Size of new member array - * type_id - identifier of the array datatype + * base_id - identifier of array base datatype + * rank - array's rank + * dims - Size of new member array + * type_id - identifier of the array datatype * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal * Thursday, November 16, 2000 @@ -1657,7 +1654,7 @@ nh5tpack_c(hid_t_f * type_id) * SOURCE */ int_f -nh5tarray_create_c(hid_t_f * base_id, int_f *rank, hsize_t_f* dims, hid_t_f* type_id) +h5tarray_create_c(hid_t_f * base_id, int_f *rank, hsize_t_f* dims, hid_t_f* type_id) /******/ { hsize_t c_dims[H5S_MAX_RANK]; @@ -1692,7 +1689,7 @@ DONE: * parent_id - Datatype identifier for the base datatype * OUTPUTS * new_type_id - datatype identifier for the new - * enumeration datatype + * enumeration datatype * RETURNS * 0 on success, -1 on failure * AUTHOR @@ -1704,7 +1701,7 @@ DONE: */ int_f -nh5tenum_create_c ( hid_t_f *parent_id , hid_t_f *new_type_id) +h5tenum_create_c ( hid_t_f *parent_id , hid_t_f *new_type_id) /******/ { int ret_value = 0; @@ -1740,7 +1737,7 @@ nh5tenum_create_c ( hid_t_f *parent_id , hid_t_f *new_type_id) */ int_f -nh5tenum_insert_c(hid_t_f *type_id, _fcd name, int_f* namelen, int_f* value) +h5tenum_insert_c(hid_t_f *type_id, _fcd name, int_f* namelen, int_f* value) /******/ { int ret_value = -1; @@ -1767,24 +1764,24 @@ nh5tenum_insert_c(hid_t_f *type_id, _fcd name, int_f* namelen, int_f* value) * h5tenum_nameof_c * PURPOSE * Call H5Tenum_nameof to find the symbol name that corresponds to - * the specified value of the enumeration datatype type + * the specified value of the enumeration datatype type * INPUTS - * type_id - identifier of the datatype - * namelen - length of the name - * value - value of the enumeration datatype - * Output: name - Name of the enumeration datatype + * type_id - identifier of the datatype + * namelen - length of the name + * value - value of the enumeration datatype + * Output: name - Name of the enumeration datatype * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * XIANGYANG SU - * Thursday, February 3, 2000 + * Thursday, February 3, 2000 * HISTORY * * SOURCE */ int_f -nh5tenum_nameof_c(hid_t_f *type_id, int_f* value, _fcd name, size_t_f* namelen) +h5tenum_nameof_c(hid_t_f *type_id, int_f* value, _fcd name, size_t_f* namelen) /******/ { int ret_value = -1; @@ -1811,24 +1808,24 @@ nh5tenum_nameof_c(hid_t_f *type_id, int_f* value, _fcd name, size_t_f* namelen) * h5tenum_valueof_c * PURPOSE * Call H5Tenum_valueof to find the value of that corresponds to - * the specified name of the enumeration datatype type + * the specified name of the enumeration datatype type * INPUTS - * type_id - identifier of the datatype - * name - Name of the enumeration datatype - * namelen - length of name - * Output: value - value of the enumeration datatype + * type_id - identifier of the datatype + * name - Name of the enumeration datatype + * namelen - length of name + * Output: value - value of the enumeration datatype * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * XIANGYANG SU - * Thursday, February 3, 2000 + * Thursday, February 3, 2000 * HISTORY * * SOURCE */ int_f -nh5tenum_valueof_c(hid_t_f *type_id, _fcd name, int_f* namelen, int_f* value) +h5tenum_valueof_c(hid_t_f *type_id, _fcd name, int_f* namelen, int_f* value) /******/ { int ret_value = -1; @@ -1851,23 +1848,23 @@ nh5tenum_valueof_c(hid_t_f *type_id, _fcd name, int_f* namelen, int_f* value) * h5tget_member_value_c * PURPOSE * Call H5Tget_member_value to get the value of an - * enumeration datatype member + * enumeration datatype member * INPUTS - * type_id - identifier of the datatype - * member_no - Number of the enumeration datatype member. - * Output: value - value of the enumeration datatype + * type_id - identifier of the datatype + * member_no - Number of the enumeration datatype member. + * Output: value - value of the enumeration datatype * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * XIANGYANG SU - * Thursday, February 3, 2000 + * Thursday, February 3, 2000 * HISTORY * * SOURCE */ int_f -nh5tget_member_value_c(hid_t_f *type_id, int_f* member_no, int_f* value) +h5tget_member_value_c(hid_t_f *type_id, int_f* member_no, int_f* value) /******/ { int ret_value = -1; @@ -1886,25 +1883,25 @@ nh5tget_member_value_c(hid_t_f *type_id, int_f* member_no, int_f* value) * NAME * h5tset_tag_c * INPUTS - * type_id - identifier of the dataspace + * type_id - identifier of the dataspace * PURPOSE * Call H5Tset_tag to set an opaque datatype tag * INPUTS - * type_id - identifier of the dataspace - * tag - Unique ASCII string with which the opaque - * datatype is to be tagged - * namelen - length of tag + * type_id - identifier of the dataspace + * tag - Unique ASCII string with which the opaque + * datatype is to be tagged + * namelen - length of tag * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * XIANGYANG SU - * Wednesday, January 26, 2000 + * Wednesday, January 26, 2000 * HISTORY * * SOURCE */ int_f -nh5tset_tag_c(hid_t_f* type_id, _fcd tag, int_f* namelen) +h5tset_tag_c(hid_t_f* type_id, _fcd tag, int_f* namelen) /******/ { int ret_value = -1; @@ -1929,11 +1926,11 @@ nh5tset_tag_c(hid_t_f* type_id, _fcd tag, int_f* namelen) * INPUTS * type_id - identifier of the datatype * OUTPUTS - * tag - Unique ASCII string with which the opaque - * datatype is to be tagged - * taglen - length of tag + * tag - Unique ASCII string with which the opaque + * datatype is to be tagged + * taglen - length of tag * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * XIANGYANG SU * Wednesday, January 26, 2000 @@ -1942,7 +1939,7 @@ nh5tset_tag_c(hid_t_f* type_id, _fcd tag, int_f* namelen) * SOURCE */ int_f -nh5tget_tag_c(hid_t_f* type_id, _fcd tag, size_t_f* tag_size, int_f* taglen) +h5tget_tag_c(hid_t_f* type_id, _fcd tag, size_t_f* tag_size, int_f* taglen) /******/ { int ret_value = -1; @@ -1965,20 +1962,20 @@ nh5tget_tag_c(hid_t_f* type_id, _fcd tag, size_t_f* tag_size, int_f* taglen) * PURPOSE * Call H5Tvlen_create to create VL dtatype * INPUTS - * type_id - identifier of the base datatype + * type_id - identifier of the base datatype * OUTPUTS - * vltype_id - identifier of the VL datatype + * vltype_id - identifier of the VL datatype * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * Wednesday, October 23, 2002 + * Wednesday, October 23, 2002 * HISTORY * * SOURCE */ int_f -nh5tvlen_create_c(hid_t_f* type_id, hid_t_f *vltype_id) +h5tvlen_create_c(hid_t_f* type_id, hid_t_f *vltype_id) /******/ { int ret_value = -1; @@ -1997,24 +1994,24 @@ nh5tvlen_create_c(hid_t_f* type_id, hid_t_f *vltype_id) * h5tis_variable_str_c * PURPOSE * Call H5Tis_variable_str to detrmine if the datatype - * is a variable string. + * is a variable string. * INPUTS - * type_id - identifier of the dataspace + * type_id - identifier of the dataspace * OUTPUTS - * flag - 0 if not VL str, 1 if is not - * and negative on failure. + * flag - 0 if not VL str, 1 if is not + * and negative on failure. * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * Wednesday, March 12 , 2003 + * Wednesday, March 12 , 2003 * HISTORY * * SOURCE */ int_f -nh5tis_variable_str_c ( hid_t_f *type_id , int_f *flag ) +h5tis_variable_str_c ( hid_t_f *type_id , int_f *flag ) /******/ { int ret_value = 0; @@ -2034,13 +2031,13 @@ nh5tis_variable_str_c ( hid_t_f *type_id , int_f *flag ) * Call H5Tget_member_class to detrmine ithe class of the compound * datatype member * INPUTS - * type_id - identifier of the dataspace - * member_no - member's index + * type_id - identifier of the dataspace + * member_no - member's index * OUTPUTS - * class - member's class - * and negative on failure. + * class - member's class + * and negative on failure. * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal * Wednesday, April 6, 2005 @@ -2050,7 +2047,7 @@ nh5tis_variable_str_c ( hid_t_f *type_id , int_f *flag ) */ int_f -nh5tget_member_class_c ( hid_t_f *type_id , int_f *member_no, int_f *cls ) +h5tget_member_class_c ( hid_t_f *type_id , int_f *member_no, int_f *cls ) /******/ { int ret_value = 0; @@ -2073,12 +2070,12 @@ nh5tget_member_class_c ( hid_t_f *type_id , int_f *member_no, int_f *cls ) * PURPOSE * Call H5Tcommit_anon * INPUTS - * loc_id - file or group identifier - * dtype_id - dataset identifier - * tcpl_id - Datatype creation property list - * tapl_id - Datatype access property list + * loc_id - file or group identifier + * dtype_id - dataset identifier + * tcpl_id - Datatype creation property list + * tapl_id - Datatype access property list * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * M. Scot Breitenfeld * February 25, 2008 @@ -2087,7 +2084,7 @@ nh5tget_member_class_c ( hid_t_f *type_id , int_f *member_no, int_f *cls ) * SOURCE */ int_f -nh5tcommit_anon_c(hid_t_f *loc_id, hid_t_f *dtype_id, +h5tcommit_anon_c(hid_t_f *loc_id, hid_t_f *dtype_id, hid_t_f *tcpl_id, hid_t_f *tapl_id) /******/ { @@ -2108,10 +2105,10 @@ nh5tcommit_anon_c(hid_t_f *loc_id, hid_t_f *dtype_id, * h5tcommitted_c * PURPOSE * Call H5Tcommitted - * dtype_id - dataset identifier + * dtype_id - dataset identifier * RETURNS - * a positive value, for TRUE, if the datatype has been committed, - * or 0 (zero), for FALSE, if the datatype has not been committed. + * a positive value, for TRUE, if the datatype has been committed, + * or 0 (zero), for FALSE, if the datatype has not been committed. * Otherwise returns a negative value. * AUTHOR * M. Scot Breitenfeld @@ -2121,7 +2118,7 @@ nh5tcommit_anon_c(hid_t_f *loc_id, hid_t_f *dtype_id, * SOURCE */ int_f -nh5tcommitted_c(hid_t_f *dtype_id) +h5tcommitted_c(hid_t_f *dtype_id) /******/ { int_f ret_value; @@ -2144,10 +2141,10 @@ nh5tcommitted_c(hid_t_f *dtype_id) * buf - Buffer for the data space object to be decoded. * OUTPUTS * - * obj_id - Object_id (non-negative) + * obj_id - Object_id (non-negative) * * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * M. Scot Breitenfeld * April 9, 2008 @@ -2157,7 +2154,7 @@ nh5tcommitted_c(hid_t_f *dtype_id) */ int_f -nh5tdecode_c ( _fcd buf, hid_t_f *obj_id ) +h5tdecode_c ( _fcd buf, hid_t_f *obj_id ) /******/ { int ret_value = -1; @@ -2187,11 +2184,11 @@ nh5tdecode_c ( _fcd buf, hid_t_f *obj_id ) * Call H5Tencode * INPUTS * - * obj_id - Identifier of the object to be encoded. + * obj_id - Identifier of the object to be encoded. * buf - Buffer for the object to be encoded into. - * nalloc - The size of the allocated buffer. + * nalloc - The size of the allocated buffer. * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * M. Scot Breitenfeld * April 9, 2008 @@ -2201,7 +2198,7 @@ nh5tdecode_c ( _fcd buf, hid_t_f *obj_id ) */ int_f -nh5tencode_c (_fcd buf, hid_t_f *obj_id, size_t_f *nalloc ) +h5tencode_c (_fcd buf, hid_t_f *obj_id, size_t_f *nalloc ) /******/ { int ret_value = -1; @@ -2256,11 +2253,11 @@ nh5tencode_c (_fcd buf, hid_t_f *obj_id, size_t_f *nalloc ) * PURPOSE * Call H5Tget_create_plist * INPUTS - * dtype_id - Datatype identifier + * dtype_id - Datatype identifier * OUTPUTS - * dtpl_id - Datatype property list identifier + * dtpl_id - Datatype property list identifier * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * M. Scot Breitenfeld * April 9, 2008 @@ -2270,7 +2267,7 @@ nh5tencode_c (_fcd buf, hid_t_f *obj_id, size_t_f *nalloc ) */ int_f -nh5tget_create_plist_c ( hid_t_f *dtype_id, hid_t_f *dtpl_id) +h5tget_create_plist_c ( hid_t_f *dtype_id, hid_t_f *dtpl_id) /******/ { int_f ret_value=-1; /* Return value */ @@ -2289,12 +2286,12 @@ nh5tget_create_plist_c ( hid_t_f *dtype_id, hid_t_f *dtpl_id) * Call H5Tcompiler_conv * INPUTS * - * src_id - Identifier for the source datatype. - * dst_id - Identifier for the destination datatype. + * src_id - Identifier for the source datatype. + * dst_id - Identifier for the destination datatype. * OUTPUTS - * c_flag - flag; TRUE for compiler conversion, FALSE for library conversion + * c_flag - flag; TRUE for compiler conversion, FALSE for library conversion * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * M.Scot Breitenfeld * April 9, 2008 @@ -2304,7 +2301,7 @@ nh5tget_create_plist_c ( hid_t_f *dtype_id, hid_t_f *dtpl_id) */ int_f -nh5tcompiler_conv_c ( hid_t_f *src_id, hid_t_f *dst_id, int_f *c_flag) +h5tcompiler_conv_c ( hid_t_f *src_id, hid_t_f *dst_id, int_f *c_flag) /******/ { int ret_value = -1; @@ -2323,12 +2320,12 @@ nh5tcompiler_conv_c ( hid_t_f *src_id, hid_t_f *dst_id, int_f *c_flag) * Call H5Tget_native_type * INPUTS * - * dtype_id - Datatype identifier for the dataset datatype. - * direction - Direction of search. + * dtype_id - Datatype identifier for the dataset datatype. + * direction - Direction of search. * OUTPUTS - * native_dtype_id - The native datatype identifier for the specified dataset datatype + * native_dtype_id - The native datatype identifier for the specified dataset datatype * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * M. Scot Breitenfeld * June 18, 2008 @@ -2338,7 +2335,7 @@ nh5tcompiler_conv_c ( hid_t_f *src_id, hid_t_f *dst_id, int_f *c_flag) */ int_f -nh5tget_native_type_c(hid_t_f *dtype_id, int_f *direction, hid_t_f *native_dtype_id) +h5tget_native_type_c(hid_t_f *dtype_id, int_f *direction, hid_t_f *native_dtype_id) /******/ { int ret_value = -1; diff --git a/fortran/src/H5Tff.F90 b/fortran/src/H5Tff.F90 new file mode 100644 index 0000000..6b8f896 --- /dev/null +++ b/fortran/src/H5Tff.F90 @@ -0,0 +1,3082 @@ +!****h* ROBODoc/H5T +! +! NAME +! MODULE H5T +! +! PURPOSE +! This file contains Fortran interfaces for H5T functions. +! +! 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. * +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! +! NOTES +! +! _____ __ __ _____ ____ _____ _______ _ _ _______ +! |_ _| \/ | __ \ / __ \| __ \__ __|/\ | \ | |__ __| +! **** | | | \ / | |__) | | | | |__) | | | / \ | \| | | | **** +! **** | | | |\/| | ___/| | | | _ / | | / /\ \ | . ` | | | **** +! **** _| |_| | | | | | |__| | | \ \ | |/ ____ \| |\ | | | **** +! |_____|_| |_|_| \____/|_| \_\ |_/_/ \_\_| \_| |_| +! +! If you add a new function here then you MUST add the function name to the +! Windows dll file 'hdf5_fortrandll.def.in' in the fortran/src directory. +! This is needed for Windows based operating systems. +! +!***** + +MODULE H5T + + USE, INTRINSIC :: ISO_C_BINDING, ONLY : C_PTR, C_CHAR, C_NULL_PTR + USE H5GLOBAL + IMPLICIT NONE + +!****t* H5T/hvl_t +! Fortran2003 Derived Type: + TYPE hvl_t + INTEGER(size_t) :: len ! Length of VL data (in base type units) + TYPE(C_PTR) :: p ! Pointer to VL data + END TYPE hvl_t + +!***** + + INTERFACE h5tenum_insert_f + MODULE PROCEDURE h5tenum_insert_f03 + MODULE PROCEDURE h5tenum_insert_f90 + END INTERFACE + +CONTAINS + +! +!****s* H5T/h5topen_f +! +! NAME +! h5topen_f +! +! PURPOSE +! Opens named datatype. +! +! INPUTS +! loc_id - location identifier +! name - a datatype name +! OUTPUTS +! type_id - datatype identifier +! hdferr - Returns 0 if successful and -1 if fails +! OPTIONAL PARAMETERS +! tapl_id - datatype access property list identifier. +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 7, 2001 +! +! Added optional parameter 'tapl_id' for compatability +! with H5Topen2. April 9, 2009. +! +! SOURCE + SUBROUTINE h5topen_f(loc_id, name, type_id, hdferr, tapl_id) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id + CHARACTER(LEN=*), INTENT(IN) :: name + INTEGER(HID_T), INTENT(OUT) :: type_id + INTEGER, INTENT(OUT) :: hdferr + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: tapl_id +!***** + INTEGER :: namelen ! Name length + INTEGER(HID_T) :: tapl_id_default + + INTERFACE + INTEGER FUNCTION h5topen_c(loc_id, name, namelen, type_id, tapl_id_default) BIND(C,NAME='h5topen_c') + IMPORT :: C_CHAR + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id + CHARACTER(KIND=C_CHAR), INTENT(IN) :: name + INTEGER :: namelen + INTEGER(HID_T), INTENT(OUT) :: type_id + INTEGER(HID_T) :: tapl_id_default + END FUNCTION h5topen_c + END INTERFACE + + namelen = LEN(name) + + tapl_id_default = H5P_DEFAULT_F + IF(PRESENT(tapl_id)) tapl_id_default = tapl_id + + hdferr = h5topen_c(loc_id, name, namelen, type_id, tapl_id_default) + END SUBROUTINE h5topen_f +! +!****s* H5T/h5tcommit_f +! +! NAME +! h5tcommit_f +! +! PURPOSE +! Commits a transient datatype to a file, creating a +! new named datatype. +! +! INPUTS +! loc_id - location identifier +! name - name of the datatype to be stored +! at the specified location +! type_id - identifier of a datatype to be stored +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails +! OPTIONAL PARAMETERS +! lcpl_id - Link creation property list +! tcpl_id - Datatype creation property list +! tapl_id - Datatype access property list +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! - Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 7, 2001 +! +! - Added optional parameters introduced in version 1.8 +! M. Scot Breitenfeld +! +! SOURCE + SUBROUTINE h5tcommit_f(loc_id, name, type_id, hdferr, & + lcpl_id, tcpl_id, tapl_id ) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier + CHARACTER(LEN=*), INTENT(IN) :: name + ! Datatype name within file or group + INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lcpl_id ! Link creation property list + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: tcpl_id ! Datatype creation property list + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: tapl_id ! Datatype access property list +!***** + + INTEGER :: namelen ! Name length + + INTEGER(HID_T) :: lcpl_id_default + INTEGER(HID_T) :: tcpl_id_default + INTEGER(HID_T) :: tapl_id_default + + INTERFACE + INTEGER FUNCTION h5tcommit_c(loc_id, name, namelen, type_id, & + lcpl_id_default, tcpl_id_default, tapl_id_default ) BIND(C,NAME='h5tcommit_c') + IMPORT :: C_CHAR + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: name + INTEGER :: namelen + INTEGER(HID_T), INTENT(IN) :: type_id + INTEGER(HID_T) :: lcpl_id_default + INTEGER(HID_T) :: tcpl_id_default + INTEGER(HID_T) :: tapl_id_default + END FUNCTION h5tcommit_c + END INTERFACE + + lcpl_id_default = H5P_DEFAULT_F + tcpl_id_default = H5P_DEFAULT_F + tapl_id_default = H5P_DEFAULT_F + + IF (PRESENT(lcpl_id)) lcpl_id_default = lcpl_id + IF (PRESENT(tcpl_id)) tcpl_id_default = tcpl_id + IF (PRESENT(tapl_id)) tapl_id_default = tapl_id + + namelen = LEN(name) + + hdferr = h5tcommit_c(loc_id, name, namelen, type_id, & + lcpl_id_default, tcpl_id_default, tapl_id_default ) + + END SUBROUTINE h5tcommit_f +! +!****s* H5T/h5tcopy_f +! +! NAME +! h5tcopy_f +! +! PURPOSE +! Creates a copy of exisiting datatype. +! +! INPUTS +! type_id - datatype identifier +! OUTPUTS +! new_type_id - identifier of datatype's copy +! hdferr - Returns 0 if successful and -1 if fails +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 7, 2001 +! +! SOURCE + SUBROUTINE h5tcopy_f(type_id, new_type_id, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: type_id + INTEGER(HID_T), INTENT(OUT) :: new_type_id + INTEGER, INTENT(OUT) :: hdferr +!***** + INTERFACE + INTEGER FUNCTION h5tcopy_c(type_id, new_type_id) BIND(C,NAME='h5tcopy_c') + IMPORT :: HID_T + INTEGER(HID_T), INTENT(IN) :: type_id + INTEGER(HID_T), INTENT(OUT) :: new_type_id + END FUNCTION h5tcopy_c + END INTERFACE + + hdferr = h5tcopy_c(type_id, new_type_id) + END SUBROUTINE h5tcopy_f +! +!****s* H5T/h5tequal_f +! +! NAME +! h5tequal_f +! +! PURPOSE +! Determines whether two datatype identifiers refer +! to the same datatype. +! +! INPUTS +! type1_id - datatype identifier +! type2_id - datatype identifier +! OUTPUTS +! flag - TRUE/FALSE flag to indicate +! if two datatypes are equal +! hdferr - Returns 0 if successful and -1 if fails +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 7, 2001 +! SOURCE + SUBROUTINE h5tequal_f(type1_id, type2_id, flag, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: type1_id + INTEGER(HID_T), INTENT(IN) :: type2_id + LOGICAL, INTENT(OUT) :: flag + INTEGER, INTENT(OUT) :: hdferr +!***** + INTEGER :: c_flag + INTERFACE + INTEGER FUNCTION h5tequal_c(type1_id, type2_id, c_flag) BIND(C,NAME='h5tequal_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: type1_id + INTEGER(HID_T), INTENT(IN) :: type2_id + INTEGER :: c_flag + END FUNCTION h5tequal_c + END INTERFACE + + flag = .FALSE. + hdferr = h5tequal_c(type1_id, type2_id, c_flag) + IF(c_flag .GT. 0) flag = .TRUE. + END SUBROUTINE h5tequal_f +! +!****s* H5T/h5tclose_f +! +! NAME +! h5tclose_f +! +! PURPOSE +! Releases a datatype. +! +! INPUTS +! type_id - datatype identifier +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 7, 2001 +! +! SOURCE + SUBROUTINE h5tclose_f(type_id, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: type_id + INTEGER, INTENT(OUT) :: hdferr +!***** + INTERFACE + INTEGER FUNCTION h5tclose_c(type_id) BIND(C,NAME='h5tclose_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: type_id + END FUNCTION h5tclose_c + END INTERFACE + + hdferr = h5tclose_c(type_id) + END SUBROUTINE h5tclose_f +! +!****s* H5T/h5tget_class_f +! +! NAME +! h5tget_class_f +! +! PURPOSE +! Returns the datatype class identifier. +! +! INPUTS +! type_id - Datatype identifier +! OUTPUTS +! class - Class, possible values are: +! H5T_NO_CLASS_F (-1) +! H5T_INTEGER_F (0) +! H5T_FLOAT_F (1) +! H5T_TIME_F (2) +! H5T_STRING_F (3) +! H5T_BITFIELD_F (4) +! H5T_OPAQUE_F (5) +! H5T_COMPOUND_F (6) +! H5T_REFERENCE_F (7) +! H5T_ENUM_F (8) +! H5T_VLEN_F (9) +! H5T_ARRAY_F (10) +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 7, 2001 +! +! SOURCE + SUBROUTINE h5tget_class_f(type_id, class, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: type_id + INTEGER, INTENT(OUT) :: class + INTEGER, INTENT(OUT) :: hdferr +!***** + INTERFACE + INTEGER FUNCTION h5tget_class_c(type_id, class) BIND(C,NAME='h5tget_class_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: type_id + INTEGER, INTENT(OUT) :: class + END FUNCTION h5tget_class_c + END INTERFACE + + hdferr = h5tget_class_c(type_id, class) + END SUBROUTINE h5tget_class_f +! +!****s* H5T/h5tget_size_f +! +! NAME +! h5tget_size_f +! +! PURPOSE +! Returns the size of a datatype. +! +! INPUTS +! type_id - datatype identifier +! OUTPUTS +! size - datatype size +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 7, 2001 +! +! SOURCE + SUBROUTINE h5tget_size_f(type_id, size, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier + INTEGER(SIZE_T), INTENT(OUT) :: size ! Datatype size + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + INTERFACE + INTEGER FUNCTION h5tget_size_c(type_id, size) BIND(C,NAME='h5tget_size_c') + IMPORT :: HID_T, SIZE_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: type_id + INTEGER(SIZE_T), INTENT(OUT) :: size + END FUNCTION h5tget_size_c + END INTERFACE + + hdferr = h5tget_size_c(type_id, size) + END SUBROUTINE h5tget_size_f + +! +!****s* H5T/h5tset_size_f +! +! NAME +! h5tset_size_f +! +! PURPOSE +! Sets the total size for an atomic datatype. +! +! INPUTS +! type_id - datatype identifier +! size - size of the datatype +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 7, 2001 +! +! +! SOURCE + SUBROUTINE h5tset_size_f(type_id, size, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier + INTEGER(SIZE_T), INTENT(IN) :: size ! Datatype size + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + INTERFACE + INTEGER FUNCTION h5tset_size_c(type_id, size) BIND(C,NAME='h5tset_size_c') + IMPORT :: HID_T, SIZE_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: type_id + INTEGER(SIZE_T), INTENT(IN) :: size + END FUNCTION h5tset_size_c + END INTERFACE + + hdferr = h5tset_size_c(type_id, size) + END SUBROUTINE h5tset_size_f + +! +!****s* H5T/h5tget_order_f +! +! NAME +! h5tget_order_f +! +! PURPOSE +! Returns the byte order of an atomic datatype. +! +! INPUTS +! type_id - datatype identifier +! OUTPUTS +! order - byte order for the datatype, possible +! values are: +! H5T_ORDER_LE_F +! H5T_ORDER_BE_F +! H5T_ORDER_VAX_F (not implemented yet) +! hdferr - Returns 0 if successful and -1 if fails +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 7, 2001 +! +! SOURCE + SUBROUTINE h5tget_order_f(type_id, order, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier + INTEGER, INTENT(OUT) :: order + ! Datatype byte order, possible values are: + ! H5T_ORDER_LE_F + ! H5T_ORDER_BE_F + ! H5T_ORDER_VAX_F + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + INTERFACE + INTEGER FUNCTION h5tget_order_c(type_id, order) BIND(C,NAME='h5tget_order_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: type_id + INTEGER, INTENT(OUT) :: order + END FUNCTION h5tget_order_c + END INTERFACE + + hdferr = h5tget_order_c(type_id, order) + END SUBROUTINE h5tget_order_f +! +!****s* H5T/h5tset_order_f +! +! NAME +! h5tset_order_f +! +! PURPOSE +! Sets the byte ordering of an atomic datatype. +! +! INPUTS +! type_id - datatype identifier +! order - datatype byte order Possible values are: +! H5T_ORDER_LE_F +! H5T_ORDER_BE_F +! H5T_ORDER_VAX_F (not implemented yet) +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 7, 2001 +! +! SOURCE + SUBROUTINE h5tset_order_f(type_id, order, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier + INTEGER, INTENT(IN) :: order ! Datatype byte order, possible values + ! are: + ! H5T_ORDER_LE_F + ! H5T_ORDER_BE_F + ! H5T_ORDER_VAX_F + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + INTERFACE + INTEGER FUNCTION h5tset_order_c(type_id, order) BIND(C,NAME='h5tset_order_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: type_id + INTEGER, INTENT(IN) :: order + END FUNCTION h5tset_order_c + END INTERFACE + + hdferr = h5tset_order_c(type_id, order) + END SUBROUTINE h5tset_order_f + +! +!****s* H5T/h5tget_precision_f +! +! NAME +! h5tget_precision_f +! +! PURPOSE +! Returns the precision of an atomic datatype. +! +! INPUTS +! type_id - datatype identifier +! OUTPUTS +! precision - precision of the datatype +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 7, 2001 +! +! SOURCE + SUBROUTINE h5tget_precision_f(type_id, PRECISION, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: type_id + INTEGER(SIZE_T), INTENT(OUT) :: precision + INTEGER, INTENT(OUT) :: hdferr +!***** + INTERFACE + INTEGER FUNCTION h5tget_precision_c(type_id, PRECISION) BIND(C,NAME='h5tget_precision_c') + IMPORT :: HID_T, SIZE_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: type_id + INTEGER(SIZE_T), INTENT(OUT) :: PRECISION + END FUNCTION h5tget_precision_c + END INTERFACE + + hdferr = h5tget_precision_c(type_id, PRECISION) + END SUBROUTINE h5tget_precision_f + +! +!****s* H5T/h5tset_precision_f +! +! NAME +! h5tset_precision_f +! +! PURPOSE +! Sets the precision of an atomic datatype. +! +! INPUTS +! type_id - datatype identifier +! precision - datatype precision +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 7, 2001 +! +! SOURCE + SUBROUTINE h5tset_precision_f(type_id, PRECISION, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: type_id + INTEGER(SIZE_T), INTENT(IN) :: PRECISION + INTEGER, INTENT(OUT) :: hdferr +!***** + INTERFACE + INTEGER FUNCTION h5tset_precision_c (type_id, PRECISION) BIND(C,NAME='h5tset_precision_c') + IMPORT :: HID_T, SIZE_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: type_id + INTEGER(SIZE_T), INTENT(IN) :: PRECISION + END FUNCTION h5tset_precision_c + END INTERFACE + + hdferr = h5tset_precision_c(type_id, PRECISION) + END SUBROUTINE h5tset_precision_f + +! +!****s* H5T/h5tget_offset_f +! +! NAME +! h5tget_offset_f +! +! PURPOSE +! Retrieves the bit offset of the first significant bit. +! +! INPUTS +! type_id - datatype identifier +! OUTPUTS +! offset - offset value +! hdferr - Returns 0 if successful and -1 if fails +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 7, 2001 +! +! SOURCE + SUBROUTINE h5tget_offset_f(type_id, offset, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: type_id + INTEGER(SIZE_T), INTENT(OUT) :: offset + INTEGER, INTENT(OUT) :: hdferr +!***** + INTERFACE + INTEGER FUNCTION h5tget_offset_c(type_id, offset) BIND(C,NAME='h5tget_offset_c') + IMPORT :: HID_T, SIZE_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: type_id + INTEGER(SIZE_T), INTENT(OUT) :: offset + END FUNCTION h5tget_offset_c + END INTERFACE + + hdferr = h5tget_offset_c(type_id, offset) + END SUBROUTINE h5tget_offset_f + +! +!****s* H5T/h5tset_offset_f +! +! NAME +! h5tset_offset_f +! +! PURPOSE +! Sets the bit offset of the first significant bit. +! +! INPUTS +! type_id - datatype identifier +! offset - offset value +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 7, 2001 +! +! SOURCE + SUBROUTINE h5tset_offset_f(type_id, offset, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: type_id + INTEGER(SIZE_T), INTENT(IN) :: offset + INTEGER, INTENT(OUT) :: hdferr +!***** + INTERFACE + INTEGER FUNCTION h5tset_offset_c(type_id, offset) BIND(C,NAME='h5tset_offset_c') + IMPORT :: HID_T, SIZE_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: type_id + INTEGER(SIZE_T), INTENT(IN) :: offset + END FUNCTION h5tset_offset_c + END INTERFACE + + hdferr = h5tset_offset_c(type_id, offset) + END SUBROUTINE h5tset_offset_f + +! +!****s* H5T/h5tget_pad_f +! +! NAME +! h5tget_pad_f +! +! PURPOSE +! Retrieves the padding type of the least and +! most -significant bit padding. +! +! INPUTS +! type_id - datatype identifier +! OUTPUTS +! lsbpad - least-significant bit padding type +! msbpad - most-significant bit padding type +! Possible values of padding type are: +! H5T_PAD_ERROR_F +! H5T_PAD_ZERO_F +! H5T_PAD_ONE_F +! H5T_PAD_BACKGROUND_F +! H5T_PAD_NPAD_F +! hdferr - Returns 0 if successful and -1 if fails + +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 7, 2001 +! SOURCE + SUBROUTINE h5tget_pad_f(type_id, lsbpad, msbpad, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: type_id + INTEGER, INTENT(OUT) :: lsbpad + INTEGER, INTENT(OUT) :: msbpad + INTEGER, INTENT(OUT) :: hdferr +!***** + INTERFACE + INTEGER FUNCTION h5tget_pad_c(type_id, lsbpad, msbpad) BIND(C,NAME='h5tget_pad_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: type_id + INTEGER, INTENT(OUT) :: lsbpad + INTEGER, INTENT(OUT) :: msbpad + END FUNCTION h5tget_pad_c + END INTERFACE + + hdferr = h5tget_pad_c(type_id, lsbpad, msbpad) + END SUBROUTINE h5tget_pad_f + +! +!****s* H5T/h5tset_pad_f +! +! NAME +! h5tset_pad_f +! +! PURPOSE +! Sets the least and most-significant bits padding types. +! +! INPUTS +! type_id - datatype identifier +! lsbpad - least-significant bit padding type +! msbpad - most-significant bit padding type +! Possible values of padding type are: +! H5T_PAD_ERROR_F = -1 +! H5T_PAD_ZERO_F = 0 +! H5T_PAD_ONE_F = 1 +! H5T_PAD_BACKGROUND_F = 2 +! H5T_PAD_NPAD_F = 3 +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 7, 2001 +! SOURCE + SUBROUTINE h5tset_pad_f(type_id, lsbpad, msbpad, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: type_id + INTEGER, INTENT(IN) :: lsbpad + INTEGER, INTENT(IN) :: msbpad + INTEGER, INTENT(OUT) :: hdferr +!***** + INTERFACE + INTEGER FUNCTION h5tset_pad_c(type_id, lsbpad, msbpad) BIND(C,NAME='h5tset_pad_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: type_id + INTEGER, INTENT(IN) :: lsbpad + INTEGER, INTENT(IN) :: msbpad + END FUNCTION h5tset_pad_c + END INTERFACE + + hdferr = h5tset_pad_c(type_id, lsbpad, msbpad) + END SUBROUTINE h5tset_pad_f + +! +!****s* H5T/h5tget_sign_f +! +! NAME +! h5tget_sign_f +! +! PURPOSE +! Retrieves the sign type for an integer type. +! +! INPUTS +! type_id - datatype identifier +! OUTPUTS +! sign - sign type +! Possible values are: +! - Unsigned integer type +! H5T_SGN_NONE_F = 0 +! - Two's complement signed integer type +! H5T_SGN_2_F = 1 +! - error value: H5T_SGN_ERROR_F=-1 +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 7, 2001 +! SOURCE + SUBROUTINE h5tget_sign_f(type_id, sign, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: type_id + INTEGER, INTENT(OUT) :: sign + INTEGER, INTENT(OUT) :: hdferr +!***** + + INTERFACE + INTEGER FUNCTION h5tget_sign_c(type_id, sign) BIND(C,NAME='h5tget_sign_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: type_id + INTEGER, INTENT(OUT) :: sign + END FUNCTION h5tget_sign_c + END INTERFACE + + hdferr = h5tget_sign_c(type_id, sign) + END SUBROUTINE h5tget_sign_f + +! +!****s* H5T/h5tset_sign_f +! +! NAME +! h5tset_sign_f +! +! PURPOSE +! Sets the sign proprety for an integer type. +! +! INPUTS +! type_id - datatype identifier +! sign - sign type +! Possible values are: +! - Unsigned integer type +! H5T_SGN_NONE_F = 0 +! - Two's complement signed integer type +! H5T_SGN_2_F = 1 +! - error value: H5T_SGN_ERROR_F=-1 +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 7, 2001 +! SOURCE + SUBROUTINE h5tset_sign_f(type_id, sign, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: type_id + INTEGER, INTENT(IN) :: sign + INTEGER, INTENT(OUT) :: hdferr +!***** + INTERFACE + INTEGER FUNCTION h5tset_sign_c(type_id, sign) BIND(C,NAME='h5tset_sign_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: type_id + INTEGER, INTENT(IN) :: sign + END FUNCTION h5tset_sign_c + END INTERFACE + + hdferr = h5tset_sign_c(type_id, sign) + END SUBROUTINE h5tset_sign_f + +! +!****s* H5T/h5tget_fields_f +! +! NAME +! h5tget_fields_f +! +! PURPOSE +! Retrieves floating point datatype bit field information. +! +! INPUTS +! type_id - datatype identifier +! OUTPUTS +! spos - sign bit-position +! epos - exponent bit-position +! esize - size of exponent in bits +! mpos - mantissa position +! msize - size of mantissa in bits +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 7, 2001 +! SOURCE + SUBROUTINE h5tget_fields_f(type_id, spos, epos, esize, mpos, msize, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: type_id + INTEGER(SIZE_T), INTENT(OUT) :: spos + INTEGER(SIZE_T), INTENT(OUT) :: epos + INTEGER(SIZE_T), INTENT(OUT) :: esize + INTEGER(SIZE_T), INTENT(OUT) :: mpos + INTEGER(SIZE_T), INTENT(OUT) :: msize + INTEGER, INTENT(OUT) :: hdferr +!***** + + INTERFACE + INTEGER FUNCTION h5tget_fields_c(type_id, spos, epos, esize, mpos, msize) & + BIND(C,NAME='h5tget_fields_c') + IMPORT :: HID_T, SIZE_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: type_id + INTEGER(SIZE_T), INTENT(OUT) :: spos + INTEGER(SIZE_T), INTENT(OUT) :: epos + INTEGER(SIZE_T), INTENT(OUT) :: esize + INTEGER(SIZE_T), INTENT(OUT) :: mpos + INTEGER(SIZE_T), INTENT(OUT) :: msize + END FUNCTION h5tget_fields_c + END INTERFACE + + hdferr = h5tget_fields_c(type_id, spos, epos, esize, mpos, msize) + END SUBROUTINE h5tget_fields_f + +! +!****s* H5T/h5tset_fields_f +! +! NAME +! h5tset_fields_f +! +! PURPOSE +! Sets locations and sizes of floating point bit fields. +! +! INPUTS +! type_id - datatype identifier +! spos - sign bit-position +! epos - exponent bit-position +! esize - size of exponent in bits +! mpos - mantissa position +! msize - size of mantissa in bits +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 7, 2001 +! SOURCE + SUBROUTINE h5tset_fields_f(type_id, spos, epos, esize, mpos, msize, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: type_id + INTEGER(SIZE_T), INTENT(IN) :: spos + INTEGER(SIZE_T), INTENT(IN) :: epos + INTEGER(SIZE_T), INTENT(IN) :: esize + INTEGER(SIZE_T), INTENT(IN) :: mpos + INTEGER(SIZE_T), INTENT(IN) :: msize + INTEGER, INTENT(OUT) :: hdferr +!***** + + INTERFACE + INTEGER FUNCTION h5tset_fields_c(type_id, spos, epos, esize, mpos, msize) & + BIND(C,NAME='h5tset_fields_c') + IMPORT :: HID_T, SIZE_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: type_id + INTEGER(SIZE_T), INTENT(IN) :: spos + INTEGER(SIZE_T), INTENT(IN) :: epos + INTEGER(SIZE_T), INTENT(IN) :: esize + INTEGER(SIZE_T), INTENT(IN) :: mpos + INTEGER(SIZE_T), INTENT(IN) :: msize + END FUNCTION h5tset_fields_c + END INTERFACE + + hdferr = h5tset_fields_c(type_id, spos, epos, esize, mpos, msize) + END SUBROUTINE h5tset_fields_f + +! +!****s* H5T/h5tget_ebias_f +! +! NAME +! h5tget_ebias_f +! +! PURPOSE +! Retrieves the exponent bias of a floating-point type. +! +! INPUTS +! type_id - datatype identifier +! OUTPUTS +! ebias - datatype exponent bias +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 7, 2001 +! SOURCE + SUBROUTINE h5tget_ebias_f(type_id, ebias, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: type_id + INTEGER(SIZE_T), INTENT(OUT) :: ebias + INTEGER, INTENT(OUT) :: hdferr +!***** + + INTERFACE + INTEGER FUNCTION h5tget_ebias_c(type_id, ebias) BIND(C,NAME='h5tget_ebias_c') + IMPORT :: HID_T, SIZE_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: type_id + INTEGER(SIZE_T), INTENT(OUT) :: ebias + END FUNCTION h5tget_ebias_c + END INTERFACE + + hdferr = h5tget_ebias_c(type_id, ebias) + END SUBROUTINE h5tget_ebias_f + +! +!****s* H5T/h5tset_ebias_f +! +! NAME +! h5tset_ebias_f +! +! PURPOSE +! Sets the exponent bias of a floating-point type. +! +! INPUTS +! type_id - datatype identifier +! ebias - datatype exponent bias +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 7, 2001 +! SOURCE + SUBROUTINE h5tset_ebias_f(type_id, ebias, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: type_id + INTEGER(SIZE_T), INTENT(IN) :: ebias + INTEGER, INTENT(OUT) :: hdferr +!***** + INTERFACE + INTEGER FUNCTION h5tset_ebias_c(type_id, ebias) BIND(C,NAME='h5tset_ebias_c') + IMPORT :: HID_T, SIZE_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: type_id + INTEGER(SIZE_T), INTENT(IN) :: ebias + END FUNCTION h5tset_ebias_c + END INTERFACE + + hdferr = h5tset_ebias_c(type_id, ebias) + END SUBROUTINE h5tset_ebias_f + +! +!****s* H5T/h5tget_norm_f +! +! NAME +! h5tget_norm_f +! +! PURPOSE +! Retrieves mantissa normalization of a floating-point +! datatype. +! +! INPUTS +! type_id - datatype identifier +! OUTPUTS +! norm - normalization types, valid values are: +! H5T_NORM_IMPLIED_F +! H5T_NORM_MSBSET_F +! H5T_NORM_NONE_F +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 7, 2001 +! SOURCE + SUBROUTINE h5tget_norm_f(type_id, norm, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: type_id + INTEGER, INTENT(OUT) :: norm + INTEGER, INTENT(OUT) :: hdferr +!***** + + INTERFACE + INTEGER FUNCTION h5tget_norm_c(type_id, norm) BIND(C,NAME='h5tget_norm_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: type_id + INTEGER, INTENT(OUT) :: norm + END FUNCTION h5tget_norm_c + END INTERFACE + + hdferr = h5tget_norm_c(type_id, norm) + END SUBROUTINE h5tget_norm_f + +! +!****s* H5T/h5tset_norm_f +! +! NAME +! h5tset_norm_f +! +! PURPOSE +! Sets the mantissa normalization of a floating-point datatype. +! +! INPUTS +! type_id - datatype identifier +! norm - normalization types, valid values are: +! H5T_NORM_IMPLIED_F +! H5T_NORM_MSBSET_F +! H5T_NORM_NONE_F +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 7, 2001 +! +! SOURCE + SUBROUTINE h5tset_norm_f(type_id, norm, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: type_id + INTEGER, INTENT(IN) :: norm + INTEGER, INTENT(OUT) :: hdferr +!***** + INTERFACE + INTEGER FUNCTION h5tset_norm_c(type_id, norm) BIND(C,NAME='h5tset_norm_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: type_id + INTEGER, INTENT(IN) :: norm + END FUNCTION h5tset_norm_c + END INTERFACE + + hdferr = h5tset_norm_c(type_id, norm) + END SUBROUTINE h5tset_norm_f + +! +!****s* H5T/h5tget_inpad_f +! +! NAME +! h5tget_inpad_f +! +! PURPOSE +! Retrieves the internal padding type for unused bits +! in floating-point datatypes. +! +! INPUTS +! type_id - datatype identifier +! OUTPUTS +! padtype - padding type for unused bits +! Possible values of padding type are: +! H5T_PAD_ZERO_F +! H5T_PAD_ONE_F +! H5T_PAD_BACKGROUND_F +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 7, 2001 +! SOURCE + SUBROUTINE h5tget_inpad_f(type_id, padtype, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: type_id + INTEGER, INTENT(OUT) :: padtype + INTEGER, INTENT(OUT) :: hdferr +!***** + INTERFACE + INTEGER FUNCTION h5tget_inpad_c(type_id, padtype) BIND(C,NAME='h5tget_inpad_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: type_id + INTEGER, INTENT(OUT) :: padtype + END FUNCTION h5tget_inpad_c + END INTERFACE + + hdferr = h5tget_inpad_c(type_id, padtype) + END SUBROUTINE h5tget_inpad_f + +! +!****s* H5T/h5tset_inpad_f +! +! NAME +! h5tset_inpad_f +! +! PURPOSE +! Fills unused internal floating point bits. +! +! INPUTS +! type_id - datatype identifier +! padtype - padding type for unused bits +! Possible values of padding type are: +! H5T_PAD_ZERO_F +! H5T_PAD_ONE_F +! H5T_PAD_BACKGROUND_F +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 7, 2001 +! SOURCE + SUBROUTINE h5tset_inpad_f(type_id, padtype, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: type_id + INTEGER, INTENT(IN) :: padtype + INTEGER, INTENT(OUT) :: hdferr +!***** + INTERFACE + INTEGER FUNCTION h5tset_inpad_c(type_id, padtype) BIND(C,NAME='h5tset_inpad_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: type_id + INTEGER, INTENT(IN) :: padtype + END FUNCTION h5tset_inpad_c + END INTERFACE + + hdferr = h5tset_inpad_c(type_id, padtype) + END SUBROUTINE h5tset_inpad_f + +! +!****s* H5T/h5tget_cset_f +! +! NAME +! h5tget_cset_f +! +! PURPOSE +! Retrieves the character set type of a string datatype. +! +! INPUTS +! type_id - Datatype identifier +! OUTPUTS +! cset - Character set type of a string datatype +! Possible values are: +! H5T_CSET_ASCII_F +! H5T_CSET_UTF8_F +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 7, 2001 +! SOURCE + SUBROUTINE h5tget_cset_f(type_id, cset, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: type_id + INTEGER, INTENT(OUT) :: cset + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + INTERFACE + INTEGER FUNCTION h5tget_cset_c(type_id, cset) BIND(C,NAME='h5tget_cset_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: type_id + INTEGER, INTENT(OUT) :: cset + END FUNCTION h5tget_cset_c + END INTERFACE + + hdferr = h5tget_cset_c(type_id, cset) + END SUBROUTINE h5tget_cset_f + +! +!****s* H5T/h5tset_cset_f +! +! NAME +! h5tset_cset_f +! +! PURPOSE +! Sets character set to be used. +! +! INPUTS +! type_id - datatype identifier +! cset - character set type of a string datatype +! Possible values are: +! H5T_CSET_ASCII_F +! H5T_CSET_UTF8_F +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 7, 2001 +! SOURCE + SUBROUTINE h5tset_cset_f(type_id, cset, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: type_id + INTEGER, INTENT(IN) :: cset + INTEGER, INTENT(OUT) :: hdferr +!***** + INTERFACE + INTEGER FUNCTION h5tset_cset_c(type_id, cset) BIND(C,NAME='h5tset_cset_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: type_id + INTEGER, INTENT(IN) :: cset + END FUNCTION h5tset_cset_c + END INTERFACE + + hdferr = h5tset_cset_c(type_id, cset) + END SUBROUTINE h5tset_cset_f +! +!****s* H5T/h5tget_strpad_f +! +! NAME +! h5tget_strpad_f +! +! PURPOSE +! Retrieves the storage mechanism for a string datatype. +! +! INPUTS +! type_id - datatype identifier +! OUTPUTS +! strpad - storage method for a string datatype +! Possible values are: +! H5T_STR_NULLTERM_F, +! H5T_STR_NULLPAD_F, +! H5T_STR_SPACEPAD_F +! H5T_STR_ERROR_F +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 7, 2001 +! SOURCE + SUBROUTINE h5tget_strpad_f(type_id, strpad, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: type_id + INTEGER, INTENT(OUT) :: strpad + INTEGER, INTENT(OUT) :: hdferr +!***** + INTERFACE + INTEGER FUNCTION h5tget_strpad_c(type_id, strpad) BIND(C,NAME='h5tget_strpad_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: type_id + INTEGER, INTENT(OUT) :: strpad + END FUNCTION h5tget_strpad_c + END INTERFACE + + hdferr = h5tget_strpad_c(type_id, strpad) + END SUBROUTINE h5tget_strpad_f + +! +!****s* H5T/h5tset_strpad_f +! +! NAME +! h5tset_strpad_f +! +! PURPOSE +! Defines the storage mechanism for character strings. +! +! INPUTS +! type_id - datatype identifier +! strpad - storage method for a string datatype +! Possible values are: +! H5T_STR_NULLTERM_F, +! H5T_STR_NULLPAD_F, +! H5T_STR_SPACEPAD_F, +! H5T_STR_ERROR_F. +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 7, 2001 +! SOURCE + SUBROUTINE h5tset_strpad_f(type_id, strpad, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: type_id + INTEGER, INTENT(IN) :: strpad + INTEGER, INTENT(OUT) :: hdferr +!***** + INTERFACE + INTEGER FUNCTION h5tset_strpad_c(type_id, strpad) BIND(C,NAME='h5tset_strpad_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: type_id + INTEGER, INTENT(IN) :: strpad + END FUNCTION h5tset_strpad_c + END INTERFACE + + hdferr = h5tset_strpad_c(type_id, strpad) + END SUBROUTINE h5tset_strpad_f + +! +!****s* H5T/h5tget_nmembers_f +! +! NAME +! h5tget_nmembers_f +! +! PURPOSE +! Retrieves the number of fields in a compound datatype. +! +! INPUTS +! type_id - datatype identifier +! OUTPUTS +! num_members - number of members +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 7, 2001 +! +! SOURCE + SUBROUTINE h5tget_nmembers_f(type_id, num_members, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: type_id + INTEGER, INTENT(OUT) :: num_members + INTEGER, INTENT(OUT) :: hdferr +!***** + INTERFACE + INTEGER FUNCTION h5tget_nmembers_c(type_id, num_members) BIND(C,NAME='h5tget_nmembers_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: type_id + INTEGER, INTENT(OUT) :: num_members + END FUNCTION h5tget_nmembers_c + END INTERFACE + + hdferr = h5tget_nmembers_c(type_id, num_members) + END SUBROUTINE h5tget_nmembers_f + +! +!****s* H5T/h5tget_member_name_f +! +! NAME +! h5tget_member_name_f +! +! PURPOSE +! Retrieves the name of a field of a compound datatype. +! +! INPUTS +! type_id - datatype identifier +! index - filed index (0-based) +! OUTPUTS +! member_name - buffer to hold member's name +! namelen - name length +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 7, 2001 +! SOURCE + SUBROUTINE h5tget_member_name_f(type_id, index, member_name, namelen, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: type_id + INTEGER, INTENT(IN) :: index + CHARACTER(LEN=*), INTENT(OUT) :: member_name + INTEGER, INTENT(OUT) :: namelen + INTEGER, INTENT(OUT) :: hdferr +!***** + INTERFACE + INTEGER FUNCTION h5tget_member_name_c(type_id, index, member_name, namelen) BIND(C,NAME='h5tget_member_name_c') + IMPORT :: C_CHAR + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: type_id + INTEGER, INTENT(IN) :: index + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(OUT) :: member_name + INTEGER, INTENT(OUT) :: namelen + END FUNCTION h5tget_member_name_c + END INTERFACE + + hdferr = h5tget_member_name_c(type_id, index, member_name, namelen) + END SUBROUTINE h5tget_member_name_f + +! +!****s* H5T/h5tget_member_offset_f +! +! NAME +! h5tget_member_offset_f +! +! PURPOSE +! Retrieves the offset of a field of a compound datatype. +! +! INPUTS +! type_id - datatype identifier +! member_no - number of the field +! OUTPUTS +! offset - byte offset of the requested field +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 7, 2001 +! SOURCE + SUBROUTINE h5tget_member_offset_f(type_id, member_no, offset, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: type_id + INTEGER, INTENT(IN) :: member_no + INTEGER(SIZE_T), INTENT(OUT) :: offset + INTEGER, INTENT(OUT) :: hdferr +!***** + INTERFACE + INTEGER FUNCTION h5tget_member_offset_c(type_id, member_no, offset ) BIND(C,NAME='h5tget_member_offset_c') + IMPORT :: HID_T, SIZE_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: type_id + INTEGER, INTENT(IN) :: member_no + INTEGER(SIZE_T), INTENT(OUT) :: offset + END FUNCTION h5tget_member_offset_c + END INTERFACE + + hdferr = h5tget_member_offset_c(type_id, member_no, offset ) + END SUBROUTINE h5tget_member_offset_f +! +!****s* H5T/h5tget_member_index_f +! +! NAME +! h5tget_member_index_f +! +! PURPOSE +! Retrieves the index of a compound or enumeration datatype member. +! +! INPUTS +! type_id - datatype identifier +! name - name of the field or member whose index to +! to be retrieved from the datatype. +! OUTPUTS +! index - 0-based index of the filed or member (0 to N-1) +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! September 26, 2002 +! +! SOURCE + SUBROUTINE h5tget_member_index_f(type_id, name, index, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: type_id + CHARACTER(LEN=*), INTENT(IN) :: name + INTEGER, INTENT(OUT) :: index + INTEGER, INTENT(OUT) :: hdferr +!***** + INTEGER :: namelen ! Name length + + INTERFACE + INTEGER FUNCTION h5tget_member_index_c(type_id, name, namelen, index) BIND(C,NAME='h5tget_member_index_c') + IMPORT :: C_CHAR + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: type_id + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: name + INTEGER, INTENT(IN) :: namelen + INTEGER, INTENT(OUT) :: index + END FUNCTION h5tget_member_index_c + END INTERFACE + + namelen = LEN(name) + hdferr = h5tget_member_index_c(type_id, name, namelen, index) + END SUBROUTINE h5tget_member_index_f + + +! !$! +! !$!****s* H5T/h5tget_member_dim_f +! !$! +! !$! NAME +! !$! h5tget_member_dim_f +! !$! +! !$! PURPOSE +! !$! This function is not supported in hdf5-1.4.* +! !$! +! !$! INPUTS +! !$! OUTPUTS +! !$! hdferr: - error code +! !$! Success: 0 +! !$! Failure: -1 +! !$! +! !$! AUTHOR +! !$! Elena Pourmal +! !$! August 12, 1999 +! !$! +! !$! HISTORY +! !$! Explicit Fortran interfaces were added for +! !$! called C functions (it is needed for Windows +! !$! port). March 7, 2001 +! !$! +! !$! SOURCE +! !$! SUBROUTINE h5tget_member_dims_f(type_id, field_idx,dims, field_dims, perm, hdferr) +! !$! +! !$! IMPLICIT NONE +! !$! INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier +! !$! INTEGER, INTENT(IN) :: field_idx !Field index (0-based) of +! !$! !field_dims, perm) +! !$! INTEGER, INTENT(OUT) :: dims !number of dimensions of the field +! !$! +! !$! INTEGER(SIZE_T),DIMENSION(*), INTENT(OUT) :: field_dims !buffer to store the +! !$! !dimensions of the field +! !$! INTEGER, DIMENSION(*), INTENT(OUT) :: perm !buffer to store the +! !$! !permutation vector of the field +! !$! INTEGER, INTENT(OUT) :: hdferr ! Error code +! !$!*****! +! !$! INTEGER, EXTERNAL :: h5tget_member_dims_c +! !$! hdferr = h5tget_member_dims_c(type_id, field_idx, dims, field_dims, perm) +! !$! +! !$! END SUBROUTINE h5tget_member_dims_f + + +!****s* H5T/h5tget_array_dims_f +! +! NAME +! h5tget_array_dims_f +! +! PURPOSE +! Returns sizes of array dimensions. +! +! INPUTS +! type_id - array datatype identifier +! OUTPUTS +! dims - buffer to store array datatype dimensions +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 7, 2001 +! SOURCE + SUBROUTINE h5tget_array_dims_f(type_id, dims, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: type_id + INTEGER(HSIZE_T),DIMENSION(*), INTENT(OUT) :: dims + INTEGER, INTENT(OUT) :: hdferr +!***** + INTERFACE + INTEGER FUNCTION h5tget_array_dims_c(type_id, dims) BIND(C,NAME='h5tget_array_dims_c') + IMPORT :: HID_T, HSIZE_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: type_id + INTEGER(HSIZE_T),DIMENSION(*), INTENT(OUT) :: dims + END FUNCTION h5tget_array_dims_c + END INTERFACE + + hdferr = h5tget_array_dims_c(type_id, dims) + + END SUBROUTINE h5tget_array_dims_f + +! +!****s* H5T/h5tget_array_ndims_f +! +! NAME +! h5tget_array_ndims_f +! +! PURPOSE +! Returns the rank of an array datatype. +! +! INPUTS +! type_id - array datatype identifier +! OUTPUTS +! ndims - number of array dimensions +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 7, 2001 +! SOURCE + SUBROUTINE h5tget_array_ndims_f(type_id, ndims, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: type_id + INTEGER, INTENT(OUT) :: ndims + INTEGER, INTENT(OUT) :: hdferr +!***** + INTERFACE + INTEGER FUNCTION h5tget_array_ndims_c(type_id, ndims) BIND(C,NAME='h5tget_array_ndims_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: type_id + INTEGER, INTENT(OUT) :: ndims + END FUNCTION h5tget_array_ndims_c + END INTERFACE + + hdferr = h5tget_array_ndims_c(type_id, ndims) + + END SUBROUTINE h5tget_array_ndims_f + +! +!****s* H5T/h5tget_super_f +! +! NAME +! h5tget_super_f +! +! PURPOSE +! Returns the base datatype from which a datatype is derived. +! +! INPUTS +! type_id - datatype identifier +! OUTPUTS +! base_type_id - identifier of the base type +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 7, 2001 +! SOURCE + SUBROUTINE h5tget_super_f(type_id, base_type_id, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: type_id + INTEGER(HID_T), INTENT(OUT) :: base_type_id + INTEGER, INTENT(OUT) :: hdferr +!***** + INTERFACE + INTEGER FUNCTION h5tget_super_c(type_id, base_type_id) BIND(C,NAME='h5tget_super_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: type_id + INTEGER(HID_T), INTENT(OUT) :: base_type_id + END FUNCTION h5tget_super_c + END INTERFACE + + hdferr = h5tget_super_c(type_id, base_type_id) + + END SUBROUTINE h5tget_super_f + +! +!****s* H5T/h5tget_member_type_f +! +! NAME +! h5tget_member_type_f +! +! PURPOSE +! Returns the datatype of the specified member. +! +! INPUTS +! type_id - compound datatype identifier +! field_idx - field index (0-based) +! +! OUTPUTS +! datatype - identifier of the member's datatype +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 7, 2001 +! SOURCE + SUBROUTINE h5tget_member_type_f(type_id, field_idx, datatype, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: type_id + INTEGER, INTENT(IN) :: field_idx + INTEGER(HID_T), INTENT(OUT) :: datatype + INTEGER, INTENT(OUT) :: hdferr +!***** + INTERFACE + INTEGER FUNCTION h5tget_member_type_c(type_id, field_idx , datatype) & + BIND(C,NAME='h5tget_member_type_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: type_id + INTEGER, INTENT(IN) :: field_idx + INTEGER(HID_T), INTENT(OUT) :: datatype + END FUNCTION h5tget_member_type_c + END INTERFACE + + hdferr = h5tget_member_type_c(type_id, field_idx , datatype) + END SUBROUTINE h5tget_member_type_f + +! +!****s* H5T/h5tcreate_f +! +! NAME +! h5tcreate_f +! +! PURPOSE +! Creates a new datatype. +! +! INPUTS +! 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 +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 7, 2001 +! SOURCE + SUBROUTINE h5tcreate_f(class, size, type_id, hdferr) + 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) BIND(C,NAME='h5tcreate_c') + IMPORT :: HID_T, SIZE_T + IMPLICIT NONE + 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 + +! +!****s* H5T/h5tinsert_f +! +! NAME +! h5tinsert_f +! +! PURPOSE +! Adds a new member to a compound datatype. +! +! INPUTS +! type_id - compound datatype identifier +! name - name of the field to insert +! offset - start of the member in an instance of +! the compound datatype +! field_id - datatype identifier of the field to insert +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 7, 2001 +! SOURCE + SUBROUTINE h5tinsert_f(type_id, name, offset, field_id, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: type_id + CHARACTER(LEN=*), INTENT(IN) :: name + INTEGER(SIZE_T), INTENT(IN) :: offset + INTEGER(HID_T), INTENT(IN) :: field_id + INTEGER, INTENT(OUT) :: hdferr +!***** + INTEGER :: namelen + + INTERFACE + INTEGER FUNCTION h5tinsert_c(type_id, name, namelen, offset, field_id) BIND(C,NAME='h5tinsert_c') + IMPORT :: C_CHAR + IMPORT :: HID_T, SIZE_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: type_id + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: name + INTEGER(SIZE_T), INTENT(IN) :: offset + INTEGER(HID_T), INTENT(IN) :: field_id + INTEGER :: namelen + END FUNCTION h5tinsert_c + END INTERFACE + + namelen = LEN(name) + hdferr = h5tinsert_c(type_id, name, namelen, offset, field_id ) + END SUBROUTINE h5tinsert_f + +! +!****s* H5T/h5tpack_f +! +! NAME +! h5tpack_f +! +! PURPOSE +! Recursively removes padding from within a compound datatype. +! +! INPUTS +! type_id - compound datatype identifier +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 7, 2001 +! SOURCE + SUBROUTINE h5tpack_f(type_id, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: type_id + INTEGER, INTENT(OUT) :: hdferr +!***** + INTERFACE + INTEGER FUNCTION h5tpack_c(type_id) BIND(C,NAME='h5tpack_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: type_id + END FUNCTION h5tpack_c + END INTERFACE + + hdferr = h5tpack_c(type_id) + END SUBROUTINE h5tpack_f + +! !$! +! !$!****s* H5T/h5tinsert_array_f +! !$! +! !$! NAME +! !$! h5tinsert_array_f +! !$! +! !$! PURPOSE +! !$! This function is not available on hdf5-1.4.* +! !$! +! !$! INPUTS +! !$! OUTPUTS +! !$! hdferr: - error code +! !$! Success: 0 +! !$! Failure: -1 +! !$! +! !$! AUTHOR +! !$! Elena Pourmal +! !$! August 12, 1999 +! !$! +! !$! HISTORY +! !$! Explicit Fortran interfaces were added for +! !$! called C functions (it is needed for Windows +! !$! port). March 7, 2001 +! !$! SOURCE +! SUBROUTINE h5tinsert_array_f(parent_id,name,offset, ndims, dims, member_id, hdferr, perm) +! IMPLICIT NONE +! INTEGER(HID_T), INTENT(IN) :: parent_id ! identifier of the parent compound datatype +! CHARACTER(LEN=*), INTENT(IN) :: name !Name of the new member +! INTEGER(SIZE_T), INTENT(IN) :: offset !Offset to start of new member +! !within compound datatype +! INTEGER, INTENT(IN) :: ndims !Dimensionality of new member. +! !Valid values are 0 (zero) through 4 (four) +! INTEGER(SIZE_T), DIMENSION(*), INTENT(IN) :: dims !Size of new member array +! INTEGER(HID_T), INTENT(IN) :: member_id ! identifier of the datatype of the new member +! INTEGER, INTENT(OUT) :: hdferr ! Error code +! !*****! +! INTEGER, DIMENSION(*), OPTIONAL, INTENT(IN) :: perm +! !Pointer to buffer to store +! !the permutation vector of the field +! INTEGER :: namelen, sizeofperm +! INTEGER, EXTERNAL :: h5tinsert_array_c, h5tinsert_array_c2 +! namelen = LEN(name) +! if (present(perm)) then +! hdferr = h5tinsert_array_c(parent_id, name, namelen, offset, ndims,dims, member_id, perm) +! else +! hdferr = h5tinsert_array_c2(parent_id, name, namelen, offset, ndims,dims, member_id) +! end if +! +! END SUBROUTINE h5tinsert_array_f + +! +!****s* H5T/h5tarray_create_f +! +! NAME +! h5tarray_create_f +! +! PURPOSE +! Creates an array datatype object. +! +! INPUTS +! base_id - datatype identifier for the array +! base datatype +! rank - rank of the array +! dims - array dimension sizes +! OUTPUTS +! type_id - array datatype identifier +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 7, 2001 +! SOURCE + SUBROUTINE h5tarray_create_f(base_id, rank, dims, type_id, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: base_id + INTEGER, INTENT(IN) :: rank + INTEGER(HSIZE_T), DIMENSION(*), INTENT(IN) :: dims + INTEGER(HID_T), INTENT(OUT) :: type_id + INTEGER, INTENT(OUT) :: hdferr +!***** + INTERFACE + INTEGER FUNCTION h5tarray_create_c(base_id, rank, dims, type_id) BIND(C,NAME='h5tarray_create_c') + IMPORT :: HID_T, HSIZE_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: base_id + INTEGER, INTENT(IN) :: rank + INTEGER(HSIZE_T), DIMENSION(*), INTENT(IN) :: dims + INTEGER(HID_T), INTENT(OUT) :: type_id + END FUNCTION h5tarray_create_c + END INTERFACE + + hdferr = h5tarray_create_c(base_id, rank, dims, type_id) + + END SUBROUTINE h5tarray_create_f + +! +!****s* H5T/h5tenum_create_f +! +! NAME +! h5tenum_create_f +! +! PURPOSE +! Creates a new enumeration datatype. +! +! INPUTS +! parent_id - datatype identifier for base datatype +! OUTPUTS +! new_type_id - datatype identifier for the enumeration datatype +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 7, 2001 +! SOURCE + SUBROUTINE h5tenum_create_f(parent_id, new_type_id, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: parent_id + INTEGER(HID_T), INTENT(OUT) :: new_type_id + INTEGER, INTENT(OUT) :: hdferr +!***** + + INTERFACE + INTEGER FUNCTION h5tenum_create_c(parent_id, new_type_id) BIND(C,NAME='h5tenum_create_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: parent_id + INTEGER(HID_T), INTENT(OUT) :: new_type_id + END FUNCTION h5tenum_create_c + END INTERFACE + + hdferr = h5tenum_create_c(parent_id, new_type_id) + END SUBROUTINE h5tenum_create_f +! +!****s* H5T/h5tenum_nameof_f +! +! NAME +! h5tenum_nameof_f +! +! PURPOSE +! Returns the symbol name corresponding to a specified +! member of an enumeration datatype. +! +! INPUTS +! type_id - datatype identifier +! value - value of the enumeration datatype +! namelen - name buffer size +! OUTPUTS +! name - buffer to hold symbol name +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 7, 2001 +! +! NOTE +! According to the standard: Because an INTENT(OUT) variable is considered undefined +! on entry to the procedure, any default initialization specified for its type will +! be applied. So we need to blank out the "name" to be portable and eliminate any +! characters the "name' may contain upon entry, depending on compiler implementation. +! SOURCE + SUBROUTINE h5tenum_nameof_f(type_id, value, namelen, name, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: type_id + CHARACTER(LEN=*), INTENT(OUT) :: name + INTEGER(SIZE_T), INTENT(IN) :: namelen + INTEGER, INTENT(IN) :: value + INTEGER, INTENT(OUT) :: hdferr +!***** + INTERFACE + INTEGER FUNCTION h5tenum_nameof_c(type_id, value, name, namelen) BIND(C,NAME='h5tenum_nameof_c') + IMPORT :: C_CHAR + IMPORT :: HID_T, SIZE_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: type_id + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(OUT) :: name + INTEGER(SIZE_T), INTENT(IN) :: namelen + INTEGER, INTENT(IN) :: value + END FUNCTION h5tenum_nameof_c + END INTERFACE + + name(1:LEN(name)) = ' ' + + hdferr = h5tenum_nameof_c(type_id, value, name, namelen) + END SUBROUTINE h5tenum_nameof_f +! +!****s* H5T/h5tenum_valuof_f +! +! NAME +! h5tenum_valuof_f +! +! PURPOSE +! Returns the value corresponding to a specified +! member of an enumeration datatype. +! +! INPUTS +! type_id - datatype identifier +! name - symbol name +! OUTPUTS +! value - value of the enumeration datatype +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 7, 2001 +! +! SOURCE + SUBROUTINE h5tenum_valueof_f(type_id, name, value, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: type_id + CHARACTER(LEN=*), INTENT(IN) :: name + INTEGER, INTENT(OUT) :: value + INTEGER, INTENT(OUT) :: hdferr +!***** + INTEGER :: namelen + + INTERFACE + INTEGER FUNCTION h5tenum_valueof_c(type_id, name, namelen, value) & + BIND(C,NAME='h5tenum_valueof_c') + IMPORT :: C_CHAR + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: type_id + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: name + INTEGER, INTENT(IN) :: namelen + INTEGER, INTENT(OUT) :: value + END FUNCTION h5tenum_valueof_c + END INTERFACE + + namelen = LEN(name) + hdferr = h5tenum_valueof_c(type_id, name, namelen, value) + END SUBROUTINE h5tenum_valueof_f + +! +!****s* H5T/h5tget_member_value_f +! +! NAME +! h5tget_member_value_f +! +! PURPOSE +! Returns the value of an enumeration datatype member. +! +! INPUTS +! type_id - datatype identifier +! member_no - number of the enumeration datatype member +! OUTPUTS +! value - value of the enumeration datatype +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 7, 2001 +! SOURCE + SUBROUTINE h5tget_member_value_f(type_id, member_no, value, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: type_id + INTEGER, INTENT(IN) :: member_no + INTEGER, INTENT(OUT) :: value + INTEGER, INTENT(OUT) :: hdferr +!***** + INTERFACE + INTEGER FUNCTION h5tget_member_value_c(type_id, member_no, value) & + BIND(C,NAME='h5tget_member_value_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: type_id + INTEGER, INTENT(IN) :: member_no + INTEGER, INTENT(OUT) :: value + END FUNCTION h5tget_member_value_c + END INTERFACE + + hdferr = h5tget_member_value_c(type_id, member_no, value) + END SUBROUTINE h5tget_member_value_f + +! +!****s* H5T/h5tset_tag_f +! +! NAME +! h5tset_tag_f +! +! PURPOSE +! Tags an opaque datatype. +! +! INPUTS +! type_id - identifier for opaque datatype +! tag - unique ASCII string with which the opaque +! datatype is to be tagged. +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 7, 2001 +! SOURCE + SUBROUTINE h5tset_tag_f(type_id, tag, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: type_id + CHARACTER(LEN=*), INTENT(IN) :: tag + INTEGER, INTENT(OUT) :: hdferr +!***** + INTEGER :: taglen + + INTERFACE + INTEGER FUNCTION h5tset_tag_c(type_id, tag, taglen) BIND(C,NAME='h5tset_tag_c') + IMPORT :: C_CHAR + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: type_id + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: tag + INTEGER :: taglen + END FUNCTION h5tset_tag_c + END INTERFACE + + taglen = LEN(tag) + hdferr = h5tset_tag_c(type_id, tag, taglen) + END SUBROUTINE h5tset_tag_f + +! +!****s* H5T/h5tget_tag_f +! +! NAME +! h5tget_tag_f +! +! PURPOSE +! Gets the tag associated with an opaque datatype. +! +! INPUTS +! type_id - identifier for opaque datatype +! OUTPUTS +! tag - unique ASCII string associated with opaque +! datatype +! taglen - Length of tag +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 7, 2001 +! SOURCE + SUBROUTINE h5tget_tag_f(type_id, tag,taglen, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: type_id + CHARACTER(LEN=*), INTENT(OUT) :: tag + INTEGER, INTENT(OUT) :: taglen + INTEGER, INTENT(OUT) :: hdferr +!***** + INTEGER(SIZE_T):: tag_size ! Declared character length of tab + INTERFACE + INTEGER FUNCTION h5tget_tag_c(type_id, tag, tag_size, taglen) & + BIND(C,NAME='h5tget_tag_c') + IMPORT :: C_CHAR + IMPORT :: HID_T, SIZE_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: type_id + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(OUT) :: tag + INTEGER(SIZE_T), INTENT(IN) :: tag_size + INTEGER, INTENT(OUT) :: taglen + END FUNCTION h5tget_tag_c + END INTERFACE + + tag_size = LEN(tag) + hdferr = h5tget_tag_c(type_id, tag, tag_size, taglen ) + END SUBROUTINE h5tget_tag_f + +! +!****s* H5T/h5tvlen_create_f +! +! NAME +! h5tvlen_create_f +! +! PURPOSE +! Creates a new variable-length datatype. +! +! INPUTS +! type_id - identifier iof base datatype +! OUTPUTS +! vltype_id - identifier for VL datatype +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! Wednesday, October 23, 2002 +! +! NOTES +! Only basic Fortran base datatypes are supported +! +! SOURCE + SUBROUTINE h5tvlen_create_f(type_id, vltype_id, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: type_id + INTEGER(HID_T), INTENT(OUT) :: vltype_id + INTEGER, INTENT(OUT) :: hdferr +!***** + INTERFACE + INTEGER FUNCTION h5tvlen_create_c(type_id, vltype_id) BIND(C,NAME='h5tvlen_create_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: type_id + INTEGER(HID_T), INTENT(OUT) :: vltype_id + END FUNCTION h5tvlen_create_c + END INTERFACE + + hdferr = h5tvlen_create_c(type_id, vltype_id) + END SUBROUTINE h5tvlen_create_f + +! +!****s* H5T/h5tis_variable_str_f +! +! NAME +! h5tis_variable_str_f +! +! PURPOSE +! Determines whether a dattype is a variable string. +! +! INPUTS +! type_id - datartpe identifier +! OUTPUTS +! status - flag to indicate if datatype +! is a variable string ( TRUE or FALSE) +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! March 12, 2003 +! +! SOURCE + SUBROUTINE h5tis_variable_str_f(type_id, status, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: type_id + LOGICAL, INTENT(OUT) :: status + INTEGER, INTENT(OUT) :: hdferr +!***** + INTEGER :: flag ! "TRUE/FALSE/ERROR from C" + + INTERFACE + INTEGER FUNCTION h5tis_variable_str_c(type_id, flag) & + BIND(C,NAME='h5tis_variable_str_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: type_id + INTEGER :: flag + END FUNCTION h5tis_variable_str_c + END INTERFACE + + hdferr = h5tis_variable_str_c(type_id, flag) + status = .TRUE. + IF (flag .EQ. 0) status = .FALSE. + + END SUBROUTINE h5tis_variable_str_f + +! +!****s* H5T/h5tget_member_class_f +! +! NAME +! h5tget_member_class_f +! +! PURPOSE +! Returns datatype class of compound datatype member. +! +! INPUTS +! type_id - datartpe identifier +! member_no - index of compound datatype member +! OUTPUTS +! class - class type for compound dadtype member +! Valid classes: +! H5T_NO_CLASS_F (error) +! H5T_INTEGER_F +! H5T_FLOAT_F +! H5T_TIME_F +! H5T_STRING_F +! H5T_BITFIELD_F +! H5T_OPAQUE_F +! H5T_COMPOUND_F +! H5T_REFERENCE_F +! H5T_ENUM_F +! H5T_VLEN_F +! H5T_ARRAY_F +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! April 6, 2005 +! +! SOURCE + SUBROUTINE h5tget_member_class_f(type_id, member_no, class, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: type_id + INTEGER, INTENT(IN) :: member_no + INTEGER, INTENT(OUT) :: class + INTEGER, INTENT(OUT) :: hdferr +!***** + INTERFACE + INTEGER FUNCTION h5tget_member_class_c(type_id, member_no, class) & + BIND(C,NAME='h5tget_member_class_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: type_id + INTEGER, INTENT(IN) :: member_no + INTEGER, INTENT(OUT) :: class + END FUNCTION h5tget_member_class_c + END INTERFACE + + hdferr = h5tget_member_class_c(type_id, member_no, class) + + END SUBROUTINE h5tget_member_class_f + +! +!****s* H5T/h5tcommit_anon_f +! +! NAME +! h5tcommit_anon_f +! +! PURPOSE +! Commits a transient datatype to a file, +! creating a new named datatype, +! but does not link it into the file structure. +! +! INPUTS +! loc_id - A file or group identifier specifying the file +! in which the new named datatype is to be created. +! dtype_id - A datatype identifier. +! +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails +! OPTIONAL PARAMETERS +! tcpl_id - A datatype creation property list identifier. +! (H5P_DEFAULT_F for the default property list.) +! tapl_id - A datatype access property list identifier. +! should always be passed as the value H5P_DEFAULT_F. +! +! AUTHOR +! M. Scot Breitenfeld +! February 25, 2008 +! +! SOURCE + SUBROUTINE h5tcommit_anon_f(loc_id, dtype_id, hdferr, tcpl_id, tapl_id) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id + INTEGER(HID_T), INTENT(IN) :: dtype_id + INTEGER, INTENT(OUT) :: hdferr + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: tcpl_id + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: tapl_id +!***** + INTEGER(HID_T) :: tcpl_id_default + INTEGER(HID_T) :: tapl_id_default + + INTERFACE + INTEGER FUNCTION h5tcommit_anon_c(loc_id, dtype_id, & + tcpl_id_default, tapl_id_default) BIND(C,NAME='h5tcommit_anon_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id + INTEGER(HID_T), INTENT(IN) :: dtype_id + INTEGER(HID_T) :: tcpl_id_default + INTEGER(HID_T) :: tapl_id_default + END FUNCTION h5tcommit_anon_c + END INTERFACE + + tcpl_id_default = H5P_DEFAULT_F + tapl_id_default = H5P_DEFAULT_F + + IF(PRESENT(tcpl_id)) tcpl_id_default = tcpl_id + IF(PRESENT(tapl_id)) tapl_id_default = tapl_id + + hdferr = h5tcommit_anon_c(loc_id, dtype_id, & + tcpl_id_default, tapl_id_default ) + + END SUBROUTINE h5tcommit_anon_f + +! +!****s* H5T/h5tcommitted_f +! +! NAME +! h5tcommitted_f +! +! PURPOSE +! Determines whether a datatype is a named type or a transient type. +! +! INPUTS +! dtype_id - A datatype identifier. +! +! OUTPUTS +! committed - .TRUE., if the datatype has been committed +! .FALSE., if the datatype has not been committed. +! hdferr - Returns 0 if successful and -1 if fails +! AUTHOR +! M. Scot Breitenfeld +! February 25, 2008 +! +! SOURCE + SUBROUTINE h5tcommitted_f(dtype_id, committed, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dtype_id + LOGICAL, INTENT(OUT) :: committed + INTEGER, INTENT(OUT) :: hdferr +!***** + INTERFACE + INTEGER FUNCTION h5tcommitted_c(dtype_id) BIND(C,NAME='h5tcommitted_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dtype_id + END FUNCTION h5tcommitted_c + END INTERFACE + + hdferr = h5tcommitted_c(dtype_id) + + IF(hdferr.GT.0)THEN + committed = .TRUE. + hdferr = 0 + ELSE IF(hdferr.EQ.0)THEN + committed = .FALSE. + hdferr = 0 + ELSE + hdferr = -1 + ENDIF + + END SUBROUTINE h5tcommitted_f + +! +!****s* H5T/H5Tdecode_f +! +! NAME +! H5Tdecode_f +! +! PURPOSE +! Decode a binary object description of data type and return a new object handle. +! INPUTS +! buf - Buffer for the data space object to be decoded. +! obj_id - Object ID +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! M. Scot Breitenfeld +! April 9, 2008 +! +! SOURCE + SUBROUTINE h5tdecode_f(buf, obj_id, hdferr) + IMPLICIT NONE + CHARACTER(LEN=*), INTENT(IN) :: buf + INTEGER(HID_T), INTENT(OUT) :: obj_id + INTEGER, INTENT(OUT) :: hdferr +!***** + INTERFACE + INTEGER FUNCTION h5tdecode_c(buf, obj_id) BIND(C,NAME='h5tdecode_c') + IMPORT :: C_CHAR + IMPORT :: HID_T + IMPLICIT NONE + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: buf + INTEGER(HID_T), INTENT(OUT) :: obj_id ! Object ID + END FUNCTION h5tdecode_c + END INTERFACE + + hdferr = h5tdecode_c(buf, obj_id) + + END SUBROUTINE h5tdecode_f + +! +!****s* H5T/H5Tencode_f +! +! NAME +! H5Tencode_f +! +! PURPOSE +! Encode a data type object description into a binary buffer. +! +! INPUTS +! obj_id - Identifier of the object to be encoded. +! buf - Buffer for the object to be encoded into. +! nalloc - The size of the allocated buffer. +! OUTPUTS +! nalloc - The size of the buffer needed. +! hdferr - Returns 0 if successful and -1 if fails. +! +! AUTHOR +! M. Scot Breitenfeld +! April 9, 2008 +! SOURCE + SUBROUTINE h5tencode_f(obj_id, buf, nalloc, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: obj_id + CHARACTER(LEN=*), INTENT(OUT) :: buf + INTEGER(SIZE_T), INTENT(INOUT) :: nalloc + INTEGER, INTENT(OUT) :: hdferr +!***** + + INTERFACE + INTEGER FUNCTION h5tencode_c(buf, obj_id, nalloc) BIND(C,NAME='h5tencode_c') + IMPORT :: C_CHAR + IMPORT :: HID_T, SIZE_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: obj_id + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(OUT) :: buf + INTEGER(SIZE_T), INTENT(INOUT) :: nalloc + END FUNCTION h5tencode_c + END INTERFACE + + hdferr = h5tencode_c(buf, obj_id, nalloc) + + END SUBROUTINE h5tencode_f + +! +!****s* H5T/h5tget_create_plist_f +! +! NAME +! h5tget_create_plist_f +! +! PURPOSE +! Returns a copy of a datatype creation property list. +! +! INPUTS +! dtype_id - Datatype identifier +! OUTPUTS +! dtpl_id - Datatype property list identifier +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! M. Scot Breitenfeld +! April 9, 2008 +! +! SOURCE + SUBROUTINE h5tget_create_plist_f(dtype_id, dtpl_id, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dtype_id + INTEGER(HID_T), INTENT(OUT) :: dtpl_id + INTEGER, INTENT(OUT) :: hdferr +!***** + INTERFACE + INTEGER FUNCTION h5tget_create_plist_c(dtype_id, dtpl_id) BIND(C,NAME='h5tget_create_plist_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dtype_id + INTEGER(HID_T), INTENT(OUT) :: dtpl_id + END FUNCTION h5tget_create_plist_c + END INTERFACE + + hdferr = h5tget_create_plist_c(dtype_id, dtpl_id) + END SUBROUTINE h5tget_create_plist_f + +! +!****s* H5T/h5tcompiler_conv_f +! +! NAME +! h5tcompiler_conv_f +! +! PURPOSE +! Check whether the library’s default conversion is hard conversion.R +! +! INPUTS +! src_id - Identifier for the source datatype. +! dst_id - Identifier for the destination datatype. +! OUTPUTS +! flag - TRUE for compiler conversion, FALSE for library conversion +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! M. Scot Breitenfeld +! April 9, 2008 +! SOURCE + SUBROUTINE h5tcompiler_conv_f( src_id, dst_id, flag, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: src_id + INTEGER(HID_T), INTENT(IN) :: dst_id + LOGICAL, INTENT(OUT) :: flag + INTEGER, INTENT(OUT) :: hdferr +!***** + INTEGER :: c_flag + + INTERFACE + INTEGER FUNCTION h5tcompiler_conv_c(src_id, dst_id, c_flag) BIND(C,NAME='h5tcompiler_conv_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: src_id + INTEGER(HID_T), INTENT(IN) :: dst_id + INTEGER :: c_flag + END FUNCTION h5tcompiler_conv_c + END INTERFACE + + hdferr = h5tcompiler_conv_c(src_id, dst_id, c_flag) + + flag = .FALSE. + IF(c_flag .GT. 0) flag = .TRUE. + + END SUBROUTINE h5tcompiler_conv_f + +! +!****s* H5T/h5tget_native_type_f +! +! NAME +! h5tget_native_type_f +! +! PURPOSE +! Returns the native datatype of a specified datatype. +! +! INPUTS +! dtype_id - Datatype identifier for the dataset datatype. +! +! direction - Direction of search: +! H5T_DIR_DEFAULT, default direction is inscendent, +! H5T_DIR_ASCEND , in inscendent order, +! H5T_DIR_DESCEND, in descendent order. +! +! * NOTE: In C it is defined as a structure: H5T_direction_t +! +! OUTPUTS +! native_dtype_id - The native datatype identifier for the specified dataset datatype +! hdferr - Returns 0 if successful and -1 if fails +! AUTHOR +! M. Scot Breitenfeld +! June 18, 2008 +! SOURCE + SUBROUTINE h5tget_native_type_f(dtype_id, direction, native_dtype_id, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dtype_id + INTEGER, INTENT(IN) :: direction + INTEGER(HID_T), INTENT(OUT) :: native_dtype_id + INTEGER, INTENT(OUT) :: hdferr +!***** + INTERFACE + INTEGER FUNCTION h5tget_native_type_c(dtype_id, direction, native_dtype_id) BIND(C,NAME='h5tget_native_type_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dtype_id + INTEGER, INTENT(IN) :: direction + INTEGER(HID_T), INTENT(OUT) :: native_dtype_id + END FUNCTION h5tget_native_type_c + END INTERFACE + + hdferr = h5tget_native_type_c(dtype_id, direction, native_dtype_id) + END SUBROUTINE h5tget_native_type_f + +!****s* H5T/H5Tconvert_f_F03 +! +! NAME +! H5Tconvert_f +! +! PURPOSE +! Converts data from between specified datatypes. +! +! Inputs: +! src_id - Identifier for the source datatype. +! dst_id - Identifier for the destination datatype. +! nelmts - Size of array buf. +! buf - Array containing pre-conversion values. +! background - Optional background buffer. +! plist_id - Dataset transfer property list identifier. +! +! Outputs: +! buf - Array containing post-conversion values. +! hdferr - error code: +! 0 on success and -1 on failure +! AUTHOR +! M. Scot Breitenfeld +! Decemember 8, 2008 +! +! Fortran2003 Interface: + SUBROUTINE h5tconvert_f(src_id, dst_id, nelmts, buf, hdferr, background, plist_id) + IMPLICIT NONE + INTEGER(HID_T) , INTENT(IN) :: src_id + INTEGER(HID_T) , INTENT(IN) :: dst_id + INTEGER(SIZE_T), INTENT(IN) :: nelmts + TYPE(C_PTR) , INTENT(INOUT) :: buf + INTEGER , INTENT(OUT) :: hdferr + TYPE(C_PTR) , INTENT(INOUT), OPTIONAL :: background + INTEGER(HID_T) , INTENT(IN) , OPTIONAL :: plist_id +!***** + INTEGER(HID_T) :: plist_id_default + TYPE(C_PTR) :: background_default + + INTERFACE + INTEGER FUNCTION h5tconvert_c(src_id, dst_id, nelmts, buf, background, plist_id) & + BIND(C, NAME='h5tconvert_c') + IMPORT :: c_ptr + IMPORT :: HID_T, SIZE_T + IMPLICIT NONE + INTEGER(HID_T) , INTENT(IN) :: src_id + INTEGER(HID_T) , INTENT(IN) :: dst_id + INTEGER(SIZE_T), INTENT(IN) :: nelmts + TYPE(C_PTR) , VALUE :: buf + TYPE(C_PTR) , VALUE :: background + INTEGER(HID_T) , INTENT(IN) :: plist_id + END FUNCTION h5tconvert_c + END INTERFACE + + plist_id_default = H5P_DEFAULT_F + IF(PRESENT(plist_id)) plist_id_default = plist_id + + background_default = C_NULL_PTR + IF(PRESENT(background)) background_default = background + + hdferr = H5Tconvert_c(src_id, dst_id, nelmts, buf, background_default, plist_id_default) + + END SUBROUTINE h5tconvert_f +! +!****s* H5T/h5tenum_insert_f90 +! +! NAME +! h5tenum_insert_f +! +! PURPOSE +! Inserts a new enumeration datatype member. +! +! INPUTS +! type_id - Datatype identifier for the enumeration datatype. +! name - Datatype identifier. +! value - Value of the new member. +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 7, 2001 +! SOURCE + SUBROUTINE h5tenum_insert_f90(type_id, name, value, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: type_id + CHARACTER(LEN=*), INTENT(IN) :: name + INTEGER, INTENT(IN) :: value + INTEGER, INTENT(OUT) :: hdferr +!***** + INTEGER :: namelen + INTERFACE + INTEGER FUNCTION h5tenum_insert_c(type_id, name, namelen, value) BIND(C,NAME='h5tenum_insert_c') + IMPORT :: C_CHAR + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: type_id + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: name + INTEGER, INTENT(IN) :: value + INTEGER :: namelen + END FUNCTION h5tenum_insert_c + END INTERFACE + + namelen = LEN(name) + hdferr = h5tenum_insert_c(type_id, name, namelen, value) + END SUBROUTINE h5tenum_insert_f90 + +! +!****s* H5T/h5tenum_insert_f03 +! +! NAME +! h5tenum_insert_f +! +! PURPOSE +! Inserts a new enumeration datatype member. +! +! INPUTS +! type_id - Datatype identifier for the enumeration datatype. +! name - Datatype identifier. +! value - Pointer to the value of the new member. +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! M. Scot Breitenfeld +! February 6, 2015 +! +! HISTORY +! F2003 implementation of function +! SOURCE + SUBROUTINE h5tenum_insert_f03(type_id, name, value, hdferr) + IMPLICIT NONE + INTEGER(HID_T) , INTENT(IN) :: type_id + CHARACTER(LEN=*), INTENT(IN) :: name + TYPE(C_PTR) , INTENT(IN) :: value + INTEGER, INTENT(OUT) :: hdferr +!***** + INTEGER :: namelen + + INTERFACE + INTEGER FUNCTION h5tenum_insert_ptr_c(type_id, name, namelen, value) & + BIND(C, NAME='h5tenum_insert_ptr_c') + IMPORT :: C_CHAR, C_PTR + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: type_id + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: name + INTEGER :: namelen + TYPE(C_PTR), VALUE :: value + END FUNCTION h5tenum_insert_ptr_c + END INTERFACE + + namelen = LEN(name) + hdferr = h5tenum_insert_ptr_c(type_id, name, namelen, value) + END SUBROUTINE h5tenum_insert_f03 + +END MODULE H5T diff --git a/fortran/src/H5Tff.f90 b/fortran/src/H5Tff.f90 deleted file mode 100644 index 4b4c0b6..0000000 --- a/fortran/src/H5Tff.f90 +++ /dev/null @@ -1,3105 +0,0 @@ -!****h* ROBODoc/H5T -! -! NAME -! MODULE H5T -! -! PURPOSE -! This file contains Fortran interfaces for H5T functions. It includes -! all the functions that are independent on whether the Fortran 2003 functions -! are enabled or disabled. -! -! -! 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. * -! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -! -! NOTES -! *** IMPORTANT *** -! If you add a new H5T function you must add the function name to the -! Windows dll file 'hdf5_fortrandll.def.in' in the fortran/src directory. -! This is needed for Windows based operating systems. -! -!***** - -MODULE H5T - - USE H5GLOBAL - -CONTAINS - -! -!****s* H5T/h5topen_f -! -! NAME -! h5topen_f -! -! PURPOSE -! Opens named datatype. -! -! INPUTS -! loc_id - location identifier -! name - a datatype name -! OUTPUTS -! type_id - datatype identifier -! hdferr - Returns 0 if successful and -1 if fails -! OPTIONAL PARAMETERS -! tapl_id - datatype access property list identifier. -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 7, 2001 -! -! Added optional parameter 'tapl_id' for compatability -! with H5Topen2. April 9, 2009. -! -! SOURCE - SUBROUTINE h5topen_f(loc_id, name, type_id, hdferr, tapl_id) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier - CHARACTER(LEN=*), INTENT(IN) :: name ! Datatype name within file or group - INTEGER(HID_T), INTENT(OUT) :: type_id ! Datatype identifier - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: tapl_id ! datatype access property list identifier -!***** - INTEGER :: namelen ! Name length - INTEGER(HID_T) :: tapl_id_default - - INTERFACE - INTEGER FUNCTION h5topen_c(loc_id, name, namelen, type_id, tapl_id_default) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TOPEN_C'::h5topen_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference ::name - INTEGER(HID_T), INTENT(IN) :: loc_id - CHARACTER(LEN=*), INTENT(IN) :: name - INTEGER :: namelen - INTEGER(HID_T), INTENT(OUT) :: type_id - INTEGER(HID_T) :: tapl_id_default - END FUNCTION h5topen_c - END INTERFACE - - namelen = LEN(name) - - tapl_id_default = H5P_DEFAULT_F - IF(PRESENT(tapl_id)) tapl_id_default = tapl_id - - hdferr = h5topen_c(loc_id, name, namelen, type_id, tapl_id_default) - END SUBROUTINE h5topen_f -! -!****s* H5T/h5tcommit_f -! -! NAME -! h5tcommit_f -! -! PURPOSE -! Commits a transient datatype to a file, creating a -! new named datatype. -! -! INPUTS -! loc_id - location identifier -! name - name of the datatype to be stored -! at the specified location -! type_id - identifier of a datatype to be stored -! OUTPUTS -! hdferr - Returns 0 if successful and -1 if fails -! OPTIONAL PARAMETERS -! lcpl_id - Link creation property list -! tcpl_id - Datatype creation property list -! tapl_id - Datatype access property list -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! - Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 7, 2001 -! -! - Added optional parameters introduced in version 1.8 -! M. Scot Breitenfeld -! -! SOURCE - SUBROUTINE h5tcommit_f(loc_id, name, type_id, hdferr, & - lcpl_id, tcpl_id, tapl_id ) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier - CHARACTER(LEN=*), INTENT(IN) :: name - ! Datatype name within file or group - INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lcpl_id ! Link creation property list - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: tcpl_id ! Datatype creation property list - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: tapl_id ! Datatype access property list -!***** - - INTEGER :: namelen ! Name length - - INTEGER(HID_T) :: lcpl_id_default - INTEGER(HID_T) :: tcpl_id_default - INTEGER(HID_T) :: tapl_id_default - - INTERFACE - INTEGER FUNCTION h5tcommit_c(loc_id, name, namelen, type_id, & - lcpl_id_default, tcpl_id_default, tapl_id_default ) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TCOMMIT_C'::h5tcommit_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference ::name - INTEGER(HID_T), INTENT(IN) :: loc_id - CHARACTER(LEN=*), INTENT(IN) :: name - INTEGER :: namelen - INTEGER(HID_T), INTENT(IN) :: type_id - INTEGER(HID_T) :: lcpl_id_default - INTEGER(HID_T) :: tcpl_id_default - INTEGER(HID_T) :: tapl_id_default - END FUNCTION h5tcommit_c - END INTERFACE - - lcpl_id_default = H5P_DEFAULT_F - tcpl_id_default = H5P_DEFAULT_F - tapl_id_default = H5P_DEFAULT_F - - IF (PRESENT(lcpl_id)) lcpl_id_default = lcpl_id - IF (PRESENT(tcpl_id)) tcpl_id_default = tcpl_id - IF (PRESENT(tapl_id)) tapl_id_default = tapl_id - - namelen = LEN(name) - - hdferr = h5tcommit_c(loc_id, name, namelen, type_id, & - lcpl_id_default, tcpl_id_default, tapl_id_default ) - - END SUBROUTINE h5tcommit_f -! -!****s* H5T/h5tcopy_f -! -! NAME -! h5tcopy_f -! -! PURPOSE -! Creates a copy of exisiting datatype. -! -! INPUTS -! type_id - datatype identifier -! OUTPUTS -! new_type_id - identifier of datatype's copy -! hdferr - Returns 0 if successful and -1 if fails -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 7, 2001 -! -! SOURCE - SUBROUTINE h5tcopy_f(type_id, new_type_id, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier - INTEGER(HID_T), INTENT(OUT) :: new_type_id - ! Identifier of datatype's copy - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTERFACE - INTEGER FUNCTION h5tcopy_c(type_id, new_type_id) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TCOPY_C'::h5tcopy_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: type_id - INTEGER(HID_T), INTENT(OUT) :: new_type_id - END FUNCTION h5tcopy_c - END INTERFACE - - hdferr = h5tcopy_c(type_id, new_type_id) - END SUBROUTINE h5tcopy_f -! -!****s* H5T/h5tequal_f -! -! NAME -! h5tequal_f -! -! PURPOSE -! Determines whether two datatype identifiers refer -! to the same datatype. -! -! INPUTS -! type1_id - datatype identifier -! type2_id - datatype identifier -! OUTPUTS -! flag - TRUE/FALSE flag to indicate -! if two datatypes are equal -! hdferr - Returns 0 if successful and -1 if fails -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 7, 2001 -! SOURCE - SUBROUTINE h5tequal_f(type1_id, type2_id, flag, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: type1_id ! Datatype identifier - INTEGER(HID_T), INTENT(IN) :: type2_id ! Datatype identifier - LOGICAL, INTENT(OUT) :: flag ! TRUE/FALSE flag to indicate if two - ! datatypes are equal - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTEGER :: c_flag - INTERFACE - INTEGER FUNCTION h5tequal_c(type1_id, type2_id, c_flag) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TEQUAL_C'::h5tequal_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: type1_id - INTEGER(HID_T), INTENT(IN) :: type2_id - INTEGER :: c_flag - END FUNCTION h5tequal_c - END INTERFACE - - flag = .FALSE. - hdferr = h5tequal_c(type1_id, type2_id, c_flag) - if(c_flag .gt. 0) flag = .TRUE. - END SUBROUTINE h5tequal_f -! -!****s* H5T/h5tclose_f -! -! NAME -! h5tclose_f -! -! PURPOSE -! Releases a datatype. -! -! INPUTS -! type_id - datatype identifier -! OUTPUTS -! hdferr - Returns 0 if successful and -1 if fails -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 7, 2001 -! -! SOURCE - SUBROUTINE h5tclose_f(type_id, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTERFACE - INTEGER FUNCTION h5tclose_c(type_id) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TCLOSE_C'::h5tclose_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: type_id - END FUNCTION h5tclose_c - END INTERFACE - - hdferr = h5tclose_c(type_id) - END SUBROUTINE h5tclose_f -! -!****s* H5T/h5tget_class_f -! -! NAME -! h5tget_class_f -! -! PURPOSE -! Returns the datatype class identifier. -! -! INPUTS -! type_id - Datatype identifier -! OUTPUTS -! class - Class, possible values are: -! H5T_NO_CLASS_F (-1) -! H5T_INTEGER_F (0) -! H5T_FLOAT_F (1) -! H5T_TIME_F (2) -! H5T_STRING_F (3) -! H5T_BITFIELD_F (4) -! H5T_OPAQUE_F (5) -! H5T_COMPOUND_F (6) -! H5T_REFERENCE_F (7) -! H5T_ENUM_F (8) -! H5T_VLEN_F (9) -! H5T_ARRAY_F (10) -! hdferr - Returns 0 if successful and -1 if fails -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 7, 2001 -! -! SOURCE - SUBROUTINE h5tget_class_f(type_id, class, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: type_id - INTEGER, INTENT(OUT) :: class - INTEGER, INTENT(OUT) :: hdferr -!***** - INTERFACE - INTEGER FUNCTION h5tget_class_c(type_id, class) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TGET_CLASS_C'::h5tget_class_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: type_id - INTEGER, INTENT(OUT) :: class - END FUNCTION h5tget_class_c - END INTERFACE - - hdferr = h5tget_class_c(type_id, class) - END SUBROUTINE h5tget_class_f -! -!****s* H5T/h5tget_size_f -! -! NAME -! h5tget_size_f -! -! PURPOSE -! Returns the size of a datatype. -! -! INPUTS -! type_id - datatype identifier -! OUTPUTS -! size - datatype size -! hdferr - Returns 0 if successful and -1 if fails -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 7, 2001 -! -! SOURCE - SUBROUTINE h5tget_size_f(type_id, size, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier - INTEGER(SIZE_T), INTENT(OUT) :: size ! Datatype size - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTERFACE - INTEGER FUNCTION h5tget_size_c(type_id, size) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TGET_SIZE_C'::h5tget_size_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: type_id - INTEGER(SIZE_T), INTENT(OUT) :: size - END FUNCTION h5tget_size_c - END INTERFACE - - hdferr = h5tget_size_c(type_id, size) - END SUBROUTINE h5tget_size_f - -! -!****s* H5T/h5tset_size_f -! -! NAME -! h5tset_size_f -! -! PURPOSE -! Sets the total size for an atomic datatype. -! -! INPUTS -! type_id - datatype identifier -! size - size of the datatype -! OUTPUTS -! hdferr - Returns 0 if successful and -1 if fails -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 7, 2001 -! -! -! SOURCE - SUBROUTINE h5tset_size_f(type_id, size, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier - INTEGER(SIZE_T), INTENT(IN) :: size ! Datatype size - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTERFACE - INTEGER FUNCTION h5tset_size_c(type_id, size) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TSET_SIZE_C'::h5tset_size_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: type_id - INTEGER(SIZE_T), INTENT(IN) :: size - END FUNCTION h5tset_size_c - END INTERFACE - - hdferr = h5tset_size_c(type_id, size) - END SUBROUTINE h5tset_size_f - -! -!****s* H5T/h5tget_order_f -! -! NAME -! h5tget_order_f -! -! PURPOSE -! Returns the byte order of an atomic datatype. -! -! INPUTS -! type_id - datatype identifier -! OUTPUTS -! order - byte order for the datatype, possible -! values are: -! H5T_ORDER_LE_F -! H5T_ORDER_BE_F -! H5T_ORDER_VAX_F (not implemented yet) -! hdferr - Returns 0 if successful and -1 if fails -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 7, 2001 -! -! SOURCE - SUBROUTINE h5tget_order_f(type_id, order, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier - INTEGER, INTENT(OUT) :: order - ! Datatype byte order, possible values are: - ! H5T_ORDER_LE_F - ! H5T_ORDER_BE_F - ! H5T_ORDER_VAX_F - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTERFACE - INTEGER FUNCTION h5tget_order_c(type_id, order) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TGET_ORDER_C'::h5tget_order_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: type_id - INTEGER, INTENT(OUT) :: order - END FUNCTION h5tget_order_c - END INTERFACE - - hdferr = h5tget_order_c(type_id, order) - END SUBROUTINE h5tget_order_f -! -!****s* H5T/h5tset_order_f -! -! NAME -! h5tset_order_f -! -! PURPOSE -! Sets the byte ordering of an atomic datatype. -! -! INPUTS -! type_id - datatype identifier -! order - datatype byte order Possible values are: -! H5T_ORDER_LE_F -! H5T_ORDER_BE_F -! H5T_ORDER_VAX_F (not implemented yet) -! OUTPUTS -! hdferr - Returns 0 if successful and -1 if fails -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 7, 2001 -! -! SOURCE - SUBROUTINE h5tset_order_f(type_id, order, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier - INTEGER, INTENT(IN) :: order ! Datatype byte order, possible values - ! are: - ! H5T_ORDER_LE_F - ! H5T_ORDER_BE_F - ! H5T_ORDER_VAX_F - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTERFACE - INTEGER FUNCTION h5tset_order_c(type_id, order) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TSET_ORDER_C'::h5tset_order_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: type_id - INTEGER, INTENT(IN) :: order - END FUNCTION h5tset_order_c - END INTERFACE - - hdferr = h5tset_order_c(type_id, order) - END SUBROUTINE h5tset_order_f - -! -!****s* H5T/h5tget_precision_f -! -! NAME -! h5tget_precision_f -! -! PURPOSE -! Returns the precision of an atomic datatype. -! -! INPUTS -! type_id - datatype identifier -! OUTPUTS -! precision - precision of the datatype -! hdferr - Returns 0 if successful and -1 if fails -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 7, 2001 -! -! SOURCE - SUBROUTINE h5tget_precision_f(type_id, precision, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier - INTEGER(SIZE_T), INTENT(OUT) :: precision ! Datatype precision - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTERFACE - INTEGER FUNCTION h5tget_precision_c (type_id, precision) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TGET_PRECISION_C'::h5tget_precision_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: type_id - INTEGER(SIZE_T), INTENT(OUT) :: precision - END FUNCTION h5tget_precision_c - END INTERFACE - - hdferr = h5tget_precision_c(type_id, precision) - END SUBROUTINE h5tget_precision_f - -! -!****s* H5T/h5tset_precision_f -! -! NAME -! h5tset_precision_f -! -! PURPOSE -! Sets the precision of an atomic datatype. -! -! INPUTS -! type_id - datatype identifier -! precision - datatype precision -! OUTPUTS -! hdferr - Returns 0 if successful and -1 if fails -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 7, 2001 -! -! SOURCE - SUBROUTINE h5tset_precision_f(type_id, precision, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier - INTEGER(SIZE_T), INTENT(IN) :: precision ! Datatype precision - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTERFACE - INTEGER FUNCTION h5tset_precision_c (type_id, precision) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TSET_PRECISION_C'::h5tset_precision_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: type_id - INTEGER(SIZE_T), INTENT(IN) :: precision - END FUNCTION h5tset_precision_c - END INTERFACE - - hdferr = h5tset_precision_c(type_id, precision) - END SUBROUTINE h5tset_precision_f - -! -!****s* H5T/h5tget_offset_f -! -! NAME -! h5tget_offset_f -! -! PURPOSE -! Retrieves the bit offset of the first significant bit. -! -! INPUTS -! type_id - datatype identifier -! OUTPUTS -! offset - offset value -! hdferr - Returns 0 if successful and -1 if fails -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 7, 2001 -! -! SOURCE - SUBROUTINE h5tget_offset_f(type_id, offset, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier - INTEGER(SIZE_T), INTENT(OUT) :: offset ! Datatype bit offset of the - ! first significant bit - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTERFACE - INTEGER FUNCTION h5tget_offset_c(type_id, offset) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TGET_OFFSET_C'::h5tget_offset_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: type_id - INTEGER(SIZE_T), INTENT(OUT) :: offset - END FUNCTION h5tget_offset_c - END INTERFACE - - hdferr = h5tget_offset_c(type_id, offset) - END SUBROUTINE h5tget_offset_f - -! -!****s* H5T/h5tset_offset_f -! -! NAME -! h5tset_offset_f -! -! PURPOSE -! Sets the bit offset of the first significant bit. -! -! INPUTS -! type_id - datatype identifier -! offset - offset value -! OUTPUTS -! hdferr - Returns 0 if successful and -1 if fails -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 7, 2001 -! -! SOURCE - SUBROUTINE h5tset_offset_f(type_id, offset, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier - INTEGER(SIZE_T), INTENT(IN) :: offset ! Datatype bit offset of the - ! first significant bit - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTERFACE - INTEGER FUNCTION h5tset_offset_c(type_id, offset) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TSET_OFFSET_C'::h5tset_offset_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: type_id - INTEGER(SIZE_T), INTENT(IN) :: offset - END FUNCTION h5tset_offset_c - END INTERFACE - - hdferr = h5tset_offset_c(type_id, offset) - END SUBROUTINE h5tset_offset_f - -! -!****s* H5T/h5tget_pad_f -! -! NAME -! h5tget_pad_f -! -! PURPOSE -! Retrieves the padding type of the least and -! most -significant bit padding. -! -! INPUTS -! type_id - datatype identifier -! OUTPUTS -! lsbpad - least-significant bit padding type -! msbpad - most-significant bit padding type -! Possible values of padding type are: -! H5T_PAD_ERROR_F = -1 -! H5T_PAD_ZERO_F = 0 -! H5T_PAD_ONE_F = 1 -! H5T_PAD_BACKGROUND_F = 2 -! H5T_PAD_NPAD_F = 3 -! hdferr - Returns 0 if successful and -1 if fails - -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 7, 2001 -! SOURCE - SUBROUTINE h5tget_pad_f(type_id, lsbpad, msbpad, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier - INTEGER, INTENT(OUT) :: lsbpad ! padding type of the - ! least significant bit - INTEGER, INTENT(OUT) :: msbpad ! padding type of the - ! most significant bit - ! Possible values of padding type are: - ! H5T__PAD_ZERO_F = 0 - ! H5T__PAD_ONE_F = 1 - ! H5T__PAD_BACKGROUND_F = 2 - ! H5T_PAD_ERROR_F = -1 - ! H5T_PAD_NPAD_F = 3 - - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTERFACE - INTEGER FUNCTION h5tget_pad_c(type_id, lsbpad, msbpad) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TGET_PAD_C'::h5tget_pad_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: type_id - INTEGER, INTENT(OUT) :: lsbpad - INTEGER, INTENT(OUT) :: msbpad - END FUNCTION h5tget_pad_c - END INTERFACE - - hdferr = h5tget_pad_c(type_id, lsbpad, msbpad) - END SUBROUTINE h5tget_pad_f - -! -!****s* H5T/h5tset_pad_f -! -! NAME -! h5tset_pad_f -! -! PURPOSE -! Sets the least and most-significant bits padding types. -! -! INPUTS -! type_id - datatype identifier -! lsbpad - least-significant bit padding type -! msbpad - most-significant bit padding type -! Possible values of padding type are: -! H5T_PAD_ERROR_F = -1 -! H5T_PAD_ZERO_F = 0 -! H5T_PAD_ONE_F = 1 -! H5T_PAD_BACKGROUND_F = 2 -! H5T_PAD_NPAD_F = 3 -! OUTPUTS -! hdferr - Returns 0 if successful and -1 if fails -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 7, 2001 -! SOURCE - SUBROUTINE h5tset_pad_f(type_id, lsbpad, msbpad, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier - INTEGER, INTENT(IN) :: lsbpad ! padding type of the - ! least significant bit - INTEGER, INTENT(IN) :: msbpad ! padding type of the - ! most significant bit - ! Possible values of padding type are: - ! H5T_PAD_ZERO_F = 0 - ! H5T_PAD_ONE_F = 1 - ! H5T_PAD_BACKGROUND_F = 2 - ! H5T_PAD_ERROR_F = -1 - ! H5T_PAD_NPAD_F = 3 - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTERFACE - INTEGER FUNCTION h5tset_pad_c(type_id, lsbpad, msbpad) - USE H5GLOBAL - INTEGER(HID_T), INTENT(IN) :: type_id - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TSET_PAD_C'::h5tset_pad_c - !DEC$ENDIF - INTEGER, INTENT(IN) :: lsbpad - INTEGER, INTENT(IN) :: msbpad - END FUNCTION h5tset_pad_c - END INTERFACE - - hdferr = h5tset_pad_c(type_id, lsbpad, msbpad) - END SUBROUTINE h5tset_pad_f - -! -!****s* H5T/h5tget_sign_f -! -! NAME -! h5tget_sign_f -! -! PURPOSE -! Retrieves the sign type for an integer type. -! -! INPUTS -! type_id - datatype identifier -! OUTPUTS -! sign - sign type -! Possible values are: -! - Unsigned integer type -! H5T_SGN_NONE_F = 0 -! - Two's complement signed integer type -! H5T_SGN_2_F = 1 -! - error value: H5T_SGN_ERROR_F=-1 -! hdferr - Returns 0 if successful and -1 if fails -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 7, 2001 -! SOURCE - SUBROUTINE h5tget_sign_f(type_id, sign, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier - INTEGER, INTENT(OUT) :: sign ! sign type for an integer type - !possible values are: - !Unsigned integer type H5T_SGN_NONE_F = 0 - !Two's complement signed integer type - !H5T_SGN_2_F = 1 - !or error value: H5T_SGN_ERROR_F=-1 - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - - INTERFACE - INTEGER FUNCTION h5tget_sign_c(type_id, sign) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TGET_SIGN_C'::h5tget_sign_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: type_id - INTEGER, INTENT(OUT) :: sign - END FUNCTION h5tget_sign_c - END INTERFACE - - hdferr = h5tget_sign_c(type_id, sign) - END SUBROUTINE h5tget_sign_f - -! -!****s* H5T/h5tset_sign_f -! -! NAME -! h5tset_sign_f -! -! PURPOSE -! Sets the sign proprety for an integer type. -! -! INPUTS -! type_id - datatype identifier -! sign - sign type -! Possible values are: -! - Unsigned integer type -! H5T_SGN_NONE_F = 0 -! - Two's complement signed integer type -! H5T_SGN_2_F = 1 -! - error value: H5T_SGN_ERROR_F=-1 -! OUTPUTS -! hdferr - Returns 0 if successful and -1 if fails -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 7, 2001 -! SOURCE - SUBROUTINE h5tset_sign_f(type_id, sign, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier - INTEGER, INTENT(IN) :: sign !sign type for an integer type - !possible values are: - !Unsigned integer type H5T_SGN_NONE_F = 0 - !Two's complement signed integer type - !H5T_SGN_2_F = 1 - !or error value: H5T_SGN_ERROR_F=-1 - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - - INTERFACE - INTEGER FUNCTION h5tset_sign_c(type_id, sign) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TSET_SIGN_C'::h5tset_sign_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: type_id - INTEGER, INTENT(IN) :: sign - END FUNCTION h5tset_sign_c - END INTERFACE - - hdferr = h5tset_sign_c(type_id, sign) - END SUBROUTINE h5tset_sign_f - -! -!****s* H5T/h5tget_fields_f -! -! NAME -! h5tget_fields_f -! -! PURPOSE -! Retrieves floating point datatype bit field information. -! -! INPUTS -! type_id - datatype identifier -! OUTPUTS -! spos - sign bit-position -! epos - exponent bit-position -! esize - size of exponent in bits -! mpos - mantissa position -! msize - size of mantissa in bits -! hdferr - Returns 0 if successful and -1 if fails -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 7, 2001 -! SOURCE - SUBROUTINE h5tget_fields_f(type_id, spos, epos, esize, mpos, msize, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier - INTEGER(SIZE_T), INTENT(OUT) :: spos ! sign bit-position - INTEGER(SIZE_T), INTENT(OUT) :: epos ! exponent bit-position - INTEGER(SIZE_T), INTENT(OUT) :: esize ! size of exponent in bits - INTEGER(SIZE_T), INTENT(OUT) :: mpos ! mantissa bit-position - INTEGER(SIZE_T), INTENT(OUT) :: msize ! size of mantissa in bits - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - - INTERFACE - INTEGER FUNCTION h5tget_fields_c(type_id, spos, epos, esize, mpos, msize) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TGET_FIELDS_C'::h5tget_fields_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: type_id - INTEGER(SIZE_T), INTENT(OUT) :: spos - INTEGER(SIZE_T), INTENT(OUT) :: epos - INTEGER(SIZE_T), INTENT(OUT) :: esize - INTEGER(SIZE_T), INTENT(OUT) :: mpos - INTEGER(SIZE_T), INTENT(OUT) :: msize - END FUNCTION h5tget_fields_c - END INTERFACE - - hdferr = h5tget_fields_c(type_id, spos, epos, esize, mpos, msize) - END SUBROUTINE h5tget_fields_f - -! -!****s* H5T/h5tset_fields_f -! -! NAME -! h5tset_fields_f -! -! PURPOSE -! Sets locations and sizes of floating point bit fields. -! -! INPUTS -! type_id - datatype identifier -! spos - sign bit-position -! epos - exponent bit-position -! esize - size of exponent in bits -! mpos - mantissa position -! msize - size of mantissa in bits -! OUTPUTS -! hdferr - Returns 0 if successful and -1 if fails -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 7, 2001 -! SOURCE - SUBROUTINE h5tset_fields_f(type_id, spos, epos, esize, mpos, msize, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier - INTEGER(SIZE_T), INTENT(IN) :: spos ! sign bit-position - INTEGER(SIZE_T), INTENT(IN) :: epos ! exponent bit-position - INTEGER(SIZE_T), INTENT(IN) :: esize ! size of exponent in bits - INTEGER(SIZE_T), INTENT(IN) :: mpos ! mantissa bit-position - INTEGER(SIZE_T), INTENT(IN) :: msize ! size of mantissa in bits - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - - INTERFACE - INTEGER FUNCTION h5tset_fields_c(type_id, spos, epos, esize, mpos, msize) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TSET_FIELDS_C'::h5tset_fields_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: type_id - INTEGER(SIZE_T), INTENT(IN) :: spos - INTEGER(SIZE_T), INTENT(IN) :: epos - INTEGER(SIZE_T), INTENT(IN) :: esize - INTEGER(SIZE_T), INTENT(IN) :: mpos - INTEGER(SIZE_T), INTENT(IN) :: msize - END FUNCTION h5tset_fields_c - END INTERFACE - - hdferr = h5tset_fields_c(type_id, spos, epos, esize, mpos, msize) - END SUBROUTINE h5tset_fields_f - -! -!****s* H5T/h5tget_ebias_f -! -! NAME -! h5tget_ebias_f -! -! PURPOSE -! Retrieves the exponent bias of a floating-point type. -! -! INPUTS -! type_id - datatype identifier -! OUTPUTS -! ebias - datatype exponent bias -! hdferr - Returns 0 if successful and -1 if fails -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 7, 2001 -! SOURCE - SUBROUTINE h5tget_ebias_f(type_id, ebias, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier - INTEGER(SIZE_T), INTENT(OUT) :: ebias ! Datatype exponent bias of a floating-point type - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - - INTERFACE - INTEGER FUNCTION h5tget_ebias_c(type_id, ebias) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TGET_EBIAS_C'::h5tget_ebias_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: type_id - INTEGER(SIZE_T), INTENT(OUT) :: ebias - END FUNCTION h5tget_ebias_c - END INTERFACE - - hdferr = h5tget_ebias_c(type_id, ebias) - END SUBROUTINE h5tget_ebias_f - -! -!****s* H5T/h5tset_ebias_f -! -! NAME -! h5tset_ebias_f -! -! PURPOSE -! Sets the exponent bias of a floating-point type. -! -! INPUTS -! type_id - datatype identifier -! ebias - datatype exponent bias -! OUTPUTS -! hdferr - Returns 0 if successful and -1 if fails -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 7, 2001 -! SOURCE - SUBROUTINE h5tset_ebias_f(type_id, ebias, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier - INTEGER(SIZE_T), INTENT(IN) :: ebias !Datatype exponent bias of a floating-point type - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - - INTERFACE - INTEGER FUNCTION h5tset_ebias_c(type_id, ebias) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TSET_EBIAS_C'::h5tset_ebias_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: type_id - INTEGER(SIZE_T), INTENT(IN) :: ebias - END FUNCTION h5tset_ebias_c - END INTERFACE - - hdferr = h5tset_ebias_c(type_id, ebias) - END SUBROUTINE h5tset_ebias_f - -! -!****s* H5T/h5tget_norm_f -! -! NAME -! h5tget_norm_f -! -! PURPOSE -! Retrieves mantissa normalization of a floating-point -! datatype. -! -! INPUTS -! type_id - datatype identifier -! OUTPUTS -! norm - normalization types, valid values are: -! H5T_NORM_IMPLIED_F(0) -! H5T_NORM_MSBSET_F(1) -! H5T_NORM_NONE_F(2) -! hdferr - Returns 0 if successful and -1 if fails -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 7, 2001 -! SOURCE - SUBROUTINE h5tget_norm_f(type_id, norm, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier - INTEGER, INTENT(OUT) :: norm !mantissa normalization of a floating-point datatype - !Valid normalization types are: - !H5T_NORM_IMPLIED_F(0),MSB of mantissa is not - !stored, always 1, H5T_NORM_MSBSET_F(1), MSB of - !mantissa is always 1, H5T_NORM_NONE_F(2) - !Mantissa is not normalize - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - - INTERFACE - INTEGER FUNCTION h5tget_norm_c(type_id, norm) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TGET_NORM_C'::h5tget_norm_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: type_id - INTEGER, INTENT(OUT) :: norm - END FUNCTION h5tget_norm_c - END INTERFACE - - hdferr = h5tget_norm_c(type_id, norm) - END SUBROUTINE h5tget_norm_f - -! -!****s* H5T/h5tset_norm_f -! -! NAME -! h5tset_norm_f -! -! PURPOSE -! Sets the mantissa normalization of a floating-point datatype. -! -! INPUTS -! type_id - datatype identifier -! norm - normalization types, valid values are: -! H5T_NORM_IMPLIED_F(0) -! H5T_NORM_MSBSET_F(1) -! H5T_NORM_NONE_F(2) -! OUTPUTS -! hdferr - Returns 0 if successful and -1 if fails -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 7, 2001 -! -! SOURCE - SUBROUTINE h5tset_norm_f(type_id, norm, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier - INTEGER, INTENT(IN) :: norm !mantissa normalization of a floating-point datatype - !Valid normalization types are: - !H5T_NORM_IMPLIED_F(0),MSB of mantissa is not - !stored, always 1, H5T_NORM_MSBSET_F(1), MSB of - !mantissa is always 1, H5T_NORM_NONE_F(2) - !Mantissa is not normalize - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTERFACE - INTEGER FUNCTION h5tset_norm_c(type_id, norm) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TSET_NORM_C'::h5tset_norm_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: type_id - INTEGER, INTENT(IN) :: norm - END FUNCTION h5tset_norm_c - END INTERFACE - - hdferr = h5tset_norm_c(type_id, norm) - END SUBROUTINE h5tset_norm_f - -! -!****s* H5T/h5tget_inpad_f -! -! NAME -! h5tget_inpad_f -! -! PURPOSE -! Retrieves the internal padding type for unused bits -! in floating-point datatypes. -! -! INPUTS -! type_id - datatype identifier -! OUTPUTS -! padtype - padding type for unused bits -! Possible values of padding type are: -! H5T_PAD_ZERO_F = 0 -! H5T_PAD_ONE_F = 1 -! H5T_PAD_BACKGROUND_F = 2 -! hdferr - Returns 0 if successful and -1 if fails -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 7, 2001 -! SOURCE - SUBROUTINE h5tget_inpad_f(type_id, padtype, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier - INTEGER, INTENT(OUT) :: padtype ! padding type for unused bits - ! in floating-point datatypes. - ! Possible values of padding type are: - ! H5T__PAD_ZERO_F = 0 - ! H5T__PAD_ONE_F = 1 - ! H5T__PAD_BACKGROUND_F = 2 - - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTERFACE - INTEGER FUNCTION h5tget_inpad_c(type_id, padtype) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TGET_INPAD_C'::h5tget_inpad_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: type_id - INTEGER, INTENT(OUT) :: padtype - END FUNCTION h5tget_inpad_c - END INTERFACE - - hdferr = h5tget_inpad_c(type_id, padtype) - END SUBROUTINE h5tget_inpad_f - -! -!****s* H5T/h5tset_inpad_f -! -! NAME -! h5tset_inpad_f -! -! PURPOSE -! Fills unused internal floating point bits. -! -! INPUTS -! type_id - datatype identifier -! padtype - padding type for unused bits -! Possible values of padding type are: -! H5T_PAD_ZERO_F = 0 -! H5T_PAD_ONE_F = 1 -! H5T_PAD_BACKGROUND_F = 2 -! OUTPUTS -! hdferr - Returns 0 if successful and -1 if fails -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 7, 2001 -! SOURCE - SUBROUTINE h5tset_inpad_f(type_id, padtype, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier - INTEGER, INTENT(IN) :: padtype ! padding type for unused bits - ! in floating-point datatypes. - ! Possible values of padding type are: - ! H5T__PAD_ZERO_F = 0 - ! H5T__PAD_ONE_F = 1 - ! H5T__PAD_BACKGROUND_F = 2 - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTERFACE - INTEGER FUNCTION h5tset_inpad_c(type_id, padtype) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TSET_INPAD_C'::h5tset_inpad_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: type_id - INTEGER, INTENT(IN) :: padtype - END FUNCTION h5tset_inpad_c - END INTERFACE - - hdferr = h5tset_inpad_c(type_id, padtype) - END SUBROUTINE h5tset_inpad_f - -! -!****s* H5T/h5tget_cset_f -! -! NAME -! h5tget_cset_f -! -! PURPOSE -! Retrieves the character set type of a string datatype. -! -! INPUTS -! type_id - Datatype identifier -! OUTPUTS -! cset - Character set type of a string datatype -! Possible values are: -! H5T_CSET_ASCII_F = 0 -! H5T_CSET_UTF8_F -! hdferr - Returns 0 if successful and -1 if fails -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 7, 2001 -! SOURCE - SUBROUTINE h5tget_cset_f(type_id, cset, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier - INTEGER, INTENT(OUT) :: cset ! character set type of a string datatype - ! Possible values are: - ! H5T_CSET_ASCII_F = 0 - ! H5T_CSET_UTF8_F - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTERFACE - INTEGER FUNCTION h5tget_cset_c(type_id, cset) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TGET_CSET_C'::h5tget_cset_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: type_id - INTEGER, INTENT(OUT) :: cset - END FUNCTION h5tget_cset_c - END INTERFACE - - hdferr = h5tget_cset_c(type_id, cset) - END SUBROUTINE h5tget_cset_f - -! -!****s* H5T/h5tset_cset_f -! -! NAME -! h5tset_cset_f -! -! PURPOSE -! Sets character set to be used. -! -! INPUTS -! type_id - datatype identifier -! cset - character set type of a string datatype -! Possible values are: -! H5T_CSET_ASCII_F = 0 -! H5T_CSET_UTF8_F -! OUTPUTS -! hdferr - Returns 0 if successful and -1 if fails -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 7, 2001 -! SOURCE - SUBROUTINE h5tset_cset_f(type_id, cset, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier - INTEGER, INTENT(IN) :: cset !character set type of a string datatype - ! Possible values of padding type are: - ! H5T_CSET_ASCII_F = 0 - ! H5T_CSET_UTF8_F - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTERFACE - INTEGER FUNCTION h5tset_cset_c(type_id, cset) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TSET_CSET_C'::h5tset_cset_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: type_id - INTEGER, INTENT(IN) :: cset - END FUNCTION h5tset_cset_c - END INTERFACE - - hdferr = h5tset_cset_c(type_id, cset) - END SUBROUTINE h5tset_cset_f - -! -!****s* H5T/h5tget_strpad_f -! -! NAME -! h5tget_strpad_f -! -! PURPOSE -! Retrieves the storage mechanism for a string datatype. -! -! INPUTS -! type_id - datatype identifier -! OUTPUTS -! strpad - storage method for a string datatype -! Possible values are: -! H5T_STR_NULLTERM_F, -! H5T_STR_NULLPAD_F, -! H5T_STR_SPACEPAD_F -! H5T_STR_ERROR_F -! hdferr - Returns 0 if successful and -1 if fails -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 7, 2001 -! SOURCE - SUBROUTINE h5tget_strpad_f(type_id, strpad, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier - INTEGER, INTENT(OUT) :: strpad - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTERFACE - INTEGER FUNCTION h5tget_strpad_c(type_id, strpad) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TGET_STRPAD_C'::h5tget_strpad_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: type_id - INTEGER, INTENT(OUT) :: strpad - END FUNCTION h5tget_strpad_c - END INTERFACE - - hdferr = h5tget_strpad_c(type_id, strpad) - END SUBROUTINE h5tget_strpad_f - -! -!****s* H5T/h5tset_strpad_f -! -! NAME -! h5tset_strpad_f -! -! PURPOSE -! Defines the storage mechanism for character strings. -! -! INPUTS -! type_id - datatype identifier -! strpad - storage method for a string datatype -! Possible values are: -! H5T_STR_NULLTERM_F, -! H5T_STR_NULLPAD_F, -! H5T_STR_SPACEPAD_F -! H5T_STR_ERROR_F -! OUTPUTS -! hdferr - Returns 0 if successful and -1 if fails -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 7, 2001 -! SOURCE - SUBROUTINE h5tset_strpad_f(type_id, strpad, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier - INTEGER, INTENT(IN) :: strpad ! string padding method for a string datatype - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTERFACE - INTEGER FUNCTION h5tset_strpad_c(type_id, strpad) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TSET_STRPAD_C'::h5tset_strpad_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: type_id - INTEGER, INTENT(IN) :: strpad - END FUNCTION h5tset_strpad_c - END INTERFACE - - hdferr = h5tset_strpad_c(type_id, strpad) - END SUBROUTINE h5tset_strpad_f - -! -!****s* H5T/h5tget_nmembers_f -! -! NAME -! h5tget_nmembers_f -! -! PURPOSE -! Retrieves the number of fields in a compound datatype. -! -! INPUTS -! type_id - datatype identifier -! OUTPUTS -! num_members - number of members -! hdferr - Returns 0 if successful and -1 if fails -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 7, 2001 -! -! SOURCE - SUBROUTINE h5tget_nmembers_f(type_id, num_members, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier - INTEGER, INTENT(OUT) :: num_members !number of fields in a compound datatype - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - - INTERFACE - INTEGER FUNCTION h5tget_nmembers_c(type_id, num_members) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TGET_NMEMBERS_C'::h5tget_nmembers_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: type_id - INTEGER, INTENT(OUT) :: num_members - END FUNCTION h5tget_nmembers_c - END INTERFACE - - hdferr = h5tget_nmembers_c(type_id, num_members) - END SUBROUTINE h5tget_nmembers_f - -! -!****s* H5T/h5tget_member_name_f -! -! NAME -! h5tget_member_name_f -! -! PURPOSE -! Retrieves the name of a field of a compound datatype. -! -! INPUTS -! type_id - datatype identifier -! index - filed index (0-based) -! OUTPUTS -! member_name - buffer to hold member's name -! namelen - name length -! hdferr - Returns 0 if successful and -1 if fails -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 7, 2001 -! SOURCE - SUBROUTINE h5tget_member_name_f(type_id, index, member_name, namelen, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier - INTEGER, INTENT(IN) :: index !Field index (0-based) of the field name to retrieve - CHARACTER(LEN=*), INTENT(OUT) :: member_name !name of a field of - !a compound datatype - INTEGER, INTENT(OUT) :: namelen ! Length of the name - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTERFACE - INTEGER FUNCTION h5tget_member_name_c(type_id, index, member_name, namelen) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TGET_MEMBER_NAME_C'::h5tget_member_name_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: member_name - INTEGER(HID_T), INTENT(IN) :: type_id - INTEGER, INTENT(IN) :: index - CHARACTER(LEN=*), INTENT(OUT) :: member_name - INTEGER, INTENT(OUT) :: namelen - END FUNCTION - END INTERFACE - - hdferr = h5tget_member_name_c(type_id, index, member_name, namelen) - END SUBROUTINE h5tget_member_name_f - -! -!****s* H5T/h5tget_member_offset_f -! -! NAME -! h5tget_member_offset_f -! -! PURPOSE -! Retrieves the offset of a field of a compound datatype. -! -! INPUTS -! type_id - datatype identifier -! member_no - number of the field -! OUTPUTS -! offset - byte offset of the requested field -! hdferr - Returns 0 if successful and -1 if fails -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 7, 2001 -! SOURCE - SUBROUTINE h5tget_member_offset_f(type_id, member_no, offset, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier - INTEGER, INTENT(IN) :: member_no !Number of the field - !whose offset is requested - INTEGER(SIZE_T), INTENT(OUT) :: offset !byte offset of the beginning of the field - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTERFACE - INTEGER FUNCTION h5tget_member_offset_c(type_id, member_no, offset ) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TGET_MEMBER_OFFSET_C'::h5tget_member_offset_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: type_id - INTEGER, INTENT(IN) :: member_no - INTEGER(SIZE_T), INTENT(OUT) :: offset - END FUNCTION h5tget_member_offset_c - END INTERFACE - - hdferr = h5tget_member_offset_c(type_id, member_no, offset ) - END SUBROUTINE h5tget_member_offset_f -! -!****s* H5T/h5tget_member_index_f -! -! NAME -! h5tget_member_index_f -! -! PURPOSE -! Retrieves the index of a compound or enumeration datatype member. -! -! INPUTS -! type_id - datatype identifier -! name - name of the field or member whose index to -! to be retrieved from the datatype. -! OUTPUTS -! index - 0-based index of the filed or member (0 to N-1) -! hdferr - Returns 0 if successful and -1 if fails -! -! AUTHOR -! Elena Pourmal -! September 26, 2002 -! -! SOURCE - SUBROUTINE h5tget_member_index_f(type_id, name, index, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier - CHARACTER(LEN=*), INTENT(IN) :: name ! Field or member name - INTEGER, INTENT(OUT) :: index ! Field or member index - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTEGER :: namelen ! Name length - - INTERFACE - INTEGER FUNCTION h5tget_member_index_c(type_id, name, namelen, index) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TGET_MEMBER_INDEX_C'::h5tget_member_index_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference ::name - INTEGER(HID_T), INTENT(IN) :: type_id - CHARACTER(LEN=*), INTENT(IN) :: name - INTEGER, INTENT(IN) :: namelen - INTEGER, INTENT(OUT) :: index - END FUNCTION h5tget_member_index_c - END INTERFACE - - namelen = LEN(name) - hdferr = h5tget_member_index_c(type_id, name, namelen, index) - END SUBROUTINE h5tget_member_index_f - - -! !$! -! !$!****s* H5T/h5tget_member_dim_f -! !$! -! !$! NAME -! !$! h5tget_member_dim_f -! !$! -! !$! PURPOSE -! !$! This function is not supported in hdf5-1.4.* -! !$! -! !$! INPUTS -! !$! OUTPUTS -! !$! hdferr: - error code -! !$! Success: 0 -! !$! Failure: -1 -! !$! -! !$! AUTHOR -! !$! Elena Pourmal -! !$! August 12, 1999 -! !$! -! !$! HISTORY -! !$! Explicit Fortran interfaces were added for -! !$! called C functions (it is needed for Windows -! !$! port). March 7, 2001 -! !$! -! !$! SOURCE -! !$! SUBROUTINE h5tget_member_dims_f(type_id, field_idx,dims, field_dims, perm, hdferr) -! !$! -! !$! IMPLICIT NONE -! !$! INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier -! !$! INTEGER, INTENT(IN) :: field_idx !Field index (0-based) of -! !$! !field_dims, perm) -! !$! INTEGER, INTENT(OUT) :: dims !number of dimensions of the field -! !$! -! !$! INTEGER(SIZE_T),DIMENSION(*), INTENT(OUT) :: field_dims !buffer to store the -! !$! !dimensions of the field -! !$! INTEGER, DIMENSION(*), INTENT(OUT) :: perm !buffer to store the -! !$! !permutation vector of the field -! !$! INTEGER, INTENT(OUT) :: hdferr ! Error code -! !$!*****! -! !$! INTEGER, EXTERNAL :: h5tget_member_dims_c -! !$! hdferr = h5tget_member_dims_c(type_id, field_idx, dims, field_dims, perm) -! !$! -! !$! END SUBROUTINE h5tget_member_dims_f - - -!****s* H5T/h5tget_array_dims_f -! -! NAME -! h5tget_array_dims_f -! -! PURPOSE -! Returns sizes of array dimensions. -! -! INPUTS -! type_id - array datatype identifier -! OUTPUTS -! dims - buffer to store array datatype dimensions -! hdferr - Returns 0 if successful and -1 if fails -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 7, 2001 -! SOURCE - SUBROUTINE h5tget_array_dims_f(type_id, dims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: type_id ! Array datatype identifier - INTEGER(HSIZE_T),DIMENSION(*), INTENT(OUT) :: dims !buffer to store array datatype - ! dimensions - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - - INTERFACE - INTEGER FUNCTION h5tget_array_dims_c(type_id, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TGET_ARRAY_DIMS_C'::h5tget_array_dims_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: type_id - INTEGER(HSIZE_T),DIMENSION(*), INTENT(OUT) :: dims - END FUNCTION h5tget_array_dims_c - END INTERFACE - - hdferr = h5tget_array_dims_c(type_id, dims) - - END SUBROUTINE h5tget_array_dims_f - -! -!****s* H5T/h5tget_array_ndims_f -! -! NAME -! h5tget_array_ndims_f -! -! PURPOSE -! Returns the rank of an array datatype. -! -! INPUTS -! type_id - array datatype identifier -! OUTPUTS -! ndims - number of array dimensions -! hdferr - Returns 0 if successful and -1 if fails -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 7, 2001 -! SOURCE - SUBROUTINE h5tget_array_ndims_f(type_id, ndims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: type_id ! Array datatype identifier - INTEGER, INTENT(OUT) :: ndims ! number of array dimensions - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTERFACE - INTEGER FUNCTION h5tget_array_ndims_c(type_id, ndims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TGET_ARRAY_NDIMS_C'::h5tget_array_ndims_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: type_id - INTEGER, INTENT(OUT) :: ndims - END FUNCTION h5tget_array_ndims_c - END INTERFACE - - hdferr = h5tget_array_ndims_c(type_id, ndims) - - END SUBROUTINE h5tget_array_ndims_f - -! -!****s* H5T/h5tget_super_f -! -! NAME -! h5tget_super_f -! -! PURPOSE -! Returns the base datatype from which a datatype is derived. -! -! INPUTS -! type_id - datatype identifier -! OUTPUTS -! base_type_id - identifier of the base type -! hdferr - Returns 0 if successful and -1 if fails -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 7, 2001 -! SOURCE - SUBROUTINE h5tget_super_f(type_id, base_type_id, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: type_id ! datatype identifier - INTEGER(HID_T), INTENT(OUT) :: base_type_id ! identifier of the datatype - ! from which datatype (type_id) was derived - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTERFACE - INTEGER FUNCTION h5tget_super_c(type_id, base_type_id) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TGET_SUPER_C'::h5tget_super_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: type_id - INTEGER(HID_T), INTENT(OUT) :: base_type_id - END FUNCTION h5tget_super_c - END INTERFACE - - hdferr = h5tget_super_c(type_id, base_type_id) - - END SUBROUTINE h5tget_super_f - -! -!****s* H5T/h5tget_member_type_f -! -! NAME -! h5tget_member_type_f -! -! PURPOSE -! Returns the datatype of the specified member. -! -! INPUTS -! type_id - compound datatype identifier -! field_idx - field index (0-based) -! -! OUTPUTS -! datatype - idnetifier of the member's datatype -! hdferr - Returns 0 if successful and -1 if fails -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 7, 2001 -! SOURCE - SUBROUTINE h5tget_member_type_f(type_id, field_idx, datatype, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier - INTEGER, INTENT(IN) :: field_idx !Field index (0-based) of the field type to retrieve - INTEGER(HID_T), INTENT(OUT) :: datatype !identifier of a copy of - !the datatype of the field - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTERFACE - INTEGER FUNCTION h5tget_member_type_c(type_id, field_idx , datatype) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TGET_MEMBER_TYPE_C'::h5tget_member_type_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: type_id - INTEGER, INTENT(IN) :: field_idx - INTEGER(HID_T), INTENT(OUT) :: datatype - END FUNCTION h5tget_member_type_c - END INTERFACE - - hdferr = h5tget_member_type_c(type_id, field_idx , datatype) - END SUBROUTINE h5tget_member_type_f - -! -!****s* H5T/h5tcreate_f -! -! NAME -! h5tcreate_f -! -! PURPOSE -! Creates a new datatype. -! -! INPUTS -! 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 -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 7, 2001 -! SOURCE - SUBROUTINE h5tcreate_f(class, size, type_id, hdferr) - 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 - - hdferr = h5tcreate_c(class, size, type_id) - END SUBROUTINE h5tcreate_f - -! -!****s* H5T/h5tinsert_f -! -! NAME -! h5tinsert_f -! -! PURPOSE -! Adds a new member to a compound datatype. -! -! INPUTS -! type_id - compound dattype identifier -! name - name of the field to insert -! offset - start of the member in an instance of -! the compound datatype -! field_id - datatype identifier of the field to insert -! OUTPUTS -! hdferr - Returns 0 if successful and -1 if fails -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 7, 2001 -! SOURCE - SUBROUTINE h5tinsert_f(type_id, name, offset, field_id, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier - CHARACTER(LEN=*), INTENT(IN) :: name !Name of the field to insert - INTEGER(SIZE_T), INTENT(IN) :: offset !start of the member in an instance of - !the compound datatype - INTEGER(HID_T), INTENT(IN) :: field_id !datatype identifier of the new member - - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTEGER :: namelen - - INTERFACE - INTEGER FUNCTION h5tinsert_c(type_id, name, namelen, offset, field_id) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TINSERT_C'::h5tinsert_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: name - INTEGER(HID_T), INTENT(IN) :: type_id - CHARACTER(LEN=*), INTENT(IN) :: name - INTEGER(SIZE_T), INTENT(IN) :: offset - INTEGER(HID_T), INTENT(IN) :: field_id - INTEGER :: namelen - END FUNCTION h5tinsert_c - END INTERFACE - - namelen = LEN(name) - hdferr = h5tinsert_c(type_id, name, namelen, offset, field_id ) - END SUBROUTINE h5tinsert_f - -! -!****s* H5T/h5tpack_f -! -! NAME -! h5tpack_f -! -! PURPOSE -! Recursively removes padding from within a compound datatype. -! -! INPUTS -! type_id - compound datatype identifier -! OUTPUTS -! hdferr - Returns 0 if successful and -1 if fails -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 7, 2001 -! SOURCE - SUBROUTINE h5tpack_f(type_id, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - - INTERFACE - INTEGER FUNCTION h5tpack_c(type_id) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TPACK_C'::h5tpack_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: type_id - END FUNCTION h5tpack_c - END INTERFACE - - hdferr = h5tpack_c(type_id) - END SUBROUTINE h5tpack_f - -! !$! -! !$!****s* H5T/h5tinsert_array_f -! !$! -! !$! NAME -! !$! h5tinsert_array_f -! !$! -! !$! PURPOSE -! !$! This function is not available on hdf5-1.4.* -! !$! -! !$! INPUTS -! !$! OUTPUTS -! !$! hdferr: - error code -! !$! Success: 0 -! !$! Failure: -1 -! !$! -! !$! AUTHOR -! !$! Elena Pourmal -! !$! August 12, 1999 -! !$! -! !$! HISTORY -! !$! Explicit Fortran interfaces were added for -! !$! called C functions (it is needed for Windows -! !$! port). March 7, 2001 -! !$! SOURCE -! SUBROUTINE h5tinsert_array_f(parent_id,name,offset, ndims, dims, member_id, hdferr, perm) -! IMPLICIT NONE -! INTEGER(HID_T), INTENT(IN) :: parent_id ! identifier of the parent compound datatype -! CHARACTER(LEN=*), INTENT(IN) :: name !Name of the new member -! INTEGER(SIZE_T), INTENT(IN) :: offset !Offset to start of new member -! !within compound datatype -! INTEGER, INTENT(IN) :: ndims !Dimensionality of new member. -! !Valid values are 0 (zero) through 4 (four) -! INTEGER(SIZE_T), DIMENSION(*), INTENT(IN) :: dims !Size of new member array -! INTEGER(HID_T), INTENT(IN) :: member_id ! identifier of the datatype of the new member -! INTEGER, INTENT(OUT) :: hdferr ! Error code -! !*****! -! INTEGER, DIMENSION(*), OPTIONAL, INTENT(IN) :: perm -! !Pointer to buffer to store -! !the permutation vector of the field -! INTEGER :: namelen, sizeofperm -! INTEGER, EXTERNAL :: h5tinsert_array_c, h5tinsert_array_c2 -! namelen = LEN(name) -! if (present(perm)) then -! hdferr = h5tinsert_array_c(parent_id, name, namelen, offset, ndims,dims, member_id, perm) -! else -! hdferr = h5tinsert_array_c2(parent_id, name, namelen, offset, ndims,dims, member_id) -! end if -! -! END SUBROUTINE h5tinsert_array_f - -! -!****s* H5T/h5tarray_create_f -! -! NAME -! h5tarray_create_f -! -! PURPOSE -! Creates an array datatype object. -! -! INPUTS -! base_id - datatype identifier for the array -! base datatype -! rank - rank of the array -! dims - array dimension sizes -! OUTPUTS -! type_id - array datatype identifier -! hdferr - Returns 0 if successful and -1 if fails -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 7, 2001 -! SOURCE - SUBROUTINE h5tarray_create_f(base_id, rank, dims, type_id, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: base_id ! identifier of array base datatype - INTEGER, INTENT(IN) :: rank ! Rank of the array - INTEGER(HSIZE_T), DIMENSION(*), INTENT(IN) :: dims !Sizes of each array dimension - INTEGER(HID_T), INTENT(OUT) :: type_id ! identifier of the array datatype - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTERFACE - INTEGER FUNCTION h5tarray_create_c(base_id, rank, dims, type_id) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TARRAY_CREATE_C'::h5tarray_create_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: base_id - INTEGER, INTENT(IN) :: rank - INTEGER(HSIZE_T), DIMENSION(*), INTENT(IN) :: dims - INTEGER(HID_T), INTENT(OUT) :: type_id - END FUNCTION h5tarray_create_c - END INTERFACE - - hdferr = h5tarray_create_c(base_id, rank, dims, type_id) - - END SUBROUTINE h5tarray_create_f - -! -!****s* H5T/h5tenum_create_f -! -! NAME -! h5tenum_create_f -! -! PURPOSE -! Creates a new enumeration datatype. -! -! INPUTS -! parent_id - datatype identifier for base datatype -! OUTPUTS -! new_type_id - datatype identifier for the enumeration datatype -! hdferr - Returns 0 if successful and -1 if fails -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 7, 2001 -! SOURCE - SUBROUTINE h5tenum_create_f(parent_id, new_type_id, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: parent_id ! Datatype identifier for - ! the base datatype - INTEGER(HID_T), INTENT(OUT) :: new_type_id - !datatype identifier for the - ! new enumeration datatype - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - - INTERFACE - INTEGER FUNCTION h5tenum_create_c(parent_id, new_type_id) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TENUM_CREATE_C'::h5tenum_create_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: parent_id - INTEGER(HID_T), INTENT(OUT) :: new_type_id - END FUNCTION h5tenum_create_c - END INTERFACE - - hdferr = h5tenum_create_c(parent_id, new_type_id) - END SUBROUTINE h5tenum_create_f -! -!****s* H5T/h5tenum_nameof_f -! -! NAME -! h5tenum_nameof_f -! -! PURPOSE -! Returns the symbol name corresponding to a specified -! member of an enumeration datatype. -! -! INPUTS -! type_id - datatype identifier -! value - value of the enumeration datatype -! namelen - name buffer size -! OUTPUTS -! name - buffer to hold symbol name -! hdferr - Returns 0 if successful and -1 if fails -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 7, 2001 -! -! NOTE -! According to the standard: Because an INTENT(OUT) variable is considered undefined -! on entry to the procedure, any default initialization specified for its type will -! be applied. So we need to blank out the "name" to be portable and eliminate any -! characters the "name' may contain upon entry, depending on compiler implementation. -! SOURCE - SUBROUTINE h5tenum_nameof_f(type_id, value, namelen, name, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier - CHARACTER(LEN=*), INTENT(OUT) :: name !Name of the enumeration datatype. - INTEGER(SIZE_T), INTENT(IN) :: namelen !length of the name - INTEGER, INTENT(IN) :: value !value of the enumeration datatype. - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - - INTERFACE - INTEGER FUNCTION h5tenum_nameof_c(type_id, value, name, namelen) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TENUM_NAMEOF_C'::h5tenum_nameof_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: name - INTEGER(HID_T), INTENT(IN) :: type_id - CHARACTER(LEN=*), INTENT(OUT) :: name - INTEGER(SIZE_T), INTENT(IN) :: namelen - INTEGER, INTENT(IN) :: value - END FUNCTION h5tenum_nameof_c - END INTERFACE - - name(1:LEN(name)) = ' ' - - hdferr = h5tenum_nameof_c(type_id, value, name, namelen) - END SUBROUTINE h5tenum_nameof_f - -! -!****s* H5T/h5tenum_valuof_f -! -! NAME -! h5tenum_valuof_f -! -! PURPOSE -! Returns the value corresponding to a specified -! member of an enumeration datatype. -! -! INPUTS -! type_id - datatype identifier -! name - symbol name -! OUTPUTS -! value - value of the enumeration datatype -! hdferr - Returns 0 if successful and -1 if fails -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 7, 2001 -! -! SOURCE - SUBROUTINE h5tenum_valueof_f(type_id, name, value, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier - CHARACTER(LEN=*), INTENT(IN) :: name !Name of the enumeration datatype. - INTEGER, INTENT(OUT) :: value !value of the enumeration datatype. - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTEGER :: namelen - - INTERFACE - INTEGER FUNCTION h5tenum_valueof_c(type_id, name, namelen, value) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TENUM_VALUEOF_C'::h5tenum_valueof_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: name - INTEGER(HID_T), INTENT(IN) :: type_id - CHARACTER(LEN=*), INTENT(IN) :: name - INTEGER, INTENT(IN) :: namelen - INTEGER, INTENT(OUT) :: value - END FUNCTION h5tenum_valueof_c - END INTERFACE - - namelen = LEN(name) - hdferr = h5tenum_valueof_c(type_id, name, namelen, value) - END SUBROUTINE h5tenum_valueof_f - -! -!****s* H5T/h5tget_member_value_f -! -! NAME -! h5tget_member_value_f -! -! PURPOSE -! Returns the value of an enumeration datatype member. -! -! INPUTS -! type_id - datatype identifier -! member_no - number of the enumeration datatype member -! OUTPUTS -! value - value of the enumeration datatype -! hdferr - Returns 0 if successful and -1 if fails -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 7, 2001 -! SOURCE - SUBROUTINE h5tget_member_value_f(type_id, member_no, value, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier - INTEGER, INTENT(IN) :: member_no !Number of the enumeration datatype member - INTEGER, INTENT(OUT) :: value !value of the enumeration datatype. - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - - INTERFACE - INTEGER FUNCTION h5tget_member_value_c(type_id, member_no, value) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TGET_MEMBER_VALUE_C'::h5tget_member_value_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: type_id - INTEGER, INTENT(IN) :: member_no - INTEGER, INTENT(OUT) :: value - END FUNCTION - END INTERFACE - - hdferr = h5tget_member_value_c(type_id, member_no, value) - END SUBROUTINE h5tget_member_value_f - -! -!****s* H5T/h5tset_tag_f -! -! NAME -! h5tset_tag_f -! -! PURPOSE -! Tags an opaque datatype. -! -! INPUTS -! type_id - identifier for opaque datatype -! tag - unique ASCII string with which the opaque -! datatype is to be tagged. -! OUTPUTS -! hdferr - Returns 0 if successful and -1 if fails -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 7, 2001 -! SOURCE - SUBROUTINE h5tset_tag_f(type_id, tag, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier - CHARACTER(LEN=*), INTENT(IN) :: tag !Unique ASCII string with which - !the opaque datatype is to be tagged - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTEGER :: taglen - - INTERFACE - INTEGER FUNCTION h5tset_tag_c(type_id, tag, taglen) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TSET_TAG_C'::h5tset_tag_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: tag - INTEGER(HID_T), INTENT(IN) :: type_id - CHARACTER(LEN=*), INTENT(IN) :: tag - INTEGER :: taglen - END FUNCTION h5tset_tag_c - END INTERFACE - - taglen = LEN(tag) - hdferr = h5tset_tag_c(type_id, tag, taglen) - END SUBROUTINE h5tset_tag_f - -! -!****s* H5T/h5tget_tag_f -! -! NAME -! h5tget_tag_f -! -! PURPOSE -! Gets the tag associated with an opaque datatype. -! -! INPUTS -! type_id - identifier for opaque datatype -! OUTPUTS -! tag - unique ASCII string associated with opaque -! datatype -! hdferr - Returns 0 if successful and -1 if fails -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 7, 2001 -! SOURCE - SUBROUTINE h5tget_tag_f(type_id, tag,taglen, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier - CHARACTER(LEN=*), INTENT(OUT) :: tag ! Unique ASCII string with which - ! the opaque datatype is to be tagged - INTEGER, INTENT(OUT) :: taglen ! Length of tag - INTEGER(SIZE_T) :: tag_size ! Declared character length of tab - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTERFACE - INTEGER FUNCTION h5tget_tag_c(type_id, tag, tag_size, taglen) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TGET_TAG_C'::h5tget_tag_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: tag - INTEGER(HID_T), INTENT(IN) :: type_id - CHARACTER(LEN=*), INTENT(OUT) :: tag - INTEGER(SIZE_T), INTENT(IN) :: tag_size - INTEGER, INTENT(OUT) :: taglen - END FUNCTION h5tget_tag_c - END INTERFACE - - tag_size = LEN(tag) - - hdferr = h5tget_tag_c(type_id, tag, tag_size, taglen ) - END SUBROUTINE h5tget_tag_f - -! -!****s* H5T/h5tvlen_create_f -! -! NAME -! h5tvlen_create_f -! -! PURPOSE -! Creates a new variable-length datatype. -! -! INPUTS -! type_id - identifier iof base datatype -! OUTPUTS -! vltype_id - identifier for VL datatype -! hdferr - Returns 0 if successful and -1 if fails -! -! AUTHOR -! Elena Pourmal -! Wednesday, October 23, 2002 -! -! NOTES -! Only basic Fortran base datatypes are supported -! -! SOURCE - SUBROUTINE h5tvlen_create_f(type_id, vltype_id, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier - INTEGER(HID_T), INTENT(OUT) :: vltype_id ! VL datatype identifier - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTERFACE - INTEGER FUNCTION h5tvlen_create_c(type_id, vltype_id) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TVLEN_CREATE_C'::h5tvlen_create_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: type_id - INTEGER(HID_T), INTENT(OUT) :: vltype_id - END FUNCTION h5tvlen_create_c - END INTERFACE - - hdferr = h5tvlen_create_c(type_id, vltype_id) - END SUBROUTINE h5tvlen_create_f - -! -!****s* H5T/h5tis_variable_str_f -! -! NAME -! h5tis_variable_str_f -! -! PURPOSE -! Determines whether a dattype is a variable string. -! -! INPUTS -! type_id - datartpe identifier -! OUTPUTS -! status - flag to indicate if datatype -! is a variable string -! hdferr - Returns 0 if successful and -1 if fails -! -! AUTHOR -! Elena Pourmal -! March 12, 2003 -! -! SOURCE - SUBROUTINE h5tis_variable_str_f(type_id, status, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier - LOGICAL, INTENT(OUT) :: status ! Flag, idicates if datatype - ! is a variable string or not ( TRUE or - ! FALSE) - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTEGER :: flag ! "TRUE/FALSE/ERROR from C" - - INTERFACE - INTEGER FUNCTION h5tis_variable_str_c(type_id, flag) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TIS_VARIABLE_STR_C'::h5tis_variable_str_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: type_id - INTEGER :: flag - END FUNCTION h5tis_variable_str_c - END INTERFACE - - hdferr = h5tis_variable_str_c(type_id, flag) - status = .TRUE. - if (flag .EQ. 0) status = .FALSE. - - END SUBROUTINE h5tis_variable_str_f - -! -!****s* H5T/h5tget_member_class_f -! -! NAME -! h5tget_member_class_f -! -! PURPOSE -! Returns datatype class of compound datatype member. -! -! INPUTS -! type_id - datartpe identifier -! member_no - index of compound datatype member -! OUTPUTS -! class - class type for compound dadtype member -! Valid classes: -! H5T_NO_CLASS_F (error) -! H5T_INTEGER_F -! H5T_FLOAT_F -! H5T_TIME_F -! H5T_STRING_F -! H5T_BITFIELD_F -! H5T_OPAQUE_F -! H5T_COMPOUND_F -! H5T_REFERENCE_F -! H5T_ENUM_F -! H5T_VLEN_F -! H5T_ARRAY_F -! hdferr - Returns 0 if successful and -1 if fails -! -! AUTHOR -! Elena Pourmal -! April 6, 2005 -! -! SOURCE - SUBROUTINE h5tget_member_class_f(type_id, member_no, class, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier - INTEGER, INTENT(IN) :: member_no ! Member number - INTEGER, INTENT(OUT) :: class ! Member class - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTERFACE - INTEGER FUNCTION h5tget_member_class_c(type_id, member_no, class) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TGET_MEMBER_CLASS_C'::h5tget_member_class_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: type_id - INTEGER, INTENT(IN) :: member_no - INTEGER, INTENT(OUT) :: class - END FUNCTION h5tget_member_class_c - END INTERFACE - - hdferr = h5tget_member_class_c(type_id, member_no, class) - - END SUBROUTINE h5tget_member_class_f - -! -!****s* H5T/h5tcommit_anon_f -! -! NAME -! h5tcommit_anon_f -! -! PURPOSE -! Commits a transient datatype to a file, -! creating a new named datatype, -! but does not link it into the file structure. -! -! INPUTS -! loc_id - A file or group identifier specifying the file -! in which the new named datatype is to be created. -! dtype_id - A datatype identifier. -! -! OUTPUTS -! hdferr - Returns 0 if successful and -1 if fails -! OPTIONAL PARAMETERS -! tcpl_id - A datatype creation property list identifier. -! (H5P_DEFAULT_F for the default property list.) -! tapl_id - A datatype access property list identifier. -! should always be passed as the value H5P_DEFAULT_F. -! -! AUTHOR -! M. Scot Breitenfeld -! February 25, 2008 -! -! SOURCE - SUBROUTINE h5tcommit_anon_f(loc_id, dtype_id, hdferr, tcpl_id, tapl_id) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id ! A file or group identifier specifying - ! the file in which the new named datatype - ! is to be created. - INTEGER(HID_T), INTENT(IN) :: dtype_id ! Datatype identifier - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: tcpl_id ! A datatype creation property - ! list identifier. - ! (H5P_DEFAULT_F for the default property list.) - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: tapl_id ! A datatype access property list identifier. - ! should always be passed as the value H5P_DEFAULT_F. -!***** - INTEGER(HID_T) :: tcpl_id_default - INTEGER(HID_T) :: tapl_id_default - - INTERFACE - INTEGER FUNCTION h5tcommit_anon_c(loc_id, dtype_id, & - tcpl_id_default, tapl_id_default) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TCOMMIT_ANON_C'::h5tcommit_anon_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: loc_id - INTEGER(HID_T), INTENT(IN) :: dtype_id - INTEGER(HID_T) :: tcpl_id_default - INTEGER(HID_T) :: tapl_id_default - END FUNCTION h5tcommit_anon_c - END INTERFACE - - tcpl_id_default = H5P_DEFAULT_F - tapl_id_default = H5P_DEFAULT_F - - IF(PRESENT(tcpl_id)) tcpl_id_default = tcpl_id - IF(PRESENT(tapl_id)) tapl_id_default = tapl_id - - hdferr = h5tcommit_anon_c(loc_id, dtype_id, & - tcpl_id_default, tapl_id_default ) - - END SUBROUTINE h5tcommit_anon_f - -! -!****s* H5T/h5tcommitted_f -! -! NAME -! h5tcommitted_f -! -! PURPOSE -! Determines whether a datatype is a named type or a transient type. -! -! INPUTS -! dtype_id - A datatype identifier. -! -! OUTPUTS -! committed - .TRUE., if the datatype has been committed -! .FALSE., if the datatype has not been committed. -! hdferr - Returns 0 if successful and -1 if fails -! AUTHOR -! M. Scot Breitenfeld -! February 25, 2008 -! -! SOURCE - SUBROUTINE h5tcommitted_f(dtype_id, committed, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dtype_id ! A datatype identifier - LOGICAL, INTENT(OUT) :: committed ! .TRUE., if the datatype has been committed - !.FALSE., if the datatype has not been committed. - INTEGER, INTENT(OUT) :: hdferr ! Error code: -! Success: 0 -! Failure: -1 -!***** - INTERFACE - INTEGER FUNCTION h5tcommitted_c(dtype_id) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TCOMMITTED_C'::h5tcommitted_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: dtype_id - END FUNCTION h5tcommitted_c - END INTERFACE - - hdferr = h5tcommitted_c(dtype_id) - - IF(hdferr.GT.0)THEN - committed = .TRUE. - hdferr = 0 - ELSE IF(hdferr.EQ.0)THEN - committed = .FALSE. - hdferr = 0 - ELSE - hdferr = -1 - ENDIF - - - END SUBROUTINE h5tcommitted_f - -! -!****s* H5T/H5Tdecode_f -! -! NAME -! H5Tdecode_f -! -! PURPOSE -! Decode a binary object description of data type and return a new object handle. -! INPUTS -! buf - Buffer for the data space object to be decoded. -! obj_id - Object ID -! OUTPUTS -! hdferr - Returns 0 if successful and -1 if fails -! -! AUTHOR -! M. Scot Breitenfeld -! April 9, 2008 -! -! SOURCE - SUBROUTINE h5tdecode_f(buf, obj_id, hdferr) - IMPLICIT NONE - CHARACTER(LEN=*), INTENT(IN) :: buf ! Buffer for the data space object to be decoded. - INTEGER(HID_T), INTENT(OUT) :: obj_id ! Object ID - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTERFACE - INTEGER FUNCTION h5tdecode_c(buf, obj_id) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TDECODE_C'::h5tdecode_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: buf - CHARACTER(LEN=*), INTENT(IN) :: buf - INTEGER(HID_T), INTENT(OUT) :: obj_id ! Object ID - END FUNCTION h5tdecode_c - END INTERFACE - - hdferr = h5tdecode_c(buf, obj_id) - - END SUBROUTINE h5tdecode_f - -! -!****s* H5T/H5Tencode_f -! -! NAME -! H5Tencode_f -! -! PURPOSE -! Encode a data type object description into a binary buffer. -! -! INPUTS -! obj_id - Identifier of the object to be encoded. -! buf - Buffer for the object to be encoded into. -! nalloc - The size of the allocated buffer. -! OUTPUTS -! nalloc - The size of the buffer needed. -! hdferr - Returns 0 if successful and -1 if fails. -! -! AUTHOR -! M. Scot Breitenfeld -! April 9, 2008 -! SOURCE - SUBROUTINE h5tencode_f(obj_id, buf, nalloc, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: obj_id ! Identifier of the object to be encoded. - CHARACTER(LEN=*), INTENT(OUT) :: buf ! Buffer for the object to be encoded into. - INTEGER(SIZE_T), INTENT(INOUT) :: nalloc ! The size of the allocated buffer. - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - - INTERFACE - INTEGER FUNCTION h5tencode_c(buf, obj_id, nalloc) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TENCODE_C'::h5tencode_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: buf - INTEGER(HID_T), INTENT(IN) :: obj_id - CHARACTER(LEN=*), INTENT(OUT) :: buf - INTEGER(SIZE_T), INTENT(INOUT) :: nalloc - END FUNCTION h5tencode_c - END INTERFACE - - hdferr = h5tencode_c(buf, obj_id, nalloc) - - END SUBROUTINE h5tencode_f - -! -!****s* H5T/h5tget_create_plist_f -! -! NAME -! h5tget_create_plist_f -! -! PURPOSE -! Returns a copy of a datatype creation property list. -! -! INPUTS -! dtype_id - Datatype identifier -! OUTPUTS -! dtpl_id - Datatype property list identifier -! hdferr - Returns 0 if successful and -1 if fails -! -! AUTHOR -! M. Scot Breitenfeld -! April 9, 2008 -! -! SOURCE - SUBROUTINE h5tget_create_plist_f(dtype_id, dtpl_id, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dtype_id ! Datatype identifier - INTEGER(HID_T), INTENT(OUT) :: dtpl_id ! Datatype property list identifier. - INTEGER, INTENT(OUT) :: hdferr ! Error code: - ! 0 on success and -1 on failure -!***** - INTERFACE - INTEGER FUNCTION h5tget_create_plist_c(dtype_id, dtpl_id) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TGET_CREATE_PLIST_C'::h5tget_create_plist_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: dtype_id - INTEGER(HID_T), INTENT(OUT) :: dtpl_id - END FUNCTION h5tget_create_plist_c - END INTERFACE - - hdferr = h5tget_create_plist_c(dtype_id, dtpl_id) - END SUBROUTINE h5tget_create_plist_f - -! -!****s* H5T/h5tcompiler_conv_f -! -! NAME -! h5tcompiler_conv_f -! -! PURPOSE -! Check whether the library’s default conversion is hard conversion.R -! -! INPUTS -! src_id - Identifier for the source datatype. -! dst_id - Identifier for the destination datatype. -! OUTPUTS -! flag - TRUE for compiler conversion, FALSE for library conversion -! hdferr - Returns 0 if successful and -1 if fails -! -! AUTHOR -! M. Scot Breitenfeld -! April 9, 2008 -! SOURCE - SUBROUTINE h5tcompiler_conv_f( src_id, dst_id, flag, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: src_id ! Identifier for the source datatype. - INTEGER(HID_T), INTENT(IN) :: dst_id ! Identifier for the destination datatype. - LOGICAL, INTENT(OUT) :: flag ! .TRUE. for compiler conversion, .FALSE. for library conversion - INTEGER, INTENT(OUT) :: hdferr ! Error code: - ! 0 on success and -1 on failure -!***** - INTEGER :: c_flag - - INTERFACE - INTEGER FUNCTION h5tcompiler_conv_c(src_id, dst_id, c_flag) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TCOMPILER_CONV_C'::h5tcompiler_conv_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: src_id - INTEGER(HID_T), INTENT(IN) :: dst_id - INTEGER :: c_flag - END FUNCTION h5tcompiler_conv_c - END INTERFACE - - hdferr = h5tcompiler_conv_c(src_id, dst_id, c_flag) - - flag = .FALSE. - IF(c_flag .GT. 0) flag = .TRUE. - - END SUBROUTINE h5tcompiler_conv_f - -! -!****s* H5T/h5tget_native_type_f -! -! NAME -! h5tget_native_type_f -! -! PURPOSE -! Returns the native datatype of a specified datatype. -! -! INPUTS -! dtype_id - Datatype identifier for the dataset datatype. -! -! direction - Direction of search: -! H5T_DIR_DEFAULT = 0, /*default direction is inscendent */ -! H5T_DIR_ASCEND = 1, /*in inscendent order */ -! H5T_DIR_DESCEND = 2 /*in descendent order */ -! * NOTE: In C it is defined as a structure: H5T_direction_t -! -! OUTPUTS -! native_dtype_id - The native datatype identifier for the specified dataset datatype -! hdferr - Returns 0 if successful and -1 if fails -! AUTHOR -! M. Scot Breitenfeld -! June 18, 2008 -! SOURCE - SUBROUTINE h5tget_native_type_f(dtype_id, direction, native_dtype_id, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dtype_id ! Datatype identifier - INTEGER, INTENT(IN) :: direction ! Direction of search: - ! H5T_DIR_ASCEND_F = 1 in inscendent order - ! H5T_DIR_DESCEND_F = 2 in descendent order - INTEGER(HID_T), INTENT(OUT) :: native_dtype_id ! The native datatype identifier - INTEGER, INTENT(OUT) :: hdferr ! Error code: - ! 0 on success and -1 on failure -!***** - INTERFACE - INTEGER FUNCTION h5tget_native_type_c(dtype_id, direction, native_dtype_id) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TGET_NATIVE_TYPE_C'::h5tget_native_type_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: dtype_id - INTEGER, INTENT(IN) :: direction - INTEGER(HID_T), INTENT(OUT) :: native_dtype_id - END FUNCTION h5tget_native_type_c - END INTERFACE - - hdferr = h5tget_native_type_c(dtype_id, direction, native_dtype_id) - END SUBROUTINE h5tget_native_type_f - -END MODULE H5T diff --git a/fortran/src/H5Tff_F03.f90 b/fortran/src/H5Tff_F03.f90 deleted file mode 100644 index 2c9f212..0000000 --- a/fortran/src/H5Tff_F03.f90 +++ /dev/null @@ -1,223 +0,0 @@ -!****h* ROBODoc/H5T (F03) -! -! NAME -! H5T_PROVISIONAL -! -! PURPOSE -! This file contains Fortran 90 and Fortran 2003 interfaces for H5T functions. -! It contains the same functions as H5Tff_F90.f90 but includes the -! Fortran 2003 functions and the interface listings. This file will be compiled -! instead of H5Tff_F90.f90 if Fortran 2003 functions are enabled. -! -! 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. * -! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -! -! NOTES -! *** IMPORTANT *** -! If you add a new H5T function you must add the function name to the -! Windows dll file 'hdf5_fortrandll.def.in' in the fortran/src directory. -! This is needed for Windows based operating systems. -! -!***** - -MODULE H5T_PROVISIONAL - - USE H5GLOBAL - USE, INTRINSIC :: ISO_C_BINDING - -!****t* H5T (F03)/hvl_t -! Fortran2003 Derived Type: - TYPE hvl_t - INTEGER(size_t) :: len ! Length of VL data (in base type units) - TYPE(C_PTR) :: p ! Pointer to VL data - END TYPE hvl_t - -!***** - - INTERFACE h5tenum_insert_f - MODULE PROCEDURE h5tenum_insert_f03 - MODULE PROCEDURE h5tenum_insert_f90 - END INTERFACE - -CONTAINS - -!****s* H5T (F03)/H5Tconvert_f_F03 -! -! NAME -! H5Tconvert_f -! -! PURPOSE -! Converts data from between specified datatypes. -! -! Inputs: -! src_id - Identifier for the source datatype. -! dst_id - Identifier for the destination datatype. -! nelmts - Size of array buf. -! buf - Array containing pre-conversion values. -! background - Optional background buffer. -! plist_id - Dataset transfer property list identifier. -! -! Outputs: -! buf - Array containing post-conversion values. -! hdferr - error code: -! 0 on success and -1 on failure -! AUTHOR -! M. Scot Breitenfeld -! Decemember 8, 2008 -! -! Fortran2003 Interface: - SUBROUTINE h5tconvert_f(src_id, dst_id, nelmts, buf, hdferr, background, plist_id) - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - INTEGER(HID_T) , INTENT(IN) :: src_id - INTEGER(HID_T) , INTENT(IN) :: dst_id - INTEGER(SIZE_T), INTENT(IN) :: nelmts - TYPE(C_PTR) , INTENT(INOUT) :: buf - INTEGER , INTENT(OUT) :: hdferr - TYPE(C_PTR) , INTENT(INOUT), OPTIONAL :: background - INTEGER(HID_T) , INTENT(IN) , OPTIONAL :: plist_id -!***** - INTEGER(HID_T) :: plist_id_default - TYPE(C_PTR) :: background_default - - INTERFACE - INTEGER FUNCTION h5tconvert_c(src_id, dst_id, nelmts, buf, background, plist_id) & - BIND(C, NAME='h5tconvert_c') - USE, INTRINSIC :: ISO_C_BINDING, ONLY : c_ptr - USE H5GLOBAL - IMPLICIT NONE - INTEGER(HID_T) , INTENT(IN) :: src_id - INTEGER(HID_T) , INTENT(IN) :: dst_id - INTEGER(SIZE_T), INTENT(IN) :: nelmts - TYPE(C_PTR) , VALUE :: buf - TYPE(C_PTR) , VALUE :: background - INTEGER(HID_T) , INTENT(IN) :: plist_id - END FUNCTION h5tconvert_c - END INTERFACE - - plist_id_default = H5P_DEFAULT_F - IF(PRESENT(plist_id)) plist_id_default = plist_id - - background_default = C_NULL_PTR - IF(PRESENT(background)) background_default = background - - hdferr = H5Tconvert_c(src_id, dst_id, nelmts, buf, background_default, plist_id_default) - - END SUBROUTINE h5tconvert_f -! -!****s* (F03) H5T/h5tenum_insert_f90 -! -! NAME -! h5tenum_insert_f -! -! PURPOSE -! Inserts a new enumeration datatype member. -! -! INPUTS -! type_id - Datatype identifier for the enumeration datatype. -! name - Datatype identifier. -! value - Value of the new member. -! OUTPUTS -! hdferr - Returns 0 if successful and -1 if fails -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 7, 2001 -! SOURCE - SUBROUTINE h5tenum_insert_f90(type_id, name, value, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier - CHARACTER(LEN=*), INTENT(IN) :: name !Name of the new member - INTEGER, INTENT(IN) :: value ! value of the new member - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTEGER :: namelen - INTERFACE - INTEGER FUNCTION h5tenum_insert_c(type_id, name, namelen, value) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TENUM_INSERT_C'::h5tenum_insert_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: name - INTEGER(HID_T), INTENT(IN) :: type_id - CHARACTER(LEN=*), INTENT(IN) :: name - INTEGER, INTENT(IN) :: value - INTEGER :: namelen - END FUNCTION h5tenum_insert_c - END INTERFACE - - namelen = LEN(name) - hdferr = h5tenum_insert_c(type_id, name, namelen, value) - END SUBROUTINE h5tenum_insert_f90 - -! -!****s* (F03) H5T/h5tenum_insert_f03 -! -! NAME -! h5tenum_insert_f -! -! PURPOSE -! Inserts a new enumeration datatype member. -! -! INPUTS -! type_id - Datatype identifier for the enumeration datatype. -! name - Datatype identifier. -! value - Pointer to the value of the new member. -! OUTPUTS -! hdferr - Returns 0 if successful and -1 if fails -! -! AUTHOR -! M. Scot Breitenfeld -! February 6, 2015 -! -! HISTORY -! F2003 implementation of function -! SOURCE - SUBROUTINE h5tenum_insert_f03(type_id, name, value, hdferr) - USE, INTRINSIC :: ISO_C_BINDING, ONLY : c_ptr, c_char - USE H5GLOBAL - IMPLICIT NONE - INTEGER(HID_T) , INTENT(IN) :: type_id - CHARACTER(LEN=*), INTENT(IN) :: name - TYPE(C_PTR) , INTENT(IN) :: value - INTEGER, INTENT(OUT) :: hdferr -!***** - INTEGER :: namelen - - INTERFACE - INTEGER FUNCTION h5tenum_insert_ptr_c(type_id, name, namelen, value) & - BIND(C, NAME='h5tenum_insert_ptr_c') - USE, INTRINSIC :: ISO_C_BINDING, ONLY : c_ptr, c_char - USE H5GLOBAL - IMPLICIT NONE - INTEGER(HID_T) , INTENT(IN) :: type_id - CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: name - INTEGER :: namelen - TYPE(C_PTR), VALUE :: value - END FUNCTION h5tenum_insert_ptr_c - END INTERFACE - - namelen = LEN(name) - hdferr = h5tenum_insert_ptr_c(type_id, name, namelen, value) - END SUBROUTINE h5tenum_insert_f03 - -END MODULE H5T_PROVISIONAL - diff --git a/fortran/src/H5Tff_F90.f90 b/fortran/src/H5Tff_F90.f90 deleted file mode 100644 index 380fbec..0000000 --- a/fortran/src/H5Tff_F90.f90 +++ /dev/null @@ -1,95 +0,0 @@ -!****h* ROBODoc/H5T (F90) -! -! NAME -! MODULE H5T_PROVISIONAL -! -! PURPOSE -! This file contains Fortran 90 interfaces for H5T functions. It contains -! the same functions as H5Tff_F03.f90 but excludes the Fortran 2003 functions -! and the interface listings. This file will be compiled instead of H5Tff_F03.f90 -! if Fortran 2003 functions are not enabled. -! -! NOTE -! Currently contains no functions. -! -! 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. * -! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -! -! *** IMPORTANT *** -! If you add a new H5D function you must add the function name to the -! Windows dll file 'hdf5_fortrandll.def.in' in the fortran/src directory. -! This is needed for Windows based operating systems. -!***** - -MODULE H5T_PROVISIONAL - - USE H5GLOBAL - -CONTAINS - -! -!****s* H5T/h5tenum_insert_f -! -! NAME -! h5tenum_insert_f -! -! PURPOSE -! Inserts a new enumeration datatype member. -! -! INPUTS -! type_id - Datatype identifier for the enumeration datatype. -! name - Datatype identifier. -! value - Value of the new member. -! OUTPUTS -! hdferr - Returns 0 if successful and -1 if fails -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 7, 2001 -! SOURCE - SUBROUTINE h5tenum_insert_f(type_id, name, value, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: type_id - CHARACTER(LEN=*), INTENT(IN) :: name - INTEGER, INTENT(IN) :: value - INTEGER, INTENT(OUT) :: hdferr -!***** - INTEGER :: namelen - - INTERFACE - INTEGER FUNCTION h5tenum_insert_c(type_id, name, namelen, value) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TENUM_INSERT_C'::h5tenum_insert_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: name - INTEGER(HID_T), INTENT(IN) :: type_id - CHARACTER(LEN=*), INTENT(IN) :: name - INTEGER, INTENT(IN) :: value - INTEGER :: namelen - END FUNCTION h5tenum_insert_c - END INTERFACE - - namelen = LEN(name) - hdferr = h5tenum_insert_c(type_id, name, namelen, value) - END SUBROUTINE h5tenum_insert_f - -END MODULE H5T_PROVISIONAL diff --git a/fortran/src/H5Zf.c b/fortran/src/H5Zf.c index 169e018..a8cf1c2 100644 --- a/fortran/src/H5Zf.c +++ b/fortran/src/H5Zf.c @@ -1,6 +1,6 @@ /****h* H5Zf/H5Zf * PURPOSE - * This file contains C stubs for H5Z Fortran APIs + * This file contains C stubs for H5Z Fortran APIs * * COPYRIGHT * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * @@ -25,22 +25,22 @@ /****if* H5Zf/h5zunregister_c * NAME - * h5zunregister_c + * h5zunregister_c * PURPOSE - * Call H5Zunregister to unregister filter + * Call H5Zunregister to unregister filter * INPUTS - * filter identifier + * filter identifier * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * Wednesday, March 12, 2003 + * Wednesday, March 12, 2003 * HISTORY * * SOURCE */ int_f -nh5zunregister_c (int_f *filter) +h5zunregister_c (int_f *filter) /******/ { int ret_value = -1; @@ -58,25 +58,25 @@ nh5zunregister_c (int_f *filter) } /****if* H5Zf/h5zfiletr_avail_c * NAME - * h5zfiletr_avail_c + * h5zfiletr_avail_c * PURPOSE - * Call H5Zfilter_avail to find if filter is available + * Call H5Zfilter_avail to find if filter is available * INPUTS - * filter - filter identifier + * filter - filter identifier * OUTPUTS - * flag - status flag + * flag - status flag * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Elena Pourmal - * Wednesday, March 12, 2003 + * Wednesday, March 12, 2003 * HISTORY * * SOURCE */ int_f -nh5zfilter_avail_c ( int_f *filter , int_f *flag ) +h5zfilter_avail_c ( int_f *filter , int_f *flag ) /******/ { int ret_value = 0; @@ -92,26 +92,26 @@ nh5zfilter_avail_c ( int_f *filter , int_f *flag ) /****if* H5Zf/h5zget_filter_info_c * NAME - * h5zget_filter_info_c + * h5zget_filter_info_c * PURPOSE - * Call H5Zget_filter_info to find if filter has its encoder - * and/or its decoder available + * Call H5Zget_filter_info to find if filter has its encoder + * and/or its decoder available * INPUTS - * filter - filter identifier + * filter - filter identifier * OUTPUTS - * flag - status flag + * flag - status flag * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Nat Furrer and James Laird - * Wednesday, June 16, 2004 + * Wednesday, June 16, 2004 * HISTORY * * SOURCE */ int_f -nh5zget_filter_info_c ( int_f *filter , int_f *flag ) +h5zget_filter_info_c ( int_f *filter , int_f *flag ) /******/ { int ret_value = 0; diff --git a/fortran/src/H5Zff.F90 b/fortran/src/H5Zff.F90 new file mode 100644 index 0000000..0259959 --- /dev/null +++ b/fortran/src/H5Zff.F90 @@ -0,0 +1,189 @@ +!****h* ROBODoc/H5Z +! +! NAME +! MODULE H5Z +! +! PURPOSE +! This file contains Fortran interfaces for H5Z functions. +! +! 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. * +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! +! NOTES! +! _____ __ __ _____ ____ _____ _______ _ _ _______ +! |_ _| \/ | __ \ / __ \| __ \__ __|/\ | \ | |__ __| +! **** | | | \ / | |__) | | | | |__) | | | / \ | \| | | | **** +! **** | | | |\/| | ___/| | | | _ / | | / /\ \ | . ` | | | **** +! **** _| |_| | | | | | |__| | | \ \ | |/ ____ \| |\ | | | **** +! |_____|_| |_|_| \____/|_| \_\ |_/_/ \_\_| \_| |_| +! +! If you add a new H5Z function you must add the function name to the +! Windows dll file 'hdf5_fortrandll.def.in' in the fortran/src directory. +! This is needed for Windows based operating systems. +! +!***** + +MODULE H5Z + + USE H5GLOBAL + +CONTAINS + +!****s* H5Z/h5zunregister_f +! +! NAME +! h5zunregister_f +! +! PURPOSE +! Unregisters specified filetr +! +! INPUTS +! filter - Filter; may have one of the following values: +! H5Z_FILTER_DEFLATE_F +! H5Z_FILTER_SZIP_F +! H5Z_FILTER_NBIT_F +! H5Z_FILTER_SCALEOFFSET_F +! H5Z_FILTER_SHUFFLE_F +! H5Z_FILTER_FLETCHER32_F +! +! OUTPUTS +! hdferr - Error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! March 12, 2003 +! +! SOURCE + SUBROUTINE h5zunregister_f(filter, hdferr) + IMPLICIT NONE + INTEGER, INTENT(IN) :: filter + INTEGER, INTENT(OUT) :: hdferr +!***** + INTERFACE + INTEGER FUNCTION h5zunregister_c(filter) BIND(C,NAME='h5zunregister_c') + INTEGER, INTENT(IN) :: filter + END FUNCTION h5zunregister_c + END INTERFACE + hdferr = h5zunregister_c(filter) + END SUBROUTINE h5zunregister_f + +!****s* H5Z/h5zfilter_avail_f +! NAME +! h5zfilter_avail_f +! +! PURPOSE +! Queries if filter is available +! +! INPUTS +! filter - Filter; may be one of the following: +! H5Z_FILTER_DEFLATE_F +! H5Z_FILTER_SZIP_F +! H5Z_FILTER_NBIT_F +! H5Z_FILTER_SCALEOFFSET_F +! H5Z_FILTER_SHUFFLE_F +! H5Z_FILTER_FLETCHER32_F +! OUTPUTS +! status - Flag; .TRUE. if filter is available, +! .FALSE. otherwise +! hdferr: - Error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! March 12, 2003 +! +! SOURCE + SUBROUTINE h5zfilter_avail_f(filter, status, hdferr) + IMPLICIT NONE + INTEGER, INTENT(IN) :: filter + LOGICAL, INTENT(OUT) :: status + INTEGER, INTENT(OUT) :: hdferr +!***** + INTEGER :: flag ! "TRUE/FALSE/ERROR from C" + + INTERFACE + INTEGER FUNCTION h5zfilter_avail_c(filter, flag) BIND(C,NAME='h5zfilter_avail_c') + IMPLICIT NONE + INTEGER, INTENT(IN) :: filter + INTEGER :: flag + END FUNCTION h5zfilter_avail_c + END INTERFACE + + hdferr = h5zfilter_avail_c(filter, flag) + status = .TRUE. + IF (flag .EQ. 0) status = .FALSE. + + END SUBROUTINE h5zfilter_avail_f + +!****s* H5Z/h5zget_filter_info_f +! +! NAME +! h5zget_filter_info_f +! +! PURPOSE +! Queries if filter has its encoder and/or decoder +! available +! +! INPUTS +! filter - Filter; may be one of the following: +! H5Z_FILTER_DEFLATE_F +! H5Z_FILTER_SZIP_F +! H5Z_FILTER_NBIT_F +! H5Z_FILTER_SCALEOFFSET_F +! H5Z_FILTER_SHUFFLE_F +! H5Z_FILTER_FLETCHER32_Ffilter +! OUTPUTS +! config_flags - Flag, indicates if filter has its encoder +! and/or decoder available, possibly containing the +! following values: +! H5Z_FILTER_ENCODE_ENABLED_F +! H5Z_FILTER_DECODE_ENABLED_F +! hdferr: - Error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Nat Furrer and James Laird +! June 16, 2004 +! SOURCE + SUBROUTINE h5zget_filter_info_f(filter, config_flags, hdferr) + IMPLICIT NONE + INTEGER, INTENT(IN) :: filter + INTEGER, INTENT(OUT) :: config_flags + INTEGER, INTENT(OUT) :: hdferr +!***** + + INTERFACE + INTEGER FUNCTION h5zget_filter_info_c(filter, config_flags) BIND(C,NAME='h5zget_filter_info_c') + IMPLICIT NONE + INTEGER, INTENT(IN) :: filter + INTEGER, INTENT(OUT) :: config_flags + END FUNCTION h5zget_filter_info_c + END INTERFACE + + hdferr = h5zget_filter_info_c(filter, config_flags) + + END SUBROUTINE h5zget_filter_info_f + +END MODULE H5Z + + + + + diff --git a/fortran/src/H5Zff.f90 b/fortran/src/H5Zff.f90 deleted file mode 100644 index 7b67b5b..0000000 --- a/fortran/src/H5Zff.f90 +++ /dev/null @@ -1,198 +0,0 @@ -!****h* ROBODoc/H5Z -! -! NAME -! MODULE H5Z -! -! PURPOSE -! This file contains Fortran interfaces for H5Z functions. It includes -! all the functions that are independent on whether the Fortran 2003 functions -! are enabled or disabled. -! -! -! 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. * -! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -! -! NOTES -! *** IMPORTANT *** -! If you add a new H5Z function you must add the function name to the -! Windows dll file 'hdf5_fortrandll.def.in' in the fortran/src directory. -! This is needed for Windows based operating systems. -! -!***** - -MODULE H5Z - - USE H5GLOBAL - -CONTAINS - -!****s* H5Z/h5zunregister_f -! -! NAME -! h5zunregister_f -! -! PURPOSE -! Unregisters specified filetr -! -! INPUTS -! filter - filter; may have one of the following values: -! H5Z_FILTER_DEFLATE_F -! H5Z_FILTER_SZIP_F -! H5Z_FILTER_NBIT_F -! H5Z_FILTER_SCALEOFFSET_F -! H5Z_FILTER_SHUFFLE_F -! H5Z_FILTER_FLETCHER32_F -! -! OUTPUTS -! hdferr - error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! Elena Pourmal -! March 12, 2003 -! -! SOURCE - SUBROUTINE h5zunregister_f(filter, hdferr) - IMPLICIT NONE - INTEGER, INTENT(IN) :: filter - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTERFACE - INTEGER FUNCTION h5zunregister_c (filter) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5ZUNREGISTER_C':: h5zunregister_c - !DEC$ENDIF - INTEGER, INTENT(IN) :: filter - END FUNCTION h5zunregister_c - END INTERFACE - hdferr = h5zunregister_c (filter) - END SUBROUTINE h5zunregister_f - -!****s* H5Z/h5zfilter_avail_f -! NAME -! h5zfilter_avail_f -! -! PURPOSE -! Queries if filter is available -! -! INPUTS -! filter - filter -! OUTPUTS -! status - status; .TRUE. if filter is available, -! .FALSE. otherwise -! hdferr: - error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! Elena Pourmal -! March 12, 2003 -! -! SOURCE - SUBROUTINE h5zfilter_avail_f(filter, status, hdferr) - IMPLICIT NONE - INTEGER, INTENT(IN) :: filter ! Filter; may be one of the following: - ! H5Z_FILTER_DEFLATE_F - ! H5Z_FILTER_SZIP_F - ! H5Z_FILTER_NBIT_F - ! H5Z_FILTER_SCALEOFFSET_F - ! H5Z_FILTER_SHUFFLE_F - ! H5Z_FILTER_FLETCHER32_F - LOGICAL, INTENT(OUT) :: status ! Flag, idicates if filter - ! is availble not ( TRUE or - ! FALSE) - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTEGER :: flag ! "TRUE/FALSE/ERROR from C" - - INTERFACE - INTEGER FUNCTION h5zfilter_avail_c(filter, flag) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5ZFILTER_AVAIL_C'::h5zfilter_avail_c - !DEC$ENDIF - INTEGER, INTENT(IN) :: filter - INTEGER :: flag - END FUNCTION h5zfilter_avail_c - END INTERFACE - - hdferr = h5zfilter_avail_c(filter, flag) - status = .TRUE. - IF (flag .EQ. 0) status = .FALSE. - - END SUBROUTINE h5zfilter_avail_f -!****s* H5Z/h5zget_filter_info_f -! -! NAME -! h5zget_filter_info_f -! -! PURPOSE -! Queries if filter has its encoder and/or decoder -! available -! -! INPUTS -! filter - filter -! OUTPUTS -! config_flags - Bit vector possibly containing the -! following values: -! H5Z_FILTER_ENCODE_ENABLED_F -! H5Z_FILTER_DECODE_ENABLED_F -! hdferr: - error code -! Success: 0 -! Failure: -1 -! -! AUTHOR -! Nat Furrer and James Laird -! June 16, 2004 -! SOURCE - SUBROUTINE h5zget_filter_info_f(filter, config_flags, hdferr) - IMPLICIT NONE - INTEGER, INTENT(IN) :: filter ! Filter; may be one of the following: - ! H5Z_FILTER_DEFLATE_F - ! H5Z_FILTER_SZIP_F - ! H5Z_FILTER_NBIT_F - ! H5Z_FILTER_SCALEOFFSET_F - ! H5Z_FILTER_SHUFFLE_F - ! H5Z_FILTER_FLETCHER32_F - INTEGER, INTENT(OUT) :: config_flags! Flag, indicates if filter - ! has its encoder and/or decoder - ! available - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - - INTERFACE - INTEGER FUNCTION h5zget_filter_info_c(filter, config_flags) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5ZGET_FILTER_INFO_C'::h5zget_filter_info_c - !DEC$ENDIF - INTEGER, INTENT(IN) :: filter - INTEGER, INTENT(OUT) :: config_flags - END FUNCTION h5zget_filter_info_c - END INTERFACE - - hdferr = h5zget_filter_info_c(filter, config_flags) - - END SUBROUTINE h5zget_filter_info_f - -END MODULE H5Z - - - - - diff --git a/fortran/src/H5_DBLE_InterfaceExclude.f90 b/fortran/src/H5_DBLE_InterfaceExclude.f90 deleted file mode 100644 index 2a3e26f..0000000 --- a/fortran/src/H5_DBLE_InterfaceExclude.f90 +++ /dev/null @@ -1,39 +0,0 @@ -!****h* fortran/src/H5_DBLE_InterfaceExclude.f90 -! -! NAME -! H5_DBLE_INTERFACE -! -! FUNCTION -! This module is used for when the default REAL is of type DOUBLE PRECISION. -! We do not include the double precision interfaces if the defaut REAL is -! DOUBLE PRECISION since this would lead to a non-unique conflict with the -! generic interfaces declared as REAL and those declared as DOUBLE PRECISION. -! -! NOTES -! Empty module. -! -! 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 -! M. Scot Breitenfeld -! -!***** - -MODULE H5_DBLE_INTERFACE - - -END MODULE H5_DBLE_INTERFACE diff --git a/fortran/src/H5_DBLE_InterfaceInclude.f90 b/fortran/src/H5_DBLE_InterfaceInclude.f90 deleted file mode 100644 index 11e0a85..0000000 --- a/fortran/src/H5_DBLE_InterfaceInclude.f90 +++ /dev/null @@ -1,1859 +0,0 @@ -!****h* fortran/src/H5_DBLE_InterfaceInclude.f90 -! -! NAME -! H5_DBLE_INTERFACE -! -! FUNCTION -! This module is used for when the default REAL is not of the type DOUBLE PRECISION. -! We only do not include the double precision interfaces if the defaut REAL is -! DOUBLE PRECISION since this would lead to a non-unique conflict with the -! generic interfaces declared as REAL. Otherwise it is okay to include the interfaces. -! -! NOTES -! This module contains all the DOUBLE PRECISION interfaces and corresponding subroutines -! from the HDF function catagory H5A, H5D and H5P. -! -! 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 -! M. Scot Breitenfeld -! -!***** - -MODULE H5_DBLE_INTERFACE - - USE H5GLOBAL - - ! - ! ----- H5A ---- - ! - INTERFACE h5awrite_f - MODULE PROCEDURE h5awrite_double_scalar - MODULE PROCEDURE h5awrite_double_1 - MODULE PROCEDURE h5awrite_double_2 - MODULE PROCEDURE h5awrite_double_3 - MODULE PROCEDURE h5awrite_double_4 - MODULE PROCEDURE h5awrite_double_5 - MODULE PROCEDURE h5awrite_double_6 - MODULE PROCEDURE h5awrite_double_7 - END INTERFACE - - INTERFACE h5aread_f - MODULE PROCEDURE h5aread_double_scalar - MODULE PROCEDURE h5aread_double_1 - MODULE PROCEDURE h5aread_double_2 - MODULE PROCEDURE h5aread_double_3 - MODULE PROCEDURE h5aread_double_4 - MODULE PROCEDURE h5aread_double_5 - MODULE PROCEDURE h5aread_double_6 - MODULE PROCEDURE h5aread_double_7 - END INTERFACE - ! - ! ----- H5D ---- - ! - INTERFACE h5dwrite_f - MODULE PROCEDURE h5dwrite_double_scalar - MODULE PROCEDURE h5dwrite_double_1 - MODULE PROCEDURE h5dwrite_double_2 - MODULE PROCEDURE h5dwrite_double_3 - MODULE PROCEDURE h5dwrite_double_4 - MODULE PROCEDURE h5dwrite_double_5 - MODULE PROCEDURE h5dwrite_double_6 - MODULE PROCEDURE h5dwrite_double_7 - END INTERFACE - - INTERFACE h5dread_f - MODULE PROCEDURE h5dread_double_scalar - MODULE PROCEDURE h5dread_double_1 - MODULE PROCEDURE h5dread_double_2 - MODULE PROCEDURE h5dread_double_3 - MODULE PROCEDURE h5dread_double_4 - MODULE PROCEDURE h5dread_double_5 - MODULE PROCEDURE h5dread_double_6 - MODULE PROCEDURE h5dread_double_7 - END INTERFACE - - INTERFACE h5dfill_f - MODULE PROCEDURE h5dfill_double - END INTERFACE - - ! - ! ----- H5P ---- - ! - INTERFACE h5pset_fill_value_f - MODULE PROCEDURE h5pset_fill_value_double - END INTERFACE - - INTERFACE h5pget_fill_value_f - MODULE PROCEDURE h5pget_fill_value_double - END INTERFACE - - INTERFACE h5pset_f - MODULE PROCEDURE h5pset_double - END INTERFACE - - INTERFACE h5pget_f - MODULE PROCEDURE h5pget_double - END INTERFACE - - INTERFACE h5pregister_f - MODULE PROCEDURE h5pregister_double - END INTERFACE - - INTERFACE h5pinsert_f - MODULE PROCEDURE h5pinsert_double - END INTERFACE - -CONTAINS - - ! - ! ----- H5A ---- - ! - SUBROUTINE h5awrite_double_scalar(attr_id, memtype_id, buf, dims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - DOUBLE PRECISION, INTENT(IN) :: buf ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - - ! INTEGER, EXTERNAL :: h5awrite_double_s_c - ! MS FORTRAN needs explicit interface for C functions called here. - ! - INTERFACE - INTEGER FUNCTION h5awrite_double_s_c(attr_id, memtype_id, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AWRITE_DOUBLE_S_C'::h5awrite_double_s_c - !DEC$ENDIF - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - INTEGER(HID_T), INTENT(IN) :: attr_id - INTEGER(HID_T), INTENT(IN) :: memtype_id - DOUBLE PRECISION, INTENT(IN)::buf - END FUNCTION h5awrite_double_s_c - END INTERFACE - - hdferr = h5awrite_double_s_c(attr_id, memtype_id, buf, dims) - END SUBROUTINE h5awrite_double_scalar - - SUBROUTINE h5awrite_double_1(attr_id, memtype_id, buf, dims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - DOUBLE PRECISION, INTENT(IN), & - DIMENSION(dims(1)) :: buf ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - - ! INTEGER, EXTERNAL :: h5awrite_double_1_c - ! MS FORTRAN needs explicit interface for C functions called here. - ! - INTERFACE - INTEGER FUNCTION h5awrite_double_1_c(attr_id, memtype_id, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AWRITE_DOUBLE_1_C'::h5awrite_double_1_c - !DEC$ENDIF - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - INTEGER(HID_T), INTENT(IN) :: attr_id - INTEGER(HID_T), INTENT(IN) :: memtype_id - DOUBLE PRECISION, INTENT(IN), & - DIMENSION(dims(1)) :: buf - END FUNCTION h5awrite_double_1_c - END INTERFACE - - hdferr = h5awrite_double_1_c(attr_id, memtype_id, buf, dims) - END SUBROUTINE h5awrite_double_1 - - - SUBROUTINE h5awrite_double_2(attr_id, memtype_id, buf, dims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - DOUBLE PRECISION, INTENT(IN), & - DIMENSION(dims(1),dims(2)) :: buf - ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - - ! INTEGER, EXTERNAL :: h5awrite_double_2_c - ! MS FORTRAN needs explicit interface for C functions called here. - ! - INTERFACE - INTEGER FUNCTION h5awrite_double_2_c(attr_id, memtype_id, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AWRITE_DOUBLE_2_C'::h5awrite_double_2_c - !DEC$ENDIF - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - INTEGER(HID_T), INTENT(IN) :: attr_id - INTEGER(HID_T), INTENT(IN) :: memtype_id - DOUBLE PRECISION, INTENT(IN), & - DIMENSION(dims(1),dims(2)) :: buf - END FUNCTION h5awrite_double_2_c - END INTERFACE - - hdferr = h5awrite_double_2_c(attr_id, memtype_id, buf, dims) - END SUBROUTINE h5awrite_double_2 - - - SUBROUTINE h5awrite_double_3(attr_id, memtype_id, buf, dims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - DOUBLE PRECISION, INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3)) :: buf - ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - - ! INTEGER, EXTERNAL :: h5awrite_double_3_c - ! MS FORTRAN needs explicit interface for C functions called here. - ! - INTERFACE - INTEGER FUNCTION h5awrite_double_3_c(attr_id, memtype_id, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AWRITE_DOUBLE_3_C'::h5awrite_double_3_c - !DEC$ENDIF - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - INTEGER(HID_T), INTENT(IN) :: attr_id - INTEGER(HID_T), INTENT(IN) :: memtype_id - DOUBLE PRECISION, INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3)) :: buf - END FUNCTION h5awrite_double_3_c - END INTERFACE - - hdferr = h5awrite_double_3_c(attr_id, memtype_id, buf, dims) - END SUBROUTINE h5awrite_double_3 - - - SUBROUTINE h5awrite_double_4(attr_id, memtype_id, buf, dims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - DOUBLE PRECISION, INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4)) :: buf - ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - - ! INTEGER, EXTERNAL :: h5awrite_double_4_c - ! MS FORTRAN needs explicit interface for C functions called here. - ! - INTERFACE - INTEGER FUNCTION h5awrite_double_4_c(attr_id, memtype_id, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AWRITE_DOUBLE_4_C'::h5awrite_double_4_c - !DEC$ENDIF - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - INTEGER(HID_T), INTENT(IN) :: attr_id - INTEGER(HID_T), INTENT(IN) :: memtype_id - DOUBLE PRECISION, INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4)) :: buf - END FUNCTION h5awrite_double_4_c - END INTERFACE - - hdferr = h5awrite_double_4_c(attr_id, memtype_id, buf, dims) - END SUBROUTINE h5awrite_double_4 - - - SUBROUTINE h5awrite_double_5(attr_id, memtype_id, buf, dims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - DOUBLE PRECISION, INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) :: buf - ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - - ! INTEGER, EXTERNAL :: h5awrite_double_5_c - ! MS FORTRAN needs explicit interface for C functions called here. - ! - INTERFACE - INTEGER FUNCTION h5awrite_double_5_c(attr_id, memtype_id, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AWRITE_DOUBLE_5_C'::h5awrite_double_5_c - !DEC$ENDIF - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - INTEGER(HID_T), INTENT(IN) :: attr_id - INTEGER(HID_T), INTENT(IN) :: memtype_id - DOUBLE PRECISION, INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) :: buf - END FUNCTION h5awrite_double_5_c - END INTERFACE - - hdferr = h5awrite_double_5_c(attr_id, memtype_id, buf, dims) - END SUBROUTINE h5awrite_double_5 - - - SUBROUTINE h5awrite_double_6(attr_id, memtype_id, buf, dims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - DOUBLE PRECISION, INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)) :: buf - ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - - ! INTEGER, EXTERNAL :: h5awrite_double_6_c - ! MS FORTRAN needs explicit interface for C functions called here. - ! - INTERFACE - INTEGER FUNCTION h5awrite_double_6_c(attr_id, memtype_id, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AWRITE_DOUBLE_6_C'::h5awrite_double_6_c - !DEC$ENDIF - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - INTEGER(HID_T), INTENT(IN) :: attr_id - INTEGER(HID_T), INTENT(IN) :: memtype_id - DOUBLE PRECISION, INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)) :: buf - END FUNCTION h5awrite_double_6_c - END INTERFACE - - hdferr = h5awrite_double_6_c(attr_id, memtype_id, buf, dims) - END SUBROUTINE h5awrite_double_6 - - - SUBROUTINE h5awrite_double_7(attr_id, memtype_id, buf, dims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - DOUBLE PRECISION, INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)) :: buf - ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - - ! INTEGER, EXTERNAL :: h5awrite_double_7_c - ! MS FORTRAN needs explicit interface for C functions called here. - ! - INTERFACE - INTEGER FUNCTION h5awrite_double_7_c(attr_id, memtype_id, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AWRITE_DOUBLE_7_C'::h5awrite_double_7_c - !DEC$ENDIF - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - INTEGER(HID_T), INTENT(IN) :: attr_id - INTEGER(HID_T), INTENT(IN) :: memtype_id - DOUBLE PRECISION, INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)) :: buf - END FUNCTION h5awrite_double_7_c - END INTERFACE - - hdferr = h5awrite_double_7_c(attr_id, memtype_id, buf, dims) - END SUBROUTINE h5awrite_double_7 - - - SUBROUTINE h5aread_double_scalar(attr_id, memtype_id, buf, dims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - DOUBLE PRECISION, INTENT(INOUT) :: buf ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - - ! INTEGER, EXTERNAL :: h5aread_double_s_c - ! MS FORTRAN needs explicit interface for C functions called here. - ! - INTERFACE - INTEGER FUNCTION h5aread_double_s_c(attr_id, memtype_id, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AREAD_DOUBLE_S_C'::h5aread_double_s_c - !DEC$ENDIF - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - INTEGER(HID_T), INTENT(IN) :: attr_id - INTEGER(HID_T), INTENT(IN) :: memtype_id - DOUBLE PRECISION, INTENT(INOUT)::buf - END FUNCTION h5aread_double_s_c - END INTERFACE - - hdferr = h5aread_double_s_c(attr_id, memtype_id, buf, dims) - END SUBROUTINE h5aread_double_scalar - - SUBROUTINE h5aread_double_1(attr_id, memtype_id, buf, dims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - DOUBLE PRECISION, INTENT(INOUT), & - DIMENSION(dims(1)) :: buf - ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - - ! INTEGER, EXTERNAL :: h5aread_double_1_c - ! MS FORTRAN needs explicit interface for C functions called here. - ! - INTERFACE - INTEGER FUNCTION h5aread_double_1_c(attr_id, memtype_id, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AREAD_DOUBLE_1_C'::h5aread_double_1_c - !DEC$ENDIF - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - INTEGER(HID_T), INTENT(IN) :: attr_id - INTEGER(HID_T), INTENT(IN) :: memtype_id - DOUBLE PRECISION, INTENT(INOUT), & - DIMENSION(dims(1)) :: buf - END FUNCTION h5aread_double_1_c - END INTERFACE - - hdferr = h5aread_double_1_c(attr_id, memtype_id, buf, dims) - END SUBROUTINE h5aread_double_1 - - - SUBROUTINE h5aread_double_2(attr_id, memtype_id, buf, dims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - DOUBLE PRECISION, INTENT(INOUT), & - DIMENSION(dims(1),dims(2)) :: buf - ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - - ! INTEGER, EXTERNAL :: h5aread_double_2_c - ! MS FORTRAN needs explicit interface for C functions called here. - ! - INTERFACE - INTEGER FUNCTION h5aread_double_2_c(attr_id, memtype_id, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AREAD_DOUBLE_2_C'::h5aread_double_2_c - !DEC$ENDIF - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - INTEGER(HID_T), INTENT(IN) :: attr_id - INTEGER(HID_T), INTENT(IN) :: memtype_id - DOUBLE PRECISION, INTENT(INOUT), & - DIMENSION(dims(1),dims(2)) :: buf - END FUNCTION h5aread_double_2_c - END INTERFACE - - hdferr = h5aread_double_2_c(attr_id, memtype_id, buf, dims) - END SUBROUTINE h5aread_double_2 - - - SUBROUTINE h5aread_double_3(attr_id, memtype_id, buf, dims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - DOUBLE PRECISION, INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3)) :: buf - ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - - ! INTEGER, EXTERNAL :: h5aread_double_3_c - ! MS FORTRAN needs explicit interface for C functions called here. - ! - INTERFACE - INTEGER FUNCTION h5aread_double_3_c(attr_id, memtype_id, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AREAD_DOUBLE_3_C'::h5aread_double_3_c - !DEC$ENDIF - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - INTEGER(HID_T), INTENT(IN) :: attr_id - INTEGER(HID_T), INTENT(IN) :: memtype_id - DOUBLE PRECISION, INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3)) :: buf - END FUNCTION h5aread_double_3_c - END INTERFACE - - hdferr = h5aread_double_3_c(attr_id, memtype_id, buf, dims) - END SUBROUTINE h5aread_double_3 - - - SUBROUTINE h5aread_double_4(attr_id, memtype_id, buf, dims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - DOUBLE PRECISION, INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4)) :: buf - ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - - ! INTEGER, EXTERNAL :: h5aread_double_4_c - ! MS FORTRAN needs explicit interface for C functions called here. - ! - INTERFACE - INTEGER FUNCTION h5aread_double_4_c(attr_id, memtype_id, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AREAD_DOUBLE_4_C'::h5aread_double_4_c - !DEC$ENDIF - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - INTEGER(HID_T), INTENT(IN) :: attr_id - INTEGER(HID_T), INTENT(IN) :: memtype_id - DOUBLE PRECISION, INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4)) :: buf - END FUNCTION h5aread_double_4_c - END INTERFACE - - hdferr = h5aread_double_4_c(attr_id, memtype_id, buf, dims) - END SUBROUTINE h5aread_double_4 - - - SUBROUTINE h5aread_double_5(attr_id, memtype_id, buf, dims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - DOUBLE PRECISION, INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) :: buf - ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - - ! INTEGER, EXTERNAL :: h5aread_double_5_c - ! MS FORTRAN needs explicit interface for C functions called here. - ! - INTERFACE - INTEGER FUNCTION h5aread_double_5_c(attr_id, memtype_id, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AREAD_DOUBLE_5_C'::h5aread_double_5_c - !DEC$ENDIF - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - INTEGER(HID_T), INTENT(IN) :: attr_id - INTEGER(HID_T), INTENT(IN) :: memtype_id - DOUBLE PRECISION, INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) :: buf - END FUNCTION h5aread_double_5_c - END INTERFACE - - hdferr = h5aread_double_5_c(attr_id, memtype_id, buf, dims) - END SUBROUTINE h5aread_double_5 - - - SUBROUTINE h5aread_double_6(attr_id, memtype_id, buf, dims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - DOUBLE PRECISION, INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)) :: buf - ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - - ! INTEGER, EXTERNAL :: h5aread_double_6_c - ! MS FORTRAN needs explicit interface for C functions called here. - ! - INTERFACE - INTEGER FUNCTION h5aread_double_6_c(attr_id, memtype_id, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AREAD_DOUBLE_6_C'::h5aread_double_6_c - !DEC$ENDIF - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - INTEGER(HID_T), INTENT(IN) :: attr_id - INTEGER(HID_T), INTENT(IN) :: memtype_id - DOUBLE PRECISION, INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)) :: buf - END FUNCTION h5aread_double_6_c - END INTERFACE - - hdferr = h5aread_double_6_c(attr_id, memtype_id, buf, dims) - END SUBROUTINE h5aread_double_6 - - - SUBROUTINE h5aread_double_7(attr_id, memtype_id, buf, dims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - DOUBLE PRECISION, INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)) :: buf - ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - - ! INTEGER, EXTERNAL :: h5aread_double_7_c - ! MS FORTRAN needs explicit interface for C functions called here. - ! - INTERFACE - INTEGER FUNCTION h5aread_double_7_c(attr_id, memtype_id, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AREAD_DOUBLE_7_C'::h5aread_double_7_c - !DEC$ENDIF - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - INTEGER(HID_T), INTENT(IN) :: attr_id - INTEGER(HID_T), INTENT(IN) :: memtype_id - DOUBLE PRECISION, INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)) :: buf - END FUNCTION h5aread_double_7_c - END INTERFACE - - hdferr = h5aread_double_7_c(attr_id, memtype_id, buf, dims) - END SUBROUTINE h5aread_double_7 - - - ! - ! ----- H5D ---- - ! - SUBROUTINE h5dwrite_double_scalar(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - DOUBLE PRECISION, INTENT(IN) :: buf ! Data buffer - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id - ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id - ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp - ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - - ! INTEGER, EXTERNAL :: h5dwrite_double_s_c - ! MS FORTRAN needs explicit interface for C functions called here. - ! - INTERFACE - INTEGER FUNCTION h5dwrite_double_s_c(dset_id, mem_type_id, & - mem_space_id_default, & - file_space_id_default, & - xfer_prp_default, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DWRITE_DOUBLE_S_C'::h5dwrite_double_s_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - DOUBLE PRECISION, INTENT(IN) :: buf - END FUNCTION h5dwrite_double_s_c - END INTERFACE - - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - if (present(xfer_prp)) xfer_prp_default = xfer_prp - if (present(mem_space_id)) mem_space_id_default = mem_space_id - if (present(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dwrite_double_s_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, buf, dims) - - END SUBROUTINE h5dwrite_double_scalar - - SUBROUTINE h5dwrite_double_1(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - DOUBLE PRECISION, INTENT(IN), & - DIMENSION(dims(1)) :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id - ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id - ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp - ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - - ! INTEGER, EXTERNAL :: h5dwrite_double_1_c - ! MS FORTRAN needs explicit interface for C functions called here. - ! - INTERFACE - INTEGER FUNCTION h5dwrite_double_1_c(dset_id, mem_type_id, & - mem_space_id_default, & - file_space_id_default, & - xfer_prp_default, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DWRITE_DOUBLE_1_C'::h5dwrite_double_1_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - DOUBLE PRECISION, INTENT(IN), & - DIMENSION(dims(1)) :: buf - END FUNCTION h5dwrite_double_1_c - END INTERFACE - - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - if (present(xfer_prp)) xfer_prp_default = xfer_prp - if (present(mem_space_id)) mem_space_id_default = mem_space_id - if (present(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dwrite_double_1_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, buf, dims) - - END SUBROUTINE h5dwrite_double_1 - - SUBROUTINE h5dwrite_double_2(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - DOUBLE PRECISION, INTENT(IN), & - DIMENSION(dims(1),dims(2)) :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id - ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id - ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp - ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - - ! INTEGER, EXTERNAL :: h5dwrite_double_2_c - ! MS FORTRAN needs explicit interface for C functions called here. - ! - INTERFACE - INTEGER FUNCTION h5dwrite_double_2_c(dset_id, mem_type_id, & - mem_space_id_default, & - file_space_id_default, & - xfer_prp_default, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DWRITE_DOUBLE_2_C'::h5dwrite_double_2_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - DOUBLE PRECISION, INTENT(IN), & - DIMENSION(dims(1),dims(2)) :: buf - END FUNCTION h5dwrite_double_2_c - END INTERFACE - - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - if (present(xfer_prp)) xfer_prp_default = xfer_prp - if (present(mem_space_id)) mem_space_id_default = mem_space_id - if (present(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dwrite_double_2_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, buf, dims) - - END SUBROUTINE h5dwrite_double_2 - - SUBROUTINE h5dwrite_double_3(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - DOUBLE PRECISION, INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3)) :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id - ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id - ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp - ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - - ! INTEGER, EXTERNAL :: h5dwrite_double_3_c - ! MS FORTRAN needs explicit interface for C functions called here. - ! - INTERFACE - INTEGER FUNCTION h5dwrite_double_3_c(dset_id, mem_type_id, & - mem_space_id_default, & - file_space_id_default, & - xfer_prp_default, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DWRITE_DOUBLE_3_C'::h5dwrite_double_3_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - DOUBLE PRECISION, INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3)) :: buf - END FUNCTION h5dwrite_double_3_c - END INTERFACE - - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - if (present(xfer_prp)) xfer_prp_default = xfer_prp - if (present(mem_space_id)) mem_space_id_default = mem_space_id - if (present(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dwrite_double_3_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, buf, dims) - - END SUBROUTINE h5dwrite_double_3 - - SUBROUTINE h5dwrite_double_4(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - DOUBLE PRECISION, INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4)) :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id - ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id - ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp - ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - - ! INTEGER, EXTERNAL :: h5dwrite_double_4_c - ! MS FORTRAN needs explicit interface for C functions called here. - ! - INTERFACE - INTEGER FUNCTION h5dwrite_double_4_c(dset_id, mem_type_id, & - mem_space_id_default, & - file_space_id_default, & - xfer_prp_default, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DWRITE_DOUBLE_4_C'::h5dwrite_double_4_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - DOUBLE PRECISION, INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4)) :: buf - END FUNCTION h5dwrite_double_4_c - END INTERFACE - - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - if (present(xfer_prp)) xfer_prp_default = xfer_prp - if (present(mem_space_id)) mem_space_id_default = mem_space_id - if (present(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dwrite_double_4_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, buf, dims) - - END SUBROUTINE h5dwrite_double_4 - - SUBROUTINE h5dwrite_double_5(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - DOUBLE PRECISION, INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id - ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id - ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp - ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - - ! INTEGER, EXTERNAL :: h5dwrite_double_5_c - ! MS FORTRAN needs explicit interface for C functions called here. - ! - INTERFACE - INTEGER FUNCTION h5dwrite_double_5_c(dset_id, mem_type_id, & - mem_space_id_default, & - file_space_id_default, & - xfer_prp_default, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DWRITE_DOUBLE_5_C'::h5dwrite_double_5_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - DOUBLE PRECISION, INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) :: buf - END FUNCTION h5dwrite_double_5_c - END INTERFACE - - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - if (present(xfer_prp)) xfer_prp_default = xfer_prp - if (present(mem_space_id)) mem_space_id_default = mem_space_id - if (present(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dwrite_double_5_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, buf, dims) - - END SUBROUTINE h5dwrite_double_5 - - SUBROUTINE h5dwrite_double_6(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - DOUBLE PRECISION, INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)) :: buf - ! Data buffer - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id - ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id - ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp - ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - - ! INTEGER, EXTERNAL :: h5dwrite_double_6_c - ! MS FORTRAN needs explicit interface for C functions called here. - ! - INTERFACE - INTEGER FUNCTION h5dwrite_double_6_c(dset_id, mem_type_id, & - mem_space_id_default, & - file_space_id_default, & - xfer_prp_default, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DWRITE_DOUBLE_6_C'::h5dwrite_double_6_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - DOUBLE PRECISION, INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)) :: buf - END FUNCTION h5dwrite_double_6_c - END INTERFACE - - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - if (present(xfer_prp)) xfer_prp_default = xfer_prp - if (present(mem_space_id)) mem_space_id_default = mem_space_id - if (present(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dwrite_double_6_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, buf, dims) - - END SUBROUTINE h5dwrite_double_6 - - SUBROUTINE h5dwrite_double_7(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - DOUBLE PRECISION, INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)) :: buf - ! Data buffer - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id - ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id - ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp - ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - - ! INTEGER, EXTERNAL :: h5dwrite_double_7_c - ! MS FORTRAN needs explicit interface for C functions called here. - ! - INTERFACE - INTEGER FUNCTION h5dwrite_double_7_c(dset_id, mem_type_id, & - mem_space_id_default, & - file_space_id_default, & - xfer_prp_default, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DWRITE_DOUBLE_7_C'::h5dwrite_double_7_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - DOUBLE PRECISION, INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)) :: buf - END FUNCTION h5dwrite_double_7_c - END INTERFACE - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - if (present(xfer_prp)) xfer_prp_default = xfer_prp - if (present(mem_space_id)) mem_space_id_default = mem_space_id - if (present(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dwrite_double_7_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, buf, dims) - - END SUBROUTINE h5dwrite_double_7 - - SUBROUTINE h5dread_double_scalar(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - DOUBLE PRECISION, INTENT(INOUT) :: buf ! Data buffer - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id - ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id - ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp - ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - - ! INTEGER, EXTERNAL :: h5dread_double_s_c - ! MS FORTRAN needs explicit interface for C functions called here. - ! - INTERFACE - INTEGER FUNCTION h5dread_double_s_c(dset_id, mem_type_id, & - mem_space_id_default, & - file_space_id_default, & - xfer_prp_default, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DREAD_DOUBLE_S_C'::h5dread_double_s_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - DOUBLE PRECISION, INTENT(OUT) :: buf - END FUNCTION h5dread_double_s_c - END INTERFACE - - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - if (present(xfer_prp)) xfer_prp_default = xfer_prp - if (present(mem_space_id)) mem_space_id_default = mem_space_id - if (present(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dread_double_s_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, buf, dims) - - END SUBROUTINE h5dread_double_scalar - - SUBROUTINE h5dread_double_1(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - DOUBLE PRECISION, INTENT(INOUT), & - DIMENSION(dims(1)) :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id - ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id - ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp - ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - - ! INTEGER, EXTERNAL :: h5dread_double_1_c - ! MS FORTRAN needs explicit interface for C functions called here. - ! - INTERFACE - INTEGER FUNCTION h5dread_double_1_c(dset_id, mem_type_id, & - mem_space_id_default, & - file_space_id_default, & - xfer_prp_default, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DREAD_DOUBLE_1_C'::h5dread_double_1_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - DOUBLE PRECISION, INTENT(INOUT), & - DIMENSION(dims(1)) :: buf - END FUNCTION h5dread_double_1_c - END INTERFACE - - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - if (present(xfer_prp)) xfer_prp_default = xfer_prp - if (present(mem_space_id)) mem_space_id_default = mem_space_id - if (present(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dread_double_1_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, buf, dims) - - END SUBROUTINE h5dread_double_1 - - SUBROUTINE h5dread_double_2(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - DOUBLE PRECISION, INTENT(INOUT), & - DIMENSION(dims(1),dims(2)) :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id - ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id - ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp - ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - - ! INTEGER, EXTERNAL :: h5dread_double_2_c - ! MS FORTRAN needs explicit interface for C functions called here. - ! - INTERFACE - INTEGER FUNCTION h5dread_double_2_c(dset_id, mem_type_id, & - mem_space_id_default, & - file_space_id_default, & - xfer_prp_default, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DREAD_DOUBLE_2_C'::h5dread_double_2_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - DOUBLE PRECISION, INTENT(INOUT), & - DIMENSION(dims(1),dims(2)) :: buf - END FUNCTION h5dread_double_2_c - END INTERFACE - - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - if (present(xfer_prp)) xfer_prp_default = xfer_prp - if (present(mem_space_id)) mem_space_id_default = mem_space_id - if (present(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dread_double_2_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, buf, dims) - - END SUBROUTINE h5dread_double_2 - - SUBROUTINE h5dread_double_3(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - DOUBLE PRECISION, INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3)) :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id - ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id - ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp - ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - - ! INTEGER, EXTERNAL :: h5dread_double_3_c - ! MS FORTRAN needs explicit interface for C functions called here. - ! - INTERFACE - INTEGER FUNCTION h5dread_double_3_c(dset_id, mem_type_id, & - mem_space_id_default, & - file_space_id_default, & - xfer_prp_default, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DREAD_DOUBLE_3_C'::h5dread_double_3_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - DOUBLE PRECISION, INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3)) :: buf - END FUNCTION h5dread_double_3_c - END INTERFACE - - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - if (present(xfer_prp)) xfer_prp_default = xfer_prp - if (present(mem_space_id)) mem_space_id_default = mem_space_id - if (present(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dread_double_3_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, buf, dims) - - END SUBROUTINE h5dread_double_3 - - SUBROUTINE h5dread_double_4(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - DOUBLE PRECISION, INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4)) :: buf - ! Data buffer - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id - ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id - ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp - ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - - ! INTEGER, EXTERNAL :: h5dread_double_4_c - ! MS FORTRAN needs explicit interface for C functions called here. - ! - INTERFACE - INTEGER FUNCTION h5dread_double_4_c(dset_id, mem_type_id, & - mem_space_id_default, & - file_space_id_default, & - xfer_prp_default, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DREAD_DOUBLE_4_C'::h5dread_double_4_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - DOUBLE PRECISION, INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4)) :: buf - END FUNCTION h5dread_double_4_c - END INTERFACE - - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - if (present(xfer_prp)) xfer_prp_default = xfer_prp - if (present(mem_space_id)) mem_space_id_default = mem_space_id - if (present(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dread_double_4_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, buf, dims) - - END SUBROUTINE h5dread_double_4 - - SUBROUTINE h5dread_double_5(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - DOUBLE PRECISION, INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id - ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id - ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp - ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - - ! INTEGER, EXTERNAL :: h5dread_double_5_c - ! MS FORTRAN needs explicit interface for C functions called here. - ! - INTERFACE - INTEGER FUNCTION h5dread_double_5_c(dset_id, mem_type_id, & - mem_space_id_default, & - file_space_id_default, & - xfer_prp_default, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DREAD_DOUBLE_5_C'::h5dread_double_5_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - DOUBLE PRECISION, INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) :: buf - END FUNCTION h5dread_double_5_c - END INTERFACE - - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - if (present(xfer_prp)) xfer_prp_default = xfer_prp - if (present(mem_space_id)) mem_space_id_default = mem_space_id - if (present(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dread_double_5_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, buf, dims) - - END SUBROUTINE h5dread_double_5 - - SUBROUTINE h5dread_double_6(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - DOUBLE PRECISION, INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)) :: buf - ! Data buffer - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id - ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id - ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp - ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - - ! INTEGER, EXTERNAL :: h5dread_double_6_c - ! MS FORTRAN needs explicit interface for C functions called here. - ! - INTERFACE - INTEGER FUNCTION h5dread_double_6_c(dset_id, mem_type_id, & - mem_space_id_default, & - file_space_id_default, & - xfer_prp_default, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DREAD_DOUBLE_6_C'::h5dread_double_6_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - DOUBLE PRECISION, INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)) :: buf - END FUNCTION h5dread_double_6_c - END INTERFACE - - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - if (present(xfer_prp)) xfer_prp_default = xfer_prp - if (present(mem_space_id)) mem_space_id_default = mem_space_id - if (present(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dread_double_6_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, buf, dims) - - END SUBROUTINE h5dread_double_6 - - SUBROUTINE h5dread_double_7(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - DOUBLE PRECISION, INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)) :: buf - ! Data buffer - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id - ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id - ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp - ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - - ! INTEGER, EXTERNAL :: h5dread_double_7_c - ! MS FORTRAN needs explicit interface for C functions called here. - ! - INTERFACE - INTEGER FUNCTION h5dread_double_7_c(dset_id, mem_type_id, & - mem_space_id_default, & - file_space_id_default, & - xfer_prp_default, buf, dims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DREAD_DOUBLE_7_C'::h5dread_double_7_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - DOUBLE PRECISION, INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)) :: buf - END FUNCTION h5dread_double_7_c - END INTERFACE - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - if (present(xfer_prp)) xfer_prp_default = xfer_prp - if (present(mem_space_id)) mem_space_id_default = mem_space_id - if (present(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dread_double_7_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, buf, dims) - - END SUBROUTINE h5dread_double_7 - - !---------------------------------------------------------------------- - ! Name: h5dfill_double - ! - ! Purpose: Fills dataspace elements with a fill value in a memory buffer. - ! Only INTEGER, CHARACTER, REAL and DOUBLE PRECISION datatypes - ! of the fillvalues and buffers are supported. Buffer and fillvalue - ! are assumed to have the same datatype. - ! Only one-dimesional buffers are supported. - ! - ! Inputs: - ! fill_value - fill value - ! space_id - memory space selection identifier - ! buf - data buffer iin memory ro apply selection to - ! - of k-th dimension of the buf array - ! Outputs: - ! hdferr: - error code - ! Success: 0 - ! Failure: -1 - ! - ! Programmer: Elena Pourmal - ! March 12, 2003 - ! - !---------------------------------------------------------------------- - - SUBROUTINE h5dfill_double(fill_value, space_id, buf, hdferr) - IMPLICIT NONE - DOUBLE PRECISION, INTENT(IN) :: fill_value ! Fill value - INTEGER(HID_T), INTENT(IN) :: space_id ! Memory dataspace selection identifier - DOUBLE PRECISION, INTENT(IN), DIMENSION(*) :: buf ! Memory buffer to fill in - INTEGER, INTENT(OUT) :: hdferr ! Error code - - INTEGER(HID_T) :: fill_type_id ! Fill value datatype identifier - INTEGER(HID_T) :: mem_type_id ! Buffer dadtype identifier - - ! INTEGER, EXTERNAL :: h5dfill_double_c - ! MS FORTRAN needs explicit interface for C functions called here. - ! - INTERFACE - INTEGER FUNCTION h5dfill_double_c(fill_value, fill_type_id, space_id, & - buf, mem_type_id) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DFILL_DOUBLE_C'::h5dfill_double_c - !DEC$ENDIF - DOUBLE PRECISION, INTENT(IN) :: fill_value ! Fill value - INTEGER(HID_T) :: fill_type_id ! Fill value datatype identifier - INTEGER(HID_T), INTENT(IN) :: space_id ! Memory dataspace selection identifier - DOUBLE PRECISION, INTENT(IN), DIMENSION(*) :: buf ! Memory buffer to fill in - INTEGER(HID_T) :: mem_type_id ! Buffer dadtype identifier - END FUNCTION h5dfill_double_c - END INTERFACE - fill_type_id = H5T_NATIVE_DOUBLE - mem_type_id = H5T_NATIVE_DOUBLE - - hdferr = h5dfill_double_c(fill_value, fill_type_id, space_id, & - buf, mem_type_id) - - - END SUBROUTINE h5dfill_double - - ! - ! -- H5P --- - ! - - SUBROUTINE h5pset_fill_value_double(prp_id, type_id, fillvalue, & - hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier of - ! of fillvalue datatype - ! (in memory) - DOUBLE PRECISION, INTENT(IN) :: fillvalue ! Fillvalue - INTEGER, INTENT(OUT) :: hdferr ! Error code - - INTERFACE - INTEGER FUNCTION h5pset_fill_value_double_c(prp_id, type_id, fillvalue) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_FILL_VALUE_DOUBLE_C'::h5pset_fill_value_double_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: prp_id - INTEGER(HID_T), INTENT(IN) :: type_id - DOUBLE PRECISION, INTENT(IN) :: fillvalue - END FUNCTION h5pset_fill_value_double_c - END INTERFACE - - hdferr = h5pset_fill_value_double_c(prp_id, type_id, fillvalue) - END SUBROUTINE h5pset_fill_value_double - - SUBROUTINE h5pget_fill_value_double(prp_id, type_id, fillvalue, & - hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier of - ! of fillvalue datatype - ! (in memory) - DOUBLE PRECISION, INTENT(IN) :: fillvalue ! Fillvalue - INTEGER, INTENT(OUT) :: hdferr ! Error code - - INTERFACE - INTEGER FUNCTION h5pget_fill_value_double_c(prp_id, type_id, fillvalue) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGET_FILL_VALUE_DOUBLE_C'::h5pget_fill_value_double_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: prp_id - INTEGER(HID_T), INTENT(IN) :: type_id - DOUBLE PRECISION :: fillvalue - END FUNCTION h5pget_fill_value_double_c - END INTERFACE - - hdferr = h5pget_fill_value_double_c(prp_id, type_id, fillvalue) - END SUBROUTINE h5pget_fill_value_double - -! -!****s* H5P (F90)/h5pset_double -! -! NAME -! h5pset_double -! -! PURPOSE -! Sets a property list value -! -! INPUTS -! prp_id - iproperty list identifier to modify -! name - name of property to modify -! value - value to set property to -! OUTPUTS -! hdferr: - error code -! Success: 0 -! Failure: -1 -! AUTHOR -! Elena Pourmal -! October 9, 2002 -! SOURCE - SUBROUTINE h5pset_double(prp_id, name, value, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to modify - DOUBLE PRECISION, INTENT(IN) :: value ! Property value - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTEGER :: name_len - - INTERFACE - INTEGER FUNCTION h5pset_double_c(prp_id, name, name_len, value) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_DOUBLE_C'::h5pset_double_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: name - INTEGER(HID_T), INTENT(IN) :: prp_id - CHARACTER(LEN=*), INTENT(IN) :: name - INTEGER, INTENT(IN) :: name_len - DOUBLE PRECISION, INTENT(IN) :: value - END FUNCTION h5pset_double_c - END INTERFACE - - name_len = LEN(name) - hdferr = h5pset_double_c(prp_id, name , name_len, value) - END SUBROUTINE h5pset_double - -!****s* H5P (F90)/h5pget_double -! -! NAME -! h5pget_double -! -! PURPOSE -! Gets a property list value -! -! INPUTS -! prp_id - iproperty list identifier to modify -! name - name of property to modify -! OUTPUTS -! value - value of property -! hdferr - error code -! Success: 0 -! Failure: -1 -! AUTHOR -! Elena Pourmal -! October 9, 2002 -! -! SOURCE - SUBROUTINE h5pget_double(prp_id, name, value, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to modify - DOUBLE PRECISION, INTENT(OUT) :: value ! Property value - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTEGER :: name_len - - INTERFACE - INTEGER FUNCTION h5pget_double_c(prp_id, name, name_len, value) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGET_DOUBLE_C'::h5pget_double_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: name - INTEGER(HID_T), INTENT(IN) :: prp_id - CHARACTER(LEN=*), INTENT(IN) :: name - INTEGER, INTENT(IN) :: name_len - DOUBLE PRECISION, INTENT(OUT) :: value - END FUNCTION h5pget_double_c - END INTERFACE - - name_len = LEN(name) - hdferr = h5pget_double_c(prp_id, name , name_len, value) - END SUBROUTINE h5pget_double - -! -!****s* H5P (F90)/h5pregister_double -! -! NAME -! h5pregister_double -! -! PURPOSE -! Registers a permanent property with a property list class. -! -! INPUTS -! class - property list class to register -! permanent property within -! name - name of property to register -! size - size of property in bytes -! value - default value for property in newly -! created property lists -! OUTPUTS -! hdferr - error code -! Success: 0 -! Failure: -1 -! AUTHOR -! Elena Pourmal -! October 10, 2002 -! -! SOURCE - SUBROUTINE h5pregister_double(class, name, size, value, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: class ! Property list class identifier - CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to register - INTEGER(SIZE_T), INTENT(IN) :: size ! Size of the property value - DOUBLE PRECISION, INTENT(IN) :: value ! Property value - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTEGER :: name_len - - INTERFACE - INTEGER FUNCTION h5pregister_double_c(class, name, name_len, size, value) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PREGISTER_DOUBLE_C'::h5pregister_double_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: name - INTEGER(HID_T), INTENT(IN) :: class - CHARACTER(LEN=*), INTENT(IN) :: name - INTEGER, INTENT(IN) :: name_len - INTEGER(SIZE_T), INTENT(IN) :: size - DOUBLE PRECISION, INTENT(IN) :: value - END FUNCTION h5pregister_double_c - END INTERFACE - - name_len = LEN(name) - hdferr = h5pregister_double_c(class, name , name_len, size, value) - END SUBROUTINE h5pregister_double - -!****s* H5P (F90)/h5pinsert_double -! -! NAME -! -! h5pinsert_double -! -! PURPOSE -! Registers a temporary property with a property list class. -! -! INPUTS -! plist - property list identifier -! permanent property within -! name - name of property to insert -! size - size of property in bytes -! value - initial value for the property -! OUTPUTS -! hdferr - error code -! Success: 0 -! Failure: -1 -! AUTHOR -! Elena Pourmal -! October 10, 2002 -! SOURCE - SUBROUTINE h5pinsert_double(plist, name, size, value, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: plist ! Property list identifier - CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to insert - INTEGER(SIZE_T), INTENT(IN) :: size ! Size of the property value - DOUBLE PRECISION, INTENT(IN) :: value ! Property value - INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** - INTEGER :: name_len - - INTERFACE - INTEGER FUNCTION h5pinsert_double_c(plist, name, name_len, size, value) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PINSERT_DOUBLE_C'::h5pinsert_double_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: name - INTEGER(HID_T), INTENT(IN) :: plist - CHARACTER(LEN=*), INTENT(IN) :: name - INTEGER, INTENT(IN) :: name_len - INTEGER(SIZE_T), INTENT(IN) :: size - DOUBLE PRECISION, INTENT(IN) :: value - END FUNCTION h5pinsert_double_c - END INTERFACE - - name_len = LEN(name) - hdferr = h5pinsert_double_c(plist, name , name_len, size, value) - END SUBROUTINE h5pinsert_double - -END MODULE H5_DBLE_INTERFACE diff --git a/fortran/src/H5_buildiface.F90 b/fortran/src/H5_buildiface.F90 new file mode 100644 index 0000000..9a42cbf --- /dev/null +++ b/fortran/src/H5_buildiface.F90 @@ -0,0 +1,1024 @@ +!****p* Program/H5_buildiface +! +! NAME +! Executable: H5_buildiface +! +! FILE +! fortran/src/H5_buildiface.f90 +! +! PURPOSE +! This stand alone program is used at build time to generate the module +! H5_gen (H5_gen.F90). It cycles through all the available KIND parameters for +! integers and reals. The appropriate program and subroutines are then generated +! depending on which of the KIND values are found. +! +! NOTES +! This program uses the Fortran 2008 intrinsic function STORAGE_SIZE or SIZEOF +! depending on availablity.It generates code that makes use of +! STORAGE_SIZE/SIZEOF in H5_gen.F90. STORAGE_SIZE is standard +! compliant and should always be chosen over SIZEOF. +! +! The availability of STORAGE_SIZE/SIZEOF is checked at configure time and the TRUE/FALSE +! condition is set in the configure variable "FORTRAN_HAVE_STORAGE_SIZE" or +! "FORTRAN_HAVE_SIZEOF". +! +! The use of C_SIZOF(X) is not used since the argument X must be an interoperable +! data entity. +! +! 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 +! M. Scot Breitenfeld +! +!***** + +#include + +PROGRAM H5_buildiface + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + +! These values are valid REAL KINDs (with corresponding C float) found during configure + H5_H5CONFIG_F_NUM_RKIND + H5_H5CONFIG_F_RKIND +! These values are valid INTEGER KINDs (with corresponding C integer) found during configure + H5_H5CONFIG_F_NUM_IKIND + H5_H5CONFIG_F_IKIND + + INTEGER :: i, j, k + INTEGER :: ji, jr, jd +#ifdef H5_FORTRAN_HAVE_C_LONG_DOUBLE + REAL(KIND=C_LONG_DOUBLE) :: c_longdble +#endif + REAL(KIND=C_DOUBLE) :: c_dble + REAL(KIND=C_FLOAT) :: c_flt + INTEGER :: sizeof_var + 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)) ', & + ', DIMENSION(dims(1),dims(2)) ', & + ', DIMENSION(dims(1),dims(2),dims(3)) ', & + ', DIMENSION(dims(1),dims(2),dims(3),dims(4)) ', & + ', DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) ', & + ', 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)) ', & + ' f_ptr = C_LOC(buf(1,1)) ', & + ' f_ptr = C_LOC(buf(1,1,1)) ', & + ' f_ptr = C_LOC(buf(1,1,1,1)) ', & + ' f_ptr = C_LOC(buf(1,1,1,1,1)) ', & + ' f_ptr = C_LOC(buf(1,1,1,1,1,1)) ', & + ' f_ptr = C_LOC(buf(1,1,1,1,1,1,1))' & + /) + CHARACTER(LEN=42), DIMENSION(1:8), PARAMETER :: fchr_ptr_line=(/ & + ' f_ptr = C_LOC(buf(1:1)) ', & + ' f_ptr = C_LOC(buf(1)(1:1)) ', & + ' f_ptr = C_LOC(buf(1,1)(1:1)) ', & + ' f_ptr = C_LOC(buf(1,1,1)(1:1)) ', & + ' f_ptr = C_LOC(buf(1,1,1,1)(1:1)) ', & + ' f_ptr = C_LOC(buf(1,1,1,1,1)(1:1)) ', & + ' f_ptr = C_LOC(buf(1,1,1,1,1,1)(1:1)) ', & + ' f_ptr = C_LOC(buf(1,1,1,1,1,1,1)(1:1))' & + /) + +! (a) Generate Fortran H5* interfaces having multiple KIND interfaces. +! +! DEVELOPER'S NOTES: +! +! Only interfaces with arrays of rank 7 and less are provided. Even-though, the F2008 +! standard extended the maximum rank to 15, it was decided that user's should use the +! new APIs to handle those use cases. Handling rank 7 and less is for backward compatibility +! with the Fortran 90/95 APIs codes which could never handle ranks greater than 7. + + OPEN(11,FILE='H5_gen.F90') + WRITE(11,'(40(A,/))') & +'!****h* ROBODoc/H5_gen.F90',& +'!',& +'! NAME',& +'! H5_gen',& +'! ',& +'! PURPOSE',& +'! This module is generated at build by H5_buildiface.F90 to handle all the',& +'! detected KINDs for APIs being passed INTEGERs, REALs and CHARACTERs. Currently ',& +'! these are H5A, H5D and H5P APIs',& +'!',& +'! COPYRIGHT',& +'! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *',& +'! Copyright by The HDF Group. *',& +'! 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',& +'! H5_buildiface.F90',& +'!',& +'!*****' + + WRITE(11,'(A)') "MODULE H5_GEN" + + WRITE(11,'(A)') ' USE, INTRINSIC :: ISO_C_BINDING' + WRITE(11,'(A)') ' USE H5GLOBAL' + + WRITE(11,'(A)') ' USE H5A' + 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, num_rkinds + j = rkind(i) + WRITE(chr2,'(I2)') j + DO k = 1, 8 + WRITE(11,'(A)') " MODULE PROCEDURE h5awrite_rkind_"//TRIM(ADJUSTL(chr2))//'_rank'//chr_rank(k) + ENDDO + END DO + DO i = 1, num_ikinds + j = ikind(i) + WRITE(chr2,'(I2)') j + DO k = 1, 8 + WRITE(11,'(A)') " MODULE PROCEDURE h5awrite_ikind_"//TRIM(ADJUSTL(chr2))//'_rank'//chr_rank(k) + ENDDO + END DO + DO k = 2, 8 + WRITE(11,'(A)') " MODULE PROCEDURE h5awrite_ckind_rank"//chr_rank(k) + ENDDO + WRITE(11,'(A)') " END INTERFACE" + +! H5Aread_f + WRITE(11,'(A)') " INTERFACE h5aread_f" + DO i = 1, num_rkinds + j = rkind(i) + WRITE(chr2,'(I2)') j + DO k = 1, 8 + WRITE(11,'(A)') " MODULE PROCEDURE h5aread_rkind_"//TRIM(ADJUSTL(chr2))//'_rank'//chr_rank(k) + ENDDO + END DO + DO i = 1, num_ikinds + j = ikind(i) + WRITE(chr2,'(I2)') j + DO k = 1, 8 + WRITE(11,'(A)') " MODULE PROCEDURE h5aread_ikind_"//TRIM(ADJUSTL(chr2))//'_rank'//chr_rank(k) + ENDDO + END DO + DO k = 2, 8 + WRITE(11,'(A)') " MODULE PROCEDURE h5aread_ckind_rank"//chr_rank(k) + ENDDO + WRITE(11,'(A)') " END INTERFACE" +!*************** +! H5D INTERFACES +!*************** +! +! H5Dwrite_f + WRITE(11,'(A)') " INTERFACE h5dwrite_f" + DO i = 1, num_rkinds + j = rkind(i) + WRITE(chr2,'(I2)') j + DO k = 1, 8 + WRITE(11,'(A)') " MODULE PROCEDURE h5dwrite_rkind_"//TRIM(ADJUSTL(chr2))//'_rank'//chr_rank(k) + ENDDO + END DO + DO i = 1, num_ikinds + j = ikind(i) + WRITE(chr2,'(I2)') j + DO k = 1, 8 + WRITE(11,'(A)') " MODULE PROCEDURE h5dwrite_ikind_"//TRIM(ADJUSTL(chr2))//'_rank'//chr_rank(k) + ENDDO + END DO + DO k = 2, 8 + WRITE(11,'(A)') " MODULE PROCEDURE h5dwrite_ckind_rank"//chr_rank(k) + END DO + WRITE(11,'(A)') " END INTERFACE" + +! H5Dread_f + WRITE(11,'(A)') " INTERFACE h5dread_f" + DO i = 1, num_rkinds + j = rkind(i) + WRITE(chr2,'(I2)') j + DO k = 1, 8 + WRITE(11,'(A)') " MODULE PROCEDURE h5dread_rkind_"//TRIM(ADJUSTL(chr2))//'_rank'//chr_rank(k) + ENDDO + END DO + DO i = 1, num_ikinds + j = ikind(i) + WRITE(chr2,'(I2)') j + DO k = 1, 8 + WRITE(11,'(A)') " MODULE PROCEDURE h5dread_ikind_"//TRIM(ADJUSTL(chr2))//'_rank'//chr_rank(k) + ENDDO + END DO + DO k = 2, 8 + WRITE(11,'(A)') " MODULE PROCEDURE h5dread_ckind_rank"//chr_rank(k) + ENDDO + WRITE(11,'(A)') " END INTERFACE" + +!*************** +! H5P INTERFACES +!*************** +! +! H5Pset_fill_value_f + WRITE(11,'(A)') " INTERFACE h5pset_fill_value_f" + DO i = 1, num_rkinds + j = rkind(i) + WRITE(chr2,'(I2)') j + WRITE(11,'(A)') " MODULE PROCEDURE h5pset_fill_value_kind_"//TRIM(ADJUSTL(chr2)) + END DO + WRITE(11,'(A)') " END INTERFACE" + +! H5Pget_fill_value_f + WRITE(11,'(A)') " INTERFACE h5pget_fill_value_f" + DO i = 1, num_rkinds + j = rkind(i) + WRITE(chr2,'(I2)') j + WRITE(11,'(A)') " MODULE PROCEDURE h5pget_fill_value_kind_"//TRIM(ADJUSTL(chr2)) + END DO + WRITE(11,'(A)') " END INTERFACE" + +! H5Pset_f + WRITE(11,'(A)') " INTERFACE h5pset_f" + DO i = 1, num_rkinds + j = rkind(i) + WRITE(chr2,'(I2)') j + WRITE(11,'(A)') " MODULE PROCEDURE h5pset_kind_"//TRIM(ADJUSTL(chr2)) + END DO + WRITE(11,'(A)') " END INTERFACE" + +! H5Pget_f + WRITE(11,'(A)') " INTERFACE h5pget_f" + DO i = 1, num_rkinds + j = rkind(i) + WRITE(chr2,'(I2)') j + WRITE(11,'(A)') " MODULE PROCEDURE h5pget_kind_"//TRIM(ADJUSTL(chr2)) + END DO + WRITE(11,'(A)') " END INTERFACE" + +! H5Pregister_f + WRITE(11,'(A)') " INTERFACE h5pregister_f" + DO i = 1, num_rkinds + j = rkind(i) + WRITE(chr2,'(I2)') j + WRITE(11,'(A)') " MODULE PROCEDURE h5pregister_kind_"//TRIM(ADJUSTL(chr2)) + END DO + WRITE(11,'(A)') " END INTERFACE" + +! H5Pinsert_f + WRITE(11,'(A)') " INTERFACE h5pinsert_f" + DO i = 1, num_rkinds + j = rkind(i) + WRITE(chr2,'(I2)') j + WRITE(11,'(A)') " MODULE PROCEDURE h5pinsert_kind_"//TRIM(ADJUSTL(chr2)) + END DO + WRITE(11,'(A)') " END INTERFACE" + + WRITE(11,'(A)') 'CONTAINS' + +!********************** +! H5A APIs +!********************** +! +! H5Awrite_f + +!****s* H5A (F03)/H5Awrite_f_F90 +! +! NAME +! H5Awrite_f_F90 +! +! PURPOSE +! Writes an attribute. +! +! Inputs: +! attr_id - Attribute identifier +! memtype_id - Attribute datatype identifier (in memory) +! dims - Array to hold corresponding dimension sizes of data buffer buf; +! dim(k) has value of the k-th dimension of buffer buf; +! values are ignored if buf is a scalar +! buf - Data buffer; may be a scalar or an array +! +! Outputs: +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces are added for +! called C functions (it is needed for Windows +! port). February 27, 2001 +! +! dims parameter was added to make code portable; +! Aprile 4, 2001 +! +! Changed buf intent to INOUT to be consistant +! with how the C functions handles it. The pg +! compiler will return 0 if a buf value is not set. +! February, 2008 +! +! NOTES +! This function is overloaded to write INTEGER, +! REAL, REAL(KIND=C_DOUBLE) and CHARACTER buffers +! up to 7 dimensions. +! +! Fortran90 Interface: +!! SUBROUTINE H5Awrite_f(attr_id, memtype_id, buf, dims, hdferr) +!! INTEGER(HID_T) , INTENT(IN) :: attr_id +!! INTEGER(HID_T) , INTENT(IN) :: memtype_id +!! TYPE , INTENT(IN) :: buf +!! INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims +!! INTEGER , INTENT(OUT) :: hdferr +!***** + + DO i = 1, num_rkinds + k = rkind(i) + WRITE(chr2,'(I2)') k + DO j = 1, 8 + +! DLL definitions for windows + WRITE(11,'(A)') '!DEC$if defined(BUILD_HDF5_DLL)' + WRITE(11,'(A)') '!DEC$attributes dllexport :: h5awrite_rkind_'//TRIM(ADJUSTL(chr2))//'_rank'//chr_rank(j) + WRITE(11,'(A)') '!DEC$endif' + +! Subroutine API + WRITE(11,'(A)') ' SUBROUTINE h5awrite_rkind_'//TRIM(ADJUSTL(chr2))& + &//'_rank'//chr_rank(j)//'(attr_id, memtype_id, buf, dims, hdferr)' + WRITE(11,'(A)') ' IMPLICIT NONE' + WRITE(11,'(A)') ' INTEGER(HID_T) , INTENT(IN) :: attr_id' + WRITE(11,'(A)') ' INTEGER(HID_T) , INTENT(IN) :: memtype_id' + WRITE(11,'(A)') ' INTEGER(HSIZE_T) , INTENT(IN), DIMENSION(*) :: dims' + WRITE(11,'(A)') ' REAL(KIND='//TRIM(ADJUSTL(chr2))//'),INTENT(IN)'//TRIM(rank_dim_line(j))//', TARGET :: buf' + WRITE(11,'(A)') ' INTEGER , INTENT(OUT) :: hdferr' + WRITE(11,'(A)') ' TYPE(C_PTR) :: f_ptr' + + WRITE(11,'(A)') f_ptr_line(j) + WRITE(11,'(A)') ' hdferr = H5Awrite_f_c(attr_id, memtype_id, f_ptr)' + WRITE(11,'(A)') ' END SUBROUTINE h5awrite_rkind_'//TRIM(ADJUSTL(chr2))//'_rank'//chr_rank(j) + ENDDO + ENDDO + DO i = 1, num_ikinds + k = ikind(i) + WRITE(chr2,'(I2)') k + DO j = 1, 8 + +! DLL definitions for windows + WRITE(11,'(A)') '!DEC$if defined(BUILD_HDF5_DLL)' + WRITE(11,'(A)') '!DEC$attributes dllexport :: h5awrite_ikind_'//TRIM(ADJUSTL(chr2))//'_rank'//chr_rank(j) + WRITE(11,'(A)') '!DEC$endif' + +! Subroutine API + WRITE(11,'(A)') ' SUBROUTINE h5awrite_ikind_'//TRIM(ADJUSTL(chr2))& + &//'_rank'//chr_rank(j)//'(attr_id, memtype_id, buf, dims, hdferr)' + WRITE(11,'(A)') ' IMPLICIT NONE' + WRITE(11,'(A)') ' INTEGER(HID_T) , INTENT(IN) :: attr_id' + WRITE(11,'(A)') ' INTEGER(HID_T) , INTENT(IN) :: memtype_id' + WRITE(11,'(A)') ' INTEGER(HSIZE_T) , INTENT(IN), DIMENSION(*) :: dims' + WRITE(11,'(A)') ' INTEGER(KIND='//TRIM(ADJUSTL(chr2))//'),INTENT(INOUT)'//TRIM(rank_dim_line(j))//', TARGET :: buf' + WRITE(11,'(A)') ' INTEGER , INTENT(OUT) :: hdferr' + WRITE(11,'(A)') ' TYPE(C_PTR) :: f_ptr' + + WRITE(11,'(A)') f_ptr_line(j) + WRITE(11,'(A)') ' hdferr = H5Awrite_f_c(attr_id, memtype_id, f_ptr)' + WRITE(11,'(A)') ' END SUBROUTINE h5awrite_ikind_'//TRIM(ADJUSTL(chr2))//'_rank'//chr_rank(j) + ENDDO + ENDDO + DO j = 2, 8 + +! DLL definitions for windows + WRITE(11,'(A)') '!DEC$if defined(BUILD_HDF5_DLL)' + WRITE(11,'(A)') '!DEC$attributes dllexport :: h5awrite_ckind_rank'//chr_rank(j) + WRITE(11,'(A)') '!DEC$endif' + +! Subroutine API + WRITE(11,'(A)') ' SUBROUTINE h5awrite_ckind_rank'//chr_rank(j)//'(attr_id, memtype_id, buf, dims, hdferr)' + WRITE(11,'(A)') ' IMPLICIT NONE' + WRITE(11,'(A)') ' INTEGER(HID_T) , INTENT(IN) :: attr_id' + WRITE(11,'(A)') ' INTEGER(HID_T) , INTENT(IN) :: memtype_id' + WRITE(11,'(A)') ' INTEGER(HSIZE_T) , INTENT(IN), DIMENSION(*) :: dims' + WRITE(11,'(A)') ' CHARACTER(LEN=*) , INTENT(IN)'//TRIM(rank_dim_line(j))//', TARGET :: buf' + WRITE(11,'(A)') ' INTEGER , INTENT(OUT) :: hdferr' + WRITE(11,'(A)') ' TYPE(C_PTR) :: f_ptr' + + WRITE(11,'(A)') fchr_ptr_line(j) + WRITE(11,'(A)') ' hdferr = H5Awrite_f_c(attr_id, memtype_id, f_ptr)' + WRITE(11,'(A)') ' END SUBROUTINE h5awrite_ckind_rank'//chr_rank(j) + ENDDO + +! +! H5Aread_f + +!****s* H5A (F03)/H5Aread_f_F90 +! +! NAME +! H5Aread_f_F90 +! +! PURPOSE +! Reads an attribute. +! +! Inputs: +! attr_id - Attribute identifier +! memtype_id - Attribute datatype identifier (in memory) +! dims - Array to hold corresponding dimension sizes of data buffer buf; +! dim(k) has value of the k-th dimension of buffer buf; +! values are ignored if buf is a scalar +! +! Outputs: +! buf - Data buffer; may be a scalar or an array +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces are added for +! called C functions (it is needed for Windows +! port). February 27, 2001 +! +! dims parameter was added to make code portable; +! Aprile 4, 2001 +! +! Changed buf intent to INOUT to be consistant +! with how the C functions handles it. The pg +! compiler will return 0 if a buf value is not set. +! February, 2008 +! +! NOTES +! This function is overloaded to write INTEGER, +! REAL, REAL(KIND=C_DOUBLE) and CHARACTER buffers +! up to 7 dimensions. +! Fortran90 Interface: +!! SUBROUTINE H5Aread_f(attr_id, memtype_id, buf, dims, hdferr) +!! INTEGER(HID_T) , INTENT(IN) :: attr_id +!! INTEGER(HID_T) , INTENT(IN) :: memtype_id +!! TYPE , INTENT(INOUT) :: buf +!! INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims +!! INTEGER , INTENT(OUT) :: hdferr +!***** + DO i = 1, num_rkinds + k = rkind(i) + WRITE(chr2,'(I2)') k + DO j = 1, 8 +! DLL definitions for windows + WRITE(11,'(A)') '!DEC$if defined(BUILD_HDF5_DLL)' + WRITE(11,'(A)') '!DEC$attributes dllexport :: h5aread_rkind_'//TRIM(ADJUSTL(chr2))//'_rank'//chr_rank(j) + WRITE(11,'(A)') '!DEC$endif' +! Subroutine API + WRITE(11,'(A)') ' SUBROUTINE h5aread_rkind_'//TRIM(ADJUSTL(chr2))& + &//'_rank'//chr_rank(j)//'(attr_id, memtype_id, buf, dims, hdferr)' + WRITE(11,'(A)') ' IMPLICIT NONE' + WRITE(11,'(A)') ' INTEGER(HID_T) , INTENT(IN) :: attr_id' + WRITE(11,'(A)') ' INTEGER(HID_T) , INTENT(IN) :: memtype_id' + WRITE(11,'(A)') ' INTEGER(HSIZE_T) , INTENT(IN), DIMENSION(*) :: dims' + WRITE(11,'(A)') ' REAL(KIND='//TRIM(ADJUSTL(chr2))//'),INTENT(INOUT)'//TRIM(rank_dim_line(j))//', TARGET :: buf' + WRITE(11,'(A)') ' INTEGER , INTENT(OUT) :: hdferr' + WRITE(11,'(A)') ' TYPE(C_PTR) :: f_ptr' + + WRITE(11,'(A)') f_ptr_line(j) + WRITE(11,'(A)') ' hdferr = H5Aread_f_c(attr_id, memtype_id, f_ptr)' + WRITE(11,'(A)') ' END SUBROUTINE h5aread_rkind_'//TRIM(ADJUSTL(chr2))//'_rank'//chr_rank(j) + ENDDO + ENDDO + DO i = 1, num_ikinds + k = ikind(i) + WRITE(chr2,'(I2)') k + DO j = 1, 8 +! DLL definitions for windows + WRITE(11,'(A)') '!DEC$if defined(BUILD_HDF5_DLL)' + WRITE(11,'(A)') '!DEC$attributes dllexport :: h5aread_ikind_'//TRIM(ADJUSTL(chr2))//'_rank'//chr_rank(j) + WRITE(11,'(A)') '!DEC$endif' +! Subroutine API + WRITE(11,'(A)') ' SUBROUTINE h5aread_ikind_'//TRIM(ADJUSTL(chr2))& + &//'_rank'//chr_rank(j)//'(attr_id, memtype_id, buf, dims, hdferr)' + WRITE(11,'(A)') ' IMPLICIT NONE' + WRITE(11,'(A)') ' INTEGER(HID_T) , INTENT(IN) :: attr_id' + WRITE(11,'(A)') ' INTEGER(HID_T) , INTENT(IN) :: memtype_id' + WRITE(11,'(A)') ' INTEGER(HSIZE_T) , INTENT(IN), DIMENSION(*) :: dims' + WRITE(11,'(A)') ' INTEGER(KIND='//TRIM(ADJUSTL(chr2))//'),INTENT(INOUT)'//TRIM(rank_dim_line(j))//', TARGET :: buf' + WRITE(11,'(A)') ' INTEGER , INTENT(OUT) :: hdferr' + WRITE(11,'(A)') ' TYPE(C_PTR) :: f_ptr' + + WRITE(11,'(A)') f_ptr_line(j) + WRITE(11,'(A)') ' hdferr = H5Aread_f_c(attr_id, memtype_id, f_ptr)' + WRITE(11,'(A)') ' END SUBROUTINE h5aread_ikind_'//TRIM(ADJUSTL(chr2))//'_rank'//chr_rank(j) + ENDDO + ENDDO + DO j = 2, 8 +! DLL definitions for windows + WRITE(11,'(A)') '!DEC$if defined(BUILD_HDF5_DLL)' + WRITE(11,'(A)') '!DEC$attributes dllexport :: h5aread_ckind_rank'//chr_rank(j) + WRITE(11,'(A)') '!DEC$endif' +! Subroutine API + WRITE(11,'(A)') ' SUBROUTINE h5aread_ckind_rank'//chr_rank(j)//'(attr_id, memtype_id, buf, dims, hdferr)' + WRITE(11,'(A)') ' IMPLICIT NONE' + WRITE(11,'(A)') ' INTEGER(HID_T) , INTENT(IN) :: attr_id' + WRITE(11,'(A)') ' INTEGER(HID_T) , INTENT(IN) :: memtype_id' + WRITE(11,'(A)') ' INTEGER(HSIZE_T) , INTENT(IN), DIMENSION(*) :: dims' + WRITE(11,'(A)') ' CHARACTER(LEN=*), INTENT(IN)'//TRIM(rank_dim_line(j))//', TARGET :: buf' + WRITE(11,'(A)') ' INTEGER , INTENT(OUT) :: hdferr' + WRITE(11,'(A)') ' TYPE(C_PTR) :: f_ptr' + + WRITE(11,'(A)') fchr_ptr_line(j) + WRITE(11,'(A)') ' hdferr = H5Aread_f_c(attr_id, memtype_id, f_ptr)' + WRITE(11,'(A)') ' END SUBROUTINE h5aread_ckind_rank'//chr_rank(j) + ENDDO + +!********************** +! H5D APIs +!********************** +! +! h5dread_f + +! +! NAME +! h5dread_f +! +! PURPOSE +! Reads raw data from the specified dataset into buf, +! converting from file datatype and dataspace to memory +! datatype and dataspace. +! +! Inputs: +! dset_id - dataset identifier +! mem_type_id - memory type identifier +! dims - 1-dim array of size 7; dims(k) has the size +! - of k-th dimension of the buf array +! Outputs: +! buf - buffer to read data in +! hdferr: - error code +! Success: 0 +! Failure: -1 +! Optional parameters: +! mem_space_id - memory dataspace identifier +! file_space_id - file dataspace identifier +! xfer_prp - trasfer property list identifier +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). February 28, 2001 +! +! dims parameter was added to make code portable; +! n parameter was replaced with dims parameter in +! the h5dwrite_reference_obj and h5dwrite_reference_dsetreg +! functions. April 2, 2001 +! +! NOTES +! This function is overloaded to read INTEGER, +! REAL, DOUBLE PRECISION and CHARACTER buffers +! up to 7 dimensions, and one dimensional buffers +! of the TYPE(hobj_ref_t_f) and TYPE(hdset_reg_ref_t_f) +! types. +! + DO i = 1, num_rkinds + k = rkind(i) + WRITE(chr2,'(I2)') k + DO j = 1, 8 +! DLL definitions for windows + WRITE(11,'(A)') '!DEC$if defined(BUILD_HDF5_DLL)' + WRITE(11,'(A)') '!DEC$attributes dllexport :: h5dread_rkind_'//TRIM(ADJUSTL(chr2))//'_rank'//chr_rank(j) + WRITE(11,'(A)') '!DEC$endif' +! Subroutine API + WRITE(11,'(A)') ' SUBROUTINE h5dread_rkind_'//TRIM(ADJUSTL(chr2))& + &//'_rank'//chr_rank(j)//'(dset_id, mem_type_id, buf, dims, hdferr, &' + WRITE(11,'(A)') ' mem_space_id, file_space_id, xfer_prp)' + WRITE(11,'(A)') ' USE, INTRINSIC :: ISO_C_BINDING' + WRITE(11,'(A)') ' IMPLICIT NONE' + WRITE(11,'(A)') ' INTEGER(HID_T), INTENT(IN) :: dset_id' + WRITE(11,'(A)') ' INTEGER(HID_T), INTENT(IN) :: mem_type_id' + WRITE(11,'(A)') ' INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims' + WRITE(11,'(A)') ' REAL(KIND='//TRIM(ADJUSTL(chr2))//'),INTENT(INOUT)'//TRIM(rank_dim_line(j))//', TARGET :: buf' + WRITE(11,'(A)') ' INTEGER, INTENT(OUT) :: hdferr' + WRITE(11,'(A)') ' INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id' + WRITE(11,'(A)') ' INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id' + WRITE(11,'(A)') ' INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp' + WRITE(11,'(A)') ' INTEGER(HID_T) :: xfer_prp_default' + WRITE(11,'(A)') ' INTEGER(HID_T) :: mem_space_id_default' + WRITE(11,'(A)') ' INTEGER(HID_T) :: file_space_id_default' + WRITE(11,'(A)') ' TYPE(C_PTR) :: f_ptr' + WRITE(11,'(A)') ' xfer_prp_default = H5P_DEFAULT_F' + WRITE(11,'(A)') ' mem_space_id_default = H5S_ALL_F' + WRITE(11,'(A)') ' file_space_id_default = H5S_ALL_F' + WRITE(11,'(A)') ' IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp' + WRITE(11,'(A)') ' IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id' + WRITE(11,'(A)') ' IF(PRESENT(file_space_id)) file_space_id_default = file_space_id' + WRITE(11,'(A)') f_ptr_line(j) + WRITE(11,'(A)') ' hdferr = h5dread_f_c(dset_id, mem_type_id, mem_space_id_default, &' + WRITE(11,'(A)') ' file_space_id_default, xfer_prp_default, f_ptr)' + WRITE(11,'(A)') ' END SUBROUTINE h5dread_rkind_'//TRIM(ADJUSTL(chr2))//'_rank'//chr_rank(j) + + ENDDO + ENDDO + + DO i = 1, num_ikinds + k = ikind(i) + WRITE(chr2,'(I2)') k + DO j = 1, 8 +! DLL definitions for windows + WRITE(11,'(A)') '!DEC$if defined(BUILD_HDF5_DLL)' + WRITE(11,'(A)') '!DEC$attributes dllexport :: h5dread_ikind_'//TRIM(ADJUSTL(chr2))//'_rank'//chr_rank(j) + WRITE(11,'(A)') '!DEC$endif' +! Subroutine API + WRITE(11,'(A)') ' SUBROUTINE h5dread_ikind_'//TRIM(ADJUSTL(chr2))& + &//'_rank'//chr_rank(j)//'(dset_id, mem_type_id, buf, dims, hdferr, &' + WRITE(11,'(A)') ' mem_space_id, file_space_id, xfer_prp)' + WRITE(11,'(A)') ' USE, INTRINSIC :: ISO_C_BINDING' + WRITE(11,'(A)') ' IMPLICIT NONE' + WRITE(11,'(A)') ' INTEGER(HID_T), INTENT(IN) :: dset_id' + WRITE(11,'(A)') ' INTEGER(HID_T), INTENT(IN) :: mem_type_id' + WRITE(11,'(A)') ' INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims' + WRITE(11,'(A)') ' INTEGER(KIND='//TRIM(ADJUSTL(chr2))//'),INTENT(INOUT)'//TRIM(rank_dim_line(j))//', TARGET :: buf' + WRITE(11,'(A)') ' INTEGER, INTENT(OUT) :: hdferr' + WRITE(11,'(A)') ' INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id' + WRITE(11,'(A)') ' INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id' + WRITE(11,'(A)') ' INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp' + WRITE(11,'(A)') ' INTEGER(HID_T) :: xfer_prp_default' + WRITE(11,'(A)') ' INTEGER(HID_T) :: mem_space_id_default' + WRITE(11,'(A)') ' INTEGER(HID_T) :: file_space_id_default' + WRITE(11,'(A)') ' TYPE(C_PTR) :: f_ptr' + WRITE(11,'(A)') ' xfer_prp_default = H5P_DEFAULT_F' + WRITE(11,'(A)') ' mem_space_id_default = H5S_ALL_F' + WRITE(11,'(A)') ' file_space_id_default = H5S_ALL_F' + WRITE(11,'(A)') ' IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp' + WRITE(11,'(A)') ' IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id' + WRITE(11,'(A)') ' IF(PRESENT(file_space_id)) file_space_id_default = file_space_id' + WRITE(11,'(A)') f_ptr_line(j) + WRITE(11,'(A)') ' hdferr = h5dread_f_c(dset_id, mem_type_id, mem_space_id_default, &' + WRITE(11,'(A)') ' file_space_id_default, xfer_prp_default, f_ptr)' + WRITE(11,'(A)') ' END SUBROUTINE h5dread_ikind_'//TRIM(ADJUSTL(chr2))//'_rank'//chr_rank(j) + + ENDDO + ENDDO + DO j = 2, 8 +! DLL definitions for windows + WRITE(11,'(A)') '!DEC$if defined(BUILD_HDF5_DLL)' + WRITE(11,'(A)') '!DEC$attributes dllexport :: h5dread_ckind_rank'//chr_rank(j) + WRITE(11,'(A)') '!DEC$endif' +! Subroutine API + WRITE(11,'(A)') ' SUBROUTINE h5dread_ckind_rank'//chr_rank(j)//'(dset_id, mem_type_id, buf, dims, hdferr, &' + WRITE(11,'(A)') ' mem_space_id, file_space_id, xfer_prp)' + WRITE(11,'(A)') ' USE, INTRINSIC :: ISO_C_BINDING' + WRITE(11,'(A)') ' IMPLICIT NONE' + WRITE(11,'(A)') ' INTEGER(HID_T), INTENT(IN) :: dset_id' + WRITE(11,'(A)') ' INTEGER(HID_T), INTENT(IN) :: mem_type_id' + WRITE(11,'(A)') ' INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims' + WRITE(11,'(A)') ' CHARACTER(LEN=*), INTENT(INOUT)'//TRIM(rank_dim_line(j))//', TARGET :: buf' + WRITE(11,'(A)') ' INTEGER, INTENT(OUT) :: hdferr' + WRITE(11,'(A)') ' INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id' + WRITE(11,'(A)') ' INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id' + WRITE(11,'(A)') ' INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp' + WRITE(11,'(A)') ' INTEGER(HID_T) :: xfer_prp_default' + WRITE(11,'(A)') ' INTEGER(HID_T) :: mem_space_id_default' + WRITE(11,'(A)') ' INTEGER(HID_T) :: file_space_id_default' + WRITE(11,'(A)') ' TYPE(C_PTR) :: f_ptr' + WRITE(11,'(A)') ' xfer_prp_default = H5P_DEFAULT_F' + WRITE(11,'(A)') ' mem_space_id_default = H5S_ALL_F' + WRITE(11,'(A)') ' file_space_id_default = H5S_ALL_F' + WRITE(11,'(A)') ' IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp' + WRITE(11,'(A)') ' IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id' + WRITE(11,'(A)') ' IF(PRESENT(file_space_id)) file_space_id_default = file_space_id' + WRITE(11,'(A)') fchr_ptr_line(j) + WRITE(11,'(A)') ' hdferr = h5dread_f_c(dset_id, mem_type_id, mem_space_id_default, &' + WRITE(11,'(A)') ' file_space_id_default, xfer_prp_default, f_ptr)' + WRITE(11,'(A)') ' END SUBROUTINE h5dread_ckind_rank'//chr_rank(j) + ENDDO +! +! h5dwrite_f + +!****s* H5D (F03)/h5dwrite_f_F03 +! +! NAME +! h5dwrite_f_F03 +! +! PURPOSE +! Writes raw data from a dataset into a buffer. +! +! Inputs: +! dset_id - Identifier of the dataset to write to. +! mem_type_id - Identifier of the memory datatype. +! buf - Buffer with data to be written to the file. +! +! Outputs: +! hdferr - Returns 0 if successful and -1 if fails +! +! Optional parameters: +! mem_space_id - Identifier of the memory dataspace. +! file_space_id - Identifier of the dataset's dataspace in the file. +! xfer_prp - Identifier of a transfer property list for this I/O operation. +! +! AUTHOR +! M. Scot Breitenfeld +! September 17, 2011 +! +! Fortran2003 Interface: +!! SUBROUTINE h5dwrite_f(dset_id, mem_type_id, buf, hdferr, & +!! mem_space_id, file_space_id, xfer_prp) +!! INTEGER(HID_T), INTENT(IN) :: dset_id +!! INTEGER(HID_T), INTENT(IN) :: mem_type_id +!! TYPE(C_PTR) , INTENT(IN) :: buf +!! INTEGER , INTENT(OUT) :: hdferr +!! INTEGER(HID_T), INTENT(IN) , OPTIONAL :: mem_space_id +!! INTEGER(HID_T), INTENT(IN) , OPTIONAL :: file_space_id +!! INTEGER(HID_T), INTENT(IN) , OPTIONAL :: xfer_prp +!***** + DO i = 1, num_rkinds + k = rkind(i) + WRITE(chr2,'(I2)') k + DO j = 1, 8 +! DLL definitions for windows + WRITE(11,'(A)') '!DEC$if defined(BUILD_HDF5_DLL)' + WRITE(11,'(A)') '!DEC$attributes dllexport :: h5dwrite_rkind_'//TRIM(ADJUSTL(chr2))//'_rank'//chr_rank(j) + WRITE(11,'(A)') '!DEC$endif' +! Subroutine API + WRITE(11,'(A)') ' SUBROUTINE h5dwrite_rkind_'//TRIM(ADJUSTL(chr2))& + &//'_rank'//chr_rank(j)//'(dset_id, mem_type_id, buf, dims, hdferr, &' + WRITE(11,'(A)') ' mem_space_id, file_space_id, xfer_prp)' + WRITE(11,'(A)') ' USE, INTRINSIC :: ISO_C_BINDING' + WRITE(11,'(A)') ' IMPLICIT NONE' + WRITE(11,'(A)') ' INTEGER(HID_T), INTENT(IN) :: dset_id' + WRITE(11,'(A)') ' INTEGER(HID_T), INTENT(IN) :: mem_type_id' + WRITE(11,'(A)') ' INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims' + WRITE(11,'(A)') ' REAL(KIND='//TRIM(ADJUSTL(chr2))//'),INTENT(IN)'//TRIM(rank_dim_line(j))//', TARGET :: buf' + WRITE(11,'(A)') ' INTEGER, INTENT(OUT) :: hdferr' + WRITE(11,'(A)') ' INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id' + WRITE(11,'(A)') ' INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id' + WRITE(11,'(A)') ' INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp' + WRITE(11,'(A)') ' INTEGER(HID_T) :: xfer_prp_default' + WRITE(11,'(A)') ' INTEGER(HID_T) :: mem_space_id_default' + WRITE(11,'(A)') ' INTEGER(HID_T) :: file_space_id_default' + WRITE(11,'(A)') ' TYPE(C_PTR) :: f_ptr' + WRITE(11,'(A)') ' xfer_prp_default = H5P_DEFAULT_F' + WRITE(11,'(A)') ' mem_space_id_default = H5S_ALL_F' + WRITE(11,'(A)') ' file_space_id_default = H5S_ALL_F' + WRITE(11,'(A)') ' IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp' + WRITE(11,'(A)') ' IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id' + WRITE(11,'(A)') ' IF(PRESENT(file_space_id)) file_space_id_default = file_space_id' + WRITE(11,'(A)') f_ptr_line(j) + WRITE(11,'(A)') ' hdferr = h5dwrite_f_c(dset_id, mem_type_id, mem_space_id_default, &' + WRITE(11,'(A)') ' file_space_id_default, xfer_prp_default, f_ptr)' + WRITE(11,'(A)') ' END SUBROUTINE h5dwrite_rkind_'//TRIM(ADJUSTL(chr2))//'_rank'//chr_rank(j) + ENDDO + ENDDO + + DO i = 1, num_ikinds + k = ikind(i) + WRITE(chr2,'(I2)') k + DO j = 1, 8 +! DLL definitions for windows + WRITE(11,'(A)') '!DEC$if defined(BUILD_HDF5_DLL)' + WRITE(11,'(A)') '!DEC$attributes dllexport :: h5dwrite_ikind_'//TRIM(ADJUSTL(chr2))//'_rank'//chr_rank(j) + WRITE(11,'(A)') '!DEC$endif' +! Subroutine API + WRITE(11,'(A)') ' SUBROUTINE h5dwrite_ikind_'//TRIM(ADJUSTL(chr2))& + &//'_rank'//chr_rank(j)//'(dset_id, mem_type_id, buf, dims, hdferr, &' + WRITE(11,'(A)') ' mem_space_id, file_space_id, xfer_prp)' + WRITE(11,'(A)') ' USE, INTRINSIC :: ISO_C_BINDING' + WRITE(11,'(A)') ' IMPLICIT NONE' + WRITE(11,'(A)') ' INTEGER(HID_T), INTENT(IN) :: dset_id' + WRITE(11,'(A)') ' INTEGER(HID_T), INTENT(IN) :: mem_type_id' + WRITE(11,'(A)') ' INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims' + WRITE(11,'(A)') ' INTEGER(KIND='//TRIM(ADJUSTL(chr2))//'),INTENT(IN)'//TRIM(rank_dim_line(j))//', TARGET :: buf' + WRITE(11,'(A)') ' INTEGER, INTENT(OUT) :: hdferr' + WRITE(11,'(A)') ' INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id' + WRITE(11,'(A)') ' INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id' + WRITE(11,'(A)') ' INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp' + WRITE(11,'(A)') ' INTEGER(HID_T) :: xfer_prp_default' + WRITE(11,'(A)') ' INTEGER(HID_T) :: mem_space_id_default' + WRITE(11,'(A)') ' INTEGER(HID_T) :: file_space_id_default' + WRITE(11,'(A)') ' TYPE(C_PTR) :: f_ptr' + WRITE(11,'(A)') ' xfer_prp_default = H5P_DEFAULT_F' + WRITE(11,'(A)') ' mem_space_id_default = H5S_ALL_F' + WRITE(11,'(A)') ' file_space_id_default = H5S_ALL_F' + WRITE(11,'(A)') ' IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp' + WRITE(11,'(A)') ' IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id' + WRITE(11,'(A)') ' IF(PRESENT(file_space_id)) file_space_id_default = file_space_id' + WRITE(11,'(A)') f_ptr_line(j) + WRITE(11,'(A)') ' hdferr = h5dwrite_f_c(dset_id, mem_type_id, mem_space_id_default, &' + WRITE(11,'(A)') ' file_space_id_default, xfer_prp_default, f_ptr)' + WRITE(11,'(A)') ' END SUBROUTINE h5dwrite_ikind_'//TRIM(ADJUSTL(chr2))//'_rank'//chr_rank(j) + ENDDO + ENDDO + DO j = 2, 8 +! DLL definitions for windows + WRITE(11,'(A)') '!DEC$if defined(BUILD_HDF5_DLL)' + WRITE(11,'(A)') '!DEC$attributes dllexport :: h5dwrite_ckind_rank'//chr_rank(j) + WRITE(11,'(A)') '!DEC$endif' +! Subroutine API + WRITE(11,'(A)') ' SUBROUTINE h5dwrite_ckind_rank'//chr_rank(j)//'(dset_id, mem_type_id, buf, dims, hdferr, &' + WRITE(11,'(A)') ' mem_space_id, file_space_id, xfer_prp)' + WRITE(11,'(A)') ' USE, INTRINSIC :: ISO_C_BINDING' + WRITE(11,'(A)') ' IMPLICIT NONE' + WRITE(11,'(A)') ' INTEGER(HID_T), INTENT(IN) :: dset_id' + WRITE(11,'(A)') ' INTEGER(HID_T), INTENT(IN) :: mem_type_id' + WRITE(11,'(A)') ' INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims' + WRITE(11,'(A)') ' CHARACTER(LEN=*),INTENT(IN)'//TRIM(rank_dim_line(j))//', TARGET :: buf' + WRITE(11,'(A)') ' INTEGER, INTENT(OUT) :: hdferr' + WRITE(11,'(A)') ' INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id' + WRITE(11,'(A)') ' INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id' + WRITE(11,'(A)') ' INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp' + WRITE(11,'(A)') ' INTEGER(HID_T) :: xfer_prp_default' + WRITE(11,'(A)') ' INTEGER(HID_T) :: mem_space_id_default' + WRITE(11,'(A)') ' INTEGER(HID_T) :: file_space_id_default' + WRITE(11,'(A)') ' TYPE(C_PTR) :: f_ptr' + WRITE(11,'(A)') ' xfer_prp_default = H5P_DEFAULT_F' + WRITE(11,'(A)') ' mem_space_id_default = H5S_ALL_F' + WRITE(11,'(A)') ' file_space_id_default = H5S_ALL_F' + WRITE(11,'(A)') ' IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp' + WRITE(11,'(A)') ' IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id' + WRITE(11,'(A)') ' IF(PRESENT(file_space_id)) file_space_id_default = file_space_id' + WRITE(11,'(A)') fchr_ptr_line(j) + WRITE(11,'(A)') ' hdferr = h5dwrite_f_c(dset_id, mem_type_id, mem_space_id_default, &' + WRITE(11,'(A)') ' file_space_id_default, xfer_prp_default, f_ptr)' + WRITE(11,'(A)') ' END SUBROUTINE h5dwrite_ckind_rank'//chr_rank(j) + ENDDO + +!********************** +! H5P APIs +!********************** +! +! H5Pset_fill_value_f + DO i = 1, num_rkinds + k = rkind(i) + WRITE(chr2,'(I2)') k +! DLL definitions for windows + WRITE(11,'(A)') '!DEC$if defined(BUILD_HDF5_DLL)' + WRITE(11,'(A)') '!DEC$attributes dllexport :: h5pset_fill_value_kind_'//TRIM(ADJUSTL(chr2)) + WRITE(11,'(A)') '!DEC$endif' +! Subroutine API + WRITE(11,'(A)') ' SUBROUTINE h5pset_fill_value_kind_'//TRIM(ADJUSTL(chr2))& + &//'(prp_id, type_id, fillvalue, hdferr)' + WRITE(11,'(A)') ' IMPLICIT NONE' + WRITE(11,'(A)') ' INTEGER(HID_T), INTENT(IN) :: prp_id' + WRITE(11,'(A)') ' INTEGER(HID_T), INTENT(IN) :: type_id' + WRITE(11,'(A)') ' REAL(KIND='//TRIM(ADJUSTL(chr2))//'), INTENT(IN), TARGET :: fillvalue' + WRITE(11,'(A)') ' INTEGER, INTENT(OUT) :: hdferr ' + WRITE(11,'(A)') ' TYPE(C_PTR) :: f_ptr ' + WRITE(11,'(A)') ' f_ptr = C_LOC(fillvalue)' + WRITE(11,'(A)') ' hdferr = h5pset_fill_value_c(prp_id, type_id, f_ptr)' + WRITE(11,'(A)') ' END SUBROUTINE h5pset_fill_value_kind_'//TRIM(ADJUSTL(chr2)) + ENDDO + +! H5Pget_fill_value_f + DO i = 1, num_rkinds + k = rkind(i) + WRITE(chr2,'(I2)') k +! DLL definitions for windows + WRITE(11,'(A)') '!DEC$if defined(BUILD_HDF5_DLL)' + WRITE(11,'(A)') '!DEC$attributes dllexport :: h5pget_fill_value_kind_'//TRIM(ADJUSTL(chr2)) + WRITE(11,'(A)') '!DEC$endif' +! Subroutine API + WRITE(11,'(A)') ' SUBROUTINE h5pget_fill_value_kind_'//TRIM(ADJUSTL(chr2))& + &//'(prp_id, type_id, fillvalue, hdferr)' + WRITE(11,'(A)') ' IMPLICIT NONE' + WRITE(11,'(A)') ' INTEGER(HID_T), INTENT(IN) :: prp_id' + WRITE(11,'(A)') ' INTEGER(HID_T), INTENT(IN) :: type_id' + WRITE(11,'(A)') ' REAL(KIND='//TRIM(ADJUSTL(chr2))//'), INTENT(OUT), TARGET :: fillvalue' + WRITE(11,'(A)') ' INTEGER, INTENT(OUT) :: hdferr' + WRITE(11,'(A)') ' TYPE(C_PTR) :: f_ptr' + WRITE(11,'(A)') ' f_ptr = C_LOC(fillvalue)' + WRITE(11,'(A)') ' hdferr = h5pget_fill_value_c(prp_id, type_id, f_ptr)' + WRITE(11,'(A)') ' END SUBROUTINE h5pget_fill_value_kind_'//TRIM(ADJUSTL(chr2)) + ENDDO + +! H5Pset_f + DO i = 1, num_rkinds + k = rkind(i) + WRITE(chr2,'(I2)') k +! DLL definitions for windows + WRITE(11,'(A)') '!DEC$if defined(BUILD_HDF5_DLL)' + WRITE(11,'(A)') '!DEC$attributes dllexport :: h5pset_kind_'//TRIM(ADJUSTL(chr2)) + WRITE(11,'(A)') '!DEC$endif' +! Subroutine API + WRITE(11,'(A)') ' SUBROUTINE h5pset_kind_'//TRIM(ADJUSTL(chr2))& + &//'(prp_id, name, value, hdferr)' + WRITE(11,'(A)') ' IMPLICIT NONE' + WRITE(11,'(A)') ' INTEGER(HID_T), INTENT(IN) :: prp_id' + WRITE(11,'(A)') ' CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: name' + WRITE(11,'(A)') ' REAL(KIND='//TRIM(ADJUSTL(chr2))//'), INTENT(IN), TARGET :: value' + WRITE(11,'(A)') ' INTEGER, INTENT(OUT) :: hdferr' + WRITE(11,'(A)') ' INTEGER :: name_len' + WRITE(11,'(A)') ' TYPE(C_PTR) :: f_ptr' + WRITE(11,'(A)') ' f_ptr = C_LOC(value)' + WRITE(11,'(A)') ' name_len = LEN(name)' + WRITE(11,'(A)') ' hdferr = h5pget_c(prp_id, name, name_len, f_ptr)' + + WRITE(11,'(A)') ' END SUBROUTINE h5pset_kind_'//TRIM(ADJUSTL(chr2)) + ENDDO + +! H5Pget_f + DO i = 1, num_rkinds + k = rkind(i) + WRITE(chr2,'(I2)') k +! DLL definitions for windows + WRITE(11,'(A)') '!DEC$if defined(BUILD_HDF5_DLL)' + WRITE(11,'(A)') '!DEC$attributes dllexport :: h5pget_kind_'//TRIM(ADJUSTL(chr2)) + WRITE(11,'(A)') '!DEC$endif' +! Subroutine API + WRITE(11,'(A)') ' SUBROUTINE h5pget_kind_'//TRIM(ADJUSTL(chr2))& + &//'(prp_id, name, value, hdferr)' + WRITE(11,'(A)') ' IMPLICIT NONE' + WRITE(11,'(A)') ' INTEGER(HID_T), INTENT(IN) :: prp_id' + WRITE(11,'(A)') ' CHARACTER(LEN=*), INTENT(IN) :: name' + WRITE(11,'(A)') ' REAL(KIND='//TRIM(ADJUSTL(chr2))//'), INTENT(OUT), TARGET :: value' + WRITE(11,'(A)') ' INTEGER, INTENT(OUT) :: hdferr' + WRITE(11,'(A)') ' INTEGER :: name_len' + WRITE(11,'(A)') ' TYPE(C_PTR) :: f_ptr' + WRITE(11,'(A)') ' f_ptr = C_LOC(value)' + WRITE(11,'(A)') ' name_len = LEN(name)' + WRITE(11,'(A)') ' hdferr = h5pget_c(prp_id, name, name_len, f_ptr)' + WRITE(11,'(A)') ' END SUBROUTINE h5pget_kind_'//TRIM(ADJUSTL(chr2)) + ENDDO + +! H5Pregister_f + DO i = 1, num_rkinds + k = rkind(i) + WRITE(chr2,'(I2)') k +! DLL definitions for windows + WRITE(11,'(A)') '!DEC$if defined(BUILD_HDF5_DLL)' + WRITE(11,'(A)') '!DEC$attributes dllexport :: h5pregister_kind_'//TRIM(ADJUSTL(chr2)) + WRITE(11,'(A)') '!DEC$endif' +! Subroutine API + WRITE(11,'(A)') 'SUBROUTINE h5pregister_kind_'//TRIM(ADJUSTL(chr2))& + &//'(class, name, size, value, hdferr)' + WRITE(11,'(A)') ' IMPLICIT NONE' + WRITE(11,'(A)') ' INTEGER(HID_T), INTENT(IN) :: class' + WRITE(11,'(A)') ' CHARACTER(LEN=*), INTENT(IN) :: name' + WRITE(11,'(A)') ' INTEGER(SIZE_T), INTENT(IN) :: size' + WRITE(11,'(A)') ' REAL(KIND='//TRIM(ADJUSTL(chr2))//'), INTENT(IN), TARGET :: value' + WRITE(11,'(A)') ' INTEGER, INTENT(OUT) :: hdferr' + WRITE(11,'(A)') ' INTEGER :: name_len' + WRITE(11,'(A)') ' TYPE(C_PTR) :: f_ptr' + WRITE(11,'(A)') ' f_ptr = C_LOC(value)' + WRITE(11,'(A)') ' name_len = LEN(name)' + WRITE(11,'(A)') ' hdferr = h5pregister_c(class, name, name_len, size, f_ptr)' + WRITE(11,'(A)') 'END SUBROUTINE h5pregister_kind_'//TRIM(ADJUSTL(chr2)) + ENDDO + +! H5Pinsert_f + DO i = 1, num_rkinds + k = rkind(i) + WRITE(chr2,'(I2)') k +! DLL definitions for windows + WRITE(11,'(A)') '!DEC$if defined(BUILD_HDF5_DLL)' + WRITE(11,'(A)') '!DEC$attributes dllexport :: h5pinsert_kind_'//TRIM(ADJUSTL(chr2)) + WRITE(11,'(A)') '!DEC$endif' +! Subroutine API + WRITE(11,'(A)') ' SUBROUTINE h5pinsert_kind_'//TRIM(ADJUSTL(chr2))& + &//'(plist, name, size, value, hdferr)' + WRITE(11,'(A)') ' IMPLICIT NONE' + WRITE(11,'(A)') ' INTEGER(HID_T), INTENT(IN) :: plist' + WRITE(11,'(A)') ' CHARACTER(LEN=*), INTENT(IN) :: name' + WRITE(11,'(A)') ' INTEGER(SIZE_T), INTENT(IN) :: size' + WRITE(11,'(A)') ' REAL(KIND='//TRIM(ADJUSTL(chr2))//'), INTENT(IN), TARGET :: value' + WRITE(11,'(A)') ' INTEGER, INTENT(OUT) :: hdferr' + WRITE(11,'(A)') ' INTEGER :: name_len' + WRITE(11,'(A)') ' TYPE(c_ptr) :: f_ptr' + WRITE(11,'(A)') ' f_ptr = c_loc(value)' + WRITE(11,'(A)') ' name_len = LEN(name)' + WRITE(11,'(A)') ' hdferr = h5pinsert_c(plist, name , name_len, size, f_ptr)' + WRITE(11,'(A)') ' END SUBROUTINE h5pinsert_kind_'//TRIM(ADJUSTL(chr2)) + ENDDO + + WRITE(11,'(A)') 'END MODULE H5_gen' + + CLOSE(11) + +END PROGRAM H5_buildiface + + + diff --git a/fortran/src/H5_f.c b/fortran/src/H5_f.c index 1641989..e527dce 100644 --- a/fortran/src/H5_f.c +++ b/fortran/src/H5_f.c @@ -1,6 +1,6 @@ /****ih* H5_f/H5_f * PURPOSE - * This file contains C stubs for H5 Fortran APIs + * This file contains C stubs for H5 Fortran APIs * * COPYRIGHT * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * @@ -22,7 +22,7 @@ */ #include "H5f90.h" - +#include "H5fort_type_defines.h" /****if* H5_f/h5init_types_c * NAME * h5init_types_c @@ -30,17 +30,17 @@ * Initialize predefined datatypes in Fortran * INPUTS * types - array with the predefined Native Fortran - * type, its element and length must be the - * same as the types array defined in the - * H5f90global.f90 + * type, its element and length must be the + * same as the types array defined in the + * H5f90global.F90 * floatingtypes - array with the predefined Floating Fortran - * type, its element and length must be the - * same as the floatingtypes array defined in the - * H5f90global.f90 + * type, its element and length must be the + * same as the floatingtypes array defined in the + * H5f90global.F90 * integertypes - array with the predefined Integer Fortran - * type, its element and length must be the - * same as the integertypes array defined in the - * H5f90global.f90 + * type, its element and length must be the + * same as the integertypes array defined in the + * H5f90global.F90 * RETURNS * 0 on success, -1 on failure * AUTHOR @@ -49,14 +49,14 @@ * SOURCE */ int_f -nh5init_types_c( hid_t_f * types, hid_t_f * floatingtypes, hid_t_f * integertypes ) +h5init_types_c( hid_t_f * types, hid_t_f * floatingtypes, hid_t_f * integertypes ) /******/ { int ret_value = -1; hid_t c_type_id; size_t tmp_val; -/* Fortran INTEGER is may not be the same as C in; do all checking to find +/* Fortran INTEGER may not be the same as C; do all checking to find an appropriate size */ if (sizeof(int_f) == sizeof(int)) { @@ -92,6 +92,12 @@ nh5init_types_c( hid_t_f * types, hid_t_f * floatingtypes, hid_t_f * integertype if ((types[2] = (hid_t_f)H5Tcopy(H5T_NATIVE_LDOUBLE)) < 0) return ret_value; }/*end else */ #endif +#ifdef H5_HAVE_FLOAT128 + else if(sizeof(double_f)==sizeof(__float128)) { + if ((types[2] = H5Tcopy (H5T_NATIVE_FLOAT)) < 0) return ret_value; + if ( H5Tset_precision (types[2], 128) < 0) return ret_value; + }/*end else */ +#endif /* if ((types[3] = H5Tcopy(H5T_NATIVE_UINT8)) < 0) return ret_value; @@ -126,7 +132,11 @@ nh5init_types_c( hid_t_f * types, hid_t_f * floatingtypes, hid_t_f * integertype if ((types[6] = (hid_t_f)H5Tcopy(H5T_NATIVE_INT)) < 0) return ret_value; } /*end if */ else if (sizeof(int_1_f) == sizeof(long long)) { - if ((types[6] = (hid_t_f)H5Tcopy(H5T_NATIVE_LLONG)) < 0) return ret_value; + if ((types[6] = (hid_t_f)H5Tcopy(H5T_NATIVE_LLONG)) < 0) return ret_value; + } /*end if */ + else { + if ((types[6] = H5Tcopy (H5T_NATIVE_INT)) < 0) return ret_value; + if ( H5Tset_precision (types[6], 128) < 0) return ret_value; } /*end else */ /* * FIND H5T_NATIVE_INTEGER_2 @@ -143,6 +153,10 @@ nh5init_types_c( hid_t_f * types, hid_t_f * floatingtypes, hid_t_f * integertype else if (sizeof(int_2_f) == sizeof(long long)) { if ((types[7] = (hid_t_f)H5Tcopy(H5T_NATIVE_LLONG)) < 0) return ret_value; } /*end else */ + else { + if ((types[7] = H5Tcopy (H5T_NATIVE_INT)) < 0) return ret_value; + if ( H5Tset_precision (types[7], 128) < 0) return ret_value; + } /*end else */ /* * FIND H5T_NATIVE_INTEGER_4 */ @@ -158,6 +172,10 @@ nh5init_types_c( hid_t_f * types, hid_t_f * floatingtypes, hid_t_f * integertype else if (sizeof(int_4_f) == sizeof(long long)) { if ((types[8] = (hid_t_f)H5Tcopy(H5T_NATIVE_LLONG)) < 0) return ret_value; } /*end else */ + else { + if ((types[8] = H5Tcopy (H5T_NATIVE_INT)) < 0) return ret_value; + if ( H5Tset_precision (types[8], 128) < 0) return ret_value; + } /*end else */ /* * FIND H5T_NATIVE_INTEGER_8 */ @@ -173,47 +191,65 @@ nh5init_types_c( hid_t_f * types, hid_t_f * floatingtypes, hid_t_f * integertype else if (sizeof(int_8_f) == sizeof(long long)) { if ((types[9] = (hid_t_f)H5Tcopy(H5T_NATIVE_LLONG)) < 0) return ret_value; } /*end else */ + else { + if ((types[9] = H5Tcopy (H5T_NATIVE_INT)) < 0) return ret_value; + if ( H5Tset_precision (types[9], 128) < 0) return ret_value; + } /*end else */ + /* - * FIND H5T_NATIVE_REAL_4 + * FIND H5T_NATIVE_REAL_C_FLOAT */ - if (sizeof(real_4_f) == sizeof(float)) { + if (sizeof(real_C_FLOAT_f) == sizeof(float)) { if ((types[10] = (hid_t_f)H5Tcopy(H5T_NATIVE_FLOAT)) < 0) return ret_value; } /*end if */ - else if (sizeof(real_4_f) == sizeof(double)) { + else if (sizeof(real_C_FLOAT_f) == sizeof(double)) { if ((types[10] = (hid_t_f)H5Tcopy(H5T_NATIVE_DOUBLE)) < 0) return ret_value; } /*end if */ #if H5_SIZEOF_LONG_DOUBLE!=0 - else if (sizeof(real_4_f) == sizeof(long double)) { + else if (sizeof(real_C_FLOAT_f) == sizeof(long double)) { if ((types[10] = (hid_t_f)H5Tcopy(H5T_NATIVE_LDOUBLE)) < 0) return ret_value; } /*end else */ #endif /* - * FIND H5T_NATIVE_REAL_8 + * FIND H5T_NATIVE_REAL_C_DOUBLE */ - if (sizeof(real_8_f) == sizeof(float)) { + if (sizeof(real_C_DOUBLE_f) == sizeof(float)) { if ((types[11] = (hid_t_f)H5Tcopy(H5T_NATIVE_FLOAT)) < 0) return ret_value; } /*end if */ - else if (sizeof(real_8_f) == sizeof(double)) { + else if (sizeof(real_C_DOUBLE_f) == sizeof(double)) { if ((types[11] = (hid_t_f)H5Tcopy(H5T_NATIVE_DOUBLE)) < 0) return ret_value; } /*end if */ #if H5_SIZEOF_LONG_DOUBLE!=0 - else if (sizeof(real_8_f) == sizeof(long double)) { + else if (sizeof(real_C_DOUBLE_f) == sizeof(long double)) { if ((types[11] = (hid_t_f)H5Tcopy(H5T_NATIVE_LDOUBLE)) < 0) return ret_value; } /*end else */ #endif /* - * FIND H5T_NATIVE_REAL_16 + * FIND H5T_NATIVE_REAL_C_LONG_DOUBLE */ - if (sizeof(real_16_f) == sizeof(float)) { +#if H5_FORTRAN_C_LONG_DOUBLE_IS_UNIQUE!=0 + if (sizeof(real_C_LONG_DOUBLE_f) == sizeof(float)) { if ((types[12] = (hid_t_f)H5Tcopy(H5T_NATIVE_FLOAT)) < 0) return ret_value; } /*end if */ - else if (sizeof(real_16_f) == sizeof(double)) { + else if (sizeof(real_C_LONG_DOUBLE_f) == sizeof(double)) { if ((types[12] = (hid_t_f)H5Tcopy(H5T_NATIVE_DOUBLE)) < 0) return ret_value; } /*end if */ -#if H5_SIZEOF_LONG_DOUBLE!=0 - else if (sizeof(real_16_f) == sizeof(long double)) { +# if H5_FORTRAN_HAVE_C_LONG_DOUBLE!=0 + else if (sizeof(real_C_LONG_DOUBLE_f) == sizeof(long double)) { + if ( H5_PAC_C_MAX_REAL_PRECISION >= H5_PAC_FC_MAX_REAL_PRECISION) { if ((types[12] = (hid_t_f)H5Tcopy(H5T_NATIVE_LDOUBLE)) < 0) return ret_value; - } /*end else */ + } + else { + if ((types[12] = H5Tcopy (H5T_NATIVE_FLOAT)) < 0) return ret_value; + if ( H5Tset_precision (types[12], 128) < 0) return ret_value; + } + } +# else + if ((types[12] = H5Tcopy (H5T_NATIVE_FLOAT)) < 0) return ret_value; + if ( H5Tset_precision (types[12], 64) < 0) return ret_value; +# endif +#else + if ((types[12] = H5Tcopy(H5T_NATIVE_DOUBLE)) < 0) return ret_value; #endif /* * FIND H5T_NATIVE_B_8 @@ -221,7 +257,38 @@ nh5init_types_c( hid_t_f * types, hid_t_f * floatingtypes, hid_t_f * integertype if ((types[13] = (hid_t_f)H5Tcopy(H5T_NATIVE_B8)) < 0) return ret_value; if ((types[14] = (hid_t_f)H5Tcopy(H5T_NATIVE_B16)) < 0) return ret_value; if ((types[15] = (hid_t_f)H5Tcopy(H5T_NATIVE_B32)) < 0) return ret_value; - if ((types[16] = (hid_t_f)H5Tcopy(H5T_NATIVE_B64)) < 0) return ret_value; + if ((types[16] = (hid_t_f)H5Tcopy(H5T_NATIVE_B64)) < 0) return ret_value; + +#if H5_HAVE_Fortran_INTEGER_SIZEOF_16!=0 + /* + * FIND H5T_NATIVE_INTEGER_16 + */ + if (sizeof(int_16_f) == sizeof(char)) { + if ((types[17] = (hid_t_f)H5Tcopy(H5T_NATIVE_CHAR)) < 0) return ret_value; + } /*end if */ + else if (sizeof(int_16_f) == sizeof(short)) { + if ((types[17] = (hid_t_f)H5Tcopy(H5T_NATIVE_SHORT)) < 0) return ret_value; + } /*end if */ + else if (sizeof(int_16_f) == sizeof(int)) { + if ((types[17] = (hid_t_f)H5Tcopy(H5T_NATIVE_INT)) < 0) return ret_value; + } /*end if */ + else if (sizeof(int_16_f) == sizeof(long long)) { + if ((types[17] = (hid_t_f)H5Tcopy(H5T_NATIVE_LLONG)) < 0) return ret_value; + } /*end else */ + else { + if ((types[17] = H5Tcopy (H5T_NATIVE_INT)) < 0) return ret_value; + if ( H5Tset_precision (types[17], 128) < 0) return ret_value; + } /*end else */ +#else + if ((types[17] = H5Tcopy (H5T_NATIVE_INT)) < 0) return ret_value; + if ( H5Tset_precision (types[17], 128) < 0) return ret_value; +#endif + + /* + * FIND H5T_NATIVE_FLOAT_128 + */ + if ((types[18] = H5Tcopy (H5T_NATIVE_FLOAT)) < 0) return ret_value; + if ( H5Tset_precision (types[18], 128) < 0) return ret_value; if ((floatingtypes[0] = (hid_t_f)H5Tcopy(H5T_IEEE_F32BE)) < 0) return ret_value; if ((floatingtypes[1] = (hid_t_f)H5Tcopy(H5T_IEEE_F32LE)) < 0) return ret_value; @@ -272,35 +339,35 @@ nh5init_types_c( hid_t_f * types, hid_t_f * floatingtypes, hid_t_f * integertype * Closes predefined datatype in Fortran * INPUTS * types - array with the predefined Native Fortran - * type, its element and length must be the - * same as the types array defined in the - * H5f90global.f90 + * type, its element and length must be the + * same as the types array defined in the + * H5f90global.F90 * lentypes - length of the types array, which must be the - * same as the length of types array defined - * in the H5f90global.f90 + * same as the length of types array defined + * in the H5f90global.F90 * floatingtypes - array with the predefined Floating Fortran - * type, its element and length must be the - * same as the floatingtypes array defined in the - * H5f90global.f90 + * type, its element and length must be the + * same as the floatingtypes array defined in the + * H5f90global.F90 * floatinglen - length of the floatingtypes array, which must be the - * same as the length of floatingtypes array defined - * in the H5f90global.f90 + * same as the length of floatingtypes array defined + * in the H5f90global.F90 * integertypes - array with the predefined Integer Fortran - * type, its element and length must be the - * same as the integertypes array defined in the - * H5f90global.f90 + * type, its element and length must be the + * same as the integertypes array defined in the + * H5f90global.F90 * integerlen - length of the floatingtypes array, which must be the - * same as the length of floatingtypes array defined - * in the H5f90global.f90 + * same as the length of floatingtypes array defined + * in the H5f90global.F90 * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR - * Elena Pourmal - * Tuesday, August 3, 1999 + * Elena Pourmal + * Tuesday, August 3, 1999 * SOURCE */ int_f -nh5close_types_c( hid_t_f * types, int_f *lentypes, +h5close_types_c( hid_t_f * types, int_f *lentypes, hid_t_f * floatingtypes, int_f* floatinglen, hid_t_f * integertypes, int_f * integerlen ) /******/ @@ -310,16 +377,16 @@ nh5close_types_c( hid_t_f * types, int_f *lentypes, int i; for (i = 0; i < *lentypes; i++) { - c_type_id = types[i]; - if ( H5Tclose(c_type_id) < 0) return ret_value; + c_type_id = types[i]; + if ( H5Tclose(c_type_id) < 0) return ret_value; } for (i = 0; i < *floatinglen; i++) { - c_type_id = floatingtypes[i]; - if ( H5Tclose(c_type_id) < 0) return ret_value; + c_type_id = floatingtypes[i]; + if ( H5Tclose(c_type_id) < 0) return ret_value; } for (i = 0; i < *integerlen; i++) { - c_type_id = integertypes[i]; - if ( H5Tclose(c_type_id) < 0) return ret_value; + c_type_id = integertypes[i]; + if ( H5Tclose(c_type_id) < 0) return ret_value; } ret_value = 0; return ret_value; @@ -368,7 +435,7 @@ nh5close_types_c( hid_t_f * types, int_f *lentypes, * SOURCE */ int_f -nh5init_flags_c( int_f *h5d_flags, size_t_f *h5d_size_flags, +h5init_flags_c( int_f *h5d_flags, size_t_f *h5d_size_flags, int_f *h5e_flags, hid_t_f *h5e_hid_flags, int_f *h5f_flags, int_f *h5fd_flags, hid_t_f *h5fd_hid_flags, int_f *h5g_flags, int_f *h5i_flags, int_f *h5l_flags, int_f *h5o_flags, @@ -524,11 +591,11 @@ nh5init_flags_c( int_f *h5d_flags, size_t_f *h5d_size_flags, h5o_flags[6] = (int_f)H5O_COPY_ALL; /* All object copying flags (for internal checking) */ /* Flags for shared message indexes. - * Pass these flags in using the mesg_type_flags parameter in + * Pass these flags in using the mesg_type_flags parameter in * H5P_set_shared_mesg_index. * (Developers: These flags correspond to object header message type IDs, - * but we need to assign each kind of message to a different bit so that - * one index can hold multiple types.) + * but we need to assign each kind of message to a different bit so that + * one index can hold multiple types.) */ h5o_flags[7] = (int_f)H5O_SHMESG_NONE_FLAG; /* No shared messages */ h5o_flags[8] = (int_f)H5O_SHMESG_SDSPACE_FLAG; /* Simple Dataspace Message. */ @@ -547,7 +614,7 @@ nh5init_flags_c( int_f *h5d_flags, size_t_f *h5d_size_flags, h5o_flags[19] = (int_f)H5O_HDR_ALL_FLAGS; /* Maximum shared message values. Number of indexes is 8 to allow room to add - * new types of messages. + * new types of messages. */ h5o_flags[20] = (int_f)H5O_SHMESG_MAX_NINDEXES; h5o_flags[21] = (int_f)H5O_SHMESG_MAX_LIST_SIZE; @@ -689,7 +756,7 @@ nh5init_flags_c( int_f *h5d_flags, size_t_f *h5d_size_flags, /* - * H5 Generic flags introduced in version 1.8 -MSB- + * H5 Generic flags introduced in version 1.8 */ /* H5_index_t enum struct */ @@ -713,7 +780,7 @@ nh5init_flags_c( int_f *h5d_flags, size_t_f *h5d_size_flags, } int_f -nh5init1_flags_c(int_f *h5lib_flags) +h5init1_flags_c(int_f *h5lib_flags) /******/ { int ret_value = -1; @@ -727,19 +794,19 @@ nh5init1_flags_c(int_f *h5lib_flags) /****if* H5_f/h5open_c * NAME - * h5open_c + * h5open_c * PURPOSE - * Calls H5open call to initialize C HDF5 library + * Calls H5open call to initialize C HDF5 library * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR - * Elena Pourmal - * Friday, November 17, 2000 + * Elena Pourmal + * Friday, November 17, 2000 * * SOURCE */ int_f -nh5open_c(void) +h5open_c(void) /******/ { int ret_value = -1; @@ -750,17 +817,17 @@ nh5open_c(void) } /****if* H5_f/h5close_c * NAME - * h5close_c + * h5close_c * PURPOSE - * Calls H5close call to close C HDF5 library + * Calls H5close call to close C HDF5 library * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR - * Elena Pourmal + * Elena Pourmal * SOURCE */ int_f -nh5close_c(void) +h5close_c(void) /******/ { int ret_value = -1; @@ -772,28 +839,28 @@ nh5close_c(void) /****if* H5_f/h5get_libversion_c * NAME - * h5get_libversion_c + * h5get_libversion_c * PURPOSE - * Calls H5get_libversion function + * Calls H5get_libversion function * to retrieve library version info. * INPUTS * - * None + * None * OUTPUTS * - * majnum - the major version of the library - * minnum - the minor version of the library - * relnum - the release version of the library + * majnum - the major version of the library + * minnum - the minor version of the library + * relnum - the release version of the library * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR - * Elena Pourmal - * Tuesday, September 24, 2002 + * Elena Pourmal + * Tuesday, September 24, 2002 * SOURCE * */ int_f -nh5get_libversion_c(int_f *majnum, int_f *minnum, int_f *relnum) +h5get_libversion_c(int_f *majnum, int_f *minnum, int_f *relnum) /******/ { @@ -811,27 +878,27 @@ nh5get_libversion_c(int_f *majnum, int_f *minnum, int_f *relnum) /****if* H5_f/h5check_version_c * NAME - * h5check_version_c + * h5check_version_c * PURPOSE - * Calls H5check_version function + * Calls H5check_version function * to verify library version info. * INPUTS * - * majnum - the major version of the library - * minnum - the minor version of the library - * relnum - the release version of the library + * majnum - the major version of the library + * minnum - the minor version of the library + * relnum - the release version of the library * OUTPUTS * - * None + * None * RETURNS - * 0 on success, aborts on failure + * 0 on success, aborts on failure * AUTHOR - * Elena Pourmal - * Tuesday, September 24, 2002 + * Elena Pourmal + * Tuesday, September 24, 2002 * SOURCE */ int_f -nh5check_version_c(int_f *majnum, int_f *minnum, int_f *relnum) +h5check_version_c(int_f *majnum, int_f *minnum, int_f *relnum) /******/ { int ret_value = -1; @@ -849,18 +916,18 @@ nh5check_version_c(int_f *majnum, int_f *minnum, int_f *relnum) /****if* H5_f/h5garbage_collect_c * NAME - * h5garbage_collect_c + * h5garbage_collect_c * PURPOSE - * Calls H5garbage_collect to collect on all free-lists of all types + * Calls H5garbage_collect to collect on all free-lists of all types * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR - * Elena Pourmal - * Tuesday, September 24, 2002 + * Elena Pourmal + * Tuesday, September 24, 2002 * SOURCE */ int_f -nh5garbage_collect_c(void) +h5garbage_collect_c(void) /******/ { int ret_value = -1; @@ -872,18 +939,18 @@ nh5garbage_collect_c(void) /****if* H5_f/h5dont_atexit_c * NAME - * h5dont_atexit_c + * h5dont_atexit_c * PURPOSE - * Calls H5dont_atexit not to install atexit cleanup routine + * Calls H5dont_atexit not to install atexit cleanup routine * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR - * Elena Pourmal - * Tuesday, September 24, 2002 + * Elena Pourmal + * Tuesday, September 24, 2002 * SOURCE */ int_f -nh5dont_atexit_c(void) +h5dont_atexit_c(void) /******/ { int ret_value = -1; diff --git a/fortran/src/H5_ff.F90 b/fortran/src/H5_ff.F90 new file mode 100644 index 0000000..39e23a7 --- /dev/null +++ b/fortran/src/H5_ff.F90 @@ -0,0 +1,451 @@ +!****h* ROBODoc/H5LIB +! +! NAME +! MODULE H5LIB +! +! PURPOSE +! This module provides fortran specific helper functions for the HDF library +! +! 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. * +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! +! NOTES +! _____ __ __ _____ ____ _____ _______ _ _ _______ +! |_ _| \/ | __ \ / __ \| __ \__ __|/\ | \ | |__ __| +! **** | | | \ / | |__) | | | | |__) | | | / \ | \| | | | **** +! **** | | | |\/| | ___/| | | | _ / | | / /\ \ | . ` | | | **** +! **** _| |_| | | | | | |__| | | \ \ | |/ ____ \| |\ | | | **** +! |_____|_| |_|_| \____/|_| \_\ |_/_/ \_\_| \_| |_| +! +! If you add a new function you must add the function name to the +! Windows dll file 'hdf5_fortrandll.def.in' in the fortran/src directory. +! This is needed for Windows based operating systems. +! +!***** + +#include + +MODULE H5LIB + + USE, INTRINSIC :: ISO_C_BINDING, ONLY : c_ptr, C_INTPTR_T + USE H5GLOBAL + IMPLICIT NONE + +CONTAINS +!****s* H5LIB/h5open_f +! +! NAME +! h5open_f +! +! PURPOSE +! Initializes HDF5 Fortran interface. +! +! Outputs: +! error - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). February 28, 2001 +! +! Removed call to h5open_c since this may cause a problem for an +! application that uses HDF5 library outside HDF5 Fortran APIs. +! October 13, 2011 +! Fortran90 Interface: + SUBROUTINE h5open_f(error) + IMPLICIT NONE + INTEGER, INTENT(OUT) :: error +!***** + INTEGER :: error_1, error_2, error_3 + + INTERFACE + INTEGER FUNCTION h5init_types_c(p_types, f_types, i_types) & + BIND(C,NAME='h5init_types_c') + IMPORT :: HID_T + IMPORT :: PREDEF_TYPES_LEN, FLOATING_TYPES_LEN, INTEGER_TYPES_LEN + IMPLICIT NONE + INTEGER(HID_T), DIMENSION(PREDEF_TYPES_LEN) :: p_types + INTEGER(HID_T), DIMENSION(FLOATING_TYPES_LEN) :: f_types + INTEGER(HID_T), DIMENSION(INTEGER_TYPES_LEN) :: i_types + END FUNCTION h5init_types_c + END INTERFACE + INTERFACE + INTEGER FUNCTION h5init_flags_c(i_H5D_flags, & + i_H5D_size_flags,& + i_H5E_flags, & + i_H5E_hid_flags, & + i_H5F_flags, & + i_H5FD_flags, & + i_H5FD_hid_flags, & + i_H5G_flags, & + i_H5I_flags, & + i_H5L_flags, & + i_H5O_flags, & + i_H5P_flags, & + i_H5P_flags_int, & + i_H5R_flags, & + i_H5S_flags, & + i_H5S_hsize_flags, & + i_H5T_flags, & + i_H5Z_flags, & + i_H5generic_flags) & + BIND(C,NAME='h5init_flags_c') + IMPORT :: HID_T, SIZE_T, HSIZE_T + IMPORT :: H5D_FLAGS_LEN, H5D_SIZE_FLAGS_LEN, & + H5E_FLAGS_LEN, H5E_HID_FLAGS_LEN, & + H5F_FLAGS_LEN, H5G_FLAGS_LEN, H5FD_FLAGS_LEN, & + H5FD_HID_FLAGS_LEN, H5I_FLAGS_LEN, H5L_FLAGS_LEN, & + H5O_FLAGS_LEN, H5P_FLAGS_LEN, H5P_FLAGS_INT_LEN, & + H5R_FLAGS_LEN, H5S_FLAGS_LEN, H5S_HSIZE_FLAGS_LEN, & + H5T_FLAGS_LEN, H5Z_FLAGS_LEN, H5generic_FLAGS_LEN + IMPLICIT NONE + INTEGER i_H5D_flags(H5D_FLAGS_LEN) + INTEGER(SIZE_T) i_H5D_size_flags(H5D_SIZE_FLAGS_LEN) + INTEGER i_H5E_flags(H5E_FLAGS_LEN) + INTEGER(HID_T) i_H5E_hid_flags(H5E_HID_FLAGS_LEN) + INTEGER i_H5F_flags(H5F_FLAGS_LEN) + INTEGER i_H5G_flags(H5G_FLAGS_LEN) + INTEGER i_H5FD_flags(H5FD_FLAGS_LEN) + INTEGER(HID_T) i_H5FD_hid_flags(H5FD_HID_FLAGS_LEN) + INTEGER i_H5I_flags(H5I_FLAGS_LEN) + INTEGER i_H5L_flags(H5L_FLAGS_LEN) + INTEGER i_H5O_flags(H5O_FLAGS_LEN) + INTEGER(HID_T) i_H5P_flags(H5P_FLAGS_LEN) + INTEGER i_H5P_flags_int(H5P_FLAGS_INT_LEN) + INTEGER i_H5R_flags(H5R_FLAGS_LEN) + INTEGER i_H5S_flags(H5S_FLAGS_LEN) + INTEGER(HSIZE_T) i_H5S_hsize_flags(H5S_HSIZE_FLAGS_LEN) + INTEGER i_H5T_flags(H5T_FLAGS_LEN) + INTEGER i_H5Z_flags(H5Z_FLAGS_LEN) + INTEGER i_H5generic_flags(H5generic_FLAGS_LEN) + END FUNCTION h5init_flags_c + END INTERFACE + INTERFACE + INTEGER FUNCTION h5init1_flags_c( i_H5LIB_flags ) & + BIND(C,NAME='h5init1_flags_c') + IMPORT :: H5LIB_FLAGS_LEN + IMPLICIT NONE + INTEGER i_H5LIB_flags(H5LIB_FLAGS_LEN) + END FUNCTION h5init1_flags_c + END INTERFACE + error_1 = h5init_types_c(predef_types, floating_types, integer_types) + error_2 = h5init_flags_c(H5D_flags, & + H5D_size_flags, & + H5E_flags, & + H5E_hid_flags, & + H5F_flags, & + H5FD_flags, & + H5FD_hid_flags, & + H5G_flags, & + H5I_flags, & + H5L_flags, & + H5O_flags, & + H5P_flags, & + H5P_flags_int, & + H5R_flags, & + H5S_flags, & + H5S_hsize_flags, & + H5T_flags, & + H5Z_flags, & + H5generic_flags) + error_3 = h5init1_flags_c(H5LIB_flags ) + error = error_1 + error_2 + error_3 + END SUBROUTINE h5open_f + +!****s* H5LIB/h5close_f +! +! NAME +! h5close_f +! +! PURPOSE +! Closes HDF5 Fortran interface. +! +! Outputs: +! error - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). February 28, 2001 +! +! Removed call to h5close_c since this may cause a problem for an +! application that uses HDF5 library outside HDF5 Fortran APIs. +! October 13, 2011 +! Fortran90 Interface: + SUBROUTINE h5close_f(error) + IMPLICIT NONE + INTEGER, INTENT(OUT) :: error +!***** + INTEGER :: error_1 + INTERFACE + INTEGER FUNCTION h5close_types_c(p_types, P_TYPES_LEN, & + f_types, F_TYPES_LEN, & + i_types, I_TYPES_LEN ) & + BIND(C,NAME='h5close_types_c') + IMPORT :: HID_T + INTEGER P_TYPES_LEN + INTEGER F_TYPES_LEN + INTEGER I_TYPES_LEN + INTEGER(HID_T), DIMENSION(P_TYPES_LEN) :: p_types + INTEGER(HID_T), DIMENSION(F_TYPES_LEN) :: f_types + INTEGER(HID_T), DIMENSION(I_TYPES_LEN) :: i_types + END FUNCTION h5close_types_c + END INTERFACE + error_1 = h5close_types_c(predef_types, PREDEF_TYPES_LEN, & + floating_types, FLOATING_TYPES_LEN, & + integer_types, INTEGER_TYPES_LEN ) + error = error_1 + + END SUBROUTINE h5close_f + +!****s* H5LIB/h5get_libversion_f +! +! NAME +! h5get_libversion_f +! +! PURPOSE +! Returns the HDF5 LIbrary release number +! +! Outputs: +! majnum - major version of the library +! minum - minor version of the library +! relnum - release version of the library +! error - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! September 24, 2002 +! +! Fortran90 Interface: + SUBROUTINE h5get_libversion_f(majnum, minnum, relnum, error) + IMPLICIT NONE + INTEGER, INTENT(OUT) :: majnum, minnum, relnum, error +!***** + INTERFACE + INTEGER FUNCTION h5get_libversion_c(majnum, minnum, relnum) & + BIND(C,NAME='h5get_libversion_c') + IMPLICIT NONE + INTEGER, INTENT(OUT) :: majnum, minnum, relnum + END FUNCTION h5get_libversion_c + END INTERFACE + + error = h5get_libversion_c(majnum, minnum, relnum) + + END SUBROUTINE h5get_libversion_f + +!****s* H5LIB/h5check_version_f +! +! NAME +! h5check_version_f +! +! PURPOSE +! Verifies that library versions are consistent. +! +! Inputs: +! majnum - major version of the library +! minum - minor version of the library +! relnum - release version of the library +! +! Outputs: +! error - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! September 24, 2002 +! +! Fortran90 Interface: + SUBROUTINE h5check_version_f(majnum, minnum, relnum, error) + IMPLICIT NONE + INTEGER, INTENT(IN) :: majnum, minnum, relnum + INTEGER, INTENT(OUT) :: error +!***** + INTERFACE + INTEGER FUNCTION h5check_version_c(majnum, minnum, relnum) & + BIND(C,NAME='h5check_version_c') + IMPLICIT NONE + INTEGER, INTENT(IN) :: majnum, minnum, relnum + END FUNCTION h5check_version_c + END INTERFACE + + error = h5check_version_c(majnum, minnum, relnum) + + END SUBROUTINE h5check_version_f +!****s* H5LIB/h5garbage_collect_f +! +! NAME +! h5garbage_collect_f +! +! PURPOSE +! Garbage collects on all free-lists of all types. +! +! Outputs: +! error - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! September 24, 2002 +! +! Fortran90 Interface: + SUBROUTINE h5garbage_collect_f(error) + IMPLICIT NONE + INTEGER, INTENT(OUT) :: error +!***** + INTERFACE + INTEGER FUNCTION h5garbage_collect_c() & + BIND(C,NAME='h5garbage_collect_c') + END FUNCTION h5garbage_collect_c + END INTERFACE + + error = h5garbage_collect_c() + + END SUBROUTINE h5garbage_collect_f +!****s* H5LIB/h5dont_atexit_f +! +! NAME +! h5dont_atexit_f +! +! PURPOSE +! Instructs library not to install atexit cleanup routine. +! +! Outputs: +! error - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! September 24, 2002 +! +! Fortran90 Interface: + SUBROUTINE h5dont_atexit_f(error) + IMPLICIT NONE + INTEGER, INTENT(OUT) :: error +!***** + INTERFACE + INTEGER FUNCTION h5dont_atexit_c() & + BIND(C,NAME='h5dont_atexit_c') + END FUNCTION h5dont_atexit_c + END INTERFACE + + error = h5dont_atexit_c() + + END SUBROUTINE h5dont_atexit_f + +!****f* H5LIB/h5kind_to_type +! +! NAME +! h5kind_to_type +! +! PURPOSE +! Converts the KIND to the correct HDF type +! +! Inputs: +! kind - Fortran KIND parameter +! flag - Whether KIND is of type INTEGER or REAL: +! H5_INTEGER_KIND - integer +! H5_REAL_KIND - real +! Outputs: +! h5_type - Returns the type +! +! AUTHOR +! M. Scot Breitenfeld +! August 25, 2008 +! +! Fortran90 Interface: + INTEGER(HID_T) FUNCTION h5kind_to_type(kind, flag) RESULT(h5_type) + IMPLICIT NONE + INTEGER, INTENT(IN) :: kind + INTEGER, INTENT(IN) :: flag +!***** + IF(flag.EQ.H5_INTEGER_KIND)THEN + IF(kind.EQ.Fortran_INTEGER_1)THEN + h5_type = H5T_NATIVE_INTEGER_1 + ELSE IF(kind.EQ.Fortran_INTEGER_2)THEN + h5_type = H5T_NATIVE_INTEGER_2 + ELSE IF(kind.EQ.Fortran_INTEGER_4)THEN + h5_type = H5T_NATIVE_INTEGER_4 + ELSE IF(kind.EQ.Fortran_INTEGER_8)THEN + h5_type = H5T_NATIVE_INTEGER_8 +#if H5_HAVE_Fortran_INTEGER_SIZEOF_16!=0 + ELSE IF(kind.EQ.Fortran_INTEGER_16)THEN + h5_type = H5T_NATIVE_INTEGER_16 +#endif + ENDIF + ELSE IF(flag.EQ.H5_REAL_KIND)THEN + IF(kind.EQ.Fortran_REAL_C_FLOAT)THEN + h5_type = H5T_NATIVE_REAL_C_FLOAT + ELSE IF(kind.EQ.Fortran_REAL_C_DOUBLE)THEN + h5_type = H5T_NATIVE_REAL_C_DOUBLE +#if H5_FORTRAN_C_LONG_DOUBLE_IS_UNIQUE!=0 + ELSE IF(kind.EQ.Fortran_REAL_C_LONG_DOUBLE)THEN + h5_type = H5T_NATIVE_REAL_C_LONG_DOUBLE +#endif +#if H5_PAC_FC_MAX_REAL_PRECISION > 28 +#if H5_HAVE_FLOAT128 == 1 + ELSE IF(kind.EQ.Fortran_REAL_C_FLOAT128)THEN + h5_type = H5T_NATIVE_FLOAT_128 +#endif +#endif + ELSE + h5_type = -1 + ENDIF + ENDIF + + END FUNCTION h5kind_to_type + +!****f* H5LIB_PROVISIONAL/h5offsetof +! +! NAME +! h5offsetof +! +! PURPOSE +! Computes the offset in memory +! +! Inputs: +! start - starting pointer address +! end - ending pointer address +! +! Outputs: +! offset - offset of a member within the derived type +! +! AUTHOR +! M. Scot Breitenfeld +! Augest 25, 2008 +! +! ACKNOWLEDGEMENTS +! Joe Krahn +! +! Fortran2003 Interface: + FUNCTION h5offsetof(start,end) RESULT(offset) + IMPLICIT NONE + INTEGER(SIZE_T) :: offset + TYPE(C_PTR), VALUE, INTENT(IN) :: start, end +!***** + INTEGER(C_INTPTR_T) :: int_address_start, int_address_end + int_address_start = TRANSFER(start, int_address_start) + int_address_end = TRANSFER(end , int_address_end ) + + offset = int_address_end - int_address_start + + END FUNCTION h5offsetof + +END MODULE H5LIB diff --git a/fortran/src/H5_ff.f90 b/fortran/src/H5_ff.f90 deleted file mode 100644 index 49e64a3..0000000 --- a/fortran/src/H5_ff.f90 +++ /dev/null @@ -1,409 +0,0 @@ -!****h* ROBODoc/H5LIB -! -! NAME -! MODULE H5LIB -! -! PURPOSE -! This module provides fortran specific helper functions for the HDF library -! -! USES -! H5LIB_PROVISIONAL - This module provides helper functions for Fortran 2003 -! only features. If Fortran 2003 functions are enabled then -! H5_ff_F03.f90 is compiled, else H5_ff_F90.f90, -! which is just a place holder blank module, is compiled. -! 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. * -! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -! -! NOTES -! *** IMPORTANT *** -! If you add a new function you must add the function name to the -! Windows dll file 'hdf5_fortrandll.def.in' in the fortran/src directory. -! This is needed for Windows based operating systems. -! -!***** - -MODULE H5LIB - - USE H5LIB_PROVISIONAL ! helper functions for Fortran 2003 features: - ! pre-Fortran 2003 - empty module - ! Forttran 2003 - contains functions - USE H5GLOBAL - -CONTAINS -!****s* H5LIB/h5open_f -! -! NAME -! h5open_f -! -! PURPOSE -! Initializes HDF5 Fortran interface. -! -! Outputs: -! error - Returns 0 if successful and -1 if fails -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). February 28, 2001 -! -! Removed call to h5open_c since this may cause a problem for an -! application that uses HDF5 library outside HDF5 Fortran APIs. -! October 13, 2011 -! Fortran90 Interface: - SUBROUTINE h5open_f(error) - USE H5GLOBAL - IMPLICIT NONE - INTEGER, INTENT(OUT) :: error -!***** - INTEGER :: error_1, error_2, error_3 - - INTERFACE - INTEGER FUNCTION h5init_types_c(p_types, f_types, i_types) - USE H5GLOBAL - INTEGER(HID_T), DIMENSION(PREDEF_TYPES_LEN) :: p_types - INTEGER(HID_T), DIMENSION(FLOATING_TYPES_LEN) :: f_types - INTEGER(HID_T), DIMENSION(INTEGER_TYPES_LEN) :: i_types - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5INIT_TYPES_C'::h5init_types_c - !DEC$ENDIF - END FUNCTION h5init_types_c - END INTERFACE - INTERFACE - INTEGER FUNCTION h5init_flags_c(i_H5D_flags, & - i_H5D_size_flags,& - i_H5E_flags, & - i_H5E_hid_flags, & - i_H5F_flags, & - i_H5FD_flags, & - i_H5FD_hid_flags, & - i_H5G_flags, & - i_H5I_flags, & - i_H5L_flags, & - i_H5O_flags, & - i_H5P_flags, & - i_H5P_flags_int, & - i_H5R_flags, & - i_H5S_flags, & - i_H5S_hsize_flags, & - i_H5T_flags, & - i_H5Z_flags, & - i_H5generic_flags) - USE H5GLOBAL - INTEGER i_H5D_flags(H5D_FLAGS_LEN) - INTEGER(SIZE_T) i_H5D_size_flags(H5D_SIZE_FLAGS_LEN) - INTEGER i_H5E_flags(H5E_FLAGS_LEN) - INTEGER(HID_T) i_H5E_hid_flags(H5E_HID_FLAGS_LEN) - INTEGER i_H5F_flags(H5F_FLAGS_LEN) - INTEGER i_H5G_flags(H5G_FLAGS_LEN) - INTEGER i_H5FD_flags(H5FD_FLAGS_LEN) - INTEGER(HID_T) i_H5FD_hid_flags(H5FD_HID_FLAGS_LEN) - INTEGER i_H5I_flags(H5I_FLAGS_LEN) - INTEGER i_H5L_flags(H5L_FLAGS_LEN) - INTEGER i_H5O_flags(H5O_FLAGS_LEN) - INTEGER(HID_T) i_H5P_flags(H5P_FLAGS_LEN) - INTEGER i_H5P_flags_int(H5P_FLAGS_INT_LEN) - INTEGER i_H5R_flags(H5R_FLAGS_LEN) - INTEGER i_H5S_flags(H5S_FLAGS_LEN) - INTEGER(HSIZE_T) i_H5S_hsize_flags(H5S_HSIZE_FLAGS_LEN) - INTEGER i_H5T_flags(H5T_FLAGS_LEN) - INTEGER i_H5Z_flags(H5Z_FLAGS_LEN) - INTEGER i_H5generic_flags(H5generic_FLAGS_LEN) - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5INIT_FLAGS_C'::h5init_flags_c - !DEC$ENDIF - END FUNCTION h5init_flags_c - END INTERFACE - INTERFACE - INTEGER FUNCTION h5init1_flags_c( i_H5LIB_flags ) - USE H5GLOBAL - INTEGER i_H5LIB_flags(H5LIB_FLAGS_LEN) - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5INIT1_FLAGS_C'::h5init1_flags_c - !DEC$ENDIF - END FUNCTION h5init1_flags_c - END INTERFACE - error_1 = h5init_types_c(predef_types, floating_types, integer_types) - error_2 = h5init_flags_c(H5D_flags, & - H5D_size_flags, & - H5E_flags, & - H5E_hid_flags, & - H5F_flags, & - H5FD_flags, & - H5FD_hid_flags, & - H5G_flags, & - H5I_flags, & - H5L_flags, & - H5O_flags, & - H5P_flags, & - H5P_flags_int, & - H5R_flags, & - H5S_flags, & - H5S_hsize_flags, & - H5T_flags, & - H5Z_flags, & - H5generic_flags) - error_3 = h5init1_flags_c(H5LIB_flags ) - error = error_1 + error_2 + error_3 - END SUBROUTINE h5open_f - -!****s* H5LIB/h5close_f -! -! NAME -! h5close_f -! -! PURPOSE -! Closes HDF5 Fortran interface. -! -! Outputs: -! error - Returns 0 if successful and -1 if fails -! -! AUTHOR -! Elena Pourmal -! August 12, 1999 -! -! HISTORY -! Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). February 28, 2001 -! -! Removed call to h5close_c since this may cause a problem for an -! application that uses HDF5 library outside HDF5 Fortran APIs. -! October 13, 2011 -! Fortran90 Interface: - SUBROUTINE h5close_f(error) - USE H5GLOBAL - IMPLICIT NONE - INTEGER, INTENT(OUT) :: error -!***** - INTEGER :: error_1 - INTERFACE - INTEGER FUNCTION h5close_types_c(p_types, P_TYPES_LEN, & - f_types, F_TYPES_LEN, & - i_types, I_TYPES_LEN ) - USE H5GLOBAL - INTEGER P_TYPES_LEN - INTEGER F_TYPES_LEN - INTEGER I_TYPES_LEN - INTEGER(HID_T), DIMENSION(P_TYPES_LEN) :: p_types - INTEGER(HID_T), DIMENSION(F_TYPES_LEN) :: f_types - INTEGER(HID_T), DIMENSION(I_TYPES_LEN) :: i_types - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5CLOSE_TYPES_C'::h5close_types_c - !DEC$ENDIF - END FUNCTION h5close_types_c - END INTERFACE - error_1 = h5close_types_c(predef_types, PREDEF_TYPES_LEN, & - floating_types, FLOATING_TYPES_LEN, & - integer_types, INTEGER_TYPES_LEN ) - error = error_1 - - END SUBROUTINE h5close_f - -!****s* H5LIB/h5get_libversion_f -! -! NAME -! h5get_libversion_f -! -! PURPOSE -! Returns the HDF5 LIbrary release number -! -! Outputs: -! majnum - major version of the library -! minum - minor version of the library -! relnum - release version of the library -! error - Returns 0 if successful and -1 if fails -! -! AUTHOR -! Elena Pourmal -! September 24, 2002 -! -! Fortran90 Interface: - SUBROUTINE h5get_libversion_f(majnum, minnum, relnum, error) - USE H5GLOBAL - IMPLICIT NONE - INTEGER, INTENT(OUT) :: majnum, minnum, relnum, error -!***** - INTERFACE - INTEGER FUNCTION h5get_libversion_c(majnum, minnum, relnum) - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5GET_LIBVERSION_C'::h5get_libversion_c - !DEC$ENDIF - INTEGER, INTENT(OUT) :: majnum, minnum, relnum - END FUNCTION h5get_libversion_c - END INTERFACE - - error = h5get_libversion_c(majnum, minnum, relnum) - - END SUBROUTINE h5get_libversion_f - -!****s* H5LIB/h5check_version_f -! -! NAME -! h5check_version_f -! -! PURPOSE -! Verifies that library versions are consistent. -! -! Inputs: -! majnum - major version of the library -! minum - minor version of the library -! relnum - release version of the library -! -! Outputs: -! error - Returns 0 if successful and -1 if fails -! -! AUTHOR -! Elena Pourmal -! September 24, 2002 -! -! Fortran90 Interface: - SUBROUTINE h5check_version_f(majnum, minnum, relnum, error) - USE H5GLOBAL - IMPLICIT NONE - INTEGER, INTENT(IN) :: majnum, minnum, relnum - INTEGER, INTENT(OUT) :: error -!***** - INTERFACE - INTEGER FUNCTION h5check_version_c(majnum, minnum, relnum) - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5CHECK_VERSION_C'::h5check_version_c - !DEC$ENDIF - INTEGER, INTENT(IN) :: majnum, minnum, relnum - END FUNCTION h5check_version_c - END INTERFACE - - error = h5check_version_c(majnum, minnum, relnum) - - END SUBROUTINE h5check_version_f -!****s* H5LIB/h5garbage_collect_f -! -! NAME -! h5garbage_collect_f -! -! PURPOSE -! Garbage collects on all free-lists of all types. -! -! Outputs: -! error - Returns 0 if successful and -1 if fails -! -! AUTHOR -! Elena Pourmal -! September 24, 2002 -! -! Fortran90 Interface: - SUBROUTINE h5garbage_collect_f(error) - USE H5GLOBAL - IMPLICIT NONE - INTEGER, INTENT(OUT) :: error -!***** - INTERFACE - INTEGER FUNCTION h5garbage_collect_c() - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5GARBAGE_COLLECT_C'::h5garbage_collect_c - !DEC$ENDIF - END FUNCTION h5garbage_collect_c - END INTERFACE - - error = h5garbage_collect_c() - - END SUBROUTINE h5garbage_collect_f -!****s* H5LIB/h5dont_atexit_f -! -! NAME -! h5dont_atexit_f -! -! PURPOSE -! Instructs library not to install atexit cleanup routine. -! -! Outputs: -! error - Returns 0 if successful and -1 if fails -! -! AUTHOR -! Elena Pourmal -! September 24, 2002 -! -! Fortran90 Interface: - SUBROUTINE h5dont_atexit_f(error) - USE H5GLOBAL - IMPLICIT NONE - INTEGER, INTENT(OUT) :: error -!***** - INTERFACE - INTEGER FUNCTION h5dont_atexit_c() - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DONT_ATEXIT_C'::h5dont_atexit_c - !DEC$ENDIF - END FUNCTION h5dont_atexit_c - END INTERFACE - - error = h5dont_atexit_c() - - END SUBROUTINE h5dont_atexit_f - -!****f* H5LIB/h5kind_to_type -! -! NAME -! h5kind_to_type -! -! PURPOSE -! Converts the KIND to the correct HDF type -! -! Inputs: -! kind - Fortran KIND parameter -! flag - Whether KIND is of type INTEGER or REAL: -! H5_INTEGER_KIND - integer -! H5_REAL_KIND - real -! Outputs: -! h5_type - Returns the type -! -! AUTHOR -! M. Scot Breitenfeld -! August 25, 2008 -! -! Fortran90 Interface: - INTEGER(HID_T) FUNCTION h5kind_to_type(kind, flag) RESULT(h5_type) - USE H5GLOBAL - IMPLICIT NONE - INTEGER, INTENT(IN) :: kind - INTEGER, INTENT(IN) :: flag -!***** - IF(flag.EQ.H5_INTEGER_KIND)THEN - IF(kind.EQ.Fortran_INTEGER_1)THEN - h5_type = H5T_NATIVE_INTEGER_1 - ELSE IF(kind.EQ.Fortran_INTEGER_2)THEN - h5_type = H5T_NATIVE_INTEGER_2 - ELSE IF(kind.EQ.Fortran_INTEGER_4)THEN - h5_type = H5T_NATIVE_INTEGER_4 - ELSE IF(kind.EQ.Fortran_INTEGER_8)THEN - h5_type = H5T_NATIVE_INTEGER_8 - ENDIF - ELSE IF(flag.EQ.H5_REAL_KIND)THEN - IF(kind.EQ.Fortran_REAL_4)THEN - h5_type = H5T_NATIVE_REAL_4 - ELSE IF(kind.EQ.Fortran_REAL_8)THEN - h5_type = H5T_NATIVE_REAL_8 - ELSE IF(kind.EQ.Fortran_REAL_16)THEN - h5_type = H5T_NATIVE_REAL_16 - ENDIF - ENDIF - - END FUNCTION h5kind_to_type - -END MODULE H5LIB diff --git a/fortran/src/H5_ff_F03.f90 b/fortran/src/H5_ff_F03.f90 deleted file mode 100644 index d418ed5..0000000 --- a/fortran/src/H5_ff_F03.f90 +++ /dev/null @@ -1,75 +0,0 @@ -!****h* ROBODoc/H5LIB_PROVISIONAL -! -! NAME -! MODULE H5LIB_PROVISIONAL -! -! PURPOSE -! This file contains helper functions for Fortran 2003 features and is -! only compiled when Fortran 2003 features are enabled, otherwise -! the file H5_ff_F90.f90 is compiled. -! -! 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. * -! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -! -! NOTES -! *** IMPORTANT *** -! If you add a new function you must add the function name to the -! Windows dll file 'hdf5_fortrandll.def.in' in the fortran/src directory. -! This is needed for Windows based operating systems. -!***** - -MODULE H5LIB_PROVISIONAL - -CONTAINS -!****f* H5LIB_PROVISIONAL/h5offsetof -! -! NAME -! h5offsetof -! -! PURPOSE -! Computes the offset in memory -! -! Inputs: -! start - starting pointer address -! end - ending pointer address -! -! Outputs: -! offset - offset of a member within the derived type -! -! AUTHOR -! M. Scot Breitenfeld -! Augest 25, 2008 -! -! ACKNOWLEDGEMENTS -! Joe Krahn -! -! Fortran2003 Interface: - FUNCTION h5offsetof(start,end) RESULT(offset) - USE, INTRINSIC :: ISO_C_BINDING - USE H5GLOBAL - IMPLICIT NONE - INTEGER(SIZE_T) :: offset - TYPE(C_PTR), VALUE, INTENT(IN) :: start, end -!***** - INTEGER(C_INTPTR_T) :: int_address_start, int_address_end - int_address_start = TRANSFER(start, int_address_start) - int_address_end = TRANSFER(end , int_address_end ) - - offset = int_address_end - int_address_start - - END FUNCTION h5offsetof - -END MODULE H5LIB_PROVISIONAL diff --git a/fortran/src/H5_ff_F90.f90 b/fortran/src/H5_ff_F90.f90 deleted file mode 100644 index a5d303a..0000000 --- a/fortran/src/H5_ff_F90.f90 +++ /dev/null @@ -1,34 +0,0 @@ -!****h* ROBODoc/H5LIB_PROVISIONAL (F90) -! -! NAME -! MODULE H5LIB_PROVISIONAL -! -! FILE -! fortran/src/H5_ff_F90.f90 -! -! PURPOSE -! This file is a dummy module for when Fortran 2003 features are not enabled. -! It is compiled in place of H5_ff_F03.f90 and is empty. -! -! 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. * -! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -! -!***** - -MODULE H5LIB_PROVISIONAL - - -END MODULE H5LIB_PROVISIONAL diff --git a/fortran/src/H5config_f.inc.cmake b/fortran/src/H5config_f.inc.cmake new file mode 100644 index 0000000..cc36889 --- /dev/null +++ b/fortran/src/H5config_f.inc.cmake @@ -0,0 +1,84 @@ +! fortran/src/H5config_f.inc. Generated from fortran/src/H5config_f.inc.in by configure + +! Define if we have parallel support +#define H5_HAVE_PARALLEL @CMAKE_H5_HAVE_PARALLEL@ + +#if H5_HAVE_PARALLEL==0 +#undef H5_HAVE_PARALLEL +#endif + +! Define if the intrinsic function STORAGE_SIZE exists +#define H5_FORTRAN_HAVE_STORAGE_SIZE @FORTRAN_HAVE_STORAGE_SIZE@ + +#if H5_FORTRAN_HAVE_STORAGE_SIZE==0 +#undef H5_FORTRAN_HAVE_STORAGE_SIZE +#endif + +! Define if the intrinsic function SIZEOF exists +#define H5_FORTRAN_HAVE_SIZEOF @FORTRAN_HAVE_SIZEOF@ + +#if H5_FORTRAN_HAVE_SIZEOF==0 +#undef H5_FORTRAN_HAVE_SIZEOF +#endif + +! Define if the intrinsic function C_SIZEOF exists +#define H5_FORTRAN_HAVE_C_SIZEOF @FORTRAN_HAVE_C_SIZEOF@ + +#if H5_FORTRAN_HAVE_C_SIZEOF==0 +#undef H5_FORTRAN_HAVE_C_SIZEOF +#endif + +! Define if the intrinsic C_LONG_DOUBLE exists +#define H5_FORTRAN_HAVE_C_LONG_DOUBLE @FORTRAN_HAVE_C_LONG_DOUBLE@ + +#if H5_FORTRAN_HAVE_C_LONG_DOUBLE==0 +#undef H5_FORTRAN_HAVE_C_LONG_DOUBLE +#endif + +! Define if Fortran C_LONG_DOUBLE is different from C_DOUBLE +#define H5_FORTRAN_C_LONG_DOUBLE_IS_UNIQUE @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ + +! Define if the intrinsic module ISO_FORTRAN_ENV exists +#define H5_HAVE_ISO_FORTRAN_ENV @HAVE_ISO_FORTRAN_ENV@ + + +! should this be ${HDF_PREFIX} instead of H5 MSB +#define H5_SIZEOF_DOUBLE @H5_SIZEOF_DOUBLE@ + +#if H5_SIZEOF_DOUBLE==0 +#undef H5_SIZEOF_DOUBLE +#endif + +! should this be ${HDF_PREFIX} instead of H5 MSB +#define H5_SIZEOF_LONG_DOUBLE @H5_SIZEOF_LONG_DOUBLE@ + +#if H5_SIZEOF_LONG_DOUBLE==0 +#undef H5_SIZEOF_LONG_DOUBLE +#endif + +! Define the maximum decimal precision for reals +#define H5_PAC_FC_MAX_REAL_PRECISION @H5_PAC_FC_MAX_REAL_PRECISION@ + +! If C has quad precision +#define H5_HAVE_FLOAT128 @H5_HAVE_FLOAT128@ + +! Define if INTEGER*16 is available +#define H5_HAVE_Fortran_INTEGER_SIZEOF_16 @HAVE_Fortran_INTEGER_SIZEOF_16@ + +! Maximum decimal precision for C +#define H5_PAC_C_MAX_REAL_PRECISION @H5_PAC_C_MAX_REAL_PRECISION@ + +! number of valid REAL KINDs +#define H5_H5CONFIG_F_NUM_RKIND @H5CONFIG_F_NUM_RKIND@ + +! valid REAL KINDs (need to have a matching C counter-part) +#define H5_H5CONFIG_F_RKIND @H5CONFIG_F_RKIND@ + +! valid REAL KINDs (need to have a matching C counter-part) +#define H5_H5CONFIG_F_RKIND_SIZEOF @H5CONFIG_F_RKIND_SIZEOF@ + +! number of valid INTEGER KINDs +#define H5_H5CONFIG_F_NUM_IKIND @H5CONFIG_F_NUM_IKIND@ + +! valid INTEGER KINDs (need to have a matching C counter-part) +#define H5_H5CONFIG_F_IKIND @H5CONFIG_F_IKIND@ diff --git a/fortran/src/H5config_f.inc.in b/fortran/src/H5config_f.inc.in new file mode 100644 index 0000000..64c3a0c --- /dev/null +++ b/fortran/src/H5config_f.inc.in @@ -0,0 +1,59 @@ +! fortran/src/H5config_f.inc. Generated from fortran/src/H5config_f.inc.in by configure + +! The script to replace the defines in H5config_f.inc.in is +! located in configure.ac in the Fortran section. + +! Define if we have parallel support +#undef HAVE_PARALLEL + +! Define if the intrinsic function STORAGE_SIZE exists +#undef FORTRAN_HAVE_STORAGE_SIZE + +! Define if the intrinsic function SIZEOF exists +#undef FORTRAN_HAVE_SIZEOF + +! Define if the intrinsic function C_SIZEOF exists +#undef FORTRAN_HAVE_C_SIZEOF + +! Define if the intrinsic function C_LONG_DOUBLE exists +#undef FORTRAN_HAVE_C_LONG_DOUBLE + +! Define if Fortran C_LONG_DOUBLE is different from C_DOUBLE +#undef FORTRAN_C_LONG_DOUBLE_IS_UNIQUE + +! Define if the intrinsic module ISO_FORTRAN_ENV exists +#undef HAVE_ISO_FORTRAN_ENV + +! Define the size of C's long double +#undef SIZEOF_DOUBLE + +! Define the size of C's long double +#undef SIZEOF_LONG_DOUBLE + +! Define the maximum decimal precision for reals +#undef PAC_FC_MAX_REAL_PRECISION + +! If C has quad precision +#undef HAVE_FLOAT128 + +! Define if INTEGER*16 is available +#undef HAVE_Fortran_INTEGER_SIZEOF_16 + +! Maximum decimal precision for C +#undef PAC_C_MAX_REAL_PRECISION + +! number of valid REAL KINDs +#undef H5CONFIG_F_NUM_RKIND + +! valid REAL KINDs (need to have a matching C counter-part) +#undef H5CONFIG_F_RKIND + +! valid REAL KINDs (need to have a matching C counter-part) +#undef H5CONFIG_F_RKIND_SIZEOF + +! number of valid INTEGER KINDs +#undef H5CONFIG_F_NUM_IKIND + +! valid INTEGER KINDs (need to have a matching C counter-part) +#undef H5CONFIG_F_IKIND + diff --git a/fortran/src/H5f90global.F90 b/fortran/src/H5f90global.F90 new file mode 100644 index 0000000..c88327c --- /dev/null +++ b/fortran/src/H5f90global.F90 @@ -0,0 +1,1040 @@ +!****h* ROBODoc/H5GLOBAL +! +! NAME +! MODULE H5GLOBAL +! +! FILE +! src/fortran/H5f90global.f90 +! +! PURPOSE +! This module is used to pass C stubs for H5 Fortran APIs. The C stubs are +! packed into arrays in H5_f.c and these arrays are then passed to Fortran. +! This module then uses EQUIVALENCE to assign elements of the arrays to +! Fortran equivalent C stubs. +! +! NOTES +! The size of the C arrays in H5_f.c has to match the values of the variables +! declared as PARAMETER, hence if the size of an array in H5_f.c is changed +! then the PARAMETER of that corresponding array in Fortran must also be changed. +! +! USES +! H5FORTRAN_TYPES - This module is generated at run time. See +! +! 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 +! Elena Pourmal +! +!***** + +MODULE H5GLOBAL + USE H5FORTRAN_TYPES + + IMPLICIT NONE + + ! Definitions for reference datatypes. + ! If you change the value of these parameters, do not forget to change corresponding + ! values in the H5f90.h file. + INTEGER, PARAMETER :: REF_REG_BUF_LEN = 3 + + ! Parameters used in the function 'h5kind_to_type' located in H5_ff.f90. + ! The flag is used to tell the function whether the kind input variable + ! is for a REAL or INTEGER data type. + + INTEGER, PARAMETER :: H5_REAL_KIND = 1 + INTEGER, PARAMETER :: H5_INTEGER_KIND = 0 + + TYPE :: hobj_ref_t_f + INTEGER(HADDR_T) ref + END TYPE hobj_ref_t_f + + TYPE :: hdset_reg_ref_t_f + INTEGER, DIMENSION(1:REF_REG_BUF_LEN) :: ref + END TYPE hdset_reg_ref_t_f + + INTEGER, PARAMETER :: PREDEF_TYPES_LEN = 19 ! Do not forget to change this + ! value when new predefined + ! datatypes are added + + ! Do not forget to change the following line when new predefined + ! floating data types are added + INTEGER, PARAMETER :: FLOATING_TYPES_LEN = 4 + + ! Do not forget to change the following line when new predefined + ! integer data types are added + INTEGER, PARAMETER :: INTEGER_TYPES_LEN = 27 + + INTEGER(HID_T) :: H5T_NATIVE_INTEGER_1, & + H5T_NATIVE_INTEGER_2, & + H5T_NATIVE_INTEGER_4, & + H5T_NATIVE_INTEGER_8, & + H5T_NATIVE_REAL_C_FLOAT, & + H5T_NATIVE_REAL_C_DOUBLE, & + H5T_NATIVE_REAL_C_LONG_DOUBLE, & + H5T_NATIVE_INTEGER, & + H5T_NATIVE_REAL, & + H5T_NATIVE_DOUBLE, & + H5T_NATIVE_CHARACTER , & + H5T_STD_REF_OBJ, & + H5T_STD_REF_DSETREG, & + H5T_IEEE_F32BE, & + H5T_IEEE_F32LE, & + H5T_IEEE_F64BE, & + H5T_IEEE_F64LE, & + H5T_STD_I8BE, & + H5T_STD_I8LE, & + H5T_STD_I16BE, & + H5T_STD_I16LE, & + H5T_STD_I32BE, & + H5T_STD_I32LE, & + H5T_STD_I64BE, & + H5T_STD_I64LE, & + H5T_STD_U8BE, & + H5T_STD_U8LE, & + H5T_STD_U16BE, & + H5T_STD_U16LE, & + H5T_STD_U32BE + + INTEGER(HID_T) :: H5T_NATIVE_INTEGER_16 ! NEED IFDEF -MSB- + INTEGER(HID_T) :: H5T_NATIVE_FLOAT_128 ! NEED IFDEF -MSB- + +! NOTE: Splitting the line since the Fortran 95 standard limits the number of +! continuation lines to 39; the F03/F08 standard limits the number +! to 255 lines. + + INTEGER(HID_T) :: H5T_STD_U32LE, & + H5T_STD_U64BE, & + H5T_STD_U64LE, & + H5T_STRING, & + H5T_STD_B8BE, & + H5T_STD_B8LE, & + H5T_STD_B16BE, & + H5T_STD_B16LE, & + H5T_STD_B32BE, & + H5T_STD_B32LE, & + H5T_STD_B64BE, & + H5T_STD_B64LE, & + H5T_NATIVE_B8, & + H5T_NATIVE_B16, & + H5T_NATIVE_B32, & + H5T_NATIVE_B64, & + H5T_FORTRAN_S1, & + H5T_C_S1 + + + INTEGER(HID_T), DIMENSION(PREDEF_TYPES_LEN) :: predef_types + EQUIVALENCE (predef_types(1), H5T_NATIVE_INTEGER) + EQUIVALENCE (predef_types(2), H5T_NATIVE_REAL) + EQUIVALENCE (predef_types(3), H5T_NATIVE_DOUBLE) + EQUIVALENCE (predef_types(4), H5T_NATIVE_CHARACTER) + EQUIVALENCE (predef_types(5), H5T_STD_REF_OBJ) + EQUIVALENCE (predef_types(6), H5T_STD_REF_DSETREG) + EQUIVALENCE (predef_types(7), H5T_NATIVE_INTEGER_1) + EQUIVALENCE (predef_types(8), H5T_NATIVE_INTEGER_2) + EQUIVALENCE (predef_types(9), H5T_NATIVE_INTEGER_4) + EQUIVALENCE (predef_types(10), H5T_NATIVE_INTEGER_8) + EQUIVALENCE (predef_types(11), H5T_NATIVE_REAL_C_FLOAT) + EQUIVALENCE (predef_types(12), H5T_NATIVE_REAL_C_DOUBLE) + EQUIVALENCE (predef_types(13), H5T_NATIVE_REAL_C_LONG_DOUBLE) + EQUIVALENCE (predef_types(14), H5T_NATIVE_B8 ) + EQUIVALENCE (predef_types(15), H5T_NATIVE_B16) + EQUIVALENCE (predef_types(16), H5T_NATIVE_B32) + EQUIVALENCE (predef_types(17), H5T_NATIVE_B64) + EQUIVALENCE (predef_types(18), H5T_NATIVE_INTEGER_16) ! ADDED NEW TYPE -MSB- + EQUIVALENCE (predef_types(19), H5T_NATIVE_FLOAT_128) ! ADDED NEW TYPE -MSB- + + INTEGER(HID_T), DIMENSION(FLOATING_TYPES_LEN) :: floating_types + EQUIVALENCE (floating_types(1), H5T_IEEE_F32BE ) + EQUIVALENCE (floating_types(2), H5T_IEEE_F32LE) + EQUIVALENCE (floating_types(3), H5T_IEEE_F64BE) + EQUIVALENCE (floating_types(4), H5T_IEEE_F64LE) + + INTEGER(HID_T), DIMENSION(INTEGER_TYPES_LEN) :: integer_types + EQUIVALENCE (integer_types(1), H5T_STD_I8BE ) + EQUIVALENCE (integer_types(2), H5T_STD_I8LE) + EQUIVALENCE (integer_types(3), H5T_STD_I16BE) + EQUIVALENCE (integer_types(4), H5T_STD_I16LE) + EQUIVALENCE (integer_types(5), H5T_STD_I32BE) + EQUIVALENCE (integer_types(6), H5T_STD_I32LE) + EQUIVALENCE (integer_types(7), H5T_STD_I64BE) + EQUIVALENCE (integer_types(8), H5T_STD_I64LE) + EQUIVALENCE (integer_types(9), H5T_STD_U8BE) + EQUIVALENCE (integer_types(10), H5T_STD_U8LE) + EQUIVALENCE (integer_types(11), H5T_STD_U16BE) + EQUIVALENCE (integer_types(12), H5T_STD_U16LE) + EQUIVALENCE (integer_types(13), H5T_STD_U32BE) + EQUIVALENCE (integer_types(14), H5T_STD_U32LE) + EQUIVALENCE (integer_types(15), H5T_STD_U64BE) + EQUIVALENCE (integer_types(16), H5T_STD_U64LE) + EQUIVALENCE (integer_types(17), H5T_STRING) + EQUIVALENCE (integer_types(18), H5T_STD_B8BE) + EQUIVALENCE (integer_types(19), H5T_STD_B8LE) + EQUIVALENCE (integer_types(20), H5T_STD_B16BE) + EQUIVALENCE (integer_types(21), H5T_STD_B16LE) + EQUIVALENCE (integer_types(22), H5T_STD_B32BE) + EQUIVALENCE (integer_types(23), H5T_STD_B32LE) + EQUIVALENCE (integer_types(24), H5T_STD_B64BE) + EQUIVALENCE (integer_types(25), H5T_STD_B64LE) + EQUIVALENCE (integer_types(26), H5T_FORTRAN_S1) + EQUIVALENCE (integer_types(27), H5T_C_S1) + + + ! COMMON /PREDEFINED_TYPES/ H5T_NATIVE_INTEGER, & + ! H5T_NATIVE_REAL, & + ! H5T_NATIVE_DOUBLE, & + ! H5T_NATIVE_CHARACTER, & + ! H5T_STD_REF_OBJ, & + ! H5T_STD_REF_DSETREG + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: /PREDEFINED_TYPES/ + !DEC$endif + COMMON /PREDEFINED_TYPES/ predef_types + + ! COMMON /FLOATING_TYPES/ H5T_IEEE_F32BE, & + ! H5T_IEEE_F32LE, & + ! H5T_IEEE_F64BE, & + ! H5T_IEEE_F64LE + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: /FLOATING_TYPES/ + !DEC$endif + COMMON /FLOATING_TYPES/ floating_types + ! + ! COMMON /INTEGER_TYPES/ H5T_STD_I8BE, & + ! H5T_STD_I8LE, & + ! H5T_STD_I16BE, & + ! H5T_STD_I16LE, & + ! H5T_STD_I32BE, & + ! H5T_STD_I32LE, & + ! H5T_STD_I64BE, & + ! H5T_STD_I64LE, & + ! H5T_STD_U8BE, & + ! H5T_STD_U8LE, & + ! H5T_STD_U16BE, & + ! H5T_STD_U16LE, & + ! H5T_STD_U32BE, & + ! H5T_STD_U32LE, & + ! H5T_STD_U64BE, & + ! H5T_STD_U64LE + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: /INTEGER_TYPES/ + !DEC$endif + COMMON /INTEGER_TYPES/ integer_types + ! + ! Fortran flags + ! + ! + ! H5F flags (DO NOT FORGET TO UPDATE WHEN NEW FLAGS ARE ADDED !) + ! + ! H5F flags declaration + ! + INTEGER, PARAMETER :: H5F_FLAGS_LEN = 19 + INTEGER :: H5F_flags(H5F_FLAGS_LEN) + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: /H5F_FLAGS/ + !DEC$endif + COMMON /H5F_FLAGS/ H5F_flags + + INTEGER :: H5F_ACC_RDWR_F + INTEGER :: H5F_ACC_RDONLY_F + INTEGER :: H5F_ACC_TRUNC_F + INTEGER :: H5F_ACC_EXCL_F + INTEGER :: H5F_ACC_DEBUG_F + INTEGER :: H5F_SCOPE_LOCAL_F + INTEGER :: H5F_SCOPE_GLOBAL_F + INTEGER :: H5F_CLOSE_DEFAULT_F + INTEGER :: H5F_CLOSE_WEAK_F + INTEGER :: H5F_CLOSE_SEMI_F + INTEGER :: H5F_CLOSE_STRONG_F + INTEGER :: H5F_OBJ_FILE_F + INTEGER :: H5F_OBJ_DATASET_F + INTEGER :: H5F_OBJ_GROUP_F + INTEGER :: H5F_OBJ_DATATYPE_F + INTEGER :: H5F_OBJ_ALL_F + INTEGER :: H5F_LIBVER_EARLIEST_F + INTEGER :: H5F_LIBVER_LATEST_F + INTEGER :: H5F_UNLIMITED_F + + EQUIVALENCE(H5F_flags(1), H5F_ACC_RDWR_F) + EQUIVALENCE(H5F_flags(2), H5F_ACC_RDONLY_F) + EQUIVALENCE(H5F_flags(3), H5F_ACC_TRUNC_F) + EQUIVALENCE(H5F_flags(4), H5F_ACC_EXCL_F) + EQUIVALENCE(H5F_flags(5), H5F_ACC_DEBUG_F) + EQUIVALENCE(H5F_flags(6), H5F_SCOPE_LOCAL_F) + EQUIVALENCE(H5F_flags(7), H5F_SCOPE_GLOBAL_F) + EQUIVALENCE(H5F_flags(8), H5F_CLOSE_DEFAULT_F) + EQUIVALENCE(H5F_flags(9), H5F_CLOSE_WEAK_F) + EQUIVALENCE(H5F_flags(10), H5F_CLOSE_SEMI_F) + EQUIVALENCE(H5F_flags(11), H5F_CLOSE_STRONG_F) + EQUIVALENCE(H5F_flags(12), H5F_OBJ_FILE_F) + EQUIVALENCE(H5F_flags(13), H5F_OBJ_DATASET_F) + EQUIVALENCE(H5F_flags(14), H5F_OBJ_GROUP_F) + EQUIVALENCE(H5F_flags(15), H5F_OBJ_DATATYPE_F) + EQUIVALENCE(H5F_flags(16), H5F_OBJ_ALL_F) + EQUIVALENCE(H5F_flags(17), H5F_LIBVER_EARLIEST_F) + EQUIVALENCE(H5F_flags(18), H5F_LIBVER_LATEST_F) + EQUIVALENCE(H5F_flags(19), H5F_UNLIMITED_F) + ! + ! H5generic flags declaration + ! + INTEGER, PARAMETER :: H5generic_FLAGS_LEN = 9 + INTEGER :: H5generic_flags(H5generic_FLAGS_LEN) + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: /H5generic_FLAGS/ + !DEC$endif + COMMON /H5generic_FLAGS/ H5generic_flags + + INTEGER :: H5_INDEX_UNKNOWN_F + INTEGER :: H5_INDEX_NAME_F + INTEGER :: H5_INDEX_CRT_ORDER_F + INTEGER :: H5_INDEX_N_F + INTEGER :: H5_ITER_UNKNOWN_F + INTEGER :: H5_ITER_INC_F + INTEGER :: H5_ITER_DEC_F + INTEGER :: H5_ITER_NATIVE_F + INTEGER :: H5_ITER_N_F + + EQUIVALENCE(H5generic_flags(1), H5_INDEX_UNKNOWN_F) + EQUIVALENCE(H5generic_flags(2), H5_INDEX_NAME_F) + EQUIVALENCE(H5generic_flags(3), H5_INDEX_CRT_ORDER_F) + EQUIVALENCE(H5generic_flags(4), H5_INDEX_N_F) + EQUIVALENCE(H5generic_flags(5), H5_ITER_UNKNOWN_F) + EQUIVALENCE(H5generic_flags(6), H5_ITER_INC_F) + EQUIVALENCE(H5generic_flags(7), H5_ITER_DEC_F) + EQUIVALENCE(H5generic_flags(8), H5_ITER_NATIVE_F) + EQUIVALENCE(H5generic_flags(9), H5_ITER_N_F) + ! + ! H5G flags declaration + ! + INTEGER, PARAMETER :: H5G_FLAGS_LEN = 12 + INTEGER :: H5G_flags(H5G_FLAGS_LEN) + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: /H5G_FLAGS/ + !DEC$endif + COMMON /H5G_FLAGS/ H5G_flags + + INTEGER :: H5G_UNKNOWN_F + INTEGER :: H5G_GROUP_F + INTEGER :: H5G_DATASET_F + INTEGER :: H5G_TYPE_F + INTEGER :: H5G_LINK_F + INTEGER :: H5G_UDLINK_F + INTEGER :: H5G_SAME_LOC_F + INTEGER :: H5G_LINK_ERROR_F + INTEGER :: H5G_LINK_HARD_F + INTEGER :: H5G_LINK_SOFT_F + INTEGER :: H5G_STORAGE_TYPE_UNKNOWN_F + INTEGER :: H5G_STORAGE_TYPE_SYMBOL_TABLE_F + INTEGER :: H5G_STORAGE_TYPE_COMPACT_F + INTEGER :: H5G_STORAGE_TYPE_DENSE_F + + EQUIVALENCE(H5G_flags(1), H5G_UNKNOWN_F) ! Unknown object type + EQUIVALENCE(H5G_flags(2), H5G_GROUP_F) ! Object is a group + EQUIVALENCE(H5G_flags(3), H5G_DATASET_F) ! Object is a dataset + EQUIVALENCE(H5G_flags(4), H5G_TYPE_F) ! Object is a named data type + EQUIVALENCE(H5G_flags(5), H5G_SAME_LOC_F) + EQUIVALENCE(H5G_flags(6), H5G_LINK_ERROR_F) + EQUIVALENCE(H5G_flags(7), H5G_LINK_HARD_F) + EQUIVALENCE(H5G_flags(8), H5G_LINK_SOFT_F) + + EQUIVALENCE(H5G_flags(9), H5G_STORAGE_TYPE_UNKNOWN_F ) + EQUIVALENCE(H5G_flags(10), H5G_STORAGE_TYPE_SYMBOL_TABLE_F) + EQUIVALENCE(H5G_flags(11), H5G_STORAGE_TYPE_COMPACT_F) + EQUIVALENCE(H5G_flags(12), H5G_STORAGE_TYPE_DENSE_F) + ! + ! H5D flags declaration + ! + + INTEGER, PARAMETER :: H5D_FLAGS_LEN = 25 + INTEGER :: H5D_flags(H5D_FLAGS_LEN) + INTEGER, PARAMETER :: H5D_SIZE_FLAGS_LEN = 2 + INTEGER(SIZE_T) :: H5D_size_flags(H5D_SIZE_FLAGS_LEN) + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: /H5D_FLAGS/ + !DEC$ATTRIBUTES DLLEXPORT :: /H5D_SIZE_FLAGS/ + !DEC$endif + COMMON /H5D_FLAGS/ H5D_flags + COMMON /H5D_SIZE_FLAGS/ H5D_size_flags + + INTEGER :: H5D_COMPACT_F + INTEGER :: H5D_CONTIGUOUS_F + INTEGER :: H5D_CHUNKED_F + + INTEGER :: H5D_ALLOC_TIME_ERROR_F + INTEGER :: H5D_ALLOC_TIME_DEFAULT_F + INTEGER :: H5D_ALLOC_TIME_EARLY_F + INTEGER :: H5D_ALLOC_TIME_LATE_F + INTEGER :: H5D_ALLOC_TIME_INCR_F + + INTEGER :: H5D_SPACE_STS_ERROR_F + INTEGER :: H5D_SPACE_STS_NOT_ALLOCATED_F + INTEGER :: H5D_SPACE_STS_PART_ALLOCATED_F + INTEGER :: H5D_SPACE_STS_ALLOCATED_F + + INTEGER :: H5D_FILL_TIME_ERROR_F + INTEGER :: H5D_FILL_TIME_ALLOC_F + INTEGER :: H5D_FILL_TIME_NEVER_F + + INTEGER :: H5D_FILL_VALUE_ERROR_F + INTEGER :: H5D_FILL_VALUE_UNDEFINED_F + INTEGER :: H5D_FILL_VALUE_DEFAULT_F + INTEGER :: H5D_FILL_VALUE_USER_DEFINED_F + +! shortened "_DEFAULT" to "_DFLT" to satisfy the limit of 31 +! characters for variable names in Fortran. +! shortened "_CONTIGUOUS" to "_CONTIG" to satisfy the limit of 31 +! characters for variable names in Fortran. + + INTEGER(SIZE_T) :: H5D_CHUNK_CACHE_NSLOTS_DFLT_F + INTEGER(SIZE_T) :: H5D_CHUNK_CACHE_NBYTES_DFLT_F + INTEGER :: H5D_CHUNK_CACHE_W0_DFLT_F + INTEGER :: H5D_MPIO_NO_COLLECTIVE_F + INTEGER :: H5D_MPIO_CHUNK_INDEPENDENT_F + INTEGER :: H5D_MPIO_CHUNK_COLLECTIVE_F + INTEGER :: H5D_MPIO_CHUNK_MIXED_F + INTEGER :: H5D_MPIO_CONTIG_COLLECTIVE_F + + EQUIVALENCE(H5D_flags(1), H5D_COMPACT_F) + EQUIVALENCE(H5D_flags(2), H5D_CONTIGUOUS_F) + EQUIVALENCE(H5D_flags(3), H5D_CHUNKED_F) + + EQUIVALENCE(H5D_flags(4), H5D_ALLOC_TIME_ERROR_F) + EQUIVALENCE(H5D_flags(5), H5D_ALLOC_TIME_DEFAULT_F) + EQUIVALENCE(H5D_flags(6), H5D_ALLOC_TIME_EARLY_F) + EQUIVALENCE(H5D_flags(7), H5D_ALLOC_TIME_LATE_F) + EQUIVALENCE(H5D_flags(8), H5D_ALLOC_TIME_INCR_F) + + EQUIVALENCE(H5D_flags(9), H5D_SPACE_STS_ERROR_F) + EQUIVALENCE(H5D_flags(10), H5D_SPACE_STS_NOT_ALLOCATED_F) + EQUIVALENCE(H5D_flags(11), H5D_SPACE_STS_PART_ALLOCATED_F) + EQUIVALENCE(H5D_flags(12), H5D_SPACE_STS_ALLOCATED_F) + + EQUIVALENCE(H5D_flags(13), H5D_FILL_TIME_ERROR_F) + EQUIVALENCE(H5D_flags(14), H5D_FILL_TIME_ALLOC_F) + EQUIVALENCE(H5D_flags(15), H5D_FILL_TIME_NEVER_F) + + EQUIVALENCE(H5D_flags(16), H5D_FILL_VALUE_ERROR_F) + EQUIVALENCE(H5D_flags(17), H5D_FILL_VALUE_UNDEFINED_F) + EQUIVALENCE(H5D_flags(18), H5D_FILL_VALUE_DEFAULT_F) + EQUIVALENCE(H5D_flags(19), H5D_FILL_VALUE_USER_DEFINED_F) + + EQUIVALENCE(H5D_flags(20), H5D_CHUNK_CACHE_W0_DFLT_F) + EQUIVALENCE(H5D_flags(21), H5D_MPIO_NO_COLLECTIVE_F) + EQUIVALENCE(H5D_flags(22), H5D_MPIO_CHUNK_INDEPENDENT_F) + EQUIVALENCE(H5D_flags(23), H5D_MPIO_CHUNK_COLLECTIVE_F) + EQUIVALENCE(H5D_flags(24), H5D_MPIO_CHUNK_MIXED_F) + EQUIVALENCE(H5D_flags(25), H5D_MPIO_CONTIG_COLLECTIVE_F) + + EQUIVALENCE(H5D_size_flags(1), H5D_CHUNK_CACHE_NSLOTS_DFLT_F) + EQUIVALENCE(H5D_size_flags(2), H5D_CHUNK_CACHE_NBYTES_DFLT_F) + + ! + ! H5E flags declaration + ! + INTEGER, PARAMETER :: H5E_FLAGS_LEN = 4 + INTEGER :: H5E_flags(H5E_FLAGS_LEN) + INTEGER, PARAMETER :: H5E_HID_FLAGS_LEN = 1 + INTEGER(HID_T) :: H5E_hid_flags(H5E_HID_FLAGS_LEN) + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: /H5E_FLAGS/ + !DEC$ATTRIBUTES DLLEXPORT :: /H5E_HID_FLAGS/ + !DEC$endif + COMMON /H5E_FLAGS/ H5E_flags + COMMON /H5E_HID_FLAGS/ H5E_hid_flags + + INTEGER(HID_T) :: H5E_DEFAULT_F + INTEGER :: H5E_MAJOR_F + INTEGER :: H5E_MINOR_F + INTEGER :: H5E_WALK_UPWARD_F + INTEGER :: H5E_WALK_DOWNWARD_F + + EQUIVALENCE(H5E_hid_flags(1), H5E_DEFAULT_F) + EQUIVALENCE(H5E_flags(1) , H5E_MAJOR_F) + EQUIVALENCE(H5E_flags(2) , H5E_MINOR_F) + EQUIVALENCE(H5E_flags(3) , H5E_WALK_UPWARD_F) + EQUIVALENCE(H5E_flags(4) , H5E_WALK_DOWNWARD_F) + + ! + ! H5FD flags declaration + ! + INTEGER, PARAMETER :: H5FD_FLAGS_LEN = 11 + INTEGER :: H5FD_flags(H5FD_FLAGS_LEN) + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: /H5FD_FLAGS/ + !DEC$endif + COMMON /H5FD_FLAGS/ H5FD_flags + + INTEGER :: H5FD_MPIO_INDEPENDENT_F + INTEGER :: H5FD_MPIO_COLLECTIVE_F + INTEGER :: H5FD_MEM_NOLIST_F + INTEGER :: H5FD_MEM_DEFAULT_F + INTEGER :: H5FD_MEM_SUPER_F + INTEGER :: H5FD_MEM_BTREE_F + INTEGER :: H5FD_MEM_DRAW_F + INTEGER :: H5FD_MEM_GHEAP_F + INTEGER :: H5FD_MEM_LHEAP_F + INTEGER :: H5FD_MEM_OHDR_F + INTEGER :: H5FD_MEM_NTYPES_F + + EQUIVALENCE(H5FD_flags(1), H5FD_MPIO_INDEPENDENT_F) + EQUIVALENCE(H5FD_flags(2), H5FD_MPIO_COLLECTIVE_F) + EQUIVALENCE(H5FD_flags(3), H5FD_MEM_NOLIST_F) + EQUIVALENCE(H5FD_flags(4), H5FD_MEM_DEFAULT_F) + EQUIVALENCE(H5FD_flags(5), H5FD_MEM_SUPER_F) + EQUIVALENCE(H5FD_flags(6), H5FD_MEM_BTREE_F) + EQUIVALENCE(H5FD_flags(7), H5FD_MEM_DRAW_F) + EQUIVALENCE(H5FD_flags(8), H5FD_MEM_GHEAP_F) + EQUIVALENCE(H5FD_flags(9), H5FD_MEM_LHEAP_F) + EQUIVALENCE(H5FD_flags(10), H5FD_MEM_OHDR_F) + EQUIVALENCE(H5FD_flags(11), H5FD_MEM_NTYPES_F) + ! + ! H5FD file drivers flags declaration + ! + INTEGER, PARAMETER :: H5FD_HID_FLAGS_LEN = 7 + INTEGER(HID_T) :: H5FD_hid_flags(H5FD_HID_FLAGS_LEN) + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: /H5FD_HID_FLAGS/ + !DEC$endif + COMMON /H5FD_HID_FLAGS/ H5FD_hid_flags + + INTEGER(HID_T) :: H5FD_CORE_F + INTEGER(HID_T) :: H5FD_FAMILY_F + INTEGER(HID_T) :: H5FD_LOG_F + INTEGER(HID_T) :: H5FD_MPIO_F + INTEGER(HID_T) :: H5FD_MULTI_F + INTEGER(HID_T) :: H5FD_SEC2_F + INTEGER(HID_T) :: H5FD_STDIO_F + + EQUIVALENCE(H5FD_hid_flags(1), H5FD_CORE_F) + EQUIVALENCE(H5FD_hid_flags(2), H5FD_FAMILY_F) + EQUIVALENCE(H5FD_hid_flags(3), H5FD_LOG_F) + EQUIVALENCE(H5FD_hid_flags(4), H5FD_MPIO_F) + EQUIVALENCE(H5FD_hid_flags(5), H5FD_MULTI_F) + EQUIVALENCE(H5FD_hid_flags(6), H5FD_SEC2_F) + EQUIVALENCE(H5FD_hid_flags(7), H5FD_STDIO_F) + + ! + ! H5I flags declaration + ! + INTEGER, PARAMETER :: H5I_FLAGS_LEN = 7 + INTEGER :: H5I_flags(H5I_FLAGS_LEN) + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: /H5I_FLAGS/ + !DEC$endif + COMMON /H5I_FLAGS/ H5I_flags + + INTEGER :: H5I_FILE_F + INTEGER :: H5I_GROUP_F + INTEGER :: H5I_DATATYPE_F + INTEGER :: H5I_DATASPACE_F + INTEGER :: H5I_DATASET_F + INTEGER :: H5I_ATTR_F + INTEGER :: H5I_BADID_F + + EQUIVALENCE(H5I_flags(1), H5I_FILE_F) + EQUIVALENCE(H5I_flags(2), H5I_GROUP_F) + EQUIVALENCE(H5I_flags(3), H5I_DATATYPE_F) + EQUIVALENCE(H5I_flags(4), H5I_DATASPACE_F) + EQUIVALENCE(H5I_flags(5), H5I_DATASET_F) + EQUIVALENCE(H5I_flags(6), H5I_ATTR_F) + EQUIVALENCE(H5I_flags(7), H5I_BADID_F) + ! + ! H5L flags declaration + ! + INTEGER, PARAMETER :: H5L_FLAGS_LEN = 6 + INTEGER :: H5L_flags(H5L_FLAGS_LEN) + + INTEGER :: H5L_TYPE_ERROR_F + INTEGER :: H5L_TYPE_HARD_F + INTEGER :: H5L_TYPE_SOFT_F + INTEGER :: H5L_TYPE_EXTERNAL_F + INTEGER :: H5L_SAME_LOC_F + INTEGER :: H5L_LINK_CLASS_T_VERS_F + + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: /H5L_FLAGS/ + !DEC$endif + COMMON /H5L_FLAGS/ H5L_flags + + EQUIVALENCE(H5L_flags(1), H5L_TYPE_ERROR_F) + EQUIVALENCE(H5L_flags(2), H5L_TYPE_HARD_F) + EQUIVALENCE(H5L_flags(3), H5L_TYPE_SOFT_F) + EQUIVALENCE(H5L_flags(4), H5L_TYPE_EXTERNAL_F) + EQUIVALENCE(H5L_flags(5), H5L_SAME_LOC_F) + EQUIVALENCE(H5L_flags(6), H5L_LINK_CLASS_T_VERS_F) + ! + ! H5O flags declaration + ! + INTEGER, PARAMETER :: H5O_FLAGS_LEN = 27 + INTEGER :: H5o_flags(H5O_FLAGS_LEN) + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: /H5O_FLAGS/ + !DEC$endif + COMMON /H5O_FLAGS/ H5O_flags + + INTEGER :: H5O_COPY_SHALLOW_HIERARCHY_F ! *** THESE VARIABLES DO + INTEGER :: H5O_COPY_EXPAND_SOFT_LINK_F ! NOT MATCH THE C VARIABLE + INTEGER :: H5O_COPY_EXPAND_EXT_LINK_F ! IN ORDER + INTEGER :: H5O_COPY_EXPAND_REFERENCE_F ! TO STAY UNDER THE + INTEGER :: H5O_COPY_WITHOUT_ATTR_FLAG_F + INTEGER :: H5O_COPY_PRESERVE_NULL_FLAG_F + INTEGER :: H5O_COPY_ALL_F + INTEGER :: H5O_SHMESG_NONE_FLAG_F + INTEGER :: H5O_SHMESG_SDSPACE_FLAG_F + INTEGER :: H5O_SHMESG_DTYPE_FLAG_F + INTEGER :: H5O_SHMESG_FILL_FLAG_F + INTEGER :: H5O_SHMESG_PLINE_FLAG_F + INTEGER :: H5O_SHMESG_ATTR_FLAG_F + INTEGER :: H5O_SHMESG_ALL_FLAG_F + INTEGER :: H5O_HDR_CHUNK0_SIZE_F + INTEGER :: H5O_HDR_ATTR_CRT_ORDER_TRACK_F ! 32 CHARACTER + INTEGER :: H5O_HDR_ATTR_CRT_ORDER_INDEX_F ! VARIABLE + INTEGER :: H5O_HDR_ATTR_STORE_PHASE_CHA_F ! LENGTH *** + INTEGER :: H5O_HDR_STORE_TIMES_F + INTEGER :: H5O_HDR_ALL_FLAGS_F + INTEGER :: H5O_SHMESG_MAX_NINDEXES_F + INTEGER :: H5O_SHMESG_MAX_LIST_SIZE_F + INTEGER :: H5O_TYPE_UNKNOWN_F + INTEGER :: H5O_TYPE_GROUP_F + INTEGER :: H5O_TYPE_DATASET_F + INTEGER :: H5O_TYPE_NAMED_DATATYPE_F + INTEGER :: H5O_TYPE_NTYPES_F + + EQUIVALENCE(h5o_flags(1) , H5O_COPY_SHALLOW_HIERARCHY_F) + EQUIVALENCE(h5o_flags(2) , H5O_COPY_EXPAND_SOFT_LINK_F) + EQUIVALENCE(h5o_flags(3) , H5O_COPY_EXPAND_EXT_LINK_F) + EQUIVALENCE(h5o_flags(4) , H5O_COPY_EXPAND_REFERENCE_F) + EQUIVALENCE(h5o_flags(5) , H5O_COPY_WITHOUT_ATTR_FLAG_F) + EQUIVALENCE(h5o_flags(6) , H5O_COPY_PRESERVE_NULL_FLAG_F) + EQUIVALENCE(h5o_flags(7) , H5O_COPY_ALL_F) + EQUIVALENCE(h5o_flags(8) , H5O_SHMESG_NONE_FLAG_F) + EQUIVALENCE(h5o_flags(9) , H5O_SHMESG_SDSPACE_FLAG_F) + EQUIVALENCE(h5o_flags(10) , H5O_SHMESG_DTYPE_FLAG_F) + EQUIVALENCE(h5o_flags(11) , H5O_SHMESG_FILL_FLAG_F) + EQUIVALENCE(h5o_flags(12) , H5O_SHMESG_PLINE_FLAG_F) + EQUIVALENCE(h5o_flags(13) , H5O_SHMESG_ATTR_FLAG_F) + EQUIVALENCE(h5o_flags(14) , H5O_SHMESG_ALL_FLAG_F) + EQUIVALENCE(h5o_flags(15) , H5O_HDR_CHUNK0_SIZE_F) + EQUIVALENCE(h5o_flags(16) , H5O_HDR_ATTR_CRT_ORDER_TRACK_F) + EQUIVALENCE(h5o_flags(17) , H5O_HDR_ATTR_CRT_ORDER_INDEX_F) + EQUIVALENCE(h5o_flags(18) , H5O_HDR_ATTR_STORE_PHASE_CHA_F) + EQUIVALENCE(h5o_flags(19) , H5O_HDR_STORE_TIMES_F) + EQUIVALENCE(h5o_flags(20) , H5O_HDR_ALL_FLAGS_F) + EQUIVALENCE(h5o_flags(21) , H5O_SHMESG_MAX_NINDEXES_F) + EQUIVALENCE(h5o_flags(22) , H5O_SHMESG_MAX_LIST_SIZE_F) + EQUIVALENCE(h5o_flags(23) , H5O_TYPE_UNKNOWN_F) + EQUIVALENCE(h5o_flags(24) , H5O_TYPE_GROUP_F) + EQUIVALENCE(h5o_flags(25) , H5O_TYPE_DATASET_F) + EQUIVALENCE(h5o_flags(26) , H5O_TYPE_NAMED_DATATYPE_F) + EQUIVALENCE(h5o_flags(27) , H5O_TYPE_NTYPES_F) + + ! + ! H5P flags declaration + ! + INTEGER, PARAMETER :: H5P_FLAGS_LEN = 18 + INTEGER(HID_T) H5P_flags(H5P_FLAGS_LEN) + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: /H5P_FLAGS/ + !DEC$endif + COMMON /H5P_FLAGS/ H5P_flags + + INTEGER(HID_T) :: H5P_FILE_CREATE_F + INTEGER(HID_T) :: H5P_FILE_ACCESS_F + INTEGER(HID_T) :: H5P_DATASET_CREATE_F + INTEGER(HID_T) :: H5P_DATASET_XFER_F + INTEGER(HID_T) :: H5P_FILE_MOUNT_F + INTEGER(HID_T) :: H5P_DEFAULT_F + INTEGER(HID_T) :: H5P_ROOT_F + INTEGER(HID_T) :: H5P_OBJECT_CREATE_F + INTEGER(HID_T) :: H5P_DATASET_ACCESS_F + INTEGER(HID_T) :: H5P_GROUP_CREATE_F + INTEGER(HID_T) :: H5P_GROUP_ACCESS_F + INTEGER(HID_T) :: H5P_DATATYPE_CREATE_F + INTEGER(HID_T) :: H5P_DATATYPE_ACCESS_F + INTEGER(HID_T) :: H5P_STRING_CREATE_F + INTEGER(HID_T) :: H5P_ATTRIBUTE_CREATE_F + INTEGER(HID_T) :: H5P_OBJECT_COPY_F + INTEGER(HID_T) :: H5P_LINK_CREATE_F + INTEGER(HID_T) :: H5P_LINK_ACCESS_F + + EQUIVALENCE(H5P_flags(1), H5P_FILE_CREATE_F) + EQUIVALENCE(H5P_flags(2), H5P_FILE_ACCESS_F) + EQUIVALENCE(H5P_flags(3), H5P_DATASET_CREATE_F) + EQUIVALENCE(H5P_flags(4), H5P_DATASET_XFER_F) + EQUIVALENCE(H5P_flags(5), H5P_FILE_MOUNT_F) + EQUIVALENCE(H5P_flags(6), H5P_DEFAULT_F) + EQUIVALENCE(H5P_flags(7), H5P_ROOT_F) + EQUIVALENCE(H5P_flags(8), H5P_OBJECT_CREATE_F) + EQUIVALENCE(H5P_flags(9), H5P_DATASET_ACCESS_F) + EQUIVALENCE(H5P_flags(10), H5P_GROUP_CREATE_F) + EQUIVALENCE(H5P_flags(11), H5P_GROUP_ACCESS_F) + EQUIVALENCE(H5P_flags(12), H5P_DATATYPE_CREATE_F) + EQUIVALENCE(H5P_flags(13), H5P_DATATYPE_ACCESS_F) + EQUIVALENCE(H5P_flags(14), H5P_STRING_CREATE_F) + EQUIVALENCE(H5P_flags(15), H5P_ATTRIBUTE_CREATE_F) + EQUIVALENCE(H5P_flags(16), H5P_OBJECT_COPY_F) + EQUIVALENCE(H5P_flags(17), H5P_LINK_CREATE_F) + EQUIVALENCE(H5P_flags(18), H5P_LINK_ACCESS_F) + + ! + ! H5P integers flags declaration + ! + INTEGER, PARAMETER :: H5P_FLAGS_INT_LEN = 2 + INTEGER :: H5P_flags_int(H5P_FLAGS_INT_LEN) + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: /H5P_FLAGS_INT/ + !DEC$endif + COMMON /H5P_FLAGS_INT/ H5P_flags_int + INTEGER :: H5P_CRT_ORDER_INDEXED_F + INTEGER :: H5P_CRT_ORDER_TRACKED_F + EQUIVALENCE(H5P_flags_int(1), H5P_CRT_ORDER_INDEXED_F) + EQUIVALENCE(H5P_flags_int(2), H5P_CRT_ORDER_TRACKED_F) + ! + ! H5R flags declaration + ! + INTEGER, PARAMETER :: H5R_FLAGS_LEN = 2 + INTEGER :: H5R_flags(H5R_FLAGS_LEN) + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: /H5R_FLAGS/ + !DEC$endif + COMMON /H5R_FLAGS/ H5R_flags + + INTEGER :: H5R_OBJECT_F + INTEGER :: H5R_DATASET_REGION_F + + EQUIVALENCE(H5R_flags(1), H5R_OBJECT_F) + EQUIVALENCE(H5R_flags(2), H5R_DATASET_REGION_F) + + ! + ! H5S flags declaration + ! + INTEGER, PARAMETER :: H5S_FLAGS_LEN = 19 + INTEGER :: H5S_flags(H5S_FLAGS_LEN) + INTEGER, PARAMETER :: H5S_HSIZE_FLAGS_LEN = 1 + INTEGER(HSIZE_T) H5S_hsize_flags(H5S_HSIZE_FLAGS_LEN) + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: /H5S_FLAGS/ + !DEC$ATTRIBUTES DLLEXPORT :: /H5S_HSIZE_FLAGS/ + !DEC$endif + COMMON /H5S_FLAGS/ H5S_flags + COMMON /H5S_HSIZE_FLAGS/ H5S_hsize_flags + + INTEGER(HSIZE_T) :: H5S_UNLIMITED_F + + INTEGER :: H5S_SCALAR_F + INTEGER :: H5S_SIMPLE_F + INTEGER :: H5S_NULL_F + + INTEGER :: H5S_ALL_F + + INTEGER :: H5S_SELECT_NOOP_F + INTEGER :: H5S_SELECT_SET_F + INTEGER :: H5S_SELECT_OR_F + INTEGER :: H5S_SELECT_AND_F + INTEGER :: H5S_SELECT_XOR_F + INTEGER :: H5S_SELECT_NOTB_F + INTEGER :: H5S_SELECT_NOTA_F + INTEGER :: H5S_SELECT_APPEND_F + INTEGER :: H5S_SELECT_PREPEND_F + INTEGER :: H5S_SELECT_INVALID_F + + INTEGER :: H5S_SEL_ERROR_F + INTEGER :: H5S_SEL_NONE_F + INTEGER :: H5S_SEL_POINTS_F + INTEGER :: H5S_SEL_HYPERSLABS_F + INTEGER :: H5S_SEL_ALL_F + + EQUIVALENCE(H5S_hsize_flags(1), H5S_UNLIMITED_F) + EQUIVALENCE(H5S_flags(1), H5S_SCALAR_F) + EQUIVALENCE(H5S_flags(2), H5S_SIMPLE_F) + EQUIVALENCE(H5S_flags(3), H5S_NULL_F) + EQUIVALENCE(H5S_flags(4), H5S_SELECT_SET_F) + EQUIVALENCE(H5S_flags(5), H5S_SELECT_OR_F) + EQUIVALENCE(H5S_flags(6), H5S_ALL_F) + + EQUIVALENCE(H5S_flags(7), H5S_SELECT_NOOP_F) + EQUIVALENCE(H5S_flags(8), H5S_SELECT_AND_F) + EQUIVALENCE(H5S_flags(9), H5S_SELECT_XOR_F) + EQUIVALENCE(H5S_flags(10), H5S_SELECT_NOTB_F) + EQUIVALENCE(H5S_flags(11), H5S_SELECT_NOTA_F) + EQUIVALENCE(H5S_flags(12), H5S_SELECT_APPEND_F) + EQUIVALENCE(H5S_flags(13), H5S_SELECT_PREPEND_F) + EQUIVALENCE(H5S_flags(14), H5S_SELECT_INVALID_F) + + + EQUIVALENCE(H5S_flags(15), H5S_SEL_ERROR_F) + EQUIVALENCE(H5S_flags(16), H5S_SEL_NONE_F) + EQUIVALENCE(H5S_flags(17), H5S_SEL_POINTS_F) + EQUIVALENCE(H5S_flags(18), H5S_SEL_HYPERSLABS_F) + EQUIVALENCE(H5S_flags(19), H5S_SEL_ALL_F) + + ! + ! H5T flags declaration + ! + INTEGER, PARAMETER :: H5T_FLAGS_LEN = 35 + INTEGER :: H5T_flags(H5T_FLAGS_LEN) + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: /H5T_FLAGS/ + !DEC$endif + COMMON /H5T_FLAGS/ H5T_flags + + INTEGER :: H5T_NO_CLASS_F + INTEGER :: H5T_INTEGER_F + INTEGER :: H5T_FLOAT_F + INTEGER :: H5T_TIME_F + INTEGER :: H5T_STRING_F + INTEGER :: H5T_BITFIELD_F + INTEGER :: H5T_OPAQUE_F + INTEGER :: H5T_COMPOUND_F + INTEGER :: H5T_REFERENCE_F + INTEGER :: H5T_ENUM_F + INTEGER :: H5T_VLEN_F + INTEGER :: H5T_ARRAY_F + INTEGER :: H5T_ORDER_LE_F + INTEGER :: H5T_ORDER_BE_F + INTEGER :: H5T_ORDER_VAX_F + INTEGER :: H5T_ORDER_NONE_F + INTEGER :: H5T_ORDER_MIXED_F + INTEGER :: H5T_PAD_ZERO_F + INTEGER :: H5T_PAD_ONE_F + INTEGER :: H5T_PAD_BACKGROUND_F + INTEGER :: H5T_PAD_ERROR_F + INTEGER :: H5T_SGN_NONE_F + INTEGER :: H5T_SGN_2_F + INTEGER :: H5T_SGN_ERROR_F + INTEGER :: H5T_NORM_IMPLIED_F + INTEGER :: H5T_NORM_MSBSET_F + INTEGER :: H5T_NORM_NONE_F + INTEGER :: H5T_CSET_ASCII_F + INTEGER :: H5T_CSET_UTF8_F + INTEGER :: H5T_STR_NULLTERM_F + INTEGER :: H5T_STR_NULLPAD_F + INTEGER :: H5T_STR_SPACEPAD_F + INTEGER :: H5T_STR_ERROR_F + INTEGER :: H5T_DIR_ASCEND_F + INTEGER :: H5T_DIR_DESCEND_F + + EQUIVALENCE(H5T_flags(1), H5T_NO_CLASS_F) + EQUIVALENCE(H5T_flags(2), H5T_INTEGER_F) + EQUIVALENCE(H5T_flags(3), H5T_FLOAT_F) + EQUIVALENCE(H5T_flags(4), H5T_TIME_F) + EQUIVALENCE(H5T_flags(5), H5T_STRING_F) + EQUIVALENCE(H5T_flags(6), H5T_BITFIELD_F) + EQUIVALENCE(H5T_flags(7), H5T_OPAQUE_F) + EQUIVALENCE(H5T_flags(8), H5T_COMPOUND_F) + EQUIVALENCE(H5T_flags(9), H5T_REFERENCE_F) + EQUIVALENCE(H5T_flags(10), H5T_ENUM_F) + EQUIVALENCE(H5T_flags(11), H5T_ORDER_LE_F) + EQUIVALENCE(H5T_flags(12), H5T_ORDER_BE_F) + EQUIVALENCE(H5T_flags(13), H5T_ORDER_MIXED_F) + EQUIVALENCE(H5T_flags(14), H5T_ORDER_VAX_F) + EQUIVALENCE(H5T_flags(15), H5T_ORDER_NONE_F) + EQUIVALENCE(H5T_flags(16), H5T_PAD_ZERO_F) + EQUIVALENCE(H5T_flags(17), H5T_PAD_ONE_F) + EQUIVALENCE(H5T_flags(18), H5T_PAD_BACKGROUND_F) + EQUIVALENCE(H5T_flags(19), H5T_PAD_ERROR_F) + EQUIVALENCE(H5T_flags(20), H5T_SGN_NONE_F) + EQUIVALENCE(H5T_flags(21), H5T_SGN_2_F) + EQUIVALENCE(H5T_flags(22), H5T_SGN_ERROR_F) + EQUIVALENCE(H5T_flags(23), H5T_NORM_IMPLIED_F) + EQUIVALENCE(H5T_flags(24), H5T_NORM_MSBSET_F) + EQUIVALENCE(H5T_flags(25), H5T_NORM_NONE_F) + EQUIVALENCE(H5T_flags(26), H5T_CSET_ASCII_F) + EQUIVALENCE(H5T_flags(27), H5T_CSET_UTF8_F) + EQUIVALENCE(H5T_flags(28), H5T_STR_NULLTERM_F) + EQUIVALENCE(H5T_flags(29), H5T_STR_NULLPAD_F) + EQUIVALENCE(H5T_flags(30), H5T_STR_SPACEPAD_F) + EQUIVALENCE(H5T_flags(31), H5T_STR_ERROR_F) + EQUIVALENCE(H5T_flags(32), H5T_VLEN_F) + EQUIVALENCE(H5T_flags(33), H5T_ARRAY_F) + EQUIVALENCE(H5T_flags(34), H5T_DIR_ASCEND_F) + EQUIVALENCE(H5T_flags(35), H5T_DIR_DESCEND_F) + ! + ! H5Z flags declaration + ! + INTEGER, PARAMETER :: H5Z_FLAGS_LEN = 20 + INTEGER :: H5Z_flags(H5Z_FLAGS_LEN) + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: /H5Z_FLAGS/ + !DEC$endif + COMMON /H5Z_FLAGS/ H5Z_flags + + INTEGER :: H5Z_FILTER_ERROR_F + INTEGER :: H5Z_FILTER_NONE_F + INTEGER :: H5Z_FILTER_ALL_F + INTEGER :: H5Z_FILTER_DEFLATE_F + INTEGER :: H5Z_FILTER_SHUFFLE_F + INTEGER :: H5Z_FILTER_FLETCHER32_F + INTEGER :: H5Z_FILTER_SZIP_F + INTEGER :: H5Z_ERROR_EDC_F + INTEGER :: H5Z_DISABLE_EDC_F + INTEGER :: H5Z_ENABLE_EDC_F + INTEGER :: H5Z_NO_EDC_F + INTEGER :: H5Z_FLAG_OPTIONAL_F + INTEGER :: H5Z_FILTER_ENCODE_ENABLED_F + INTEGER :: H5Z_FILTER_DECODE_ENABLED_F + INTEGER :: H5Z_FILTER_NBIT_F + INTEGER :: H5Z_FILTER_SCALEOFFSET_F + INTEGER :: H5Z_SO_FLOAT_DSCALE_F + INTEGER :: H5Z_SO_FLOAT_ESCALE_F + INTEGER :: H5Z_SO_INT_F + INTEGER :: H5Z_SO_INT_MINBITS_DEFAULT_F + + EQUIVALENCE(H5Z_flags(1), H5Z_FILTER_ERROR_F) + EQUIVALENCE(H5Z_flags(2), H5Z_FILTER_NONE_F) + EQUIVALENCE(H5Z_flags(3), H5Z_FILTER_DEFLATE_F) + EQUIVALENCE(H5Z_flags(4), H5Z_FILTER_SHUFFLE_F) + EQUIVALENCE(H5Z_flags(5), H5Z_FILTER_FLETCHER32_F) + EQUIVALENCE(H5Z_flags(6), H5Z_ERROR_EDC_F) + EQUIVALENCE(H5Z_flags(7), H5Z_DISABLE_EDC_F) + EQUIVALENCE(H5Z_flags(8), H5Z_ENABLE_EDC_F) + EQUIVALENCE(H5Z_flags(9), H5Z_NO_EDC_F) + EQUIVALENCE(H5Z_flags(10), H5Z_FILTER_SZIP_F) + EQUIVALENCE(H5Z_flags(11), H5Z_FLAG_OPTIONAL_F) + EQUIVALENCE(H5Z_flags(12), H5Z_FILTER_ENCODE_ENABLED_F) + EQUIVALENCE(H5Z_flags(13), H5Z_FILTER_DECODE_ENABLED_F) + EQUIVALENCE(H5Z_flags(14), H5Z_FILTER_ALL_F) + EQUIVALENCE(H5Z_flags(15), H5Z_FILTER_NBIT_F) + EQUIVALENCE(H5Z_flags(16), H5Z_FILTER_SCALEOFFSET_F) + EQUIVALENCE(H5Z_flags(17), H5Z_SO_FLOAT_DSCALE_F) + EQUIVALENCE(H5Z_flags(18), H5Z_SO_FLOAT_ESCALE_F) + EQUIVALENCE(H5Z_flags(19), H5Z_SO_INT_F) + EQUIVALENCE(H5Z_flags(20), H5Z_SO_INT_MINBITS_DEFAULT_F) + + ! + ! H5 Library flags declaration + ! + INTEGER, PARAMETER :: H5LIB_FLAGS_LEN = 2 + INTEGER :: H5LIB_flags(H5LIB_FLAGS_LEN) + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: /H5LIB_FLAGS/ + !DEC$endif + COMMON /H5LIB_FLAGS/ H5LIB_flags + INTEGER :: H5_SZIP_EC_OM_F + INTEGER :: H5_SZIP_NN_OM_F + ! + EQUIVALENCE(H5LIB_flags(1), H5_SZIP_EC_OM_F) + EQUIVALENCE(H5LIB_flags(2), H5_SZIP_NN_OM_F) + + + ! General H5 flags declarations + ! +!!$ INTEGER, PARAMETER :: H5_FLAGS_LEN = 2 +!!$ INTEGER H5_flags(H5_FLAGS_LEN) +!!$!DEC$if defined(BUILD_HDF5_DLL) +!!$!DEC$ATTRIBUTES DLLEXPORT :: /H5_FLAGS/ +!!$!DEC$endif +!!$ COMMON /H5_FLAGS/ H5_flags +!!$ +!!$ INTEGER :: _F +!!$ INTEGER :: H5F_SCOPE_LOCAL_F +!!$ +!!$ EQUIVALENCE(H5F_flags(1), H5F_SCOPE_GLOBAL_F) +!!$ EQUIVALENCE(H5F_flags(2), H5F_SCOPE_LOCAL_F) + +CONTAINS + + ! Copy a c string to a Fortran string + + SUBROUTINE H5_Fortran_string_c2f(c_string, f_string) + + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + CHARACTER(KIND=C_CHAR, LEN=*), INTENT(IN) :: c_string + CHARACTER(LEN=*), INTENT(OUT) :: f_string + INTEGER(SIZE_T) :: c_len, f_len + + ! Find the length of the C string by located the null terminator + c_len = MAX(INDEX(c_string,C_NULL_CHAR, KIND=SIZE_T)-1,1) + ! Find the length of the Fortran string + f_len = LEN(f_string) + + ! CASE (1): C string is equal to or larger then Fortran character buffer, + ! so fill the entire Fortran buffer. + IF(c_len.GE.f_len)THEN ! + f_string(1:f_len) = c_string(1:f_len) + + ! CASE (2): C string is smaller then Fortran character buffer, + ! so copy C string and blank pad remaining characters. + ELSE + f_string(1:c_len) = c_string(1:c_len) + f_string(c_len+1:f_len) =' ' + ENDIF + END SUBROUTINE H5_Fortran_string_c2f + + SUBROUTINE H5_Fortran_string_f2c(f_string, c_string) + + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + CHARACTER(LEN=*), INTENT(IN) :: f_string + CHARACTER(KIND=C_CHAR, LEN=*), INTENT(OUT) :: c_string + INTEGER(SIZE_T) :: c_len, f_len + + c_string = TRIM(f_string)//C_NULL_CHAR + + END SUBROUTINE H5_Fortran_string_f2c + + +! Copy Fortran string to C charater array, assuming the C array is one-char +! longer for the terminating null char. +! fstring : the Fortran input string +! cstring : the C output string (with memory already allocated) +!!$subroutine MPIR_Fortran_string_f2c(fstring, cstring) +!!$ implicit none +!!$ character(len=*), intent(in) :: fstring +!!$ character(kind=c_char), intent(out) :: cstring(:) +!!$ integer :: i, j +!!$ logical :: met_non_blank +!!$ +!!$ ! Trim the leading and trailing blank characters +!!$ j = 1 +!!$ met_non_blank = .false. +!!$ do i = 1, len_trim(fstring) +!!$ if (met_non_blank) then +!!$ cstring(j) = fstring(i:i) +!!$ j = j + 1 +!!$ else if (fstring(i:i) /= ' ') then +!!$ met_non_blank = .true. +!!$ cstring(j) = fstring(i:i) +!!$ j = j + 1 +!!$ end if +!!$ end do +!!$ +!!$ cstring(j) = C_NULL_CHAR +!!$end subroutine MPIR_Fortran_string_f2c +!!$ +!!$! Copy C charater array to Fortran string +!!$subroutine MPIR_Fortran_string_c2f(cstring, fstring) +!!$ implicit none +!!$ character(kind=c_char), intent(in) :: cstring(:) +!!$ character(len=*), intent(out) :: fstring +!!$ integer :: i, j, length +!!$ +!!$ i = 1 +!!$ do while (cstring(i) /= C_NULL_CHAR) +!!$ fstring(i:i) = cstring(i) +!!$ i = i + 1 +!!$ end do +!!$ +!!$ ! Zero out the trailing characters +!!$ length = len(fstring) +!!$ do j = i, length +!!$ fstring(j:j) = ' ' +!!$ end do +!!$end subroutine MPIR_Fortran_string_c2f + +END MODULE H5GLOBAL + diff --git a/fortran/src/H5f90global.f90 b/fortran/src/H5f90global.f90 deleted file mode 100644 index 0e371f5..0000000 --- a/fortran/src/H5f90global.f90 +++ /dev/null @@ -1,947 +0,0 @@ -!****h* ROBODoc/H5GLOBAL -! -! NAME -! MODULE H5GLOBAL -! -! FILE -! src/fortran/H5f90global.f90 -! -! PURPOSE -! This module is used to pass C stubs for H5 Fortran APIs. The C stubs are -! packed into arrays in H5_f.c and these arrays are then passed to Fortran. -! This module then uses EQUIVALENCE to assign elements of the arrays to -! Fortran equivalent C stubs. -! -! NOTES -! The size of the C arrays in H5_f.c has to match the values of the variables -! declared as PARAMETER, hence if the size of an array in H5_f.c is changed -! then the PARAMETER of that corresponding array in Fortran must also be changed. -! -! USES -! H5FORTRAN_TYPES - This module is generated at run time. See -! -! 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 -! Elena Pourmal -! -!***** - -MODULE H5GLOBAL - USE H5FORTRAN_TYPES - - IMPLICIT NONE - - ! Definitions for reference datatypes. - ! If you change the value of these parameters, do not forget to change corresponding - ! values in the H5f90.h file. - INTEGER, PARAMETER :: REF_REG_BUF_LEN = 3 - - ! Parameters used in the function 'h5kind_to_type' located in H5_ff.f90. - ! The flag is used to tell the function whether the kind input variable - ! is for a REAL or INTEGER data type. - - INTEGER, PARAMETER :: H5_REAL_KIND = 1 - INTEGER, PARAMETER :: H5_INTEGER_KIND = 0 - - TYPE :: hobj_ref_t_f - INTEGER(HADDR_T) ref - END TYPE hobj_ref_t_f - - TYPE :: hdset_reg_ref_t_f - INTEGER, DIMENSION(1:REF_REG_BUF_LEN) :: ref - END TYPE hdset_reg_ref_t_f - - INTEGER, PARAMETER :: PREDEF_TYPES_LEN = 17 ! Do not forget to change this - ! value when new predefined - ! datatypes are added - - ! Do not forget to change the following line when new predefined - ! floating data types are added - INTEGER, PARAMETER :: FLOATING_TYPES_LEN = 4 - - ! Do not forget to change the following line when new predefined - ! integer data types are added - INTEGER, PARAMETER :: INTEGER_TYPES_LEN = 27 - - INTEGER(HID_T) :: H5T_NATIVE_INTEGER_1, & - H5T_NATIVE_INTEGER_2, & - H5T_NATIVE_INTEGER_4, & - H5T_NATIVE_INTEGER_8, & - H5T_NATIVE_REAL_4, & - H5T_NATIVE_REAL_8, & - H5T_NATIVE_REAL_16, & - H5T_NATIVE_INTEGER, & - H5T_NATIVE_REAL, & - H5T_NATIVE_DOUBLE, & - H5T_NATIVE_CHARACTER , & - H5T_STD_REF_OBJ, & - H5T_STD_REF_DSETREG, & - H5T_IEEE_F32BE, & - H5T_IEEE_F32LE, & - H5T_IEEE_F64BE, & - H5T_IEEE_F64LE, & - H5T_STD_I8BE, & - H5T_STD_I8LE, & - H5T_STD_I16BE, & - H5T_STD_I16LE, & - H5T_STD_I32BE, & - H5T_STD_I32LE, & - H5T_STD_I64BE, & - H5T_STD_I64LE, & - H5T_STD_U8BE, & - H5T_STD_U8LE, & - H5T_STD_U16BE, & - H5T_STD_U16LE, & - H5T_STD_U32BE - -! NOTE: Splitting the line since the Fortran 95 standard limits the number of -! continuation lines to 39; the F03/F08 standard limits the number -! to 255 lines. - - INTEGER(HID_T) :: H5T_STD_U32LE, & - H5T_STD_U64BE, & - H5T_STD_U64LE, & - H5T_STRING, & - H5T_STD_B8BE, & - H5T_STD_B8LE, & - H5T_STD_B16BE, & - H5T_STD_B16LE, & - H5T_STD_B32BE, & - H5T_STD_B32LE, & - H5T_STD_B64BE, & - H5T_STD_B64LE, & - H5T_NATIVE_B8, & - H5T_NATIVE_B16, & - H5T_NATIVE_B32, & - H5T_NATIVE_B64, & - H5T_FORTRAN_S1, & - H5T_C_S1 - - - INTEGER(HID_T), DIMENSION(PREDEF_TYPES_LEN) :: predef_types - EQUIVALENCE (predef_types(1), H5T_NATIVE_INTEGER) - EQUIVALENCE (predef_types(2), H5T_NATIVE_REAL) - EQUIVALENCE (predef_types(3), H5T_NATIVE_DOUBLE) - EQUIVALENCE (predef_types(4), H5T_NATIVE_CHARACTER) - EQUIVALENCE (predef_types(5), H5T_STD_REF_OBJ) - EQUIVALENCE (predef_types(6), H5T_STD_REF_DSETREG) - EQUIVALENCE (predef_types(7), H5T_NATIVE_INTEGER_1) - EQUIVALENCE (predef_types(8), H5T_NATIVE_INTEGER_2) - EQUIVALENCE (predef_types(9), H5T_NATIVE_INTEGER_4) - EQUIVALENCE (predef_types(10), H5T_NATIVE_INTEGER_8) - EQUIVALENCE (predef_types(11), H5T_NATIVE_REAL_4) - EQUIVALENCE (predef_types(12), H5T_NATIVE_REAL_8) - EQUIVALENCE (predef_types(13), H5T_NATIVE_REAL_16) - EQUIVALENCE (predef_types(14), H5T_NATIVE_B8 ) - EQUIVALENCE (predef_types(15), H5T_NATIVE_B16) - EQUIVALENCE (predef_types(16), H5T_NATIVE_B32) - EQUIVALENCE (predef_types(17), H5T_NATIVE_B64) - - INTEGER(HID_T), DIMENSION(FLOATING_TYPES_LEN) :: floating_types - EQUIVALENCE (floating_types(1), H5T_IEEE_F32BE ) - EQUIVALENCE (floating_types(2), H5T_IEEE_F32LE) - EQUIVALENCE (floating_types(3), H5T_IEEE_F64BE) - EQUIVALENCE (floating_types(4), H5T_IEEE_F64LE) - - INTEGER(HID_T), DIMENSION(INTEGER_TYPES_LEN) :: integer_types - EQUIVALENCE (integer_types(1), H5T_STD_I8BE ) - EQUIVALENCE (integer_types(2), H5T_STD_I8LE) - EQUIVALENCE (integer_types(3), H5T_STD_I16BE) - EQUIVALENCE (integer_types(4), H5T_STD_I16LE) - EQUIVALENCE (integer_types(5), H5T_STD_I32BE) - EQUIVALENCE (integer_types(6), H5T_STD_I32LE) - EQUIVALENCE (integer_types(7), H5T_STD_I64BE) - EQUIVALENCE (integer_types(8), H5T_STD_I64LE) - EQUIVALENCE (integer_types(9), H5T_STD_U8BE) - EQUIVALENCE (integer_types(10), H5T_STD_U8LE) - EQUIVALENCE (integer_types(11), H5T_STD_U16BE) - EQUIVALENCE (integer_types(12), H5T_STD_U16LE) - EQUIVALENCE (integer_types(13), H5T_STD_U32BE) - EQUIVALENCE (integer_types(14), H5T_STD_U32LE) - EQUIVALENCE (integer_types(15), H5T_STD_U64BE) - EQUIVALENCE (integer_types(16), H5T_STD_U64LE) - EQUIVALENCE (integer_types(17), H5T_STRING) - EQUIVALENCE (integer_types(18), H5T_STD_B8BE) - EQUIVALENCE (integer_types(19), H5T_STD_B8LE) - EQUIVALENCE (integer_types(20), H5T_STD_B16BE) - EQUIVALENCE (integer_types(21), H5T_STD_B16LE) - EQUIVALENCE (integer_types(22), H5T_STD_B32BE) - EQUIVALENCE (integer_types(23), H5T_STD_B32LE) - EQUIVALENCE (integer_types(24), H5T_STD_B64BE) - EQUIVALENCE (integer_types(25), H5T_STD_B64LE) - EQUIVALENCE (integer_types(26), H5T_FORTRAN_S1) - EQUIVALENCE (integer_types(27), H5T_C_S1) - - - ! COMMON /PREDEFINED_TYPES/ H5T_NATIVE_INTEGER, & - ! H5T_NATIVE_REAL, & - ! H5T_NATIVE_DOUBLE, & - ! H5T_NATIVE_CHARACTER, & - ! H5T_STD_REF_OBJ, & - ! H5T_STD_REF_DSETREG - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /PREDEFINED_TYPES/ - !DEC$endif - COMMON /PREDEFINED_TYPES/ predef_types - - ! COMMON /FLOATING_TYPES/ H5T_IEEE_F32BE, & - ! H5T_IEEE_F32LE, & - ! H5T_IEEE_F64BE, & - ! H5T_IEEE_F64LE - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /FLOATING_TYPES/ - !DEC$endif - COMMON /FLOATING_TYPES/ floating_types - ! - ! COMMON /INTEGER_TYPES/ H5T_STD_I8BE, & - ! H5T_STD_I8LE, & - ! H5T_STD_I16BE, & - ! H5T_STD_I16LE, & - ! H5T_STD_I32BE, & - ! H5T_STD_I32LE, & - ! H5T_STD_I64BE, & - ! H5T_STD_I64LE, & - ! H5T_STD_U8BE, & - ! H5T_STD_U8LE, & - ! H5T_STD_U16BE, & - ! H5T_STD_U16LE, & - ! H5T_STD_U32BE, & - ! H5T_STD_U32LE, & - ! H5T_STD_U64BE, & - ! H5T_STD_U64LE - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /INTEGER_TYPES/ - !DEC$endif - COMMON /INTEGER_TYPES/ integer_types - ! - ! Fortran flags - ! - ! - ! H5F flags (DO NOT FORGET TO UPDATE WHEN NEW FLAGS ARE ADDED !) - ! - ! NOTE: H5F_ACC_DEBUG is deprecated (nonfunctional) but retained for - ! backward compatibility since it's in the public API. - ! - ! H5F flags declaration - ! - INTEGER, PARAMETER :: H5F_FLAGS_LEN = 19 - INTEGER :: H5F_flags(H5F_FLAGS_LEN) - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5F_FLAGS/ - !DEC$endif - COMMON /H5F_FLAGS/ H5F_flags - - INTEGER :: H5F_ACC_RDWR_F - INTEGER :: H5F_ACC_RDONLY_F - INTEGER :: H5F_ACC_TRUNC_F - INTEGER :: H5F_ACC_EXCL_F - INTEGER :: H5F_ACC_DEBUG_F - INTEGER :: H5F_SCOPE_LOCAL_F - INTEGER :: H5F_SCOPE_GLOBAL_F - INTEGER :: H5F_CLOSE_DEFAULT_F - INTEGER :: H5F_CLOSE_WEAK_F - INTEGER :: H5F_CLOSE_SEMI_F - INTEGER :: H5F_CLOSE_STRONG_F - INTEGER :: H5F_OBJ_FILE_F - INTEGER :: H5F_OBJ_DATASET_F - INTEGER :: H5F_OBJ_GROUP_F - INTEGER :: H5F_OBJ_DATATYPE_F - INTEGER :: H5F_OBJ_ALL_F - INTEGER :: H5F_LIBVER_EARLIEST_F - INTEGER :: H5F_LIBVER_LATEST_F - INTEGER :: H5F_UNLIMITED_F - - EQUIVALENCE(H5F_flags(1), H5F_ACC_RDWR_F) - EQUIVALENCE(H5F_flags(2), H5F_ACC_RDONLY_F) - EQUIVALENCE(H5F_flags(3), H5F_ACC_TRUNC_F) - EQUIVALENCE(H5F_flags(4), H5F_ACC_EXCL_F) - EQUIVALENCE(H5F_flags(5), H5F_ACC_DEBUG_F) - EQUIVALENCE(H5F_flags(6), H5F_SCOPE_LOCAL_F) - EQUIVALENCE(H5F_flags(7), H5F_SCOPE_GLOBAL_F) - EQUIVALENCE(H5F_flags(8), H5F_CLOSE_DEFAULT_F) - EQUIVALENCE(H5F_flags(9), H5F_CLOSE_WEAK_F) - EQUIVALENCE(H5F_flags(10), H5F_CLOSE_SEMI_F) - EQUIVALENCE(H5F_flags(11), H5F_CLOSE_STRONG_F) - EQUIVALENCE(H5F_flags(12), H5F_OBJ_FILE_F) - EQUIVALENCE(H5F_flags(13), H5F_OBJ_DATASET_F) - EQUIVALENCE(H5F_flags(14), H5F_OBJ_GROUP_F) - EQUIVALENCE(H5F_flags(15), H5F_OBJ_DATATYPE_F) - EQUIVALENCE(H5F_flags(16), H5F_OBJ_ALL_F) - EQUIVALENCE(H5F_flags(17), H5F_LIBVER_EARLIEST_F) - EQUIVALENCE(H5F_flags(18), H5F_LIBVER_LATEST_F) - EQUIVALENCE(H5F_flags(19), H5F_UNLIMITED_F) - ! - ! H5generic flags declaration - ! - INTEGER, PARAMETER :: H5generic_FLAGS_LEN = 9 - INTEGER :: H5generic_flags(H5generic_FLAGS_LEN) - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5generic_FLAGS/ - !DEC$endif - COMMON /H5generic_FLAGS/ H5generic_flags - - INTEGER :: H5_INDEX_UNKNOWN_F - INTEGER :: H5_INDEX_NAME_F - INTEGER :: H5_INDEX_CRT_ORDER_F - INTEGER :: H5_INDEX_N_F - INTEGER :: H5_ITER_UNKNOWN_F - INTEGER :: H5_ITER_INC_F - INTEGER :: H5_ITER_DEC_F - INTEGER :: H5_ITER_NATIVE_F - INTEGER :: H5_ITER_N_F - - EQUIVALENCE(H5generic_flags(1), H5_INDEX_UNKNOWN_F) - EQUIVALENCE(H5generic_flags(2), H5_INDEX_NAME_F) - EQUIVALENCE(H5generic_flags(3), H5_INDEX_CRT_ORDER_F) - EQUIVALENCE(H5generic_flags(4), H5_INDEX_N_F) - EQUIVALENCE(H5generic_flags(5), H5_ITER_UNKNOWN_F) - EQUIVALENCE(H5generic_flags(6), H5_ITER_INC_F) - EQUIVALENCE(H5generic_flags(7), H5_ITER_DEC_F) - EQUIVALENCE(H5generic_flags(8), H5_ITER_NATIVE_F) - EQUIVALENCE(H5generic_flags(9), H5_ITER_N_F) - ! - ! H5G flags declaration - ! - INTEGER, PARAMETER :: H5G_FLAGS_LEN = 12 - INTEGER :: H5G_flags(H5G_FLAGS_LEN) - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5G_FLAGS/ - !DEC$endif - COMMON /H5G_FLAGS/ H5G_flags - - INTEGER :: H5G_UNKNOWN_F - INTEGER :: H5G_GROUP_F - INTEGER :: H5G_DATASET_F - INTEGER :: H5G_TYPE_F - INTEGER :: H5G_LINK_F - INTEGER :: H5G_UDLINK_F - INTEGER :: H5G_SAME_LOC_F - INTEGER :: H5G_LINK_ERROR_F - INTEGER :: H5G_LINK_HARD_F - INTEGER :: H5G_LINK_SOFT_F - INTEGER :: H5G_STORAGE_TYPE_UNKNOWN_F - INTEGER :: H5G_STORAGE_TYPE_SYMBOL_TABLE_F - INTEGER :: H5G_STORAGE_TYPE_COMPACT_F - INTEGER :: H5G_STORAGE_TYPE_DENSE_F - - EQUIVALENCE(H5G_flags(1), H5G_UNKNOWN_F) ! Unknown object type - EQUIVALENCE(H5G_flags(2), H5G_GROUP_F) ! Object is a group - EQUIVALENCE(H5G_flags(3), H5G_DATASET_F) ! Object is a dataset - EQUIVALENCE(H5G_flags(4), H5G_TYPE_F) ! Object is a named data type - EQUIVALENCE(H5G_flags(5), H5G_SAME_LOC_F) - EQUIVALENCE(H5G_flags(6), H5G_LINK_ERROR_F) - EQUIVALENCE(H5G_flags(7), H5G_LINK_HARD_F) - EQUIVALENCE(H5G_flags(8), H5G_LINK_SOFT_F) - - EQUIVALENCE(H5G_flags(9), H5G_STORAGE_TYPE_UNKNOWN_F ) - EQUIVALENCE(H5G_flags(10), H5G_STORAGE_TYPE_SYMBOL_TABLE_F) - EQUIVALENCE(H5G_flags(11), H5G_STORAGE_TYPE_COMPACT_F) - EQUIVALENCE(H5G_flags(12), H5G_STORAGE_TYPE_DENSE_F) - ! - ! H5D flags declaration - ! - - INTEGER, PARAMETER :: H5D_FLAGS_LEN = 25 - INTEGER :: H5D_flags(H5D_FLAGS_LEN) - INTEGER, PARAMETER :: H5D_SIZE_FLAGS_LEN = 2 - INTEGER(SIZE_T) :: H5D_size_flags(H5D_SIZE_FLAGS_LEN) - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5D_FLAGS/ - !DEC$ATTRIBUTES DLLEXPORT :: /H5D_SIZE_FLAGS/ - !DEC$endif - COMMON /H5D_FLAGS/ H5D_flags - COMMON /H5D_SIZE_FLAGS/ H5D_size_flags - - INTEGER :: H5D_COMPACT_F - INTEGER :: H5D_CONTIGUOUS_F - INTEGER :: H5D_CHUNKED_F - - INTEGER :: H5D_ALLOC_TIME_ERROR_F - INTEGER :: H5D_ALLOC_TIME_DEFAULT_F - INTEGER :: H5D_ALLOC_TIME_EARLY_F - INTEGER :: H5D_ALLOC_TIME_LATE_F - INTEGER :: H5D_ALLOC_TIME_INCR_F - - INTEGER :: H5D_SPACE_STS_ERROR_F - INTEGER :: H5D_SPACE_STS_NOT_ALLOCATED_F - INTEGER :: H5D_SPACE_STS_PART_ALLOCATED_F - INTEGER :: H5D_SPACE_STS_ALLOCATED_F - - INTEGER :: H5D_FILL_TIME_ERROR_F - INTEGER :: H5D_FILL_TIME_ALLOC_F - INTEGER :: H5D_FILL_TIME_NEVER_F - - INTEGER :: H5D_FILL_VALUE_ERROR_F - INTEGER :: H5D_FILL_VALUE_UNDEFINED_F - INTEGER :: H5D_FILL_VALUE_DEFAULT_F - INTEGER :: H5D_FILL_VALUE_USER_DEFINED_F - -! shortened "_DEFAULT" to "_DFLT" to satisfy the limit of 31 -! characters for variable names in Fortran. -! shortened "_CONTIGUOUS" to "_CONTIG" to satisfy the limit of 31 -! characters for variable names in Fortran. - - INTEGER(SIZE_T) :: H5D_CHUNK_CACHE_NSLOTS_DFLT_F - INTEGER(SIZE_T) :: H5D_CHUNK_CACHE_NBYTES_DFLT_F - INTEGER :: H5D_CHUNK_CACHE_W0_DFLT_F - INTEGER :: H5D_MPIO_NO_COLLECTIVE_F - INTEGER :: H5D_MPIO_CHUNK_INDEPENDENT_F - INTEGER :: H5D_MPIO_CHUNK_COLLECTIVE_F - INTEGER :: H5D_MPIO_CHUNK_MIXED_F - INTEGER :: H5D_MPIO_CONTIG_COLLECTIVE_F - - EQUIVALENCE(H5D_flags(1), H5D_COMPACT_F) - EQUIVALENCE(H5D_flags(2), H5D_CONTIGUOUS_F) - EQUIVALENCE(H5D_flags(3), H5D_CHUNKED_F) - - EQUIVALENCE(H5D_flags(4), H5D_ALLOC_TIME_ERROR_F) - EQUIVALENCE(H5D_flags(5), H5D_ALLOC_TIME_DEFAULT_F) - EQUIVALENCE(H5D_flags(6), H5D_ALLOC_TIME_EARLY_F) - EQUIVALENCE(H5D_flags(7), H5D_ALLOC_TIME_LATE_F) - EQUIVALENCE(H5D_flags(8), H5D_ALLOC_TIME_INCR_F) - - EQUIVALENCE(H5D_flags(9), H5D_SPACE_STS_ERROR_F) - EQUIVALENCE(H5D_flags(10), H5D_SPACE_STS_NOT_ALLOCATED_F) - EQUIVALENCE(H5D_flags(11), H5D_SPACE_STS_PART_ALLOCATED_F) - EQUIVALENCE(H5D_flags(12), H5D_SPACE_STS_ALLOCATED_F) - - EQUIVALENCE(H5D_flags(13), H5D_FILL_TIME_ERROR_F) - EQUIVALENCE(H5D_flags(14), H5D_FILL_TIME_ALLOC_F) - EQUIVALENCE(H5D_flags(15), H5D_FILL_TIME_NEVER_F) - - EQUIVALENCE(H5D_flags(16), H5D_FILL_VALUE_ERROR_F) - EQUIVALENCE(H5D_flags(17), H5D_FILL_VALUE_UNDEFINED_F) - EQUIVALENCE(H5D_flags(18), H5D_FILL_VALUE_DEFAULT_F) - EQUIVALENCE(H5D_flags(19), H5D_FILL_VALUE_USER_DEFINED_F) - - EQUIVALENCE(H5D_flags(20), H5D_CHUNK_CACHE_W0_DFLT_F) - EQUIVALENCE(H5D_flags(21), H5D_MPIO_NO_COLLECTIVE_F) - EQUIVALENCE(H5D_flags(22), H5D_MPIO_CHUNK_INDEPENDENT_F) - EQUIVALENCE(H5D_flags(23), H5D_MPIO_CHUNK_COLLECTIVE_F) - EQUIVALENCE(H5D_flags(24), H5D_MPIO_CHUNK_MIXED_F) - EQUIVALENCE(H5D_flags(25), H5D_MPIO_CONTIG_COLLECTIVE_F) - - EQUIVALENCE(H5D_size_flags(1), H5D_CHUNK_CACHE_NSLOTS_DFLT_F) - EQUIVALENCE(H5D_size_flags(2), H5D_CHUNK_CACHE_NBYTES_DFLT_F) - - ! - ! H5E flags declaration - ! - INTEGER, PARAMETER :: H5E_FLAGS_LEN = 4 - INTEGER :: H5E_flags(H5E_FLAGS_LEN) - INTEGER, PARAMETER :: H5E_HID_FLAGS_LEN = 1 - INTEGER(HID_T) :: H5E_hid_flags(H5E_HID_FLAGS_LEN) - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5E_FLAGS/ - !DEC$ATTRIBUTES DLLEXPORT :: /H5E_HID_FLAGS/ - !DEC$endif - COMMON /H5E_FLAGS/ H5E_flags - COMMON /H5E_HID_FLAGS/ H5E_hid_flags - - INTEGER(HID_T) :: H5E_DEFAULT_F - INTEGER :: H5E_MAJOR_F - INTEGER :: H5E_MINOR_F - INTEGER :: H5E_WALK_UPWARD_F - INTEGER :: H5E_WALK_DOWNWARD_F - - EQUIVALENCE(H5E_hid_flags(1), H5E_DEFAULT_F) - EQUIVALENCE(H5E_flags(1) , H5E_MAJOR_F) - EQUIVALENCE(H5E_flags(2) , H5E_MINOR_F) - EQUIVALENCE(H5E_flags(3) , H5E_WALK_UPWARD_F) - EQUIVALENCE(H5E_flags(4) , H5E_WALK_DOWNWARD_F) - - ! - ! H5FD flags declaration - ! - INTEGER, PARAMETER :: H5FD_FLAGS_LEN = 11 - INTEGER :: H5FD_flags(H5FD_FLAGS_LEN) - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5FD_FLAGS/ - !DEC$endif - COMMON /H5FD_FLAGS/ H5FD_flags - - INTEGER :: H5FD_MPIO_INDEPENDENT_F - INTEGER :: H5FD_MPIO_COLLECTIVE_F - INTEGER :: H5FD_MEM_NOLIST_F - INTEGER :: H5FD_MEM_DEFAULT_F - INTEGER :: H5FD_MEM_SUPER_F - INTEGER :: H5FD_MEM_BTREE_F - INTEGER :: H5FD_MEM_DRAW_F - INTEGER :: H5FD_MEM_GHEAP_F - INTEGER :: H5FD_MEM_LHEAP_F - INTEGER :: H5FD_MEM_OHDR_F - INTEGER :: H5FD_MEM_NTYPES_F - - EQUIVALENCE(H5FD_flags(1), H5FD_MPIO_INDEPENDENT_F) - EQUIVALENCE(H5FD_flags(2), H5FD_MPIO_COLLECTIVE_F) - EQUIVALENCE(H5FD_flags(3), H5FD_MEM_NOLIST_F) - EQUIVALENCE(H5FD_flags(4), H5FD_MEM_DEFAULT_F) - EQUIVALENCE(H5FD_flags(5), H5FD_MEM_SUPER_F) - EQUIVALENCE(H5FD_flags(6), H5FD_MEM_BTREE_F) - EQUIVALENCE(H5FD_flags(7), H5FD_MEM_DRAW_F) - EQUIVALENCE(H5FD_flags(8), H5FD_MEM_GHEAP_F) - EQUIVALENCE(H5FD_flags(9), H5FD_MEM_LHEAP_F) - EQUIVALENCE(H5FD_flags(10), H5FD_MEM_OHDR_F) - EQUIVALENCE(H5FD_flags(11), H5FD_MEM_NTYPES_F) - ! - ! H5FD file drivers flags declaration - ! - INTEGER, PARAMETER :: H5FD_HID_FLAGS_LEN = 7 - INTEGER(HID_T) :: H5FD_hid_flags(H5FD_HID_FLAGS_LEN) - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5FD_HID_FLAGS/ - !DEC$endif - COMMON /H5FD_HID_FLAGS/ H5FD_hid_flags - - INTEGER(HID_T) :: H5FD_CORE_F - INTEGER(HID_T) :: H5FD_FAMILY_F - INTEGER(HID_T) :: H5FD_LOG_F - INTEGER(HID_T) :: H5FD_MPIO_F - INTEGER(HID_T) :: H5FD_MULTI_F - INTEGER(HID_T) :: H5FD_SEC2_F - INTEGER(HID_T) :: H5FD_STDIO_F - - EQUIVALENCE(H5FD_hid_flags(1), H5FD_CORE_F) - EQUIVALENCE(H5FD_hid_flags(2), H5FD_FAMILY_F) - EQUIVALENCE(H5FD_hid_flags(3), H5FD_LOG_F) - EQUIVALENCE(H5FD_hid_flags(4), H5FD_MPIO_F) - EQUIVALENCE(H5FD_hid_flags(5), H5FD_MULTI_F) - EQUIVALENCE(H5FD_hid_flags(6), H5FD_SEC2_F) - EQUIVALENCE(H5FD_hid_flags(7), H5FD_STDIO_F) - - ! - ! H5I flags declaration - ! - INTEGER, PARAMETER :: H5I_FLAGS_LEN = 7 - INTEGER :: H5I_flags(H5I_FLAGS_LEN) - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5I_FLAGS/ - !DEC$endif - COMMON /H5I_FLAGS/ H5I_flags - - INTEGER :: H5I_FILE_F - INTEGER :: H5I_GROUP_F - INTEGER :: H5I_DATATYPE_F - INTEGER :: H5I_DATASPACE_F - INTEGER :: H5I_DATASET_F - INTEGER :: H5I_ATTR_F - INTEGER :: H5I_BADID_F - - EQUIVALENCE(H5I_flags(1), H5I_FILE_F) - EQUIVALENCE(H5I_flags(2), H5I_GROUP_F) - EQUIVALENCE(H5I_flags(3), H5I_DATATYPE_F) - EQUIVALENCE(H5I_flags(4), H5I_DATASPACE_F) - EQUIVALENCE(H5I_flags(5), H5I_DATASET_F) - EQUIVALENCE(H5I_flags(6), H5I_ATTR_F) - EQUIVALENCE(H5I_flags(7), H5I_BADID_F) - ! - ! H5L flags declaration - ! - INTEGER, PARAMETER :: H5L_FLAGS_LEN = 6 - INTEGER :: H5L_flags(H5L_FLAGS_LEN) - - INTEGER :: H5L_TYPE_ERROR_F - INTEGER :: H5L_TYPE_HARD_F - INTEGER :: H5L_TYPE_SOFT_F - INTEGER :: H5L_TYPE_EXTERNAL_F - INTEGER :: H5L_SAME_LOC_F - INTEGER :: H5L_LINK_CLASS_T_VERS_F - - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5L_FLAGS/ - !DEC$endif - COMMON /H5L_FLAGS/ H5L_flags - - EQUIVALENCE(H5L_flags(1), H5L_TYPE_ERROR_F) - EQUIVALENCE(H5L_flags(2), H5L_TYPE_HARD_F) - EQUIVALENCE(H5L_flags(3), H5L_TYPE_SOFT_F) - EQUIVALENCE(H5L_flags(4), H5L_TYPE_EXTERNAL_F) - EQUIVALENCE(H5L_flags(5), H5L_SAME_LOC_F) - EQUIVALENCE(H5L_flags(6), H5L_LINK_CLASS_T_VERS_F) - ! - ! H5O flags declaration - ! - INTEGER, PARAMETER :: H5O_FLAGS_LEN = 27 - INTEGER :: H5o_flags(H5O_FLAGS_LEN) - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5O_FLAGS/ - !DEC$endif - COMMON /H5O_FLAGS/ H5O_flags - - INTEGER :: H5O_COPY_SHALLOW_HIERARCHY_F ! *** THESE VARIABLES DO - INTEGER :: H5O_COPY_EXPAND_SOFT_LINK_F ! NOT MATCH THE C VARIABLE - INTEGER :: H5O_COPY_EXPAND_EXT_LINK_F ! IN ORDER - INTEGER :: H5O_COPY_EXPAND_REFERENCE_F ! TO STAY UNDER THE - INTEGER :: H5O_COPY_WITHOUT_ATTR_FLAG_F - INTEGER :: H5O_COPY_PRESERVE_NULL_FLAG_F - INTEGER :: H5O_COPY_ALL_F - INTEGER :: H5O_SHMESG_NONE_FLAG_F - INTEGER :: H5O_SHMESG_SDSPACE_FLAG_F - INTEGER :: H5O_SHMESG_DTYPE_FLAG_F - INTEGER :: H5O_SHMESG_FILL_FLAG_F - INTEGER :: H5O_SHMESG_PLINE_FLAG_F - INTEGER :: H5O_SHMESG_ATTR_FLAG_F - INTEGER :: H5O_SHMESG_ALL_FLAG_F - INTEGER :: H5O_HDR_CHUNK0_SIZE_F - INTEGER :: H5O_HDR_ATTR_CRT_ORDER_TRACK_F ! 32 CHARACTER - INTEGER :: H5O_HDR_ATTR_CRT_ORDER_INDEX_F ! VARIABLE - INTEGER :: H5O_HDR_ATTR_STORE_PHASE_CHA_F ! LENGTH *** - INTEGER :: H5O_HDR_STORE_TIMES_F - INTEGER :: H5O_HDR_ALL_FLAGS_F - INTEGER :: H5O_SHMESG_MAX_NINDEXES_F - INTEGER :: H5O_SHMESG_MAX_LIST_SIZE_F - INTEGER :: H5O_TYPE_UNKNOWN_F - INTEGER :: H5O_TYPE_GROUP_F - INTEGER :: H5O_TYPE_DATASET_F - INTEGER :: H5O_TYPE_NAMED_DATATYPE_F - INTEGER :: H5O_TYPE_NTYPES_F - - EQUIVALENCE(h5o_flags(1) , H5O_COPY_SHALLOW_HIERARCHY_F) - EQUIVALENCE(h5o_flags(2) , H5O_COPY_EXPAND_SOFT_LINK_F) - EQUIVALENCE(h5o_flags(3) , H5O_COPY_EXPAND_EXT_LINK_F) - EQUIVALENCE(h5o_flags(4) , H5O_COPY_EXPAND_REFERENCE_F) - EQUIVALENCE(h5o_flags(5) , H5O_COPY_WITHOUT_ATTR_FLAG_F) - EQUIVALENCE(h5o_flags(6) , H5O_COPY_PRESERVE_NULL_FLAG_F) - EQUIVALENCE(h5o_flags(7) , H5O_COPY_ALL_F) - EQUIVALENCE(h5o_flags(8) , H5O_SHMESG_NONE_FLAG_F) - EQUIVALENCE(h5o_flags(9) , H5O_SHMESG_SDSPACE_FLAG_F) - EQUIVALENCE(h5o_flags(10) , H5O_SHMESG_DTYPE_FLAG_F) - EQUIVALENCE(h5o_flags(11) , H5O_SHMESG_FILL_FLAG_F) - EQUIVALENCE(h5o_flags(12) , H5O_SHMESG_PLINE_FLAG_F) - EQUIVALENCE(h5o_flags(13) , H5O_SHMESG_ATTR_FLAG_F) - EQUIVALENCE(h5o_flags(14) , H5O_SHMESG_ALL_FLAG_F) - EQUIVALENCE(h5o_flags(15) , H5O_HDR_CHUNK0_SIZE_F) - EQUIVALENCE(h5o_flags(16) , H5O_HDR_ATTR_CRT_ORDER_TRACK_F) - EQUIVALENCE(h5o_flags(17) , H5O_HDR_ATTR_CRT_ORDER_INDEX_F) - EQUIVALENCE(h5o_flags(18) , H5O_HDR_ATTR_STORE_PHASE_CHA_F) - EQUIVALENCE(h5o_flags(19) , H5O_HDR_STORE_TIMES_F) - EQUIVALENCE(h5o_flags(20) , H5O_HDR_ALL_FLAGS_F) - EQUIVALENCE(h5o_flags(21) , H5O_SHMESG_MAX_NINDEXES_F) - EQUIVALENCE(h5o_flags(22) , H5O_SHMESG_MAX_LIST_SIZE_F) - EQUIVALENCE(h5o_flags(23) , H5O_TYPE_UNKNOWN_F) - EQUIVALENCE(h5o_flags(24) , H5O_TYPE_GROUP_F) - EQUIVALENCE(h5o_flags(25) , H5O_TYPE_DATASET_F) - EQUIVALENCE(h5o_flags(26) , H5O_TYPE_NAMED_DATATYPE_F) - EQUIVALENCE(h5o_flags(27) , H5O_TYPE_NTYPES_F) - - ! - ! H5P flags declaration - ! - INTEGER, PARAMETER :: H5P_FLAGS_LEN = 18 - INTEGER(HID_T) H5P_flags(H5P_FLAGS_LEN) - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5P_FLAGS/ - !DEC$endif - COMMON /H5P_FLAGS/ H5P_flags - - INTEGER(HID_T) :: H5P_FILE_CREATE_F - INTEGER(HID_T) :: H5P_FILE_ACCESS_F - INTEGER(HID_T) :: H5P_DATASET_CREATE_F - INTEGER(HID_T) :: H5P_DATASET_XFER_F - INTEGER(HID_T) :: H5P_FILE_MOUNT_F - INTEGER(HID_T) :: H5P_DEFAULT_F - INTEGER(HID_T) :: H5P_ROOT_F - INTEGER(HID_T) :: H5P_OBJECT_CREATE_F - INTEGER(HID_T) :: H5P_DATASET_ACCESS_F - INTEGER(HID_T) :: H5P_GROUP_CREATE_F - INTEGER(HID_T) :: H5P_GROUP_ACCESS_F - INTEGER(HID_T) :: H5P_DATATYPE_CREATE_F - INTEGER(HID_T) :: H5P_DATATYPE_ACCESS_F - INTEGER(HID_T) :: H5P_STRING_CREATE_F - INTEGER(HID_T) :: H5P_ATTRIBUTE_CREATE_F - INTEGER(HID_T) :: H5P_OBJECT_COPY_F - INTEGER(HID_T) :: H5P_LINK_CREATE_F - INTEGER(HID_T) :: H5P_LINK_ACCESS_F - - EQUIVALENCE(H5P_flags(1), H5P_FILE_CREATE_F) - EQUIVALENCE(H5P_flags(2), H5P_FILE_ACCESS_F) - EQUIVALENCE(H5P_flags(3), H5P_DATASET_CREATE_F) - EQUIVALENCE(H5P_flags(4), H5P_DATASET_XFER_F) - EQUIVALENCE(H5P_flags(5), H5P_FILE_MOUNT_F) - EQUIVALENCE(H5P_flags(6), H5P_DEFAULT_F) - EQUIVALENCE(H5P_flags(7), H5P_ROOT_F) - EQUIVALENCE(H5P_flags(8), H5P_OBJECT_CREATE_F) - EQUIVALENCE(H5P_flags(9), H5P_DATASET_ACCESS_F) - EQUIVALENCE(H5P_flags(10), H5P_GROUP_CREATE_F) - EQUIVALENCE(H5P_flags(11), H5P_GROUP_ACCESS_F) - EQUIVALENCE(H5P_flags(12), H5P_DATATYPE_CREATE_F) - EQUIVALENCE(H5P_flags(13), H5P_DATATYPE_ACCESS_F) - EQUIVALENCE(H5P_flags(14), H5P_STRING_CREATE_F) - EQUIVALENCE(H5P_flags(15), H5P_ATTRIBUTE_CREATE_F) - EQUIVALENCE(H5P_flags(16), H5P_OBJECT_COPY_F) - EQUIVALENCE(H5P_flags(17), H5P_LINK_CREATE_F) - EQUIVALENCE(H5P_flags(18), H5P_LINK_ACCESS_F) - - ! - ! H5P integers flags declaration - ! - INTEGER, PARAMETER :: H5P_FLAGS_INT_LEN = 2 - INTEGER :: H5P_flags_int(H5P_FLAGS_INT_LEN) - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5P_FLAGS_INT/ - !DEC$endif - COMMON /H5P_FLAGS_INT/ H5P_flags_int - INTEGER :: H5P_CRT_ORDER_INDEXED_F - INTEGER :: H5P_CRT_ORDER_TRACKED_F - EQUIVALENCE(H5P_flags_int(1), H5P_CRT_ORDER_INDEXED_F) - EQUIVALENCE(H5P_flags_int(2), H5P_CRT_ORDER_TRACKED_F) - ! - ! H5R flags declaration - ! - INTEGER, PARAMETER :: H5R_FLAGS_LEN = 2 - INTEGER :: H5R_flags(H5R_FLAGS_LEN) - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5R_FLAGS/ - !DEC$endif - COMMON /H5R_FLAGS/ H5R_flags - - INTEGER :: H5R_OBJECT_F - INTEGER :: H5R_DATASET_REGION_F - - EQUIVALENCE(H5R_flags(1), H5R_OBJECT_F) - EQUIVALENCE(H5R_flags(2), H5R_DATASET_REGION_F) - - ! - ! H5S flags declaration - ! - INTEGER, PARAMETER :: H5S_FLAGS_LEN = 19 - INTEGER :: H5S_flags(H5S_FLAGS_LEN) - INTEGER, PARAMETER :: H5S_HSIZE_FLAGS_LEN = 1 - INTEGER(HSIZE_T) H5S_hsize_flags(H5S_HSIZE_FLAGS_LEN) - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5S_FLAGS/ - !DEC$ATTRIBUTES DLLEXPORT :: /H5S_HSIZE_FLAGS/ - !DEC$endif - COMMON /H5S_FLAGS/ H5S_flags - COMMON /H5S_HSIZE_FLAGS/ H5S_hsize_flags - - INTEGER(HSIZE_T) :: H5S_UNLIMITED_F - - INTEGER :: H5S_SCALAR_F - INTEGER :: H5S_SIMPLE_F - INTEGER :: H5S_NULL_F - - INTEGER :: H5S_ALL_F - - INTEGER :: H5S_SELECT_NOOP_F - INTEGER :: H5S_SELECT_SET_F - INTEGER :: H5S_SELECT_OR_F - INTEGER :: H5S_SELECT_AND_F - INTEGER :: H5S_SELECT_XOR_F - INTEGER :: H5S_SELECT_NOTB_F - INTEGER :: H5S_SELECT_NOTA_F - INTEGER :: H5S_SELECT_APPEND_F - INTEGER :: H5S_SELECT_PREPEND_F - INTEGER :: H5S_SELECT_INVALID_F - - INTEGER :: H5S_SEL_ERROR_F - INTEGER :: H5S_SEL_NONE_F - INTEGER :: H5S_SEL_POINTS_F - INTEGER :: H5S_SEL_HYPERSLABS_F - INTEGER :: H5S_SEL_ALL_F - - EQUIVALENCE(H5S_hsize_flags(1), H5S_UNLIMITED_F) - EQUIVALENCE(H5S_flags(1), H5S_SCALAR_F) - EQUIVALENCE(H5S_flags(2), H5S_SIMPLE_F) - EQUIVALENCE(H5S_flags(3), H5S_NULL_F) - EQUIVALENCE(H5S_flags(4), H5S_SELECT_SET_F) - EQUIVALENCE(H5S_flags(5), H5S_SELECT_OR_F) - EQUIVALENCE(H5S_flags(6), H5S_ALL_F) - - EQUIVALENCE(H5S_flags(7), H5S_SELECT_NOOP_F) - EQUIVALENCE(H5S_flags(8), H5S_SELECT_AND_F) - EQUIVALENCE(H5S_flags(9), H5S_SELECT_XOR_F) - EQUIVALENCE(H5S_flags(10), H5S_SELECT_NOTB_F) - EQUIVALENCE(H5S_flags(11), H5S_SELECT_NOTA_F) - EQUIVALENCE(H5S_flags(12), H5S_SELECT_APPEND_F) - EQUIVALENCE(H5S_flags(13), H5S_SELECT_PREPEND_F) - EQUIVALENCE(H5S_flags(14), H5S_SELECT_INVALID_F) - - - EQUIVALENCE(H5S_flags(15), H5S_SEL_ERROR_F) - EQUIVALENCE(H5S_flags(16), H5S_SEL_NONE_F) - EQUIVALENCE(H5S_flags(17), H5S_SEL_POINTS_F) - EQUIVALENCE(H5S_flags(18), H5S_SEL_HYPERSLABS_F) - EQUIVALENCE(H5S_flags(19), H5S_SEL_ALL_F) - - ! - ! H5T flags declaration - ! - INTEGER, PARAMETER :: H5T_FLAGS_LEN = 35 - INTEGER :: H5T_flags(H5T_FLAGS_LEN) - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5T_FLAGS/ - !DEC$endif - COMMON /H5T_FLAGS/ H5T_flags - - INTEGER :: H5T_NO_CLASS_F - INTEGER :: H5T_INTEGER_F - INTEGER :: H5T_FLOAT_F - INTEGER :: H5T_TIME_F - INTEGER :: H5T_STRING_F - INTEGER :: H5T_BITFIELD_F - INTEGER :: H5T_OPAQUE_F - INTEGER :: H5T_COMPOUND_F - INTEGER :: H5T_REFERENCE_F - INTEGER :: H5T_ENUM_F - INTEGER :: H5T_VLEN_F - INTEGER :: H5T_ARRAY_F - INTEGER :: H5T_ORDER_LE_F - INTEGER :: H5T_ORDER_BE_F - INTEGER :: H5T_ORDER_VAX_F - INTEGER :: H5T_ORDER_NONE_F - INTEGER :: H5T_ORDER_MIXED_F - INTEGER :: H5T_PAD_ZERO_F - INTEGER :: H5T_PAD_ONE_F - INTEGER :: H5T_PAD_BACKGROUND_F - INTEGER :: H5T_PAD_ERROR_F - INTEGER :: H5T_SGN_NONE_F - INTEGER :: H5T_SGN_2_F - INTEGER :: H5T_SGN_ERROR_F - INTEGER :: H5T_NORM_IMPLIED_F - INTEGER :: H5T_NORM_MSBSET_F - INTEGER :: H5T_NORM_NONE_F - INTEGER :: H5T_CSET_ASCII_F - INTEGER :: H5T_CSET_UTF8_F - INTEGER :: H5T_STR_NULLTERM_F - INTEGER :: H5T_STR_NULLPAD_F - INTEGER :: H5T_STR_SPACEPAD_F - INTEGER :: H5T_STR_ERROR_F - INTEGER :: H5T_DIR_ASCEND_F - INTEGER :: H5T_DIR_DESCEND_F - - EQUIVALENCE(H5T_flags(1), H5T_NO_CLASS_F) - EQUIVALENCE(H5T_flags(2), H5T_INTEGER_F) - EQUIVALENCE(H5T_flags(3), H5T_FLOAT_F) - EQUIVALENCE(H5T_flags(4), H5T_TIME_F) - EQUIVALENCE(H5T_flags(5), H5T_STRING_F) - EQUIVALENCE(H5T_flags(6), H5T_BITFIELD_F) - EQUIVALENCE(H5T_flags(7), H5T_OPAQUE_F) - EQUIVALENCE(H5T_flags(8), H5T_COMPOUND_F) - EQUIVALENCE(H5T_flags(9), H5T_REFERENCE_F) - EQUIVALENCE(H5T_flags(10), H5T_ENUM_F) - EQUIVALENCE(H5T_flags(11), H5T_ORDER_LE_F) - EQUIVALENCE(H5T_flags(12), H5T_ORDER_BE_F) - EQUIVALENCE(H5T_flags(13), H5T_ORDER_MIXED_F) - EQUIVALENCE(H5T_flags(14), H5T_ORDER_VAX_F) - EQUIVALENCE(H5T_flags(15), H5T_ORDER_NONE_F) - EQUIVALENCE(H5T_flags(16), H5T_PAD_ZERO_F) - EQUIVALENCE(H5T_flags(17), H5T_PAD_ONE_F) - EQUIVALENCE(H5T_flags(18), H5T_PAD_BACKGROUND_F) - EQUIVALENCE(H5T_flags(19), H5T_PAD_ERROR_F) - EQUIVALENCE(H5T_flags(20), H5T_SGN_NONE_F) - EQUIVALENCE(H5T_flags(21), H5T_SGN_2_F) - EQUIVALENCE(H5T_flags(22), H5T_SGN_ERROR_F) - EQUIVALENCE(H5T_flags(23), H5T_NORM_IMPLIED_F) - EQUIVALENCE(H5T_flags(24), H5T_NORM_MSBSET_F) - EQUIVALENCE(H5T_flags(25), H5T_NORM_NONE_F) - EQUIVALENCE(H5T_flags(26), H5T_CSET_ASCII_F) - EQUIVALENCE(H5T_flags(27), H5T_CSET_UTF8_F) - EQUIVALENCE(H5T_flags(28), H5T_STR_NULLTERM_F) - EQUIVALENCE(H5T_flags(29), H5T_STR_NULLPAD_F) - EQUIVALENCE(H5T_flags(30), H5T_STR_SPACEPAD_F) - EQUIVALENCE(H5T_flags(31), H5T_STR_ERROR_F) - EQUIVALENCE(H5T_flags(32), H5T_VLEN_F) - EQUIVALENCE(H5T_flags(33), H5T_ARRAY_F) - EQUIVALENCE(H5T_flags(34), H5T_DIR_ASCEND_F) - EQUIVALENCE(H5T_flags(35), H5T_DIR_DESCEND_F) - ! - ! H5Z flags declaration - ! - INTEGER, PARAMETER :: H5Z_FLAGS_LEN = 20 - INTEGER :: H5Z_flags(H5Z_FLAGS_LEN) - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5Z_FLAGS/ - !DEC$endif - COMMON /H5Z_FLAGS/ H5Z_flags - - INTEGER :: H5Z_FILTER_ERROR_F - INTEGER :: H5Z_FILTER_NONE_F - INTEGER :: H5Z_FILTER_ALL_F - INTEGER :: H5Z_FILTER_DEFLATE_F - INTEGER :: H5Z_FILTER_SHUFFLE_F - INTEGER :: H5Z_FILTER_FLETCHER32_F - INTEGER :: H5Z_FILTER_SZIP_F - INTEGER :: H5Z_ERROR_EDC_F - INTEGER :: H5Z_DISABLE_EDC_F - INTEGER :: H5Z_ENABLE_EDC_F - INTEGER :: H5Z_NO_EDC_F - INTEGER :: H5Z_FLAG_OPTIONAL_F - INTEGER :: H5Z_FILTER_ENCODE_ENABLED_F - INTEGER :: H5Z_FILTER_DECODE_ENABLED_F - INTEGER :: H5Z_FILTER_NBIT_F - INTEGER :: H5Z_FILTER_SCALEOFFSET_F - INTEGER :: H5Z_SO_FLOAT_DSCALE_F - INTEGER :: H5Z_SO_FLOAT_ESCALE_F - INTEGER :: H5Z_SO_INT_F - INTEGER :: H5Z_SO_INT_MINBITS_DEFAULT_F - - EQUIVALENCE(H5Z_flags(1), H5Z_FILTER_ERROR_F) - EQUIVALENCE(H5Z_flags(2), H5Z_FILTER_NONE_F) - EQUIVALENCE(H5Z_flags(3), H5Z_FILTER_DEFLATE_F) - EQUIVALENCE(H5Z_flags(4), H5Z_FILTER_SHUFFLE_F) - EQUIVALENCE(H5Z_flags(5), H5Z_FILTER_FLETCHER32_F) - EQUIVALENCE(H5Z_flags(6), H5Z_ERROR_EDC_F) - EQUIVALENCE(H5Z_flags(7), H5Z_DISABLE_EDC_F) - EQUIVALENCE(H5Z_flags(8), H5Z_ENABLE_EDC_F) - EQUIVALENCE(H5Z_flags(9), H5Z_NO_EDC_F) - EQUIVALENCE(H5Z_flags(10), H5Z_FILTER_SZIP_F) - EQUIVALENCE(H5Z_flags(11), H5Z_FLAG_OPTIONAL_F) - EQUIVALENCE(H5Z_flags(12), H5Z_FILTER_ENCODE_ENABLED_F) - EQUIVALENCE(H5Z_flags(13), H5Z_FILTER_DECODE_ENABLED_F) - EQUIVALENCE(H5Z_flags(14), H5Z_FILTER_ALL_F) - EQUIVALENCE(H5Z_flags(15), H5Z_FILTER_NBIT_F) - EQUIVALENCE(H5Z_flags(16), H5Z_FILTER_SCALEOFFSET_F) - EQUIVALENCE(H5Z_flags(17), H5Z_SO_FLOAT_DSCALE_F) - EQUIVALENCE(H5Z_flags(18), H5Z_SO_FLOAT_ESCALE_F) - EQUIVALENCE(H5Z_flags(19), H5Z_SO_INT_F) - EQUIVALENCE(H5Z_flags(20), H5Z_SO_INT_MINBITS_DEFAULT_F) - - ! - ! H5 Library flags declaration - ! - INTEGER, PARAMETER :: H5LIB_FLAGS_LEN = 2 - INTEGER :: H5LIB_flags(H5LIB_FLAGS_LEN) - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5LIB_FLAGS/ - !DEC$endif - COMMON /H5LIB_FLAGS/ H5LIB_flags - INTEGER :: H5_SZIP_EC_OM_F - INTEGER :: H5_SZIP_NN_OM_F - ! - EQUIVALENCE(H5LIB_flags(1), H5_SZIP_EC_OM_F) - EQUIVALENCE(H5LIB_flags(2), H5_SZIP_NN_OM_F) - - - ! General H5 flags declarations - ! -!!$ INTEGER, PARAMETER :: H5_FLAGS_LEN = 2 -!!$ INTEGER H5_flags(H5_FLAGS_LEN) -!!$!DEC$if defined(BUILD_HDF5_DLL) -!!$!DEC$ATTRIBUTES DLLEXPORT :: /H5_FLAGS/ -!!$!DEC$endif -!!$ COMMON /H5_FLAGS/ H5_flags -!!$ -!!$ INTEGER :: _F -!!$ INTEGER :: H5F_SCOPE_LOCAL_F -!!$ -!!$ EQUIVALENCE(H5F_flags(1), H5F_SCOPE_GLOBAL_F) -!!$ EQUIVALENCE(H5F_flags(2), H5F_SCOPE_LOCAL_F) - -END MODULE H5GLOBAL - diff --git a/fortran/src/H5f90kit.c b/fortran/src/H5f90kit.c index 0bc721f..c6c874f 100644 --- a/fortran/src/H5f90kit.c +++ b/fortran/src/H5f90kit.c @@ -1,6 +1,6 @@ /****h* H5f90kit/H5f90kit * PURPOSE - * Routines from HDF4 to deal with C-FORTRAN issues: + * Routines from HDF4 to deal with C-FORTRAN issues: * * HD5f2cstring -- convert a Fortran string to a C string * HD5packFstring -- convert a C string into a Fortran string @@ -31,16 +31,16 @@ /****if* H5f90kit/HDf2cstring * NAME * HD5f2cstring -- convert a Fortran string to a C string - * char * HDf2cstring(fdesc, len) + * char * HDf2cstring(fdesc, len) * INPUTS * _fcd fdesc; IN: Fortran string descriptor - * int len; IN: length of Fortran string + * int len; IN: length of Fortran string * RETURNS - * Pointer to the C string if success, else NULL + * Pointer to the C string if success, else NULL * PURPOSE - * Chop off trailing blanks off of a Fortran string and - * move it into a newly allocated C string. It is up - * to the user to free this string. + * Chop off trailing blanks off of a Fortran string and + * move it into a newly allocated C string. It is up + * to the user to free this string. * SOURCE */ char * @@ -72,21 +72,21 @@ HD5f2cstring(_fcd fdesc, size_t len) /****if* H5f90kit/HD5packFstring * NAME * HD5packFstring -- convert a C string into a Fortran string - * int HD5packFstring(src, dest, len) + * int HD5packFstring(src, dest, len) * INPUTS - * char * src; IN: source string - * int len; IN: length of string + * char * src; IN: source string + * int len; IN: length of string * OUTPUTS - * char * dest; OUT: destination + * char * dest; OUT: destination * RETURNS * SUCCEED / FAIL * PURPOSE - * given a NULL terminated C string 'src' convert it to - * a space padded Fortran string 'dest' of length 'len' + * given a NULL terminated C string 'src' convert it to + * a space padded Fortran string 'dest' of length 'len' * - * This is very similar to HDc2fstr except that function does - * it in place and this one copies. We should probably only - * support one of these. + * This is very similar to HDc2fstr except that function does + * it in place and this one copies. We should probably only + * support one of these. * SOURCE */ void diff --git a/fortran/src/H5f90proto.h b/fortran/src/H5f90proto.h index 6bde877..b26e985 100644 --- a/fortran/src/H5f90proto.h +++ b/fortran/src/H5f90proto.h @@ -18,6 +18,7 @@ #define _H5f90proto_H #include "H5public.h" +#include "H5f90.h" H5_FCDLL char * HD5f2cstring (_fcd fdesc, size_t len); H5_FCDLL void HD5packFstring(char *src, char *dest, size_t len); @@ -80,1236 +81,505 @@ typedef struct H5O_info_t_f { /* * Functions from H5Ff.c */ -#define nh5fcreate_c H5_FC_FUNC_(h5fcreate_c, H5FCREATE_C) -#define nh5fflush_c H5_FC_FUNC_(h5fflush_c, H5FFLUSH_C) -#define nh5fclose_c H5_FC_FUNC_(h5fclose_c, H5FCLOSE_C) -#define nh5fopen_c H5_FC_FUNC_(h5fopen_c, H5FOPEN_C) -#define nh5fis_hdf5_c H5_FC_FUNC_(h5fis_hdf5_c, H5FIS_HDF5_C) -#define nh5fmount_c H5_FC_FUNC_(h5fmount_c, H5FMOUNT_C) -#define nh5funmount_c H5_FC_FUNC_(h5funmount_c, H5FUNMOUNT_C) -#define nh5freopen_c H5_FC_FUNC_(h5freopen_c, H5FREOPEN_C) -#define nh5fget_create_plist_c H5_FC_FUNC_(h5fget_create_plist_c, H5FGET_CREATE_PLIST_C) -#define nh5fget_access_plist_c H5_FC_FUNC_(h5fget_access_plist_c, H5FGET_ACCESS_PLIST_C) -#define nh5fget_obj_count_c H5_FC_FUNC_(h5fget_obj_count_c, H5FGET_OBJ_COUNT_C) -#define nh5fget_obj_ids_c H5_FC_FUNC_(h5fget_obj_ids_c, H5FGET_OBJ_IDS_C) -#define nh5fget_freespace_c H5_FC_FUNC_(h5fget_freespace_c, H5FGET_FREESPACE_C) -#define nh5fget_name_c H5_FC_FUNC_(h5fget_name_c, H5FGET_NAME_C) -#define nh5fget_filesize_c H5_FC_FUNC_(h5fget_filesize_c, H5FGET_FILESIZE_C) - -H5_FCDLL int_f nh5fcreate_c (_fcd name, int_f *namelen, int_f *access_flags, hid_t_f *crt_prp, hid_t_f *acc_prp, hid_t_f *file_id); -H5_FCDLL int_f nh5fopen_c (_fcd name, int_f *namelen, int_f *access_flags, hid_t_f *acc_prp, hid_t_f *file_id); -H5_FCDLL int_f nh5fis_hdf5_c (_fcd name, int_f *namelen, int_f *flag); -H5_FCDLL int_f nh5fclose_c (hid_t_f *file_id); -H5_FCDLL int_f nh5fmount_c (hid_t_f *loc_id, _fcd dsetname, int_f *namelen, hid_t_f *file_id, hid_t_f *acc_prp); -H5_FCDLL int_f nh5funmount_c (hid_t_f *loc_id, _fcd dsetname, int_f *namelen); -H5_FCDLL int_f nh5freopen_c (hid_t_f *file_id1, hid_t_f *file_id2); -H5_FCDLL int_f nh5fget_create_plist_c (hid_t_f *file_id, hid_t_f *prop_id); -H5_FCDLL int_f nh5fget_access_plist_c (hid_t_f *file_id, hid_t_f *access_id); -H5_FCDLL int_f nh5fget_obj_count_c (hid_t_f *file_id, int_f *obj_type, size_t_f *obj_count); -H5_FCDLL int_f nh5fget_obj_ids_c (hid_t_f *file_id, int_f *obj_type, size_t_f *max_objs, hid_t_f *obj_ids, size_t_f *num_objs); -H5_FCDLL int_f nh5fget_freespace_c (hid_t_f *file_id, hssize_t_f *free_space); +H5_FCDLL int_f h5fcreate_c(_fcd name, int_f *namelen, int_f *access_flags, hid_t_f *crt_prp, hid_t_f *acc_prp, hid_t_f *file_id); +H5_FCDLL int_f h5fopen_c(_fcd name, int_f *namelen, int_f *access_flags, hid_t_f *acc_prp, hid_t_f *file_id); +H5_FCDLL int_f h5fis_hdf5_c(_fcd name, int_f *namelen, int_f *flag); +H5_FCDLL int_f h5fclose_c(hid_t_f *file_id); +H5_FCDLL int_f h5fmount_c(hid_t_f *loc_id, _fcd dsetname, int_f *namelen, hid_t_f *file_id, hid_t_f *acc_prp); +H5_FCDLL int_f h5funmount_c(hid_t_f *loc_id, _fcd dsetname, int_f *namelen); +H5_FCDLL int_f h5freopen_c(hid_t_f *file_id1, hid_t_f *file_id2); +H5_FCDLL int_f h5fget_create_plist_c(hid_t_f *file_id, hid_t_f *prop_id); +H5_FCDLL int_f h5fget_access_plist_c(hid_t_f *file_id, hid_t_f *access_id); +H5_FCDLL int_f h5fget_obj_count_c(hid_t_f *file_id, int_f *obj_type, size_t_f *obj_count); +H5_FCDLL int_f h5fget_obj_ids_c(hid_t_f *file_id, int_f *obj_type, size_t_f *max_objs, hid_t_f *obj_ids, size_t_f *num_objs); +H5_FCDLL int_f h5fget_freespace_c(hid_t_f *file_id, hssize_t_f *free_space); H5_FCDLL int_f h5fget_file_image_c(hid_t_f *file_id, void *buf_ptr, size_t_f *buf_len, size_t_f *buf_req); -H5_FCDLL int_f nh5fflush_c (hid_t_f *obj_id, int_f *scope); -H5_FCDLL int_f nh5fget_name_c(hid_t_f *obj_id, size_t_f *size, _fcd buf, size_t_f *buflen); -H5_FCDLL int_f nh5fget_filesize_c(hid_t_f *file_id, hsize_t_f *size); +H5_FCDLL int_f h5fflush_c(hid_t_f *obj_id, int_f *scope); +H5_FCDLL int_f h5fget_name_c(hid_t_f *obj_id, size_t_f *size, _fcd buf, size_t_f *buflen); +H5_FCDLL int_f h5fget_filesize_c(hid_t_f *file_id, hsize_t_f *size); /* * Functions from H5Sf.c */ -#define nh5screate_simple_c H5_FC_FUNC_(h5screate_simple_c, H5SCREATE_SIMPLE_C) -#define nh5sclose_c H5_FC_FUNC_(h5sclose_c, H5SCLOSE_C) -#define nh5screate_c H5_FC_FUNC_(h5screate_c, H5SCREATE_C) -#define nh5scopy_c H5_FC_FUNC_(h5scopy_c, H5SCOPY_C) -#define nh5sget_select_hyper_nblocks_c H5_FC_FUNC_(h5sget_select_hyper_nblocks_c, H5SGET_SELECT_HYPER_NBLOCKS_C) -#define nh5sget_select_hyper_blocklist_c H5_FC_FUNC_(h5sget_select_hyper_blocklist_c, H5SGET_SELECT_HYPER_BLOCKLIST_C) -#define nh5sget_select_elem_npoints_c H5_FC_FUNC_(h5sget_select_elem_npoints_c, H5SGET_SELECT_ELEM_NPOINTS_C) -#define nh5sget_select_elem_pointlist_c H5_FC_FUNC_(h5sget_select_elem_pointlist_c, H5SGET_SELECT_ELEM_POINTLIST_C) -#define nh5sget_select_bounds_c H5_FC_FUNC_(h5sget_select_bounds_c, H5SGET_SELECT_BOUNDS_C) -#define nh5sselect_all_c H5_FC_FUNC_(h5sselect_all_c, H5SSELECT_ALL_C) -#define nh5sselect_none_c H5_FC_FUNC_(h5sselect_none_c, H5SSELECT_NONE_C) -#define nh5sselect_valid_c H5_FC_FUNC_(h5sselect_valid_c, H5SSELECT_VALID_C) -#define nh5sget_simple_extent_npoints_c H5_FC_FUNC_(h5sget_simple_extent_npoints_c, H5SGET_SIMPLE_EXTENT_NPOINTS_C) -#define nh5sget_select_npoints_c H5_FC_FUNC_(h5sget_select_npoints_c, H5SGET_SELECT_NPOINTS_C) -#define nh5sget_simple_extent_ndims_c H5_FC_FUNC_(h5sget_simple_extent_ndims_c, H5SGET_SIMPLE_EXTENT_NDIMS_C) -#define nh5sget_simple_extent_type_c H5_FC_FUNC_(h5sget_simple_extent_type_c, H5SGET_SIMPLE_EXTENT_TYPE_C) -#define nh5soffset_simple_c H5_FC_FUNC_(h5soffset_simple_c, H5SOFFSET_SIMPLE_C) -#define nh5sset_extent_simple_c H5_FC_FUNC_(h5sset_extent_simple_c, H5SSET_EXTENT_SIMPLE_C) -#define nh5sis_simple_c H5_FC_FUNC_(h5sis_simple_c, H5SIS_SIMPLE_C) -#define nh5sextent_class_c H5_FC_FUNC_(h5sextent_class_c, H5SEXTENT_CLASS_C) -#define nh5sget_simple_extent_dims_c H5_FC_FUNC_(h5sget_simple_extent_dims_c, H5SGET_SIMPLE_EXTENT_DIMS_C) -#define nh5sextent_copy_c H5_FC_FUNC_(h5sextent_copy_c, H5SEXTENT_COPY_C) -#define nh5sset_extent_none_c H5_FC_FUNC_(h5sset_extent_none_c, H5SSET_EXTENT_NONE_C) -#define nh5sselect_hyperslab_c H5_FC_FUNC_(h5sselect_hyperslab_c, H5SSELECT_HYPERSLAB_C) -#define nh5scombine_hyperslab_c H5_FC_FUNC_(h5scombine_hyperslab_c, H5SCOMBINE_HYPERSLAB_C) -#define nh5scombine_select_c H5_FC_FUNC_(h5scombine_select_c, H5SCOMBINE_SELECT_C) -#define nh5sselect_select_c H5_FC_FUNC_(h5sselect_select_c, H5SSELECT_SELECT_C) -#define nh5sget_select_type_c H5_FC_FUNC_(h5sget_select_type_c, H5SGET_SELECT_TYPE_C) -#define nh5sselect_elements_c H5_FC_FUNC_(h5sselect_elements_c, H5SSELECT_ELEMENTS_C) -#define nh5sdecode_c H5_FC_FUNC_(h5sdecode_c, H5SDECODE_C) -#define nh5sencode_c H5_FC_FUNC_(h5sencode_c, H5SENCODE_C) -#define nh5sextent_equal_c H5_FC_FUNC_(h5sextent_equal_c, H5SEXTENT_EQUAL_C) - -H5_FCDLL int_f nh5screate_simple_c ( int_f *rank, hsize_t_f *dims, hsize_t_f *maxdims, hid_t_f *space_id ); -H5_FCDLL int_f nh5sclose_c ( hid_t_f *space_id ); -H5_FCDLL int_f nh5screate_c ( int_f *classtype, hid_t_f *space_id ); -H5_FCDLL int_f nh5scopy_c ( hid_t_f *space_id , hid_t_f *new_space_id); -H5_FCDLL int_f nh5sget_select_hyper_nblocks_c( hid_t_f *space_id , hssize_t_f * num_blocks); -H5_FCDLL int_f nh5sget_select_hyper_blocklist_c( hid_t_f *space_id ,hsize_t_f * startblock, hsize_t_f * num_blocks, hsize_t_f * buf); -H5_FCDLL int_f nh5sget_select_bounds_c( hid_t_f *space_id , hsize_t_f * start, hsize_t_f * end); -H5_FCDLL int_f nh5sget_select_elem_npoints_c( hid_t_f *space_id , hssize_t_f * num_points); -H5_FCDLL int_f nh5sget_select_elem_pointlist_c( hid_t_f *space_id ,hsize_t_f * startpoint, hsize_t_f * numpoints, hsize_t_f * buf); -H5_FCDLL int_f nh5sselect_all_c ( hid_t_f *space_id ); -H5_FCDLL int_f nh5sselect_none_c ( hid_t_f *space_id ); -H5_FCDLL int_f nh5sselect_valid_c ( hid_t_f *space_id , int_f *flag ); -H5_FCDLL int_f nh5sget_simple_extent_npoints_c ( hid_t_f *space_id , hsize_t_f *npoints ); -H5_FCDLL int_f nh5sget_select_npoints_c ( hid_t_f *space_id , hssize_t_f *npoints ); -H5_FCDLL int_f nh5sget_simple_extent_ndims_c ( hid_t_f *space_id , int_f *ndims ); -H5_FCDLL int_f nh5sget_simple_extent_type_c ( hid_t_f *space_id , int_f *classtype); -H5_FCDLL int_f nh5soffset_simple_c ( hid_t_f *space_id , hssize_t_f *offset); -H5_FCDLL int_f nh5sset_extent_simple_c ( hid_t_f *space_id , int_f *rank, hsize_t_f * current_size, hsize_t_f *maximum_size); -H5_FCDLL int_f nh5sis_simple_c ( hid_t_f *space_id , int_f *flag ); -H5_FCDLL int_f nh5sextent_class_c ( hid_t_f *space_id , int_f *classtype); -H5_FCDLL int_f nh5sget_simple_extent_dims_c ( hid_t_f *space_id , hsize_t_f *dims, hsize_t_f *maxdims); -H5_FCDLL int_f nh5sextent_copy_c ( hid_t_f *dest_space_id , hid_t_f *source_space_id); -H5_FCDLL int_f nh5sset_extent_none_c ( hid_t_f *space_id ); -H5_FCDLL int_f nh5sselect_hyperslab_c ( hid_t_f *space_id , int_f *op, hsize_t_f *start, hsize_t_f *count, hsize_t_f *stride, hsize_t_f *block); -H5_FCDLL int_f nh5sget_select_type_c ( hid_t_f *space_id , int_f *op); -H5_FCDLL int_f nh5sselect_elements_c ( hid_t_f *space_id , int_f *op, size_t_f *nelements, hsize_t_f *coord); -H5_FCDLL int_f nh5scombine_hyperslab_c ( hid_t_f *space_id , int_f *op, hsize_t_f *start, hsize_t_f *count, hsize_t_f *stride, hsize_t_f *block, hid_t_f *hyper_id); -H5_FCDLL int_f nh5scombine_select_c ( hid_t_f *space1_id , int_f *op, hid_t_f *space2_id, hid_t_f *ds_id); -H5_FCDLL int_f nh5sselect_select_c ( hid_t_f *space1_id , int_f *op, hid_t_f *space2_id); -H5_FCDLL int_f nh5sdecode_c ( _fcd buf, hid_t_f *obj_id ); -H5_FCDLL int_f nh5sencode_c (_fcd buf, hid_t_f *obj_id, size_t_f *nalloc ); -H5_FCDLL int_f nh5sextent_equal_c ( hid_t_f * space1_id, hid_t_f *space2_id, hid_t_f *c_equal); +H5_FCDLL int_f h5screate_simple_c( int_f *rank, hsize_t_f *dims, hsize_t_f *maxdims, hid_t_f *space_id ); +H5_FCDLL int_f h5sclose_c( hid_t_f *space_id ); +H5_FCDLL int_f h5screate_c( int_f *classtype, hid_t_f *space_id ); +H5_FCDLL int_f h5scopy_c( hid_t_f *space_id , hid_t_f *new_space_id); +H5_FCDLL int_f h5sget_select_hyper_nblocks_c( hid_t_f *space_id , hssize_t_f * num_blocks); +H5_FCDLL int_f h5sget_select_hyper_blocklist_c( hid_t_f *space_id ,hsize_t_f * startblock, hsize_t_f * num_blocks, hsize_t_f * buf); +H5_FCDLL int_f h5sget_select_bounds_c( hid_t_f *space_id , hsize_t_f * start, hsize_t_f * end); +H5_FCDLL int_f h5sget_select_elem_npoints_c( hid_t_f *space_id , hssize_t_f * num_points); +H5_FCDLL int_f h5sget_select_elem_pointlist_c( hid_t_f *space_id ,hsize_t_f * startpoint, hsize_t_f * numpoints, hsize_t_f * buf); +H5_FCDLL int_f h5sselect_all_c( hid_t_f *space_id ); +H5_FCDLL int_f h5sselect_none_c( hid_t_f *space_id ); +H5_FCDLL int_f h5sselect_valid_c( hid_t_f *space_id , int_f *flag ); +H5_FCDLL int_f h5sget_simple_extent_npoints_c( hid_t_f *space_id , hsize_t_f *npoints ); +H5_FCDLL int_f h5sget_select_npoints_c( hid_t_f *space_id , hssize_t_f *npoints ); +H5_FCDLL int_f h5sget_simple_extent_ndims_c( hid_t_f *space_id , int_f *ndims ); +H5_FCDLL int_f h5sget_simple_extent_type_c( hid_t_f *space_id , int_f *classtype); +H5_FCDLL int_f h5soffset_simple_c( hid_t_f *space_id , hssize_t_f *offset); +H5_FCDLL int_f h5sset_extent_simple_c( hid_t_f *space_id , int_f *rank, hsize_t_f * current_size, hsize_t_f *maximum_size); +H5_FCDLL int_f h5sis_simple_c( hid_t_f *space_id , int_f *flag ); +H5_FCDLL int_f h5sget_simple_extent_dims_c( hid_t_f *space_id , hsize_t_f *dims, hsize_t_f *maxdims); +H5_FCDLL int_f h5sextent_copy_c( hid_t_f *dest_space_id , hid_t_f *source_space_id); +H5_FCDLL int_f h5sset_extent_none_c( hid_t_f *space_id ); +H5_FCDLL int_f h5sselect_hyperslab_c( hid_t_f *space_id , int_f *op, hsize_t_f *start, hsize_t_f *count, hsize_t_f *stride, hsize_t_f *block); +H5_FCDLL int_f h5sget_select_type_c( hid_t_f *space_id , int_f *op); +H5_FCDLL int_f h5sselect_elements_c( hid_t_f *space_id , int_f *op, size_t_f *nelements, hsize_t_f *coord); +H5_FCDLL int_f h5scombine_hyperslab_c( hid_t_f *space_id , int_f *op, hsize_t_f *start, hsize_t_f *count, hsize_t_f *stride, hsize_t_f *block, hid_t_f *hyper_id); +H5_FCDLL int_f h5scombine_select_c( hid_t_f *space1_id , int_f *op, hid_t_f *space2_id, hid_t_f *ds_id); +H5_FCDLL int_f h5sselect_select_c( hid_t_f *space1_id , int_f *op, hid_t_f *space2_id); +H5_FCDLL int_f h5sdecode_c( _fcd buf, hid_t_f *obj_id ); +H5_FCDLL int_f h5sencode_c(_fcd buf, hid_t_f *obj_id, size_t_f *nalloc ); +H5_FCDLL int_f h5sextent_equal_c( hid_t_f * space1_id, hid_t_f *space2_id, hid_t_f *c_equal); /* * Functions from H5Df.c */ -#define nh5dcreate_c H5_FC_FUNC_(h5dcreate_c, H5DCREATE_C) -#define nh5dclose_c H5_FC_FUNC_(h5dclose_c, H5DCLOSE_C) -#define nh5dopen_c H5_FC_FUNC_(h5dopen_c, H5DOPEN_C) -#define nh5dwrite_c H5_FC_FUNC_(h5dwrite_c, H5DWRITE_C) -#define nh5dwrite_integer_s_c H5_FC_FUNC_(h5dwrite_integer_s_c, H5DWRITE_INTEGER_S_C) -#define nh5dwrite_integer_1_c H5_FC_FUNC_(h5dwrite_integer_1_c, H5DWRITE_INTEGER_1_C) -#define nh5dwrite_integer_2_c H5_FC_FUNC_(h5dwrite_integer_2_c, H5DWRITE_INTEGER_2_C) -#define nh5dwrite_integer_3_c H5_FC_FUNC_(h5dwrite_integer_3_c, H5DWRITE_INTEGER_3_C) -#define nh5dwrite_integer_4_c H5_FC_FUNC_(h5dwrite_integer_4_c, H5DWRITE_INTEGER_4_C) -#define nh5dwrite_integer_5_c H5_FC_FUNC_(h5dwrite_integer_5_c, H5DWRITE_INTEGER_5_C) -#define nh5dwrite_integer_6_c H5_FC_FUNC_(h5dwrite_integer_6_c, H5DWRITE_INTEGER_6_C) -#define nh5dwrite_integer_7_c H5_FC_FUNC_(h5dwrite_integer_7_c, H5DWRITE_INTEGER_7_C) -#define nh5dwrite_real_s_c H5_FC_FUNC_(h5dwrite_real_s_c, H5DWRITE_REAL_S_C) -#define nh5dwrite_real_1_c H5_FC_FUNC_(h5dwrite_real_1_c, H5DWRITE_REAL_1_C) -#define nh5dwrite_real_2_c H5_FC_FUNC_(h5dwrite_real_2_c, H5DWRITE_REAL_2_C) -#define nh5dwrite_real_3_c H5_FC_FUNC_(h5dwrite_real_3_c, H5DWRITE_REAL_3_C) -#define nh5dwrite_real_4_c H5_FC_FUNC_(h5dwrite_real_4_c, H5DWRITE_REAL_4_C) -#define nh5dwrite_real_5_c H5_FC_FUNC_(h5dwrite_real_5_c, H5DWRITE_REAL_5_C) -#define nh5dwrite_real_6_c H5_FC_FUNC_(h5dwrite_real_6_c, H5DWRITE_REAL_6_C) -#define nh5dwrite_real_7_c H5_FC_FUNC_(h5dwrite_real_7_c, H5DWRITE_REAL_7_C) -#define nh5dwrite_double_s_c H5_FC_FUNC_(h5dwrite_double_s_c, H5DWRITE_DOUBLE_S_C) -#define nh5dwrite_double_1_c H5_FC_FUNC_(h5dwrite_double_1_c, H5DWRITE_DOUBLE_1_C) -#define nh5dwrite_double_2_c H5_FC_FUNC_(h5dwrite_double_2_c, H5DWRITE_DOUBLE_2_C) -#define nh5dwrite_double_3_c H5_FC_FUNC_(h5dwrite_double_3_c, H5DWRITE_DOUBLE_3_C) -#define nh5dwrite_double_4_c H5_FC_FUNC_(h5dwrite_double_4_c, H5DWRITE_DOUBLE_4_C) -#define nh5dwrite_double_5_c H5_FC_FUNC_(h5dwrite_double_5_c, H5DWRITE_DOUBLE_5_C) -#define nh5dwrite_double_6_c H5_FC_FUNC_(h5dwrite_double_6_c, H5DWRITE_DOUBLE_6_C) -#define nh5dwrite_double_7_c H5_FC_FUNC_(h5dwrite_double_7_c, H5DWRITE_DOUBLE_7_C) -#define nh5dwrite_ref_obj_c H5_FC_FUNC_(h5dwrite_ref_obj_c, H5DWRITE_REF_OBJ_C) -#define nh5dwrite_ref_reg_c H5_FC_FUNC_(h5dwrite_ref_reg_c, H5DWRITE_REF_REG_C) -#define nh5dwritec_c H5_FC_FUNC_(h5dwritec_c, H5DWRITEC_C) -#define nh5dwritec_s_c H5_FC_FUNC_(h5dwritec_s_c, H5DWRITEC_S_C) -#define nh5dwritec_1_c H5_FC_FUNC_(h5dwritec_1_c, H5DWRITEC_1_C) -#define nh5dwritec_2_c H5_FC_FUNC_(h5dwritec_2_c, H5DWRITEC_2_C) -#define nh5dwritec_3_c H5_FC_FUNC_(h5dwritec_3_c, H5DWRITEC_3_C) -#define nh5dwritec_4_c H5_FC_FUNC_(h5dwritec_4_c, H5DWRITEC_4_C) -#define nh5dwritec_5_c H5_FC_FUNC_(h5dwritec_5_c, H5DWRITEC_5_C) -#define nh5dwritec_6_c H5_FC_FUNC_(h5dwritec_6_c, H5DWRITEC_6_C) -#define nh5dwritec_7_c H5_FC_FUNC_(h5dwritec_7_c, H5DWRITEC_7_C) -#define nh5dread_c H5_FC_FUNC_(h5dread_c, H5DREAD_C) -#define nh5dread_integer_s_c H5_FC_FUNC_(h5dread_integer_s_c, H5DREAD_INTEGER_S_C) -#define nh5dread_integer_1_c H5_FC_FUNC_(h5dread_integer_1_c, H5DREAD_INTEGER_1_C) -#define nh5dread_integer_2_c H5_FC_FUNC_(h5dread_integer_2_c, H5DREAD_INTEGER_2_C) -#define nh5dread_integer_3_c H5_FC_FUNC_(h5dread_integer_3_c, H5DREAD_INTEGER_3_C) -#define nh5dread_integer_4_c H5_FC_FUNC_(h5dread_integer_4_c, H5DREAD_INTEGER_4_C) -#define nh5dread_integer_5_c H5_FC_FUNC_(h5dread_integer_5_c, H5DREAD_INTEGER_5_C) -#define nh5dread_integer_6_c H5_FC_FUNC_(h5dread_integer_6_c, H5DREAD_INTEGER_6_C) -#define nh5dread_integer_7_c H5_FC_FUNC_(h5dread_integer_7_c, H5DREAD_INTEGER_7_C) -#define nh5dread_real_s_c H5_FC_FUNC_(h5dread_real_s_c, H5DREAD_REAL_S_C) -#define nh5dread_real_1_c H5_FC_FUNC_(h5dread_real_1_c, H5DREAD_REAL_1_C) -#define nh5dread_real_2_c H5_FC_FUNC_(h5dread_real_2_c, H5DREAD_REAL_2_C) -#define nh5dread_real_3_c H5_FC_FUNC_(h5dread_real_3_c, H5DREAD_REAL_3_C) -#define nh5dread_real_4_c H5_FC_FUNC_(h5dread_real_4_c, H5DREAD_REAL_4_C) -#define nh5dread_real_5_c H5_FC_FUNC_(h5dread_real_5_c, H5DREAD_REAL_5_C) -#define nh5dread_real_6_c H5_FC_FUNC_(h5dread_real_6_c, H5DREAD_REAL_6_C) -#define nh5dread_real_7_c H5_FC_FUNC_(h5dread_real_7_c, H5DREAD_REAL_7_C) -#define nh5dread_double_s_c H5_FC_FUNC_(h5dread_double_s_c, H5DREAD_DOUBLE_S_C) -#define nh5dread_double_1_c H5_FC_FUNC_(h5dread_double_1_c, H5DREAD_DOUBLE_1_C) -#define nh5dread_double_2_c H5_FC_FUNC_(h5dread_double_2_c, H5DREAD_DOUBLE_2_C) -#define nh5dread_double_3_c H5_FC_FUNC_(h5dread_double_3_c, H5DREAD_DOUBLE_3_C) -#define nh5dread_double_4_c H5_FC_FUNC_(h5dread_double_4_c, H5DREAD_DOUBLE_4_C) -#define nh5dread_double_5_c H5_FC_FUNC_(h5dread_double_5_c, H5DREAD_DOUBLE_5_C) -#define nh5dread_double_6_c H5_FC_FUNC_(h5dread_double_6_c, H5DREAD_DOUBLE_6_C) -#define nh5dread_double_7_c H5_FC_FUNC_(h5dread_double_7_c, H5DREAD_DOUBLE_7_C) -#define nh5dread_c_b H5_FC_FUNC_(h5dread_c_b, H5DREAD_C_B) -#define nh5dread_ref_reg_c H5_FC_FUNC_(h5dread_ref_reg_c, H5DREAD_REF_REG_C) -#define nh5dread_ref_obj_c H5_FC_FUNC_(h5dread_ref_obj_c, H5DREAD_REF_OBJ_C) -#define nh5dreadc_c H5_FC_FUNC_(h5dreadc_c, H5DREADC_C) -#define nh5dreadc_s_c H5_FC_FUNC_(h5dreadc_s_c, H5DREADC_S_C) -#define nh5dreadc_1_c H5_FC_FUNC_(h5dreadc_1_c, H5DREADC_1_C) -#define nh5dreadc_2_c H5_FC_FUNC_(h5dreadc_2_c, H5DREADC_2_C) -#define nh5dreadc_3_c H5_FC_FUNC_(h5dreadc_3_c, H5DREADC_3_C) -#define nh5dreadc_4_c H5_FC_FUNC_(h5dreadc_4_c, H5DREADC_4_C) -#define nh5dreadc_5_c H5_FC_FUNC_(h5dreadc_5_c, H5DREADC_5_C) -#define nh5dreadc_6_c H5_FC_FUNC_(h5dreadc_6_c, H5DREADC_6_C) -#define nh5dreadc_7_c H5_FC_FUNC_(h5dreadc_7_c, H5DREADC_7_C) -#define nh5dreadc_c_b H5_FC_FUNC_(h5dreadc_c_b, H5DREADC_C_B) -#define nh5dget_space_c H5_FC_FUNC_(h5dget_space_c, H5DGET_SPACE_C) -#define nh5dget_type_c H5_FC_FUNC_(h5dget_type_c, H5DGET_TYPE_C) -#define nh5dget_create_plist_c H5_FC_FUNC_(h5dget_create_plist_c, H5DGET_CREATE_PLIST_C) -#define nh5dset_extent_c H5_FC_FUNC_(h5dset_extent_c, H5DSET_EXTENT_C) -#define nh5dget_storage_size_c H5_FC_FUNC_(h5dget_storage_size_c, H5DGET_STORAGE_SIZE_C) -#define nh5dvlen_get_max_len_c H5_FC_FUNC_(h5dvlen_get_max_len_c, H5DVLEN_GET_MAX_LEN_C) -#define nh5dwrite_vl_integer_c H5_FC_FUNC_(h5dwrite_vl_integer_c, H5DWRITE_VL_INTEGER_C) -#define nh5dread_vl_integer_c H5_FC_FUNC_(h5dread_vl_integer_c, H5DREAD_VL_INTEGER_C) -#define nh5dwrite_vl_real_c H5_FC_FUNC_(h5dwrite_vl_real_c, H5DWRITE_VL_REAL_C) -#define nh5dread_vl_real_c H5_FC_FUNC_(h5dread_vl_real_c, H5DREAD_VL_REAL_C) -#define nh5dwrite_vl_string_c H5_FC_FUNC_(h5dwrite_vl_string_c, H5DWRITE_VL_STRING_C) -#define nh5dread_vl_string_c H5_FC_FUNC_(h5dread_vl_string_c, H5DREAD_VL_STRING_C) -#define nh5dfillc_c H5_FC_FUNC_(h5dfillc_c, H5DFILLC_C) -#define nh5dfill_integer_c H5_FC_FUNC_(h5dfill_integer_c, H5DFILL_INTEGER_C) -#define nh5dfill_real_c H5_FC_FUNC_(h5dfill_real_c, H5DFILL_REAL_C) -#define nh5dfill_double_c H5_FC_FUNC_(h5dfill_double_c, H5DFILL_DOUBLE_C) -#define nh5dget_space_status_c H5_FC_FUNC_(h5dget_space_status_c, H5DGET_SPACE_STATUS_C) -#define nh5dcreate_anon_c H5_FC_FUNC_(h5dcreate_anon_c, H5DCREATE_ANON_C) -#define nh5dget_access_plist_c H5_FC_FUNC_(h5dget_access_plist_c, H5DGET_ACCESS_PLIST_C) - -H5_FCDLL int_f nh5dcreate_c (hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *type_id, hid_t_f *space_id, +H5_FCDLL int_f h5dcreate_c(hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *type_id, hid_t_f *space_id, hid_t_f *lcpl_id, hid_t_f *dcpl_id, hid_t_f *dapl_id, hid_t_f *dset_id); -H5_FCDLL int_f nh5dopen_c (hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *dapl_id, hid_t_f *dset_id); -H5_FCDLL int_f nh5dclose_c ( hid_t_f *dset_id ); -H5_FCDLL int_f nh5dwrite_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf, hsize_t_f *dims); -H5_FCDLL int_f nh5dwrite_integer_s_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf, hsize_t_f *dims); -H5_FCDLL int_f nh5dwrite_integer_1_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf, hsize_t_f *dims); -H5_FCDLL int_f nh5dwrite_integer_2_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf, hsize_t_f *dims); -H5_FCDLL int_f nh5dwrite_integer_3_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf, hsize_t_f *dims); -H5_FCDLL int_f nh5dwrite_integer_4_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf, hsize_t_f *dims); -H5_FCDLL int_f nh5dwrite_integer_5_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf, hsize_t_f *dims); -H5_FCDLL int_f nh5dwrite_integer_6_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf, hsize_t_f *dims); -H5_FCDLL int_f nh5dwrite_integer_7_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf, hsize_t_f *dims); - -H5_FCDLL int_f nh5dwrite_real_s_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf, hsize_t_f *dims); -H5_FCDLL int_f nh5dwrite_real_1_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf, hsize_t_f *dims); -H5_FCDLL int_f nh5dwrite_real_2_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf, hsize_t_f *dims); -H5_FCDLL int_f nh5dwrite_real_3_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf, hsize_t_f *dims); -H5_FCDLL int_f nh5dwrite_real_4_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf, hsize_t_f *dims); -H5_FCDLL int_f nh5dwrite_real_5_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf, hsize_t_f *dims); -H5_FCDLL int_f nh5dwrite_real_6_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf, hsize_t_f *dims); -H5_FCDLL int_f nh5dwrite_real_7_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf, hsize_t_f *dims); - -H5_FCDLL int_f nh5dwrite_double_s_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf, hsize_t_f *dims); -H5_FCDLL int_f nh5dwrite_double_1_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf, hsize_t_f *dims); -H5_FCDLL int_f nh5dwrite_double_2_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf, hsize_t_f *dims); -H5_FCDLL int_f nh5dwrite_double_3_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf, hsize_t_f *dims); -H5_FCDLL int_f nh5dwrite_double_4_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf, hsize_t_f *dims); -H5_FCDLL int_f nh5dwrite_double_5_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf, hsize_t_f *dims); -H5_FCDLL int_f nh5dwrite_double_6_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf, hsize_t_f *dims); -H5_FCDLL int_f nh5dwrite_double_7_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf, hsize_t_f *dims); - -H5_FCDLL int_f nh5dwrite_vl_integer_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, int_f *buf, hsize_t_f *dims, size_t_f *len); -H5_FCDLL int_f nh5dwrite_vl_real_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, real_f *buf, hsize_t_f *dims, size_t_f *len); -H5_FCDLL int_f nh5dwrite_vl_string_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, _fcd buf, hsize_t_f *dims, size_t_f *len); -H5_FCDLL int_f nh5dwrite_ref_obj_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, haddr_t_f *buf, hsize_t_f *dims); -H5_FCDLL int_f nh5dwrite_ref_reg_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, int_f *buf, hsize_t_f *dims); - -H5_FCDLL int_f nh5dwritec_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, _fcd buf, hsize_t_f *dims); - -H5_FCDLL int_f nh5dwritec_s_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, _fcd buf, hsize_t_f *dims); -H5_FCDLL int_f nh5dwritec_1_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, _fcd buf, hsize_t_f *dims); -H5_FCDLL int_f nh5dwritec_2_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, _fcd buf, hsize_t_f *dims); -H5_FCDLL int_f nh5dwritec_3_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, _fcd buf, hsize_t_f *dims); -H5_FCDLL int_f nh5dwritec_4_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, _fcd buf, hsize_t_f *dims); -H5_FCDLL int_f nh5dwritec_5_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, _fcd buf, hsize_t_f *dims); -H5_FCDLL int_f nh5dwritec_6_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, _fcd buf, hsize_t_f *dims); -H5_FCDLL int_f nh5dwritec_7_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, _fcd buf, hsize_t_f *dims); - -H5_FCDLL int_f nh5dread_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf, hsize_t_f *dims); - -H5_FCDLL int_f nh5dread_integer_s_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf, hsize_t_f *dims); -H5_FCDLL int_f nh5dread_integer_1_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf, hsize_t_f *dims); -H5_FCDLL int_f nh5dread_integer_2_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf, hsize_t_f *dims); -H5_FCDLL int_f nh5dread_integer_3_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf, hsize_t_f *dims); -H5_FCDLL int_f nh5dread_integer_4_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf, hsize_t_f *dims); -H5_FCDLL int_f nh5dread_integer_5_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf, hsize_t_f *dims); -H5_FCDLL int_f nh5dread_integer_6_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf, hsize_t_f *dims); -H5_FCDLL int_f nh5dread_integer_7_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf, hsize_t_f *dims); - -H5_FCDLL int_f nh5dread_real_s_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf, hsize_t_f *dims); -H5_FCDLL int_f nh5dread_real_1_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf, hsize_t_f *dims); -H5_FCDLL int_f nh5dread_real_2_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf, hsize_t_f *dims); -H5_FCDLL int_f nh5dread_real_3_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf, hsize_t_f *dims); -H5_FCDLL int_f nh5dread_real_4_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf, hsize_t_f *dims); -H5_FCDLL int_f nh5dread_real_5_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf, hsize_t_f *dims); -H5_FCDLL int_f nh5dread_real_6_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf, hsize_t_f *dims); -H5_FCDLL int_f nh5dread_real_7_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf, hsize_t_f *dims); - -H5_FCDLL int_f nh5dread_double_s_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf, hsize_t_f *dims); -H5_FCDLL int_f nh5dread_double_1_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf, hsize_t_f *dims); -H5_FCDLL int_f nh5dread_double_2_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf, hsize_t_f *dims); -H5_FCDLL int_f nh5dread_double_3_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf, hsize_t_f *dims); -H5_FCDLL int_f nh5dread_double_4_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf, hsize_t_f *dims); -H5_FCDLL int_f nh5dread_double_5_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf, hsize_t_f *dims); -H5_FCDLL int_f nh5dread_double_6_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf, hsize_t_f *dims); -H5_FCDLL int_f nh5dread_double_7_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf, hsize_t_f *dims); - -H5_FCDLL int_f nh5dread_vl_integer_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, int_f *buf, hsize_t_f *dims, size_t_f *len); -H5_FCDLL int_f nh5dread_vl_real_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, real_f *buf, hsize_t_f *dims, size_t_f *len); -H5_FCDLL int_f nh5dread_vl_string_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, _fcd buf, hsize_t_f *dims, size_t_f *len); -H5_FCDLL int_f nh5dread_ref_obj_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, haddr_t_f * buf, hsize_t_f *dims); -H5_FCDLL int_f nh5dread_ref_reg_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, int_f * buf, hsize_t_f *dims); - -H5_FCDLL int_f nh5dreadc_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, _fcd buf, hsize_t_f *dims); - -H5_FCDLL int_f nh5dreadc_s_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, _fcd buf, hsize_t_f *dims); -H5_FCDLL int_f nh5dreadc_1_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, _fcd buf, hsize_t_f *dims); -H5_FCDLL int_f nh5dreadc_2_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, _fcd buf, hsize_t_f *dims); -H5_FCDLL int_f nh5dreadc_3_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, _fcd buf, hsize_t_f *dims); -H5_FCDLL int_f nh5dreadc_4_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, _fcd buf, hsize_t_f *dims); -H5_FCDLL int_f nh5dreadc_5_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, _fcd buf, hsize_t_f *dims); -H5_FCDLL int_f nh5dreadc_6_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, _fcd buf, hsize_t_f *dims); -H5_FCDLL int_f nh5dreadc_7_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, _fcd buf, hsize_t_f *dims); -H5_FCDLL int_f nh5dget_access_plist_c (hid_t_f *dset_id, hid_t_f *plist_id); - - -H5_FCDLL int_f nh5dget_space_c ( hid_t_f *dset_id , hid_t_f *space_id); -H5_FCDLL int_f nh5dget_type_c ( hid_t_f *dset_id , hid_t_f *type_id); -H5_FCDLL int_f nh5dget_create_plist_c ( hid_t_f *dset_id , hid_t_f *plist_id); -H5_FCDLL int_f nh5dset_extent_c ( hid_t_f *dset_id , hsize_t_f *dims); -H5_FCDLL int_f nh5dvlen_get_max_len_c(hid_t_f *dataset_id, hid_t_f *type_id, hid_t_f *space_id, size_t_f *len); -H5_FCDLL int_f nh5dget_storage_size_c(hid_t_f *dataset_id, hsize_t_f *size); -H5_FCDLL int_f nh5dfillc_c(_fcd fill_value, hid_t_f *fill_type_id, hid_t_f *space_id, _fcd buf, hid_t_f *mem_type_id); +H5_FCDLL int_f h5dopen_c(hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *dapl_id, hid_t_f *dset_id); +H5_FCDLL int_f h5dclose_c( hid_t_f *dset_id ); + +H5_FCDLL int_f h5dwrite_vl_integer_c(hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, int_f *buf, hsize_t_f *dims, size_t_f *len); +H5_FCDLL int_f h5dwrite_vl_real_c(hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, real_f *buf, hsize_t_f *dims, size_t_f *len); +H5_FCDLL int_f h5dwrite_vl_string_c(hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, _fcd buf, hsize_t_f *dims, size_t_f *len); +H5_FCDLL int_f h5dwrite_ref_reg_c(hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, int_f *buf, hsize_t_f *dims); +H5_FCDLL int_f h5dread_vl_integer_c(hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, int_f *buf, hsize_t_f *dims, size_t_f *len); +H5_FCDLL int_f h5dread_vl_real_c(hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, real_f *buf, hsize_t_f *dims, size_t_f *len); +H5_FCDLL int_f h5dread_vl_string_c(hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, _fcd buf, hsize_t_f *dims, size_t_f *len); +H5_FCDLL int_f h5dread_ref_reg_c(hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, int_f * buf, hsize_t_f *dims); +H5_FCDLL int_f h5dget_access_plist_c(hid_t_f *dset_id, hid_t_f *plist_id); +H5_FCDLL int_f h5dget_space_c( hid_t_f *dset_id , hid_t_f *space_id); +H5_FCDLL int_f h5dget_type_c( hid_t_f *dset_id , hid_t_f *type_id); +H5_FCDLL int_f h5dget_create_plist_c( hid_t_f *dset_id , hid_t_f *plist_id); +H5_FCDLL int_f h5dset_extent_c( hid_t_f *dset_id , hsize_t_f *dims); +H5_FCDLL int_f h5dvlen_get_max_len_c(hid_t_f *dataset_id, hid_t_f *type_id, hid_t_f *space_id, size_t_f *len); +H5_FCDLL int_f h5dget_storage_size_c(hid_t_f *dataset_id, hsize_t_f *size); H5_FCDLL int_f h5dfill_c(void * fill_value, hid_t_f *fill_type_id, hid_t_f *space_id, void * buf, hid_t_f *mem_type_id); -H5_FCDLL int_f nh5dfill_integer_c(void * fill_value, hid_t_f *fill_type_id, hid_t_f *space_id, void * buf, hid_t_f *mem_type_id); -H5_FCDLL int_f nh5dfill_real_c(void * fill_value, hid_t_f *fill_type_id, hid_t_f *space_id, void * buf, hid_t_f *mem_type_id); -H5_FCDLL int_f nh5dfill_double_c(void * fill_value, hid_t_f *fill_type_id, hid_t_f *space_id, void * buf, hid_t_f *mem_type_id); -H5_FCDLL int_f nh5dget_space_status_c ( hid_t_f *dset_id, int_f *flag); -H5_FCDLL int_f nh5dcreate_anon_c (hid_t_f *loc_id, hid_t_f *type_id, hid_t_f *space_id, +H5_FCDLL int_f h5dget_space_status_c( hid_t_f *dset_id, int_f *flag); +H5_FCDLL int_f h5dcreate_anon_c(hid_t_f *loc_id, hid_t_f *type_id, hid_t_f *space_id, hid_t_f *dcpl_id, hid_t_f *dapl_id, hid_t_f *dset_id); -H5_FCDLL int_f h5dwrite_f_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, +H5_FCDLL int_f h5dwrite_f_c(hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf); -H5_FCDLL int_f h5dread_f_c ( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_space_id, +H5_FCDLL int_f h5dread_f_c( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf); -H5_FCDLL int_f h5dvlen_reclaim_c (hid_t_f *type_id , hid_t_f *space_id, hid_t_f *plist_id, void *buf); +H5_FCDLL int_f h5dvlen_reclaim_c(hid_t_f *type_id , hid_t_f *space_id, hid_t_f *plist_id, void *buf); + /* * Functions from H5Gf.c */ -#define nh5gcreate_c H5_FC_FUNC_(h5gcreate_c, H5GCREATE_C) -#define nh5gclose_c H5_FC_FUNC_(h5gclose_c, H5GCLOSE_C) -#define nh5gopen_c H5_FC_FUNC_(h5gopen_c, H5GOPEN_C) -#define nh5gget_obj_info_idx_c H5_FC_FUNC_(h5gget_obj_info_idx_c, H5GGET_OBJ_INFO_IDX_C) -#define nh5gn_members_c H5_FC_FUNC_(h5gn_members_c, H5GN_MEMBERS_C) -#define nh5glink_c H5_FC_FUNC_(h5glink_c, H5GLINK_C) -#define nh5glink2_c H5_FC_FUNC_(h5glink2_c, H5GLINK2_C) -#define nh5gunlink_c H5_FC_FUNC_(h5gunlink_c, H5GUNLINK_C) -#define nh5gmove_c H5_FC_FUNC_(h5gmove_c, H5GMOVE_C) -#define nh5gmove2_c H5_FC_FUNC_(h5gmove2_c, H5GMOVE2_C) -#define nh5gget_linkval_c H5_FC_FUNC_(h5gget_linkval_c, H5GGET_LINKVAL_C) -#define nh5gset_comment_c H5_FC_FUNC_(h5gset_comment_c, H5GSET_COMMENT_C) -#define nh5gget_comment_c H5_FC_FUNC_(h5gget_comment_c, H5GGET_COMMENT_C) -#define nh5gcreate_anon_c H5_FC_FUNC_(h5gcreate_anon_c, H5GCREATE_ANON_C) -#define nh5gget_create_plist_c H5_FC_FUNC_(h5gget_create_plist_c, H5GGET_CREATE_PLIST_C) -#define nh5gget_info_c H5_FC_FUNC_(h5gget_info_c, H5GGET_INFO_C) -#define nh5gget_info_by_idx_c H5_FC_FUNC_(h5gget_info_by_idx_c, H5GGET_INFO_BY_IDX_C) -#define nh5gget_info_by_name_c H5_FC_FUNC_(h5gget_info_by_name_c, H5GGET_INFO_BY_NAME_C) - - -H5_FCDLL int_f nh5gcreate_c (hid_t_f *loc_id, _fcd name, int_f *namelen, size_t_f *size_hint, hid_t_f *grp_id, +H5_FCDLL int_f h5gcreate_c(hid_t_f *loc_id, _fcd name, int_f *namelen, size_t_f *size_hint, hid_t_f *grp_id, hid_t_f *lcpl_id, hid_t_f *gcpl_id, hid_t_f *gapl_id); -H5_FCDLL int_f nh5gopen_c (hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *gapl_id, hid_t_f *grp_id); -H5_FCDLL int_f nh5gclose_c ( hid_t_f *grp_id ); -H5_FCDLL int_f nh5gget_obj_info_idx_c (hid_t_f *loc_id, _fcd name, int_f *namelen, int_f *idx, _fcd obj_name, int_f *obj_namelen, int_f *obj_type); -H5_FCDLL int_f nh5gn_members_c (hid_t_f *loc_id, _fcd name, int_f *namelen, int_f *nmembers); -H5_FCDLL int_f nh5glink_c (hid_t_f *loc_id, int_f *link_type, _fcd current_name, int_f *current_namelen, _fcd new_name, int_f *new_namelen); -H5_FCDLL int_f nh5glink2_c (hid_t_f *cur_loc_id, _fcd cur_name, int_f *cur_namelen, int_f *link_type, hid_t_f *new_loc_id, _fcd new_name, int_f *new_namelen); -H5_FCDLL int_f nh5gunlink_c (hid_t_f *loc_id, _fcd name, int_f *namelen); -H5_FCDLL int_f nh5gmove_c (hid_t_f *loc_id, _fcd src_name, int_f *src_namelen, _fcd dst_name, int_f *dst_namelen); -H5_FCDLL int_f nh5gmove2_c (hid_t_f *src_loc_id, _fcd src_name, int_f *src_namelen, hid_t_f *dst_loc_id,_fcd dst_name, int_f *dst_namelen); -H5_FCDLL int_f nh5gget_linkval_c (hid_t_f *loc_id, _fcd name, int_f *namelen, size_t_f *size, _fcd value ); -H5_FCDLL int_f nh5gset_comment_c (hid_t_f *loc_id, _fcd name, int_f *namelen, _fcd comment, int_f *commentlen); -H5_FCDLL int_f nh5gget_comment_c (hid_t_f *loc_id, _fcd name, int_f *namelen, size_t_f *bufsize, _fcd comment); -H5_FCDLL int_f nh5gcreate_anon_c (hid_t_f *loc_id, hid_t_f *gcpl_id, hid_t_f *gapl_id, hid_t_f *grp_id); -H5_FCDLL int_f nh5gget_create_plist_c(hid_t_f *grp_id, hid_t_f *gcpl_id ); -H5_FCDLL int_f nh5gget_info_c (hid_t_f *group_id, int_f *storage_type, int_f *nlinks, int_f *max_corder, int_f *mounted); -H5_FCDLL int_f nh5gget_info_by_idx_c(hid_t_f *loc_id, _fcd group_name, size_t_f *group_namelen, +H5_FCDLL int_f h5gopen_c(hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *gapl_id, hid_t_f *grp_id); +H5_FCDLL int_f h5gclose_c( hid_t_f *grp_id ); +H5_FCDLL int_f h5gget_obj_info_idx_c(hid_t_f *loc_id, _fcd name, int_f *namelen, int_f *idx, _fcd obj_name, int_f *obj_namelen, int_f *obj_type); +H5_FCDLL int_f h5gn_members_c(hid_t_f *loc_id, _fcd name, int_f *namelen, int_f *nmembers); +H5_FCDLL int_f h5glink_c(hid_t_f *loc_id, int_f *link_type, _fcd current_name, int_f *current_namelen, _fcd new_name, int_f *new_namelen); +H5_FCDLL int_f h5glink2_c(hid_t_f *cur_loc_id, _fcd cur_name, int_f *cur_namelen, int_f *link_type, hid_t_f *new_loc_id, _fcd new_name, int_f *new_namelen); +H5_FCDLL int_f h5gunlink_c(hid_t_f *loc_id, _fcd name, int_f *namelen); +H5_FCDLL int_f h5gmove_c(hid_t_f *loc_id, _fcd src_name, int_f *src_namelen, _fcd dst_name, int_f *dst_namelen); +H5_FCDLL int_f h5gmove2_c(hid_t_f *src_loc_id, _fcd src_name, int_f *src_namelen, hid_t_f *dst_loc_id,_fcd dst_name, int_f *dst_namelen); +H5_FCDLL int_f h5gget_linkval_c(hid_t_f *loc_id, _fcd name, int_f *namelen, size_t_f *size, _fcd value ); +H5_FCDLL int_f h5gset_comment_c(hid_t_f *loc_id, _fcd name, int_f *namelen, _fcd comment, int_f *commentlen); +H5_FCDLL int_f h5gget_comment_c(hid_t_f *loc_id, _fcd name, int_f *namelen, size_t_f *bufsize, _fcd comment); +H5_FCDLL int_f h5gcreate_anon_c(hid_t_f *loc_id, hid_t_f *gcpl_id, hid_t_f *gapl_id, hid_t_f *grp_id); +H5_FCDLL int_f h5gget_create_plist_c(hid_t_f *grp_id, hid_t_f *gcpl_id ); +H5_FCDLL int_f h5gget_info_c(hid_t_f *group_id, int_f *storage_type, int_f *nlinks, int_f *max_corder, int_f *mounted); +H5_FCDLL int_f h5gget_info_by_idx_c(hid_t_f *loc_id, _fcd group_name, size_t_f *group_namelen, int_f *index_type, int_f *order, hsize_t_f *n, hid_t_f *lapl_id, int_f *storage_type, int_f *nlinks, int_f *max_corder, int_f *mounted); -H5_FCDLL int_f nh5gget_info_by_name_c(hid_t_f *loc_id, _fcd group_name, size_t_f *group_namelen, hid_t_f *lapl_id, +H5_FCDLL int_f h5gget_info_by_name_c(hid_t_f *loc_id, _fcd group_name, size_t_f *group_namelen, hid_t_f *lapl_id, int_f *storage_type, int_f *nlinks, int_f *max_corder, int_f *mounted); /* * Functions from H5Af.c */ -#define nh5acreate_c H5_FC_FUNC_(h5acreate_c, H5ACREATE_C) -#define nh5aclose_c H5_FC_FUNC_(h5aclose_c, H5ACLOSE_C) -#define nh5aopen_name_c H5_FC_FUNC_(h5aopen_name_c, H5AOPEN_NAME_C) -#define nh5awrite_c H5_FC_FUNC_(h5awrite_c, H5AWRITE_C) -#define nh5awrite_integer_s_c H5_FC_FUNC_(h5awrite_integer_s_c, H5AWRITE_INTEGER_S_C) -#define nh5awrite_integer_1_c H5_FC_FUNC_(h5awrite_integer_1_c, H5AWRITE_INTEGER_1_C) -#define nh5awrite_integer_2_c H5_FC_FUNC_(h5awrite_integer_2_c, H5AWRITE_INTEGER_2_C) -#define nh5awrite_integer_3_c H5_FC_FUNC_(h5awrite_integer_3_c, H5AWRITE_INTEGER_3_C) -#define nh5awrite_integer_4_c H5_FC_FUNC_(h5awrite_integer_4_c, H5AWRITE_INTEGER_4_C) -#define nh5awrite_integer_5_c H5_FC_FUNC_(h5awrite_integer_5_c, H5AWRITE_INTEGER_5_C) -#define nh5awrite_integer_6_c H5_FC_FUNC_(h5awrite_integer_6_c, H5AWRITE_INTEGER_6_C) -#define nh5awrite_integer_7_c H5_FC_FUNC_(h5awrite_integer_7_c, H5AWRITE_INTEGER_7_C) -#define nh5awrite_real_s_c H5_FC_FUNC_(h5awrite_real_s_c, H5AWRITE_REAL_S_C) -#define nh5awrite_real_1_c H5_FC_FUNC_(h5awrite_real_1_c, H5AWRITE_REAL_1_C) -#define nh5awrite_real_2_c H5_FC_FUNC_(h5awrite_real_2_c, H5AWRITE_REAL_2_C) -#define nh5awrite_real_3_c H5_FC_FUNC_(h5awrite_real_3_c, H5AWRITE_REAL_3_C) -#define nh5awrite_real_4_c H5_FC_FUNC_(h5awrite_real_4_c, H5AWRITE_REAL_4_C) -#define nh5awrite_real_5_c H5_FC_FUNC_(h5awrite_real_5_c, H5AWRITE_REAL_5_C) -#define nh5awrite_real_6_c H5_FC_FUNC_(h5awrite_real_6_c, H5AWRITE_REAL_6_C) -#define nh5awrite_real_7_c H5_FC_FUNC_(h5awrite_real_7_c, H5AWRITE_REAL_7_C) -#define nh5awrite_double_s_c H5_FC_FUNC_(h5awrite_double_s_c, H5AWRITE_DOUBLE_S_C) -#define nh5awrite_double_1_c H5_FC_FUNC_(h5awrite_double_1_c, H5AWRITE_DOUBLE_1_C) -#define nh5awrite_double_2_c H5_FC_FUNC_(h5awrite_double_2_c, H5AWRITE_DOUBLE_2_C) -#define nh5awrite_double_3_c H5_FC_FUNC_(h5awrite_double_3_c, H5AWRITE_DOUBLE_3_C) -#define nh5awrite_double_4_c H5_FC_FUNC_(h5awrite_double_4_c, H5AWRITE_DOUBLE_4_C) -#define nh5awrite_double_5_c H5_FC_FUNC_(h5awrite_double_5_c, H5AWRITE_DOUBLE_5_C) -#define nh5awrite_double_6_c H5_FC_FUNC_(h5awrite_double_6_c, H5AWRITE_DOUBLE_6_C) -#define nh5awrite_double_7_c H5_FC_FUNC_(h5awrite_double_7_c, H5AWRITE_DOUBLE_7_C) -#define nh5awritec_c H5_FC_FUNC_(h5awritec_c, H5AWRITEC_C) -#define nh5awritec_s_c H5_FC_FUNC_(h5awritec_s_c, H5AWRITEC_S_C) -#define nh5awritec_1_c H5_FC_FUNC_(h5awritec_1_c, H5AWRITEC_1_C) -#define nh5awritec_2_c H5_FC_FUNC_(h5awritec_2_c, H5AWRITEC_2_C) -#define nh5awritec_3_c H5_FC_FUNC_(h5awritec_3_c, H5AWRITEC_3_C) -#define nh5awritec_4_c H5_FC_FUNC_(h5awritec_4_c, H5AWRITEC_4_C) -#define nh5awritec_5_c H5_FC_FUNC_(h5awritec_5_c, H5AWRITEC_5_C) -#define nh5awritec_6_c H5_FC_FUNC_(h5awritec_6_c, H5AWRITEC_6_C) -#define nh5awritec_7_c H5_FC_FUNC_(h5awritec_7_c, H5AWRITEC_7_C) -#define nh5aread_c H5_FC_FUNC_(h5aread_c, H5AREAD_C) -#define nh5aread_integer_s_c H5_FC_FUNC_(h5aread_integer_s_c, H5AREAD_INTEGER_S_C) -#define nh5aread_integer_1_c H5_FC_FUNC_(h5aread_integer_1_c, H5AREAD_INTEGER_1_C) -#define nh5aread_integer_2_c H5_FC_FUNC_(h5aread_integer_2_c, H5AREAD_INTEGER_2_C) -#define nh5aread_integer_3_c H5_FC_FUNC_(h5aread_integer_3_c, H5AREAD_INTEGER_3_C) -#define nh5aread_integer_4_c H5_FC_FUNC_(h5aread_integer_4_c, H5AREAD_INTEGER_4_C) -#define nh5aread_integer_5_c H5_FC_FUNC_(h5aread_integer_5_c, H5AREAD_INTEGER_5_C) -#define nh5aread_integer_6_c H5_FC_FUNC_(h5aread_integer_6_c, H5AREAD_INTEGER_6_C) -#define nh5aread_integer_7_c H5_FC_FUNC_(h5aread_integer_7_c, H5AREAD_INTEGER_7_C) -#define nh5aread_real_s_c H5_FC_FUNC_(h5aread_real_s_c, H5AREAD_REAL_S_C) -#define nh5aread_real_1_c H5_FC_FUNC_(h5aread_real_1_c, H5AREAD_REAL_1_C) -#define nh5aread_real_2_c H5_FC_FUNC_(h5aread_real_2_c, H5AREAD_REAL_2_C) -#define nh5aread_real_3_c H5_FC_FUNC_(h5aread_real_3_c, H5AREAD_REAL_3_C) -#define nh5aread_real_4_c H5_FC_FUNC_(h5aread_real_4_c, H5AREAD_REAL_4_C) -#define nh5aread_real_5_c H5_FC_FUNC_(h5aread_real_5_c, H5AREAD_REAL_5_C) -#define nh5aread_real_6_c H5_FC_FUNC_(h5aread_real_6_c, H5AREAD_REAL_6_C) -#define nh5aread_real_7_c H5_FC_FUNC_(h5aread_real_7_c, H5AREAD_REAL_7_C) -#define nh5aread_double_s_c H5_FC_FUNC_(h5aread_double_s_c, H5AREAD_DOUBLE_S_C) -#define nh5aread_double_1_c H5_FC_FUNC_(h5aread_double_1_c, H5AREAD_DOUBLE_1_C) -#define nh5aread_double_2_c H5_FC_FUNC_(h5aread_double_2_c, H5AREAD_DOUBLE_2_C) -#define nh5aread_double_3_c H5_FC_FUNC_(h5aread_double_3_c, H5AREAD_DOUBLE_3_C) -#define nh5aread_double_4_c H5_FC_FUNC_(h5aread_double_4_c, H5AREAD_DOUBLE_4_C) -#define nh5aread_double_5_c H5_FC_FUNC_(h5aread_double_5_c, H5AREAD_DOUBLE_5_C) -#define nh5aread_double_6_c H5_FC_FUNC_(h5aread_double_6_c, H5AREAD_DOUBLE_6_C) -#define nh5aread_double_7_c H5_FC_FUNC_(h5aread_double_7_c, H5AREAD_DOUBLE_7_C) -#define nh5areadc_c H5_FC_FUNC_(h5areadc_c, H5AREADC_C) -#define nh5areadc_s_c H5_FC_FUNC_(h5areadc_s_c, H5AREADC_S_C) -#define nh5areadc_1_c H5_FC_FUNC_(h5areadc_1_c, H5AREADC_1_C) -#define nh5areadc_2_c H5_FC_FUNC_(h5areadc_2_c, H5AREADC_2_C) -#define nh5areadc_3_c H5_FC_FUNC_(h5areadc_3_c, H5AREADC_3_C) -#define nh5areadc_4_c H5_FC_FUNC_(h5areadc_4_c, H5AREADC_4_C) -#define nh5areadc_5_c H5_FC_FUNC_(h5areadc_5_c, H5AREADC_5_C) -#define nh5areadc_6_c H5_FC_FUNC_(h5areadc_6_c, H5AREADC_6_C) -#define nh5areadc_7_c H5_FC_FUNC_(h5areadc_7_c, H5AREADC_7_C) -#define nh5aget_name_c H5_FC_FUNC_(h5aget_name_c, H5AGET_NAME_C) -#define nh5aopen_idx_c H5_FC_FUNC_(h5aopen_idx_c, H5AOPEN_IDX_C) -#define nh5aget_space_c H5_FC_FUNC_(h5aget_space_c, H5AGET_SPACE_C) -#define nh5aget_type_c H5_FC_FUNC_(h5aget_type_c, H5AGET_TYPE_C) -#define nh5aget_num_attrs_c H5_FC_FUNC_(h5aget_num_attrs_c, H5AGET_NUM_ATTRS_C) -#define nh5adelete_c H5_FC_FUNC_(h5adelete_c, H5ADELETE_C) -#define nh5aget_storage_size_c H5_FC_FUNC_(h5aget_storage_size_c, H5AGET_STORAGE_SIZE_C) -#define nh5arename_by_name_c H5_FC_FUNC_(h5arename_by_name_c, H5ARENAME_BY_NAME_C) -#define nh5aopen_c H5_FC_FUNC_(h5aopen_c, H5AOPEN_C) -#define nh5adelete_by_name_c H5_FC_FUNC_(h5adelete_by_name_c,H5ADELETE_BY_NAME_C) -#define nh5adelete_by_idx_c H5_FC_FUNC_(h5adelete_by_idx_c,H5ADELETE_BY_IDX_C) -#define nh5aget_name_by_idx_c H5_FC_FUNC_(h5aget_name_by_idx_c,H5AGET_NAME_BY_IDX_C) -#define nh5aget_create_plist_c H5_FC_FUNC_(h5aget_create_plist_c,H5AGET_CREATE_PLIST_C) -#define nh5aopen_by_idx_c H5_FC_FUNC_(h5aopen_by_idx_c,H5AOPEN_BY_IDX_C) -#define nh5aget_info_c H5_FC_FUNC_(h5aget_info_c,H5AGET_INFO_C) -#define nh5aget_info_by_idx_c H5_FC_FUNC_(h5aget_info_by_idx_c,H5AGET_INFO_BY_IDX_C) -#define nh5aget_info_by_name_c H5_FC_FUNC_(h5aget_info_by_name_c,H5AGET_INFO_BY_NAME_C) -#define nh5aget_info_by_name_c H5_FC_FUNC_(h5aget_info_by_name_c,H5AGET_INFO_BY_NAME_C) -#define nh5acreate_by_name_c H5_FC_FUNC_(h5acreate_by_name_c,H5ACREATE_BY_NAME_C) -#define nh5aexists_c H5_FC_FUNC_(h5aexists_c,H5AEXISTS_C) -#define nh5aexists_by_name_c H5_FC_FUNC_(h5aexists_by_name_c,H5AEXISTS_BY_NAME_C) -#define nh5aopen_by_name_c H5_FC_FUNC_(h5aopen_by_name_c,H5AOPEN_BY_NAME_C) -#define nh5arename_c H5_FC_FUNC_(h5arename_c,H5ARENAME_C) -H5_FCDLL int_f nh5acreate_c (hid_t_f *obj_id, _fcd name, size_t_f *namelen, hid_t_f *type_id, hid_t_f *space_id, hid_t_f *crt_prp, hid_t_f *aapl, hid_t_f *attr_id); -H5_FCDLL int_f nh5aopen_name_c (hid_t_f *obj_id, _fcd name, size_t_f *namelen, hid_t_f *attr_id); -H5_FCDLL int_f nh5awritec_c (hid_t_f *attr_id, hid_t_f *mem_type_id, _fcd buf, void *dims); -H5_FCDLL int_f nh5awritec_s_c (hid_t_f *attr_id, hid_t_f *mem_type_id, _fcd buf, void *dims); -H5_FCDLL int_f nh5awritec_1_c (hid_t_f *attr_id, hid_t_f *mem_type_id, _fcd buf, void *dims); -H5_FCDLL int_f nh5awritec_2_c (hid_t_f *attr_id, hid_t_f *mem_type_id, _fcd buf, void *dims); -H5_FCDLL int_f nh5awritec_3_c (hid_t_f *attr_id, hid_t_f *mem_type_id, _fcd buf, void *dims); -H5_FCDLL int_f nh5awritec_4_c (hid_t_f *attr_id, hid_t_f *mem_type_id, _fcd buf, void *dims); -H5_FCDLL int_f nh5awritec_5_c (hid_t_f *attr_id, hid_t_f *mem_type_id, _fcd buf, void *dims); -H5_FCDLL int_f nh5awritec_6_c (hid_t_f *attr_id, hid_t_f *mem_type_id, _fcd buf, void *dims); -H5_FCDLL int_f nh5awritec_7_c (hid_t_f *attr_id, hid_t_f *mem_type_id, _fcd buf, void *dims); -H5_FCDLL int_f nh5awrite_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void *dims); -H5_FCDLL int_f nh5awrite_integer_s_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void *dims); -H5_FCDLL int_f nh5awrite_integer_1_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void *dims); -H5_FCDLL int_f nh5awrite_integer_2_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void *dims); -H5_FCDLL int_f nh5awrite_integer_3_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void *dims); -H5_FCDLL int_f nh5awrite_integer_4_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void *dims); -H5_FCDLL int_f nh5awrite_integer_5_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void *dims); -H5_FCDLL int_f nh5awrite_integer_6_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void *dims); -H5_FCDLL int_f nh5awrite_integer_7_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void *dims); -H5_FCDLL int_f nh5awrite_real_s_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void *dims); -H5_FCDLL int_f nh5awrite_real_1_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void *dims); -H5_FCDLL int_f nh5awrite_real_2_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void *dims); -H5_FCDLL int_f nh5awrite_real_3_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void *dims); -H5_FCDLL int_f nh5awrite_real_4_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void *dims); -H5_FCDLL int_f nh5awrite_real_5_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void *dims); -H5_FCDLL int_f nh5awrite_real_6_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void *dims); -H5_FCDLL int_f nh5awrite_real_7_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void *dims); -H5_FCDLL int_f nh5awrite_double_s_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void *dims); -H5_FCDLL int_f nh5awrite_double_1_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void *dims); -H5_FCDLL int_f nh5awrite_double_2_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void *dims); -H5_FCDLL int_f nh5awrite_double_3_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void *dims); -H5_FCDLL int_f nh5awrite_double_4_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void *dims); -H5_FCDLL int_f nh5awrite_double_5_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void *dims); -H5_FCDLL int_f nh5awrite_double_6_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void *dims); -H5_FCDLL int_f nh5awrite_double_7_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void *dims); -H5_FCDLL int_f h5awrite_f_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf); -H5_FCDLL int_f nh5areadc_c (hid_t_f *attr_id, hid_t_f *mem_type_id, _fcd buf, void *dims); -H5_FCDLL int_f nh5areadc_s_c (hid_t_f *attr_id, hid_t_f *mem_type_id, _fcd buf, void *dims); -H5_FCDLL int_f nh5areadc_1_c (hid_t_f *attr_id, hid_t_f *mem_type_id, _fcd buf, void *dims); -H5_FCDLL int_f nh5areadc_2_c (hid_t_f *attr_id, hid_t_f *mem_type_id, _fcd buf, void *dims); -H5_FCDLL int_f nh5areadc_3_c (hid_t_f *attr_id, hid_t_f *mem_type_id, _fcd buf, void *dims); -H5_FCDLL int_f nh5areadc_4_c (hid_t_f *attr_id, hid_t_f *mem_type_id, _fcd buf, void *dims); -H5_FCDLL int_f nh5areadc_5_c (hid_t_f *attr_id, hid_t_f *mem_type_id, _fcd buf, void *dims); -H5_FCDLL int_f nh5areadc_6_c (hid_t_f *attr_id, hid_t_f *mem_type_id, _fcd buf, void *dims); -H5_FCDLL int_f nh5areadc_7_c (hid_t_f *attr_id, hid_t_f *mem_type_id, _fcd buf, void *dims); -H5_FCDLL int_f nh5aread_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void *dims); -H5_FCDLL int_f nh5aread_integer_s_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void *dims); -H5_FCDLL int_f nh5aread_integer_1_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void *dims); -H5_FCDLL int_f nh5aread_integer_2_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void *dims); -H5_FCDLL int_f nh5aread_integer_3_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void *dims); -H5_FCDLL int_f nh5aread_integer_4_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void *dims); -H5_FCDLL int_f nh5aread_integer_5_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void *dims); -H5_FCDLL int_f nh5aread_integer_6_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void *dims); -H5_FCDLL int_f nh5aread_integer_7_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void *dims); -H5_FCDLL int_f nh5aread_real_s_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void *dims); -H5_FCDLL int_f nh5aread_real_1_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void *dims); -H5_FCDLL int_f nh5aread_real_2_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void *dims); -H5_FCDLL int_f nh5aread_real_3_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void *dims); -H5_FCDLL int_f nh5aread_real_4_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void *dims); -H5_FCDLL int_f nh5aread_real_5_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void *dims); -H5_FCDLL int_f nh5aread_real_6_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void *dims); -H5_FCDLL int_f nh5aread_real_7_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void *dims); -H5_FCDLL int_f nh5aread_double_s_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void *dims); -H5_FCDLL int_f nh5aread_double_1_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void *dims); -H5_FCDLL int_f nh5aread_double_2_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void *dims); -H5_FCDLL int_f nh5aread_double_3_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void *dims); -H5_FCDLL int_f nh5aread_double_4_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void *dims); -H5_FCDLL int_f nh5aread_double_5_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void *dims); -H5_FCDLL int_f nh5aread_double_6_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void *dims); -H5_FCDLL int_f nh5aread_double_7_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void *dims); -H5_FCDLL int_f h5aread_f_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf); -H5_FCDLL int_f nh5aclose_c ( hid_t_f *attr_id ); -H5_FCDLL int_f nh5adelete_c (hid_t_f *obj_id, _fcd name, size_t_f *namelen); -H5_FCDLL int_f nh5aopen_idx_c (hid_t_f *obj_id, int_f *idx, hid_t_f *attr_id); -H5_FCDLL int_f nh5aget_space_c (hid_t_f *attr_id, hid_t_f *space_id); -H5_FCDLL int_f nh5aget_type_c (hid_t_f *attr_id, hid_t_f *type_id); -H5_FCDLL int_f nh5aget_num_attrs_c (hid_t_f *obj_id, int_f *attr_num); -H5_FCDLL int_f nh5aget_name_c(hid_t_f *attr_id, size_t_f *size, _fcd buf); -H5_FCDLL int_f nh5aget_storage_size_c ( hid_t_f *attr_id, hsize_t_f *size ); -H5_FCDLL int_f nh5arename_by_name_c ( hid_t_f *loc_id, _fcd obj_name, size_t_f *obj_namelen, +H5_FCDLL int_f h5awrite_f_c(hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf); +H5_FCDLL int_f h5aread_f_c(hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf); +H5_FCDLL int_f h5adelete_c(hid_t_f *obj_id, _fcd name, size_t_f *namelen); +H5_FCDLL int_f h5aget_num_attrs_c(hid_t_f *obj_id, int_f *attr_num); +H5_FCDLL int_f h5aget_name_c(hid_t_f *attr_id, size_t_f *size, _fcd buf); +H5_FCDLL int_f h5arename_by_name_c( hid_t_f *loc_id, _fcd obj_name, size_t_f *obj_namelen, _fcd old_attr_name, size_t_f *old_attr_namelen, _fcd new_attr_name, size_t_f *new_attr_namelen, hid_t_f *lapl_id ); -H5_FCDLL int_f nh5aopen_c ( hid_t_f *obj_id, _fcd attr_name, size_t_f *attr_namelen, +H5_FCDLL int_f h5aopen_c( hid_t_f *obj_id, _fcd attr_name, size_t_f *attr_namelen, hid_t_f *aapl_id, hid_t_f *attr_id); -H5_FCDLL int_f nh5adelete_by_name_c (hid_t_f *loc_id, _fcd obj_name, size_t_f *obj_namelen, +H5_FCDLL int_f h5adelete_by_name_c(hid_t_f *loc_id, _fcd obj_name, size_t_f *obj_namelen, _fcd attr_name, size_t_f *attr_namelen, hid_t_f *lapl_id); -H5_FCDLL int_f nh5adelete_by_idx_c (hid_t_f *loc_id, _fcd obj_name, size_t_f *obj_namelen, +H5_FCDLL int_f h5adelete_by_idx_c(hid_t_f *loc_id, _fcd obj_name, size_t_f *obj_namelen, int_f *idx_type, int_f *order, hsize_t_f *n, hid_t_f *lapl_id); -H5_FCDLL int_f nh5aget_name_by_idx_c (hid_t_f *loc_id, _fcd obj_name, size_t_f *obj_namelen, +H5_FCDLL int_f h5aget_name_by_idx_c(hid_t_f *loc_id, _fcd obj_name, size_t_f *obj_namelen, int_f *idx_type, int_f *order, hsize_t_f *n, _fcd name, size_t_f *size, hid_t_f *lapl_id); -H5_FCDLL int_f nh5aget_create_plist_c ( hid_t_f *attr_id, hid_t_f *creation_prop_id ); -H5_FCDLL int_f nh5aopen_by_idx_c (hid_t_f *loc_id, _fcd obj_name, size_t_f *obj_namelen, +H5_FCDLL int_f h5aopen_by_idx_c(hid_t_f *loc_id, _fcd obj_name, size_t_f *obj_namelen, int_f *idx_type, int_f *order, hsize_t_f *n, hid_t_f *aapl_id, hid_t_f *lapl_id, hid_t_f *attr_id); -H5_FCDLL int_f nh5aget_info_c (hid_t_f *loc_id, int_f *corder_valid, int_f *corder, +H5_FCDLL int_f h5aget_info_c(hid_t_f *loc_id, int_f *corder_valid, int_f *corder, int_f *cset, hsize_t_f *data_size ); -H5_FCDLL int_f nh5aget_info_by_idx_c (hid_t_f *loc_id, _fcd obj_name, size_t_f *obj_namelen, +H5_FCDLL int_f h5aget_info_by_idx_c(hid_t_f *loc_id, _fcd obj_name, size_t_f *obj_namelen, int_f *idx_type, int_f *order, hsize_t_f *n, hid_t_f *lapl_id, int_f *corder_valid, int_f *corder, int_f *cset, hsize_t_f *data_size ); -H5_FCDLL int_f nh5aget_info_by_name_c (hid_t_f *loc_id, _fcd obj_name, size_t_f *obj_namelen, +H5_FCDLL int_f h5aget_info_by_name_c(hid_t_f *loc_id, _fcd obj_name, size_t_f *obj_namelen, _fcd attr_name, size_t_f *attr_namelen, hid_t_f *lapl_id, int_f *corder_valid, int_f *corder, int_f *cset, hsize_t_f *data_size ); -H5_FCDLL int_f nh5acreate_by_name_c(hid_t_f *loc_id, _fcd obj_name, size_t_f *obj_namelen, +H5_FCDLL int_f h5acreate_by_name_c(hid_t_f *loc_id, _fcd obj_name, size_t_f *obj_namelen, _fcd attr_name, size_t_f *attr_namelen, hid_t_f *type_id, hid_t_f *space_id, hid_t_f *acpl_id, hid_t_f *aapl_id, hid_t_f *lapl_id, hid_t_f *attr_id ); -H5_FCDLL int_f nh5aexists_c (hid_t_f *obj_id, _fcd name, size_t_f *namelen, hid_t_f *attr_exists); -H5_FCDLL int_f nh5aexists_by_name_c (hid_t_f *loc_id, _fcd obj_name, size_t_f *obj_namelen, _fcd attr_name, size_t_f *attr_namelen, +H5_FCDLL int_f h5aexists_c(hid_t_f *obj_id, _fcd name, size_t_f *namelen, hid_t_f *attr_exists); +H5_FCDLL int_f h5aexists_by_name_c(hid_t_f *loc_id, _fcd obj_name, size_t_f *obj_namelen, _fcd attr_name, size_t_f *attr_namelen, hid_t_f *lapl_id, int_f *attr_exists); -H5_FCDLL int_f nh5aopen_by_name_c (hid_t_f *loc_id, _fcd obj_name, size_t_f *obj_namelen, _fcd attr_name, size_t_f *attr_namelen, +H5_FCDLL int_f h5aopen_by_name_c(hid_t_f *loc_id, _fcd obj_name, size_t_f *obj_namelen, _fcd attr_name, size_t_f *attr_namelen, hid_t_f *aapl_id, hid_t_f *lapl_id, hid_t_f *attr_id); -H5_FCDLL int_f nh5arename_c( hid_t_f *loc_id, +H5_FCDLL int_f h5arename_c( hid_t_f *loc_id, _fcd old_attr_name, size_t_f *old_attr_namelen, _fcd new_attr_name, size_t_f *new_attr_namelen); /* * Functions form H5Tf.c file */ -#define nh5topen_c H5_FC_FUNC_(h5topen_c, H5TOPEN_C) -#define nh5tcommit_c H5_FC_FUNC_(h5tcommit_c, H5TCOMMIT_C) -#define nh5tcommitted_c H5_FC_FUNC_(h5tcommitted_c, H5TCOMMITTED_C) -#define nh5tclose_c H5_FC_FUNC_(h5tclose_c, H5TCLOSE_C) -#define nh5tcopy_c H5_FC_FUNC_(h5tcopy_c, H5TCOPY_C) -#define nh5tequal_c H5_FC_FUNC_(h5tequal_c, H5TEQUAL_C) -#define nh5tget_class_c H5_FC_FUNC_(h5tget_class_c, H5TGET_CLASS_C) -#define nh5tget_order_c H5_FC_FUNC_(h5tget_order_c, H5TGET_ORDER_C) -#define nh5tset_order_c H5_FC_FUNC_(h5tset_order_c, H5TSET_ORDER_C) -#define nh5tget_size_c H5_FC_FUNC_(h5tget_size_c, H5TGET_SIZE_C) -#define nh5tset_size_c H5_FC_FUNC_(h5tset_size_c, H5TSET_SIZE_C) -#define nh5tget_precision_c H5_FC_FUNC_(h5tget_precision_c, H5TGET_PRECISION_C) -#define nh5tset_precision_c H5_FC_FUNC_(h5tset_precision_c, H5TSET_PRECISION_C) -#define nh5tget_offset_c H5_FC_FUNC_(h5tget_offset_c, H5TGET_OFFSET_C) -#define nh5tset_offset_c H5_FC_FUNC_(h5tset_offset_c, H5TSET_OFFSET_C) -#define nh5tget_pad_c H5_FC_FUNC_(h5tget_pad_c, H5TGET_PAD_C) -#define nh5tset_pad_c H5_FC_FUNC_(h5tset_pad_c, H5TSET_PAD_C) -#define nh5tget_sign_c H5_FC_FUNC_(h5tget_sign_c, H5TGET_SIGN_C) -#define nh5tset_sign_c H5_FC_FUNC_(h5tset_sign_c, H5TSET_SIGN_C) -#define nh5tget_fields_c H5_FC_FUNC_(h5tget_fields_c, H5TGET_FIELDS_C) -#define nh5tset_fields_c H5_FC_FUNC_(h5tset_fields_c, H5TSET_FIELDS_C) -#define nh5tget_ebias_c H5_FC_FUNC_(h5tget_ebias_c, H5TGET_EBIAS_C) -#define nh5tset_ebias_c H5_FC_FUNC_(h5tset_ebias_c, H5TSET_EBIAS_C) -#define nh5tget_norm_c H5_FC_FUNC_(h5tget_norm_c, H5TGET_NORM_C) -#define nh5tset_norm_c H5_FC_FUNC_(h5tset_norm_c, H5TSET_NORM_C) -#define nh5tget_inpad_c H5_FC_FUNC_(h5tget_inpad_c, H5TGET_INPAD_C) -#define nh5tset_inpad_c H5_FC_FUNC_(h5tset_inpad_c, H5TSET_INPAD_C) -#define nh5tget_cset_c H5_FC_FUNC_(h5tget_cset_c, H5TGET_CSET_C) -#define nh5tset_cset_c H5_FC_FUNC_(h5tset_cset_c, H5TSET_CSET_C) -#define nh5tget_strpad_c H5_FC_FUNC_(h5tget_strpad_c, H5TGET_STRPAD_C) -#define nh5tset_strpad_c H5_FC_FUNC_(h5tset_strpad_c, H5TSET_STRPAD_C) -#define nh5tget_nmembers_c H5_FC_FUNC_(h5tget_nmembers_c, H5TGET_NMEMBERS_C) -#define nh5tget_member_name_c H5_FC_FUNC_(h5tget_member_name_c, H5TGET_MEMBER_NAME_C) -#define nh5tget_member_offset_c H5_FC_FUNC_(h5tget_member_offset_c, H5TGET_MEMBER_OFFSET_C) -#define nh5tget_member_dims_c H5_FC_FUNC_(h5tget_member_dims_c, H5TGET_MEMBER_DIMS_C) -#define nh5tget_member_type_c H5_FC_FUNC_(h5tget_member_type_c, H5TGET_MEMBER_TYPE_C) -#define nh5tget_member_index_c H5_FC_FUNC_(h5tget_member_index_c, H5TGET_MEMBER_INDEX_C) -#define nh5tinsert_c H5_FC_FUNC_(h5tinsert_c, H5TINSERT_C) -#define nh5tcreate_c H5_FC_FUNC_(h5tcreate_c, H5TCREATE_C) -#define nh5tpack_c H5_FC_FUNC_(h5tpack_c, H5TPACK_C) -#define nh5tinsert_array_c H5_FC_FUNC_(h5tinsert_array_c, H5TINSERT_ARRAY_C) -#define nh5tinsert_array_c2 H5_FC_FUNC_(h5tinsert_array_c2, H5TINSERT_ARRAY_C2) -#define nh5tenum_create_c H5_FC_FUNC_(h5tenum_create_c, H5TENUM_CREATE_C) -#define nh5tenum_insert_c H5_FC_FUNC_(h5tenum_insert_c, H5TENUM_INSERT_C) -#define nh5tenum_nameof_c H5_FC_FUNC_(h5tenum_nameof_c, H5TENUM_NAMEOF_C) -#define nh5tenum_valueof_c H5_FC_FUNC_(h5tenum_valueof_c, H5TENUM_VALUEOF_C) -#define nh5tget_member_value_c H5_FC_FUNC_(h5tget_member_value_c, H5TGET_MEMBER_VALUE_C) -#define nh5tset_tag_c H5_FC_FUNC_(h5tset_tag_c, H5TSET_TAG_C) -#define nh5tget_tag_c H5_FC_FUNC_(h5tget_tag_c, H5TGET_TAG_C) -#define nh5tarray_create_c H5_FC_FUNC_(h5tarray_create_c, H5TARRAY_CREATE_C) -#define nh5tget_array_ndims_c H5_FC_FUNC_(h5tget_array_ndims_c, H5TGET_ARRAY_NDIMS_C) -#define nh5tget_array_dims_c H5_FC_FUNC_(h5tget_array_dims_c, H5TGET_ARRAY_DIMS_C) -#define nh5tget_super_c H5_FC_FUNC_(h5tget_super_c, H5TGET_SUPER_C) -#define nh5tvlen_create_c H5_FC_FUNC_(h5tvlen_create_c, H5TVLEN_CREATE_C) -#define nh5tis_variable_str_c H5_FC_FUNC_(h5tis_variable_str_c, H5TIS_VARIABLE_STR_C) -#define nh5tget_member_class_c H5_FC_FUNC_(h5tget_member_class_c, H5TGET_MEMBER_CLASS_C) -#define nh5tcommit_anon_c H5_FC_FUNC_(h5tcommit_anon_c, H5TCOMMIT_ANON_C) -#define nh5tdecode_c H5_FC_FUNC_(h5tdecode_c, H5TDECODE_C) -#define nh5tencode_c H5_FC_FUNC_(h5tencode_c, H5TENCODE_C) -#define nh5tget_create_plist_c H5_FC_FUNC_(h5tget_create_plist_c, H5TGET_CREATE_PLIST_C) -#define nh5tcompiler_conv_c H5_FC_FUNC_(h5tcompiler_conv_c, H5TCOMPILER_CONV_C) -#define nh5tget_native_type_c H5_FC_FUNC_(h5tget_native_type_c, H5TGET_NATIVE_TYPE_C ) -H5_FCDLL int_f nh5tcreate_c(int_f *cls, size_t_f *size, hid_t_f *type_id); -H5_FCDLL int_f nh5topen_c (hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *type_id, hid_t_f *tapl_id ); -H5_FCDLL int_f nh5tcommit_c (hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *type_id, hid_t_f *lcpl_id, hid_t_f *tcpl_id, hid_t_f *tapl_id); -H5_FCDLL int_f nh5tclose_c ( hid_t_f *type_id ); -H5_FCDLL int_f nh5tequal_c ( hid_t_f *type1_id , hid_t_f *type2_id, int_f *c_flag); -H5_FCDLL int_f nh5tcopy_c ( hid_t_f *type_id , hid_t_f *new_type_id); -H5_FCDLL int_f nh5tget_class_c ( hid_t_f *type_id , int_f *classtype); -H5_FCDLL int_f nh5tget_order_c ( hid_t_f *type_id , int_f *order); -H5_FCDLL int_f nh5tset_order_c ( hid_t_f *type_id , int_f *order); -H5_FCDLL int_f nh5tget_size_c ( hid_t_f *type_id , size_t_f *size); -H5_FCDLL int_f nh5tset_size_c ( hid_t_f *type_id , size_t_f *size); -H5_FCDLL int_f nh5tcommitted_c (hid_t_f *dtype_id); -H5_FCDLL int_f nh5tget_precision_c ( hid_t_f *type_id , size_t_f *precision); -H5_FCDLL int_f nh5tset_precision_c ( hid_t_f *type_id , size_t_f *precision); -H5_FCDLL int_f nh5tget_offset_c ( hid_t_f *type_id , size_t_f *offset); -H5_FCDLL int_f nh5tset_offset_c ( hid_t_f *type_id , size_t_f *offset); -H5_FCDLL int_f nh5tget_pad_c ( hid_t_f *type_id , int_f * lsbpad, int_f * msbpad); -H5_FCDLL int_f nh5tset_pad_c ( hid_t_f *type_id, int_f * lsbpad, int_f * msbpad ); -H5_FCDLL int_f nh5tget_sign_c ( hid_t_f *type_id , int_f* sign); -H5_FCDLL int_f nh5tset_sign_c ( hid_t_f *type_id , int_f *sign); -H5_FCDLL int_f nh5tget_fields_c ( hid_t_f *type_id, size_t_f *spos, size_t_f *epos, size_t_f* esize, size_t_f* mpos, size_t_f* msize); -H5_FCDLL int_f nh5tset_fields_c ( hid_t_f *type_id, size_t_f *spos, size_t_f *epos, size_t_f* esize, size_t_f* mpos, size_t_f* msize); -H5_FCDLL int_f nh5tget_ebias_c ( hid_t_f *type_id , size_t_f *ebias); -H5_FCDLL int_f nh5tset_ebias_c ( hid_t_f *type_id , size_t_f *ebias); -H5_FCDLL int_f nh5tget_norm_c ( hid_t_f *type_id , int_f *norm); -H5_FCDLL int_f nh5tset_norm_c ( hid_t_f *type_id , int_f *norm); -H5_FCDLL int_f nh5tget_inpad_c ( hid_t_f *type_id, int_f * padtype); -H5_FCDLL int_f nh5tset_inpad_c ( hid_t_f *type_id, int_f * padtype); -H5_FCDLL int_f nh5tget_cset_c ( hid_t_f *type_id, int_f * cset); -H5_FCDLL int_f nh5tset_cset_c ( hid_t_f *type_id, int_f * cset); -H5_FCDLL int_f nh5tget_strpad_c ( hid_t_f *type_id, int_f * strpad); -H5_FCDLL int_f nh5tset_strpad_c ( hid_t_f *type_id, int_f * strpad); -H5_FCDLL int_f nh5tget_nmembers_c ( hid_t_f *type_id , int_f * num_members); -H5_FCDLL int_f nh5tget_member_name_c ( hid_t_f *type_id ,int_f* idx, _fcd member_name, int_f *namelen); -H5_FCDLL int_f nh5tget_member_dims_c ( hid_t_f *type_id ,int_f* field_idx, int_f * dims, size_t_f * field_dims, int_f * perm ); -H5_FCDLL int_f nh5tget_member_offset_c ( hid_t_f *type_id ,int_f* member_no, size_t_f* offset); -H5_FCDLL int_f nh5tget_member_type_c ( hid_t_f *type_id ,int_f* field_idx, hid_t_f * datatype); -H5_FCDLL int_f nh5tget_member_index_c ( hid_t_f *type_id ,_fcd name, int_f* namelen, int_f *idx); -H5_FCDLL int_f nh5tinsert_c(hid_t_f *type_id, _fcd name, int_f* namelen, size_t_f *offset, hid_t_f * field_id); -H5_FCDLL int_f nh5tpack_c(hid_t_f * type_id); -H5_FCDLL int_f nh5tinsert_array_c(hid_t_f * parent_id, _fcd name, int_f* namelen, size_t_f* offset, int_f* ndims, size_t_f* dims, hid_t_f* member_id, int_f* perm ); -H5_FCDLL int_f nh5tinsert_array_c2(hid_t_f * parent_id, _fcd name, int_f* namelen, size_t_f* offset, int_f* ndims, size_t_f* dims, hid_t_f* member_id); -H5_FCDLL int_f nh5tenum_create_c ( hid_t_f *parent_id , hid_t_f *new_type_id); -H5_FCDLL int_f nh5tenum_insert_c(hid_t_f *type_id, _fcd name, int_f* namelen, int_f* value); +H5_FCDLL int_f h5tcreate_c(int_f *cls, size_t_f *size, hid_t_f *type_id); +H5_FCDLL int_f h5topen_c(hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *type_id, hid_t_f *tapl_id ); +H5_FCDLL int_f h5tcommit_c(hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *type_id, hid_t_f *lcpl_id, hid_t_f *tcpl_id, hid_t_f *tapl_id); +H5_FCDLL int_f h5tclose_c( hid_t_f *type_id ); +H5_FCDLL int_f h5tequal_c( hid_t_f *type1_id , hid_t_f *type2_id, int_f *c_flag); +H5_FCDLL int_f h5tcopy_c( hid_t_f *type_id , hid_t_f *new_type_id); +H5_FCDLL int_f h5tget_class_c( hid_t_f *type_id , int_f *classtype); +H5_FCDLL int_f h5tget_order_c( hid_t_f *type_id , int_f *order); +H5_FCDLL int_f h5tset_order_c( hid_t_f *type_id , int_f *order); +H5_FCDLL int_f h5tget_size_c( hid_t_f *type_id , size_t_f *size); +H5_FCDLL int_f h5tset_size_c( hid_t_f *type_id , size_t_f *size); +H5_FCDLL int_f h5tcommitted_c(hid_t_f *dtype_id); +H5_FCDLL int_f h5tget_precision_c( hid_t_f *type_id , size_t_f *precision); +H5_FCDLL int_f h5tset_precision_c( hid_t_f *type_id , size_t_f *precision); +H5_FCDLL int_f h5tget_offset_c( hid_t_f *type_id , size_t_f *offset); +H5_FCDLL int_f h5tset_offset_c( hid_t_f *type_id , size_t_f *offset); +H5_FCDLL int_f h5tget_pad_c( hid_t_f *type_id , int_f * lsbpad, int_f * msbpad); +H5_FCDLL int_f h5tset_pad_c( hid_t_f *type_id, int_f * lsbpad, int_f * msbpad ); +H5_FCDLL int_f h5tget_sign_c( hid_t_f *type_id , int_f* sign); +H5_FCDLL int_f h5tset_sign_c( hid_t_f *type_id , int_f *sign); +H5_FCDLL int_f h5tget_fields_c( hid_t_f *type_id, size_t_f *spos, size_t_f *epos, size_t_f* esize, size_t_f* mpos, size_t_f* msize); +H5_FCDLL int_f h5tset_fields_c( hid_t_f *type_id, size_t_f *spos, size_t_f *epos, size_t_f* esize, size_t_f* mpos, size_t_f* msize); +H5_FCDLL int_f h5tget_ebias_c( hid_t_f *type_id , size_t_f *ebias); +H5_FCDLL int_f h5tset_ebias_c( hid_t_f *type_id , size_t_f *ebias); +H5_FCDLL int_f h5tget_norm_c( hid_t_f *type_id , int_f *norm); +H5_FCDLL int_f h5tset_norm_c( hid_t_f *type_id , int_f *norm); +H5_FCDLL int_f h5tget_inpad_c( hid_t_f *type_id, int_f * padtype); +H5_FCDLL int_f h5tset_inpad_c( hid_t_f *type_id, int_f * padtype); +H5_FCDLL int_f h5tget_cset_c( hid_t_f *type_id, int_f * cset); +H5_FCDLL int_f h5tset_cset_c( hid_t_f *type_id, int_f * cset); +H5_FCDLL int_f h5tget_strpad_c( hid_t_f *type_id, int_f * strpad); +H5_FCDLL int_f h5tset_strpad_c( hid_t_f *type_id, int_f * strpad); +H5_FCDLL int_f h5tget_nmembers_c( hid_t_f *type_id , int_f * num_members); +H5_FCDLL int_f h5tget_member_name_c( hid_t_f *type_id ,int_f* idx, _fcd member_name, int_f *namelen); +H5_FCDLL int_f h5tget_member_dims_c( hid_t_f *type_id ,int_f* field_idx, int_f * dims, size_t_f * field_dims, int_f * perm ); +H5_FCDLL int_f h5tget_member_offset_c( hid_t_f *type_id ,int_f* member_no, size_t_f* offset); +H5_FCDLL int_f h5tget_member_type_c( hid_t_f *type_id ,int_f* field_idx, hid_t_f * datatype); +H5_FCDLL int_f h5tget_member_index_c( hid_t_f *type_id ,_fcd name, int_f* namelen, int_f *idx); +H5_FCDLL int_f h5tinsert_c(hid_t_f *type_id, _fcd name, int_f* namelen, size_t_f *offset, hid_t_f * field_id); +H5_FCDLL int_f h5tpack_c(hid_t_f * type_id); +H5_FCDLL int_f h5tinsert_array_c(hid_t_f * parent_id, _fcd name, int_f* namelen, size_t_f* offset, int_f* ndims, size_t_f* dims, hid_t_f* member_id, int_f* perm ); +H5_FCDLL int_f h5tinsert_array_c2(hid_t_f * parent_id, _fcd name, int_f* namelen, size_t_f* offset, int_f* ndims, size_t_f* dims, hid_t_f* member_id); +H5_FCDLL int_f h5tenum_create_c( hid_t_f *parent_id , hid_t_f *new_type_id); +H5_FCDLL int_f h5tenum_insert_c(hid_t_f *type_id, _fcd name, int_f* namelen, int_f* value); H5_FCDLL int_f h5tenum_insert_ptr_c(hid_t_f *type_id, _fcd name, int_f* namelen, void *value); -H5_FCDLL int_f nh5tenum_nameof_c(hid_t_f *type_id, int_f* value, _fcd name, size_t_f* namelen); -H5_FCDLL int_f nh5tenum_valueof_c(hid_t_f *type_id, _fcd name, int_f* namelen, int_f* value); -H5_FCDLL int_f nh5tget_member_value_c(hid_t_f *type_id, int_f* member_no, int_f* value); -H5_FCDLL int_f nh5tset_tag_c(hid_t_f* type_id, _fcd tag, int_f* namelen); -H5_FCDLL int_f nh5tget_tag_c(hid_t_f* type_id, _fcd tag, size_t_f* tag_size, int_f* namelen); -H5_FCDLL int_f nh5tarray_create_c(hid_t_f * base_id, int_f *rank, hsize_t_f* dims, hid_t_f* type_id); -H5_FCDLL int_f nh5tget_array_dims_c ( hid_t_f *type_id , hsize_t_f * dims); -H5_FCDLL int_f nh5tget_array_ndims_c ( hid_t_f *type_id , int_f * ndims); -H5_FCDLL int_f nh5tget_super_c ( hid_t_f *type_id , hid_t_f *base_type_id); -H5_FCDLL int_f nh5tvlen_create_c ( hid_t_f *type_id , hid_t_f *vltype_id); -H5_FCDLL int_f nh5tis_variable_str_c ( hid_t_f *type_id , int_f *flag ); -H5_FCDLL int_f nh5tget_member_class_c ( hid_t_f *type_id , int_f *member_no, int_f *cls ); -H5_FCDLL int_f nh5tcommit_anon_c(hid_t_f *loc_id, hid_t_f *dtype_id, hid_t_f *tcpl_id, hid_t_f *tapl_id); -H5_FCDLL int_f nh5tdecode_c ( _fcd buf, hid_t_f *obj_id ); -H5_FCDLL int_f nh5tencode_c (_fcd buf, hid_t_f *obj_id, size_t_f *nalloc ); -H5_FCDLL int_f nh5tget_create_plist_c ( hid_t_f *dtype_id, hid_t_f *dtpl_id); -H5_FCDLL int_f nh5tcompiler_conv_c ( hid_t_f *src_id, hid_t_f *dst_id, int_f *c_flag); -H5_FCDLL int_f nh5tget_native_type_c(hid_t_f *dtype_id, int_f *direction, hid_t_f *native_dtype_id); +H5_FCDLL int_f h5tenum_nameof_c(hid_t_f *type_id, int_f* value, _fcd name, size_t_f* namelen); +H5_FCDLL int_f h5tenum_valueof_c(hid_t_f *type_id, _fcd name, int_f* namelen, int_f* value); +H5_FCDLL int_f h5tget_member_value_c(hid_t_f *type_id, int_f* member_no, int_f* value); +H5_FCDLL int_f h5tset_tag_c(hid_t_f* type_id, _fcd tag, int_f* namelen); +H5_FCDLL int_f h5tget_tag_c(hid_t_f* type_id, _fcd tag, size_t_f* tag_size, int_f* namelen); +H5_FCDLL int_f h5tarray_create_c(hid_t_f * base_id, int_f *rank, hsize_t_f* dims, hid_t_f* type_id); +H5_FCDLL int_f h5tget_array_dims_c( hid_t_f *type_id , hsize_t_f * dims); +H5_FCDLL int_f h5tget_array_ndims_c( hid_t_f *type_id , int_f * ndims); +H5_FCDLL int_f h5tget_super_c( hid_t_f *type_id , hid_t_f *base_type_id); +H5_FCDLL int_f h5tvlen_create_c( hid_t_f *type_id , hid_t_f *vltype_id); +H5_FCDLL int_f h5tis_variable_str_c( hid_t_f *type_id , int_f *flag ); +H5_FCDLL int_f h5tget_member_class_c( hid_t_f *type_id , int_f *member_no, int_f *cls ); +H5_FCDLL int_f h5tcommit_anon_c(hid_t_f *loc_id, hid_t_f *dtype_id, hid_t_f *tcpl_id, hid_t_f *tapl_id); +H5_FCDLL int_f h5tdecode_c( _fcd buf, hid_t_f *obj_id ); +H5_FCDLL int_f h5tencode_c(_fcd buf, hid_t_f *obj_id, size_t_f *nalloc ); +H5_FCDLL int_f h5tget_create_plist_c( hid_t_f *dtype_id, hid_t_f *dtpl_id); +H5_FCDLL int_f h5tcompiler_conv_c( hid_t_f *src_id, hid_t_f *dst_id, int_f *c_flag); +H5_FCDLL int_f h5tget_native_type_c(hid_t_f *dtype_id, int_f *direction, hid_t_f *native_dtype_id); H5_FCDLL int_f h5tconvert_c(hid_t_f *src_id, hid_t_f *dst_id, size_t_f *nelmts, void *buf, void *background, hid_t_f *plist_id); - /* * Functions from H5Of.c */ -#define nh5olink_c H5_FC_FUNC_(h5olink_c, H5OLINK_C) -#define nh5oopen_c H5_FC_FUNC_(h5oopen_c, H5OOPEN_C) -#define nh5oclose_c H5_FC_FUNC_(h5oclose_c, H5OCLOSE_C) -#define nh5oopen_by_addr_c H5_FC_FUNC_(h5oopen_by_addr_c, H5OOPEN_BY_ADDR_C) -#define nh5ocopy_c H5_FC_FUNC_(h5ocopy_c, H5OCOPY_C) -#define nh5odecr_refcount_c H5_FC_FUNC_(h5odecr_refcount_c, H5ODECR_REFCOUNT_C) -#define nh5oincr_refcount_c H5_FC_FUNC_(h5oincr_refcount_c, H5OINCR_REFCOUNT_C) -#define nh5oexists_by_name_c H5_FC_FUNC_(h5oexists_by_name_c, H5OEXISTS_BY_NAME_C) -#define nh5oset_comment_c H5_FC_FUNC_(h5oset_comment_c, H5OSET_COMMENT_C) -#define nh5oset_comment_by_name_c H5_FC_FUNC_(h5oset_comment_by_name_c, H5OSET_COMMENT_BY_NAME_C) -#define nh5oopen_by_idx_c H5_FC_FUNC_(h5oopen_by_idx_c, H5OOPEN_BY_IDX_C) -#define nh5oget_comment_c H5_FC_FUNC_(h5oget_comment_c, H5OGET_COMMENT_C) -#define nh5oget_comment_by_name_c H5_FC_FUNC_(h5oget_comment_by_name_c, H5OGET_COMMENT_BY_NAME_C) - -H5_FCDLL int_f nh5oopen_c (hid_t_f *loc_id, _fcd name, size_t_f *namelen, hid_t_f *lapl_id, hid_t_f *obj_id); -H5_FCDLL int_f nh5oclose_c (hid_t_f *object_id ); -H5_FCDLL int_f nh5oopen_by_addr_c (hid_t_f *loc_id, haddr_t_f *addr, hid_t_f *obj_id); -H5_FCDLL int_f nh5olink_c (hid_t_f *object_id, hid_t_f *new_loc_id, _fcd name, size_t_f *namelen, +H5_FCDLL int_f h5oopen_c(hid_t_f *loc_id, _fcd name, size_t_f *namelen, hid_t_f *lapl_id, hid_t_f *obj_id); +H5_FCDLL int_f h5oclose_c(hid_t_f *object_id ); +H5_FCDLL int_f h5oopen_by_addr_c(hid_t_f *loc_id, haddr_t_f *addr, hid_t_f *obj_id); +H5_FCDLL int_f h5olink_c(hid_t_f *object_id, hid_t_f *new_loc_id, _fcd name, size_t_f *namelen, hid_t_f *lcpl_id, hid_t_f *lapl_id); -H5_FCDLL int_f h5ovisit_c (hid_t_f *group_id, int_f *index_type, int_f *order, H5O_iterate_t op, void *op_data); +H5_FCDLL int_f h5ovisit_c(hid_t_f *group_id, int_f *index_type, int_f *order, H5O_iterate_t op, void *op_data); H5_FCDLL int_f h5ovisit_by_name_c(hid_t_f *loc_id, _fcd object_name, size_t_f *namelen, int_f *index_type, int_f *order, H5O_iterate_t op, void *op_data, hid_t_f *lapl_id ); -H5_FCDLL int_f h5oget_info_c (hid_t_f *object_id, H5O_info_t_f *object_info); -H5_FCDLL int_f h5oget_info_by_idx_c (hid_t_f *loc_id, _fcd group_name, size_t_f *namelen, +H5_FCDLL int_f h5oget_info_c(hid_t_f *object_id, H5O_info_t_f *object_info); +H5_FCDLL int_f h5oget_info_by_idx_c(hid_t_f *loc_id, _fcd group_name, size_t_f *namelen, int_f *index_field, int_f *order, hsize_t_f *n, hid_t_f *lapl_id, H5O_info_t_f *object_info); -H5_FCDLL int_f h5oget_info_by_name_c (hid_t_f *loc_id, _fcd name, size_t_f *namelen, hid_t_f *lapl_id, +H5_FCDLL int_f h5oget_info_by_name_c(hid_t_f *loc_id, _fcd name, size_t_f *namelen, hid_t_f *lapl_id, H5O_info_t_f *object_info); -H5_FCDLL int_f nh5ocopy_c (hid_t_f *src_loc_id, _fcd src_name, size_t_f *src_name_len, +H5_FCDLL int_f h5ocopy_c(hid_t_f *src_loc_id, _fcd src_name, size_t_f *src_name_len, hid_t_f *dst_loc_id, _fcd dst_name, size_t_f *dst_name_len, hid_t_f *ocpypl_id, hid_t_f *lcpl_id ); -H5_FCDLL int_f nh5odecr_refcount_c (hid_t_f *object_id); -H5_FCDLL int_f nh5oincr_refcount_c (hid_t_f *object_id); -H5_FCDLL int_f nh5oexists_by_name_c (hid_t_f *loc_id, _fcd name, size_t_f *namelen, hid_t_f *lapl_id); -H5_FCDLL int_f nh5oset_comment_c (hid_t_f *object_id, _fcd comment, size_t_f *commentlen); -H5_FCDLL int_f nh5oset_comment_by_name_c (hid_t_f *object_id, _fcd name, size_t_f *namelen, _fcd comment, size_t_f *commentlen, hid_t_f *lapl_id); -H5_FCDLL int_f nh5oopen_by_idx_c (hid_t_f *loc_id, _fcd group_name, size_t_f *group_namelen, +H5_FCDLL int_f h5odecr_refcount_c(hid_t_f *object_id); +H5_FCDLL int_f h5oincr_refcount_c(hid_t_f *object_id); +H5_FCDLL int_f h5oexists_by_name_c(hid_t_f *loc_id, _fcd name, size_t_f *namelen, hid_t_f *lapl_id); +H5_FCDLL int_f h5oset_comment_c(hid_t_f *object_id, _fcd comment, size_t_f *commentlen); +H5_FCDLL int_f h5oset_comment_by_name_c(hid_t_f *object_id, _fcd name, size_t_f *namelen, _fcd comment, size_t_f *commentlen, hid_t_f *lapl_id); +H5_FCDLL int_f h5oopen_by_idx_c(hid_t_f *loc_id, _fcd group_name, size_t_f *group_namelen, int_f *index_type, int_f *order, hsize_t_f *n, hid_t_f *obj_id, hid_t_f *lapl_id); -H5_FCDLL int_f nh5oget_comment_c (hid_t_f *object_id, _fcd comment, size_t_f *commentsize, hssize_t_f *bufsize); -H5_FCDLL int_f nh5oget_comment_by_name_c (hid_t_f *loc_id, _fcd name, size_t_f *name_size, +H5_FCDLL int_f h5oget_comment_c(hid_t_f *object_id, _fcd comment, size_t_f *commentsize, hssize_t_f *bufsize); +H5_FCDLL int_f h5oget_comment_by_name_c(hid_t_f *loc_id, _fcd name, size_t_f *name_size, _fcd comment, size_t_f *commentsize, size_t_f *bufsize, hid_t_f *lapl_id); /* * Functions from H5Pf.c */ -#define nh5pcreate_c H5_FC_FUNC_(h5pcreate_c, H5PCREATE_C) -#define nh5pclose_c H5_FC_FUNC_(h5pclose_c, H5PCLOSE_C) -#define nh5pcopy_c H5_FC_FUNC_(h5pcopy_c, H5PCOPY_C) -#define nh5pcreate_class_f90_c H5_FC_FUNC_(h5pcreate_class_f90_c, H5PCREATE_CLASS_F90_C) -#define nh5pequal_c H5_FC_FUNC_(h5pequal_c, H5PEQUAL_C) -#define nh5pget_class_c H5_FC_FUNC_(h5pget_class_c, H5PGET_CLASS_C) -#define nh5pset_deflate_c H5_FC_FUNC_(h5pset_deflate_c, H5PSET_DEFLATE_C) -#define nh5pset_preserve_c H5_FC_FUNC_(h5pset_preserve_c, H5PSET_PRESERVE_C) -#define nh5pget_preserve_c H5_FC_FUNC_(h5pget_preserve_c, H5PGET_PRESERVE_C) -#define nh5pset_chunk_c H5_FC_FUNC_(h5pset_chunk_c, H5PSET_CHUNK_C) -#define nh5pget_chunk_c H5_FC_FUNC_(h5pget_chunk_c, H5PGET_CHUNK_C) -#define nh5pset_fill_valuec_c H5_FC_FUNC_(h5pset_fill_valuec_c, H5PSET_FILL_VALUEC_C) -#define nh5pset_fill_value_integer_c H5_FC_FUNC_(h5pset_fill_value_integer_c, H5PSET_FILL_VALUE_INTEGER_C) -#define nh5pset_fill_value_real_c H5_FC_FUNC_(h5pset_fill_value_real_c, H5PSET_FILL_VALUE_REAL_C) -#define nh5pset_fill_value_double_c H5_FC_FUNC_(h5pset_fill_value_double_c, H5PSET_FILL_VALUE_DOUBLE_C) -#define nh5pget_fill_valuec_c H5_FC_FUNC_(h5pget_fill_valuec_c, H5PGET_FILL_VALUEC_C) -#define nh5pget_fill_value_integer_c H5_FC_FUNC_(h5pget_fill_value_integer_c, H5PGET_FILL_VALUE_INTEGER_C) -#define nh5pget_fill_value_real_c H5_FC_FUNC_(h5pget_fill_value_real_c, H5PGET_FILL_VALUE_REAL_C) -#define nh5pget_fill_value_double_c H5_FC_FUNC_(h5pget_fill_value_double_c, H5PGET_FILL_VALUE_DOUBLE_C) -#define nh5pget_version_c H5_FC_FUNC_(h5pget_version_c, H5PGET_VERSION_C) -#define nh5pget_userblock_c H5_FC_FUNC_(h5pget_userblock_c, H5PGET_USERBLOCK_C) -#define nh5pset_userblock_c H5_FC_FUNC_(h5pset_userblock_c, H5PSET_USERBLOCK_C) -#define nh5pset_sizes_c H5_FC_FUNC_(h5pset_sizes_c, H5PSET_SIZES_C) -#define nh5pget_sizes_c H5_FC_FUNC_(h5pget_sizes_c, H5PGET_SIZES_C) -#define nh5pget_sym_k_c H5_FC_FUNC_(h5pget_sym_k_c, H5PGET_SYM_K_C) -#define nh5pset_sym_k_c H5_FC_FUNC_(h5pset_sym_k_c, H5PSET_SYM_K_C) -#define nh5pget_istore_k_c H5_FC_FUNC_(h5pget_istore_k_c, H5PGET_ISTORE_K_C) -#define nh5pset_istore_k_c H5_FC_FUNC_(h5pset_istore_k_c, H5PSET_ISTORE_K_C) -#define nh5pget_driver_c H5_FC_FUNC_(h5pget_driver_c, H5PGET_DRIVER_C) -#define nh5pset_fapl_stdio_c H5_FC_FUNC_(h5pset_fapl_stdio_c, H5PSET_FAPL_STDIO_C) -#define nh5pget_fapl_stdio_c H5_FC_FUNC_(h5pget_fapl_stdio_c, H5PGET_FAPL_STDIO_C) -#define nh5pset_fapl_sec2_c H5_FC_FUNC_(h5pset_fapl_sec2_c, H5PSET_FAPL_SEC2_C) -#define nh5pget_fapl_sec2_c H5_FC_FUNC_(h5pget_fapl_sec2_c, H5PGET_FAPL_SEC2_C) -#define nh5pset_alignment_c H5_FC_FUNC_(h5pset_alignment_c, H5PSET_ALIGNMENT_C) -#define nh5pget_alignment_c H5_FC_FUNC_(h5pget_alignment_c, H5PGET_ALIGNMENT_C) -#define nh5pset_fapl_core_c H5_FC_FUNC_(h5pset_fapl_core_c, H5PSET_FAPL_CORE_C) -#define nh5pget_fapl_core_c H5_FC_FUNC_(h5pget_fapl_core_c, H5PGET_FAPL_CORE_C) -#define nh5pset_fapl_family_c H5_FC_FUNC_(h5pset_fapl_family_c, H5PSET_FAPL_FAMILY_C) -#define nh5pget_fapl_family_c H5_FC_FUNC_(h5pget_fapl_family_c, H5PGET_FAPL_FAMILY_C) -#define nh5pset_cache_c H5_FC_FUNC_(h5pset_cache_c, H5PSET_CACHE_C) -#define nh5pget_cache_c H5_FC_FUNC_(h5pget_cache_c, H5PGET_CACHE_C) -#define nh5pset_fapl_split_c H5_FC_FUNC_(h5pset_fapl_split_c, H5PSET_FAPL_SPLIT_C) -#define nh5pget_fapl_split_c H5_FC_FUNC_(h5pget_fapl_split_c, H5PGET_FAPL_SPLIT_C) -#define nh5pset_gc_references_c H5_FC_FUNC_(h5pset_gc_references_c, H5PSET_GC_REFERENCES_C) -#define nh5pget_gc_references_c H5_FC_FUNC_(h5pget_gc_references_c, H5PGET_GC_REFERENCES_C) -#define nh5pset_layout_c H5_FC_FUNC_(h5pset_layout_c, H5PSET_LAYOUT_C) -#define nh5pget_layout_c H5_FC_FUNC_(h5pget_layout_c, H5PGET_LAYOUT_C) -#define nh5pset_filter_c H5_FC_FUNC_(h5pset_filter_c, H5PSET_FILTER_C) -#define nh5premove_filter_c H5_FC_FUNC_(h5premove_filter_c, H5PREMOVE_FILTER_C) -#define nh5pmodify_filter_c H5_FC_FUNC_(h5pmodify_filter_c, H5PMODIFY_FILTER_C) -#define nh5pget_nfilters_c H5_FC_FUNC_(h5pget_nfilters_c, H5PGET_NFILTERS_C) -#define nh5pget_filter_c H5_FC_FUNC_(h5pget_filter_c, H5PGET_FILTER_C) -#define nh5pget_filter_by_id_c H5_FC_FUNC_(h5pget_filter_by_id_c, H5PGET_FILTER_BY_ID_C) -#define nh5pset_external_c H5_FC_FUNC_(h5pset_external_c, H5PSET_EXTERNAL_C) -#define nh5pget_external_count_c H5_FC_FUNC_(h5pget_external_count_c, H5PGET_EXTERNAL_COUNT_C) -#define nh5pget_external_c H5_FC_FUNC_(h5pget_external_c, H5PGET_EXTERNAL_C) -#define nh5pget_btree_ratios_c H5_FC_FUNC_(h5pget_btree_ratios_c, H5PGET_BTREE_RATIOS_C) -#define nh5pset_btree_ratios_c H5_FC_FUNC_(h5pset_btree_ratios_c, H5PSET_BTREE_RATIOS_C) -#define nh5pset_fapl_mpio_c H5_FC_FUNC_(h5pset_fapl_mpio_c, H5PSET_FAPL_MPIO_C) -#define nh5pget_fapl_mpio_c H5_FC_FUNC_(h5pget_fapl_mpio_c, H5PGET_FAPL_MPIO_C) -#define nh5pset_dxpl_mpio_c H5_FC_FUNC_(h5pset_dxpl_mpio_c, H5PSET_DXPL_MPIO_C) -#define nh5pget_dxpl_mpio_c H5_FC_FUNC_(h5pget_dxpl_mpio_c, H5PGET_DXPL_MPIO_C) -#define nh5pget_fclose_degree_c H5_FC_FUNC_(h5pget_fclose_degree_c, H5PGET_FCLOSE_DEGREE_C) -#define nh5pset_fclose_degree_c H5_FC_FUNC_(h5pset_fclose_degree_c, H5PSET_FCLOSE_DEGREE_C) -#define nh5pset_buffer_c H5_FC_FUNC_(h5pset_buffer_c, H5PSET_BUFFER_C) -#define nh5pget_buffer_c H5_FC_FUNC_(h5pget_buffer_c, H5PGET_BUFFER_C) -#define nh5pfill_value_defined_c H5_FC_FUNC_(h5pfill_value_defined_c, H5PFILL_VALUE_DEFINED_C) -#define nh5pset_alloc_time_c H5_FC_FUNC_(h5pset_alloc_time_c, H5PSET_ALLOC_TIME_C) -#define nh5pget_alloc_time_c H5_FC_FUNC_(h5pget_alloc_time_c, H5PGET_ALLOC_TIME_C) -#define nh5pset_fill_time_c H5_FC_FUNC_(h5pset_fill_time_c, H5PSET_FILL_TIME_C) -#define nh5pget_fill_time_c H5_FC_FUNC_(h5pget_fill_time_c, H5PGET_FILL_TIME_C) -#define nh5pset_meta_block_size_c H5_FC_FUNC_(h5pset_meta_block_size_c, H5PSET_META_BLOCK_SIZE_C) -#define nh5pget_meta_block_size_c H5_FC_FUNC_(h5pget_meta_block_size_c, H5PGET_META_BLOCK_SIZE_C) -#define nh5pset_sieve_buf_size_c H5_FC_FUNC_(h5pset_sieve_buf_size_c, H5PSET_SIEVE_BUF_SIZE_C) -#define nh5pget_sieve_buf_size_c H5_FC_FUNC_(h5pget_sieve_buf_size_c, H5PGET_SIEVE_BUF_SIZE_C) -#define nh5pset_hyper_vector_size_c H5_FC_FUNC_(h5pset_hyper_vector_size_c, H5PSET_HYPER_VECTOR_SIZE_C) -#define nh5pget_hyper_vector_size_c H5_FC_FUNC_(h5pget_hyper_vector_size_c, H5PGET_HYPER_VECTOR_SIZE_C) -#define nh5pset_small_data_block_size_c H5_FC_FUNC_(h5pset_small_data_block_size_c, H5PSET_SMALL_DATA_BLOCK_SIZE_C) -#define nh5pget_small_data_block_size_c H5_FC_FUNC_(h5pget_small_data_block_size_c, H5PGET_SMALL_DATA_BLOCK_SIZE_C) -#define nh5pregister_integer_c H5_FC_FUNC_(h5pregister_integer_c, H5PREGISTER_INTEGER_C) -#define nh5pregister_real_c H5_FC_FUNC_(h5pregister_real_c, H5PREGISTER_REAL_C) -#define nh5pregister_double_c H5_FC_FUNC_(h5pregister_double_c, H5PREGISTER_DOUBLE_C) -#define nh5pregisterc_c H5_FC_FUNC_(h5pregisterc_c, H5PREGISTERC_C) -#define nh5pinsert_integer_c H5_FC_FUNC_(h5pinsert_integer_c, H5PINSERT_INTEGER_C) -#define nh5pinsert_real_c H5_FC_FUNC_(h5pinsert_real_c, H5PINSERT_REAL_C) -#define nh5pinsert_double_c H5_FC_FUNC_(h5pinsert_double_c, H5PINSERT_DOUBLE_C) -#define nh5pinsertc_c H5_FC_FUNC_(h5pinsertc_c, H5PINSERTC_C) -#define nh5pset_integer_c H5_FC_FUNC_(h5pset_integer_c, H5PSET_INTEGER_C) -#define nh5pset_real_c H5_FC_FUNC_(h5pset_real_c, H5PSET_REAL_C) -#define nh5pset_double_c H5_FC_FUNC_(h5pset_double_c, H5PSET_DOUBLE_C) -#define nh5psetc_c H5_FC_FUNC_(h5psetc_c, H5PSETC_C) -#define nh5pget_integer_c H5_FC_FUNC_(h5pget_integer_c, H5PGET_INTEGER_C) -#define nh5pget_real_c H5_FC_FUNC_(h5pget_real_c, H5PGET_REAL_C) -#define nh5pget_double_c H5_FC_FUNC_(h5pget_double_c, H5PGET_DOUBLE_C) -#define nh5pgetc_c H5_FC_FUNC_(h5pgetc_c, H5PGETC_C) -#define nh5pexist_c H5_FC_FUNC_(h5pexist_c, H5PEXIST_C) -#define nh5pget_size_c H5_FC_FUNC_(h5pget_size_c, H5PGET_SIZE_C) -#define nh5pget_nprops_c H5_FC_FUNC_(h5pget_nprops_c, H5PGET_NPROPS_C) -#define nh5pget_class_parent_c H5_FC_FUNC_(h5pget_class_parent_c, H5PGET_CLASS_PARENT_C) -#define nh5pisa_class_c H5_FC_FUNC_(h5pisa_class_c, H5PISA_CLASS_C) -#define nh5pcopy_prop_c H5_FC_FUNC_(h5pcopy_prop_c, H5PCOPY_PROP_C) -#define nh5premove_c H5_FC_FUNC_(h5premove_c, H5PREMOVE_C) -#define nh5punregister_c H5_FC_FUNC_(h5punregister_c, H5PUNREGISTER_C) -#define nh5pclose_class_c H5_FC_FUNC_(h5pclose_class_c, H5PCLOSE_CLASS_C) -#define nh5pget_class_name_c H5_FC_FUNC_(h5pget_class_name_c, H5PGET_CLASS_NAME_C) -#define nh5pset_shuffle_c H5_FC_FUNC_(h5pset_shuffle_c, H5PSET_SHUFFLE_C) -#define nh5pset_fletcher32_c H5_FC_FUNC_(h5pset_fletcher32_c, H5PSET_FLETCHER32_C) -#define nh5pset_edc_check_c H5_FC_FUNC_(h5pset_edc_check_c, H5PSET_EDC_CHECK_C) -#define nh5pget_edc_check_c H5_FC_FUNC_(h5pget_edc_check_c, H5PGET_EDC_CHECK_C) -#define nh5pset_family_offset_c H5_FC_FUNC_(h5pset_family_offset_c, H5PSET_FAMILY_OFFSET_C) -#define nh5pget_fapl_multi_c H5_FC_FUNC_(h5pget_fapl_multi_c, H5PGET_FAPL_MULTI_C) -#define nh5pset_fapl_multi_c H5_FC_FUNC_(h5pset_fapl_multi_c, H5PSET_FAPL_MULTI_C) -#define nh5pset_fapl_multi_sc H5_FC_FUNC_(h5pset_fapl_multi_sc, H5PSET_FAPL_MULTI_SC) -#define nh5pset_szip_c H5_FC_FUNC_(h5pset_szip_c, H5PSET_SZIP_C) -#define nh5pall_filters_avail_c H5_FC_FUNC_(h5pall_filters_avail_c, H5PALL_FILTERS_AVAIL_C) -#define nh5pget_attr_phase_change_c H5_FC_FUNC_(h5pget_attr_phase_change_c, H5PGET_ATTR_PHASE_CHANGE_C) -#define nh5pset_attr_creation_order_c H5_FC_FUNC_(h5pset_attr_creation_order_c, H5PSET_ATTR_CREATION_ORDER_C) -#define nh5pset_shared_mesg_nindexes_c H5_FC_FUNC_(h5pset_shared_mesg_nindexes_c, H5PSET_SHARED_MESG_NINDEXES_C) -#define nh5pset_shared_mesg_index_c H5_FC_FUNC_(h5pset_shared_mesg_index_c,H5PSET_SHARED_MESG_INDEX_C) -#define nh5pget_attr_creation_order_c H5_FC_FUNC_(h5pget_attr_creation_order_c,H5PGET_ATTR_CREATION_ORDER_C) -#define nh5pset_libver_bounds_c H5_FC_FUNC_(h5pset_libver_bounds_c,H5PSET_LIBVER_BOUNDS_C) -#define nh5pset_link_creation_order_c H5_FC_FUNC_(h5pset_link_creation_order_c, H5PSET_LINK_CREATION_ORDER_C) -#define nh5pget_link_phase_change_c H5_FC_FUNC_(h5pget_link_phase_change_c, H5PGET_LINK_PHASE_CHANGE_C) -#define nh5pget_obj_track_times_c H5_FC_FUNC_(h5pget_obj_track_times_c, H5PGET_OBJ_TRACK_TIMES_C) -#define nh5pset_obj_track_times_c H5_FC_FUNC_(h5pset_obj_track_times_c, H5PSET_OBJ_TRACK_TIMES_C) -#define nh5pset_create_inter_group_c H5_FC_FUNC_(h5pset_create_inter_group_c,H5PSET_CREATE_INTER_GROUP_C) -#define nh5pget_create_inter_group_c H5_FC_FUNC_(h5pget_create_inter_group_c,H5PGET_CREATE_INTER_GROUP_C) -#define nh5pget_link_creation_order_c H5_FC_FUNC_(h5pget_link_creation_order_c,H5PGET_LINK_CREATION_ORDER_C) -#define nh5pset_char_encoding_c H5_FC_FUNC_(h5pset_char_encoding_c, H5PSET_CHAR_ENCODING_C) -#define nh5pget_char_encoding_c H5_FC_FUNC_(h5pget_char_encoding_c, H5PGET_CHAR_ENCODING_C) -#define nh5pset_copy_object_c H5_FC_FUNC_(h5pset_copy_object_c, H5PSET_COPY_OBJECT_C) -#define nh5pget_copy_object_c H5_FC_FUNC_(h5pget_copy_object_c, H5PGET_COPY_OBJECT_C) -#define nh5pget_data_transform_c H5_FC_FUNC_(h5pget_data_transform_c, H5PGET_DATA_TRANSFORM_C) -#define nh5pset_data_transform_c H5_FC_FUNC_(h5pset_data_transform_c, H5PSET_DATA_TRANSFORM_C) -#define nh5pget_local_heap_size_hint_c H5_FC_FUNC_(h5pget_local_heap_size_hint_c, H5PGET_LOCAL_HEAP_SIZE_HINT_C) -#define nh5pget_est_link_info_c H5_FC_FUNC_(h5pget_est_link_info_c,H5PGET_EST_LINK_INFO_C) -#define nh5pset_est_link_info_c H5_FC_FUNC_(h5pset_est_link_info_c,H5PSET_EST_LINK_INFO_C) -#define nh5pset_local_heap_size_hint_c H5_FC_FUNC_(h5pset_local_heap_size_hint_c, H5PSET_LOCAL_HEAP_SIZE_HINT_C) -#define nh5pset_link_phase_change_c H5_FC_FUNC_(h5pset_link_phase_change_c, H5PSET_LINK_PHASE_CHANGE_C) -#define nh5pset_fapl_direct_c H5_FC_FUNC_(h5pset_fapl_direct_c, H5PSET_FAPL_DIRECT_C) -#define nh5pget_fapl_direct_c H5_FC_FUNC_(h5pget_fapl_direct_c, H5PGET_FAPL_DIRECT_C) -#define nh5pset_attr_phase_change_c H5_FC_FUNC_(h5pset_attr_phase_change_c, H5PSET_ATTR_PHASE_CHANGE_C) -#define nh5pset_nbit_c H5_FC_FUNC_(h5pset_nbit_c, H5PSET_NBIT_C) -#define nh5pset_scaleoffset_c H5_FC_FUNC_(h5pset_scaleoffset_c, H5PSET_SCALEOFFSET_C) -#define nh5pset_nlinks_c H5_FC_FUNC_(h5pset_nlinks_c, H5PSET_NLINKS_C) -#define nh5pget_nlinks_c H5_FC_FUNC_(h5pget_nlinks_c, H5PGET_NLINKS_C) -#define nh5pset_chunk_cache_c H5_FC_FUNC_(h5pset_chunk_cache_c, H5PSET_CHUNK_CACHE_C) -#define nh5pget_chunk_cache_c H5_FC_FUNC_(h5pget_chunk_cache_c, H5PGET_CHUNK_CACHE_C) -#define nh5pget_mpio_actual_io_mode_c H5_FC_FUNC_(h5pget_mpio_actual_io_mode_c, H5PGET_MPIO_ACTUAL_IO_MODE_C) - -H5_FCDLL int_f nh5pcreate_c ( hid_t_f *cls, hid_t_f *prp_id ); -H5_FCDLL int_f nh5pclose_c ( hid_t_f *prp_id ); -H5_FCDLL int_f nh5pcopy_c ( hid_t_f *prp_id , hid_t_f *new_prp_id); -H5_FCDLL int_f nh5pequal_c ( hid_t_f *plist1_id , hid_t_f *plist2_id, int_f *c_flag); -H5_FCDLL int_f nh5pget_class_c ( hid_t_f *prp_id , hid_t_f *classtype); -H5_FCDLL int_f nh5pset_deflate_c ( hid_t_f *prp_id , int_f *level); -H5_FCDLL int_f nh5pset_chunk_c ( hid_t_f *prp_id, int_f *rank, hsize_t_f *dims ); -H5_FCDLL int_f nh5pget_chunk_c ( hid_t_f *prp_id, int_f *max_rank, hsize_t_f *dims ); -H5_FCDLL int_f h5pset_file_image_c (hid_t_f *fapl_id, void *buf_ptr, size_t_f *buf_len); -H5_FCDLL int_f nh5pset_fill_valuec_c (hid_t_f *prp_id, hid_t_f *type_id, _fcd fillvalue); -H5_FCDLL int_f h5pset_fill_value_c (hid_t_f *prp_id, hid_t_f *type_id, void *fillvalue); -H5_FCDLL int_f nh5pset_fill_value_integer_c (hid_t_f *prp_id, hid_t_f *type_id, void *fillvalue); -H5_FCDLL int_f nh5pset_fill_value_real_c (hid_t_f *prp_id, hid_t_f *type_id, void *fillvalue); -H5_FCDLL int_f nh5pset_fill_value_double_c (hid_t_f *prp_id, hid_t_f *type_id, void *fillvalue); -H5_FCDLL int_f h5pget_file_image_c (hid_t_f *fapl_id, void **buf_ptr, size_t_f *buf_len); -H5_FCDLL int_f nh5pget_fill_valuec_c (hid_t_f *prp_id, hid_t_f *type_id, _fcd fillvalue); -H5_FCDLL int_f h5pget_fill_value_c (hid_t_f *prp_id, hid_t_f *type_id, void *fillvalue); -H5_FCDLL int_f nh5pget_fill_value_integer_c (hid_t_f *prp_id, hid_t_f *type_id, void *fillvalue); -H5_FCDLL int_f nh5pget_fill_value_real_c (hid_t_f *prp_id, hid_t_f *type_id, void *fillvalue); -H5_FCDLL int_f nh5pget_fill_value_double_c (hid_t_f *prp_id, hid_t_f *type_id, void *fillvalue); -H5_FCDLL int_f nh5pset_preserve_c ( hid_t_f *prp_id , int_f *flag); -H5_FCDLL int_f nh5pget_preserve_c ( hid_t_f *prp_id , int_f *flag); -H5_FCDLL int_f nh5pget_version_c (hid_t_f *prp_id, int_f * boot,int_f * freelist, int_f * stab, int_f *shhdr); -H5_FCDLL int_f nh5pset_userblock_c (hid_t_f *prp_id, hsize_t_f * size); -H5_FCDLL int_f nh5pget_userblock_c (hid_t_f *prp_id, hsize_t_f * size); -H5_FCDLL int_f nh5pget_sizes_c (hid_t_f *prp_id, size_t_f * sizeof_addr, size_t_f * sizeof_size); -H5_FCDLL int_f nh5pset_sizes_c (hid_t_f *prp_id, size_t_f * sizeof_addr, size_t_f * sizeof_size); -H5_FCDLL int_f nh5pset_sym_k_c (hid_t_f *prp_id, int_f* ik, int_f* lk); -H5_FCDLL int_f nh5pget_sym_k_c (hid_t_f *prp_id, int_f* ik, int_f* lk); -H5_FCDLL int_f nh5pset_istore_k_c (hid_t_f *prp_id, int_f* ik); -H5_FCDLL int_f nh5pget_istore_k_c (hid_t_f *prp_id, int_f* ik); -H5_FCDLL int_f nh5pget_driver_c (hid_t_f *prp_id, hid_t_f*driver); -H5_FCDLL int_f nh5pset_fapl_stdio_c (hid_t_f *prp_id); -H5_FCDLL int_f nh5pget_fapl_stdio_c (hid_t_f *prp_id, int_f* io); -H5_FCDLL int_f nh5pset_fapl_sec2_c (hid_t_f *prp_id); -H5_FCDLL int_f nh5pget_fapl_sec2_c (hid_t_f *prp_id, int_f* sec2); -H5_FCDLL int_f nh5pset_alignment_c(hid_t_f *prp_id, hsize_t_f* threshold, hsize_t_f* alignment); -H5_FCDLL int_f nh5pget_alignment_c(hid_t_f *prp_id, hsize_t_f* threshold, hsize_t_f* alignment); -H5_FCDLL int_f nh5pget_fapl_core_c (hid_t_f *prp_id, size_t_f* increment, int_f *flag); -H5_FCDLL int_f nh5pset_fapl_core_c (hid_t_f *prp_id, size_t_f* increment, int_f *flag); -H5_FCDLL int_f nh5pset_fapl_family_c (hid_t_f *prp_id, hsize_t_f* memb_size, hid_t_f* memb_plist ); -H5_FCDLL int_f nh5pget_fapl_family_c (hid_t_f *prp_id, hsize_t_f* memb_size, hid_t_f* memb_plist ); -H5_FCDLL int_f nh5pset_cache_c(hid_t_f *prp_id, int_f* mdc_nelmts, size_t_f* rdcc_nelmts, size_t_f* rdcc_nbytes, real_f* rdcc_w0); -H5_FCDLL int_f nh5pget_cache_c(hid_t_f *prp_id, int_f* mdc_nelmts, size_t_f* rdcc_nelmts, size_t_f* rdcc_nbytes, real_f* rdcc_w0); -H5_FCDLL int_f nh5pget_fapl_split_c(hid_t_f *prp_id, size_t_f* meta_ext_size , _fcd meta_ext, hid_t_f* meta_plist, size_t_f* raw_ext_size, _fcd raw_ext, hid_t_f * raw_plist); -H5_FCDLL int_f nh5pset_fapl_split_c(hid_t_f *prp_id, int_f* meta_len, _fcd meta_ext, hid_t_f* meta_plist, int_f* raw_len, _fcd raw_ext, hid_t_f * raw_plist); -H5_FCDLL int_f nh5pset_gc_references_c(hid_t_f *prp_id, int_f* gc_references); -H5_FCDLL int_f nh5pget_gc_references_c(hid_t_f *prp_id, int_f* gc_references); -H5_FCDLL int_f nh5pset_layout_c (hid_t_f *prp_id, int_f* layout); -H5_FCDLL int_f nh5pget_layout_c (hid_t_f *prp_id, int_f* layout); -H5_FCDLL int_f nh5pset_filter_c (hid_t_f *prp_id, int_f* filter, int_f* flags, size_t_f* cd_nelmts, int_f* cd_values ); -H5_FCDLL int_f nh5premove_filter_c (hid_t_f *prp_id, int_f* filter); -H5_FCDLL int_f nh5pmodify_filter_c (hid_t_f *prp_id, int_f* filter, int_f* flags, size_t_f* cd_nelmts, int_f* cd_values ); -H5_FCDLL int_f nh5pget_nfilters_c (hid_t_f *prp_id, int_f* nfilters); -H5_FCDLL int_f nh5pget_filter_c(hid_t_f *prp_id, int_f* filter_number, int_f* flags, size_t_f* cd_nelmts, int_f* cd_values, size_t_f *namelen, _fcd name, int_f* filter_id); -H5_FCDLL int_f nh5pget_filter_by_id_c(hid_t_f *prp_id, int_f* filter_id, int_f* flags, size_t_f* cd_nelmts, int_f* cd_values, size_t_f *namelen, _fcd name); -H5_FCDLL int_f nh5pset_external_c (hid_t_f *prp_id, _fcd name, int_f* namelen, off_t_f* offset, hsize_t_f*bytes); -H5_FCDLL int_f nh5pget_external_count_c (hid_t_f *prp_id, int_f* count); -H5_FCDLL int_f nh5pget_external_c(hid_t_f *prp_id, int_f *idx, size_t_f* name_size, _fcd name, off_t_f* offset, hsize_t_f*bytes); -H5_FCDLL int_f nh5pget_btree_ratios_c(hid_t_f *prp_id, real_f* left, real_f* middle, real_f* right); -H5_FCDLL int_f nh5pset_btree_ratios_c(hid_t_f *prp_id, real_f* left, real_f* middle, real_f* right); -H5_FCDLL int_f nh5pget_fapl_mpio_c(hid_t_f *prp_id, int_f* comm, int_f* info); -H5_FCDLL int_f nh5pset_fapl_mpio_c(hid_t_f *prp_id, int_f* comm, int_f* info); -H5_FCDLL int_f nh5pget_dxpl_mpio_c(hid_t_f *prp_id, int_f* data_xfer_mode); -H5_FCDLL int_f nh5pset_dxpl_mpio_c(hid_t_f *prp_id, int_f* data_xfer_mode); -H5_FCDLL int_f nh5pset_fclose_degree_c(hid_t_f *fapl, int_f *degree); -H5_FCDLL int_f nh5pget_fclose_degree_c(hid_t_f *fapl, int_f *degree); -H5_FCDLL int_f nh5pget_buffer_c(hid_t_f *plist, hsize_t_f *size); -H5_FCDLL int_f nh5pset_buffer_c(hid_t_f *plist, hsize_t_f *size); -H5_FCDLL int_f nh5pset_alloc_time_c(hid_t_f *plist, int_f *flag); -H5_FCDLL int_f nh5pget_alloc_time_c(hid_t_f *plist, int_f *flag); -H5_FCDLL int_f nh5pset_fill_time_c(hid_t_f *plist, int_f *flag); -H5_FCDLL int_f nh5pget_fill_time_c(hid_t_f *plist, int_f *flag); -H5_FCDLL int_f nh5pset_meta_block_size_c(hid_t_f *plist, hsize_t_f *size); -H5_FCDLL int_f nh5pget_meta_block_size_c(hid_t_f *plist, hsize_t_f *size); -H5_FCDLL int_f nh5pset_sieve_buf_size_c(hid_t_f *plist, size_t_f *size); -H5_FCDLL int_f nh5pget_sieve_buf_size_c(hid_t_f *plist, size_t_f *size); -H5_FCDLL int_f nh5pset_small_data_block_size_c(hid_t_f *plist, hsize_t_f *size); -H5_FCDLL int_f nh5pget_small_data_block_size_c(hid_t_f *plist, hsize_t_f *size); -H5_FCDLL int_f nh5pset_hyper_vector_size_c(hid_t_f *plist, size_t_f *size); -H5_FCDLL int_f nh5pget_hyper_vector_size_c(hid_t_f *plist, size_t_f *size); +H5_FCDLL int_f h5pcreate_c( hid_t_f *cls, hid_t_f *prp_id ); +H5_FCDLL int_f h5pclose_c( hid_t_f *prp_id ); +H5_FCDLL int_f h5pcopy_c( hid_t_f *prp_id , hid_t_f *new_prp_id); +H5_FCDLL int_f h5pequal_c( hid_t_f *plist1_id , hid_t_f *plist2_id, int_f *c_flag); +H5_FCDLL int_f h5pget_class_c( hid_t_f *prp_id , hid_t_f *classtype); +H5_FCDLL int_f h5pset_deflate_c( hid_t_f *prp_id , int_f *level); +H5_FCDLL int_f h5pset_chunk_c( hid_t_f *prp_id, int_f *rank, hsize_t_f *dims ); +H5_FCDLL int_f h5pget_chunk_c( hid_t_f *prp_id, int_f *max_rank, hsize_t_f *dims ); +H5_FCDLL int_f h5pset_file_image_c(hid_t_f *fapl_id, void *buf_ptr, size_t_f *buf_len); +H5_FCDLL int_f h5pset_fill_value_c(hid_t_f *prp_id, hid_t_f *type_id, void *fillvalue); +H5_FCDLL int_f h5pget_file_image_c(hid_t_f *fapl_id, void **buf_ptr, size_t_f *buf_len); +H5_FCDLL int_f h5pget_fill_value_c(hid_t_f *prp_id, hid_t_f *type_id, void *fillvalue); +H5_FCDLL int_f h5pset_preserve_c( hid_t_f *prp_id , int_f *flag); +H5_FCDLL int_f h5pget_preserve_c( hid_t_f *prp_id , int_f *flag); +H5_FCDLL int_f h5pget_version_c(hid_t_f *prp_id, int_f * boot,int_f * freelist, int_f * stab, int_f *shhdr); +H5_FCDLL int_f h5pset_userblock_c(hid_t_f *prp_id, hsize_t_f * size); +H5_FCDLL int_f h5pget_userblock_c(hid_t_f *prp_id, hsize_t_f * size); +H5_FCDLL int_f h5pget_sizes_c(hid_t_f *prp_id, size_t_f * sizeof_addr, size_t_f * sizeof_size); +H5_FCDLL int_f h5pset_sizes_c(hid_t_f *prp_id, size_t_f * sizeof_addr, size_t_f * sizeof_size); +H5_FCDLL int_f h5pset_sym_k_c(hid_t_f *prp_id, int_f* ik, int_f* lk); +H5_FCDLL int_f h5pget_sym_k_c(hid_t_f *prp_id, int_f* ik, int_f* lk); +H5_FCDLL int_f h5pset_istore_k_c(hid_t_f *prp_id, int_f* ik); +H5_FCDLL int_f h5pget_istore_k_c(hid_t_f *prp_id, int_f* ik); +H5_FCDLL int_f h5pget_driver_c(hid_t_f *prp_id, hid_t_f*driver); +H5_FCDLL int_f h5pset_fapl_stdio_c(hid_t_f *prp_id); +#ifdef NO_SUCH_F90_FUNCTION +H5_FCDLL int_f h5pget_fapl_stdio_c(hid_t_f *prp_id, int_f* io); +#endif +H5_FCDLL int_f h5pset_fapl_sec2_c(hid_t_f *prp_id); +#ifdef NO_SUCH_F90_FUNCTION +H5_FCDLL int_f h5pget_fapl_sec2_c(hid_t_f *prp_id, int_f* sec2); +#endif +H5_FCDLL int_f h5pset_alignment_c(hid_t_f *prp_id, hsize_t_f* threshold, hsize_t_f* alignment); +H5_FCDLL int_f h5pget_alignment_c(hid_t_f *prp_id, hsize_t_f* threshold, hsize_t_f* alignment); +H5_FCDLL int_f h5pget_fapl_core_c(hid_t_f *prp_id, size_t_f* increment, int_f *flag); +H5_FCDLL int_f h5pset_fapl_core_c(hid_t_f *prp_id, size_t_f* increment, int_f *flag); +H5_FCDLL int_f h5pset_fapl_family_c(hid_t_f *prp_id, hsize_t_f* memb_size, hid_t_f* memb_plist ); +H5_FCDLL int_f h5pget_fapl_family_c(hid_t_f *prp_id, hsize_t_f* memb_size, hid_t_f* memb_plist ); +H5_FCDLL int_f h5pset_cache_c(hid_t_f *prp_id, int_f* mdc_nelmts, size_t_f* rdcc_nelmts, size_t_f* rdcc_nbytes, real_f* rdcc_w0); +H5_FCDLL int_f h5pget_cache_c(hid_t_f *prp_id, int_f* mdc_nelmts, size_t_f* rdcc_nelmts, size_t_f* rdcc_nbytes, real_f* rdcc_w0); +#ifdef NO_SUCH_F90_FUNCTION +H5_FCDLL int_f h5pget_fapl_split_c(hid_t_f *prp_id, size_t_f* meta_ext_size , _fcd meta_ext, hid_t_f* meta_plist, size_t_f* raw_ext_size, _fcd raw_ext, hid_t_f * raw_plist); +#endif +H5_FCDLL int_f h5pset_fapl_split_c(hid_t_f *prp_id, int_f* meta_len, _fcd meta_ext, hid_t_f* meta_plist, int_f* raw_len, _fcd raw_ext, hid_t_f * raw_plist); +H5_FCDLL int_f h5pset_gc_references_c(hid_t_f *prp_id, int_f* gc_references); +H5_FCDLL int_f h5pget_gc_references_c(hid_t_f *prp_id, int_f* gc_references); +H5_FCDLL int_f h5pset_layout_c(hid_t_f *prp_id, int_f* layout); +H5_FCDLL int_f h5pget_layout_c(hid_t_f *prp_id, int_f* layout); +H5_FCDLL int_f h5pset_filter_c(hid_t_f *prp_id, int_f* filter, int_f* flags, size_t_f* cd_nelmts, int_f* cd_values ); +H5_FCDLL int_f h5premove_filter_c(hid_t_f *prp_id, int_f* filter); +H5_FCDLL int_f h5pmodify_filter_c(hid_t_f *prp_id, int_f* filter, int_f* flags, size_t_f* cd_nelmts, int_f* cd_values ); +H5_FCDLL int_f h5pget_nfilters_c(hid_t_f *prp_id, int_f* nfilters); +H5_FCDLL int_f h5pget_filter_c(hid_t_f *prp_id, int_f* filter_number, int_f* flags, size_t_f* cd_nelmts, int_f* cd_values, size_t_f *namelen, _fcd name, int_f* filter_id); +H5_FCDLL int_f h5pget_filter_by_id_c(hid_t_f *prp_id, int_f* filter_id, int_f* flags, size_t_f* cd_nelmts, int_f* cd_values, size_t_f *namelen, _fcd name); +H5_FCDLL int_f h5pset_external_c(hid_t_f *prp_id, _fcd name, int_f* namelen, off_t_f* offset, hsize_t_f*bytes); +H5_FCDLL int_f h5pget_external_count_c(hid_t_f *prp_id, int_f* count); +H5_FCDLL int_f h5pget_external_c(hid_t_f *prp_id, int_f *idx, size_t_f* name_size, _fcd name, off_t_f* offset, hsize_t_f*bytes); +H5_FCDLL int_f h5pget_btree_ratios_c(hid_t_f *prp_id, real_f* left, real_f* middle, real_f* right); +H5_FCDLL int_f h5pset_btree_ratios_c(hid_t_f *prp_id, real_f* left, real_f* middle, real_f* right); +H5_FCDLL int_f h5pset_fclose_degree_c(hid_t_f *fapl, int_f *degree); +H5_FCDLL int_f h5pget_fclose_degree_c(hid_t_f *fapl, int_f *degree); +H5_FCDLL int_f h5pget_buffer_c(hid_t_f *plist, hsize_t_f *size); +H5_FCDLL int_f h5pset_buffer_c(hid_t_f *plist, hsize_t_f *size); +H5_FCDLL int_f h5pset_alloc_time_c(hid_t_f *plist, int_f *flag); +H5_FCDLL int_f h5pget_alloc_time_c(hid_t_f *plist, int_f *flag); +H5_FCDLL int_f h5pset_fill_time_c(hid_t_f *plist, int_f *flag); +H5_FCDLL int_f h5pget_fill_time_c(hid_t_f *plist, int_f *flag); +H5_FCDLL int_f h5pset_meta_block_size_c(hid_t_f *plist, hsize_t_f *size); +H5_FCDLL int_f h5pget_meta_block_size_c(hid_t_f *plist, hsize_t_f *size); +H5_FCDLL int_f h5pset_sieve_buf_size_c(hid_t_f *plist, size_t_f *size); +H5_FCDLL int_f h5pget_sieve_buf_size_c(hid_t_f *plist, size_t_f *size); +H5_FCDLL int_f h5pset_small_data_block_size_c(hid_t_f *plist, hsize_t_f *size); +H5_FCDLL int_f h5pget_small_data_block_size_c(hid_t_f *plist, hsize_t_f *size); +H5_FCDLL int_f h5pset_hyper_vector_size_c(hid_t_f *plist, size_t_f *size); +H5_FCDLL int_f h5pget_hyper_vector_size_c(hid_t_f *plist, size_t_f *size); H5_FCDLL int_f h5pcreate_class_c(hid_t_f *parent, _fcd name, int_f *name_len, hid_t_f *cls, H5P_cls_create_func_t create, void *create_data, H5P_cls_copy_func_t copy, void *copy_data, H5P_cls_close_func_t close, void *close_data); -H5_FCDLL int_f nh5pcreate_class_f90_c(hid_t_f *parent, _fcd name, int_f *name_len, hid_t_f *cls); H5_FCDLL int_f h5pregister_c(hid_t_f *cls, _fcd name, int_f * name_len, size_t_f *size, void *value); -H5_FCDLL int_f nh5pregister_integer_c(hid_t_f *cls, _fcd name, int_f * name_len, size_t_f *size, void *value); -H5_FCDLL int_f nh5pregister_real_c(hid_t_f *cls, _fcd name, int_f * name_len, size_t_f *size, void *value); -H5_FCDLL int_f nh5pregister_double_c(hid_t_f *cls, _fcd name, int_f * name_len, size_t_f *size, void *value); -H5_FCDLL int_f nh5pregisterc_c(hid_t_f *cls, _fcd name, int_f * name_len, size_t_f *size, _fcd value, int_f *value_len); H5_FCDLL int_f h5pinsert_c(hid_t_f *plist, _fcd name, int_f *name_len, size_t_f *size, void *value); -H5_FCDLL int_f nh5pinsert_integer_c(hid_t_f *plist, _fcd name, int_f *name_len, size_t_f *size, void *value); -H5_FCDLL int_f nh5pinsert_real_c(hid_t_f *plist, _fcd name, int_f *name_len, size_t_f *size, void *value); -H5_FCDLL int_f nh5pinsert_double_c(hid_t_f *plist, _fcd name, int_f *name_len, size_t_f *size, void *value); -H5_FCDLL int_f nh5pinsertc_c(hid_t_f *plist, _fcd name, int_f *name_len, size_t_f *size, _fcd value, int_f *value_len); H5_FCDLL int_f h5pset_c(hid_t_f *prp_id, _fcd name, int_f *name_len, void *value); -H5_FCDLL int_f nh5pset_integer_c(hid_t_f *prp_id, _fcd name, int_f *name_len, void *value); -H5_FCDLL int_f nh5pset_real_c(hid_t_f *prp_id, _fcd name, int_f *name_len, void *value); -H5_FCDLL int_f nh5pset_double_c(hid_t_f *prp_id, _fcd name, int_f *name_len, void *value); -H5_FCDLL int_f nh5psetc_c(hid_t_f *prp_id, _fcd name, int_f *name_len, _fcd value, int_f *value_len); H5_FCDLL int_f h5pget_c(hid_t_f *prp_id, _fcd name, int_f *name_len, void *value); -H5_FCDLL int_f nh5pget_double_c(hid_t_f *prp_id, _fcd name, int_f *name_len, void *value); -H5_FCDLL int_f nh5pget_integer_c(hid_t_f *prp_id, _fcd name, int_f *name_len, void *value); -H5_FCDLL int_f nh5pget_real_c(hid_t_f *prp_id, _fcd name, int_f *name_len, void *value); -H5_FCDLL int_f nh5pgetc_c(hid_t_f *prp_id, _fcd name, int_f *name_len, _fcd value, int_f *value_len); -H5_FCDLL int_f nh5pexist_c(hid_t_f *prp_id, _fcd name, int_f *name_len); -H5_FCDLL int_f nh5pget_size_c(hid_t_f *prp_id, _fcd name, int_f *name_len, size_t_f *size); -H5_FCDLL int_f nh5pget_nprops_c(hid_t_f *prp_id, size_t_f *nprops); -H5_FCDLL int_f nh5pget_class_parent_c(hid_t_f *prp_id, hid_t_f *parent_id); -H5_FCDLL int_f nh5pisa_class_c(hid_t_f *plist, hid_t_f *pclass); -H5_FCDLL int_f nh5pcopy_prop_c(hid_t_f *dst_id, hid_t_f *src_id, _fcd name, int_f *name_len); -H5_FCDLL int_f nh5premove_c(hid_t_f *plid, _fcd name, int_f *name_len); -H5_FCDLL int_f nh5punregister_c(hid_t_f *cls, _fcd name, int_f *name_len); -H5_FCDLL int_f nh5pclose_class_c(hid_t_f * cls); -H5_FCDLL int_f nh5pget_class_name_c(hid_t_f *prp_id, _fcd name, int_f *name_len); -H5_FCDLL int_f nh5pset_shuffle_c ( hid_t_f *prp_id); -H5_FCDLL int_f nh5pset_fletcher32_c ( hid_t_f *prp_id ); -H5_FCDLL int_f nh5pset_edc_check_c ( hid_t_f *prp_id, int_f *flag ); -H5_FCDLL int_f nh5pget_edc_check_c ( hid_t_f *prp_id, int_f *flag ); -H5_FCDLL int_f nh5pset_family_offset_c ( hid_t_f *prp_id , hsize_t_f *offset); -H5_FCDLL int_f nh5pget_fapl_multi_c ( hid_t_f *prp_id , int_f *mem_map, hid_t_f *memb_fapl, _fcd memb_name, int_f *len, int_f *lenmax, real_f *memb_addr, int_f *flag, int_f *maxlen_out); -H5_FCDLL int_f nh5pset_fapl_multi_c ( hid_t_f *prp_id , int_f *mem_map, hid_t_f *memb_fapl, _fcd memb_name, int_f *len, int_f *lenmax, real_f *memb_addr, int_f *flag); -H5_FCDLL int_f nh5pset_fapl_multi_sc ( hid_t_f *prp_id , int_f *flag); -H5_FCDLL int_f nh5pset_szip_c ( hid_t_f *prp_id , int_f *options_mask, int_f *pixels_per_block); -H5_FCDLL int_f nh5pall_filters_avail_c ( hid_t_f *prp_id , int_f *status); -H5_FCDLL int_f nh5pfill_value_defined_c ( hid_t_f *prp_id , int_f *flag); -H5_FCDLL int_f nh5pget_attr_phase_change_c (hid_t_f *ocpl_id, int_f *max_compact, int_f *min_dense ); -H5_FCDLL int_f nh5pset_attr_creation_order_c(hid_t_f *ocpl_id, int_f *crt_order_flags ); -H5_FCDLL int_f nh5pset_shared_mesg_nindexes_c(hid_t_f *plist_id, int_f *nindexes ); -H5_FCDLL int_f nh5pset_shared_mesg_index_c(hid_t_f *fcpl_id, int_f *index_num, int_f *mesg_type_flags, int_f *min_mesg_size); -H5_FCDLL int_f nh5pget_attr_creation_order_c(hid_t_f *ocpl_id, int_f *crt_order_flags); -H5_FCDLL int_f nh5pset_libver_bounds_c(hid_t_f *fapl_id, int_f *low, int_f *high); -H5_FCDLL int_f nh5pset_link_creation_order_c(hid_t_f *gcpl_id, int_f *crt_order_flags); -H5_FCDLL int_f nh5pget_link_phase_change_c(hid_t_f *gcpl_id, int_f *max_compact, int_f *min_dense ); -H5_FCDLL int_f nh5pget_obj_track_times_c(hid_t_f *plist_id, int_f *flag); -H5_FCDLL int_f nh5pset_obj_track_times_c(hid_t_f *plist_id, int_f *flag); -H5_FCDLL int_f nh5pset_create_inter_group_c(hid_t_f *lcpl_id, int_f *crt_intermed_group); -H5_FCDLL int_f nh5pget_create_inter_group_c(hid_t_f *lcpl_id, int_f *crt_intermed_group); -H5_FCDLL int_f nh5pget_link_creation_order_c(hid_t_f *gcpl_id, int_f *crt_order_flags); -H5_FCDLL int_f nh5pset_char_encoding_c(hid_t_f *plist_id, int_f *encoding); -H5_FCDLL int_f nh5pget_char_encoding_c(hid_t_f *plist_id, int_f *encoding); -H5_FCDLL int_f nh5pset_copy_object_c(hid_t_f *ocp_plist_id, int_f *copy_options); -H5_FCDLL int_f nh5pget_copy_object_c(hid_t_f *ocp_plist_id, int_f *copy_options); -H5_FCDLL int_f nh5pget_data_transform_c(hid_t_f *plist_id, _fcd expression, int_f *expression_len, size_t_f *size); -H5_FCDLL int_f nh5pset_data_transform_c(hid_t_f *plist_id, _fcd expression, int_f *expression_len); -H5_FCDLL int_f nh5pget_local_heap_size_hint_c(hid_t_f *gcpl_id, size_t_f *size_hint); -H5_FCDLL int_f nh5pget_est_link_info_c(hid_t_f *gcpl_id, int_f *est_num_entries, int_f *est_name_len); -H5_FCDLL int_f nh5pset_local_heap_size_hint_c(hid_t_f *gcpl_id, size_t_f *size_hint); -H5_FCDLL int_f nh5pset_est_link_info_c(hid_t_f *gcpl_id, int_f *est_num_entries, int_f *est_name_len); -H5_FCDLL int_f nh5pset_link_phase_change_c(hid_t_f *gcpl_id, int_f *max_compact, int_f *min_dense ); -H5_FCDLL int_f nh5pset_fapl_direct_c(hid_t_f *fapl_id, size_t_f *alignment, size_t_f *block_size, size_t_f *cbuf_size ); -H5_FCDLL int_f nh5pget_fapl_direct_c(hid_t_f *fapl_id, size_t_f *alignment, size_t_f *block_size, size_t_f *cbuf_size ); -H5_FCDLL int_f nh5pset_attr_phase_change_c (hid_t_f *ocpl_id, int_f *max_compact, int_f *min_dense ); -H5_FCDLL int_f nh5pset_nbit_c(hid_t_f *plist_id ); -H5_FCDLL int_f nh5pset_scaleoffset_c(hid_t_f *plist_id, int_f *scale_type, int_f *scale_factor ); -H5_FCDLL int_f nh5pset_nlinks_c(hid_t_f *lapl_id, size_t_f *nlinks); -H5_FCDLL int_f nh5pget_nlinks_c(hid_t_f *lapl_id, size_t_f *nlinks); -H5_FCDLL int_f nh5pset_chunk_cache_c(hid_t_f *dapl_id, size_t_f *rdcc_nslots, size_t_f *rdcc_nbytes, real_f *rdcc_w0); -H5_FCDLL int_f nh5pget_chunk_cache_c(hid_t_f *dapl_id, size_t_f *rdcc_nslots, size_t_f *rdcc_nbytes, real_f *rdcc_w0); -H5_FCDLL int_f nh5pget_mpio_actual_io_mode_c(hid_t_f *dxpl_id, int_f *actual_io_mode); +H5_FCDLL int_f h5pexist_c(hid_t_f *prp_id, _fcd name, int_f *name_len); +H5_FCDLL int_f h5pget_size_c(hid_t_f *prp_id, _fcd name, int_f *name_len, size_t_f *size); +H5_FCDLL int_f h5pget_nprops_c(hid_t_f *prp_id, size_t_f *nprops); +H5_FCDLL int_f h5pget_class_parent_c(hid_t_f *prp_id, hid_t_f *parent_id); +H5_FCDLL int_f h5pisa_class_c(hid_t_f *plist, hid_t_f *pclass); +H5_FCDLL int_f h5pcopy_prop_c(hid_t_f *dst_id, hid_t_f *src_id, _fcd name, int_f *name_len); +H5_FCDLL int_f h5premove_c(hid_t_f *plid, _fcd name, int_f *name_len); +H5_FCDLL int_f h5punregister_c(hid_t_f *cls, _fcd name, int_f *name_len); +H5_FCDLL int_f h5pclose_class_c(hid_t_f * cls); +H5_FCDLL int_f h5pget_class_name_c(hid_t_f *prp_id, _fcd name, int_f *name_len); +H5_FCDLL int_f h5pset_shuffle_c( hid_t_f *prp_id); +H5_FCDLL int_f h5pset_fletcher32_c( hid_t_f *prp_id ); +H5_FCDLL int_f h5pset_edc_check_c( hid_t_f *prp_id, int_f *flag ); +H5_FCDLL int_f h5pget_edc_check_c( hid_t_f *prp_id, int_f *flag ); +H5_FCDLL int_f h5pset_family_offset_c( hid_t_f *prp_id , hsize_t_f *offset); +H5_FCDLL int_f h5pget_fapl_multi_c( hid_t_f *prp_id , int_f *mem_map, hid_t_f *memb_fapl, _fcd memb_name, int_f *len, int_f *lenmax, real_f *memb_addr, int_f *flag, int_f *maxlen_out); +H5_FCDLL int_f h5pset_fapl_multi_c( hid_t_f *prp_id , int_f *mem_map, hid_t_f *memb_fapl, _fcd memb_name, int_f *len, int_f *lenmax, real_f *memb_addr, int_f *flag); +H5_FCDLL int_f h5pset_fapl_multi_sc ( hid_t_f *prp_id , int_f *flag); +H5_FCDLL int_f h5pset_szip_c( hid_t_f *prp_id , int_f *options_mask, int_f *pixels_per_block); +H5_FCDLL int_f h5pall_filters_avail_c( hid_t_f *prp_id , int_f *status); +H5_FCDLL int_f h5pfill_value_defined_c( hid_t_f *prp_id , int_f *flag); +H5_FCDLL int_f h5pget_attr_phase_change_c(hid_t_f *ocpl_id, int_f *max_compact, int_f *min_dense ); +H5_FCDLL int_f h5pset_attr_creation_order_c(hid_t_f *ocpl_id, int_f *crt_order_flags ); +H5_FCDLL int_f h5pset_shared_mesg_nindexes_c(hid_t_f *plist_id, int_f *nindexes ); +H5_FCDLL int_f h5pset_shared_mesg_index_c(hid_t_f *fcpl_id, int_f *index_num, int_f *mesg_type_flags, int_f *min_mesg_size); +H5_FCDLL int_f h5pget_attr_creation_order_c(hid_t_f *ocpl_id, int_f *crt_order_flags); +H5_FCDLL int_f h5pset_libver_bounds_c(hid_t_f *fapl_id, int_f *low, int_f *high); +H5_FCDLL int_f h5pset_link_creation_order_c(hid_t_f *gcpl_id, int_f *crt_order_flags); +H5_FCDLL int_f h5pget_link_phase_change_c(hid_t_f *gcpl_id, int_f *max_compact, int_f *min_dense ); +H5_FCDLL int_f h5pget_obj_track_times_c(hid_t_f *plist_id, int_f *flag); +H5_FCDLL int_f h5pset_obj_track_times_c(hid_t_f *plist_id, int_f *flag); +H5_FCDLL int_f h5pset_create_inter_group_c(hid_t_f *lcpl_id, int_f *crt_intermed_group); +H5_FCDLL int_f h5pget_create_inter_group_c(hid_t_f *lcpl_id, int_f *crt_intermed_group); +H5_FCDLL int_f h5pget_link_creation_order_c(hid_t_f *gcpl_id, int_f *crt_order_flags); +H5_FCDLL int_f h5pset_char_encoding_c(hid_t_f *plist_id, int_f *encoding); +H5_FCDLL int_f h5pget_char_encoding_c(hid_t_f *plist_id, int_f *encoding); +H5_FCDLL int_f h5pset_copy_object_c(hid_t_f *ocp_plist_id, int_f *copy_options); +H5_FCDLL int_f h5pget_copy_object_c(hid_t_f *ocp_plist_id, int_f *copy_options); +H5_FCDLL int_f h5pget_data_transform_c(hid_t_f *plist_id, _fcd expression, int_f *expression_len, size_t_f *size); +H5_FCDLL int_f h5pset_data_transform_c(hid_t_f *plist_id, _fcd expression, int_f *expression_len); +H5_FCDLL int_f h5pget_local_heap_size_hint_c(hid_t_f *gcpl_id, size_t_f *size_hint); +H5_FCDLL int_f h5pget_est_link_info_c(hid_t_f *gcpl_id, int_f *est_num_entries, int_f *est_name_len); +H5_FCDLL int_f h5pset_local_heap_size_hint_c(hid_t_f *gcpl_id, size_t_f *size_hint); +H5_FCDLL int_f h5pset_est_link_info_c(hid_t_f *gcpl_id, int_f *est_num_entries, int_f *est_name_len); +H5_FCDLL int_f h5pset_link_phase_change_c(hid_t_f *gcpl_id, int_f *max_compact, int_f *min_dense ); +H5_FCDLL int_f h5pset_fapl_direct_c(hid_t_f *fapl_id, size_t_f *alignment, size_t_f *block_size, size_t_f *cbuf_size ); +H5_FCDLL int_f h5pget_fapl_direct_c(hid_t_f *fapl_id, size_t_f *alignment, size_t_f *block_size, size_t_f *cbuf_size ); +H5_FCDLL int_f h5pset_attr_phase_change_c(hid_t_f *ocpl_id, int_f *max_compact, int_f *min_dense ); +H5_FCDLL int_f h5pset_nbit_c(hid_t_f *plist_id ); +H5_FCDLL int_f h5pset_scaleoffset_c(hid_t_f *plist_id, int_f *scale_type, int_f *scale_factor ); +H5_FCDLL int_f h5pset_nlinks_c(hid_t_f *lapl_id, size_t_f *nlinks); +H5_FCDLL int_f h5pget_nlinks_c(hid_t_f *lapl_id, size_t_f *nlinks); +H5_FCDLL int_f h5pset_chunk_cache_c(hid_t_f *dapl_id, size_t_f *rdcc_nslots, size_t_f *rdcc_nbytes, real_f *rdcc_w0); +H5_FCDLL int_f h5pget_chunk_cache_c(hid_t_f *dapl_id, size_t_f *rdcc_nslots, size_t_f *rdcc_nbytes, real_f *rdcc_w0); +#ifdef H5_HAVE_PARALLEL +H5_FCDLL int_f h5pget_mpio_actual_io_mode_c(hid_t_f *dxpl_id, int_f *actual_io_mode); +H5_FCDLL int_f h5pget_fapl_mpio_c(hid_t_f *prp_id, int_f* comm, int_f* info); +H5_FCDLL int_f h5pset_fapl_mpio_c(hid_t_f *prp_id, int_f* comm, int_f* info); +H5_FCDLL int_f h5pget_dxpl_mpio_c(hid_t_f *prp_id, int_f* data_xfer_mode); +H5_FCDLL int_f h5pset_dxpl_mpio_c(hid_t_f *prp_id, int_f* data_xfer_mode); +#endif /* * Functions frome H5Rf.c */ -#define nh5rcreate_object_c H5_FC_FUNC_(h5rcreate_object_c, H5RCREATE_OBJECT_C) -#define nh5rcreate_region_c H5_FC_FUNC_(h5rcreate_region_c, H5RCREATE_REGION_C) -#define nh5rdereference_region_c H5_FC_FUNC_(h5rdereference_region_c, H5RDEREFERENCE_REGION_C) -#define nh5rdereference_object_c H5_FC_FUNC_(h5rdereference_object_c, H5RDEREFERENCE_OBJECT_C) -#define nh5rget_region_region_c H5_FC_FUNC_(h5rget_region_region_c, H5RGET_REGION_REGION_C) -#define nh5rget_object_type_obj_c H5_FC_FUNC_(h5rget_object_type_obj_c, H5RGET_OBJECT_TYPE_OBJ_C) -#define nh5rget_name_object_c H5_FC_FUNC_(h5rget_name_object_c, H5RGET_NAME_OBJECT_C) -#define nh5rget_name_region_c H5_FC_FUNC_(h5rget_name_region_c, H5RGET_NAME_REGION_C) - - -H5_FCDLL int_f nh5rcreate_object_c (haddr_t_f *ref, hid_t_f *loc_id, _fcd name, int_f *namelen); -H5_FCDLL int_f nh5rcreate_region_c (int_f *ref, hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *space_id); -H5_FCDLL int_f h5rcreate_ptr_c (void *ref, hid_t_f *loc_id, _fcd name, int_f *namelen, int_f *ref_type, hid_t_f *space_id); -H5_FCDLL int_f nh5rdereference_region_c (hid_t_f *dset_id, int_f *ref, hid_t_f *obj_id); -H5_FCDLL int_f nh5rdereference_object_c (hid_t_f *dset_id, haddr_t_f *ref, hid_t_f *obj_id); -H5_FCDLL int_f h5rdereference_ptr_c (hid_t_f *obj_id, int_f *ref_type, void *ref, hid_t_f *ref_obj_id); -H5_FCDLL int_f nh5rget_region_region_c (hid_t_f *dset_id, int_f *ref, hid_t_f *space_id); +H5_FCDLL int_f h5rcreate_region_c(int_f *ref, hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *space_id); +H5_FCDLL int_f h5rcreate_ptr_c(void *ref, hid_t_f *loc_id, _fcd name, int_f *namelen, int_f *ref_type, hid_t_f *space_id); +H5_FCDLL int_f h5rdereference_ptr_c(hid_t_f *obj_id, int_f *ref_type, void *ref, hid_t_f *ref_obj_id); +H5_FCDLL int_f h5rget_region_region_c(hid_t_f *dset_id, int_f *ref, hid_t_f *space_id); H5_FCDLL int_f h5rget_region_ptr_c(hid_t_f *dset_id, void *ref, hid_t_f *space_id); -H5_FCDLL int_f nh5rget_object_type_obj_c (hid_t_f *dset_id, haddr_t_f *ref, int_f *obj_type); -H5_FCDLL int_f nh5rget_name_object_c (hid_t_f *loc_id, haddr_t_f *ref, _fcd name, size_t_f *name_len, size_t_f *size_default); -H5_FCDLL int_f nh5rget_name_region_c (hid_t_f *loc_id, int_f *ref, _fcd name, size_t_f *name_len, size_t_f *size_default); -H5_FCDLL int_f h5rget_name_ptr_c (hid_t_f *loc_id, int_f *ref_type, void *ref, _fcd name, size_t_f *name_len, size_t_f *size_default); -H5_FCDLL int_f h5rget_obj_type_c (hid_t_f *loc_id, int_f *ref_type, void *ref, int_f *obj_type); +H5_FCDLL int_f h5rget_object_type_obj_c(hid_t_f *dset_id, haddr_t_f *ref, int_f *obj_type); +H5_FCDLL int_f h5rget_name_ptr_c(hid_t_f *loc_id, int_f *ref_type, void *ref, _fcd name, size_t_f *name_len, size_t_f *size_default); +H5_FCDLL int_f h5rget_obj_type_c(hid_t_f *loc_id, int_f *ref_type, void *ref, int_f *obj_type); /* * Functions from H5If.c */ -#define nh5iget_type_c H5_FC_FUNC_(h5iget_type_c, H5IGET_TYPE_C) -#define nh5iget_name_c H5_FC_FUNC_(h5iget_name_c, H5IGET_NAME_C) -#define nh5iinc_ref_c H5_FC_FUNC_(h5iinc_ref_c, H5IINC_REF_C) -#define nh5idec_ref_c H5_FC_FUNC_(h5idec_ref_c, H5IDEC_REF_C) -#define nh5iget_ref_c H5_FC_FUNC_(h5iget_ref_c, H5IGET_REF_C) -#define nh5iget_file_id_c H5_FC_FUNC_(h5iget_file_id_c, H5IGET_FILE_ID_C) -#define nh5iis_valid_c H5_FC_FUNC_(h5iis_valid_c, H5IIS_VALID_C) - -H5_FCDLL int_f nh5iget_type_c(hid_t_f *obj_id, int_f *type); -H5_FCDLL int_f nh5iget_name_c(hid_t_f *obj_id, _fcd buf, size_t_f *buf_size, size_t_f *name_size); -H5_FCDLL int_f nh5iinc_ref_c(hid_t_f *obj_id, int_f *ref_count); -H5_FCDLL int_f nh5idec_ref_c(hid_t_f *obj_id, int_f *ref_count); -H5_FCDLL int_f nh5iget_ref_c(hid_t_f *obj_id, int_f *ref_count); -H5_FCDLL int_f nh5iget_file_id_c(hid_t_f *obj_id, hid_t_f *file_id); -H5_FCDLL int_f nh5iis_valid_c(hid_t_f *obj_id, int_f *c_valid); +H5_FCDLL int_f h5iget_type_c(hid_t_f *obj_id, int_f *type); +H5_FCDLL int_f h5iget_name_c(hid_t_f *obj_id, _fcd buf, size_t_f *buf_size, size_t_f *name_size); +H5_FCDLL int_f h5iinc_ref_c(hid_t_f *obj_id, int_f *ref_count); +H5_FCDLL int_f h5idec_ref_c(hid_t_f *obj_id, int_f *ref_count); +H5_FCDLL int_f h5iget_ref_c(hid_t_f *obj_id, int_f *ref_count); +H5_FCDLL int_f h5iget_file_id_c(hid_t_f *obj_id, hid_t_f *file_id); +H5_FCDLL int_f h5iis_valid_c(hid_t_f *obj_id, int_f *c_valid); /* * Functions from H5Ef.c */ -#define nh5eclear_c H5_FC_FUNC_(h5eclear_c, H5ECLEAR_C) -#define nh5eprint_c1 H5_FC_FUNC_(h5eprint_c1, H5EPRINT_C1) -#define nh5eprint_c2 H5_FC_FUNC_(h5eprint_c2, H5EPRINT_C2) -#define nh5eget_major_c H5_FC_FUNC_(h5eget_major_c, H5EGET_MAJOR_C) -#define nh5eget_minor_c H5_FC_FUNC_(h5eget_minor_c, H5EGET_MINOR_C) -#define nh5eset_auto_c H5_FC_FUNC_(h5eset_auto_c, H5ESET_AUTO_C) -#define nprocess_buffer H5_FC_FUNC_(process_buffer, PROCESS_BUFFER) - -H5_FCDLL int_f nh5eclear_c(hid_t_f *estack_id); -H5_FCDLL int_f nh5eprint_c1(_fcd name, int_f* namelen); -H5_FCDLL int_f nh5eprint_c2(void); -H5_FCDLL int_f nh5eget_major_c(int_f* error_no, _fcd name, size_t_f* namelen); -H5_FCDLL int_f nh5eget_minor_c(int_f* error_no, _fcd name, size_t_f* namelen); -H5_FCDLL int_f nh5eset_auto_c(int_f* printflag); +H5_FCDLL int_f h5eclear_c(hid_t_f *estack_id); +H5_FCDLL int_f h5eprint_c1(_fcd name, int_f* namelen); +H5_FCDLL int_f h5eprint_c2(void); +H5_FCDLL int_f h5eget_major_c(int_f* error_no, _fcd name, size_t_f* namelen); +H5_FCDLL int_f h5eget_minor_c(int_f* error_no, _fcd name, size_t_f* namelen); H5_FCDLL int_f h5eset_auto2_c(int_f* printflag, hid_t_f *estack_id, H5E_auto2_t func, void *client_data); -H5_FCDLL int_f nprocess_buffer(hid_t_f *estack_id,void **buffer); /* * Functions from H5f.c */ -#define nh5open_c H5_FC_FUNC_(h5open_c, H5OPEN_C) -#define nh5close_c H5_FC_FUNC_(h5close_c, H5CLOSE_C) -#define nh5init_types_c H5_FC_FUNC_(h5init_types_c, H5INIT_TYPES_C) -#define nh5close_types_c H5_FC_FUNC_(h5close_types_c, H5CLOSE_TYPES_C) -#define nh5init_flags_c H5_FC_FUNC_(h5init_flags_c, H5INIT_FLAGS_C) -#define nh5init1_flags_c H5_FC_FUNC_(h5init1_flags_c, H5INIT1_FLAGS_C) -#define nh5get_libversion_c H5_FC_FUNC_(h5get_libversion_c, H5GET_LIBVERSION_C) -#define nh5check_version_c H5_FC_FUNC_(h5check_version_c, H5CHECK_VERSION_C) -#define nh5garbage_collect_c H5_FC_FUNC_(h5garbage_collect_c, H5GARBAGE_COLLECT_C) -#define nh5dont_atexit_c H5_FC_FUNC_(h5dont_atexit_c, H5DONT_ATEXIT_C) - - -H5_FCDLL int_f nh5open_c(void); -H5_FCDLL int_f nh5close_c(void); -H5_FCDLL int_f nh5init_types_c(hid_t_f *types, hid_t_f *floatingtypes, hid_t_f *integertypes); -H5_FCDLL int_f nh5close_types_c(hid_t_f *types, int_f *lentypes, hid_t_f *floatingtypes, int_f *floatinglen, hid_t_f *integertypes, int_f *integerlen); -H5_FCDLL int_f nh5init_flags_c(int_f *h5d_flags, size_t_f *h5d_size_flags, int_f *h5e_flags, hid_t_f *h5e_hid_flags, int_f *h5f_flags, +H5_FCDLL int_f h5open_c(void); +H5_FCDLL int_f h5close_c(void); +H5_FCDLL int_f h5init_types_c(hid_t_f *types, hid_t_f *floatingtypes, hid_t_f *integertypes); +H5_FCDLL int_f h5close_types_c(hid_t_f *types, int_f *lentypes, hid_t_f *floatingtypes, int_f *floatinglen, hid_t_f *integertypes, int_f *integerlen); +H5_FCDLL int_f h5init_flags_c(int_f *h5d_flags, size_t_f *h5d_size_flags, int_f *h5e_flags, hid_t_f *h5e_hid_flags, int_f *h5f_flags, int_f *h5fd_flags, hid_t_f *h5fd_hid_flags, int_f *h5g_flags, int_f *h5i_flags, int_f *h5l_flags, int_f *h5o_flags, hid_t_f *h5p_flags, int_f *h5p_flags_int, int_f *h5r_flags, int_f *h5s_flags, hsize_t_f *h5s_hsize_flags, int_f *h5t_flags, int_f *h5z_flags, int_f *h5_generic_flags); -H5_FCDLL int_f nh5init1_flags_c(int_f *h5lib_flags); -H5_FCDLL int_f nh5get_libversion_c(int_f *majnum, int_f *minnum, int_f *relnum); -H5_FCDLL int_f nh5check_version_c(int_f *majnum, int_f *minnum, int_f *relnum); -H5_FCDLL int_f nh5garbage_collect_c(void); -H5_FCDLL int_f nh5dont_atexit_c(void); +H5_FCDLL int_f h5init1_flags_c(int_f *h5lib_flags); +H5_FCDLL int_f h5get_libversion_c(int_f *majnum, int_f *minnum, int_f *relnum); +H5_FCDLL int_f h5check_version_c(int_f *majnum, int_f *minnum, int_f *relnum); +H5_FCDLL int_f h5garbage_collect_c(void); +H5_FCDLL int_f h5dont_atexit_c(void); /* * Functions from H5Zf.c */ -#define nh5zunregister_c H5_FC_FUNC_(h5zunregister_c, H5ZUNREGISTER_C) -#define nh5zfilter_avail_c H5_FC_FUNC_(h5zfilter_avail_c, H5ZFILTER_AVAIL_C) -#define nh5zget_filter_info_c H5_FC_FUNC_(h5zget_filter_info_c, H5ZGET_FILTER_INFO_C) - - -H5_FCDLL int_f nh5zunregister_c (int_f *filter); -H5_FCDLL int_f nh5zfilter_avail_c (int_f *filter, int_f *flag); -H5_FCDLL int_f nh5zget_filter_info_c (int_f *filter, int_f *flag); - +H5_FCDLL int_f h5zunregister_c(int_f *filter); +H5_FCDLL int_f h5zfilter_avail_c(int_f *filter, int_f *flag); +H5_FCDLL int_f h5zget_filter_info_c(int_f *filter, int_f *flag); /* * Functions from H5Lf.c */ -#define nh5lcopy_c H5_FC_FUNC_(h5lcopy_c, H5LCOPY_C) -#define nh5lcreate_external_c H5_FC_FUNC_(h5lcreate_external_c, H5LCREATE_EXTERNAL_C) -#define nh5lcreate_hard_c H5_FC_FUNC_(h5lcreate_hard_c, H5LCREATE_HARD_C) -#define nh5lcreate_soft_c H5_FC_FUNC_(h5lcreate_soft_c, H5LCREATE_SOFT_C) -#define nh5ldelete_c H5_FC_FUNC_(h5ldelete_c, H5LDELETE_C) -#define nh5ldelete_by_idx_c H5_FC_FUNC_(h5ldelete_by_idx_c, H5LDELETE_BY_IDX_C) -#define nh5lexists_c H5_FC_FUNC_(h5lexists_c, H5LEXISTS_C) -#define nh5lget_info_c H5_FC_FUNC_(h5lget_info_c, H5LGET_INFO_C) -#define nh5lget_info_by_idx_c H5_FC_FUNC_(h5lget_info_by_idx_c, H5LGET_INFO_BY_IDX_C) -#define nh5lis_registered_c H5_FC_FUNC_(h5lis_registered_c, H5LIS_REGISTERED_C) -#define nh5lmove_c H5_FC_FUNC_(h5lmove_c, H5LMOVE_C) -#define nh5lget_name_by_idx_c H5_FC_FUNC_(h5lget_name_by_idx_c, H5LGET_NAME_BY_IDX_C) -#define nh5lget_val_c H5_FC_FUNC_(h5lget_val_c, H5LGET_VAL_C) -H5_FCDLL int_f nh5lcopy_c(hid_t_f *src_loc_id, _fcd src_name, size_t_f *src_namelen, hid_t_f *dest_loc_id, +H5_FCDLL int_f h5lcopy_c(hid_t_f *src_loc_id, _fcd src_name, size_t_f *src_namelen, hid_t_f *dest_loc_id, _fcd dest_name, size_t_f *dest_namelen, hid_t_f *lcpl_id, hid_t_f *lapl_id); -H5_FCDLL int_f nh5lcreate_external_c(_fcd file_name, size_t_f *file_namelen, _fcd obj_name, size_t_f *obj_namelen, +H5_FCDLL int_f h5lcreate_external_c(_fcd file_name, size_t_f *file_namelen, _fcd obj_name, size_t_f *obj_namelen, hid_t_f *link_loc_id, _fcd link_name, size_t_f *link_namelen, hid_t_f *lcpl_id, hid_t_f *lapl_id); -H5_FCDLL int_f nh5lcreate_hard_c(hid_t_f *obj_loc_id, _fcd obj_name, size_t_f *obj_namelen, +H5_FCDLL int_f h5lcreate_hard_c(hid_t_f *obj_loc_id, _fcd obj_name, size_t_f *obj_namelen, hid_t_f *link_loc_id, _fcd link_name, size_t_f *link_namelen, hid_t_f *lcpl_id, hid_t_f *lapl_id ); -H5_FCDLL int_f nh5lcreate_soft_c(_fcd target_path, size_t_f *target_path_len, +H5_FCDLL int_f h5lcreate_soft_c(_fcd target_path, size_t_f *target_path_len, hid_t_f *link_loc_id, _fcd link_name, size_t_f *link_name_len, hid_t_f *lcpl_id, hid_t_f *lapl_id ); -H5_FCDLL int_f nh5ldelete_c( hid_t_f *loc_id, _fcd name, size_t_f *namelen, hid_t_f *lapl_id ); -H5_FCDLL int_f nh5ldelete_by_idx_c (hid_t_f *loc_id, _fcd group_name, size_t_f *group_namelen, +H5_FCDLL int_f h5ldelete_c( hid_t_f *loc_id, _fcd name, size_t_f *namelen, hid_t_f *lapl_id ); +H5_FCDLL int_f h5ldelete_by_idx_c(hid_t_f *loc_id, _fcd group_name, size_t_f *group_namelen, int_f *index_field, int_f *order, hsize_t_f *n, hid_t_f *lapl_id); -H5_FCDLL int_f nh5lexists_c (hid_t_f *loc_id, _fcd name, size_t_f *namelen, hid_t_f *lapl_id, int_f *link_exists); -H5_FCDLL int_f nh5lget_info_c (hid_t_f *link_loc_id, _fcd link_name, size_t_f *link_namelen, +H5_FCDLL int_f h5lexists_c(hid_t_f *loc_id, _fcd name, size_t_f *namelen, hid_t_f *lapl_id, int_f *link_exists); +H5_FCDLL int_f h5lget_info_c(hid_t_f *link_loc_id, _fcd link_name, size_t_f *link_namelen, int_f *cset, int_f *corder, int_f *corder_valid, int_f *link_type, haddr_t_f *address, size_t_f *val_size, hid_t_f *lapl_id); -H5_FCDLL int_f nh5lget_info_by_idx_c(hid_t_f *loc_id, _fcd group_name, size_t_f *group_namelen, +H5_FCDLL int_f h5lget_info_by_idx_c(hid_t_f *loc_id, _fcd group_name, size_t_f *group_namelen, int_f *index_field, int_f *order, hsize_t_f *n, int_f *link_type, int_f *corder_valid, int_f *corder, int_f *cset, haddr_t_f *address, size_t_f *val_size, hid_t_f *lapl_id); -H5_FCDLL int_f nh5lis_registered_c(int_f *link_cls_id); -H5_FCDLL int_f nh5lmove_c(hid_t_f *src_loc_id, _fcd src_name, size_t_f *src_namelen, hid_t_f *dest_loc_id, +H5_FCDLL int_f h5lis_registered_c(int_f *link_cls_id); +H5_FCDLL int_f h5lmove_c(hid_t_f *src_loc_id, _fcd src_name, size_t_f *src_namelen, hid_t_f *dest_loc_id, _fcd dest_name, size_t_f *dest_namelen, hid_t_f *lcpl_id, hid_t_f *lapl_id); -H5_FCDLL int_f nh5lget_name_by_idx_c(hid_t_f *loc_id, _fcd group_name, size_t_f *group_namelen, +H5_FCDLL int_f h5lget_name_by_idx_c(hid_t_f *loc_id, _fcd group_name, size_t_f *group_namelen, int_f *index_field, int_f *order, hsize_t_f *n, size_t_f *size, _fcd name, hid_t_f *lapl_id); -H5_FCDLL int_f nh5lget_val_c(hid_t_f *link_loc_id, _fcd link_name, size_t_f *link_namelen, size_t_f *size, +H5_FCDLL int_f h5lget_val_c(hid_t_f *link_loc_id, _fcd link_name, size_t_f *link_namelen, size_t_f *size, void *linkval_buff, hid_t_f *lapl_id) ; H5_FCDLL int_f h5literate_c(hid_t_f *group_id, int_f *index_type, int_f *order, hsize_t_f *idx, H5L_iterate_t op, void *op_data ); diff --git a/fortran/src/H5fort_type_defines.h.in b/fortran/src/H5fort_type_defines.h.in new file mode 100644 index 0000000..0e14e86 --- /dev/null +++ b/fortran/src/H5fort_type_defines.h.in @@ -0,0 +1,16 @@ +/* If you are reading this file and it has a '.h' suffix, it was automatically + * generated from the '.in' version. Make changes there. + */ +#define H5_FORTRAN_NATIVE_INTEGER_KIND @PAC_FORTRAN_NATIVE_INTEGER_KIND@ +#define H5_FORTRAN_NATIVE_INTEGER_SIZEOF @PAC_FORTRAN_NATIVE_INTEGER_SIZEOF@ +#define H5_FORTRAN_NATIVE_REAL_KIND @PAC_FORTRAN_NATIVE_REAL_KIND@ +#define H5_FORTRAN_NATIVE_REAL_SIZEOF @PAC_FORTRAN_NATIVE_REAL_SIZEOF@ +#define H5_FORTRAN_NATIVE_DOUBLE_KIND @PAC_FORTRAN_NATIVE_DOUBLE_KIND@ +#define H5_FORTRAN_NATIVE_DOUBLE_SIZEOF @PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF@ +#define H5_FORTRAN_INTEGER_KINDS @PAC_FC_ALL_INTEGER_KINDS@ +#define H5_FORTRAN_INTEGER_KINDS_SIZEOF @PAC_FC_ALL_INTEGER_KINDS_SIZEOF@ +#define H5_FORTRAN_REAL_KINDS @PAC_FC_ALL_REAL_KINDS@ +#define H5_FORTRAN_REAL_KINDS_SIZEOF @PAC_FC_ALL_REAL_KINDS_SIZEOF@ +#define H5_HAVE_Fortran_INTEGER_SIZEOF_16 @HAVE_Fortran_INTEGER_SIZEOF_16@ +#define H5_FORTRAN_HAVE_C_LONG_DOUBLE @FORTRAN_HAVE_C_LONG_DOUBLE@ +#define H5_FORTRAN_C_LONG_DOUBLE_IS_UNIQUE @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ diff --git a/fortran/src/H5match_types.c b/fortran/src/H5match_types.c index c4b7f73..37509a0 100644 --- a/fortran/src/H5match_types.c +++ b/fortran/src/H5match_types.c @@ -9,7 +9,7 @@ * PURPOSE * C Program to match C types to Fortran types. * Creates the files H5f90i_gen.h for the C code and - * H5fortran_types.f90 for the Fortran code. + * H5fortran_types.F90 for the Fortran code. * * COPYRIGHT * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * @@ -31,6 +31,7 @@ */ #include +#include #include #include "H5public.h" @@ -45,12 +46,13 @@ FILE * c_header; FILE * fort_header; #define CFILE "H5f90i_gen.h" -#define FFILE "H5fortran_types.f90" +#define FFILE "H5fortran_types.F90" /* Prototypes for the write routines */ -void writeTypedef(const char* c_typedef, const char* c_type, unsigned int size); -void writeTypedefDefault(const char* c_typedef, unsigned int size); -void writeToFiles(const char* c_typedef, const char* fortran_type, const char* c_type, int size, unsigned int kind); +void writeTypedef(const char* c_typedef, const char* c_type, int size); +void writeTypedefDefault(const char* c_typedef, int size); +void writeToFiles(const char* c_typedef, const char* fortran_type, const char* c_type, int size, int kind); +void writeToFilesChr(const char* c_typedef, const char* fortran_type, const char* c_type, int size, char* kind); static void initCfile(void) @@ -100,6 +102,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\ !\n\ ! HDF5 integers\n\ !\n"); @@ -119,253 +122,198 @@ endFfile(void) } /* Define a c_int_x type in the C header */ -void writeTypedef(const char* c_typedef, const char* c_type, unsigned int size) +void writeTypedef(const char* c_typedef, const char* c_type, int size) { fprintf(c_header, "#define c_%s_%u %s\n", c_typedef, size, c_type); } /* Call this function if there is no matching C type for sizes > 1 */ -void writeTypedefDefault(const char* c_typedef, unsigned int size) +void writeTypedefDefault(const char* c_typedef, int size) { assert(size %2 == 0); - fprintf(c_header, "typedef struct {c_%s_%u a; c_%s_%u b;} c_%s_%u\n", c_typedef, size / 2, c_typedef, size / 2, c_typedef, size); + fprintf(c_header, "typedef struct {c_%s_%u a; c_%s_%u b;} c_%s_%u;\n", c_typedef, size / 2, c_typedef, size / 2, c_typedef, size); } /* Create matching Fortran and C types by writing to both files */ -void writeToFiles(const char* c_typedef, const char* fortran_type, const char* c_type, int size, unsigned int kind) +void writeToFiles(const char* c_typedef, const char* fortran_type, const char* c_type, int size, int kind) { fprintf(fort_header, " INTEGER, PARAMETER :: %s = %u\n", fortran_type, kind); fprintf(c_header, "typedef c_%s_%d %s;\n", c_typedef, size, c_type); } - +void writeToFilesChr(const char* c_typedef, const char* fortran_type, const char* c_type, int size, char* kind) +{ + fprintf(fort_header, " INTEGER, PARAMETER :: %s = %s\n", fortran_type, kind); + fprintf(c_header, "typedef c_%s_%d %s;\n", c_typedef, size, c_type); +} int main(void) { - int FoundIntSize[4]; - unsigned FoundIntSizeKind[4]; - int FoundRealSize[3]; - unsigned FoundRealSizeKind[3]; - int i,j,flag; - char chrA[20],chrB[20]; - int H5_C_HAS_REAL_NATIVE_16; + int FoundIntSize[10]; + int FoundIntSizeKind[10]; + int FoundRealSize[10]; + int FoundRealSizeKind[10]; + int i, j,flag; + char chrA[32],chrB[32]; + + int IntKinds[] = H5_FORTRAN_INTEGER_KINDS; + int IntKinds_SizeOf[] = H5_FORTRAN_INTEGER_KINDS_SIZEOF; + int RealKinds[] = H5_FORTRAN_REAL_KINDS; + int RealKinds_SizeOf[] = H5_FORTRAN_REAL_KINDS_SIZEOF; + char Real_C_TYPES[10][32]; + + int H5_FORTRAN_NUM_INTEGER_KINDS; + int H5_FORTRAN_NUM_REAL_KINDS; + int found_long_double = 0; /* Open target files */ c_header = fopen(CFILE, "w"); fort_header = fopen(FFILE, "w"); - /* Default is C has 16 byte float */ - H5_C_HAS_REAL_NATIVE_16 = 1; - /* Write copyright, boilerplate to both files */ initCfile(); initFfile(); - /* First, define c_int_x */ - -#if defined H5_FORTRAN_HAS_INTEGER_1_KIND - if(sizeof(long long) == 1) - writeTypedef("int", "long long", 1); - else if(sizeof(long) == 1) - writeTypedef("int", "long", 1); - else if(sizeof(int) == 1) - writeTypedef("int", "int", 1); - else if(sizeof(short) == 1) - writeTypedef("int", "short", 1); - else - writeTypedef("int", "char", 1); - /* Actually, char is not necessarily one byte. - * But if char isn't, then nothing is, so this - * is as close as we can get. */ - if(sizeof(size_t) == 1) - writeTypedef("size_t", "size_t", 1); - if(sizeof(hsize_t) == 1) - writeTypedef("hsize_t", "hsize_t", 1); -#endif /*H5_FORTRAN_HAS_INTEGER_1_KIND*/ - -#if defined H5_FORTRAN_HAS_INTEGER_2_KIND - if(sizeof(long long) == 2) - writeTypedef("int", "long long", 2); - else if(sizeof(long) == 2) - writeTypedef("int", "long", 2); - else if(sizeof(int) == 2) - writeTypedef("int", "int", 2); - else if(sizeof(short) == 2) - writeTypedef("int", "short", 2); - else - writeTypedefDefault("int",2); - - if(sizeof(size_t) == 2) - writeTypedef("size_t", "size_t", 2); - if(sizeof(hsize_t) == 2) - writeTypedef("hsize_t", "hsize_t", 2); -#endif /*H5_FORTRAN_HAS_INTEGER_2_KIND*/ - -#if defined H5_FORTRAN_HAS_INTEGER_4_KIND - if(sizeof(long long) == 4) - writeTypedef("int", "long long", 4); - else if(sizeof(long) == 4) - writeTypedef("int", "long", 4); - else if(sizeof(int) == 4) - writeTypedef("int", "int", 4); - else if(sizeof(short) == 4) - writeTypedef("int", "short", 4); - else - writeTypedefDefault("int",4); - - if(sizeof(size_t) == 4) - writeTypedef("size_t", "size_t", 4); - if(sizeof(hsize_t) == 4) - writeTypedef("hsize_t", "hsize_t", 4); - -#endif /*H5_FORTRAN_HAS_INTEGER_4_KIND*/ - -#if defined H5_FORTRAN_HAS_INTEGER_8_KIND - if(sizeof(long long) == 8) - writeTypedef("int", "long long", 8); - else if(sizeof(long) == 8) - writeTypedef("int", "long", 8); - else if(sizeof(int) == 8) - writeTypedef("int", "int", 8); - else if(sizeof(short) == 8) - writeTypedef("int", "short", 8); - else - writeTypedefDefault("int",8); - - if(sizeof(size_t) == 8) - writeTypedef("size_t", "size_t", 8); - if(sizeof(hsize_t) == 8) - writeTypedef("hsize_t", "hsize_t", 8); - -#endif /*H5_FORTRAN_HAS_INTEGER_8_KIND*/ - - /* Define c_float_x */ - -#if defined H5_FORTRAN_HAS_REAL_NATIVE_4_KIND || defined H5_FORTRAN_HAS_REAL_4_KIND - if(sizeof(long double) == 4) - writeTypedef("float", "long double", 4); - else if(sizeof(double) == 4) - writeTypedef("float", "double", 4); - else if(sizeof(float) == 4) - writeTypedef("float", "float", 4); - else - { printf("Fortran REAL is 4 bytes, no corresponding C floating type\n"); - printf("Quitting....\n"); - return -1; - } -#endif /*H5_FORTRAN_HAS_REAL_NATIVE_4_KIND*/ - -#if defined H5_FORTRAN_HAS_REAL_NATIVE_8_KIND || defined H5_FORTRAN_HAS_REAL_8_KIND - if(sizeof(long double) == 8) - writeTypedef("float", "long double", 8); - else if(sizeof(double) == 8) - writeTypedef("float", "double", 8); - else if(sizeof(float) == 8) - writeTypedef("float", "float", 8); - else - { printf("Fortran REAL is 16 bytes, no corresponding C floating type\n"); - printf("Quitting....\n"); - return -1; - } -#endif /*H5_FORTRAN_HAS_REAL_NATIVE_8_KIND*/ - -#if defined H5_FORTRAN_HAS_REAL_NATIVE_16_KIND || defined H5_FORTRAN_HAS_REAL_16_KIND - if(sizeof(long double) == 16) - writeTypedef("float", "long double", 16); - else if(sizeof(double) == 16) - writeTypedef("float", "double", 16); - else if(sizeof(float) == 16) - writeTypedef("float", "float", 16); - else /*C has no 16 byte float so disable it in Fortran*/ - { printf("warning: Fortran REAL is 16 bytes, no corresponding C floating type\n"); - printf(" Disabling Fortran 16 byte REALs\n"); - H5_C_HAS_REAL_NATIVE_16 = 0; - } -#endif /*H5_FORTRAN_HAS_REAL_NATIVE_16_KIND*/ + /* (a) define c_int_x */ + + H5_FORTRAN_NUM_INTEGER_KINDS = (int)(sizeof(IntKinds)/sizeof(IntKinds[0])); + H5_FORTRAN_NUM_REAL_KINDS = (int)(sizeof(RealKinds)/sizeof(RealKinds[0])); + + for(i=0;i< H5_FORTRAN_NUM_INTEGER_KINDS;i++) { + if(sizeof(long long) == IntKinds_SizeOf[i]) + writeTypedef("int", "long long", IntKinds[i]); + else if(sizeof(long) == IntKinds[i]) + writeTypedef("int", "long", IntKinds[i]); + else if(sizeof(int) == IntKinds_SizeOf[i]) + writeTypedef("int", "int", IntKinds[i]); + else if(sizeof(short) == IntKinds_SizeOf[i]) + writeTypedef("int", "short", IntKinds[i]); + else + if(IntKinds_SizeOf[i] == 1) { + writeTypedef("int", "char", IntKinds[i]); + /* Actually, char is not necessarily one byte. + * But if char isn't, then nothing is, so this + * is as close as we can get. */ + } else { + writeTypedefDefault("int",IntKinds[i]); + } + if(sizeof(size_t) == IntKinds_SizeOf[i]) + writeTypedef("size_t", "size_t", IntKinds[i]); + if(sizeof(hsize_t) == IntKinds_SizeOf[i]) + writeTypedef("hsize_t", "hsize_t", IntKinds[i]); + } + + /* (b) Define c_float_x */ + + for(i=0;i< H5_FORTRAN_NUM_REAL_KINDS;i++) { + if (sizeof(float) == RealKinds_SizeOf[i]) { + writeTypedef("float", "float", RealKinds[i]); + strcpy(Real_C_TYPES[i], "C_FLOAT"); + } + else if(sizeof(double) == RealKinds_SizeOf[i]) { + writeTypedef("float", "double", RealKinds[i]); + strcpy(Real_C_TYPES[i], "C_DOUBLE"); + } +#if H5_FORTRAN_HAVE_C_LONG_DOUBLE!=0 + else if(sizeof(long double) == RealKinds_SizeOf[i] && found_long_double == 0) { + writeTypedef("float", "long double", RealKinds[i]); + strcpy(Real_C_TYPES[i], "C_LONG_DOUBLE"); + found_long_double = 1; + } +# ifdef H5_HAVE_FLOAT128 + /* Don't select a higher precision than Fortran can support */ + else if(sizeof(__float128) == RealKinds_SizeOf[i] && found_long_double == 1 && H5_PAC_FC_MAX_REAL_PRECISION > 28) { + writeTypedef("float", "__float128", RealKinds[i]); + strcpy(Real_C_TYPES[i], "C_FLOAT128"); + } +# else + else if(sizeof(long double) == RealKinds_SizeOf[i] && found_long_double == 1 && H5_PAC_FC_MAX_REAL_PRECISION > 28) { + writeTypedef("float", "long double", RealKinds[i]); + strcpy(Real_C_TYPES[i], "C_FLOAT128"); + } +# endif +#else /* There is no C_LONG_DOUBLE intrinsic */ +# ifdef H5_HAVE_FLOAT128 + /* Don't select a higher precision than Fortran can support */ + else if(sizeof(__float128) == RealKinds_SizeOf[i] ) { + writeTypedef("float", "__float128", RealKinds[i]); + strcpy(Real_C_TYPES[i], "C_FLOAT128"); + } +# else + else if(sizeof(long double) == RealKinds_SizeOf[i] ) { + writeTypedef("float", "long double", RealKinds[i]); + strcpy(Real_C_TYPES[i], "C_FLOAT128"); + } +# endif +#endif + else { + printf("\n **** HDF5 WARNING ****\n"); + printf("Fortran REAL(KIND=%d) is %d Bytes, but no corresponding C float type exists of that size\n",RealKinds[i],RealKinds_SizeOf[i]); + printf(" !!! Fortran interfaces will not be generated for REAL(KIND=%d) !!!\n\n",RealKinds[i]); + + RealKinds_SizeOf[i] = -1; + RealKinds[i] = -1; + } + } /* Now begin defining fortran types. */ fprintf(c_header, "\n"); + /* haddr_t */ -#if defined H5_FORTRAN_HAS_INTEGER_8_KIND && H5_SIZEOF_HADDR_T >= 8 - writeToFiles("int","HADDR_T", "haddr_t_f", 8, H5_FORTRAN_HAS_INTEGER_8_KIND); -#elif defined H5_FORTRAN_HAS_INTEGER_4_KIND && H5_SIZEOF_HADDR_T >= 4 - writeToFiles("int","HADDR_T", "haddr_t_f", 4, H5_FORTRAN_HAS_INTEGER_4_KIND); -#elif defined H5_FORTRAN_HAS_INTEGER_2_KIND && H5_SIZEOF_HADDR_T >= 2 - writeToFiles("int","HADDR_T", "haddr_t_f", 2, H5_FORTRAN_HAS_INTEGER_2_KIND); -#elif defined H5_FORTRAN_HAS_INTEGER_1_KIND && H5_SIZEOF_HADDR_T >= 1 - writeToFiles("int","HADDR_T", "haddr_t_f", 1, H5_FORTRAN_HAS_INTEGER_1_KIND); -#else - /* Error: couldn't find a size for haddr_t */ - return -1; -#endif + for(i=0;i< H5_FORTRAN_NUM_INTEGER_KINDS;i++) { + if(IntKinds_SizeOf[i] == H5_SIZEOF_HADDR_T) { + writeToFiles("int","HADDR_T", "haddr_t_f", H5_SIZEOF_HADDR_T, IntKinds[i]); + break; + } + if(i == (H5_FORTRAN_NUM_INTEGER_KINDS-1) ) + /* Error: couldn't find a size for haddr_t */ + return -1; + } /* hsize_t */ -#if defined H5_FORTRAN_HAS_INTEGER_8_KIND && H5_SIZEOF_HSIZE_T >= 8 - writeToFiles("hsize_t","HSIZE_T", "hsize_t_f", 8, H5_FORTRAN_HAS_INTEGER_8_KIND); -#elif defined H5_FORTRAN_HAS_INTEGER_4_KIND && H5_SIZEOF_HSIZE_T >= 4 - writeToFiles("hsize_t","HSIZE_T", "hsize_t_f", 4, H5_FORTRAN_HAS_INTEGER_4_KIND); -#elif defined H5_FORTRAN_HAS_INTEGER_2_KIND && H5_SIZEOF_HSIZE_T >= 2 - writeToFiles("hsize_t","HSIZE_T", "hsize_t_f", 2, H5_FORTRAN_HAS_INTEGER_2_KIND); -#elif defined H5_FORTRAN_HAS_INTEGER_1_KIND && H5_SIZEOF_HSIZE_T >= 1 - writeToFiles("hsize_t","HSIZE_T", "hsize_t_f", 1, H5_FORTRAN_HAS_INTEGER_1_KIND); -#else - /* Error: couldn't find a size for hsize_t */ - return -1; -#endif + for(i=0;i< H5_FORTRAN_NUM_INTEGER_KINDS;i++) { + if(IntKinds_SizeOf[i] == H5_SIZEOF_HSIZE_T) { + writeToFiles("hsize_t","HSIZE_T", "hsize_t_f", H5_SIZEOF_HSIZE_T, IntKinds[i]); + break; + } + if(i == (H5_FORTRAN_NUM_INTEGER_KINDS-1) ) + /* Error: couldn't find a size for hsize_t */ + return -1; + } /* hssize_t */ -#if defined H5_FORTRAN_HAS_INTEGER_8_KIND && H5_SIZEOF_HSSIZE_T >= 8 - writeToFiles("int","HSSIZE_T", "hssize_t_f", 8, H5_FORTRAN_HAS_INTEGER_8_KIND); -#elif defined H5_FORTRAN_HAS_INTEGER_4_KIND && H5_SIZEOF_HSSIZE_T >= 4 - writeToFiles("int","HSSIZE_T", "hssize_t_f", 4, H5_FORTRAN_HAS_INTEGER_4_KIND); -#elif defined H5_FORTRAN_HAS_INTEGER_2_KIND && H5_SIZEOF_HSSIZE_T >= 2 - writeToFiles("int","HSSIZE_T", "hssize_t_f", 2, H5_FORTRAN_HAS_INTEGER_2_KIND); -#elif defined H5_FORTRAN_HAS_INTEGER_1_KIND && H5_SIZEOF_HSSIZE_T >= 1 - writeToFiles("int","HSSIZE_T", "hssize_t_f", 1, H5_FORTRAN_HAS_INTEGER_1_KIND); -#else - /* Error: couldn't find a size for hssize_t */ - return -1; -#endif + for(i=0;i< H5_FORTRAN_NUM_INTEGER_KINDS;i++) { + if(IntKinds_SizeOf[i] == H5_SIZEOF_HSSIZE_T) { + writeToFiles("int","HSSIZE_T", "hssize_t_f", H5_SIZEOF_HSSIZE_T, IntKinds[i]); + break; + } + if(i == (H5_FORTRAN_NUM_INTEGER_KINDS-1) ) + /* Error: couldn't find a size for hssize_t */ + return -1; + } /* off_t */ -#if defined H5_FORTRAN_HAS_INTEGER_8_KIND && H5_SIZEOF_OFF_T >= 8 - writeToFiles("int","OFF_T", "off_t_f", 8, H5_FORTRAN_HAS_INTEGER_8_KIND); -#elif defined H5_FORTRAN_HAS_INTEGER_4_KIND && H5_SIZEOF_OFF_T >= 4 - writeToFiles("int","OFF_T", "off_t_f", 4, H5_FORTRAN_HAS_INTEGER_4_KIND); -#elif defined H5_FORTRAN_HAS_INTEGER_2_KIND && H5_SIZEOF_OFF_T >= 2 - writeToFiles("int","OFF_T", "off_t_f", 2, H5_FORTRAN_HAS_INTEGER_2_KIND); -#elif defined H5_FORTRAN_HAS_INTEGER_1_KIND && H5_SIZEOF_OFF_T >= 1 - writeToFiles("int","OFF_T", "off_t_f", 1, H5_FORTRAN_HAS_INTEGER_1_KIND); -#else - /* Error: couldn't find a size for off_t */ - return -1; -#endif + for(i=0;i< H5_FORTRAN_NUM_INTEGER_KINDS;i++) { + if(IntKinds_SizeOf[i] == H5_SIZEOF_OFF_T) { + writeToFiles("int","OFF_T", "off_t_f", H5_SIZEOF_OFF_T, IntKinds[i]); + break; + } + if(i == (H5_FORTRAN_NUM_INTEGER_KINDS-1) ) + /* Error: couldn't find a size for off_t */ + return -1; + } /* size_t */ -#if defined H5_FORTRAN_HAS_INTEGER_8_KIND && H5_SIZEOF_SIZE_T >= 8 - writeToFiles("size_t","SIZE_T", "size_t_f", 8, H5_FORTRAN_HAS_INTEGER_8_KIND); -#elif defined H5_FORTRAN_HAS_INTEGER_4_KIND && H5_SIZEOF_SIZE_T >= 4 - writeToFiles("size_t","SIZE_T", "size_t_f", 4, H5_FORTRAN_HAS_INTEGER_4_KIND); -#elif defined H5_FORTRAN_HAS_INTEGER_2_KIND && H5_SIZEOF_SIZE_T >= 2 - writeToFiles("size_t","SIZE_T", "size_t_f", 2, H5_FORTRAN_HAS_INTEGER_2_KIND); -#elif defined H5_FORTRAN_HAS_INTEGER_1_KIND && H5_SIZEOF_SIZE_T >= 1 - writeToFiles("size_t","SIZE_T", "size_t_f", 1, H5_FORTRAN_HAS_INTEGER_1_KIND); -#else - /* Error: couldn't find a size for size_t */ - return -1; -#endif + for(i=0;i< H5_FORTRAN_NUM_INTEGER_KINDS;i++) { + if(IntKinds_SizeOf[i] == H5_SIZEOF_SIZE_T) { + writeToFiles("size_t","SIZE_T", "size_t_f", H5_SIZEOF_SIZE_T, IntKinds[i]); + break; + } + if(i == (H5_FORTRAN_NUM_INTEGER_KINDS-1) ) + /* Error: couldn't find a size for size_t */ + return -1; + } /* int */ -#if defined H5_FORTRAN_HAS_NATIVE_8_KIND - writeToFiles("int","Fortran_INTEGER", "int_f", 8, H5_FORTRAN_HAS_NATIVE_8_KIND); -#elif defined H5_FORTRAN_HAS_NATIVE_4_KIND - writeToFiles("int","Fortran_INTEGER", "int_f", 4, H5_FORTRAN_HAS_NATIVE_4_KIND); -#elif defined H5_FORTRAN_HAS_NATIVE_2_KIND - writeToFiles("int","Fortran_INTEGER", "int_f", 2, H5_FORTRAN_HAS_NATIVE_2_KIND); -#elif defined H5_FORTRAN_HAS_NATIVE_1_KIND - writeToFiles("int","Fortran_INTEGER", "int_f", 1, H5_FORTRAN_HAS_NATIVE_1_KIND); -#else - /* Error: couldn't find a size for int */ - return -1; -#endif + writeToFiles("int","Fortran_INTEGER", "int_f", H5_FORTRAN_NATIVE_INTEGER_SIZEOF, H5_FORTRAN_NATIVE_INTEGER_KIND); /* int_1, int_2, int_4, int_8 */ @@ -374,29 +322,20 @@ int main(void) /* it a value of the next larger one, but if the next */ /* higher one is not available we assigned it the next lowest */ - FoundIntSize[0] = -1; - FoundIntSize[1] = -2; - FoundIntSize[2] = -4; - FoundIntSize[3] = -8; -#if defined H5_FORTRAN_HAS_INTEGER_1_KIND - FoundIntSize[0] = 1; - FoundIntSizeKind[0] = H5_FORTRAN_HAS_INTEGER_1_KIND; -#endif -#if defined H5_FORTRAN_HAS_INTEGER_2_KIND - FoundIntSize[1] = 2; - FoundIntSizeKind[1] = H5_FORTRAN_HAS_INTEGER_2_KIND; -#endif -#if defined H5_FORTRAN_HAS_INTEGER_4_KIND - FoundIntSize[2] = 4; - FoundIntSizeKind[2] = H5_FORTRAN_HAS_INTEGER_4_KIND; -#endif -#if defined H5_FORTRAN_HAS_INTEGER_8_KIND - FoundIntSize[3] = 8; - FoundIntSizeKind[3] = H5_FORTRAN_HAS_INTEGER_8_KIND ; -#endif + FoundIntSize[0] = -1; + FoundIntSize[1] = -1; + FoundIntSize[2] = -1; + FoundIntSize[3] = -1; + FoundIntSize[4] = -1; + + for(i=0;i 0) /* Found the integer type */ { sprintf(chrA, "Fortran_INTEGER_%d", FoundIntSize[i]); @@ -443,129 +382,77 @@ int main(void) /* it a value of the next larger one, but if the next */ /* higher one is not available we assigned it the next lowest */ - FoundRealSize[0] = -4; - FoundRealSize[1] = -8; - FoundRealSize[2] = -16; - -#if defined H5_FORTRAN_HAS_REAL_4_KIND - FoundRealSize[0] = 4; - FoundRealSizeKind[0] = H5_FORTRAN_HAS_REAL_4_KIND; -#endif -#if defined H5_FORTRAN_HAS_REAL_8_KIND - FoundRealSize[1] = 8; - FoundRealSizeKind[1] = H5_FORTRAN_HAS_REAL_8_KIND; -#endif - -#if defined H5_FORTRAN_HAS_REAL_16_KIND - if(H5_C_HAS_REAL_NATIVE_16 != 0) { - FoundRealSize[2] = 16; - FoundRealSizeKind[2] = H5_FORTRAN_HAS_REAL_16_KIND; - } -#endif - - for(i=0;i<3;i++) { - if( FoundRealSize[i] > 0) /* Found the real type */ - { - sprintf(chrA, "Fortran_REAL_%d", FoundRealSize[i]); - sprintf(chrB, "real_%d_f", FoundRealSize[i]); - writeToFiles("float",chrA, chrB, FoundRealSize[i], FoundRealSizeKind[i]); - } - else /* Did not find the real type */ - { - flag = 0; /* flag indicating if found the next highest */ - for(j=i+1;j<3;j++) /* search for next highest */ - { - if( FoundRealSize[j] > 0) /* Found the next highest */ - { - sprintf(chrA, "Fortran_REAL_%d", (-1)*FoundRealSize[i]); - sprintf(chrB, "real_%d_f", (-1)*FoundRealSize[i]); - if(FoundRealSize[j]>4) { - writeToFiles("float",chrA, chrB, FoundRealSize[j], FoundRealSizeKind[j]); - flag = 1; - } - /* else { */ -/* writeToFiles("float", chrA, chrB, FoundRealSize[j]); */ -/* } */ - flag = 1; - break; - } - } - if(flag == 0) /* No higher one found, so find next lowest */ - { - for(j=1;j>-1;j--) /* Search for next lowest */ - { - if( FoundRealSize[j] > 0) /* Found the next lowest */ - { - sprintf(chrA, "Fortran_REAL_%d", (-1)*FoundRealSize[i]); - sprintf(chrB, "real_%d_f", (-1)*FoundRealSize[i]); - if(FoundRealSize[j]>4) - writeToFiles("float",chrA, chrB, FoundRealSize[j], FoundRealSizeKind[j]); - /* else { */ -/* writeToFiles("float", chrA, chrB, FoundRealSize[j]); */ -/* } */ - flag = 1; - break; - } - } - } - if(flag == 0) /* No higher or lower one found, indicating an error */ - return -1; - } + FoundRealSize[0] = -1; + FoundRealSize[1] = -1; + FoundRealSize[2] = -1; + FoundRealSize[3] = -1; + FoundRealSize[4] = -1; + + for(i=0;i 0) { + FoundRealSize[i] = (int)RealKinds[i]; + FoundRealSizeKind[i] = (int)RealKinds_SizeOf[i]; + sprintf(chrA, "Fortran_REAL_%s", Real_C_TYPES[i]); + sprintf(chrB, "real_%s_f", Real_C_TYPES[i]); + writeToFiles("float",chrA, chrB, RealKinds[i], RealKinds_SizeOf[i]); } + } /* hid_t */ -#if defined H5_FORTRAN_HAS_INTEGER_8_KIND && H5_SIZEOF_HID_T >= 8 - writeToFiles("int","HID_T", "hid_t_f", 8, H5_FORTRAN_HAS_INTEGER_8_KIND); -#elif defined H5_FORTRAN_HAS_INTEGER_4_KIND && H5_SIZEOF_HID_T >= 4 - writeToFiles("int","HID_T", "hid_t_f", 4, H5_FORTRAN_HAS_INTEGER_4_KIND); -#elif defined H5_FORTRAN_HAS_INTEGER_2_KIND && H5_SIZEOF_HID_T >= 2 - writeToFiles("int","HID_T", "hid_t_f", 2, H5_FORTRAN_HAS_INTEGER_2_KIND); -#elif defined H5_FORTRAN_HAS_INTEGER_1_KIND && H5_SIZEOF_HID_T >= 1 - writeToFiles("int","HID_T", "hid_t_f", 1, H5_FORTRAN_HAS_INTEGER_1_KIND); -#elif defined H5_FORTRAN_HAS_INTEGER_8_KIND && H5_SIZEOF_HID_T >= 4 - writeToFiles("int","HID_T", "hid_t_f", 8, H5_FORTRAN_HAS_INTEGER_8_KIND); -#else - /* Error: couldn't find a size for hid_t */ - return -1; -#endif + for(i=0;i< H5_FORTRAN_NUM_INTEGER_KINDS;i++) { + if(IntKinds_SizeOf[i] == H5_SIZEOF_HID_T) { + writeToFiles("int","HID_T", "hid_t_f", H5_SIZEOF_HID_T, IntKinds[i]); + break; + } + if(i == (H5_FORTRAN_NUM_INTEGER_KINDS-1) ) + /* Error: couldn't find a size for hid_t */ + return -1; + } /* real_f */ -#if defined H5_FORTRAN_HAS_REAL_NATIVE_16_KIND - if(H5_C_HAS_REAL_NATIVE_16 != 0) { - writeToFiles("float","Fortran_REAL", "real_f", 16, H5_FORTRAN_HAS_REAL_NATIVE_16_KIND); + if(H5_FORTRAN_NATIVE_REAL_SIZEOF == sizeof(long double)) + writeToFilesChr("float","Fortran_REAL", "real_f", H5_FORTRAN_NATIVE_REAL_KIND, "C_LONG_DOUBLE"); + else if(H5_FORTRAN_NATIVE_REAL_SIZEOF == sizeof(double)) + writeToFilesChr("float","Fortran_REAL", "real_f", H5_FORTRAN_NATIVE_REAL_KIND, "C_DOUBLE"); + else if(H5_FORTRAN_NATIVE_REAL_SIZEOF == sizeof(float)) + writeToFilesChr("float","Fortran_REAL", "real_f", H5_FORTRAN_NATIVE_REAL_KIND, "C_FLOAT"); + else { + /* No exact match, choose the next highest */ + if(H5_FORTRAN_NATIVE_REAL_SIZEOF > sizeof(long double)) + writeToFilesChr("float","Fortran_REAL", "real_f", H5_FORTRAN_NATIVE_REAL_KIND, "C_LONG_DOUBLE"); + else if(H5_FORTRAN_NATIVE_REAL_SIZEOF > sizeof(double)) + writeToFilesChr("float","Fortran_REAL", "real_f", H5_FORTRAN_NATIVE_REAL_KIND, "C_DOUBLE"); + else if(H5_FORTRAN_NATIVE_REAL_SIZEOF > sizeof(float)) + writeToFilesChr("float","Fortran_REAL", "real_f", H5_FORTRAN_NATIVE_REAL_KIND, "C_FLOAT"); + else { + /* Error: couldn't find a size for real_f */ + printf("Error: couldn't find a size for real_f \n"); + return -1; } -#elif defined H5_FORTRAN_HAS_REAL_NATIVE_8_KIND - writeToFiles("float", "Fortran_REAL", "real_f", 8, H5_FORTRAN_HAS_REAL_NATIVE_8_KIND); -#elif defined H5_FORTRAN_HAS_REAL_NATIVE_4_KIND - writeToFiles("float", "Fortran_REAL", "real_f", 4, H5_FORTRAN_HAS_REAL_NATIVE_4_KIND); -#else - /* Error: couldn't find a size for real_f */ - return -1; -#endif + } /* double_f */ -#if defined H5_FORTRAN_HAS_DOUBLE_NATIVE_16_KIND - if(H5_C_HAS_REAL_NATIVE_16 != 0) { /* Check if C has 16 byte floats */ - writeToFiles("float", "Fortran_DOUBLE", "double_f", 16, H5_FORTRAN_HAS_DOUBLE_NATIVE_16_KIND); - } else { -#if defined H5_FORTRAN_HAS_REAL_NATIVE_8_KIND /* Fall back to 8 byte floats */ - writeToFiles("float", "Fortran_DOUBLE", "double_f", 8, H5_FORTRAN_HAS_REAL_NATIVE_8_KIND); - } -#elif defined H5_FORTRAN_HAS_REAL_NATIVE_4_KIND /* Fall back to 4 byte floats */ - writeToFiles("float", "Fortran_DOUBLE", "double_f", 4, H5_FORTRAN_HAS_REAL_NATIVE_4_KIND); + if(H5_FORTRAN_NATIVE_DOUBLE_SIZEOF == sizeof(long double)) + writeToFilesChr("float","Fortran_DOUBLE", "double_f", H5_FORTRAN_NATIVE_DOUBLE_KIND, "C_LONG_DOUBLE"); + else if(H5_FORTRAN_NATIVE_DOUBLE_SIZEOF == sizeof(double)) + writeToFilesChr("float","Fortran_DOUBLE", "double_f", H5_FORTRAN_NATIVE_DOUBLE_KIND, "C_DOUBLE"); + else if(H5_FORTRAN_NATIVE_DOUBLE_SIZEOF == sizeof(float)) + writeToFilesChr("float","Fortran_DOUBLE", "double_f", H5_FORTRAN_NATIVE_DOUBLE_KIND, "C_FLOAT"); +#ifdef H5_HAVE_FLOAT128 + /* Don't select a higher precision than Fortran can support */ + else if(sizeof(__float128) == H5_FORTRAN_NATIVE_DOUBLE_SIZEOF && H5_PAC_FC_MAX_REAL_PRECISION > 28) { + writeToFilesChr("float","Fortran_DOUBLE", "double_f", H5_FORTRAN_NATIVE_DOUBLE_KIND, "C_FLOAT128"); } #else - /* Error: couldn't find a size for double_f when fortran has 16 byte reals */ - return -1; + else if(sizeof(long double) == H5_FORTRAN_NATIVE_DOUBLE_SIZEOF && H5_PAC_FC_MAX_REAL_PRECISION > 28) { + writeToFilesChr("float","Fortran_DOUBLE", "double_f", H5_FORTRAN_NATIVE_DOUBLE_KIND, "C_FLOAT128"); } #endif - -#elif defined H5_FORTRAN_HAS_DOUBLE_NATIVE_8_KIND - writeToFiles("float", "Fortran_DOUBLE", "double_f", 8, H5_FORTRAN_HAS_DOUBLE_NATIVE_8_KIND); -#else - /* Error: couldn't find a size for real_f */ + else { + /* Error: couldn't find a size for double_f */ + printf("Error: couldn't find a size for double_f \n"); return -1; -#endif + } /* Need the buffer size for the fortran derive type 'hdset_reg_ref_t_f03' * in order to be interoperable with C's structure, the C buffer size @@ -574,12 +461,12 @@ int main(void) fprintf(fort_header, " INTEGER, PARAMETER :: H5R_DSET_REG_REF_BUF_SIZE_F = %u\n", H5_SIZEOF_HADDR_T + 4 ); - /* Close files */ endCfile(); endFfile(); fclose(c_header); fclose(fort_header); + return 0; } diff --git a/fortran/src/H5test_kind.f90 b/fortran/src/H5test_kind.f90 deleted file mode 100644 index 1a1a0ec..0000000 --- a/fortran/src/H5test_kind.f90 +++ /dev/null @@ -1,269 +0,0 @@ -!****p* Program/H5test_kind -! -! NAME -! Executable: H5test_kind -! -! FILE -! fortran/src/H5test_kind.f90 -! -! PURPOSE -! This stand alone program is used at build time to generate the program -! H5fortran_detect.f90. It cycles through all the available KIND parameters for -! integers and reals. The appropriate program and subroutines are then generated -! depending on which of the KIND values are found. -! -! NOTES -! This program is depreciated in favor of H5test_kind_SIZEOF.f90 and is only -! used when the Fortran intrinsic function SIZEOF is not available. It generates -! code that does not make use of SIZEOF in H5fortran_detect.f90 which is less -! portable in comparison to using SIZEOF. -! -! The availability of SIZEOF is checked at configure time and the TRUE/FALSE -! condition is set in the configure variable "FORTRAN_HAVE_SIZEOF". -! -! 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 -! Elena Pourma -! -!***** - -PROGRAM test_kind - IMPLICIT NONE - INTEGER :: i, j, ii, ir, last, ikind_numbers(10), rkind_numbers(10) - INTEGER :: ji, jr, jd - last = -1 - ii = 0 - j = SELECTED_INT_KIND(18) - DO i = 1,100 - j = SELECTED_INT_KIND(i) - IF(j .NE. last) THEN - IF(last .NE. -1) THEN - ii = ii + 1 - ikind_numbers(ii) = last - ENDIF - last = j - IF(j .EQ. -1) EXIT - ENDIF - ENDDO - - last = -1 - ir = 0 - DO i = 1,100 - j = SELECTED_REAL_KIND(i) - IF(j .NE. last) THEN - IF(last .NE. -1) THEN - ir = ir + 1 - rkind_numbers(ir) = last - ENDIF - last = j - IF(j .EQ. -1) EXIT - ENDIF - ENDDO - -! Generate program information: - -WRITE(*,'(40(A,/))') & -'!****h* ROBODoc/H5fortran_detect.f90',& -'!',& -'! NAME',& -'! H5fortran_detect',& -'! ',& -'! PURPOSE',& -'! This stand alone program is used at build time to generate the header file',& -'! H5fort_type_defines.h. The source code itself was automatically generated by',& -'! the program H5test_kind.f90',& -'!',& -'! NOTES',& -'! This source code does not make use of the Fortran intrinsic function SIZEOF because',& -'! the availability of the intrinsic function was determined to be not available at',& -'! configure time',& -'!',& -'! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *',& -'! 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',& -'!',& -'!*****' - -! Generate a program - - WRITE(*,*) "PROGRAM int_kind" - WRITE(*,*) "WRITE(*,*) "" /*generating header file*/ """ - ji = 0 - WRITE(*, "("" CALL i"", i2.2,""()"")") ji - jr = 0 - WRITE(*, "("" CALL r"", i2.2,""()"")") jr - jd = 0 - WRITE(*, "("" CALL d"", i2.2,""()"")") jd - DO i = 1, ii - j = ikind_numbers(i) - WRITE(*, "("" CALL i"", i2.2,""()"")") j - ENDDO - DO i = 1, ir - j = rkind_numbers(i) - WRITE(*, "("" CALL r"", i2.2,""()"")") j - ENDDO - WRITE(*,*) "END PROGRAM int_kind" - j = 0 - ji = KIND(1) - WRITE(*, "("" SUBROUTINE i"", i2.2,""()"")") j - WRITE(*,*)" IMPLICIT NONE" - WRITE(*,*)" INTEGER :: a = 0" - WRITE(*,*)" INTEGER :: a_size" - WRITE(*,*)" CHARACTER(LEN=2) :: jchr2" - WRITE(*,*)" a_size = BIT_SIZE(a)" - WRITE(*,*)" IF (a_size .EQ. 8) THEN" - WRITE(*,*)" WRITE(jchr2,'(I2)')",ji - WRITE(*,'(A)')' WRITE(*,*) "#define H5_FORTRAN_HAS_NATIVE_1_KIND "'//"//ADJUSTL(jchr2)" - WRITE(*,*)" endif" - WRITE(*,*)" IF (a_size .EQ. 16) THEN" - WRITE(*,*)" WRITE(jchr2,'(I2)')",ji - WRITE(*,'(A)')' WRITE(*,*) "#define H5_FORTRAN_HAS_NATIVE_2_KIND "'//"//ADJUSTL(jchr2)" - WRITE(*,*)" endif" - WRITE(*,*)" IF (a_size .EQ. 32) THEN" - WRITE(*,*)" WRITE(jchr2,'(I2)')",ji - WRITE(*,'(A)')' WRITE(*,*) "#define H5_FORTRAN_HAS_NATIVE_4_KIND "'//"//ADJUSTL(jchr2)" - WRITE(*,*)" ENDIF" - WRITE(*,*)" IF (a_size .EQ. 64) THEN" - WRITE(*,*)" WRITE(jchr2,'(I2)')",ji - WRITE(*,'(A)')' WRITE(*,*) "#define H5_FORTRAN_HAS_NATIVE_8_KIND "'//"//ADJUSTL(jchr2)" - WRITE(*,*)" ENDIF" - WRITE(*,*)" IF (a_size .EQ. 128) THEN" - WRITE(*,*)" WRITE(jchr2,'(I2)')",ji - WRITE(*,'(A)')' WRITE(*,*) "#define H5_FORTRAN_HAS_NATIVE_16_KIND "'//"//ADJUSTL(jchr2)" - WRITE(*,*)" ENDIF" - WRITE(*,*)" RETURN" - WRITE(*,*)"END SUBROUTINE" - jr = KIND(1.0) - WRITE(*, "("" SUBROUTINE r"", i2.2,""()"")") j - WRITE(*,*)" IMPLICIT NONE" - WRITE(*,*)" REAL :: b(32)" - WRITE(*,*)" INTEGER :: a(1)" - WRITE(*,*)" INTEGER :: a_size" - WRITE(*,*)" INTEGER :: real_size" - WRITE(*,*)" CHARACTER(LEN=2) :: jchr2" - WRITE(*,*)" a_size = BIT_SIZE(a(1)) ! Size in bits for integer" - WRITE(*,*)" real_size = (SIZE(TRANSFER(b,a))*a_size)/SIZE(b)" - WRITE(*,*)" IF (real_size .EQ. 32) THEN" - WRITE(*,*)" WRITE(jchr2,'(I2)')",jr - WRITE(*,'(A)')' WRITE(*,*) "#define H5_FORTRAN_HAS_REAL_NATIVE_4_KIND "'//"//ADJUSTL(jchr2)" - WRITE(*,*)" ENDIF" - WRITE(*,*)" IF (real_size .EQ. 64) THEN" - WRITE(*,*)" WRITE(jchr2,'(I2)')",jr - WRITE(*,'(A)')' WRITE(*,*) "#define H5_FORTRAN_HAS_REAL_NATIVE_8_KIND "'//"//ADJUSTL(jchr2)" - WRITE(*,*)" ENDIF" - WRITE(*,*)" IF (real_size .EQ. 128) THEN" - WRITE(*,*)" WRITE(jchr2,'(I2)')",jr - WRITE(*,'(A)')' WRITE(*,*) "#define H5_FORTRAN_HAS_REAL_NATIVE_16_KIND "'//"//ADJUSTL(jchr2)" - WRITE(*,*)" ENDIF" - WRITE(*,*)" RETURN" - WRITE(*,*)"END SUBROUTINE" - jd = KIND(1.d0) - WRITE(*, "("" SUBROUTINE d"", i2.2,""()"")") j - WRITE(*,*)" IMPLICIT NONE" - WRITE(*,*)" DOUBLE PRECISION :: b=0" - WRITE(*,*)" INTEGER :: a(8)=0" - WRITE(*,*)" INTEGER :: a_size" - WRITE(*,*)" INTEGER :: b_size" - WRITE(*,*)" CHARACTER(LEN=2) :: jchr2" - WRITE(*,*)" a_size = BIT_SIZE(a(1))" - WRITE(*,*)" b_size = SIZE(transfer(b,a))*a_size" - WRITE(*,*)" IF (b_size .EQ. 64) THEN" - WRITE(*,*)" WRITE(jchr2,'(I2)')",jd - WRITE(*,'(A)')' WRITE(*,*) "#define H5_FORTRAN_HAS_DOUBLE_NATIVE_8_KIND "'//"//ADJUSTL(jchr2)" - WRITE(*,*)" ENDIF" - WRITE(*,*)" IF (b_size .EQ. 128) THEN" - WRITE(*,*)" WRITE(jchr2,'(I2)')",jd - WRITE(*,'(A)')' WRITE(*,*) "#define H5_FORTRAN_HAS_DOUBLE_NATIVE_16_KIND "'//"//ADJUSTL(jchr2)" - WRITE(*,*)" ENDIF" - WRITE(*,*)" RETURN" - WRITE(*,*)"END SUBROUTINE" - DO i = 1, ii - j = ikind_numbers(i) - WRITE(*, "("" SUBROUTINE i"", i2.2,""()"")") j - WRITE(*,*)" IMPLICIT NONE" - WRITE(*,*)" INTEGER(",j,") :: a = 0" - WRITE(*,*)" INTEGER :: a_size" - WRITE(*,*)" CHARACTER(LEN=2) :: jchr2" - WRITE(*,*)" a_size = BIT_SIZE(a)" - WRITE(*,*)" IF (a_size .EQ. 8) THEN" - WRITE(*,*)" WRITE(jchr2,'(I2)')",j - WRITE(*,'(A)')' WRITE(*,*) "#define H5_FORTRAN_HAS_INTEGER_1_KIND "'//"//ADJUSTL(jchr2)" - WRITE(*,*)" ENDIF" - WRITE(*,*)" IF (a_size .EQ. 16) THEN" - WRITE(*,*)" WRITE(jchr2,'(I2)')",j - WRITE(*,'(A)')' WRITE(*,*) "#define H5_FORTRAN_HAS_INTEGER_2_KIND "'//"//ADJUSTL(jchr2)" - WRITE(*,*)" ENDIF" - WRITE(*,*)" IF (a_size .EQ. 32) THEN" - WRITE(*,*)" WRITE(jchr2,'(I2)')",j - WRITE(*,'(A)')' WRITE(*,*) "#define H5_FORTRAN_HAS_INTEGER_4_KIND "'//"//ADJUSTL(jchr2)" - WRITE(*,*)" ENDIF" - WRITE(*,*)" IF (a_size .EQ. 64) THEN" - WRITE(*,*)" WRITE(jchr2,'(I2)')",j - WRITE(*,'(A)')' WRITE(*,*) "#define H5_FORTRAN_HAS_INTEGER_8_KIND "'//"//ADJUSTL(jchr2)" - WRITE(*,*)" ENDIF" - WRITE(*,*)" IF (a_size .EQ. 128) THEN" - WRITE(*,*)" WRITE(jchr2,'(I2)')",j - WRITE(*,'(A)')' WRITE(*,*) "#define H5_FORTRAN_HAS_INTEGER_16_KIND "'//"//ADJUSTL(jchr2)" - WRITE(*,*)" ENDIF" - WRITE(*,*)" RETURN" - WRITE(*,*)" END SUBROUTINE" - ENDDO - DO i = 1, ir - j = rkind_numbers(i) - WRITE(*, "("" SUBROUTINE r"", i2.2,""()"")") j - WRITE(*,*)" IMPLICIT NONE" - WRITE(*,*)" REAL(KIND=",j,") :: b(32)" - WRITE(*,*)" INTEGER :: a(1)" - WRITE(*,*)" INTEGER :: a_size" - WRITE(*,*)" INTEGER :: real_size" - WRITE(*,*)" CHARACTER(LEN=2) :: jchr2" - WRITE(*,*)" a_size = BIT_SIZE(a(1)) ! Size in bits for integer" - WRITE(*,*)" real_size = (SIZE(TRANSFER(b,a))*a_size)/SIZE(b)" - WRITE(*,*)" IF (real_size .EQ. 32) THEN" - WRITE(*,*)" WRITE(jchr2,'(I2)')",j - WRITE(*,'(A)')' WRITE(*,*) "#define H5_FORTRAN_HAS_REAL_4_KIND "'//"//ADJUSTL(jchr2)" - WRITE(*,*)" ENDIF" - WRITE(*,*)" IF (real_size .EQ. 64) THEN" - WRITE(*,*)" WRITE(jchr2,'(I2)')",j - WRITE(*,*)' WRITE(*,*) "#define H5_FORTRAN_HAS_REAL_8_KIND "'//"//ADJUSTL(jchr2)" - WRITE(*,*)" endif" - WRITE(*,*)" IF (real_size .EQ. 128) THEN" - WRITE(*,*)" WRITE(jchr2,'(I2)')",j - WRITE(*,'(A)')' WRITE(*,*) "#define H5_FORTRAN_HAS_REAL_16_KIND "'//"//ADJUSTL(jchr2)" - WRITE(*,*)" ENDIF" - WRITE(*,*)" RETURN" - WRITE(*,*)" END SUBROUTINE" - ENDDO -END PROGRAM test_kind - - - diff --git a/fortran/src/H5test_kind_SIZEOF.f90 b/fortran/src/H5test_kind_SIZEOF.f90 deleted file mode 100644 index 468086a..0000000 --- a/fortran/src/H5test_kind_SIZEOF.f90 +++ /dev/null @@ -1,228 +0,0 @@ -!****p* Program/H5test_kind_SIZEOF -! -! NAME -! Executable: H5test_kind -! -! FILE -! fortran/src/H5test_kind_SIZEOF.f90 -! -! PURPOSE -! This stand alone program is used at build time to generate the program -! H5fortran_detect.f90. It cycles through all the available KIND parameters for -! integers and reals. The appropriate program and subroutines are then generated -! depending on which of the KIND values are found. -! -! NOTES -! This program is used in place of H5test_kind.f90 when the Fortran intrinsic -! function SIZEOF is available. It generates code that makes use of SIZEOF in -! H5fortran_detect.f90 which is a portable solution but is not standard -! compliant. The program H5test_kind_C_SIZEOF uses F2008 standard intrinsic -! function instead, which is the preferred method. -! -! The availability of SIZEOF is checked at configure time and the TRUE/FALSE -! condition is set in the configure variable "FORTRAN_HAVE_SIZEOF". -! -! 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 -! M. Scot Breitenfeld -! -!***** - -PROGRAM test_kind - IMPLICIT NONE - INTEGER :: i, j, ii, ir, last, ikind_numbers(10), rkind_numbers(10) - INTEGER :: ji, jr, jd - last = -1 - ii = 0 - - ikind_numbers = 0 - rkind_numbers = 0 - - DO i = 1,100 - j = SELECTED_INT_KIND(i) - IF(j .NE. last) THEN - IF(last .NE. -1) THEN - ii = ii + 1 - ikind_numbers(ii) = last - ENDIF - last = j - IF(j .EQ. -1) EXIT - ENDIF - ENDDO - - last = -1 - ir = 0 - DO i = 1,100 - j = SELECTED_REAL_KIND(i) - IF(j .NE. last) THEN - IF(last .NE. -1) THEN - ir = ir + 1 - rkind_numbers(ir) = last - ENDIF - last = j - IF(j .EQ. -1) EXIT - ENDIF - ENDDO - -! Generate program information: - -WRITE(*,'(40(A,/))') & -'!****h* ROBODoc/H5fortran_detect.f90',& -'!',& -'! NAME',& -'! H5fortran_detect',& -'! ',& -'! PURPOSE',& -'! This stand alone program is used at build time to generate the header file',& -'! H5fort_type_defines.h. The source code itself was automatically generated by',& -'! the program H5test_kind_SIZEOF.f90',& -'!',& -'! NOTES',& -'! This source code makes use of the Fortran intrinsic function SIZEOF because',& -'! the availability of the intrinsic function was determined to be available at',& -'! configure time',& -'!',& -'! 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_SIZEOF.f90',& -'!',& -'!*****' - -! GENERATE A PROGRAM -! -! (a) Generate the module - - WRITE(*,*) "MODULE H5test_kind_SIZEOF_mod" - WRITE(*,*) "USE ISO_C_BINDING" - WRITE(*,*) "IMPLICIT NONE" - WRITE(*,*) "CONTAINS" - j = 0 - ji = KIND(1) - WRITE(*, "("" SUBROUTINE i"", i2.2,""()"")") j - WRITE(*,*)" IMPLICIT NONE" - WRITE(*,*)" INTEGER :: a" - WRITE(*,*)" INTEGER(C_SIZE_T) :: a_size" - WRITE(*,*)" CHARACTER(LEN=2) :: ichr2, jchr2" - WRITE(*,*)" a_size = SIZEOF(a)" - WRITE(*,*)" WRITE(ichr2,'(I2)') a_size" - WRITE(*,'(A,I0)')" WRITE(jchr2,'(I2)') ",ji - WRITE(*,'(A)')' WRITE(*,*) "#define H5_FORTRAN_HAS_NATIVE_"'// & - "//TRIM(ADJUSTL(ichr2))//"//'"_KIND "'//"//ADJUSTL(jchr2)" - WRITE(*,*)" RETURN" - WRITE(*,*)"END SUBROUTINE" - jr = 0 - j = KIND(1.0) - WRITE(*, "("" SUBROUTINE r"", i2.2,""()"")") jr - WRITE(*,*)" IMPLICIT NONE" - WRITE(*,*)" REAL :: a" - WRITE(*,*)" INTEGER(C_SIZE_T) :: a_size" - WRITE(*,*)" CHARACTER(LEN=2) :: ichr2, jchr2" - WRITE(*,*)" a_size = SIZEOF(a)" - WRITE(*,*)" WRITE(ichr2,'(I2)') a_size" - WRITE(*,'(A,I0)')" WRITE(jchr2,'(I2)') ",j - WRITE(*,'(A)')' WRITE(*,*) "#define H5_FORTRAN_HAS_REAL_NATIVE_"'// & - "//TRIM(ADJUSTL(ichr2))//"//'"_KIND "'//"//ADJUSTL(jchr2)" - WRITE(*,*)" RETURN" - WRITE(*,*)"END SUBROUTINE" - jd = 0 - j = KIND(1.d0) - WRITE(*, "("" SUBROUTINE d"", i2.2,""()"")") jd - WRITE(*,*)" IMPLICIT NONE" - WRITE(*,*)" DOUBLE PRECISION :: a" - WRITE(*,*)" INTEGER(C_SIZE_T) :: a_size" - WRITE(*,*)" CHARACTER(LEN=2) :: ichr2, jchr2" - WRITE(*,*)" a_size = SIZEOF(a)" - WRITE(*,*)" WRITE(ichr2,'(I2)') a_size" - WRITE(*,'(A,I0)')" WRITE(jchr2,'(I2)') ",j - WRITE(*,'(A)')' WRITE(*,*) "#define H5_FORTRAN_HAS_DOUBLE_NATIVE_"'// & - "//TRIM(ADJUSTL(ichr2))//"//'"_KIND "'//"//ADJUSTL(jchr2)" - WRITE(*,*)" RETURN" - WRITE(*,*)"END SUBROUTINE" - DO i = 1, ii - j = ikind_numbers(i) - WRITE(*, "("" SUBROUTINE i"", i2.2,""()"")") j - WRITE(*,*)" IMPLICIT NONE" - WRITE(*,'(A,I0,A)')" INTEGER(KIND=",j,") :: a" - WRITE(*,*)" INTEGER(C_SIZE_T) :: a_size" - WRITE(*,*)" CHARACTER(LEN=2) :: ichr2, jchr2" - WRITE(*,*)" a_size = SIZEOF(a)" - WRITE(*,*)" WRITE(ichr2,'(I2)') a_size" - WRITE(*,'(A,I0)')" WRITE(jchr2,'(I2)') ",j - WRITE(*,'(A)')' WRITE(*,*) "#define H5_FORTRAN_HAS_INTEGER_"'// & - "//TRIM(ADJUSTL(ichr2))//"//'"_KIND "'//"//ADJUSTL(jchr2)" - WRITE(*,*)" RETURN" - WRITE(*,*)"END SUBROUTINE" - ENDDO - DO i = 1, ir - j = rkind_numbers(i) - WRITE(*, "("" SUBROUTINE r"", i2.2,""()"")") j - WRITE(*,*)" IMPLICIT NONE" - WRITE(*,'(A,I0,A)')" REAL(KIND= ",j,") :: a" - WRITE(*,*)" INTEGER(C_SIZE_T) :: a_size" - WRITE(*,*)" CHARACTER(LEN=2) :: ichr2, jchr2" - WRITE(*,*)" a_size = SIZEOF(a)" - WRITE(*,*)" WRITE(ichr2,'(I2)') a_size" - WRITE(*,'(A,I0)')" WRITE(jchr2,'(I2)') ", j - WRITE(*,'(A)')' WRITE(*,*) "#define H5_FORTRAN_HAS_REAL_"'// & - "//TRIM(ADJUSTL(ichr2))//"//'"_KIND "'//"//ADJUSTL(jchr2)" - WRITE(*,*)" RETURN" - WRITE(*,*)"END SUBROUTINE" - ENDDO - WRITE(*,*) "END MODULE H5test_kind_SIZEOF_mod" - WRITE(*,*) "" - - ! (b) generate the main program - - WRITE(*,*) "PROGRAM H5test_kind_SIZEOF" - WRITE(*,*) "USE H5test_kind_SIZEOF_mod" - WRITE(*,*) "WRITE(*,*) "" /*generating header file*/ """ - ji = 0 - WRITE(*, "("" CALL i"", i2.2,""()"")") ji - jr = 0 - WRITE(*, "("" CALL r"", i2.2,""()"")") jr - jd = 0 - WRITE(*, "("" CALL d"", i2.2,""()"")") jd - DO i = 1, ii - j = ikind_numbers(i) - WRITE(*, "("" CALL i"", i2.2,""()"")") j - ENDDO - DO i = 1, ir - j = rkind_numbers(i) - WRITE(*, "("" CALL r"", i2.2,""()"")") j - ENDDO - WRITE(*,*) "END PROGRAM H5test_kind_SIZEOF" - -END PROGRAM test_kind - - - diff --git a/fortran/src/H5test_kind_STORAGE_SIZE.f90 b/fortran/src/H5test_kind_STORAGE_SIZE.f90 deleted file mode 100644 index 89c904c..0000000 --- a/fortran/src/H5test_kind_STORAGE_SIZE.f90 +++ /dev/null @@ -1,230 +0,0 @@ -!****p* Program/H5test_kind_STORAGE_SIZE -! -! NAME -! Executable: H5test_kind -! -! FILE -! fortran/src/H5test_kind_STORAGE_SIZE.f90 -! -! PURPOSE -! This stand alone program is used at build time to generate the program -! H5fortran_detect.f90. It cycles through all the available KIND parameters for -! integers and reals. The appropriate program and subroutines are then generated -! depending on which of the KIND values are found. -! -! NOTES -! This program is used in place of H5test_kind.f90 or H5test_kind_SIZEOF.f90 when -! the Fortran 2008 intrinsic function STORAGE_SIZE is available. It generates code -! that makes use of STORAGE_SIZE in H5fortran_detect.f90, which will be standard -! compliant. This program is the preferred method. -! -! The availability of STORAGE_SIZE is checked at configure time and the TRUE/FALSE -! condition is set in the configure variable "FORTRAN_HAVE_STORAGE_SIZE". -! -! The use of C_SIZOF(X) is not used since the argument X must be an interoperable -! data entity. -! -! 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 -! M. Scot Breitenfeld -! -!***** - -PROGRAM test_kind - IMPLICIT NONE - INTEGER :: i, j, ii, ir, last, ikind_numbers(10), rkind_numbers(10) - INTEGER :: ji, jr, jd - last = -1 - ii = 0 - - ikind_numbers = 0 - rkind_numbers = 0 - - DO i = 1,100 - j = SELECTED_INT_KIND(i) - IF(j .NE. last) THEN - IF(last .NE. -1) THEN - ii = ii + 1 - ikind_numbers(ii) = last - ENDIF - last = j - IF(j .EQ. -1) EXIT - ENDIF - ENDDO - - last = -1 - ir = 0 - DO i = 1,100 - j = SELECTED_REAL_KIND(i) - IF(j .NE. last) THEN - IF(last .NE. -1) THEN - ir = ir + 1 - rkind_numbers(ir) = last - ENDIF - last = j - IF(j .EQ. -1) EXIT - ENDIF - ENDDO - -! Generate program information: - -WRITE(*,'(40(A,/))') & -'!****h* ROBODoc/H5fortran_detect.f90',& -'!',& -'! NAME',& -'! H5fortran_detect',& -'! ',& -'! PURPOSE',& -'! This stand alone program is used at build time to generate the header file',& -'! H5fort_type_defines.h. The source code itself was automatically generated by',& -'! the program H5test_kind_STORAGE_SIZE.f90',& -'!',& -'! NOTES',& -'! This source code makes use of the Fortran intrinsic function STORAGE_SIZE because',& -'! the availability of the intrinsic function was determined to be available at',& -'! configure time',& -'!',& -'! 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_C_SIZEOF.f90',& -'!',& -'!*****' - -! GENERATE A PROGRAM -! -! (a) Generate the module - - WRITE(*,*) "MODULE H5test_kind_STORAGE_SIZE_mod" - WRITE(*,*) "USE ISO_C_BINDING" - WRITE(*,*) "IMPLICIT NONE" - WRITE(*,*) "CONTAINS" - j = 0 - ji = KIND(1) - WRITE(*, "("" SUBROUTINE i"", i2.2,""()"")") j - WRITE(*,*)" IMPLICIT NONE" - WRITE(*,*)" INTEGER :: a" - WRITE(*,*)" INTEGER(C_SIZE_T) :: a_size" - WRITE(*,*)" CHARACTER(LEN=2) :: ichr2, jchr2" - WRITE(*,*)" a_size = STORAGE_SIZE(a, c_size_t)/STORAGE_SIZE(c_char_'a',c_size_t)" - WRITE(*,*)" WRITE(ichr2,'(I2)') a_size" - WRITE(*,'(A,I0)')" WRITE(jchr2,'(I2)') ",ji - WRITE(*,'(A)')' WRITE(*,*) "#define H5_FORTRAN_HAS_NATIVE_"'// & - "//TRIM(ADJUSTL(ichr2))//"//'"_KIND "'//"//ADJUSTL(jchr2)" - WRITE(*,*)" RETURN" - WRITE(*,*)"END SUBROUTINE" - jr = 0 - j = KIND(1.0) - WRITE(*, "("" SUBROUTINE r"", i2.2,""()"")") jr - WRITE(*,*)" IMPLICIT NONE" - WRITE(*,*)" REAL :: a" - WRITE(*,*)" INTEGER(C_SIZE_T) :: a_size" - WRITE(*,*)" CHARACTER(LEN=2) :: ichr2, jchr2" - WRITE(*,*)" a_size = STORAGE_SIZE(a, c_size_t)/STORAGE_SIZE(c_char_'a',c_size_t)" - WRITE(*,*)" WRITE(ichr2,'(I2)') a_size" - WRITE(*,'(A,I0)')" WRITE(jchr2,'(I2)') ",j - WRITE(*,'(A)')' WRITE(*,*) "#define H5_FORTRAN_HAS_REAL_NATIVE_"'// & - "//TRIM(ADJUSTL(ichr2))//"//'"_KIND "'//"//ADJUSTL(jchr2)" - WRITE(*,*)" RETURN" - WRITE(*,*)"END SUBROUTINE" - jd = 0 - j = KIND(1.d0) - WRITE(*, "("" SUBROUTINE d"", i2.2,""()"")") jd - WRITE(*,*)" IMPLICIT NONE" - WRITE(*,*)" DOUBLE PRECISION :: a" - WRITE(*,*)" INTEGER(C_SIZE_T) :: a_size" - WRITE(*,*)" CHARACTER(LEN=2) :: ichr2, jchr2" - WRITE(*,*)" a_size = STORAGE_SIZE(a, c_size_t)/STORAGE_SIZE(c_char_'a',c_size_t)" - WRITE(*,*)" WRITE(ichr2,'(I2)') a_size" - WRITE(*,'(A,I0)')" WRITE(jchr2,'(I2)') ",j - WRITE(*,'(A)')' WRITE(*,*) "#define H5_FORTRAN_HAS_DOUBLE_NATIVE_"'// & - "//TRIM(ADJUSTL(ichr2))//"//'"_KIND "'//"//ADJUSTL(jchr2)" - WRITE(*,*)" RETURN" - WRITE(*,*)"END SUBROUTINE" - DO i = 1, ii - j = ikind_numbers(i) - WRITE(*, "("" SUBROUTINE i"", i2.2,""()"")") j - WRITE(*,*)" IMPLICIT NONE" - WRITE(*,'(A,I0,A)')" INTEGER(KIND=",j,") :: a" - WRITE(*,*)" INTEGER(C_SIZE_T) :: a_size" - WRITE(*,*)" CHARACTER(LEN=2) :: ichr2, jchr2" - WRITE(*,*)" a_size = STORAGE_SIZE(a, c_size_t)/STORAGE_SIZE(c_char_'a',c_size_t)" - WRITE(*,*)" WRITE(ichr2,'(I2)') a_size" - WRITE(*,'(A,I0)')" WRITE(jchr2,'(I2)') ",j - WRITE(*,'(A)')' WRITE(*,*) "#define H5_FORTRAN_HAS_INTEGER_"'// & - "//TRIM(ADJUSTL(ichr2))//"//'"_KIND "'//"//ADJUSTL(jchr2)" - WRITE(*,*)" RETURN" - WRITE(*,*)"END SUBROUTINE" - ENDDO - DO i = 1, ir - j = rkind_numbers(i) - WRITE(*, "("" SUBROUTINE r"", i2.2,""()"")") j - WRITE(*,*)" IMPLICIT NONE" - WRITE(*,'(A,I0,A)')" REAL(KIND= ",j,") :: a" - WRITE(*,*)" INTEGER(C_SIZE_T) :: a_size" - WRITE(*,*)" CHARACTER(LEN=2) :: ichr2, jchr2" - WRITE(*,*)" a_size = STORAGE_SIZE(a, c_size_t)/STORAGE_SIZE(c_char_'a',c_size_t)" - WRITE(*,*)" WRITE(ichr2,'(I2)') a_size" - WRITE(*,'(A,I0)')" WRITE(jchr2,'(I2)') ", j - WRITE(*,'(A)')' WRITE(*,*) "#define H5_FORTRAN_HAS_REAL_"'// & - "//TRIM(ADJUSTL(ichr2))//"//'"_KIND "'//"//ADJUSTL(jchr2)" - WRITE(*,*)" RETURN" - WRITE(*,*)"END SUBROUTINE" - ENDDO - WRITE(*,*) "END MODULE H5test_kind_STORAGE_SIZE_mod" - WRITE(*,*) "" - - ! (b) generate the main program - - WRITE(*,*) "PROGRAM H5test_kind_STORAGE_SIZE" - WRITE(*,*) "USE H5test_kind_STORAGE_SIZE_mod" - WRITE(*,*) "WRITE(*,*) "" /*generating header file*/ """ - ji = 0 - WRITE(*, "("" CALL i"", i2.2,""()"")") ji - jr = 0 - WRITE(*, "("" CALL r"", i2.2,""()"")") jr - jd = 0 - WRITE(*, "("" CALL d"", i2.2,""()"")") jd - DO i = 1, ii - j = ikind_numbers(i) - WRITE(*, "("" CALL i"", i2.2,""()"")") j - ENDDO - DO i = 1, ir - j = rkind_numbers(i) - WRITE(*, "("" CALL r"", i2.2,""()"")") j - ENDDO - WRITE(*,*) "END PROGRAM H5test_kind_STORAGE_SIZE" - -END PROGRAM test_kind - - - diff --git a/fortran/src/HDF5.F90 b/fortran/src/HDF5.F90 new file mode 100644 index 0000000..64f5be6 --- /dev/null +++ b/fortran/src/HDF5.F90 @@ -0,0 +1,46 @@ +!****h* ROBODoc/HDF5 +! +! NAME +! MODULE HDF5 +! +! FILE +! src/fortran/src/HDF5.f90 +! +! PURPOSE +! This is the main module used for linking to the Fortran HDF library. +! +! 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. * +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! +!***** +MODULE HDF5 + USE H5GLOBAL + USE H5F + USE H5G + USE H5E + USE H5I + USE H5L + USE H5S + USE H5D + USE H5A + USE H5T + USE H5O + USE H5P + USE H5R + USE H5Z + USE H5_gen + USE H5LIB +END MODULE HDF5 diff --git a/fortran/src/HDF5.f90 b/fortran/src/HDF5.f90 deleted file mode 100644 index 75af333..0000000 --- a/fortran/src/HDF5.f90 +++ /dev/null @@ -1,56 +0,0 @@ -!****h* ROBODoc/HDF5 -! -! NAME -! MODULE HDF5 -! -! FILE -! src/fortran/src/HDF5.f90 -! -! PURPOSE -! This is the main module used for linking to the Fortran HDF library. -! -! 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. * -! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -! -!***** - -MODULE HDF5 - USE H5GLOBAL - USE H5F - USE H5F_PROVISIONAL - USE H5G - USE H5E - USE H5E_PROVISIONAL - USE H5I - USE H5L - USE H5L_PROVISIONAL - USE H5S - USE H5D - USE H5D_PROVISIONAL - USE H5A - USE H5A_PROVISIONAL - USE H5T - USE H5T_PROVISIONAL - USE H5O - USE H5O_PROVISIONAL - USE H5P - USE H5P_PROVISIONAL - USE H5R - USE H5R_PROVISIONAL - USE H5Z - USE H5_DBLE_INTERFACE - USE H5LIB -END MODULE HDF5 diff --git a/fortran/src/HDF5mpio.f90 b/fortran/src/HDF5mpio.f90 deleted file mode 100644 index b8fb645..0000000 --- a/fortran/src/HDF5mpio.f90 +++ /dev/null @@ -1,55 +0,0 @@ -!****h* ROBODoc/HDF5 (mpio) -! -! NAME -! HDF5 -! -! PURPOSE -! This is the main module used for linking to the Fortran parallel HDF library. -! This file replaces HDF5.f90 when compiling the parallel library. -! -! 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. * -! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -! -!***** - -MODULE HDF5 - USE H5GLOBAL - USE H5F - USE H5F_PROVISIONAL - USE H5G - USE H5E - USE H5E_PROVISIONAL - USE H5I - USE H5L - USE H5L_PROVISIONAL - USE H5S - USE H5D - USE H5D_PROVISIONAL - USE H5A - USE H5A_PROVISIONAL - USE H5T - USE H5T_PROVISIONAL - USE H5O - USE H5O_PROVISIONAL - USE H5P - USE H5P_PROVISIONAL - USE H5FDMPIO - USE H5R - USE H5R_PROVISIONAL - USE H5Z - USE H5_DBLE_INTERFACE - USE H5LIB -END MODULE HDF5 diff --git a/fortran/src/Makefile.am b/fortran/src/Makefile.am index a4b3843..734f46e 100644 --- a/fortran/src/Makefile.am +++ b/fortran/src/Makefile.am @@ -42,42 +42,13 @@ else AM_LDFLAGS+=-static endif -# Include HDF5.f90 if parallel is disabled, HDF5mpiof* if parallel is enabled -if BUILD_PARALLEL_CONDITIONAL - PARALLEL_COND_SRC = H5FDmpiof.c HDF5mpio.f90 H5FDmpioff.f90 -else - PARALLEL_COND_SRC = HDF5.f90 -endif - -# Check if the compiler supports the Fortran 2003 standard -# which should include the intrinsic module iso_c_binding -if FORTRAN_2003_CONDITIONAL_F - F_STATUS = _F03 -else - F_STATUS = _F90 -endif - -# Condition for including/excluding the DBLE interfaces for when the -# default REAL is of type DOUBLE PRECISION. -# We do not include the double precision interfaces if the defaut REAL is -# DOUBLE PRECISION since this would lead to a non-unique conflict with the -# generic interfaces declared as REAL. -if FORTRAN_DEFAULT_REALisDBLE_F - F_DBLE = Exclude -else - F_DBLE = Include -endif - # Source files for the library. -libhdf5_fortran_la_SOURCES=H5f90global.f90 \ - H5fortran_types.f90 H5_ff$(F_STATUS).f90 H5_ff.f90 H5Aff.f90 H5Dff.f90 H5Eff.f90 \ - H5Fff.f90 H5Gff.f90 H5Iff.f90 H5Lff.f90 H5Off.f90 H5Pff.f90 H5Rff.f90 H5Sff.f90 \ - H5Tff.f90 H5Zff.f90 \ - H5_DBLE_Interface$(F_DBLE).f90 \ +libhdf5_fortran_la_SOURCES=H5f90global.F90 \ + H5fortran_types.F90 H5_ff.F90 H5Aff.F90 H5Dff.F90 H5Eff.F90 \ + H5Fff.F90 H5Gff.F90 H5Iff.F90 H5Lff.F90 H5Off.F90 H5Pff.F90 H5Rff.F90 H5Sff.F90 \ + H5Tff.F90 H5Zff.F90 H5_gen.f90 \ H5f90kit.c H5_f.c H5Af.c H5Df.c H5Ef.c H5Ff.c H5Gf.c \ - H5If.c H5Lf.c H5Of.c H5Pf.c H5Rf.c H5Sf.c H5Tf.c H5Zf.c \ - H5Aff$(F_STATUS).f90 H5Dff$(F_STATUS).f90 H5Eff$(F_STATUS).f90 H5Fff$(F_STATUS).f90 H5Lff$(F_STATUS).f90 \ - H5Off$(F_STATUS).f90 H5Pff$(F_STATUS).f90 H5Rff$(F_STATUS).f90 H5Tff$(F_STATUS).f90 $(PARALLEL_COND_SRC) + H5If.c H5Lf.c H5Of.c H5Pf.c H5Rf.c H5Sf.c H5Tf.c H5Zf.c HDF5.f90 # HDF5 Fortran library depends on HDF5 Library. libhdf5_fortran_la_LIBADD=$(LIBHDF5) @@ -86,11 +57,10 @@ libhdf5_fortran_la_LIBADD=$(LIBHDF5) # Remove it only when distclean. DISTCLEANFILES=h5fc -# H5fortran_types.f90 and H5f90i.h are automatically generaed by +# H5fortran_types.F90 and H5f90i.h are automatically generaed by # H5match_types, and must be cleaned explicitly. H5fort_type_defines.h # is generated by H5fortran_detect -MOSTLYCLEANFILES=H5fortran_types.f90 H5f90i_gen.h H5fort_type_defines.h \ - H5fortran_detect.f90 +MOSTLYCLEANFILES=H5fortran_types.F90 H5f90i_gen.h H5fort_type_defines.h # Fortran module files can have different extensions and different names # (e.g., different capitalizations) on different platforms. Write rules @@ -136,55 +106,35 @@ endif # programs. # It's a bit tricky to make sure that Automake builds things in the right # order (especially when using 'gmake -j ...') -# H5test_kind is compiled and run to produce H5fortran_detect.f90. -# H5fortran_detect is compiled and run to produce H5fort_type_defines.h. -# H5match_types.c then includes this file and can be compiled into +# H5_buildiface is compiled and run to produce H5_gen.F90. +# H5match_types.c then includes H5fort_type_defines.h and can be compiled into # H5match_types. When H5match_types is run, it creates H5f90i_gen.h -# and H5fortran_types.f90, which are included in the Fortran library. +# and H5fortran_types.F90, which are included in the Fortran library. # These are the helper programs we need to build. -noinst_PROGRAMS = H5match_types H5fortran_detect H5test_kind +noinst_PROGRAMS = H5match_types H5_buildiface # Tell Automake to create H5f90i_gen.h before it builds the library # sources. When it creates H5f90i_gen.h, it will create -# H5fortran_types.f90 as a side effect. +# H5fortran_types.F90 as a side effect. BUILT_SOURCES = H5f90i_gen.h #Specify what Automake needs to create: first the H5fort_type_defines.h # header, then H5match_types which includes that header, then # it needs to run H5match_types. -H5fortran_types.f90 H5f90i_gen.h: H5match_types$(EXEEXT) +H5fortran_types.F90 H5f90i_gen.h: H5match_types$(EXEEXT) $(RUNSERIAL) ./H5match_types$(EXEEXT) -# H5fort_type_defines.h is created by running H5fortran_detect. -# Obviously, H5fortran_detect needs to be built first. -H5fort_type_defines.h: H5fortran_detect$(EXEEXT) - $(RUNSERIAL) ./H5fortran_detect$(EXEEXT) > H5fort_type_defines.h - -H5match_types.$(OBJEXT): H5fort_type_defines.h - -# Automake knows how to build fortran programs if we tell it the source -# files. -H5fortran_detect_SOURCES = H5fortran_detect.f90 +# H5_buildiface.F90 generates all the APIs that have a KIND type associated +# with them. -# H5test_kind.f90 generates H5Fortran_detect.f90 depending on if -# intrinsic function SIZEOF is available. +H5_gen.F90: H5_buildiface$(EXEEXT) + $(RUNSERIAL) ./H5_buildiface$(EXEEXT) -H5fortran_detect.f90: H5test_kind$(EXEEXT) - $(RUNSERIAL) ./H5test_kind$(EXEEXT) > H5fortran_detect.f90 - -# H5test_kind.f90 is included in the distribution, and Automake knows +# H5_buildiface.F90 is included in the distribution, and Automake knows # how to compile a fortran program given its sources. -if FORTRAN_HAVE_STORAGE_SIZE - H5test_kind_SOURCES = H5test_kind_STORAGE_SIZE.f90 -else -if FORTRAN_HAVE_SIZEOF - H5test_kind_SOURCES = H5test_kind_SIZEOF.f90 -else - H5test_kind_SOURCES = H5test_kind.f90 -endif -endif +H5_buildiface_SOURCES = H5_buildiface.F90 # Mark this directory as part of the Fortran API FORTRAN_API=yes @@ -193,51 +143,28 @@ FORTRAN_API=yes # determining this automagically (like we do with the C files). So, when # doing a parallel make, some modules could be made way before the # modules they depend upon are actually made. *sigh* -H5f90global.lo: $(srcdir)/H5f90global.f90 H5fortran_types.lo -H5fortran_types.lo: H5fortran_types.f90 -H5fortran_detect.lo: H5fortran_detect.f90 -H5test_kind.lo: $(srcdir)/H5test_kind.f90 -H5test_kind_SIZEOF.lo: $(srcdir)/H5test_kind_SIZEOF.f90 -H5_ff$(F_STATUS).lo: $(srcdir)/H5_ff$(F_STATUS).f90 H5f90global.lo -H5_ff.lo: $(srcdir)/H5_ff.f90 H5f90global.lo H5_ff$(F_STATUS).lo -H5Aff.lo: $(srcdir)/H5Aff.f90 H5f90global.lo -H5Dff.lo: $(srcdir)/H5Dff.f90 H5f90global.lo -H5Aff$(F_STATUS).lo: $(srcdir)/H5Aff$(F_STATUS).f90 H5f90global.lo -H5Dff$(F_STATUS).lo: $(srcdir)/H5Dff$(F_STATUS).f90 H5f90global.lo -H5Eff$(F_STATUS).lo: $(srcdir)/H5Eff$(F_STATUS).f90 H5f90global.lo -H5Fff$(F_STATUS).lo: $(srcdir)/H5Fff$(F_STATUS).f90 H5f90global.lo -H5Lff$(F_STATUS).lo: $(srcdir)/H5Lff$(F_STATUS).f90 H5f90global.lo -H5Off$(F_STATUS).lo: $(srcdir)/H5Off$(F_STATUS).f90 H5f90global.lo -H5Pff$(F_STATUS).lo: $(srcdir)/H5Pff$(F_STATUS).f90 H5f90global.lo -H5Rff$(F_STATUS).lo: $(srcdir)/H5Rff$(F_STATUS).f90 H5f90global.lo -H5Tff$(F_STATUS).lo: $(srcdir)/H5Tff$(F_STATUS).f90 H5f90global.lo -H5Eff.lo: $(srcdir)/H5Eff.f90 H5f90global.lo -H5Fff.lo: $(srcdir)/H5Fff.f90 H5f90global.lo -H5Gff.lo: $(srcdir)/H5Gff.f90 H5f90global.lo -H5Iff.lo: $(srcdir)/H5Iff.f90 H5f90global.lo -H5Lff.lo: $(srcdir)/H5Lff.f90 H5f90global.lo -H5Off.lo: $(srcdir)/H5Off.f90 H5f90global.lo -H5Pff.lo: $(srcdir)/H5Pff.f90 H5f90global.lo -H5Rff.lo: $(srcdir)/H5Rff.f90 H5f90global.lo -H5Sff.lo: $(srcdir)/H5Sff.f90 H5f90global.lo -H5Tff.lo: $(srcdir)/H5Tff.f90 H5f90global.lo -H5Zff.lo: $(srcdir)/H5Zff.f90 H5f90global.lo -H5_DBLE_Interface$(F_DBLE).lo: $(srcdir)/H5_DBLE_Interface$(F_DBLE).f90 H5Aff$(F_STATUS).lo H5Dff$(F_STATUS).lo H5Fff$(F_STATUS).lo H5Eff$(F_STATUS).lo H5Pff$(F_STATUS).lo -HDF5.lo: $(srcdir)/HDF5.f90 H5f90global.lo H5_ff$(F_STATUS).lo H5_ff.lo H5Aff.lo H5Aff$(F_STATUS).lo \ - H5Dff.lo H5Dff$(F_STATUS).lo \ - H5Eff.lo H5Eff$(F_STATUS).lo \ - H5Fff.lo H5Fff$(F_STATUS).lo H5Gff.lo H5Iff.lo H5Lff.lo H5Lff$(F_STATUS).lo \ - H5Off.lo H5Off$(F_STATUS).lo H5Pff.lo H5Pff$(F_STATUS).lo H5Rff$(F_STATUS).lo H5Rff.lo \ - H5Sff.lo H5Tff.lo H5Tff$(F_STATUS).lo H5Zff.lo \ - H5_DBLE_Interface$(F_DBLE).lo -H5FDmpioff.lo: $(srcdir)/H5FDmpioff.f90 H5f90global.lo -HDF5mpio.lo: $(srcdir)/H5FDmpioff.f90 H5f90global.lo H5_ff$(F_STATUS).lo H5_ff.lo \ - H5Aff.lo H5Aff$(F_STATUS).lo \ - H5Dff.lo H5Dff$(F_STATUS).lo \ - H5Eff.lo H5Eff$(F_STATUS).lo \ - H5Fff.lo H5Fff$(F_STATUS).lo H5Gff.lo H5Iff.lo H5Lff.lo H5Lff$(F_STATUS).lo \ - H5Off.lo H5Off$(F_STATUS).lo H5Pff.lo H5Pff$(F_STATUS).lo H5Rff$(F_STATUS).lo H5Rff.lo \ - H5Sff.lo H5Tff.lo H5Tff$(F_STATUS).lo H5Zff.lo \ - H5_DBLE_Interface$(F_DBLE).lo H5FDmpioff.lo +H5f90global.lo: $(srcdir)/H5f90global.F90 H5fortran_types.lo +H5_buildiface.lo: $(srcdir)/H5_buildiface.F90 +H5_ff.lo: $(srcdir)/H5_ff.F90 H5f90global.lo +H5Aff.lo: $(srcdir)/H5Aff.F90 H5f90global.lo +H5Dff.lo: $(srcdir)/H5Dff.F90 H5f90global.lo +H5Eff.lo: $(srcdir)/H5Eff.F90 H5f90global.lo +H5Fff.lo: $(srcdir)/H5Fff.F90 H5f90global.lo +H5Gff.lo: $(srcdir)/H5Gff.F90 H5f90global.lo +H5Iff.lo: $(srcdir)/H5Iff.F90 H5f90global.lo +H5Lff.lo: $(srcdir)/H5Lff.F90 H5f90global.lo +H5Off.lo: $(srcdir)/H5Off.F90 H5f90global.lo +H5Pff.lo: $(srcdir)/H5Pff.F90 H5f90global.lo +H5Rff.lo: $(srcdir)/H5Rff.F90 H5f90global.lo +H5Sff.lo: $(srcdir)/H5Sff.F90 H5f90global.lo +H5Tff.lo: $(srcdir)/H5Tff.F90 H5f90global.lo +H5Zff.lo: $(srcdir)/H5Zff.F90 H5f90global.lo +H5_gen.lo: H5_gen.F90 H5f90global.lo H5Aff.lo H5Dff.lo H5Pff.lo +HDF5.lo: $(srcdir)/HDF5.F90 H5f90global.lo H5_ff.lo H5Aff.lo \ + H5Dff.lo \ + H5Eff.lo \ + H5Fff.lo H5Gff.lo H5Iff.lo H5Lff.lo \ + H5Off.lo H5Pff.lo H5Rff.lo \ + H5Sff.lo H5Tff.lo H5Zff.lo H5_gen.lo include $(top_srcdir)/config/conclude.am diff --git a/fortran/src/Makefile.in b/fortran/src/Makefile.in index aba85ec..9a1ce4f 100644 --- a/fortran/src/Makefile.in +++ b/fortran/src/Makefile.in @@ -99,16 +99,16 @@ host_triplet = @host@ DIST_COMMON = $(top_srcdir)/config/commence.am \ $(top_srcdir)/config/lt_vers.am \ $(top_srcdir)/config/conclude.am $(srcdir)/Makefile.in \ - $(srcdir)/Makefile.am $(top_srcdir)/bin/mkinstalldirs \ - $(srcdir)/h5fc.in $(top_srcdir)/bin/depcomp \ + $(srcdir)/Makefile.am $(srcdir)/H5config_f.inc.in \ + $(top_srcdir)/bin/mkinstalldirs $(srcdir)/h5fc.in \ + $(srcdir)/H5fort_type_defines.h.in $(top_srcdir)/bin/depcomp \ $(top_srcdir)/bin/test-driver README # Some Fortran compilers can't build shared libraries, so sometimes we # want to build a shared C library and a static Fortran library. If so, # pass the -static flag to the library linker. @FORTRAN_SHARED_CONDITIONAL_FALSE@am__append_1 = -static -noinst_PROGRAMS = H5match_types$(EXEEXT) H5fortran_detect$(EXEEXT) \ - H5test_kind$(EXEEXT) +noinst_PROGRAMS = H5match_types$(EXEEXT) H5_buildiface$(EXEEXT) TESTS = subdir = fortran/src ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 @@ -117,8 +117,8 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/aclocal_cxx.m4 \ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/bin/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/src/H5config.h -CONFIG_CLEAN_FILES = h5fc +CONFIG_HEADER = $(top_builddir)/src/H5config.h H5config_f.inc +CONFIG_CLEAN_FILES = h5fc H5fort_type_defines.h CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ @@ -150,30 +150,12 @@ am__uninstall_files_from_dir = { \ am__installdirs = "$(DESTDIR)$(libdir)" LTLIBRARIES = $(lib_LTLIBRARIES) libhdf5_fortran_la_DEPENDENCIES = $(LIBHDF5) -am__libhdf5_fortran_la_SOURCES_DIST = H5f90global.f90 \ - H5fortran_types.f90 H5_ff$(F_STATUS).f90 H5_ff.f90 H5Aff.f90 \ - H5Dff.f90 H5Eff.f90 H5Fff.f90 H5Gff.f90 H5Iff.f90 H5Lff.f90 \ - H5Off.f90 H5Pff.f90 H5Rff.f90 H5Sff.f90 H5Tff.f90 H5Zff.f90 \ - H5_DBLE_Interface$(F_DBLE).f90 H5f90kit.c H5_f.c H5Af.c H5Df.c \ - H5Ef.c H5Ff.c H5Gf.c H5If.c H5Lf.c H5Of.c H5Pf.c H5Rf.c H5Sf.c \ - H5Tf.c H5Zf.c H5Aff$(F_STATUS).f90 H5Dff$(F_STATUS).f90 \ - H5Eff$(F_STATUS).f90 H5Fff$(F_STATUS).f90 H5Lff$(F_STATUS).f90 \ - H5Off$(F_STATUS).f90 H5Pff$(F_STATUS).f90 H5Rff$(F_STATUS).f90 \ - H5Tff$(F_STATUS).f90 HDF5.f90 H5FDmpiof.c HDF5mpio.f90 \ - H5FDmpioff.f90 -@BUILD_PARALLEL_CONDITIONAL_FALSE@am__objects_1 = HDF5.lo -@BUILD_PARALLEL_CONDITIONAL_TRUE@am__objects_1 = H5FDmpiof.lo \ -@BUILD_PARALLEL_CONDITIONAL_TRUE@ HDF5mpio.lo H5FDmpioff.lo am_libhdf5_fortran_la_OBJECTS = H5f90global.lo H5fortran_types.lo \ - H5_ff$(F_STATUS).lo H5_ff.lo H5Aff.lo H5Dff.lo H5Eff.lo \ - H5Fff.lo H5Gff.lo H5Iff.lo H5Lff.lo H5Off.lo H5Pff.lo H5Rff.lo \ - H5Sff.lo H5Tff.lo H5Zff.lo H5_DBLE_Interface$(F_DBLE).lo \ - H5f90kit.lo H5_f.lo H5Af.lo H5Df.lo H5Ef.lo H5Ff.lo H5Gf.lo \ - H5If.lo H5Lf.lo H5Of.lo H5Pf.lo H5Rf.lo H5Sf.lo H5Tf.lo \ - H5Zf.lo H5Aff$(F_STATUS).lo H5Dff$(F_STATUS).lo \ - H5Eff$(F_STATUS).lo H5Fff$(F_STATUS).lo H5Lff$(F_STATUS).lo \ - H5Off$(F_STATUS).lo H5Pff$(F_STATUS).lo H5Rff$(F_STATUS).lo \ - H5Tff$(F_STATUS).lo $(am__objects_1) + H5_ff.lo H5Aff.lo H5Dff.lo H5Eff.lo H5Fff.lo H5Gff.lo H5Iff.lo \ + H5Lff.lo H5Off.lo H5Pff.lo H5Rff.lo H5Sff.lo H5Tff.lo H5Zff.lo \ + H5_gen.lo H5f90kit.lo H5_f.lo H5Af.lo H5Df.lo H5Ef.lo H5Ff.lo \ + H5Gf.lo H5If.lo H5Lf.lo H5Of.lo H5Pf.lo H5Rf.lo H5Sf.lo \ + H5Tf.lo H5Zf.lo HDF5.lo libhdf5_fortran_la_OBJECTS = $(am_libhdf5_fortran_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) @@ -184,19 +166,12 @@ libhdf5_fortran_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=FC \ $(AM_FCFLAGS) $(FCFLAGS) $(libhdf5_fortran_la_LDFLAGS) \ $(LDFLAGS) -o $@ PROGRAMS = $(noinst_PROGRAMS) -am_H5fortran_detect_OBJECTS = H5fortran_detect.$(OBJEXT) -H5fortran_detect_OBJECTS = $(am_H5fortran_detect_OBJECTS) -H5fortran_detect_LDADD = $(LDADD) +am_H5_buildiface_OBJECTS = H5_buildiface.$(OBJEXT) +H5_buildiface_OBJECTS = $(am_H5_buildiface_OBJECTS) +H5_buildiface_LDADD = $(LDADD) H5match_types_SOURCES = H5match_types.c H5match_types_OBJECTS = H5match_types.$(OBJEXT) H5match_types_LDADD = $(LDADD) -am__H5test_kind_SOURCES_DIST = H5test_kind.f90 H5test_kind_SIZEOF.f90 \ - H5test_kind_STORAGE_SIZE.f90 -@FORTRAN_HAVE_SIZEOF_FALSE@@FORTRAN_HAVE_STORAGE_SIZE_FALSE@am_H5test_kind_OBJECTS = H5test_kind.$(OBJEXT) -@FORTRAN_HAVE_SIZEOF_TRUE@@FORTRAN_HAVE_STORAGE_SIZE_FALSE@am_H5test_kind_OBJECTS = H5test_kind_SIZEOF.$(OBJEXT) -@FORTRAN_HAVE_STORAGE_SIZE_TRUE@am_H5test_kind_OBJECTS = H5test_kind_STORAGE_SIZE.$(OBJEXT) -H5test_kind_OBJECTS = $(am_H5test_kind_OBJECTS) -H5test_kind_LDADD = $(LDADD) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false @@ -213,6 +188,24 @@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src depcomp = $(SHELL) $(top_srcdir)/bin/depcomp am__depfiles_maybe = depfiles am__mv = mv -f +PPFCCOMPILE = $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) +LTPPFCCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=FC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_FCFLAGS) $(FCFLAGS) +AM_V_PPFC = $(am__v_PPFC_@AM_V@) +am__v_PPFC_ = $(am__v_PPFC_@AM_DEFAULT_V@) +am__v_PPFC_0 = @echo " PPFC " $@; +am__v_PPFC_1 = +FCLD = $(FC) +FCLINK = $(LIBTOOL) $(AM_V_lt) --tag=FC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(FCLD) $(AM_FCFLAGS) $(FCFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_FCLD = $(am__v_FCLD_@AM_V@) +am__v_FCLD_ = $(am__v_FCLD_@AM_DEFAULT_V@) +am__v_FCLD_0 = @echo " FCLD " $@; +am__v_FCLD_1 = COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ @@ -238,25 +231,17 @@ AM_V_FC = $(am__v_FC_@AM_V@) am__v_FC_ = $(am__v_FC_@AM_DEFAULT_V@) am__v_FC_0 = @echo " FC " $@; am__v_FC_1 = -FCLD = $(FC) -FCLINK = $(LIBTOOL) $(AM_V_lt) --tag=FC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(FCLD) $(AM_FCFLAGS) $(FCFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_FCLD = $(am__v_FCLD_@AM_V@) -am__v_FCLD_ = $(am__v_FCLD_@AM_DEFAULT_V@) -am__v_FCLD_0 = @echo " FCLD " $@; -am__v_FCLD_1 = -SOURCES = $(libhdf5_fortran_la_SOURCES) $(H5fortran_detect_SOURCES) \ - H5match_types.c $(H5test_kind_SOURCES) -DIST_SOURCES = $(am__libhdf5_fortran_la_SOURCES_DIST) \ - $(H5fortran_detect_SOURCES) H5match_types.c \ - $(am__H5test_kind_SOURCES_DIST) +SOURCES = $(libhdf5_fortran_la_SOURCES) $(H5_buildiface_SOURCES) \ + H5match_types.c +DIST_SOURCES = $(libhdf5_fortran_la_SOURCES) $(H5_buildiface_SOURCES) \ + H5match_types.c am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac -am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ + $(LISP)H5config_f.inc.in # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. @@ -513,14 +498,21 @@ F9XMODEXT = @F9XMODEXT@ F9XMODFLAG = @F9XMODFLAG@ F9XSUFFIXFLAG = @F9XSUFFIXFLAG@ FC = @FC@ -FC2003 = @FC2003@ FCFLAGS = @FCFLAGS@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ +FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ +FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ +FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ +H5CONFIG_F_IKIND = @H5CONFIG_F_IKIND@ +H5CONFIG_F_NUM_IKIND = @H5CONFIG_F_NUM_IKIND@ +H5CONFIG_F_NUM_RKIND = @H5CONFIG_F_NUM_RKIND@ +H5CONFIG_F_RKIND = @H5CONFIG_F_RKIND@ +H5CONFIG_F_RKIND_SIZEOF = @H5CONFIG_F_RKIND_SIZEOF@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ @@ -530,13 +522,12 @@ H5_LDFLAGS = @H5_LDFLAGS@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ -HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_Fortran_INTEGER_SIZEOF_16 = @HAVE_Fortran_INTEGER_SIZEOF_16@ HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ HDF_FORTRAN = @HDF_FORTRAN@ -HDF_FORTRAN2003 = @HDF_FORTRAN2003@ HID_T = @HID_T@ HL = @HL@ HL_FOR = @HL_FOR@ @@ -578,6 +569,18 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PAC_C_MAX_REAL_PRECISION = @PAC_C_MAX_REAL_PRECISION@ +PAC_FC_ALL_INTEGER_KINDS = @PAC_FC_ALL_INTEGER_KINDS@ +PAC_FC_ALL_INTEGER_KINDS_SIZEOF = @PAC_FC_ALL_INTEGER_KINDS_SIZEOF@ +PAC_FC_ALL_REAL_KINDS = @PAC_FC_ALL_REAL_KINDS@ +PAC_FC_ALL_REAL_KINDS_SIZEOF = @PAC_FC_ALL_REAL_KINDS_SIZEOF@ +PAC_FC_MAX_REAL_PRECISION = @PAC_FC_MAX_REAL_PRECISION@ +PAC_FORTRAN_NATIVE_DOUBLE_KIND = @PAC_FORTRAN_NATIVE_DOUBLE_KIND@ +PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF = @PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF@ +PAC_FORTRAN_NATIVE_INTEGER_KIND = @PAC_FORTRAN_NATIVE_INTEGER_KIND@ +PAC_FORTRAN_NATIVE_INTEGER_SIZEOF = @PAC_FORTRAN_NATIVE_INTEGER_SIZEOF@ +PAC_FORTRAN_NATIVE_REAL_KIND = @PAC_FORTRAN_NATIVE_REAL_KIND@ +PAC_FORTRAN_NATIVE_REAL_SIZEOF = @PAC_FORTRAN_NATIVE_REAL_SIZEOF@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ @@ -733,34 +736,14 @@ lib_LTLIBRARIES = libhdf5_fortran.la # Add libtool numbers to the HDF5 Fortran library (from config/lt_vers.am) libhdf5_fortran_la_LDFLAGS = -version-info $(LT_VERS_INTERFACE):$(LT_VERS_REVISION):$(LT_VERS_AGE) $(AM_LDFLAGS) -@BUILD_PARALLEL_CONDITIONAL_FALSE@PARALLEL_COND_SRC = HDF5.f90 - -# Include HDF5.f90 if parallel is disabled, HDF5mpiof* if parallel is enabled -@BUILD_PARALLEL_CONDITIONAL_TRUE@PARALLEL_COND_SRC = H5FDmpiof.c HDF5mpio.f90 H5FDmpioff.f90 -@FORTRAN_2003_CONDITIONAL_F_FALSE@F_STATUS = _F90 - -# Check if the compiler supports the Fortran 2003 standard -# which should include the intrinsic module iso_c_binding -@FORTRAN_2003_CONDITIONAL_F_TRUE@F_STATUS = _F03 -@FORTRAN_DEFAULT_REALisDBLE_F_FALSE@F_DBLE = Include - -# Condition for including/excluding the DBLE interfaces for when the -# default REAL is of type DOUBLE PRECISION. -# We do not include the double precision interfaces if the defaut REAL is -# DOUBLE PRECISION since this would lead to a non-unique conflict with the -# generic interfaces declared as REAL. -@FORTRAN_DEFAULT_REALisDBLE_F_TRUE@F_DBLE = Exclude # Source files for the library. -libhdf5_fortran_la_SOURCES = H5f90global.f90 \ - H5fortran_types.f90 H5_ff$(F_STATUS).f90 H5_ff.f90 H5Aff.f90 H5Dff.f90 H5Eff.f90 \ - H5Fff.f90 H5Gff.f90 H5Iff.f90 H5Lff.f90 H5Off.f90 H5Pff.f90 H5Rff.f90 H5Sff.f90 \ - H5Tff.f90 H5Zff.f90 \ - H5_DBLE_Interface$(F_DBLE).f90 \ +libhdf5_fortran_la_SOURCES = H5f90global.F90 \ + H5fortran_types.F90 H5_ff.F90 H5Aff.F90 H5Dff.F90 H5Eff.F90 \ + H5Fff.F90 H5Gff.F90 H5Iff.F90 H5Lff.F90 H5Off.F90 H5Pff.F90 H5Rff.F90 H5Sff.F90 \ + H5Tff.F90 H5Zff.F90 H5_gen.f90 \ H5f90kit.c H5_f.c H5Af.c H5Df.c H5Ef.c H5Ff.c H5Gf.c \ - H5If.c H5Lf.c H5Of.c H5Pf.c H5Rf.c H5Sf.c H5Tf.c H5Zf.c \ - H5Aff$(F_STATUS).f90 H5Dff$(F_STATUS).f90 H5Eff$(F_STATUS).f90 H5Fff$(F_STATUS).f90 H5Lff$(F_STATUS).f90 \ - H5Off$(F_STATUS).f90 H5Pff$(F_STATUS).f90 H5Rff$(F_STATUS).f90 H5Tff$(F_STATUS).f90 $(PARALLEL_COND_SRC) + H5If.c H5Lf.c H5Of.c H5Pf.c H5Rf.c H5Sf.c H5Tf.c H5Zf.c HDF5.f90 # HDF5 Fortran library depends on HDF5 Library. @@ -770,12 +753,10 @@ libhdf5_fortran_la_LIBADD = $(LIBHDF5) # Remove it only when distclean. DISTCLEANFILES = h5fc -# H5fortran_types.f90 and H5f90i.h are automatically generaed by +# H5fortran_types.F90 and H5f90i.h are automatically generaed by # H5match_types, and must be cleaned explicitly. H5fort_type_defines.h # is generated by H5fortran_detect -MOSTLYCLEANFILES = H5fortran_types.f90 H5f90i_gen.h H5fort_type_defines.h \ - H5fortran_detect.f90 - +MOSTLYCLEANFILES = H5fortran_types.F90 H5f90i_gen.h H5fort_type_defines.h @BUILD_PARALLEL_CONDITIONAL_FALSE@H5FC_NAME = h5fc # Custom rule for installing h5fc, since it will be named h5pfc if hdf5 @@ -784,18 +765,12 @@ MOSTLYCLEANFILES = H5fortran_types.f90 H5f90i_gen.h H5fort_type_defines.h \ # Tell Automake to create H5f90i_gen.h before it builds the library # sources. When it creates H5f90i_gen.h, it will create -# H5fortran_types.f90 as a side effect. +# H5fortran_types.F90 as a side effect. BUILT_SOURCES = H5f90i_gen.h -# Automake knows how to build fortran programs if we tell it the source -# files. -H5fortran_detect_SOURCES = H5fortran_detect.f90 -@FORTRAN_HAVE_SIZEOF_FALSE@@FORTRAN_HAVE_STORAGE_SIZE_FALSE@H5test_kind_SOURCES = H5test_kind.f90 -@FORTRAN_HAVE_SIZEOF_TRUE@@FORTRAN_HAVE_STORAGE_SIZE_FALSE@H5test_kind_SOURCES = H5test_kind_SIZEOF.f90 - -# H5test_kind.f90 is included in the distribution, and Automake knows +# H5_buildiface.F90 is included in the distribution, and Automake knows # how to compile a fortran program given its sources. -@FORTRAN_HAVE_STORAGE_SIZE_TRUE@H5test_kind_SOURCES = H5test_kind_STORAGE_SIZE.f90 +H5_buildiface_SOURCES = H5_buildiface.F90 # Mark this directory as part of the Fortran API FORTRAN_API = yes @@ -819,11 +794,11 @@ TEST_PROG_CHKEXE = $(TEST_PROG:=.chkexe_) TEST_PROG_PARA_CHKEXE = $(TEST_PROG_PARA:=.chkexe_) TEST_SCRIPT_CHKSH = $(TEST_SCRIPT:=.chkexe_) TEST_SCRIPT_PARA_CHKSH = $(TEST_SCRIPT_PARA:=.chkexe_) -all: $(BUILT_SOURCES) +all: $(BUILT_SOURCES) H5config_f.inc $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: -.SUFFIXES: .c .f90 .lo .log .o .obj .sh .sh$(EXEEXT) .trs +.SUFFIXES: .F90 .c .f90 .lo .log .o .obj .sh .sh$(EXEEXT) .trs $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/config/commence.am $(top_srcdir)/config/lt_vers.am $(top_srcdir)/config/conclude.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ @@ -855,8 +830,21 @@ $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): + +H5config_f.inc: stamp-h2 + @test -f $@ || rm -f stamp-h2 + @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h2 + +stamp-h2: $(srcdir)/H5config_f.inc.in $(top_builddir)/config.status + @rm -f stamp-h2 + cd $(top_builddir) && $(SHELL) ./config.status fortran/src/H5config_f.inc + +distclean-hdr: + -rm -f H5config_f.inc stamp-h2 h5fc: $(top_builddir)/config.status $(srcdir)/h5fc.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ +H5fort_type_defines.h: $(top_builddir)/config.status $(srcdir)/H5fort_type_defines.h.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) @@ -905,18 +893,14 @@ clean-noinstPROGRAMS: echo " rm -f" $$list; \ rm -f $$list -H5fortran_detect$(EXEEXT): $(H5fortran_detect_OBJECTS) $(H5fortran_detect_DEPENDENCIES) $(EXTRA_H5fortran_detect_DEPENDENCIES) - @rm -f H5fortran_detect$(EXEEXT) - $(AM_V_FCLD)$(FCLINK) $(H5fortran_detect_OBJECTS) $(H5fortran_detect_LDADD) $(LIBS) +H5_buildiface$(EXEEXT): $(H5_buildiface_OBJECTS) $(H5_buildiface_DEPENDENCIES) $(EXTRA_H5_buildiface_DEPENDENCIES) + @rm -f H5_buildiface$(EXEEXT) + $(AM_V_FCLD)$(FCLINK) $(H5_buildiface_OBJECTS) $(H5_buildiface_LDADD) $(LIBS) H5match_types$(EXEEXT): $(H5match_types_OBJECTS) $(H5match_types_DEPENDENCIES) $(EXTRA_H5match_types_DEPENDENCIES) @rm -f H5match_types$(EXEEXT) $(AM_V_CCLD)$(LINK) $(H5match_types_OBJECTS) $(H5match_types_LDADD) $(LIBS) -H5test_kind$(EXEEXT): $(H5test_kind_OBJECTS) $(H5test_kind_DEPENDENCIES) $(EXTRA_H5test_kind_DEPENDENCIES) - @rm -f H5test_kind$(EXEEXT) - $(AM_V_FCLD)$(FCLINK) $(H5test_kind_OBJECTS) $(H5test_kind_LDADD) $(LIBS) - mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -926,7 +910,6 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5Af.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5Df.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5Ef.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5FDmpiof.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5Ff.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5Gf.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5If.Plo@am__quote@ @@ -941,6 +924,15 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5f90kit.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5match_types.Po@am__quote@ +.F90.o: + $(AM_V_PPFC)$(PPFCCOMPILE) -c -o $@ $< + +.F90.obj: + $(AM_V_PPFC)$(PPFCCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.F90.lo: + $(AM_V_PPFC)$(LTPPFCCOMPILE) -c -o $@ $< + .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @@ -1208,7 +1200,7 @@ check-am: all-am $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-am -all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) all-local +all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) H5config_f.inc all-local installdirs: for dir in "$(DESTDIR)$(libdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ @@ -1259,7 +1251,7 @@ distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ - distclean-local distclean-tags + distclean-hdr distclean-local distclean-tags dvi: dvi-am @@ -1328,14 +1320,14 @@ uninstall-am: uninstall-libLTLIBRARIES uninstall-local check-am clean clean-generic clean-libLTLIBRARIES \ clean-libtool clean-local clean-noinstPROGRAMS cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ - distclean-libtool distclean-local distclean-tags distdir dvi \ - dvi-am html html-am info info-am install install-am \ - install-data install-data-am install-data-local install-dvi \ - install-dvi-am install-exec install-exec-am install-exec-local \ - install-html install-html-am install-info install-info-am \ - install-libLTLIBRARIES install-man install-pdf install-pdf-am \ - install-ps install-ps-am install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ + distclean-hdr distclean-libtool distclean-local distclean-tags \ + distdir dvi dvi-am html html-am info info-am install \ + install-am install-data install-data-am install-data-local \ + install-dvi install-dvi-am install-exec install-exec-am \ + install-exec-local install-html install-html-am install-info \ + install-info-am install-libLTLIBRARIES install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic maintainer-clean-local mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ mostlyclean-local pdf pdf-am ps ps-am recheck tags tags-am \ @@ -1401,72 +1393,42 @@ install-exec-local: #Specify what Automake needs to create: first the H5fort_type_defines.h # header, then H5match_types which includes that header, then # it needs to run H5match_types. -H5fortran_types.f90 H5f90i_gen.h: H5match_types$(EXEEXT) +H5fortran_types.F90 H5f90i_gen.h: H5match_types$(EXEEXT) $(RUNSERIAL) ./H5match_types$(EXEEXT) -# H5fort_type_defines.h is created by running H5fortran_detect. -# Obviously, H5fortran_detect needs to be built first. -H5fort_type_defines.h: H5fortran_detect$(EXEEXT) - $(RUNSERIAL) ./H5fortran_detect$(EXEEXT) > H5fort_type_defines.h - -H5match_types.$(OBJEXT): H5fort_type_defines.h - -# H5test_kind.f90 generates H5Fortran_detect.f90 depending on if -# intrinsic function SIZEOF is available. +# H5_buildiface.F90 generates all the APIs that have a KIND type associated +# with them. -H5fortran_detect.f90: H5test_kind$(EXEEXT) - $(RUNSERIAL) ./H5test_kind$(EXEEXT) > H5fortran_detect.f90 +H5_gen.F90: H5_buildiface$(EXEEXT) + $(RUNSERIAL) ./H5_buildiface$(EXEEXT) # Hardcode the dependencies of these files. There isn't a known way of # determining this automagically (like we do with the C files). So, when # doing a parallel make, some modules could be made way before the # modules they depend upon are actually made. *sigh* -H5f90global.lo: $(srcdir)/H5f90global.f90 H5fortran_types.lo -H5fortran_types.lo: H5fortran_types.f90 -H5fortran_detect.lo: H5fortran_detect.f90 -H5test_kind.lo: $(srcdir)/H5test_kind.f90 -H5test_kind_SIZEOF.lo: $(srcdir)/H5test_kind_SIZEOF.f90 -H5_ff$(F_STATUS).lo: $(srcdir)/H5_ff$(F_STATUS).f90 H5f90global.lo -H5_ff.lo: $(srcdir)/H5_ff.f90 H5f90global.lo H5_ff$(F_STATUS).lo -H5Aff.lo: $(srcdir)/H5Aff.f90 H5f90global.lo -H5Dff.lo: $(srcdir)/H5Dff.f90 H5f90global.lo -H5Aff$(F_STATUS).lo: $(srcdir)/H5Aff$(F_STATUS).f90 H5f90global.lo -H5Dff$(F_STATUS).lo: $(srcdir)/H5Dff$(F_STATUS).f90 H5f90global.lo -H5Eff$(F_STATUS).lo: $(srcdir)/H5Eff$(F_STATUS).f90 H5f90global.lo -H5Fff$(F_STATUS).lo: $(srcdir)/H5Fff$(F_STATUS).f90 H5f90global.lo -H5Lff$(F_STATUS).lo: $(srcdir)/H5Lff$(F_STATUS).f90 H5f90global.lo -H5Off$(F_STATUS).lo: $(srcdir)/H5Off$(F_STATUS).f90 H5f90global.lo -H5Pff$(F_STATUS).lo: $(srcdir)/H5Pff$(F_STATUS).f90 H5f90global.lo -H5Rff$(F_STATUS).lo: $(srcdir)/H5Rff$(F_STATUS).f90 H5f90global.lo -H5Tff$(F_STATUS).lo: $(srcdir)/H5Tff$(F_STATUS).f90 H5f90global.lo -H5Eff.lo: $(srcdir)/H5Eff.f90 H5f90global.lo -H5Fff.lo: $(srcdir)/H5Fff.f90 H5f90global.lo -H5Gff.lo: $(srcdir)/H5Gff.f90 H5f90global.lo -H5Iff.lo: $(srcdir)/H5Iff.f90 H5f90global.lo -H5Lff.lo: $(srcdir)/H5Lff.f90 H5f90global.lo -H5Off.lo: $(srcdir)/H5Off.f90 H5f90global.lo -H5Pff.lo: $(srcdir)/H5Pff.f90 H5f90global.lo -H5Rff.lo: $(srcdir)/H5Rff.f90 H5f90global.lo -H5Sff.lo: $(srcdir)/H5Sff.f90 H5f90global.lo -H5Tff.lo: $(srcdir)/H5Tff.f90 H5f90global.lo -H5Zff.lo: $(srcdir)/H5Zff.f90 H5f90global.lo -H5_DBLE_Interface$(F_DBLE).lo: $(srcdir)/H5_DBLE_Interface$(F_DBLE).f90 H5Aff$(F_STATUS).lo H5Dff$(F_STATUS).lo H5Fff$(F_STATUS).lo H5Eff$(F_STATUS).lo H5Pff$(F_STATUS).lo -HDF5.lo: $(srcdir)/HDF5.f90 H5f90global.lo H5_ff$(F_STATUS).lo H5_ff.lo H5Aff.lo H5Aff$(F_STATUS).lo \ - H5Dff.lo H5Dff$(F_STATUS).lo \ - H5Eff.lo H5Eff$(F_STATUS).lo \ - H5Fff.lo H5Fff$(F_STATUS).lo H5Gff.lo H5Iff.lo H5Lff.lo H5Lff$(F_STATUS).lo \ - H5Off.lo H5Off$(F_STATUS).lo H5Pff.lo H5Pff$(F_STATUS).lo H5Rff$(F_STATUS).lo H5Rff.lo \ - H5Sff.lo H5Tff.lo H5Tff$(F_STATUS).lo H5Zff.lo \ - H5_DBLE_Interface$(F_DBLE).lo -H5FDmpioff.lo: $(srcdir)/H5FDmpioff.f90 H5f90global.lo -HDF5mpio.lo: $(srcdir)/H5FDmpioff.f90 H5f90global.lo H5_ff$(F_STATUS).lo H5_ff.lo \ - H5Aff.lo H5Aff$(F_STATUS).lo \ - H5Dff.lo H5Dff$(F_STATUS).lo \ - H5Eff.lo H5Eff$(F_STATUS).lo \ - H5Fff.lo H5Fff$(F_STATUS).lo H5Gff.lo H5Iff.lo H5Lff.lo H5Lff$(F_STATUS).lo \ - H5Off.lo H5Off$(F_STATUS).lo H5Pff.lo H5Pff$(F_STATUS).lo H5Rff$(F_STATUS).lo H5Rff.lo \ - H5Sff.lo H5Tff.lo H5Tff$(F_STATUS).lo H5Zff.lo \ - H5_DBLE_Interface$(F_DBLE).lo H5FDmpioff.lo +H5f90global.lo: $(srcdir)/H5f90global.F90 H5fortran_types.lo +H5_buildiface.lo: $(srcdir)/H5_buildiface.F90 +H5_ff.lo: $(srcdir)/H5_ff.F90 H5f90global.lo +H5Aff.lo: $(srcdir)/H5Aff.F90 H5f90global.lo +H5Dff.lo: $(srcdir)/H5Dff.F90 H5f90global.lo +H5Eff.lo: $(srcdir)/H5Eff.F90 H5f90global.lo +H5Fff.lo: $(srcdir)/H5Fff.F90 H5f90global.lo +H5Gff.lo: $(srcdir)/H5Gff.F90 H5f90global.lo +H5Iff.lo: $(srcdir)/H5Iff.F90 H5f90global.lo +H5Lff.lo: $(srcdir)/H5Lff.F90 H5f90global.lo +H5Off.lo: $(srcdir)/H5Off.F90 H5f90global.lo +H5Pff.lo: $(srcdir)/H5Pff.F90 H5f90global.lo +H5Rff.lo: $(srcdir)/H5Rff.F90 H5f90global.lo +H5Sff.lo: $(srcdir)/H5Sff.F90 H5f90global.lo +H5Tff.lo: $(srcdir)/H5Tff.F90 H5f90global.lo +H5Zff.lo: $(srcdir)/H5Zff.F90 H5f90global.lo +H5_gen.lo: H5_gen.F90 H5f90global.lo H5Aff.lo H5Dff.lo H5Pff.lo +HDF5.lo: $(srcdir)/HDF5.F90 H5f90global.lo H5_ff.lo H5Aff.lo \ + H5Dff.lo \ + H5Eff.lo \ + H5Fff.lo H5Gff.lo H5Iff.lo H5Lff.lo \ + H5Off.lo H5Pff.lo H5Rff.lo \ + H5Sff.lo H5Tff.lo H5Zff.lo H5_gen.lo # lib/progs/tests targets recurse into subdirectories. build-* targets # build files in this directory. diff --git a/fortran/src/hdf5_fortrandll.def.in b/fortran/src/hdf5_fortrandll.def.in index 48fb343..7b218ca 100644 --- a/fortran/src/hdf5_fortrandll.def.in +++ b/fortran/src/hdf5_fortrandll.def.in @@ -7,99 +7,13 @@ H5LIB_mp_H5CHECK_VERSION_F H5LIB_mp_H5GARBAGE_COLLECT_F H5LIB_mp_H5DONT_ATEXIT_F H5LIB_mp_H5KIND_TO_TYPE -@H5_NOF03EXP@H5LIB_PROVISIONAL_mp_H5OFFSETOF -; H5_DBLE_INTERFACE -H5_DBLE_INTERFACE_mp_H5AREAD_DOUBLE_SCALAR -H5_DBLE_INTERFACE_mp_H5AREAD_DOUBLE_1 -H5_DBLE_INTERFACE_mp_H5AREAD_DOUBLE_2 -H5_DBLE_INTERFACE_mp_H5AREAD_DOUBLE_3 -H5_DBLE_INTERFACE_mp_H5AREAD_DOUBLE_4 -H5_DBLE_INTERFACE_mp_H5AREAD_DOUBLE_5 -H5_DBLE_INTERFACE_mp_H5AREAD_DOUBLE_6 -H5_DBLE_INTERFACE_mp_H5AREAD_DOUBLE_7 -H5_DBLE_INTERFACE_mp_H5AWRITE_DOUBLE_SCALAR -H5_DBLE_INTERFACE_mp_H5AWRITE_DOUBLE_1 -H5_DBLE_INTERFACE_mp_H5AWRITE_DOUBLE_2 -H5_DBLE_INTERFACE_mp_H5AWRITE_DOUBLE_3 -H5_DBLE_INTERFACE_mp_H5AWRITE_DOUBLE_4 -H5_DBLE_INTERFACE_mp_H5AWRITE_DOUBLE_5 -H5_DBLE_INTERFACE_mp_H5AWRITE_DOUBLE_6 -H5_DBLE_INTERFACE_mp_H5AWRITE_DOUBLE_7 -H5_DBLE_INTERFACE_mp_H5DFILL_DOUBLE -H5_DBLE_INTERFACE_mp_H5DREAD_DOUBLE_SCALAR -H5_DBLE_INTERFACE_mp_H5DREAD_DOUBLE_1 -H5_DBLE_INTERFACE_mp_H5DREAD_DOUBLE_2 -H5_DBLE_INTERFACE_mp_H5DREAD_DOUBLE_3 -H5_DBLE_INTERFACE_mp_H5DREAD_DOUBLE_4 -H5_DBLE_INTERFACE_mp_H5DREAD_DOUBLE_5 -H5_DBLE_INTERFACE_mp_H5DREAD_DOUBLE_6 -H5_DBLE_INTERFACE_mp_H5DREAD_DOUBLE_7 -H5_DBLE_INTERFACE_mp_H5DWRITE_DOUBLE_SCALAR -H5_DBLE_INTERFACE_mp_H5DWRITE_DOUBLE_1 -H5_DBLE_INTERFACE_mp_H5DWRITE_DOUBLE_2 -H5_DBLE_INTERFACE_mp_H5DWRITE_DOUBLE_3 -H5_DBLE_INTERFACE_mp_H5DWRITE_DOUBLE_4 -H5_DBLE_INTERFACE_mp_H5DWRITE_DOUBLE_5 -H5_DBLE_INTERFACE_mp_H5DWRITE_DOUBLE_6 -H5_DBLE_INTERFACE_mp_H5DWRITE_DOUBLE_7 -H5_DBLE_INTERFACE_mp_H5PGET_DOUBLE -H5_DBLE_INTERFACE_mp_H5PSET_DOUBLE -H5_DBLE_INTERFACE_mp_H5PSET_FILL_VALUE_DOUBLE -H5_DBLE_INTERFACE_mp_H5PGET_FILL_VALUE_DOUBLE -H5_DBLE_INTERFACE_mp_H5PINSERT_DOUBLE -H5_DBLE_INTERFACE_mp_H5PREGISTER_DOUBLE +H5LIB_mp_H5OFFSETOF ; H5A +H5A_mp_H5AWRITE_CHAR_SCALAR +H5A_mp_H5AREAD_CHAR_SCALAR H5A_mp_H5ACREATE_F H5A_mp_H5AOPEN_NAME_F H5A_mp_H5AOPEN_IDX_F -H5A_PROVISIONAL_mp_H5AWRITE_INTEGER_SCALAR -H5A_PROVISIONAL_mp_H5AWRITE_INTEGER_1 -H5A_PROVISIONAL_mp_H5AWRITE_INTEGER_2 -H5A_PROVISIONAL_mp_H5AWRITE_INTEGER_3 -H5A_PROVISIONAL_mp_H5AWRITE_INTEGER_4 -H5A_PROVISIONAL_mp_H5AWRITE_INTEGER_5 -H5A_PROVISIONAL_mp_H5AWRITE_INTEGER_6 -H5A_PROVISIONAL_mp_H5AWRITE_INTEGER_7 -H5A_PROVISIONAL_mp_H5AWRITE_REAL_SCALAR -H5A_PROVISIONAL_mp_H5AWRITE_REAL_1 -H5A_PROVISIONAL_mp_H5AWRITE_REAL_2 -H5A_PROVISIONAL_mp_H5AWRITE_REAL_3 -H5A_PROVISIONAL_mp_H5AWRITE_REAL_4 -H5A_PROVISIONAL_mp_H5AWRITE_REAL_5 -H5A_PROVISIONAL_mp_H5AWRITE_REAL_6 -H5A_PROVISIONAL_mp_H5AWRITE_REAL_7 -H5A_PROVISIONAL_mp_H5AWRITE_CHAR_SCALAR -H5A_PROVISIONAL_mp_H5AWRITE_CHAR_1 -H5A_PROVISIONAL_mp_H5AWRITE_CHAR_2 -H5A_PROVISIONAL_mp_H5AWRITE_CHAR_3 -H5A_PROVISIONAL_mp_H5AWRITE_CHAR_4 -H5A_PROVISIONAL_mp_H5AWRITE_CHAR_5 -H5A_PROVISIONAL_mp_H5AWRITE_CHAR_6 -H5A_PROVISIONAL_mp_H5AWRITE_CHAR_7 -H5A_PROVISIONAL_mp_H5AREAD_INTEGER_SCALAR -H5A_PROVISIONAL_mp_H5AREAD_INTEGER_1 -H5A_PROVISIONAL_mp_H5AREAD_INTEGER_2 -H5A_PROVISIONAL_mp_H5AREAD_INTEGER_3 -H5A_PROVISIONAL_mp_H5AREAD_INTEGER_4 -H5A_PROVISIONAL_mp_H5AREAD_INTEGER_5 -H5A_PROVISIONAL_mp_H5AREAD_INTEGER_6 -H5A_PROVISIONAL_mp_H5AREAD_INTEGER_7 -H5A_PROVISIONAL_mp_H5AREAD_REAL_SCALAR -H5A_PROVISIONAL_mp_H5AREAD_REAL_1 -H5A_PROVISIONAL_mp_H5AREAD_REAL_2 -H5A_PROVISIONAL_mp_H5AREAD_REAL_3 -H5A_PROVISIONAL_mp_H5AREAD_REAL_4 -H5A_PROVISIONAL_mp_H5AREAD_REAL_5 -H5A_PROVISIONAL_mp_H5AREAD_REAL_6 -H5A_PROVISIONAL_mp_H5AREAD_REAL_7 -H5A_PROVISIONAL_mp_H5AREAD_CHAR_SCALAR -H5A_PROVISIONAL_mp_H5AREAD_CHAR_1 -H5A_PROVISIONAL_mp_H5AREAD_CHAR_2 -H5A_PROVISIONAL_mp_H5AREAD_CHAR_3 -H5A_PROVISIONAL_mp_H5AREAD_CHAR_4 -H5A_PROVISIONAL_mp_H5AREAD_CHAR_5 -H5A_PROVISIONAL_mp_H5AREAD_CHAR_6 -H5A_PROVISIONAL_mp_H5AREAD_CHAR_7 H5A_mp_H5AGET_SPACE_F H5A_mp_H5AGET_TYPE_F H5A_mp_H5AGET_NAME_F @@ -122,64 +36,16 @@ H5A_mp_H5AEXISTS_F H5A_mp_H5AEXISTS_BY_NAME_F H5A_mp_H5AOPEN_BY_NAME_F H5A_mp_H5ARENAME_F -@H5_NOF03EXP@H5A_PROVISIONAL_mp_H5AWRITE_PTR -@H5_NOF03EXP@H5A_PROVISIONAL_mp_H5AREAD_PTR ; H5D H5D_mp_H5DCREATE_F H5D_mp_H5DOPEN_F H5D_mp_H5DCLOSE_F -H5D_PROVISIONAL_mp_H5DWRITE_REFERENCE_OBJ -H5D_PROVISIONAL_mp_H5DWRITE_REFERENCE_DSETREG -H5D_PROVISIONAL_mp_H5DWRITE_INTEGER_SCALAR -H5D_PROVISIONAL_mp_H5DWRITE_INTEGER_1 -H5D_PROVISIONAL_mp_H5DWRITE_INTEGER_2 -H5D_PROVISIONAL_mp_H5DWRITE_INTEGER_3 -H5D_PROVISIONAL_mp_H5DWRITE_INTEGER_4 -H5D_PROVISIONAL_mp_H5DWRITE_INTEGER_5 -H5D_PROVISIONAL_mp_H5DWRITE_INTEGER_6 -H5D_PROVISIONAL_mp_H5DWRITE_INTEGER_7 -H5D_PROVISIONAL_mp_H5DWRITE_CHAR_SCALAR -H5D_PROVISIONAL_mp_H5DWRITE_CHAR_1 -H5D_PROVISIONAL_mp_H5DWRITE_CHAR_2 -H5D_PROVISIONAL_mp_H5DWRITE_CHAR_3 -H5D_PROVISIONAL_mp_H5DWRITE_CHAR_4 -H5D_PROVISIONAL_mp_H5DWRITE_CHAR_5 -H5D_PROVISIONAL_mp_H5DWRITE_CHAR_6 -H5D_PROVISIONAL_mp_H5DWRITE_CHAR_7 -H5D_PROVISIONAL_mp_H5DWRITE_REAL_SCALAR -H5D_PROVISIONAL_mp_H5DWRITE_REAL_1 -H5D_PROVISIONAL_mp_H5DWRITE_REAL_2 -H5D_PROVISIONAL_mp_H5DWRITE_REAL_3 -H5D_PROVISIONAL_mp_H5DWRITE_REAL_4 -H5D_PROVISIONAL_mp_H5DWRITE_REAL_5 -H5D_PROVISIONAL_mp_H5DWRITE_REAL_6 -H5D_PROVISIONAL_mp_H5DWRITE_REAL_7 -H5D_PROVISIONAL_mp_H5DREAD_REFERENCE_OBJ -H5D_PROVISIONAL_mp_H5DREAD_REFERENCE_DSETREG -H5D_PROVISIONAL_mp_H5DREAD_INTEGER_SCALAR -H5D_PROVISIONAL_mp_H5DREAD_INTEGER_1 -H5D_PROVISIONAL_mp_H5DREAD_INTEGER_2 -H5D_PROVISIONAL_mp_H5DREAD_INTEGER_3 -H5D_PROVISIONAL_mp_H5DREAD_INTEGER_4 -H5D_PROVISIONAL_mp_H5DREAD_INTEGER_5 -H5D_PROVISIONAL_mp_H5DREAD_INTEGER_6 -H5D_PROVISIONAL_mp_H5DREAD_INTEGER_7 -H5D_PROVISIONAL_mp_H5DREAD_CHAR_SCALAR -H5D_PROVISIONAL_mp_H5DREAD_CHAR_1 -H5D_PROVISIONAL_mp_H5DREAD_CHAR_2 -H5D_PROVISIONAL_mp_H5DREAD_CHAR_3 -H5D_PROVISIONAL_mp_H5DREAD_CHAR_4 -H5D_PROVISIONAL_mp_H5DREAD_CHAR_5 -H5D_PROVISIONAL_mp_H5DREAD_CHAR_6 -H5D_PROVISIONAL_mp_H5DREAD_CHAR_7 -H5D_PROVISIONAL_mp_H5DREAD_REAL_SCALAR -H5D_PROVISIONAL_mp_H5DREAD_REAL_1 -H5D_PROVISIONAL_mp_H5DREAD_REAL_2 -H5D_PROVISIONAL_mp_H5DREAD_REAL_3 -H5D_PROVISIONAL_mp_H5DREAD_REAL_4 -H5D_PROVISIONAL_mp_H5DREAD_REAL_5 -H5D_PROVISIONAL_mp_H5DREAD_REAL_6 -H5D_PROVISIONAL_mp_H5DREAD_REAL_7 +H5D_mp_H5DWRITE_REFERENCE_OBJ +H5D_mp_H5DWRITE_REFERENCE_DSETREG +H5D_mp_H5DWRITE_CHAR_SCALAR +H5D_mp_H5DREAD_REFERENCE_OBJ +H5D_mp_H5DREAD_REFERENCE_DSETREG +H5D_mp_H5DREAD_CHAR_SCALAR H5D_mp_H5DGET_SPACE_F H5D_mp_H5DGET_TYPE_F H5D_mp_H5DSET_EXTENT_F @@ -192,9 +58,8 @@ H5D_mp_H5DWRITE_VL_REAL H5D_mp_H5DREAD_VL_REAL H5D_mp_H5DWRITE_VL_STRING H5D_mp_H5DREAD_VL_STRING -H5D_PROVISIONAL_mp_H5DFILL_INTEGER -H5D_PROVISIONAL_mp_H5DFILL_REAL -H5D_PROVISIONAL_mp_H5DFILL_CHAR +H5D_mp_H5DFILL_CHAR +H5D_mp_H5DFILL_INTEGER H5D_mp_H5DGET_SPACE_STATUS_F H5D_mp_H5DCREATE_ANON_F H5D_mp_H5DGET_SPACE_F @@ -204,15 +69,15 @@ H5D_mp_H5DGET_CREATE_PLIST_F H5D_mp_H5DGET_STORAGE_SIZE_F H5D_mp_H5DVLEN_GET_MAX_LEN_F H5D_mp_H5DGET_ACCESS_PLIST_F -@H5_NOF03EXP@H5D_PROVISIONAL_mp_H5DWRITE_PTR -@H5_NOF03EXP@H5D_PROVISIONAL_mp_H5DREAD_PTR -@H5_NOF03EXP@H5D_PROVISIONAL_mp_H5DVLEN_RECLAIM_F +H5D_mp_H5DWRITE_PTR +H5D_mp_H5DREAD_PTR +H5D_mp_H5DVLEN_RECLAIM_F ; H5E H5E_mp_H5ECLEAR_F H5E_mp_H5EPRINT_F H5E_mp_H5EGET_MAJOR_F H5E_mp_H5EGET_MINOR_F -H5E_PROVISIONAL_mp_H5ESET_AUTO_F +H5E_mp_H5ESET_AUTO_F ; H5F H5F_mp_H5FCREATE_F H5F_mp_H5FFLUSH_F @@ -229,7 +94,7 @@ H5F_mp_H5FGET_ACCESS_PLIST_F H5F_mp_H5FIS_HDF5_F H5F_mp_H5FGET_NAME_F H5F_mp_H5FGET_FILESIZE_F -@H5_NOF03EXP@H5F_PROVISIONAL_mp_H5FGET_FILE_IMAGE_F +H5F_mp_H5FGET_FILE_IMAGE_F ; H5G H5G_mp_H5GOPEN_F H5G_mp_H5GCREATE_F @@ -291,8 +156,8 @@ H5L_mp_H5LGET_INFO_BY_IDX_F H5L_mp_H5LIS_REGISTERED_F H5L_mp_H5LMOVE_F H5L_mp_H5LGET_NAME_BY_IDX_F -@H5_NOF03EXP@H5L_PROVISIONAL_mp_H5LITERATE_F -@H5_NOF03EXP@H5L_PROVISIONAL_mp_H5LITERATE_BY_NAME_F +H5L_mp_H5LITERATE_F +H5L_mp_H5LITERATE_BY_NAME_F ; H5O H5O_mp_H5OCLOSE_F H5O_mp_H5OCOPY_F @@ -307,11 +172,11 @@ H5O_mp_H5OOPEN_BY_IDX_F H5O_mp_H5OOPEN_F H5O_mp_H5OSET_COMMENT_F H5O_mp_H5OSET_COMMENT_BY_NAME_F -@H5_NOF03EXP@H5O_PROVISIONAL_mp_H5OGET_INFO_BY_IDX_F -@H5_NOF03EXP@H5O_PROVISIONAL_mp_H5OGET_INFO_BY_NAME_F -@H5_NOF03EXP@H5O_PROVISIONAL_mp_H5OGET_INFO_F -@H5_NOF03EXP@H5O_PROVISIONAL_mp_H5OVISIT_BY_NAME_F -@H5_NOF03EXP@H5O_PROVISIONAL_mp_H5OVISIT_F +H5O_mp_H5OGET_INFO_BY_IDX_F +H5O_mp_H5OGET_INFO_BY_NAME_F +H5O_mp_H5OGET_INFO_F +H5O_mp_H5OVISIT_BY_NAME_F +H5O_mp_H5OVISIT_F ; H5P H5P_mp_H5PCREATE_F H5P_mp_H5PSET_PRESERVE_F @@ -322,12 +187,10 @@ H5P_mp_H5PCLOSE_F H5P_mp_H5PSET_CHUNK_F H5P_mp_H5PGET_CHUNK_F H5P_mp_H5PSET_DEFLATE_F -H5P_PROVISIONAL_mp_H5PSET_FILL_VALUE_INTEGER -H5P_PROVISIONAL_mp_H5PGET_FILL_VALUE_INTEGER -H5P_PROVISIONAL_mp_H5PSET_FILL_VALUE_REAL -H5P_PROVISIONAL_mp_H5PGET_FILL_VALUE_REAL -H5P_PROVISIONAL_mp_H5PSET_FILL_VALUE_CHAR -H5P_PROVISIONAL_mp_H5PGET_FILL_VALUE_CHAR +H5P_mp_H5PSET_FILL_VALUE_CHAR +H5P_mp_H5PGET_FILL_VALUE_CHAR +H5P_mp_H5PSET_FILL_VALUE_INTEGER +H5P_mp_H5PGET_FILL_VALUE_INTEGER H5P_mp_H5PGET_VERSION_F H5P_mp_H5PSET_USERBLOCK_F H5P_mp_H5PGET_USERBLOCK_F @@ -379,12 +242,10 @@ H5P_mp_H5PSET_SMALL_DATA_BLOCK_SIZE_F H5P_mp_H5PGET_SMALL_DATA_BLOCK_SIZE_F H5P_mp_H5PSET_HYPER_VECTOR_SIZE_F H5P_mp_H5PGET_HYPER_VECTOR_SIZE_F -H5P_PROVISIONAL_mp_H5PSET_INTEGER -H5P_PROVISIONAL_mp_H5PSET_REAL -H5P_PROVISIONAL_mp_H5PSET_CHAR -H5P_PROVISIONAL_mp_H5PGET_INTEGER -H5P_PROVISIONAL_mp_H5PGET_REAL -H5P_PROVISIONAL_mp_H5PGET_CHAR +H5P_mp_H5PSET_CHAR +H5P_mp_H5PSET_INTEGER +H5P_mp_H5PGET_CHAR +H5P_mp_H5PGET_INTEGER H5P_mp_H5PEXIST_F H5P_mp_H5PGET_SIZE_F H5P_mp_H5PGET_NPROPS_F @@ -395,13 +256,11 @@ H5P_mp_H5PCOPY_PROP_F H5P_mp_H5PREMOVE_F H5P_mp_H5PUNREGISTER_F H5P_mp_H5PCLOSE_CLASS_F -H5P_PROVISIONAL_mp_H5PCREATE_CLASS_F -H5P_PROVISIONAL_mp_H5PREGISTER_INTEGER -H5P_PROVISIONAL_mp_H5PREGISTER_REAL -H5P_PROVISIONAL_mp_H5PREGISTER_CHAR -H5P_PROVISIONAL_mp_H5PINSERT_INTEGER -H5P_PROVISIONAL_mp_H5PINSERT_REAL -H5P_PROVISIONAL_mp_H5PINSERT_CHAR +H5P_mp_H5PCREATE_CLASS_F +H5P_mp_H5PREGISTER_INTEGER +H5P_mp_H5PREGISTER_CHAR +H5P_mp_H5PINSERT_CHAR +H5P_mp_H5PINSERT_INTEGER H5P_mp_H5PSET_SHUFFLE_F H5P_mp_H5PSET_EDC_CHECK_F H5P_mp_H5PGET_EDC_CHECK_F @@ -448,28 +307,34 @@ H5P_mp_H5PGET_NLINKS_F H5P_mp_H5PGET_CREATE_INTER_GROUP_F H5P_mp_H5PSET_CHUNK_CACHE_F H5P_mp_H5PGET_CHUNK_CACHE_F -@H5_NOF03EXP@H5P_PROVISIONAL_mp_H5PSET_FILL_VALUE_PTR -@H5_NOF03EXP@H5P_PROVISIONAL_mp_H5PGET_FILL_VALUE_PTR -@H5_NOF03EXP@H5P_PROVISIONAL_mp_H5PSET_PTR -@H5_NOF03EXP@H5P_PROVISIONAL_mp_H5PGET_PTR -@H5_NOF03EXP@H5P_PROVISIONAL_mp_H5PREGISTER_PTR -@H5_NOF03EXP@H5P_PROVISIONAL_mp_H5PINSERT_PTR -@H5_NOF03EXP@H5P_PROVISIONAL_mp_H5PGET_FILE_IMAGE_F -@H5_NOF03EXP@H5P_PROVISIONAL_mp_H5PSET_FILE_IMAGE_F +H5P_mp_H5PSET_FILL_VALUE_PTR +H5P_mp_H5PGET_FILL_VALUE_PTR +H5P_mp_H5PSET_PTR +H5P_mp_H5PGET_PTR +H5P_mp_H5PREGISTER_PTR +H5P_mp_H5PINSERT_PTR +H5P_mp_H5PGET_FILE_IMAGE_F +H5P_mp_H5PSET_FILE_IMAGE_F +; Parallel +@H5_NOPAREXP@H5P_mp_H5PSET_FAPL_MPIO_F +@H5_NOPAREXP@H5P_mp_H5PGET_FAPL_MPIO_F +@H5_NOPAREXP@H5P_mp_H5PSET_DXPL_MPIO_F +@H5_NOPAREXP@H5P_mp_H5PGET_DXPL_MPIO_F +@H5_NOPAREXP@H5P_mp_H5PGET_MPIO_ACTUAL_IO_MODE_F ; H5R -H5R_PROVISIONAL_mp_H5RCREATE_OBJECT_F -H5R_PROVISIONAL_mp_H5RCREATE_REGION_F -H5R_PROVISIONAL_mp_H5RDEREFERENCE_OBJECT_F -H5R_PROVISIONAL_mp_H5RDEREFERENCE_REGION_F -H5R_PROVISIONAL_mp_H5RGET_REGION_REGION_F +H5R_mp_H5RCREATE_OBJECT_F +H5R_mp_H5RCREATE_REGION_F +H5R_mp_H5RDEREFERENCE_OBJECT_F +H5R_mp_H5RDEREFERENCE_REGION_F +H5R_mp_H5RGET_REGION_REGION_F H5R_mp_H5RGET_OBJECT_TYPE_OBJ_F -H5R_PROVISIONAL_mp_H5RGET_NAME_OBJECT_F -H5R_PROVISIONAL_mp_H5RGET_NAME_REGION_F -@H5_NOF03EXP@H5R_PROVISIONAL_mp_H5RGET_REGION_PTR_F -@H5_NOF03EXP@H5R_PROVISIONAL_mp_H5RCREATE_PTR_F -@H5_NOF03EXP@H5R_PROVISIONAL_mp_H5RDEREFERENCE_PTR_F -@H5_NOF03EXP@H5R_PROVISIONAL_mp_H5RGET_NAME_PTR_F -@H5_NOF03EXP@H5R_PROVISIONAL_mp_H5RGET_OBJ_TYPE_F +H5R_mp_H5RGET_NAME_OBJECT_F +H5R_mp_H5RGET_NAME_REGION_F +H5R_mp_H5RGET_REGION_PTR_F +H5R_mp_H5RCREATE_PTR_F +H5R_mp_H5RDEREFERENCE_PTR_F +H5R_mp_H5RGET_NAME_PTR_F +H5R_mp_H5RGET_OBJ_TYPE_F ; H5S H5S_mp_H5SCREATE_SIMPLE_F H5S_mp_H5SCLOSE_F @@ -558,17 +423,10 @@ H5T_mp_H5TENCODE_F H5T_mp_H5TGET_CREATE_PLIST_F H5T_mp_H5TCOMPILER_CONV_F H5T_mp_H5TGET_NATIVE_TYPE_F -@H5_NOF03EXP@H5T_PROVISIONAL_mp_H5TCONVERT_F -@H5_F03EXP@H5T_PROVISIONAL_mp_H5TENUM_INSERT_F -@H5_NOF03EXP@H5T_PROVISIONAL_mp_H5TENUM_INSERT_F90 -@H5_NOF03EXP@H5T_PROVISIONAL_mp_H5TENUM_INSERT_F03 +H5T_mp_H5TCONVERT_F +H5T_mp_H5TENUM_INSERT_F90 +H5T_mp_H5TENUM_INSERT_F03 ; H5Z H5Z_mp_H5ZUNREGISTER_F H5Z_mp_H5ZFILTER_AVAIL_F H5Z_mp_H5ZGET_FILTER_INFO_F -; Parallel -@H5_NOPAREXP@H5FDMPIO_mp_H5PSET_FAPL_MPIO_F -@H5_NOPAREXP@H5FDMPIO_mp_H5PGET_FAPL_MPIO_F -@H5_NOPAREXP@H5FDMPIO_mp_H5PSET_DXPL_MPIO_F -@H5_NOPAREXP@H5FDMPIO_mp_H5PGET_DXPL_MPIO_F -@H5_NOPAREXP@H5FDMPIO_mp_H5PGET_MPIO_ACTUAL_IO_MODE_F diff --git a/fortran/test/CMakeLists.txt b/fortran/test/CMakeLists.txt index a2711c0..19d4975 100644 --- a/fortran/test/CMakeLists.txt +++ b/fortran/test/CMakeLists.txt @@ -39,26 +39,11 @@ if (BUILD_SHARED_LIBS) ) endif (BUILD_SHARED_LIBS) -# See if the F2008 intrinsic STORAGE_SIZE and C_SIZEOF are supported. If not then -# fall back to F2003. If F2003 not supported then use F90 for the tests. - -set_source_files_properties (tf_F90.f90 tf_F03.f90 tf_F08.f90 tf.f90 PROPERTIES LANGUAGE Fortran) -if (FORTRAN_HAVE_STORAGE_SIZE AND FORTRAN_HAVE_C_SIZEOF) - add_library (${HDF5_F90_TEST_LIB_TARGET} STATIC tf_F08.f90 tf.f90) - if (BUILD_SHARED_LIBS) - add_library (${HDF5_F90_TEST_LIBSH_TARGET} SHARED tf_F08.f90 tf.f90) - endif (BUILD_SHARED_LIBS) -elseif (HDF5_ENABLE_F2003) - add_library (${HDF5_F90_TEST_LIB_TARGET} STATIC tf_F03.f90 tf.f90) - if (BUILD_SHARED_LIBS) - add_library (${HDF5_F90_TEST_LIBSH_TARGET} SHARED tf_F03.f90 tf.f90) - endif (BUILD_SHARED_LIBS) -else (FORTRAN_HAVE_STORAGE_SIZE AND FORTRAN_HAVE_C_SIZEOF) - add_library (${HDF5_F90_TEST_LIB_TARGET} STATIC tf_F90.f90 tf.f90) - if (BUILD_SHARED_LIBS) - add_library (${HDF5_F90_TEST_LIBSH_TARGET} SHARED tf_F90.f90 tf.f90) - endif (BUILD_SHARED_LIBS) -endif (FORTRAN_HAVE_STORAGE_SIZE AND FORTRAN_HAVE_C_SIZEOF) +set_source_files_properties (tf.F90 ${HDF5_F90_BINARY_DIR}/tf_gen.F90 PROPERTIES LANGUAGE Fortran) +add_library (${HDF5_F90_TEST_LIB_TARGET} STATIC tf.F90 ${HDF5_F90_BINARY_DIR}/tf_gen.F90) +if (BUILD_SHARED_LIBS) + add_library (${HDF5_F90_TEST_LIBSH_TARGET} SHARED tf.F90 ${HDF5_F90_BINARY_DIR}/tf_gen.F90) +endif (BUILD_SHARED_LIBS) TARGET_FORTRAN_PROPERTIES (${HDF5_F90_TEST_LIB_TARGET} STATIC " " " ") target_link_libraries (${HDF5_F90_TEST_LIB_TARGET} @@ -108,6 +93,40 @@ if (BUILD_SHARED_LIBS) endif (BUILD_SHARED_LIBS) #----------------------------------------------------------------------------- +# Setup the Fortran auto-detection utilities +# H5_test_buildiface.F90 used to generate various KIND test interfaces +#----------------------------------------------------------------------------- + +add_executable (H5_test_buildiface + ${HDF5_F90_SRC_DIR}/test/H5_test_buildiface.F90 + ) + +if (WIN32 AND MSVC) + if (BUILD_SHARED_LIBS) + set_target_properties (H5_test_buildiface + PROPERTIES + COMPILE_FLAGS "/MT" + ) + endif (BUILD_SHARED_LIBS) + set_target_properties (H5_test_buildiface + PROPERTIES + LINK_FLAGS "/SUBSYSTEM:CONSOLE" + ) +endif (WIN32 AND MSVC) +set_target_properties (H5_test_buildiface PROPERTIES + LINKER_LANGUAGE Fortran + Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY} +) + +set (CMD $) +add_custom_command ( + OUTPUT ${HDF5_F90_BINARY_DIR}/tf_gen.F90 + COMMAND ${CMD} + WORKING_DIRECTORY ${HDF5_F90_BINARY_DIR} + DEPENDS H5_test_buildiface +) + +#----------------------------------------------------------------------------- # Add Tests #----------------------------------------------------------------------------- @@ -234,62 +253,60 @@ if (BUILD_SHARED_LIBS) endif (BUILD_SHARED_LIBS) #-- Adding test for fortranlib_test_F03 -if (HDF5_ENABLE_F2003) - add_executable (fortranlib_test_F03 +add_executable (fortranlib_test_F03 + fortranlib_test_F03.f90 + tH5E_F03.f90 + tH5F_F03.f90 + tH5L_F03.f90 + tH5O_F03.f90 + tH5P_F03.f90 + tH5T_F03.F90 + tHDF5_F03.f90 +) +TARGET_NAMING (fortranlib_test_F03 STATIC) +TARGET_FORTRAN_PROPERTIES (fortranlib_test_F03 STATIC " " " ") +target_link_libraries (fortranlib_test_F03 + ${HDF5_F90_TEST_LIB_TARGET} + ${HDF5_F90_LIB_TARGET} + ${HDF5_LIB_TARGET} +) +if (WIN32 AND MSVC) + target_link_libraries (fortranlib_test_F03 "ws2_32.lib") +endif (WIN32 AND MSVC) +target_include_directories (fortranlib_test_F03 PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/static) +set_target_properties (fortranlib_test_F03 PROPERTIES + LINKER_LANGUAGE Fortran + FOLDER test/fortran + Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/static +) +if (BUILD_SHARED_LIBS) + add_executable (fortranlib_test_F03-shared fortranlib_test_F03.f90 tH5E_F03.f90 tH5F_F03.f90 tH5L_F03.f90 tH5O_F03.f90 tH5P_F03.f90 - tH5T_F03.f90 + tH5T_F03.F90 tHDF5_F03.f90 ) - TARGET_NAMING (fortranlib_test_F03 STATIC) - TARGET_FORTRAN_PROPERTIES (fortranlib_test_F03 STATIC " " " ") - target_link_libraries (fortranlib_test_F03 - ${HDF5_F90_TEST_LIB_TARGET} - ${HDF5_F90_LIB_TARGET} - ${HDF5_LIB_TARGET} + TARGET_NAMING (fortranlib_test_F03-shared SHARED) + TARGET_FORTRAN_PROPERTIES (fortranlib_test_F03-shared SHARED " " " ") + target_link_libraries (fortranlib_test_F03-shared + ${HDF5_F90_TEST_LIBSH_TARGET} + ${HDF5_F90_LIBSH_TARGET} + ${HDF5_LIBSH_TARGET} ) if (WIN32 AND MSVC) - target_link_libraries (fortranlib_test_F03 "ws2_32.lib") + target_link_libraries (fortranlib_test_F03-shared "ws2_32.lib") endif (WIN32 AND MSVC) - target_include_directories (fortranlib_test_F03 PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/static) - set_target_properties (fortranlib_test_F03 PROPERTIES + target_include_directories (fortranlib_test_F03-shared PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/shared) + set_target_properties (fortranlib_test_F03-shared PROPERTIES LINKER_LANGUAGE Fortran FOLDER test/fortran - Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/static - ) - if (BUILD_SHARED_LIBS) - add_executable (fortranlib_test_F03-shared - fortranlib_test_F03.f90 - tH5E_F03.f90 - tH5F_F03.f90 - tH5L_F03.f90 - tH5O_F03.f90 - tH5P_F03.f90 - tH5T_F03.f90 - tHDF5_F03.f90 - ) - TARGET_NAMING (fortranlib_test_F03-shared SHARED) - TARGET_FORTRAN_PROPERTIES (fortranlib_test_F03-shared SHARED " " " ") - target_link_libraries (fortranlib_test_F03-shared - ${HDF5_F90_TEST_LIBSH_TARGET} - ${HDF5_F90_LIBSH_TARGET} - ${HDF5_LIBSH_TARGET} - ) - if (WIN32 AND MSVC) - target_link_libraries (fortranlib_test_F03-shared "ws2_32.lib") - endif (WIN32 AND MSVC) - target_include_directories (fortranlib_test_F03-shared PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/shared) - set_target_properties (fortranlib_test_F03-shared PROPERTIES - LINKER_LANGUAGE Fortran - FOLDER test/fortran - Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/shared - ) - endif (BUILD_SHARED_LIBS) -endif (HDF5_ENABLE_F2003) + Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/shared +) +endif (BUILD_SHARED_LIBS) #-- Adding test for fflush1 add_executable (fflush1 fflush1.f90) diff --git a/fortran/test/H5_test_buildiface.F90 b/fortran/test/H5_test_buildiface.F90 new file mode 100644 index 0000000..30687df --- /dev/null +++ b/fortran/test/H5_test_buildiface.F90 @@ -0,0 +1,306 @@ +!****p* Program/H5_buildiface +! +! NAME +! Executable: H5_buildiface +! +! FILE +! fortran/src/H5_buildiface.f90 +! +! PURPOSE +! This stand alone program is used at build time to generate the program +! H5fortran_detect.f90. It cycles through all the available KIND parameters for +! integers and reals. The appropriate program and subroutines are then generated +! depending on which of the KIND values are found. +! +! NOTES +! This program uses the Fortran 2008 intrinsic function STORAGE_SIZE or SIZEOF +! depending on availablity.It generates code that makes use of +! STORAGE_SIZE/SIZEOF in H5fortran_detect.f90. STORAGE_SIZE is standard +! compliant and should always be chosen over SIZEOF. +! +! The availability of STORAGE_SIZE/SIZEOF is checked at configure time and the TRUE/FALSE +! condition is set in the configure variable "FORTRAN_HAVE_STORAGE_SIZE" or +! "FORTRAN_HAVE_SIZEOF". +! +! The use of C_SIZOF(X) is not used since the argument X must be an interoperable +! data entity. +! +! 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 +! M. Scot Breitenfeld +! +!***** + +#include + +PROGRAM H5_test_buildiface + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + +! These values are valid REAL KINDs (with corresponding C float) found during configure + H5_H5CONFIG_F_NUM_RKIND + H5_H5CONFIG_F_RKIND +! These values are valid INTEGER KINDs (with corresponding C integer) found during configure + H5_H5CONFIG_F_NUM_IKIND + H5_H5CONFIG_F_IKIND + + INTEGER :: i, j, k + INTEGER :: ji, jr, jd +#ifdef H5_FORTRAN_HAVE_C_LONG_DOUBLE + REAL(KIND=C_LONG_DOUBLE) :: c_longdble +#endif + REAL(KIND=C_DOUBLE) :: c_dble + REAL(KIND=C_FLOAT) :: c_flt + INTEGER :: sizeof_var + 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)) ', & + ', DIMENSION(dims(1),dims(2)) ', & + ', DIMENSION(dims(1),dims(2),dims(3)) ', & + ', DIMENSION(dims(1),dims(2),dims(3),dims(4)) ', & + ', DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) ', & + ', 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)) ', & + ' f_ptr = C_LOC(buf(1,1)) ', & + ' f_ptr = C_LOC(buf(1,1,1)) ', & + ' f_ptr = C_LOC(buf(1,1,1,1)) ', & + ' f_ptr = C_LOC(buf(1,1,1,1,1)) ', & + ' f_ptr = C_LOC(buf(1,1,1,1,1,1)) ', & + ' f_ptr = C_LOC(buf(1,1,1,1,1,1,1))' & + /) + +! Generate Fortran Check routines for the tests KIND interfaces. + + OPEN(11,FILE='tf_gen.F90') + WRITE(11,'(40(A,/))') & +'!****h* ROBODoc/TH5_MISC_gen.F90',& +'!',& +'! NAME',& +'! TH5_MISC_gen',& +'! ',& +'! PURPOSE',& +'! This module is generated at build by H5_test_buildiface.F90 to handle checking ',& +'! in the tests all the detected KINDs.',& +'!',& +'! COPYRIGHT',& +'! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *',& +'! Copyright by The HDF Group. *',& +'! 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',& +'! H5_test_buildiface.F90',& +'!',& +'!*****' + + WRITE(11,'(a)') "MODULE TH5_MISC_gen" + + WRITE(11,'(A)') ' USE, INTRINSIC :: ISO_C_BINDING' + +! Interfaces for validating REALs, INTEGERs, CHARACTERs, LOGICALs + + WRITE(11,'(A)') ' INTERFACE verify' + DO i = 1, num_rkinds + j = rkind(i) + WRITE(chr2,'(I2)') j + WRITE(11,'(A)') " MODULE PROCEDURE verify_real_kind_"//TRIM(ADJUSTL(chr2)) + END DO + DO i = 1, num_ikinds + j = ikind(i) + WRITE(chr2,'(I2)') j + WRITE(11,'(A)') " MODULE PROCEDURE verify_integer_kind_"//TRIM(ADJUSTL(chr2)) + END DO + WRITE(11,'(A)') " MODULE PROCEDURE verify_character" + WRITE(11,'(A)') " MODULE PROCEDURE verify_logical" + WRITE(11,'(A)') " END INTERFACE" + + WRITE(11,'(A)') ' INTERFACE check_real_eq' + DO i = 1, num_rkinds + j = rkind(i) + WRITE(chr2,'(I2)') j + WRITE(11,'(A)') " MODULE PROCEDURE real_eq_kind_"//TRIM(ADJUSTL(chr2)) + END DO + WRITE(11,'(A)') " END INTERFACE" + + WRITE(11,'(A)') 'CONTAINS' + +! *************************** +! VALIDATE INTEGERS +! *************************** + DO i = 1, num_ikinds + k = ikind(i) + WRITE(chr2,'(I2)') k +! DLL definitions for windows + WRITE(11,'(A)') '!DEC$if defined(BUILD_HDF5_TEST_DLL)' + WRITE(11,'(A)') '!DEC$attributes dllexport :: verify_integer_kind_'//TRIM(ADJUSTL(chr2)) + WRITE(11,'(A)') '!DEC$endif' + +! Subroutine API + WRITE(11,'(A)') ' SUBROUTINE verify_integer_kind_'//TRIM(ADJUSTL(chr2))//'(string,value,correct_value,total_error)' + WRITE(11,'(A)') ' IMPLICIT NONE' + WRITE(11,'(A)') ' CHARACTER(LEN=*) :: string' + WRITE(11,'(A)') ' INTEGER(KIND='//TRIM(ADJUSTL(chr2))//') :: value, correct_value' + WRITE(11,'(A)') ' INTEGER :: total_error' + WRITE(11,'(A)') ' IF (value .NE. correct_value) THEN' + WRITE(11,'(A)') ' total_error=total_error+1' + WRITE(11,'(A)') ' WRITE(*,*) "ERROR: INCORRECT INTEGER VALIDATION ", string' + WRITE(11,'(A)') ' ENDIF' + WRITE(11,'(A)') ' END SUBROUTINE verify_integer_kind_'//TRIM(ADJUSTL(chr2)) + ENDDO + +! *************************** +! VALIDATE REALS +! *************************** + DO i = 1, num_rkinds + k = rkind(i) + WRITE(chr2,'(I2)') k +! DLL definitions for windows + WRITE(11,'(A)') '!DEC$if defined(BUILD_HDF5_TEST_DLL)' + WRITE(11,'(A)') '!DEC$attributes dllexport :: verify_real_kind_'//TRIM(ADJUSTL(chr2)) + WRITE(11,'(A)') '!DEC$endif' + +! Subroutine API + WRITE(11,'(A)') ' SUBROUTINE verify_real_kind_'//TRIM(ADJUSTL(chr2))//'(string,value,correct_value,total_error)' + WRITE(11,'(A)') ' IMPLICIT NONE' + WRITE(11,'(A)') ' CHARACTER(LEN=*) :: string' + WRITE(11,'(A)') ' REAL(KIND='//TRIM(ADJUSTL(chr2))//') :: value, correct_value' + WRITE(11,'(A)') ' INTEGER :: total_error' + WRITE(11,'(A)') ' IF (.NOT.real_eq_kind_'//TRIM(ADJUSTL(chr2))//'( value, correct_value) ) THEN' + WRITE(11,'(A)') ' total_error=total_error+1' + WRITE(11,'(A)') ' WRITE(*,*) "ERROR: INCORRECT REAL VALIDATION ", string' + WRITE(11,'(A)') ' ENDIF' + WRITE(11,'(A)') ' END SUBROUTINE verify_real_kind_'//TRIM(ADJUSTL(chr2)) + + +! *********************************** +! TEST IF TWO REAL NUMBERS ARE EQUAL +! *********************************** + +! [1] The test performed is +! +! ABS( x - y ) < ( ULP * SPACING( MAX(ABS(x),ABS(y)) ) ) +! +! The numbers are considered equal if true +! +! The intrinsic function SPACING(x) returns the absolute spacing of numbers +! near the value of x, +! +! { EXPONENT(x)-DIGITS(x) +! { 2.0 for x /= 0 +! SPACING(x) = { +! { +! { TINY(x) for x == 0 +! +! The ULP optional argument scales the comparison: +! +! Unit of data precision. The acronym stands for "unit in +! the last place," the smallest possible increment or decrement +! that can be made using a machine's floating point arithmetic. +! A 0.5 ulp maximum error is the best you could hope for, since +! this corresponds to always rounding to the nearest representable +! floating-point number. Value must be positive - if a negative +! value is supplied, the absolute value is used. +! If not specified, the default value is 1. +! +! James Van Buskirk and James Giles suggested this method for floating +! point comparisons in the comp.lang.fortran newsgroup. +! +! Reference: [1] Paul van Delst, paul.vandelst@ssec.wisc.edu + + WRITE(11,'(A)') '!DEC$if defined(BUILD_HDF5_TEST_DLL)' + WRITE(11,'(A)') '!DEC$attributes dllexport :: real_eq_kind_'//TRIM(ADJUSTL(chr2)) + WRITE(11,'(A)') '!DEC$endif' + WRITE(11,'(A)') ' LOGICAL FUNCTION real_eq_kind_'//TRIM(ADJUSTL(chr2))//'(a,b,ulp)' + WRITE(11,'(A)') ' IMPLICIT NONE' + WRITE(11,'(A)') ' REAL(KIND='//TRIM(ADJUSTL(chr2))//'), INTENT (in):: a,b' + WRITE(11,'(A)') ' REAL(KIND='//TRIM(ADJUSTL(chr2))//') :: Rel' + WRITE(11,'(A)') ' INTEGER, OPTIONAL, INTENT( IN ) :: ulp' + WRITE(11,'(A)') ' IF ( PRESENT( ulp ) ) Rel = REAL( ABS(ulp), '//TRIM(ADJUSTL(chr2))//')' + WRITE(11,'(A)') ' Rel = 1.0_'//TRIM(ADJUSTL(chr2)) + WRITE(11,'(A)') ' real_eq_kind_'//TRIM(ADJUSTL(chr2))//' = ABS( a - b ) < ( Rel * SPACING( MAX(ABS(a),ABS(b)) ) )' + WRITE(11,'(A)') ' END FUNCTION real_eq_kind_'//TRIM(ADJUSTL(chr2)) + ENDDO + +! *************************** +! VALIDATE CHARACTER STRINGS +! *************************** + +! DLL definitions for windows + WRITE(11,'(A)') '!DEC$if defined(BUILD_HDF5_TEST_DLL)' + WRITE(11,'(A)') '!DEC$attributes dllexport :: verify_character' + WRITE(11,'(A)') '!DEC$endif' + +! Subroutine API + WRITE(11,'(A)') ' SUBROUTINE verify_character(string,value,correct_value,total_error)' + WRITE(11,'(A)') ' IMPLICIT NONE' + WRITE(11,'(A)') ' CHARACTER*(*) :: string' + WRITE(11,'(A)') ' CHARACTER*(*) :: value, correct_value' + WRITE(11,'(A)') ' INTEGER :: total_error' + WRITE(11,'(A)') ' IF (TRIM(value) .NE. TRIM(correct_value)) THEN' + WRITE(11,'(A)') ' total_error = total_error + 1' + WRITE(11,'(A)') ' WRITE(*,*) "ERROR: INCORRECT VALIDATION ", string' + WRITE(11,'(A)') ' ENDIF' + WRITE(11,'(A)') ' END SUBROUTINE verify_character' + +! *************************** +! VALIDATE LOGICAL +! *************************** + +! DLL definitions for windows + WRITE(11,'(A)') '!DEC$if defined(BUILD_HDF5_TEST_DLL)' + WRITE(11,'(A)') '!DEC$attributes dllexport :: verify_logical' + WRITE(11,'(A)') '!DEC$endif' +! Subroutine API + WRITE(11,'(A)') ' SUBROUTINE verify_logical(string,value,correct_value,total_error)' + WRITE(11,'(A)') ' IMPLICIT NONE' + WRITE(11,'(A)') ' CHARACTER(LEN=*) :: string' + WRITE(11,'(A)') ' LOGICAL :: value, correct_value' + WRITE(11,'(A)') ' INTEGER :: total_error' + WRITE(11,'(A)') ' IF (value .NEQV. correct_value) THEN' + WRITE(11,'(A)') ' total_error = total_error + 1' + WRITE(11,'(A)') ' WRITE(*,*) "ERROR: INCORRECT VALIDATION ", string' + WRITE(11,'(A)') ' ENDIF' + + WRITE(11,'(A)') ' END SUBROUTINE verify_logical' + + WRITE(11,'(A)') "END MODULE TH5_MISC_gen" + + CLOSE(11) + +END PROGRAM H5_test_buildiface + + + diff --git a/fortran/test/Makefile.am b/fortran/test/Makefile.am index 735ab7a..608b1e9 100644 --- a/fortran/test/Makefile.am +++ b/fortran/test/Makefile.am @@ -36,40 +36,12 @@ else AM_LDFLAGS+=-static endif -# Check if the compiler supports the Fortran 2003 standard -# which should include the intrinsic module iso_c_binding -if FORTRAN_2003_CONDITIONAL_F - ff_PREFIX = F03 -else - ff_PREFIX = F90 -endif - # Our main targets, the tests themselves -TEST_PROG=fortranlib_test fflush1 fflush2 fortranlib_test_1_8 - -if FORTRAN_2003_CONDITIONAL_F - TEST_PROG += fortranlib_test_F03 -endif +TEST_PROG=fortranlib_test fflush1 fflush2 fortranlib_test_1_8 fortranlib_test_F03 check_PROGRAMS=$(TEST_PROG) -if FORTRAN_HAVE_STORAGE_SIZE -if FORTRAN_HAVE_C_SIZEOF - libh5test_fortran_la_SOURCES = tf_F08.f90 -else - libh5test_fortran_la_SOURCES = tf_F03.f90 -endif -else -if FORTRAN_2003_CONDITIONAL_F - libh5test_fortran_la_SOURCES = tf_F03.f90 -else - libh5test_fortran_la_SOURCES = tf_F90.f90 -endif -endif - -# tf.f90 depends on either tf_F08.f90 or tf_F03.f90 so they need to be -# compiled first -libh5test_fortran_la_SOURCES += tf.f90 t.c +libh5test_fortran_la_SOURCES = tf_gen.F90 tf.F90 t.c # Source files are used for both the library and fortranlib_test. # Automake will complain about this without the following workaround. @@ -79,13 +51,11 @@ fortranlib_test_CFLAGS=$(AM_CFLAGS) fortranlib_test_SOURCES = tH5F.f90 tH5D.f90 tH5R.f90 tH5S.f90 tH5T.f90 tH5VL.f90 tH5Z.f90 \ tH5Sselect.f90 tH5P.f90 tH5A.f90 tH5I.f90 tH5G.f90 tH5E.f90 tHDF5.f90 fortranlib_test.f90 -fortranlib_test_1_8_SOURCES = tH5O.f90 tH5A_1_8.f90 tH5G_1_8.f90 tH5MISC_1_8.f90 tHDF5_1_8.f90\ +fortranlib_test_1_8_SOURCES = tH5O.f90 tH5A_1_8.f90 tH5G_1_8.f90 tH5MISC_1_8.f90 tHDF5_1_8.f90 \ fortranlib_test_1_8.f90 -if FORTRAN_2003_CONDITIONAL_F - fortranlib_test_F03_SOURCES = tH5E_F03.f90 tH5F_F03.f90 tH5L_F03.f90 \ - tH5O_F03.f90 tH5P_F03.f90 tH5T_F03.f90 tHDF5_F03.f90 fortranlib_test_F03.f90 -endif +fortranlib_test_F03_SOURCES = tH5E_F03.f90 tH5F_F03.f90 tH5L_F03.f90 \ + tH5O_F03.f90 tH5P_F03.f90 tH5T_F03.F90 tHDF5_F03.f90 fortranlib_test_F03.f90 fflush1_SOURCES=fflush1.f90 @@ -106,13 +76,32 @@ maintainer-clean-local: clean-local distclean-local: clean-local clean-local: @if test -n "$(F9XMODEXT)" && test "X$(F9XMODEXT)" != "Xo"; then \ - $(RM) *.$(F9XMODEXT); \ + $(RM) *.$(F9XMODEXT) tf_gen.F90; \ fi # Mark this directory as part of the Fortran API (this affects output # from tests in conclude.am) FORTRAN_API=yes +# helper program we need to build. +noinst_PROGRAMS = H5_test_buildiface + +# H5_test_buildiface.F90 generates all the test APIs that have a KIND type associated +# with them. + +tf_gen.F90: H5_test_buildiface$(EXEEXT) + $(RUNSERIAL) ./H5_test_buildiface$(EXEEXT) + +# H5_test_buildiface.F90 is included in the distribution, and Automake knows +# how to compile a fortran program given its sources. + +H5_test_buildiface_SOURCES = H5_test_buildiface.F90 + +# The build of the H5_test_buildiface does depend on any libraries, so set it +# to nothing. + +H5_test_buildiface_LDADD = + # fflush2 depends on files created by fflush1 fflush2.chkexe_: fflush1.chkexe_ diff --git a/fortran/test/Makefile.in b/fortran/test/Makefile.in index 4ec1ad5..4e9bbd6 100644 --- a/fortran/test/Makefile.in +++ b/fortran/test/Makefile.in @@ -14,6 +14,7 @@ @SET_MAKE@ + VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ @@ -87,9 +88,9 @@ DIST_COMMON = $(top_srcdir)/config/commence.am \ # want to build a shared C library and a static Fortran library. If so, # pass the -static flag to the library linker. @FORTRAN_SHARED_CONDITIONAL_FALSE@am__append_1 = -static -@FORTRAN_2003_CONDITIONAL_F_TRUE@am__append_2 = fortranlib_test_F03 -check_PROGRAMS = $(am__EXEEXT_2) -TESTS = $(am__EXEEXT_2) +check_PROGRAMS = $(am__EXEEXT_1) +noinst_PROGRAMS = H5_test_buildiface$(EXEEXT) +TESTS = $(am__EXEEXT_1) subdir = fortran/test ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/aclocal_cxx.m4 \ @@ -97,34 +98,25 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/aclocal_cxx.m4 \ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/bin/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/src/H5config.h +CONFIG_HEADER = $(top_builddir)/src/H5config.h \ + $(top_builddir)/fortran/src/H5config_f.inc CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libh5test_fortran_la_LIBADD = -am__libh5test_fortran_la_SOURCES_DIST = tf_F90.f90 tf.f90 t.c \ - tf_F03.f90 tf_F08.f90 -@FORTRAN_2003_CONDITIONAL_F_FALSE@@FORTRAN_HAVE_STORAGE_SIZE_FALSE@am_libh5test_fortran_la_OBJECTS = tf_F90.lo \ -@FORTRAN_2003_CONDITIONAL_F_FALSE@@FORTRAN_HAVE_STORAGE_SIZE_FALSE@ tf.lo \ -@FORTRAN_2003_CONDITIONAL_F_FALSE@@FORTRAN_HAVE_STORAGE_SIZE_FALSE@ t.lo -@FORTRAN_2003_CONDITIONAL_F_TRUE@@FORTRAN_HAVE_STORAGE_SIZE_FALSE@am_libh5test_fortran_la_OBJECTS = tf_F03.lo \ -@FORTRAN_2003_CONDITIONAL_F_TRUE@@FORTRAN_HAVE_STORAGE_SIZE_FALSE@ tf.lo \ -@FORTRAN_2003_CONDITIONAL_F_TRUE@@FORTRAN_HAVE_STORAGE_SIZE_FALSE@ t.lo -@FORTRAN_HAVE_C_SIZEOF_FALSE@@FORTRAN_HAVE_STORAGE_SIZE_TRUE@am_libh5test_fortran_la_OBJECTS = tf_F03.lo \ -@FORTRAN_HAVE_C_SIZEOF_FALSE@@FORTRAN_HAVE_STORAGE_SIZE_TRUE@ tf.lo \ -@FORTRAN_HAVE_C_SIZEOF_FALSE@@FORTRAN_HAVE_STORAGE_SIZE_TRUE@ t.lo -@FORTRAN_HAVE_C_SIZEOF_TRUE@@FORTRAN_HAVE_STORAGE_SIZE_TRUE@am_libh5test_fortran_la_OBJECTS = tf_F08.lo \ -@FORTRAN_HAVE_C_SIZEOF_TRUE@@FORTRAN_HAVE_STORAGE_SIZE_TRUE@ tf.lo \ -@FORTRAN_HAVE_C_SIZEOF_TRUE@@FORTRAN_HAVE_STORAGE_SIZE_TRUE@ t.lo +am_libh5test_fortran_la_OBJECTS = tf_gen.lo tf.lo t.lo libh5test_fortran_la_OBJECTS = $(am_libh5test_fortran_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = -@FORTRAN_2003_CONDITIONAL_F_TRUE@am__EXEEXT_1 = \ -@FORTRAN_2003_CONDITIONAL_F_TRUE@ fortranlib_test_F03$(EXEEXT) -am__EXEEXT_2 = fortranlib_test$(EXEEXT) fflush1$(EXEEXT) \ - fflush2$(EXEEXT) fortranlib_test_1_8$(EXEEXT) $(am__EXEEXT_1) +am__EXEEXT_1 = fortranlib_test$(EXEEXT) fflush1$(EXEEXT) \ + fflush2$(EXEEXT) fortranlib_test_1_8$(EXEEXT) \ + fortranlib_test_F03$(EXEEXT) +PROGRAMS = $(noinst_PROGRAMS) +am_H5_test_buildiface_OBJECTS = H5_test_buildiface.$(OBJEXT) +H5_test_buildiface_OBJECTS = $(am_H5_test_buildiface_OBJECTS) +H5_test_buildiface_DEPENDENCIES = am_fflush1_OBJECTS = fflush1.$(OBJEXT) fflush1_OBJECTS = $(am_fflush1_OBJECTS) fflush1_LDADD = $(LDADD) @@ -159,18 +151,10 @@ fortranlib_test_1_8_OBJECTS = $(am_fortranlib_test_1_8_OBJECTS) fortranlib_test_1_8_LDADD = $(LDADD) fortranlib_test_1_8_DEPENDENCIES = libh5test_fortran.la $(LIBH5TEST) \ $(LIBH5F) $(LIBHDF5) -am__fortranlib_test_F03_SOURCES_DIST = tH5E_F03.f90 tH5F_F03.f90 \ - tH5L_F03.f90 tH5O_F03.f90 tH5P_F03.f90 tH5T_F03.f90 \ - tHDF5_F03.f90 fortranlib_test_F03.f90 -@FORTRAN_2003_CONDITIONAL_F_TRUE@am_fortranlib_test_F03_OBJECTS = \ -@FORTRAN_2003_CONDITIONAL_F_TRUE@ tH5E_F03.$(OBJEXT) \ -@FORTRAN_2003_CONDITIONAL_F_TRUE@ tH5F_F03.$(OBJEXT) \ -@FORTRAN_2003_CONDITIONAL_F_TRUE@ tH5L_F03.$(OBJEXT) \ -@FORTRAN_2003_CONDITIONAL_F_TRUE@ tH5O_F03.$(OBJEXT) \ -@FORTRAN_2003_CONDITIONAL_F_TRUE@ tH5P_F03.$(OBJEXT) \ -@FORTRAN_2003_CONDITIONAL_F_TRUE@ tH5T_F03.$(OBJEXT) \ -@FORTRAN_2003_CONDITIONAL_F_TRUE@ tHDF5_F03.$(OBJEXT) \ -@FORTRAN_2003_CONDITIONAL_F_TRUE@ fortranlib_test_F03.$(OBJEXT) +am_fortranlib_test_F03_OBJECTS = tH5E_F03.$(OBJEXT) tH5F_F03.$(OBJEXT) \ + tH5L_F03.$(OBJEXT) tH5O_F03.$(OBJEXT) tH5P_F03.$(OBJEXT) \ + tH5T_F03.$(OBJEXT) tHDF5_F03.$(OBJEXT) \ + fortranlib_test_F03.$(OBJEXT) fortranlib_test_F03_OBJECTS = $(am_fortranlib_test_F03_OBJECTS) fortranlib_test_F03_LDADD = $(LDADD) fortranlib_test_F03_DEPENDENCIES = libh5test_fortran.la $(LIBH5TEST) \ @@ -187,10 +171,28 @@ AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = -DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src -I$(top_builddir)/fortran/src depcomp = $(SHELL) $(top_srcdir)/bin/depcomp am__depfiles_maybe = depfiles am__mv = mv -f +PPFCCOMPILE = $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) +LTPPFCCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=FC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_FCFLAGS) $(FCFLAGS) +AM_V_PPFC = $(am__v_PPFC_@AM_V@) +am__v_PPFC_ = $(am__v_PPFC_@AM_DEFAULT_V@) +am__v_PPFC_0 = @echo " PPFC " $@; +am__v_PPFC_1 = +FCLD = $(FC) +FCLINK = $(LIBTOOL) $(AM_V_lt) --tag=FC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(FCLD) $(AM_FCFLAGS) $(FCFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_FCLD = $(am__v_FCLD_@AM_V@) +am__v_FCLD_ = $(am__v_FCLD_@AM_DEFAULT_V@) +am__v_FCLD_0 = @echo " FCLD " $@; +am__v_FCLD_1 = COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ @@ -216,21 +218,14 @@ AM_V_FC = $(am__v_FC_@AM_V@) am__v_FC_ = $(am__v_FC_@AM_DEFAULT_V@) am__v_FC_0 = @echo " FC " $@; am__v_FC_1 = -FCLD = $(FC) -FCLINK = $(LIBTOOL) $(AM_V_lt) --tag=FC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(FCLD) $(AM_FCFLAGS) $(FCFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_FCLD = $(am__v_FCLD_@AM_V@) -am__v_FCLD_ = $(am__v_FCLD_@AM_DEFAULT_V@) -am__v_FCLD_0 = @echo " FCLD " $@; -am__v_FCLD_1 = -SOURCES = $(libh5test_fortran_la_SOURCES) $(fflush1_SOURCES) \ +SOURCES = $(libh5test_fortran_la_SOURCES) \ + $(H5_test_buildiface_SOURCES) $(fflush1_SOURCES) \ + $(fflush2_SOURCES) $(fortranlib_test_SOURCES) \ + $(fortranlib_test_1_8_SOURCES) $(fortranlib_test_F03_SOURCES) +DIST_SOURCES = $(libh5test_fortran_la_SOURCES) \ + $(H5_test_buildiface_SOURCES) $(fflush1_SOURCES) \ $(fflush2_SOURCES) $(fortranlib_test_SOURCES) \ $(fortranlib_test_1_8_SOURCES) $(fortranlib_test_F03_SOURCES) -DIST_SOURCES = $(am__libh5test_fortran_la_SOURCES_DIST) \ - $(fflush1_SOURCES) $(fflush2_SOURCES) \ - $(fortranlib_test_SOURCES) $(fortranlib_test_1_8_SOURCES) \ - $(am__fortranlib_test_F03_SOURCES_DIST) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ @@ -522,14 +517,21 @@ F9XMODEXT = @F9XMODEXT@ F9XMODFLAG = @F9XMODFLAG@ F9XSUFFIXFLAG = @F9XSUFFIXFLAG@ FC = @FC@ -FC2003 = @FC2003@ FCFLAGS = @FCFLAGS@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ +FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ +FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ +FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ +H5CONFIG_F_IKIND = @H5CONFIG_F_IKIND@ +H5CONFIG_F_NUM_IKIND = @H5CONFIG_F_NUM_IKIND@ +H5CONFIG_F_NUM_RKIND = @H5CONFIG_F_NUM_RKIND@ +H5CONFIG_F_RKIND = @H5CONFIG_F_RKIND@ +H5CONFIG_F_RKIND_SIZEOF = @H5CONFIG_F_RKIND_SIZEOF@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ @@ -539,13 +541,12 @@ H5_LDFLAGS = @H5_LDFLAGS@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ -HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_Fortran_INTEGER_SIZEOF_16 = @HAVE_Fortran_INTEGER_SIZEOF_16@ HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ HDF_FORTRAN = @HDF_FORTRAN@ -HDF_FORTRAN2003 = @HDF_FORTRAN2003@ HID_T = @HID_T@ HL = @HL@ HL_FOR = @HL_FOR@ @@ -587,6 +588,18 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PAC_C_MAX_REAL_PRECISION = @PAC_C_MAX_REAL_PRECISION@ +PAC_FC_ALL_INTEGER_KINDS = @PAC_FC_ALL_INTEGER_KINDS@ +PAC_FC_ALL_INTEGER_KINDS_SIZEOF = @PAC_FC_ALL_INTEGER_KINDS_SIZEOF@ +PAC_FC_ALL_REAL_KINDS = @PAC_FC_ALL_REAL_KINDS@ +PAC_FC_ALL_REAL_KINDS_SIZEOF = @PAC_FC_ALL_REAL_KINDS_SIZEOF@ +PAC_FC_MAX_REAL_PRECISION = @PAC_FC_MAX_REAL_PRECISION@ +PAC_FORTRAN_NATIVE_DOUBLE_KIND = @PAC_FORTRAN_NATIVE_DOUBLE_KIND@ +PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF = @PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF@ +PAC_FORTRAN_NATIVE_INTEGER_KIND = @PAC_FORTRAN_NATIVE_INTEGER_KIND@ +PAC_FORTRAN_NATIVE_INTEGER_SIZEOF = @PAC_FORTRAN_NATIVE_INTEGER_SIZEOF@ +PAC_FORTRAN_NATIVE_REAL_KIND = @PAC_FORTRAN_NATIVE_REAL_KIND@ +PAC_FORTRAN_NATIVE_REAL_SIZEOF = @PAC_FORTRAN_NATIVE_REAL_SIZEOF@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ @@ -732,39 +745,10 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 *.h5 *.raw # The Fortran test library noinst_LTLIBRARIES = libh5test_fortran.la -@FORTRAN_2003_CONDITIONAL_F_FALSE@ff_PREFIX = F90 - -# Check if the compiler supports the Fortran 2003 standard -# which should include the intrinsic module iso_c_binding -@FORTRAN_2003_CONDITIONAL_F_TRUE@ff_PREFIX = F03 # Our main targets, the tests themselves -TEST_PROG = fortranlib_test fflush1 fflush2 fortranlib_test_1_8 \ - $(am__append_2) - -# tf.f90 depends on either tf_F08.f90 or tf_F03.f90 so they need to be -# compiled first -@FORTRAN_2003_CONDITIONAL_F_FALSE@@FORTRAN_HAVE_STORAGE_SIZE_FALSE@libh5test_fortran_la_SOURCES = tf_F90.f90 \ -@FORTRAN_2003_CONDITIONAL_F_FALSE@@FORTRAN_HAVE_STORAGE_SIZE_FALSE@ tf.f90 \ -@FORTRAN_2003_CONDITIONAL_F_FALSE@@FORTRAN_HAVE_STORAGE_SIZE_FALSE@ t.c - -# tf.f90 depends on either tf_F08.f90 or tf_F03.f90 so they need to be -# compiled first -@FORTRAN_2003_CONDITIONAL_F_TRUE@@FORTRAN_HAVE_STORAGE_SIZE_FALSE@libh5test_fortran_la_SOURCES = tf_F03.f90 \ -@FORTRAN_2003_CONDITIONAL_F_TRUE@@FORTRAN_HAVE_STORAGE_SIZE_FALSE@ tf.f90 \ -@FORTRAN_2003_CONDITIONAL_F_TRUE@@FORTRAN_HAVE_STORAGE_SIZE_FALSE@ t.c - -# tf.f90 depends on either tf_F08.f90 or tf_F03.f90 so they need to be -# compiled first -@FORTRAN_HAVE_C_SIZEOF_FALSE@@FORTRAN_HAVE_STORAGE_SIZE_TRUE@libh5test_fortran_la_SOURCES = tf_F03.f90 \ -@FORTRAN_HAVE_C_SIZEOF_FALSE@@FORTRAN_HAVE_STORAGE_SIZE_TRUE@ tf.f90 \ -@FORTRAN_HAVE_C_SIZEOF_FALSE@@FORTRAN_HAVE_STORAGE_SIZE_TRUE@ t.c - -# tf.f90 depends on either tf_F08.f90 or tf_F03.f90 so they need to be -# compiled first -@FORTRAN_HAVE_C_SIZEOF_TRUE@@FORTRAN_HAVE_STORAGE_SIZE_TRUE@libh5test_fortran_la_SOURCES = tf_F08.f90 \ -@FORTRAN_HAVE_C_SIZEOF_TRUE@@FORTRAN_HAVE_STORAGE_SIZE_TRUE@ tf.f90 \ -@FORTRAN_HAVE_C_SIZEOF_TRUE@@FORTRAN_HAVE_STORAGE_SIZE_TRUE@ t.c +TEST_PROG = fortranlib_test fflush1 fflush2 fortranlib_test_1_8 fortranlib_test_F03 +libh5test_fortran_la_SOURCES = tf_gen.F90 tf.F90 t.c # Source files are used for both the library and fortranlib_test. # Automake will complain about this without the following workaround. @@ -773,11 +757,11 @@ fortranlib_test_CFLAGS = $(AM_CFLAGS) fortranlib_test_SOURCES = tH5F.f90 tH5D.f90 tH5R.f90 tH5S.f90 tH5T.f90 tH5VL.f90 tH5Z.f90 \ tH5Sselect.f90 tH5P.f90 tH5A.f90 tH5I.f90 tH5G.f90 tH5E.f90 tHDF5.f90 fortranlib_test.f90 -fortranlib_test_1_8_SOURCES = tH5O.f90 tH5A_1_8.f90 tH5G_1_8.f90 tH5MISC_1_8.f90 tHDF5_1_8.f90\ +fortranlib_test_1_8_SOURCES = tH5O.f90 tH5A_1_8.f90 tH5G_1_8.f90 tH5MISC_1_8.f90 tHDF5_1_8.f90 \ fortranlib_test_1_8.f90 -@FORTRAN_2003_CONDITIONAL_F_TRUE@fortranlib_test_F03_SOURCES = tH5E_F03.f90 tH5F_F03.f90 tH5L_F03.f90 \ -@FORTRAN_2003_CONDITIONAL_F_TRUE@ tH5O_F03.f90 tH5P_F03.f90 tH5T_F03.f90 tHDF5_F03.f90 fortranlib_test_F03.f90 +fortranlib_test_F03_SOURCES = tH5E_F03.f90 tH5F_F03.f90 tH5L_F03.f90 \ + tH5O_F03.f90 tH5P_F03.f90 tH5T_F03.F90 tHDF5_F03.f90 fortranlib_test_F03.f90 fflush1_SOURCES = fflush1.f90 fflush2_SOURCES = fflush2.f90 @@ -790,6 +774,14 @@ MOSTLYCLEANFILES = *.tmp # from tests in conclude.am) FORTRAN_API = yes +# H5_test_buildiface.F90 is included in the distribution, and Automake knows +# how to compile a fortran program given its sources. +H5_test_buildiface_SOURCES = H5_test_buildiface.F90 + +# The build of the H5_test_buildiface does depend on any libraries, so set it +# to nothing. +H5_test_buildiface_LDADD = + # Automake needs to be taught how to build lib, progs, and tests targets. # These will be filled in automatically for the most part (e.g., # lib_LIBRARIES are built for lib target), but EXTRA_LIB, EXTRA_PROG, and @@ -812,7 +804,7 @@ TEST_SCRIPT_PARA_CHKSH = $(TEST_SCRIPT_PARA:=.chkexe_) all: all-am .SUFFIXES: -.SUFFIXES: .c .f90 .lo .log .o .obj .sh .sh$(EXEEXT) .trs +.SUFFIXES: .F90 .c .f90 .lo .log .o .obj .sh .sh$(EXEEXT) .trs $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/config/commence.am $(top_srcdir)/config/conclude.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ @@ -868,6 +860,19 @@ clean-checkPROGRAMS: echo " rm -f" $$list; \ rm -f $$list +clean-noinstPROGRAMS: + @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list + +H5_test_buildiface$(EXEEXT): $(H5_test_buildiface_OBJECTS) $(H5_test_buildiface_DEPENDENCIES) $(EXTRA_H5_test_buildiface_DEPENDENCIES) + @rm -f H5_test_buildiface$(EXEEXT) + $(AM_V_FCLD)$(FCLINK) $(H5_test_buildiface_OBJECTS) $(H5_test_buildiface_LDADD) $(LIBS) + fflush1$(EXEEXT): $(fflush1_OBJECTS) $(fflush1_DEPENDENCIES) $(EXTRA_fflush1_DEPENDENCIES) @rm -f fflush1$(EXEEXT) $(AM_V_FCLD)$(FCLINK) $(fflush1_OBJECTS) $(fflush1_LDADD) $(LIBS) @@ -896,6 +901,15 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t.Plo@am__quote@ +.F90.o: + $(AM_V_PPFC)$(PPFCCOMPILE) -c -o $@ $< + +.F90.obj: + $(AM_V_PPFC)$(PPFCCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.F90.lo: + $(AM_V_PPFC)$(LTPPFCCOMPILE) -c -o $@ $< + .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @@ -1288,7 +1302,7 @@ check-am: all-am $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-am -all-am: Makefile $(LTLIBRARIES) all-local +all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) all-local installdirs: install: install-am install-exec: install-exec-am @@ -1327,7 +1341,7 @@ maintainer-clean-generic: clean: clean-am clean-am: clean-checkPROGRAMS clean-generic clean-libtool clean-local \ - clean-noinstLTLIBRARIES mostlyclean-am + clean-noinstLTLIBRARIES clean-noinstPROGRAMS mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) @@ -1400,19 +1414,19 @@ uninstall-am: .PHONY: CTAGS GTAGS TAGS all all-am all-local check check-TESTS \ check-am clean clean-checkPROGRAMS clean-generic clean-libtool \ - clean-local clean-noinstLTLIBRARIES cscopelist-am ctags \ - ctags-am distclean distclean-compile distclean-generic \ - distclean-libtool distclean-local distclean-tags distdir dvi \ - dvi-am html html-am info info-am install install-am \ - install-data install-data-am install-dvi install-dvi-am \ - install-exec install-exec-am install-html install-html-am \ - install-info install-info-am install-man install-pdf \ - install-pdf-am install-ps install-ps-am install-strip \ - installcheck installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic maintainer-clean-local mostlyclean \ - mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ - mostlyclean-local pdf pdf-am ps ps-am recheck tags tags-am \ - uninstall uninstall-am + clean-local clean-noinstLTLIBRARIES clean-noinstPROGRAMS \ + cscopelist-am ctags ctags-am distclean distclean-compile \ + distclean-generic distclean-libtool distclean-local \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic \ + maintainer-clean-local mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool mostlyclean-local pdf \ + pdf-am ps ps-am recheck tags tags-am uninstall uninstall-am # @@ -1453,9 +1467,15 @@ maintainer-clean-local: clean-local distclean-local: clean-local clean-local: @if test -n "$(F9XMODEXT)" && test "X$(F9XMODEXT)" != "Xo"; then \ - $(RM) *.$(F9XMODEXT); \ + $(RM) *.$(F9XMODEXT) tf_gen.F90; \ fi +# H5_test_buildiface.F90 generates all the test APIs that have a KIND type associated +# with them. + +tf_gen.F90: H5_test_buildiface$(EXEEXT) + $(RUNSERIAL) ./H5_test_buildiface$(EXEEXT) + # fflush2 depends on files created by fflush1 fflush2.chkexe_: fflush1.chkexe_ diff --git a/fortran/test/fflush2.f90 b/fortran/test/fflush2.f90 index 04ce439..4230832 100644 --- a/fortran/test/fflush2.f90 +++ b/fortran/test/fflush2.f90 @@ -27,152 +27,151 @@ ! !***** - PROGRAM FFLUSH2EXAMPLE - - USE HDF5 ! This module contains all necessary modules - USE TH5_MISC - - IMPLICIT NONE - - CHARACTER(LEN=7), PARAMETER :: filename = "fflush1" - CHARACTER(LEN=80) :: fix_filename - - ! - !data space rank and dimensions - ! - INTEGER, PARAMETER :: NX = 4 - INTEGER, PARAMETER :: NY = 5 - - ! - ! File identifiers - ! - INTEGER(HID_T) :: file_id - - ! - ! Group identifier - ! - INTEGER(HID_T) :: gid - - ! - ! dataset identifier - ! - INTEGER(HID_T) :: dset_id - - - ! - ! data type identifier - ! - INTEGER(HID_T) :: dtype_id - - ! - !flag to check operation success - ! - INTEGER :: error - - ! - !general purpose integer - ! - INTEGER :: i, j, total_error = 0 - - ! - !data buffers - ! - INTEGER, DIMENSION(NX,NY) :: data_out - INTEGER(HSIZE_T), DIMENSION(2) :: data_dims - data_dims(1) = NX - data_dims(2) = NY - - ! - !Initialize FORTRAN predifined datatypes - ! - CALL h5open_f(error) - CALL check("h5open_f",error,total_error) - - ! - !Open the file. - ! - CALL h5_fixname_f(filename, fix_filename, H5P_DEFAULT_F, error) - if (error .ne. 0) then - write(*,*) "Cannot modify filename" - CALL h5_exit_f (1) - endif - CALL h5fopen_f(fix_filename, H5F_ACC_RDONLY_F, file_id, error) - CALL check("h5fopen_f",error,total_error) - - ! - !Open the dataset - ! - CALL h5dopen_f(file_id, "/D", dset_id, error) - CALL check("h5dopen_f",error,total_error) - - ! - !Get dataset's data type. - ! - CALL h5dget_type_f(dset_id, dtype_id, error) - CALL check("h5dget_type_f",error,total_error) - - ! - !Read the dataset. - ! - CALL h5dread_f(dset_id, dtype_id, data_out, data_dims, error) - CALL check("h5dread_f",error,total_error) - - ! - !Print the dataset. - ! - do i = 1, NX - write(*,*) (data_out(i,j), j = 1, NY) - end do -! -!result of the print statement -! -! 0, 1, 2, 3, 4 -! 1, 2, 3, 4, 5 -! 2, 3, 4, 5, 6 -! 3, 4, 5, 6, 7 - - ! - !Open the group. - ! - CALL h5gopen_f(file_id, "G", gid, error) - CALL check("h5gopen_f",error,total_error) - - ! - !In case error happens, exit. - ! - IF (error == -1) CALL h5_exit_f (1) - ! - !Close the datatype - ! - CALL h5tclose_f(dtype_id, error) - CALL check("h5tclose_f",error,total_error) - - ! - !Close the dataset. - ! - CALL h5dclose_f(dset_id, error) - CALL check("h5dclose_f",error,total_error) - - ! - !Close the group. - ! - CALL h5gclose_f(gid, error) - CALL check("h5gclose_f",error,total_error) - - ! - !Close the file. - ! - CALL h5fclose_f(file_id, error) - CALL check("h5fclose_f",error,total_error) - - ! - !Close FORTRAN predifined datatypes - ! - CALL h5_cleanup_f(filename, H5P_DEFAULT_F, error) - CALL h5close_f(error) - CALL check("h5close_types_f",error,total_error) - - ! if errors detected, exit with non-zero code. - IF (total_error .ne. 0) CALL h5_exit_f (1) - - END PROGRAM FFLUSH2EXAMPLE +PROGRAM FFLUSH2EXAMPLE + + USE HDF5 ! This module contains all necessary modules + USE TH5_MISC + + IMPLICIT NONE + + CHARACTER(LEN=7), PARAMETER :: filename = "fflush1" + CHARACTER(LEN=80) :: fix_filename + + ! + !data space rank and dimensions + ! + INTEGER, PARAMETER :: NX = 4 + INTEGER, PARAMETER :: NY = 5 + + ! + ! File identifiers + ! + INTEGER(HID_T) :: file_id + + ! + ! Group identifier + ! + INTEGER(HID_T) :: gid + + ! + ! dataset identifier + ! + INTEGER(HID_T) :: dset_id + + + ! + ! data type identifier + ! + INTEGER(HID_T) :: dtype_id + + ! + !flag to check operation success + ! + INTEGER :: error + + ! + !general purpose integer + ! + INTEGER :: i, j, total_error = 0 + + ! + !data buffers + ! + INTEGER, DIMENSION(NX,NY) :: data_out + INTEGER(HSIZE_T), DIMENSION(2) :: data_dims + data_dims(1) = NX + data_dims(2) = NY + + ! + !Initialize FORTRAN predifined datatypes + ! + CALL h5open_f(error) + CALL check("h5open_f",error,total_error) + + ! + !Open the file. + ! + CALL h5_fixname_f(filename, fix_filename, H5P_DEFAULT_F, error) + IF (error .NE. 0) THEN + WRITE(*,*) "Cannot modify filename" + CALL h5_exit_f (1) + ENDIF + CALL h5fopen_f(fix_filename, H5F_ACC_RDONLY_F, file_id, error) + CALL check("h5fopen_f",error,total_error) + + ! + !Open the dataset + ! + CALL h5dopen_f(file_id, "/D", dset_id, error) + CALL check("h5dopen_f",error,total_error) + + ! + !Get dataset's data type. + ! + CALL h5dget_type_f(dset_id, dtype_id, error) + CALL check("h5dget_type_f",error,total_error) + ! + !Read the dataset. + ! + CALL h5dread_f(dset_id, dtype_id, data_out, data_dims, error) + CALL check("h5dread_f",error,total_error) + + ! + !Print the dataset. + ! + DO i = 1, NX + WRITE(*,*) (data_out(i,j), j = 1, NY) + END DO + ! + !result of the print statement + ! + ! 0, 1, 2, 3, 4 + ! 1, 2, 3, 4, 5 + ! 2, 3, 4, 5, 6 + ! 3, 4, 5, 6, 7 + + ! + !Open the group. + ! + CALL h5gopen_f(file_id, "G", gid, error) + CALL check("h5gopen_f",error,total_error) + + ! + !In case error happens, exit. + ! + IF (error == -1) CALL h5_exit_f (1) + ! + !Close the datatype + ! + CALL h5tclose_f(dtype_id, error) + CALL check("h5tclose_f",error,total_error) + + ! + !Close the dataset. + ! + CALL h5dclose_f(dset_id, error) + CALL check("h5dclose_f",error,total_error) + + ! + !Close the group. + ! + CALL h5gclose_f(gid, error) + CALL check("h5gclose_f",error,total_error) + + ! + !Close the file. + ! + CALL h5fclose_f(file_id, error) + CALL check("h5fclose_f",error,total_error) + + ! + !Close FORTRAN predifined datatypes + ! + CALL h5_cleanup_f(filename, H5P_DEFAULT_F, error) + CALL h5close_f(error) + CALL check("h5close_types_f",error,total_error) + + ! if errors detected, exit with non-zero code. + IF (total_error .ne. 0) CALL h5_exit_f (1) + +END PROGRAM FFLUSH2EXAMPLE diff --git a/fortran/test/tH5A.f90 b/fortran/test/tH5A.f90 index e3b3b2a..5b814fa 100644 --- a/fortran/test/tH5A.f90 +++ b/fortran/test/tH5A.f90 @@ -29,6 +29,10 @@ !***** MODULE TH5A + USE HDF5 ! This module contains all necessary modules + USE TH5_MISC + USE TH5_MISC_GEN + CONTAINS SUBROUTINE attribute_test(cleanup, total_error) @@ -36,9 +40,6 @@ CONTAINS ! h5acreate_f, h5awrite_f, h5aclose_f,h5aread_f, h5aopen_name_f, ! h5aget_name_f,h5aget_space_f, h5aget_type_f, ! - - USE HDF5 ! This module contains all necessary modules - USE TH5_MISC IMPLICIT NONE LOGICAL, INTENT(IN) :: cleanup INTEGER, INTENT(INOUT) :: total_error @@ -309,7 +310,7 @@ CONTAINS ! CALL h5aget_storage_size_f(attr_id, attr_storage, error) CALL check("h5aget_storage_size_f",error,total_error) -! CALL VERIFY("h5aget_storage_size_f",attr_storage,*SizeOf(attr_storage),total_error) +! CALL verify("h5aget_storage_size_f",attr_storage,*SizeOf(attr_storage),total_error) CALL h5aget_storage_size_f(attr2_id, attr_storage, error) CALL check("h5aget_storage_size_f",error,total_error) ! CALL verify("h5aget_storage_size_f",attr_storage,1,total_error) @@ -517,21 +518,15 @@ CONTAINS data_dims(1) = 1 CALL h5aread_f(attr3_id, H5T_NATIVE_DOUBLE, aread_double_data, data_dims, error) CALL check("h5aread_f",error,total_error) + CALL VERIFY("Read back double attrbute is wrong", aread_double_data(1),3.459_Fortran_DOUBLE,total_error) - IF( .NOT.dreal_eq( REAL(aread_double_data(1),dp), 3.459_dp) )THEN - WRITE(*,*) "Read back double attrbute is wrong", aread_double_data(1) - total_error = total_error + 1 - ENDIF ! !read the real attribute data back to memory ! data_dims(1) = 1 CALL h5aread_f(attr4_id, H5T_NATIVE_REAL, aread_real_data, data_dims, error) CALL check("h5aread_f",error,total_error) - IF( .NOT.dreal_eq( REAL(aread_real_data(1),dp), 4.0_dp) )THEN - WRITE(*,*) "Read back real attrbute is wrong", aread_real_data(1) - total_error = total_error + 1 - ENDIF + CALL VERIFY("Read back real attrbute is wrong", aread_real_data(1),4.0,total_error) ! !read the Integer attribute data back to memory ! diff --git a/fortran/test/tH5A_1_8.f90 b/fortran/test/tH5A_1_8.f90 index 8e20100..c70e288 100644 --- a/fortran/test/tH5A_1_8.f90 +++ b/fortran/test/tH5A_1_8.f90 @@ -32,6 +32,10 @@ !***** MODULE TH5A_1_8 + USE HDF5 ! This module contains all necessary modules + USE TH5_MISC + USE TH5_MISC_GEN + CONTAINS SUBROUTINE attribute_test_1_8(cleanup, total_error) @@ -41,8 +45,6 @@ SUBROUTINE attribute_test_1_8(cleanup, total_error) ! H5Pset_shared_mesg_index_f ! - USE HDF5 ! This module contains all necessary modules - USE TH5_MISC IMPLICIT NONE LOGICAL, INTENT(IN) :: cleanup @@ -199,8 +201,6 @@ SUBROUTINE test_attr_corder_create_compact(fcpl,fapl, total_error) ! Needed for get_info_by_name - USE HDF5 ! This module contains all necessary modules - USE TH5_MISC IMPLICIT NONE @@ -350,7 +350,7 @@ SUBROUTINE test_attr_corder_create_compact(fcpl,fapl, total_error) ! Verify creation order of attribute - CALL verifyLogical("H5Aget_info_by_name_f", f_corder_valid, .TRUE., total_error) + CALL verify("H5Aget_info_by_name_f", f_corder_valid, .TRUE., total_error) CALL verify("H5Aget_info_by_name_f", corder, u, total_error) @@ -363,7 +363,7 @@ SUBROUTINE test_attr_corder_create_compact(fcpl,fapl, total_error) ! Verify creation order of attribute - CALL verifyLogical("H5Aget_info_by_name_f", f_corder_valid, .TRUE., total_error) + CALL verify("H5Aget_info_by_name_f", f_corder_valid, .TRUE., total_error) CALL verify("H5Aget_info_by_name_f", corder, u, total_error) END DO @@ -389,8 +389,7 @@ SUBROUTINE test_attr_null_space(fcpl, fapl, total_error) !** Tests storing attribute with "null" dataspace !** !*************************************************************** - USE HDF5 - USE TH5_MISC + IMPLICIT NONE @@ -473,22 +472,22 @@ SUBROUTINE test_attr_null_space(fcpl, fapl, total_error) CALL H5Sextent_equal_f(attr_sid, null_sid, equal, error) CALL check("H5Sextent_equal_f",error,total_error) - CALL Verifylogical("H5Sextent_equal_f",equal,.TRUE.,total_error) + CALL verify("H5Sextent_equal_f",equal,.TRUE.,total_error) CALL h5aget_storage_size_f(attr, storage_size, error) CALL check("h5aget_storage_size_f",error,total_error) - CALL VERIFY("h5aget_storage_size_f",INT(storage_size),0,total_error) + CALL verify("h5aget_storage_size_f",INT(storage_size),0,total_error) CALL h5aget_info_f(attr, f_corder_valid, corder, cset, data_size, error) CALL check("h5aget_info_f", error, total_error) ! Check the attribute's information - CALL VERIFY("h5aget_info_f.corder",corder,0,total_error) + CALL verify("h5aget_info_f.corder",corder,0,total_error) - CALL VERIFY("h5aget_info_f.cset", cset, H5T_CSET_ASCII_F, total_error) + CALL verify("h5aget_info_f.cset", cset, H5T_CSET_ASCII_F, total_error) CALL h5aget_storage_size_f(attr, storage_size, error) CALL check("h5aget_storage_size_f",error,total_error) - CALL VERIFY("h5aget_info_f.data_size", INT(data_size), INT(storage_size), total_error) + CALL verify("h5aget_info_f.data_size", INT(data_size), INT(storage_size), total_error) CALL h5aclose_f(attr,error) CALL check("h5aclose_f",error,total_error) @@ -520,9 +519,6 @@ SUBROUTINE test_attr_create_by_name(new_format,fcpl,fapl, total_error) !** !*************************************************************** - USE HDF5 - USE TH5_MISC - IMPLICIT NONE INTEGER(SIZE_T), PARAMETER :: NAME_BUF_SIZE = 7 @@ -735,9 +731,6 @@ SUBROUTINE test_attr_info_by_idx(new_format, fcpl, fapl, total_error) !** !*************************************************************** - USE HDF5 - USE TH5_MISC - IMPLICIT NONE LOGICAL :: new_format @@ -859,24 +852,24 @@ SUBROUTINE test_attr_info_by_idx(new_format, fcpl, fapl, total_error) CALL h5aget_info_by_idx_f(my_dataset, ".", H5_INDEX_CRT_ORDER_F, H5_ITER_INC_F, 0_hsize_t, & f_corder_valid, corder, cset, data_size, error, lapl_id=H5P_DEFAULT_F) - CALL VERIFY("h5aget_info_by_idx_f",error,minusone,total_error) + CALL verify("h5aget_info_by_idx_f",error,minusone,total_error) ! 2) call by passing an integer with the INT(,hsize_t) declaration CALL h5aget_info_by_idx_f(my_dataset, ".", H5_INDEX_CRT_ORDER_F, H5_ITER_INC_F, INT(0,hsize_t), & f_corder_valid, corder, cset, data_size, error, lapl_id=H5P_DEFAULT_F) - CALL VERIFY("h5aget_info_by_idx_f",error,minusone,total_error) + CALL verify("h5aget_info_by_idx_f",error,minusone,total_error) ! 3) call by passing a variable with the attribute hsize_t CALL h5aget_info_by_idx_f(my_dataset, ".", H5_INDEX_CRT_ORDER_F, H5_ITER_INC_F, hzero, & f_corder_valid, corder, cset, data_size, error, lapl_id=H5P_DEFAULT_F) - CALL VERIFY("h5aget_info_by_idx_f",error,minusone,total_error) + CALL verify("h5aget_info_by_idx_f",error,minusone,total_error) CALL h5aget_name_by_idx_f(my_dataset, ".", H5_INDEX_CRT_ORDER_F, H5_ITER_INC_F, & hzero, tmpname, error, size, lapl_id=H5P_DEFAULT_F) - CALL VERIFY("h5aget_name_by_idx_f",error,minusone,total_error) + CALL verify("h5aget_name_by_idx_f",error,minusone,total_error) ! Create attributes, up to limit of compact form @@ -941,9 +934,6 @@ END SUBROUTINE test_attr_info_by_idx SUBROUTINE attr_info_by_idx_check(obj_id, attrname, n, use_index, total_error ) - USE HDF5 - USE TH5_MISC - IMPLICIT NONE INTEGER :: error, total_error @@ -974,7 +964,7 @@ SUBROUTINE attr_info_by_idx_check(obj_id, attrname, n, use_index, total_error ) f_corder_valid, corder, cset, data_size, error) CALL check("h5aget_info_by_idx_f",error,total_error) - CALL VERIFY("h5aget_info_by_idx_f",corder,INT(n),total_error) + CALL verify("h5aget_info_by_idx_f",corder,INT(n),total_error) ! Verify the name for new link, in increasing creation order @@ -983,12 +973,12 @@ SUBROUTINE attr_info_by_idx_check(obj_id, attrname, n, use_index, total_error ) CALL h5aget_name_by_idx_f(obj_id, ".", H5_INDEX_CRT_ORDER_F, H5_ITER_INC_F, & n, tmpname, error, NAME_BUF_SIZE) CALL check("h5aget_name_by_idx_f",error,total_error) - CALL VERIFY("h5aget_name_by_idx_f", INT(NAME_BUF_SIZE), 7, error) + CALL verify("h5aget_name_by_idx_f", INT(NAME_BUF_SIZE), 7, error) IF(attrname.NE.tmpname)THEN error = -1 ENDIF - CALL VERIFY("h5aget_name_by_idx_f",error,0,total_error) + CALL verify("h5aget_name_by_idx_f",error,0,total_error) ! Don't test "native" order if there is no creation order index, since ! * there's not a good way to easily predict the attribute's order in the name @@ -999,13 +989,13 @@ SUBROUTINE attr_info_by_idx_check(obj_id, attrname, n, use_index, total_error ) CALL h5aget_info_by_idx_f(obj_id, ".", H5_INDEX_CRT_ORDER_F, H5_ITER_NATIVE_F, hzero, & f_corder_valid, corder, cset, data_size, error) CALL check("h5aget_info_by_idx_f",error,total_error) - CALL VERIFY("h5aget_info_by_idx_f",corder,0,total_error) + CALL verify("h5aget_info_by_idx_f",corder,0,total_error) ! Verify the information for new attribute, in native creation order CALL h5aget_info_by_idx_f(obj_id, ".", H5_INDEX_CRT_ORDER_F, H5_ITER_NATIVE_F, n, & f_corder_valid, corder, cset, data_size, error) CALL check("h5aget_info_by_idx_f",error,total_error) - CALL VERIFY("h5aget_info_by_idx_f",corder,INT(n),total_error) + CALL verify("h5aget_info_by_idx_f",corder,INT(n),total_error) ! Verify the name for new link, in increasing native order CALL h5aget_name_by_idx_f(obj_id, ".", H5_INDEX_CRT_ORDER_F, H5_ITER_NATIVE_F, & @@ -1015,14 +1005,14 @@ SUBROUTINE attr_info_by_idx_check(obj_id, attrname, n, use_index, total_error ) WRITE(*,*) "ERROR: attribute name size wrong!" error = -1 ENDIF - CALL VERIFY("h5aget_name_by_idx_f",error,0,total_error) + CALL verify("h5aget_name_by_idx_f",error,0,total_error) END IF CALL h5aget_info_by_idx_f(obj_id, ".", H5_INDEX_CRT_ORDER_F, H5_ITER_DEC_F, n, & f_corder_valid, corder, cset, data_size, error) CALL check("h5aget_info_by_idx_f",error,total_error) - CALL VERIFY("h5aget_info_by_idx_f",corder,0,total_error) + CALL verify("h5aget_info_by_idx_f",corder,0,total_error) !EP CALL h5aget_info_by_idx_f(obj_id, ".", H5_INDEX_CRT_ORDER_F, H5_ITER_DEC_F, 0_HSIZE_T, & @@ -1033,41 +1023,41 @@ SUBROUTINE attr_info_by_idx_check(obj_id, attrname, n, use_index, total_error ) CALL h5aget_info_by_idx_f(obj_id, ".", H5_INDEX_CRT_ORDER_F, H5_ITER_DEC_F, 0_HSIZE_T, & f_corder_valid, corder, cset, data_size, error) CALL check("h5aget_info_by_idx_f",error,total_error) - CALL VERIFY("h5aget_info_by_idx_f",corder,INT(n),total_error) + CALL verify("h5aget_info_by_idx_f",corder,INT(n),total_error) ! 2) call by passing an integer with the INT(,hsize_t) declaration CALL h5aget_info_by_idx_f(obj_id, ".", H5_INDEX_CRT_ORDER_F, H5_ITER_DEC_F, INT(0,HSIZE_T), & f_corder_valid, corder, cset, data_size, error) CALL check("h5aget_info_by_idx_f",error,total_error) - CALL VERIFY("h5aget_info_by_idx_f",corder,INT(n),total_error) + CALL verify("h5aget_info_by_idx_f",corder,INT(n),total_error) ! 3) call by passing a variable with the attribute hsize_t CALL h5aget_info_by_idx_f(obj_id, ".", H5_INDEX_CRT_ORDER_F, H5_ITER_DEC_F, hzero, & f_corder_valid, corder, cset, data_size, error) CALL check("h5aget_info_by_idx_f",error,total_error) - CALL VERIFY("h5aget_info_by_idx_f",corder,INT(n),total_error) + CALL verify("h5aget_info_by_idx_f",corder,INT(n),total_error) !EP CALL h5aget_info_by_idx_f(obj_id, ".", H5_INDEX_NAME_F, H5_ITER_INC_F, 0_HSIZE_T, & CALL h5aget_info_by_idx_f(obj_id, ".", H5_INDEX_NAME_F, H5_ITER_INC_F, hzero, & f_corder_valid, corder, cset, data_size, error) CALL check("h5aget_info_by_idx_f",error,total_error) - CALL VERIFY("h5aget_info_by_idx_f",corder,0,total_error) + CALL verify("h5aget_info_by_idx_f",corder,0,total_error) CALL h5aget_info_by_idx_f(obj_id, ".", H5_INDEX_NAME_F, H5_ITER_INC_F, n, & f_corder_valid, corder, cset, data_size, error) CALL check("h5aget_info_by_idx_f",error,total_error) - CALL VERIFY("h5aget_info_by_idx_f",corder,INT(n),total_error) + CALL verify("h5aget_info_by_idx_f",corder,INT(n),total_error) CALL h5aget_info_by_idx_f(obj_id, ".", H5_INDEX_NAME_F, H5_ITER_DEC_F, n, & f_corder_valid, corder, cset, data_size, error) CALL check("h5aget_info_by_idx_f",error,total_error) - CALL VERIFY("h5aget_info_by_idx_f",corder,0,total_error) + CALL verify("h5aget_info_by_idx_f",corder,0,total_error) !EP CALL h5aget_info_by_idx_f(obj_id, ".", H5_INDEX_NAME_F, H5_ITER_DEC_F, 0_HSIZE_T, & CALL h5aget_info_by_idx_f(obj_id, ".", H5_INDEX_NAME_F, H5_ITER_DEC_F, hzero, & f_corder_valid, corder, cset, data_size, error) CALL check("h5aget_info_by_idx_f",error,total_error) - CALL VERIFY("h5aget_info_by_idx_f",corder,INT(n),total_error) + CALL verify("h5aget_info_by_idx_f",corder,INT(n),total_error) END SUBROUTINE attr_info_by_idx_check @@ -1082,9 +1072,6 @@ SUBROUTINE test_attr_shared_rename( fcpl, fapl, total_error) !** !*************************************************************** - USE HDF5 - USE TH5_MISC - IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: fcpl @@ -1371,7 +1358,7 @@ SUBROUTINE test_attr_shared_rename( fcpl, fapl, total_error) ! Check size of file !filesize = h5_get_file_size(FILENAME); - !VERIFY(filesize, empty_filesize, "h5_get_file_size"); + !verify(filesize, empty_filesize, "h5_get_file_size"); ENDDO ! Close dataspaces @@ -1392,9 +1379,6 @@ SUBROUTINE test_attr_delete_by_idx(new_format, fcpl, fapl, total_error) !** !*************************************************************** - USE HDF5 - USE TH5_MISC - IMPLICIT NONE LOGICAL, INTENT(IN) :: new_format @@ -1518,7 +1502,7 @@ SUBROUTINE test_attr_delete_by_idx(new_format, fcpl, fapl, total_error) ! Check for deleting non-existant attribute !EP CALL H5Adelete_by_idx_f(my_dataset, '.', idx_type, order, 0_HSIZE_T,error, lapl_id=H5P_DEFAULT_F) CALL H5Adelete_by_idx_f(my_dataset, '.', idx_type, order, hzero,error, lapl_id=H5P_DEFAULT_F) - CALL VERIFY("H5Adelete_by_idx_f",error,minusone,total_error) + CALL verify("H5Adelete_by_idx_f",error,minusone,total_error) ! Create attributes, up to limit of compact form DO u = 0, max_compact - 1 @@ -1546,7 +1530,7 @@ SUBROUTINE test_attr_delete_by_idx(new_format, fcpl, fapl, total_error) ! Check for out of bound deletions CALL H5Adelete_by_idx_f(my_dataset, ".", idx_type, order, INT(u,HSIZE_T), error, lapl_id=H5P_DEFAULT_F) - CALL VERIFY("H5Adelete_by_idx_f",error,minusone,total_error) + CALL verify("H5Adelete_by_idx_f",error,minusone,total_error) ENDDO @@ -1584,10 +1568,10 @@ SUBROUTINE test_attr_delete_by_idx(new_format, fcpl, fapl, total_error) IF(new_format)THEN IF(order.EQ.H5_ITER_INC_F)THEN - CALL VERIFY("H5Aget_info_by_idx_f",corder,u + 1,total_error) + CALL verify("H5Aget_info_by_idx_f",corder,u + 1,total_error) ENDIF ELSE - CALL VERIFY("H5Aget_info_by_idx_f",corder, max_compact-(u + 2),total_error) + CALL verify("H5Aget_info_by_idx_f",corder, max_compact-(u + 2),total_error) ENDIF ! Verify the name for first attribute in appropriate order @@ -1604,7 +1588,7 @@ SUBROUTINE test_attr_delete_by_idx(new_format, fcpl, fapl, total_error) attrname = 'attr '//chr2 ENDIF IF(TRIM(attrname).NE.TRIM(tmpname)) error = -1 - CALL VERIFY("h5aget_name_by_idx_f",error,0,total_error) + CALL verify("h5aget_name_by_idx_f",error,0,total_error) ENDDO ! Delete last attribute @@ -1655,7 +1639,7 @@ SUBROUTINE test_attr_delete_by_idx(new_format, fcpl, fapl, total_error) ENDDO ! Check for out of bound deletion CALL H5Adelete_by_idx_f(my_dataset, ".", idx_type, order, INT(u,HSIZE_T), error) - CALL VERIFY("H5Adelete_by_idx_f",error,minusone,total_error) + CALL verify("H5Adelete_by_idx_f",error,minusone,total_error) ENDDO ! Work on all the datasets @@ -1684,10 +1668,10 @@ SUBROUTINE test_attr_delete_by_idx(new_format, fcpl, fapl, total_error) f_corder_valid, corder, cset, data_size, error) IF(new_format)THEN IF(order.EQ.H5_ITER_INC_F)THEN - CALL VERIFY("H5Aget_info_by_idx_f",corder,u + 1,total_error) + CALL verify("H5Aget_info_by_idx_f",corder,u + 1,total_error) ENDIF ELSE - CALL VERIFY("H5Aget_info_by_idx_f",corder, ((max_compact * 2) - (u + 2)), total_error) + CALL verify("H5Aget_info_by_idx_f",corder, ((max_compact * 2) - (u + 2)), total_error) ENDIF ! Verify the name for first attribute in appropriate order @@ -1705,7 +1689,7 @@ SUBROUTINE test_attr_delete_by_idx(new_format, fcpl, fapl, total_error) attrname = 'attr '//chr2 ENDIF IF(TRIM(attrname).NE.TRIM(tmpname)) error = -1 - CALL VERIFY("h5aget_name_by_idx_f",error,0,total_error) + CALL verify("h5aget_name_by_idx_f",error,0,total_error) ENDDO @@ -1716,7 +1700,7 @@ SUBROUTINE test_attr_delete_by_idx(new_format, fcpl, fapl, total_error) ! Check for deletion on empty attribute storage again CALL H5Adelete_by_idx_f(my_dataset, ".", idx_type, order, INT(0,HSIZE_T), error) - CALL VERIFY("H5Adelete_by_idx_f",error,minusone,total_error) + CALL verify("H5Adelete_by_idx_f",error,minusone,total_error) ENDDO ! Close Datasets @@ -1753,9 +1737,6 @@ SUBROUTINE test_attr_shared_delete(fcpl, fapl, total_error) !** !*************************************************************** - USE HDF5 - USE TH5_MISC - IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: fcpl @@ -2030,9 +2011,6 @@ SUBROUTINE test_attr_dense_open( fcpl, fapl, total_error) !** !*************************************************************** - USE HDF5 - USE TH5_MISC - IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: fcpl @@ -2169,7 +2147,7 @@ SUBROUTINE test_attr_dense_open( fcpl, fapl, total_error) ! Check size of file ! filesize = h5_get_file_size(FILENAME); - ! VERIFY(filesize, empty_filesize, "h5_get_file_size") + ! verify(filesize, empty_filesize, "h5_get_file_size") END SUBROUTINE test_attr_dense_open @@ -2182,9 +2160,6 @@ END SUBROUTINE test_attr_dense_open SUBROUTINE test_attr_dense_verify(loc_id, max_attr, total_error) - USE HDF5 - USE TH5_MISC - IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: loc_id @@ -2227,7 +2202,7 @@ SUBROUTINE test_attr_dense_verify(loc_id, max_attr, total_error) CALL h5aread_f(attr, H5T_NATIVE_INTEGER, value, data_dims, error) CALL CHECK("H5Aread_F", error, total_error) - CALL VERIFY("H5Aread_F", value, u, total_error) + CALL verify("H5Aread_F", value, u, total_error) ! Close attribute CALL h5aclose_f(attr, error) @@ -2259,7 +2234,7 @@ SUBROUTINE test_attr_dense_verify(loc_id, max_attr, total_error) data_dims(1) = 1 CALL h5aread_f(attr, H5T_NATIVE_INTEGER, value, data_dims, error) CALL CHECK("H5Aread_f", error, total_error) - CALL VERIFY("H5Aread_f", value, u, total_error) + CALL verify("H5Aread_f", value, u, total_error) ! Close attribute @@ -2278,9 +2253,6 @@ END SUBROUTINE test_attr_dense_verify SUBROUTINE test_attr_corder_create_basic( fcpl, fapl, total_error ) - USE HDF5 - USE TH5_MISC - IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: fcpl @@ -2314,14 +2286,14 @@ SUBROUTINE test_attr_corder_create_basic( fcpl, fapl, total_error ) ! Get creation order indexing on object CALL H5Pget_attr_creation_order_f(dcpl, crt_order_flags, error) CALL check("H5Pget_attr_creation_order_f",error,total_error) - CALL VERIFY("H5Pget_attr_creation_order_f",crt_order_flags , 0, total_error) + CALL verify("H5Pget_attr_creation_order_f",crt_order_flags , 0, total_error) ! Setting invalid combination of a attribute order creation order indexing on should fail CALL H5Pset_attr_creation_order_f(dcpl, H5P_CRT_ORDER_INDEXED_F, error) - CALL VERIFY("H5Pset_attr_creation_order_f",error , minusone, total_error) + CALL verify("H5Pset_attr_creation_order_f",error , minusone, total_error) CALL H5Pget_attr_creation_order_f(dcpl, crt_order_flags, error) CALL check("H5Pget_attr_creation_order_f",error,total_error) - CALL VERIFY("H5Pget_attr_creation_order_f",crt_order_flags , 0, total_error) + CALL verify("H5Pget_attr_creation_order_f",crt_order_flags , 0, total_error) ! Set attribute creation order tracking & indexing for object CALL h5pset_attr_creation_order_f(dcpl, IOR(H5P_CRT_ORDER_TRACKED_F, H5P_CRT_ORDER_INDEXED_F), error) @@ -2329,7 +2301,7 @@ SUBROUTINE test_attr_corder_create_basic( fcpl, fapl, total_error ) CALL H5Pget_attr_creation_order_f(dcpl, crt_order_flags, error) CALL check("H5Pget_attr_creation_order_f",error,total_error) - CALL VERIFY("H5Pget_attr_creation_order_f",crt_order_flags , & + CALL verify("H5Pget_attr_creation_order_f",crt_order_flags , & IOR(H5P_CRT_ORDER_TRACKED_F, H5P_CRT_ORDER_INDEXED_F), total_error) ! Create dataspace for dataset @@ -2374,7 +2346,7 @@ SUBROUTINE test_attr_corder_create_basic( fcpl, fapl, total_error ) ! Query the attribute creation properties CALL H5Pget_attr_creation_order_f(dcpl, crt_order_flags, error) CALL check("H5Pget_attr_creation_order_f",error,total_error) - CALL VERIFY("H5Pget_attr_creation_order_f",crt_order_flags , & + CALL verify("H5Pget_attr_creation_order_f",crt_order_flags , & IOR(H5P_CRT_ORDER_TRACKED_F, H5P_CRT_ORDER_INDEXED_F), total_error ) ! Close property list @@ -2401,9 +2373,6 @@ END SUBROUTINE test_attr_corder_create_basic SUBROUTINE test_attr_basic_write(fapl, total_error) - USE HDF5 - USE TH5_MISC - IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: fapl @@ -2512,7 +2481,7 @@ SUBROUTINE test_attr_basic_write(fapl, total_error) CALL h5aget_storage_size_f(attr, attr_size, error) CALL check("h5aget_storage_size_f",error,total_error) -!EP CALL VERIFY("h5aget_storage_size_f", INT(attr_size), 2*HSIZE_T, total_error) +!EP CALL verify("h5aget_storage_size_f", INT(attr_size), 2*HSIZE_T, total_error) ! Read attribute information immediately, without closing attribute @@ -2521,7 +2490,7 @@ SUBROUTINE test_attr_basic_write(fapl, total_error) ! Verify values read in DO i = 1, ATTR1_DIM1 - CALL VERIFY('h5aread_f',attr_data1(i),read_data1(i), total_error) + CALL verify('h5aread_f',attr_data1(i),read_data1(i), total_error) ENDDO ! CLOSE attribute @@ -2570,7 +2539,7 @@ SUBROUTINE test_attr_basic_write(fapl, total_error) size = 18 CALL H5Aget_name_f(attr, size, chr_exact_size, error) CALL check('H5Aget_name_f',error,total_error) - CALL VerifyString('H5Aget_name_f',chr_exact_size,ATTR_TMP_NAME, total_error) + CALL verify('H5Aget_name_f',chr_exact_size,ATTR_TMP_NAME, total_error) ! Close attribute CALL h5aclose_f(attr, error) @@ -2599,9 +2568,6 @@ END SUBROUTINE test_attr_basic_write SUBROUTINE test_attr_many(new_format, fcpl, fapl, total_error) - USE HDF5 - USE TH5_MISC - IMPLICIT NONE LOGICAL, INTENT(IN) :: new_format @@ -2656,19 +2622,19 @@ SUBROUTINE test_attr_many(new_format, fcpl, fapl, total_error) WRITE(chr5,'(I5.5)') u attrname = 'attr '//chr5 CALL H5Aexists_f( gid, attrname, exists, error) - CALL VerifyLogical("H5Aexists",exists,.FALSE.,total_error ) + CALL verify("H5Aexists",exists,.FALSE.,total_error ) CALL H5Aexists_by_name_f(fid, GROUP1_NAME, attrname, exists, error, lapl_id = H5P_DEFAULT_F) - CALL VerifyLogical("H5Aexists_by_name_f",exists,.FALSE.,total_error ) + CALL verify("H5Aexists_by_name_f",exists,.FALSE.,total_error ) CALL h5acreate_f(gid, attrname, H5T_NATIVE_INTEGER, sid, aid, error, H5P_DEFAULT_F, H5P_DEFAULT_F) CALL check("h5acreate_f",error,total_error) CALL H5Aexists_f(gid, attrname, exists, error) - CALL VerifyLogical("H5Aexists",exists,.TRUE.,total_error ) + CALL verify("H5Aexists",exists,.TRUE.,total_error ) CALL H5Aexists_by_name_f(fid, GROUP1_NAME, attrname, exists, error) - CALL VerifyLogical("H5Aexists_by_name_f",exists,.TRUE.,total_error ) + CALL verify("H5Aexists_by_name_f",exists,.TRUE.,total_error ) attr_data1(1) = u data_dims(1) = 1 @@ -2680,10 +2646,10 @@ SUBROUTINE test_attr_many(new_format, fcpl, fapl, total_error) CALL check("h5aclose_f",error,total_error) CALL H5Aexists_f(gid, attrname, exists, error) - CALL VerifyLogical("H5Aexists",exists,.TRUE.,total_error ) + CALL verify("H5Aexists",exists,.TRUE.,total_error ) CALL H5Aexists_by_name_f(fid, GROUP1_NAME, attrname, exists, error) - CALL VerifyLogical("H5Aexists_by_name_f",exists,.TRUE.,total_error ) + CALL verify("H5Aexists_by_name_f",exists,.TRUE.,total_error ) ENDDO @@ -2717,9 +2683,6 @@ END SUBROUTINE test_attr_many SUBROUTINE attr_open_check(fid, dsetname, obj_id, max_attrs, total_error ) - USE HDF5 - USE TH5_MISC - IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: fid CHARACTER(LEN=*), INTENT(IN) :: dsetname @@ -2757,13 +2720,13 @@ SUBROUTINE attr_open_check(fid, dsetname, obj_id, max_attrs, total_error ) CALL check("h5aget_info_f",error,total_error) ! Check that the object's attributes are correct - CALL VERIFY("h5aget_info_f.corder",corder,u,total_error) - CALL Verifylogical("h5aget_info_f.corder_valid",f_corder_valid,.TRUE.,total_error) - CALL VERIFY("h5aget_info_f.cset", cset, H5T_CSET_ASCII_F, total_error) + CALL verify("h5aget_info_f.corder",corder,u,total_error) + CALL verify("h5aget_info_f.corder_valid",f_corder_valid,.TRUE.,total_error) + CALL verify("h5aget_info_f.cset", cset, H5T_CSET_ASCII_F, total_error) CALL h5aget_storage_size_f(attr_id, storage_size, error) CALL check("h5aget_storage_size_f",error,total_error) - CALL VERIFY("h5aget_info_f.data_size", INT(data_size), INT(storage_size), total_error) + CALL verify("h5aget_info_f.data_size", INT(data_size), INT(storage_size), total_error) ! Close attribute @@ -2778,12 +2741,12 @@ SUBROUTINE attr_open_check(fid, dsetname, obj_id, max_attrs, total_error ) CALL h5aget_info_f(attr_id, f_corder_valid, corder, cset, data_size, error) CALL check("h5aget_info_f",error,total_error) ! Check the attribute's information - CALL VERIFY("h5aget_info_f",corder,u,total_error) - CALL Verifylogical("h5aget_info_f",f_corder_valid,.TRUE.,total_error) - CALL VERIFY("h5aget_info_f", cset, H5T_CSET_ASCII_F, total_error) + CALL verify("h5aget_info_f",corder,u,total_error) + CALL verify("h5aget_info_f",f_corder_valid,.TRUE.,total_error) + CALL verify("h5aget_info_f", cset, H5T_CSET_ASCII_F, total_error) CALL h5aget_storage_size_f(attr_id, storage_size, error) CALL check("h5aget_storage_size_f",error,total_error) - CALL VERIFY("h5aget_info_f", INT(data_size), INT(storage_size), total_error) + CALL verify("h5aget_info_f", INT(data_size), INT(storage_size), total_error) ! Close attribute CALL h5aclose_f(attr_id, error) @@ -2800,12 +2763,12 @@ SUBROUTINE attr_open_check(fid, dsetname, obj_id, max_attrs, total_error ) CALL check("h5aget_info_f",error,total_error) ! Check the attribute's information - CALL VERIFY("h5aget_info_f",corder,u,total_error) - CALL Verifylogical("h5aget_info_f",f_corder_valid,.TRUE.,total_error) - CALL VERIFY("h5aget_info_f", cset, H5T_CSET_ASCII_F, total_error) + CALL verify("h5aget_info_f",corder,u,total_error) + CALL verify("h5aget_info_f",f_corder_valid,.TRUE.,total_error) + CALL verify("h5aget_info_f", cset, H5T_CSET_ASCII_F, total_error) CALL h5aget_storage_size_f(attr_id, storage_size, error) CALL check("h5aget_storage_size_f",error,total_error) - CALL VERIFY("h5aget_info_f", INT(data_size), INT(storage_size), total_error) + CALL verify("h5aget_info_f", INT(data_size), INT(storage_size), total_error) ! Close attribute CALL h5aclose_f(attr_id, error) diff --git a/fortran/test/tH5D.f90 b/fortran/test/tH5D.f90 index c0eb8f9..b5febb3 100644 --- a/fortran/test/tH5D.f90 +++ b/fortran/test/tH5D.f90 @@ -36,503 +36,477 @@ ! MODULE TH5D -CONTAINS - SUBROUTINE datasettest(cleanup, total_error) - USE HDF5 ! This module contains all necessary modules - USE TH5_MISC - - IMPLICIT NONE - LOGICAL, INTENT(IN) :: cleanup - INTEGER, INTENT(OUT) :: total_error - - CHARACTER(LEN=5), PARAMETER :: filename = "dsetf" ! File name - CHARACTER(LEN=80) :: fix_filename - CHARACTER(LEN=4), PARAMETER :: dsetname = "dset" ! Dataset name - CHARACTER(LEN=9), PARAMETER :: null_dsetname = "null_dset" ! Dataset name - - INTEGER(HID_T) :: file_id ! File identifier - INTEGER(HID_T) :: dset_id ! Dataset identifier - INTEGER(HID_T) :: null_dset ! Null dataset identifier - INTEGER(HID_T) :: dspace_id ! Dataspace identifier - INTEGER(HID_T) :: null_dspace ! Null dataspace identifier - INTEGER(HID_T) :: dtype_id ! Datatype identifier - - - INTEGER(HSIZE_T), DIMENSION(2) :: dims = (/4,6/) ! Dataset dimensions - INTEGER :: rank = 2 ! Dataset rank - - INTEGER, DIMENSION(4,6) :: dset_data, data_out ! Data buffers - INTEGER :: error ! Error flag - - INTEGER :: i, j !general purpose integers - INTEGER(HSIZE_T), DIMENSION(2) :: data_dims - INTEGER(HSIZE_T), DIMENSION(1) :: null_data_dim - INTEGER :: null_dset_data = 1 ! null data - INTEGER :: flag ! Space allocation status - - ! - ! Initialize the dset_data array. - ! - do i = 1, 4 - do j = 1, 6 - dset_data(i,j) = (i-1)*6 + j; - end do - end do - - - ! - ! Create a new file using default properties. - ! - CALL h5_fixname_f(filename, fix_filename, H5P_DEFAULT_F, error) - if (error .ne. 0) then - write(*,*) "Cannot modify filename" - stop - endif - CALL h5fcreate_f(fix_filename, H5F_ACC_TRUNC_F, file_id, error) - CALL check("h5fcreate_f", error, total_error) - - - ! - ! Create the dataspace. - ! - CALL h5screate_simple_f(rank, dims, dspace_id, error) - CALL check("h5screate_simple_f", error, total_error) - ! - ! Create null dataspace. - ! - CALL h5screate_f(H5S_NULL_F, null_dspace, error) - CALL check("h5screate_simple_f", error, total_error) - - - ! - ! Create the dataset with default properties. - ! - CALL h5dcreate_f(file_id, dsetname, H5T_NATIVE_INTEGER, dspace_id, & - dset_id, error) - CALL check("h5dcreate_f", error, total_error) - ! - ! Create the null dataset. - ! - CALL h5dcreate_f(file_id, null_dsetname, H5T_NATIVE_INTEGER, null_dspace, & - null_dset, error) - CALL check("h5dcreate_f", error, total_error) - - ! - ! Write the dataset. - ! - data_dims(1) = 4 - data_dims(2) = 6 - CALL h5dwrite_f(dset_id, H5T_NATIVE_INTEGER, dset_data, data_dims, error) - CALL check("h5dwrite_f", error, total_error) - ! - ! Write null dataset. Nothing can be written. - ! - null_data_dim(1) = 1 - CALL h5dwrite_f(null_dset, H5T_NATIVE_INTEGER, null_dset_data, null_data_dim, error) - CALL check("h5dwrite_f", error, total_error) - - - ! - ! End access to the dataset and release resources used by it. - ! - CALL h5dclose_f(dset_id, error) - CALL check("h5dclose_f", error, total_error) - CALL h5dclose_f(null_dset, error) - CALL check("h5dclose_f", error, total_error) - - ! - ! Terminate access to the data space. - ! - CALL h5sclose_f(dspace_id, error) - CALL check("h5sclose_f", error, total_error) - CALL h5sclose_f(null_dspace, error) - CALL check("h5sclose_f", error, total_error) - - ! - ! Close the file. - ! - CALL h5fclose_f(file_id, error) - CALL check("h5fclose_f", error, total_error) - - ! - ! Open the existing file. - ! - CALL h5fopen_f (fix_filename, H5F_ACC_RDWR_F, file_id, error) - CALL check("h5fopen_f", error, total_error) + USE HDF5 ! This module contains all necessary modules + USE TH5_MISC + USE TH5_MISC_GEN - ! - ! Open the existing dataset. - ! - CALL h5dopen_f(file_id, dsetname, dset_id, error) - CALL check("h5dopen_f", error, total_error) - CALL h5dopen_f(file_id, null_dsetname, null_dset, error) - CALL check("h5dopen_f", error, total_error) - - ! Test whether space has been allocated for a dataset - CALL h5dget_space_status_f(dset_id, flag, error) - CALL check("h5dget_space_status_f",error, total_error) - CALL verify("h5dget_space_status_f", flag, H5D_SPACE_STS_ALLOCATED_F, total_error) - - CALL h5dget_space_status_f(null_dset, flag, error) - CALL check("h5dget_space_status_f",error, total_error) - CALL verify("h5dget_space_status_f", flag, H5D_SPACE_STS_NOT_ALLOCATED_F, total_error) - - - ! - ! Get the dataset type. - ! - CALL h5dget_type_f(dset_id, dtype_id, error) - CALL check("h5dget_type_f", error, total_error) - - ! - ! Get the data space. - ! - CALL h5dget_space_f(dset_id, dspace_id, error) - CALL check("h5dget_space_f", error, total_error) - - ! - ! Read the dataset. - ! - CALL h5dread_f(dset_id, H5T_NATIVE_INTEGER, data_out, data_dims, error) - CALL check("h5dread_f", error, total_error) - ! - ! Read the null dataset. Nothing should be read. - ! - CALL h5dread_f(null_dset, H5T_NATIVE_INTEGER, null_dset_data, null_data_dim, error) - CALL check("h5dread_f", error, total_error) - - ! - !Compare the data. - ! - do i = 1, 4 - do j = 1, 6 - IF (data_out(i,j) .NE. dset_data(i, j)) THEN - write(*, *) "dataset test error occured" - write(*,*) "data read is not the same as the data written" - END IF - end do - end do - - ! - ! Check if no change to null_dset_data - ! - IF (null_dset_data .NE. 1) THEN - write(*, *) "null dataset test error occured" +CONTAINS + SUBROUTINE datasettest(cleanup, total_error) + + IMPLICIT NONE + LOGICAL, INTENT(IN) :: cleanup + INTEGER, INTENT(OUT) :: total_error + + CHARACTER(LEN=5), PARAMETER :: filename = "dsetf" ! File name + CHARACTER(LEN=80) :: fix_filename + CHARACTER(LEN=4), PARAMETER :: dsetname = "dset" ! Dataset name + CHARACTER(LEN=9), PARAMETER :: null_dsetname = "null_dset" ! Dataset name + + INTEGER(HID_T) :: file_id ! File identifier + INTEGER(HID_T) :: dset_id ! Dataset identifier + INTEGER(HID_T) :: null_dset ! Null dataset identifier + INTEGER(HID_T) :: dspace_id ! Dataspace identifier + INTEGER(HID_T) :: null_dspace ! Null dataspace identifier + INTEGER(HID_T) :: dtype_id ! Datatype identifier + + INTEGER(HSIZE_T), DIMENSION(2) :: dims = (/4,6/) ! Dataset dimensions + INTEGER :: rank = 2 ! Dataset rank + + INTEGER, DIMENSION(4,6) :: dset_data, data_out ! Data buffers + INTEGER :: error ! Error flag + + INTEGER :: i, j !general purpose integers + INTEGER(HSIZE_T), DIMENSION(2) :: data_dims + INTEGER(HSIZE_T), DIMENSION(1) :: null_data_dim + INTEGER :: null_dset_data = 1 ! null data + INTEGER :: flag ! Space allocation status + + ! + ! Initialize the dset_data array. + ! + DO i = 1, 4 + DO j = 1, 6 + dset_data(i,j) = (i-1)*6 + j; + END DO + END DO + ! + ! Create a new file using default properties. + ! + CALL h5_fixname_f(filename, fix_filename, H5P_DEFAULT_F, error) + IF (error .NE. 0) THEN + WRITE(*,*) "Cannot modify filename" + STOP + ENDIF + CALL h5fcreate_f(fix_filename, H5F_ACC_TRUNC_F, file_id, error) + CALL check("h5fcreate_f", error, total_error) + ! + ! Create the dataspace. + ! + CALL h5screate_simple_f(rank, dims, dspace_id, error) + CALL check("h5screate_simple_f", error, total_error) + ! + ! Create null dataspace. + ! + CALL h5screate_f(H5S_NULL_F, null_dspace, error) + CALL check("h5screate_simple_f", error, total_error) + ! + ! Create the dataset with default properties. + ! + CALL h5dcreate_f(file_id, dsetname, H5T_NATIVE_INTEGER, dspace_id, & + dset_id, error) + CALL check("h5dcreate_f", error, total_error) + ! + ! Create the null dataset. + ! + CALL h5dcreate_f(file_id, null_dsetname, H5T_NATIVE_INTEGER, null_dspace, null_dset, error) + CALL check("h5dcreate_f", error, total_error) + ! + ! Write the dataset. + ! + data_dims(1) = 4 + data_dims(2) = 6 + CALL h5dwrite_f(dset_id, H5T_NATIVE_INTEGER, dset_data, data_dims, error) + CALL check("h5dwrite_f", error, total_error) + ! + ! Write null dataset. Nothing can be written. + ! + null_data_dim(1) = 1 + CALL h5dwrite_f(null_dset, H5T_NATIVE_INTEGER, null_dset_data, null_data_dim, error) + CALL check("h5dwrite_f", error, total_error) + ! + ! End access to the dataset and release resources used by it. + ! + CALL h5dclose_f(dset_id, error) + CALL check("h5dclose_f", error, total_error) + CALL h5dclose_f(null_dset, error) + CALL check("h5dclose_f", error, total_error) + ! + ! Terminate access to the data space. + ! + CALL h5sclose_f(dspace_id, error) + CALL check("h5sclose_f", error, total_error) + CALL h5sclose_f(null_dspace, error) + CALL check("h5sclose_f", error, total_error) + ! + ! Close the file. + ! + CALL h5fclose_f(file_id, error) + CALL check("h5fclose_f", error, total_error) + ! + ! Open the existing file. + ! + CALL h5fopen_f (fix_filename, H5F_ACC_RDWR_F, file_id, error) + CALL check("h5fopen_f", error, total_error) + ! + ! Open the existing dataset. + ! + CALL h5dopen_f(file_id, dsetname, dset_id, error) + CALL check("h5dopen_f", error, total_error) + CALL h5dopen_f(file_id, null_dsetname, null_dset, error) + CALL check("h5dopen_f", error, total_error) + + ! Test whether space has been allocated for a dataset + CALL h5dget_space_status_f(dset_id, flag, error) + CALL check("h5dget_space_status_f",error, total_error) + CALL VERIFY("h5dget_space_status_f", flag, H5D_SPACE_STS_ALLOCATED_F, total_error) + + CALL h5dget_space_status_f(null_dset, flag, error) + CALL check("h5dget_space_status_f",error, total_error) + CALL VERIFY("h5dget_space_status_f", flag, H5D_SPACE_STS_NOT_ALLOCATED_F, total_error) + ! + ! Get the dataset type. + ! + CALL h5dget_type_f(dset_id, dtype_id, error) + CALL check("h5dget_type_f", error, total_error) + ! + ! Get the data space. + ! + CALL h5dget_space_f(dset_id, dspace_id, error) + CALL check("h5dget_space_f", error, total_error) + ! + ! Read the dataset. + ! + CALL h5dread_f(dset_id, H5T_NATIVE_INTEGER, data_out, data_dims, error) + CALL check("h5dread_f", error, total_error) + ! + ! Read the null dataset. Nothing should be read. + ! + CALL h5dread_f(null_dset, H5T_NATIVE_INTEGER, null_dset_data, null_data_dim, error) + CALL check("h5dread_f", error, total_error) + ! + !Compare the data. + ! + DO i = 1, 4 + DO j = 1, 6 + IF (data_out(i,j) .NE. dset_data(i, j)) THEN + WRITE(*, *) "dataset test error occured" + WRITE(*,*) "data read is not the same as the data written" END IF - - ! - ! End access to the dataset and release resources used by it. - ! - CALL h5dclose_f(dset_id, error) - CALL check("h5dclose_f", error, total_error) - CALL h5dclose_f(null_dset, error) - CALL check("h5dclose_f", error, total_error) - - ! - ! Terminate access to the data space. - ! - CALL h5sclose_f(dspace_id, error) - CALL check("h5sclose_f", error, total_error) - - ! - ! Terminate access to the data type. - ! - CALL h5tclose_f(dtype_id, error) - CALL check("h5tclose_f", error, total_error) - ! - ! Close the file. - ! - CALL h5fclose_f(file_id, error) - CALL check("h5fclose_f", error, total_error) - if(cleanup) CALL h5_cleanup_f(filename, H5P_DEFAULT_F, error) - CALL check("h5_cleanup_f", error, total_error) - - RETURN - END SUBROUTINE datasettest - + END DO + END DO + ! + ! Check if no change to null_dset_data + ! + IF (null_dset_data .NE. 1) THEN + WRITE(*, *) "null dataset test error occured" + END IF + ! + ! End access to the dataset and release resources used by it. + ! + CALL h5dclose_f(dset_id, error) + CALL check("h5dclose_f", error, total_error) + CALL h5dclose_f(null_dset, error) + CALL check("h5dclose_f", error, total_error) + ! + ! Terminate access to the data space. + ! + CALL h5sclose_f(dspace_id, error) + CALL check("h5sclose_f", error, total_error) + + ! + ! Terminate access to the data type. + ! + CALL h5tclose_f(dtype_id, error) + CALL check("h5tclose_f", error, total_error) + ! + ! Close the file. + ! + CALL h5fclose_f(file_id, error) + CALL check("h5fclose_f", error, total_error) + IF(cleanup) CALL h5_cleanup_f(filename, H5P_DEFAULT_F, error) + CALL check("h5_cleanup_f", error, total_error) + + RETURN + END SUBROUTINE datasettest + ! !the following subroutine tests h5dextend_f functionality ! - SUBROUTINE extenddsettest(cleanup, total_error) - USE HDF5 ! This module contains all necessary modules - USE TH5_MISC - - IMPLICIT NONE - - LOGICAL, INTENT(IN) :: cleanup - INTEGER, INTENT(OUT) :: total_error - - ! - !the dataset is stored in file "extf.h5" - ! - CHARACTER(LEN=4), PARAMETER :: filename = "extf" - CHARACTER(LEN=80) :: fix_filename - - ! - !dataset name is "ExtendibleArray" - ! - CHARACTER(LEN=15), PARAMETER :: dsetname = "ExtendibleArray" - - ! - !dataset rank is 2 - ! - INTEGER :: RANK = 2 - - INTEGER(HID_T) :: file_id ! File identifier - INTEGER(HID_T) :: dset_id ! Dataset identifier - INTEGER(HID_T) :: dataspace ! Dataspace identifier - INTEGER(HID_T) :: memspace ! memory Dataspace identifier - INTEGER(HID_T) :: crp_list ! dataset creatation property identifier - - ! - !dataset dimensions at creation time - ! - INTEGER(HSIZE_T), DIMENSION(2) :: dims = (/3,3/) - - ! - !data dimensions - ! - INTEGER(HSIZE_T), DIMENSION(2) :: dims1 = (/10,3/) - - ! - !Maximum dimensions - ! - INTEGER(HSIZE_T), DIMENSION(2) :: maxdims - - ! - !data arrays for reading and writing - ! - INTEGER, DIMENSION(10,3) :: data_in, data_out - - ! - !Size of data in the file - ! - INTEGER(HSIZE_T), DIMENSION(2) :: size - - ! - !general purpose integer - ! - INTEGER :: i, j - INTEGER(HSIZE_T) :: ih, jh - - ! - !flag to check operation success - ! - INTEGER :: error - - ! - !Variables used in reading data back - ! - INTEGER(HSIZE_T), DIMENSION(2) :: dimsr, maxdimsr - INTEGER :: rankr - INTEGER(HSIZE_T), DIMENSION(2) :: data_dims - - ! - !data initialization - ! - do i = 1, 10 - do j = 1, 3 - data_in(i,j) = 2 - end do - end do - - ! - !Initialize FORTRAN predifined datatypes - ! + SUBROUTINE extenddsettest(cleanup, total_error) + + IMPLICIT NONE + + LOGICAL, INTENT(IN) :: cleanup + INTEGER, INTENT(OUT) :: total_error + + ! + !the dataset is stored in file "extf.h5" + ! + CHARACTER(LEN=4), PARAMETER :: filename = "extf" + CHARACTER(LEN=80) :: fix_filename + + ! + !dataset name is "ExtendibleArray" + ! + CHARACTER(LEN=15), PARAMETER :: dsetname = "ExtendibleArray" + + ! + !dataset rank is 2 + ! + INTEGER :: RANK = 2 + + INTEGER(HID_T) :: file_id ! File identifier + INTEGER(HID_T) :: dset_id ! Dataset identifier + INTEGER(HID_T) :: dataspace ! Dataspace identifier + INTEGER(HID_T) :: memspace ! memory Dataspace identifier + INTEGER(HID_T) :: crp_list ! dataset creatation property identifier + + ! + !dataset dimensions at creation time + ! + INTEGER(HSIZE_T), DIMENSION(2) :: dims = (/3,3/) + + ! + !data dimensions + ! + INTEGER(HSIZE_T), DIMENSION(2) :: dims1 = (/10,3/) + + ! + !Maximum dimensions + ! + INTEGER(HSIZE_T), DIMENSION(2) :: maxdims + + ! + !data arrays for reading and writing + ! + INTEGER, DIMENSION(10,3) :: data_in, data_out + + ! + !Size of data in the file + ! + INTEGER(HSIZE_T), DIMENSION(2) :: size + + ! + !general purpose integer + ! + INTEGER :: i, j + INTEGER(HSIZE_T) :: ih, jh + + ! + !flag to check operation success + ! + INTEGER :: error + + ! + !Variables used in reading data back + ! + INTEGER(HSIZE_T), DIMENSION(2) :: dimsr, maxdimsr + INTEGER :: rankr + INTEGER(HSIZE_T), DIMENSION(2) :: data_dims + + ! + !data initialization + ! + DO i = 1, 10 + DO j = 1, 3 + data_in(i,j) = 2 + END DO + END DO + + ! + !Initialize FORTRAN predifined datatypes + ! ! CALL h5init_types_f(error) ! CALL check("h5init_types_f",error,total_error) - ! - !Create a new file using default properties. - ! - CALL h5_fixname_f(filename, fix_filename, H5P_DEFAULT_F, error) - if (error .ne. 0) then - write(*,*) "Cannot modify filename" - stop - endif - CALL h5fcreate_f(fix_filename, H5F_ACC_TRUNC_F, file_id, error) - CALL check("h5fcreate_f",error,total_error) - - - ! - !Create the data space with unlimited dimensions. - ! - maxdims = (/H5S_UNLIMITED_F, H5S_UNLIMITED_F/) - - CALL h5screate_simple_f(RANK, dims, dataspace, error, maxdims) - CALL check("h5screate_simple_f",error,total_error) - - ! - !Modify dataset creation properties, i.e. enable chunking - ! - CALL h5pcreate_f(H5P_DATASET_CREATE_F, crp_list, error) - CALL check("h5pcreat_f",error,total_error) - - CALL h5pset_chunk_f(crp_list, RANK, dims1, error) - CALL check("h5pset_chunk_f",error,total_error) - - ! - !Create a dataset with 3X3 dimensions using cparms creation propertie . - ! - CALL h5dcreate_f(file_id, dsetname, H5T_NATIVE_INTEGER, dataspace, & - dset_id, error, crp_list ) - CALL check("h5dcreate_f",error,total_error) - - ! - !Extend the dataset. This call assures that dataset is 3 x 3. - ! - size(1) = 3 - size(2) = 3 - CALL h5dextend_f(dset_id, size, error) - CALL check("h5dextend_f",error,total_error) - - - ! - !Extend the dataset. Dataset becomes 10 x 3. - ! - size(1) = 10; - size(2) = 3; - CALL h5dextend_f(dset_id, size, error) - CALL check("h5dextend_f",error,total_error) - - ! - !Write the data of size 10X3 to the extended dataset. - ! - data_dims(1) = 10 - data_dims(2) = 3 - CALL H5dwrite_f(dset_id, H5T_NATIVE_INTEGER, data_in, data_dims, error) - CALL check("h5dwrite_f",error,total_error) - - ! - !Close the dataspace for the dataset. - ! - CALL h5sclose_f(dataspace, error) - CALL check("h5sclose_f",error,total_error) - - ! - !Close the property list. - ! - CALL h5pclose_f(crp_list, error) - CALL check("h5pclose_f",error,total_error) - ! - !Close the dataset. - ! - CALL h5dclose_f(dset_id, error) - CALL check("h5dclose_f",error,total_error) - - ! - !Close the file. - ! - CALL h5fclose_f(file_id, error) - CALL check("h5fclose_f",error,total_error) - - ! - !read the data back - ! - !Open the file. - ! - CALL h5fopen_f (fix_filename, H5F_ACC_RDONLY_F, file_id, error) - CALL check("hfopen_f",error,total_error) - - ! - !Open the dataset. - ! - CALL h5dopen_f(file_id, dsetname, dset_id, error) - CALL check("h5dopen_f",error,total_error) - - ! - !Get dataset's dataspace handle. - ! - CALL h5dget_space_f(dset_id, dataspace, error) - CALL check("h5dget_space_f",error,total_error) - - ! - !Get dataspace's rank. - ! - CALL h5sget_simple_extent_ndims_f(dataspace, rankr, error) - CALL check("h5sget_simple_extent_ndims_f",error,total_error) - IF (rankr .NE. RANK) then - write(*,*) "dataset rank error occured" - stop - END IF - - ! - !Get dataspace's dimensinons. - ! - CALL h5sget_simple_extent_dims_f(dataspace, dimsr, maxdimsr, error) - CALL check("h5sget_simple_extent_dims_f",error,total_error) - IF ((dimsr(1) .NE. dims1(1)) .OR. (dimsr(2) .NE. dims1(2))) THEN - write(*,*) "dataset dimensions error occured" - stop + ! + !Create a new file using default properties. + ! + CALL h5_fixname_f(filename, fix_filename, H5P_DEFAULT_F, error) + IF (error .NE. 0) THEN + WRITE(*,*) "Cannot modify filename" + STOP + ENDIF + CALL h5fcreate_f(fix_filename, H5F_ACC_TRUNC_F, file_id, error) + CALL check("h5fcreate_f",error,total_error) + + ! + !Create the data space with unlimited dimensions. + ! + maxdims = (/H5S_UNLIMITED_F, H5S_UNLIMITED_F/) + + CALL h5screate_simple_f(RANK, dims, dataspace, error, maxdims) + CALL check("h5screate_simple_f",error,total_error) + + ! + !Modify dataset creation properties, i.e. enable chunking + ! + CALL h5pcreate_f(H5P_DATASET_CREATE_F, crp_list, error) + CALL check("h5pcreat_f",error,total_error) + + CALL h5pset_chunk_f(crp_list, RANK, dims1, error) + CALL check("h5pset_chunk_f",error,total_error) + + ! + !Create a dataset with 3X3 dimensions using cparms creation propertie . + ! + CALL h5dcreate_f(file_id, dsetname, H5T_NATIVE_INTEGER, dataspace, dset_id, error, crp_list ) + CALL check("h5dcreate_f",error,total_error) + + ! + !Extend the dataset. This call assures that dataset is 3 x 3. + ! + SIZE(1) = 3 + SIZE(2) = 3 + CALL h5dextend_f(dset_id, size, error) + CALL check("h5dextend_f",error,total_error) + + + ! + !Extend the dataset. Dataset becomes 10 x 3. + ! + SIZE(1) = 10; + SIZE(2) = 3; + CALL h5dextend_f(dset_id, size, error) + CALL check("h5dextend_f",error,total_error) + + ! + !Write the data of size 10X3 to the extended dataset. + ! + data_dims(1) = 10 + data_dims(2) = 3 + CALL H5dwrite_f(dset_id, H5T_NATIVE_INTEGER, data_in, data_dims, error) + CALL check("h5dwrite_f",error,total_error) + + ! + !Close the dataspace for the dataset. + ! + CALL h5sclose_f(dataspace, error) + CALL check("h5sclose_f",error,total_error) + + ! + !Close the property list. + ! + CALL h5pclose_f(crp_list, error) + CALL check("h5pclose_f",error,total_error) + ! + !Close the dataset. + ! + CALL h5dclose_f(dset_id, error) + CALL check("h5dclose_f",error,total_error) + + ! + !Close the file. + ! + CALL h5fclose_f(file_id, error) + CALL check("h5fclose_f",error,total_error) + + ! + !read the data back + ! + !Open the file. + ! + CALL h5fopen_f (fix_filename, H5F_ACC_RDONLY_F, file_id, error) + CALL check("hfopen_f",error,total_error) + + ! + !Open the dataset. + ! + CALL h5dopen_f(file_id, dsetname, dset_id, error) + CALL check("h5dopen_f",error,total_error) + + ! + !Get dataset's dataspace handle. + ! + CALL h5dget_space_f(dset_id, dataspace, error) + CALL check("h5dget_space_f",error,total_error) + + ! + !Get dataspace's rank. + ! + CALL h5sget_simple_extent_ndims_f(dataspace, rankr, error) + CALL check("h5sget_simple_extent_ndims_f",error,total_error) + IF (rankr .NE. RANK) THEN + WRITE(*,*) "dataset rank error occured" + STOP + END IF + + ! + !Get dataspace's dimensinons. + ! + CALL h5sget_simple_extent_dims_f(dataspace, dimsr, maxdimsr, error) + CALL check("h5sget_simple_extent_dims_f",error,total_error) + IF ((dimsr(1) .NE. dims1(1)) .OR. (dimsr(2) .NE. dims1(2))) THEN + WRITE(*,*) "dataset dimensions error occured" + STOP + END IF + + ! + !Get creation property list. + ! + CALL h5dget_create_plist_f(dset_id, crp_list, error) + CALL check("h5dget_create_plist_f",error,total_error) + + + ! + !create memory dataspace. + ! + CALL h5screate_simple_f(rankr, dimsr, memspace, error) + CALL check("h5screate_simple_f",error,total_error) + + ! + !Read data + ! + CALL H5dread_f(dset_id, H5T_NATIVE_INTEGER, data_out, data_dims, error, memspace, dataspace) + CALL check("h5dread_f",error,total_error) + + + ! + !Compare the data. + ! + DO ih = 1, dims1(1) + DO jh = 1, dims1(2) + IF (data_out(ih,jh) .NE. data_in(ih, jh)) THEN + WRITE(*, *) "extend dataset test error occured" + WRITE(*, *) "read value is not the same as the written values" END IF - - ! - !Get creation property list. - ! - CALL h5dget_create_plist_f(dset_id, crp_list, error) - CALL check("h5dget_create_plist_f",error,total_error) - - - ! - !create memory dataspace. - ! - CALL h5screate_simple_f(rankr, dimsr, memspace, error) - CALL check("h5screate_simple_f",error,total_error) - - ! - !Read data - ! - CALL H5dread_f(dset_id, H5T_NATIVE_INTEGER, data_out, data_dims, error, & - memspace, dataspace) - CALL check("h5dread_f",error,total_error) - - - ! - !Compare the data. - ! - do ih = 1, dims1(1) - do jh = 1, dims1(2) - IF (data_out(ih,jh) .NE. data_in(ih, jh)) THEN - write(*, *) "extend dataset test error occured" - write(*, *) "read value is not the same as the written values" - END IF - end do - end do - - ! - !Close the dataspace for the dataset. - ! - CALL h5sclose_f(dataspace, error) - CALL check("h5sclose_f",error,total_error) - - ! - !Close the memspace for the dataset. - ! - CALL h5sclose_f(memspace, error) - CALL check("h5sclose_f",error,total_error) - - ! - !Close the property list. - ! - CALL h5pclose_f(crp_list, error) - CALL check("h5pclose_f",error,total_error) - - ! - !Close the dataset. - ! - CALL h5dclose_f(dset_id, error) - CALL check("h5dclose_f",error,total_error) - - ! - !Close the file. - ! - CALL h5fclose_f(file_id, error) - CALL check("h5fclose_f",error,total_error) - if(cleanup) CALL h5_cleanup_f(filename, H5P_DEFAULT_F, error) - CALL check("h5_cleanup_f", error, total_error) - - RETURN - END SUBROUTINE extenddsettest + END DO + END DO + + ! + !Close the dataspace for the dataset. + ! + CALL h5sclose_f(dataspace, error) + CALL check("h5sclose_f",error,total_error) + + ! + !Close the memspace for the dataset. + ! + CALL h5sclose_f(memspace, error) + CALL check("h5sclose_f",error,total_error) + + ! + !Close the property list. + ! + CALL h5pclose_f(crp_list, error) + CALL check("h5pclose_f",error,total_error) + + ! + !Close the dataset. + ! + CALL h5dclose_f(dset_id, error) + CALL check("h5dclose_f",error,total_error) + + ! + !Close the file. + ! + CALL h5fclose_f(file_id, error) + CALL check("h5fclose_f",error,total_error) + IF(cleanup) CALL h5_cleanup_f(filename, H5P_DEFAULT_F, error) + CALL check("h5_cleanup_f", error, total_error) + + RETURN + END SUBROUTINE extenddsettest END MODULE TH5D diff --git a/fortran/test/tH5E_F03.f90 b/fortran/test/tH5E_F03.f90 index a7d45f2..63e70a3 100644 --- a/fortran/test/tH5E_F03.f90 +++ b/fortran/test/tH5E_F03.f90 @@ -36,6 +36,9 @@ ! ***************************************** MODULE test_my_hdf5_error_handler + USE HDF5 + USE TH5_MISC + USE TH5_MISC_GEN CONTAINS @@ -49,8 +52,6 @@ CONTAINS ! This error function handle works with only version 2 error stack - USE HDF5 - USE ISO_C_BINDING IMPLICIT NONE ! estack_id is always passed from C as: H5E_DEFAULT @@ -74,8 +75,6 @@ CONTAINS ! This error function handle works with only version 2 error stack - USE HDF5 - USE ISO_C_BINDING IMPLICIT NONE ! estack_id is always passed from C as: H5E_DEFAULT @@ -102,8 +101,6 @@ CONTAINS SUBROUTINE test_error(total_error) - USE HDF5 - USE TH5_MISC USE ISO_C_BINDING USE test_my_hdf5_error_handler @@ -147,15 +144,15 @@ SUBROUTINE test_error(total_error) ! Create the erring dataset CALL h5dcreate_f(FAKE_ID,"a_dataset",H5T_NATIVE_INTEGER, space, dataset, error) - CALL VERIFY("h5dcreate_f", error, -1, total_error) + CALL verify("h5dcreate_f", error, -1, total_error) -!!$ CALL VERIFY("H5Eset_auto_f",my_hdf5_error_handler_data(1),10, total_error) -!!$ CALL VERIFY("H5Eset_auto_f",my_hdf5_error_handler_data(2),20, total_error) +!!$ CALL verify("H5Eset_auto_f",my_hdf5_error_handler_data(1),10, total_error) +!!$ CALL verify("H5Eset_auto_f",my_hdf5_error_handler_data(2),20, total_error) !!$ ! Test enabling and disabling default printing !!$ !!$ CALL H5Eget_auto_f(H5E_DEFAULT_F, func1, f_ptr1, error) -!!$ CALL VERIFY("H5Eget_auto_f", error, 0, total_error) +!!$ CALL verify("H5Eget_auto_f", error, 0, total_error) ! PRINT*,c_associated(f_ptr1) @@ -187,7 +184,7 @@ SUBROUTINE test_error(total_error) CALL H5Eset_auto_f(1, error, H5E_DEFAULT_F, func, f_ptr) CALL h5dcreate_f(FAKE_ID,"a_dataset",H5T_NATIVE_INTEGER, space, dataset, error) - CALL VERIFY("h5dcreate_f", error, -1, total_error) + CALL verify("h5dcreate_f", error, -1, total_error) ! turn on automatic printing with h5eprint_f which prints an error stack in the default manner. diff --git a/fortran/test/tH5F_F03.f90 b/fortran/test/tH5F_F03.f90 index c878a59..9e23d19 100644 --- a/fortran/test/tH5F_F03.f90 +++ b/fortran/test/tH5F_F03.f90 @@ -38,16 +38,17 @@ MODULE TH5F_F03 + USE HDF5 + USE TH5_MISC + USE TH5_MISC_GEN + USE ISO_C_BINDING + CONTAINS SUBROUTINE test_get_file_image(total_error) ! ! Tests the wrapper for h5fget_file_image ! - USE HDF5 - USE TH5_MISC - USE ISO_C_BINDING - IMPLICIT NONE INTEGER, INTENT(INOUT) :: total_error ! returns error @@ -128,8 +129,8 @@ SUBROUTINE test_get_file_image(total_error) itmp_a = 1 CALL h5fget_file_image_f(file_id, f_ptr, itmp_a, error, image_size) CALL check("h5fget_file_image_f",error, total_error) - CALL VERIFY("h5fget_file_image_f", INT(itmp_a), 1, total_error) ! Routine should not change the value - CALL VERIFY("h5fget_file_image_f", file_sz, INT(image_size), total_error) + CALL verify("h5fget_file_image_f", INT(itmp_a), 1, total_error) ! Routine should not change the value + CALL verify("h5fget_file_image_f", file_sz, INT(image_size), total_error) ! Allocate a buffer of the appropriate size ALLOCATE(image_ptr(1:image_size)) diff --git a/fortran/test/tH5G_1_8.f90 b/fortran/test/tH5G_1_8.f90 index ab75163..ddc3736 100644 --- a/fortran/test/tH5G_1_8.f90 +++ b/fortran/test/tH5G_1_8.f90 @@ -31,11 +31,13 @@ MODULE TH5G_1_8 + USE HDF5 + USE TH5_MISC + USE TH5_MISC_GEN + CONTAINS SUBROUTINE group_test(cleanup, total_error) - USE HDF5 ! This module contains all necessary modules - USE TH5_MISC IMPLICIT NONE LOGICAL, INTENT(IN) :: cleanup @@ -139,9 +141,6 @@ END SUBROUTINE group_test SUBROUTINE group_info(cleanup, fapl, total_error) - USE HDF5 ! This module contains all necessary modules - USE TH5_MISC - IMPLICIT NONE INTEGER, INTENT(INOUT) :: total_error INTEGER(HID_T), INTENT(IN) :: fapl @@ -269,7 +268,7 @@ SUBROUTINE group_info(cleanup, fapl, total_error) ! Check for out of bound query by index on empty group, should fail CALL H5Gget_info_by_idx_f(group_id, ".", H5_INDEX_NAME_F, order, INT(0,HSIZE_T), & storage_type, nlinks, max_corder, error) - CALL VERIFY("H5Gget_info_by_idx_f", error, -1, total_error) + CALL verify("H5Gget_info_by_idx_f", error, -1, total_error) ! Create several links, up to limit of compact form DO u = 0, max_compact-1 @@ -287,29 +286,29 @@ SUBROUTINE group_info(cleanup, fapl, total_error) CALL check("H5Gget_info_f", error, total_error) ! Check (new/empty) group's information - CALL VERIFY("H5Gget_info_f", storage_type, H5G_STORAGE_TYPE_COMPACT_F, total_error) - CALL VERIFY("H5Gget_info_f", max_corder, 0, total_error) - CALL VERIFY("H5Gget_info_f", nlinks, 0, total_error) - CALL verifyLogical("H5Gget_info_f.mounted", mounted,.FALSE.,total_error) + CALL verify("H5Gget_info_f", storage_type, H5G_STORAGE_TYPE_COMPACT_F, total_error) + CALL verify("H5Gget_info_f", max_corder, 0, total_error) + CALL verify("H5Gget_info_f", nlinks, 0, total_error) + CALL verify("H5Gget_info_f.mounted", mounted,.FALSE.,total_error) ! Retrieve group's information CALL H5Gget_info_by_name_f(group_id, objname, storage_type, nlinks, max_corder, error, mounted=mounted) CALL check("H5Gget_info_by_name_f", error, total_error) ! Check (new/empty) group's information - CALL VERIFY("H5Gget_info_by_name_f", storage_type, H5G_STORAGE_TYPE_COMPACT_F, total_error) - CALL VERIFY("H5Gget_info_by_name_f", max_corder, 0, total_error) - CALL VERIFY("H5Gget_info_by_name_f", nlinks, 0, total_error) - CALL verifyLogical("H5Gget_info_by_name_f.mounted", mounted,.FALSE.,total_error) + CALL verify("H5Gget_info_by_name_f", storage_type, H5G_STORAGE_TYPE_COMPACT_F, total_error) + CALL verify("H5Gget_info_by_name_f", max_corder, 0, total_error) + CALL verify("H5Gget_info_by_name_f", nlinks, 0, total_error) + CALL verify("H5Gget_info_by_name_f.mounted", mounted,.FALSE.,total_error) ! Retrieve group's information CALL H5Gget_info_by_name_f(group_id2, ".", storage_type, nlinks, max_corder, error) CALL check("H5Gget_info_by_name", error, total_error) ! Check (new/empty) group's information - CALL VERIFY("H5Gget_info_by_name_f", storage_type, H5G_STORAGE_TYPE_COMPACT_F, total_error) - CALL VERIFY("H5Gget_info_by_name_f", max_corder, 0, total_error) - CALL VERIFY("H5Gget_info_by_name_f", nlinks, 0, total_error) + CALL verify("H5Gget_info_by_name_f", storage_type, H5G_STORAGE_TYPE_COMPACT_F, total_error) + CALL verify("H5Gget_info_by_name_f", max_corder, 0, total_error) + CALL verify("H5Gget_info_by_name_f", nlinks, 0, total_error) ! Create objects in new group created DO v = 0, u @@ -331,27 +330,27 @@ SUBROUTINE group_info(cleanup, fapl, total_error) CALL check("H5Gget_info_f", error, total_error) ! Check (new) group's information - CALL VERIFY("H5Gget_info_f", storage_type, H5G_STORAGE_TYPE_COMPACT_F, total_error) - CALL VERIFY("H5Gget_info_f", max_corder, u+1, total_error) - CALL VERIFY("H5Gget_info_f", nlinks, u+1, total_error) + CALL verify("H5Gget_info_f", storage_type, H5G_STORAGE_TYPE_COMPACT_F, total_error) + CALL verify("H5Gget_info_f", max_corder, u+1, total_error) + CALL verify("H5Gget_info_f", nlinks, u+1, total_error) ! Retrieve group's information CALL H5Gget_info_by_name_f(group_id, objname, storage_type, nlinks, max_corder, error) CALL check("H5Gget_info_by_name_f", error, total_error) ! Check (new) group's information - CALL VERIFY("H5Gget_info_by_name_f", storage_type, H5G_STORAGE_TYPE_COMPACT_F, total_error) - CALL VERIFY("H5Gget_info_by_name_f",max_corder, u+1, total_error) - CALL VERIFY("H5Gget_info_by_name_f", nlinks, u+1, total_error) + CALL verify("H5Gget_info_by_name_f", storage_type, H5G_STORAGE_TYPE_COMPACT_F, total_error) + CALL verify("H5Gget_info_by_name_f",max_corder, u+1, total_error) + CALL verify("H5Gget_info_by_name_f", nlinks, u+1, total_error) ! Retrieve group's information CALL H5Gget_info_by_name_f(group_id2, ".", storage_type, nlinks, max_corder, error) CALL check("H5Gget_info_by_name_f", error, total_error) ! Check (new) group's information - CALL VERIFY("H5Gget_info_by_name_f", storage_type, H5G_STORAGE_TYPE_COMPACT_F, total_error) - CALL VERIFY("H5Gget_info_by_name_f", max_corder, u+1, total_error) - CALL VERIFY("H5Gget_info_by_name_f", nlinks, u+1, total_error) + CALL verify("H5Gget_info_by_name_f", storage_type, H5G_STORAGE_TYPE_COMPACT_F, total_error) + CALL verify("H5Gget_info_by_name_f", max_corder, u+1, total_error) + CALL verify("H5Gget_info_by_name_f", nlinks, u+1, total_error) ! Retrieve group's information IF(order.NE.H5_ITER_NATIVE_F)THEN @@ -359,17 +358,17 @@ SUBROUTINE group_info(cleanup, fapl, total_error) CALL H5Gget_info_by_idx_f(group_id, ".", idx_type, order, INT(u,HSIZE_T), & storage_type, nlinks, max_corder, error,lapl_id=H5P_DEFAULT_F, mounted=mounted) CALL check("H5Gget_info_by_idx_f", error, total_error) - CALL verifyLogical("H5Gget_info_by_idx_f", mounted,.FALSE.,total_error) + CALL verify("H5Gget_info_by_idx_f", mounted,.FALSE.,total_error) ELSE CALL H5Gget_info_by_idx_f(group_id, ".", idx_type, order, INT(0,HSIZE_T), & storage_type, nlinks, max_corder, error, mounted=mounted) - CALL verifyLogical("H5Gget_info_by_idx_f", mounted,.FALSE.,total_error) + CALL verify("H5Gget_info_by_idx_f", mounted,.FALSE.,total_error) CALL check("H5Gget_info_by_idx_f", error, total_error) ENDIF ! Check (new) group's information - CALL VERIFY("H5Gget_info_by_idx_f", storage_type, H5G_STORAGE_TYPE_COMPACT_F, total_error) - CALL VERIFY("H5Gget_info_by_idx_f", max_corder, u+1, total_error) - CALL VERIFY("H5Gget_info_by_idx_f", nlinks, u+1, total_error) + CALL verify("H5Gget_info_by_idx_f", storage_type, H5G_STORAGE_TYPE_COMPACT_F, total_error) + CALL verify("H5Gget_info_by_idx_f", max_corder, u+1, total_error) + CALL verify("H5Gget_info_by_idx_f", nlinks, u+1, total_error) ENDIF ! Close group created CALL H5Gclose_f(group_id2, error) @@ -380,27 +379,27 @@ SUBROUTINE group_info(cleanup, fapl, total_error) CALL check("H5Gget_info_f", error, total_error) ! Check main group's information - CALL VERIFY("H5Gget_info_f", storage_type, H5G_STORAGE_TYPE_COMPACT_F, total_error) - CALL VERIFY("H5Gget_info_f", max_corder, u+1, total_error) - CALL VERIFY("H5Gget_info_f", nlinks, u+1, total_error) + CALL verify("H5Gget_info_f", storage_type, H5G_STORAGE_TYPE_COMPACT_F, total_error) + CALL verify("H5Gget_info_f", max_corder, u+1, total_error) + CALL verify("H5Gget_info_f", nlinks, u+1, total_error) ! Retrieve main group's information, by name CALL H5Gget_info_by_name_f(file_id, CORDER_GROUP_NAME, storage_type, nlinks, max_corder, error) CALL check("H5Gget_info_by_name_f", error, total_error) ! Check main group's information - CALL VERIFY("H5Gget_info_by_name_f", storage_type, H5G_STORAGE_TYPE_COMPACT_F, total_error) - CALL VERIFY("H5Gget_info_by_name_f", max_corder, u+1, total_error) - CALL VERIFY("H5Gget_info_by_name_f", nlinks, u+1, total_error) + CALL verify("H5Gget_info_by_name_f", storage_type, H5G_STORAGE_TYPE_COMPACT_F, total_error) + CALL verify("H5Gget_info_by_name_f", max_corder, u+1, total_error) + CALL verify("H5Gget_info_by_name_f", nlinks, u+1, total_error) ! Retrieve main group's information, by name CALL H5Gget_info_by_name_f(group_id, ".", storage_type, nlinks, max_corder, error, H5P_DEFAULT_F) CALL check("H5Gget_info_by_name_f", error, total_error) ! Check main group's information - CALL VERIFY("H5Gget_info_by_name_f", storage_type, H5G_STORAGE_TYPE_COMPACT_F, total_error) - CALL VERIFY("H5Gget_info_by_name_f", max_corder, u+1, total_error) - CALL VERIFY("H5Gget_info_by_name_f", nlinks, u+1, total_error) + CALL verify("H5Gget_info_by_name_f", storage_type, H5G_STORAGE_TYPE_COMPACT_F, total_error) + CALL verify("H5Gget_info_by_name_f", max_corder, u+1, total_error) + CALL verify("H5Gget_info_by_name_f", nlinks, u+1, total_error) ! Create soft link in another group, to objects in main group valname = CORDER_GROUP_NAME//objname @@ -412,9 +411,9 @@ SUBROUTINE group_info(cleanup, fapl, total_error) CALL check("H5Gget_info_f", error, total_error) ! Check soft link group's information - CALL VERIFY("H5Gget_info_f", storage_type, H5G_STORAGE_TYPE_COMPACT_F, total_error) - CALL VERIFY("H5Gget_info_f", max_corder, u+1, total_error) - CALL VERIFY("H5Gget_info_f", nlinks, u+1, total_error) + CALL verify("H5Gget_info_f", storage_type, H5G_STORAGE_TYPE_COMPACT_F, total_error) + CALL verify("H5Gget_info_f", max_corder, u+1, total_error) + CALL verify("H5Gget_info_f", nlinks, u+1, total_error) ENDDO ! Close the groups @@ -456,9 +455,6 @@ SUBROUTINE group_info(cleanup, fapl, total_error) SUBROUTINE timestamps(cleanup, fapl, total_error) - USE HDF5 ! This module contains all necessary modules - USE TH5_MISC - IMPLICIT NONE INTEGER, INTENT(INOUT) :: total_error INTEGER(HID_T), INTENT(IN) :: fapl @@ -491,7 +487,7 @@ SUBROUTINE group_info(cleanup, fapl, total_error) CALL check("H5Pget_obj_track_times_f", error, total_error) ! Check default timestamp information - CALL VerifyLogical("H5Pget_obj_track_times",track_times,.TRUE.,total_error) + CALL verify("H5Pget_obj_track_times",track_times,.TRUE.,total_error) ! Set a non-default object timestamp setting CALL H5Pset_obj_track_times_f(gcpl_id, .FALSE., error) @@ -502,7 +498,7 @@ SUBROUTINE group_info(cleanup, fapl, total_error) CALL check("H5Pget_obj_track_times_f", error, total_error) ! Check default timestamp information - CALL VerifyLogical("H5Pget_obj_track_times",track_times,.FALSE.,total_error) + CALL verify("H5Pget_obj_track_times",track_times,.FALSE.,total_error) ! Create file !h5_fixname(FILENAME[0], fapl, filename, sizeof filename); @@ -533,10 +529,10 @@ SUBROUTINE group_info(cleanup, fapl, total_error) ! Query & verify the object timestamp settings CALL H5Pget_obj_track_times_f(gcpl_id, track_times, error) CALL check("H5Pget_obj_track_times_f", error, total_error) - CALL VerifyLogical("H5Pget_obj_track_times1",track_times,.FALSE.,total_error) + CALL verify("H5Pget_obj_track_times1",track_times,.FALSE.,total_error) CALL H5Pget_obj_track_times_f(gcpl_id2, track_times, error) CALL check("H5Pget_obj_track_times_f", error, total_error) - CALL VerifyLogical("H5Pget_obj_track_times2",track_times,.TRUE.,total_error) + CALL verify("H5Pget_obj_track_times2",track_times,.TRUE.,total_error) ! Query the object information for each group ! if(H5Oget_info(group_id, &oinfo) < 0) TEST_ERROR @@ -593,10 +589,10 @@ SUBROUTINE group_info(cleanup, fapl, total_error) CALL H5Pget_obj_track_times_f(gcpl_id, track_times, error) CALL check("H5Pget_obj_track_times_f", error, total_error) - CALL VerifyLogical("H5Pget_obj_track_times1",track_times,.FALSE.,total_error) + CALL verify("H5Pget_obj_track_times1",track_times,.FALSE.,total_error) CALL H5Pget_obj_track_times_f(gcpl_id2, track_times, error) CALL check("H5Pget_obj_track_times_f", error, total_error) - CALL VerifyLogical("H5Pget_obj_track_times2",track_times,.TRUE.,total_error) + CALL verify("H5Pget_obj_track_times2",track_times,.TRUE.,total_error) !!$ !!$ Query the object information for each group !!$ if(H5Oget_info(group_id, &oinfo) < 0) TEST_ERROR @@ -653,9 +649,6 @@ SUBROUTINE group_info(cleanup, fapl, total_error) SUBROUTINE mklinks(fapl, total_error) - USE HDF5 ! This module contains all necessary modules - USE TH5_MISC - IMPLICIT NONE INTEGER, INTENT(INOUT) :: total_error INTEGER(HID_T), INTENT(IN) :: fapl @@ -711,12 +704,12 @@ SUBROUTINE group_info(cleanup, fapl, total_error) error, H5P_DEFAULT_F) CALL check("H5Lget_info_f",error,total_error) -! CALL VerifyLogical("H5Lget_info_by_idx_f11", f_corder_valid, .TRUE., total_error) +! CALL verify("H5Lget_info_by_idx_f11", f_corder_valid, .TRUE., total_error) - CALL VERIFY("H5Lget_info_by_idx_f", H5L_TYPE_SOFT_F, link_type, total_error) - CALL VERIFY("H5Lget_info_by_idx_f", cset, H5T_CSET_ASCII_F, total_error) + CALL verify("H5Lget_info_by_idx_f", H5L_TYPE_SOFT_F, link_type, total_error) + CALL verify("H5Lget_info_by_idx_f", cset, H5T_CSET_ASCII_F, total_error) ! should be '/d1' + NULL character = 4 - CALL VERIFY("H5Lget_info_by_idx_f", INT(val_size), 4, total_error) + CALL verify("H5Lget_info_by_idx_f", INT(val_size), 4, total_error) ! Create a symbolic link to something that doesn't exist @@ -749,9 +742,6 @@ SUBROUTINE group_info(cleanup, fapl, total_error) SUBROUTINE test_move_preserves(fapl_id, total_error) - USE HDF5 ! This module contains all necessary modules - USE TH5_MISC - IMPLICIT NONE INTEGER, INTENT(INOUT) :: total_error INTEGER(HID_T), INTENT(IN) :: fapl_id @@ -798,14 +788,14 @@ SUBROUTINE group_info(cleanup, fapl, total_error) CALL H5Pget_link_creation_order_f(fcpl_id, crt_order_flags, error) CALL check("H5Pget_link_creation_order_f",error, total_error) - CALL VERIFY("H5Pget_link_creation_order_f",crt_order_flags,0, total_error) + CALL verify("H5Pget_link_creation_order_f",crt_order_flags,0, total_error) CALL H5Pset_link_creation_order_f(fcpl_id, H5P_CRT_ORDER_TRACKED_F, error) CALL check("H5Pset_link_creation_order_f", error, total_error) CALL H5Pget_link_creation_order_f(fcpl_id, crt_order_flags, error) CALL check("H5Pget_link_creation_order_f",error, total_error) - CALL VERIFY("H5Pget_link_creation_order_f",crt_order_flags, H5P_CRT_ORDER_TRACKED_F, total_error) + CALL verify("H5Pget_link_creation_order_f",crt_order_flags, H5P_CRT_ORDER_TRACKED_F, total_error) ! Create file ! (with creation order tracking for the root group) @@ -835,10 +825,10 @@ SUBROUTINE group_info(cleanup, fapl, total_error) ! if(H5Oget_info_by_name(file_id, "group", &oinfo, H5P_DEFAULT) < 0) TEST_ERROR old_cset = cset - CALL VERIFY("H5Lget_info_f",old_cset,H5T_CSET_UTF8_F,total_error) - CALL VerifyLogical("H5Lget_info_f",f_corder_valid,.TRUE.,total_error) + CALL verify("H5Lget_info_f",old_cset,H5T_CSET_UTF8_F,total_error) + CALL verify("H5Lget_info_f",f_corder_valid,.TRUE.,total_error) old_corder = corder; - CALL VERIFY("H5Lget_info_f",old_corder,0,total_error) + CALL verify("H5Lget_info_f",old_corder,0,total_error) ! old_modification_time = oinfo.mtime; @@ -956,10 +946,6 @@ SUBROUTINE group_info(cleanup, fapl, total_error) ! SUBROUTINE lifecycle(cleanup, fapl2, total_error) - - USE HDF5 ! This module contains all necessary modules - USE TH5_MISC - IMPLICIT NONE INTEGER, INTENT(INOUT) :: total_error INTEGER(HID_T), INTENT(IN) :: fapl2 @@ -1105,10 +1091,6 @@ SUBROUTINE lifecycle(cleanup, fapl2, total_error) SUBROUTINE cklinks(fapl, total_error) -! USE ISO_C_BINDING - USE HDF5 ! This module contains all necessary modules - USE TH5_MISC - IMPLICIT NONE INTEGER, INTENT(INOUT) :: total_error INTEGER(HID_T), INTENT(IN) :: fapl @@ -1146,10 +1128,10 @@ SUBROUTINE lifecycle(cleanup, fapl2, total_error) CALL H5Lexists_f(file,"d1",Lexists, error) - CALL verifylogical("H5Lexists", Lexists,.TRUE.,total_error) + CALL verify("H5Lexists", Lexists,.TRUE.,total_error) CALL H5Lexists_f(file,"grp1/hard",Lexists, error) - CALL verifylogical("H5Lexists", Lexists,.TRUE.,total_error) + CALL verify("H5Lexists", Lexists,.TRUE.,total_error) ! Cleanup CALL H5Fclose_f(file,error) @@ -1176,9 +1158,6 @@ END SUBROUTINE cklinks ! SUBROUTINE delete_by_idx(cleanup, fapl, total_error) - USE HDF5 ! This module contains all necessary modules - USE TH5_MISC - IMPLICIT NONE INTEGER, INTENT(INOUT) :: total_error INTEGER(HID_T), INTENT(IN) :: fapl @@ -1294,7 +1273,7 @@ SUBROUTINE delete_by_idx(cleanup, fapl, total_error) ! Check for deletion on empty group CALL H5Ldelete_by_idx_f(group_id, ".", idx_type, iorder, INT(0,HSIZE_T), error) - CALL VERIFY("delete_by_idx.H5Ldelete_by_idx_f", error, -1, total_error) ! test should fail (error = -1) + CALL verify("delete_by_idx.H5Ldelete_by_idx_f", error, -1, total_error) ! test should fail (error = -1) ! Create several links, up to limit of compact form DO u = 0, max_compact-1 ! Make name for link @@ -1319,7 +1298,7 @@ SUBROUTINE delete_by_idx(cleanup, fapl, total_error) htmp =9 !EP CALL H5Ldelete_by_idx_f(group_id, ".", idx_type, iorder, INT(u,HSIZE_T), error) CALL H5Ldelete_by_idx_f(group_id, ".", idx_type, iorder, htmp, error) - CALL VERIFY("H5Ldelete_by_idx_f", error, -1, total_error) ! test should fail (error = -1) + CALL verify("H5Ldelete_by_idx_f", error, -1, total_error) ! test should fail (error = -1) ! Delete links from compact group @@ -1340,21 +1319,21 @@ SUBROUTINE delete_by_idx(cleanup, fapl, total_error) CALL H5Iget_type_f(grp, id_type, error) CALL check("H5Iget_type_f", error, total_error) - CALL VERIFY("H5Iget_type_f", id_type, H5I_GROUP_F, total_error) + CALL verify("H5Iget_type_f", id_type, H5I_GROUP_F, total_error) CALL H5Gclose_f(grp, error) CALL check("H5Gclose_f", error, total_error) - CALL VerifyLogical("H5Lget_info_by_idx_f", f_corder_valid, .TRUE., total_error) + CALL verify("H5Lget_info_by_idx_f", f_corder_valid, .TRUE., total_error) - CALL VERIFY("H5Lget_info_by_idx_f", H5L_TYPE_HARD_F, link_type, total_error) + CALL verify("H5Lget_info_by_idx_f", H5L_TYPE_HARD_F, link_type, total_error) IF(iorder.EQ.H5_ITER_INC_F)THEN - CALL VERIFY("H5Lget_info_by_idx_f", corder, u+1, total_error) + CALL verify("H5Lget_info_by_idx_f", corder, u+1, total_error) ELSE - CALL VERIFY("H5Lget_info_by_idx_f", corder, (max_compact - (u + 2)), total_error) + CALL verify("H5Lget_info_by_idx_f", corder, (max_compact - (u + 2)), total_error) ENDIF - CALL VERIFY("H5Lget_info_by_idx_f",cset, H5T_CSET_ASCII_F, total_error) + CALL verify("H5Lget_info_by_idx_f",cset, H5T_CSET_ASCII_F, total_error) @@ -1371,7 +1350,7 @@ SUBROUTINE delete_by_idx(cleanup, fapl, total_error) !!$ ENDIF !!$ objname = 'fill '//chr2 !!$ PRINT*,objname, tmpname -!!$ CALL verifyString("delete_by_idx.H5Lget_name_by_idx_f", objname, tmpname, total_error) +!!$ CALL verify("delete_by_idx.H5Lget_name_by_idx_f", objname, tmpname, total_error) ENDDO ! Close the group @@ -1418,9 +1397,6 @@ END SUBROUTINE delete_by_idx SUBROUTINE link_info_by_idx_check(group_id, linkname, n, & hard_link, use_index, total_error) - USE HDF5 ! This module contains all necessary modules - USE TH5_MISC - IMPLICIT NONE INTEGER, INTENT(INOUT) :: total_error INTEGER(HID_T), INTENT(IN) :: group_id @@ -1455,14 +1431,14 @@ SUBROUTINE link_info_by_idx_check(group_id, linkname, n, & CALL H5Lget_info_by_idx_f(group_id, ".", H5_INDEX_CRT_ORDER_F, H5_ITER_INC_F, INT(0,HSIZE_T), & link_type, f_corder_valid, corder, cset, address, val_size, error) CALL check("H5Lget_info_by_idx_f", error, total_error) - CALL VERIFY("H5Lget_info_by_idx_f", corder, 0, total_error) + CALL verify("H5Lget_info_by_idx_f", corder, 0, total_error) ! Verify the link information for new link, in increasing creation order ! HDmemset(&linfo, 0, sizeof(linfo)); CALL H5Lget_info_by_idx_f(group_id, ".", H5_INDEX_CRT_ORDER_F, H5_ITER_INC_F, INT(n,HSIZE_T), & link_type, f_corder_valid, corder, cset, address, val_size, error) CALL check("H5Lget_info_by_idx_f", error, total_error) - CALL VERIFY("H5Lget_info_by_idx_f", corder, n, total_error) + CALL verify("H5Lget_info_by_idx_f", corder, n, total_error) ! Verify value for new soft link, in increasing creation order !!$ IF(hard_link)THEN @@ -1481,21 +1457,21 @@ SUBROUTINE link_info_by_idx_check(group_id, linkname, n, & CALL H5Lget_name_by_idx_f(group_id, ".", H5_INDEX_CRT_ORDER_F, H5_ITER_INC_F, INT(n,HSIZE_T), tmpname_small, error, size_tmp) CALL check("link_info_by_idx_check.H5Lget_name_by_idx_f", error, total_error) - CALL verifyString("link_info_by_idx_check.H5Lget_name_by_idx_f", & + CALL verify("link_info_by_idx_check.H5Lget_name_by_idx_f", & linkname(1:LEN(tmpname_small)), tmpname_small(1:LEN(tmpname_small)), total_error) - CALL VERIFY("link_info_by_idx_check.H5Lget_name_by_idx_f", INT(size_tmp), 7, total_error) + CALL verify("link_info_by_idx_check.H5Lget_name_by_idx_f", INT(size_tmp), 7, total_error) ! try it with the correct size CALL H5Lget_name_by_idx_f(group_id, ".", H5_INDEX_CRT_ORDER_F, H5_ITER_INC_F, INT(n,HSIZE_T), tmpname, error, size=size_tmp) CALL check("link_info_by_idx_check.H5Lget_name_by_idx_f", error, total_error) - CALL verifyString("link_info_by_idx_check.H5Lget_name_by_idx_f", & + CALL verify("link_info_by_idx_check.H5Lget_name_by_idx_f", & linkname(1:LEN(tmpname)), tmpname(1:LEN(tmpname)), total_error) - CALL VERIFY("link_info_by_idx_check.H5Lget_name_by_idx_f", INT(size_tmp), 7, total_error) + CALL verify("link_info_by_idx_check.H5Lget_name_by_idx_f", INT(size_tmp), 7, total_error) CALL H5Lget_name_by_idx_f(group_id, ".", H5_INDEX_CRT_ORDER_F, H5_ITER_INC_F, INT(n,HSIZE_T), tmpname_big, error, size_tmp) CALL check("link_info_by_idx_check.H5Lget_name_by_idx_f", error, total_error) - CALL verifyString("link_info_by_idx_check.H5Lget_name_by_idx_f", & + CALL verify("link_info_by_idx_check.H5Lget_name_by_idx_f", & linkname(1:7), tmpname_big(1:7), total_error) - CALL VERIFY("link_info_by_idx_check.H5Lget_name_by_idx_f", INT(size_tmp), 7, total_error) + CALL verify("link_info_by_idx_check.H5Lget_name_by_idx_f", INT(size_tmp), 7, total_error) ! Try with a buffer set to small @@ -1522,9 +1498,6 @@ SUBROUTINE link_info_by_idx_check(group_id, linkname, n, & SUBROUTINE test_lcpl(cleanup, fapl, total_error) - USE HDF5 ! This module contains all necessary modules - USE TH5_MISC - IMPLICIT NONE INTEGER, INTENT(INOUT) :: total_error INTEGER(HID_T), INTENT(IN) :: fapl @@ -1591,7 +1564,7 @@ SUBROUTINE link_info_by_idx_check(group_id, linkname, n, & ! * creation property list and is always ASCII. !#define H5F_DEFAULT_CSET H5T_CSET_ASCII -- FROM H5Fprivate.h -- - CALL VERIFY("H5Lget_info_f",cset, H5T_CSET_ASCII_F,total_error) + CALL verify("H5Lget_info_f",cset, H5T_CSET_ASCII_F,total_error) ! Create and commit a datatype with the default LCPL CALL h5tcopy_f(H5T_NATIVE_INTEGER, type_id, error) @@ -1652,10 +1625,10 @@ SUBROUTINE link_info_by_idx_check(group_id, linkname, n, & DO i = 1, 2 tmp1 = INT(dimsout(i)) tmp2 = INT(extend_dim(i)) - CALL VERIFY("H5Sget_simple_extent_dims", tmp1, tmp2, total_error) + CALL verify("H5Sget_simple_extent_dims", tmp1, tmp2, total_error) tmp1 = INT(maxdimsout(i)) tmp2 = INT(dims(i)) - CALL VERIFY("H5Sget_simple_extent_dims", tmp1, tmp2, total_error) + CALL verify("H5Sget_simple_extent_dims", tmp1, tmp2, total_error) ENDDO ! close data set @@ -1722,7 +1695,7 @@ SUBROUTINE link_info_by_idx_check(group_id, linkname, n, & CALL H5Pget_char_encoding_f(lcpl_id, encoding, error) CALL check("H5Pget_char_encoding_f", error, total_error) - CALL VERIFY("H5Pget_char_encoding_f", encoding, H5T_CSET_UTF8_F, total_error) + CALL verify("H5Pget_char_encoding_f", encoding, H5T_CSET_UTF8_F, total_error) ! Check that its character encoding is UTF-8 CALL H5Lget_info_f(file_id, "dataset2", & @@ -1744,7 +1717,7 @@ SUBROUTINE link_info_by_idx_check(group_id, linkname, n, & CALL H5Lexists_f(file_id,"/dataset2_link",Lexists, error) CALL check("H5Lexists",error, total_error) - CALL verifylogical("H5Lexists", Lexists,.TRUE.,total_error) + CALL verify("H5Lexists", Lexists,.TRUE.,total_error) ! Check that its character encoding is ASCII CALL H5Lget_info_f(file_id, "/dataset2_link", & @@ -1834,9 +1807,6 @@ END SUBROUTINE test_lcpl SUBROUTINE objcopy(fapl, total_error) - USE HDF5 ! This module contains all necessary modules - USE TH5_MISC - IMPLICIT NONE INTEGER, INTENT(INOUT) :: total_error INTEGER(HID_T), INTENT(IN) :: fapl @@ -1867,7 +1837,7 @@ SUBROUTINE objcopy(fapl, total_error) ! Verify object copy flags CALL H5Pget_copy_object_f(pid, cpy_flags, error) CALL check("H5Pget_copy_object_f",error, total_error) - CALL VERIFY("H5Pget_copy_object_f", cpy_flags, flag, total_error) + CALL verify("H5Pget_copy_object_f", cpy_flags, flag, total_error) !!$ !!$ CALL test_copy_option(fcpl_src, fcpl_dst, my_fapl, H5O_COPY_WITHOUT_ATTR_FLAG, @@ -1898,9 +1868,6 @@ END SUBROUTINE objcopy SUBROUTINE lapl_nlinks( fapl, total_error) - USE HDF5 - USE TH5_MISC - IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: fapl INTEGER, INTENT(INOUT) :: total_error @@ -1972,7 +1939,7 @@ SUBROUTINE lapl_nlinks( fapl, total_error) nlinks = 0 CALL H5Pget_nlinks_f(plist, nlinks, error) CALL check("H5Pset_nlinks_f",error,total_error) - CALL VERIFY("H5Pset_nlinks_f",INT(nlinks), 20, total_error) + CALL verify("H5Pset_nlinks_f",INT(nlinks), 20, total_error) ! Open object through what is normally too many soft links using @@ -1984,7 +1951,7 @@ SUBROUTINE lapl_nlinks( fapl, total_error) ! Check name CALL h5iget_name_f(gid, objname, buf_size, name_len, error) CALL check("h5iget_name_f",error,total_error) - CALL VerifyString("h5iget_name_f", TRIM(objname),"/soft17", total_error) + CALL verify("h5iget_name_f", TRIM(objname),"/soft17", total_error) ! Create group using soft link CALL H5Gcreate_f(gid, "new_soft", gid2, error) CALL check("H5Gcreate_f", error, total_error) @@ -2006,12 +1973,12 @@ SUBROUTINE lapl_nlinks( fapl, total_error) CALL H5Pget_nlinks_f(plist, nlinks, error) CALL check("H5Pget_nlinks_f",error,total_error) - CALL VERIFY("H5Pget_nlinks_f", INT(nlinks), 4, total_error) + CALL verify("H5Pget_nlinks_f", INT(nlinks), 4, total_error) ! Try opening through what is now too many soft links CALL H5Oopen_f(fid,"soft5",gid,error,plist) - CALL VERIFY("H5Oopen_f", error, -1, total_error) ! should fail + CALL verify("H5Oopen_f", error, -1, total_error) ! should fail ! Open object through lesser soft link CALL H5Oopen_f(fid,"soft4",gid,error,plist) @@ -2020,7 +1987,7 @@ SUBROUTINE lapl_nlinks( fapl, total_error) ! Check name CALL h5iget_name_f(gid, objname, buf_size, name_len, error) CALL check("h5iget_name_f",error,total_error) - CALL VerifyString("h5iget_name_f", TRIM(objname),"/soft4", total_error) + CALL verify("h5iget_name_f", TRIM(objname),"/soft4", total_error) ! Test other functions that should use a LAPL nlinks = 20 diff --git a/fortran/test/tH5I.f90 b/fortran/test/tH5I.f90 index 088b4eb..97c48c6 100644 --- a/fortran/test/tH5I.f90 +++ b/fortran/test/tH5I.f90 @@ -27,6 +27,10 @@ ! !***** MODULE TH5I + + USE HDF5 ! This module contains all necessary modules + USE TH5_MISC + USE TH5_MISC_GEN CONTAINS @@ -34,8 +38,6 @@ CONTAINS ! This subroutine tests following functionalities: h5iget_type_f - USE HDF5 ! This module contains all necessary modules - USE TH5_MISC IMPLICIT NONE LOGICAL, INTENT(IN) :: cleanup @@ -88,7 +90,7 @@ CONTAINS dtype = -1 CALL H5Iis_valid_f(dtype, tri_ret, error) CALL check("H5Iis_valid_f", error, total_error) - CALL VerifyLogical("H5Iis_valid_f", tri_ret, .FALSE., total_error) + CALL verify("H5Iis_valid_f", tri_ret, .FALSE., total_error) ! Create a datatype id CALL H5Tcopy_f(H5T_NATIVE_INTEGER,dtype,error) @@ -97,7 +99,7 @@ CONTAINS ! Check that the ID is valid CALL H5Iis_valid_f(dtype, tri_ret, error) CALL check("H5Iis_valid_f", error, total_error) - CALL VerifyLogical("H5Tequal_f", tri_ret, .TRUE., total_error) + CALL verify("H5Tequal_f", tri_ret, .TRUE., total_error) CALL H5Tclose_f(dtype, error) CALL check("H5Tclose_f", error, total_error) diff --git a/fortran/test/tH5L_F03.f90 b/fortran/test/tH5L_F03.f90 index 795f1e2..40afdbc 100644 --- a/fortran/test/tH5L_F03.f90 +++ b/fortran/test/tH5L_F03.f90 @@ -32,8 +32,10 @@ !***** MODULE liter_cb_mod - USE HDF5 - USE ISO_C_BINDING + USE HDF5 + USE TH5_MISC + USE TH5_MISC_GEN + USE, INTRINSIC :: ISO_C_BINDING IMPLICIT NONE TYPE iter_enum @@ -45,7 +47,7 @@ MODULE liter_cb_mod ! Custom group iteration callback data TYPE, bind(c) :: iter_info - CHARACTER(LEN=1), DIMENSION(1:10) :: name ! The name of the object + CHARACTER(KIND=C_CHAR), DIMENSION(1:10) :: name ! The name of the object INTEGER(c_int) :: TYPE ! The TYPE of the object INTEGER(c_int) :: command ! The TYPE of RETURN value END TYPE iter_info @@ -60,8 +62,6 @@ CONTAINS INTEGER(KIND=C_INT) FUNCTION liter_cb(group, name, link_info, op_data) bind(C) - USE HDF5 - USE ISO_C_BINDING IMPLICIT NONE INTEGER(HID_T), VALUE :: group @@ -123,9 +123,6 @@ CONTAINS !*************************************************************** SUBROUTINE test_iter_group(total_error) - USE HDF5 - USE TH5_MISC - USE ISO_C_BINDING USE liter_cb_mod IMPLICIT NONE @@ -251,11 +248,11 @@ SUBROUTINE test_iter_group(total_error) CALL H5Literate_f(file, H5_INDEX_NAME_F, H5_ITER_INC_F, idx, f1, f2, ret_value, error) IF(error.LT.0) EXIT ! Verify return value from iterator gets propagated correctly - CALL VERIFY("H5Literate", ret_value, 2, total_error) + CALL verify("H5Literate", ret_value, 2, total_error) ! Increment the number of times "2" is returned i = i + 1 ! Verify that the index is the correct value - CALL VERIFY("H5Literate", INT(idx), INT(i), total_error) + CALL verify("H5Literate", INT(idx), INT(i), total_error) IF(idx .GT.ndatasets+2)THEN PRINT*,"ERROR: Group iteration function walked too far!" ENDIF @@ -264,14 +261,14 @@ SUBROUTINE test_iter_group(total_error) DO j = 1, 10 ichr10(j:j) = info%name(j)(1:1) ENDDO - CALL verifystring("H5Literate_f", ichr10, lnames(INT(idx)), total_error) + CALL verify("H5Literate_f", ichr10, lnames(INT(idx)), total_error) IF(i.EQ.52)EXIT ! prints out error message otherwise (for gcc/gfortran/g95) not intel (why) -FIXME- scot END DO ! put check if did not walk far enough -scot FIXME IF(i .NE. (NDATASETS + 2)) THEN - CALL VERIFY("H5Literate_f", i, INT(NDATASETS + 2), total_error) + CALL verify("H5Literate_f", i, INT(NDATASETS + 2), total_error) PRINT*,"ERROR: Group iteration function didn't perform multiple iterations correctly" ENDIF @@ -288,13 +285,13 @@ SUBROUTINE test_iter_group(total_error) CALL H5Literate_f(file, H5_INDEX_NAME_F, H5_ITER_INC_F, idx, f1, f2, ret_value, error) IF(error.LT.0) EXIT - CALL VERIFY("H5Literate_f", ret_value, 1, total_error) + CALL verify("H5Literate_f", ret_value, 1, total_error) ! Increment the number of times "1" is returned i = i + 1 ! Verify that the index is the correct value - CALL VERIFY("H5Literate_f", INT(idx), INT(i+10), total_error) + CALL verify("H5Literate_f", INT(idx), INT(i+10), total_error) IF(idx .GT.ndatasets+2)THEN PRINT*,"Group iteration function walked too far!" @@ -304,7 +301,7 @@ SUBROUTINE test_iter_group(total_error) ichr10(j:j) = info%name(j)(1:1) ENDDO ! Verify that the correct name is retrieved - CALL verifystring("H5Literate_f", ichr10, lnames(INT(idx)), total_error) + CALL verify("H5Literate_f", ichr10, lnames(INT(idx)), total_error) IF(i.EQ.42)EXIT ! prints out error message otherwise (for gcc/gfortran/g95) not intel (why) -FIX- scot ENDDO diff --git a/fortran/test/tH5MISC_1_8.f90 b/fortran/test/tH5MISC_1_8.f90 index efaf594..ba3f095 100644 --- a/fortran/test/tH5MISC_1_8.f90 +++ b/fortran/test/tH5MISC_1_8.f90 @@ -25,11 +25,13 @@ !***** MODULE TH5MISC_1_8 + USE HDF5 ! This module contains all necessary modules + USE TH5_MISC + USE TH5_MISC_GEN + CONTAINS SUBROUTINE dtransform(cleanup, total_error) - USE HDF5 ! This module contains all necessary modules - USE TH5_MISC IMPLICIT NONE LOGICAL, INTENT(IN) :: cleanup @@ -57,22 +59,22 @@ SUBROUTINE dtransform(cleanup, total_error) CALL H5Pget_data_transform_f(dxpl_id_c_to_f, ptrgetTest, error, size=size) CALL check("dtransform.H5Pget_data_transform_f", error, total_error) - CALL VerifyString("dtransform.H5Pget_data_transform_f", c_to_f, ptrgetTest, total_error) - CALL VERIFY("dtransform.H5Pget_data_transform_f", INT(size),15, total_error) + CALL verify("dtransform.H5Pget_data_transform_f", c_to_f, ptrgetTest, total_error) + CALL verify("dtransform.H5Pget_data_transform_f", INT(size),15, total_error) ! check case when receiving buffer to small CALL H5Pget_data_transform_f(dxpl_id_c_to_f, ptrgetTest_small, error, size=size) CALL check("dtransform.H5Pget_data_transform_f", error, total_error) - CALL VerifyString("dtransform.H5Pget_data_transform_f", c_to_f(1:7), ptrgetTest_small, total_error) - CALL VERIFY("dtransform.H5Pget_data_transform_f", INT(size),15, total_error) + CALL verify("dtransform.H5Pget_data_transform_f", c_to_f(1:7), ptrgetTest_small, total_error) + CALL verify("dtransform.H5Pget_data_transform_f", INT(size),15, total_error) ! check case when receiving buffer to big CALL H5Pget_data_transform_f(dxpl_id_c_to_f, ptrgetTest_big, error, size=size) CALL check("dtransform.H5Pget_data_transform_f", error, total_error) - CALL VerifyString("dtransform.H5Pget_data_transform_f", c_to_f(1:15), ptrgetTest_big(1:15), total_error) - CALL VERIFY("dtransform.H5Pget_data_transform_f", INT(size), 15, total_error) + CALL verify("dtransform.H5Pget_data_transform_f", c_to_f(1:15), ptrgetTest_big(1:15), total_error) + CALL verify("dtransform.H5Pget_data_transform_f", INT(size), 15, total_error) CALL H5Fclose_f(file_id, error) CALL check("H5Fclose_f", error, total_error) @@ -92,9 +94,6 @@ END SUBROUTINE dtransform SUBROUTINE test_genprop_basic_class(total_error) - USE HDF5 ! This module contains all necessary modules - USE TH5_MISC - IMPLICIT NONE INTEGER, INTENT(INOUT) :: total_error @@ -117,7 +116,7 @@ SUBROUTINE test_genprop_basic_class(total_error) cid1 = 456 CALL H5Pget_class_name_f(cid1, name, size, error) - CALL VERIFY("H5Pget_class_name", error, -1, error) + CALL verify("H5Pget_class_name", error, -1, error) ! Create a new generic class, derived from the root of the class hierarchy CALL H5Pcreate_class_f(H5P_ROOT_F, CLASS1_NAME, cid1, error) @@ -126,8 +125,8 @@ SUBROUTINE test_genprop_basic_class(total_error) ! Check class name CALL H5Pget_class_name_f(cid1, name, size, error) CALL check("H5Pget_class_name", error, total_error) - CALL VERIFY("H5Pget_class_name", size,7,error) - CALL verifystring("H5Pget_class_name", name, CLASS1_NAME, error) + CALL verify("H5Pget_class_name", size,7,error) + CALL verify("H5Pget_class_name", name, CLASS1_NAME, error) IF(error.NE.0)THEN WRITE(*,*) 'Class names do not match! name=',name, 'CLASS1_NAME=',CLASS1_NAME total_error = total_error + 1 @@ -136,8 +135,8 @@ SUBROUTINE test_genprop_basic_class(total_error) ! Check class name smaller buffer CALL H5Pget_class_name_f(cid1, name_small, size, error) CALL check("H5Pget_class_name", error, total_error) - CALL VERIFY("H5Pget_class_name", size,7,error) - CALL verifystring("H5Pget_class_name", name_small(1:4), CLASS1_NAME(1:4), error) + CALL verify("H5Pget_class_name", size,7,error) + CALL verify("H5Pget_class_name", name_small(1:4), CLASS1_NAME(1:4), error) IF(error.NE.0)THEN WRITE(*,*) 'Class names do not match! name=',name_small(1:4), 'CLASS1_NAME=',CLASS1_NAME(1:4) total_error = total_error + 1 @@ -146,8 +145,8 @@ SUBROUTINE test_genprop_basic_class(total_error) ! Check class name bigger buffer CALL H5Pget_class_name_f(cid1, name_big, size, error) CALL check("H5Pget_class_name", error, total_error) - CALL VERIFY("H5Pget_class_name", size,7,error) - CALL verifystring("H5Pget_class_name", TRIM(name_big), TRIM(CLASS1_NAME), error) + CALL verify("H5Pget_class_name", size,7,error) + CALL verify("H5Pget_class_name", TRIM(name_big), TRIM(CLASS1_NAME), error) IF(error.NE.0)THEN WRITE(*,*) 'Class names do not match! name=',TRIM(name_small), 'CLASS1_NAME=',TRIM(CLASS1_NAME) total_error = total_error + 1 @@ -160,13 +159,13 @@ SUBROUTINE test_genprop_basic_class(total_error) ! Verify class parent correct CALL H5Pequal_f(cid2, H5P_ROOT_F, flag, error) CALL check("H5Pequal_f", error, total_error) - CALL verifylogical("H5Pequal_f", flag, .TRUE., total_error) + CALL verify("H5Pequal_f", flag, .TRUE., total_error) ! Make certain false postives aren't being returned CALL H5Pequal_f(cid2, H5P_FILE_CREATE_F, flag, error) CALL check("H5Pequal_f", error, total_error) - CALL verifylogical("H5Pequal_f", flag, .FALSE., total_error) + CALL verify("H5Pequal_f", flag, .FALSE., total_error) ! Close parent class CALL H5Pclose_class_f(cid2, error) @@ -187,8 +186,6 @@ SUBROUTINE test_h5s_encode(total_error) !** !*************************************************************** - USE HDF5 ! This module contains all necessary modules - USE TH5_MISC IMPLICIT NONE INTEGER, INTENT(INOUT) :: total_error @@ -241,7 +238,7 @@ SUBROUTINE test_h5s_encode(total_error) ! Try decoding bogus buffer CALL H5Sdecode_f(sbuf, decoded_sid1, error) - CALL VERIFY("H5Sdecode", error, -1, total_error) + CALL verify("H5Sdecode", error, -1, total_error) CALL H5Sencode_f(sid1, sbuf, sbuf_size, error) CALL check("H5Sencode", error, total_error) @@ -254,7 +251,7 @@ SUBROUTINE test_h5s_encode(total_error) ! Verify the decoded dataspace CALL h5sget_simple_extent_npoints_f(decoded_sid1, n, error) CALL check("h5sget_simple_extent_npoints_f", error, total_error) - CALL VERIFY("h5sget_simple_extent_npoints_f", INT(n), INT(SPACE1_DIM1 * SPACE1_DIM2 * SPACE1_DIM3), & + CALL verify("h5sget_simple_extent_npoints_f", INT(n), INT(SPACE1_DIM1 * SPACE1_DIM2 * SPACE1_DIM3), & total_error) ! @@ -297,16 +294,16 @@ SUBROUTINE test_h5s_encode(total_error) CALL H5Sget_simple_extent_type_f(decoded_sid3, space_type, error) CALL check("H5Sget_simple_extent_type_f", error, total_error) - CALL VERIFY("H5Sget_simple_extent_type_f", space_type, H5S_SCALAR_F, total_error) + CALL verify("H5Sget_simple_extent_type_f", space_type, H5S_SCALAR_F, total_error) ! Verify decoded dataspace CALL h5sget_simple_extent_npoints_f(decoded_sid3, n, error) CALL check("h5sget_simple_extent_npoints_f", error, total_error) - CALL VERIFY("h5sget_simple_extent_npoints_f", INT(n), 1, total_error) + CALL verify("h5sget_simple_extent_npoints_f", INT(n), 1, total_error) CALL H5Sget_simple_extent_ndims_f(decoded_sid3, rank, error) CALL CHECK("H5Sget_simple_extent_ndims_f", error, total_error) - CALL VERIFY("H5Sget_simple_extent_ndims_f", rank, 0, total_error ) + CALL verify("H5Sget_simple_extent_ndims_f", rank, 0, total_error ) CALL h5sclose_f(sid3, error) CALL check("h5sclose_f", error, total_error) @@ -335,8 +332,6 @@ END SUBROUTINE test_h5s_encode SUBROUTINE test_scaleoffset(cleanup, total_error ) - USE HDF5 - USE TH5_MISC IMPLICIT NONE LOGICAL, INTENT(IN) :: cleanup INTEGER, INTENT(INOUT) :: total_error diff --git a/fortran/test/tH5O.f90 b/fortran/test/tH5O.f90 index 99d4c22..51e1d64 100644 --- a/fortran/test/tH5O.f90 +++ b/fortran/test/tH5O.f90 @@ -28,11 +28,13 @@ !***** MODULE TH5O + USE HDF5 ! This module contains all necessary modules + USE TH5_MISC + USE TH5_MISC_GEN + CONTAINS SUBROUTINE test_h5o(cleanup, total_error) - USE HDF5 ! This module contains all necessary modules - USE TH5_MISC IMPLICIT NONE LOGICAL, INTENT(IN) :: cleanup @@ -57,9 +59,6 @@ END SUBROUTINE test_h5o SUBROUTINE test_h5o_link(total_error) - USE HDF5 ! This module contains all necessary modules - USE TH5_MISC - IMPLICIT NONE INTEGER, INTENT(INOUT) :: total_error @@ -157,7 +156,7 @@ SUBROUTINE test_h5o_link(total_error) CALL H5Tcommitted_f(type_id, committed, error) CALL check("H5Tcommitted_f",error,total_error) - CALL verifyLogical("H5Tcommitted_f", committed, .TRUE., total_error) + CALL verify("H5Tcommitted_f", committed, .TRUE., total_error) ! Create a dataset with no name using the committed datatype CALL H5Dcreate_anon_f(file_id, type_id, space_id, dset_id, error ) ! using no optional parameters @@ -181,7 +180,7 @@ SUBROUTINE test_h5o_link(total_error) ! Verify the data DO i = 1, TEST6_DIM1 DO j = 1, TEST6_DIM2 - CALL VERIFY("H5Dread_f",wdata(i,j),rdata(i,j),total_error) + CALL verify("H5Dread_f",wdata(i,j),rdata(i,j),total_error) wdata(i,j) = i*j ENDDO ENDDO @@ -229,7 +228,7 @@ SUBROUTINE test_h5o_link(total_error) ! Verify the data DO i = 1, TEST6_DIM1 DO j = 1, TEST6_DIM2 - CALL VERIFY("H5Dread",wdata(i,j),rdata(i,j),total_error) + CALL verify("H5Dread",wdata(i,j),rdata(i,j),total_error) ENDDO ENDDO ! Close open IDs @@ -464,7 +463,7 @@ SUBROUTINE test_h5o_link(total_error) nlinks = 0 CALL h5pget_nlinks_f(plist, nlinks, error) CALL check("h5pget_nlinks_f",error,total_error) - CALL VERIFY("h5pget_nlinks_f", INT(nlinks), 2, total_error) + CALL verify("h5pget_nlinks_f", INT(nlinks), 2, total_error) ! See if the link exists CALL h5oexists_by_name_f(file_id,"/G1_LINK", link_exists, error, plist) @@ -578,9 +577,6 @@ END SUBROUTINE test_h5o_link SUBROUTINE test_h5o_plist(total_error) - USE HDF5 ! This module contains all necessary modules - USE TH5_MISC - IMPLICIT NONE INTEGER, INTENT(INOUT) :: total_error @@ -631,18 +627,18 @@ SUBROUTINE test_h5o_plist(total_error) ! Retrieve attribute phase change values on each creation property list and verify CALL H5Pget_attr_phase_change_f(gcpl, max_compact, min_dense, error) CALL check("H5Pget_attr_phase_change_f", error, total_error) - CALL VERIFY("H5Pget_attr_phase_change_f", max_compact, (def_max_compact + 1), total_error) - CALL VERIFY("H5Pget_attr_phase_change_f", min_dense, (def_min_dense - 1), total_error) + CALL verify("H5Pget_attr_phase_change_f", max_compact, (def_max_compact + 1), total_error) + CALL verify("H5Pget_attr_phase_change_f", min_dense, (def_min_dense - 1), total_error) CALL H5Pget_attr_phase_change_f(dcpl, max_compact, min_dense, error) CALL check("H5Pget_attr_phase_change_f", error, total_error) - CALL VERIFY("H5Pget_attr_phase_change_f", max_compact, (def_max_compact + 1), total_error) - CALL VERIFY("H5Pget_attr_phase_change_f", min_dense, (def_min_dense - 1), total_error) + CALL verify("H5Pget_attr_phase_change_f", max_compact, (def_max_compact + 1), total_error) + CALL verify("H5Pget_attr_phase_change_f", min_dense, (def_min_dense - 1), total_error) CALL H5Pget_attr_phase_change_f(tcpl, max_compact, min_dense, error) CALL check("H5Pget_attr_phase_change_f", error, total_error) - CALL VERIFY("H5Pget_attr_phase_change_f", max_compact, (def_max_compact + 1), total_error) - CALL VERIFY("H5Pget_attr_phase_change_f", min_dense, (def_min_dense - 1), total_error) + CALL verify("H5Pget_attr_phase_change_f", max_compact, (def_max_compact + 1), total_error) + CALL verify("H5Pget_attr_phase_change_f", min_dense, (def_min_dense - 1), total_error) ! Create a group, dataset, and committed datatype within the file, ! using the respective type of creation property lists. @@ -700,18 +696,18 @@ SUBROUTINE test_h5o_plist(total_error) ! Retrieve attribute phase change values on each creation property list and verify CALL H5Pget_attr_phase_change_f(gcpl, max_compact, min_dense, error) CALL check("H5Pget_attr_phase_change_f", error, total_error) - CALL VERIFY("H5Pget_attr_phase_change_f", max_compact, (def_max_compact + 1), total_error) - CALL VERIFY("H5Pget_attr_phase_change_f", min_dense, (def_min_dense - 1), total_error) + CALL verify("H5Pget_attr_phase_change_f", max_compact, (def_max_compact + 1), total_error) + CALL verify("H5Pget_attr_phase_change_f", min_dense, (def_min_dense - 1), total_error) CALL H5Pget_attr_phase_change_f(dcpl, max_compact, min_dense, error) CALL check("H5Pget_attr_phase_change_f", error, total_error) - CALL VERIFY("H5Pget_attr_phase_change_f", max_compact, (def_max_compact + 1), total_error) - CALL VERIFY("H5Pget_attr_phase_change_f", min_dense, (def_min_dense - 1), total_error) + CALL verify("H5Pget_attr_phase_change_f", max_compact, (def_max_compact + 1), total_error) + CALL verify("H5Pget_attr_phase_change_f", min_dense, (def_min_dense - 1), total_error) CALL H5Pget_attr_phase_change_f(tcpl, max_compact, min_dense, error) CALL check("H5Pget_attr_phase_change_f", error, total_error) - CALL VERIFY("H5Pget_attr_phase_change_f", max_compact, (def_max_compact + 1), total_error) - CALL VERIFY("H5Pget_attr_phase_change_f", min_dense, (def_min_dense - 1), total_error) + CALL verify("H5Pget_attr_phase_change_f", max_compact, (def_max_compact + 1), total_error) + CALL verify("H5Pget_attr_phase_change_f", min_dense, (def_min_dense - 1), total_error) ! Close current objects CALL h5pclose_f(gcpl,error) @@ -757,18 +753,18 @@ SUBROUTINE test_h5o_plist(total_error) ! Retrieve attribute phase change values on each creation property list and verify CALL H5Pget_attr_phase_change_f(gcpl, max_compact, min_dense, error) CALL check("H5Pget_attr_phase_change_f", error, total_error) - CALL VERIFY("H5Pget_attr_phase_change_f", max_compact, (def_max_compact + 1), total_error) - CALL VERIFY("H5Pget_attr_phase_change_f", min_dense, (def_min_dense - 1), total_error) + CALL verify("H5Pget_attr_phase_change_f", max_compact, (def_max_compact + 1), total_error) + CALL verify("H5Pget_attr_phase_change_f", min_dense, (def_min_dense - 1), total_error) CALL H5Pget_attr_phase_change_f(dcpl, max_compact, min_dense, error) CALL check("H5Pget_attr_phase_change_f", error, total_error) - CALL VERIFY("H5Pget_attr_phase_change_f", max_compact, (def_max_compact + 1), total_error) - CALL VERIFY("H5Pget_attr_phase_change_f", min_dense, (def_min_dense - 1), total_error) + CALL verify("H5Pget_attr_phase_change_f", max_compact, (def_max_compact + 1), total_error) + CALL verify("H5Pget_attr_phase_change_f", min_dense, (def_min_dense - 1), total_error) CALL H5Pget_attr_phase_change_f(tcpl, max_compact, min_dense, error) CALL check("H5Pget_attr_phase_change_f", error, total_error) - CALL VERIFY("H5Pget_attr_phase_change_f", max_compact, (def_max_compact + 1), total_error) - CALL VERIFY("H5Pget_attr_phase_change_f", min_dense, (def_min_dense - 1), total_error) + CALL verify("H5Pget_attr_phase_change_f", max_compact, (def_max_compact + 1), total_error) + CALL verify("H5Pget_attr_phase_change_f", min_dense, (def_min_dense - 1), total_error) ! Close current objects CALL h5pclose_f(gcpl,error) diff --git a/fortran/test/tH5O_F03.f90 b/fortran/test/tH5O_F03.f90 index 8e014f4..834308b 100644 --- a/fortran/test/tH5O_F03.f90 +++ b/fortran/test/tH5O_F03.f90 @@ -31,7 +31,7 @@ MODULE visit_cb USE HDF5 - USE ISO_C_BINDING + USE, INTRINSIC :: ISO_C_BINDING IMPLICIT NONE @@ -53,7 +53,7 @@ MODULE visit_cb ! ! Object visit structs TYPE, bind(c) :: obj_visit_t - CHARACTER(LEN=1), DIMENSION(1:180) :: path ! Path to object + CHARACTER(KIND=C_CHAR), DIMENSION(1:180) :: path ! Path to object INTEGER :: type_obj ! type of object END TYPE obj_visit_t diff --git a/fortran/test/tH5P.f90 b/fortran/test/tH5P.f90 index 7dcc580..39d8c1e 100644 --- a/fortran/test/tH5P.f90 +++ b/fortran/test/tH5P.f90 @@ -27,6 +27,9 @@ ! !***** MODULE TH5P + USE HDF5 ! This module contains all necessary modules + USE TH5_MISC + USE TH5_MISC_GEN CONTAINS @@ -36,8 +39,6 @@ SUBROUTINE external_test(cleanup, total_error) ! h5pset_external_f, h5pget_external_count_f, ! h5pget_external_f - USE HDF5 ! This module contains all necessary modules - USE TH5_MISC IMPLICIT NONE LOGICAL, INTENT(IN) :: cleanup @@ -153,8 +154,6 @@ SUBROUTINE external_test(cleanup, total_error) END SUBROUTINE external_test SUBROUTINE multi_file_test(cleanup, total_error) - USE HDF5 ! This module contains all necessary modules - USE TH5_MISC IMPLICIT NONE LOGICAL, INTENT(IN) :: cleanup @@ -421,10 +420,7 @@ END SUBROUTINE multi_file_test ! April 16, 2009 !------------------------------------------------------------------------- ! -SUBROUTINE test_chunk_cache(cleanup, total_error) - - USE HDF5 ! This module contains all necessary modules - USE TH5_MISC +SUBROUTINE test_chunk_cache(cleanup, total_error) IMPLICIT NONE LOGICAL, INTENT(IN) :: cleanup @@ -470,19 +466,16 @@ SUBROUTINE test_chunk_cache(cleanup, total_error) CALL check("H5Pget_cache_f", error, total_error) CALL H5Pget_chunk_cache_f(dapl1, nslots_4, nbytes_4, w0_4, error) CALL check("H5Pget_chunk_cache_f", error, total_error) - CALL VERIFY("H5Pget_chunk_cache_f", INT(nslots_1), INT(nslots_4), total_error) - CALL VERIFY("H5Pget_chunk_cache_f", INT(nbytes_1), INT(nbytes_4), total_error) - - IF( .NOT.dreal_eq( REAL(w0_1,dp), REAL( w0_4, dp)) ) THEN - CALL VERIFYlogical("H5Pget_chunk_cache_f", .TRUE., .FALSE., total_error) - ENDIF + CALL verify("H5Pget_chunk_cache_f", nslots_1, nslots_4, total_error) + CALL verify("H5Pget_chunk_cache_f", nbytes_1, nbytes_4, total_error) + CALL verify("H5Pget_chunk_cache_f", w0_1, w0_4, total_error) ! Set a lapl property on dapl1 (to verify inheritance) CALL H5Pset_nlinks_f(dapl1, 134_size_t , error) CALL check("H5Pset_nlinks_f", error, total_error) CALL H5Pget_nlinks_f(dapl1, nlinks, error) CALL check("H5Pget_nlinks_f", error, total_error) - CALL VERIFY("H5Pget_nlinks_f", INT(nlinks), 134, total_error) + CALL verify("H5Pget_nlinks_f", INT(nlinks), 134, total_error) CALL h5pcreate_f(H5P_FILE_ACCESS_F, fapl_local, error) @@ -529,11 +522,9 @@ SUBROUTINE test_chunk_cache(cleanup, total_error) CALL check("H5Dget_access_plist_f", error, total_error) CALL H5Pget_chunk_cache_f(dapl2, nslots_4, nbytes_4, w0_4, error) CALL check("H5Pget_chunk_cache_f", error, total_error) - CALL VERIFY("H5Pget_chunk_cache_f", INT(nslots_2), INT(nslots_4), total_error) - CALL VERIFY("H5Pget_chunk_cache_f", INT(nbytes_2), INT(nbytes_4), total_error) - IF( .NOT.dreal_eq( REAL(w0_2,dp), REAL( w0_4, dp)) ) THEN - CALL VERIFYlogical("H5Pget_chunk_cache_f", .TRUE., .FALSE., total_error) - ENDIF + CALL verify("H5Pget_chunk_cache_f", INT(nslots_2), INT(nslots_4), total_error) + CALL verify("H5Pget_chunk_cache_f", INT(nbytes_2), INT(nbytes_4), total_error) + CALL verify("H5Pget_chunk_cache_f", w0_2, w0_4, total_error) CALL H5Pclose_f(dapl2,error) CALL check("H5Pclose_f", error, total_error) @@ -561,11 +552,9 @@ SUBROUTINE test_chunk_cache(cleanup, total_error) CALL check("H5Dget_access_plist_f", error, total_error) CALL H5Pget_chunk_cache_f(dapl2, nslots_4, nbytes_4, w0_4, error) CALL check("H5Pget_chunk_cache_f", error, total_error) - CALL VERIFY("H5Pget_chunk_cache_f", INT(nslots_3), INT(nslots_4), total_error) - CALL VERIFY("H5Pget_chunk_cache_f", INT(nbytes_2), INT(nbytes_4), total_error) - IF( .NOT.dreal_eq( REAL(w0_3,dp), REAL( w0_4, dp)) ) THEN - CALL VERIFYlogical("H5Pget_chunk_cache_f4", .TRUE., .FALSE., total_error) - ENDIF + CALL verify("H5Pget_chunk_cache_f", INT(nslots_3), INT(nslots_4), total_error) + CALL verify("H5Pget_chunk_cache_f", INT(nbytes_2), INT(nbytes_4), total_error) + CALL verify("H5Pget_chunk_cache_f", w0_3, w0_4, total_error) CALL H5Pclose_f(dapl2,error) CALL check("H5Pclose_f", error, total_error) @@ -581,11 +570,9 @@ SUBROUTINE test_chunk_cache(cleanup, total_error) CALL check("H5Dget_access_plist_f", error, total_error) CALL H5Pget_chunk_cache_f(dapl2, nslots_4, nbytes_4, w0_4, error) CALL check("H5Pget_chunk_cache_f", error, total_error) - CALL VERIFY("H5Pget_chunk_cache_f", INT(nslots_2), INT(nslots_4), total_error) - CALL VERIFY("H5Pget_chunk_cache_f", INT(nbytes_2), INT(nbytes_4), total_error) - IF( .NOT.dreal_eq( REAL(w0_2,dp), REAL( w0_4, dp)) ) THEN - CALL VERIFYlogical("H5Pget_chunk_cache_f", .TRUE., .FALSE., total_error) - ENDIF + CALL verify("H5Pget_chunk_cache_f", INT(nslots_2), INT(nslots_4), total_error) + CALL verify("H5Pget_chunk_cache_f", INT(nbytes_2), INT(nbytes_4), total_error) + CALL verify("H5Pget_chunk_cache_f", w0_2, w0_4, total_error) CALL H5Pclose_f(dapl2,error) CALL check("H5Pclose_f", error, total_error) @@ -601,11 +588,9 @@ SUBROUTINE test_chunk_cache(cleanup, total_error) CALL H5Pget_chunk_cache_f(dapl2, nslots_4, nbytes_4, w0_4, error) CALL check("H5Pget_chunk_cache_f", error, total_error) - CALL VERIFY("H5Pget_chunk_cache_f", INT(nslots_2), INT(nslots_4), total_error) - CALL VERIFY("H5Pget_chunk_cache_f", INT(nbytes_2), INT(nbytes_4), total_error) - IF( .NOT.dreal_eq( REAL(w0_2,dp), REAL( w0_4, dp)) ) THEN - CALL VERIFYlogical("H5Pget_chunk_cache_f", .TRUE., .FALSE., total_error) - ENDIF + CALL verify("H5Pget_chunk_cache_f", INT(nslots_2), INT(nslots_4), total_error) + CALL verify("H5Pget_chunk_cache_f", INT(nbytes_2), INT(nbytes_4), total_error) + CALL verify("H5Pget_chunk_cache_f", w0_2, w0_4, total_error) ! Don't close dapl2, we will use it in the next section ! Modify cache values on fapl_local @@ -638,11 +623,9 @@ SUBROUTINE test_chunk_cache(cleanup, total_error) CALL check("H5Dget_access_plist_f", error, total_error) CALL H5Pget_chunk_cache_f(dapl2, nslots_4, nbytes_4, w0_4, error) CALL check("H5Pget_chunk_cache_f", error, total_error) - CALL VERIFY("H5Pget_chunk_cache_f", INT(nslots_2), INT(nslots_4), total_error) - CALL VERIFY("H5Pget_chunk_cache_f", INT(nbytes_2), INT(nbytes_4), total_error) - IF( .NOT.dreal_eq( REAL(w0_2,dp), REAL( w0_4, dp)) ) THEN - CALL VERIFYlogical("H5Pget_chunk_cache_f", .TRUE., .FALSE., total_error) - ENDIF + CALL verify("H5Pget_chunk_cache_f", INT(nslots_2), INT(nslots_4), total_error) + CALL verify("H5Pget_chunk_cache_f", INT(nbytes_2), INT(nbytes_4), total_error) + CALL verify("H5Pget_chunk_cache_f", w0_2, w0_4, total_error) ! Test H5D_CHUNK_CACHE_NSLOTS_DEFAULT and H5D_CHUNK_CACHE_W0_DEFAULT nslots_2 = H5D_CHUNK_CACHE_NSLOTS_DFLT_F @@ -663,11 +646,9 @@ SUBROUTINE test_chunk_cache(cleanup, total_error) CALL check("H5Dget_access_plist_f", error, total_error) CALL H5Pget_chunk_cache_f(dapl2, nslots_4, nbytes_4, w0_4, error) CALL check("H5Pget_chunk_cache_f", error, total_error) - CALL VERIFY("H5Pget_chunk_cache_f", INT(nslots_3), INT(nslots_4), total_error) - CALL VERIFY("H5Pget_chunk_cache_f", INT(nbytes_2), INT(nbytes_4), total_error) - IF( .NOT.dreal_eq( REAL(w0_3,dp), REAL( w0_4, dp)) ) THEN - CALL VERIFYlogical("H5Pget_chunk_cache_f", .TRUE., .FALSE., total_error) - ENDIF + CALL verify("H5Pget_chunk_cache_f", INT(nslots_3), INT(nslots_4), total_error) + CALL verify("H5Pget_chunk_cache_f", INT(nbytes_2), INT(nbytes_4), total_error) + CALL verify("H5Pget_chunk_cache_f", w0_3, w0_4, total_error) ! Close diff --git a/fortran/test/tH5P_F03.f90 b/fortran/test/tH5P_F03.f90 index 56f9679..ec9fef2 100644 --- a/fortran/test/tH5P_F03.f90 +++ b/fortran/test/tH5P_F03.f90 @@ -52,8 +52,6 @@ CONTAINS INTEGER FUNCTION test_genprop_cls_cb1_f(list_id, create_data ) bind(C) - USE HDF5 - USE ISO_C_BINDING IMPLICIT NONE INTEGER(HID_T), INTENT(IN), VALUE :: list_id @@ -71,6 +69,11 @@ END MODULE test_genprop_cls_cb1_mod MODULE TH5P_F03 + USE HDF5 + USE TH5_MISC + USE TH5_MISC_GEN + USE ISO_C_BINDING + CONTAINS !------------------------------------------------------------------------- @@ -92,9 +95,6 @@ CONTAINS SUBROUTINE test_create(total_error) - USE HDF5 - USE TH5_MISC - USE ISO_C_BINDING IMPLICIT NONE INTEGER, INTENT(INOUT) :: total_error @@ -187,18 +187,12 @@ SUBROUTINE test_create(total_error) CALL check("H5Pset_fill_value_f",error, total_error) CALL h5pget_fill_value_f(dcpl, H5T_NATIVE_DOUBLE, dpfill, error) CALL check("H5Pget_fill_value_f",error, total_error) - IF(.NOT.dreal_eq( REAL(dpfill,dp), 1.0_dp))THEN - PRINT*,"***ERROR: Returned wrong fill value (double)" - total_error = total_error + 1 - ENDIF + CALL VERIFY("***ERROR: Returned wrong fill value (double)", dpfill, 1.0_dp, total_error) CALL H5Pset_fill_value_f(dcpl, H5T_NATIVE_REAL, 2.0, error) CALL check("H5Pset_fill_value_f",error, total_error) CALL h5pget_fill_value_f(dcpl, H5T_NATIVE_REAL, rfill, error) CALL check("H5Pget_fill_value_f",error, total_error) - IF(.NOT.dreal_eq( REAL(rfill,dp), REAL(2.0,dp)))THEN - PRINT*,"***ERROR: Returned wrong fill value (real)" - total_error = total_error + 1 - ENDIF + CALL VERIFY("***ERROR: Returned wrong fill value (real)", rfill, 2.0, total_error) ! For the actual compound type CALL H5Pset_fill_value_f(dcpl, comp_type_id, f_ptr, error) @@ -234,10 +228,10 @@ SUBROUTINE test_create(total_error) CALL H5Pget_fill_value_f(dcpl, comp_type_id, f_ptr, error) CALL check("H5Pget_fill_value_f", error, total_error) + CALL verify("***ERROR: Returned wrong fill value", rd_c%a, fill_ctype%a, total_error) + CALL verify("***ERROR: Returned wrong fill value", rd_c%y, fill_ctype%y, total_error) - IF( .NOT.dreal_eq( REAL(rd_c%a,dp), REAL(fill_ctype%a, dp)) .OR. & - .NOT.dreal_eq( REAL(rd_c%y,dp), REAL(fill_ctype%y, dp)) .OR. & - rd_c%x .NE. fill_ctype%x .OR. & + IF( rd_c%x .NE. fill_ctype%x .OR. & rd_c%z .NE. fill_ctype%z )THEN PRINT*,"***ERROR: Returned wrong fill value" @@ -269,9 +263,6 @@ SUBROUTINE test_genprop_class_callback(total_error) ! ! - USE HDF5 - USE TH5_MISC - USE ISO_C_BINDING USE test_genprop_cls_cb1_mod IMPLICIT NONE @@ -330,7 +321,7 @@ SUBROUTINE test_genprop_class_callback(total_error) ! Check the number of properties in class CALL h5pget_nprops_f(cid1, nprops, error) CALL check("h5pget_nprops_f", error, total_error) - CALL VERIFY("h5pget_nprops_f", INT(nprops), 4, total_error) + CALL verify("h5pget_nprops_f", INT(nprops), 4, total_error) ! Initialize class callback structs @@ -350,12 +341,12 @@ SUBROUTINE test_genprop_class_callback(total_error) ! Check that the list's class is correct CALL H5Pequal_f(cid2, cid1, flag, error) CALL check("H5Pequal_f", error, total_error) - CALL verifylogical("H5Pequal_f", flag, .TRUE., total_error) + CALL verify("H5Pequal_f", flag, .TRUE., total_error) ! Check the class name CALL H5Pget_class_name_f(cid2, CLASS1_NAME_BUF, CLASS1_NAME_SIZE, error) CALL check("H5Pget_class_name_f", error, total_error) - CALL verifystring("H5Pget_class_name_f", CLASS1_NAME_BUF, CLASS1_NAME, error) + CALL verify("H5Pget_class_name_f", CLASS1_NAME_BUF, CLASS1_NAME, error) IF(error.NE.0)THEN WRITE(*,*) 'Class names do not match! name=',CLASS1_NAME_BUF, 'CLASS1_NAME=',CLASS1_NAME total_error = total_error + 1 @@ -365,42 +356,42 @@ SUBROUTINE test_genprop_class_callback(total_error) CALL check("h5pclose_class_f", error, total_error) ! Verify that the creation callback occurred - CALL VERIFY("h5pcreate_f", crt_cb_struct%count, 1, total_error) - CALL VERIFY_INTEGER_HID_T("h5pcreate_f", crt_cb_struct%id, lid1, total_error) + CALL verify("h5pcreate_f", crt_cb_struct%count, 1, total_error) + CALL verify("h5pcreate_f", crt_cb_struct%id, lid1, total_error) ! Check the number of properties in list CALL h5pget_nprops_f(lid1,nprops, error) CALL check("h5pget_nprops_f", error, total_error) - CALL VERIFY("h5pget_nprops_f", INT(nprops), 4, total_error) + CALL verify("h5pget_nprops_f", INT(nprops), 4, total_error) ! Create another property list from the class CALL h5pcreate_f(cid1, lid2, error) CALL check("h5pcreate_f", error, total_error) ! Verify that the creation callback occurred - CALL VERIFY("h5pcreate_f", crt_cb_struct%count, 2, total_error) - CALL VERIFY_INTEGER_HID_T("h5pcreate_f", crt_cb_struct%id, lid2, total_error) + CALL verify("h5pcreate_f", crt_cb_struct%count, 2, total_error) + CALL verify("h5pcreate_f", crt_cb_struct%id, lid2, total_error) ! Check the number of properties in list CALL h5pget_nprops_f(lid2,nprops, error) CALL check("h5pget_nprops_f", error, total_error) - CALL VERIFY("h5pget_nprops_f", INT(nprops), 4, total_error) + CALL verify("h5pget_nprops_f", INT(nprops), 4, total_error) ! Close first list CALL h5pclose_f(lid1, error); CALL check("h5pclose_f", error, total_error) ! Verify that the close callback occurred - CALL VERIFY("h5pcreate_f", cls_cb_struct%count, 1, total_error) - CALL VERIFY_INTEGER_HID_T("h5pcreate_f", cls_cb_struct%id, lid1, total_error) + CALL verify("h5pcreate_f", cls_cb_struct%count, 1, total_error) + CALL verify("h5pcreate_f", cls_cb_struct%id, lid1, total_error) ! Close second list CALL h5pclose_f(lid2, error); CALL check("h5pclose_f", error, total_error) ! Verify that the close callback occurred - CALL VERIFY("h5pcreate_f", cls_cb_struct%count, 2, total_error) - CALL verify_INTEGER_HID_T("h5pcreate_f", cls_cb_struct%id, lid2, total_error) + CALL verify("h5pcreate_f", cls_cb_struct%count, 2, total_error) + CALL verify("h5pcreate_f", cls_cb_struct%id, lid2, total_error) ! Close class CALL h5pclose_class_f(cid1, error) @@ -423,8 +414,6 @@ END SUBROUTINE test_genprop_class_callback SUBROUTINE test_h5p_file_image(total_error) - USE HDF5 - USE TH5_MISC USE, INTRINSIC :: iso_c_binding IMPLICIT NONE INTEGER, INTENT(INOUT) :: total_error @@ -475,11 +464,11 @@ SUBROUTINE test_h5p_file_image(total_error) CALL check("h5pget_file_image_f", error, total_error) ! Check that sizes are the same, and that the buffers are identical but separate - CALL VERIFY("h5pget_file_image_f", INT(temp_size), INT(size), total_error) + CALL verify("h5pget_file_image_f", INT(temp_size), INT(size), total_error) ! Verify the image data is correct DO i = 1, count - CALL VERIFY("h5pget_file_image_f", temp(i), buffer(i), total_error) + CALL verify("h5pget_file_image_f", temp(i), buffer(i), total_error) ENDDO END SUBROUTINE test_h5p_file_image @@ -499,10 +488,6 @@ END SUBROUTINE test_h5p_file_image ! SUBROUTINE external_test_offset(cleanup,total_error) - USE ISO_C_BINDING - USE TH5_MISC - USE HDF5 ! This module contains all necessary modules - IMPLICIT NONE INTEGER, INTENT(INOUT) :: total_error LOGICAL, INTENT(IN) :: cleanup diff --git a/fortran/test/tH5R.f90 b/fortran/test/tH5R.f90 index bd6264f..ef392b4 100644 --- a/fortran/test/tH5R.f90 +++ b/fortran/test/tH5R.f90 @@ -33,11 +33,13 @@ ! MODULE TH5R + USE HDF5 + USE TH5_MISC + USE TH5_MISC_GEN + CONTAINS SUBROUTINE refobjtest(cleanup, total_error) - USE HDF5 ! This module contains all necessary modules - USE TH5_MISC IMPLICIT NONE LOGICAL, INTENT(IN) :: cleanup INTEGER, INTENT(INOUT) :: total_error @@ -125,7 +127,6 @@ SUBROUTINE refobjtest(cleanup, total_error) CALL check("h5tcopy_f",error,total_error) CALL h5tcommit_f(file_id, "MyType", type_id, error) CALL check("h5tcommit_f",error,total_error) - ! ! Close dataspaces, groups and integer dataset ! @@ -164,22 +165,22 @@ SUBROUTINE refobjtest(cleanup, total_error) CALL check("H5Rget_name_f", error, total_error) - CALL VERIFY("H5Rget_name_f", INT(buf_size),7, total_error) - CALL VerifyString("H5Rget_name_f", buf, "/GROUP1", total_error) + CALL verify("H5Rget_name_f", INT(buf_size),7, total_error) + CALL verify("H5Rget_name_f", buf, "/GROUP1", total_error) ! with buffer bigger then needed CALL H5Rget_name_f(dsetr_id, ref(1), buf_big, error, buf_size ) CALL check("H5Rget_name_f", error, total_error) - CALL VERIFY("H5Rget_name_f", INT(buf_size),7,total_error) - CALL VerifyString("H5Rget_name_f", TRIM(buf_big), "/GROUP1", total_error) + CALL verify("H5Rget_name_f", INT(buf_size),7,total_error) + CALL verify("H5Rget_name_f", TRIM(buf_big), "/GROUP1", total_error) ! getting path to dataset in /Group1 CALL H5Rget_name_f(dsetr_id, ref(2), buf_big, error, buf_size ) CALL check("H5Rget_name_f", error, total_error) - CALL VERIFY("H5Rget_name_f", INT(buf_size),14,total_error) - CALL VerifyString("H5Rget_name_f", TRIM(buf_big), "/GROUP1/GROUP2", total_error) + CALL verify("H5Rget_name_f", INT(buf_size),14,total_error) + CALL verify("H5Rget_name_f", TRIM(buf_big), "/GROUP1/GROUP2", total_error) ! !Close the dataset @@ -233,7 +234,6 @@ SUBROUTINE refobjtest(cleanup, total_error) CALL h5fclose_f(file_id, error) CALL check("h5fclose_f",error,total_error) - IF(cleanup) CALL h5_cleanup_f(filename, H5P_DEFAULT_F, error) CALL check("h5_cleanup_f", error, total_error) RETURN @@ -244,9 +244,6 @@ END SUBROUTINE refobjtest ! and h5rdereference_f functionalities ! SUBROUTINE refregtest(cleanup, total_error) - USE HDF5 ! This module contains all necessary modules - USE TH5_MISC -! use iso_c_binding ! NOTE: if this is uncommented, then need to move subroutine into another file. IMPLICIT NONE LOGICAL, INTENT(IN) :: cleanup @@ -408,23 +405,23 @@ SUBROUTINE refregtest(cleanup, total_error) ! Get name of the dataset the first region reference points to using H5Rget_name_f CALL H5Rget_name_f(dsetr_id, ref_out(1), buf, error, buf_size ) CALL check("H5Rget_name_f", error, total_error) - CALL VERIFY("H5Rget_name_f", INT(buf_size),7,total_error) - CALL VerifyString("H5Rget_name_f", buf, "/MATRIX", total_error) + CALL verify("H5Rget_name_f", INT(buf_size),7,total_error) + CALL verify("H5Rget_name_f", buf, "/MATRIX", total_error) ! Get name of the dataset the first region reference points to using H5Rget_name_f ! buffer bigger then needed CALL H5Rget_name_f(dsetr_id, ref_out(1), buf_big, error, buf_size ) CALL check("H5Rget_name_f", error, total_error) - CALL VERIFY("H5Rget_name_f", INT(buf_size),7,total_error) - CALL VerifyString("H5Rget_name_f", TRIM(buf_big), "/MATRIX", total_error) + CALL verify("H5Rget_name_f", INT(buf_size),7,total_error) + CALL verify("H5Rget_name_f", TRIM(buf_big), "/MATRIX", total_error) ! Get name of the dataset the first region reference points to using H5Rget_name_f ! buffer smaller then needed CALL H5Rget_name_f(dsetr_id, ref_out(1), buf_small, error, buf_size ) CALL check("H5Rget_name_f", error, total_error) - CALL VERIFY("H5Rget_name_f", INT(buf_size),7,total_error) - CALL VerifyString("H5Rget_name_f", TRIM(buf_small), "/MAT", total_error) + CALL verify("H5Rget_name_f", INT(buf_size),7,total_error) + CALL verify("H5Rget_name_f", TRIM(buf_small), "/MAT", total_error) ! ! Dereference the first reference. ! @@ -436,7 +433,7 @@ SUBROUTINE refregtest(cleanup, total_error) ! Get name of the dataset the second region reference points to using H5Rget_name_f CALL H5Rget_name_f(dsetr_id, ref_out(2), buf, error) ! no optional size CALL check("H5Rget_name_f", error, total_error) - CALL VerifyString("H5Rget_name_f", TRIM(buf), "/MATRIX", total_error) + CALL verify("H5Rget_name_f", TRIM(buf), "/MATRIX", total_error) ! ! Read selected data from the dataset. ! diff --git a/fortran/test/tH5S.f90 b/fortran/test/tH5S.f90 index eaaf29a..7223772 100644 --- a/fortran/test/tH5S.f90 +++ b/fortran/test/tH5S.f90 @@ -35,12 +35,14 @@ !***** MODULE TH5S + USE HDF5 ! This module contains all necessary modules + USE TH5_MISC + USE TH5_MISC_GEN + CONTAINS SUBROUTINE dataspace_basic_test(cleanup, total_error) - USE HDF5 ! This module contains all necessary modules - USE TH5_MISC IMPLICIT NONE LOGICAL, INTENT(IN) :: cleanup diff --git a/fortran/test/tH5Sselect.f90 b/fortran/test/tH5Sselect.f90 index 7d07308..aeb80e9 100644 --- a/fortran/test/tH5Sselect.f90 +++ b/fortran/test/tH5Sselect.f90 @@ -38,13 +38,14 @@ !***** MODULE TH5SSELECT + USE HDF5 ! This module contains all necessary modules + USE TH5_MISC + USE TH5_MISC_GEN + CONTAINS SUBROUTINE test_select_hyperslab(cleanup, total_error) - USE HDF5 ! This module contains all necessary modules - USE TH5_MISC - IMPLICIT NONE LOGICAL, INTENT(IN) :: cleanup INTEGER, INTENT(INOUT) :: total_error @@ -699,8 +700,6 @@ CONTAINS SUBROUTINE test_basic_select(cleanup, total_error) - USE HDF5 ! This module contains all necessary modules - USE TH5_MISC IMPLICIT NONE LOGICAL, INTENT(IN) :: cleanup @@ -1036,8 +1035,6 @@ CONTAINS !*************************************************************** SUBROUTINE test_select_point(cleanup, total_error) - USE HDF5 ! This module contains all necessary modules - USE TH5_MISC IMPLICIT NONE LOGICAL, INTENT(IN) :: cleanup @@ -1140,9 +1137,9 @@ SUBROUTINE test_select_point(cleanup, total_error) CALL check("h5sget_select_elem_pointlist_f", error, total_error) DO i= 1, POINT1_NPOINTS - CALL VERIFY("h5sget_select_elem_pointlist_f", INT(temp_coord1(1,i)), INT(coord1(1,i)), total_error) - CALL VERIFY("h5sget_select_elem_pointlist_f", INT(temp_coord1(2,i)), INT(coord1(2,i)), total_error) - CALL VERIFY("h5sget_select_elem_pointlist_f", INT(temp_coord1(3,i)), INT(coord1(3,i)), total_error) + CALL verify("h5sget_select_elem_pointlist_f", INT(temp_coord1(1,i)), INT(coord1(1,i)), total_error) + CALL verify("h5sget_select_elem_pointlist_f", INT(temp_coord1(2,i)), INT(coord1(2,i)), total_error) + CALL verify("h5sget_select_elem_pointlist_f", INT(temp_coord1(3,i)), INT(coord1(3,i)), total_error) ENDDO CALL H5Sget_select_npoints_f(sid1, npoints, error) @@ -1171,9 +1168,9 @@ SUBROUTINE test_select_point(cleanup, total_error) CALL check("h5sget_select_elem_pointlist_f", error, total_error) DO i= 1, POINT1_NPOINTS - CALL VERIFY("h5sget_select_elem_pointlist_f", INT(temp_coord1(1,i)), INT(coord1(1,i)), total_error) - CALL VERIFY("h5sget_select_elem_pointlist_f", INT(temp_coord1(2,i)), INT(coord1(2,i)), total_error) - CALL VERIFY("h5sget_select_elem_pointlist_f", INT(temp_coord1(3,i)), INT(coord1(3,i)), total_error) + CALL verify("h5sget_select_elem_pointlist_f", INT(temp_coord1(1,i)), INT(coord1(1,i)), total_error) + CALL verify("h5sget_select_elem_pointlist_f", INT(temp_coord1(2,i)), INT(coord1(2,i)), total_error) + CALL verify("h5sget_select_elem_pointlist_f", INT(temp_coord1(3,i)), INT(coord1(3,i)), total_error) ENDDO CALL H5Sget_select_npoints_f(sid1, npoints, error) @@ -1202,8 +1199,8 @@ SUBROUTINE test_select_point(cleanup, total_error) CALL check("h5sget_select_elem_pointlist_f", error, total_error) DO i= 1, POINT1_NPOINTS - CALL VERIFY("h5sget_select_elem_pointlist_f", INT(temp_coord2(1,i)), INT(coord2(1,i)), total_error) - CALL VERIFY("h5sget_select_elem_pointlist_f", INT(temp_coord2(2,i)), INT(coord2(2,i)), total_error) + CALL verify("h5sget_select_elem_pointlist_f", INT(temp_coord2(1,i)), INT(coord2(1,i)), total_error) + CALL verify("h5sget_select_elem_pointlist_f", INT(temp_coord2(2,i)), INT(coord2(2,i)), total_error) ENDDO !!$ @@ -1238,8 +1235,8 @@ SUBROUTINE test_select_point(cleanup, total_error) CALL check("h5sget_select_elem_pointlist_f", error, total_error) DO i= 1, POINT1_NPOINTS - CALL VERIFY("h5sget_select_elem_pointlist_f", INT(temp_coord2(1,i)), INT(coord2(1,i)), total_error) - CALL VERIFY("h5sget_select_elem_pointlist_f", INT(temp_coord2(2,i)), INT(coord2(2,i)), total_error) + CALL verify("h5sget_select_elem_pointlist_f", INT(temp_coord2(1,i)), INT(coord2(1,i)), total_error) + CALL verify("h5sget_select_elem_pointlist_f", INT(temp_coord2(2,i)), INT(coord2(2,i)), total_error) ENDDO CALL H5Sget_select_npoints_f(sid2, npoints, error) @@ -1284,8 +1281,8 @@ SUBROUTINE test_select_point(cleanup, total_error) CALL h5sget_select_elem_pointlist_f(sid2, INT(0,hsize_t), INT(POINT1_NPOINTS,hsize_t),temp_coord3,error) CALL check("h5sget_select_elem_pointlist_f", error, total_error) DO i= 1, POINT1_NPOINTS - CALL VERIFY("h5sget_select_elem_pointlist_f", INT(temp_coord3(1,i)), INT(coord3(1,i)), total_error) - CALL VERIFY("h5sget_select_elem_pointlist_f", INT(temp_coord3(2,i)), INT(coord3(2,i)), total_error) + CALL verify("h5sget_select_elem_pointlist_f", INT(temp_coord3(1,i)), INT(coord3(1,i)), total_error) + CALL verify("h5sget_select_elem_pointlist_f", INT(temp_coord3(2,i)), INT(coord3(2,i)), total_error) ENDDO CALL H5Sget_select_npoints_f(sid2, npoints, error) @@ -1311,8 +1308,8 @@ SUBROUTINE test_select_point(cleanup, total_error) CALL h5sget_select_elem_pointlist_f(sid2, INT(POINT1_NPOINTS,hsize_t), INT(POINT1_NPOINTS,hsize_t),temp_coord3,error) CALL check("h5sget_select_elem_pointlist_f", error, total_error) DO i= 1, POINT1_NPOINTS - CALL VERIFY("h5sget_select_elem_pointlist_f", INT(temp_coord3(1,i)), INT(coord3(1,i)), total_error) - CALL VERIFY("h5sget_select_elem_pointlist_f", INT(temp_coord3(2,i)), INT(coord3(2,i)), total_error) + CALL verify("h5sget_select_elem_pointlist_f", INT(temp_coord3(1,i)), INT(coord3(1,i)), total_error) + CALL verify("h5sget_select_elem_pointlist_f", INT(temp_coord3(2,i)), INT(coord3(2,i)), total_error) ENDDO CALL H5Sget_select_npoints_f(sid2, npoints, error) @@ -1363,8 +1360,6 @@ END SUBROUTINE test_select_point !*************************************************************** SUBROUTINE test_select_combine(total_error) - USE HDF5 ! This module contains all necessary modules - USE TH5_MISC IMPLICIT NONE INTEGER, INTENT(INOUT) :: total_error @@ -1400,7 +1395,7 @@ SUBROUTINE test_select_combine(total_error) CALL H5Sget_select_type_f(all_id, sel_type, error) CALL check("H5Sget_select_type_f", error, total_error) - CALL VERIFY("H5Sget_select_type_f", INT(sel_type), INT(H5S_SEL_ALL_F), total_error) + CALL verify("H5Sget_select_type_f", INT(sel_type), INT(H5S_SEL_ALL_F), total_error) ! Copy base dataspace and set selection to "none" CALL h5scopy_f(base_id, none_id, error) @@ -1411,7 +1406,7 @@ SUBROUTINE test_select_combine(total_error) CALL H5Sget_select_type_f(none_id, sel_type, error) CALL check("H5Sget_select_type_f", error, total_error) - CALL VERIFY("H5Sget_select_type_f", INT(sel_type), INT(H5S_SEL_NONE_F), total_error) + CALL verify("H5Sget_select_type_f", INT(sel_type), INT(H5S_SEL_NONE_F), total_error) ! Copy "all" selection & space CALL H5Scopy_f(all_id, space1, error) @@ -1429,7 +1424,7 @@ SUBROUTINE test_select_combine(total_error) ! Verify that it's still "all" selection CALL H5Sget_select_type_f(space1, sel_type, error) CALL check("H5Sget_select_type_f", error, total_error) - CALL VERIFY("H5Sget_select_type_f", INT(sel_type), INT(H5S_SEL_ALL_F), total_error) + CALL verify("H5Sget_select_type_f", INT(sel_type), INT(H5S_SEL_ALL_F), total_error) ! Close temporary dataspace CALL h5sclose_f(space1, error) @@ -1451,12 +1446,12 @@ SUBROUTINE test_select_combine(total_error) ! Verify that the new selection is the same at the original block CALL H5Sget_select_type_f(space1, sel_type, error) CALL check("H5Sget_select_type_f", error, total_error) - CALL VERIFY("H5Sget_select_type_f", INT(sel_type), INT( H5S_SEL_HYPERSLABS_F), total_error) + CALL verify("H5Sget_select_type_f", INT(sel_type), INT( H5S_SEL_HYPERSLABS_F), total_error) ! Verify that there is only one block CALL h5sget_select_hyper_nblocks_f(space1, nblocks, error) CALL check("h5sget_select_hyper_nblocks_f", error, total_error) - CALL VERIFY("h5sget_select_hyper_nblocks_f", INT(nblocks), 1, total_error) + CALL verify("h5sget_select_hyper_nblocks_f", INT(nblocks), 1, total_error) ! Retrieve the block defined CALL h5sget_select_hyper_blocklist_f(space1, INT(0, hsize_t), INT(nblocks,hsize_t), blocks, error) @@ -1464,10 +1459,10 @@ SUBROUTINE test_select_combine(total_error) ! Verify that the correct block is defined - CALL VERIFY("h5sget_select_hyper_blocklist_f", INT(blocks(1,1,1)), 1, total_error) - CALL VERIFY("h5sget_select_hyper_blocklist_f", INT(blocks(2,1,1)), 1, total_error) - CALL VERIFY("h5sget_select_hyper_blocklist_f", INT(blocks(3,1,1)), 5, total_error) - CALL VERIFY("h5sget_select_hyper_blocklist_f", INT(blocks(4,1,1)), 4, total_error) + CALL verify("h5sget_select_hyper_blocklist_f", INT(blocks(1,1,1)), 1, total_error) + CALL verify("h5sget_select_hyper_blocklist_f", INT(blocks(2,1,1)), 1, total_error) + CALL verify("h5sget_select_hyper_blocklist_f", INT(blocks(3,1,1)), 5, total_error) + CALL verify("h5sget_select_hyper_blocklist_f", INT(blocks(4,1,1)), 4, total_error) ! Close temporary dataspace CALL h5sclose_f(space1, error) @@ -1490,12 +1485,12 @@ SUBROUTINE test_select_combine(total_error) ! Verify that the new selection is an inversion of the original block CALL H5Sget_select_type_f(space1, sel_type, error) CALL check("H5Sget_select_type_f", error, total_error) - CALL VERIFY("H5Sget_select_type_f", INT(sel_type), INT( H5S_SEL_HYPERSLABS_F), total_error) + CALL verify("H5Sget_select_type_f", INT(sel_type), INT( H5S_SEL_HYPERSLABS_F), total_error) ! Verify that there are two blocks CALL h5sget_select_hyper_nblocks_f(space1, nblocks, error) CALL check("h5sget_select_hyper_nblocks_f", error, total_error) - CALL VERIFY("h5sget_select_hyper_nblocks_f", INT(nblocks), 2, total_error) + CALL verify("h5sget_select_hyper_nblocks_f", INT(nblocks), 2, total_error) ! Retrieve the block defined @@ -1507,19 +1502,19 @@ SUBROUTINE test_select_combine(total_error) ! No guarantee is implied as the order in which blocks are listed. ! So this will ONLY work for square domains iblock(1:2) = (/5,5/) -!!$ CALL VERIFY("h5sget_select_hyper_blocklist_f", INT(blocks(1,1,1)), 1, total_error) -!!$ CALL VERIFY("h5sget_select_hyper_blocklist_f", INT(blocks(2,1,1)), 5, total_error) -!!$ CALL VERIFY("h5sget_select_hyper_blocklist_f", INT(blocks(3,1,1)), 5, total_error) -!!$ CALL VERIFY("h5sget_select_hyper_blocklist_f", INT(blocks(4,1,1)), 10, total_error) -!!$ CALL VERIFY("h5sget_select_hyper_blocklist_f", INT(blocks(5,1,1)), 6, total_error) -!!$ CALL VERIFY("h5sget_select_hyper_blocklist_f", INT(blocks(6,1,1)), 1, total_error) -!!$ CALL VERIFY("h5sget_select_hyper_blocklist_f", INT(blocks(7,1,1)), 10, total_error) -!!$ CALL VERIFY("h5sget_select_hyper_blocklist_f", INT(blocks(8,1,1)), 10, total_error) +!!$ CALL verify("h5sget_select_hyper_blocklist_f", INT(blocks(1,1,1)), 1, total_error) +!!$ CALL verify("h5sget_select_hyper_blocklist_f", INT(blocks(2,1,1)), 5, total_error) +!!$ CALL verify("h5sget_select_hyper_blocklist_f", INT(blocks(3,1,1)), 5, total_error) +!!$ CALL verify("h5sget_select_hyper_blocklist_f", INT(blocks(4,1,1)), 10, total_error) +!!$ CALL verify("h5sget_select_hyper_blocklist_f", INT(blocks(5,1,1)), 6, total_error) +!!$ CALL verify("h5sget_select_hyper_blocklist_f", INT(blocks(6,1,1)), 1, total_error) +!!$ CALL verify("h5sget_select_hyper_blocklist_f", INT(blocks(7,1,1)), 10, total_error) +!!$ CALL verify("h5sget_select_hyper_blocklist_f", INT(blocks(8,1,1)), 10, total_error) ! Otherwise make sure the "area" of the block is correct area = (ABS(INT(blocks(1,1,1)-blocks(3,1,1)))+1)*(ABS(INT(blocks(2,1,1)-blocks(4,1,1)))+1) area = area + (ABS(INT(blocks(5,1,1)-blocks(7,1,1)))+1)*(ABS(INT(blocks(6,1,1)-blocks(8,1,1)))+1) - CALL VERIFY("h5sget_select_hyper_blocklist_f", area, 80, total_error) + CALL verify("h5sget_select_hyper_blocklist_f", area, 80, total_error) ! Close temporary dataspace CALL h5sclose_f(space1, error) @@ -1542,12 +1537,12 @@ SUBROUTINE test_select_combine(total_error) ! Verify that the new selection is an inversion of the original block CALL H5Sget_select_type_f(space1, sel_type, error) CALL check("H5Sget_select_type_f", error, total_error) - CALL VERIFY("H5Sget_select_type_f", INT(sel_type), INT( H5S_SEL_HYPERSLABS_F), total_error) + CALL verify("H5Sget_select_type_f", INT(sel_type), INT( H5S_SEL_HYPERSLABS_F), total_error) ! Verify that there are two blocks CALL h5sget_select_hyper_nblocks_f(space1, nblocks, error) CALL check("h5sget_select_hyper_nblocks_f", error, total_error) - CALL VERIFY("h5sget_select_hyper_nblocks_f", INT(nblocks), 2, total_error) + CALL verify("h5sget_select_hyper_nblocks_f", INT(nblocks), 2, total_error) ! Retrieve the block defined blocks = -1 ! Reset block list @@ -1559,19 +1554,19 @@ SUBROUTINE test_select_combine(total_error) ! No guarantee is implied as the order in which blocks are listed. ! So this will ONLY work for square domains iblock(1:2) = (/5,5/) -!!$ CALL VERIFY("h5sget_select_hyper_blocklist_f", INT(blocks(1,1,1)), 1, total_error) -!!$ CALL VERIFY("h5sget_select_hyper_blocklist_f", INT(blocks(2,1,1)), 5, total_error) -!!$ CALL VERIFY("h5sget_select_hyper_blocklist_f", INT(blocks(3,1,1)), 5, total_error) -!!$ CALL VERIFY("h5sget_select_hyper_blocklist_f", INT(blocks(4,1,1)),10, total_error) -!!$ CALL VERIFY("h5sget_select_hyper_blocklist_f", INT(blocks(5,1,1)), 6, total_error) -!!$ CALL VERIFY("h5sget_select_hyper_blocklist_f", INT(blocks(6,1,1)), 1, total_error) -!!$ CALL VERIFY("h5sget_select_hyper_blocklist_f", INT(blocks(7,1,1)),10, total_error) -!!$ CALL VERIFY("h5sget_select_hyper_blocklist_f", INT(blocks(8,1,1)),10, total_error) +!!$ CALL verify("h5sget_select_hyper_blocklist_f", INT(blocks(1,1,1)), 1, total_error) +!!$ CALL verify("h5sget_select_hyper_blocklist_f", INT(blocks(2,1,1)), 5, total_error) +!!$ CALL verify("h5sget_select_hyper_blocklist_f", INT(blocks(3,1,1)), 5, total_error) +!!$ CALL verify("h5sget_select_hyper_blocklist_f", INT(blocks(4,1,1)),10, total_error) +!!$ CALL verify("h5sget_select_hyper_blocklist_f", INT(blocks(5,1,1)), 6, total_error) +!!$ CALL verify("h5sget_select_hyper_blocklist_f", INT(blocks(6,1,1)), 1, total_error) +!!$ CALL verify("h5sget_select_hyper_blocklist_f", INT(blocks(7,1,1)),10, total_error) +!!$ CALL verify("h5sget_select_hyper_blocklist_f", INT(blocks(8,1,1)),10, total_error) ! Otherwise make sure the "area" of the block is correct area = (ABS(INT(blocks(1,1,1)-blocks(3,1,1)))+1)*(ABS(INT(blocks(2,1,1)-blocks(4,1,1)))+1) area = area + (ABS(INT(blocks(5,1,1)-blocks(7,1,1)))+1)*(ABS(INT(blocks(6,1,1)-blocks(8,1,1)))+1) - CALL VERIFY("h5sget_select_hyper_blocklist_f", area, 80, total_error) + CALL verify("h5sget_select_hyper_blocklist_f", area, 80, total_error) ! Close temporary dataspace @@ -1594,7 +1589,7 @@ SUBROUTINE test_select_combine(total_error) ! Verify that the new selection is the "none" selection CALL H5Sget_select_type_f(space1, sel_type, error) CALL check("H5Sget_select_type_f", error, total_error) - CALL VERIFY("H5Sget_select_type_f", INT(sel_type), INT( H5S_SEL_NONE_F), total_error) + CALL verify("H5Sget_select_type_f", INT(sel_type), INT( H5S_SEL_NONE_F), total_error) ! Close temporary dataspace CALL h5sclose_f(space1, error) @@ -1617,13 +1612,13 @@ SUBROUTINE test_select_combine(total_error) ! Verify that the new selection is the same as the original hyperslab CALL H5Sget_select_type_f(space1, sel_type, error) CALL check("H5Sget_select_type_f", error, total_error) - CALL VERIFY("H5Sget_select_type_f", INT(sel_type), INT( H5S_SEL_HYPERSLABS_F), total_error) + CALL verify("H5Sget_select_type_f", INT(sel_type), INT( H5S_SEL_HYPERSLABS_F), total_error) ! Verify that there is only one block CALL h5sget_select_hyper_nblocks_f(space1, nblocks, error) CALL check("h5sget_select_hyper_nblocks_f", error, total_error) - CALL VERIFY("h5sget_select_hyper_nblocks_f", INT(nblocks), 1, total_error) + CALL verify("h5sget_select_hyper_nblocks_f", INT(nblocks), 1, total_error) ! Retrieve the block defined blocks = -1 ! Reset block list @@ -1631,10 +1626,10 @@ SUBROUTINE test_select_combine(total_error) CALL check("h5sget_select_hyper_blocklist_f", error, total_error) ! Verify that the correct block is defined - CALL VERIFY("h5sget_select_hyper_blocklist_f", INT(blocks(1,1,1)), 1, total_error) - CALL VERIFY("h5sget_select_hyper_blocklist_f", INT(blocks(2,1,1)), 1, total_error) - CALL VERIFY("h5sget_select_hyper_blocklist_f", INT(blocks(3,1,1)), 5, total_error) - CALL VERIFY("h5sget_select_hyper_blocklist_f", INT(blocks(4,1,1)), 4, total_error) + CALL verify("h5sget_select_hyper_blocklist_f", INT(blocks(1,1,1)), 1, total_error) + CALL verify("h5sget_select_hyper_blocklist_f", INT(blocks(2,1,1)), 1, total_error) + CALL verify("h5sget_select_hyper_blocklist_f", INT(blocks(3,1,1)), 5, total_error) + CALL verify("h5sget_select_hyper_blocklist_f", INT(blocks(4,1,1)), 4, total_error) ! Close temporary dataspace CALL h5sclose_f(space1, error) @@ -1657,7 +1652,7 @@ SUBROUTINE test_select_combine(total_error) ! Verify that the new selection is the "none" selection CALL H5Sget_select_type_f(space1, sel_type, error) CALL check("H5Sget_select_type_f", error, total_error) - CALL VERIFY("H5Sget_select_type_f", INT(sel_type), INT( H5S_SEL_NONE_F), total_error) + CALL verify("H5Sget_select_type_f", INT(sel_type), INT( H5S_SEL_NONE_F), total_error) ! Close temporary dataspace CALL h5sclose_f(space1, error) @@ -1680,23 +1675,23 @@ SUBROUTINE test_select_combine(total_error) ! Verify that the new selection is the same as the original hyperslab CALL H5Sget_select_type_f(space1, sel_type, error) CALL check("H5Sget_select_type_f", error, total_error) - CALL VERIFY("H5Sget_select_type_f", INT(sel_type), INT( H5S_SEL_HYPERSLABS_F), total_error) + CALL verify("H5Sget_select_type_f", INT(sel_type), INT( H5S_SEL_HYPERSLABS_F), total_error) ! Verify that there is only one block CALL h5sget_select_hyper_nblocks_f(space1, nblocks, error) CALL check("h5sget_select_hyper_nblocks_f", error, total_error) - CALL VERIFY("h5sget_select_hyper_nblocks_f", INT(nblocks), 1, total_error) + CALL verify("h5sget_select_hyper_nblocks_f", INT(nblocks), 1, total_error) ! Retrieve the block defined blocks = -1 ! Reset block list CALL h5sget_select_hyper_blocklist_f(space1, INT(0, hsize_t), INT(nblocks,hsize_t), blocks, error) CALL check("h5sget_select_hyper_blocklist_f", error, total_error) ! Verify that the correct block is defined - CALL VERIFY("h5sget_select_hyper_blocklist_f", INT(blocks(1,1,1)), 1, total_error) - CALL VERIFY("h5sget_select_hyper_blocklist_f", INT(blocks(2,1,1)), 1, total_error) - CALL VERIFY("h5sget_select_hyper_blocklist_f", INT(blocks(3,1,1)), 5, total_error) - CALL VERIFY("h5sget_select_hyper_blocklist_f", INT(blocks(4,1,1)), 4, total_error) + CALL verify("h5sget_select_hyper_blocklist_f", INT(blocks(1,1,1)), 1, total_error) + CALL verify("h5sget_select_hyper_blocklist_f", INT(blocks(2,1,1)), 1, total_error) + CALL verify("h5sget_select_hyper_blocklist_f", INT(blocks(3,1,1)), 5, total_error) + CALL verify("h5sget_select_hyper_blocklist_f", INT(blocks(4,1,1)), 4, total_error) ! Close temporary dataspace CALL h5sclose_f(space1, error) @@ -1719,7 +1714,7 @@ SUBROUTINE test_select_combine(total_error) ! Verify that the new selection is the "none" selection CALL H5Sget_select_type_f(space1, sel_type, error) CALL check("H5Sget_select_type_f", error, total_error) - CALL VERIFY("H5Sget_select_type_f", INT(sel_type), INT( H5S_SEL_NONE_F), total_error) + CALL verify("H5Sget_select_type_f", INT(sel_type), INT( H5S_SEL_NONE_F), total_error) ! Close temporary dataspace CALL h5sclose_f(space1, error) @@ -1741,12 +1736,12 @@ SUBROUTINE test_select_combine(total_error) ! Verify that the new selection is the same as the original hyperslab CALL H5Sget_select_type_f(space1, sel_type, error) CALL check("H5Sget_select_type_f", error, total_error) - CALL VERIFY("H5Sget_select_type_f", INT(sel_type), INT( H5S_SEL_HYPERSLABS_F), total_error) + CALL verify("H5Sget_select_type_f", INT(sel_type), INT( H5S_SEL_HYPERSLABS_F), total_error) ! Verify that there is ONLY one BLOCK CALL h5sget_select_hyper_nblocks_f(space1, nblocks, error) CALL check("h5sget_select_hyper_nblocks_f", error, total_error) - CALL VERIFY("h5sget_select_hyper_nblocks_f", INT(nblocks), 1, total_error) + CALL verify("h5sget_select_hyper_nblocks_f", INT(nblocks), 1, total_error) ! Retrieve the block defined @@ -1757,10 +1752,10 @@ SUBROUTINE test_select_combine(total_error) ! Verify that the correct block is defined - CALL VERIFY("h5sget_select_hyper_blocklist_f", INT(blocks(1,1,1)), 1, total_error) - CALL VERIFY("h5sget_select_hyper_blocklist_f", INT(blocks(2,1,1)), 1, total_error) - CALL VERIFY("h5sget_select_hyper_blocklist_f", INT(blocks(3,1,1)), 5, total_error) - CALL VERIFY("h5sget_select_hyper_blocklist_f", INT(blocks(4,1,1)), 4, total_error) + CALL verify("h5sget_select_hyper_blocklist_f", INT(blocks(1,1,1)), 1, total_error) + CALL verify("h5sget_select_hyper_blocklist_f", INT(blocks(2,1,1)), 1, total_error) + CALL verify("h5sget_select_hyper_blocklist_f", INT(blocks(3,1,1)), 5, total_error) + CALL verify("h5sget_select_hyper_blocklist_f", INT(blocks(4,1,1)), 4, total_error) ! Close temporary dataspace CALL h5sclose_f(space1, error) @@ -1785,8 +1780,6 @@ END SUBROUTINE test_select_combine !*************************************************************** SUBROUTINE test_select_bounds(total_error) - USE HDF5 ! This module contains all necessary modules - USE TH5_MISC IMPLICIT NONE INTEGER, INTENT(INOUT) :: total_error @@ -1817,10 +1810,10 @@ SUBROUTINE test_select_bounds(total_error) CALL h5sget_select_bounds_f(sid, low_bounds, high_bounds, error) CALL check("h5sget_select_bounds_f", error, total_error) - CALL VERIFY("h5sget_select_bounds_f", INT(low_bounds(1)), 1, total_error) - CALL VERIFY("h5sget_select_bounds_f", INT(low_bounds(2)), 1, total_error) - CALL VERIFY("h5sget_select_bounds_f", INT(high_bounds(1)), SPACE11_DIM1, total_error) - CALL VERIFY("h5sget_select_bounds_f", INT(high_bounds(2)), SPACE11_DIM2, total_error) + CALL verify("h5sget_select_bounds_f", low_bounds(1), 1_hsize_t, total_error) + CALL verify("h5sget_select_bounds_f", low_bounds(2), 1_hsize_t, total_error) + CALL verify("h5sget_select_bounds_f", high_bounds(1), INT(SPACE11_DIM1, hsize_t), total_error) + CALL verify("h5sget_select_bounds_f", high_bounds(2), INT(SPACE11_DIM2, hsize_t), total_error) ! Set offset for selection offset(1:2) = 1 @@ -1831,10 +1824,10 @@ SUBROUTINE test_select_bounds(total_error) CALL h5sget_select_bounds_f(sid, low_bounds, high_bounds, error) CALL check("h5sget_select_bounds_f", error, total_error) - CALL verify("h5sget_select_bounds_f", INT(low_bounds(1)), 1, total_error) - CALL verify("h5sget_select_bounds_f", INT(low_bounds(2)), 1, total_error) - CALL verify("h5sget_select_bounds_f", INT(high_bounds(1)), SPACE11_DIM1, total_error) - CALL verify("h5sget_select_bounds_f", INT(high_bounds(2)), SPACE11_DIM2, total_error) + CALL verify("h5sget_select_bounds_f", low_bounds(1), 1_hsize_t, total_error) + CALL verify("h5sget_select_bounds_f", low_bounds(2), 1_hsize_t, total_error) + CALL VERIFY("h5sget_select_bounds_f", high_bounds(1), INT(SPACE11_DIM1, hsize_t), total_error) + CALL verify("h5sget_select_bounds_f", high_bounds(2), INT(SPACE11_DIM2, hsize_t), total_error) ! Reset offset for selection offset(1:2) = 0 @@ -1847,7 +1840,7 @@ SUBROUTINE test_select_bounds(total_error) ! Get bounds for 'none' selection, should fail CALL h5sget_select_bounds_f(sid, low_bounds, high_bounds, error) - CALL VERIFY("h5sget_select_bounds_f", error, -1, total_error) + CALL verify("h5sget_select_bounds_f", error, -1, total_error) ! Set point selection @@ -1863,10 +1856,10 @@ SUBROUTINE test_select_bounds(total_error) CALL h5sget_select_bounds_f(sid, low_bounds, high_bounds, error) CALL check("h5sget_select_bounds_f", error, total_error) - CALL VERIFY("h5sget_select_bounds_f", INT(low_bounds(1)), 3, total_error) - CALL VERIFY("h5sget_select_bounds_f", INT(low_bounds(2)), 3, total_error) - CALL VERIFY("h5sget_select_bounds_f", INT(high_bounds(1)), INT(SPACE11_DIM1-4), total_error) - CALL VERIFY("h5sget_select_bounds_f", INT(high_bounds(2)), INT(SPACE11_DIM2-4), total_error) + CALL verify("h5sget_select_bounds_f", low_bounds(1), 3_hsize_t, total_error) + CALL verify("h5sget_select_bounds_f", low_bounds(2), 3_hsize_t, total_error) + CALL VERIFY("h5sget_select_bounds_f", high_bounds(1), INT(SPACE11_DIM1-4,hsize_t), total_error) + CALL verify("h5sget_select_bounds_f", high_bounds(2), INT(SPACE11_DIM2-4,hsize_t), total_error) ! Set bad offset for selection @@ -1876,7 +1869,7 @@ SUBROUTINE test_select_bounds(total_error) ! Get bounds for hyperslab selection with negative offset CALL h5sget_select_bounds_f(sid, low_bounds, high_bounds, error) - CALL VERIFY("h5sget_select_bounds_f", error, -1, total_error) + CALL verify("h5sget_select_bounds_f", error, -1, total_error) ! Set valid offset for selection offset(1:2) = (/2,-2/) @@ -1887,10 +1880,10 @@ SUBROUTINE test_select_bounds(total_error) CALL h5sget_select_bounds_f(sid, low_bounds, high_bounds, error) CALL check("h5sget_select_bounds_f", error, total_error) - CALL VERIFY("h5sget_select_bounds_f", INT(low_bounds(1)), 5, total_error) - CALL VERIFY("h5sget_select_bounds_f", INT(low_bounds(2)), 1, total_error) - CALL VERIFY("h5sget_select_bounds_f", INT(high_bounds(1)), INT(SPACE11_DIM1-2), total_error) - CALL VERIFY("h5sget_select_bounds_f", INT(high_bounds(2)), INT(SPACE11_DIM2-6), total_error) + CALL verify("h5sget_select_bounds_f", low_bounds(1), 5_hsize_t, total_error) + CALL verify("h5sget_select_bounds_f", low_bounds(2), 1_hsize_t, total_error) + CALL verify("h5sget_select_bounds_f", high_bounds(1), INT(SPACE11_DIM1-2,hsize_t), total_error) + CALL verify("h5sget_select_bounds_f", high_bounds(2), INT(SPACE11_DIM2-6,hsize_t), total_error) ! Reset offset for selection offset(1:2) = 0 @@ -1911,10 +1904,10 @@ SUBROUTINE test_select_bounds(total_error) CALL h5sget_select_bounds_f(sid, low_bounds, high_bounds, error) CALL check("h5sget_select_bounds_f", error, total_error) - CALL VERIFY("h5sget_select_bounds_f", INT(low_bounds(1)), 3, total_error) - CALL VERIFY("h5sget_select_bounds_f", INT(low_bounds(2)), 3, total_error) - CALL VERIFY("h5sget_select_bounds_f", INT(high_bounds(1)), 37, total_error) - CALL VERIFY("h5sget_select_bounds_f", INT(high_bounds(2)), 37, total_error) + CALL verify("h5sget_select_bounds_f", low_bounds(1), 3_hsize_t, total_error) + CALL verify("h5sget_select_bounds_f", low_bounds(2), 3_hsize_t, total_error) + CALL verify("h5sget_select_bounds_f", high_bounds(1), 37_hsize_t, total_error) + CALL verify("h5sget_select_bounds_f", high_bounds(2), 37_hsize_t, total_error) ! Set bad offset for selection offset(1:2) = (/5,-5/) @@ -1923,7 +1916,7 @@ SUBROUTINE test_select_bounds(total_error) ! Get bounds for hyperslab selection with negative offset CALL h5sget_select_bounds_f(sid, low_bounds, high_bounds, error) - CALL VERIFY("h5sget_select_bounds_f", error, -1, total_error) + CALL verify("h5sget_select_bounds_f", error, -1, total_error) ! Set valid offset for selection offset(1:2) = (/5,-2/) @@ -1934,10 +1927,10 @@ SUBROUTINE test_select_bounds(total_error) CALL h5sget_select_bounds_f(sid, low_bounds, high_bounds, error) CALL check("h5sget_select_bounds_f", error, total_error) - CALL VERIFY("h5sget_select_bounds_f", INT(low_bounds(1)), 8, total_error) - CALL VERIFY("h5sget_select_bounds_f", INT(low_bounds(2)), 1, total_error) - CALL VERIFY("h5sget_select_bounds_f", INT(high_bounds(1)), 42, total_error) - CALL VERIFY("h5sget_select_bounds_f", INT(high_bounds(2)), 35, total_error) + CALL verify("h5sget_select_bounds_f", low_bounds(1), 8_hsize_t, total_error) + CALL verify("h5sget_select_bounds_f", low_bounds(2), 1_hsize_t, total_error) + CALL verify("h5sget_select_bounds_f", high_bounds(1), 42_hsize_t, total_error) + CALL verify("h5sget_select_bounds_f", high_bounds(2), 35_hsize_t, total_error) ! Reset offset for selection offset(1:2) = 0 @@ -1958,10 +1951,10 @@ SUBROUTINE test_select_bounds(total_error) CALL h5sget_select_bounds_f(sid, low_bounds, high_bounds, error) CALL check("h5sget_select_bounds_f", error, total_error) - CALL VERIFY("h5sget_select_bounds_f", INT(low_bounds(1)), 3, total_error) - CALL VERIFY("h5sget_select_bounds_f", INT(low_bounds(2)), 3, total_error) - CALL VERIFY("h5sget_select_bounds_f", INT(high_bounds(1)), 50, total_error) - CALL VERIFY("h5sget_select_bounds_f", INT(high_bounds(2)), 50, total_error) + CALL verify("h5sget_select_bounds_f", low_bounds(1), 3_hsize_t, total_error) + CALL verify("h5sget_select_bounds_f", low_bounds(2), 3_hsize_t, total_error) + CALL verify("h5sget_select_bounds_f", high_bounds(1), 50_hsize_t, total_error) + CALL verify("h5sget_select_bounds_f", high_bounds(2), 50_hsize_t, total_error) ! Set bad offset for selection offset(1:2) = (/5,-5/) @@ -1970,7 +1963,7 @@ SUBROUTINE test_select_bounds(total_error) ! Get bounds for hyperslab selection with negative offset CALL h5sget_select_bounds_f(sid, low_bounds, high_bounds, error) - CALL VERIFY("h5sget_select_bounds_f", error, -1, total_error) + CALL verify("h5sget_select_bounds_f", error, -1, total_error) ! Set valid offset for selection offset(1:2) = (/5,-2/) @@ -1981,10 +1974,10 @@ SUBROUTINE test_select_bounds(total_error) CALL h5sget_select_bounds_f(sid, low_bounds, high_bounds, error) CALL check("h5sget_select_bounds_f", error, total_error) - CALL VERIFY("h5sget_select_bounds_f", INT(low_bounds(1)), 8, total_error) - CALL VERIFY("h5sget_select_bounds_f", INT(low_bounds(2)), 1, total_error) - CALL VERIFY("h5sget_select_bounds_f", INT(high_bounds(1)), 55, total_error) - CALL VERIFY("h5sget_select_bounds_f", INT(high_bounds(2)), 48, total_error) + CALL verify("h5sget_select_bounds_f", low_bounds(1), 8_hsize_t, total_error) + CALL verify("h5sget_select_bounds_f", low_bounds(2), 1_hsize_t, total_error) + CALL verify("h5sget_select_bounds_f", high_bounds(1), 55_hsize_t, total_error) + CALL verify("h5sget_select_bounds_f", high_bounds(2), 48_hsize_t, total_error) ! Reset offset for selection offset(1:2) = 0 diff --git a/fortran/test/tH5T.f90 b/fortran/test/tH5T.f90 index 7822c16..efbceea 100644 --- a/fortran/test/tH5T.f90 +++ b/fortran/test/tH5T.f90 @@ -29,6 +29,10 @@ MODULE TH5T + USE HDF5 + USE TH5_MISC + USE TH5_MISC_GEN + CONTAINS SUBROUTINE compoundtest(cleanup, total_error) @@ -47,8 +51,6 @@ CONTAINS ! h5tget_class_f, h5tget_member_name_f, h5tget_member_offset_f, h5tget_member_type_f, ! h5tequal_f, h5tinsert_array_f, h5tcommit_f, h5tencode_f, h5tdecode_f - USE HDF5 ! This module contains all necessary modules - USE TH5_MISC IMPLICIT NONE LOGICAL, INTENT(IN) :: cleanup @@ -155,7 +157,6 @@ CONTAINS CALL h5tclose_f(fixed_str2,error) CALL check("h5tclose_f", error, total_error) - data_dims(1) = dimsize ! ! Initialize data buffer. @@ -178,47 +179,47 @@ CONTAINS ! during write/read to/from dataset with compound datatype. ! CALL h5pcreate_f(H5P_DATASET_XFER_F, plist_id, error) - CALL check("h5pcreate_f", error, total_error) + CALL check("h5pcreate_f", error, total_error) CALL h5pset_preserve_f(plist_id, flag, error) - CALL check("h5pset_preserve_f", error, total_error) + CALL check("h5pset_preserve_f", error, total_error) ! ! Create a new file using default properties. ! - CALL h5_fixname_f(filename, fix_filename, H5P_DEFAULT_F, error) + CALL h5_fixname_f(filename, fix_filename, H5P_DEFAULT_F, error) if (error .ne. 0) then write(*,*) "Cannot modify filename" stop endif CALL h5fcreate_f(fix_filename, H5F_ACC_TRUNC_F, file_id, error) - CALL check("h5fcreate_f", error, total_error) + CALL check("h5fcreate_f", error, total_error) ! ! Create the dataspace. ! CALL h5screate_simple_f(rank, dims, dspace_id, error) - CALL check("h5screate_simple_f", error, total_error) + CALL check("h5screate_simple_f", error, total_error) ! ! Create compound datatype. ! ! First calculate total size by calculating sizes of each member ! CALL h5tcopy_f(H5T_NATIVE_CHARACTER, dt5_id, error) - CALL check("h5tcopy_f", error, total_error) + CALL check("h5tcopy_f", error, total_error) sizechar = 2 CALL h5tset_size_f(dt5_id, sizechar, error) - CALL check("h5tset_size_f", error, total_error) + CALL check("h5tset_size_f", error, total_error) CALL h5tget_size_f(dt5_id, type_sizec, error) - CALL check("h5tget_size_f", error, total_error) + CALL check("h5tget_size_f", error, total_error) CALL h5tget_size_f(H5T_NATIVE_INTEGER, type_sizei, error) - CALL check("h5tget_size_f", error, total_error) + CALL check("h5tget_size_f", error, total_error) CALL h5tget_size_f(H5T_NATIVE_DOUBLE, type_sized, error) - CALL check("h5tget_size_f", error, total_error) + CALL check("h5tget_size_f", error, total_error) CALL h5tget_size_f(H5T_NATIVE_REAL, type_sizer, error) - CALL check("h5tget_size_f", error, total_error) + CALL check("h5tget_size_f", error, total_error) !write(*,*) "get sizes", type_sizec, type_sizei, type_sizer, type_sized type_size = type_sizec + type_sizei + type_sized + type_sizer CALL h5tcreate_f(H5T_COMPOUND_F, type_size, dtype_id, error) - CALL check("h5tcreate_f", error, total_error) + CALL check("h5tcreate_f", error, total_error) ! ! Insert memebers ! @@ -226,19 +227,19 @@ CONTAINS ! offset = 0 CALL h5tinsert_f(dtype_id, "char_field", offset, dt5_id, error) - CALL check("h5tinsert_f", error, total_error) + CALL check("h5tinsert_f", error, total_error) ! ! INTEGER member ! offset = offset + type_sizec ! Offset of the second memeber is 2 CALL h5tinsert_f(dtype_id, "integer_field", offset, H5T_NATIVE_INTEGER, error) - CALL check("h5tinsert_f", error, total_error) + CALL check("h5tinsert_f", error, total_error) ! ! DOUBLE PRECISION member ! offset = offset + type_sizei ! Offset of the third memeber is 6 CALL h5tinsert_f(dtype_id, "double_field", offset, H5T_NATIVE_DOUBLE, error) - CALL check("h5tinsert_f", error, total_error) + CALL check("h5tinsert_f", error, total_error) ! ! REAL member ! @@ -250,123 +251,122 @@ CONTAINS ! CALL h5dcreate_f(file_id, dsetname, dtype_id, dspace_id, & dset_id, error) - CALL check("h5dcreate_f", error, total_error) + CALL check("h5dcreate_f", error, total_error) ! ! Create memory types. We have to create a compound datatype ! for each member we want to write. ! CALL h5tcreate_f(H5T_COMPOUND_F, type_sizec, dt1_id, error) - CALL check("h5tcreate_f", error, total_error) + CALL check("h5tcreate_f", error, total_error) offset = 0 CALL h5tinsert_f(dt1_id, "char_field", offset, dt5_id, error) - CALL check("h5tinsert_f", error, total_error) + CALL check("h5tinsert_f", error, total_error) ! CALL h5tcreate_f(H5T_COMPOUND_F, type_sizei, dt2_id, error) - CALL check("h5tcreate_f", error, total_error) + CALL check("h5tcreate_f", error, total_error) offset = 0 CALL h5tinsert_f(dt2_id, "integer_field", offset, H5T_NATIVE_INTEGER, error) - CALL check("h5tinsert_f", error, total_error) + CALL check("h5tinsert_f", error, total_error) ! CALL h5tcreate_f(H5T_COMPOUND_F, type_sized, dt3_id, error) - CALL check("h5tcreate_f", error, total_error) + CALL check("h5tcreate_f", error, total_error) offset = 0 CALL h5tinsert_f(dt3_id, "double_field", offset, H5T_NATIVE_DOUBLE, error) - CALL check("h5tinsert_f", error, total_error) + CALL check("h5tinsert_f", error, total_error) ! CALL h5tcreate_f(H5T_COMPOUND_F, type_sizer, dt4_id, error) - CALL check("h5tcreate_f", error, total_error) + CALL check("h5tcreate_f", error, total_error) offset = 0 CALL h5tinsert_f(dt4_id, "real_field", offset, H5T_NATIVE_REAL, error) - CALL check("h5tinsert_f", error, total_error) + CALL check("h5tinsert_f", error, total_error) ! ! Write data by fields in the datatype. Fields order is not important. ! CALL h5dwrite_f(dset_id, dt4_id, real_member, data_dims, error, xfer_prp = plist_id) - CALL check("h5dwrite_f", error, total_error) + CALL check("h5dwrite_f", error, total_error) CALL h5dwrite_f(dset_id, dt1_id, char_member, data_dims, error, xfer_prp = plist_id) - CALL check("h5dwrite_f", error, total_error) + CALL check("h5dwrite_f", error, total_error) CALL h5dwrite_f(dset_id, dt3_id, double_member, data_dims, error, xfer_prp = plist_id) - CALL check("h5dwrite_f", error, total_error) + CALL check("h5dwrite_f", error, total_error) CALL h5dwrite_f(dset_id, dt2_id, int_member, data_dims, error, xfer_prp = plist_id) - CALL check("h5dwrite_f", error, total_error) + CALL check("h5dwrite_f", error, total_error) ! ! End access to the dataset and release resources used by it. ! CALL h5dclose_f(dset_id, error) - CALL check("h5dclose_f", error, total_error) + CALL check("h5dclose_f", error, total_error) ! ! Terminate access to the data space. ! CALL h5sclose_f(dspace_id, error) - CALL check("h5sclose_f", error, total_error) + CALL check("h5sclose_f", error, total_error) ! ! Terminate access to the datatype ! CALL h5tclose_f(dtype_id, error) - CALL check("h5tclose_f", error, total_error) + CALL check("h5tclose_f", error, total_error) CALL h5tclose_f(dt1_id, error) - CALL check("h5tclose_f", error, total_error) + CALL check("h5tclose_f", error, total_error) CALL h5tclose_f(dt2_id, error) - CALL check("h5tclose_f", error, total_error) + CALL check("h5tclose_f", error, total_error) CALL h5tclose_f(dt3_id, error) - CALL check("h5tclose_f", error, total_error) + CALL check("h5tclose_f", error, total_error) CALL h5tclose_f(dt4_id, error) - CALL check("h5tclose_f", error, total_error) - + CALL check("h5tclose_f", error, total_error) ! ! Create and store compound datatype with the character and ! array members. ! type_size = type_sizec + elements*type_sizer ! Size of compound datatype CALL h5tcreate_f(H5T_COMPOUND_F, type_size, dtarray_id, error) - CALL check("h5tcreate_f", error, total_error) + CALL check("h5tcreate_f", error, total_error) offset = 0 CALL h5tinsert_f(dtarray_id, "char_field", offset, H5T_NATIVE_CHARACTER, error) - CALL check("h5tinsert_f", error, total_error) + CALL check("h5tinsert_f", error, total_error) offset = type_sizec CALL h5tarray_create_f(H5T_NATIVE_REAL, array_dims_range, array_dims, arrayt_id, error) - CALL check("h5tarray_create_f", error, total_error) + CALL check("h5tarray_create_f", error, total_error) CALL h5tinsert_f(dtarray_id,"array_field", offset, arrayt_id, error) - CALL check("h5tinsert_f", error, total_error) + CALL check("h5tinsert_f", error, total_error) CALL h5tcommit_f(file_id, "Compound_with_array_member", dtarray_id, error) - CALL check("h5tcommit_f", error, total_error) + CALL check("h5tcommit_f", error, total_error) CALL h5tclose_f(arrayt_id, error) - CALL check("h5tclose_f", error, total_error) + CALL check("h5tclose_f", error, total_error) CALL h5tclose_f(dtarray_id, error) - CALL check("h5tclose_f", error, total_error) + CALL check("h5tclose_f", error, total_error) ! ! Close the file. ! CALL h5fclose_f(file_id, error) - CALL check("h5fclose_f", error, total_error) + CALL check("h5fclose_f", error, total_error) ! ! Open the file. ! CALL h5fopen_f (fix_filename, H5F_ACC_RDWR_F, file_id, error) - CALL check("h5fopen_f", error, total_error) + CALL check("h5fopen_f", error, total_error) ! ! Open the dataset. ! CALL h5dopen_f(file_id, dsetname, dset_id, error) - CALL check("h5dopen_f", error, total_error) + CALL check("h5dopen_f", error, total_error) ! ! Get datatype of the open dataset. ! Check it class, number of members, and member's names. ! CALL h5dget_type_f(dset_id, dtype_id, error) - CALL check("h5dget_type_f", error, total_error) + CALL check("h5dget_type_f", error, total_error) CALL h5tget_class_f(dtype_id, class, error) - CALL check("h5dget_class_f", error, total_error) + CALL check("h5dget_class_f", error, total_error) if (class .ne. H5T_COMPOUND_F) then write(*,*) " Wrong class type returned" total_error = total_error + 1 endif CALL h5tget_nmembers_f(dtype_id, num_members, error) - CALL check("h5dget_nmembers_f", error, total_error) + CALL check("h5dget_nmembers_f", error, total_error) if (num_members .ne. COMP_NUM_MEMBERS ) then write(*,*) " Wrong number of members returned" total_error = total_error + 1 @@ -377,11 +377,11 @@ CONTAINS ! 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 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 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) + 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 @@ -394,16 +394,16 @@ CONTAINS write(*,*) "Offset of the char member is incorrect" total_error = total_error + 1 endif - CALL h5tget_member_type_f(dtype_id, i-1, membtype_id, error) - CALL check("h5tget_member_type_f", error, total_error) - CALL h5tequal_f(membtype_id, dt5_id, flag, error) - CALL check("h5tequal_f", error, total_error) + CALL h5tget_member_type_f(dtype_id, i-1, membtype_id, error) + CALL check("h5tget_member_type_f", error, total_error) + CALL h5tequal_f(membtype_id, dt5_id, flag, error) + CALL check("h5tequal_f", error, total_error) if(.not. flag) then write(*,*) "Wrong member type returned for character member" total_error = total_error + 1 endif - CALL h5tget_member_class_f(dtype_id, i-1, class, error) - CALL check("h5tget_member_class_f",error, total_error) + CALL h5tget_member_class_f(dtype_id, i-1, class, error) + CALL check("h5tget_member_class_f",error, total_error) if (class .ne. H5T_STRING_F) then write(*,*) "Wrong class returned for character member" total_error = total_error + 1 @@ -413,16 +413,16 @@ CONTAINS write(*,*) "Offset of the integer member is incorrect" total_error = total_error + 1 endif - CALL h5tget_member_type_f(dtype_id, i-1, membtype_id, error) - CALL check("h5tget_member_type_f", error, total_error) - CALL h5tequal_f(membtype_id, H5T_NATIVE_INTEGER, flag, error) - CALL check("h5tequal_f", error, total_error) + CALL h5tget_member_type_f(dtype_id, i-1, membtype_id, error) + CALL check("h5tget_member_type_f", error, total_error) + CALL h5tequal_f(membtype_id, H5T_NATIVE_INTEGER, flag, error) + CALL check("h5tequal_f", error, total_error) if(.not. flag) then write(*,*) "Wrong member type returned for integer memebr" total_error = total_error + 1 endif - CALL h5tget_member_class_f(dtype_id, i-1, class, error) - CALL check("h5tget_member_class_f",error, total_error) + CALL h5tget_member_class_f(dtype_id, i-1, class, error) + CALL check("h5tget_member_class_f",error, total_error) if (class .ne. H5T_INTEGER_F) then write(*,*) "Wrong class returned for INTEGER member" total_error = total_error + 1 @@ -432,16 +432,16 @@ CONTAINS write(*,*) "Offset of the double precision member is incorrect" total_error = total_error + 1 endif - CALL h5tget_member_type_f(dtype_id, i-1, membtype_id, error) - CALL check("h5tget_member_type_f", error, total_error) - CALL h5tequal_f(membtype_id, H5T_NATIVE_DOUBLE, flag, error) - CALL check("h5tequal_f", error, total_error) + CALL h5tget_member_type_f(dtype_id, i-1, membtype_id, error) + CALL check("h5tget_member_type_f", error, total_error) + CALL h5tequal_f(membtype_id, H5T_NATIVE_DOUBLE, flag, error) + CALL check("h5tequal_f", error, total_error) if(.not. flag) then write(*,*) "Wrong member type returned for double precision memebr" total_error = total_error + 1 endif - CALL h5tget_member_class_f(dtype_id, i-1, class, error) - CALL check("h5tget_member_class_f",error, total_error) + CALL h5tget_member_class_f(dtype_id, i-1, class, error) + CALL check("h5tget_member_class_f",error, total_error) if (class .ne. H5T_FLOAT_F) then write(*,*) "Wrong class returned for double precision member" total_error = total_error + 1 @@ -451,16 +451,16 @@ CONTAINS write(*,*) "Offset of the real member is incorrect" total_error = total_error + 1 endif - CALL h5tget_member_type_f(dtype_id, i-1, membtype_id, error) - CALL check("h5tget_member_type_f", error, total_error) - CALL h5tequal_f(membtype_id, H5T_NATIVE_REAL, flag, error) - CALL check("h5tequal_f", error, total_error) + CALL h5tget_member_type_f(dtype_id, i-1, membtype_id, error) + CALL check("h5tget_member_type_f", error, total_error) + CALL h5tequal_f(membtype_id, H5T_NATIVE_REAL, flag, error) + CALL check("h5tequal_f", error, total_error) if(.not. flag) then write(*,*) "Wrong member type returned for real memebr" total_error = total_error + 1 endif - CALL h5tget_member_class_f(dtype_id, i-1, class, error) - CALL check("h5tget_member_class_f",error, total_error) + CALL h5tget_member_class_f(dtype_id, i-1, class, error) + CALL check("h5tget_member_class_f",error, total_error) if (class .ne. H5T_FLOAT_F) then write(*,*) "Wrong class returned for real member" total_error = total_error + 1 @@ -476,22 +476,22 @@ CONTAINS ! Create memory datatype to read character member of the compound datatype. ! CALL h5tcopy_f(H5T_NATIVE_CHARACTER, dt2_id, error) - CALL check("h5tcopy_f", error, total_error) + CALL check("h5tcopy_f", error, total_error) sizechar = 2 CALL h5tset_size_f(dt2_id, sizechar, error) - CALL check("h5tset_size_f", error, total_error) + CALL check("h5tset_size_f", error, total_error) CALL h5tget_size_f(dt2_id, type_size, error) - CALL check("h5tget_size_f", error, total_error) + CALL check("h5tget_size_f", error, total_error) CALL h5tcreate_f(H5T_COMPOUND_F, type_size, dt1_id, error) - CALL check("h5tcreate_f", error, total_error) + CALL check("h5tcreate_f", error, total_error) offset = 0 CALL h5tinsert_f(dt1_id, "char_field", offset, dt2_id, error) - CALL check("h5tinsert_f", error, total_error) + CALL check("h5tinsert_f", error, total_error) ! ! Read part of the dataset ! CALL h5dread_f(dset_id, dt1_id, char_member_out, data_dims, error) - CALL check("h5dread_f", error, total_error) + CALL check("h5dread_f", error, total_error) do i = 1, dimsize if (char_member_out(i) .ne. char_member(i)) then write(*,*) " Wrong character data is read back " @@ -500,15 +500,15 @@ CONTAINS enddo ! CALL h5tcreate_f(H5T_COMPOUND_F, type_sizei, dt5_id, error) - CALL check("h5tcreate_f", error, total_error) + CALL check("h5tcreate_f", error, total_error) offset = 0 CALL h5tinsert_f(dt5_id, "integer_field", offset, H5T_NATIVE_INTEGER, error) - CALL check("h5tinsert_f", error, total_error) + CALL check("h5tinsert_f", error, total_error) ! ! Read part of the dataset ! CALL h5dread_f(dset_id, dt5_id, int_member_out, data_dims, error) - CALL check("h5dread_f", error, total_error) + CALL check("h5dread_f", error, total_error) do i = 1, dimsize if (int_member_out(i) .ne. int_member(i)) then write(*,*) " Wrong integer data is read back " @@ -518,39 +518,33 @@ CONTAINS ! ! CALL h5tcreate_f(H5T_COMPOUND_F, type_sized, dt3_id, error) - CALL check("h5tcreate_f", error, total_error) + CALL check("h5tcreate_f", error, total_error) offset = 0 CALL h5tinsert_f(dt3_id, "double_field", offset, H5T_NATIVE_DOUBLE, error) - CALL check("h5tinsert_f", error, total_error) + CALL check("h5tinsert_f", error, total_error) ! ! Read part of the dataset ! CALL h5dread_f(dset_id, dt3_id, double_member_out, data_dims, error) - CALL check("h5dread_f", error, total_error) - do i = 1, dimsize - IF( .NOT.dreal_eq( REAL(double_member_out(i),dp), REAL( double_member(i), dp)) ) THEN - write(*,*) " Wrong double precision data is read back " - total_error = total_error + 1 - endif - enddo + CALL check("h5dread_f", error, total_error) + DO i = 1, dimsize + CALL VERIFY("h5dread_f:Wrong double precision data is read back", double_member_out(i), double_member(i), total_error) + ENDDO ! ! CALL h5tcreate_f(H5T_COMPOUND_F, type_sizer, dt4_id, error) - CALL check("h5tcreate_f", error, total_error) + CALL check("h5tcreate_f", error, total_error) offset = 0 CALL h5tinsert_f(dt4_id, "real_field", offset, H5T_NATIVE_REAL, error) - CALL check("h5tinsert_f", error, total_error) + CALL check("h5tinsert_f", error, total_error) ! ! Read part of the dataset ! CALL h5dread_f(dset_id, dt4_id, real_member_out, data_dims, error) - CALL check("h5dread_f", error, total_error) - DO i = 1, dimsize - IF( .NOT.dreal_eq( REAL(real_member_out(i),dp), REAL( real_member(i), dp)) ) THEN - WRITE(*,*) " Wrong real precision data is read back " - total_error = total_error + 1 - ENDIF - ENDDO + CALL check("h5dread_f", error, total_error) + DO i = 1, dimsize + CALL VERIFY("h5dread_f:Wrong double precision data is read back", real_member_out(i), real_member(i), total_error) + ENDDO ! ! *----------------------------------------------------------------------- ! * Test encoding and decoding compound datatypes @@ -565,7 +559,7 @@ CONTAINS ! Try decoding bogus buffer CALL H5Tdecode_f(cmpd_buf, decoded_tid1, error) - CALL VERIFY("H5Tdecode_f", error, -1, total_error) + CALL verify("H5Tdecode_f", error, -1, total_error) CALL H5Tencode_f(dtype_id, cmpd_buf, cmpd_buf_size, error) CALL check("H5Tencode_f", error, total_error) @@ -578,27 +572,27 @@ CONTAINS CALL H5Tequal_f(decoded_tid1, dtype_id, flag, error) CALL check("H5Tequal_f", error, total_error) - CALL VerifyLogical("H5Tequal_f", flag, .TRUE., total_error) + CALL verify("H5Tequal_f", flag, .TRUE., total_error) ! ! Close all open objects. ! CALL h5dclose_f(dset_id, error) - CALL check("h5dclose_f", error, total_error) + CALL check("h5dclose_f", error, total_error) CALL h5tclose_f(dt1_id, error) - CALL check("h5tclose_f", error, total_error) + CALL check("h5tclose_f", error, total_error) CALL h5tclose_f(dt2_id, error) - CALL check("h5tclose_f", error, total_error) + CALL check("h5tclose_f", error, total_error) CALL h5tclose_f(dt3_id, error) - CALL check("h5tclose_f", error, total_error) + CALL check("h5tclose_f", error, total_error) CALL h5tclose_f(dt4_id, error) - CALL check("h5tclose_f", error, total_error) + CALL check("h5tclose_f", error, total_error) CALL h5tclose_f(dt5_id, error) - CALL check("h5tclose_f", error, total_error) + CALL check("h5tclose_f", error, total_error) CALL h5fclose_f(file_id, error) - CALL check("h5fclose_f", error, total_error) + CALL check("h5fclose_f", error, total_error) - if(cleanup) CALL h5_cleanup_f(filename, H5P_DEFAULT_F, error) - CALL check("h5_cleanup_f", error, total_error) + IF(cleanup) CALL h5_cleanup_f(filename, H5P_DEFAULT_F, error) + CALL check("h5_cleanup_f", error, total_error) RETURN END SUBROUTINE compoundtest @@ -614,9 +608,6 @@ CONTAINS ! H5tset_norm_f, H5tget_inpad_f, H5tset_inpad_f, H5tget_cset_f, ! H5tset_cset_f, H5tget_strpad_f, H5tset_strpad_f - USE HDF5 ! This module contains all necessary modules - USE TH5_MISC - IMPLICIT NONE INTEGER, INTENT(OUT) :: total_error @@ -902,7 +893,7 @@ CONTAINS CALL check("H5Tget_order_f",error, total_error) CALL H5Tget_order_f(H5T_NATIVE_INTEGER, order2, error) CALL check("H5Tget_order_f",error, total_error) - CALL VERIFY("H5Tget_native_type_f",order1, order2, total_error) + CALL verify("H5Tget_native_type_f",order1, order2, total_error) ! this test depends on whether -i8 was specified @@ -910,11 +901,11 @@ CONTAINS !!$ CALL check("H5Tget_size_f",error, total_error) !!$ CALL H5Tget_size_f(H5T_STD_I32BE, type_size2, error) !!$ CALL check("H5Tget_size_f",error, total_error) -!!$ CALL VERIFY("H5Tget_native_type_f", INT(type_size1), INT(type_size2), total_error) +!!$ CALL verify("H5Tget_native_type_f", INT(type_size1), INT(type_size2), total_error) CALL H5Tget_class_f(native_type, class, error) CALL check("H5Tget_class_f",error, total_error) - CALL VERIFY("H5Tget_native_type_f", INT(class), INT(H5T_ENUM_F), total_error) + CALL verify("H5Tget_native_type_f", INT(class), INT(H5T_ENUM_F), total_error) CALL h5dclose_f(dset_id,error) CALL check("h5dclose_f", error, total_error) @@ -972,8 +963,6 @@ CONTAINS SUBROUTINE test_derived_flt(cleanup, total_error) - USE HDF5 ! This module contains all necessary modules - USE TH5_MISC IMPLICIT NONE LOGICAL, INTENT(IN) :: cleanup @@ -1060,24 +1049,24 @@ SUBROUTINE test_derived_flt(cleanup, total_error) CALL check("H5Tget_fields_f", error, total_error) IF(spos.NE.44 .OR. epos.NE.34 .OR. esize.NE.10 .OR. mpos.NE.3 .OR. msize.NE.31)THEN - CALL VERIFY("H5Tget_fields_f", -1, 0, total_error) + CALL verify("H5Tget_fields_f", -1, 0, total_error) ENDIF CALL H5Tget_precision_f(tid1, precision1, error) CALL check("H5Tget_precision_f", error, total_error) - CALL VERIFY("H5Tget_precision_f", INT(precision1), 42, total_error) + CALL verify("H5Tget_precision_f", INT(precision1), 42, total_error) CALL H5Tget_offset_f(tid1, offset1, error) CALL check("H5Tget_offset_f", error, total_error) - CALL VERIFY("H5Tget_offset_f", INT(offset1), 3, total_error) + CALL verify("H5Tget_offset_f", INT(offset1), 3, total_error) CALL H5Tget_size_f(tid1, size1, error) CALL check("H5Tget_size_f", error, total_error) - CALL VERIFY("H5Tget_size_f", INT(size1), 7, total_error) + CALL verify("H5Tget_size_f", INT(size1), 7, total_error) CALL H5Tget_ebias_f(tid1, ebias1, error) CALL check("H5Tget_ebias_f", error, total_error) - CALL VERIFY("H5Tget_ebias_f", INT(ebias1), 511, total_error) + CALL verify("H5Tget_ebias_f", INT(ebias1), 511, total_error) !-------------------------------------------------------------------------- ! * 2nd floating-point type @@ -1121,24 +1110,24 @@ SUBROUTINE test_derived_flt(cleanup, total_error) CALL check("H5Tget_fields_f", error, total_error) IF(spos.NE.23 .OR. epos.NE.16 .OR. esize.NE.7 .OR. mpos.NE.0 .OR. msize.NE.16)THEN - CALL VERIFY("H5Tget_fields_f", -1, 0, total_error) + CALL verify("H5Tget_fields_f", -1, 0, total_error) ENDIF CALL H5Tget_precision_f(tid2, precision2, error) CALL check("H5Tget_precision_f", error, total_error) - CALL VERIFY("H5Tget_precision_f", INT(precision2), 24, total_error) + CALL verify("H5Tget_precision_f", INT(precision2), 24, total_error) CALL H5Tget_offset_f(tid2, offset2, error) CALL check("H5Tget_offset_f", error, total_error) - CALL VERIFY("H5Tget_offset_f", INT(offset2), 0, total_error) + CALL verify("H5Tget_offset_f", INT(offset2), 0, total_error) CALL H5Tget_size_f(tid2, size2, error) CALL check("H5Tget_size_f", error, total_error) - CALL VERIFY("H5Tget_size_f", INT(size2), 3, total_error) + CALL verify("H5Tget_size_f", INT(size2), 3, total_error) CALL H5Tget_ebias_f(tid2, ebias2, error) CALL check("H5Tget_ebias_f", error, total_error) - CALL VERIFY("H5Tget_ebias_f", INT(ebias2), 63, total_error) + CALL verify("H5Tget_ebias_f", INT(ebias2), 63, total_error) CALL h5tclose_f(tid1, error) CALL check("h5tclose_f", error, total_error) diff --git a/fortran/test/tH5T_F03.F90 b/fortran/test/tH5T_F03.F90 new file mode 100644 index 0000000..d50b76d --- /dev/null +++ b/fortran/test/tH5T_F03.F90 @@ -0,0 +1,3425 @@ +!****h* root/fortran/test/tH5T_F03.f90 +! +! NAME +! tH5T_F03.f90 +! +! FUNCTION +! Test FORTRAN HDF5 H5T APIs which are dependent on FORTRAN 2003 +! features. +! +! 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. * +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! +! +! CONTAINS SUBROUTINES +! test_array_compound_atomic, test_array_compound_array, +! test_array_bkg, test_h5kind_to_type +! +!***** + +! ***************************************** +! *** H 5 T T E S T S +! ***************************************** + +!*************************************************************** +!** +!** test_array_compound_atomic(): Test basic array datatype code. +!** Tests 1-D array of compound datatypes (with no array fields) +!** +!*************************************************************** +! +#include + +MODULE TH5T_F03 + + USE HDF5 + USE TH5_MISC + USE TH5_MISC_GEN + USE ISO_C_BINDING + +CONTAINS + +SUBROUTINE test_array_compound_atomic(total_error) + + IMPLICIT NONE + + INTEGER, INTENT(INOUT) :: total_error + ! 1-D dataset WITH fixed dimensions + INTEGER, PARAMETER :: SPACE1_RANK = 1 + INTEGER, PARAMETER :: SPACE1_DIM1 = 4 + ! 1-D array datatype + INTEGER, PARAMETER :: ARRAY1_RANK= 1 + INTEGER, PARAMETER :: ARRAY1_DIM1= 4 + CHARACTER(LEN=10), PARAMETER :: FILENAME = "tarray1.h5" + + TYPE s1_t + INTEGER :: i + REAL :: f + END TYPE s1_t + TYPE(s1_t), DIMENSION(:,:), ALLOCATABLE, TARGET :: wdata ! Information to write + TYPE(s1_t), DIMENSION(:,:), ALLOCATABLE, TARGET :: rdata ! Information read in + INTEGER(hid_t) :: fid1 ! HDF5 File IDs + INTEGER(hid_t) :: dataset ! Dataset ID + INTEGER(hid_t) :: sid1 ! Dataspace ID + INTEGER(hid_t) :: tid1 ! Array Datatype ID + INTEGER(hid_t) :: tid2 ! Compound Datatype ID + + INTEGER(HSIZE_T), DIMENSION(1) :: sdims1 = (/SPACE1_DIM1/) + INTEGER(HSIZE_T), DIMENSION(1) :: tdims1=(/ARRAY1_DIM1/) + INTEGER :: ndims ! Array rank for reading + INTEGER(HSIZE_T), ALLOCATABLE, DIMENSION(:) :: rdims1 ! Array dimensions for reading + INTEGER(HSIZE_T), ALLOCATABLE, DIMENSION(:) :: rdims ! Array dimensions for reading + INTEGER :: nmemb ! Number of compound members + CHARACTER(LEN=20) :: mname ! Name of compound field + INTEGER(size_t) :: off ! Offset of compound field + INTEGER(hid_t) :: mtid ! Datatype ID for field + INTEGER :: i,j ! counting variables + + INTEGER :: error ! Generic RETURN value + INTEGER :: namelen + LOGICAL :: flag + + TYPE(C_PTR) :: f_ptr ! Needed to pass the pointer, for g95 compiler to work + + ALLOCATE( wdata(1:SPACE1_DIM1,1:ARRAY1_DIM1) ) + ALLOCATE( rdata(1:SPACE1_DIM1,1:ARRAY1_DIM1) ) + + ! Initialize array data to write + DO i = 1, SPACE1_DIM1 + DO j = 1, ARRAY1_DIM1 + wdata(i,j)%i = i * 10 + j + wdata(i,j)%f = i * 2.5 + j + ENDDO + ENDDO + + ! Create file + CALL h5fcreate_f(FILENAME,H5F_ACC_TRUNC_F,fid1,error) + CALL check("h5fcreate_f", error, total_error) + + ! Create dataspace for datasets + CALL h5screate_simple_f(SPACE1_RANK, sdims1, sid1, error) + CALL check("h5screate_simple_f", error, total_error) + + CALL h5tcreate_f(H5T_COMPOUND_F, H5OFFSETOF(C_LOC(wdata(1,1)), C_LOC(wdata(2,1))), tid2, error) + CALL check("h5tcreate_f", error, total_error) + + ! Insert integer field + CALL h5tinsert_f(tid2, "i", H5OFFSETOF(C_LOC(wdata(1,1)),C_LOC(wdata(1,1)%i)), H5T_NATIVE_INTEGER, error) + CALL check("h5tinsert_f", error, total_error) + + ! Insert float field + + CALL h5tinsert_f(tid2, "f", H5OFFSETOF(C_LOC(wdata(1,1)),C_LOC(wdata(1,1)%f)), H5T_NATIVE_REAL, error) + CALL check("h5tinsert_f", error, total_error) + + ! Create an array datatype to refer to + CALL h5tarray_create_f(tid2, ARRAY1_RANK, tdims1, tid1, error) + CALL check("h5tarray_create_f", error, total_error) + + ! Close compound datatype + CALL h5tclose_f(tid2,error) + CALL check("h5tclose_f", error, total_error) + + + ! Create a dataset + CALL h5dcreate_f(fid1,"Dataset1",tid1, sid1, dataset,error) + CALL check("h5dcreate_f", error, total_error) + + ! Write dataset to disk + + ALLOCATE(rdims(1:2)) ! dummy not needed + + f_ptr = C_LOC(wdata(1,1)) + CALL h5dwrite_f(dataset, tid1, f_ptr, error ) + CALL check("h5dwrite_f", error, total_error) + ! Close Dataset + CALL h5dclose_f(dataset, error) + CALL check("h5dclose_f", error, total_error) + + ! Close datatype + CALL h5tclose_f(tid1,error) + CALL check("h5tclose_f", error, total_error) + + ! Close disk dataspace + CALL h5sclose_f(sid1,error) + CALL check("h5sclose_f", error, total_error) + + ! Close file + CALL h5fclose_f(fid1,error) + CALL check("h5fclose_f", error, total_error) + + ! Re-open file + CALL h5fopen_f (FILENAME, H5F_ACC_RDONLY_F, fid1, error) + CALL check("h5fopen_f", error, total_error) + + ! Open the dataset + CALL h5dopen_f(fid1, "Dataset1", dataset, error) + CALL check("h5dopen_f", error, total_error) + + ! Get the datatype + CALL h5dget_type_f(dataset, tid1, error) + CALL check("h5dget_type_f", error, total_error) + + ! Check the array rank + CALL h5tget_array_ndims_f(tid1, ndims, error) + CALL check("h5tget_array_ndims_f", error, total_error) + CALL VERIFY("h5tget_array_ndims_f",ndims, ARRAY1_RANK, total_error) + + ! Get the array dimensions + ALLOCATE(rdims1(1:ndims)) + CALL h5tget_array_dims_f(tid1, rdims1, error) + CALL check("h5tget_array_dims_f", error, total_error) + + + ! Check the array dimensions + DO i = 1, ndims + CALL VERIFY("h5tget_array_dims_f", INT(rdims1(i)), INT(tdims1(i)), total_error) + ENDDO + + ! Get the compound datatype + CALL h5tget_super_f(tid1, tid2, error) + CALL check("h5tget_super_f", error, total_error) + + ! Check the number of members + CALL h5tget_nmembers_f(tid2, nmemb, error) + CALL check("h5tget_nmembers_f", error, total_error) + CALL VERIFY("h5tget_nmembers_f", nmemb, 2, total_error) + + ! Check the 1st field's name + CALL H5Tget_member_name_f(tid2, 0, mname, namelen,error) + CALL check("H5Tget_member_name_f", error, total_error) + CALL verify("H5Tget_member_name_f",mname(1:namelen),"i", total_error) + + ! Check the 1st field's offset + CALL H5Tget_member_offset_f(tid2, 0, off, error) + CALL check("H5Tget_member_offset_f", error, total_error) + CALL VERIFY("H5Tget_member_offset_f",INT(off),0, total_error) + + + ! Check the 1st field's datatype + CALL H5Tget_member_type_f(tid2, 0, mtid, error) + CALL check("H5Tget_member_type_f", error, total_error) + + CALL H5Tequal_f(mtid, H5T_NATIVE_INTEGER, flag, error) + CALL check("H5Tequal_f", error, total_error) + CALL verify("H5Tequal_f", flag, .TRUE., total_error) + + CALL h5tclose_f(mtid,error) + CALL check("h5tclose_f", error, total_error) + + ! Check the 2nd field's name + CALL H5Tget_member_name_f(tid2, 1, mname, namelen,error) + CALL check("H5Tget_member_name_f", error, total_error) + CALL verify("H5Tget_member_name_f",mname(1:namelen),"f", total_error) + + ! Check the 2nd field's offset + CALL H5Tget_member_offset_f(tid2, 1, off, error) + CALL check("H5Tget_member_offset_f", error, total_error) + CALL VERIFY("H5Tget_member_offset_f",INT(off),INT(H5OFFSETOF(C_LOC(wdata(1,1)),C_LOC(wdata(1,1)%f))), total_error) + + ! Check the 2nd field's datatype + CALL H5Tget_member_type_f(tid2, 1, mtid, error) + CALL check("H5Tget_member_type_f", error, total_error) + + CALL H5Tequal_f(mtid, H5T_NATIVE_REAL, flag, error) + CALL check("H5Tequal_f", error, total_error) + CALL verify("H5Tequal_f", flag, .TRUE., total_error) + + CALL h5tclose_f(mtid,error) + CALL check("h5tclose_f", error, total_error) + + ! Close Compound Datatype + CALL h5tclose_f(tid2, error) + CALL check("h5tclose_f", error, total_error) + + ! Read dataset from disk + + f_ptr = C_LOC(rdata(1,1)) + CALL H5Dread_f(dataset, tid1, f_ptr, error) + CALL check("H5Dread_f", error, total_error) + + ! Compare data read in + DO i = 1, SPACE1_DIM1 + DO j = 1, ARRAY1_DIM1 + IF(wdata(i,j)%i.NE.rdata(i,j)%i)THEN + PRINT*, 'ERROR: Wrong integer data is read back by H5Dread_f ' + total_error = total_error + 1 + ENDIF + CALL VERIFY('ERROR: Wrong real data is read back by H5Dread_f ',wdata(i,j)%f, rdata(i,j)%f, total_error) + ENDDO + ENDDO + + ! Close Datatype + CALL h5tclose_f(tid1,error) + CALL check("h5tclose_f", error, total_error) + + ! Close Dataset + CALL h5dclose_f(dataset, error) + CALL check("h5dclose_f", error, total_error) + + ! Close file + CALL h5fclose_f(fid1,error) + CALL check("h5fclose_f", error, total_error) + +END SUBROUTINE test_array_compound_atomic +!!$ +!!$!*************************************************************** +!!$!** +!!$!** test_array_compound_array(): Test basic array datatype code. +!!$!** Tests 1-D array of compound datatypes (with array fields) +!!$!** +!!$!*************************************************************** +!!$ + SUBROUTINE test_array_compound_array(total_error) + + IMPLICIT NONE + + INTEGER, INTENT(INOUT) :: total_error + + ! 1-D array datatype + INTEGER, PARAMETER :: ARRAY1_RANK= 1 + INTEGER, PARAMETER :: ARRAY1_DIM1= 3 + INTEGER, PARAMETER :: ARRAY2_DIM1= 5 + + INTEGER, PARAMETER :: SPACE1_RANK = 1 + INTEGER, PARAMETER :: SPACE1_DIM1 = 4 + CHARACTER(LEN=10), PARAMETER :: FILENAME = "tarray2.h5" + + TYPE st_t_struct ! Typedef for compound datatype + INTEGER :: i + REAL, DIMENSION(1:ARRAY2_DIM1) :: f + CHARACTER(LEN=2), DIMENSION(1:ARRAY2_DIM1) :: c + END TYPE st_t_struct + ! Information to write + TYPE(st_t_struct), DIMENSION(1:SPACE1_DIM1,1:ARRAY1_DIM1), TARGET :: wdata + ! Information read in + TYPE(st_t_struct), DIMENSION(1:SPACE1_DIM1,1:ARRAY1_DIM1), TARGET :: rdata + + + INTEGER(hid_t) :: fid1 ! HDF5 File IDs + INTEGER(hid_t) :: dataset ! Dataset ID + integer(hid_t) :: sid1 ! Dataspace ID + integer(hid_t) :: tid1 ! Array Datatype ID + integer(hid_t) :: tid2 ! Compound Datatype ID + integer(hid_t) :: tid3 ! Nested Array Datatype ID + integer(hid_t) :: tid4 ! Nested Array Datatype ID + + INTEGER(HSIZE_T), DIMENSION(1) :: sdims1 = (/SPACE1_DIM1/) + INTEGER(HSIZE_T), DIMENSION(1) :: tdims1=(/ARRAY1_DIM1/) + INTEGER(HSIZE_T), DIMENSION(1) :: tdims2=(/ARRAY2_DIM1/) + + INTEGER ndims ! Array rank for reading + + INTEGER(HSIZE_T), ALLOCATABLE, DIMENSION(:) :: rdims1 ! Array dimensions for reading + + INTEGER :: nmemb ! Number of compound members + CHARACTER(LEN=20) :: mname ! Name of compound field + INTEGER(size_t) :: off ! Offset of compound field + INTEGER(hid_t) :: mtid ! Datatype ID for field + INTEGER(hid_t) :: mtid2 ! Datatype ID for field + + INTEGER :: mclass ! Datatype class for field + INTEGER :: i,j,k ! counting variables + + INTEGER :: error + CHARACTER(LEN=2) :: ichr2 + INTEGER :: namelen + LOGICAL :: flag + INTEGER(HID_T) :: atype_id !String Attribute Datatype identifier + INTEGER(SIZE_T) :: attrlen ! Length of the attribute string + + TYPE(c_ptr) :: f_ptr + + ! Initialize array data to write + DO i = 1, SPACE1_DIM1 + DO j = 1, array1_DIM1 + wdata(i,j)%i = i*10+j + DO k = 1, ARRAY2_DIM1 + wdata(i,j)%f(k) = 10*i+j+.5 + WRITE(ichr2,'(I2.2)') k + wdata(i,j)%c(k) = ichr2 + ENDDO + ENDDO + ENDDO + + ! Create file + CALL h5fcreate_f(FILENAME,H5F_ACC_TRUNC_F,fid1,error) + CALL check("h5fcreate_f", error, total_error) + + + ! Create dataspace for datasets + CALL h5screate_simple_f(SPACE1_RANK, sdims1, sid1, error) + CALL check("h5screate_simple_f", error, total_error) + + ! Create a compound datatype to refer to + ! + CALL h5tcreate_f(H5T_COMPOUND_F, H5OFFSETOF(C_LOC(wdata(1,1)), C_LOC(wdata(2,1))), tid2, error) + CALL check("h5tcreate_f", error, total_error) + + ! Insert integer field + CALL h5tinsert_f(tid2, "i", H5OFFSETOF(C_LOC(wdata(1,1)),C_LOC(wdata(1,1)%i)), H5T_NATIVE_INTEGER, error) + CALL check("h5tinsert_f", error, total_error) + + ! Create an array of floats datatype + CALL h5tarray_create_f(H5T_NATIVE_REAL, ARRAY1_RANK, tdims2, tid3, error) + CALL check("h5tarray_create_f", error, total_error) + ! Insert float array field + + CALL h5tinsert_f(tid2, "f", H5OFFSETOF(C_LOC(wdata(1,1)),C_LOC(wdata(1,1)%f)), tid3, error) + CALL check("h5tinsert_f", error, total_error) + + ! + ! Create datatype for the String attribute. + ! + CALL h5tcopy_f(H5T_NATIVE_CHARACTER, atype_id, error) + CALL check("h5tcopy_f",error,total_error) + + attrlen = LEN(wdata(1,1)%c(1)) + CALL h5tset_size_f(atype_id, attrlen, error) + CALL check("h5tset_size_f",error,total_error) + + ! Create an array of character datatype + CALL h5tarray_create_f(atype_id, ARRAY1_RANK, tdims2, tid4, error) + CALL check("h5tarray_create_f", error, total_error) + + ! Insert character array field + CALL h5tinsert_f(tid2, "c", H5OFFSETOF(C_LOC(wdata(1,1)),C_LOC(wdata(1,1)%c(1)(1:1))), tid4, error) + CALL check("h5tinsert2_f", error, total_error) + + ! Close array of floats field datatype + CALL h5tclose_f(tid3,error) + CALL check("h5tclose_f", error, total_error) + + CALL h5tclose_f(tid4,error) + CALL check("h5tclose_f", error, total_error) + + ! Create an array datatype to refer to + CALL h5tarray_create_f(tid2, ARRAY1_RANK, tdims1, tid1, error) + CALL check("h5tarray_create_f", error, total_error) + + ! Close compound datatype + CALL h5tclose_f(tid2,error) + CALL check("h5tclose_f", error, total_error) + + ! Create a dataset + CALL h5dcreate_f(fid1,"Dataset1",tid1, sid1, dataset,error) + CALL check("h5dcreate_f", error, total_error) + + + ! Write dataset to disk + f_ptr = C_LOC(wdata(1,1)) + CALL h5dwrite_f(dataset, tid1, f_ptr, error ) + CALL check("h5dwrite_f", error, total_error) + + ! Close Dataset + CALL h5dclose_f(dataset, error) + CALL check("h5dclose_f", error, total_error) + + ! Close datatype + CALL h5tclose_f(tid1,error) + CALL check("h5tclose_f", error, total_error) + + ! Close disk dataspace + CALL h5sclose_f(sid1,error) + CALL check("h5sclose_f", error, total_error) + + ! Close file + CALL h5fclose_f(fid1,error) + CALL check("h5fclose_f", error, total_error) + + ! Re-open file + CALL h5fopen_f (FILENAME, H5F_ACC_RDONLY_F, fid1, error) + CALL check("h5fopen_f", error, total_error) + + ! Open the dataset + + CALL h5dopen_f(fid1, "Dataset1", dataset, error) + CALL check("h5dopen_f", error, total_error) + + ! Get the datatype + CALL h5dget_type_f(dataset, tid1, error) + CALL check("h5dget_type_f", error, total_error) + + ! Check the array rank + CALL h5tget_array_ndims_f(tid1, ndims, error) + CALL check("h5tget_array_ndims_f", error, total_error) + CALL VERIFY("h5tget_array_ndims_f",ndims, ARRAY1_RANK, total_error) + + + ! Get the array dimensions + ALLOCATE(rdims1(1:ndims)) + CALL h5tget_array_dims_f(tid1, rdims1, error) + CALL check("h5tget_array_dims_f", error, total_error) + + ! Check the array dimensions + DO i = 1, ndims + CALL VERIFY("h5tget_array_dims_f", INT(rdims1(i)), INT(tdims1(i)), total_error) + ENDDO + + ! Get the compound datatype + CALL h5tget_super_f(tid1, tid2, error) + CALL check("h5tget_super_f", error, total_error) + + ! Check the number of members + CALL h5tget_nmembers_f(tid2, nmemb, error) + CALL check("h5tget_nmembers_f", error, total_error) + CALL VERIFY("h5tget_nmembers_f", nmemb, 3, total_error) + + ! Check the 1st field's name + CALL H5Tget_member_name_f(tid2, 0, mname, namelen,error) + CALL check("H5Tget_member_name_f", error, total_error) + CALL verify("H5Tget_member_name_f",mname(1:namelen),"i", total_error) + + ! Check the 1st field's offset + + CALL H5Tget_member_offset_f(tid2, 0, off, error) + CALL check("H5Tget_member_offset_f", error, total_error) + CALL VERIFY("H5Tget_member_offset_f",INT(off),0, total_error) + + ! Check the 1st field's datatype + CALL H5Tget_member_type_f(tid2, 0, mtid, error) + CALL check("H5Tget_member_type_f", error, total_error) + + CALL H5Tequal_f(mtid, H5T_NATIVE_INTEGER, flag, error) + CALL check("H5Tequal_f", error, total_error) + CALL verify("H5Tequal_f", flag, .TRUE., total_error) + + CALL h5tclose_f(mtid,error) + CALL check("h5tclose_f", error, total_error) + + ! Check the 2nd field's name + CALL H5Tget_member_name_f(tid2, 1, mname, namelen,error) + CALL check("H5Tget_member_name_f", error, total_error) + CALL verify("H5Tget_member_name_f",mname(1:namelen),"f", total_error) + + ! Check the 2nd field's offset + CALL H5Tget_member_offset_f(tid2, 1, off, error) + CALL check("H5Tget_member_offset_f", error, total_error) + CALL VERIFY("H5Tget_member_offset_f",INT(off),INT(H5OFFSETOF(C_LOC(wdata(1,1)),C_LOC(wdata(1,1)%f))), total_error) + + ! Check the 2nd field's datatype + CALL H5Tget_member_type_f(tid2, 1, mtid, error) + CALL check("H5Tget_member_type_f", error, total_error) + + ! Get the 2nd field's class + CALL H5Tget_class_f(mtid, mclass, error) + CALL check("H5Tget_class_f", error, total_error) + CALL VERIFY("H5Tget_class_f",mclass, H5T_ARRAY_F, total_error) + + ! Check the array rank + CALL h5tget_array_ndims_f(mtid, ndims, error) + CALL check("h5tget_array_ndims_f", error, total_error) + CALL VERIFY("h5tget_array_ndims_f",ndims, ARRAY1_RANK, total_error) + + ! Get the array dimensions + CALL h5tget_array_dims_f(mtid, rdims1, error) + CALL check("h5tget_array_dims_f", error, total_error) + + ! Check the array dimensions + DO i = 1, ndims + CALL VERIFY("h5tget_array_dims_f", INT(rdims1(i)), INT(tdims2(i)), total_error) + ENDDO + + ! Check the 3rd field's name + CALL H5Tget_member_name_f(tid2, 2, mname, namelen,error) + CALL check("H5Tget_member_name_f", error, total_error) + CALL verify("H5Tget_member_name_f",mname(1:namelen),"c", total_error) + + ! Check the 3rd field's offset + CALL H5Tget_member_offset_f(tid2, 2, off, error) + CALL check("H5Tget_member_offset_f", error, total_error) + CALL VERIFY("H5Tget_member_offset_f",INT(off),& + INT(H5OFFSETOF(C_LOC(wdata(1,1)),C_LOC(wdata(1,1)%c(1)(1:1)))), total_error) + + ! Check the 3rd field's datatype + CALL H5Tget_member_type_f(tid2, 2, mtid2, error) + CALL check("H5Tget_member_type_f", error, total_error) + + ! Get the 3rd field's class + CALL H5Tget_class_f(mtid2, mclass, error) + CALL check("H5Tget_class_f", error, total_error) + CALL VERIFY("H5Tget_class_f",mclass, H5T_ARRAY_F, total_error) + + ! Check the array rank + CALL h5tget_array_ndims_f(mtid2, ndims, error) + CALL check("h5tget_array_ndims_f", error, total_error) + CALL VERIFY("h5tget_array_ndims_f",ndims, ARRAY1_RANK, total_error) + + ! Get the array dimensions + CALL h5tget_array_dims_f(mtid2, rdims1, error) + CALL check("h5tget_array_dims_f", error, total_error) + + ! Check the array dimensions + DO i = 1, ndims + CALL VERIFY("h5tget_array_dims_f", INT(rdims1(i)), INT(tdims2(i)), total_error) + ENDDO + + ! Check the nested array's datatype + CALL H5Tget_super_f(mtid, tid3, error) + CALL check("H5Tget_super_f", error, total_error) + + CALL H5Tequal_f(tid3, H5T_NATIVE_REAL, flag, error) + CALL check("H5Tequal_f", error, total_error) + CALL verify("H5Tequal_f", flag, .TRUE., total_error) + + ! Check the nested array's datatype + CALL H5Tget_super_f(mtid2, tid3, error) + CALL check("H5Tget_super_f", error, total_error) + + CALL H5Tequal_f(tid3, atype_id, flag, error) + CALL check("H5Tequal_f", error, total_error) + CALL verify("H5Tequal_f", flag, .TRUE., total_error) + + ! Close the array's base type datatype + CALL h5tclose_f(tid3, error) + CALL check("h5tclose_f", error, total_error) + + ! Close the member datatype + CALL h5tclose_f(mtid,error) + CALL check("h5tclose_f", error, total_error) + + ! Close the member datatype + CALL h5tclose_f(mtid2,error) + CALL check("h5tclose_f", error, total_error) + + ! Close Compound Datatype + CALL h5tclose_f(tid2,error) + CALL check("h5tclose_f", error, total_error) + + ! READ dataset from disk + + f_ptr = c_null_ptr + f_ptr = C_LOC(rdata(1,1)) + CALL H5Dread_f(dataset, tid1, f_ptr, error) + CALL check("H5Dread_f", error, total_error) + + ! Compare data read in + DO i = 1, SPACE1_DIM1 + DO j = 1, ARRAY1_DIM1 + IF(wdata(i,j)%i.NE.rdata(i,j)%i)THEN + PRINT*, 'ERROR: Wrong integer data is read back by H5Dread_f ' + total_error = total_error + 1 + ENDIF + DO k = 1, ARRAY2_DIM1 + + IF(wdata(i,j)%f(k).NE.rdata(i,j)%f(k))THEN + PRINT*, 'ERROR: Wrong real array data is read back by H5Dread_f ' + total_error = total_error + 1 + ENDIF + IF(wdata(i,j)%c(k).NE.rdata(i,j)%c(k))THEN + PRINT*, 'ERROR: Wrong character array data is read back by H5Dread_f ' + total_error = total_error + 1 + ENDIF + ENDDO + ENDDO + ENDDO + + ! Close Datatype + CALL h5tclose_f(tid1,error) + CALL check("h5tclose_f", error, total_error) + + ! Close Dataset + CALL h5dclose_f(dataset, error) + CALL check("h5dclose_f", error, total_error) + + ! Close file + CALL h5fclose_f(fid1,error) + CALL check("h5fclose_f", error, total_error) + END SUBROUTINE test_array_compound_array +!!$ +!!$!*************************************************************** +!!$!** +!!$!** test_array_bkg(): Test basic array datatype code. +!!$!** Tests reading compound datatype with array fields and +!!$!** writing partial fields. +!!$!** +!!$!*************************************************************** +!!$ + SUBROUTINE test_array_bkg(total_error) + + IMPLICIT NONE + + INTEGER, INTENT(INOUT) :: total_error + + INTEGER, PARAMETER :: LENGTH = 5 + INTEGER, PARAMETER :: ALEN = 10 + INTEGER, PARAMETER :: RANK = 1 + INTEGER, PARAMETER :: NMAX = 100 + CHARACTER(LEN=17), PARAMETER :: FIELDNAME = "ArrayofStructures" + + INTEGER(hid_t) :: fid, array_dt + INTEGER(hid_t) :: space + INTEGER(hid_t) :: type + INTEGER(hid_t) :: dataset + + INTEGER(hsize_t), DIMENSION(1:1) :: dim =(/LENGTH/) + INTEGER(hsize_t), DIMENSION(1:1) :: dima =(/ALEN/) + + INTEGER :: i, j + INTEGER, DIMENSION(1:3) :: ndims = (/1,1,1/) + + TYPE CmpField_struct + INTEGER, DIMENSION(1:ALEN) :: a + REAL(KIND=sp), DIMENSION(1:ALEN) :: b + REAL(KIND=dp), DIMENSION(1:ALEN) :: c + ENDTYPE CmpField_struct + + TYPE(CmpField_struct), DIMENSION(1:LENGTH), TARGET :: cf + TYPE(CmpField_struct), DIMENSION(1:LENGTH), TARGET :: cfr + + TYPE CmpDTSinfo_struct + INTEGER :: nsubfields + CHARACTER(LEN=5), DIMENSION(1:nmax) :: name + INTEGER(size_t), DIMENSION(1:nmax) :: offset + INTEGER(hid_t), DIMENSION(1:nmax) :: datatype + END TYPE CmpDTSinfo_struct + + TYPE(CmpDTSinfo_struct) :: dtsinfo + + TYPE fld_t_struct + REAL(KIND=sp), DIMENSION(1:ALEN) :: b + END TYPE fld_t_struct + + INTEGER(SIZE_T) :: type_sizei ! Size of the integer datatype + INTEGER(SIZE_T) :: type_sizer ! Size of the real datatype + INTEGER(SIZE_T) :: type_sized ! Size of the double datatype + INTEGER(SIZE_T) :: sizeof_compound ! total size of compound + + TYPE(fld_t_struct), DIMENSION(1:LENGTH), TARGET :: fld + TYPE(fld_t_struct), DIMENSION(1:LENGTH), TARGET :: fldr + + CHARACTER(LEN=10), PARAMETER :: FILENAME = "tarray3.h5" + + INTEGER(HSIZE_T), ALLOCATABLE, DIMENSION(:) :: rdims1 ! Array dimensions for reading + INTEGER(HSIZE_T), ALLOCATABLE, DIMENSION(:) :: rdims ! Array dimensions for reading + + INTEGER :: error + TYPE(c_ptr) :: f_ptr + +! Initialize the data +! ------------------- + + DO i = 1, LENGTH + DO j = 1, ALEN + cf(i)%a(j) = 100*(i+1) + j + cf(i)%b(j) = (100.*(i+1) + 0.01*j) + cf(i)%c(j) = 100.*(i+1) + 0.02*j + ENDDO + ENDDO + + ! Set the number of data members + ! ------------------------------ + + dtsinfo%nsubfields = 3 + + ! Initialize the offsets + ! ----------------------- + CALL h5tget_size_f(H5T_NATIVE_INTEGER, type_sizei, error) + CALL check("h5tget_size_f", error, total_error) + IF(h5_sizeof(cf(1)%b(1)).EQ.4_size_t)THEN + CALL h5tget_size_f(H5T_NATIVE_REAL_C_FLOAT, type_sizer, error) + CALL check("h5tget_size_f", error, total_error) + ELSE IF(h5_sizeof(cf(1)%b(1)).EQ.8_size_t)THEN + CALL h5tget_size_f(H5T_NATIVE_REAL_C_DOUBLE, type_sizer, error) + CALL check("h5tget_size_f", error, total_error) + ENDIF + + CALL h5tget_size_f(H5T_NATIVE_DOUBLE, type_sized, error) + CALL check("h5tget_size_f", error, total_error) + + dtsinfo%offset(1) = H5OFFSETOF(C_LOC(cf(1)),C_LOC(cf(1)%a(1))) + dtsinfo%offset(2) = H5OFFSETOF(C_LOC(cf(1)),C_LOC(cf(1)%b(1))) + dtsinfo%offset(3) = H5OFFSETOF(C_LOC(cf(1)),C_LOC(cf(1)%c(1))) + + + ! Initialize the data type IDs + ! ---------------------------- + dtsinfo%datatype(1) = H5T_NATIVE_INTEGER; + dtsinfo%datatype(2) = H5T_NATIVE_REAL_C_FLOAT; + dtsinfo%datatype(3) = H5T_NATIVE_REAL_C_DOUBLE; + + + ! Initialize the names of data members + ! ------------------------------------ + + dtsinfo%name(1) = "One " + dtsinfo%name(2) = "Two " + dtsinfo%name(3) = "Three" + + ! Create file + ! ----------- + CALL h5fcreate_f(FILENAME,H5F_ACC_TRUNC_F,fid,error) + CALL check("h5fcreate_f", error, total_error) + + + ! Create data space + ! ----------------- + CALL h5screate_simple_f(RANK, dim, space, error) + CALL check("h5screate_simple_f", error, total_error) + + + ! Create the memory data type + ! --------------------------- + + CALL h5tcreate_f(H5T_COMPOUND_F, H5OFFSETOF(C_LOC(cf(1)), C_LOC(cf(2))), type, error) + CALL check("h5tcreate_f", error, total_error) + + ! Add members to the compound data type + ! -------------------------------------- + + DO i = 1, dtsinfo%nsubfields + CALL h5tarray_create_f(dtsinfo%datatype(i), ndims(i), dima, array_dt, error) + CALL check("h5tarray_create_f", error, total_error) + CALL H5Tinsert_f(type, dtsinfo%name(i), dtsinfo%offset(i), array_dt, error) + CALL check("h5tinsert_f", error, total_error) + + CALL h5tclose_f(array_dt,error) + CALL check("h5tclose_f", error, total_error) + ENDDO + + ! Create the dataset + ! ------------------ / + CALL h5dcreate_f(fid,FIELDNAME,type, space, dataset,error) + CALL check("h5dcreate_f", error, total_error) + + ! Write data to the dataset + ! ------------------------- + + ALLOCATE(rdims(1:2)) ! dummy not needed + + f_ptr = C_LOC(cf(1)) + + CALL h5dwrite_f(dataset, type, f_ptr, error ) + CALL check("h5dwrite_f", error, total_error) + + + ALLOCATE(rdims1(1:2)) ! dummy not needed + f_ptr = C_LOC(cfr(1)) + CALL H5Dread_f(dataset, type, f_ptr, error) + CALL check("H5Dread_f", error, total_error) + + ! Verify correct data + ! ------------------- + DO i = 1, LENGTH + DO j = 1, ALEN + IF( cf(i)%a(j) .NE. cfr(i)%a(j) )THEN + PRINT*, 'ERROR: Wrong integer data is read back by H5Dread_f ' + total_error = total_error + 1 + ENDIF + CALL VERIFY('ERROR: Wrong real data is read back by H5Dread_f ',cf(i)%b(j), cfr(i)%b(j), total_error) + CALL VERIFY('ERROR: Wrong double data is read back by H5Dread_f ',cf(i)%c(j), cfr(i)%c(j), total_error) + ENDDO + ENDDO + + + ! Release IDs + ! ----------- + CALL h5tclose_f(type,error) + CALL check("h5tclose_f", error, total_error) + CALL h5sclose_f(space,error) + CALL check("h5sclose_f", error, total_error) + CALL h5dclose_f(dataset, error) + CALL check("h5dclose_f", error, total_error) + CALL h5fclose_f(fid,error) + CALL check("h5fclose_f", error, total_error) + + !**************************** + ! Reopen the file and update + !**************************** + + CALL h5fopen_f (FILENAME, H5F_ACC_RDWR_F, fid, error) + CALL check("h5fopen_f", error, total_error) + + CALL h5dopen_f(fid, FIELDNAME, dataset, error) + CALL check("h5dopen_f", error, total_error) + + sizeof_compound = INT( type_sizer*ALEN, size_t) + + CALL h5tcreate_f(H5T_COMPOUND_F, sizeof_compound , type, error) + CALL check("h5tcreate_f", error, total_error) + + CALL h5tarray_create_f(H5T_NATIVE_REAL_C_FLOAT, 1, dima, array_dt, error) + CALL check("h5tarray_create_f", error, total_error) + + CALL h5tinsert_f(TYPE, "Two", 0_size_t, array_dt, error) + CALL check("h5tinsert_f", error, total_error) + + ! Initialize the data to overwrite + ! -------------------------------- + DO i = 1, LENGTH + DO j = 1, ALEN + fld(i)%b(j) = 1.313 + cf(i)%b(j) = fld(i)%b(j) + ENDDO + ENDDO + + f_ptr = C_LOC(fld(1)) + + CALL h5dwrite_f(dataset, TYPE, f_ptr, error ) + CALL check("h5dwrite_f", error, total_error) + + + ! Read just the field changed + + f_ptr = C_LOC(fldr(1)) + CALL H5Dread_f(dataset, TYPE, f_ptr, error) + CALL check("H5Dread_f", error, total_error) + + DO i = 1, LENGTH + DO j = 1, ALEN + CALL VERIFY('ERROR: Wrong real data is read back by H5Dread_f ',fld(i)%b(j), fldr(i)%b(j), total_error) + ENDDO + ENDDO + CALL h5tclose_f(TYPE,error) + CALL check("h5tclose_f", error, total_error) + CALL h5tclose_f(array_dt,error) + CALL check("h5tclose_f", error, total_error) + + CALL h5dget_type_f(dataset, type, error) + CALL check("h5dget_type_f", error, total_error) + + + ! Read the entire dataset again + + f_ptr = C_LOC(cfr(1)) + CALL H5Dread_f(dataset, TYPE, f_ptr, error) + CALL check("H5Dread_f", error, total_error) + + + ! Verify correct data + ! ------------------- + + DO i = 1, LENGTH + DO j = 1, ALEN + CALL VERIFY('ERROR: Wrong integer data is read back by H5Dread_f ',cf(i)%a(j), cfr(i)%a(j), total_error) + CALL VERIFY('ERROR: Wrong real data is read back by H5Dread_f ',cf(i)%b(j),cfr(i)%b(j), total_error) + CALL VERIFY('ERROR: Wrong double data is read back by H5Dread_f ',cf(i)%c(j), cfr(i)%c(j), total_error) + ENDDO + ENDDO + + CALL h5dclose_f(dataset, error) + CALL check("h5dclose_f", error, total_error) + + CALL h5tclose_f(type,error) + CALL check("h5tclose_f", error, total_error) + + CALL h5fclose_f(fid,error) + CALL check("h5fclose_f", error, total_error) + +!************************************************** +! Reopen the file and print out all the data again +!************************************************** + + CALL h5fopen_f (FILENAME, H5F_ACC_RDWR_F, fid, error) + CALL check("h5fopen_f", error, total_error) + + + CALL h5dopen_f(fid, FIELDNAME, dataset, error) + CALL check("h5dopen_f", error, total_error) + + + CALL h5dget_type_f(dataset, type, error) + CALL check("h5dget_type_f", error, total_error) + + + ! Reset the data to read in + ! ------------------------- + + DO i = 1, LENGTH + cfr(i)%a(:) = 0 + cfr(i)%b(:) = 0 + cfr(i)%c(:) = 0 + ENDDO + + f_ptr = C_LOC(cfr(1)) + CALL H5Dread_f(dataset, TYPE, f_ptr, error) + CALL check("H5Dread_f", error, total_error) + + ! Verify correct data + ! ------------------- + + DO i = 1, LENGTH + DO j = 1, ALEN + CALL VERIFY('ERROR: Wrong integer data is read back by H5Dread_f ',cf(i)%a(j), cfr(i)%a(j), total_error) + CALL VERIFY('ERROR: Wrong real data is read back by H5Dread_f ',cf(i)%b(j),cfr(i)%b(j), total_error) + CALL VERIFY('ERROR: Wrong double data is read back by H5Dread_f ',cf(i)%c(j), cfr(i)%c(j), total_error) + ENDDO + ENDDO + + CALL h5dclose_f(dataset, error) + CALL check("h5dclose_f", error, total_error) + + CALL h5tclose_f(type,error) + CALL check("h5tclose_f", error, total_error) + + CALL h5fclose_f(fid,error) + CALL check("h5fclose_f", error, total_error) + + END SUBROUTINE test_array_bkg + + SUBROUTINE test_h5kind_to_type(total_error) + + IMPLICIT NONE + + INTEGER, INTENT(INOUT) :: total_error + + INTEGER, PARAMETER :: int_kind_1 = SELECTED_INT_KIND(2) !should map to INTEGER*1 on most modern processors + INTEGER, PARAMETER :: int_kind_4 = SELECTED_INT_KIND(4) !should map to INTEGER*2 on most modern processors + INTEGER, PARAMETER :: int_kind_8 = SELECTED_INT_KIND(9) !should map to INTEGER*4 on most modern processors + INTEGER, PARAMETER :: int_kind_16 = SELECTED_INT_KIND(18) !should map to INTEGER*8 on most modern processors +#if H5_HAVE_Fortran_INTEGER_SIZEOF_16!=0 + INTEGER, PARAMETER :: int_kind_32 = SELECTED_INT_KIND(36) !should map to INTEGER*16 on most modern processors + INTEGER(int_kind_32), DIMENSION(1:4), TARGET :: dset_data_i32, data_out_i32 + INTEGER(HID_T) :: dset_id32 ! Dataset identifier + CHARACTER(LEN=6), PARAMETER :: dsetname16 = "dset16" ! Dataset name +#endif + INTEGER, PARAMETER :: real_kind_7 = C_FLOAT !should map to REAL*4 on most modern processors + INTEGER, PARAMETER :: real_kind_15 = C_DOUBLE !should map to REAL*8 on most modern processors + +! Check if C has quad precision extension +#if H5_HAVE_FLOAT128!=0 +! Check if Fortran supports quad precision +# if H5_PAC_FC_MAX_REAL_PRECISION > 26 + INTEGER, PARAMETER :: real_kind_31 = SELECTED_REAL_KIND(31) +# else + INTEGER, PARAMETER :: real_kind_31 = SELECTED_REAL_KIND(15,307) +# endif +#else +! Check if the default of long double is quad precision +# if H5_PAC_C_MAX_REAL_PRECISION > 26 +# if H5_PAC_FC_MAX_REAL_PRECISION > 26 + INTEGER, PARAMETER :: real_kind_31 = SELECTED_REAL_KIND(31) +# else + INTEGER, PARAMETER :: real_kind_31 = SELECTED_REAL_KIND(15,307) +# endif +# else + INTEGER, PARAMETER :: real_kind_31 = SELECTED_REAL_KIND(15,307) +# endif +#endif + REAL(real_kind_31), DIMENSION(1:4), TARGET :: dset_data_r31, data_out_r31 + INTEGER(HID_T) :: dset_idr16 ! Dataset identifier + CHARACTER(LEN=7), PARAMETER :: dsetnamer16 = "dsetr16" ! Dataset name + + CHARACTER(LEN=12), PARAMETER :: filename = "dsetf_F03.h5" ! File name + CHARACTER(LEN=5), PARAMETER :: dsetname1 = "dset1" ! Dataset name + CHARACTER(LEN=5), PARAMETER :: dsetname2 = "dset2" ! Dataset name + CHARACTER(LEN=5), PARAMETER :: dsetname4 = "dset4" ! Dataset name + CHARACTER(LEN=5), PARAMETER :: dsetname8 = "dset8" ! Dataset name + CHARACTER(LEN=6), PARAMETER :: dsetnamer = "dsetr" ! Dataset name + CHARACTER(LEN=6), PARAMETER :: dsetnamer4 = "dsetr4" ! Dataset name + CHARACTER(LEN=6), PARAMETER :: dsetnamer8 = "dsetr8" ! Dataset name + + INTEGER(HID_T) :: file_id ! File identifier + INTEGER(HID_T) :: dset_id1 ! Dataset identifier + INTEGER(HID_T) :: dset_id4 ! Dataset identifier + INTEGER(HID_T) :: dset_id8 ! Dataset identifier + INTEGER(HID_T) :: dset_id16 ! Dataset identifier + INTEGER(HID_T) :: dset_idr ! Dataset identifier + INTEGER(HID_T) :: dset_idr4 ! Dataset identifier + INTEGER(HID_T) :: dset_idr8 ! Dataset identifier + + INTEGER :: error ! Error flag + INTEGER :: i + +! Data buffers: + + INTEGER(int_kind_1), DIMENSION(1:4), TARGET :: dset_data_i1, data_out_i1 + INTEGER(int_kind_4), DIMENSION(1:4), TARGET :: dset_data_i4, data_out_i4 + INTEGER(int_kind_8), DIMENSION(1:4), TARGET :: dset_data_i8, data_out_i8 + INTEGER(int_kind_16), DIMENSION(1:4), TARGET :: dset_data_i16, data_out_i16 + + REAL, DIMENSION(1:4), TARGET :: dset_data_r, data_out_r + REAL(real_kind_7), DIMENSION(1:4), TARGET :: dset_data_r7, data_out_r7 + REAL(real_kind_15), DIMENSION(1:4), TARGET :: dset_data_r15, data_out_r15 + + INTEGER(HSIZE_T), DIMENSION(1:1) :: data_dims = (/4/) + INTEGER(HID_T) :: dspace_id ! Dataspace identifier + + TYPE(C_PTR) :: f_ptr + + ! + ! Initialize the dset_data array. + ! + DO i = 1, 4 + dset_data_i1(i) = HUGE(0_int_kind_1)-i + dset_data_i4(i) = HUGE(0_int_kind_4)-i + dset_data_i8(i) = HUGE(0_int_kind_8)-i + dset_data_i16(i) = HUGE(0_int_kind_16)-i +#if H5_HAVE_Fortran_INTEGER_SIZEOF_16!=0 + dset_data_i32(i) = HUGE(0_int_kind_32)-i +#endif + dset_data_r(i) = 4.0*ATAN(1.0)-REAL(i-1) + dset_data_r7(i) = 4.0_real_kind_7*ATAN(1.0_real_kind_7)-REAL(i-1,real_kind_7) + dset_data_r15(i) = 4.0_real_kind_15*ATAN(1.0_real_kind_15)-REAL(i-1,real_kind_15) + dset_data_r31(i) = 4.0_real_kind_31*ATAN(1.0_real_kind_31)-REAL(i-1,real_kind_31) + + END DO + + CALL h5fcreate_f(filename, H5F_ACC_TRUNC_F, file_id, error) + CALL check("h5fcreate_f",error, total_error) + ! + ! Create dataspaces for datasets + ! + CALL h5screate_simple_f(1, data_dims , dspace_id, error) + CALL check("h5screate_simple_f",error, total_error) + ! + ! Create the dataset. + ! + CALL H5Dcreate_f(file_id, dsetname1, h5kind_to_type(int_kind_1,H5_INTEGER_KIND), dspace_id, dset_id1, error) + CALL check("H5Dcreate_f",error, total_error) + CALL H5Dcreate_f(file_id, dsetname2, h5kind_to_type(int_kind_4,H5_INTEGER_KIND), dspace_id, dset_id4, error) + CALL check("H5Dcreate_f",error, total_error) + CALL H5Dcreate_f(file_id, dsetname4, h5kind_to_type(int_kind_8,H5_INTEGER_KIND), dspace_id, dset_id8, error) + CALL check("H5Dcreate_f",error, total_error) + CALL H5Dcreate_f(file_id, dsetname8, h5kind_to_type(int_kind_16,H5_INTEGER_KIND), dspace_id, dset_id16, error) + CALL check("H5Dcreate_f",error, total_error) +#if H5_HAVE_Fortran_INTEGER_SIZEOF_16!=0 + CALL H5Dcreate_f(file_id, dsetname16, h5kind_to_type(int_kind_32,H5_INTEGER_KIND), dspace_id, dset_id32, error) + CALL check("H5Dcreate_f",error, total_error) +#endif + CALL H5Dcreate_f(file_id, dsetnamer, H5T_NATIVE_REAL, dspace_id, dset_idr, error) + CALL check("H5Dcreate_f",error, total_error) + CALL H5Dcreate_f(file_id, dsetnamer4, h5kind_to_type(real_kind_7,H5_REAL_KIND), dspace_id, dset_idr4, error) + CALL check("H5Dcreate_f",error, total_error) + CALL H5Dcreate_f(file_id, dsetnamer8, h5kind_to_type(real_kind_15,H5_REAL_KIND), dspace_id, dset_idr8, error) + CALL check("H5Dcreate_f",error, total_error) +!#ifdef H5_HAVE_FLOAT128 + CALL H5Dcreate_f(file_id, dsetnamer16, h5kind_to_type(real_kind_31,H5_REAL_KIND), dspace_id, dset_idr16, error) + CALL check("H5Dcreate_f",error, total_error) +!#endif + ! + ! Write the dataset. + ! + f_ptr = C_LOC(dset_data_i1(1)) + CALL h5dwrite_f(dset_id1, h5kind_to_type(int_kind_1,H5_INTEGER_KIND), f_ptr, error) + CALL check("H5Dwrite_f",error, total_error) + f_ptr = C_LOC(dset_data_i4(1)) + CALL h5dwrite_f(dset_id4, h5kind_to_type(int_kind_4,H5_INTEGER_KIND), f_ptr, error) + CALL check("H5Dwrite_f",error, total_error) + f_ptr = C_LOC(dset_data_i8(1)) + CALL h5dwrite_f(dset_id8, h5kind_to_type(int_kind_8,H5_INTEGER_KIND), f_ptr, error) + CALL check("H5Dwrite_f",error, total_error) + f_ptr = C_LOC(dset_data_i16(1)) + CALL h5dwrite_f(dset_id16, h5kind_to_type(int_kind_16,H5_INTEGER_KIND), f_ptr, error) + CALL check("H5Dwrite_f",error, total_error) +#if H5_HAVE_Fortran_INTEGER_SIZEOF_16!=0 + f_ptr = C_LOC(dset_data_i32(1)) + CALL h5dwrite_f(dset_id32, h5kind_to_type(int_kind_32,H5_INTEGER_KIND), f_ptr, error) + CALL check("H5Dwrite_f",error, total_error) +#endif + f_ptr = C_LOC(dset_data_r(1)) + CALL h5dwrite_f(dset_idr, H5T_NATIVE_REAL, f_ptr, error) + CALL check("H5Dwrite_f",error, total_error) + f_ptr = C_LOC(dset_data_r7(1)) + CALL h5dwrite_f(dset_idr4, h5kind_to_type(real_kind_7,H5_REAL_KIND), f_ptr, error) + CALL check("H5Dwrite_f",error, total_error) + f_ptr = C_LOC(dset_data_r15(1)) + CALL h5dwrite_f(dset_idr8, h5kind_to_type(real_kind_15,H5_REAL_KIND), f_ptr, error) + CALL check("H5Dwrite_f",error, total_error) +!#ifdef H5_HAVE_FLOAT128 + f_ptr = C_LOC(dset_data_r31(1)) + CALL h5dwrite_f(dset_idr16, h5kind_to_type(real_kind_31,H5_REAL_KIND), f_ptr, error) + CALL check("H5Dwrite_f",error, total_error) +!#endif + ! + ! Close the file + ! + CALL h5fclose_f(file_id, error) + CALL check("h5fclose_f",error, total_error) + + ! Open the file + + CALL h5fopen_f(filename, H5F_ACC_RDONLY_F, file_id, error) + CALL check("h5fopen_f",error, total_error) + ! + ! Read the dataset. + ! + ! Read data back into an integer size that is larger then the original size used for + ! writing the data + f_ptr = C_LOC(data_out_i1) + CALL h5dread_f(dset_id1, h5kind_to_type(int_kind_1,H5_INTEGER_KIND), f_ptr, error) + CALL check("h5dread_f",error, total_error) + f_ptr = C_LOC(data_out_i4) + CALL h5dread_f(dset_id4, h5kind_to_type(int_kind_4,H5_INTEGER_KIND), f_ptr, error) + CALL check("h5dread_f",error, total_error) + f_ptr = C_LOC(data_out_i8) + CALL h5dread_f(dset_id8, h5kind_to_type(int_kind_8,H5_INTEGER_KIND), f_ptr, error) + CALL check("h5dread_f",error, total_error) + f_ptr = C_LOC(data_out_i16) + CALL h5dread_f(dset_id16, h5kind_to_type(int_kind_16,H5_INTEGER_KIND), f_ptr, error) + CALL check("h5dread_f",error, total_error) +#if H5_HAVE_Fortran_INTEGER_SIZEOF_16!=0 + f_ptr = C_LOC(data_out_i32) + CALL h5dread_f(dset_id32, h5kind_to_type(int_kind_32,H5_INTEGER_KIND), f_ptr, error) + CALL check("h5dread_f",error, total_error) +#endif + f_ptr = C_LOC(data_out_r) + CALL h5dread_f(dset_idr, H5T_NATIVE_REAL, f_ptr, error) + CALL check("h5dread_f",error, total_error) + f_ptr = C_LOC(data_out_r7) + CALL h5dread_f(dset_idr4, h5kind_to_type(real_kind_7,H5_REAL_KIND), f_ptr, error) + CALL check("h5dread_f",error, total_error) + f_ptr = C_LOC(data_out_r15) + CALL h5dread_f(dset_idr8, h5kind_to_type(real_kind_15,H5_REAL_KIND), f_ptr, error) + CALL check("h5dread_f",error, total_error) + f_ptr = C_LOC(data_out_r31) + CALL h5dread_f(dset_idr16, h5kind_to_type(real_kind_31,H5_REAL_KIND), f_ptr, error) + CALL check("h5dread_f",error, total_error) + DO i = 1, 4 + + CALL verify("h5kind_to_type",dset_data_i1(i),data_out_i1(i),total_error) + CALL verify("h5kind_to_type",dset_data_i4(i),data_out_i4(i),total_error) + CALL verify("h5kind_to_type",dset_data_i8(i),data_out_i8(i),total_error) + CALL verify("h5kind_to_type",dset_data_i16(i),data_out_i16(i),total_error) + +#if H5_HAVE_Fortran_INTEGER_SIZEOF_16!=0 + CALL verify("h5kind_to_type",dset_data_i32(i),data_out_i32(i),total_error) +#endif + CALL verify("h5kind_to_type",dset_data_r(i),data_out_r(i),total_error) + CALL verify("h5kind_to_type",dset_data_r7(i),data_out_r7(i),total_error) + CALL verify("h5kind_to_type",dset_data_r15(i),data_out_r15(i),total_error) + CALL verify("h5kind_to_type",dset_data_r31(i),data_out_r31(i),total_error) + END DO + + ! + ! Close the dataset. + ! + CALL h5dclose_f(dset_id1, error) + CALL check("h5dclose_f",error, total_error) + CALL h5dclose_f(dset_id4, error) + CALL check("h5dclose_f",error, total_error) + CALL h5dclose_f(dset_id8, error) + CALL check("h5dclose_f",error, total_error) + CALL h5dclose_f(dset_id16, error) + CALL check("h5dclose_f",error, total_error) + CALL h5dclose_f(dset_idr4, error) + CALL check("h5dclose_f",error, total_error) + CALL h5dclose_f(dset_idr8, error) + CALL check("h5dclose_f",error, total_error) + ! + ! Close the file. + ! + CALL h5fclose_f(file_id, error) + CALL check("h5fclose_f",error, total_error) + +END SUBROUTINE test_h5kind_to_type + +!************************************************************ +! +! This test reads and writes array datatypes +! to a dataset. The test first writes integers arrays of +! dimension ADIM0xADIM1 to a dataset with a dataspace of +! DIM0, then closes the file. Next, it reopens the file, +! reads back the data. +! +!************************************************************ +SUBROUTINE t_array(total_error) + + IMPLICIT NONE + + INTEGER, INTENT(INOUT) :: total_error + + CHARACTER(LEN=19), PARAMETER :: filename = "t_array_F03.h5" + CHARACTER(LEN=3) , PARAMETER :: dataset = "DS1" + INTEGER , PARAMETER :: dim0 = 4 + INTEGER , PARAMETER :: adim0 = 3 + INTEGER , PARAMETER :: adim1 = 5 + INTEGER(HID_T) :: file, filetype, memtype, space, dset ! Handles + INTEGER(HSIZE_T), DIMENSION(1:1) :: dims = (/dim0/) + INTEGER(HSIZE_T), DIMENSION(1:2) :: adims = (/adim0, adim1/) + INTEGER(HSIZE_T), DIMENSION(1:2) :: maxdims + INTEGER, DIMENSION(1:dim0, 1:adim0, 1:adim1), TARGET :: wdata ! Write buffer + INTEGER, DIMENSION(:,:,:), ALLOCATABLE, TARGET :: rdata ! Read buffer + INTEGER :: i, j, k + TYPE(C_PTR) :: f_ptr + INTEGER :: error ! Error flag + + ! + ! Initialize data. i is the element in the dataspace, j and k the + ! elements within the array datatype. + ! + DO i = 1, dim0 + DO j = 1, adim0 + DO k = 1, adim1 + wdata(i,j,k) = (i-1)*(j-1)-(j-1)*(k-1)+(i-1)*(k-1) + ENDDO + ENDDO + ENDDO + ! + ! Create a new file using the default properties. + ! + CALL h5fcreate_f(filename, H5F_ACC_TRUNC_F, file, error) + CALL check("h5fcreate_f",error, error) + ! + ! Create array datatypes for file and memory. + ! + CALL H5Tarray_create_f(INT(H5T_STD_I64LE, HID_T), 2, adims, filetype, error) + CALL check("H5Tarray_create_f",error, total_error) + CALL H5Tarray_create_f(H5T_NATIVE_INTEGER, 2, adims, memtype, error) + CALL check("H5Tarray_create_f",error, total_error) + ! + ! Create dataspace. Setting maximum size to be the current size. + ! + CALL h5screate_simple_f(1, dims, space, error) + CALL check("h5screate_simple_f",error, total_error) + ! + ! Create the dataset and write the array data to it. + ! + CALL h5dcreate_f(file, dataset, filetype, space, dset, error) + CALL check("h5dcreate_f",error, total_error) + f_ptr = C_LOC(wdata) + CALL h5dwrite_f(dset, memtype, f_ptr, error) + CALL check("h5dwrite_f",error, total_error) + ! + ! Close and release resources. + ! + CALL H5Dclose_f(dset, error) + CALL check("h5dclose_f",error, total_error) + CALL H5Sclose_f(space, error) + CALL check("h5sclose_f",error, total_error) + CALL H5Tclose_f(filetype, error) + CALL check("h5tclose_f",error, total_error) + CALL H5Tclose_f(memtype, error) + CALL check("h5tclose_f",error, total_error) + CALL H5Fclose_f(file, error) + CALL check("h5fclose_f",error, total_error) + ! + ! Now we begin the read section of this example. + ! + ! Open file, dataset, and attribute. + ! + CALL h5fopen_f(filename, H5F_ACC_RDONLY_F, file, error) + CALL check("h5fopen_f",error, total_error) + CALL h5dopen_f(file, dataset, dset, error) + CALL check("h5dopen_f",error, total_error) + ! + ! Get the datatype and its dimensions. + ! + CALL h5dget_type_f(dset, filetype, error) + CALL check("h5dget_type_f",error, error) + CALL H5Tget_array_dims_f(filetype, adims, error) + CALL check("h5dget_type_f",error, total_error) + CALL VERIFY("H5Tget_array_dims_f", adims(1), INT(adim0,hsize_t), total_error) + CALL VERIFY("H5Tget_array_dims_f", adims(2), INT(adim1,hsize_t), total_error) + ! + ! Get dataspace and allocate memory for read buffer. This is a + ! three dimensional attribute when the array datatype is included. + ! + CALL H5Dget_space_f(dset, space, error) + CALL check("H5Dget_space_f",error, error) + CALL H5Sget_simple_extent_dims_f(space, dims, maxdims, error) + CALL check("H5Sget_simple_extent_dims_f",error, total_error) + CALL VERIFY("H5Sget_simple_extent_dims_f", dims(1), INT(dim0,hsize_t), total_error) + + ALLOCATE(rdata(1:dims(1),1:adims(1),1:adims(2))) + ! + ! Create the memory datatype. + ! + CALL H5Tarray_create_f(H5T_NATIVE_INTEGER, 2, adims, memtype, error) + CALL check("H5Tarray_create_f",error, total_error) + ! + ! Read the data. + ! + + f_ptr = C_LOC(rdata) + CALL H5Dread_f(dset, memtype, f_ptr, error) + CALL check("H5Dread_f",error, total_error) + ! + ! Output the data to the screen. + ! + i_loop: DO i = 1, INT(dims(1)) + DO j=1, INT(adim0) + DO k = 1, INT(adim1) + CALL VERIFY("H5Sget_simple_extent_dims_f", rdata(i,j,k), wdata(i,j,k), total_error) + IF(total_error.NE.0) EXIT i_loop + ENDDO + ENDDO + ENDDO i_loop + ! + ! Close and release resources. + ! + DEALLOCATE(rdata) + CALL H5Dclose_f(dset, error) + CALL check("h5dclose_f",error, total_error) + CALL H5Sclose_f(space, error) + CALL check("h5sclose_f",error, total_error) + CALL H5Tclose_f(filetype, error) + CALL check("h5tclose_f",error, total_error) + CALL H5Tclose_f(memtype, error) + CALL check("h5tclose_f",error, total_error) + CALL H5Fclose_f(file, error) + CALL check("h5fclose_f",error, total_error) + +END SUBROUTINE t_array + +SUBROUTINE t_enum(total_error) + + IMPLICIT NONE + + INTEGER, INTENT(INOUT) :: total_error + + CHARACTER(LEN=19), PARAMETER :: filename = "t_enum_F03.h5" + CHARACTER(LEN=3) , PARAMETER :: dataset = "DS1" + INTEGER , PARAMETER :: dim0 = 4 + INTEGER , PARAMETER :: dim1 = 7 + INTEGER(HID_T) :: F_BASET ! File base type + INTEGER(HID_T) :: M_BASET ! Memory base type + INTEGER(SIZE_T) , PARAMETER :: NAME_BUF_SIZE = 16 + +! Enumerated type + INTEGER, PARAMETER :: SOLID=0, LIQUID=1, GAS=2, PLASMA=3 + + INTEGER(HID_T) :: file, filetype, memtype, space, dset ! Handles + + INTEGER(hsize_t), DIMENSION(1:2) :: dims = (/dim0, dim1/) + INTEGER, DIMENSION(1:dim0, 1:dim1), TARGET :: wdata ! Write buffer + INTEGER, DIMENSION(:,:), ALLOCATABLE, TARGET :: rdata ! Read buffer + INTEGER, DIMENSION(1:1), TARGET :: val + + CHARACTER(LEN=6), DIMENSION(1:4) :: & + names = (/"SOLID ", "LIQUID", "GAS ", "PLASMA"/) + CHARACTER(LEN=NAME_BUF_SIZE) :: name + INTEGER(HSIZE_T), DIMENSION(1:2) :: maxdims + INTEGER :: i, j, idx + TYPE(C_PTR) :: f_ptr + INTEGER :: error ! Error flag + ! + ! Initialize DATA. + ! + F_BASET = H5T_STD_I16BE ! File base type + M_BASET = H5T_NATIVE_INTEGER ! Memory base type + DO i = 1, dim0 + DO j = 1, dim1 + wdata(i,j) = MOD( (j-1)*(i-1), PLASMA+1) + ENDDO + ENDDO + ! + ! Create a new file using the default properties. + ! + CALL h5fcreate_f(filename, H5F_ACC_TRUNC_F, file, error) + CALL check("h5fcreate_f",error, total_error) + ! + ! Create the enumerated datatypes for file and memory. This + ! process is simplified IF native types are used for the file, + ! as only one type must be defined. + ! + CALL h5tenum_create_f(F_BASET, filetype, error) + CALL check("h5tenum_create_f",error, total_error) + + CALL h5tenum_create_f(M_BASET, memtype, error) + CALL check("h5tenum_create_f",error, total_error) + + DO i = SOLID, PLASMA + ! + ! Insert enumerated value for memtype. + ! + val(1) = i + f_ptr = C_LOC(val(1)) + CALL H5Tenum_insert_f(memtype, TRIM(names(i+1)), f_ptr, error) + CALL check("H5Tenum_insert_f", error, total_error) + ! + ! Insert enumerated value for filetype. We must first convert + ! the numerical value val to the base type of the destination. + ! + f_ptr = C_LOC(val(1)) + CALL H5Tconvert_f(M_BASET, F_BASET, INT(1,SIZE_T), f_ptr, error) + CALL check("H5Tconvert_f",error, total_error) + IF(i.GE.1)THEN ! test both F90 and F03 APIs + CALL H5Tenum_insert_f(filetype, TRIM(names(i+1)), f_ptr, error) + ELSE + CALL H5Tenum_insert_f(filetype, TRIM(names(i+1)), val(1), error) + ENDIF + CALL check("H5Tenum_insert_f",error, total_error) + ENDDO + ! + ! Create dataspace. Setting maximum size to be the current size. + ! + CALL h5screate_simple_f(2, dims, space, total_error) + CALL check("h5screate_simple_f",error, total_error) + ! + ! Create the dataset and write the enumerated data to it. + ! + CALL h5dcreate_f(file, dataset, filetype, space, dset, error) + CALL check("h5dcreate_f",error, total_error) + f_ptr = C_LOC(wdata(1,1)) + CALL h5dwrite_f(dset, memtype, f_ptr, error) + CALL check("h5dwrite_f",error, total_error) + ! + ! Close and release resources. + ! + CALL h5dclose_f(dset , error) + CALL check("h5dclose_f",error, total_error) + CALL h5sclose_f(space, error) + CALL check("h5sclose_f",error, total_error) + CALL h5tclose_f(filetype, error) + CALL check("h5tclose_f",error, total_error) + CALL h5fclose_f(file , error) + CALL check("h5fclose_f",error, total_error) + + ! + ! Now we begin the read section of this example. + ! + ! Open file and dataset. + ! + CALL h5fopen_f(filename, H5F_ACC_RDONLY_F, file, error) + CALL check("h5fopen_f",error, total_error) + CALL h5dopen_f (file, dataset, dset, error) + CALL check("h5dopen_f",error, total_error) + CALL h5dopen_f(file, dataset, dset, error) + CALL check("h5dopen_f",error, total_error) + ! + ! Get dataspace and allocate memory for read buffer. + ! + CALL h5dget_space_f(dset,space, error) + CALL check("H5Dget_space_f",error, total_error) + CALL h5sget_simple_extent_dims_f(space, dims, maxdims, error) + CALL check("H5Sget_simple_extent_dims_f",error, total_error) + CALL VERIFY("H5Sget_simple_extent_dims_f", dims(1), INT(dim0,hsize_t), total_error) + CALL VERIFY("H5Sget_simple_extent_dims_f", dims(2), INT(dim1,hsize_t), total_error) + + ALLOCATE(rdata(1:dims(1),1:dims(2))) + + ! + ! Read the data. + ! + f_ptr = C_LOC(rdata(1,1)) + CALL h5dread_f(dset, memtype, f_ptr, error) + CALL check("H5Dread_f",error, total_error) + + ! + ! Output the data to the screen. + ! + i_loop: DO i = 1, INT(dims(1)) + DO j = 1, INT(dims(2)) + ! + ! Get the name of the enumeration member. + ! + CALL h5tenum_nameof_f( memtype, rdata(i,j), NAME_BUF_SIZE, name, error) + CALL check("h5tenum_nameof_f",error, total_error) + idx = MOD( (j-1)*(i-1), PLASMA+1 ) + 1 + CALL verify("h5tenum_nameof_f",TRIM(name),TRIM(names(idx)), total_error) + IF(total_error.NE.0) EXIT i_loop + ENDDO + ENDDO i_loop + ! + ! Close and release resources. + ! + DEALLOCATE(rdata) + CALL h5dclose_f(dset , error) + CALL check("h5dclose_f",error, total_error) + CALL h5sclose_f(space, error) + CALL check("h5sclose_f",error, total_error) + CALL h5tclose_f(memtype, error) + CALL check("h5tclose_f",error, total_error) + CALL h5fclose_f(file , error) + CALL check("h5fclose_f",error, total_error) + +END SUBROUTINE t_enum + +SUBROUTINE t_bit(total_error) + + IMPLICIT NONE + + INTEGER, INTENT(INOUT) :: total_error + + CHARACTER(LEN=20), PARAMETER :: filename = "t_bit_F03.h5" + CHARACTER(LEN=3) , PARAMETER :: dataset = "DS1" + INTEGER , PARAMETER :: dim0 = 4 + INTEGER , PARAMETER :: dim1 = 7 + + INTEGER(HID_T) :: file, space, dset ! Handles + INTEGER(HSIZE_T), DIMENSION(1:2) :: dims = (/dim0, dim1/) + INTEGER(HSIZE_T), DIMENSION(1:2) :: maxdims + INTEGER(C_SIGNED_CHAR), DIMENSION(1:dim0, 1:dim1), TARGET :: wdata ! Write buffer + INTEGER(C_SIGNED_CHAR), DIMENSION(:,:), ALLOCATABLE, TARGET :: rdata ! Read buffer + INTEGER :: A, B, C, D + INTEGER :: Aw, Bw, Cw, Dw + INTEGER :: i, j + INTEGER, PARAMETER :: hex = Z'00000003' + TYPE(C_PTR) :: f_ptr + INTEGER :: error ! Error flag + ! + ! Initialize data. We will manually pack 4 2-bit integers into + ! each unsigned char data element. + ! + DO i = 0, dim0-1 + DO j = 0, dim1-1 + wdata(i+1,j+1) = 0 + wdata(i+1,j+1) = IOR( wdata(i+1,j+1), INT(IAND(i * j - j, hex),C_SIGNED_CHAR) ) ! Field "A" + wdata(i+1,j+1) = IOR( wdata(i+1,j+1), INT(ISHFT(IAND(i,hex),2),C_SIGNED_CHAR) ) ! Field "B" + wdata(i+1,j+1) = IOR( wdata(i+1,j+1), INT(ISHFT(IAND(j,hex),4),C_SIGNED_CHAR) ) ! Field "C" + wdata(i+1,j+1) = IOR( wdata(i+1,j+1), INT(ISHFT(IAND(i+j,hex),6),C_SIGNED_CHAR) ) ! Field "D" + ENDDO + ENDDO + ! + ! Create a new file using the default properties. + ! + CALL h5fcreate_f(filename, H5F_ACC_TRUNC_F, file, error) + CALL check("h5fcreate_f",error, total_error) + ! + ! Create dataspace. Setting maximum size to be the current size. + ! + CALL h5screate_simple_f(2, dims, space, error) + CALL check("h5screate_simple_f",error, total_error) + ! + ! Create the dataset and write the bitfield data to it. + ! + CALL H5Dcreate_f(file, dataset, H5T_STD_B8BE, space, dset, error) + CALL check("h5dcreate_f",error, total_error) + f_ptr = C_LOC(wdata(1,1)) + CALL H5Dwrite_f(dset, H5T_NATIVE_B8, f_ptr, error) + CALL check("h5dwrite_f",error, total_error) + ! + ! Close and release resources. + ! + CALL H5Dclose_f(dset, error) + CALL check("h5dclose_f",error, total_error) + CALL H5Sclose_f(space, error) + CALL check("h5sclose_f",error, total_error) + CALL H5Fclose_f(file, error) + CALL check("h5fclose_f",error, total_error) + ! + ! Now we begin the read section of this example. + ! + ! Open file, dataset. + ! + CALL h5fopen_f(filename, H5F_ACC_RDONLY_F, file, error) + CALL check("h5fopen_f",error, total_error) + CALL h5dopen_f(file, dataset, dset, error) + CALL check("h5dopen_f",error, total_error) + ! + ! Get dataspace and allocate memory for read buffer. + ! + CALL H5Dget_space_f(dset, space, error) + CALL check("H5Dget_space_f",error, total_error) + CALL H5Sget_simple_extent_dims_f(space, dims, maxdims, error) + CALL check("H5Sget_simple_extent_dims_f",error, total_error) + CALL VERIFY("H5Sget_simple_extent_dims_f", dims(1), INT(dim0,hsize_t), total_error) + CALL VERIFY("H5Sget_simple_extent_dims_f", dims(2), INT(dim1,hsize_t), total_error) + ALLOCATE(rdata(1:dims(1),1:dims(2))) + ! + ! Read the data. + ! + f_ptr = C_LOC(rdata) + CALL H5Dread_f(dset, H5T_NATIVE_B8, f_ptr, error) + CALL check("H5Dread_f",error, total_error) + ! + ! Output the data to the screen. + ! + i_loop: DO i = 1, INT(dims(1)) + DO j = 1, INT(dims(2)) + A = IAND(rdata(i,j), INT(hex,C_SIGNED_CHAR)) ! Retrieve field "A" + B = IAND(ISHFT(rdata(i,j),-2), INT(hex,C_SIGNED_CHAR)) ! Retrieve field "B" + C = IAND(ISHFT(rdata(i,j),-4), INT(hex,C_SIGNED_CHAR)) ! Retrieve field "C" + D = IAND(ISHFT(rdata(i,j),-6), INT(hex,C_SIGNED_CHAR)) ! Retrieve field "D" + + Aw = IAND(wdata(i,j), INT(hex,C_SIGNED_CHAR)) + Bw = IAND(ISHFT(wdata(i,j),-2), INT(hex,C_SIGNED_CHAR)) + Cw = IAND(ISHFT(wdata(i,j),-4), INT(hex,C_SIGNED_CHAR)) + Dw = IAND(ISHFT(wdata(i,j),-6), INT(hex,C_SIGNED_CHAR)) + + CALL VERIFY("bitfield", A, Aw, total_error) + CALL VERIFY("bitfield", B, Bw, total_error) + CALL VERIFY("bitfield", C, Cw, total_error) + CALL VERIFY("bitfield", D, Dw, total_error) + IF(total_error.NE.0) EXIT i_loop + ENDDO + ENDDO i_loop + ! + ! Close and release resources. + ! + DEALLOCATE(rdata) + CALL H5Dclose_f(dset, error) + CALL check("h5dclose_f",error, total_error) + CALL H5Sclose_f(space, error) + CALL check("h5sclose_f",error, total_error) + CALL H5Fclose_f(file, error) + CALL check("h5fclose_f",error, total_error) + +END SUBROUTINE t_bit + +SUBROUTINE t_opaque(total_error) + + IMPLICIT NONE + + INTEGER, INTENT(INOUT) :: total_error + CHARACTER(LEN=20), PARAMETER :: filename = "t_opaque_F03.h5" + CHARACTER(LEN=3) , PARAMETER :: dataset = "DS1" + INTEGER , PARAMETER :: dim0 = 4 + INTEGER(SIZE_T) , PARAMETER :: size = 7 + INTEGER(HID_T) :: file, space, dtype, dset ! Handles + INTEGER(size_t) :: len + INTEGER(hsize_t), DIMENSION(1:1) :: dims = (/DIM0/) + + CHARACTER(LEN=size), DIMENSION(1:dim0), TARGET :: wdata ! Write buffer + CHARACTER(LEN=size), DIMENSION(:), ALLOCATABLE, TARGET :: rdata ! Read buffer + CHARACTER(LEN=size-1) :: str = "OPAQUE" + + CHARACTER(LEN=14) :: tag_sm ! Test reading obaque tag into + CHARACTER(LEN=15) :: tag_exact ! buffers that are: to small, exact + CHARACTER(LEN=17) :: tag_big ! and to big. + + INTEGER :: taglen + INTEGER(HSIZE_T), DIMENSION(1:1) :: maxdims + INTEGER(hsize_t) :: i + CHARACTER(LEN=1) :: ichr + TYPE(C_PTR) :: f_ptr + INTEGER :: error + ! + ! Initialize data. + ! + DO i = 1, dim0 + WRITE(ichr,'(I1)') i-1 + wdata(i) = str//ichr + ENDDO + ! + ! Create a new file using the default properties. + ! + CALL h5fcreate_f(filename, H5F_ACC_TRUNC_F, file, error) + CALL check("h5fcreate_f",error, total_error) + ! + ! Create opaque datatype and set the tag to something appropriate. + ! For this example we will write and view the data as a character + ! array. + ! + CALL h5tcreate_f(h5T_OPAQUE_F, size, dtype, error) + CALL check("h5tcreate_f",error, total_error) + CALL h5tset_tag_f(dtype,"Character array",error) + CALL check("h5tset_tag_f",error, total_error) + ! + ! Create dataspace. Setting maximum size to be the current size. + ! + CALL h5screate_simple_f(1, dims, space, error) + CALL check("h5screate_simple_f",error, total_error) + ! + ! Create the dataset and write the opaque data to it. + ! + CALL h5dcreate_f(file, dataset, dtype, space, dset, error) + CALL check("h5dcreate_f",error, total_error) + f_ptr = C_LOC(wdata(1)(1:1)) + CALL h5dwrite_f(dset, dtype, f_ptr, error) + CALL check("h5dwrite_f",error, total_error) + ! + ! Close and release resources. + ! + CALL H5Dclose_f(dset, error) + CALL check("h5dclose_f",error, total_error) + CALL H5Sclose_f(space, error) + CALL check("h5sclose_f",error, total_error) + CALL H5Tclose_f(dtype, error) + CALL check("h5tclose_f",error, total_error) + CALL H5Fclose_f(file, error) + CALL check("h5fclose_f",error, total_error) + ! + ! Now we begin the read section of this example. + ! + ! Open file and dataset. + ! + CALL h5fopen_f(filename, H5F_ACC_RDONLY_F, file, error) + CALL check("h5fopen_f",error, total_error) + CALL h5dopen_f(file, dataset, dset, error) + CALL check("h5dopen_f",error, total_error) + ! + ! Get datatype and properties for the datatype. + ! + CALL h5dget_type_f(dset, dtype, error) + CALL check("h5dget_type_f",error, total_error) + CALL h5tget_size_f(dtype, len, error) + CALL check("h5tget_size_f",error, total_error) + + ! Next tests should return + ! opaque_tag = tag = "Character array" and the actual length = 15 + + ! Test reading into a string that is to small + CALL h5tget_tag_f(dtype, tag_sm, taglen, error) + CALL check("h5tget_tag_f",error, total_error) + CALL VERIFY("h5tget_tag_f", taglen, 15, total_error) + CALL verify("h5tget_tag_f",tag_sm,"Character arra", total_error) + + ! Test reading into a string that is exact + CALL h5tget_tag_f(dtype, tag_exact, taglen, error) + CALL check("h5tget_tag_f",error, total_error) + CALL VERIFY("h5tget_tag_f", taglen, 15, total_error) + CALL verify("h5tget_tag_f",tag_exact,"Character array", total_error) + + ! Test reading into a string that is to big + CALL h5tget_tag_f(dtype, tag_big, taglen, error) + CALL check("h5tget_tag_f",error, total_error) + CALL VERIFY("h5tget_tag_f", taglen, 15, total_error) + CALL verify("h5tget_tag_f",tag_big,"Character array ", total_error) + + ! + ! Get dataspace and allocate memory for read buffer. + ! + CALL h5dget_space_f(dset, space, error) + CALL check("H5Dget_space_f",error, total_error) + CALL h5sget_simple_extent_dims_f(space, dims, maxdims, error) + CALL check("H5Sget_simple_extent_dims_f",error, total_error) + CALL VERIFY("H5Sget_simple_extent_dims_f", dims(1), INT(dim0,hsize_t), total_error) + ALLOCATE(rdata(1:dims(1))) + ! + ! Read the data. + ! + f_ptr = C_LOC(rdata(1)(1:1)) + CALL h5dread_f(dset, dtype, f_ptr, error) + CALL check("H5Dread_f",error, total_error) + ! + DO i = 1, dims(1) + CALL verify("t_opaque",TRIM(rdata(i)),TRIM(wdata(i)), total_error) + ENDDO + ! + ! Close and release resources. + ! + DEALLOCATE(rdata) + CALL H5Dclose_f(dset, error) + CALL check("h5dclose_f",error, total_error) + CALL H5Sclose_f(space, error) + CALL check("h5sclose_f",error, total_error) + CALL H5Tclose_f(dtype, error) + CALL check("h5tclose_f",error, total_error) + CALL H5Fclose_f(file, error) + CALL check("h5fclose_f",error, total_error) + +END SUBROUTINE t_opaque + +SUBROUTINE t_objref(total_error) + + IMPLICIT NONE + + INTEGER, INTENT(INOUT) :: total_error + CHARACTER(LEN=20), PARAMETER :: filename = "t_objref_F03.h5" + CHARACTER(LEN=3) , PARAMETER :: dataset = "DS1" + INTEGER , PARAMETER :: dim0 = 2 + + INTEGER(HID_T) :: file, space, dset, obj ! Handles + INTEGER :: error + + INTEGER(hsize_t), DIMENSION(1:1) :: dims = (/dim0/) + TYPE(hobj_ref_t_f), DIMENSION(1:dim0), TARGET :: wdata ! Write buffer + TYPE(hobj_ref_t_f), DIMENSION(:), ALLOCATABLE, TARGET :: rdata ! Read buffer + INTEGER :: objtype + INTEGER(SIZE_T) :: name_size + CHARACTER(LEN=80) :: name + INTEGER(HSIZE_T), DIMENSION(1:1) :: maxdims + INTEGER :: i + TYPE(C_PTR) :: f_ptr + ! + ! Create a new file using the default properties. + ! + CALL h5fcreate_f(filename, H5F_ACC_TRUNC_F, file, error) + CALL check("h5fcreate_f",error, total_error) + ! + ! Create a dataset with a null dataspace. + ! + CALL h5screate_f(H5S_NULL_F,space,error) + CALL check("h5screate_f",error, total_error) + CALL h5dcreate_f(file, "DS2", H5T_STD_I32LE, space, obj, error) + CALL check("h5dcreate_f",error, total_error) + ! + CALL h5dclose_f(obj , error) + CALL check("h5dclose_f",error, total_error) + CALL h5sclose_f(space, error) + CALL check("h5sclose_f",error, total_error) + ! + ! Create a group. + ! + CALL h5gcreate_f(file, "G1", obj, error) + CALL check("h5gcreate_f",error, total_error) + CALL h5gclose_f(obj, error) + CALL check("h5gclose_f",error, total_error) + ! + ! Create references to the previously created objects. note, space_id + ! is not needed for object references. + ! + f_ptr = C_LOC(wdata(1)) + CALL H5Rcreate_f(file, "G1", H5R_OBJECT_F, f_ptr, error) + CALL check("H5Rcreate_f",error, total_error) + f_ptr = C_LOC(wdata(2)) + CALL H5Rcreate_f(file, "DS2", H5R_OBJECT_F, f_ptr, error) + CALL check("H5Rcreate_f",error, total_error) + ! + ! Create dataspace. Setting maximum size to be the current size. + ! + CALL h5screate_simple_f(1, dims, space, error) + CALL check("h5screate_simple_f",error, total_error) + ! + ! Create the dataset and write the object references to it. + ! + CALL h5dcreate_f(file, dataset, H5T_STD_REF_OBJ, space, dset, error) + CALL check("h5dcreate_f",error, total_error) + + f_ptr = C_LOC(wdata(1)) + CALL h5dwrite_f(dset, H5T_STD_REF_OBJ, f_ptr, error) + CALL check("h5dwrite_f",error, total_error) + ! + ! Close and release resources. + ! + CALL h5dclose_f(dset , error) + CALL check("h5dclose_f",error, total_error) + CALL h5sclose_f(space, error) + CALL check("h5sclose_f",error, total_error) + CALL h5fclose_f(file , error) + CALL check("h5fclose_f",error, total_error) + ! + ! Now we begin the read section of this example. + ! + ! Open file and dataset. + ! + CALL h5fopen_f(filename, H5F_ACC_RDONLY_F, file, error) + CALL check("h5fopen_f",error, total_error) + CALL h5dopen_f(file, dataset, dset, error) + CALL check("h5dopen_f",error, total_error) + ! + ! Get dataspace and allocate memory for read buffer. + ! + CALL h5dget_space_f(dset, space, error) + CALL check("H5Dget_space_f",error, total_error) + CALL h5sget_simple_extent_dims_f(space, dims, maxdims, error) + CALL check("H5Sget_simple_extent_dims_f",error, total_error) + CALL VERIFY("H5Sget_simple_extent_dims_f", dims(1), INT(dim0,hsize_t), total_error) + + ALLOCATE(rdata(1:maxdims(1))) + ! + ! Read the data. + ! + f_ptr = C_LOC(rdata(1)) + CALL h5dread_f( dset, H5T_STD_REF_OBJ, f_ptr, error) + CALL check("H5Dread_f",error, total_error) + ! + ! Output the data to the screen. + ! + DO i = 1, INT(maxdims(1)) + ! + ! Open the referenced object, get its name and type. + ! + f_ptr = C_LOC(rdata(i)) + CALL H5Rdereference_f(dset, H5R_OBJECT_F, f_ptr, obj, error) + CALL check("H5Rdereference_f",error, total_error) + CALL H5Rget_obj_type_f(dset, H5R_OBJECT_F, f_ptr, objtype, error) + CALL check("H5Rget_obj_type_f",error, total_error) + ! + ! Get the length of the name and name + ! + name(:) = ' ' ! initialize string to blanks + CALL H5Iget_name_f(obj, name, 80_size_t, name_size, error) + CALL check("H5Iget_name_f",error, total_error) + ! + ! Print the object type and close the object. + ! + IF(objtype.EQ.H5G_GROUP_F)THEN + CALL verify("t_objref", name(1:name_size),"/G1", total_error) + ELSE IF(objtype.EQ.H5G_DATASET_F)THEN + CALL verify("t_objref", name(1:name_size),"/DS2", total_error) + ELSE + total_error = total_error + 1 + ENDIF + CALL h5oclose_f(obj, error) + CALL check("h5oclose_f",error, total_error) + + END DO + ! + ! Close and release resources. + ! + DEALLOCATE(rdata) + CALL h5dclose_f(dset , error) + CALL check("h5dclose_f",error, total_error) + CALL h5sclose_f(space, error) + CALL check("h5sclose_f",error, total_error) + CALL h5fclose_f(file , error) + CALL check("h5fclose_f",error, total_error) + +END SUBROUTINE t_objref + + +SUBROUTINE t_regref(total_error) + + IMPLICIT NONE + + INTEGER, INTENT(INOUT) :: total_error + CHARACTER(LEN=22), PARAMETER :: filename = "t_regref_F03.h5" + CHARACTER(LEN=3) , PARAMETER :: dataset = "DS1" + CHARACTER(LEN=3) , PARAMETER :: dataset2 = "DS2" + INTEGER , PARAMETER :: dim0 = 2 + INTEGER , PARAMETER :: ds2dim0 = 16 + INTEGER , PARAMETER :: ds2dim1 = 3 + + INTEGER(HID_T) :: file, memspace, space, dset, dset2 ! Handles + INTEGER :: error + + INTEGER(HSIZE_T), DIMENSION(1:1) :: dims = (/dim0/) + INTEGER(HSIZE_T), DIMENSION(1:1) :: dims3 + INTEGER(HSIZE_T), DIMENSION(1:2) :: dims2 = (/ds2dim0,ds2dim1/) + + INTEGER(HSIZE_T), DIMENSION(1:2,1:4) :: coords = RESHAPE((/2,1,12,3,1,2,5,3/),(/2,4/)) + + INTEGER(HSIZE_T), DIMENSION(1:2) :: start=(/0,0/),stride=(/11,2/),count=(/2,2/), BLOCK=(/3,1/) + + INTEGER(HSIZE_T), DIMENSION(1:1) :: maxdims + INTEGER(hssize_t) :: npoints + TYPE(hdset_reg_ref_t_f03), DIMENSION(1:dim0), TARGET :: wdata ! Write buffer + TYPE(hdset_reg_ref_t_f03), DIMENSION(:), ALLOCATABLE, TARGET :: rdata ! Read buffer + + INTEGER(size_t) :: size + CHARACTER(LEN=1), DIMENSION(1:ds2dim0,1:ds2dim1), TARGET :: wdata2 + + CHARACTER(LEN=80),DIMENSION(1:1), TARGET :: rdata2 + CHARACTER(LEN=80) :: name + INTEGER(hsize_t) :: i + TYPE(C_PTR) :: f_ptr + CHARACTER(LEN=ds2dim0) :: chrvar + CHARACTER(LEN=20), DIMENSION(1:2) :: chrref_correct + + chrvar = "The quick brown " + READ(chrvar,'(16A1)') wdata2(1:16,1) + chrvar = "fox jumps over " + READ(chrvar,'(16A1)') wdata2(1:16,2) + chrvar = "the 5 lazy dogs " + READ(chrvar,'(16A1)') wdata2(1:16,3) + + chrref_correct(1) = 'hdf5' + chrref_correct(2) = 'Therowthedog' + + ! + ! Create a new file using the default properties. + ! + CALL h5fcreate_f(filename, H5F_ACC_TRUNC_F, file, error) + CALL check("h5fcreate_f",error, total_error) + ! + ! Create a dataset with character data. + ! + CALL h5screate_simple_f(2, dims2, space, error) + CALL check("h5screate_simple_f",error, total_error) + CALL h5dcreate_f(file,dataset2, H5T_STD_I8LE, space, dset2, error) + CALL check("h5dcreate_f",error, total_error) + f_ptr = C_LOC(wdata2(1,1)) + CALL h5dwrite_f(dset2, H5T_NATIVE_INTEGER_1, f_ptr, error) + CALL check("h5dwrite_f",error, total_error) + ! + ! Create reference to a list of elements in dset2. + ! + CALL h5sselect_elements_f(space, H5S_SELECT_SET_F, 2, INT(4,size_t), coords, error) + CALL check("h5sselect_elements_f",error, total_error) + f_ptr = C_LOC(wdata(1)) + CALL h5rcreate_f(file, DATASET2, H5R_DATASET_REGION_F, f_ptr, error, space) + CALL check("h5rcreate_f",error, total_error) + ! + ! Create reference to a hyperslab in dset2, close dataspace. + ! + CALL h5sselect_hyperslab_f (space, H5S_SELECT_SET_F, start, count, error, stride, block) + CALL check("h5sselect_hyperslab_f",error, total_error) + f_ptr = C_LOC(wdata(2)) + CALL h5rcreate_f(file, DATASET2, H5R_DATASET_REGION_F, f_ptr, error, space) + CALL check("h5rcreate_f",error, total_error) + + CALL h5sclose_f(space, error) + CALL check("h5sclose_f",error, total_error) + ! + ! Create dataspace. Setting maximum size to the current size. + ! + CALL h5screate_simple_f(1, dims, space, error) + CALL check("h5screate_simple_f",error, total_error) + + ! + ! Create the dataset and write the region references to it. + ! + CALL h5dcreate_f(file, dataset, H5T_STD_REF_DSETREG, space, dset, error) + CALL check("h5dcreate_f",error, total_error) + f_ptr = C_LOC(wdata(1)) + CALL h5dwrite_f(dset, H5T_STD_REF_DSETREG, f_ptr, error) + CALL check("h5dwrite_f",error, total_error) + ! + ! Close and release resources. + ! + CALL h5dclose_f(dset , error) + CALL check("h5dclose_f",error, total_error) + CALL h5dclose_f(dset2, error) + CALL check("h5dclose_f",error, total_error) + CALL h5sclose_f(space, error) + CALL check("h5sclose_f",error, total_error) + CALL h5fclose_f(file , error) + CALL check("h5fclose_f",error, total_error) + ! + ! Now we begin the read section of this example. + ! + ! + ! Open file and dataset. + ! + CALL h5fopen_f(filename, H5F_ACC_RDONLY_F, file, error) + CALL check("h5fopen_f",error, total_error) + CALL h5dopen_f(file, dataset, dset, error) + CALL check("h5dopen_f",error, total_error) + ! + ! Get dataspace and allocate memory for read buffer. + ! + CALL h5dget_space_f(dset, space, error) + CALL check("H5Dget_space_f",error, total_error) + CALL h5sget_simple_extent_dims_f(space, dims, maxdims, error) + CALL check("H5Sget_simple_extent_dims_f",error, total_error) + CALL VERIFY("H5Sget_simple_extent_dims_f", dims(1), INT(dim0,hsize_t), total_error) + ALLOCATE(rdata(1:dims(1))) + CALL h5sclose_f(space, error) + CALL check("h5sclose_f",error, total_error) + ! + ! Read the data. + ! + f_ptr = C_LOC(rdata(1)) + CALL h5dread_f( dset, H5T_STD_REF_DSETREG, f_ptr, error) + CALL check("H5Dread_f",error, total_error) + ! + ! Output the data to the screen. + ! + DO i = 1, dims(1) + + ! + ! Open the referenced object, retrieve its region as a + ! dataspace selection. + ! + f_ptr = C_LOC(rdata(i)) + CALL H5Rdereference_f(dset, H5R_DATASET_REGION_F, f_ptr, dset2, error) + CALL check("H5Rdereference_f",error, total_error) + + CALL H5Rget_region_f(dset, f_ptr, space, error) + CALL check("H5Rget_region_f",error, total_error) + + ! + ! Get the object's name + ! + name(:) = ' ' ! initialize string to blanks + CALL H5Iget_name_f(dset2, name, 80_size_t, size, error) + CALL check("H5Iget_name_f",error, total_error) + CALL VERIFY("H5Iget_name_f", INT(size), LEN_TRIM(name), total_error) + CALL verify("H5Iget_name_f",name(1:size),TRIM(name), total_error) + ! + ! Allocate space for the read buffer. + ! + CALL H5Sget_select_npoints_f(space, npoints, error) + CALL check("H5Sget_select_npoints_f",error, total_error) + CALL VERIFY("H5Sget_select_npoints_f", INT(npoints), LEN_TRIM(chrref_correct(i)), total_error) + + dims3(1) = npoints + ! + ! Read the dataset region. + ! + CALL h5screate_simple_f(1, dims3, memspace, error) + CALL check("h5screate_simple_f",error, total_error) + + f_ptr = C_LOC(rdata2(1)(1:1)) + CALL h5dread_f( dset2, H5T_NATIVE_INTEGER_1, f_ptr, error, memspace, space) + CALL check("H5Dread_f",error, total_error) + CALL verify("h5dread_f",rdata2(1)(1:npoints),TRIM(chrref_correct(i)), total_error) + + CALL H5Sclose_f(space, error) + CALL check("h5sclose_f",error, total_error) + CALL H5Sclose_f(memspace, error) + CALL check("h5sclose_f",error, total_error) + CALL H5Dclose_f(dset2, error) + CALL check("h5dclose_f",error, total_error) + + END DO + ! + ! Close and release resources. + ! + DEALLOCATE(rdata) + CALL H5Dclose_f(dset, error) + CALL check("h5dclose_f",error, total_error) + CALL H5Fclose_f(file, error) + CALL check("h5fclose_f",error, total_error) + +END SUBROUTINE t_regref + +SUBROUTINE t_vlen(total_error) + + IMPLICIT NONE + + INTEGER, INTENT(INOUT) :: total_error + CHARACTER(LEN=18), PARAMETER :: filename = "t_vlen_F03.h5" + CHARACTER(LEN=3) , PARAMETER :: dataset = "DS1" + INTEGER, PARAMETER :: LEN0 = 3 + INTEGER, PARAMETER :: LEN1 = 12 + INTEGER(hsize_t) :: dim0 + + INTEGER(HID_T) :: file, filetype, memtype, space, dset ! Handles + INTEGER :: error + INTEGER(HSIZE_T), DIMENSION(1:2) :: maxdims + INTEGER :: i, j + + ! vl data + TYPE vl + INTEGER, DIMENSION(:), POINTER :: DATA + END TYPE vl + TYPE(vl), DIMENSION(:), ALLOCATABLE, TARGET :: ptr + + + TYPE(hvl_t), DIMENSION(1:2), TARGET :: wdata ! Array of vlen structures + TYPE(hvl_t), DIMENSION(1:2), TARGET :: rdata ! Pointer to vlen structures + + INTEGER(hsize_t), DIMENSION(1:1) :: dims = (/2/) + INTEGER, DIMENSION(:), POINTER :: ptr_r + TYPE(C_PTR) :: f_ptr + + ! + ! Initialize variable-length data. wdata(1) is a countdown of + ! length LEN0, wdata(2) is a Fibonacci sequence of length LEN1. + ! + wdata(1)%len = LEN0 + wdata(2)%len = LEN1 + + ALLOCATE( ptr(1:2) ) + ALLOCATE( ptr(1)%data(1:wdata(1)%len) ) + ALLOCATE( ptr(2)%data(1:wdata(2)%len) ) + + DO i=1, wdata(1)%len + ptr(1)%data(i) = wdata(1)%len - i + 1 ! 3 2 1 + ENDDO + wdata(1)%p = C_LOC(ptr(1)%data(1)) + + ptr(2)%data(1:2) = 1 + DO i = 3, wdata(2)%len + ptr(2)%data(i) = ptr(2)%data(i-1) + ptr(2)%data(i-2) ! (1 1 2 3 5 8 etc.) + ENDDO + wdata(2)%p = C_LOC(ptr(2)%data(1)) + + ! + ! Create a new file using the default properties. + ! + CALL h5fcreate_f(filename, H5F_ACC_TRUNC_F, file, error) + CALL check("h5fcreate_f",error, total_error) + ! + ! Create variable-length datatype for file and memory. + ! + CALL H5Tvlen_create_f(H5T_STD_I32LE, filetype, error) + CALL check("H5Tvlen_create_f",error, total_error) + CALL H5Tvlen_create_f(H5T_NATIVE_INTEGER, memtype, error) + CALL check("H5Tvlen_create_f",error, total_error) + ! + ! Create dataspace. + ! + CALL h5screate_simple_f(1, dims, space, error) + CALL check("h5screate_simple_f",error, total_error) + ! + ! Create the dataset and write the variable-length data to it. + ! + CALL H5Dcreate_f(file, dataset, filetype, space, dset, error) + CALL check("h5dcreate_f",error, total_error) + + f_ptr = C_LOC(wdata(1)) + CALL h5dwrite_f(dset, memtype, f_ptr, error) + CALL check("h5dwrite_f",error, total_error) + ! + ! Close and release resources. Note the use of H5Dvlen_reclaim + ! removes the need to manually deallocate the previously allocated + ! data. + ! + + CALL h5dclose_f(dset , error) + CALL check("h5dclose_f",error, total_error) + CALL h5sclose_f(space, error) + CALL check("h5sclose_f",error, total_error) + CALL H5Tclose_f(filetype, error) + CALL check("h5tclose_f",error, total_error) + CALL H5Tclose_f(memtype, error) + CALL check("h5tclose_f",error, total_error) + CALL h5fclose_f(file , error) + CALL check("h5fclose_f",error, total_error) + + ! + ! Now we begin the read section of this example. + + ! + ! Open file and dataset. + ! + CALL h5fopen_f(filename, H5F_ACC_RDONLY_F, file, error) + CALL check("h5fopen_f",error, total_error) + CALL h5dopen_f(file, dataset, dset, error) + CALL check("h5dopen_f",error, total_error) + + ! + ! Get dataspace and allocate memory for array of vlen structures. + ! This does not actually allocate memory for the vlen data, that + ! will be done by the library. + ! + CALL H5Dget_space_f(dset, space, error) + CALL check("H5Dget_space_f",error, total_error) + dim0 = dims(1) + CALL H5Sget_simple_extent_dims_f(space, dims, maxdims, error) + CALL check("H5Sget_simple_extent_dims_f",error, total_error) + CALL VERIFY("H5Sget_simple_extent_dims_f", INT(dims(1)), INT(dim0), total_error) + + ! + ! Create the memory datatype. + ! + CALL H5Tvlen_create_f(H5T_NATIVE_INTEGER, memtype, error) + CALL check("H5Tvlen_create_f",error, total_error) + + ! + ! Read the data. + ! + f_ptr = C_LOC(rdata(1)) + CALL H5Dread_f(dset, memtype, f_ptr, error) + CALL check("H5Dread_f",error, total_error) + + DO i = 1, INT(dims(1)) + CALL c_f_pointer(rdata(i)%p, ptr_r, [rdata(i)%len] ) + DO j = 1, rdata(i)%len + CALL VERIFY("t_vlen", ptr_r(j), ptr(i)%data(j), total_error) + ENDDO + ENDDO + ! + ! Close and release resources. + ! + DEALLOCATE(ptr) + CALL h5dvlen_reclaim_f(memtype, space, H5P_DEFAULT_F, f_ptr, error) + CALL h5dclose_f(dset, error) + CALL check("h5dclose_f",error, total_error) + CALL h5sclose_f(space, error) + CALL check("h5sclose_f",error, total_error) + CALL H5Tclose_f(memtype, error) + CALL check("h5tclose_f",error, total_error) + CALL h5fclose_f(file, error) + CALL check("h5fclose_f",error, total_error) + +END SUBROUTINE t_vlen + + +SUBROUTINE t_vlstring(total_error) + + IMPLICIT NONE + + INTEGER, INTENT(INOUT) :: total_error + + CHARACTER(LEN=18), PARAMETER :: filename = "t_vlstring.h5" + CHARACTER(LEN=3) , PARAMETER :: dataset = "DS1" + + INTEGER(SIZE_T), PARAMETER :: dim0 = 4 + INTEGER(SIZE_T), PARAMETER :: sdim = 7 + INTEGER(HID_T) :: file, filetype, space, dset ! Handles + INTEGER :: error + INTEGER(HSIZE_T), DIMENSION(1:1) :: dims = (/dim0/) + INTEGER(HSIZE_T), DIMENSION(1:2) :: maxdims + + CHARACTER(LEN=sdim), DIMENSION(1:dim0), TARGET :: & + wdata = (/"Parting", "is such", "sweet ", "sorrow."/) ! Write buffer + CHARACTER(LEN=sdim), DIMENSION(:), ALLOCATABLE :: rdata ! Read buffer + INTEGER(HSIZE_T), DIMENSION(2) :: data_dims = (/sdim,dim0/) + INTEGER(SIZE_T), DIMENSION(4) :: str_len = (/7,7,5,7/) + INTEGER(hsize_t) :: i + + ! + ! Create a new file using the default properties. + ! + CALL h5fcreate_f(filename, H5F_ACC_TRUNC_F, file, error) + CALL check("h5fcreate_f",error, total_error) + ! + ! Create file and memory datatypes. For this example we will save + ! the strings as C variable length strings, H5T_STRING is defined + ! as a variable length string. + ! + CALL H5Tcopy_f(H5T_STRING, filetype, error) + CALL check("H5Tcopy_f",error, total_error) + CALL H5Tset_strpad_f(filetype, H5T_STR_NULLPAD_F, error) + CALL check("H5Tset_strpad_f",error, total_error) + ! + ! Create dataspace. + ! + CALL h5screate_simple_f(1, dims, space, error) + CALL check("h5screate_simple_f",error, total_error) + ! + ! Create the dataset and write the variable-length string data to + ! it. + ! + CALL h5dcreate_f(file, dataset, filetype, space, dset, error) + CALL check("h5dcreate_f",error, total_error) + + CALL h5dwrite_vl_f(dset, filetype, wdata, data_dims, str_len, error, space) + CALL check("h5dwrite_vl_f",error, total_error) + + ! + ! Close and release resources. + ! + CALL h5dclose_f(dset , error) + CALL check("h5dclose_f",error, total_error) + CALL h5sclose_f(space, error) + CALL check("h5sclose_f",error, total_error) + CALL H5Tclose_f(filetype, error) + CALL check("h5tclose_f",error, total_error) + CALL h5fclose_f(file , error) + CALL check("h5fclose_f",error, total_error) + + ! + ! Now we begin the read section of this example. + ! + ! + ! Open file and dataset. + ! + CALL h5fopen_f(filename, H5F_ACC_RDONLY_F, file, error) + CALL check("h5fopen_f",error, total_error) + CALL h5dopen_f(file, dataset, dset, error) + CALL check("h5dopen_f",error, total_error) + ! + ! Get the datatype. + ! + CALL H5Dget_type_f(dset, filetype, error) + CALL check("H5Dget_type_f",error, total_error) + ! + ! Get dataspace and allocate memory for read buffer. + ! + CALL H5Dget_space_f(dset, space, error) + CALL check("H5Dget_space_f",error, total_error) + CALL H5Sget_simple_extent_dims_f(space, dims, maxdims, error) + CALL check("H5Sget_simple_extent_dims_f",error, total_error) + CALL VERIFY("H5Sget_simple_extent_dims_f", INT(dims(1)), INT(dim0), total_error) + + ALLOCATE(rdata(1:dims(1))) + + ! + ! Read the data. + ! + CALL h5dread_vl_f(dset, filetype, rdata, data_dims, str_len, error, space) + CALL check("H5Dread_vl_f",error, total_error) + + ! + ! Output the data to the screen. + ! + DO i = 1, dims(1) + CALL verify("h5dopen_f",TRIM(rdata(i)),TRIM(wdata(i)) , total_error) + END DO + + DEALLOCATE(rdata) + CALL h5dclose_f(dset, error) + CALL check("h5dclose_f",error, total_error) + CALL h5sclose_f(space, error) + CALL check("h5sclose_f",error, total_error) + CALL H5Tclose_f(filetype, error) + CALL check("h5tclose_f",error, total_error) + CALL h5fclose_f(file , error) + CALL check("h5fclose_f",error, total_error) + +END SUBROUTINE t_vlstring + +SUBROUTINE t_vlstring_readwrite(total_error) + +! test writing and reading vl string using h5dread_f and h5dwrite_f, C_LOC and C_F_POINTER + + IMPLICIT NONE + + INTEGER, INTENT(INOUT) :: total_error + + CHARACTER(LEN=19), PARAMETER :: filename = "t_vlstringrw_F03.h5" + CHARACTER(LEN=3) , PARAMETER :: dataset = "DS1" + CHARACTER(LEN=3) , PARAMETER :: dataset2D = "DS2" + + INTEGER(HSIZE_T) , PARAMETER :: dim0 = 4 + INTEGER(HSIZE_T) , PARAMETER :: dim1 = 2 + INTEGER(HID_T) :: file, filetype, space, dset ! Handles + INTEGER(HSIZE_T), DIMENSION(1:1) :: dims = (/dim0/) + INTEGER(HSIZE_T), DIMENSION(1:2) :: dims2D = (/dim1,dim0/) + INTEGER(HSIZE_T), DIMENSION(1:2) :: maxdims + + TYPE(C_PTR), DIMENSION(1:dim0), TARGET :: wdata + CHARACTER(len=7, KIND=c_char), DIMENSION(1:1), TARGET :: A = "123456"//C_NULL_CHAR + CHARACTER(len=5, KIND=c_char), DIMENSION(1:1), TARGET :: B = "7890"//C_NULL_CHAR + CHARACTER(len=4, KIND=c_char), DIMENSION(1:1), TARGET :: C = "abc"//C_NULL_CHAR + CHARACTER(len=3, KIND=c_char), DIMENSION(1:1), TARGET :: D = "df"//C_NULL_CHAR + + TYPE(C_PTR), DIMENSION(1:dim1,1:dim0), TARGET :: wdata2D + + CHARACTER(len=7, KIND=c_char), DIMENSION(1:1), TARGET :: A11 = "A(1,1)"//C_NULL_CHAR + CHARACTER(len=4, KIND=c_char), DIMENSION(1:1), TARGET :: A12 = "A12"//C_NULL_CHAR + CHARACTER(len=5, KIND=c_char), DIMENSION(1:1), TARGET :: A13 = "A_13"//C_NULL_CHAR + CHARACTER(len=8, KIND=c_char), DIMENSION(1:1), TARGET :: A14 = "A_{1,4}"//C_NULL_CHAR + CHARACTER(len=8, KIND=c_char), DIMENSION(1:1), TARGET :: A21 = "A_{2,1}"//C_NULL_CHAR + CHARACTER(len=5, KIND=c_char), DIMENSION(1:1), TARGET :: A22 = "A_22"//C_NULL_CHAR + CHARACTER(len=4, KIND=c_char), DIMENSION(1:1), TARGET :: A23 = "A23"//C_NULL_CHAR + CHARACTER(len=7, KIND=c_char), DIMENSION(1:1), TARGET :: A24 = "A(2,4)"//C_NULL_CHAR + + TYPE(C_PTR), DIMENSION(:), ALLOCATABLE, TARGET :: rdata ! Read buffer + TYPE(C_PTR), DIMENSION(:,:), ALLOCATABLE, TARGET :: rdata2D ! Read 2D buffer + CHARACTER(len=8, kind=c_char), POINTER :: data ! A pointer to a Fortran string + CHARACTER(len=8, kind=c_char), DIMENSION(1:4) :: data_w ! A pointer to a Fortran string + CHARACTER(len=8, kind=c_char), DIMENSION(1:dim1,1:dim0) :: data2D_w ! A pointer to a Fortran string + TYPE(C_PTR) :: f_ptr + INTEGER(hsize_t) :: i, j + INTEGER :: len + INTEGER :: error + + ! Initialize array of C pointers + + wdata(1) = C_LOC(A(1)(1:1)) + wdata(2) = C_LOC(B(1)(1:1)) + wdata(3) = C_LOC(C(1)(1:1)) + wdata(4) = C_LOC(D(1)(1:1)) + + data_w(1) = A(1) + data_w(2) = B(1) + data_w(3) = C(1) + data_w(4) = D(1) + + wdata2D(1,1) = C_LOC(A11(1)(1:1)) + wdata2D(1,2) = C_LOC(A12(1)(1:1)) + wdata2D(1,3) = C_LOC(A13(1)(1:1)) + wdata2D(1,4) = C_LOC(A14(1)(1:1)) + wdata2D(2,1) = C_LOC(A21(1)(1:1)) + wdata2D(2,2) = C_LOC(A22(1)(1:1)) + wdata2D(2,3) = C_LOC(A23(1)(1:1)) + wdata2D(2,4) = C_LOC(A24(1)(1:1)) + + data2D_w(1,1) = A11(1) + data2D_w(1,2) = A12(1) + data2D_w(1,3) = A13(1) + data2D_w(1,4) = A14(1) + data2D_w(2,1) = A21(1) + data2D_w(2,2) = A22(1) + data2D_w(2,3) = A23(1) + data2D_w(2,4) = A24(1) + + ! + ! Create a new file using the default properties. + ! + CALL h5fcreate_f(filename, H5F_ACC_TRUNC_F, file, error) + CALL check("h5fcreate_f",error, total_error) + ! + ! Create file and memory datatypes. For this test we will save + ! the strings as C variable length strings, H5T_STRING is defined + ! as a variable length string. + ! + CALL H5Tcopy_f(H5T_STRING, filetype, error) + CALL check("H5Tcopy_f",error, total_error) + ! + ! Create dataspace. + ! + CALL h5screate_simple_f(1, dims, space, error) + CALL check("h5screate_simple_f",error, total_error) + ! + ! Create the dataset and write the variable-length string data to + ! it. + ! + CALL h5dcreate_f(file, dataset, filetype, space, dset, error) + CALL check("h5dcreate_f",error, total_error) + + f_ptr = C_LOC(wdata(1)) + CALL h5dwrite_f(dset, filetype, f_ptr, error) + CALL check("h5dwrite_f",error, total_error) + + ! + ! Close and release resources. + ! + CALL h5dclose_f(dset , error) + CALL check("h5dclose_f",error, total_error) + CALL h5sclose_f(space, error) + CALL check("h5sclose_f",error, total_error) + + ! + ! Create dataspace. + ! + CALL h5screate_simple_f(2, dims2D, space, error) + CALL check("h5screate_simple_f",error, total_error) + ! + ! Create the dataset and write the variable-length string data to + ! it. + ! + CALL h5dcreate_f(file, dataset2D, filetype, space, dset, error) + CALL check("h5dcreate_f",error, total_error) + + f_ptr = C_LOC(wdata2D(1,1)) + CALL h5dwrite_f(dset, filetype, f_ptr, error) + CALL check("h5dwrite_f",error, total_error) + + ! + ! Close and release resources. + ! + CALL h5dclose_f(dset , error) + CALL check("h5dclose_f",error, total_error) + CALL h5sclose_f(space, error) + CALL check("h5sclose_f",error, total_error) + + CALL H5Tclose_f(filetype, error) + CALL check("h5tclose_f",error, total_error) + CALL h5fclose_f(file , error) + CALL check("h5fclose_f",error, total_error) + + ! + ! Now we begin the read section of this test. + ! + ! + ! Open file and dataset. + ! + CALL h5fopen_f(filename, H5F_ACC_RDONLY_F, file, error) + CALL check("h5fopen_f",error, total_error) + CALL h5dopen_f(file, dataset, dset, error) + CALL check("h5dopen_f",error, total_error) + ! + ! Get the datatype. + ! + CALL H5Dget_type_f(dset, filetype, error) + CALL check("H5Dget_type_f",error, total_error) + ! + ! Get dataspace and allocate memory for read buffer. + ! + CALL H5Dget_space_f(dset, space, error) + CALL check("H5Dget_space_f",error, total_error) + + CALL H5Sget_simple_extent_dims_f(space, dims, maxdims, error) + CALL check("H5Sget_simple_extent_dims_f",error, total_error) + ALLOCATE(rdata(1:dims(1))) + ! + ! Read the data. + ! + + f_ptr = C_LOC(rdata(1)) + CALL h5dread_f(dset, H5T_STRING, f_ptr, error) + CALL check("H5Dread_f",error, total_error) + + ! + ! Check the data. + ! + DO i = 1, dims(1) + CALL C_F_POINTER(rdata(i), data) + len = 0 + DO + IF(DATA(len+1:len+1).EQ.C_NULL_CHAR.OR.len.GE.8) EXIT + len = len + 1 + ENDDO + CALL verify("h5dread_f",data(1:len), data_w(i)(1:len), total_error) + END DO + + DEALLOCATE(rdata) + CALL h5dclose_f(dset , error) + CALL check("h5dclose_f",error, total_error) + CALL h5sclose_f(space, error) + CALL check("h5sclose_f",error, total_error) + ! + ! Test reading in 2D dataset + ! + CALL h5dopen_f(file, dataset2D, dset, error) + CALL check("h5dopen_f",error, total_error) + ! + ! Get the datatype. + ! + CALL H5Dget_type_f(dset, filetype, error) + CALL check("H5Dget_type_f",error, total_error) + ! + ! Get dataspace and allocate memory for read buffer. + ! + CALL H5Dget_space_f(dset, space, error) + CALL check("H5Dget_space_f",error, total_error) + + + CALL H5Sget_simple_extent_dims_f(space, dims2D, maxdims, error) + CALL check("H5Sget_simple_extent_dims_f",error, total_error) + ALLOCATE(rdata2D(1:dims2D(1),1:dims2D(2))) + + ! + ! Read the data. + ! + + f_ptr = C_LOC(rdata2D(1,1)) + CALL h5dread_f(dset, H5T_STRING, f_ptr, error) + CALL check("H5Dread_f",error, total_error) + + ! + ! Check the data. + ! + DO i = 1, dims2D(1) + DO j = 1, dims2D(2) + CALL C_F_POINTER(rdata2D(i,j), DATA) + len = 0 + DO + IF(DATA(len+1:len+1).EQ.C_NULL_CHAR.OR.len.GE.8) EXIT + len = len + 1 + ENDDO + CALL verify("h5dread_f",DATA(1:len), data2D_w(i,j)(1:len), total_error) + ENDDO + END DO + + DEALLOCATE(rdata2D) + CALL h5dclose_f(dset , error) + CALL check("h5dclose_f",error, total_error) + CALL h5sclose_f(space, error) + CALL check("h5sclose_f",error, total_error) + + CALL H5Tclose_f(filetype, error) + CALL check("h5tclose_f",error, total_error) + CALL h5fclose_f(file , error) + CALL check("h5fclose_f",error, total_error) + +END SUBROUTINE t_vlstring_readwrite + + +SUBROUTINE t_string(total_error) + + IMPLICIT NONE + + INTEGER, INTENT(INOUT) :: total_error + + CHARACTER(LEN=20), PARAMETER :: filename = "t_string_F03.h5" + CHARACTER(LEN=3) , PARAMETER :: dataset = "DS1" + INTEGER , PARAMETER :: dim0 = 4 + INTEGER(SIZE_T) , PARAMETER :: sdim = 8 + + INTEGER(HID_T) :: file, filetype, memtype, space, dset ! Handles + INTEGER :: error + + INTEGER(HSIZE_T), DIMENSION(1:1) :: dims = (/dim0/) + INTEGER(HSIZE_T), DIMENSION(1:1) :: maxdims + + CHARACTER(LEN=sdim), DIMENSION(1:dim0), TARGET :: & + wdata = (/"Parting", "is such", "sweet ", "sorrow."/) + CHARACTER(LEN=sdim), DIMENSION(:), ALLOCATABLE, TARGET :: rdata + INTEGER(hsize_t) :: i + INTEGER(SIZE_T) :: size + TYPE(C_PTR) :: f_ptr + ! + ! Create a new file using the default properties. + ! + CALL h5fcreate_f(filename, H5F_ACC_TRUNC_F, file, error) + CALL check("h5fcreate_f",error, total_error) + ! + ! Create file datatypes. For this example we will save + ! the strings as FORTRAN strings + ! + CALL H5Tcopy_f(H5T_FORTRAN_S1, filetype, error) + CALL check("H5Tcopy_f",error, total_error) + CALL H5Tset_size_f(filetype, sdim, error) + CALL check("H5Tset_size_f",error, total_error) + ! + ! Create dataspace. + ! + CALL h5screate_simple_f(1, dims, space, error) + CALL check("h5screate_simple_f",error, total_error) + ! + ! Create the dataset and write the string data to it. + ! + CALL h5dcreate_f(file, dataset, filetype, space, dset, error) + CALL check("h5dcreate_f",error, total_error) + + f_ptr = C_LOC(wdata(1)(1:1)) + CALL H5Dwrite_f(dset, filetype, f_ptr, error) + CALL check("H5Dwrite_f",error, total_error) + ! + ! Close and release resources. + ! + CALL h5dclose_f(dset , error) + CALL check("h5dclose_f",error, total_error) + CALL h5sclose_f(space, error) + CALL check("h5sclose_f",error, total_error) + CALL H5Tclose_f(filetype, error) + CALL check("h5tclose_f",error, total_error) + CALL h5fclose_f(file , error) + CALL check("h5fclose_f",error, total_error) + ! + ! Now we begin the read section of this example. + ! + ! Open file and dataset. + ! + CALL h5fopen_f(filename, H5F_ACC_RDONLY_F, file, error) + CALL check("h5fopen_f",error, total_error) + CALL h5dopen_f(file, dataset, dset, error) + CALL check("h5dopen_f",error, total_error) + ! + ! Get the datatype and its size. + ! + CALL H5Dget_type_f(dset, filetype, error) + CALL check("H5Dget_type_f",error, total_error) + CALL H5Tget_size_f(filetype, size, error) + CALL check("H5Tget_size_f",error, total_error) + CALL VERIFY("H5Tget_size_f", INT(size), INT(sdim), total_error) + ! + ! Get dataspace. + ! + CALL H5Dget_space_f(dset, space, error) + CALL check("H5Dget_space_f",error, total_error) + CALL H5Sget_simple_extent_dims_f(space, dims, maxdims, error) + CALL check("H5Sget_simple_extent_dims_f",error, total_error) + CALL VERIFY("H5Sget_simple_extent_dims_f", dims(1), INT(dim0,hsize_t), total_error) + + ALLOCATE(rdata(1:dims(1))) + ! + ! Create the memory datatype. + ! + CALL H5Tcopy_f(H5T_FORTRAN_S1, memtype, error) + CALL check("H5Tcopy_f",error, total_error) + CALL H5Tset_size_f(memtype, sdim, error) + CALL check("H5Tset_size_f",error, total_error) + ! + ! Read the data. + ! + f_ptr = C_LOC(rdata(1)(1:1)) + CALL H5Dread_f(dset, memtype, f_ptr, error, space) + CALL check("H5Dread_f",error, total_error) + + DO i = 1, dims(1) + CALL verify("h5dread_f",TRIM(rdata(i)),TRIM(wdata(i)) , total_error) + END DO + + DEALLOCATE(rdata) + + ! + ! Close and release resources. + ! + CALL H5Dclose_f(dset, error) + CALL check("h5dclose_f",error, total_error) + CALL H5Sclose_f(space, error) + CALL check("h5sclose_f",error, total_error) + CALL H5Tclose_f(memtype, error) + CALL check("h5tclose_f",error, total_error) + CALL H5Fclose_f(file, error) + CALL check("h5fclose_f",error, total_error) + + +END SUBROUTINE t_string + +SUBROUTINE vl_test_special_char(total_error) + + IMPLICIT NONE + +! INTERFACE +! SUBROUTINE setup_buffer(data_in, line_lengths, char_type) +! USE HDF5 +! USE ISO_C_BINDING +! IMPLICIT NONE +! CHARACTER(len=*), DIMENSION(:) :: data_in +! INTEGER(size_t), DIMENSION(:) :: line_lengths +! CHARACTER(KIND=C_CHAR,LEN=*) :: char_type +! END SUBROUTINE setup_buffer +! END INTERFACE + + INTEGER, INTENT(OUT) :: total_error + + CHARACTER(LEN=16), PARAMETER :: filename = "t_controlchar.h5" + INTEGER, PARAMETER :: line_length = 10 + INTEGER(hid_t) :: file + INTEGER(hid_t) :: dataset0 + CHARACTER(len=line_length), DIMENSION(1:100) :: data_in + CHARACTER(len=line_length), DIMENSION(1:100) :: data_out + INTEGER(size_t), DIMENSION(1:100) :: line_lengths + INTEGER(hid_t) :: string_id, space, dcpl + INTEGER(hsize_t), DIMENSION(1:1) :: dims = (/0/) + INTEGER(hsize_t), DIMENSION(1:1) :: max_dims = (/0/) + INTEGER(hsize_t), DIMENSION(1:2) :: data_dims = (/0,0/) + INTEGER(hsize_t), DIMENSION(1:1) :: chunk =(/10/) + INTEGER, PARAMETER :: ncontrolchar = 7 + CHARACTER(KIND=C_CHAR,LEN=1), DIMENSION(1:ncontrolchar) :: controlchar = & + (/C_ALERT, C_BACKSPACE,C_CARRIAGE_RETURN, C_FORM_FEED,C_HORIZONTAL_TAB,C_VERTICAL_TAB, C_NEW_LINE/) + INTEGER :: i, j, n, error + n = 8 + ! + ! Create a new file using the default properties. + ! + CALL h5fcreate_f(filename, H5F_ACC_TRUNC_F, file, error) + CALL check("h5fcreate_f",error, total_error) + + max_dims = (/H5S_UNLIMITED_F/) + + ! + ! Create the memory datatype. + ! + CALL h5tcopy_f(h5t_string, string_id, error) + CALL check("h5tcopy_f", error, total_error) + CALL h5tset_strpad_f(string_id, h5t_str_nullpad_f, error) + CALL check("h5tset_strpad_f", error, total_error) + dims(1) = n + ! + ! Create dataspace. + ! + CALL h5screate_simple_f(1, dims, space, error, max_dims) + CALL check("h5screate_simple_f", error, total_error) + CALL h5pcreate_f(h5p_dataset_create_f, dcpl, error) + CALL check("h5pcreate_f", error, total_error) + CALL h5pset_chunk_f(dcpl, 1, chunk, error) + CALL check("h5pset_chunk_f", error, total_error) + + data_dims(1) = line_length + data_dims(2) = n + ! + ! Create data with strings containing various control characters. + ! + DO i = 1, ncontrolchar + ! + ! Create the dataset, for the string with control character and write the string data to it. + ! + CALL h5dcreate_f(file, controlchar(i), string_id, space, dataset0, error, dcpl) + CALL check("h5dcreate_f", error, total_error) + CALL setup_buffer(data_in(1:n), line_lengths, controlchar(i)) + CALL h5dwrite_vl_f(dataset0, string_id, data_in(1:n), data_dims, line_lengths(1:n), error, space) + CALL check("h5dwrite_vl_f", error, total_error) + ! + ! Read the string back. + ! + CALL h5dread_vl_f(dataset0, string_id, data_out(1:n), data_dims, line_lengths(1:n), error, space) + CALL check("h5dread_vl_f", error, total_error) + + DO j = 1, n + IF(data_in(j).NE.data_out(j))THEN + total_error = total_error + 1 + EXIT + ENDIF + ENDDO + + CALL h5dclose_f(dataset0, error) + CALL check("h5dclose_f", error, total_error) + ENDDO + + CALL h5pclose_f(dcpl, error) + CALL check("h5pclose_f", error, total_error) + CALL h5sclose_f(space, error) + CALL check("h5sclose_f", error, total_error) + CALL h5fclose_f(file, error) + CALL check("h5fclose_f", error, total_error) + +END SUBROUTINE vl_test_special_char + + +SUBROUTINE setup_buffer(data_in, line_lengths, char_type) + + IMPLICIT NONE + + ! Creates a simple "Data_in" consisting of the letters of the alphabet, + ! one per line, with a control character. + + CHARACTER(len=10), DIMENSION(:) :: data_in + INTEGER(size_t), DIMENSION(:) :: line_lengths + INTEGER, DIMENSION(1:3) :: letters + CHARACTER(LEN=3) :: lets + CHARACTER(KIND=C_CHAR,LEN=*) :: char_type + CHARACTER(KIND=C_CHAR,LEN=1) :: char_tmp + INTEGER :: i, j, n, ff + + ! Convert the letters and special character to integers + lets = 'abc' + + READ(lets,'(3A1)') letters + READ(char_type,'(A1)') ff + n = SIZE(data_in) + j = 1 + DO i=1,n-1 + IF( j .EQ. 4 )THEN + WRITE(char_tmp,'(A1)') ff + data_in(i:i) = char_tmp + ELSE + WRITE(char_tmp,'(A1)') letters(j) + data_in(i:i) = char_tmp + ENDIF + line_lengths(i) = LEN_TRIM(data_in(i)) + j = j + 1 + IF( j .EQ. 5 ) j = 1 + END DO + WRITE(char_tmp,'(A1)') ff + data_in(n:n) = char_tmp + line_lengths(n) = 1 + +END SUBROUTINE setup_buffer + +!------------------------------------------------------------------------- +! Function: test_nbit +! +! Purpose: Tests (real, 4 byte) datatype for nbit filter +! +! Return: Success: 0 +! Failure: >0 +! +! Programmer: M. Scot Breitenfeld +! Decemeber 7, 2010 +! +! Modifications: Moved this subroutine from the 1.8 test file and +! modified it to use F2003 features. +! This routine requires 4 byte reals, so we use F2003 features to +! ensure the requirement is satisfied in a portable way. +! The need for this arises when a user specifies the default real is 8 bytes. +! MSB 7/31/12 +! +!------------------------------------------------------------------------- +! + +SUBROUTINE test_nbit(total_error ) + + IMPLICIT NONE + INTEGER, PARAMETER :: wp = C_FLOAT !should map to REAL*4 on most modern processors + INTEGER, INTENT(INOUT) :: total_error + INTEGER(hid_t) :: file + + INTEGER(hid_t) :: dataset, datatype, space, dc, mem_type_id + INTEGER(hsize_t), DIMENSION(1:2) :: dims = (/2,5/) + INTEGER(hsize_t), DIMENSION(1:2) :: chunk_dim = (/2,5/) + ! orig_data[] are initialized to be within the range that can be represented by + ! dataset datatype (no precision loss during datatype conversion) + ! + REAL(kind=wp), DIMENSION(1:2,1:5), TARGET :: orig_data = & + RESHAPE( (/188384.00, 19.103516, -1.0831790e9, -84.242188, & + 5.2045898, -49140.000, 2350.2500, -3.2110596e-1, 6.4998865e-5, -0.0000000/) , (/2,5/) ) + REAL(kind=wp), DIMENSION(1:2,1:5), TARGET :: new_data + INTEGER(size_t) :: PRECISION, offset + INTEGER :: error + LOGICAL :: status + INTEGER(hsize_t) :: i, j + TYPE(C_PTR) :: f_ptr + + ! check to see if filter is available + CALL H5Zfilter_avail_f(H5Z_FILTER_NBIT_F, status, error) + IF(.NOT.status)THEN ! We don't have H5Z_FILTER_NBIT_F filter + total_error = -1 ! so return + RETURN + ENDIF + + CALL H5Fcreate_f("nbit.h5", H5F_ACC_TRUNC_F, file, error) + CALL check("H5Fcreate_f", error, total_error) + + ! Define dataset datatype (integer), and set precision, offset + CALL H5Tcopy_f(H5T_IEEE_F32BE, datatype, error) + CALL CHECK(" H5Tcopy_f", error, total_error) + CALL H5Tset_fields_f(datatype, 26_size_t, 20_size_t, 6_size_t, 7_size_t, 13_size_t, error) + CALL CHECK(" H5Tset_fields_f", error, total_error) + offset = 7 + CALL H5Tset_offset_f(datatype, offset, error) + CALL CHECK(" H5Tset_offset_f", error, total_error) + PRECISION = 20 + CALL H5Tset_precision_f(datatype,PRECISION, error) + CALL CHECK(" H5Tset_precision_f", error, total_error) + + CALL H5Tset_size_f(datatype, 4_size_t, error) + CALL CHECK(" H5Tset_size_f", error, total_error) + + CALL H5Tset_ebias_f(datatype, 31_size_t, error) + CALL CHECK(" H5Tset_ebias_f", error, total_error) + + ! Create the data space + CALL H5Screate_simple_f(2, dims, space, error) + CALL CHECK(" H5Screate_simple_f", error, total_error) + + ! USE nbit filter + CALL H5Pcreate_f(H5P_DATASET_CREATE_F, dc, error) + CALL CHECK(" H5Pcreate_f", error, total_error) + + CALL H5Pset_chunk_f(dc, 2, chunk_dim, error) + CALL CHECK(" H5Pset_chunk_f", error, total_error) + CALL H5Pset_nbit_f(dc, error) + CALL CHECK(" H5Pset_nbit_f", error, total_error) + + ! Create the dataset + CALL H5Dcreate_f(file, "nbit_real", datatype, & + space, dataset, error, dc) + CALL CHECK(" H5Dcreate_f", error, total_error) + + !---------------------------------------------------------------------- + ! STEP 1: Test nbit by setting up a chunked dataset and writing + ! to it. + !---------------------------------------------------------------------- + ! + mem_type_id = h5kind_to_type(wp,H5_REAL_KIND) + + f_ptr = C_LOC(orig_data(1,1)) + CALL H5Dwrite_f(dataset, mem_type_id, f_ptr, error) + CALL CHECK(" H5Dwrite_f", error, total_error) + + !---------------------------------------------------------------------- + ! STEP 2: Try to read the data we just wrote. + !---------------------------------------------------------------------- + ! + f_ptr = C_LOC(new_data(1,1)) + CALL H5Dread_f(dataset, mem_type_id, f_ptr, error) + CALL CHECK(" H5Dread_f", error, total_error) + + ! Check that the values read are the same as the values written + ! Assume size of long long = size of double + ! + i_loop: DO i = 1, dims(1) + j_loop: DO j = 1, dims(2) + + IF(.NOT.(orig_data(i,j).EQ.orig_data(i,j))) CYCLE ! skip IF value is NaN + + IF( .NOT.check_real_eq( new_data(i,j), orig_data(i,j)) ) THEN + total_error = total_error + 1 + WRITE(*,'(" Read different values than written.")') + WRITE(*,'(" At index ", 2(1X,I0))') i, j + EXIT i_loop + END IF + ENDDO j_loop + ENDDO i_loop + + !---------------------------------------------------------------------- + ! Cleanup + !---------------------------------------------------------------------- + ! + CALL H5Tclose_f(datatype, error) + CALL CHECK(" H5Tclose_f", error, total_error) + CALL H5Pclose_f(dc, error) + CALL CHECK(" H5Pclose_f", error, total_error) + CALL H5Sclose_f(space, error) + CALL CHECK(" H5Sclose_f", error, total_error) + CALL H5Dclose_f(dataset, error) + CALL CHECK(" H5Dclose_f", error, total_error) + CALL H5Fclose_f(file, error) + CALL CHECK(" H5Fclose_f", error, total_error) + +END SUBROUTINE test_nbit + + +SUBROUTINE t_enum_conv(total_error) + +!------------------------------------------------------------------------- +! Subroutine: t_enum_conv +! +! Purpose: Tests converting data from enumeration datatype +! to numeric (integer or floating-point number) +! datatype. Tests various KINDs of INTEGERs +! and REALs. Checks reading enum data into +! INTEGER and REAL KINDs. +! +! Return: Success: 0 +! Failure: number of errors +! +! Programmer: M. Scot Breitenfeld +! October 27, 2012 +! +! Note: Adapted from C test (enum.c -- test_conv) +! No reliance on C tests. +!------------------------------------------------------------------------- +! + + IMPLICIT NONE + + INTEGER, INTENT(INOUT) :: total_error + + INTEGER, PARAMETER :: int_kind_8 = SELECTED_INT_KIND(9) !should map to INTEGER*4 on most modern processors + INTEGER, PARAMETER :: int_kind_16 = SELECTED_INT_KIND(18) !should map to INTEGER*8 on most modern processors + + INTEGER, PARAMETER :: real_kind_7 = C_FLOAT !should map to REAL*4 on most modern processors + + INTEGER(hid_t) :: cwg=-1, dtype=-1, space=-1, dset=-1 ! Handles + INTEGER(hid_t) :: file ! Handles + + ! Enumerated type + ENUM, BIND(C) + ENUMERATOR :: E1_RED, E1_GREEN, E1_BLUE, E1_WHITE, E1_BLACK + END ENUM + + INTEGER(KIND(E1_RED)), TARGET :: val + + ! Enumerated data array + ! Some values are out of range for testing. The library should accept them + INTEGER(KIND(E1_RED)), DIMENSION(1:20), TARGET :: data1 = (/INT(E1_RED,KIND(E1_RED)), & + INT(E1_GREEN,KIND(E1_RED)), INT(E1_BLUE,KIND(E1_RED)), & + INT(E1_GREEN,KIND(E1_RED)), INT(E1_WHITE,KIND(E1_RED)), & + INT(E1_WHITE,KIND(E1_RED)), INT(E1_BLACK,KIND(E1_RED)), & + INT(E1_GREEN,KIND(E1_RED)), INT(E1_BLUE,KIND(E1_RED)), & + INT(E1_RED,KIND(E1_RED)), INT(E1_RED,KIND(E1_RED)), INT(E1_BLUE,KIND(E1_RED)), & + INT(E1_GREEN,KIND(E1_RED)), INT(E1_BLACK,KIND(E1_RED)), INT(E1_WHITE,KIND(E1_RED)),& + INT(E1_RED,KIND(E1_RED)), INT(E1_WHITE,KIND(E1_RED)), & + INT(0,KIND(E1_RED)), INT(-1,KIND(E1_RED)), INT(-2,KIND(E1_RED))/) + + ! Reading array for enum data + INTEGER(KIND(E1_RED)), DIMENSION(1:20), TARGET :: data2 + + ! Reading array's for converted enum data + INTEGER(C_SHORT), DIMENSION(1:20), TARGET :: data_short + INTEGER(C_INT), DIMENSION(1:20), TARGET :: data_int + REAL(C_DOUBLE), DIMENSION(1:20), TARGET :: data_double + + INTEGER(int_kind_8), DIMENSION(1:20), TARGET :: data_i8 + INTEGER(int_kind_16), DIMENSION(1:20), TARGET :: data_i16 + REAL(real_kind_7), DIMENSION(1:20), TARGET :: data_r7 + + INTEGER(hsize_t), DIMENSION(1:1) :: ds_size = (/20/) + INTEGER(size_t) :: i + INTEGER(hsize_t) :: ih + INTEGER :: error + TYPE(C_PTR) :: f_ptr + INTEGER(HID_T) :: m_baset ! Memory base type + ! + ! Create a new file using the default properties. + ! + CALL h5fcreate_f("enum1.h5", H5F_ACC_TRUNC_F, file, error) + CALL check("h5fcreate_f", error, total_error) + ! + ! Create a new group using the default properties. + ! + CALL h5gcreate_f(file, "test_conv", cwg, error) + CALL check("h5gcreate_f",error, total_error) + ! + ! Create a enum type + ! + CALL H5Tcreate_f(H5T_ENUM_F, H5OFFSETOF(C_LOC(data1(1)), C_LOC(data1(2))), dtype, error) + CALL check("h5tcreate_f",error, total_error) + ! + ! Initialize enum data. + ! + + val = E1_RED + CALL H5Tenum_insert_f(dtype, "RED", C_LOC(val), error) + CALL check("h5tenum_insert_f",error, total_error) + val = E1_GREEN + f_ptr = C_LOC(val) + CALL H5Tenum_insert_f(dtype, "GREEN", f_ptr, error) + CALL check("h5tenum_insert_f",error, total_error) + val = E1_BLUE + f_ptr = C_LOC(val) + CALL H5Tenum_insert_f(dtype, "BLUE", f_ptr, error) + CALL check("h5tenum_insert_f",error, total_error) + val = E1_WHITE + f_ptr = C_LOC(val) + CALL H5Tenum_insert_f(dtype, "WHITE", f_ptr, error) + CALL check("h5tenum_insert_f",error, total_error) + val = E1_BLACK + f_ptr = C_LOC(val) + CALL H5Tenum_insert_f(dtype, "BLACK", f_ptr, error) + CALL check("h5tenum_insert_f",error, total_error) + ! + ! Create dataspace. Setting maximum size to be the current size. + ! + CALL h5screate_simple_f(1, ds_size, space, error) + CALL check("h5screate_simple_f", error, total_error) + + ! *************************************** + ! * Dataset of enumeration type + ! *************************************** + ! + ! Create a dataset of enum type and write enum data to it + + CALL h5dcreate_f(cwg, "color_table1", dtype, space, dset, error) + CALL check("h5dcreate_f", error, total_error) + + f_ptr = C_LOC(data1(1)) + CALL h5dwrite_f(dset, dtype, f_ptr, error, space, space) + CALL check(" h5dwrite_f", error, total_error) + + ! Test reading back the data with no conversion + + f_ptr = C_LOC(data2(1)) + CALL h5dread_f(dset, dtype, f_ptr, error, space, space) + CALL check(" h5dread_f", error, total_error) + + ! Check values + DO ih = 1, ds_size(1) + IF(data1(ih) .NE. data2(ih))THEN + total_error = total_error + 1 + WRITE(*,'(" 1. data1(",I0,")=",I0," .NE. data2(",I0,")=",I0)') ih, data1(ih),i,data2(ih) + EXIT + ENDIF + ENDDO + + ! Test converting the data to integer (KIND=C_SHORT). Read enum data back as integer + m_baset = h5kind_to_type(KIND(data_short(1)), H5_INTEGER_KIND) ! Memory base type + f_ptr = C_LOC(data_short(1)) + CALL h5dread_f(dset, m_baset, f_ptr, error, space, space) + CALL check("h5dread_f", error, total_error) + ! Check values + DO ih = 1, ds_size(1) + IF(data1(ih) .NE. data_short(ih))THEN + total_error = total_error + 1 + WRITE(*,'(" 2. data1(",I0,")=",I0," .NE. data_short(",I0,")=",I0)') ih, data1(ih),i,data_short(ih) + EXIT + ENDIF + ENDDO + + ! Test converting the data to (KIND=C_double) number. + ! Read enum data back as (KIND=C_double) number + + m_baset = h5kind_to_type(KIND(data_double(1)), H5_REAL_KIND) ! Memory base type + f_ptr = C_LOC(data_double(1)) + CALL h5dread_f(dset, m_baset, f_ptr, error, space, space) + CALL check("h5dread_f", error, total_error) + ! Check values + DO ih = 1, ds_size(1) + IF(data1(ih) .NE. INT(data_double(ih)))THEN + total_error = total_error + 1 + WRITE(*,'(" 3. data_double(",I0,")=",I0," .NE. data_double(",I0,")=",I0)') & + ih, INT(data1(ih)), ih, INT(data_double(ih)) + EXIT + ENDIF + ENDDO + + ! Test converting the data to (SELECTED_INT_KIND(9)) number. + ! Read enum data back as (SELECTED_INT_KIND(9)) number + + m_baset = h5kind_to_type(int_kind_8, H5_INTEGER_KIND) ! Memory base type + f_ptr = C_LOC(data_i8(1)) + CALL h5dread_f(dset, m_baset, f_ptr, error, space, space) + CALL check("h5dread_f", error, total_error) + ! Check values + DO ih = 1, ds_size(1) + IF(data1(ih) .NE. INT(data_i8(ih)))THEN + total_error = total_error + 1 + WRITE(*,'(" 4. data_i8(",I0,")=",I0," .NE. data_i8(",I0,")=",I0)') & + ih, INT(data1(ih)), i, INT(data_i8(ih)) + EXIT + ENDIF + ENDDO + + ! Test converting the data to (SELECTED_INT_KIND(18)) number. + ! Read enum data back as (SELECTED_INT_KIND(18)) number + + m_baset = h5kind_to_type(int_kind_16, H5_INTEGER_KIND) ! Memory base type + f_ptr = C_LOC(data_i16(1)) + CALL h5dread_f(dset, m_baset, f_ptr, error, space, space) + CALL check("h5dread_f", error, total_error) + ! Check values + DO ih = 1, ds_size(1) + IF(data1(ih) .NE. INT(data_i16(ih)))THEN + total_error = total_error + 1 + WRITE(*,'(" 5. data_i16(",I0,")=",I0," .NE. data_i16(",I0,")=",I0)') & + ih, INT(data1(ih)), i, INT(data_i16(ih)) + EXIT + ENDIF + ENDDO + + ! Test converting the data to C_FLOAT number. + ! Read enum data back as C_FLOAT number + + m_baset = h5kind_to_type(KIND(data_r7(1)), H5_REAL_KIND) ! Memory base type + f_ptr = C_LOC(data_r7(1)) + CALL h5dread_f(dset, m_baset, f_ptr, error, space, space) + CALL check("h5dread_f", error, total_error) + ! Check values + DO ih = 1, ds_size(1) + IF(data1(ih) .NE. INT(data_r7(ih)))THEN + total_error = total_error + 1 + WRITE(*,'(" 6. data_r7(",I0,")=",I0," .NE. data_r7(",I0,")=",I0)') & + ih, INT(data1(ih)), i, INT(data_r7(ih)) + EXIT + ENDIF + ENDDO + + CALL h5dclose_f(dset, error) + CALL check("h5dclose_f", error, total_error) + + ! *************************************** + ! * Dataset of C_int type + ! *************************************** + + ! Create a integer dataset of KIND=C_INT and write enum data to it + m_baset = h5kind_to_type(KIND(data_int(1)), H5_INTEGER_KIND) ! Memory base type + CALL h5dcreate_f(cwg, "color_table2", m_baset, space, dset, error) + CALL check("h5dcreate_f", error, total_error) + + ! Write the enum data + f_ptr = C_LOC(data1(1)) + CALL h5dwrite_f(dset, dtype, f_ptr, error, space, space) + CALL check("h5dwrite_f", error, total_error) + + ! Test reading back the data with no conversion + f_ptr = C_LOC(data_int(1)) + CALL h5dread_f(dset, m_baset, f_ptr, error, space, space) + CALL check("h5dread_f", error, total_error) + + DO ih = 1, ds_size(1) + IF(data1(ih) .NE. data_int(ih))THEN + total_error = total_error + 1 + WRITE(*,'(" 7. data1(",I0,")=",I0," .NE. data_int(",I0,")=",I0)') ih, data1(ih),i,data_int(ih) + EXIT + ENDIF + ENDDO + CALL h5dclose_f(dset, error) + CALL check("h5dclose_f", error, total_error) + + !************************************** + !* Dataset of C_double type + !************************************** + + ! Create a dataset of KIND=C_DOUBLE and write enum data to it + m_baset = h5kind_to_type(KIND(data_double(1)), H5_REAL_KIND) ! Memory base type + CALL h5dcreate_f(cwg, "color_table3", m_baset, space, dset, error) + CALL check("h5dcreate_f", error, total_error) + + f_ptr = C_LOC(data1(1)) + CALL h5dwrite_f(dset, dtype, f_ptr, error, space, space) + CALL check("h5dwrite_f", error, total_error) + + ! Test reading back the data with no conversion + f_ptr = C_LOC(data_double(1)) + CALL h5dread_f(dset, m_baset, f_ptr, error, space, space) + CALL check("h5dread_f", error, total_error) + + DO ih = 1, ds_size(1) + IF(data1(ih) .NE. INT(data_double(ih)))THEN + total_error = total_error + 1 + WRITE(*,'(" 8. data1(",I0,")=",I0," .NE. data_double(",I0,")=",I0)') ih, data1(ih),ih,INT(data_double(ih)) + EXIT + ENDIF + ENDDO + CALL h5dclose_f(dset, error) + CALL check("h5dclose_f", error, total_error) + + !********************************************************* + !* Dataset of real C_FLOAT type + !********************************************************* + + ! Create a dataset of C_FLOAT and write enum data to it + m_baset = h5kind_to_type(KIND(data_r7(1)), H5_REAL_KIND) ! Memory base type + CALL h5dcreate_f(cwg, "color_table4", m_baset, space, dset, error) + CALL check("h5dcreate_f", error, total_error) + + f_ptr = C_LOC(data1(1)) + CALL h5dwrite_f(dset, dtype, f_ptr, error, space, space) + CALL check("h5dwrite_f", error, total_error) + + ! Test reading back the data with no conversion + f_ptr = C_LOC(data_r7(1)) + CALL h5dread_f(dset, m_baset, f_ptr, error, space, space) + CALL check("h5dread_f", error, total_error) + + DO ih = 1, ds_size(1) + IF(data1(ih) .NE. INT(data_r7(ih)))THEN + total_error = total_error + 1 + WRITE(*,'(" 9. data1(",I0,")=",I0," .NE. data_r7(",I0,")=",I0)') ih, data1(ih),ih,INT(data_r7(ih)) + EXIT + ENDIF + ENDDO + CALL h5dclose_f(dset, error) + CALL check("h5dclose_f", error, total_error) + + ! ***************************************************************** + ! * Dataset of integer SELECTED_INT_KIND(18) type + ! ***************************************************************** + + ! Create a integer dataset of (SELECTED_INT_KIND(18)) and write enum data to it + m_baset = h5kind_to_type(KIND(data_i16(1)), H5_INTEGER_KIND) ! Memory base type + CALL h5dcreate_f(cwg, "color_table5", m_baset, space, dset, error) + CALL check("h5dcreate_f", error, total_error) + + ! Write the enum data + f_ptr = C_LOC(data1(1)) + CALL h5dwrite_f(dset, dtype, f_ptr, error, space, space) + CALL check("h5dwrite_f", error, total_error) + + ! Test reading back the data with no conversion + f_ptr = C_LOC(data_i16(1)) + CALL h5dread_f(dset, m_baset, f_ptr, error, space, space) + CALL check("h5dread_f", error, total_error) + + DO ih = 1, ds_size(1) + IF(data1(ih) .NE. data_i16(ih))THEN + total_error = total_error + 1 + WRITE(*,'(" 10. data1(",I0,")=",I0," .NE. data_i16(",I0,")=",I0)') ih, data1(ih),ih,data_i16(ih) + EXIT + ENDIF + ENDDO + CALL h5dclose_f(dset, error) + CALL check("h5dclose_f", error, total_error) + + ! + ! Close and release resources. + ! + CALL h5sclose_f(space, error) + CALL check("H5Sclose_f", error, total_error) + CALL h5tclose_f(dtype, error) + CALL check("H5Tclose_f", error, total_error) + CALL h5gclose_f(cwg, error) + CALL check("h5gclose_f",error, total_error) + CALL h5fclose_f(file, error) + CALL check("H5Fclose_f", error, total_error) + +END SUBROUTINE t_enum_conv + +END MODULE TH5T_F03 diff --git a/fortran/test/tH5T_F03.f90 b/fortran/test/tH5T_F03.f90 deleted file mode 100644 index 32531b0..0000000 --- a/fortran/test/tH5T_F03.f90 +++ /dev/null @@ -1,3453 +0,0 @@ -!****h* root/fortran/test/tH5T_F03.f90 -! -! NAME -! tH5T_F03.f90 -! -! FUNCTION -! Test FORTRAN HDF5 H5T APIs which are dependent on FORTRAN 2003 -! features. -! -! 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. * -! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -! -! -! CONTAINS SUBROUTINES -! test_array_compound_atomic, test_array_compound_array, -! test_array_bkg, test_h5kind_to_type -! -!***** - -! ***************************************** -! *** H 5 T T E S T S -! ***************************************** - -!*************************************************************** -!** -!** test_array_compound_atomic(): Test basic array datatype code. -!** Tests 1-D array of compound datatypes (with no array fields) -!** -!*************************************************************** -! - -MODULE TH5T_F03 - - USE HDF5 - USE ISO_C_BINDING - -CONTAINS - -SUBROUTINE test_array_compound_atomic(total_error) - - USE HDF5 - USE TH5_MISC - USE ISO_C_BINDING - IMPLICIT NONE - - INTEGER, INTENT(INOUT) :: total_error - ! 1-D dataset WITH fixed dimensions - INTEGER, PARAMETER :: SPACE1_RANK = 1 - INTEGER, PARAMETER :: SPACE1_DIM1 = 4 - ! 1-D array datatype - INTEGER, PARAMETER :: ARRAY1_RANK= 1 - INTEGER, PARAMETER :: ARRAY1_DIM1= 4 - CHARACTER(LEN=10), PARAMETER :: FILENAME = "tarray1.h5" - - TYPE s1_t - INTEGER :: i - REAL :: f - END TYPE s1_t - TYPE(s1_t), DIMENSION(:,:), ALLOCATABLE, TARGET :: wdata ! Information to write - TYPE(s1_t), DIMENSION(:,:), ALLOCATABLE, TARGET :: rdata ! Information read in - INTEGER(hid_t) :: fid1 ! HDF5 File IDs - INTEGER(hid_t) :: dataset ! Dataset ID - INTEGER(hid_t) :: sid1 ! Dataspace ID - INTEGER(hid_t) :: tid1 ! Array Datatype ID - INTEGER(hid_t) :: tid2 ! Compound Datatype ID - - INTEGER(HSIZE_T), DIMENSION(1) :: sdims1 = (/SPACE1_DIM1/) - INTEGER(HSIZE_T), DIMENSION(1) :: tdims1=(/ARRAY1_DIM1/) - INTEGER :: ndims ! Array rank for reading - INTEGER(HSIZE_T), ALLOCATABLE, DIMENSION(:) :: rdims1 ! Array dimensions for reading - INTEGER(HSIZE_T), ALLOCATABLE, DIMENSION(:) :: rdims ! Array dimensions for reading - INTEGER :: nmemb ! Number of compound members - CHARACTER(LEN=20) :: mname ! Name of compound field - INTEGER(size_t) :: off ! Offset of compound field - INTEGER(hid_t) :: mtid ! Datatype ID for field - INTEGER :: i,j ! counting variables - - INTEGER :: error ! Generic RETURN value - INTEGER :: namelen - LOGICAL :: flag - - TYPE(C_PTR) :: f_ptr ! Needed to pass the pointer, for g95 compiler to work - - ALLOCATE( wdata(1:SPACE1_DIM1,1:ARRAY1_DIM1) ) - ALLOCATE( rdata(1:SPACE1_DIM1,1:ARRAY1_DIM1) ) - - ! Initialize array data to write - DO i = 1, SPACE1_DIM1 - DO j = 1, ARRAY1_DIM1 - wdata(i,j)%i = i * 10 + j - wdata(i,j)%f = i * 2.5 + j - ENDDO - ENDDO - - ! Create file - CALL h5fcreate_f(FILENAME,H5F_ACC_TRUNC_F,fid1,error) - CALL check("h5fcreate_f", error, total_error) - - ! Create dataspace for datasets - CALL h5screate_simple_f(SPACE1_RANK, sdims1, sid1, error) - CALL check("h5screate_simple_f", error, total_error) - - CALL h5tcreate_f(H5T_COMPOUND_F, H5OFFSETOF(C_LOC(wdata(1,1)), C_LOC(wdata(2,1))), tid2, error) - CALL check("h5tcreate_f", error, total_error) - - ! Insert integer field - CALL h5tinsert_f(tid2, "i", H5OFFSETOF(C_LOC(wdata(1,1)),C_LOC(wdata(1,1)%i)), H5T_NATIVE_INTEGER, error) - CALL check("h5tinsert_f", error, total_error) - - ! Insert float field - - CALL h5tinsert_f(tid2, "f", H5OFFSETOF(C_LOC(wdata(1,1)),C_LOC(wdata(1,1)%f)), H5T_NATIVE_REAL, error) - CALL check("h5tinsert_f", error, total_error) - - ! Create an array datatype to refer to - CALL h5tarray_create_f(tid2, ARRAY1_RANK, tdims1, tid1, error) - CALL check("h5tarray_create_f", error, total_error) - - ! Close compound datatype - CALL h5tclose_f(tid2,error) - CALL check("h5tclose_f", error, total_error) - - - ! Create a dataset - CALL h5dcreate_f(fid1,"Dataset1",tid1, sid1, dataset,error) - CALL check("h5dcreate_f", error, total_error) - - ! Write dataset to disk - - ALLOCATE(rdims(1:2)) ! dummy not needed - - f_ptr = C_LOC(wdata(1,1)) - CALL h5dwrite_f(dataset, tid1, f_ptr, error ) - CALL check("h5dwrite_f", error, total_error) - ! Close Dataset - CALL h5dclose_f(dataset, error) - CALL check("h5dclose_f", error, total_error) - - ! Close datatype - CALL h5tclose_f(tid1,error) - CALL check("h5tclose_f", error, total_error) - - ! Close disk dataspace - CALL h5sclose_f(sid1,error) - CALL check("h5sclose_f", error, total_error) - - ! Close file - CALL h5fclose_f(fid1,error) - CALL check("h5fclose_f", error, total_error) - - ! Re-open file - CALL h5fopen_f (FILENAME, H5F_ACC_RDONLY_F, fid1, error) - CALL check("h5fopen_f", error, total_error) - - ! Open the dataset - CALL h5dopen_f(fid1, "Dataset1", dataset, error) - CALL check("h5dopen_f", error, total_error) - - ! Get the datatype - CALL h5dget_type_f(dataset, tid1, error) - CALL check("h5dget_type_f", error, total_error) - - ! Check the array rank - CALL h5tget_array_ndims_f(tid1, ndims, error) - CALL check("h5tget_array_ndims_f", error, total_error) - CALL VERIFY("h5tget_array_ndims_f",ndims, ARRAY1_RANK, total_error) - - ! Get the array dimensions - ALLOCATE(rdims1(1:ndims)) - CALL h5tget_array_dims_f(tid1, rdims1, error) - CALL check("h5tget_array_dims_f", error, total_error) - - - ! Check the array dimensions - DO i = 1, ndims - CALL VERIFY("h5tget_array_dims_f", INT(rdims1(i)), INT(tdims1(i)), total_error) - ENDDO - - ! Get the compound datatype - CALL h5tget_super_f(tid1, tid2, error) - CALL check("h5tget_super_f", error, total_error) - - ! Check the number of members - CALL h5tget_nmembers_f(tid2, nmemb, error) - CALL check("h5tget_nmembers_f", error, total_error) - CALL VERIFY("h5tget_nmembers_f", nmemb, 2, total_error) - - ! Check the 1st field's name - CALL H5Tget_member_name_f(tid2, 0, mname, namelen,error) - CALL check("H5Tget_member_name_f", error, total_error) - CALL verifystring("H5Tget_member_name_f",mname(1:namelen),"i", total_error) - - ! Check the 1st field's offset - CALL H5Tget_member_offset_f(tid2, 0, off, error) - CALL check("H5Tget_member_offset_f", error, total_error) - CALL VERIFY("H5Tget_member_offset_f",INT(off),0, total_error) - - - ! Check the 1st field's datatype - CALL H5Tget_member_type_f(tid2, 0, mtid, error) - CALL check("H5Tget_member_type_f", error, total_error) - - CALL H5Tequal_f(mtid, H5T_NATIVE_INTEGER, flag, error) - CALL check("H5Tequal_f", error, total_error) - CALL VerifyLogical("H5Tequal_f", flag, .TRUE., total_error) - - CALL h5tclose_f(mtid,error) - CALL check("h5tclose_f", error, total_error) - - ! Check the 2nd field's name - CALL H5Tget_member_name_f(tid2, 1, mname, namelen,error) - CALL check("H5Tget_member_name_f", error, total_error) - CALL verifystring("H5Tget_member_name_f",mname(1:namelen),"f", total_error) - - ! Check the 2nd field's offset - CALL H5Tget_member_offset_f(tid2, 1, off, error) - CALL check("H5Tget_member_offset_f", error, total_error) - CALL VERIFY("H5Tget_member_offset_f",INT(off),INT(H5OFFSETOF(C_LOC(wdata(1,1)),C_LOC(wdata(1,1)%f))), total_error) - - ! Check the 2nd field's datatype - CALL H5Tget_member_type_f(tid2, 1, mtid, error) - CALL check("H5Tget_member_type_f", error, total_error) - - CALL H5Tequal_f(mtid, H5T_NATIVE_REAL, flag, error) - CALL check("H5Tequal_f", error, total_error) - CALL VerifyLogical("H5Tequal_f", flag, .TRUE., total_error) - - CALL h5tclose_f(mtid,error) - CALL check("h5tclose_f", error, total_error) - - ! Close Compound Datatype - CALL h5tclose_f(tid2, error) - CALL check("h5tclose_f", error, total_error) - - ! Read dataset from disk - - f_ptr = C_LOC(rdata(1,1)) - CALL H5Dread_f(dataset, tid1, f_ptr, error) - CALL check("H5Dread_f", error, total_error) - - ! Compare data read in - DO i = 1, SPACE1_DIM1 - DO j = 1, ARRAY1_DIM1 - IF(wdata(i,j)%i.NE.rdata(i,j)%i)THEN - PRINT*, 'ERROR: Wrong integer data is read back by H5Dread_f ' - total_error = total_error + 1 - ENDIF - IF( .NOT.dreal_eq( REAL(wdata(i,j)%f,dp), REAL( rdata(i,j)%f, dp)) ) THEN - PRINT*, 'ERROR: Wrong real data is read back by H5Dread_f ' - total_error = total_error + 1 - ENDIF - ENDDO - ENDDO - - ! Close Datatype - CALL h5tclose_f(tid1,error) - CALL check("h5tclose_f", error, total_error) - - ! Close Dataset - CALL h5dclose_f(dataset, error) - CALL check("h5dclose_f", error, total_error) - - ! Close file - CALL h5fclose_f(fid1,error) - CALL check("h5fclose_f", error, total_error) - -END SUBROUTINE test_array_compound_atomic -!!$ -!!$!*************************************************************** -!!$!** -!!$!** test_array_compound_array(): Test basic array datatype code. -!!$!** Tests 1-D array of compound datatypes (with array fields) -!!$!** -!!$!*************************************************************** -!!$ - SUBROUTINE test_array_compound_array(total_error) - - USE HDF5 - USE TH5_MISC - USE ISO_C_BINDING - IMPLICIT NONE - - INTEGER, INTENT(INOUT) :: total_error - - ! 1-D array datatype - INTEGER, PARAMETER :: ARRAY1_RANK= 1 - INTEGER, PARAMETER :: ARRAY1_DIM1= 3 - INTEGER, PARAMETER :: ARRAY2_DIM1= 5 - - INTEGER, PARAMETER :: SPACE1_RANK = 1 - INTEGER, PARAMETER :: SPACE1_DIM1 = 4 - CHARACTER(LEN=10), PARAMETER :: FILENAME = "tarray2.h5" - - TYPE st_t_struct ! Typedef for compound datatype - INTEGER :: i - REAL, DIMENSION(1:ARRAY2_DIM1) :: f - CHARACTER(LEN=2), DIMENSION(1:ARRAY2_DIM1) :: c - END TYPE st_t_struct - ! Information to write - TYPE(st_t_struct), DIMENSION(1:SPACE1_DIM1,1:ARRAY1_DIM1), TARGET :: wdata - ! Information read in - TYPE(st_t_struct), DIMENSION(1:SPACE1_DIM1,1:ARRAY1_DIM1), TARGET :: rdata - - - INTEGER(hid_t) :: fid1 ! HDF5 File IDs - INTEGER(hid_t) :: dataset ! Dataset ID - integer(hid_t) :: sid1 ! Dataspace ID - integer(hid_t) :: tid1 ! Array Datatype ID - integer(hid_t) :: tid2 ! Compound Datatype ID - integer(hid_t) :: tid3 ! Nested Array Datatype ID - integer(hid_t) :: tid4 ! Nested Array Datatype ID - - INTEGER(HSIZE_T), DIMENSION(1) :: sdims1 = (/SPACE1_DIM1/) - INTEGER(HSIZE_T), DIMENSION(1) :: tdims1=(/ARRAY1_DIM1/) - INTEGER(HSIZE_T), DIMENSION(1) :: tdims2=(/ARRAY2_DIM1/) - - INTEGER ndims ! Array rank for reading - - INTEGER(HSIZE_T), ALLOCATABLE, DIMENSION(:) :: rdims1 ! Array dimensions for reading - - INTEGER :: nmemb ! Number of compound members - CHARACTER(LEN=20) :: mname ! Name of compound field - INTEGER(size_t) :: off ! Offset of compound field - INTEGER(hid_t) :: mtid ! Datatype ID for field - INTEGER(hid_t) :: mtid2 ! Datatype ID for field - - INTEGER :: mclass ! Datatype class for field - INTEGER :: i,j,k ! counting variables - - INTEGER :: error - CHARACTER(LEN=2) :: ichr2 - INTEGER :: namelen - LOGICAL :: flag - INTEGER(HID_T) :: atype_id !String Attribute Datatype identifier - INTEGER(SIZE_T) :: attrlen ! Length of the attribute string - - TYPE(c_ptr) :: f_ptr - - ! Initialize array data to write - DO i = 1, SPACE1_DIM1 - DO j = 1, array1_DIM1 - wdata(i,j)%i = i*10+j - DO k = 1, ARRAY2_DIM1 - wdata(i,j)%f(k) = 10*i+j+.5 - WRITE(ichr2,'(I2.2)') k - wdata(i,j)%c(k) = ichr2 - ENDDO - ENDDO - ENDDO - - ! Create file - CALL h5fcreate_f(FILENAME,H5F_ACC_TRUNC_F,fid1,error) - CALL check("h5fcreate_f", error, total_error) - - - ! Create dataspace for datasets - CALL h5screate_simple_f(SPACE1_RANK, sdims1, sid1, error) - CALL check("h5screate_simple_f", error, total_error) - - ! Create a compound datatype to refer to - ! - CALL h5tcreate_f(H5T_COMPOUND_F, H5OFFSETOF(C_LOC(wdata(1,1)), C_LOC(wdata(2,1))), tid2, error) - CALL check("h5tcreate_f", error, total_error) - - ! Insert integer field - CALL h5tinsert_f(tid2, "i", H5OFFSETOF(C_LOC(wdata(1,1)),C_LOC(wdata(1,1)%i)), H5T_NATIVE_INTEGER, error) - CALL check("h5tinsert_f", error, total_error) - - ! Create an array of floats datatype - CALL h5tarray_create_f(H5T_NATIVE_REAL, ARRAY1_RANK, tdims2, tid3, error) - CALL check("h5tarray_create_f", error, total_error) - ! Insert float array field - - CALL h5tinsert_f(tid2, "f", H5OFFSETOF(C_LOC(wdata(1,1)),C_LOC(wdata(1,1)%f)), tid3, error) - CALL check("h5tinsert_f", error, total_error) - - ! - ! Create datatype for the String attribute. - ! - CALL h5tcopy_f(H5T_NATIVE_CHARACTER, atype_id, error) - CALL check("h5tcopy_f",error,total_error) - - attrlen = LEN(wdata(1,1)%c(1)) - CALL h5tset_size_f(atype_id, attrlen, error) - CALL check("h5tset_size_f",error,total_error) - - ! Create an array of character datatype - CALL h5tarray_create_f(atype_id, ARRAY1_RANK, tdims2, tid4, error) - CALL check("h5tarray_create_f", error, total_error) - - ! Insert character array field - CALL h5tinsert_f(tid2, "c", H5OFFSETOF(C_LOC(wdata(1,1)),C_LOC(wdata(1,1)%c(1)(1:1))), tid4, error) - CALL check("h5tinsert2_f", error, total_error) - - ! Close array of floats field datatype - CALL h5tclose_f(tid3,error) - CALL check("h5tclose_f", error, total_error) - - CALL h5tclose_f(tid4,error) - CALL check("h5tclose_f", error, total_error) - - ! Create an array datatype to refer to - CALL h5tarray_create_f(tid2, ARRAY1_RANK, tdims1, tid1, error) - CALL check("h5tarray_create_f", error, total_error) - - ! Close compound datatype - CALL h5tclose_f(tid2,error) - CALL check("h5tclose_f", error, total_error) - - ! Create a dataset - CALL h5dcreate_f(fid1,"Dataset1",tid1, sid1, dataset,error) - CALL check("h5dcreate_f", error, total_error) - - - ! Write dataset to disk - f_ptr = C_LOC(wdata(1,1)) - CALL h5dwrite_f(dataset, tid1, f_ptr, error ) - CALL check("h5dwrite_f", error, total_error) - - ! Close Dataset - CALL h5dclose_f(dataset, error) - CALL check("h5dclose_f", error, total_error) - - ! Close datatype - CALL h5tclose_f(tid1,error) - CALL check("h5tclose_f", error, total_error) - - ! Close disk dataspace - CALL h5sclose_f(sid1,error) - CALL check("h5sclose_f", error, total_error) - - ! Close file - CALL h5fclose_f(fid1,error) - CALL check("h5fclose_f", error, total_error) - - ! Re-open file - CALL h5fopen_f (FILENAME, H5F_ACC_RDONLY_F, fid1, error) - CALL check("h5fopen_f", error, total_error) - - ! Open the dataset - - CALL h5dopen_f(fid1, "Dataset1", dataset, error) - CALL check("h5dopen_f", error, total_error) - - ! Get the datatype - CALL h5dget_type_f(dataset, tid1, error) - CALL check("h5dget_type_f", error, total_error) - - ! Check the array rank - CALL h5tget_array_ndims_f(tid1, ndims, error) - CALL check("h5tget_array_ndims_f", error, total_error) - CALL VERIFY("h5tget_array_ndims_f",ndims, ARRAY1_RANK, total_error) - - - ! Get the array dimensions - ALLOCATE(rdims1(1:ndims)) - CALL h5tget_array_dims_f(tid1, rdims1, error) - CALL check("h5tget_array_dims_f", error, total_error) - - ! Check the array dimensions - DO i = 1, ndims - CALL VERIFY("h5tget_array_dims_f", INT(rdims1(i)), INT(tdims1(i)), total_error) - ENDDO - - ! Get the compound datatype - CALL h5tget_super_f(tid1, tid2, error) - CALL check("h5tget_super_f", error, total_error) - - ! Check the number of members - CALL h5tget_nmembers_f(tid2, nmemb, error) - CALL check("h5tget_nmembers_f", error, total_error) - CALL VERIFY("h5tget_nmembers_f", nmemb, 3, total_error) - - ! Check the 1st field's name - CALL H5Tget_member_name_f(tid2, 0, mname, namelen,error) - CALL check("H5Tget_member_name_f", error, total_error) - CALL verifystring("H5Tget_member_name_f",mname(1:namelen),"i", total_error) - - ! Check the 1st field's offset - - CALL H5Tget_member_offset_f(tid2, 0, off, error) - CALL check("H5Tget_member_offset_f", error, total_error) - CALL VERIFY("H5Tget_member_offset_f",INT(off),0, total_error) - - ! Check the 1st field's datatype - CALL H5Tget_member_type_f(tid2, 0, mtid, error) - CALL check("H5Tget_member_type_f", error, total_error) - - CALL H5Tequal_f(mtid, H5T_NATIVE_INTEGER, flag, error) - CALL check("H5Tequal_f", error, total_error) - CALL VerifyLogical("H5Tequal_f", flag, .TRUE., total_error) - - CALL h5tclose_f(mtid,error) - CALL check("h5tclose_f", error, total_error) - - ! Check the 2nd field's name - CALL H5Tget_member_name_f(tid2, 1, mname, namelen,error) - CALL check("H5Tget_member_name_f", error, total_error) - CALL verifystring("H5Tget_member_name_f",mname(1:namelen),"f", total_error) - - ! Check the 2nd field's offset - CALL H5Tget_member_offset_f(tid2, 1, off, error) - CALL check("H5Tget_member_offset_f", error, total_error) - CALL VERIFY("H5Tget_member_offset_f",INT(off),INT(H5OFFSETOF(C_LOC(wdata(1,1)),C_LOC(wdata(1,1)%f))), total_error) - - ! Check the 2nd field's datatype - CALL H5Tget_member_type_f(tid2, 1, mtid, error) - CALL check("H5Tget_member_type_f", error, total_error) - - ! Get the 2nd field's class - CALL H5Tget_class_f(mtid, mclass, error) - CALL check("H5Tget_class_f", error, total_error) - CALL VERIFY("H5Tget_class_f",mclass, H5T_ARRAY_F, total_error) - - ! Check the array rank - CALL h5tget_array_ndims_f(mtid, ndims, error) - CALL check("h5tget_array_ndims_f", error, total_error) - CALL VERIFY("h5tget_array_ndims_f",ndims, ARRAY1_RANK, total_error) - - ! Get the array dimensions - CALL h5tget_array_dims_f(mtid, rdims1, error) - CALL check("h5tget_array_dims_f", error, total_error) - - ! Check the array dimensions - DO i = 1, ndims - CALL VERIFY("h5tget_array_dims_f", INT(rdims1(i)), INT(tdims2(i)), total_error) - ENDDO - - ! Check the 3rd field's name - CALL H5Tget_member_name_f(tid2, 2, mname, namelen,error) - CALL check("H5Tget_member_name_f", error, total_error) - CALL verifystring("H5Tget_member_name_f",mname(1:namelen),"c", total_error) - - ! Check the 3rd field's offset - CALL H5Tget_member_offset_f(tid2, 2, off, error) - CALL check("H5Tget_member_offset_f", error, total_error) - CALL VERIFY("H5Tget_member_offset_f",INT(off),& - INT(H5OFFSETOF(C_LOC(wdata(1,1)),C_LOC(wdata(1,1)%c(1)(1:1)))), total_error) - - ! Check the 3rd field's datatype - CALL H5Tget_member_type_f(tid2, 2, mtid2, error) - CALL check("H5Tget_member_type_f", error, total_error) - - ! Get the 3rd field's class - CALL H5Tget_class_f(mtid2, mclass, error) - CALL check("H5Tget_class_f", error, total_error) - CALL VERIFY("H5Tget_class_f",mclass, H5T_ARRAY_F, total_error) - - ! Check the array rank - CALL h5tget_array_ndims_f(mtid2, ndims, error) - CALL check("h5tget_array_ndims_f", error, total_error) - CALL VERIFY("h5tget_array_ndims_f",ndims, ARRAY1_RANK, total_error) - - ! Get the array dimensions - CALL h5tget_array_dims_f(mtid2, rdims1, error) - CALL check("h5tget_array_dims_f", error, total_error) - - ! Check the array dimensions - DO i = 1, ndims - CALL VERIFY("h5tget_array_dims_f", INT(rdims1(i)), INT(tdims2(i)), total_error) - ENDDO - - ! Check the nested array's datatype - CALL H5Tget_super_f(mtid, tid3, error) - CALL check("H5Tget_super_f", error, total_error) - - CALL H5Tequal_f(tid3, H5T_NATIVE_REAL, flag, error) - CALL check("H5Tequal_f", error, total_error) - CALL VerifyLogical("H5Tequal_f", flag, .TRUE., total_error) - - ! Check the nested array's datatype - CALL H5Tget_super_f(mtid2, tid3, error) - CALL check("H5Tget_super_f", error, total_error) - - CALL H5Tequal_f(tid3, atype_id, flag, error) - CALL check("H5Tequal_f", error, total_error) - CALL VerifyLogical("H5Tequal_f", flag, .TRUE., total_error) - - ! Close the array's base type datatype - CALL h5tclose_f(tid3, error) - CALL check("h5tclose_f", error, total_error) - - ! Close the member datatype - CALL h5tclose_f(mtid,error) - CALL check("h5tclose_f", error, total_error) - - ! Close the member datatype - CALL h5tclose_f(mtid2,error) - CALL check("h5tclose_f", error, total_error) - - ! Close Compound Datatype - CALL h5tclose_f(tid2,error) - CALL check("h5tclose_f", error, total_error) - - ! READ dataset from disk - - f_ptr = c_null_ptr - f_ptr = C_LOC(rdata(1,1)) - CALL H5Dread_f(dataset, tid1, f_ptr, error) - CALL check("H5Dread_f", error, total_error) - - ! Compare data read in - DO i = 1, SPACE1_DIM1 - DO j = 1, ARRAY1_DIM1 - IF(wdata(i,j)%i.NE.rdata(i,j)%i)THEN - PRINT*, 'ERROR: Wrong integer data is read back by H5Dread_f ' - total_error = total_error + 1 - ENDIF - DO k = 1, ARRAY2_DIM1 - - IF(wdata(i,j)%f(k).NE.rdata(i,j)%f(k))THEN - PRINT*, 'ERROR: Wrong real array data is read back by H5Dread_f ' - total_error = total_error + 1 - ENDIF - IF(wdata(i,j)%c(k).NE.rdata(i,j)%c(k))THEN - PRINT*, 'ERROR: Wrong character array data is read back by H5Dread_f ' - total_error = total_error + 1 - ENDIF - ENDDO - ENDDO - ENDDO - - ! Close Datatype - CALL h5tclose_f(tid1,error) - CALL check("h5tclose_f", error, total_error) - - ! Close Dataset - CALL h5dclose_f(dataset, error) - CALL check("h5dclose_f", error, total_error) - - ! Close file - CALL h5fclose_f(fid1,error) - CALL check("h5fclose_f", error, total_error) - END SUBROUTINE test_array_compound_array -!!$ -!!$!*************************************************************** -!!$!** -!!$!** test_array_bkg(): Test basic array datatype code. -!!$!** Tests reading compound datatype with array fields and -!!$!** writing partial fields. -!!$!** -!!$!*************************************************************** -!!$ - SUBROUTINE test_array_bkg(total_error) - - USE HDF5 - USE TH5_MISC - USE ISO_C_BINDING - IMPLICIT NONE - - INTEGER, INTENT(INOUT) :: total_error - - INTEGER, PARAMETER :: LENGTH = 5 - INTEGER, PARAMETER :: ALEN = 10 - INTEGER, PARAMETER :: RANK = 1 - INTEGER, PARAMETER :: NMAX = 100 - CHARACTER(LEN=17), PARAMETER :: FIELDNAME = "ArrayofStructures" - - INTEGER(hid_t) :: fid, array_dt - INTEGER(hid_t) :: space - INTEGER(hid_t) :: type - INTEGER(hid_t) :: dataset - - INTEGER(hsize_t), DIMENSION(1:1) :: dim =(/LENGTH/) - INTEGER(hsize_t), DIMENSION(1:1) :: dima =(/ALEN/) - - INTEGER :: i, j - INTEGER, DIMENSION(1:3) :: ndims = (/1,1,1/) - - TYPE CmpField_struct - INTEGER, DIMENSION(1:ALEN) :: a - REAL(KIND=sp), DIMENSION(1:ALEN) :: b - REAL(KIND=dp), DIMENSION(1:ALEN) :: c - ENDTYPE CmpField_struct - - TYPE(CmpField_struct), DIMENSION(1:LENGTH), TARGET :: cf - TYPE(CmpField_struct), DIMENSION(1:LENGTH), TARGET :: cfr - - TYPE CmpDTSinfo_struct - INTEGER :: nsubfields - CHARACTER(LEN=5), DIMENSION(1:nmax) :: name - INTEGER(size_t), DIMENSION(1:nmax) :: offset - INTEGER(hid_t), DIMENSION(1:nmax) :: datatype - END TYPE CmpDTSinfo_struct - - TYPE(CmpDTSinfo_struct) :: dtsinfo - - TYPE fld_t_struct - REAL(KIND=sp), DIMENSION(1:ALEN) :: b - END TYPE fld_t_struct - - INTEGER(SIZE_T) :: type_sizei ! Size of the integer datatype - INTEGER(SIZE_T) :: type_sizer ! Size of the real datatype - INTEGER(SIZE_T) :: type_sized ! Size of the double datatype - INTEGER(SIZE_T) :: sizeof_compound ! total size of compound - - TYPE(fld_t_struct), DIMENSION(1:LENGTH), TARGET :: fld - TYPE(fld_t_struct), DIMENSION(1:LENGTH), TARGET :: fldr - - CHARACTER(LEN=10), PARAMETER :: FILENAME = "tarray3.h5" - - INTEGER(HSIZE_T), ALLOCATABLE, DIMENSION(:) :: rdims1 ! Array dimensions for reading - INTEGER(HSIZE_T), ALLOCATABLE, DIMENSION(:) :: rdims ! Array dimensions for reading - - INTEGER :: error - TYPE(c_ptr) :: f_ptr - -! Initialize the data -! ------------------- - - DO i = 1, LENGTH - DO j = 1, ALEN - cf(i)%a(j) = 100*(i+1) + j - cf(i)%b(j) = (100.*(i+1) + 0.01*j) - cf(i)%c(j) = 100.*(i+1) + 0.02*j - ENDDO - ENDDO - - ! Set the number of data members - ! ------------------------------ - - dtsinfo%nsubfields = 3 - - ! Initialize the offsets - ! ----------------------- - CALL h5tget_size_f(H5T_NATIVE_INTEGER, type_sizei, error) - CALL check("h5tget_size_f", error, total_error) - IF(h5_sizeof(cf(1)%b(1)).EQ.4_size_t)THEN - CALL h5tget_size_f(H5T_NATIVE_REAL_4, type_sizer, error) - CALL check("h5tget_size_f", error, total_error) - ELSE IF(h5_sizeof(cf(1)%b(1)).EQ.8_size_t)THEN - CALL h5tget_size_f(H5T_NATIVE_REAL_8, type_sizer, error) - CALL check("h5tget_size_f", error, total_error) - ENDIF - - CALL h5tget_size_f(H5T_NATIVE_DOUBLE, type_sized, error) - CALL check("h5tget_size_f", error, total_error) - - dtsinfo%offset(1) = H5OFFSETOF(C_LOC(cf(1)),C_LOC(cf(1)%a(1))) - dtsinfo%offset(2) = H5OFFSETOF(C_LOC(cf(1)),C_LOC(cf(1)%b(1))) - dtsinfo%offset(3) = H5OFFSETOF(C_LOC(cf(1)),C_LOC(cf(1)%c(1))) - - - ! Initialize the data type IDs - ! ---------------------------- - dtsinfo%datatype(1) = H5T_NATIVE_INTEGER; - dtsinfo%datatype(2) = H5T_NATIVE_REAL_4; - dtsinfo%datatype(3) = H5T_NATIVE_REAL_8; - - - ! Initialize the names of data members - ! ------------------------------------ - - dtsinfo%name(1) = "One " - dtsinfo%name(2) = "Two " - dtsinfo%name(3) = "Three" - - ! Create file - ! ----------- - CALL h5fcreate_f(FILENAME,H5F_ACC_TRUNC_F,fid,error) - CALL check("h5fcreate_f", error, total_error) - - - ! Create data space - ! ----------------- - CALL h5screate_simple_f(RANK, dim, space, error) - CALL check("h5screate_simple_f", error, total_error) - - - ! Create the memory data type - ! --------------------------- - - CALL h5tcreate_f(H5T_COMPOUND_F, H5OFFSETOF(C_LOC(cf(1)), C_LOC(cf(2))), type, error) - CALL check("h5tcreate_f", error, total_error) - - ! Add members to the compound data type - ! -------------------------------------- - - DO i = 1, dtsinfo%nsubfields - CALL h5tarray_create_f(dtsinfo%datatype(i), ndims(i), dima, array_dt, error) - CALL check("h5tarray_create_f", error, total_error) - CALL H5Tinsert_f(type, dtsinfo%name(i), dtsinfo%offset(i), array_dt, error) - CALL check("h5tinsert_f", error, total_error) - - CALL h5tclose_f(array_dt,error) - CALL check("h5tclose_f", error, total_error) - ENDDO - - ! Create the dataset - ! ------------------ / - CALL h5dcreate_f(fid,FIELDNAME,type, space, dataset,error) - CALL check("h5dcreate_f", error, total_error) - - ! Write data to the dataset - ! ------------------------- - - ALLOCATE(rdims(1:2)) ! dummy not needed - - f_ptr = C_LOC(cf(1)) - - CALL h5dwrite_f(dataset, type, f_ptr, error ) - CALL check("h5dwrite_f", error, total_error) - - - ALLOCATE(rdims1(1:2)) ! dummy not needed - f_ptr = C_LOC(cfr(1)) - CALL H5Dread_f(dataset, type, f_ptr, error) - CALL check("H5Dread_f", error, total_error) - - ! Verify correct data - ! ------------------- - DO i = 1, LENGTH - DO j = 1, ALEN - IF( cf(i)%a(j) .NE. cfr(i)%a(j) )THEN - PRINT*, 'ERROR: Wrong integer data is read back by H5Dread_f ' - total_error = total_error + 1 - ENDIF - IF( .NOT.dreal_eq( REAL(cf(i)%b(j),dp), REAL( cfr(i)%b(j), dp)) ) THEN - PRINT*, 'ERROR: Wrong real data is read back by H5Dread_f ' - total_error = total_error + 1 - ENDIF - IF( .NOT.dreal_eq( REAL(cf(i)%c(j),dp), REAL( cfr(i)%c(j), dp)) ) THEN - PRINT*, 'ERROR: Wrong double data is read back by H5Dread_f ' - total_error = total_error + 1 - ENDIF - ENDDO - ENDDO - - - ! Release IDs - ! ----------- - CALL h5tclose_f(type,error) - CALL check("h5tclose_f", error, total_error) - CALL h5sclose_f(space,error) - CALL check("h5sclose_f", error, total_error) - CALL h5dclose_f(dataset, error) - CALL check("h5dclose_f", error, total_error) - CALL h5fclose_f(fid,error) - CALL check("h5fclose_f", error, total_error) - - !**************************** - ! Reopen the file and update - !**************************** - - CALL h5fopen_f (FILENAME, H5F_ACC_RDWR_F, fid, error) - CALL check("h5fopen_f", error, total_error) - - CALL h5dopen_f(fid, FIELDNAME, dataset, error) - CALL check("h5dopen_f", error, total_error) - - sizeof_compound = INT( type_sizer*ALEN, size_t) - - CALL h5tcreate_f(H5T_COMPOUND_F, sizeof_compound , type, error) - CALL check("h5tcreate_f", error, total_error) - - CALL h5tarray_create_f(H5T_NATIVE_REAL_4, 1, dima, array_dt, error) - CALL check("h5tarray_create_f", error, total_error) - - CALL h5tinsert_f(TYPE, "Two", 0_size_t, array_dt, error) - CALL check("h5tinsert_f", error, total_error) - - ! Initialize the data to overwrite - ! -------------------------------- - DO i = 1, LENGTH - DO j = 1, ALEN - fld(i)%b(j) = 1.313 - cf(i)%b(j) = fld(i)%b(j) - ENDDO - ENDDO - - f_ptr = C_LOC(fld(1)) - - CALL h5dwrite_f(dataset, TYPE, f_ptr, error ) - CALL check("h5dwrite_f", error, total_error) - - - ! Read just the field changed - - f_ptr = C_LOC(fldr(1)) - CALL H5Dread_f(dataset, TYPE, f_ptr, error) - CALL check("H5Dread_f", error, total_error) - - DO i = 1, LENGTH - DO j = 1, ALEN - IF( .NOT.dreal_eq( REAL(fld(i)%b(j),dp), REAL( fldr(i)%b(j), dp)) ) THEN - PRINT*, 'ERROR: Wrong real data is read back by H5Dread_f ' - total_error = total_error + 1 - ENDIF - ENDDO - ENDDO - CALL h5tclose_f(TYPE,error) - CALL check("h5tclose_f", error, total_error) - CALL h5tclose_f(array_dt,error) - CALL check("h5tclose_f", error, total_error) - - CALL h5dget_type_f(dataset, type, error) - CALL check("h5dget_type_f", error, total_error) - - - ! Read the entire dataset again - - f_ptr = C_LOC(cfr(1)) - CALL H5Dread_f(dataset, TYPE, f_ptr, error) - CALL check("H5Dread_f", error, total_error) - - - ! Verify correct data - ! ------------------- - - DO i = 1, LENGTH - DO j = 1, ALEN - IF( cf(i)%a(j) .NE. cfr(i)%a(j) )THEN - PRINT*, 'ERROR: Wrong integer data is read back by H5Dread_f ' - total_error = total_error + 1 - ENDIF - IF( .NOT.dreal_eq( REAL(cf(i)%b(j),dp), REAL(cfr(i)%b(j), dp)) ) THEN - PRINT*, 'ERROR: Wrong real data is read back by H5Dread_f ' - total_error = total_error + 1 - ENDIF - IF( .NOT.dreal_eq( REAL(cf(i)%c(j),dp), REAL(cfr(i)%c(j), dp)) ) THEN - PRINT*, 'ERROR: Wrong double data is read back by H5Dread_f ' - total_error = total_error + 1 - ENDIF - ENDDO - ENDDO - - CALL h5dclose_f(dataset, error) - CALL check("h5dclose_f", error, total_error) - - CALL h5tclose_f(type,error) - CALL check("h5tclose_f", error, total_error) - - CALL h5fclose_f(fid,error) - CALL check("h5fclose_f", error, total_error) - -!************************************************** -! Reopen the file and print out all the data again -!************************************************** - - CALL h5fopen_f (FILENAME, H5F_ACC_RDWR_F, fid, error) - CALL check("h5fopen_f", error, total_error) - - - CALL h5dopen_f(fid, FIELDNAME, dataset, error) - CALL check("h5dopen_f", error, total_error) - - - CALL h5dget_type_f(dataset, type, error) - CALL check("h5dget_type_f", error, total_error) - - - ! Reset the data to read in - ! ------------------------- - - DO i = 1, LENGTH - cfr(i)%a(:) = 0 - cfr(i)%b(:) = 0 - cfr(i)%c(:) = 0 - ENDDO - - f_ptr = C_LOC(cfr(1)) - CALL H5Dread_f(dataset, TYPE, f_ptr, error) - CALL check("H5Dread_f", error, total_error) - - ! Verify correct data - ! ------------------- - - DO i = 1, LENGTH - DO j = 1, ALEN - IF( cf(i)%a(j) .NE. cfr(i)%a(j) )THEN - PRINT*, 'ERROR: Wrong integer data is read back by H5Dread_f ' - total_error = total_error + 1 - ENDIF - IF( .NOT.dreal_eq( REAL(cf(i)%b(j),dp), REAL(cfr(i)%b(j), dp)) ) THEN - PRINT*, 'ERROR: Wrong real data is read back by H5Dread_f ' - total_error = total_error + 1 - ENDIF - IF( .NOT.dreal_eq( REAL(cf(i)%c(j),dp), REAL(cfr(i)%c(j), dp)) ) THEN - PRINT*, 'ERROR: Wrong double data is read back by H5Dread_f ' - total_error = total_error + 1 - ENDIF - ENDDO - ENDDO - - CALL h5dclose_f(dataset, error) - CALL check("h5dclose_f", error, total_error) - - CALL h5tclose_f(type,error) - CALL check("h5tclose_f", error, total_error) - - CALL h5fclose_f(fid,error) - CALL check("h5fclose_f", error, total_error) - - END SUBROUTINE test_array_bkg - - - - SUBROUTINE test_h5kind_to_type(total_error) - - USE ISO_C_BINDING - USE HDF5 ! This module contains all necessary modules - USE TH5_MISC - - IMPLICIT NONE - - INTEGER, INTENT(INOUT) :: total_error - - INTEGER, PARAMETER :: int_kind_1 = SELECTED_INT_KIND(Fortran_INTEGER_1) !should map to INTEGER*1 on most modern processors - INTEGER, PARAMETER :: int_kind_4 = SELECTED_INT_KIND(Fortran_INTEGER_2) !should map to INTEGER*2 on most modern processors - INTEGER, PARAMETER :: int_kind_8 = SELECTED_INT_KIND(Fortran_INTEGER_4) !should map to INTEGER*4 on most modern processors - INTEGER, PARAMETER :: int_kind_16 = SELECTED_INT_KIND(Fortran_INTEGER_8) !should map to INTEGER*8 on most modern processors - - INTEGER, PARAMETER :: real_kind_7 = SELECTED_REAL_KIND(Fortran_REAL_4) !should map to REAL*4 on most modern processors - INTEGER, PARAMETER :: real_kind_15 = SELECTED_REAL_KIND(Fortran_REAL_8) !should map to REAL*8 on most modern processors - - CHARACTER(LEN=12), PARAMETER :: filename = "dsetf_F03.h5" ! File name - CHARACTER(LEN=5), PARAMETER :: dsetname1 = "dset1" ! Dataset name - CHARACTER(LEN=5), PARAMETER :: dsetname2 = "dset2" ! Dataset name - CHARACTER(LEN=5), PARAMETER :: dsetname4 = "dset4" ! Dataset name - CHARACTER(LEN=5), PARAMETER :: dsetname8 = "dset8" ! Dataset name - CHARACTER(LEN=6), PARAMETER :: dsetnamer = "dsetr" ! Dataset name - CHARACTER(LEN=6), PARAMETER :: dsetnamer4 = "dsetr4" ! Dataset name - CHARACTER(LEN=6), PARAMETER :: dsetnamer8 = "dsetr8" ! Dataset name - - INTEGER(HID_T) :: file_id ! File identifier - INTEGER(HID_T) :: dset_id1 ! Dataset identifier - INTEGER(HID_T) :: dset_id4 ! Dataset identifier - INTEGER(HID_T) :: dset_id8 ! Dataset identifier - INTEGER(HID_T) :: dset_id16 ! Dataset identifier - INTEGER(HID_T) :: dset_idr ! Dataset identifier - INTEGER(HID_T) :: dset_idr4 ! Dataset identifier - INTEGER(HID_T) :: dset_idr8 ! Dataset identifier - - INTEGER :: error ! Error flag - INTEGER :: i - -! Data buffers: - - INTEGER(int_kind_1), DIMENSION(1:4), TARGET :: dset_data_i1, data_out_i1 - INTEGER(int_kind_4), DIMENSION(1:4), TARGET :: dset_data_i4, data_out_i4 - INTEGER(int_kind_8), DIMENSION(1:4), TARGET :: dset_data_i8, data_out_i8 - INTEGER(int_kind_16), DIMENSION(1:4), TARGET :: dset_data_i16, data_out_i16 - - REAL, DIMENSION(1:4), TARGET :: dset_data_r, data_out_r - REAL(real_kind_7), DIMENSION(1:4), TARGET :: dset_data_r7, data_out_r7 - REAL(real_kind_15), DIMENSION(1:4), TARGET :: dset_data_r15, data_out_r15 - - INTEGER(HSIZE_T), DIMENSION(1:1) :: data_dims = (/4/) - INTEGER(HID_T) :: dspace_id ! Dataspace identifier - - TYPE(C_PTR) :: f_ptr - - ! - ! Initialize the dset_data array. - ! - DO i = 1, 4 - dset_data_i1(i) = i - dset_data_i4(i) = i - dset_data_i8(i) = i - dset_data_i16(i) = i - - dset_data_r(i) = (i)*100. - dset_data_r7(i) = (i)*100. - dset_data_r15(i) = (i)*1000. - - END DO - - CALL h5fcreate_f(filename, H5F_ACC_TRUNC_F, file_id, error) - CALL check("h5fcreate_f",error, total_error) - ! - ! Create dataspaces for datasets - ! - CALL h5screate_simple_f(1, data_dims , dspace_id, error) - CALL check("h5screate_simple_f",error, total_error) - ! - ! Create the dataset. - ! - CALL H5Dcreate_f(file_id, dsetname1, h5kind_to_type(int_kind_1,H5_INTEGER_KIND), dspace_id, dset_id1, error) - CALL check("H5Dcreate_f",error, total_error) - CALL H5Dcreate_f(file_id, dsetname2, h5kind_to_type(int_kind_4,H5_INTEGER_KIND), dspace_id, dset_id4, error) - CALL check("H5Dcreate_f",error, total_error) - CALL H5Dcreate_f(file_id, dsetname4, h5kind_to_type(int_kind_8,H5_INTEGER_KIND), dspace_id, dset_id8, error) - CALL check("H5Dcreate_f",error, total_error) - CALL H5Dcreate_f(file_id, dsetname8, h5kind_to_type(int_kind_16,H5_INTEGER_KIND), dspace_id, dset_id16, error) - CALL check("H5Dcreate_f",error, total_error) - - CALL H5Dcreate_f(file_id, dsetnamer, H5T_NATIVE_REAL, dspace_id, dset_idr, error) - CALL check("H5Dcreate_f",error, total_error) - CALL H5Dcreate_f(file_id, dsetnamer4, h5kind_to_type(real_kind_7,H5_REAL_KIND), dspace_id, dset_idr4, error) - CALL check("H5Dcreate_f",error, total_error) - CALL H5Dcreate_f(file_id, dsetnamer8, h5kind_to_type(real_kind_15,H5_REAL_KIND), dspace_id, dset_idr8, error) - CALL check("H5Dcreate_f",error, total_error) - - ! - ! Write the dataset. - ! - f_ptr = C_LOC(dset_data_i1(1)) - CALL h5dwrite_f(dset_id1, h5kind_to_type(int_kind_1,H5_INTEGER_KIND), f_ptr, error) - CALL check("H5Dwrite_f",error, total_error) - f_ptr = C_LOC(dset_data_i4(1)) - CALL h5dwrite_f(dset_id4, h5kind_to_type(int_kind_4,H5_INTEGER_KIND), f_ptr, error) - CALL check("H5Dwrite_f",error, total_error) - f_ptr = C_LOC(dset_data_i8(1)) - CALL h5dwrite_f(dset_id8, h5kind_to_type(int_kind_8,H5_INTEGER_KIND), f_ptr, error) - CALL check("H5Dwrite_f",error, total_error) - f_ptr = C_LOC(dset_data_i16(1)) - CALL h5dwrite_f(dset_id16, h5kind_to_type(int_kind_16,H5_INTEGER_KIND), f_ptr, error) - CALL check("H5Dwrite_f",error, total_error) - f_ptr = C_LOC(dset_data_r(1)) - CALL h5dwrite_f(dset_idr, H5T_NATIVE_REAL, f_ptr, error) - CALL check("H5Dwrite_f",error, total_error) - f_ptr = C_LOC(dset_data_r7(1)) - CALL h5dwrite_f(dset_idr4, h5kind_to_type(real_kind_7,H5_REAL_KIND), f_ptr, error) - CALL check("H5Dwrite_f",error, total_error) - f_ptr = C_LOC(dset_data_r15(1)) - CALL h5dwrite_f(dset_idr8, h5kind_to_type(real_kind_15,H5_REAL_KIND), f_ptr, error) - CALL check("H5Dwrite_f",error, total_error) - ! - ! Close the file - ! - CALL h5fclose_f(file_id, error) - CALL check("h5fclose_f",error, total_error) - - ! Open the file - - CALL h5fopen_f(filename, H5F_ACC_RDONLY_F, file_id, error) - CALL check("h5fopen_f",error, total_error) - ! - ! Read the dataset. - ! - ! Read data back into an integer size that is larger then the original size used for - ! writing the data - f_ptr = C_LOC(data_out_i1) - CALL h5dread_f(dset_id1, h5kind_to_type(int_kind_1,H5_INTEGER_KIND), f_ptr, error) - CALL check("h5dread_f",error, total_error) - f_ptr = C_LOC(data_out_i4) - CALL h5dread_f(dset_id4, h5kind_to_type(int_kind_4,H5_INTEGER_KIND), f_ptr, error) - CALL check("h5dread_f",error, total_error) - f_ptr = C_LOC(data_out_i8) - CALL h5dread_f(dset_id8, h5kind_to_type(int_kind_8,H5_INTEGER_KIND), f_ptr, error) - CALL check("h5dread_f",error, total_error) - f_ptr = C_LOC(data_out_i16) - CALL h5dread_f(dset_id16, h5kind_to_type(int_kind_16,H5_INTEGER_KIND), f_ptr, error) - CALL check("h5dread_f",error, total_error) - f_ptr = C_LOC(data_out_r) - CALL h5dread_f(dset_idr, H5T_NATIVE_REAL, f_ptr, error) - CALL check("h5dread_f",error, total_error) - f_ptr = C_LOC(data_out_r7) - CALL h5dread_f(dset_idr4, h5kind_to_type(real_kind_7,H5_REAL_KIND), f_ptr, error) - CALL check("h5dread_f",error, total_error) - f_ptr = C_LOC(data_out_r15) - CALL h5dread_f(dset_idr8, h5kind_to_type(real_kind_15,H5_REAL_KIND), f_ptr, error) - CALL check("h5dread_f",error, total_error) - - DO i = 1, 4 - - CALL verify_Fortran_INTEGER_4("h5kind_to_type1",INT(dset_data_i1(i),int_kind_8),INT(data_out_i1(i),int_kind_8),total_error) - CALL verify_Fortran_INTEGER_4("h5kind_to_type2",INT(dset_data_i4(i),int_kind_8),INT(data_out_i4(i),int_kind_8),total_error) - CALL verify_Fortran_INTEGER_4("h5kind_to_type3",INT(dset_data_i8(i),int_kind_8),INT(data_out_i8(i),int_kind_8),total_error) - CALL verify_Fortran_INTEGER_4("h5kind_to_type4",INT(dset_data_i16(i),int_kind_8),INT(data_out_i16(i),int_kind_8),total_error) - - CALL verify_real_kind_7("h5kind_to_type5",REAL(dset_data_r(i),real_kind_7),REAL(data_out_r(i),real_kind_7),total_error) - CALL verify_real_kind_7("h5kind_to_type6",REAL(dset_data_r7(i),real_kind_7),REAL(data_out_r7(i),real_kind_7),total_error) - CALL verify_real_kind_7("h5kind_to_type7",REAL(dset_data_r15(i),real_kind_7),REAL(data_out_r15(i),real_kind_7),total_error) - - END DO - - ! - ! Close the dataset. - ! - CALL h5dclose_f(dset_id1, error) - CALL check("h5dclose_f",error, total_error) - CALL h5dclose_f(dset_id4, error) - CALL check("h5dclose_f",error, total_error) - CALL h5dclose_f(dset_id8, error) - CALL check("h5dclose_f",error, total_error) - CALL h5dclose_f(dset_id16, error) - CALL check("h5dclose_f",error, total_error) - CALL h5dclose_f(dset_idr4, error) - CALL check("h5dclose_f",error, total_error) - CALL h5dclose_f(dset_idr8, error) - CALL check("h5dclose_f",error, total_error) - ! - ! Close the file. - ! - CALL h5fclose_f(file_id, error) - CALL check("h5fclose_f",error, total_error) - -END SUBROUTINE test_h5kind_to_type - -!************************************************************ -! -! This test reads and writes array datatypes -! to a dataset. The test first writes integers arrays of -! dimension ADIM0xADIM1 to a dataset with a dataspace of -! DIM0, then closes the file. Next, it reopens the file, -! reads back the data. -! -!************************************************************ -SUBROUTINE t_array(total_error) - - USE ISO_C_BINDING - USE HDF5 - USE TH5_MISC - - IMPLICIT NONE - - INTEGER, INTENT(INOUT) :: total_error - - CHARACTER(LEN=19), PARAMETER :: filename = "t_array_F03.h5" - CHARACTER(LEN=3) , PARAMETER :: dataset = "DS1" - INTEGER , PARAMETER :: dim0 = 4 - INTEGER , PARAMETER :: adim0 = 3 - INTEGER , PARAMETER :: adim1 = 5 - INTEGER(HID_T) :: file, filetype, memtype, space, dset ! Handles - INTEGER(HSIZE_T), DIMENSION(1:1) :: dims = (/dim0/) - INTEGER(HSIZE_T), DIMENSION(1:2) :: adims = (/adim0, adim1/) - INTEGER(HSIZE_T), DIMENSION(1:2) :: maxdims - INTEGER, DIMENSION(1:dim0, 1:adim0, 1:adim1), TARGET :: wdata ! Write buffer - INTEGER, DIMENSION(:,:,:), ALLOCATABLE, TARGET :: rdata ! Read buffer - INTEGER :: i, j, k - TYPE(C_PTR) :: f_ptr - INTEGER :: error ! Error flag - - ! - ! Initialize data. i is the element in the dataspace, j and k the - ! elements within the array datatype. - ! - DO i = 1, dim0 - DO j = 1, adim0 - DO k = 1, adim1 - wdata(i,j,k) = (i-1)*(j-1)-(j-1)*(k-1)+(i-1)*(k-1) - ENDDO - ENDDO - ENDDO - ! - ! Create a new file using the default properties. - ! - CALL h5fcreate_f(filename, H5F_ACC_TRUNC_F, file, error) - CALL check("h5fcreate_f",error, error) - ! - ! Create array datatypes for file and memory. - ! - CALL H5Tarray_create_f(INT(H5T_STD_I64LE, HID_T), 2, adims, filetype, error) - CALL check("H5Tarray_create_f",error, total_error) - CALL H5Tarray_create_f(H5T_NATIVE_INTEGER, 2, adims, memtype, error) - CALL check("H5Tarray_create_f",error, total_error) - ! - ! Create dataspace. Setting maximum size to be the current size. - ! - CALL h5screate_simple_f(1, dims, space, error) - CALL check("h5screate_simple_f",error, total_error) - ! - ! Create the dataset and write the array data to it. - ! - CALL h5dcreate_f(file, dataset, filetype, space, dset, error) - CALL check("h5dcreate_f",error, total_error) - f_ptr = C_LOC(wdata) - CALL h5dwrite_f(dset, memtype, f_ptr, error) - CALL check("h5dwrite_f",error, total_error) - ! - ! Close and release resources. - ! - CALL H5Dclose_f(dset, error) - CALL check("h5dclose_f",error, total_error) - CALL H5Sclose_f(space, error) - CALL check("h5sclose_f",error, total_error) - CALL H5Tclose_f(filetype, error) - CALL check("h5tclose_f",error, total_error) - CALL H5Tclose_f(memtype, error) - CALL check("h5tclose_f",error, total_error) - CALL H5Fclose_f(file, error) - CALL check("h5fclose_f",error, total_error) - ! - ! Now we begin the read section of this example. - ! - ! Open file, dataset, and attribute. - ! - CALL h5fopen_f(filename, H5F_ACC_RDONLY_F, file, error) - CALL check("h5fopen_f",error, total_error) - CALL h5dopen_f(file, dataset, dset, error) - CALL check("h5dopen_f",error, total_error) - ! - ! Get the datatype and its dimensions. - ! - CALL h5dget_type_f(dset, filetype, error) - CALL check("h5dget_type_f",error, error) - CALL H5Tget_array_dims_f(filetype, adims, error) - CALL check("h5dget_type_f",error, total_error) - CALL VERIFY("H5Tget_array_dims_f", INT(adims(1)), adim0, total_error) - CALL VERIFY("H5Tget_array_dims_f", INT(adims(2)), adim1, total_error) - ! - ! Get dataspace and allocate memory for read buffer. This is a - ! three dimensional attribute when the array datatype is included. - ! - CALL H5Dget_space_f(dset, space, error) - CALL check("H5Dget_space_f",error, error) - CALL H5Sget_simple_extent_dims_f(space, dims, maxdims, error) - CALL check("H5Sget_simple_extent_dims_f",error, total_error) - CALL VERIFY("H5Sget_simple_extent_dims_f", INT(dims(1)), dim0, total_error) - - ALLOCATE(rdata(1:dims(1),1:adims(1),1:adims(2))) - ! - ! Create the memory datatype. - ! - CALL H5Tarray_create_f(H5T_NATIVE_INTEGER, 2, adims, memtype, error) - CALL check("H5Tarray_create_f",error, total_error) - ! - ! Read the data. - ! - - f_ptr = C_LOC(rdata) - CALL H5Dread_f(dset, memtype, f_ptr, error) - CALL check("H5Dread_f",error, total_error) - ! - ! Output the data to the screen. - ! - i_loop: DO i = 1, INT(dims(1)) - DO j=1, INT(adim0) - DO k = 1, INT(adim1) - CALL VERIFY("H5Sget_simple_extent_dims_f", rdata(i,j,k), wdata(i,j,k), total_error) - IF(total_error.NE.0) EXIT i_loop - ENDDO - ENDDO - ENDDO i_loop - ! - ! Close and release resources. - ! - DEALLOCATE(rdata) - CALL H5Dclose_f(dset, error) - CALL check("h5dclose_f",error, total_error) - CALL H5Sclose_f(space, error) - CALL check("h5sclose_f",error, total_error) - CALL H5Tclose_f(filetype, error) - CALL check("h5tclose_f",error, total_error) - CALL H5Tclose_f(memtype, error) - CALL check("h5tclose_f",error, total_error) - CALL H5Fclose_f(file, error) - CALL check("h5fclose_f",error, total_error) - -END SUBROUTINE t_array - -SUBROUTINE t_enum(total_error) - - USE HDF5 - USE TH5_MISC - USE ISO_C_BINDING - - IMPLICIT NONE - - INTEGER, INTENT(INOUT) :: total_error - - CHARACTER(LEN=19), PARAMETER :: filename = "t_enum_F03.h5" - CHARACTER(LEN=3) , PARAMETER :: dataset = "DS1" - INTEGER , PARAMETER :: dim0 = 4 - INTEGER , PARAMETER :: dim1 = 7 - INTEGER(HID_T) :: F_BASET ! File base type - INTEGER(HID_T) :: M_BASET ! Memory base type - INTEGER(SIZE_T) , PARAMETER :: NAME_BUF_SIZE = 16 - -! Enumerated type - INTEGER, PARAMETER :: SOLID=0, LIQUID=1, GAS=2, PLASMA=3 - - INTEGER(HID_T) :: file, filetype, memtype, space, dset ! Handles - - INTEGER(hsize_t), DIMENSION(1:2) :: dims = (/dim0, dim1/) - INTEGER, DIMENSION(1:dim0, 1:dim1), TARGET :: wdata ! Write buffer - INTEGER, DIMENSION(:,:), ALLOCATABLE, TARGET :: rdata ! Read buffer - INTEGER, DIMENSION(1:1), TARGET :: val - - CHARACTER(LEN=6), DIMENSION(1:4) :: & - names = (/"SOLID ", "LIQUID", "GAS ", "PLASMA"/) - CHARACTER(LEN=NAME_BUF_SIZE) :: name - INTEGER(HSIZE_T), DIMENSION(1:2) :: maxdims - INTEGER :: i, j, idx - TYPE(C_PTR) :: f_ptr - INTEGER :: error ! Error flag - ! - ! Initialize DATA. - ! - F_BASET = H5T_STD_I16BE ! File base type - M_BASET = H5T_NATIVE_INTEGER ! Memory base type - DO i = 1, dim0 - DO j = 1, dim1 - wdata(i,j) = MOD( (j-1)*(i-1), PLASMA+1) - ENDDO - ENDDO - ! - ! Create a new file using the default properties. - ! - CALL h5fcreate_f(filename, H5F_ACC_TRUNC_F, file, error) - CALL check("h5fcreate_f",error, total_error) - ! - ! Create the enumerated datatypes for file and memory. This - ! process is simplified IF native types are used for the file, - ! as only one type must be defined. - ! - CALL h5tenum_create_f(F_BASET, filetype, error) - CALL check("h5tenum_create_f",error, total_error) - - CALL h5tenum_create_f(M_BASET, memtype, error) - CALL check("h5tenum_create_f",error, total_error) - - DO i = SOLID, PLASMA - ! - ! Insert enumerated value for memtype. - ! - val(1) = i - CALL H5Tenum_insert_f(memtype, TRIM(names(i+1)), C_LOC(val(1)), error) - CALL check("H5Tenum_insert_f", error, total_error) - ! - ! Insert enumerated value for filetype. We must first convert - ! the numerical value val to the base type of the destination. - ! - f_ptr = C_LOC(val(1)) - CALL H5Tconvert_f(M_BASET, F_BASET, INT(1,SIZE_T), f_ptr, error) - CALL check("H5Tconvert_f",error, total_error) - IF(i.GE.1)THEN ! test both F90 and F03 APIs - CALL H5Tenum_insert_f(filetype, TRIM(names(i+1)), f_ptr, error) - ELSE - CALL H5Tenum_insert_f(filetype, TRIM(names(i+1)), val(1), error) - ENDIF - CALL check("H5Tenum_insert_f",error, total_error) - ENDDO - ! - ! Create dataspace. Setting maximum size to be the current size. - ! - CALL h5screate_simple_f(2, dims, space, total_error) - CALL check("h5screate_simple_f",error, total_error) - ! - ! Create the dataset and write the enumerated data to it. - ! - CALL h5dcreate_f(file, dataset, filetype, space, dset, error) - CALL check("h5dcreate_f",error, total_error) - f_ptr = C_LOC(wdata(1,1)) - CALL h5dwrite_f(dset, memtype, f_ptr, error) - CALL check("h5dwrite_f",error, total_error) - ! - ! Close and release resources. - ! - CALL h5dclose_f(dset , error) - CALL check("h5dclose_f",error, total_error) - CALL h5sclose_f(space, error) - CALL check("h5sclose_f",error, total_error) - CALL h5tclose_f(filetype, error) - CALL check("h5tclose_f",error, total_error) - CALL h5fclose_f(file , error) - CALL check("h5fclose_f",error, total_error) - - ! - ! Now we begin the read section of this example. - ! - ! Open file and dataset. - ! - CALL h5fopen_f(filename, H5F_ACC_RDONLY_F, file, error) - CALL check("h5fopen_f",error, total_error) - CALL h5dopen_f (file, dataset, dset, error) - CALL check("h5dopen_f",error, total_error) - CALL h5dopen_f(file, dataset, dset, error) - CALL check("h5dopen_f",error, total_error) - ! - ! Get dataspace and allocate memory for read buffer. - ! - CALL h5dget_space_f(dset,space, error) - CALL check("H5Dget_space_f",error, total_error) - CALL h5sget_simple_extent_dims_f(space, dims, maxdims, error) - CALL check("H5Sget_simple_extent_dims_f",error, total_error) - CALL VERIFY("H5Sget_simple_extent_dims_f", INT(dims(1)), dim0, total_error) - CALL VERIFY("H5Sget_simple_extent_dims_f", INT(dims(2)), dim1, total_error) - - ALLOCATE(rdata(1:dims(1),1:dims(2))) - - ! - ! Read the data. - ! - f_ptr = C_LOC(rdata(1,1)) - CALL h5dread_f(dset, memtype, f_ptr, error) - CALL check("H5Dread_f",error, total_error) - - ! - ! Output the data to the screen. - ! - i_loop: DO i = 1, INT(dims(1)) - DO j = 1, INT(dims(2)) - ! - ! Get the name of the enumeration member. - ! - CALL h5tenum_nameof_f( memtype, rdata(i,j), NAME_BUF_SIZE, name, error) - CALL check("h5tenum_nameof_f",error, total_error) - idx = MOD( (j-1)*(i-1), PLASMA+1 ) + 1 - CALL verifystring("h5tenum_nameof_f",TRIM(name),TRIM(names(idx)), total_error) - IF(total_error.NE.0) EXIT i_loop - ENDDO - ENDDO i_loop - ! - ! Close and release resources. - ! - DEALLOCATE(rdata) - CALL h5dclose_f(dset , error) - CALL check("h5dclose_f",error, total_error) - CALL h5sclose_f(space, error) - CALL check("h5sclose_f",error, total_error) - CALL h5tclose_f(memtype, error) - CALL check("h5tclose_f",error, total_error) - CALL h5fclose_f(file , error) - CALL check("h5fclose_f",error, total_error) - -END SUBROUTINE t_enum - -SUBROUTINE t_bit(total_error) - - USE HDF5 - USE TH5_MISC - USE ISO_C_BINDING - - IMPLICIT NONE - - INTEGER, INTENT(INOUT) :: total_error - - CHARACTER(LEN=20), PARAMETER :: filename = "t_bit_F03.h5" - CHARACTER(LEN=3) , PARAMETER :: dataset = "DS1" - INTEGER , PARAMETER :: dim0 = 4 - INTEGER , PARAMETER :: dim1 = 7 - - INTEGER(HID_T) :: file, space, dset ! Handles - INTEGER(HSIZE_T), DIMENSION(1:2) :: dims = (/dim0, dim1/) - INTEGER(HSIZE_T), DIMENSION(1:2) :: maxdims - INTEGER(C_SIGNED_CHAR), DIMENSION(1:dim0, 1:dim1), TARGET :: wdata ! Write buffer - INTEGER(C_SIGNED_CHAR), DIMENSION(:,:), ALLOCATABLE, TARGET :: rdata ! Read buffer - INTEGER :: A, B, C, D - INTEGER :: Aw, Bw, Cw, Dw - INTEGER :: i, j - INTEGER, PARAMETER :: hex = Z'00000003' - TYPE(C_PTR) :: f_ptr - INTEGER :: error ! Error flag - ! - ! Initialize data. We will manually pack 4 2-bit integers into - ! each unsigned char data element. - ! - DO i = 0, dim0-1 - DO j = 0, dim1-1 - wdata(i+1,j+1) = 0 - wdata(i+1,j+1) = IOR( wdata(i+1,j+1), INT(IAND(i * j - j, hex),C_SIGNED_CHAR) ) ! Field "A" - wdata(i+1,j+1) = IOR( wdata(i+1,j+1), INT(ISHFT(IAND(i,hex),2),C_SIGNED_CHAR) ) ! Field "B" - wdata(i+1,j+1) = IOR( wdata(i+1,j+1), INT(ISHFT(IAND(j,hex),4),C_SIGNED_CHAR) ) ! Field "C" - wdata(i+1,j+1) = IOR( wdata(i+1,j+1), INT(ISHFT(IAND(i+j,hex),6),C_SIGNED_CHAR) ) ! Field "D" - ENDDO - ENDDO - ! - ! Create a new file using the default properties. - ! - CALL h5fcreate_f(filename, H5F_ACC_TRUNC_F, file, error) - CALL check("h5fcreate_f",error, total_error) - ! - ! Create dataspace. Setting maximum size to be the current size. - ! - CALL h5screate_simple_f(2, dims, space, error) - CALL check("h5screate_simple_f",error, total_error) - ! - ! Create the dataset and write the bitfield data to it. - ! - CALL H5Dcreate_f(file, dataset, H5T_STD_B8BE, space, dset, error) - CALL check("h5dcreate_f",error, total_error) - f_ptr = C_LOC(wdata(1,1)) - CALL H5Dwrite_f(dset, H5T_NATIVE_B8, f_ptr, error) - CALL check("h5dwrite_f",error, total_error) - ! - ! Close and release resources. - ! - CALL H5Dclose_f(dset, error) - CALL check("h5dclose_f",error, total_error) - CALL H5Sclose_f(space, error) - CALL check("h5sclose_f",error, total_error) - CALL H5Fclose_f(file, error) - CALL check("h5fclose_f",error, total_error) - ! - ! Now we begin the read section of this example. - ! - ! Open file, dataset. - ! - CALL h5fopen_f(filename, H5F_ACC_RDONLY_F, file, error) - CALL check("h5fopen_f",error, total_error) - CALL h5dopen_f(file, dataset, dset, error) - CALL check("h5dopen_f",error, total_error) - ! - ! Get dataspace and allocate memory for read buffer. - ! - CALL H5Dget_space_f(dset, space, error) - CALL check("H5Dget_space_f",error, total_error) - CALL H5Sget_simple_extent_dims_f(space, dims, maxdims, error) - CALL check("H5Sget_simple_extent_dims_f",error, total_error) - CALL VERIFY("H5Sget_simple_extent_dims_f", INT(dims(1)), dim0, total_error) - CALL VERIFY("H5Sget_simple_extent_dims_f", INT(dims(2)), dim1, total_error) - ALLOCATE(rdata(1:dims(1),1:dims(2))) - ! - ! Read the data. - ! - f_ptr = C_LOC(rdata) - CALL H5Dread_f(dset, H5T_NATIVE_B8, f_ptr, error) - CALL check("H5Dread_f",error, total_error) - ! - ! Output the data to the screen. - ! - i_loop: DO i = 1, INT(dims(1)) - DO j = 1, INT(dims(2)) - A = IAND(rdata(i,j), INT(hex,C_SIGNED_CHAR)) ! Retrieve field "A" - B = IAND(ISHFT(rdata(i,j),-2), INT(hex,C_SIGNED_CHAR)) ! Retrieve field "B" - C = IAND(ISHFT(rdata(i,j),-4), INT(hex,C_SIGNED_CHAR)) ! Retrieve field "C" - D = IAND(ISHFT(rdata(i,j),-6), INT(hex,C_SIGNED_CHAR)) ! Retrieve field "D" - - Aw = IAND(wdata(i,j), INT(hex,C_SIGNED_CHAR)) - Bw = IAND(ISHFT(wdata(i,j),-2), INT(hex,C_SIGNED_CHAR)) - Cw = IAND(ISHFT(wdata(i,j),-4), INT(hex,C_SIGNED_CHAR)) - Dw = IAND(ISHFT(wdata(i,j),-6), INT(hex,C_SIGNED_CHAR)) - - CALL VERIFY("bitfield", A, Aw, total_error) - CALL VERIFY("bitfield", B, Bw, total_error) - CALL VERIFY("bitfield", C, Cw, total_error) - CALL VERIFY("bitfield", D, Dw, total_error) - IF(total_error.NE.0) EXIT i_loop - ENDDO - ENDDO i_loop - ! - ! Close and release resources. - ! - DEALLOCATE(rdata) - CALL H5Dclose_f(dset, error) - CALL check("h5dclose_f",error, total_error) - CALL H5Sclose_f(space, error) - CALL check("h5sclose_f",error, total_error) - CALL H5Fclose_f(file, error) - CALL check("h5fclose_f",error, total_error) - -END SUBROUTINE t_bit - -SUBROUTINE t_opaque(total_error) - - USE HDF5 - USE TH5_MISC - USE ISO_C_BINDING - - IMPLICIT NONE - - INTEGER, INTENT(INOUT) :: total_error - CHARACTER(LEN=20), PARAMETER :: filename = "t_opaque_F03.h5" - CHARACTER(LEN=3) , PARAMETER :: dataset = "DS1" - INTEGER , PARAMETER :: dim0 = 4 - INTEGER(SIZE_T) , PARAMETER :: size = 7 - INTEGER(HID_T) :: file, space, dtype, dset ! Handles - INTEGER(size_t) :: len - INTEGER(hsize_t), DIMENSION(1:1) :: dims = (/DIM0/) - - CHARACTER(LEN=size), DIMENSION(1:dim0), TARGET :: wdata ! Write buffer - CHARACTER(LEN=size), DIMENSION(:), ALLOCATABLE, TARGET :: rdata ! Read buffer - CHARACTER(LEN=size-1) :: str = "OPAQUE" - - CHARACTER(LEN=14) :: tag_sm ! Test reading obaque tag into - CHARACTER(LEN=15) :: tag_exact ! buffers that are: to small, exact - CHARACTER(LEN=17) :: tag_big ! and to big. - - INTEGER :: taglen - INTEGER(HSIZE_T), DIMENSION(1:1) :: maxdims - INTEGER(hsize_t) :: i - CHARACTER(LEN=1) :: ichr - TYPE(C_PTR) :: f_ptr - INTEGER :: error - ! - ! Initialize data. - ! - DO i = 1, dim0 - WRITE(ichr,'(I1)') i-1 - wdata(i) = str//ichr - ENDDO - ! - ! Create a new file using the default properties. - ! - CALL h5fcreate_f(filename, H5F_ACC_TRUNC_F, file, error) - CALL check("h5fcreate_f",error, total_error) - ! - ! Create opaque datatype and set the tag to something appropriate. - ! For this example we will write and view the data as a character - ! array. - ! - CALL h5tcreate_f(h5T_OPAQUE_F, size, dtype, error) - CALL check("h5tcreate_f",error, total_error) - CALL h5tset_tag_f(dtype,"Character array",error) - CALL check("h5tset_tag_f",error, total_error) - ! - ! Create dataspace. Setting maximum size to be the current size. - ! - CALL h5screate_simple_f(1, dims, space, error) - CALL check("h5screate_simple_f",error, total_error) - ! - ! Create the dataset and write the opaque data to it. - ! - CALL h5dcreate_f(file, dataset, dtype, space, dset, error) - CALL check("h5dcreate_f",error, total_error) - f_ptr = C_LOC(wdata(1)(1:1)) - CALL h5dwrite_f(dset, dtype, f_ptr, error) - CALL check("h5dwrite_f",error, total_error) - ! - ! Close and release resources. - ! - CALL H5Dclose_f(dset, error) - CALL check("h5dclose_f",error, total_error) - CALL H5Sclose_f(space, error) - CALL check("h5sclose_f",error, total_error) - CALL H5Tclose_f(dtype, error) - CALL check("h5tclose_f",error, total_error) - CALL H5Fclose_f(file, error) - CALL check("h5fclose_f",error, total_error) - ! - ! Now we begin the read section of this example. - ! - ! Open file and dataset. - ! - CALL h5fopen_f(filename, H5F_ACC_RDONLY_F, file, error) - CALL check("h5fopen_f",error, total_error) - CALL h5dopen_f(file, dataset, dset, error) - CALL check("h5dopen_f",error, total_error) - ! - ! Get datatype and properties for the datatype. - ! - CALL h5dget_type_f(dset, dtype, error) - CALL check("h5dget_type_f",error, total_error) - CALL h5tget_size_f(dtype, len, error) - CALL check("h5tget_size_f",error, total_error) - - ! Next tests should return - ! opaque_tag = tag = "Character array" and the actual length = 15 - - ! Test reading into a string that is to small - CALL h5tget_tag_f(dtype, tag_sm, taglen, error) - CALL check("h5tget_tag_f",error, total_error) - CALL VERIFY("h5tget_tag_f", taglen, 15, total_error) - CALL verifystring("h5tget_tag_f",tag_sm,"Character arra", total_error) - - ! Test reading into a string that is exact - CALL h5tget_tag_f(dtype, tag_exact, taglen, error) - CALL check("h5tget_tag_f",error, total_error) - CALL VERIFY("h5tget_tag_f", taglen, 15, total_error) - CALL verifystring("h5tget_tag_f",tag_exact,"Character array", total_error) - - ! Test reading into a string that is to big - CALL h5tget_tag_f(dtype, tag_big, taglen, error) - CALL check("h5tget_tag_f",error, total_error) - CALL VERIFY("h5tget_tag_f", taglen, 15, total_error) - CALL verifystring("h5tget_tag_f",tag_big,"Character array ", total_error) - - ! - ! Get dataspace and allocate memory for read buffer. - ! - CALL h5dget_space_f(dset, space, error) - CALL check("H5Dget_space_f",error, total_error) - CALL h5sget_simple_extent_dims_f(space, dims, maxdims, error) - CALL check("H5Sget_simple_extent_dims_f",error, total_error) - CALL VERIFY("H5Sget_simple_extent_dims_f", INT(dims(1)), dim0, total_error) - ALLOCATE(rdata(1:dims(1))) - ! - ! Read the data. - ! - f_ptr = C_LOC(rdata(1)(1:1)) - CALL h5dread_f(dset, dtype, f_ptr, error) - CALL check("H5Dread_f",error, total_error) - ! - DO i = 1, dims(1) - CALL verifystring("t_opaque",TRIM(rdata(i)),TRIM(wdata(i)), total_error) - ENDDO - ! - ! Close and release resources. - ! - DEALLOCATE(rdata) - CALL H5Dclose_f(dset, error) - CALL check("h5dclose_f",error, total_error) - CALL H5Sclose_f(space, error) - CALL check("h5sclose_f",error, total_error) - CALL H5Tclose_f(dtype, error) - CALL check("h5tclose_f",error, total_error) - CALL H5Fclose_f(file, error) - CALL check("h5fclose_f",error, total_error) - -END SUBROUTINE t_opaque - -SUBROUTINE t_objref(total_error) - - USE HDF5 - USE TH5_MISC - USE ISO_C_BINDING - - IMPLICIT NONE - - INTEGER, INTENT(INOUT) :: total_error - CHARACTER(LEN=20), PARAMETER :: filename = "t_objref_F03.h5" - CHARACTER(LEN=3) , PARAMETER :: dataset = "DS1" - INTEGER , PARAMETER :: dim0 = 2 - - INTEGER(HID_T) :: file, space, dset, obj ! Handles - INTEGER :: error - - INTEGER(hsize_t), DIMENSION(1:1) :: dims = (/dim0/) - TYPE(hobj_ref_t_f), DIMENSION(1:dim0), TARGET :: wdata ! Write buffer - TYPE(hobj_ref_t_f), DIMENSION(:), ALLOCATABLE, TARGET :: rdata ! Read buffer - INTEGER :: objtype - INTEGER(SIZE_T) :: name_size - CHARACTER(LEN=80) :: name - INTEGER(HSIZE_T), DIMENSION(1:1) :: maxdims - INTEGER :: i - TYPE(C_PTR) :: f_ptr - ! - ! Create a new file using the default properties. - ! - CALL h5fcreate_f(filename, H5F_ACC_TRUNC_F, file, error) - CALL check("h5fcreate_f",error, total_error) - ! - ! Create a dataset with a null dataspace. - ! - CALL h5screate_f(H5S_NULL_F,space,error) - CALL check("h5screate_f",error, total_error) - CALL h5dcreate_f(file, "DS2", H5T_STD_I32LE, space, obj, error) - CALL check("h5dcreate_f",error, total_error) - ! - CALL h5dclose_f(obj , error) - CALL check("h5dclose_f",error, total_error) - CALL h5sclose_f(space, error) - CALL check("h5sclose_f",error, total_error) - ! - ! Create a group. - ! - CALL h5gcreate_f(file, "G1", obj, error) - CALL check("h5gcreate_f",error, total_error) - CALL h5gclose_f(obj, error) - CALL check("h5gclose_f",error, total_error) - ! - ! Create references to the previously created objects. note, space_id - ! is not needed for object references. - ! - f_ptr = C_LOC(wdata(1)) - CALL H5Rcreate_f(file, "G1", H5R_OBJECT_F, f_ptr, error) - CALL check("H5Rcreate_f",error, total_error) - f_ptr = C_LOC(wdata(2)) - CALL H5Rcreate_f(file, "DS2", H5R_OBJECT_F, f_ptr, error) - CALL check("H5Rcreate_f",error, total_error) - ! - ! Create dataspace. Setting maximum size to be the current size. - ! - CALL h5screate_simple_f(1, dims, space, error) - CALL check("h5screate_simple_f",error, total_error) - ! - ! Create the dataset and write the object references to it. - ! - CALL h5dcreate_f(file, dataset, H5T_STD_REF_OBJ, space, dset, error) - CALL check("h5dcreate_f",error, total_error) - - f_ptr = C_LOC(wdata(1)) - CALL h5dwrite_f(dset, H5T_STD_REF_OBJ, f_ptr, error) - CALL check("h5dwrite_f",error, total_error) - ! - ! Close and release resources. - ! - CALL h5dclose_f(dset , error) - CALL check("h5dclose_f",error, total_error) - CALL h5sclose_f(space, error) - CALL check("h5sclose_f",error, total_error) - CALL h5fclose_f(file , error) - CALL check("h5fclose_f",error, total_error) - ! - ! Now we begin the read section of this example. - ! - ! Open file and dataset. - ! - CALL h5fopen_f(filename, H5F_ACC_RDONLY_F, file, error) - CALL check("h5fopen_f",error, total_error) - CALL h5dopen_f(file, dataset, dset, error) - CALL check("h5dopen_f",error, total_error) - ! - ! Get dataspace and allocate memory for read buffer. - ! - CALL h5dget_space_f(dset, space, error) - CALL check("H5Dget_space_f",error, total_error) - CALL h5sget_simple_extent_dims_f(space, dims, maxdims, error) - CALL check("H5Sget_simple_extent_dims_f",error, total_error) - CALL VERIFY("H5Sget_simple_extent_dims_f", INT(dims(1)), dim0, total_error) - - ALLOCATE(rdata(1:maxdims(1))) - ! - ! Read the data. - ! - f_ptr = C_LOC(rdata(1)) - CALL h5dread_f( dset, H5T_STD_REF_OBJ, f_ptr, error) - CALL check("H5Dread_f",error, total_error) - ! - ! Output the data to the screen. - ! - DO i = 1, INT(maxdims(1)) - ! - ! Open the referenced object, get its name and type. - ! - f_ptr = C_LOC(rdata(i)) - CALL H5Rdereference_f(dset, H5R_OBJECT_F, f_ptr, obj, error) - CALL check("H5Rdereference_f",error, total_error) - CALL H5Rget_obj_type_f(dset, H5R_OBJECT_F, f_ptr, objtype, error) - CALL check("H5Rget_obj_type_f",error, total_error) - ! - ! Get the length of the name and name - ! - name(:) = ' ' ! initialize string to blanks - CALL H5Iget_name_f(obj, name, 80_size_t, name_size, error) - CALL check("H5Iget_name_f",error, total_error) - ! - ! Print the object type and close the object. - ! - IF(objtype.EQ.H5G_GROUP_F)THEN - CALL verifystring("t_objref", name(1:name_size),"/G1", total_error) - ELSE IF(objtype.EQ.H5G_DATASET_F)THEN - CALL verifystring("t_objref", name(1:name_size),"/DS2", total_error) - ELSE - total_error = total_error + 1 - ENDIF - CALL h5oclose_f(obj, error) - CALL check("h5oclose_f",error, total_error) - - END DO - ! - ! Close and release resources. - ! - DEALLOCATE(rdata) - CALL h5dclose_f(dset , error) - CALL check("h5dclose_f",error, total_error) - CALL h5sclose_f(space, error) - CALL check("h5sclose_f",error, total_error) - CALL h5fclose_f(file , error) - CALL check("h5fclose_f",error, total_error) - -END SUBROUTINE t_objref - - -SUBROUTINE t_regref(total_error) - - USE HDF5 - USE TH5_MISC - USE ISO_C_BINDING - - IMPLICIT NONE - - INTEGER, INTENT(INOUT) :: total_error - CHARACTER(LEN=22), PARAMETER :: filename = "t_regref_F03.h5" - CHARACTER(LEN=3) , PARAMETER :: dataset = "DS1" - CHARACTER(LEN=3) , PARAMETER :: dataset2 = "DS2" - INTEGER , PARAMETER :: dim0 = 2 - INTEGER , PARAMETER :: ds2dim0 = 16 - INTEGER , PARAMETER :: ds2dim1 = 3 - - INTEGER(HID_T) :: file, memspace, space, dset, dset2 ! Handles - INTEGER :: error - - INTEGER(HSIZE_T), DIMENSION(1:1) :: dims = (/dim0/) - INTEGER(HSIZE_T), DIMENSION(1:1) :: dims3 - INTEGER(HSIZE_T), DIMENSION(1:2) :: dims2 = (/ds2dim0,ds2dim1/) - - INTEGER(HSIZE_T), DIMENSION(1:2,1:4) :: coords = RESHAPE((/2,1,12,3,1,2,5,3/),(/2,4/)) - - INTEGER(HSIZE_T), DIMENSION(1:2) :: start=(/0,0/),stride=(/11,2/),count=(/2,2/), BLOCK=(/3,1/) - - INTEGER(HSIZE_T), DIMENSION(1:1) :: maxdims - INTEGER(hssize_t) :: npoints - TYPE(hdset_reg_ref_t_f03), DIMENSION(1:dim0), TARGET :: wdata ! Write buffer - TYPE(hdset_reg_ref_t_f03), DIMENSION(:), ALLOCATABLE, TARGET :: rdata ! Read buffer - - INTEGER(size_t) :: size - CHARACTER(LEN=1), DIMENSION(1:ds2dim0,1:ds2dim1), TARGET :: wdata2 - - CHARACTER(LEN=80),DIMENSION(1:1), TARGET :: rdata2 - CHARACTER(LEN=80) :: name - INTEGER(hsize_t) :: i - TYPE(C_PTR) :: f_ptr - CHARACTER(LEN=ds2dim0) :: chrvar - CHARACTER(LEN=20), DIMENSION(1:2) :: chrref_correct - - chrvar = "The quick brown " - READ(chrvar,'(16A1)') wdata2(1:16,1) - chrvar = "fox jumps over " - READ(chrvar,'(16A1)') wdata2(1:16,2) - chrvar = "the 5 lazy dogs " - READ(chrvar,'(16A1)') wdata2(1:16,3) - - chrref_correct(1) = 'hdf5' - chrref_correct(2) = 'Therowthedog' - - ! - ! Create a new file using the default properties. - ! - CALL h5fcreate_f(filename, H5F_ACC_TRUNC_F, file, error) - CALL check("h5fcreate_f",error, total_error) - ! - ! Create a dataset with character data. - ! - CALL h5screate_simple_f(2, dims2, space, error) - CALL check("h5screate_simple_f",error, total_error) - CALL h5dcreate_f(file,dataset2, H5T_STD_I8LE, space, dset2, error) - CALL check("h5dcreate_f",error, total_error) - f_ptr = C_LOC(wdata2(1,1)) - CALL h5dwrite_f(dset2, H5T_NATIVE_INTEGER_1, f_ptr, error) - CALL check("h5dwrite_f",error, total_error) - ! - ! Create reference to a list of elements in dset2. - ! - CALL h5sselect_elements_f(space, H5S_SELECT_SET_F, 2, INT(4,size_t), coords, error) - CALL check("h5sselect_elements_f",error, total_error) - f_ptr = C_LOC(wdata(1)) - CALL h5rcreate_f(file, DATASET2, H5R_DATASET_REGION_F, f_ptr, error, space) - CALL check("h5rcreate_f",error, total_error) - ! - ! Create reference to a hyperslab in dset2, close dataspace. - ! - CALL h5sselect_hyperslab_f (space, H5S_SELECT_SET_F, start, count, error, stride, block) - CALL check("h5sselect_hyperslab_f",error, total_error) - f_ptr = C_LOC(wdata(2)) - CALL h5rcreate_f(file, DATASET2, H5R_DATASET_REGION_F, f_ptr, error, space) - CALL check("h5rcreate_f",error, total_error) - - CALL h5sclose_f(space, error) - CALL check("h5sclose_f",error, total_error) - ! - ! Create dataspace. Setting maximum size to the current size. - ! - CALL h5screate_simple_f(1, dims, space, error) - CALL check("h5screate_simple_f",error, total_error) - - ! - ! Create the dataset and write the region references to it. - ! - CALL h5dcreate_f(file, dataset, H5T_STD_REF_DSETREG, space, dset, error) - CALL check("h5dcreate_f",error, total_error) - f_ptr = C_LOC(wdata(1)) - CALL h5dwrite_f(dset, H5T_STD_REF_DSETREG, f_ptr, error) - CALL check("h5dwrite_f",error, total_error) - ! - ! Close and release resources. - ! - CALL h5dclose_f(dset , error) - CALL check("h5dclose_f",error, total_error) - CALL h5dclose_f(dset2, error) - CALL check("h5dclose_f",error, total_error) - CALL h5sclose_f(space, error) - CALL check("h5sclose_f",error, total_error) - CALL h5fclose_f(file , error) - CALL check("h5fclose_f",error, total_error) - ! - ! Now we begin the read section of this example. - ! - ! - ! Open file and dataset. - ! - CALL h5fopen_f(filename, H5F_ACC_RDONLY_F, file, error) - CALL check("h5fopen_f",error, total_error) - CALL h5dopen_f(file, dataset, dset, error) - CALL check("h5dopen_f",error, total_error) - ! - ! Get dataspace and allocate memory for read buffer. - ! - CALL h5dget_space_f(dset, space, error) - CALL check("H5Dget_space_f",error, total_error) - CALL h5sget_simple_extent_dims_f(space, dims, maxdims, error) - CALL check("H5Sget_simple_extent_dims_f",error, total_error) - CALL VERIFY("H5Sget_simple_extent_dims_f", INT(dims(1)), dim0, total_error) - ALLOCATE(rdata(1:dims(1))) - CALL h5sclose_f(space, error) - CALL check("h5sclose_f",error, total_error) - ! - ! Read the data. - ! - f_ptr = C_LOC(rdata(1)) - CALL h5dread_f( dset, H5T_STD_REF_DSETREG, f_ptr, error) - CALL check("H5Dread_f",error, total_error) - ! - ! Output the data to the screen. - ! - DO i = 1, dims(1) - - ! - ! Open the referenced object, retrieve its region as a - ! dataspace selection. - ! - f_ptr = C_LOC(rdata(i)) - CALL H5Rdereference_f(dset, H5R_DATASET_REGION_F, f_ptr, dset2, error) - CALL check("H5Rdereference_f",error, total_error) - - CALL H5Rget_region_f(dset, f_ptr, space, error) - CALL check("H5Rget_region_f",error, total_error) - - ! - ! Get the object's name - ! - name(:) = ' ' ! initialize string to blanks - CALL H5Iget_name_f(dset2, name, 80_size_t, size, error) - CALL check("H5Iget_name_f",error, total_error) - CALL VERIFY("H5Iget_name_f", INT(size), LEN_TRIM(name), total_error) - CALL verifystring("H5Iget_name_f",name(1:size),TRIM(name), total_error) - ! - ! Allocate space for the read buffer. - ! - CALL H5Sget_select_npoints_f(space, npoints, error) - CALL check("H5Sget_select_npoints_f",error, total_error) - CALL VERIFY("H5Sget_select_npoints_f", INT(npoints), LEN_TRIM(chrref_correct(i)), total_error) - - dims3(1) = npoints - ! - ! Read the dataset region. - ! - CALL h5screate_simple_f(1, dims3, memspace, error) - CALL check("h5screate_simple_f",error, total_error) - - f_ptr = C_LOC(rdata2(1)(1:1)) - CALL h5dread_f( dset2, H5T_NATIVE_INTEGER_1, f_ptr, error, memspace, space) - CALL check("H5Dread_f",error, total_error) - CALL verifystring("h5dread_f",rdata2(1)(1:npoints),TRIM(chrref_correct(i)), total_error) - - CALL H5Sclose_f(space, error) - CALL check("h5sclose_f",error, total_error) - CALL H5Sclose_f(memspace, error) - CALL check("h5sclose_f",error, total_error) - CALL H5Dclose_f(dset2, error) - CALL check("h5dclose_f",error, total_error) - - END DO - ! - ! Close and release resources. - ! - DEALLOCATE(rdata) - CALL H5Dclose_f(dset, error) - CALL check("h5dclose_f",error, total_error) - CALL H5Fclose_f(file, error) - CALL check("h5fclose_f",error, total_error) - -END SUBROUTINE t_regref - -SUBROUTINE t_vlen(total_error) - - USE HDF5 - USE TH5_MISC - USE ISO_C_BINDING - - IMPLICIT NONE - - INTEGER, INTENT(INOUT) :: total_error - CHARACTER(LEN=18), PARAMETER :: filename = "t_vlen_F03.h5" - CHARACTER(LEN=3) , PARAMETER :: dataset = "DS1" - INTEGER, PARAMETER :: LEN0 = 3 - INTEGER, PARAMETER :: LEN1 = 12 - INTEGER(hsize_t) :: dim0 - - INTEGER(HID_T) :: file, filetype, memtype, space, dset ! Handles - INTEGER :: error - INTEGER(HSIZE_T), DIMENSION(1:2) :: maxdims - INTEGER :: i, j - - ! vl data - TYPE vl - INTEGER, DIMENSION(:), POINTER :: DATA - END TYPE vl - TYPE(vl), DIMENSION(:), ALLOCATABLE, TARGET :: ptr - - - TYPE(hvl_t), DIMENSION(1:2), TARGET :: wdata ! Array of vlen structures - TYPE(hvl_t), DIMENSION(1:2), TARGET :: rdata ! Pointer to vlen structures - - INTEGER(hsize_t), DIMENSION(1:1) :: dims = (/2/) - INTEGER, DIMENSION(:), POINTER :: ptr_r - TYPE(C_PTR) :: f_ptr - - ! - ! Initialize variable-length data. wdata(1) is a countdown of - ! length LEN0, wdata(2) is a Fibonacci sequence of length LEN1. - ! - wdata(1)%len = LEN0 - wdata(2)%len = LEN1 - - ALLOCATE( ptr(1:2) ) - ALLOCATE( ptr(1)%data(1:wdata(1)%len) ) - ALLOCATE( ptr(2)%data(1:wdata(2)%len) ) - - DO i=1, wdata(1)%len - ptr(1)%data(i) = wdata(1)%len - i + 1 ! 3 2 1 - ENDDO - wdata(1)%p = C_LOC(ptr(1)%data(1)) - - ptr(2)%data(1:2) = 1 - DO i = 3, wdata(2)%len - ptr(2)%data(i) = ptr(2)%data(i-1) + ptr(2)%data(i-2) ! (1 1 2 3 5 8 etc.) - ENDDO - wdata(2)%p = C_LOC(ptr(2)%data(1)) - - ! - ! Create a new file using the default properties. - ! - CALL h5fcreate_f(filename, H5F_ACC_TRUNC_F, file, error) - CALL check("h5fcreate_f",error, total_error) - ! - ! Create variable-length datatype for file and memory. - ! - CALL H5Tvlen_create_f(H5T_STD_I32LE, filetype, error) - CALL check("H5Tvlen_create_f",error, total_error) - CALL H5Tvlen_create_f(H5T_NATIVE_INTEGER, memtype, error) - CALL check("H5Tvlen_create_f",error, total_error) - ! - ! Create dataspace. - ! - CALL h5screate_simple_f(1, dims, space, error) - CALL check("h5screate_simple_f",error, total_error) - ! - ! Create the dataset and write the variable-length data to it. - ! - CALL H5Dcreate_f(file, dataset, filetype, space, dset, error) - CALL check("h5dcreate_f",error, total_error) - - f_ptr = C_LOC(wdata(1)) - CALL h5dwrite_f(dset, memtype, f_ptr, error) - CALL check("h5dwrite_f",error, total_error) - ! - ! Close and release resources. Note the use of H5Dvlen_reclaim - ! removes the need to manually deallocate the previously allocated - ! data. - ! - - CALL h5dclose_f(dset , error) - CALL check("h5dclose_f",error, total_error) - CALL h5sclose_f(space, error) - CALL check("h5sclose_f",error, total_error) - CALL H5Tclose_f(filetype, error) - CALL check("h5tclose_f",error, total_error) - CALL H5Tclose_f(memtype, error) - CALL check("h5tclose_f",error, total_error) - CALL h5fclose_f(file , error) - CALL check("h5fclose_f",error, total_error) - - ! - ! Now we begin the read section of this example. - - ! - ! Open file and dataset. - ! - CALL h5fopen_f(filename, H5F_ACC_RDONLY_F, file, error) - CALL check("h5fopen_f",error, total_error) - CALL h5dopen_f(file, dataset, dset, error) - CALL check("h5dopen_f",error, total_error) - - ! - ! Get dataspace and allocate memory for array of vlen structures. - ! This does not actually allocate memory for the vlen data, that - ! will be done by the library. - ! - CALL H5Dget_space_f(dset, space, error) - CALL check("H5Dget_space_f",error, total_error) - dim0 = dims(1) - CALL H5Sget_simple_extent_dims_f(space, dims, maxdims, error) - CALL check("H5Sget_simple_extent_dims_f",error, total_error) - CALL VERIFY("H5Sget_simple_extent_dims_f", INT(dims(1)), INT(dim0), total_error) - - ! - ! Create the memory datatype. - ! - CALL H5Tvlen_create_f(H5T_NATIVE_INTEGER, memtype, error) - CALL check("H5Tvlen_create_f",error, total_error) - - ! - ! Read the data. - ! - f_ptr = C_LOC(rdata(1)) - CALL H5Dread_f(dset, memtype, f_ptr, error) - CALL check("H5Dread_f",error, total_error) - - DO i = 1, INT(dims(1)) - CALL c_f_pointer(rdata(i)%p, ptr_r, [rdata(i)%len] ) - DO j = 1, rdata(i)%len - CALL VERIFY("t_vlen", ptr_r(j), ptr(i)%data(j), total_error) - ENDDO - ENDDO - ! - ! Close and release resources. - ! - DEALLOCATE(ptr) - CALL h5dvlen_reclaim_f(memtype, space, H5P_DEFAULT_F, f_ptr, error) - CALL h5dclose_f(dset, error) - CALL check("h5dclose_f",error, total_error) - CALL h5sclose_f(space, error) - CALL check("h5sclose_f",error, total_error) - CALL H5Tclose_f(memtype, error) - CALL check("h5tclose_f",error, total_error) - CALL h5fclose_f(file, error) - CALL check("h5fclose_f",error, total_error) - -END SUBROUTINE t_vlen - - -SUBROUTINE t_vlstring(total_error) - - USE HDF5 - USE TH5_MISC - USE ISO_C_BINDING - - IMPLICIT NONE - - INTEGER, INTENT(INOUT) :: total_error - - CHARACTER(LEN=18), PARAMETER :: filename = "t_vlstring.h5" - CHARACTER(LEN=3) , PARAMETER :: dataset = "DS1" - - INTEGER(SIZE_T), PARAMETER :: dim0 = 4 - INTEGER(SIZE_T), PARAMETER :: sdim = 7 - INTEGER(HID_T) :: file, filetype, space, dset ! Handles - INTEGER :: error - INTEGER(HSIZE_T), DIMENSION(1:1) :: dims = (/dim0/) - INTEGER(HSIZE_T), DIMENSION(1:2) :: maxdims - - CHARACTER(LEN=sdim), DIMENSION(1:dim0), TARGET :: & - wdata = (/"Parting", "is such", "sweet ", "sorrow."/) ! Write buffer - CHARACTER(LEN=sdim), DIMENSION(:), ALLOCATABLE :: rdata ! Read buffer - INTEGER(HSIZE_T), DIMENSION(2) :: data_dims = (/sdim,dim0/) - INTEGER(SIZE_T), DIMENSION(4) :: str_len = (/7,7,5,7/) - INTEGER(hsize_t) :: i - - ! - ! Create a new file using the default properties. - ! - CALL h5fcreate_f(filename, H5F_ACC_TRUNC_F, file, error) - CALL check("h5fcreate_f",error, total_error) - ! - ! Create file and memory datatypes. For this example we will save - ! the strings as C variable length strings, H5T_STRING is defined - ! as a variable length string. - ! - CALL H5Tcopy_f(H5T_STRING, filetype, error) - CALL check("H5Tcopy_f",error, total_error) - CALL H5Tset_strpad_f(filetype, H5T_STR_NULLPAD_F, error) - CALL check("H5Tset_strpad_f",error, total_error) - ! - ! Create dataspace. - ! - CALL h5screate_simple_f(1, dims, space, error) - CALL check("h5screate_simple_f",error, total_error) - ! - ! Create the dataset and write the variable-length string data to - ! it. - ! - CALL h5dcreate_f(file, dataset, filetype, space, dset, error) - CALL check("h5dcreate_f",error, total_error) - - CALL h5dwrite_vl_f(dset, filetype, wdata, data_dims, str_len, error, space) - CALL check("h5dwrite_vl_f",error, total_error) - - ! - ! Close and release resources. - ! - CALL h5dclose_f(dset , error) - CALL check("h5dclose_f",error, total_error) - CALL h5sclose_f(space, error) - CALL check("h5sclose_f",error, total_error) - CALL H5Tclose_f(filetype, error) - CALL check("h5tclose_f",error, total_error) - CALL h5fclose_f(file , error) - CALL check("h5fclose_f",error, total_error) - - ! - ! Now we begin the read section of this example. - ! - ! - ! Open file and dataset. - ! - CALL h5fopen_f(filename, H5F_ACC_RDONLY_F, file, error) - CALL check("h5fopen_f",error, total_error) - CALL h5dopen_f(file, dataset, dset, error) - CALL check("h5dopen_f",error, total_error) - ! - ! Get the datatype. - ! - CALL H5Dget_type_f(dset, filetype, error) - CALL check("H5Dget_type_f",error, total_error) - ! - ! Get dataspace and allocate memory for read buffer. - ! - CALL H5Dget_space_f(dset, space, error) - CALL check("H5Dget_space_f",error, total_error) - CALL H5Sget_simple_extent_dims_f(space, dims, maxdims, error) - CALL check("H5Sget_simple_extent_dims_f",error, total_error) - CALL VERIFY("H5Sget_simple_extent_dims_f", INT(dims(1)), INT(dim0), total_error) - - ALLOCATE(rdata(1:dims(1))) - - ! - ! Read the data. - ! - CALL h5dread_vl_f(dset, filetype, rdata, data_dims, str_len, error, space) - CALL check("H5Dread_vl_f",error, total_error) - - ! - ! Output the data to the screen. - ! - DO i = 1, dims(1) - CALL verifystring("h5dopen_f",TRIM(rdata(i)),TRIM(wdata(i)) , total_error) - END DO - - DEALLOCATE(rdata) - CALL h5dclose_f(dset, error) - CALL check("h5dclose_f",error, total_error) - CALL h5sclose_f(space, error) - CALL check("h5sclose_f",error, total_error) - CALL H5Tclose_f(filetype, error) - CALL check("h5tclose_f",error, total_error) - CALL h5fclose_f(file , error) - CALL check("h5fclose_f",error, total_error) - -END SUBROUTINE t_vlstring - -SUBROUTINE t_vlstring_readwrite(total_error) - -! test writing and reading vl string using h5dread_f and h5dwrite_f, C_LOC and C_F_POINTER - - USE HDF5 - USE TH5_MISC - USE ISO_C_BINDING - - IMPLICIT NONE - - INTEGER, INTENT(INOUT) :: total_error - - CHARACTER(LEN=19), PARAMETER :: filename = "t_vlstringrw_F03.h5" - CHARACTER(LEN=3) , PARAMETER :: dataset = "DS1" - CHARACTER(LEN=3) , PARAMETER :: dataset2D = "DS2" - - INTEGER(HSIZE_T) , PARAMETER :: dim0 = 4 - INTEGER(HSIZE_T) , PARAMETER :: dim1 = 2 - INTEGER(HID_T) :: file, filetype, space, dset ! Handles - INTEGER(HSIZE_T), DIMENSION(1:1) :: dims = (/dim0/) - INTEGER(HSIZE_T), DIMENSION(1:2) :: dims2D = (/dim1,dim0/) - INTEGER(HSIZE_T), DIMENSION(1:2) :: maxdims - - TYPE(C_PTR), DIMENSION(1:dim0), TARGET :: wdata - CHARACTER(len=7, KIND=c_char), DIMENSION(1:1), TARGET :: A = "123456"//C_NULL_CHAR - CHARACTER(len=5, KIND=c_char), DIMENSION(1:1), TARGET :: B = "7890"//C_NULL_CHAR - CHARACTER(len=4, KIND=c_char), DIMENSION(1:1), TARGET :: C = "abc"//C_NULL_CHAR - CHARACTER(len=3, KIND=c_char), DIMENSION(1:1), TARGET :: D = "df"//C_NULL_CHAR - - TYPE(C_PTR), DIMENSION(1:dim1,1:dim0), TARGET :: wdata2D - - CHARACTER(len=7, KIND=c_char), DIMENSION(1:1), TARGET :: A11 = "A(1,1)"//C_NULL_CHAR - CHARACTER(len=4, KIND=c_char), DIMENSION(1:1), TARGET :: A12 = "A12"//C_NULL_CHAR - CHARACTER(len=5, KIND=c_char), DIMENSION(1:1), TARGET :: A13 = "A_13"//C_NULL_CHAR - CHARACTER(len=8, KIND=c_char), DIMENSION(1:1), TARGET :: A14 = "A_{1,4}"//C_NULL_CHAR - CHARACTER(len=8, KIND=c_char), DIMENSION(1:1), TARGET :: A21 = "A_{2,1}"//C_NULL_CHAR - CHARACTER(len=5, KIND=c_char), DIMENSION(1:1), TARGET :: A22 = "A_22"//C_NULL_CHAR - CHARACTER(len=4, KIND=c_char), DIMENSION(1:1), TARGET :: A23 = "A23"//C_NULL_CHAR - CHARACTER(len=7, KIND=c_char), DIMENSION(1:1), TARGET :: A24 = "A(2,4)"//C_NULL_CHAR - - TYPE(C_PTR), DIMENSION(:), ALLOCATABLE, TARGET :: rdata ! Read buffer - TYPE(C_PTR), DIMENSION(:,:), ALLOCATABLE, TARGET :: rdata2D ! Read 2D buffer - CHARACTER(len=8, kind=c_char), POINTER :: data ! A pointer to a Fortran string - CHARACTER(len=8, kind=c_char), DIMENSION(1:4) :: data_w ! A pointer to a Fortran string - CHARACTER(len=8, kind=c_char), DIMENSION(1:dim1,1:dim0) :: data2D_w ! A pointer to a Fortran string - TYPE(C_PTR) :: f_ptr - INTEGER(hsize_t) :: i, j - INTEGER :: len - INTEGER :: error - - ! Initialize array of C pointers - - wdata(1) = C_LOC(A(1)(1:1)) - wdata(2) = C_LOC(B(1)(1:1)) - wdata(3) = C_LOC(C(1)(1:1)) - wdata(4) = C_LOC(D(1)(1:1)) - - data_w(1) = A(1) - data_w(2) = B(1) - data_w(3) = C(1) - data_w(4) = D(1) - - wdata2D(1,1) = C_LOC(A11(1)(1:1)) - wdata2D(1,2) = C_LOC(A12(1)(1:1)) - wdata2D(1,3) = C_LOC(A13(1)(1:1)) - wdata2D(1,4) = C_LOC(A14(1)(1:1)) - wdata2D(2,1) = C_LOC(A21(1)(1:1)) - wdata2D(2,2) = C_LOC(A22(1)(1:1)) - wdata2D(2,3) = C_LOC(A23(1)(1:1)) - wdata2D(2,4) = C_LOC(A24(1)(1:1)) - - data2D_w(1,1) = A11(1) - data2D_w(1,2) = A12(1) - data2D_w(1,3) = A13(1) - data2D_w(1,4) = A14(1) - data2D_w(2,1) = A21(1) - data2D_w(2,2) = A22(1) - data2D_w(2,3) = A23(1) - data2D_w(2,4) = A24(1) - - ! - ! Create a new file using the default properties. - ! - CALL h5fcreate_f(filename, H5F_ACC_TRUNC_F, file, error) - CALL check("h5fcreate_f",error, total_error) - ! - ! Create file and memory datatypes. For this test we will save - ! the strings as C variable length strings, H5T_STRING is defined - ! as a variable length string. - ! - CALL H5Tcopy_f(H5T_STRING, filetype, error) - CALL check("H5Tcopy_f",error, total_error) - ! - ! Create dataspace. - ! - CALL h5screate_simple_f(1, dims, space, error) - CALL check("h5screate_simple_f",error, total_error) - ! - ! Create the dataset and write the variable-length string data to - ! it. - ! - CALL h5dcreate_f(file, dataset, filetype, space, dset, error) - CALL check("h5dcreate_f",error, total_error) - - f_ptr = C_LOC(wdata(1)) - CALL h5dwrite_f(dset, filetype, f_ptr, error) - CALL check("h5dwrite_f",error, total_error) - - ! - ! Close and release resources. - ! - CALL h5dclose_f(dset , error) - CALL check("h5dclose_f",error, total_error) - CALL h5sclose_f(space, error) - CALL check("h5sclose_f",error, total_error) - - ! - ! Create dataspace. - ! - CALL h5screate_simple_f(2, dims2D, space, error) - CALL check("h5screate_simple_f",error, total_error) - ! - ! Create the dataset and write the variable-length string data to - ! it. - ! - CALL h5dcreate_f(file, dataset2D, filetype, space, dset, error) - CALL check("h5dcreate_f",error, total_error) - - f_ptr = C_LOC(wdata2D(1,1)) - CALL h5dwrite_f(dset, filetype, f_ptr, error) - CALL check("h5dwrite_f",error, total_error) - - ! - ! Close and release resources. - ! - CALL h5dclose_f(dset , error) - CALL check("h5dclose_f",error, total_error) - CALL h5sclose_f(space, error) - CALL check("h5sclose_f",error, total_error) - - CALL H5Tclose_f(filetype, error) - CALL check("h5tclose_f",error, total_error) - CALL h5fclose_f(file , error) - CALL check("h5fclose_f",error, total_error) - - ! - ! Now we begin the read section of this test. - ! - ! - ! Open file and dataset. - ! - CALL h5fopen_f(filename, H5F_ACC_RDONLY_F, file, error) - CALL check("h5fopen_f",error, total_error) - CALL h5dopen_f(file, dataset, dset, error) - CALL check("h5dopen_f",error, total_error) - ! - ! Get the datatype. - ! - CALL H5Dget_type_f(dset, filetype, error) - CALL check("H5Dget_type_f",error, total_error) - ! - ! Get dataspace and allocate memory for read buffer. - ! - CALL H5Dget_space_f(dset, space, error) - CALL check("H5Dget_space_f",error, total_error) - - CALL H5Sget_simple_extent_dims_f(space, dims, maxdims, error) - CALL check("H5Sget_simple_extent_dims_f",error, total_error) - ALLOCATE(rdata(1:dims(1))) - ! - ! Read the data. - ! - - f_ptr = C_LOC(rdata(1)) - CALL h5dread_f(dset, H5T_STRING, f_ptr, error) - CALL check("H5Dread_f",error, total_error) - - ! - ! Check the data. - ! - DO i = 1, dims(1) - CALL C_F_POINTER(rdata(i), data) - len = 0 - DO - IF(DATA(len+1:len+1).EQ.C_NULL_CHAR.OR.len.GE.8) EXIT - len = len + 1 - ENDDO - CALL verifystring("h5dread_f",data(1:len), data_w(i)(1:len), total_error) - END DO - - DEALLOCATE(rdata) - CALL h5dclose_f(dset , error) - CALL check("h5dclose_f",error, total_error) - CALL h5sclose_f(space, error) - CALL check("h5sclose_f",error, total_error) - ! - ! Test reading in 2D dataset - ! - CALL h5dopen_f(file, dataset2D, dset, error) - CALL check("h5dopen_f",error, total_error) - ! - ! Get the datatype. - ! - CALL H5Dget_type_f(dset, filetype, error) - CALL check("H5Dget_type_f",error, total_error) - ! - ! Get dataspace and allocate memory for read buffer. - ! - CALL H5Dget_space_f(dset, space, error) - CALL check("H5Dget_space_f",error, total_error) - - - CALL H5Sget_simple_extent_dims_f(space, dims2D, maxdims, error) - CALL check("H5Sget_simple_extent_dims_f",error, total_error) - ALLOCATE(rdata2D(1:dims2D(1),1:dims2D(2))) - - ! - ! Read the data. - ! - - f_ptr = C_LOC(rdata2D(1,1)) - CALL h5dread_f(dset, H5T_STRING, f_ptr, error) - CALL check("H5Dread_f",error, total_error) - - ! - ! Check the data. - ! - DO i = 1, dims2D(1) - DO j = 1, dims2D(2) - CALL C_F_POINTER(rdata2D(i,j), DATA) - len = 0 - DO - IF(DATA(len+1:len+1).EQ.C_NULL_CHAR.OR.len.GE.8) EXIT - len = len + 1 - ENDDO - CALL verifystring("h5dread_f",DATA(1:len), data2D_w(i,j)(1:len), total_error) - ENDDO - END DO - - DEALLOCATE(rdata2D) - CALL h5dclose_f(dset , error) - CALL check("h5dclose_f",error, total_error) - CALL h5sclose_f(space, error) - CALL check("h5sclose_f",error, total_error) - - CALL H5Tclose_f(filetype, error) - CALL check("h5tclose_f",error, total_error) - CALL h5fclose_f(file , error) - CALL check("h5fclose_f",error, total_error) - -END SUBROUTINE t_vlstring_readwrite - - -SUBROUTINE t_string(total_error) - - USE HDF5 - USE TH5_MISC - USE ISO_C_BINDING - - IMPLICIT NONE - - INTEGER, INTENT(INOUT) :: total_error - - CHARACTER(LEN=20), PARAMETER :: filename = "t_string_F03.h5" - CHARACTER(LEN=3) , PARAMETER :: dataset = "DS1" - INTEGER , PARAMETER :: dim0 = 4 - INTEGER(SIZE_T) , PARAMETER :: sdim = 8 - - INTEGER(HID_T) :: file, filetype, memtype, space, dset ! Handles - INTEGER :: error - - INTEGER(HSIZE_T), DIMENSION(1:1) :: dims = (/dim0/) - INTEGER(HSIZE_T), DIMENSION(1:1) :: maxdims - - CHARACTER(LEN=sdim), DIMENSION(1:dim0), TARGET :: & - wdata = (/"Parting", "is such", "sweet ", "sorrow."/) - CHARACTER(LEN=sdim), DIMENSION(:), ALLOCATABLE, TARGET :: rdata - INTEGER(hsize_t) :: i - INTEGER(SIZE_T) :: size - TYPE(C_PTR) :: f_ptr - ! - ! Create a new file using the default properties. - ! - CALL h5fcreate_f(filename, H5F_ACC_TRUNC_F, file, error) - CALL check("h5fcreate_f",error, total_error) - ! - ! Create file datatypes. For this example we will save - ! the strings as FORTRAN strings - ! - CALL H5Tcopy_f(H5T_FORTRAN_S1, filetype, error) - CALL check("H5Tcopy_f",error, total_error) - CALL H5Tset_size_f(filetype, sdim, error) - CALL check("H5Tset_size_f",error, total_error) - ! - ! Create dataspace. - ! - CALL h5screate_simple_f(1, dims, space, error) - CALL check("h5screate_simple_f",error, total_error) - ! - ! Create the dataset and write the string data to it. - ! - CALL h5dcreate_f(file, dataset, filetype, space, dset, error) - CALL check("h5dcreate_f",error, total_error) - - f_ptr = C_LOC(wdata(1)(1:1)) - CALL H5Dwrite_f(dset, filetype, f_ptr, error) - CALL check("H5Dwrite_f",error, total_error) - ! - ! Close and release resources. - ! - CALL h5dclose_f(dset , error) - CALL check("h5dclose_f",error, total_error) - CALL h5sclose_f(space, error) - CALL check("h5sclose_f",error, total_error) - CALL H5Tclose_f(filetype, error) - CALL check("h5tclose_f",error, total_error) - CALL h5fclose_f(file , error) - CALL check("h5fclose_f",error, total_error) - ! - ! Now we begin the read section of this example. - ! - ! Open file and dataset. - ! - CALL h5fopen_f(filename, H5F_ACC_RDONLY_F, file, error) - CALL check("h5fopen_f",error, total_error) - CALL h5dopen_f(file, dataset, dset, error) - CALL check("h5dopen_f",error, total_error) - ! - ! Get the datatype and its size. - ! - CALL H5Dget_type_f(dset, filetype, error) - CALL check("H5Dget_type_f",error, total_error) - CALL H5Tget_size_f(filetype, size, error) - CALL check("H5Tget_size_f",error, total_error) - CALL VERIFY("H5Tget_size_f", INT(size), INT(sdim), total_error) - ! - ! Get dataspace. - ! - CALL H5Dget_space_f(dset, space, error) - CALL check("H5Dget_space_f",error, total_error) - CALL H5Sget_simple_extent_dims_f(space, dims, maxdims, error) - CALL check("H5Sget_simple_extent_dims_f",error, total_error) - CALL VERIFY("H5Sget_simple_extent_dims_f", INT(dims(1)), dim0, total_error) - - ALLOCATE(rdata(1:dims(1))) - ! - ! Create the memory datatype. - ! - CALL H5Tcopy_f(H5T_FORTRAN_S1, memtype, error) - CALL check("H5Tcopy_f",error, total_error) - CALL H5Tset_size_f(memtype, sdim, error) - CALL check("H5Tset_size_f",error, total_error) - ! - ! Read the data. - ! - f_ptr = C_LOC(rdata(1)(1:1)) - CALL H5Dread_f(dset, memtype, f_ptr, error, space) - CALL check("H5Dread_f",error, total_error) - - DO i = 1, dims(1) - CALL verifystring("h5dread_f",TRIM(rdata(i)),TRIM(wdata(i)) , total_error) - END DO - - DEALLOCATE(rdata) - - ! - ! Close and release resources. - ! - CALL H5Dclose_f(dset, error) - CALL check("h5dclose_f",error, total_error) - CALL H5Sclose_f(space, error) - CALL check("h5sclose_f",error, total_error) - CALL H5Tclose_f(memtype, error) - CALL check("h5tclose_f",error, total_error) - CALL H5Fclose_f(file, error) - CALL check("h5fclose_f",error, total_error) - - -END SUBROUTINE t_string - -SUBROUTINE vl_test_special_char(total_error) - - USE HDF5 - USE TH5_MISC - IMPLICIT NONE - -! INTERFACE -! SUBROUTINE setup_buffer(data_in, line_lengths, char_type) -! USE HDF5 -! USE ISO_C_BINDING -! IMPLICIT NONE -! CHARACTER(len=*), DIMENSION(:) :: data_in -! INTEGER(size_t), DIMENSION(:) :: line_lengths -! CHARACTER(KIND=C_CHAR,LEN=*) :: char_type -! END SUBROUTINE setup_buffer -! END INTERFACE - - INTEGER, INTENT(OUT) :: total_error - - CHARACTER(LEN=16), PARAMETER :: filename = "t_controlchar.h5" - INTEGER, PARAMETER :: line_length = 10 - INTEGER(hid_t) :: file - INTEGER(hid_t) :: dataset0 - CHARACTER(len=line_length), DIMENSION(1:100) :: data_in - CHARACTER(len=line_length), DIMENSION(1:100) :: data_out - INTEGER(size_t), DIMENSION(1:100) :: line_lengths - INTEGER(hid_t) :: string_id, space, dcpl - INTEGER(hsize_t), DIMENSION(1:1) :: dims = (/0/) - INTEGER(hsize_t), DIMENSION(1:1) :: max_dims = (/0/) - INTEGER(hsize_t), DIMENSION(1:2) :: data_dims = (/0,0/) - INTEGER(hsize_t), DIMENSION(1:1) :: chunk =(/10/) - INTEGER, PARAMETER :: ncontrolchar = 7 - CHARACTER(KIND=C_CHAR,LEN=1), DIMENSION(1:ncontrolchar) :: controlchar = & - (/C_ALERT, C_BACKSPACE,C_CARRIAGE_RETURN, C_FORM_FEED,C_HORIZONTAL_TAB,C_VERTICAL_TAB, C_NEW_LINE/) - INTEGER :: i, j, n, error - n = 8 - ! - ! Create a new file using the default properties. - ! - CALL h5fcreate_f(filename, H5F_ACC_TRUNC_F, file, error) - CALL check("h5fcreate_f",error, total_error) - - max_dims = (/H5S_UNLIMITED_F/) - - ! - ! Create the memory datatype. - ! - CALL h5tcopy_f(h5t_string, string_id, error) - CALL check("h5tcopy_f", error, total_error) - CALL h5tset_strpad_f(string_id, h5t_str_nullpad_f, error) - CALL check("h5tset_strpad_f", error, total_error) - dims(1) = n - ! - ! Create dataspace. - ! - CALL h5screate_simple_f(1, dims, space, error, max_dims) - CALL check("h5screate_simple_f", error, total_error) - CALL h5pcreate_f(h5p_dataset_create_f, dcpl, error) - CALL check("h5pcreate_f", error, total_error) - CALL h5pset_chunk_f(dcpl, 1, chunk, error) - CALL check("h5pset_chunk_f", error, total_error) - - data_dims(1) = line_length - data_dims(2) = n - ! - ! Create data with strings containing various control characters. - ! - DO i = 1, ncontrolchar - ! - ! Create the dataset, for the string with control character and write the string data to it. - ! - CALL h5dcreate_f(file, controlchar(i), string_id, space, dataset0, error, dcpl) - CALL check("h5dcreate_f", error, total_error) - CALL setup_buffer(data_in(1:n), line_lengths, controlchar(i)) - CALL h5dwrite_vl_f(dataset0, string_id, data_in(1:n), data_dims, line_lengths(1:n), error, space) - CALL check("h5dwrite_vl_f", error, total_error) - ! - ! Read the string back. - ! - CALL h5dread_vl_f(dataset0, string_id, data_out(1:n), data_dims, line_lengths(1:n), error, space) - CALL check("h5dread_vl_f", error, total_error) - - DO j = 1, n - IF(data_in(j).NE.data_out(j))THEN - total_error = total_error + 1 - EXIT - ENDIF - ENDDO - - CALL h5dclose_f(dataset0, error) - CALL check("h5dclose_f", error, total_error) - ENDDO - - CALL h5pclose_f(dcpl, error) - CALL check("h5pclose_f", error, total_error) - CALL h5sclose_f(space, error) - CALL check("h5sclose_f", error, total_error) - CALL h5fclose_f(file, error) - CALL check("h5fclose_f", error, total_error) - -END SUBROUTINE vl_test_special_char - - -SUBROUTINE setup_buffer(data_in, line_lengths, char_type) - - USE HDF5 - USE ISO_C_BINDING - - IMPLICIT NONE - - ! Creates a simple "Data_in" consisting of the letters of the alphabet, - ! one per line, with a control character. - - CHARACTER(len=10), DIMENSION(:) :: data_in - INTEGER(size_t), DIMENSION(:) :: line_lengths - INTEGER, DIMENSION(1:3) :: letters - CHARACTER(LEN=3) :: lets - CHARACTER(KIND=C_CHAR,LEN=*) :: char_type - CHARACTER(KIND=C_CHAR,LEN=1) :: char_tmp - INTEGER :: i, j, n, ff - - ! Convert the letters and special character to integers - lets = 'abc' - - READ(lets,'(3A1)') letters - READ(char_type,'(A1)') ff - n = SIZE(data_in) - j = 1 - DO i=1,n-1 - IF( j .EQ. 4 )THEN - WRITE(char_tmp,'(A1)') ff - data_in(i:i) = char_tmp - ELSE - WRITE(char_tmp,'(A1)') letters(j) - data_in(i:i) = char_tmp - ENDIF - line_lengths(i) = LEN_TRIM(data_in(i)) - j = j + 1 - IF( j .EQ. 5 ) j = 1 - END DO - WRITE(char_tmp,'(A1)') ff - data_in(n:n) = char_tmp - line_lengths(n) = 1 - -END SUBROUTINE setup_buffer - -!------------------------------------------------------------------------- -! Function: test_nbit -! -! Purpose: Tests (real, 4 byte) datatype for nbit filter -! -! Return: Success: 0 -! Failure: >0 -! -! Programmer: M. Scot Breitenfeld -! Decemeber 7, 2010 -! -! Modifications: Moved this subroutine from the 1.8 test file and -! modified it to use F2003 features. -! This routine requires 4 byte reals, so we use F2003 features to -! ensure the requirement is satisfied in a portable way. -! The need for this arises when a user specifies the default real is 8 bytes. -! MSB 7/31/12 -! -!------------------------------------------------------------------------- -! - -SUBROUTINE test_nbit(total_error ) - - USE HDF5 - USE TH5_MISC - USE ISO_C_BINDING - - IMPLICIT NONE - INTEGER, PARAMETER :: wp = SELECTED_REAL_KIND(Fortran_REAL_4) !should map to REAL*4 on most modern processors - INTEGER, INTENT(INOUT) :: total_error - INTEGER(hid_t) :: file - - INTEGER(hid_t) :: dataset, datatype, space, dc, mem_type_id - INTEGER(hsize_t), DIMENSION(1:2) :: dims = (/2,5/) - INTEGER(hsize_t), DIMENSION(1:2) :: chunk_dim = (/2,5/) - ! orig_data[] are initialized to be within the range that can be represented by - ! dataset datatype (no precision loss during datatype conversion) - ! - REAL(kind=wp), DIMENSION(1:2,1:5), TARGET :: orig_data = & - RESHAPE( (/188384.00, 19.103516, -1.0831790e9, -84.242188, & - 5.2045898, -49140.000, 2350.2500, -3.2110596e-1, 6.4998865e-5, -0.0000000/) , (/2,5/) ) - REAL(kind=wp), DIMENSION(1:2,1:5), TARGET :: new_data - INTEGER(size_t) :: PRECISION, offset - INTEGER :: error - LOGICAL :: status - INTEGER(hsize_t) :: i, j - TYPE(C_PTR) :: f_ptr - - ! check to see if filter is available - CALL H5Zfilter_avail_f(H5Z_FILTER_NBIT_F, status, error) - IF(.NOT.status)THEN ! We don't have H5Z_FILTER_NBIT_F filter - total_error = -1 ! so return - RETURN - ENDIF - - CALL H5Fcreate_f("nbit.h5", H5F_ACC_TRUNC_F, file, error) - CALL check("H5Fcreate_f", error, total_error) - - ! Define dataset datatype (integer), and set precision, offset - CALL H5Tcopy_f(H5T_IEEE_F32BE, datatype, error) - CALL CHECK(" H5Tcopy_f", error, total_error) - CALL H5Tset_fields_f(datatype, 26_size_t, 20_size_t, 6_size_t, 7_size_t, 13_size_t, error) - CALL CHECK(" H5Tset_fields_f", error, total_error) - offset = 7 - CALL H5Tset_offset_f(datatype, offset, error) - CALL CHECK(" H5Tset_offset_f", error, total_error) - PRECISION = 20 - CALL H5Tset_precision_f(datatype,PRECISION, error) - CALL CHECK(" H5Tset_precision_f", error, total_error) - - CALL H5Tset_size_f(datatype, 4_size_t, error) - CALL CHECK(" H5Tset_size_f", error, total_error) - - CALL H5Tset_ebias_f(datatype, 31_size_t, error) - CALL CHECK(" H5Tset_ebias_f", error, total_error) - - ! Create the data space - CALL H5Screate_simple_f(2, dims, space, error) - CALL CHECK(" H5Screate_simple_f", error, total_error) - - ! USE nbit filter - CALL H5Pcreate_f(H5P_DATASET_CREATE_F, dc, error) - CALL CHECK(" H5Pcreate_f", error, total_error) - - CALL H5Pset_chunk_f(dc, 2, chunk_dim, error) - CALL CHECK(" H5Pset_chunk_f", error, total_error) - CALL H5Pset_nbit_f(dc, error) - CALL CHECK(" H5Pset_nbit_f", error, total_error) - - ! Create the dataset - CALL H5Dcreate_f(file, "nbit_real", datatype, & - space, dataset, error, dc) - CALL CHECK(" H5Dcreate_f", error, total_error) - - !---------------------------------------------------------------------- - ! STEP 1: Test nbit by setting up a chunked dataset and writing - ! to it. - !---------------------------------------------------------------------- - ! - mem_type_id = h5kind_to_type(wp,H5_REAL_KIND) - - f_ptr = C_LOC(orig_data(1,1)) - CALL H5Dwrite_f(dataset, mem_type_id, f_ptr, error) - CALL CHECK(" H5Dwrite_f", error, total_error) - - !---------------------------------------------------------------------- - ! STEP 2: Try to read the data we just wrote. - !---------------------------------------------------------------------- - ! - f_ptr = C_LOC(new_data(1,1)) - CALL H5Dread_f(dataset, mem_type_id, f_ptr, error) - CALL CHECK(" H5Dread_f", error, total_error) - - ! Check that the values read are the same as the values written - ! Assume size of long long = size of double - ! - i_loop: DO i = 1, dims(1) - j_loop: DO j = 1, dims(2) - IF(.NOT.(orig_data(i,j).EQ.orig_data(i,j))) CYCLE ! skip IF value is NaN - IF( .NOT.dreal_eq( REAL(new_data(i,j),dp), REAL( orig_data(i,j), dp)) ) THEN - total_error = total_error + 1 - WRITE(*,'(" Read different values than written.")') - WRITE(*,'(" At index ", 2(1X,I0))') i, j - EXIT i_loop - END IF - ENDDO j_loop - ENDDO i_loop - - !---------------------------------------------------------------------- - ! Cleanup - !---------------------------------------------------------------------- - ! - CALL H5Tclose_f(datatype, error) - CALL CHECK(" H5Tclose_f", error, total_error) - CALL H5Pclose_f(dc, error) - CALL CHECK(" H5Pclose_f", error, total_error) - CALL H5Sclose_f(space, error) - CALL CHECK(" H5Sclose_f", error, total_error) - CALL H5Dclose_f(dataset, error) - CALL CHECK(" H5Dclose_f", error, total_error) - CALL H5Fclose_f(file, error) - CALL CHECK(" H5Fclose_f", error, total_error) - -END SUBROUTINE test_nbit - - -SUBROUTINE t_enum_conv(total_error) - -!------------------------------------------------------------------------- -! Subroutine: t_enum_conv -! -! Purpose: Tests converting data from enumeration datatype -! to numeric (integer or floating-point number) -! datatype. Tests various KINDs of INTEGERs -! and REALs. Checks reading enum data into -! INTEGER and REAL KINDs. -! -! Return: Success: 0 -! Failure: number of errors -! -! Programmer: M. Scot Breitenfeld -! October 27, 2012 -! -! Note: Adapted from C test (enum.c -- test_conv) -! No reliance on C tests. -!------------------------------------------------------------------------- -! - USE HDF5 - USE TH5_MISC - USE ISO_C_BINDING - - IMPLICIT NONE - - INTEGER, INTENT(INOUT) :: total_error - - INTEGER, PARAMETER :: int_kind_8 = SELECTED_INT_KIND(Fortran_INTEGER_4) !should map to INTEGER*4 on most modern processors - INTEGER, PARAMETER :: int_kind_16 = SELECTED_INT_KIND(Fortran_INTEGER_8)!should map to INTEGER*8 on most modern processors - - INTEGER, PARAMETER :: real_kind_7 = SELECTED_REAL_KIND(Fortran_REAL_4) !should map to REAL*4 on most modern processors - - INTEGER(hid_t) :: cwg=-1, dtype=-1, space=-1, dset=-1 ! Handles - INTEGER(hid_t) :: file ! Handles - - ! Enumerated type - ENUM, BIND(C) - ENUMERATOR :: E1_RED, E1_GREEN, E1_BLUE, E1_WHITE, E1_BLACK - END ENUM - - INTEGER(KIND(E1_RED)), TARGET :: val - - ! Enumerated data array - ! Some values are out of range for testing. The library should accept them - INTEGER(KIND(E1_RED)), DIMENSION(1:20), TARGET :: data1 = (/INT(E1_RED,KIND(E1_RED)), & - INT(E1_GREEN,KIND(E1_RED)), INT(E1_BLUE,KIND(E1_RED)), & - INT(E1_GREEN,KIND(E1_RED)), INT(E1_WHITE,KIND(E1_RED)), & - INT(E1_WHITE,KIND(E1_RED)), INT(E1_BLACK,KIND(E1_RED)), & - INT(E1_GREEN,KIND(E1_RED)), INT(E1_BLUE,KIND(E1_RED)), & - INT(E1_RED,KIND(E1_RED)), INT(E1_RED,KIND(E1_RED)), INT(E1_BLUE,KIND(E1_RED)), & - INT(E1_GREEN,KIND(E1_RED)), INT(E1_BLACK,KIND(E1_RED)), INT(E1_WHITE,KIND(E1_RED)),& - INT(E1_RED,KIND(E1_RED)), INT(E1_WHITE,KIND(E1_RED)), & - INT(0,KIND(E1_RED)), INT(-1,KIND(E1_RED)), INT(-2,KIND(E1_RED))/) - - ! Reading array for enum data - INTEGER(KIND(E1_RED)), DIMENSION(1:20), TARGET :: data2 - - ! Reading array's for converted enum data - INTEGER(C_SHORT), DIMENSION(1:20), TARGET :: data_short - INTEGER(C_INT), DIMENSION(1:20), TARGET :: data_int - REAL(C_DOUBLE), DIMENSION(1:20), TARGET :: data_double - - INTEGER(int_kind_8), DIMENSION(1:20), TARGET :: data_i8 - INTEGER(int_kind_16), DIMENSION(1:20), TARGET :: data_i16 - REAL(real_kind_7), DIMENSION(1:20), TARGET :: data_r7 - - INTEGER(hsize_t), DIMENSION(1:1) :: ds_size = (/20/) - INTEGER(size_t) :: i - INTEGER(hsize_t) :: ih - INTEGER :: error - TYPE(C_PTR) :: f_ptr - INTEGER(HID_T) :: m_baset ! Memory base type - ! - ! Create a new file using the default properties. - ! - CALL h5fcreate_f("enum1.h5", H5F_ACC_TRUNC_F, file, error) - CALL check("h5fcreate_f", error, total_error) - ! - ! Create a new group using the default properties. - ! - CALL h5gcreate_f(file, "test_conv", cwg, error) - CALL check("h5gcreate_f",error, total_error) - ! - ! Create a enum type - ! - CALL H5Tcreate_f(H5T_ENUM_F, H5OFFSETOF(C_LOC(data1(1)), C_LOC(data1(2))), dtype, error) - CALL check("h5tcreate_f",error, total_error) - ! - ! Initialize enum data. - ! - val = E1_RED - CALL H5Tenum_insert_f(dtype, "RED", C_LOC(val), error) - CALL check("h5tenum_insert_f",error, total_error) - val = E1_GREEN - CALL H5Tenum_insert_f(dtype, "GREEN", C_LOC(val), error) - CALL check("h5tenum_insert_f",error, total_error) - val = E1_BLUE - CALL H5Tenum_insert_f(dtype, "BLUE", C_LOC(val), error) - CALL check("h5tenum_insert_f",error, total_error) - val = E1_WHITE - CALL H5Tenum_insert_f(dtype, "WHITE", C_LOC(val), error) - CALL check("h5tenum_insert_f",error, total_error) - val = E1_BLACK - CALL H5Tenum_insert_f(dtype, "BLACK", C_LOC(val), error) - CALL check("h5tenum_insert_f",error, total_error) - ! - ! Create dataspace. Setting maximum size to be the current size. - ! - CALL h5screate_simple_f(1, ds_size, space, error) - CALL check("h5screate_simple_f", error, total_error) - - ! *************************************** - ! * Dataset of enumeration type - ! *************************************** - ! - ! Create a dataset of enum type and write enum data to it - - CALL h5dcreate_f(cwg, "color_table1", dtype, space, dset, error) - CALL check("h5dcreate_f", error, total_error) - - f_ptr = C_LOC(data1(1)) - CALL h5dwrite_f(dset, dtype, f_ptr, error, space, space) - CALL check(" h5dwrite_f", error, total_error) - - ! Test reading back the data with no conversion - - f_ptr = C_LOC(data2(1)) - CALL h5dread_f(dset, dtype, f_ptr, error, space, space) - CALL check(" h5dread_f", error, total_error) - - ! Check values - DO ih = 1, ds_size(1) - IF(data1(ih) .NE. data2(ih))THEN - total_error = total_error + 1 - WRITE(*,'(" 1. data1(",I0,")=",I0," .NE. data2(",I0,")=",I0)') ih, data1(ih),i,data2(ih) - EXIT - ENDIF - ENDDO - - ! Test converting the data to integer (KIND=C_SHORT). Read enum data back as integer - m_baset = h5kind_to_type(KIND(data_short(1)), H5_INTEGER_KIND) ! Memory base type - f_ptr = C_LOC(data_short(1)) - CALL h5dread_f(dset, m_baset, f_ptr, error, space, space) - CALL check("h5dread_f", error, total_error) - ! Check values - DO ih = 1, ds_size(1) - IF(data1(ih) .NE. data_short(ih))THEN - total_error = total_error + 1 - WRITE(*,'(" 2. data1(",I0,")=",I0," .NE. data_short(",I0,")=",I0)') ih, data1(ih),i,data_short(ih) - EXIT - ENDIF - ENDDO - - ! Test converting the data to (KIND=C_double) number. - ! Read enum data back as (KIND=C_double) number - - m_baset = h5kind_to_type(KIND(data_double(1)), H5_REAL_KIND) ! Memory base type - f_ptr = C_LOC(data_double(1)) - CALL h5dread_f(dset, m_baset, f_ptr, error, space, space) - CALL check("h5dread_f", error, total_error) - ! Check values - DO ih = 1, ds_size(1) - IF(data1(ih) .NE. INT(data_double(ih)))THEN - total_error = total_error + 1 - WRITE(*,'(" 3. data_double(",I0,")=",I0," .NE. data_double(",I0,")=",I0)') & - ih, INT(data1(ih)), ih, INT(data_double(ih)) - EXIT - ENDIF - ENDDO - - ! Test converting the data to (SELECTED_INT_KIND(Fortran_INTEGER_4)) number. - ! Read enum data back as (SELECTED_INT_KIND(Fortran_INTEGER_4)) number - - m_baset = h5kind_to_type(int_kind_8, H5_INTEGER_KIND) ! Memory base type - f_ptr = C_LOC(data_i8(1)) - CALL h5dread_f(dset, m_baset, f_ptr, error, space, space) - CALL check("h5dread_f", error, total_error) - ! Check values - DO ih = 1, ds_size(1) - IF(data1(ih) .NE. INT(data_i8(ih)))THEN - total_error = total_error + 1 - WRITE(*,'(" 4. data_i8(",I0,")=",I0," .NE. data_i8(",I0,")=",I0)') & - ih, INT(data1(ih)), i, INT(data_i8(ih)) - EXIT - ENDIF - ENDDO - - ! Test converting the data to (SELECTED_INT_KIND(Fortran_INTEGER_8)) number. - ! Read enum data back as (SELECTED_INT_KIND(Fortran_INTEGER_8)) number - - m_baset = h5kind_to_type(int_kind_16, H5_INTEGER_KIND) ! Memory base type - f_ptr = C_LOC(data_i16(1)) - CALL h5dread_f(dset, m_baset, f_ptr, error, space, space) - CALL check("h5dread_f", error, total_error) - ! Check values - DO ih = 1, ds_size(1) - IF(data1(ih) .NE. INT(data_i16(ih)))THEN - total_error = total_error + 1 - WRITE(*,'(" 5. data_i16(",I0,")=",I0," .NE. data_i16(",I0,")=",I0)') & - ih, INT(data1(ih)), i, INT(data_i16(ih)) - EXIT - ENDIF - ENDDO - - ! Test converting the data to SELECTED_REAL_KIND(Fortran_REAL_4) number. - ! Read enum data back as SELECTED_REAL_KIND(Fortran_REAL_4) number - - m_baset = h5kind_to_type(KIND(data_r7(1)), H5_REAL_KIND) ! Memory base type - f_ptr = C_LOC(data_r7(1)) - CALL h5dread_f(dset, m_baset, f_ptr, error, space, space) - CALL check("h5dread_f", error, total_error) - ! Check values - DO ih = 1, ds_size(1) - IF(data1(ih) .NE. INT(data_r7(ih)))THEN - total_error = total_error + 1 - WRITE(*,'(" 6. data_r7(",I0,")=",I0," .NE. data_r7(",I0,")=",I0)') & - ih, INT(data1(ih)), i, INT(data_r7(ih)) - EXIT - ENDIF - ENDDO - - CALL h5dclose_f(dset, error) - CALL check("h5dclose_f", error, total_error) - - ! *************************************** - ! * Dataset of C_int type - ! *************************************** - - ! Create a integer dataset of KIND=C_INT and write enum data to it - m_baset = h5kind_to_type(KIND(data_int(1)), H5_INTEGER_KIND) ! Memory base type - CALL h5dcreate_f(cwg, "color_table2", m_baset, space, dset, error) - CALL check("h5dcreate_f", error, total_error) - - ! Write the enum data - f_ptr = C_LOC(data1(1)) - CALL h5dwrite_f(dset, dtype, f_ptr, error, space, space) - CALL check("h5dwrite_f", error, total_error) - - ! Test reading back the data with no conversion - f_ptr = C_LOC(data_int(1)) - CALL h5dread_f(dset, m_baset, f_ptr, error, space, space) - CALL check("h5dread_f", error, total_error) - - DO ih = 1, ds_size(1) - IF(data1(ih) .NE. data_int(ih))THEN - total_error = total_error + 1 - WRITE(*,'(" 7. data1(",I0,")=",I0," .NE. data_int(",I0,")=",I0)') ih, data1(ih),i,data_int(ih) - EXIT - ENDIF - ENDDO - CALL h5dclose_f(dset, error) - CALL check("h5dclose_f", error, total_error) - - !************************************** - !* Dataset of C_double type - !************************************** - - ! Create a dataset of KIND=C_DOUBLE and write enum data to it - m_baset = h5kind_to_type(KIND(data_double(1)), H5_REAL_KIND) ! Memory base type - CALL h5dcreate_f(cwg, "color_table3", m_baset, space, dset, error) - CALL check("h5dcreate_f", error, total_error) - - f_ptr = C_LOC(data1(1)) - CALL h5dwrite_f(dset, dtype, f_ptr, error, space, space) - CALL check("h5dwrite_f", error, total_error) - - ! Test reading back the data with no conversion - f_ptr = C_LOC(data_double(1)) - CALL h5dread_f(dset, m_baset, f_ptr, error, space, space) - CALL check("h5dread_f", error, total_error) - - DO ih = 1, ds_size(1) - IF(data1(ih) .NE. INT(data_double(ih)))THEN - total_error = total_error + 1 - WRITE(*,'(" 8. data1(",I0,")=",I0," .NE. data_double(",I0,")=",I0)') ih, data1(ih),ih,INT(data_double(ih)) - EXIT - ENDIF - ENDDO - CALL h5dclose_f(dset, error) - CALL check("h5dclose_f", error, total_error) - - !********************************************************* - !* Dataset of real SELECTED_REAL_KIND(Fortran_REAL_4) type - !********************************************************* - - ! Create a dataset of SELECTED_REAL_KIND(Fortran_REAL_4) and write enum data to it - m_baset = h5kind_to_type(KIND(data_r7(1)), H5_REAL_KIND) ! Memory base type - CALL h5dcreate_f(cwg, "color_table4", m_baset, space, dset, error) - CALL check("h5dcreate_f", error, total_error) - - f_ptr = C_LOC(data1(1)) - CALL h5dwrite_f(dset, dtype, f_ptr, error, space, space) - CALL check("h5dwrite_f", error, total_error) - - ! Test reading back the data with no conversion - f_ptr = C_LOC(data_r7(1)) - CALL h5dread_f(dset, m_baset, f_ptr, error, space, space) - CALL check("h5dread_f", error, total_error) - - DO ih = 1, ds_size(1) - IF(data1(ih) .NE. INT(data_r7(ih)))THEN - total_error = total_error + 1 - WRITE(*,'(" 9. data1(",I0,")=",I0," .NE. data_r7(",I0,")=",I0)') ih, data1(ih),ih,INT(data_r7(ih)) - EXIT - ENDIF - ENDDO - CALL h5dclose_f(dset, error) - CALL check("h5dclose_f", error, total_error) - - ! ***************************************************************** - ! * Dataset of integer SELECTED_INT_KIND(Fortran_INTEGER_8) type - ! ***************************************************************** - - ! Create a integer dataset of (SELECTED_INT_KIND(Fortran_INTEGER_8)) and write enum data to it - m_baset = h5kind_to_type(KIND(data_i16(1)), H5_INTEGER_KIND) ! Memory base type - CALL h5dcreate_f(cwg, "color_table5", m_baset, space, dset, error) - CALL check("h5dcreate_f", error, total_error) - - ! Write the enum data - f_ptr = C_LOC(data1(1)) - CALL h5dwrite_f(dset, dtype, f_ptr, error, space, space) - CALL check("h5dwrite_f", error, total_error) - - ! Test reading back the data with no conversion - f_ptr = C_LOC(data_i16(1)) - CALL h5dread_f(dset, m_baset, f_ptr, error, space, space) - CALL check("h5dread_f", error, total_error) - - DO ih = 1, ds_size(1) - IF(data1(ih) .NE. data_i16(ih))THEN - total_error = total_error + 1 - WRITE(*,'(" 10. data1(",I0,")=",I0," .NE. data_i16(",I0,")=",I0)') ih, data1(ih),ih,data_i16(ih) - EXIT - ENDIF - ENDDO - CALL h5dclose_f(dset, error) - CALL check("h5dclose_f", error, total_error) - - ! - ! Close and release resources. - ! - CALL h5sclose_f(space, error) - CALL check("H5Sclose_f", error, total_error) - CALL h5tclose_f(dtype, error) - CALL check("H5Tclose_f", error, total_error) - CALL h5gclose_f(cwg, error) - CALL check("h5gclose_f",error, total_error) - CALL h5fclose_f(file, error) - CALL check("H5Fclose_f", error, total_error) - -END SUBROUTINE t_enum_conv - -END MODULE TH5T_F03 diff --git a/fortran/test/tH5VL.f90 b/fortran/test/tH5VL.f90 index 651ca75..834fbde 100644 --- a/fortran/test/tH5VL.f90 +++ b/fortran/test/tH5VL.f90 @@ -28,12 +28,13 @@ !***** MODULE TH5VL + USE HDF5 ! This module contains all necessary modules + USE TH5_MISC + USE TH5_MISC_GEN CONTAINS SUBROUTINE vl_test_integer(cleanup, total_error) - USE HDF5 ! This module contains all necessary modules - USE TH5_MISC IMPLICIT NONE LOGICAL, INTENT(IN) :: cleanup @@ -194,8 +195,6 @@ CONTAINS END SUBROUTINE vl_test_integer SUBROUTINE vl_test_real(cleanup, total_error) - USE HDF5 ! This module contains all necessary modules - USE TH5_MISC IMPLICIT NONE LOGICAL, INTENT(IN) :: cleanup @@ -328,18 +327,15 @@ CONTAINS CALL h5dread_vl_f(dset_id, vltype_id, vl_real_data_out, data_dims, len_out, & error, mem_space_id = dspace_id, file_space_id = dspace_id) CALL check("h5dread_real_f", error, total_error) - do ih = 1, data_dims(2) - do jh = 1, len_out(ih) - IF( .NOT.dreal_eq( REAL(vl_real_data(jh,ih),dp), REAL(vl_real_data_out(jh,ih), dp)) ) THEN - total_error = total_error + 1 - WRITE(*,*) "h5dread_vl_f returned incorrect data" - ENDIF - enddo - if (len(ih) .ne. len_out(ih)) then - total_error = total_error + 1 - write(*,*) "h5dread_vl_f returned incorrect data" - endif - enddo + DO ih = 1, data_dims(2) + DO jh = 1, len_out(ih) + CALL VERIFY("h5dread_vl_f returned incorrect data",vl_real_data(jh,ih),vl_real_data_out(jh,ih), total_error) + ENDDO + IF (LEN(ih) .NE. len_out(ih)) THEN + total_error = total_error + 1 + WRITE(*,*) "h5dread_vl_f returned incorrect data" + ENDIF + ENDDO ! @@ -367,8 +363,6 @@ CONTAINS END SUBROUTINE vl_test_real SUBROUTINE vl_test_string(cleanup, total_error) - USE HDF5 ! This module contains all necessary modules - USE TH5_MISC IMPLICIT NONE LOGICAL, INTENT(IN) :: cleanup diff --git a/fortran/test/tHDF5.f90 b/fortran/test/tHDF5.f90 index e73fed2..d12bb25 100644 --- a/fortran/test/tHDF5.f90 +++ b/fortran/test/tHDF5.f90 @@ -29,6 +29,7 @@ MODULE THDF5 USE TH5_MISC + USE TH5_MISC_GEN USE TH5A USE TH5D USE TH5E diff --git a/fortran/test/tf.F90 b/fortran/test/tf.F90 new file mode 100644 index 0000000..7d67f30 --- /dev/null +++ b/fortran/test/tf.F90 @@ -0,0 +1,412 @@ +!****h* root/fortran/test/tf.f90 +! +! NAME +! tf.f90 +! +! FUNCTION +! Contains subroutines which are needed in all the hdf5 fortran tests +! +! 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. * +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! +! CONTAINS SUBROUTINES +! write_test_status, check, verify, verifyLogical, verifyString, h5_fixname_f, +! h5_cleanup_f, h5_exit_f, h5_env_nocleanup_f,dreal_eqv +! +!***** + +#include "H5config_f.inc" + +MODULE TH5_MISC + + USE, INTRINSIC :: ISO_C_BINDING + + IMPLICIT NONE + + INTEGER, PARAMETER :: sp = SELECTED_REAL_KIND(5) ! This should map to REAL*4 on most modern processors + INTEGER, PARAMETER :: dp = SELECTED_REAL_KIND(10) ! This should map to REAL*8 on most modern processors + + ! generic compound datatype + TYPE, BIND(C) :: comp_datatype + REAL :: a + INTEGER :: x + DOUBLE PRECISION :: y + CHARACTER(KIND=C_CHAR) :: z + END TYPE comp_datatype + + PUBLIC :: H5_SIZEOF + INTERFACE H5_SIZEOF + MODULE PROCEDURE H5_SIZEOF_CMPD + MODULE PROCEDURE H5_SIZEOF_CHR + MODULE PROCEDURE H5_SIZEOF_I + MODULE PROCEDURE H5_SIZEOF_SP,H5_SIZEOF_DP + END INTERFACE + +CONTAINS + +!This definition is needed for Windows DLLs +!DEC$if defined(BUILD_HDF5_TEST_DLL) +!DEC$attributes dllexport :: write_test_status +!DEC$endif + SUBROUTINE write_test_status( test_result, test_title, total_error) + + ! Writes the results of the tests + + IMPLICIT NONE + + INTEGER, INTENT(IN) :: test_result ! negative, --skip -- + ! 0 , passed + ! positive, failed + + CHARACTER(LEN=*), INTENT(IN) :: test_title ! Short description of test + INTEGER, INTENT(INOUT) :: total_error ! Accumulated error + +! Controls the output style for reporting test results + + CHARACTER(LEN=8) :: error_string + CHARACTER(LEN=8), PARAMETER :: success = ' PASSED ' + CHARACTER(LEN=8), PARAMETER :: failure = '*FAILED*' + CHARACTER(LEN=8), PARAMETER :: skip = '--SKIP--' + + + error_string = failure + IF (test_result == 0) THEN + error_string = success + ELSE IF (test_result == -1) THEN + error_string = skip + ENDIF + + WRITE(*, fmt = '(A, T72, A)') test_title, error_string + + IF(test_result.GT.0) total_error = total_error + test_result + + END SUBROUTINE write_test_status + + +!This definition is needed for Windows DLLs +!DEC$if defined(BUILD_HDF5_TEST_DLL) +!DEC$attributes dllexport :: check +!DEC$endif + SUBROUTINE check(string,error,total_error) + CHARACTER(LEN=*) :: string + INTEGER :: error, total_error + IF (error .LT. 0) THEN + total_error=total_error+1 + WRITE(*,*) string, " FAILED" + ENDIF + RETURN + END SUBROUTINE check + +!---------------------------------------------------------------------- +! Name: h5_fixname_f +! +! Purpose: Create a file name from the a file base name. +! It is a fortran counterpart for the h5_fixname in ../../test/h5test.c +! +! Inputs: +! base_name - base name of the file +! fapl - file access property list +! Outputs: +! full_name - full file name +! hdferr: - error code +! Success: 0 +! Failure: -1 +! +! Programmer: Elena Pourmal +! September 13, 2002 +! +! +!---------------------------------------------------------------------- + SUBROUTINE h5_fixname_f(base_name, full_name, fapl, hdferr) +! +!This definition is needed for Windows DLLs +!DEC$if defined(BUILD_HDF5_TEST_DLL) +!DEC$attributes dllexport :: h5_fixname_f +!DEC$endif + USE H5GLOBAL + IMPLICIT NONE + CHARACTER(LEN=*), INTENT(IN) :: base_name ! base name + CHARACTER(LEN=*), INTENT(IN) :: full_name ! full name + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), INTENT(IN) :: fapl ! file access property list + + INTEGER(SIZE_T) :: base_namelen ! Length of the base name character string + INTEGER(SIZE_T) :: full_namelen ! Length of the full name character string +! INTEGER(HID_T) :: fapl_default + + INTERFACE + INTEGER FUNCTION h5_fixname_c(base_name, base_namelen, fapl, & + full_name, full_namelen) + USE H5GLOBAL + !DEC$ IF DEFINED(HDF5F90_WINDOWS) + !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5_FIXNAME_C':: h5_fixname_c + !DEC$ ENDIF + !DEC$ATTRIBUTES reference :: base_name + !DEC$ATTRIBUTES reference :: full_name + CHARACTER(LEN=*), INTENT(IN) :: base_name + INTEGER(SIZE_T) :: base_namelen + INTEGER(HID_T), INTENT(IN) :: fapl + CHARACTER(LEN=*), INTENT(IN) :: full_name + INTEGER(SIZE_T) :: full_namelen + END FUNCTION h5_fixname_c + END INTERFACE + + base_namelen = LEN(base_name) + full_namelen = LEN(full_name) + hdferr = h5_fixname_c(base_name, base_namelen, fapl, & + full_name, full_namelen) + + END SUBROUTINE h5_fixname_f + +!---------------------------------------------------------------------- +! Name: h5_cleanup_f +! +! Purpose: Cleanups tests files +! It is a fortran counterpart for the h5_cleanup in ../../test/h5test.c +! +! Inputs: +! base_name - base name of the file +! fapl - file access property list +! Outputs: +! hdferr: - error code +! Success: 0 +! Failure: -1 +! +! Programmer: Elena Pourmal +! September 19, 2002 +! +! +!---------------------------------------------------------------------- + SUBROUTINE h5_cleanup_f(base_name, fapl, hdferr) +! +!This definition is needed for Windows DLLs +!DEC$if defined(BUILD_HDF5_TEST_DLL) +!DEC$attributes dllexport :: h5_cleanup_f +!DEC$endif + USE H5GLOBAL + IMPLICIT NONE + CHARACTER(LEN=*), INTENT(IN) :: base_name ! base name + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), INTENT(IN) :: fapl ! file access property list + + INTEGER(SIZE_T) :: base_namelen ! Length of the base name character string + + INTERFACE + INTEGER FUNCTION h5_cleanup_c(base_name, base_namelen, fapl) + USE H5GLOBAL + !DEC$ IF DEFINED(HDF5F90_WINDOWS) + !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5_CLEANUP_C':: h5_cleanup_c + !DEC$ ENDIF + !DEC$ATTRIBUTES reference :: base_name + CHARACTER(LEN=*), INTENT(IN) :: base_name + INTEGER(SIZE_T) :: base_namelen + INTEGER(HID_T), INTENT(IN) :: fapl + END FUNCTION h5_cleanup_c + END INTERFACE + + base_namelen = LEN(base_name) + hdferr = h5_cleanup_c(base_name, base_namelen, fapl) + + END SUBROUTINE h5_cleanup_f + +!---------------------------------------------------------------------- +! Name: h5_exit_f +! +! Purpose: Exit application +! It is a fortran counterpart for the standard C 'exit()' routine +! Be careful not to overflow the exit value range since +! UNIX supports a very small range such as 1 byte. +! Therefore, exit(256) may end up as exit(0). +! +! Inputs: +! status - Status to return from application +! +! Outputs: +! none +! +! Programmer: Quincey Koziol +! December 14, 2004 +! +! +!---------------------------------------------------------------------- + SUBROUTINE h5_exit_f(status) +! +!This definition is needed for Windows DLLs +!DEC$if defined(BUILD_HDF5_TEST_DLL) +!DEC$attributes dllexport :: h5_exit_f +!DEC$endif + IMPLICIT NONE + INTEGER, INTENT(IN) :: status ! Return code + + INTERFACE + SUBROUTINE h5_exit_c(status) + !DEC$ IF DEFINED(HDF5F90_WINDOWS) + !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5_EXIT_C':: h5_exit_c + !DEC$ ENDIF + INTEGER, INTENT(IN) :: status + END SUBROUTINE h5_exit_c + END INTERFACE + + CALL h5_exit_c(status) + + END SUBROUTINE h5_exit_f + +!---------------------------------------------------------------------- +! Name: h5_env_nocleanup_f +! +! Purpose: Uses the HDF5_NOCLEANUP environment variable in Fortran +! tests to determine if the output files should be removed +! +! Inputs: +! +! Outputs: HDF5_NOCLEANUP: .true. - don't remove test files +! .false. - remove test files +! +! Programmer: M.S. Breitenfeld +! September 30, 2008 +! +!---------------------------------------------------------------------- + SUBROUTINE h5_env_nocleanup_f(HDF5_NOCLEANUP) +! +!This definition is needed for Windows DLLs +!DEC$if defined(BUILD_HDF5_TEST_DLL) +!DEC$attributes dllexport :: h5_env_nocleanup_f +!DEC$endif + IMPLICIT NONE + LOGICAL, INTENT(OUT) :: HDF5_NOCLEANUP ! Return code + INTEGER :: status + + INTERFACE + SUBROUTINE h5_env_nocleanup_c(status) + !DEC$ IF DEFINED(HDF5F90_WINDOWS) + !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5_ENV_NOCLEANUP_C':: h5_env_nocleanup_c + !DEC$ ENDIF + INTEGER :: status + END SUBROUTINE h5_env_nocleanup_c + END INTERFACE + + CALL h5_env_nocleanup_c(status) + + HDF5_NOCLEANUP = .FALSE. + IF(status.EQ.1) HDF5_NOCLEANUP = .TRUE. + + END SUBROUTINE h5_env_nocleanup_f + +! --------------------------------------------------------------------------------------------------- +! H5_SIZEOF routines +! +! NOTES +! (1) The Sun/Oracle compiler has the following restrictions on the SIZEOF intrinsic function: +! +! "The SIZEOF intrinsic cannot be applied to arrays of an assumed size, characters of a +! length that is passed, or subroutine calls or names. SIZEOF returns default INTEGER*4 data. +! If compiling for a 64-bit environment, the compiler will issue a warning if the result overflows +! the INTEGER*4 data range. To use SIZEOF in a 64-bit environment with arrays larger +! than the INTEGER*4 limit (2 Gbytes), the SIZEOF function and +! the variables receiving the result must be declared INTEGER*8." +! +! Thus, we can not overload the H5_SIZEOF function to handle arrays (as used in tH5P_F03.f90), or +! characters that do not have a set length (as used in tH5P_F03.f90), sigh... +! +! (2) F08+TS29113 requires C interoperable variable as argument for C_SIZEOF. +! +! (3) Unfortunately we need to wrap the C_SIZEOF/STORAGE_SIZE functions to handle different +! data types from the various tests. +! +! --------------------------------------------------------------------------------------------------- + +!This definition is needed for Windows DLLs +!DEC$if defined(BUILD_HDF5_TEST_DLL) +!DEC$attributes dllexport :: h5_sizeof_cmpd +!DEC$endif + INTEGER(C_SIZE_T) FUNCTION H5_SIZEOF_CMPD(a) + IMPLICIT NONE + TYPE(comp_datatype), INTENT(in) :: a + +#ifdef H5_FORTRAN_FORTRAN_HAVE_C_SIZEOF + H5_SIZEOF_CMPD = C_SIZEOF(a) +#else + H5_SIZEOF_CMPD = SIZEOF(a) +#endif + + END FUNCTION H5_SIZEOF_CMPD + +!This definition is needed for Windows DLLs +!DEC$if defined(BUILD_HDF5_TEST_DLL) +!DEC$attributes dllexport :: h5_sizeof_chr +!DEC$endif + INTEGER(C_SIZE_T) FUNCTION H5_SIZEOF_CHR(a) + IMPLICIT NONE + CHARACTER(LEN=1), INTENT(in) :: a + +#ifdef H5_FORTRAN_HAVE_STORAGE_SIZE + H5_SIZEOF_CHR = storage_size(a, c_size_t)/storage_size(c_char_'a',c_size_t) +#else + H5_SIZEOF_CHR = SIZEOF(a) +#endif + + END FUNCTION H5_SIZEOF_CHR + +!This definition is needed for Windows DLLs +!DEC$if defined(BUILD_HDF5_TEST_DLL) +!DEC$attributes dllexport :: h5_sizeof_i +!DEC$endif + INTEGER(C_SIZE_T) FUNCTION H5_SIZEOF_I(a) + IMPLICIT NONE + INTEGER, INTENT(in):: a + +#ifdef H5_FORTRAN_HAVE_STORAGE_SIZE + H5_SIZEOF_I = storage_size(a, c_size_t)/storage_size(c_char_'a',c_size_t) +#else + H5_SIZEOF_I = SIZEOF(a) +#endif + + END FUNCTION H5_SIZEOF_I + + +!This definition is needed for Windows DLLs +!DEC$if defined(BUILD_HDF5_TEST_DLL) +!DEC$attributes dllexport :: h5_sizeof_sp +!DEC$endif + INTEGER(C_SIZE_T) FUNCTION H5_SIZEOF_SP(a) + IMPLICIT NONE + REAL(sp), INTENT(in):: a + +#ifdef H5_FORTRAN_HAVE_STORAGE_SIZE + H5_SIZEOF_SP = storage_size(a, c_size_t)/storage_size(c_char_'a',c_size_t) +#else + H5_SIZEOF_SP = SIZEOF(a) +#endif + + END FUNCTION H5_SIZEOF_SP + +!This definition is needed for Windows DLLs +!DEC$if defined(BUILD_HDF5_TEST_DLL) +!DEC$attributes dllexport :: h5_sizeof_dp +!DEC$endif + INTEGER(C_SIZE_T) FUNCTION H5_SIZEOF_DP(a) + IMPLICIT NONE + REAL(dp), INTENT(in):: a + +#ifdef H5_FORTRAN_HAVE_STORAGE_SIZE + H5_SIZEOF_DP = storage_size(a, c_size_t)/storage_size(c_char_'a',c_size_t) +#else + H5_SIZEOF_DP = SIZEOF(a) +#endif + + END FUNCTION H5_SIZEOF_DP + +END MODULE TH5_MISC diff --git a/fortran/test/tf.f90 b/fortran/test/tf.f90 deleted file mode 100644 index 450daf2..0000000 --- a/fortran/test/tf.f90 +++ /dev/null @@ -1,393 +0,0 @@ -!****h* root/fortran/test/tf.f90 -! -! NAME -! tf.f90 -! -! FUNCTION -! Contains subroutines which are needed in all the hdf5 fortran tests -! -! 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. * -! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -! -! CONTAINS SUBROUTINES -! write_test_status, check, verify, verifyLogical, verifyString, h5_fixname_f, -! h5_cleanup_f, h5_exit_f, h5_env_nocleanup_f,dreal_eqv -! -!***** -MODULE TH5_MISC - - USE TH5_MISC_PROVISIONAL - - IMPLICIT NONE - -CONTAINS - -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_TEST_DLL) -!DEC$attributes dllexport :: dreal_eq -!DEC$endif - LOGICAL FUNCTION dreal_eq(a,b) - - ! Check if two double precision reals are equivalent - REAL(dp), INTENT (in):: a,b - REAL(dp), PARAMETER :: eps = 1.e-8 - dreal_eq = ABS(a-b) .LT. eps - - END FUNCTION dreal_eq - -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_TEST_DLL) -!DEC$attributes dllexport :: verify_real_kind_7 -!DEC$endif - SUBROUTINE verify_real_kind_7(string,value,correct_value,total_error) - USE HDF5 - INTEGER, PARAMETER :: real_kind_7 = SELECTED_REAL_KIND(Fortran_REAL_4) !should map to REAL*4 on most modern processors - CHARACTER(LEN=*) :: string - REAL(real_kind_7) :: value, correct_value - INTEGER :: total_error - IF (.NOT.dreal_eq( REAL(value,dp), REAL(correct_value, dp)) ) THEN - total_error=total_error+1 - WRITE(*,*) "ERROR: INCORRECT REAL VALIDATION ", string - ENDIF - RETURN - END SUBROUTINE verify_real_kind_7 - -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_TEST_DLL) -!DEC$attributes dllexport :: write_test_status -!DEC$endif - SUBROUTINE write_test_status( test_result, test_title, total_error) - - ! Writes the results of the tests - - IMPLICIT NONE - - INTEGER, INTENT(IN) :: test_result ! negative, --skip -- - ! 0 , passed - ! positive, failed - - CHARACTER(LEN=*), INTENT(IN) :: test_title ! Short description of test - INTEGER, INTENT(INOUT) :: total_error ! Accumulated error - -! Controls the output style for reporting test results - - CHARACTER(LEN=8) :: error_string - CHARACTER(LEN=8), PARAMETER :: success = ' PASSED ' - CHARACTER(LEN=8), PARAMETER :: failure = '*FAILED*' - CHARACTER(LEN=8), PARAMETER :: skip = '--SKIP--' - - - error_string = failure - IF (test_result == 0) THEN - error_string = success - ELSE IF (test_result == -1) THEN - error_string = skip - ENDIF - - WRITE(*, fmt = '(A, T72, A)') test_title, error_string - - IF(test_result.GT.0) total_error = total_error + test_result - - END SUBROUTINE write_test_status - - -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_TEST_DLL) -!DEC$attributes dllexport :: check -!DEC$endif - SUBROUTINE check(string,error,total_error) - CHARACTER(LEN=*) :: string - INTEGER :: error, total_error - IF (error .LT. 0) THEN - total_error=total_error+1 - WRITE(*,*) string, " FAILED" - ENDIF - RETURN - END SUBROUTINE check - -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_TEST_DLL) -!DEC$attributes dllexport :: verify -!DEC$endif - SUBROUTINE VERIFY(string,value,correct_value,total_error) - CHARACTER(LEN=*) :: string - INTEGER :: value, correct_value, total_error - IF (value .NE. correct_value) THEN - total_error=total_error+1 - WRITE(*,*) "ERROR: INCORRECT VALIDATION ", string - ENDIF - RETURN - END SUBROUTINE verify - -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_TEST_DLL) -!DEC$attributes dllexport :: verify_INTEGER_HID_T -!DEC$endif - SUBROUTINE verify_INTEGER_HID_T(string,value,correct_value,total_error) - USE HDF5 - CHARACTER(LEN=*) :: string - INTEGER(HID_T) :: value, correct_value - INTEGER :: total_error - IF (value .NE. correct_value) THEN - total_error=total_error+1 - WRITE(*,*) "ERROR: INCORRECT VALIDATION ", string - ENDIF - RETURN - END SUBROUTINE verify_INTEGER_HID_T - -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_TEST_DLL) -!DEC$attributes dllexport :: verify_Fortran_INTEGER_4 -!DEC$endif - SUBROUTINE verify_Fortran_INTEGER_4(string,value,correct_value,total_error) - USE HDF5 - INTEGER, PARAMETER :: int_kind_8 = SELECTED_INT_KIND(Fortran_INTEGER_4) ! should map to INTEGER*4 on most modern processors - CHARACTER(LEN=*) :: string - INTEGER(int_kind_8) :: value, correct_value - INTEGER :: total_error - IF (value .NE. correct_value) THEN - total_error=total_error+1 - WRITE(*,*) "ERROR: INCORRECT VALIDATION ", string - ENDIF - RETURN - END SUBROUTINE verify_Fortran_INTEGER_4 - -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_TEST_DLL) -!DEC$attributes dllexport :: verifyLogical -!DEC$endif - SUBROUTINE verifyLogical(string,value,correct_value,total_error) - CHARACTER(LEN=*) :: string - LOGICAL :: value, correct_value - INTEGER :: total_error - IF (value .NEQV. correct_value) THEN - total_error = total_error + 1 - WRITE(*,*) "ERROR: INCORRECT VALIDATION ", string - ENDIF - RETURN - END SUBROUTINE verifyLogical - -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_TEST_DLL) -!DEC$attributes dllexport :: verifyString -!DEC$endif - SUBROUTINE verifyString(string, value,correct_value,total_error) - CHARACTER*(*) :: string - CHARACTER*(*) :: value, correct_value - INTEGER :: total_error - IF (TRIM(value) .NE. TRIM(correct_value)) THEN - total_error = total_error + 1 - WRITE(*,*) "ERROR: INCORRECT VALIDATION ", string - ENDIF - RETURN - END SUBROUTINE verifyString - - -!---------------------------------------------------------------------- -! Name: h5_fixname_f -! -! Purpose: Create a file name from the a file base name. -! It is a fortran counterpart for the h5_fixname in ../../test/h5test.c -! -! Inputs: -! base_name - base name of the file -! fapl - file access property list -! Outputs: -! full_name - full file name -! hdferr: - error code -! Success: 0 -! Failure: -1 -! -! Programmer: Elena Pourmal -! September 13, 2002 -! -! -!---------------------------------------------------------------------- - SUBROUTINE h5_fixname_f(base_name, full_name, fapl, hdferr) -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_TEST_DLL) -!DEC$attributes dllexport :: h5_fixname_f -!DEC$endif - USE H5GLOBAL - IMPLICIT NONE - CHARACTER(LEN=*), INTENT(IN) :: base_name ! base name - CHARACTER(LEN=*), INTENT(IN) :: full_name ! full name - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), INTENT(IN) :: fapl ! file access property list - - INTEGER(SIZE_T) :: base_namelen ! Length of the base name character string - INTEGER(SIZE_T) :: full_namelen ! Length of the full name character string -! INTEGER(HID_T) :: fapl_default - - INTERFACE - INTEGER FUNCTION h5_fixname_c(base_name, base_namelen, fapl, & - full_name, full_namelen) - USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5_FIXNAME_C':: h5_fixname_c - !DEC$ ENDIF - !DEC$ATTRIBUTES reference :: base_name - !DEC$ATTRIBUTES reference :: full_name - CHARACTER(LEN=*), INTENT(IN) :: base_name - INTEGER(SIZE_T) :: base_namelen - INTEGER(HID_T), INTENT(IN) :: fapl - CHARACTER(LEN=*), INTENT(IN) :: full_name - INTEGER(SIZE_T) :: full_namelen - END FUNCTION h5_fixname_c - END INTERFACE - - base_namelen = LEN(base_name) - full_namelen = LEN(full_name) - hdferr = h5_fixname_c(base_name, base_namelen, fapl, & - full_name, full_namelen) - - END SUBROUTINE h5_fixname_f - -!---------------------------------------------------------------------- -! Name: h5_cleanup_f -! -! Purpose: Cleanups tests files -! It is a fortran counterpart for the h5_cleanup in ../../test/h5test.c -! -! Inputs: -! base_name - base name of the file -! fapl - file access property list -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! -! Programmer: Elena Pourmal -! September 19, 2002 -! -! -!---------------------------------------------------------------------- - SUBROUTINE h5_cleanup_f(base_name, fapl, hdferr) -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_TEST_DLL) -!DEC$attributes dllexport :: h5_cleanup_f -!DEC$endif - USE H5GLOBAL - IMPLICIT NONE - CHARACTER(LEN=*), INTENT(IN) :: base_name ! base name - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), INTENT(IN) :: fapl ! file access property list - - INTEGER(SIZE_T) :: base_namelen ! Length of the base name character string - - INTERFACE - INTEGER FUNCTION h5_cleanup_c(base_name, base_namelen, fapl) - USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5_CLEANUP_C':: h5_cleanup_c - !DEC$ ENDIF - !DEC$ATTRIBUTES reference :: base_name - CHARACTER(LEN=*), INTENT(IN) :: base_name - INTEGER(SIZE_T) :: base_namelen - INTEGER(HID_T), INTENT(IN) :: fapl - END FUNCTION h5_cleanup_c - END INTERFACE - - base_namelen = LEN(base_name) - hdferr = h5_cleanup_c(base_name, base_namelen, fapl) - - END SUBROUTINE h5_cleanup_f - -!---------------------------------------------------------------------- -! Name: h5_exit_f -! -! Purpose: Exit application -! It is a fortran counterpart for the standard C 'exit()' routine -! Be careful not to overflow the exit value range since -! UNIX supports a very small range such as 1 byte. -! Therefore, exit(256) may end up as exit(0). -! -! Inputs: -! status - Status to return from application -! -! Outputs: -! none -! -! Programmer: Quincey Koziol -! December 14, 2004 -! -! -!---------------------------------------------------------------------- - SUBROUTINE h5_exit_f(status) -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_TEST_DLL) -!DEC$attributes dllexport :: h5_exit_f -!DEC$endif - IMPLICIT NONE - INTEGER, INTENT(IN) :: status ! Return code - - INTERFACE - SUBROUTINE h5_exit_c(status) - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5_EXIT_C':: h5_exit_c - !DEC$ ENDIF - INTEGER, INTENT(IN) :: status - END SUBROUTINE h5_exit_c - END INTERFACE - - CALL h5_exit_c(status) - - END SUBROUTINE h5_exit_f - -!---------------------------------------------------------------------- -! Name: h5_env_nocleanup_f -! -! Purpose: Uses the HDF5_NOCLEANUP environment variable in Fortran -! tests to determine if the output files should be removed -! -! Inputs: -! -! Outputs: HDF5_NOCLEANUP: .true. - don't remove test files -! .false. - remove test files -! -! Programmer: M.S. Breitenfeld -! September 30, 2008 -! -!---------------------------------------------------------------------- - SUBROUTINE h5_env_nocleanup_f(HDF5_NOCLEANUP) -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_TEST_DLL) -!DEC$attributes dllexport :: h5_env_nocleanup_f -!DEC$endif - IMPLICIT NONE - LOGICAL, INTENT(OUT) :: HDF5_NOCLEANUP ! Return code - INTEGER :: status - - INTERFACE - SUBROUTINE h5_env_nocleanup_c(status) - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5_ENV_NOCLEANUP_C':: h5_env_nocleanup_c - !DEC$ ENDIF - INTEGER :: status - END SUBROUTINE h5_env_nocleanup_c - END INTERFACE - - CALL h5_env_nocleanup_c(status) - - HDF5_NOCLEANUP = .FALSE. - IF(status.EQ.1) HDF5_NOCLEANUP = .TRUE. - - END SUBROUTINE h5_env_nocleanup_f -END MODULE TH5_MISC diff --git a/fortran/test/tf_F03.f90 b/fortran/test/tf_F03.f90 deleted file mode 100644 index b3f1399..0000000 --- a/fortran/test/tf_F03.f90 +++ /dev/null @@ -1,128 +0,0 @@ -!****h* root/fortran/test/tf_F03.f90 -! -! NAME -! tf_F03.f90 -! -! FUNCTION -! Contains functions that are part of the F2003 standard, and are not F2008 compliant. -! Needed by the hdf5 fortran tests. -! -! 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. * -! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -! -! CONTAINS SUBROUTINES -! H5_SIZEOF -! -! NOTES -! The Sun/Oracle compiler has the following restrictions on the SIZEOF intrinsic function: -! -! "The SIZEOF intrinsic cannot be applied to arrays of an assumed size, characters of a -! length that is passed, or subroutine calls or names. SIZEOF returns default INTEGER*4 data. -! If compiling for a 64-bit environment, the compiler will issue a warning if the result overflows -! the INTEGER*4 data range. To use SIZEOF in a 64-bit environment with arrays larger -! than the INTEGER*4 limit (2 Gbytes), the SIZEOF function and -! the variables receiving the result must be declared INTEGER*8." -! -! Thus, we can not overload the H5_SIZEOF function to handle arrays (as used in tH5P_F03.f90), or -! characters that do not have a set length (as used in tH5P_F03.f90), sigh... -! -!***** -MODULE TH5_MISC_PROVISIONAL - - USE ISO_C_BINDING - IMPLICIT NONE - - INTEGER, PARAMETER :: sp = SELECTED_REAL_KIND(5) ! This should map to REAL*4 on most modern processors - INTEGER, PARAMETER :: dp = SELECTED_REAL_KIND(10) ! This should map to REAL*8 on most modern processors - - ! generic compound datatype - TYPE, BIND(C) :: comp_datatype - REAL :: a - INTEGER :: x - DOUBLE PRECISION :: y - CHARACTER(LEN=1) :: z - END TYPE comp_datatype - - PUBLIC :: H5_SIZEOF - INTERFACE H5_SIZEOF - MODULE PROCEDURE H5_SIZEOF_CMPD - MODULE PROCEDURE H5_SIZEOF_I, H5_SIZEOF_CHR - MODULE PROCEDURE H5_SIZEOF_SP,H5_SIZEOF_DP - END INTERFACE - -CONTAINS - -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_TEST_DLL) -!DEC$attributes dllexport :: h5_sizeof_cmpd - !DEC$endif - INTEGER(C_SIZE_T) FUNCTION H5_SIZEOF_CMPD(a) - IMPLICIT NONE - TYPE(comp_datatype), INTENT(in) :: a - - H5_SIZEOF_CMPD = SIZEOF(a) - - END FUNCTION H5_SIZEOF_CMPD - -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_TEST_DLL) -!DEC$attributes dllexport :: h5_sizeof_chr -!DEC$endif - INTEGER(C_SIZE_T) FUNCTION H5_SIZEOF_CHR(a) - IMPLICIT NONE - CHARACTER(LEN=1), INTENT(in):: a - - H5_SIZEOF_CHR = SIZEOF(a) - - END FUNCTION H5_SIZEOF_CHR - -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_TEST_DLL) -!DEC$attributes dllexport :: h5_sizeof_i -!DEC$endif - INTEGER(C_SIZE_T) FUNCTION H5_SIZEOF_I(a) - IMPLICIT NONE - INTEGER, INTENT(in):: a - - H5_SIZEOF_I = SIZEOF(a) - - END FUNCTION H5_SIZEOF_I - -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_TEST_DLL) -!DEC$attributes dllexport :: h5_sizeof_sp -!DEC$endif - INTEGER(C_SIZE_T) FUNCTION H5_SIZEOF_SP(a) - IMPLICIT NONE - REAL(sp), INTENT(in):: a - - H5_SIZEOF_SP = SIZEOF(a) - - END FUNCTION H5_SIZEOF_SP - -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_TEST_DLL) -!DEC$attributes dllexport :: h5_sizeof_dp -!DEC$endif - INTEGER(C_SIZE_T) FUNCTION H5_SIZEOF_DP(a) - IMPLICIT NONE - REAL(dp), INTENT(in):: a - - H5_SIZEOF_DP = SIZEOF(a) - - END FUNCTION H5_SIZEOF_DP - -END MODULE TH5_MISC_PROVISIONAL diff --git a/fortran/test/tf_F08.f90 b/fortran/test/tf_F08.f90 deleted file mode 100644 index 20c2859..0000000 --- a/fortran/test/tf_F08.f90 +++ /dev/null @@ -1,128 +0,0 @@ -!****h* root/fortran/test/tf_F08.f90 -! -! NAME -! tf_F08.f90 -! -! FUNCTION -! Contains functions that are part of the F2008 standard and needed by -! the hdf5 fortran tests. -! -! 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. * -! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -! -! CONTAINS SUBROUTINES -! H5_SIZEOF -! -! NOTES -! This file contains "sizeof" functions that are F2008 standard compliant -! and replace the non-standard 'SIZEOF' functions found in the file tf_F03. -! Unfortunity we need to wrap the C_SIZEOF/STORAGE_SIZE functions to handle different -! data types from the various tests. -! -! F08+TS29113 requires C interoperable variable as argument for C_SIZEOF. -! -! This file will be build instead of tf_F03.f90 if the intrinsic fortran -! function C_SIZEOF/STORAGE_SIZE is found during configure. -! -!***** -MODULE TH5_MISC_PROVISIONAL - - USE ISO_C_BINDING - IMPLICIT NONE - - INTEGER, PARAMETER :: sp = SELECTED_REAL_KIND(5) ! This should map to REAL*4 on most modern processors - INTEGER, PARAMETER :: dp = SELECTED_REAL_KIND(10) ! This should map to REAL*8 on most modern processors - - ! generic compound datatype - TYPE, BIND(C) :: comp_datatype - REAL :: a - INTEGER :: x - DOUBLE PRECISION :: y - CHARACTER(LEN=1) :: z - END TYPE comp_datatype - - PUBLIC :: H5_SIZEOF - INTERFACE H5_SIZEOF - MODULE PROCEDURE H5_SIZEOF_CMPD - MODULE PROCEDURE H5_SIZEOF_CHR - MODULE PROCEDURE H5_SIZEOF_I - MODULE PROCEDURE H5_SIZEOF_SP,H5_SIZEOF_DP - END INTERFACE - -CONTAINS - -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_TEST_DLL) -!DEC$attributes dllexport :: h5_sizeof_cmpd -!DEC$endif - INTEGER(C_SIZE_T) FUNCTION H5_SIZEOF_CMPD(a) - IMPLICIT NONE - TYPE(comp_datatype), INTENT(in) :: a - - H5_SIZEOF_CMPD = C_SIZEOF(a) - - END FUNCTION H5_SIZEOF_CMPD - -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_TEST_DLL) -!DEC$attributes dllexport :: h5_sizeof_chr -!DEC$endif - INTEGER(C_SIZE_T) FUNCTION H5_SIZEOF_CHR(a) - IMPLICIT NONE - CHARACTER(LEN=*), INTENT(in) :: a - - H5_SIZEOF_CHR = storage_size(a, c_size_t)/storage_size(c_char_'a',c_size_t) - - END FUNCTION H5_SIZEOF_CHR - -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_TEST_DLL) -!DEC$attributes dllexport :: h5_sizeof_i -!DEC$endif - INTEGER(C_SIZE_T) FUNCTION H5_SIZEOF_I(a) - IMPLICIT NONE - INTEGER, INTENT(in):: a - - H5_SIZEOF_I = storage_size(a, c_size_t)/storage_size(c_char_'a',c_size_t) - - END FUNCTION H5_SIZEOF_I - - -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_TEST_DLL) -!DEC$attributes dllexport :: h5_sizeof_sp -!DEC$endif - INTEGER(C_SIZE_T) FUNCTION H5_SIZEOF_SP(a) - IMPLICIT NONE - REAL(sp), INTENT(in):: a - - H5_SIZEOF_SP = storage_size(a, c_size_t)/storage_size(c_char_'a',c_size_t) - - END FUNCTION H5_SIZEOF_SP - -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_TEST_DLL) -!DEC$attributes dllexport :: h5_sizeof_dp -!DEC$endif - INTEGER(C_SIZE_T) FUNCTION H5_SIZEOF_DP(a) - IMPLICIT NONE - REAL(dp), INTENT(in):: a - - H5_SIZEOF_DP = storage_size(a, c_size_t)/storage_size(c_char_'a',c_size_t) - - END FUNCTION H5_SIZEOF_DP - -END MODULE TH5_MISC_PROVISIONAL diff --git a/fortran/test/tf_F90.f90 b/fortran/test/tf_F90.f90 deleted file mode 100644 index 11a047c..0000000 --- a/fortran/test/tf_F90.f90 +++ /dev/null @@ -1,33 +0,0 @@ -!****h* root/fortran/test/tf_F90.f90 -! -! NAME -! tf_F90.f90 -! -! FUNCTION -! Module for when the compiler is not F2003 or F2008 compliant. -! Needed by tf.f90 for the test programs. -! -! 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. * -! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -! -!***** -MODULE TH5_MISC_PROVISIONAL - IMPLICIT NONE - - INTEGER, PARAMETER :: sp = KIND(0.0) - INTEGER, PARAMETER :: dp = KIND(0.D0) - -END MODULE TH5_MISC_PROVISIONAL diff --git a/fortran/testpar/Makefile.in b/fortran/testpar/Makefile.in index f16dfff..073194a 100644 --- a/fortran/testpar/Makefile.in +++ b/fortran/testpar/Makefile.in @@ -114,7 +114,8 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/aclocal_cxx.m4 \ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/bin/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/src/H5config.h +CONFIG_HEADER = $(top_builddir)/src/H5config.h \ + $(top_builddir)/fortran/src/H5config_f.inc CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__EXEEXT_1 = parallel_test$(EXEEXT) @@ -140,7 +141,7 @@ AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = -DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src -I$(top_builddir)/fortran/src FCCOMPILE = $(FC) $(AM_FCFLAGS) $(FCFLAGS) LTFCCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=FC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(FC) $(AM_FCFLAGS) $(FCFLAGS) @@ -448,14 +449,21 @@ F9XMODEXT = @F9XMODEXT@ F9XMODFLAG = @F9XMODFLAG@ F9XSUFFIXFLAG = @F9XSUFFIXFLAG@ FC = @FC@ -FC2003 = @FC2003@ FCFLAGS = @FCFLAGS@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ +FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ +FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ +FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ +H5CONFIG_F_IKIND = @H5CONFIG_F_IKIND@ +H5CONFIG_F_NUM_IKIND = @H5CONFIG_F_NUM_IKIND@ +H5CONFIG_F_NUM_RKIND = @H5CONFIG_F_NUM_RKIND@ +H5CONFIG_F_RKIND = @H5CONFIG_F_RKIND@ +H5CONFIG_F_RKIND_SIZEOF = @H5CONFIG_F_RKIND_SIZEOF@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ @@ -465,13 +473,12 @@ H5_LDFLAGS = @H5_LDFLAGS@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ -HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_Fortran_INTEGER_SIZEOF_16 = @HAVE_Fortran_INTEGER_SIZEOF_16@ HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ HDF_FORTRAN = @HDF_FORTRAN@ -HDF_FORTRAN2003 = @HDF_FORTRAN2003@ HID_T = @HID_T@ HL = @HL@ HL_FOR = @HL_FOR@ @@ -513,6 +520,18 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PAC_C_MAX_REAL_PRECISION = @PAC_C_MAX_REAL_PRECISION@ +PAC_FC_ALL_INTEGER_KINDS = @PAC_FC_ALL_INTEGER_KINDS@ +PAC_FC_ALL_INTEGER_KINDS_SIZEOF = @PAC_FC_ALL_INTEGER_KINDS_SIZEOF@ +PAC_FC_ALL_REAL_KINDS = @PAC_FC_ALL_REAL_KINDS@ +PAC_FC_ALL_REAL_KINDS_SIZEOF = @PAC_FC_ALL_REAL_KINDS_SIZEOF@ +PAC_FC_MAX_REAL_PRECISION = @PAC_FC_MAX_REAL_PRECISION@ +PAC_FORTRAN_NATIVE_DOUBLE_KIND = @PAC_FORTRAN_NATIVE_DOUBLE_KIND@ +PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF = @PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF@ +PAC_FORTRAN_NATIVE_INTEGER_KIND = @PAC_FORTRAN_NATIVE_INTEGER_KIND@ +PAC_FORTRAN_NATIVE_INTEGER_SIZEOF = @PAC_FORTRAN_NATIVE_INTEGER_SIZEOF@ +PAC_FORTRAN_NATIVE_REAL_KIND = @PAC_FORTRAN_NATIVE_REAL_KIND@ +PAC_FORTRAN_NATIVE_REAL_SIZEOF = @PAC_FORTRAN_NATIVE_REAL_SIZEOF@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ diff --git a/hl/Makefile.in b/hl/Makefile.in index 60c9453..b5fbb46 100644 --- a/hl/Makefile.in +++ b/hl/Makefile.in @@ -110,7 +110,8 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/aclocal_cxx.m4 \ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/bin/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/src/H5config.h +CONFIG_HEADER = $(top_builddir)/src/H5config.h \ + $(top_builddir)/fortran/src/H5config_f.inc CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) @@ -452,14 +453,21 @@ F9XMODEXT = @F9XMODEXT@ F9XMODFLAG = @F9XMODFLAG@ F9XSUFFIXFLAG = @F9XSUFFIXFLAG@ FC = @FC@ -FC2003 = @FC2003@ FCFLAGS = @FCFLAGS@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ +FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ +FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ +FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ +H5CONFIG_F_IKIND = @H5CONFIG_F_IKIND@ +H5CONFIG_F_NUM_IKIND = @H5CONFIG_F_NUM_IKIND@ +H5CONFIG_F_NUM_RKIND = @H5CONFIG_F_NUM_RKIND@ +H5CONFIG_F_RKIND = @H5CONFIG_F_RKIND@ +H5CONFIG_F_RKIND_SIZEOF = @H5CONFIG_F_RKIND_SIZEOF@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ @@ -469,13 +477,12 @@ H5_LDFLAGS = @H5_LDFLAGS@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ -HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_Fortran_INTEGER_SIZEOF_16 = @HAVE_Fortran_INTEGER_SIZEOF_16@ HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ HDF_FORTRAN = @HDF_FORTRAN@ -HDF_FORTRAN2003 = @HDF_FORTRAN2003@ HID_T = @HID_T@ HL = @HL@ HL_FOR = @HL_FOR@ @@ -517,6 +524,18 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PAC_C_MAX_REAL_PRECISION = @PAC_C_MAX_REAL_PRECISION@ +PAC_FC_ALL_INTEGER_KINDS = @PAC_FC_ALL_INTEGER_KINDS@ +PAC_FC_ALL_INTEGER_KINDS_SIZEOF = @PAC_FC_ALL_INTEGER_KINDS_SIZEOF@ +PAC_FC_ALL_REAL_KINDS = @PAC_FC_ALL_REAL_KINDS@ +PAC_FC_ALL_REAL_KINDS_SIZEOF = @PAC_FC_ALL_REAL_KINDS_SIZEOF@ +PAC_FC_MAX_REAL_PRECISION = @PAC_FC_MAX_REAL_PRECISION@ +PAC_FORTRAN_NATIVE_DOUBLE_KIND = @PAC_FORTRAN_NATIVE_DOUBLE_KIND@ +PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF = @PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF@ +PAC_FORTRAN_NATIVE_INTEGER_KIND = @PAC_FORTRAN_NATIVE_INTEGER_KIND@ +PAC_FORTRAN_NATIVE_INTEGER_SIZEOF = @PAC_FORTRAN_NATIVE_INTEGER_SIZEOF@ +PAC_FORTRAN_NATIVE_REAL_KIND = @PAC_FORTRAN_NATIVE_REAL_KIND@ +PAC_FORTRAN_NATIVE_REAL_SIZEOF = @PAC_FORTRAN_NATIVE_REAL_SIZEOF@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ diff --git a/hl/c++/Makefile.in b/hl/c++/Makefile.in index 278f97b..831dadc 100644 --- a/hl/c++/Makefile.in +++ b/hl/c++/Makefile.in @@ -106,7 +106,8 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/aclocal_cxx.m4 \ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/bin/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/src/H5config.h +CONFIG_HEADER = $(top_builddir)/src/H5config.h \ + $(top_builddir)/fortran/src/H5config_f.inc CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) @@ -448,14 +449,21 @@ F9XMODEXT = @F9XMODEXT@ F9XMODFLAG = @F9XMODFLAG@ F9XSUFFIXFLAG = @F9XSUFFIXFLAG@ FC = @FC@ -FC2003 = @FC2003@ FCFLAGS = @FCFLAGS@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ +FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ +FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ +FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ +H5CONFIG_F_IKIND = @H5CONFIG_F_IKIND@ +H5CONFIG_F_NUM_IKIND = @H5CONFIG_F_NUM_IKIND@ +H5CONFIG_F_NUM_RKIND = @H5CONFIG_F_NUM_RKIND@ +H5CONFIG_F_RKIND = @H5CONFIG_F_RKIND@ +H5CONFIG_F_RKIND_SIZEOF = @H5CONFIG_F_RKIND_SIZEOF@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ @@ -465,13 +473,12 @@ H5_LDFLAGS = @H5_LDFLAGS@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ -HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_Fortran_INTEGER_SIZEOF_16 = @HAVE_Fortran_INTEGER_SIZEOF_16@ HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ HDF_FORTRAN = @HDF_FORTRAN@ -HDF_FORTRAN2003 = @HDF_FORTRAN2003@ HID_T = @HID_T@ HL = @HL@ HL_FOR = @HL_FOR@ @@ -513,6 +520,18 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PAC_C_MAX_REAL_PRECISION = @PAC_C_MAX_REAL_PRECISION@ +PAC_FC_ALL_INTEGER_KINDS = @PAC_FC_ALL_INTEGER_KINDS@ +PAC_FC_ALL_INTEGER_KINDS_SIZEOF = @PAC_FC_ALL_INTEGER_KINDS_SIZEOF@ +PAC_FC_ALL_REAL_KINDS = @PAC_FC_ALL_REAL_KINDS@ +PAC_FC_ALL_REAL_KINDS_SIZEOF = @PAC_FC_ALL_REAL_KINDS_SIZEOF@ +PAC_FC_MAX_REAL_PRECISION = @PAC_FC_MAX_REAL_PRECISION@ +PAC_FORTRAN_NATIVE_DOUBLE_KIND = @PAC_FORTRAN_NATIVE_DOUBLE_KIND@ +PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF = @PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF@ +PAC_FORTRAN_NATIVE_INTEGER_KIND = @PAC_FORTRAN_NATIVE_INTEGER_KIND@ +PAC_FORTRAN_NATIVE_INTEGER_SIZEOF = @PAC_FORTRAN_NATIVE_INTEGER_SIZEOF@ +PAC_FORTRAN_NATIVE_REAL_KIND = @PAC_FORTRAN_NATIVE_REAL_KIND@ +PAC_FORTRAN_NATIVE_REAL_SIZEOF = @PAC_FORTRAN_NATIVE_REAL_SIZEOF@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ diff --git a/hl/c++/examples/Makefile.in b/hl/c++/examples/Makefile.in index 5bad31f..67a14ca 100644 --- a/hl/c++/examples/Makefile.in +++ b/hl/c++/examples/Makefile.in @@ -111,7 +111,8 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/aclocal_cxx.m4 \ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/bin/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/src/H5config.h +CONFIG_HEADER = $(top_builddir)/src/H5config.h \ + $(top_builddir)/fortran/src/H5config_f.inc CONFIG_CLEAN_FILES = run-hlc++-ex.sh CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) @@ -395,14 +396,21 @@ F9XMODEXT = @F9XMODEXT@ F9XMODFLAG = @F9XMODFLAG@ F9XSUFFIXFLAG = @F9XSUFFIXFLAG@ FC = @FC@ -FC2003 = @FC2003@ FCFLAGS = @FCFLAGS@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ +FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ +FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ +FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ +H5CONFIG_F_IKIND = @H5CONFIG_F_IKIND@ +H5CONFIG_F_NUM_IKIND = @H5CONFIG_F_NUM_IKIND@ +H5CONFIG_F_NUM_RKIND = @H5CONFIG_F_NUM_RKIND@ +H5CONFIG_F_RKIND = @H5CONFIG_F_RKIND@ +H5CONFIG_F_RKIND_SIZEOF = @H5CONFIG_F_RKIND_SIZEOF@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ @@ -412,13 +420,12 @@ H5_LDFLAGS = @H5_LDFLAGS@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ -HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_Fortran_INTEGER_SIZEOF_16 = @HAVE_Fortran_INTEGER_SIZEOF_16@ HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ HDF_FORTRAN = @HDF_FORTRAN@ -HDF_FORTRAN2003 = @HDF_FORTRAN2003@ HID_T = @HID_T@ HL = @HL@ HL_FOR = @HL_FOR@ @@ -460,6 +467,18 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PAC_C_MAX_REAL_PRECISION = @PAC_C_MAX_REAL_PRECISION@ +PAC_FC_ALL_INTEGER_KINDS = @PAC_FC_ALL_INTEGER_KINDS@ +PAC_FC_ALL_INTEGER_KINDS_SIZEOF = @PAC_FC_ALL_INTEGER_KINDS_SIZEOF@ +PAC_FC_ALL_REAL_KINDS = @PAC_FC_ALL_REAL_KINDS@ +PAC_FC_ALL_REAL_KINDS_SIZEOF = @PAC_FC_ALL_REAL_KINDS_SIZEOF@ +PAC_FC_MAX_REAL_PRECISION = @PAC_FC_MAX_REAL_PRECISION@ +PAC_FORTRAN_NATIVE_DOUBLE_KIND = @PAC_FORTRAN_NATIVE_DOUBLE_KIND@ +PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF = @PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF@ +PAC_FORTRAN_NATIVE_INTEGER_KIND = @PAC_FORTRAN_NATIVE_INTEGER_KIND@ +PAC_FORTRAN_NATIVE_INTEGER_SIZEOF = @PAC_FORTRAN_NATIVE_INTEGER_SIZEOF@ +PAC_FORTRAN_NATIVE_REAL_KIND = @PAC_FORTRAN_NATIVE_REAL_KIND@ +PAC_FORTRAN_NATIVE_REAL_SIZEOF = @PAC_FORTRAN_NATIVE_REAL_SIZEOF@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ diff --git a/hl/c++/src/Makefile.in b/hl/c++/src/Makefile.in index 742b35c..043a25a 100644 --- a/hl/c++/src/Makefile.in +++ b/hl/c++/src/Makefile.in @@ -110,7 +110,8 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/aclocal_cxx.m4 \ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/bin/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/src/H5config.h +CONFIG_HEADER = $(top_builddir)/src/H5config.h \ + $(top_builddir)/fortran/src/H5config_f.inc CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; @@ -165,7 +166,7 @@ AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = -DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src -I$(top_builddir)/fortran/src depcomp = $(SHELL) $(top_srcdir)/bin/depcomp am__depfiles_maybe = depfiles am__mv = mv -f @@ -451,14 +452,21 @@ F9XMODEXT = @F9XMODEXT@ F9XMODFLAG = @F9XMODFLAG@ F9XSUFFIXFLAG = @F9XSUFFIXFLAG@ FC = @FC@ -FC2003 = @FC2003@ FCFLAGS = @FCFLAGS@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ +FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ +FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ +FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ +H5CONFIG_F_IKIND = @H5CONFIG_F_IKIND@ +H5CONFIG_F_NUM_IKIND = @H5CONFIG_F_NUM_IKIND@ +H5CONFIG_F_NUM_RKIND = @H5CONFIG_F_NUM_RKIND@ +H5CONFIG_F_RKIND = @H5CONFIG_F_RKIND@ +H5CONFIG_F_RKIND_SIZEOF = @H5CONFIG_F_RKIND_SIZEOF@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ @@ -468,13 +476,12 @@ H5_LDFLAGS = @H5_LDFLAGS@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ -HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_Fortran_INTEGER_SIZEOF_16 = @HAVE_Fortran_INTEGER_SIZEOF_16@ HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ HDF_FORTRAN = @HDF_FORTRAN@ -HDF_FORTRAN2003 = @HDF_FORTRAN2003@ HID_T = @HID_T@ HL = @HL@ HL_FOR = @HL_FOR@ @@ -516,6 +523,18 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PAC_C_MAX_REAL_PRECISION = @PAC_C_MAX_REAL_PRECISION@ +PAC_FC_ALL_INTEGER_KINDS = @PAC_FC_ALL_INTEGER_KINDS@ +PAC_FC_ALL_INTEGER_KINDS_SIZEOF = @PAC_FC_ALL_INTEGER_KINDS_SIZEOF@ +PAC_FC_ALL_REAL_KINDS = @PAC_FC_ALL_REAL_KINDS@ +PAC_FC_ALL_REAL_KINDS_SIZEOF = @PAC_FC_ALL_REAL_KINDS_SIZEOF@ +PAC_FC_MAX_REAL_PRECISION = @PAC_FC_MAX_REAL_PRECISION@ +PAC_FORTRAN_NATIVE_DOUBLE_KIND = @PAC_FORTRAN_NATIVE_DOUBLE_KIND@ +PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF = @PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF@ +PAC_FORTRAN_NATIVE_INTEGER_KIND = @PAC_FORTRAN_NATIVE_INTEGER_KIND@ +PAC_FORTRAN_NATIVE_INTEGER_SIZEOF = @PAC_FORTRAN_NATIVE_INTEGER_SIZEOF@ +PAC_FORTRAN_NATIVE_REAL_KIND = @PAC_FORTRAN_NATIVE_REAL_KIND@ +PAC_FORTRAN_NATIVE_REAL_SIZEOF = @PAC_FORTRAN_NATIVE_REAL_SIZEOF@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ diff --git a/hl/c++/test/Makefile.in b/hl/c++/test/Makefile.in index b7d7d09..4f88242 100644 --- a/hl/c++/test/Makefile.in +++ b/hl/c++/test/Makefile.in @@ -107,7 +107,8 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/aclocal_cxx.m4 \ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/bin/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/src/H5config.h +CONFIG_HEADER = $(top_builddir)/src/H5config.h \ + $(top_builddir)/fortran/src/H5config_f.inc CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__EXEEXT_1 = ptableTest$(EXEEXT) @@ -132,7 +133,7 @@ AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = -DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src -I$(top_builddir)/fortran/src depcomp = $(SHELL) $(top_srcdir)/bin/depcomp am__depfiles_maybe = depfiles am__mv = mv -f @@ -448,14 +449,21 @@ F9XMODEXT = @F9XMODEXT@ F9XMODFLAG = @F9XMODFLAG@ F9XSUFFIXFLAG = @F9XSUFFIXFLAG@ FC = @FC@ -FC2003 = @FC2003@ FCFLAGS = @FCFLAGS@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ +FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ +FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ +FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ +H5CONFIG_F_IKIND = @H5CONFIG_F_IKIND@ +H5CONFIG_F_NUM_IKIND = @H5CONFIG_F_NUM_IKIND@ +H5CONFIG_F_NUM_RKIND = @H5CONFIG_F_NUM_RKIND@ +H5CONFIG_F_RKIND = @H5CONFIG_F_RKIND@ +H5CONFIG_F_RKIND_SIZEOF = @H5CONFIG_F_RKIND_SIZEOF@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ @@ -465,13 +473,12 @@ H5_LDFLAGS = @H5_LDFLAGS@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ -HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_Fortran_INTEGER_SIZEOF_16 = @HAVE_Fortran_INTEGER_SIZEOF_16@ HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ HDF_FORTRAN = @HDF_FORTRAN@ -HDF_FORTRAN2003 = @HDF_FORTRAN2003@ HID_T = @HID_T@ HL = @HL@ HL_FOR = @HL_FOR@ @@ -513,6 +520,18 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PAC_C_MAX_REAL_PRECISION = @PAC_C_MAX_REAL_PRECISION@ +PAC_FC_ALL_INTEGER_KINDS = @PAC_FC_ALL_INTEGER_KINDS@ +PAC_FC_ALL_INTEGER_KINDS_SIZEOF = @PAC_FC_ALL_INTEGER_KINDS_SIZEOF@ +PAC_FC_ALL_REAL_KINDS = @PAC_FC_ALL_REAL_KINDS@ +PAC_FC_ALL_REAL_KINDS_SIZEOF = @PAC_FC_ALL_REAL_KINDS_SIZEOF@ +PAC_FC_MAX_REAL_PRECISION = @PAC_FC_MAX_REAL_PRECISION@ +PAC_FORTRAN_NATIVE_DOUBLE_KIND = @PAC_FORTRAN_NATIVE_DOUBLE_KIND@ +PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF = @PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF@ +PAC_FORTRAN_NATIVE_INTEGER_KIND = @PAC_FORTRAN_NATIVE_INTEGER_KIND@ +PAC_FORTRAN_NATIVE_INTEGER_SIZEOF = @PAC_FORTRAN_NATIVE_INTEGER_SIZEOF@ +PAC_FORTRAN_NATIVE_REAL_KIND = @PAC_FORTRAN_NATIVE_REAL_KIND@ +PAC_FORTRAN_NATIVE_REAL_SIZEOF = @PAC_FORTRAN_NATIVE_REAL_SIZEOF@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ diff --git a/hl/examples/Makefile.in b/hl/examples/Makefile.in index f0bf099..ccf2308 100644 --- a/hl/examples/Makefile.in +++ b/hl/examples/Makefile.in @@ -111,7 +111,8 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/aclocal_cxx.m4 \ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/bin/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/src/H5config.h +CONFIG_HEADER = $(top_builddir)/src/H5config.h \ + $(top_builddir)/fortran/src/H5config_f.inc CONFIG_CLEAN_FILES = run-hlc-ex.sh CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) @@ -395,14 +396,21 @@ F9XMODEXT = @F9XMODEXT@ F9XMODFLAG = @F9XMODFLAG@ F9XSUFFIXFLAG = @F9XSUFFIXFLAG@ FC = @FC@ -FC2003 = @FC2003@ FCFLAGS = @FCFLAGS@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ +FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ +FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ +FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ +H5CONFIG_F_IKIND = @H5CONFIG_F_IKIND@ +H5CONFIG_F_NUM_IKIND = @H5CONFIG_F_NUM_IKIND@ +H5CONFIG_F_NUM_RKIND = @H5CONFIG_F_NUM_RKIND@ +H5CONFIG_F_RKIND = @H5CONFIG_F_RKIND@ +H5CONFIG_F_RKIND_SIZEOF = @H5CONFIG_F_RKIND_SIZEOF@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ @@ -412,13 +420,12 @@ H5_LDFLAGS = @H5_LDFLAGS@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ -HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_Fortran_INTEGER_SIZEOF_16 = @HAVE_Fortran_INTEGER_SIZEOF_16@ HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ HDF_FORTRAN = @HDF_FORTRAN@ -HDF_FORTRAN2003 = @HDF_FORTRAN2003@ HID_T = @HID_T@ HL = @HL@ HL_FOR = @HL_FOR@ @@ -460,6 +467,18 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PAC_C_MAX_REAL_PRECISION = @PAC_C_MAX_REAL_PRECISION@ +PAC_FC_ALL_INTEGER_KINDS = @PAC_FC_ALL_INTEGER_KINDS@ +PAC_FC_ALL_INTEGER_KINDS_SIZEOF = @PAC_FC_ALL_INTEGER_KINDS_SIZEOF@ +PAC_FC_ALL_REAL_KINDS = @PAC_FC_ALL_REAL_KINDS@ +PAC_FC_ALL_REAL_KINDS_SIZEOF = @PAC_FC_ALL_REAL_KINDS_SIZEOF@ +PAC_FC_MAX_REAL_PRECISION = @PAC_FC_MAX_REAL_PRECISION@ +PAC_FORTRAN_NATIVE_DOUBLE_KIND = @PAC_FORTRAN_NATIVE_DOUBLE_KIND@ +PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF = @PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF@ +PAC_FORTRAN_NATIVE_INTEGER_KIND = @PAC_FORTRAN_NATIVE_INTEGER_KIND@ +PAC_FORTRAN_NATIVE_INTEGER_SIZEOF = @PAC_FORTRAN_NATIVE_INTEGER_SIZEOF@ +PAC_FORTRAN_NATIVE_REAL_KIND = @PAC_FORTRAN_NATIVE_REAL_KIND@ +PAC_FORTRAN_NATIVE_REAL_SIZEOF = @PAC_FORTRAN_NATIVE_REAL_SIZEOF@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ diff --git a/hl/fortran/Makefile.in b/hl/fortran/Makefile.in index 4651579..6d87e82 100644 --- a/hl/fortran/Makefile.in +++ b/hl/fortran/Makefile.in @@ -110,7 +110,8 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/aclocal_cxx.m4 \ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/bin/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/src/H5config.h +CONFIG_HEADER = $(top_builddir)/src/H5config.h \ + $(top_builddir)/fortran/src/H5config_f.inc CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) @@ -452,14 +453,21 @@ F9XMODEXT = @F9XMODEXT@ F9XMODFLAG = @F9XMODFLAG@ F9XSUFFIXFLAG = @F9XSUFFIXFLAG@ FC = @FC@ -FC2003 = @FC2003@ FCFLAGS = @FCFLAGS@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ +FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ +FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ +FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ +H5CONFIG_F_IKIND = @H5CONFIG_F_IKIND@ +H5CONFIG_F_NUM_IKIND = @H5CONFIG_F_NUM_IKIND@ +H5CONFIG_F_NUM_RKIND = @H5CONFIG_F_NUM_RKIND@ +H5CONFIG_F_RKIND = @H5CONFIG_F_RKIND@ +H5CONFIG_F_RKIND_SIZEOF = @H5CONFIG_F_RKIND_SIZEOF@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ @@ -469,13 +477,12 @@ H5_LDFLAGS = @H5_LDFLAGS@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ -HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_Fortran_INTEGER_SIZEOF_16 = @HAVE_Fortran_INTEGER_SIZEOF_16@ HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ HDF_FORTRAN = @HDF_FORTRAN@ -HDF_FORTRAN2003 = @HDF_FORTRAN2003@ HID_T = @HID_T@ HL = @HL@ HL_FOR = @HL_FOR@ @@ -517,6 +524,18 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PAC_C_MAX_REAL_PRECISION = @PAC_C_MAX_REAL_PRECISION@ +PAC_FC_ALL_INTEGER_KINDS = @PAC_FC_ALL_INTEGER_KINDS@ +PAC_FC_ALL_INTEGER_KINDS_SIZEOF = @PAC_FC_ALL_INTEGER_KINDS_SIZEOF@ +PAC_FC_ALL_REAL_KINDS = @PAC_FC_ALL_REAL_KINDS@ +PAC_FC_ALL_REAL_KINDS_SIZEOF = @PAC_FC_ALL_REAL_KINDS_SIZEOF@ +PAC_FC_MAX_REAL_PRECISION = @PAC_FC_MAX_REAL_PRECISION@ +PAC_FORTRAN_NATIVE_DOUBLE_KIND = @PAC_FORTRAN_NATIVE_DOUBLE_KIND@ +PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF = @PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF@ +PAC_FORTRAN_NATIVE_INTEGER_KIND = @PAC_FORTRAN_NATIVE_INTEGER_KIND@ +PAC_FORTRAN_NATIVE_INTEGER_SIZEOF = @PAC_FORTRAN_NATIVE_INTEGER_SIZEOF@ +PAC_FORTRAN_NATIVE_REAL_KIND = @PAC_FORTRAN_NATIVE_REAL_KIND@ +PAC_FORTRAN_NATIVE_REAL_SIZEOF = @PAC_FORTRAN_NATIVE_REAL_SIZEOF@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ diff --git a/hl/fortran/examples/Makefile.in b/hl/fortran/examples/Makefile.in index e229f12..71e70dd 100644 --- a/hl/fortran/examples/Makefile.in +++ b/hl/fortran/examples/Makefile.in @@ -111,7 +111,8 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/aclocal_cxx.m4 \ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/bin/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/src/H5config.h +CONFIG_HEADER = $(top_builddir)/src/H5config.h \ + $(top_builddir)/fortran/src/H5config_f.inc CONFIG_CLEAN_FILES = run-hlfortran-ex.sh CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) @@ -395,14 +396,21 @@ F9XMODEXT = @F9XMODEXT@ F9XMODFLAG = @F9XMODFLAG@ F9XSUFFIXFLAG = @F9XSUFFIXFLAG@ FC = @FC@ -FC2003 = @FC2003@ FCFLAGS = @FCFLAGS@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ +FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ +FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ +FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ +H5CONFIG_F_IKIND = @H5CONFIG_F_IKIND@ +H5CONFIG_F_NUM_IKIND = @H5CONFIG_F_NUM_IKIND@ +H5CONFIG_F_NUM_RKIND = @H5CONFIG_F_NUM_RKIND@ +H5CONFIG_F_RKIND = @H5CONFIG_F_RKIND@ +H5CONFIG_F_RKIND_SIZEOF = @H5CONFIG_F_RKIND_SIZEOF@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ @@ -412,13 +420,12 @@ H5_LDFLAGS = @H5_LDFLAGS@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ -HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_Fortran_INTEGER_SIZEOF_16 = @HAVE_Fortran_INTEGER_SIZEOF_16@ HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ HDF_FORTRAN = @HDF_FORTRAN@ -HDF_FORTRAN2003 = @HDF_FORTRAN2003@ HID_T = @HID_T@ HL = @HL@ HL_FOR = @HL_FOR@ @@ -460,6 +467,18 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PAC_C_MAX_REAL_PRECISION = @PAC_C_MAX_REAL_PRECISION@ +PAC_FC_ALL_INTEGER_KINDS = @PAC_FC_ALL_INTEGER_KINDS@ +PAC_FC_ALL_INTEGER_KINDS_SIZEOF = @PAC_FC_ALL_INTEGER_KINDS_SIZEOF@ +PAC_FC_ALL_REAL_KINDS = @PAC_FC_ALL_REAL_KINDS@ +PAC_FC_ALL_REAL_KINDS_SIZEOF = @PAC_FC_ALL_REAL_KINDS_SIZEOF@ +PAC_FC_MAX_REAL_PRECISION = @PAC_FC_MAX_REAL_PRECISION@ +PAC_FORTRAN_NATIVE_DOUBLE_KIND = @PAC_FORTRAN_NATIVE_DOUBLE_KIND@ +PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF = @PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF@ +PAC_FORTRAN_NATIVE_INTEGER_KIND = @PAC_FORTRAN_NATIVE_INTEGER_KIND@ +PAC_FORTRAN_NATIVE_INTEGER_SIZEOF = @PAC_FORTRAN_NATIVE_INTEGER_SIZEOF@ +PAC_FORTRAN_NATIVE_REAL_KIND = @PAC_FORTRAN_NATIVE_REAL_KIND@ +PAC_FORTRAN_NATIVE_REAL_SIZEOF = @PAC_FORTRAN_NATIVE_REAL_SIZEOF@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ diff --git a/hl/fortran/src/CMakeLists.txt b/hl/fortran/src/CMakeLists.txt index 2af665c..9d110a8 100644 --- a/hl/fortran/src/CMakeLists.txt +++ b/hl/fortran/src/CMakeLists.txt @@ -2,6 +2,41 @@ cmake_minimum_required (VERSION 3.1.0) PROJECT(HDF5_HL_F90_SRC C CXX Fortran) #----------------------------------------------------------------------------- +# configure def file for shared libs on windows +if (WIN32) + if (BUILD_SHARED_LIBS) + if (MSVC) + configure_file (${HDF5_HL_F90_SRC_SOURCE_DIR}/hdf5_hl_fortrandll.def.in ${HDF5_HL_F90_SRC_BINARY_DIR}/hdf5_hl_fortrandll.def @ONLY) + endif (MSVC) + endif (BUILD_SHARED_LIBS) +endif (WIN32) + +#----------------------------------------------------------------------------- +# Generate the H5LT and H5TB REAL APIs +#----------------------------------------------------------------------------- + +add_executable (H5HL_buildiface + ${HDF5_HL_F90_SRC_SOURCE_DIR}/H5HL_buildiface.F90 + ) + +if (WIN32 AND MSVC) + if (BUILD_SHARED_LIBS) + set_target_properties (H5HL_buildiface + PROPERTIES + COMPILE_FLAGS "/MT" + ) + endif (BUILD_SHARED_LIBS) + set_target_properties (H5HL_buildiface + PROPERTIES + LINK_FLAGS "/SUBSYSTEM:CONSOLE" + ) +endif (WIN32 AND MSVC) +set_target_properties (H5HL_buildiface PROPERTIES + LINKER_LANGUAGE Fortran + Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY} +) + +#----------------------------------------------------------------------------- # Setup include Directories #----------------------------------------------------------------------------- INCLUDE_DIRECTORIES ( @@ -56,14 +91,37 @@ endif (BUILD_SHARED_LIBS) #----------------------------------------------------------------------------- # Fortran Modules #----------------------------------------------------------------------------- +set (HDF5_HL_F90_F_BASE_SRCS + ${HDF5_HL_F90_SRC_SOURCE_DIR}/H5DSff.F90 + ${HDF5_HL_F90_SRC_SOURCE_DIR}/H5TBff.F90 + ${HDF5_HL_F90_SRC_SOURCE_DIR}/H5LTff.F90 + ${HDF5_HL_F90_SRC_SOURCE_DIR}/H5IMff.F90 +) set (HDF5_HL_F90_F_SRCS - ${HDF5_HL_F90_SRC_SOURCE_DIR}/H5DSff.f90 - ${HDF5_HL_F90_SRC_SOURCE_DIR}/H5TBff.f90 - ${HDF5_HL_F90_SRC_SOURCE_DIR}/H5LTff.f90 - ${HDF5_HL_F90_SRC_SOURCE_DIR}/H5IMff.f90 + ${HDF5_HL_F90_F_BASE_SRCS} + + # generated files + ${HDF5_HL_F90_SRC_BINARY_DIR}/H5LTff_gen.F90 + ${HDF5_HL_F90_SRC_BINARY_DIR}/H5TBff_gen.F90 ) + set_source_files_properties (${HDF5_HL_F90_F_SRCS} PROPERTIES LANGUAGE Fortran) +set_source_files_properties ( + ${HDF5_HL_F90_SRC_BINARY_DIR}/H5LTff_gen.F90 + ${HDF5_HL_F90_SRC_BINARY_DIR}/H5TBff_gen.F90 + PROPERTIES GENERATED TRUE +) + +set (CMD $) +add_custom_target (H5HLgen ALL + COMMAND ${CMD} +#v3.2 BYPRODUCT ${HDF5_HL_F90_SRC_BINARY_DIR}/H5LTff_gen.F90 +#v3.2 ${HDF5_HL_F90_SRC_BINARY_DIR}/H5TBff_gen.F90 + WORKING_DIRECTORY ${HDF5_HL_F90_SRC_BINARY_DIR} + DEPENDS ${HDF5_HL_F90_F_BASE_SRCS} +) + add_library (${HDF5_HL_F90_LIB_TARGET} STATIC ${HDF5_HL_F90_F_SRCS}) TARGET_FORTRAN_PROPERTIES (${HDF5_HL_F90_LIB_TARGET} STATIC " " " ") target_link_libraries (${HDF5_HL_F90_LIB_TARGET} ${HDF5_HL_F90_C_LIB_TARGET} ${HDF5_F90_LIB_TARGET}) @@ -86,7 +144,7 @@ if (BUILD_SHARED_LIBS) add_library (${HDF5_HL_F90_LIBSH_TARGET} SHARED ${HDF5_HL_F90_F_SRCS}) set (SHARED_LINK_FLAGS " ") if (WIN32 AND MSVC) - set (SHARED_LINK_FLAGS "/DLL") + set (SHARED_LINK_FLAGS "/DLL /DEF:${HDF5_HL_F90_SRC_BINARY_DIR}/hdf5_hl_fortrandll.def") endif (WIN32 AND MSVC) TARGET_FORTRAN_PROPERTIES (${HDF5_HL_F90_LIBSH_TARGET} SHARED " " ${SHARED_LINK_FLAGS}) target_link_libraries (${HDF5_HL_F90_LIBSH_TARGET} ${HDF5_HL_F90_C_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET}) @@ -128,7 +186,9 @@ endif (BUILD_SHARED_LIBS) set (mod_files ${MOD_BUILD_DIR}/h5ds.mod ${MOD_BUILD_DIR}/h5tb.mod + ${MOD_BUILD_DIR}/h5tb_const.mod ${MOD_BUILD_DIR}/h5lt.mod + ${MOD_BUILD_DIR}/h5lt_const.mod ${MOD_BUILD_DIR}/h5im.mod ) @@ -149,7 +209,7 @@ if (HDF5_EXPORTED_TARGETS) INSTALL_TARGET_PDB (${HDF5_HL_F90_C_LIBSH_TARGET} ${HDF5_INSTALL_BIN_DIR} hlfortlibraries) #INSTALL_TARGET_PDB (${HDF5_HL_F90_LIBSH_TARGET} ${HDF5_INSTALL_BIN_DIR} hlfortlibraries) endif (BUILD_SHARED_LIBS) - + install ( TARGETS ${install_targets} diff --git a/hl/fortran/src/H5DSfc.c b/hl/fortran/src/H5DSfc.c index 1de3fff..af054e0 100644 --- a/hl/fortran/src/H5DSfc.c +++ b/hl/fortran/src/H5DSfc.c @@ -35,7 +35,7 @@ *------------------------------------------------------------------------- */ int_f -nh5dsset_scale_c(hid_t_f *dsid, _fcd dimname, size_t_f *dimnamelen) +h5dsset_scale_c(hid_t_f *dsid, _fcd dimname, size_t_f *dimnamelen) { char *c_dimname = NULL; int_f ret_value = 0; @@ -61,7 +61,7 @@ nh5dsset_scale_c(hid_t_f *dsid, _fcd dimname, size_t_f *dimnamelen) return ret_value; -} /* end nh5dsset_scale_c() */ +} /* end h5dsset_scale_c() */ /*------------------------------------------------------------------------- @@ -80,7 +80,7 @@ nh5dsset_scale_c(hid_t_f *dsid, _fcd dimname, size_t_f *dimnamelen) *------------------------------------------------------------------------- */ int_f -nh5dsattach_scale_c( hid_t_f *did, hid_t_f *dsid, int_f *idx) +h5dsattach_scale_c( hid_t_f *did, hid_t_f *dsid, int_f *idx) { int_f ret_value = 0; @@ -94,7 +94,7 @@ nh5dsattach_scale_c( hid_t_f *did, hid_t_f *dsid, int_f *idx) done: return ret_value; -} /* end nh5dsattach_scale_c() */ +} /* end h5dsattach_scale_c() */ /*------------------------------------------------------------------------- @@ -113,7 +113,7 @@ nh5dsattach_scale_c( hid_t_f *did, hid_t_f *dsid, int_f *idx) *------------------------------------------------------------------------- */ int_f -nh5dsdetach_scale_c( hid_t_f *did, hid_t_f *dsid, int_f *idx) +h5dsdetach_scale_c( hid_t_f *did, hid_t_f *dsid, int_f *idx) { int_f ret_value = 0; @@ -127,7 +127,7 @@ nh5dsdetach_scale_c( hid_t_f *did, hid_t_f *dsid, int_f *idx) done: return ret_value; -} /* end nh5dsdetach_scale_c() */ +} /* end h5dsdetach_scale_c() */ /*------------------------------------------------------------------------- @@ -146,7 +146,7 @@ nh5dsdetach_scale_c( hid_t_f *did, hid_t_f *dsid, int_f *idx) *------------------------------------------------------------------------- */ int_f -nh5dsis_attached_c( hid_t_f *did, hid_t_f *dsid, int_f *idx, int_f *is_attached) +h5dsis_attached_c( hid_t_f *did, hid_t_f *dsid, int_f *idx, int_f *is_attached) { int_f ret_value = 0; htri_t c_is_attached; @@ -163,7 +163,7 @@ nh5dsis_attached_c( hid_t_f *did, hid_t_f *dsid, int_f *idx, int_f *is_attached) done: return ret_value; -} /* end nh5dsis_attached_c() */ +} /* end h5dsis_attached_c() */ /*------------------------------------------------------------------------- * Function: H5DSis_scale_c @@ -181,7 +181,7 @@ nh5dsis_attached_c( hid_t_f *did, hid_t_f *dsid, int_f *idx, int_f *is_attached) *------------------------------------------------------------------------- */ int_f -nh5dsis_scale_c( hid_t_f *did, int_f *is_scale) +h5dsis_scale_c( hid_t_f *did, int_f *is_scale) { int_f ret_value = 0; htri_t c_is_scale; @@ -198,7 +198,7 @@ nh5dsis_scale_c( hid_t_f *did, int_f *is_scale) done: return ret_value; -} /* end nh5dsis_scale_c() */ +} /* end h5dsis_scale_c() */ /*------------------------------------------------------------------------- @@ -217,7 +217,7 @@ nh5dsis_scale_c( hid_t_f *did, int_f *is_scale) *------------------------------------------------------------------------- */ int_f -nh5dsset_label_c(hid_t_f *did, int_f *idx, _fcd label, size_t_f *labellen) +h5dsset_label_c(hid_t_f *did, int_f *idx, _fcd label, size_t_f *labellen) { char *c_label = NULL; int_f ret_value = 0; @@ -242,7 +242,7 @@ nh5dsset_label_c(hid_t_f *did, int_f *idx, _fcd label, size_t_f *labellen) return ret_value; -} /* end nh5dsset_label_c() */ +} /* end h5dsset_label_c() */ /*------------------------------------------------------------------------- * Function: h5dsget_label_c @@ -260,7 +260,7 @@ nh5dsset_label_c(hid_t_f *did, int_f *idx, _fcd label, size_t_f *labellen) *------------------------------------------------------------------------- */ int_f -nh5dsget_label_c(hid_t_f *did, int_f *idx, _fcd label, size_t_f *size) +h5dsget_label_c(hid_t_f *did, int_f *idx, _fcd label, size_t_f *size) { char *c_label = NULL; ssize_t size_c = -1; @@ -291,7 +291,7 @@ done: if(c_label) HDfree(c_label); return ret_value; -} /* end nh5dsget_label_c() */ +} /* end h5dsget_label_c() */ /*------------------------------------------------------------------------- * Function: h5dsget_scale_name_c @@ -309,7 +309,7 @@ done: *------------------------------------------------------------------------- */ int_f -nh5dsget_scale_name_c(hid_t_f *did, _fcd name, size_t_f *size) +h5dsget_scale_name_c(hid_t_f *did, _fcd name, size_t_f *size) { char *c_scale_name = NULL; ssize_t size_c = -1; @@ -338,7 +338,7 @@ done: if(c_scale_name) HDfree(c_scale_name); return ret_value; -} /* end nh5dsget_scale_name_c() */ +} /* end h5dsget_scale_name_c() */ /*------------------------------------------------------------------------- * Function: H5DSget_num_scales_c @@ -356,7 +356,7 @@ done: *------------------------------------------------------------------------- */ int_f -nh5dsget_num_scales_c( hid_t_f *did, int_f *idx, int_f *num_scales) +h5dsget_num_scales_c( hid_t_f *did, int_f *idx, int_f *num_scales) { int_f ret_value = 0; @@ -370,4 +370,4 @@ nh5dsget_num_scales_c( hid_t_f *did, int_f *idx, int_f *num_scales) done: return ret_value; -} /* end nh5dsget_num_scales_c() */ +} /* end h5dsget_num_scales_c() */ diff --git a/hl/fortran/src/H5DSff.F90 b/hl/fortran/src/H5DSff.F90 new file mode 100644 index 0000000..00cf4d8 --- /dev/null +++ b/hl/fortran/src/H5DSff.F90 @@ -0,0 +1,518 @@ +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! 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. * +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! +! +! This file contains FORTRAN90 interfaces for H5DS functions +! + +MODULE h5ds + + USE, INTRINSIC :: ISO_C_BINDING, ONLY : C_PTR, C_CHAR, C_FLOAT, C_DOUBLE, C_LOC, C_CHAR + USE h5fortran_types + USE hdf5 + +CONTAINS + +!------------------------------------------------------------------------- +! Function: H5DSset_scale_f +! +! Purpose: Convert dataset dsid to a dimension scale, with optional name, dimname. +! +! Return: Success: 0, Failure: -1 +! +! Programmer: M. Scot Breitenfeld +! +! Date: April 17, 2011 +! +! Comments: +! +! Modifications: +! +!------------------------------------------------------------------------- + + SUBROUTINE H5DSset_scale_f( dsid, errcode, dimname) + + IMPLICIT NONE + +! +!This definition is needed for Windows DLLs +!DEC$if defined(BUILD_HDF5_HL_DLL) +!DEC$attributes dllexport :: h5dsset_scale_f +!DEC$endif +! + + INTEGER(hid_t), INTENT(in) :: dsid ! The dataset to be made a Dimension Scale + CHARACTER(LEN=*), INTENT(in), OPTIONAL :: dimname ! The dimension name + INTEGER :: errcode ! Error code + + INTEGER(SIZE_T) :: dimname_len ! length of dimname (if present) + + INTERFACE + INTEGER FUNCTION H5DSset_scale_c(dsid, dimname, dimname_len) & + BIND(C,NAME='h5dsset_scale_c') + IMPORT :: C_CHAR + IMPORT :: HID_T, SIZE_T + IMPLICIT NONE + INTEGER(hid_t), INTENT(in) :: dsid ! The dataset to be made a Dimension Scale + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: dimname ! The dimension name + INTEGER(SIZE_T), INTENT(in) :: dimname_len + END FUNCTION H5DSset_scale_c + END INTERFACE + + IF(PRESENT(dimname))THEN + dimname_len = LEN(dimname) + errcode = H5DSset_scale_c(dsid, dimname, dimname_len ) + ELSE + errcode = H5DSset_scale_c(dsid, " ", INT(0,SIZE_T) ) + ENDIF + + END SUBROUTINE H5DSset_scale_f + +!------------------------------------------------------------------------- +! Function: H5DSattach_scale_f +! +! Purpose: Attach dimension scale dsid to dimension idx of dataset did. +! +! Return: Success: 0, Failure: -1 +! +! Programmer: M. Scot Breitenfeld +! +! Date: April 17, 2011 +! +! Comments: +! +! Modifications: +! +!------------------------------------------------------------------------- + + SUBROUTINE H5DSattach_scale_f( did, dsid, idx, errcode) + + IMPLICIT NONE + +! +!This definition is needed for Windows DLLs +!DEC$if defined(BUILD_HDF5_HL_DLL) +!DEC$attributes dllexport :: h5dsattach_scale_f +!DEC$endif +! + INTEGER(hid_t), INTENT(in) :: did ! the dataset + INTEGER(hid_t), INTENT(in) :: dsid ! the scale to be attached + INTEGER , INTENT(in) :: idx ! the dimension of did that dsid is associated with. + INTEGER :: errcode ! error code + INTEGER :: c_idx + + INTERFACE + INTEGER FUNCTION H5DSattach_scale_c(did, dsid, idx) & + BIND(C,NAME='h5dsattach_scale_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(hid_t), INTENT(in) :: did ! the dataset + INTEGER(hid_t), INTENT(in) :: dsid ! the scale to be attached + INTEGER , INTENT(in) :: idx ! the dimension of did that dsid is associated with. + END FUNCTION H5DSattach_scale_c + END INTERFACE + + c_idx = idx -1 ! account for C-dimensions starting at 0 + + errcode = H5DSattach_scale_c( did, dsid, c_idx) + + END SUBROUTINE H5DSattach_scale_f + +!------------------------------------------------------------------------- +! Function: H5DSdetach_scale_f +! +! Purpose: Detach dimension scale dsid from the dimension idx of Dataset did. +! +! Return: Success: 0, Failure: -1 +! +! Programmer: M. Scot Breitenfeld +! +! Date: April 17, 2011 +! +! Comments: +! +! Modifications: +! +!------------------------------------------------------------------------- + + SUBROUTINE H5DSdetach_scale_f( did, dsid, idx, errcode) + + IMPLICIT NONE + +! +!This definition is needed for Windows DLLs +!DEC$if defined(BUILD_HDF5_HL_DLL) +!DEC$attributes dllexport :: h5dsdetach_scale_f +!DEC$endif +! + INTEGER(hid_t), INTENT(in) :: did ! the dataset + INTEGER(hid_t), INTENT(in) :: dsid ! the scale to be detached + INTEGER , INTENT(in) :: idx ! the dimension of did to detach + INTEGER :: errcode ! error code + INTEGER :: c_idx + + INTERFACE + INTEGER FUNCTION H5DSdetach_scale_c(did, dsid, idx) & + BIND(C,NAME='h5dsdetach_scale_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(hid_t), INTENT(in) :: did ! the dataset + INTEGER(hid_t), INTENT(in) :: dsid ! the scale to be detached + INTEGER , INTENT(in) :: idx ! the dimension of did to detach + END FUNCTION H5DSdetach_scale_c + END INTERFACE + + c_idx = idx - 1 ! account for C-dimensions starting at 0 + + errcode = H5DSdetach_scale_c( did, dsid, c_idx) + + END SUBROUTINE H5DSdetach_scale_f + + +!------------------------------------------------------------------------- +! Function: H5DSis_attached_f +! +! Purpose: Report if dimension scale dsid is currently attached to dimension idx of dataset did. +! +! Return: Success: 0, Failure: -1 +! +! Programmer: M. Scot Breitenfeld +! +! Date: April 17, 2011 +! +! Comments: +! +! Modifications: +! +!------------------------------------------------------------------------- + + SUBROUTINE H5DSis_attached_f( did, dsid, idx, is_attached, errcode) + + IMPLICIT NONE + +! +!This definition is needed for Windows DLLs +!DEC$if defined(BUILD_HDF5_HL_DLL) +!DEC$attributes dllexport :: h5dsis_attached_f +!DEC$endif +! + INTEGER(hid_t), INTENT(in) :: did ! the dataset + INTEGER(hid_t), INTENT(in) :: dsid ! the scale to be attached + INTEGER , INTENT(in) :: idx ! the dimension of did that dsid is associated with + LOGICAL , INTENT(out) :: is_attached ! logical: dimension scale dsid is currently attached to + ! dimension idx of dataset did + INTEGER :: errcode ! error code + INTEGER :: c_is_attached + INTEGER :: c_idx + + INTERFACE + INTEGER FUNCTION H5DSis_attached_c(did, dsid, idx, c_is_attached) & + BIND(C,NAME='h5dsis_attached_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(hid_t), INTENT(in) :: did ! the dataset + INTEGER(hid_t), INTENT(in) :: dsid ! the scale to be detached + INTEGER , INTENT(in) :: idx ! the dimension of did to detach + INTEGER , INTENT(out) :: c_is_attached ! dimension scale dsid is currently attached to + END FUNCTION H5DSis_attached_c + END INTERFACE + + c_idx = idx - 1 ! account for C-dimensions starting at 0 + + errcode = H5DSis_attached_c(did, dsid, c_idx, c_is_attached) + + is_attached = .FALSE. ! default + IF(c_is_attached.GT.0)THEN + is_attached = .TRUE. + ELSE IF(errcode.LT.0)THEN + errcode = -1 + ENDIF + + END SUBROUTINE H5DSis_attached_f + +! +! H5DSiterate_scales: Impliment in F2003 +! + +!------------------------------------------------------------------------- +! Function: H5DSis_scale_f +! +! Purpose: Determines whether dset is a Dimension Scale. +! +! Return: Success: 0, Failure: -1 +! +! Programmer: M. Scot Breitenfeld +! +! Date: April 18, 2011 +! +! Comments: +! +! Modifications: +! +!------------------------------------------------------------------------- + + SUBROUTINE H5DSis_scale_f( did, is_scale, errcode) + + IMPLICIT NONE + +! +!This definition is needed for Windows DLLs +!DEC$if defined(BUILD_HDF5_HL_DLL) +!DEC$attributes dllexport :: h5dsis_scale_f +!DEC$endif +! + INTEGER(hid_t), INTENT(in) :: did ! the data set to query + LOGICAL , INTENT(out) :: is_scale ! logical: + ! .TRUE. if did is a Dimension Scale + INTEGER :: errcode ! error code + INTEGER :: c_is_scale + + INTERFACE + INTEGER FUNCTION H5DSis_scale_c(did,c_is_scale) & + BIND(C,NAME='h5dsis_scale_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(hid_t), INTENT(in) :: did + INTEGER, INTENT(out) :: c_is_scale + END FUNCTION H5DSis_scale_c + END INTERFACE + + errcode = H5DSis_scale_c(did, c_is_scale) + + is_scale = .FALSE. ! default + IF(c_is_scale.GT.0)THEN + is_scale = .TRUE. + ELSE IF(errcode.LT.0)THEN + errcode = -1 + ENDIF + + END SUBROUTINE H5DSis_scale_f + +!------------------------------------------------------------------------- +! Function: H5DSset_label_f +! +! Purpose: Set label for the dimension idx of did to the value label +! +! Return: Success: 0, Failure: -1 +! +! Programmer: M. Scot Breitenfeld +! +! Date: April 18, 2011 +! +! Comments: +! +! Modifications: +! +!------------------------------------------------------------------------- + + SUBROUTINE H5DSset_label_f( did, idx, label, errcode) + + IMPLICIT NONE + +! +!This definition is needed for Windows DLLs +!DEC$if defined(BUILD_HDF5_HL_DLL) +!DEC$attributes dllexport :: h5dsset_label_f +!DEC$endif +! + + INTEGER(hid_t), INTENT(in) :: did ! The dataset + INTEGER , INTENT(in) :: idx ! The dimension + CHARACTER(LEN=*), INTENT(in) :: label ! The label + INTEGER :: errcode ! Error code + + INTEGER(SIZE_T) :: label_len ! Length of label + INTEGER :: c_idx + + INTERFACE + INTEGER FUNCTION H5DSset_label_c(did, idx, label, label_len) & + BIND(C,NAME='h5dsset_label_c') + IMPORT :: C_CHAR + IMPORT :: HID_T, SIZE_T + IMPLICIT NONE + INTEGER(hid_t), INTENT(in) :: did ! The dataset + INTEGER , INTENT(in) :: idx ! The dimension + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: label ! The label + INTEGER(SIZE_T), INTENT(in) :: label_len ! Length of label + END FUNCTION H5DSset_label_c + END INTERFACE + + c_idx = idx - 1 + + label_len = LEN(label) + errcode = H5DSset_label_c(did, c_idx, label, label_len) + + END SUBROUTINE H5DSset_label_f + +!------------------------------------------------------------------------- +! Function: H5DSget_label_f +! +! Purpose: Read the label for dimension idx of did into buffer label. +! +! Return: Success: 0, Failure: -1 +! +! Programmer: M. Scot Breitenfeld +! +! Date: April 18, 2011 +! +! Comments: +! +! Modifications: +! +!------------------------------------------------------------------------- + + SUBROUTINE H5DSget_label_f( did, idx, label, size, errcode) + + IMPLICIT NONE + +! +!This definition is needed for Windows DLLs +!DEC$if defined(BUILD_HDF5_HL_DLL) +!DEC$attributes dllexport :: h5dsget_label_f +!DEC$endif +! + + INTEGER(hid_t), INTENT(in) :: did ! The dataget + INTEGER , INTENT(in) :: idx ! The dimension + CHARACTER(LEN=*), INTENT(in) :: label ! The label + INTEGER(size_t) , INTENT(inout) :: size ! The length of the label buffer + INTEGER :: errcode ! Error code + INTEGER :: c_idx + + INTERFACE + INTEGER FUNCTION H5DSget_label_c(did, idx, label, size) & + BIND(C,NAME='h5dsget_label_c') + IMPORT :: C_CHAR + IMPORT :: HID_T, SIZE_T + IMPLICIT NONE + INTEGER(hid_t), INTENT(in) :: did ! The dataget + INTEGER , INTENT(in) :: idx ! The dimension + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: label ! The label + INTEGER(SIZE_T), INTENT(inout) :: size ! Length of label + END FUNCTION H5DSget_label_c + END INTERFACE + + c_idx = idx - 1 + + errcode = H5DSget_label_c(did, c_idx, label, size) + + END SUBROUTINE H5DSget_label_f + + +!------------------------------------------------------------------------- +! Function: H5DSget_scale_name_f +! +! Purpose: Read the name of scale did into buffer name. +! +! Return: Success: 0, Failure: -1 +! +! Programmer: M. Scot Breitenfeld +! +! Date: April 18, 2011 +! +! Comments: +! +! Modifications: +! +!------------------------------------------------------------------------- + + SUBROUTINE H5DSget_scale_name_f(did, name, size, errcode) + + IMPLICIT NONE + +! +!This definition is needed for Windows DLLs +!DEC$if defined(BUILD_HDF5_HL_DLL) +!DEC$attributes dllexport :: h5dsget_scale_name_f +!DEC$endif +! + + INTEGER(hid_t), INTENT(in) :: did ! The dataget + CHARACTER(LEN=*), INTENT(out) :: name ! The name + INTEGER(size_t) , INTENT(inout) :: size ! The length of the name buffer + INTEGER :: errcode ! Error code + + INTERFACE + INTEGER FUNCTION H5DSget_scale_name_c(did, name, size) & + bind(c,name='h5dsget_scale_name_c') + IMPORT :: C_CHAR + IMPORT :: HID_T, SIZE_T + IMPLICIT NONE + INTEGER(hid_t), INTENT(in) :: did ! The dataget + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(out) :: name ! The name + INTEGER(SIZE_T), INTENT(inout) :: size ! Length of name + END FUNCTION H5DSget_scale_name_c + END INTERFACE + + errcode = H5DSget_scale_name_c(did, name, size) + + END SUBROUTINE H5DSget_scale_name_f + +!------------------------------------------------------------------------- +! Function: H5DSget_num_scales_f +! +! Purpose: Determines how many Dimension Scales are attached to dimension idx of did +! +! Return: Success: 0, Failure: -1 +! +! Programmer: M. Scot Breitenfeld +! +! Date: April 18, 2011 +! +! Comments: +! +! Modifications: +! +!------------------------------------------------------------------------- + + SUBROUTINE H5DSget_num_scales_f( did, idx, num_scales, errcode) + + IMPLICIT NONE + +! +!This definition is needed for Windows DLLs +!DEC$if defined(BUILD_HDF5_HL_DLL) +!DEC$attributes dllexport :: h5dsget_num_scales_f +!DEC$endif +! + INTEGER(hid_t), INTENT(in) :: did ! the dataset + INTEGER , INTENT(in) :: idx ! the dimension of did to query + INTEGER , INTENT(out) :: num_scales ! the number of Dimension Scales associated with did + INTEGER :: errcode ! error code + INTEGER :: c_idx + + INTERFACE + INTEGER FUNCTION H5DSget_num_scales_c(did, idx, num_scales) & + BIND(C,NAME='h5dsget_num_scales_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(hid_t), INTENT(in) :: did ! the dataset + INTEGER , INTENT(in) :: idx ! the dimension of did to query + INTEGER , INTENT(out) :: num_scales ! the number of Dimension Scales associated with did + END FUNCTION H5DSget_num_scales_c + END INTERFACE + + c_idx = idx - 1 + errcode = H5DSget_num_scales_c(did, c_idx, num_scales) + + END SUBROUTINE H5DSget_num_scales_f + +END MODULE h5ds + + + + + + diff --git a/hl/fortran/src/H5DSff.f90 b/hl/fortran/src/H5DSff.f90 deleted file mode 100644 index 04540a6..0000000 --- a/hl/fortran/src/H5DSff.f90 +++ /dev/null @@ -1,545 +0,0 @@ -! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -! 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. * -! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -! -! -! This file contains FORTRAN90 interfaces for H5DS functions -! - -MODULE h5ds - - USE h5fortran_types - USE hdf5 - -CONTAINS - - -!------------------------------------------------------------------------- -! Function: H5DSset_scale_f -! -! Purpose: Convert dataset dsid to a dimension scale, with optional name, dimname. -! -! Return: Success: 0, Failure: -1 -! -! Programmer: M. Scot Breitenfeld -! -! Date: April 17, 2011 -! -! Comments: -! -! Modifications: -! -!------------------------------------------------------------------------- - - SUBROUTINE H5DSset_scale_f( dsid, errcode, dimname) - - IMPLICIT NONE - -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5dsset_scale_f -!DEC$endif -! - - INTEGER(hid_t), INTENT(in) :: dsid ! The dataset to be made a Dimension Scale - CHARACTER(LEN=*), INTENT(in), OPTIONAL :: dimname ! The dimension name - INTEGER :: errcode ! Error code - - INTEGER(SIZE_T) :: dimname_len ! length of dimname (if present) - - INTERFACE - INTEGER FUNCTION H5DSset_scale_c(dsid, dimname, dimname_len ) - - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DSSET_SCALE_C'::h5dsset_scale_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dimname - INTEGER(hid_t), INTENT(in) :: dsid ! The dataset to be made a Dimension Scale - CHARACTER(LEN=*), INTENT(in) :: dimname ! The dimension name - INTEGER(SIZE_T), INTENT(in) :: dimname_len - END FUNCTION H5DSset_scale_c - END INTERFACE - - IF(PRESENT(dimname))THEN - dimname_len = LEN(dimname) - errcode = H5DSset_scale_c(dsid, dimname, dimname_len ) - ELSE - errcode = H5DSset_scale_c(dsid, " ", INT(0,SIZE_T) ) - ENDIF - - END SUBROUTINE H5DSset_scale_f - -!------------------------------------------------------------------------- -! Function: H5DSattach_scale_f -! -! Purpose: Attach dimension scale dsid to dimension idx of dataset did. -! -! Return: Success: 0, Failure: -1 -! -! Programmer: M. Scot Breitenfeld -! -! Date: April 17, 2011 -! -! Comments: -! -! Modifications: -! -!------------------------------------------------------------------------- - - SUBROUTINE H5DSattach_scale_f( did, dsid, idx, errcode) - - IMPLICIT NONE - -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5dsattach_scale_f -!DEC$endif -! - INTEGER(hid_t), INTENT(in) :: did ! the dataset - INTEGER(hid_t), INTENT(in) :: dsid ! the scale to be attached - INTEGER , INTENT(in) :: idx ! the dimension of did that dsid is associated with. - INTEGER :: errcode ! error code - INTEGER :: c_idx - - INTERFACE - INTEGER FUNCTION H5DSattach_scale_c(did, dsid, idx ) - - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DSATTACH_SCALE_C':: h5dsattach_scale_c - !DEC$ENDIF - INTEGER(hid_t), INTENT(in) :: did ! the dataset - INTEGER(hid_t), INTENT(in) :: dsid ! the scale to be attached - INTEGER , INTENT(in) :: idx ! the dimension of did that dsid is associated with. - END FUNCTION H5DSattach_scale_c - END INTERFACE - - c_idx = idx -1 ! account for C-dimensions starting at 0 - - errcode = H5DSattach_scale_c( did, dsid, c_idx) - - END SUBROUTINE H5DSattach_scale_f - -!------------------------------------------------------------------------- -! Function: H5DSdetach_scale_f -! -! Purpose: Detach dimension scale dsid from the dimension idx of Dataset did. -! -! Return: Success: 0, Failure: -1 -! -! Programmer: M. Scot Breitenfeld -! -! Date: April 17, 2011 -! -! Comments: -! -! Modifications: -! -!------------------------------------------------------------------------- - - SUBROUTINE H5DSdetach_scale_f( did, dsid, idx, errcode) - - IMPLICIT NONE - -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5dsdetach_scale_f -!DEC$endif -! - INTEGER(hid_t), INTENT(in) :: did ! the dataset - INTEGER(hid_t), INTENT(in) :: dsid ! the scale to be detached - INTEGER , INTENT(in) :: idx ! the dimension of did to detach - INTEGER :: errcode ! error code - INTEGER :: c_idx - - INTERFACE - INTEGER FUNCTION H5DSdetach_scale_c(did, dsid, idx ) - - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DSDETACH_SCALE_C':: h5dsdetach_scale_c - !DEC$ENDIF - INTEGER(hid_t), INTENT(in) :: did ! the dataset - INTEGER(hid_t), INTENT(in) :: dsid ! the scale to be detached - INTEGER , INTENT(in) :: idx ! the dimension of did to detach - END FUNCTION H5DSdetach_scale_c - END INTERFACE - - c_idx = idx - 1 ! account for C-dimensions starting at 0 - - errcode = H5DSdetach_scale_c( did, dsid, c_idx) - - END SUBROUTINE H5DSdetach_scale_f - - -!------------------------------------------------------------------------- -! Function: H5DSis_attached_f -! -! Purpose: Report if dimension scale dsid is currently attached to dimension idx of dataset did. -! -! Return: Success: 0, Failure: -1 -! -! Programmer: M. Scot Breitenfeld -! -! Date: April 17, 2011 -! -! Comments: -! -! Modifications: -! -!------------------------------------------------------------------------- - - SUBROUTINE H5DSis_attached_f( did, dsid, idx, is_attached, errcode) - - IMPLICIT NONE - -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5dsis_attached_f -!DEC$endif -! - INTEGER(hid_t), INTENT(in) :: did ! the dataset - INTEGER(hid_t), INTENT(in) :: dsid ! the scale to be attached - INTEGER , INTENT(in) :: idx ! the dimension of did that dsid is associated with - LOGICAL , INTENT(out) :: is_attached ! logical: dimension scale dsid is currently attached to - ! dimension idx of dataset did - INTEGER :: errcode ! error code - INTEGER :: c_is_attached - INTEGER :: c_idx - - INTERFACE - INTEGER FUNCTION H5DSis_attached_c(did, dsid, idx, c_is_attached ) - - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DSIS_ATTACHED_C':: h5dsis_attached_c - !DEC$ENDIF - INTEGER(hid_t), INTENT(in) :: did ! the dataset - INTEGER(hid_t), INTENT(in) :: dsid ! the scale to be detached - INTEGER , INTENT(in) :: idx ! the dimension of did to detach - INTEGER , INTENT(out) :: c_is_attached ! dimension scale dsid is currently attached to - END FUNCTION H5DSis_attached_c - END INTERFACE - - c_idx = idx - 1 ! account for C-dimensions starting at 0 - - errcode = H5DSis_attached_c(did, dsid, c_idx, c_is_attached) - - is_attached = .FALSE. ! default - IF(c_is_attached.GT.0)THEN - is_attached = .TRUE. - ELSE IF(errcode.LT.0)THEN - errcode = -1 - ENDIF - - END SUBROUTINE H5DSis_attached_f - -! -! H5DSiterate_scales: Impliment in F2003 -! - -!------------------------------------------------------------------------- -! Function: H5DSis_scale_f -! -! Purpose: Determines whether dset is a Dimension Scale. -! -! Return: Success: 0, Failure: -1 -! -! Programmer: M. Scot Breitenfeld -! -! Date: April 18, 2011 -! -! Comments: -! -! Modifications: -! -!------------------------------------------------------------------------- - - SUBROUTINE H5DSis_scale_f( did, is_scale, errcode) - - IMPLICIT NONE - -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5dsis_scale_f -!DEC$endif -! - INTEGER(hid_t), INTENT(in) :: did ! the data set to query - LOGICAL , INTENT(out) :: is_scale ! logical: - ! .TRUE. if did is a Dimension Scale - INTEGER :: errcode ! error code - INTEGER :: c_is_scale - - INTERFACE - INTEGER FUNCTION H5DSis_scale_c(did,c_is_scale) - - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DSIS_SCALE_C':: h5dsis_scale_c - !DEC$ENDIF - INTEGER(hid_t), INTENT(in) :: did ! the data set to query - INTEGER, INTENT(out) :: c_is_scale - END FUNCTION H5DSis_scale_c - END INTERFACE - - errcode = H5DSis_scale_c(did, c_is_scale) - - is_scale = .FALSE. ! default - IF(c_is_scale.GT.0)THEN - is_scale = .TRUE. - ELSE IF(errcode.LT.0)THEN - errcode = -1 - ENDIF - - END SUBROUTINE H5DSis_scale_f - -!------------------------------------------------------------------------- -! Function: H5DSset_label_f -! -! Purpose: Set label for the dimension idx of did to the value label -! -! Return: Success: 0, Failure: -1 -! -! Programmer: M. Scot Breitenfeld -! -! Date: April 18, 2011 -! -! Comments: -! -! Modifications: -! -!------------------------------------------------------------------------- - - SUBROUTINE H5DSset_label_f( did, idx, label, errcode) - - IMPLICIT NONE - -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5dsset_label_f -!DEC$endif -! - - INTEGER(hid_t), INTENT(in) :: did ! The dataset - INTEGER , INTENT(in) :: idx ! The dimension - CHARACTER(LEN=*), INTENT(in) :: label ! The label - INTEGER :: errcode ! Error code - - INTEGER(SIZE_T) :: label_len ! Length of label - INTEGER :: c_idx - - INTERFACE - INTEGER FUNCTION H5DSset_label_c(did, idx, label, label_len) - - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DSSET_LABEL_C'::h5dsset_label_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: label - INTEGER(hid_t), INTENT(in) :: did ! The dataset - INTEGER , INTENT(in) :: idx ! The dimension - CHARACTER(LEN=*), INTENT(in) :: label ! The label - INTEGER(SIZE_T), INTENT(in) :: label_len ! Length of label - END FUNCTION H5DSset_label_c - END INTERFACE - - c_idx = idx - 1 - - label_len = LEN(label) - errcode = H5DSset_label_c(did, c_idx, label, label_len) - - END SUBROUTINE H5DSset_label_f - -!------------------------------------------------------------------------- -! Function: H5DSget_label_f -! -! Purpose: Read the label for dimension idx of did into buffer label. -! -! Return: Success: 0, Failure: -1 -! -! Programmer: M. Scot Breitenfeld -! -! Date: April 18, 2011 -! -! Comments: -! -! Modifications: -! -!------------------------------------------------------------------------- - - SUBROUTINE H5DSget_label_f( did, idx, label, size, errcode) - - IMPLICIT NONE - -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5dsget_label_f -!DEC$endif -! - - INTEGER(hid_t), INTENT(in) :: did ! The dataget - INTEGER , INTENT(in) :: idx ! The dimension - CHARACTER(LEN=*), INTENT(in) :: label ! The label - INTEGER(size_t) , INTENT(inout) :: size ! The length of the label buffer - INTEGER :: errcode ! Error code - INTEGER :: c_idx - - INTERFACE - INTEGER FUNCTION H5DSget_label_c(did, idx, label, size) - - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DSGET_LABEL_C'::h5dsget_label_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: label - INTEGER(hid_t), INTENT(in) :: did ! The dataget - INTEGER , INTENT(in) :: idx ! The dimension - CHARACTER(LEN=*), INTENT(in) :: label ! The label - INTEGER(SIZE_T), INTENT(inout) :: size ! Length of label - END FUNCTION H5DSget_label_c - END INTERFACE - - c_idx = idx - 1 - - errcode = H5DSget_label_c(did, c_idx, label, size) - - END SUBROUTINE H5DSget_label_f - - -!------------------------------------------------------------------------- -! Function: H5DSget_scale_name_f -! -! Purpose: Read the name of scale did into buffer name. -! -! Return: Success: 0, Failure: -1 -! -! Programmer: M. Scot Breitenfeld -! -! Date: April 18, 2011 -! -! Comments: -! -! Modifications: -! -!------------------------------------------------------------------------- - - SUBROUTINE H5DSget_scale_name_f(did, name, size, errcode) - - IMPLICIT NONE - -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5dsget_scale_name_f -!DEC$endif -! - - INTEGER(hid_t), INTENT(in) :: did ! The dataget - CHARACTER(LEN=*), INTENT(out) :: name ! The name - INTEGER(size_t) , INTENT(inout) :: size ! The length of the name buffer - INTEGER :: errcode ! Error code - - INTERFACE - INTEGER FUNCTION H5DSget_scale_name_c(did, name, size) - - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DSGET_SCALE_NAME_C'::h5dsget_scale_name_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: name - INTEGER(hid_t), INTENT(in) :: did ! The dataget - CHARACTER(LEN=*), INTENT(out) :: name ! The name - INTEGER(SIZE_T), INTENT(inout) :: size ! Length of name - END FUNCTION H5DSget_scale_name_c - END INTERFACE - - errcode = H5DSget_scale_name_c(did, name, size) - - END SUBROUTINE H5DSget_scale_name_f - -!------------------------------------------------------------------------- -! Function: H5DSget_num_scales_f -! -! Purpose: Determines how many Dimension Scales are attached to dimension idx of did -! -! Return: Success: 0, Failure: -1 -! -! Programmer: M. Scot Breitenfeld -! -! Date: April 18, 2011 -! -! Comments: -! -! Modifications: -! -!------------------------------------------------------------------------- - - SUBROUTINE H5DSget_num_scales_f( did, idx, num_scales, errcode) - - IMPLICIT NONE - -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5dsget_num_scales_f -!DEC$endif -! - INTEGER(hid_t), INTENT(in) :: did ! the dataset - INTEGER , INTENT(in) :: idx ! the dimension of did to query - INTEGER , INTENT(out) :: num_scales ! the number of Dimension Scales associated with did - INTEGER :: errcode ! error code - INTEGER :: c_idx - - INTERFACE - INTEGER FUNCTION H5DSget_num_scales_c(did, idx, num_scales) - - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DSGET_NUM_SCALES_C':: h5dsget_num_scales_c - !DEC$ENDIF - INTEGER(hid_t), INTENT(in) :: did ! the dataset - INTEGER , INTENT(in) :: idx ! the dimension of did to query - INTEGER , INTENT(out) :: num_scales ! the number of Dimension Scales associated with did - END FUNCTION H5DSget_num_scales_c - END INTERFACE - - c_idx = idx - 1 - errcode = H5DSget_num_scales_c(did, c_idx, num_scales) - - END SUBROUTINE H5DSget_num_scales_f - -END MODULE h5ds - - - - - - diff --git a/hl/fortran/src/H5HL_buildiface.F90 b/hl/fortran/src/H5HL_buildiface.F90 new file mode 100644 index 0000000..0e85e27 --- /dev/null +++ b/hl/fortran/src/H5HL_buildiface.F90 @@ -0,0 +1,683 @@ +!****p* Program/H5HL_buildiface +! +! NAME +! Executable: H5HL_buildiface +! +! FILE +! fortran/src/H5HL_buildiface.f90 +! +! PURPOSE +! This stand alone program is used at build time to generate the program +! H5HL_gen.f90. It cycles through all the available KIND parameters for +! integers and reals. The appropriate program and subroutines are then generated +! depending on which of the KIND values are found. +! +! NOTES +! This program uses the Fortran 2008 intrinsic function STORAGE_SIZE or SIZEOF +! depending on availablity.It generates code that makes use of +! STORAGE_SIZE/SIZEOF in H5fortran_detect.f90. STORAGE_SIZE is standard +! compliant and should always be chosen over SIZEOF. +! +! The availability of STORAGE_SIZE/SIZEOF is checked at configure time and the TRUE/FALSE +! condition is set in the configure variable "FORTRAN_HAVE_STORAGE_SIZE" or +! "FORTRAN_HAVE_SIZEOF". +! +! The use of C_SIZOF(X) is not used since the argument X must be an interoperable +! data entity. +! +! 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 +! M. Scot Breitenfeld +! +!***** + +#include + +PROGRAM H5HL_buildiface + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + +! These values are valid REAL KINDs (with corresponding C float) found during configure + H5_H5CONFIG_F_NUM_RKIND + H5_H5CONFIG_F_RKIND +! These values are valid INTEGER KINDs (with corresponding C float) found during configure + H5_H5CONFIG_F_NUM_IKIND + H5_H5CONFIG_F_IKIND + + INTEGER :: i, j, k + INTEGER :: ji, jr, jd +#ifdef H5_FORTRAN_HAVE_C_LONG_DOUBLE + REAL(KIND=C_LONG_DOUBLE) :: c_longdble +#endif + REAL(KIND=C_DOUBLE) :: c_dble + REAL(KIND=C_FLOAT) :: c_flt + INTEGER :: sizeof_var + 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)) ', & + ', DIMENSION(dims(1),dims(2)) ', & + ', DIMENSION(dims(1),dims(2),dims(3)) ', & + ', DIMENSION(dims(1),dims(2),dims(3),dims(4)) ', & + ', DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) ', & + ', 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)) ', & + ' f_ptr = C_LOC(buf(1,1)) ', & + ' f_ptr = C_LOC(buf(1,1,1)) ', & + ' f_ptr = C_LOC(buf(1,1,1,1)) ', & + ' f_ptr = C_LOC(buf(1,1,1,1,1)) ', & + ' f_ptr = C_LOC(buf(1,1,1,1,1,1)) ', & + ' f_ptr = C_LOC(buf(1,1,1,1,1,1,1))' & + /) + +! Generate Fortran H5LT* interfaces having multiple KIND interfaces. +! +! Developer's notes: +! +! Only interfaces with arrays of rank 7 and less are provided. Even-though the F2008 +! standard extended the maximum rank to 15, it was decided that they should use the +! new APIs to handle those use cases. Handling rank 7 and less is for backward compatibility +! with the Fortran 90/95 APIs codes which could never handle rank 8-15 array sizes. + + OPEN(11,FILE='H5LTff_gen.F90') + WRITE(11,'(40(A,/))') & +'!****h* ROBODoc/H5LTff_gen.F90',& +'!',& +'! NAME',& +'! H5LTff_gen',& +'! ',& +'! PURPOSE',& +'! This module is generated at build by H5HL_buildiface.F90 to handle all the',& +'! detected REAL/INTEGER KINDs for APIs being passed those KINDs. Currently these ',& +'! are H5LT and H5TB APIs',& +'!',& +'! COPYRIGHT',& +'! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *',& +'! Copyright by The HDF Group. *',& +'! 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',& +'! H5HL_buildiface.F90',& +'!',& +'!*****' + + WRITE(11,'(a)') "MODULE H5LT" + + WRITE(11,'(A)') ' USE, INTRINSIC :: ISO_C_BINDING' + WRITE(11,'(A)') ' USE h5fortran_types' + WRITE(11,'(A)') ' USE H5LT_CONST' + WRITE(11,'(A)') ' IMPLICIT NONE' +!*************** +! H5LT INTERFACES +!*************** +! +! H5LTmake_dataset_f +! + WRITE(11,'(A)') " INTERFACE h5ltmake_dataset_f" + DO i = 1, num_rkinds + j = rkind(i) + WRITE(chr2,'(I2)') j + DO k = 1, 8 + WRITE(11,'(A)') " MODULE PROCEDURE h5ltmake_dataset_real_kind_"//TRIM(ADJUSTL(chr2))//'_rank'//chr_rank(k) + ENDDO + END DO + WRITE(11,'(A)') " END INTERFACE" + +! h5ltread_dataset_f + WRITE(11,'(A)') " INTERFACE h5ltread_dataset_f" + DO i = 1, num_rkinds + j = rkind(i) + WRITE(chr2,'(I2)') j + DO k = 1, 8 + WRITE(11,'(A)') " MODULE PROCEDURE h5ltread_dataset_real_kind_"//TRIM(ADJUSTL(chr2))//'_rank'//chr_rank(k) + ENDDO + END DO + WRITE(11,'(A)') " END INTERFACE" + +! h5ltmake_dataset_float_f + WRITE(11,'(A)') " INTERFACE h5ltmake_dataset_float_f" + DO i = 1, num_rkinds + j = rkind(i) + WRITE(chr2,'(I2)') j + DO k = 1, 8 + WRITE(11,'(A)') " MODULE PROCEDURE h5ltmake_dataset_float_kind_"//TRIM(ADJUSTL(chr2))//'_rank'//chr_rank(k) + ENDDO + END DO + WRITE(11,'(A)') " END INTERFACE" + +! h5ltmake_dataset_double_f + WRITE(11,'(A)') " INTERFACE h5ltmake_dataset_double_f" + DO i = 1, num_rkinds + j = rkind(i) + WRITE(chr2,'(I2)') j + DO k = 1, 8 + WRITE(11,'(A)') " MODULE PROCEDURE h5ltmake_dataset_double_kind_"//TRIM(ADJUSTL(chr2))//'_rank'//chr_rank(k) + ENDDO + END DO + WRITE(11,'(A)') " END INTERFACE" + +! h5ltread_dataset_float_f + WRITE(11,'(A)') " INTERFACE h5ltread_dataset_float_f" + DO i = 1, num_rkinds + j = rkind(i) + WRITE(chr2,'(I2)') j + DO k = 1, 8 + WRITE(11,'(A)') " MODULE PROCEDURE h5ltread_dataset_float_kind_"//TRIM(ADJUSTL(chr2))//'_rank'//chr_rank(k) + ENDDO + END DO + WRITE(11,'(A)') " END INTERFACE" + +! h5ltread_dataset_double_f + WRITE(11,'(A)') " INTERFACE h5ltread_dataset_double_f" + DO i = 1, num_rkinds + j = rkind(i) + WRITE(chr2,'(I2)') j + DO k = 1, 8 + WRITE(11,'(A)') " MODULE PROCEDURE h5ltread_dataset_double_kind_"//TRIM(ADJUSTL(chr2))//'_rank'//chr_rank(k) + ENDDO + END DO + WRITE(11,'(A)') " END INTERFACE" + + WRITE(11,'(A)') 'CONTAINS' + +!********************** +! H5LT APIs +!********************** +! +! h5ltmake_dataset_f + DO i = 1, num_rkinds + k = rkind(i) + WRITE(chr2,'(I2)') k + DO j = 1, 8 + +! DLL definitions for windows + WRITE(11,'(A)') '!DEC$if defined(BUILD_HDF5_HL_DLL)' + WRITE(11,'(A)') '!DEC$attributes dllexport :: h5ltmake_dataset_real_kind_'//TRIM(ADJUSTL(chr2))//'_rank'//chr_rank(j) + WRITE(11,'(A)') '!DEC$endif' + +! Subroutine API + WRITE(11,'(A)') ' SUBROUTINE h5ltmake_dataset_real_kind_'//TRIM(ADJUSTL(chr2))& + &//'_rank'//chr_rank(j)//'(loc_id,dset_name,rank,dims,type_id,buf,errcode)' + WRITE(11,'(A)') ' IMPLICIT NONE' + WRITE(11,'(A)') ' INTEGER(hid_t) , INTENT(IN) :: loc_id' + WRITE(11,'(A)') ' CHARACTER(LEN=*), INTENT(IN) :: dset_name' + WRITE(11,'(A)') ' INTEGER, INTENT(IN) :: rank' + WRITE(11,'(A)') ' INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims' + WRITE(11,'(A)') ' INTEGER(hid_t), INTENT(in) :: type_id' + WRITE(11,'(A)') ' REAL(KIND='//TRIM(ADJUSTL(chr2))//'),INTENT(IN)'//TRIM(rank_dim_line(j))//', TARGET :: buf' + WRITE(11,'(A)') ' INTEGER :: errcode ' + WRITE(11,'(A)') ' TYPE(C_PTR) :: f_ptr' + WRITE(11,'(A)') ' INTEGER(size_t) :: namelen' + + WRITE(11,'(A)') f_ptr_line(j) + WRITE(11,'(A)') ' namelen = LEN(dset_name)' + WRITE(11,'(A)') ' errcode = h5ltmake_dataset_c(loc_id,namelen,dset_name,rank,dims,type_id,f_ptr)' + WRITE(11,'(A)') ' END SUBROUTINE h5ltmake_dataset_real_kind_'//TRIM(ADJUSTL(chr2))//'_rank'//chr_rank(j) + ENDDO + ENDDO + +! h5ltread_dataset_f + DO i = 1, num_rkinds + k = rkind(i) + WRITE(chr2,'(I2)') k + DO j = 1, 8 + +! DLL definitions for windows + WRITE(11,'(A)') '!DEC$if defined(BUILD_HDF5_HL_DLL)' + WRITE(11,'(A)') '!DEC$attributes dllexport :: h5ltread_dataset_real_kind_'//TRIM(ADJUSTL(chr2))//'_rank'//chr_rank(j) + WRITE(11,'(A)') '!DEC$endif' + +! Subroutine API + WRITE(11,'(A)') ' SUBROUTINE h5ltread_dataset_real_kind_'//TRIM(ADJUSTL(chr2))& + &//'_rank'//chr_rank(j)//'(loc_id,dset_name,type_id,buf,dims,errcode)' + WRITE(11,'(A)') ' IMPLICIT NONE' + WRITE(11,'(A)') ' INTEGER(hid_t) , INTENT(IN) :: loc_id' + WRITE(11,'(A)') ' CHARACTER(LEN=*), INTENT(IN) :: dset_name' + WRITE(11,'(A)') ' INTEGER(hid_t), INTENT(in) :: type_id' + WRITE(11,'(A)') ' INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims' + WRITE(11,'(A)') ' REAL(KIND='//TRIM(ADJUSTL(chr2))//'),INTENT(IN)'//TRIM(rank_dim_line(j))//', TARGET :: buf' + WRITE(11,'(A)') ' INTEGER :: errcode ' + WRITE(11,'(A)') ' TYPE(C_PTR) :: f_ptr' + WRITE(11,'(A)') ' INTEGER(size_t) :: namelen' + + WRITE(11,'(A)') f_ptr_line(j) + WRITE(11,'(A)') ' namelen = LEN(dset_name)' + WRITE(11,'(A)') ' errcode = h5ltread_dataset_c(loc_id,namelen,dset_name,type_id,f_ptr)' + WRITE(11,'(A)') ' END SUBROUTINE h5ltread_dataset_real_kind_'//TRIM(ADJUSTL(chr2))//'_rank'//chr_rank(j) + ENDDO + ENDDO + +! h5ltmake_dataset_float_f + DO i = 1, num_rkinds + k = rkind(i) + WRITE(chr2,'(I2)') k + DO j = 1, 8 + +! DLL definitions for windows + WRITE(11,'(A)') '!DEC$if defined(BUILD_HDF5_HL_DLL)' + WRITE(11,'(A)') '!DEC$attributes dllexport :: h5ltmake_dataset_float_kind_'//TRIM(ADJUSTL(chr2))//'_rank'//chr_rank(j) + WRITE(11,'(A)') '!DEC$endif' + +! Subroutine API + WRITE(11,'(A)') ' SUBROUTINE h5ltmake_dataset_float_kind_'//TRIM(ADJUSTL(chr2))& + &//'_rank'//chr_rank(j)//'(loc_id,dset_name,rank,dims,buf,errcode)' + WRITE(11,'(A)') ' IMPLICIT NONE' + WRITE(11,'(A)') ' INTEGER(hid_t) , INTENT(IN) :: loc_id' + WRITE(11,'(A)') ' CHARACTER(LEN=*), INTENT(IN) :: dset_name' + WRITE(11,'(A)') ' INTEGER, INTENT(IN) :: rank' + WRITE(11,'(A)') ' INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims' + WRITE(11,'(A)') ' REAL(KIND='//TRIM(ADJUSTL(chr2))//'),INTENT(IN)'//TRIM(rank_dim_line(j))//', TARGET :: buf' + WRITE(11,'(A)') ' INTEGER :: errcode ' + WRITE(11,'(A)') ' TYPE(C_PTR) :: f_ptr' + WRITE(11,'(A)') ' INTEGER(size_t) :: namelen' + + WRITE(11,'(A)') f_ptr_line(j) + WRITE(11,'(A)') ' namelen = LEN(dset_name)' + WRITE(11,'(A)') ' errcode = h5ltmake_dataset_c(loc_id,namelen,dset_name,rank,dims,H5T_NATIVE_REAL,f_ptr)' + WRITE(11,'(A)') ' END SUBROUTINE h5ltmake_dataset_float_kind_'//TRIM(ADJUSTL(chr2))//'_rank'//chr_rank(j) + ENDDO + ENDDO + +! h5ltread_dataset_float_f + DO i = 1, num_rkinds + k = rkind(i) + WRITE(chr2,'(I2)') k + DO j = 1, 8 + +! DLL definitions for windows + WRITE(11,'(A)') '!DEC$if defined(BUILD_HDF5_HL_DLL)' + WRITE(11,'(A)') '!DEC$attributes dllexport :: h5ltread_dataset_float_kind_'//TRIM(ADJUSTL(chr2))//'_rank'//chr_rank(j) + WRITE(11,'(A)') '!DEC$endif' + +! Subroutine API + WRITE(11,'(A)') ' SUBROUTINE h5ltread_dataset_float_kind_'//TRIM(ADJUSTL(chr2))& + &//'_rank'//chr_rank(j)//'(loc_id,dset_name,buf,dims,errcode)' + WRITE(11,'(A)') ' IMPLICIT NONE' + WRITE(11,'(A)') ' INTEGER(hid_t) , INTENT(IN) :: loc_id' + WRITE(11,'(A)') ' CHARACTER(LEN=*), INTENT(IN) :: dset_name' + WRITE(11,'(A)') ' INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims' + WRITE(11,'(A)') ' REAL(KIND='//TRIM(ADJUSTL(chr2))//'),INTENT(IN)'//TRIM(rank_dim_line(j))//', TARGET :: buf' + WRITE(11,'(A)') ' INTEGER :: errcode ' + WRITE(11,'(A)') ' TYPE(C_PTR) :: f_ptr' + WRITE(11,'(A)') ' INTEGER(size_t) :: namelen' + + WRITE(11,'(A)') f_ptr_line(j) + WRITE(11,'(A)') ' namelen = LEN(dset_name)' + WRITE(11,'(A)') ' errcode = h5ltread_dataset_c(loc_id,namelen,dset_name,H5T_NATIVE_REAL,f_ptr)' + WRITE(11,'(A)') ' END SUBROUTINE h5ltread_dataset_float_kind_'//TRIM(ADJUSTL(chr2))//'_rank'//chr_rank(j) + ENDDO + ENDDO + +! h5ltmake_dataset_double_f + DO i = 1, num_rkinds + k = rkind(i) + WRITE(chr2,'(I2)') k + DO j = 1, 8 + +! DLL definitions for windows + WRITE(11,'(A)') '!DEC$if defined(BUILD_HDF5_HL_DLL)' + WRITE(11,'(A)') '!DEC$attributes dllexport :: h5ltmake_dataset_double_kind_'//TRIM(ADJUSTL(chr2))//'_rank'//chr_rank(j) + WRITE(11,'(A)') '!DEC$endif' + +! Subroutine API + WRITE(11,'(A)') ' SUBROUTINE h5ltmake_dataset_double_kind_'//TRIM(ADJUSTL(chr2))& + &//'_rank'//chr_rank(j)//'(loc_id,dset_name,rank,dims,buf,errcode)' + WRITE(11,'(A)') ' IMPLICIT NONE' + WRITE(11,'(A)') ' INTEGER(hid_t) , INTENT(IN) :: loc_id' + WRITE(11,'(A)') ' CHARACTER(LEN=*), INTENT(IN) :: dset_name' + WRITE(11,'(A)') ' INTEGER, INTENT(IN) :: rank' + WRITE(11,'(A)') ' INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims' + WRITE(11,'(A)') ' REAL(KIND='//TRIM(ADJUSTL(chr2))//'),INTENT(IN)'//TRIM(rank_dim_line(j))//', TARGET :: buf' + WRITE(11,'(A)') ' INTEGER :: errcode ' + WRITE(11,'(A)') ' TYPE(C_PTR) :: f_ptr' + WRITE(11,'(A)') ' INTEGER(size_t) :: namelen' + + WRITE(11,'(A)') f_ptr_line(j) + WRITE(11,'(A)') ' namelen = LEN(dset_name)' + WRITE(11,'(A)') ' errcode = h5ltmake_dataset_c(loc_id,namelen,dset_name,rank,dims,H5T_NATIVE_DOUBLE,f_ptr)' + WRITE(11,'(A)') ' END SUBROUTINE h5ltmake_dataset_double_kind_'//TRIM(ADJUSTL(chr2))//'_rank'//chr_rank(j) + ENDDO + ENDDO + +! h5ltread_dataset_double_f + DO i = 1, num_rkinds + k = rkind(i) + WRITE(chr2,'(I2)') k + DO j = 1, 8 + +! DLL definitions for windows + WRITE(11,'(A)') '!DEC$if defined(BUILD_HDF5_HL_DLL)' + WRITE(11,'(A)') '!DEC$attributes dllexport :: h5ltread_dataset_double_kind_'//TRIM(ADJUSTL(chr2))//'_rank'//chr_rank(j) + WRITE(11,'(A)') '!DEC$endif' + +! Subroutine API + WRITE(11,'(A)') ' SUBROUTINE h5ltread_dataset_double_kind_'//TRIM(ADJUSTL(chr2))& + &//'_rank'//chr_rank(j)//'(loc_id,dset_name,buf,dims,errcode)' + WRITE(11,'(A)') ' IMPLICIT NONE' + WRITE(11,'(A)') ' INTEGER(hid_t) , INTENT(IN) :: loc_id' + WRITE(11,'(A)') ' CHARACTER(LEN=*), INTENT(IN) :: dset_name' + WRITE(11,'(A)') ' INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims' + WRITE(11,'(A)') ' REAL(KIND='//TRIM(ADJUSTL(chr2))//'),INTENT(IN)'//TRIM(rank_dim_line(j))//', TARGET :: buf' + WRITE(11,'(A)') ' INTEGER :: errcode ' + WRITE(11,'(A)') ' TYPE(C_PTR) :: f_ptr' + WRITE(11,'(A)') ' INTEGER(size_t) :: namelen' + + WRITE(11,'(A)') f_ptr_line(j) + WRITE(11,'(A)') ' namelen = LEN(dset_name)' + WRITE(11,'(A)') ' errcode = h5ltread_dataset_c(loc_id,namelen,dset_name,H5T_NATIVE_DOUBLE,f_ptr)' + WRITE(11,'(A)') ' END SUBROUTINE h5ltread_dataset_double_kind_'//TRIM(ADJUSTL(chr2))//'_rank'//chr_rank(j) + ENDDO + ENDDO + + WRITE(11,'(A)') 'END MODULE H5LT' ! change this to be generic MSB + + CLOSE(11) + +! Generate Fortran H5TB* interfaces having multiple KIND interfaces. + + + OPEN(11,FILE='H5TBff_gen.F90') + WRITE(11,'(40(A,/))') & +'!****h* ROBODoc/H5TBff_gen.F90',& +'!',& +'! NAME',& +'! H5TBff_gen',& +'! ',& +'! PURPOSE',& +'! This module is generated at build by H5HL_buildiface.F90 to handle all the',& +'! detected REAL/INTEGER KINDs for APIs being passed those KINDs. Currently these ',& +'! are H5LT and H5TB APIs',& +'!',& +'! COPYRIGHT',& +'! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *',& +'! Copyright by The HDF Group. *',& +'! 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',& +'! H5HL_buildiface.F90',& +'!',& +'!*****' + + WRITE(11,'(a)') "MODULE H5TB" + + WRITE(11,'(A)') ' USE, INTRINSIC :: ISO_C_BINDING' + WRITE(11,'(A)') ' USE h5fortran_types' + WRITE(11,'(A)') ' USE H5TB_CONST' + WRITE(11,'(A)') ' IMPLICIT NONE' + +!*************** +! H5TB INTERFACES +!*************** + +! h5tbwrite_field_name_f + WRITE(11,'(A)') " INTERFACE h5tbwrite_field_name_f" + DO i = 1, num_rkinds + j = rkind(i) + WRITE(chr2,'(I2)') j + k =2 + WRITE(11,'(A)') " MODULE PROCEDURE h5tbwrite_field_name_kind_"//TRIM(ADJUSTL(chr2))//'_rank'//chr_rank(k) + END DO + WRITE(11,'(A)') " END INTERFACE" + +! h5tbread_field_name_f + WRITE(11,'(A)') " INTERFACE h5tbread_field_name_f" + DO i = 1, num_rkinds + j = rkind(i) + WRITE(chr2,'(I2)') j + k = 2 + WRITE(11,'(A)') " MODULE PROCEDURE h5tbread_field_name_kind_"//TRIM(ADJUSTL(chr2))//'_rank'//chr_rank(k) + END DO + WRITE(11,'(A)') " END INTERFACE" + +! h5tbwrite_field_index_f + WRITE(11,'(A)') " INTERFACE h5tbwrite_field_index_f" + DO i = 1, num_rkinds + j = rkind(i) + WRITE(chr2,'(I2)') j + k = 2 + WRITE(11,'(A)') " MODULE PROCEDURE h5tbwrite_field_index_kind_"//TRIM(ADJUSTL(chr2))//'_rank'//chr_rank(k) + END DO + WRITE(11,'(A)') " END INTERFACE" + +! h5tbread_field_index_f + WRITE(11,'(A)') " INTERFACE h5tbread_field_index_f" + DO i = 1, num_rkinds + j = rkind(i) + WRITE(chr2,'(I2)') j + k = 2 + WRITE(11,'(A)') " MODULE PROCEDURE h5tbread_field_index_kind_"//TRIM(ADJUSTL(chr2))//'_rank'//chr_rank(k) + END DO + WRITE(11,'(A)') " END INTERFACE" + +! h5tbinsert_field_f + WRITE(11,'(A)') " INTERFACE h5tbinsert_field_f" + DO i = 1, num_rkinds + j = rkind(i) + WRITE(chr2,'(I2)') j + k = 2 + WRITE(11,'(A)') " MODULE PROCEDURE h5tbinsert_field_kind_"//TRIM(ADJUSTL(chr2))//'_rank'//chr_rank(k) + END DO + WRITE(11,'(A)') " END INTERFACE" + + WRITE(11,'(A)') 'CONTAINS' + + !********************** + ! H5TB APIs + !********************** + + ! h5tbwrite_field_name_f + DO i = 1, num_rkinds + k = rkind(i) + WRITE(chr2,'(I2)') k + j = 2 +! DLL definitions for windows + WRITE(11,'(A)') '!DEC$if defined(BUILD_HDF5_HL_DLL)' + WRITE(11,'(A)') '!DEC$attributes dllexport :: h5tbwrite_field_name_kind_'//TRIM(ADJUSTL(chr2))//'_rank'//chr_rank(j) + WRITE(11,'(A)') '!DEC$endif' + +! Subroutine API + WRITE(11,'(A)') ' SUBROUTINE h5tbwrite_field_name_kind_'//TRIM(ADJUSTL(chr2))& + &//'_rank'//chr_rank(j)//'(loc_id,dset_name,field_name,start, nrecords,type_size,buf,errcode)' + WRITE(11,'(A)') ' IMPLICIT NONE' + WRITE(11,'(A)') ' INTEGER(hid_t) , INTENT(IN) :: loc_id' + WRITE(11,'(A)') ' CHARACTER(LEN=*), INTENT(IN) :: dset_name' + WRITE(11,'(A)') ' CHARACTER(LEN=*), INTENT(in) :: field_name' + WRITE(11,'(A)') ' INTEGER(hsize_t), INTENT(in) :: start' + WRITE(11,'(A)') ' INTEGER(hsize_t), INTENT(in) :: nrecords' + WRITE(11,'(A)') ' INTEGER(size_t), INTENT(in) :: type_size' + WRITE(11,'(A)') ' REAL(KIND='//TRIM(ADJUSTL(chr2))//'),INTENT(IN), DIMENSION(*), TARGET :: buf' + WRITE(11,'(A)') ' INTEGER :: errcode ' + WRITE(11,'(A)') ' INTEGER(size_t) :: namelen' + WRITE(11,'(A)') ' INTEGER(size_t) :: namelen1' + WRITE(11,'(A)') ' TYPE(C_PTR) :: f_ptr' + + WRITE(11,'(A)') f_ptr_line(j) + WRITE(11,'(A)') ' namelen = LEN(dset_name)' + WRITE(11,'(A)') ' namelen1 = LEN(field_name)' + WRITE(11,'(A)') & + ' errcode = h5tbwrite_field_name_c(loc_id,namelen,dset_name,namelen1,field_name,start,nrecords,type_size,f_ptr)' + WRITE(11,'(A)') ' END SUBROUTINE h5tbwrite_field_name_kind_'//TRIM(ADJUSTL(chr2))//'_rank'//chr_rank(j) + ENDDO + + ! h5tbread_field_name_f + DO i = 1, num_rkinds + k = rkind(i) + WRITE(chr2,'(I2)') k + j = 2 +! DLL definitions for windows + WRITE(11,'(A)') '!DEC$if defined(BUILD_HDF5_HL_DLL)' + WRITE(11,'(A)') '!DEC$attributes dllexport :: h5tbread_field_name_kind_'//TRIM(ADJUSTL(chr2))//'_rank'//chr_rank(j) + WRITE(11,'(A)') '!DEC$endif' + +! Subroutine API + WRITE(11,'(A)') ' SUBROUTINE h5tbread_field_name_kind_'//TRIM(ADJUSTL(chr2))& + &//'_rank'//chr_rank(j)//'(loc_id,dset_name,field_name,start, nrecords,type_size,buf,errcode)' + WRITE(11,'(A)') ' IMPLICIT NONE' + WRITE(11,'(A)') ' INTEGER(hid_t) , INTENT(IN) :: loc_id' + WRITE(11,'(A)') ' CHARACTER(LEN=*), INTENT(IN) :: dset_name' + WRITE(11,'(A)') ' CHARACTER(LEN=*), INTENT(in) :: field_name' + WRITE(11,'(A)') ' INTEGER(hsize_t), INTENT(in) :: start' + WRITE(11,'(A)') ' INTEGER(hsize_t), INTENT(in) :: nrecords' + WRITE(11,'(A)') ' INTEGER(size_t), INTENT(in) :: type_size' + WRITE(11,'(A)') ' REAL(KIND='//TRIM(ADJUSTL(chr2))//'),INTENT(IN), DIMENSION(*), TARGET :: buf' + WRITE(11,'(A)') ' INTEGER :: errcode ' + WRITE(11,'(A)') ' INTEGER(size_t) :: namelen' + WRITE(11,'(A)') ' INTEGER(size_t) :: namelen1' + WRITE(11,'(A)') ' TYPE(C_PTR) :: f_ptr' + + WRITE(11,'(A)') f_ptr_line(j) + WRITE(11,'(A)') ' namelen = LEN(dset_name)' + WRITE(11,'(A)') ' namelen1 = LEN(field_name)' + WRITE(11,'(A)') & + ' errcode = h5tbread_field_name_c(loc_id,namelen,dset_name,namelen1,field_name,start,nrecords,type_size,f_ptr)' + WRITE(11,'(A)') ' END SUBROUTINE h5tbread_field_name_kind_'//TRIM(ADJUSTL(chr2))//'_rank'//chr_rank(j) + ENDDO + + ! h5tbwrite_field_index_f + DO i = 1, num_rkinds + k = rkind(i) + WRITE(chr2,'(I2)') k + j = 2 +! DLL definitions for windows + WRITE(11,'(A)') '!DEC$if defined(BUILD_HDF5_HL_DLL)' + WRITE(11,'(A)') '!DEC$attributes dllexport :: h5tbwrite_field_index_kind_'//TRIM(ADJUSTL(chr2))//'_rank'//chr_rank(j) + WRITE(11,'(A)') '!DEC$endif' + +! Subroutine API + WRITE(11,'(A)') ' SUBROUTINE h5tbwrite_field_index_kind_'//TRIM(ADJUSTL(chr2))& + &//'_rank'//chr_rank(j)//'(loc_id,dset_name,field_index,start, nrecords,type_size,buf,errcode)' + WRITE(11,'(A)') ' IMPLICIT NONE' + WRITE(11,'(A)') ' INTEGER(hid_t) , INTENT(IN) :: loc_id' + WRITE(11,'(A)') ' CHARACTER(LEN=*), INTENT(IN) :: dset_name' + WRITE(11,'(A)') ' INTEGER, INTENT(in) :: field_index' + WRITE(11,'(A)') ' INTEGER(hsize_t), INTENT(in) :: start' + WRITE(11,'(A)') ' INTEGER(hsize_t), INTENT(in) :: nrecords' + WRITE(11,'(A)') ' INTEGER(size_t), INTENT(in) :: type_size' + WRITE(11,'(A)') ' REAL(KIND='//TRIM(ADJUSTL(chr2))//'),INTENT(IN), DIMENSION(*), TARGET :: buf' + WRITE(11,'(A)') ' INTEGER :: errcode ' + WRITE(11,'(A)') ' INTEGER(size_t) :: namelen' + WRITE(11,'(A)') ' TYPE(C_PTR) :: f_ptr' + + WRITE(11,'(A)') f_ptr_line(j) + WRITE(11,'(A)') ' namelen = LEN(dset_name)' + WRITE(11,'(A)') & + ' errcode = h5tbwrite_field_index_c(loc_id,namelen,dset_name,field_index,start,nrecords,type_size,f_ptr)' + WRITE(11,'(A)') ' END SUBROUTINE h5tbwrite_field_index_kind_'//TRIM(ADJUSTL(chr2))//'_rank'//chr_rank(j) + ENDDO + + ! h5tbread_field_index_f + DO i = 1, num_rkinds + k = rkind(i) + WRITE(chr2,'(I2)') k + j = 2 +! DLL definitions for windows + WRITE(11,'(A)') '!DEC$if defined(BUILD_HDF5_HL_DLL)' + WRITE(11,'(A)') '!DEC$attributes dllexport :: h5tbread_field_index_kind_'//TRIM(ADJUSTL(chr2))//'_rank'//chr_rank(j) + WRITE(11,'(A)') '!DEC$endif' + +! Subroutine API + WRITE(11,'(A)') ' SUBROUTINE h5tbread_field_index_kind_'//TRIM(ADJUSTL(chr2))& + &//'_rank'//chr_rank(j)//'(loc_id,dset_name,field_index,start, nrecords,type_size,buf,errcode)' + WRITE(11,'(A)') ' IMPLICIT NONE' + WRITE(11,'(A)') ' INTEGER(hid_t) , INTENT(IN) :: loc_id' + WRITE(11,'(A)') ' CHARACTER(LEN=*), INTENT(IN) :: dset_name' + WRITE(11,'(A)') ' INTEGER, INTENT(in) :: field_index' + WRITE(11,'(A)') ' INTEGER(hsize_t), INTENT(in) :: start' + WRITE(11,'(A)') ' INTEGER(hsize_t), INTENT(in) :: nrecords' + WRITE(11,'(A)') ' INTEGER(size_t), INTENT(in) :: type_size' + WRITE(11,'(A)') ' REAL(KIND='//TRIM(ADJUSTL(chr2))//'),INTENT(IN), DIMENSION(*), TARGET :: buf' + WRITE(11,'(A)') ' INTEGER :: errcode ' + WRITE(11,'(A)') ' INTEGER(size_t) :: namelen' + WRITE(11,'(A)') ' TYPE(C_PTR) :: f_ptr' + + WRITE(11,'(A)') f_ptr_line(j) + WRITE(11,'(A)') ' namelen = LEN(dset_name)' + WRITE(11,'(A)') & + ' errcode = h5tbread_field_index_c(loc_id,namelen,dset_name,field_index,start,nrecords,type_size,f_ptr)' + WRITE(11,'(A)') ' END SUBROUTINE h5tbread_field_index_kind_'//TRIM(ADJUSTL(chr2))//'_rank'//chr_rank(j) + ENDDO + + ! h5tbinsert_field_f + DO i = 1, num_rkinds + k = rkind(i) + WRITE(chr2,'(I2)') k + j = 2 +! DLL definitions for windows + WRITE(11,'(A)') '!DEC$if defined(BUILD_HDF5_HL_DLL)' + WRITE(11,'(A)') '!DEC$attributes dllexport :: h5tbinsert_field_kind_'//TRIM(ADJUSTL(chr2))//'_rank'//chr_rank(j) + WRITE(11,'(A)') '!DEC$endif' + +! Subroutine API + WRITE(11,'(A)') ' SUBROUTINE h5tbinsert_field_kind_'//TRIM(ADJUSTL(chr2))& + &//'_rank'//chr_rank(j)//'(loc_id,dset_name,field_name,field_type,field_index,buf,errcode)' + WRITE(11,'(A)') ' IMPLICIT NONE' + WRITE(11,'(A)') ' INTEGER(hid_t), INTENT(in) :: loc_id' + WRITE(11,'(A)') ' CHARACTER(LEN=*), INTENT(in) :: dset_name' + WRITE(11,'(A)') ' CHARACTER(LEN=*), INTENT(in) :: field_name' + WRITE(11,'(A)') ' INTEGER(hid_t), INTENT(in) :: field_type' + WRITE(11,'(A)') ' INTEGER, INTENT(in) :: field_index' + WRITE(11,'(A)') ' REAL(KIND='//TRIM(ADJUSTL(chr2))//'), INTENT(in), DIMENSION(*), TARGET :: buf' + WRITE(11,'(A)') ' INTEGER(size_t) :: namelen' + WRITE(11,'(A)') ' INTEGER(size_t) :: namelen1' + WRITE(11,'(A)') ' INTEGER :: errcode' + WRITE(11,'(A)') ' TYPE(C_PTR) :: f_ptr' + + WRITE(11,'(A)') f_ptr_line(j) + WRITE(11,'(A)') ' namelen = LEN(dset_name)' + WRITE(11,'(A)') ' namelen1 = LEN(field_name)' + WRITE(11,'(A)') & + ' errcode = h5tbinsert_field_c(loc_id,namelen,dset_name,namelen1,field_name,field_type,field_index,f_ptr)' + WRITE(11,'(A)') ' END SUBROUTINE h5tbinsert_field_kind_'//TRIM(ADJUSTL(chr2))//'_rank'//chr_rank(j) + ENDDO + + WRITE(11,'(A)') 'END MODULE H5TB' + + CLOSE(11) + +END PROGRAM H5HL_buildiface + + + diff --git a/hl/fortran/src/H5IMfc.c b/hl/fortran/src/H5IMfc.c index 6acd410..7ad50d6 100644 --- a/hl/fortran/src/H5IMfc.c +++ b/hl/fortran/src/H5IMfc.c @@ -39,7 +39,7 @@ */ int_f -nh5immake_image_8bit_c (hid_t_f *loc_id, +h5immake_image_8bit_c (hid_t_f *loc_id, size_t_f *namelen, _fcd name, hsize_t_f *width, @@ -100,7 +100,7 @@ done: */ int_f -nh5imread_image_c (hid_t_f *loc_id, +h5imread_image_c (hid_t_f *loc_id, size_t_f *namelen, _fcd name, int_f *buf) @@ -153,7 +153,7 @@ done: */ int_f -nh5immake_image_24bit_c (hid_t_f *loc_id, +h5immake_image_24bit_c (hid_t_f *loc_id, size_t_f *namelen, _fcd name, size_t_f *ilen, @@ -222,7 +222,7 @@ done: */ int_f -nh5imget_image_info_c(hid_t_f *loc_id, +h5imget_image_info_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name, hsize_t_f *width, @@ -307,7 +307,7 @@ done: */ int_f -nh5imis_image_c(hid_t_f *loc_id, +h5imis_image_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name) { @@ -356,7 +356,7 @@ nh5imis_image_c(hid_t_f *loc_id, */ int_f -nh5immake_palette_c (hid_t_f *loc_id, +h5immake_palette_c (hid_t_f *loc_id, size_t_f *namelen, _fcd name, hsize_t_f *dims, @@ -411,7 +411,7 @@ done: */ int_f -nh5imlink_palette_c (hid_t_f *loc_id, +h5imlink_palette_c (hid_t_f *loc_id, size_t_f *namelen, _fcd name, size_t_f *ilen, @@ -476,7 +476,7 @@ done: */ int_f -nh5imunlink_palette_c (hid_t_f *loc_id, +h5imunlink_palette_c (hid_t_f *loc_id, size_t_f *namelen, _fcd name, size_t_f *ilen, @@ -542,7 +542,7 @@ done: */ int_f -nh5imget_npalettes_c(hid_t_f *loc_id, +h5imget_npalettes_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name, hsize_t_f *npals) @@ -604,7 +604,7 @@ done: int_f -nh5imget_palette_info_c(hid_t_f *loc_id, +h5imget_palette_info_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name, int_f *pal_number, @@ -671,7 +671,7 @@ done: int_f -nh5imget_palette_c(hid_t_f *loc_id, +h5imget_palette_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name, int_f *pal_number, @@ -729,7 +729,7 @@ done: */ int_f -nh5imis_palette_c(hid_t_f *loc_id, +h5imis_palette_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name) { diff --git a/hl/fortran/src/H5IMff.F90 b/hl/fortran/src/H5IMff.F90 new file mode 100644 index 0000000..4408dda --- /dev/null +++ b/hl/fortran/src/H5IMff.F90 @@ -0,0 +1,667 @@ +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! 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. * +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! +! +! This file contains FORTRAN interfaces for H5IM functions +! +! NOTES +! +! _____ __ __ _____ ____ _____ _______ _ _ _______ +! |_ _| \/ | __ \ / __ \| __ \__ __|/\ | \ | |__ __| +! **** | | | \ / | |__) | | | | |__) | | | / \ | \| | | | **** +! **** | | | |\/| | ___/| | | | _ / | | / /\ \ | . ` | | | **** +! **** _| |_| | | | | | |__| | | \ \ | |/ ____ \| |\ | | | **** +! |_____|_| |_|_| \____/|_| \_\ |_/_/ \_\_| \_| |_| +! +! If you add a new function here then you MUST add the function name to the +! Windows dll file 'hdf5_hl_fortrandll.def.in' in the hl/fortran/src directory. +! This is needed for Windows based operating systems. +! + +MODULE h5im + USE, INTRINSIC :: ISO_C_BINDING + USE h5fortran_types + USE hdf5 +CONTAINS + +!------------------------------------------------------------------------- +! Function: h5immake_image_8bit_f +! +! Purpose: Creates and writes an image an 8 bit image +! +! Return: Success: 0, Failure: -1 +! +! Programmer: pvn@ncsa.uiuc.edu +! +! Date: October 05, 2004 +! +! Comments: +! +! Modifications: +! +!------------------------------------------------------------------------- + + SUBROUTINE h5immake_image_8bit_f(loc_id,& + dset_name,& + width,& + height,& + buf,& + errcode ) + + IMPLICIT NONE + + INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier + CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset + INTEGER(hsize_t), INTENT(in) :: width ! width of image + INTEGER(hsize_t), INTENT(in) :: height ! height of image + INTEGER, INTENT(in), DIMENSION(*) :: buf ! buffer + INTEGER :: errcode ! error code + INTEGER(size_t) :: namelen ! name length + + INTERFACE + INTEGER FUNCTION h5immake_image_8bit_c(loc_id,namelen,dset_name,width,height,buf) & + BIND(C,NAME='h5immake_image_8bit_c') + IMPORT :: C_CHAR + IMPORT :: HID_T, SIZE_T, HSIZE_T + IMPLICIT NONE + INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier + INTEGER(size_t) :: namelen ! length of name buffer + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: dset_name ! name of the dataset + INTEGER(hsize_t), INTENT(in) :: width ! width of image + INTEGER(hsize_t), INTENT(in) :: height ! height of image + INTEGER , INTENT(in), DIMENSION(*) :: buf ! buffer + END FUNCTION h5immake_image_8bit_c + END INTERFACE + + namelen = LEN(dset_name) + errcode = h5immake_image_8bit_c(loc_id,namelen,dset_name,width,height,buf) + + END SUBROUTINE h5immake_image_8bit_f + +!------------------------------------------------------------------------- +! Function: h5imread_image_f +! +! Purpose: Reads image data from disk. +! +! Return: Success: 0, Failure: -1 +! +! Programmer: pvn@ncsa.uiuc.edu +! +! Date: October 05, 2004 +! +! Comments: +! +! Modifications: +! +!------------------------------------------------------------------------- + SUBROUTINE h5imread_image_f(loc_id,& + dset_name,& + buf,& + errcode ) + + IMPLICIT NONE + + INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier + CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset + INTEGER, INTENT(inout), DIMENSION(*) :: buf ! buffer + INTEGER :: errcode ! error code + INTEGER(size_t) :: namelen ! name length + + INTERFACE + INTEGER FUNCTION h5imread_image_c(loc_id,namelen,dset_name,buf) & + BIND(C,NAME='h5imread_image_c') + IMPORT :: C_CHAR + IMPORT :: HID_T, SIZE_T + IMPLICIT NONE + INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier + INTEGER(size_t) :: namelen ! length of name buffer + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: dset_name ! name of the dataset + INTEGER, INTENT(inout), DIMENSION(*) :: buf ! buffer + END FUNCTION h5imread_image_c + END INTERFACE + + namelen = LEN(dset_name) + errcode = h5imread_image_c(loc_id,namelen,dset_name,buf) + + END SUBROUTINE h5imread_image_f + +!------------------------------------------------------------------------- +! Function: h5immake_image_24bit_f +! +! Purpose: Creates and writes an image a 24 bit image +! +! Return: Success: 0, Failure: -1 +! +! Programmer: pvn@ncsa.uiuc.edu +! +! Date: October 05, 2004 +! +! Comments: +! +! Modifications: +! +!------------------------------------------------------------------------- + + SUBROUTINE h5immake_image_24bit_f(loc_id,& + dset_name,& + width,& + height,& + il,& + buf,& + errcode ) + + IMPLICIT NONE + + INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier + CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset + INTEGER(hsize_t), INTENT(in) :: width ! width of image + INTEGER(hsize_t), INTENT(in) :: height ! height of image + CHARACTER(len=*), INTENT(in) :: il ! interlace + INTEGER, INTENT(in), DIMENSION(*) :: buf ! buffer + INTEGER :: errcode ! error code + INTEGER(size_t) :: namelen ! name length + INTEGER(size_t) :: ILEN ! name length + + INTERFACE + INTEGER FUNCTION h5immake_image_24bit_c(loc_id,namelen,dset_name,ILEN,il,width,height,buf) & + BIND(C,NAME='h5immake_image_24bit_c') + IMPORT :: C_CHAR + IMPORT :: HID_T, SIZE_T, HSIZE_T + IMPLICIT NONE + INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: dset_name ! name of the dataset + INTEGER(hsize_t), INTENT(in) :: width ! width of image + INTEGER(hsize_t), INTENT(in) :: height ! height of image + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: il ! interlace + INTEGER, INTENT(in), DIMENSION(*) :: buf ! buffer + INTEGER(size_t) :: namelen ! length of name buffer + INTEGER(size_t) :: ILEN ! name length + + END FUNCTION h5immake_image_24bit_c + END INTERFACE + + namelen = LEN(dset_name) + ILEN = LEN(il) + errcode = h5immake_image_24bit_c(loc_id,namelen,dset_name,ILEN,il,width,height,buf) + + END SUBROUTINE h5immake_image_24bit_f + +!------------------------------------------------------------------------- +! Function: h5imget_image_info_f +! +! Purpose: Gets information about an image dataset (dimensions, interlace mode +! and number of associated palettes). +! +! Return: Success: 0, Failure: -1 +! +! Programmer: pvn@ncsa.uiuc.edu +! +! Date: October 05, 2004 +! +! Comments: +! +! Modifications: +! +!------------------------------------------------------------------------- + + SUBROUTINE h5imget_image_info_f(loc_id,& + dset_name,& + width,& + height,& + planes,& + interlace,& + npals,& + errcode ) + + IMPLICIT NONE + + INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier + CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset + INTEGER(hsize_t), INTENT(inout) :: width ! width of image + INTEGER(hsize_t), INTENT(inout) :: height ! height of image + INTEGER(hsize_t), INTENT(inout) :: planes ! color planes + INTEGER(hsize_t), INTENT(inout) :: npals ! palettes + CHARACTER(len=*), INTENT(inout) :: interlace ! interlace + INTEGER :: errcode ! error code + INTEGER(size_t) :: namelen ! name length + INTEGER(size_t) :: ILEN ! name length + + INTERFACE + INTEGER FUNCTION h5imget_image_info_c(loc_id,namelen,dset_name,width,height,planes,npals,ILEN,interlace) & + BIND(C,NAME='h5imget_image_info_c') + IMPORT :: C_CHAR + IMPORT :: HID_T, SIZE_T, HSIZE_T + IMPLICIT NONE + INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: dset_name ! name of the dataset + INTEGER(hsize_t), INTENT(inout) :: width ! width of image + INTEGER(hsize_t), INTENT(inout) :: height ! height of image + INTEGER(hsize_t), INTENT(inout) :: planes ! color planes + INTEGER(hsize_t), INTENT(inout) :: npals ! palettes + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(inout) :: interlace ! interlace + INTEGER(size_t) :: namelen ! name length + INTEGER(size_t) :: ILEN ! name length + END FUNCTION h5imget_image_info_c + END INTERFACE + + namelen = LEN(dset_name) + ILEN = LEN(interlace) + errcode = h5imget_image_info_c(loc_id,namelen,dset_name,width,height,planes,npals,ILEN,interlace) + + END SUBROUTINE h5imget_image_info_f + +!------------------------------------------------------------------------- +! Function: h5imis_image_f +! +! Purpose: Inquires if a dataset is an image +! +! Return: Success: 0, Failure: -1 +! +! Programmer: pvn@ncsa.uiuc.edu +! +! Date: October 05, 2004 +! +! Comments: +! +! Modifications: +! +!------------------------------------------------------------------------- + + INTEGER FUNCTION h5imis_image_f(loc_id,& + dset_name) + + IMPLICIT NONE + + INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier + CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset + INTEGER :: errcode ! error code + INTEGER(size_t) :: namelen ! name length + + INTERFACE + INTEGER FUNCTION h5imis_image_c(loc_id,namelen,dset_name) & + BIND(C,NAME='h5imis_image_c') + IMPORT :: C_CHAR + IMPORT :: HID_T, SIZE_T + IMPLICIT NONE + INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier + INTEGER(size_t) :: namelen ! length of name buffer + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: dset_name ! name of the dataset + END FUNCTION h5imis_image_c + END INTERFACE + + namelen = LEN(dset_name) + errcode = h5imis_image_c(loc_id,namelen,dset_name) + h5imis_image_f = errcode + + END FUNCTION h5imis_image_f + + +!------------------------------------------------------------------------- +! Function: h5immake_palette_f +! +! Purpose: Creates and writes a palette +! +! Return: Success: 0, Failure: -1 +! +! Programmer: pvn@ncsa.uiuc.edu +! +! Date: October 06, 2004 +! +! Comments: +! +! Modifications: +! +!------------------------------------------------------------------------- + + SUBROUTINE h5immake_palette_f(loc_id,& + dset_name,& + pal_dims,& + buf,& + errcode ) + + IMPLICIT NONE + + INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier + CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset + INTEGER(hsize_t), INTENT(in), DIMENSION(*) :: pal_dims ! dimensions + INTEGER, INTENT(in), DIMENSION(*) :: buf ! buffer + INTEGER :: errcode ! error code + INTEGER(size_t) :: namelen ! name length + + INTERFACE + INTEGER FUNCTION h5immake_palette_c(loc_id,namelen,dset_name,pal_dims,buf) & + BIND(C,NAME='h5immake_palette_c') + IMPORT :: C_CHAR + IMPORT :: HID_T, SIZE_T, HSIZE_T + IMPLICIT NONE + INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier + INTEGER(size_t) :: namelen ! length of name buffer + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: dset_name ! name of the dataset + INTEGER(hsize_t), INTENT(in), DIMENSION(*) :: pal_dims ! dimensions + INTEGER, INTENT(in), DIMENSION(*) :: buf ! buffer + END FUNCTION h5immake_palette_c + END INTERFACE + + namelen = LEN(dset_name) + errcode = h5immake_palette_c(loc_id,namelen,dset_name,pal_dims,buf) + + END SUBROUTINE h5immake_palette_f + +!------------------------------------------------------------------------- +! Function: h5imlink_palette_f +! +! Purpose: This function attaches a palette to an existing image dataset +! +! Return: Success: 0, Failure: -1 +! +! Programmer: pvn@ncsa.uiuc.edu +! +! Date: October 06, 2004 +! +! Comments: +! +! Modifications: +! +!------------------------------------------------------------------------- + + SUBROUTINE h5imlink_palette_f(loc_id,& + dset_name,& + pal_name,& + errcode ) + + IMPLICIT NONE + + INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier + CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset + CHARACTER(len=*), INTENT(in) :: pal_name ! palette name + INTEGER :: errcode ! error code + INTEGER(size_t) :: namelen ! name length + INTEGER(size_t) :: ILEN ! name length + + INTERFACE + INTEGER FUNCTION h5imlink_palette_c(loc_id,namelen,dset_name,ILEN,pal_name) & + BIND(C,NAME='h5imlink_palette_c') + IMPORT :: C_CHAR + IMPORT :: HID_T, SIZE_T + IMPLICIT NONE + INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: dset_name ! name of the dataset + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: pal_name ! palette name + INTEGER(size_t) :: namelen ! name length + INTEGER(size_t) :: ILEN ! name length + END FUNCTION h5imlink_palette_c + END INTERFACE + + namelen = LEN(dset_name) + ILEN = LEN(pal_name) + errcode = h5imlink_palette_c(loc_id,namelen,dset_name,ILEN,pal_name) + + END SUBROUTINE h5imlink_palette_f + + +!------------------------------------------------------------------------- +! Function: h5imunlink_palette_f +! +! Purpose: This function dettaches a palette to an existing image dataset +! +! Return: Success: 0, Failure: -1 +! +! Programmer: pvn@ncsa.uiuc.edu +! +! Date: October 06, 2004 +! +! Comments: +! +! Modifications: +! +!------------------------------------------------------------------------- + + SUBROUTINE h5imunlink_palette_f(loc_id,& + dset_name,& + pal_name,& + errcode ) + + IMPLICIT NONE + + INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier + CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset + CHARACTER(len=*), INTENT(in) :: pal_name ! palette name + INTEGER :: errcode ! error code + INTEGER(size_t) :: namelen ! name length + INTEGER(size_t) :: ILEN ! name length + + INTERFACE + INTEGER FUNCTION h5imunlink_palette_c(loc_id,namelen,dset_name,ILEN,pal_name) & + BIND(C,NAME='h5imunlink_palette_c') + IMPORT :: C_CHAR + IMPORT :: HID_T, SIZE_T + IMPLICIT NONE + INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: dset_name ! name of the dataset + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: pal_name ! palette name + INTEGER(size_t) :: namelen ! name length + INTEGER(size_t) :: ILEN ! name length + END FUNCTION h5imunlink_palette_c + END INTERFACE + + namelen = LEN(dset_name) + ILEN = LEN(pal_name) + errcode = h5imunlink_palette_c(loc_id,namelen,dset_name,ILEN,pal_name) + + END SUBROUTINE h5imunlink_palette_f + +!------------------------------------------------------------------------- +! Function: h5imget_npalettes_f +! +! Purpose: Gets the number of palettes associated to an image +! +! Return: Success: 0, Failure: -1 +! +! Programmer: pvn@ncsa.uiuc.edu +! +! Date: October 05, 2004 +! +! Comments: +! +! Modifications: +! +!------------------------------------------------------------------------- + + SUBROUTINE h5imget_npalettes_f(loc_id,& + dset_name,& + npals,& + errcode ) + + IMPLICIT NONE + + INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier + CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset + INTEGER(hsize_t), INTENT(inout) :: npals ! palettes + INTEGER :: errcode ! error code + INTEGER(size_t) :: namelen ! name length + + INTERFACE + INTEGER FUNCTION h5imget_npalettes_c(loc_id,namelen,dset_name,npals) & + BIND(C,NAME='h5imget_npalettes_c') + IMPORT :: C_CHAR + IMPORT :: HID_T, SIZE_T, HSIZE_T + IMPLICIT NONE + INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: dset_name ! name of the dataset + INTEGER(hsize_t), INTENT(inout) :: npals ! palettes + INTEGER(size_t) :: namelen ! name length + END FUNCTION h5imget_npalettes_c + END INTERFACE + + namelen = LEN(dset_name) + errcode = h5imget_npalettes_c(loc_id,namelen,dset_name,npals) + + END SUBROUTINE h5imget_npalettes_f + + +!------------------------------------------------------------------------- +! Function: h5imget_palette_info_f +! +! Purpose: Get palette information +! +! Return: Success: 0, Failure: -1 +! +! Programmer: pvn@ncsa.uiuc.edu +! +! Date: October 06, 2004 +! +! Comments: +! +! Modifications: +! +!------------------------------------------------------------------------- + + SUBROUTINE h5imget_palette_info_f(loc_id,& + dset_name,& + pal_number,& + dims,& + errcode ) + + IMPLICIT NONE + + INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier + CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset + INTEGER, INTENT(in) :: pal_number ! palette number + INTEGER(hsize_t), DIMENSION(*), INTENT(inout) :: dims ! dimensions + INTEGER :: errcode ! error code + INTEGER(size_t) :: namelen ! name length + + INTERFACE + INTEGER FUNCTION h5imget_palette_info_c(loc_id,namelen,dset_name,pal_number,dims) & + BIND(C,NAME='h5imget_palette_info_c') + IMPORT :: C_CHAR + IMPORT :: HID_T, SIZE_T, HSIZE_T + IMPLICIT NONE + INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: dset_name ! name of the dataset + INTEGER, INTENT(in) :: pal_number ! palette number + INTEGER(hsize_t), DIMENSION(*), INTENT(inout) :: dims ! dimensions + INTEGER(size_t) :: namelen ! name length + END FUNCTION h5imget_palette_info_c + END INTERFACE + + namelen = LEN(dset_name) + errcode = h5imget_palette_info_c(loc_id,namelen,dset_name,pal_number,dims) + + END SUBROUTINE h5imget_palette_info_f + +!------------------------------------------------------------------------- +! Function: h5imget_palette_f +! +! Purpose: Reads palette +! +! Return: Success: 0, Failure: -1 +! +! Programmer: pvn@ncsa.uiuc.edu +! +! Date: October 06, 2004 +! +! Comments: +! +! Modifications: +! +!------------------------------------------------------------------------- + + SUBROUTINE h5imget_palette_f(loc_id,& + dset_name,& + pal_number,& + buf,& + errcode ) + + IMPLICIT NONE + + INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier + CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset + INTEGER, INTENT(in) :: pal_number ! palette number + INTEGER, INTENT(inout), DIMENSION(*) :: buf ! buffer + INTEGER :: errcode ! error code + INTEGER(size_t) :: namelen ! name length + + INTERFACE + INTEGER FUNCTION h5imget_palette_c(loc_id,namelen,dset_name,pal_number,buf) & + BIND(C,NAME='h5imget_palette_c') + IMPORT :: C_CHAR + IMPORT :: HID_T, SIZE_T + IMPLICIT NONE + INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier + INTEGER(size_t) :: namelen ! length of name buffer + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: dset_name ! name of the dataset + INTEGER, INTENT(in) :: pal_number ! palette number + INTEGER, INTENT(inout), DIMENSION(*) :: buf ! buffer + END FUNCTION h5imget_palette_c + END INTERFACE + + namelen = LEN(dset_name) + errcode = h5imget_palette_c(loc_id,namelen,dset_name,pal_number,buf) + + END SUBROUTINE h5imget_palette_f + + +!------------------------------------------------------------------------- +! Function: h5imis_palette_f +! +! Purpose: Inquires if a dataset is a palette +! +! Return: true, false, fail +! +! Programmer: pvn@ncsa.uiuc.edu +! +! Date: October 06, 2004 +! +! Comments: +! +! Modifications: +! +!------------------------------------------------------------------------- + + INTEGER FUNCTION h5imis_palette_f(loc_id,& + dset_name) + + IMPLICIT NONE + + INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier + CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset + INTEGER :: errcode ! error code + INTEGER(size_t) :: namelen ! name length + + INTERFACE + INTEGER FUNCTION h5imis_palette_c(loc_id,namelen,dset_name) & + BIND(C,NAME='h5imis_palette_c') + IMPORT :: C_CHAR + IMPORT :: HID_T, SIZE_T + IMPLICIT NONE + INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier + INTEGER(size_t) :: namelen ! length of name buffer + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: dset_name ! name of the dataset + END FUNCTION h5imis_palette_c + END INTERFACE + + namelen = LEN(dset_name) + errcode = h5imis_palette_c(loc_id,namelen,dset_name) + h5imis_palette_f = errcode + + END FUNCTION h5imis_palette_f + +END MODULE H5IM + + + + + diff --git a/hl/fortran/src/H5IMff.f90 b/hl/fortran/src/H5IMff.f90 deleted file mode 100644 index 50c6d8b..0000000 --- a/hl/fortran/src/H5IMff.f90 +++ /dev/null @@ -1,783 +0,0 @@ -! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -! 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. * -! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -! -! -! This file contains FORTRAN90 interfaces for H5IM functions -! - -module h5im -use h5fortran_types -use hdf5 -contains - - -!------------------------------------------------------------------------- -! Function: h5immake_image_8bit_f -! -! Purpose: Creates and writes an image an 8 bit image -! -! Return: Success: 0, Failure: -1 -! -! Programmer: pvn@ncsa.uiuc.edu -! -! Date: October 05, 2004 -! -! Comments: -! -! Modifications: -! -!------------------------------------------------------------------------- - -subroutine h5immake_image_8bit_f(loc_id,& - dset_name,& - width,& - height,& - buf,& - errcode ) - - implicit none - -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5immake_image_8bit_f -!DEC$endif -! - - integer(hid_t), intent(in) :: loc_id ! file or group identifier - character(len=*), intent(in) :: dset_name ! name of the dataset - integer(hsize_t), intent(in) :: width ! width of image - integer(hsize_t), intent(in) :: height ! height of image - integer, intent(in), dimension(*) :: buf ! buffer - integer :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - - interface - integer function h5immake_image_8bit_c(loc_id,namelen,dset_name,width,height,buf) - use h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5IMMAKE_IMAGE_8BIT_C'::h5immake_image_8bit_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - integer(hid_t), intent(in) :: loc_id ! file or group identifier - integer(size_t) :: namelen ! length of name buffer - character(len=*), intent(in) :: dset_name ! name of the dataset - integer(hsize_t), intent(in) :: width ! width of image - integer(hsize_t), intent(in) :: height ! height of image - integer , intent(in), dimension(*) :: buf ! buffer - end function h5immake_image_8bit_c - end interface - - namelen = len(dset_name) - errcode = h5immake_image_8bit_c(loc_id,namelen,dset_name,width,height,buf) - -end subroutine h5immake_image_8bit_f - - - -!------------------------------------------------------------------------- -! Function: h5imread_image_f -! -! Purpose: Reads image data from disk. -! -! Return: Success: 0, Failure: -1 -! -! Programmer: pvn@ncsa.uiuc.edu -! -! Date: October 05, 2004 -! -! Comments: -! -! Modifications: -! -!------------------------------------------------------------------------- - - -subroutine h5imread_image_f(loc_id,& - dset_name,& - buf,& - errcode ) - - implicit none - -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5imread_image_f -!DEC$endif -! - integer(hid_t), intent(in) :: loc_id ! file or group identifier - character(len=*), intent(in) :: dset_name ! name of the dataset - integer, intent(inout), dimension(*) :: buf ! buffer - integer :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - - interface - integer function h5imread_image_c(loc_id,namelen,dset_name,buf) - use h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5IMREAD_IMAGE_C'::h5imread_image_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - integer(hid_t), intent(in) :: loc_id ! file or group identifier - integer(size_t) :: namelen ! length of name buffer - character(len=*), intent(in) :: dset_name ! name of the dataset - integer, intent(inout), dimension(*) :: buf ! buffer - end function h5imread_image_c - end interface - - namelen = len(dset_name) - errcode = h5imread_image_c(loc_id,namelen,dset_name,buf) - -end subroutine h5imread_image_f - - -!------------------------------------------------------------------------- -! Function: h5immake_image_24bit_f -! -! Purpose: Creates and writes an image a 24 bit image -! -! Return: Success: 0, Failure: -1 -! -! Programmer: pvn@ncsa.uiuc.edu -! -! Date: October 05, 2004 -! -! Comments: -! -! Modifications: -! -!------------------------------------------------------------------------- - -subroutine h5immake_image_24bit_f(loc_id,& - dset_name,& - width,& - height,& - il,& - buf,& - errcode ) - - implicit none - -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5immake_image_24bit_f -!DEC$endif -! - - integer(hid_t), intent(in) :: loc_id ! file or group identifier - character(len=*), intent(in) :: dset_name ! name of the dataset - integer(hsize_t), intent(in) :: width ! width of image - integer(hsize_t), intent(in) :: height ! height of image - character(len=*), intent(in) :: il ! interlace - integer, intent(in), dimension(*) :: buf ! buffer - integer :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - integer(size_t) :: ilen ! name length - - interface - integer function h5immake_image_24bit_c(loc_id,namelen,dset_name,ilen,il,width,height,buf) - use h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5IMMAKE_IMAGE_24BIT_C'::h5immake_image_24bit_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - !DEC$ATTRIBUTES reference :: il - integer(hid_t), intent(in) :: loc_id ! file or group identifier - character(len=*), intent(in) :: dset_name ! name of the dataset - integer(hsize_t), intent(in) :: width ! width of image - integer(hsize_t), intent(in) :: height ! height of image - character(len=*), intent(in) :: il ! interlace - integer, intent(in), dimension(*) :: buf ! buffer - integer(size_t) :: namelen ! length of name buffer - integer(size_t) :: ilen ! name length - - end function h5immake_image_24bit_c - end interface - - namelen = len(dset_name) - ilen = len(il) - errcode = h5immake_image_24bit_c(loc_id,namelen,dset_name,ilen,il,width,height,buf) - -end subroutine h5immake_image_24bit_f - - -!------------------------------------------------------------------------- -! Function: h5imget_image_info_f -! -! Purpose: Gets information about an image dataset (dimensions, interlace mode -! and number of associated palettes). -! -! Return: Success: 0, Failure: -1 -! -! Programmer: pvn@ncsa.uiuc.edu -! -! Date: October 05, 2004 -! -! Comments: -! -! Modifications: -! -!------------------------------------------------------------------------- - -subroutine h5imget_image_info_f(loc_id,& - dset_name,& - width,& - height,& - planes,& - interlace,& - npals,& - errcode ) - - implicit none - -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5imget_image_info_f -!DEC$endif -! - - integer(hid_t), intent(in) :: loc_id ! file or group identifier - character(len=*), intent(in) :: dset_name ! name of the dataset - integer(hsize_t), intent(inout) :: width ! width of image - integer(hsize_t), intent(inout) :: height ! height of image - integer(hsize_t), intent(inout) :: planes ! color planes - integer(hsize_t), intent(inout) :: npals ! palettes - character(len=*), intent(inout) :: interlace ! interlace - integer :: errcode ! error code - integer(size_t) :: namelen ! name length - integer(size_t) :: ilen ! name length - - interface - integer function h5imget_image_info_c(loc_id,namelen,dset_name,width,height,planes,npals,ilen,interlace) - use h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5IMGET_IMAGE_INFO_C'::h5imget_image_info_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - !DEC$ATTRIBUTES reference :: interlace - integer(hid_t), intent(in) :: loc_id ! file or group identifier - character(len=*), intent(in) :: dset_name ! name of the dataset - integer(hsize_t), intent(inout) :: width ! width of image - integer(hsize_t), intent(inout) :: height ! height of image - integer(hsize_t), intent(inout) :: planes ! color planes - integer(hsize_t), intent(inout) :: npals ! palettes - character(len=*), intent(inout) :: interlace ! interlace - integer(size_t) :: namelen ! name length - integer(size_t) :: ilen ! name length - end function h5imget_image_info_c - end interface - - namelen = len(dset_name) - ilen = len(interlace) - errcode = h5imget_image_info_c(loc_id,namelen,dset_name,width,height,planes,npals,ilen,interlace) - -end subroutine h5imget_image_info_f - - -!------------------------------------------------------------------------- -! Function: h5imis_image_f -! -! Purpose: Inquires if a dataset is an image -! -! Return: Success: 0, Failure: -1 -! -! Programmer: pvn@ncsa.uiuc.edu -! -! Date: October 05, 2004 -! -! Comments: -! -! Modifications: -! -!------------------------------------------------------------------------- - -integer function h5imis_image_f(loc_id,& - dset_name) - - implicit none - -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5imis_image_f -!DEC$endif -! - - integer(hid_t), intent(in) :: loc_id ! file or group identifier - character(len=*), intent(in) :: dset_name ! name of the dataset - integer :: errcode ! error code - integer(size_t) :: namelen ! name length - - interface - integer function h5imis_image_c(loc_id,namelen,dset_name) - use h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5IMIS_IMAGE_C'::h5imis_image_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - integer(hid_t), intent(in) :: loc_id ! file or group identifier - integer(size_t) :: namelen ! length of name buffer - character(len=*), intent(in) :: dset_name ! name of the dataset - end function h5imis_image_c - end interface - - namelen = len(dset_name) - errcode = h5imis_image_c(loc_id,namelen,dset_name) - h5imis_image_f = errcode - -end function h5imis_image_f - - -!------------------------------------------------------------------------- -! Function: h5immake_palette_f -! -! Purpose: Creates and writes a palette -! -! Return: Success: 0, Failure: -1 -! -! Programmer: pvn@ncsa.uiuc.edu -! -! Date: October 06, 2004 -! -! Comments: -! -! Modifications: -! -!------------------------------------------------------------------------- - -subroutine h5immake_palette_f(loc_id,& - dset_name,& - pal_dims,& - buf,& - errcode ) - - implicit none - -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5immake_palette_f -!DEC$endif -! - - integer(hid_t), intent(in) :: loc_id ! file or group identifier - character(len=*), intent(in) :: dset_name ! name of the dataset - integer(hsize_t), intent(in), dimension(*) :: pal_dims ! dimensions - integer, intent(in), dimension(*) :: buf ! buffer - integer :: errcode ! error code - integer(size_t) :: namelen ! name length - - interface - integer function h5immake_palette_c(loc_id,namelen,dset_name,pal_dims,buf) - use h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5IMMAKE_PALETTE_C'::h5immake_palette_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - integer(hid_t), intent(in) :: loc_id ! file or group identifier - integer(size_t) :: namelen ! length of name buffer - character(len=*), intent(in) :: dset_name ! name of the dataset - integer(hsize_t), intent(in), dimension(*) :: pal_dims ! dimensions - integer, intent(in), dimension(*) :: buf ! buffer - end function h5immake_palette_c - end interface - - namelen = len(dset_name) - errcode = h5immake_palette_c(loc_id,namelen,dset_name,pal_dims,buf) - -end subroutine h5immake_palette_f - - - -!------------------------------------------------------------------------- -! Function: h5imlink_palette_f -! -! Purpose: This function attaches a palette to an existing image dataset -! -! Return: Success: 0, Failure: -1 -! -! Programmer: pvn@ncsa.uiuc.edu -! -! Date: October 06, 2004 -! -! Comments: -! -! Modifications: -! -!------------------------------------------------------------------------- - -subroutine h5imlink_palette_f(loc_id,& - dset_name,& - pal_name,& - errcode ) - - implicit none - -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5imlink_palette_f -!DEC$endif -! - integer(hid_t), intent(in) :: loc_id ! file or group identifier - character(len=*), intent(in) :: dset_name ! name of the dataset - character(len=*), intent(in) :: pal_name ! palette name - integer :: errcode ! error code - integer(size_t) :: namelen ! name length - integer(size_t) :: ilen ! name length - - interface - integer function h5imlink_palette_c(loc_id,namelen,dset_name,ilen,pal_name) - use h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5IMLINK_PALETTE_C'::h5imlink_palette_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - !DEC$ATTRIBUTES reference :: pal_name - integer(hid_t), intent(in) :: loc_id ! file or group identifier - character(len=*), intent(in) :: dset_name ! name of the dataset - character(len=*), intent(in) :: pal_name ! palette name - integer(size_t) :: namelen ! name length - integer(size_t) :: ilen ! name length - end function h5imlink_palette_c - end interface - - namelen = len(dset_name) - ilen = len(pal_name) - errcode = h5imlink_palette_c(loc_id,namelen,dset_name,ilen,pal_name) - -end subroutine h5imlink_palette_f - - -!------------------------------------------------------------------------- -! Function: h5imunlink_palette_f -! -! Purpose: This function dettaches a palette to an existing image dataset -! -! Return: Success: 0, Failure: -1 -! -! Programmer: pvn@ncsa.uiuc.edu -! -! Date: October 06, 2004 -! -! Comments: -! -! Modifications: -! -!------------------------------------------------------------------------- - -subroutine h5imunlink_palette_f(loc_id,& - dset_name,& - pal_name,& - errcode ) - - implicit none - -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5imunlink_palette_f -!DEC$endif -! - - - integer(hid_t), intent(in) :: loc_id ! file or group identifier - character(len=*), intent(in) :: dset_name ! name of the dataset - character(len=*), intent(in) :: pal_name ! palette name - integer :: errcode ! error code - integer(size_t) :: namelen ! name length - integer(size_t) :: ilen ! name length - - interface - integer function h5imunlink_palette_c(loc_id,namelen,dset_name,ilen,pal_name) - use h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5IMUNLINK_PALETTE_C'::h5imunlink_palette_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - !DEC$ATTRIBUTES reference :: pal_name - integer(hid_t), intent(in) :: loc_id ! file or group identifier - character(len=*), intent(in) :: dset_name ! name of the dataset - character(len=*), intent(in) :: pal_name ! palette name - integer(size_t) :: namelen ! name length - integer(size_t) :: ilen ! name length - end function h5imunlink_palette_c - end interface - - namelen = len(dset_name) - ilen = len(pal_name) - errcode = h5imunlink_palette_c(loc_id,namelen,dset_name,ilen,pal_name) - -end subroutine h5imunlink_palette_f - - - -!------------------------------------------------------------------------- -! Function: h5imget_npalettes_f -! -! Purpose: Gets the number of palettes associated to an image -! -! Return: Success: 0, Failure: -1 -! -! Programmer: pvn@ncsa.uiuc.edu -! -! Date: October 05, 2004 -! -! Comments: -! -! Modifications: -! -!------------------------------------------------------------------------- - -subroutine h5imget_npalettes_f(loc_id,& - dset_name,& - npals,& - errcode ) - - implicit none - -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5imget_npalettes_f -!DEC$endif -! - - integer(hid_t), intent(in) :: loc_id ! file or group identifier - character(len=*), intent(in) :: dset_name ! name of the dataset - integer(hsize_t), intent(inout) :: npals ! palettes - integer :: errcode ! error code - integer(size_t) :: namelen ! name length - - interface - integer function h5imget_npalettes_c(loc_id,namelen,dset_name,npals) - use h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5IMGET_NPALETTES_C'::h5imget_npalettes_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - integer(hid_t), intent(in) :: loc_id ! file or group identifier - character(len=*), intent(in) :: dset_name ! name of the dataset - integer(hsize_t), intent(inout) :: npals ! palettes - integer(size_t) :: namelen ! name length - end function h5imget_npalettes_c - end interface - - namelen = len(dset_name) - errcode = h5imget_npalettes_c(loc_id,namelen,dset_name,npals) - -end subroutine h5imget_npalettes_f - - -!------------------------------------------------------------------------- -! Function: h5imget_palette_info_f -! -! Purpose: Get palette information -! -! Return: Success: 0, Failure: -1 -! -! Programmer: pvn@ncsa.uiuc.edu -! -! Date: October 06, 2004 -! -! Comments: -! -! Modifications: -! -!------------------------------------------------------------------------- - -subroutine h5imget_palette_info_f(loc_id,& - dset_name,& - pal_number,& - dims,& - errcode ) - - implicit none - - -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5imget_palette_info_f -!DEC$endif -! - - integer(hid_t), intent(in) :: loc_id ! file or group identifier - character(len=*), intent(in) :: dset_name ! name of the dataset - integer, intent(in) :: pal_number ! palette number - integer(hsize_t), dimension(*), intent(inout) :: dims ! dimensions - integer :: errcode ! error code - integer(size_t) :: namelen ! name length - - interface - integer function h5imget_palette_info_c(loc_id,namelen,dset_name,pal_number,dims) - use h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5IMGET_PALETTE_INFO_C'::h5imget_palette_info_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - integer(hid_t), intent(in) :: loc_id ! file or group identifier - character(len=*), intent(in) :: dset_name ! name of the dataset - integer, intent(in) :: pal_number ! palette number - integer(hsize_t), dimension(*), intent(inout) :: dims ! dimensions - integer(size_t) :: namelen ! name length - end function h5imget_palette_info_c - end interface - - namelen = len(dset_name) - errcode = h5imget_palette_info_c(loc_id,namelen,dset_name,pal_number,dims) - -end subroutine h5imget_palette_info_f - - - -!------------------------------------------------------------------------- -! Function: h5imget_palette_f -! -! Purpose: Reads palette -! -! Return: Success: 0, Failure: -1 -! -! Programmer: pvn@ncsa.uiuc.edu -! -! Date: October 06, 2004 -! -! Comments: -! -! Modifications: -! -!------------------------------------------------------------------------- - - -subroutine h5imget_palette_f(loc_id,& - dset_name,& - pal_number,& - buf,& - errcode ) - - implicit none - -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5imget_palette_f -!DEC$endif -! - - integer(hid_t), intent(in) :: loc_id ! file or group identifier - character(len=*), intent(in) :: dset_name ! name of the dataset - integer, intent(in) :: pal_number ! palette number - integer, intent(inout), dimension(*) :: buf ! buffer - integer :: errcode ! error code - integer(size_t) :: namelen ! name length - - interface - integer function h5imget_palette_c(loc_id,namelen,dset_name,pal_number,buf) - use h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5IMGET_PALETTE_C'::h5imget_palette_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - integer(hid_t), intent(in) :: loc_id ! file or group identifier - integer(size_t) :: namelen ! length of name buffer - character(len=*), intent(in) :: dset_name ! name of the dataset - integer, intent(in) :: pal_number ! palette number - integer, intent(inout), dimension(*) :: buf ! buffer - end function h5imget_palette_c - end interface - - namelen = len(dset_name) - errcode = h5imget_palette_c(loc_id,namelen,dset_name,pal_number,buf) - -end subroutine h5imget_palette_f - - -!------------------------------------------------------------------------- -! Function: h5imis_palette_f -! -! Purpose: Inquires if a dataset is a palette -! -! Return: true, false, fail -! -! Programmer: pvn@ncsa.uiuc.edu -! -! Date: October 06, 2004 -! -! Comments: -! -! Modifications: -! -!------------------------------------------------------------------------- - -integer function h5imis_palette_f(loc_id,& - dset_name) - - implicit none - -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5imis_palette_f -!DEC$endif -! - - integer(hid_t), intent(in) :: loc_id ! file or group identifier - character(len=*), intent(in) :: dset_name ! name of the dataset - integer :: errcode ! error code - integer(size_t) :: namelen ! name length - - interface - integer function h5imis_palette_c(loc_id,namelen,dset_name) - use h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5IMIS_PALETTE_C'::h5imis_palette_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - integer(hid_t), intent(in) :: loc_id ! file or group identifier - integer(size_t) :: namelen ! length of name buffer - character(len=*), intent(in) :: dset_name ! name of the dataset - end function h5imis_palette_c - end interface - - namelen = len(dset_name) - errcode = h5imis_palette_c(loc_id,namelen,dset_name) - h5imis_palette_f = errcode - -end function h5imis_palette_f - - -! end -! -end module H5IM - - - - - diff --git a/hl/fortran/src/H5LTf90proto.h b/hl/fortran/src/H5LTf90proto.h index 532d9d8..20d043e 100644 --- a/hl/fortran/src/H5LTf90proto.h +++ b/hl/fortran/src/H5LTf90proto.h @@ -30,1131 +30,110 @@ H5_FCDLL void HD5packFstring (char *src, char *dest, size_t len); /* * Functions from H5DSfc.c */ - -#define nh5dsset_scale_c H5_FC_FUNC_(h5dsset_scale_c, H5DSSET_SCALE_C) -#define nh5dsattach_scale_c H5_FC_FUNC_(h5dsattach_scale_c, H5DSATTACH_SCALE_C) -#define nh5dsdetach_scale_c H5_FC_FUNC_(h5dsdetach_scale_c, H5DSDETACH_SCALE_C) -#define nh5dsis_attached_c H5_FC_FUNC_(h5dsis_attached_c, H5DSIS_ATTACHED_C) -#define nh5dsis_scale_c H5_FC_FUNC_(h5dsis_scale_c, H5DSIS_SCALE_C) -#define nh5dsset_label_c H5_FC_FUNC_(h5dsset_label_c, H5DSSET_LABEL_C) -#define nh5dsget_label_c H5_FC_FUNC_(h5dsget_label_c, H5DSGET_LABEL_C) -#define nh5dsget_scale_name_c H5_FC_FUNC_(h5dsget_scale_name_c,H5DSGET_SCALE_NAME_C) -#define nh5dsget_num_scales_c H5_FC_FUNC_(h5dsget_num_scales_c,H5DSGET_NUM_SCALES_C) - - -/* - * Functions from H5LTfc.c - */ -#define nh5ltmake_dataset_c H5_FC_FUNC_(h5ltmake_dataset_c, H5LTMAKE_DATASET_C) -#define nh5ltmake_dataset_int1_c H5_FC_FUNC_(h5ltmake_dataset_int1_c, H5LTMAKE_DATASET_INT1_C) -#define nh5ltmake_dataset_int2_c H5_FC_FUNC_(h5ltmake_dataset_int2_c, H5LTMAKE_DATASET_INT2_C) -#define nh5ltmake_dataset_int3_c H5_FC_FUNC_(h5ltmake_dataset_int3_c, H5LTMAKE_DATASET_INT3_C) -#define nh5ltmake_dataset_int4_c H5_FC_FUNC_(h5ltmake_dataset_int4_c, H5LTMAKE_DATASET_INT4_C) -#define nh5ltmake_dataset_int5_c H5_FC_FUNC_(h5ltmake_dataset_int5_c, H5LTMAKE_DATASET_INT5_C) -#define nh5ltmake_dataset_int6_c H5_FC_FUNC_(h5ltmake_dataset_int6_c, H5LTMAKE_DATASET_INT6_C) -#define nh5ltmake_dataset_int7_c H5_FC_FUNC_(h5ltmake_dataset_int7_c, H5LTMAKE_DATASET_INT7_C) -#define nh5ltmake_dataset_fl1_c H5_FC_FUNC_(h5ltmake_dataset_fl1_c, H5LTMAKE_DATASET_FL1_C) -#define nh5ltmake_dataset_fl2_c H5_FC_FUNC_(h5ltmake_dataset_fl2_c, H5LTMAKE_DATASET_FL2_C) -#define nh5ltmake_dataset_fl3_c H5_FC_FUNC_(h5ltmake_dataset_fl3_c, H5LTMAKE_DATASET_FL3_C) -#define nh5ltmake_dataset_fl4_c H5_FC_FUNC_(h5ltmake_dataset_fl4_c, H5LTMAKE_DATASET_FL4_C) -#define nh5ltmake_dataset_fl5_c H5_FC_FUNC_(h5ltmake_dataset_fl5_c, H5LTMAKE_DATASET_FL5_C) -#define nh5ltmake_dataset_fl6_c H5_FC_FUNC_(h5ltmake_dataset_fl6_c, H5LTMAKE_DATASET_FL6_C) -#define nh5ltmake_dataset_fl7_c H5_FC_FUNC_(h5ltmake_dataset_fl7_c, H5LTMAKE_DATASET_FL7_C) -#define nh5ltmake_dataset_dl1_c H5_FC_FUNC_(h5ltmake_dataset_dl1_c, H5LTMAKE_DATASET_DL1_C) -#define nh5ltmake_dataset_dl2_c H5_FC_FUNC_(h5ltmake_dataset_dl2_c, H5LTMAKE_DATASET_DL2_C) -#define nh5ltmake_dataset_dl3_c H5_FC_FUNC_(h5ltmake_dataset_dl3_c, H5LTMAKE_DATASET_DL3_C) -#define nh5ltmake_dataset_dl4_c H5_FC_FUNC_(h5ltmake_dataset_dl4_c, H5LTMAKE_DATASET_DL4_C) -#define nh5ltmake_dataset_dl5_c H5_FC_FUNC_(h5ltmake_dataset_dl5_c, H5LTMAKE_DATASET_DL5_C) -#define nh5ltmake_dataset_dl6_c H5_FC_FUNC_(h5ltmake_dataset_dl6_c, H5LTMAKE_DATASET_DL6_C) -#define nh5ltmake_dataset_dl7_c H5_FC_FUNC_(h5ltmake_dataset_dl7_c, H5LTMAKE_DATASET_DL7_C) -#define nh5ltmake_dataset_nint1_c H5_FC_FUNC_(h5ltmake_dataset_nint1_c, H5LTMAKE_DATASET_NINT1_C) -#define nh5ltmake_dataset_nint2_c H5_FC_FUNC_(h5ltmake_dataset_nint2_c, H5LTMAKE_DATASET_NINT2_C) -#define nh5ltmake_dataset_nint3_c H5_FC_FUNC_(h5ltmake_dataset_nint3_c, H5LTMAKE_DATASET_NINT3_C) -#define nh5ltmake_dataset_nint4_c H5_FC_FUNC_(h5ltmake_dataset_nint4_c, H5LTMAKE_DATASET_NINT4_C) -#define nh5ltmake_dataset_nint5_c H5_FC_FUNC_(h5ltmake_dataset_nint5_c, H5LTMAKE_DATASET_NINT5_C) -#define nh5ltmake_dataset_nint6_c H5_FC_FUNC_(h5ltmake_dataset_nint6_c, H5LTMAKE_DATASET_NINT6_C) -#define nh5ltmake_dataset_nint7_c H5_FC_FUNC_(h5ltmake_dataset_nint7_c, H5LTMAKE_DATASET_NINT7_C) -#define nh5ltmake_dataset_nfl1_c H5_FC_FUNC_(h5ltmake_dataset_nfl1_c, H5LTMAKE_DATASET_NFL1_C) -#define nh5ltmake_dataset_nfl2_c H5_FC_FUNC_(h5ltmake_dataset_nfl2_c, H5LTMAKE_DATASET_NFL2_C) -#define nh5ltmake_dataset_nfl3_c H5_FC_FUNC_(h5ltmake_dataset_nfl3_c, H5LTMAKE_DATASET_NFL3_C) -#define nh5ltmake_dataset_nfl4_c H5_FC_FUNC_(h5ltmake_dataset_nfl4_c, H5LTMAKE_DATASET_NFL4_C) -#define nh5ltmake_dataset_nfl5_c H5_FC_FUNC_(h5ltmake_dataset_nfl5_c, H5LTMAKE_DATASET_NFL5_C) -#define nh5ltmake_dataset_nfl6_c H5_FC_FUNC_(h5ltmake_dataset_nfl6_c, H5LTMAKE_DATASET_NFL6_C) -#define nh5ltmake_dataset_nfl7_c H5_FC_FUNC_(h5ltmake_dataset_nfl7_c, H5LTMAKE_DATASET_NFL7_C) -#define nh5ltmake_dataset_ndl1_c H5_FC_FUNC_(h5ltmake_dataset_ndl1_c, H5LTMAKE_DATASET_NDL1_C) -#define nh5ltmake_dataset_ndl2_c H5_FC_FUNC_(h5ltmake_dataset_ndl2_c, H5LTMAKE_DATASET_NDL2_C) -#define nh5ltmake_dataset_ndl3_c H5_FC_FUNC_(h5ltmake_dataset_ndl3_c, H5LTMAKE_DATASET_NDL3_C) -#define nh5ltmake_dataset_ndl4_c H5_FC_FUNC_(h5ltmake_dataset_ndl4_c, H5LTMAKE_DATASET_NDL4_C) -#define nh5ltmake_dataset_ndl5_c H5_FC_FUNC_(h5ltmake_dataset_ndl5_c, H5LTMAKE_DATASET_NDL5_C) -#define nh5ltmake_dataset_ndl6_c H5_FC_FUNC_(h5ltmake_dataset_ndl6_c, H5LTMAKE_DATASET_NDL6_C) -#define nh5ltmake_dataset_ndl7_c H5_FC_FUNC_(h5ltmake_dataset_ndl7_c, H5LTMAKE_DATASET_NDL7_C) -#define nh5ltread_dataset_c H5_FC_FUNC_(h5ltread_dataset_c, H5LTREAD_DATASET_C) -#define nh5ltread_dataset_int1_c H5_FC_FUNC_(h5ltread_dataset_int1_c, H5LTREAD_DATASET_INT1_C) -#define nh5ltread_dataset_int2_c H5_FC_FUNC_(h5ltread_dataset_int2_c, H5LTREAD_DATASET_INT2_C) -#define nh5ltread_dataset_int3_c H5_FC_FUNC_(h5ltread_dataset_int3_c, H5LTREAD_DATASET_INT3_C) -#define nh5ltread_dataset_int4_c H5_FC_FUNC_(h5ltread_dataset_int4_c, H5LTREAD_DATASET_INT4_C) -#define nh5ltread_dataset_int5_c H5_FC_FUNC_(h5ltread_dataset_int5_c, H5LTREAD_DATASET_INT5_C) -#define nh5ltread_dataset_int6_c H5_FC_FUNC_(h5ltread_dataset_int6_c, H5LTREAD_DATASET_INT6_C) -#define nh5ltread_dataset_int7_c H5_FC_FUNC_(h5ltread_dataset_int7_c, H5LTREAD_DATASET_INT7_C) -#define nh5ltread_dataset_fl1_c H5_FC_FUNC_(h5ltread_dataset_fl1_c, H5LTREAD_DATASET_FL1_C) -#define nh5ltread_dataset_fl2_c H5_FC_FUNC_(h5ltread_dataset_fl2_c, H5LTREAD_DATASET_FL2_C) -#define nh5ltread_dataset_fl3_c H5_FC_FUNC_(h5ltread_dataset_fl3_c, H5LTREAD_DATASET_FL3_C) -#define nh5ltread_dataset_fl4_c H5_FC_FUNC_(h5ltread_dataset_fl4_c, H5LTREAD_DATASET_FL4_C) -#define nh5ltread_dataset_fl5_c H5_FC_FUNC_(h5ltread_dataset_fl5_c, H5LTREAD_DATASET_FL5_C) -#define nh5ltread_dataset_fl6_c H5_FC_FUNC_(h5ltread_dataset_fl6_c, H5LTREAD_DATASET_FL6_C) -#define nh5ltread_dataset_fl7_c H5_FC_FUNC_(h5ltread_dataset_fl7_c, H5LTREAD_DATASET_FL7_C) -#define nh5ltread_dataset_dl1_c H5_FC_FUNC_(h5ltread_dataset_dl1_c, H5LTREAD_DATASET_DL1_C) -#define nh5ltread_dataset_dl2_c H5_FC_FUNC_(h5ltread_dataset_dl2_c, H5LTREAD_DATASET_DL2_C) -#define nh5ltread_dataset_dl3_c H5_FC_FUNC_(h5ltread_dataset_dl3_c, H5LTREAD_DATASET_DL3_C) -#define nh5ltread_dataset_dl4_c H5_FC_FUNC_(h5ltread_dataset_dl4_c, H5LTREAD_DATASET_DL4_C) -#define nh5ltread_dataset_dl5_c H5_FC_FUNC_(h5ltread_dataset_dl5_c, H5LTREAD_DATASET_DL5_C) -#define nh5ltread_dataset_dl6_c H5_FC_FUNC_(h5ltread_dataset_dl6_c, H5LTREAD_DATASET_DL6_C) -#define nh5ltread_dataset_dl7_c H5_FC_FUNC_(h5ltread_dataset_dl7_c, H5LTREAD_DATASET_DL7_C) -#define nh5ltread_dataset_nint1_c H5_FC_FUNC_(h5ltread_dataset_nint1_c, H5LTREAD_DATASET_NINT1_C) -#define nh5ltread_dataset_nint2_c H5_FC_FUNC_(h5ltread_dataset_nint2_c, H5LTREAD_DATASET_NINT2_C) -#define nh5ltread_dataset_nint3_c H5_FC_FUNC_(h5ltread_dataset_nint3_c, H5LTREAD_DATASET_NINT3_C) -#define nh5ltread_dataset_nint4_c H5_FC_FUNC_(h5ltread_dataset_nint4_c, H5LTREAD_DATASET_NINT4_C) -#define nh5ltread_dataset_nint5_c H5_FC_FUNC_(h5ltread_dataset_nint5_c, H5LTREAD_DATASET_NINT5_C) -#define nh5ltread_dataset_nint6_c H5_FC_FUNC_(h5ltread_dataset_nint6_c, H5LTREAD_DATASET_NINT6_C) -#define nh5ltread_dataset_nint7_c H5_FC_FUNC_(h5ltread_dataset_nint7_c, H5LTREAD_DATASET_NINT7_C) -#define nh5ltread_dataset_nfl1_c H5_FC_FUNC_(h5ltread_dataset_nfl1_c, H5LTREAD_DATASET_NFL1_C) -#define nh5ltread_dataset_nfl2_c H5_FC_FUNC_(h5ltread_dataset_nfl2_c, H5LTREAD_DATASET_NFL2_C) -#define nh5ltread_dataset_nfl3_c H5_FC_FUNC_(h5ltread_dataset_nfl3_c, H5LTREAD_DATASET_NFL3_C) -#define nh5ltread_dataset_nfl4_c H5_FC_FUNC_(h5ltread_dataset_nfl4_c, H5LTREAD_DATASET_NFL4_C) -#define nh5ltread_dataset_nfl5_c H5_FC_FUNC_(h5ltread_dataset_nfl5_c, H5LTREAD_DATASET_NFL5_C) -#define nh5ltread_dataset_nfl6_c H5_FC_FUNC_(h5ltread_dataset_nfl6_c, H5LTREAD_DATASET_NFL6_C) -#define nh5ltread_dataset_nfl7_c H5_FC_FUNC_(h5ltread_dataset_nfl7_c, H5LTREAD_DATASET_NFL7_C) -#define nh5ltread_dataset_ndl1_c H5_FC_FUNC_(h5ltread_dataset_ndl1_c, H5LTREAD_DATASET_NDL1_C) -#define nh5ltread_dataset_ndl2_c H5_FC_FUNC_(h5ltread_dataset_ndl2_c, H5LTREAD_DATASET_NDL2_C) -#define nh5ltread_dataset_ndl3_c H5_FC_FUNC_(h5ltread_dataset_ndl3_c, H5LTREAD_DATASET_NDL3_C) -#define nh5ltread_dataset_ndl4_c H5_FC_FUNC_(h5ltread_dataset_ndl4_c, H5LTREAD_DATASET_NDL4_C) -#define nh5ltread_dataset_ndl5_c H5_FC_FUNC_(h5ltread_dataset_ndl5_c, H5LTREAD_DATASET_NDL5_C) -#define nh5ltread_dataset_ndl6_c H5_FC_FUNC_(h5ltread_dataset_ndl6_c, H5LTREAD_DATASET_NDL6_C) -#define nh5ltread_dataset_ndl7_c H5_FC_FUNC_(h5ltread_dataset_ndl7_c, H5LTREAD_DATASET_NDL7_C) -#define nh5ltmake_dataset_string_c H5_FC_FUNC_(h5ltmake_dataset_string_c, H5LTMAKE_DATASET_STRING_C) -#define nh5ltread_dataset_string_c H5_FC_FUNC_(h5ltread_dataset_string_c, H5LTREAD_DATASET_STRING_C) - -#define nh5ltset_attribute_int_c H5_FC_FUNC_(h5ltset_attribute_int_c, H5LTSET_ATTRIBUTE_INT_C) -#define nh5ltset_attribute_float_c H5_FC_FUNC_(h5ltset_attribute_float_c, H5LTSET_ATTRIBUTE_FLOAT_C) -#define nh5ltset_attribute_double_c H5_FC_FUNC_(h5ltset_attribute_double_c, H5LTSET_ATTRIBUTE_DOUBLE_C) -#define nh5ltset_attribute_string_c H5_FC_FUNC_(h5ltset_attribute_string_c, H5LTSET_ATTRIBUTE_STRING_C) - -#define nh5ltget_attribute_int_c H5_FC_FUNC_(h5ltget_attribute_int_c, H5LTGET_ATTRIBUTE_INT_C) -#define nh5ltget_attribute_float_c H5_FC_FUNC_(h5ltget_attribute_float_c, H5LTGET_ATTRIBUTE_FLOAT_C) -#define nh5ltget_attribute_double_c H5_FC_FUNC_(h5ltget_attribute_double_c, H5LTGET_ATTRIBUTE_DOUBLE_C) -#define nh5ltget_attribute_string_c H5_FC_FUNC_(h5ltget_attribute_string_c, H5LTGET_ATTRIBUTE_STRING_C) - -#define nh5ltget_dataset_ndims_c H5_FC_FUNC_(h5ltget_dataset_ndims_c, H5LTGET_DATASET_NDIMS_C) -#define nh5ltfind_dataset_c H5_FC_FUNC_(h5ltfind_dataset_c, H5LTFIND_DATASET_C) -#define nh5ltget_dataset_info_c H5_FC_FUNC_(h5ltget_dataset_info_c, H5LTGET_DATASET_INFO_C) - -#define nh5ltget_attribute_ndims_c H5_FC_FUNC_(h5ltget_attribute_ndims_c, H5LTGET_ATTRIBUTE_NDIMS_C) -#define nh5ltget_attribute_info_c H5_FC_FUNC_(h5ltget_attribute_info_c, H5LTGET_ATTRIBUTE_INFO_C) -#define nh5ltpath_valid_c H5_FC_FUNC_(h5ltpath_valid_c, H5LTPATH_VALID_C) - -/*------------------------------------------------------------------------- -* Image -*------------------------------------------------------------------------- -*/ -#define nh5immake_image_8bit_c H5_FC_FUNC_(h5immake_image_8bit_c, H5IMMAKE_IMAGE_8BIT_C) -#define nh5immake_image_24bit_c H5_FC_FUNC_(h5immake_image_24bit_c, H5IMMAKE_IMAGE_24BIT_C) -#define nh5imread_image_c H5_FC_FUNC_(h5imread_image_c, H5IMREAD_IMAGE_C) -#define nh5imget_image_info_c H5_FC_FUNC_(h5imget_image_info_c, H5IMGET_IMAGE_INFO_C) -#define nh5imis_image_c H5_FC_FUNC_(h5imis_image_c, H5IMIS_IMAGE_C) -#define nh5immake_palette_c H5_FC_FUNC_(h5immake_palette_c, H5IMMAKE_PALETTE_C) -#define nh5imlink_palette_c H5_FC_FUNC_(h5imlink_palette_c, H5IMLINK_PALETTE_C) -#define nh5imunlink_palette_c H5_FC_FUNC_(h5imunlink_palette_c, H5IMUNLINK_PALETTE_C) -#define nh5imget_npalettes_c H5_FC_FUNC_(h5imget_npalettes_c, H5IMGET_NPALETTES_C) -#define nh5imget_palette_info_c H5_FC_FUNC_(h5imget_palette_info_c, H5IMGET_PALETTE_INFO_C) -#define nh5imget_palette_c H5_FC_FUNC_(h5imget_palette_c, H5IMGET_PALETTE_C) -#define nh5imis_palette_c H5_FC_FUNC_(h5imis_palette_c, H5IMIS_PALETTE_C) - -/*------------------------------------------------------------------------- -* Table -*------------------------------------------------------------------------- -*/ -#define nh5tbmake_table_c H5_FC_FUNC_(h5tbmake_table_c, H5TBMAKE_TABLE_C) -#define nh5tbwrite_field_name_c H5_FC_FUNC_(h5tbwrite_field_name_c, H5TBWRITE_FIELD_NAME_C) -#define nh5tbwrite_field_name_int_c H5_FC_FUNC_(h5tbwrite_field_name_int_c, H5TBWRITE_FIELD_NAME_INT_C) -#define nh5tbwrite_field_name_fl_c H5_FC_FUNC_(h5tbwrite_field_name_fl_c, H5TBWRITE_FIELD_NAME_FL_C) -#define nh5tbwrite_field_name_dl_c H5_FC_FUNC_(h5tbwrite_field_name_dl_c, H5TBWRITE_FIELD_NAME_DL_C) -#define nh5tbwrite_field_name_st_c H5_FC_FUNC_(h5tbwrite_field_name_st_c, H5TBWRITE_FIELD_NAME_ST_C) -#define nh5tbread_field_name_c H5_FC_FUNC_(h5tbread_field_name_c, H5TBREAD_FIELD_NAME_C) -#define nh5tbread_field_name_int_c H5_FC_FUNC_(h5tbread_field_name_int_c, H5TBREAD_FIELD_NAME_INT_C) -#define nh5tbread_field_name_fl_c H5_FC_FUNC_(h5tbread_field_name_fl_c, H5TBREAD_FIELD_NAME_FL_C) -#define nh5tbread_field_name_dl_c H5_FC_FUNC_(h5tbread_field_name_dl_c, H5TBREAD_FIELD_NAME_DL_C) -#define nh5tbread_field_name_st_c H5_FC_FUNC_(h5tbread_field_name_st_c, H5TBREAD_FIELD_NAME_ST_C) -#define nh5tbwrite_field_index_c H5_FC_FUNC_(h5tbwrite_field_index_c, H5TBWRITE_FIELD_INDEX_C) -#define nh5tbwrite_field_index_int_c H5_FC_FUNC_(h5tbwrite_field_index_int_c, H5TBWRITE_FIELD_INDEX_INT_C) -#define nh5tbwrite_field_index_fl_c H5_FC_FUNC_(h5tbwrite_field_index_fl_c, H5TBWRITE_FIELD_INDEX_FL_C) -#define nh5tbwrite_field_index_dl_c H5_FC_FUNC_(h5tbwrite_field_index_dl_c, H5TBWRITE_FIELD_INDEX_DL_C) -#define nh5tbwrite_field_index_st_c H5_FC_FUNC_(h5tbwrite_field_index_st_c, H5TBWRITE_FIELD_INDEX_ST_C) -#define nh5tbread_field_index_c H5_FC_FUNC_(h5tbread_field_index_c, H5TBREAD_FIELD_INDEX_C) -#define nh5tbread_field_index_int_c H5_FC_FUNC_(h5tbread_field_index_int_c, H5TBREAD_FIELD_INDEX_INT_C) -#define nh5tbread_field_index_fl_c H5_FC_FUNC_(h5tbread_field_index_fl_c, H5TBREAD_FIELD_INDEX_FL_C) -#define nh5tbread_field_index_dl_c H5_FC_FUNC_(h5tbread_field_index_dl_c, H5TBREAD_FIELD_INDEX_DL_C) -#define nh5tbread_field_index_st_c H5_FC_FUNC_(h5tbread_field_index_st_c, H5TBREAD_FIELD_INDEX_ST_C) -#define nh5tbinsert_field_c H5_FC_FUNC_(h5tbinsert_field_c, H5TBINSERT_FIELD_C) -#define nh5tbinsert_field_int_c H5_FC_FUNC_(h5tbinsert_field_int_c, H5TBINSERT_FIELD_INT_C) -#define nh5tbinsert_field_fl_c H5_FC_FUNC_(h5tbinsert_field_fl_c, H5TBINSERT_FIELD_FL_C) -#define nh5tbinsert_field_dl_c H5_FC_FUNC_(h5tbinsert_field_dl_c, H5TBINSERT_FIELD_DL_C) -#define nh5tbinsert_field_st_c H5_FC_FUNC_(h5tbinsert_field_st_c, H5TBINSERT_FIELD_ST_C) -#define nh5tbdelete_field_c H5_FC_FUNC_(h5tbdelete_field_c, H5TBDELETE_FIELD_C) -#define nh5tbget_table_info_c H5_FC_FUNC_(h5tbget_table_info_c, H5TBGET_TABLE_INFO_C) -#define nh5tbget_field_info_c H5_FC_FUNC_(h5tbget_field_info_c, H5TBGET_FIELD_INFO_C) - -HDF5_HL_F90CSTUBDLL -int_f -nh5dsset_scale_c(hid_t_f *dsid, _fcd dimname, size_t_f *dimnamelen); - -HDF5_HL_F90CSTUBDLL -int_f -nh5dsattach_scale_c( hid_t_f *did, hid_t_f *dsid, int_f *idx); - -HDF5_HL_F90CSTUBDLL -int_f -nh5dsdetach_scale_c( hid_t_f *did, hid_t_f *dsid, int_f *idx); - -HDF5_HL_F90CSTUBDLL -int_f -nh5dsis_attached_c( hid_t_f *did, hid_t_f *dsid, int_f *idx, int_f *c_is_attached); - -HDF5_HL_F90CSTUBDLL -int_f -nh5dsis_scale_c(hid_t_f *did, int_f *is_scale); - -HDF5_HL_F90CSTUBDLL -int_f -nh5dsset_label_c(hid_t_f *did, int_f *idx, _fcd label, size_t_f *labellen); - -HDF5_HL_F90CSTUBDLL -int_f -nh5dsget_label_c(hid_t_f *did, int_f *idx, _fcd label, size_t_f *size); - -HDF5_HL_F90CSTUBDLL -int_f -nh5dsget_scale_name_c(hid_t_f *did, _fcd label, size_t_f *size); - -HDF5_HL_F90CSTUBDLL -int_f -nh5dsget_num_scales_c( hid_t_f *did, int_f *idx, int_f *num_scales); - - -HDF5_HL_F90CSTUBDLL -int_f -nh5ltmake_dataset_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - int_f *rank, - hsize_t_f *dims, - hid_t_f *type_id, - void *buf); - -HDF5_HL_F90CSTUBDLL -int_f -nh5ltmake_dataset_int1_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - int_f *rank, - hsize_t_f *dims, - hid_t_f *type_id, - void *buf); - -HDF5_HL_F90CSTUBDLL -int_f -nh5ltmake_dataset_int2_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - int_f *rank, - hsize_t_f *dims, - hid_t_f *type_id, - void *buf); - -HDF5_HL_F90CSTUBDLL -int_f -nh5ltmake_dataset_int3_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - int_f *rank, - hsize_t_f *dims, - hid_t_f *type_id, - void *buf); - -HDF5_HL_F90CSTUBDLL -int_f -nh5ltmake_dataset_int4_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - int_f *rank, - hsize_t_f *dims, - hid_t_f *type_id, - void *buf); - -HDF5_HL_F90CSTUBDLL -int_f -nh5ltmake_dataset_int5_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - int_f *rank, - hsize_t_f *dims, - hid_t_f *type_id, - void *buf); - -HDF5_HL_F90CSTUBDLL -int_f -nh5ltmake_dataset_int6_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - int_f *rank, - hsize_t_f *dims, - hid_t_f *type_id, - void *buf); - -HDF5_HL_F90CSTUBDLL -int_f -nh5ltmake_dataset_int7_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - int_f *rank, - hsize_t_f *dims, - hid_t_f *type_id, - void *buf); - - -HDF5_HL_F90CSTUBDLL -int_f -nh5ltmake_dataset_fl1_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - int_f *rank, - hsize_t_f *dims, - hid_t_f *type_id, - void *buf); - -HDF5_HL_F90CSTUBDLL -int_f -nh5ltmake_dataset_fl2_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - int_f *rank, - hsize_t_f *dims, - hid_t_f *type_id, - void *buf); - -HDF5_HL_F90CSTUBDLL -int_f -nh5ltmake_dataset_fl3_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - int_f *rank, - hsize_t_f *dims, - hid_t_f *type_id, - void *buf); - -HDF5_HL_F90CSTUBDLL -int_f -nh5ltmake_dataset_fl4_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - int_f *rank, - hsize_t_f *dims, - hid_t_f *type_id, - void *buf); - -HDF5_HL_F90CSTUBDLL -int_f -nh5ltmake_dataset_fl5_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - int_f *rank, - hsize_t_f *dims, - hid_t_f *type_id, - void *buf); - -HDF5_HL_F90CSTUBDLL -int_f -nh5ltmake_dataset_fl6_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - int_f *rank, - hsize_t_f *dims, - hid_t_f *type_id, - void *buf); - -HDF5_HL_F90CSTUBDLL -int_f -nh5ltmake_dataset_fl7_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - int_f *rank, - hsize_t_f *dims, - hid_t_f *type_id, - void *buf); - - -HDF5_HL_F90CSTUBDLL -int_f -nh5ltmake_dataset_dl1_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - int_f *rank, - hsize_t_f *dims, - hid_t_f *type_id, - void *buf); - -HDF5_HL_F90CSTUBDLL -int_f -nh5ltmake_dataset_dl2_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - int_f *rank, - hsize_t_f *dims, - hid_t_f *type_id, - void *buf); - -HDF5_HL_F90CSTUBDLL -int_f -nh5ltmake_dataset_dl3_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - int_f *rank, - hsize_t_f *dims, - hid_t_f *type_id, - void *buf); - -HDF5_HL_F90CSTUBDLL -int_f -nh5ltmake_dataset_dl4_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - int_f *rank, - hsize_t_f *dims, - hid_t_f *type_id, - void *buf); - -HDF5_HL_F90CSTUBDLL -int_f -nh5ltmake_dataset_dl5_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - int_f *rank, - hsize_t_f *dims, - hid_t_f *type_id, - void *buf); - -HDF5_HL_F90CSTUBDLL -int_f -nh5ltmake_dataset_dl6_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - int_f *rank, - hsize_t_f *dims, - hid_t_f *type_id, - void *buf); - -HDF5_HL_F90CSTUBDLL -int_f -nh5ltmake_dataset_dl7_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - int_f *rank, - hsize_t_f *dims, - hid_t_f *type_id, - void *buf); - -HDF5_HL_F90CSTUBDLL -int_f -nh5ltmake_dataset_nint1_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - int_f *rank, - hsize_t_f *dims, - hid_t_f *type_id, - void *buf); - -HDF5_HL_F90CSTUBDLL -int_f -nh5ltmake_dataset_nint2_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - int_f *rank, - hsize_t_f *dims, - hid_t_f *type_id, - void *buf); - -HDF5_HL_F90CSTUBDLL -int_f -nh5ltmake_dataset_nint3_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - int_f *rank, - hsize_t_f *dims, - hid_t_f *type_id, - void *buf); - -HDF5_HL_F90CSTUBDLL -int_f -nh5ltmake_dataset_nint4_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - int_f *rank, - hsize_t_f *dims, - hid_t_f *type_id, - void *buf); - -HDF5_HL_F90CSTUBDLL -int_f -nh5ltmake_dataset_nint5_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - int_f *rank, - hsize_t_f *dims, - hid_t_f *type_id, - void *buf); - -HDF5_HL_F90CSTUBDLL -int_f -nh5ltmake_dataset_nint6_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - int_f *rank, - hsize_t_f *dims, - hid_t_f *type_id, - void *buf); - -HDF5_HL_F90CSTUBDLL -int_f -nh5ltmake_dataset_nint7_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - int_f *rank, - hsize_t_f *dims, - hid_t_f *type_id, - void *buf); - -HDF5_HL_F90CSTUBDLL -int_f -nh5ltmake_dataset_nfl1_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - int_f *rank, - hsize_t_f *dims, - hid_t_f *type_id, - void *buf); - -HDF5_HL_F90CSTUBDLL -int_f -nh5ltmake_dataset_nfl2_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - int_f *rank, - hsize_t_f *dims, - hid_t_f *type_id, - void *buf); - -HDF5_HL_F90CSTUBDLL -int_f -nh5ltmake_dataset_nfl3_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - int_f *rank, - hsize_t_f *dims, - hid_t_f *type_id, - void *buf); - -HDF5_HL_F90CSTUBDLL -int_f -nh5ltmake_dataset_nfl4_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - int_f *rank, - hsize_t_f *dims, - hid_t_f *type_id, - void *buf); - -HDF5_HL_F90CSTUBDLL -int_f -nh5ltmake_dataset_nfl5_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - int_f *rank, - hsize_t_f *dims, - hid_t_f *type_id, - void *buf); - -HDF5_HL_F90CSTUBDLL -int_f -nh5ltmake_dataset_nfl6_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - int_f *rank, - hsize_t_f *dims, - hid_t_f *type_id, - void *buf); - -HDF5_HL_F90CSTUBDLL -int_f -nh5ltmake_dataset_nfl7_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - int_f *rank, - hsize_t_f *dims, - hid_t_f *type_id, - void *buf); - -HDF5_HL_F90CSTUBDLL -int_f -nh5ltmake_dataset_ndl1_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - int_f *rank, - hsize_t_f *dims, - hid_t_f *type_id, - void *buf); - -HDF5_HL_F90CSTUBDLL -int_f -nh5ltmake_dataset_ndl2_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - int_f *rank, - hsize_t_f *dims, - hid_t_f *type_id, - void *buf); - -HDF5_HL_F90CSTUBDLL -int_f -nh5ltmake_dataset_ndl3_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - int_f *rank, - hsize_t_f *dims, - hid_t_f *type_id, - void *buf); - -HDF5_HL_F90CSTUBDLL -int_f -nh5ltmake_dataset_ndl4_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - int_f *rank, - hsize_t_f *dims, - hid_t_f *type_id, - void *buf); - -HDF5_HL_F90CSTUBDLL -int_f -nh5ltmake_dataset_ndl5_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - int_f *rank, - hsize_t_f *dims, - hid_t_f *type_id, - void *buf); - -HDF5_HL_F90CSTUBDLL -int_f -nh5ltmake_dataset_ndl6_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - int_f *rank, - hsize_t_f *dims, - hid_t_f *type_id, - void *buf); - -HDF5_HL_F90CSTUBDLL -int_f -nh5ltmake_dataset_ndl7_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - int_f *rank, - hsize_t_f *dims, - hid_t_f *type_id, - void *buf); - -HDF5_HL_F90CSTUBDLL -int_f -nh5ltread_dataset_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - hid_t_f *type_id, - void *buf, - hsize_t_f *dims); - - -HDF5_HL_F90CSTUBDLL -int_f -nh5ltread_dataset_int1_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - hid_t_f *type_id, - void *buf, - hsize_t_f *dims); - -HDF5_HL_F90CSTUBDLL -int_f -nh5ltread_dataset_int2_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - hid_t_f *type_id, - void *buf, - hsize_t_f *dims); - -HDF5_HL_F90CSTUBDLL -int_f -nh5ltread_dataset_int3_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - hid_t_f *type_id, - void *buf, - hsize_t_f *dims); - -HDF5_HL_F90CSTUBDLL -int_f -nh5ltread_dataset_int4_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - hid_t_f *type_id, - void *buf, - hsize_t_f *dims); - -HDF5_HL_F90CSTUBDLL -int_f -nh5ltread_dataset_int5_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - hid_t_f *type_id, - void *buf, - hsize_t_f *dims); - -HDF5_HL_F90CSTUBDLL -int_f -nh5ltread_dataset_int6_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - hid_t_f *type_id, - void *buf, - hsize_t_f *dims); - -HDF5_HL_F90CSTUBDLL -int_f -nh5ltread_dataset_int7_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - hid_t_f *type_id, - void *buf, - hsize_t_f *dims); - -HDF5_HL_F90CSTUBDLL -int_f -nh5ltread_dataset_fl1_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - hid_t_f *type_id, - void *buf, - hsize_t_f *dims); - -HDF5_HL_F90CSTUBDLL -int_f -nh5ltread_dataset_fl2_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - hid_t_f *type_id, - void *buf, - hsize_t_f *dims); - -HDF5_HL_F90CSTUBDLL -int_f -nh5ltread_dataset_fl3_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - hid_t_f *type_id, - void *buf, - hsize_t_f *dims); - -HDF5_HL_F90CSTUBDLL -int_f -nh5ltread_dataset_fl4_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - hid_t_f *type_id, - void *buf, - hsize_t_f *dims); - -HDF5_HL_F90CSTUBDLL -int_f -nh5ltread_dataset_fl5_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - hid_t_f *type_id, - void *buf, - hsize_t_f *dims); - -HDF5_HL_F90CSTUBDLL -int_f -nh5ltread_dataset_fl6_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - hid_t_f *type_id, - void *buf, - hsize_t_f *dims); - - -HDF5_HL_F90CSTUBDLL -int_f -nh5ltread_dataset_fl7_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - hid_t_f *type_id, - void *buf, - hsize_t_f *dims); - -HDF5_HL_F90CSTUBDLL -int_f -nh5ltread_dataset_dl1_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - hid_t_f *type_id, - void *buf, - hsize_t_f *dims); - -HDF5_HL_F90CSTUBDLL -int_f -nh5ltread_dataset_dl2_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - hid_t_f *type_id, - void *buf, - hsize_t_f *dims); - -HDF5_HL_F90CSTUBDLL -int_f -nh5ltread_dataset_dl3_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - hid_t_f *type_id, - void *buf, - hsize_t_f *dims); - -HDF5_HL_F90CSTUBDLL -int_f -nh5ltread_dataset_dl4_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - hid_t_f *type_id, - void *buf, - hsize_t_f *dims); - -HDF5_HL_F90CSTUBDLL -int_f -nh5ltread_dataset_dl5_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - hid_t_f *type_id, - void *buf, - hsize_t_f *dims); - -HDF5_HL_F90CSTUBDLL -int_f -nh5ltread_dataset_dl6_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - hid_t_f *type_id, - void *buf, - hsize_t_f *dims); - -HDF5_HL_F90CSTUBDLL -int_f -nh5ltread_dataset_dl7_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - hid_t_f *type_id, - void *buf, - hsize_t_f *dims); - -HDF5_HL_F90CSTUBDLL -int_f -nh5ltread_dataset_nint1_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - hid_t_f *type_id, - void *buf, - hsize_t_f *dims); - -HDF5_HL_F90CSTUBDLL -int_f -nh5ltread_dataset_nint2_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - hid_t_f *type_id, - void *buf, - hsize_t_f *dims); - -HDF5_HL_F90CSTUBDLL -int_f -nh5ltread_dataset_nint3_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - hid_t_f *type_id, - void *buf, - hsize_t_f *dims); - -HDF5_HL_F90CSTUBDLL -int_f -nh5ltread_dataset_nint4_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - hid_t_f *type_id, - void *buf, - hsize_t_f *dims); - -HDF5_HL_F90CSTUBDLL -int_f -nh5ltread_dataset_nint5_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - hid_t_f *type_id, - void *buf, - hsize_t_f *dims); - -HDF5_HL_F90CSTUBDLL -int_f -nh5ltread_dataset_nint6_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - hid_t_f *type_id, - void *buf, - hsize_t_f *dims); - -HDF5_HL_F90CSTUBDLL -int_f -nh5ltread_dataset_nint7_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - hid_t_f *type_id, - void *buf, - hsize_t_f *dims); - -HDF5_HL_F90CSTUBDLL -int_f -nh5ltread_dataset_nfl1_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - hid_t_f *type_id, - void *buf, - hsize_t_f *dims); - -HDF5_HL_F90CSTUBDLL -int_f -nh5ltread_dataset_nfl2_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - hid_t_f *type_id, - void *buf, - hsize_t_f *dims); - -HDF5_HL_F90CSTUBDLL -int_f -nh5ltread_dataset_nfl3_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - hid_t_f *type_id, - void *buf, - hsize_t_f *dims); - -HDF5_HL_F90CSTUBDLL -int_f -nh5ltread_dataset_nfl4_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - hid_t_f *type_id, - void *buf, - hsize_t_f *dims); - -HDF5_HL_F90CSTUBDLL -int_f -nh5ltread_dataset_nfl5_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - hid_t_f *type_id, - void *buf, - hsize_t_f *dims); - HDF5_HL_F90CSTUBDLL int_f -nh5ltread_dataset_nfl6_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - hid_t_f *type_id, - void *buf, - hsize_t_f *dims); +h5dsset_scale_c(hid_t_f *dsid, _fcd dimname, size_t_f *dimnamelen); HDF5_HL_F90CSTUBDLL int_f -nh5ltread_dataset_nfl7_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - hid_t_f *type_id, - void *buf, - hsize_t_f *dims); +h5dsattach_scale_c( hid_t_f *did, hid_t_f *dsid, int_f *idx); HDF5_HL_F90CSTUBDLL int_f -nh5ltread_dataset_ndl1_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - hid_t_f *type_id, - void *buf, - hsize_t_f *dims); +h5dsdetach_scale_c( hid_t_f *did, hid_t_f *dsid, int_f *idx); HDF5_HL_F90CSTUBDLL int_f -nh5ltread_dataset_ndl2_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - hid_t_f *type_id, - void *buf, - hsize_t_f *dims); +h5dsis_attached_c( hid_t_f *did, hid_t_f *dsid, int_f *idx, int_f *c_is_attached); HDF5_HL_F90CSTUBDLL int_f -nh5ltread_dataset_ndl3_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - hid_t_f *type_id, - void *buf, - hsize_t_f *dims); +h5dsis_scale_c(hid_t_f *did, int_f *is_scale); HDF5_HL_F90CSTUBDLL int_f -nh5ltread_dataset_ndl4_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - hid_t_f *type_id, - void *buf, - hsize_t_f *dims); +h5dsset_label_c(hid_t_f *did, int_f *idx, _fcd label, size_t_f *labellen); HDF5_HL_F90CSTUBDLL int_f -nh5ltread_dataset_ndl5_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - hid_t_f *type_id, - void *buf, - hsize_t_f *dims); +h5dsget_label_c(hid_t_f *did, int_f *idx, _fcd label, size_t_f *size); HDF5_HL_F90CSTUBDLL int_f -nh5ltread_dataset_ndl6_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - hid_t_f *type_id, - void *buf, - hsize_t_f *dims); +h5dsget_scale_name_c(hid_t_f *did, _fcd label, size_t_f *size); HDF5_HL_F90CSTUBDLL int_f -nh5ltread_dataset_ndl7_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - hid_t_f *type_id, - void *buf, - hsize_t_f *dims); +h5dsget_num_scales_c( hid_t_f *did, int_f *idx, int_f *num_scales); -HDF5_HL_F90CSTUBDLL -int_f -nh5ltset_attribute_int_c(hid_t_f *loc_id, - size_t_f *namelen, - _fcd dsetname, - size_t_f *attrnamelen, - _fcd attrname, - size_t_f *size, - void *buf); +/* + * Functions from H5LTfc.c + */ HDF5_HL_F90CSTUBDLL int_f -nh5ltset_attribute_float_c(hid_t_f *loc_id, - size_t_f *namelen, - _fcd dsetname, - size_t_f *attrnamelen, - _fcd attrname, - size_t_f *size, - void *buf); +h5ltmake_dataset_c (hid_t_f *loc_id, + size_t_f *namelen, + _fcd name, + int_f *rank, + hsize_t_f *dims, + hid_t_f *type_id, + void *buf); HDF5_HL_F90CSTUBDLL int_f -nh5ltset_attribute_double_c(hid_t_f *loc_id, - size_t_f *namelen, - _fcd dsetname, - size_t_f *attrnamelen, - _fcd attrname, - size_t_f *size, - void *buf); +h5ltread_dataset_c (hid_t_f *loc_id, + size_t_f *namelen, + _fcd name, + hid_t_f *type_id, + void *buf); HDF5_HL_F90CSTUBDLL int_f -nh5ltset_attribute_string_c(hid_t_f *loc_id, - size_t_f *namelen, - _fcd dsetname, - size_t_f *attrnamelen, - _fcd attrname, - size_t_f *buflen, - void *buf); +h5ltset_attribute_c(hid_t_f *loc_id, + size_t_f *namelen, + _fcd dsetname, + size_t_f *attrnamelen, + _fcd attrname, + size_t_f *size, + void *buf, char *dtype, size_t_f *sizeof_val); HDF5_HL_F90CSTUBDLL int_f -nh5ltget_attribute_int_c(hid_t_f *loc_id, +h5ltget_attribute_c(hid_t_f *loc_id, size_t_f *namelen, _fcd dsetname, size_t_f *attrnamelen, _fcd attrname, - void *buf); - -HDF5_HL_F90CSTUBDLL -int_f -nh5ltget_attribute_float_c(hid_t_f *loc_id, - size_t_f *namelen, - _fcd dsetname, - size_t_f *attrnamelen, - _fcd attrname, - void *buf); - -HDF5_HL_F90CSTUBDLL -int_f -nh5ltget_attribute_double_c(hid_t_f *loc_id, - size_t_f *namelen, - _fcd dsetname, - size_t_f *attrnamelen, - _fcd attrname, - void *buf); + void *buf, char* dtype, size_t_f *sizeof_val); HDF5_HL_F90CSTUBDLL int_f -nh5ltget_attribute_string_c(hid_t_f *loc_id, - size_t_f *namelen, - _fcd dsetname, - size_t_f *attrnamelen, - _fcd attrname, - _fcd buf, - size_t_f *buf_size); +h5ltget_attribute_string_c(hid_t_f *loc_id, + size_t_f *namelen, + _fcd dsetname, + size_t_f *attrnamelen, + _fcd attrname, + _fcd buf, + size_t_f *buf_size); HDF5_HL_F90CSTUBDLL int_f -nh5ltget_dataset_ndims_c(hid_t_f *loc_id, +h5ltget_dataset_ndims_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name, int_f *rank); HDF5_HL_F90CSTUBDLL int_f -nh5ltfind_dataset_c(hid_t_f *loc_id, +h5ltfind_dataset_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name); HDF5_HL_F90CSTUBDLL int_f -nh5ltget_dataset_info_c(hid_t_f *loc_id, +h5ltget_dataset_info_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name, hsize_t_f *dims, @@ -1163,7 +142,7 @@ nh5ltget_dataset_info_c(hid_t_f *loc_id, HDF5_HL_F90CSTUBDLL int_f -nh5ltget_attribute_ndims_c(hid_t_f *loc_id, +h5ltget_attribute_ndims_c(hid_t_f *loc_id, size_t_f *namelen, _fcd dsetname, size_t_f *attrnamelen, @@ -1171,7 +150,7 @@ nh5ltget_attribute_ndims_c(hid_t_f *loc_id, int_f *rank); HDF5_HL_F90CSTUBDLL int_f -nh5ltget_attribute_info_c(hid_t_f *loc_id, +h5ltget_attribute_info_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name, size_t_f *attrnamelen, @@ -1182,7 +161,7 @@ nh5ltget_attribute_info_c(hid_t_f *loc_id, HDF5_HL_F90CSTUBDLL int_f -nh5ltmake_dataset_string_c (hid_t_f *loc_id, +h5ltmake_dataset_string_c (hid_t_f *loc_id, size_t_f *namelen, _fcd name, size_t_f *buflen, @@ -1190,14 +169,14 @@ nh5ltmake_dataset_string_c (hid_t_f *loc_id, HDF5_HL_F90CSTUBDLL int_f -nh5ltread_dataset_string_c (hid_t_f *loc_id, +h5ltread_dataset_string_c (hid_t_f *loc_id, size_t_f *namelen, _fcd name, char *buf); HDF5_HL_F90CSTUBDLL int_f -nh5ltpath_valid_c(hid_t_f *loc_id, +h5ltpath_valid_c(hid_t_f *loc_id, _fcd path, size_t_f *pathlen, int_f *check_object_valid_c); @@ -1206,10 +185,9 @@ nh5ltpath_valid_c(hid_t_f *loc_id, * Image *------------------------------------------------------------------------- */ - HDF5_HL_F90CSTUBDLL int_f -nh5immake_image_8bit_c (hid_t_f *loc_id, +h5immake_image_8bit_c (hid_t_f *loc_id, size_t_f *namelen, _fcd name, hsize_t_f *width, @@ -1217,14 +195,14 @@ nh5immake_image_8bit_c (hid_t_f *loc_id, int_f *buf); HDF5_HL_F90CSTUBDLL int_f -nh5imread_image_c (hid_t_f *loc_id, +h5imread_image_c (hid_t_f *loc_id, size_t_f *namelen, _fcd name, int_f *buf); HDF5_HL_F90CSTUBDLL int_f -nh5immake_image_24bit_c (hid_t_f *loc_id, +h5immake_image_24bit_c (hid_t_f *loc_id, size_t_f *namelen, _fcd name, size_t_f *ilen, @@ -1234,7 +212,7 @@ nh5immake_image_24bit_c (hid_t_f *loc_id, void *buf); HDF5_HL_F90CSTUBDLL int_f -nh5imget_image_info_c(hid_t_f *loc_id, +h5imget_image_info_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name, hsize_t_f *width, @@ -1247,14 +225,14 @@ nh5imget_image_info_c(hid_t_f *loc_id, HDF5_HL_F90CSTUBDLL int_f -nh5imis_image_c(hid_t_f *loc_id, +h5imis_image_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name); HDF5_HL_F90CSTUBDLL int_f -nh5immake_palette_c (hid_t_f *loc_id, +h5immake_palette_c (hid_t_f *loc_id, size_t_f *namelen, _fcd name, hsize_t_f *dims, @@ -1262,7 +240,7 @@ nh5immake_palette_c (hid_t_f *loc_id, HDF5_HL_F90CSTUBDLL int_f -nh5imlink_palette_c (hid_t_f *loc_id, +h5imlink_palette_c (hid_t_f *loc_id, size_t_f *namelen, _fcd name, size_t_f *ilen, @@ -1270,7 +248,7 @@ nh5imlink_palette_c (hid_t_f *loc_id, HDF5_HL_F90CSTUBDLL int_f -nh5imunlink_palette_c (hid_t_f *loc_id, +h5imunlink_palette_c (hid_t_f *loc_id, size_t_f *namelen, _fcd name, size_t_f *ilen, @@ -1278,7 +256,7 @@ nh5imunlink_palette_c (hid_t_f *loc_id, HDF5_HL_F90CSTUBDLL int_f -nh5imget_npalettes_c(hid_t_f *loc_id, +h5imget_npalettes_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name, hsize_t_f *npals); @@ -1286,7 +264,7 @@ nh5imget_npalettes_c(hid_t_f *loc_id, HDF5_HL_F90CSTUBDLL int_f -nh5imget_palette_info_c(hid_t_f *loc_id, +h5imget_palette_info_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name, int_f *pal_number, @@ -1294,7 +272,7 @@ nh5imget_palette_info_c(hid_t_f *loc_id, HDF5_HL_F90CSTUBDLL int_f -nh5imget_palette_c(hid_t_f *loc_id, +h5imget_palette_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name, int_f *pal_number, @@ -1302,7 +280,7 @@ nh5imget_palette_c(hid_t_f *loc_id, HDF5_HL_F90CSTUBDLL int_f -nh5imis_palette_c(hid_t_f *loc_id, +h5imis_palette_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name); @@ -1315,7 +293,7 @@ nh5imis_palette_c(hid_t_f *loc_id, HDF5_HL_F90CSTUBDLL int_f -nh5tbmake_table_c(size_t_f *namelen1, +h5tbmake_table_c(size_t_f *namelen1, _fcd name1, hid_t_f *loc_id, size_t_f *namelen, @@ -1333,7 +311,7 @@ nh5tbmake_table_c(size_t_f *namelen1, HDF5_HL_F90CSTUBDLL int_f -nh5tbwrite_field_name_c(hid_t_f *loc_id, +h5tbwrite_field_name_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name, size_t_f *namelen1, @@ -1343,57 +321,11 @@ nh5tbwrite_field_name_c(hid_t_f *loc_id, size_t_f *type_size, void *buf); -HDF5_HL_F90CSTUBDLL -int_f -nh5tbwrite_field_name_int_c(hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - size_t_f *namelen1, - _fcd field_name, - hsize_t_f *start, - hsize_t_f *nrecords, - size_t_f *type_size, - void *buf); - -HDF5_HL_F90CSTUBDLL -int_f -nh5tbwrite_field_name_fl_c(hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - size_t_f *namelen1, - _fcd field_name, - hsize_t_f *start, - hsize_t_f *nrecords, - size_t_f *type_size, - void *buf); - -HDF5_HL_F90CSTUBDLL -int_f -nh5tbwrite_field_name_dl_c(hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - size_t_f *namelen1, - _fcd field_name, - hsize_t_f *start, - hsize_t_f *nrecords, - size_t_f *type_size, - void *buf); -HDF5_HL_F90CSTUBDLL -int_f -nh5tbwrite_field_name_st_c(hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - size_t_f *namelen1, - _fcd field_name, - hsize_t_f *start, - hsize_t_f *nrecords, - size_t_f *type_size, - void *buf); HDF5_HL_F90CSTUBDLL int_f -nh5tbread_field_name_c(hid_t_f *loc_id, +h5tbread_field_name_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name, size_t_f *namelen1, @@ -1403,57 +335,11 @@ nh5tbread_field_name_c(hid_t_f *loc_id, size_t_f *type_size, void *buf); -HDF5_HL_F90CSTUBDLL -int_f -nh5tbread_field_name_int_c(hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - size_t_f *namelen1, - _fcd field_name, - hsize_t_f *start, - hsize_t_f *nrecords, - size_t_f *type_size, - void *buf); - -HDF5_HL_F90CSTUBDLL -int_f -nh5tbread_field_name_fl_c(hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - size_t_f *namelen1, - _fcd field_name, - hsize_t_f *start, - hsize_t_f *nrecords, - size_t_f *type_size, - void *buf); -HDF5_HL_F90CSTUBDLL -int_f -nh5tbread_field_name_dl_c(hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - size_t_f *namelen1, - _fcd field_name, - hsize_t_f *start, - hsize_t_f *nrecords, - size_t_f *type_size, - void *buf); - -HDF5_HL_F90CSTUBDLL -int_f -nh5tbread_field_name_st_c(hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - size_t_f *namelen1, - _fcd field_name, - hsize_t_f *start, - hsize_t_f *nrecords, - size_t_f *type_size, - void *buf); HDF5_HL_F90CSTUBDLL int_f -nh5tbwrite_field_index_c(hid_t_f *loc_id, +h5tbwrite_field_index_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name, int_f *field_index, @@ -1464,51 +350,7 @@ nh5tbwrite_field_index_c(hid_t_f *loc_id, HDF5_HL_F90CSTUBDLL int_f -nh5tbwrite_field_index_int_c(hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - int_f *field_index, - hsize_t_f *start, - hsize_t_f *nrecords, - size_t_f *type_size, - void *buf); - -HDF5_HL_F90CSTUBDLL -int_f -nh5tbwrite_field_index_fl_c(hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - int_f *field_index, - hsize_t_f *start, - hsize_t_f *nrecords, - size_t_f *type_size, - void *buf); - -HDF5_HL_F90CSTUBDLL -int_f -nh5tbwrite_field_index_dl_c(hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - int_f *field_index, - hsize_t_f *start, - hsize_t_f *nrecords, - size_t_f *type_size, - void *buf); - -HDF5_HL_F90CSTUBDLL -int_f -nh5tbwrite_field_index_st_c(hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - int_f *field_index, - hsize_t_f *start, - hsize_t_f *nrecords, - size_t_f *type_size, - void *buf); - -HDF5_HL_F90CSTUBDLL -int_f -nh5tbread_field_index_c(hid_t_f *loc_id, +h5tbread_field_index_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name, int_f *field_index, @@ -1519,51 +361,7 @@ nh5tbread_field_index_c(hid_t_f *loc_id, HDF5_HL_F90CSTUBDLL int_f -nh5tbread_field_index_int_c(hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - int_f *field_index, - hsize_t_f *start, - hsize_t_f *nrecords, - size_t_f *type_size, - void *buf); - -HDF5_HL_F90CSTUBDLL -int_f -nh5tbread_field_index_fl_c(hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - int_f *field_index, - hsize_t_f *start, - hsize_t_f *nrecords, - size_t_f *type_size, - void *buf); - -HDF5_HL_F90CSTUBDLL -int_f -nh5tbread_field_index_dl_c(hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - int_f *field_index, - hsize_t_f *start, - hsize_t_f *nrecords, - size_t_f *type_size, - void *buf); - -HDF5_HL_F90CSTUBDLL -int_f -nh5tbread_field_index_st_c(hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - int_f *field_index, - hsize_t_f *start, - hsize_t_f *nrecords, - size_t_f *type_size, - void *buf); - -HDF5_HL_F90CSTUBDLL -int_f -nh5tbinsert_field_c(hid_t_f *loc_id, +h5tbinsert_field_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name, size_t_f *namelen1, @@ -1574,47 +372,7 @@ nh5tbinsert_field_c(hid_t_f *loc_id, HDF5_HL_F90CSTUBDLL int_f -nh5tbinsert_field_int_c(hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - size_t_f *namelen1, - _fcd field_name, - hid_t_f *field_type, - int_f *position, - void *buf); -HDF5_HL_F90CSTUBDLL -int_f -nh5tbinsert_field_fl_c(hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - size_t_f *namelen1, - _fcd field_name, - hid_t_f *field_type, - int_f *position, - void *buf); -HDF5_HL_F90CSTUBDLL -int_f -nh5tbinsert_field_dl_c(hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - size_t_f *namelen1, - _fcd field_name, - hid_t_f *field_type, - int_f *position, - void *buf); -HDF5_HL_F90CSTUBDLL -int_f -nh5tbinsert_field_st_c(hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - size_t_f *namelen1, - _fcd field_name, - hid_t_f *field_type, - int_f *position, - void *buf); -HDF5_HL_F90CSTUBDLL -int_f -nh5tbdelete_field_c(hid_t_f *loc_id, +h5tbdelete_field_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name, size_t_f *namelen1, @@ -1623,7 +381,7 @@ nh5tbdelete_field_c(hid_t_f *loc_id, HDF5_HL_F90CSTUBDLL int_f -nh5tbget_table_info_c(hid_t_f *loc_id, +h5tbget_table_info_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name, hsize_t_f *nfields, @@ -1631,7 +389,7 @@ nh5tbget_table_info_c(hid_t_f *loc_id, HDF5_HL_F90CSTUBDLL int_f -nh5tbget_field_info_c(hid_t_f *loc_id, +h5tbget_field_info_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name, hsize_t_f *nfields, diff --git a/hl/fortran/src/H5LTfc.c b/hl/fortran/src/H5LTfc.c index 1e0a236..c955590 100644 --- a/hl/fortran/src/H5LTfc.c +++ b/hl/fortran/src/H5LTfc.c @@ -39,7 +39,7 @@ */ int_f -nh5ltmake_dataset_c (hid_t_f *loc_id, +h5ltmake_dataset_c (hid_t_f *loc_id, size_t_f *namelen, _fcd name, int_f *rank, @@ -89,1081 +89,16 @@ done: return ret_value; } -int_f -nh5ltmake_dataset_int1_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - int_f *rank, - hsize_t_f *dims, - hid_t_f *type_id, - void *buf) -{ - return nh5ltmake_dataset_c (loc_id, namelen, name, rank, dims, type_id, buf); -} -int_f -nh5ltmake_dataset_int2_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - int_f *rank, - hsize_t_f *dims, - hid_t_f *type_id, - void *buf) -{ - return nh5ltmake_dataset_c (loc_id, namelen, name, rank, dims, type_id, buf); -} -int_f -nh5ltmake_dataset_int3_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - int_f *rank, - hsize_t_f *dims, - hid_t_f *type_id, - void *buf) -{ - return nh5ltmake_dataset_c (loc_id, namelen, name, rank, dims, type_id, buf); -} -int_f -nh5ltmake_dataset_int4_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - int_f *rank, - hsize_t_f *dims, - hid_t_f *type_id, - void *buf) -{ - return nh5ltmake_dataset_c (loc_id, namelen, name, rank, dims, type_id, buf); -} -int_f -nh5ltmake_dataset_int5_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - int_f *rank, - hsize_t_f *dims, - hid_t_f *type_id, - void *buf) -{ - return nh5ltmake_dataset_c (loc_id, namelen, name, rank, dims, type_id, buf); -} -int_f -nh5ltmake_dataset_int6_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - int_f *rank, - hsize_t_f *dims, - hid_t_f *type_id, - void *buf) -{ - return nh5ltmake_dataset_c (loc_id, namelen, name, rank, dims, type_id, buf); -} -int_f -nh5ltmake_dataset_int7_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - int_f *rank, - hsize_t_f *dims, - hid_t_f *type_id, - void *buf) -{ - return nh5ltmake_dataset_c (loc_id, namelen, name, rank, dims, type_id, buf); -} -int_f -nh5ltmake_dataset_fl1_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - int_f *rank, - hsize_t_f *dims, - hid_t_f *type_id, - void *buf) -{ - return nh5ltmake_dataset_c (loc_id, namelen, name, rank, dims, type_id, buf); -} -int_f -nh5ltmake_dataset_fl2_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - int_f *rank, - hsize_t_f *dims, - hid_t_f *type_id, - void *buf) -{ - return nh5ltmake_dataset_c (loc_id, namelen, name, rank, dims, type_id, buf); -} -int_f -nh5ltmake_dataset_fl3_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - int_f *rank, - hsize_t_f *dims, - hid_t_f *type_id, - void *buf) -{ - return nh5ltmake_dataset_c (loc_id, namelen, name, rank, dims, type_id, buf); -} -int_f -nh5ltmake_dataset_fl4_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - int_f *rank, - hsize_t_f *dims, - hid_t_f *type_id, - void *buf) -{ - return nh5ltmake_dataset_c (loc_id, namelen, name, rank, dims, type_id, buf); -} -int_f -nh5ltmake_dataset_fl5_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - int_f *rank, - hsize_t_f *dims, - hid_t_f *type_id, - void *buf) -{ - return nh5ltmake_dataset_c (loc_id, namelen, name, rank, dims, type_id, buf); -} -int_f -nh5ltmake_dataset_fl6_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - int_f *rank, - hsize_t_f *dims, - hid_t_f *type_id, - void *buf) -{ - return nh5ltmake_dataset_c (loc_id, namelen, name, rank, dims, type_id, buf); -} -int_f -nh5ltmake_dataset_fl7_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - int_f *rank, - hsize_t_f *dims, - hid_t_f *type_id, - void *buf) -{ - return nh5ltmake_dataset_c (loc_id, namelen, name, rank, dims, type_id, buf); -} -int_f -nh5ltmake_dataset_dl1_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - int_f *rank, - hsize_t_f *dims, - hid_t_f *type_id, - void *buf) -{ - return nh5ltmake_dataset_c (loc_id, namelen, name, rank, dims, type_id, buf); -} -int_f -nh5ltmake_dataset_dl2_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - int_f *rank, - hsize_t_f *dims, - hid_t_f *type_id, - void *buf) -{ - return nh5ltmake_dataset_c (loc_id, namelen, name, rank, dims, type_id, buf); -} -int_f -nh5ltmake_dataset_dl3_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - int_f *rank, - hsize_t_f *dims, - hid_t_f *type_id, - void *buf) -{ - return nh5ltmake_dataset_c (loc_id, namelen, name, rank, dims, type_id, buf); -} -int_f -nh5ltmake_dataset_dl4_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - int_f *rank, - hsize_t_f *dims, - hid_t_f *type_id, - void *buf) -{ - return nh5ltmake_dataset_c (loc_id, namelen, name, rank, dims, type_id, buf); -} -int_f -nh5ltmake_dataset_dl5_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - int_f *rank, - hsize_t_f *dims, - hid_t_f *type_id, - void *buf) -{ - return nh5ltmake_dataset_c (loc_id, namelen, name, rank, dims, type_id, buf); -} -int_f -nh5ltmake_dataset_dl6_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - int_f *rank, - hsize_t_f *dims, - hid_t_f *type_id, - void *buf) -{ - return nh5ltmake_dataset_c (loc_id, namelen, name, rank, dims, type_id, buf); -} -int_f -nh5ltmake_dataset_dl7_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - int_f *rank, - hsize_t_f *dims, - hid_t_f *type_id, - void *buf) -{ - return nh5ltmake_dataset_c (loc_id, namelen, name, rank, dims, type_id, buf); -} -int_f -nh5ltmake_dataset_nint1_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - int_f *rank, - hsize_t_f *dims, - hid_t_f *type_id, - void *buf) -{ - return nh5ltmake_dataset_c (loc_id, namelen, name, rank, dims, type_id, buf); -} -int_f -nh5ltmake_dataset_nint2_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - int_f *rank, - hsize_t_f *dims, - hid_t_f *type_id, - void *buf) -{ - return nh5ltmake_dataset_c (loc_id, namelen, name, rank, dims, type_id, buf); -} -int_f -nh5ltmake_dataset_nint3_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - int_f *rank, - hsize_t_f *dims, - hid_t_f *type_id, - void *buf) -{ - return nh5ltmake_dataset_c (loc_id, namelen, name, rank, dims, type_id, buf); -} -int_f -nh5ltmake_dataset_nint4_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - int_f *rank, - hsize_t_f *dims, - hid_t_f *type_id, - void *buf) -{ - return nh5ltmake_dataset_c (loc_id, namelen, name, rank, dims, type_id, buf); -} -int_f -nh5ltmake_dataset_nint5_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - int_f *rank, - hsize_t_f *dims, - hid_t_f *type_id, - void *buf) -{ - return nh5ltmake_dataset_c (loc_id, namelen, name, rank, dims, type_id, buf); -} -int_f -nh5ltmake_dataset_nint6_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - int_f *rank, - hsize_t_f *dims, - hid_t_f *type_id, - void *buf) -{ - return nh5ltmake_dataset_c (loc_id, namelen, name, rank, dims, type_id, buf); -} -int_f -nh5ltmake_dataset_nint7_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - int_f *rank, - hsize_t_f *dims, - hid_t_f *type_id, - void *buf) -{ - return nh5ltmake_dataset_c (loc_id, namelen, name, rank, dims, type_id, buf); -} -int_f -nh5ltmake_dataset_nfl1_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - int_f *rank, - hsize_t_f *dims, - hid_t_f *type_id, - void *buf) -{ - return nh5ltmake_dataset_c (loc_id, namelen, name, rank, dims, type_id, buf); -} -int_f -nh5ltmake_dataset_nfl2_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - int_f *rank, - hsize_t_f *dims, - hid_t_f *type_id, - void *buf) -{ - return nh5ltmake_dataset_c (loc_id, namelen, name, rank, dims, type_id, buf); -} -int_f -nh5ltmake_dataset_nfl3_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - int_f *rank, - hsize_t_f *dims, - hid_t_f *type_id, - void *buf) -{ - return nh5ltmake_dataset_c (loc_id, namelen, name, rank, dims, type_id, buf); -} -int_f -nh5ltmake_dataset_nfl4_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - int_f *rank, - hsize_t_f *dims, - hid_t_f *type_id, - void *buf) -{ - return nh5ltmake_dataset_c (loc_id, namelen, name, rank, dims, type_id, buf); -} -int_f -nh5ltmake_dataset_nfl5_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - int_f *rank, - hsize_t_f *dims, - hid_t_f *type_id, - void *buf) -{ - return nh5ltmake_dataset_c (loc_id, namelen, name, rank, dims, type_id, buf); -} -int_f -nh5ltmake_dataset_nfl6_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - int_f *rank, - hsize_t_f *dims, - hid_t_f *type_id, - void *buf) -{ - return nh5ltmake_dataset_c (loc_id, namelen, name, rank, dims, type_id, buf); -} -int_f -nh5ltmake_dataset_nfl7_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - int_f *rank, - hsize_t_f *dims, - hid_t_f *type_id, - void *buf) -{ - return nh5ltmake_dataset_c (loc_id, namelen, name, rank, dims, type_id, buf); -} -int_f -nh5ltmake_dataset_ndl1_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - int_f *rank, - hsize_t_f *dims, - hid_t_f *type_id, - void *buf) -{ - return nh5ltmake_dataset_c (loc_id, namelen, name, rank, dims, type_id, buf); -} -int_f -nh5ltmake_dataset_ndl2_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - int_f *rank, - hsize_t_f *dims, - hid_t_f *type_id, - void *buf) -{ - return nh5ltmake_dataset_c (loc_id, namelen, name, rank, dims, type_id, buf); -} -int_f -nh5ltmake_dataset_ndl3_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - int_f *rank, - hsize_t_f *dims, - hid_t_f *type_id, - void *buf) -{ - return nh5ltmake_dataset_c (loc_id, namelen, name, rank, dims, type_id, buf); -} -int_f -nh5ltmake_dataset_ndl4_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - int_f *rank, - hsize_t_f *dims, - hid_t_f *type_id, - void *buf) -{ - return nh5ltmake_dataset_c (loc_id, namelen, name, rank, dims, type_id, buf); -} -int_f -nh5ltmake_dataset_ndl5_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - int_f *rank, - hsize_t_f *dims, - hid_t_f *type_id, - void *buf) -{ - return nh5ltmake_dataset_c (loc_id, namelen, name, rank, dims, type_id, buf); -} -int_f -nh5ltmake_dataset_ndl6_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - int_f *rank, - hsize_t_f *dims, - hid_t_f *type_id, - void *buf) -{ - return nh5ltmake_dataset_c (loc_id, namelen, name, rank, dims, type_id, buf); -} -int_f -nh5ltmake_dataset_ndl7_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - int_f *rank, - hsize_t_f *dims, - hid_t_f *type_id, - void *buf) -{ - return nh5ltmake_dataset_c (loc_id, namelen, name, rank, dims, type_id, buf); -} -/*------------------------------------------------------------------------- -* Function: H5LTread_dataset_c -* -* Purpose: Call H5LTmake_dataset -* -* Return: Success: 0, Failure: -1 -* -* Programmer: pvn@ncsa.uiuc.edu -* -* Date: September 09, 2004 -* -* Comments: -* -* Modifications: -* -* -*------------------------------------------------------------------------- -*/ - -int_f -nh5ltread_dataset_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - hid_t_f *type_id, - void *buf, - hsize_t_f *dims) -{ - int ret_value = -1; - herr_t ret; - hid_t c_loc_id; - hid_t c_type_id; - char *c_name = NULL; - - /* - * convert FORTRAN name to C name - */ - c_name = (char *)HD5f2cstring(name, (size_t)*namelen); - if (c_name == NULL) - goto done; - - /* - * call H5LTread_dataset function. - */ - c_loc_id = (hid_t)*loc_id; - c_type_id = (hid_t)*type_id; - - ret = H5LTread_dataset(c_loc_id, c_name, c_type_id, buf ); - - if (ret < 0) - goto done; - - ret_value = 0; - -done: - if(c_name!=NULL) - HDfree(c_name); - - return ret_value; -} - -int_f -nh5ltread_dataset_int1_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - hid_t_f *type_id, - void *buf, - hsize_t_f *dims) -{ - return nh5ltread_dataset_c(loc_id, namelen, name, type_id, buf, dims); -} -int_f -nh5ltread_dataset_int2_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - hid_t_f *type_id, - void *buf, - hsize_t_f *dims) -{ - return nh5ltread_dataset_c(loc_id, namelen, name, type_id, buf, dims); -} -int_f -nh5ltread_dataset_int3_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - hid_t_f *type_id, - void *buf, - hsize_t_f *dims) -{ - return nh5ltread_dataset_c(loc_id, namelen, name, type_id, buf, dims); -} -int_f -nh5ltread_dataset_int4_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - hid_t_f *type_id, - void *buf, - hsize_t_f *dims) -{ - return nh5ltread_dataset_c(loc_id, namelen, name, type_id, buf, dims); -} -int_f -nh5ltread_dataset_int5_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - hid_t_f *type_id, - void *buf, - hsize_t_f *dims) -{ - return nh5ltread_dataset_c(loc_id, namelen, name, type_id, buf, dims); -} -int_f -nh5ltread_dataset_int6_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - hid_t_f *type_id, - void *buf, - hsize_t_f *dims) -{ - return nh5ltread_dataset_c(loc_id, namelen, name, type_id, buf, dims); -} -int_f -nh5ltread_dataset_int7_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - hid_t_f *type_id, - void *buf, - hsize_t_f *dims) -{ - return nh5ltread_dataset_c(loc_id, namelen, name, type_id, buf, dims); -} -int_f -nh5ltread_dataset_fl1_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - hid_t_f *type_id, - void *buf, - hsize_t_f *dims) -{ - return nh5ltread_dataset_c(loc_id, namelen, name, type_id, buf, dims); -} -int_f -nh5ltread_dataset_fl2_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - hid_t_f *type_id, - void *buf, - hsize_t_f *dims) -{ - return nh5ltread_dataset_c(loc_id, namelen, name, type_id, buf, dims); -} -int_f -nh5ltread_dataset_fl3_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - hid_t_f *type_id, - void *buf, - hsize_t_f *dims) -{ - return nh5ltread_dataset_c(loc_id, namelen, name, type_id, buf, dims); -} -int_f -nh5ltread_dataset_fl4_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - hid_t_f *type_id, - void *buf, - hsize_t_f *dims) -{ - return nh5ltread_dataset_c(loc_id, namelen, name, type_id, buf, dims); -} -int_f -nh5ltread_dataset_fl5_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - hid_t_f *type_id, - void *buf, - hsize_t_f *dims) -{ - return nh5ltread_dataset_c(loc_id, namelen, name, type_id, buf, dims); -} -int_f -nh5ltread_dataset_fl6_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - hid_t_f *type_id, - void *buf, - hsize_t_f *dims) -{ - return nh5ltread_dataset_c(loc_id, namelen, name, type_id, buf, dims); -} -int_f -nh5ltread_dataset_fl7_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - hid_t_f *type_id, - void *buf, - hsize_t_f *dims) -{ - return nh5ltread_dataset_c(loc_id, namelen, name, type_id, buf, dims); -} -int_f -nh5ltread_dataset_dl1_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - hid_t_f *type_id, - void *buf, - hsize_t_f *dims) -{ - return nh5ltread_dataset_c(loc_id, namelen, name, type_id, buf, dims); -} -int_f -nh5ltread_dataset_dl2_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - hid_t_f *type_id, - void *buf, - hsize_t_f *dims) -{ - return nh5ltread_dataset_c(loc_id, namelen, name, type_id, buf, dims); -} -int_f -nh5ltread_dataset_dl3_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - hid_t_f *type_id, - void *buf, - hsize_t_f *dims) -{ - return nh5ltread_dataset_c(loc_id, namelen, name, type_id, buf, dims); -} -int_f -nh5ltread_dataset_dl4_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - hid_t_f *type_id, - void *buf, - hsize_t_f *dims) -{ - return nh5ltread_dataset_c(loc_id, namelen, name, type_id, buf, dims); -} -int_f -nh5ltread_dataset_dl5_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - hid_t_f *type_id, - void *buf, - hsize_t_f *dims) -{ - return nh5ltread_dataset_c(loc_id, namelen, name, type_id, buf, dims); -} -int_f -nh5ltread_dataset_dl6_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - hid_t_f *type_id, - void *buf, - hsize_t_f *dims) -{ - return nh5ltread_dataset_c(loc_id, namelen, name, type_id, buf, dims); -} -int_f -nh5ltread_dataset_dl7_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - hid_t_f *type_id, - void *buf, - hsize_t_f *dims) -{ - return nh5ltread_dataset_c(loc_id, namelen, name, type_id, buf, dims); -} -int_f -nh5ltread_dataset_nint1_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - hid_t_f *type_id, - void *buf, - hsize_t_f *dims) -{ - return nh5ltread_dataset_c(loc_id, namelen, name, type_id, buf, dims); -} -int_f -nh5ltread_dataset_nint2_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - hid_t_f *type_id, - void *buf, - hsize_t_f *dims) -{ - return nh5ltread_dataset_c(loc_id, namelen, name, type_id, buf, dims); -} -int_f -nh5ltread_dataset_nint3_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - hid_t_f *type_id, - void *buf, - hsize_t_f *dims) -{ - return nh5ltread_dataset_c(loc_id, namelen, name, type_id, buf, dims); -} -int_f -nh5ltread_dataset_nint4_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - hid_t_f *type_id, - void *buf, - hsize_t_f *dims) -{ - return nh5ltread_dataset_c(loc_id, namelen, name, type_id, buf, dims); -} -int_f -nh5ltread_dataset_nint5_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - hid_t_f *type_id, - void *buf, - hsize_t_f *dims) -{ - return nh5ltread_dataset_c(loc_id, namelen, name, type_id, buf, dims); -} -int_f -nh5ltread_dataset_nint6_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - hid_t_f *type_id, - void *buf, - hsize_t_f *dims) -{ - return nh5ltread_dataset_c(loc_id, namelen, name, type_id, buf, dims); -} -int_f -nh5ltread_dataset_nint7_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - hid_t_f *type_id, - void *buf, - hsize_t_f *dims) -{ - return nh5ltread_dataset_c(loc_id, namelen, name, type_id, buf, dims); -} -int_f -nh5ltread_dataset_nfl1_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - hid_t_f *type_id, - void *buf, - hsize_t_f *dims) -{ - return nh5ltread_dataset_c(loc_id, namelen, name, type_id, buf, dims); -} -int_f -nh5ltread_dataset_nfl2_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - hid_t_f *type_id, - void *buf, - hsize_t_f *dims) -{ - return nh5ltread_dataset_c(loc_id, namelen, name, type_id, buf, dims); -} -int_f -nh5ltread_dataset_nfl3_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - hid_t_f *type_id, - void *buf, - hsize_t_f *dims) -{ - return nh5ltread_dataset_c(loc_id, namelen, name, type_id, buf, dims); -} -int_f -nh5ltread_dataset_nfl4_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - hid_t_f *type_id, - void *buf, - hsize_t_f *dims) -{ - return nh5ltread_dataset_c(loc_id, namelen, name, type_id, buf, dims); -} -int_f -nh5ltread_dataset_nfl5_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - hid_t_f *type_id, - void *buf, - hsize_t_f *dims) -{ - return nh5ltread_dataset_c(loc_id, namelen, name, type_id, buf, dims); -} -int_f -nh5ltread_dataset_nfl6_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - hid_t_f *type_id, - void *buf, - hsize_t_f *dims) -{ - return nh5ltread_dataset_c(loc_id, namelen, name, type_id, buf, dims); -} -int_f -nh5ltread_dataset_nfl7_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - hid_t_f *type_id, - void *buf, - hsize_t_f *dims) -{ - return nh5ltread_dataset_c(loc_id, namelen, name, type_id, buf, dims); -} -int_f -nh5ltread_dataset_ndl1_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - hid_t_f *type_id, - void *buf, - hsize_t_f *dims) -{ - return nh5ltread_dataset_c(loc_id, namelen, name, type_id, buf, dims); -} -int_f -nh5ltread_dataset_ndl2_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - hid_t_f *type_id, - void *buf, - hsize_t_f *dims) -{ - return nh5ltread_dataset_c(loc_id, namelen, name, type_id, buf, dims); -} -int_f -nh5ltread_dataset_ndl3_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - hid_t_f *type_id, - void *buf, - hsize_t_f *dims) -{ - return nh5ltread_dataset_c(loc_id, namelen, name, type_id, buf, dims); -} -int_f -nh5ltread_dataset_ndl4_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - hid_t_f *type_id, - void *buf, - hsize_t_f *dims) -{ - return nh5ltread_dataset_c(loc_id, namelen, name, type_id, buf, dims); -} -int_f -nh5ltread_dataset_ndl5_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - hid_t_f *type_id, - void *buf, - hsize_t_f *dims) -{ - return nh5ltread_dataset_c(loc_id, namelen, name, type_id, buf, dims); -} -int_f -nh5ltread_dataset_ndl6_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - hid_t_f *type_id, - void *buf, - hsize_t_f *dims) -{ - return nh5ltread_dataset_c(loc_id, namelen, name, type_id, buf, dims); -} -int_f -nh5ltread_dataset_ndl7_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - hid_t_f *type_id, - void *buf, - hsize_t_f *dims) -{ - return nh5ltread_dataset_c(loc_id, namelen, name, type_id, buf, dims); -} -/*------------------------------------------------------------------------- -* Function: H5LTmake_dataset_string_c -* -* Purpose: Call H5LTmake_dataset -* -* Return: Success: 0, Failure: -1 -* -* Programmer: pvn@ncsa.uiuc.edu -* -* Date: September 09, 2004 -* -* Comments: -* -* Modifications: -* -* -*------------------------------------------------------------------------- -*/ - -int_f -nh5ltmake_dataset_string_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - size_t_f *buflen, - char *buf) -{ - int ret_value = -1; - herr_t ret; - hid_t c_loc_id; - char *c_name = NULL; - char *c_buf = NULL; - - /* - * convert FORTRAN name to C name - */ - c_name = (char *)HD5f2cstring(name, (size_t)*namelen); - if (c_name == NULL) - goto done; - - c_buf = (char *)HD5f2cstring(buf, (size_t)*buflen); - if (c_buf == NULL) - goto done; - - /* - * call H5LTmake_dataset_string function. - */ - c_loc_id = (hid_t)*loc_id; - - ret = H5LTmake_dataset_string(c_loc_id,c_name,c_buf); - - if (ret < 0) - goto done; - - ret_value = 0; - -done: - if(c_name!=NULL) - HDfree(c_name); - if(c_buf!=NULL) - HDfree(c_buf); - - return ret_value; -} - - -/*------------------------------------------------------------------------- -* Function: H5LTread_dataset_string_c -* -* Purpose: Call H5LTread_dataset_string -* -* Return: Success: 0, Failure: -1 -* -* Programmer: pvn@ncsa.uiuc.edu -* -* Date: September 09, 2004 -* -* Comments: -* -* Modifications: -* -* -*------------------------------------------------------------------------- -*/ - -int_f -nh5ltread_dataset_string_c (hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - char *buf) -{ - int ret_value = -1; - herr_t ret; - hid_t c_loc_id; - char *c_name = NULL; - - /* - * convert FORTRAN name to C name - */ - c_name = (char *)HD5f2cstring(name, (size_t)*namelen); - if (c_name == NULL) - goto done; - - /* - * call H5LTread_dataset_string function. - */ - c_loc_id = (hid_t)*loc_id; - - ret = H5LTread_dataset_string(c_loc_id,c_name,buf); - - if (ret < 0) - goto done; - - ret_value = 0; - -done: - if(c_name!=NULL) - HDfree(c_name); - - return ret_value; -} - - - /*------------------------------------------------------------------------- -* Function: H5LTset_attribute_int_c +* Function: H5LTread_dataset_c * -* Purpose: Call H5LTset_attribute_int +* Purpose: Call H5LTmake_dataset * * Return: Success: 0, Failure: -1 * * Programmer: pvn@ncsa.uiuc.edu * -* Date: October 05, 2004 +* Date: September 09, 2004 * * Comments: * @@ -1174,46 +109,32 @@ done: */ int_f -nh5ltset_attribute_int_c(hid_t_f *loc_id, - size_t_f *namelen, - _fcd dsetname, - size_t_f *attrnamelen, - _fcd attrname, - size_t_f *size, - void *buf) +h5ltread_dataset_c (hid_t_f *loc_id, + size_t_f *namelen, + _fcd name, + hid_t_f *type_id, + void *buf) { int ret_value = -1; herr_t ret; hid_t c_loc_id; + hid_t c_type_id; char *c_name = NULL; - char *c_attrname = NULL; - size_t c_size; /* * convert FORTRAN name to C name */ - c_name = (char *)HD5f2cstring(dsetname, (size_t)*namelen); + c_name = (char *)HD5f2cstring(name, (size_t)*namelen); if (c_name == NULL) goto done; - c_attrname = (char *)HD5f2cstring(attrname, (size_t)*attrnamelen); - if (c_attrname == NULL) - goto done; - /* - * call H5LTset_attribute_int function. + * call H5LTread_dataset function. */ c_loc_id = (hid_t)*loc_id; - c_size = (size_t)*size; + c_type_id = (hid_t)*type_id; - if (sizeof(int_f) == sizeof(int)) - ret = H5LTset_attribute_int(c_loc_id,c_name,c_attrname,(const int *)buf,c_size); - else if (sizeof(int_f) == sizeof(long)) - ret = H5LTset_attribute_long(c_loc_id,c_name,c_attrname,(const long *)buf,c_size); - else if (sizeof(int_f) == sizeof(long long)) - ret = H5LTset_attribute_long_long(c_loc_id,c_name,c_attrname,(const long long *)buf,c_size); - else - goto done; + ret = H5LTread_dataset(c_loc_id, c_name, c_type_id, buf ); if (ret < 0) goto done; @@ -1223,22 +144,20 @@ nh5ltset_attribute_int_c(hid_t_f *loc_id, done: if(c_name!=NULL) HDfree(c_name); - if(c_attrname!=NULL) - HDfree(c_attrname); return ret_value; } /*------------------------------------------------------------------------- -* Function: H5LTset_attribute_float_c +* Function: H5LTmake_dataset_string_c * -* Purpose: Call H5LTset_attribute_float +* Purpose: Call H5LTmake_dataset * * Return: Success: 0, Failure: -1 * * Programmer: pvn@ncsa.uiuc.edu * -* Date: October 05, 2004 +* Date: September 09, 2004 * * Comments: * @@ -1249,65 +168,61 @@ done: */ int_f -nh5ltset_attribute_float_c(hid_t_f *loc_id, - size_t_f *namelen, - _fcd dsetname, - size_t_f *attrnamelen, - _fcd attrname, - size_t_f *size, - void *buf) +h5ltmake_dataset_string_c (hid_t_f *loc_id, + size_t_f *namelen, + _fcd name, + size_t_f *buflen, + char *buf) { int ret_value = -1; herr_t ret; hid_t c_loc_id; char *c_name = NULL; - char *c_attrname = NULL; - size_t c_size; + char *c_buf = NULL; /* * convert FORTRAN name to C name */ - c_name = (char *)HD5f2cstring(dsetname, (size_t)*namelen); + c_name = (char *)HD5f2cstring(name, (size_t)*namelen); if (c_name == NULL) - goto done; + goto done; - c_attrname = (char *)HD5f2cstring(attrname, (size_t)*attrnamelen); - if (c_attrname == NULL) - goto done; + c_buf = (char *)HD5f2cstring(buf, (size_t)*buflen); + if (c_buf == NULL) + goto done; /* - * Call H5LTset_attribute_float function. + * call H5LTmake_dataset_string function. */ c_loc_id = (hid_t)*loc_id; - c_size = (size_t)*size; - ret = H5LTset_attribute_float(c_loc_id,c_name,c_attrname,(float *)buf,c_size); + ret = H5LTmake_dataset_string(c_loc_id,c_name,c_buf); if (ret < 0) - goto done; + goto done; ret_value = 0; done: if(c_name!=NULL) HDfree(c_name); - if(c_attrname!=NULL) - HDfree(c_attrname); + if(c_buf!=NULL) + HDfree(c_buf); return ret_value; } /*------------------------------------------------------------------------- -* Function: H5LTset_attribute_double_c +* Function: H5LTread_dataset_string_c * -* Purpose: Call H5LTset_attribute_double +* Purpose: Call H5LTread_dataset_string * * Return: Success: 0, Failure: -1 * * Programmer: pvn@ncsa.uiuc.edu * -* Date: October 05, 2004 +* Date: September 09, 2004 * * Comments: * @@ -1318,59 +233,46 @@ done: */ int_f -nh5ltset_attribute_double_c(hid_t_f *loc_id, +h5ltread_dataset_string_c (hid_t_f *loc_id, size_t_f *namelen, - _fcd dsetname, - size_t_f *attrnamelen, - _fcd attrname, - size_t_f *size, - void *buf) + _fcd name, + char *buf) { int ret_value = -1; herr_t ret; hid_t c_loc_id; char *c_name = NULL; - char *c_attrname = NULL; - size_t c_size; /* - * Convert FORTRAN name to C name + * convert FORTRAN name to C name */ - c_name = (char *)HD5f2cstring(dsetname, (size_t)*namelen); + c_name = (char *)HD5f2cstring(name, (size_t)*namelen); if (c_name == NULL) goto done; - c_attrname = (char *)HD5f2cstring(attrname, (size_t)*attrnamelen); - if (c_attrname == NULL) - goto done; - /* - * Call H5LTset_attribute_double function. + * call H5LTread_dataset_string function. */ c_loc_id = (hid_t)*loc_id; - c_size = (size_t)*size; - ret = H5LTset_attribute_double(c_loc_id,c_name,c_attrname,(double *)buf,c_size); + ret = H5LTread_dataset_string(c_loc_id,c_name,buf); if (ret < 0) goto done; ret_value = 0; - done: if(c_name!=NULL) HDfree(c_name); - if(c_attrname!=NULL) - HDfree(c_attrname); return ret_value; } /*------------------------------------------------------------------------- -* Function: H5LTset_attribute_string_c +* Function: H5LTset_attribute_int_c * -* Purpose: Call H5LTset_attribute_string +* Purpose: Call H5LTset_attribute_int * * Return: Success: 0, Failure: -1 * @@ -1387,13 +289,13 @@ done: */ int_f -nh5ltset_attribute_string_c(hid_t_f *loc_id, - size_t_f *namelen, - _fcd dsetname, - size_t_f *attrnamelen, - _fcd attrname, - size_t_f *buflen, - void *buf) +h5ltset_attribute_c(hid_t_f *loc_id, + size_t_f *namelen, + _fcd dsetname, + size_t_f *attrnamelen, + _fcd attrname, + size_t_f *size, + void *buf, char *dtype, size_t_f *sizeof_val) { int ret_value = -1; herr_t ret; @@ -1401,6 +303,7 @@ nh5ltset_attribute_string_c(hid_t_f *loc_id, char *c_name = NULL; char *c_attrname = NULL; char *c_buf = NULL; + size_t c_size; /* * convert FORTRAN name to C name @@ -1413,28 +316,49 @@ nh5ltset_attribute_string_c(hid_t_f *loc_id, if (c_attrname == NULL) goto done; - c_buf = (char *)HD5f2cstring((_fcd)buf, (size_t)*buflen); - if (c_buf == NULL) - goto done; - - /* - * call H5LTset_attribute_string function. + * call H5LTset_attribute_int function. */ c_loc_id = (hid_t)*loc_id; + c_size = (size_t)*size; - ret = H5LTset_attribute_string(c_loc_id,c_name,c_attrname,c_buf); - + if( HDstrncmp(dtype,"I",1) == 0 ) { + if ((size_t)*sizeof_val == sizeof(int)) + ret = H5LT_set_attribute_numerical(c_loc_id,c_name,c_attrname, c_size, H5T_NATIVE_INT, (const int *)buf); + else if ((size_t)*sizeof_val == sizeof(long)) + ret = H5LT_set_attribute_numerical(c_loc_id,c_name,c_attrname, c_size, H5T_NATIVE_LONG, (const long *)buf); + else if ((size_t)*sizeof_val == sizeof(long long)) + ret = H5LT_set_attribute_numerical(c_loc_id,c_name,c_attrname, c_size, H5T_NATIVE_LLONG, (const long long *)buf); + else + goto done; + } else if ( HDstrncmp(dtype,"R",1) == 0 ) { + if((size_t)*sizeof_val == sizeof(float)) + ret = H5LT_set_attribute_numerical(c_loc_id,c_name,c_attrname, c_size, H5T_NATIVE_FLOAT, (const float *)buf); + else if((size_t)*sizeof_val == sizeof(double)) + ret = H5LT_set_attribute_numerical(c_loc_id,c_name,c_attrname, c_size, H5T_NATIVE_DOUBLE, (const double *)buf); +#if H5_SIZEOF_LONG_DOUBLE !=0 + else if((size_t)*sizeof_val == sizeof(long double)) + ret = H5LT_set_attribute_numerical(c_loc_id,c_name,c_attrname, c_size, H5T_NATIVE_LDOUBLE, (const long double *)buf); +#endif + else + goto done; + } else if ( HDstrncmp(dtype,"C",1) == 0 ) { + + c_buf = (char *)HD5f2cstring((_fcd)buf, c_size); + if (c_buf == NULL) + goto done; + + ret = H5LTset_attribute_string(c_loc_id,c_name,c_attrname,c_buf); + } if (ret < 0) - goto done; + goto done; ret_value = 0; - done: if(c_name!=NULL) HDfree(c_name); - if(c_attrname!=NULL) + if(c_attrname!=NULL) HDfree(c_attrname); if(c_buf!=NULL) HDfree(c_buf); @@ -1443,7 +367,7 @@ done: } /*------------------------------------------------------------------------- -* Function: H5LTget_attribute_int_c +* Function: H5LTget_attribute_c * * Purpose: Call H5LTget_attribute_int * @@ -1462,86 +386,12 @@ done: */ int_f -nh5ltget_attribute_int_c(hid_t_f *loc_id, +h5ltget_attribute_c(hid_t_f *loc_id, size_t_f *namelen, _fcd dsetname, size_t_f *attrnamelen, _fcd attrname, - void *buf) -{ - int ret_value = -1; - herr_t ret; - hid_t c_loc_id; - char *c_name = NULL; - char *c_attrname = NULL; - - /* - * convert FORTRAN name to C name - */ - c_name = (char *)HD5f2cstring(dsetname, (size_t)*namelen); - if (c_name == NULL) - goto done; - - c_attrname = (char *)HD5f2cstring(attrname, (size_t)*attrnamelen); - if (c_attrname == NULL) - goto done; - - /* - * call H5LTget_attribute_int function. - */ - c_loc_id = (hid_t)*loc_id; - - if(sizeof(int_f) == sizeof(int)) - ret = H5LTget_attribute_int(c_loc_id,c_name,c_attrname,(int *)buf); - else if (sizeof(int_f) == sizeof(long)) - ret = H5LTget_attribute_long(c_loc_id,c_name,c_attrname,(long *)buf); - else if (sizeof(int_f) == sizeof(long long)) - ret = H5LTget_attribute_long_long(c_loc_id,c_name,c_attrname,(long long *)buf); - else - goto done; - - if (ret < 0) - goto done; - - ret_value = 0; - -done: - if(c_name!=NULL) - HDfree(c_name); - if(c_attrname!=NULL) - HDfree(c_attrname); - - - return ret_value; -} - - -/*------------------------------------------------------------------------- -* Function: H5LTget_attribute_float_c -* -* Purpose: Call H5LTget_attribute_float -* -* Return: Success: 0, Failure: -1 -* -* Programmer: pvn@ncsa.uiuc.edu -* -* Date: October 05, 2004 -* -* Comments: -* -* Modifications: -* -* -*------------------------------------------------------------------------- -*/ - -int_f -nh5ltget_attribute_float_c(hid_t_f *loc_id, - size_t_f *namelen, - _fcd dsetname, - size_t_f *attrnamelen, - _fcd attrname, - void *buf) + void *buf, char *dtype, size_t_f *sizeof_val) { int ret_value = -1; herr_t ret; @@ -1565,79 +415,33 @@ nh5ltget_attribute_float_c(hid_t_f *loc_id, */ c_loc_id = (hid_t)*loc_id; - ret = H5LTget_attribute_float(c_loc_id,c_name,c_attrname,(float*)buf); - - if (ret < 0) - goto done; - - ret_value = 0; - -done: - if(c_name!=NULL) - HDfree(c_name); - if(c_attrname!=NULL) - HDfree(c_attrname); - - return ret_value; -} - -/*------------------------------------------------------------------------- -* Function: H5LTget_attribute_double_c -* -* Purpose: Call H5LTget_attribute_double -* -* Return: Success: 0, Failure: -1 -* -* Programmer: pvn@ncsa.uiuc.edu -* -* Date: October 05, 2004 -* -* Comments: -* -* Modifications: -* -* -*------------------------------------------------------------------------- -*/ - -int_f -nh5ltget_attribute_double_c(hid_t_f *loc_id, - size_t_f *namelen, - _fcd dsetname, - size_t_f *attrnamelen, - _fcd attrname, - void *buf) -{ - int ret_value = -1; - herr_t ret; - hid_t c_loc_id; - char *c_name = NULL; - char *c_attrname = NULL; - - /* - * convert FORTRAN name to C name - */ - c_name = (char *)HD5f2cstring(dsetname, (size_t)*namelen); - if (c_name == NULL) - goto done; - - c_attrname = (char *)HD5f2cstring(attrname, (size_t)*attrnamelen); - if (c_attrname == NULL) + if( HDstrncmp(dtype,"I",1) == 0) { + if((size_t)*sizeof_val == sizeof(int)) + ret = H5LTget_attribute(c_loc_id,c_name,c_attrname,H5T_NATIVE_INT,buf); + else if ((size_t)*sizeof_val == sizeof(long)) + ret = H5LTget_attribute(c_loc_id,c_name,c_attrname,H5T_NATIVE_LONG,buf); + else if ((size_t)*sizeof_val == sizeof(long long)) + ret = H5LTget_attribute(c_loc_id,c_name,c_attrname,H5T_NATIVE_LLONG,buf); + else + goto done; + } else if ( HDstrncmp(dtype,"R",1) == 0 ) { + if((size_t)*sizeof_val == sizeof(float)) + ret = H5LTget_attribute(c_loc_id,c_name,c_attrname,H5T_NATIVE_FLOAT,buf); + else if((size_t)*sizeof_val == sizeof(double)) + ret = H5LTget_attribute(c_loc_id,c_name,c_attrname,H5T_NATIVE_DOUBLE,buf); +#if H5_SIZEOF_LONG_DOUBLE !=0 + else if((size_t)*sizeof_val == sizeof(long double)) + ret = H5LTget_attribute(c_loc_id,c_name,c_attrname,H5T_NATIVE_LDOUBLE,buf); +#endif + else goto done; - - /* - * call H5LTget_attribute_int function. - */ - c_loc_id = (hid_t)*loc_id; - - ret = H5LTget_attribute_double(c_loc_id,c_name,c_attrname,(double *)buf); - + } + if (ret < 0) goto done; ret_value = 0; - done: if(c_name!=NULL) HDfree(c_name); @@ -1667,7 +471,7 @@ done: */ int_f -nh5ltget_attribute_string_c(hid_t_f *loc_id, +h5ltget_attribute_string_c(hid_t_f *loc_id, size_t_f *namelen, _fcd dsetname, size_t_f *attrnamelen, @@ -1742,7 +546,7 @@ done: */ int_f -nh5ltget_dataset_ndims_c(hid_t_f *loc_id, +h5ltget_dataset_ndims_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name, int_f *rank) @@ -1802,7 +606,7 @@ done: */ int_f -nh5ltfind_dataset_c(hid_t_f *loc_id, +h5ltfind_dataset_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name) { @@ -1850,7 +654,7 @@ nh5ltfind_dataset_c(hid_t_f *loc_id, */ int_f -nh5ltget_dataset_info_c(hid_t_f *loc_id, +h5ltget_dataset_info_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name, hsize_t_f *dims, @@ -1929,7 +733,7 @@ done: */ int_f -nh5ltget_attribute_ndims_c(hid_t_f *loc_id, +h5ltget_attribute_ndims_c(hid_t_f *loc_id, size_t_f *namelen, _fcd dsetname, size_t_f *attrnamelen, @@ -1998,7 +802,7 @@ done: */ int_f -nh5ltget_attribute_info_c(hid_t_f *loc_id, +h5ltget_attribute_info_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name, size_t_f *attrnamelen, @@ -2087,7 +891,7 @@ done: */ int_f -nh5ltpath_valid_c(hid_t_f *loc_id, +h5ltpath_valid_c(hid_t_f *loc_id, _fcd path, size_t_f *pathlen, int_f *check_object_valid_c) diff --git a/hl/fortran/src/H5LTff.F90 b/hl/fortran/src/H5LTff.F90 new file mode 100644 index 0000000..ffc7ab5 --- /dev/null +++ b/hl/fortran/src/H5LTff.F90 @@ -0,0 +1,1912 @@ +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! 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. * +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! +! +! This file contains FORTRAN interfaces for H5LT functions +! +! NOTES +! +! _____ __ __ _____ ____ _____ _______ _ _ _______ +! |_ _| \/ | __ \ / __ \| __ \__ __|/\ | \ | |__ __| +! **** | | | \ / | |__) | | | | |__) | | | / \ | \| | | | **** +! **** | | | |\/| | ___/| | | | _ / | | / /\ \ | . ` | | | **** +! **** _| |_| | | | | | |__| | | \ \ | |/ ____ \| |\ | | | **** +! |_____|_| |_|_| \____/|_| \_\ |_/_/ \_\_| \_| |_| +! +! If you add a new function here then you MUST add the function name to the +! Windows dll file 'hdf5_hl_fortrandll.def.in' in the hl/fortran/src directory. +! This is needed for Windows based operating systems. +! + +#include + +MODULE H5LT_CONST + USE, INTRINSIC :: ISO_C_BINDING + USE h5fortran_types + USE hdf5 + + INTERFACE h5ltmake_dataset_f + MODULE PROCEDURE h5ltmake_dataset_f_int1 + MODULE PROCEDURE h5ltmake_dataset_f_int2 + MODULE PROCEDURE h5ltmake_dataset_f_int3 + MODULE PROCEDURE h5ltmake_dataset_f_int4 + MODULE PROCEDURE h5ltmake_dataset_f_int5 + MODULE PROCEDURE h5ltmake_dataset_f_int6 + MODULE PROCEDURE h5ltmake_dataset_f_int7 + MODULE PROCEDURE h5ltmake_dataset_f_ptr + END INTERFACE + + INTERFACE h5ltread_dataset_f + MODULE PROCEDURE h5ltread_dataset_f_int1 + MODULE PROCEDURE h5ltread_dataset_f_int2 + MODULE PROCEDURE h5ltread_dataset_f_int3 + MODULE PROCEDURE h5ltread_dataset_f_int4 + MODULE PROCEDURE h5ltread_dataset_f_int5 + MODULE PROCEDURE h5ltread_dataset_f_int6 + MODULE PROCEDURE h5ltread_dataset_f_int7 + MODULE PROCEDURE h5ltread_dataset_f_ptr + END INTERFACE + + INTERFACE h5ltmake_dataset_int_f + MODULE PROCEDURE h5ltmake_dataset_int_f_1 + MODULE PROCEDURE h5ltmake_dataset_int_f_2 + MODULE PROCEDURE h5ltmake_dataset_int_f_3 + MODULE PROCEDURE h5ltmake_dataset_int_f_4 + MODULE PROCEDURE h5ltmake_dataset_int_f_5 + MODULE PROCEDURE h5ltmake_dataset_int_f_6 + MODULE PROCEDURE h5ltmake_dataset_int_f_7 + END INTERFACE + + INTERFACE h5ltread_dataset_int_f + MODULE PROCEDURE h5ltread_dataset_int_f_1 + MODULE PROCEDURE h5ltread_dataset_int_f_2 + MODULE PROCEDURE h5ltread_dataset_int_f_3 + MODULE PROCEDURE h5ltread_dataset_int_f_4 + MODULE PROCEDURE h5ltread_dataset_int_f_5 + MODULE PROCEDURE h5ltread_dataset_int_f_6 + MODULE PROCEDURE h5ltread_dataset_int_f_7 + END INTERFACE + + INTERFACE + INTEGER FUNCTION h5ltmake_dataset_c(loc_id,namelen,dset_name,rank,dims,type_id,buf) & + BIND(C,NAME='h5ltmake_dataset_c') + IMPORT :: C_CHAR, C_PTR + IMPORT :: HID_T, SIZE_T, HSIZE_T + IMPLICIT NONE + INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier + INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier + INTEGER(size_t) :: namelen ! length of name buffer + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: dset_name ! name of the dataset + INTEGER, INTENT(in) :: rank ! rank + INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf + TYPE(C_PTR), VALUE :: buf ! data buffer + END FUNCTION h5ltmake_dataset_c + END INTERFACE + + INTERFACE + INTEGER FUNCTION h5ltread_dataset_c(loc_id,namelen,dset_name,type_id,buf) & + BIND(C,NAME='h5ltread_dataset_c') + IMPORT :: C_CHAR, C_PTR + IMPORT :: HID_T, SIZE_T, HSIZE_T + IMPLICIT NONE + INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier + INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier + INTEGER(size_t) :: namelen ! length of name buffer + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: dset_name ! name of the dataset + TYPE(C_PTR), VALUE :: buf ! data buffer + END FUNCTION h5ltread_dataset_c + END INTERFACE + + INTERFACE + INTEGER FUNCTION h5ltset_attribute_c(loc_id,namelen,dset_name,attrlen,attr_name,size,buf,dtype, SizeOf_buf) & + BIND(C,NAME='h5ltset_attribute_c') + IMPORT :: C_CHAR, C_PTR + IMPORT :: HID_T, SIZE_T, HSIZE_T + IMPLICIT NONE + INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier + INTEGER(size_t) :: namelen ! length of name buffer + INTEGER(size_t) :: attrlen ! length of attr name buffer + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: dset_name ! name of the dataset + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: attr_name ! name of the attribute + INTEGER(size_t), INTENT(in) :: size ! size of attribute array + TYPE(C_PTR), VALUE :: buf ! data buffer + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: dtype ! flag indicating the datatype of the + ! the buffer: + ! R=Real, D=DOUBLE, I=Interger, C=Character + INTEGER(size_t) :: SizeOf_buf ! Sizeof the buf datatype + END FUNCTION h5ltset_attribute_c + END INTERFACE + + INTERFACE + INTEGER FUNCTION h5ltget_attribute_c(loc_id,namelen,dset_name,attrlen,attr_name,buf,dtype, SizeOf_buf) & + BIND(C,NAME='h5ltget_attribute_c') + IMPORT :: C_CHAR, C_PTR + IMPORT :: HID_T, SIZE_T, HSIZE_T + IMPLICIT NONE + INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier + INTEGER(size_t) :: namelen ! length of name buffer + INTEGER(size_t) :: attrlen ! length of attr name buffer + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: dset_name ! name of the dataset + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: attr_name ! name of the attribute + TYPE(C_PTR), VALUE :: buf ! data buffer + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: dtype ! flag indicating the datatype of the + ! the buffer: + ! R=Real, D=DOUBLE, I=Interger + INTEGER(size_t) :: SizeOf_buf ! Sizeof the buf datatype + END FUNCTION h5ltget_attribute_c + END INTERFACE + +CONTAINS + !------------------------------------------------------------------------- + ! Make/Read dataset functions + !------------------------------------------------------------------------- + + !------------------------------------------------------------------------- + ! Function(s): h5ltmake_dataset_f_ptr + ! + ! Purpose: Creates and writes a dataset of a type TYPE_ID + ! + ! Return: Success: 0, Failure: -1 + ! + ! Programmer: M. Scot Breitenfeld + ! + ! Date: APR 29, 2015 + ! + ! Comments: + ! + ! Modifications: + ! + !------------------------------------------------------------------------- + + SUBROUTINE h5ltmake_dataset_f_ptr(loc_id,& + dset_name,& + rank,& + dims,& + type_id,& + buf,& + errcode ) + + IMPLICIT NONE + INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier + CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset + INTEGER, INTENT(in) :: rank ! rank + INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf + INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier + TYPE(C_PTR) :: buf ! data buffer + INTEGER :: errcode ! error code + INTEGER(size_t) :: namelen ! name length + + namelen = LEN(dset_name) + errcode = h5ltmake_dataset_c(loc_id,namelen,dset_name,rank,dims,type_id,buf) + + END SUBROUTINE h5ltmake_dataset_f_ptr + + !------------------------------------------------------------------------- + ! Function(s): h5ltmake_dataset_f_int(1-7) + ! + ! Purpose: Creates and writes a dataset of a type TYPE_ID + ! + ! Return: Success: 0, Failure: -1 + ! + ! Programmer: pvn@ncsa.uiuc.edu + ! + ! Date: September 1, 2004 + ! + ! Comments: + ! + ! Modifications: Changed to passing C_PTR. + ! + !------------------------------------------------------------------------- + + SUBROUTINE h5ltmake_dataset_f_int1(loc_id,& + dset_name,& + rank,& + dims,& + type_id,& + buf,& + errcode ) + + IMPLICIT NONE + INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier + CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset + INTEGER, INTENT(in) :: rank ! rank + INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf + INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier + INTEGER, INTENT(in), DIMENSION(*), TARGET :: buf ! data buffer + INTEGER :: errcode ! error code + INTEGER(size_t) :: namelen ! name length + TYPE(C_PTR) :: f_ptr + + f_ptr = C_LOC(buf(1)) + namelen = LEN(dset_name) + errcode = h5ltmake_dataset_c(loc_id,namelen,dset_name,rank,dims,type_id,f_ptr) + + END SUBROUTINE h5ltmake_dataset_f_int1 + + SUBROUTINE h5ltmake_dataset_f_int2(loc_id,& + dset_name,& + rank,& + dims,& + type_id,& + buf,& + errcode ) + + IMPLICIT NONE + INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier + CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset + INTEGER, INTENT(in) :: rank ! rank + INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf + INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier + INTEGER :: errcode ! error code + INTEGER(size_t) :: namelen ! name length + INTEGER, INTENT(in), & + DIMENSION(dims(1),dims(2)), TARGET :: buf ! data buffer + TYPE(C_PTR) :: f_ptr + + f_ptr = C_LOC(buf(1,1)) + + namelen = LEN(dset_name) + errcode = h5ltmake_dataset_c(loc_id,namelen,dset_name,rank,dims,type_id,f_ptr) + + END SUBROUTINE h5ltmake_dataset_f_int2 + + SUBROUTINE h5ltmake_dataset_f_int3(loc_id,& + dset_name,& + rank,& + dims,& + type_id,& + buf,& + errcode ) + + IMPLICIT NONE + INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier + CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset + INTEGER, INTENT(in) :: rank ! rank + INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf + INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier + INTEGER :: errcode ! error code + INTEGER(size_t) :: namelen ! name length + INTEGER, INTENT(in), & + DIMENSION(dims(1),dims(2),dims(3)), TARGET :: buf ! data buffer + TYPE(C_PTR) :: f_ptr + + f_ptr = C_LOC(buf(1,1,1)) + + namelen = LEN(dset_name) + errcode = h5ltmake_dataset_c(loc_id,namelen,dset_name,rank,dims,type_id,f_ptr) + + END SUBROUTINE h5ltmake_dataset_f_int3 + + SUBROUTINE h5ltmake_dataset_f_int4(loc_id, dset_name, rank, dims, & + type_id, buf, errcode ) + + IMPLICIT NONE + INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier + CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset + INTEGER, INTENT(in) :: rank ! rank + INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf + INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier + INTEGER :: errcode ! error code + INTEGER(size_t) :: namelen ! name length + INTEGER, INTENT(in), & + DIMENSION(dims(1),dims(2),dims(3),dims(4)), TARGET :: buf ! data buffer + TYPE(C_PTR) :: f_ptr + + f_ptr = C_LOC(buf(1,1,1,1)) + + namelen = LEN(dset_name) + errcode = h5ltmake_dataset_c(loc_id,namelen,dset_name,rank,dims,type_id,f_ptr) + + END SUBROUTINE h5ltmake_dataset_f_int4 + + SUBROUTINE h5ltmake_dataset_f_int5(loc_id, dset_name, rank, dims, & + type_id, buf, errcode ) + + IMPLICIT NONE + INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier + CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset + INTEGER, INTENT(in) :: rank ! rank + INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf + INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier + INTEGER :: errcode ! error code + INTEGER(size_t) :: namelen ! name length + INTEGER, INTENT(in), & + DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)), TARGET :: buf ! data buffer + TYPE(C_PTR) :: f_ptr + + f_ptr = C_LOC(buf(1,1,1,1,1)) + + namelen = LEN(dset_name) + errcode = h5ltmake_dataset_c(loc_id,namelen,dset_name,rank,dims,type_id,f_ptr) + + END SUBROUTINE h5ltmake_dataset_f_int5 + + SUBROUTINE h5ltmake_dataset_f_int6(loc_id, dset_name, rank, dims, & + type_id, buf, errcode ) + + IMPLICIT NONE + INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier + CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset + INTEGER, INTENT(in) :: rank ! rank + INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf + INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier + INTEGER :: errcode ! error code + INTEGER(size_t) :: namelen ! name length + INTEGER, INTENT(in), & + DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)), TARGET :: buf ! data buffer + TYPE(C_PTR) :: f_ptr + + f_ptr = C_LOC(buf(1,1,1,1,1,1)) + + namelen = LEN(dset_name) + errcode = h5ltmake_dataset_c(loc_id,namelen,dset_name,rank,dims,type_id,f_ptr) + + END SUBROUTINE h5ltmake_dataset_f_int6 + + SUBROUTINE h5ltmake_dataset_f_int7(loc_id, dset_name, rank, dims, & + type_id, buf, errcode ) + + IMPLICIT NONE + INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier + CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset + INTEGER, INTENT(in) :: rank ! rank + INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf + INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier + INTEGER :: errcode ! error code + INTEGER(size_t) :: namelen ! name length + INTEGER, INTENT(in), & + DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)), TARGET :: buf ! data buffer + TYPE(C_PTR) :: f_ptr + + f_ptr = C_LOC(buf(1,1,1,1,1,1,1)) + + namelen = LEN(dset_name) + errcode = h5ltmake_dataset_c(loc_id,namelen,dset_name,rank,dims,type_id,f_ptr) + + END SUBROUTINE h5ltmake_dataset_f_int7 + + + !------------------------------------------------------------------------- + ! Function(s): h5ltread_dataset_f_ptr + ! + ! Purpose: Read a dataset of a type TYPE_ID + ! + ! Return: Success: 0, Failure: -1 + ! + ! Programmer: M. Scot Breitenfeld + ! + ! Date: Apr 29, 2015 + ! + ! Comments: + ! + ! Modifications: + ! + !------------------------------------------------------------------------- + + SUBROUTINE h5ltread_dataset_f_ptr(loc_id,& + dset_name,& + type_id,& + buf,& + errcode ) + + IMPLICIT NONE + INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier + CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset + INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier + TYPE(C_PTR) :: buf ! data buffer + INTEGER :: errcode ! error code + INTEGER(size_t) :: namelen + + namelen = LEN(dset_name) + errcode = h5ltread_dataset_c(loc_id,namelen,dset_name,type_id, buf) + + END SUBROUTINE h5ltread_dataset_f_ptr + + !------------------------------------------------------------------------- + ! Function(s): h5ltread_dataset_f_int(1-7) + ! + ! Purpose: Read a dataset of a type TYPE_ID + ! + ! Return: Success: 0, Failure: -1 + ! + ! Programmer: pvn@ncsa.uiuc.edu + ! + ! Date: September 22, 2004 + ! + ! Comments: + ! + ! Modifications: + ! + !------------------------------------------------------------------------- + + SUBROUTINE h5ltread_dataset_f_int1(loc_id,& + dset_name,& + type_id,& + buf,& + dims,& + errcode ) + + IMPLICIT NONE + INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier + CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset + INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier + INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf + INTEGER, INTENT(inout), DIMENSION(*), TARGET :: buf ! data buffer + INTEGER :: errcode ! error code + INTEGER(size_t) :: namelen + TYPE(C_PTR) :: f_ptr + + f_ptr = C_LOC(buf(1)) + + namelen = LEN(dset_name) + errcode = h5ltread_dataset_c(loc_id,namelen,dset_name,type_id,f_ptr) + + END SUBROUTINE h5ltread_dataset_f_int1 + + !------------------------------------------------------------------------- + ! Function: h5ltread_dataset_f_int2 + ! + ! Purpose: Read a dataset of a type TYPE_ID + ! + ! Return: Success: 0, Failure: -1 + ! + ! Programmer: pvn@ncsa.uiuc.edu + ! + ! Date: September 22, 2004 + ! + ! Comments: + ! + ! Modifications: + ! + !------------------------------------------------------------------------- + + SUBROUTINE h5ltread_dataset_f_int2(loc_id,& + dset_name,& + type_id,& + buf,& + dims,& + errcode ) + + IMPLICIT NONE + INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier + CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset + INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier + INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf + INTEGER :: errcode ! error code + INTEGER(size_t) :: namelen ! name length + INTEGER, INTENT(inout), & + DIMENSION(dims(1),dims(2)), TARGET :: buf + TYPE(C_PTR) :: f_ptr + + f_ptr = C_LOC(buf(1,1)) + + namelen = LEN(dset_name) + errcode = h5ltread_dataset_c(loc_id,namelen,dset_name,type_id,f_ptr) + + END SUBROUTINE h5ltread_dataset_f_int2 + + SUBROUTINE h5ltread_dataset_f_int3(loc_id,& + dset_name,& + type_id,& + buf,& + dims,& + errcode ) + + IMPLICIT NONE + INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier + CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset + INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier + INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf + INTEGER :: errcode ! error code + INTEGER(size_t) :: namelen ! name length + INTEGER, INTENT(inout), & + DIMENSION(dims(1),dims(2),dims(3)), TARGET :: buf + TYPE(C_PTR) :: f_ptr + + f_ptr = C_LOC(buf(1,1,1)) + + namelen = LEN(dset_name) + errcode = h5ltread_dataset_c(loc_id,namelen,dset_name,type_id,f_ptr) + + END SUBROUTINE h5ltread_dataset_f_int3 + + SUBROUTINE h5ltread_dataset_f_int4(loc_id, dset_name, type_id, buf, & + dims, errcode ) + + IMPLICIT NONE + INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier + CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset + INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier + INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf + INTEGER :: errcode ! error code + INTEGER(size_t) :: namelen ! name length + INTEGER, INTENT(inout), & + DIMENSION(dims(1),dims(2),dims(3),dims(4)), TARGET :: buf + TYPE(C_PTR) :: f_ptr + + f_ptr = C_LOC(buf(1,1,1,1)) + + namelen = LEN(dset_name) + errcode = h5ltread_dataset_c(loc_id,namelen,dset_name,type_id,f_ptr) + + END SUBROUTINE h5ltread_dataset_f_int4 + + SUBROUTINE h5ltread_dataset_f_int5(loc_id, dset_name, type_id, buf, & + dims, errcode ) + + IMPLICIT NONE + INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier + CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset + INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier + INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf + INTEGER :: errcode ! error code + INTEGER(size_t) :: namelen ! name length + INTEGER, INTENT(inout), & + DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)), TARGET :: buf + TYPE(C_PTR) :: f_ptr + + f_ptr = C_LOC(buf(1,1,1,1,1)) + + namelen = LEN(dset_name) + errcode = h5ltread_dataset_c(loc_id,namelen,dset_name,type_id,f_ptr) + + END SUBROUTINE h5ltread_dataset_f_int5 + + !------------------------------------------------------------------------- + ! Function: h5ltread_dataset_f_int6 + ! + ! Purpose: Read a dataset of a type TYPE_ID + ! + ! Return: Success: 0, Failure: -1 + ! + ! Programmer: M. Scot Breitenfeld + ! + ! Date: March 12, 2011 + ! + ! Comments: + ! + ! Modifications: + ! + !------------------------------------------------------------------------- + + SUBROUTINE h5ltread_dataset_f_int6(loc_id, dset_name, type_id, buf, & + dims, errcode ) + + IMPLICIT NONE + INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier + CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset + INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier + INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf + INTEGER :: errcode ! error code + INTEGER(size_t) :: namelen ! name length + INTEGER, INTENT(inout), & + DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)), TARGET :: buf + TYPE(C_PTR) :: f_ptr + + f_ptr = C_LOC(buf(1,1,1,1,1,1)) + + namelen = LEN(dset_name) + errcode = h5ltread_dataset_c(loc_id,namelen,dset_name,type_id,f_ptr) + + END SUBROUTINE h5ltread_dataset_f_int6 + + SUBROUTINE h5ltread_dataset_f_int7(loc_id, dset_name, type_id, buf, & + dims, errcode ) + + IMPLICIT NONE + INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier + CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset + INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier + INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf + INTEGER :: errcode ! error code + INTEGER(size_t) :: namelen ! name length + INTEGER, INTENT(inout), & + DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)), TARGET :: buf + TYPE(C_PTR) :: f_ptr + + f_ptr = C_LOC(buf(1,1,1,1,1,1,1)) + + namelen = LEN(dset_name) + errcode = h5ltread_dataset_c(loc_id,namelen,dset_name,type_id,f_ptr) + + END SUBROUTINE h5ltread_dataset_f_int7 + + + !------------------------------------------------------------------------- + ! Function: h5ltmake_dataset_int_f_1 + ! + ! Purpose: Creates and writes a dataset of H5T_NATIVE_INT type + ! + ! Return: Success: 0, Failure: -1 + ! + ! Programmer: pvn@ncsa.uiuc.edu + ! + ! Date: September 22, 2004 + ! + ! Comments: + ! + ! Modifications: + ! + !------------------------------------------------------------------------- + + SUBROUTINE h5ltmake_dataset_int_f_1 (loc_id,& + dset_name,& + rank,& + dims,& + buf,& + errcode ) + + IMPLICIT NONE + INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier + CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset + INTEGER, INTENT(in) :: rank ! rank + INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf + INTEGER, INTENT(in), DIMENSION(*), TARGET :: buf ! data buffer + INTEGER :: errcode ! error code + INTEGER(size_t) :: namelen ! name length + TYPE(C_PTR) :: f_ptr + + f_ptr = C_LOC(buf(1)) + + namelen = LEN(dset_name) + errcode = h5ltmake_dataset_c(loc_id,namelen,dset_name,rank,dims,h5t_native_integer,f_ptr) + + END SUBROUTINE h5ltmake_dataset_int_f_1 + + SUBROUTINE h5ltmake_dataset_int_f_2 (loc_id,& + dset_name,& + rank,& + dims,& + buf,& + errcode ) + + IMPLICIT NONE + INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier + CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset + INTEGER, INTENT(in) :: rank ! rank + INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf + INTEGER :: errcode ! error code + INTEGER(size_t) :: namelen ! name length + INTEGER, INTENT(in), & + DIMENSION(dims(1),dims(2)), TARGET :: buf + TYPE(C_PTR) :: f_ptr + + f_ptr = C_LOC(buf(1,1)) + + namelen = LEN(dset_name) + errcode = h5ltmake_dataset_c(loc_id,namelen,dset_name,rank,dims,H5T_NATIVE_INTEGER,f_ptr) + + END SUBROUTINE h5ltmake_dataset_int_f_2 + + SUBROUTINE h5ltmake_dataset_int_f_3 (loc_id,& + dset_name,& + rank,& + dims,& + buf,& + errcode ) + + IMPLICIT NONE + INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier + CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset + INTEGER, INTENT(in) :: rank ! rank + INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf + INTEGER :: errcode ! error code + INTEGER(size_t) :: namelen ! name length + INTEGER, INTENT(in), & + DIMENSION(dims(1),dims(2),dims(3)), TARGET :: buf + TYPE(C_PTR) :: f_ptr + + f_ptr = C_LOC(buf(1,1,1)) + + namelen = LEN(dset_name) + errcode = h5ltmake_dataset_c(loc_id,namelen,dset_name,rank,dims,H5T_NATIVE_INTEGER,f_ptr) + + END SUBROUTINE h5ltmake_dataset_int_f_3 + + SUBROUTINE h5ltmake_dataset_int_f_4(loc_id, dset_name, rank, dims, & + buf, errcode ) + + IMPLICIT NONE + INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier + CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset + INTEGER, INTENT(in) :: rank ! rank + INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf + INTEGER :: errcode ! error code + INTEGER(size_t) :: namelen ! name length + INTEGER, INTENT(in), & + DIMENSION(dims(1),dims(2),dims(3),dims(4)), TARGET :: buf + TYPE(C_PTR) :: f_ptr + + f_ptr = C_LOC(buf(1,1,1,1)) + + namelen = LEN(dset_name) + errcode = h5ltmake_dataset_c(loc_id,namelen,dset_name,rank,dims,H5T_NATIVE_INTEGER,f_ptr) + + END SUBROUTINE h5ltmake_dataset_int_f_4 + + SUBROUTINE h5ltmake_dataset_int_f_5(loc_id, dset_name, rank, dims, & + buf, errcode ) + + IMPLICIT NONE + INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier + CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset + INTEGER, INTENT(in) :: rank ! rank + INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf + INTEGER :: errcode ! error code + INTEGER(size_t) :: namelen ! name length + INTEGER, INTENT(in), & + DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)), TARGET :: buf + TYPE(C_PTR) :: f_ptr + + f_ptr = C_LOC(buf(1,1,1,1,1)) + + namelen = LEN(dset_name) + errcode = h5ltmake_dataset_c(loc_id,namelen,dset_name,rank,dims,H5T_NATIVE_INTEGER,f_ptr) + + END SUBROUTINE h5ltmake_dataset_int_f_5 + + SUBROUTINE h5ltmake_dataset_int_f_6(loc_id, dset_name, rank, dims, & + buf, errcode ) + + IMPLICIT NONE + INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier + CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset + INTEGER, INTENT(in) :: rank ! rank + INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf + INTEGER :: errcode ! error code + INTEGER(size_t) :: namelen ! name length + INTEGER, INTENT(in), & + DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)), TARGET :: buf + TYPE(C_PTR) :: f_ptr + + f_ptr = C_LOC(buf(1,1,1,1,1,1)) + + namelen = LEN(dset_name) + errcode = h5ltmake_dataset_c(loc_id,namelen,dset_name,rank,dims,H5T_NATIVE_INTEGER,f_ptr) + + END SUBROUTINE h5ltmake_dataset_int_f_6 + + SUBROUTINE h5ltmake_dataset_int_f_7(loc_id, dset_name, rank, dims, & + buf, errcode ) + + IMPLICIT NONE + INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier + CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset + INTEGER, INTENT(in) :: rank ! rank + INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf + INTEGER :: errcode ! error code + INTEGER(size_t) :: namelen ! name length + INTEGER, INTENT(in), & + DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)), TARGET :: buf + TYPE(C_PTR) :: f_ptr + + f_ptr = C_LOC(buf(1,1,1,1,1,1,1)) + + namelen = LEN(dset_name) + errcode = h5ltmake_dataset_c(loc_id,namelen,dset_name,rank,dims,H5T_NATIVE_INTEGER,f_ptr) + + END SUBROUTINE h5ltmake_dataset_int_f_7 + + !------------------------------------------------------------------------- + ! Function(s): h5ltread_dataset_int_f_(1-7) + ! + ! Purpose: Read a dataset + ! + ! Return: Success: 0, Failure: -1 + ! + ! Programmer: pvn@ncsa.uiuc.edu + ! + ! Date: September 22, 2004 + ! + ! Comments: + ! + ! Modifications: + ! + !------------------------------------------------------------------------- + + SUBROUTINE h5ltread_dataset_int_f_1(loc_id,& + dset_name,& + buf,& + dims,& + errcode ) + + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id ! file or group identifier + CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset + INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf + INTEGER :: errcode ! error code + INTEGER(size_t) :: namelen ! name length + INTEGER, INTENT(inout), & + DIMENSION(dims(1)), TARGET :: buf + TYPE(C_PTR) :: f_ptr + + f_ptr = C_LOC(buf(1)) + + namelen = LEN(dset_name) + errcode = h5ltread_dataset_c(loc_id,namelen,dset_name,H5T_NATIVE_INTEGER,f_ptr) + + END SUBROUTINE h5ltread_dataset_int_f_1 + + SUBROUTINE h5ltread_dataset_int_f_2(loc_id,& + dset_name,& + buf,& + dims,& + errcode ) + + IMPLICIT NONE + INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier + CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset + INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf + INTEGER :: errcode ! error code + INTEGER(size_t) :: namelen ! name length + INTEGER, INTENT(inout), & + DIMENSION(dims(1),dims(2)), TARGET :: buf + TYPE(C_PTR) :: f_ptr + + f_ptr = C_LOC(buf(1,1)) + + namelen = LEN(dset_name) + errcode = h5ltread_dataset_c(loc_id,namelen,dset_name,H5T_NATIVE_INTEGER,f_ptr) + + END SUBROUTINE h5ltread_dataset_int_f_2 + + SUBROUTINE h5ltread_dataset_int_f_3(loc_id,& + dset_name,& + buf,& + dims,& + errcode ) + + IMPLICIT NONE + INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier + CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset + INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf + INTEGER :: errcode ! error code + INTEGER(size_t) :: namelen ! name length + INTEGER, INTENT(inout), & + DIMENSION(dims(1),dims(2),dims(3)), TARGET :: buf + TYPE(C_PTR) :: f_ptr + + f_ptr = C_LOC(buf(1,1,1)) + + namelen = LEN(dset_name) + errcode = h5ltread_dataset_c(loc_id,namelen,dset_name,H5T_NATIVE_INTEGER,f_ptr) + + END SUBROUTINE h5ltread_dataset_int_f_3 + + SUBROUTINE h5ltread_dataset_int_f_4(loc_id, dset_name, buf, dims, errcode ) + + IMPLICIT NONE + INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier + CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset + INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf + INTEGER :: errcode ! error code + INTEGER(size_t) :: namelen ! name length + INTEGER, INTENT(inout), & + DIMENSION(dims(1),dims(2),dims(3),dims(4)), TARGET :: buf + TYPE(C_PTR) :: f_ptr + + f_ptr = C_LOC(buf(1,1,1,1)) + + namelen = LEN(dset_name) + errcode = h5ltread_dataset_c(loc_id,namelen,dset_name,H5T_NATIVE_INTEGER,f_ptr) + + END SUBROUTINE h5ltread_dataset_int_f_4 + + SUBROUTINE h5ltread_dataset_int_f_5(loc_id, dset_name, buf, dims, errcode ) + + IMPLICIT NONE + INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier + CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset + INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf + INTEGER :: errcode ! error code + INTEGER(size_t) :: namelen ! name length + INTEGER, INTENT(inout), & + DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)), TARGET :: buf + TYPE(C_PTR) :: f_ptr + + f_ptr = C_LOC(buf(1,1,1,1,1)) + + namelen = LEN(dset_name) + errcode = h5ltread_dataset_c(loc_id,namelen,dset_name,H5T_NATIVE_INTEGER,f_ptr) + + END SUBROUTINE h5ltread_dataset_int_f_5 + + SUBROUTINE h5ltread_dataset_int_f_6(loc_id, dset_name, buf, dims, errcode ) + + IMPLICIT NONE + INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier + CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset + INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf + INTEGER :: errcode ! error code + INTEGER(size_t) :: namelen ! name length + INTEGER, INTENT(inout), & + DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)), TARGET :: buf + TYPE(C_PTR) :: f_ptr + + f_ptr = C_LOC(buf(1,1,1,1,1,1)) + + namelen = LEN(dset_name) + errcode = h5ltread_dataset_c(loc_id,namelen,dset_name,H5T_NATIVE_INTEGER,f_ptr) + + END SUBROUTINE h5ltread_dataset_int_f_6 + + SUBROUTINE h5ltread_dataset_int_f_7(loc_id, dset_name, buf, dims, errcode ) + + IMPLICIT NONE + INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier + CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset + INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf + INTEGER :: errcode ! error code + INTEGER(size_t) :: namelen ! name length + INTEGER, INTENT(inout), & + DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)), TARGET :: buf + TYPE(C_PTR) :: f_ptr + + f_ptr = C_LOC(buf(1,1,1,1,1,1,1)) + + namelen = LEN(dset_name) + errcode = h5ltread_dataset_c(loc_id,namelen,dset_name,H5T_NATIVE_INTEGER,f_ptr) + + END SUBROUTINE h5ltread_dataset_int_f_7 + + + !------------------------------------------------------------------------- + ! Function: h5ltmake_dataset_string_f + ! + ! Purpose: Creates and writes a dataset + ! + ! Return: Success: 0, Failure: -1 + ! + ! Programmer: pvn@ncsa.uiuc.edu + ! + ! Date: September 22, 2004 + ! + ! Comments: + ! + ! Modifications: + ! + !------------------------------------------------------------------------- + + SUBROUTINE h5ltmake_dataset_string_f(loc_id,& + dset_name,& + buf,& + errcode ) + + IMPLICIT NONE + INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier + CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset + CHARACTER(LEN=*), INTENT(in) :: buf ! data buffer + INTEGER :: errcode ! error code + INTEGER(size_t) :: namelen ! name length + INTEGER(size_t) :: buflen ! buffer length + + INTERFACE + INTEGER FUNCTION h5ltmake_dataset_string_c(loc_id,namelen,dset_name,buflen,buf) & + BIND(C,NAME='h5ltmake_dataset_string_c') + IMPORT :: C_CHAR + IMPORT :: HID_T, SIZE_T, HSIZE_T + IMPLICIT NONE + INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier + INTEGER(size_t) :: namelen ! length of name buffer + INTEGER(size_t) :: buflen ! length of data buffer + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: dset_name ! name of the dataset + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: buf ! data buffer + END FUNCTION h5ltmake_dataset_string_c + END INTERFACE + + namelen = LEN(dset_name) + buflen = LEN(buf) + errcode = h5ltmake_dataset_string_c(loc_id,namelen,dset_name,buflen,buf) + + END SUBROUTINE h5ltmake_dataset_string_f + + !------------------------------------------------------------------------- + ! Function: h5ltread_dataset_string_f + ! + ! Purpose: Read a dataset + ! + ! Return: Success: 0, Failure: -1 + ! + ! Programmer: pvn@ncsa.uiuc.edu + ! + ! Date: September 22, 2004 + ! + ! Comments: + ! + ! Modifications: + ! + !------------------------------------------------------------------------- + + SUBROUTINE h5ltread_dataset_string_f(loc_id,& + dset_name,& + buf,& + errcode ) + + IMPLICIT NONE + INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier + CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset + CHARACTER(LEN=*), INTENT(inout) :: buf ! data buffer + INTEGER :: errcode ! error code + INTEGER(size_t) :: namelen ! name length + + INTERFACE + INTEGER FUNCTION h5ltread_dataset_string_c(loc_id,namelen,dset_name,buf) & + BIND(C,NAME='h5ltread_dataset_string_c') + IMPORT :: C_CHAR + IMPORT :: HID_T, SIZE_T, HSIZE_T + IMPLICIT NONE + INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier + INTEGER(size_t) :: namelen ! length of name buffer + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: dset_name ! name of the dataset + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(inout) :: buf ! data buffer + END FUNCTION h5ltread_dataset_string_c + END INTERFACE + + namelen = LEN(dset_name) + errcode = h5ltread_dataset_string_c(loc_id,namelen,dset_name,buf) + + END SUBROUTINE h5ltread_dataset_string_f + + !------------------------------------------------------------------------- + ! Make/Read attribute functions + !------------------------------------------------------------------------- + + !------------------------------------------------------------------------- + ! Function: h5ltset_attribute_f + ! + ! Purpose: Create and write an attribute + ! + ! Return: Success: 0, Failure: -1 + ! + ! Programmer: M. Scot Breitenfeld + ! + ! Date: May 4, 2015 + ! + ! Comments: + ! + ! Modifications: + ! + !------------------------------------------------------------------------- + + SUBROUTINE h5ltset_attribute_f(loc_id,& + dset_name,& + attr_name,& + buf,& + buf_type, SizeOf_buf_type, & + size,& + errcode ) + + IMPLICIT NONE + INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier + CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset + CHARACTER(LEN=*), INTENT(in) :: attr_name ! name of the attribute + TYPE(C_PTR) :: buf ! data buffer + CHARACTER(LEN=*), INTENT(in) :: buf_type ! + INTEGER(size_t), INTENT(in) :: size ! size of attribute array + INTEGER :: errcode ! error code + INTEGER(size_t) :: namelen ! name length + INTEGER(size_t) :: attrlen ! name length + + CHARACTER(KIND=C_CHAR) :: buf_type_uppercase + INTEGER(size_t) :: SizeOf_buf_type + + namelen = LEN(dset_name) + attrlen = LEN(attr_name) + + buf_type_uppercase(1:1) = buf_type(1:1) + IF(buf_type_uppercase(1:1).EQ.'i')THEN + buf_type_uppercase(1:1) = 'I' + ELSE IF(buf_type_uppercase(1:1).EQ.'r')THEN + buf_type_uppercase(1:1) = 'R' + ELSE IF(buf_type_uppercase(1:1).EQ.'c')THEN + buf_type_uppercase(1:1) = 'C' + ENDIF + + errcode = h5ltset_attribute_c(loc_id,namelen,dset_name,attrlen,attr_name,size,& + buf,buf_type_uppercase(1:1)//C_NULL_CHAR, SizeOf_buf_type) + + END SUBROUTINE h5ltset_attribute_f + + !------------------------------------------------------------------------- + ! Function: h5ltset_attribute_int_f + ! + ! Purpose: Create and write an attribute + ! + ! Return: Success: 0, Failure: -1 + ! + ! Programmer: pvn@ncsa.uiuc.edu + ! + ! Date: October 05, 2004 + ! + ! Comments: + ! + ! Modifications: + ! + !------------------------------------------------------------------------- + + SUBROUTINE h5ltset_attribute_int_f(loc_id,& + dset_name,& + attr_name,& + buf,& + size,& + errcode ) + + IMPLICIT NONE + INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier + CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset + CHARACTER(LEN=*), INTENT(in) :: attr_name ! name of the attribute + INTEGER(size_t), INTENT(in) :: size ! size of attribute array + INTEGER :: errcode ! error code + INTEGER, DIMENSION(*), TARGET :: buf ! data buffer + INTEGER(size_t) :: namelen ! name length + INTEGER(size_t) :: attrlen ! name length + TYPE(C_PTR) :: f_ptr + INTEGER(size_t) :: SizeOf_buf_type + + f_ptr = C_LOC(buf(1:1)) + +#if H5_FORTRAN_HAVE_STORAGE_SIZE!=0 + SizeOf_buf_type = STORAGE_SIZE(buf(1), c_size_t)/STORAGE_SIZE(c_char_'a',c_size_t) +#else + SizeOf_buf_type = SIZEOF(buf(1)) +#endif + + namelen = LEN(dset_name) + attrlen = LEN(attr_name) + errcode = h5ltset_attribute_c(loc_id,namelen,dset_name,attrlen,attr_name,size,& + f_ptr,'I'//C_NULL_CHAR,SizeOf_buf_type) + + END SUBROUTINE h5ltset_attribute_int_f + + !------------------------------------------------------------------------- + ! Function: h5ltset_attribute_float_f + ! + ! Purpose: Create and write an attribute + ! + ! Return: Success: 0, Failure: -1 + ! + ! Programmer: pvn@ncsa.uiuc.edu + ! + ! Date: October 05, 2004 + ! + ! Comments: + ! + ! Modifications: + ! + !------------------------------------------------------------------------- + + SUBROUTINE h5ltset_attribute_float_f(loc_id,& + dset_name,& + attr_name,& + buf,& + size,& + errcode ) + + IMPLICIT NONE + INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier + CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset + CHARACTER(LEN=*), INTENT(in) :: attr_name ! name of the attribute + INTEGER(size_t), INTENT(in) :: size ! size of attribute array + INTEGER :: errcode ! error code + REAL(KIND=C_FLOAT), INTENT(in), DIMENSION(*), TARGET :: buf ! data buffer + INTEGER(size_t) :: namelen ! name length + INTEGER(size_t) :: attrlen ! name length + TYPE(C_PTR) :: f_ptr + INTEGER(size_t) :: SizeOf_buf_type + + f_ptr = C_LOC(buf(1)) +#if H5_FORTRAN_HAVE_STORAGE_SIZE!=0 + SizeOf_buf_type = STORAGE_SIZE(buf(1), c_size_t)/STORAGE_SIZE(c_char_'a',c_size_t) +#else + SizeOf_buf_type = SIZEOF(buf(1)) +#endif + + namelen = LEN(dset_name) + attrlen = LEN(attr_name) + errcode = h5ltset_attribute_c(loc_id,namelen,dset_name,attrlen,attr_name,size,& + f_ptr,'R'//C_NULL_CHAR, SizeOf_buf_type) + + END SUBROUTINE h5ltset_attribute_float_f + + !------------------------------------------------------------------------- + ! Function: h5ltset_attribute_double_f + ! + ! Purpose: Create and write an attribute + ! + ! Return: Success: 0, Failure: -1 + ! + ! Programmer: pvn@ncsa.uiuc.edu + ! + ! Date: October 05, 2004 + ! + ! Comments: + ! + ! Modifications: + ! + !------------------------------------------------------------------------- + + SUBROUTINE h5ltset_attribute_double_f(loc_id,& + dset_name,& + attr_name,& + buf,& + size,& + errcode ) + + IMPLICIT NONE + INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier + CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset + CHARACTER(LEN=*), INTENT(in) :: attr_name ! name of the attribute + INTEGER(size_t), INTENT(in) :: size ! size of attribute array + INTEGER :: errcode ! error code + REAL(KIND=C_DOUBLE), INTENT(in), DIMENSION(*), TARGET :: buf ! data buffer + INTEGER(size_t) :: namelen ! name length + INTEGER(size_t) :: attrlen ! name length + TYPE(C_PTR) :: f_ptr + INTEGER(size_t) :: SizeOf_buf_type + + f_ptr = C_LOC(buf(1)) + +#if H5_FORTRAN_HAVE_STORAGE_SIZE!=0 + SizeOf_buf_type = STORAGE_SIZE(buf(1), c_size_t)/STORAGE_SIZE(c_char_'a',c_size_t) +#else + SizeOf_buf_type = SIZEOF(buf(1)) +#endif + + namelen = LEN(dset_name) + attrlen = LEN(attr_name) + errcode = h5ltset_attribute_c(loc_id,namelen,dset_name,attrlen,attr_name,size,& + f_ptr,'R'//C_NULL_CHAR,SizeOf_buf_type) + + END SUBROUTINE h5ltset_attribute_double_f + + + !------------------------------------------------------------------------- + ! Function: h5ltset_attribute_string_f + ! + ! Purpose: Create and write an attribute + ! + ! Return: Success: 0, Failure: -1 + ! + ! Programmer: pvn@ncsa.uiuc.edu + ! + ! Date: October 05, 2004 + ! + ! Comments: + ! + ! Modifications: + ! + !------------------------------------------------------------------------- + + SUBROUTINE h5ltset_attribute_string_f(loc_id,& + dset_name,& + attr_name,& + buf,& + errcode ) + + IMPLICIT NONE + INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier + CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset + CHARACTER(LEN=*), INTENT(in) :: attr_name ! name of the attribute + INTEGER :: errcode ! error code + CHARACTER(LEN=*), DIMENSION(*), INTENT(in), TARGET :: buf ! data buffer + INTEGER(size_t) :: namelen ! name length + INTEGER(size_t) :: attrlen ! name length + INTEGER(size_t) :: buflen ! data buffer length + TYPE(C_PTR) :: f_ptr + INTEGER(size_t) :: SizeOf_buf_type + + f_ptr = C_LOC(buf(1)(1:1)) + +#if H5_FORTRAN_HAVE_STORAGE_SIZE!=0 + SizeOf_buf_type = STORAGE_SIZE(buf(1)(1:1), c_size_t)/STORAGE_SIZE(c_char_'a',c_size_t) +#else + SizeOf_buf_type = SIZEOF(buf(1:1)(1:1)) +#endif + + namelen = LEN(dset_name) + attrlen = LEN(attr_name) + buflen = LEN(buf) + errcode = h5ltset_attribute_c(loc_id,namelen,dset_name,attrlen,attr_name,buflen,& + f_ptr,'C'//C_NULL_CHAR, SizeOf_buf_type) + + END SUBROUTINE h5ltset_attribute_string_f + + !------------------------------------------------------------------------- + ! Function: h5ltget_attribute_f + ! + ! Purpose: Reads an attribute named ATTR_NAME + ! + ! Return: Success: 0, Failure: -1 + ! + ! Programmer: M. Scot Breitenfeld + ! + ! Date: Apr 29, 2015 + ! + ! Comments: + ! + ! Modifications: + ! + !------------------------------------------------------------------------- + + SUBROUTINE h5ltget_attribute_f(loc_id,& + dset_name,& + attr_name,& + buf, buf_type, SizeOf_buf_type, & + errcode ) + + IMPLICIT NONE + INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier + CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset + CHARACTER(LEN=*), INTENT(in) :: attr_name ! name of the attribute + INTEGER, INTENT(out) :: errcode ! error code + CHARACTER(LEN=*), INTENT(in) :: buf_type + TYPE(C_PTR) :: buf! data buffer + INTEGER(size_t) :: namelen ! name length + INTEGER(size_t) :: attrlen ! name length + CHARACTER(KIND=C_CHAR) :: buf_type_uppercase + INTEGER(size_t) :: SizeOf_buf_type + + namelen = LEN(dset_name) + attrlen = LEN(attr_name) + + buf_type_uppercase(1:1) = buf_type(1:1) + IF(buf_type_uppercase(1:1).EQ.'i')THEN + buf_type_uppercase(1:1) = 'I' + ELSE IF(buf_type_uppercase(1:1).EQ.'r')THEN + buf_type_uppercase(1:1) = 'R' + ELSE IF(buf_type_uppercase(1:1).EQ.'c')THEN + buf_type_uppercase(1:1) = 'C' + ENDIF + errcode = h5ltget_attribute_c(loc_id,namelen,dset_name,attrlen,attr_name, & + buf, buf_type_uppercase//C_NULL_CHAR, SizeOf_buf_type) + + + END SUBROUTINE h5ltget_attribute_f + + !------------------------------------------------------------------------- + ! Function: h5ltget_attribute_int_f + ! + ! Purpose: Reads an attribute named ATTR_NAME + ! + ! Return: Success: 0, Failure: -1 + ! + ! Programmer: pvn@ncsa.uiuc.edu + ! + ! Date: October 05, 2004 + ! + ! Comments: + ! + ! Modifications: + ! + !------------------------------------------------------------------------- + + SUBROUTINE h5ltget_attribute_int_f(loc_id,& + dset_name,& + attr_name,& + buf,& + errcode ) + + IMPLICIT NONE + INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier + CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset + CHARACTER(LEN=*), INTENT(in) :: attr_name ! name of the attribute + INTEGER :: errcode ! error code + INTEGER, INTENT(inout), DIMENSION(*), TARGET :: buf! data buffer + INTEGER(size_t) :: namelen ! name length + INTEGER(size_t) :: attrlen ! name length + TYPE(C_PTR) :: f_ptr + INTEGER(size_t) :: SizeOf_buf + + f_ptr = C_LOC(buf(1)) + +#if H5_FORTRAN_HAVE_STORAGE_SIZE!=0 + SizeOf_buf = STORAGE_SIZE(buf(1), c_size_t)/STORAGE_SIZE(c_char_'a',c_size_t) +#else + SizeOf_buf = SIZEOF(buf(1)) +#endif + namelen = LEN(dset_name) + attrlen = LEN(attr_name) + errcode = h5ltget_attribute_c(loc_id,namelen,dset_name,attrlen,attr_name,f_ptr,'I'//C_NULL_CHAR, SizeOf_buf) + + END SUBROUTINE h5ltget_attribute_int_f + + !------------------------------------------------------------------------- + ! Function: h5ltget_attribute_float_f + ! + ! Purpose: Reads an attribute named ATTR_NAME + ! + ! Return: Success: 0, Failure: -1 + ! + ! Programmer: pvn@ncsa.uiuc.edu + ! + ! Date: October 05, 2004 + ! + ! Comments: + ! + ! Modifications: + ! + !------------------------------------------------------------------------- + + SUBROUTINE h5ltget_attribute_float_f(loc_id,& + dset_name,& + attr_name,& + buf,& + errcode ) + + IMPLICIT NONE + INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier + CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset + CHARACTER(LEN=*), INTENT(in) :: attr_name ! name of the attribute + INTEGER :: errcode ! error code + REAL(KIND=C_FLOAT), INTENT(inout), DIMENSION(*), TARGET :: buf + INTEGER(size_t) :: namelen ! name length + INTEGER(size_t) :: attrlen ! name length + TYPE(C_PTR) :: f_ptr + INTEGER(size_t) :: SizeOf_buf + + f_ptr = C_LOC(buf(1)) +#if H5_FORTRAN_HAVE_STORAGE_SIZE!=0 + SizeOf_buf = STORAGE_SIZE(buf(1), c_size_t)/STORAGE_SIZE(c_char_'a',c_size_t) +#else + SizeOf_buf = SIZEOF(buf(1)) +#endif + namelen = LEN(dset_name) + attrlen = LEN(attr_name) + errcode = h5ltget_attribute_c(loc_id,namelen,dset_name,attrlen,attr_name,f_ptr,'R'//C_NULL_CHAR, SizeOf_buf) + + END SUBROUTINE h5ltget_attribute_float_f + + !------------------------------------------------------------------------- + ! Function: h5ltget_attribute_c_double_f + ! + ! Purpose: Reads an attribute named ATTR_NAME + ! + ! Return: Success: 0, Failure: -1 + ! + ! Programmer: pvn@ncsa.uiuc.edu + ! + ! Date: October 05, 2004 + ! + ! Comments: + ! + ! Modifications: + ! + !------------------------------------------------------------------------- + + SUBROUTINE h5ltget_attribute_double_f(loc_id,& + dset_name,& + attr_name,& + buf,& + errcode ) + + IMPLICIT NONE + INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier + CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset + CHARACTER(LEN=*), INTENT(in) :: attr_name ! name of the attribute + INTEGER :: errcode ! error code + REAL(KIND=C_DOUBLE),INTENT(inout),DIMENSION(*), TARGET :: buf + INTEGER(size_t) :: namelen ! name length + INTEGER(size_t) :: attrlen ! name length + TYPE(C_PTR) :: f_ptr + INTEGER(size_t) :: SizeOf_buf + + f_ptr = C_LOC(buf(1)) +#if H5_FORTRAN_HAVE_STORAGE_SIZE!=0 + SizeOf_buf = STORAGE_SIZE(buf(1), c_size_t)/STORAGE_SIZE(c_char_'a',c_size_t) +#else + SizeOf_buf = SIZEOF(buf(1)) +#endif + + namelen = LEN(dset_name) + attrlen = LEN(attr_name) + errcode = h5ltget_attribute_c(loc_id,namelen,dset_name,attrlen,attr_name,f_ptr,'R'//C_NULL_CHAR, SizeOf_buf) + + END SUBROUTINE h5ltget_attribute_double_f + + !------------------------------------------------------------------------- + ! Function: h5ltget_attribute_string_f + ! + ! Purpose: Reads an attribute named ATTR_NAME + ! + ! Return: Success: 0, Failure: -1 + ! + ! Programmer: pvn@ncsa.uiuc.edu + ! + ! Date: October 05, 2004 + ! + ! Comments: + ! + ! Modifications: + ! + !------------------------------------------------------------------------- + + SUBROUTINE h5ltget_attribute_string_f(loc_id,& + dset_name,& + attr_name,& + buf,& + errcode ) + + IMPLICIT NONE + INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier + CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset + CHARACTER(LEN=*), INTENT(in) :: attr_name ! name of the attribute + INTEGER :: errcode ! error code + CHARACTER(LEN=*), INTENT(inout) :: buf + INTEGER(size_t) :: namelen ! name length + INTEGER(size_t) :: attrlen ! name length + INTEGER(size_t) :: buf_size ! buf size + + INTERFACE + INTEGER FUNCTION h5ltget_attribute_string_c(loc_id,namelen,dset_name,attrlen,attr_name,buf,buf_size) & + BIND(C,NAME='h5ltget_attribute_string_c') + IMPORT :: C_CHAR + IMPORT :: HID_T, SIZE_T, HSIZE_T + IMPLICIT NONE + INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier + INTEGER(size_t) :: namelen ! length of name buffer + INTEGER(size_t) :: attrlen ! length of attr name buffer + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: dset_name ! name of the dataset + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: attr_name ! name of the attribute + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(inout) :: buf ! data buffer + INTEGER(size_t) :: buf_size ! data buffer size + END FUNCTION h5ltget_attribute_string_c + END INTERFACE + + namelen = LEN(dset_name) + attrlen = LEN(attr_name) + buf_size = LEN(buf) + + errcode = h5ltget_attribute_string_c(loc_id,namelen,dset_name,attrlen,attr_name,buf,buf_size) + + END SUBROUTINE h5ltget_attribute_string_f + + !------------------------------------------------------------------------- + ! Query dataset functions + !------------------------------------------------------------------------- + + !------------------------------------------------------------------------- + ! Function: h5ltget_dataset_ndims_f + ! + ! Purpose: Gets the dimensionality of a dataset + ! + ! Return: Success: 0, Failure: -1 + ! + ! Programmer: pvn@ncsa.uiuc.edu + ! + ! Date: September 30, 2004 + ! + ! Comments: + ! + ! Modifications: + ! + !------------------------------------------------------------------------- + + SUBROUTINE h5ltget_dataset_ndims_f(loc_id,& + dset_name,& + rank,& + errcode ) + + IMPLICIT NONE + INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier + CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset + INTEGER, INTENT(inout) :: rank ! rank + INTEGER :: errcode ! error code + INTEGER(size_t) :: namelen ! name length + + INTERFACE + INTEGER FUNCTION h5ltget_dataset_ndims_c(loc_id,namelen,dset_name,rank) & + BIND(C,NAME='h5ltget_dataset_ndims_c') + IMPORT :: C_CHAR + IMPORT :: HID_T, SIZE_T, HSIZE_T + IMPLICIT NONE + INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier + INTEGER(size_t) :: namelen ! length of name buffer + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: dset_name ! name of the dataset + INTEGER, INTENT(inout) :: rank ! rank + END FUNCTION h5ltget_dataset_ndims_c + END INTERFACE + + namelen = LEN(dset_name) + errcode = h5ltget_dataset_ndims_c(loc_id,namelen,dset_name,rank) + + END SUBROUTINE h5ltget_dataset_ndims_f + + + !------------------------------------------------------------------------- + ! Function: h5ltfind_dataset_f + ! + ! Purpose: Inquires if a dataset named dset_name exists attached + ! to the object loc_id. + ! + ! Return: Success: 0, Failure: -1 + ! + ! Programmer: pvn@ncsa.uiuc.edu + ! + ! Date: October 05, 2004 + ! + ! Comments: + ! + ! Modifications: + ! + !------------------------------------------------------------------------- + + INTEGER FUNCTION h5ltfind_dataset_f(loc_id,& + dset_name) + + IMPLICIT NONE + INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier + CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset + INTEGER :: errcode ! error code + INTEGER(size_t) :: namelen ! name length + + INTERFACE + INTEGER FUNCTION h5ltfind_dataset_c(loc_id,namelen,dset_name) & + BIND(C,NAME='h5ltfind_dataset_c') + IMPORT :: C_CHAR + IMPORT :: HID_T, SIZE_T, HSIZE_T + IMPLICIT NONE + INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier + INTEGER(size_t) :: namelen ! length of name buffer + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: dset_name ! name of the dataset + END FUNCTION h5ltfind_dataset_c + END INTERFACE + + namelen = LEN(dset_name) + errcode = h5ltfind_dataset_c(loc_id,namelen,dset_name) + h5ltfind_dataset_f = errcode + + END FUNCTION h5ltfind_dataset_f + + !------------------------------------------------------------------------- + ! Function: h5ltget_dataset_info_f + ! + ! Purpose: Gets information about a dataset + ! + ! Return: Success: 0, Failure: -1 + ! + ! Programmer: pvn@ncsa.uiuc.edu + ! + ! Date: September 30, 2004 + ! + ! Comments: + ! + ! Modifications: + ! + !------------------------------------------------------------------------- + + SUBROUTINE h5ltget_dataset_info_f(loc_id,& + dset_name,& + dims,& + type_class,& + type_size,& + errcode ) + + IMPLICIT NONE + INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier + CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset + INTEGER(hsize_t),DIMENSION(*),INTENT(inout):: dims ! dimensions + INTEGER, INTENT(inout) :: type_class ! type class + INTEGER(size_t), INTENT(inout) :: type_size ! type size + INTEGER :: errcode ! error code + INTEGER(size_t) :: namelen ! name length + + INTERFACE + INTEGER FUNCTION h5ltget_dataset_info_c(loc_id,namelen,dset_name,dims,type_class,type_size) & + BIND(C,NAME='h5ltget_dataset_info_c') + IMPORT :: C_CHAR + IMPORT :: HID_T, SIZE_T, HSIZE_T + IMPLICIT NONE + INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier + INTEGER(size_t) :: namelen ! length of name buffer + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: dset_name ! name of the dataset + INTEGER(hsize_t),DIMENSION(*),INTENT(inout):: dims ! dimensions + INTEGER, INTENT(inout) :: type_class ! type class + INTEGER(size_t), INTENT(inout) :: type_size ! type size + END FUNCTION h5ltget_dataset_info_c + END INTERFACE + + namelen = LEN(dset_name) + errcode = h5ltget_dataset_info_c(loc_id,namelen,dset_name,dims,type_class,type_size) + + END SUBROUTINE h5ltget_dataset_info_f + + + !------------------------------------------------------------------------- + ! Query attribute functions + !------------------------------------------------------------------------- + + + !------------------------------------------------------------------------- + ! Function: h5ltget_attribute_ndims_f + ! + ! Purpose: Create and write an attribute + ! + ! Return: Success: 0, Failure: -1 + ! + ! Programmer: pvn@ncsa.uiuc.edu + ! + ! Date: October 05, 2004 + ! + ! Comments: + ! + ! Modifications: + ! + !------------------------------------------------------------------------- + + SUBROUTINE h5ltget_attribute_ndims_f(loc_id,& + dset_name,& + attr_name,& + rank,& + errcode ) + + IMPLICIT NONE + INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier + CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset + CHARACTER(LEN=*), INTENT(in) :: attr_name ! name of the attribute + INTEGER, INTENT(inout) :: rank ! rank + INTEGER :: errcode ! error code + INTEGER(size_t) :: namelen ! name length + INTEGER(size_t) :: attrlen ! name length + + INTERFACE + INTEGER FUNCTION h5ltget_attribute_ndims_c(loc_id,namelen,dset_name,attrlen,attr_name,rank) & + BIND(C,NAME='h5ltget_attribute_ndims_c') + IMPORT :: C_CHAR + IMPORT :: HID_T, SIZE_T, HSIZE_T + IMPLICIT NONE + INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier + INTEGER(size_t) :: namelen ! length of name buffer + INTEGER(size_t) :: attrlen ! length of attr name buffer + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: dset_name ! name of the dataset + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: attr_name ! name of the attribute + INTEGER, INTENT(inout) :: rank ! rank + END FUNCTION h5ltget_attribute_ndims_c + END INTERFACE + + namelen = LEN(dset_name) + attrlen = LEN(attr_name) + errcode = h5ltget_attribute_ndims_c(loc_id,namelen,dset_name,attrlen,attr_name,rank) + + END SUBROUTINE h5ltget_attribute_ndims_f + + + !------------------------------------------------------------------------- + ! Function: h5ltget_attribute_info_f + ! + ! Purpose: Gets information about an attribute + ! + ! Return: Success: 0, Failure: -1 + ! + ! Programmer: pvn@ncsa.uiuc.edu + ! + ! Date: September 30, 2004 + ! + ! Comments: + ! + ! Modifications: + ! + !------------------------------------------------------------------------- + + SUBROUTINE h5ltget_attribute_info_f(loc_id,& + dset_name,& + attr_name,& + dims,& + type_class,& + type_size,& + errcode ) + + IMPLICIT NONE + INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier + CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset + CHARACTER(LEN=*), INTENT(in) :: attr_name ! name of the attribute + INTEGER(hsize_t),DIMENSION(*),INTENT(inout):: dims ! dimensions + INTEGER, INTENT(inout) :: type_class ! type class + INTEGER(size_t), INTENT(inout) :: type_size ! type size + INTEGER :: errcode ! error code + INTEGER(size_t) :: namelen ! name length + INTEGER(size_t) :: attrlen ! name length + + INTERFACE + INTEGER FUNCTION h5ltget_attribute_info_c(loc_id,namelen,dset_name,attrlen,attr_name,dims,type_class,type_size) & + BIND(C,NAME='h5ltget_attribute_info_c') + IMPORT :: C_CHAR + IMPORT :: HID_T, SIZE_T, HSIZE_T + IMPLICIT NONE + INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier + INTEGER(size_t) :: namelen ! length of name buffer + INTEGER(size_t) :: attrlen ! length of attr name buffer + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: dset_name ! name of the dataset + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: attr_name ! name of the attribute + INTEGER(hsize_t),DIMENSION(*),INTENT(inout):: dims ! dimensions + INTEGER, INTENT(inout) :: type_class ! type class + INTEGER(size_t), INTENT(inout) :: type_size ! type size + END FUNCTION h5ltget_attribute_info_c + END INTERFACE + + namelen = LEN(dset_name) + attrlen = LEN(attr_name) + errcode = h5ltget_attribute_info_c(loc_id,namelen,dset_name,attrlen,attr_name,dims,type_class,type_size) + + END SUBROUTINE h5ltget_attribute_info_f + + !------------------------------------------------------------------------- + ! Function: h5ltpath_valid_f + ! + ! Purpose: Validates a path + ! + ! Return: Success: 0, Failure: -1 + ! + ! Programmer: M. Scot Breitenfeld + ! + ! Date: February 18, 2012 + ! + ! Comments: + ! + ! Modifications: + ! + !------------------------------------------------------------------------- + + SUBROUTINE h5ltpath_valid_f(loc_id, path, check_object_valid, path_valid, errcode) + + IMPLICIT NONE + INTEGER(hid_t) , INTENT(IN) :: loc_id ! An identifier of an object in the file. + CHARACTER(LEN=*), INTENT(IN) :: path ! Path to the object to check, relative to loc_id. + LOGICAL , INTENT(IN) :: check_object_valid ! Indicates whether to check if the final component + ! of the path resolves to a valid object + LOGICAL , INTENT(OUT) :: path_valid ! Object status + INTEGER , INTENT(OUT) :: errcode ! Error code: 0 on success and -1 on failure + + INTEGER(size_t) :: pathlen + INTEGER :: check_object_valid_c + INTEGER :: status + + INTERFACE + INTEGER FUNCTION h5ltpath_valid_c(loc_id, path, pathlen, check_object_valid_c) & + BIND(C,NAME='h5ltpath_valid_c') + IMPORT :: C_CHAR + IMPORT :: HID_T, SIZE_T, HSIZE_T + IMPLICIT NONE + INTEGER(hid_t), INTENT(in) :: loc_id + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: path + INTEGER(size_t) :: pathlen + INTEGER :: check_object_valid_c + END FUNCTION h5ltpath_valid_c + END INTERFACE + + ! Initialize + path_valid = .FALSE. + errcode = 0 + + check_object_valid_c = 0 + IF(check_object_valid) check_object_valid_c = 1 + + pathlen = LEN(path) + status = h5ltpath_valid_c(loc_id, path, pathlen, check_object_valid_c) + + IF(status.EQ.1)THEN + path_valid = .TRUE. + ELSE IF(status.LT.0)THEN + errcode = -1 + ENDIF + + END SUBROUTINE h5ltpath_valid_f + +END MODULE H5LT_CONST + + + + + + diff --git a/hl/fortran/src/H5LTff.f90 b/hl/fortran/src/H5LTff.f90 deleted file mode 100644 index 9393f7f..0000000 --- a/hl/fortran/src/H5LTff.f90 +++ /dev/null @@ -1,6490 +0,0 @@ -! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -! 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. * -! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -! -! -! This file contains FORTRAN90 interfaces for H5LT functions -! - -MODULE h5lt - USE h5fortran_types - USE hdf5 - - INTERFACE h5ltmake_dataset_f - MODULE PROCEDURE h5ltmake_dataset_f_int1 - MODULE PROCEDURE h5ltmake_dataset_f_int2 - MODULE PROCEDURE h5ltmake_dataset_f_int3 - MODULE PROCEDURE h5ltmake_dataset_f_int4 - MODULE PROCEDURE h5ltmake_dataset_f_int5 - MODULE PROCEDURE h5ltmake_dataset_f_int6 - MODULE PROCEDURE h5ltmake_dataset_f_int7 - MODULE PROCEDURE h5ltmake_dataset_f_float1 - MODULE PROCEDURE h5ltmake_dataset_f_float2 - MODULE PROCEDURE h5ltmake_dataset_f_float3 - MODULE PROCEDURE h5ltmake_dataset_f_float4 - MODULE PROCEDURE h5ltmake_dataset_f_float5 - MODULE PROCEDURE h5ltmake_dataset_f_float6 - MODULE PROCEDURE h5ltmake_dataset_f_float7 - MODULE PROCEDURE h5ltmake_dataset_f_double1 - MODULE PROCEDURE h5ltmake_dataset_f_double2 - MODULE PROCEDURE h5ltmake_dataset_f_double3 - MODULE PROCEDURE h5ltmake_dataset_f_double4 - MODULE PROCEDURE h5ltmake_dataset_f_double5 - MODULE PROCEDURE h5ltmake_dataset_f_double6 - MODULE PROCEDURE h5ltmake_dataset_f_double7 - END INTERFACE - - INTERFACE h5ltread_dataset_f - MODULE PROCEDURE h5ltread_dataset_f_int1 - MODULE PROCEDURE h5ltread_dataset_f_int2 - MODULE PROCEDURE h5ltread_dataset_f_int3 - MODULE PROCEDURE h5ltread_dataset_f_int4 - MODULE PROCEDURE h5ltread_dataset_f_int5 - MODULE PROCEDURE h5ltread_dataset_f_int6 - MODULE PROCEDURE h5ltread_dataset_f_int7 - MODULE PROCEDURE h5ltread_dataset_f_float1 - MODULE PROCEDURE h5ltread_dataset_f_float2 - MODULE PROCEDURE h5ltread_dataset_f_float3 - MODULE PROCEDURE h5ltread_dataset_f_float4 - MODULE PROCEDURE h5ltread_dataset_f_float5 - MODULE PROCEDURE h5ltread_dataset_f_float6 - MODULE PROCEDURE h5ltread_dataset_f_float7 - MODULE PROCEDURE h5ltread_dataset_f_double1 - MODULE PROCEDURE h5ltread_dataset_f_double2 - MODULE PROCEDURE h5ltread_dataset_f_double3 - MODULE PROCEDURE h5ltread_dataset_f_double4 - MODULE PROCEDURE h5ltread_dataset_f_double5 - MODULE PROCEDURE h5ltread_dataset_f_double6 - MODULE PROCEDURE h5ltread_dataset_f_double7 - END INTERFACE - - INTERFACE h5ltmake_dataset_int_f - MODULE PROCEDURE h5ltmake_dataset_int_f_1 - MODULE PROCEDURE h5ltmake_dataset_int_f_2 - MODULE PROCEDURE h5ltmake_dataset_int_f_3 - MODULE PROCEDURE h5ltmake_dataset_int_f_4 - MODULE PROCEDURE h5ltmake_dataset_int_f_5 - MODULE PROCEDURE h5ltmake_dataset_int_f_6 - MODULE PROCEDURE h5ltmake_dataset_int_f_7 - END INTERFACE - - INTERFACE h5ltmake_dataset_float_f - MODULE PROCEDURE h5ltmake_dataset_float_f_1 - MODULE PROCEDURE h5ltmake_dataset_float_f_2 - MODULE PROCEDURE h5ltmake_dataset_float_f_3 - MODULE PROCEDURE h5ltmake_dataset_float_f_4 - MODULE PROCEDURE h5ltmake_dataset_float_f_5 - MODULE PROCEDURE h5ltmake_dataset_float_f_6 - MODULE PROCEDURE h5ltmake_dataset_float_f_7 - END INTERFACE - - INTERFACE h5ltmake_dataset_double_f - MODULE PROCEDURE h5ltmake_dataset_double_f_1 - MODULE PROCEDURE h5ltmake_dataset_double_f_2 - MODULE PROCEDURE h5ltmake_dataset_double_f_3 - MODULE PROCEDURE h5ltmake_dataset_double_f_4 - MODULE PROCEDURE h5ltmake_dataset_double_f_5 - MODULE PROCEDURE h5ltmake_dataset_double_f_6 - MODULE PROCEDURE h5ltmake_dataset_double_f_7 - END INTERFACE - - INTERFACE h5ltread_dataset_int_f - MODULE PROCEDURE h5ltread_dataset_int_f_1 - MODULE PROCEDURE h5ltread_dataset_int_f_2 - MODULE PROCEDURE h5ltread_dataset_int_f_3 - MODULE PROCEDURE h5ltread_dataset_int_f_4 - MODULE PROCEDURE h5ltread_dataset_int_f_5 - MODULE PROCEDURE h5ltread_dataset_int_f_6 - MODULE PROCEDURE h5ltread_dataset_int_f_7 - END INTERFACE - - INTERFACE h5ltread_dataset_float_f - MODULE PROCEDURE h5ltread_dataset_float_f_1 - MODULE PROCEDURE h5ltread_dataset_float_f_2 - MODULE PROCEDURE h5ltread_dataset_float_f_3 - MODULE PROCEDURE h5ltread_dataset_float_f_4 - MODULE PROCEDURE h5ltread_dataset_float_f_5 - MODULE PROCEDURE h5ltread_dataset_float_f_6 - MODULE PROCEDURE h5ltread_dataset_float_f_7 - END INTERFACE - - INTERFACE h5ltread_dataset_double_f - MODULE PROCEDURE h5ltread_dataset_double_f_1 - MODULE PROCEDURE h5ltread_dataset_double_f_2 - MODULE PROCEDURE h5ltread_dataset_double_f_3 - MODULE PROCEDURE h5ltread_dataset_double_f_4 - MODULE PROCEDURE h5ltread_dataset_double_f_5 - MODULE PROCEDURE h5ltread_dataset_double_f_6 - MODULE PROCEDURE h5ltread_dataset_double_f_7 - END INTERFACE - -CONTAINS - !------------------------------------------------------------------------- - ! Make/Read dataset functions - !------------------------------------------------------------------------- - - !------------------------------------------------------------------------- - ! Function: h5ltmake_dataset_f_int1 - ! - ! Purpose: Creates and writes a dataset of a type TYPE_ID - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: pvn@ncsa.uiuc.edu - ! - ! Date: September 1, 2004 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - - SUBROUTINE h5ltmake_dataset_f_int1(loc_id,& - dset_name,& - rank,& - dims,& - type_id,& - buf,& - errcode ) - - IMPLICIT NONE - - ! - !This definition is needed for Windows DLLs - !DEC$if defined(BUILD_HDF5_HL_DLL) - !DEC$attributes dllexport :: h5ltmake_dataset_f_int1 - !DEC$endif - ! - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: rank ! rank - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER, INTENT(in), DIMENSION(*) :: buf ! data buffer - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - - INTERFACE - INTEGER FUNCTION h5ltmake_dataset_int1_c(loc_id,namelen,dset_name,rank,dims,type_id,buf) - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LTMAKE_DATASET_INT1_C'::h5ltmake_dataset_int1_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER(size_t) :: namelen ! length of name buffer - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: rank ! rank - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER, INTENT(in), DIMENSION(*) :: buf ! data buffer - END FUNCTION h5ltmake_dataset_int1_c - END INTERFACE - - namelen = LEN(dset_name) - errcode = h5ltmake_dataset_int1_c(loc_id,namelen,dset_name,rank,dims,type_id,buf) - - END SUBROUTINE h5ltmake_dataset_f_int1 - - !------------------------------------------------------------------------- - ! Function: h5ltmake_dataset_f_int2 - ! - ! Purpose: Creates and writes a dataset of a type TYPE_ID - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: pvn@ncsa.uiuc.edu - ! - ! Date: September 1, 2004 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - - SUBROUTINE h5ltmake_dataset_f_int2(loc_id,& - dset_name,& - rank,& - dims,& - type_id,& - buf,& - errcode ) - - IMPLICIT NONE - - ! - !This definition is needed for Windows DLLs - !DEC$if defined(BUILD_HDF5_HL_DLL) - !DEC$attributes dllexport :: h5ltmake_dataset_f_int2 - !DEC$endif - ! - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: rank ! rank - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - INTEGER, INTENT(in), & - DIMENSION(dims(1),dims(2)) :: buf ! data buffer - - INTERFACE - INTEGER FUNCTION h5ltmake_dataset_int2_c(loc_id,namelen,dset_name,rank,dims,type_id,buf) - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LTMAKE_DATASET_INT2_C'::h5ltmake_dataset_int2_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER(size_t) :: namelen ! length of name buffer - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: rank ! rank - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER, INTENT(in), & - DIMENSION(dims(1),dims(2)) :: buf ! data buffer - END FUNCTION h5ltmake_dataset_int2_c - END INTERFACE - - namelen = LEN(dset_name) - errcode = h5ltmake_dataset_int2_c(loc_id,namelen,dset_name,rank,dims,type_id,buf) - - END SUBROUTINE h5ltmake_dataset_f_int2 - - !------------------------------------------------------------------------- - ! Function: h5ltmake_dataset_f_int3 - ! - ! Purpose: Creates and writes a dataset of a type TYPE_ID - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: pvn@ncsa.uiuc.edu - ! - ! Date: September 1, 2004 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - - SUBROUTINE h5ltmake_dataset_f_int3(loc_id,& - dset_name,& - rank,& - dims,& - type_id,& - buf,& - errcode ) - - IMPLICIT NONE - - ! - !This definition is needed for Windows DLLs - !DEC$if defined(BUILD_HDF5_HL_DLL) - !DEC$attributes dllexport :: h5ltmake_dataset_f_int3 - !DEC$endif - ! - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: rank ! rank - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - INTEGER, INTENT(in), & - DIMENSION(dims(1),dims(2),dims(3)) :: buf ! data buffer - - INTERFACE - INTEGER FUNCTION h5ltmake_dataset_int3_c(loc_id,namelen,dset_name,rank,dims,type_id,buf) - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LTMAKE_DATASET_INT3_C'::h5ltmake_dataset_int3_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER(size_t) :: namelen ! length of name buffer - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: rank ! rank - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER, INTENT(in), & - DIMENSION(dims(1),dims(2),dims(3)) :: buf ! data buffer - END FUNCTION h5ltmake_dataset_int3_c - END INTERFACE - - namelen = LEN(dset_name) - errcode = h5ltmake_dataset_int3_c(loc_id,namelen,dset_name,rank,dims,type_id,buf) - - END SUBROUTINE h5ltmake_dataset_f_int3 - - !------------------------------------------------------------------------- - ! Function: h5ltmake_dataset_f_int4 - ! - ! Purpose: Creates and writes a dataset of a type TYPE_ID - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: M. Scot Breitenfeld - ! - ! Date: March 7, 2011 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - - SUBROUTINE h5ltmake_dataset_f_int4(loc_id, dset_name, rank, dims, & - type_id, buf, errcode ) - - IMPLICIT NONE - - ! - !This definition is needed for Windows DLLs - !DEC$if defined(BUILD_HDF5_HL_DLL) - !DEC$attributes dllexport :: h5ltmake_dataset_f_int4 - !DEC$endif - ! - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: rank ! rank - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - INTEGER, INTENT(in), & - DIMENSION(dims(1),dims(2),dims(3),dims(4)) :: buf ! data buffer - - INTERFACE - INTEGER FUNCTION h5ltmake_dataset_int4_c(loc_id,namelen,dset_name,rank,dims,type_id,buf) - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LTMAKE_DATASET_INT4_C'::h5ltmake_dataset_int4_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER(size_t) :: namelen ! length of name buffer - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: rank ! rank - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER, INTENT(in), & - DIMENSION(dims(1),dims(2),dims(3),dims(4)) :: buf ! data buffer - END FUNCTION h5ltmake_dataset_int4_c - END INTERFACE - - namelen = LEN(dset_name) - errcode = h5ltmake_dataset_int4_c(loc_id,namelen,dset_name,rank,dims,type_id,buf) - - END SUBROUTINE h5ltmake_dataset_f_int4 - - !------------------------------------------------------------------------- - ! Function: h5ltmake_dataset_f_int5 - ! - ! Purpose: Creates and writes a dataset of a type TYPE_ID - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: M. Scot Breitenfeld - ! - ! Date: March 7, 2011 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - - SUBROUTINE h5ltmake_dataset_f_int5(loc_id, dset_name, rank, dims, & - type_id, buf, errcode ) - - IMPLICIT NONE - - ! - !This definition is needed for Windows DLLs - !DEC$if defined(BUILD_HDF5_HL_DLL) - !DEC$attributes dllexport :: h5ltmake_dataset_f_int5 - !DEC$endif - ! - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: rank ! rank - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - INTEGER, INTENT(in), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) :: buf ! data buffer - - INTERFACE - INTEGER FUNCTION h5ltmake_dataset_int5_c(loc_id,namelen,dset_name,rank,dims,type_id,buf) - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LTMAKE_DATASET_INT5_C'::h5ltmake_dataset_int5_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER(size_t) :: namelen ! length of name buffer - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: rank ! rank - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER, INTENT(in), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) :: buf ! data buffer - END FUNCTION h5ltmake_dataset_int5_c - END INTERFACE - - namelen = LEN(dset_name) - errcode = h5ltmake_dataset_int5_c(loc_id,namelen,dset_name,rank,dims,type_id,buf) - - END SUBROUTINE h5ltmake_dataset_f_int5 - - !------------------------------------------------------------------------- - ! Function: h5ltmake_dataset_f_int6 - ! - ! Purpose: Creates and writes a dataset of a type TYPE_ID - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: M. Scot Breitenfeld - ! - ! Date: March 7, 2011 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - - SUBROUTINE h5ltmake_dataset_f_int6(loc_id, dset_name, rank, dims, & - type_id, buf, errcode ) - - IMPLICIT NONE - - ! - !This definition is needed for Windows DLLs - !DEC$if defined(BUILD_HDF5_HL_DLL) - !DEC$attributes dllexport :: h5ltmake_dataset_f_int6 - !DEC$endif - ! - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: rank ! rank - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - INTEGER, INTENT(in), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)) :: buf ! data buffer - - INTERFACE - INTEGER FUNCTION h5ltmake_dataset_int6_c(loc_id,namelen,dset_name,rank,dims,type_id,buf) - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LTMAKE_DATASET_INT6_C'::h5ltmake_dataset_int6_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER(size_t) :: namelen ! length of name buffer - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: rank ! rank - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER, INTENT(in), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)) :: buf ! data buffer - END FUNCTION h5ltmake_dataset_int6_c - END INTERFACE - - namelen = LEN(dset_name) - errcode = h5ltmake_dataset_int6_c(loc_id,namelen,dset_name,rank,dims,type_id,buf) - - END SUBROUTINE h5ltmake_dataset_f_int6 - - !------------------------------------------------------------------------- - ! Function: h5ltmake_dataset_f_int7 - ! - ! Purpose: Creates and writes a dataset of a type TYPE_ID - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: M. Scot Breitenfeld - ! - ! Date: March 7, 2011 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - - SUBROUTINE h5ltmake_dataset_f_int7(loc_id, dset_name, rank, dims, & - type_id, buf, errcode ) - - IMPLICIT NONE - - ! - !This definition is needed for Windows DLLs - !DEC$if defined(BUILD_HDF5_HL_DLL) - !DEC$attributes dllexport :: h5ltmake_dataset_f_int7 - !DEC$endif - ! - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: rank ! rank - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - INTEGER, INTENT(in), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)) :: buf ! data buffer - - INTERFACE - INTEGER FUNCTION h5ltmake_dataset_int7_c(loc_id,namelen,dset_name,rank,dims,type_id,buf) - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LTMAKE_DATASET_INT7_C'::h5ltmake_dataset_int7_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER(size_t) :: namelen ! length of name buffer - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: rank ! rank - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER, INTENT(in), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)) :: buf ! data buffer - END FUNCTION h5ltmake_dataset_int7_c - END INTERFACE - - namelen = LEN(dset_name) - errcode = h5ltmake_dataset_int7_c(loc_id,namelen,dset_name,rank,dims,type_id,buf) - - END SUBROUTINE h5ltmake_dataset_f_int7 - - - !------------------------------------------------------------------------- - ! Function: h5ltmake_dataset_f_float1 - ! - ! Purpose: Creates and writes a dataset of a type TYPE_ID - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: pvn@ncsa.uiuc.edu - ! - ! Date: September 1, 2004 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - - SUBROUTINE h5ltmake_dataset_f_float1(loc_id,& - dset_name,& - rank,& - dims,& - type_id,& - buf,& - errcode ) - - IMPLICIT NONE - - ! - !This definition is needed for Windows DLLs - !DEC$if defined(BUILD_HDF5_HL_DLL) - !DEC$attributes dllexport :: h5ltmake_dataset_f_float1 - !DEC$endif - ! - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: rank ! rank - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - REAL, INTENT(in), DIMENSION(*) :: buf ! data buffer - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - - INTERFACE - INTEGER FUNCTION h5ltmake_dataset_fl1_c(loc_id,namelen,dset_name,rank,dims,type_id,buf) - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LTMAKE_DATASET_FL1_C'::h5ltmake_dataset_fl1_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER(size_t) :: namelen ! length of name buffer - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: rank ! rank - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - REAL, INTENT(in), DIMENSION(*) :: buf ! data buffer - END FUNCTION h5ltmake_dataset_fl1_c - END INTERFACE - - namelen = LEN(dset_name) - errcode = h5ltmake_dataset_fl1_c(loc_id,namelen,dset_name,rank,dims,type_id,buf) - - END SUBROUTINE h5ltmake_dataset_f_float1 - - !------------------------------------------------------------------------- - ! Function: h5ltmake_dataset_f_float2 - ! - ! Purpose: Creates and writes a dataset of a type TYPE_ID - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: pvn@ncsa.uiuc.edu - ! - ! Date: September 1, 2004 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - - SUBROUTINE h5ltmake_dataset_f_float2(loc_id,& - dset_name,& - rank,& - dims,& - type_id,& - buf,& - errcode ) - - IMPLICIT NONE - - ! - !This definition is needed for Windows DLLs - !DEC$if defined(BUILD_HDF5_HL_DLL) - !DEC$attributes dllexport :: h5ltmake_dataset_f_float2 - !DEC$endif - ! - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: rank ! rank - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - REAL, INTENT(in), & - DIMENSION(dims(1),dims(2)) :: buf ! data buffer - - INTERFACE - INTEGER FUNCTION h5ltmake_dataset_fl2_c(loc_id,namelen,dset_name,rank,dims,type_id,buf) - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LTMAKE_DATASET_FL2_C'::h5ltmake_dataset_fl2_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER(size_t) :: namelen ! length of name buffer - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: rank ! rank - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - REAL, INTENT(in), & - DIMENSION(dims(1),dims(2)) :: buf ! data buffer - END FUNCTION h5ltmake_dataset_fl2_c - END INTERFACE - - namelen = LEN(dset_name) - errcode = h5ltmake_dataset_fl2_c(loc_id,namelen,dset_name,rank,dims,type_id,buf) - - END SUBROUTINE h5ltmake_dataset_f_float2 - - !------------------------------------------------------------------------- - ! Function: h5ltmake_dataset_f_float3 - ! - ! Purpose: Creates and writes a dataset of a type TYPE_ID - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: pvn@ncsa.uiuc.edu - ! - ! Date: September 1, 2004 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - - SUBROUTINE h5ltmake_dataset_f_float3(loc_id,& - dset_name,& - rank,& - dims,& - type_id,& - buf,& - errcode ) - - IMPLICIT NONE - - ! - !This definition is needed for Windows DLLs - !DEC$if defined(BUILD_HDF5_HL_DLL) - !DEC$attributes dllexport :: h5ltmake_dataset_f_float3 - !DEC$endif - ! - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: rank ! rank - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - REAL, INTENT(in), & - DIMENSION(dims(1),dims(2),dims(3)) :: buf ! data buffer - - INTERFACE - INTEGER FUNCTION h5ltmake_dataset_fl3_c(loc_id,namelen,dset_name,rank,dims,type_id,buf) - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LTMAKE_DATASET_FL3_C'::h5ltmake_dataset_fl3_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER(size_t) :: namelen ! length of name buffer - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: rank ! rank - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - REAL, INTENT(in), & - DIMENSION(dims(1),dims(2),dims(3)) :: buf ! data buffer - END FUNCTION h5ltmake_dataset_fl3_c - END INTERFACE - - namelen = LEN(dset_name) - errcode = h5ltmake_dataset_fl3_c(loc_id,namelen,dset_name,rank,dims,type_id,buf) - - END SUBROUTINE h5ltmake_dataset_f_float3 - - !------------------------------------------------------------------------- - ! Function: h5ltmake_dataset_f_float4 - ! - ! Purpose: Creates and writes a dataset of a type TYPE_ID - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: M. Scot Breitenfeld - ! - ! Date: March 7, 2011 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - - SUBROUTINE h5ltmake_dataset_f_float4(loc_id, dset_name, rank, dims,& - type_id, buf, errcode ) - - IMPLICIT NONE - - ! - !This definition is needed for Windows DLLs - !DEC$if defined(BUILD_HDF5_HL_DLL) - !DEC$attributes dllexport :: h5ltmake_dataset_f_float4 - !DEC$endif - ! - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: rank ! rank - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - REAL, INTENT(in), & - DIMENSION(dims(1),dims(2),dims(3),dims(4)) :: buf ! data buffer - - INTERFACE - INTEGER FUNCTION h5ltmake_dataset_fl4_c(loc_id,namelen,dset_name,rank,dims,type_id,buf) - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LTMAKE_DATASET_FL4_C'::h5ltmake_dataset_fl4_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER(size_t) :: namelen ! length of name buffer - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: rank ! rank - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - REAL, INTENT(in), & - DIMENSION(dims(1),dims(2),dims(3), dims(4)) :: buf ! data buffer - END FUNCTION h5ltmake_dataset_fl4_c - END INTERFACE - - namelen = LEN(dset_name) - errcode = h5ltmake_dataset_fl4_c(loc_id,namelen,dset_name,rank,dims,type_id,buf) - - END SUBROUTINE h5ltmake_dataset_f_float4 - - !------------------------------------------------------------------------- - ! Function: h5ltmake_dataset_f_float5 - ! - ! Purpose: Creates and writes a dataset of a type TYPE_ID - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: M. Scot Breitenfeld - ! - ! Date: March 7, 2011 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - - SUBROUTINE h5ltmake_dataset_f_float5(loc_id, dset_name, rank, dims,& - type_id, buf, errcode ) - - IMPLICIT NONE - - ! - !This definition is needed for Windows DLLs - !DEC$if defined(BUILD_HDF5_HL_DLL) - !DEC$attributes dllexport :: h5ltmake_dataset_f_float5 - !DEC$endif - ! - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: rank ! rank - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - REAL, INTENT(in), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) :: buf ! data buffer - - INTERFACE - INTEGER FUNCTION h5ltmake_dataset_fl5_c(loc_id,namelen,dset_name,rank,dims,type_id,buf) - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LTMAKE_DATASET_FL5_C'::h5ltmake_dataset_fl5_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER(size_t) :: namelen ! length of name buffer - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: rank ! rank - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - REAL, INTENT(in), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) :: buf ! data buffer - END FUNCTION h5ltmake_dataset_fl5_c - END INTERFACE - - namelen = LEN(dset_name) - errcode = h5ltmake_dataset_fl5_c(loc_id,namelen,dset_name,rank,dims,type_id,buf) - - END SUBROUTINE h5ltmake_dataset_f_float5 - - !------------------------------------------------------------------------- - ! Function: h5ltmake_dataset_f_float6 - ! - ! Purpose: Creates and writes a dataset of a type TYPE_ID - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: M. Scot Breitenfeld - ! - ! Date: March 7, 2011 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - - SUBROUTINE h5ltmake_dataset_f_float6(loc_id, dset_name, rank, dims,& - type_id, buf, errcode ) - - IMPLICIT NONE - - ! - !This definition is needed for Windows DLLs - !DEC$if defined(BUILD_HDF5_HL_DLL) - !DEC$attributes dllexport :: h5ltmake_dataset_f_float6 - !DEC$endif - ! - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: rank ! rank - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - REAL, INTENT(in), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)) :: buf ! data buffer - - INTERFACE - INTEGER FUNCTION h5ltmake_dataset_fl6_c(loc_id,namelen,dset_name,rank,dims,type_id,buf) - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LTMAKE_DATASET_FL6_C'::h5ltmake_dataset_fl6_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER(size_t) :: namelen ! length of name buffer - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: rank ! rank - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - REAL, INTENT(in), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)) :: buf ! data buffer - END FUNCTION h5ltmake_dataset_fl6_c - END INTERFACE - - namelen = LEN(dset_name) - errcode = h5ltmake_dataset_fl6_c(loc_id,namelen,dset_name,rank,dims,type_id,buf) - - END SUBROUTINE h5ltmake_dataset_f_float6 - - !------------------------------------------------------------------------- - ! Function: h5ltmake_dataset_f_float7 - ! - ! Purpose: Creates and writes a dataset of a type TYPE_ID - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: M. Scot Breitenfeld - ! - ! Date: March 7, 2011 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - - SUBROUTINE h5ltmake_dataset_f_float7(loc_id, dset_name, rank, dims,& - type_id, buf, errcode ) - - IMPLICIT NONE - - ! - !This definition is needed for Windows DLLs - !DEC$if defined(BUILD_HDF5_HL_DLL) - !DEC$attributes dllexport :: h5ltmake_dataset_f_float7 - !DEC$endif - ! - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: rank ! rank - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - REAL, INTENT(in), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)) :: buf ! data buffer - - INTERFACE - INTEGER FUNCTION h5ltmake_dataset_fl7_c(loc_id,namelen,dset_name,rank,dims,type_id,buf) - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LTMAKE_DATASET_FL7_C'::h5ltmake_dataset_fl7_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER(size_t) :: namelen ! length of name buffer - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: rank ! rank - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - REAL, INTENT(in), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)) :: buf ! data buffer - END FUNCTION h5ltmake_dataset_fl7_c - END INTERFACE - - namelen = LEN(dset_name) - errcode = h5ltmake_dataset_fl7_c(loc_id,namelen,dset_name,rank,dims,type_id,buf) - - END SUBROUTINE h5ltmake_dataset_f_float7 - - !------------------------------------------------------------------------- - ! Function: h5ltmake_dataset_f_double1 - ! - ! Purpose: Creates and writes a dataset of a type TYPE_ID - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: pvn@ncsa.uiuc.edu - ! - ! Date: September 1, 2004 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - - SUBROUTINE h5ltmake_dataset_f_double1(loc_id,& - dset_name,& - rank,& - dims,& - type_id,& - buf,& - errcode ) - - IMPLICIT NONE - - ! - !This definition is needed for Windows DLLs - !DEC$if defined(BUILD_HDF5_HL_DLL) - !DEC$attributes dllexport :: h5ltmake_dataset_f_double1 - !DEC$endif - ! - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: rank ! rank - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - DOUBLE PRECISION, INTENT(in), DIMENSION(*) :: buf ! data buffer - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - - INTERFACE - INTEGER FUNCTION h5ltmake_dataset_dl1_c(loc_id,namelen,dset_name,rank,dims,type_id,buf) - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LTMAKE_DATASET_DL1_C'::h5ltmake_dataset_dl1_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER(size_t) :: namelen ! length of name buffer - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: rank ! rank - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - DOUBLE PRECISION, INTENT(in), DIMENSION(*) :: buf ! data buffer - END FUNCTION h5ltmake_dataset_dl1_c - END INTERFACE - - namelen = LEN(dset_name) - errcode = h5ltmake_dataset_dl1_c(loc_id,namelen,dset_name,rank,dims,type_id,buf) - - END SUBROUTINE h5ltmake_dataset_f_double1 - - !------------------------------------------------------------------------- - ! Function: h5ltmake_dataset_f_double2 - ! - ! Purpose: Creates and writes a dataset of a type TYPE_ID - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: pvn@ncsa.uiuc.edu - ! - ! Date: September 1, 2004 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - - SUBROUTINE h5ltmake_dataset_f_double2(loc_id,& - dset_name,& - rank,& - dims,& - type_id,& - buf,& - errcode ) - - IMPLICIT NONE - - ! - !This definition is needed for Windows DLLs - !DEC$if defined(BUILD_HDF5_HL_DLL) - !DEC$attributes dllexport :: h5ltmake_dataset_f_double2 - !DEC$endif - ! - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: rank ! rank - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - DOUBLE PRECISION, INTENT(in), & - DIMENSION(dims(1),dims(2)) :: buf ! data buffer - - INTERFACE - INTEGER FUNCTION h5ltmake_dataset_dl2_c(loc_id,namelen,dset_name,rank,dims,type_id,buf) - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LTMAKE_DATASET_DL2_C'::h5ltmake_dataset_dl2_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER(size_t) :: namelen ! length of name buffer - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: rank ! rank - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - DOUBLE PRECISION, INTENT(in), & - DIMENSION(dims(1),dims(2)) :: buf ! data buffer - END FUNCTION h5ltmake_dataset_dl2_c - END INTERFACE - - namelen = LEN(dset_name) - errcode = h5ltmake_dataset_dl2_c(loc_id,namelen,dset_name,rank,dims,type_id,buf) - - END SUBROUTINE h5ltmake_dataset_f_double2 - - !------------------------------------------------------------------------- - ! Function: h5ltmake_dataset_f_double3 - ! - ! Purpose: Creates and writes a dataset of a type TYPE_ID - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: pvn@ncsa.uiuc.edu - ! - ! Date: September 1, 2004 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - - SUBROUTINE h5ltmake_dataset_f_double3(loc_id,& - dset_name,& - rank,& - dims,& - type_id,& - buf,& - errcode ) - - IMPLICIT NONE - - ! - !This definition is needed for Windows DLLs - !DEC$if defined(BUILD_HDF5_HL_DLL) - !DEC$attributes dllexport :: h5ltmake_dataset_f_double3 - !DEC$endif - ! - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: rank ! rank - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - DOUBLE PRECISION, INTENT(in), & - DIMENSION(dims(1),dims(2),dims(3)) :: buf ! data buffer - - INTERFACE - INTEGER FUNCTION h5ltmake_dataset_dl3_c(loc_id,namelen,dset_name,rank,dims,type_id,buf) - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LTMAKE_DATASET_DL3_C'::h5ltmake_dataset_dl3_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER(size_t) :: namelen ! length of name buffer - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: rank ! rank - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - DOUBLE PRECISION, INTENT(in), & - DIMENSION(dims(1),dims(2),dims(3)) :: buf ! data buffer - END FUNCTION h5ltmake_dataset_dl3_c - END INTERFACE - - namelen = LEN(dset_name) - errcode = h5ltmake_dataset_dl3_c(loc_id,namelen,dset_name,rank,dims,type_id,buf) - - END SUBROUTINE h5ltmake_dataset_f_double3 - - !------------------------------------------------------------------------- - ! Function: h5ltmake_dataset_f_double4 - ! - ! Purpose: Creates and writes a dataset of a type TYPE_ID - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: M. Scot Breitenfeld - ! - ! Date: March 7, 2011 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - - SUBROUTINE h5ltmake_dataset_f_double4(loc_id, dset_name, rank, dims, & - type_id, buf, errcode ) - - IMPLICIT NONE - - ! - !This definition is needed for Windows DLLs - !DEC$if defined(BUILD_HDF5_HL_DLL) - !DEC$attributes dllexport :: h5ltmake_dataset_f_double4 - !DEC$endif - ! - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: rank ! rank - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - DOUBLE PRECISION, INTENT(in), & - DIMENSION(dims(1),dims(2),dims(3), dims(4)) :: buf ! data buffer - - INTERFACE - INTEGER FUNCTION h5ltmake_dataset_dl4_c(loc_id,namelen,dset_name,rank,dims,type_id,buf) - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LTMAKE_DATASET_DL4_C'::h5ltmake_dataset_dl4_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER(size_t) :: namelen ! length of name buffer - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: rank ! rank - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - DOUBLE PRECISION, INTENT(in), & - DIMENSION(dims(1),dims(2),dims(3),dims(4)) :: buf ! data buffer - END FUNCTION h5ltmake_dataset_dl4_c - END INTERFACE - - namelen = LEN(dset_name) - errcode = h5ltmake_dataset_dl4_c(loc_id,namelen,dset_name,rank,dims,type_id,buf) - - END SUBROUTINE h5ltmake_dataset_f_double4 - - !------------------------------------------------------------------------- - ! Function: h5ltmake_dataset_f_double5 - ! - ! Purpose: Creates and writes a dataset of a type TYPE_ID - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: M. Scot Breitenfeld - ! - ! Date: March 7, 2011 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - - SUBROUTINE h5ltmake_dataset_f_double5(loc_id, dset_name, rank, dims, & - type_id, buf, errcode ) - - IMPLICIT NONE - - ! - !This definition is needed for Windows DLLs - !DEC$if defined(BUILD_HDF5_HL_DLL) - !DEC$attributes dllexport :: h5ltmake_dataset_f_double5 - !DEC$endif - ! - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: rank ! rank - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - DOUBLE PRECISION, INTENT(in), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) :: buf ! data buffer - - INTERFACE - INTEGER FUNCTION h5ltmake_dataset_dl5_c(loc_id,namelen,dset_name,rank,dims,type_id,buf) - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LTMAKE_DATASET_DL5_C'::h5ltmake_dataset_dl5_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER(size_t) :: namelen ! length of name buffer - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: rank ! rank - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - DOUBLE PRECISION, INTENT(in), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) :: buf ! data buffer - END FUNCTION h5ltmake_dataset_dl5_c - END INTERFACE - - namelen = LEN(dset_name) - errcode = h5ltmake_dataset_dl5_c(loc_id,namelen,dset_name,rank,dims,type_id,buf) - - END SUBROUTINE h5ltmake_dataset_f_double5 - - !------------------------------------------------------------------------- - ! Function: h5ltmake_dataset_f_double6 - ! - ! Purpose: Creates and writes a dataset of a type TYPE_ID - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: M. Scot Breitenfeld - ! - ! Date: March 7, 2011 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - - SUBROUTINE h5ltmake_dataset_f_double6(loc_id, dset_name, rank, dims, & - type_id, buf, errcode ) - - IMPLICIT NONE - - ! - !This definition is needed for Windows DLLs - !DEC$if defined(BUILD_HDF5_HL_DLL) - !DEC$attributes dllexport :: h5ltmake_dataset_f_double6 - !DEC$endif - ! - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: rank ! rank - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - DOUBLE PRECISION, INTENT(in), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)) :: buf ! data buffer - - INTERFACE - INTEGER FUNCTION h5ltmake_dataset_dl6_c(loc_id,namelen,dset_name,rank,dims,type_id,buf) - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LTMAKE_DATASET_DL6_C'::h5ltmake_dataset_dl6_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER(size_t) :: namelen ! length of name buffer - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: rank ! rank - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - DOUBLE PRECISION, INTENT(in), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)) :: buf ! data buffer - END FUNCTION h5ltmake_dataset_dl6_c - END INTERFACE - - namelen = LEN(dset_name) - errcode = h5ltmake_dataset_dl6_c(loc_id,namelen,dset_name,rank,dims,type_id,buf) - - END SUBROUTINE h5ltmake_dataset_f_double6 - - !------------------------------------------------------------------------- - ! Function: h5ltmake_dataset_f_double7 - ! - ! Purpose: Creates and writes a dataset of a type TYPE_ID - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: M. Scot Breitenfeld - ! - ! Date: March 7, 2011 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - - SUBROUTINE h5ltmake_dataset_f_double7(loc_id, dset_name, rank, dims, & - type_id, buf, errcode ) - - IMPLICIT NONE - - ! - !This definition is needed for Windows DLLs - !DEC$if defined(BUILD_HDF5_HL_DLL) - !DEC$attributes dllexport :: h5ltmake_dataset_f_double7 - !DEC$endif - ! - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: rank ! rank - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - DOUBLE PRECISION, INTENT(in), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)) :: buf ! data buffer - - INTERFACE - INTEGER FUNCTION h5ltmake_dataset_dl7_c(loc_id,namelen,dset_name,rank,dims,type_id,buf) - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LTMAKE_DATASET_DL7_C'::h5ltmake_dataset_dl7_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER(size_t) :: namelen ! length of name buffer - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: rank ! rank - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - DOUBLE PRECISION, INTENT(in), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)) :: buf ! data buffer - END FUNCTION h5ltmake_dataset_dl7_c - END INTERFACE - - namelen = LEN(dset_name) - errcode = h5ltmake_dataset_dl7_c(loc_id,namelen,dset_name,rank,dims,type_id,buf) - - END SUBROUTINE h5ltmake_dataset_f_double7 - - !------------------------------------------------------------------------- - ! Function: h5ltread_dataset_f_int1 - ! - ! Purpose: Read a dataset of a type TYPE_ID - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: pvn@ncsa.uiuc.edu - ! - ! Date: September 22, 2004 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - - SUBROUTINE h5ltread_dataset_f_int1(loc_id,& - dset_name,& - type_id,& - buf,& - dims,& - errcode ) - - IMPLICIT NONE - - ! - !This definition is needed for Windows DLLs - !DEC$if defined(BUILD_HDF5_HL_DLL) - !DEC$attributes dllexport :: h5ltread_dataset_f_int1 - !DEC$endif - ! - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER, INTENT(inout), DIMENSION(*) :: buf ! data buffer - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - - INTERFACE - INTEGER FUNCTION h5ltread_dataset_int1_c(loc_id,namelen,dset_name,type_id,buf,dims) - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LTREAD_DATASET_INT1_C'::h5ltread_dataset_int1_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - INTEGER(HID_T), INTENT(IN) :: loc_id ! file or group identifier - INTEGER(HID_T), INTENT(IN) :: type_id ! datatype identifier - INTEGER(size_t) :: namelen ! length of name buffer - CHARACTER(LEN=*), INTENT(IN) :: dset_name ! name of the dataset - INTEGER(HSIZE_T), DIMENSION(*), INTENT(IN) :: dims ! size of the buffer buf - INTEGER, INTENT(IN), DIMENSION(*) :: buf ! data buffer - END FUNCTION h5ltread_dataset_int1_c - END INTERFACE - - namelen = LEN(dset_name) - errcode = h5ltread_dataset_int1_c(loc_id,namelen,dset_name,type_id,buf,dims) - - END SUBROUTINE h5ltread_dataset_f_int1 - - !------------------------------------------------------------------------- - ! Function: h5ltread_dataset_f_int2 - ! - ! Purpose: Read a dataset of a type TYPE_ID - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: pvn@ncsa.uiuc.edu - ! - ! Date: September 22, 2004 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - - SUBROUTINE h5ltread_dataset_f_int2(loc_id,& - dset_name,& - type_id,& - buf,& - dims,& - errcode ) - - IMPLICIT NONE - - ! - !This definition is needed for Windows DLLs - !DEC$if defined(BUILD_HDF5_HL_DLL) - !DEC$attributes dllexport :: h5ltread_dataset_f_int2 - !DEC$endif - ! - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - INTEGER, INTENT(inout), & - DIMENSION(dims(1),dims(2)) :: buf ! data buffer - - INTERFACE - INTEGER FUNCTION h5ltread_dataset_int2_c(loc_id,namelen,dset_name,type_id,buf,dims) - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LTREAD_DATASET_INT2_C'::h5ltread_dataset_int2_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER(size_t) :: namelen ! length of name buffer - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER, INTENT(in), & - DIMENSION(dims(1),dims(2)) :: buf ! data buffer - END FUNCTION h5ltread_dataset_int2_c - END INTERFACE - - namelen = LEN(dset_name) - errcode = h5ltread_dataset_int2_c(loc_id,namelen,dset_name,type_id,buf,dims) - - END SUBROUTINE h5ltread_dataset_f_int2 - - !------------------------------------------------------------------------- - ! Function: h5ltread_dataset_f_int3 - ! - ! Purpose: Read a dataset of a type TYPE_ID - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: pvn@ncsa.uiuc.edu - ! - ! Date: September 22, 2004 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - - SUBROUTINE h5ltread_dataset_f_int3(loc_id,& - dset_name,& - type_id,& - buf,& - dims,& - errcode ) - - IMPLICIT NONE - - ! - !This definition is needed for Windows DLLs - !DEC$if defined(BUILD_HDF5_HL_DLL) - !DEC$attributes dllexport :: h5ltread_dataset_f_int3 - !DEC$endif - ! - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - INTEGER, INTENT(inout), & - DIMENSION(dims(1),dims(2),dims(3)) :: buf ! data buffer - - INTERFACE - INTEGER FUNCTION h5ltread_dataset_int3_c(loc_id,namelen,dset_name,type_id,buf,dims) - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LTREAD_DATASET_INT3_C'::h5ltread_dataset_int3_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER(size_t) :: namelen ! length of name buffer - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER, INTENT(in), & - DIMENSION(dims(1),dims(2),dims(3)) :: buf ! data buffer - END FUNCTION h5ltread_dataset_int3_c - END INTERFACE - - namelen = LEN(dset_name) - errcode = h5ltread_dataset_int3_c(loc_id,namelen,dset_name,type_id,buf,dims) - - END SUBROUTINE h5ltread_dataset_f_int3 - - !------------------------------------------------------------------------- - ! Function: h5ltread_dataset_f_int4 - ! - ! Purpose: Read a dataset of a type TYPE_ID - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: M. Scot Breitenfeld - ! - ! Date: March 12, 2011 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - - SUBROUTINE h5ltread_dataset_f_int4(loc_id, dset_name, type_id, buf, & - dims, errcode ) - - IMPLICIT NONE - - ! - !This definition is needed for Windows DLLs - !DEC$if defined(BUILD_HDF5_HL_DLL) - !DEC$attributes dllexport :: h5ltread_dataset_f_int4 - !DEC$endif - ! - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - INTEGER, INTENT(inout), & - DIMENSION(dims(1),dims(2),dims(3),dims(4)) :: buf ! data buffer - - INTERFACE - INTEGER FUNCTION h5ltread_dataset_int4_c(loc_id,namelen,dset_name,type_id,buf,dims) - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LTREAD_DATASET_INT4_C'::h5ltread_dataset_int4_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER(size_t) :: namelen ! length of name buffer - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER, INTENT(in), & - DIMENSION(dims(1),dims(2),dims(3),dims(4)) :: buf ! data buffer - END FUNCTION h5ltread_dataset_int4_c - END INTERFACE - - namelen = LEN(dset_name) - errcode = h5ltread_dataset_int4_c(loc_id,namelen,dset_name,type_id,buf,dims) - - END SUBROUTINE h5ltread_dataset_f_int4 - - !------------------------------------------------------------------------- - ! Function: h5ltread_dataset_f_int5 - ! - ! Purpose: Read a dataset of a type TYPE_ID - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: M. Scot Breitenfeld - ! - ! Date: March 12, 2011 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - - SUBROUTINE h5ltread_dataset_f_int5(loc_id, dset_name, type_id, buf, & - dims, errcode ) - - IMPLICIT NONE - - ! - !This definition is needed for Windows DLLs - !DEC$if defined(BUILD_HDF5_HL_DLL) - !DEC$attributes dllexport :: h5ltread_dataset_f_int5 - !DEC$endif - ! - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - INTEGER, INTENT(inout), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) :: buf ! data buffer - - INTERFACE - INTEGER FUNCTION h5ltread_dataset_int5_c(loc_id,namelen,dset_name,type_id,buf,dims) - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LTREAD_DATASET_INT5_C'::h5ltread_dataset_int5_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER(size_t) :: namelen ! length of name buffer - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER, INTENT(in), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) :: buf ! data buffer - END FUNCTION h5ltread_dataset_int5_c - END INTERFACE - - namelen = LEN(dset_name) - errcode = h5ltread_dataset_int5_c(loc_id,namelen,dset_name,type_id,buf,dims) - - END SUBROUTINE h5ltread_dataset_f_int5 - - !------------------------------------------------------------------------- - ! Function: h5ltread_dataset_f_int6 - ! - ! Purpose: Read a dataset of a type TYPE_ID - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: M. Scot Breitenfeld - ! - ! Date: March 12, 2011 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - - SUBROUTINE h5ltread_dataset_f_int6(loc_id, dset_name, type_id, buf, & - dims, errcode ) - - IMPLICIT NONE - - ! - !This definition is needed for Windows DLLs - !DEC$if defined(BUILD_HDF5_HL_DLL) - !DEC$attributes dllexport :: h5ltread_dataset_f_int6 - !DEC$endif - ! - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - INTEGER, INTENT(inout), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)) :: buf ! data buffer - - INTERFACE - INTEGER FUNCTION h5ltread_dataset_int6_c(loc_id,namelen,dset_name,type_id,buf,dims) - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LTREAD_DATASET_INT6_C'::h5ltread_dataset_int6_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER(size_t) :: namelen ! length of name buffer - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER, INTENT(in), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)) :: buf ! data buffer - END FUNCTION h5ltread_dataset_int6_c - END INTERFACE - - namelen = LEN(dset_name) - errcode = h5ltread_dataset_int6_c(loc_id,namelen,dset_name,type_id,buf,dims) - - END SUBROUTINE h5ltread_dataset_f_int6 - - !------------------------------------------------------------------------- - ! Function: h5ltread_dataset_f_int7 - ! - ! Purpose: Read a dataset of a type TYPE_ID - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: M. Scot Breitenfeld - ! - ! Date: March 12, 2011 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - - SUBROUTINE h5ltread_dataset_f_int7(loc_id, dset_name, type_id, buf, & - dims, errcode ) - - IMPLICIT NONE - - ! - !This definition is needed for Windows DLLs - !DEC$if defined(BUILD_HDF5_HL_DLL) - !DEC$attributes dllexport :: h5ltread_dataset_f_int7 - !DEC$endif - ! - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - INTEGER, INTENT(inout), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)) :: buf ! data buffer - - INTERFACE - INTEGER FUNCTION h5ltread_dataset_int7_c(loc_id,namelen,dset_name,type_id,buf,dims) - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LTREAD_DATASET_INT7_C'::h5ltread_dataset_int7_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER(size_t) :: namelen ! length of name buffer - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER, INTENT(in), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)) :: buf ! data buffer - END FUNCTION h5ltread_dataset_int7_c - END INTERFACE - - namelen = LEN(dset_name) - errcode = h5ltread_dataset_int7_c(loc_id,namelen,dset_name,type_id,buf,dims) - - END SUBROUTINE h5ltread_dataset_f_int7 - - - !------------------------------------------------------------------------- - ! Function: h5ltread_dataset_f_float1 - ! - ! Purpose: Read a dataset of a type TYPE_ID - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: pvn@ncsa.uiuc.edu - ! - ! Date: September 22, 2004 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - - SUBROUTINE h5ltread_dataset_f_float1(loc_id,& - dset_name,& - type_id,& - buf,& - dims,& - errcode ) - - IMPLICIT NONE - - ! - !This definition is needed for Windows DLLs - !DEC$if defined(BUILD_HDF5_HL_DLL) - !DEC$attributes dllexport :: h5ltread_dataset_f_float1 - !DEC$endif - ! - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - REAL, INTENT(inout), DIMENSION(*) :: buf ! data buffer - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - - INTERFACE - INTEGER FUNCTION h5ltread_dataset_fl1_c(loc_id,namelen,dset_name,type_id,buf,dims) - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LTREAD_DATASET_FL1_C'::h5ltread_dataset_fl1_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER(size_t) :: namelen ! length of name buffer - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - REAL, INTENT(in), DIMENSION(*) :: buf ! data buffer - END FUNCTION h5ltread_dataset_fl1_c - END INTERFACE - - namelen = LEN(dset_name) - errcode = h5ltread_dataset_fl1_c(loc_id,namelen,dset_name,type_id,buf,dims) - - END SUBROUTINE h5ltread_dataset_f_float1 - - !------------------------------------------------------------------------- - ! Function: h5ltread_dataset_f_float2 - ! - ! Purpose: Read a dataset of a type TYPE_ID - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: pvn@ncsa.uiuc.edu - ! - ! Date: September 22, 2004 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - - SUBROUTINE h5ltread_dataset_f_float2(loc_id,& - dset_name,& - type_id,& - buf,& - dims,& - errcode ) - - IMPLICIT NONE - - ! - !This definition is needed for Windows DLLs - !DEC$if defined(BUILD_HDF5_HL_DLL) - !DEC$attributes dllexport :: h5ltread_dataset_f_float2 - !DEC$endif - ! - - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - REAL, INTENT(inout), & - DIMENSION(dims(1),dims(2)) :: buf ! data buffer - - INTERFACE - INTEGER FUNCTION h5ltread_dataset_fl2_c(loc_id,namelen,dset_name,type_id,buf,dims) - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LTREAD_DATASET_FL2_C'::h5ltread_dataset_fl2_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER(size_t) :: namelen ! length of name buffer - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - REAL, INTENT(in), & - DIMENSION(dims(1),dims(2)) :: buf ! data buffer - END FUNCTION h5ltread_dataset_fl2_c - END INTERFACE - - namelen = LEN(dset_name) - errcode = h5ltread_dataset_fl2_c(loc_id,namelen,dset_name,type_id,buf,dims) - - END SUBROUTINE h5ltread_dataset_f_float2 - - !------------------------------------------------------------------------- - ! Function: h5ltread_dataset_f_float3 - ! - ! Purpose: Read a dataset of a type TYPE_ID - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: pvn@ncsa.uiuc.edu - ! - ! Date: September 22, 2004 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - - SUBROUTINE h5ltread_dataset_f_float3(loc_id,& - dset_name,& - type_id,& - buf,& - dims,& - errcode ) - - IMPLICIT NONE - - ! - !This definition is needed for Windows DLLs - !DEC$if defined(BUILD_HDF5_HL_DLL) - !DEC$attributes dllexport :: h5ltread_dataset_f_float3 - !DEC$endif - ! - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - REAL, INTENT(inout), & - DIMENSION(dims(1),dims(2),dims(3)) :: buf ! data buffer - - INTERFACE - INTEGER FUNCTION h5ltread_dataset_fl3_c(loc_id,namelen,dset_name,type_id,buf,dims) - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LTREAD_DATASET_FL3_C'::h5ltread_dataset_fl3_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER(size_t) :: namelen ! length of name buffer - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - REAL, INTENT(in), & - DIMENSION(dims(1),dims(2),dims(3)) :: buf ! data buffer - END FUNCTION h5ltread_dataset_fl3_c - END INTERFACE - - namelen = LEN(dset_name) - errcode = h5ltread_dataset_fl3_c(loc_id,namelen,dset_name,type_id,buf,dims) - - END SUBROUTINE h5ltread_dataset_f_float3 - - !------------------------------------------------------------------------- - ! Function: h5ltread_dataset_f_float4 - ! - ! Purpose: Read a dataset of a type TYPE_ID - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: M. Scot Breitenfeld - ! - ! Date: March 8, 2011 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - - SUBROUTINE h5ltread_dataset_f_float4(loc_id, dset_name, type_id, buf, & - dims, errcode ) - - IMPLICIT NONE - - ! - !This definition is needed for Windows DLLs - !DEC$if defined(BUILD_HDF5_HL_DLL) - !DEC$attributes dllexport :: h5ltread_dataset_f_float4 - !DEC$endif - ! - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - REAL, INTENT(inout), & - DIMENSION(dims(1),dims(2),dims(3),dims(4)) :: buf ! data buffer - - INTERFACE - INTEGER FUNCTION h5ltread_dataset_fl4_c(loc_id,namelen,dset_name,type_id,buf,dims) - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LTREAD_DATASET_FL4_C'::h5ltread_dataset_fl4_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER(size_t) :: namelen ! length of name buffer - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - REAL, INTENT(in), & - DIMENSION(dims(1),dims(2),dims(3),dims(4)) :: buf ! data buffer - END FUNCTION h5ltread_dataset_fl4_c - END INTERFACE - - namelen = LEN(dset_name) - errcode = h5ltread_dataset_fl4_c(loc_id,namelen,dset_name,type_id,buf,dims) - - END SUBROUTINE h5ltread_dataset_f_float4 - - !------------------------------------------------------------------------- - ! Function: h5ltread_dataset_f_float5 - ! - ! Purpose: Read a dataset of a type TYPE_ID - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: M. Scot Breitenfeld - ! - ! Date: March 8, 2011 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - - SUBROUTINE h5ltread_dataset_f_float5(loc_id, dset_name, type_id, buf, & - dims, errcode ) - - IMPLICIT NONE - - ! - !This definition is needed for Windows DLLs - !DEC$if defined(BUILD_HDF5_HL_DLL) - !DEC$attributes dllexport :: h5ltread_dataset_f_float5 - !DEC$endif - ! - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - REAL, INTENT(inout), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) :: buf ! data buffer - - INTERFACE - INTEGER FUNCTION h5ltread_dataset_fl5_c(loc_id,namelen,dset_name,type_id,buf,dims) - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LTREAD_DATASET_FL5_C'::h5ltread_dataset_fl5_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER(size_t) :: namelen ! length of name buffer - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - REAL, INTENT(in), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) :: buf ! data buffer - END FUNCTION h5ltread_dataset_fl5_c - END INTERFACE - - namelen = LEN(dset_name) - errcode = h5ltread_dataset_fl5_c(loc_id,namelen,dset_name,type_id,buf,dims) - - END SUBROUTINE h5ltread_dataset_f_float5 - - !------------------------------------------------------------------------- - ! Function: h5ltread_dataset_f_float6 - ! - ! Purpose: Read a dataset of a type TYPE_ID - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: M. Scot Breitenfeld - ! - ! Date: March 8, 2011 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - - SUBROUTINE h5ltread_dataset_f_float6(loc_id, dset_name, type_id, buf, & - dims, errcode ) - - IMPLICIT NONE - - ! - !This definition is needed for Windows DLLs - !DEC$if defined(BUILD_HDF5_HL_DLL) - !DEC$attributes dllexport :: h5ltread_dataset_f_float6 - !DEC$endif - ! - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - REAL, INTENT(inout), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)) :: buf ! data buffer - - INTERFACE - INTEGER FUNCTION h5ltread_dataset_fl6_c(loc_id,namelen,dset_name,type_id,buf,dims) - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LTREAD_DATASET_FL6_C'::h5ltread_dataset_fl6_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER(size_t) :: namelen ! length of name buffer - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - REAL, INTENT(in), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)) :: buf ! data buffer - END FUNCTION h5ltread_dataset_fl6_c - END INTERFACE - - namelen = LEN(dset_name) - errcode = h5ltread_dataset_fl6_c(loc_id,namelen,dset_name,type_id,buf,dims) - - END SUBROUTINE h5ltread_dataset_f_float6 - - !------------------------------------------------------------------------- - ! Function: h5ltread_dataset_f_float7 - ! - ! Purpose: Read a dataset of a type TYPE_ID - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: M. Scot Breitenfeld - ! - ! Date: March 8, 2011 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - - SUBROUTINE h5ltread_dataset_f_float7(loc_id, dset_name, type_id, buf, & - dims, errcode ) - - IMPLICIT NONE - - ! - !This definition is needed for Windows DLLs - !DEC$if defined(BUILD_HDF5_HL_DLL) - !DEC$attributes dllexport :: h5ltread_dataset_f_float7 - !DEC$endif - ! - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - REAL, INTENT(inout), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)) :: buf ! data buffer - - INTERFACE - INTEGER FUNCTION h5ltread_dataset_fl7_c(loc_id,namelen,dset_name,type_id,buf,dims) - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LTREAD_DATASET_FL7_C'::h5ltread_dataset_fl7_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER(size_t) :: namelen ! length of name buffer - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - REAL, INTENT(in), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)) :: buf ! data buffer - END FUNCTION h5ltread_dataset_fl7_c - END INTERFACE - - namelen = LEN(dset_name) - errcode = h5ltread_dataset_fl7_c(loc_id,namelen,dset_name,type_id,buf,dims) - - END SUBROUTINE h5ltread_dataset_f_float7 - - - !------------------------------------------------------------------------- - ! Function: h5ltread_dataset_f_double1 - ! - ! Purpose: Read a dataset of a type TYPE_ID - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: pvn@ncsa.uiuc.edu - ! - ! Date: September 22, 2004 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - - SUBROUTINE h5ltread_dataset_f_double1(loc_id,& - dset_name,& - type_id,& - buf,& - dims,& - errcode ) - - IMPLICIT NONE - - ! - !This definition is needed for Windows DLLs - !DEC$if defined(BUILD_HDF5_HL_DLL) - !DEC$attributes dllexport ::h5ltread_dataset_f_double1 - !DEC$endif - ! - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - DOUBLE PRECISION, INTENT(inout), DIMENSION(*) :: buf ! data buffer - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - - INTERFACE - INTEGER FUNCTION h5ltread_dataset_dl1_c(loc_id,namelen,dset_name,type_id,buf,dims) - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LTREAD_DATASET_DL1_C'::h5ltread_dataset_dl1_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER(size_t) :: namelen ! length of name buffer - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - DOUBLE PRECISION, INTENT(in), DIMENSION(*) :: buf ! data buffer - END FUNCTION h5ltread_dataset_dl1_c - END INTERFACE - - namelen = LEN(dset_name) - errcode = h5ltread_dataset_dl1_c(loc_id,namelen,dset_name,type_id,buf,dims) - - END SUBROUTINE h5ltread_dataset_f_double1 - - !------------------------------------------------------------------------- - ! Function: h5ltread_dataset_f_double2 - ! - ! Purpose: Read a dataset of a type TYPE_ID - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: pvn@ncsa.uiuc.edu - ! - ! Date: September 22, 2004 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - - SUBROUTINE h5ltread_dataset_f_double2(loc_id,& - dset_name,& - type_id,& - buf,& - dims,& - errcode ) - - IMPLICIT NONE - - ! - !This definition is needed for Windows DLLs - !DEC$if defined(BUILD_HDF5_HL_DLL) - !DEC$attributes dllexport :: h5ltread_dataset_f_double2 - !DEC$endif - ! - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - DOUBLE PRECISION, INTENT(inout), & - DIMENSION(dims(1),dims(2)) :: buf ! data buffer - - INTERFACE - INTEGER FUNCTION h5ltread_dataset_dl2_c(loc_id,namelen,dset_name,type_id,buf,dims) - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LTREAD_DATASET_DL2_C'::h5ltread_dataset_dl2_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER(size_t) :: namelen ! length of name buffer - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - DOUBLE PRECISION, INTENT(in), & - DIMENSION(dims(1),dims(2)) :: buf ! data buffer - END FUNCTION h5ltread_dataset_dl2_c - END INTERFACE - - namelen = LEN(dset_name) - errcode = h5ltread_dataset_dl2_c(loc_id,namelen,dset_name,type_id,buf,dims) - - END SUBROUTINE h5ltread_dataset_f_double2 - - !------------------------------------------------------------------------- - ! Function: h5ltread_dataset_f_double3 - ! - ! Purpose: Read a dataset of a type TYPE_ID - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: pvn@ncsa.uiuc.edu - ! - ! Date: September 22, 2004 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - - SUBROUTINE h5ltread_dataset_f_double3(loc_id,& - dset_name,& - type_id,& - buf,& - dims,& - errcode ) - - IMPLICIT NONE - - ! - !This definition is needed for Windows DLLs - !DEC$if defined(BUILD_HDF5_HL_DLL) - !DEC$attributes dllexport :: h5ltread_dataset_f_double3 - !DEC$endif - ! - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - DOUBLE PRECISION, INTENT(inout), & - DIMENSION(dims(1),dims(2),dims(3)) :: buf ! data buffer - - INTERFACE - INTEGER FUNCTION h5ltread_dataset_dl3_c(loc_id,namelen,dset_name,type_id,buf,dims) - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LTREAD_DATASET_DL3_C'::h5ltread_dataset_dl3_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER(size_t) :: namelen ! length of name buffer - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - DOUBLE PRECISION, INTENT(in), & - DIMENSION(dims(1),dims(2),dims(3)) :: buf ! data buffer - END FUNCTION h5ltread_dataset_dl3_c - END INTERFACE - - namelen = LEN(dset_name) - errcode = h5ltread_dataset_dl3_c(loc_id,namelen,dset_name,type_id,buf,dims) - - END SUBROUTINE h5ltread_dataset_f_double3 - - !------------------------------------------------------------------------- - ! Function: h5ltread_dataset_f_double4 - ! - ! Purpose: Read a dataset of a type TYPE_ID - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: M. Scot Breitenfeld - ! - ! Date: March 8, 2011 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - - SUBROUTINE h5ltread_dataset_f_double4(loc_id, dset_name, type_id, buf, & - dims, errcode ) - - IMPLICIT NONE - - ! - !This definition is needed for Windows DLLs - !DEC$if defined(BUILD_HDF5_HL_DLL) - !DEC$attributes dllexport :: h5ltread_dataset_f_double4 - !DEC$endif - ! - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - DOUBLE PRECISION, INTENT(inout), & - DIMENSION(dims(1),dims(2),dims(3),dims(4)) :: buf ! data buffer - - INTERFACE - INTEGER FUNCTION h5ltread_dataset_dl4_c(loc_id,namelen,dset_name,type_id,buf,dims) - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LTREAD_DATASET_DL4_C'::h5ltread_dataset_dl4_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER(size_t) :: namelen ! length of name buffer - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - DOUBLE PRECISION, INTENT(in), & - DIMENSION(dims(1),dims(2),dims(3),dims(4)) :: buf ! data buffer - END FUNCTION h5ltread_dataset_dl4_c - END INTERFACE - - namelen = LEN(dset_name) - errcode = h5ltread_dataset_dl4_c(loc_id,namelen,dset_name,type_id,buf,dims) - - END SUBROUTINE h5ltread_dataset_f_double4 - - !------------------------------------------------------------------------- - ! Function: h5ltread_dataset_f_double5 - ! - ! Purpose: Read a dataset of a type TYPE_ID - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: M. Scot Breitenfeld - ! - ! Date: March 8, 2011 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - - SUBROUTINE h5ltread_dataset_f_double5(loc_id, dset_name, type_id, buf, & - dims, errcode ) - - IMPLICIT NONE - - ! - !This definition is needed for Windows DLLs - !DEC$if defined(BUILD_HDF5_HL_DLL) - !DEC$attributes dllexport :: h5ltread_dataset_f_double5 - !DEC$endif - ! - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - DOUBLE PRECISION, INTENT(inout), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) :: buf ! data buffer - - INTERFACE - INTEGER FUNCTION h5ltread_dataset_dl5_c(loc_id,namelen,dset_name,type_id,buf,dims) - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LTREAD_DATASET_DL5_C'::h5ltread_dataset_dl5_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER(size_t) :: namelen ! length of name buffer - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - DOUBLE PRECISION, INTENT(in), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) :: buf ! data buffer - END FUNCTION h5ltread_dataset_dl5_c - END INTERFACE - - namelen = LEN(dset_name) - errcode = h5ltread_dataset_dl5_c(loc_id,namelen,dset_name,type_id,buf,dims) - - END SUBROUTINE h5ltread_dataset_f_double5 - - !------------------------------------------------------------------------- - ! Function: h5ltread_dataset_f_double6 - ! - ! Purpose: Read a dataset of a type TYPE_ID - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: M. Scot Breitenfeld - ! - ! Date: March 8, 2011 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - - SUBROUTINE h5ltread_dataset_f_double6(loc_id, dset_name, type_id, buf, & - dims, errcode ) - - IMPLICIT NONE - - ! - !This definition is needed for Windows DLLs - !DEC$if defined(BUILD_HDF5_HL_DLL) - !DEC$attributes dllexport :: h5ltread_dataset_f_double6 - !DEC$endif - ! - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - DOUBLE PRECISION, INTENT(inout), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)) :: buf ! data buffer - - INTERFACE - INTEGER FUNCTION h5ltread_dataset_dl6_c(loc_id,namelen,dset_name,type_id,buf,dims) - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LTREAD_DATASET_DL6_C'::h5ltread_dataset_dl6_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER(size_t) :: namelen ! length of name buffer - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - DOUBLE PRECISION, INTENT(in), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)) :: buf ! data buffer - END FUNCTION h5ltread_dataset_dl6_c - END INTERFACE - - namelen = LEN(dset_name) - errcode = h5ltread_dataset_dl6_c(loc_id,namelen,dset_name,type_id,buf,dims) - - END SUBROUTINE h5ltread_dataset_f_double6 - - !------------------------------------------------------------------------- - ! Function: h5ltread_dataset_f_double7 - ! - ! Purpose: Read a dataset of a type TYPE_ID - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: M. Scot Breitenfeld - ! - ! Date: March 8, 2011 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - - SUBROUTINE h5ltread_dataset_f_double7(loc_id, dset_name, type_id, buf, & - dims, errcode ) - - IMPLICIT NONE - - ! - !This definition is needed for Windows DLLs - !DEC$if defined(BUILD_HDF5_HL_DLL) - !DEC$attributes dllexport :: h5ltread_dataset_f_double7 - !DEC$endif - ! - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - DOUBLE PRECISION, INTENT(inout), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)) :: buf ! data buffer - - INTERFACE - INTEGER FUNCTION h5ltread_dataset_dl7_c(loc_id,namelen,dset_name,type_id,buf,dims) - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LTREAD_DATASET_DL7_C'::h5ltread_dataset_dl7_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER(size_t) :: namelen ! length of name buffer - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - DOUBLE PRECISION, INTENT(in), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)) :: buf ! data buffer - END FUNCTION h5ltread_dataset_dl7_c - END INTERFACE - - namelen = LEN(dset_name) - errcode = h5ltread_dataset_dl7_c(loc_id,namelen,dset_name,type_id,buf,dims) - - END SUBROUTINE h5ltread_dataset_f_double7 - - !------------------------------------------------------------------------- - ! Function: h5ltmake_dataset_int_f_1 - ! - ! Purpose: Creates and writes a dataset of H5T_NATIVE_INT type - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: pvn@ncsa.uiuc.edu - ! - ! Date: September 22, 2004 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - - SUBROUTINE h5ltmake_dataset_int_f_1 (loc_id,& - dset_name,& - rank,& - dims,& - buf,& - errcode ) - - IMPLICIT NONE - - ! - !This definition is needed for Windows DLLs - !DEC$if defined(BUILD_HDF5_HL_DLL) - !DEC$attributes dllexport :: h5ltmake_dataset_int_f_1 - !DEC$endif - ! - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: rank ! rank - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER, INTENT(in), DIMENSION(*) :: buf ! data buffer - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - - INTERFACE - INTEGER FUNCTION h5ltmake_dataset_nint1_c(loc_id,namelen,dset_name,rank,dims,type_id,buf) - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LTMAKE_DATASET_NINT1_C'::h5ltmake_dataset_nint1_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER(size_t) :: namelen ! length of name buffer - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: rank ! rank - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER, INTENT(in), DIMENSION(*) :: buf ! data buffer - END FUNCTION h5ltmake_dataset_nint1_c - END INTERFACE - - namelen = LEN(dset_name) - errcode = h5ltmake_dataset_nint1_c(loc_id,namelen,dset_name,rank,dims,h5t_native_integer,buf) - - END SUBROUTINE h5ltmake_dataset_int_f_1 - - !------------------------------------------------------------------------- - ! Function: h5ltmake_dataset_int_f_2 - ! - ! Purpose: Creates and writes a dataset of H5T_NATIVE_INT type - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: pvn@ncsa.uiuc.edu - ! - ! Date: September 22, 2004 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - - SUBROUTINE h5ltmake_dataset_int_f_2 (loc_id,& - dset_name,& - rank,& - dims,& - buf,& - errcode ) - - IMPLICIT NONE - - ! - !This definition is needed for Windows DLLs - !DEC$if defined(BUILD_HDF5_HL_DLL) - !DEC$attributes dllexport :: h5ltmake_dataset_int_f_2 - !DEC$endif - ! - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: rank ! rank - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - INTEGER, INTENT(in), & - DIMENSION(dims(1),dims(2)) :: buf ! data buffer - - - INTERFACE - INTEGER FUNCTION h5ltmake_dataset_nint2_c(loc_id,namelen,dset_name,rank,dims,type_id,buf) - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LTMAKE_DATASET_NINT2_C'::h5ltmake_dataset_nint2_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER(size_t) :: namelen ! length of name buffer - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: rank ! rank - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER, INTENT(in), & - DIMENSION(dims(1),dims(2)) :: buf ! data buffer - END FUNCTION h5ltmake_dataset_nint2_c - END INTERFACE - - namelen = LEN(dset_name) - errcode = h5ltmake_dataset_nint2_c(loc_id,namelen,dset_name,rank,dims,H5T_NATIVE_INTEGER,buf) - - END SUBROUTINE h5ltmake_dataset_int_f_2 - - - !------------------------------------------------------------------------- - ! Function: h5ltmake_dataset_int_f_3 - ! - ! Purpose: Creates and writes a dataset of H5T_NATIVE_INT type - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: pvn@ncsa.uiuc.edu - ! - ! Date: September 22, 2004 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - - SUBROUTINE h5ltmake_dataset_int_f_3 (loc_id,& - dset_name,& - rank,& - dims,& - buf,& - errcode ) - - IMPLICIT NONE - - ! - !This definition is needed for Windows DLLs - !DEC$if defined(BUILD_HDF5_HL_DLL) - !DEC$attributes dllexport :: h5ltmake_dataset_int_f_3 - !DEC$endif - ! - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: rank ! rank - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - INTEGER, INTENT(in), & - DIMENSION(dims(1),dims(2),dims(3)) :: buf ! data buffer - - - INTERFACE - INTEGER FUNCTION h5ltmake_dataset_nint3_c(loc_id,namelen,dset_name,rank,dims,type_id,buf) - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LTMAKE_DATASET_NINT3_C'::h5ltmake_dataset_nint3_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER(size_t) :: namelen ! length of name buffer - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: rank ! rank - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER, INTENT(in), & - DIMENSION(dims(1),dims(2),dims(3)) :: buf ! data buffer - END FUNCTION h5ltmake_dataset_nint3_c - END INTERFACE - - namelen = LEN(dset_name) - errcode = h5ltmake_dataset_nint3_c(loc_id,namelen,dset_name,rank,dims,H5T_NATIVE_INTEGER,buf) - - END SUBROUTINE h5ltmake_dataset_int_f_3 - - !------------------------------------------------------------------------- - ! Function: h5ltmake_dataset_int_f_4 - ! - ! Purpose: Creates and writes a dataset of H5T_NATIVE_INT type - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: M. Scot Breitenfeld - ! - ! Date: March 8, 2011 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - - SUBROUTINE h5ltmake_dataset_int_f_4(loc_id, dset_name, rank, dims, & - buf, errcode ) - - IMPLICIT NONE - - ! - !This definition is needed for Windows DLLs - !DEC$if defined(BUILD_HDF5_HL_DLL) - !DEC$attributes dllexport :: h5ltmake_dataset_int_f_4 - !DEC$endif - ! - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: rank ! rank - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - INTEGER, INTENT(in), & - DIMENSION(dims(1),dims(2),dims(3),dims(4)) :: buf ! data buffer - - - INTERFACE - INTEGER FUNCTION h5ltmake_dataset_nint4_c(loc_id,namelen,dset_name,rank,dims,type_id,buf) - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LTMAKE_DATASET_NINT4_C'::h5ltmake_dataset_nint4_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER(size_t) :: namelen ! length of name buffer - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: rank ! rank - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER, INTENT(in), & - DIMENSION(dims(1),dims(2),dims(3),dims(4)) :: buf ! data buffer - END FUNCTION h5ltmake_dataset_nint4_c - END INTERFACE - - namelen = LEN(dset_name) - errcode = h5ltmake_dataset_nint4_c(loc_id,namelen,dset_name,rank,dims,H5T_NATIVE_INTEGER,buf) - - END SUBROUTINE h5ltmake_dataset_int_f_4 - - !------------------------------------------------------------------------- - ! Function: h5ltmake_dataset_int_f_5 - ! - ! Purpose: Creates and writes a dataset of H5T_NATIVE_INT type - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: M. Scot Breitenfeld - ! - ! Date: March 8, 2011 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - - SUBROUTINE h5ltmake_dataset_int_f_5(loc_id, dset_name, rank, dims, & - buf, errcode ) - - IMPLICIT NONE - - ! - !This definition is needed for Windows DLLs - !DEC$if defined(BUILD_HDF5_HL_DLL) - !DEC$attributes dllexport :: h5ltmake_dataset_int_f_5 - !DEC$endif - ! - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: rank ! rank - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - INTEGER, INTENT(in), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) :: buf ! data buffer - - - INTERFACE - INTEGER FUNCTION h5ltmake_dataset_nint5_c(loc_id,namelen,dset_name,rank,dims,type_id,buf) - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LTMAKE_DATASET_NINT5_C'::h5ltmake_dataset_nint5_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER(size_t) :: namelen ! length of name buffer - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: rank ! rank - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER, INTENT(in), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) :: buf ! data buffer - END FUNCTION h5ltmake_dataset_nint5_c - END INTERFACE - - namelen = LEN(dset_name) - errcode = h5ltmake_dataset_nint5_c(loc_id,namelen,dset_name,rank,dims,H5T_NATIVE_INTEGER,buf) - - END SUBROUTINE h5ltmake_dataset_int_f_5 - - !------------------------------------------------------------------------- - ! Function: h5ltmake_dataset_int_f_6 - ! - ! Purpose: Creates and writes a dataset of H5T_NATIVE_INT type - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: M. Scot Breitenfeld - ! - ! Date: March 8, 2011 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - - SUBROUTINE h5ltmake_dataset_int_f_6(loc_id, dset_name, rank, dims, & - buf, errcode ) - - IMPLICIT NONE - - ! - !This definition is needed for Windows DLLs - !DEC$if defined(BUILD_HDF5_HL_DLL) - !DEC$attributes dllexport :: h5ltmake_dataset_int_f_6 - !DEC$endif - ! - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: rank ! rank - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - INTEGER, INTENT(in), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)) :: buf ! data buffer - - - INTERFACE - INTEGER FUNCTION h5ltmake_dataset_nint6_c(loc_id,namelen,dset_name,rank,dims,type_id,buf) - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LTMAKE_DATASET_NINT6_C'::h5ltmake_dataset_nint6_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER(size_t) :: namelen ! length of name buffer - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: rank ! rank - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER, INTENT(in), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)) :: buf ! data buffer - END FUNCTION h5ltmake_dataset_nint6_c - END INTERFACE - - namelen = LEN(dset_name) - errcode = h5ltmake_dataset_nint6_c(loc_id,namelen,dset_name,rank,dims,H5T_NATIVE_INTEGER,buf) - - END SUBROUTINE h5ltmake_dataset_int_f_6 - - !------------------------------------------------------------------------- - ! Function: h5ltmake_dataset_int_f_7 - ! - ! Purpose: Creates and writes a dataset of H5T_NATIVE_INT type - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: M. Scot Breitenfeld - ! - ! Date: March 8, 2011 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - - SUBROUTINE h5ltmake_dataset_int_f_7(loc_id, dset_name, rank, dims, & - buf, errcode ) - - IMPLICIT NONE - - ! - !This definition is needed for Windows DLLs - !DEC$if defined(BUILD_HDF5_HL_DLL) - !DEC$attributes dllexport :: h5ltmake_dataset_int_f_7 - !DEC$endif - ! - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: rank ! rank - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - INTEGER, INTENT(in), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)) :: buf ! data buffer - - - INTERFACE - INTEGER FUNCTION h5ltmake_dataset_nint7_c(loc_id,namelen,dset_name,rank,dims,type_id,buf) - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LTMAKE_DATASET_NINT7_C'::h5ltmake_dataset_nint7_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER(size_t) :: namelen ! length of name buffer - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: rank ! rank - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER, INTENT(in), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)) :: buf ! data buffer - END FUNCTION h5ltmake_dataset_nint7_c - END INTERFACE - - namelen = LEN(dset_name) - errcode = h5ltmake_dataset_nint7_c(loc_id,namelen,dset_name,rank,dims,H5T_NATIVE_INTEGER,buf) - - END SUBROUTINE h5ltmake_dataset_int_f_7 - - !------------------------------------------------------------------------- - ! Function: h5ltmake_dataset_float_f_1 - ! - ! Purpose: Creates and writes a dataset of H5T_NATIVE_FLOAT type - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: pvn@ncsa.uiuc.edu - ! - ! Date: September 22, 2004 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - - SUBROUTINE h5ltmake_dataset_float_f_1 (loc_id,& - dset_name,& - rank,& - dims,& - buf,& - errcode ) - - IMPLICIT NONE - - ! - !This definition is needed for Windows DLLs - !DEC$if defined(BUILD_HDF5_HL_DLL) - !DEC$attributes dllexport :: h5ltmake_dataset_float_f_1 - !DEC$endif - ! - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: rank ! rank - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - REAL, INTENT(in), DIMENSION(*) :: buf ! data buffer - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - - INTERFACE - INTEGER FUNCTION h5ltmake_dataset_nfl1_c(loc_id,namelen,dset_name,rank,dims,type_id,buf) - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LTMAKE_DATASET_NFL1_C'::h5ltmake_dataset_nfl1_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER(size_t) :: namelen ! length of name buffer - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: rank ! rank - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - REAL, INTENT(in), DIMENSION(*) :: buf ! data buffer - END FUNCTION h5ltmake_dataset_nfl1_c - END INTERFACE - - namelen = LEN(dset_name) - errcode = h5ltmake_dataset_nfl1_c(loc_id,namelen,dset_name,rank,dims,H5T_NATIVE_REAL,buf) - - END SUBROUTINE h5ltmake_dataset_float_f_1 - - !------------------------------------------------------------------------- - ! Function: h5ltmake_dataset_float_f_2 - ! - ! Purpose: Creates and writes a dataset of H5T_NATIVE_FLOAT type - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: pvn@ncsa.uiuc.edu - ! - ! Date: September 22, 2004 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - - SUBROUTINE h5ltmake_dataset_float_f_2 (loc_id,& - dset_name,& - rank,& - dims,& - buf,& - errcode ) - - IMPLICIT NONE - - ! - !This definition is needed for Windows DLLs - !DEC$if defined(BUILD_HDF5_HL_DLL) - !DEC$attributes dllexport :: h5ltmake_dataset_float_f_2 - !DEC$endif - ! - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: rank ! rank - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - REAL, INTENT(in), & - DIMENSION(dims(1),dims(2)) :: buf ! data buffer - - INTERFACE - INTEGER FUNCTION h5ltmake_dataset_nfl2_c(loc_id,namelen,dset_name,rank,dims,type_id,buf) - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LTMAKE_DATASET_NFL2_C'::h5ltmake_dataset_nfl2_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER(size_t) :: namelen ! length of name buffer - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: rank ! rank - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - REAL, INTENT(in), & - DIMENSION(dims(1),dims(2)) :: buf ! data buffer - END FUNCTION h5ltmake_dataset_nfl2_c - END INTERFACE - - namelen = LEN(dset_name) - errcode = h5ltmake_dataset_nfl2_c(loc_id,namelen,dset_name,rank,dims,H5T_NATIVE_REAL,buf) - - END SUBROUTINE h5ltmake_dataset_float_f_2 - - !------------------------------------------------------------------------- - ! Function: h5ltmake_dataset_float_f_3 - ! - ! Purpose: Creates and writes a dataset of H5T_NATIVE_FLOAT type - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: pvn@ncsa.uiuc.edu - ! - ! Date: September 22, 2004 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - - SUBROUTINE h5ltmake_dataset_float_f_3 (loc_id,& - dset_name,& - rank,& - dims,& - buf,& - errcode ) - - IMPLICIT NONE - - ! - !This definition is needed for Windows DLLs - !DEC$if defined(BUILD_HDF5_HL_DLL) - !DEC$attributes dllexport :: h5ltmake_dataset_float_f_3 - !DEC$endif - ! - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: rank ! rank - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - REAL, INTENT(in), & - DIMENSION(dims(1),dims(2),dims(3)) :: buf ! data buffer - - INTERFACE - INTEGER FUNCTION h5ltmake_dataset_nfl3_c(loc_id,namelen,dset_name,rank,dims,type_id,buf) - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LTMAKE_DATASET_NFL3_C'::h5ltmake_dataset_nfl3_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER(size_t) :: namelen ! length of name buffer - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: rank ! rank - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - REAL, INTENT(in), & - DIMENSION(dims(1),dims(2),dims(3)) :: buf ! data buffer - END FUNCTION h5ltmake_dataset_nfl3_c - END INTERFACE - - namelen = LEN(dset_name) - errcode = h5ltmake_dataset_nfl3_c(loc_id,namelen,dset_name,rank,dims,H5T_NATIVE_REAL,buf) - - END SUBROUTINE h5ltmake_dataset_float_f_3 - - !------------------------------------------------------------------------- - ! Function: h5ltmake_dataset_float_f_4 - ! - ! Purpose: Creates and writes a dataset of H5T_NATIVE_FLOAT type - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: M. Scot Breitenfeld - ! - ! Date: March 8, 2011 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - - SUBROUTINE h5ltmake_dataset_float_f_4 (loc_id, dset_name, rank, dims, & - buf, errcode ) - - IMPLICIT NONE - - ! - !This definition is needed for Windows DLLs - !DEC$if defined(BUILD_HDF5_HL_DLL) - !DEC$attributes dllexport :: h5ltmake_dataset_float_f_4 - !DEC$endif - ! - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: rank ! rank - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - REAL, INTENT(in), & - DIMENSION(dims(1),dims(2),dims(3),dims(4)) :: buf ! data buffer - - INTERFACE - INTEGER FUNCTION h5ltmake_dataset_nfl4_c(loc_id,namelen,dset_name,rank,dims,type_id,buf) - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LTMAKE_DATASET_NFL4_C'::h5ltmake_dataset_nfl4_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER(size_t) :: namelen ! length of name buffer - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: rank ! rank - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - REAL, INTENT(in), & - DIMENSION(dims(1),dims(2),dims(3),dims(4)) :: buf ! data buffer - END FUNCTION h5ltmake_dataset_nfl4_c - END INTERFACE - - namelen = LEN(dset_name) - errcode = h5ltmake_dataset_nfl4_c(loc_id,namelen,dset_name,rank,dims,H5T_NATIVE_REAL,buf) - - END SUBROUTINE h5ltmake_dataset_float_f_4 - - !------------------------------------------------------------------------- - ! Function: h5ltmake_dataset_float_f_5 - ! - ! Purpose: Creates and writes a dataset of H5T_NATIVE_FLOAT type - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: M. Scot Breitenfeld - ! - ! Date: March 8, 2011 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - - SUBROUTINE h5ltmake_dataset_float_f_5 (loc_id, dset_name, rank, dims, & - buf, errcode ) - - IMPLICIT NONE - - ! - !This definition is needed for Windows DLLs - !DEC$if defined(BUILD_HDF5_HL_DLL) - !DEC$attributes dllexport :: h5ltmake_dataset_float_f_5 - !DEC$endif - ! - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: rank ! rank - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - REAL, INTENT(in), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) :: buf ! data buffer - - INTERFACE - INTEGER FUNCTION h5ltmake_dataset_nfl5_c(loc_id,namelen,dset_name,rank,dims,type_id,buf) - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LTMAKE_DATASET_NFL5_C'::h5ltmake_dataset_nfl5_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER(size_t) :: namelen ! length of name buffer - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: rank ! rank - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - REAL, INTENT(in), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) :: buf ! data buffer - END FUNCTION h5ltmake_dataset_nfl5_c - END INTERFACE - - namelen = LEN(dset_name) - errcode = h5ltmake_dataset_nfl5_c(loc_id,namelen,dset_name,rank,dims,H5T_NATIVE_REAL,buf) - - END SUBROUTINE h5ltmake_dataset_float_f_5 - - !------------------------------------------------------------------------- - ! Function: h5ltmake_dataset_float_f_6 - ! - ! Purpose: Creates and writes a dataset of H5T_NATIVE_FLOAT type - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: M. Scot Breitenfeld - ! - ! Date: March 8, 2011 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - - SUBROUTINE h5ltmake_dataset_float_f_6 (loc_id, dset_name, rank, dims, & - buf, errcode ) - - IMPLICIT NONE - - ! - !This definition is needed for Windows DLLs - !DEC$if defined(BUILD_HDF5_HL_DLL) - !DEC$attributes dllexport :: h5ltmake_dataset_float_f_6 - !DEC$endif - ! - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: rank ! rank - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - REAL, INTENT(in), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)) :: buf ! data buffer - - INTERFACE - INTEGER FUNCTION h5ltmake_dataset_nfl6_c(loc_id,namelen,dset_name,rank,dims,type_id,buf) - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LTMAKE_DATASET_NFL6_C'::h5ltmake_dataset_nfl6_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER(size_t) :: namelen ! length of name buffer - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: rank ! rank - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - REAL, INTENT(in), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)) :: buf ! data buffer - END FUNCTION h5ltmake_dataset_nfl6_c - END INTERFACE - - namelen = LEN(dset_name) - errcode = h5ltmake_dataset_nfl6_c(loc_id,namelen,dset_name,rank,dims,H5T_NATIVE_REAL,buf) - - END SUBROUTINE h5ltmake_dataset_float_f_6 - - !------------------------------------------------------------------------- - ! Function: h5ltmake_dataset_float_f_7 - ! - ! Purpose: Creates and writes a dataset of H5T_NATIVE_FLOAT type - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: M. Scot Breitenfeld - ! - ! Date: March 8, 2011 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - - SUBROUTINE h5ltmake_dataset_float_f_7 (loc_id, dset_name, rank, dims, & - buf, errcode ) - - IMPLICIT NONE - - ! - !This definition is needed for Windows DLLs - !DEC$if defined(BUILD_HDF5_HL_DLL) - !DEC$attributes dllexport :: h5ltmake_dataset_float_f_7 - !DEC$endif - ! - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: rank ! rank - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - REAL, INTENT(in), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)) :: buf ! data buffer - - INTERFACE - INTEGER FUNCTION h5ltmake_dataset_nfl7_c(loc_id,namelen,dset_name,rank,dims,type_id,buf) - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LTMAKE_DATASET_NFL7_C'::h5ltmake_dataset_nfl7_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER(size_t) :: namelen ! length of name buffer - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: rank ! rank - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - REAL, INTENT(in), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)) :: buf ! data buffer - END FUNCTION h5ltmake_dataset_nfl7_c - END INTERFACE - - namelen = LEN(dset_name) - errcode = h5ltmake_dataset_nfl7_c(loc_id,namelen,dset_name,rank,dims,H5T_NATIVE_REAL,buf) - - END SUBROUTINE h5ltmake_dataset_float_f_7 - - - !------------------------------------------------------------------------- - ! Function: h5ltmake_dataset_double_f_1 - ! - ! Purpose: Creates and writes a dataset of H5T_NATIVE_DOUBLE type - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: pvn@ncsa.uiuc.edu - ! - ! Date: September 22, 2004 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - - SUBROUTINE h5ltmake_dataset_double_f_1 (loc_id,& - dset_name,& - rank,& - dims,& - buf,& - errcode ) - - IMPLICIT NONE - - ! - !This definition is needed for Windows DLLs - !DEC$if defined(BUILD_HDF5_HL_DLL) - !DEC$attributes dllexport :: h5ltmake_dataset_double_f_1 - !DEC$endif - ! - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: rank ! rank - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - DOUBLE PRECISION, INTENT(in), & - DIMENSION(dims(1)) :: buf ! data buffer - - INTERFACE - INTEGER FUNCTION h5ltmake_dataset_ndl1_c(loc_id,namelen,dset_name,rank,dims,type_id,buf) - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LTMAKE_DATASET_NDL1_C'::h5ltmake_dataset_ndl1_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER(size_t) :: namelen ! length of name buffer - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: rank ! rank - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - DOUBLE PRECISION, INTENT(in), & - DIMENSION(dims(1)) :: buf ! data buffer - END FUNCTION h5ltmake_dataset_ndl1_c - END INTERFACE - - namelen = LEN(dset_name) - errcode = h5ltmake_dataset_ndl1_c(loc_id,namelen,dset_name,rank,dims,H5T_NATIVE_DOUBLE,buf) - - END SUBROUTINE h5ltmake_dataset_double_f_1 - - - !------------------------------------------------------------------------- - ! Function: h5ltmake_dataset_double_f_2 - ! - ! Purpose: Creates and writes a dataset of H5T_NATIVE_DOUBLE type - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: pvn@ncsa.uiuc.edu - ! - ! Date: September 22, 2004 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - - SUBROUTINE h5ltmake_dataset_double_f_2 (loc_id,& - dset_name,& - rank,& - dims,& - buf,& - errcode ) - - IMPLICIT NONE - - ! - !This definition is needed for Windows DLLs - !DEC$if defined(BUILD_HDF5_HL_DLL) - !DEC$attributes dllexport :: h5ltmake_dataset_double_f_2 - !DEC$endif - ! - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: rank ! rank - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - DOUBLE PRECISION, INTENT(in), & - DIMENSION(dims(1),dims(2)) :: buf ! data buffer - - INTERFACE - INTEGER FUNCTION h5ltmake_dataset_ndl2_c(loc_id,namelen,dset_name,rank,dims,type_id,buf) - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LTMAKE_DATASET_NDL2_C'::h5ltmake_dataset_ndl2_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER(size_t) :: namelen ! length of name buffer - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: rank ! rank - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - DOUBLE PRECISION, INTENT(in), & - DIMENSION(dims(1),dims(2)) :: buf ! data buffer - END FUNCTION h5ltmake_dataset_ndl2_c - END INTERFACE - - namelen = LEN(dset_name) - errcode = h5ltmake_dataset_ndl2_c(loc_id,namelen,dset_name,rank,dims,H5T_NATIVE_DOUBLE,buf) - - END SUBROUTINE h5ltmake_dataset_double_f_2 - - !------------------------------------------------------------------------- - ! Function: h5ltmake_dataset_double_f_3 - ! - ! Purpose: Creates and writes a dataset of H5T_NATIVE_DOUBLE type - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: pvn@ncsa.uiuc.edu - ! - ! Date: September 22, 2004 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - - SUBROUTINE h5ltmake_dataset_double_f_3 (loc_id,& - dset_name,& - rank,& - dims,& - buf,& - errcode ) - - IMPLICIT NONE - - ! - !This definition is needed for Windows DLLs - !DEC$if defined(BUILD_HDF5_HL_DLL) - !DEC$attributes dllexport :: h5ltmake_dataset_double_f_3 - !DEC$endif - ! - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: rank ! rank - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - DOUBLE PRECISION, INTENT(in), & - DIMENSION(dims(1),dims(2),dims(3)) :: buf ! data buffer - - INTERFACE - INTEGER FUNCTION h5ltmake_dataset_ndl3_c(loc_id,namelen,dset_name,rank,dims,type_id,buf) - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LTMAKE_DATASET_NDL3_C'::h5ltmake_dataset_ndl3_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER(size_t) :: namelen ! length of name buffer - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: rank ! rank - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - DOUBLE PRECISION, INTENT(in), & - DIMENSION(dims(1),dims(2),dims(3)) :: buf ! data buffer - END FUNCTION h5ltmake_dataset_ndl3_c - END INTERFACE - - namelen = LEN(dset_name) - errcode = h5ltmake_dataset_ndl3_c(loc_id,namelen,dset_name,rank,dims,H5T_NATIVE_DOUBLE,buf) - - END SUBROUTINE h5ltmake_dataset_double_f_3 - - !------------------------------------------------------------------------- - ! Function: h5ltmake_dataset_double_f_4 - ! - ! Purpose: Creates and writes a dataset of H5T_NATIVE_DOUBLE type - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: M. Scot Breitenfeld - ! - ! Date: March 8, 2011 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - - SUBROUTINE h5ltmake_dataset_double_f_4 (loc_id, dset_name, rank, dims,& - buf, errcode ) - - IMPLICIT NONE - - ! - !This definition is needed for Windows DLLs - !DEC$if defined(BUILD_HDF5_HL_DLL) - !DEC$attributes dllexport :: h5ltmake_dataset_double_f_4 - !DEC$endif - ! - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: rank ! rank - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - DOUBLE PRECISION, INTENT(in), & - DIMENSION(dims(1),dims(2),dims(3),dims(4)) :: buf ! data buffer - - INTERFACE - INTEGER FUNCTION h5ltmake_dataset_ndl4_c(loc_id,namelen,dset_name,rank,dims,type_id,buf) - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LTMAKE_DATASET_NDL4_C'::h5ltmake_dataset_ndl4_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER(size_t) :: namelen ! length of name buffer - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: rank ! rank - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - DOUBLE PRECISION, INTENT(in), & - DIMENSION(dims(1),dims(2),dims(3),dims(4)) :: buf ! data buffer - END FUNCTION h5ltmake_dataset_ndl4_c - END INTERFACE - - namelen = LEN(dset_name) - errcode = h5ltmake_dataset_ndl4_c(loc_id,namelen,dset_name,rank,dims,H5T_NATIVE_DOUBLE,buf) - - END SUBROUTINE h5ltmake_dataset_double_f_4 - - !------------------------------------------------------------------------- - ! Function: h5ltmake_dataset_double_f_5 - ! - ! Purpose: Creates and writes a dataset of H5T_NATIVE_DOUBLE type - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: M. Scot Breitenfeld - ! - ! Date: March 8, 2011 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - - SUBROUTINE h5ltmake_dataset_double_f_5 (loc_id, dset_name, rank, dims,& - buf, errcode ) - - IMPLICIT NONE - - ! - !This definition is needed for Windows DLLs - !DEC$if defined(BUILD_HDF5_HL_DLL) - !DEC$attributes dllexport :: h5ltmake_dataset_double_f_5 - !DEC$endif - ! - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: rank ! rank - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - DOUBLE PRECISION, INTENT(in), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) :: buf ! data buffer - - INTERFACE - INTEGER FUNCTION h5ltmake_dataset_ndl5_c(loc_id,namelen,dset_name,rank,dims,type_id,buf) - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LTMAKE_DATASET_NDL5_C'::h5ltmake_dataset_ndl5_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER(size_t) :: namelen ! length of name buffer - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: rank ! rank - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - DOUBLE PRECISION, INTENT(in), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) :: buf ! data buffer - END FUNCTION h5ltmake_dataset_ndl5_c - END INTERFACE - - namelen = LEN(dset_name) - errcode = h5ltmake_dataset_ndl5_c(loc_id,namelen,dset_name,rank,dims,H5T_NATIVE_DOUBLE,buf) - - END SUBROUTINE h5ltmake_dataset_double_f_5 - - !------------------------------------------------------------------------- - ! Function: h5ltmake_dataset_double_f_6 - ! - ! Purpose: Creates and writes a dataset of H5T_NATIVE_DOUBLE type - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: M. Scot Breitenfeld - ! - ! Date: March 8, 2011 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - - SUBROUTINE h5ltmake_dataset_double_f_6 (loc_id, dset_name, rank, dims,& - buf, errcode ) - - IMPLICIT NONE - - ! - !This definition is needed for Windows DLLs - !DEC$if defined(BUILD_HDF5_HL_DLL) - !DEC$attributes dllexport :: h5ltmake_dataset_double_f_5 - !DEC$endif - ! - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: rank ! rank - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - DOUBLE PRECISION, INTENT(in), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)) :: buf ! data buffer - - INTERFACE - INTEGER FUNCTION h5ltmake_dataset_ndl6_c(loc_id,namelen,dset_name,rank,dims,type_id,buf) - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LTMAKE_DATASET_NDL6_C'::h5ltmake_dataset_ndl6_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER(size_t) :: namelen ! length of name buffer - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: rank ! rank - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - DOUBLE PRECISION, INTENT(in), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)) :: buf ! data buffer - END FUNCTION h5ltmake_dataset_ndl6_c - END INTERFACE - - namelen = LEN(dset_name) - errcode = h5ltmake_dataset_ndl6_c(loc_id,namelen,dset_name,rank,dims,H5T_NATIVE_DOUBLE,buf) - - END SUBROUTINE h5ltmake_dataset_double_f_6 - - !------------------------------------------------------------------------- - ! Function: h5ltmake_dataset_double_f_7 - ! - ! Purpose: Creates and writes a dataset of H5T_NATIVE_DOUBLE type - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: M. Scot Breitenfeld - ! - ! Date: March 8, 2011 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - - SUBROUTINE h5ltmake_dataset_double_f_7 (loc_id, dset_name, rank, dims,& - buf, errcode ) - - IMPLICIT NONE - - ! - !This definition is needed for Windows DLLs - !DEC$if defined(BUILD_HDF5_HL_DLL) - !DEC$attributes dllexport :: h5ltmake_dataset_double_f_5 - !DEC$endif - ! - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: rank ! rank - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - DOUBLE PRECISION, INTENT(in), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)) :: buf ! data buffer - - INTERFACE - INTEGER FUNCTION h5ltmake_dataset_ndl7_c(loc_id,namelen,dset_name,rank,dims,type_id,buf) - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LTMAKE_DATASET_NDL7_C'::h5ltmake_dataset_ndl7_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER(size_t) :: namelen ! length of name buffer - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: rank ! rank - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - DOUBLE PRECISION, INTENT(in), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)) :: buf ! data buffer - END FUNCTION h5ltmake_dataset_ndl7_c - END INTERFACE - - namelen = LEN(dset_name) - errcode = h5ltmake_dataset_ndl7_c(loc_id,namelen,dset_name,rank,dims,H5T_NATIVE_DOUBLE,buf) - - END SUBROUTINE h5ltmake_dataset_double_f_7 - - !------------------------------------------------------------------------- - ! Function: h5ltread_dataset_int_f_1 - ! - ! Purpose: Read a dataset - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: pvn@ncsa.uiuc.edu - ! - ! Date: September 22, 2004 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - - SUBROUTINE h5ltread_dataset_int_f_1(loc_id,& - dset_name,& - buf,& - dims,& - errcode ) - - IMPLICIT NONE - - ! - !This definition is needed for Windows DLLs - !DEC$if defined(BUILD_HDF5_HL_DLL) - !DEC$attributes dllexport :: h5ltread_dataset_int_f_1 - !DEC$endif - ! - - INTEGER(HID_T), INTENT(IN) :: loc_id ! file or group identifier - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - INTEGER, INTENT(inout), & - DIMENSION(dims(1)) :: buf ! data buffer - - INTERFACE - INTEGER FUNCTION h5ltread_dataset_nint1_c(loc_id,namelen,dset_name,type_id,buf,dims) - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LTREAD_DATASET_NINT1_C'::h5ltread_dataset_nint1_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER(size_t) :: namelen ! length of name buffer - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER, INTENT(inout), & - DIMENSION(dims(1)) :: buf ! data buffer - END FUNCTION h5ltread_dataset_nint1_c - END INTERFACE - - namelen = LEN(dset_name) - errcode = h5ltread_dataset_nint1_c(loc_id,namelen,dset_name,H5T_NATIVE_INTEGER,buf,dims) - - END SUBROUTINE h5ltread_dataset_int_f_1 - - - !------------------------------------------------------------------------- - ! Function: h5ltread_dataset_int_f_2 - ! - ! Purpose: Read a dataset - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: pvn@ncsa.uiuc.edu - ! - ! Date: September 22, 2004 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - - SUBROUTINE h5ltread_dataset_int_f_2(loc_id,& - dset_name,& - buf,& - dims,& - errcode ) - - IMPLICIT NONE - - ! - !This definition is needed for Windows DLLs - !DEC$if defined(BUILD_HDF5_HL_DLL) - !DEC$attributes dllexport :: h5ltread_dataset_int_f_2 - !DEC$endif - ! - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - INTEGER, INTENT(inout), & - DIMENSION(dims(1),dims(2)) :: buf ! data buffer - - INTERFACE - INTEGER FUNCTION h5ltread_dataset_nint2_c(loc_id,namelen,dset_name,type_id,buf,dims) - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LTREAD_DATASET_NINT2_C'::h5ltread_dataset_nint2_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER(size_t) :: namelen ! length of name buffer - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER, INTENT(inout), & - DIMENSION(dims(1),dims(2)) :: buf ! data buffer - END FUNCTION h5ltread_dataset_nint2_c - END INTERFACE - - namelen = LEN(dset_name) - errcode = h5ltread_dataset_nint2_c(loc_id,namelen,dset_name,H5T_NATIVE_INTEGER,buf,dims) - - END SUBROUTINE h5ltread_dataset_int_f_2 - - !------------------------------------------------------------------------- - ! Function: h5ltread_dataset_int_f_3 - ! - ! Purpose: Read a dataset - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: pvn@ncsa.uiuc.edu - ! - ! Date: September 22, 2004 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - - SUBROUTINE h5ltread_dataset_int_f_3(loc_id,& - dset_name,& - buf,& - dims,& - errcode ) - - IMPLICIT NONE - - ! - !This definition is needed for Windows DLLs - !DEC$if defined(BUILD_HDF5_HL_DLL) - !DEC$attributes dllexport :: h5ltread_dataset_int_f_3 - !DEC$endif - ! - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - INTEGER, INTENT(inout), & - DIMENSION(dims(1),dims(2),dims(3)) :: buf ! data buffer - - INTERFACE - INTEGER FUNCTION h5ltread_dataset_nint3_c(loc_id,namelen,dset_name,type_id,buf,dims) - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LTREAD_DATASET_NINT3_C'::h5ltread_dataset_nint3_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER(size_t) :: namelen ! length of name buffer - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER, INTENT(inout), & - DIMENSION(dims(1),dims(2),dims(3)) :: buf ! data buffer - END FUNCTION h5ltread_dataset_nint3_c - END INTERFACE - - namelen = LEN(dset_name) - errcode = h5ltread_dataset_nint3_c(loc_id,namelen,dset_name,H5T_NATIVE_INTEGER,buf,dims) - - END SUBROUTINE h5ltread_dataset_int_f_3 - - !------------------------------------------------------------------------- - ! Function: h5ltread_dataset_int_f_4 - ! - ! Purpose: Read a dataset - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: M. Scot Breitenfeld - ! - ! Date: March 8, 2011 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - - SUBROUTINE h5ltread_dataset_int_f_4(loc_id, dset_name, buf, dims, errcode ) - - IMPLICIT NONE - - ! - !This definition is needed for Windows DLLs - !DEC$if defined(BUILD_HDF5_HL_DLL) - !DEC$attributes dllexport :: h5ltread_dataset_int_f_4 - !DEC$endif - ! - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - INTEGER, INTENT(inout), & - DIMENSION(dims(1),dims(2),dims(3),dims(4)) :: buf ! data buffer - - INTERFACE - INTEGER FUNCTION h5ltread_dataset_nint4_c(loc_id,namelen,dset_name,type_id,buf,dims) - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LTREAD_DATASET_NINT4_C'::h5ltread_dataset_nint4_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER(size_t) :: namelen ! length of name buffer - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER, INTENT(inout), & - DIMENSION(dims(1),dims(2),dims(3),dims(4)) :: buf ! data buffer - END FUNCTION h5ltread_dataset_nint4_c - END INTERFACE - - namelen = LEN(dset_name) - errcode = h5ltread_dataset_nint4_c(loc_id,namelen,dset_name,H5T_NATIVE_INTEGER,buf,dims) - - END SUBROUTINE h5ltread_dataset_int_f_4 - - !------------------------------------------------------------------------- - ! Function: h5ltread_dataset_int_f_5 - ! - ! Purpose: Read a dataset - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: M. Scot Breitenfeld - ! - ! Date: March 8, 2011 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - - SUBROUTINE h5ltread_dataset_int_f_5(loc_id, dset_name, buf, dims, errcode ) - - IMPLICIT NONE - - ! - !This definition is needed for Windows DLLs - !DEC$if defined(BUILD_HDF5_HL_DLL) - !DEC$attributes dllexport :: h5ltread_dataset_int_f_5 - !DEC$endif - ! - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - INTEGER, INTENT(inout), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) :: buf ! data buffer - - INTERFACE - INTEGER FUNCTION h5ltread_dataset_nint5_c(loc_id,namelen,dset_name,type_id,buf,dims) - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LTREAD_DATASET_NINT5_C'::h5ltread_dataset_nint5_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER(size_t) :: namelen ! length of name buffer - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER, INTENT(inout), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) :: buf ! data buffer - END FUNCTION h5ltread_dataset_nint5_c - END INTERFACE - - namelen = LEN(dset_name) - errcode = h5ltread_dataset_nint5_c(loc_id,namelen,dset_name,H5T_NATIVE_INTEGER,buf,dims) - - END SUBROUTINE h5ltread_dataset_int_f_5 - - !------------------------------------------------------------------------- - ! Function: h5ltread_dataset_int_f_6 - ! - ! Purpose: Read a dataset - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: M. Scot Breitenfeld - ! - ! Date: March 8, 2011 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - - SUBROUTINE h5ltread_dataset_int_f_6(loc_id, dset_name, buf, dims, errcode ) - - IMPLICIT NONE - - ! - !This definition is needed for Windows DLLs - !DEC$if defined(BUILD_HDF5_HL_DLL) - !DEC$attributes dllexport :: h5ltread_dataset_int_f_6 - !DEC$endif - ! - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - INTEGER, INTENT(inout), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)) :: buf ! data buffer - - INTERFACE - INTEGER FUNCTION h5ltread_dataset_nint6_c(loc_id,namelen,dset_name,type_id,buf,dims) - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LTREAD_DATASET_NINT6_C'::h5ltread_dataset_nint6_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER(size_t) :: namelen ! length of name buffer - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER, INTENT(inout), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)) :: buf ! data buffer - END FUNCTION h5ltread_dataset_nint6_c - END INTERFACE - - namelen = LEN(dset_name) - errcode = h5ltread_dataset_nint6_c(loc_id,namelen,dset_name,H5T_NATIVE_INTEGER,buf,dims) - - END SUBROUTINE h5ltread_dataset_int_f_6 - - !------------------------------------------------------------------------- - ! Function: h5ltread_dataset_int_f_7 - ! - ! Purpose: Read a dataset - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: M. Scot Breitenfeld - ! - ! Date: March 8, 2011 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - - SUBROUTINE h5ltread_dataset_int_f_7(loc_id, dset_name, buf, dims, errcode ) - - IMPLICIT NONE - - ! - !This definition is needed for Windows DLLs - !DEC$if defined(BUILD_HDF5_HL_DLL) - !DEC$attributes dllexport :: h5ltread_dataset_int_f_7 - !DEC$endif - ! - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - INTEGER, INTENT(inout), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)) :: buf ! data buffer - - INTERFACE - INTEGER FUNCTION h5ltread_dataset_nint7_c(loc_id,namelen,dset_name,type_id,buf,dims) - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LTREAD_DATASET_NINT7_C'::h5ltread_dataset_nint7_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER(size_t) :: namelen ! length of name buffer - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER, INTENT(inout), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)) :: buf ! data buffer - END FUNCTION h5ltread_dataset_nint7_c - END INTERFACE - - namelen = LEN(dset_name) - errcode = h5ltread_dataset_nint7_c(loc_id,namelen,dset_name,H5T_NATIVE_INTEGER,buf,dims) - - END SUBROUTINE h5ltread_dataset_int_f_7 - - - !------------------------------------------------------------------------- - ! Function: h5ltread_dataset_float_f_1 - ! - ! Purpose: Read a dataset - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: pvn@ncsa.uiuc.edu - ! - ! Date: September 22, 2004 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - - SUBROUTINE h5ltread_dataset_float_f_1(loc_id,& - dset_name,& - buf,& - dims,& - errcode ) - - IMPLICIT NONE - - ! - !This definition is needed for Windows DLLs - !DEC$if defined(BUILD_HDF5_HL_DLL) - !DEC$attributes dllexport :: h5ltread_dataset_float_f_1 - !DEC$endif - ! - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - REAL, INTENT(inout), & - DIMENSION(dims(1)) :: buf ! data buffer - - INTERFACE - INTEGER FUNCTION h5ltread_dataset_nfl1_c(loc_id,namelen,dset_name,type_id,buf,dims) - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LTREAD_DATASET_NFL1_C'::h5ltread_dataset_nfl1_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER(size_t) :: namelen ! length of name buffer - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - REAL, INTENT(inout), & - DIMENSION(dims(1)) :: buf ! data buffer - END FUNCTION h5ltread_dataset_nfl1_c - END INTERFACE - - namelen = LEN(dset_name) - errcode = h5ltread_dataset_nfl1_c(loc_id,namelen,dset_name,H5T_NATIVE_REAL,buf,dims) - - END SUBROUTINE h5ltread_dataset_float_f_1 - - - !------------------------------------------------------------------------- - ! Function: h5ltread_dataset_float_f_2 - ! - ! Purpose: Read a dataset - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: pvn@ncsa.uiuc.edu - ! - ! Date: September 22, 2004 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - - SUBROUTINE h5ltread_dataset_float_f_2(loc_id,& - dset_name,& - buf,& - dims,& - errcode ) - - IMPLICIT NONE - - ! - !This definition is needed for Windows DLLs - !DEC$if defined(BUILD_HDF5_HL_DLL) - !DEC$attributes dllexport :: h5ltread_dataset_float_f_2 - !DEC$endif - ! - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - REAL, INTENT(inout), & - DIMENSION(dims(1),dims(2)) :: buf ! data buffer - - INTERFACE - INTEGER FUNCTION h5ltread_dataset_nfl2_c(loc_id,namelen,dset_name,type_id,buf,dims) - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LTREAD_DATASET_NFL2_C'::h5ltread_dataset_nfl2_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER(size_t) :: namelen ! length of name buffer - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - REAL, INTENT(inout), & - DIMENSION(dims(1),dims(2)) :: buf ! data buffer - END FUNCTION h5ltread_dataset_nfl2_c - END INTERFACE - - namelen = LEN(dset_name) - errcode = h5ltread_dataset_nfl2_c(loc_id,namelen,dset_name,H5T_NATIVE_REAL,buf,dims) - - END SUBROUTINE h5ltread_dataset_float_f_2 - - !------------------------------------------------------------------------- - ! Function: h5ltread_dataset_float_f_3 - ! - ! Purpose: Read a dataset - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: pvn@ncsa.uiuc.edu - ! - ! Date: September 22, 2004 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - - SUBROUTINE h5ltread_dataset_float_f_3(loc_id,& - dset_name,& - buf,& - dims,& - errcode ) - - IMPLICIT NONE - - ! - !This definition is needed for Windows DLLs - !DEC$if defined(BUILD_HDF5_HL_DLL) - !DEC$attributes dllexport :: h5ltread_dataset_float_f_3 - !DEC$endif - ! - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - REAL, INTENT(inout), & - DIMENSION(dims(1),dims(2),dims(3)) :: buf ! data buffer - - INTERFACE - INTEGER FUNCTION h5ltread_dataset_nfl3_c(loc_id,namelen,dset_name,type_id,buf,dims) - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LTREAD_DATASET_NFL3_C'::h5ltread_dataset_nfl3_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER(size_t) :: namelen ! length of name buffer - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - REAL, INTENT(inout), & - DIMENSION(dims(1),dims(2),dims(3)) :: buf ! data buffer - END FUNCTION h5ltread_dataset_nfl3_c - END INTERFACE - - namelen = LEN(dset_name) - errcode = h5ltread_dataset_nfl3_c(loc_id,namelen,dset_name,H5T_NATIVE_REAL,buf,dims) - - END SUBROUTINE h5ltread_dataset_float_f_3 - - !------------------------------------------------------------------------- - ! Function: h5ltread_dataset_float_f_4 - ! - ! Purpose: Read a dataset - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: M. Scot Breitenfeld - ! - ! Date: March 8, 2011 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - - SUBROUTINE h5ltread_dataset_float_f_4(loc_id, dset_name, buf, dims, errcode ) - - IMPLICIT NONE - - ! - !This definition is needed for Windows DLLs - !DEC$if defined(BUILD_HDF5_HL_DLL) - !DEC$attributes dllexport :: h5ltread_dataset_float_f_4 - !DEC$endif - ! - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - REAL, INTENT(inout), & - DIMENSION(dims(1),dims(2),dims(3),dims(4)) :: buf ! data buffer - - INTERFACE - INTEGER FUNCTION h5ltread_dataset_nfl4_c(loc_id,namelen,dset_name,type_id,buf,dims) - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LTREAD_DATASET_NFL4_C'::h5ltread_dataset_nfl4_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER(size_t) :: namelen ! length of name buffer - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - REAL, INTENT(inout), & - DIMENSION(dims(1),dims(2),dims(3),dims(4)) :: buf ! data buffer - END FUNCTION h5ltread_dataset_nfl4_c - END INTERFACE - - namelen = LEN(dset_name) - errcode = h5ltread_dataset_nfl4_c(loc_id,namelen,dset_name,H5T_NATIVE_REAL,buf,dims) - - END SUBROUTINE h5ltread_dataset_float_f_4 - - !------------------------------------------------------------------------- - ! Function: h5ltread_dataset_float_f_5 - ! - ! Purpose: Read a dataset - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: M. Scot Breitenfeld - ! - ! Date: March 8, 2011 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - - SUBROUTINE h5ltread_dataset_float_f_5(loc_id, dset_name, buf, dims, errcode ) - - IMPLICIT NONE - - ! - !This definition is needed for Windows DLLs - !DEC$if defined(BUILD_HDF5_HL_DLL) - !DEC$attributes dllexport :: h5ltread_dataset_float_f_5 - !DEC$endif - ! - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - REAL, INTENT(inout), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) :: buf ! data buffer - - INTERFACE - INTEGER FUNCTION h5ltread_dataset_nfl5_c(loc_id,namelen,dset_name,type_id,buf,dims) - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LTREAD_DATASET_NFL5_C'::h5ltread_dataset_nfl5_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER(size_t) :: namelen ! length of name buffer - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - REAL, INTENT(inout), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) :: buf ! data buffer - END FUNCTION h5ltread_dataset_nfl5_c - END INTERFACE - - namelen = LEN(dset_name) - errcode = h5ltread_dataset_nfl5_c(loc_id,namelen,dset_name,H5T_NATIVE_REAL,buf,dims) - - END SUBROUTINE h5ltread_dataset_float_f_5 - - !------------------------------------------------------------------------- - ! Function: h5ltread_dataset_float_f_6 - ! - ! Purpose: Read a dataset - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: M. Scot Breitenfeld - ! - ! Date: March 8, 2011 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - - SUBROUTINE h5ltread_dataset_float_f_6(loc_id, dset_name, buf, dims, errcode ) - - IMPLICIT NONE - - ! - !This definition is needed for Windows DLLs - !DEC$if defined(BUILD_HDF5_HL_DLL) - !DEC$attributes dllexport :: h5ltread_dataset_float_f_6 - !DEC$endif - ! - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - REAL, INTENT(inout), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)) :: buf ! data buffer - - INTERFACE - INTEGER FUNCTION h5ltread_dataset_nfl6_c(loc_id,namelen,dset_name,type_id,buf,dims) - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LTREAD_DATASET_NFL6_C'::h5ltread_dataset_nfl6_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER(size_t) :: namelen ! length of name buffer - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - REAL, INTENT(inout), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)) :: buf ! data buffer - END FUNCTION h5ltread_dataset_nfl6_c - END INTERFACE - - namelen = LEN(dset_name) - errcode = h5ltread_dataset_nfl6_c(loc_id,namelen,dset_name,H5T_NATIVE_REAL,buf,dims) - - END SUBROUTINE h5ltread_dataset_float_f_6 - - !------------------------------------------------------------------------- - ! Function: h5ltread_dataset_float_f_7 - ! - ! Purpose: Read a dataset - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: M. Scot Breitenfeld - ! - ! Date: March 8, 2011 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - - SUBROUTINE h5ltread_dataset_float_f_7(loc_id, dset_name, buf, dims, errcode ) - - IMPLICIT NONE - - ! - !This definition is needed for Windows DLLs - !DEC$if defined(BUILD_HDF5_HL_DLL) - !DEC$attributes dllexport :: h5ltread_dataset_float_f_7 - !DEC$endif - ! - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - REAL, INTENT(inout), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)) :: buf ! data buffer - - INTERFACE - INTEGER FUNCTION h5ltread_dataset_nfl7_c(loc_id,namelen,dset_name,type_id,buf,dims) - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LTREAD_DATASET_NFL7_C'::h5ltread_dataset_nfl7_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER(size_t) :: namelen ! length of name buffer - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - REAL, INTENT(inout), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)) :: buf ! data buffer - END FUNCTION h5ltread_dataset_nfl7_c - END INTERFACE - - namelen = LEN(dset_name) - errcode = h5ltread_dataset_nfl7_c(loc_id,namelen,dset_name,H5T_NATIVE_REAL,buf,dims) - - END SUBROUTINE h5ltread_dataset_float_f_7 - - !------------------------------------------------------------------------- - ! Function: h5ltread_dataset_double_f_1 - ! - ! Purpose: Read a dataset - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: pvn@ncsa.uiuc.edu - ! - ! Date: September 22, 2004 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - - SUBROUTINE h5ltread_dataset_double_f_1(loc_id,& - dset_name,& - buf,& - dims,& - errcode ) - - IMPLICIT NONE - - ! - !This definition is needed for Windows DLLs - !DEC$if defined(BUILD_HDF5_HL_DLL) - !DEC$attributes dllexport :: h5ltread_dataset_double_f_1 - !DEC$endif - ! - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - DOUBLE PRECISION, INTENT(inout), & - DIMENSION(dims(1)) :: buf ! data buffer - - INTERFACE - INTEGER FUNCTION h5ltread_dataset_ndl1_c(loc_id,namelen,dset_name,type_id,buf,dims) - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LTREAD_DATASET_NDL1_C'::h5ltread_dataset_ndl1_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER(size_t) :: namelen ! length of name buffer - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - DOUBLE PRECISION, INTENT(inout), & - DIMENSION(dims(1)) :: buf ! data buffer - END FUNCTION h5ltread_dataset_ndl1_c - END INTERFACE - - namelen = LEN(dset_name) - errcode = h5ltread_dataset_ndl1_c(loc_id,namelen,dset_name,H5T_NATIVE_DOUBLE,buf,dims) - - END SUBROUTINE h5ltread_dataset_double_f_1 - - - !------------------------------------------------------------------------- - ! Function: h5ltread_dataset_double_f_2 - ! - ! Purpose: Read a dataset - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: pvn@ncsa.uiuc.edu - ! - ! Date: September 22, 2004 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - - SUBROUTINE h5ltread_dataset_double_f_2(loc_id,& - dset_name,& - buf,& - dims,& - errcode ) - - IMPLICIT NONE - - ! - !This definition is needed for Windows DLLs - !DEC$if defined(BUILD_HDF5_HL_DLL) - !DEC$attributes dllexport :: h5ltread_dataset_double_f_2 - !DEC$endif - ! - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - DOUBLE PRECISION, INTENT(inout), & - DIMENSION(dims(1),dims(2)) :: buf ! data buffer - - INTERFACE - INTEGER FUNCTION h5ltread_dataset_ndl2_c(loc_id,namelen,dset_name,type_id,buf,dims) - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LTREAD_DATASET_NDL2_C'::h5ltread_dataset_ndl2_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER(size_t) :: namelen ! length of name buffer - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - DOUBLE PRECISION, INTENT(inout), & - DIMENSION(dims(1),dims(2)) :: buf ! data buffer - END FUNCTION h5ltread_dataset_ndl2_c - END INTERFACE - - namelen = LEN(dset_name) - errcode = h5ltread_dataset_ndl2_c(loc_id,namelen,dset_name,H5T_NATIVE_DOUBLE,buf,dims) - - END SUBROUTINE h5ltread_dataset_double_f_2 - - !------------------------------------------------------------------------- - ! Function: h5ltread_dataset_double_f_3 - ! - ! Purpose: Read a dataset - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: pvn@ncsa.uiuc.edu - ! - ! Date: September 22, 2004 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - - SUBROUTINE h5ltread_dataset_double_f_3(loc_id,& - dset_name,& - buf,& - dims,& - errcode ) - - IMPLICIT NONE - - ! - !This definition is needed for Windows DLLs - !DEC$if defined(BUILD_HDF5_HL_DLL) - !DEC$attributes dllexport :: h5ltread_dataset_double_f_3 - !DEC$endif - ! - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - DOUBLE PRECISION, INTENT(inout), & - DIMENSION(dims(1),dims(2),dims(3)) :: buf ! data buffer - - INTERFACE - INTEGER FUNCTION h5ltread_dataset_ndl3_c(loc_id,namelen,dset_name,type_id,buf,dims) - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LTREAD_DATASET_NDL3_C'::h5ltread_dataset_ndl3_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER(size_t) :: namelen ! length of name buffer - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - DOUBLE PRECISION, INTENT(inout), & - DIMENSION(dims(1),dims(2),dims(3)) :: buf ! data buffer - END FUNCTION h5ltread_dataset_ndl3_c - END INTERFACE - - namelen = LEN(dset_name) - errcode = h5ltread_dataset_ndl3_c(loc_id,namelen,dset_name,H5T_NATIVE_DOUBLE,buf,dims) - - END SUBROUTINE h5ltread_dataset_double_f_3 - - !------------------------------------------------------------------------- - ! Function: h5ltread_dataset_double_f_4 - ! - ! Purpose: Read a dataset - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: M. Scot Breitenfeld - ! - ! Date: March 8, 2011 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - - SUBROUTINE h5ltread_dataset_double_f_4(loc_id, dset_name, buf, dims, errcode ) - - IMPLICIT NONE - - ! - !This definition is needed for Windows DLLs - !DEC$if defined(BUILD_HDF5_HL_DLL) - !DEC$attributes dllexport :: h5ltread_dataset_double_f_4 - !DEC$endif - ! - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - DOUBLE PRECISION, INTENT(inout), & - DIMENSION(dims(1),dims(2),dims(3),dims(4)) :: buf ! data buffer - - INTERFACE - INTEGER FUNCTION h5ltread_dataset_ndl4_c(loc_id,namelen,dset_name,type_id,buf,dims) - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LTREAD_DATASET_NDL4_C'::h5ltread_dataset_ndl4_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER(size_t) :: namelen ! length of name buffer - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - DOUBLE PRECISION, INTENT(inout), & - DIMENSION(dims(1),dims(2),dims(3),dims(4)) :: buf ! data buffer - END FUNCTION h5ltread_dataset_ndl4_c - END INTERFACE - - namelen = LEN(dset_name) - errcode = h5ltread_dataset_ndl4_c(loc_id,namelen,dset_name,H5T_NATIVE_DOUBLE,buf,dims) - - END SUBROUTINE h5ltread_dataset_double_f_4 - - !------------------------------------------------------------------------- - ! Function: h5ltread_dataset_double_f_5 - ! - ! Purpose: Read a dataset - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: M. Scot Breitenfeld - ! - ! Date: March 8, 2011 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - - SUBROUTINE h5ltread_dataset_double_f_5(loc_id, dset_name, buf, dims, errcode ) - - IMPLICIT NONE - - ! - !This definition is needed for Windows DLLs - !DEC$if defined(BUILD_HDF5_HL_DLL) - !DEC$attributes dllexport :: h5ltread_dataset_double_f_5 - !DEC$endif - ! - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - DOUBLE PRECISION, INTENT(inout), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) :: buf ! data buffer - - INTERFACE - INTEGER FUNCTION h5ltread_dataset_ndl5_c(loc_id,namelen,dset_name,type_id,buf,dims) - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LTREAD_DATASET_NDL5_C'::h5ltread_dataset_ndl5_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER(size_t) :: namelen ! length of name buffer - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - DOUBLE PRECISION, INTENT(inout), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) :: buf ! data buffer - END FUNCTION h5ltread_dataset_ndl5_c - END INTERFACE - - namelen = LEN(dset_name) - errcode = h5ltread_dataset_ndl5_c(loc_id,namelen,dset_name,H5T_NATIVE_DOUBLE,buf,dims) - - END SUBROUTINE h5ltread_dataset_double_f_5 - - !------------------------------------------------------------------------- - ! Function: h5ltread_dataset_double_f_6 - ! - ! Purpose: Read a dataset - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: M. Scot Breitenfeld - ! - ! Date: March 8, 2011 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - - SUBROUTINE h5ltread_dataset_double_f_6(loc_id, dset_name, buf, dims, errcode ) - - IMPLICIT NONE - - ! - !This definition is needed for Windows DLLs - !DEC$if defined(BUILD_HDF5_HL_DLL) - !DEC$attributes dllexport :: h5ltread_dataset_double_f_6 - !DEC$endif - ! - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - DOUBLE PRECISION, INTENT(inout), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)) :: buf ! data buffer - - INTERFACE - INTEGER FUNCTION h5ltread_dataset_ndl6_c(loc_id,namelen,dset_name,type_id,buf,dims) - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LTREAD_DATASET_NDL6_C'::h5ltread_dataset_ndl6_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER(size_t) :: namelen ! length of name buffer - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - DOUBLE PRECISION, INTENT(inout), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)) :: buf ! data buffer - END FUNCTION h5ltread_dataset_ndl6_c - END INTERFACE - - namelen = LEN(dset_name) - errcode = h5ltread_dataset_ndl6_c(loc_id,namelen,dset_name,H5T_NATIVE_DOUBLE,buf,dims) - - END SUBROUTINE h5ltread_dataset_double_f_6 - - !------------------------------------------------------------------------- - ! Function: h5ltread_dataset_double_f_7 - ! - ! Purpose: Read a dataset - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: M. Scot Breitenfeld - ! - ! Date: March 8, 2011 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - - SUBROUTINE h5ltread_dataset_double_f_7(loc_id, dset_name, buf, dims, errcode ) - - IMPLICIT NONE - - ! - !This definition is needed for Windows DLLs - !DEC$if defined(BUILD_HDF5_HL_DLL) - !DEC$attributes dllexport :: h5ltread_dataset_double_f_7 - !DEC$endif - ! - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - DOUBLE PRECISION, INTENT(inout), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)) :: buf ! data buffer - - INTERFACE - INTEGER FUNCTION h5ltread_dataset_ndl7_c(loc_id,namelen,dset_name,type_id,buf,dims) - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LTREAD_DATASET_NDL7_C'::h5ltread_dataset_ndl7_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - INTEGER(hid_t), INTENT(in) :: type_id ! datatype identifier - INTEGER(size_t) :: namelen ! length of name buffer - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims ! size of the buffer buf - DOUBLE PRECISION, INTENT(inout), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)) :: buf ! data buffer - END FUNCTION h5ltread_dataset_ndl7_c - END INTERFACE - - namelen = LEN(dset_name) - errcode = h5ltread_dataset_ndl7_c(loc_id,namelen,dset_name,H5T_NATIVE_DOUBLE,buf,dims) - - END SUBROUTINE h5ltread_dataset_double_f_7 - - - !------------------------------------------------------------------------- - ! Function: h5ltmake_dataset_string_f - ! - ! Purpose: Creates and writes a dataset - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: pvn@ncsa.uiuc.edu - ! - ! Date: September 22, 2004 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - - SUBROUTINE h5ltmake_dataset_string_f(loc_id,& - dset_name,& - buf,& - errcode ) - - IMPLICIT NONE - ! - !This definition is needed for Windows DLLs - !DEC$if defined(BUILD_HDF5_HL_DLL) - !DEC$attributes dllexport :: h5ltmake_dataset_string_f - !DEC$endif - ! - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - CHARACTER(len=*), INTENT(in) :: buf ! data buffer - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - INTEGER(size_t) :: buflen ! buffer length - - INTERFACE - INTEGER FUNCTION h5ltmake_dataset_string_c(loc_id,namelen,dset_name,buflen,buf) - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LTMAKE_DATASET_STRING_C'::h5ltmake_dataset_string_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - INTEGER(size_t) :: namelen ! length of name buffer - INTEGER(size_t) :: buflen ! length of data buffer - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - CHARACTER(len=*), INTENT(in) :: buf ! data buffer - END FUNCTION h5ltmake_dataset_string_c - END INTERFACE - - namelen = LEN(dset_name) - buflen = LEN(buf) - errcode = h5ltmake_dataset_string_c(loc_id,namelen,dset_name,buflen,buf) - - END SUBROUTINE h5ltmake_dataset_string_f - - !------------------------------------------------------------------------- - ! Function: h5ltread_dataset_string_f - ! - ! Purpose: Read a dataset - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: pvn@ncsa.uiuc.edu - ! - ! Date: September 22, 2004 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - - SUBROUTINE h5ltread_dataset_string_f(loc_id,& - dset_name,& - buf,& - errcode ) - - IMPLICIT NONE - - ! - !This definition is needed for Windows DLLs - !DEC$if defined(BUILD_HDF5_HL_DLL) - !DEC$attributes dllexport :: h5ltread_dataset_string_f - !DEC$endif - ! - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - CHARACTER(len=*), INTENT(inout) :: buf ! data buffer - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - - INTERFACE - INTEGER FUNCTION h5ltread_dataset_string_c(loc_id,namelen,dset_name,buf) - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LTREAD_DATASET_STRING_C'::h5ltread_dataset_string_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - INTEGER(size_t) :: namelen ! length of name buffer - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - CHARACTER(len=*), INTENT(inout) :: buf ! data buffer - END FUNCTION h5ltread_dataset_string_c - END INTERFACE - - namelen = LEN(dset_name) - errcode = h5ltread_dataset_string_c(loc_id,namelen,dset_name,buf) - - END SUBROUTINE h5ltread_dataset_string_f - - - - - !------------------------------------------------------------------------- - ! Make/Read attribute functions - !------------------------------------------------------------------------- - - - !------------------------------------------------------------------------- - ! Function: h5ltset_attribute_int_f - ! - ! Purpose: Create and write an attribute - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: pvn@ncsa.uiuc.edu - ! - ! Date: October 05, 2004 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - - SUBROUTINE h5ltset_attribute_int_f(loc_id,& - dset_name,& - attr_name,& - buf,& - size,& - errcode ) - - IMPLICIT NONE - - ! - !This definition is needed for Windows DLLs - !DEC$if defined(BUILD_HDF5_HL_DLL) - !DEC$attributes dllexport :: h5ltset_attribute_int_f - !DEC$endif - ! - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - CHARACTER(len=*), INTENT(in) :: attr_name ! name of the attribute - INTEGER(size_t), INTENT(in) :: size ! size of attribute array - INTEGER :: errcode ! error code - INTEGER, INTENT(in), DIMENSION(*) :: buf ! data buffer - INTEGER(size_t) :: namelen ! name length - INTEGER(size_t) :: attrlen ! name length - - INTERFACE - INTEGER FUNCTION h5ltset_attribute_int_c(loc_id,namelen,dset_name,attrlen,attr_name,size,buf) - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LTSET_ATTRIBUTE_INT_C'::h5ltset_attribute_int_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - !DEC$ATTRIBUTES reference :: attr_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - INTEGER(size_t) :: namelen ! length of name buffer - INTEGER(size_t) :: attrlen ! length of attr name buffer - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - CHARACTER(len=*), INTENT(in) :: attr_name ! name of the attribute - INTEGER(size_t), INTENT(in) :: size ! size of attribute array - INTEGER, INTENT(in), DIMENSION(*) :: buf ! data buffer - END FUNCTION h5ltset_attribute_int_c - END INTERFACE - - namelen = LEN(dset_name) - attrlen = LEN(attr_name) - errcode = h5ltset_attribute_int_c(loc_id,namelen,dset_name,attrlen,attr_name,size,buf) - - END SUBROUTINE h5ltset_attribute_int_f - - !------------------------------------------------------------------------- - ! Function: h5ltset_attribute_float_f - ! - ! Purpose: Create and write an attribute - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: pvn@ncsa.uiuc.edu - ! - ! Date: October 05, 2004 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - - SUBROUTINE h5ltset_attribute_float_f(loc_id,& - dset_name,& - attr_name,& - buf,& - size,& - errcode ) - - IMPLICIT NONE - - ! - !This definition is needed for Windows DLLs - !DEC$if defined(BUILD_HDF5_HL_DLL) - !DEC$attributes dllexport :: h5ltset_attribute_float_f - !DEC$endif - ! - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - CHARACTER(len=*), INTENT(in) :: attr_name ! name of the attribute - INTEGER(size_t), INTENT(in) :: size ! size of attribute array - INTEGER :: errcode ! error code - REAL, INTENT(in), DIMENSION(*) :: buf ! data buffer - INTEGER(size_t) :: namelen ! name length - INTEGER(size_t) :: attrlen ! name length - - INTERFACE - INTEGER FUNCTION h5ltset_attribute_float_c(loc_id,namelen,dset_name,attrlen,attr_name,size,buf) - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LTSET_ATTRIBUTE_FLOAT_C'::h5ltset_attribute_float_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - !DEC$ATTRIBUTES reference :: attr_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - INTEGER(size_t) :: namelen ! length of name buffer - INTEGER(size_t) :: attrlen ! length of attr name buffer - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - CHARACTER(len=*), INTENT(in) :: attr_name ! name of the attribute - INTEGER(size_t), INTENT(in) :: size ! size of attribute array - REAL, INTENT(in), DIMENSION(*) :: buf ! data buffer - END FUNCTION h5ltset_attribute_float_c - END INTERFACE - - namelen = LEN(dset_name) - attrlen = LEN(attr_name) - errcode = h5ltset_attribute_float_c(loc_id,namelen,dset_name,attrlen,attr_name,size,buf) - - END SUBROUTINE h5ltset_attribute_float_f - - !------------------------------------------------------------------------- - ! Function: h5ltset_attribute_double_f - ! - ! Purpose: Create and write an attribute - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: pvn@ncsa.uiuc.edu - ! - ! Date: October 05, 2004 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - - SUBROUTINE h5ltset_attribute_double_f(loc_id,& - dset_name,& - attr_name,& - buf,& - size,& - errcode ) - - IMPLICIT NONE - - ! - !This definition is needed for Windows DLLs - !DEC$if defined(BUILD_HDF5_HL_DLL) - !DEC$attributes dllexport :: h5ltset_attribute_double_f - !DEC$endif - ! - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - CHARACTER(len=*), INTENT(in) :: attr_name ! name of the attribute - INTEGER(size_t), INTENT(in) :: size ! size of attribute array - INTEGER :: errcode ! error code - DOUBLE PRECISION, INTENT(in), DIMENSION(*) :: buf ! data buffer - INTEGER(size_t) :: namelen ! name length - INTEGER(size_t) :: attrlen ! name length - - INTERFACE - INTEGER FUNCTION h5ltset_attribute_double_c(loc_id,namelen,dset_name,attrlen,attr_name,size,buf) - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LTSET_ATTRIBUTE_DOUBLE_C'::h5ltset_attribute_double_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - !DEC$ATTRIBUTES reference :: attr_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - INTEGER(size_t) :: namelen ! length of name buffer - INTEGER(size_t) :: attrlen ! length of attr name buffer - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - CHARACTER(len=*), INTENT(in) :: attr_name ! name of the attribute - INTEGER(size_t), INTENT(in) :: size ! size of attribute array - DOUBLE PRECISION, INTENT(in), DIMENSION(*) :: buf ! data buffer - END FUNCTION h5ltset_attribute_double_c - END INTERFACE - - namelen = LEN(dset_name) - attrlen = LEN(attr_name) - errcode = h5ltset_attribute_double_c(loc_id,namelen,dset_name,attrlen,attr_name,size,buf) - - END SUBROUTINE h5ltset_attribute_double_f - - - !------------------------------------------------------------------------- - ! Function: h5ltset_attribute_string_f - ! - ! Purpose: Create and write an attribute - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: pvn@ncsa.uiuc.edu - ! - ! Date: October 05, 2004 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - - SUBROUTINE h5ltset_attribute_string_f(loc_id,& - dset_name,& - attr_name,& - buf,& - errcode ) - - IMPLICIT NONE - - ! - !This definition is needed for Windows DLLs - !DEC$if defined(BUILD_HDF5_HL_DLL) - !DEC$attributes dllexport :: h5ltset_attribute_string_f - !DEC$endif - ! - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - CHARACTER(len=*), INTENT(in) :: attr_name ! name of the attribute - INTEGER :: errcode ! error code - CHARACTER(len=*), INTENT(in) :: buf ! data buffer - INTEGER(size_t) :: namelen ! name length - INTEGER(size_t) :: attrlen ! name length - INTEGER(size_t) :: buflen ! data buffer length - - INTERFACE - INTEGER FUNCTION h5ltset_attribute_string_c(loc_id,namelen,dset_name,attrlen,attr_name,buflen,buf) - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LTSET_ATTRIBUTE_STRING_C'::h5ltset_attribute_string_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - !DEC$ATTRIBUTES reference :: attr_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - INTEGER(size_t) :: namelen ! length of name buffer - INTEGER(size_t) :: attrlen ! length of attr name buffer - INTEGER(size_t) :: buflen ! data buffer length - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - CHARACTER(len=*), INTENT(in) :: attr_name ! name of the attribute - CHARACTER(len=*), INTENT(in) :: buf ! data buffer - END FUNCTION h5ltset_attribute_string_c - END INTERFACE - - namelen = LEN(dset_name) - attrlen = LEN(attr_name) - buflen = LEN(buf) - errcode = h5ltset_attribute_string_c(loc_id,namelen,dset_name,attrlen,attr_name,buflen,buf) - - END SUBROUTINE h5ltset_attribute_string_f - - - - !------------------------------------------------------------------------- - ! Function: h5ltget_attribute_int_f - ! - ! Purpose: Reads an attribute named ATTR_NAME - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: pvn@ncsa.uiuc.edu - ! - ! Date: October 05, 2004 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - - SUBROUTINE h5ltget_attribute_int_f(loc_id,& - dset_name,& - attr_name,& - buf,& - errcode ) - - IMPLICIT NONE - - ! - !This definition is needed for Windows DLLs - !DEC$if defined(BUILD_HDF5_HL_DLL) - !DEC$attributes dllexport :: h5ltget_attribute_int_f - !DEC$endif - ! - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - CHARACTER(len=*), INTENT(in) :: attr_name ! name of the attribute - INTEGER :: errcode ! error code - INTEGER, INTENT(inout), DIMENSION(*) :: buf ! data buffer - INTEGER(size_t) :: namelen ! name length - INTEGER(size_t) :: attrlen ! name length - - INTERFACE - INTEGER FUNCTION h5ltget_attribute_int_c(loc_id,namelen,dset_name,attrlen,attr_name,buf) - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LTGET_ATTRIBUTE_INT_C'::h5ltget_attribute_int_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - !DEC$ATTRIBUTES reference :: attr_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - INTEGER(size_t) :: namelen ! length of name buffer - INTEGER(size_t) :: attrlen ! length of attr name buffer - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - CHARACTER(len=*), INTENT(in) :: attr_name ! name of the attribute - INTEGER, INTENT(inout), DIMENSION(*) :: buf ! data buffer - END FUNCTION h5ltget_attribute_int_c - END INTERFACE - - namelen = LEN(dset_name) - attrlen = LEN(attr_name) - errcode = h5ltget_attribute_int_c(loc_id,namelen,dset_name,attrlen,attr_name,buf) - - END SUBROUTINE h5ltget_attribute_int_f - - - !------------------------------------------------------------------------- - ! Function: h5ltget_attribute_float_f - ! - ! Purpose: Reads an attribute named ATTR_NAME - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: pvn@ncsa.uiuc.edu - ! - ! Date: October 05, 2004 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - - SUBROUTINE h5ltget_attribute_float_f(loc_id,& - dset_name,& - attr_name,& - buf,& - errcode ) - - IMPLICIT NONE - - ! - !This definition is needed for Windows DLLs - !DEC$if defined(BUILD_HDF5_HL_DLL) - !DEC$attributes dllexport :: h5ltget_attribute_float_f - !DEC$endif - ! - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - CHARACTER(len=*), INTENT(in) :: attr_name ! name of the attribute - INTEGER :: errcode ! error code - REAL, INTENT(inout), DIMENSION(*) :: buf ! data buffer - INTEGER(size_t) :: namelen ! name length - INTEGER(size_t) :: attrlen ! name length - - INTERFACE - INTEGER FUNCTION h5ltget_attribute_float_c(loc_id,namelen,dset_name,attrlen,attr_name,buf) - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LTGET_ATTRIBUTE_FLOAT_C'::h5ltget_attribute_float_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - !DEC$ATTRIBUTES reference :: attr_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - INTEGER(size_t) :: namelen ! length of name buffer - INTEGER(size_t) :: attrlen ! length of attr name buffer - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - CHARACTER(len=*), INTENT(in) :: attr_name ! name of the attribute - REAL, INTENT(inout), DIMENSION(*) :: buf ! data buffer - END FUNCTION h5ltget_attribute_float_c - END INTERFACE - - namelen = LEN(dset_name) - attrlen = LEN(attr_name) - errcode = h5ltget_attribute_float_c(loc_id,namelen,dset_name,attrlen,attr_name,buf) - - END SUBROUTINE h5ltget_attribute_float_f - - !------------------------------------------------------------------------- - ! Function: h5ltget_attribute_double_f - ! - ! Purpose: Reads an attribute named ATTR_NAME - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: pvn@ncsa.uiuc.edu - ! - ! Date: October 05, 2004 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - - SUBROUTINE h5ltget_attribute_double_f(loc_id,& - dset_name,& - attr_name,& - buf,& - errcode ) - - IMPLICIT NONE - - ! - !This definition is needed for Windows DLLs - !DEC$if defined(BUILD_HDF5_HL_DLL) - !DEC$attributes dllexport :: h5ltget_attribute_double_f - !DEC$endif - ! - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - CHARACTER(len=*), INTENT(in) :: attr_name ! name of the attribute - INTEGER :: errcode ! error code - DOUBLE PRECISION,INTENT(inout),DIMENSION(*) :: buf ! data buffer - INTEGER(size_t) :: namelen ! name length - INTEGER(size_t) :: attrlen ! name length - - INTERFACE - INTEGER FUNCTION h5ltget_attribute_double_c(loc_id,namelen,dset_name,attrlen,attr_name,buf) - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LTGET_ATTRIBUTE_DOUBLE_C'::h5ltget_attribute_double_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - !DEC$ATTRIBUTES reference :: attr_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - INTEGER(size_t) :: namelen ! length of name buffer - INTEGER(size_t) :: attrlen ! length of attr name buffer - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - CHARACTER(len=*), INTENT(in) :: attr_name ! name of the attribute - DOUBLE PRECISION, INTENT(inout), DIMENSION(*) :: buf ! data buffer - END FUNCTION h5ltget_attribute_double_c - END INTERFACE - - namelen = LEN(dset_name) - attrlen = LEN(attr_name) - errcode = h5ltget_attribute_double_c(loc_id,namelen,dset_name,attrlen,attr_name,buf) - - END SUBROUTINE h5ltget_attribute_double_f - - !------------------------------------------------------------------------- - ! Function: h5ltget_attribute_string_f - ! - ! Purpose: Reads an attribute named ATTR_NAME - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: pvn@ncsa.uiuc.edu - ! - ! Date: October 05, 2004 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - - SUBROUTINE h5ltget_attribute_string_f(loc_id,& - dset_name,& - attr_name,& - buf,& - errcode ) - - IMPLICIT NONE - - ! - !This definition is needed for Windows DLLs - !DEC$if defined(BUILD_HDF5_HL_DLL) - !DEC$attributes dllexport :: h5ltget_attribute_string_f - !DEC$endif - ! - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - CHARACTER(len=*), INTENT(in) :: attr_name ! name of the attribute - INTEGER :: errcode ! error code - CHARACTER(len=*), INTENT(inout) :: buf ! data buffer - INTEGER(size_t) :: namelen ! name length - INTEGER(size_t) :: attrlen ! name length - INTEGER(size_t) :: buf_size ! buf size - - INTERFACE - INTEGER FUNCTION h5ltget_attribute_string_c(loc_id,namelen,dset_name,attrlen,attr_name,buf,buf_size) - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LTGET_ATTRIBUTE_STRING_C'::h5ltget_attribute_string_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - !DEC$ATTRIBUTES reference :: attr_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - INTEGER(size_t) :: namelen ! length of name buffer - INTEGER(size_t) :: attrlen ! length of attr name buffer - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - CHARACTER(len=*), INTENT(in) :: attr_name ! name of the attribute - CHARACTER(len=*), INTENT(inout) :: buf ! data buffer - INTEGER(size_t) :: buf_size ! data buffer size - END FUNCTION h5ltget_attribute_string_c - END INTERFACE - - namelen = LEN(dset_name) - attrlen = LEN(attr_name) - buf_size = LEN(buf) - - errcode = h5ltget_attribute_string_c(loc_id,namelen,dset_name,attrlen,attr_name,buf,buf_size) - - END SUBROUTINE h5ltget_attribute_string_f - - !------------------------------------------------------------------------- - ! Query dataset functions - !------------------------------------------------------------------------- - - !------------------------------------------------------------------------- - ! Function: h5ltget_dataset_ndims_f - ! - ! Purpose: Gets the dimensionality of a dataset - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: pvn@ncsa.uiuc.edu - ! - ! Date: September 30, 2004 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - - SUBROUTINE h5ltget_dataset_ndims_f(loc_id,& - dset_name,& - rank,& - errcode ) - - IMPLICIT NONE - - ! - !This definition is needed for Windows DLLs - !DEC$if defined(BUILD_HDF5_HL_DLL) - !DEC$attributes dllexport :: h5ltget_dataset_ndims_f - !DEC$endif - ! - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(inout) :: rank ! rank - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - - INTERFACE - INTEGER FUNCTION h5ltget_dataset_ndims_c(loc_id,namelen,dset_name,rank) - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LTGET_DATASET_NDIMS_C'::h5ltget_dataset_ndims_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - INTEGER(size_t) :: namelen ! length of name buffer - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(inout) :: rank ! rank - END FUNCTION h5ltget_dataset_ndims_c - END INTERFACE - - namelen = LEN(dset_name) - errcode = h5ltget_dataset_ndims_c(loc_id,namelen,dset_name,rank) - - END SUBROUTINE h5ltget_dataset_ndims_f - - - !------------------------------------------------------------------------- - ! Function: h5ltfind_dataset_f - ! - ! Purpose: Inquires if a dataset named dset_name exists attached - ! to the object loc_id. - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: pvn@ncsa.uiuc.edu - ! - ! Date: October 05, 2004 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - - INTEGER FUNCTION h5ltfind_dataset_f(loc_id,& - dset_name) - - IMPLICIT NONE - - ! - !This definition is needed for Windows DLLs - !DEC$if defined(BUILD_HDF5_HL_DLL) - !DEC$attributes dllexport :: h5ltfind_dataset_f - !DEC$endif - ! - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - - INTERFACE - INTEGER FUNCTION h5ltfind_dataset_c(loc_id,namelen,dset_name) - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LTFIND_DATASET_C'::h5ltfind_dataset_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - INTEGER(size_t) :: namelen ! length of name buffer - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - END FUNCTION h5ltfind_dataset_c - END INTERFACE - - namelen = LEN(dset_name) - errcode = h5ltfind_dataset_c(loc_id,namelen,dset_name) - h5ltfind_dataset_f = errcode - - END FUNCTION h5ltfind_dataset_f - - !------------------------------------------------------------------------- - ! Function: h5ltget_dataset_info_f - ! - ! Purpose: Gets information about a dataset - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: pvn@ncsa.uiuc.edu - ! - ! Date: September 30, 2004 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - - SUBROUTINE h5ltget_dataset_info_f(loc_id,& - dset_name,& - dims,& - type_class,& - type_size,& - errcode ) - - IMPLICIT NONE - - ! - !This definition is needed for Windows DLLs - !DEC$if defined(BUILD_HDF5_HL_DLL) - !DEC$attributes dllexport :: h5ltget_dataset_info_f - !DEC$endif - ! - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hsize_t),DIMENSION(*),INTENT(inout):: dims ! dimensions - INTEGER, INTENT(inout) :: type_class ! type class - INTEGER(size_t), INTENT(inout) :: type_size ! type size - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - - INTERFACE - INTEGER FUNCTION h5ltget_dataset_info_c(loc_id,namelen,dset_name,dims,type_class,type_size) - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LTGET_DATASET_INFO_C'::h5ltget_dataset_info_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - INTEGER(size_t) :: namelen ! length of name buffer - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hsize_t),DIMENSION(*),INTENT(inout):: dims ! dimensions - INTEGER, INTENT(inout) :: type_class ! type class - INTEGER(size_t), INTENT(inout) :: type_size ! type size - END FUNCTION h5ltget_dataset_info_c - END INTERFACE - - namelen = LEN(dset_name) - errcode = h5ltget_dataset_info_c(loc_id,namelen,dset_name,dims,type_class,type_size) - - END SUBROUTINE h5ltget_dataset_info_f - - - !------------------------------------------------------------------------- - ! Query attribute functions - !------------------------------------------------------------------------- - - - !------------------------------------------------------------------------- - ! Function: h5ltget_attribute_ndims_f - ! - ! Purpose: Create and write an attribute - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: pvn@ncsa.uiuc.edu - ! - ! Date: October 05, 2004 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - - SUBROUTINE h5ltget_attribute_ndims_f(loc_id,& - dset_name,& - attr_name,& - rank,& - errcode ) - - IMPLICIT NONE - - ! - !This definition is needed for Windows DLLs - !DEC$if defined(BUILD_HDF5_HL_DLL) - !DEC$attributes dllexport :: h5ltget_attribute_ndims_f - !DEC$endif - ! - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - CHARACTER(len=*), INTENT(in) :: attr_name ! name of the attribute - INTEGER, INTENT(inout) :: rank ! rank - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - INTEGER(size_t) :: attrlen ! name length - - INTERFACE - INTEGER FUNCTION h5ltget_attribute_ndims_c(loc_id,namelen,dset_name,attrlen,attr_name,rank) - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LTGET_ATTRIBUTE_NDIMS_C'::h5ltget_attribute_ndims_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - !DEC$ATTRIBUTES reference :: attr_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - INTEGER(size_t) :: namelen ! length of name buffer - INTEGER(size_t) :: attrlen ! length of attr name buffer - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - CHARACTER(len=*), INTENT(in) :: attr_name ! name of the attribute - INTEGER, INTENT(inout) :: rank ! rank - END FUNCTION h5ltget_attribute_ndims_c - END INTERFACE - - namelen = LEN(dset_name) - attrlen = LEN(attr_name) - errcode = h5ltget_attribute_ndims_c(loc_id,namelen,dset_name,attrlen,attr_name,rank) - - END SUBROUTINE h5ltget_attribute_ndims_f - - - !------------------------------------------------------------------------- - ! Function: h5ltget_attribute_info_f - ! - ! Purpose: Gets information about an attribute - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: pvn@ncsa.uiuc.edu - ! - ! Date: September 30, 2004 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - - SUBROUTINE h5ltget_attribute_info_f(loc_id,& - dset_name,& - attr_name,& - dims,& - type_class,& - type_size,& - errcode ) - - IMPLICIT NONE - - ! - !This definition is needed for Windows DLLs - !DEC$if defined(BUILD_HDF5_HL_DLL) - !DEC$attributes dllexport :: h5ltget_attribute_info_f - !DEC$endif - ! - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - CHARACTER(len=*), INTENT(in) :: attr_name ! name of the attribute - INTEGER(hsize_t),DIMENSION(*),INTENT(inout):: dims ! dimensions - INTEGER, INTENT(inout) :: type_class ! type class - INTEGER(size_t), INTENT(inout) :: type_size ! type size - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - INTEGER(size_t) :: attrlen ! name length - - INTERFACE - INTEGER FUNCTION h5ltget_attribute_info_c(loc_id,namelen,dset_name,attrlen,attr_name,dims,type_class,type_size) - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LTGET_ATTRIBUTE_INFO_C'::h5ltget_attribute_info_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - !DEC$ATTRIBUTES reference :: attr_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - INTEGER(size_t) :: namelen ! length of name buffer - INTEGER(size_t) :: attrlen ! length of attr name buffer - CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset - CHARACTER(len=*), INTENT(in) :: attr_name ! name of the attribute - INTEGER(hsize_t),DIMENSION(*),INTENT(inout):: dims ! dimensions - INTEGER, INTENT(inout) :: type_class ! type class - INTEGER(size_t), INTENT(inout) :: type_size ! type size - END FUNCTION h5ltget_attribute_info_c - END INTERFACE - - namelen = LEN(dset_name) - attrlen = LEN(attr_name) - errcode = h5ltget_attribute_info_c(loc_id,namelen,dset_name,attrlen,attr_name,dims,type_class,type_size) - - END SUBROUTINE h5ltget_attribute_info_f - - !------------------------------------------------------------------------- - ! Function: h5ltpath_valid_f - ! - ! Purpose: Validates a path - ! - ! Return: Success: 0, Failure: -1 - ! - ! Programmer: M. Scot Breitenfeld - ! - ! Date: February 18, 2012 - ! - ! Comments: - ! - ! Modifications: - ! - !------------------------------------------------------------------------- - - SUBROUTINE h5ltpath_valid_f(loc_id, path, check_object_valid, path_valid, errcode) - - IMPLICIT NONE - ! - !This definition is needed for Windows DLLs - !DEC$if defined(BUILD_HDF5_HL_DLL) - !DEC$attributes dllexport :: h5ltpath_valid_f - !DEC$endif - ! - INTEGER(hid_t) , INTENT(IN) :: loc_id ! An identifier of an object in the file. - CHARACTER(LEN=*), INTENT(IN) :: path ! Path to the object to check, relative to loc_id. - LOGICAL , INTENT(IN) :: check_object_valid ! Indicates whether to check if the final component - ! of the path resolves to a valid object - LOGICAL , INTENT(OUT) :: path_valid ! Object status - INTEGER , INTENT(OUT) :: errcode ! Error code: 0 on success and -1 on failure - - INTEGER(size_t) :: pathlen - INTEGER :: check_object_valid_c - INTEGER :: status - - INTERFACE - INTEGER FUNCTION h5ltpath_valid_c(loc_id, path, pathlen, check_object_valid_c) - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LTPATH_VALID_C'::h5ltpath_valid_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: path - INTEGER(hid_t), INTENT(in) :: loc_id - CHARACTER(len=*), INTENT(in) :: path - INTEGER(size_t) :: pathlen - INTEGER :: check_object_valid_c - END FUNCTION h5ltpath_valid_c - END INTERFACE - - ! Initialize - path_valid = .FALSE. - errcode = 0 - - check_object_valid_c = 0 - IF(check_object_valid) check_object_valid_c = 1 - - pathlen = LEN(path) - status = h5ltpath_valid_c(loc_id, path, pathlen, check_object_valid_c) - - IF(status.EQ.1)THEN - path_valid = .TRUE. - ELSE IF(status.LT.0)THEN - errcode = -1 - ENDIF - - END SUBROUTINE h5ltpath_valid_f - ! end - ! -END MODULE H5LT - - - - - - diff --git a/hl/fortran/src/H5TBfc.c b/hl/fortran/src/H5TBfc.c index bf058fd..99a7800 100644 --- a/hl/fortran/src/H5TBfc.c +++ b/hl/fortran/src/H5TBfc.c @@ -37,7 +37,7 @@ *------------------------------------------------------------------------- */ int_f -nh5tbmake_table_c(size_t_f *namelen1, +h5tbmake_table_c(size_t_f *namelen1, _fcd name1, hid_t_f *loc_id, size_t_f *namelen, @@ -133,7 +133,7 @@ done: HDfree(c_field_types); return ret_value; -} /* end nh5tbmake_table_c() */ +} /* end h5tbmake_table_c() */ /*------------------------------------------------------------------------- * Function: h5tbwrite_field_name_c @@ -151,7 +151,7 @@ done: *------------------------------------------------------------------------- */ int_f -nh5tbwrite_field_name_c(hid_t_f *loc_id, +h5tbwrite_field_name_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name, size_t_f *namelen1, @@ -190,65 +190,6 @@ done: return ret_value; } -int_f -nh5tbwrite_field_name_int_c(hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - size_t_f *namelen1, - _fcd field_name, - hsize_t_f *start, - hsize_t_f *nrecords, - size_t_f *type_size, - void *buf) -{ - return nh5tbwrite_field_name_c(loc_id, namelen, name, namelen1, field_name, - start, nrecords, type_size, buf); -} - -int_f -nh5tbwrite_field_name_fl_c(hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - size_t_f *namelen1, - _fcd field_name, - hsize_t_f *start, - hsize_t_f *nrecords, - size_t_f *type_size, - void *buf) -{ - return nh5tbwrite_field_name_c(loc_id, namelen, name, namelen1, field_name, - start, nrecords, type_size, buf); -} - -int_f -nh5tbwrite_field_name_dl_c(hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - size_t_f *namelen1, - _fcd field_name, - hsize_t_f *start, - hsize_t_f *nrecords, - size_t_f *type_size, - void *buf) -{ - return nh5tbwrite_field_name_c(loc_id, namelen, name, namelen1, field_name, - start, nrecords, type_size, buf); -} - -int_f -nh5tbwrite_field_name_st_c(hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - size_t_f *namelen1, - _fcd field_name, - hsize_t_f *start, - hsize_t_f *nrecords, - size_t_f *type_size, - void *buf) -{ - return nh5tbwrite_field_name_c(loc_id, namelen, name, namelen1, field_name, - start, nrecords, type_size, buf); -} /*------------------------------------------------------------------------- * Function: h5tbread_field_name_c @@ -266,7 +207,7 @@ nh5tbwrite_field_name_st_c(hid_t_f *loc_id, *------------------------------------------------------------------------- */ int_f -nh5tbread_field_name_c(hid_t_f *loc_id, +h5tbread_field_name_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name, size_t_f *namelen1, @@ -305,66 +246,6 @@ done: return ret_value; } -int_f -nh5tbread_field_name_int_c(hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - size_t_f *namelen1, - _fcd field_name, - hsize_t_f *start, - hsize_t_f *nrecords, - size_t_f *type_size, - void *buf) -{ - return nh5tbread_field_name_c(loc_id, namelen, name, namelen1, field_name, - start, nrecords, type_size, buf); -} - -int_f -nh5tbread_field_name_fl_c(hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - size_t_f *namelen1, - _fcd field_name, - hsize_t_f *start, - hsize_t_f *nrecords, - size_t_f *type_size, - void *buf) -{ - return nh5tbread_field_name_c(loc_id, namelen, name, namelen1, field_name, - start, nrecords, type_size, buf); -} - -int_f -nh5tbread_field_name_dl_c(hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - size_t_f *namelen1, - _fcd field_name, - hsize_t_f *start, - hsize_t_f *nrecords, - size_t_f *type_size, - void *buf) -{ - return nh5tbread_field_name_c(loc_id, namelen, name, namelen1, field_name, - start, nrecords, type_size, buf); -} - -int_f -nh5tbread_field_name_st_c(hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - size_t_f *namelen1, - _fcd field_name, - hsize_t_f *start, - hsize_t_f *nrecords, - size_t_f *type_size, - void *buf) -{ - return nh5tbread_field_name_c(loc_id, namelen, name, namelen1, field_name, - start, nrecords, type_size, buf); -} - /*------------------------------------------------------------------------- * Function: h5tbwrite_field_index_c * @@ -381,7 +262,7 @@ nh5tbread_field_name_st_c(hid_t_f *loc_id, *------------------------------------------------------------------------- */ int_f -nh5tbwrite_field_index_c(hid_t_f *loc_id, +h5tbwrite_field_index_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name, int_f *field_index, @@ -416,62 +297,6 @@ done: return ret_value; } -int_f -nh5tbwrite_field_index_int_c(hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - int_f *field_index, - hsize_t_f *start, - hsize_t_f *nrecords, - size_t_f *type_size, - void *buf) -{ - return nh5tbwrite_field_index_c(loc_id, namelen, name, field_index, start, - nrecords, type_size, buf); -} - -int_f -nh5tbwrite_field_index_fl_c(hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - int_f *field_index, - hsize_t_f *start, - hsize_t_f *nrecords, - size_t_f *type_size, - void *buf) -{ - return nh5tbwrite_field_index_c(loc_id, namelen, name, field_index, start, - nrecords, type_size, buf); -} - -int_f -nh5tbwrite_field_index_dl_c(hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - int_f *field_index, - hsize_t_f *start, - hsize_t_f *nrecords, - size_t_f *type_size, - void *buf) -{ - return nh5tbwrite_field_index_c(loc_id, namelen, name, field_index, start, - nrecords, type_size, buf); -} - -int_f -nh5tbwrite_field_index_st_c(hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - int_f *field_index, - hsize_t_f *start, - hsize_t_f *nrecords, - size_t_f *type_size, - void *buf) -{ - return nh5tbwrite_field_index_c(loc_id, namelen, name, field_index, start, - nrecords, type_size, buf); -} - /*------------------------------------------------------------------------- * Function: h5tbread_field_index_c * @@ -488,7 +313,7 @@ nh5tbwrite_field_index_st_c(hid_t_f *loc_id, *------------------------------------------------------------------------- */ int_f -nh5tbread_field_index_c(hid_t_f *loc_id, +h5tbread_field_index_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name, int_f *field_index, @@ -522,62 +347,6 @@ done: return ret_value; } -int_f -nh5tbread_field_index_int_c(hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - int_f *field_index, - hsize_t_f *start, - hsize_t_f *nrecords, - size_t_f *type_size, - void *buf) -{ - return nh5tbread_field_index_c(loc_id, namelen, name, field_index, start, - nrecords, type_size, buf); -} - -int_f -nh5tbread_field_index_fl_c(hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - int_f *field_index, - hsize_t_f *start, - hsize_t_f *nrecords, - size_t_f *type_size, - void *buf) -{ - return nh5tbread_field_index_c(loc_id, namelen, name, field_index, start, - nrecords, type_size, buf); -} - -int_f -nh5tbread_field_index_dl_c(hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - int_f *field_index, - hsize_t_f *start, - hsize_t_f *nrecords, - size_t_f *type_size, - void *buf) -{ - return nh5tbread_field_index_c(loc_id, namelen, name, field_index, start, - nrecords, type_size, buf); -} - -int_f -nh5tbread_field_index_st_c(hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - int_f *field_index, - hsize_t_f *start, - hsize_t_f *nrecords, - size_t_f *type_size, - void *buf) -{ - return nh5tbread_field_index_c(loc_id, namelen, name, field_index, start, - nrecords, type_size, buf); -} - /*------------------------------------------------------------------------- * Function: h5tbinsert_field_c * @@ -594,7 +363,7 @@ nh5tbread_field_index_st_c(hid_t_f *loc_id, *------------------------------------------------------------------------- */ int_f -nh5tbinsert_field_c(hid_t_f *loc_id, +h5tbinsert_field_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name, size_t_f *namelen1, @@ -631,62 +400,6 @@ done: return ret_value; } -int_f -nh5tbinsert_field_int_c(hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - size_t_f *namelen1, - _fcd field_name, - hid_t_f *field_type, - int_f *position, - void *buf) -{ - return nh5tbinsert_field_c(loc_id, namelen, name, namelen1, field_name, - field_type, position, buf); -} - -int_f -nh5tbinsert_field_fl_c(hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - size_t_f *namelen1, - _fcd field_name, - hid_t_f *field_type, - int_f *position, - void *buf) -{ - return nh5tbinsert_field_c(loc_id, namelen, name, namelen1, field_name, - field_type, position, buf); -} - -int_f -nh5tbinsert_field_dl_c(hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - size_t_f *namelen1, - _fcd field_name, - hid_t_f *field_type, - int_f *position, - void *buf) -{ - return nh5tbinsert_field_c(loc_id, namelen, name, namelen1, field_name, - field_type, position, buf); -} - -int_f -nh5tbinsert_field_st_c(hid_t_f *loc_id, - size_t_f *namelen, - _fcd name, - size_t_f *namelen1, - _fcd field_name, - hid_t_f *field_type, - int_f *position, - void *buf) -{ - return nh5tbinsert_field_c(loc_id, namelen, name, namelen1, field_name, - field_type, position, buf); -} - /*------------------------------------------------------------------------- * Function: h5tbdelete_field_c * @@ -703,7 +416,7 @@ nh5tbinsert_field_st_c(hid_t_f *loc_id, *------------------------------------------------------------------------- */ int_f -nh5tbdelete_field_c(hid_t_f *loc_id, +h5tbdelete_field_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name, size_t_f *namelen1, @@ -752,7 +465,7 @@ done: *------------------------------------------------------------------------- */ int_f -nh5tbget_table_info_c(hid_t_f *loc_id, +h5tbget_table_info_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name, hsize_t_f *nfields, @@ -802,7 +515,7 @@ done: *------------------------------------------------------------------------- */ int_f -nh5tbget_field_info_c(hid_t_f *loc_id, +h5tbget_field_info_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name, hsize_t_f *nfields, diff --git a/hl/fortran/src/H5TBff.F90 b/hl/fortran/src/H5TBff.F90 new file mode 100644 index 0000000..448d607 --- /dev/null +++ b/hl/fortran/src/H5TBff.F90 @@ -0,0 +1,848 @@ +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! 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. * +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! +! +! This file contains FORTRAN interfaces for H5TB functions +! +! +! NOTES +! +! _____ __ __ _____ ____ _____ _______ _ _ _______ +! |_ _| \/ | __ \ / __ \| __ \__ __|/\ | \ | |__ __| +! **** | | | \ / | |__) | | | | |__) | | | / \ | \| | | | **** +! **** | | | |\/| | ___/| | | | _ / | | / /\ \ | . ` | | | **** +! **** _| |_| | | | | | |__| | | \ \ | |/ ____ \| |\ | | | **** +! |_____|_| |_|_| \____/|_| \_\ |_/_/ \_\_| \_| |_| +! +! If you add a new function here then you MUST add the function name to the +! Windows dll file 'hdf5_hl_fortrandll.def.in' in the hl/fortran/src directory. +! This is needed for Windows based operating systems. +! +#include "H5config_f.inc" + +MODULE h5tb_CONST + + USE, INTRINSIC :: ISO_C_BINDING + USE h5fortran_types + USE hdf5 + + INTERFACE h5tbwrite_field_name_f + MODULE PROCEDURE h5tbwrite_field_name_f_int + MODULE PROCEDURE h5tbwrite_field_name_f_string + END INTERFACE + + INTERFACE h5tbread_field_name_f + MODULE PROCEDURE h5tbread_field_name_f_int + MODULE PROCEDURE h5tbread_field_name_f_string + END INTERFACE + + INTERFACE h5tbwrite_field_index_f + MODULE PROCEDURE h5tbwrite_field_index_f_int + MODULE PROCEDURE h5tbwrite_field_index_f_string + END INTERFACE + + INTERFACE h5tbread_field_index_f + MODULE PROCEDURE h5tbread_field_index_f_int + MODULE PROCEDURE h5tbread_field_index_f_string + END INTERFACE + + INTERFACE h5tbinsert_field_f + MODULE PROCEDURE h5tbinsert_field_f_int + MODULE PROCEDURE h5tbinsert_field_f_string + END INTERFACE + + INTERFACE + INTEGER FUNCTION h5tbwrite_field_name_c(loc_id,namelen,dset_name,namelen1,field_name,& + start,nrecords,type_size,buf) & + BIND(C,NAME='h5tbwrite_field_name_c') + IMPORT :: C_CHAR, C_PTR + IMPORT :: HID_T, SIZE_T, HSIZE_T + IMPLICIT NONE + INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: dset_name ! name of the dataset + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: field_name ! name of the field + INTEGER(hsize_t), INTENT(in) :: start ! start record + INTEGER(hsize_t), INTENT(in) :: nrecords ! records + INTEGER(size_t), INTENT(in) :: type_size ! type size + TYPE(C_PTR), VALUE :: buf ! data buffer + INTEGER :: errcode ! error code + INTEGER(size_t) :: namelen ! name length + INTEGER(size_t) :: namelen1 ! name length + END FUNCTION h5tbwrite_field_name_c + END INTERFACE + + INTERFACE + INTEGER FUNCTION h5tbread_field_name_c(loc_id,namelen,dset_name,namelen1,field_name, & + start,nrecords,type_size,buf) & + BIND(C,NAME='h5tbread_field_name_c') + IMPORT :: C_CHAR, C_PTR + IMPORT :: HID_T, SIZE_T, HSIZE_T + IMPLICIT NONE + INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: dset_name ! name of the dataset + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: field_name ! name of the field + INTEGER(hsize_t), INTENT(in) :: start ! start record + INTEGER(hsize_t), INTENT(in) :: nrecords ! records + INTEGER(size_t), INTENT(in) :: type_size ! type size + TYPE(C_PTR), VALUE :: buf ! data buffer + INTEGER :: errcode ! error code + INTEGER(size_t) :: namelen ! name length + INTEGER(size_t) :: namelen1 ! name length + END FUNCTION h5tbread_field_name_c + END INTERFACE + + INTERFACE + INTEGER FUNCTION h5tbwrite_field_index_c(loc_id,namelen,dset_name,field_index,& + start,nrecords,type_size,buf) & + BIND(C,NAME='h5tbwrite_field_index_c') + IMPORT :: C_CHAR, C_PTR + IMPORT :: HID_T, SIZE_T, HSIZE_T + IMPLICIT NONE + INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: dset_name ! name of the dataset + INTEGER, INTENT(in) :: field_index ! index + INTEGER(hsize_t), INTENT(in) :: start ! start record + INTEGER(hsize_t), INTENT(in) :: nrecords ! records + INTEGER(size_t), INTENT(in) :: type_size ! type size + TYPE(C_PTR), VALUE :: buf ! data buffer + INTEGER :: errcode ! error code + INTEGER(size_t) :: namelen ! name length + END FUNCTION h5tbwrite_field_index_c + END INTERFACE + + INTERFACE + INTEGER FUNCTION h5tbread_field_index_c(loc_id,namelen,dset_name,field_index,& + start,nrecords,type_size,buf) & + BIND(C,NAME='h5tbread_field_index_c') + IMPORT :: C_CHAR, C_PTR + IMPORT :: HID_T, SIZE_T, HSIZE_T + IMPLICIT NONE + INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: dset_name ! name of the dataset + INTEGER, INTENT(in) :: field_index ! index + INTEGER(hsize_t), INTENT(in) :: start ! start record + INTEGER(hsize_t), INTENT(in) :: nrecords ! records + INTEGER(size_t), INTENT(in) :: type_size ! type size + TYPE(C_PTR), VALUE :: buf ! data buffer + INTEGER :: errcode ! error code + INTEGER(size_t) :: namelen ! name length + END FUNCTION h5tbread_field_index_c + END INTERFACE + + + INTERFACE + INTEGER FUNCTION h5tbinsert_field_c(loc_id,namelen,dset_name,namelen1,field_name,& + field_type,field_index,buf) & + BIND(C,NAME='h5tbinsert_field_c') + IMPORT :: C_CHAR, C_PTR + IMPORT :: HID_T, SIZE_T, HSIZE_T + IMPLICIT NONE + INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: dset_name ! name of the dataset + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: field_name ! name of the field + INTEGER(hid_t), INTENT(in) :: field_type ! field type + INTEGER, INTENT(in) :: field_index ! field_index + TYPE(C_PTR), VALUE :: buf ! data buffer + INTEGER(size_t) :: namelen ! name length + INTEGER(size_t) :: namelen1 ! name length length + END FUNCTION h5tbinsert_field_c + END INTERFACE + +CONTAINS + +!------------------------------------------------------------------------- +! Function: h5tbmake_table_f +! +! Purpose: Make a table +! +! Return: Success: 0, Failure: -1 +! +! Programmer: pvn@ncsa.uiuc.edu +! +! Date: October 06, 2004 +! +! Comments: +! +! Modifications: +! +!------------------------------------------------------------------------- + + SUBROUTINE h5tbmake_table_f(table_title,& + loc_id,& + dset_name,& + nfields,& + nrecords,& + type_size,& + field_names,& + field_offset,& + field_types,& + chunk_size,& + compress,& + errcode ) + + IMPLICIT NONE + CHARACTER(LEN=*), INTENT(in) :: table_title ! name of the dataset + INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier + CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset + INTEGER(hsize_t), INTENT(in) :: nfields ! fields + INTEGER(hsize_t), INTENT(in) :: nrecords ! records + INTEGER(size_t), INTENT(in) :: type_size ! type size + CHARACTER(LEN=*), DIMENSION(1:nfields), INTENT(in) :: field_names ! field names + INTEGER(size_t), DIMENSION(1:nfields), INTENT(in) :: field_offset ! field offset + INTEGER(hid_t), DIMENSION(1:nfields), INTENT(in) :: field_types ! field types + INTEGER(hsize_t), INTENT(in) :: chunk_size ! chunk size + INTEGER, INTENT(in) :: compress ! compress + INTEGER(size_t) :: namelen ! name length + INTEGER(size_t) :: namelen1 ! name length + INTEGER :: errcode ! error code + INTEGER(size_t), DIMENSION(1:nfields) :: char_len_field_names ! field name lengths + INTEGER(size_t) :: max_char_size_field_names ! character len of field names + INTEGER(hsize_t) :: i ! general purpose integer + + INTERFACE + INTEGER FUNCTION h5tbmake_table_c(namelen1,& + table_title,& + loc_id,& + namelen,& + dset_name,& + nfields,& + nrecords,& + type_size,& + field_offset,& + field_types,& + chunk_size,& + compress,& + char_len_field_names,& + max_char_size_field_names,& + field_names) & + BIND(C,NAME='h5tbmake_table_c') + IMPORT :: C_CHAR + IMPORT :: HID_T, SIZE_T, HSIZE_T + IMPLICIT NONE + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: table_title ! name of the dataset + INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: dset_name ! name of the dataset + INTEGER(hsize_t), INTENT(in) :: nfields ! fields + INTEGER(hsize_t), INTENT(in) :: nrecords ! records + INTEGER(size_t), INTENT(in) :: type_size ! type size + CHARACTER(KIND=C_CHAR), DIMENSION(nfields), INTENT(in) :: field_names ! field names + INTEGER(size_t), DIMENSION(nfields), INTENT(in) :: field_offset ! field offset + INTEGER(hid_t), DIMENSION(nfields), INTENT(in) :: field_types ! field types + INTEGER(hsize_t), INTENT(in) :: chunk_size ! chunk size + INTEGER, INTENT(in) :: compress ! compress + INTEGER(size_t) :: namelen ! name length + INTEGER(size_t) :: namelen1 ! name length + INTEGER(size_t), DIMENSION(nfields) :: char_len_field_names ! field name's lengths + INTEGER(size_t) :: max_char_size_field_names ! character len of field names + END FUNCTION h5tbmake_table_c + END INTERFACE + + namelen = LEN(dset_name) + namelen1 = LEN(table_title) + + ! Find the size of each character string in the array + DO i = 1, nfields + char_len_field_names(i) = LEN_TRIM(field_names(i)) + END DO + + max_char_size_field_names = LEN(field_names(1)) + + errcode = h5tbmake_table_c(namelen1,& + table_title,& + loc_id,& + namelen,& + dset_name,& + nfields,& + nrecords,& + type_size,& + field_offset,& + field_types,& + chunk_size,& + compress,& + char_len_field_names, & + max_char_size_field_names, & + field_names) + + END SUBROUTINE h5tbmake_table_f + +!------------------------------------------------------------------------- +! Function: h5tbwrite_field_name_f_int +! +! Purpose: Writes one field +! +! Programmer: pvn@ncsa.uiuc.edu +! +! Date: October 12, 2004 +! +! Comments: +! +! Modifications: +! +!------------------------------------------------------------------------- + + SUBROUTINE h5tbwrite_field_name_f_int(loc_id,& + dset_name,& + field_name,& + start,& + nrecords,& + type_size,& + buf,& + errcode ) + + IMPLICIT NONE + INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier + CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset + CHARACTER(LEN=*), INTENT(in) :: field_name ! name of the field + INTEGER(hsize_t), INTENT(in) :: start ! start record + INTEGER(hsize_t), INTENT(in) :: nrecords ! records + INTEGER(size_t), INTENT(in) :: type_size ! type size + INTEGER, INTENT(in), DIMENSION(*), TARGET :: buf ! data buffer + INTEGER :: errcode ! error code + INTEGER(size_t) :: namelen ! name length + INTEGER(size_t) :: namelen1 ! name length + TYPE(C_PTR) :: f_ptr + + f_ptr = C_LOC(buf(1)) + namelen = LEN(dset_name) + namelen1 = LEN(field_name) + + errcode = h5tbwrite_field_name_c(loc_id,namelen,dset_name,namelen1,field_name,& + start,nrecords,type_size,f_ptr) + + END SUBROUTINE h5tbwrite_field_name_f_int + + + SUBROUTINE h5tbwrite_field_name_f_string(loc_id,& + dset_name,& + field_name,& + start,& + nrecords,& + type_size,& + buf,& + errcode ) + + IMPLICIT NONE + + INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier + CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset + CHARACTER(LEN=*), INTENT(in) :: field_name ! name of the field + INTEGER(hsize_t), INTENT(in) :: start ! start record + INTEGER(hsize_t), INTENT(in) :: nrecords ! records + INTEGER(size_t), INTENT(in) :: type_size ! type size + CHARACTER(LEN=*), INTENT(in), DIMENSION(*), TARGET :: buf ! data buffer + INTEGER :: errcode ! error code + INTEGER(size_t) :: namelen ! name length + INTEGER(size_t) :: namelen1 + TYPE(C_PTR) :: f_ptr + + f_ptr = C_LOC(buf(1)(1:1)) + + namelen = LEN(dset_name) + namelen1 = LEN(field_name) + + errcode = h5tbwrite_field_name_c(loc_id,namelen,dset_name,namelen1,field_name,& + start,nrecords,type_size,f_ptr) + + END SUBROUTINE h5tbwrite_field_name_f_string + + +!------------------------------------------------------------------------- +! Function: h5tbread_field_name_f_int +! +! Purpose: Reads one field +! +! Programmer: pvn@ncsa.uiuc.edu +! +! Date: October 12, 2004 +! +! Comments: +! +! Modifications: +! +!------------------------------------------------------------------------- + + SUBROUTINE h5tbread_field_name_f_int(loc_id,& + dset_name,& + field_name,& + start,& + nrecords,& + type_size,& + buf,& + errcode ) + + IMPLICIT NONE + + INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier + CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset + CHARACTER(LEN=*), INTENT(in) :: field_name ! name of the field + INTEGER(hsize_t), INTENT(in) :: start ! start record + INTEGER(hsize_t), INTENT(in) :: nrecords ! records + INTEGER(size_t), INTENT(in) :: type_size ! type size + INTEGER, INTENT(in), DIMENSION(*), TARGET :: buf ! data buffer + INTEGER :: errcode ! error code + INTEGER(size_t) :: namelen ! name length + INTEGER(size_t) :: namelen1 + TYPE(C_PTR) :: f_ptr + + f_ptr = C_LOC(buf(1)) ! name length + + namelen = LEN(dset_name) + namelen1 = LEN(field_name) + + errcode = h5tbread_field_name_c(loc_id,namelen,dset_name,namelen1,field_name,& + start,nrecords,type_size,f_ptr) + + END SUBROUTINE h5tbread_field_name_f_int + + SUBROUTINE h5tbread_field_name_f_string(loc_id,& + dset_name,& + field_name,& + start,& + nrecords,& + type_size,& + buf,& + errcode ) + + IMPLICIT NONE + INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier + CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset + CHARACTER(LEN=*), INTENT(in) :: field_name ! name of the field + INTEGER(hsize_t), INTENT(in) :: start ! start record + INTEGER(hsize_t), INTENT(in) :: nrecords ! records + INTEGER(size_t), INTENT(in) :: type_size ! type size + CHARACTER(LEN=*), INTENT(in), DIMENSION(*), TARGET :: buf ! data buffer + INTEGER :: errcode ! error code + INTEGER(size_t) :: namelen ! name length + INTEGER(size_t) :: namelen1 ! name length + TYPE(C_PTR) :: f_ptr + + f_ptr = C_LOC(buf(1)(1:1)) + + namelen = LEN(dset_name) + namelen1 = LEN(field_name) + + errcode = h5tbread_field_name_c(loc_id,namelen,dset_name,namelen1,field_name,& + start,nrecords,type_size,f_ptr) + + END SUBROUTINE h5tbread_field_name_f_string + + +!------------------------------------------------------------------------- +! Function: h5tbwrite_field_index_f_int +! +! Purpose: Writes one field +! +! Programmer: pvn@ncsa.uiuc.edu +! +! Date: October 12, 2004 +! +! Comments: +! +! Modifications: +! +!------------------------------------------------------------------------- + + SUBROUTINE h5tbwrite_field_index_f_int(loc_id,& + dset_name,& + field_index,& + start,& + nrecords,& + type_size,& + buf,& + errcode ) + + IMPLICIT NONE + INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier + CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset + INTEGER, INTENT(in) :: field_index ! index + INTEGER(hsize_t), INTENT(in) :: start ! start record + INTEGER(hsize_t), INTENT(in) :: nrecords ! records + INTEGER(size_t), INTENT(in) :: type_size ! type size + INTEGER, INTENT(in), DIMENSION(*), TARGET :: buf ! data buffer + INTEGER :: errcode ! error code + INTEGER(size_t) :: namelen ! name length + TYPE(C_PTR) :: f_ptr + + f_ptr = C_LOC(buf(1)) + + namelen = LEN(dset_name) + + errcode = h5tbwrite_field_index_c(loc_id,namelen,dset_name,field_index,& + start,nrecords,type_size,f_ptr) + + END SUBROUTINE h5tbwrite_field_index_f_int + + SUBROUTINE h5tbwrite_field_index_f_string(loc_id,& + dset_name,& + field_index,& + start,& + nrecords,& + type_size,& + buf,& + errcode ) + + IMPLICIT NONE + INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier + CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset + INTEGER, INTENT(in) :: field_index ! index + INTEGER(hsize_t), INTENT(in) :: start ! start record + INTEGER(hsize_t), INTENT(in) :: nrecords ! records + INTEGER(size_t), INTENT(in) :: type_size ! type size + CHARACTER(LEN=*), INTENT(in), DIMENSION(*), TARGET :: buf ! data buffer + INTEGER :: errcode ! error code + INTEGER(size_t) :: namelen ! name length + TYPE(C_PTR) :: f_ptr + + f_ptr = C_LOC(buf(1)(1:1)) + namelen = LEN(dset_name) + + errcode = h5tbwrite_field_index_c(loc_id,namelen,dset_name,field_index,& + start,nrecords,type_size,f_ptr) + + END SUBROUTINE h5tbwrite_field_index_f_string + + +!------------------------------------------------------------------------- +! Function: h5tbread_field_index_f_int +! +! Purpose: Reads one field +! +! Programmer: pvn@ncsa.uiuc.edu +! +! Date: October 12, 2004 +! +! Comments: +! +! Modifications: +! +!------------------------------------------------------------------------- + + SUBROUTINE h5tbread_field_index_f_int(loc_id,& + dset_name,& + field_index,& + start,& + nrecords,& + type_size,& + buf,& + errcode ) + + IMPLICIT NONE + INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier + CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset + INTEGER, INTENT(in) :: field_index ! index + INTEGER(hsize_t), INTENT(in) :: start ! start record + INTEGER(hsize_t), INTENT(in) :: nrecords ! records + INTEGER(size_t), INTENT(in) :: type_size ! type size + INTEGER, INTENT(in), DIMENSION(*), TARGET :: buf ! data buffer + INTEGER :: errcode ! error code + INTEGER(size_t) :: namelen ! name length + TYPE(C_PTR) :: f_ptr + + f_ptr = C_LOC(buf(1)) + namelen = LEN(dset_name) + + errcode = h5tbread_field_index_c(loc_id,namelen,dset_name,field_index,& + start,nrecords,type_size,f_ptr) + + END SUBROUTINE h5tbread_field_index_f_int + + SUBROUTINE h5tbread_field_index_f_string(loc_id,& + dset_name,& + field_index,& + start,& + nrecords,& + type_size,& + buf,& + errcode ) + + IMPLICIT NONE + INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier + CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset + INTEGER, INTENT(in) :: field_index ! index + INTEGER(hsize_t), INTENT(in) :: start ! start record + INTEGER(hsize_t), INTENT(in) :: nrecords ! records + INTEGER(size_t), INTENT(in) :: type_size ! type size + CHARACTER(LEN=*), INTENT(in), DIMENSION(*), TARGET :: buf ! data buffer + INTEGER :: errcode ! error code + INTEGER(size_t) :: namelen ! name length + TYPE(C_PTR) :: f_ptr + + f_ptr = C_LOC(buf(1)(1:1)) + namelen = LEN(dset_name) + + errcode = h5tbread_field_index_c(loc_id,namelen,dset_name,field_index,& + start,nrecords,type_size,f_ptr) + + END SUBROUTINE h5tbread_field_index_f_string + +!------------------------------------------------------------------------- +! Function: h5tbinsert_field_f +! +! Purpose: Inserts one field +! +! Programmer: pvn@ncsa.uiuc.edu +! +! Date: October 13, 2004 +! +! Comments: +! +! Modifications: +! +!------------------------------------------------------------------------- + + SUBROUTINE h5tbinsert_field_f_int(loc_id,& + dset_name,& + field_name,& + field_type,& + field_index,& + buf,& + errcode ) + IMPLICIT NONE + INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier + CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset + CHARACTER(LEN=*), INTENT(in) :: field_name ! name of the field + INTEGER(hid_t), INTENT(in) :: field_type ! field type + INTEGER, INTENT(in) :: field_index ! field_index + INTEGER, INTENT(in), DIMENSION(*), TARGET :: buf ! data buffer + INTEGER(size_t) :: namelen ! name length + INTEGER(size_t) :: namelen1 ! name length + INTEGER :: errcode ! error code + TYPE(C_PTR) :: f_ptr + + f_ptr = C_LOC(buf(1)) + + namelen = LEN(dset_name) + namelen1 = LEN(field_name) + + errcode = h5tbinsert_field_c(loc_id,namelen,dset_name,namelen1,field_name,& + field_type,field_index,f_ptr) + + END SUBROUTINE h5tbinsert_field_f_int + + SUBROUTINE h5tbinsert_field_f_string(loc_id,& + dset_name,& + field_name,& + field_type,& + field_index,& + buf,& + errcode ) + IMPLICIT NONE + INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier + CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset + CHARACTER(LEN=*), INTENT(in) :: field_name ! name of the field + INTEGER(hid_t), INTENT(in) :: field_type ! field type + INTEGER, INTENT(in) :: field_index ! field_index + CHARACTER(LEN=*), INTENT(in), DIMENSION(*), TARGET :: buf ! data buffer + INTEGER(size_t) :: namelen ! name length + INTEGER(size_t) :: namelen1 ! name length + INTEGER :: errcode ! error code + TYPE(C_PTR) :: f_ptr + + f_ptr = C_LOC(buf(1)(1:1)) + + namelen = LEN(dset_name) + namelen1 = LEN(field_name) + + errcode = h5tbinsert_field_c(loc_id,namelen,dset_name,namelen1,field_name,& + field_type,field_index,f_ptr) + + END SUBROUTINE h5tbinsert_field_f_string + +!------------------------------------------------------------------------- +! Function: h5tbdelete_field_f +! +! Purpose: Inserts one field +! +! Programmer: pvn@ncsa.uiuc.edu +! +! Date: October 13, 2004 +! +! Comments: +! +! Modifications: +! +!------------------------------------------------------------------------- + + SUBROUTINE h5tbdelete_field_f(loc_id,& + dset_name,& + field_name,& + errcode ) + IMPLICIT NONE + INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier + CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset + CHARACTER(LEN=*), INTENT(in) :: field_name ! name of the field + INTEGER(size_t) :: namelen ! name length + INTEGER(size_t) :: namelen1 ! name length + INTEGER :: errcode ! error code + + + INTERFACE + INTEGER FUNCTION h5tbdelete_field_c(loc_id,namelen,dset_name,namelen1,field_name) & + BIND(C,NAME='h5tbdelete_field_c') + IMPORT :: C_CHAR + IMPORT :: HID_T, SIZE_T, HSIZE_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id ! file or group identifier + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: dset_name ! name of the dataset + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: field_name ! name of the field + INTEGER(size_t) :: namelen ! name length + INTEGER(size_t) :: namelen1 ! name length length + END FUNCTION h5tbdelete_field_c + END INTERFACE + + namelen = LEN(dset_name) + namelen1 = LEN(field_name) + + errcode = h5tbdelete_field_c(loc_id,namelen,dset_name,namelen1,field_name) + + END SUBROUTINE h5tbdelete_field_f + +!------------------------------------------------------------------------- +! Function: h5tbget_table_info_f +! +! Purpose: Gets the number of records and fields of a table +! +! Return: Success: 0, Failure: -1 +! +! Programmer: pvn@ncsa.uiuc.edu +! +! Date: October 13, 2004 +! +! Comments: +! +! Modifications: +! +!------------------------------------------------------------------------- + + SUBROUTINE h5tbget_table_info_f(loc_id,& + dset_name,& + nfields,& + nrecords,& + errcode ) + + IMPLICIT NONE + INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier + CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset + INTEGER(hsize_t), INTENT(inout):: nfields ! nfields + INTEGER(hsize_t), INTENT(inout):: nrecords ! nrecords + INTEGER :: errcode ! error code + INTEGER(size_t) :: namelen ! name length + + INTERFACE + INTEGER FUNCTION h5tbget_table_info_c(loc_id,namelen,dset_name,nfields,nrecords) & + BIND(C,NAME='h5tbget_table_info_c') + IMPORT :: C_CHAR + IMPORT :: HID_T, SIZE_T, HSIZE_T + IMPLICIT NONE + INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: dset_name ! name of the dataset + INTEGER(hsize_t), INTENT(inout):: nfields ! nfields + INTEGER(hsize_t), INTENT(inout):: nrecords ! nrecords + INTEGER(size_t) :: namelen ! name length + END FUNCTION h5tbget_table_info_c + END INTERFACE + + namelen = LEN(dset_name) + errcode = h5tbget_table_info_c(loc_id,namelen,dset_name,nfields,nrecords) + + END SUBROUTINE h5tbget_table_info_f + + +!------------------------------------------------------------------------- +! Function: h5tbget_field_info_f +! +! Purpose: Get information about fields +! +! Return: Success: 0, Failure: -1 +! +! Programmer: pvn@ncsa.uiuc.edu +! +! Date: October 13, 2004 +! +! Comments: +! +! Modifications: +! Added optional parameter for returning the maximum character length +! in the field name array. March 3, 2011 +! +!------------------------------------------------------------------------- + + SUBROUTINE h5tbget_field_info_f(loc_id,& + dset_name,& + nfields,& + field_names,& + field_sizes,& + field_offsets,& + type_size,& + errcode, maxlen_out ) + + IMPLICIT NONE + INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier + CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset + INTEGER(hsize_t), INTENT(in) :: nfields ! nfields + CHARACTER(LEN=*), DIMENSION(nfields), INTENT(inout) :: field_names ! field names + INTEGER(size_t), DIMENSION(nfields), INTENT(inout) :: field_sizes ! field sizes + INTEGER(size_t), DIMENSION(nfields), INTENT(inout) :: field_offsets ! field offsets + INTEGER(size_t), INTENT(inout):: type_size ! type size + INTEGER :: errcode ! error code + INTEGER, OPTIONAL :: maxlen_out ! maximum character len of the field names + INTEGER(size_t) :: namelen ! name length + INTEGER(size_t), DIMENSION(nfields) :: namelen2 ! name lengths + INTEGER(hsize_t) :: i ! general purpose integer + INTEGER(size_t) :: maxlen + INTEGER(size_t) :: c_maxlen_out + + INTERFACE + INTEGER FUNCTION h5tbget_field_info_c(loc_id,namelen,dset_name,nfields,& + field_sizes,field_offsets,type_size,namelen2, maxlen, field_names, c_maxlen_out) & + BIND(C,NAME='h5tbget_field_info_c') + IMPORT :: C_CHAR + IMPORT :: HID_T, SIZE_T, HSIZE_T + IMPLICIT NONE + INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(in) :: dset_name ! name of the dataset + INTEGER(hsize_t), INTENT(in):: nfields ! nfields + CHARACTER(KIND=C_CHAR), DIMENSION(1:nfields), INTENT(inout) :: field_names ! field names + INTEGER(size_t), DIMENSION(1:nfields), INTENT(inout) :: field_sizes ! field sizes + INTEGER(size_t), DIMENSION(1:nfields), INTENT(inout) :: field_offsets ! field offsets + INTEGER(size_t), INTENT(inout):: type_size ! type size + INTEGER(size_t) :: namelen ! name length + INTEGER(size_t) :: maxlen ! maxiumum length of input field names + INTEGER(size_t), DIMENSION(1:nfields) :: namelen2 ! name lengths + INTEGER(size_t) :: c_maxlen_out ! maximum character length of a field array element + END FUNCTION h5tbget_field_info_c + END INTERFACE + + namelen = LEN(dset_name) + DO i = 1, nfields + namelen2(i) = LEN_TRIM(field_names(i)) + END DO + maxlen = LEN(field_names(1)) + c_maxlen_out = 0 + + errcode = h5tbget_field_info_c(loc_id, namelen,dset_name, nfields, & + field_sizes, field_offsets, type_size, namelen2, maxlen, field_names, c_maxlen_out) + + IF(PRESENT(maxlen_out)) maxlen_out = c_maxlen_out + + END SUBROUTINE h5tbget_field_info_f + +END MODULE H5TB_CONST + + + + + + diff --git a/hl/fortran/src/H5TBff.f90 b/hl/fortran/src/H5TBff.f90 deleted file mode 100644 index 5846f49..0000000 --- a/hl/fortran/src/H5TBff.f90 +++ /dev/null @@ -1,1900 +0,0 @@ -! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -! 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. * -! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -! -! -! This file contains FORTRAN90 interfaces for H5TB functions -! - -MODULE h5tb -USE h5fortran_types -USE hdf5 - - -INTERFACE h5tbwrite_field_name_f - MODULE PROCEDURE h5tbwrite_field_name_f_int - MODULE PROCEDURE h5tbwrite_field_name_f_float - MODULE PROCEDURE h5tbwrite_field_name_f_double - MODULE PROCEDURE h5tbwrite_field_name_f_string -END INTERFACE - -INTERFACE h5tbread_field_name_f - MODULE PROCEDURE h5tbread_field_name_f_int - MODULE PROCEDURE h5tbread_field_name_f_float - MODULE PROCEDURE h5tbread_field_name_f_double - MODULE PROCEDURE h5tbread_field_name_f_string -END INTERFACE - -INTERFACE h5tbwrite_field_index_f - MODULE PROCEDURE h5tbwrite_field_index_f_int - MODULE PROCEDURE h5tbwrite_field_index_f_float - MODULE PROCEDURE h5tbwrite_field_index_f_double - MODULE PROCEDURE h5tbwrite_field_index_f_string -END INTERFACE - -INTERFACE h5tbread_field_index_f - MODULE PROCEDURE h5tbread_field_index_f_int - MODULE PROCEDURE h5tbread_field_index_f_float - MODULE PROCEDURE h5tbread_field_index_f_double - MODULE PROCEDURE h5tbread_field_index_f_string -END INTERFACE - - -INTERFACE h5tbinsert_field_f - MODULE PROCEDURE h5tbinsert_field_f_int - MODULE PROCEDURE h5tbinsert_field_f_float - MODULE PROCEDURE h5tbinsert_field_f_double - MODULE PROCEDURE h5tbinsert_field_f_string -END INTERFACE - - -CONTAINS - - -!------------------------------------------------------------------------- -! Function: h5tbmake_table_f -! -! Purpose: Make a table -! -! Return: Success: 0, Failure: -1 -! -! Programmer: pvn@ncsa.uiuc.edu -! -! Date: October 06, 2004 -! -! Comments: -! -! Modifications: -! -!------------------------------------------------------------------------- - -SUBROUTINE h5tbmake_table_f(table_title,& - loc_id,& - dset_name,& - nfields,& - nrecords,& - type_size,& - field_names,& - field_offset,& - field_types,& - chunk_size,& - compress,& - errcode ) - - IMPLICIT NONE -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5tbmake_table_f -!DEC$endif -! - CHARACTER(LEN=*), INTENT(in) :: table_title ! name of the dataset - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hsize_t), INTENT(in) :: nfields ! fields - INTEGER(hsize_t), INTENT(in) :: nrecords ! records - INTEGER(size_t), INTENT(in) :: type_size ! type size - CHARACTER(LEN=*), DIMENSION(1:nfields), INTENT(in) :: field_names ! field names - INTEGER(size_t), DIMENSION(1:nfields), INTENT(in) :: field_offset ! field offset - INTEGER(hid_t), DIMENSION(1:nfields), INTENT(in) :: field_types ! field types - INTEGER(hsize_t), INTENT(in) :: chunk_size ! chunk size - INTEGER, INTENT(in) :: compress ! compress - INTEGER(size_t) :: namelen ! name length - INTEGER(size_t) :: namelen1 ! name length - INTEGER :: errcode ! error code - INTEGER(size_t), DIMENSION(1:nfields) :: char_len_field_names ! field name lengths - INTEGER(size_t) :: max_char_size_field_names ! character len of field names - INTEGER(hsize_t) :: i ! general purpose integer - - - INTERFACE - INTEGER FUNCTION h5tbmake_table_c(namelen1,& - table_title,& - loc_id,& - namelen,& - dset_name,& - nfields,& - nrecords,& - type_size,& - field_offset,& - field_types,& - chunk_size,& - compress,& - char_len_field_names,& - max_char_size_field_names,& - field_names) - - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TBMAKE_TABLE_C'::h5tbmake_table_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - !DEC$ATTRIBUTES reference :: table_title - CHARACTER(LEN=*), INTENT(in) :: table_title ! name of the dataset - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hsize_t), INTENT(in) :: nfields ! fields - INTEGER(hsize_t), INTENT(in) :: nrecords ! records - INTEGER(size_t), INTENT(in) :: type_size ! type size - CHARACTER(LEN=*), DIMENSION(nfields), INTENT(in) :: field_names ! field names - INTEGER(size_t), DIMENSION(nfields), INTENT(in) :: field_offset ! field offset - INTEGER(hid_t), DIMENSION(nfields), INTENT(in) :: field_types ! field types - INTEGER(hsize_t), INTENT(in) :: chunk_size ! chunk size - INTEGER, INTENT(in) :: compress ! compress - INTEGER(size_t) :: namelen ! name length - INTEGER(size_t) :: namelen1 ! name length - INTEGER(size_t), DIMENSION(nfields) :: char_len_field_names ! field name's lengths - INTEGER(size_t) :: max_char_size_field_names ! character len of field names - END FUNCTION h5tbmake_table_c - END INTERFACE - - namelen = LEN(dset_name) - namelen1 = LEN(table_title) - - ! Find the size of each character string in the array - DO i = 1, nfields - char_len_field_names(i) = LEN_TRIM(field_names(i)) - END DO - - max_char_size_field_names = LEN(field_names(1)) - - errcode = h5tbmake_table_c(namelen1,& - table_title,& - loc_id,& - namelen,& - dset_name,& - nfields,& - nrecords,& - type_size,& - field_offset,& - field_types,& - chunk_size,& - compress,& - char_len_field_names, & - max_char_size_field_names, & - field_names) - -END SUBROUTINE h5tbmake_table_f - - -!------------------------------------------------------------------------- -! Function: h5tbwrite_field_name_f_int -! -! Purpose: Writes one field -! -! Programmer: pvn@ncsa.uiuc.edu -! -! Date: October 12, 2004 -! -! Comments: -! -! Modifications: -! -!------------------------------------------------------------------------- - -SUBROUTINE h5tbwrite_field_name_f_int(loc_id,& - dset_name,& - field_name,& - start,& - nrecords,& - type_size,& - buf,& - errcode ) - - IMPLICIT NONE - -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5tbwrite_field_name_f_int -!DEC$endif -! - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset - CHARACTER(LEN=*), INTENT(in) :: field_name ! name of the field - INTEGER(hsize_t), INTENT(in) :: start ! start record - INTEGER(hsize_t), INTENT(in) :: nrecords ! records - INTEGER(size_t), INTENT(in) :: type_size ! type size - INTEGER, INTENT(in), DIMENSION(*) :: buf ! data buffer - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - INTEGER(size_t) :: namelen1 ! name length - - INTERFACE - INTEGER FUNCTION h5tbwrite_field_name_int_c(loc_id,namelen,dset_name,namelen1,field_name,& - start,nrecords,type_size,buf) - - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TBWRITE_FIELD_NAME_INT_C'::h5tbwrite_field_name_int_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - !DEC$ATTRIBUTES reference :: field_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset - CHARACTER(LEN=*), INTENT(in) :: field_name ! name of the field - INTEGER(hsize_t), INTENT(in) :: start ! start record - INTEGER(hsize_t), INTENT(in) :: nrecords ! records - INTEGER(size_t), INTENT(in) :: type_size ! type size - INTEGER, INTENT(in), DIMENSION(*) :: buf ! data buffer - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - INTEGER(size_t) :: namelen1 ! name length - END FUNCTION h5tbwrite_field_name_int_c - END INTERFACE - - namelen = LEN(dset_name) - namelen1 = LEN(field_name) - - errcode = h5tbwrite_field_name_int_c(loc_id,namelen,dset_name,namelen1,field_name,& - start,nrecords,type_size,buf) - -END SUBROUTINE h5tbwrite_field_name_f_int - -!------------------------------------------------------------------------- -! Function: h5tbwrite_field_name_f_float -! -! Purpose: Writes one field -! -! Programmer: pvn@ncsa.uiuc.edu -! -! Date: October 12, 2004 -! -! Comments: -! -! Modifications: -! -!------------------------------------------------------------------------- - -SUBROUTINE h5tbwrite_field_name_f_float(loc_id,& - dset_name,& - field_name,& - start,& - nrecords,& - type_size,& - buf,& - errcode ) - - IMPLICIT NONE - -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5tbwrite_field_name_f_float -!DEC$endif -! - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset - CHARACTER(LEN=*), INTENT(in) :: field_name ! name of the field - INTEGER(hsize_t), INTENT(in) :: start ! start record - INTEGER(hsize_t), INTENT(in) :: nrecords ! records - INTEGER(size_t), INTENT(in) :: type_size ! type size - REAL, INTENT(in), DIMENSION(*) :: buf ! data buffer - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - INTEGER(size_t) :: namelen1 ! name length - - INTERFACE - INTEGER FUNCTION h5tbwrite_field_name_fl_c(loc_id,namelen,dset_name,namelen1,field_name,& - start,nrecords,type_size,buf) - - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TBWRITE_FIELD_NAME_FL_C'::h5tbwrite_field_name_fl_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - !DEC$ATTRIBUTES reference :: field_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset - CHARACTER(LEN=*), INTENT(in) :: field_name ! name of the field - INTEGER(hsize_t), INTENT(in) :: start ! start record - INTEGER(hsize_t), INTENT(in) :: nrecords ! records - INTEGER(size_t), INTENT(in) :: type_size ! type size - REAL, INTENT(in), DIMENSION(*) :: buf ! data buffer - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - INTEGER(size_t) :: namelen1 ! name length - END FUNCTION h5tbwrite_field_name_fl_c - END INTERFACE - - namelen = LEN(dset_name) - namelen1 = LEN(field_name) - - errcode = h5tbwrite_field_name_fl_c(loc_id,namelen,dset_name,namelen1,field_name,& - start,nrecords,type_size,buf) - -END SUBROUTINE h5tbwrite_field_name_f_float - - - -!------------------------------------------------------------------------- -! Function: h5tbwrite_field_name_f_double -! -! Purpose: Writes one field -! -! Programmer: pvn@ncsa.uiuc.edu -! -! Date: October 12, 2004 -! -! Comments: -! -! Modifications: -! -!------------------------------------------------------------------------- - -SUBROUTINE h5tbwrite_field_name_f_double(loc_id,& - dset_name,& - field_name,& - start,& - nrecords,& - type_size,& - buf,& - errcode ) - - IMPLICIT NONE - -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5tbwrite_field_name_f_double -!DEC$endif -! - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset - CHARACTER(LEN=*), INTENT(in) :: field_name ! name of the field - INTEGER(hsize_t), INTENT(in) :: start ! start record - INTEGER(hsize_t), INTENT(in) :: nrecords ! records - INTEGER(size_t), INTENT(in) :: type_size ! type size - DOUBLE PRECISION, INTENT(in), DIMENSION(*) :: buf ! data buffer - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - INTEGER(size_t) :: namelen1 ! name length - - INTERFACE - INTEGER FUNCTION h5tbwrite_field_name_dl_c(loc_id,namelen,dset_name,namelen1,field_name,& - start,nrecords,type_size,buf) - - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TBWRITE_FIELD_NAME_DL_C'::h5tbwrite_field_name_dl_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - !DEC$ATTRIBUTES reference :: field_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset - CHARACTER(LEN=*), INTENT(in) :: field_name ! name of the field - INTEGER(hsize_t), INTENT(in) :: start ! start record - INTEGER(hsize_t), INTENT(in) :: nrecords ! records - INTEGER(size_t), INTENT(in) :: type_size ! type size - DOUBLE PRECISION, INTENT(in), DIMENSION(*) :: buf ! data buffer - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - INTEGER(size_t) :: namelen1 ! name length - END FUNCTION h5tbwrite_field_name_dl_c - END INTERFACE - - namelen = LEN(dset_name) - namelen1 = LEN(field_name) - - errcode = h5tbwrite_field_name_dl_c(loc_id,namelen,dset_name,namelen1,field_name,& - start,nrecords,type_size,buf) - -END SUBROUTINE h5tbwrite_field_name_f_double - -!------------------------------------------------------------------------- -! Function: h5tbwrite_field_name_f_string -! -! Purpose: Writes one field -! -! Programmer: pvn@ncsa.uiuc.edu -! -! Date: October 12, 2004 -! -! Comments: -! -! Modifications: -! -!------------------------------------------------------------------------- - -SUBROUTINE h5tbwrite_field_name_f_string(loc_id,& - dset_name,& - field_name,& - start,& - nrecords,& - type_size,& - buf,& - errcode ) - - IMPLICIT NONE - -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5tbwrite_field_name_f_string -!DEC$endif -! - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset - CHARACTER(LEN=*), INTENT(in) :: field_name ! name of the field - INTEGER(hsize_t), INTENT(in) :: start ! start record - INTEGER(hsize_t), INTENT(in) :: nrecords ! records - INTEGER(size_t), INTENT(in) :: type_size ! type size - CHARACTER(LEN=*), INTENT(in), DIMENSION(*) :: buf ! data buffer - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - INTEGER(size_t) :: namelen1 ! name length - - INTERFACE - INTEGER FUNCTION h5tbwrite_field_name_st_c(loc_id,namelen,dset_name,namelen1,field_name,& - start,nrecords,type_size,buf) - - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TBWRITE_FIELD_NAME_ST_C'::h5tbwrite_field_name_st_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - !DEC$ATTRIBUTES reference :: field_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset - CHARACTER(LEN=*), INTENT(in) :: field_name ! name of the field - INTEGER(hsize_t), INTENT(in) :: start ! start record - INTEGER(hsize_t), INTENT(in) :: nrecords ! records - INTEGER(size_t), INTENT(in) :: type_size ! type size - CHARACTER(LEN=*), INTENT(in), DIMENSION(*) :: buf ! data buffer - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - INTEGER(size_t) :: namelen1 ! name length - END FUNCTION h5tbwrite_field_name_st_c - END INTERFACE - - namelen = LEN(dset_name) - namelen1 = LEN(field_name) - - errcode = h5tbwrite_field_name_st_c(loc_id,namelen,dset_name,namelen1,field_name,& - start,nrecords,type_size,buf) - -END SUBROUTINE h5tbwrite_field_name_f_string - - -!------------------------------------------------------------------------- -! Function: h5tbread_field_name_f_int -! -! Purpose: Reads one field -! -! Programmer: pvn@ncsa.uiuc.edu -! -! Date: October 12, 2004 -! -! Comments: -! -! Modifications: -! -!------------------------------------------------------------------------- - -SUBROUTINE h5tbread_field_name_f_int(loc_id,& - dset_name,& - field_name,& - start,& - nrecords,& - type_size,& - buf,& - errcode ) - - IMPLICIT NONE - -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5tbread_field_name_f_int -!DEC$endif -! - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset - CHARACTER(LEN=*), INTENT(in) :: field_name ! name of the field - INTEGER(hsize_t), INTENT(in) :: start ! start record - INTEGER(hsize_t), INTENT(in) :: nrecords ! records - INTEGER(size_t), INTENT(in) :: type_size ! type size - INTEGER, INTENT(in), DIMENSION(*) :: buf ! data buffer - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - INTEGER(size_t) :: namelen1 ! name length - - INTERFACE - INTEGER FUNCTION h5tbread_field_name_int_c(loc_id,namelen,dset_name,namelen1,field_name,& - start,nrecords,type_size,buf) - - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TBREAD_FIELD_NAME_INT_C'::h5tbread_field_name_int_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - !DEC$ATTRIBUTES reference :: field_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset - CHARACTER(LEN=*), INTENT(in) :: field_name ! name of the field - INTEGER(hsize_t), INTENT(in) :: start ! start record - INTEGER(hsize_t), INTENT(in) :: nrecords ! records - INTEGER(size_t), INTENT(in) :: type_size ! type size - INTEGER, INTENT(in), DIMENSION(*) :: buf ! data buffer - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - INTEGER(size_t) :: namelen1 ! name length - END FUNCTION h5tbread_field_name_int_c - END INTERFACE - - namelen = LEN(dset_name) - namelen1 = LEN(field_name) - - errcode = h5tbread_field_name_int_c(loc_id,namelen,dset_name,namelen1,field_name,& - start,nrecords,type_size,buf) - -END SUBROUTINE h5tbread_field_name_f_int - -!------------------------------------------------------------------------- -! Function: h5tbread_field_name_f_float -! -! Purpose: Reads one field -! -! Programmer: pvn@ncsa.uiuc.edu -! -! Date: October 12, 2004 -! -! Comments: -! -! Modifications: -! -!------------------------------------------------------------------------- - -SUBROUTINE h5tbread_field_name_f_float(loc_id,& - dset_name,& - field_name,& - start,& - nrecords,& - type_size,& - buf,& - errcode ) - - IMPLICIT NONE - -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5tbread_field_name_f_float -!DEC$endif -! - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset - CHARACTER(LEN=*), INTENT(in) :: field_name ! name of the field - INTEGER(hsize_t), INTENT(in) :: start ! start record - INTEGER(hsize_t), INTENT(in) :: nrecords ! records - INTEGER(size_t), INTENT(in) :: type_size ! type size - REAL, INTENT(in), DIMENSION(*) :: buf ! data buffer - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - INTEGER(size_t) :: namelen1 ! name length - - INTERFACE - INTEGER FUNCTION h5tbread_field_name_fl_c(loc_id,namelen,dset_name,namelen1,field_name,& - start,nrecords,type_size,buf) - - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TBREAD_FIELD_NAME_FL_C'::h5tbread_field_name_fl_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - !DEC$ATTRIBUTES reference :: field_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset - CHARACTER(LEN=*), INTENT(in) :: field_name ! name of the field - INTEGER(hsize_t), INTENT(in) :: start ! start record - INTEGER(hsize_t), INTENT(in) :: nrecords ! records - INTEGER(size_t), INTENT(in) :: type_size ! type size - REAL, INTENT(in), DIMENSION(*) :: buf ! data buffer - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - INTEGER(size_t) :: namelen1 ! name length - END FUNCTION h5tbread_field_name_fl_c - END INTERFACE - - namelen = LEN(dset_name) - namelen1 = LEN(field_name) - - errcode = h5tbread_field_name_fl_c(loc_id,namelen,dset_name,namelen1,field_name,& - start,nrecords,type_size,buf) - -END SUBROUTINE h5tbread_field_name_f_float - -!------------------------------------------------------------------------- -! Function: h5tbread_field_name_f_double -! -! Purpose: Reads one field -! -! Programmer: pvn@ncsa.uiuc.edu -! -! Date: October 12, 2004 -! -! Comments: -! -! Modifications: -! -!------------------------------------------------------------------------- - -SUBROUTINE h5tbread_field_name_f_double(loc_id,& - dset_name,& - field_name,& - start,& - nrecords,& - type_size,& - buf,& - errcode ) - - IMPLICIT NONE - -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5tbread_field_name_f_double -!DEC$endif -! - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset - CHARACTER(LEN=*), INTENT(in) :: field_name ! name of the field - INTEGER(hsize_t), INTENT(in) :: start ! start record - INTEGER(hsize_t), INTENT(in) :: nrecords ! records - INTEGER(size_t), INTENT(in) :: type_size ! type size - DOUBLE PRECISION, INTENT(in), DIMENSION(*) :: buf ! data buffer - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - INTEGER(size_t) :: namelen1 ! name length - - INTERFACE - INTEGER FUNCTION h5tbread_field_name_dl_c(loc_id,namelen,dset_name,namelen1,field_name,& - start,nrecords,type_size,buf) - - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TBREAD_FIELD_NAME_DL_C'::h5tbread_field_name_dl_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - !DEC$ATTRIBUTES reference :: field_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset - CHARACTER(LEN=*), INTENT(in) :: field_name ! name of the field - INTEGER(hsize_t), INTENT(in) :: start ! start record - INTEGER(hsize_t), INTENT(in) :: nrecords ! records - INTEGER(size_t), INTENT(in) :: type_size ! type size - DOUBLE PRECISION, INTENT(in), DIMENSION(*) :: buf ! data buffer - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - INTEGER(size_t) :: namelen1 ! name length - END FUNCTION h5tbread_field_name_dl_c - END INTERFACE - - namelen = LEN(dset_name) - namelen1 = LEN(field_name) - - errcode = h5tbread_field_name_dl_c(loc_id,namelen,dset_name,namelen1,field_name,& - start,nrecords,type_size,buf) - -END SUBROUTINE h5tbread_field_name_f_double - -!------------------------------------------------------------------------- -! Function: h5tbread_field_name_f_string -! -! Purpose: Reads one field -! -! Programmer: pvn@ncsa.uiuc.edu -! -! Date: October 12, 2004 -! -! Comments: -! -! Modifications: -! -!------------------------------------------------------------------------- - -SUBROUTINE h5tbread_field_name_f_string(loc_id,& - dset_name,& - field_name,& - start,& - nrecords,& - type_size,& - buf,& - errcode ) - - IMPLICIT NONE - -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5tbread_field_name_f_string -!DEC$endif -! - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset - CHARACTER(LEN=*), INTENT(in) :: field_name ! name of the field - INTEGER(hsize_t), INTENT(in) :: start ! start record - INTEGER(hsize_t), INTENT(in) :: nrecords ! records - INTEGER(size_t), INTENT(in) :: type_size ! type size - CHARACTER(LEN=*), INTENT(in), DIMENSION(*) :: buf ! data buffer - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - INTEGER(size_t) :: namelen1 ! name length - - INTERFACE - INTEGER FUNCTION h5tbread_field_name_st_c(loc_id,namelen,dset_name,namelen1,field_name,& - start,nrecords,type_size,buf) - - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TBREAD_FIELD_NAME_ST_C'::h5tbread_field_name_st_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - !DEC$ATTRIBUTES reference :: field_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset - CHARACTER(LEN=*), INTENT(in) :: field_name ! name of the field - INTEGER(hsize_t), INTENT(in) :: start ! start record - INTEGER(hsize_t), INTENT(in) :: nrecords ! records - INTEGER(size_t), INTENT(in) :: type_size ! type size - CHARACTER(LEN=*), INTENT(in), DIMENSION(*) :: buf ! data buffer - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - INTEGER(size_t) :: namelen1 ! name length - END FUNCTION h5tbread_field_name_st_c - END INTERFACE - - namelen = LEN(dset_name) - namelen1 = LEN(field_name) - - errcode = h5tbread_field_name_st_c(loc_id,namelen,dset_name,namelen1,field_name,& - start,nrecords,type_size,buf) - -END SUBROUTINE h5tbread_field_name_f_string - - -!------------------------------------------------------------------------- -! Function: h5tbwrite_field_index_f_int -! -! Purpose: Writes one field -! -! Programmer: pvn@ncsa.uiuc.edu -! -! Date: October 12, 2004 -! -! Comments: -! -! Modifications: -! -!------------------------------------------------------------------------- - -SUBROUTINE h5tbwrite_field_index_f_int(loc_id,& - dset_name,& - field_index,& - start,& - nrecords,& - type_size,& - buf,& - errcode ) - - IMPLICIT NONE - -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5tbwrite_field_index_f_int -!DEC$endif -! - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: field_index ! index - INTEGER(hsize_t), INTENT(in) :: start ! start record - INTEGER(hsize_t), INTENT(in) :: nrecords ! records - INTEGER(size_t), INTENT(in) :: type_size ! type size - INTEGER, INTENT(in), DIMENSION(*) :: buf ! data buffer - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - - INTERFACE - INTEGER FUNCTION h5tbwrite_field_index_int_c(loc_id,namelen,dset_name,field_index,& - start,nrecords,type_size,buf) - - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TBWRITE_FIELD_INDEX_INT_C'::h5tbwrite_field_index_int_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: field_index ! index - INTEGER(hsize_t), INTENT(in) :: start ! start record - INTEGER(hsize_t), INTENT(in) :: nrecords ! records - INTEGER(size_t), INTENT(in) :: type_size ! type size - INTEGER, INTENT(in), DIMENSION(*) :: buf ! data buffer - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - END FUNCTION h5tbwrite_field_index_int_c - END INTERFACE - - namelen = LEN(dset_name) - - errcode = h5tbwrite_field_index_int_c(loc_id,namelen,dset_name,field_index,& - start,nrecords,type_size,buf) - -END SUBROUTINE h5tbwrite_field_index_f_int - -!------------------------------------------------------------------------- -! Function: h5tbwrite_field_index_f_float -! -! Purpose: Writes one field -! -! Programmer: pvn@ncsa.uiuc.edu -! -! Date: October 12, 2004 -! -! Comments: -! -! Modifications: -! -!------------------------------------------------------------------------- - -SUBROUTINE h5tbwrite_field_index_f_float(loc_id,& - dset_name,& - field_index,& - start,& - nrecords,& - type_size,& - buf,& - errcode ) - - IMPLICIT NONE - -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5tbwrite_field_index_f_float -!DEC$endif -! - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: field_index ! index - INTEGER(hsize_t), INTENT(in) :: start ! start record - INTEGER(hsize_t), INTENT(in) :: nrecords ! records - INTEGER(size_t), INTENT(in) :: type_size ! type size - REAL, INTENT(in), DIMENSION(*) :: buf ! data buffer - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - - INTERFACE - INTEGER FUNCTION h5tbwrite_field_index_fl_c(loc_id,namelen,dset_name,field_index,& - start,nrecords,type_size,buf) - - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TBWRITE_FIELD_INDEX_FL_C'::h5tbwrite_field_index_fl_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: field_index ! index - INTEGER(hsize_t), INTENT(in) :: start ! start record - INTEGER(hsize_t), INTENT(in) :: nrecords ! records - INTEGER(size_t), INTENT(in) :: type_size ! type size - REAL, INTENT(in), DIMENSION(*) :: buf ! data buffer - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - END FUNCTION h5tbwrite_field_index_fl_c - END INTERFACE - - namelen = LEN(dset_name) - - errcode = h5tbwrite_field_index_fl_c(loc_id,namelen,dset_name,field_index,& - start,nrecords,type_size,buf) - -END SUBROUTINE h5tbwrite_field_index_f_float - - - -!------------------------------------------------------------------------- -! Function: h5tbwrite_field_index_f_double -! -! Purpose: Writes one field -! -! Programmer: pvn@ncsa.uiuc.edu -! -! Date: October 12, 2004 -! -! Comments: -! -! Modifications: -! -!------------------------------------------------------------------------- - -SUBROUTINE h5tbwrite_field_index_f_double(loc_id,& - dset_name,& - field_index,& - start,& - nrecords,& - type_size,& - buf,& - errcode ) - - IMPLICIT NONE - -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5tbwrite_field_index_f_double -!DEC$endif -! - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: field_index ! index - INTEGER(hsize_t), INTENT(in) :: start ! start record - INTEGER(hsize_t), INTENT(in) :: nrecords ! records - INTEGER(size_t), INTENT(in) :: type_size ! type size - DOUBLE PRECISION, INTENT(in), DIMENSION(*) :: buf ! data buffer - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - - INTERFACE - INTEGER FUNCTION h5tbwrite_field_index_dl_c(loc_id,namelen,dset_name,field_index,& - start,nrecords,type_size,buf) - - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TBWRITE_FIELD_INDEX_DL_C'::h5tbwrite_field_index_dl_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: field_index ! index - INTEGER(hsize_t), INTENT(in) :: start ! start record - INTEGER(hsize_t), INTENT(in) :: nrecords ! records - INTEGER(size_t), INTENT(in) :: type_size ! type size - DOUBLE PRECISION, INTENT(in), DIMENSION(*) :: buf ! data buffer - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - END FUNCTION h5tbwrite_field_index_dl_c - END INTERFACE - - namelen = LEN(dset_name) - - errcode = h5tbwrite_field_index_dl_c(loc_id,namelen,dset_name,field_index,& - start,nrecords,type_size,buf) - -END SUBROUTINE h5tbwrite_field_index_f_double - -!------------------------------------------------------------------------- -! Function: h5tbwrite_field_index_f_string -! -! Purpose: Writes one field -! -! Programmer: pvn@ncsa.uiuc.edu -! -! Date: October 12, 2004 -! -! Comments: -! -! Modifications: -! -!------------------------------------------------------------------------- - -SUBROUTINE h5tbwrite_field_index_f_string(loc_id,& - dset_name,& - field_index,& - start,& - nrecords,& - type_size,& - buf,& - errcode ) - - IMPLICIT NONE - -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5tbwrite_field_index_f_string -!DEC$endif -! - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: field_index ! index - INTEGER(hsize_t), INTENT(in) :: start ! start record - INTEGER(hsize_t), INTENT(in) :: nrecords ! records - INTEGER(size_t), INTENT(in) :: type_size ! type size - CHARACTER(LEN=*), INTENT(in), DIMENSION(*) :: buf ! data buffer - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - - INTERFACE - INTEGER FUNCTION h5tbwrite_field_index_st_c(loc_id,namelen,dset_name,field_index,& - start,nrecords,type_size,buf) - - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TBWRITE_FIELD_INDEX_ST_C'::h5tbwrite_field_index_st_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: field_index ! index - INTEGER(hsize_t), INTENT(in) :: start ! start record - INTEGER(hsize_t), INTENT(in) :: nrecords ! records - INTEGER(size_t), INTENT(in) :: type_size ! type size - CHARACTER(LEN=*), INTENT(in), DIMENSION(*) :: buf ! data buffer - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - END FUNCTION h5tbwrite_field_index_st_c - END INTERFACE - - namelen = LEN(dset_name) - - errcode = h5tbwrite_field_index_st_c(loc_id,namelen,dset_name,field_index,& - start,nrecords,type_size,buf) - -END SUBROUTINE h5tbwrite_field_index_f_string - - -!------------------------------------------------------------------------- -! Function: h5tbread_field_index_f_int -! -! Purpose: Reads one field -! -! Programmer: pvn@ncsa.uiuc.edu -! -! Date: October 12, 2004 -! -! Comments: -! -! Modifications: -! -!------------------------------------------------------------------------- - -SUBROUTINE h5tbread_field_index_f_int(loc_id,& - dset_name,& - field_index,& - start,& - nrecords,& - type_size,& - buf,& - errcode ) - - IMPLICIT NONE - -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport ::h5tbread_field_index_f_int -!DEC$endif -! - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: field_index ! index - INTEGER(hsize_t), INTENT(in) :: start ! start record - INTEGER(hsize_t), INTENT(in) :: nrecords ! records - INTEGER(size_t), INTENT(in) :: type_size ! type size - INTEGER, INTENT(in), DIMENSION(*) :: buf ! data buffer - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - - INTERFACE - INTEGER FUNCTION h5tbread_field_index_int_c(loc_id,namelen,dset_name,field_index,& - start,nrecords,type_size,buf) - - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TBREAD_FIELD_INDEX_INT_C'::h5tbread_field_index_int_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: field_index ! index - INTEGER(hsize_t), INTENT(in) :: start ! start record - INTEGER(hsize_t), INTENT(in) :: nrecords ! records - INTEGER(size_t), INTENT(in) :: type_size ! type size - INTEGER, INTENT(in), DIMENSION(*) :: buf ! data buffer - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - END FUNCTION h5tbread_field_index_int_c - END INTERFACE - - namelen = LEN(dset_name) - - errcode = h5tbread_field_index_int_c(loc_id,namelen,dset_name,field_index,& - start,nrecords,type_size,buf) - -END SUBROUTINE h5tbread_field_index_f_int - -!------------------------------------------------------------------------- -! Function: h5tbread_field_index_f_float -! -! Purpose: Reads one field -! -! Programmer: pvn@ncsa.uiuc.edu -! -! Date: October 12, 2004 -! -! Comments: -! -! Modifications: -! -!------------------------------------------------------------------------- - -SUBROUTINE h5tbread_field_index_f_float(loc_id,& - dset_name,& - field_index,& - start,& - nrecords,& - type_size,& - buf,& - errcode ) - - IMPLICIT NONE - -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5tbread_field_index_f_float -!DEC$endif -! - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: field_index ! index - INTEGER(hsize_t), INTENT(in) :: start ! start record - INTEGER(hsize_t), INTENT(in) :: nrecords ! records - INTEGER(size_t), INTENT(in) :: type_size ! type size - REAL, INTENT(in), DIMENSION(*) :: buf ! data buffer - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - - INTERFACE - INTEGER FUNCTION h5tbread_field_index_fl_c(loc_id,namelen,dset_name,field_index,& - start,nrecords,type_size,buf) - - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TBREAD_FIELD_INDEX_FL_C'::h5tbread_field_index_fl_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: field_index ! index - INTEGER(hsize_t), INTENT(in) :: start ! start record - INTEGER(hsize_t), INTENT(in) :: nrecords ! records - INTEGER(size_t), INTENT(in) :: type_size ! type size - REAL, INTENT(in), DIMENSION(*) :: buf ! data buffer - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - END FUNCTION h5tbread_field_index_fl_c - END INTERFACE - - namelen = LEN(dset_name) - - errcode = h5tbread_field_index_fl_c(loc_id,namelen,dset_name,field_index,& - start,nrecords,type_size,buf) - -END SUBROUTINE h5tbread_field_index_f_float - -!------------------------------------------------------------------------- -! Function: h5tbread_field_index_f_double -! -! Purpose: Reads one field -! -! Programmer: pvn@ncsa.uiuc.edu -! -! Date: October 12, 2004 -! -! Comments: -! -! Modifications: -! -!------------------------------------------------------------------------- - -SUBROUTINE h5tbread_field_index_f_double(loc_id,& - dset_name,& - field_index,& - start,& - nrecords,& - type_size,& - buf,& - errcode ) - - IMPLICIT NONE - -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5tbread_field_index_f_double -!DEC$endif -! - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: field_index ! index - INTEGER(hsize_t), INTENT(in) :: start ! start record - INTEGER(hsize_t), INTENT(in) :: nrecords ! records - INTEGER(size_t), INTENT(in) :: type_size ! type size - DOUBLE PRECISION, INTENT(in), DIMENSION(*) :: buf ! data buffer - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - - INTERFACE - INTEGER FUNCTION h5tbread_field_index_dl_c(loc_id,namelen,dset_name,field_index,& - start,nrecords,type_size,buf) - - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TBREAD_FIELD_INDEX_DL_C'::h5tbread_field_index_dl_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: field_index ! index - INTEGER(hsize_t), INTENT(in) :: start ! start record - INTEGER(hsize_t), INTENT(in) :: nrecords ! records - INTEGER(size_t), INTENT(in) :: type_size ! type size - DOUBLE PRECISION, INTENT(in), DIMENSION(*) :: buf ! data buffer - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - END FUNCTION h5tbread_field_index_dl_c - END INTERFACE - - namelen = LEN(dset_name) - - errcode = h5tbread_field_index_dl_c(loc_id,namelen,dset_name,field_index,& - start,nrecords,type_size,buf) - -END SUBROUTINE h5tbread_field_index_f_double - -!------------------------------------------------------------------------- -! Function: h5tbread_field_index_f_string -! -! Purpose: Reads one field -! -! Programmer: pvn@ncsa.uiuc.edu -! -! Date: October 12, 2004 -! -! Comments: -! -! Modifications: -! -!------------------------------------------------------------------------- - -SUBROUTINE h5tbread_field_index_f_string(loc_id,& - dset_name,& - field_index,& - start,& - nrecords,& - type_size,& - buf,& - errcode ) - - IMPLICIT NONE - -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5tbread_field_index_f_string -!DEC$endif -! - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: field_index ! index - INTEGER(hsize_t), INTENT(in) :: start ! start record - INTEGER(hsize_t), INTENT(in) :: nrecords ! records - INTEGER(size_t), INTENT(in) :: type_size ! type size - CHARACTER(LEN=*), INTENT(in), DIMENSION(*) :: buf ! data buffer - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - - INTERFACE - INTEGER FUNCTION h5tbread_field_index_st_c(loc_id,namelen,dset_name,field_index,& - start,nrecords,type_size,buf) - - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TBREAD_FIELD_INDEX_ST_C'::h5tbread_field_index_st_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER, INTENT(in) :: field_index ! index - INTEGER(hsize_t), INTENT(in) :: start ! start record - INTEGER(hsize_t), INTENT(in) :: nrecords ! records - INTEGER(size_t), INTENT(in) :: type_size ! type size - CHARACTER(LEN=*), INTENT(in), DIMENSION(*) :: buf ! data buffer - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - END FUNCTION h5tbread_field_index_st_c - END INTERFACE - - namelen = LEN(dset_name) - - errcode = h5tbread_field_index_st_c(loc_id,namelen,dset_name,field_index,& - start,nrecords,type_size,buf) - -END SUBROUTINE h5tbread_field_index_f_string - - -!------------------------------------------------------------------------- -! Function: h5tbinsert_field_f_int -! -! Purpose: Inserts one field -! -! Programmer: pvn@ncsa.uiuc.edu -! -! Date: October 13, 2004 -! -! Comments: -! -! Modifications: -! -!------------------------------------------------------------------------- - -SUBROUTINE h5tbinsert_field_f_int(loc_id,& - dset_name,& - field_name,& - field_type,& - field_index,& - buf,& - errcode ) - IMPLICIT NONE - -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5tbinsert_field_f_int -!DEC$endif -! - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset - CHARACTER(LEN=*), INTENT(in) :: field_name ! name of the field - INTEGER(hid_t), INTENT(in) :: field_type ! field type - INTEGER, INTENT(in) :: field_index ! field_index - INTEGER, INTENT(in), DIMENSION(*) :: buf ! data buffer - INTEGER(size_t) :: namelen ! name length - INTEGER(size_t) :: namelen1 ! name length - INTEGER :: errcode ! error code - - - INTERFACE - INTEGER FUNCTION h5tbinsert_field_int_c(loc_id,namelen,dset_name,namelen1,field_name,& - field_type,field_index,buf) - - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TBINSERT_FIELD_INT_C'::h5tbinsert_field_int_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - !DEC$ATTRIBUTES reference :: field_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset - CHARACTER(LEN=*), INTENT(in) :: field_name ! name of the field - INTEGER(hid_t), INTENT(in) :: field_type ! field type - INTEGER, INTENT(in) :: field_index ! field_index - INTEGER, INTENT(in), DIMENSION(*) :: buf ! data buffer - INTEGER(size_t) :: namelen ! name length - INTEGER(size_t) :: namelen1 ! name length length - END FUNCTION h5tbinsert_field_int_c - END INTERFACE - - namelen = LEN(dset_name) - namelen1 = LEN(field_name) - - errcode = h5tbinsert_field_int_c(loc_id,namelen,dset_name,namelen1,field_name,& - field_type,field_index,buf) - -END SUBROUTINE h5tbinsert_field_f_int - - - -!------------------------------------------------------------------------- -! Function: h5tbinsert_field_f_float -! -! Purpose: Inserts one field -! -! Programmer: pvn@ncsa.uiuc.edu -! -! Date: October 13, 2004 -! -! Comments: -! -! Modifications: -! -!------------------------------------------------------------------------- - -SUBROUTINE h5tbinsert_field_f_float(loc_id,& - dset_name,& - field_name,& - field_type,& - field_index,& - buf,& - errcode ) - IMPLICIT NONE - -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5tbinsert_field_f_float -!DEC$endif -! - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset - CHARACTER(LEN=*), INTENT(in) :: field_name ! name of the field - INTEGER(hid_t), INTENT(in) :: field_type ! field type - INTEGER, INTENT(in) :: field_index ! field_index - REAL, INTENT(in), DIMENSION(*) :: buf ! data buffer - INTEGER(size_t) :: namelen ! name length - INTEGER(size_t) :: namelen1 ! name length - INTEGER :: errcode ! error code - - - INTERFACE - INTEGER FUNCTION h5tbinsert_field_fl_c(loc_id,namelen,dset_name,namelen1,field_name,& - field_type,field_index,buf) - - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TBINSERT_FIELD_FL_C'::h5tbinsert_field_fl_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - !DEC$ATTRIBUTES reference :: field_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset - CHARACTER(LEN=*), INTENT(in) :: field_name ! name of the field - INTEGER(hid_t), INTENT(in) :: field_type ! field type - INTEGER, INTENT(in) :: field_index ! field_index - REAL, INTENT(in), DIMENSION(*) :: buf ! data buffer - INTEGER(size_t) :: namelen ! name length - INTEGER(size_t) :: namelen1 ! name length length - END FUNCTION h5tbinsert_field_fl_c - END INTERFACE - - namelen = LEN(dset_name) - namelen1 = LEN(field_name) - - errcode = h5tbinsert_field_fl_c(loc_id,namelen,dset_name,namelen1,field_name,& - field_type,field_index,buf) - -END SUBROUTINE h5tbinsert_field_f_float - - - -!------------------------------------------------------------------------- -! Function: h5tbinsert_field_f_double -! -! Purpose: Inserts one field -! -! Programmer: pvn@ncsa.uiuc.edu -! -! Date: October 13, 2004 -! -! Comments: -! -! Modifications: -! -!------------------------------------------------------------------------- - -SUBROUTINE h5tbinsert_field_f_double(loc_id,& - dset_name,& - field_name,& - field_type,& - field_index,& - buf,& - errcode ) - IMPLICIT NONE - -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5tbinsert_field_f_double -!DEC$endif -! - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset - CHARACTER(LEN=*), INTENT(in) :: field_name ! name of the field - INTEGER(hid_t), INTENT(in) :: field_type ! field type - INTEGER, INTENT(in) :: field_index ! field_index - DOUBLE PRECISION, INTENT(in), DIMENSION(*) :: buf ! data buffer - INTEGER(size_t) :: namelen ! name length - INTEGER(size_t) :: namelen1 ! name length - INTEGER :: errcode ! error code - - - INTERFACE - INTEGER FUNCTION h5tbinsert_field_dl_c(loc_id,namelen,dset_name,namelen1,field_name,& - field_type,field_index,buf) - - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TBINSERT_FIELD_DL_C'::h5tbinsert_field_dl_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - !DEC$ATTRIBUTES reference :: field_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset - CHARACTER(LEN=*), INTENT(in) :: field_name ! name of the field - INTEGER(hid_t), INTENT(in) :: field_type ! field type - INTEGER, INTENT(in) :: field_index ! field_index - DOUBLE PRECISION, INTENT(in), DIMENSION(*) :: buf ! data buffer - INTEGER(size_t) :: namelen ! name length - INTEGER(size_t) :: namelen1 ! name length length - END FUNCTION h5tbinsert_field_dl_c - END INTERFACE - - namelen = LEN(dset_name) - namelen1 = LEN(field_name) - - errcode = h5tbinsert_field_dl_c(loc_id,namelen,dset_name,namelen1,field_name,& - field_type,field_index,buf) - -END SUBROUTINE h5tbinsert_field_f_double - - - - -!------------------------------------------------------------------------- -! Function: h5tbinsert_field_f_string -! -! Purpose: Inserts one field -! -! Programmer: pvn@ncsa.uiuc.edu -! -! Date: October 13, 2004 -! -! Comments: -! -! Modifications: -! -!------------------------------------------------------------------------- - -SUBROUTINE h5tbinsert_field_f_string(loc_id,& - dset_name,& - field_name,& - field_type,& - field_index,& - buf,& - errcode ) - IMPLICIT NONE - -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5tbinsert_field_f_string -!DEC$endif -! - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset - CHARACTER(LEN=*), INTENT(in) :: field_name ! name of the field - INTEGER(hid_t), INTENT(in) :: field_type ! field type - INTEGER, INTENT(in) :: field_index ! field_index - CHARACTER(LEN=*), INTENT(in), DIMENSION(*) :: buf ! data buffer - INTEGER(size_t) :: namelen ! name length - INTEGER(size_t) :: namelen1 ! name length - INTEGER :: errcode ! error code - - - INTERFACE - INTEGER FUNCTION h5tbinsert_field_st_c(loc_id,namelen,dset_name,namelen1,field_name,& - field_type,field_index,buf) - - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TBINSERT_FIELD_ST_C'::h5tbinsert_field_st_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - !DEC$ATTRIBUTES reference :: field_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset - CHARACTER(LEN=*), INTENT(in) :: field_name ! name of the field - INTEGER(hid_t), INTENT(in) :: field_type ! field type - INTEGER, INTENT(in) :: field_index ! field_index - CHARACTER(LEN=*), INTENT(in), DIMENSION(*) :: buf ! data buffer - INTEGER(size_t) :: namelen ! name length - INTEGER(size_t) :: namelen1 ! name length length - END FUNCTION h5tbinsert_field_st_c - END INTERFACE - - namelen = LEN(dset_name) - namelen1 = LEN(field_name) - - errcode = h5tbinsert_field_st_c(loc_id,namelen,dset_name,namelen1,field_name,& - field_type,field_index,buf) - -END SUBROUTINE h5tbinsert_field_f_string - - - - -!------------------------------------------------------------------------- -! Function: h5tbdelete_field_f -! -! Purpose: Inserts one field -! -! Programmer: pvn@ncsa.uiuc.edu -! -! Date: October 13, 2004 -! -! Comments: -! -! Modifications: -! -!------------------------------------------------------------------------- - -SUBROUTINE h5tbdelete_field_f(loc_id,& - dset_name,& - field_name,& - errcode ) - IMPLICIT NONE - -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5tbdelete_field_f -!DEC$endif -! - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset - CHARACTER(LEN=*), INTENT(in) :: field_name ! name of the field - INTEGER(size_t) :: namelen ! name length - INTEGER(size_t) :: namelen1 ! name length - INTEGER :: errcode ! error code - - - INTERFACE - INTEGER FUNCTION h5tbdelete_field_c(loc_id,namelen,dset_name,namelen1,field_name) - - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TBDELETE_FIELD_C'::h5tbdelete_field_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - !DEC$ATTRIBUTES reference :: field_name - INTEGER(HID_T), INTENT(IN) :: loc_id ! file or group identifier - CHARACTER(LEN=*), INTENT(IN) :: dset_name ! name of the dataset - CHARACTER(LEN=*), INTENT(IN) :: field_name ! name of the field - INTEGER(size_t) :: namelen ! name length - INTEGER(size_t) :: namelen1 ! name length length - END FUNCTION h5tbdelete_field_c - END INTERFACE - - namelen = LEN(dset_name) - namelen1 = LEN(field_name) - - errcode = h5tbdelete_field_c(loc_id,namelen,dset_name,namelen1,field_name) - -END SUBROUTINE h5tbdelete_field_f - - - -!------------------------------------------------------------------------- -! Function: h5tbget_table_info_f -! -! Purpose: Gets the number of records and fields of a table -! -! Return: Success: 0, Failure: -1 -! -! Programmer: pvn@ncsa.uiuc.edu -! -! Date: October 13, 2004 -! -! Comments: -! -! Modifications: -! -!------------------------------------------------------------------------- - -SUBROUTINE h5tbget_table_info_f(loc_id,& - dset_name,& - nfields,& - nrecords,& - errcode ) - - IMPLICIT NONE - -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5tbget_table_info_f -!DEC$endif -! - - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hsize_t), INTENT(inout):: nfields ! nfields - INTEGER(hsize_t), INTENT(inout):: nrecords ! nrecords - INTEGER :: errcode ! error code - INTEGER(size_t) :: namelen ! name length - - INTERFACE - INTEGER FUNCTION h5tbget_table_info_c(loc_id,namelen,dset_name,nfields,nrecords) - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TBGET_TABLE_INFO_C'::h5tbget_table_info_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hsize_t), INTENT(inout):: nfields ! nfields - INTEGER(hsize_t), INTENT(inout):: nrecords ! nrecords - INTEGER(size_t) :: namelen ! name length - END FUNCTION h5tbget_table_info_c - END INTERFACE - - namelen = LEN(dset_name) - errcode = h5tbget_table_info_c(loc_id,namelen,dset_name,nfields,nrecords) - -END SUBROUTINE h5tbget_table_info_f - - -!------------------------------------------------------------------------- -! Function: h5tbget_field_info_f -! -! Purpose: Get information about fields -! -! Return: Success: 0, Failure: -1 -! -! Programmer: pvn@ncsa.uiuc.edu -! -! Date: October 13, 2004 -! -! Comments: -! -! Modifications: -! Added optional parameter for returning the maximum character length -! in the field name array. March 3, 2011 -! -!------------------------------------------------------------------------- - -SUBROUTINE h5tbget_field_info_f(loc_id,& - dset_name,& - nfields,& - field_names,& - field_sizes,& - field_offsets,& - type_size,& - errcode, maxlen_out ) - - IMPLICIT NONE -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5tbget_field_info_f -!DEC$endif -! - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hsize_t), INTENT(in) :: nfields ! nfields - CHARACTER(LEN=*), DIMENSION(nfields), INTENT(inout) :: field_names ! field names - INTEGER(size_t), DIMENSION(nfields), INTENT(inout) :: field_sizes ! field sizes - INTEGER(size_t), DIMENSION(nfields), INTENT(inout) :: field_offsets ! field offsets - INTEGER(size_t), INTENT(inout):: type_size ! type size - INTEGER :: errcode ! error code - INTEGER, OPTIONAL :: maxlen_out ! maximum character len of the field names - INTEGER(size_t) :: namelen ! name length - INTEGER(size_t), DIMENSION(nfields) :: namelen2 ! name lengths - INTEGER(hsize_t) :: i ! general purpose integer - INTEGER(size_t) :: maxlen - INTEGER(size_t) :: c_maxlen_out - - INTERFACE - INTEGER FUNCTION h5tbget_field_info_c(loc_id,namelen,dset_name,nfields,& - field_sizes,field_offsets,type_size,namelen2, maxlen, field_names, c_maxlen_out) - - USE h5global - IMPLICIT NONE - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TBGET_FIELD_INFO_C'::h5tbget_field_info_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: dset_name - INTEGER(hid_t), INTENT(in) :: loc_id ! file or group identifier - CHARACTER(LEN=*), INTENT(in) :: dset_name ! name of the dataset - INTEGER(hsize_t), INTENT(in):: nfields ! nfields - CHARACTER(LEN=*), DIMENSION(1:nfields), INTENT(inout) :: field_names ! field names - INTEGER(size_t), DIMENSION(1:nfields), INTENT(inout) :: field_sizes ! field sizes - INTEGER(size_t), DIMENSION(1:nfields), INTENT(inout) :: field_offsets ! field offsets - INTEGER(size_t), INTENT(inout):: type_size ! type size - INTEGER(size_t) :: namelen ! name length - INTEGER(size_t) :: maxlen ! maxiumum length of input field names - INTEGER(size_t), DIMENSION(1:nfields) :: namelen2 ! name lengths - INTEGER(size_t) :: c_maxlen_out ! maximum character length of a field array element - END FUNCTION h5tbget_field_info_c - END INTERFACE - - namelen = LEN(dset_name) - DO i = 1, nfields - namelen2(i) = LEN_TRIM(field_names(i)) - END DO - maxlen = LEN(field_names(1)) - c_maxlen_out = 0 - - errcode = h5tbget_field_info_c(loc_id, namelen,dset_name, nfields, & - field_sizes, field_offsets, type_size, namelen2, maxlen, field_names, c_maxlen_out) - - IF(PRESENT(maxlen_out)) maxlen_out = c_maxlen_out - -END SUBROUTINE h5tbget_field_info_f - -END MODULE H5TB - - - - - - diff --git a/hl/fortran/src/Makefile.am b/hl/fortran/src/Makefile.am index c8c4541..6457f81 100644 --- a/hl/fortran/src/Makefile.am +++ b/hl/fortran/src/Makefile.am @@ -42,12 +42,12 @@ endif # Source files for the library #if BUILD_PARALLEL_CONDITIONAL -# PARALLEL_COND_SRC=HDFDmpiof.c HDF5mpio.f90 +# PARALLEL_COND_SRC=HDFDmpiof.c HDF5mpio.F90 #endif # List sources to include in the HDF5 HL Fortran library. -libhdf5hl_fortran_la_SOURCES=H5DSfc.c H5LTfc.c H5IMfc.c H5IMcc.c H5TBfc.c \ - H5DSff.f90 H5LTff.f90 H5IMff.f90 H5TBff.f90 +libhdf5hl_fortran_la_SOURCES=H5DSfc.c H5LTfc.c H5IMfc.c H5IMcc.c H5TBfc.c \ + H5DSff.F90 H5LTff.F90 H5TBff.F90 H5IMff.F90 H5LTff_gen.F90 H5TBff_gen.F90 # HDF5 HL Fortran library depends on HDF5 Library. libhdf5hl_fortran_la_LIBADD=$(LIBH5_HL) $(LIBH5F) @@ -60,7 +60,7 @@ maintainer-clean-local: clean-local distclean-local: clean-local clean-local: @if test -n "$(F9XMODEXT)" && test "X$(F9XMODEXT)" != "Xo"; then \ - $(RM) *.$(F9XMODEXT); \ + $(RM) *.$(F9XMODEXT) H5LTff_gen.F90 H5TBff_gen.F90; \ fi install-data-local: @@ -75,13 +75,31 @@ uninstall-local: fi; \ fi +# These are the helper programs we need to build. +noinst_PROGRAMS = H5HL_buildiface + +# H5HL_buildiface.F90 generates all the APIs that have a KIND type associated +# with them. + +H5LTff_gen.F90: H5HL_buildiface$(EXEEXT) + $(RUNSERIAL) ./H5HL_buildiface$(EXEEXT) + +H5TBff_gen.F90: H5HL_buildiface$(EXEEXT) + +#H5TBff_gen.F90: H5HL_buildiface$(EXEEXT) + +# H5HL_buildiface.F90 is included in the distribution, and Automake knows +# how to compile a fortran program given its sources. + +H5HL_buildiface_SOURCES = H5HL_buildiface.F90 # Hardcode the dependencies of these files. There isn't a known way of # determining this automagically (like we do with the C files). So, when # doing a parallel make, some modules could be made way before the # modules they depend upon are actually made. *sigh* -H5DSff.lo: $(srcdir)/H5DSff.f90 -H5LTff.lo: $(srcdir)/H5LTff.f90 -H5IMff.lo: $(srcdir)/H5IMff.f90 -H5TBff.lo: $(srcdir)/H5TBff.f90 - +H5DSff.lo: $(srcdir)/H5DSff.F90 +H5LTff.lo: $(srcdir)/H5LTff.F90 +H5IMff.lo: $(srcdir)/H5IMff.F90 +H5TBff.lo: $(srcdir)/H5TBff.F90 +H5LTff_gen.lo: H5LTff.lo H5LTff_gen.F90 +H5TBff_gen.lo: H5TBff.lo H5LTff_gen.F90 H5TBff_gen.F90 include $(top_srcdir)/config/conclude.am diff --git a/hl/fortran/src/Makefile.in b/hl/fortran/src/Makefile.in index 029e5a1..956eda8 100644 --- a/hl/fortran/src/Makefile.in +++ b/hl/fortran/src/Makefile.in @@ -31,6 +31,7 @@ # # HDF5 High-Level Fortran Makefile(.in) + VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ @@ -105,6 +106,7 @@ DIST_COMMON = $(top_srcdir)/config/commence.am \ # want to build a shared C library and a static Fortran library. If so, # pass the -static flag to the library linker. @FORTRAN_SHARED_CONDITIONAL_FALSE@am__append_1 = -static +noinst_PROGRAMS = H5HL_buildiface$(EXEEXT) TESTS = subdir = hl/fortran/src ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 @@ -113,7 +115,8 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/aclocal_cxx.m4 \ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/bin/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/src/H5config.h +CONFIG_HEADER = $(top_builddir)/src/H5config.h \ + $(top_builddir)/fortran/src/H5config_f.inc CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; @@ -147,7 +150,8 @@ am__installdirs = "$(DESTDIR)$(libdir)" LTLIBRARIES = $(lib_LTLIBRARIES) libhdf5hl_fortran_la_DEPENDENCIES = $(LIBH5_HL) $(LIBH5F) am_libhdf5hl_fortran_la_OBJECTS = H5DSfc.lo H5LTfc.lo H5IMfc.lo \ - H5IMcc.lo H5TBfc.lo H5DSff.lo H5LTff.lo H5IMff.lo H5TBff.lo + H5IMcc.lo H5TBfc.lo H5DSff.lo H5LTff.lo H5TBff.lo H5IMff.lo \ + H5LTff_gen.lo H5TBff_gen.lo libhdf5hl_fortran_la_OBJECTS = $(am_libhdf5hl_fortran_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) @@ -157,6 +161,10 @@ libhdf5hl_fortran_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=FC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(FCLD) \ $(AM_FCFLAGS) $(FCFLAGS) $(libhdf5hl_fortran_la_LDFLAGS) \ $(LDFLAGS) -o $@ +PROGRAMS = $(noinst_PROGRAMS) +am_H5HL_buildiface_OBJECTS = H5HL_buildiface.$(OBJEXT) +H5HL_buildiface_OBJECTS = $(am_H5HL_buildiface_OBJECTS) +H5HL_buildiface_LDADD = $(LDADD) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false @@ -169,10 +177,28 @@ AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = -DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src -I$(top_builddir)/fortran/src depcomp = $(SHELL) $(top_srcdir)/bin/depcomp am__depfiles_maybe = depfiles am__mv = mv -f +PPFCCOMPILE = $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) +LTPPFCCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=FC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_FCFLAGS) $(FCFLAGS) +AM_V_PPFC = $(am__v_PPFC_@AM_V@) +am__v_PPFC_ = $(am__v_PPFC_@AM_DEFAULT_V@) +am__v_PPFC_0 = @echo " PPFC " $@; +am__v_PPFC_1 = +FCLD = $(FC) +FCLINK = $(LIBTOOL) $(AM_V_lt) --tag=FC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(FCLD) $(AM_FCFLAGS) $(FCFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_FCLD = $(am__v_FCLD_@AM_V@) +am__v_FCLD_ = $(am__v_FCLD_@AM_DEFAULT_V@) +am__v_FCLD_0 = @echo " FCLD " $@; +am__v_FCLD_1 = COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ @@ -191,23 +217,9 @@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = -FCCOMPILE = $(FC) $(AM_FCFLAGS) $(FCFLAGS) -LTFCCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=FC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=compile $(FC) $(AM_FCFLAGS) $(FCFLAGS) -AM_V_FC = $(am__v_FC_@AM_V@) -am__v_FC_ = $(am__v_FC_@AM_DEFAULT_V@) -am__v_FC_0 = @echo " FC " $@; -am__v_FC_1 = -FCLD = $(FC) -FCLINK = $(LIBTOOL) $(AM_V_lt) --tag=FC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(FCLD) $(AM_FCFLAGS) $(FCFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_FCLD = $(am__v_FCLD_@AM_V@) -am__v_FCLD_ = $(am__v_FCLD_@AM_DEFAULT_V@) -am__v_FCLD_0 = @echo " FCLD " $@; -am__v_FCLD_1 = -SOURCES = $(libhdf5hl_fortran_la_SOURCES) -DIST_SOURCES = $(libhdf5hl_fortran_la_SOURCES) +SOURCES = $(libhdf5hl_fortran_la_SOURCES) $(H5HL_buildiface_SOURCES) +DIST_SOURCES = $(libhdf5hl_fortran_la_SOURCES) \ + $(H5HL_buildiface_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ @@ -469,14 +481,21 @@ F9XMODEXT = @F9XMODEXT@ F9XMODFLAG = @F9XMODFLAG@ F9XSUFFIXFLAG = @F9XSUFFIXFLAG@ FC = @FC@ -FC2003 = @FC2003@ FCFLAGS = @FCFLAGS@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ +FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ +FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ +FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ +H5CONFIG_F_IKIND = @H5CONFIG_F_IKIND@ +H5CONFIG_F_NUM_IKIND = @H5CONFIG_F_NUM_IKIND@ +H5CONFIG_F_NUM_RKIND = @H5CONFIG_F_NUM_RKIND@ +H5CONFIG_F_RKIND = @H5CONFIG_F_RKIND@ +H5CONFIG_F_RKIND_SIZEOF = @H5CONFIG_F_RKIND_SIZEOF@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ @@ -486,13 +505,12 @@ H5_LDFLAGS = @H5_LDFLAGS@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ -HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_Fortran_INTEGER_SIZEOF_16 = @HAVE_Fortran_INTEGER_SIZEOF_16@ HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ HDF_FORTRAN = @HDF_FORTRAN@ -HDF_FORTRAN2003 = @HDF_FORTRAN2003@ HID_T = @HID_T@ HL = @HL@ HL_FOR = @HL_FOR@ @@ -534,6 +552,18 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PAC_C_MAX_REAL_PRECISION = @PAC_C_MAX_REAL_PRECISION@ +PAC_FC_ALL_INTEGER_KINDS = @PAC_FC_ALL_INTEGER_KINDS@ +PAC_FC_ALL_INTEGER_KINDS_SIZEOF = @PAC_FC_ALL_INTEGER_KINDS_SIZEOF@ +PAC_FC_ALL_REAL_KINDS = @PAC_FC_ALL_REAL_KINDS@ +PAC_FC_ALL_REAL_KINDS_SIZEOF = @PAC_FC_ALL_REAL_KINDS_SIZEOF@ +PAC_FC_MAX_REAL_PRECISION = @PAC_FC_MAX_REAL_PRECISION@ +PAC_FORTRAN_NATIVE_DOUBLE_KIND = @PAC_FORTRAN_NATIVE_DOUBLE_KIND@ +PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF = @PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF@ +PAC_FORTRAN_NATIVE_INTEGER_KIND = @PAC_FORTRAN_NATIVE_INTEGER_KIND@ +PAC_FORTRAN_NATIVE_INTEGER_SIZEOF = @PAC_FORTRAN_NATIVE_INTEGER_SIZEOF@ +PAC_FORTRAN_NATIVE_REAL_KIND = @PAC_FORTRAN_NATIVE_REAL_KIND@ +PAC_FORTRAN_NATIVE_REAL_SIZEOF = @PAC_FORTRAN_NATIVE_REAL_SIZEOF@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ @@ -691,17 +721,23 @@ libhdf5hl_fortran_la_LDFLAGS = -version-info $(LT_VERS_INTERFACE):$(LT_VERS_REVI # Source files for the library #if BUILD_PARALLEL_CONDITIONAL -# PARALLEL_COND_SRC=HDFDmpiof.c HDF5mpio.f90 +# PARALLEL_COND_SRC=HDFDmpiof.c HDF5mpio.F90 #endif # List sources to include in the HDF5 HL Fortran library. -libhdf5hl_fortran_la_SOURCES = H5DSfc.c H5LTfc.c H5IMfc.c H5IMcc.c H5TBfc.c \ - H5DSff.f90 H5LTff.f90 H5IMff.f90 H5TBff.f90 +libhdf5hl_fortran_la_SOURCES = H5DSfc.c H5LTfc.c H5IMfc.c H5IMcc.c H5TBfc.c \ + H5DSff.F90 H5LTff.F90 H5TBff.F90 H5IMff.F90 H5LTff_gen.F90 H5TBff_gen.F90 # HDF5 HL Fortran library depends on HDF5 Library. libhdf5hl_fortran_la_LIBADD = $(LIBH5_HL) $(LIBH5F) +#H5TBff_gen.F90: H5HL_buildiface$(EXEEXT) + +# H5HL_buildiface.F90 is included in the distribution, and Automake knows +# how to compile a fortran program given its sources. +H5HL_buildiface_SOURCES = H5HL_buildiface.F90 + # Automake needs to be taught how to build lib, progs, and tests targets. # These will be filled in automatically for the most part (e.g., # lib_LIBRARIES are built for lib target), but EXTRA_LIB, EXTRA_PROG, and @@ -724,7 +760,7 @@ TEST_SCRIPT_PARA_CHKSH = $(TEST_SCRIPT_PARA:=.chkexe_) all: all-am .SUFFIXES: -.SUFFIXES: .c .f90 .lo .log .o .obj .sh .sh$(EXEEXT) .trs +.SUFFIXES: .F90 .c .lo .log .o .obj .sh .sh$(EXEEXT) .trs $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/config/commence.am $(top_srcdir)/config/lt_vers.am $(top_srcdir)/config/conclude.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ @@ -795,6 +831,19 @@ clean-libLTLIBRARIES: libhdf5hl_fortran.la: $(libhdf5hl_fortran_la_OBJECTS) $(libhdf5hl_fortran_la_DEPENDENCIES) $(EXTRA_libhdf5hl_fortran_la_DEPENDENCIES) $(AM_V_FCLD)$(libhdf5hl_fortran_la_LINK) -rpath $(libdir) $(libhdf5hl_fortran_la_OBJECTS) $(libhdf5hl_fortran_la_LIBADD) $(LIBS) +clean-noinstPROGRAMS: + @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list + +H5HL_buildiface$(EXEEXT): $(H5HL_buildiface_OBJECTS) $(H5HL_buildiface_DEPENDENCIES) $(EXTRA_H5HL_buildiface_DEPENDENCIES) + @rm -f H5HL_buildiface$(EXEEXT) + $(AM_V_FCLD)$(FCLINK) $(H5HL_buildiface_OBJECTS) $(H5HL_buildiface_LDADD) $(LIBS) + mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -807,6 +856,15 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5LTfc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5TBfc.Plo@am__quote@ +.F90.o: + $(AM_V_PPFC)$(PPFCCOMPILE) -c -o $@ $< + +.F90.obj: + $(AM_V_PPFC)$(PPFCCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.F90.lo: + $(AM_V_PPFC)$(LTPPFCCOMPILE) -c -o $@ $< + .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @@ -828,15 +886,6 @@ distclean-compile: @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< -.f90.o: - $(AM_V_FC)$(FCCOMPILE) -c -o $@ $(FCFLAGS_f90) $< - -.f90.obj: - $(AM_V_FC)$(FCCOMPILE) -c -o $@ $(FCFLAGS_f90) `$(CYGPATH_W) '$<'` - -.f90.lo: - $(AM_V_FC)$(LTFCCOMPILE) -c -o $@ $(FCFLAGS_f90) $< - mostlyclean-libtool: -rm -f *.lo @@ -1073,7 +1122,7 @@ distdir: $(DISTFILES) check-am: all-am $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-am -all-am: Makefile $(LTLIBRARIES) all-local +all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) all-local installdirs: for dir in "$(DESTDIR)$(libdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ @@ -1114,7 +1163,7 @@ maintainer-clean-generic: clean: clean-am clean-am: clean-generic clean-libLTLIBRARIES clean-libtool clean-local \ - mostlyclean-am + clean-noinstPROGRAMS mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) @@ -1187,8 +1236,8 @@ uninstall-am: uninstall-libLTLIBRARIES uninstall-local .PHONY: CTAGS GTAGS TAGS all all-am all-local check check-TESTS \ check-am clean clean-generic clean-libLTLIBRARIES \ - clean-libtool clean-local cscopelist-am ctags ctags-am \ - distclean distclean-compile distclean-generic \ + clean-libtool clean-local clean-noinstPROGRAMS cscopelist-am \ + ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-local distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-data-local install-dvi \ @@ -1236,7 +1285,7 @@ maintainer-clean-local: clean-local distclean-local: clean-local clean-local: @if test -n "$(F9XMODEXT)" && test "X$(F9XMODEXT)" != "Xo"; then \ - $(RM) *.$(F9XMODEXT); \ + $(RM) *.$(F9XMODEXT) H5LTff_gen.F90 H5TBff_gen.F90; \ fi install-data-local: @@ -1251,14 +1300,23 @@ uninstall-local: fi; \ fi +# H5HL_buildiface.F90 generates all the APIs that have a KIND type associated +# with them. + +H5LTff_gen.F90: H5HL_buildiface$(EXEEXT) + $(RUNSERIAL) ./H5HL_buildiface$(EXEEXT) + +H5TBff_gen.F90: H5HL_buildiface$(EXEEXT) # Hardcode the dependencies of these files. There isn't a known way of # determining this automagically (like we do with the C files). So, when # doing a parallel make, some modules could be made way before the # modules they depend upon are actually made. *sigh* -H5DSff.lo: $(srcdir)/H5DSff.f90 -H5LTff.lo: $(srcdir)/H5LTff.f90 -H5IMff.lo: $(srcdir)/H5IMff.f90 -H5TBff.lo: $(srcdir)/H5TBff.f90 +H5DSff.lo: $(srcdir)/H5DSff.F90 +H5LTff.lo: $(srcdir)/H5LTff.F90 +H5IMff.lo: $(srcdir)/H5IMff.F90 +H5TBff.lo: $(srcdir)/H5TBff.F90 +H5LTff_gen.lo: H5LTff.lo H5LTff_gen.F90 +H5TBff_gen.lo: H5TBff.lo H5LTff_gen.F90 H5TBff_gen.F90 # lib/progs/tests targets recurse into subdirectories. build-* targets # build files in this directory. diff --git a/hl/fortran/src/hdf5_hl_fortrandll.def.in b/hl/fortran/src/hdf5_hl_fortrandll.def.in new file mode 100644 index 0000000..9a1231a --- /dev/null +++ b/hl/fortran/src/hdf5_hl_fortrandll.def.in @@ -0,0 +1,88 @@ +EXPORTS +; H5DS +H5DS_mp_H5DSSET_SCALE_F +H5DS_mp_H5DSATTACH_SCALE_F +H5DS_mp_H5DSDETACH_SCALE_F +H5DS_mp_H5DSIS_ATTACHED_F +H5DS_mp_H5DSIS_SCALE_F +H5DS_mp_H5DSSET_LABEL_F +H5DS_mp_H5DSGET_LABEL_F +H5DS_mp_H5DSGET_SCALE_NAME_F +H5DS_mp_H5DSGET_NUM_SCALES_F +; H5IM +H5IM_mp_H5IMMAKE_IMAGE_8BIT_F +H5IM_mp_H5IMREAD_IMAGE_F +H5IM_mp_H5IMMAKE_IMAGE_24BIT_F +H5IM_mp_H5IMGET_IMAGE_INFO_F +H5IM_mp_H5IMIS_IMAGE_F +H5IM_mp_H5IMMAKE_PALETTE_F +H5IM_mp_H5IMLINK_PALETTE_F +H5IM_mp_H5IMUNLINK_PALETTE_F +H5IM_mp_H5IMGET_NPALETTES_F +H5IM_mp_H5IMGET_PALETTE_INFO_F +H5IM_mp_H5IMGET_PALETTE_F +H5IM_mp_H5IMIS_PALETTE_F +; H5LT +H5LT_CONST_mp_H5LTMAKE_DATASET_F_PTR +H5LT_CONST_mp_H5LTMAKE_DATASET_F_INT1 +H5LT_CONST_mp_H5LTMAKE_DATASET_F_INT2 +H5LT_CONST_mp_H5LTMAKE_DATASET_F_INT3 +H5LT_CONST_mp_H5LTMAKE_DATASET_F_INT4 +H5LT_CONST_mp_H5LTMAKE_DATASET_F_INT5 +H5LT_CONST_mp_H5LTMAKE_DATASET_F_INT6 +H5LT_CONST_mp_H5LTMAKE_DATASET_F_INT7 +H5LT_CONST_mp_H5LTREAD_DATASET_F_PTR +H5LT_CONST_mp_H5LTREAD_DATASET_F_INT1 +H5LT_CONST_mp_H5LTREAD_DATASET_F_INT2 +H5LT_CONST_mp_H5LTREAD_DATASET_F_INT3 +H5LT_CONST_mp_H5LTREAD_DATASET_F_INT4 +H5LT_CONST_mp_H5LTREAD_DATASET_F_INT5 +H5LT_CONST_mp_H5LTREAD_DATASET_F_INT6 +H5LT_CONST_mp_H5LTREAD_DATASET_F_INT7 +H5LT_CONST_mp_H5LTMAKE_DATASET_INT_F_1 +H5LT_CONST_mp_H5LTMAKE_DATASET_INT_F_2 +H5LT_CONST_mp_H5LTMAKE_DATASET_INT_F_3 +H5LT_CONST_mp_H5LTMAKE_DATASET_INT_F_4 +H5LT_CONST_mp_H5LTMAKE_DATASET_INT_F_5 +H5LT_CONST_mp_H5LTMAKE_DATASET_INT_F_6 +H5LT_CONST_mp_H5LTMAKE_DATASET_INT_F_7 +H5LT_CONST_mp_H5LTREAD_DATASET_INT_F_1 +H5LT_CONST_mp_H5LTREAD_DATASET_INT_F_2 +H5LT_CONST_mp_H5LTREAD_DATASET_INT_F_3 +H5LT_CONST_mp_H5LTREAD_DATASET_INT_F_4 +H5LT_CONST_mp_H5LTREAD_DATASET_INT_F_5 +H5LT_CONST_mp_H5LTREAD_DATASET_INT_F_6 +H5LT_CONST_mp_H5LTREAD_DATASET_INT_F_7 +H5LT_CONST_mp_H5LTMAKE_DATASET_STRING_F +H5LT_CONST_mp_H5LTREAD_DATASET_STRING_F +H5LT_CONST_mp_H5LTSET_ATTRIBUTE_F +H5LT_CONST_mp_H5LTSET_ATTRIBUTE_INT_F +H5LT_CONST_mp_H5LTSET_ATTRIBUTE_FLOAT_F +H5LT_CONST_mp_H5LTSET_ATTRIBUTE_DOUBLE_F +H5LT_CONST_mp_H5LTSET_ATTRIBUTE_STRING_F +H5LT_CONST_mp_H5LTGET_ATTRIBUTE_F +H5LT_CONST_mp_H5LTGET_ATTRIBUTE_INT_F +H5LT_CONST_mp_H5LTGET_ATTRIBUTE_FLOAT_F +H5LT_CONST_mp_H5LTGET_ATTRIBUTE_DOUBLE_F +H5LT_CONST_mp_H5LTGET_ATTRIBUTE_STRING_F +H5LT_CONST_mp_H5LTGET_DATASET_NDIMS_F +H5LT_CONST_mp_H5LTFIND_DATASET_F +H5LT_CONST_mp_H5LTGET_DATASET_INFO_F +H5LT_CONST_mp_H5LTGET_ATTRIBUTE_NDIMS_F +H5LT_CONST_mp_H5LTGET_ATTRIBUTE_INFO_F +H5LT_CONST_mp_H5LTPATH_VALID_F +; H5TB +H5TB_CONST_mp_H5TBMAKE_TABLE_F +H5TB_CONST_mp_H5TBWRITE_FIELD_NAME_F_INT +H5TB_CONST_mp_H5TBWRITE_FIELD_NAME_F_STRING +H5TB_CONST_mp_H5TBREAD_FIELD_NAME_F_INT +H5TB_CONST_mp_H5TBREAD_FIELD_NAME_F_STRING +H5TB_CONST_mp_H5TBWRITE_FIELD_INDEX_F_INT +H5TB_CONST_mp_H5TBWRITE_FIELD_INDEX_F_STRING +H5TB_CONST_mp_H5TBREAD_FIELD_INDEX_F_INT +H5TB_CONST_mp_H5TBREAD_FIELD_INDEX_F_STRING +H5TB_CONST_mp_H5TBINSERT_FIELD_F_INT +H5TB_CONST_mp_H5TBINSERT_FIELD_F_STRING +H5TB_CONST_mp_H5TBDELETE_FIELD_F +H5TB_CONST_mp_H5TBGET_TABLE_INFO_F +H5TB_CONST_mp_H5TBGET_FIELD_INFO_F diff --git a/hl/fortran/test/CMakeLists.txt b/hl/fortran/test/CMakeLists.txt index 4918e06..a1d1386 100644 --- a/hl/fortran/test/CMakeLists.txt +++ b/hl/fortran/test/CMakeLists.txt @@ -7,7 +7,7 @@ PROJECT (HDF5_HL_FORTRAN_TESTS C CXX Fortran) INCLUDE_DIRECTORIES (${CMAKE_Fortran_MODULE_DIRECTORY} ${HDF5_F90_BINARY_DIR} ${HDF5_F90_SRC_DIR}/src) #-- Adding test for hl_f90_tstds -add_executable (hl_f90_tstds tstds.f90) +add_executable (hl_f90_tstds tstds.F90) TARGET_NAMING (hl_f90_tstds STATIC) TARGET_FORTRAN_PROPERTIES (hl_f90_tstds STATIC " " " ") target_link_libraries (hl_f90_tstds ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_TARGET}) @@ -15,7 +15,7 @@ target_include_directories (hl_f90_tstds PRIVATE ${CMAKE_Fortran_MODULE_DIRECTOR set_target_properties (hl_f90_tstds PROPERTIES LINKER_LANGUAGE Fortran) set_target_properties (hl_f90_tstds PROPERTIES FOLDER test/hl/fortran) if (BUILD_SHARED_LIBS) - add_executable (hl_f90_tstds-shared tstds.f90) + add_executable (hl_f90_tstds-shared tstds.F90) TARGET_NAMING (hl_f90_tstds-shared SHARED) TARGET_FORTRAN_PROPERTIES (hl_f90_tstds-shared SHARED " " " ") target_link_libraries (hl_f90_tstds-shared ${HDF5_HL_F90_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET}) @@ -28,7 +28,7 @@ if (BUILD_SHARED_LIBS) endif (BUILD_SHARED_LIBS) #-- Adding test for hl_f90_tstlite -add_executable (hl_f90_tstlite tstlite.f90) +add_executable (hl_f90_tstlite tstlite.F90) TARGET_NAMING (hl_f90_tstlite STATIC) TARGET_FORTRAN_PROPERTIES (hl_f90_tstlite STATIC " " " ") target_link_libraries (hl_f90_tstlite ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_TARGET}) @@ -36,7 +36,7 @@ target_include_directories (hl_f90_tstlite PRIVATE ${CMAKE_Fortran_MODULE_DIRECT set_target_properties (hl_f90_tstlite PROPERTIES LINKER_LANGUAGE Fortran) set_target_properties (hl_f90_tstlite PROPERTIES FOLDER test/hl/fortran) if (BUILD_SHARED_LIBS) - add_executable (hl_f90_tstlite-shared tstlite.f90) + add_executable (hl_f90_tstlite-shared tstlite.F90) TARGET_NAMING (hl_f90_tstlite-shared SHARED) TARGET_FORTRAN_PROPERTIES (hl_f90_tstlite-shared SHARED " " " ") target_link_libraries (hl_f90_tstlite-shared ${HDF5_HL_F90_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET}) @@ -49,7 +49,7 @@ if (BUILD_SHARED_LIBS) endif (BUILD_SHARED_LIBS) #-- Adding test for hl_f90_tstimage -add_executable (hl_f90_tstimage tstimage.f90) +add_executable (hl_f90_tstimage tstimage.F90) TARGET_NAMING (hl_f90_tstimage STATIC) TARGET_FORTRAN_PROPERTIES (hl_f90_tstimage STATIC " " " ") target_link_libraries (hl_f90_tstimage ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_TARGET}) @@ -57,7 +57,7 @@ target_include_directories (hl_f90_tstimage PRIVATE ${CMAKE_Fortran_MODULE_DIREC set_target_properties (hl_f90_tstimage PROPERTIES LINKER_LANGUAGE Fortran) set_target_properties (hl_f90_tstimage PROPERTIES FOLDER test/hl/fortran) if (BUILD_SHARED_LIBS) - add_executable (hl_f90_tstimage-shared tstimage.f90) + add_executable (hl_f90_tstimage-shared tstimage.F90) TARGET_NAMING (hl_f90_tstimage-shared SHARED) TARGET_FORTRAN_PROPERTIES (hl_f90_tstimage-shared SHARED " " " ") target_link_libraries (hl_f90_tstimage-shared ${HDF5_HL_F90_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET}) @@ -70,7 +70,7 @@ if (BUILD_SHARED_LIBS) endif (BUILD_SHARED_LIBS) #-- Adding test for hl_f90_tsttable -add_executable (hl_f90_tsttable tsttable.f90) +add_executable (hl_f90_tsttable tsttable.F90) TARGET_NAMING (hl_f90_tsttable STATIC) TARGET_FORTRAN_PROPERTIES (hl_f90_tsttable STATIC " " " ") target_link_libraries (hl_f90_tsttable ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_TARGET}) @@ -78,7 +78,7 @@ target_include_directories (hl_f90_tsttable PRIVATE ${CMAKE_Fortran_MODULE_DIREC set_target_properties (hl_f90_tsttable PROPERTIES LINKER_LANGUAGE Fortran) set_target_properties (hl_f90_tsttable PROPERTIES FOLDER test/hl/fortran) if (BUILD_SHARED_LIBS) - add_executable (hl_f90_tsttable-shared tsttable.f90) + add_executable (hl_f90_tsttable-shared tsttable.F90) TARGET_NAMING (hl_f90_tsttable-shared SHARED) TARGET_FORTRAN_PROPERTIES (hl_f90_tsttable-shared SHARED " " " ") target_link_libraries (hl_f90_tsttable-shared ${HDF5_HL_F90_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET}) diff --git a/hl/fortran/test/Makefile.am b/hl/fortran/test/Makefile.am index fa3a803..18fdaf3 100644 --- a/hl/fortran/test/Makefile.am +++ b/hl/fortran/test/Makefile.am @@ -39,10 +39,10 @@ check_PROGRAMS=$(TEST_PROG) LDADD= $(LIBH5F_HL) $(LIBH5F) $(LIBH5_HL) $(LIBHDF5) # Source files for the programs -tstds_SOURCES=tstds.f90 -tstlite_SOURCES=tstlite.f90 -tstimage_SOURCES=tstimage.f90 -tsttable_SOURCES=tsttable.f90 +tstds_SOURCES=tstds.F90 +tstlite_SOURCES=tstlite.F90 +tstimage_SOURCES=tstimage.F90 +tsttable_SOURCES=tsttable.F90 # Temporary files. CHECK_CLEANFILES+=dsetf[1-5].h5 f1img.h5 f1tab.h5 tstds.h5 diff --git a/hl/fortran/test/Makefile.in b/hl/fortran/test/Makefile.in index 6725d26..ee4b206 100644 --- a/hl/fortran/test/Makefile.in +++ b/hl/fortran/test/Makefile.in @@ -112,7 +112,8 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/aclocal_cxx.m4 \ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/bin/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/src/H5config.h +CONFIG_HEADER = $(top_builddir)/src/H5config.h \ + $(top_builddir)/fortran/src/H5config_f.inc CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__EXEEXT_1 = tstds$(EXEEXT) tstlite$(EXEEXT) tstimage$(EXEEXT) \ @@ -149,14 +150,17 @@ AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = -DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src -FCCOMPILE = $(FC) $(AM_FCFLAGS) $(FCFLAGS) -LTFCCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=FC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=compile $(FC) $(AM_FCFLAGS) $(FCFLAGS) -AM_V_FC = $(am__v_FC_@AM_V@) -am__v_FC_ = $(am__v_FC_@AM_DEFAULT_V@) -am__v_FC_0 = @echo " FC " $@; -am__v_FC_1 = +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src -I$(top_builddir)/fortran/src +PPFCCOMPILE = $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) +LTPPFCCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=FC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_FCFLAGS) $(FCFLAGS) +AM_V_PPFC = $(am__v_PPFC_@AM_V@) +am__v_PPFC_ = $(am__v_PPFC_@AM_DEFAULT_V@) +am__v_PPFC_0 = @echo " PPFC " $@; +am__v_PPFC_1 = FCLD = $(FC) FCLINK = $(LIBTOOL) $(AM_V_lt) --tag=FC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(FCLD) $(AM_FCFLAGS) $(FCFLAGS) \ @@ -460,14 +464,21 @@ F9XMODEXT = @F9XMODEXT@ F9XMODFLAG = @F9XMODFLAG@ F9XSUFFIXFLAG = @F9XSUFFIXFLAG@ FC = @FC@ -FC2003 = @FC2003@ FCFLAGS = @FCFLAGS@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ +FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ +FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ +FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ +H5CONFIG_F_IKIND = @H5CONFIG_F_IKIND@ +H5CONFIG_F_NUM_IKIND = @H5CONFIG_F_NUM_IKIND@ +H5CONFIG_F_NUM_RKIND = @H5CONFIG_F_NUM_RKIND@ +H5CONFIG_F_RKIND = @H5CONFIG_F_RKIND@ +H5CONFIG_F_RKIND_SIZEOF = @H5CONFIG_F_RKIND_SIZEOF@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ @@ -477,13 +488,12 @@ H5_LDFLAGS = @H5_LDFLAGS@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ -HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_Fortran_INTEGER_SIZEOF_16 = @HAVE_Fortran_INTEGER_SIZEOF_16@ HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ HDF_FORTRAN = @HDF_FORTRAN@ -HDF_FORTRAN2003 = @HDF_FORTRAN2003@ HID_T = @HID_T@ HL = @HL@ HL_FOR = @HL_FOR@ @@ -525,6 +535,18 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PAC_C_MAX_REAL_PRECISION = @PAC_C_MAX_REAL_PRECISION@ +PAC_FC_ALL_INTEGER_KINDS = @PAC_FC_ALL_INTEGER_KINDS@ +PAC_FC_ALL_INTEGER_KINDS_SIZEOF = @PAC_FC_ALL_INTEGER_KINDS_SIZEOF@ +PAC_FC_ALL_REAL_KINDS = @PAC_FC_ALL_REAL_KINDS@ +PAC_FC_ALL_REAL_KINDS_SIZEOF = @PAC_FC_ALL_REAL_KINDS_SIZEOF@ +PAC_FC_MAX_REAL_PRECISION = @PAC_FC_MAX_REAL_PRECISION@ +PAC_FORTRAN_NATIVE_DOUBLE_KIND = @PAC_FORTRAN_NATIVE_DOUBLE_KIND@ +PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF = @PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF@ +PAC_FORTRAN_NATIVE_INTEGER_KIND = @PAC_FORTRAN_NATIVE_INTEGER_KIND@ +PAC_FORTRAN_NATIVE_INTEGER_SIZEOF = @PAC_FORTRAN_NATIVE_INTEGER_SIZEOF@ +PAC_FORTRAN_NATIVE_REAL_KIND = @PAC_FORTRAN_NATIVE_REAL_KIND@ +PAC_FORTRAN_NATIVE_REAL_SIZEOF = @PAC_FORTRAN_NATIVE_REAL_SIZEOF@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ @@ -674,10 +696,10 @@ TEST_PROG = tstds tstlite tstimage tsttable LDADD = $(LIBH5F_HL) $(LIBH5F) $(LIBH5_HL) $(LIBHDF5) # Source files for the programs -tstds_SOURCES = tstds.f90 -tstlite_SOURCES = tstlite.f90 -tstimage_SOURCES = tstimage.f90 -tsttable_SOURCES = tsttable.f90 +tstds_SOURCES = tstds.F90 +tstlite_SOURCES = tstlite.F90 +tstimage_SOURCES = tstimage.F90 +tsttable_SOURCES = tsttable.F90 # Mark this directory as part of the Fortran API (this affects output # from tests in conclude.am) @@ -705,7 +727,7 @@ TEST_SCRIPT_PARA_CHKSH = $(TEST_SCRIPT_PARA:=.chkexe_) all: all-am .SUFFIXES: -.SUFFIXES: .f90 .lo .log .o .obj .sh .sh$(EXEEXT) .trs +.SUFFIXES: .F90 .lo .log .o .obj .sh .sh$(EXEEXT) .trs $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/config/commence.am $(top_srcdir)/config/conclude.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ @@ -769,14 +791,14 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c -.f90.o: - $(AM_V_FC)$(FCCOMPILE) -c -o $@ $(FCFLAGS_f90) $< +.F90.o: + $(AM_V_PPFC)$(PPFCCOMPILE) -c -o $@ $< -.f90.obj: - $(AM_V_FC)$(FCCOMPILE) -c -o $@ $(FCFLAGS_f90) `$(CYGPATH_W) '$<'` +.F90.obj: + $(AM_V_PPFC)$(PPFCCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` -.f90.lo: - $(AM_V_FC)$(LTFCCOMPILE) -c -o $@ $(FCFLAGS_f90) $< +.F90.lo: + $(AM_V_PPFC)$(LTPPFCCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo diff --git a/hl/fortran/test/tstds.F90 b/hl/fortran/test/tstds.F90 new file mode 100644 index 0000000..cbf6c38 --- /dev/null +++ b/hl/fortran/test/tstds.F90 @@ -0,0 +1,353 @@ +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! * 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. * +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +PROGRAM test_ds + + IMPLICIT NONE + + INTEGER :: err + + CALL test_testds(err) + + IF(err.LT.0)THEN + WRITE(*,'(5X,A)') "DIMENSION SCALES TEST *FAILED*" + ENDIF + +END PROGRAM test_ds + +SUBROUTINE test_testds(err) + + USE HDF5 + USE H5LT + USE H5DS + + IMPLICIT NONE + + INTEGER, PARAMETER :: RANK = 2 ! rank of DATA dataset + INTEGER, PARAMETER :: DIM_DATA = 12 + INTEGER, PARAMETER :: DIM1_SIZE = 3 + INTEGER, PARAMETER :: DIM2_SIZE = 4 + INTEGER, PARAMETER :: DIM1 = 1 + INTEGER, PARAMETER :: DIM2 = 2 + INTEGER, PARAMETER :: FAILED = -1 + + CHARACTER(LEN=6), PARAMETER :: DSET_NAME = "Mydata" + CHARACTER(LEN=5), PARAMETER :: DS_1_NAME = "Yaxis" + CHARACTER(LEN=5), PARAMETER :: DS_1_NAME_A = "Yaxiz" + CHARACTER(LEN=5), PARAMETER :: DS_2_NAME = "Xaxis" + + + INTEGER(hid_t) :: fid ! file ID + INTEGER(hid_t) :: did ! dataset ID + INTEGER(hid_t) :: dsid ! DS dataset ID + INTEGER :: rankds = 1 ! rank of DS dataset + INTEGER(hsize_t), DIMENSION(1:rank) :: dims = (/DIM2_SIZE,DIM1_SIZE/) ! size of DATA dataset + INTEGER, DIMENSION(1:DIM_DATA) :: buf = (/1,2,3,4,5,6,7,8,9,10,11,12/) ! DATA of DATA dataset + INTEGER(hsize_t), DIMENSION(1:1) :: s1_dim = (/DIM1_SIZE/) ! size of DS 1 dataset + INTEGER(hsize_t), DIMENSION(1:1) :: s2_dim = (/DIM2_SIZE/) ! size of DS 2 dataset + REAL, DIMENSION(1:DIM1_SIZE) :: s1_wbuf = (/10,20,30/) ! DATA of DS 1 dataset + INTEGER, DIMENSION(1:DIM2_SIZE) :: s2_wbuf = (/10,20,50,100/) ! DATA of DS 2 dataset + INTEGER :: err + INTEGER :: num_scales + INTEGER(size_t) :: name_len + CHARACTER(LEN=80) :: name + INTEGER(size_t) :: label_len + CHARACTER(LEN=80) :: label + LOGICAL :: is_attached, is_scale + + ! + ! Initialize FORTRAN predefined datatypes. + ! + CALL h5open_f(err) + IF(err.LT.0) RETURN + + ! create a file using default properties + CALL H5Fcreate_f("tstds.h5",H5F_ACC_TRUNC_F, fid, err) + IF(err.LT.0) RETURN + + ! make a dataset + CALL H5LTmake_dataset_int_f(fid,DSET_NAME,rank,dims,buf, err) + IF(err.LT.0) RETURN + + ! make a DS dataset for the first dimension + CALL H5LTmake_dataset_float_f(fid,DS_1_NAME,rankds,s1_dim,s1_wbuf,err) + IF(err.LT.0) RETURN + + ! make a DS dataset for the second dimension + CALL H5LTmake_dataset_int_f(fid,DS_2_NAME,rankds,s2_dim,s2_wbuf,err) + IF(err.LT.0) RETURN + + !------------------------------------------------------------------------- + ! attach the DS_1_NAME dimension scale to DSET_NAME at dimension 1 + !------------------------------------------------------------------------- + + CALL test_begin(' Test Attaching Dimension Scale ') + + ! get the dataset id for DSET_NAME + CALL H5Dopen_f(fid, DSET_NAME, did, err) + IF(err.LT.0) RETURN + + ! get the DS dataset id + CALL H5Dopen_f(fid, DS_1_NAME, dsid, err) + IF(err.LT.0) RETURN + + ! check attaching to a non-existent dimension; should fail + CALL H5DSattach_scale_f(did, dsid, 20, err) + IF(err.NE.-1) THEN + err = FAILED ! should fail, mark as an error + CALL write_test_status(err) + RETURN + ENDIF + + ! attach the DS_1_NAME dimension scale to DSET_NAME at dimension index 1 + CALL H5DSattach_scale_f(did, dsid, DIM1, err) + IF(err.EQ.-1) THEN + CALL write_test_status(err) + RETURN + ENDIF + CALL write_test_status(err) + + CALL test_begin(' Test If Dimension Scale Attached ') + + CALL H5DSis_attached_f(did, dsid, DIM1, is_attached, err) + IF(err.EQ.-1.OR..NOT.is_attached) THEN + err = FAILED + CALL write_test_status(err) + RETURN + ENDIF + CALL write_test_status(err) + + ! Check to see how many Dimension Scales are attached + + CALL test_begin(' Test Getting Number Dimension Scales ') + + CALL H5DSget_num_scales_f(did, DIM1, num_scales, err) + IF(err.LT.0.OR.num_scales.NE.1)THEN + err = FAILED + CALL write_test_status(err) + RETURN + ENDIF + CALL write_test_status(err) + + CALL test_begin(' Test Detaching Dimension Scale ') + + ! Detach scale + CALL H5DSdetach_scale_f(did, dsid, DIM1, err) + IF(err.LT.0) RETURN + + ! Check to see if a dimension scale is attached, should be .false. + CALL H5DSis_attached_f(did, dsid, DIM1, is_attached, err) + IF(err.LT.0.OR.is_attached)THEN + err = FAILED + CALL write_test_status(err) + RETURN + ENDIF + CALL write_test_status(err) + + !------------------------------------------------------------------------- + ! set the DS_1_NAME dimension scale to DSET_NAME at dimension 0 + !------------------------------------------------------------------------- + + CALL test_begin(' Test Setting Dimension Scale ') + + CALL H5DSset_scale_f(dsid, err, "Dimension Scale Set 1") + IF(err.LT.0.OR.is_attached)THEN + err = FAILED + CALL write_test_status(err) + RETURN + ENDIF + CALL write_test_status(err) + + CALL test_begin(' Test If Dimension Scale ') + + CALL H5DSis_scale_f(dsid, is_scale, err) + IF(err.LT.0.OR..NOT.is_scale)THEN + err = FAILED + CALL write_test_status(err) + RETURN + ENDIF + CALL write_test_status(err) + + ! Get scale name; test to large character buffer + + CALL test_begin(' Test Getting Dimension Scale By Name ') + + name_len = 25 + name = '' + CALL H5DSget_scale_name_f(dsid, name, name_len, err) + IF(err.LT.0 .OR. & + name_len.NE.21 .OR. & + TRIM(name).NE."Dimension Scale Set 1" .OR. & + name(22:25).NE.' ')THEN + err = FAILED + CALL write_test_status(err) + RETURN + ENDIF + + ! Get scale name; test exact size character buffer + name_len = 21 + name = '' + CALL H5DSget_scale_name_f(dsid, name(1:name_len), name_len, err) + IF(err.LT.0.OR.name_len.NE.21.OR.TRIM(name).NE."Dimension Scale Set 1")THEN + err = FAILED + CALL write_test_status(err) + RETURN + ENDIF + + ! Get scale name; test to small character buffer + name_len = 5 + name = '' + CALL H5DSget_scale_name_f(dsid, name(1:name_len), name_len, err) + IF(err.LT.0.OR.name_len.NE.21.OR.TRIM(name).NE."Dimen")THEN + err = FAILED + CALL write_test_status(err) + RETURN + ENDIF + + ! close DS id + CALL H5Dclose_f(dsid, err) + IF(err.LT.0) RETURN + + !------------------------------------------------------------------------- + ! attach the DS_2_NAME dimension scale to DSET_NAME + !------------------------------------------------------------------------- + + ! get the DS dataset id + CALL H5Dopen_f(fid, DS_2_NAME, dsid, err) + IF(err.LT.0) RETURN + + ! attach the DS_2_NAME dimension scale to DSET_NAME as the 2nd dimension (index 2) + CALL H5DSattach_scale_f(did, dsid, DIM2, err) + IF(err.LT.0) RETURN + + CALL H5DSis_attached_f(did, dsid, DIM2, is_attached, err) + IF(err.LT.0) RETURN + + ! test sending no Dimension Scale name + + CALL H5DSset_scale_f(dsid, err) + IF(err.LT.0)THEN + CALL write_test_status(err) + RETURN + ENDIF + + CALL H5DSis_scale_f(dsid, is_scale, err) + IF(err.LT.0.OR..NOT.is_scale)THEN + err = FAILED + CALL write_test_status(err) + RETURN + ENDIF + + ! Get scale name when there is no scale name + name_len = 5 + name = '' + CALL H5DSget_scale_name_f(dsid, name(1:name_len), name_len, err) + IF(err.LT.0.OR.name_len.NE.0)THEN ! name_len is 0 if no name is found + err = FAILED + CALL write_test_status(err) + RETURN + ENDIF + + CALL write_test_status(err) + + CALL test_begin(' Test Setting Dimension Scale Label ') + + CALL H5DSset_label_f(did, DIM2, "Label12", err) + IF(err.LT.0)THEN + CALL write_test_status(err) + RETURN + ENDIF + + ! Test label where character length is to small + + label_len = 5 + label = '' + CALL H5DSget_label_f(did, DIM2, label(1:label_len), label_len, err) + IF(err.LT.0.OR.label(1:5).NE."Label".OR.label_len.NE.7)THEN + err = FAILED + CALL write_test_status(err) + RETURN + ENDIF + + ! Test label where character length is exact + + label_len = 7 + label = '' + CALL H5DSget_label_f(did, DIM2, label(1:label_len), label_len, err) + IF(err.LT.0.OR.label(1:label_len).NE."Label12".OR.label_len.NE.7)THEN + err = FAILED + CALL write_test_status(err) + RETURN + ENDIF + + ! Test label where character length is to big + + label_len = 25 + label = '' + CALL H5DSget_label_f(did, DIM2, label, label_len, err) + IF(err.LT.0.OR. & + label(1:label_len).NE."Label12" .OR. & + label_len.NE.7 .OR. & + label(8:25).NE.' ')THEN + err = FAILED + CALL write_test_status(err) + RETURN + ENDIF + CALL write_test_status(err) + + ! close DS id + CALL H5Dclose_f(dsid, err) + IF(err.LT.0) RETURN + + ! close file + CALL H5Fclose_f(fid, err) + IF(err.LT.0) RETURN + +END SUBROUTINE test_testds + +!------------------------------------------------------------------------- +! test_begin +!------------------------------------------------------------------------- + +SUBROUTINE test_begin(string) + CHARACTER(LEN=*), INTENT(IN) :: string + WRITE(*, fmt = '(A)', advance = 'no') ADJUSTL(string) +END SUBROUTINE test_begin + +!------------------------------------------------------------------------- +! passed/failed +!------------------------------------------------------------------------- +SUBROUTINE write_test_status( test_result) + +! Writes the results of the tests + + IMPLICIT NONE + + INTEGER, INTENT(IN) :: test_result ! negative, failed + ! 0 , passed + +! Controls the output style for reporting test results + + CHARACTER(LEN=8) :: error_string + CHARACTER(LEN=8), PARAMETER :: success = ' PASSED ' + CHARACTER(LEN=8), PARAMETER :: failure = '*FAILED*' + + error_string = failure + IF (test_result .EQ. 0) THEN + error_string = success + ENDIF + + WRITE(*, fmt = '(T34, A)') error_string + +END SUBROUTINE write_test_status diff --git a/hl/fortran/test/tstds.f90 b/hl/fortran/test/tstds.f90 deleted file mode 100644 index cbf6c38..0000000 --- a/hl/fortran/test/tstds.f90 +++ /dev/null @@ -1,353 +0,0 @@ -! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -! * 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. * -! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -PROGRAM test_ds - - IMPLICIT NONE - - INTEGER :: err - - CALL test_testds(err) - - IF(err.LT.0)THEN - WRITE(*,'(5X,A)') "DIMENSION SCALES TEST *FAILED*" - ENDIF - -END PROGRAM test_ds - -SUBROUTINE test_testds(err) - - USE HDF5 - USE H5LT - USE H5DS - - IMPLICIT NONE - - INTEGER, PARAMETER :: RANK = 2 ! rank of DATA dataset - INTEGER, PARAMETER :: DIM_DATA = 12 - INTEGER, PARAMETER :: DIM1_SIZE = 3 - INTEGER, PARAMETER :: DIM2_SIZE = 4 - INTEGER, PARAMETER :: DIM1 = 1 - INTEGER, PARAMETER :: DIM2 = 2 - INTEGER, PARAMETER :: FAILED = -1 - - CHARACTER(LEN=6), PARAMETER :: DSET_NAME = "Mydata" - CHARACTER(LEN=5), PARAMETER :: DS_1_NAME = "Yaxis" - CHARACTER(LEN=5), PARAMETER :: DS_1_NAME_A = "Yaxiz" - CHARACTER(LEN=5), PARAMETER :: DS_2_NAME = "Xaxis" - - - INTEGER(hid_t) :: fid ! file ID - INTEGER(hid_t) :: did ! dataset ID - INTEGER(hid_t) :: dsid ! DS dataset ID - INTEGER :: rankds = 1 ! rank of DS dataset - INTEGER(hsize_t), DIMENSION(1:rank) :: dims = (/DIM2_SIZE,DIM1_SIZE/) ! size of DATA dataset - INTEGER, DIMENSION(1:DIM_DATA) :: buf = (/1,2,3,4,5,6,7,8,9,10,11,12/) ! DATA of DATA dataset - INTEGER(hsize_t), DIMENSION(1:1) :: s1_dim = (/DIM1_SIZE/) ! size of DS 1 dataset - INTEGER(hsize_t), DIMENSION(1:1) :: s2_dim = (/DIM2_SIZE/) ! size of DS 2 dataset - REAL, DIMENSION(1:DIM1_SIZE) :: s1_wbuf = (/10,20,30/) ! DATA of DS 1 dataset - INTEGER, DIMENSION(1:DIM2_SIZE) :: s2_wbuf = (/10,20,50,100/) ! DATA of DS 2 dataset - INTEGER :: err - INTEGER :: num_scales - INTEGER(size_t) :: name_len - CHARACTER(LEN=80) :: name - INTEGER(size_t) :: label_len - CHARACTER(LEN=80) :: label - LOGICAL :: is_attached, is_scale - - ! - ! Initialize FORTRAN predefined datatypes. - ! - CALL h5open_f(err) - IF(err.LT.0) RETURN - - ! create a file using default properties - CALL H5Fcreate_f("tstds.h5",H5F_ACC_TRUNC_F, fid, err) - IF(err.LT.0) RETURN - - ! make a dataset - CALL H5LTmake_dataset_int_f(fid,DSET_NAME,rank,dims,buf, err) - IF(err.LT.0) RETURN - - ! make a DS dataset for the first dimension - CALL H5LTmake_dataset_float_f(fid,DS_1_NAME,rankds,s1_dim,s1_wbuf,err) - IF(err.LT.0) RETURN - - ! make a DS dataset for the second dimension - CALL H5LTmake_dataset_int_f(fid,DS_2_NAME,rankds,s2_dim,s2_wbuf,err) - IF(err.LT.0) RETURN - - !------------------------------------------------------------------------- - ! attach the DS_1_NAME dimension scale to DSET_NAME at dimension 1 - !------------------------------------------------------------------------- - - CALL test_begin(' Test Attaching Dimension Scale ') - - ! get the dataset id for DSET_NAME - CALL H5Dopen_f(fid, DSET_NAME, did, err) - IF(err.LT.0) RETURN - - ! get the DS dataset id - CALL H5Dopen_f(fid, DS_1_NAME, dsid, err) - IF(err.LT.0) RETURN - - ! check attaching to a non-existent dimension; should fail - CALL H5DSattach_scale_f(did, dsid, 20, err) - IF(err.NE.-1) THEN - err = FAILED ! should fail, mark as an error - CALL write_test_status(err) - RETURN - ENDIF - - ! attach the DS_1_NAME dimension scale to DSET_NAME at dimension index 1 - CALL H5DSattach_scale_f(did, dsid, DIM1, err) - IF(err.EQ.-1) THEN - CALL write_test_status(err) - RETURN - ENDIF - CALL write_test_status(err) - - CALL test_begin(' Test If Dimension Scale Attached ') - - CALL H5DSis_attached_f(did, dsid, DIM1, is_attached, err) - IF(err.EQ.-1.OR..NOT.is_attached) THEN - err = FAILED - CALL write_test_status(err) - RETURN - ENDIF - CALL write_test_status(err) - - ! Check to see how many Dimension Scales are attached - - CALL test_begin(' Test Getting Number Dimension Scales ') - - CALL H5DSget_num_scales_f(did, DIM1, num_scales, err) - IF(err.LT.0.OR.num_scales.NE.1)THEN - err = FAILED - CALL write_test_status(err) - RETURN - ENDIF - CALL write_test_status(err) - - CALL test_begin(' Test Detaching Dimension Scale ') - - ! Detach scale - CALL H5DSdetach_scale_f(did, dsid, DIM1, err) - IF(err.LT.0) RETURN - - ! Check to see if a dimension scale is attached, should be .false. - CALL H5DSis_attached_f(did, dsid, DIM1, is_attached, err) - IF(err.LT.0.OR.is_attached)THEN - err = FAILED - CALL write_test_status(err) - RETURN - ENDIF - CALL write_test_status(err) - - !------------------------------------------------------------------------- - ! set the DS_1_NAME dimension scale to DSET_NAME at dimension 0 - !------------------------------------------------------------------------- - - CALL test_begin(' Test Setting Dimension Scale ') - - CALL H5DSset_scale_f(dsid, err, "Dimension Scale Set 1") - IF(err.LT.0.OR.is_attached)THEN - err = FAILED - CALL write_test_status(err) - RETURN - ENDIF - CALL write_test_status(err) - - CALL test_begin(' Test If Dimension Scale ') - - CALL H5DSis_scale_f(dsid, is_scale, err) - IF(err.LT.0.OR..NOT.is_scale)THEN - err = FAILED - CALL write_test_status(err) - RETURN - ENDIF - CALL write_test_status(err) - - ! Get scale name; test to large character buffer - - CALL test_begin(' Test Getting Dimension Scale By Name ') - - name_len = 25 - name = '' - CALL H5DSget_scale_name_f(dsid, name, name_len, err) - IF(err.LT.0 .OR. & - name_len.NE.21 .OR. & - TRIM(name).NE."Dimension Scale Set 1" .OR. & - name(22:25).NE.' ')THEN - err = FAILED - CALL write_test_status(err) - RETURN - ENDIF - - ! Get scale name; test exact size character buffer - name_len = 21 - name = '' - CALL H5DSget_scale_name_f(dsid, name(1:name_len), name_len, err) - IF(err.LT.0.OR.name_len.NE.21.OR.TRIM(name).NE."Dimension Scale Set 1")THEN - err = FAILED - CALL write_test_status(err) - RETURN - ENDIF - - ! Get scale name; test to small character buffer - name_len = 5 - name = '' - CALL H5DSget_scale_name_f(dsid, name(1:name_len), name_len, err) - IF(err.LT.0.OR.name_len.NE.21.OR.TRIM(name).NE."Dimen")THEN - err = FAILED - CALL write_test_status(err) - RETURN - ENDIF - - ! close DS id - CALL H5Dclose_f(dsid, err) - IF(err.LT.0) RETURN - - !------------------------------------------------------------------------- - ! attach the DS_2_NAME dimension scale to DSET_NAME - !------------------------------------------------------------------------- - - ! get the DS dataset id - CALL H5Dopen_f(fid, DS_2_NAME, dsid, err) - IF(err.LT.0) RETURN - - ! attach the DS_2_NAME dimension scale to DSET_NAME as the 2nd dimension (index 2) - CALL H5DSattach_scale_f(did, dsid, DIM2, err) - IF(err.LT.0) RETURN - - CALL H5DSis_attached_f(did, dsid, DIM2, is_attached, err) - IF(err.LT.0) RETURN - - ! test sending no Dimension Scale name - - CALL H5DSset_scale_f(dsid, err) - IF(err.LT.0)THEN - CALL write_test_status(err) - RETURN - ENDIF - - CALL H5DSis_scale_f(dsid, is_scale, err) - IF(err.LT.0.OR..NOT.is_scale)THEN - err = FAILED - CALL write_test_status(err) - RETURN - ENDIF - - ! Get scale name when there is no scale name - name_len = 5 - name = '' - CALL H5DSget_scale_name_f(dsid, name(1:name_len), name_len, err) - IF(err.LT.0.OR.name_len.NE.0)THEN ! name_len is 0 if no name is found - err = FAILED - CALL write_test_status(err) - RETURN - ENDIF - - CALL write_test_status(err) - - CALL test_begin(' Test Setting Dimension Scale Label ') - - CALL H5DSset_label_f(did, DIM2, "Label12", err) - IF(err.LT.0)THEN - CALL write_test_status(err) - RETURN - ENDIF - - ! Test label where character length is to small - - label_len = 5 - label = '' - CALL H5DSget_label_f(did, DIM2, label(1:label_len), label_len, err) - IF(err.LT.0.OR.label(1:5).NE."Label".OR.label_len.NE.7)THEN - err = FAILED - CALL write_test_status(err) - RETURN - ENDIF - - ! Test label where character length is exact - - label_len = 7 - label = '' - CALL H5DSget_label_f(did, DIM2, label(1:label_len), label_len, err) - IF(err.LT.0.OR.label(1:label_len).NE."Label12".OR.label_len.NE.7)THEN - err = FAILED - CALL write_test_status(err) - RETURN - ENDIF - - ! Test label where character length is to big - - label_len = 25 - label = '' - CALL H5DSget_label_f(did, DIM2, label, label_len, err) - IF(err.LT.0.OR. & - label(1:label_len).NE."Label12" .OR. & - label_len.NE.7 .OR. & - label(8:25).NE.' ')THEN - err = FAILED - CALL write_test_status(err) - RETURN - ENDIF - CALL write_test_status(err) - - ! close DS id - CALL H5Dclose_f(dsid, err) - IF(err.LT.0) RETURN - - ! close file - CALL H5Fclose_f(fid, err) - IF(err.LT.0) RETURN - -END SUBROUTINE test_testds - -!------------------------------------------------------------------------- -! test_begin -!------------------------------------------------------------------------- - -SUBROUTINE test_begin(string) - CHARACTER(LEN=*), INTENT(IN) :: string - WRITE(*, fmt = '(A)', advance = 'no') ADJUSTL(string) -END SUBROUTINE test_begin - -!------------------------------------------------------------------------- -! passed/failed -!------------------------------------------------------------------------- -SUBROUTINE write_test_status( test_result) - -! Writes the results of the tests - - IMPLICIT NONE - - INTEGER, INTENT(IN) :: test_result ! negative, failed - ! 0 , passed - -! Controls the output style for reporting test results - - CHARACTER(LEN=8) :: error_string - CHARACTER(LEN=8), PARAMETER :: success = ' PASSED ' - CHARACTER(LEN=8), PARAMETER :: failure = '*FAILED*' - - error_string = failure - IF (test_result .EQ. 0) THEN - error_string = success - ENDIF - - WRITE(*, fmt = '(T34, A)') error_string - -END SUBROUTINE write_test_status diff --git a/hl/fortran/test/tstimage.F90 b/hl/fortran/test/tstimage.F90 new file mode 100644 index 0000000..0bff6b2 --- /dev/null +++ b/hl/fortran/test/tstimage.F90 @@ -0,0 +1,339 @@ +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! 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. * +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! +! +! This file contains the FORTRAN90 tests for H5LT +! + +program image_test + +call make_image1() + +end program image_test + + +!------------------------------------------------------------------------- +! make_image1 +!------------------------------------------------------------------------- + +subroutine make_image1() + +use h5im ! module of H5IM +use hdf5 ! module of HDF5 library + +implicit none + +character(len=8), parameter :: filename = "f1img.h5" ! file name +character(len=4), parameter :: dsetname1 = "img1" ! dataset name +character(len=4), parameter :: dsetname2 = "img2" ! dataset name +character(len=15), parameter :: il ="INTERLACE_PIXEL"! dataset name +integer(hid_t) :: file_id ! file identifier +integer(hsize_t), parameter :: width = 500 ! width of image +integer(hsize_t), parameter :: height = 200 ! height of image +integer, parameter :: pal_entries = 9 ! palette number of entries +integer, dimension(width*height) :: buf1 ! data buffer +integer, dimension(width*height) :: bufr1 ! data buffer +integer, dimension(width*height*3) :: buf2 ! data buffer +integer, dimension(width*height*3) :: bufr2 ! data buffer +integer(hsize_t) :: widthr ! width of image +integer(hsize_t) :: heightr ! height of image +integer(hsize_t) :: planesr ! color planes +integer(hsize_t) :: npalsr ! palettes +character(len=15) :: interlacer ! interlace +integer :: errcode ! error flag +integer :: is_image ! error flag +integer :: i, j, n ! general purpose integers +! +! palette +! create a 9 entry palette +! +character(len=4), parameter :: pal_name = "pal1" ! dataset name +integer(hsize_t), dimension(2) :: pal_dims = (/pal_entries,3/) ! palette dimensions +integer(hsize_t), dimension(2) :: pal_dims_out ! palette dimensions +integer, dimension(pal_entries*3) :: pal_data_out ! data buffer +integer(hsize_t) :: npals ! number of palettes +integer :: pal_number ! palette number +integer :: is_palette ! is palette +integer :: space +integer, dimension(pal_entries*3) :: pal_data_in = (/& + 0,0,168,& ! dark blue + 0,0,252,& ! blue + 0,168,252,& ! ocean blue + 84,252,252,& ! light blue + 168,252,168,& ! light green + 0,252,168,& ! green + 252,252,84,& ! yellow + 252,168,0,& ! orange + 252,0,0/) ! red + + +! create an 8bit image of 9 values divided evenly by the array +! +space = width*height / pal_entries; +n = 0; j = 0; +do i = 1, width*height + buf1(i) = n + if ( j > space ) then + n = n + 1; + j = 0; + endif + if (n>pal_entries-1) n=0; + j = j +1; +end do + +! +! create a 3 byte rgb image +! +n = 0; j = 0; +do i = 1, width*height*3 + buf2(i) = n; + if (j == 3) then + n = n + 1; + j = 0; + endif + if (n>255) n=0; + j = j +1; +end do + + +! Initialize FORTRAN predefined datatypes. +! +call h5open_f(errcode) +! +! Create a new file using default properties. +! +call h5fcreate_f(filename, H5F_ACC_TRUNC_F, file_id, errcode) + +!------------------------------------------------------------------------- +! indexed image +!------------------------------------------------------------------------- + +call test_begin(' Make/Read image 8bit ') + +! +! write image. +! +call h5immake_image_8bit_f(file_id,dsetname1,width,height,buf1,errcode) +! +! read image. +! +call h5imread_image_f(file_id,dsetname1,bufr1,errcode) +! +! compare read and write buffers. +! +do i = 1, width*height + if ( buf1(i) /= bufr1(i) ) then + print *, 'read buffer differs from write buffer' + print *, bufr1(i), ' and ', buf1(i) + stop + endif +end do + +! +! get image info. +! +call h5imget_image_info_f(file_id,dsetname1,widthr,heightr,planesr,interlacer,npalsr,errcode) + +if ( (widthr /= widthr) .or. (heightr /= height) .or. (planesr /= 1)) then + print *, 'h5imget_image_info_f bad value' + stop +endif + +is_image = h5imis_image_f(file_id,dsetname1) +if ( is_image /= 1) then + print *, 'h5imis_image_f bad value' + stop +endif + + +call passed() + +!------------------------------------------------------------------------- +! true color image +!------------------------------------------------------------------------- + +call test_begin(' Make/Read image 24bit ') + +! +! write image. +! +call h5immake_image_24bit_f(file_id,dsetname2,width,height,il,buf2,errcode) + +! +! read image. +! +call h5imread_image_f(file_id,dsetname2,bufr2,errcode) + +! +! compare read and write buffers. +! +do i = 1, width*height*3 + if ( buf2(i) /= bufr2(i) ) then + print *, 'read buffer differs from write buffer' + print *, bufr2(i), ' and ', buf2(i) + stop + endif +end do + +! +! get image info. +! +call h5imget_image_info_f(file_id,dsetname2,widthr,heightr,planesr,interlacer,npalsr,errcode) + +if ( (widthr /= widthr) .or. (heightr /= height) .or. (planesr /= 3)) then + print *, 'h5imget_image_info_f bad value' + stop +endif + +is_image = h5imis_image_f(file_id,dsetname2) +if ( is_image /= 1) then + print *, 'h5imis_image_f bad value' + stop +endif + + + +call passed() + +!------------------------------------------------------------------------- +! palette +!------------------------------------------------------------------------- + +call test_begin(' Make palette ') + +! +! make palette. +! +call h5immake_palette_f(file_id,pal_name,pal_dims,pal_data_in,errcode) + +call passed() + + +call test_begin(' Link/Unlink palette ') + +! +! link palette. +! +call h5imlink_palette_f(file_id,dsetname1,pal_name,errcode) + + +! +! read palette. +! +pal_number = 0 +call h5imget_palette_f(file_id,dsetname1,pal_number,pal_data_out,errcode) + +! +! compare read and write buffers. +! +do i = 1, pal_entries*3 + if ( pal_data_in(i) /= pal_data_out(i) ) then + print *, 'read buffer differs from write buffer' + print *, pal_data_in(i), ' and ', pal_data_out(i) + stop + endif +end do + +! +! get number of palettes +! +call h5imget_npalettes_f(file_id,dsetname1,npals,errcode) + +if ( npals /= 1) then + print *, 'h5imget_npalettes_f bad value' + stop +endif + +! +! get palette info +! +pal_number = 0 +call h5imget_palette_info_f(file_id,dsetname1,pal_number,pal_dims_out,errcode) + +if ( (pal_dims_out(1) /= pal_dims(1)) .or. (pal_dims_out(2) /= pal_dims(2))) then + print *, 'h5imget_palette_info_f bad value' + stop +endif + +! +! is palette +! +is_palette = h5imis_palette_f(file_id,pal_name) + +if ( is_palette /= 1 ) then + print *, 'h5imis_palette_f bad value' + stop +endif + +! +! unlink palette. +! +call h5imunlink_palette_f(file_id,dsetname1,pal_name,errcode) + +! +! get number of palettes +! +call h5imget_npalettes_f(file_id,dsetname1,npals,errcode ) + +if ( npals /= 0) then + print *, 'h5imget_npalettes_f bad value' + stop +endif + + +! +! link palette again +! +call h5imlink_palette_f(file_id,dsetname1,pal_name,errcode) + +call passed() + + +!------------------------------------------------------------------------- +! end +!------------------------------------------------------------------------- + +! +! Close the file. +! +call h5fclose_f(file_id, errcode) + +! +! Close FORTRAN predefined datatypes. +! +call h5close_f(errcode) + +! +! end function. +! +end subroutine make_image1 + +!------------------------------------------------------------------------- +! test_begin +!------------------------------------------------------------------------- + +subroutine test_begin(string) +character(len=*), intent(in) :: string +write(*, fmt = '(14a)', advance = 'no') string +write(*, fmt = '(40x,a)', advance = 'no') ' ' +end subroutine test_begin + +!------------------------------------------------------------------------- +! passed +!------------------------------------------------------------------------- + +subroutine passed() +write(*, fmt = '(6a)') 'PASSED' +end subroutine passed diff --git a/hl/fortran/test/tstimage.f90 b/hl/fortran/test/tstimage.f90 deleted file mode 100644 index 0bff6b2..0000000 --- a/hl/fortran/test/tstimage.f90 +++ /dev/null @@ -1,339 +0,0 @@ -! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -! 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. * -! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -! -! -! This file contains the FORTRAN90 tests for H5LT -! - -program image_test - -call make_image1() - -end program image_test - - -!------------------------------------------------------------------------- -! make_image1 -!------------------------------------------------------------------------- - -subroutine make_image1() - -use h5im ! module of H5IM -use hdf5 ! module of HDF5 library - -implicit none - -character(len=8), parameter :: filename = "f1img.h5" ! file name -character(len=4), parameter :: dsetname1 = "img1" ! dataset name -character(len=4), parameter :: dsetname2 = "img2" ! dataset name -character(len=15), parameter :: il ="INTERLACE_PIXEL"! dataset name -integer(hid_t) :: file_id ! file identifier -integer(hsize_t), parameter :: width = 500 ! width of image -integer(hsize_t), parameter :: height = 200 ! height of image -integer, parameter :: pal_entries = 9 ! palette number of entries -integer, dimension(width*height) :: buf1 ! data buffer -integer, dimension(width*height) :: bufr1 ! data buffer -integer, dimension(width*height*3) :: buf2 ! data buffer -integer, dimension(width*height*3) :: bufr2 ! data buffer -integer(hsize_t) :: widthr ! width of image -integer(hsize_t) :: heightr ! height of image -integer(hsize_t) :: planesr ! color planes -integer(hsize_t) :: npalsr ! palettes -character(len=15) :: interlacer ! interlace -integer :: errcode ! error flag -integer :: is_image ! error flag -integer :: i, j, n ! general purpose integers -! -! palette -! create a 9 entry palette -! -character(len=4), parameter :: pal_name = "pal1" ! dataset name -integer(hsize_t), dimension(2) :: pal_dims = (/pal_entries,3/) ! palette dimensions -integer(hsize_t), dimension(2) :: pal_dims_out ! palette dimensions -integer, dimension(pal_entries*3) :: pal_data_out ! data buffer -integer(hsize_t) :: npals ! number of palettes -integer :: pal_number ! palette number -integer :: is_palette ! is palette -integer :: space -integer, dimension(pal_entries*3) :: pal_data_in = (/& - 0,0,168,& ! dark blue - 0,0,252,& ! blue - 0,168,252,& ! ocean blue - 84,252,252,& ! light blue - 168,252,168,& ! light green - 0,252,168,& ! green - 252,252,84,& ! yellow - 252,168,0,& ! orange - 252,0,0/) ! red - - -! create an 8bit image of 9 values divided evenly by the array -! -space = width*height / pal_entries; -n = 0; j = 0; -do i = 1, width*height - buf1(i) = n - if ( j > space ) then - n = n + 1; - j = 0; - endif - if (n>pal_entries-1) n=0; - j = j +1; -end do - -! -! create a 3 byte rgb image -! -n = 0; j = 0; -do i = 1, width*height*3 - buf2(i) = n; - if (j == 3) then - n = n + 1; - j = 0; - endif - if (n>255) n=0; - j = j +1; -end do - - -! Initialize FORTRAN predefined datatypes. -! -call h5open_f(errcode) -! -! Create a new file using default properties. -! -call h5fcreate_f(filename, H5F_ACC_TRUNC_F, file_id, errcode) - -!------------------------------------------------------------------------- -! indexed image -!------------------------------------------------------------------------- - -call test_begin(' Make/Read image 8bit ') - -! -! write image. -! -call h5immake_image_8bit_f(file_id,dsetname1,width,height,buf1,errcode) -! -! read image. -! -call h5imread_image_f(file_id,dsetname1,bufr1,errcode) -! -! compare read and write buffers. -! -do i = 1, width*height - if ( buf1(i) /= bufr1(i) ) then - print *, 'read buffer differs from write buffer' - print *, bufr1(i), ' and ', buf1(i) - stop - endif -end do - -! -! get image info. -! -call h5imget_image_info_f(file_id,dsetname1,widthr,heightr,planesr,interlacer,npalsr,errcode) - -if ( (widthr /= widthr) .or. (heightr /= height) .or. (planesr /= 1)) then - print *, 'h5imget_image_info_f bad value' - stop -endif - -is_image = h5imis_image_f(file_id,dsetname1) -if ( is_image /= 1) then - print *, 'h5imis_image_f bad value' - stop -endif - - -call passed() - -!------------------------------------------------------------------------- -! true color image -!------------------------------------------------------------------------- - -call test_begin(' Make/Read image 24bit ') - -! -! write image. -! -call h5immake_image_24bit_f(file_id,dsetname2,width,height,il,buf2,errcode) - -! -! read image. -! -call h5imread_image_f(file_id,dsetname2,bufr2,errcode) - -! -! compare read and write buffers. -! -do i = 1, width*height*3 - if ( buf2(i) /= bufr2(i) ) then - print *, 'read buffer differs from write buffer' - print *, bufr2(i), ' and ', buf2(i) - stop - endif -end do - -! -! get image info. -! -call h5imget_image_info_f(file_id,dsetname2,widthr,heightr,planesr,interlacer,npalsr,errcode) - -if ( (widthr /= widthr) .or. (heightr /= height) .or. (planesr /= 3)) then - print *, 'h5imget_image_info_f bad value' - stop -endif - -is_image = h5imis_image_f(file_id,dsetname2) -if ( is_image /= 1) then - print *, 'h5imis_image_f bad value' - stop -endif - - - -call passed() - -!------------------------------------------------------------------------- -! palette -!------------------------------------------------------------------------- - -call test_begin(' Make palette ') - -! -! make palette. -! -call h5immake_palette_f(file_id,pal_name,pal_dims,pal_data_in,errcode) - -call passed() - - -call test_begin(' Link/Unlink palette ') - -! -! link palette. -! -call h5imlink_palette_f(file_id,dsetname1,pal_name,errcode) - - -! -! read palette. -! -pal_number = 0 -call h5imget_palette_f(file_id,dsetname1,pal_number,pal_data_out,errcode) - -! -! compare read and write buffers. -! -do i = 1, pal_entries*3 - if ( pal_data_in(i) /= pal_data_out(i) ) then - print *, 'read buffer differs from write buffer' - print *, pal_data_in(i), ' and ', pal_data_out(i) - stop - endif -end do - -! -! get number of palettes -! -call h5imget_npalettes_f(file_id,dsetname1,npals,errcode) - -if ( npals /= 1) then - print *, 'h5imget_npalettes_f bad value' - stop -endif - -! -! get palette info -! -pal_number = 0 -call h5imget_palette_info_f(file_id,dsetname1,pal_number,pal_dims_out,errcode) - -if ( (pal_dims_out(1) /= pal_dims(1)) .or. (pal_dims_out(2) /= pal_dims(2))) then - print *, 'h5imget_palette_info_f bad value' - stop -endif - -! -! is palette -! -is_palette = h5imis_palette_f(file_id,pal_name) - -if ( is_palette /= 1 ) then - print *, 'h5imis_palette_f bad value' - stop -endif - -! -! unlink palette. -! -call h5imunlink_palette_f(file_id,dsetname1,pal_name,errcode) - -! -! get number of palettes -! -call h5imget_npalettes_f(file_id,dsetname1,npals,errcode ) - -if ( npals /= 0) then - print *, 'h5imget_npalettes_f bad value' - stop -endif - - -! -! link palette again -! -call h5imlink_palette_f(file_id,dsetname1,pal_name,errcode) - -call passed() - - -!------------------------------------------------------------------------- -! end -!------------------------------------------------------------------------- - -! -! Close the file. -! -call h5fclose_f(file_id, errcode) - -! -! Close FORTRAN predefined datatypes. -! -call h5close_f(errcode) - -! -! end function. -! -end subroutine make_image1 - -!------------------------------------------------------------------------- -! test_begin -!------------------------------------------------------------------------- - -subroutine test_begin(string) -character(len=*), intent(in) :: string -write(*, fmt = '(14a)', advance = 'no') string -write(*, fmt = '(40x,a)', advance = 'no') ' ' -end subroutine test_begin - -!------------------------------------------------------------------------- -! passed -!------------------------------------------------------------------------- - -subroutine passed() -write(*, fmt = '(6a)') 'PASSED' -end subroutine passed diff --git a/hl/fortran/test/tstlite.F90 b/hl/fortran/test/tstlite.F90 new file mode 100644 index 0000000..0eb005b --- /dev/null +++ b/hl/fortran/test/tstlite.F90 @@ -0,0 +1,1719 @@ +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! 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. * +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! +! +! This file contains the FORTRAN90 tests for H5LT +! +#include + +PROGRAM lite_test + + CALL test_dataset1D() + CALL test_dataset2D() + CALL test_dataset3D() + CALL test_datasetND(4) + CALL test_datasetND(5) + CALL test_datasetND(6) + CALL test_datasetND(7) + CALL test_datasets() + CALL test_attributes() + +END PROGRAM lite_test + + +!------------------------------------------------------------------------- +! test_dataset1D +!------------------------------------------------------------------------- + +SUBROUTINE test_dataset1D() + +USE, INTRINSIC :: ISO_C_BINDING +USE H5LT ! module of H5LT +USE HDF5 ! module of HDF5 library + +IMPLICIT NONE + +INTEGER, PARAMETER :: DIM1 = 4; ! Dimension of array +CHARACTER(len=9), PARAMETER :: filename = "dsetf1.h5"! File name +CHARACTER(LEN=5), PARAMETER :: dsetname1 = "dset1" ! Dataset name +CHARACTER(LEN=5), PARAMETER :: dsetname2 = "dset2" ! Dataset name +CHARACTER(LEN=5), PARAMETER :: dsetname3 = "dset3" ! Dataset name +INTEGER(HID_T) :: file_id ! File identifier +INTEGER(HSIZE_T), DIMENSION(1) :: dims = (/DIM1/) ! Dataset dimensions +INTEGER :: rank = 1 ! Dataset rank +INTEGER, DIMENSION(DIM1) :: buf1 ! Data buffer +INTEGER, DIMENSION(DIM1) :: bufr1 ! Data buffer +REAL, DIMENSION(DIM1) :: buf2 ! Data buffer +REAL, DIMENSION(DIM1) :: bufr2 ! Data buffer +DOUBLE PRECISION, DIMENSION(DIM1), TARGET :: buf3 ! Data buffer +DOUBLE PRECISION, DIMENSION(DIM1), TARGET :: bufr3 ! Data buffer +INTEGER :: errcode ! Error flag +INTEGER :: i ! general purpose integer +TYPE(C_PTR) :: f_ptr +integer(HID_T) :: mytype + +CALL test_begin(' Make/Read datasets (1D) ') + +! +! Initialize the data array. +! +DO i = 1, DIM1 + buf1(i) = i; + buf2(i) = i; + buf3(i) = i; +END DO + +! +! Initialize FORTRAN predefined datatypes. +! +CALL h5open_f(errcode) + +! +! Create a new file using default properties. +! +CALL h5fcreate_f(filename, H5F_ACC_TRUNC_F, file_id, errcode) + +!------------------------------------------------------------------------- +! H5T_NATIVE_INTEGER +!------------------------------------------------------------------------- + +! +! write dataset. +! +CALL h5ltmake_dataset_f(file_id, dsetname1, rank, dims, H5T_NATIVE_INTEGER, buf1, errcode) + +! +! read dataset. +! +CALL h5ltread_dataset_f(file_id, dsetname1, H5T_NATIVE_INTEGER, bufr1, dims, errcode) + +! +! compare read and write buffers. +! +DO i = 1, DIM1 + IF ( buf1(i) .NE. bufr1(i) ) THEN + PRINT *, 'read buffer differs from write buffer (I)' + PRINT *, bufr1(i), ' and ', buf1(i) + STOP + ENDIF +END DO + +!------------------------------------------------------------------------- +! H5T_NATIVE_REAL +!------------------------------------------------------------------------- + +! +! write dataset. +! +CALL h5ltmake_dataset_f(file_id, dsetname2, rank, dims, H5T_NATIVE_REAL, buf2, errcode) + +! +! read dataset. +! +CALL h5ltread_dataset_f(file_id, dsetname2, H5T_NATIVE_REAL, bufr2, dims, errcode) + +! +! compare read and write buffers. +! +DO i = 1, DIM1 + IF ( buf2(i) .NE. bufr2(i) ) THEN + PRINT *, 'read buffer differs from write buffer (R)' + PRINT *, bufr2(i), ' and ', buf2(i) + STOP + ENDIF +END DO + +!------------------------------------------------------------------------- +! H5T_NATIVE_DOUBLE +!------------------------------------------------------------------------- + +! +! write dataset. +! +f_ptr = C_LOC(buf3(1)) +mytype = h5kind_to_type(KIND(buf3(1)), H5_REAL_KIND) +CALL h5ltmake_dataset_f(file_id, dsetname3, rank, dims, & + mytype, f_ptr, errcode) +!CALL h5ltmake_dataset_f(file_id, dsetname3, rank, dims, H5T_NATIVE_DOUBLE, buf3, errcode) +! h5kind_to_type(KIND(buf3(1)), H5_REAL_KIND) +! +! read dataset. +! +f_ptr = C_LOC(bufr3(1)) +CALL h5ltread_dataset_f(file_id, dsetname3, & + h5kind_to_type(KIND(bufr3(1)), H5_REAL_KIND), f_ptr, errcode) +!CALL h5ltread_dataset_f(file_id, dsetname3, H5T_NATIVE_DOUBLE, bufr3, dims, errcode) + +! +! compare read and write buffers. +! +DO i = 1, DIM1 + IF ( buf3(i) .NE. bufr3(i) ) THEN + PRINT *, 'read buffer differs from write buffer (D)' + PRINT *, bufr3(i), ' and ', buf3(i) + STOP + ENDIF +END DO + +! +! Close the file. +! +CALL h5fclose_f(file_id, errcode) + +! +! Close FORTRAN predefined datatypes. +! +CALL h5close_f(errcode) + +CALL passed() +! +! end function. +! +END SUBROUTINE test_dataset1D + +!------------------------------------------------------------------------- +! test_dataset2D +!------------------------------------------------------------------------- + +SUBROUTINE test_dataset2D() + +USE, INTRINSIC :: ISO_C_BINDING +USE H5LT ! module of H5LT +USE HDF5 ! module of HDF5 library + +IMPLICIT NONE + + +INTEGER(HSIZE_T), PARAMETER :: DIM1 = 4; ! columns +INTEGER(HSIZE_T), PARAMETER :: DIM2 = 6; ! rows +CHARACTER(len=9), PARAMETER :: filename = "dsetf2.h5"! File name +CHARACTER(LEN=5), PARAMETER :: dsetname1 = "dset1" ! Dataset name +CHARACTER(LEN=5), PARAMETER :: dsetname2 = "dset2" ! Dataset name +CHARACTER(LEN=5), PARAMETER :: dsetname3 = "dset3" ! Dataset name +CHARACTER(LEN=5), PARAMETER :: dsetname4 = "dset4" ! Dataset name +INTEGER(HID_T) :: file_id ! File identifier +INTEGER(HSIZE_T), DIMENSION(2) :: dims = (/4,6/) ! Dataset dimensions +INTEGER :: rank = 2 ! Dataset rank +INTEGER, DIMENSION(DIM1*DIM2) :: buf ! Data buffer +INTEGER, DIMENSION(DIM1*DIM2) :: bufr ! Data buffer +INTEGER, DIMENSION(DIM1,DIM2) :: buf2 ! Data buffer +INTEGER, DIMENSION(DIM1,DIM2) :: buf2r ! Data buffer +REAL, DIMENSION(DIM1,DIM2), TARGET :: buf3 ! Data buffer +REAL, DIMENSION(DIM1,DIM2), TARGET :: buf3r ! Data buffer +DOUBLE PRECISION, DIMENSION(DIM1,DIM2), TARGET :: buf4 ! Data buffer +DOUBLE PRECISION, DIMENSION(DIM1,DIM2), TARGET :: buf4r ! Data buffer +INTEGER :: errcode ! Error flag +INTEGER(HSIZE_T) :: i, j, n ! general purpose integers +TYPE(C_PTR) :: f_ptr + +CALL test_begin(' Make/Read datasets (2D) ') + + +! +! Initialize the data arrays. +! +n=1 +DO i = 1, DIM1*DIM2 + buf(i) = INT(n) + n = n + 1 +END DO + +DO i = 1, dims(1) + DO j = 1, dims(2) + buf2(i,j) = INT((i-1)*dims(2) + j) + buf3(i,j) = INT((i-1)*dims(2) + j) + buf4(i,j) = INT((i-1)*dims(2) + j) + END DO +END DO + + +! +! Initialize FORTRAN predefined datatypes. +! +CALL h5open_f(errcode) + +! +! Create a new file using default properties. +! +CALL h5fcreate_f(filename, H5F_ACC_TRUNC_F, file_id, errcode) + +!------------------------------------------------------------------------- +! H5T_NATIVE_INT 1D buffer +!------------------------------------------------------------------------- + +! +! write dataset. +! +CALL h5ltmake_dataset_f(file_id, dsetname1, rank, dims, H5T_NATIVE_INTEGER, buf, errcode) + +! +! read dataset. +! +CALL h5ltread_dataset_f(file_id, dsetname1, H5T_NATIVE_INTEGER, bufr, dims, errcode) + +! +! compare read and write buffers. +! +DO i = 1, DIM1*DIM2 + IF ( buf(i) .NE. bufr(i) ) THEN + PRINT *, 'read buffer differs from write buffer' + PRINT *, bufr(i), ' and ', buf(i) + STOP + ENDIF +END DO + +!------------------------------------------------------------------------- +! H5T_NATIVE_INT 2D buffer +!------------------------------------------------------------------------- + +! +! write dataset. +! +CALL h5ltmake_dataset_f(file_id, dsetname2, rank, dims, H5T_NATIVE_INTEGER, buf2, errcode) + +! +! read dataset. +! +CALL h5ltread_dataset_f(file_id, dsetname2, H5T_NATIVE_INTEGER, buf2r, dims, errcode) + +! +! compare read and write buffers. +! +DO i = 1, dims(1) + DO j = 1, dims(2) + IF ( buf2(i,j) .NE. buf2r(i,j) ) THEN + PRINT *, 'read buffer differs from write buffer' + PRINT *, buf2r(i,j), ' and ', buf2(i,j) + STOP + ENDIF + END DO +END DO + +!------------------------------------------------------------------------- +! H5T_NATIVE_REAL +!------------------------------------------------------------------------- + +! +! write dataset. +! +f_ptr = C_LOC(buf3(1,1)) +CALL h5ltmake_dataset_f(file_id, dsetname3, rank, dims, H5T_NATIVE_REAL, f_ptr, errcode) +!CALL h5ltmake_dataset_f(file_id, dsetname3, rank, dims, H5T_NATIVE_REAL, buf3, errcode) + +! +! read dataset. +! +f_ptr = C_LOC(buf3r(1,1)) +CALL h5ltread_dataset_f(file_id, dsetname3, H5T_NATIVE_REAL, f_ptr, errcode) +!CALL h5ltread_dataset_f(file_id, dsetname3, H5T_NATIVE_REAL, buf3r, dims, errcode) + +! +! compare read and write buffers. +! +DO i = 1, dims(1) + DO j = 1, dims(2) + IF ( buf3(i,j) .NE. buf3r(i,j) ) THEN + PRINT *, 'read buffer differs from write buffer' + PRINT *, buf3r(i,j), ' and ', buf3(i,j) + STOP + ENDIF + END DO +END DO + +!------------------------------------------------------------------------- +! H5T_NATIVE_DOUBLE +!------------------------------------------------------------------------- + +! +! write dataset. +! +f_ptr = C_LOC(buf4(1,1)) +CALL h5ltmake_dataset_f(file_id, dsetname4, rank, dims, H5T_NATIVE_DOUBLE, f_ptr, errcode) +!CALL h5ltmake_dataset_f(file_id, dsetname4, rank, dims, H5T_NATIVE_DOUBLE, buf4, errcode) + +! +! read dataset. +f_ptr = C_LOC(buf4r(1,1)) +CALL h5ltread_dataset_f(file_id, dsetname4, H5T_NATIVE_DOUBLE, f_ptr, errcode) + +!CALL h5ltread_dataset_f(file_id, dsetname4, H5T_NATIVE_DOUBLE, buf4r, dims, errcode) + +! +! compare read and write buffers. +! +DO i = 1, dims(1) + DO j = 1, dims(2) + IF ( buf4(i,j) .NE. buf4r(i,j) ) THEN + PRINT *, 'read buffer differs from write buffer' + PRINT *, buf4r(i,j), ' and ', buf4(i,j) + STOP + ENDIF + END DO +END DO + +! +! Close the file. +! +CALL h5fclose_f(file_id, errcode) + +! +! Close FORTRAN predefined datatypes. +! +CALL h5close_f(errcode) + +CALL passed() +! +! end function. +! +END SUBROUTINE test_dataset2D + + +!------------------------------------------------------------------------- +! test_dataset3D +!------------------------------------------------------------------------- + + +SUBROUTINE test_dataset3D() +USE, INTRINSIC :: ISO_C_BINDING +USE H5LT ! module of H5LT +USE HDF5 ! module of HDF5 library + +IMPLICIT NONE + +INTEGER, PARAMETER :: DIM1 = 6 ! columns +INTEGER, PARAMETER :: DIM2 = 4 ! rows +INTEGER, PARAMETER :: DIM3 = 2 ! layers +CHARACTER(len=9), PARAMETER :: filename = "dsetf3.h5" ! File name +CHARACTER(LEN=5), PARAMETER :: dsetname1 = "dset1" ! Dataset name +CHARACTER(LEN=5), PARAMETER :: dsetname2 = "dset2" ! Dataset name +CHARACTER(LEN=5), PARAMETER :: dsetname3 = "dset3" ! Dataset name +CHARACTER(LEN=5), PARAMETER :: dsetname4 = "dset4" ! Dataset name +INTEGER(HID_T) :: file_id ! File identifier +INTEGER(HSIZE_T), DIMENSION(3) :: dims = (/DIM1,DIM2,DIM3/) ! Dataset dimensions +INTEGER(HSIZE_T), DIMENSION(3) :: dimsr ! Dataset dimensions +INTEGER, DIMENSION(DIM1*DIM2*DIM3) :: buf ! Data buffer +INTEGER, DIMENSION(DIM1*DIM2*DIM3) :: bufr ! Data buffer +INTEGER, DIMENSION(DIM1,DIM2,DIM3) :: buf2 ! Data buffer +INTEGER, DIMENSION(DIM1,DIM2,DIM3) :: buf2r ! Data buffer +REAL, DIMENSION(DIM1,DIM2,DIM3), TARGET :: buf3 ! Data buffer +REAL, DIMENSION(DIM1,DIM2,DIM3), TARGET :: buf3r ! Data buffer +DOUBLE PRECISION, DIMENSION(DIM1,DIM2,DIM3), TARGET :: buf4 ! Data buffer +DOUBLE PRECISION, DIMENSION(DIM1,DIM2,DIM3), TARGET :: buf4r ! Data buffer +INTEGER :: rank = 3 ! Dataset rank +INTEGER :: errcode ! Error flag +INTEGER(HSIZE_T) :: i, j, k, n ! general purpose integers +INTEGER :: type_class +INTEGER(SIZE_T) :: type_size +TYPE(C_PTR) :: f_ptr +CALL test_begin(' Make/Read datasets (3D) ') + + +! +! Initialize the data array. +! +n=1 +DO i = 1, DIM1*DIM2*DIM3 + buf(i) = INT(n) + n = n + 1 +END DO + +n = 1 +DO i = 1, dims(1) + DO j = 1, dims(2) + DO k = 1, dims(3) + buf2(i,j,k) = INT(n) + buf3(i,j,k) = INT(n) + buf4(i,j,k) = INT(n) + n = n + 1 + END DO + END DO +END DO + +! +! Initialize FORTRAN predefined datatypes. +! +CALL h5open_f(errcode) + +! +! Create a new file using default properties. +! +CALL h5fcreate_f(filename, H5F_ACC_TRUNC_F, file_id, errcode) + +!------------------------------------------------------------------------- +! H5T_NATIVE_INT 1D buffer +!------------------------------------------------------------------------- + +! +! write dataset. +! +CALL h5ltmake_dataset_f(file_id, dsetname1, rank, dims, H5T_NATIVE_INTEGER, buf, errcode) + +! +! read dataset. +! +CALL h5ltread_dataset_f(file_id, dsetname1, H5T_NATIVE_INTEGER, bufr, dims, errcode) + +! +! compare read and write buffers. +! +DO i = 1, DIM1*DIM2*DIM3 + IF ( buf(i) .NE. bufr(i) ) THEN + PRINT *, 'read buffer differs from write buffer' + PRINT *, bufr(i), ' and ', buf(i) + STOP + ENDIF +END DO + +!------------------------------------------------------------------------- +! H5T_NATIVE_INT 3D buffer +!------------------------------------------------------------------------- + +! +! write dataset. +! +CALL h5ltmake_dataset_f(file_id, dsetname2, rank, dims, H5T_NATIVE_INTEGER, buf2, errcode) + +! +! read dataset. +! +CALL h5ltread_dataset_f(file_id, dsetname2, H5T_NATIVE_INTEGER, buf2r, dims, errcode) + +! +! compare read and write buffers. +! +DO i = 1, dims(1) + DO j = 1, dims(2) + DO k = 1, dims(3) + IF ( buf2(i,j,k) .NE. buf2r(i,j,k) ) THEN + PRINT *, 'read buffer differs from write buffer' + PRINT *, buf2r(i,j,k), ' and ', buf2(i,j,k) + STOP + ENDIF + END DO + END DO +END DO + +!------------------------------------------------------------------------- +! H5T_NATIVE_REAL +!------------------------------------------------------------------------- + +! +! write dataset. +! +f_ptr = C_LOC(buf3(1,1,1)) +CALL h5ltmake_dataset_f(file_id, dsetname3, rank, dims, H5T_NATIVE_REAL, f_ptr, errcode) +!CALL h5ltmake_dataset_f(file_id, dsetname3, rank, dims, H5T_NATIVE_REAL, buf3, errcode) + +! +! read dataset. +! +f_ptr = C_LOC(buf3r(1,1,1)) +CALL h5ltread_dataset_f(file_id, dsetname3, H5T_NATIVE_REAL, f_ptr, errcode) +!CALL h5ltread_dataset_f(file_id, dsetname3, H5T_NATIVE_REAL, buf3r, dims, errcode) + +! +! compare read and write buffers. +! +DO i = 1, dims(1) + DO j = 1, dims(2) + DO k = 1, dims(3) + IF ( buf3(i,j,k) .NE. buf3r(i,j,k) ) THEN + PRINT *, 'read buffer differs from write buffer' + PRINT *, buf3r(i,j,k), ' and ', buf3(i,j,k) + STOP + ENDIF + END DO + END DO +END DO + +!------------------------------------------------------------------------- +! H5T_NATIVE_DOUBLE +!------------------------------------------------------------------------- + +! +! write dataset. +! +f_ptr = C_LOC(buf4(1,1,1)) +CALL h5ltmake_dataset_f(file_id, dsetname4, rank, dims, H5T_NATIVE_DOUBLE, f_ptr, errcode) + +! +! read dataset. +! +f_ptr = C_LOC(buf4r(1,1,1)) +CALL h5ltread_dataset_f(file_id, dsetname4, H5T_NATIVE_DOUBLE, f_ptr, errcode) + +! +! compare read and write buffers. +! +DO i = 1, dims(1) + DO j = 1, dims(2) + DO k = 1, dims(3) + IF ( buf4(i,j,k) .NE. buf4r(i,j,k) ) THEN + PRINT *, 'read buffer differs from write buffer' + PRINT *, buf4r(i,j,k), ' and ', buf4(i,j,k) + STOP + ENDIF + END DO + END DO +END DO + +CALL h5ltget_dataset_info_f(file_id,dsetname4,dimsr,type_class,type_size,errcode ) + +! +! compare dimensions +! +DO i = 1, rank + IF ( dimsr(i) .NE. dims(i) ) THEN + PRINT *, 'dimensions differ ' + STOP + ENDIF +END DO + +! +! Close the file. +! +CALL h5fclose_f(file_id, errcode) + +! +! Close FORTRAN predefined datatypes. +! +CALL h5close_f(errcode) + +CALL passed() +! +! end function. +! +END SUBROUTINE test_dataset3D + +!------------------------------------------------------------------------- +! test_datasetND +!------------------------------------------------------------------------- + + +SUBROUTINE test_datasetND(rank) + + USE, INTRINSIC :: ISO_C_BINDING + USE H5LT ! module of H5LT + USE HDF5 ! module of HDF5 library + + IMPLICIT NONE + + INTEGER :: rank ! Dataset rank + + INTEGER, PARAMETER :: DIM1 = 2 ! columns + INTEGER, PARAMETER :: DIM2 = 4 ! rows + INTEGER, PARAMETER :: DIM3 = 2 ! layers + INTEGER, PARAMETER :: DIM4 = 5 ! columns + INTEGER, PARAMETER :: DIM5 = 4 ! rows + INTEGER, PARAMETER :: DIM6 = 3 ! layers + INTEGER, PARAMETER :: DIM7 = 2 ! layers + CHARACTER(len=9), PARAMETER :: filename = "dsetf3.h5" ! File name + CHARACTER(LEN=5), PARAMETER :: dsetname2 = "dset2" ! Dataset name + CHARACTER(LEN=5), PARAMETER :: dsetname3 = "dset3" ! Dataset name + CHARACTER(LEN=5), PARAMETER :: dsetname4 = "dset4" ! Dataset name + INTEGER(HID_T) :: file_id ! File identifier + INTEGER(HSIZE_T), DIMENSION(7) :: dims + INTEGER(HSIZE_T), DIMENSION(7) :: dimsr ! Dataset dimensions + INTEGER, ALLOCATABLE, DIMENSION(:,:,:,:) :: ibuf_4 ! Data buffer + INTEGER, ALLOCATABLE, DIMENSION(:,:,:,:) :: ibufr_4 ! Data buffer + INTEGER, ALLOCATABLE, DIMENSION(:,:,:,:,:), TARGET :: ibuf_5 ! Data buffer + INTEGER, ALLOCATABLE, DIMENSION(:,:,:,:,:), TARGET :: ibufr_5 ! Data buffer + INTEGER, ALLOCATABLE, DIMENSION(:,:,:,:,:,:) :: ibuf_6 ! Data buffer + INTEGER, ALLOCATABLE, DIMENSION(:,:,:,:,:,:) :: ibufr_6 ! Data buffer + INTEGER, ALLOCATABLE, DIMENSION(:,:,:,:,:,:,:) :: ibuf_7 ! Data buffer + INTEGER, ALLOCATABLE, DIMENSION(:,:,:,:,:,:,:) :: ibufr_7 ! Data buffer + REAL, ALLOCATABLE, DIMENSION(:,:,:,:), TARGET :: rbuf_4 ! Data buffer + REAL, ALLOCATABLE, DIMENSION(:,:,:,:), TARGET :: rbufr_4 ! Data buffer + REAL, ALLOCATABLE, DIMENSION(:,:,:,:,:), TARGET :: rbuf_5 ! Data buffer + REAL, ALLOCATABLE, DIMENSION(:,:,:,:,:), TARGET :: rbufr_5 ! Data buffer + REAL, ALLOCATABLE, DIMENSION(:,:,:,:,:,:), TARGET :: rbuf_6 ! Data buffer + REAL, ALLOCATABLE, DIMENSION(:,:,:,:,:,:), TARGET :: rbufr_6 ! Data buffer + REAL, ALLOCATABLE, DIMENSION(:,:,:,:,:,:,:), TARGET :: rbuf_7 ! Data buffer + REAL, ALLOCATABLE, DIMENSION(:,:,:,:,:,:,:), TARGET :: rbufr_7 ! Data buffer + DOUBLE PRECISION, ALLOCATABLE, DIMENSION(:,:,:,:), TARGET :: dbuf_4 ! Data buffer + DOUBLE PRECISION, ALLOCATABLE, DIMENSION(:,:,:,:), TARGET :: dbufr_4 ! Data buffer + DOUBLE PRECISION, ALLOCATABLE, DIMENSION(:,:,:,:,:), TARGET :: dbuf_5 ! Data buffer + DOUBLE PRECISION, ALLOCATABLE, DIMENSION(:,:,:,:,:), TARGET :: dbufr_5 ! Data buffer + DOUBLE PRECISION, ALLOCATABLE, DIMENSION(:,:,:,:,:,:), TARGET :: dbuf_6 ! Data buffer + DOUBLE PRECISION, ALLOCATABLE, DIMENSION(:,:,:,:,:,:), TARGET :: dbufr_6 ! Data buffer + DOUBLE PRECISION, ALLOCATABLE, DIMENSION(:,:,:,:,:,:,:), TARGET :: dbuf_7 ! Data buffer + DOUBLE PRECISION, ALLOCATABLE, DIMENSION(:,:,:,:,:,:,:), TARGET :: dbufr_7 ! Data buffer + INTEGER :: errcode ! Error flag + INTEGER(HSIZE_T) :: i, j, k, l, m, n, o, nn ! general purpose integers + INTEGER :: type_class + INTEGER(SIZE_T) :: type_size + CHARACTER(LEN=1) :: ichr1 + TYPE(C_PTR) :: f_ptr + + WRITE(ichr1,'(I1.1)') rank + CALL test_begin(' Make/Read datasets ('//ichr1//'D) ') +! +! Initialize the data array. +! + IF(rank.EQ.4)THEN + + ALLOCATE(ibuf_4 (1:DIM1,1:DIM2,1:DIM3,1:DIM4)) + ALLOCATE(ibufr_4(1:DIM1,1:DIM2,1:DIM3,1:DIM4)) + ALLOCATE(rbuf_4 (1:DIM1,1:DIM2,1:DIM3,1:DIM4)) + ALLOCATE(rbufr_4(1:DIM1,1:DIM2,1:DIM3,1:DIM4)) + ALLOCATE(dbuf_4 (1:DIM1,1:DIM2,1:DIM3,1:DIM4)) + ALLOCATE(dbufr_4(1:DIM1,1:DIM2,1:DIM3,1:DIM4)) + + dims(1:7) = (/DIM1,DIM2,DIM3,DIM4,0,0,0/) + + nn = 1 + DO i = 1, DIM1 + DO j = 1, DIM2 + DO k = 1, DIM3 + DO l = 1, DIM4 + ibuf_4(i,j,k,l) = INT(nn) + rbuf_4(i,j,k,l) = INT(nn) + dbuf_4(i,j,k,l) = INT(nn) + nn = nn + 1 + END DO + END DO + END DO + ENDDO + + ELSE IF(rank.EQ.5)THEN + + ALLOCATE(ibuf_5 (1:DIM1,1:DIM2,1:DIM3,1:DIM4,1:DIM5)) + ALLOCATE(ibufr_5(1:DIM1,1:DIM2,1:DIM3,1:DIM4,1:DIM5)) + ALLOCATE(rbuf_5 (1:DIM1,1:DIM2,1:DIM3,1:DIM4,1:DIM5)) + ALLOCATE(rbufr_5(1:DIM1,1:DIM2,1:DIM3,1:DIM4,1:DIM5)) + ALLOCATE(dbuf_5 (1:DIM1,1:DIM2,1:DIM3,1:DIM4,1:DIM5)) + ALLOCATE(dbufr_5(1:DIM1,1:DIM2,1:DIM3,1:DIM4,1:DIM5)) + + dims(1:7) = (/DIM1,DIM2,DIM3,DIM4,DIM5,0,0/) + + nn = 1 + DO i = 1, DIM1 + DO j = 1, DIM2 + DO k = 1, DIM3 + DO l = 1, DIM4 + DO m = 1, DIM5 + ibuf_5(i,j,k,l,m) = INT(nn) + rbuf_5(i,j,k,l,m) = INT(nn) + dbuf_5(i,j,k,l,m) = INT(nn) + nn = nn + 1 + END DO + END DO + END DO + ENDDO + ENDDO + + ELSE IF(rank.EQ.6)THEN + + ALLOCATE(ibuf_6 (1:DIM1,1:DIM2,1:DIM3,1:DIM4,1:DIM5,1:DIM6)) + ALLOCATE(ibufr_6(1:DIM1,1:DIM2,1:DIM3,1:DIM4,1:DIM5,1:DIM6)) + ALLOCATE(rbuf_6 (1:DIM1,1:DIM2,1:DIM3,1:DIM4,1:DIM5,1:DIM6)) + ALLOCATE(rbufr_6(1:DIM1,1:DIM2,1:DIM3,1:DIM4,1:DIM5,1:DIM6)) + ALLOCATE(dbuf_6 (1:DIM1,1:DIM2,1:DIM3,1:DIM4,1:DIM5,1:DIM6)) + ALLOCATE(dbufr_6(1:DIM1,1:DIM2,1:DIM3,1:DIM4,1:DIM5,1:DIM6)) + + dims(1:7) = (/DIM1,DIM2,DIM3,DIM4,DIM5,DIM6,0/) + + nn = 1 + DO i = 1, DIM1 + DO j = 1, DIM2 + DO k = 1, DIM3 + DO l = 1, DIM4 + DO m = 1, DIM5 + DO n = 1, DIM6 + ibuf_6(i,j,k,l,m,n) = INT(nn) + rbuf_6(i,j,k,l,m,n) = INT(nn) + dbuf_6(i,j,k,l,m,n) = INT(nn) + nn = nn + 1 + END DO + END DO + END DO + ENDDO + ENDDO + ENDDO + + ELSE IF(rank.EQ.7)THEN + + ALLOCATE(ibuf_7 (1:DIM1,1:DIM2,1:DIM3,1:DIM4,1:DIM5,1:DIM6,1:DIM7)) + ALLOCATE(ibufr_7(1:DIM1,1:DIM2,1:DIM3,1:DIM4,1:DIM5,1:DIM6,1:DIM7)) + ALLOCATE(rbuf_7 (1:DIM1,1:DIM2,1:DIM3,1:DIM4,1:DIM5,1:DIM6,1:DIM7)) + ALLOCATE(rbufr_7(1:DIM1,1:DIM2,1:DIM3,1:DIM4,1:DIM5,1:DIM6,1:DIM7)) + ALLOCATE(dbuf_7 (1:DIM1,1:DIM2,1:DIM3,1:DIM4,1:DIM5,1:DIM6,1:DIM7)) + ALLOCATE(dbufr_7(1:DIM1,1:DIM2,1:DIM3,1:DIM4,1:DIM5,1:DIM6,1:DIM7)) + + dims(1:7) = (/DIM1,DIM2,DIM3,DIM4,DIM5,DIM6,DIM7/) + + nn = 1 + DO i = 1, DIM1 + DO j = 1, DIM2 + DO k = 1, DIM3 + DO l = 1, DIM4 + DO m = 1, DIM5 + DO n = 1, DIM6 + DO o = 1, DIM7 + ibuf_7(i,j,k,l,m,n,o) = INT(nn) + rbuf_7(i,j,k,l,m,n,o) = INT(nn) + dbuf_7(i,j,k,l,m,n,o) = INT(nn) + nn = nn + 1 + END DO + END DO + END DO + ENDDO + ENDDO + ENDDO + ENDDO + + ENDIF + + ! + ! Initialize FORTRAN predefined datatypes. + ! + CALL h5open_f(errcode) + + ! + ! Create a new file using default properties. + ! + CALL h5fcreate_f(filename, H5F_ACC_TRUNC_F, file_id, errcode) + + !------------------------------------------------------------------------- + ! H5T_NATIVE_INT ND buffer + !------------------------------------------------------------------------- + + ! + ! write dataset. + ! + IF(rank.EQ.4)THEN + CALL h5ltmake_dataset_f(file_id, dsetname2, rank, dims(1:rank), H5T_NATIVE_INTEGER, ibuf_4, errcode) + ELSE IF(rank.EQ.5)THEN + f_ptr = C_LOC(ibuf_5(1,1,1,1,1)) + CALL h5ltmake_dataset_f(file_id, dsetname2, rank, dims(1:rank), H5T_NATIVE_INTEGER, f_ptr, errcode) + ELSE IF(rank.EQ.6)THEN + CALL h5ltmake_dataset_f(file_id, dsetname2, rank, dims(1:rank), H5T_NATIVE_INTEGER, ibuf_6, errcode) + ELSE IF(rank.EQ.7)THEN + CALL h5ltmake_dataset_f(file_id, dsetname2, rank, dims(1:rank), H5T_NATIVE_INTEGER, ibuf_7, errcode) + ENDIF + + + ! + ! read dataset. + ! + IF(rank.EQ.4)THEN + CALL h5ltread_dataset_f(file_id, dsetname2, H5T_NATIVE_INTEGER, ibufr_4, dims(1:rank), errcode) + ELSE IF(rank.EQ.5)THEN + f_ptr = C_LOC(ibufr_5(1,1,1,1,1)) + CALL h5ltread_dataset_f(file_id, dsetname2, H5T_NATIVE_INTEGER, f_ptr, errcode) + ELSE IF(rank.EQ.6)THEN + CALL h5ltread_dataset_f(file_id, dsetname2, H5T_NATIVE_INTEGER, ibufr_6, dims(1:rank), errcode) + ELSE IF(rank.EQ.7)THEN + CALL h5ltread_dataset_f(file_id, dsetname2, H5T_NATIVE_INTEGER, ibufr_7, dims(1:rank), errcode) + ENDIF + + ! + ! compare read and write buffers. + ! + DO i = 1, dims(1) + DO j = 1, dims(2) + DO k = 1, dims(3) + DO l = 1, dims(4) + IF(rank.EQ.4)THEN + IF ( ibuf_4(i,j,k,l) .NE. ibufr_4(i,j,k,l) ) THEN + PRINT *, 'read buffer differs from write buffer' + PRINT *, ibuf_4(i,j,k,l), ' and ', ibufr_4(i,j,k,l) + STOP + ENDIF + ENDIF + DO m = 1, dims(5) + IF(rank.EQ.5)THEN + IF ( ibuf_5(i,j,k,l,m) .NE. ibufr_5(i,j,k,l,m) ) THEN + PRINT *, 'read buffer differs from write buffer' + PRINT *, ibuf_5(i,j,k,l,m), ' and ', ibufr_5(i,j,k,l,m) + STOP + ENDIF + ENDIF + DO n = 1, dims(6) + IF(rank.EQ.6)THEN + IF ( ibuf_6(i,j,k,l,m,n) .NE. ibufr_6(i,j,k,l,m,n) ) THEN + PRINT *, 'read buffer differs from write buffer' + PRINT *, ibuf_6(i,j,k,l,m,n), ' and ', ibufr_6(i,j,k,l,m,n) + STOP + ENDIF + ENDIF + DO o = 1, dims(7) + IF(rank.EQ.7)THEN + IF ( ibuf_7(i,j,k,l,m,n,o) .NE. ibufr_7(i,j,k,l,m,n,o) ) THEN + PRINT *, 'read buffer differs from write buffer' + PRINT *, ibuf_7(i,j,k,l,m,n,o), ' and ', ibufr_7(i,j,k,l,m,n,o) + STOP + ENDIF + ENDIF + ENDDO + ENDDO + ENDDO + ENDDO + ENDDO + ENDDO + ENDDO + !------------------------------------------------------------------------- + ! H5T_NATIVE_REAL + !------------------------------------------------------------------------- + + ! + ! write dataset. + ! + IF(rank.EQ.4)THEN + f_ptr = C_LOC(rbuf_4(1,1,1,1)) + CALL h5ltmake_dataset_f(file_id, dsetname3, rank, dims(1:rank), H5T_NATIVE_REAL, f_ptr, errcode) + ! CALL h5ltmake_dataset_f(file_id, dsetname3, rank, dims(1:rank), H5T_NATIVE_REAL, rbuf_4, errcode) + ELSE IF(rank.EQ.5)THEN + f_ptr = C_LOC(rbuf_5(1,1,1,1,1)) + CALL h5ltmake_dataset_f(file_id, dsetname3, rank, dims(1:rank), H5T_NATIVE_REAL, f_ptr, errcode) + ELSE IF(rank.EQ.6)THEN + f_ptr = C_LOC(rbuf_6(1,1,1,1,1,1)) + CALL h5ltmake_dataset_f(file_id, dsetname3, rank, dims(1:rank), H5T_NATIVE_REAL, f_ptr, errcode) + !CALL h5ltmake_dataset_f(file_id, dsetname3, rank, dims(1:rank), H5T_NATIVE_REAL, rbuf_6, errcode) + ELSE IF(rank.EQ.7)THEN + f_ptr = C_LOC(rbuf_7(1,1,1,1,1,1,1)) + CALL h5ltmake_dataset_f(file_id, dsetname3, rank, dims(1:rank), H5T_NATIVE_REAL, f_ptr, errcode) + !CALL h5ltmake_dataset_f(file_id, dsetname3, rank, dims(1:rank), H5T_NATIVE_REAL, rbuf_7, errcode) + ENDIF + + + ! + ! read dataset. + ! + IF(rank.EQ.4)THEN + f_ptr = C_LOC(rbufr_4(1,1,1,1)) + CALL h5ltread_dataset_f(file_id, dsetname3, H5T_NATIVE_REAL, f_ptr, errcode) + ELSE IF(rank.EQ.5)THEN + f_ptr = C_LOC(rbufr_5(1,1,1,1,1)) + CALL h5ltread_dataset_f(file_id, dsetname3, H5T_NATIVE_REAL, f_ptr, errcode) + ELSE IF(rank.EQ.6)THEN + f_ptr = C_LOC(rbufr_6(1,1,1,1,1,1)) + CALL h5ltread_dataset_f(file_id, dsetname3, H5T_NATIVE_REAL, f_ptr, errcode) + ELSE IF(rank.EQ.7)THEN + f_ptr = C_LOC(rbufr_7(1,1,1,1,1,1,1)) + CALL h5ltread_dataset_f(file_id, dsetname3, H5T_NATIVE_REAL, f_ptr, errcode) + ENDIF + + ! + ! compare read and write buffers. + ! + DO i = 1, dims(1) + DO j = 1, dims(2) + DO k = 1, dims(3) + DO l = 1, dims(4) + IF(rank.EQ.4)THEN + IF ( rbuf_4(i,j,k,l) .NE. rbufr_4(i,j,k,l) ) THEN + PRINT *, 'read buffer differs from write buffer' + PRINT *, rbuf_4(i,j,k,l), ' and ', rbufr_4(i,j,k,l) + STOP + ENDIF + ENDIF + DO m = 1, dims(5) + IF(rank.EQ.5)THEN + IF ( rbuf_5(i,j,k,l,m) .NE. rbufr_5(i,j,k,l,m) ) THEN + PRINT *, 'read buffer differs from write buffer' + PRINT *, rbuf_5(i,j,k,l,m), ' and ', rbufr_5(i,j,k,l,m) + STOP + ENDIF + ENDIF + DO n = 1, dims(6) + IF(rank.EQ.6)THEN + IF ( rbuf_6(i,j,k,l,m,n) .NE. rbufr_6(i,j,k,l,m,n) ) THEN + PRINT *, 'read buffer differs from write buffer' + PRINT *, rbuf_6(i,j,k,l,m,n), ' and ', rbufr_6(i,j,k,l,m,n) + STOP + ENDIF + ENDIF + DO o = 1, dims(7) + IF(rank.EQ.7)THEN + IF ( rbuf_7(i,j,k,l,m,n,o) .NE. rbufr_7(i,j,k,l,m,n,o) ) THEN + PRINT *, 'read buffer differs from write buffer' + PRINT *, rbuf_7(i,j,k,l,m,n,o), ' and ', rbufr_7(i,j,k,l,m,n,o) + STOP + ENDIF + ENDIF + ENDDO + ENDDO + ENDDO + ENDDO + ENDDO + ENDDO + ENDDO + + !------------------------------------------------------------------------- + ! H5T_NATIVE_DOUBLE + !------------------------------------------------------------------------- + + ! + ! write dataset. + ! + IF(rank.EQ.4)THEN + f_ptr = C_LOC(dbuf_4(1,1,1,1)) + CALL h5ltmake_dataset_f(file_id, dsetname4, rank, dims(1:rank), H5T_NATIVE_DOUBLE, f_ptr, errcode) + ELSE IF(rank.EQ.5)THEN + f_ptr = C_LOC(dbuf_5(1,1,1,1,1)) + CALL h5ltmake_dataset_f(file_id, dsetname4, rank, dims(1:rank), H5T_NATIVE_DOUBLE, f_ptr, errcode) + ELSE IF(rank.EQ.6)THEN + f_ptr = C_LOC(dbuf_6(1,1,1,1,1,1)) + CALL h5ltmake_dataset_f(file_id, dsetname4, rank, dims(1:rank), H5T_NATIVE_DOUBLE, f_ptr, errcode) + ELSE IF(rank.EQ.7)THEN + f_ptr = C_LOC(dbuf_7(1,1,1,1,1,1,1)) + CALL h5ltmake_dataset_f(file_id, dsetname4, rank, dims(1:rank), H5T_NATIVE_DOUBLE, f_ptr, errcode) + ENDIF + + + ! + ! read dataset. + ! + IF(rank.EQ.4)THEN + f_ptr = C_LOC(dbufr_4(1,1,1,1)) + CALL h5ltread_dataset_f(file_id, dsetname4, H5T_NATIVE_DOUBLE, f_ptr, errcode) + ELSE IF(rank.EQ.5)THEN + f_ptr = C_LOC(dbufr_5(1,1,1,1,1)) + CALL h5ltread_dataset_f(file_id, dsetname4, H5T_NATIVE_DOUBLE, f_ptr, errcode) + ELSE IF(rank.EQ.6)THEN + f_ptr = C_LOC(dbufr_6(1,1,1,1,1,1)) + CALL h5ltread_dataset_f(file_id, dsetname4, H5T_NATIVE_DOUBLE, f_ptr, errcode) + ELSE IF(rank.EQ.7)THEN + f_ptr = C_LOC(dbufr_7(1,1,1,1,1,1,1)) + CALL h5ltread_dataset_f(file_id, dsetname4, H5T_NATIVE_DOUBLE, f_ptr, errcode) + ENDIF + + ! + ! compare read and write buffers. + ! + DO i = 1, dims(1) + DO j = 1, dims(2) + DO k = 1, dims(3) + DO l = 1, dims(4) + IF(rank.EQ.4)THEN + IF ( dbuf_4(i,j,k,l) .NE. dbufr_4(i,j,k,l) ) THEN + PRINT *, 'read buffer differs from write buffer' + PRINT *, dbuf_4(i,j,k,l), ' and ', dbufr_4(i,j,k,l) + STOP + ENDIF + ENDIF + DO m = 1, dims(5) + IF(rank.EQ.5)THEN + IF ( dbuf_5(i,j,k,l,m) .NE. dbufr_5(i,j,k,l,m) ) THEN + PRINT *, 'read buffer differs from write buffer' + PRINT *, dbuf_5(i,j,k,l,m), ' and ', dbufr_5(i,j,k,l,m) + STOP + ENDIF + ENDIF + DO n = 1, dims(6) + IF(rank.EQ.6)THEN + IF ( dbuf_6(i,j,k,l,m,n) .NE. dbufr_6(i,j,k,l,m,n) ) THEN + PRINT *, 'read buffer differs from write buffer' + PRINT *, dbuf_6(i,j,k,l,m,n), ' and ', dbufr_6(i,j,k,l,m,n) + STOP + ENDIF + ENDIF + DO o = 1, dims(7) + IF(rank.EQ.7)THEN + IF ( dbuf_7(i,j,k,l,m,n,o) .NE. dbufr_7(i,j,k,l,m,n,o) ) THEN + PRINT *, 'read buffer differs from write buffer' + PRINT *, dbuf_7(i,j,k,l,m,n,o), ' and ', dbufr_7(i,j,k,l,m,n,o) + STOP + ENDIF + ENDIF + ENDDO + ENDDO + ENDDO + ENDDO + ENDDO + ENDDO + ENDDO + + CALL h5ltget_dataset_info_f(file_id,dsetname4,dimsr,type_class,type_size,errcode ) + + ! + ! compare dimensions + ! + DO i = 1, rank + IF ( dimsr(i) .NE. dims(i) ) THEN + PRINT *, 'dimensions differ ' + STOP + ENDIF + END DO + + ! + ! Close the file. + ! + CALL h5fclose_f(file_id, errcode) + + ! + ! Close FORTRAN predefined datatypes. + ! + CALL h5close_f(errcode) + + ! DEALLOCATE RESOURCES + + IF(rank.EQ.4)THEN + DEALLOCATE(ibuf_4, ibufr_4, rbuf_4, rbufr_4, dbuf_4, dbufr_4) + ELSE IF(rank.EQ.5)THEN + DEALLOCATE(ibuf_5, ibufr_5, rbuf_5, rbufr_5, dbuf_5, dbufr_5) + ELSE IF(rank.EQ.6)THEN + DEALLOCATE(ibuf_6, ibufr_6, rbuf_6, rbufr_6, dbuf_6, dbufr_6) + ELSE IF(rank.EQ.7)THEN + DEALLOCATE(ibuf_7, ibufr_7, rbuf_7, rbufr_7, dbuf_7, dbufr_7) + ENDIF + + CALL passed() + ! + ! end function. + ! +END SUBROUTINE test_datasetND + + + +!------------------------------------------------------------------------- +! test_datasets +!------------------------------------------------------------------------- + +SUBROUTINE test_datasets() + + USE, INTRINSIC :: ISO_C_BINDING + USE H5LT ! module of H5LT + USE HDF5 ! module of HDF5 library + + IMPLICIT NONE + + CHARACTER(len=9), PARAMETER :: filename = "dsetf4.h5"! File name + INTEGER(HID_T) :: file_id ! File identifier + INTEGER :: errcode ! Error flag + INTEGER, PARAMETER :: DIM1 = 10 ! Dimension of array + CHARACTER(LEN=5), PARAMETER :: dsetname1 = "dset1" ! Dataset name + CHARACTER(LEN=5), PARAMETER :: dsetname2 = "dset2" ! Dataset name + CHARACTER(LEN=5), PARAMETER :: dsetname3 = "dset3" ! Dataset name + CHARACTER(LEN=5), PARAMETER :: dsetname4 = "dset4" ! Dataset name + CHARACTER(LEN=5), PARAMETER :: dsetname5 = "dset5" ! Dataset name + INTEGER(HSIZE_T), DIMENSION(1) :: dims = (/DIM1/) ! Dataset dimensions + INTEGER(HSIZE_T), DIMENSION(1) :: dimsr ! Dataset dimensions + INTEGER :: rank = 1 ! Dataset rank + INTEGER :: rankr ! Dataset rank + CHARACTER(LEN=8), PARAMETER :: buf1 = "mystring" ! Data buffer + CHARACTER(LEN=8) :: buf1r ! Data buffer + INTEGER, DIMENSION(DIM1) :: buf2 ! Data buffer + INTEGER, DIMENSION(DIM1) :: bufr2 ! Data buffer + REAL, DIMENSION(DIM1), TARGET :: buf3 ! Data buffer + REAL, DIMENSION(DIM1) , TARGET :: bufr3 ! Data buffer + DOUBLE PRECISION, DIMENSION(DIM1), TARGET :: buf4 ! Data buffer + DOUBLE PRECISION, DIMENSION(DIM1), TARGET :: bufr4 ! Data buffer + INTEGER :: i, n ! general purpose integer + INTEGER :: has ! general purpose integer + INTEGER :: type_class + INTEGER(SIZE_T) :: type_size + LOGICAL :: path_valid ! status of the path + CHARACTER(LEN=6) :: chr_exact + CHARACTER(LEN=8) :: chr_lg + TYPE(C_PTR) :: f_ptr + + ! + ! Initialize FORTRAN predefined datatypes. + ! + CALL h5open_f(errcode) + + ! + ! Create a new file using default properties. + ! + CALL h5fcreate_f(filename, H5F_ACC_TRUNC_F, file_id, errcode) + + ! + ! Initialize the data array. + ! + n = 1 + DO i = 1, DIM1 + buf2(i) = n + buf3(i) = n + buf4(i) = n + n = n + 1 + END DO + + !------------------------------------------------------------------------- + ! int + !------------------------------------------------------------------------- + + CALL test_begin(' Make/Read datasets (integer) ') + + ! + ! write dataset. + ! + CALL h5ltmake_dataset_int_f(file_id, dsetname2, rank, dims, buf2, errcode) + + ! + ! read dataset. + ! + CALL h5ltread_dataset_int_f(file_id, dsetname2, bufr2, dims, errcode) + + ! + ! compare read and write buffers. + ! + DO i = 1, DIM1 + IF ( buf2(i) .NE. bufr2(i) ) THEN + PRINT *, 'read buffer differs from write buffer' + PRINT *, bufr2(i), ' and ', buf2(i) + STOP + ENDIF + END DO + + CALL passed() + + + !------------------------------------------------------------------------- + ! real + !------------------------------------------------------------------------- + + CALL test_begin(' Make/Read datasets (float) ') + + + ! + ! write dataset. + ! + f_ptr = C_LOC(buf3(1)) + CALL h5ltmake_dataset_f(file_id, dsetname3, rank, dims, H5T_NATIVE_REAL, f_ptr, errcode) + + ! + ! read dataset. + ! + f_ptr = C_LOC(bufr3(1)) + CALL h5ltread_dataset_f(file_id, dsetname3, H5T_NATIVE_REAL, f_ptr, errcode) + + ! + ! compare read and write buffers. + ! + DO i = 1, DIM1 + IF ( buf3(i) .NE. bufr3(i) ) THEN + PRINT *, 'read buffer differs from write buffer' + PRINT *, bufr3(i), ' and ', buf3(i) + STOP + ENDIF + END DO + + CALL passed() + + !------------------------------------------------------------------------- + ! double + !------------------------------------------------------------------------- + + CALL test_begin(' Make/Read datasets (double) ') + + + ! + ! write dataset. + ! + !f_ptr = C_LOC(buf4(1)) + !CALL h5ltmake_dataset_f(file_id, dsetname4, rank, dims, H5T_NATIVE_DOUBLE, f_ptr, errcode) + CALL h5ltmake_dataset_double_f(file_id, dsetname4, rank, dims, buf4, errcode) + + ! + ! read dataset. + ! + !f_ptr = C_LOC(buf4(1)) + !CALL h5ltread_dataset_f(file_id, dsetname4, H5T_NATIVE_DOUBLE, f_ptr, errcode) + CALL h5ltread_dataset_double_f(file_id, dsetname4, bufr4, dims, errcode) + + + ! + ! compare read and write buffers. + ! + DO i = 1, DIM1 + IF ( buf4(i) .NE. bufr4(i) ) THEN + PRINT *, 'read buffer differs from write buffer' + PRINT *, bufr4(i), ' and ', buf4(i) + STOP + ENDIF + END DO + + CALL passed() + + + !------------------------------------------------------------------------- + ! string + !------------------------------------------------------------------------- + + CALL test_begin(' Make/Read datasets (string) ') + + + ! + ! write dataset. + ! + CALL h5ltmake_dataset_string_f(file_id, dsetname5, buf1, errcode) + + ! + ! read dataset. + ! + CALL h5ltread_dataset_string_f(file_id, dsetname5, buf1r, errcode) + + ! + ! compare read and write buffers. + ! + IF ( buf1 .NE. buf1r ) THEN + PRINT *, 'read buffer differs from write buffer' + PRINT *, buf1, ' and ', buf1r + STOP + ENDIF + + CALL passed() + + CALL test_begin(' Test h5ltpath_valid_f ') + ! + ! test function h5ltpath_valid_f + ! + chr_exact = "/"//dsetname2 ! test character buffer the exact size needed + CALL h5ltpath_valid_f(file_id, chr_exact, .TRUE., path_valid, errcode) + IF(errcode.LT.0.OR..NOT.path_valid)THEN + PRINT *, 'error in h5ltpath_valid_f' + STOP + ENDIF + chr_lg = "/"//dsetname2 ! test character buffer larger then needed + CALL h5ltpath_valid_f(file_id, chr_lg, .TRUE., path_valid, errcode) + IF(errcode.LT.0.OR..NOT.path_valid)THEN + PRINT *, 'error in h5ltpath_valid_f' + STOP + ENDIF + + CALL h5ltpath_valid_f(file_id, chr_lg, .FALSE., path_valid, errcode) + IF(errcode.LT.0.OR..NOT.path_valid)THEN + PRINT *, 'error in h5ltpath_valid_f' + STOP + ENDIF + + ! Should fail, dataset does not exist + CALL h5ltpath_valid_f(file_id, "/"//dsetname2//"junk", .TRUE., path_valid, errcode) + IF(errcode.LT.0.OR.path_valid)THEN + PRINT *, 'error in h5ltpath_valid_f' + STOP + ENDIF + + CALL h5ltpath_valid_f(file_id, "/"//dsetname2//"junk", .FALSE., path_valid, errcode) + IF(errcode.LT.0.OR.path_valid)THEN + PRINT *, 'error in h5ltpath_valid_f' + STOP + ENDIF + + ! Create a dangling soft link + CALL h5lcreate_soft_f("/G2", file_id, "/G3", errcode) + + ! Should pass, does not check for dangled link + CALL h5ltpath_valid_f(file_id, "/G3", .FALSE., path_valid, errcode) + IF(.NOT.path_valid)THEN + PRINT *, 'error in h5ltpath_valid_f' + STOP + ENDIF + + ! Should fail, dangled link + CALL h5ltpath_valid_f(file_id, "/G2", .TRUE., path_valid, errcode) + IF(path_valid)THEN + PRINT *, 'error in h5ltpath_valid_f' + STOP + ENDIF + + CALL passed() + + + CALL test_begin(' Get dataset dimensions/info ') + + !------------------------------------------------------------------------- + ! h5ltget_dataset_ndims_f + !------------------------------------------------------------------------- + + CALL h5ltget_dataset_ndims_f(file_id, dsetname4, rankr, errcode) + IF ( rankr .NE. rank ) THEN + PRINT *, 'h5ltget_dataset_ndims_f return error' + STOP + ENDIF + + + !------------------------------------------------------------------------- + ! test h5ltfind_dataset_f function + !------------------------------------------------------------------------- + + + has = h5ltfind_dataset_f(file_id,dsetname4) + IF ( has .NE. 1 ) THEN + PRINT *, 'h5ltfind_dataset_f return error' + STOP + ENDIF + + !------------------------------------------------------------------------- + ! test h5ltget_dataset_info_f function + !------------------------------------------------------------------------- + + + CALL h5ltget_dataset_info_f(file_id,dsetname4,dimsr,type_class,type_size,errcode ) + + ! + ! compare dimensions + ! + DO i = 1, rank + IF ( dimsr(i) .NE. dims(i) ) THEN + PRINT *, 'dimensions differ ' + STOP + ENDIF + END DO + + IF ( type_class .NE. 1 ) THEN ! H5T_FLOAT + PRINT *, 'wrong type class ' + STOP + ENDIF + + ! + ! Close the file. + ! + CALL h5fclose_f(file_id, errcode) + ! + ! Close FORTRAN predefined datatypes. + ! + CALL h5close_f(errcode) + + CALL passed() + ! + ! end function. + ! +END SUBROUTINE test_datasets + + + +!------------------------------------------------------------------------- +! test_attributes +!------------------------------------------------------------------------- + +SUBROUTINE test_attributes() + + USE, INTRINSIC :: ISO_C_BINDING + USE H5LT ! module of H5LT + USE HDF5 ! module of HDF5 library + + IMPLICIT NONE + + CHARACTER(len=9), PARAMETER :: filename = "dsetf5.h5"! File name + CHARACTER(len=9), PARAMETER :: filename1 ="tattr.h5" ! C written attribute file + INTEGER(HID_T) :: file_id ! File identifier +! INTEGER(HID_T) :: file_id1 + INTEGER, PARAMETER :: DIM1 = 10 ! Dimension of array + CHARACTER(LEN=5), PARAMETER :: attrname1 = "attr1" ! Attribute name + CHARACTER(LEN=5), PARAMETER :: attrname2 = "attr2" ! Attribute name + CHARACTER(LEN=5), PARAMETER :: attrname3 = "attr3" ! Attribute name + CHARACTER(LEN=5), PARAMETER :: attrname4 = "attr4" ! Attribute name + CHARACTER(LEN=5), PARAMETER :: attrname5 = "attr5" ! Attribute name + CHARACTER(LEN=8), PARAMETER :: buf1 = "mystring" ! Data buffer + CHARACTER(LEN=16), PARAMETER :: buf_c = "string attribute" + CHARACTER(LEN=8) :: bufr1 ! Data buffer + CHARACTER(LEN=10) :: bufr1_lg ! Data buffer +! CHARACTER(LEN=16) :: bufr_c ! Data buffer +! CHARACTER(LEN=18) :: bufr_c_lg ! Data buffer + INTEGER, DIMENSION(DIM1) :: buf2 ! Data buffer + INTEGER, DIMENSION(DIM1) :: bufr2 ! Data buffer + REAL, DIMENSION(DIM1), target :: buf3 ! Data buffer + REAL, DIMENSION(DIM1), target :: bufr3 ! Data buffer + DOUBLE PRECISION, DIMENSION(DIM1), TARGET :: buf4 ! Data buffer + DOUBLE PRECISION, DIMENSION(DIM1), TARGET :: bufr4 ! Data buffer + INTEGER :: errcode ! Error flag + INTEGER :: i, n ! general purpose integer + INTEGER(SIZE_T) size ! size of attribute array + INTEGER :: rankr ! rank + INTEGER(HSIZE_T), DIMENSION(1) :: dimsr ! attribute dimensions + INTEGER :: type_class + INTEGER(SIZE_T) :: type_size + INTEGER(HSIZE_T), DIMENSION(1) :: dims = (/DIM1/) ! Dataset dimensions + INTEGER :: rank = 1 ! Dataset rank + CHARACTER(LEN=5), PARAMETER :: dsetname1 = "dset1" ! Dataset name + INTEGER, DIMENSION(DIM1) :: buf ! Data buffer + INTEGER(SIZE_T) :: SizeOf_buf_type + TYPE(C_PTR) :: f_ptr + + ! + ! Initialize FORTRAN predefined datatypes. + ! + CALL h5open_f(errcode) + ! + ! Create a new file using default properties. + ! + CALL h5fcreate_f(filename, H5F_ACC_TRUNC_F, file_id, errcode) + ! + ! make a dataset. + ! + CALL h5ltmake_dataset_int_f(file_id, dsetname1, rank, dims, buf, errcode) + + ! + ! Initialize the data array. + ! + size = DIM1 + n = 1 + DO i = 1, DIM1 + buf2(i) = n + buf3(i) = n + buf4(i) = n + n = n + 1 + END DO + + + !------------------------------------------------------------------------- + ! int + !------------------------------------------------------------------------- + + CALL test_begin(' Set/Get attributes int ') + + + ! + ! write attribute. + ! + CALL h5ltset_attribute_int_f(file_id,dsetname1,attrname2,buf2,size,errcode) + + ! + ! read attribute. + ! + CALL h5ltget_attribute_int_f(file_id,dsetname1,attrname2,bufr2,errcode) + + ! + ! compare read and write buffers. + ! + DO i = 1, DIM1 + IF ( buf2(i) .NE. bufr2(i) ) THEN + PRINT *, 'read buffer differs from write buffer' + PRINT *, bufr2(i), ' and ', buf2(i) + STOP + ENDIF + END DO + + CALL passed() + + !------------------------------------------------------------------------- + ! float + !------------------------------------------------------------------------- + + CALL test_begin(' Set/Get attributes float ') + + + ! + ! write attribute. + ! +#ifdef H5_FORTRAN_HAVE_STORAGE_SIZE + SizeOf_buf_type = STORAGE_SIZE(buf3(1), c_size_t)/STORAGE_SIZE(c_char_'a',c_size_t) +#else + SizeOf_buf_type = SIZEOF(buf3(1)) +#endif + f_ptr = C_LOC(buf3(1)) + CALL h5ltset_attribute_f(file_id,dsetname1,attrname3,f_ptr,"REAL", SizeOf_buf_type, size,errcode) + !CALL h5ltset_attribute_float_f(file_id,dsetname1,attrname3,buf3,size,errcode) + ! + ! read attribute. + ! +#ifdef H5_FORTRAN_HAVE_STORAGE_SIZE + SizeOf_buf_type = STORAGE_SIZE(bufr3(1), c_size_t)/STORAGE_SIZE(c_char_'a',c_size_t) +#else + SizeOf_buf_type = SIZEOF(bufr3(1)) +#endif + + f_ptr = C_LOC(bufr3(1)) + CALL h5ltget_attribute_f(file_id,dsetname1,attrname3,f_ptr,"REAL",SizeOf_buf_type,errcode) + !CALL h5ltget_attribute_float_f(file_id,dsetname1,attrname3,bufr3,errcode) + + ! + ! compare read and write buffers. + ! + DO i = 1, DIM1 + IF ( buf3(i) .NE. bufr3(i) ) THEN + PRINT *, 'read buffer differs from write buffer' + PRINT *, bufr3(i), ' and ', buf3(i) + STOP + ENDIF + END DO + + CALL passed() + + !------------------------------------------------------------------------- + ! double + !------------------------------------------------------------------------- + +#ifdef H5_FORTRAN_HAVE_STORAGE_SIZE + SizeOf_buf_type = STORAGE_SIZE(buf4(1), c_size_t)/STORAGE_SIZE(c_char_'a',c_size_t) +#else + SizeOf_buf_type = SIZEOF(buf4(1)) +#endif + + IF(SizeOf_buf_type.LT.16)THEN ! MSB can't handle 16 byte reals + + CALL test_begin(' Set/Get attributes double ') + + ! + ! write attribute. + ! + f_ptr = C_LOC(buf4(1)) + CALL h5ltset_attribute_f(file_id,dsetname1,attrname4,f_ptr,"real", SizeOf_buf_type, size, errcode) + +! CALL h5ltset_attribute_double_f(file_id,dsetname1,attrname4,buf4, size, errcode) + + ! + ! read attribute. + ! + +#ifdef H5_FORTRAN_HAVE_STORAGE_SIZE + SizeOf_buf_type = STORAGE_SIZE(bufr4(1), c_size_t)/STORAGE_SIZE(c_char_'a',c_size_t) +#else + SizeOf_buf_type = SIZEOF(bufr4(1)) +#endif + + f_ptr = C_LOC(bufr4(1)) + CALL h5ltget_attribute_f(file_id,dsetname1,attrname4,f_ptr,"REAL",SizeOf_buf_type,errcode) + + ! + ! compare read and write buffers. + ! + DO i = 1, DIM1 + IF ( buf4(i) .NE. bufr4(i) ) THEN + PRINT *, 'read buffer differs from write buffer' + PRINT *, bufr4(i), ' and ', buf4(i) + STOP + ENDIF + END DO + + CALL passed() + + ENDIF + + !------------------------------------------------------------------------- + ! string + !------------------------------------------------------------------------- + + CALL test_begin(' Set/Get attributes string ') + + ! + ! write attribute. + ! + CALL h5ltset_attribute_string_f(file_id,dsetname1,attrname5,buf1,errcode) + + ! + ! read attribute into a fortran character buf that is the same size as buf1. + ! + CALL h5ltget_attribute_string_f(file_id,dsetname1,attrname5,bufr1,errcode) + + ! + ! compare read and write buffers. + ! + IF ( buf1 .NE. bufr1 ) THEN + PRINT *, 'read buffer differs from write buffer' + PRINT *, buf1, ' and ', bufr1 + STOP + ENDIF + + ! + ! read attribute into a fortran character buf that is larger then buf1. + ! + CALL h5ltget_attribute_string_f(file_id,dsetname1,attrname5,bufr1_lg,errcode) + + ! + ! compare read and write buffers, make sure C NULL character was removed. + ! + IF ( buf1(1:8) .NE. bufr1_lg(1:8) .AND. bufr1_lg(9:10) .NE. ' ' ) THEN + PRINT *, 'larger read buffer differs from write buffer' + PRINT *, buf1, ' and ', bufr1_lg + STOP + ENDIF + + ! + ! ** Test reading a string that was created with a C program ** + ! + +!!$ CALL h5fopen_f(filename1, H5F_ACC_RDONLY_F, file_id1, errcode) +!!$ +!!$ CALL h5ltget_attribute_string_f(file_id1, "/", "attr5", bufr_c, errcode) +!!$ ! +!!$ ! compare read and write buffers. +!!$ ! +!!$ IF ( bufr_c .NE. buf_c ) THEN +!!$ PRINT *, 'read buffer differs from write buffer' +!!$ PRINT *, bufr1, ' and ', buf_c +!!$ STOP +!!$ ENDIF +!!$ ! +!!$ ! read attribute into a fortran character buf that is larger then buf_c. +!!$ ! +!!$ CALL h5ltget_attribute_string_f(file_id1, "/", "attr5", bufr_c_lg, errcode) +!!$ +!!$ ! +!!$ ! compare read and write buffers, make sure C NULL character was removed. +!!$ ! +!!$ IF ( buf_c(1:16) .NE. bufr_c_lg(1:16) .AND. bufr_c_lg(17:18) .NE. ' ' ) THEN +!!$ PRINT *, 'larger read buffer differs from write buffer' +!!$ PRINT *, buf_c, ' and ', bufr_c_lg +!!$ STOP +!!$ ENDIF + +!!$ CALL h5fclose_f(file_id1, errcode) + + CALL passed() + + !------------------------------------------------------------------------- + ! get attribute rank + !------------------------------------------------------------------------- + + CALL test_begin(' Get attribute rank/info ') + + + CALL h5ltget_attribute_ndims_f(file_id,dsetname1,attrname2,rankr,errcode) + + IF ( rankr .NE. 1 ) THEN + PRINT *, 'h5ltget_attribute_ndims_f return error' + STOP + ENDIF + + + CALL h5ltget_attribute_info_f(file_id,dsetname1,attrname2,dimsr,type_class,type_size,errcode) + + ! + ! compare dimensions + ! + DO i = 1, rank + IF ( dimsr(i) .NE. dims(i) ) THEN + PRINT *, 'dimensions differ ' + STOP + ENDIF + END DO + + + ! + ! Close the file. + ! + CALL h5fclose_f(file_id, errcode) + ! + ! Close FORTRAN predefined datatypes. + ! + CALL h5close_f(errcode) + + CALL passed() + ! + ! end function. + ! +END SUBROUTINE test_attributes + +!------------------------------------------------------------------------- +! test_begin +!------------------------------------------------------------------------- + +SUBROUTINE test_begin(string) + CHARACTER(LEN=*), INTENT(IN) :: string + WRITE(*, fmt = '(14a)', advance = 'no') string + WRITE(*, fmt = '(40x,a)', advance = 'no') ' ' +END SUBROUTINE test_begin + +!------------------------------------------------------------------------- +! passed +!------------------------------------------------------------------------- + +SUBROUTINE passed() + WRITE(*, fmt = '(6a)') 'PASSED' +END SUBROUTINE passed diff --git a/hl/fortran/test/tstlite.f90 b/hl/fortran/test/tstlite.f90 deleted file mode 100644 index d035b89..0000000 --- a/hl/fortran/test/tstlite.f90 +++ /dev/null @@ -1,1628 +0,0 @@ -! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -! 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. * -! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -! -! -! This file contains the FORTRAN90 tests for H5LT -! - -PROGRAM lite_test - - CALL test_dataset1D() - CALL test_dataset2D() - CALL test_dataset3D() - CALL test_datasetND(4) - CALL test_datasetND(5) - CALL test_datasetND(6) - CALL test_datasetND(7) - CALL test_datasets() - CALL test_attributes() - -END PROGRAM lite_test - - -!------------------------------------------------------------------------- -! test_dataset1D -!------------------------------------------------------------------------- - -SUBROUTINE test_dataset1D() - -USE H5LT ! module of H5LT -USE HDF5 ! module of HDF5 library - -IMPLICIT NONE - -INTEGER, PARAMETER :: DIM1 = 4; ! Dimension of array -CHARACTER(len=9), PARAMETER :: filename = "dsetf1.h5"! File name -CHARACTER(LEN=5), PARAMETER :: dsetname1 = "dset1" ! Dataset name -CHARACTER(LEN=5), PARAMETER :: dsetname2 = "dset2" ! Dataset name -CHARACTER(LEN=5), PARAMETER :: dsetname3 = "dset3" ! Dataset name -INTEGER(HID_T) :: file_id ! File identifier -INTEGER(HSIZE_T), DIMENSION(1) :: dims = (/DIM1/) ! Dataset dimensions -INTEGER :: rank = 1 ! Dataset rank -INTEGER, DIMENSION(DIM1) :: buf1 ! Data buffer -INTEGER, DIMENSION(DIM1) :: bufr1 ! Data buffer -REAL, DIMENSION(DIM1) :: buf2 ! Data buffer -REAL, DIMENSION(DIM1) :: bufr2 ! Data buffer -DOUBLE PRECISION, DIMENSION(DIM1) :: buf3 ! Data buffer -DOUBLE PRECISION, DIMENSION(DIM1) :: bufr3 ! Data buffer -INTEGER :: errcode ! Error flag -INTEGER :: i ! general purpose integer - - -CALL test_begin(' Make/Read datasets (1D) ') - -! -! Initialize the data array. -! -DO i = 1, DIM1 - buf1(i) = i; - buf2(i) = i; - buf3(i) = i; -END DO - -! -! Initialize FORTRAN predefined datatypes. -! -CALL h5open_f(errcode) - -! -! Create a new file using default properties. -! -CALL h5fcreate_f(filename, H5F_ACC_TRUNC_F, file_id, errcode) - -!------------------------------------------------------------------------- -! H5T_NATIVE_INTEGER -!------------------------------------------------------------------------- - -! -! write dataset. -! -CALL h5ltmake_dataset_f(file_id, dsetname1, rank, dims, H5T_NATIVE_INTEGER, buf1, errcode) - -! -! read dataset. -! -CALL h5ltread_dataset_f(file_id, dsetname1, H5T_NATIVE_INTEGER, bufr1, dims, errcode) - -! -! compare read and write buffers. -! -DO i = 1, DIM1 - IF ( buf1(i) .NE. bufr1(i) ) THEN - PRINT *, 'read buffer differs from write buffer' - PRINT *, bufr1(i), ' and ', buf1(i) - STOP - ENDIF -END DO - -!------------------------------------------------------------------------- -! H5T_NATIVE_REAL -!------------------------------------------------------------------------- - -! -! write dataset. -! -CALL h5ltmake_dataset_f(file_id, dsetname2, rank, dims, H5T_NATIVE_REAL, buf2, errcode) - -! -! read dataset. -! -CALL h5ltread_dataset_f(file_id, dsetname2, H5T_NATIVE_REAL, bufr2, dims, errcode) - -! -! compare read and write buffers. -! -DO i = 1, DIM1 - IF ( buf2(i) .NE. bufr2(i) ) THEN - PRINT *, 'read buffer differs from write buffer' - PRINT *, bufr2(i), ' and ', buf2(i) - STOP - ENDIF -END DO - -!------------------------------------------------------------------------- -! H5T_NATIVE_DOUBLE -!------------------------------------------------------------------------- - -! -! write dataset. -! -CALL h5ltmake_dataset_f(file_id, dsetname3, rank, dims, H5T_NATIVE_DOUBLE, buf3, errcode) - -! -! read dataset. -! -CALL h5ltread_dataset_f(file_id, dsetname3, H5T_NATIVE_DOUBLE, bufr3, dims, errcode) - -! -! compare read and write buffers. -! -DO i = 1, DIM1 - IF ( buf3(i) .NE. bufr3(i) ) THEN - PRINT *, 'read buffer differs from write buffer' - PRINT *, bufr3(i), ' and ', buf3(i) - STOP - ENDIF -END DO - -! -! Close the file. -! -CALL h5fclose_f(file_id, errcode) - -! -! Close FORTRAN predefined datatypes. -! -CALL h5close_f(errcode) - -CALL passed() -! -! end function. -! -END SUBROUTINE test_dataset1D - -!------------------------------------------------------------------------- -! test_dataset2D -!------------------------------------------------------------------------- - -SUBROUTINE test_dataset2D() - -USE H5LT ! module of H5LT -USE HDF5 ! module of HDF5 library - -IMPLICIT NONE - - -INTEGER(HSIZE_T), PARAMETER :: DIM1 = 4; ! columns -INTEGER(HSIZE_T), PARAMETER :: DIM2 = 6; ! rows -CHARACTER(len=9), PARAMETER :: filename = "dsetf2.h5"! File name -CHARACTER(LEN=5), PARAMETER :: dsetname1 = "dset1" ! Dataset name -CHARACTER(LEN=5), PARAMETER :: dsetname2 = "dset2" ! Dataset name -CHARACTER(LEN=5), PARAMETER :: dsetname3 = "dset3" ! Dataset name -CHARACTER(LEN=5), PARAMETER :: dsetname4 = "dset4" ! Dataset name -INTEGER(HID_T) :: file_id ! File identifier -INTEGER(HSIZE_T), DIMENSION(2) :: dims = (/4,6/) ! Dataset dimensions -INTEGER :: rank = 2 ! Dataset rank -INTEGER, DIMENSION(DIM1*DIM2) :: buf ! Data buffer -INTEGER, DIMENSION(DIM1*DIM2) :: bufr ! Data buffer -INTEGER, DIMENSION(DIM1,DIM2) :: buf2 ! Data buffer -INTEGER, DIMENSION(DIM1,DIM2) :: buf2r ! Data buffer -REAL, DIMENSION(DIM1,DIM2) :: buf3 ! Data buffer -REAL, DIMENSION(DIM1,DIM2) :: buf3r ! Data buffer -DOUBLE PRECISION, DIMENSION(DIM1,DIM2) :: buf4 ! Data buffer -DOUBLE PRECISION, DIMENSION(DIM1,DIM2) :: buf4r ! Data buffer -INTEGER :: errcode ! Error flag -INTEGER(HSIZE_T) :: i, j, n ! general purpose integers - -CALL test_begin(' Make/Read datasets (2D) ') - - -! -! Initialize the data arrays. -! -n=1 -DO i = 1, DIM1*DIM2 - buf(i) = INT(n) - n = n + 1 -END DO - -DO i = 1, dims(1) - DO j = 1, dims(2) - buf2(i,j) = INT((i-1)*dims(2) + j) - buf3(i,j) = INT((i-1)*dims(2) + j) - buf4(i,j) = INT((i-1)*dims(2) + j) - END DO -END DO - - -! -! Initialize FORTRAN predefined datatypes. -! -CALL h5open_f(errcode) - -! -! Create a new file using default properties. -! -CALL h5fcreate_f(filename, H5F_ACC_TRUNC_F, file_id, errcode) - -!------------------------------------------------------------------------- -! H5T_NATIVE_INT 1D buffer -!------------------------------------------------------------------------- - -! -! write dataset. -! -CALL h5ltmake_dataset_f(file_id, dsetname1, rank, dims, H5T_NATIVE_INTEGER, buf, errcode) - -! -! read dataset. -! -CALL h5ltread_dataset_f(file_id, dsetname1, H5T_NATIVE_INTEGER, bufr, dims, errcode) - -! -! compare read and write buffers. -! -DO i = 1, DIM1*DIM2 - IF ( buf(i) .NE. bufr(i) ) THEN - PRINT *, 'read buffer differs from write buffer' - PRINT *, bufr(i), ' and ', buf(i) - STOP - ENDIF -END DO - -!------------------------------------------------------------------------- -! H5T_NATIVE_INT 2D buffer -!------------------------------------------------------------------------- - -! -! write dataset. -! -CALL h5ltmake_dataset_f(file_id, dsetname2, rank, dims, H5T_NATIVE_INTEGER, buf2, errcode) - -! -! read dataset. -! -CALL h5ltread_dataset_f(file_id, dsetname2, H5T_NATIVE_INTEGER, buf2r, dims, errcode) - -! -! compare read and write buffers. -! -DO i = 1, dims(1) - DO j = 1, dims(2) - IF ( buf2(i,j) .NE. buf2r(i,j) ) THEN - PRINT *, 'read buffer differs from write buffer' - PRINT *, buf2r(i,j), ' and ', buf2(i,j) - STOP - ENDIF - END DO -END DO - -!------------------------------------------------------------------------- -! H5T_NATIVE_REAL -!------------------------------------------------------------------------- - -! -! write dataset. -! -CALL h5ltmake_dataset_f(file_id, dsetname3, rank, dims, H5T_NATIVE_REAL, buf3, errcode) - -! -! read dataset. -! -CALL h5ltread_dataset_f(file_id, dsetname3, H5T_NATIVE_REAL, buf3r, dims, errcode) - -! -! compare read and write buffers. -! -DO i = 1, dims(1) - DO j = 1, dims(2) - IF ( buf3(i,j) .NE. buf3r(i,j) ) THEN - PRINT *, 'read buffer differs from write buffer' - PRINT *, buf3r(i,j), ' and ', buf3(i,j) - STOP - ENDIF - END DO -END DO - -!------------------------------------------------------------------------- -! H5T_NATIVE_DOUBLE -!------------------------------------------------------------------------- - -! -! write dataset. -! -CALL h5ltmake_dataset_f(file_id, dsetname4, rank, dims, H5T_NATIVE_DOUBLE, buf4, errcode) - -! -! read dataset. -! -CALL h5ltread_dataset_f(file_id, dsetname4, H5T_NATIVE_DOUBLE, buf4r, dims, errcode) - -! -! compare read and write buffers. -! -DO i = 1, dims(1) - DO j = 1, dims(2) - IF ( buf4(i,j) .NE. buf4r(i,j) ) THEN - PRINT *, 'read buffer differs from write buffer' - PRINT *, buf4r(i,j), ' and ', buf4(i,j) - STOP - ENDIF - END DO -END DO - -! -! Close the file. -! -CALL h5fclose_f(file_id, errcode) - -! -! Close FORTRAN predefined datatypes. -! -CALL h5close_f(errcode) - -CALL passed() -! -! end function. -! -END SUBROUTINE test_dataset2D - - -!------------------------------------------------------------------------- -! test_dataset3D -!------------------------------------------------------------------------- - - -SUBROUTINE test_dataset3D() - -USE H5LT ! module of H5LT -USE HDF5 ! module of HDF5 library - -IMPLICIT NONE - -INTEGER, PARAMETER :: DIM1 = 6 ! columns -INTEGER, PARAMETER :: DIM2 = 4 ! rows -INTEGER, PARAMETER :: DIM3 = 2 ! layers -CHARACTER(len=9), PARAMETER :: filename = "dsetf3.h5" ! File name -CHARACTER(LEN=5), PARAMETER :: dsetname1 = "dset1" ! Dataset name -CHARACTER(LEN=5), PARAMETER :: dsetname2 = "dset2" ! Dataset name -CHARACTER(LEN=5), PARAMETER :: dsetname3 = "dset3" ! Dataset name -CHARACTER(LEN=5), PARAMETER :: dsetname4 = "dset4" ! Dataset name -INTEGER(HID_T) :: file_id ! File identifier -INTEGER(HSIZE_T), DIMENSION(3) :: dims = (/DIM1,DIM2,DIM3/) ! Dataset dimensions -INTEGER(HSIZE_T), DIMENSION(3) :: dimsr ! Dataset dimensions -INTEGER, DIMENSION(DIM1*DIM2*DIM3) :: buf ! Data buffer -INTEGER, DIMENSION(DIM1*DIM2*DIM3) :: bufr ! Data buffer -INTEGER, DIMENSION(DIM1,DIM2,DIM3) :: buf2 ! Data buffer -INTEGER, DIMENSION(DIM1,DIM2,DIM3) :: buf2r ! Data buffer -REAL, DIMENSION(DIM1,DIM2,DIM3) :: buf3 ! Data buffer -REAL, DIMENSION(DIM1,DIM2,DIM3) :: buf3r ! Data buffer -DOUBLE PRECISION, DIMENSION(DIM1,DIM2,DIM3) :: buf4 ! Data buffer -DOUBLE PRECISION, DIMENSION(DIM1,DIM2,DIM3) :: buf4r ! Data buffer -INTEGER :: rank = 3 ! Dataset rank -INTEGER :: errcode ! Error flag -INTEGER(HSIZE_T) :: i, j, k, n ! general purpose integers -INTEGER :: type_class -INTEGER(SIZE_T) :: type_size - -CALL test_begin(' Make/Read datasets (3D) ') - - -! -! Initialize the data array. -! -n=1 -DO i = 1, DIM1*DIM2*DIM3 - buf(i) = INT(n) - n = n + 1 -END DO - -n = 1 -DO i = 1, dims(1) - DO j = 1, dims(2) - DO k = 1, dims(3) - buf2(i,j,k) = INT(n) - buf3(i,j,k) = INT(n) - buf4(i,j,k) = INT(n) - n = n + 1 - END DO - END DO -END DO - -! -! Initialize FORTRAN predefined datatypes. -! -CALL h5open_f(errcode) - -! -! Create a new file using default properties. -! -CALL h5fcreate_f(filename, H5F_ACC_TRUNC_F, file_id, errcode) - -!------------------------------------------------------------------------- -! H5T_NATIVE_INT 1D buffer -!------------------------------------------------------------------------- - -! -! write dataset. -! -CALL h5ltmake_dataset_f(file_id, dsetname1, rank, dims, H5T_NATIVE_INTEGER, buf, errcode) - -! -! read dataset. -! -CALL h5ltread_dataset_f(file_id, dsetname1, H5T_NATIVE_INTEGER, bufr, dims, errcode) - -! -! compare read and write buffers. -! -DO i = 1, DIM1*DIM2*DIM3 - IF ( buf(i) .NE. bufr(i) ) THEN - PRINT *, 'read buffer differs from write buffer' - PRINT *, bufr(i), ' and ', buf(i) - STOP - ENDIF -END DO - -!------------------------------------------------------------------------- -! H5T_NATIVE_INT 3D buffer -!------------------------------------------------------------------------- - -! -! write dataset. -! -CALL h5ltmake_dataset_f(file_id, dsetname2, rank, dims, H5T_NATIVE_INTEGER, buf2, errcode) - -! -! read dataset. -! -CALL h5ltread_dataset_f(file_id, dsetname2, H5T_NATIVE_INTEGER, buf2r, dims, errcode) - -! -! compare read and write buffers. -! -DO i = 1, dims(1) - DO j = 1, dims(2) - DO k = 1, dims(3) - IF ( buf2(i,j,k) .NE. buf2r(i,j,k) ) THEN - PRINT *, 'read buffer differs from write buffer' - PRINT *, buf2r(i,j,k), ' and ', buf2(i,j,k) - STOP - ENDIF - END DO - END DO -END DO - -!------------------------------------------------------------------------- -! H5T_NATIVE_REAL -!------------------------------------------------------------------------- - -! -! write dataset. -! -CALL h5ltmake_dataset_f(file_id, dsetname3, rank, dims, H5T_NATIVE_REAL, buf3, errcode) - -! -! read dataset. -! -CALL h5ltread_dataset_f(file_id, dsetname3, H5T_NATIVE_REAL, buf3r, dims, errcode) - -! -! compare read and write buffers. -! -DO i = 1, dims(1) - DO j = 1, dims(2) - DO k = 1, dims(3) - IF ( buf3(i,j,k) .NE. buf3r(i,j,k) ) THEN - PRINT *, 'read buffer differs from write buffer' - PRINT *, buf3r(i,j,k), ' and ', buf3(i,j,k) - STOP - ENDIF - END DO - END DO -END DO - -!------------------------------------------------------------------------- -! H5T_NATIVE_DOUBLE -!------------------------------------------------------------------------- - -! -! write dataset. -! -CALL h5ltmake_dataset_f(file_id, dsetname4, rank, dims, H5T_NATIVE_DOUBLE, buf4, errcode) - -! -! read dataset. -! -CALL h5ltread_dataset_f(file_id, dsetname4, H5T_NATIVE_DOUBLE, buf4r, dims, errcode) - -! -! compare read and write buffers. -! -DO i = 1, dims(1) - DO j = 1, dims(2) - DO k = 1, dims(3) - IF ( buf4(i,j,k) .NE. buf4r(i,j,k) ) THEN - PRINT *, 'read buffer differs from write buffer' - PRINT *, buf4r(i,j,k), ' and ', buf4(i,j,k) - STOP - ENDIF - END DO - END DO -END DO - -CALL h5ltget_dataset_info_f(file_id,dsetname4,dimsr,type_class,type_size,errcode ) - -! -! compare dimensions -! -DO i = 1, rank - IF ( dimsr(i) .NE. dims(i) ) THEN - PRINT *, 'dimensions differ ' - STOP - ENDIF -END DO - -! -! Close the file. -! -CALL h5fclose_f(file_id, errcode) - -! -! Close FORTRAN predefined datatypes. -! -CALL h5close_f(errcode) - -CALL passed() -! -! end function. -! -END SUBROUTINE test_dataset3D - -!------------------------------------------------------------------------- -! test_datasetND -!------------------------------------------------------------------------- - - -SUBROUTINE test_datasetND(rank) - - USE H5LT ! module of H5LT - USE HDF5 ! module of HDF5 library - - IMPLICIT NONE - - INTEGER :: rank ! Dataset rank - - INTEGER, PARAMETER :: DIM1 = 2 ! columns - INTEGER, PARAMETER :: DIM2 = 4 ! rows - INTEGER, PARAMETER :: DIM3 = 2 ! layers - INTEGER, PARAMETER :: DIM4 = 5 ! columns - INTEGER, PARAMETER :: DIM5 = 4 ! rows - INTEGER, PARAMETER :: DIM6 = 3 ! layers - INTEGER, PARAMETER :: DIM7 = 2 ! layers - CHARACTER(len=9), PARAMETER :: filename = "dsetf3.h5" ! File name - CHARACTER(LEN=5), PARAMETER :: dsetname2 = "dset2" ! Dataset name - CHARACTER(LEN=5), PARAMETER :: dsetname3 = "dset3" ! Dataset name - CHARACTER(LEN=5), PARAMETER :: dsetname4 = "dset4" ! Dataset name - INTEGER(HID_T) :: file_id ! File identifier - INTEGER(HSIZE_T), DIMENSION(7) :: dims - INTEGER(HSIZE_T), DIMENSION(7) :: dimsr ! Dataset dimensions - INTEGER, ALLOCATABLE, DIMENSION(:,:,:,:) :: ibuf_4 ! Data buffer - INTEGER, ALLOCATABLE, DIMENSION(:,:,:,:) :: ibufr_4 ! Data buffer - INTEGER, ALLOCATABLE, DIMENSION(:,:,:,:,:) :: ibuf_5 ! Data buffer - INTEGER, ALLOCATABLE, DIMENSION(:,:,:,:,:) :: ibufr_5 ! Data buffer - INTEGER, ALLOCATABLE, DIMENSION(:,:,:,:,:,:) :: ibuf_6 ! Data buffer - INTEGER, ALLOCATABLE, DIMENSION(:,:,:,:,:,:) :: ibufr_6 ! Data buffer - INTEGER, ALLOCATABLE, DIMENSION(:,:,:,:,:,:,:) :: ibuf_7 ! Data buffer - INTEGER, ALLOCATABLE, DIMENSION(:,:,:,:,:,:,:) :: ibufr_7 ! Data buffer - REAL, ALLOCATABLE, DIMENSION(:,:,:,:) :: rbuf_4 ! Data buffer - REAL, ALLOCATABLE, DIMENSION(:,:,:,:) :: rbufr_4 ! Data buffer - REAL, ALLOCATABLE, DIMENSION(:,:,:,:,:) :: rbuf_5 ! Data buffer - REAL, ALLOCATABLE, DIMENSION(:,:,:,:,:) :: rbufr_5 ! Data buffer - REAL, ALLOCATABLE, DIMENSION(:,:,:,:,:,:) :: rbuf_6 ! Data buffer - REAL, ALLOCATABLE, DIMENSION(:,:,:,:,:,:) :: rbufr_6 ! Data buffer - REAL, ALLOCATABLE, DIMENSION(:,:,:,:,:,:,:) :: rbuf_7 ! Data buffer - REAL, ALLOCATABLE, DIMENSION(:,:,:,:,:,:,:) :: rbufr_7 ! Data buffer - DOUBLE PRECISION, ALLOCATABLE, DIMENSION(:,:,:,:) :: dbuf_4 ! Data buffer - DOUBLE PRECISION, ALLOCATABLE, DIMENSION(:,:,:,:) :: dbufr_4 ! Data buffer - DOUBLE PRECISION, ALLOCATABLE, DIMENSION(:,:,:,:,:) :: dbuf_5 ! Data buffer - DOUBLE PRECISION, ALLOCATABLE, DIMENSION(:,:,:,:,:) :: dbufr_5 ! Data buffer - DOUBLE PRECISION, ALLOCATABLE, DIMENSION(:,:,:,:,:,:) :: dbuf_6 ! Data buffer - DOUBLE PRECISION, ALLOCATABLE, DIMENSION(:,:,:,:,:,:) :: dbufr_6 ! Data buffer - DOUBLE PRECISION, ALLOCATABLE, DIMENSION(:,:,:,:,:,:,:) :: dbuf_7 ! Data buffer - DOUBLE PRECISION, ALLOCATABLE, DIMENSION(:,:,:,:,:,:,:) :: dbufr_7 ! Data buffer - INTEGER :: errcode ! Error flag - INTEGER(HSIZE_T) :: i, j, k, l, m, n, o, nn ! general purpose integers - INTEGER :: type_class - INTEGER(SIZE_T) :: type_size - CHARACTER(LEN=1) :: ichr1 - - WRITE(ichr1,'(I1.1)') rank - CALL test_begin(' Make/Read datasets ('//ichr1//'D) ') -! -! Initialize the data array. -! - IF(rank.EQ.4)THEN - - ALLOCATE(ibuf_4 (1:DIM1,1:DIM2,1:DIM3,1:DIM4)) - ALLOCATE(ibufr_4(1:DIM1,1:DIM2,1:DIM3,1:DIM4)) - ALLOCATE(rbuf_4 (1:DIM1,1:DIM2,1:DIM3,1:DIM4)) - ALLOCATE(rbufr_4(1:DIM1,1:DIM2,1:DIM3,1:DIM4)) - ALLOCATE(dbuf_4 (1:DIM1,1:DIM2,1:DIM3,1:DIM4)) - ALLOCATE(dbufr_4(1:DIM1,1:DIM2,1:DIM3,1:DIM4)) - - dims(1:7) = (/DIM1,DIM2,DIM3,DIM4,0,0,0/) - - nn = 1 - DO i = 1, DIM1 - DO j = 1, DIM2 - DO k = 1, DIM3 - DO l = 1, DIM4 - ibuf_4(i,j,k,l) = INT(nn) - rbuf_4(i,j,k,l) = INT(nn) - dbuf_4(i,j,k,l) = INT(nn) - nn = nn + 1 - END DO - END DO - END DO - ENDDO - - ELSE IF(rank.EQ.5)THEN - - ALLOCATE(ibuf_5 (1:DIM1,1:DIM2,1:DIM3,1:DIM4,1:DIM5)) - ALLOCATE(ibufr_5(1:DIM1,1:DIM2,1:DIM3,1:DIM4,1:DIM5)) - ALLOCATE(rbuf_5 (1:DIM1,1:DIM2,1:DIM3,1:DIM4,1:DIM5)) - ALLOCATE(rbufr_5(1:DIM1,1:DIM2,1:DIM3,1:DIM4,1:DIM5)) - ALLOCATE(dbuf_5 (1:DIM1,1:DIM2,1:DIM3,1:DIM4,1:DIM5)) - ALLOCATE(dbufr_5(1:DIM1,1:DIM2,1:DIM3,1:DIM4,1:DIM5)) - - dims(1:7) = (/DIM1,DIM2,DIM3,DIM4,DIM5,0,0/) - - nn = 1 - DO i = 1, DIM1 - DO j = 1, DIM2 - DO k = 1, DIM3 - DO l = 1, DIM4 - DO m = 1, DIM5 - ibuf_5(i,j,k,l,m) = INT(nn) - rbuf_5(i,j,k,l,m) = INT(nn) - dbuf_5(i,j,k,l,m) = INT(nn) - nn = nn + 1 - END DO - END DO - END DO - ENDDO - ENDDO - - ELSE IF(rank.EQ.6)THEN - - ALLOCATE(ibuf_6 (1:DIM1,1:DIM2,1:DIM3,1:DIM4,1:DIM5,1:DIM6)) - ALLOCATE(ibufr_6(1:DIM1,1:DIM2,1:DIM3,1:DIM4,1:DIM5,1:DIM6)) - ALLOCATE(rbuf_6 (1:DIM1,1:DIM2,1:DIM3,1:DIM4,1:DIM5,1:DIM6)) - ALLOCATE(rbufr_6(1:DIM1,1:DIM2,1:DIM3,1:DIM4,1:DIM5,1:DIM6)) - ALLOCATE(dbuf_6 (1:DIM1,1:DIM2,1:DIM3,1:DIM4,1:DIM5,1:DIM6)) - ALLOCATE(dbufr_6(1:DIM1,1:DIM2,1:DIM3,1:DIM4,1:DIM5,1:DIM6)) - - dims(1:7) = (/DIM1,DIM2,DIM3,DIM4,DIM5,DIM6,0/) - - nn = 1 - DO i = 1, DIM1 - DO j = 1, DIM2 - DO k = 1, DIM3 - DO l = 1, DIM4 - DO m = 1, DIM5 - DO n = 1, DIM6 - ibuf_6(i,j,k,l,m,n) = INT(nn) - rbuf_6(i,j,k,l,m,n) = INT(nn) - dbuf_6(i,j,k,l,m,n) = INT(nn) - nn = nn + 1 - END DO - END DO - END DO - ENDDO - ENDDO - ENDDO - - ELSE IF(rank.EQ.7)THEN - - ALLOCATE(ibuf_7 (1:DIM1,1:DIM2,1:DIM3,1:DIM4,1:DIM5,1:DIM6,1:DIM7)) - ALLOCATE(ibufr_7(1:DIM1,1:DIM2,1:DIM3,1:DIM4,1:DIM5,1:DIM6,1:DIM7)) - ALLOCATE(rbuf_7 (1:DIM1,1:DIM2,1:DIM3,1:DIM4,1:DIM5,1:DIM6,1:DIM7)) - ALLOCATE(rbufr_7(1:DIM1,1:DIM2,1:DIM3,1:DIM4,1:DIM5,1:DIM6,1:DIM7)) - ALLOCATE(dbuf_7 (1:DIM1,1:DIM2,1:DIM3,1:DIM4,1:DIM5,1:DIM6,1:DIM7)) - ALLOCATE(dbufr_7(1:DIM1,1:DIM2,1:DIM3,1:DIM4,1:DIM5,1:DIM6,1:DIM7)) - - dims(1:7) = (/DIM1,DIM2,DIM3,DIM4,DIM5,DIM6,DIM7/) - - nn = 1 - DO i = 1, DIM1 - DO j = 1, DIM2 - DO k = 1, DIM3 - DO l = 1, DIM4 - DO m = 1, DIM5 - DO n = 1, DIM6 - DO o = 1, DIM7 - ibuf_7(i,j,k,l,m,n,o) = INT(nn) - rbuf_7(i,j,k,l,m,n,o) = INT(nn) - dbuf_7(i,j,k,l,m,n,o) = INT(nn) - nn = nn + 1 - END DO - END DO - END DO - ENDDO - ENDDO - ENDDO - ENDDO - - ENDIF - - ! - ! Initialize FORTRAN predefined datatypes. - ! - CALL h5open_f(errcode) - - ! - ! Create a new file using default properties. - ! - CALL h5fcreate_f(filename, H5F_ACC_TRUNC_F, file_id, errcode) - - !------------------------------------------------------------------------- - ! H5T_NATIVE_INT ND buffer - !------------------------------------------------------------------------- - - ! - ! write dataset. - ! - IF(rank.EQ.4)THEN - CALL h5ltmake_dataset_f(file_id, dsetname2, rank, dims(1:rank), H5T_NATIVE_INTEGER, ibuf_4, errcode) - ELSE IF(rank.EQ.5)THEN - CALL h5ltmake_dataset_f(file_id, dsetname2, rank, dims(1:rank), H5T_NATIVE_INTEGER, ibuf_5, errcode) - ELSE IF(rank.EQ.6)THEN - CALL h5ltmake_dataset_f(file_id, dsetname2, rank, dims(1:rank), H5T_NATIVE_INTEGER, ibuf_6, errcode) - ELSE IF(rank.EQ.7)THEN - CALL h5ltmake_dataset_f(file_id, dsetname2, rank, dims(1:rank), H5T_NATIVE_INTEGER, ibuf_7, errcode) - ENDIF - - - ! - ! read dataset. - ! - IF(rank.EQ.4)THEN - CALL h5ltread_dataset_f(file_id, dsetname2, H5T_NATIVE_INTEGER, ibufr_4, dims(1:rank), errcode) - ELSE IF(rank.EQ.5)THEN - CALL h5ltread_dataset_f(file_id, dsetname2, H5T_NATIVE_INTEGER, ibufr_5, dims(1:rank), errcode) - ELSE IF(rank.EQ.6)THEN - CALL h5ltread_dataset_f(file_id, dsetname2, H5T_NATIVE_INTEGER, ibufr_6, dims(1:rank), errcode) - ELSE IF(rank.EQ.7)THEN - CALL h5ltread_dataset_f(file_id, dsetname2, H5T_NATIVE_INTEGER, ibufr_7, dims(1:rank), errcode) - ENDIF - - ! - ! compare read and write buffers. - ! - DO i = 1, dims(1) - DO j = 1, dims(2) - DO k = 1, dims(3) - DO l = 1, dims(4) - IF(rank.EQ.4)THEN - IF ( ibuf_4(i,j,k,l) .NE. ibufr_4(i,j,k,l) ) THEN - PRINT *, 'read buffer differs from write buffer' - PRINT *, ibuf_4(i,j,k,l), ' and ', ibufr_4(i,j,k,l) - STOP - ENDIF - ENDIF - DO m = 1, dims(5) - IF(rank.EQ.5)THEN - IF ( ibuf_5(i,j,k,l,m) .NE. ibufr_5(i,j,k,l,m) ) THEN - PRINT *, 'read buffer differs from write buffer' - PRINT *, ibuf_5(i,j,k,l,m), ' and ', ibufr_5(i,j,k,l,m) - STOP - ENDIF - ENDIF - DO n = 1, dims(6) - IF(rank.EQ.6)THEN - IF ( ibuf_6(i,j,k,l,m,n) .NE. ibufr_6(i,j,k,l,m,n) ) THEN - PRINT *, 'read buffer differs from write buffer' - PRINT *, ibuf_6(i,j,k,l,m,n), ' and ', ibufr_6(i,j,k,l,m,n) - STOP - ENDIF - ENDIF - DO o = 1, dims(7) - IF(rank.EQ.7)THEN - IF ( ibuf_7(i,j,k,l,m,n,o) .NE. ibufr_7(i,j,k,l,m,n,o) ) THEN - PRINT *, 'read buffer differs from write buffer' - PRINT *, ibuf_7(i,j,k,l,m,n,o), ' and ', ibufr_7(i,j,k,l,m,n,o) - STOP - ENDIF - ENDIF - ENDDO - ENDDO - ENDDO - ENDDO - ENDDO - ENDDO - ENDDO - !------------------------------------------------------------------------- - ! H5T_NATIVE_REAL - !------------------------------------------------------------------------- - - ! - ! write dataset. - ! - IF(rank.EQ.4)THEN - CALL h5ltmake_dataset_f(file_id, dsetname3, rank, dims(1:rank), H5T_NATIVE_REAL, rbuf_4, errcode) - ELSE IF(rank.EQ.5)THEN - CALL h5ltmake_dataset_f(file_id, dsetname3, rank, dims(1:rank), H5T_NATIVE_REAL, rbuf_5, errcode) - ELSE IF(rank.EQ.6)THEN - CALL h5ltmake_dataset_f(file_id, dsetname3, rank, dims(1:rank), H5T_NATIVE_REAL, rbuf_6, errcode) - ELSE IF(rank.EQ.7)THEN - CALL h5ltmake_dataset_f(file_id, dsetname3, rank, dims(1:rank), H5T_NATIVE_REAL, rbuf_7, errcode) - ENDIF - - - ! - ! read dataset. - ! - IF(rank.EQ.4)THEN - CALL h5ltread_dataset_f(file_id, dsetname3, H5T_NATIVE_REAL, rbufr_4, dims(1:rank), errcode) - ELSE IF(rank.EQ.5)THEN - CALL h5ltread_dataset_f(file_id, dsetname3, H5T_NATIVE_REAL, rbufr_5, dims(1:rank), errcode) - ELSE IF(rank.EQ.6)THEN - CALL h5ltread_dataset_f(file_id, dsetname3, H5T_NATIVE_REAL, rbufr_6, dims(1:rank), errcode) - ELSE IF(rank.EQ.7)THEN - CALL h5ltread_dataset_f(file_id, dsetname3, H5T_NATIVE_REAL, rbufr_7, dims(1:rank), errcode) - ENDIF - - ! - ! compare read and write buffers. - ! - DO i = 1, dims(1) - DO j = 1, dims(2) - DO k = 1, dims(3) - DO l = 1, dims(4) - IF(rank.EQ.4)THEN - IF ( rbuf_4(i,j,k,l) .NE. rbufr_4(i,j,k,l) ) THEN - PRINT *, 'read buffer differs from write buffer' - PRINT *, rbuf_4(i,j,k,l), ' and ', rbufr_4(i,j,k,l) - STOP - ENDIF - ENDIF - DO m = 1, dims(5) - IF(rank.EQ.5)THEN - IF ( rbuf_5(i,j,k,l,m) .NE. rbufr_5(i,j,k,l,m) ) THEN - PRINT *, 'read buffer differs from write buffer' - PRINT *, rbuf_5(i,j,k,l,m), ' and ', rbufr_5(i,j,k,l,m) - STOP - ENDIF - ENDIF - DO n = 1, dims(6) - IF(rank.EQ.6)THEN - IF ( rbuf_6(i,j,k,l,m,n) .NE. rbufr_6(i,j,k,l,m,n) ) THEN - PRINT *, 'read buffer differs from write buffer' - PRINT *, rbuf_6(i,j,k,l,m,n), ' and ', rbufr_6(i,j,k,l,m,n) - STOP - ENDIF - ENDIF - DO o = 1, dims(7) - IF(rank.EQ.7)THEN - IF ( rbuf_7(i,j,k,l,m,n,o) .NE. rbufr_7(i,j,k,l,m,n,o) ) THEN - PRINT *, 'read buffer differs from write buffer' - PRINT *, rbuf_7(i,j,k,l,m,n,o), ' and ', rbufr_7(i,j,k,l,m,n,o) - STOP - ENDIF - ENDIF - ENDDO - ENDDO - ENDDO - ENDDO - ENDDO - ENDDO - ENDDO - - !------------------------------------------------------------------------- - ! H5T_NATIVE_DOUBLE - !------------------------------------------------------------------------- - - ! - ! write dataset. - ! - IF(rank.EQ.4)THEN - CALL h5ltmake_dataset_f(file_id, dsetname4, rank, dims(1:rank), H5T_NATIVE_DOUBLE, dbuf_4, errcode) - ELSE IF(rank.EQ.5)THEN - CALL h5ltmake_dataset_f(file_id, dsetname4, rank, dims(1:rank), H5T_NATIVE_DOUBLE, dbuf_5, errcode) - ELSE IF(rank.EQ.6)THEN - CALL h5ltmake_dataset_f(file_id, dsetname4, rank, dims(1:rank), H5T_NATIVE_DOUBLE, dbuf_6, errcode) - ELSE IF(rank.EQ.7)THEN - CALL h5ltmake_dataset_f(file_id, dsetname4, rank, dims(1:rank), H5T_NATIVE_DOUBLE, dbuf_7, errcode) - ENDIF - - - ! - ! read dataset. - ! - IF(rank.EQ.4)THEN - CALL h5ltread_dataset_f(file_id, dsetname4, H5T_NATIVE_DOUBLE, dbufr_4, dims(1:rank), errcode) - ELSE IF(rank.EQ.5)THEN - CALL h5ltread_dataset_f(file_id, dsetname4, H5T_NATIVE_DOUBLE, dbufr_5, dims(1:rank), errcode) - ELSE IF(rank.EQ.6)THEN - CALL h5ltread_dataset_f(file_id, dsetname4, H5T_NATIVE_DOUBLE, dbufr_6, dims(1:rank), errcode) - ELSE IF(rank.EQ.7)THEN - CALL h5ltread_dataset_f(file_id, dsetname4, H5T_NATIVE_DOUBLE, dbufr_7, dims(1:rank), errcode) - ENDIF - - ! - ! compare read and write buffers. - ! - DO i = 1, dims(1) - DO j = 1, dims(2) - DO k = 1, dims(3) - DO l = 1, dims(4) - IF(rank.EQ.4)THEN - IF ( dbuf_4(i,j,k,l) .NE. dbufr_4(i,j,k,l) ) THEN - PRINT *, 'read buffer differs from write buffer' - PRINT *, dbuf_4(i,j,k,l), ' and ', dbufr_4(i,j,k,l) - STOP - ENDIF - ENDIF - DO m = 1, dims(5) - IF(rank.EQ.5)THEN - IF ( dbuf_5(i,j,k,l,m) .NE. dbufr_5(i,j,k,l,m) ) THEN - PRINT *, 'read buffer differs from write buffer' - PRINT *, dbuf_5(i,j,k,l,m), ' and ', dbufr_5(i,j,k,l,m) - STOP - ENDIF - ENDIF - DO n = 1, dims(6) - IF(rank.EQ.6)THEN - IF ( dbuf_6(i,j,k,l,m,n) .NE. dbufr_6(i,j,k,l,m,n) ) THEN - PRINT *, 'read buffer differs from write buffer' - PRINT *, dbuf_6(i,j,k,l,m,n), ' and ', dbufr_6(i,j,k,l,m,n) - STOP - ENDIF - ENDIF - DO o = 1, dims(7) - IF(rank.EQ.7)THEN - IF ( dbuf_7(i,j,k,l,m,n,o) .NE. dbufr_7(i,j,k,l,m,n,o) ) THEN - PRINT *, 'read buffer differs from write buffer' - PRINT *, dbuf_7(i,j,k,l,m,n,o), ' and ', dbufr_7(i,j,k,l,m,n,o) - STOP - ENDIF - ENDIF - ENDDO - ENDDO - ENDDO - ENDDO - ENDDO - ENDDO - ENDDO - - CALL h5ltget_dataset_info_f(file_id,dsetname4,dimsr,type_class,type_size,errcode ) - - ! - ! compare dimensions - ! - DO i = 1, rank - IF ( dimsr(i) .NE. dims(i) ) THEN - PRINT *, 'dimensions differ ' - STOP - ENDIF - END DO - - ! - ! Close the file. - ! - CALL h5fclose_f(file_id, errcode) - - ! - ! Close FORTRAN predefined datatypes. - ! - CALL h5close_f(errcode) - - ! DEALLOCATE RESOURCES - - IF(rank.EQ.4)THEN - DEALLOCATE(ibuf_4, ibufr_4, rbuf_4, rbufr_4, dbuf_4, dbufr_4) - ELSE IF(rank.EQ.5)THEN - DEALLOCATE(ibuf_5, ibufr_5, rbuf_5, rbufr_5, dbuf_5, dbufr_5) - ELSE IF(rank.EQ.6)THEN - DEALLOCATE(ibuf_6, ibufr_6, rbuf_6, rbufr_6, dbuf_6, dbufr_6) - ELSE IF(rank.EQ.7)THEN - DEALLOCATE(ibuf_7, ibufr_7, rbuf_7, rbufr_7, dbuf_7, dbufr_7) - ENDIF - - CALL passed() - ! - ! end function. - ! -END SUBROUTINE test_datasetND - - - -!------------------------------------------------------------------------- -! test_datasets -!------------------------------------------------------------------------- - -SUBROUTINE test_datasets() - - USE H5LT ! module of H5LT - USE HDF5 ! module of HDF5 library - - IMPLICIT NONE - - CHARACTER(len=9), PARAMETER :: filename = "dsetf4.h5"! File name - INTEGER(HID_T) :: file_id ! File identifier - INTEGER :: errcode ! Error flag - INTEGER, PARAMETER :: DIM1 = 10 ! Dimension of array - CHARACTER(LEN=5), PARAMETER :: dsetname1 = "dset1" ! Dataset name - CHARACTER(LEN=5), PARAMETER :: dsetname2 = "dset2" ! Dataset name - CHARACTER(LEN=5), PARAMETER :: dsetname3 = "dset3" ! Dataset name - CHARACTER(LEN=5), PARAMETER :: dsetname4 = "dset4" ! Dataset name - CHARACTER(LEN=5), PARAMETER :: dsetname5 = "dset5" ! Dataset name - INTEGER(HSIZE_T), DIMENSION(1) :: dims = (/DIM1/) ! Dataset dimensions - INTEGER(HSIZE_T), DIMENSION(1) :: dimsr ! Dataset dimensions - INTEGER :: rank = 1 ! Dataset rank - INTEGER :: rankr ! Dataset rank - CHARACTER(LEN=8), PARAMETER :: buf1 = "mystring" ! Data buffer - CHARACTER(LEN=8) :: buf1r ! Data buffer - INTEGER, DIMENSION(DIM1) :: buf2 ! Data buffer - INTEGER, DIMENSION(DIM1) :: bufr2 ! Data buffer - REAL, DIMENSION(DIM1) :: buf3 ! Data buffer - REAL, DIMENSION(DIM1) :: bufr3 ! Data buffer - DOUBLE PRECISION, DIMENSION(DIM1) :: buf4 ! Data buffer - DOUBLE PRECISION, DIMENSION(DIM1) :: bufr4 ! Data buffer - INTEGER :: i, n ! general purpose integer - INTEGER :: has ! general purpose integer - INTEGER :: type_class - INTEGER(SIZE_T) :: type_size - LOGICAL :: path_valid ! status of the path - CHARACTER(LEN=6) :: chr_exact - CHARACTER(LEN=8) :: chr_lg - - ! - ! Initialize FORTRAN predefined datatypes. - ! - CALL h5open_f(errcode) - - ! - ! Create a new file using default properties. - ! - CALL h5fcreate_f(filename, H5F_ACC_TRUNC_F, file_id, errcode) - - ! - ! Initialize the data array. - ! - n = 1 - DO i = 1, DIM1 - buf2(i) = n - buf3(i) = n - buf4(i) = n - n = n + 1 - END DO - - !------------------------------------------------------------------------- - ! int - !------------------------------------------------------------------------- - - CALL test_begin(' Make/Read datasets (integer) ') - - ! - ! write dataset. - ! - CALL h5ltmake_dataset_int_f(file_id, dsetname2, rank, dims, buf2, errcode) - - ! - ! read dataset. - ! - CALL h5ltread_dataset_int_f(file_id, dsetname2, bufr2, dims, errcode) - - ! - ! compare read and write buffers. - ! - DO i = 1, DIM1 - IF ( buf2(i) .NE. bufr2(i) ) THEN - PRINT *, 'read buffer differs from write buffer' - PRINT *, bufr2(i), ' and ', buf2(i) - STOP - ENDIF - END DO - - CALL passed() - - - !------------------------------------------------------------------------- - ! real - !------------------------------------------------------------------------- - - CALL test_begin(' Make/Read datasets (float) ') - - - ! - ! write dataset. - ! - CALL h5ltmake_dataset_float_f(file_id, dsetname3, rank, dims, buf3, errcode) - - ! - ! read dataset. - ! - CALL h5ltread_dataset_float_f(file_id, dsetname3, bufr3, dims, errcode) - - ! - ! compare read and write buffers. - ! - DO i = 1, DIM1 - IF ( buf3(i) .NE. bufr3(i) ) THEN - PRINT *, 'read buffer differs from write buffer' - PRINT *, bufr3(i), ' and ', buf3(i) - STOP - ENDIF - END DO - - CALL passed() - - !------------------------------------------------------------------------- - ! double - !------------------------------------------------------------------------- - - CALL test_begin(' Make/Read datasets (double) ') - - - ! - ! write dataset. - ! - CALL h5ltmake_dataset_double_f(file_id, dsetname4, rank, dims, buf4, errcode) - - ! - ! read dataset. - ! - CALL h5ltread_dataset_double_f(file_id, dsetname4, bufr4, dims, errcode) - - ! - ! compare read and write buffers. - ! - DO i = 1, DIM1 - IF ( buf4(i) .NE. bufr4(i) ) THEN - PRINT *, 'read buffer differs from write buffer' - PRINT *, bufr4(i), ' and ', buf4(i) - STOP - ENDIF - END DO - - CALL passed() - - - !------------------------------------------------------------------------- - ! string - !------------------------------------------------------------------------- - - CALL test_begin(' Make/Read datasets (string) ') - - - ! - ! write dataset. - ! - CALL h5ltmake_dataset_string_f(file_id, dsetname5, buf1, errcode) - - ! - ! read dataset. - ! - CALL h5ltread_dataset_string_f(file_id, dsetname5, buf1r, errcode) - - ! - ! compare read and write buffers. - ! - IF ( buf1 .NE. buf1r ) THEN - PRINT *, 'read buffer differs from write buffer' - PRINT *, buf1, ' and ', buf1r - STOP - ENDIF - - CALL passed() - - CALL test_begin(' Test h5ltpath_valid_f ') - ! - ! test function h5ltpath_valid_f - ! - chr_exact = "/"//dsetname2 ! test character buffer the exact size needed - CALL h5ltpath_valid_f(file_id, chr_exact, .TRUE., path_valid, errcode) - IF(errcode.LT.0.OR..NOT.path_valid)THEN - PRINT *, 'error in h5ltpath_valid_f' - STOP - ENDIF - chr_lg = "/"//dsetname2 ! test character buffer larger then needed - CALL h5ltpath_valid_f(file_id, chr_lg, .TRUE., path_valid, errcode) - IF(errcode.LT.0.OR..NOT.path_valid)THEN - PRINT *, 'error in h5ltpath_valid_f' - STOP - ENDIF - - CALL h5ltpath_valid_f(file_id, chr_lg, .FALSE., path_valid, errcode) - IF(errcode.LT.0.OR..NOT.path_valid)THEN - PRINT *, 'error in h5ltpath_valid_f' - STOP - ENDIF - - ! Should fail, dataset does not exist - CALL h5ltpath_valid_f(file_id, "/"//dsetname2//"junk", .TRUE., path_valid, errcode) - IF(errcode.LT.0.OR.path_valid)THEN - PRINT *, 'error in h5ltpath_valid_f' - STOP - ENDIF - - CALL h5ltpath_valid_f(file_id, "/"//dsetname2//"junk", .FALSE., path_valid, errcode) - IF(errcode.LT.0.OR.path_valid)THEN - PRINT *, 'error in h5ltpath_valid_f' - STOP - ENDIF - - ! Create a dangling soft link - CALL h5lcreate_soft_f("/G2", file_id, "/G3", errcode) - - ! Should pass, does not check for dangled link - CALL h5ltpath_valid_f(file_id, "/G3", .FALSE., path_valid, errcode) - IF(.NOT.path_valid)THEN - PRINT *, 'error in h5ltpath_valid_f' - STOP - ENDIF - - ! Should fail, dangled link - CALL h5ltpath_valid_f(file_id, "/G2", .TRUE., path_valid, errcode) - IF(path_valid)THEN - PRINT *, 'error in h5ltpath_valid_f' - STOP - ENDIF - - CALL passed() - - - CALL test_begin(' Get dataset dimensions/info ') - - !------------------------------------------------------------------------- - ! h5ltget_dataset_ndims_f - !------------------------------------------------------------------------- - - CALL h5ltget_dataset_ndims_f(file_id, dsetname4, rankr, errcode) - IF ( rankr .NE. rank ) THEN - PRINT *, 'h5ltget_dataset_ndims_f return error' - STOP - ENDIF - - - !------------------------------------------------------------------------- - ! test h5ltfind_dataset_f function - !------------------------------------------------------------------------- - - - has = h5ltfind_dataset_f(file_id,dsetname4) - IF ( has .NE. 1 ) THEN - PRINT *, 'h5ltfind_dataset_f return error' - STOP - ENDIF - - !------------------------------------------------------------------------- - ! test h5ltget_dataset_info_f function - !------------------------------------------------------------------------- - - - CALL h5ltget_dataset_info_f(file_id,dsetname4,dimsr,type_class,type_size,errcode ) - - ! - ! compare dimensions - ! - DO i = 1, rank - IF ( dimsr(i) .NE. dims(i) ) THEN - PRINT *, 'dimensions differ ' - STOP - ENDIF - END DO - - IF ( type_class .NE. 1 ) THEN ! H5T_FLOAT - PRINT *, 'wrong type class ' - STOP - ENDIF - - ! - ! Close the file. - ! - CALL h5fclose_f(file_id, errcode) - ! - ! Close FORTRAN predefined datatypes. - ! - CALL h5close_f(errcode) - - CALL passed() - ! - ! end function. - ! -END SUBROUTINE test_datasets - - - -!------------------------------------------------------------------------- -! test_attributes -!------------------------------------------------------------------------- - -SUBROUTINE test_attributes() - - USE H5LT ! module of H5LT - USE HDF5 ! module of HDF5 library - - IMPLICIT NONE - - CHARACTER(len=9), PARAMETER :: filename = "dsetf5.h5"! File name - CHARACTER(len=9), PARAMETER :: filename1 ="tattr.h5" ! C written attribute file - INTEGER(HID_T) :: file_id ! File identifier -! INTEGER(HID_T) :: file_id1 - INTEGER, PARAMETER :: DIM1 = 10 ! Dimension of array - CHARACTER(LEN=5), PARAMETER :: attrname1 = "attr1" ! Attribute name - CHARACTER(LEN=5), PARAMETER :: attrname2 = "attr2" ! Attribute name - CHARACTER(LEN=5), PARAMETER :: attrname3 = "attr3" ! Attribute name - CHARACTER(LEN=5), PARAMETER :: attrname4 = "attr4" ! Attribute name - CHARACTER(LEN=5), PARAMETER :: attrname5 = "attr5" ! Attribute name - CHARACTER(LEN=8), PARAMETER :: buf1 = "mystring" ! Data buffer - CHARACTER(LEN=16), PARAMETER :: buf_c = "string attribute" - CHARACTER(LEN=8) :: bufr1 ! Data buffer - CHARACTER(LEN=10) :: bufr1_lg ! Data buffer -! CHARACTER(LEN=16) :: bufr_c ! Data buffer -! CHARACTER(LEN=18) :: bufr_c_lg ! Data buffer - INTEGER, DIMENSION(DIM1) :: buf2 ! Data buffer - INTEGER, DIMENSION(DIM1) :: bufr2 ! Data buffer - REAL, DIMENSION(DIM1) :: buf3 ! Data buffer - REAL, DIMENSION(DIM1) :: bufr3 ! Data buffer - DOUBLE PRECISION, DIMENSION(DIM1) :: buf4 ! Data buffer - DOUBLE PRECISION, DIMENSION(DIM1) :: bufr4 ! Data buffer - INTEGER :: errcode ! Error flag - INTEGER :: i, n ! general purpose integer - INTEGER(SIZE_T) size ! size of attribute array - INTEGER :: rankr ! rank - INTEGER(HSIZE_T), DIMENSION(1) :: dimsr ! attribute dimensions - INTEGER :: type_class - INTEGER(SIZE_T) :: type_size - INTEGER(HSIZE_T), DIMENSION(1) :: dims = (/DIM1/) ! Dataset dimensions - INTEGER :: rank = 1 ! Dataset rank - CHARACTER(LEN=5), PARAMETER :: dsetname1 = "dset1" ! Dataset name - INTEGER, DIMENSION(DIM1) :: buf ! Data buffer - - - ! - ! Initialize FORTRAN predefined datatypes. - ! - CALL h5open_f(errcode) - ! - ! Create a new file using default properties. - ! - CALL h5fcreate_f(filename, H5F_ACC_TRUNC_F, file_id, errcode) - ! - ! make a dataset. - ! - CALL h5ltmake_dataset_int_f(file_id, dsetname1, rank, dims, buf, errcode) - - ! - ! Initialize the data array. - ! - size = DIM1 - n = 1 - DO i = 1, DIM1 - buf2(i) = n - buf3(i) = n - buf4(i) = n - n = n + 1 - END DO - - - !------------------------------------------------------------------------- - ! int - !------------------------------------------------------------------------- - - CALL test_begin(' Set/Get attributes int ') - - - ! - ! write attribute. - ! - CALL h5ltset_attribute_int_f(file_id,dsetname1,attrname2,buf2,size,errcode) - - ! - ! read attribute. - ! - CALL h5ltget_attribute_int_f(file_id,dsetname1,attrname2,bufr2,errcode) - - ! - ! compare read and write buffers. - ! - DO i = 1, DIM1 - IF ( buf2(i) .NE. bufr2(i) ) THEN - PRINT *, 'read buffer differs from write buffer' - PRINT *, bufr2(i), ' and ', buf2(i) - STOP - ENDIF - END DO - - CALL passed() - - !------------------------------------------------------------------------- - ! float - !------------------------------------------------------------------------- - - CALL test_begin(' Set/Get attributes float ') - - - ! - ! write attribute. - ! - CALL h5ltset_attribute_float_f(file_id,dsetname1,attrname3,buf3,size,errcode) - ! - ! read attribute. - ! - CALL h5ltget_attribute_float_f(file_id,dsetname1,attrname3,bufr3,errcode) - - ! - ! compare read and write buffers. - ! - DO i = 1, DIM1 - IF ( buf3(i) .NE. bufr3(i) ) THEN - PRINT *, 'read buffer differs from write buffer' - PRINT *, bufr3(i), ' and ', buf3(i) - STOP - ENDIF - END DO - - CALL passed() - - !------------------------------------------------------------------------- - ! double - !------------------------------------------------------------------------- - - CALL test_begin(' Set/Get attributes double ') - - ! - ! write attribute. - ! - CALL h5ltset_attribute_double_f(file_id,dsetname1,attrname4,buf4,size,errcode) - - ! - ! read attribute. - ! - CALL h5ltget_attribute_double_f(file_id,dsetname1,attrname4,bufr4,errcode) - - ! - ! compare read and write buffers. - ! - DO i = 1, DIM1 - IF ( buf4(i) .NE. bufr4(i) ) THEN - PRINT *, 'read buffer differs from write buffer' - PRINT *, bufr4(i), ' and ', buf4(i) - STOP - ENDIF - END DO - - CALL passed() - - !------------------------------------------------------------------------- - ! string - !------------------------------------------------------------------------- - - CALL test_begin(' Set/Get attributes string ') - - ! - ! write attribute. - ! - CALL h5ltset_attribute_string_f(file_id,dsetname1,attrname5,buf1,errcode) - - ! - ! read attribute into a fortran character buf that is the same size as buf1. - ! - CALL h5ltget_attribute_string_f(file_id,dsetname1,attrname5,bufr1,errcode) - - ! - ! compare read and write buffers. - ! - IF ( buf1 .NE. bufr1 ) THEN - PRINT *, 'read buffer differs from write buffer' - PRINT *, buf1, ' and ', bufr1 - STOP - ENDIF - - ! - ! read attribute into a fortran character buf that is larger then buf1. - ! - CALL h5ltget_attribute_string_f(file_id,dsetname1,attrname5,bufr1_lg,errcode) - - ! - ! compare read and write buffers, make sure C NULL character was removed. - ! - IF ( buf1(1:8) .NE. bufr1_lg(1:8) .AND. bufr1_lg(9:10) .NE. ' ' ) THEN - PRINT *, 'larger read buffer differs from write buffer' - PRINT *, buf1, ' and ', bufr1_lg - STOP - ENDIF - - ! - ! ** Test reading a string that was created with a C program ** - ! - -!!$ CALL h5fopen_f(filename1, H5F_ACC_RDONLY_F, file_id1, errcode) -!!$ -!!$ CALL h5ltget_attribute_string_f(file_id1, "/", "attr5", bufr_c, errcode) -!!$ ! -!!$ ! compare read and write buffers. -!!$ ! -!!$ IF ( bufr_c .NE. buf_c ) THEN -!!$ PRINT *, 'read buffer differs from write buffer' -!!$ PRINT *, bufr1, ' and ', buf_c -!!$ STOP -!!$ ENDIF -!!$ ! -!!$ ! read attribute into a fortran character buf that is larger then buf_c. -!!$ ! -!!$ CALL h5ltget_attribute_string_f(file_id1, "/", "attr5", bufr_c_lg, errcode) -!!$ -!!$ ! -!!$ ! compare read and write buffers, make sure C NULL character was removed. -!!$ ! -!!$ IF ( buf_c(1:16) .NE. bufr_c_lg(1:16) .AND. bufr_c_lg(17:18) .NE. ' ' ) THEN -!!$ PRINT *, 'larger read buffer differs from write buffer' -!!$ PRINT *, buf_c, ' and ', bufr_c_lg -!!$ STOP -!!$ ENDIF - -!!$ CALL h5fclose_f(file_id1, errcode) - - CALL passed() - - !------------------------------------------------------------------------- - ! get attribute rank - !------------------------------------------------------------------------- - - CALL test_begin(' Get attribute rank/info ') - - - CALL h5ltget_attribute_ndims_f(file_id,dsetname1,attrname2,rankr,errcode) - - IF ( rankr .NE. 1 ) THEN - PRINT *, 'h5ltget_attribute_ndims_f return error' - STOP - ENDIF - - - CALL h5ltget_attribute_info_f(file_id,dsetname1,attrname2,dimsr,type_class,type_size,errcode) - - ! - ! compare dimensions - ! - DO i = 1, rank - IF ( dimsr(i) .NE. dims(i) ) THEN - PRINT *, 'dimensions differ ' - STOP - ENDIF - END DO - - - ! - ! Close the file. - ! - CALL h5fclose_f(file_id, errcode) - ! - ! Close FORTRAN predefined datatypes. - ! - CALL h5close_f(errcode) - - CALL passed() - ! - ! end function. - ! -END SUBROUTINE test_attributes - - - - - - -!------------------------------------------------------------------------- -! test_begin -!------------------------------------------------------------------------- - -SUBROUTINE test_begin(string) - CHARACTER(LEN=*), INTENT(IN) :: string - WRITE(*, fmt = '(14a)', advance = 'no') string - WRITE(*, fmt = '(40x,a)', advance = 'no') ' ' -END SUBROUTINE test_begin - -!------------------------------------------------------------------------- -! passed -!------------------------------------------------------------------------- - -SUBROUTINE passed() - WRITE(*, fmt = '(6a)') 'PASSED' -END SUBROUTINE passed diff --git a/hl/fortran/test/tsttable.F90 b/hl/fortran/test/tsttable.F90 new file mode 100644 index 0000000..74029a5 --- /dev/null +++ b/hl/fortran/test/tsttable.F90 @@ -0,0 +1,534 @@ +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! 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. * +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! +! +! This file contains the FORTRAN90 tests for H5LT +! +#include + +PROGRAM table_test + + CALL test_table1() + +END PROGRAM table_test + + +!------------------------------------------------------------------------- +! test_table1 +!------------------------------------------------------------------------- + +SUBROUTINE test_table1() + + USE H5TB ! module of H5TB + USE HDF5 ! module of HDF5 library + + IMPLICIT NONE + + CHARACTER(len=8), PARAMETER :: filename = "f1tab.h5" ! File name + CHARACTER(LEN=5), PARAMETER :: dsetname1 = "dset1" ! Dataset name + INTEGER(HID_T) :: file_id ! File identifier + INTEGER(HSIZE_T), PARAMETER :: nfields = 4 ! nfields + INTEGER(HSIZE_T), PARAMETER :: nrecords = 5 ! nrecords + CHARACTER(LEN=10),DIMENSION(1:nfields) :: field_names ! field names + INTEGER(SIZE_T), DIMENSION(1:nfields) :: field_offset ! field offset + INTEGER(HID_T), DIMENSION(1:nfields) :: field_types ! field types + INTEGER(HSIZE_T), PARAMETER :: chunk_size = 5 ! chunk size + INTEGER, PARAMETER :: compress = 0 ! compress + INTEGER :: errcode = 0 ! Error flag + INTEGER :: i ! general purpose integer + INTEGER(SIZE_T) :: type_size ! Size of the datatype + INTEGER(SIZE_T) :: type_sizec ! Size of the character datatype + INTEGER(SIZE_T) :: type_sizei ! Size of the integer datatype + INTEGER(SIZE_T) :: type_sized ! Size of the double precision datatype + INTEGER(SIZE_T) :: type_sizer ! Size of the real datatype + INTEGER(HID_T) :: type_id_c ! Memory datatype identifier (for character field) + INTEGER(SIZE_T) :: offset ! Member's offset + INTEGER(HSIZE_T) :: start = 0 ! start record + INTEGER, DIMENSION(nrecords) :: bufi ! Data buffer + INTEGER, DIMENSION(nrecords) :: bufir ! Data buffer + REAL, DIMENSION(nrecords) :: bufr ! Data buffer + REAL, DIMENSION(nrecords) :: bufrr ! Data buffer + DOUBLE PRECISION, DIMENSION(nrecords) :: bufd ! Data buffer + DOUBLE PRECISION, DIMENSION(nrecords) :: bufdr ! Data buffer + CHARACTER(LEN=2), DIMENSION(nrecords), PARAMETER :: bufs = (/"AB","CD","EF","GH","IJ"/) ! Data buffer + CHARACTER(LEN=2), DIMENSION(nrecords) :: bufsr ! Data buffer + INTEGER(HSIZE_T) :: nfieldsr ! nfields + INTEGER(HSIZE_T) :: nrecordsr ! nrecords + CHARACTER(LEN=9), DIMENSION(1:nfields) :: field_namesr ! field names + INTEGER(SIZE_T), DIMENSION(1:nfields) :: field_offsetr ! field offset + INTEGER(SIZE_T), DIMENSION(1:nfields) :: field_sizesr ! field sizes + INTEGER(SIZE_T) :: type_sizeout = 0 ! size of the datatype + INTEGER :: maxlen = 0 ! max chararter length of a field name + INTEGER :: Cs_sizeof_double = H5_SIZEOF_DOUBLE ! C's sizeof double + INTEGER :: SIZEOF_X + LOGICAL :: Exclude_double + + ! Find size of DOUBLE PRECISION +#ifdef H5_FORTRAN_HAVE_STORAGE_SIZE + SIZEOF_X = storage_size(bufd(1))/storage_size(c_char_'a') +#else + SIZEOF_X = SIZEOF(bufd(1)) +#endif + + ! If Fortran DOUBLE PRECISION and C DOUBLE sizeofs don't match then disable + ! creating a DOUBLE RECISION field, and instead create a REAL field. This + ! is needed to handle when DOUBLE PRECISION is promoted via a compiler flag. + Exclude_double = .FALSE. + IF(Cs_sizeof_double.NE.SIZEOF_X)THEN + Exclude_double = .TRUE. + ENDIF + + ! + ! Initialize the data arrays. + ! + DO i = 1, nrecords + bufi(i) = i + bufr(i) = i + bufd(i) = i + END DO + + ! + ! Initialize FORTRAN predefined datatypes. + ! + CALL h5open_f(errcode) + + ! + ! Create a new file using default properties. + ! + CALL h5fcreate_f(filename, H5F_ACC_TRUNC_F, file_id, errcode) + + + !------------------------------------------------------------------------- + ! make table + ! initialize the table parameters + !------------------------------------------------------------------------- + + field_names(1) = "field1" + field_names(2) = "field2a" + field_names(3) = "field3ab" + field_names(4) = "field4abc" + + ! + ! calculate total size by calculating sizes of each member + ! + CALL h5tcopy_f(H5T_NATIVE_CHARACTER, type_id_c, errcode) + type_size = 2 + CALL h5tset_size_f(type_id_c, type_size, errcode) + CALL h5tget_size_f(type_id_c, type_sizec, errcode) + CALL h5tget_size_f(H5T_NATIVE_INTEGER, type_sizei, errcode) + IF(exclude_double)THEN + CALL h5tget_size_f(H5T_NATIVE_REAL, type_sized, errcode) + ELSE + CALL h5tget_size_f(H5T_NATIVE_DOUBLE, type_sized, errcode) + ENDIF + CALL h5tget_size_f(H5T_NATIVE_REAL, type_sizer, errcode) + type_size = type_sizec + type_sizei + type_sized + type_sizer + + ! + ! type ID's + ! + field_types(1) = type_id_c + field_types(2) = H5T_NATIVE_INTEGER + IF(exclude_double)THEN + field_types(3) = H5T_NATIVE_REAL + ELSE + field_types(3) = H5T_NATIVE_DOUBLE + ENDIF + field_types(4) = H5T_NATIVE_REAL + + ! + ! offsets + ! + offset = 0 + field_offset(1) = offset + offset = offset + type_sizec ! Offset of the second memeber is 2 + field_offset(2) = offset + offset = offset + type_sizei ! Offset of the second memeber is 6 + field_offset(3) = offset + offset = offset + type_sized ! Offset of the second memeber is 14 + field_offset(4) = offset + + !------------------------------------------------------------------------- + ! make table + !------------------------------------------------------------------------- + + CALL test_begin(' Make table ') + + CALL h5tbmake_table_f(dsetname1,& + file_id,& + dsetname1,& + nfields,& + nrecords,& + type_size,& + field_names,& + field_offset,& + field_types,& + chunk_size,& + compress,& + errcode ) + + CALL passed() + + + !------------------------------------------------------------------------- + ! write field + !------------------------------------------------------------------------- + + CALL test_begin(' Read/Write field by name ') + + CALL h5tbwrite_field_name_f(file_id,dsetname1,field_names(1),start,nrecords,type_sizec,& + bufs,errcode) + + CALL h5tbwrite_field_name_f(file_id,dsetname1,field_names(2),start,nrecords,type_sizei,& + bufi,errcode) + IF(exclude_double)THEN + CALL h5tbwrite_field_name_f(file_id,dsetname1,field_names(3),start,nrecords,type_sized,& + bufr,errcode) + ELSE + CALL h5tbwrite_field_name_f(file_id,dsetname1,field_names(3),start,nrecords,type_sized,& + bufd,errcode) + ENDIF + + CALL h5tbwrite_field_name_f(file_id,dsetname1,field_names(4),start,nrecords,type_sizer,& + bufr,errcode) + + !------------------------------------------------------------------------- + ! read field + !------------------------------------------------------------------------- + + ! Read an invalid field, should fail + CALL h5tbread_field_name_f(file_id,dsetname1,'DoesNotExist',start,nrecords,type_sizec,& + bufsr,errcode) + + IF(errcode.GE.0)THEN + PRINT *, 'error in h5tbread_field_name_f' + CALL h5fclose_f(file_id, errcode) + CALL h5close_f(errcode) + STOP + ENDIF + + ! Read a valid field, should pass + CALL h5tbread_field_name_f(file_id,dsetname1,field_names(1),start,nrecords,type_sizec,& + bufsr,errcode) + IF(errcode.LT.0)THEN + PRINT *, 'error in h5tbread_field_name_f' + CALL h5fclose_f(file_id, errcode) + CALL h5close_f(errcode) + STOP + ENDIF + + ! + ! compare read and write buffers. + ! + DO i = 1, nrecords + IF ( bufsr(i) .NE. bufs(i) ) THEN + PRINT *, 'read buffer differs from write buffer' + PRINT *, bufsr(i), ' and ', bufs(i) + STOP + ENDIF + END DO + + CALL h5tbread_field_name_f(file_id,dsetname1,field_names(2),start,nrecords,type_sizei,& + bufir,errcode) + + ! + ! compare read and write buffers. + ! + DO i = 1, nrecords + IF ( bufir(i) .NE. bufi(i) ) THEN + PRINT *, 'read buffer differs from write buffer' + PRINT *, bufir(i), ' and ', bufi(i) + STOP + ENDIF + END DO + + IF(exclude_double)THEN + + CALL h5tbread_field_name_f(file_id,dsetname1,field_names(3),start,nrecords,type_sized,& + bufrr,errcode) + + ! + ! compare read and write buffers. + ! + DO i = 1, nrecords + IF ( bufrr(i) .NE. bufr(i) ) THEN + PRINT *, 'read buffer differs from write buffer' + PRINT *, bufrr(i), ' and ', bufr(i) + STOP + ENDIF + END DO + + ELSE + CALL h5tbread_field_name_f(file_id,dsetname1,field_names(3),start,nrecords,type_sized,& + bufdr,errcode) + + ! + ! compare read and write buffers. + ! + DO i = 1, nrecords + IF ( bufdr(i) .NE. bufd(i) ) THEN + PRINT *, 'read buffer differs from write buffer' + PRINT *, bufdr(i), ' and ', bufd(i) + STOP + ENDIF + END DO + ENDIF + + + + CALL h5tbread_field_name_f(file_id,dsetname1,field_names(4),start,nrecords,type_sizer,& + bufrr,errcode) + + ! + ! compare read and write buffers. + ! + DO i = 1, nrecords + IF ( bufrr(i) .NE. bufr(i) ) THEN + PRINT *, 'read buffer differs from write buffer' + PRINT *, bufrr(i), ' and ', bufr(i) + STOP + ENDIF + END DO + + CALL passed() + + + !------------------------------------------------------------------------- + ! write field + !------------------------------------------------------------------------- + + CALL test_begin(' Read/Write field by index ') + + CALL h5tbwrite_field_index_f(file_id,dsetname1,1,start,nrecords,type_sizec,& + bufs,errcode) + + CALL h5tbwrite_field_index_f(file_id,dsetname1,2,start,nrecords,type_sizei,& + bufi,errcode) + + IF(exclude_double)THEN + CALL h5tbwrite_field_index_f(file_id,dsetname1,3,start,nrecords,type_sized,& + bufr,errcode) + ELSE + CALL h5tbwrite_field_index_f(file_id,dsetname1,3,start,nrecords,type_sized,& + bufd,errcode) + ENDIF + + CALL h5tbwrite_field_index_f(file_id,dsetname1,4,start,nrecords,type_sizer,& + bufr,errcode) + + + + !------------------------------------------------------------------------- + ! read field + !------------------------------------------------------------------------- + + CALL h5tbread_field_index_f(file_id,dsetname1,1,start,nrecords,type_sizec,& + bufsr,errcode) + + ! + ! compare read and write buffers. + ! + DO i = 1, nrecords + IF ( bufsr(i) .NE. bufs(i) ) THEN + PRINT *, 'read buffer differs from write buffer' + PRINT *, bufsr(i), ' and ', bufs(i) + STOP + ENDIF + END DO + + CALL h5tbread_field_index_f(file_id,dsetname1,2,start,nrecords,type_sizei,& + bufir,errcode) + + ! + ! compare read and write buffers. + ! + DO i = 1, nrecords + IF ( bufir(i) .NE. bufi(i) ) THEN + PRINT *, 'read buffer differs from write buffer' + PRINT *, bufir(i), ' and ', bufi(i) + STOP + ENDIF + END DO + IF(exclude_double)THEN + CALL h5tbread_field_index_f(file_id,dsetname1,3,start,nrecords,type_sized,& + bufrr,errcode) + + ! + ! compare read and write buffers. + ! + DO i = 1, nrecords + IF ( bufrr(i) .NE. bufr(i) ) THEN + PRINT *, 'read buffer differs from write buffer' + PRINT *, bufrr(i), ' and ', bufr(i) + STOP + ENDIF + END DO + ELSE + CALL h5tbread_field_index_f(file_id,dsetname1,3,start,nrecords,type_sized,& + bufdr,errcode) + + ! + ! compare read and write buffers. + ! + DO i = 1, nrecords + IF ( bufdr(i) .NE. bufd(i) ) THEN + PRINT *, 'read buffer differs from write buffer' + PRINT *, bufdr(i), ' and ', bufd(i) + STOP + ENDIF + END DO + ENDIF + + CALL h5tbread_field_index_f(file_id,dsetname1,4,start,nrecords,type_sizer,& + bufrr,errcode) + + ! + ! compare read and write buffers. + ! + DO i = 1, nrecords + IF ( bufrr(i) .NE. bufr(i) ) THEN + PRINT *, 'read buffer differs from write buffer' + PRINT *, bufrr(i), ' and ', bufr(i) + STOP + ENDIF + END DO + + + CALL passed() + + + !------------------------------------------------------------------------- + ! Insert field + ! we insert a field callsed "field5" with the same type and buffer as field 4 (Real) + !------------------------------------------------------------------------- + + CALL test_begin(' Insert field ') + + CALL h5tbinsert_field_f(file_id,dsetname1,"field5",field_types(4),4,bufr,errcode) + CALL h5tbread_field_index_f(file_id,dsetname1,5,start,nrecords,type_sizer,& + bufrr,errcode) + ! + ! compare read and write buffers. + ! + DO i = 1, nrecords + IF ( bufrr(i) .NE. bufr(i) ) THEN + PRINT *, 'read buffer differs from write buffer' + PRINT *, bufrr(i), ' and ', bufr(i) + STOP + ENDIF + END DO + + + CALL passed() + + !------------------------------------------------------------------------- + ! Delete field + !------------------------------------------------------------------------- + + CALL test_begin(' Delete field ') + + CALL h5tbdelete_field_f(file_id,dsetname1,"field4abc",errcode) + + CALL passed() + + + !------------------------------------------------------------------------- + ! Gets the number of records and fields + !------------------------------------------------------------------------- + + CALL test_begin(' Get table info ') + + CALL h5tbget_table_info_f(file_id,dsetname1,nfieldsr,nrecordsr,errcode ) + + IF ( nfieldsr .NE. nfields .AND. nrecordsr .NE. nrecords ) THEN + PRINT *, 'h5tbget_table_info_f return error' + STOP + ENDIF + + CALL passed() + + !------------------------------------------------------------------------- + ! Get information about fields + !------------------------------------------------------------------------- + + CALL test_begin(' Get fields info ') + + CALL h5tbget_field_info_f(file_id, dsetname1, nfields, field_namesr, field_sizesr,& + field_offsetr, type_sizeout, errcode, maxlen ) + + IF ( errcode.NE.0 ) THEN + WRITE(*,'(/,5X,"H5TBGET_FIELD_INFO_F: RETURN ERROR")') + STOP + ENDIF + + ! "field4abc" was deleted and "field5" was added. + field_names(4) = "field5" + + IF ( maxlen .NE. 8 ) THEN + WRITE(*,'(/,5X,"H5TBGET_FIELD_INFO_F: INCORRECT MAXIMUM CHARACTER LENGTH OF THE FIELD NAMES")') + WRITE(*,'(5X,"RETURNED VALUE = ", I0, ", CORRECT VALUE = ", I0)') maxlen, 8 + STOP + ENDIF + + DO i = 1, nfields + IF ( field_namesr(i) .NE. field_names(i)) THEN + WRITE(*,'(/,5X,"H5TBGET_FIELD_INFO_F: READ/WRITE FIELD NAMES DIFFER")') + WRITE(*,'(27X,A," AND ",A)') TRIM(field_namesr(i)), TRIM(field_names(i)) + STOP + ENDIF + END DO + + CALL passed() + + + !------------------------------------------------------------------------- + ! end + !------------------------------------------------------------------------- + + ! + ! Close the file. + ! + CALL h5fclose_f(file_id, errcode) + + ! + ! Close FORTRAN predefined datatypes. + ! + CALL h5close_f(errcode) + + ! + ! end function. + ! +END SUBROUTINE test_table1 + + +!------------------------------------------------------------------------- +! test_begin +!------------------------------------------------------------------------- + +SUBROUTINE test_begin(string) + CHARACTER(LEN=*), INTENT(IN) :: string + WRITE(*, fmt = '(14a)', advance = 'no') string + WRITE(*, fmt = '(40x,a)', advance = 'no') ' ' +END SUBROUTINE test_begin + +!------------------------------------------------------------------------- +! passed +!------------------------------------------------------------------------- + +SUBROUTINE passed() + WRITE(*, fmt = '(6a)') 'PASSED' +END SUBROUTINE passed + + diff --git a/hl/fortran/test/tsttable.f90 b/hl/fortran/test/tsttable.f90 deleted file mode 100644 index bb88abf..0000000 --- a/hl/fortran/test/tsttable.f90 +++ /dev/null @@ -1,466 +0,0 @@ -! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -! 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. * -! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -! -! -! This file contains the FORTRAN90 tests for H5LT -! - -PROGRAM table_test - - CALL test_table1() - - -END PROGRAM table_test - - -!------------------------------------------------------------------------- -! test_table1 -!------------------------------------------------------------------------- - -SUBROUTINE test_table1() - - USE H5TB ! module of H5TB - USE HDF5 ! module of HDF5 library - - IMPLICIT NONE - - CHARACTER(len=8), PARAMETER :: filename = "f1tab.h5" ! File name - CHARACTER(LEN=5), PARAMETER :: dsetname1 = "dset1" ! Dataset name - INTEGER(HID_T) :: file_id ! File identifier - INTEGER(HSIZE_T), PARAMETER :: nfields = 4 ! nfields - INTEGER(HSIZE_T), PARAMETER :: nrecords = 5 ! nrecords - CHARACTER(LEN=10),DIMENSION(1:nfields) :: field_names ! field names - INTEGER(SIZE_T), DIMENSION(1:nfields) :: field_offset ! field offset - INTEGER(HID_T), DIMENSION(1:nfields) :: field_types ! field types - INTEGER(HSIZE_T), PARAMETER :: chunk_size = 5 ! chunk size - INTEGER, PARAMETER :: compress = 0 ! compress - INTEGER :: errcode = 0 ! Error flag - INTEGER :: i ! general purpose integer - INTEGER(SIZE_T) :: type_size ! Size of the datatype - INTEGER(SIZE_T) :: type_sizec ! Size of the character datatype - INTEGER(SIZE_T) :: type_sizei ! Size of the integer datatype - INTEGER(SIZE_T) :: type_sized ! Size of the double precision datatype - INTEGER(SIZE_T) :: type_sizer ! Size of the real datatype - INTEGER(HID_T) :: type_id_c ! Memory datatype identifier (for character field) - INTEGER(SIZE_T) :: offset ! Member's offset - INTEGER(HSIZE_T) :: start = 0 ! start record - INTEGER, DIMENSION(nrecords) :: bufi ! Data buffer - INTEGER, DIMENSION(nrecords) :: bufir ! Data buffer - REAL, DIMENSION(nrecords) :: bufr ! Data buffer - REAL, DIMENSION(nrecords) :: bufrr ! Data buffer - DOUBLE PRECISION, DIMENSION(nrecords) :: bufd ! Data buffer - DOUBLE PRECISION, DIMENSION(nrecords) :: bufdr ! Data buffer - CHARACTER(LEN=2), DIMENSION(nrecords), PARAMETER :: bufs = (/"AB","CD","EF","GH","IJ"/) ! Data buffer - CHARACTER(LEN=2), DIMENSION(nrecords) :: bufsr ! Data buffer - INTEGER(HSIZE_T) :: nfieldsr ! nfields - INTEGER(HSIZE_T) :: nrecordsr ! nrecords - CHARACTER(LEN=9), DIMENSION(1:nfields) :: field_namesr ! field names - INTEGER(SIZE_T), DIMENSION(1:nfields) :: field_offsetr ! field offset - INTEGER(SIZE_T), DIMENSION(1:nfields) :: field_sizesr ! field sizes - INTEGER(SIZE_T) :: type_sizeout = 0 ! size of the datatype - INTEGER :: maxlen = 0 ! max chararter length of a field name - - - ! - ! Initialize the data arrays. - ! - DO i = 1, nrecords - bufi(i) = i - bufr(i) = i - bufd(i) = i - END DO - - ! - ! Initialize FORTRAN predefined datatypes. - ! - CALL h5open_f(errcode) - - ! - ! Create a new file using default properties. - ! - CALL h5fcreate_f(filename, H5F_ACC_TRUNC_F, file_id, errcode) - - - !------------------------------------------------------------------------- - ! make table - ! initialize the table parameters - !------------------------------------------------------------------------- - - field_names(1) = "field1" - field_names(2) = "field2a" - field_names(3) = "field3ab" - field_names(4) = "field4abc" - - ! - ! calculate total size by calculating sizes of each member - ! - CALL h5tcopy_f(H5T_NATIVE_CHARACTER, type_id_c, errcode) - type_size = 2 - CALL h5tset_size_f(type_id_c, type_size, errcode) - CALL h5tget_size_f(type_id_c, type_sizec, errcode) - CALL h5tget_size_f(H5T_NATIVE_INTEGER, type_sizei, errcode) - CALL h5tget_size_f(H5T_NATIVE_DOUBLE, type_sized, errcode) - CALL h5tget_size_f(H5T_NATIVE_REAL, type_sizer, errcode) - type_size = type_sizec + type_sizei + type_sized + type_sizer - - ! - ! type ID's - ! - field_types(1) = type_id_c - field_types(2) = H5T_NATIVE_INTEGER - field_types(3) = H5T_NATIVE_DOUBLE - field_types(4) = H5T_NATIVE_REAL - - ! - ! offsets - ! - offset = 0 - field_offset(1) = offset - offset = offset + type_sizec ! Offset of the second memeber is 2 - field_offset(2) = offset - offset = offset + type_sizei ! Offset of the second memeber is 6 - field_offset(3) = offset - offset = offset + type_sized ! Offset of the second memeber is 14 - field_offset(4) = offset - - !------------------------------------------------------------------------- - ! make table - !------------------------------------------------------------------------- - - CALL test_begin(' Make table ') - - CALL h5tbmake_table_f(dsetname1,& - file_id,& - dsetname1,& - nfields,& - nrecords,& - type_size,& - field_names,& - field_offset,& - field_types,& - chunk_size,& - compress,& - errcode ) - - CALL passed() - - - !------------------------------------------------------------------------- - ! write field - !------------------------------------------------------------------------- - - CALL test_begin(' Read/Write field by name ') - - CALL h5tbwrite_field_name_f(file_id,dsetname1,field_names(1),start,nrecords,type_sizec,& - bufs,errcode) - - CALL h5tbwrite_field_name_f(file_id,dsetname1,field_names(2),start,nrecords,type_sizei,& - bufi,errcode) - - CALL h5tbwrite_field_name_f(file_id,dsetname1,field_names(3),start,nrecords,type_sized,& - bufd,errcode) - - CALL h5tbwrite_field_name_f(file_id,dsetname1,field_names(4),start,nrecords,type_sizer,& - bufr,errcode) - - !------------------------------------------------------------------------- - ! read field - !------------------------------------------------------------------------- - - ! Read an invalid field, should fail - CALL h5tbread_field_name_f(file_id,dsetname1,'DoesNotExist',start,nrecords,type_sizec,& - bufsr,errcode) - - IF(errcode.GE.0)THEN - PRINT *, 'error in h5tbread_field_name_f' - CALL h5fclose_f(file_id, errcode) - CALL h5close_f(errcode) - STOP - ENDIF - - ! Read a valid field, should pass - CALL h5tbread_field_name_f(file_id,dsetname1,field_names(1),start,nrecords,type_sizec,& - bufsr,errcode) - IF(errcode.LT.0)THEN - PRINT *, 'error in h5tbread_field_name_f' - CALL h5fclose_f(file_id, errcode) - CALL h5close_f(errcode) - STOP - ENDIF - - ! - ! compare read and write buffers. - ! - DO i = 1, nrecords - IF ( bufsr(i) .NE. bufs(i) ) THEN - PRINT *, 'read buffer differs from write buffer' - PRINT *, bufsr(i), ' and ', bufs(i) - STOP - ENDIF - END DO - - CALL h5tbread_field_name_f(file_id,dsetname1,field_names(2),start,nrecords,type_sizei,& - bufir,errcode) - - - ! - ! compare read and write buffers. - ! - DO i = 1, nrecords - IF ( bufir(i) .NE. bufi(i) ) THEN - PRINT *, 'read buffer differs from write buffer' - PRINT *, bufir(i), ' and ', bufi(i) - STOP - ENDIF - END DO - - CALL h5tbread_field_name_f(file_id,dsetname1,field_names(3),start,nrecords,type_sized,& - bufdr,errcode) - - ! - ! compare read and write buffers. - ! - DO i = 1, nrecords - IF ( bufdr(i) .NE. bufd(i) ) THEN - PRINT *, 'read buffer differs from write buffer' - PRINT *, bufdr(i), ' and ', bufd(i) - STOP - ENDIF - END DO - - CALL h5tbread_field_name_f(file_id,dsetname1,field_names(4),start,nrecords,type_sizer,& - bufrr,errcode) - - ! - ! compare read and write buffers. - ! - DO i = 1, nrecords - IF ( bufrr(i) .NE. bufr(i) ) THEN - PRINT *, 'read buffer differs from write buffer' - PRINT *, bufrr(i), ' and ', bufr(i) - STOP - ENDIF - END DO - - - CALL passed() - - !------------------------------------------------------------------------- - ! write field - !------------------------------------------------------------------------- - - CALL test_begin(' Read/Write field by index ') - - CALL h5tbwrite_field_index_f(file_id,dsetname1,1,start,nrecords,type_sizec,& - bufs,errcode) - - CALL h5tbwrite_field_index_f(file_id,dsetname1,2,start,nrecords,type_sizei,& - bufi,errcode) - - CALL h5tbwrite_field_index_f(file_id,dsetname1,3,start,nrecords,type_sized,& - bufd,errcode) - - CALL h5tbwrite_field_index_f(file_id,dsetname1,4,start,nrecords,type_sizer,& - bufr,errcode) - - - - !------------------------------------------------------------------------- - ! read field - !------------------------------------------------------------------------- - - CALL h5tbread_field_index_f(file_id,dsetname1,1,start,nrecords,type_sizec,& - bufsr,errcode) - - ! - ! compare read and write buffers. - ! - DO i = 1, nrecords - IF ( bufsr(i) .NE. bufs(i) ) THEN - PRINT *, 'read buffer differs from write buffer' - PRINT *, bufsr(i), ' and ', bufs(i) - STOP - ENDIF - END DO - - CALL h5tbread_field_index_f(file_id,dsetname1,2,start,nrecords,type_sizei,& - bufir,errcode) - - ! - ! compare read and write buffers. - ! - DO i = 1, nrecords - IF ( bufir(i) .NE. bufi(i) ) THEN - PRINT *, 'read buffer differs from write buffer' - PRINT *, bufir(i), ' and ', bufi(i) - STOP - ENDIF - END DO - - CALL h5tbread_field_index_f(file_id,dsetname1,3,start,nrecords,type_sized,& - bufdr,errcode) - - ! - ! compare read and write buffers. - ! - DO i = 1, nrecords - IF ( bufdr(i) .NE. bufd(i) ) THEN - PRINT *, 'read buffer differs from write buffer' - PRINT *, bufdr(i), ' and ', bufd(i) - STOP - ENDIF - END DO - - CALL h5tbread_field_index_f(file_id,dsetname1,4,start,nrecords,type_sizer,& - bufrr,errcode) - - ! - ! compare read and write buffers. - ! - DO i = 1, nrecords - IF ( bufrr(i) .NE. bufr(i) ) THEN - PRINT *, 'read buffer differs from write buffer' - PRINT *, bufrr(i), ' and ', bufr(i) - STOP - ENDIF - END DO - - - CALL passed() - - - !------------------------------------------------------------------------- - ! Insert field - ! we insert a field callsed "field5" with the same type and buffer as field 4 (Real) - !------------------------------------------------------------------------- - - CALL test_begin(' Insert field ') - - CALL h5tbinsert_field_f(file_id,dsetname1,"field5",field_types(4),4,bufr,errcode) - CALL h5tbread_field_index_f(file_id,dsetname1,5,start,nrecords,type_sizer,& - bufrr,errcode) - ! - ! compare read and write buffers. - ! - DO i = 1, nrecords - IF ( bufrr(i) .NE. bufr(i) ) THEN - PRINT *, 'read buffer differs from write buffer' - PRINT *, bufrr(i), ' and ', bufr(i) - STOP - ENDIF - END DO - - - CALL passed() - - !------------------------------------------------------------------------- - ! Delete field - !------------------------------------------------------------------------- - - CALL test_begin(' Delete field ') - - CALL h5tbdelete_field_f(file_id,dsetname1,"field4abc",errcode) - - CALL passed() - - - !------------------------------------------------------------------------- - ! Gets the number of records and fields - !------------------------------------------------------------------------- - - CALL test_begin(' Get table info ') - - CALL h5tbget_table_info_f(file_id,dsetname1,nfieldsr,nrecordsr,errcode ) - - IF ( nfieldsr .NE. nfields .AND. nrecordsr .NE. nrecords ) THEN - PRINT *, 'h5tbget_table_info_f return error' - STOP - ENDIF - - CALL passed() - - !------------------------------------------------------------------------- - ! Get information about fields - !------------------------------------------------------------------------- - - CALL test_begin(' Get fields info ') - - CALL h5tbget_field_info_f(file_id, dsetname1, nfields, field_namesr, field_sizesr,& - field_offsetr, type_sizeout, errcode, maxlen ) - - IF ( errcode.NE.0 ) THEN - WRITE(*,'(/,5X,"H5TBGET_FIELD_INFO_F: RETURN ERROR")') - STOP - ENDIF - - ! "field4abc" was deleted and "field5" was added. - field_names(4) = "field5" - - IF ( maxlen .NE. 8 ) THEN - WRITE(*,'(/,5X,"H5TBGET_FIELD_INFO_F: INCORRECT MAXIMUM CHARACTER LENGTH OF THE FIELD NAMES")') - WRITE(*,'(5X,"RETURNED VALUE = ", I0, ", CORRECT VALUE = ", I0)') maxlen, 8 - STOP - ENDIF - - DO i = 1, nfields - IF ( field_namesr(i) .NE. field_names(i)) THEN - WRITE(*,'(/,5X,"H5TBGET_FIELD_INFO_F: READ/WRITE FIELD NAMES DIFFER")') - WRITE(*,'(27X,A," AND ",A)') TRIM(field_namesr(i)), TRIM(field_names(i)) - STOP - ENDIF - END DO - - CALL passed() - - - !------------------------------------------------------------------------- - ! end - !------------------------------------------------------------------------- - - ! - ! Close the file. - ! - CALL h5fclose_f(file_id, errcode) - - ! - ! Close FORTRAN predefined datatypes. - ! - CALL h5close_f(errcode) - - ! - ! end function. - ! -END SUBROUTINE test_table1 - - -!------------------------------------------------------------------------- -! test_begin -!------------------------------------------------------------------------- - -SUBROUTINE test_begin(string) - CHARACTER(LEN=*), INTENT(IN) :: string - WRITE(*, fmt = '(14a)', advance = 'no') string - WRITE(*, fmt = '(40x,a)', advance = 'no') ' ' -END SUBROUTINE test_begin - -!------------------------------------------------------------------------- -! passed -!------------------------------------------------------------------------- - -SUBROUTINE passed() - WRITE(*, fmt = '(6a)') 'PASSED' -END SUBROUTINE passed - - diff --git a/hl/src/Makefile.in b/hl/src/Makefile.in index d5b0b1e..8039d15 100644 --- a/hl/src/Makefile.in +++ b/hl/src/Makefile.in @@ -110,7 +110,8 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/aclocal_cxx.m4 \ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/bin/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/src/H5config.h +CONFIG_HEADER = $(top_builddir)/src/H5config.h \ + $(top_builddir)/fortran/src/H5config_f.inc CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; @@ -165,7 +166,7 @@ AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = -DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src -I$(top_builddir)/fortran/src depcomp = $(SHELL) $(top_srcdir)/bin/depcomp am__depfiles_maybe = depfiles am__mv = mv -f @@ -450,14 +451,21 @@ F9XMODEXT = @F9XMODEXT@ F9XMODFLAG = @F9XMODFLAG@ F9XSUFFIXFLAG = @F9XSUFFIXFLAG@ FC = @FC@ -FC2003 = @FC2003@ FCFLAGS = @FCFLAGS@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ +FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ +FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ +FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ +H5CONFIG_F_IKIND = @H5CONFIG_F_IKIND@ +H5CONFIG_F_NUM_IKIND = @H5CONFIG_F_NUM_IKIND@ +H5CONFIG_F_NUM_RKIND = @H5CONFIG_F_NUM_RKIND@ +H5CONFIG_F_RKIND = @H5CONFIG_F_RKIND@ +H5CONFIG_F_RKIND_SIZEOF = @H5CONFIG_F_RKIND_SIZEOF@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ @@ -467,13 +475,12 @@ H5_LDFLAGS = @H5_LDFLAGS@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ -HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_Fortran_INTEGER_SIZEOF_16 = @HAVE_Fortran_INTEGER_SIZEOF_16@ HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ HDF_FORTRAN = @HDF_FORTRAN@ -HDF_FORTRAN2003 = @HDF_FORTRAN2003@ HID_T = @HID_T@ HL = @HL@ HL_FOR = @HL_FOR@ @@ -515,6 +522,18 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PAC_C_MAX_REAL_PRECISION = @PAC_C_MAX_REAL_PRECISION@ +PAC_FC_ALL_INTEGER_KINDS = @PAC_FC_ALL_INTEGER_KINDS@ +PAC_FC_ALL_INTEGER_KINDS_SIZEOF = @PAC_FC_ALL_INTEGER_KINDS_SIZEOF@ +PAC_FC_ALL_REAL_KINDS = @PAC_FC_ALL_REAL_KINDS@ +PAC_FC_ALL_REAL_KINDS_SIZEOF = @PAC_FC_ALL_REAL_KINDS_SIZEOF@ +PAC_FC_MAX_REAL_PRECISION = @PAC_FC_MAX_REAL_PRECISION@ +PAC_FORTRAN_NATIVE_DOUBLE_KIND = @PAC_FORTRAN_NATIVE_DOUBLE_KIND@ +PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF = @PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF@ +PAC_FORTRAN_NATIVE_INTEGER_KIND = @PAC_FORTRAN_NATIVE_INTEGER_KIND@ +PAC_FORTRAN_NATIVE_INTEGER_SIZEOF = @PAC_FORTRAN_NATIVE_INTEGER_SIZEOF@ +PAC_FORTRAN_NATIVE_REAL_KIND = @PAC_FORTRAN_NATIVE_REAL_KIND@ +PAC_FORTRAN_NATIVE_REAL_SIZEOF = @PAC_FORTRAN_NATIVE_REAL_SIZEOF@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ diff --git a/hl/test/Makefile.in b/hl/test/Makefile.in index 6fc324b..4614152 100644 --- a/hl/test/Makefile.in +++ b/hl/test/Makefile.in @@ -112,7 +112,8 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/aclocal_cxx.m4 \ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/bin/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/src/H5config.h +CONFIG_HEADER = $(top_builddir)/src/H5config.h \ + $(top_builddir)/fortran/src/H5config_f.inc CONFIG_CLEAN_FILES = H5srcdir_str.h CONFIG_CLEAN_VPATH_FILES = am__EXEEXT_1 = test_lite$(EXEEXT) test_image$(EXEEXT) \ @@ -168,7 +169,7 @@ AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = -DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src -I$(top_builddir)/fortran/src depcomp = $(SHELL) $(top_srcdir)/bin/depcomp am__depfiles_maybe = depfiles am__mv = mv -f @@ -487,14 +488,21 @@ F9XMODEXT = @F9XMODEXT@ F9XMODFLAG = @F9XMODFLAG@ F9XSUFFIXFLAG = @F9XSUFFIXFLAG@ FC = @FC@ -FC2003 = @FC2003@ FCFLAGS = @FCFLAGS@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ +FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ +FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ +FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ +H5CONFIG_F_IKIND = @H5CONFIG_F_IKIND@ +H5CONFIG_F_NUM_IKIND = @H5CONFIG_F_NUM_IKIND@ +H5CONFIG_F_NUM_RKIND = @H5CONFIG_F_NUM_RKIND@ +H5CONFIG_F_RKIND = @H5CONFIG_F_RKIND@ +H5CONFIG_F_RKIND_SIZEOF = @H5CONFIG_F_RKIND_SIZEOF@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ @@ -504,13 +512,12 @@ H5_LDFLAGS = @H5_LDFLAGS@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ -HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_Fortran_INTEGER_SIZEOF_16 = @HAVE_Fortran_INTEGER_SIZEOF_16@ HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ HDF_FORTRAN = @HDF_FORTRAN@ -HDF_FORTRAN2003 = @HDF_FORTRAN2003@ HID_T = @HID_T@ HL = @HL@ HL_FOR = @HL_FOR@ @@ -552,6 +559,18 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PAC_C_MAX_REAL_PRECISION = @PAC_C_MAX_REAL_PRECISION@ +PAC_FC_ALL_INTEGER_KINDS = @PAC_FC_ALL_INTEGER_KINDS@ +PAC_FC_ALL_INTEGER_KINDS_SIZEOF = @PAC_FC_ALL_INTEGER_KINDS_SIZEOF@ +PAC_FC_ALL_REAL_KINDS = @PAC_FC_ALL_REAL_KINDS@ +PAC_FC_ALL_REAL_KINDS_SIZEOF = @PAC_FC_ALL_REAL_KINDS_SIZEOF@ +PAC_FC_MAX_REAL_PRECISION = @PAC_FC_MAX_REAL_PRECISION@ +PAC_FORTRAN_NATIVE_DOUBLE_KIND = @PAC_FORTRAN_NATIVE_DOUBLE_KIND@ +PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF = @PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF@ +PAC_FORTRAN_NATIVE_INTEGER_KIND = @PAC_FORTRAN_NATIVE_INTEGER_KIND@ +PAC_FORTRAN_NATIVE_INTEGER_SIZEOF = @PAC_FORTRAN_NATIVE_INTEGER_SIZEOF@ +PAC_FORTRAN_NATIVE_REAL_KIND = @PAC_FORTRAN_NATIVE_REAL_KIND@ +PAC_FORTRAN_NATIVE_REAL_SIZEOF = @PAC_FORTRAN_NATIVE_REAL_SIZEOF@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ diff --git a/hl/tools/Makefile.in b/hl/tools/Makefile.in index 77049d3..653c273 100644 --- a/hl/tools/Makefile.in +++ b/hl/tools/Makefile.in @@ -106,7 +106,8 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/aclocal_cxx.m4 \ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/bin/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/src/H5config.h +CONFIG_HEADER = $(top_builddir)/src/H5config.h \ + $(top_builddir)/fortran/src/H5config_f.inc CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) @@ -449,14 +450,21 @@ F9XMODEXT = @F9XMODEXT@ F9XMODFLAG = @F9XMODFLAG@ F9XSUFFIXFLAG = @F9XSUFFIXFLAG@ FC = @FC@ -FC2003 = @FC2003@ FCFLAGS = @FCFLAGS@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ +FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ +FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ +FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ +H5CONFIG_F_IKIND = @H5CONFIG_F_IKIND@ +H5CONFIG_F_NUM_IKIND = @H5CONFIG_F_NUM_IKIND@ +H5CONFIG_F_NUM_RKIND = @H5CONFIG_F_NUM_RKIND@ +H5CONFIG_F_RKIND = @H5CONFIG_F_RKIND@ +H5CONFIG_F_RKIND_SIZEOF = @H5CONFIG_F_RKIND_SIZEOF@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ @@ -466,13 +474,12 @@ H5_LDFLAGS = @H5_LDFLAGS@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ -HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_Fortran_INTEGER_SIZEOF_16 = @HAVE_Fortran_INTEGER_SIZEOF_16@ HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ HDF_FORTRAN = @HDF_FORTRAN@ -HDF_FORTRAN2003 = @HDF_FORTRAN2003@ HID_T = @HID_T@ HL = @HL@ HL_FOR = @HL_FOR@ @@ -514,6 +521,18 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PAC_C_MAX_REAL_PRECISION = @PAC_C_MAX_REAL_PRECISION@ +PAC_FC_ALL_INTEGER_KINDS = @PAC_FC_ALL_INTEGER_KINDS@ +PAC_FC_ALL_INTEGER_KINDS_SIZEOF = @PAC_FC_ALL_INTEGER_KINDS_SIZEOF@ +PAC_FC_ALL_REAL_KINDS = @PAC_FC_ALL_REAL_KINDS@ +PAC_FC_ALL_REAL_KINDS_SIZEOF = @PAC_FC_ALL_REAL_KINDS_SIZEOF@ +PAC_FC_MAX_REAL_PRECISION = @PAC_FC_MAX_REAL_PRECISION@ +PAC_FORTRAN_NATIVE_DOUBLE_KIND = @PAC_FORTRAN_NATIVE_DOUBLE_KIND@ +PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF = @PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF@ +PAC_FORTRAN_NATIVE_INTEGER_KIND = @PAC_FORTRAN_NATIVE_INTEGER_KIND@ +PAC_FORTRAN_NATIVE_INTEGER_SIZEOF = @PAC_FORTRAN_NATIVE_INTEGER_SIZEOF@ +PAC_FORTRAN_NATIVE_REAL_KIND = @PAC_FORTRAN_NATIVE_REAL_KIND@ +PAC_FORTRAN_NATIVE_REAL_SIZEOF = @PAC_FORTRAN_NATIVE_REAL_SIZEOF@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ diff --git a/hl/tools/gif2h5/Makefile.in b/hl/tools/gif2h5/Makefile.in index 3da84e1..6ebf126 100644 --- a/hl/tools/gif2h5/Makefile.in +++ b/hl/tools/gif2h5/Makefile.in @@ -110,7 +110,8 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/aclocal_cxx.m4 \ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/bin/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/src/H5config.h +CONFIG_HEADER = $(top_builddir)/src/H5config.h \ + $(top_builddir)/fortran/src/H5config_f.inc CONFIG_CLEAN_FILES = h52giftest.sh CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" @@ -150,7 +151,7 @@ AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = -DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src -I$(top_builddir)/fortran/src depcomp = $(SHELL) $(top_srcdir)/bin/depcomp am__depfiles_maybe = depfiles am__mv = mv -f @@ -463,14 +464,21 @@ F9XMODEXT = @F9XMODEXT@ F9XMODFLAG = @F9XMODFLAG@ F9XSUFFIXFLAG = @F9XSUFFIXFLAG@ FC = @FC@ -FC2003 = @FC2003@ FCFLAGS = @FCFLAGS@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ +FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ +FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ +FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ +H5CONFIG_F_IKIND = @H5CONFIG_F_IKIND@ +H5CONFIG_F_NUM_IKIND = @H5CONFIG_F_NUM_IKIND@ +H5CONFIG_F_NUM_RKIND = @H5CONFIG_F_NUM_RKIND@ +H5CONFIG_F_RKIND = @H5CONFIG_F_RKIND@ +H5CONFIG_F_RKIND_SIZEOF = @H5CONFIG_F_RKIND_SIZEOF@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ @@ -480,13 +488,12 @@ H5_LDFLAGS = @H5_LDFLAGS@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ -HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_Fortran_INTEGER_SIZEOF_16 = @HAVE_Fortran_INTEGER_SIZEOF_16@ HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ HDF_FORTRAN = @HDF_FORTRAN@ -HDF_FORTRAN2003 = @HDF_FORTRAN2003@ HID_T = @HID_T@ HL = @HL@ HL_FOR = @HL_FOR@ @@ -528,6 +535,18 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PAC_C_MAX_REAL_PRECISION = @PAC_C_MAX_REAL_PRECISION@ +PAC_FC_ALL_INTEGER_KINDS = @PAC_FC_ALL_INTEGER_KINDS@ +PAC_FC_ALL_INTEGER_KINDS_SIZEOF = @PAC_FC_ALL_INTEGER_KINDS_SIZEOF@ +PAC_FC_ALL_REAL_KINDS = @PAC_FC_ALL_REAL_KINDS@ +PAC_FC_ALL_REAL_KINDS_SIZEOF = @PAC_FC_ALL_REAL_KINDS_SIZEOF@ +PAC_FC_MAX_REAL_PRECISION = @PAC_FC_MAX_REAL_PRECISION@ +PAC_FORTRAN_NATIVE_DOUBLE_KIND = @PAC_FORTRAN_NATIVE_DOUBLE_KIND@ +PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF = @PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF@ +PAC_FORTRAN_NATIVE_INTEGER_KIND = @PAC_FORTRAN_NATIVE_INTEGER_KIND@ +PAC_FORTRAN_NATIVE_INTEGER_SIZEOF = @PAC_FORTRAN_NATIVE_INTEGER_SIZEOF@ +PAC_FORTRAN_NATIVE_REAL_KIND = @PAC_FORTRAN_NATIVE_REAL_KIND@ +PAC_FORTRAN_NATIVE_REAL_SIZEOF = @PAC_FORTRAN_NATIVE_REAL_SIZEOF@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ diff --git a/m4/aclocal_fc.m4 b/m4/aclocal_fc.m4 index cda2fee..b7ce048 100644 --- a/m4/aclocal_fc.m4 +++ b/m4/aclocal_fc.m4 @@ -63,6 +63,20 @@ dnl was required" problem when libtool is also used dnl [1] MPICH.org dnl +dnl See if the fortran compiler supports the intrinsic module "ISO_FORTRAN_ENV" + +AC_DEFUN([PAC_PROG_FC_ISO_FORTRAN_ENV],[ + HAVE_ISO_FORTRAN_ENV="no" + AC_MSG_CHECKING([if Fortran compiler supports intrinsic module ISO_FORTRAN_ENV]) + AC_LINK_IFELSE([AC_LANG_SOURCE([ + PROGRAM main + USE, INTRINSIC :: ISO_FORTRAN_ENV + END PROGRAM + ])],[AC_MSG_RESULT([yes]) + HAVE_ISO_FORTRAN_ENV="yes"], + [AC_MSG_RESULT([no])]) +]) + dnl See if the fortran compiler supports the intrinsic function "SIZEOF" AC_DEFUN([PAC_PROG_FC_SIZEOF],[ @@ -111,38 +125,56 @@ AC_DEFUN([PAC_PROG_FC_STORAGE_SIZE],[ ]) -dnl Check to see if -r8 was specified to determine if we need to -dnl compile the DOUBLE PRECISION interfaces. +dnl Check to see C_LONG_DOUBLE is available + +AC_DEFUN([PAC_PROG_FC_HAVE_C_LONG_DOUBLE],[ + HAVE_C_LONG_DOUBLE_FORTRAN="no" + AC_MSG_CHECKING([if Fortran compiler supports intrinsic C_LONG_DOUBLE]) + AC_LINK_IFELSE([AC_LANG_SOURCE([ + PROGRAM main + USE ISO_C_BINDING + REAL(KIND=C_LONG_DOUBLE) :: d + END PROGRAM + ])], [AC_MSG_RESULT([yes]) + HAVE_C_LONG_DOUBLE_FORTRAN="yes"], + [AC_MSG_RESULT([no])]) +]) + +dnl Check if C_LONG_DOUBLE is different from C_DOUBLE -AC_DEFUN([PAC_PROG_FC_DEFAULT_REALisDBLE],[ - FORTRAN_DEFAULT_REALisDBLE="no" - AC_MSG_CHECKING([if Fortran default REAL is DOUBLE PRECISION]) +if test "X$FORTRAN_HAVE_C_LONG_DOUBLE" = "Xyes"; then +AC_DEFUN([PAC_PROG_FC_C_LONG_DOUBLE_EQ_C_DOUBLE],[ + C_LONG_DOUBLE_IS_UNIQUE_FORTRAN="no" + AC_MSG_CHECKING([if Fortran C_LONG_DOUBLE is different from C_DOUBLE]) AC_COMPILE_IFELSE([AC_LANG_SOURCE([ MODULE type_mod + USE ISO_C_BINDING INTERFACE h5t - MODULE PROCEDURE h5t_real - MODULE PROCEDURE h5t_dble + MODULE PROCEDURE h5t_c_double + MODULE PROCEDURE h5t_c_long_double END INTERFACE CONTAINS - SUBROUTINE h5t_real(r) - REAL :: r - END SUBROUTINE h5t_real - SUBROUTINE h5t_dble(d) - DOUBLE PRECISION :: d - END SUBROUTINE h5t_dble + SUBROUTINE h5t_c_double(r) + REAL(KIND=C_DOUBLE) :: r + END SUBROUTINE h5t_c_double + SUBROUTINE h5t_c_long_double(d) + REAL(KIND=C_LONG_DOUBLE) :: d + END SUBROUTINE h5t_c_long_double END MODULE type_mod PROGRAM main + USE ISO_C_BINDING USE type_mod - REAL :: r - DOUBLE PRECISION :: d + REAL(KIND=C_DOUBLE) :: r + REAL(KIND=C_LONG_DOUBLE) :: d CALL h5t(r) CALL h5t(d) END PROGRAM main - ])], [AC_MSG_RESULT([no])], - [AC_MSG_RESULT([yes]) - FORTRAN_DEFAULT_REALisDBLE="yes"]) + ])], [AC_MSG_RESULT([yes]) + C_LONG_DOUBLE_IS_UNIQUE_FORTRAN="yes"], + [AC_MSG_RESULT([no])]) ]) +fi dnl Checking if the compiler supports the required Fortran 2003 features and dnl disable Fortran 2003 if it does not. @@ -152,7 +184,6 @@ AC_DEFUN([PAC_PROG_FC_HAVE_F2003_REQUIREMENTS],[ dnl -------------------------------------------------------------------- dnl Default for FORTRAN 2003 compliant compilers dnl - HAVE_FORTRAN_2003="no" HAVE_F2003_REQUIREMENTS="no" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[ @@ -280,4 +311,280 @@ dnl Try link a simple MPI program. dnl Change to the C language AC_LANG_POP(Fortran) ]) + +dnl ------------------------------------------------------ +dnl Determine the available KINDs for REALs and INTEGERs +dnl ------------------------------------------------------ +dnl +dnl This is a runtime test. +dnl +AC_DEFUN([PAC_FC_AVAIL_KINDS],[ +AC_LANG_PUSH([Fortran]) +rm -f pac_fconftest.out + +AC_RUN_IFELSE([ + AC_LANG_SOURCE([ + PROGRAM main + IMPLICIT NONE + INTEGER :: ik, k, lastkind, max_decimal_prec + INTEGER :: num_rkinds, num_ikinds + num_ikinds = 0 + lastkind=SELECTED_INT_KIND(1) + OPEN(8, FILE='pac_fconftest.out', form='formatted') + ! Find integer KINDs + DO ik=2,36 + k = SELECTED_INT_KIND(ik) + IF (k .NE. lastkind) THEN + num_ikinds = num_ikinds + 1 + WRITE(8,'(I0)',ADVANCE='NO') lastkind + lastkind = k + IF(k.GT.0) WRITE(8,'(A)',ADVANCE='NO') ',' + ENDIF + IF (k .LE. 0) EXIT + ENDDO + IF (lastkind.NE.-1) THEN + num_ikinds = num_ikinds + 1 + WRITE(8,'(I0)') lastkind + ELSE + WRITE(8,'()') + ENDIF + ! Find real KINDs + num_rkinds = 0 + lastkind=SELECTED_REAL_KIND(1) + max_decimal_prec = 1 + DO ik=2,36 + k = SELECTED_REAL_KIND(ik) + IF (k .NE. lastkind) THEN + num_rkinds = num_rkinds + 1 + WRITE(8,'(I0)',ADVANCE='NO') lastkind + lastkind = k + IF(k.GT.0) WRITE(8,'(A)',ADVANCE='NO') ',' + max_decimal_prec = ik + ENDIF + IF (k .LE. 0) EXIT + ENDDO + IF (lastkind.NE.-1)THEN + num_rkinds = num_rkinds + 1 + WRITE(8,'(I0)') lastkind + ELSE + WRITE(8,'()') + ENDIF + WRITE(8,'(I0)') max_decimal_prec + WRITE(8,'(I0)') num_ikinds + WRITE(8,'(I0)') num_rkinds + END + ]) +],[ + if test -s pac_fconftest.out ; then + dnl The output from the above program will be: + dnl -- LINE 1 -- valid integer kinds (comma seperated list) + dnl -- LINE 2 -- valid real kinds (comma seperated list) + dnl -- LINE 3 -- max decimal precision for reals + dnl -- LINE 4 -- number of valid integer kinds + dnl -- LINE 5 -- number of valid real kinds + + pac_validIntKinds="`perl -ne '$. == 1 && print && exit' pac_fconftest.out`" + pac_validRealKinds="`perl -ne '$. == 2 && print && exit' pac_fconftest.out`" + PAC_FC_MAX_REAL_PRECISION="`perl -ne '$. == 3 && print && exit' pac_fconftest.out`" + AC_DEFINE_UNQUOTED([PAC_FC_MAX_REAL_PRECISION], $PAC_FC_MAX_REAL_PRECISION, [Define Fortran Maximum Real Decimal Precision]) + + PAC_FC_ALL_INTEGER_KINDS="{`echo $pac_validIntKinds`}" + PAC_FC_ALL_REAL_KINDS="{`echo $pac_validRealKinds`}" + + H5CONFIG_F_NUM_IKIND="INTEGER, PARAMETER :: num_ikinds = `perl -ne '$. == 4 && print && exit' pac_fconftest.out`" + H5CONFIG_F_IKIND="INTEGER, DIMENSION(1:num_ikinds) :: ikind = (/`echo $pac_validIntKinds`/)" + H5CONFIG_F_NUM_RKIND="INTEGER, PARAMETER :: num_rkinds = `perl -ne '$. == 5 && print && exit' pac_fconftest.out`" + H5CONFIG_F_RKIND="INTEGER, DIMENSION(1:num_rkinds) :: rkind = (/`echo $pac_validRealKinds`/)" + + AC_DEFINE_UNQUOTED([H5CONFIG_F_NUM_RKIND], $H5CONFIG_F_NUM_RKIND, [Define number of valid Fortran REAL KINDs]) + AC_DEFINE_UNQUOTED([H5CONFIG_F_NUM_IKIND], $H5CONFIG_F_NUM_IKIND, [Define number of valid Fortran INTEGER KINDs]) + AC_DEFINE_UNQUOTED([H5CONFIG_F_RKIND], $H5CONFIG_F_RKIND, [Define valid Fortran REAL KINDs]) + AC_DEFINE_UNQUOTED([H5CONFIG_F_IKIND], $H5CONFIG_F_IKIND, [Define valid Fortran INTEGER KINDs]) + + AC_MSG_CHECKING([for Fortran INTEGER KINDs]) + AC_MSG_RESULT([$PAC_FC_ALL_INTEGER_KINDS]) + AC_MSG_CHECKING([for Fortran REAL KINDs]) + AC_MSG_RESULT([$PAC_FC_ALL_REAL_KINDS]) + AC_MSG_CHECKING([for Fortran REALs maximum decimal precision]) + AC_MSG_RESULT([$PAC_FC_MAX_REAL_PRECISION]) + else + AC_MSG_RESULT([Error]) + AC_MSG_WARN([No output from test program!]) + fi + rm -f pac_fconftest.out +],[ + AC_MSG_RESULT([Error]) + AC_MSG_WARN([Failed to run program to determine available KINDs]) +],[]) + +AC_LANG_POP([Fortran]) +]) +AC_DEFUN([PAC_FC_SIZEOF_INT_KINDS],[ +AC_REQUIRE([PAC_FC_AVAIL_KINDS]) +AC_MSG_CHECKING([sizeof of available INTEGER KINDs]) +AC_LANG_PUSH([Fortran]) +pack_int_sizeof="" +rm -f pac_fconftest.out + +for kind in `echo $pac_validIntKinds | perl -pe 's/,/ /g'`; do + AC_LANG_CONFTEST([ + AC_LANG_SOURCE([ + PROGRAM main + USE ISO_C_BINDING + IMPLICIT NONE + INTEGER (KIND=$kind) a + OPEN(8, FILE='pac_fconftest.out', FORM='formatted') + WRITE(8,'(I0)') $FC_SIZEOF_A + CLOSE(8) + END + ]) + ]) + AC_RUN_IFELSE([],[ + if test -s pac_fconftest.out ; then + sizes="`cat pac_fconftest.out`" + pack_int_sizeof="$pack_int_sizeof $sizes," + else + AC_MSG_WARN([No output from test program!]) + fi + rm -f pac_fconftest.out + ],[ + AC_MSG_WARN([Fortran program fails to build or run!]) + ],[ + pack_int_sizeof="$2" + ]) +done +PAC_FC_ALL_INTEGER_KINDS_SIZEOF="{`echo $pack_int_sizeof | perl -pe 's/,$//' | perl -pe 's/ //g'`}" +AC_MSG_RESULT([$PAC_FC_ALL_INTEGER_KINDS_SIZEOF]) +AC_LANG_POP([Fortran]) +]) + +AC_DEFUN([PAC_FC_SIZEOF_REAL_KINDS],[ +AC_REQUIRE([PAC_FC_AVAIL_KINDS]) +AC_MSG_CHECKING([sizeof of available REAL KINDs]) +AC_LANG_PUSH([Fortran]) +pack_real_sizeof="" +rm -f pac_fconftest.out +for kind in `echo $pac_validRealKinds| perl -pe 's/,/ /g'`; do + AC_LANG_CONFTEST([ + AC_LANG_SOURCE([ + PROGRAM main + USE ISO_C_BINDING + IMPLICIT NONE + REAL (KIND=$kind) :: a + OPEN(8, FILE='pac_fconftest.out', FORM='formatted') + WRITE(8,'(I0)') $FC_SIZEOF_A + CLOSE(8) + END + ]) + ]) + AC_RUN_IFELSE([],[ + if test -s pac_fconftest.out ; then + sizes="`cat pac_fconftest.out`" + pack_real_sizeof="$pack_real_sizeof $sizes," + else + AC_MSG_WARN([No output from test program!]) + fi + rm -f pac_fconftest.out + ],[ + AC_MSG_WARN([Fortran program fails to build or run!]) + ],[ + pack_real_sizeof="$2" + ]) +done +PAC_FC_ALL_REAL_KINDS_SIZEOF="{`echo $pack_real_sizeof | perl -pe 's/,$//' | perl -pe 's/ //g'`}" +AC_MSG_RESULT([$PAC_FC_ALL_REAL_KINDS_SIZEOF]) +AC_LANG_POP([Fortran]) +]) + +AC_DEFUN([PAC_FC_NATIVE_INTEGER],[ +AC_REQUIRE([PAC_FC_AVAIL_KINDS]) +AC_MSG_CHECKING([sizeof of native KINDS]) +AC_LANG_PUSH([Fortran]) +pack_int_sizeof="" +rm -f pac_fconftest.out + AC_LANG_CONFTEST([ + AC_LANG_SOURCE([ + PROGRAM main + USE ISO_C_BINDING + IMPLICIT NONE + INTEGER a + REAL b + DOUBLE PRECISION c + OPEN(8, FILE='pac_fconftest.out', FORM='formatted') + WRITE(8,*) $FC_SIZEOF_A + WRITE(8,*) kind(a) + WRITE(8,*) $FC_SIZEOF_B + WRITE(8,*) kind(b) + WRITE(8,*) $FC_SIZEOF_C + WRITE(8,*) kind(c) + CLOSE(8) + END + ]) + ]) + AC_RUN_IFELSE([],[ + if test -s pac_fconftest.out ; then + PAC_FORTRAN_NATIVE_INTEGER_KIND="`perl -ne '$. == 1 && print && exit' pac_fconftest.out`" + PAC_FORTRAN_NATIVE_INTEGER_SIZEOF="`perl -ne '$. == 2 && print && exit' pac_fconftest.out`" + PAC_FORTRAN_NATIVE_REAL_KIND="`perl -ne '$. == 3 && print && exit' pac_fconftest.out`" + PAC_FORTRAN_NATIVE_REAL_SIZEOF="`perl -ne '$. == 4 && print && exit' pac_fconftest.out`" + PAC_FORTRAN_NATIVE_DOUBLE_KIND="`perl -ne '$. == 5 && print && exit' pac_fconftest.out`" + PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF="`perl -ne '$. == 6 && print && exit' pac_fconftest.out`" + else + AC_MSG_WARN([No output from test program!]) + fi + rm -f pac_fconftest.out + ],[ + AC_MSG_WARN([Fortran program fails to build or run!]) + ],[ + pack_int_sizeof="$2" + ]) +AC_MSG_RESULT([$pack_int_sizeof]) +AC_LANG_POP([Fortran]) +]) + +AC_DEFUN([PAC_FC_LDBL_DIG],[ +AC_MSG_CHECKING([maximum decimal precision for C]) +rm -f pac_Cconftest.out + AC_LANG_CONFTEST([ + AC_LANG_PROGRAM([ + #include + #include + #define CHECK_FLOAT128 $ac_cv_sizeof___float128 + #if CHECK_FLOAT128!=0 + # if $HAVE_QUADMATH!=0 + #include + # endif + # ifdef FLT128_DIG + #define C_FLT128_DIG FLT128_DIG + # else + #define C_FLT128_DIG 0 + # endif + #else + #define C_FLT128_DIG 0 + #endif + #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define C_LDBL_DIG DECIMAL_DIG + #else + #define C_LDBL_DIG LDBL_DIG + #endif + ],[[ + FILE * pFile; + pFile = fopen("pac_Cconftest.out","w"); + fprintf(pFile, "%d\n%d\n", C_LDBL_DIG, C_FLT128_DIG); + ]]) + ]) + AC_RUN_IFELSE([],[ + if test -s pac_Cconftest.out ; then + LDBL_DIG="`perl -ne '$. == 1 && print && exit' pac_Cconftest.out`" + FLT128_DIG="`perl -ne '$. == 2 && print && exit' pac_Cconftest.out`" + else + AC_MSG_WARN([No output from test program!]) + fi + rm -f pac_Cconftest.out + ],[ + AC_MSG_ERROR([C program fails to build or run!]) + ],[]) +]) + + diff --git a/src/H5config.h.in b/src/H5config.h.in index c0f4466..ad8dcf9 100644 --- a/src/H5config.h.in +++ b/src/H5config.h.in @@ -30,6 +30,39 @@ /* As FC_FUNC, but for C identifiers containing underscores. */ #undef FC_FUNC_ +/* Define if Fortran C_LONG_DOUBLE is different from C_DOUBLE */ +#undef FORTRAN_C_LONG_DOUBLE_IS_UNIQUE + +/* Define if we have Fortran C_LONG_DOUBLE */ +#undef FORTRAN_HAVE_C_LONG_DOUBLE + +/* Define if we have Fortran intrinsic C_SIZEOF */ +#undef FORTRAN_HAVE_C_SIZEOF + +/* Define if we have Fortran intrinsic SIZEOF */ +#undef FORTRAN_HAVE_SIZEOF + +/* Define if we have Fortran intrinsic STORAGE_SIZE */ +#undef FORTRAN_HAVE_STORAGE_SIZE + +/* Determine the size of C long double */ +#undef FORTRAN_SIZEOF_LONG_DOUBLE + +/* Define valid Fortran INTEGER KINDs */ +#undef H5CONFIG_F_IKIND + +/* Define number of valid Fortran INTEGER KINDs */ +#undef H5CONFIG_F_NUM_IKIND + +/* Define number of valid Fortran REAL KINDs */ +#undef H5CONFIG_F_NUM_RKIND + +/* Define valid Fortran REAL KINDs */ +#undef H5CONFIG_F_RKIND + +/* Define valid Fortran REAL KINDs Sizeof */ +#undef H5CONFIG_F_RKIND_SIZEOF + /* Define to 1 if you have the `alarm' function. */ #undef HAVE_ALARM @@ -82,6 +115,9 @@ /* Define if support for szip filter is enabled */ #undef HAVE_FILTER_SZIP +/* Determine if __float128 is available */ +#undef HAVE_FLOAT128 + /* Define to 1 if you have the `fork' function. */ #undef HAVE_FORK @@ -112,6 +148,9 @@ /* Define if the compiler understands the __FUNCTION__ keyword */ #undef HAVE_FUNCTION +/* Determine if INTEGER*16 is available */ +#undef HAVE_Fortran_INTEGER_SIZEOF_16 + /* Define to 1 if you have the `GetConsoleScreenBufferInfo' function. */ #undef HAVE_GETCONSOLESCREENBUFFERINFO @@ -212,6 +251,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_PTHREAD_H +/* Define to 1 if you have the header file. */ +#undef HAVE_QUADMATH_H + /* Define to 1 if you have the `random' function. */ #undef HAVE_RANDOM @@ -418,6 +460,12 @@ /* Define to the version of this package. */ #undef PACKAGE_VERSION +/* Determine the maximum decimal precision in C */ +#undef PAC_C_MAX_REAL_PRECISION + +/* Define Fortran Maximum Real Decimal Precision */ +#undef PAC_FC_MAX_REAL_PRECISION + /* Width for printf() for type `long long' or `__int64', use `ll' */ #undef PRINTF_LL_WIDTH @@ -535,6 +583,12 @@ /* The size of `unsigned', as computed by sizeof. */ #undef SIZEOF_UNSIGNED +/* The size of `_Quad', as computed by sizeof. */ +#undef SIZEOF__QUAD + +/* The size of `__float128', as computed by sizeof. */ +#undef SIZEOF___FLOAT128 + /* The size of `__int64', as computed by sizeof. */ #undef SIZEOF___INT64 diff --git a/src/Makefile.in b/src/Makefile.in index 8a60a77..5f2ef19 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -114,7 +114,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/aclocal_cxx.m4 \ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/bin/mkinstalldirs -CONFIG_HEADER = H5config.h +CONFIG_HEADER = H5config.h $(top_builddir)/fortran/src/H5config_f.inc CONFIG_CLEAN_FILES = libhdf5.settings CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; @@ -228,7 +228,7 @@ AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = -DEFAULT_INCLUDES = -I.@am__isrc@ +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/fortran/src depcomp = $(SHELL) $(top_srcdir)/bin/depcomp am__depfiles_maybe = depfiles am__mv = mv -f @@ -513,14 +513,21 @@ F9XMODEXT = @F9XMODEXT@ F9XMODFLAG = @F9XMODFLAG@ F9XSUFFIXFLAG = @F9XSUFFIXFLAG@ FC = @FC@ -FC2003 = @FC2003@ FCFLAGS = @FCFLAGS@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ +FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ +FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ +FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ +H5CONFIG_F_IKIND = @H5CONFIG_F_IKIND@ +H5CONFIG_F_NUM_IKIND = @H5CONFIG_F_NUM_IKIND@ +H5CONFIG_F_NUM_RKIND = @H5CONFIG_F_NUM_RKIND@ +H5CONFIG_F_RKIND = @H5CONFIG_F_RKIND@ +H5CONFIG_F_RKIND_SIZEOF = @H5CONFIG_F_RKIND_SIZEOF@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ @@ -530,13 +537,12 @@ H5_LDFLAGS = @H5_LDFLAGS@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ -HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_Fortran_INTEGER_SIZEOF_16 = @HAVE_Fortran_INTEGER_SIZEOF_16@ HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ HDF_FORTRAN = @HDF_FORTRAN@ -HDF_FORTRAN2003 = @HDF_FORTRAN2003@ HID_T = @HID_T@ HL = @HL@ HL_FOR = @HL_FOR@ @@ -578,6 +584,18 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PAC_C_MAX_REAL_PRECISION = @PAC_C_MAX_REAL_PRECISION@ +PAC_FC_ALL_INTEGER_KINDS = @PAC_FC_ALL_INTEGER_KINDS@ +PAC_FC_ALL_INTEGER_KINDS_SIZEOF = @PAC_FC_ALL_INTEGER_KINDS_SIZEOF@ +PAC_FC_ALL_REAL_KINDS = @PAC_FC_ALL_REAL_KINDS@ +PAC_FC_ALL_REAL_KINDS_SIZEOF = @PAC_FC_ALL_REAL_KINDS_SIZEOF@ +PAC_FC_MAX_REAL_PRECISION = @PAC_FC_MAX_REAL_PRECISION@ +PAC_FORTRAN_NATIVE_DOUBLE_KIND = @PAC_FORTRAN_NATIVE_DOUBLE_KIND@ +PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF = @PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF@ +PAC_FORTRAN_NATIVE_INTEGER_KIND = @PAC_FORTRAN_NATIVE_INTEGER_KIND@ +PAC_FORTRAN_NATIVE_INTEGER_SIZEOF = @PAC_FORTRAN_NATIVE_INTEGER_SIZEOF@ +PAC_FORTRAN_NATIVE_REAL_KIND = @PAC_FORTRAN_NATIVE_REAL_KIND@ +PAC_FORTRAN_NATIVE_REAL_SIZEOF = @PAC_FORTRAN_NATIVE_REAL_SIZEOF@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ diff --git a/src/libhdf5.settings.in b/src/libhdf5.settings.in index 1eed645..2355543 100644 --- a/src/libhdf5.settings.in +++ b/src/libhdf5.settings.in @@ -39,7 +39,6 @@ Languages: ---------- Fortran: @HDF_FORTRAN@ @BUILD_FORTRAN_CONDITIONAL_TRUE@ Fortran Compiler: @FC_VERSION@ -@BUILD_FORTRAN_CONDITIONAL_TRUE@ Fortran 2003 Compiler: @HAVE_FORTRAN_2003@ @BUILD_FORTRAN_CONDITIONAL_TRUE@ Fortran Flags: @FCFLAGS@ @BUILD_FORTRAN_CONDITIONAL_TRUE@ H5 Fortran Flags: @H5_FCFLAGS@ @BUILD_FORTRAN_CONDITIONAL_TRUE@ AM Fortran Flags: @AM_FCFLAGS@ diff --git a/test/Makefile.in b/test/Makefile.in index 8b36650..d3f1b86 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -120,7 +120,8 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/aclocal_cxx.m4 \ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/bin/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/src/H5config.h +CONFIG_HEADER = $(top_builddir)/src/H5config.h \ + $(top_builddir)/fortran/src/H5config_f.inc CONFIG_CLEAN_FILES = testcheck_version.sh testerror.sh H5srcdir_str.h \ testlibinfo.sh testlinks_env.sh test_plugin.sh CONFIG_CLEAN_VPATH_FILES = @@ -535,7 +536,7 @@ AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = -DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src -I$(top_builddir)/fortran/src depcomp = $(SHELL) $(top_srcdir)/bin/depcomp am__depfiles_maybe = depfiles am__mv = mv -f @@ -855,14 +856,21 @@ F9XMODEXT = @F9XMODEXT@ F9XMODFLAG = @F9XMODFLAG@ F9XSUFFIXFLAG = @F9XSUFFIXFLAG@ FC = @FC@ -FC2003 = @FC2003@ FCFLAGS = @FCFLAGS@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ +FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ +FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ +FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ +H5CONFIG_F_IKIND = @H5CONFIG_F_IKIND@ +H5CONFIG_F_NUM_IKIND = @H5CONFIG_F_NUM_IKIND@ +H5CONFIG_F_NUM_RKIND = @H5CONFIG_F_NUM_RKIND@ +H5CONFIG_F_RKIND = @H5CONFIG_F_RKIND@ +H5CONFIG_F_RKIND_SIZEOF = @H5CONFIG_F_RKIND_SIZEOF@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ @@ -872,13 +880,12 @@ H5_LDFLAGS = @H5_LDFLAGS@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ -HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_Fortran_INTEGER_SIZEOF_16 = @HAVE_Fortran_INTEGER_SIZEOF_16@ HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ HDF_FORTRAN = @HDF_FORTRAN@ -HDF_FORTRAN2003 = @HDF_FORTRAN2003@ HID_T = @HID_T@ HL = @HL@ HL_FOR = @HL_FOR@ @@ -920,6 +927,18 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PAC_C_MAX_REAL_PRECISION = @PAC_C_MAX_REAL_PRECISION@ +PAC_FC_ALL_INTEGER_KINDS = @PAC_FC_ALL_INTEGER_KINDS@ +PAC_FC_ALL_INTEGER_KINDS_SIZEOF = @PAC_FC_ALL_INTEGER_KINDS_SIZEOF@ +PAC_FC_ALL_REAL_KINDS = @PAC_FC_ALL_REAL_KINDS@ +PAC_FC_ALL_REAL_KINDS_SIZEOF = @PAC_FC_ALL_REAL_KINDS_SIZEOF@ +PAC_FC_MAX_REAL_PRECISION = @PAC_FC_MAX_REAL_PRECISION@ +PAC_FORTRAN_NATIVE_DOUBLE_KIND = @PAC_FORTRAN_NATIVE_DOUBLE_KIND@ +PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF = @PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF@ +PAC_FORTRAN_NATIVE_INTEGER_KIND = @PAC_FORTRAN_NATIVE_INTEGER_KIND@ +PAC_FORTRAN_NATIVE_INTEGER_SIZEOF = @PAC_FORTRAN_NATIVE_INTEGER_SIZEOF@ +PAC_FORTRAN_NATIVE_REAL_KIND = @PAC_FORTRAN_NATIVE_REAL_KIND@ +PAC_FORTRAN_NATIVE_REAL_SIZEOF = @PAC_FORTRAN_NATIVE_REAL_SIZEOF@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ diff --git a/testpar/Makefile.in b/testpar/Makefile.in index dc339cd..5797dfc 100644 --- a/testpar/Makefile.in +++ b/testpar/Makefile.in @@ -108,7 +108,8 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/aclocal_cxx.m4 \ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/bin/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/src/H5config.h +CONFIG_HEADER = $(top_builddir)/src/H5config.h \ + $(top_builddir)/fortran/src/H5config_f.inc CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__EXEEXT_1 = t_mpi$(EXEEXT) testphdf5$(EXEEXT) t_cache$(EXEEXT) \ @@ -170,7 +171,7 @@ AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = -DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src -I$(top_builddir)/fortran/src depcomp = $(SHELL) $(top_srcdir)/bin/depcomp am__depfiles_maybe = depfiles am__mv = mv -f @@ -482,14 +483,21 @@ F9XMODEXT = @F9XMODEXT@ F9XMODFLAG = @F9XMODFLAG@ F9XSUFFIXFLAG = @F9XSUFFIXFLAG@ FC = @FC@ -FC2003 = @FC2003@ FCFLAGS = @FCFLAGS@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ +FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ +FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ +FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ +H5CONFIG_F_IKIND = @H5CONFIG_F_IKIND@ +H5CONFIG_F_NUM_IKIND = @H5CONFIG_F_NUM_IKIND@ +H5CONFIG_F_NUM_RKIND = @H5CONFIG_F_NUM_RKIND@ +H5CONFIG_F_RKIND = @H5CONFIG_F_RKIND@ +H5CONFIG_F_RKIND_SIZEOF = @H5CONFIG_F_RKIND_SIZEOF@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ @@ -499,13 +507,12 @@ H5_LDFLAGS = @H5_LDFLAGS@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ -HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_Fortran_INTEGER_SIZEOF_16 = @HAVE_Fortran_INTEGER_SIZEOF_16@ HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ HDF_FORTRAN = @HDF_FORTRAN@ -HDF_FORTRAN2003 = @HDF_FORTRAN2003@ HID_T = @HID_T@ HL = @HL@ HL_FOR = @HL_FOR@ @@ -547,6 +554,18 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PAC_C_MAX_REAL_PRECISION = @PAC_C_MAX_REAL_PRECISION@ +PAC_FC_ALL_INTEGER_KINDS = @PAC_FC_ALL_INTEGER_KINDS@ +PAC_FC_ALL_INTEGER_KINDS_SIZEOF = @PAC_FC_ALL_INTEGER_KINDS_SIZEOF@ +PAC_FC_ALL_REAL_KINDS = @PAC_FC_ALL_REAL_KINDS@ +PAC_FC_ALL_REAL_KINDS_SIZEOF = @PAC_FC_ALL_REAL_KINDS_SIZEOF@ +PAC_FC_MAX_REAL_PRECISION = @PAC_FC_MAX_REAL_PRECISION@ +PAC_FORTRAN_NATIVE_DOUBLE_KIND = @PAC_FORTRAN_NATIVE_DOUBLE_KIND@ +PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF = @PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF@ +PAC_FORTRAN_NATIVE_INTEGER_KIND = @PAC_FORTRAN_NATIVE_INTEGER_KIND@ +PAC_FORTRAN_NATIVE_INTEGER_SIZEOF = @PAC_FORTRAN_NATIVE_INTEGER_SIZEOF@ +PAC_FORTRAN_NATIVE_REAL_KIND = @PAC_FORTRAN_NATIVE_REAL_KIND@ +PAC_FORTRAN_NATIVE_REAL_SIZEOF = @PAC_FORTRAN_NATIVE_REAL_SIZEOF@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ diff --git a/tools/Makefile.in b/tools/Makefile.in index 974e6b4..0f5684d 100644 --- a/tools/Makefile.in +++ b/tools/Makefile.in @@ -106,7 +106,8 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/aclocal_cxx.m4 \ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/bin/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/src/H5config.h +CONFIG_HEADER = $(top_builddir)/src/H5config.h \ + $(top_builddir)/fortran/src/H5config_f.inc CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) @@ -449,14 +450,21 @@ F9XMODEXT = @F9XMODEXT@ F9XMODFLAG = @F9XMODFLAG@ F9XSUFFIXFLAG = @F9XSUFFIXFLAG@ FC = @FC@ -FC2003 = @FC2003@ FCFLAGS = @FCFLAGS@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ +FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ +FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ +FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ +H5CONFIG_F_IKIND = @H5CONFIG_F_IKIND@ +H5CONFIG_F_NUM_IKIND = @H5CONFIG_F_NUM_IKIND@ +H5CONFIG_F_NUM_RKIND = @H5CONFIG_F_NUM_RKIND@ +H5CONFIG_F_RKIND = @H5CONFIG_F_RKIND@ +H5CONFIG_F_RKIND_SIZEOF = @H5CONFIG_F_RKIND_SIZEOF@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ @@ -466,13 +474,12 @@ H5_LDFLAGS = @H5_LDFLAGS@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ -HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_Fortran_INTEGER_SIZEOF_16 = @HAVE_Fortran_INTEGER_SIZEOF_16@ HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ HDF_FORTRAN = @HDF_FORTRAN@ -HDF_FORTRAN2003 = @HDF_FORTRAN2003@ HID_T = @HID_T@ HL = @HL@ HL_FOR = @HL_FOR@ @@ -514,6 +521,18 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PAC_C_MAX_REAL_PRECISION = @PAC_C_MAX_REAL_PRECISION@ +PAC_FC_ALL_INTEGER_KINDS = @PAC_FC_ALL_INTEGER_KINDS@ +PAC_FC_ALL_INTEGER_KINDS_SIZEOF = @PAC_FC_ALL_INTEGER_KINDS_SIZEOF@ +PAC_FC_ALL_REAL_KINDS = @PAC_FC_ALL_REAL_KINDS@ +PAC_FC_ALL_REAL_KINDS_SIZEOF = @PAC_FC_ALL_REAL_KINDS_SIZEOF@ +PAC_FC_MAX_REAL_PRECISION = @PAC_FC_MAX_REAL_PRECISION@ +PAC_FORTRAN_NATIVE_DOUBLE_KIND = @PAC_FORTRAN_NATIVE_DOUBLE_KIND@ +PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF = @PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF@ +PAC_FORTRAN_NATIVE_INTEGER_KIND = @PAC_FORTRAN_NATIVE_INTEGER_KIND@ +PAC_FORTRAN_NATIVE_INTEGER_SIZEOF = @PAC_FORTRAN_NATIVE_INTEGER_SIZEOF@ +PAC_FORTRAN_NATIVE_REAL_KIND = @PAC_FORTRAN_NATIVE_REAL_KIND@ +PAC_FORTRAN_NATIVE_REAL_SIZEOF = @PAC_FORTRAN_NATIVE_REAL_SIZEOF@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ diff --git a/tools/h5copy/Makefile.in b/tools/h5copy/Makefile.in index e128cfe..1b50662 100644 --- a/tools/h5copy/Makefile.in +++ b/tools/h5copy/Makefile.in @@ -110,7 +110,8 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/aclocal_cxx.m4 \ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/bin/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/src/H5config.h +CONFIG_HEADER = $(top_builddir)/src/H5config.h \ + $(top_builddir)/fortran/src/H5config_f.inc CONFIG_CLEAN_FILES = testh5copy.sh CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" @@ -143,7 +144,7 @@ AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = -DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src -I$(top_builddir)/fortran/src depcomp = $(SHELL) $(top_srcdir)/bin/depcomp am__depfiles_maybe = depfiles am__mv = mv -f @@ -457,14 +458,21 @@ F9XMODEXT = @F9XMODEXT@ F9XMODFLAG = @F9XMODFLAG@ F9XSUFFIXFLAG = @F9XSUFFIXFLAG@ FC = @FC@ -FC2003 = @FC2003@ FCFLAGS = @FCFLAGS@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ +FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ +FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ +FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ +H5CONFIG_F_IKIND = @H5CONFIG_F_IKIND@ +H5CONFIG_F_NUM_IKIND = @H5CONFIG_F_NUM_IKIND@ +H5CONFIG_F_NUM_RKIND = @H5CONFIG_F_NUM_RKIND@ +H5CONFIG_F_RKIND = @H5CONFIG_F_RKIND@ +H5CONFIG_F_RKIND_SIZEOF = @H5CONFIG_F_RKIND_SIZEOF@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ @@ -474,13 +482,12 @@ H5_LDFLAGS = @H5_LDFLAGS@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ -HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_Fortran_INTEGER_SIZEOF_16 = @HAVE_Fortran_INTEGER_SIZEOF_16@ HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ HDF_FORTRAN = @HDF_FORTRAN@ -HDF_FORTRAN2003 = @HDF_FORTRAN2003@ HID_T = @HID_T@ HL = @HL@ HL_FOR = @HL_FOR@ @@ -522,6 +529,18 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PAC_C_MAX_REAL_PRECISION = @PAC_C_MAX_REAL_PRECISION@ +PAC_FC_ALL_INTEGER_KINDS = @PAC_FC_ALL_INTEGER_KINDS@ +PAC_FC_ALL_INTEGER_KINDS_SIZEOF = @PAC_FC_ALL_INTEGER_KINDS_SIZEOF@ +PAC_FC_ALL_REAL_KINDS = @PAC_FC_ALL_REAL_KINDS@ +PAC_FC_ALL_REAL_KINDS_SIZEOF = @PAC_FC_ALL_REAL_KINDS_SIZEOF@ +PAC_FC_MAX_REAL_PRECISION = @PAC_FC_MAX_REAL_PRECISION@ +PAC_FORTRAN_NATIVE_DOUBLE_KIND = @PAC_FORTRAN_NATIVE_DOUBLE_KIND@ +PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF = @PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF@ +PAC_FORTRAN_NATIVE_INTEGER_KIND = @PAC_FORTRAN_NATIVE_INTEGER_KIND@ +PAC_FORTRAN_NATIVE_INTEGER_SIZEOF = @PAC_FORTRAN_NATIVE_INTEGER_SIZEOF@ +PAC_FORTRAN_NATIVE_REAL_KIND = @PAC_FORTRAN_NATIVE_REAL_KIND@ +PAC_FORTRAN_NATIVE_REAL_SIZEOF = @PAC_FORTRAN_NATIVE_REAL_SIZEOF@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ diff --git a/tools/h5diff/Makefile.in b/tools/h5diff/Makefile.in index c95967d..7b4d121 100644 --- a/tools/h5diff/Makefile.in +++ b/tools/h5diff/Makefile.in @@ -110,7 +110,8 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/aclocal_cxx.m4 \ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/bin/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/src/H5config.h +CONFIG_HEADER = $(top_builddir)/src/H5config.h \ + $(top_builddir)/fortran/src/H5config_f.inc CONFIG_CLEAN_FILES = testh5diff.sh testph5diff.sh CONFIG_CLEAN_VPATH_FILES = @BUILD_PARALLEL_CONDITIONAL_TRUE@am__EXEEXT_1 = ph5diff$(EXEEXT) @@ -148,7 +149,7 @@ AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = -DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src -I$(top_builddir)/fortran/src depcomp = $(SHELL) $(top_srcdir)/bin/depcomp am__depfiles_maybe = depfiles am__mv = mv -f @@ -464,14 +465,21 @@ F9XMODEXT = @F9XMODEXT@ F9XMODFLAG = @F9XMODFLAG@ F9XSUFFIXFLAG = @F9XSUFFIXFLAG@ FC = @FC@ -FC2003 = @FC2003@ FCFLAGS = @FCFLAGS@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ +FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ +FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ +FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ +H5CONFIG_F_IKIND = @H5CONFIG_F_IKIND@ +H5CONFIG_F_NUM_IKIND = @H5CONFIG_F_NUM_IKIND@ +H5CONFIG_F_NUM_RKIND = @H5CONFIG_F_NUM_RKIND@ +H5CONFIG_F_RKIND = @H5CONFIG_F_RKIND@ +H5CONFIG_F_RKIND_SIZEOF = @H5CONFIG_F_RKIND_SIZEOF@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ @@ -481,13 +489,12 @@ H5_LDFLAGS = @H5_LDFLAGS@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ -HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_Fortran_INTEGER_SIZEOF_16 = @HAVE_Fortran_INTEGER_SIZEOF_16@ HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ HDF_FORTRAN = @HDF_FORTRAN@ -HDF_FORTRAN2003 = @HDF_FORTRAN2003@ HID_T = @HID_T@ HL = @HL@ HL_FOR = @HL_FOR@ @@ -529,6 +536,18 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PAC_C_MAX_REAL_PRECISION = @PAC_C_MAX_REAL_PRECISION@ +PAC_FC_ALL_INTEGER_KINDS = @PAC_FC_ALL_INTEGER_KINDS@ +PAC_FC_ALL_INTEGER_KINDS_SIZEOF = @PAC_FC_ALL_INTEGER_KINDS_SIZEOF@ +PAC_FC_ALL_REAL_KINDS = @PAC_FC_ALL_REAL_KINDS@ +PAC_FC_ALL_REAL_KINDS_SIZEOF = @PAC_FC_ALL_REAL_KINDS_SIZEOF@ +PAC_FC_MAX_REAL_PRECISION = @PAC_FC_MAX_REAL_PRECISION@ +PAC_FORTRAN_NATIVE_DOUBLE_KIND = @PAC_FORTRAN_NATIVE_DOUBLE_KIND@ +PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF = @PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF@ +PAC_FORTRAN_NATIVE_INTEGER_KIND = @PAC_FORTRAN_NATIVE_INTEGER_KIND@ +PAC_FORTRAN_NATIVE_INTEGER_SIZEOF = @PAC_FORTRAN_NATIVE_INTEGER_SIZEOF@ +PAC_FORTRAN_NATIVE_REAL_KIND = @PAC_FORTRAN_NATIVE_REAL_KIND@ +PAC_FORTRAN_NATIVE_REAL_SIZEOF = @PAC_FORTRAN_NATIVE_REAL_SIZEOF@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ diff --git a/tools/h5dump/Makefile.in b/tools/h5dump/Makefile.in index 7371adf..9865e3a 100644 --- a/tools/h5dump/Makefile.in +++ b/tools/h5dump/Makefile.in @@ -111,7 +111,8 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/aclocal_cxx.m4 \ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/bin/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/src/H5config.h +CONFIG_HEADER = $(top_builddir)/src/H5config.h \ + $(top_builddir)/fortran/src/H5config_f.inc CONFIG_CLEAN_FILES = testh5dump.sh testh5dumppbits.sh testh5dumpxml.sh CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" @@ -149,7 +150,7 @@ AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = -DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src -I$(top_builddir)/fortran/src depcomp = $(SHELL) $(top_srcdir)/bin/depcomp am__depfiles_maybe = depfiles am__mv = mv -f @@ -463,14 +464,21 @@ F9XMODEXT = @F9XMODEXT@ F9XMODFLAG = @F9XMODFLAG@ F9XSUFFIXFLAG = @F9XSUFFIXFLAG@ FC = @FC@ -FC2003 = @FC2003@ FCFLAGS = @FCFLAGS@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ +FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ +FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ +FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ +H5CONFIG_F_IKIND = @H5CONFIG_F_IKIND@ +H5CONFIG_F_NUM_IKIND = @H5CONFIG_F_NUM_IKIND@ +H5CONFIG_F_NUM_RKIND = @H5CONFIG_F_NUM_RKIND@ +H5CONFIG_F_RKIND = @H5CONFIG_F_RKIND@ +H5CONFIG_F_RKIND_SIZEOF = @H5CONFIG_F_RKIND_SIZEOF@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ @@ -480,13 +488,12 @@ H5_LDFLAGS = @H5_LDFLAGS@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ -HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_Fortran_INTEGER_SIZEOF_16 = @HAVE_Fortran_INTEGER_SIZEOF_16@ HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ HDF_FORTRAN = @HDF_FORTRAN@ -HDF_FORTRAN2003 = @HDF_FORTRAN2003@ HID_T = @HID_T@ HL = @HL@ HL_FOR = @HL_FOR@ @@ -528,6 +535,18 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PAC_C_MAX_REAL_PRECISION = @PAC_C_MAX_REAL_PRECISION@ +PAC_FC_ALL_INTEGER_KINDS = @PAC_FC_ALL_INTEGER_KINDS@ +PAC_FC_ALL_INTEGER_KINDS_SIZEOF = @PAC_FC_ALL_INTEGER_KINDS_SIZEOF@ +PAC_FC_ALL_REAL_KINDS = @PAC_FC_ALL_REAL_KINDS@ +PAC_FC_ALL_REAL_KINDS_SIZEOF = @PAC_FC_ALL_REAL_KINDS_SIZEOF@ +PAC_FC_MAX_REAL_PRECISION = @PAC_FC_MAX_REAL_PRECISION@ +PAC_FORTRAN_NATIVE_DOUBLE_KIND = @PAC_FORTRAN_NATIVE_DOUBLE_KIND@ +PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF = @PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF@ +PAC_FORTRAN_NATIVE_INTEGER_KIND = @PAC_FORTRAN_NATIVE_INTEGER_KIND@ +PAC_FORTRAN_NATIVE_INTEGER_SIZEOF = @PAC_FORTRAN_NATIVE_INTEGER_SIZEOF@ +PAC_FORTRAN_NATIVE_REAL_KIND = @PAC_FORTRAN_NATIVE_REAL_KIND@ +PAC_FORTRAN_NATIVE_REAL_SIZEOF = @PAC_FORTRAN_NATIVE_REAL_SIZEOF@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ diff --git a/tools/h5import/Makefile.in b/tools/h5import/Makefile.in index 0778fc2..d6e784a 100644 --- a/tools/h5import/Makefile.in +++ b/tools/h5import/Makefile.in @@ -110,7 +110,8 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/aclocal_cxx.m4 \ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/bin/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/src/H5config.h +CONFIG_HEADER = $(top_builddir)/src/H5config.h \ + $(top_builddir)/fortran/src/H5config_f.inc CONFIG_CLEAN_FILES = h5importtestutil.sh CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" @@ -143,7 +144,7 @@ AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = -DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src -I$(top_builddir)/fortran/src depcomp = $(SHELL) $(top_srcdir)/bin/depcomp am__depfiles_maybe = depfiles am__mv = mv -f @@ -457,14 +458,21 @@ F9XMODEXT = @F9XMODEXT@ F9XMODFLAG = @F9XMODFLAG@ F9XSUFFIXFLAG = @F9XSUFFIXFLAG@ FC = @FC@ -FC2003 = @FC2003@ FCFLAGS = @FCFLAGS@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ +FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ +FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ +FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ +H5CONFIG_F_IKIND = @H5CONFIG_F_IKIND@ +H5CONFIG_F_NUM_IKIND = @H5CONFIG_F_NUM_IKIND@ +H5CONFIG_F_NUM_RKIND = @H5CONFIG_F_NUM_RKIND@ +H5CONFIG_F_RKIND = @H5CONFIG_F_RKIND@ +H5CONFIG_F_RKIND_SIZEOF = @H5CONFIG_F_RKIND_SIZEOF@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ @@ -474,13 +482,12 @@ H5_LDFLAGS = @H5_LDFLAGS@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ -HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_Fortran_INTEGER_SIZEOF_16 = @HAVE_Fortran_INTEGER_SIZEOF_16@ HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ HDF_FORTRAN = @HDF_FORTRAN@ -HDF_FORTRAN2003 = @HDF_FORTRAN2003@ HID_T = @HID_T@ HL = @HL@ HL_FOR = @HL_FOR@ @@ -522,6 +529,18 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PAC_C_MAX_REAL_PRECISION = @PAC_C_MAX_REAL_PRECISION@ +PAC_FC_ALL_INTEGER_KINDS = @PAC_FC_ALL_INTEGER_KINDS@ +PAC_FC_ALL_INTEGER_KINDS_SIZEOF = @PAC_FC_ALL_INTEGER_KINDS_SIZEOF@ +PAC_FC_ALL_REAL_KINDS = @PAC_FC_ALL_REAL_KINDS@ +PAC_FC_ALL_REAL_KINDS_SIZEOF = @PAC_FC_ALL_REAL_KINDS_SIZEOF@ +PAC_FC_MAX_REAL_PRECISION = @PAC_FC_MAX_REAL_PRECISION@ +PAC_FORTRAN_NATIVE_DOUBLE_KIND = @PAC_FORTRAN_NATIVE_DOUBLE_KIND@ +PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF = @PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF@ +PAC_FORTRAN_NATIVE_INTEGER_KIND = @PAC_FORTRAN_NATIVE_INTEGER_KIND@ +PAC_FORTRAN_NATIVE_INTEGER_SIZEOF = @PAC_FORTRAN_NATIVE_INTEGER_SIZEOF@ +PAC_FORTRAN_NATIVE_REAL_KIND = @PAC_FORTRAN_NATIVE_REAL_KIND@ +PAC_FORTRAN_NATIVE_REAL_SIZEOF = @PAC_FORTRAN_NATIVE_REAL_SIZEOF@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ diff --git a/tools/h5jam/Makefile.in b/tools/h5jam/Makefile.in index ed8151f..c915437 100644 --- a/tools/h5jam/Makefile.in +++ b/tools/h5jam/Makefile.in @@ -110,7 +110,8 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/aclocal_cxx.m4 \ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/bin/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/src/H5config.h +CONFIG_HEADER = $(top_builddir)/src/H5config.h \ + $(top_builddir)/fortran/src/H5config_f.inc CONFIG_CLEAN_FILES = testh5jam.sh CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" @@ -157,7 +158,7 @@ AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = -DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src -I$(top_builddir)/fortran/src depcomp = $(SHELL) $(top_srcdir)/bin/depcomp am__depfiles_maybe = depfiles am__mv = mv -f @@ -469,14 +470,21 @@ F9XMODEXT = @F9XMODEXT@ F9XMODFLAG = @F9XMODFLAG@ F9XSUFFIXFLAG = @F9XSUFFIXFLAG@ FC = @FC@ -FC2003 = @FC2003@ FCFLAGS = @FCFLAGS@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ +FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ +FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ +FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ +H5CONFIG_F_IKIND = @H5CONFIG_F_IKIND@ +H5CONFIG_F_NUM_IKIND = @H5CONFIG_F_NUM_IKIND@ +H5CONFIG_F_NUM_RKIND = @H5CONFIG_F_NUM_RKIND@ +H5CONFIG_F_RKIND = @H5CONFIG_F_RKIND@ +H5CONFIG_F_RKIND_SIZEOF = @H5CONFIG_F_RKIND_SIZEOF@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ @@ -486,13 +494,12 @@ H5_LDFLAGS = @H5_LDFLAGS@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ -HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_Fortran_INTEGER_SIZEOF_16 = @HAVE_Fortran_INTEGER_SIZEOF_16@ HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ HDF_FORTRAN = @HDF_FORTRAN@ -HDF_FORTRAN2003 = @HDF_FORTRAN2003@ HID_T = @HID_T@ HL = @HL@ HL_FOR = @HL_FOR@ @@ -534,6 +541,18 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PAC_C_MAX_REAL_PRECISION = @PAC_C_MAX_REAL_PRECISION@ +PAC_FC_ALL_INTEGER_KINDS = @PAC_FC_ALL_INTEGER_KINDS@ +PAC_FC_ALL_INTEGER_KINDS_SIZEOF = @PAC_FC_ALL_INTEGER_KINDS_SIZEOF@ +PAC_FC_ALL_REAL_KINDS = @PAC_FC_ALL_REAL_KINDS@ +PAC_FC_ALL_REAL_KINDS_SIZEOF = @PAC_FC_ALL_REAL_KINDS_SIZEOF@ +PAC_FC_MAX_REAL_PRECISION = @PAC_FC_MAX_REAL_PRECISION@ +PAC_FORTRAN_NATIVE_DOUBLE_KIND = @PAC_FORTRAN_NATIVE_DOUBLE_KIND@ +PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF = @PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF@ +PAC_FORTRAN_NATIVE_INTEGER_KIND = @PAC_FORTRAN_NATIVE_INTEGER_KIND@ +PAC_FORTRAN_NATIVE_INTEGER_SIZEOF = @PAC_FORTRAN_NATIVE_INTEGER_SIZEOF@ +PAC_FORTRAN_NATIVE_REAL_KIND = @PAC_FORTRAN_NATIVE_REAL_KIND@ +PAC_FORTRAN_NATIVE_REAL_SIZEOF = @PAC_FORTRAN_NATIVE_REAL_SIZEOF@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ diff --git a/tools/h5ls/Makefile.in b/tools/h5ls/Makefile.in index c77784e..8fb9822 100644 --- a/tools/h5ls/Makefile.in +++ b/tools/h5ls/Makefile.in @@ -109,7 +109,8 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/aclocal_cxx.m4 \ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/bin/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/src/H5config.h +CONFIG_HEADER = $(top_builddir)/src/H5config.h \ + $(top_builddir)/fortran/src/H5config_f.inc CONFIG_CLEAN_FILES = testh5ls.sh CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" @@ -137,7 +138,7 @@ AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = -DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src -I$(top_builddir)/fortran/src depcomp = $(SHELL) $(top_srcdir)/bin/depcomp am__depfiles_maybe = depfiles am__mv = mv -f @@ -449,14 +450,21 @@ F9XMODEXT = @F9XMODEXT@ F9XMODFLAG = @F9XMODFLAG@ F9XSUFFIXFLAG = @F9XSUFFIXFLAG@ FC = @FC@ -FC2003 = @FC2003@ FCFLAGS = @FCFLAGS@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ +FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ +FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ +FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ +H5CONFIG_F_IKIND = @H5CONFIG_F_IKIND@ +H5CONFIG_F_NUM_IKIND = @H5CONFIG_F_NUM_IKIND@ +H5CONFIG_F_NUM_RKIND = @H5CONFIG_F_NUM_RKIND@ +H5CONFIG_F_RKIND = @H5CONFIG_F_RKIND@ +H5CONFIG_F_RKIND_SIZEOF = @H5CONFIG_F_RKIND_SIZEOF@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ @@ -466,13 +474,12 @@ H5_LDFLAGS = @H5_LDFLAGS@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ -HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_Fortran_INTEGER_SIZEOF_16 = @HAVE_Fortran_INTEGER_SIZEOF_16@ HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ HDF_FORTRAN = @HDF_FORTRAN@ -HDF_FORTRAN2003 = @HDF_FORTRAN2003@ HID_T = @HID_T@ HL = @HL@ HL_FOR = @HL_FOR@ @@ -514,6 +521,18 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PAC_C_MAX_REAL_PRECISION = @PAC_C_MAX_REAL_PRECISION@ +PAC_FC_ALL_INTEGER_KINDS = @PAC_FC_ALL_INTEGER_KINDS@ +PAC_FC_ALL_INTEGER_KINDS_SIZEOF = @PAC_FC_ALL_INTEGER_KINDS_SIZEOF@ +PAC_FC_ALL_REAL_KINDS = @PAC_FC_ALL_REAL_KINDS@ +PAC_FC_ALL_REAL_KINDS_SIZEOF = @PAC_FC_ALL_REAL_KINDS_SIZEOF@ +PAC_FC_MAX_REAL_PRECISION = @PAC_FC_MAX_REAL_PRECISION@ +PAC_FORTRAN_NATIVE_DOUBLE_KIND = @PAC_FORTRAN_NATIVE_DOUBLE_KIND@ +PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF = @PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF@ +PAC_FORTRAN_NATIVE_INTEGER_KIND = @PAC_FORTRAN_NATIVE_INTEGER_KIND@ +PAC_FORTRAN_NATIVE_INTEGER_SIZEOF = @PAC_FORTRAN_NATIVE_INTEGER_SIZEOF@ +PAC_FORTRAN_NATIVE_REAL_KIND = @PAC_FORTRAN_NATIVE_REAL_KIND@ +PAC_FORTRAN_NATIVE_REAL_SIZEOF = @PAC_FORTRAN_NATIVE_REAL_SIZEOF@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ diff --git a/tools/h5repack/Makefile.in b/tools/h5repack/Makefile.in index 6d1bfd6..c0b6685 100644 --- a/tools/h5repack/Makefile.in +++ b/tools/h5repack/Makefile.in @@ -113,7 +113,8 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/aclocal_cxx.m4 \ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/bin/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/src/H5config.h +CONFIG_HEADER = $(top_builddir)/src/H5config.h \ + $(top_builddir)/fortran/src/H5config_f.inc CONFIG_CLEAN_FILES = h5repack.sh h5repack_plugin.sh CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; @@ -192,7 +193,7 @@ AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = -DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src -I$(top_builddir)/fortran/src depcomp = $(SHELL) $(top_srcdir)/bin/depcomp am__depfiles_maybe = depfiles am__mv = mv -f @@ -481,14 +482,21 @@ F9XMODEXT = @F9XMODEXT@ F9XMODFLAG = @F9XMODFLAG@ F9XSUFFIXFLAG = @F9XSUFFIXFLAG@ FC = @FC@ -FC2003 = @FC2003@ FCFLAGS = @FCFLAGS@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ +FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ +FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ +FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ +H5CONFIG_F_IKIND = @H5CONFIG_F_IKIND@ +H5CONFIG_F_NUM_IKIND = @H5CONFIG_F_NUM_IKIND@ +H5CONFIG_F_NUM_RKIND = @H5CONFIG_F_NUM_RKIND@ +H5CONFIG_F_RKIND = @H5CONFIG_F_RKIND@ +H5CONFIG_F_RKIND_SIZEOF = @H5CONFIG_F_RKIND_SIZEOF@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ @@ -498,13 +506,12 @@ H5_LDFLAGS = @H5_LDFLAGS@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ -HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_Fortran_INTEGER_SIZEOF_16 = @HAVE_Fortran_INTEGER_SIZEOF_16@ HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ HDF_FORTRAN = @HDF_FORTRAN@ -HDF_FORTRAN2003 = @HDF_FORTRAN2003@ HID_T = @HID_T@ HL = @HL@ HL_FOR = @HL_FOR@ @@ -546,6 +553,18 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PAC_C_MAX_REAL_PRECISION = @PAC_C_MAX_REAL_PRECISION@ +PAC_FC_ALL_INTEGER_KINDS = @PAC_FC_ALL_INTEGER_KINDS@ +PAC_FC_ALL_INTEGER_KINDS_SIZEOF = @PAC_FC_ALL_INTEGER_KINDS_SIZEOF@ +PAC_FC_ALL_REAL_KINDS = @PAC_FC_ALL_REAL_KINDS@ +PAC_FC_ALL_REAL_KINDS_SIZEOF = @PAC_FC_ALL_REAL_KINDS_SIZEOF@ +PAC_FC_MAX_REAL_PRECISION = @PAC_FC_MAX_REAL_PRECISION@ +PAC_FORTRAN_NATIVE_DOUBLE_KIND = @PAC_FORTRAN_NATIVE_DOUBLE_KIND@ +PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF = @PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF@ +PAC_FORTRAN_NATIVE_INTEGER_KIND = @PAC_FORTRAN_NATIVE_INTEGER_KIND@ +PAC_FORTRAN_NATIVE_INTEGER_SIZEOF = @PAC_FORTRAN_NATIVE_INTEGER_SIZEOF@ +PAC_FORTRAN_NATIVE_REAL_KIND = @PAC_FORTRAN_NATIVE_REAL_KIND@ +PAC_FORTRAN_NATIVE_REAL_SIZEOF = @PAC_FORTRAN_NATIVE_REAL_SIZEOF@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ diff --git a/tools/h5stat/Makefile.in b/tools/h5stat/Makefile.in index 1bbefe9..6bf37f3 100644 --- a/tools/h5stat/Makefile.in +++ b/tools/h5stat/Makefile.in @@ -111,7 +111,8 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/aclocal_cxx.m4 \ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/bin/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/src/H5config.h +CONFIG_HEADER = $(top_builddir)/src/H5config.h \ + $(top_builddir)/fortran/src/H5config_f.inc CONFIG_CLEAN_FILES = testh5stat.sh CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(bindir)" @@ -172,7 +173,7 @@ AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = -DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src -I$(top_builddir)/fortran/src depcomp = $(SHELL) $(top_srcdir)/bin/depcomp am__depfiles_maybe = depfiles am__mv = mv -f @@ -459,14 +460,21 @@ F9XMODEXT = @F9XMODEXT@ F9XMODFLAG = @F9XMODFLAG@ F9XSUFFIXFLAG = @F9XSUFFIXFLAG@ FC = @FC@ -FC2003 = @FC2003@ FCFLAGS = @FCFLAGS@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ +FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ +FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ +FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ +H5CONFIG_F_IKIND = @H5CONFIG_F_IKIND@ +H5CONFIG_F_NUM_IKIND = @H5CONFIG_F_NUM_IKIND@ +H5CONFIG_F_NUM_RKIND = @H5CONFIG_F_NUM_RKIND@ +H5CONFIG_F_RKIND = @H5CONFIG_F_RKIND@ +H5CONFIG_F_RKIND_SIZEOF = @H5CONFIG_F_RKIND_SIZEOF@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ @@ -476,13 +484,12 @@ H5_LDFLAGS = @H5_LDFLAGS@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ -HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_Fortran_INTEGER_SIZEOF_16 = @HAVE_Fortran_INTEGER_SIZEOF_16@ HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ HDF_FORTRAN = @HDF_FORTRAN@ -HDF_FORTRAN2003 = @HDF_FORTRAN2003@ HID_T = @HID_T@ HL = @HL@ HL_FOR = @HL_FOR@ @@ -524,6 +531,18 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PAC_C_MAX_REAL_PRECISION = @PAC_C_MAX_REAL_PRECISION@ +PAC_FC_ALL_INTEGER_KINDS = @PAC_FC_ALL_INTEGER_KINDS@ +PAC_FC_ALL_INTEGER_KINDS_SIZEOF = @PAC_FC_ALL_INTEGER_KINDS_SIZEOF@ +PAC_FC_ALL_REAL_KINDS = @PAC_FC_ALL_REAL_KINDS@ +PAC_FC_ALL_REAL_KINDS_SIZEOF = @PAC_FC_ALL_REAL_KINDS_SIZEOF@ +PAC_FC_MAX_REAL_PRECISION = @PAC_FC_MAX_REAL_PRECISION@ +PAC_FORTRAN_NATIVE_DOUBLE_KIND = @PAC_FORTRAN_NATIVE_DOUBLE_KIND@ +PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF = @PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF@ +PAC_FORTRAN_NATIVE_INTEGER_KIND = @PAC_FORTRAN_NATIVE_INTEGER_KIND@ +PAC_FORTRAN_NATIVE_INTEGER_SIZEOF = @PAC_FORTRAN_NATIVE_INTEGER_SIZEOF@ +PAC_FORTRAN_NATIVE_REAL_KIND = @PAC_FORTRAN_NATIVE_REAL_KIND@ +PAC_FORTRAN_NATIVE_REAL_SIZEOF = @PAC_FORTRAN_NATIVE_REAL_SIZEOF@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ diff --git a/tools/lib/Makefile.in b/tools/lib/Makefile.in index 0b531b3..fcfb019 100644 --- a/tools/lib/Makefile.in +++ b/tools/lib/Makefile.in @@ -108,7 +108,8 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/aclocal_cxx.m4 \ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/bin/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/src/H5config.h +CONFIG_HEADER = $(top_builddir)/src/H5config.h \ + $(top_builddir)/fortran/src/H5config_f.inc CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) @@ -135,7 +136,7 @@ AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = -DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src -I$(top_builddir)/fortran/src depcomp = $(SHELL) $(top_srcdir)/bin/depcomp am__depfiles_maybe = depfiles am__mv = mv -f @@ -446,14 +447,21 @@ F9XMODEXT = @F9XMODEXT@ F9XMODFLAG = @F9XMODFLAG@ F9XSUFFIXFLAG = @F9XSUFFIXFLAG@ FC = @FC@ -FC2003 = @FC2003@ FCFLAGS = @FCFLAGS@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ +FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ +FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ +FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ +H5CONFIG_F_IKIND = @H5CONFIG_F_IKIND@ +H5CONFIG_F_NUM_IKIND = @H5CONFIG_F_NUM_IKIND@ +H5CONFIG_F_NUM_RKIND = @H5CONFIG_F_NUM_RKIND@ +H5CONFIG_F_RKIND = @H5CONFIG_F_RKIND@ +H5CONFIG_F_RKIND_SIZEOF = @H5CONFIG_F_RKIND_SIZEOF@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ @@ -463,13 +471,12 @@ H5_LDFLAGS = @H5_LDFLAGS@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ -HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_Fortran_INTEGER_SIZEOF_16 = @HAVE_Fortran_INTEGER_SIZEOF_16@ HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ HDF_FORTRAN = @HDF_FORTRAN@ -HDF_FORTRAN2003 = @HDF_FORTRAN2003@ HID_T = @HID_T@ HL = @HL@ HL_FOR = @HL_FOR@ @@ -511,6 +518,18 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PAC_C_MAX_REAL_PRECISION = @PAC_C_MAX_REAL_PRECISION@ +PAC_FC_ALL_INTEGER_KINDS = @PAC_FC_ALL_INTEGER_KINDS@ +PAC_FC_ALL_INTEGER_KINDS_SIZEOF = @PAC_FC_ALL_INTEGER_KINDS_SIZEOF@ +PAC_FC_ALL_REAL_KINDS = @PAC_FC_ALL_REAL_KINDS@ +PAC_FC_ALL_REAL_KINDS_SIZEOF = @PAC_FC_ALL_REAL_KINDS_SIZEOF@ +PAC_FC_MAX_REAL_PRECISION = @PAC_FC_MAX_REAL_PRECISION@ +PAC_FORTRAN_NATIVE_DOUBLE_KIND = @PAC_FORTRAN_NATIVE_DOUBLE_KIND@ +PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF = @PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF@ +PAC_FORTRAN_NATIVE_INTEGER_KIND = @PAC_FORTRAN_NATIVE_INTEGER_KIND@ +PAC_FORTRAN_NATIVE_INTEGER_SIZEOF = @PAC_FORTRAN_NATIVE_INTEGER_SIZEOF@ +PAC_FORTRAN_NATIVE_REAL_KIND = @PAC_FORTRAN_NATIVE_REAL_KIND@ +PAC_FORTRAN_NATIVE_REAL_SIZEOF = @PAC_FORTRAN_NATIVE_REAL_SIZEOF@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ diff --git a/tools/misc/Makefile.in b/tools/misc/Makefile.in index 1b8e0eb..2688e8d 100644 --- a/tools/misc/Makefile.in +++ b/tools/misc/Makefile.in @@ -112,7 +112,8 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/aclocal_cxx.m4 \ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/bin/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/src/H5config.h +CONFIG_HEADER = $(top_builddir)/src/H5config.h \ + $(top_builddir)/fortran/src/H5config_f.inc CONFIG_CLEAN_FILES = h5cc testh5mkgrp.sh testh5repart.sh CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(bindir)" @@ -195,7 +196,7 @@ AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = -DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src -I$(top_builddir)/fortran/src depcomp = $(SHELL) $(top_srcdir)/bin/depcomp am__depfiles_maybe = depfiles am__mv = mv -f @@ -484,14 +485,21 @@ F9XMODEXT = @F9XMODEXT@ F9XMODFLAG = @F9XMODFLAG@ F9XSUFFIXFLAG = @F9XSUFFIXFLAG@ FC = @FC@ -FC2003 = @FC2003@ FCFLAGS = @FCFLAGS@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ +FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ +FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ +FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ +H5CONFIG_F_IKIND = @H5CONFIG_F_IKIND@ +H5CONFIG_F_NUM_IKIND = @H5CONFIG_F_NUM_IKIND@ +H5CONFIG_F_NUM_RKIND = @H5CONFIG_F_NUM_RKIND@ +H5CONFIG_F_RKIND = @H5CONFIG_F_RKIND@ +H5CONFIG_F_RKIND_SIZEOF = @H5CONFIG_F_RKIND_SIZEOF@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ @@ -501,13 +509,12 @@ H5_LDFLAGS = @H5_LDFLAGS@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ -HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_Fortran_INTEGER_SIZEOF_16 = @HAVE_Fortran_INTEGER_SIZEOF_16@ HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ HDF_FORTRAN = @HDF_FORTRAN@ -HDF_FORTRAN2003 = @HDF_FORTRAN2003@ HID_T = @HID_T@ HL = @HL@ HL_FOR = @HL_FOR@ @@ -549,6 +556,18 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PAC_C_MAX_REAL_PRECISION = @PAC_C_MAX_REAL_PRECISION@ +PAC_FC_ALL_INTEGER_KINDS = @PAC_FC_ALL_INTEGER_KINDS@ +PAC_FC_ALL_INTEGER_KINDS_SIZEOF = @PAC_FC_ALL_INTEGER_KINDS_SIZEOF@ +PAC_FC_ALL_REAL_KINDS = @PAC_FC_ALL_REAL_KINDS@ +PAC_FC_ALL_REAL_KINDS_SIZEOF = @PAC_FC_ALL_REAL_KINDS_SIZEOF@ +PAC_FC_MAX_REAL_PRECISION = @PAC_FC_MAX_REAL_PRECISION@ +PAC_FORTRAN_NATIVE_DOUBLE_KIND = @PAC_FORTRAN_NATIVE_DOUBLE_KIND@ +PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF = @PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF@ +PAC_FORTRAN_NATIVE_INTEGER_KIND = @PAC_FORTRAN_NATIVE_INTEGER_KIND@ +PAC_FORTRAN_NATIVE_INTEGER_SIZEOF = @PAC_FORTRAN_NATIVE_INTEGER_SIZEOF@ +PAC_FORTRAN_NATIVE_REAL_KIND = @PAC_FORTRAN_NATIVE_REAL_KIND@ +PAC_FORTRAN_NATIVE_REAL_SIZEOF = @PAC_FORTRAN_NATIVE_REAL_SIZEOF@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ diff --git a/tools/perform/Makefile.in b/tools/perform/Makefile.in index 325bc4d..4804533 100644 --- a/tools/perform/Makefile.in +++ b/tools/perform/Makefile.in @@ -116,7 +116,8 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/aclocal_cxx.m4 \ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/bin/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/src/H5config.h +CONFIG_HEADER = $(top_builddir)/src/H5config.h \ + $(top_builddir)/fortran/src/H5config_f.inc CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" @@ -171,7 +172,7 @@ AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = -DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src -I$(top_builddir)/fortran/src depcomp = $(SHELL) $(top_srcdir)/bin/depcomp am__depfiles_maybe = depfiles am__mv = mv -f @@ -488,14 +489,21 @@ F9XMODEXT = @F9XMODEXT@ F9XMODFLAG = @F9XMODFLAG@ F9XSUFFIXFLAG = @F9XSUFFIXFLAG@ FC = @FC@ -FC2003 = @FC2003@ FCFLAGS = @FCFLAGS@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ +FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ +FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ +FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ +H5CONFIG_F_IKIND = @H5CONFIG_F_IKIND@ +H5CONFIG_F_NUM_IKIND = @H5CONFIG_F_NUM_IKIND@ +H5CONFIG_F_NUM_RKIND = @H5CONFIG_F_NUM_RKIND@ +H5CONFIG_F_RKIND = @H5CONFIG_F_RKIND@ +H5CONFIG_F_RKIND_SIZEOF = @H5CONFIG_F_RKIND_SIZEOF@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ @@ -505,13 +513,12 @@ H5_LDFLAGS = @H5_LDFLAGS@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ -HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_Fortran_INTEGER_SIZEOF_16 = @HAVE_Fortran_INTEGER_SIZEOF_16@ HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ HDF_FORTRAN = @HDF_FORTRAN@ -HDF_FORTRAN2003 = @HDF_FORTRAN2003@ HID_T = @HID_T@ HL = @HL@ HL_FOR = @HL_FOR@ @@ -553,6 +560,18 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PAC_C_MAX_REAL_PRECISION = @PAC_C_MAX_REAL_PRECISION@ +PAC_FC_ALL_INTEGER_KINDS = @PAC_FC_ALL_INTEGER_KINDS@ +PAC_FC_ALL_INTEGER_KINDS_SIZEOF = @PAC_FC_ALL_INTEGER_KINDS_SIZEOF@ +PAC_FC_ALL_REAL_KINDS = @PAC_FC_ALL_REAL_KINDS@ +PAC_FC_ALL_REAL_KINDS_SIZEOF = @PAC_FC_ALL_REAL_KINDS_SIZEOF@ +PAC_FC_MAX_REAL_PRECISION = @PAC_FC_MAX_REAL_PRECISION@ +PAC_FORTRAN_NATIVE_DOUBLE_KIND = @PAC_FORTRAN_NATIVE_DOUBLE_KIND@ +PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF = @PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF@ +PAC_FORTRAN_NATIVE_INTEGER_KIND = @PAC_FORTRAN_NATIVE_INTEGER_KIND@ +PAC_FORTRAN_NATIVE_INTEGER_SIZEOF = @PAC_FORTRAN_NATIVE_INTEGER_SIZEOF@ +PAC_FORTRAN_NATIVE_REAL_KIND = @PAC_FORTRAN_NATIVE_REAL_KIND@ +PAC_FORTRAN_NATIVE_REAL_SIZEOF = @PAC_FORTRAN_NATIVE_REAL_SIZEOF@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ -- cgit v0.12 From 555a29e8966a615e7bf3ad64dea8139e812fc880 Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Tue, 11 Aug 2015 11:44:07 -0500 Subject: [svn-r27494] Purpose: Fix HDFFV-9288 Description: Added footer to include copyright and helpdesk info. Platform tested: Re-run Doxygen on cpp_doc_config and verified the html files on a Windows 7 machine. --- c++/src/cpp_doc_config | 4 ++-- c++/src/footer.html | 24 ++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 c++/src/footer.html diff --git a/c++/src/cpp_doc_config b/c++/src/cpp_doc_config index 53d9a7d..376d6cc 100644 --- a/c++/src/cpp_doc_config +++ b/c++/src/cpp_doc_config @@ -873,7 +873,7 @@ EXAMPLE_RECURSIVE = NO # that contain images that are to be included in the documentation (see the # \image command). -IMAGE_PATH = +IMAGE_PATH = ./header_files # The INPUT_FILTER tag can be used to specify a program that doxygen should # invoke to filter for each input file. Doxygen will invoke the filter program @@ -1106,7 +1106,7 @@ HTML_HEADER = # that doxygen normally uses. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_FOOTER = +HTML_FOOTER = footer.html # The HTML_STYLESHEET tag can be used to specify a user-defined cascading style # sheet that is used by each HTML page. It can be used to fine-tune the look of diff --git a/c++/src/footer.html b/c++/src/footer.html new file mode 100644 index 0000000..5c624f7 --- /dev/null +++ b/c++/src/footer.html @@ -0,0 +1,24 @@ + + + +
+


+ + + + + +
+
+ The HDF Group Help Desk: +
+
  + Copyright by + The HDF Group +
+ and the Board of Trustees of the University of Illinois +
+
+ + + -- cgit v0.12 From 53d53ee0eeec6207e280c13e40a3c0ee2368eb06 Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Tue, 11 Aug 2015 12:50:02 -0500 Subject: [svn-r27495] Description: Added ./c++/src/footer.html --- MANIFEST | 1 + 1 file changed, 1 insertion(+) diff --git a/MANIFEST b/MANIFEST index 3629e3c..8fe25ef 100644 --- a/MANIFEST +++ b/MANIFEST @@ -379,6 +379,7 @@ ./c++/src/Makefile.in ./c++/src/RM_stylesheet.css ./c++/src/cpp_doc_config +./c++/src/footer.html ./c++/src/h5c++.in ./c++/src/header.html ./c++/src/header_files/filelist.xml -- cgit v0.12 From c98d072e6987afd9a3b7c501b36cc99f5fc7ec98 Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Tue, 11 Aug 2015 13:36:39 -0500 Subject: [svn-r27496] Description: Used HTML_EXTRA_FILES for image files. Platform tested: Re-run Doxygen on cpp_doc_config and verified the html files on a Windows 7 machine. --- c++/src/cpp_doc_config | 2 +- c++/src/footer.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/c++/src/cpp_doc_config b/c++/src/cpp_doc_config index 376d6cc..0e1fa6a 100644 --- a/c++/src/cpp_doc_config +++ b/c++/src/cpp_doc_config @@ -1139,7 +1139,7 @@ HTML_EXTRA_STYLESHEET = # files will be copied as-is; there are no commands or markers available. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_EXTRA_FILES = +HTML_EXTRA_FILES = ./header_files/help.jpg # The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen # will adjust the colors in the stylesheet and background images according to diff --git a/c++/src/footer.html b/c++/src/footer.html index 5c624f7..ba37ee7 100644 --- a/c++/src/footer.html +++ b/c++/src/footer.html @@ -7,7 +7,7 @@
- The HDF Group Help Desk: + The HDF Group Help Desk:
  -- cgit v0.12 From 48c429d4a39c2257b33567f15639a2d239876e65 Mon Sep 17 00:00:00 2001 From: Scot Breitenfeld Date: Wed, 12 Aug 2015 12:13:12 -0500 Subject: [svn-r27497] Fixed missing variable declarations. tested: h5committest. --- fortran/src/H5_ff.F90 | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/fortran/src/H5_ff.F90 b/fortran/src/H5_ff.F90 index 39e23a7..a95c284 100644 --- a/fortran/src/H5_ff.F90 +++ b/fortran/src/H5_ff.F90 @@ -371,40 +371,46 @@ CONTAINS ! August 25, 2008 ! ! Fortran90 Interface: - INTEGER(HID_T) FUNCTION h5kind_to_type(kind, flag) RESULT(h5_type) + INTEGER(HID_T) FUNCTION h5kind_to_type(ikind, flag) RESULT(h5_type) + USE ISO_C_BINDING IMPLICIT NONE - INTEGER, INTENT(IN) :: kind + INTEGER, INTENT(IN) :: ikind INTEGER, INTENT(IN) :: flag +#if H5_HAVE_Fortran_INTEGER_SIZEOF_16!=0 + Fortran_INTEGER_16=SELECTED_INT_KIND(15) +#endif + + !***** IF(flag.EQ.H5_INTEGER_KIND)THEN - IF(kind.EQ.Fortran_INTEGER_1)THEN + IF(ikind.EQ.Fortran_INTEGER_1)THEN h5_type = H5T_NATIVE_INTEGER_1 - ELSE IF(kind.EQ.Fortran_INTEGER_2)THEN + ELSE IF(ikind.EQ.Fortran_INTEGER_2)THEN h5_type = H5T_NATIVE_INTEGER_2 - ELSE IF(kind.EQ.Fortran_INTEGER_4)THEN + ELSE IF(ikind.EQ.Fortran_INTEGER_4)THEN h5_type = H5T_NATIVE_INTEGER_4 - ELSE IF(kind.EQ.Fortran_INTEGER_8)THEN + ELSE IF(ikind.EQ.Fortran_INTEGER_8)THEN h5_type = H5T_NATIVE_INTEGER_8 #if H5_HAVE_Fortran_INTEGER_SIZEOF_16!=0 - ELSE IF(kind.EQ.Fortran_INTEGER_16)THEN + ELSE IF(ikind.EQ.Fortran_INTEGER_16)THEN h5_type = H5T_NATIVE_INTEGER_16 #endif ENDIF ELSE IF(flag.EQ.H5_REAL_KIND)THEN - IF(kind.EQ.Fortran_REAL_C_FLOAT)THEN + IF(ikind.EQ.KIND(1.0_C_FLOAT))THEN h5_type = H5T_NATIVE_REAL_C_FLOAT - ELSE IF(kind.EQ.Fortran_REAL_C_DOUBLE)THEN + ELSE IF(ikind.EQ.KIND(1.0_C_DOUBLE))THEN h5_type = H5T_NATIVE_REAL_C_DOUBLE -#if H5_FORTRAN_C_LONG_DOUBLE_IS_UNIQUE!=0 - ELSE IF(kind.EQ.Fortran_REAL_C_LONG_DOUBLE)THEN - h5_type = H5T_NATIVE_REAL_C_LONG_DOUBLE -#endif #if H5_PAC_FC_MAX_REAL_PRECISION > 28 #if H5_HAVE_FLOAT128 == 1 - ELSE IF(kind.EQ.Fortran_REAL_C_FLOAT128)THEN + ELSE IF(ikind.EQ.KIND(1.0_C_LONG_DOUBLE))THEN h5_type = H5T_NATIVE_FLOAT_128 #endif #endif +#if H5_FORTRAN_C_LONG_DOUBLE_IS_UNIQUE!=0 + ELSE IF(ikind.EQ.KIND(1.0_C_LONG_DOUBLE))THEN + h5_type = H5T_NATIVE_REAL_C_LONG_DOUBLE +#endif ELSE h5_type = -1 ENDIF -- cgit v0.12 From 91ec9431232f7b8c7d298043f34f1d43aa70a41b Mon Sep 17 00:00:00 2001 From: Scot Breitenfeld Date: Wed, 12 Aug 2015 13:23:03 -0500 Subject: [svn-r27499] Fixed FLOAT_128 H5T type detection. tested: jam --- fortran/src/H5_ff.F90 | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/fortran/src/H5_ff.F90 b/fortran/src/H5_ff.F90 index a95c284..b5b2c93 100644 --- a/fortran/src/H5_ff.F90 +++ b/fortran/src/H5_ff.F90 @@ -377,7 +377,7 @@ CONTAINS INTEGER, INTENT(IN) :: ikind INTEGER, INTENT(IN) :: flag #if H5_HAVE_Fortran_INTEGER_SIZEOF_16!=0 - Fortran_INTEGER_16=SELECTED_INT_KIND(15) + Fortran_INTEGER_16=SELECTED_INT_KIND(36) !should map to INTEGER*16 on most modern processors #endif @@ -401,18 +401,19 @@ CONTAINS h5_type = H5T_NATIVE_REAL_C_FLOAT ELSE IF(ikind.EQ.KIND(1.0_C_DOUBLE))THEN h5_type = H5T_NATIVE_REAL_C_DOUBLE -#if H5_PAC_FC_MAX_REAL_PRECISION > 28 -#if H5_HAVE_FLOAT128 == 1 - ELSE IF(ikind.EQ.KIND(1.0_C_LONG_DOUBLE))THEN - h5_type = H5T_NATIVE_FLOAT_128 -#endif -#endif #if H5_FORTRAN_C_LONG_DOUBLE_IS_UNIQUE!=0 ELSE IF(ikind.EQ.KIND(1.0_C_LONG_DOUBLE))THEN h5_type = H5T_NATIVE_REAL_C_LONG_DOUBLE #endif +#if H5_PAC_FC_MAX_REAL_PRECISION > 28 +#if H5_HAVE_FLOAT128 == 1 + ELSE + h5_type = H5T_NATIVE_FLOAT_128 +#endif +#else ELSE h5_type = -1 +#endif ENDIF ENDIF -- cgit v0.12 From d3e931c772a1fea1d8d0676dd6dd3fe95b000d9e Mon Sep 17 00:00:00 2001 From: Scot Breitenfeld Date: Wed, 12 Aug 2015 14:53:03 -0500 Subject: [svn-r27500] missing declaration --- fortran/src/H5_ff.F90 | 1 + 1 file changed, 1 insertion(+) diff --git a/fortran/src/H5_ff.F90 b/fortran/src/H5_ff.F90 index b5b2c93..4ceb1a8 100644 --- a/fortran/src/H5_ff.F90 +++ b/fortran/src/H5_ff.F90 @@ -377,6 +377,7 @@ CONTAINS INTEGER, INTENT(IN) :: ikind INTEGER, INTENT(IN) :: flag #if H5_HAVE_Fortran_INTEGER_SIZEOF_16!=0 + INTEGER :: Fortran_INTEGER_16 Fortran_INTEGER_16=SELECTED_INT_KIND(36) !should map to INTEGER*16 on most modern processors #endif -- cgit v0.12 From b79070ac8d71114066669be2363a93972b56c112 Mon Sep 17 00:00:00 2001 From: Scot Breitenfeld Date: Fri, 14 Aug 2015 17:21:11 -0500 Subject: [svn-r27509] Fixed check for perl: tested--h5committest --- configure | 6 +++--- configure.ac | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/configure b/configure index fe13186..0b34bba 100755 --- a/configure +++ b/configure @@ -3025,7 +3025,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_PERL="" + ac_cv_prog_PERL="true" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -3033,7 +3033,7 @@ done done IFS=$as_save_IFS - test -z "$ac_cv_prog_PERL" && ac_cv_prog_PERL="$PATH" + test -z "$ac_cv_prog_PERL" && ac_cv_prog_PERL="false" fi fi PERL=$ac_cv_prog_PERL @@ -3046,7 +3046,7 @@ $as_echo "no" >&6; } fi -if test "x$PERL" = "xfalse"; then +if test "x$PERL" != "xtrue"; then as_fn_error $? "*** Perl is required for installing HDF5, but Perl could not be found!" "$LINENO" 5 fi diff --git a/configure.ac b/configure.ac index c37a1c4..b4be127 100644 --- a/configure.ac +++ b/configure.ac @@ -33,8 +33,8 @@ AC_INIT([HDF5], [1.9.227], [help@hdfgroup.org]) ## Requirement #1: Check if Perl is installed. ## AC_SUBST([PERL]) PERL="" -AC_CHECK_PROG([PERL], [perl],, [$PATH]) -if test "x$PERL" = "xfalse"; then +AC_CHECK_PROG([PERL], [perl], true, false, [$PATH]) +if test "x$PERL" != "xtrue"; then AC_MSG_ERROR([*** Perl is required for installing HDF5, but Perl could not be found!]) fi -- cgit v0.12 From 68347a67efd4a03c15abfeeaed289a4c5eeb6c9b Mon Sep 17 00:00:00 2001 From: HDF Tester Date: Sun, 16 Aug 2015 21:58:42 -0500 Subject: [svn-r27511] Snapshot version 1.9 release 227 --- README.txt | 2 +- c++/src/Makefile.in | 2 +- c++/src/cpp_doc_config | 2 +- config/lt_vers.am | 2 +- configure | 22 +++++++++++----------- configure.ac | 2 +- fortran/src/Makefile.in | 2 +- hl/c++/src/Makefile.in | 2 +- hl/fortran/src/Makefile.in | 2 +- hl/src/Makefile.in | 2 +- release_docs/RELEASE.txt | 2 +- src/H5public.h | 4 ++-- src/Makefile.in | 2 +- 13 files changed, 24 insertions(+), 24 deletions(-) diff --git a/README.txt b/README.txt index 3ae4df3..0803889 100644 --- a/README.txt +++ b/README.txt @@ -1,4 +1,4 @@ -HDF5 version 1.9.227 currently under development +HDF5 version 1.9.228 currently under development Please refer to the release_docs/INSTALL file for installation instructions. ------------------------------------------------------------------------------ diff --git a/c++/src/Makefile.in b/c++/src/Makefile.in index c2daa56..6fc9169 100644 --- a/c++/src/Makefile.in +++ b/c++/src/Makefile.in @@ -689,7 +689,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 # After making changes, run bin/reconfigure to update other configure related # files like Makefile.in. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 217 +LT_VERS_REVISION = 218 LT_VERS_AGE = 0 # This is our main target diff --git a/c++/src/cpp_doc_config b/c++/src/cpp_doc_config index 0e1fa6a..36edb72 100644 --- a/c++/src/cpp_doc_config +++ b/c++/src/cpp_doc_config @@ -38,7 +38,7 @@ PROJECT_NAME = "HDF5 C++ API" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = HDF5 version 1.9.227 currently under development +PROJECT_NUMBER = "1.9.228 currently under development" # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/config/lt_vers.am b/config/lt_vers.am index ac029c0..5ad05c6 100644 --- a/config/lt_vers.am +++ b/config/lt_vers.am @@ -19,7 +19,7 @@ # After making changes, run bin/reconfigure to update other configure related # files like Makefile.in. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 217 +LT_VERS_REVISION = 218 LT_VERS_AGE = 0 ## If the API changes *at all*, increment LT_VERS_INTERFACE and diff --git a/configure b/configure index 0b34bba..3e97642 100755 --- a/configure +++ b/configure @@ -1,7 +1,7 @@ #! /bin/sh # From configure.ac Id: configure.ac 22697 2012-08-19 14:35:47Z hdftest . # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for HDF5 1.9.227. +# Generated by GNU Autoconf 2.69 for HDF5 1.9.228. # # Report bugs to . # @@ -591,8 +591,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='HDF5' PACKAGE_TARNAME='hdf5' -PACKAGE_VERSION='1.9.227' -PACKAGE_STRING='HDF5 1.9.227' +PACKAGE_VERSION='1.9.228' +PACKAGE_STRING='HDF5 1.9.228' PACKAGE_BUGREPORT='help@hdfgroup.org' PACKAGE_URL='' @@ -1480,7 +1480,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures HDF5 1.9.227 to adapt to many kinds of systems. +\`configure' configures HDF5 1.9.228 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1550,7 +1550,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of HDF5 1.9.227:";; + short | recursive ) echo "Configuration of HDF5 1.9.228:";; esac cat <<\_ACEOF @@ -1739,7 +1739,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -HDF5 configure 1.9.227 +HDF5 configure 1.9.228 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2654,7 +2654,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by HDF5 $as_me 1.9.227, which was +It was created by HDF5 $as_me 1.9.228, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3573,7 +3573,7 @@ fi # Define the identity of the package. PACKAGE='hdf5' - VERSION='1.9.227' + VERSION='1.9.228' cat >>confdefs.h <<_ACEOF @@ -29511,7 +29511,7 @@ Usage: $0 [OPTIONS] Report bugs to ." lt_cl_version="\ -HDF5 config.lt 1.9.227 +HDF5 config.lt 1.9.228 configured by $0, generated by GNU Autoconf 2.69. Copyright (C) 2011 Free Software Foundation, Inc. @@ -31607,7 +31607,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by HDF5 $as_me 1.9.227, which was +This file was extended by HDF5 $as_me 1.9.228, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -31673,7 +31673,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -HDF5 config.status 1.9.227 +HDF5 config.status 1.9.228 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/configure.ac b/configure.ac index b4be127..78b1f8d 100644 --- a/configure.ac +++ b/configure.ac @@ -26,7 +26,7 @@ AC_PREREQ([2.69]) ## NOTE: Do not forget to change the version number here when we do a ## release!!! ## -AC_INIT([HDF5], [1.9.227], [help@hdfgroup.org]) +AC_INIT([HDF5], [1.9.228], [help@hdfgroup.org]) ## PLACE CHECKS FOR REQUIRED PACKAGES NEEDED TO INSTALL HDF5 AT THE BEGINNING ## -------------------------------------------------------------------------- diff --git a/fortran/src/Makefile.in b/fortran/src/Makefile.in index 9a1ce4f..634565b 100644 --- a/fortran/src/Makefile.in +++ b/fortran/src/Makefile.in @@ -727,7 +727,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 # After making changes, run bin/reconfigure to update other configure related # files like Makefile.in. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 217 +LT_VERS_REVISION = 218 LT_VERS_AGE = 0 AM_FCLIBS = $(LIBHDF5) diff --git a/hl/c++/src/Makefile.in b/hl/c++/src/Makefile.in index 043a25a..e4282c4 100644 --- a/hl/c++/src/Makefile.in +++ b/hl/c++/src/Makefile.in @@ -681,7 +681,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 # After making changes, run bin/reconfigure to update other configure related # files like Makefile.in. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 217 +LT_VERS_REVISION = 218 LT_VERS_AGE = 0 # This is our main target diff --git a/hl/fortran/src/Makefile.in b/hl/fortran/src/Makefile.in index 956eda8..92c8296 100644 --- a/hl/fortran/src/Makefile.in +++ b/hl/fortran/src/Makefile.in @@ -710,7 +710,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 # After making changes, run bin/reconfigure to update other configure related # files like Makefile.in. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 217 +LT_VERS_REVISION = 218 LT_VERS_AGE = 0 # Our main target, the high-level fortran library diff --git a/hl/src/Makefile.in b/hl/src/Makefile.in index 8039d15..626f9e0 100644 --- a/hl/src/Makefile.in +++ b/hl/src/Makefile.in @@ -680,7 +680,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 # After making changes, run bin/reconfigure to update other configure related # files like Makefile.in. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 217 +LT_VERS_REVISION = 218 LT_VERS_AGE = 0 # This library is our main target. diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index d034cd3..003145b 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -1,4 +1,4 @@ -HDF5 version 1.9.227 currently under development +HDF5 version 1.9.228 currently under development ================================================================================ diff --git a/src/H5public.h b/src/H5public.h index 1d99c11..1b3711b 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -94,10 +94,10 @@ extern "C" { /* Version numbers */ #define H5_VERS_MAJOR 1 /* For major interface/format changes */ #define H5_VERS_MINOR 9 /* For minor interface/format changes */ -#define H5_VERS_RELEASE 227 /* For tweaks, bug-fixes, or development */ +#define H5_VERS_RELEASE 228 /* For tweaks, bug-fixes, or development */ #define H5_VERS_SUBRELEASE "" /* For pre-releases like snap0 */ /* Empty string for real releases. */ -#define H5_VERS_INFO "HDF5 library version: 1.9.227" /* Full version string */ +#define H5_VERS_INFO "HDF5 library version: 1.9.228" /* Full version string */ #define H5check() H5check_version(H5_VERS_MAJOR,H5_VERS_MINOR, \ H5_VERS_RELEASE) diff --git a/src/Makefile.in b/src/Makefile.in index 5f2ef19..853f98f 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -742,7 +742,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 # After making changes, run bin/reconfigure to update other configure related # files like Makefile.in. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 217 +LT_VERS_REVISION = 218 LT_VERS_AGE = 0 # Our main target, the HDF5 library -- cgit v0.12 From 72ae17138b28e51ab06440c3a81a00b83c01de5f Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 17 Aug 2015 10:37:43 -0500 Subject: [svn-r27515] Correct spelling of function --- src/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index eddc951..ee06669 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -802,7 +802,7 @@ add_custom_command ( ) if (GENERATE_ERROR_HEADERS) - find_pacakge (Perl) + find_package (Perl) if (PERL_FOUND) add_custom_command ( OUTPUT ${HDF5_BINARY_DIR}/H5Edefin.h -- cgit v0.12 From d06fee7bd278d8fdeb630a97f70b87ba92ffbfe2 Mon Sep 17 00:00:00 2001 From: Scot Breitenfeld Date: Mon, 17 Aug 2015 16:12:03 -0500 Subject: [svn-r27517] Removed all perl scripts from configure. Tested: h5committest --- Makefile.in | 1 - c++/Makefile.in | 1 - c++/examples/Makefile.in | 1 - c++/src/Makefile.in | 1 - c++/test/Makefile.in | 1 - configure | 107 +++++++++++----------------------------- configure.ac | 25 +++------- examples/Makefile.in | 1 - fortran/Makefile.in | 1 - fortran/examples/Makefile.in | 1 - fortran/src/Makefile.in | 1 - fortran/test/Makefile.in | 1 - fortran/testpar/Makefile.in | 1 - hl/Makefile.in | 1 - hl/c++/Makefile.in | 1 - hl/c++/examples/Makefile.in | 1 - hl/c++/src/Makefile.in | 1 - hl/c++/test/Makefile.in | 1 - hl/examples/Makefile.in | 1 - hl/fortran/Makefile.in | 1 - hl/fortran/examples/Makefile.in | 1 - hl/fortran/src/Makefile.in | 1 - hl/fortran/test/Makefile.in | 1 - hl/src/Makefile.in | 1 - hl/test/Makefile.in | 1 - hl/tools/Makefile.in | 1 - hl/tools/gif2h5/Makefile.in | 1 - m4/aclocal_fc.m4 | 34 ++++++------- src/Makefile.in | 1 - test/Makefile.in | 1 - testpar/Makefile.in | 1 - tools/Makefile.in | 1 - tools/h5copy/Makefile.in | 1 - tools/h5diff/Makefile.in | 1 - tools/h5dump/Makefile.in | 1 - tools/h5import/Makefile.in | 1 - tools/h5jam/Makefile.in | 1 - tools/h5ls/Makefile.in | 1 - tools/h5repack/Makefile.in | 1 - tools/h5stat/Makefile.in | 1 - tools/lib/Makefile.in | 1 - tools/misc/Makefile.in | 1 - tools/perform/Makefile.in | 1 - 43 files changed, 53 insertions(+), 153 deletions(-) diff --git a/Makefile.in b/Makefile.in index ce0c833..2e9effd 100644 --- a/Makefile.in +++ b/Makefile.in @@ -374,7 +374,6 @@ PAC_FORTRAN_NATIVE_REAL_KIND = @PAC_FORTRAN_NATIVE_REAL_KIND@ PAC_FORTRAN_NATIVE_REAL_SIZEOF = @PAC_FORTRAN_NATIVE_REAL_SIZEOF@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ -PERL = @PERL@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ diff --git a/c++/Makefile.in b/c++/Makefile.in index 2315cc2..4ff4906 100644 --- a/c++/Makefile.in +++ b/c++/Makefile.in @@ -534,7 +534,6 @@ PAC_FORTRAN_NATIVE_REAL_KIND = @PAC_FORTRAN_NATIVE_REAL_KIND@ PAC_FORTRAN_NATIVE_REAL_SIZEOF = @PAC_FORTRAN_NATIVE_REAL_SIZEOF@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ -PERL = @PERL@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ diff --git a/c++/examples/Makefile.in b/c++/examples/Makefile.in index 6b0f894..9691b5e 100644 --- a/c++/examples/Makefile.in +++ b/c++/examples/Makefile.in @@ -482,7 +482,6 @@ PAC_FORTRAN_NATIVE_REAL_KIND = @PAC_FORTRAN_NATIVE_REAL_KIND@ PAC_FORTRAN_NATIVE_REAL_SIZEOF = @PAC_FORTRAN_NATIVE_REAL_SIZEOF@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ -PERL = @PERL@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ diff --git a/c++/src/Makefile.in b/c++/src/Makefile.in index 6fc9169..6d47efc 100644 --- a/c++/src/Makefile.in +++ b/c++/src/Makefile.in @@ -545,7 +545,6 @@ PAC_FORTRAN_NATIVE_REAL_KIND = @PAC_FORTRAN_NATIVE_REAL_KIND@ PAC_FORTRAN_NATIVE_REAL_SIZEOF = @PAC_FORTRAN_NATIVE_REAL_SIZEOF@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ -PERL = @PERL@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ diff --git a/c++/test/Makefile.in b/c++/test/Makefile.in index 0da1d86..e487e54 100644 --- a/c++/test/Makefile.in +++ b/c++/test/Makefile.in @@ -536,7 +536,6 @@ PAC_FORTRAN_NATIVE_REAL_KIND = @PAC_FORTRAN_NATIVE_REAL_KIND@ PAC_FORTRAN_NATIVE_REAL_SIZEOF = @PAC_FORTRAN_NATIVE_REAL_SIZEOF@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ -PERL = @PERL@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ diff --git a/configure b/configure index 3e97642..c050cf3 100755 --- a/configure +++ b/configure @@ -841,7 +841,6 @@ am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM -PERL target_alias host_alias build_alias @@ -3003,53 +3002,6 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu -## PLACE CHECKS FOR REQUIRED PACKAGES NEEDED TO INSTALL HDF5 AT THE BEGINNING -## -------------------------------------------------------------------------- -## Requirement #1: Check if Perl is installed. -## - PERL="" -# Extract the first word of "perl", so it can be a program name with args. -set dummy perl; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_PERL+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$PERL"; then - ac_cv_prog_PERL="$PERL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_PERL="true" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - test -z "$ac_cv_prog_PERL" && ac_cv_prog_PERL="false" -fi -fi -PERL=$ac_cv_prog_PERL -if test -n "$PERL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PERL" >&5 -$as_echo "$PERL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -if test "x$PERL" != "xtrue"; then - as_fn_error $? "*** Perl is required for installing HDF5, but Perl could not be found!" "$LINENO" 5 -fi - ac_config_headers="$ac_config_headers src/H5config.h" @@ -6286,8 +6238,8 @@ else if ac_fn_c_try_run "$LINENO"; then : if test -s pac_Cconftest.out ; then - LDBL_DIG="`perl -ne '$. == 1 && print && exit' pac_Cconftest.out`" - FLT128_DIG="`perl -ne '$. == 2 && print && exit' pac_Cconftest.out`" + LDBL_DIG="`sed -n '1p' pac_Cconftest.out`" + FLT128_DIG="`sed -n '2p' pac_Cconftest.out`" else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: No output from test program!" >&5 $as_echo "$as_me: WARNING: No output from test program!" >&2;} @@ -7863,9 +7815,9 @@ if ac_fn_fc_try_run "$LINENO"; then : if test -s pac_fconftest.out ; then - pac_validIntKinds="`perl -ne '$. == 1 && print && exit' pac_fconftest.out`" - pac_validRealKinds="`perl -ne '$. == 2 && print && exit' pac_fconftest.out`" - PAC_FC_MAX_REAL_PRECISION="`perl -ne '$. == 3 && print && exit' pac_fconftest.out`" + pac_validIntKinds="`sed -n '1p' pac_fconftest.out`" + pac_validRealKinds="`sed -n '2p' pac_fconftest.out`" + PAC_FC_MAX_REAL_PRECISION="`sed -n '3p' pac_fconftest.out`" cat >>confdefs.h <<_ACEOF #define PAC_FC_MAX_REAL_PRECISION $PAC_FC_MAX_REAL_PRECISION @@ -7875,9 +7827,9 @@ _ACEOF PAC_FC_ALL_INTEGER_KINDS="{`echo $pac_validIntKinds`}" PAC_FC_ALL_REAL_KINDS="{`echo $pac_validRealKinds`}" - H5CONFIG_F_NUM_IKIND="INTEGER, PARAMETER :: num_ikinds = `perl -ne '$. == 4 && print && exit' pac_fconftest.out`" + H5CONFIG_F_NUM_IKIND="INTEGER, PARAMETER :: num_ikinds = `sed -n '4p' pac_fconftest.out`" H5CONFIG_F_IKIND="INTEGER, DIMENSION(1:num_ikinds) :: ikind = (/`echo $pac_validIntKinds`/)" - H5CONFIG_F_NUM_RKIND="INTEGER, PARAMETER :: num_rkinds = `perl -ne '$. == 5 && print && exit' pac_fconftest.out`" + H5CONFIG_F_NUM_RKIND="INTEGER, PARAMETER :: num_rkinds = `sed -n '5p' pac_fconftest.out`" H5CONFIG_F_RKIND="INTEGER, DIMENSION(1:num_rkinds) :: rkind = (/`echo $pac_validRealKinds`/)" @@ -7980,12 +7932,12 @@ else if ac_fn_fc_try_run "$LINENO"; then : if test -s pac_fconftest.out ; then - PAC_FORTRAN_NATIVE_INTEGER_KIND="`perl -ne '$. == 1 && print && exit' pac_fconftest.out`" - PAC_FORTRAN_NATIVE_INTEGER_SIZEOF="`perl -ne '$. == 2 && print && exit' pac_fconftest.out`" - PAC_FORTRAN_NATIVE_REAL_KIND="`perl -ne '$. == 3 && print && exit' pac_fconftest.out`" - PAC_FORTRAN_NATIVE_REAL_SIZEOF="`perl -ne '$. == 4 && print && exit' pac_fconftest.out`" - PAC_FORTRAN_NATIVE_DOUBLE_KIND="`perl -ne '$. == 5 && print && exit' pac_fconftest.out`" - PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF="`perl -ne '$. == 6 && print && exit' pac_fconftest.out`" + PAC_FORTRAN_NATIVE_INTEGER_KIND="`sed -n '1p' pac_fconftest.out`" + PAC_FORTRAN_NATIVE_INTEGER_SIZEOF="`sed -n '2p' pac_fconftest.out`" + PAC_FORTRAN_NATIVE_REAL_KIND="`sed -n '3p' pac_fconftest.out`" + PAC_FORTRAN_NATIVE_REAL_SIZEOF="`sed -n '4p' pac_fconftest.out`" + PAC_FORTRAN_NATIVE_DOUBLE_KIND="`sed -n '5p' pac_fconftest.out`" + PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF="`sed -n '6p' pac_fconftest.out`" else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: No output from test program!" >&5 $as_echo "$as_me: WARNING: No output from test program!" >&2;} @@ -8086,9 +8038,9 @@ if ac_fn_fc_try_run "$LINENO"; then : if test -s pac_fconftest.out ; then - pac_validIntKinds="`perl -ne '$. == 1 && print && exit' pac_fconftest.out`" - pac_validRealKinds="`perl -ne '$. == 2 && print && exit' pac_fconftest.out`" - PAC_FC_MAX_REAL_PRECISION="`perl -ne '$. == 3 && print && exit' pac_fconftest.out`" + pac_validIntKinds="`sed -n '1p' pac_fconftest.out`" + pac_validRealKinds="`sed -n '2p' pac_fconftest.out`" + PAC_FC_MAX_REAL_PRECISION="`sed -n '3p' pac_fconftest.out`" cat >>confdefs.h <<_ACEOF #define PAC_FC_MAX_REAL_PRECISION $PAC_FC_MAX_REAL_PRECISION @@ -8098,9 +8050,9 @@ _ACEOF PAC_FC_ALL_INTEGER_KINDS="{`echo $pac_validIntKinds`}" PAC_FC_ALL_REAL_KINDS="{`echo $pac_validRealKinds`}" - H5CONFIG_F_NUM_IKIND="INTEGER, PARAMETER :: num_ikinds = `perl -ne '$. == 4 && print && exit' pac_fconftest.out`" + H5CONFIG_F_NUM_IKIND="INTEGER, PARAMETER :: num_ikinds = `sed -n '4p' pac_fconftest.out`" H5CONFIG_F_IKIND="INTEGER, DIMENSION(1:num_ikinds) :: ikind = (/`echo $pac_validIntKinds`/)" - H5CONFIG_F_NUM_RKIND="INTEGER, PARAMETER :: num_rkinds = `perl -ne '$. == 5 && print && exit' pac_fconftest.out`" + H5CONFIG_F_NUM_RKIND="INTEGER, PARAMETER :: num_rkinds = `sed -n '5p' pac_fconftest.out`" H5CONFIG_F_RKIND="INTEGER, DIMENSION(1:num_rkinds) :: rkind = (/`echo $pac_validRealKinds`/)" @@ -8176,7 +8128,7 @@ ac_compiler_gnu=$ac_cv_fc_compiler_gnu pack_int_sizeof="" rm -f pac_fconftest.out -for kind in `echo $pac_validIntKinds | perl -pe 's/,/ /g'`; do +for kind in `echo $pac_validIntKinds | sed -e 's/,/ /g'`; do cat > conftest.$ac_ext <<_ACEOF @@ -8218,7 +8170,7 @@ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ fi done -PAC_FC_ALL_INTEGER_KINDS_SIZEOF="{`echo $pack_int_sizeof | perl -pe 's/,$//' | perl -pe 's/ //g'`}" +PAC_FC_ALL_INTEGER_KINDS_SIZEOF="{`echo $pack_int_sizeof | sed -e 's/,$//' | sed -e 's/ //g'`}" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PAC_FC_ALL_INTEGER_KINDS_SIZEOF" >&5 $as_echo "$PAC_FC_ALL_INTEGER_KINDS_SIZEOF" >&6; } ac_ext=${ac_fc_srcext-f} @@ -8238,7 +8190,7 @@ ac_compiler_gnu=$ac_cv_fc_compiler_gnu pack_real_sizeof="" rm -f pac_fconftest.out -for kind in `echo $pac_validRealKinds| perl -pe 's/,/ /g'`; do +for kind in `echo $pac_validRealKinds | sed -e 's/,/ /g'`; do cat > conftest.$ac_ext <<_ACEOF @@ -8280,7 +8232,7 @@ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ fi done -PAC_FC_ALL_REAL_KINDS_SIZEOF="{`echo $pack_real_sizeof | perl -pe 's/,$//' | perl -pe 's/ //g'`}" +PAC_FC_ALL_REAL_KINDS_SIZEOF="{`echo $pack_real_sizeof | sed -e 's/,$//' | sed -e 's/ //g'`}" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PAC_FC_ALL_REAL_KINDS_SIZEOF" >&5 $as_echo "$PAC_FC_ALL_REAL_KINDS_SIZEOF" >&6; } ac_ext=${ac_fc_srcext-f} @@ -8437,9 +8389,8 @@ _ACEOF - - max_real_fortran_sizeof="`echo \"$PAC_FC_ALL_REAL_KINDS_SIZEOF\" | perl -ne '/,(\d+)\}/; print $1'`" - max_real_fortran_kind="`echo \"$PAC_FC_ALL_REAL_KINDS\" | perl -ne '/,(\d+)\}/; print $1'`" + max_real_fortran_sizeof="`echo $PAC_FC_ALL_REAL_KINDS_SIZEOF | sed -ne 's/.*,\([0-9]*\)\}/\1/p'`" + max_real_fortran_kind="`echo \"$PAC_FC_ALL_REAL_KINDS\" | sed -ne 's/.*,\([0-9]*\)\}/\1/p'`" if test "$ac_cv_sizeof___float128" != 0;then if test "$ac_cv_sizeof___float128" != "$max_real_fortran_sizeof" && test "${ac_cv_sizeof_long_double}" != "$max_real_fortran_sizeof"; then @@ -8451,8 +8402,8 @@ $as_echo "$as_me: WARNING: Fortran REAL(KIND=$max_real_fortran_kind) is $max_real_fortran_sizeof Bytes, but no corresponding C float type exists of that size !!! Fortran interfaces will not be generated for REAL(KIND=$max_real_fortran_kind) !!! " >&2;} - PAC_FC_ALL_REAL_KINDS="`echo \"$PAC_FC_ALL_REAL_KINDS\" | perl -pe 's/,\d+}/}/g;'`" - PAC_FC_ALL_REAL_KINDS_SIZEOF="`echo \"$PAC_FC_ALL_REAL_KINDS_SIZEOF\" | perl -pe 's/,\d+}/}/g;'`" + PAC_FC_ALL_REAL_KINDS="`echo $PAC_FC_ALL_REAL_KINDS | sed -e 's/,[0-9]\+}/}/g'`" + PAC_FC_ALL_REAL_KINDS_SIZEOF="`echo $PAC_FC_ALL_REAL_KINDS_SIZEOF | sed -e 's/,[0-9]\+}/}/g'`" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Fortran interoperable KINDS with C" >&5 @@ -8460,9 +8411,9 @@ $as_echo_n "checking for Fortran interoperable KINDS with C... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PAC_FC_ALL_REAL_KINDS" >&5 $as_echo "$PAC_FC_ALL_REAL_KINDS" >&6; } - H5CONFIG_F_NUM_RKIND="INTEGER, PARAMETER :: num_rkinds = `echo \"$PAC_FC_ALL_REAL_KINDS\" | perl -e '$count = ( =~ tr/,//);print $count+1'`" - H5CONFIG_F_RKIND="INTEGER, DIMENSION(1:num_rkinds) :: rkind = (/`echo \"$PAC_FC_ALL_REAL_KINDS\" | perl -pe 's/{//g' | perl -pe 's/}//g' | perl -pe 's/ /,/g'`/)" - H5CONFIG_F_RKIND_SIZEOF="INTEGER, DIMENSION(1:num_rkinds) :: rkind_sizeof = (/`echo \"$PAC_FC_ALL_REAL_KINDS_SIZEOF\" | perl -pe 's/{//g' | perl -pe 's/}//g'| perl -pe 's/ /,/g'`/)" + H5CONFIG_F_NUM_RKIND="INTEGER, PARAMETER :: num_rkinds = `echo \"$PAC_FC_ALL_REAL_KINDS\" | tr -d -c ',\n' | awk '{ print length + 1; }'`" + H5CONFIG_F_RKIND="INTEGER, DIMENSION(1:num_rkinds) :: rkind = (/`echo $PAC_FC_ALL_REAL_KINDS | sed -e 's/{//g' | sed -e 's/}//g' | sed -e 's/ /,/g'`/)" + H5CONFIG_F_RKIND_SIZEOF="INTEGER, DIMENSION(1:num_rkinds) :: rkind_sizeof = (/`echo $PAC_FC_ALL_REAL_KINDS_SIZEOF | sed -e 's/{//g' | sed -e 's/}//g'| sed -e 's/ /,/g'`/)" cat >>confdefs.h <<_ACEOF diff --git a/configure.ac b/configure.ac index 78b1f8d..9ca4440 100644 --- a/configure.ac +++ b/configure.ac @@ -28,16 +28,6 @@ AC_PREREQ([2.69]) ## AC_INIT([HDF5], [1.9.228], [help@hdfgroup.org]) -## PLACE CHECKS FOR REQUIRED PACKAGES NEEDED TO INSTALL HDF5 AT THE BEGINNING -## -------------------------------------------------------------------------- -## Requirement #1: Check if Perl is installed. -## -AC_SUBST([PERL]) PERL="" -AC_CHECK_PROG([PERL], [perl], true, false, [$PATH]) -if test "x$PERL" != "xtrue"; then - AC_MSG_ERROR([*** Perl is required for installing HDF5, but Perl could not be found!]) -fi - AC_CONFIG_SRCDIR([src/H5.c]) AC_CONFIG_HEADER([src/H5config.h]) @@ -576,9 +566,8 @@ if test "X$HDF_FORTRAN" = "Xyes"; then dnl get the largest sizeof for REAL kinds - - max_real_fortran_sizeof="`echo \"[$]PAC_FC_ALL_REAL_KINDS_SIZEOF\" | perl -ne '/,(\d+)\}/; print $1'`" - max_real_fortran_kind="`echo \"[$]PAC_FC_ALL_REAL_KINDS\" | perl -ne '/,(\d+)\}/; print $1'`" + max_real_fortran_sizeof="`echo $PAC_FC_ALL_REAL_KINDS_SIZEOF | sed -ne 's/.*,\([[0-9]]*\)\}/\1/p'`" + max_real_fortran_kind="`echo \"[$]PAC_FC_ALL_REAL_KINDS\" | sed -ne 's/.*,\([[0-9]]*\)\}/\1/p'`" dnl remove the invalid kind from the list if test "$ac_cv_sizeof___float128" != 0;then @@ -587,17 +576,17 @@ if test "X$HDF_FORTRAN" = "Xyes"; then Fortran REAL(KIND=$max_real_fortran_kind) is $max_real_fortran_sizeof Bytes, but no corresponding C float type exists of that size !!! Fortran interfaces will not be generated for REAL(KIND=$max_real_fortran_kind) !!! ]) - PAC_FC_ALL_REAL_KINDS="`echo \"[$]PAC_FC_ALL_REAL_KINDS\" | perl -pe 's/,\d+}/}/g;'`" - PAC_FC_ALL_REAL_KINDS_SIZEOF="`echo \"[$]PAC_FC_ALL_REAL_KINDS_SIZEOF\" | perl -pe 's/,\d+}/}/g;'`" + PAC_FC_ALL_REAL_KINDS="`echo $PAC_FC_ALL_REAL_KINDS | sed -e 's/,[[0-9]]\+}/}/g'`" + PAC_FC_ALL_REAL_KINDS_SIZEOF="`echo $PAC_FC_ALL_REAL_KINDS_SIZEOF | sed -e 's/,[[0-9]]\+}/}/g'`" fi fi AC_MSG_CHECKING([for Fortran interoperable KINDS with C]) AC_MSG_RESULT([$PAC_FC_ALL_REAL_KINDS]) dnl count the number of real kinds - H5CONFIG_F_NUM_RKIND="INTEGER, PARAMETER :: num_rkinds = `echo \"[$]PAC_FC_ALL_REAL_KINDS\" | perl -e '$count = ( =~ tr/,//);print $count+1'`" - H5CONFIG_F_RKIND="INTEGER, DIMENSION(1:num_rkinds) :: rkind = (/`echo \"[$]PAC_FC_ALL_REAL_KINDS\" | perl -pe 's/{//g' | perl -pe 's/}//g' | perl -pe 's/ /,/g'`/)" - H5CONFIG_F_RKIND_SIZEOF="INTEGER, DIMENSION(1:num_rkinds) :: rkind_sizeof = (/`echo \"[$]PAC_FC_ALL_REAL_KINDS_SIZEOF\" | perl -pe 's/{//g' | perl -pe 's/}//g'| perl -pe 's/ /,/g'`/)" + H5CONFIG_F_NUM_RKIND="INTEGER, PARAMETER :: num_rkinds = `echo \"[$]PAC_FC_ALL_REAL_KINDS\" | tr -d -c ',\n' | awk '{ print length + 1; }'`" + H5CONFIG_F_RKIND="INTEGER, DIMENSION(1:num_rkinds) :: rkind = (/`echo $PAC_FC_ALL_REAL_KINDS | sed -e 's/{//g' | sed -e 's/}//g' | sed -e 's/ /,/g'`/)" + H5CONFIG_F_RKIND_SIZEOF="INTEGER, DIMENSION(1:num_rkinds) :: rkind_sizeof = (/`echo $PAC_FC_ALL_REAL_KINDS_SIZEOF | sed -e 's/{//g' | sed -e 's/}//g'| sed -e 's/ /,/g'`/)" AC_DEFINE_UNQUOTED([H5CONFIG_F_NUM_RKIND], $H5CONFIG_F_NUM_RKIND, [Define number of valid Fortran REAL KINDs]) AC_DEFINE_UNQUOTED([H5CONFIG_F_RKIND], $H5CONFIG_F_RKIND, [Define valid Fortran REAL KINDs]) diff --git a/examples/Makefile.in b/examples/Makefile.in index 79232ae..94a0b54 100644 --- a/examples/Makefile.in +++ b/examples/Makefile.in @@ -482,7 +482,6 @@ PAC_FORTRAN_NATIVE_REAL_KIND = @PAC_FORTRAN_NATIVE_REAL_KIND@ PAC_FORTRAN_NATIVE_REAL_SIZEOF = @PAC_FORTRAN_NATIVE_REAL_SIZEOF@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ -PERL = @PERL@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ diff --git a/fortran/Makefile.in b/fortran/Makefile.in index 8585623..5d5d63e 100644 --- a/fortran/Makefile.in +++ b/fortran/Makefile.in @@ -538,7 +538,6 @@ PAC_FORTRAN_NATIVE_REAL_KIND = @PAC_FORTRAN_NATIVE_REAL_KIND@ PAC_FORTRAN_NATIVE_REAL_SIZEOF = @PAC_FORTRAN_NATIVE_REAL_SIZEOF@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ -PERL = @PERL@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ diff --git a/fortran/examples/Makefile.in b/fortran/examples/Makefile.in index f97fdc8..cfde59c 100644 --- a/fortran/examples/Makefile.in +++ b/fortran/examples/Makefile.in @@ -482,7 +482,6 @@ PAC_FORTRAN_NATIVE_REAL_KIND = @PAC_FORTRAN_NATIVE_REAL_KIND@ PAC_FORTRAN_NATIVE_REAL_SIZEOF = @PAC_FORTRAN_NATIVE_REAL_SIZEOF@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ -PERL = @PERL@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ diff --git a/fortran/src/Makefile.in b/fortran/src/Makefile.in index 634565b..2a0099c 100644 --- a/fortran/src/Makefile.in +++ b/fortran/src/Makefile.in @@ -583,7 +583,6 @@ PAC_FORTRAN_NATIVE_REAL_KIND = @PAC_FORTRAN_NATIVE_REAL_KIND@ PAC_FORTRAN_NATIVE_REAL_SIZEOF = @PAC_FORTRAN_NATIVE_REAL_SIZEOF@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ -PERL = @PERL@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ diff --git a/fortran/test/Makefile.in b/fortran/test/Makefile.in index 4e9bbd6..0d1a8cc 100644 --- a/fortran/test/Makefile.in +++ b/fortran/test/Makefile.in @@ -602,7 +602,6 @@ PAC_FORTRAN_NATIVE_REAL_KIND = @PAC_FORTRAN_NATIVE_REAL_KIND@ PAC_FORTRAN_NATIVE_REAL_SIZEOF = @PAC_FORTRAN_NATIVE_REAL_SIZEOF@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ -PERL = @PERL@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ diff --git a/fortran/testpar/Makefile.in b/fortran/testpar/Makefile.in index 073194a..9e23ee3 100644 --- a/fortran/testpar/Makefile.in +++ b/fortran/testpar/Makefile.in @@ -534,7 +534,6 @@ PAC_FORTRAN_NATIVE_REAL_KIND = @PAC_FORTRAN_NATIVE_REAL_KIND@ PAC_FORTRAN_NATIVE_REAL_SIZEOF = @PAC_FORTRAN_NATIVE_REAL_SIZEOF@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ -PERL = @PERL@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ diff --git a/hl/Makefile.in b/hl/Makefile.in index b5fbb46..f1e178d 100644 --- a/hl/Makefile.in +++ b/hl/Makefile.in @@ -538,7 +538,6 @@ PAC_FORTRAN_NATIVE_REAL_KIND = @PAC_FORTRAN_NATIVE_REAL_KIND@ PAC_FORTRAN_NATIVE_REAL_SIZEOF = @PAC_FORTRAN_NATIVE_REAL_SIZEOF@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ -PERL = @PERL@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ diff --git a/hl/c++/Makefile.in b/hl/c++/Makefile.in index 831dadc..7f71fc3 100644 --- a/hl/c++/Makefile.in +++ b/hl/c++/Makefile.in @@ -534,7 +534,6 @@ PAC_FORTRAN_NATIVE_REAL_KIND = @PAC_FORTRAN_NATIVE_REAL_KIND@ PAC_FORTRAN_NATIVE_REAL_SIZEOF = @PAC_FORTRAN_NATIVE_REAL_SIZEOF@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ -PERL = @PERL@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ diff --git a/hl/c++/examples/Makefile.in b/hl/c++/examples/Makefile.in index 67a14ca..fc3237a 100644 --- a/hl/c++/examples/Makefile.in +++ b/hl/c++/examples/Makefile.in @@ -481,7 +481,6 @@ PAC_FORTRAN_NATIVE_REAL_KIND = @PAC_FORTRAN_NATIVE_REAL_KIND@ PAC_FORTRAN_NATIVE_REAL_SIZEOF = @PAC_FORTRAN_NATIVE_REAL_SIZEOF@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ -PERL = @PERL@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ diff --git a/hl/c++/src/Makefile.in b/hl/c++/src/Makefile.in index e4282c4..525bbfc 100644 --- a/hl/c++/src/Makefile.in +++ b/hl/c++/src/Makefile.in @@ -537,7 +537,6 @@ PAC_FORTRAN_NATIVE_REAL_KIND = @PAC_FORTRAN_NATIVE_REAL_KIND@ PAC_FORTRAN_NATIVE_REAL_SIZEOF = @PAC_FORTRAN_NATIVE_REAL_SIZEOF@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ -PERL = @PERL@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ diff --git a/hl/c++/test/Makefile.in b/hl/c++/test/Makefile.in index 4f88242..c22eff8 100644 --- a/hl/c++/test/Makefile.in +++ b/hl/c++/test/Makefile.in @@ -534,7 +534,6 @@ PAC_FORTRAN_NATIVE_REAL_KIND = @PAC_FORTRAN_NATIVE_REAL_KIND@ PAC_FORTRAN_NATIVE_REAL_SIZEOF = @PAC_FORTRAN_NATIVE_REAL_SIZEOF@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ -PERL = @PERL@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ diff --git a/hl/examples/Makefile.in b/hl/examples/Makefile.in index ccf2308..1061124 100644 --- a/hl/examples/Makefile.in +++ b/hl/examples/Makefile.in @@ -481,7 +481,6 @@ PAC_FORTRAN_NATIVE_REAL_KIND = @PAC_FORTRAN_NATIVE_REAL_KIND@ PAC_FORTRAN_NATIVE_REAL_SIZEOF = @PAC_FORTRAN_NATIVE_REAL_SIZEOF@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ -PERL = @PERL@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ diff --git a/hl/fortran/Makefile.in b/hl/fortran/Makefile.in index 6d87e82..bd2ac82 100644 --- a/hl/fortran/Makefile.in +++ b/hl/fortran/Makefile.in @@ -538,7 +538,6 @@ PAC_FORTRAN_NATIVE_REAL_KIND = @PAC_FORTRAN_NATIVE_REAL_KIND@ PAC_FORTRAN_NATIVE_REAL_SIZEOF = @PAC_FORTRAN_NATIVE_REAL_SIZEOF@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ -PERL = @PERL@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ diff --git a/hl/fortran/examples/Makefile.in b/hl/fortran/examples/Makefile.in index 71e70dd..fdbb736 100644 --- a/hl/fortran/examples/Makefile.in +++ b/hl/fortran/examples/Makefile.in @@ -481,7 +481,6 @@ PAC_FORTRAN_NATIVE_REAL_KIND = @PAC_FORTRAN_NATIVE_REAL_KIND@ PAC_FORTRAN_NATIVE_REAL_SIZEOF = @PAC_FORTRAN_NATIVE_REAL_SIZEOF@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ -PERL = @PERL@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ diff --git a/hl/fortran/src/Makefile.in b/hl/fortran/src/Makefile.in index 92c8296..2004753 100644 --- a/hl/fortran/src/Makefile.in +++ b/hl/fortran/src/Makefile.in @@ -566,7 +566,6 @@ PAC_FORTRAN_NATIVE_REAL_KIND = @PAC_FORTRAN_NATIVE_REAL_KIND@ PAC_FORTRAN_NATIVE_REAL_SIZEOF = @PAC_FORTRAN_NATIVE_REAL_SIZEOF@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ -PERL = @PERL@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ diff --git a/hl/fortran/test/Makefile.in b/hl/fortran/test/Makefile.in index ee4b206..3869036 100644 --- a/hl/fortran/test/Makefile.in +++ b/hl/fortran/test/Makefile.in @@ -549,7 +549,6 @@ PAC_FORTRAN_NATIVE_REAL_KIND = @PAC_FORTRAN_NATIVE_REAL_KIND@ PAC_FORTRAN_NATIVE_REAL_SIZEOF = @PAC_FORTRAN_NATIVE_REAL_SIZEOF@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ -PERL = @PERL@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ diff --git a/hl/src/Makefile.in b/hl/src/Makefile.in index 626f9e0..9424b46 100644 --- a/hl/src/Makefile.in +++ b/hl/src/Makefile.in @@ -536,7 +536,6 @@ PAC_FORTRAN_NATIVE_REAL_KIND = @PAC_FORTRAN_NATIVE_REAL_KIND@ PAC_FORTRAN_NATIVE_REAL_SIZEOF = @PAC_FORTRAN_NATIVE_REAL_SIZEOF@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ -PERL = @PERL@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ diff --git a/hl/test/Makefile.in b/hl/test/Makefile.in index 4614152..f55bc3a 100644 --- a/hl/test/Makefile.in +++ b/hl/test/Makefile.in @@ -573,7 +573,6 @@ PAC_FORTRAN_NATIVE_REAL_KIND = @PAC_FORTRAN_NATIVE_REAL_KIND@ PAC_FORTRAN_NATIVE_REAL_SIZEOF = @PAC_FORTRAN_NATIVE_REAL_SIZEOF@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ -PERL = @PERL@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ diff --git a/hl/tools/Makefile.in b/hl/tools/Makefile.in index 653c273..d42f55c 100644 --- a/hl/tools/Makefile.in +++ b/hl/tools/Makefile.in @@ -535,7 +535,6 @@ PAC_FORTRAN_NATIVE_REAL_KIND = @PAC_FORTRAN_NATIVE_REAL_KIND@ PAC_FORTRAN_NATIVE_REAL_SIZEOF = @PAC_FORTRAN_NATIVE_REAL_SIZEOF@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ -PERL = @PERL@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ diff --git a/hl/tools/gif2h5/Makefile.in b/hl/tools/gif2h5/Makefile.in index 6ebf126..5dda20f 100644 --- a/hl/tools/gif2h5/Makefile.in +++ b/hl/tools/gif2h5/Makefile.in @@ -549,7 +549,6 @@ PAC_FORTRAN_NATIVE_REAL_KIND = @PAC_FORTRAN_NATIVE_REAL_KIND@ PAC_FORTRAN_NATIVE_REAL_SIZEOF = @PAC_FORTRAN_NATIVE_REAL_SIZEOF@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ -PERL = @PERL@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ diff --git a/m4/aclocal_fc.m4 b/m4/aclocal_fc.m4 index b7ce048..6d32f10 100644 --- a/m4/aclocal_fc.m4 +++ b/m4/aclocal_fc.m4 @@ -384,17 +384,17 @@ AC_RUN_IFELSE([ dnl -- LINE 4 -- number of valid integer kinds dnl -- LINE 5 -- number of valid real kinds - pac_validIntKinds="`perl -ne '$. == 1 && print && exit' pac_fconftest.out`" - pac_validRealKinds="`perl -ne '$. == 2 && print && exit' pac_fconftest.out`" - PAC_FC_MAX_REAL_PRECISION="`perl -ne '$. == 3 && print && exit' pac_fconftest.out`" + pac_validIntKinds="`sed -n '1p' pac_fconftest.out`" + pac_validRealKinds="`sed -n '2p' pac_fconftest.out`" + PAC_FC_MAX_REAL_PRECISION="`sed -n '3p' pac_fconftest.out`" AC_DEFINE_UNQUOTED([PAC_FC_MAX_REAL_PRECISION], $PAC_FC_MAX_REAL_PRECISION, [Define Fortran Maximum Real Decimal Precision]) PAC_FC_ALL_INTEGER_KINDS="{`echo $pac_validIntKinds`}" PAC_FC_ALL_REAL_KINDS="{`echo $pac_validRealKinds`}" - H5CONFIG_F_NUM_IKIND="INTEGER, PARAMETER :: num_ikinds = `perl -ne '$. == 4 && print && exit' pac_fconftest.out`" + H5CONFIG_F_NUM_IKIND="INTEGER, PARAMETER :: num_ikinds = `sed -n '4p' pac_fconftest.out`" H5CONFIG_F_IKIND="INTEGER, DIMENSION(1:num_ikinds) :: ikind = (/`echo $pac_validIntKinds`/)" - H5CONFIG_F_NUM_RKIND="INTEGER, PARAMETER :: num_rkinds = `perl -ne '$. == 5 && print && exit' pac_fconftest.out`" + H5CONFIG_F_NUM_RKIND="INTEGER, PARAMETER :: num_rkinds = `sed -n '5p' pac_fconftest.out`" H5CONFIG_F_RKIND="INTEGER, DIMENSION(1:num_rkinds) :: rkind = (/`echo $pac_validRealKinds`/)" AC_DEFINE_UNQUOTED([H5CONFIG_F_NUM_RKIND], $H5CONFIG_F_NUM_RKIND, [Define number of valid Fortran REAL KINDs]) @@ -427,7 +427,7 @@ AC_LANG_PUSH([Fortran]) pack_int_sizeof="" rm -f pac_fconftest.out -for kind in `echo $pac_validIntKinds | perl -pe 's/,/ /g'`; do +for kind in `echo $pac_validIntKinds | sed -e 's/,/ /g'`; do AC_LANG_CONFTEST([ AC_LANG_SOURCE([ PROGRAM main @@ -454,7 +454,7 @@ for kind in `echo $pac_validIntKinds | perl -pe 's/,/ /g'`; do pack_int_sizeof="$2" ]) done -PAC_FC_ALL_INTEGER_KINDS_SIZEOF="{`echo $pack_int_sizeof | perl -pe 's/,$//' | perl -pe 's/ //g'`}" +PAC_FC_ALL_INTEGER_KINDS_SIZEOF="{`echo $pack_int_sizeof | sed -e 's/,$//' | sed -e 's/ //g'`}" AC_MSG_RESULT([$PAC_FC_ALL_INTEGER_KINDS_SIZEOF]) AC_LANG_POP([Fortran]) ]) @@ -465,7 +465,7 @@ AC_MSG_CHECKING([sizeof of available REAL KINDs]) AC_LANG_PUSH([Fortran]) pack_real_sizeof="" rm -f pac_fconftest.out -for kind in `echo $pac_validRealKinds| perl -pe 's/,/ /g'`; do +for kind in `echo $pac_validRealKinds | sed -e 's/,/ /g'`; do AC_LANG_CONFTEST([ AC_LANG_SOURCE([ PROGRAM main @@ -492,7 +492,7 @@ for kind in `echo $pac_validRealKinds| perl -pe 's/,/ /g'`; do pack_real_sizeof="$2" ]) done -PAC_FC_ALL_REAL_KINDS_SIZEOF="{`echo $pack_real_sizeof | perl -pe 's/,$//' | perl -pe 's/ //g'`}" +PAC_FC_ALL_REAL_KINDS_SIZEOF="{`echo $pack_real_sizeof | sed -e 's/,$//' | sed -e 's/ //g'`}" AC_MSG_RESULT([$PAC_FC_ALL_REAL_KINDS_SIZEOF]) AC_LANG_POP([Fortran]) ]) @@ -524,12 +524,12 @@ rm -f pac_fconftest.out ]) AC_RUN_IFELSE([],[ if test -s pac_fconftest.out ; then - PAC_FORTRAN_NATIVE_INTEGER_KIND="`perl -ne '$. == 1 && print && exit' pac_fconftest.out`" - PAC_FORTRAN_NATIVE_INTEGER_SIZEOF="`perl -ne '$. == 2 && print && exit' pac_fconftest.out`" - PAC_FORTRAN_NATIVE_REAL_KIND="`perl -ne '$. == 3 && print && exit' pac_fconftest.out`" - PAC_FORTRAN_NATIVE_REAL_SIZEOF="`perl -ne '$. == 4 && print && exit' pac_fconftest.out`" - PAC_FORTRAN_NATIVE_DOUBLE_KIND="`perl -ne '$. == 5 && print && exit' pac_fconftest.out`" - PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF="`perl -ne '$. == 6 && print && exit' pac_fconftest.out`" + PAC_FORTRAN_NATIVE_INTEGER_KIND="`sed -n '1p' pac_fconftest.out`" + PAC_FORTRAN_NATIVE_INTEGER_SIZEOF="`sed -n '2p' pac_fconftest.out`" + PAC_FORTRAN_NATIVE_REAL_KIND="`sed -n '3p' pac_fconftest.out`" + PAC_FORTRAN_NATIVE_REAL_SIZEOF="`sed -n '4p' pac_fconftest.out`" + PAC_FORTRAN_NATIVE_DOUBLE_KIND="`sed -n '5p' pac_fconftest.out`" + PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF="`sed -n '6p' pac_fconftest.out`" else AC_MSG_WARN([No output from test program!]) fi @@ -576,8 +576,8 @@ rm -f pac_Cconftest.out ]) AC_RUN_IFELSE([],[ if test -s pac_Cconftest.out ; then - LDBL_DIG="`perl -ne '$. == 1 && print && exit' pac_Cconftest.out`" - FLT128_DIG="`perl -ne '$. == 2 && print && exit' pac_Cconftest.out`" + LDBL_DIG="`sed -n '1p' pac_Cconftest.out`" + FLT128_DIG="`sed -n '2p' pac_Cconftest.out`" else AC_MSG_WARN([No output from test program!]) fi diff --git a/src/Makefile.in b/src/Makefile.in index 853f98f..5db54f1 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -598,7 +598,6 @@ PAC_FORTRAN_NATIVE_REAL_KIND = @PAC_FORTRAN_NATIVE_REAL_KIND@ PAC_FORTRAN_NATIVE_REAL_SIZEOF = @PAC_FORTRAN_NATIVE_REAL_SIZEOF@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ -PERL = @PERL@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ diff --git a/test/Makefile.in b/test/Makefile.in index d3f1b86..e8877d7 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -941,7 +941,6 @@ PAC_FORTRAN_NATIVE_REAL_KIND = @PAC_FORTRAN_NATIVE_REAL_KIND@ PAC_FORTRAN_NATIVE_REAL_SIZEOF = @PAC_FORTRAN_NATIVE_REAL_SIZEOF@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ -PERL = @PERL@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ diff --git a/testpar/Makefile.in b/testpar/Makefile.in index 5797dfc..e70d05e 100644 --- a/testpar/Makefile.in +++ b/testpar/Makefile.in @@ -568,7 +568,6 @@ PAC_FORTRAN_NATIVE_REAL_KIND = @PAC_FORTRAN_NATIVE_REAL_KIND@ PAC_FORTRAN_NATIVE_REAL_SIZEOF = @PAC_FORTRAN_NATIVE_REAL_SIZEOF@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ -PERL = @PERL@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ diff --git a/tools/Makefile.in b/tools/Makefile.in index 0f5684d..f7121e6 100644 --- a/tools/Makefile.in +++ b/tools/Makefile.in @@ -535,7 +535,6 @@ PAC_FORTRAN_NATIVE_REAL_KIND = @PAC_FORTRAN_NATIVE_REAL_KIND@ PAC_FORTRAN_NATIVE_REAL_SIZEOF = @PAC_FORTRAN_NATIVE_REAL_SIZEOF@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ -PERL = @PERL@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ diff --git a/tools/h5copy/Makefile.in b/tools/h5copy/Makefile.in index 1b50662..57c0a38 100644 --- a/tools/h5copy/Makefile.in +++ b/tools/h5copy/Makefile.in @@ -543,7 +543,6 @@ PAC_FORTRAN_NATIVE_REAL_KIND = @PAC_FORTRAN_NATIVE_REAL_KIND@ PAC_FORTRAN_NATIVE_REAL_SIZEOF = @PAC_FORTRAN_NATIVE_REAL_SIZEOF@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ -PERL = @PERL@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ diff --git a/tools/h5diff/Makefile.in b/tools/h5diff/Makefile.in index 7b4d121..638afd6 100644 --- a/tools/h5diff/Makefile.in +++ b/tools/h5diff/Makefile.in @@ -550,7 +550,6 @@ PAC_FORTRAN_NATIVE_REAL_KIND = @PAC_FORTRAN_NATIVE_REAL_KIND@ PAC_FORTRAN_NATIVE_REAL_SIZEOF = @PAC_FORTRAN_NATIVE_REAL_SIZEOF@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ -PERL = @PERL@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ diff --git a/tools/h5dump/Makefile.in b/tools/h5dump/Makefile.in index 9865e3a..cfb268c 100644 --- a/tools/h5dump/Makefile.in +++ b/tools/h5dump/Makefile.in @@ -549,7 +549,6 @@ PAC_FORTRAN_NATIVE_REAL_KIND = @PAC_FORTRAN_NATIVE_REAL_KIND@ PAC_FORTRAN_NATIVE_REAL_SIZEOF = @PAC_FORTRAN_NATIVE_REAL_SIZEOF@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ -PERL = @PERL@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ diff --git a/tools/h5import/Makefile.in b/tools/h5import/Makefile.in index d6e784a..3185d72 100644 --- a/tools/h5import/Makefile.in +++ b/tools/h5import/Makefile.in @@ -543,7 +543,6 @@ PAC_FORTRAN_NATIVE_REAL_KIND = @PAC_FORTRAN_NATIVE_REAL_KIND@ PAC_FORTRAN_NATIVE_REAL_SIZEOF = @PAC_FORTRAN_NATIVE_REAL_SIZEOF@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ -PERL = @PERL@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ diff --git a/tools/h5jam/Makefile.in b/tools/h5jam/Makefile.in index c915437..8e5f994 100644 --- a/tools/h5jam/Makefile.in +++ b/tools/h5jam/Makefile.in @@ -555,7 +555,6 @@ PAC_FORTRAN_NATIVE_REAL_KIND = @PAC_FORTRAN_NATIVE_REAL_KIND@ PAC_FORTRAN_NATIVE_REAL_SIZEOF = @PAC_FORTRAN_NATIVE_REAL_SIZEOF@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ -PERL = @PERL@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ diff --git a/tools/h5ls/Makefile.in b/tools/h5ls/Makefile.in index 8fb9822..b23d07f 100644 --- a/tools/h5ls/Makefile.in +++ b/tools/h5ls/Makefile.in @@ -535,7 +535,6 @@ PAC_FORTRAN_NATIVE_REAL_KIND = @PAC_FORTRAN_NATIVE_REAL_KIND@ PAC_FORTRAN_NATIVE_REAL_SIZEOF = @PAC_FORTRAN_NATIVE_REAL_SIZEOF@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ -PERL = @PERL@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ diff --git a/tools/h5repack/Makefile.in b/tools/h5repack/Makefile.in index c0b6685..6868523 100644 --- a/tools/h5repack/Makefile.in +++ b/tools/h5repack/Makefile.in @@ -567,7 +567,6 @@ PAC_FORTRAN_NATIVE_REAL_KIND = @PAC_FORTRAN_NATIVE_REAL_KIND@ PAC_FORTRAN_NATIVE_REAL_SIZEOF = @PAC_FORTRAN_NATIVE_REAL_SIZEOF@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ -PERL = @PERL@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ diff --git a/tools/h5stat/Makefile.in b/tools/h5stat/Makefile.in index 6bf37f3..a03b765 100644 --- a/tools/h5stat/Makefile.in +++ b/tools/h5stat/Makefile.in @@ -545,7 +545,6 @@ PAC_FORTRAN_NATIVE_REAL_KIND = @PAC_FORTRAN_NATIVE_REAL_KIND@ PAC_FORTRAN_NATIVE_REAL_SIZEOF = @PAC_FORTRAN_NATIVE_REAL_SIZEOF@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ -PERL = @PERL@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ diff --git a/tools/lib/Makefile.in b/tools/lib/Makefile.in index fcfb019..ab7940e 100644 --- a/tools/lib/Makefile.in +++ b/tools/lib/Makefile.in @@ -532,7 +532,6 @@ PAC_FORTRAN_NATIVE_REAL_KIND = @PAC_FORTRAN_NATIVE_REAL_KIND@ PAC_FORTRAN_NATIVE_REAL_SIZEOF = @PAC_FORTRAN_NATIVE_REAL_SIZEOF@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ -PERL = @PERL@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ diff --git a/tools/misc/Makefile.in b/tools/misc/Makefile.in index 2688e8d..3e6b688 100644 --- a/tools/misc/Makefile.in +++ b/tools/misc/Makefile.in @@ -570,7 +570,6 @@ PAC_FORTRAN_NATIVE_REAL_KIND = @PAC_FORTRAN_NATIVE_REAL_KIND@ PAC_FORTRAN_NATIVE_REAL_SIZEOF = @PAC_FORTRAN_NATIVE_REAL_SIZEOF@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ -PERL = @PERL@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ diff --git a/tools/perform/Makefile.in b/tools/perform/Makefile.in index 4804533..292a65b 100644 --- a/tools/perform/Makefile.in +++ b/tools/perform/Makefile.in @@ -574,7 +574,6 @@ PAC_FORTRAN_NATIVE_REAL_KIND = @PAC_FORTRAN_NATIVE_REAL_KIND@ PAC_FORTRAN_NATIVE_REAL_SIZEOF = @PAC_FORTRAN_NATIVE_REAL_SIZEOF@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ -PERL = @PERL@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ -- cgit v0.12 From 6e0edba918dcbdd62414791d0e2b2f57bc97b8b5 Mon Sep 17 00:00:00 2001 From: Scot Breitenfeld Date: Tue, 18 Aug 2015 17:11:37 -0500 Subject: [svn-r27521] Added test to not remove double precision from valid KINDS if it is the largest compatible REAL with C. Tested: h5committest. --- configure | 18 ++++++++++-------- configure.ac | 15 ++++++++++----- 2 files changed, 20 insertions(+), 13 deletions(-) diff --git a/configure b/configure index c050cf3..42e9b81 100755 --- a/configure +++ b/configure @@ -8393,15 +8393,17 @@ _ACEOF max_real_fortran_kind="`echo \"$PAC_FC_ALL_REAL_KINDS\" | sed -ne 's/.*,\([0-9]*\)\}/\1/p'`" if test "$ac_cv_sizeof___float128" != 0;then - if test "$ac_cv_sizeof___float128" != "$max_real_fortran_sizeof" && test "${ac_cv_sizeof_long_double}" != "$max_real_fortran_sizeof"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: - Fortran REAL(KIND=$max_real_fortran_kind) is $max_real_fortran_sizeof Bytes, but no corresponding C float type exists of that size - !!! Fortran interfaces will not be generated for REAL(KIND=$max_real_fortran_kind) !!! - " >&5 + if test "$ac_cv_sizeof___float128" != "$max_real_fortran_sizeof" && + test "${ac_cv_sizeof_long_double}" != "$max_real_fortran_sizeof" && + test "${ac_cv_sizeof_double}" != "$max_real_fortran_sizeof" ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: + Fortran REAL(KIND=$max_real_fortran_kind) is $max_real_fortran_sizeof Bytes, but no corresponding C float type exists of that size + !!! Fortran interfaces will not be generated for REAL(KIND=$max_real_fortran_kind) !!! + " >&5 $as_echo "$as_me: WARNING: - Fortran REAL(KIND=$max_real_fortran_kind) is $max_real_fortran_sizeof Bytes, but no corresponding C float type exists of that size - !!! Fortran interfaces will not be generated for REAL(KIND=$max_real_fortran_kind) !!! - " >&2;} + Fortran REAL(KIND=$max_real_fortran_kind) is $max_real_fortran_sizeof Bytes, but no corresponding C float type exists of that size + !!! Fortran interfaces will not be generated for REAL(KIND=$max_real_fortran_kind) !!! + " >&2;} PAC_FC_ALL_REAL_KINDS="`echo $PAC_FC_ALL_REAL_KINDS | sed -e 's/,[0-9]\+}/}/g'`" PAC_FC_ALL_REAL_KINDS_SIZEOF="`echo $PAC_FC_ALL_REAL_KINDS_SIZEOF | sed -e 's/,[0-9]\+}/}/g'`" fi diff --git a/configure.ac b/configure.ac index 9ca4440..88d037c 100644 --- a/configure.ac +++ b/configure.ac @@ -571,11 +571,16 @@ if test "X$HDF_FORTRAN" = "Xyes"; then dnl remove the invalid kind from the list if test "$ac_cv_sizeof___float128" != 0;then - if test "$ac_cv_sizeof___float128" != "$max_real_fortran_sizeof" && test "${ac_cv_sizeof_long_double}" != "$max_real_fortran_sizeof"; then - AC_MSG_WARN([ - Fortran REAL(KIND=$max_real_fortran_kind) is $max_real_fortran_sizeof Bytes, but no corresponding C float type exists of that size - !!! Fortran interfaces will not be generated for REAL(KIND=$max_real_fortran_kind) !!! - ]) + if test "$ac_cv_sizeof___float128" != "$max_real_fortran_sizeof" && + test "${ac_cv_sizeof_long_double}" != "$max_real_fortran_sizeof" && + dnl account for the fact that the C compiler can have 16-byte __float128 and the Fortran compiler only has 8-byte doubles, + dnl so we don't want to remove the 8-byte Fortran doubles. This is sometimes the case if different C and Fortran vendors + dnl are used (for example gnu and pgi). + test "${ac_cv_sizeof_double}" != "$max_real_fortran_sizeof" ; then + AC_MSG_WARN([ + Fortran REAL(KIND=$max_real_fortran_kind) is $max_real_fortran_sizeof Bytes, but no corresponding C float type exists of that size + !!! Fortran interfaces will not be generated for REAL(KIND=$max_real_fortran_kind) !!! + ]) PAC_FC_ALL_REAL_KINDS="`echo $PAC_FC_ALL_REAL_KINDS | sed -e 's/,[[0-9]]\+}/}/g'`" PAC_FC_ALL_REAL_KINDS_SIZEOF="`echo $PAC_FC_ALL_REAL_KINDS_SIZEOF | sed -e 's/,[[0-9]]\+}/}/g'`" fi -- cgit v0.12 From 2b4038e5e75dd488cd920e0b2f8e6382ac254bff Mon Sep 17 00:00:00 2001 From: Scot Breitenfeld Date: Wed, 19 Aug 2015 08:40:27 -0500 Subject: [svn-r27524] Added test to not remove double precision from valid KINDS if it is the largest compatible REAL with C. Tested: h5committest. --- config/cmake/HDF5UseFortran.cmake | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/config/cmake/HDF5UseFortran.cmake b/config/cmake/HDF5UseFortran.cmake index b3dec14..02f97f0 100644 --- a/config/cmake/HDF5UseFortran.cmake +++ b/config/cmake/HDF5UseFortran.cmake @@ -351,14 +351,18 @@ set(FORTRAN_SIZEOF_LONG_DOUBLE ${${HDF_PREFIX}_SIZEOF_LONG_DOUBLE}) # remove the invalid kind from the list if(NOT(${SIZEOF___FLOAT128} EQUAL 0)) - if(NOT(${SIZEOF___FLOAT128} EQUAL ${max_real_fortran_sizeof}) AND NOT(${FORTRAN_SIZEOF_LONG_DOUBLE} EQUAL ${max_real_fortran_sizeof})) + if(NOT(${SIZEOF___FLOAT128} EQUAL ${max_real_fortran_sizeof}) + AND NOT(${FORTRAN_SIZEOF_LONG_DOUBLE} EQUAL ${max_real_fortran_sizeof}) + # account for the fact that the C compiler can have 16-byte __float128 and the fortran compiler only has 8-byte doubles, + # so we don't want to remove the 8-byte fortran doubles. + AND NOT(${PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF} EQUAL ${max_real_fortran_sizeof})) message(WARNING " Fortran REAL(KIND=${max_real_fortran_kind}) is $max_real_fortran_sizeof Bytes, but no corresponding C float type exists of that size !!! Fortran interfaces will not be generated for REAL(KIND=${max_real_fortran_kind}) !!!") string(REGEX REPLACE ",[0-9]+}" "}" PAC_FC_ALL_REAL_KINDS ${PAC_FC_ALL_REAL_KINDS}) string(REGEX REPLACE ",[0-9]+}" "}" PAC_FC_ALL_REAL_KINDS_SIZEOF ${PAC_FC_ALL_REAL_KINDS_SIZEOF}) MATH (EXPR NUM_RKIND "${NUM_RKIND} - 1") - endif(NOT(${SIZEOF___FLOAT128} EQUAL ${max_real_fortran_sizeof}) AND NOT(${FORTRAN_SIZEOF_LONG_DOUBLE} EQUAL ${max_real_fortran_sizeof})) + endif() endif(NOT(${SIZEOF___FLOAT128} EQUAL 0)) set(H5CONFIG_F_NUM_RKIND "INTEGER, PARAMETER :: num_rkinds = ${NUM_RKIND}") -- cgit v0.12 From 8db36cc7664ea6b618d7c78cbc70d8736f4b9b5f Mon Sep 17 00:00:00 2001 From: Scot Breitenfeld Date: Wed, 19 Aug 2015 09:50:47 -0500 Subject: [svn-r27525] Added missing H5A_mp_H5AREAD_PTR and H5A_mp_H5AWRITE_PTR definitions. --- fortran/src/hdf5_fortrandll.def.in | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fortran/src/hdf5_fortrandll.def.in b/fortran/src/hdf5_fortrandll.def.in index 7b218ca..e931a97 100644 --- a/fortran/src/hdf5_fortrandll.def.in +++ b/fortran/src/hdf5_fortrandll.def.in @@ -35,6 +35,8 @@ H5A_mp_H5ACREATE_BY_NAME_F H5A_mp_H5AEXISTS_F H5A_mp_H5AEXISTS_BY_NAME_F H5A_mp_H5AOPEN_BY_NAME_F +H5A_mp_H5AWRITE_PTR +H5A_mp_H5AREAD_PTR H5A_mp_H5ARENAME_F ; H5D H5D_mp_H5DCREATE_F -- cgit v0.12 From 1436a07905193713568304dd00b26ca18e982e6f Mon Sep 17 00:00:00 2001 From: Scot Breitenfeld Date: Thu, 20 Aug 2015 11:01:26 -0500 Subject: [svn-r27537] Added new FCCPPFLAGS to avoid passing CPPFLAGS to the fortran pre-processor compiler (This mainly causes issues with the xlf compilers) Tested: h5committest --- MANIFEST | 1 + config/conclude_fc.am | 33 +++++++++++++++++++++++++++++++++ fortran/examples/Makefile.am | 2 +- fortran/examples/Makefile.in | 19 ++++++++++++++++--- fortran/src/Makefile.am | 7 +++---- fortran/src/Makefile.in | 31 ++++++++++++++++--------------- fortran/test/Makefile.am | 2 +- fortran/test/Makefile.in | 29 +++++++++++++++-------------- fortran/testpar/Makefile.am | 2 +- fortran/testpar/Makefile.in | 22 ++++++++++++++++------ hl/fortran/examples/Makefile.am | 2 +- hl/fortran/examples/Makefile.in | 19 ++++++++++++++++--- hl/fortran/src/Makefile.am | 2 +- hl/fortran/src/Makefile.in | 28 ++++++++++++++++------------ hl/fortran/test/Makefile.am | 2 +- hl/fortran/test/Makefile.in | 28 ++++++++++++++++------------ 16 files changed, 154 insertions(+), 75 deletions(-) create mode 100644 config/conclude_fc.am diff --git a/MANIFEST b/MANIFEST index 8fe25ef..b506522 100644 --- a/MANIFEST +++ b/MANIFEST @@ -93,6 +93,7 @@ ./config/cce-flags ./config/commence.am ./config/conclude.am +./config/conclude_fc.am ./config/examples.am ./config/freebsd ./config/gnu-fflags diff --git a/config/conclude_fc.am b/config/conclude_fc.am new file mode 100644 index 0000000..d9e7b56 --- /dev/null +++ b/config/conclude_fc.am @@ -0,0 +1,33 @@ +## config/conclude_fc.am +## (Use double hashes for copyright notice so that automake treats it as +## comments and does not pass it to Makefile.in) +## 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. + + +## Textually included at the end of the Fortran HDF5 Makefiles.am. + +# Makefile.am include fragment with Fortran helper rules and macros. + +# AM_FCCPPFLAGS, FCCPPFLAGS are currently not used. + +PPFCCOMPILE = $(FC) $(FCDEFS) $(DEFAULT_INCLUDES) $(FCINCLUDES) $(AM_FCCPPFLAGS) $(FCCPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) +LTPPFCCOMPILE = $(LIBTOOL) --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(PPFCCOMPILE) + +# Treat all .f90 and .F90 files as preprocessed Fortran. +.f90.o: + $(PPFCCOMPILE) -c -o $@ $(FCFLAGS) $< +.F90.o: + $(PPFCCOMPILE) -c -o $@ $(FCFLAGS) $< + +include $(top_srcdir)/config/conclude.am diff --git a/fortran/examples/Makefile.am b/fortran/examples/Makefile.am index cdd9317..5a3b09e 100644 --- a/fortran/examples/Makefile.am +++ b/fortran/examples/Makefile.am @@ -107,4 +107,4 @@ compound_fortran2003: compound_fortran2003.f90 compound_complex_fortran2003: compound_complex_fortran2003.f90 include $(top_srcdir)/config/examples.am -include $(top_srcdir)/config/conclude.am +include $(top_srcdir)/config/conclude_fc.am diff --git a/fortran/examples/Makefile.in b/fortran/examples/Makefile.in index cfde59c..0ee1461 100644 --- a/fortran/examples/Makefile.in +++ b/fortran/examples/Makefile.in @@ -34,6 +34,10 @@ # We can't tell automake about example programs, because they need to be # built using h5cc (or h5fc, etc.) instead of the standard compilers. # This creates some extra work for us. + +# Makefile.am include fragment with Fortran helper rules and macros. + +# AM_FCCPPFLAGS, FCCPPFLAGS are currently not used. VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ @@ -100,6 +104,7 @@ build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(top_srcdir)/config/commence.am \ $(top_srcdir)/config/examples.am \ + $(top_srcdir)/config/conclude_fc.am \ $(top_srcdir)/config/conclude.am $(srcdir)/Makefile.in \ $(srcdir)/Makefile.am $(top_srcdir)/bin/mkinstalldirs \ $(srcdir)/run-fortran-ex.sh.in $(srcdir)/testh5fc.sh.in \ @@ -662,6 +667,8 @@ EXTRA_PROG = $(EXAMPLE_PROG) $(EXAMPLE_PROG_PARA) # We need to tell automake what to clean MOSTLYCLEANFILES = *.raw *.meta *.o CLEANFILES = $(EXAMPLE_PROG) $(EXAMPLE_PROG_PARA) +PPFCCOMPILE = $(FC) $(FCDEFS) $(DEFAULT_INCLUDES) $(FCINCLUDES) $(AM_FCCPPFLAGS) $(FCCPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) +LTPPFCCOMPILE = $(LIBTOOL) --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(PPFCCOMPILE) # Automake needs to be taught how to build lib, progs, and tests targets. # These will be filled in automatically for the most part (e.g., @@ -685,8 +692,8 @@ TEST_SCRIPT_PARA_CHKSH = $(TEST_SCRIPT_PARA:=.chkexe_) all: all-am .SUFFIXES: -.SUFFIXES: .log .sh .sh$(EXEEXT) .trs -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/config/commence.am $(top_srcdir)/config/examples.am $(top_srcdir)/config/conclude.am $(am__configure_deps) +.SUFFIXES: .F90 .f90 .log .o .sh .sh$(EXEEXT) .trs +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/config/commence.am $(top_srcdir)/config/examples.am $(top_srcdir)/config/conclude_fc.am $(top_srcdir)/config/conclude.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -707,7 +714,7 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; -$(top_srcdir)/config/commence.am $(top_srcdir)/config/examples.am $(top_srcdir)/config/conclude.am: +$(top_srcdir)/config/commence.am $(top_srcdir)/config/examples.am $(top_srcdir)/config/conclude_fc.am $(top_srcdir)/config/conclude.am: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh @@ -1155,6 +1162,12 @@ installcheck-local: /bin/sh ./$(TEST_EXAMPLES_SCRIPT);) \ fi +# Treat all .f90 and .F90 files as preprocessed Fortran. +.f90.o: + $(PPFCCOMPILE) -c -o $@ $(FCFLAGS) $< +.F90.o: + $(PPFCCOMPILE) -c -o $@ $(FCFLAGS) $< + # lib/progs/tests targets recurse into subdirectories. build-* targets # build files in this directory. build-lib: $(LIB) diff --git a/fortran/src/Makefile.am b/fortran/src/Makefile.am index 734f46e..eb45f60 100644 --- a/fortran/src/Makefile.am +++ b/fortran/src/Makefile.am @@ -58,9 +58,8 @@ libhdf5_fortran_la_LIBADD=$(LIBHDF5) DISTCLEANFILES=h5fc # H5fortran_types.F90 and H5f90i.h are automatically generaed by -# H5match_types, and must be cleaned explicitly. H5fort_type_defines.h -# is generated by H5fortran_detect -MOSTLYCLEANFILES=H5fortran_types.F90 H5f90i_gen.h H5fort_type_defines.h +# H5match_types, and must be cleaned explicitly. +MOSTLYCLEANFILES=H5fortran_types.F90 H5f90i_gen.h # Fortran module files can have different extensions and different names # (e.g., different capitalizations) on different platforms. Write rules @@ -167,4 +166,4 @@ HDF5.lo: $(srcdir)/HDF5.F90 H5f90global.lo H5_ff.lo H5Aff.lo \ H5Off.lo H5Pff.lo H5Rff.lo \ H5Sff.lo H5Tff.lo H5Zff.lo H5_gen.lo -include $(top_srcdir)/config/conclude.am +include $(top_srcdir)/config/conclude_fc.am diff --git a/fortran/src/Makefile.in b/fortran/src/Makefile.in index 2a0099c..3f95f08 100644 --- a/fortran/src/Makefile.in +++ b/fortran/src/Makefile.in @@ -31,6 +31,10 @@ # HDF5 Fortran Library Makefile(.in) # +# Makefile.am include fragment with Fortran helper rules and macros. + +# AM_FCCPPFLAGS, FCCPPFLAGS are currently not used. + VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' @@ -98,6 +102,7 @@ build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(top_srcdir)/config/commence.am \ $(top_srcdir)/config/lt_vers.am \ + $(top_srcdir)/config/conclude_fc.am \ $(top_srcdir)/config/conclude.am $(srcdir)/Makefile.in \ $(srcdir)/Makefile.am $(srcdir)/H5config_f.inc.in \ $(top_srcdir)/bin/mkinstalldirs $(srcdir)/h5fc.in \ @@ -188,12 +193,6 @@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src depcomp = $(SHELL) $(top_srcdir)/bin/depcomp am__depfiles_maybe = depfiles am__mv = mv -f -PPFCCOMPILE = $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -LTPPFCCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=FC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) \ - $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_FCFLAGS) $(FCFLAGS) AM_V_PPFC = $(am__v_PPFC_@AM_V@) am__v_PPFC_ = $(am__v_PPFC_@AM_DEFAULT_V@) am__v_PPFC_0 = @echo " PPFC " $@; @@ -755,7 +754,7 @@ DISTCLEANFILES = h5fc # H5fortran_types.F90 and H5f90i.h are automatically generaed by # H5match_types, and must be cleaned explicitly. H5fort_type_defines.h # is generated by H5fortran_detect -MOSTLYCLEANFILES = H5fortran_types.F90 H5f90i_gen.h H5fort_type_defines.h +MOSTLYCLEANFILES = H5fortran_types.F90 H5f90i_gen.h @BUILD_PARALLEL_CONDITIONAL_FALSE@H5FC_NAME = h5fc # Custom rule for installing h5fc, since it will be named h5pfc if hdf5 @@ -773,6 +772,8 @@ H5_buildiface_SOURCES = H5_buildiface.F90 # Mark this directory as part of the Fortran API FORTRAN_API = yes +PPFCCOMPILE = $(FC) $(FCDEFS) $(DEFAULT_INCLUDES) $(FCINCLUDES) $(AM_FCCPPFLAGS) $(FCCPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) +LTPPFCCOMPILE = $(LIBTOOL) --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(PPFCCOMPILE) # Automake needs to be taught how to build lib, progs, and tests targets. # These will be filled in automatically for the most part (e.g., @@ -798,7 +799,7 @@ all: $(BUILT_SOURCES) H5config_f.inc .SUFFIXES: .SUFFIXES: .F90 .c .f90 .lo .log .o .obj .sh .sh$(EXEEXT) .trs -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/config/commence.am $(top_srcdir)/config/lt_vers.am $(top_srcdir)/config/conclude.am $(am__configure_deps) +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/config/commence.am $(top_srcdir)/config/lt_vers.am $(top_srcdir)/config/conclude_fc.am $(top_srcdir)/config/conclude.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -819,7 +820,7 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; -$(top_srcdir)/config/commence.am $(top_srcdir)/config/lt_vers.am $(top_srcdir)/config/conclude.am: +$(top_srcdir)/config/commence.am $(top_srcdir)/config/lt_vers.am $(top_srcdir)/config/conclude_fc.am $(top_srcdir)/config/conclude.am: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh @@ -923,9 +924,6 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5f90kit.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5match_types.Po@am__quote@ -.F90.o: - $(AM_V_PPFC)$(PPFCCOMPILE) -c -o $@ $< - .F90.obj: $(AM_V_PPFC)$(PPFCCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` @@ -953,9 +951,6 @@ distclean-compile: @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< -.f90.o: - $(AM_V_FC)$(FCCOMPILE) -c -o $@ $(FCFLAGS_f90) $< - .f90.obj: $(AM_V_FC)$(FCCOMPILE) -c -o $@ $(FCFLAGS_f90) `$(CYGPATH_W) '$<'` @@ -1429,6 +1424,12 @@ HDF5.lo: $(srcdir)/HDF5.F90 H5f90global.lo H5_ff.lo H5Aff.lo \ H5Off.lo H5Pff.lo H5Rff.lo \ H5Sff.lo H5Tff.lo H5Zff.lo H5_gen.lo +# Treat all .f90 and .F90 files as preprocessed Fortran. +.f90.o: + $(PPFCCOMPILE) -c -o $@ $(FCFLAGS) $< +.F90.o: + $(PPFCCOMPILE) -c -o $@ $(FCFLAGS) $< + # lib/progs/tests targets recurse into subdirectories. build-* targets # build files in this directory. build-lib: $(LIB) diff --git a/fortran/test/Makefile.am b/fortran/test/Makefile.am index 608b1e9..29c41ec 100644 --- a/fortran/test/Makefile.am +++ b/fortran/test/Makefile.am @@ -106,4 +106,4 @@ H5_test_buildiface_LDADD = fflush2.chkexe_: fflush1.chkexe_ -include $(top_srcdir)/config/conclude.am +include $(top_srcdir)/config/conclude_fc.am diff --git a/fortran/test/Makefile.in b/fortran/test/Makefile.in index 0d1a8cc..e65ed45 100644 --- a/fortran/test/Makefile.in +++ b/fortran/test/Makefile.in @@ -14,6 +14,10 @@ @SET_MAKE@ +# Makefile.am include fragment with Fortran helper rules and macros. + +# AM_FCCPPFLAGS, FCCPPFLAGS are currently not used. + VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' @@ -80,6 +84,7 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(top_srcdir)/config/commence.am \ + $(top_srcdir)/config/conclude_fc.am \ $(top_srcdir)/config/conclude.am $(srcdir)/Makefile.in \ $(srcdir)/Makefile.am $(top_srcdir)/bin/mkinstalldirs \ $(top_srcdir)/bin/depcomp $(top_srcdir)/bin/test-driver @@ -175,12 +180,6 @@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src -I$(top_builddir)/fortran depcomp = $(SHELL) $(top_srcdir)/bin/depcomp am__depfiles_maybe = depfiles am__mv = mv -f -PPFCCOMPILE = $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -LTPPFCCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=FC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) \ - $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_FCFLAGS) $(FCFLAGS) AM_V_PPFC = $(am__v_PPFC_@AM_V@) am__v_PPFC_ = $(am__v_PPFC_@AM_DEFAULT_V@) am__v_PPFC_0 = @echo " PPFC " $@; @@ -780,6 +779,8 @@ H5_test_buildiface_SOURCES = H5_test_buildiface.F90 # The build of the H5_test_buildiface does depend on any libraries, so set it # to nothing. H5_test_buildiface_LDADD = +PPFCCOMPILE = $(FC) $(FCDEFS) $(DEFAULT_INCLUDES) $(FCINCLUDES) $(AM_FCCPPFLAGS) $(FCCPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) +LTPPFCCOMPILE = $(LIBTOOL) --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(PPFCCOMPILE) # Automake needs to be taught how to build lib, progs, and tests targets. # These will be filled in automatically for the most part (e.g., @@ -804,7 +805,7 @@ all: all-am .SUFFIXES: .SUFFIXES: .F90 .c .f90 .lo .log .o .obj .sh .sh$(EXEEXT) .trs -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/config/commence.am $(top_srcdir)/config/conclude.am $(am__configure_deps) +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/config/commence.am $(top_srcdir)/config/conclude_fc.am $(top_srcdir)/config/conclude.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -825,7 +826,7 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; -$(top_srcdir)/config/commence.am $(top_srcdir)/config/conclude.am: +$(top_srcdir)/config/commence.am $(top_srcdir)/config/conclude_fc.am $(top_srcdir)/config/conclude.am: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh @@ -900,9 +901,6 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t.Plo@am__quote@ -.F90.o: - $(AM_V_PPFC)$(PPFCCOMPILE) -c -o $@ $< - .F90.obj: $(AM_V_PPFC)$(PPFCCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` @@ -930,9 +928,6 @@ distclean-compile: @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< -.f90.o: - $(AM_V_FC)$(FCCOMPILE) -c -o $@ $(FCFLAGS_f90) $< - .f90.obj: $(AM_V_FC)$(FCCOMPILE) -c -o $@ $(FCFLAGS_f90) `$(CYGPATH_W) '$<'` @@ -1478,6 +1473,12 @@ tf_gen.F90: H5_test_buildiface$(EXEEXT) # fflush2 depends on files created by fflush1 fflush2.chkexe_: fflush1.chkexe_ +# Treat all .f90 and .F90 files as preprocessed Fortran. +.f90.o: + $(PPFCCOMPILE) -c -o $@ $(FCFLAGS) $< +.F90.o: + $(PPFCCOMPILE) -c -o $@ $(FCFLAGS) $< + # lib/progs/tests targets recurse into subdirectories. build-* targets # build files in this directory. build-lib: $(LIB) diff --git a/fortran/testpar/Makefile.am b/fortran/testpar/Makefile.am index 517a3c8..380f475 100644 --- a/fortran/testpar/Makefile.am +++ b/fortran/testpar/Makefile.am @@ -50,4 +50,4 @@ LDADD=$(LIBH5FTEST) $(LIBH5TEST) $(LIBH5F) $(LIBHDF5) # Mark this directory as part of the Fortran API FORTRAN_API=yes -include $(top_srcdir)/config/conclude.am +include $(top_srcdir)/config/conclude_fc.am diff --git a/fortran/testpar/Makefile.in b/fortran/testpar/Makefile.in index 9e23ee3..9ee38d5 100644 --- a/fortran/testpar/Makefile.in +++ b/fortran/testpar/Makefile.in @@ -30,6 +30,10 @@ # # HDF5 Fortran Parallel Library Test Makefile(.in) # + +# Makefile.am include fragment with Fortran helper rules and macros. + +# AM_FCCPPFLAGS, FCCPPFLAGS are currently not used. VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ @@ -95,6 +99,7 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(top_srcdir)/config/commence.am \ + $(top_srcdir)/config/conclude_fc.am \ $(top_srcdir)/config/conclude.am $(srcdir)/Makefile.in \ $(srcdir)/Makefile.am $(top_srcdir)/bin/mkinstalldirs \ $(top_srcdir)/bin/test-driver @@ -685,6 +690,8 @@ LDADD = $(LIBH5FTEST) $(LIBH5TEST) $(LIBH5F) $(LIBHDF5) # Mark this directory as part of the Fortran API FORTRAN_API = yes +PPFCCOMPILE = $(FC) $(FCDEFS) $(DEFAULT_INCLUDES) $(FCINCLUDES) $(AM_FCCPPFLAGS) $(FCCPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) +LTPPFCCOMPILE = $(LIBTOOL) --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(PPFCCOMPILE) # Automake needs to be taught how to build lib, progs, and tests targets. # These will be filled in automatically for the most part (e.g., @@ -708,8 +715,8 @@ TEST_SCRIPT_PARA_CHKSH = $(TEST_SCRIPT_PARA:=.chkexe_) all: all-am .SUFFIXES: -.SUFFIXES: .f90 .lo .log .o .obj .sh .sh$(EXEEXT) .trs -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/config/commence.am $(top_srcdir)/config/conclude.am $(am__configure_deps) +.SUFFIXES: .F90 .f90 .lo .log .o .obj .sh .sh$(EXEEXT) .trs +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/config/commence.am $(top_srcdir)/config/conclude_fc.am $(top_srcdir)/config/conclude.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -730,7 +737,7 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; -$(top_srcdir)/config/commence.am $(top_srcdir)/config/conclude.am: +$(top_srcdir)/config/commence.am $(top_srcdir)/config/conclude_fc.am $(top_srcdir)/config/conclude.am: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh @@ -760,9 +767,6 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c -.f90.o: - $(AM_V_FC)$(FCCOMPILE) -c -o $@ $(FCFLAGS_f90) $< - .f90.obj: $(AM_V_FC)$(FCCOMPILE) -c -o $@ $(FCFLAGS_f90) `$(CYGPATH_W) '$<'` @@ -1138,6 +1142,12 @@ uninstall-am: help: @$(top_srcdir)/bin/makehelp +# Treat all .f90 and .F90 files as preprocessed Fortran. +.f90.o: + $(PPFCCOMPILE) -c -o $@ $(FCFLAGS) $< +.F90.o: + $(PPFCCOMPILE) -c -o $@ $(FCFLAGS) $< + # lib/progs/tests targets recurse into subdirectories. build-* targets # build files in this directory. build-lib: $(LIB) diff --git a/hl/fortran/examples/Makefile.am b/hl/fortran/examples/Makefile.am index 6a5032b..997da73 100644 --- a/hl/fortran/examples/Makefile.am +++ b/hl/fortran/examples/Makefile.am @@ -64,4 +64,4 @@ EXAMPLETOPDIR=${DESTDIR}$(exec_prefix)/share/hdf5_examples/hl # and fortran libraries above. include $(top_srcdir)/config/examples.am -include $(top_srcdir)/config/conclude.am +include $(top_srcdir)/config/conclude_fc.am diff --git a/hl/fortran/examples/Makefile.in b/hl/fortran/examples/Makefile.in index fdbb736..c992e8a 100644 --- a/hl/fortran/examples/Makefile.in +++ b/hl/fortran/examples/Makefile.in @@ -34,6 +34,10 @@ # We can't tell automake about example programs, because they need to be # built using h5cc (or h5fc, etc.) instead of the standard compilers. # This creates some extra work for us. + +# Makefile.am include fragment with Fortran helper rules and macros. + +# AM_FCCPPFLAGS, FCCPPFLAGS are currently not used. VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ @@ -100,6 +104,7 @@ build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(top_srcdir)/config/commence.am \ $(top_srcdir)/config/examples.am \ + $(top_srcdir)/config/conclude_fc.am \ $(top_srcdir)/config/conclude.am $(srcdir)/Makefile.in \ $(srcdir)/Makefile.am $(top_srcdir)/bin/mkinstalldirs \ $(srcdir)/run-hlfortran-ex.sh.in $(top_srcdir)/bin/test-driver @@ -650,6 +655,8 @@ EXTRA_PROG = $(EXAMPLE_PROG) $(EXAMPLE_PROG_PARA) # We need to tell automake what to clean MOSTLYCLEANFILES = *.raw *.meta *.o CLEANFILES = $(EXAMPLE_PROG) $(EXAMPLE_PROG_PARA) +PPFCCOMPILE = $(FC) $(FCDEFS) $(DEFAULT_INCLUDES) $(FCINCLUDES) $(AM_FCCPPFLAGS) $(FCCPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) +LTPPFCCOMPILE = $(LIBTOOL) --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(PPFCCOMPILE) # Automake needs to be taught how to build lib, progs, and tests targets. # These will be filled in automatically for the most part (e.g., @@ -673,8 +680,8 @@ TEST_SCRIPT_PARA_CHKSH = $(TEST_SCRIPT_PARA:=.chkexe_) all: all-am .SUFFIXES: -.SUFFIXES: .log .sh .sh$(EXEEXT) .trs -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/config/commence.am $(top_srcdir)/config/examples.am $(top_srcdir)/config/conclude.am $(am__configure_deps) +.SUFFIXES: .F90 .f90 .log .o .sh .sh$(EXEEXT) .trs +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/config/commence.am $(top_srcdir)/config/examples.am $(top_srcdir)/config/conclude_fc.am $(top_srcdir)/config/conclude.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -695,7 +702,7 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; -$(top_srcdir)/config/commence.am $(top_srcdir)/config/examples.am $(top_srcdir)/config/conclude.am: +$(top_srcdir)/config/commence.am $(top_srcdir)/config/examples.am $(top_srcdir)/config/conclude_fc.am $(top_srcdir)/config/conclude.am: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh @@ -1105,6 +1112,12 @@ installcheck-local: /bin/sh ./$(TEST_EXAMPLES_SCRIPT);) \ fi +# Treat all .f90 and .F90 files as preprocessed Fortran. +.f90.o: + $(PPFCCOMPILE) -c -o $@ $(FCFLAGS) $< +.F90.o: + $(PPFCCOMPILE) -c -o $@ $(FCFLAGS) $< + # lib/progs/tests targets recurse into subdirectories. build-* targets # build files in this directory. build-lib: $(LIB) diff --git a/hl/fortran/src/Makefile.am b/hl/fortran/src/Makefile.am index 6457f81..d190ed1 100644 --- a/hl/fortran/src/Makefile.am +++ b/hl/fortran/src/Makefile.am @@ -102,4 +102,4 @@ H5IMff.lo: $(srcdir)/H5IMff.F90 H5TBff.lo: $(srcdir)/H5TBff.F90 H5LTff_gen.lo: H5LTff.lo H5LTff_gen.F90 H5TBff_gen.lo: H5TBff.lo H5LTff_gen.F90 H5TBff_gen.F90 -include $(top_srcdir)/config/conclude.am +include $(top_srcdir)/config/conclude_fc.am diff --git a/hl/fortran/src/Makefile.in b/hl/fortran/src/Makefile.in index 2004753..12a91b0 100644 --- a/hl/fortran/src/Makefile.in +++ b/hl/fortran/src/Makefile.in @@ -31,6 +31,10 @@ # # HDF5 High-Level Fortran Makefile(.in) +# Makefile.am include fragment with Fortran helper rules and macros. + +# AM_FCCPPFLAGS, FCCPPFLAGS are currently not used. + VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' @@ -98,6 +102,7 @@ build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(top_srcdir)/config/commence.am \ $(top_srcdir)/config/lt_vers.am \ + $(top_srcdir)/config/conclude_fc.am \ $(top_srcdir)/config/conclude.am $(srcdir)/Makefile.in \ $(srcdir)/Makefile.am $(top_srcdir)/bin/mkinstalldirs \ $(top_srcdir)/bin/depcomp $(top_srcdir)/bin/test-driver @@ -181,12 +186,6 @@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src -I$(top_builddir)/fortran depcomp = $(SHELL) $(top_srcdir)/bin/depcomp am__depfiles_maybe = depfiles am__mv = mv -f -PPFCCOMPILE = $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -LTPPFCCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=FC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) \ - $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_FCFLAGS) $(FCFLAGS) AM_V_PPFC = $(am__v_PPFC_@AM_V@) am__v_PPFC_ = $(am__v_PPFC_@AM_DEFAULT_V@) am__v_PPFC_0 = @echo " PPFC " $@; @@ -736,6 +735,8 @@ libhdf5hl_fortran_la_LIBADD = $(LIBH5_HL) $(LIBH5F) # H5HL_buildiface.F90 is included in the distribution, and Automake knows # how to compile a fortran program given its sources. H5HL_buildiface_SOURCES = H5HL_buildiface.F90 +PPFCCOMPILE = $(FC) $(FCDEFS) $(DEFAULT_INCLUDES) $(FCINCLUDES) $(AM_FCCPPFLAGS) $(FCCPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) +LTPPFCCOMPILE = $(LIBTOOL) --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(PPFCCOMPILE) # Automake needs to be taught how to build lib, progs, and tests targets. # These will be filled in automatically for the most part (e.g., @@ -759,8 +760,8 @@ TEST_SCRIPT_PARA_CHKSH = $(TEST_SCRIPT_PARA:=.chkexe_) all: all-am .SUFFIXES: -.SUFFIXES: .F90 .c .lo .log .o .obj .sh .sh$(EXEEXT) .trs -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/config/commence.am $(top_srcdir)/config/lt_vers.am $(top_srcdir)/config/conclude.am $(am__configure_deps) +.SUFFIXES: .F90 .c .f90 .lo .log .o .obj .sh .sh$(EXEEXT) .trs +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/config/commence.am $(top_srcdir)/config/lt_vers.am $(top_srcdir)/config/conclude_fc.am $(top_srcdir)/config/conclude.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -781,7 +782,7 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; -$(top_srcdir)/config/commence.am $(top_srcdir)/config/lt_vers.am $(top_srcdir)/config/conclude.am: +$(top_srcdir)/config/commence.am $(top_srcdir)/config/lt_vers.am $(top_srcdir)/config/conclude_fc.am $(top_srcdir)/config/conclude.am: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh @@ -855,9 +856,6 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5LTfc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5TBfc.Plo@am__quote@ -.F90.o: - $(AM_V_PPFC)$(PPFCCOMPILE) -c -o $@ $< - .F90.obj: $(AM_V_PPFC)$(PPFCCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` @@ -1317,6 +1315,12 @@ H5TBff.lo: $(srcdir)/H5TBff.F90 H5LTff_gen.lo: H5LTff.lo H5LTff_gen.F90 H5TBff_gen.lo: H5TBff.lo H5LTff_gen.F90 H5TBff_gen.F90 +# Treat all .f90 and .F90 files as preprocessed Fortran. +.f90.o: + $(PPFCCOMPILE) -c -o $@ $(FCFLAGS) $< +.F90.o: + $(PPFCCOMPILE) -c -o $@ $(FCFLAGS) $< + # lib/progs/tests targets recurse into subdirectories. build-* targets # build files in this directory. build-lib: $(LIB) diff --git a/hl/fortran/test/Makefile.am b/hl/fortran/test/Makefile.am index 18fdaf3..ca49817 100644 --- a/hl/fortran/test/Makefile.am +++ b/hl/fortran/test/Makefile.am @@ -51,4 +51,4 @@ CHECK_CLEANFILES+=dsetf[1-5].h5 f1img.h5 f1tab.h5 tstds.h5 # from tests in conclude.am) FORTRAN_API=yes -include $(top_srcdir)/config/conclude.am +include $(top_srcdir)/config/conclude_fc.am diff --git a/hl/fortran/test/Makefile.in b/hl/fortran/test/Makefile.in index 3869036..da46790 100644 --- a/hl/fortran/test/Makefile.in +++ b/hl/fortran/test/Makefile.in @@ -30,6 +30,10 @@ # # # HDF5 High-Level Fortran Makefile(.in) + +# Makefile.am include fragment with Fortran helper rules and macros. + +# AM_FCCPPFLAGS, FCCPPFLAGS are currently not used. VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ @@ -95,6 +99,7 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(top_srcdir)/config/commence.am \ + $(top_srcdir)/config/conclude_fc.am \ $(top_srcdir)/config/conclude.am $(srcdir)/Makefile.in \ $(srcdir)/Makefile.am $(top_srcdir)/bin/mkinstalldirs \ $(top_srcdir)/bin/test-driver @@ -151,12 +156,6 @@ am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src -I$(top_builddir)/fortran/src -PPFCCOMPILE = $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -LTPPFCCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=FC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=compile $(FC) $(DEFS) \ - $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_FCFLAGS) $(FCFLAGS) AM_V_PPFC = $(am__v_PPFC_@AM_V@) am__v_PPFC_ = $(am__v_PPFC_@AM_DEFAULT_V@) am__v_PPFC_0 = @echo " PPFC " $@; @@ -703,6 +702,8 @@ tsttable_SOURCES = tsttable.F90 # Mark this directory as part of the Fortran API (this affects output # from tests in conclude.am) FORTRAN_API = yes +PPFCCOMPILE = $(FC) $(FCDEFS) $(DEFAULT_INCLUDES) $(FCINCLUDES) $(AM_FCCPPFLAGS) $(FCCPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) +LTPPFCCOMPILE = $(LIBTOOL) --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(PPFCCOMPILE) # Automake needs to be taught how to build lib, progs, and tests targets. # These will be filled in automatically for the most part (e.g., @@ -726,8 +727,8 @@ TEST_SCRIPT_PARA_CHKSH = $(TEST_SCRIPT_PARA:=.chkexe_) all: all-am .SUFFIXES: -.SUFFIXES: .F90 .lo .log .o .obj .sh .sh$(EXEEXT) .trs -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/config/commence.am $(top_srcdir)/config/conclude.am $(am__configure_deps) +.SUFFIXES: .F90 .f90 .lo .log .o .obj .sh .sh$(EXEEXT) .trs +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/config/commence.am $(top_srcdir)/config/conclude_fc.am $(top_srcdir)/config/conclude.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -748,7 +749,7 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; -$(top_srcdir)/config/commence.am $(top_srcdir)/config/conclude.am: +$(top_srcdir)/config/commence.am $(top_srcdir)/config/conclude_fc.am $(top_srcdir)/config/conclude.am: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh @@ -790,9 +791,6 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c -.F90.o: - $(AM_V_PPFC)$(PPFCCOMPILE) -c -o $@ $< - .F90.obj: $(AM_V_PPFC)$(PPFCCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` @@ -1196,6 +1194,12 @@ uninstall-am: help: @$(top_srcdir)/bin/makehelp +# Treat all .f90 and .F90 files as preprocessed Fortran. +.f90.o: + $(PPFCCOMPILE) -c -o $@ $(FCFLAGS) $< +.F90.o: + $(PPFCCOMPILE) -c -o $@ $(FCFLAGS) $< + # lib/progs/tests targets recurse into subdirectories. build-* targets # build files in this directory. build-lib: $(LIB) -- cgit v0.12 From 1b2b0bd5a30cbc4227457abd08f563a8fd8c8b68 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 20 Aug 2015 12:03:29 -0500 Subject: [svn-r27540] Replace svn:externals with hard copy of files --- config/cmake_ext_mod/CTestCustom.cmake | 16 + config/cmake_ext_mod/CheckTypeSize.cmake | 50 ++ config/cmake_ext_mod/ConfigureChecks.cmake | 756 ++++++++++++++++++ config/cmake_ext_mod/FindMPI.cmake | 684 +++++++++++++++++ config/cmake_ext_mod/FindSZIP.cmake | 172 +++++ config/cmake_ext_mod/GetTimeOfDayTest.cpp | 15 + config/cmake_ext_mod/HDFCXXTests.cpp | 56 ++ config/cmake_ext_mod/HDFLibMacros.cmake | 270 +++++++ config/cmake_ext_mod/HDFMacros.cmake | 277 +++++++ config/cmake_ext_mod/HDFTests.c | 466 ++++++++++++ config/cmake_ext_mod/HDFUseFortran.cmake | 176 +++++ config/cmake_ext_mod/NSIS.InstallOptions.ini.in | 37 + config/cmake_ext_mod/NSIS.template.in | 974 ++++++++++++++++++++++++ config/cmake_ext_mod/grepTest.cmake | 64 ++ config/cmake_ext_mod/hdf.bmp | Bin 0 -> 1254 bytes config/cmake_ext_mod/hdf.icns | Bin 0 -> 326012 bytes config/cmake_ext_mod/hdf.ico | Bin 0 -> 23558 bytes config/cmake_ext_mod/prunTest.cmake | 145 ++++ config/cmake_ext_mod/runTest.cmake | 207 +++++ config/cmake_ext_mod/version.plist.in | 17 + 20 files changed, 4382 insertions(+) create mode 100644 config/cmake_ext_mod/CTestCustom.cmake create mode 100644 config/cmake_ext_mod/CheckTypeSize.cmake create mode 100644 config/cmake_ext_mod/ConfigureChecks.cmake create mode 100644 config/cmake_ext_mod/FindMPI.cmake create mode 100644 config/cmake_ext_mod/FindSZIP.cmake create mode 100644 config/cmake_ext_mod/GetTimeOfDayTest.cpp create mode 100644 config/cmake_ext_mod/HDFCXXTests.cpp create mode 100644 config/cmake_ext_mod/HDFLibMacros.cmake create mode 100644 config/cmake_ext_mod/HDFMacros.cmake create mode 100644 config/cmake_ext_mod/HDFTests.c create mode 100644 config/cmake_ext_mod/HDFUseFortran.cmake create mode 100644 config/cmake_ext_mod/NSIS.InstallOptions.ini.in create mode 100644 config/cmake_ext_mod/NSIS.template.in create mode 100644 config/cmake_ext_mod/grepTest.cmake create mode 100644 config/cmake_ext_mod/hdf.bmp create mode 100644 config/cmake_ext_mod/hdf.icns create mode 100644 config/cmake_ext_mod/hdf.ico create mode 100644 config/cmake_ext_mod/prunTest.cmake create mode 100644 config/cmake_ext_mod/runTest.cmake create mode 100644 config/cmake_ext_mod/version.plist.in diff --git a/config/cmake_ext_mod/CTestCustom.cmake b/config/cmake_ext_mod/CTestCustom.cmake new file mode 100644 index 0000000..025bce4 --- /dev/null +++ b/config/cmake_ext_mod/CTestCustom.cmake @@ -0,0 +1,16 @@ +set (CTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS 3000) + +set (CTEST_CUSTOM_WARNING_EXCEPTION + ${CTEST_CUSTOM_WARNING_EXCEPTION} + "note.*expected.*void.*but argument is of type.*volatile" + "SZIP.src.*:[ \t]*warning" + "jpeg.src.*:[ \t]*warning" + "POSIX name for this item is deprecated" + "disabling jobserver mode" + "warning.*implicit declaration of function" + "note: expanded from macro" +) + +set (CTEST_CUSTOM_MEMCHECK_IGNORE + ${CTEST_CUSTOM_MEMCHECK_IGNORE} +) diff --git a/config/cmake_ext_mod/CheckTypeSize.cmake b/config/cmake_ext_mod/CheckTypeSize.cmake new file mode 100644 index 0000000..5095a27 --- /dev/null +++ b/config/cmake_ext_mod/CheckTypeSize.cmake @@ -0,0 +1,50 @@ +# +# Check if the type exists and determine size of type. if the type +# exists, the size will be stored to the variable. +# +# CHECK_TYPE_SIZE - macro which checks the size of type +# VARIABLE - variable to store size if the type exists. +# HAVE_${VARIABLE} - does the variable exists or not +# + +MACRO (HDF_CHECK_TYPE_SIZE TYPE VARIABLE) + set (CMAKE_ALLOW_UNKNOWN_VARIABLE_READ_ACCESS 1) + if ("HAVE_${VARIABLE}" MATCHES "^HAVE_${VARIABLE}$") + set (MACRO_CHECK_TYPE_SIZE_FLAGS + "-DCHECK_TYPE_SIZE_TYPE=\"${TYPE}\" ${CMAKE_REQUIRED_FLAGS}" + ) + foreach (def HAVE_SYS_TYPES_H HAVE_STDINT_H HAVE_STDDEF_H HAVE_INTTYPES_H) + if ("${def}") + set (MACRO_CHECK_TYPE_SIZE_FLAGS "${MACRO_CHECK_TYPE_SIZE_FLAGS} -D${def}") + endif ("${def}") + endforeach (def) + + message (STATUS "Check size of ${TYPE}") + if (CMAKE_REQUIRED_LIBRARIES) + set (CHECK_TYPE_SIZE_ADD_LIBRARIES + "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}" + ) + endif (CMAKE_REQUIRED_LIBRARIES) + try_run (${VARIABLE} HAVE_${VARIABLE} + ${CMAKE_BINARY_DIR} + ${HDF_RESOURCES_EXT_DIR}/CheckTypeSize.c + CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_TYPE_SIZE_FLAGS} + "${CHECK_TYPE_SIZE_ADD_LIBRARIES}" + OUTPUT_VARIABLE OUTPUT + ) + if (HAVE_${VARIABLE}) + message (STATUS "Check size of ${TYPE} - done") + file (APPEND + ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeOutput.log + "Determining size of ${TYPE} passed with the following output:\n${OUTPUT}\n\n" + ) + else (HAVE_${VARIABLE}) + message (STATUS "Check size of ${TYPE} - failed") + file (APPEND + ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log + "Determining size of ${TYPE} failed with the following output:\n${OUTPUT}\n\n" + ) + endif (HAVE_${VARIABLE}) + endif ("HAVE_${VARIABLE}" MATCHES "^HAVE_${VARIABLE}$") + set (CMAKE_ALLOW_UNKNOWN_VARIABLE_READ_ACCESS) +ENDMACRO (HDF_CHECK_TYPE_SIZE) diff --git a/config/cmake_ext_mod/ConfigureChecks.cmake b/config/cmake_ext_mod/ConfigureChecks.cmake new file mode 100644 index 0000000..e058b10 --- /dev/null +++ b/config/cmake_ext_mod/ConfigureChecks.cmake @@ -0,0 +1,756 @@ +#----------------------------------------------------------------------------- +# Include all the necessary files for macros +#----------------------------------------------------------------------------- +include (${CMAKE_ROOT}/Modules/CheckFunctionExists.cmake) +include (${CMAKE_ROOT}/Modules/CheckIncludeFile.cmake) +include (${CMAKE_ROOT}/Modules/CheckIncludeFileCXX.cmake) +include (${CMAKE_ROOT}/Modules/CheckIncludeFiles.cmake) +include (${CMAKE_ROOT}/Modules/CheckLibraryExists.cmake) +include (${CMAKE_ROOT}/Modules/CheckSymbolExists.cmake) +include (${CMAKE_ROOT}/Modules/CheckTypeSize.cmake) +include (${CMAKE_ROOT}/Modules/CheckVariableExists.cmake) +include (${CMAKE_ROOT}/Modules/CheckFortranFunctionExists.cmake) +include (${CMAKE_ROOT}/Modules/TestBigEndian.cmake) +if(CMAKE_CXX_COMPILER) + include (${CMAKE_ROOT}/Modules/TestForSTDNamespace.cmake) +endif(CMAKE_CXX_COMPILER) + +#----------------------------------------------------------------------------- +# APPLE/Darwin setup +#----------------------------------------------------------------------------- +if (APPLE) + list (LENGTH CMAKE_OSX_ARCHITECTURES ARCH_LENGTH) + if (ARCH_LENGTH GREATER 1) + set (CMAKE_OSX_ARCHITECTURES "" CACHE STRING "" FORCE) + message(FATAL_ERROR "Building Universal Binaries on OS X is NOT supported by the HDF5 project. This is" + "due to technical reasons. The best approach would be build each architecture in separate directories" + "and use the 'lipo' tool to combine them into a single executable or library. The 'CMAKE_OSX_ARCHITECTURES'" + "variable has been set to a blank value which will build the default architecture for this system.") + endif () + set (${HDF_PREFIX}_AC_APPLE_UNIVERSAL_BUILD 0) +endif (APPLE) + +# Check for Darwin (not just Apple - we also want to catch OpenDarwin) +if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + set (${HDF_PREFIX}_HAVE_DARWIN 1) +endif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + +# Check for Solaris +if (${CMAKE_SYSTEM_NAME} MATCHES "SunOS") + set (${HDF_PREFIX}_HAVE_SOLARIS 1) +endif (${CMAKE_SYSTEM_NAME} MATCHES "SunOS") + +#----------------------------------------------------------------------------- +# This MACRO checks IF the symbol exists in the library and IF it +# does, it appends library to the list. +#----------------------------------------------------------------------------- +set (LINK_LIBS "") +MACRO (CHECK_LIBRARY_EXISTS_CONCAT LIBRARY SYMBOL VARIABLE) + CHECK_LIBRARY_EXISTS ("${LIBRARY};${LINK_LIBS}" ${SYMBOL} "" ${VARIABLE}) + if (${VARIABLE}) + set (LINK_LIBS ${LINK_LIBS} ${LIBRARY}) + endif (${VARIABLE}) +ENDMACRO (CHECK_LIBRARY_EXISTS_CONCAT) + +# ---------------------------------------------------------------------- +# WINDOWS Hard code Values +# ---------------------------------------------------------------------- + +set (WINDOWS) +if (WIN32) + if (MINGW) + set (${HDF_PREFIX}_HAVE_MINGW 1) + set (WINDOWS 1) # MinGW tries to imitate Windows + set (CMAKE_REQUIRED_FLAGS "-DWIN32_LEAN_AND_MEAN=1 -DNOGDI=1") + endif (MINGW) + set (${HDF_PREFIX}_HAVE_WIN32_API 1) + set (CMAKE_REQUIRED_LIBRARIES "ws2_32.lib;wsock32.lib") + if (NOT UNIX AND NOT MINGW) + set (WINDOWS 1) + set (CMAKE_REQUIRED_FLAGS "/DWIN32_LEAN_AND_MEAN=1 /DNOGDI=1") + if (MSVC) + set (${HDF_PREFIX}_HAVE_VISUAL_STUDIO 1) + endif (MSVC) + endif (NOT UNIX AND NOT MINGW) +endif (WIN32) + +if (WINDOWS) + set (${HDF_PREFIX}_HAVE_STDDEF_H 1) + set (${HDF_PREFIX}_HAVE_SYS_STAT_H 1) + set (${HDF_PREFIX}_HAVE_SYS_TYPES_H 1) + set (${HDF_PREFIX}_HAVE_LIBM 1) + set (${HDF_PREFIX}_HAVE_STRDUP 1) + set (${HDF_PREFIX}_HAVE_SYSTEM 1) + set (${HDF_PREFIX}_HAVE_LONGJMP 1) + if (NOT MINGW) + set (${HDF_PREFIX}_HAVE_GETHOSTNAME 1) + endif (NOT MINGW) + if (NOT UNIX AND NOT CYGWIN AND NOT MINGW) + set (${HDF_PREFIX}_HAVE_GETCONSOLESCREENBUFFERINFO 1) + endif (NOT UNIX AND NOT CYGWIN AND NOT MINGW) + set (${HDF_PREFIX}_HAVE_FUNCTION 1) + set (${HDF_PREFIX}_GETTIMEOFDAY_GIVES_TZ 1) + set (${HDF_PREFIX}_HAVE_TIMEZONE 1) + set (${HDF_PREFIX}_HAVE_GETTIMEOFDAY 1) + if (MINGW) + set (${HDF_PREFIX}_HAVE_WINSOCK2_H 1) + endif (MINGW) + set (${HDF_PREFIX}_HAVE_LIBWS2_32 1) + set (${HDF_PREFIX}_HAVE_LIBWSOCK32 1) +endif (WINDOWS) + +# ---------------------------------------------------------------------- +# END of WINDOWS Hard code Values +# ---------------------------------------------------------------------- + +if (CYGWIN) + set (${HDF_PREFIX}_HAVE_LSEEK64 0) +endif (CYGWIN) + +#----------------------------------------------------------------------------- +# Check for the math library "m" +#----------------------------------------------------------------------------- +if (NOT WINDOWS) + CHECK_LIBRARY_EXISTS_CONCAT ("m" ceil ${HDF_PREFIX}_HAVE_LIBM) + CHECK_LIBRARY_EXISTS_CONCAT ("dl" dlopen ${HDF_PREFIX}_HAVE_LIBDL) + CHECK_LIBRARY_EXISTS_CONCAT ("ws2_32" WSAStartup ${HDF_PREFIX}_HAVE_LIBWS2_32) + CHECK_LIBRARY_EXISTS_CONCAT ("wsock32" gethostbyname ${HDF_PREFIX}_HAVE_LIBWSOCK32) +endif (NOT WINDOWS) + +CHECK_LIBRARY_EXISTS_CONCAT ("ucb" gethostname ${HDF_PREFIX}_HAVE_LIBUCB) +CHECK_LIBRARY_EXISTS_CONCAT ("socket" connect ${HDF_PREFIX}_HAVE_LIBSOCKET) +CHECK_LIBRARY_EXISTS ("c" gethostbyname "" NOT_NEED_LIBNSL) + +if (NOT NOT_NEED_LIBNSL) + CHECK_LIBRARY_EXISTS_CONCAT ("nsl" gethostbyname ${HDF_PREFIX}_HAVE_LIBNSL) +endif (NOT NOT_NEED_LIBNSL) + +# For other tests to use the same libraries +set (CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${LINK_LIBS}) + +set (USE_INCLUDES "") +if (WINDOWS) + set (USE_INCLUDES ${USE_INCLUDES} "windows.h") +endif (WINDOWS) + +if (NOT WINDOWS) + TEST_BIG_ENDIAN (${HDF_PREFIX}_WORDS_BIGENDIAN) +endif (NOT WINDOWS) + +# For other specific tests, use this MACRO. +MACRO (HDF_FUNCTION_TEST OTHER_TEST) + if ("${HDF_PREFIX}_${OTHER_TEST}" MATCHES "^${HDF_PREFIX}_${OTHER_TEST}$") + set (MACRO_CHECK_FUNCTION_DEFINITIONS "-D${OTHER_TEST} ${CMAKE_REQUIRED_FLAGS}") + set (OTHER_TEST_ADD_LIBRARIES) + if (CMAKE_REQUIRED_LIBRARIES) + set (OTHER_TEST_ADD_LIBRARIES "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}") + endif (CMAKE_REQUIRED_LIBRARIES) + + foreach (def ${HDF_EXTRA_TEST_DEFINITIONS}) + set (MACRO_CHECK_FUNCTION_DEFINITIONS "${MACRO_CHECK_FUNCTION_DEFINITIONS} -D${def}=${${def}}") + endforeach (def) + + foreach (def + HAVE_SYS_TIME_H + HAVE_UNISTD_H + HAVE_SYS_TYPES_H + HAVE_SYS_SOCKET_H + ) + if ("${${HDF_PREFIX}_${def}}") + set (MACRO_CHECK_FUNCTION_DEFINITIONS "${MACRO_CHECK_FUNCTION_DEFINITIONS} -D${def}") + endif ("${${HDF_PREFIX}_${def}}") + endforeach (def) + + if (LARGEFILE) + set (MACRO_CHECK_FUNCTION_DEFINITIONS + "${MACRO_CHECK_FUNCTION_DEFINITIONS} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE" + ) + endif (LARGEFILE) + + #message (STATUS "Performing ${OTHER_TEST}") + TRY_COMPILE (${OTHER_TEST} + ${CMAKE_BINARY_DIR} + ${HDF_RESOURCES_EXT_DIR}/HDFTests.c + CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS} + "${OTHER_TEST_ADD_LIBRARIES}" + OUTPUT_VARIABLE OUTPUT + ) + if (${OTHER_TEST}) + set (${HDF_PREFIX}_${OTHER_TEST} 1 CACHE INTERNAL "Other test ${FUNCTION}") + message (STATUS "Performing Other Test ${OTHER_TEST} - Success") + else (${OTHER_TEST}) + message (STATUS "Performing Other Test ${OTHER_TEST} - Failed") + set (${HDF_PREFIX}_${OTHER_TEST} "" CACHE INTERNAL "Other test ${FUNCTION}") + file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log + "Performing Other Test ${OTHER_TEST} failed with the following output:\n" + "${OUTPUT}\n" + ) + endif (${OTHER_TEST}) + endif ("${HDF_PREFIX}_${OTHER_TEST}" MATCHES "^${HDF_PREFIX}_${OTHER_TEST}$") +ENDMACRO (HDF_FUNCTION_TEST) + +#----------------------------------------------------------------------------- +# Check for these functions before the time headers are checked +#----------------------------------------------------------------------------- +HDF_FUNCTION_TEST (STDC_HEADERS) + +#----------------------------------------------------------------------------- +# Check IF header file exists and add it to the list. +#----------------------------------------------------------------------------- +MACRO (CHECK_INCLUDE_FILE_CONCAT FILE VARIABLE) + CHECK_INCLUDE_FILES ("${USE_INCLUDES};${FILE}" ${VARIABLE}) + if (${VARIABLE}) + set (USE_INCLUDES ${USE_INCLUDES} ${FILE}) + endif (${VARIABLE}) +ENDMACRO (CHECK_INCLUDE_FILE_CONCAT) + +#----------------------------------------------------------------------------- +# Check for the existence of certain header files +#----------------------------------------------------------------------------- +CHECK_INCLUDE_FILE_CONCAT ("sys/resource.h" ${HDF_PREFIX}_HAVE_SYS_RESOURCE_H) +CHECK_INCLUDE_FILE_CONCAT ("sys/time.h" ${HDF_PREFIX}_HAVE_SYS_TIME_H) +CHECK_INCLUDE_FILE_CONCAT ("unistd.h" ${HDF_PREFIX}_HAVE_UNISTD_H) +CHECK_INCLUDE_FILE_CONCAT ("sys/ioctl.h" ${HDF_PREFIX}_HAVE_SYS_IOCTL_H) +CHECK_INCLUDE_FILE_CONCAT ("sys/stat.h" ${HDF_PREFIX}_HAVE_SYS_STAT_H) +CHECK_INCLUDE_FILE_CONCAT ("sys/socket.h" ${HDF_PREFIX}_HAVE_SYS_SOCKET_H) +CHECK_INCLUDE_FILE_CONCAT ("sys/types.h" ${HDF_PREFIX}_HAVE_SYS_TYPES_H) +CHECK_INCLUDE_FILE_CONCAT ("stddef.h" ${HDF_PREFIX}_HAVE_STDDEF_H) +CHECK_INCLUDE_FILE_CONCAT ("setjmp.h" ${HDF_PREFIX}_HAVE_SETJMP_H) +CHECK_INCLUDE_FILE_CONCAT ("features.h" ${HDF_PREFIX}_HAVE_FEATURES_H) +CHECK_INCLUDE_FILE_CONCAT ("dirent.h" ${HDF_PREFIX}_HAVE_DIRENT_H) +CHECK_INCLUDE_FILE_CONCAT ("stdint.h" ${HDF_PREFIX}_HAVE_STDINT_H) + +# IF the c compiler found stdint, check the C++ as well. On some systems this +# file will be found by C but not C++, only do this test IF the C++ compiler +# has been initialized (e.g. the project also includes some c++) +if (${HDF_PREFIX}_HAVE_STDINT_H AND CMAKE_CXX_COMPILER_LOADED) + CHECK_INCLUDE_FILE_CXX ("stdint.h" ${HDF_PREFIX}_HAVE_STDINT_H_CXX) + if (NOT ${HDF_PREFIX}_HAVE_STDINT_H_CXX) + set (${HDF_PREFIX}_HAVE_STDINT_H "" CACHE INTERNAL "Have includes HAVE_STDINT_H") + set (USE_INCLUDES ${USE_INCLUDES} "stdint.h") + endif (NOT ${HDF_PREFIX}_HAVE_STDINT_H_CXX) +endif (${HDF_PREFIX}_HAVE_STDINT_H AND CMAKE_CXX_COMPILER_LOADED) + +# Darwin +CHECK_INCLUDE_FILE_CONCAT ("mach/mach_time.h" ${HDF_PREFIX}_HAVE_MACH_MACH_TIME_H) + +# Windows +CHECK_INCLUDE_FILE_CONCAT ("io.h" ${HDF_PREFIX}_HAVE_IO_H) +if (NOT CYGWIN) + CHECK_INCLUDE_FILE_CONCAT ("winsock2.h" ${HDF_PREFIX}_HAVE_WINSOCK2_H) +endif (NOT CYGWIN) +CHECK_INCLUDE_FILE_CONCAT ("sys/timeb.h" ${HDF_PREFIX}_HAVE_SYS_TIMEB_H) + +if (CMAKE_SYSTEM_NAME MATCHES "OSF") + CHECK_INCLUDE_FILE_CONCAT ("sys/sysinfo.h" ${HDF_PREFIX}_HAVE_SYS_SYSINFO_H) + CHECK_INCLUDE_FILE_CONCAT ("sys/proc.h" ${HDF_PREFIX}_HAVE_SYS_PROC_H) +else (CMAKE_SYSTEM_NAME MATCHES "OSF") + set (${HDF_PREFIX}_HAVE_SYS_SYSINFO_H "" CACHE INTERNAL "" FORCE) + set (${HDF_PREFIX}_HAVE_SYS_PROC_H "" CACHE INTERNAL "" FORCE) +endif (CMAKE_SYSTEM_NAME MATCHES "OSF") + +CHECK_INCLUDE_FILE_CONCAT ("globus/common.h" ${HDF_PREFIX}_HAVE_GLOBUS_COMMON_H) +CHECK_INCLUDE_FILE_CONCAT ("pdb.h" ${HDF_PREFIX}_HAVE_PDB_H) +CHECK_INCLUDE_FILE_CONCAT ("pthread.h" ${HDF_PREFIX}_HAVE_PTHREAD_H) +CHECK_INCLUDE_FILE_CONCAT ("srbclient.h" ${HDF_PREFIX}_HAVE_SRBCLIENT_H) +CHECK_INCLUDE_FILE_CONCAT ("string.h" ${HDF_PREFIX}_HAVE_STRING_H) +CHECK_INCLUDE_FILE_CONCAT ("strings.h" ${HDF_PREFIX}_HAVE_STRINGS_H) +CHECK_INCLUDE_FILE_CONCAT ("stdlib.h" ${HDF_PREFIX}_HAVE_STDLIB_H) +CHECK_INCLUDE_FILE_CONCAT ("memory.h" ${HDF_PREFIX}_HAVE_MEMORY_H) +CHECK_INCLUDE_FILE_CONCAT ("dlfcn.h" ${HDF_PREFIX}_HAVE_DLFCN_H) +CHECK_INCLUDE_FILE_CONCAT ("inttypes.h" ${HDF_PREFIX}_HAVE_INTTYPES_H) +CHECK_INCLUDE_FILE_CONCAT ("netinet/in.h" ${HDF_PREFIX}_HAVE_NETINET_IN_H) + +#----------------------------------------------------------------------------- +# Check for large file support +#----------------------------------------------------------------------------- + +# The linux-lfs option is deprecated. +set (LINUX_LFS 0) + +set (HDF_EXTRA_C_FLAGS) +set (HDF_EXTRA_FLAGS) +if (NOT WINDOWS) + if (NOT ${HDF_PREFIX}_HAVE_SOLARIS) + # Linux Specific flags + # This was originally defined as _POSIX_SOURCE which was updated to + # _POSIX_C_SOURCE=199506L to expose a greater amount of POSIX + # functionality so clock_gettime and CLOCK_MONOTONIC are defined + # correctly. + # POSIX feature information can be found in the gcc manual at: + # http://www.gnu.org/s/libc/manual/html_node/Feature-Test-Macros.html + set (HDF_EXTRA_C_FLAGS -D_POSIX_C_SOURCE=199506L) + # _BSD_SOURCE deprecated in GLIBC >= 2.20 + TRY_RUN (HAVE_DEFAULT_SOURCE_RUN HAVE_DEFAULT_SOURCE_COMPILE + ${CMAKE_BINARY_DIR} + ${HDF_RESOURCES_EXT_DIR}/HDFTests.c + CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=-DHAVE_DEFAULT_SOURCE + OUTPUT_VARIABLE OUTPUT + ) + if (HAVE_DEFAULT_SOURCE_COMPILE AND HAVE_DEFAULT_SOURCE_RUN) + set (HDF_EXTRA_FLAGS -D_DEFAULT_SOURCE) + else (HAVE_DEFAULT_SOURCE_COMPILE AND HAVE_DEFAULT_SOURCE_RUN) + set (HDF_EXTRA_FLAGS -D_BSD_SOURCE) + endif (HAVE_DEFAULT_SOURCE_COMPILE AND HAVE_DEFAULT_SOURCE_RUN) + + option (HDF_ENABLE_LARGE_FILE "Enable support for large (64-bit) files on Linux." ON) + if (HDF_ENABLE_LARGE_FILE) + set (msg "Performing TEST_LFS_WORKS") + TRY_RUN (TEST_LFS_WORKS_RUN TEST_LFS_WORKS_COMPILE + ${CMAKE_BINARY_DIR} + ${HDF_RESOURCES_EXT_DIR}/HDFTests.c + CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=-DTEST_LFS_WORKS + OUTPUT_VARIABLE OUTPUT + ) + if (TEST_LFS_WORKS_COMPILE) + if (TEST_LFS_WORKS_RUN MATCHES 0) + set (TEST_LFS_WORKS 1 CACHE INTERNAL ${msg}) + set (LARGEFILE 1) + set (HDF_EXTRA_FLAGS ${HDF_EXTRA_FLAGS} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE) + message (STATUS "${msg}... yes") + else (TEST_LFS_WORKS_RUN MATCHES 0) + set (TEST_LFS_WORKS "" CACHE INTERNAL ${msg}) + message (STATUS "${msg}... no") + file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log + "Test TEST_LFS_WORKS Run failed with the following output and exit code:\n ${OUTPUT}\n" + ) + endif (TEST_LFS_WORKS_RUN MATCHES 0) + else (TEST_LFS_WORKS_COMPILE ) + set (TEST_LFS_WORKS "" CACHE INTERNAL ${msg}) + message (STATUS "${msg}... no") + file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log + "Test TEST_LFS_WORKS Compile failed with the following output:\n ${OUTPUT}\n" + ) + endif (TEST_LFS_WORKS_COMPILE) + endif (HDF_ENABLE_LARGE_FILE) + set (CMAKE_REQUIRED_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} ${HDF_EXTRA_FLAGS}) + endif (NOT ${HDF_PREFIX}_HAVE_SOLARIS) +endif (NOT WINDOWS) + +add_definitions (${HDF_EXTRA_FLAGS}) + +#----------------------------------------------------------------------------- +# Check for HAVE_OFF64_T functionality +#----------------------------------------------------------------------------- +if (NOT WINDOWS OR MINGW) + HDF_FUNCTION_TEST (HAVE_OFF64_T) + if (${HDF_PREFIX}_HAVE_OFF64_T) + CHECK_FUNCTION_EXISTS (lseek64 ${HDF_PREFIX}_HAVE_LSEEK64) + CHECK_FUNCTION_EXISTS (fseeko64 ${HDF_PREFIX}_HAVE_FSEEKO64) + CHECK_FUNCTION_EXISTS (ftello64 ${HDF_PREFIX}_HAVE_FTELLO64) + CHECK_FUNCTION_EXISTS (ftruncate64 ${HDF_PREFIX}_HAVE_FTRUNCATE64) + endif (${HDF_PREFIX}_HAVE_OFF64_T) + + CHECK_FUNCTION_EXISTS (fseeko ${HDF_PREFIX}_HAVE_FSEEKO) + CHECK_FUNCTION_EXISTS (ftello ${HDF_PREFIX}_HAVE_FTELLO) + + HDF_FUNCTION_TEST (HAVE_STAT64_STRUCT) + if (HAVE_STAT64_STRUCT) + CHECK_FUNCTION_EXISTS (fstat64 ${HDF_PREFIX}_HAVE_FSTAT64) + CHECK_FUNCTION_EXISTS (stat64 ${HDF_PREFIX}_HAVE_STAT64) + endif (HAVE_STAT64_STRUCT) +endif (NOT WINDOWS OR MINGW) + +#----------------------------------------------------------------------------- +# Check the size in bytes of all the int and float types +#----------------------------------------------------------------------------- +MACRO (HDF_CHECK_TYPE_SIZE type var) + set (aType ${type}) + set (aVar ${var}) +# message (STATUS "Checking size of ${aType} and storing into ${aVar}") + CHECK_TYPE_SIZE (${aType} ${aVar}) + if (NOT ${aVar}) + set (${aVar} 0 CACHE INTERNAL "SizeOf for ${aType}") +# message (STATUS "Size of ${aType} was NOT Found") + endif (NOT ${aVar}) +ENDMACRO (HDF_CHECK_TYPE_SIZE) + +HDF_CHECK_TYPE_SIZE (char ${HDF_PREFIX}_SIZEOF_CHAR) +HDF_CHECK_TYPE_SIZE (short ${HDF_PREFIX}_SIZEOF_SHORT) +HDF_CHECK_TYPE_SIZE (int ${HDF_PREFIX}_SIZEOF_INT) +HDF_CHECK_TYPE_SIZE (unsigned ${HDF_PREFIX}_SIZEOF_UNSIGNED) +if (NOT APPLE) + HDF_CHECK_TYPE_SIZE (long ${HDF_PREFIX}_SIZEOF_LONG) +endif (NOT APPLE) +HDF_CHECK_TYPE_SIZE ("long long" ${HDF_PREFIX}_SIZEOF_LONG_LONG) +HDF_CHECK_TYPE_SIZE (__int64 ${HDF_PREFIX}_SIZEOF___INT64) +if (NOT ${HDF_PREFIX}_SIZEOF___INT64) + set (${HDF_PREFIX}_SIZEOF___INT64 0) +endif (NOT ${HDF_PREFIX}_SIZEOF___INT64) + +HDF_CHECK_TYPE_SIZE (float ${HDF_PREFIX}_SIZEOF_FLOAT) +HDF_CHECK_TYPE_SIZE (double ${HDF_PREFIX}_SIZEOF_DOUBLE) +HDF_CHECK_TYPE_SIZE ("long double" ${HDF_PREFIX}_SIZEOF_LONG_DOUBLE) + +HDF_CHECK_TYPE_SIZE (int8_t ${HDF_PREFIX}_SIZEOF_INT8_T) +HDF_CHECK_TYPE_SIZE (uint8_t ${HDF_PREFIX}_SIZEOF_UINT8_T) +HDF_CHECK_TYPE_SIZE (int_least8_t ${HDF_PREFIX}_SIZEOF_INT_LEAST8_T) +HDF_CHECK_TYPE_SIZE (uint_least8_t ${HDF_PREFIX}_SIZEOF_UINT_LEAST8_T) +HDF_CHECK_TYPE_SIZE (int_fast8_t ${HDF_PREFIX}_SIZEOF_INT_FAST8_T) +HDF_CHECK_TYPE_SIZE (uint_fast8_t ${HDF_PREFIX}_SIZEOF_UINT_FAST8_T) + +HDF_CHECK_TYPE_SIZE (int16_t ${HDF_PREFIX}_SIZEOF_INT16_T) +HDF_CHECK_TYPE_SIZE (uint16_t ${HDF_PREFIX}_SIZEOF_UINT16_T) +HDF_CHECK_TYPE_SIZE (int_least16_t ${HDF_PREFIX}_SIZEOF_INT_LEAST16_T) +HDF_CHECK_TYPE_SIZE (uint_least16_t ${HDF_PREFIX}_SIZEOF_UINT_LEAST16_T) +HDF_CHECK_TYPE_SIZE (int_fast16_t ${HDF_PREFIX}_SIZEOF_INT_FAST16_T) +HDF_CHECK_TYPE_SIZE (uint_fast16_t ${HDF_PREFIX}_SIZEOF_UINT_FAST16_T) + +HDF_CHECK_TYPE_SIZE (int32_t ${HDF_PREFIX}_SIZEOF_INT32_T) +HDF_CHECK_TYPE_SIZE (uint32_t ${HDF_PREFIX}_SIZEOF_UINT32_T) +HDF_CHECK_TYPE_SIZE (int_least32_t ${HDF_PREFIX}_SIZEOF_INT_LEAST32_T) +HDF_CHECK_TYPE_SIZE (uint_least32_t ${HDF_PREFIX}_SIZEOF_UINT_LEAST32_T) +HDF_CHECK_TYPE_SIZE (int_fast32_t ${HDF_PREFIX}_SIZEOF_INT_FAST32_T) +HDF_CHECK_TYPE_SIZE (uint_fast32_t ${HDF_PREFIX}_SIZEOF_UINT_FAST32_T) + +HDF_CHECK_TYPE_SIZE (int64_t ${HDF_PREFIX}_SIZEOF_INT64_T) +HDF_CHECK_TYPE_SIZE (uint64_t ${HDF_PREFIX}_SIZEOF_UINT64_T) +HDF_CHECK_TYPE_SIZE (int_least64_t ${HDF_PREFIX}_SIZEOF_INT_LEAST64_T) +HDF_CHECK_TYPE_SIZE (uint_least64_t ${HDF_PREFIX}_SIZEOF_UINT_LEAST64_T) +HDF_CHECK_TYPE_SIZE (int_fast64_t ${HDF_PREFIX}_SIZEOF_INT_FAST64_T) +HDF_CHECK_TYPE_SIZE (uint_fast64_t ${HDF_PREFIX}_SIZEOF_UINT_FAST64_T) + +if (NOT APPLE) + HDF_CHECK_TYPE_SIZE (size_t ${HDF_PREFIX}_SIZEOF_SIZE_T) + HDF_CHECK_TYPE_SIZE (ssize_t ${HDF_PREFIX}_SIZEOF_SSIZE_T) + if (NOT ${HDF_PREFIX}_SIZEOF_SSIZE_T) + set (${HDF_PREFIX}_SIZEOF_SSIZE_T 0) + endif (NOT ${HDF_PREFIX}_SIZEOF_SSIZE_T) + if (NOT WINDOWS) + HDF_CHECK_TYPE_SIZE (ptrdiff_t ${HDF_PREFIX}_SIZEOF_PTRDIFF_T) + endif (NOT WINDOWS) +endif (NOT APPLE) + +HDF_CHECK_TYPE_SIZE (off_t ${HDF_PREFIX}_SIZEOF_OFF_T) +HDF_CHECK_TYPE_SIZE (off64_t ${HDF_PREFIX}_SIZEOF_OFF64_T) +if (NOT ${HDF_PREFIX}_SIZEOF_OFF64_T) + set (${HDF_PREFIX}_SIZEOF_OFF64_T 0) +endif (NOT ${HDF_PREFIX}_SIZEOF_OFF64_T) + +if (NOT WINDOWS) + #----------------------------------------------------------------------------- + # Check if the dev_t type is a scalar type + #----------------------------------------------------------------------------- + HDF_FUNCTION_TEST (DEV_T_IS_SCALAR) + + # ---------------------------------------------------------------------- + # Check for MONOTONIC_TIMER support (used in clock_gettime). This has + # to be done after any POSIX/BSD defines to ensure that the test gets + # the correct POSIX level on linux. + CHECK_VARIABLE_EXISTS (CLOCK_MONOTONIC HAVE_CLOCK_MONOTONIC) + + #----------------------------------------------------------------------------- + # Check a bunch of time functions + #----------------------------------------------------------------------------- + foreach (test + HAVE_TM_GMTOFF + HAVE___TM_GMTOFF +# HAVE_TIMEZONE + HAVE_STRUCT_TIMEZONE + GETTIMEOFDAY_GIVES_TZ + TIME_WITH_SYS_TIME + HAVE_TM_ZONE + HAVE_STRUCT_TM_TM_ZONE + ) + HDF_FUNCTION_TEST (${test}) + endforeach (test) + if (NOT CYGWIN AND NOT MINGW) + HDF_FUNCTION_TEST (HAVE_TIMEZONE) +# HDF_FUNCTION_TEST (HAVE_STAT_ST_BLOCKS) + endif (NOT CYGWIN AND NOT MINGW) + + # ---------------------------------------------------------------------- + # Does the struct stat have the st_blocks field? This field is not Posix. + # + HDF_FUNCTION_TEST (HAVE_STAT_ST_BLOCKS) + + # ---------------------------------------------------------------------- + # How do we figure out the width of a tty in characters? + # + CHECK_FUNCTION_EXISTS (ioctl ${HDF_PREFIX}_HAVE_IOCTL) + HDF_FUNCTION_TEST (HAVE_STRUCT_VIDEOCONFIG) + HDF_FUNCTION_TEST (HAVE_STRUCT_TEXT_INFO) + CHECK_FUNCTION_EXISTS (_getvideoconfig ${HDF_PREFIX}_HAVE__GETVIDEOCONFIG) + CHECK_FUNCTION_EXISTS (gettextinfo ${HDF_PREFIX}_HAVE_GETTEXTINFO) + CHECK_FUNCTION_EXISTS (_scrsize ${HDF_PREFIX}_HAVE__SCRSIZE) + if (NOT CYGWIN AND NOT MINGW) + CHECK_FUNCTION_EXISTS (GetConsoleScreenBufferInfo ${HDF_PREFIX}_HAVE_GETCONSOLESCREENBUFFERINFO) + endif (NOT CYGWIN AND NOT MINGW) + CHECK_SYMBOL_EXISTS (TIOCGWINSZ "sys/ioctl.h" ${HDF_PREFIX}_HAVE_TIOCGWINSZ) + CHECK_SYMBOL_EXISTS (TIOCGETD "sys/ioctl.h" ${HDF_PREFIX}_HAVE_TIOCGETD) +endif (NOT WINDOWS) + +#----------------------------------------------------------------------------- +# Check for some functions that are used +# +CHECK_FUNCTION_EXISTS (alarm ${HDF_PREFIX}_HAVE_ALARM) +CHECK_FUNCTION_EXISTS (fork ${HDF_PREFIX}_HAVE_FORK) +CHECK_FUNCTION_EXISTS (frexpf ${HDF_PREFIX}_HAVE_FREXPF) +CHECK_FUNCTION_EXISTS (frexpl ${HDF_PREFIX}_HAVE_FREXPL) + +CHECK_FUNCTION_EXISTS (gethostname ${HDF_PREFIX}_HAVE_GETHOSTNAME) +CHECK_FUNCTION_EXISTS (getpwuid ${HDF_PREFIX}_HAVE_GETPWUID) +CHECK_FUNCTION_EXISTS (getrusage ${HDF_PREFIX}_HAVE_GETRUSAGE) +CHECK_FUNCTION_EXISTS (lstat ${HDF_PREFIX}_HAVE_LSTAT) + +CHECK_FUNCTION_EXISTS (rand_r ${HDF_PREFIX}_HAVE_RAND_R) +CHECK_FUNCTION_EXISTS (random ${HDF_PREFIX}_HAVE_RANDOM) +CHECK_FUNCTION_EXISTS (setsysinfo ${HDF_PREFIX}_HAVE_SETSYSINFO) + +CHECK_FUNCTION_EXISTS (signal ${HDF_PREFIX}_HAVE_SIGNAL) +CHECK_FUNCTION_EXISTS (longjmp ${HDF_PREFIX}_HAVE_LONGJMP) +CHECK_FUNCTION_EXISTS (setjmp ${HDF_PREFIX}_HAVE_SETJMP) +CHECK_FUNCTION_EXISTS (siglongjmp ${HDF_PREFIX}_HAVE_SIGLONGJMP) +CHECK_FUNCTION_EXISTS (sigsetjmp ${HDF_PREFIX}_HAVE_SIGSETJMP) +CHECK_FUNCTION_EXISTS (sigprocmask ${HDF_PREFIX}_HAVE_SIGPROCMASK) + +CHECK_FUNCTION_EXISTS (snprintf ${HDF_PREFIX}_HAVE_SNPRINTF) +CHECK_FUNCTION_EXISTS (srandom ${HDF_PREFIX}_HAVE_SRANDOM) +CHECK_FUNCTION_EXISTS (strdup ${HDF_PREFIX}_HAVE_STRDUP) +CHECK_FUNCTION_EXISTS (symlink ${HDF_PREFIX}_HAVE_SYMLINK) +CHECK_FUNCTION_EXISTS (system ${HDF_PREFIX}_HAVE_SYSTEM) + +CHECK_FUNCTION_EXISTS (tmpfile ${HDF_PREFIX}_HAVE_TMPFILE) +CHECK_FUNCTION_EXISTS (asprintf ${HDF_PREFIX}_HAVE_ASPRINTF) +CHECK_FUNCTION_EXISTS (vasprintf ${HDF_PREFIX}_HAVE_VASPRINTF) +CHECK_FUNCTION_EXISTS (waitpid ${HDF_PREFIX}_HAVE_WAITPID) + +CHECK_FUNCTION_EXISTS (vsnprintf ${HDF_PREFIX}_HAVE_VSNPRINTF) +if (NOT WINDOWS) + if (${HDF_PREFIX}_HAVE_VSNPRINTF) + HDF_FUNCTION_TEST (VSNPRINTF_WORKS) + endif (${HDF_PREFIX}_HAVE_VSNPRINTF) +endif (NOT WINDOWS) + +#----------------------------------------------------------------------------- +# sigsetjmp is special; may actually be a macro +#----------------------------------------------------------------------------- +if (NOT ${HDF_PREFIX}_HAVE_SIGSETJMP) + if (${HDF_PREFIX}_HAVE_SETJMP_H) + CHECK_SYMBOL_EXISTS (sigsetjmp "setjmp.h" ${HDF_PREFIX}_HAVE_MACRO_SIGSETJMP) + if (${HDF_PREFIX}_HAVE_MACRO_SIGSETJMP) + set (${HDF_PREFIX}_HAVE_SIGSETJMP 1) + endif (${HDF_PREFIX}_HAVE_MACRO_SIGSETJMP) + endif (${HDF_PREFIX}_HAVE_SETJMP_H) +endif (NOT ${HDF_PREFIX}_HAVE_SIGSETJMP) + +#----------------------------------------------------------------------------- +# Check a bunch of other functions +#----------------------------------------------------------------------------- +if (NOT WINDOWS) + foreach (test + HAVE_ATTRIBUTE + HAVE_C99_FUNC +# STDC_HEADERS + HAVE_FUNCTION + HAVE_C99_DESIGNATED_INITIALIZER + SYSTEM_SCOPE_THREADS + HAVE_SOCKLEN_T + CXX_HAVE_OFFSETOF + ) + HDF_FUNCTION_TEST (${test}) + endforeach (test) +endif (NOT WINDOWS) + +# For other CXX specific tests, use this MACRO. +MACRO (HDF_CXX_FUNCTION_TEST OTHER_TEST) + if ("${OTHER_TEST}" MATCHES "^${OTHER_TEST}$") + set (MACRO_CHECK_FUNCTION_DEFINITIONS "-D${OTHER_TEST} ${CMAKE_REQUIRED_FLAGS}") + set (OTHER_TEST_ADD_LIBRARIES) + if (CMAKE_REQUIRED_LIBRARIES) + set (OTHER_TEST_ADD_LIBRARIES "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}") + endif (CMAKE_REQUIRED_LIBRARIES) + + foreach (def ${HDF_EXTRA_TEST_DEFINITIONS}) + set (MACRO_CHECK_FUNCTION_DEFINITIONS "${MACRO_CHECK_FUNCTION_DEFINITIONS} -D${def}=${${def}}") + endforeach (def) + + foreach (def + HAVE_SYS_TIME_H + HAVE_UNISTD_H + HAVE_SYS_TYPES_H + HAVE_SYS_SOCKET_H + ) + if ("${${HDF_PREFIX}_${def}}") + set (MACRO_CHECK_FUNCTION_DEFINITIONS "${MACRO_CHECK_FUNCTION_DEFINITIONS} -D${def}") + endif ("${${HDF_PREFIX}_${def}}") + endforeach (def) + + if (LARGEFILE) + set (MACRO_CHECK_FUNCTION_DEFINITIONS + "${MACRO_CHECK_FUNCTION_DEFINITIONS} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE" + ) + endif (LARGEFILE) + + #message (STATUS "Performing ${OTHER_TEST}") + TRY_COMPILE (${OTHER_TEST} + ${CMAKE_BINARY_DIR} + ${HDF_RESOURCES_EXT_DIR}/HDFCXXTests.cpp + CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS} + "${OTHER_TEST_ADD_LIBRARIES}" + OUTPUT_VARIABLE OUTPUT + ) + if (${OTHER_TEST} EQUAL 0) + set (${OTHER_TEST} 1 CACHE INTERNAL "CXX test ${FUNCTION}") + message (STATUS "Performing CXX Test ${OTHER_TEST} - Success") + else (${OTHER_TEST} EQUAL 0) + message (STATUS "Performing CXX Test ${OTHER_TEST} - Failed") + set (${OTHER_TEST} "" CACHE INTERNAL "CXX test ${FUNCTION}") + file (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log + "Performing CXX Test ${OTHER_TEST} failed with the following output:\n" + "${OUTPUT}\n" + ) + endif (${OTHER_TEST} EQUAL 0) + endif ("${OTHER_TEST}" MATCHES "^${OTHER_TEST}$") +ENDMACRO (HDF_CXX_FUNCTION_TEST) + +#----------------------------------------------------------------------------- +# Check a bunch of cxx functions +#----------------------------------------------------------------------------- +if (CMAKE_CXX_COMPILER_LOADED) + foreach (test + OLD_HEADER_FILENAME + ${HDF_PREFIX}_NO_NAMESPACE + ${HDF_PREFIX}_NO_STD + BOOL_NOTDEFINED + NO_STATIC_CAST + ) + HDF_CXX_FUNCTION_TEST (${test}) + endforeach (test) +endif (CMAKE_CXX_COMPILER_LOADED) + +#----------------------------------------------------------------------------- +# Check if InitOnceExecuteOnce is available +#----------------------------------------------------------------------------- +if (WINDOWS) + if (NOT HDF_NO_IOEO_TEST) + message (STATUS "Checking for InitOnceExecuteOnce:") + if ("${${HDF_PREFIX}_HAVE_IOEO}" MATCHES "^${${HDF_PREFIX}_HAVE_IOEO}$") + if (LARGEFILE) + set (CMAKE_REQUIRED_DEFINITIONS + "${CURRENT_TEST_DEFINITIONS} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE" + ) + endif (LARGEFILE) + set (MACRO_CHECK_FUNCTION_DEFINITIONS + "-DHAVE_IOEO ${CMAKE_REQUIRED_FLAGS}") + if (CMAKE_REQUIRED_LIBRARIES) + set (CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES + "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}") + else (CMAKE_REQUIRED_LIBRARIES) + set (CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES) + endif (CMAKE_REQUIRED_LIBRARIES) + if (CMAKE_REQUIRED_INCLUDES) + set (CHECK_C_SOURCE_COMPILES_ADD_INCLUDES + "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}") + else (CMAKE_REQUIRED_INCLUDES) + set (CHECK_C_SOURCE_COMPILES_ADD_INCLUDES) + endif (CMAKE_REQUIRED_INCLUDES) + + TRY_RUN(HAVE_IOEO_EXITCODE HAVE_IOEO_COMPILED + ${CMAKE_BINARY_DIR} + ${HDF_RESOURCES_EXT_DIR}/HDFTests.c + COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} + CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS} + -DCMAKE_SKIP_RPATH:BOOL=${CMAKE_SKIP_RPATH} + "${CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES}" + "${CHECK_C_SOURCE_COMPILES_ADD_INCLUDES}" + COMPILE_OUTPUT_VARIABLE OUTPUT) + # if it did not compile make the return value fail code of 1 + if (NOT HAVE_IOEO_COMPILED) + set (HAVE_IOEO_EXITCODE 1) + endif (NOT HAVE_IOEO_COMPILED) + # if the return value was 0 then it worked + if ("${HAVE_IOEO_EXITCODE}" EQUAL 0) + set (${HDF_PREFIX}_HAVE_IOEO 1 CACHE INTERNAL "Test InitOnceExecuteOnce") + message (STATUS "Performing Test InitOnceExecuteOnce - Success") + file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + "Performing C SOURCE FILE Test InitOnceExecuteOnce succeded with the following output:\n" + "${OUTPUT}\n" + "Return value: ${HAVE_IOEO}\n") + else ("${HAVE_IOEO_EXITCODE}" EQUAL 0) + if (CMAKE_CROSSCOMPILING AND "${HAVE_IOEO_EXITCODE}" MATCHES "FAILED_TO_RUN") + set (${HDF_PREFIX}_HAVE_IOEO "${HAVE_IOEO_EXITCODE}") + else (CMAKE_CROSSCOMPILING AND "${HAVE_IOEO_EXITCODE}" MATCHES "FAILED_TO_RUN") + set (${HDF_PREFIX}_HAVE_IOEO "" CACHE INTERNAL "Test InitOnceExecuteOnce") + endif (CMAKE_CROSSCOMPILING AND "${HAVE_IOEO_EXITCODE}" MATCHES "FAILED_TO_RUN") + + message (STATUS "Performing Test InitOnceExecuteOnce - Failed") + file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log + "Performing InitOnceExecuteOnce Test failed with the following output:\n" + "${OUTPUT}\n" + "Return value: ${HAVE_IOEO_EXITCODE}\n") + endif ("${HAVE_IOEO_EXITCODE}" EQUAL 0) + endif ("${${HDF_PREFIX}_HAVE_IOEO}" MATCHES "^${${HDF_PREFIX}_HAVE_IOEO}$") + endif (NOT HDF_NO_IOEO_TEST) +endif (WINDOWS) + +#----------------------------------------------------------------------------- +# Determine how 'inline' is used +#----------------------------------------------------------------------------- +set (HDF_EXTRA_TEST_DEFINITIONS INLINE_TEST_INLINE) +foreach (inline_test inline __inline__ __inline) + set (INLINE_TEST_INLINE ${inline_test}) + HDF_FUNCTION_TEST (INLINE_TEST_${inline_test}) +endforeach (inline_test) + +set (HDF_EXTRA_TEST_DEFINITIONS) +if (INLINE_TEST___inline__) + set (${HDF_PREFIX}_inline __inline__) +else (INLINE_TEST___inline__) + if (INLINE_TEST___inline) + set (${HDF_PREFIX}_inline __inline) + else (INLINE_TEST___inline) + if (INLINE_TEST_inline) + set (${HDF_PREFIX}_inline inline) + endif (INLINE_TEST_inline) + endif (INLINE_TEST___inline) +endif (INLINE_TEST___inline__) + +#----------------------------------------------------------------------------- +# Check how to print a Long Long integer +#----------------------------------------------------------------------------- +if (NOT ${HDF_PREFIX}_PRINTF_LL_WIDTH OR ${HDF_PREFIX}_PRINTF_LL_WIDTH MATCHES "unknown") + set (PRINT_LL_FOUND 0) + message (STATUS "Checking for appropriate format for 64 bit long:") + foreach (HDF5_PRINTF_LL l64 l L q I64 ll) + set (CURRENT_TEST_DEFINITIONS "-DPRINTF_LL_WIDTH=${HDF5_PRINTF_LL}") + if (${HDF_PREFIX}_SIZEOF_LONG_LONG) + set (CURRENT_TEST_DEFINITIONS "${CURRENT_TEST_DEFINITIONS} -DHAVE_LONG_LONG") + endif (${HDF_PREFIX}_SIZEOF_LONG_LONG) + TRY_RUN (HDF5_PRINTF_LL_TEST_RUN HDF5_PRINTF_LL_TEST_COMPILE + ${CMAKE_BINARY_DIR} + ${HDF_RESOURCES_EXT_DIR}/HDFTests.c + CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${CURRENT_TEST_DEFINITIONS} + OUTPUT_VARIABLE OUTPUT + ) + if (HDF5_PRINTF_LL_TEST_COMPILE) + if (HDF5_PRINTF_LL_TEST_RUN MATCHES 0) + set (${HDF_PREFIX}_PRINTF_LL_WIDTH "\"${HDF5_PRINTF_LL}\"" CACHE INTERNAL "Width for printf for type `long long' or `__int64', us. `ll") + set (PRINT_LL_FOUND 1) + else (HDF5_PRINTF_LL_TEST_RUN MATCHES 0) + message ("Width with ${HDF5_PRINTF_LL} failed with result: ${HDF5_PRINTF_LL_TEST_RUN}") + endif (HDF5_PRINTF_LL_TEST_RUN MATCHES 0) + else (HDF5_PRINTF_LL_TEST_COMPILE) + file (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log + "Test ${HDF_PREFIX}_PRINTF_LL_WIDTH for ${HDF5_PRINTF_LL} failed with the following output:\n ${OUTPUT}\n" + ) + endif (HDF5_PRINTF_LL_TEST_COMPILE) + endforeach (HDF5_PRINTF_LL) + + if (PRINT_LL_FOUND) + message (STATUS "Checking for apropriate format for 64 bit long: found ${${HDF_PREFIX}_PRINTF_LL_WIDTH}") + else (PRINT_LL_FOUND) + message (STATUS "Checking for apropriate format for 64 bit long: not found") + set (${HDF_PREFIX}_PRINTF_LL_WIDTH "\"unknown\"" CACHE INTERNAL + "Width for printf for type `long long' or `__int64', us. `ll" + ) + endif (PRINT_LL_FOUND) +endif (NOT ${HDF_PREFIX}_PRINTF_LL_WIDTH OR ${HDF_PREFIX}_PRINTF_LL_WIDTH MATCHES "unknown") + +# ---------------------------------------------------------------------- +# Set the flag to indicate that the machine can handle converting +# denormalized floating-point values. +# (This flag should be set for all machines, except for the Crays, where +# the cache value is set in it's config file) +# +set (${HDF_PREFIX}_CONVERT_DENORMAL_FLOAT 1) diff --git a/config/cmake_ext_mod/FindMPI.cmake b/config/cmake_ext_mod/FindMPI.cmake new file mode 100644 index 0000000..1c9a2e3 --- /dev/null +++ b/config/cmake_ext_mod/FindMPI.cmake @@ -0,0 +1,684 @@ +#.rst: +# FindMPI +# ------- +# +# Find a Message Passing Interface (MPI) implementation +# +# The Message Passing Interface (MPI) is a library used to write +# high-performance distributed-memory parallel applications, and is +# typically deployed on a cluster. MPI is a standard interface (defined +# by the MPI forum) for which many implementations are available. All +# of them have somewhat different include paths, libraries to link +# against, etc., and this module tries to smooth out those differences. +# +# === Variables === +# +# This module will set the following variables per language in your +# project, where is one of C, CXX, or Fortran: +# +# :: +# +# MPI__FOUND TRUE if FindMPI found MPI flags for +# MPI__COMPILER MPI Compiler wrapper for +# MPI__COMPILE_FLAGS Compilation flags for MPI programs +# MPI__INCLUDE_PATH Include path(s) for MPI header +# MPI__LINK_FLAGS Linking flags for MPI programs +# MPI__LIBRARIES All libraries to link MPI programs against +# +# Additionally, FindMPI sets the following variables for running MPI +# programs from the command line: +# +# :: +# +# MPIEXEC Executable for running MPI programs +# MPIEXEC_NUMPROC_FLAG Flag to pass to MPIEXEC before giving +# it the number of processors to run on +# MPIEXEC_PREFLAGS Flags to pass to MPIEXEC directly +# before the executable to run. +# MPIEXEC_POSTFLAGS Flags to pass to MPIEXEC after other flags +# +# === Usage === +# +# To use this module, simply call FindMPI from a CMakeLists.txt file, or +# run find_package(MPI), then run CMake. If you are happy with the +# auto- detected configuration for your language, then you're done. If +# not, you have two options: +# +# :: +# +# 1. Set MPI__COMPILER to the MPI wrapper (mpicc, etc.) of your +# choice and reconfigure. FindMPI will attempt to determine all the +# necessary variables using THAT compiler's compile and link flags. +# 2. If this fails, or if your MPI implementation does not come with +# a compiler wrapper, then set both MPI__LIBRARIES and +# MPI__INCLUDE_PATH. You may also set any other variables +# listed above, but these two are required. This will circumvent +# autodetection entirely. +# +# When configuration is successful, MPI__COMPILER will be set to +# the compiler wrapper for , if it was found. MPI__FOUND +# and other variables above will be set if any MPI implementation was +# found for , regardless of whether a compiler was found. +# +# When using MPIEXEC to execute MPI applications, you should typically +# use all of the MPIEXEC flags as follows: +# +# :: +# +# ${MPIEXEC} ${MPIEXEC_NUMPROC_FLAG} PROCS +# ${MPIEXEC_PREFLAGS} EXECUTABLE ${MPIEXEC_POSTFLAGS} ARGS +# +# where PROCS is the number of processors on which to execute the +# program, EXECUTABLE is the MPI program, and ARGS are the arguments to +# pass to the MPI program. +# +# === Backward Compatibility === +# +# For backward compatibility with older versions of FindMPI, these +# variables are set, but deprecated: +# +# :: +# +# MPI_FOUND MPI_COMPILER MPI_LIBRARY +# MPI_COMPILE_FLAGS MPI_INCLUDE_PATH MPI_EXTRA_LIBRARY +# MPI_LINK_FLAGS MPI_LIBRARIES +# +# In new projects, please use the MPI__XXX equivalents. + +#============================================================================= +# Copyright 2001-2011 Kitware, Inc. +# Copyright 2010-2011 Todd Gamblin tgamblin@llnl.gov +# Copyright 2001-2009 Dave Partyka +# +# Distributed under the OSI-approved BSD License (the "License"); +# see accompanying file Copyright.txt for details. +# +# This software is distributed WITHOUT ANY WARRANTY; without even the +# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the License for more information. +#============================================================================= +# (To distribute this file outside of CMake, substitute the full +# License text for the above reference.) + +# include this to handle the QUIETLY and REQUIRED arguments +include(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake) +include(GetPrerequisites) + +# +# This part detects MPI compilers, attempting to wade through the mess of compiler names in +# a sensible way. +# +# The compilers are detected in this order: +# +# 1. Try to find the most generic available MPI compiler, as this is usually set up by +# cluster admins. e.g., if plain old mpicc is available, we'll use it and assume it's +# the right compiler. +# +# 2. If a generic mpicc is NOT found, then we attempt to find one that matches +# CMAKE__COMPILER_ID. e.g. if you are using XL compilers, we'll try to find mpixlc +# and company, but not mpiicc. This hopefully prevents toolchain mismatches. +# +# If you want to force a particular MPI compiler other than what we autodetect (e.g. if you +# want to compile regular stuff with GNU and parallel stuff with Intel), you can always set +# your favorite MPI__COMPILER explicitly and this stuff will be ignored. +# + +# Start out with the generic MPI compiler names, as these are most commonly used. +set(_MPI_C_COMPILER_NAMES mpicc mpcc mpicc_r mpcc_r) +set(_MPI_CXX_COMPILER_NAMES mpicxx mpiCC mpcxx mpCC mpic++ mpc++ + mpicxx_r mpiCC_r mpcxx_r mpCC_r mpic++_r mpc++_r) +set(_MPI_Fortran_COMPILER_NAMES mpif95 mpif95_r mpf95 mpf95_r + mpif90 mpif90_r mpf90 mpf90_r + mpif77 mpif77_r mpf77 mpf77_r) + +# GNU compiler names +set(_MPI_GNU_C_COMPILER_NAMES mpigcc mpgcc mpigcc_r mpgcc_r) +set(_MPI_GNU_CXX_COMPILER_NAMES mpig++ mpg++ mpig++_r mpg++_r) +set(_MPI_GNU_Fortran_COMPILER_NAMES mpigfortran mpgfortran mpigfortran_r mpgfortran_r + mpig77 mpig77_r mpg77 mpg77_r) + +# Intel MPI compiler names +set(_MPI_Intel_C_COMPILER_NAMES mpiicc) +set(_MPI_Intel_CXX_COMPILER_NAMES mpiicpc mpiicxx mpiic++ mpiiCC) +set(_MPI_Intel_Fortran_COMPILER_NAMES mpiifort mpiif95 mpiif90 mpiif77) + +# PGI compiler names +set(_MPI_PGI_C_COMPILER_NAMES mpipgcc mppgcc) +set(_MPI_PGI_CXX_COMPILER_NAMES mpipgCC mppgCC) +set(_MPI_PGI_Fortran_COMPILER_NAMES mpipgf95 mpipgf90 mppgf95 mppgf90 mpipgf77 mppgf77) + +# XLC MPI Compiler names +set(_MPI_XL_C_COMPILER_NAMES mpxlc mpxlc_r mpixlc mpixlc_r) +set(_MPI_XL_CXX_COMPILER_NAMES mpixlcxx mpixlC mpixlc++ mpxlcxx mpxlc++ mpixlc++ mpxlCC + mpixlcxx_r mpixlC_r mpixlc++_r mpxlcxx_r mpxlc++_r mpixlc++_r mpxlCC_r) +set(_MPI_XL_Fortran_COMPILER_NAMES mpixlf95 mpixlf95_r mpxlf95 mpxlf95_r + mpixlf90 mpixlf90_r mpxlf90 mpxlf90_r + mpixlf77 mpixlf77_r mpxlf77 mpxlf77_r + mpixlf mpixlf_r mpxlf mpxlf_r) + +# append vendor-specific compilers to the list if we either don't know the compiler id, +# or if we know it matches the regular compiler. +foreach (lang C CXX Fortran) + foreach (id GNU Intel PGI XL) + if (NOT CMAKE_${lang}_COMPILER_ID OR CMAKE_${lang}_COMPILER_ID STREQUAL id) + list(APPEND _MPI_${lang}_COMPILER_NAMES ${_MPI_${id}_${lang}_COMPILER_NAMES}) + endif() + unset(_MPI_${id}_${lang}_COMPILER_NAMES) # clean up the namespace here + endforeach() +endforeach() + + +# Names to try for MPI exec +set(_MPI_EXEC_NAMES mpiexec mpirun lamexec srun) + +# Grab the path to MPI from the registry if we're on windows. +set(_MPI_PREFIX_PATH) +if(WIN32) + # MSMPI + file(TO_CMAKE_PATH "$ENV{MSMPI_BIN}" msmpi_bin_path) # The default path ends with a '\' and doesn't mix with ';' when appending. + list(APPEND _MPI_PREFIX_PATH "${msmpi_bin_path}") + unset(msmpi_bin_path) + list(APPEND _MPI_PREFIX_PATH "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\MPI;InstallRoot]/Bin") + list(APPEND _MPI_PREFIX_PATH "$ENV{MSMPI_INC}/..") # The SDK is installed separately from the runtime + # MPICH + list(APPEND _MPI_PREFIX_PATH "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MPICH\\SMPD;binary]/..") + list(APPEND _MPI_PREFIX_PATH "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MPICH2;Path]") + list(APPEND _MPI_PREFIX_PATH "$ENV{ProgramW6432}/MPICH2/") +endif() + +# Build a list of prefixes to search for MPI. +foreach(SystemPrefixDir ${CMAKE_SYSTEM_PREFIX_PATH}) + foreach(MpiPackageDir ${_MPI_PREFIX_PATH}) + if(EXISTS ${SystemPrefixDir}/${MpiPackageDir}) + list(APPEND _MPI_PREFIX_PATH "${SystemPrefixDir}/${MpiPackageDir}") + endif() + endforeach() +endforeach() + +function (_mpi_check_compiler compiler options cmdvar resvar) + execute_process( + COMMAND "${compiler}" ${options} + OUTPUT_VARIABLE cmdline OUTPUT_STRIP_TRAILING_WHITESPACE + ERROR_VARIABLE cmdline ERROR_STRIP_TRAILING_WHITESPACE + RESULT_VARIABLE success) + # Intel MPI 5.0.1 will return a zero return code even when the + # argument to the MPI compiler wrapper is unknown. Attempt to + # catch this case. + if("${cmdline}" MATCHES "undefined reference") + set(success 255 ) + endif() + set(${cmdvar} "${cmdline}" PARENT_SCOPE) + set(${resvar} "${success}" PARENT_SCOPE) +endfunction() + +# +# interrogate_mpi_compiler(lang try_libs) +# +# Attempts to extract compiler and linker args from an MPI compiler. The arguments set +# by this function are: +# +# MPI__INCLUDE_PATH MPI__LINK_FLAGS MPI__FOUND +# MPI__COMPILE_FLAGS MPI__LIBRARIES +# +# MPI__COMPILER must be set beforehand to the absolute path to an MPI compiler for +# . Additionally, MPI__INCLUDE_PATH and MPI__LIBRARIES may be set +# to skip autodetection. +# +# If try_libs is TRUE, this will also attempt to find plain MPI libraries in the usual +# way. In general, this is not as effective as interrogating the compilers, as it +# ignores language-specific flags and libraries. However, some MPI implementations +# (Windows implementations) do not have compiler wrappers, so this approach must be used. +# +function (interrogate_mpi_compiler lang try_libs) + # MPI_${lang}_NO_INTERROGATE will be set to a compiler name when the *regular* compiler was + # discovered to be the MPI compiler. This happens on machines like the Cray XE6 that use + # modules to set cc, CC, and ftn to the MPI compilers. If the user force-sets another MPI + # compiler, MPI_${lang}_COMPILER won't be equal to MPI_${lang}_NO_INTERROGATE, and we'll + # inspect that compiler anew. This allows users to set new compilers w/o rm'ing cache. + string(COMPARE NOTEQUAL "${MPI_${lang}_NO_INTERROGATE}" "${MPI_${lang}_COMPILER}" interrogate) + + # If MPI is set already in the cache, don't bother with interrogating the compiler. + if (interrogate AND ((NOT MPI_${lang}_INCLUDE_PATH) OR (NOT MPI_${lang}_LIBRARIES))) + if (MPI_${lang}_COMPILER) + # Check whether the -showme:compile option works. This indicates that we have either OpenMPI + # or a newer version of LAM-MPI, and implies that -showme:link will also work. + _mpi_check_compiler("${MPI_${lang}_COMPILER}" "-showme:compile" MPI_COMPILE_CMDLINE MPI_COMPILER_RETURN) + if (MPI_COMPILER_RETURN EQUAL 0) + # If we appear to have -showme:compile, then we should + # also have -showme:link. Try it. + execute_process( + COMMAND ${MPI_${lang}_COMPILER} -showme:link + OUTPUT_VARIABLE MPI_LINK_CMDLINE OUTPUT_STRIP_TRAILING_WHITESPACE + ERROR_VARIABLE MPI_LINK_CMDLINE ERROR_STRIP_TRAILING_WHITESPACE + RESULT_VARIABLE MPI_COMPILER_RETURN) + + if (MPI_COMPILER_RETURN EQUAL 0) + # We probably have -showme:incdirs and -showme:libdirs as well, + # so grab that while we're at it. + execute_process( + COMMAND ${MPI_${lang}_COMPILER} -showme:incdirs + OUTPUT_VARIABLE MPI_INCDIRS OUTPUT_STRIP_TRAILING_WHITESPACE + ERROR_VARIABLE MPI_INCDIRS ERROR_STRIP_TRAILING_WHITESPACE) + + execute_process( + COMMAND ${MPI_${lang}_COMPILER} -showme:libdirs + OUTPUT_VARIABLE MPI_LIBDIRS OUTPUT_STRIP_TRAILING_WHITESPACE + ERROR_VARIABLE MPI_LIBDIRS ERROR_STRIP_TRAILING_WHITESPACE) + + else() + # reset things here if something went wrong. + set(MPI_COMPILE_CMDLINE) + set(MPI_LINK_CMDLINE) + endif() + endif () + + # Older versions of LAM-MPI have "-showme". Try to find that. + if (NOT MPI_COMPILER_RETURN EQUAL 0) + _mpi_check_compiler("${MPI_${lang}_COMPILER}" "-showme" MPI_COMPILE_CMDLINE MPI_COMPILER_RETURN) + endif() + + # MVAPICH uses -compile-info and -link-info. Try them. + if (NOT MPI_COMPILER_RETURN EQUAL 0) + _mpi_check_compiler("${MPI_${lang}_COMPILER}" "-compile-info" MPI_COMPILE_CMDLINE MPI_COMPILER_RETURN) + + # If we have compile-info, also have link-info. + if (MPI_COMPILER_RETURN EQUAL 0) + execute_process( + COMMAND ${MPI_${lang}_COMPILER} -link-info + OUTPUT_VARIABLE MPI_LINK_CMDLINE OUTPUT_STRIP_TRAILING_WHITESPACE + ERROR_VARIABLE MPI_LINK_CMDLINE ERROR_STRIP_TRAILING_WHITESPACE + RESULT_VARIABLE MPI_COMPILER_RETURN) + endif() + + # make sure we got compile and link. Reset vars if something's wrong. + if (NOT MPI_COMPILER_RETURN EQUAL 0) + set(MPI_COMPILE_CMDLINE) + set(MPI_LINK_CMDLINE) + endif() + endif() + + # MPICH just uses "-show". Try it. + if (NOT MPI_COMPILER_RETURN EQUAL 0) + _mpi_check_compiler("${MPI_${lang}_COMPILER}" "-show" MPI_COMPILE_CMDLINE MPI_COMPILER_RETURN) + endif() + + if (MPI_COMPILER_RETURN EQUAL 0) + # We have our command lines, but we might need to copy MPI_COMPILE_CMDLINE + # into MPI_LINK_CMDLINE, if we didn't find the link line. + if (NOT MPI_LINK_CMDLINE) + set(MPI_LINK_CMDLINE ${MPI_COMPILE_CMDLINE}) + endif() + else() + message(STATUS "Unable to determine MPI from MPI driver ${MPI_${lang}_COMPILER}") + set(MPI_COMPILE_CMDLINE) + set(MPI_LINK_CMDLINE) + endif() + + # Here, we're done with the interrogation part, and we'll try to extract args we care + # about from what we learned from the compiler wrapper scripts. + + # If interrogation came back with something, extract our variable from the MPI command line + if (MPI_COMPILE_CMDLINE OR MPI_LINK_CMDLINE) + # Extract compile flags from the compile command line. + string(REGEX MATCHALL "(^| )-[Df]([^\" ]+|\"[^\"]+\")" MPI_ALL_COMPILE_FLAGS "${MPI_COMPILE_CMDLINE}") + set(MPI_COMPILE_FLAGS_WORK) + + foreach(FLAG ${MPI_ALL_COMPILE_FLAGS}) + if (MPI_COMPILE_FLAGS_WORK) + set(MPI_COMPILE_FLAGS_WORK "${MPI_COMPILE_FLAGS_WORK} ${FLAG}") + else() + set(MPI_COMPILE_FLAGS_WORK ${FLAG}) + endif() + endforeach() + + # Extract include paths from compile command line + string(REGEX MATCHALL "(^| )-I([^\" ]+|\"[^\"]+\")" MPI_ALL_INCLUDE_PATHS "${MPI_COMPILE_CMDLINE}") + foreach(IPATH ${MPI_ALL_INCLUDE_PATHS}) + string(REGEX REPLACE "^ ?-I" "" IPATH ${IPATH}) + string(REPLACE "//" "/" IPATH ${IPATH}) + list(APPEND MPI_INCLUDE_PATH_WORK ${IPATH}) + endforeach() + + # try using showme:incdirs if extracting didn't work. + if (NOT MPI_INCLUDE_PATH_WORK) + set(MPI_INCLUDE_PATH_WORK ${MPI_INCDIRS}) + separate_arguments(MPI_INCLUDE_PATH_WORK) + endif() + + # If all else fails, just search for mpi.h in the normal include paths. + if (NOT MPI_INCLUDE_PATH_WORK) + set(MPI_HEADER_PATH "MPI_HEADER_PATH-NOTFOUND" CACHE FILEPATH "Cleared" FORCE) + find_path(MPI_HEADER_PATH mpi.h + HINTS ${_MPI_BASE_DIR} ${_MPI_PREFIX_PATH} + PATH_SUFFIXES include) + set(MPI_INCLUDE_PATH_WORK ${MPI_HEADER_PATH}) + endif() + + # Extract linker paths from the link command line + string(REGEX MATCHALL "(^| |-Wl,)-L([^\" ]+|\"[^\"]+\")" MPI_ALL_LINK_PATHS "${MPI_LINK_CMDLINE}") + set(MPI_LINK_PATH) + foreach(LPATH ${MPI_ALL_LINK_PATHS}) + string(REGEX REPLACE "^(| |-Wl,)-L" "" LPATH ${LPATH}) + string(REPLACE "//" "/" LPATH ${LPATH}) + list(APPEND MPI_LINK_PATH ${LPATH}) + endforeach() + + # try using showme:libdirs if extracting didn't work. + if (NOT MPI_LINK_PATH) + set(MPI_LINK_PATH ${MPI_LIBDIRS}) + separate_arguments(MPI_LINK_PATH) + endif() + + # Extract linker flags from the link command line + string(REGEX MATCHALL "(^| )(-Wl,|-Xlinker )([^\" ]+|\"[^\"]+\")" MPI_ALL_LINK_FLAGS "${MPI_LINK_CMDLINE}") + set(MPI_LINK_FLAGS_WORK) + foreach(FLAG ${MPI_ALL_LINK_FLAGS}) + if (MPI_LINK_FLAGS_WORK) + set(MPI_LINK_FLAGS_WORK "${MPI_LINK_FLAGS_WORK} ${FLAG}") + else() + set(MPI_LINK_FLAGS_WORK ${FLAG}) + endif() + endforeach() + + # Extract the set of libraries to link against from the link command + # line + string(REGEX MATCHALL "(^| )-l([^\" ]+|\"[^\"]+\")" MPI_LIBNAMES "${MPI_LINK_CMDLINE}") + + # add the compiler implicit directories because some compilers + # such as the intel compiler have libraries that show up + # in the showme list that can only be found in the implicit + # link directories of the compiler. + if (DEFINED CMAKE_${lang}_IMPLICIT_LINK_DIRECTORIES) + set(MPI_LINK_PATH + "${MPI_LINK_PATH};${CMAKE_${lang}_IMPLICIT_LINK_DIRECTORIES}") + endif () + + # Determine full path names for all of the libraries that one needs + # to link against in an MPI program + foreach(LIB ${MPI_LIBNAMES}) + string(REGEX REPLACE "^ ?-l" "" LIB ${LIB}) + # MPI_LIB is cached by find_library, but we don't want that. Clear it first. + set(MPI_LIB "MPI_LIB-NOTFOUND" CACHE FILEPATH "Cleared" FORCE) + find_library(MPI_LIB NAMES ${LIB} HINTS ${MPI_LINK_PATH}) + + if (MPI_LIB) + list(APPEND MPI_LIBRARIES_WORK ${MPI_LIB}) + elseif (NOT MPI_FIND_QUIETLY) + message(WARNING "Unable to find MPI library ${LIB}") + endif() + endforeach() + + # Sanity check MPI_LIBRARIES to make sure there are enough libraries + list(LENGTH MPI_LIBRARIES_WORK MPI_NUMLIBS) + list(LENGTH MPI_LIBNAMES MPI_NUMLIBS_EXPECTED) + if (NOT MPI_NUMLIBS EQUAL MPI_NUMLIBS_EXPECTED) + set(MPI_LIBRARIES_WORK "MPI_${lang}_LIBRARIES-NOTFOUND") + endif() + endif() + + elseif(try_libs) + # If we didn't have an MPI compiler script to interrogate, attempt to find everything + # with plain old find functions. This is nasty because MPI implementations have LOTS of + # different library names, so this section isn't going to be very generic. We need to + # make sure it works for MS MPI, though, since there are no compiler wrappers for that. + find_path(MPI_HEADER_PATH mpi.h + HINTS ${_MPI_BASE_DIR} ${_MPI_PREFIX_PATH} + PATH_SUFFIXES include Inc) + set(MPI_INCLUDE_PATH_WORK ${MPI_HEADER_PATH}) + + # Decide between 32-bit and 64-bit libraries for Microsoft's MPI + if("${CMAKE_SIZEOF_VOID_P}" EQUAL 8) + set(MS_MPI_ARCH_DIR x64) + set(MS_MPI_ARCH_DIR2 amd64) + else() + set(MS_MPI_ARCH_DIR x86) + set(MS_MPI_ARCH_DIR2 i386) + endif() + + set(MPI_LIB "MPI_LIB-NOTFOUND" CACHE FILEPATH "Cleared" FORCE) + find_library(MPI_LIB + NAMES mpi mpich mpich2 msmpi + HINTS ${_MPI_BASE_DIR} ${_MPI_PREFIX_PATH} + PATH_SUFFIXES lib lib/${MS_MPI_ARCH_DIR} Lib Lib/${MS_MPI_ARCH_DIR} lib/${MS_MPI_ARCH_DIR2} Lib/${MS_MPI_ARCH_DIR2}) + set(MPI_LIBRARIES_WORK ${MPI_LIB}) + + # Right now, we only know about the extra libs for C++. + # We could add Fortran here (as there is usually libfmpich, etc.), but + # this really only has to work with MS MPI on Windows. + # Assume that other MPI's are covered by the compiler wrappers. + if (${lang} STREQUAL CXX) + set(MPI_LIB "MPI_LIB-NOTFOUND" CACHE FILEPATH "Cleared" FORCE) + find_library(MPI_LIB + NAMES mpi++ mpicxx cxx mpi_cxx + HINTS ${_MPI_BASE_DIR} ${_MPI_PREFIX_PATH} + PATH_SUFFIXES lib) + if (MPI_LIBRARIES_WORK AND MPI_LIB) + list(APPEND MPI_LIBRARIES_WORK ${MPI_LIB}) + endif() + endif() + + if (${lang} STREQUAL Fortran) + set(MPI_HEADER_PATH "MPI_HEADER_PATH-NOTFOUND" CACHE FILEPATH "Cleared" FORCE) + find_path(MPI_HEADER_PATH mpifptr.h + HINTS ${_MPI_BASE_DIR} ${_MPI_PREFIX_PATH} + PATH_SUFFIXES include include/${MS_MPI_ARCH_DIR} include/${MS_MPI_ARCH_DIR2} Inc Inc/${MS_MPI_ARCH_DIR} Inc/${MS_MPI_ARCH_DIR2}) + if (MPI_INCLUDE_PATH_WORK AND MPI_HEADER_PATH) + list(APPEND MPI_INCLUDE_PATH_WORK ${MPI_HEADER_PATH}) + endif() + + set(MPI_LIB "MPI_LIB-NOTFOUND" CACHE FILEPATH "Cleared" FORCE) + find_library(MPI_LIB + NAMES fmpi fmpich fmpich2 fmpich2g msmpifec msmpifmc + HINTS ${_MPI_BASE_DIR} ${_MPI_PREFIX_PATH} + PATH_SUFFIXES lib lib/${MS_MPI_ARCH_DIR} Lib Lib/${MS_MPI_ARCH_DIR}) + if (MPI_LIBRARIES_WORK AND MPI_LIB) + list(APPEND MPI_LIBRARIES_WORK ${MPI_LIB}) + endif() + endif() + + if (NOT MPI_LIBRARIES_WORK) + set(MPI_LIBRARIES_WORK "MPI_${lang}_LIBRARIES-NOTFOUND") + endif() + endif() + + # If we found MPI, set up all of the appropriate cache entries + set(MPI_${lang}_COMPILE_FLAGS ${MPI_COMPILE_FLAGS_WORK} CACHE STRING "MPI ${lang} compilation flags" FORCE) + set(MPI_${lang}_INCLUDE_PATH ${MPI_INCLUDE_PATH_WORK} CACHE STRING "MPI ${lang} include path" FORCE) + set(MPI_${lang}_LINK_FLAGS ${MPI_LINK_FLAGS_WORK} CACHE STRING "MPI ${lang} linking flags" FORCE) + set(MPI_${lang}_LIBRARIES ${MPI_LIBRARIES_WORK} CACHE STRING "MPI ${lang} libraries to link against" FORCE) + mark_as_advanced(MPI_${lang}_COMPILE_FLAGS MPI_${lang}_INCLUDE_PATH MPI_${lang}_LINK_FLAGS MPI_${lang}_LIBRARIES) + + # clear out our temporary lib/header detectionv variable here. + set(MPI_LIB "MPI_LIB-NOTFOUND" CACHE INTERNAL "Scratch variable for MPI lib detection" FORCE) + set(MPI_HEADER_PATH "MPI_HEADER_PATH-NOTFOUND" CACHE INTERNAL "Scratch variable for MPI header detection" FORCE) + endif() + + # finally set a found variable for each MPI language + if (MPI_${lang}_INCLUDE_PATH AND MPI_${lang}_LIBRARIES) + set(MPI_${lang}_FOUND TRUE PARENT_SCOPE) + else() + set(MPI_${lang}_FOUND FALSE PARENT_SCOPE) + endif() +endfunction() + + +# This function attempts to compile with the regular compiler, to see if MPI programs +# work with it. This is a last ditch attempt after we've tried interrogating mpicc and +# friends, and after we've tried to find generic libraries. Works on machines like +# Cray XE6, where the modules environment changes what MPI version cc, CC, and ftn use. +function(try_regular_compiler lang success) + set(scratch_directory ${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}) + if (${lang} STREQUAL Fortran) + set(test_file ${scratch_directory}/cmake_mpi_test.f90) + file(WRITE ${test_file} + "program hello\n" + "include 'mpif.h'\n" + "integer ierror\n" + "call MPI_INIT(ierror)\n" + "call MPI_FINALIZE(ierror)\n" + "end\n") + else() + if (${lang} STREQUAL CXX) + set(test_file ${scratch_directory}/cmake_mpi_test.cpp) + else() + set(test_file ${scratch_directory}/cmake_mpi_test.c) + endif() + file(WRITE ${test_file} + "#include \n" + "int main(int argc, char **argv) {\n" + " MPI_Init(&argc, &argv);\n" + " MPI_Finalize();\n" + "}\n") + endif() + try_compile(compiler_has_mpi ${scratch_directory} ${test_file}) + if (compiler_has_mpi) + set(MPI_${lang}_NO_INTERROGATE ${CMAKE_${lang}_COMPILER} CACHE STRING "Whether to interrogate MPI ${lang} compiler" FORCE) + set(MPI_${lang}_COMPILER ${CMAKE_${lang}_COMPILER} CACHE STRING "MPI ${lang} compiler" FORCE) + set(MPI_${lang}_COMPILE_FLAGS "" CACHE STRING "MPI ${lang} compilation flags" FORCE) + set(MPI_${lang}_INCLUDE_PATH "" CACHE STRING "MPI ${lang} include path" FORCE) + set(MPI_${lang}_LINK_FLAGS "" CACHE STRING "MPI ${lang} linking flags" FORCE) + set(MPI_${lang}_LIBRARIES "" CACHE STRING "MPI ${lang} libraries to link against" FORCE) + endif() + set(${success} ${compiler_has_mpi} PARENT_SCOPE) + unset(compiler_has_mpi CACHE) +endfunction() + +# End definitions, commence real work here. + +# Most mpi distros have some form of mpiexec which gives us something we can reliably look for. +find_program(MPIEXEC + NAMES ${_MPI_EXEC_NAMES} + HINTS ${MPI_HOME} $ENV{MPI_HOME} + PATHS ${_MPI_PREFIX_PATH} + PATH_SUFFIXES bin + DOC "Executable for running MPI programs.") + +# call get_filename_component twice to remove mpiexec and the directory it exists in (typically bin). +# This gives us a fairly reliable base directory to search for /bin /lib and /include from. +get_filename_component(_MPI_BASE_DIR "${MPIEXEC}" PATH) +get_filename_component(_MPI_BASE_DIR "${_MPI_BASE_DIR}" PATH) + +set(MPIEXEC_NUMPROC_FLAG "-np" CACHE STRING "Flag used by MPI to specify the number of processes for MPIEXEC; the next option will be the number of processes.") +set(MPIEXEC_PREFLAGS "" CACHE STRING "These flags will be directly before the executable that is being run by MPIEXEC.") +set(MPIEXEC_POSTFLAGS "" CACHE STRING "These flags will come after all flags given to MPIEXEC.") +set(MPIEXEC_MAX_NUMPROCS "2" CACHE STRING "Maximum number of processors available to run MPI applications.") +mark_as_advanced(MPIEXEC MPIEXEC_NUMPROC_FLAG MPIEXEC_PREFLAGS MPIEXEC_POSTFLAGS MPIEXEC_MAX_NUMPROCS) + + +#============================================================================= +# Backward compatibility input hacks. Propagate the FindMPI hints to C and +# CXX if the respective new versions are not defined. Translate the old +# MPI_LIBRARY and MPI_EXTRA_LIBRARY to respective MPI_${lang}_LIBRARIES. +# +# Once we find the new variables, we translate them back into their old +# equivalents below. +foreach (lang C CXX) + # Old input variables. + set(_MPI_OLD_INPUT_VARS COMPILER COMPILE_FLAGS INCLUDE_PATH LINK_FLAGS) + + # Set new vars based on their old equivalents, if the new versions are not already set. + foreach (var ${_MPI_OLD_INPUT_VARS}) + if (NOT MPI_${lang}_${var} AND MPI_${var}) + set(MPI_${lang}_${var} "${MPI_${var}}") + endif() + endforeach() + + # Special handling for MPI_LIBRARY and MPI_EXTRA_LIBRARY, which we nixed in the + # new FindMPI. These need to be merged into MPI__LIBRARIES + if (NOT MPI_${lang}_LIBRARIES AND (MPI_LIBRARY OR MPI_EXTRA_LIBRARY)) + set(MPI_${lang}_LIBRARIES ${MPI_LIBRARY} ${MPI_EXTRA_LIBRARY}) + endif() +endforeach() +#============================================================================= + + +# This loop finds the compilers and sends them off for interrogation. +foreach (lang C CXX Fortran) + if (CMAKE_${lang}_COMPILER_WORKS) + # If the user supplies a compiler *name* instead of an absolute path, assume that we need to find THAT compiler. + if (MPI_${lang}_COMPILER) + is_file_executable(MPI_${lang}_COMPILER MPI_COMPILER_IS_EXECUTABLE) + if (NOT MPI_COMPILER_IS_EXECUTABLE) + # Get rid of our default list of names and just search for the name the user wants. + set(_MPI_${lang}_COMPILER_NAMES ${MPI_${lang}_COMPILER}) + set(MPI_${lang}_COMPILER "MPI_${lang}_COMPILER-NOTFOUND" CACHE FILEPATH "Cleared" FORCE) + # If the user specifies a compiler, we don't want to try to search libraries either. + set(try_libs FALSE) + endif() + else() + set(try_libs TRUE) + endif() + + find_program(MPI_${lang}_COMPILER + NAMES ${_MPI_${lang}_COMPILER_NAMES} + HINTS ${_MPI_BASE_DIR}/bin + PATHS ${_MPI_PREFIX_PATH} + ) + interrogate_mpi_compiler(${lang} ${try_libs}) + mark_as_advanced(MPI_${lang}_COMPILER) + + # last ditch try -- if nothing works so far, just try running the regular compiler and + # see if we can create an MPI executable. + set(regular_compiler_worked 0) + if (NOT MPI_${lang}_LIBRARIES OR NOT MPI_${lang}_INCLUDE_PATH) + try_regular_compiler(${lang} regular_compiler_worked) + endif() + + set(MPI_${lang}_FIND_QUIETLY ${MPI_FIND_QUIETLY}) + set(MPI_${lang}_FIND_REQUIRED ${MPI_FIND_REQUIRED}) + set(MPI_${lang}_FIND_VERSION ${MPI_FIND_VERSION}) + set(MPI_${lang}_FIND_VERSION_EXACT ${MPI_FIND_VERSION_EXACT}) + + if (regular_compiler_worked) + find_package_handle_standard_args(MPI_${lang} DEFAULT_MSG MPI_${lang}_COMPILER) + else() + find_package_handle_standard_args(MPI_${lang} DEFAULT_MSG MPI_${lang}_LIBRARIES MPI_${lang}_INCLUDE_PATH) + endif() + endif() +endforeach() + + +#============================================================================= +# More backward compatibility stuff +# +# Bare MPI sans ${lang} vars are set to CXX then C, depending on what was found. +# This mimics the behavior of the old language-oblivious FindMPI. +set(_MPI_OLD_VARS FOUND COMPILER INCLUDE_PATH COMPILE_FLAGS LINK_FLAGS LIBRARIES) +if (MPI_CXX_FOUND) + foreach (var ${_MPI_OLD_VARS}) + set(MPI_${var} ${MPI_CXX_${var}}) + endforeach() +elseif (MPI_C_FOUND) + foreach (var ${_MPI_OLD_VARS}) + set(MPI_${var} ${MPI_C_${var}}) + endforeach() +else() + # Note that we might still have found Fortran, but you'll need to use MPI_Fortran_FOUND + set(MPI_FOUND FALSE) +endif() + +# Chop MPI_LIBRARIES into the old-style MPI_LIBRARY and MPI_EXTRA_LIBRARY, and set them in cache. +if (MPI_LIBRARIES) + list(GET MPI_LIBRARIES 0 MPI_LIBRARY_WORK) + set(MPI_LIBRARY ${MPI_LIBRARY_WORK} CACHE FILEPATH "MPI library to link against" FORCE) +else() + set(MPI_LIBRARY "MPI_LIBRARY-NOTFOUND" CACHE FILEPATH "MPI library to link against" FORCE) +endif() + +list(LENGTH MPI_LIBRARIES MPI_NUMLIBS) +if (MPI_NUMLIBS GREATER 1) + set(MPI_EXTRA_LIBRARY_WORK ${MPI_LIBRARIES}) + list(REMOVE_AT MPI_EXTRA_LIBRARY_WORK 0) + set(MPI_EXTRA_LIBRARY ${MPI_EXTRA_LIBRARY_WORK} CACHE STRING "Extra MPI libraries to link against" FORCE) +else() + set(MPI_EXTRA_LIBRARY "MPI_EXTRA_LIBRARY-NOTFOUND" CACHE STRING "Extra MPI libraries to link against" FORCE) +endif() +#============================================================================= + +# unset these vars to cleanup namespace +unset(_MPI_OLD_VARS) +unset(_MPI_PREFIX_PATH) +unset(_MPI_BASE_DIR) +foreach (lang C CXX Fortran) + unset(_MPI_${lang}_COMPILER_NAMES) +endforeach() diff --git a/config/cmake_ext_mod/FindSZIP.cmake b/config/cmake_ext_mod/FindSZIP.cmake new file mode 100644 index 0000000..5f0f031 --- /dev/null +++ b/config/cmake_ext_mod/FindSZIP.cmake @@ -0,0 +1,172 @@ + +# - Find SZIP library +# - Derived from the FindTiff.cmake that is included with cmake +# Find the native SZIP includes and library +# This module defines +# SZIP_INCLUDE_DIRS, where to find tiff.h, etc. +# SZIP_LIBRARIES, libraries to link against to use SZIP. +# SZIP_FOUND, If false, do not try to use SZIP. +# also defined, but not for general use are +# SZIP_LIBRARY, where to find the SZIP library. +# SZIP_LIBRARY_DEBUG - Debug version of SZIP library +# SZIP_LIBRARY_RELEASE - Release Version of SZIP library + +# message (STATUS "Finding SZIP library and headers..." ) + +############################################ +# +# Check the existence of the libraries. +# +############################################ +# This macro was taken directly from the FindQt4.cmake file that is included +# with the CMake distribution. This is NOT my work. All work was done by the +# original authors of the FindQt4.cmake file. Only minor modifications were +# made to remove references to Qt and make this file more generally applicable +######################################################################### + +MACRO (SZIP_ADJUST_LIB_VARS basename) + if (${basename}_INCLUDE_DIR) + + # if only the release version was found, set the debug variable also to the release version + if (${basename}_LIBRARY_RELEASE AND NOT ${basename}_LIBRARY_DEBUG) + set (${basename}_LIBRARY_DEBUG ${${basename}_LIBRARY_RELEASE}) + set (${basename}_LIBRARY ${${basename}_LIBRARY_RELEASE}) + set (${basename}_LIBRARIES ${${basename}_LIBRARY_RELEASE}) + endif (${basename}_LIBRARY_RELEASE AND NOT ${basename}_LIBRARY_DEBUG) + + # if only the debug version was found, set the release variable also to the debug version + if (${basename}_LIBRARY_DEBUG AND NOT ${basename}_LIBRARY_RELEASE) + set (${basename}_LIBRARY_RELEASE ${${basename}_LIBRARY_DEBUG}) + set (${basename}_LIBRARY ${${basename}_LIBRARY_DEBUG}) + set (${basename}_LIBRARIES ${${basename}_LIBRARY_DEBUG}) + endif (${basename}_LIBRARY_DEBUG AND NOT ${basename}_LIBRARY_RELEASE) + if (${basename}_LIBRARY_DEBUG AND ${basename}_LIBRARY_RELEASE) + # if the generator supports configuration types then set + # optimized and debug libraries, or if the CMAKE_BUILD_TYPE has a value + if (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE) + set (${basename}_LIBRARY optimized ${${basename}_LIBRARY_RELEASE} debug ${${basename}_LIBRARY_DEBUG}) + else (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE) + # if there are no configuration types and CMAKE_BUILD_TYPE has no value + # then just use the release libraries + set (${basename}_LIBRARY ${${basename}_LIBRARY_RELEASE} ) + endif (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE) + set (${basename}_LIBRARIES optimized ${${basename}_LIBRARY_RELEASE} debug ${${basename}_LIBRARY_DEBUG}) + endif (${basename}_LIBRARY_DEBUG AND ${basename}_LIBRARY_RELEASE) + + set (${basename}_LIBRARY ${${basename}_LIBRARY} CACHE FILEPATH "The ${basename} library") + + if (${basename}_LIBRARY) + set (${basename}_FOUND 1) + endif (${basename}_LIBRARY) + + endif (${basename}_INCLUDE_DIR ) + + # Make variables changeble to the advanced user + MARK_AS_ADVANCED (${basename}_LIBRARY ${basename}_LIBRARY_RELEASE ${basename}_LIBRARY_DEBUG ${basename}_INCLUDE_DIR ) +ENDMACRO (SZIP_ADJUST_LIB_VARS) + + +# Look for the header file. +set (SZIP_INCLUDE_SEARCH_DIRS + $ENV{SZIP_INSTALL}/include + $ENV{SZIP_INSTALL}/include/szip + /usr/include + /usr/include/szip +) + +set (SZIP_LIB_SEARCH_DIRS + $ENV{SZIP_INSTALL}/lib + /usr/lib +) + +set (SZIP_BIN_SEARCH_DIRS + $ENV{SZIP_INSTALL}/bin + /usr/bin +) + +FIND_PATH (SZIP_INCLUDE_DIR + NAMES szlib.h + PATHS ${SZIP_INCLUDE_SEARCH_DIRS} + NO_DEFAULT_PATH +) + +if (WIN32) + set (SZIP_SEARCH_DEBUG_NAMES "sz_d;libsz_d") + set (SZIP_SEARCH_RELEASE_NAMES "sz;libsz;libszip") +else (WIN32) + set (SZIP_SEARCH_DEBUG_NAMES "sz_d") + set (SZIP_SEARCH_RELEASE_NAMES "sz;szip") +endif (WIN32) + +# Look for the library. +FIND_LIBRARY (SZIP_LIBRARY_DEBUG + NAMES ${SZIP_SEARCH_DEBUG_NAMES} + PATHS ${SZIP_LIB_SEARCH_DIRS} + NO_DEFAULT_PATH +) + +FIND_LIBRARY (SZIP_LIBRARY_RELEASE + NAMES ${SZIP_SEARCH_RELEASE_NAMES} + PATHS ${SZIP_LIB_SEARCH_DIRS} + NO_DEFAULT_PATH +) + +SZIP_ADJUST_LIB_VARS (SZIP) + +if (SZIP_INCLUDE_DIR AND SZIP_LIBRARY) + set (SZIP_FOUND 1) + set (SZIP_LIBRARIES ${SZIP_LIBRARY}) + set (SZIP_INCLUDE_DIRS ${SZIP_INCLUDE_DIR}) + if (SZIP_LIBRARY_DEBUG) + get_filename_component (SZIP_LIBRARY_PATH ${SZIP_LIBRARY_DEBUG} PATH) + set (SZIP_LIB_DIR ${SZIP_LIBRARY_PATH}) + elseif (SZIP_LIBRARY_RELEASE) + get_filename_component (SZIP_LIBRARY_PATH ${SZIP_LIBRARY_RELEASE} PATH) + set (SZIP_LIB_DIR ${SZIP_LIBRARY_PATH}) + endif (SZIP_LIBRARY_DEBUG) + +else (SZIP_INCLUDE_DIR AND SZIP_LIBRARY) + set (SZIP_FOUND 0) + set (SZIP_LIBRARIES) + set (SZIP_INCLUDE_DIRS) +endif (SZIP_INCLUDE_DIR AND SZIP_LIBRARY) + +# Report the results. +if (NOT SZIP_FOUND) + set (SZIP_DIR_MESSAGE + "SZip was not found. Make sure SZIP_LIBRARY and SZIP_INCLUDE_DIR are set or set the SZIP_INSTALL environment variable." + ) + if (NOT SZIP_FIND_QUIETLY) + message (STATUS "${SZIP_DIR_MESSAGE}") + else (NOT SZIP_FIND_QUIETLY) + if (SZIP_FIND_REQUIRED) + message (FATAL_ERROR "SZip was NOT found and is Required by this project") + endif (SZIP_FIND_REQUIRED) + endif (NOT SZIP_FIND_QUIETLY) +endif (NOT SZIP_FOUND) + +if (SZIP_FOUND) + include (CheckSymbolExists) + ############################################# + # Find out if SZIP was build using dll's + ############################################# + # Save required variable + set (CMAKE_REQUIRED_INCLUDES_SAVE ${CMAKE_REQUIRED_INCLUDES}) + set (CMAKE_REQUIRED_FLAGS_SAVE ${CMAKE_REQUIRED_FLAGS}) + # Add SZIP_INCLUDE_DIR to CMAKE_REQUIRED_INCLUDES + set (CMAKE_REQUIRED_INCLUDES "${CMAKE_REQUIRED_INCLUDES};${SZIP_INCLUDE_DIRS}") + + # Restore CMAKE_REQUIRED_INCLUDES and CMAKE_REQUIRED_FLAGS variables + set (CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES_SAVE}) + set (CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS_SAVE}) + # + ############################################# +endif (SZIP_FOUND) + +if (FIND_SZIP_DEBUG) + message (STATUS "SZIP_INCLUDE_DIR: ${SZIP_INCLUDE_DIR}") + message (STATUS "SZIP_INCLUDE_DIRS: ${SZIP_INCLUDE_DIRS}") + message (STATUS "SZIP_LIBRARY_DEBUG: ${SZIP_LIBRARY_DEBUG}") + message (STATUS "SZIP_LIBRARY_RELEASE: ${SZIP_LIBRARY_RELEASE}") + message (STATUS "CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}") +endif (FIND_SZIP_DEBUG) diff --git a/config/cmake_ext_mod/GetTimeOfDayTest.cpp b/config/cmake_ext_mod/GetTimeOfDayTest.cpp new file mode 100644 index 0000000..3b5bf60 --- /dev/null +++ b/config/cmake_ext_mod/GetTimeOfDayTest.cpp @@ -0,0 +1,15 @@ +#if defined (TRY_SYS_TIME_H) +#include +/* #include */ +#endif + + +#if defined (TRY_TIME_H) +#include +#endif + +int main(int argc, char **argv) { + struct timeval t1; + gettimeofday(&t1, 0x00); + return 0; +} diff --git a/config/cmake_ext_mod/HDFCXXTests.cpp b/config/cmake_ext_mod/HDFCXXTests.cpp new file mode 100644 index 0000000..6b47421 --- /dev/null +++ b/config/cmake_ext_mod/HDFCXXTests.cpp @@ -0,0 +1,56 @@ + +#ifdef OLD_HEADER_FILENAME + +#include + +int main(void) { return 0; } + +#endif + + +#ifdef HDF_NO_NAMESPACE + +namespace HDF { +int fnord; +} + +int main(void) { + using namespace HDF; + fnord = 37; + return 0; +} + +#endif + +#ifdef HDF_NO_STD + +#include + +using namespace std; + +int main(void) { + string myString("testing namespace std"); + return 0; +} + +#endif + +#ifdef BOOL_NOTDEFINED +int main(void) { + bool flag; + return 0; +} + +#endif + +#ifdef NO_STATIC_CAST + +int main(void) { + float test_float; + int test_int; + test_float = 37.0; + test_int = static_cast (test_float); + return 0; +} + +#endif diff --git a/config/cmake_ext_mod/HDFLibMacros.cmake b/config/cmake_ext_mod/HDFLibMacros.cmake new file mode 100644 index 0000000..7660a8a --- /dev/null +++ b/config/cmake_ext_mod/HDFLibMacros.cmake @@ -0,0 +1,270 @@ +#------------------------------------------------------------------------------- +MACRO (EXTERNAL_JPEG_LIBRARY compress_type jpeg_pic) + # May need to build JPEG with PIC on x64 machines with gcc + # Need to use CMAKE_ANSI_CFLAGS define so that compiler test works + + if (${compress_type} MATCHES "SVN") + EXTERNALPROJECT_ADD (JPEG + SVN_REPOSITORY ${JPEG_URL} + # [SVN_REVISION rev] + INSTALL_COMMAND "" + CMAKE_ARGS + -DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS} + -DJPEG_PACKAGE_EXT:STRING=${HDF_PACKAGE_EXT} + -DJPEG_EXTERNALLY_CONFIGURED:BOOL=OFF + -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} + -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX} + -DCMAKE_RUNTIME_OUTPUT_DIRECTORY:PATH=${CMAKE_RUNTIME_OUTPUT_DIRECTORY} + -DCMAKE_LIBRARY_OUTPUT_DIRECTORY:PATH=${CMAKE_LIBRARY_OUTPUT_DIRECTORY} + -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY} + -DCMAKE_ANSI_CFLAGS:STRING=${jpeg_pic} + ) + elseif (${compress_type} MATCHES "GIT") + EXTERNALPROJECT_ADD (JPEG + GIT_REPOSITORY ${JPEG_URL} + INSTALL_COMMAND "" + CMAKE_ARGS + -DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS} + -DJPEG_PACKAGE_EXT:STRING=${HDF_PACKAGE_EXT} + -DJPEG_EXTERNALLY_CONFIGURED:BOOL=OFF + -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} + -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX} + -DCMAKE_RUNTIME_OUTPUT_DIRECTORY:PATH=${CMAKE_RUNTIME_OUTPUT_DIRECTORY} + -DCMAKE_LIBRARY_OUTPUT_DIRECTORY:PATH=${CMAKE_LIBRARY_OUTPUT_DIRECTORY} + -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY} + -DCMAKE_ANSI_CFLAGS:STRING=${jpeg_pic} + ) + elseif (${compress_type} MATCHES "TGZ") + EXTERNALPROJECT_ADD (JPEG + URL ${JPEG_URL} + URL_MD5 "" + INSTALL_COMMAND "" + CMAKE_ARGS + -DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS} + -DJPEG_PACKAGE_EXT:STRING=${HDF_PACKAGE_EXT} + -DJPEG_EXTERNALLY_CONFIGURED:BOOL=OFF + -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} + -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX} + -DCMAKE_RUNTIME_OUTPUT_DIRECTORY:PATH=${CMAKE_RUNTIME_OUTPUT_DIRECTORY} + -DCMAKE_LIBRARY_OUTPUT_DIRECTORY:PATH=${CMAKE_LIBRARY_OUTPUT_DIRECTORY} + -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY} + -DCMAKE_ANSI_CFLAGS:STRING=${jpeg_pic} + ) + endif (${compress_type} MATCHES "SVN") + externalproject_get_property (JPEG BINARY_DIR SOURCE_DIR) + +##include (${BINARY_DIR}/${JPEG_PACKAGE_NAME}${HDF_PACKAGE_EXT}-targets.cmake) +# Create imported target jpeg-static + add_library(jpeg-static STATIC IMPORTED) +# Create imported target jpeg-shared + add_library(jpeg-shared SHARED IMPORTED) + if (BUILD_SHARED_LIBS) + HDF_IMPORT_SET_LIB_OPTIONS (jpeg-shared "jpeg" SHARED "") + add_dependencies (JPEG jpeg-shared) + set (JPEG_SHARED_LIBRARY "jpeg-shared") + set (JPEG_LIBRARIES ${JPEG_shared_LIBRARY}) + endif (BUILD_SHARED_LIBS) + HDF_IMPORT_SET_LIB_OPTIONS (jpeg-static "jpeg" STATIC "") + add_dependencies (JPEG jpeg-static) + set (JPEG_STATIC_LIBRARY "jpeg-static") + set (JPEG_LIBRARIES ${JPEG_static_LIBRARY}) + + set (JPEG_INCLUDE_DIR_GEN "${BINARY_DIR}") + set (JPEG_INCLUDE_DIR "${SOURCE_DIR}/src") + set (JPEG_FOUND 1) + set (JPEG_INCLUDE_DIRS ${JPEG_INCLUDE_DIR_GEN} ${JPEG_INCLUDE_DIR}) +ENDMACRO (EXTERNAL_JPEG_LIBRARY) + +#------------------------------------------------------------------------------- +MACRO (PACKAGE_JPEG_LIBRARY compress_type) + add_custom_target (JPEG-GenHeader-Copy ALL + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${JPEG_INCLUDE_DIR_GEN}/jconfig.h ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ + COMMENT "Copying ${JPEG_INCLUDE_DIR_GEN}/jconfig.h to ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/" + ) + set (EXTERNAL_HEADER_LIST ${EXTERNAL_HEADER_LIST} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/jconfig.h) + if (${compress_type} MATCHES "SVN" OR ${compress_type} MATCHES "TGZ") + add_dependencies (JPEG-GenHeader-Copy JPEG) + endif (${compress_type} MATCHES "SVN" OR ${compress_type} MATCHES "TGZ") +ENDMACRO (PACKAGE_JPEG_LIBRARY) + +#------------------------------------------------------------------------------- +MACRO (EXTERNAL_SZIP_LIBRARY compress_type encoding) + if (${compress_type} MATCHES "SVN") + EXTERNALPROJECT_ADD (SZIP + SVN_REPOSITORY ${SZIP_URL} + # [SVN_REVISION rev] + INSTALL_COMMAND "" + CMAKE_ARGS + -DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS} + -DSZIP_PACKAGE_EXT:STRING=${HDF_PACKAGE_EXT} + -DSZIP_EXTERNALLY_CONFIGURED:BOOL=OFF + -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} + -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX} + -DCMAKE_RUNTIME_OUTPUT_DIRECTORY:PATH=${CMAKE_RUNTIME_OUTPUT_DIRECTORY} + -DCMAKE_LIBRARY_OUTPUT_DIRECTORY:PATH=${CMAKE_LIBRARY_OUTPUT_DIRECTORY} + -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY} + -DCMAKE_ANSI_CFLAGS:STRING=${CMAKE_ANSI_CFLAGS} + -DSZIP_ENABLE_ENCODING:BOOL=${encoding} + ) + elseif (${compress_type} MATCHES "GIT") + EXTERNALPROJECT_ADD (SZIP + GIT_REPOSITORY ${SZIP_URL} + # [SVN_REVISION rev] + INSTALL_COMMAND "" + CMAKE_ARGS + -DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS} + -DSZIP_PACKAGE_EXT:STRING=${HDF_PACKAGE_EXT} + -DSZIP_EXTERNALLY_CONFIGURED:BOOL=OFF + -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} + -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX} + -DCMAKE_RUNTIME_OUTPUT_DIRECTORY:PATH=${CMAKE_RUNTIME_OUTPUT_DIRECTORY} + -DCMAKE_LIBRARY_OUTPUT_DIRECTORY:PATH=${CMAKE_LIBRARY_OUTPUT_DIRECTORY} + -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY} + -DCMAKE_ANSI_CFLAGS:STRING=${CMAKE_ANSI_CFLAGS} + -DSZIP_ENABLE_ENCODING:BOOL=${encoding} + ) + elseif (${compress_type} MATCHES "TGZ") + EXTERNALPROJECT_ADD (SZIP + URL ${SZIP_URL} + URL_MD5 "" + INSTALL_COMMAND "" + CMAKE_ARGS + -DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS} + -DSZIP_PACKAGE_EXT:STRING=${HDF_PACKAGE_EXT} + -DSZIP_EXTERNALLY_CONFIGURED:BOOL=OFF + -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} + -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX} + -DCMAKE_RUNTIME_OUTPUT_DIRECTORY:PATH=${CMAKE_RUNTIME_OUTPUT_DIRECTORY} + -DCMAKE_LIBRARY_OUTPUT_DIRECTORY:PATH=${CMAKE_LIBRARY_OUTPUT_DIRECTORY} + -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY} + -DCMAKE_ANSI_CFLAGS:STRING=${CMAKE_ANSI_CFLAGS} + -DSZIP_ENABLE_ENCODING:BOOL=${encoding} + ) + endif (${compress_type} MATCHES "SVN") + externalproject_get_property (SZIP BINARY_DIR SOURCE_DIR) + +##include (${BINARY_DIR}/${SZIP_PACKAGE_NAME}${HDF_PACKAGE_EXT}-targets.cmake) +# Create imported target szip-static + add_library(szip-static STATIC IMPORTED) +# Create imported target szip-shared + add_library(szip-shared SHARED IMPORTED) + if (BUILD_SHARED_LIBS) + HDF_IMPORT_SET_LIB_OPTIONS (szip-shared "szip" SHARED "") + add_dependencies (SZIP szip-shared) + set (SZIP_SHARED_LIBRARY "szip-shared") + set (SZIP_LIBRARIES ${SZIP_shared_LIBRARY}) + endif (BUILD_SHARED_LIBS) + HDF_IMPORT_SET_LIB_OPTIONS (szip-static "szip" STATIC "") + add_dependencies (SZIP szip-static) + set (SZIP_STATIC_LIBRARY "szip-static") + set (SZIP_LIBRARIES ${SZIP_static_LIBRARY}) + + set (SZIP_INCLUDE_DIR_GEN "${BINARY_DIR}") + set (SZIP_INCLUDE_DIR "${SOURCE_DIR}/src") + set (SZIP_FOUND 1) + set (SZIP_INCLUDE_DIRS ${SZIP_INCLUDE_DIR_GEN} ${SZIP_INCLUDE_DIR}) +ENDMACRO (EXTERNAL_SZIP_LIBRARY) + +#------------------------------------------------------------------------------- +MACRO (PACKAGE_SZIP_LIBRARY compress_type) + add_custom_target (SZIP-GenHeader-Copy ALL + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${SZIP_INCLUDE_DIR_GEN}/SZconfig.h ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ + COMMENT "Copying ${SZIP_INCLUDE_DIR_GEN}/SZconfig.h to ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/" + ) + set (EXTERNAL_HEADER_LIST ${EXTERNAL_HEADER_LIST} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/SZconfig.h) + if (${compress_type} MATCHES "SVN" OR ${compress_type} MATCHES "TGZ") + add_dependencies (SZIP-GenHeader-Copy SZIP) + endif (${compress_type} MATCHES "SVN" OR ${compress_type} MATCHES "TGZ") +ENDMACRO (PACKAGE_SZIP_LIBRARY) + +#------------------------------------------------------------------------------- +MACRO (EXTERNAL_ZLIB_LIBRARY compress_type) + if (${compress_type} MATCHES "SVN") + EXTERNALPROJECT_ADD (ZLIB + SVN_REPOSITORY ${ZLIB_URL} + # [SVN_REVISION rev] + INSTALL_COMMAND "" + CMAKE_ARGS + -DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS} + -DZLIB_PACKAGE_EXT:STRING=${HDF_PACKAGE_EXT} + -DZLIB_EXTERNALLY_CONFIGURED:BOOL=OFF + -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} + -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX} + -DCMAKE_RUNTIME_OUTPUT_DIRECTORY:PATH=${CMAKE_RUNTIME_OUTPUT_DIRECTORY} + -DCMAKE_LIBRARY_OUTPUT_DIRECTORY:PATH=${CMAKE_LIBRARY_OUTPUT_DIRECTORY} + -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY} + -DCMAKE_ANSI_CFLAGS:STRING=${CMAKE_ANSI_CFLAGS} + ) + elseif (${compress_type} MATCHES "GIT") + EXTERNALPROJECT_ADD (ZLIB + GIT_REPOSITORY ${ZLIB_URL} + # [SVN_REVISION rev] + INSTALL_COMMAND "" + CMAKE_ARGS + -DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS} + -DZLIB_PACKAGE_EXT:STRING=${HDF_PACKAGE_EXT} + -DZLIB_EXTERNALLY_CONFIGURED:BOOL=OFF + -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} + -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX} + -DCMAKE_RUNTIME_OUTPUT_DIRECTORY:PATH=${CMAKE_RUNTIME_OUTPUT_DIRECTORY} + -DCMAKE_LIBRARY_OUTPUT_DIRECTORY:PATH=${CMAKE_LIBRARY_OUTPUT_DIRECTORY} + -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY} + -DCMAKE_ANSI_CFLAGS:STRING=${CMAKE_ANSI_CFLAGS} + ) + elseif (${compress_type} MATCHES "TGZ") + EXTERNALPROJECT_ADD (ZLIB + URL ${ZLIB_URL} + URL_MD5 "" + INSTALL_COMMAND "" + CMAKE_ARGS + -DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS} + -DZLIB_PACKAGE_EXT:STRING=${HDF_PACKAGE_EXT} + -DZLIB_EXTERNALLY_CONFIGURED:BOOL=OFF + -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} + -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX} + -DCMAKE_RUNTIME_OUTPUT_DIRECTORY:PATH=${CMAKE_RUNTIME_OUTPUT_DIRECTORY} + -DCMAKE_LIBRARY_OUTPUT_DIRECTORY:PATH=${CMAKE_LIBRARY_OUTPUT_DIRECTORY} + -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY} + -DCMAKE_ANSI_CFLAGS:STRING=${CMAKE_ANSI_CFLAGS} + ) + endif (${compress_type} MATCHES "SVN") + externalproject_get_property (ZLIB BINARY_DIR SOURCE_DIR) + + if (WIN32) + set (ZLIB_LIB_NAME "zlib") + else (WIN32) + set (ZLIB_LIB_NAME "z") + endif (WIN32) +##include (${BINARY_DIR}/${ZLIB_PACKAGE_NAME}${HDF_PACKAGE_EXT}-targets.cmake) +# Create imported target zlib-static + add_library(zlib-static STATIC IMPORTED) +# Create imported target zlib-shared + add_library(zlib-shared SHARED IMPORTED) + if (BUILD_SHARED_LIBS) + HDF_IMPORT_SET_LIB_OPTIONS (zlib-shared ${ZLIB_LIB_NAME} SHARED "") + add_dependencies (ZLIB zlib-shared) + set (ZLIB_SHARED_LIBRARY "zlib-shared") + set (ZLIB_LIBRARIES ${ZLIB_SHARED_LIBRARY}) + endif (BUILD_SHARED_LIBS) + HDF_IMPORT_SET_LIB_OPTIONS (zlib-static ${ZLIB_LIB_NAME} STATIC "") + add_dependencies (ZLIB zlib-static) + set (ZLIB_STATIC_LIBRARY "zlib-static") + set (ZLIB_LIBRARIES ${ZLIB_static_LIBRARY}) + + set (ZLIB_INCLUDE_DIR_GEN "${BINARY_DIR}") + set (ZLIB_INCLUDE_DIR "${SOURCE_DIR}") + set (ZLIB_FOUND 1) + set (ZLIB_INCLUDE_DIRS ${ZLIB_INCLUDE_DIR_GEN} ${ZLIB_INCLUDE_DIR}) +ENDMACRO (EXTERNAL_ZLIB_LIBRARY) + +#------------------------------------------------------------------------------- +MACRO (PACKAGE_ZLIB_LIBRARY compress_type) + add_custom_target (ZLIB-GenHeader-Copy ALL + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${ZLIB_INCLUDE_DIR_GEN}/zconf.h ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ + COMMENT "Copying ${ZLIB_INCLUDE_DIR_GEN}/zconf.h to ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/" + ) + set (EXTERNAL_HEADER_LIST ${EXTERNAL_HEADER_LIST} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/zconf.h) + if (${compress_type} MATCHES "SVN" OR ${compress_type} MATCHES "TGZ") + add_dependencies (ZLIB-GenHeader-Copy ZLIB) + endif (${compress_type} MATCHES "SVN" OR ${compress_type} MATCHES "TGZ") +ENDMACRO (PACKAGE_ZLIB_LIBRARY) diff --git a/config/cmake_ext_mod/HDFMacros.cmake b/config/cmake_ext_mod/HDFMacros.cmake new file mode 100644 index 0000000..d3ac36b --- /dev/null +++ b/config/cmake_ext_mod/HDFMacros.cmake @@ -0,0 +1,277 @@ +#------------------------------------------------------------------------------- +macro (SET_GLOBAL_VARIABLE name value) + set (${name} ${value} CACHE INTERNAL "Used to pass variables between directories" FORCE) +endmacro (SET_GLOBAL_VARIABLE) + +#------------------------------------------------------------------------------- +macro (IDE_GENERATED_PROPERTIES SOURCE_PATH HEADERS SOURCES) + #set(source_group_path "Source/AIM/${NAME}") + string (REPLACE "/" "\\\\" source_group_path ${SOURCE_PATH}) + source_group (${source_group_path} FILES ${HEADERS} ${SOURCES}) + + #-- The following is needed if we ever start to use OS X Frameworks but only + #-- works on CMake 2.6 and greater + #set_property (SOURCE ${HEADERS} + # PROPERTY MACOSX_PACKAGE_LOCATION Headers/${NAME} + #) +endmacro (IDE_GENERATED_PROPERTIES) + +#------------------------------------------------------------------------------- +macro (IDE_SOURCE_PROPERTIES SOURCE_PATH HEADERS SOURCES) + # install (FILES ${HEADERS} + # DESTINATION include/R3D/${NAME} + # COMPONENT Headers + # ) + + string (REPLACE "/" "\\\\" source_group_path ${SOURCE_PATH} ) + source_group (${source_group_path} FILES ${HEADERS} ${SOURCES}) + + #-- The following is needed if we ever start to use OS X Frameworks but only + #-- works on CMake 2.6 and greater + #set_property (SOURCE ${HEADERS} + # PROPERTY MACOSX_PACKAGE_LOCATION Headers/${NAME} + #) +endmacro (IDE_SOURCE_PROPERTIES) + +#------------------------------------------------------------------------------- +macro (TARGET_NAMING libtarget libtype) + if (${libtype} MATCHES "SHARED") + set_target_properties (${libtarget} PROPERTIES OUTPUT_NAME "${libtarget}${ARGN}") + endif (${libtype} MATCHES "SHARED") +endmacro (TARGET_NAMING) + +#------------------------------------------------------------------------------- +macro (INSTALL_TARGET_PDB libtarget targetdestination targetcomponent) + if (WIN32 AND MSVC) + get_target_property (target_name ${libtarget} OUTPUT_NAME_RELWITHDEBINFO) + install ( + FILES + ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}${target_name}.pdb + DESTINATION + ${targetdestination} + CONFIGURATIONS RelWithDebInfo + COMPONENT ${targetcomponent} + ) + endif (WIN32 AND MSVC) +endmacro (INSTALL_TARGET_PDB) + +#------------------------------------------------------------------------------- +macro (INSTALL_PROGRAM_PDB progtarget targetdestination targetcomponent) + if (WIN32 AND MSVC) + get_target_property (target_name ${progtarget} OUTPUT_NAME_RELWITHDEBINFO) + get_target_property (target_prefix ${progtarget} PREFIX) + install ( + FILES + ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}/${target_prefix}${target_name}.pdb + DESTINATION + ${targetdestination} + CONFIGURATIONS RelWithDebInfo + COMPONENT ${targetcomponent} + ) + endif (WIN32 AND MSVC) +endmacro (INSTALL_PROGRAM_PDB) + +#------------------------------------------------------------------------------- +macro (HDF_SET_LIB_OPTIONS libtarget libname libtype) + if (${libtype} MATCHES "SHARED") + if (WIN32) + set (LIB_RELEASE_NAME "${libname}") + set (LIB_DEBUG_NAME "${libname}_D") + else (WIN32) + set (LIB_RELEASE_NAME "${libname}") + set (LIB_DEBUG_NAME "${libname}_debug") + endif (WIN32) + else (${libtype} MATCHES "SHARED") + if (WIN32) + set (LIB_RELEASE_NAME "lib${libname}") + set (LIB_DEBUG_NAME "lib${libname}_D") + else (WIN32) + set (LIB_RELEASE_NAME "${libname}") + set (LIB_DEBUG_NAME "${libname}_debug") + endif (WIN32) + endif (${libtype} MATCHES "SHARED") + + set_target_properties (${libtarget} + PROPERTIES + OUTPUT_NAME_DEBUG ${LIB_DEBUG_NAME} + OUTPUT_NAME_RELEASE ${LIB_RELEASE_NAME} + OUTPUT_NAME_MINSIZEREL ${LIB_RELEASE_NAME} + OUTPUT_NAME_RELWITHDEBINFO ${LIB_RELEASE_NAME} + ) + + #----- Use MSVC Naming conventions for Shared Libraries + if (MINGW AND ${libtype} MATCHES "SHARED") + set_target_properties (${libtarget} + PROPERTIES + IMPORT_SUFFIX ".lib" + IMPORT_PREFIX "" + PREFIX "" + ) + endif (MINGW AND ${libtype} MATCHES "SHARED") + +endmacro (HDF_SET_LIB_OPTIONS) + +#------------------------------------------------------------------------------- +macro (HDF_IMPORT_SET_LIB_OPTIONS libtarget libname libtype libversion) + HDF_SET_LIB_OPTIONS (${libtarget} ${libname} ${libtype}) + + if (${importtype} MATCHES "IMPORT") + set (importprefix "${CMAKE_STATIC_LIBRARY_PREFIX}") + endif (${importtype} MATCHES "IMPORT") + if (${CMAKE_BUILD_TYPE} MATCHES "Debug") + set (IMPORT_LIB_NAME ${LIB_DEBUG_NAME}) + else (${CMAKE_BUILD_TYPE} MATCHES "Debug") + set (IMPORT_LIB_NAME ${LIB_RELEASE_NAME}) + endif (${CMAKE_BUILD_TYPE} MATCHES "Debug") + + if (${libtype} MATCHES "SHARED") + if (WIN32) + if (MINGW) + set_target_properties (${libtarget} PROPERTIES + IMPORTED_IMPLIB "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${IMPORT_LIB_NAME}.lib" + IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${IMPORT_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" + ) + else (MINGW) + set_target_properties (${libtarget} PROPERTIES + IMPORTED_IMPLIB "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}${IMPORT_LIB_NAME}${CMAKE_IMPORT_LIBRARY_SUFFIX}" + IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}${IMPORT_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" + ) + endif (MINGW) + else (WIN32) + if (CYGWIN) + set_target_properties (${libtarget} PROPERTIES + IMPORTED_IMPLIB "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_IMPORT_LIBRARY_PREFIX}${IMPORT_LIB_NAME}${CMAKE_IMPORT_LIBRARY_SUFFIX}" + IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_IMPORT_LIBRARY_PREFIX}${IMPORT_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" + ) + else (CYGWIN) + set_target_properties (${libtarget} PROPERTIES + IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_SHARED_LIBRARY_PREFIX}${IMPORT_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" + IMPORTED_SONAME "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_SHARED_LIBRARY_PREFIX}${IMPORT_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}.${libversion}" + SOVERSION "${libversion}" + ) + endif (CYGWIN) + endif (WIN32) + else (${libtype} MATCHES "SHARED") + if (WIN32 AND NOT MINGW) + set_target_properties (${libtarget} PROPERTIES + IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}/${IMPORT_LIB_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX}" + IMPORTED_LINK_INTERFACE_LANGUAGES "C" + ) + else (WIN32 AND NOT MINGW) + set_target_properties (${libtarget} PROPERTIES + IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_STATIC_LIBRARY_PREFIX}${IMPORT_LIB_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX}" + IMPORTED_LINK_INTERFACE_LANGUAGES "C" + ) + endif (WIN32 AND NOT MINGW) + endif (${libtype} MATCHES "SHARED") + +endmacro (HDF_IMPORT_SET_LIB_OPTIONS) + +#------------------------------------------------------------------------------- +macro (TARGET_C_PROPERTIES wintarget libtype addcompileflags addlinkflags) + if (MSVC) + TARGET_MSVC_PROPERTIES (${wintarget} ${libtype} "${addcompileflags} ${WIN_COMPILE_FLAGS}" "${addlinkflags} ${WIN_LINK_FLAGS}") + else (MSVC) + set_target_properties (${wintarget} + PROPERTIES + COMPILE_FLAGS "${addcompileflags}" + LINK_FLAGS "${addlinkflags}" + ) + endif (MSVC) +endmacro (TARGET_C_PROPERTIES) + +#------------------------------------------------------------------------------- +macro (TARGET_MSVC_PROPERTIES wintarget libtype addcompileflags addlinkflags) + if (MSVC) + set_target_properties (${wintarget} + PROPERTIES + COMPILE_FLAGS "${addcompileflags}" + LINK_FLAGS "${addlinkflags}" + ) + endif (MSVC) +endmacro (TARGET_MSVC_PROPERTIES) + +#------------------------------------------------------------------------------- +macro (TARGET_FORTRAN_PROPERTIES forttarget libtype addcompileflags addlinkflags) + if (WIN32) + TARGET_FORTRAN_WIN_PROPERTIES (${forttarget} ${libtype} "${addcompileflags} ${WIN_COMPILE_FLAGS}" "${addlinkflags} ${WIN_LINK_FLAGS}") + endif (WIN32) +endmacro (TARGET_FORTRAN_PROPERTIES) + +#------------------------------------------------------------------------------- +macro (TARGET_FORTRAN_WIN_PROPERTIES forttarget libtype addcompileflags addlinkflags) + if (MSVC) + if (${libtype} MATCHES "SHARED") + set_target_properties (${forttarget} + PROPERTIES + COMPILE_FLAGS "/dll ${addcompileflags}" + LINK_FLAGS "/SUBSYSTEM:CONSOLE ${addlinkflags}" + ) + else (${libtype} MATCHES "SHARED") + set_target_properties (${forttarget} + PROPERTIES + COMPILE_FLAGS "${addcompileflags}" + LINK_FLAGS "/SUBSYSTEM:CONSOLE ${addlinkflags}" + ) + endif (${libtype} MATCHES "SHARED") + endif (MSVC) +endmacro (TARGET_FORTRAN_WIN_PROPERTIES) + +#----------------------------------------------------------------------------- +# Configure the README.txt file for the binary package +#----------------------------------------------------------------------------- +macro (HDF_README_PROPERTIES target_fortran) + set (BINARY_SYSTEM_NAME ${CMAKE_SYSTEM_NAME}) + set (BINARY_PLATFORM "${CMAKE_SYSTEM_NAME}") + if (WIN32) + set (BINARY_EXAMPLE_ENDING "zip") + set (BINARY_INSTALL_ENDING "msi") + if (CMAKE_CL_64) + set (BINARY_SYSTEM_NAME "win64") + else (CMAKE_CL_64) + set (BINARY_SYSTEM_NAME "win32") + endif (CMAKE_CL_64) + if (${CMAKE_SYSTEM_VERSION} MATCHES "6.1") + set (BINARY_PLATFORM "${BINARY_PLATFORM} 7") + elseif (${CMAKE_SYSTEM_VERSION} MATCHES "6.2") + set (BINARY_PLATFORM "${BINARY_PLATFORM} 8") + endif (${CMAKE_SYSTEM_VERSION} MATCHES "6.1") + set (BINARY_PLATFORM "${BINARY_PLATFORM} ${MSVC_C_ARCHITECTURE_ID}") + if (${CMAKE_C_COMPILER_VERSION} MATCHES "16.*") + set (BINARY_PLATFORM "${BINARY_PLATFORM}, using VISUAL STUDIO 2010") + elseif (${CMAKE_C_COMPILER_VERSION} MATCHES "15.*") + set (BINARY_PLATFORM "${BINARY_PLATFORM}, using VISUAL STUDIO 2008") + elseif (${CMAKE_C_COMPILER_VERSION} MATCHES "17.*") + set (BINARY_PLATFORM "${BINARY_PLATFORM}, using VISUAL STUDIO 2012") + elseif (${CMAKE_C_COMPILER_VERSION} MATCHES "18.*") + set (BINARY_PLATFORM "${BINARY_PLATFORM}, using VISUAL STUDIO 2013") + else (${CMAKE_C_COMPILER_VERSION} MATCHES "16.*") + set (BINARY_PLATFORM "${BINARY_PLATFORM}, using VISUAL STUDIO ${CMAKE_C_COMPILER_VERSION}") + endif (${CMAKE_C_COMPILER_VERSION} MATCHES "16.*") + elseif (APPLE) + set (BINARY_EXAMPLE_ENDING "tar.gz") + set (BINARY_INSTALL_ENDING "dmg") + set (BINARY_PLATFORM "${BINARY_PLATFORM} ${CMAKE_SYSTEM_VERSION} ${CMAKE_SYSTEM_PROCESSOR}") + set (BINARY_PLATFORM "${BINARY_PLATFORM}, using ${CMAKE_C_COMPILER_ID} C ${CMAKE_C_COMPILER_VERSION}") + else (WIN32) + set (BINARY_EXAMPLE_ENDING "tar.gz") + set (BINARY_INSTALL_ENDING "sh") + set (BINARY_PLATFORM "${BINARY_PLATFORM} ${CMAKE_SYSTEM_VERSION} ${CMAKE_SYSTEM_PROCESSOR}") + set (BINARY_PLATFORM "${BINARY_PLATFORM}, using ${CMAKE_C_COMPILER_ID} C ${CMAKE_C_COMPILER_VERSION}") + endif (WIN32) + + if (target_fortran) + set (BINARY_PLATFORM "${BINARY_PLATFORM} / ${CMAKE_Fortran_COMPILER_ID} Fortran") + endif (target_fortran) + + if (BUILD_SHARED_LIBS) + set (LIB_TYPE "Static and Shared") + else (BUILD_SHARED_LIBS) + set (LIB_TYPE "Static") + endif (BUILD_SHARED_LIBS) + + configure_file ( + ${HDF_RESOURCES_DIR}/README.txt.cmake.in + ${CMAKE_BINARY_DIR}/README.txt @ONLY + ) +endmacro (HDF_README_PROPERTIES) diff --git a/config/cmake_ext_mod/HDFTests.c b/config/cmake_ext_mod/HDFTests.c new file mode 100644 index 0000000..1c23ac3 --- /dev/null +++ b/config/cmake_ext_mod/HDFTests.c @@ -0,0 +1,466 @@ +#define SIMPLE_TEST(x) int main(){ x; return 0; } + +#ifdef HAVE_C99_DESIGNATED_INITIALIZER + +#ifdef FC_DUMMY_MAIN +#ifndef FC_DUMMY_MAIN_EQ_F77 +# ifdef __cplusplus +extern "C" +# endif +int FC_DUMMY_MAIN() +{ return 1;} +#endif +#endif +int +main () +{ + + typedef struct + { + int x; + union + { + int i; + double d; + }u; + }di_struct_t; + di_struct_t x = + { 0, + { .d = 0.0}}; + ; + return 0; +} + +#endif + +#ifdef HAVE_C99_FUNC + +#ifdef FC_DUMMY_MAIN +#ifndef FC_DUMMY_MAIN_EQ_F77 +# ifdef __cplusplus + extern "C" +# endif + int FC_DUMMY_MAIN() { return 1; } +#endif +#endif +int +main () +{ + const char *fname = __func__; + ; + return 0; +} + +#endif + +#ifdef VSNPRINTF_WORKS +#include +#include +#include + +int test_vsnprintf(const char *fmt,...) +{ + va_list ap; + char *s = malloc(16); + int ret; + + va_start(ap, fmt); + ret=vsnprintf(s,16,"%s",ap); + va_end(ap); + + return(ret!=42 ? 1 : 0); +} + +int main(void) +{ + return(test_vsnprintf("%s","A string that is longer than 16 characters")); +} +#endif + + +#ifdef TIME_WITH_SYS_TIME +/* Time with sys/time test */ + +#include +#include +#include + +int +main () +{ +if ((struct tm *) 0) +return 0; + ; + return 0; +} + +#endif + +#ifdef STDC_HEADERS +#include +#include +#include +#include +int main() { return 0; } +#endif /* STDC_HEADERS */ + + +#ifdef HAVE_ATTRIBUTE + +#if 0 +static void test int __attribute((unused)) var) +{ + int __attribute__((unused)) x = var; +} + +int main(void) +{ + test(19); +} + +#else +int +main () +{ +int __attribute__((unused)) x + ; + return 0; +} +#endif + + +#endif /* HAVE_ATTRIBUTE */ + +#ifdef HAVE_FUNCTION + +#ifdef FC_DUMMY_MAIN +#ifndef FC_DUMMY_MAIN_EQ_F77 +# ifdef __cplusplus + extern "C" +# endif + int FC_DUMMY_MAIN() { return 1; } +#endif +#endif +int +main () +{ +(void)__FUNCTION__ + ; + return 0; +} + +#endif /* HAVE_FUNCTION */ + +#ifdef HAVE_TM_GMTOFF + +#ifdef HAVE_SYS_TIME_H +#include +#endif +#include +SIMPLE_TEST(struct tm tm; tm.tm_gmtoff=0); + +#endif /* HAVE_TM_GMTOFF */ + +#ifdef HAVE___TM_GMTOFF + +#ifdef HAVE_SYS_TIME_H +#include +#endif +#include +SIMPLE_TEST(struct tm tm; tm.__tm_gmtoff=0); + +#endif /* HAVE_TM_GMTOFF */ + +#ifdef HAVE_TIMEZONE + +#ifdef HAVE_SYS_TIME_H +#include +#endif +#include +SIMPLE_TEST(timezone=0); + +#endif /* HAVE_TIMEZONE */ + +#ifdef HAVE_STRUCT_TIMEZONE + +#include +#ifdef HAVE_SYS_TIME_H +#include +#endif +#include +SIMPLE_TEST(struct timezone tz; tz.tz_minuteswest=0); + +#endif /* HAVE_STRUCT_TIMEZONE */ + +#ifdef HAVE_STAT_ST_BLOCKS + +#include +SIMPLE_TEST(struct stat sb; sb.st_blocks=0); + +#endif /* HAVE_STAT_ST_BLOCKS */ + +#ifdef PRINTF_LL_WIDTH + +#ifdef HAVE_LONG_LONG +# define LL_TYPE long long +#else /* HAVE_LONG_LONG */ +# define LL_TYPE __int64 +#endif /* HAVE_LONG_LONG */ + +#include +#include +#include + +int main(void) +{ + char *llwidthArgs[] = { "l64", "l", "L", "q", "ll", NULL }; + char *s = malloc(128); + char **currentArg = NULL; + LL_TYPE x = (LL_TYPE)1048576 * (LL_TYPE)1048576; + for (currentArg = llwidthArgs; *currentArg != NULL; currentArg++) + { + char formatString[64]; + sprintf(formatString, "%%%sd", *currentArg); + sprintf(s, formatString, x); + if (strcmp(s, "1099511627776") == 0) + { + printf("PRINTF_LL_WIDTH=[%s]\n", *currentArg); + return 0; + } + } + return 1; +} + +#endif /* PRINTF_LL_WIDTH */ + +#ifdef SYSTEM_SCOPE_THREADS +#include +#include + +int main(void) +{ + pthread_attr_t attribute; + int ret; + + pthread_attr_init(&attribute); + ret=pthread_attr_setscope(&attribute, PTHREAD_SCOPE_SYSTEM); + if (ret==0) + return 0; + return 1; +} + +#endif /* SYSTEM_SCOPE_THREADS */ + +#ifdef HAVE_SOCKLEN_T + +#include +#include +#ifdef HAVE_UNISTD_H +#include +#endif +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_SYS_SOCKET_H +#include +#endif + +SIMPLE_TEST(socklen_t foo); + +#endif /* HAVE_SOCKLEN_T */ + +#ifdef DEV_T_IS_SCALAR + +#ifdef HAVE_SYS_TYPES_H +#include +#endif + +int main () +{ + dev_t d1, d2; + if(d1==d2) + return 0; + return 1; +} + +#endif /* DEV_T_IS_SCALAR */ + +#ifdef HAVE_OFF64_T +#include +int main() +{ + off64_t n = 0; + return (int)n; +} +#endif + +#ifdef HAVE_STAT64_STRUCT +#include +#include ], +struct stat64 sb; +int main() +{ + return 0; +} +#endif + +#ifdef TEST_DIRECT_VFD_WORKS +#include +#include +#include +int main(void) +{ + int fid; + if((fid=open("tst_file", O_CREAT | O_TRUNC | O_DIRECT, 0755))<0) + return 1; + close(fid); + remove("tst_file"); + return 0; +} +#endif + +#ifdef HAVE_DIRECT + SIMPLE_TEST(posix_memalign()); +#endif + +#ifdef HAVE_DEFAULT_SOURCE +/* check default source */ +#include + +int +main(void) +{ +#ifdef __GLIBC_PREREQ + return __GLIBC_PREREQ(2,19); +#else + return 0; +#endif /* defined(__GLIBC_PREREQ) */ +} +#endif + +#ifdef TEST_LFS_WORKS +/* Return 0 when LFS is available and 1 otherwise. */ +#define _LARGEFILE_SOURCE +#define _LARGEFILE64_SOURCE +#define _LARGE_FILES +#define _FILE_OFFSET_BITS 64 +#include +#include +#include +#include + +int main(int argc, char **argv) +{ + /* check that off_t can hold 2^63 - 1 and perform basic operations... */ +#define OFF_T_64 (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + if (OFF_T_64 % 2147483647 != 1) + return 1; + + /* stat breaks on SCO OpenServer */ + struct stat buf; + stat( argv[0], &buf ); + if (!S_ISREG(buf.st_mode)) + return 2; + + FILE *file = fopen( argv[0], "r" ); + off_t offset = ftello( file ); + fseek( file, offset, SEEK_CUR ); + fclose( file ); + return 0; +} +#endif + +#ifdef GETTIMEOFDAY_GIVES_TZ +#include +#ifdef HAVE_SYS_TIME_H +#include +#endif +int main(void) +{ + struct timeval tv; + struct timezone tz; + tz.tz_minuteswest = 7777; /* Initialize to an unreasonable number */ + tz.tz_dsttime = 7; + gettimeofday(&tv, &tz); + /* Check whether the function returned any value at all */ + if(tz.tz_minuteswest == 7777 && tz.tz_dsttime == 7) + return 1; + else return 0; +} +#endif + +#ifdef CXX_HAVE_OFFSETOF + +#include +#include + +#ifdef FC_DUMMY_MAIN +#ifndef FC_DUMMY_MAIN_EQ_F77 +# ifdef __cplusplus +extern "C" +# endif +int FC_DUMMY_MAIN() +{ return 1;} +#endif +#endif +int +main () +{ + + struct index_st + { + unsigned char type; + unsigned char num; + unsigned int len; + }; + typedef struct index_st index_t; + int x,y; + x = offsetof(struct index_st, len); + y = offsetof(index_t, num) + + ; + return 0; +} + +#endif + +#ifdef HAVE_IOEO + +#include +typedef void (WINAPI *PGNSI)(LPSYSTEM_INFO); +int main () +{ + PGNSI pGNSI; + pGNSI = (PGNSI) GetProcAddress( + GetModuleHandle(TEXT("kernel32.dll")), + "InitOnceExecuteOnce"); + if(NULL == pGNSI) + return 1; + else + return 0; +} + +#endif /* HAVE_IOEO */ + +#ifdef HAVE_STRUCT_VIDEOCONFIG + +SIMPLE_TEST(struct videoconfig w; w.numtextcols=0); + +#endif /* HAVE_TM_GMTOFF */ + +#ifdef HAVE_STRUCT_TEXT_INFO + +SIMPLE_TEST(struct text_info w; w.screenwidth=0); + +#endif /* HAVE_TM_GMTOFF */ + + +#if defined( INLINE_TEST_inline ) || defined( INLINE_TEST___inline__ ) || defined( INLINE_TEST___inline ) +#ifndef __cplusplus +typedef int foo_t; +static INLINE_TEST_INLINE foo_t static_foo () { return 0; } +INLINE_TEST_INLINE foo_t foo () {return 0; } +int main() { return 0; } +#endif + +#endif /* INLINE_TEST */ diff --git a/config/cmake_ext_mod/HDFUseFortran.cmake b/config/cmake_ext_mod/HDFUseFortran.cmake new file mode 100644 index 0000000..66a631f --- /dev/null +++ b/config/cmake_ext_mod/HDFUseFortran.cmake @@ -0,0 +1,176 @@ +# +# This file provides functions for Fortran support. +# +#------------------------------------------------------------------------------- +ENABLE_LANGUAGE (Fortran) + +#----------------------------------------------------------------------------- +# Detect name mangling convention used between Fortran and C +#----------------------------------------------------------------------------- +include (FortranCInterface) +FortranCInterface_HEADER ( + ${CMAKE_BINARY_DIR}/FCMangle.h + MACRO_NAMESPACE "H5_FC_" + SYMBOL_NAMESPACE "H5_FC_" + SYMBOLS mysub mymod:my_sub +) + +file (STRINGS ${CMAKE_BINARY_DIR}/FCMangle.h CONTENTS REGEX "H5_FC_GLOBAL\\(.*,.*\\) +(.*)") +string (REGEX MATCH "H5_FC_GLOBAL\\(.*,.*\\) +(.*)" RESULT ${CONTENTS}) +set (H5_FC_FUNC "H5_FC_FUNC(name,NAME) ${CMAKE_MATCH_1}") + +file (STRINGS ${CMAKE_BINARY_DIR}/FCMangle.h CONTENTS REGEX "H5_FC_GLOBAL_\\(.*,.*\\) +(.*)") +string (REGEX MATCH "H5_FC_GLOBAL_\\(.*,.*\\) +(.*)" RESULT ${CONTENTS}) +set (H5_FC_FUNC_ "H5_FC_FUNC_(name,NAME) ${CMAKE_MATCH_1}") + +#----------------------------------------------------------------------------- +# The provided CMake Fortran macros don't provide a general check function +# so this one is used for a sizeof test. +#----------------------------------------------------------------------------- +MACRO (CHECK_FORTRAN_FEATURE FUNCTION CODE VARIABLE) + if (NOT DEFINED ${VARIABLE}) + message (STATUS "Testing Fortran ${FUNCTION}") + if (CMAKE_REQUIRED_LIBRARIES) + set (CHECK_FUNCTION_EXISTS_ADD_LIBRARIES + "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}") + else (CMAKE_REQUIRED_LIBRARIES) + set (CHECK_FUNCTION_EXISTS_ADD_LIBRARIES) + endif (CMAKE_REQUIRED_LIBRARIES) + file (WRITE + ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompiler.f90 + "${CODE}" + ) + TRY_COMPILE (${VARIABLE} + ${CMAKE_BINARY_DIR} + ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompiler.f90 + CMAKE_FLAGS "${CHECK_FUNCTION_EXISTS_ADD_LIBRARIES}" + OUTPUT_VARIABLE OUTPUT + ) + +# message ( "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ") +# message ( "Test result ${OUTPUT}") +# message ( "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ") + + if (${VARIABLE}) + set (${VARIABLE} 1 CACHE INTERNAL "Have Fortran function ${FUNCTION}") + message (STATUS "Testing Fortran ${FUNCTION} - OK") + file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + "Determining if the Fortran ${FUNCTION} exists passed with the following output:\n" + "${OUTPUT}\n\n" + ) + else (${VARIABLE}) + message (STATUS "Testing Fortran ${FUNCTION} - Fail") + set (${VARIABLE} "" CACHE INTERNAL "Have Fortran function ${FUNCTION}") + file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log + "Determining if the Fortran ${FUNCTION} exists failed with the following output:\n" + "${OUTPUT}\n\n") + endif (${VARIABLE}) + endif (NOT DEFINED ${VARIABLE}) +ENDMACRO (CHECK_FORTRAN_FEATURE) + +#----------------------------------------------------------------------------- +# Configure Checks which require Fortran compilation must go in here +# not in the main ConfigureChecks.cmake files, because if the user has +# no Fortran compiler, problems arise. +# +# Be careful with leading spaces here, do not remove them. +#----------------------------------------------------------------------------- + +# Check for Non-standard extension intrinsic function SIZEOF +CHECK_FORTRAN_FEATURE(sizeof + " + PROGRAM main + i = sizeof(x) + END PROGRAM + " + FORTRAN_HAVE_SIZEOF +) + +# Check for F2008 standard intrinsic function C_SIZEOF +CHECK_FORTRAN_FEATURE(c_sizeof + " + PROGRAM main + USE ISO_C_BINDING + INTEGER(C_INT) :: a + INTEGER(C_SIZE_T) :: result + result = c_sizeof(a) + END PROGRAM + " + FORTRAN_HAVE_C_SIZEOF +) + +# Check for F2008 standard intrinsic function STORAGE_SIZE +CHECK_FORTRAN_FEATURE(storage_size + " + PROGRAM main + INTEGER :: a + INTEGER :: result + result = storage_size(a) + END PROGRAM + " + FORTRAN_HAVE_STORAGE_SIZE +) + +# Check for F2008 standard intrinsic module "ISO_FORTRAN_ENV" +CHECK_FORTRAN_FEATURE(ISO_FORTRAN_ENV + " + PROGRAM main + USE, INTRINSIC :: ISO_FORTRAN_ENV + END PROGRAM + " + HAVE_ISO_FORTRAN_ENV +) + +CHECK_FORTRAN_FEATURE(RealIsNotDouble + " + MODULE type_mod + INTERFACE h5t + MODULE PROCEDURE h5t_real + MODULE PROCEDURE h5t_dble + END INTERFACE + CONTAINS + SUBROUTINE h5t_real(r) + REAL :: r + END SUBROUTINE h5t_real + SUBROUTINE h5t_dble(d) + DOUBLE PRECISION :: d + END SUBROUTINE h5t_dble + END MODULE type_mod + PROGRAM main + USE type_mod + REAL :: r + DOUBLE PRECISION :: d + CALL h5t(r) + CALL h5t(d) + END PROGRAM main + " + FORTRAN_DEFAULT_REAL_NOT_DOUBLE +) + +#----------------------------------------------------------------------------- +# Checks if the ISO_C_BINDING module meets all the requirements +#----------------------------------------------------------------------------- +CHECK_FORTRAN_FEATURE(iso_c_binding + " + PROGRAM main + USE iso_c_binding + IMPLICIT NONE + TYPE(C_PTR) :: ptr + TYPE(C_FUNPTR) :: funptr + INTEGER(C_INT64_T) :: c_int64_type + CHARACTER(LEN=80, KIND=c_char), TARGET :: ichr + ptr = C_LOC(ichr(1:1)) + END PROGRAM + " + FORTRAN_HAVE_ISO_C_BINDING +) + +#----------------------------------------------------------------------------- +# Add debug information (intel Fortran : JB) +#----------------------------------------------------------------------------- +if (CMAKE_Fortran_COMPILER MATCHES ifort) + if (WIN32) + set (CMAKE_Fortran_FLAGS_DEBUG "/debug:full /dbglibs " CACHE "flags" STRING FORCE) + set (CMAKE_EXE_LINKER_FLAGS_DEBUG "/DEBUG" CACHE "flags" STRING FORCE) + endif (WIN32) +endif (CMAKE_Fortran_COMPILER MATCHES ifort) diff --git a/config/cmake_ext_mod/NSIS.InstallOptions.ini.in b/config/cmake_ext_mod/NSIS.InstallOptions.ini.in new file mode 100644 index 0000000..9954f28 --- /dev/null +++ b/config/cmake_ext_mod/NSIS.InstallOptions.ini.in @@ -0,0 +1,37 @@ +[Settings] +NumFields=5 + +[Field 1] +Type=label +Text=By default the @CPACK_PACKAGE_NAME@ bin directory is added to the system PATH. This allows shared library (dll) discovery (if installed) and running HDF5 tools from the command line. +Left=0 +Right=-1 +Top=0 +Bottom=20 + +[Field 2] +Type=radiobutton +Text=Do not add @CPACK_PACKAGE_NAME@ to the system PATH +Left=0 +Right=-1 +Top=30 +Bottom=40 +State=0 + +[Field 3] +Type=radiobutton +Text=Add @CPACK_PACKAGE_NAME@ to the system PATH for all users +Left=0 +Right=-1 +Top=40 +Bottom=50 +State=1 + +[Field 4] +Type=radiobutton +Text=Add @CPACK_PACKAGE_NAME@ to the system PATH for current user +Left=0 +Right=-1 +Top=50 +Bottom=60 +State=0 diff --git a/config/cmake_ext_mod/NSIS.template.in b/config/cmake_ext_mod/NSIS.template.in new file mode 100644 index 0000000..ecced05 --- /dev/null +++ b/config/cmake_ext_mod/NSIS.template.in @@ -0,0 +1,974 @@ +; CPack install script designed for a nmake build + +;-------------------------------- +; You must define these values + + !define VERSION "@CPACK_PACKAGE_VERSION@" + !define PATCH "@CPACK_PACKAGE_VERSION_PATCH@" + !define INST_DIR "@CPACK_TEMPORARY_DIRECTORY@" + +;-------------------------------- +;Variables + + Var MUI_TEMP + Var STARTMENU_FOLDER + Var SV_ALLUSERS + Var START_MENU + Var DO_NOT_ADD_TO_PATH + Var ADD_TO_PATH_ALL_USERS + Var ADD_TO_PATH_CURRENT_USER + Var INSTALL_DESKTOP + Var IS_DEFAULT_INSTALLDIR +;-------------------------------- +;Include Modern UI + + !include "MUI.nsh" + + ;Default installation folder + InstallDir "@CPACK_NSIS_INSTALL_ROOT@\@CPACK_PACKAGE_INSTALL_DIRECTORY@" + +;-------------------------------- +;General + + ;Name and file + Name "@CPACK_NSIS_PACKAGE_NAME@" + OutFile "@CPACK_TOPLEVEL_DIRECTORY@/@CPACK_OUTPUT_FILE_NAME@" + + ;Set compression + SetCompressor @CPACK_NSIS_COMPRESSOR@ + +@CPACK_NSIS_DEFINES@ + + !include Sections.nsh + +;--- Component support macros: --- +; The code for the add/remove functionality is from: +; http://nsis.sourceforge.net/Add/Remove_Functionality +; It has been modified slightly and extended to provide +; inter-component dependencies. +Var AR_SecFlags +Var AR_RegFlags +@CPACK_NSIS_SECTION_SELECTED_VARS@ + +; Loads the "selected" flag for the section named SecName into the +; variable VarName. +!macro LoadSectionSelectedIntoVar SecName VarName + SectionGetFlags ${${SecName}} $${VarName} + IntOp $${VarName} $${VarName} & ${SF_SELECTED} ;Turn off all other bits +!macroend + +; Loads the value of a variable... can we get around this? +!macro LoadVar VarName + IntOp $R0 0 + $${VarName} +!macroend + +; Sets the value of a variable +!macro StoreVar VarName IntValue + IntOp $${VarName} 0 + ${IntValue} +!macroend + +!macro InitSection SecName + ; This macro reads component installed flag from the registry and + ;changes checked state of the section on the components page. + ;Input: section index constant name specified in Section command. + + ClearErrors + ;Reading component status from registry + ReadRegDWORD $AR_RegFlags HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_INSTALL_REGISTRY_KEY@\Components\${SecName}" "Installed" + IfErrors "default_${SecName}" + ;Status will stay default if registry value not found + ;(component was never installed) + IntOp $AR_RegFlags $AR_RegFlags & ${SF_SELECTED} ;Turn off all other bits + SectionGetFlags ${${SecName}} $AR_SecFlags ;Reading default section flags + IntOp $AR_SecFlags $AR_SecFlags & 0xFFFE ;Turn lowest (enabled) bit off + IntOp $AR_SecFlags $AR_RegFlags | $AR_SecFlags ;Change lowest bit + + ; Note whether this component was installed before + !insertmacro StoreVar ${SecName}_was_installed $AR_RegFlags + IntOp $R0 $AR_RegFlags & $AR_RegFlags + + ;Writing modified flags + SectionSetFlags ${${SecName}} $AR_SecFlags + + "default_${SecName}:" + !insertmacro LoadSectionSelectedIntoVar ${SecName} ${SecName}_selected +!macroend + +!macro FinishSection SecName + ; This macro reads section flag set by user and removes the section + ;if it is not selected. + ;Then it writes component installed flag to registry + ;Input: section index constant name specified in Section command. + + SectionGetFlags ${${SecName}} $AR_SecFlags ;Reading section flags + ;Checking lowest bit: + IntOp $AR_SecFlags $AR_SecFlags & ${SF_SELECTED} + IntCmp $AR_SecFlags 1 "leave_${SecName}" + ;Section is not selected: + ;Calling Section uninstall macro and writing zero installed flag + !insertmacro "Remove_${${SecName}}" + WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_INSTALL_REGISTRY_KEY@\Components\${SecName}" \ + "Installed" 0 + Goto "exit_${SecName}" + + "leave_${SecName}:" + ;Section is selected: + WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_INSTALL_REGISTRY_KEY@\Components\${SecName}" \ + "Installed" 1 + + "exit_${SecName}:" +!macroend + +!macro RemoveSection_CPack SecName + ; This macro is used to call section's Remove_... macro + ;from the uninstaller. + ;Input: section index constant name specified in Section command. + + !insertmacro "Remove_${${SecName}}" +!macroend + +; Determine whether the selection of SecName changed +!macro MaybeSelectionChanged SecName + !insertmacro LoadVar ${SecName}_selected + SectionGetFlags ${${SecName}} $R1 + IntOp $R1 $R1 & ${SF_SELECTED} ;Turn off all other bits + + ; See if the status has changed: + IntCmp $R0 $R1 "${SecName}_unchanged" + !insertmacro LoadSectionSelectedIntoVar ${SecName} ${SecName}_selected + + IntCmp $R1 ${SF_SELECTED} "${SecName}_was_selected" + !insertmacro "Deselect_required_by_${SecName}" + goto "${SecName}_unchanged" + + "${SecName}_was_selected:" + !insertmacro "Select_${SecName}_depends" + + "${SecName}_unchanged:" +!macroend +;--- End of Add/Remove macros --- + +;-------------------------------- +;Interface Settings + + !define MUI_HEADERIMAGE + !define MUI_ABORTWARNING + +;-------------------------------- +; path functions + +!verbose 3 +!include "WinMessages.NSH" +!verbose 4 + +;---------------------------------------- +; based upon a script of "Written by KiCHiK 2003-01-18 05:57:02" +;---------------------------------------- +!verbose 3 +!include "WinMessages.NSH" +!verbose 4 +;==================================================== +; get_NT_environment +; Returns: the selected environment +; Output : head of the stack +;==================================================== +!macro select_NT_profile UN +Function ${UN}select_NT_profile + StrCmp $ADD_TO_PATH_ALL_USERS "1" 0 environment_single + DetailPrint "Selected environment for all users" + Push "all" + Return + environment_single: + DetailPrint "Selected environment for current user only." + Push "current" + Return +FunctionEnd +!macroend +!insertmacro select_NT_profile "" +!insertmacro select_NT_profile "un." +;---------------------------------------------------- +!define NT_current_env 'HKCU "Environment"' +!define NT_all_env 'HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"' + +!ifndef WriteEnvStr_RegKey + !ifdef ALL_USERS + !define WriteEnvStr_RegKey \ + 'HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"' + !else + !define WriteEnvStr_RegKey 'HKCU "Environment"' + !endif +!endif + +; AddToPath - Adds the given dir to the search path. +; Input - head of the stack +; Note - Win9x systems requires reboot + +Function AddToPath + Exch $0 + Push $1 + Push $2 + Push $3 + + # don't add if the path doesn't exist + IfFileExists "$0\*.*" "" AddToPath_done + + ReadEnvStr $1 PATH + ; if the path is too long for a NSIS variable NSIS will return a 0 + ; length string. If we find that, then warn and skip any path + ; modification as it will trash the existing path. + StrLen $2 $1 + IntCmp $2 0 CheckPathLength_ShowPathWarning CheckPathLength_Done CheckPathLength_Done + CheckPathLength_ShowPathWarning: + Messagebox MB_OK|MB_ICONEXCLAMATION "Warning! PATH too long installer unable to modify PATH!" + Goto AddToPath_done + CheckPathLength_Done: + Push "$1;" + Push "$0;" + Call StrStr + Pop $2 + StrCmp $2 "" "" AddToPath_done + Push "$1;" + Push "$0\;" + Call StrStr + Pop $2 + StrCmp $2 "" "" AddToPath_done + GetFullPathName /SHORT $3 $0 + Push "$1;" + Push "$3;" + Call StrStr + Pop $2 + StrCmp $2 "" "" AddToPath_done + Push "$1;" + Push "$3\;" + Call StrStr + Pop $2 + StrCmp $2 "" "" AddToPath_done + + Call IsNT + Pop $1 + StrCmp $1 1 AddToPath_NT + ; Not on NT + StrCpy $1 $WINDIR 2 + FileOpen $1 "$1\autoexec.bat" a + FileSeek $1 -1 END + FileReadByte $1 $2 + IntCmp $2 26 0 +2 +2 # DOS EOF + FileSeek $1 -1 END # write over EOF + FileWrite $1 "$\r$\nSET PATH=%PATH%;$3$\r$\n" + FileClose $1 + SetRebootFlag true + Goto AddToPath_done + + AddToPath_NT: + StrCmp $ADD_TO_PATH_ALL_USERS "1" ReadAllKey + ReadRegStr $1 ${NT_current_env} "PATH" + Goto DoTrim + ReadAllKey: + ReadRegStr $1 ${NT_all_env} "PATH" + DoTrim: + StrCmp $1 "" AddToPath_NTdoIt + Push $1 + Call Trim + Pop $1 + StrCpy $0 "$1;$0" + AddToPath_NTdoIt: + StrCmp $ADD_TO_PATH_ALL_USERS "1" WriteAllKey + WriteRegExpandStr ${NT_current_env} "PATH" $0 + Goto DoSend + WriteAllKey: + WriteRegExpandStr ${NT_all_env} "PATH" $0 + DoSend: + SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000 + + AddToPath_done: + Pop $3 + Pop $2 + Pop $1 + Pop $0 +FunctionEnd + + +; RemoveFromPath - Remove a given dir from the path +; Input: head of the stack + +Function un.RemoveFromPath + Exch $0 + Push $1 + Push $2 + Push $3 + Push $4 + Push $5 + Push $6 + + IntFmt $6 "%c" 26 # DOS EOF + + Call un.IsNT + Pop $1 + StrCmp $1 1 unRemoveFromPath_NT + ; Not on NT + StrCpy $1 $WINDIR 2 + FileOpen $1 "$1\autoexec.bat" r + GetTempFileName $4 + FileOpen $2 $4 w + GetFullPathName /SHORT $0 $0 + StrCpy $0 "SET PATH=%PATH%;$0" + Goto unRemoveFromPath_dosLoop + + unRemoveFromPath_dosLoop: + FileRead $1 $3 + StrCpy $5 $3 1 -1 # read last char + StrCmp $5 $6 0 +2 # if DOS EOF + StrCpy $3 $3 -1 # remove DOS EOF so we can compare + StrCmp $3 "$0$\r$\n" unRemoveFromPath_dosLoopRemoveLine + StrCmp $3 "$0$\n" unRemoveFromPath_dosLoopRemoveLine + StrCmp $3 "$0" unRemoveFromPath_dosLoopRemoveLine + StrCmp $3 "" unRemoveFromPath_dosLoopEnd + FileWrite $2 $3 + Goto unRemoveFromPath_dosLoop + unRemoveFromPath_dosLoopRemoveLine: + SetRebootFlag true + Goto unRemoveFromPath_dosLoop + + unRemoveFromPath_dosLoopEnd: + FileClose $2 + FileClose $1 + StrCpy $1 $WINDIR 2 + Delete "$1\autoexec.bat" + CopyFiles /SILENT $4 "$1\autoexec.bat" + Delete $4 + Goto unRemoveFromPath_done + + unRemoveFromPath_NT: + StrCmp $ADD_TO_PATH_ALL_USERS "1" unReadAllKey + ReadRegStr $1 ${NT_current_env} "PATH" + Goto unDoTrim + unReadAllKey: + ReadRegStr $1 ${NT_all_env} "PATH" + unDoTrim: + StrCpy $5 $1 1 -1 # copy last char + StrCmp $5 ";" +2 # if last char != ; + StrCpy $1 "$1;" # append ; + Push $1 + Push "$0;" + Call un.StrStr ; Find `$0;` in $1 + Pop $2 ; pos of our dir + StrCmp $2 "" unRemoveFromPath_done + ; else, it is in path + # $0 - path to add + # $1 - path var + StrLen $3 "$0;" + StrLen $4 $2 + StrCpy $5 $1 -$4 # $5 is now the part before the path to remove + StrCpy $6 $2 "" $3 # $6 is now the part after the path to remove + StrCpy $3 $5$6 + + StrCpy $5 $3 1 -1 # copy last char + StrCmp $5 ";" 0 +2 # if last char == ; + StrCpy $3 $3 -1 # remove last char + + StrCmp $ADD_TO_PATH_ALL_USERS "1" unWriteAllKey + WriteRegExpandStr ${NT_current_env} "PATH" $3 + Goto unDoSend + unWriteAllKey: + WriteRegExpandStr ${NT_all_env} "PATH" $3 + unDoSend: + SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000 + + unRemoveFromPath_done: + Pop $6 + Pop $5 + Pop $4 + Pop $3 + Pop $2 + Pop $1 + Pop $0 +FunctionEnd + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; Uninstall sutff +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +########################################### +# Utility Functions # +########################################### + +;==================================================== +; IsNT - Returns 1 if the current system is NT, 0 +; otherwise. +; Output: head of the stack +;==================================================== +; IsNT +; no input +; output, top of the stack = 1 if NT or 0 if not +; +; Usage: +; Call IsNT +; Pop $R0 +; ($R0 at this point is 1 or 0) + +!macro IsNT un +Function ${un}IsNT + Push $0 + ReadRegStr $0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion + StrCmp $0 "" 0 IsNT_yes + ; we are not NT. + Pop $0 + Push 0 + Return + + IsNT_yes: + ; NT!!! + Pop $0 + Push 1 +FunctionEnd +!macroend +!insertmacro IsNT "" +!insertmacro IsNT "un." + +; StrStr +; input, top of stack = string to search for +; top of stack-1 = string to search in +; output, top of stack (replaces with the portion of the string remaining) +; modifies no other variables. +; +; Usage: +; Push "this is a long ass string" +; Push "ass" +; Call StrStr +; Pop $R0 +; ($R0 at this point is "ass string") + +!macro StrStr un +Function ${un}StrStr +Exch $R1 ; st=haystack,old$R1, $R1=needle + Exch ; st=old$R1,haystack + Exch $R2 ; st=old$R1,old$R2, $R2=haystack + Push $R3 + Push $R4 + Push $R5 + StrLen $R3 $R1 + StrCpy $R4 0 + ; $R1=needle + ; $R2=haystack + ; $R3=len(needle) + ; $R4=cnt + ; $R5=tmp + loop: + StrCpy $R5 $R2 $R3 $R4 + StrCmp $R5 $R1 done + StrCmp $R5 "" done + IntOp $R4 $R4 + 1 + Goto loop +done: + StrCpy $R1 $R2 "" $R4 + Pop $R5 + Pop $R4 + Pop $R3 + Pop $R2 + Exch $R1 +FunctionEnd +!macroend +!insertmacro StrStr "" +!insertmacro StrStr "un." + +Function Trim ; Added by Pelaca + Exch $R1 + Push $R2 +Loop: + StrCpy $R2 "$R1" 1 -1 + StrCmp "$R2" " " RTrim + StrCmp "$R2" "$\n" RTrim + StrCmp "$R2" "$\r" RTrim + StrCmp "$R2" ";" RTrim + GoTo Done +RTrim: + StrCpy $R1 "$R1" -1 + Goto Loop +Done: + Pop $R2 + Exch $R1 +FunctionEnd + +Function ConditionalAddToRegisty + Pop $0 + Pop $1 + StrCmp "$0" "" ConditionalAddToRegisty_EmptyString + WriteRegStr SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_INSTALL_REGISTRY_KEY@" \ + "$1" "$0" + ;MessageBox MB_OK "Set Registry: '$1' to '$0'" + DetailPrint "Set install registry entry: '$1' to '$0'" + ConditionalAddToRegisty_EmptyString: +FunctionEnd + +;-------------------------------- + +!ifdef CPACK_USES_DOWNLOAD +Function DownloadFile + IfFileExists $INSTDIR\* +2 + CreateDirectory $INSTDIR + Pop $0 + + ; Skip if already downloaded + IfFileExists $INSTDIR\$0 0 +2 + Return + + StrCpy $1 "@CPACK_DOWNLOAD_SITE@" + + try_again: + NSISdl::download "$1/$0" "$INSTDIR\$0" + + Pop $1 + StrCmp $1 "success" success + StrCmp $1 "Cancelled" cancel + MessageBox MB_OK "Download failed: $1" + cancel: + Return + success: +FunctionEnd +!endif + +;-------------------------------- +; Installation types +@CPACK_NSIS_INSTALLATION_TYPES@ + +;-------------------------------- +; Component sections +@CPACK_NSIS_COMPONENT_SECTIONS@ + +;-------------------------------- +; Define some macro setting for the gui +@CPACK_NSIS_INSTALLER_MUI_ICON_CODE@ +@CPACK_NSIS_INSTALLER_ICON_CODE@ +@CPACK_NSIS_INSTALLER_MUI_COMPONENTS_DESC@ +@CPACK_NSIS_INSTALLER_MUI_FINISHPAGE_RUN_CODE@ + +;-------------------------------- +;Pages + !insertmacro MUI_PAGE_WELCOME + + !insertmacro MUI_PAGE_LICENSE "@CPACK_RESOURCE_FILE_LICENSE@" + Page custom InstallOptionsPage + !insertmacro MUI_PAGE_DIRECTORY + + ;Start Menu Folder Page Configuration + !define MUI_STARTMENUPAGE_REGISTRY_ROOT "SHCTX" + !define MUI_STARTMENUPAGE_REGISTRY_KEY "Software\@CPACK_PACKAGE_VENDOR@\@CPACK_PACKAGE_INSTALL_REGISTRY_KEY@" + !define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "Start Menu Folder" + !insertmacro MUI_PAGE_STARTMENU Application $STARTMENU_FOLDER + + @CPACK_NSIS_PAGE_COMPONENTS@ + + !insertmacro MUI_PAGE_INSTFILES + !insertmacro MUI_PAGE_FINISH + + !insertmacro MUI_UNPAGE_CONFIRM + !insertmacro MUI_UNPAGE_INSTFILES + +;-------------------------------- +;Languages + + !insertmacro MUI_LANGUAGE "English" ;first language is the default language + !insertmacro MUI_LANGUAGE "Albanian" + !insertmacro MUI_LANGUAGE "Arabic" + !insertmacro MUI_LANGUAGE "Basque" + !insertmacro MUI_LANGUAGE "Belarusian" + !insertmacro MUI_LANGUAGE "Bosnian" + !insertmacro MUI_LANGUAGE "Breton" + !insertmacro MUI_LANGUAGE "Bulgarian" + !insertmacro MUI_LANGUAGE "Croatian" + !insertmacro MUI_LANGUAGE "Czech" + !insertmacro MUI_LANGUAGE "Danish" + !insertmacro MUI_LANGUAGE "Dutch" + !insertmacro MUI_LANGUAGE "Estonian" + !insertmacro MUI_LANGUAGE "Farsi" + !insertmacro MUI_LANGUAGE "Finnish" + !insertmacro MUI_LANGUAGE "French" + !insertmacro MUI_LANGUAGE "German" + !insertmacro MUI_LANGUAGE "Greek" + !insertmacro MUI_LANGUAGE "Hebrew" + !insertmacro MUI_LANGUAGE "Hungarian" + !insertmacro MUI_LANGUAGE "Icelandic" + !insertmacro MUI_LANGUAGE "Indonesian" + !insertmacro MUI_LANGUAGE "Irish" + !insertmacro MUI_LANGUAGE "Italian" + !insertmacro MUI_LANGUAGE "Japanese" + !insertmacro MUI_LANGUAGE "Korean" + !insertmacro MUI_LANGUAGE "Kurdish" + !insertmacro MUI_LANGUAGE "Latvian" + !insertmacro MUI_LANGUAGE "Lithuanian" + !insertmacro MUI_LANGUAGE "Luxembourgish" + !insertmacro MUI_LANGUAGE "Macedonian" + !insertmacro MUI_LANGUAGE "Malay" + !insertmacro MUI_LANGUAGE "Mongolian" + !insertmacro MUI_LANGUAGE "Norwegian" + !insertmacro MUI_LANGUAGE "Polish" + !insertmacro MUI_LANGUAGE "Portuguese" + !insertmacro MUI_LANGUAGE "PortugueseBR" + !insertmacro MUI_LANGUAGE "Romanian" + !insertmacro MUI_LANGUAGE "Russian" + !insertmacro MUI_LANGUAGE "Serbian" + !insertmacro MUI_LANGUAGE "SerbianLatin" + !insertmacro MUI_LANGUAGE "SimpChinese" + !insertmacro MUI_LANGUAGE "Slovak" + !insertmacro MUI_LANGUAGE "Slovenian" + !insertmacro MUI_LANGUAGE "Spanish" + !insertmacro MUI_LANGUAGE "Swedish" + !insertmacro MUI_LANGUAGE "Thai" + !insertmacro MUI_LANGUAGE "TradChinese" + !insertmacro MUI_LANGUAGE "Turkish" + !insertmacro MUI_LANGUAGE "Ukrainian" + !insertmacro MUI_LANGUAGE "Welsh" + + +;-------------------------------- +;Reserve Files + + ;These files should be inserted before other files in the data block + ;Keep these lines before any File command + ;Only for solid compression (by default, solid compression is enabled for BZIP2 and LZMA) + + ReserveFile "NSIS.InstallOptions.ini" + !insertmacro MUI_RESERVEFILE_INSTALLOPTIONS + +;-------------------------------- +;Installer Sections + +Section "-Core installation" + ;Use the entire tree produced by the INSTALL target. Keep the + ;list of directories here in sync with the RMDir commands below. + SetOutPath "$INSTDIR" + @CPACK_NSIS_EXTRA_PREINSTALL_COMMANDS@ + @CPACK_NSIS_FULL_INSTALL@ + + ;Store installation folder + WriteRegStr SHCTX "Software\@CPACK_PACKAGE_VENDOR@\@CPACK_PACKAGE_INSTALL_REGISTRY_KEY@" "" $INSTDIR + + ;Create uninstaller + WriteUninstaller "$INSTDIR\Uninstall.exe" + Push "DisplayName" + Push "@CPACK_NSIS_DISPLAY_NAME@" + Call ConditionalAddToRegisty + Push "DisplayVersion" + Push "@CPACK_PACKAGE_VERSION@" + Call ConditionalAddToRegisty + Push "Publisher" + Push "@CPACK_PACKAGE_VENDOR@" + Call ConditionalAddToRegisty + Push "UninstallString" + Push "$INSTDIR\Uninstall.exe" + Call ConditionalAddToRegisty + Push "NoRepair" + Push "1" + Call ConditionalAddToRegisty + + !ifdef CPACK_NSIS_ADD_REMOVE + ;Create add/remove functionality + Push "ModifyPath" + Push "$INSTDIR\AddRemove.exe" + Call ConditionalAddToRegisty + !else + Push "NoModify" + Push "1" + Call ConditionalAddToRegisty + !endif + + ; Optional registration + Push "DisplayIcon" + Push "$INSTDIR\@CPACK_NSIS_INSTALLED_ICON_NAME@" + Call ConditionalAddToRegisty + Push "HelpLink" + Push "@CPACK_NSIS_HELP_LINK@" + Call ConditionalAddToRegisty + Push "URLInfoAbout" + Push "@CPACK_NSIS_URL_INFO_ABOUT@" + Call ConditionalAddToRegisty + Push "Contact" + Push "@CPACK_NSIS_CONTACT@" + Call ConditionalAddToRegisty + !insertmacro MUI_INSTALLOPTIONS_READ $INSTALL_DESKTOP "NSIS.InstallOptions.ini" "Field 5" "State" + !insertmacro MUI_STARTMENU_WRITE_BEGIN Application + + ;Create shortcuts + CreateDirectory "$SMPROGRAMS\$STARTMENU_FOLDER" +@CPACK_NSIS_CREATE_ICONS@ +@CPACK_NSIS_CREATE_ICONS_EXTRA@ + CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Uninstall.lnk" "$INSTDIR\Uninstall.exe" + + ;Read a value from an InstallOptions INI file + !insertmacro MUI_INSTALLOPTIONS_READ $DO_NOT_ADD_TO_PATH "NSIS.InstallOptions.ini" "Field 2" "State" + !insertmacro MUI_INSTALLOPTIONS_READ $ADD_TO_PATH_ALL_USERS "NSIS.InstallOptions.ini" "Field 3" "State" + !insertmacro MUI_INSTALLOPTIONS_READ $ADD_TO_PATH_CURRENT_USER "NSIS.InstallOptions.ini" "Field 4" "State" + + ; Write special uninstall registry entries + Push "StartMenu" + Push "$STARTMENU_FOLDER" + Call ConditionalAddToRegisty + Push "DoNotAddToPath" + Push "$DO_NOT_ADD_TO_PATH" + Call ConditionalAddToRegisty + Push "AddToPathAllUsers" + Push "$ADD_TO_PATH_ALL_USERS" + Call ConditionalAddToRegisty + Push "AddToPathCurrentUser" + Push "$ADD_TO_PATH_CURRENT_USER" + Call ConditionalAddToRegisty + Push "InstallToDesktop" + Push "$INSTALL_DESKTOP" + Call ConditionalAddToRegisty + + !insertmacro MUI_STARTMENU_WRITE_END + +@CPACK_NSIS_EXTRA_INSTALL_COMMANDS@ + +SectionEnd + +Section "-Add to path" + Push $INSTDIR\bin + StrCmp "@CPACK_NSIS_MODIFY_PATH@" "ON" 0 doNotAddToPath + StrCmp $DO_NOT_ADD_TO_PATH "1" doNotAddToPath 0 + Call AddToPath + doNotAddToPath: +SectionEnd + +;-------------------------------- +; Create custom pages +Function InstallOptionsPage + !insertmacro MUI_HEADER_TEXT "Install Options" "Choose options for installing @CPACK_NSIS_PACKAGE_NAME@" + !insertmacro MUI_INSTALLOPTIONS_DISPLAY "NSIS.InstallOptions.ini" + +FunctionEnd + +;-------------------------------- +; determine admin versus local install +Function un.onInit + + ClearErrors + UserInfo::GetName + IfErrors noLM + Pop $0 + UserInfo::GetAccountType + Pop $1 + StrCmp $1 "Admin" 0 +3 + SetShellVarContext all + ;MessageBox MB_OK 'User "$0" is in the Admin group' + Goto done + StrCmp $1 "Power" 0 +3 + SetShellVarContext all + ;MessageBox MB_OK 'User "$0" is in the Power Users group' + Goto done + + noLM: + ;Get installation folder from registry if available + + done: + +FunctionEnd + +;--- Add/Remove callback functions: --- +!macro SectionList MacroName + ;This macro used to perform operation on multiple sections. + ;List all of your components in following manner here. +@CPACK_NSIS_COMPONENT_SECTION_LIST@ +!macroend + +Section -FinishComponents + ;Removes unselected components and writes component status to registry + !insertmacro SectionList "FinishSection" + +!ifdef CPACK_NSIS_ADD_REMOVE + ; Get the name of the installer executable + System::Call 'kernel32::GetModuleFileNameA(i 0, t .R0, i 1024) i r1' + StrCpy $R3 $R0 + + ; Strip off the last 13 characters, to see if we have AddRemove.exe + StrLen $R1 $R0 + IntOp $R1 $R0 - 13 + StrCpy $R2 $R0 13 $R1 + StrCmp $R2 "AddRemove.exe" addremove_installed + + ; We're not running AddRemove.exe, so install it + CopyFiles $R3 $INSTDIR\AddRemove.exe + + addremove_installed: +!endif +SectionEnd +;--- End of Add/Remove callback functions --- + +;-------------------------------- +; Component dependencies +Function .onSelChange + !insertmacro SectionList MaybeSelectionChanged +FunctionEnd + +;-------------------------------- +;Uninstaller Section + +Section "Uninstall" + ReadRegStr $START_MENU SHCTX \ + "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_INSTALL_REGISTRY_KEY@" "StartMenu" + ;MessageBox MB_OK "Start menu is in: $START_MENU" + ReadRegStr $DO_NOT_ADD_TO_PATH SHCTX \ + "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_INSTALL_REGISTRY_KEY@" "DoNotAddToPath" + ReadRegStr $ADD_TO_PATH_ALL_USERS SHCTX \ + "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_INSTALL_REGISTRY_KEY@" "AddToPathAllUsers" + ReadRegStr $ADD_TO_PATH_CURRENT_USER SHCTX \ + "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_INSTALL_REGISTRY_KEY@" "AddToPathCurrentUser" + ;MessageBox MB_OK "Add to path: $DO_NOT_ADD_TO_PATH all users: $ADD_TO_PATH_ALL_USERS" + ReadRegStr $INSTALL_DESKTOP SHCTX \ + "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_INSTALL_REGISTRY_KEY@" "InstallToDesktop" + ;MessageBox MB_OK "Install to desktop: $INSTALL_DESKTOP " + +@CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS@ + + ;Remove files we installed. + ;Keep the list of directories here in sync with the File commands above. +@CPACK_NSIS_DELETE_FILES@ +@CPACK_NSIS_DELETE_DIRECTORIES@ + +!ifdef CPACK_NSIS_ADD_REMOVE + ;Remove the add/remove program + Delete "$INSTDIR\AddRemove.exe" +!endif + + ;Remove the uninstaller itself. + Delete "$INSTDIR\Uninstall.exe" + DeleteRegKey SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_INSTALL_REGISTRY_KEY@" + + ;Remove the installation directory if it is empty. + RMDir "$INSTDIR" + + ; Remove the registry entries. + DeleteRegKey SHCTX "Software\@CPACK_PACKAGE_VENDOR@\@CPACK_PACKAGE_INSTALL_REGISTRY_KEY@" + + ; Removes all optional components + !insertmacro SectionList "RemoveSection_CPack" + + !insertmacro MUI_STARTMENU_GETFOLDER Application $MUI_TEMP + + Delete "$SMPROGRAMS\$MUI_TEMP\Uninstall.lnk" +@CPACK_NSIS_DELETE_ICONS@ +@CPACK_NSIS_DELETE_ICONS_EXTRA@ + + ;Delete empty start menu parent diretories + StrCpy $MUI_TEMP "$SMPROGRAMS\$MUI_TEMP" + + startMenuDeleteLoop: + ClearErrors + RMDir $MUI_TEMP + GetFullPathName $MUI_TEMP "$MUI_TEMP\.." + + IfErrors startMenuDeleteLoopDone + + StrCmp "$MUI_TEMP" "$SMPROGRAMS" startMenuDeleteLoopDone startMenuDeleteLoop + startMenuDeleteLoopDone: + + ; If the user changed the shortcut, then untinstall may not work. This should + ; try to fix it. + StrCpy $MUI_TEMP "$START_MENU" + Delete "$SMPROGRAMS\$MUI_TEMP\Uninstall.lnk" +@CPACK_NSIS_DELETE_ICONS_EXTRA@ + + ;Delete empty start menu parent diretories + StrCpy $MUI_TEMP "$SMPROGRAMS\$MUI_TEMP" + + secondStartMenuDeleteLoop: + ClearErrors + RMDir $MUI_TEMP + GetFullPathName $MUI_TEMP "$MUI_TEMP\.." + + IfErrors secondStartMenuDeleteLoopDone + + StrCmp "$MUI_TEMP" "$SMPROGRAMS" secondStartMenuDeleteLoopDone secondStartMenuDeleteLoop + secondStartMenuDeleteLoopDone: + + DeleteRegKey /ifempty SHCTX "Software\@CPACK_PACKAGE_VENDOR@\@CPACK_PACKAGE_INSTALL_REGISTRY_KEY@" + + Push $INSTDIR\bin + StrCmp $DO_NOT_ADD_TO_PATH_ "1" doNotRemoveFromPath 0 + Call un.RemoveFromPath + doNotRemoveFromPath: +SectionEnd + +;-------------------------------- +; determine admin versus local install +; Is install for "AllUsers" or "JustMe"? +; Default to "JustMe" - set to "AllUsers" if admin or on Win9x +; This function is used for the very first "custom page" of the installer. +; This custom page does not show up visibly, but it executes prior to the +; first visible page and sets up $INSTDIR properly... +; Choose different default installation folder based on SV_ALLUSERS... +; "Program Files" for AllUsers, "My Documents" for JustMe... + +Function .onInit + StrCmp "@CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL@" "ON" 0 inst + + ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_INSTALL_REGISTRY_KEY@" "UninstallString" + StrCmp $0 "" inst + + MessageBox MB_YESNOCANCEL|MB_ICONEXCLAMATION \ + "@CPACK_NSIS_PACKAGE_NAME@ is already installed. $\n$\nDo you want to uninstall the old version before installing the new one?" \ + IDYES uninst IDNO inst + Abort + +;Run the uninstaller +uninst: + ClearErrors + StrLen $2 "\Uninstall.exe" + StrCpy $3 $0 -$2 # remove "\Uninstall.exe" from UninstallString to get path + ExecWait '$0 _?=$3' ;Do not copy the uninstaller to a temp file + + IfErrors uninst_failed inst +uninst_failed: + MessageBox MB_OK|MB_ICONSTOP "Uninstall failed." + Abort + + +inst: + ; Reads components status for registry + !insertmacro SectionList "InitSection" + + ; check to see if /D has been used to change + ; the install directory by comparing it to the + ; install directory that is expected to be the + ; default + StrCpy $IS_DEFAULT_INSTALLDIR 0 + StrCmp "$INSTDIR" "@CPACK_NSIS_INSTALL_ROOT@\@CPACK_PACKAGE_INSTALL_DIRECTORY@" 0 +2 + StrCpy $IS_DEFAULT_INSTALLDIR 1 + + StrCpy $SV_ALLUSERS "JustMe" + ; if default install dir then change the default + ; if it is installed for JustMe + StrCmp "$IS_DEFAULT_INSTALLDIR" "1" 0 +2 + StrCpy $INSTDIR "$DOCUMENTS\@CPACK_PACKAGE_INSTALL_DIRECTORY@" + + ClearErrors + UserInfo::GetName + IfErrors noLM + Pop $0 + UserInfo::GetAccountType + Pop $1 + StrCmp $1 "Admin" 0 +4 + SetShellVarContext all + ;MessageBox MB_OK 'User "$0" is in the Admin group' + StrCpy $SV_ALLUSERS "AllUsers" + Goto done + StrCmp $1 "Power" 0 +4 + SetShellVarContext all + ;MessageBox MB_OK 'User "$0" is in the Power Users group' + StrCpy $SV_ALLUSERS "AllUsers" + Goto done + + noLM: + StrCpy $SV_ALLUSERS "AllUsers" + ;Get installation folder from registry if available + + done: + StrCmp $SV_ALLUSERS "AllUsers" 0 +3 + StrCmp "$IS_DEFAULT_INSTALLDIR" "1" 0 +2 + StrCpy $INSTDIR "@CPACK_NSIS_INSTALL_ROOT@\@CPACK_PACKAGE_INSTALL_DIRECTORY@" + + StrCmp "@CPACK_NSIS_MODIFY_PATH@" "ON" 0 noOptionsPage + !insertmacro MUI_INSTALLOPTIONS_EXTRACT "NSIS.InstallOptions.ini" + + noOptionsPage: +FunctionEnd diff --git a/config/cmake_ext_mod/grepTest.cmake b/config/cmake_ext_mod/grepTest.cmake new file mode 100644 index 0000000..579d855 --- /dev/null +++ b/config/cmake_ext_mod/grepTest.cmake @@ -0,0 +1,64 @@ +# grepTest.cmake executes a command and captures the output in a file. File is then compared +# against a reference file. Exit status of command can also be compared. + +# arguments checking +if (NOT TEST_PROGRAM) + message (FATAL_ERROR "Require TEST_PROGRAM to be defined") +endif (NOT TEST_PROGRAM) +#if (NOT TEST_ARGS) +# message (STATUS "Require TEST_ARGS to be defined") +#endif (NOT TEST_ARGS) +if (NOT TEST_FOLDER) + message ( FATAL_ERROR "Require TEST_FOLDER to be defined") +endif (NOT TEST_FOLDER) +if (NOT TEST_OUTPUT) + message (FATAL_ERROR "Require TEST_OUTPUT to be defined") +endif (NOT TEST_OUTPUT) +#if (NOT TEST_EXPECT) +# message (STATUS "Require TEST_EXPECT to be defined") +#endif (NOT TEST_EXPECT) +if (NOT TEST_FILTER) + message (STATUS "Require TEST_FILTER to be defined") +endif (NOT TEST_FILTER) +if (NOT TEST_REFERENCE) + message (FATAL_ERROR "Require TEST_REFERENCE to be defined") +endif (NOT TEST_REFERENCE) + +message (STATUS "COMMAND: ${TEST_PROGRAM} ${TEST_ARGS}") + +# run the test program, capture the stdout/stderr and the result var +EXECUTE_PROCESS ( + COMMAND ${TEST_PROGRAM} ${TEST_ARGS} + WORKING_DIRECTORY ${TEST_FOLDER} + RESULT_VARIABLE TEST_RESULT + OUTPUT_FILE ${TEST_OUTPUT} + ERROR_FILE ${TEST_OUTPUT}.err + OUTPUT_VARIABLE TEST_ERROR + ERROR_VARIABLE TEST_ERROR +) + +message (STATUS "COMMAND Result: ${TEST_RESULT}") +message (STATUS "COMMAND Error: ${TEST_ERROR}") + +# now grep the output with the reference +file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) + +# TEST_REFERENCE should always be matched +STRING(REGEX MATCH "${TEST_REFERENCE}" TEST_MATCH ${TEST_STREAM}) +STRING(COMPARE EQUAL "${TEST_REFERENCE}" "${TEST_MATCH}" TEST_RESULT) +if (${TEST_RESULT} STREQUAL "0") + message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did not contain ${TEST_REFERENCE}") +endif (${TEST_RESULT} STREQUAL "0") + +STRING(REGEX MATCH "${TEST_FILTER}" TEST_MATCH ${TEST_STREAM}) +if (${TEST_EXPECT} STREQUAL "1") + # TEST_EXPECT (1) interperts TEST_FILTER as NOT to match + STRING(LENGTH "${TEST_MATCH}" TEST_RESULT) + if (NOT ${TEST_RESULT} STREQUAL "0") + message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did contain ${TEST_FILTER}") + endif (NOT ${TEST_RESULT} STREQUAL "0") +endif (${TEST_EXPECT} STREQUAL "1") + +# everything went fine... +message ("Passed: The output of ${TEST_PROGRAM} matched") + diff --git a/config/cmake_ext_mod/hdf.bmp b/config/cmake_ext_mod/hdf.bmp new file mode 100644 index 0000000..9e9e4aa Binary files /dev/null and b/config/cmake_ext_mod/hdf.bmp differ diff --git a/config/cmake_ext_mod/hdf.icns b/config/cmake_ext_mod/hdf.icns new file mode 100644 index 0000000..66f025d Binary files /dev/null and b/config/cmake_ext_mod/hdf.icns differ diff --git a/config/cmake_ext_mod/hdf.ico b/config/cmake_ext_mod/hdf.ico new file mode 100644 index 0000000..26abc96 Binary files /dev/null and b/config/cmake_ext_mod/hdf.ico differ diff --git a/config/cmake_ext_mod/prunTest.cmake b/config/cmake_ext_mod/prunTest.cmake new file mode 100644 index 0000000..3d5ec31 --- /dev/null +++ b/config/cmake_ext_mod/prunTest.cmake @@ -0,0 +1,145 @@ +# runTest.cmake executes a command and captures the output in a file. File is then compared +# against a reference file. Exit status of command can also be compared. +cmake_policy(SET CMP0007 NEW) + +# arguments checking +if (NOT TEST_PROGRAM) + message (FATAL_ERROR "Require TEST_PROGRAM to be defined") +endif (NOT TEST_PROGRAM) +#if (NOT TEST_ARGS) +# message (STATUS "Require TEST_ARGS to be defined") +#endif (NOT TEST_ARGS) +if (NOT TEST_FOLDER) + message ( FATAL_ERROR "Require TEST_FOLDER to be defined") +endif (NOT TEST_FOLDER) +if (NOT TEST_OUTPUT) + message (FATAL_ERROR "Require TEST_OUTPUT to be defined") +endif (NOT TEST_OUTPUT) +#if (NOT TEST_EXPECT) +# message (STATUS "Require TEST_EXPECT to be defined") +#endif (NOT TEST_EXPECT) +#if (NOT TEST_FILTER) +# message (STATUS "Require TEST_FILTER to be defined") +#endif (NOT TEST_FILTER) +if (NOT TEST_SKIP_COMPARE AND NOT TEST_REFERENCE) + message (FATAL_ERROR "Require TEST_REFERENCE to be defined") +endif (NOT TEST_SKIP_COMPARE AND NOT TEST_REFERENCE) + +set (ERROR_APPEND 1) + +message (STATUS "COMMAND: ${TEST_PROGRAM} ${TEST_ARGS}") + +if (TEST_ENV_VAR) + set (ENV{${TEST_ENV_VAR}} "${TEST_ENV_VALUE}") +endif (TEST_ENV_VAR) + +# run the test program, capture the stdout/stderr and the result var +EXECUTE_PROCESS ( + COMMAND ${TEST_PROGRAM} ${TEST_ARGS} + WORKING_DIRECTORY ${TEST_FOLDER} + RESULT_VARIABLE TEST_RESULT + OUTPUT_FILE ${TEST_OUTPUT} + ERROR_FILE ${TEST_OUTPUT}.err + OUTPUT_VARIABLE TEST_ERROR + ERROR_VARIABLE TEST_ERROR +) + +message (STATUS "COMMAND Result: ${TEST_RESULT}") + +file (READ ${TEST_FOLDER}/${TEST_REFERENCE} TEST_STREAM) +file (WRITE ${TEST_FOLDER}/P_${TEST_REFERENCE} "${TEST_STREAM}") + +if (ERROR_APPEND) + file (READ ${TEST_FOLDER}/${TEST_OUTPUT}.err TEST_STREAM) + file (APPEND ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") +endif (ERROR_APPEND) + +if (TEST_APPEND) + file (APPEND ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_APPEND} ${TEST_ERROR}\n") +endif (TEST_APPEND) + +message (STATUS "COMMAND Error: ${TEST_ERROR}") + +if (TEST_MASK) + file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) + STRING(REGEX REPLACE "Storage:[^\n]+\n" "Storage:
\n" TEST_STREAM "${TEST_STREAM}") + file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") +endif (TEST_MASK) + +if (TEST_MASK_MOD) + file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) + STRING(REGEX REPLACE "Modified:[^\n]+\n" "Modified: XXXX-XX-XX XX:XX:XX XXX\n" TEST_STREAM "${TEST_STREAM}") + file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") +endif (TEST_MASK_MOD) + +if (TEST_MASK_ERROR) + file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) + STRING(REGEX REPLACE "thread [0-9]*:" "thread (IDs):" TEST_STREAM "${TEST_STREAM}") + STRING(REGEX REPLACE ": ([^\n]*)[.]c " ": (file name) " TEST_STREAM "${TEST_STREAM}") + STRING(REGEX REPLACE " line [0-9]*" " line (number)" TEST_STREAM "${TEST_STREAM}") + STRING(REGEX REPLACE "v[1-9]*[.][0-9]*[.]" "version (number)." TEST_STREAM "${TEST_STREAM}") + STRING(REGEX REPLACE "[1-9]*[.][0-9]*[.][0-9]*[^)]*" "version (number)" TEST_STREAM "${TEST_STREAM}") + STRING(REGEX REPLACE "H5Eget_auto[1-2]*" "H5Eget_auto(1 or 2)" TEST_STREAM "${TEST_STREAM}") + STRING(REGEX REPLACE "H5Eset_auto[1-2]*" "H5Eset_auto(1 or 2)" TEST_STREAM "${TEST_STREAM}") + file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") +endif (TEST_MASK_ERROR) + +if (TEST_FILTER) + file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) + STRING(REGEX REPLACE "${TEST_FILTER}" "" TEST_STREAM "${TEST_STREAM}") + file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") +endif (TEST_FILTER) + +#if (TEST_REF_FILTER) +# message (STATUS "TEST_REF_FILTER: ${TEST_APPEND}${TEST_REF_FILTER}") +# file (READ ${TEST_FOLDER}/P_${TEST_REFERENCE} TEST_STREAM) +# STRING(REGEX REPLACE "${TEST_APPEND}" "${TEST_REF_FILTER}" TEST_STREAM "${TEST_STREAM}") +# file (WRITE ${TEST_FOLDER}/P_${TEST_REFERENCE} "${TEST_STREAM}") +#endif (TEST_REF_FILTER) + +if (NOT TEST_SKIP_COMPARE) + if (WIN32 AND NOT MINGW) + file (READ ${TEST_FOLDER}/P_${TEST_REFERENCE} TEST_STREAM) + file (WRITE ${TEST_FOLDER}/P_${TEST_REFERENCE} "${TEST_STREAM}") + endif (WIN32 AND NOT MINGW) + + # now compare the output with the reference + EXECUTE_PROCESS ( + COMMAND ${CMAKE_COMMAND} -E compare_files ${TEST_FOLDER}/${TEST_OUTPUT} ${TEST_FOLDER}/P_${TEST_REFERENCE} + RESULT_VARIABLE TEST_RESULT + ) + if (NOT ${TEST_RESULT} STREQUAL 0) + set (TEST_RESULT 0) + file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT} test_act) + LIST (LENGTH test_act len_act) + file (STRINGS ${TEST_FOLDER}/P_${TEST_REFERENCE} test_ref) + LIST (LENGTH test_ref len_ref) + if (NOT ${len_act} STREQUAL "0") + MATH (EXPR _FP_LEN "${len_ref} - 1") + foreach (line RANGE 0 ${_FP_LEN}) + LIST (GET test_act ${line} str_act) + LIST (GET test_ref ${line} str_ref) + if (NOT "${str_act}" STREQUAL "${str_ref}") + if (NOT "${str_act}" STREQUAL "") + set (TEST_RESULT 1) + message ("line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n") + endif (NOT "${str_act}" STREQUAL "") + endif (NOT "${str_act}" STREQUAL "${str_ref}") + endforeach (line RANGE 0 ${_FP_LEN}) + endif (NOT ${len_act} STREQUAL "0") + if (NOT ${len_act} STREQUAL ${len_ref}) + set (TEST_RESULT 1) + endif (NOT ${len_act} STREQUAL ${len_ref}) + endif (NOT ${TEST_RESULT} STREQUAL 0) + + message (STATUS "COMPARE Result: ${TEST_RESULT}") + + # again, if return value is !=0 scream and shout + if (NOT ${TEST_RESULT} STREQUAL 0) + message (FATAL_ERROR "Failed: The output of ${TEST_OUTPUT} did not match P_${TEST_REFERENCE}") + endif (NOT ${TEST_RESULT} STREQUAL 0) +endif (NOT TEST_SKIP_COMPARE) + +# everything went fine... +message ("Passed: The output of ${TEST_PROGRAM} matches P_${TEST_REFERENCE}") + diff --git a/config/cmake_ext_mod/runTest.cmake b/config/cmake_ext_mod/runTest.cmake new file mode 100644 index 0000000..bfaae2b --- /dev/null +++ b/config/cmake_ext_mod/runTest.cmake @@ -0,0 +1,207 @@ +# runTest.cmake executes a command and captures the output in a file. File is then compared +# against a reference file. Exit status of command can also be compared. +cmake_policy(SET CMP0007 NEW) + +# arguments checking +if (NOT TEST_PROGRAM) + message (FATAL_ERROR "Require TEST_PROGRAM to be defined") +endif (NOT TEST_PROGRAM) +#if (NOT TEST_ARGS) +# message (STATUS "Require TEST_ARGS to be defined") +#endif (NOT TEST_ARGS) +if (NOT TEST_FOLDER) + message ( FATAL_ERROR "Require TEST_FOLDER to be defined") +endif (NOT TEST_FOLDER) +if (NOT TEST_OUTPUT) + message (FATAL_ERROR "Require TEST_OUTPUT to be defined") +endif (NOT TEST_OUTPUT) +if (NOT TEST_EXPECT) + message (STATUS "Require TEST_EXPECT to be defined") +endif (NOT TEST_EXPECT) +#if (NOT TEST_FILTER) +# message (STATUS "Require TEST_FILTER to be defined") +#endif (NOT TEST_FILTER) +if (NOT TEST_SKIP_COMPARE AND NOT TEST_REFERENCE) + message (FATAL_ERROR "Require TEST_REFERENCE to be defined") +endif (NOT TEST_SKIP_COMPARE AND NOT TEST_REFERENCE) + +if (NOT TEST_ERRREF) + set (ERROR_APPEND 1) +endif (NOT TEST_ERRREF) + +message (STATUS "COMMAND: ${TEST_PROGRAM} ${TEST_ARGS}") + +if (TEST_ENV_VAR) + set (ENV{${TEST_ENV_VAR}} "${TEST_ENV_VALUE}") +endif (TEST_ENV_VAR) + +if (NOT TEST_INPUT) + # run the test program, capture the stdout/stderr and the result var + EXECUTE_PROCESS ( + COMMAND ${TEST_PROGRAM} ${TEST_ARGS} + WORKING_DIRECTORY ${TEST_FOLDER} + RESULT_VARIABLE TEST_RESULT + OUTPUT_FILE ${TEST_OUTPUT} + ERROR_FILE ${TEST_OUTPUT}.err + OUTPUT_VARIABLE TEST_ERROR + ERROR_VARIABLE TEST_ERROR + ) +else (NOT TEST_INPUT) + # run the test program with stdin, capture the stdout/stderr and the result var + EXECUTE_PROCESS ( + COMMAND ${TEST_PROGRAM} ${TEST_ARGS} + WORKING_DIRECTORY ${TEST_FOLDER} + RESULT_VARIABLE TEST_RESULT + INPUT_FILE ${TEST_INPUT} + OUTPUT_FILE ${TEST_OUTPUT} + ERROR_FILE ${TEST_OUTPUT}.err + OUTPUT_VARIABLE TEST_ERROR + ERROR_VARIABLE TEST_ERROR + ) +endif (NOT TEST_INPUT) + +message (STATUS "COMMAND Result: ${TEST_RESULT}") + +if (ERROR_APPEND) + file (READ ${TEST_FOLDER}/${TEST_OUTPUT}.err TEST_STREAM) + file (APPEND ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") +endif (ERROR_APPEND) + +if (TEST_APPEND) + file (APPEND ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_APPEND} ${TEST_RESULT}\n") +endif (TEST_APPEND) + +# if the return value is !=${TEST_EXPECT} bail out +if (NOT ${TEST_RESULT} STREQUAL ${TEST_EXPECT}) + message ( FATAL_ERROR "Failed: Test program ${TEST_PROGRAM} exited != ${TEST_EXPECT}.\n${TEST_ERROR}") +endif (NOT ${TEST_RESULT} STREQUAL ${TEST_EXPECT}) + +message (STATUS "COMMAND Error: ${TEST_ERROR}") + +if (TEST_MASK) + file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) + STRING(REGEX REPLACE "Storage:[^\n]+\n" "Storage:
\n" TEST_STREAM "${TEST_STREAM}") + file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") +endif (TEST_MASK) + +if (TEST_MASK_MOD) + file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) + STRING(REGEX REPLACE "Modified:[^\n]+\n" "Modified: XXXX-XX-XX XX:XX:XX XXX\n" TEST_STREAM "${TEST_STREAM}") + file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") +endif (TEST_MASK_MOD) + +if (TEST_MASK_ERROR) + if (NOT TEST_ERRREF) + file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) + else (NOT TEST_ERRREF) + file (READ ${TEST_FOLDER}/${TEST_OUTPUT}.err TEST_STREAM) + endif (NOT TEST_ERRREF) + STRING(REGEX REPLACE "thread [0-9]*:" "thread (IDs):" TEST_STREAM "${TEST_STREAM}") + STRING(REGEX REPLACE ": ([^\n]*)[.]c " ": (file name) " TEST_STREAM "${TEST_STREAM}") + STRING(REGEX REPLACE " line [0-9]*" " line (number)" TEST_STREAM "${TEST_STREAM}") + STRING(REGEX REPLACE "v[1-9]*[.][0-9]*[.]" "version (number)." TEST_STREAM "${TEST_STREAM}") + STRING(REGEX REPLACE "[1-9]*[.][0-9]*[.][0-9]*[^)]*" "version (number)" TEST_STREAM "${TEST_STREAM}") + STRING(REGEX REPLACE "H5Eget_auto[1-2]*" "H5Eget_auto(1 or 2)" TEST_STREAM "${TEST_STREAM}") + STRING(REGEX REPLACE "H5Eset_auto[1-2]*" "H5Eset_auto(1 or 2)" TEST_STREAM "${TEST_STREAM}") + if (NOT TEST_ERRREF) + file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") + else (NOT TEST_ERRREF) + file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT}.err "${TEST_STREAM}") + endif (NOT TEST_ERRREF) +endif (TEST_MASK_ERROR) + +if (TEST_FILTER) + file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) + STRING(REGEX REPLACE "${TEST_FILTER}" "" TEST_STREAM "${TEST_STREAM}") + file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") +endif (TEST_FILTER) + +if (NOT TEST_SKIP_COMPARE) + if (WIN32 AND NOT MINGW) + file (READ ${TEST_FOLDER}/${TEST_REFERENCE} TEST_STREAM) + file (WRITE ${TEST_FOLDER}/${TEST_REFERENCE} "${TEST_STREAM}") + endif (WIN32 AND NOT MINGW) + + # now compare the output with the reference + EXECUTE_PROCESS ( + COMMAND ${CMAKE_COMMAND} -E compare_files ${TEST_FOLDER}/${TEST_OUTPUT} ${TEST_FOLDER}/${TEST_REFERENCE} + RESULT_VARIABLE TEST_RESULT + ) + if (NOT ${TEST_RESULT} STREQUAL 0) + set (TEST_RESULT 0) + file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT} test_act) + LIST (LENGTH test_act len_act) + file (STRINGS ${TEST_FOLDER}/${TEST_REFERENCE} test_ref) + LIST (LENGTH test_ref len_ref) + if (NOT ${len_act} STREQUAL "0") + MATH (EXPR _FP_LEN "${len_ref} - 1") + foreach (line RANGE 0 ${_FP_LEN}) + LIST (GET test_act ${line} str_act) + LIST (GET test_ref ${line} str_ref) + if (NOT "${str_act}" STREQUAL "${str_ref}") + if (NOT "${str_act}" STREQUAL "") + set (TEST_RESULT 1) + message ("line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n") + endif (NOT "${str_act}" STREQUAL "") + endif (NOT "${str_act}" STREQUAL "${str_ref}") + endforeach (line RANGE 0 ${_FP_LEN}) + endif (NOT ${len_act} STREQUAL "0") + if (NOT ${len_act} STREQUAL ${len_ref}) + set (TEST_RESULT 1) + endif (NOT ${len_act} STREQUAL ${len_ref}) + endif (NOT ${TEST_RESULT} STREQUAL 0) + + message (STATUS "COMPARE Result: ${TEST_RESULT}") + + # again, if return value is !=0 scream and shout + if (NOT ${TEST_RESULT} STREQUAL 0) + message (FATAL_ERROR "Failed: The output of ${TEST_OUTPUT} did not match ${TEST_REFERENCE}") + endif (NOT ${TEST_RESULT} STREQUAL 0) + + if (TEST_ERRREF) + if (WIN32 AND NOT MINGW) + file (READ ${TEST_FOLDER}/${TEST_ERRREF} TEST_STREAM) + file (WRITE ${TEST_FOLDER}/${TEST_ERRREF} "${TEST_STREAM}") + endif (WIN32 AND NOT MINGW) + + # now compare the error output with the error reference + EXECUTE_PROCESS ( + COMMAND ${CMAKE_COMMAND} -E compare_files ${TEST_FOLDER}/${TEST_OUTPUT}.err ${TEST_FOLDER}/${TEST_ERRREF} + RESULT_VARIABLE TEST_RESULT + ) + if (NOT ${TEST_RESULT} STREQUAL 0) + set (TEST_RESULT 0) + file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT}.err test_act) + LIST (LENGTH test_act len_act) + file (STRINGS ${TEST_FOLDER}/${TEST_ERRREF} test_ref) + LIST (LENGTH test_ref len_ref) + MATH (EXPR _FP_LEN "${len_ref} - 1") + if (NOT ${len_act} STREQUAL "0") + MATH (EXPR _FP_LEN "${len_ref} - 1") + foreach (line RANGE 0 ${_FP_LEN}) + LIST (GET test_act ${line} str_act) + LIST (GET test_ref ${line} str_ref) + if (NOT "${str_act}" STREQUAL "${str_ref}") + if (NOT "${str_act}" STREQUAL "") + set (TEST_RESULT 1) + message ("line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n") + endif (NOT "${str_act}" STREQUAL "") + endif (NOT "${str_act}" STREQUAL "${str_ref}") + endforeach (line RANGE 0 ${_FP_LEN}) + endif (NOT ${len_act} STREQUAL "0") + if (NOT ${len_act} STREQUAL ${len_ref}) + set (TEST_RESULT 1) + endif (NOT ${len_act} STREQUAL ${len_ref}) + endif (NOT ${TEST_RESULT} STREQUAL 0) + + message (STATUS "COMPARE Result: ${TEST_RESULT}") + + # again, if return value is !=0 scream and shout + if (NOT ${TEST_RESULT} STREQUAL 0) + message (FATAL_ERROR "Failed: The error output of ${TEST_OUTPUT}.err did not match ${TEST_ERRREF}") + endif (NOT ${TEST_RESULT} STREQUAL 0) + endif (TEST_ERRREF) +endif (NOT TEST_SKIP_COMPARE) + +# everything went fine... +message ("Passed: The output of ${TEST_PROGRAM} matches ${TEST_REFERENCE}") diff --git a/config/cmake_ext_mod/version.plist.in b/config/cmake_ext_mod/version.plist.in new file mode 100644 index 0000000..817d89e --- /dev/null +++ b/config/cmake_ext_mod/version.plist.in @@ -0,0 +1,17 @@ + + + + + + BuildVersion + @CPACK_PACKAGE_VERSION_MAJOR@ + CFBundleShortVersionString + @CPACK_APPLE_GUI_SHORT_VERSION_STRING@ + CFBundleVersion + @CPACK_APPLE_GUI_SHORT_VERSION_STRING@ + ProjectName + @CPACK_APPLE_GUI_BUNDLE_NAME@ + SourceVersion + @CPACK_PACKAGE_VERSION_MINOR@ + + -- cgit v0.12 From 7ce2d52cf69f6f6477e0f16e9d85d67cc54d5949 Mon Sep 17 00:00:00 2001 From: Jerome Soumagne Date: Fri, 21 Aug 2015 13:52:30 -0500 Subject: [svn-r27545] Add first support for _Bool and make hbool_t a "real" _Bool if available Fix tests accordingly --- config/cmake/H5pubconf.h.in | 6 ++ config/cmake_ext_mod/ConfigureChecks.cmake | 13 +++ configure | 55 ++++++++++++ configure.ac | 12 +++ src/H5Pgcpl.c | 2 +- src/H5T.c | 2 +- src/H5config.h.in | 6 ++ src/H5private.h | 4 +- src/H5public.h | 15 +++- test/btree2.c | 2 +- test/cache_api.c | 140 ++++++++--------------------- test/dsets.c | 2 +- test/dtypes.c | 4 +- test/fillval.c | 2 +- test/links.c | 22 ++--- test/mf.c | 4 +- test/objcopy.c | 2 +- test/ohdr.c | 2 +- test/plugin.c | 2 +- test/set_extent.c | 4 +- test/stab.c | 2 +- test/tattr.c | 18 ++-- test/tfile.c | 6 +- test/th5o.c | 2 +- test/titerate.c | 2 +- test/tmisc.c | 2 +- test/unlink.c | 2 +- tools/perform/pio_standalone.h | 4 +- tools/perform/sio_standalone.h | 4 +- 29 files changed, 189 insertions(+), 154 deletions(-) diff --git a/config/cmake/H5pubconf.h.in b/config/cmake/H5pubconf.h.in index 37bcfbf..bbc1b95 100644 --- a/config/cmake/H5pubconf.h.in +++ b/config/cmake/H5pubconf.h.in @@ -581,6 +581,12 @@ /* The size of `__int64', as computed by sizeof. */ #define H5_SIZEOF___INT64 @H5_SIZEOF___INT64@ +/* Define to 1 if you have the header file. */ +#cmakedefine H5_HAVE_STDBOOL_H @H5_HAVE_STDBOOL_H@ + +/* The size of `bool', as computed by sizeof. */ +#cmakedefine H5_SIZEOF_BOOL @H5_SIZEOF_BOOL@ + /* Define to 1 if you have the ANSI C header files. */ #cmakedefine H5_STDC_HEADERS @H5_STDC_HEADERS@ diff --git a/config/cmake_ext_mod/ConfigureChecks.cmake b/config/cmake_ext_mod/ConfigureChecks.cmake index e058b10..f58c435 100644 --- a/config/cmake_ext_mod/ConfigureChecks.cmake +++ b/config/cmake_ext_mod/ConfigureChecks.cmake @@ -427,6 +427,19 @@ if (NOT ${HDF_PREFIX}_SIZEOF_OFF64_T) set (${HDF_PREFIX}_SIZEOF_OFF64_T 0) endif (NOT ${HDF_PREFIX}_SIZEOF_OFF64_T) +#----------------------------------------------------------------------------- +# Extra C99 types +#----------------------------------------------------------------------------- + +# _Bool type support +CHECK_INCLUDE_FILE_CONCAT (stdbool.h ${HDF_PREFIX}_HAVE_STDBOOL_H) +if (HAVE_STDBOOL_H) + set (CMAKE_EXTRA_INCLUDE_FILES stdbool.h) + HDF_CHECK_TYPE_SIZE (bool ${HDF_PREFIX}_SIZEOF_BOOL) +else (HAVE_STDBOOL_H) + HDF_CHECK_TYPE_SIZE (_Bool ${HDF_PREFIX}_SIZEOF_BOOL) +endif (HAVE_STDBOOL_H) + if (NOT WINDOWS) #----------------------------------------------------------------------------- # Check if the dev_t type is a scalar type diff --git a/configure b/configure index 42e9b81..55ade2f 100755 --- a/configure +++ b/configure @@ -23373,6 +23373,18 @@ fi done +for ac_header in stdbool.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "stdbool.h" "ac_cv_header_stdbool_h" "$ac_includes_default" +if test "x$ac_cv_header_stdbool_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_STDBOOL_H 1 +_ACEOF + +fi + +done + ## Darwin for ac_header in mach/mach_time.h @@ -24963,6 +24975,49 @@ _ACEOF +if test "X$C9x" = "Xyes"; then + cat >>confdefs.h <<\EOF +#ifdef HAVE_STDBOOL_H +#include /* for bool definition */ +#else +#define bool _Bool +#endif +EOF +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of bool" >&5 +$as_echo_n "checking size of bool... " >&6; } +if ${ac_cv_sizeof_bool+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (bool))" "ac_cv_sizeof_bool" "$ac_includes_default"; then : + +else + if test "$ac_cv_type_bool" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (bool) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_bool=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_bool" >&5 +$as_echo "$ac_cv_sizeof_bool" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_BOOL $ac_cv_sizeof_bool +_ACEOF + + +fi + ## Checkpoint the cache cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure diff --git a/configure.ac b/configure.ac index 88d037c..ca25fd9 100644 --- a/configure.ac +++ b/configure.ac @@ -982,6 +982,7 @@ AC_CHECK_HEADERS([sys/socket.h sys/types.h]) AC_CHECK_HEADERS([stddef.h setjmp.h features.h]) AC_CHECK_HEADERS([dirent.h]) AC_CHECK_HEADERS([stdint.h], [C9x=yes]) +AC_CHECK_HEADERS([stdbool.h]) ## Darwin AC_CHECK_HEADERS([mach/mach_time.h]) @@ -1189,6 +1190,17 @@ EOF AC_CHECK_SIZEOF([off_t], [4]) AC_CHECK_SIZEOF([off64_t], [8]) +if test "X$C9x" = "Xyes"; then + cat >>confdefs.h <<\EOF +#ifdef HAVE_STDBOOL_H +#include /* for bool definition */ +#else +#define bool _Bool +#endif +EOF +AC_CHECK_SIZEOF([bool], [1]) +fi + ## Checkpoint the cache AC_CACHE_SAVE diff --git a/src/H5Pgcpl.c b/src/H5Pgcpl.c index 1e3a278..e33fb6e 100644 --- a/src/H5Pgcpl.c +++ b/src/H5Pgcpl.c @@ -690,7 +690,7 @@ H5P__gcrt_link_info_dec(const void **_pp, void *_value) HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "unsigned value can't be decoded") /* Set property to default value */ - *linfo = H5G_def_linfo_g; + memcpy(linfo, &H5G_def_linfo_g, sizeof(H5O_linfo_t)); H5_DECODE_UNSIGNED(*pp, crt_order_flags) diff --git a/src/H5T.c b/src/H5T.c index 5f6c8e3..977ac22 100644 --- a/src/H5T.c +++ b/src/H5T.c @@ -850,7 +850,7 @@ H5T_init_interface(void) H5T_INIT_TYPE(OFFSET,H5T_NATIVE_HERR_g,COPY,native_int,SET,sizeof(herr_t)) /* hbool_t */ - H5T_INIT_TYPE(OFFSET,H5T_NATIVE_HBOOL_g,COPY,native_int,SET,sizeof(hbool_t)) + H5T_INIT_TYPE(OFFSET,H5T_NATIVE_HBOOL_g,COPY,native_uint,SET,sizeof(hbool_t)) /*------------------------------------------------------------ * IEEE Types diff --git a/src/H5config.h.in b/src/H5config.h.in index ad8dcf9..96e2df5 100644 --- a/src/H5config.h.in +++ b/src/H5config.h.in @@ -293,6 +293,9 @@ /* Define if `struct stat' has the `st_blocks' field */ #undef HAVE_STAT_ST_BLOCKS +/* Define to 1 if you have the header file. */ +#undef HAVE_STDBOOL_H + /* Define to 1 if you have the header file. */ #undef HAVE_STDDEF_H @@ -469,6 +472,9 @@ /* Width for printf() for type `long long' or `__int64', use `ll' */ #undef PRINTF_LL_WIDTH +/* The size of `bool', as computed by sizeof. */ +#undef SIZEOF_BOOL + /* The size of `char', as computed by sizeof. */ #undef SIZEOF_CHAR diff --git a/src/H5private.h b/src/H5private.h index 9efd145..b0880a1 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -353,10 +353,10 @@ * HDF Boolean type. */ #ifndef FALSE -# define FALSE 0 + #define FALSE false #endif #ifndef TRUE -# define TRUE 1 + #define TRUE true #endif /* diff --git a/src/H5public.h b/src/H5public.h index 1b3711b..858e67f 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -141,7 +141,20 @@ typedef int herr_t; * printf("error determining whether data type is committed\n"); * } */ -typedef unsigned int hbool_t; +#ifdef H5_HAVE_STDBOOL_H + #include +#else /* H5_HAVE_STDBOOL_H */ + #ifndef __cplusplus + #if defined(H5_SIZEOF_BOOL) && (H5_SIZEOF_BOOL != 0) + #define bool _Bool + #else + #define bool unsigned int + #endif + #define true 1 + #define false 0 + #endif /* __cplusplus */ +#endif /* H5_HAVE_STDBOOL_H */ +typedef bool hbool_t; typedef int htri_t; /* Define the ssize_t type if it not is defined */ diff --git a/test/btree2.c b/test/btree2.c index d8abc84..a59861f 100644 --- a/test/btree2.c +++ b/test/btree2.c @@ -7625,7 +7625,7 @@ main(void) bt2_test_param_t tparam; /* Test parameters for v2 B-tree */ hid_t fapl = -1; /* File access property list for data files */ unsigned nerrors = 0; /* Cumulative error count */ - hbool_t reopen; /* Whether to reopen B-tree during tests */ + unsigned reopen; /* Whether to reopen B-tree during tests */ int ExpressMode; const char *envval = NULL; diff --git a/test/cache_api.c b/test/cache_api.c index 1697884..bebb828 100644 --- a/test/cache_api.c +++ b/test/cache_api.c @@ -1530,7 +1530,7 @@ mdc_api_call_smoke_check(int express_test) * Note: It is assumed that boolean parameters are only set to TRUE/FALSE. */ -#define NUM_INVALID_CONFIGS 42 +#define NUM_INVALID_CONFIGS 36 H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = { @@ -1605,42 +1605,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 2 -- bad set_initial_size */ - /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, - /* hbool_t rpt_fcn_enabled = */ FALSE, - /* hbool_t open_trace_file = */ FALSE, - /* hbool_t close_trace_file = */ FALSE, - /* char trace_file_name[] = */ "", - /* hbool_t evictions_enabled = */ TRUE, - /* hbool_t set_initial_size = */ 2, - /* size_t initial_size = */ (1 * 1024 * 1024), - /* double min_clean_fraction = */ 0.25f, - /* size_t max_size = */ (16 * 1024 * 1024), - /* size_t min_size = */ ( 1 * 1024 * 1024), - /* long int epoch_length = */ 50000, - /* enum H5C_cache_incr_mode incr_mode = */ H5C_incr__threshold, - /* double lower_hr_threshold = */ 0.9f, - /* double increment = */ 2.0f, - /* hbool_t apply_max_increment = */ TRUE, - /* size_t max_increment = */ (4 * 1024 * 1024), - /* enum H5C_cache_flash_incr_mode */ - /* flash_incr_mode = */ H5C_flash_incr__off, - /* double flash_multiple = */ 2.0f, - /* double flash_threshold = */ 0.5f, - /* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__age_out_with_threshold, - /* double upper_hr_threshold = */ 0.999f, - /* double decrement = */ 0.9f, - /* hbool_t apply_max_decrement = */ TRUE, - /* size_t max_decrement = */ (1 * 1024 * 1024), - /* int epochs_before_eviction = */ 3, - /* hbool_t apply_empty_reserve = */ TRUE, - /* double empty_reserve = */ 0.1f, - /* int dirty_bytes_threshold = */ (256 * 1024), - /* int metadata_write_strategy = */ - H5AC__DEFAULT_METADATA_WRITE_STRATEGY - }, - { - /* 3 -- max_size too big */ + /* 2 -- max_size too big */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -1675,7 +1640,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 4 -- min_size too small */ + /* 3 -- min_size too small */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -1710,7 +1675,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 5 -- min_size > max_size */ + /* 4 -- min_size > max_size */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -1745,7 +1710,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 6 -- initial size out of range (too big) */ + /* 5 -- initial size out of range (too big) */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -1780,7 +1745,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 7 -- initial_size out of range (too small) */ + /* 6 -- initial_size out of range (too small) */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -1815,7 +1780,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 8 -- min_clean_fraction too big */ + /* 7 -- min_clean_fraction too big */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -1850,7 +1815,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 9 -- min_clean_fraction too small */ + /* 8 -- min_clean_fraction too small */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -1885,7 +1850,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 10 -- epoch_length too small */ + /* 9 -- epoch_length too small */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -1920,7 +1885,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 11 -- epoch_length too big */ + /* 10 -- epoch_length too big */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -1955,7 +1920,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 12 -- invalid incr_mode */ + /* 11 -- invalid incr_mode */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -1990,7 +1955,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 13 -- lower_hr_threshold too small */ + /* 12 -- lower_hr_threshold too small */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -2025,7 +1990,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 14 -- lower_hr_threshold too big */ + /* 13 -- lower_hr_threshold too big */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -2060,7 +2025,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 15 -- increment too small */ + /* 14 -- increment too small */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -2095,7 +2060,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 16 -- invalid flash_incr_mode */ + /* 15 -- invalid flash_incr_mode */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -2130,7 +2095,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 17 -- flash_multiple too small */ + /* 16 -- flash_multiple too small */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -2165,7 +2130,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 18 -- flash_multiple too big */ + /* 17 -- flash_multiple too big */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -2200,7 +2165,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 19 -- flash_threshold too small */ + /* 18 -- flash_threshold too small */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -2235,7 +2200,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 20 -- flash_threshold too big */ + /* 19 -- flash_threshold too big */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -2270,7 +2235,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 21 -- bad decr_mode */ + /* 20 -- bad decr_mode */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -2305,7 +2270,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 22 -- upper_hr_threshold too big */ + /* 21 -- upper_hr_threshold too big */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -2340,7 +2305,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 23 -- decrement too small */ + /* 22 -- decrement too small */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -2375,7 +2340,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 24 -- decrement too big */ + /* 23 -- decrement too big */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -2410,7 +2375,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 25 -- epochs_before_eviction too small */ + /* 24 -- epochs_before_eviction too small */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -2445,7 +2410,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 26 -- epochs_before_eviction too big */ + /* 25 -- epochs_before_eviction too big */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -2480,42 +2445,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 27 -- invalid apply_empty_reserve */ - /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, - /* hbool_t rpt_fcn_enabled = */ FALSE, - /* hbool_t open_trace_file = */ FALSE, - /* hbool_t close_trace_file = */ FALSE, - /* char trace_file_name[] = */ "", - /* hbool_t evictions_enabled = */ TRUE, - /* hbool_t set_initial_size = */ TRUE, - /* size_t initial_size = */ (1 * 1024 * 1024), - /* double min_clean_fraction = */ 0.25f, - /* size_t max_size = */ (16 * 1024 * 1024), - /* size_t min_size = */ ( 1 * 1024 * 1024), - /* long int epoch_length = */ 50000, - /* enum H5C_cache_incr_mode incr_mode = */ H5C_incr__threshold, - /* double lower_hr_threshold = */ 0.9f, - /* double increment = */ 2.0f, - /* hbool_t apply_max_increment = */ TRUE, - /* size_t max_increment = */ (4 * 1024 * 1024), - /* enum H5C_cache_flash_incr_mode */ - /* flash_incr_mode = */ H5C_flash_incr__off, - /* double flash_multiple = */ 2.0f, - /* double flash_threshold = */ 0.5f, - /* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__age_out_with_threshold, - /* double upper_hr_threshold = */ 0.999f, - /* double decrement = */ 0.9f, - /* hbool_t apply_max_decrement = */ TRUE, - /* size_t max_decrement = */ (1 * 1024 * 1024), - /* int epochs_before_eviction = */ 3, - /* hbool_t apply_empty_reserve = */ 2, - /* double empty_reserve = */ 0.1f, - /* int dirty_bytes_threshold = */ (256 * 1024), - /* int metadata_write_strategy = */ - H5AC__DEFAULT_METADATA_WRITE_STRATEGY - }, - { - /* 28 -- empty_reserve too small */ + /* 26 -- empty_reserve too small */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -2550,7 +2480,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 29 -- empty_reserve too big */ + /* 27 -- empty_reserve too big */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -2585,7 +2515,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 30 -- upper_hr_threshold too small */ + /* 28 -- upper_hr_threshold too small */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -2620,7 +2550,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 31 -- upper_hr_threshold too big */ + /* 29 -- upper_hr_threshold too big */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -2655,7 +2585,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 32 -- upper_hr_threshold <= lower_hr_threshold */ + /* 30 -- upper_hr_threshold <= lower_hr_threshold */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -2690,7 +2620,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 33 -- dirty_bytes_threshold too small */ + /* 31 -- dirty_bytes_threshold too small */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -2725,7 +2655,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 34 -- dirty_bytes_threshold too big */ + /* 32 -- dirty_bytes_threshold too big */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -2760,7 +2690,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 35 -- attempt to disable evictions when auto incr enabled */ + /* 33 -- attempt to disable evictions when auto incr enabled */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -2795,7 +2725,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 36 -- attempt to disable evictions when auto decr enabled */ + /* 34 -- attempt to disable evictions when auto decr enabled */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -2830,7 +2760,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 37 -- unknown metadata write strategy */ + /* 35 -- unknown metadata write strategy */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, diff --git a/test/dsets.c b/test/dsets.c index e6b2ee4..1dd17f7 100644 --- a/test/dsets.c +++ b/test/dsets.c @@ -9033,7 +9033,7 @@ main(void) { char filename[FILENAME_BUF_SIZE]; hid_t file, grp, fapl, fapl2; - hbool_t new_format; + unsigned new_format; int mdc_nelmts; size_t rdcc_nelmts; size_t rdcc_nbytes; diff --git a/test/dtypes.c b/test/dtypes.c index 59cf000..3b95d41 100644 --- a/test/dtypes.c +++ b/test/dtypes.c @@ -6658,7 +6658,7 @@ test_delete_obj_named(hid_t fapl) hid_t attr = -1; /* Attribute ID */ hid_t dset = -1; /* Dataset ID */ hid_t fapl2 = -1; /* File access property list ID */ - hbool_t new_format; /* Whether to use old or new format */ + unsigned new_format; /* Whether to use old or new format */ char filename[1024], filename2[1024]; TESTING("deleting objects that use named datatypes"); @@ -6753,7 +6753,7 @@ test_delete_obj_named_fileid(hid_t fapl) hid_t attr = -1; /* Attribute ID */ hid_t dset = -1; /* Dataset ID */ hid_t fapl2 = -1; /* File access property list ID */ - hbool_t new_format; /* Whether to use old or new format */ + unsigned new_format; /* Whether to use old or new format */ char filename[1024], filename2[1024]; TESTING("deleting objects that use named datatypes"); diff --git a/test/fillval.c b/test/fillval.c index c791504..c0ce76b 100644 --- a/test/fillval.c +++ b/test/fillval.c @@ -2368,7 +2368,7 @@ main(int argc, char *argv[]) { int nerrors=0, argno, test_contig=1, test_chunk=1, test_compact=1; hid_t fapl = (-1), fapl2 = (-1); /* File access property lists */ - hbool_t new_format; /* Whether to use the new format or not */ + unsigned new_format; /* Whether to use the new format or not */ if(argc >= 2) { test_contig = test_chunk = test_compact = 0; diff --git a/test/links.c b/test/links.c index cfbc4a1..81b2ce0 100644 --- a/test/links.c +++ b/test/links.c @@ -10714,7 +10714,7 @@ corder_delete(hid_t fapl) unsigned min_dense; /* Minimum # of links to store in group "densely" */ hsize_t name_count; /* # of records in name index */ hsize_t corder_count; /* # of records in creation order index */ - hbool_t reopen_file; /* Whether to re-open the file before deleting group */ + unsigned reopen_file; /* Whether to re-open the file before deleting group */ h5_stat_size_t empty_size; /* Size of empty file */ h5_stat_size_t file_size; /* Size of file after operating on it */ char objname[NAME_BUF_SIZE]; /* Object name */ @@ -10995,8 +10995,8 @@ link_info_by_idx(hid_t fapl) hid_t file_id = (-1); /* File ID */ hid_t group_id = (-1); /* Group ID */ hid_t gcpl_id = (-1); /* Group creation property list ID */ - hbool_t hard_link; /* Create hard or soft link? */ - hbool_t use_index; /* Use index on creation order values */ + unsigned hard_link; /* Create hard or soft link? */ + unsigned use_index; /* Use index on creation order values */ unsigned max_compact; /* Maximum # of links to store in group compactly */ unsigned min_dense; /* Minimum # of links to store in group "densely" */ H5L_info_t linfo; /* Link info struct */ @@ -11178,7 +11178,7 @@ link_info_by_idx_old(hid_t fapl) { hid_t file_id = (-1); /* File ID */ hid_t group_id = (-1), group_id2 = (-1); /* Group IDs */ - hbool_t hard_link; /* Create hard or soft link? */ + unsigned hard_link; /* Create hard or soft link? */ H5L_info_t linfo; /* Link info struct */ char objname[NAME_BUF_SIZE]; /* Object name */ char valname[NAME_BUF_SIZE]; /* Link value name */ @@ -11347,7 +11347,7 @@ delete_by_idx(hid_t fapl) hid_t gcpl_id = (-1); /* Group creation property list ID */ H5_index_t idx_type; /* Type of index to operate on */ H5_iter_order_t order; /* Order within in the index */ - hbool_t use_index; /* Use index on creation order values */ + unsigned use_index; /* Use index on creation order values */ unsigned max_compact; /* Maximum # of links to store in group compactly */ unsigned min_dense; /* Minimum # of links to store in group "densely" */ H5L_info_t linfo; /* Link info struct */ @@ -12180,7 +12180,7 @@ link_iterate(hid_t fapl) hid_t gcpl_id = (-1); /* Group creation property list ID */ H5_index_t idx_type; /* Type of index to operate on */ H5_iter_order_t order; /* Order within in the index */ - hbool_t use_index; /* Use index on creation order values */ + unsigned use_index; /* Use index on creation order values */ unsigned max_compact; /* Maximum # of links to store in group compactly */ unsigned min_dense; /* Minimum # of links to store in group "densely" */ char objname[NAME_BUF_SIZE]; /* Object name */ @@ -12866,7 +12866,7 @@ open_by_idx(hid_t fapl) hid_t gcpl_id = (-1); /* Group creation property list ID */ H5_index_t idx_type; /* Type of index to operate on */ H5_iter_order_t order; /* Order within in the index */ - hbool_t use_index; /* Use index on creation order values */ + unsigned use_index; /* Use index on creation order values */ unsigned max_compact; /* Maximum # of links to store in group compactly */ unsigned min_dense; /* Minimum # of links to store in group "densely" */ H5O_info_t oi; /* Buffer for querying object's info */ @@ -13302,7 +13302,7 @@ object_info(hid_t fapl) hid_t space_id = (-1); /* Dataspace ID (for attributes) */ H5_index_t idx_type; /* Type of index to operate on */ H5_iter_order_t order; /* Order within in the index */ - hbool_t use_index; /* Use index on creation order values */ + unsigned use_index; /* Use index on creation order values */ unsigned max_compact; /* Maximum # of links to store in group compactly */ unsigned min_dense; /* Minimum # of links to store in group "densely" */ H5O_info_t oinfo; /* Buffer for querying object's info */ @@ -13698,7 +13698,7 @@ group_info(hid_t fapl) hid_t gcpl_id = (-1); /* Group creation property list ID */ H5_index_t idx_type; /* Type of index to operate on */ H5_iter_order_t order; /* Order within in the index */ - hbool_t use_index; /* Use index on creation order values */ + unsigned use_index; /* Use index on creation order values */ unsigned max_compact; /* Maximum # of links to store in group compactly */ unsigned min_dense; /* Minimum # of links to store in group "densely" */ H5G_info_t grp_info; /* Buffer for querying object's info */ @@ -14509,8 +14509,8 @@ main(void) { hid_t fapl, fapl2; /* File access property lists */ int nerrors = 0; - hbool_t new_format; /* Whether to use the new format or not */ - hbool_t efc; /* Whether to use the external file cache */ + unsigned new_format; /* Whether to use the new format or not */ + unsigned efc; /* Whether to use the external file cache */ const char *env_h5_drvr; /* File Driver value from environment */ env_h5_drvr = HDgetenv("HDF5_DRIVER"); diff --git a/test/mf.c b/test/mf.c index 67ebc4e..e306f98 100644 --- a/test/mf.c +++ b/test/mf.c @@ -6802,7 +6802,7 @@ test_mf_fs_drivers(hid_t fapl) hid_t fcpl = -1; /* file creation property list */ hid_t fapl_new = -1; /* copy of file access property list */ hid_t fapl2 = -1; /* copy of file access property list */ - hbool_t new_format; /* To use new library format or not */ + unsigned new_format; /* To use new library format or not */ unsigned ret = 0; /* return value */ H5FD_mem_t memb_map[H5FD_MEM_NTYPES]; /* Memory usage map */ @@ -7227,7 +7227,7 @@ test_filespace_drivers(hid_t fapl) { hid_t fapl_new = -1; /* copy of file access property list */ hid_t fapl2 = -1; /* copy of file access property list */ - hbool_t new_format; /* Using library new format or not */ + unsigned new_format; /* Using library new format or not */ unsigned ret = 0; /* return value */ H5FD_mem_t memb_map[H5FD_MEM_NTYPES]; /* Memory usage map */ diff --git a/test/objcopy.c b/test/objcopy.c index e84e70c..5e7d90c 100644 --- a/test/objcopy.c +++ b/test/objcopy.c @@ -12318,7 +12318,7 @@ main(void) /* Tests that do not use attributes and do not need to be tested * multiple times for different attribute configurations */ if(configuration < CONFIG_DENSE) { - hbool_t reopen; + unsigned reopen; nerrors += test_copy_named_datatype(fcpl_src, fcpl_dst, src_fapl, dst_fapl); nerrors += test_copy_named_datatype_vl(fcpl_src, fcpl_dst, src_fapl, dst_fapl); diff --git a/test/ohdr.c b/test/ohdr.c index 45f2238..ade01e7 100644 --- a/test/ohdr.c +++ b/test/ohdr.c @@ -321,7 +321,7 @@ main(void) time_t time_new, ro; int chunkno; /* Chunk index for message */ int i; /* Local index variable */ - hbool_t b; /* Index for "new format" loop */ + unsigned b; /* Index for "new format" loop */ herr_t ret; /* Generic return value */ /* Reset library */ diff --git a/test/plugin.c b/test/plugin.c index 74a8f4b..49302d2 100644 --- a/test/plugin.c +++ b/test/plugin.c @@ -710,7 +710,7 @@ main(void) { char filename[FILENAME_BUF_SIZE]; hid_t file, fapl, fapl2; - hbool_t new_format; + unsigned new_format; int mdc_nelmts; size_t rdcc_nelmts; size_t rdcc_nbytes; diff --git a/test/set_extent.c b/test/set_extent.c index f6c3766..ae83ba2 100644 --- a/test/set_extent.c +++ b/test/set_extent.c @@ -116,8 +116,8 @@ int main( void ) { hid_t fapl; /* file access property list */ hid_t fapl2; /* file access property list w/latest format set */ - hbool_t new_format; /* Whether to use the latest file format */ - hbool_t chunk_cache; /* Whether to enable chunk caching */ + unsigned new_format; /* Whether to use the latest file format */ + unsigned chunk_cache; /* Whether to enable chunk caching */ int nerrors = 0; /* Initialize random number seed */ diff --git a/test/stab.c b/test/stab.c index 48b58b1..574678d 100644 --- a/test/stab.c +++ b/test/stab.c @@ -1168,7 +1168,7 @@ int main(void) { hid_t fapl, fapl2; /* File access property list IDs */ - hbool_t new_format; /* Whether to use the new format or not */ + unsigned new_format; /* Whether to use the new format or not */ int nerrors = 0; /* Reset library */ diff --git a/test/tattr.c b/test/tattr.c index 137c7c9..d3f7c01 100644 --- a/test/tattr.c +++ b/test/tattr.c @@ -5338,7 +5338,7 @@ test_attr_corder_delete(hid_t fcpl, hid_t fapl) hsize_t nattrs; /* Number of attributes on object */ hsize_t name_count; /* # of records in name index */ hsize_t corder_count; /* # of records in creation order index */ - hbool_t reopen_file; /* Whether to re-open the file before deleting group */ + unsigned reopen_file; /* Whether to re-open the file before deleting group */ char attrname[NAME_BUF_SIZE]; /* Name of attribute */ #ifdef LATER h5_stat_size_t empty_size; /* Size of empty file */ @@ -5687,7 +5687,7 @@ test_attr_info_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl) hsize_t nattrs; /* Number of attributes on object */ hsize_t name_count; /* # of records in name index */ hsize_t corder_count; /* # of records in creation order index */ - hbool_t use_index; /* Use index on creation order values */ + unsigned use_index; /* Use index on creation order values */ char attrname[NAME_BUF_SIZE]; /* Name of attribute */ char tmpname[NAME_BUF_SIZE]; /* Temporary attribute name */ unsigned curr_dset; /* Current dataset to work on */ @@ -5899,7 +5899,7 @@ test_attr_delete_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl) hsize_t corder_count; /* # of records in creation order index */ H5_index_t idx_type; /* Type of index to operate on */ H5_iter_order_t order; /* Order within in the index */ - hbool_t use_index; /* Use index on creation order values */ + unsigned use_index; /* Use index on creation order values */ char attrname[NAME_BUF_SIZE]; /* Name of attribute */ char tmpname[NAME_BUF_SIZE]; /* Temporary attribute name */ unsigned curr_dset; /* Current dataset to work on */ @@ -6842,7 +6842,7 @@ test_attr_iterate2(hbool_t new_format, hid_t fcpl, hid_t fapl) attr_iter_info_t iter_info; /* Iterator info */ hbool_t *visited = NULL; /* Array of flags for visiting links */ hsize_t idx; /* Start index for iteration */ - hbool_t use_index; /* Use index on creation order values */ + unsigned use_index; /* Use index on creation order values */ const char *dsetname; /* Name of dataset for attributes */ char attrname[NAME_BUF_SIZE]; /* Name of attribute */ unsigned curr_dset; /* Current dataset to work on */ @@ -7203,7 +7203,7 @@ test_attr_open_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl) hsize_t corder_count; /* # of records in creation order index */ H5_index_t idx_type; /* Type of index to operate on */ H5_iter_order_t order; /* Order within in the index */ - hbool_t use_index; /* Use index on creation order values */ + unsigned use_index; /* Use index on creation order values */ char attrname[NAME_BUF_SIZE]; /* Name of attribute */ unsigned curr_dset; /* Current dataset to work on */ unsigned u; /* Local index variable */ @@ -7549,7 +7549,7 @@ test_attr_open_by_name(hbool_t new_format, hid_t fcpl, hid_t fapl) hsize_t nattrs; /* Number of attributes on object */ hsize_t name_count; /* # of records in name index */ hsize_t corder_count; /* # of records in creation order index */ - hbool_t use_index; /* Use index on creation order values */ + unsigned use_index; /* Use index on creation order values */ const char *dsetname; /* Name of dataset for attributes */ char attrname[NAME_BUF_SIZE]; /* Name of attribute */ unsigned curr_dset; /* Current dataset to work on */ @@ -7804,7 +7804,7 @@ test_attr_create_by_name(hbool_t new_format, hid_t fcpl, hid_t fapl) hsize_t nattrs; /* Number of attributes on object */ hsize_t name_count; /* # of records in name index */ hsize_t corder_count; /* # of records in creation order index */ - hbool_t use_index; /* Use index on creation order values */ + unsigned use_index; /* Use index on creation order values */ const char *dsetname; /* Name of dataset for attributes */ char attrname[NAME_BUF_SIZE]; /* Name of attribute */ unsigned curr_dset; /* Current dataset to work on */ @@ -10568,8 +10568,8 @@ test_attr(void) { hid_t fapl = (-1), fapl2 = (-1); /* File access property lists */ hid_t fcpl = (-1), fcpl2 = (-1); /* File creation property lists */ - hbool_t new_format; /* Whether to use the new format or not */ - hbool_t use_shared; /* Whether to use shared attributes or not */ + unsigned new_format; /* Whether to use the new format or not */ + unsigned use_shared; /* Whether to use shared attributes or not */ herr_t ret; /* Generic return value */ /* Output message about test being performed */ diff --git a/test/tfile.c b/test/tfile.c index 52c8fd9..d8bcd54 100644 --- a/test/tfile.c +++ b/test/tfile.c @@ -3049,7 +3049,7 @@ test_filespace_info(void) char filename[FILENAME_LEN]; /* Filename to use */ H5F_file_space_type_t strategy, fs_type, def_type; /* File space handling strategy */ hsize_t threshold, fs_size, def_size; /* Free space section threshold */ - hbool_t new_format; /* new format or old format */ + unsigned new_format; /* new format or old format */ herr_t ret; /* return value */ /* Output message about test being performed */ @@ -3112,7 +3112,7 @@ test_filespace_info(void) /* Create the file with the specified file space info */ fid1 = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl1, my_fapl); - CHECK(ret, FAIL, "H5Fcreate"); + CHECK(fid1, FAIL, "H5Fcreate"); /* Close the file */ ret = H5Fclose(fid1); @@ -3120,7 +3120,7 @@ test_filespace_info(void) /* Re-open the file */ fid2 = H5Fopen(filename, H5F_ACC_RDWR, my_fapl); - CHECK(ret, FAIL, "H5Fopen"); + CHECK(fid2, FAIL, "H5Fopen"); /* Get the file's creation property */ fcpl2 = H5Fget_create_plist(fid2); diff --git a/test/th5o.c b/test/th5o.c index be3b4ab..71a486e 100644 --- a/test/th5o.c +++ b/test/th5o.c @@ -776,7 +776,7 @@ test_h5o_link(void) hid_t lcpl_id=-1; hsize_t dims[2] = {TEST6_DIM1, TEST6_DIM2}; htri_t committed; /* Whether the named datatype is committed */ - hbool_t new_format; /* Whether to use the new format or not */ + unsigned new_format; /* Whether to use the new format or not */ int wdata[TEST6_DIM1][TEST6_DIM2]; int rdata[TEST6_DIM1][TEST6_DIM2]; int i, n, j; diff --git a/test/titerate.c b/test/titerate.c index fff13f1..f00858f 100644 --- a/test/titerate.c +++ b/test/titerate.c @@ -919,7 +919,7 @@ void test_iterate(void) { hid_t fapl, fapl2; /* File access property lists */ - hbool_t new_format; /* Whether to use the new format or not */ + unsigned new_format; /* Whether to use the new format or not */ herr_t ret; /* Generic return value */ /* Output message about test being performed */ diff --git a/test/tmisc.c b/test/tmisc.c index 11c6de7..796464f 100644 --- a/test/tmisc.c +++ b/test/tmisc.c @@ -5163,7 +5163,7 @@ static void test_misc30(void) { hsize_t file_size[] = {0, 0}; /* Sizes of file created */ - hbool_t get_info; /* Whether to perform the get info call */ + unsigned get_info; /* Whether to perform the get info call */ /* Output message about test being performed */ MESSAGE(5, ("Local heap dropping free block info\n")); diff --git a/test/unlink.c b/test/unlink.c index 993a7ec..07af800 100644 --- a/test/unlink.c +++ b/test/unlink.c @@ -2443,7 +2443,7 @@ main(void) hid_t fapl, fapl2, file; int nerrors = 0; char filename[1024]; - hbool_t new_format; + unsigned new_format; /* Metadata cache parameters */ int mdc_nelmts; diff --git a/tools/perform/pio_standalone.h b/tools/perform/pio_standalone.h index 584a057..762a564 100644 --- a/tools/perform/pio_standalone.h +++ b/tools/perform/pio_standalone.h @@ -105,10 +105,10 @@ typedef off_t h5_stat_size_t; * HDF Boolean type. */ #ifndef FALSE -# define FALSE 0 +# define FALSE false #endif #ifndef TRUE -# define TRUE 1 +# define TRUE true #endif diff --git a/tools/perform/sio_standalone.h b/tools/perform/sio_standalone.h index 4eb1ded..8176745 100644 --- a/tools/perform/sio_standalone.h +++ b/tools/perform/sio_standalone.h @@ -482,10 +482,10 @@ extern char *strdup(const char *s); * HDF Boolean type. */ #ifndef FALSE -# define FALSE 0 +# define FALSE false #endif #ifndef TRUE -# define TRUE 1 +# define TRUE true #endif /** From h5test.h **/ -- cgit v0.12 From ab7d724ffd5749c1e3666fd1be0b92f41613af1e Mon Sep 17 00:00:00 2001 From: Jerome Soumagne Date: Fri, 21 Aug 2015 17:44:22 -0500 Subject: [svn-r27548] Revert r27545 --- config/cmake/H5pubconf.h.in | 6 -- config/cmake_ext_mod/ConfigureChecks.cmake | 13 --- configure | 55 ------------ configure.ac | 12 --- src/H5Pgcpl.c | 2 +- src/H5T.c | 2 +- src/H5config.h.in | 6 -- src/H5private.h | 4 +- src/H5public.h | 15 +--- test/btree2.c | 2 +- test/cache_api.c | 140 +++++++++++++++++++++-------- test/dsets.c | 2 +- test/dtypes.c | 4 +- test/fillval.c | 2 +- test/links.c | 22 ++--- test/mf.c | 4 +- test/objcopy.c | 2 +- test/ohdr.c | 2 +- test/plugin.c | 2 +- test/set_extent.c | 4 +- test/stab.c | 2 +- test/tattr.c | 18 ++-- test/tfile.c | 6 +- test/th5o.c | 2 +- test/titerate.c | 2 +- test/tmisc.c | 2 +- test/unlink.c | 2 +- tools/perform/pio_standalone.h | 4 +- tools/perform/sio_standalone.h | 4 +- 29 files changed, 154 insertions(+), 189 deletions(-) diff --git a/config/cmake/H5pubconf.h.in b/config/cmake/H5pubconf.h.in index bbc1b95..37bcfbf 100644 --- a/config/cmake/H5pubconf.h.in +++ b/config/cmake/H5pubconf.h.in @@ -581,12 +581,6 @@ /* The size of `__int64', as computed by sizeof. */ #define H5_SIZEOF___INT64 @H5_SIZEOF___INT64@ -/* Define to 1 if you have the header file. */ -#cmakedefine H5_HAVE_STDBOOL_H @H5_HAVE_STDBOOL_H@ - -/* The size of `bool', as computed by sizeof. */ -#cmakedefine H5_SIZEOF_BOOL @H5_SIZEOF_BOOL@ - /* Define to 1 if you have the ANSI C header files. */ #cmakedefine H5_STDC_HEADERS @H5_STDC_HEADERS@ diff --git a/config/cmake_ext_mod/ConfigureChecks.cmake b/config/cmake_ext_mod/ConfigureChecks.cmake index f58c435..e058b10 100644 --- a/config/cmake_ext_mod/ConfigureChecks.cmake +++ b/config/cmake_ext_mod/ConfigureChecks.cmake @@ -427,19 +427,6 @@ if (NOT ${HDF_PREFIX}_SIZEOF_OFF64_T) set (${HDF_PREFIX}_SIZEOF_OFF64_T 0) endif (NOT ${HDF_PREFIX}_SIZEOF_OFF64_T) -#----------------------------------------------------------------------------- -# Extra C99 types -#----------------------------------------------------------------------------- - -# _Bool type support -CHECK_INCLUDE_FILE_CONCAT (stdbool.h ${HDF_PREFIX}_HAVE_STDBOOL_H) -if (HAVE_STDBOOL_H) - set (CMAKE_EXTRA_INCLUDE_FILES stdbool.h) - HDF_CHECK_TYPE_SIZE (bool ${HDF_PREFIX}_SIZEOF_BOOL) -else (HAVE_STDBOOL_H) - HDF_CHECK_TYPE_SIZE (_Bool ${HDF_PREFIX}_SIZEOF_BOOL) -endif (HAVE_STDBOOL_H) - if (NOT WINDOWS) #----------------------------------------------------------------------------- # Check if the dev_t type is a scalar type diff --git a/configure b/configure index 55ade2f..42e9b81 100755 --- a/configure +++ b/configure @@ -23373,18 +23373,6 @@ fi done -for ac_header in stdbool.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "stdbool.h" "ac_cv_header_stdbool_h" "$ac_includes_default" -if test "x$ac_cv_header_stdbool_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_STDBOOL_H 1 -_ACEOF - -fi - -done - ## Darwin for ac_header in mach/mach_time.h @@ -24975,49 +24963,6 @@ _ACEOF -if test "X$C9x" = "Xyes"; then - cat >>confdefs.h <<\EOF -#ifdef HAVE_STDBOOL_H -#include /* for bool definition */ -#else -#define bool _Bool -#endif -EOF -# The cast to long int works around a bug in the HP C Compiler -# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. -# This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of bool" >&5 -$as_echo_n "checking size of bool... " >&6; } -if ${ac_cv_sizeof_bool+:} false; then : - $as_echo_n "(cached) " >&6 -else - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (bool))" "ac_cv_sizeof_bool" "$ac_includes_default"; then : - -else - if test "$ac_cv_type_bool" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error 77 "cannot compute sizeof (bool) -See \`config.log' for more details" "$LINENO" 5; } - else - ac_cv_sizeof_bool=0 - fi -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_bool" >&5 -$as_echo "$ac_cv_sizeof_bool" >&6; } - - - -cat >>confdefs.h <<_ACEOF -#define SIZEOF_BOOL $ac_cv_sizeof_bool -_ACEOF - - -fi - ## Checkpoint the cache cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure diff --git a/configure.ac b/configure.ac index ca25fd9..88d037c 100644 --- a/configure.ac +++ b/configure.ac @@ -982,7 +982,6 @@ AC_CHECK_HEADERS([sys/socket.h sys/types.h]) AC_CHECK_HEADERS([stddef.h setjmp.h features.h]) AC_CHECK_HEADERS([dirent.h]) AC_CHECK_HEADERS([stdint.h], [C9x=yes]) -AC_CHECK_HEADERS([stdbool.h]) ## Darwin AC_CHECK_HEADERS([mach/mach_time.h]) @@ -1190,17 +1189,6 @@ EOF AC_CHECK_SIZEOF([off_t], [4]) AC_CHECK_SIZEOF([off64_t], [8]) -if test "X$C9x" = "Xyes"; then - cat >>confdefs.h <<\EOF -#ifdef HAVE_STDBOOL_H -#include /* for bool definition */ -#else -#define bool _Bool -#endif -EOF -AC_CHECK_SIZEOF([bool], [1]) -fi - ## Checkpoint the cache AC_CACHE_SAVE diff --git a/src/H5Pgcpl.c b/src/H5Pgcpl.c index e33fb6e..1e3a278 100644 --- a/src/H5Pgcpl.c +++ b/src/H5Pgcpl.c @@ -690,7 +690,7 @@ H5P__gcrt_link_info_dec(const void **_pp, void *_value) HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "unsigned value can't be decoded") /* Set property to default value */ - memcpy(linfo, &H5G_def_linfo_g, sizeof(H5O_linfo_t)); + *linfo = H5G_def_linfo_g; H5_DECODE_UNSIGNED(*pp, crt_order_flags) diff --git a/src/H5T.c b/src/H5T.c index 977ac22..5f6c8e3 100644 --- a/src/H5T.c +++ b/src/H5T.c @@ -850,7 +850,7 @@ H5T_init_interface(void) H5T_INIT_TYPE(OFFSET,H5T_NATIVE_HERR_g,COPY,native_int,SET,sizeof(herr_t)) /* hbool_t */ - H5T_INIT_TYPE(OFFSET,H5T_NATIVE_HBOOL_g,COPY,native_uint,SET,sizeof(hbool_t)) + H5T_INIT_TYPE(OFFSET,H5T_NATIVE_HBOOL_g,COPY,native_int,SET,sizeof(hbool_t)) /*------------------------------------------------------------ * IEEE Types diff --git a/src/H5config.h.in b/src/H5config.h.in index 96e2df5..ad8dcf9 100644 --- a/src/H5config.h.in +++ b/src/H5config.h.in @@ -293,9 +293,6 @@ /* Define if `struct stat' has the `st_blocks' field */ #undef HAVE_STAT_ST_BLOCKS -/* Define to 1 if you have the header file. */ -#undef HAVE_STDBOOL_H - /* Define to 1 if you have the header file. */ #undef HAVE_STDDEF_H @@ -472,9 +469,6 @@ /* Width for printf() for type `long long' or `__int64', use `ll' */ #undef PRINTF_LL_WIDTH -/* The size of `bool', as computed by sizeof. */ -#undef SIZEOF_BOOL - /* The size of `char', as computed by sizeof. */ #undef SIZEOF_CHAR diff --git a/src/H5private.h b/src/H5private.h index b0880a1..9efd145 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -353,10 +353,10 @@ * HDF Boolean type. */ #ifndef FALSE - #define FALSE false +# define FALSE 0 #endif #ifndef TRUE - #define TRUE true +# define TRUE 1 #endif /* diff --git a/src/H5public.h b/src/H5public.h index 858e67f..1b3711b 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -141,20 +141,7 @@ typedef int herr_t; * printf("error determining whether data type is committed\n"); * } */ -#ifdef H5_HAVE_STDBOOL_H - #include -#else /* H5_HAVE_STDBOOL_H */ - #ifndef __cplusplus - #if defined(H5_SIZEOF_BOOL) && (H5_SIZEOF_BOOL != 0) - #define bool _Bool - #else - #define bool unsigned int - #endif - #define true 1 - #define false 0 - #endif /* __cplusplus */ -#endif /* H5_HAVE_STDBOOL_H */ -typedef bool hbool_t; +typedef unsigned int hbool_t; typedef int htri_t; /* Define the ssize_t type if it not is defined */ diff --git a/test/btree2.c b/test/btree2.c index a59861f..d8abc84 100644 --- a/test/btree2.c +++ b/test/btree2.c @@ -7625,7 +7625,7 @@ main(void) bt2_test_param_t tparam; /* Test parameters for v2 B-tree */ hid_t fapl = -1; /* File access property list for data files */ unsigned nerrors = 0; /* Cumulative error count */ - unsigned reopen; /* Whether to reopen B-tree during tests */ + hbool_t reopen; /* Whether to reopen B-tree during tests */ int ExpressMode; const char *envval = NULL; diff --git a/test/cache_api.c b/test/cache_api.c index bebb828..1697884 100644 --- a/test/cache_api.c +++ b/test/cache_api.c @@ -1530,7 +1530,7 @@ mdc_api_call_smoke_check(int express_test) * Note: It is assumed that boolean parameters are only set to TRUE/FALSE. */ -#define NUM_INVALID_CONFIGS 36 +#define NUM_INVALID_CONFIGS 42 H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = { @@ -1605,7 +1605,42 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 2 -- max_size too big */ + /* 2 -- bad set_initial_size */ + /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, + /* hbool_t rpt_fcn_enabled = */ FALSE, + /* hbool_t open_trace_file = */ FALSE, + /* hbool_t close_trace_file = */ FALSE, + /* char trace_file_name[] = */ "", + /* hbool_t evictions_enabled = */ TRUE, + /* hbool_t set_initial_size = */ 2, + /* size_t initial_size = */ (1 * 1024 * 1024), + /* double min_clean_fraction = */ 0.25f, + /* size_t max_size = */ (16 * 1024 * 1024), + /* size_t min_size = */ ( 1 * 1024 * 1024), + /* long int epoch_length = */ 50000, + /* enum H5C_cache_incr_mode incr_mode = */ H5C_incr__threshold, + /* double lower_hr_threshold = */ 0.9f, + /* double increment = */ 2.0f, + /* hbool_t apply_max_increment = */ TRUE, + /* size_t max_increment = */ (4 * 1024 * 1024), + /* enum H5C_cache_flash_incr_mode */ + /* flash_incr_mode = */ H5C_flash_incr__off, + /* double flash_multiple = */ 2.0f, + /* double flash_threshold = */ 0.5f, + /* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__age_out_with_threshold, + /* double upper_hr_threshold = */ 0.999f, + /* double decrement = */ 0.9f, + /* hbool_t apply_max_decrement = */ TRUE, + /* size_t max_decrement = */ (1 * 1024 * 1024), + /* int epochs_before_eviction = */ 3, + /* hbool_t apply_empty_reserve = */ TRUE, + /* double empty_reserve = */ 0.1f, + /* int dirty_bytes_threshold = */ (256 * 1024), + /* int metadata_write_strategy = */ + H5AC__DEFAULT_METADATA_WRITE_STRATEGY + }, + { + /* 3 -- max_size too big */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -1640,7 +1675,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 3 -- min_size too small */ + /* 4 -- min_size too small */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -1675,7 +1710,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 4 -- min_size > max_size */ + /* 5 -- min_size > max_size */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -1710,7 +1745,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 5 -- initial size out of range (too big) */ + /* 6 -- initial size out of range (too big) */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -1745,7 +1780,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 6 -- initial_size out of range (too small) */ + /* 7 -- initial_size out of range (too small) */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -1780,7 +1815,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 7 -- min_clean_fraction too big */ + /* 8 -- min_clean_fraction too big */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -1815,7 +1850,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 8 -- min_clean_fraction too small */ + /* 9 -- min_clean_fraction too small */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -1850,7 +1885,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 9 -- epoch_length too small */ + /* 10 -- epoch_length too small */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -1885,7 +1920,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 10 -- epoch_length too big */ + /* 11 -- epoch_length too big */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -1920,7 +1955,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 11 -- invalid incr_mode */ + /* 12 -- invalid incr_mode */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -1955,7 +1990,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 12 -- lower_hr_threshold too small */ + /* 13 -- lower_hr_threshold too small */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -1990,7 +2025,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 13 -- lower_hr_threshold too big */ + /* 14 -- lower_hr_threshold too big */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -2025,7 +2060,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 14 -- increment too small */ + /* 15 -- increment too small */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -2060,7 +2095,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 15 -- invalid flash_incr_mode */ + /* 16 -- invalid flash_incr_mode */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -2095,7 +2130,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 16 -- flash_multiple too small */ + /* 17 -- flash_multiple too small */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -2130,7 +2165,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 17 -- flash_multiple too big */ + /* 18 -- flash_multiple too big */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -2165,7 +2200,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 18 -- flash_threshold too small */ + /* 19 -- flash_threshold too small */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -2200,7 +2235,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 19 -- flash_threshold too big */ + /* 20 -- flash_threshold too big */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -2235,7 +2270,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 20 -- bad decr_mode */ + /* 21 -- bad decr_mode */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -2270,7 +2305,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 21 -- upper_hr_threshold too big */ + /* 22 -- upper_hr_threshold too big */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -2305,7 +2340,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 22 -- decrement too small */ + /* 23 -- decrement too small */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -2340,7 +2375,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 23 -- decrement too big */ + /* 24 -- decrement too big */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -2375,7 +2410,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 24 -- epochs_before_eviction too small */ + /* 25 -- epochs_before_eviction too small */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -2410,7 +2445,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 25 -- epochs_before_eviction too big */ + /* 26 -- epochs_before_eviction too big */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -2445,7 +2480,42 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 26 -- empty_reserve too small */ + /* 27 -- invalid apply_empty_reserve */ + /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, + /* hbool_t rpt_fcn_enabled = */ FALSE, + /* hbool_t open_trace_file = */ FALSE, + /* hbool_t close_trace_file = */ FALSE, + /* char trace_file_name[] = */ "", + /* hbool_t evictions_enabled = */ TRUE, + /* hbool_t set_initial_size = */ TRUE, + /* size_t initial_size = */ (1 * 1024 * 1024), + /* double min_clean_fraction = */ 0.25f, + /* size_t max_size = */ (16 * 1024 * 1024), + /* size_t min_size = */ ( 1 * 1024 * 1024), + /* long int epoch_length = */ 50000, + /* enum H5C_cache_incr_mode incr_mode = */ H5C_incr__threshold, + /* double lower_hr_threshold = */ 0.9f, + /* double increment = */ 2.0f, + /* hbool_t apply_max_increment = */ TRUE, + /* size_t max_increment = */ (4 * 1024 * 1024), + /* enum H5C_cache_flash_incr_mode */ + /* flash_incr_mode = */ H5C_flash_incr__off, + /* double flash_multiple = */ 2.0f, + /* double flash_threshold = */ 0.5f, + /* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__age_out_with_threshold, + /* double upper_hr_threshold = */ 0.999f, + /* double decrement = */ 0.9f, + /* hbool_t apply_max_decrement = */ TRUE, + /* size_t max_decrement = */ (1 * 1024 * 1024), + /* int epochs_before_eviction = */ 3, + /* hbool_t apply_empty_reserve = */ 2, + /* double empty_reserve = */ 0.1f, + /* int dirty_bytes_threshold = */ (256 * 1024), + /* int metadata_write_strategy = */ + H5AC__DEFAULT_METADATA_WRITE_STRATEGY + }, + { + /* 28 -- empty_reserve too small */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -2480,7 +2550,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 27 -- empty_reserve too big */ + /* 29 -- empty_reserve too big */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -2515,7 +2585,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 28 -- upper_hr_threshold too small */ + /* 30 -- upper_hr_threshold too small */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -2550,7 +2620,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 29 -- upper_hr_threshold too big */ + /* 31 -- upper_hr_threshold too big */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -2585,7 +2655,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 30 -- upper_hr_threshold <= lower_hr_threshold */ + /* 32 -- upper_hr_threshold <= lower_hr_threshold */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -2620,7 +2690,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 31 -- dirty_bytes_threshold too small */ + /* 33 -- dirty_bytes_threshold too small */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -2655,7 +2725,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 32 -- dirty_bytes_threshold too big */ + /* 34 -- dirty_bytes_threshold too big */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -2690,7 +2760,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 33 -- attempt to disable evictions when auto incr enabled */ + /* 35 -- attempt to disable evictions when auto incr enabled */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -2725,7 +2795,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 34 -- attempt to disable evictions when auto decr enabled */ + /* 36 -- attempt to disable evictions when auto decr enabled */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -2760,7 +2830,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 35 -- unknown metadata write strategy */ + /* 37 -- unknown metadata write strategy */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, diff --git a/test/dsets.c b/test/dsets.c index 1dd17f7..e6b2ee4 100644 --- a/test/dsets.c +++ b/test/dsets.c @@ -9033,7 +9033,7 @@ main(void) { char filename[FILENAME_BUF_SIZE]; hid_t file, grp, fapl, fapl2; - unsigned new_format; + hbool_t new_format; int mdc_nelmts; size_t rdcc_nelmts; size_t rdcc_nbytes; diff --git a/test/dtypes.c b/test/dtypes.c index 3b95d41..59cf000 100644 --- a/test/dtypes.c +++ b/test/dtypes.c @@ -6658,7 +6658,7 @@ test_delete_obj_named(hid_t fapl) hid_t attr = -1; /* Attribute ID */ hid_t dset = -1; /* Dataset ID */ hid_t fapl2 = -1; /* File access property list ID */ - unsigned new_format; /* Whether to use old or new format */ + hbool_t new_format; /* Whether to use old or new format */ char filename[1024], filename2[1024]; TESTING("deleting objects that use named datatypes"); @@ -6753,7 +6753,7 @@ test_delete_obj_named_fileid(hid_t fapl) hid_t attr = -1; /* Attribute ID */ hid_t dset = -1; /* Dataset ID */ hid_t fapl2 = -1; /* File access property list ID */ - unsigned new_format; /* Whether to use old or new format */ + hbool_t new_format; /* Whether to use old or new format */ char filename[1024], filename2[1024]; TESTING("deleting objects that use named datatypes"); diff --git a/test/fillval.c b/test/fillval.c index c0ce76b..c791504 100644 --- a/test/fillval.c +++ b/test/fillval.c @@ -2368,7 +2368,7 @@ main(int argc, char *argv[]) { int nerrors=0, argno, test_contig=1, test_chunk=1, test_compact=1; hid_t fapl = (-1), fapl2 = (-1); /* File access property lists */ - unsigned new_format; /* Whether to use the new format or not */ + hbool_t new_format; /* Whether to use the new format or not */ if(argc >= 2) { test_contig = test_chunk = test_compact = 0; diff --git a/test/links.c b/test/links.c index 81b2ce0..cfbc4a1 100644 --- a/test/links.c +++ b/test/links.c @@ -10714,7 +10714,7 @@ corder_delete(hid_t fapl) unsigned min_dense; /* Minimum # of links to store in group "densely" */ hsize_t name_count; /* # of records in name index */ hsize_t corder_count; /* # of records in creation order index */ - unsigned reopen_file; /* Whether to re-open the file before deleting group */ + hbool_t reopen_file; /* Whether to re-open the file before deleting group */ h5_stat_size_t empty_size; /* Size of empty file */ h5_stat_size_t file_size; /* Size of file after operating on it */ char objname[NAME_BUF_SIZE]; /* Object name */ @@ -10995,8 +10995,8 @@ link_info_by_idx(hid_t fapl) hid_t file_id = (-1); /* File ID */ hid_t group_id = (-1); /* Group ID */ hid_t gcpl_id = (-1); /* Group creation property list ID */ - unsigned hard_link; /* Create hard or soft link? */ - unsigned use_index; /* Use index on creation order values */ + hbool_t hard_link; /* Create hard or soft link? */ + hbool_t use_index; /* Use index on creation order values */ unsigned max_compact; /* Maximum # of links to store in group compactly */ unsigned min_dense; /* Minimum # of links to store in group "densely" */ H5L_info_t linfo; /* Link info struct */ @@ -11178,7 +11178,7 @@ link_info_by_idx_old(hid_t fapl) { hid_t file_id = (-1); /* File ID */ hid_t group_id = (-1), group_id2 = (-1); /* Group IDs */ - unsigned hard_link; /* Create hard or soft link? */ + hbool_t hard_link; /* Create hard or soft link? */ H5L_info_t linfo; /* Link info struct */ char objname[NAME_BUF_SIZE]; /* Object name */ char valname[NAME_BUF_SIZE]; /* Link value name */ @@ -11347,7 +11347,7 @@ delete_by_idx(hid_t fapl) hid_t gcpl_id = (-1); /* Group creation property list ID */ H5_index_t idx_type; /* Type of index to operate on */ H5_iter_order_t order; /* Order within in the index */ - unsigned use_index; /* Use index on creation order values */ + hbool_t use_index; /* Use index on creation order values */ unsigned max_compact; /* Maximum # of links to store in group compactly */ unsigned min_dense; /* Minimum # of links to store in group "densely" */ H5L_info_t linfo; /* Link info struct */ @@ -12180,7 +12180,7 @@ link_iterate(hid_t fapl) hid_t gcpl_id = (-1); /* Group creation property list ID */ H5_index_t idx_type; /* Type of index to operate on */ H5_iter_order_t order; /* Order within in the index */ - unsigned use_index; /* Use index on creation order values */ + hbool_t use_index; /* Use index on creation order values */ unsigned max_compact; /* Maximum # of links to store in group compactly */ unsigned min_dense; /* Minimum # of links to store in group "densely" */ char objname[NAME_BUF_SIZE]; /* Object name */ @@ -12866,7 +12866,7 @@ open_by_idx(hid_t fapl) hid_t gcpl_id = (-1); /* Group creation property list ID */ H5_index_t idx_type; /* Type of index to operate on */ H5_iter_order_t order; /* Order within in the index */ - unsigned use_index; /* Use index on creation order values */ + hbool_t use_index; /* Use index on creation order values */ unsigned max_compact; /* Maximum # of links to store in group compactly */ unsigned min_dense; /* Minimum # of links to store in group "densely" */ H5O_info_t oi; /* Buffer for querying object's info */ @@ -13302,7 +13302,7 @@ object_info(hid_t fapl) hid_t space_id = (-1); /* Dataspace ID (for attributes) */ H5_index_t idx_type; /* Type of index to operate on */ H5_iter_order_t order; /* Order within in the index */ - unsigned use_index; /* Use index on creation order values */ + hbool_t use_index; /* Use index on creation order values */ unsigned max_compact; /* Maximum # of links to store in group compactly */ unsigned min_dense; /* Minimum # of links to store in group "densely" */ H5O_info_t oinfo; /* Buffer for querying object's info */ @@ -13698,7 +13698,7 @@ group_info(hid_t fapl) hid_t gcpl_id = (-1); /* Group creation property list ID */ H5_index_t idx_type; /* Type of index to operate on */ H5_iter_order_t order; /* Order within in the index */ - unsigned use_index; /* Use index on creation order values */ + hbool_t use_index; /* Use index on creation order values */ unsigned max_compact; /* Maximum # of links to store in group compactly */ unsigned min_dense; /* Minimum # of links to store in group "densely" */ H5G_info_t grp_info; /* Buffer for querying object's info */ @@ -14509,8 +14509,8 @@ main(void) { hid_t fapl, fapl2; /* File access property lists */ int nerrors = 0; - unsigned new_format; /* Whether to use the new format or not */ - unsigned efc; /* Whether to use the external file cache */ + hbool_t new_format; /* Whether to use the new format or not */ + hbool_t efc; /* Whether to use the external file cache */ const char *env_h5_drvr; /* File Driver value from environment */ env_h5_drvr = HDgetenv("HDF5_DRIVER"); diff --git a/test/mf.c b/test/mf.c index e306f98..67ebc4e 100644 --- a/test/mf.c +++ b/test/mf.c @@ -6802,7 +6802,7 @@ test_mf_fs_drivers(hid_t fapl) hid_t fcpl = -1; /* file creation property list */ hid_t fapl_new = -1; /* copy of file access property list */ hid_t fapl2 = -1; /* copy of file access property list */ - unsigned new_format; /* To use new library format or not */ + hbool_t new_format; /* To use new library format or not */ unsigned ret = 0; /* return value */ H5FD_mem_t memb_map[H5FD_MEM_NTYPES]; /* Memory usage map */ @@ -7227,7 +7227,7 @@ test_filespace_drivers(hid_t fapl) { hid_t fapl_new = -1; /* copy of file access property list */ hid_t fapl2 = -1; /* copy of file access property list */ - unsigned new_format; /* Using library new format or not */ + hbool_t new_format; /* Using library new format or not */ unsigned ret = 0; /* return value */ H5FD_mem_t memb_map[H5FD_MEM_NTYPES]; /* Memory usage map */ diff --git a/test/objcopy.c b/test/objcopy.c index 5e7d90c..e84e70c 100644 --- a/test/objcopy.c +++ b/test/objcopy.c @@ -12318,7 +12318,7 @@ main(void) /* Tests that do not use attributes and do not need to be tested * multiple times for different attribute configurations */ if(configuration < CONFIG_DENSE) { - unsigned reopen; + hbool_t reopen; nerrors += test_copy_named_datatype(fcpl_src, fcpl_dst, src_fapl, dst_fapl); nerrors += test_copy_named_datatype_vl(fcpl_src, fcpl_dst, src_fapl, dst_fapl); diff --git a/test/ohdr.c b/test/ohdr.c index ade01e7..45f2238 100644 --- a/test/ohdr.c +++ b/test/ohdr.c @@ -321,7 +321,7 @@ main(void) time_t time_new, ro; int chunkno; /* Chunk index for message */ int i; /* Local index variable */ - unsigned b; /* Index for "new format" loop */ + hbool_t b; /* Index for "new format" loop */ herr_t ret; /* Generic return value */ /* Reset library */ diff --git a/test/plugin.c b/test/plugin.c index 49302d2..74a8f4b 100644 --- a/test/plugin.c +++ b/test/plugin.c @@ -710,7 +710,7 @@ main(void) { char filename[FILENAME_BUF_SIZE]; hid_t file, fapl, fapl2; - unsigned new_format; + hbool_t new_format; int mdc_nelmts; size_t rdcc_nelmts; size_t rdcc_nbytes; diff --git a/test/set_extent.c b/test/set_extent.c index ae83ba2..f6c3766 100644 --- a/test/set_extent.c +++ b/test/set_extent.c @@ -116,8 +116,8 @@ int main( void ) { hid_t fapl; /* file access property list */ hid_t fapl2; /* file access property list w/latest format set */ - unsigned new_format; /* Whether to use the latest file format */ - unsigned chunk_cache; /* Whether to enable chunk caching */ + hbool_t new_format; /* Whether to use the latest file format */ + hbool_t chunk_cache; /* Whether to enable chunk caching */ int nerrors = 0; /* Initialize random number seed */ diff --git a/test/stab.c b/test/stab.c index 574678d..48b58b1 100644 --- a/test/stab.c +++ b/test/stab.c @@ -1168,7 +1168,7 @@ int main(void) { hid_t fapl, fapl2; /* File access property list IDs */ - unsigned new_format; /* Whether to use the new format or not */ + hbool_t new_format; /* Whether to use the new format or not */ int nerrors = 0; /* Reset library */ diff --git a/test/tattr.c b/test/tattr.c index d3f7c01..137c7c9 100644 --- a/test/tattr.c +++ b/test/tattr.c @@ -5338,7 +5338,7 @@ test_attr_corder_delete(hid_t fcpl, hid_t fapl) hsize_t nattrs; /* Number of attributes on object */ hsize_t name_count; /* # of records in name index */ hsize_t corder_count; /* # of records in creation order index */ - unsigned reopen_file; /* Whether to re-open the file before deleting group */ + hbool_t reopen_file; /* Whether to re-open the file before deleting group */ char attrname[NAME_BUF_SIZE]; /* Name of attribute */ #ifdef LATER h5_stat_size_t empty_size; /* Size of empty file */ @@ -5687,7 +5687,7 @@ test_attr_info_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl) hsize_t nattrs; /* Number of attributes on object */ hsize_t name_count; /* # of records in name index */ hsize_t corder_count; /* # of records in creation order index */ - unsigned use_index; /* Use index on creation order values */ + hbool_t use_index; /* Use index on creation order values */ char attrname[NAME_BUF_SIZE]; /* Name of attribute */ char tmpname[NAME_BUF_SIZE]; /* Temporary attribute name */ unsigned curr_dset; /* Current dataset to work on */ @@ -5899,7 +5899,7 @@ test_attr_delete_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl) hsize_t corder_count; /* # of records in creation order index */ H5_index_t idx_type; /* Type of index to operate on */ H5_iter_order_t order; /* Order within in the index */ - unsigned use_index; /* Use index on creation order values */ + hbool_t use_index; /* Use index on creation order values */ char attrname[NAME_BUF_SIZE]; /* Name of attribute */ char tmpname[NAME_BUF_SIZE]; /* Temporary attribute name */ unsigned curr_dset; /* Current dataset to work on */ @@ -6842,7 +6842,7 @@ test_attr_iterate2(hbool_t new_format, hid_t fcpl, hid_t fapl) attr_iter_info_t iter_info; /* Iterator info */ hbool_t *visited = NULL; /* Array of flags for visiting links */ hsize_t idx; /* Start index for iteration */ - unsigned use_index; /* Use index on creation order values */ + hbool_t use_index; /* Use index on creation order values */ const char *dsetname; /* Name of dataset for attributes */ char attrname[NAME_BUF_SIZE]; /* Name of attribute */ unsigned curr_dset; /* Current dataset to work on */ @@ -7203,7 +7203,7 @@ test_attr_open_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl) hsize_t corder_count; /* # of records in creation order index */ H5_index_t idx_type; /* Type of index to operate on */ H5_iter_order_t order; /* Order within in the index */ - unsigned use_index; /* Use index on creation order values */ + hbool_t use_index; /* Use index on creation order values */ char attrname[NAME_BUF_SIZE]; /* Name of attribute */ unsigned curr_dset; /* Current dataset to work on */ unsigned u; /* Local index variable */ @@ -7549,7 +7549,7 @@ test_attr_open_by_name(hbool_t new_format, hid_t fcpl, hid_t fapl) hsize_t nattrs; /* Number of attributes on object */ hsize_t name_count; /* # of records in name index */ hsize_t corder_count; /* # of records in creation order index */ - unsigned use_index; /* Use index on creation order values */ + hbool_t use_index; /* Use index on creation order values */ const char *dsetname; /* Name of dataset for attributes */ char attrname[NAME_BUF_SIZE]; /* Name of attribute */ unsigned curr_dset; /* Current dataset to work on */ @@ -7804,7 +7804,7 @@ test_attr_create_by_name(hbool_t new_format, hid_t fcpl, hid_t fapl) hsize_t nattrs; /* Number of attributes on object */ hsize_t name_count; /* # of records in name index */ hsize_t corder_count; /* # of records in creation order index */ - unsigned use_index; /* Use index on creation order values */ + hbool_t use_index; /* Use index on creation order values */ const char *dsetname; /* Name of dataset for attributes */ char attrname[NAME_BUF_SIZE]; /* Name of attribute */ unsigned curr_dset; /* Current dataset to work on */ @@ -10568,8 +10568,8 @@ test_attr(void) { hid_t fapl = (-1), fapl2 = (-1); /* File access property lists */ hid_t fcpl = (-1), fcpl2 = (-1); /* File creation property lists */ - unsigned new_format; /* Whether to use the new format or not */ - unsigned use_shared; /* Whether to use shared attributes or not */ + hbool_t new_format; /* Whether to use the new format or not */ + hbool_t use_shared; /* Whether to use shared attributes or not */ herr_t ret; /* Generic return value */ /* Output message about test being performed */ diff --git a/test/tfile.c b/test/tfile.c index d8bcd54..52c8fd9 100644 --- a/test/tfile.c +++ b/test/tfile.c @@ -3049,7 +3049,7 @@ test_filespace_info(void) char filename[FILENAME_LEN]; /* Filename to use */ H5F_file_space_type_t strategy, fs_type, def_type; /* File space handling strategy */ hsize_t threshold, fs_size, def_size; /* Free space section threshold */ - unsigned new_format; /* new format or old format */ + hbool_t new_format; /* new format or old format */ herr_t ret; /* return value */ /* Output message about test being performed */ @@ -3112,7 +3112,7 @@ test_filespace_info(void) /* Create the file with the specified file space info */ fid1 = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl1, my_fapl); - CHECK(fid1, FAIL, "H5Fcreate"); + CHECK(ret, FAIL, "H5Fcreate"); /* Close the file */ ret = H5Fclose(fid1); @@ -3120,7 +3120,7 @@ test_filespace_info(void) /* Re-open the file */ fid2 = H5Fopen(filename, H5F_ACC_RDWR, my_fapl); - CHECK(fid2, FAIL, "H5Fopen"); + CHECK(ret, FAIL, "H5Fopen"); /* Get the file's creation property */ fcpl2 = H5Fget_create_plist(fid2); diff --git a/test/th5o.c b/test/th5o.c index 71a486e..be3b4ab 100644 --- a/test/th5o.c +++ b/test/th5o.c @@ -776,7 +776,7 @@ test_h5o_link(void) hid_t lcpl_id=-1; hsize_t dims[2] = {TEST6_DIM1, TEST6_DIM2}; htri_t committed; /* Whether the named datatype is committed */ - unsigned new_format; /* Whether to use the new format or not */ + hbool_t new_format; /* Whether to use the new format or not */ int wdata[TEST6_DIM1][TEST6_DIM2]; int rdata[TEST6_DIM1][TEST6_DIM2]; int i, n, j; diff --git a/test/titerate.c b/test/titerate.c index f00858f..fff13f1 100644 --- a/test/titerate.c +++ b/test/titerate.c @@ -919,7 +919,7 @@ void test_iterate(void) { hid_t fapl, fapl2; /* File access property lists */ - unsigned new_format; /* Whether to use the new format or not */ + hbool_t new_format; /* Whether to use the new format or not */ herr_t ret; /* Generic return value */ /* Output message about test being performed */ diff --git a/test/tmisc.c b/test/tmisc.c index 796464f..11c6de7 100644 --- a/test/tmisc.c +++ b/test/tmisc.c @@ -5163,7 +5163,7 @@ static void test_misc30(void) { hsize_t file_size[] = {0, 0}; /* Sizes of file created */ - unsigned get_info; /* Whether to perform the get info call */ + hbool_t get_info; /* Whether to perform the get info call */ /* Output message about test being performed */ MESSAGE(5, ("Local heap dropping free block info\n")); diff --git a/test/unlink.c b/test/unlink.c index 07af800..993a7ec 100644 --- a/test/unlink.c +++ b/test/unlink.c @@ -2443,7 +2443,7 @@ main(void) hid_t fapl, fapl2, file; int nerrors = 0; char filename[1024]; - unsigned new_format; + hbool_t new_format; /* Metadata cache parameters */ int mdc_nelmts; diff --git a/tools/perform/pio_standalone.h b/tools/perform/pio_standalone.h index 762a564..584a057 100644 --- a/tools/perform/pio_standalone.h +++ b/tools/perform/pio_standalone.h @@ -105,10 +105,10 @@ typedef off_t h5_stat_size_t; * HDF Boolean type. */ #ifndef FALSE -# define FALSE false +# define FALSE 0 #endif #ifndef TRUE -# define TRUE true +# define TRUE 1 #endif diff --git a/tools/perform/sio_standalone.h b/tools/perform/sio_standalone.h index 8176745..4eb1ded 100644 --- a/tools/perform/sio_standalone.h +++ b/tools/perform/sio_standalone.h @@ -482,10 +482,10 @@ extern char *strdup(const char *s); * HDF Boolean type. */ #ifndef FALSE -# define FALSE false +# define FALSE 0 #endif #ifndef TRUE -# define TRUE true +# define TRUE 1 #endif /** From h5test.h **/ -- cgit v0.12 From de324a50f8e5cc2e07595232dc33908e6560d490 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Fri, 21 Aug 2015 22:08:43 -0500 Subject: [svn-r27549] Description: Update the file format debugging routines to match the recent changes to the metadata cache, along with a few other cleanups and miscellaneous enhancements. Tested on: MacOSX/64 10.10.5 (amazon) (h5committest forthcoming) --- src/H5Abtree2.c | 20 ++++-------- src/H5B2dbg.c | 79 ++++++++++++----------------------------------- src/H5B2private.h | 6 ++-- src/H5B2test.c | 53 +++----------------------------- src/H5Fdbg.c | 2 ++ src/H5Gbtree2.c | 22 ++++--------- src/H5HF.c | 66 +++++++++++++++++++++++++++++++++++++-- src/H5HFbtree2.c | 84 ++++++++------------------------------------------ src/H5HFdbg.c | 74 ++++++++++++++++++++++++++++++++++++++++++++ src/H5HFhuge.c | 87 ++++++++++++++++++++++++++++++++++++++++++++++++++++ src/H5HFman.c | 35 +++++++++++++++++++++ src/H5HFpkg.h | 6 +++- src/H5HFprivate.h | 4 +++ src/H5Odbg.c | 21 ++++++++++--- src/H5Olink.c | 4 +-- src/H5SM.c | 62 ++++++++++++++++++++++++------------- src/H5SMbtree2.c | 51 +++--------------------------- src/H5SMprivate.h | 2 +- tools/misc/h5debug.c | 14 ++++----- 19 files changed, 392 insertions(+), 300 deletions(-) diff --git a/src/H5Abtree2.c b/src/H5Abtree2.c index b85bee3..5e29d3f 100644 --- a/src/H5Abtree2.c +++ b/src/H5Abtree2.c @@ -85,8 +85,7 @@ static herr_t H5A__dense_btree2_corder_encode(uint8_t *raw, const void *native, void *ctx); static herr_t H5A__dense_btree2_corder_decode(const uint8_t *raw, void *native, void *ctx); -static herr_t H5A__dense_btree2_corder_debug(FILE *stream, const H5F_t *f, hid_t dxpl_id, - int indent, int fwidth, const void *record, const void *_udata); +static herr_t H5A__dense_btree2_corder_debug(FILE *stream, int indent, int fwidth, const void *record); /* v2 B-tree driver callbacks for 'name' index */ static herr_t H5A__dense_btree2_name_store(void *native, const void *udata); @@ -95,8 +94,7 @@ static herr_t H5A__dense_btree2_name_encode(uint8_t *raw, const void *native, void *ctx); static herr_t H5A__dense_btree2_name_decode(const uint8_t *raw, void *native, void *ctx); -static herr_t H5A__dense_btree2_name_debug(FILE *stream, const H5F_t *f, hid_t dxpl_id, - int indent, int fwidth, const void *record, const void *_udata); +static herr_t H5A__dense_btree2_name_debug(FILE *stream, int indent, int fwidth, const void *record); /* Fractal heap function callbacks */ static herr_t H5A__dense_fh_name_cmp(const void *obj, size_t obj_len, void *op_data); @@ -116,9 +114,7 @@ const H5B2_class_t H5A_BT2_NAME[1]={{ /* B-tree class information */ H5A__dense_btree2_name_compare, /* Record comparison callback */ H5A__dense_btree2_name_encode, /* Record encoding callback */ H5A__dense_btree2_name_decode, /* Record decoding callback */ - H5A__dense_btree2_name_debug, /* Record debugging callback */ - NULL, /* Create debugging context */ - NULL /* Destroy debugging context */ + H5A__dense_btree2_name_debug /* Record debugging callback */ }}; /* v2 B-tree class for indexing 'creation order' field of attributes */ @@ -132,9 +128,7 @@ const H5B2_class_t H5A_BT2_CORDER[1]={{ /* B-tree class information */ H5A__dense_btree2_corder_compare, /* Record comparison callback */ H5A__dense_btree2_corder_encode, /* Record encoding callback */ H5A__dense_btree2_corder_decode, /* Record decoding callback */ - H5A__dense_btree2_corder_debug, /* Record debugging callback */ - NULL, /* Create debugging context */ - NULL /* Destroy debugging context */ + H5A__dense_btree2_corder_debug /* Record debugging callback */ }}; @@ -381,8 +375,7 @@ H5A__dense_btree2_name_decode(const uint8_t *raw, void *_nrecord, void H5_ATTR_U *------------------------------------------------------------------------- */ static herr_t -H5A__dense_btree2_name_debug(FILE *stream, const H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, - int indent, int fwidth, const void *_nrecord, const void H5_ATTR_UNUSED *_udata) +H5A__dense_btree2_name_debug(FILE *stream, int indent, int fwidth, const void *_nrecord) { const H5A_dense_bt2_name_rec_t *nrecord = (const H5A_dense_bt2_name_rec_t *)_nrecord; @@ -539,8 +532,7 @@ H5A__dense_btree2_corder_decode(const uint8_t *raw, void *_nrecord, void H5_ATTR *------------------------------------------------------------------------- */ static herr_t -H5A__dense_btree2_corder_debug(FILE *stream, const H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, - int indent, int fwidth, const void *_nrecord, const void H5_ATTR_UNUSED *_udata) +H5A__dense_btree2_corder_debug(FILE *stream, int indent, int fwidth, const void *_nrecord) { const H5A_dense_bt2_corder_rec_t *nrecord = (const H5A_dense_bt2_corder_rec_t *)_nrecord; diff --git a/src/H5B2dbg.c b/src/H5B2dbg.c index 6e1250b..d3b5014 100644 --- a/src/H5B2dbg.c +++ b/src/H5B2dbg.c @@ -91,7 +91,6 @@ H5B2__hdr_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, const H5B2_class_t *type, haddr_t obj_addr) { H5B2_hdr_t *hdr = NULL; /* B-tree header info */ - void *dbg_ctx = NULL; /* v2 B-tree debugging context */ unsigned u; /* Local index variable */ char temp_str[128]; /* Temporary string, for formatting */ H5B2_hdr_cache_ud_t cache_udata; /* User-data for callback */ @@ -109,22 +108,13 @@ H5B2__hdr_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, HDassert(indent >= 0); HDassert(fwidth >= 0); HDassert(type); - HDassert((type->crt_dbg_ctx && type->dst_dbg_ctx) || - (NULL == type->crt_dbg_ctx && NULL == type->dst_dbg_ctx)); - - /* Check for debugging context callback available */ - if(type->crt_dbg_ctx) { - /* Create debugging context */ - if(NULL == (dbg_ctx = (type->crt_dbg_ctx)(f, dxpl_id, obj_addr))) - HGOTO_ERROR(H5E_BTREE, H5E_CANTGET, FAIL, "unable to create v2 B-tree debugging context") - } /* end if */ /* * Load the B-tree header. */ cache_udata.f = f; cache_udata.addr = addr; - cache_udata.ctx_udata = dbg_ctx; + cache_udata.ctx_udata = f; if(NULL == (hdr = (H5B2_hdr_t *)H5AC_protect(f, dxpl_id, H5AC_BT2_HDR, addr, &cache_udata, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_BTREE, H5E_CANTLOAD, FAIL, "unable to load B-tree header") @@ -139,12 +129,12 @@ H5B2__hdr_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, */ HDfprintf(stream, "%*s%-*s %s (%u)\n", indent, "", fwidth, "Tree type ID:", hdr->cls->name, (unsigned)hdr->cls->id); - HDfprintf(stream, "%*s%-*s %Zu\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth, "Size of node:", - hdr->node_size); - HDfprintf(stream, "%*s%-*s %Zu\n", indent, "", fwidth, + (unsigned)hdr->node_size); + HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth, "Size of raw (disk) record:", - hdr->rrec_size); + (unsigned)hdr->rrec_size); HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, "Dirty flag:", hdr->cache_info.is_dirty ? "True" : "False"); @@ -177,8 +167,6 @@ H5B2__hdr_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, } /* end for */ done: - if(dbg_ctx && (type->dst_dbg_ctx)(dbg_ctx) < 0) - HDONE_ERROR(H5E_BTREE, H5E_CANTRELEASE, FAIL, "unable to release v2 B-tree debugging context") if(hdr) { hdr->f = NULL; if(H5AC_unprotect(f, dxpl_id, H5AC_BT2_HDR, addr, hdr, H5AC__NO_FLAGS_SET) < 0) @@ -208,7 +196,6 @@ H5B2__int_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, { H5B2_hdr_t *hdr = NULL; /* B-tree header */ H5B2_internal_t *internal = NULL; /* B-tree internal node */ - void *dbg_ctx = NULL; /* v2 B-tree debugging context */ unsigned u; /* Local index variable */ char temp_str[128]; /* Temporary string, for formatting */ H5B2_hdr_cache_ud_t cache_udata; /* User-data for callback */ @@ -225,25 +212,16 @@ H5B2__int_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, HDassert(indent >= 0); HDassert(fwidth >= 0); HDassert(type); - HDassert((type->crt_dbg_ctx && type->dst_dbg_ctx) || - (NULL == type->crt_dbg_ctx && NULL == type->dst_dbg_ctx)); HDassert(H5F_addr_defined(hdr_addr)); HDassert(H5F_addr_defined(obj_addr)); HDassert(nrec > 0); - /* Check for debugging context callback available */ - if(type->crt_dbg_ctx) { - /* Create debugging context */ - if(NULL == (dbg_ctx = (type->crt_dbg_ctx)(f, dxpl_id, obj_addr))) - HGOTO_ERROR(H5E_BTREE, H5E_CANTGET, FAIL, "unable to create v2 B-tree debugging context") - } /* end if */ - /* * Load the B-tree header. */ cache_udata.f = f; cache_udata.addr = hdr_addr; - cache_udata.ctx_udata = dbg_ctx; + cache_udata.ctx_udata = f; if(NULL == (hdr = (H5B2_hdr_t *)H5AC_protect(f, dxpl_id, H5AC_BT2_HDR, hdr_addr, &cache_udata, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_BTREE, H5E_CANTLOAD, FAIL, "unable to load B-tree header") @@ -259,22 +237,19 @@ H5B2__int_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, HGOTO_ERROR(H5E_BTREE, H5E_CANTLOAD, FAIL, "unable to load B-tree internal node") /* Print opening message */ - if(internal->depth == 1) - HDfprintf(stream, "%*sv2 B-tree Internal 'Leaf' Node...\n", indent, ""); - else - HDfprintf(stream, "%*sv2 B-tree Internal 'Branch' Node...\n", indent, ""); + HDfprintf(stream, "%*sv2 B-tree Internal Node...\n", indent, ""); /* * Print the values. */ HDfprintf(stream, "%*s%-*s %s (%u)\n", indent, "", fwidth, "Tree type ID:", hdr->cls->name, (unsigned)hdr->cls->id); - HDfprintf(stream, "%*s%-*s %Zu\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth, "Size of node:", - hdr->node_size); - HDfprintf(stream, "%*s%-*s %Zu\n", indent, "", fwidth, + (unsigned)hdr->node_size); + HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth, "Size of raw (disk) record:", - hdr->rrec_size); + (unsigned)hdr->rrec_size); HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, "Dirty flag:", internal->cache_info.is_dirty ? "True" : "False"); @@ -297,8 +272,8 @@ H5B2__int_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, HDfprintf(stream, "%*s%-*s\n", indent + 3, "", MAX(0, fwidth - 3), temp_str); HDassert(H5B2_INT_NREC(internal, hdr, u)); - (void)(type->debug)(stream, f, dxpl_id, indent + 6, MAX (0, fwidth-6), - H5B2_INT_NREC(internal, hdr, u), dbg_ctx); + (void)(type->debug)(stream, indent + 6, MAX (0, fwidth-6), + H5B2_INT_NREC(internal, hdr, u)); } /* end for */ /* Print final node pointer */ @@ -310,8 +285,6 @@ H5B2__int_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, internal->node_ptrs[u].addr); done: - if(dbg_ctx && (type->dst_dbg_ctx)(dbg_ctx) < 0) - HDONE_ERROR(H5E_BTREE, H5E_CANTRELEASE, FAIL, "unable to release v2 B-tree debugging context") if(hdr) { hdr->f = NULL; if(H5AC_unprotect(f, dxpl_id, H5AC_BT2_HDR, hdr_addr, hdr, H5AC__NO_FLAGS_SET) < 0) @@ -344,7 +317,6 @@ H5B2__leaf_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent H5B2_hdr_t *hdr = NULL; /* B-tree header */ H5B2_leaf_t *leaf = NULL; /* B-tree leaf node */ H5B2_hdr_cache_ud_t cache_udata; /* User-data for callback */ - void *dbg_ctx = NULL; /* v2 B-tree debugging context */ unsigned u; /* Local index variable */ char temp_str[128]; /* Temporary string, for formatting */ herr_t ret_value = SUCCEED; /* Return value */ @@ -360,25 +332,16 @@ H5B2__leaf_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent HDassert(indent >= 0); HDassert(fwidth >= 0); HDassert(type); - HDassert((type->crt_dbg_ctx && type->dst_dbg_ctx) || - (NULL == type->crt_dbg_ctx && NULL == type->dst_dbg_ctx)); HDassert(H5F_addr_defined(hdr_addr)); HDassert(H5F_addr_defined(obj_addr)); HDassert(nrec > 0); - /* Check for debugging context callback available */ - if(type->crt_dbg_ctx) { - /* Create debugging context */ - if(NULL == (dbg_ctx = (type->crt_dbg_ctx)(f, dxpl_id, obj_addr))) - HGOTO_ERROR(H5E_BTREE, H5E_CANTGET, FAIL, "unable to create v2 B-tree debugging context") - } /* end if */ - /* * Load the B-tree header. */ cache_udata.f = f; cache_udata.addr = hdr_addr; - cache_udata.ctx_udata = dbg_ctx; + cache_udata.ctx_udata = f; if(NULL == (hdr = (H5B2_hdr_t *)H5AC_protect(f, dxpl_id, H5AC_BT2_HDR, hdr_addr, &cache_udata, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree header") @@ -400,12 +363,12 @@ H5B2__leaf_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent */ HDfprintf(stream, "%*s%-*s %s (%u)\n", indent, "", fwidth, "Tree type ID:", hdr->cls->name, (unsigned)hdr->cls->id); - HDfprintf(stream, "%*s%-*s %Zu\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth, "Size of node:", - hdr->node_size); - HDfprintf(stream, "%*s%-*s %Zu\n", indent, "", fwidth, + (unsigned)hdr->node_size); + HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth, "Size of raw (disk) record:", - hdr->rrec_size); + (unsigned)hdr->rrec_size); HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, "Dirty flag:", leaf->cache_info.is_dirty ? "True" : "False"); @@ -420,13 +383,11 @@ H5B2__leaf_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent HDfprintf(stream, "%*s%-*s\n", indent + 3, "", MAX(0, fwidth - 3), temp_str); HDassert(H5B2_LEAF_NREC(leaf, hdr, u)); - (void)(type->debug)(stream, f, dxpl_id, indent + 6, MAX (0, fwidth-6), - H5B2_LEAF_NREC(leaf, hdr, u), dbg_ctx); + (void)(type->debug)(stream, indent + 6, MAX (0, fwidth-6), + H5B2_LEAF_NREC(leaf, hdr, u)); } /* end for */ done: - if(dbg_ctx && (type->dst_dbg_ctx)(dbg_ctx) < 0) - HDONE_ERROR(H5E_BTREE, H5E_CANTRELEASE, FAIL, "unable to release v2 B-tree debugging context") if(hdr) { hdr->f = NULL; if(H5AC_unprotect(f, dxpl_id, H5AC_BT2_HDR, hdr_addr, hdr, H5AC__NO_FLAGS_SET) < 0) diff --git a/src/H5B2private.h b/src/H5B2private.h index 08d3ce1..45b6737 100644 --- a/src/H5B2private.h +++ b/src/H5B2private.h @@ -92,10 +92,8 @@ struct H5B2_class_t { herr_t (*compare)(const void *rec1, const void *rec2); /* Compare two native records */ herr_t (*encode)(uint8_t *raw, const void *record, void *ctx); /* Encode record from native form to disk storage form */ herr_t (*decode)(const uint8_t *raw, void *record, void *ctx); /* Decode record from disk storage form to native form */ - herr_t (*debug)(FILE *stream, const H5F_t *f, hid_t dxpl_id, /* Print a record for debugging */ - int indent, int fwidth, const void *record, const void *ctx); - void *(*crt_dbg_ctx)(H5F_t *f, hid_t dxpl_id, haddr_t obj_addr); /* Create debugging context */ - herr_t (*dst_dbg_ctx)(void *dbg_ctx); /* Destroy debugging context */ + herr_t (*debug)(FILE *stream, int indent, int fwidth, /* Print a record for debugging */ + const void *record); }; /* v2 B-tree creation parameters */ diff --git a/src/H5B2test.c b/src/H5B2test.c index 35771f2..31cf8e1 100644 --- a/src/H5B2test.c +++ b/src/H5B2test.c @@ -67,9 +67,7 @@ static herr_t H5B2__test_store(void *nrecord, const void *udata); static herr_t H5B2__test_compare(const void *rec1, const void *rec2); static herr_t H5B2__test_encode(uint8_t *raw, const void *nrecord, void *ctx); static herr_t H5B2__test_decode(const uint8_t *raw, void *nrecord, void *ctx); -static herr_t H5B2__test_debug(FILE *stream, const H5F_t *f, hid_t dxpl_id, - int indent, int fwidth, const void *record, const void *_udata); -static void *H5B2__test_crt_dbg_context(H5F_t *f, hid_t dxpl_id, haddr_t addr); +static herr_t H5B2__test_debug(FILE *stream, int indent, int fwidth, const void *record); /*********************/ @@ -86,9 +84,7 @@ const H5B2_class_t H5B2_TEST[1]={{ /* B-tree class information */ H5B2__test_compare, /* Record comparison callback */ H5B2__test_encode, /* Record encoding callback */ H5B2__test_decode, /* Record decoding callback */ - H5B2__test_debug, /* Record debugging callback */ - H5B2__test_crt_dbg_context, /* Create debugging context */ - H5B2__test_dst_context /* Destroy debugging context */ + H5B2__test_debug /* Record debugging callback */ }}; @@ -295,13 +291,11 @@ H5B2__test_decode(const uint8_t *raw, void *nrecord, void *_ctx) *------------------------------------------------------------------------- */ static herr_t -H5B2__test_debug(FILE *stream, const H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, - int indent, int fwidth, const void *record, - const void H5_ATTR_UNUSED *_udata) +H5B2__test_debug(FILE *stream, int indent, int fwidth, const void *record) { FUNC_ENTER_STATIC_NOERR - HDassert (record); + HDassert(record); HDfprintf(stream, "%*s%-*s %Hu\n", indent, "", fwidth, "Record:", *(const hsize_t *)record); @@ -311,45 +305,6 @@ H5B2__test_debug(FILE *stream, const H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUS /*------------------------------------------------------------------------- - * Function: H5B2__test_crt_dbg_context - * - * Purpose: Create context for debugging callback - * - * Return: Success: non-NULL - * Failure: NULL - * - * Programmer: Quincey Koziol - * Tuesday, December 1, 2009 - * - *------------------------------------------------------------------------- - */ -static void * -H5B2__test_crt_dbg_context(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, haddr_t H5_ATTR_UNUSED addr) -{ - H5B2_test_ctx_t *ctx; /* Callback context structure */ - void *ret_value; /* Return value */ - - FUNC_ENTER_STATIC - - /* Sanity check */ - HDassert(f); - - /* Allocate callback context */ - if(NULL == (ctx = H5FL_MALLOC(H5B2_test_ctx_t))) - HGOTO_ERROR(H5E_BTREE, H5E_CANTALLOC, NULL, "can't allocate callback context") - - /* Determine the size of addresses & lengths in the file */ - ctx->sizeof_size = H5F_SIZEOF_SIZE(f); - - /* Set return value */ - ret_value = ctx; - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* H5B2__test_crt_dbg_context() */ - - -/*------------------------------------------------------------------------- * Function: H5B2_get_root_addr_test * * Purpose: Retrieve the root node's address diff --git a/src/H5Fdbg.c b/src/H5Fdbg.c index 40d24e5..93da900 100644 --- a/src/H5Fdbg.c +++ b/src/H5Fdbg.c @@ -104,6 +104,8 @@ H5F_debug(H5F_t *f, FILE *stream, int indent, int fwidth) "Symbol table leaf node 1/2 rank:", f->shared->sblock->sym_leaf_k); HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth, "Symbol table internal node 1/2 rank:", f->shared->sblock->btree_k[H5B_SNODE_ID]); + HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth, + "Indexed storage internal node 1/2 rank:", f->shared->sblock->btree_k[H5B_CHUNK_ID]); HDfprintf(stream, "%*s%-*s 0x%02x\n", indent, "", fwidth, "File status flags:", (unsigned)(f->shared->sblock->status_flags)); HDfprintf(stream, "%*s%-*s %a (rel)\n", indent, "", fwidth, diff --git a/src/H5Gbtree2.c b/src/H5Gbtree2.c index 06af245..31db886 100644 --- a/src/H5Gbtree2.c +++ b/src/H5Gbtree2.c @@ -83,8 +83,7 @@ static herr_t H5G_dense_btree2_corder_encode(uint8_t *raw, const void *native, void *ctx); static herr_t H5G_dense_btree2_corder_decode(const uint8_t *raw, void *native, void *ctx); -static herr_t H5G_dense_btree2_corder_debug(FILE *stream, const H5F_t *f, hid_t dxpl_id, - int indent, int fwidth, const void *record, const void *_udata); +static herr_t H5G_dense_btree2_corder_debug(FILE *stream, int indent, int fwidth, const void *record); /* v2 B-tree driver callbacks for 'name' index */ static herr_t H5G_dense_btree2_name_store(void *native, const void *udata); @@ -93,8 +92,7 @@ static herr_t H5G_dense_btree2_name_encode(uint8_t *raw, const void *native, void *ctx); static herr_t H5G_dense_btree2_name_decode(const uint8_t *raw, void *native, void *ctx); -static herr_t H5G_dense_btree2_name_debug(FILE *stream, const H5F_t *f, hid_t dxpl_id, - int indent, int fwidth, const void *record, const void *_udata); +static herr_t H5G_dense_btree2_name_debug(FILE *stream, int indent, int fwidth, const void *record); /* Fractal heap function callbacks */ static herr_t H5G_dense_fh_name_cmp(const void *obj, size_t obj_len, void *op_data); @@ -114,9 +112,7 @@ const H5B2_class_t H5G_BT2_NAME[1]={{ /* B-tree class information */ H5G_dense_btree2_name_compare, /* Record comparison callback */ H5G_dense_btree2_name_encode, /* Record encoding callback */ H5G_dense_btree2_name_decode, /* Record decoding callback */ - H5G_dense_btree2_name_debug, /* Record debugging callback */ - NULL, /* Create debugging context */ - NULL /* Destroy debugging context */ + H5G_dense_btree2_name_debug /* Record debugging callback */ }}; /* v2 B-tree class for indexing 'creation order' field of links */ @@ -130,9 +126,7 @@ const H5B2_class_t H5G_BT2_CORDER[1]={{ /* B-tree class information */ H5G_dense_btree2_corder_compare, /* Record comparison callback */ H5G_dense_btree2_corder_encode, /* Record encoding callback */ H5G_dense_btree2_corder_decode, /* Record decoding callback */ - H5G_dense_btree2_corder_debug, /* Record debugging callback */ - NULL, /* Create debugging context */ - NULL /* Destroy debugging context */ + H5G_dense_btree2_corder_debug /* Record debugging callback */ }}; /*****************************/ @@ -362,9 +356,7 @@ H5G_dense_btree2_name_decode(const uint8_t *raw, void *_nrecord, void H5_ATTR_UN *------------------------------------------------------------------------- */ static herr_t -H5G_dense_btree2_name_debug(FILE *stream, const H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, - int indent, int fwidth, const void *_nrecord, - const void H5_ATTR_UNUSED *_udata) +H5G_dense_btree2_name_debug(FILE *stream, int indent, int fwidth, const void *_nrecord) { const H5G_dense_bt2_name_rec_t *nrecord = (const H5G_dense_bt2_name_rec_t *)_nrecord; unsigned u; /* Local index variable */ @@ -528,9 +520,7 @@ H5G_dense_btree2_corder_decode(const uint8_t *raw, void *_nrecord, void H5_ATTR_ *------------------------------------------------------------------------- */ static herr_t -H5G_dense_btree2_corder_debug(FILE *stream, const H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, - int indent, int fwidth, const void *_nrecord, - const void H5_ATTR_UNUSED *_udata) +H5G_dense_btree2_corder_debug(FILE *stream, int indent, int fwidth, const void *_nrecord) { const H5G_dense_bt2_corder_rec_t *nrecord = (const H5G_dense_bt2_corder_rec_t *)_nrecord; unsigned u; /* Local index variable */ diff --git a/src/H5HF.c b/src/H5HF.c index 0464da4..4a0ad07 100644 --- a/src/H5HF.c +++ b/src/H5HF.c @@ -451,8 +451,8 @@ H5HF_get_obj_len(H5HF_t *fh, hid_t dxpl_id, const void *_id, size_t *obj_len_p) HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't get 'tiny' object's length") } /* end if */ else { - HDfprintf(stderr, "%s: Heap ID type not supported yet!\n", FUNC); - HGOTO_ERROR(H5E_HEAP, H5E_UNSUPPORTED, FAIL, "heap ID type not supported yet") +HDfprintf(stderr, "%s: Heap ID type not supported yet!\n", FUNC); +HGOTO_ERROR(H5E_HEAP, H5E_UNSUPPORTED, FAIL, "heap ID type not supported yet") } /* end else */ done: @@ -461,6 +461,68 @@ done: /*------------------------------------------------------------------------- + * Function: H5HF_get_obj_off + * + * Purpose: Get the offset of an entry in a fractal heap + * + * Return: SUCCEED/FAIL + * + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * Aug 20 2015 + * + *------------------------------------------------------------------------- + */ +herr_t +H5HF_get_obj_off(H5HF_t *fh, hid_t dxpl_id, const void *_id, hsize_t *obj_off_p) +{ + const uint8_t *id = (const uint8_t *)_id; /* Object ID */ + uint8_t id_flags; /* Heap ID flag bits */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* + * Check arguments. + */ + HDassert(fh); + HDassert(id); + HDassert(obj_off_p); + + /* Get the ID flags */ + id_flags = *id; + + /* Check for correct heap ID version */ + if((id_flags & H5HF_ID_VERS_MASK) != H5HF_ID_VERS_CURR) + HGOTO_ERROR(H5E_HEAP, H5E_VERSION, FAIL, "incorrect heap ID version") + + /* Set the shared heap header's file context for this operation */ + fh->hdr->f = fh->f; + + /* Check type of object in heap */ + if((id_flags & H5HF_ID_TYPE_MASK) == H5HF_ID_TYPE_MAN) { + H5HF__man_get_obj_off(fh->hdr, id, obj_off_p); + } /* end if */ + else if((id_flags & H5HF_ID_TYPE_MASK) == H5HF_ID_TYPE_HUGE) { + /* Huge objects are located directly in the file */ + if(H5HF__huge_get_obj_off(fh->hdr, dxpl_id, id, obj_off_p) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't get 'huge' object's offset") + } /* end if */ + else if((id_flags & H5HF_ID_TYPE_MASK) == H5HF_ID_TYPE_TINY) { + /* Tiny objects are not stored in the heap */ + *obj_off_p = (hsize_t)0; + } /* end if */ + else { +HDfprintf(stderr, "%s: Heap ID type not supported yet!\n", FUNC); +HGOTO_ERROR(H5E_HEAP, H5E_UNSUPPORTED, FAIL, "heap ID type not supported yet") + } /* end else */ + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5HF_get_obj_off() */ + + +/*------------------------------------------------------------------------- * Function: H5HF_read * * Purpose: Read an object from a fractal heap into a buffer diff --git a/src/H5HFbtree2.c b/src/H5HFbtree2.c index 0229ebe..cb1ec77 100644 --- a/src/H5HFbtree2.c +++ b/src/H5HFbtree2.c @@ -70,7 +70,6 @@ typedef struct H5HF_huge_bt2_ctx_t { static void *H5HF_huge_bt2_crt_context(void *udata); static herr_t H5HF_huge_bt2_dst_context(void *ctx); -static void *H5HF_huge_bt2_crt_dbg_context(H5F_t *f, hid_t dxpl_id, haddr_t addr); static herr_t H5HF_huge_bt2_indir_store(void *native, const void *udata); static herr_t H5HF_huge_bt2_indir_compare(const void *rec1, const void *rec2); @@ -78,8 +77,7 @@ static herr_t H5HF_huge_bt2_indir_encode(uint8_t *raw, const void *native, void *ctx); static herr_t H5HF_huge_bt2_indir_decode(const uint8_t *raw, void *native, void *ctx); -static herr_t H5HF_huge_bt2_indir_debug(FILE *stream, const H5F_t *f, hid_t dxpl_id, - int indent, int fwidth, const void *record, const void *_udata); +static herr_t H5HF_huge_bt2_indir_debug(FILE *stream, int indent, int fwidth, const void *record); static herr_t H5HF_huge_bt2_filt_indir_store(void *native, const void *udata); static herr_t H5HF_huge_bt2_filt_indir_compare(const void *rec1, const void *rec2); @@ -87,8 +85,7 @@ static herr_t H5HF_huge_bt2_filt_indir_encode(uint8_t *raw, const void *native, void *ctx); static herr_t H5HF_huge_bt2_filt_indir_decode(const uint8_t *raw, void *native, void *ctx); -static herr_t H5HF_huge_bt2_filt_indir_debug(FILE *stream, const H5F_t *f, hid_t dxpl_id, - int indent, int fwidth, const void *record, const void *_udata); +static herr_t H5HF_huge_bt2_filt_indir_debug(FILE *stream, int indent, int fwidth, const void *record); static herr_t H5HF_huge_bt2_dir_store(void *native, const void *udata); static herr_t H5HF_huge_bt2_dir_compare(const void *rec1, const void *rec2); @@ -96,8 +93,7 @@ static herr_t H5HF_huge_bt2_dir_encode(uint8_t *raw, const void *native, void *ctx); static herr_t H5HF_huge_bt2_dir_decode(const uint8_t *raw, void *native, void *ctx); -static herr_t H5HF_huge_bt2_dir_debug(FILE *stream, const H5F_t *f, hid_t dxpl_id, - int indent, int fwidth, const void *record, const void *_udata); +static herr_t H5HF_huge_bt2_dir_debug(FILE *stream, int indent, int fwidth, const void *record); static herr_t H5HF_huge_bt2_filt_dir_store(void *native, const void *udata); static herr_t H5HF_huge_bt2_filt_dir_compare(const void *rec1, const void *rec2); @@ -105,8 +101,7 @@ static herr_t H5HF_huge_bt2_filt_dir_encode(uint8_t *raw, const void *native, void *ctx); static herr_t H5HF_huge_bt2_filt_dir_decode(const uint8_t *raw, void *native, void *ctx); -static herr_t H5HF_huge_bt2_filt_dir_debug(FILE *stream, const H5F_t *f, hid_t dxpl_id, - int indent, int fwidth, const void *record, const void *_udata); +static herr_t H5HF_huge_bt2_filt_dir_debug(FILE *stream, int indent, int fwidth, const void *record); /*********************/ /* Package Variables */ @@ -122,9 +117,7 @@ const H5B2_class_t H5HF_HUGE_BT2_INDIR[1]={{ /* B-tree class information */ H5HF_huge_bt2_indir_compare, /* Record comparison callback */ H5HF_huge_bt2_indir_encode, /* Record encoding callback */ H5HF_huge_bt2_indir_decode, /* Record decoding callback */ - H5HF_huge_bt2_indir_debug, /* Record debugging callback */ - H5HF_huge_bt2_crt_dbg_context, /* Create debugging context */ - H5HF_huge_bt2_dst_context /* Destroy debugging context */ + H5HF_huge_bt2_indir_debug /* Record debugging callback */ }}; /* v2 B-tree class for indirectly accessed, filtered 'huge' objects */ @@ -138,9 +131,7 @@ const H5B2_class_t H5HF_HUGE_BT2_FILT_INDIR[1]={{ /* B-tree class information */ H5HF_huge_bt2_filt_indir_compare, /* Record comparison callback */ H5HF_huge_bt2_filt_indir_encode, /* Record encoding callback */ H5HF_huge_bt2_filt_indir_decode, /* Record decoding callback */ - H5HF_huge_bt2_filt_indir_debug, /* Record debugging callback */ - H5HF_huge_bt2_crt_dbg_context, /* Create debugging context */ - H5HF_huge_bt2_dst_context /* Destroy debugging context */ + H5HF_huge_bt2_filt_indir_debug /* Record debugging callback */ }}; /* v2 B-tree class for directly accessed 'huge' objects */ @@ -154,9 +145,7 @@ const H5B2_class_t H5HF_HUGE_BT2_DIR[1]={{ /* B-tree class information */ H5HF_huge_bt2_dir_compare, /* Record comparison callback */ H5HF_huge_bt2_dir_encode, /* Record encoding callback */ H5HF_huge_bt2_dir_decode, /* Record decoding callback */ - H5HF_huge_bt2_dir_debug, /* Record debugging callback */ - H5HF_huge_bt2_crt_dbg_context, /* Create debugging context */ - H5HF_huge_bt2_dst_context /* Destroy debugging context */ + H5HF_huge_bt2_dir_debug /* Record debugging callback */ }}; /* v2 B-tree class for directly accessed, filtered 'huge' objects */ @@ -170,9 +159,7 @@ const H5B2_class_t H5HF_HUGE_BT2_FILT_DIR[1]={{ /* B-tree class information */ H5HF_huge_bt2_filt_dir_compare, /* Record comparison callback */ H5HF_huge_bt2_filt_dir_encode, /* Record encoding callback */ H5HF_huge_bt2_filt_dir_decode, /* Record decoding callback */ - H5HF_huge_bt2_filt_dir_debug, /* Record debugging callback */ - H5HF_huge_bt2_crt_dbg_context, /* Create debugging context */ - H5HF_huge_bt2_dst_context /* Destroy debugging context */ + H5HF_huge_bt2_filt_dir_debug /* Record debugging callback */ }}; /*****************************/ @@ -265,46 +252,6 @@ H5HF_huge_bt2_dst_context(void *_ctx) /*------------------------------------------------------------------------- - * Function: H5HF_huge_bt2_crt_dbg_context - * - * Purpose: Create context for debugging callback - * - * Return: Success: non-NULL - * Failure: NULL - * - * Programmer: Quincey Koziol - * Tuesday, December 1, 2009 - * - *------------------------------------------------------------------------- - */ -static void * -H5HF_huge_bt2_crt_dbg_context(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, haddr_t H5_ATTR_UNUSED addr) -{ - H5HF_huge_bt2_ctx_t *ctx; /* Callback context structure */ - void *ret_value; /* Return value */ - - FUNC_ENTER_NOAPI_NOINIT - - /* Sanity check */ - HDassert(f); - - /* Allocate callback context */ - if(NULL == (ctx = H5FL_MALLOC(H5HF_huge_bt2_ctx_t))) - HGOTO_ERROR(H5E_HEAP, H5E_CANTALLOC, NULL, "can't allocate callback context") - - /* Determine the size of addresses & lengths in the file */ - ctx->sizeof_addr = H5F_SIZEOF_ADDR(f); - ctx->sizeof_size = H5F_SIZEOF_SIZE(f); - - /* Set return value */ - ret_value = ctx; - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* H5HF_huge_bt2_crt_dbg_context() */ - - -/*------------------------------------------------------------------------- * Function: H5HF_huge_bt2_indir_found * * Purpose: Retrieve record for indirectly accessed 'huge' object, when @@ -505,9 +452,7 @@ H5HF_huge_bt2_indir_decode(const uint8_t *raw, void *_nrecord, void *_ctx) *------------------------------------------------------------------------- */ static herr_t -H5HF_huge_bt2_indir_debug(FILE *stream, const H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, - int indent, int fwidth, const void *_nrecord, - const void H5_ATTR_UNUSED *_udata) +H5HF_huge_bt2_indir_debug(FILE *stream, int indent, int fwidth, const void *_nrecord) { const H5HF_huge_bt2_indir_rec_t *nrecord = (const H5HF_huge_bt2_indir_rec_t *)_nrecord; @@ -727,9 +672,7 @@ H5HF_huge_bt2_filt_indir_decode(const uint8_t *raw, void *_nrecord, void *_ctx) *------------------------------------------------------------------------- */ static herr_t -H5HF_huge_bt2_filt_indir_debug(FILE *stream, const H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, - int indent, int fwidth, const void *_nrecord, - const void H5_ATTR_UNUSED *_udata) +H5HF_huge_bt2_filt_indir_debug(FILE *stream, int indent, int fwidth, const void *_nrecord) { const H5HF_huge_bt2_filt_indir_rec_t *nrecord = (const H5HF_huge_bt2_filt_indir_rec_t *)_nrecord; @@ -920,9 +863,7 @@ H5HF_huge_bt2_dir_decode(const uint8_t *raw, void *_nrecord, void *_ctx) *------------------------------------------------------------------------- */ static herr_t -H5HF_huge_bt2_dir_debug(FILE *stream, const H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, - int indent, int fwidth, const void *_nrecord, - const void H5_ATTR_UNUSED *_udata) +H5HF_huge_bt2_dir_debug(FILE *stream, int indent, int fwidth, const void *_nrecord) { const H5HF_huge_bt2_dir_rec_t *nrecord = (const H5HF_huge_bt2_dir_rec_t *)_nrecord; @@ -1149,8 +1090,7 @@ H5HF_huge_bt2_filt_dir_decode(const uint8_t *raw, void *_nrecord, void *_ctx) *------------------------------------------------------------------------- */ static herr_t -H5HF_huge_bt2_filt_dir_debug(FILE *stream, const H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, - int indent, int fwidth, const void *_nrecord, const void H5_ATTR_UNUSED *_udata) +H5HF_huge_bt2_filt_dir_debug(FILE *stream, int indent, int fwidth, const void *_nrecord) { const H5HF_huge_bt2_filt_dir_rec_t *nrecord = (const H5HF_huge_bt2_filt_dir_rec_t *)_nrecord; diff --git a/src/H5HFdbg.c b/src/H5HFdbg.c index 5183b67..736b98d 100644 --- a/src/H5HFdbg.c +++ b/src/H5HFdbg.c @@ -100,6 +100,80 @@ static herr_t H5HF_dtable_debug(const H5HF_dtable_t *dtable, FILE *stream, /*------------------------------------------------------------------------- + * Function: H5HF_id_print + * + * Purpose: Prints a fractal heap ID. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * Aug 20 2015 + * + *------------------------------------------------------------------------- + */ +herr_t +H5HF_id_print(H5HF_t *fh, hid_t dxpl_id, const void *_id, FILE *stream, int indent, int fwidth) +{ + const uint8_t *id = (const uint8_t *)_id; /* Object ID */ + uint8_t id_flags; /* Heap ID flag bits */ + hsize_t obj_off; /* Offset of object */ + size_t obj_len; /* Length of object */ + char id_type; /* Character for the type of heap ID */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI_NOINIT + + /* + * Check arguments. + */ + HDassert(fh); + HDassert(id); + HDassert(stream); + HDassert(indent >= 0); + HDassert(fwidth >= 0); + + /* Get the ID flags */ + id_flags = *id; + + /* Check for correct heap ID version */ + if((id_flags & H5HF_ID_VERS_MASK) != H5HF_ID_VERS_CURR) + HGOTO_ERROR(H5E_HEAP, H5E_VERSION, FAIL, "incorrect heap ID version") + + /* Check type of object in heap */ + if((id_flags & H5HF_ID_TYPE_MASK) == H5HF_ID_TYPE_MAN) { + id_type = 'M'; + } /* end if */ + else if((id_flags & H5HF_ID_TYPE_MASK) == H5HF_ID_TYPE_HUGE) { + id_type = 'H'; + } /* end if */ + else if((id_flags & H5HF_ID_TYPE_MASK) == H5HF_ID_TYPE_TINY) { + id_type = 'T'; + } /* end if */ + else { +HDfprintf(stderr, "%s: Heap ID type not supported yet!\n", FUNC); +HGOTO_ERROR(H5E_HEAP, H5E_UNSUPPORTED, FAIL, "heap ID type not supported yet") + } /* end else */ + + /* Get the length of the heap object */ + if(H5HF_get_obj_len(fh, dxpl_id, id, &obj_len) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't retrieve heap ID length") + + /* Get the offset of the heap object */ + if(H5HF_get_obj_off(fh, dxpl_id, id, &obj_off) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't retrieve heap ID length") + + /* Display the heap ID */ + HDfprintf(stream, "%*s%-*s (%c, %Hu, %Zu)\n", indent, "", fwidth, + "Heap ID info: (type, offset, length)", + id_type, obj_off, obj_len); + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5HF_id_print() */ + + +/*------------------------------------------------------------------------- * Function: H5HF_dtable_debug * * Purpose: Prints debugging info about a doubling table diff --git a/src/H5HFhuge.c b/src/H5HFhuge.c index 7f0da02..04cd425 100644 --- a/src/H5HFhuge.c +++ b/src/H5HFhuge.c @@ -585,6 +585,93 @@ done: /*------------------------------------------------------------------------- + * Function: H5HF__huge_get_obj_off + * + * Purpose: Get the offset of a 'huge' object in a fractal heap + * + * Return: SUCCEED/FAIL + * + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * Aug 8 2006 + * + *------------------------------------------------------------------------- + */ +herr_t +H5HF__huge_get_obj_off(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, + hsize_t *obj_off_p) +{ + haddr_t obj_addr; /* Object's address in the file */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI_NOINIT + + /* + * Check arguments. + */ + HDassert(hdr); + HDassert(H5F_addr_defined(hdr->huge_bt2_addr)); + HDassert(id); + HDassert(obj_off_p); + + /* Skip over the flag byte */ + id++; + + /* Check if 'huge' object ID encodes address & length directly */ + if(hdr->huge_ids_direct) { + /* Retrieve the object's address (common) */ + H5F_addr_decode(hdr->f, &id, &obj_addr); + } /* end if */ + else { + /* Sanity check */ + HDassert(H5F_addr_defined(hdr->huge_bt2_addr)); + + /* Check if v2 B-tree is open yet */ + if(NULL == hdr->huge_bt2) { + /* Open existing v2 B-tree */ + if(NULL == (hdr->huge_bt2 = H5B2_open(hdr->f, dxpl_id, hdr->huge_bt2_addr, hdr->f))) + HGOTO_ERROR(H5E_HEAP, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for tracking 'huge' heap objects") + } /* end if */ + + if(hdr->filter_len > 0) { + H5HF_huge_bt2_filt_indir_rec_t found_rec; /* Record found from tracking object */ + H5HF_huge_bt2_filt_indir_rec_t search_rec; /* Record for searching for object */ + + /* Get ID for looking up 'huge' object in v2 B-tree */ + UINT64DECODE_VAR(id, search_rec.id, hdr->huge_id_size) + + /* Look up object in v2 B-tree */ + if(H5B2_find(hdr->huge_bt2, dxpl_id, &search_rec, H5HF_huge_bt2_filt_indir_found, &found_rec) != TRUE) + HGOTO_ERROR(H5E_HEAP, H5E_NOTFOUND, FAIL, "can't find object in B-tree") + + /* Retrieve the object's address & length */ + obj_addr = found_rec.addr; + } /* end if */ + else { + H5HF_huge_bt2_indir_rec_t found_rec; /* Record found from tracking object */ + H5HF_huge_bt2_indir_rec_t search_rec; /* Record for searching for object */ + + /* Get ID for looking up 'huge' object in v2 B-tree */ + UINT64DECODE_VAR(id, search_rec.id, hdr->huge_id_size) + + /* Look up object in v2 B-tree */ + if(H5B2_find(hdr->huge_bt2, dxpl_id, &search_rec, H5HF_huge_bt2_indir_found, &found_rec) != TRUE) + HGOTO_ERROR(H5E_HEAP, H5E_NOTFOUND, FAIL, "can't find object in B-tree") + + /* Retrieve the object's address & length */ + obj_addr = found_rec.addr; + } /* end else */ + } /* end else */ + + /* Set the value to return */ + *obj_off_p = (hsize_t)obj_addr; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5HF__huge_get_obj_off() */ + + +/*------------------------------------------------------------------------- * Function: H5HF_huge_op_real * * Purpose: Internal routine to perform an operation on a 'huge' object diff --git a/src/H5HFman.c b/src/H5HFman.c index 5f95a91..cfbcd87 100644 --- a/src/H5HFman.c +++ b/src/H5HFman.c @@ -256,6 +256,41 @@ H5HF_man_get_obj_len(H5HF_hdr_t *hdr, const uint8_t *id, size_t *obj_len_p) /*------------------------------------------------------------------------- + * Function: H5HF__man_get_obj_off + * + * Purpose: Get the offset of a managed heap object + * + * Return: SUCCEED (Can't fail) + * + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * Aug 20 2015 + * + *------------------------------------------------------------------------- + */ +void +H5HF__man_get_obj_off(const H5HF_hdr_t *hdr, const uint8_t *id, hsize_t *obj_off_p) +{ + FUNC_ENTER_PACKAGE_NOERR + + /* + * Check arguments. + */ + HDassert(hdr); + HDassert(id); + HDassert(obj_off_p); + + /* Skip over the flag byte */ + id++; + + /* Skip over object offset */ + UINT64DECODE_VAR(id, *obj_off_p, hdr->heap_off_size); + + FUNC_LEAVE_NOAPI_VOID +} /* end H5HF__man_get_obj_off() */ + + +/*------------------------------------------------------------------------- * Function: H5HF_man_op_real * * Purpose: Internal routine to perform an operation on a managed heap diff --git a/src/H5HFpkg.h b/src/H5HFpkg.h index 4655d83..685c83a 100644 --- a/src/H5HFpkg.h +++ b/src/H5HFpkg.h @@ -702,6 +702,8 @@ H5_DLL herr_t H5HF_man_insert(H5HF_hdr_t *fh, hid_t dxpl_id, size_t obj_size, const void *obj, void *id); H5_DLL herr_t H5HF_man_get_obj_len(H5HF_hdr_t *hdr, const uint8_t *id, size_t *obj_len_p); +H5_DLL void H5HF__man_get_obj_off(const H5HF_hdr_t *hdr, const uint8_t *id, + hsize_t *obj_off_p); H5_DLL herr_t H5HF_man_read(H5HF_hdr_t *fh, hid_t dxpl_id, const uint8_t *id, void *obj); H5_DLL herr_t H5HF_man_write(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, @@ -716,6 +718,8 @@ H5_DLL herr_t H5HF_huge_insert(H5HF_hdr_t *hdr, hid_t dxpl_id, size_t obj_size, void *obj, void *id); H5_DLL herr_t H5HF_huge_get_obj_len(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, size_t *obj_len_p); +H5_DLL herr_t H5HF__huge_get_obj_off(H5HF_hdr_t *hdr, hid_t dxpl_id, + const uint8_t *id, hsize_t *obj_off_p); H5_DLL herr_t H5HF_huge_read(H5HF_hdr_t *fh, hid_t dxpl_id, const uint8_t *id, void *obj); H5_DLL herr_t H5HF_huge_write(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, @@ -748,7 +752,7 @@ H5_DLL herr_t H5HF_tiny_remove(H5HF_hdr_t *fh, const uint8_t *id); /* Debugging routines for dumping file structures */ H5_DLL void H5HF_hdr_print(const H5HF_hdr_t *hdr, hid_t dxpl_id, - hbool_t dump_internal, FILE *stream, int indent, int fwidth); + hbool_t dump_internal, FILE *stream, int indent, int fwidth); H5_DLL herr_t H5HF_hdr_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, int fwidth); H5_DLL herr_t H5HF_dblock_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, diff --git a/src/H5HFprivate.h b/src/H5HFprivate.h index 55daa30..441ad3e 100644 --- a/src/H5HFprivate.h +++ b/src/H5HFprivate.h @@ -116,6 +116,8 @@ H5_DLL herr_t H5HF_insert(H5HF_t *fh, hid_t dxpl_id, size_t size, const void *obj, void *id/*out*/); H5_DLL herr_t H5HF_get_obj_len(H5HF_t *fh, hid_t dxpl_id, const void *id, size_t *obj_len_p/*out*/); +H5_DLL herr_t H5HF_get_obj_off(H5HF_t *fh, hid_t dxpl_id, const void *_id, + hsize_t *obj_off_p/*out*/); H5_DLL herr_t H5HF_read(H5HF_t *fh, hid_t dxpl_id, const void *id, void *obj/*out*/); H5_DLL herr_t H5HF_write(H5HF_t *fh, hid_t dxpl_id, void *id, hbool_t *id_changed, @@ -131,6 +133,8 @@ H5_DLL herr_t H5HF_stat_info(const H5HF_t *fh, H5HF_stat_t *stats); H5_DLL herr_t H5HF_size(const H5HF_t *fh, hid_t dxpl_id, hsize_t *heap_size/*out*/); /* Debugging routines */ +H5_DLL herr_t H5HF_id_print(H5HF_t *fh, hid_t dxpl_id, + const void *id, FILE *stream, int indent, int fwidth); #ifdef H5HF_DEBUGGING H5_DLL herr_t H5HF_sects_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, int fwidth); diff --git a/src/H5Odbg.c b/src/H5Odbg.c index 0388cd5..bd789c5 100644 --- a/src/H5Odbg.c +++ b/src/H5Odbg.c @@ -454,20 +454,23 @@ H5O_debug_real(H5F_t *f, hid_t dxpl_id, H5O_t *oh, haddr_t addr, FILE *stream, i if(oh->mesg[i].flags) { hbool_t flag_printed = FALSE; - if(oh->mesg[i].flags & H5O_MSG_FLAG_SHARED) { - HDfprintf(stream, "mesg[i].flags & H5O_MSG_FLAG_CONSTANT) { HDfprintf(stream, "%sC", (flag_printed ? ", " : "<")); flag_printed = TRUE; } /* end if */ + if(oh->mesg[i].flags & H5O_MSG_FLAG_SHARED) { + HDfprintf(stream, "%sS", (flag_printed ? ", " : "<")); + flag_printed = TRUE; + } /* end if */ if(oh->mesg[i].flags & H5O_MSG_FLAG_DONTSHARE) { HDfprintf(stream, "%sDS", (flag_printed ? ", " : "<")); flag_printed = TRUE; } /* end if */ if(oh->mesg[i].flags & H5O_MSG_FLAG_FAIL_IF_UNKNOWN_AND_OPEN_FOR_WRITE) { - HDfprintf(stream, "%sFIU", (flag_printed ? ", " : "<")); + HDfprintf(stream, "%sFIUW", (flag_printed ? ", " : "<")); flag_printed = TRUE; } /* end if */ if(oh->mesg[i].flags & H5O_MSG_FLAG_MARK_IF_UNKNOWN) { @@ -479,6 +482,14 @@ H5O_debug_real(H5F_t *f, hid_t dxpl_id, H5O_t *oh, haddr_t addr, FILE *stream, i HDfprintf(stream, "%sWU", (flag_printed ? ", " : "<")); flag_printed = TRUE; } /* end if */ + if(oh->mesg[i].flags & H5O_MSG_FLAG_SHAREABLE) { + HDfprintf(stream, "%sSA", (flag_printed ? ", " : "<")); + flag_printed = TRUE; + } /* end if */ + if(oh->mesg[i].flags & H5O_MSG_FLAG_FAIL_IF_UNKNOWN_ALWAYS) { + HDfprintf(stream, "%sFIUA", (flag_printed ? ", " : "<")); + flag_printed = TRUE; + } /* end if */ if(!flag_printed) HDfprintf(stream, "-"); HDfprintf(stream, ">\n"); diff --git a/src/H5Olink.c b/src/H5Olink.c index 53191ca..7e70196 100644 --- a/src/H5Olink.c +++ b/src/H5Olink.c @@ -834,7 +834,7 @@ H5O_link_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const void HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, "Link Name Character Set:", (lnk->cset == H5T_CSET_ASCII ? "ASCII" : (lnk->cset == H5T_CSET_UTF8 ? "UTF-8" : "Unknown"))); - HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s '%s'\n", indent, "", fwidth, "Link Name:", lnk->name); /* Display link-specific information */ @@ -845,7 +845,7 @@ H5O_link_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const void break; case H5L_TYPE_SOFT: - HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s '%s'\n", indent, "", fwidth, "Link Value:", lnk->u.soft.name); break; diff --git a/src/H5SM.c b/src/H5SM.c index 1d391f1..1fc3b85 100644 --- a/src/H5SM.c +++ b/src/H5SM.c @@ -2580,14 +2580,15 @@ done: *------------------------------------------------------------------------- */ herr_t -H5SM_list_debug(H5F_t *f, hid_t dxpl_id, haddr_t list_addr, - FILE *stream, int indent, int fwidth, - unsigned table_vers, size_t num_messages) +H5SM_list_debug(H5F_t *f, hid_t dxpl_id, haddr_t list_addr, FILE *stream, + int indent, int fwidth, haddr_t table_addr) { - + H5SM_master_table_t *table = NULL; /* SOHM master table */ H5SM_list_t *list = NULL; /* SOHM index list for message type (if in list form) */ - H5SM_index_header_t header; /* A "false" header used to read the list */ - H5SM_list_cache_ud_t cache_udata; /* User-data for metadata cache callback */ + H5SM_list_cache_ud_t lst_cache_udata; /* List user-data for metadata cache callback */ + H5SM_table_cache_ud_t tbl_cache_udata; /* Table user-data for metadata cache callback */ + H5HF_t *fh = NULL; /* Fractal heap for SOHM messages */ + unsigned index_num; /* Index of list, within master table */ unsigned x; /* Counter variable */ herr_t ret_value = SUCCEED; /* Return value */ @@ -2599,36 +2600,51 @@ H5SM_list_debug(H5F_t *f, hid_t dxpl_id, haddr_t list_addr, HDassert(indent >= 0); HDassert(fwidth >= 0); - /* Check arguments. Version must be 0, the only version implemented so far */ - if(table_vers > H5SM_LIST_VERSION) - HGOTO_ERROR(H5E_SOHM, H5E_BADVALUE, FAIL, "unknown shared message list version") - if(num_messages == 0 || num_messages > H5O_SHMESG_MAX_LIST_SIZE) - HGOTO_ERROR(H5E_SOHM, H5E_BADVALUE, FAIL, "number of indexes must be between 1 and H5O_SHMESG_MAX_NINDEXES") + /* Set up user data for callback */ + tbl_cache_udata.f = f; + + /* Look up the master SOHM table */ + if(NULL == (table = (H5SM_master_table_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_TABLE, table_addr, &tbl_cache_udata, H5AC__READ_ONLY_FLAG))) + HGOTO_ERROR(H5E_SOHM, H5E_CANTPROTECT, FAIL, "unable to load SOHM master table") - /* Create a temporary header using the arguments. The cache needs this to load the list. */ - HDmemset(&header, 0, sizeof(H5SM_index_header_t)); - header.list_max = header.num_messages = num_messages; - header.index_type = H5SM_LIST; - header.index_addr = list_addr; + /* Determine which index the list is part of */ + index_num = table->num_indexes; + for(x = 0; x < table->num_indexes; x++) { + if(H5F_addr_eq(table->indexes[x].index_addr, list_addr)) { + index_num = x; + break; + } /* end if */ + } /* end for */ + if(x == table->num_indexes) + HGOTO_ERROR(H5E_SOHM, H5E_BADVALUE, FAIL, "list address doesn't match address for any indices in table") /* Set up user data for metadata cache callback */ - cache_udata.f = f; - cache_udata.header = &header; + lst_cache_udata.f = f; + lst_cache_udata.header = &(table->indexes[index_num]); /* Get the list from the cache */ - if(NULL == (list = (H5SM_list_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_LIST, list_addr, &cache_udata, H5AC__READ_ONLY_FLAG))) + if(NULL == (list = (H5SM_list_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_LIST, list_addr, &lst_cache_udata, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_SOHM, H5E_CANTPROTECT, FAIL, "unable to load SOHM index") + /* Open the heap, if one exists */ + if(H5F_addr_defined(table->indexes[index_num].heap_addr)) + if(NULL == (fh = H5HF_open(f, dxpl_id, table->indexes[index_num].heap_addr))) + HGOTO_ERROR(H5E_SOHM, H5E_CANTOPENOBJ, FAIL, "unable to open SOHM heap") + HDfprintf(stream, "%*sShared Message List Index...\n", indent, ""); - for(x = 0; x < num_messages; ++x) { + for(x = 0; x < table->indexes[index_num].num_messages; ++x) { HDfprintf(stream, "%*sShared Object Header Message %d...\n", indent, "", x); HDfprintf(stream, "%*s%-*s %08lu\n", indent + 3, "", fwidth, "Hash value:", (unsigned long)list->messages[x].hash); if(list->messages[x].location == H5SM_IN_HEAP) { + HDassert(fh); + HDfprintf(stream, "%*s%-*s %s\n", indent + 3, "", fwidth, "Location:", "in heap"); - HDfprintf(stream, "%*s%-*s %Zu\n", indent + 3, "", fwidth, + HDfprintf(stream, "%*s%-*s 0x%Zx\n", indent + 3, "", fwidth, "Heap ID:", list->messages[x].u.heap_loc.fheap_id); +H5HF_id_print(fh, dxpl_id, + &(list->messages[x].u.heap_loc.fheap_id), stream, indent + 6, (fwidth - 3)); HDfprintf(stream, "%*s%-*s %u\n", indent + 3, "", fwidth, "Reference count:", list->messages[x].u.heap_loc.ref_count); } /* end if */ @@ -2648,8 +2664,12 @@ H5SM_list_debug(H5F_t *f, hid_t dxpl_id, haddr_t list_addr, } /* end for */ done: + if(fh && H5HF_close(fh, dxpl_id) < 0) + HDONE_ERROR(H5E_SOHM, H5E_CANTCLOSEOBJ, FAIL, "unable to close SOHM heap") if(list && H5AC_unprotect(f, dxpl_id, H5AC_SOHM_LIST, list_addr, list, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_SOHM, H5E_CANTUNPROTECT, FAIL, "unable to close SOHM index") + if(table && H5AC_unprotect(f, dxpl_id, H5AC_SOHM_TABLE, table_addr, table, H5AC__NO_FLAGS_SET) < 0) + HDONE_ERROR(H5E_SOHM, H5E_CANTUNPROTECT, FAIL, "unable to close SOHM master table") FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) } /* end H5SM_list_debug() */ diff --git a/src/H5SMbtree2.c b/src/H5SMbtree2.c index e18e9fb..7706cbd 100644 --- a/src/H5SMbtree2.c +++ b/src/H5SMbtree2.c @@ -48,9 +48,8 @@ static void *H5SM_bt2_crt_context(void *udata); static herr_t H5SM_bt2_dst_context(void *ctx); static herr_t H5SM_bt2_store(void *native, const void *udata); -static herr_t H5SM_bt2_debug(FILE *stream, const H5F_t *f, hid_t dxpl_id, - int indent, int fwidth, const void *record, const void *_udata); -static void *H5SM_bt2_crt_dbg_context(H5F_t *f, hid_t dxpl_id, haddr_t addr); +static herr_t H5SM_bt2_debug(FILE *stream, int indent, int fwidth, + const void *record); /*****************************/ @@ -67,9 +66,7 @@ const H5B2_class_t H5SM_INDEX[1]={{ /* B-tree class information */ H5SM_message_compare, /* Record comparison callback */ H5SM_message_encode, /* Record encoding callback */ H5SM_message_decode, /* Record decoding callback */ - H5SM_bt2_debug, /* Record debugging callback */ - H5SM_bt2_crt_dbg_context, /* Create debugging context */ - H5SM_bt2_dst_context /* Destroy debugging context */ + H5SM_bt2_debug /* Record debugging callback */ }}; @@ -195,8 +192,7 @@ H5SM_bt2_store(void *native, const void *udata) *------------------------------------------------------------------------- */ static herr_t -H5SM_bt2_debug(FILE *stream, const H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, - int indent, int fwidth, const void *record, const void H5_ATTR_UNUSED *_udata) +H5SM_bt2_debug(FILE *stream, int indent, int fwidth, const void *record) { const H5SM_sohm_t *sohm = (const H5SM_sohm_t *)record; @@ -218,45 +214,6 @@ H5SM_bt2_debug(FILE *stream, const H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED /*------------------------------------------------------------------------- - * Function: H5SM_bt2_crt_dbg_context - * - * Purpose: Create context for debugging callback - * - * Return: Success: non-NULL - * Failure: NULL - * - * Programmer: Quincey Koziol - * Tuesday, December 1, 2009 - * - *------------------------------------------------------------------------- - */ -static void * -H5SM_bt2_crt_dbg_context(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, haddr_t H5_ATTR_UNUSED addr) -{ - H5SM_bt2_ctx_t *ctx; /* Callback context structure */ - void *ret_value; /* Return value */ - - FUNC_ENTER_NOAPI_NOINIT - - /* Sanity check */ - HDassert(f); - - /* Allocate callback context */ - if(NULL == (ctx = H5FL_MALLOC(H5SM_bt2_ctx_t))) - HGOTO_ERROR(H5E_HEAP, H5E_CANTALLOC, NULL, "can't allocate callback context") - - /* Determine the size of addresses & lengths in the file */ - ctx->sizeof_addr = H5F_SIZEOF_ADDR(f); - - /* Set return value */ - ret_value = ctx; - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* H5SM_bt2_crt_dbg_context() */ - - -/*------------------------------------------------------------------------- * Function: H5SM_bt2_convert_to_list_op * * Purpose: An H5B2_remove_t callback function to convert a SOHM diff --git a/src/H5SMprivate.h b/src/H5SMprivate.h index d072434..57afacf 100644 --- a/src/H5SMprivate.h +++ b/src/H5SMprivate.h @@ -74,7 +74,7 @@ H5_DLL herr_t H5SM_table_debug(H5F_t *f, hid_t dxpl_id, haddr_t table_addr, FILE *stream, int indent, int fwidth, unsigned table_vers, unsigned num_indexes); H5_DLL herr_t H5SM_list_debug(H5F_t *f, hid_t dxpl_id, haddr_t list_addr, - FILE *stream, int indent, int fwidth, unsigned list_vers, size_t num_messages); + FILE *stream, int indent, int fwidth, haddr_t table_addr); #endif /*_H5SMprivate_H*/ diff --git a/tools/misc/h5debug.c b/tools/misc/h5debug.c index 87c112a..be6d089 100644 --- a/tools/misc/h5debug.c +++ b/tools/misc/h5debug.c @@ -355,11 +355,11 @@ main(int argc, char *argv[]) /* Build array of chunk dimensions */ ndims = (unsigned)extra; - dim[0] = extra2; + dim[0] = (uint32_t)extra2; if(ndims > 1) - dim[1] = extra3; + dim[1] = (uint32_t)extra3; if(ndims > 2) - dim[2] = extra4; + dim[2] = (uint32_t)extra4; /* Check for dimension error */ if(ndims > 3) { @@ -502,14 +502,14 @@ main(int argc, char *argv[]) */ /* Check for enough valid parameters */ - if(extra2 == 0) { - HDfprintf(stderr, "ERROR: Need list format version and number of messages in order to shared message list\n"); + if(extra == 0) { + HDfprintf(stderr, "ERROR: Need shared message header address in order to shared message list\n"); HDfprintf(stderr, "Shared message list usage:\n"); - HDfprintf(stderr, "\th5debug \n"); + HDfprintf(stderr, "\th5debug \n"); HDexit(4); } /* end if */ - status = H5SM_list_debug(f, H5P_DATASET_XFER_DEFAULT, addr, stdout, 0, VCOL, (unsigned) extra, (size_t) extra2); + status = H5SM_list_debug(f, H5P_DATASET_XFER_DEFAULT, addr, stdout, 0, VCOL, (haddr_t)extra); } else if(!HDmemcmp(sig, H5EA_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC)) { /* -- cgit v0.12 From abdb2a64566f64f7602f6ee8664d121a74988e3b Mon Sep 17 00:00:00 2001 From: HDF Tester Date: Sun, 23 Aug 2015 19:21:39 -0500 Subject: [svn-r27551] Snapshot version 1.9 release 228 --- README.txt | 2 +- c++/src/Makefile.in | 2 +- c++/src/cpp_doc_config | 2 +- config/lt_vers.am | 2 +- configure | 22 +++++++++++----------- configure.ac | 2 +- fortran/src/Makefile.in | 5 ++--- hl/c++/src/Makefile.in | 2 +- hl/fortran/src/Makefile.in | 2 +- hl/src/Makefile.in | 2 +- release_docs/RELEASE.txt | 2 +- src/H5public.h | 4 ++-- src/Makefile.in | 2 +- 13 files changed, 25 insertions(+), 26 deletions(-) diff --git a/README.txt b/README.txt index 0803889..4d1b59a 100644 --- a/README.txt +++ b/README.txt @@ -1,4 +1,4 @@ -HDF5 version 1.9.228 currently under development +HDF5 version 1.9.229 currently under development Please refer to the release_docs/INSTALL file for installation instructions. ------------------------------------------------------------------------------ diff --git a/c++/src/Makefile.in b/c++/src/Makefile.in index 6d47efc..e882e8b 100644 --- a/c++/src/Makefile.in +++ b/c++/src/Makefile.in @@ -688,7 +688,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 # After making changes, run bin/reconfigure to update other configure related # files like Makefile.in. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 218 +LT_VERS_REVISION = 219 LT_VERS_AGE = 0 # This is our main target diff --git a/c++/src/cpp_doc_config b/c++/src/cpp_doc_config index 36edb72..6624fad 100644 --- a/c++/src/cpp_doc_config +++ b/c++/src/cpp_doc_config @@ -38,7 +38,7 @@ PROJECT_NAME = "HDF5 C++ API" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = "1.9.228 currently under development" +PROJECT_NUMBER = "1.9.229 currently under development" # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/config/lt_vers.am b/config/lt_vers.am index 5ad05c6..20959db 100644 --- a/config/lt_vers.am +++ b/config/lt_vers.am @@ -19,7 +19,7 @@ # After making changes, run bin/reconfigure to update other configure related # files like Makefile.in. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 218 +LT_VERS_REVISION = 219 LT_VERS_AGE = 0 ## If the API changes *at all*, increment LT_VERS_INTERFACE and diff --git a/configure b/configure index 42e9b81..e9713e2 100755 --- a/configure +++ b/configure @@ -1,7 +1,7 @@ #! /bin/sh # From configure.ac Id: configure.ac 22697 2012-08-19 14:35:47Z hdftest . # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for HDF5 1.9.228. +# Generated by GNU Autoconf 2.69 for HDF5 1.9.229. # # Report bugs to . # @@ -591,8 +591,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='HDF5' PACKAGE_TARNAME='hdf5' -PACKAGE_VERSION='1.9.228' -PACKAGE_STRING='HDF5 1.9.228' +PACKAGE_VERSION='1.9.229' +PACKAGE_STRING='HDF5 1.9.229' PACKAGE_BUGREPORT='help@hdfgroup.org' PACKAGE_URL='' @@ -1479,7 +1479,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures HDF5 1.9.228 to adapt to many kinds of systems. +\`configure' configures HDF5 1.9.229 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1549,7 +1549,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of HDF5 1.9.228:";; + short | recursive ) echo "Configuration of HDF5 1.9.229:";; esac cat <<\_ACEOF @@ -1738,7 +1738,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -HDF5 configure 1.9.228 +HDF5 configure 1.9.229 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2653,7 +2653,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by HDF5 $as_me 1.9.228, which was +It was created by HDF5 $as_me 1.9.229, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3525,7 +3525,7 @@ fi # Define the identity of the package. PACKAGE='hdf5' - VERSION='1.9.228' + VERSION='1.9.229' cat >>confdefs.h <<_ACEOF @@ -29464,7 +29464,7 @@ Usage: $0 [OPTIONS] Report bugs to ." lt_cl_version="\ -HDF5 config.lt 1.9.228 +HDF5 config.lt 1.9.229 configured by $0, generated by GNU Autoconf 2.69. Copyright (C) 2011 Free Software Foundation, Inc. @@ -31560,7 +31560,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by HDF5 $as_me 1.9.228, which was +This file was extended by HDF5 $as_me 1.9.229, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -31626,7 +31626,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -HDF5 config.status 1.9.228 +HDF5 config.status 1.9.229 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/configure.ac b/configure.ac index 88d037c..b441cad 100644 --- a/configure.ac +++ b/configure.ac @@ -26,7 +26,7 @@ AC_PREREQ([2.69]) ## NOTE: Do not forget to change the version number here when we do a ## release!!! ## -AC_INIT([HDF5], [1.9.228], [help@hdfgroup.org]) +AC_INIT([HDF5], [1.9.229], [help@hdfgroup.org]) AC_CONFIG_SRCDIR([src/H5.c]) AC_CONFIG_HEADER([src/H5config.h]) diff --git a/fortran/src/Makefile.in b/fortran/src/Makefile.in index 3f95f08..563f75f 100644 --- a/fortran/src/Makefile.in +++ b/fortran/src/Makefile.in @@ -725,7 +725,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 # After making changes, run bin/reconfigure to update other configure related # files like Makefile.in. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 218 +LT_VERS_REVISION = 219 LT_VERS_AGE = 0 AM_FCLIBS = $(LIBHDF5) @@ -752,8 +752,7 @@ libhdf5_fortran_la_LIBADD = $(LIBHDF5) DISTCLEANFILES = h5fc # H5fortran_types.F90 and H5f90i.h are automatically generaed by -# H5match_types, and must be cleaned explicitly. H5fort_type_defines.h -# is generated by H5fortran_detect +# H5match_types, and must be cleaned explicitly. MOSTLYCLEANFILES = H5fortran_types.F90 H5f90i_gen.h @BUILD_PARALLEL_CONDITIONAL_FALSE@H5FC_NAME = h5fc diff --git a/hl/c++/src/Makefile.in b/hl/c++/src/Makefile.in index 525bbfc..4dcf546 100644 --- a/hl/c++/src/Makefile.in +++ b/hl/c++/src/Makefile.in @@ -680,7 +680,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 # After making changes, run bin/reconfigure to update other configure related # files like Makefile.in. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 218 +LT_VERS_REVISION = 219 LT_VERS_AGE = 0 # This is our main target diff --git a/hl/fortran/src/Makefile.in b/hl/fortran/src/Makefile.in index 12a91b0..6ceb7c7 100644 --- a/hl/fortran/src/Makefile.in +++ b/hl/fortran/src/Makefile.in @@ -708,7 +708,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 # After making changes, run bin/reconfigure to update other configure related # files like Makefile.in. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 218 +LT_VERS_REVISION = 219 LT_VERS_AGE = 0 # Our main target, the high-level fortran library diff --git a/hl/src/Makefile.in b/hl/src/Makefile.in index 9424b46..dff64ee 100644 --- a/hl/src/Makefile.in +++ b/hl/src/Makefile.in @@ -679,7 +679,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 # After making changes, run bin/reconfigure to update other configure related # files like Makefile.in. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 218 +LT_VERS_REVISION = 219 LT_VERS_AGE = 0 # This library is our main target. diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 003145b..849a340 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -1,4 +1,4 @@ -HDF5 version 1.9.228 currently under development +HDF5 version 1.9.229 currently under development ================================================================================ diff --git a/src/H5public.h b/src/H5public.h index 1b3711b..b9b4dd7 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -94,10 +94,10 @@ extern "C" { /* Version numbers */ #define H5_VERS_MAJOR 1 /* For major interface/format changes */ #define H5_VERS_MINOR 9 /* For minor interface/format changes */ -#define H5_VERS_RELEASE 228 /* For tweaks, bug-fixes, or development */ +#define H5_VERS_RELEASE 229 /* For tweaks, bug-fixes, or development */ #define H5_VERS_SUBRELEASE "" /* For pre-releases like snap0 */ /* Empty string for real releases. */ -#define H5_VERS_INFO "HDF5 library version: 1.9.228" /* Full version string */ +#define H5_VERS_INFO "HDF5 library version: 1.9.229" /* Full version string */ #define H5check() H5check_version(H5_VERS_MAJOR,H5_VERS_MINOR, \ H5_VERS_RELEASE) diff --git a/src/Makefile.in b/src/Makefile.in index 5db54f1..e5a991f 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -741,7 +741,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 # After making changes, run bin/reconfigure to update other configure related # files like Makefile.in. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 218 +LT_VERS_REVISION = 219 LT_VERS_AGE = 0 # Our main target, the HDF5 library -- cgit v0.12 From 49a27febbc450e68937e1edacaaa0804105a1a6a Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 24 Aug 2015 11:01:40 -0500 Subject: [svn-r27555] Merge cmake_ext_mod change --- config/cmake_ext_mod/HDFUseFortran.cmake | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/config/cmake_ext_mod/HDFUseFortran.cmake b/config/cmake_ext_mod/HDFUseFortran.cmake index 66a631f..c1df8cf 100644 --- a/config/cmake_ext_mod/HDFUseFortran.cmake +++ b/config/cmake_ext_mod/HDFUseFortran.cmake @@ -28,7 +28,6 @@ set (H5_FC_FUNC_ "H5_FC_FUNC_(name,NAME) ${CMAKE_MATCH_1}") # so this one is used for a sizeof test. #----------------------------------------------------------------------------- MACRO (CHECK_FORTRAN_FEATURE FUNCTION CODE VARIABLE) - if (NOT DEFINED ${VARIABLE}) message (STATUS "Testing Fortran ${FUNCTION}") if (CMAKE_REQUIRED_LIBRARIES) set (CHECK_FUNCTION_EXISTS_ADD_LIBRARIES @@ -40,7 +39,7 @@ MACRO (CHECK_FORTRAN_FEATURE FUNCTION CODE VARIABLE) ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompiler.f90 "${CODE}" ) - TRY_COMPILE (${VARIABLE} + TRY_COMPILE (RESULT_VAR ${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompiler.f90 CMAKE_FLAGS "${CHECK_FUNCTION_EXISTS_ADD_LIBRARIES}" @@ -51,21 +50,21 @@ MACRO (CHECK_FORTRAN_FEATURE FUNCTION CODE VARIABLE) # message ( "Test result ${OUTPUT}") # message ( "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ") - if (${VARIABLE}) + if (${RESULT_VAR}) set (${VARIABLE} 1 CACHE INTERNAL "Have Fortran function ${FUNCTION}") message (STATUS "Testing Fortran ${FUNCTION} - OK") file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log "Determining if the Fortran ${FUNCTION} exists passed with the following output:\n" "${OUTPUT}\n\n" ) - else (${VARIABLE}) + else () message (STATUS "Testing Fortran ${FUNCTION} - Fail") - set (${VARIABLE} "" CACHE INTERNAL "Have Fortran function ${FUNCTION}") + set (${VARIABLE} 0 CACHE INTERNAL "Have Fortran function ${FUNCTION}") file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "Determining if the Fortran ${FUNCTION} exists failed with the following output:\n" "${OUTPUT}\n\n") - endif (${VARIABLE}) - endif (NOT DEFINED ${VARIABLE}) + endif () + ENDMACRO (CHECK_FORTRAN_FEATURE) #----------------------------------------------------------------------------- @@ -77,6 +76,7 @@ ENDMACRO (CHECK_FORTRAN_FEATURE) #----------------------------------------------------------------------------- # Check for Non-standard extension intrinsic function SIZEOF +set(FORTRAN_HAVE_SIZEOF FALSE) CHECK_FORTRAN_FEATURE(sizeof " PROGRAM main @@ -87,6 +87,7 @@ CHECK_FORTRAN_FEATURE(sizeof ) # Check for F2008 standard intrinsic function C_SIZEOF +set(FORTRAN_HAVE_C_SIZEOF FALSE) CHECK_FORTRAN_FEATURE(c_sizeof " PROGRAM main @@ -112,6 +113,7 @@ CHECK_FORTRAN_FEATURE(storage_size ) # Check for F2008 standard intrinsic module "ISO_FORTRAN_ENV" +set(HAVE_ISO_FORTRAN_ENV FALSE) CHECK_FORTRAN_FEATURE(ISO_FORTRAN_ENV " PROGRAM main @@ -121,6 +123,7 @@ CHECK_FORTRAN_FEATURE(ISO_FORTRAN_ENV HAVE_ISO_FORTRAN_ENV ) +set(FORTRAN_DEFAULT_REAL_NOT_DOUBLE FALSE) CHECK_FORTRAN_FEATURE(RealIsNotDouble " MODULE type_mod @@ -150,6 +153,7 @@ CHECK_FORTRAN_FEATURE(RealIsNotDouble #----------------------------------------------------------------------------- # Checks if the ISO_C_BINDING module meets all the requirements #----------------------------------------------------------------------------- +set(FORTRAN_HAVE_ISO_C_BINDING FALSE) CHECK_FORTRAN_FEATURE(iso_c_binding " PROGRAM main -- cgit v0.12 From 9d625c0580409601de0f69c1317c7be4af9a122f Mon Sep 17 00:00:00 2001 From: Scot Breitenfeld Date: Mon, 24 Aug 2015 11:05:05 -0500 Subject: [svn-r27556] Added include for build_mod directory. Tested: h5committest. --- fortran/src/CMakeLists.txt | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/fortran/src/CMakeLists.txt b/fortran/src/CMakeLists.txt index 8f63b3c..261e52a 100644 --- a/fortran/src/CMakeLists.txt +++ b/fortran/src/CMakeLists.txt @@ -62,7 +62,22 @@ set_target_properties (H5_buildiface PROPERTIES Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY} ) -INCLUDE_DIRECTORIES (${HDF5_F90_BINARY_DIR} ${CMAKE_Fortran_MODULE_DIRECTORY}) +if (BUILD_SHARED_LIBS) + if (WIN32) + set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared/\${BUILD_TYPE}) + else (WIN32) + set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared) + endif (WIN32) +else (BUILD_SHARED_LIBS) + if (WIN32) + set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static/\${BUILD_TYPE}) + else (WIN32) + set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static) + endif (WIN32) +endif (BUILD_SHARED_LIBS) + +INCLUDE_DIRECTORIES (${HDF5_F90_BINARY_DIR} ${CMAKE_Fortran_MODULE_DIRECTORY} ${MOD_BUILD_DIR}) + #----------------------------------------------------------------------------- add_executable (H5match_types ${HDF5_F90_BINARY_DIR}/H5fort_type_defines.h @@ -251,20 +266,6 @@ install ( fortheaders ) -if (BUILD_SHARED_LIBS) - if (WIN32) - set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared/\${BUILD_TYPE}) - else (WIN32) - set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared) - endif (WIN32) -else (BUILD_SHARED_LIBS) - if (WIN32) - set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static/\${BUILD_TYPE}) - else (WIN32) - set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static) - endif (WIN32) -endif (BUILD_SHARED_LIBS) - set (mod_files ${MOD_BUILD_DIR}/h5fortran_types.mod ${MOD_BUILD_DIR}/hdf5.mod -- cgit v0.12 From 47d97ed2c072926a2039e29f0ddda561fcaf502d Mon Sep 17 00:00:00 2001 From: Scot Breitenfeld Date: Mon, 24 Aug 2015 11:07:17 -0500 Subject: [svn-r27557] Added build_mod directory and updated the C try_run macro to not check for definitions and does not return unused arguments. --- config/cmake/HDF5UseFortran.cmake | 30 +++++++++++------------------- hl/fortran/src/CMakeLists.txt | 28 +++++++++++++++------------- 2 files changed, 26 insertions(+), 32 deletions(-) diff --git a/config/cmake/HDF5UseFortran.cmake b/config/cmake/HDF5UseFortran.cmake index 02f97f0..f445f54 100644 --- a/config/cmake/HDF5UseFortran.cmake +++ b/config/cmake/HDF5UseFortran.cmake @@ -381,9 +381,7 @@ ENABLE_LANGUAGE (C) # The provided CMake C macros don't provide a general compile/run function # so this one is used. #----------------------------------------------------------------------------- -MACRO (C_RUN FUNCTION CODE RUN_RESULT_VAR COMPILE_RESULT_VAR RETURN) -# MSB CHECK WHY THIS CHECK? -# if (NOT DEFINED ${RUN_RESULT_VAR}) +MACRO (C_RUN FUNCTION CODE RETURN) message (STATUS "Detecting C ${FUNCTION}") if (CMAKE_REQUIRED_LIBRARIES) set (CHECK_FUNCTION_EXISTS_ADD_LIBRARIES @@ -395,7 +393,7 @@ MACRO (C_RUN FUNCTION CODE RUN_RESULT_VAR COMPILE_RESULT_VAR RETURN) ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testCCompiler1.c ${CODE} ) - TRY_RUN (${RUN_RESULT_VAR} ${COMPILE_RESULT_VAR} + TRY_RUN (RUN_RESULT_VAR COMPILE_RESULT_VAR ${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testCCompiler1.c CMAKE_FLAGS "${CHECK_FUNCTION_EXISTS_ADD_LIBRARIES}" @@ -404,18 +402,14 @@ MACRO (C_RUN FUNCTION CODE RUN_RESULT_VAR COMPILE_RESULT_VAR RETURN) set(${RETURN} ${OUTPUT}) - #message ( "Test result1 ${RETURN} ") - #message ( "Test result3 ${RESULT} ") - #message ( "Test result2 ${CMAKE_MATCH_0} ") - #message ( "Test result4 ${CMAKE_MATCH_1} ") #message ( "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ") - #message ( "Test result ${COMPILE_RESULT_VAR} ") + #message ( "Test COMPILE_RESULT_VAR ${COMPILE_RESULT_VAR} ") #message ( "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ") - #message ( "Test result ${RUN_RESULT_VAR} ") + #message ( "Test RUN_RESULT_VAR ${RUN_RESULT_VAR} ") #message ( "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ") if (${COMPILE_RESULT_VAR}) - if (${RUN_RESULT_VAR} MATCHES 0) + if (${RUN_RESULT_VAR} MATCHES 1) set (${RUN_RESULT_VAR} 1 CACHE INTERNAL "Have C function ${FUNCTION}") message (STATUS "Testing C ${FUNCTION} - OK") file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log @@ -424,13 +418,14 @@ MACRO (C_RUN FUNCTION CODE RUN_RESULT_VAR COMPILE_RESULT_VAR RETURN) ) else () message (STATUS "Testing C ${FUNCTION} - Fail") - set (${RUN_RESULT_VAR} "" CACHE INTERNAL "Have C function ${FUNCTION}") + set (${RUN_RESULT_VAR} 0 CACHE INTERNAL "Have C function ${FUNCTION}") file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "Determining if the C ${FUNCTION} exists failed with the following output:\n" "${OUTPUT}\n\n") endif () + else () + message (FATAL_ERROR "Compilation of C ${FUNCTION} - Failed") endif() -# endif (NOT DEFINED ${RUN_RESULT_VAR}) ENDMACRO (C_RUN) set(PROG_SRC @@ -455,17 +450,14 @@ set(PROG_SRC #else #define C_LDBL_DIG LDBL_DIG #endif - void main() { + int main() { printf(\"%d\\\\n%d\\\\n\", C_LDBL_DIG, C_FLT128_DIG)\\\; + return 1\\\; } " ) -C_RUN("maximum decimal precision for C" ${PROG_SRC} - XX - YY - PROG_OUTPUT -) +C_RUN("maximum decimal precision for C" ${PROG_SRC} PROG_OUTPUT) # dnl The output from the above program will be: # dnl -- LINE 1 -- long double decimal precision diff --git a/hl/fortran/src/CMakeLists.txt b/hl/fortran/src/CMakeLists.txt index 9d110a8..ed2e542 100644 --- a/hl/fortran/src/CMakeLists.txt +++ b/hl/fortran/src/CMakeLists.txt @@ -36,6 +36,20 @@ set_target_properties (H5HL_buildiface PROPERTIES Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY} ) +if (BUILD_SHARED_LIBS) + if (WIN32) + set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared/\${BUILD_TYPE}) + else (WIN32) + set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared) + endif (WIN32) +else (BUILD_SHARED_LIBS) + if (WIN32) + set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static/\${BUILD_TYPE}) + else (WIN32) + set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static) + endif (WIN32) +endif (BUILD_SHARED_LIBS) + #----------------------------------------------------------------------------- # Setup include Directories #----------------------------------------------------------------------------- @@ -44,6 +58,7 @@ INCLUDE_DIRECTORIES ( ${HDF5_F90_SRC_DIR}/src ${HDF5_F90_BINARY_DIR} ${CMAKE_Fortran_MODULE_DIRECTORY} + ${MOD_BUILD_DIR} ) #----------------------------------------------------------------------------- @@ -169,19 +184,6 @@ endif (BUILD_SHARED_LIBS) # Add file(s) to CMake Install #----------------------------------------------------------------------------- -if (BUILD_SHARED_LIBS) - if (WIN32) - set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared/\${BUILD_TYPE}) - else (WIN32) - set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared) - endif (WIN32) -else (BUILD_SHARED_LIBS) - if (WIN32) - set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static/\${BUILD_TYPE}) - else (WIN32) - set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static) - endif (WIN32) -endif (BUILD_SHARED_LIBS) set (mod_files ${MOD_BUILD_DIR}/h5ds.mod -- cgit v0.12 From 76d7d3cb976feced595c978575f1e46a7b67b223 Mon Sep 17 00:00:00 2001 From: Scot Breitenfeld Date: Mon, 24 Aug 2015 14:22:55 -0500 Subject: [svn-r27570] Fixed issue with REAL max detection. tested: h5committest --- config/cmake/HDF5UseFortran.cmake | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/config/cmake/HDF5UseFortran.cmake b/config/cmake/HDF5UseFortran.cmake index f445f54..8ca10a7 100644 --- a/config/cmake/HDF5UseFortran.cmake +++ b/config/cmake/HDF5UseFortran.cmake @@ -227,9 +227,9 @@ message ( " ........MAX DECIMAL PRECISION ${H5_PAC_FC_MAX_REAL_PRECISION}") # ********** # INTEGERS # ********** -string(REGEX REPLACE "," ";" VAR_KIND "${pac_validIntKinds}") +string(REGEX REPLACE "," ";" VAR "${pac_validIntKinds}") -foreach( KIND ${VAR_KIND} ) +foreach( KIND ${VAR} ) set(PROG_SRC " PROGRAM main @@ -262,14 +262,14 @@ message("...FOUND SIZEOF for INTEGER KINDs ${PAC_FC_ALL_INTEGER_KINDS_SIZEOF}") # ********** # REALS # ********** -string(REGEX REPLACE "," ";" VAR_KIND "${pac_validRealKinds}") +string(REGEX REPLACE "," ";" VAR "${pac_validRealKinds}") #find the maximum kind of the real -list(LENGTH VAR_KIND LEN_VAR_KIND) -MATH (EXPR _LEN "${LEN_VAR_KIND} - 1") -list(GET VAR_KIND ${_LEN} max_real_fortran_kind) +list(LENGTH VAR LEN_VAR) +MATH (EXPR _LEN "${LEN_VAR}-1") +list(GET VAR ${_LEN} max_real_fortran_kind) -foreach( KIND ${VAR_KIND} ) +foreach( KIND ${VAR} ) set(PROG_SRC " PROGRAM main @@ -299,12 +299,14 @@ set(H5CONFIG_F_RKIND_SIZEOF "INTEGER, DIMENSION(1:num_rkinds) :: rkind_sizeof = message("...FOUND SIZEOF for REAL KINDs \{${pack_real_sizeof}\}") +set(PAC_FC_ALL_REAL_KINDS_SIZEOF "\{${pack_real_sizeof}\}") + #find the maximum kind of the real -list(LENGTH VAR_KIND LEN_VAR_KIND) -MATH (EXPR _LEN "${LEN_VAR_KIND} - 1") -list(GET VAR_KIND ${_LEN} max_real_fortran_sizeof) +string(REGEX REPLACE "," ";" VAR "${pack_real_sizeof}") +list(LENGTH VAR LEN_VAR) +MATH (EXPR _LEN "${LEN_VAR}-1") +list(GET VAR ${_LEN} max_real_fortran_sizeof) -set(PAC_FC_ALL_REAL_KINDS_SIZEOF "\{${pack_real_sizeof}\}") #----------------------------------------------------------------------------- # Find sizeof of native kinds #----------------------------------------------------------------------------- -- cgit v0.12 From 2e6100fb23e496cab62ce81a3e08719563c61dc1 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Mon, 24 Aug 2015 15:19:39 -0500 Subject: [svn-r27572] Removed VMS-specific code from the library. The only remaining code consists of a few floating-point tests that rely on pre-generated and checked-in VMS files. These have been left alone, even though they will not be possible to recreate, since testing VMS float behavior is still important. Tested on: h5committest --- MANIFEST | 1 - README.txt | 2 +- bin/chkcopyright | 43 --------------- c++/src/H5IdComponent.cpp | 6 --- c++/test/tfile.cpp | 12 ++--- c++/test/tlinks.cpp | 61 --------------------- fortran/src/H5f90proto.h | 3 -- release_docs/INSTALL_VMS.txt | 77 --------------------------- src/H5FDcore.c | 22 -------- src/H5FDdirect.c | 15 ------ src/H5FDlog.c | 24 +-------- src/H5FDsec2.c | 22 +------- src/H5FDstdio.c | 15 ------ src/H5Lexternal.c | 2 - src/H5Tconv.c | 7 ++- src/H5private.h | 35 ++---------- src/H5system.c | 62 +--------------------- test/H5srcdir.h | 16 ------ test/dt_arith.c | 118 ++--------------------------------------- test/dtypes.c | 4 -- test/fheap.c | 2 - test/flush2.c | 4 -- test/gen_cross.c | 4 ++ test/getname.c | 2 - test/lheap.c | 4 -- test/links.c | 29 +--------- test/links_env.c | 4 -- test/objcopy.c | 2 - test/stab.c | 2 - test/tconfig.c | 9 ---- test/tfile.c | 14 +---- test/th5o.c | 2 - test/tsohm.c | 3 -- tools/lib/h5diff_array.c | 22 -------- tools/lib/h5tools_str.c | 4 -- tools/perform/sio_standalone.h | 11 ---- tools/perform/zip_perf.c | 9 ---- 37 files changed, 27 insertions(+), 647 deletions(-) delete mode 100644 release_docs/INSTALL_VMS.txt diff --git a/MANIFEST b/MANIFEST index b506522..b18c4ee 100644 --- a/MANIFEST +++ b/MANIFEST @@ -422,7 +422,6 @@ ./release_docs/INSTALL_CMake.txt ./release_docs/INSTALL_Cygwin.txt ./release_docs/INSTALL_parallel -./release_docs/INSTALL_VMS.txt ./release_docs/INSTALL_Windows.txt ./release_docs/RELEASE.txt ./release_docs/USING_HDF5_CMake.txt diff --git a/README.txt b/README.txt index 4d1b59a..a78bec1 100644 --- a/README.txt +++ b/README.txt @@ -8,7 +8,7 @@ specific to this release of the library. Several INSTALL* files can also be found in the release_docs/ directory: INSTALL contains instructions for compiling and installing the library; INSTALL_parallel contains instructions for installing the parallel version of the library; similarly-named files -contain instructions for VMS and several environments on MS Windows systems. +contain instructions for several environments on MS Windows systems. Documentation for this release can be found at the following URL: http://www.hdfgroup.org/HDF5/doc/. diff --git a/bin/chkcopyright b/bin/chkcopyright index fe9fe49..07fcb24 100755 --- a/bin/chkcopyright +++ b/bin/chkcopyright @@ -56,7 +56,6 @@ HTM_COPYRIGHT=/tmp/h5chkright_HTM.$$ # HTML style copyright SH_COPYRIGHT=/tmp/h5chkright_SH.$$ # SHELL style copyright SH_COPYRIGHT2=/tmp/h5chkright_SH2.$$ # SHELL style copyright, 2nd style. WINBAT_COPYRIGHT=/tmp/h5chkright_WINBAT.$$ # Windows Batch file Copyright notice -VMSCMD_COPYRIGHT=/tmp/h5chkright_VMSCMD.$$ # VMS command file Copyright notice CONFIGURE_AC_COPYRIGHT=/tmp/h5chkright_CONFIGURE_AC.$$ # configure.ac file Copyright notice tmpfixfile=/tmp/h5chkright_fix.$$ # Temporary fixed copy of file @@ -223,22 +222,6 @@ dnl http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have dnl access to either file, you may request a copy from help@hdfgroup.org. EOF - # VMS command file Copyright notice - cat > ${VMSCMD_COPYRIGHT} << \EOF -$!# 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. -EOF - } # Initialization @@ -611,28 +594,6 @@ BATCH_FILE() } -# Check Windows Batch files -# -VMSCMD_FILE() -{ - f=$1 - case `MATCH_COPYRIGHT $VMSCMD_COPYRIGHT $f` in - PASSED) - PASSED $f - return - ;; - FAILED) - # show the difference - FAILED $f - $DIFF ${EXTRACTEDFILE} ${VMSCMD_COPYRIGHT} - if [ -n "$FIXIT" ]; then - FIX_COPYRIGHT $VMSCMD_COPYRIGHT $f - fi - ;; - esac -} - - # Check Configure.in type files # CONFIGURE_AC_FILE() @@ -834,10 +795,6 @@ while read file; do # Windows Batch files BATCH_FILE ${file} ;; - *.com ) - # VMS Command files - VMSCMD_FILE ${file} - ;; *.h5 | *.hdf5 ) # Ignore HDF5 data files continue diff --git a/c++/src/H5IdComponent.cpp b/c++/src/H5IdComponent.cpp index c01d41e..bcd69c4 100644 --- a/c++/src/H5IdComponent.cpp +++ b/c++/src/H5IdComponent.cpp @@ -285,15 +285,9 @@ IdComponent::~IdComponent() {} //-------------------------------------------------------------------------- H5std_string IdComponent::inMemFunc(const char* func_name) const { -#ifdef H5_VMS - H5std_string full_name = fromClass(); - full_name.append("::"); - full_name.append(func_name); -#else H5std_string full_name = func_name; full_name.insert(0, "::"); full_name.insert(0, fromClass()); -#endif /*H5_VMS*/ return (full_name); } diff --git a/c++/test/tfile.cpp b/c++/test/tfile.cpp index f3bbb16..f84ce3a 100644 --- a/c++/test/tfile.cpp +++ b/c++/test/tfile.cpp @@ -109,9 +109,7 @@ static void test_file_create() file1 = new H5File (FILE1, H5F_ACC_EXCL); // Try to create the same file with H5F_ACC_TRUNC. This should fail - // because file1 is the same file and is currently open. Skip it on - // OpenVMS because it creates another version of the file. -#ifndef H5_HAVE_FILE_VERSIONS + // because file1 is the same file and is currently open. try { H5File file2 (FILE1, H5F_ACC_TRUNC); // should throw E @@ -120,7 +118,6 @@ static void test_file_create() } catch( FileIException E ) // catch truncating existing file {} // do nothing, FAIL expected -#endif // H5_HAVE_FILE_VERSIONS // Close file1 delete file1; @@ -141,9 +138,7 @@ static void test_file_create() file1 = new H5File (FILE1, H5F_ACC_TRUNC); // Try to create first file again. This should fail because file1 - // is the same file and is currently open. Skip it on OpenVMS because - // it creates another version of the file. -#ifndef H5_HAVE_FILE_VERSIONS + // is the same file and is currently open. try { H5File file2 (FILE1, H5F_ACC_TRUNC); // should throw E @@ -154,7 +149,7 @@ static void test_file_create() {} // do nothing, FAIL expected // Try with H5F_ACC_EXCL. This should fail too because the file already - // exists. Skip it on OpenVMS because it creates another version of the file. + // exists. try { H5File file3 (FILE1, H5F_ACC_EXCL); // should throw E @@ -163,7 +158,6 @@ static void test_file_create() } catch( FileIException E ) // catching H5F_ACC_EXCL on existing file {} // do nothing, FAIL expected -#endif /*H5_HAVE_FILE_VERSIONS*/ // Get the file-creation template FileCreatPropList tmpl1 = file1->getCreatePlist(); diff --git a/c++/test/tlinks.cpp b/c++/test/tlinks.cpp index 291b649..33d10ea 100644 --- a/c++/test/tlinks.cpp +++ b/c++/test/tlinks.cpp @@ -58,60 +58,6 @@ /* File for external link test. Created with gen_udlinks.c */ #define LINKED_FILE "be_extlink2.h5" -#ifdef H5_VMS -#if 0 -const char *FILENAME[] = { - "links0", - "links1", - "links2", - "links3", - "links4a", /* 4 */ - "links4b", /* 5 */ - "links4c", /* 6 */ - "links4d", /* 7 */ - "links5", /* 8 */ - "links6", /* 9 */ - "links7", /* 10 */ - "links8", /* 11 */ - "extlinks0", /* 12: main files */ - "[.tmp]extlinks0", /* 13: */ - "extlinks1", /* 14: target files */ - "[.tmp]extlinks1", /* 15: */ - "extlinks2", /* 16: */ - "[.tmp]extlinks2", /* 17: */ - "extlinks3", /* 18: */ - "[.tmp]extlinks3", /* 19: */ - "extlinks4", /* 20: */ - "[.tmp]extlinks4", /* 21: */ - "extlinks5", /* 22: */ - "[.tmp]extlinks6", /* 23: */ - "extlinks7", /* 24: */ - "[.tmp]extlinks7", /* 25: */ - "[.tmp]extlinks8", /* 26: */ - "extlinks9", /* 27: */ - "[.tmp]extlinks9", /* 28: */ - "extlinks10", /* 29: */ /* TESTS for windows */ - "[.tmp]extlinks10", /* 30: */ - "[.tmp]extlinks11", /* 31: */ - "[.tmp]extlinks12", /* 32: */ - "extlinks13", /* 33: */ - "[.tmp]extlinks13", /* 34: */ - "[.tmp]extlinks14", /* 35: */ - "[.tmp]extlinks15", /* 36: */ - "extlinks16A", /* 37: */ /* TESTS for H5P_set_elink_fapl */ - "extlinks16B", /* 38: */ - "extlinks17", /* 39: */ - "extlinks18A", /* 40: */ - "extlinks18B", /* 41: */ - "extlinks19A", /* 42: */ - "extlinks19B", /* 43: */ - "extlinks20", /* 44: */ - NULL -}; -#endif // 0 - -#define TMPDIR "[.tmp]" -#else #if 0 const char *FILENAME[] = { "links0", @@ -165,7 +111,6 @@ const char *FILENAME[] = { #endif // 0 #define TMPDIR "tmp" -#endif #define FAMILY_SIZE 1024 #define CORE_INCREMENT 1024 @@ -574,16 +519,12 @@ void test_links() #ifndef H5_NO_DEPRECATED_SYMBOLS nerrors += test_deprec(my_fapl, new_format); #endif /* H5_NO_DEPRECATED_SYMBOLS */ -#ifndef H5_CANNOT_OPEN_TWICE nerrors += external_link_root(my_fapl, new_format) < 0 ? 1 : 0; -#endif /* H5_CANNOT_OPEN_TWICE */ nerrors += external_link_path(my_fapl, new_format) < 0 ? 1 : 0; nerrors += external_link_mult(my_fapl, new_format) < 0 ? 1 : 0; -#ifndef H5_CANNOT_OPEN_TWICE nerrors += external_link_self(envval, my_fapl, new_format) < 0 ? 1 : 0; nerrors += external_link_pingpong(envval, my_fapl, new_format) < 0 ? 1 : 0; nerrors += external_link_toomany(my_fapl, new_format) < 0 ? 1 : 0; -#endif /* H5_CANNOT_OPEN_TWICE */ nerrors += external_link_dangling(my_fapl, new_format) < 0 ? 1 : 0; nerrors += external_link_recursive(my_fapl, new_format) < 0 ? 1 : 0; nerrors += external_link_query(my_fapl, new_format) < 0 ? 1 : 0; @@ -591,9 +532,7 @@ void test_links() nerrors += external_link_unlink_dense(my_fapl, new_format) < 0 ? 1 : 0; nerrors += external_link_move(my_fapl, new_format) < 0 ? 1 : 0; nerrors += external_link_ride(my_fapl, new_format) < 0 ? 1 : 0; -#ifndef H5_CANNOT_OPEN_TWICE nerrors += external_link_closing(envval, my_fapl, new_format) < 0 ? 1 : 0; -#endif /* H5_CANNOT_OPEN_TWICE */ nerrors += external_link_endian(new_format) < 0 ? 1 : 0; nerrors += external_link_strong(my_fapl, new_format) < 0 ? 1 : 0; diff --git a/fortran/src/H5f90proto.h b/fortran/src/H5f90proto.h index b26e985..a07db22 100644 --- a/fortran/src/H5f90proto.h +++ b/fortran/src/H5f90proto.h @@ -23,9 +23,6 @@ H5_FCDLL char * HD5f2cstring (_fcd fdesc, size_t len); H5_FCDLL void HD5packFstring(char *src, char *dest, size_t len); -#ifdef H5_VMS -#define H5_FC_FUNC_(name, NAME) NAME -#endif /*H5_VMS*/ /* * Storage info struct used by H5O_info_t and H5F_info_t diff --git a/release_docs/INSTALL_VMS.txt b/release_docs/INSTALL_VMS.txt deleted file mode 100644 index c2a1463..0000000 --- a/release_docs/INSTALL_VMS.txt +++ /dev/null @@ -1,77 +0,0 @@ - Building and installation instructions for Alpha Open VMS - HDF5 1.8.6 release - 18 February 2011 - - - - CONTENTS - -------- - - 1. Obtaining HDF5 - 2. Building and testing HDF5 C, Fortran and C++ libraries, - and utilities - 3. Installing HDF5 libraries - 4. Known problems - - - 1.Obtaining HDF5 - - Please see INSTALL file in this directory for downloading instructions. - - 2. Building and testing HDF5 C, Fortran and C++ libraries and utilities. - - IMPORTANT: This version REQUIRES GNU ZLIB library to be installed - on a system. You may download the source code from - http://www.zlib.net/ - - - Use tar command to untar HDF5 source ball - - tar -xvf .tar - - - Change default directory to [..vms] - - Specify top HDF5 source directory in the build.com file - - Edit make.com: - specify path to ZLIB library - if necessary, modify compilation flags - Do NOT REMOVE /define=H5_VMS and /standard=strict_ansi qualifiers. - - Run build.com command file - @build - We recommend using batch queue to build and test this distribution. - The command file runs make.com and builds - C library, tests, and utilities - Fortran library and tests - C++ library and tests - It also runs test scripts to test C, Fortran and C++ libraries, and - h5dump, h5diff, h5ls, h5repack and h5import utilities. - - 3. Installing HDF5 libraries - - Modify install.com file to specify installation directory and run - @install - to install HDF5 C, Fortran, and C++ libraries, and utilities. - The script will create the directories shown below in the - installation directory: - - [.HDF5]... - [.HDF5.INCLUDE] - [.HDF5.LIB] - [.HDF5.BIN] - [.HDF5.EXAMPLES] - [.HDF5.EXAMPLES.C] - [.HDF5.EXAMPLES.F90] - [.HDF5.EXAMPLES.CXX] - - [.HDF5.EXAMPLES.*] directories contain make.com and check.com files - to build examples against the installed libraries and to verify - the installation. - - 3. Known problems - - - dsets test fails for test_scleoffset_double and - test_scleoffset_double_2 tests when G_FLOAT double is used - - There is no support for szip compression filter. - - Fortran multifile driver test fails; similar C test passes. - - - For help contact help@hdfgroup.org - diff --git a/src/H5FDcore.c b/src/H5FDcore.c index 32f23fb..e553f6b 100644 --- a/src/H5FDcore.c +++ b/src/H5FDcore.c @@ -65,11 +65,7 @@ typedef struct H5FD_core_t { * identify a file. */ dev_t device; /*file device number */ -#ifdef H5_VMS - ino_t inode[3]; /*file i-node number */ -#else ino_t inode; /*file i-node number */ -#endif /*H5_VMS*/ #else /* Files in windows are uniquely identified by the volume serial * number and the file index (both low and high parts). @@ -741,14 +737,7 @@ H5FD_core_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr) file->dwVolumeSerialNumber = fileinfo.dwVolumeSerialNumber; #else /* H5_HAVE_WIN32_API */ file->device = sb.st_dev; -#ifdef H5_VMS - file->inode[0] = sb.st_ino[0]; - file->inode[1] = sb.st_ino[1]; - file->inode[2] = sb.st_ino[2]; -#else file->inode = sb.st_ino; -#endif /* H5_VMS */ - #endif /* H5_HAVE_WIN32_API */ } /* end if */ @@ -981,13 +970,8 @@ H5FD_core_cmp(const H5FD_t *_f1, const H5FD_t *_f2) if(HDmemcmp(&(f1->device),&(f2->device),sizeof(dev_t))>0) HGOTO_DONE(1) #endif /* H5_DEV_T_IS_SCALAR */ -#ifndef H5_VMS if (f1->inode < f2->inode) HGOTO_DONE(-1) if (f1->inode > f2->inode) HGOTO_DONE(1) -#else - if(HDmemcmp(&(f1->inode),&(f2->inode),3*sizeof(ino_t))<0) HGOTO_DONE(-1) - if(HDmemcmp(&(f1->inode),&(f2->inode),3*sizeof(ino_t))>0) HGOTO_DONE(1) -#endif /* H5_VMS */ #endif /*H5_HAVE_WIN32_API*/ } /* end if */ @@ -1523,12 +1507,6 @@ H5FD_core_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t closing) if(0 == bError) HGOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to extend file properly") #else /* H5_HAVE_WIN32_API */ -#ifdef H5_VMS - /* Reset seek offset to the beginning of the file, so that the file isn't - * re-extended later. This may happen on Open VMS. */ - if(-1 == HDlseek(file->fd, (HDoff_t)0, SEEK_SET)) - HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to seek to proper position") -#endif /* H5_VMS */ if(-1 == HDftruncate(file->fd, (HDoff_t)new_eof)) HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to extend file properly") #endif /* H5_HAVE_WIN32_API */ diff --git a/src/H5FDdirect.c b/src/H5FDdirect.c index e9fd1ea..f4ee910 100644 --- a/src/H5FDdirect.c +++ b/src/H5FDdirect.c @@ -83,11 +83,7 @@ typedef struct H5FD_direct_t { * identify a file. */ dev_t device; /*file device number */ -#ifdef H5_VMS - ino_t inode[3]; /*file i-node number */ -#else ino_t inode; /*file i-node number */ -#endif /*H5_VMS*/ #else /* * On H5_HAVE_WIN32_API the low-order word of a unique identifier associated with the @@ -525,13 +521,7 @@ H5FD_direct_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxadd file->fileindexlo = fileinfo.nFileIndexLow; #else file->device = sb.st_dev; -#ifdef H5_VMS - file->inode[0] = sb.st_ino[0]; - file->inode[1] = sb.st_ino[1]; - file->inode[2] = sb.st_ino[2]; -#else file->inode = sb.st_ino; -#endif /*H5_VMS*/ #endif /*H5_HAVE_WIN32_API*/ file->fa.mboundary = fa->mboundary; file->fa.fbsize = fa->fbsize; @@ -673,13 +663,8 @@ H5FD_direct_cmp(const H5FD_t *_f1, const H5FD_t *_f2) if(HDmemcmp(&(f1->device),&(f2->device),sizeof(dev_t))>0) HGOTO_DONE(1) #endif /* H5_DEV_T_IS_SCALAR */ -#ifndef H5_VMS if (f1->inode < f2->inode) HGOTO_DONE(-1) if (f1->inode > f2->inode) HGOTO_DONE(1) -#else - if(HDmemcmp(&(f1->inode),&(f2->inode),3*sizeof(ino_t))<0) HGOTO_DONE(-1) - if(HDmemcmp(&(f1->inode),&(f2->inode),3*sizeof(ino_t))>0) HGOTO_DONE(1) -#endif /*H5_VMS*/ #endif diff --git a/src/H5FDlog.c b/src/H5FDlog.c index d2289fd..e8695c5 100644 --- a/src/H5FDlog.c +++ b/src/H5FDlog.c @@ -92,11 +92,7 @@ typedef struct H5FD_log_t { * Windows code further below. */ dev_t device; /* file device number */ -#ifdef H5_VMS - ino_t inode[3]; /* file i-node number */ -#else ino_t inode; /* file i-node number */ -#endif /*H5_VMS*/ #else /* Files in windows are uniquely identified by the volume serial * number and the file index (both low and high parts). @@ -587,14 +583,7 @@ H5FD_log_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr) file->dwVolumeSerialNumber = fileinfo.dwVolumeSerialNumber; #else /* H5_HAVE_WIN32_API */ file->device = sb.st_dev; -#ifdef H5_VMS - file->inode[0] = sb.st_ino[0]; - file->inode[1] = sb.st_ino[1]; - file->inode[2] = sb.st_ino[2]; -#else file->inode = sb.st_ino; -#endif /*H5_VMS*/ - #endif /* H5_HAVE_WIN32_API */ /* Retain a copy of the name used to open the file, for possible error reporting */ @@ -867,13 +856,8 @@ H5FD_log_cmp(const H5FD_t *_f1, const H5FD_t *_f2) if(HDmemcmp(&(f1->device),&(f2->device),sizeof(dev_t)) > 0) HGOTO_DONE(1) #endif /* H5_DEV_T_IS_SCALAR */ -#ifndef H5_VMS if(f1->inode < f2->inode) HGOTO_DONE(-1) if(f1->inode > f2->inode) HGOTO_DONE(1) -#else - if(HDmemcmp(&(f1->inode), &(f2->inode), 3 * sizeof(ino_t)) < 0) HGOTO_DONE(-1) - if(HDmemcmp(&(f1->inode), &(f2->inode), 3 * sizeof(ino_t)) > 0) HGOTO_DONE(1) -#endif /*H5_VMS*/ #endif @@ -1553,13 +1537,6 @@ H5FD_log_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATTR_U if(0 == bError) HGOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to extend file properly") #else /* H5_HAVE_WIN32_API */ -#ifdef H5_VMS - /* Reset seek offset to the beginning of the file, so that the file isn't - * re-extended later. This may happen on Open VMS. */ - if(-1 == HDlseek(file->fd, (HDoff_t)0, SEEK_SET)) - HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to seek to proper position") -#endif - if(-1 == HDftruncate(file->fd, (HDoff_t)file->eoa)) HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to extend file properly") #endif /* H5_HAVE_WIN32_API */ @@ -1579,3 +1556,4 @@ H5FD_log_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATTR_U done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5FD_log_truncate() */ + diff --git a/src/H5FDsec2.c b/src/H5FDsec2.c index 73dd7a0..10e2a66 100644 --- a/src/H5FDsec2.c +++ b/src/H5FDsec2.c @@ -69,11 +69,7 @@ typedef struct H5FD_sec2_t { * Windows code further below. */ dev_t device; /* file device number */ -#ifdef H5_VMS - ino_t inode[3]; /* file i-node number */ -#else ino_t inode; /* file i-node number */ -#endif /* H5_VMS */ #else /* Files in windows are uniquely identified by the volume serial * number and the file index (both low and high parts). @@ -374,13 +370,7 @@ H5FD_sec2_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr) file->dwVolumeSerialNumber = fileinfo.dwVolumeSerialNumber; #else /* H5_HAVE_WIN32_API */ file->device = sb.st_dev; -#ifdef H5_VMS - file->inode[0] = sb.st_ino[0]; - file->inode[1] = sb.st_ino[1]; - file->inode[2] = sb.st_ino[2]; -#else /* H5_VMS */ file->inode = sb.st_ino; -#endif /* H5_VMS */ #endif /* H5_HAVE_WIN32_API */ /* Retain a copy of the name used to open the file, for possible error reporting */ @@ -501,13 +491,8 @@ H5FD_sec2_cmp(const H5FD_t *_f1, const H5FD_t *_f2) if(HDmemcmp(&(f1->device),&(f2->device),sizeof(dev_t)) < 0) HGOTO_DONE(-1) if(HDmemcmp(&(f1->device),&(f2->device),sizeof(dev_t)) > 0) HGOTO_DONE(1) #endif /* H5_DEV_T_IS_SCALAR */ -#ifdef H5_VMS - if(HDmemcmp(&(f1->inode), &(f2->inode), 3 * sizeof(ino_t)) < 0) HGOTO_DONE(-1) - if(HDmemcmp(&(f1->inode), &(f2->inode), 3 * sizeof(ino_t)) > 0) HGOTO_DONE(1) -#else /* H5_VMS */ if(f1->inode < f2->inode) HGOTO_DONE(-1) if(f1->inode > f2->inode) HGOTO_DONE(1) -#endif /* H5_VMS */ #endif /* H5_HAVE_WIN32_API */ done: @@ -901,12 +886,6 @@ H5FD_sec2_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATTR_ if(0 == bError) HGOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to extend file properly") #else /* H5_HAVE_WIN32_API */ -#ifdef H5_VMS - /* Reset seek offset to the beginning of the file, so that the file isn't - * re-extended later. This may happen on Open VMS. */ - if(-1 == HDlseek(file->fd, (HDoff_t)0, SEEK_SET)) - HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to seek to proper position") -#endif if(-1 == HDftruncate(file->fd, (HDoff_t)file->eoa)) HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to extend file properly") #endif /* H5_HAVE_WIN32_API */ @@ -922,3 +901,4 @@ H5FD_sec2_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATTR_ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5FD_sec2_truncate() */ + diff --git a/src/H5FDstdio.c b/src/H5FDstdio.c index 8e7eaf4..65b75a3 100644 --- a/src/H5FDstdio.c +++ b/src/H5FDstdio.c @@ -97,11 +97,7 @@ typedef struct H5FD_stdio_t { * Windows code further below. */ dev_t device; /* file device number */ -#ifdef H5_VMS - ino_t inode[3]; /* file i-node number */ -#else ino_t inode; /* file i-node number */ -#endif /* H5_VMS */ #else /* Files in windows are uniquely identified by the volume serial * number and the file index (both low and high parts). @@ -450,13 +446,7 @@ H5FD_stdio_open( const char *name, unsigned flags, hid_t fapl_id, H5Epush_ret(func, H5E_ERR_CLS, H5E_FILE, H5E_BADFILE, "unable to fstat file", NULL) } /* end if */ file->device = sb.st_dev; -#ifdef H5_VMS - file->inode[0] = sb.st_ino[0]; - file->inode[1] = sb.st_ino[1]; - file->inode[2] = sb.st_ino[2]; -#else /* H5_VMS */ file->inode = sb.st_ino; -#endif /* H5_VMS */ #endif /* H5_HAVE_WIN32_API */ return (H5FD_t*)file; @@ -542,13 +532,8 @@ H5FD_stdio_cmp(const H5FD_t *_f1, const H5FD_t *_f2) if(memcmp(&(f1->device),&(f2->device),sizeof(dev_t)) < 0) return -1; if(memcmp(&(f1->device),&(f2->device),sizeof(dev_t)) > 0) return 1; #endif /* H5_DEV_T_IS_SCALAR */ -#ifdef H5_VMS - if(memcmp(&(f1->inode), &(f2->inode), 3 * sizeof(ino_t)) < 0) return -1; - if(memcmp(&(f1->inode), &(f2->inode), 3 * sizeof(ino_t)) > 0) return 1; -#else /* H5_VMS */ if(f1->inode < f2->inode) return -1; if(f1->inode > f2->inode) return 1; -#endif /* H5_VMS */ #endif /* H5_HAVE_WIN32_API */ return 0; diff --git a/src/H5Lexternal.c b/src/H5Lexternal.c index ae13e6b..08d401e 100644 --- a/src/H5Lexternal.c +++ b/src/H5Lexternal.c @@ -125,8 +125,6 @@ H5L_getenv_prefix_name(char **env_prefix/*in,out*/) * * Programmer: Vailin Choi, April 2, 2008 * - * Modification: Raymond Lu, 14 Jan. 2009 - * Added support for OpenVMS pathname --------------------------------------------------------------------------*/ static herr_t H5L_build_name(char *prefix, char *file_name, char **full_name/*out*/) diff --git a/src/H5Tconv.c b/src/H5Tconv.c index b14f6e5..6847e68 100644 --- a/src/H5Tconv.c +++ b/src/H5Tconv.c @@ -4255,7 +4255,11 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") goto padding; -#ifndef H5_VMS /*Temporary solution to handle VAX special values*/ + /* Temporary solution to handle VAX special values. + * Note that even though we don't support VAX anymore, we + * still need to handle legacy VAX files so this code must + * remain in place. + */ } else if (H5T__bit_find (s, src.u.f.epos, src.u.f.esize, H5T_BIT_LSB, FALSE)<0) { /* NaN */ @@ -4280,7 +4284,6 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") goto padding; -#endif /*H5_VMS*/ } /* diff --git a/src/H5private.h b/src/H5private.h index 9efd145..65726da 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -1130,22 +1130,9 @@ H5_DLL int HDfprintf (FILE *stream, const char *fmt, ...); #ifndef HDrealpath #define HDrealpath(F1,F2) realpath(F1,F2) #endif /* HDrealloc */ -#ifdef H5_VMS - #ifdef __cplusplus - extern "C" { - #endif /* __cplusplus */ - int HDremove_all(const char * fname); - #ifdef __cplusplus - } - #endif /* __cplusplus */ - #ifndef HDremove - #define HDremove(S) HDremove_all(S) - #endif /* HDremove */ -#else /* H5_VMS */ - #ifndef HDremove - #define HDremove(S) remove(S) - #endif /* HDremove */ -#endif /*H5_VMS*/ +#ifndef HDremove + #define HDremove(S) remove(S) +#endif /* HDremove */ #ifndef HDrename #define HDrename(OLD,NEW) rename(OLD,NEW) #endif /* HDrename */ @@ -1562,19 +1549,7 @@ extern char *strdup(const char *s); (ptr = slash); \ } -#elif defined(H5_HAVE_VMS_PATH) - -/* OpenVMS pathname: $:[path] - * i.g. SYS$SYSUSERS:[LU.HDF5.SRC]H5system.c */ -#define H5_DIR_SEPC ']' -#define H5_DIR_SEPS "]" -#define H5_CHECK_DELIMITER(SS) (SS == H5_DIR_SEPC) -#define H5_CHECK_ABSOLUTE(NAME) (HDstrrchr(NAME, ':') && HDstrrchr(NAME, '[')) -#define H5_CHECK_ABS_DRIVE(NAME) (0) -#define H5_CHECK_ABS_PATH(NAME) (0) -#define H5_GET_LAST_DELIMITER(NAME, ptr) ptr = HDstrrchr(NAME, H5_DIR_SEPC); - -#else +#else /* H5_HAVE_WINDOW_PATH */ #define H5_DIR_SEPC '/' #define H5_DIR_SEPS "/" @@ -1584,7 +1559,7 @@ extern char *strdup(const char *s); #define H5_CHECK_ABS_PATH(NAME) (0) #define H5_GET_LAST_DELIMITER(NAME, ptr) ptr = HDstrrchr(NAME, H5_DIR_SEPC); -#endif +#endif /* H5_HAVE_WINDOW_PATH */ #define H5_COLON_SEPC ':' diff --git a/src/H5system.c b/src/H5system.c index 56db380..e00e5a5 100644 --- a/src/H5system.c +++ b/src/H5system.c @@ -582,45 +582,8 @@ void HDsrand(unsigned int seed) { g_seed = seed; } -#endif +#endif /* H5_HAVE_RAND_R */ - -/*------------------------------------------------------------------------- - * Function: HDremove_all - * - * Purpose: Wrapper function for remove on VMS systems - * - * This function deletes all versions of a file - * - * Return: Success: 0; - * - * Failure: -1 - * - * Programmer: Elena Pourmal - * March 22, 2006 - * - *------------------------------------------------------------------------- - */ -#ifdef H5_VMS -int -HDremove_all(const char *fname) -{ - int ret_value = -1; - size_t fname_len; - char *_fname; - - fname_len = HDstrlen(fname) + 3; /* to accomodate ";*" and null terminator */ - _fname = (char *)H5MM_malloc(fname_len); - if(_fname) { - HDsnprintf(_fname, fname_len, "%s;*", fname); - /* Do not use HDremove; function becomes recursive (see H5private.h file)*/ - remove(_fname); - H5MM_xfree(_fname); - ret_value = 0; - } - return ret_value; -} -#endif /*------------------------------------------------------------------------- * Function: Wgettimeofday @@ -764,8 +727,6 @@ H5_build_extpath(const char *name, char **extpath/*out*/) /* * Unix: name[0] is a "/" * Windows: name[0-2] is ":\" or ":/" - * OpenVMS: $:[path] - * i.g. SYS$SYSUSERS:[LU.HDF5.SRC]H5system.c */ if(H5_CHECK_ABSOLUTE(name)) { if(NULL == (full_path = (char *)H5MM_strdup(name))) @@ -786,7 +747,6 @@ H5_build_extpath(const char *name, char **extpath/*out*/) * Windows: name[0-1] is ":" * Get current working directory on the drive specified in NAME * Unix: does not apply - * OpenVMS: does not apply */ if(H5_CHECK_ABS_DRIVE(name)) { drive = name[0] - 'A' + 1; @@ -797,14 +757,13 @@ H5_build_extpath(const char *name, char **extpath/*out*/) * Windows: name[0] is a '/' or '\' * Get current drive * Unix: does not apply - * OpenVMS: does not apply */ else if(H5_CHECK_ABS_PATH(name) && (0 != (drive = HDgetdrive()))) { HDsnprintf(cwdpath, MAX_PATH_LEN, "%c:%c", (drive + 'A' - 1), name[0]); retcwd = cwdpath; HDstrncpy(new_name, &name[1], name_len); } - /* totally relative for Unix, Windows, and OpenVMS: get current working directory */ + /* totally relative for Unix and Windows: get current working directory */ else { retcwd = HDgetcwd(cwdpath, MAX_PATH_LEN); HDstrncpy(new_name, name, name_len); @@ -823,26 +782,9 @@ H5_build_extpath(const char *name, char **extpath/*out*/) HGOTO_ERROR(H5E_INTERNAL, H5E_NOSPACE, FAIL, "memory allocation failed") HDstrncpy(full_path, cwdpath, cwdlen + 1); -#ifdef H5_VMS - /* If the file name contains relative path, cut off the beginning bracket. Also cut off the - * ending bracket of CWDPATH to combine the full path name. i.g. - * cwdpath = SYS$SYSUSERS:[LU.HDF5.TEST] - * new_name = [.tmp]extlinks.h5 - * full_path = SYS$SYSUSERS:[LU.HDF5.TEST.tmp]extlinks.h5 - */ - if(new_name[0] == '[') { - char *tmp = new_name; - - full_path[cwdlen - 1] = '\0'; - HDstrncat(full_path, ++tmp, HDstrlen(tmp)); - } /* end if */ - else - HDstrncat(full_path, new_name, HDstrlen(new_name)); -#else if(!H5_CHECK_DELIMITER(cwdpath[cwdlen - 1])) HDstrncat(full_path, H5_DIR_SEPS, HDstrlen(H5_DIR_SEPS)); HDstrncat(full_path, new_name, HDstrlen(new_name)); -#endif } /* end if */ } /* end else */ diff --git a/test/H5srcdir.h b/test/H5srcdir.h index 4f0f439..81624d8 100644 --- a/test/H5srcdir.h +++ b/test/H5srcdir.h @@ -32,11 +32,7 @@ static char srcdir_path[1024] = ""; static char srcdir_testpath[1024] = ""; /* Append the test file name to the srcdir path and return the whole string */ -#ifdef H5_VMS -static const char *H5_get_srcdir_filename(char *filename) -#else static const char *H5_get_srcdir_filename(const char *filename) -#endif { const char *srcdir = HDgetenv("srcdir"); @@ -46,19 +42,7 @@ static const char *H5_get_srcdir_filename(const char *filename) /* Build path to test file */ if((HDstrlen(srcdir) + HDstrlen(filename) + 2) < sizeof(srcdir_testpath)) { -#ifdef H5_VMS - HDstrcpy(srcdir_testpath, srcdir); - if(filename[0] == '[') { - char *tmp = filename; - - srcdir_testpath[HDstrlen(srcdir) - 1] = '\0'; - HDstrcat(srcdir_testpath, ++tmp); - } /* end if */ - else - HDstrcat(srcdir_testpath, filename); -#else HDsnprintf(srcdir_testpath, sizeof(srcdir_testpath), "%s/%s", srcdir, filename); -#endif return(srcdir_testpath); } /* end if */ else diff --git a/test/dt_arith.c b/test/dt_arith.c index b3f5cad..eb201d0 100644 --- a/test/dt_arith.c +++ b/test/dt_arith.c @@ -58,10 +58,9 @@ const char *FILENAME[] = { }; /* - * Count up or down depending on whether the machine is big endian, little - * endian, or VAX (OpenVMS). If local variable `endian' is H5T_ORDER_BE then - * the result will be I, otherwise the result will be Z-(I+1). VAX is printed - * as little endian. + * Count up or down depending on whether the machine is big endian or little + * endian. If local variable `endian' is H5T_ORDER_BE then the result will + * be I, otherwise the result will be Z-(I+1). */ #define ENDIAN(Z,I,E) (H5T_ORDER_BE==E?(I):(Z)-((I)+1)) @@ -88,11 +87,6 @@ static int skip_overflow_tests_g = 0; #define HANDLE_SIGFPE #endif -/* OpenVMS doesn't have this feature. Make sure to disable it*/ -#ifdef H5_VMS -#undef HANDLE_SIGFPE -#endif - /* * Decide what values of floating-point number we want to test. They are * 1 - normalized; 2 - denormalized; 3 - special. @@ -2740,24 +2734,6 @@ my_isnan(dtype_t type, void *val) retval = 1; } -#ifdef H5_VMS - /* For "float" and "double" on OpenVMS/Alpha, NaN is - * actually a valid value of maximal value.*/ - if(!retval) { - if (FLT_FLOAT==type) { - float x; - HDmemcpy(&x, val, sizeof(float)); - retval = (x==FLT_MAX || x==-FLT_MAX); - } else if (FLT_DOUBLE==type) { - double x; - HDmemcpy(&x, val, sizeof(double)); - retval = (x==DBL_MAX || x==-DBL_MAX); - } else { - return 0; - } - } -#endif /*H5_VMS*/ - return retval; } @@ -2786,23 +2762,8 @@ my_isinf(int endian, unsigned char *val, size_t size, bits = (unsigned char*)HDcalloc((size_t)1, size); -#ifdef H5_VMS - if(H5T_ORDER_VAX==endian) { - for (i = 0; i < size; i += 4) { - bits[i] = val[(size-2)-i]; - bits[i+1] = val[(size-1)-i]; - - bits[(size-2)-i] = val[i]; - bits[(size-1)-i] = val[i+1]; - } - } else { - for (i=0; i FLT_MAX; -#ifdef H5_VMS - maximal = HDfabs(*((double*)aligned)) == FLT_MAX; -#endif } else if (FLT_DOUBLE==dst_type) { hw_d = *((double*)aligned); hw = (unsigned char*)&hw_d; @@ -3149,17 +3074,11 @@ test_conv_flt_1 (const char *name, int run_test, hid_t src, hid_t dst) hw = (unsigned char*)&hw_f; underflow = HDfabsl(*((long double*)aligned)) < FLT_MIN; overflow = HDfabsl(*((long double*)aligned)) > FLT_MAX; -#ifdef H5_VMS - maximal = HDfabs(*((long double*)aligned)) == FLT_MAX; -#endif } else if (FLT_DOUBLE==dst_type) { hw_d = *((long double*)aligned); hw = (unsigned char*)&hw_d; underflow = HDfabsl(*((long double*)aligned)) < DBL_MIN; overflow = HDfabsl(*((long double*)aligned)) > DBL_MAX; -#ifdef H5_VMS - maximal = HDfabs(*((long double*)aligned)) == DBL_MAX; -#endif } else { hw_ld = *((long double*)aligned); hw = (unsigned char*)&hw_ld; @@ -3194,17 +3113,6 @@ test_conv_flt_1 (const char *name, int run_test, hid_t src, hid_t dst) if (k==dst_size) continue; /*no error*/ -#ifdef H5_VMS - /* For "float" and "double" on OpenVMS/Alpha, NaN is - * a valid value of maximal value.*/ - if (FLT_FLOAT==src_type && - my_isnan(src_type, saved+j*sizeof(float))) { - continue; - } else if (FLT_DOUBLE==src_type && - my_isnan(src_type, saved+j*sizeof(double))) { - continue; - } -#endif /*H5_VMS*/ /* * Assume same if both results are NaN. There are many NaN bit @@ -3262,11 +3170,6 @@ test_conv_flt_1 (const char *name, int run_test, hid_t src, hid_t dst) if (overflow && my_isinf(dendian, buf+j*sizeof(float), dst_size, dst_mpos, dst_msize, dst_epos, dst_esize)) continue; /* all overflowed, no error */ -#ifdef H5_VMS - if (maximal && my_isinf(dendian, buf+j*sizeof(float), - dst_size, dst_mpos, dst_msize, dst_epos, dst_esize)) - continue; /* maximal value, no error */ -#endif /*H5_VMS*/ check_mant[0] = HDfrexpf(x, check_expo+0); check_mant[1] = HDfrexpf(hw_f, check_expo+1); } else if (FLT_DOUBLE==dst_type) { @@ -3278,11 +3181,6 @@ test_conv_flt_1 (const char *name, int run_test, hid_t src, hid_t dst) if (overflow && my_isinf(dendian, buf+j*sizeof(double), dst_size, dst_mpos, dst_msize, dst_epos, dst_esize)) continue; /* all overflowed, no error */ -#ifdef H5_VMS - if (maximal && my_isinf(dendian, buf+j*sizeof(double), - dst_size, dst_mpos, dst_msize, dst_epos, dst_esize)) - continue; /* maximal value, no error */ -#endif /*H5_VMS*/ check_mant[0] = HDfrexp(x, check_expo+0); check_mant[1] = HDfrexp(hw_d, check_expo+1); #if H5_SIZEOF_LONG_DOUBLE !=0 && (H5_SIZEOF_LONG_DOUBLE!=H5_SIZEOF_DOUBLE) @@ -4924,7 +4822,6 @@ run_fp_tests(const char *name) nerrors += test_conv_flt_1(name, TEST_NORMAL, H5T_NATIVE_LDOUBLE, H5T_NATIVE_DOUBLE); #endif -#ifndef H5_VMS /*Test denormalized values. TEST_DENORM indicates denormalized values.*/ nerrors += test_conv_flt_1(name, TEST_DENORM, H5T_NATIVE_FLOAT, H5T_NATIVE_DOUBLE); nerrors += test_conv_flt_1(name, TEST_DENORM, H5T_NATIVE_DOUBLE, H5T_NATIVE_FLOAT); @@ -4944,7 +4841,6 @@ run_fp_tests(const char *name) nerrors += test_conv_flt_1(name, TEST_SPECIAL, H5T_NATIVE_LDOUBLE, H5T_NATIVE_FLOAT); nerrors += test_conv_flt_1(name, TEST_SPECIAL, H5T_NATIVE_LDOUBLE, H5T_NATIVE_DOUBLE); #endif -#endif /*H5_VMS*/ done: return nerrors; @@ -5085,11 +4981,7 @@ run_fp_int_conv(const char *name) int nerrors = 0; int test_values; -#ifdef H5_VMS - test_values = TEST_NORMAL; -#else for(test_values = TEST_NORMAL; test_values <= TEST_SPECIAL; test_values++) { -#endif /*H5_VMS*/ nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_FLOAT, H5T_NATIVE_SCHAR); nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_DOUBLE, H5T_NATIVE_SCHAR); @@ -5194,9 +5086,7 @@ run_fp_int_conv(const char *name) #endif /*H5_LDOUBLE_TO_LLONG_ACCURATE*/ #endif #endif -#ifndef H5_VMS } /* end for */ -#endif /* H5_VMS */ return nerrors; } @@ -5248,10 +5138,8 @@ main(void) * for user-defined integer types */ nerrors += test_derived_integer(); -#ifndef H5_VMS /* Does floating point overflow generate a SIGFPE? */ generates_sigfpe(); -#endif /* Test degenerate cases */ nerrors += run_fp_tests("noop"); diff --git a/test/dtypes.c b/test/dtypes.c index 59cf000..88bbce0 100644 --- a/test/dtypes.c +++ b/test/dtypes.c @@ -3233,11 +3233,7 @@ test_compound_18(void) /* Open Generated File */ /* (generated with gen_bad_compound.c) */ -#ifdef H5_VMS - if((file = H5Fopen(TESTFILE, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR -#else if((file = H5Fopen(testfile, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR -#endif /* Try to open the datatype */ H5E_BEGIN_TRY { diff --git a/test/fheap.c b/test/fheap.c index fee6fdf..c300028 100644 --- a/test/fheap.c +++ b/test/fheap.c @@ -16418,9 +16418,7 @@ curr_test = FHEAP_TEST_NORMAL; nerrors += test_id_limits(fapl, &small_cparam); nerrors += test_filtered_create(fapl, &small_cparam); nerrors += test_size(fapl, &small_cparam); -#ifndef H5_CANNOT_OPEN_TWICE nerrors += test_reopen_hdr(fapl, &small_cparam); -#endif /*H5_CANNOT_OPEN_TWICE*/ #else /* QAK */ HDfprintf(stderr, "Uncomment tests!\n"); #endif /* QAK */ diff --git a/test/flush2.c b/test/flush2.c index 28ce41e..0ee299e 100644 --- a/test/flush2.c +++ b/test/flush2.c @@ -189,8 +189,6 @@ main(void) #if defined H5_HAVE_WIN32_API && !defined (hdf5_EXPORTS) SKIPPED(); puts(" DLL will flush the file even when calling _exit, skip this test temporarily"); -#elif defined H5_VMS - SKIPPED(); #else H5_FAILED() goto error; @@ -212,8 +210,6 @@ main(void) #if defined H5_HAVE_WIN32_API && !defined (hdf5_EXPORTS) SKIPPED(); puts(" DLL will flush the file even when calling _exit, skip this test temporarily"); -#elif defined H5_VMS - SKIPPED(); #else H5_FAILED() goto error; diff --git a/test/gen_cross.c b/test/gen_cross.c index 1c73016..2d4b788 100644 --- a/test/gen_cross.c +++ b/test/gen_cross.c @@ -22,6 +22,10 @@ * Run it on an OpenVMS, a little-endian, and a big-endian machine. Change the * output file names to vms_data.h5, le_data.h5, and be_data.h5, and put them * under hdf5/test/ directory. + * + * Note that we no longer support OpenVMS. The OpenVMS file will eventually + * have to go away since we won't be able to re-create it but it's probably + * worth keeping around for now. */ #include diff --git a/test/getname.c b/test/getname.c index dc1ddbe..e1bbc6b 100644 --- a/test/getname.c +++ b/test/getname.c @@ -2995,9 +2995,7 @@ main(void) nerrors += test_main(file_id, fapl); nerrors += test_obj_ref(fapl); nerrors += test_reg_ref(fapl); -#ifndef H5_CANNOT_OPEN_TWICE nerrors += test_elinks(fapl); -#endif /*H5_CANNOT_OPEN_TWICE*/ /* Close file */ H5Fclose(file_id); diff --git a/test/lheap.c b/test/lheap.c index bdb6360..492316e 100644 --- a/test/lheap.c +++ b/test/lheap.c @@ -179,11 +179,7 @@ main(void) { const char *testfile = H5_get_srcdir_filename(TESTFILE); /* Corrected test file name */ hid_t dset = -1; -#ifdef H5_VMS - file = H5Fopen(TESTFILE, H5F_ACC_RDONLY, H5P_DEFAULT); -#else file = H5Fopen(testfile, H5F_ACC_RDONLY, H5P_DEFAULT); -#endif if(file >= 0){ if((dset = H5Dopen2(file, "/Dataset1", H5P_DEFAULT)) < 0) TEST_ERROR diff --git a/test/links.c b/test/links.c index cfbc4a1..ef71be7 100644 --- a/test/links.c +++ b/test/links.c @@ -36,13 +36,8 @@ /* File for external link test. Created with gen_udlinks.c */ #define LINKED_FILE "be_extlink2.h5" -#ifdef H5_VMS -#define TMPDIR "[.tmp]" -#define TMPDIR2 "[.tmp2]" -#else /* H5_VMS */ #define TMPDIR "tmp/" #define TMPDIR2 "tmp2/" -#endif /* H5_VMS */ /* Symlinks for external link symlink test */ #define SYMLINK1 TMPDIR "sym1.h5" @@ -320,7 +315,7 @@ typedef struct { * Function: fix_ext_filename * * Purpose: Internal function to append path to file name. It handles - * path name of Unix, Windows, and OpenVMS. + * path name of Unix and Windows. * * Return: void * @@ -333,17 +328,8 @@ fix_ext_filename(char *path_name, char *cwd, const char *file_name) { HDstrcpy(path_name, cwd); -#ifdef H5_VMS - if(file_name[0] == '[') { - char *tmp = file_name; - path_name[strlen(cwd)-1] = '\0'; - HDstrcat(path_name, ++tmp); - } else - HDstrcat(path_name, file_name); -#else HDstrcat(path_name, "/"); HDstrcat(path_name, file_name); -#endif } @@ -2877,7 +2863,6 @@ external_link_abs_mainpath(hid_t fapl, hbool_t new_format) * set up name for main file: * Linux: "/CWD/tmp/extlinks0" * Window: ":/CWD/tmp/extlinks0" - * OpenVMS: "$:[CWD.tmp]extlinks0" */ fix_ext_filename(tmpname, cwdpath, FILENAME[13]); h5_fixname(tmpname, fapl, filename1, sizeof filename1); @@ -6943,7 +6928,6 @@ external_file_cache(hid_t fapl, hbool_t new_format) /* Verify that all files are now closed */ H5F_sfile_assert_num(0); -#ifndef H5_CANNOT_OPEN_TWICE /* * Test 5: 3 file cycle */ @@ -7045,7 +7029,6 @@ external_file_cache(hid_t fapl, hbool_t new_format) /* Verify that all files are now closed */ H5F_sfile_assert_num(0); -#endif /* H5_CANNOT_OPEN_TWICE */ /* Close fapl */ H5Pclose(my_fapl); @@ -14580,15 +14563,11 @@ main(void) printf("\n---Testing without external file cache---\n"); } /* end else */ -#ifndef H5_CANNOT_OPEN_TWICE nerrors += external_link_root(my_fapl, new_format) < 0 ? 1 : 0; -#endif /* H5_CANNOT_OPEN_TWICE */ nerrors += external_link_path(my_fapl, new_format) < 0 ? 1 : 0; -#ifndef H5_CANNOT_OPEN_TWICE nerrors += external_link_self(my_fapl, new_format) < 0 ? 1 : 0; nerrors += external_link_pingpong(my_fapl, new_format) < 0 ? 1 : 0; nerrors += external_link_toomany(my_fapl, new_format) < 0 ? 1 : 0; -#endif /* H5_CANNOT_OPEN_TWICE */ nerrors += external_link_dangling(my_fapl, new_format) < 0 ? 1 : 0; nerrors += external_link_recursive(my_fapl, new_format) < 0 ? 1 : 0; nerrors += external_link_query(my_fapl, new_format) < 0 ? 1 : 0; @@ -14596,9 +14575,7 @@ main(void) nerrors += external_link_unlink_dense(my_fapl, new_format) < 0 ? 1 : 0; nerrors += external_link_move(my_fapl, new_format) < 0 ? 1 : 0; nerrors += external_link_ride(my_fapl, new_format) < 0 ? 1 : 0; -#ifndef H5_CANNOT_OPEN_TWICE nerrors += external_link_closing(my_fapl, new_format) < 0 ? 1 : 0; -#endif /* H5_CANNOT_OPEN_TWICE */ nerrors += external_link_endian(new_format) < 0 ? 1 : 0; nerrors += external_link_strong(my_fapl, new_format) < 0 ? 1 : 0; @@ -14628,9 +14605,7 @@ main(void) nerrors += external_symlink(env_h5_drvr, my_fapl, new_format) < 0 ? 1 : 0; nerrors += external_copy_invalid_object(my_fapl, new_format) < 0 ? 1 : 0; nerrors += external_dont_fail_to_source(my_fapl, new_format) < 0 ? 1 : 0; -#ifndef H5_CANNOT_OPEN_TWICE nerrors += external_open_twice(my_fapl, new_format) < 0 ? 1 : 0; -#endif /* H5_CANNOT_OPEN_TWICE */ } /* end for */ /* These tests assume that external links are a form of UD links, @@ -14654,9 +14629,7 @@ main(void) nerrors += obj_visit_by_name(my_fapl, new_format) < 0 ? 1 : 0; nerrors += obj_visit_stop(my_fapl, new_format) < 0 ? 1 : 0; nerrors += link_filters(my_fapl, new_format) < 0 ? 1 : 0; -#ifndef H5_CANNOT_OPEN_TWICE nerrors += obj_exists(my_fapl, new_format) < 0 ? 1 : 0; -#endif /* H5_CANNOT_OPEN_TWICE */ /* Keep this test last, it's testing files that are used above */ /* do not do this for files used by external link tests */ diff --git a/test/links_env.c b/test/links_env.c index 308d562..6e47667 100644 --- a/test/links_env.c +++ b/test/links_env.c @@ -25,11 +25,7 @@ #include "H5Iprivate.h" /* IDs */ #include "H5Lprivate.h" /* Links */ -#ifdef H5_VMS -#define TMPDIR "[.tmp]" -#else /* H5_VMS */ #define TMPDIR "tmp/" -#endif /* H5_VMS */ #define NAME_BUF_SIZE 1024 const char *FILENAME[] = { diff --git a/test/objcopy.c b/test/objcopy.c index e84e70c..a73beb3 100644 --- a/test/objcopy.c +++ b/test/objcopy.c @@ -12276,9 +12276,7 @@ main(void) nerrors += test_copy_group_wide_loop(fcpl_src, fcpl_dst, src_fapl, dst_fapl); nerrors += test_copy_group_links(fcpl_src, fcpl_dst, src_fapl, dst_fapl); nerrors += test_copy_soft_link(fcpl_src, fcpl_dst, src_fapl, dst_fapl); -#ifndef H5_CANNOT_OPEN_TWICE nerrors += test_copy_ext_link(fcpl_src, fcpl_dst, src_fapl, dst_fapl); -#endif /* H5_CANNOT_OPEN_TWICE */ nerrors += test_copy_exist(fcpl_src, fcpl_dst, src_fapl, dst_fapl); nerrors += test_copy_path(fcpl_src, fcpl_dst, src_fapl, dst_fapl); diff --git a/test/stab.c b/test/stab.c index 48b58b1..95e9722 100644 --- a/test/stab.c +++ b/test/stab.c @@ -57,8 +57,6 @@ const char *FILENAME[] = { /* The group_old.h5 is generated from gen_old_fill.c in HDF5 'test' directory * for version 1.6. To get this data file, simply compile gen_old_group.c with * the HDF5 library in that branch and run it. */ -/* I changed the name "group_old.h5.copy" to "group_old_copy.h5" because OpenVMS - * doesn't like any file name with more than one ".". SLU 2010/12/13 */ #define FILE_OLD_GROUPS "group_old.h5" #define FILE_OLD_GROUPS_COPY "group_old_copy.h5" diff --git a/test/tconfig.c b/test/tconfig.c index f3ac242..14c863e 100644 --- a/test/tconfig.c +++ b/test/tconfig.c @@ -60,13 +60,6 @@ void test_exit_definitions(void); * Programmer: Albert Cheng * September 25, 2001 * - * Modifications: - * Raymond Lu - * 16 Dec 2009 - * On Boeing's OpenVMS, the value of EXIT_FAILURE is 268435458. - * (The test is in test_exit_definitions.) Their document says - * it's supposed to be 2. I commented it out for OpenVMS for - * further consideration. *------------------------------------------------------------------------- */ void @@ -75,9 +68,7 @@ test_configure(void) /* Output message about test being performed */ MESSAGE(5, ("Testing configure definitions\n")); test_config_ctypes(); -#ifndef H5_VMS test_exit_definitions(); -#endif } diff --git a/test/tfile.c b/test/tfile.c index 52c8fd9..4913a15 100644 --- a/test/tfile.c +++ b/test/tfile.c @@ -181,19 +181,15 @@ test_file_create(void) * try to create the same file with H5F_ACC_TRUNC. This should fail * because fid1 is the same file and is currently open. */ -#ifndef H5_HAVE_FILE_VERSIONS fid2 = H5Fcreate(FILE1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); VERIFY(fid2, FAIL, "H5Fcreate"); -#endif /*H5_DONT_HAVE_FILE_VERSIONS*/ /* Close all files */ ret = H5Fclose(fid1); CHECK(ret, FAIL, "H5Fclose"); -#ifndef H5_HAVE_FILE_VERSIONS ret = H5Fclose(fid2); VERIFY(ret, FAIL, "H5Fclose"); /*file should not have been open */ -#endif /*H5_HAVE_FILE_VERSIONS*/ /* * Try again with H5F_ACC_EXCL. This should fail because the file already @@ -206,7 +202,6 @@ test_file_create(void) fid1 = H5Fcreate(FILE1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); CHECK(fid1, FAIL, "H5Fcreate"); -#ifndef H5_HAVE_FILE_VERSIONS /* * Try to truncate first file again. This should fail because fid1 is the * same file and is currently open. @@ -220,7 +215,6 @@ test_file_create(void) */ fid2 = H5Fcreate(FILE1, H5F_ACC_EXCL, H5P_DEFAULT, H5P_DEFAULT); VERIFY(fid2, FAIL, "H5Fcreate"); -#endif /*H5_HAVE_FILE_VERSIONS*/ /* Get the file-creation template */ tmpl1 = H5Fget_create_plist(fid1); @@ -1370,7 +1364,6 @@ test_file_perm(void) ret = H5Dclose(dset); CHECK(ret, FAIL, "H5Dclose"); -#ifndef H5_CANNOT_OPEN_TWICE /* Open the file (with read-only permission) */ filero = H5Fopen(FILE2, H5F_ACC_RDONLY, H5P_DEFAULT); CHECK(filero, FAIL, "H5Fopen"); @@ -1387,7 +1380,6 @@ test_file_perm(void) ret = H5Fclose(filero); CHECK(ret, FAIL, "H5Fclose"); -#endif /*H5_CANNOT_OPEN_TWICE*/ ret = H5Fclose(file); CHECK(ret, FAIL, "H5Fclose"); @@ -2364,7 +2356,7 @@ test_rw_noupdate(void) /* Check That Timestamps Are Equal */ if(diff > 0.0F) { /* Output message about test being performed */ - MESSAGE(1, ("Testing to verify that nothing is written if nothing is changed: This test is skipped on this system because the modification time from stat is the same as the last access time (We know OpenVMS behaves in this way).\n")); + MESSAGE(1, ("Testing to verify that nothing is written if nothing is changed: This test is skipped on this system because the modification time from stat is the same as the last access time.\n")); } /* end if */ else { hid_t file_id; /* HDF5 File ID */ @@ -3660,16 +3652,12 @@ test_file(void) test_file_freespace(); /* Test file free space information */ test_file_ishdf5(); /* Test detecting HDF5 files correctly */ test_file_open_dot(); /* Test opening objects with "." for a name */ -#ifndef H5_CANNOT_OPEN_TWICE test_file_open_overlap(); /* Test opening files in an overlapping manner */ -#endif /*H5_CANNOT_OPEN_TWICE*/ test_file_getname(); /* Test basic H5Fget_name() functionality */ -#ifndef H5_CANNOT_OPEN_TWICE test_file_double_root_open(); /* Test opening root group from two files works properly */ test_file_double_group_open(); /* Test opening same group from two files works properly */ test_file_double_dataset_open(); /* Test opening same dataset from two files works properly */ test_file_double_datatype_open(); /* Test opening same named datatype from two files works properly */ -#endif /*H5_CANNOT_OPEN_TWICE*/ test_userblock_file_size(); /* Tests that files created with a userblock have the correct size */ test_cached_stab_info(); /* Tests that files are created with cached stab info in the superblock */ test_rw_noupdate(); /* Test to ensure that RW permissions don't write the file unless dirtied */ diff --git a/test/th5o.c b/test/th5o.c index be3b4ab..40844fa 100644 --- a/test/th5o.c +++ b/test/th5o.c @@ -1355,9 +1355,7 @@ test_h5o(void) test_h5o_link(); /* Test object link routine */ test_h5o_comment(); /* Test routines for comment */ test_h5o_comment_by_name(); /* Test routines for comment by name */ -#ifndef H5_CANNOT_OPEN_TWICE /* OpenVMS can't open a file twice */ test_h5o_getinfo_same_file(); /* Test info for objects in the same file */ -#endif /* H5_CANNOT_OPEN_TWICE */ } /* test_h5o() */ diff --git a/test/tsohm.c b/test/tsohm.c index 9da655e..e22940f 100644 --- a/test/tsohm.c +++ b/test/tsohm.c @@ -3988,10 +3988,7 @@ test_sohm(void) test_sohm_delete(); /* Test deleting shared messages */ test_sohm_delete_revert(); /* Test that a file with SOHMs becomes an * empty file again when they are deleted. */ -#ifndef H5_CANNOT_OPEN_TWICE /* On VMS this test fails since it tries to - open target file the second time */ test_sohm_extlink(); /* Test SOHMs when external links are used */ -#endif /* H5_CANNOT_OPEN_TWICE */ test_sohm_extend_dset(); /* Test extending shared datasets */ test_sohm_external_dtype(); /* Test using datatype in another file */ diff --git a/tools/lib/h5diff_array.c b/tools/lib/h5diff_array.c index cfd171a..71ada53 100644 --- a/tools/lib/h5diff_array.c +++ b/tools/lib/h5diff_array.c @@ -6090,28 +6090,6 @@ my_isnan(dtype_t type, void *val) } } -#ifdef H5_VMS - /* For "float" and "double" on OpenVMS/Alpha, NaN is - * actually a valid value of maximal value.*/ - if(!retval) - { - if (FLT_FLOAT==type) - { - float x; - - HDmemcpy(&x, val, sizeof(float)); - retval = (x==FLT_MAX || x==-FLT_MAX); - } else if (FLT_DOUBLE==type) { - double x; - - HDmemcpy(&x, val, sizeof(double)); - retval = (x==DBL_MAX || x==-DBL_MAX); - } else - { - return FALSE; - } - } -#endif /*H5_VMS*/ h5difftrace("my_isnan finish\n"); return retval; diff --git a/tools/lib/h5tools_str.c b/tools/lib/h5tools_str.c index 470620f..b61ed34 100644 --- a/tools/lib/h5tools_str.c +++ b/tools/lib/h5tools_str.c @@ -860,11 +860,7 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai else tempchar = (tempchar >> packed_data_offset) & packed_data_mask; } - #ifdef H5_VMS - h5tools_str_append(str, OPT(info->fmt_schar, "%hd"), tempchar); - #else h5tools_str_append(str, OPT(info->fmt_schar, "%hhd"), tempchar); - #endif } } /* end if (sizeof(char) == nsize) */ else if (sizeof(int) == nsize) { diff --git a/tools/perform/sio_standalone.h b/tools/perform/sio_standalone.h index 4eb1ded..8f52eba 100644 --- a/tools/perform/sio_standalone.h +++ b/tools/perform/sio_standalone.h @@ -322,18 +322,7 @@ H5_DLL int HDrand(void); #define HDread(F,M,Z) read(F,M,Z) #define HDreaddir(D) readdir(D) #define HDrealloc(M,Z) realloc(M,Z) -#ifdef H5_VMS -#ifdef __cplusplus -extern "C" { -#endif -int HDremove_all(const char * fname); -#ifdef __cplusplus -} -#endif -#define HDremove(S) HDremove_all(S) -#else #define HDremove(S) remove(S) -#endif /*H5_VMS*/ #define HDrename(OLD,NEW) rename(OLD,NEW) #define HDrewind(F) rewind(F) #define HDrewinddir(D) rewinddir(D) diff --git a/tools/perform/zip_perf.c b/tools/perform/zip_perf.c index f73ba40..d025602 100644 --- a/tools/perform/zip_perf.c +++ b/tools/perform/zip_perf.c @@ -30,15 +30,6 @@ #include -#ifdef VMS -# define unlink delete -#endif /* VMS */ - -#ifdef RISCOS -# define unlink remove -# define fileno(file) file->__file -#endif /* RISCOS */ - #define ONE_KB 1024 #define ONE_MB (ONE_KB * ONE_KB) #define ONE_GB (ONE_MB * ONE_KB) -- cgit v0.12 From 8aef26f78594fc4f642e3bf5f170867c64839d2c Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 25 Aug 2015 09:14:12 -0500 Subject: [svn-r27575] lowercase commands --- config/cmake_ext_mod/grepTest.cmake | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/config/cmake_ext_mod/grepTest.cmake b/config/cmake_ext_mod/grepTest.cmake index 579d855..5f07134 100644 --- a/config/cmake_ext_mod/grepTest.cmake +++ b/config/cmake_ext_mod/grepTest.cmake @@ -27,7 +27,7 @@ endif (NOT TEST_REFERENCE) message (STATUS "COMMAND: ${TEST_PROGRAM} ${TEST_ARGS}") # run the test program, capture the stdout/stderr and the result var -EXECUTE_PROCESS ( +execute_process ( COMMAND ${TEST_PROGRAM} ${TEST_ARGS} WORKING_DIRECTORY ${TEST_FOLDER} RESULT_VARIABLE TEST_RESULT @@ -44,16 +44,16 @@ message (STATUS "COMMAND Error: ${TEST_ERROR}") file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) # TEST_REFERENCE should always be matched -STRING(REGEX MATCH "${TEST_REFERENCE}" TEST_MATCH ${TEST_STREAM}) -STRING(COMPARE EQUAL "${TEST_REFERENCE}" "${TEST_MATCH}" TEST_RESULT) +string (REGEX MATCH "${TEST_REFERENCE}" TEST_MATCH ${TEST_STREAM}) +string (COMPARE EQUAL "${TEST_REFERENCE}" "${TEST_MATCH}" TEST_RESULT) if (${TEST_RESULT} STREQUAL "0") message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did not contain ${TEST_REFERENCE}") endif (${TEST_RESULT} STREQUAL "0") -STRING(REGEX MATCH "${TEST_FILTER}" TEST_MATCH ${TEST_STREAM}) +string (REGEX MATCH "${TEST_FILTER}" TEST_MATCH ${TEST_STREAM}) if (${TEST_EXPECT} STREQUAL "1") # TEST_EXPECT (1) interperts TEST_FILTER as NOT to match - STRING(LENGTH "${TEST_MATCH}" TEST_RESULT) + string (LENGTH "${TEST_MATCH}" TEST_RESULT) if (NOT ${TEST_RESULT} STREQUAL "0") message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did contain ${TEST_FILTER}") endif (NOT ${TEST_RESULT} STREQUAL "0") -- cgit v0.12 From 4939ee241909f476bc25ad6f3a7f7ee56c443fa8 Mon Sep 17 00:00:00 2001 From: Scot Breitenfeld Date: Tue, 25 Aug 2015 16:49:36 -0500 Subject: [svn-r27580] Fix for: HDFFV-9283 Add H5Dget_offset fortran wrapper tested: h5committest --- fortran/src/H5Dff.F90 | 3 +- fortran/src/H5_f.c | 15 +++-- fortran/src/H5_ff.F90 | 11 ++-- fortran/src/H5f90global.F90 | 12 ++++ fortran/src/H5f90proto.h | 9 +-- fortran/test/fortranlib_test.f90 | 2 + fortran/test/tH5D.f90 | 120 ++++++++++++++++++++++++++++++++++++++- 7 files changed, 155 insertions(+), 17 deletions(-) diff --git a/fortran/src/H5Dff.F90 b/fortran/src/H5Dff.F90 index afdb5ba..e44d90e 100644 --- a/fortran/src/H5Dff.F90 +++ b/fortran/src/H5Dff.F90 @@ -1094,8 +1094,7 @@ CONTAINS offset = h5dget_offset(dset_id) - hdferr = 0 - IF(offset .LT. 0) hdferr = -1 + hdferr = 0 ! never returns a function error because C API never returns a function error. END SUBROUTINE h5dget_offset_f diff --git a/fortran/src/H5_f.c b/fortran/src/H5_f.c index e527dce..f3bc42f 100644 --- a/fortran/src/H5_f.c +++ b/fortran/src/H5_f.c @@ -436,11 +436,12 @@ h5close_types_c( hid_t_f * types, int_f *lentypes, */ int_f h5init_flags_c( int_f *h5d_flags, size_t_f *h5d_size_flags, - int_f *h5e_flags, hid_t_f *h5e_hid_flags, int_f *h5f_flags, - int_f *h5fd_flags, hid_t_f *h5fd_hid_flags, - int_f *h5g_flags, int_f *h5i_flags, int_f *h5l_flags, int_f *h5o_flags, - hid_t_f *h5p_flags, int_f *h5p_flags_int, int_f *h5r_flags, int_f *h5s_flags, - hsize_t_f *h5s_hsize_flags, int_f *h5t_flags, int_f *h5z_flags, int_f *h5_generic_flags) + int_f *h5e_flags, hid_t_f *h5e_hid_flags, int_f *h5f_flags, + int_f *h5fd_flags, hid_t_f *h5fd_hid_flags, + int_f *h5g_flags, int_f *h5i_flags, int_f *h5l_flags, int_f *h5o_flags, + hid_t_f *h5p_flags, int_f *h5p_flags_int, int_f *h5r_flags, int_f *h5s_flags, + hsize_t_f *h5s_hsize_flags, int_f *h5t_flags, int_f *h5z_flags, int_f *h5_generic_flags, + haddr_t_f *h5_haddr_generic_flags) /******/ { int ret_value = -1; @@ -773,7 +774,9 @@ h5init_flags_c( int_f *h5d_flags, size_t_f *h5d_size_flags, h5_generic_flags[5] = (int_f)H5_ITER_INC; /* Increasing order */ h5_generic_flags[6] = (int_f)H5_ITER_DEC; /* Decreasing order */ h5_generic_flags[7] = (int_f)H5_ITER_NATIVE; /* No particular order, whatever is fastest */ - h5_generic_flags[8] = (int_f)H5_ITER_N; /* Number of iteration orders */ + h5_generic_flags[8] = (int_f)H5_ITER_N; /* Number of iteration orders */ + + h5_haddr_generic_flags[0] = (haddr_t_f)HADDR_UNDEF; /* undefined address */ ret_value = 0; return ret_value; diff --git a/fortran/src/H5_ff.F90 b/fortran/src/H5_ff.F90 index 4ceb1a8..169864f 100644 --- a/fortran/src/H5_ff.F90 +++ b/fortran/src/H5_ff.F90 @@ -105,16 +105,17 @@ CONTAINS i_H5S_hsize_flags, & i_H5T_flags, & i_H5Z_flags, & - i_H5generic_flags) & + i_H5generic_flags, & + i_H5generic_haddr_flags) & BIND(C,NAME='h5init_flags_c') - IMPORT :: HID_T, SIZE_T, HSIZE_T + IMPORT :: HID_T, SIZE_T, HSIZE_T, HADDR_T IMPORT :: H5D_FLAGS_LEN, H5D_SIZE_FLAGS_LEN, & H5E_FLAGS_LEN, H5E_HID_FLAGS_LEN, & H5F_FLAGS_LEN, H5G_FLAGS_LEN, H5FD_FLAGS_LEN, & H5FD_HID_FLAGS_LEN, H5I_FLAGS_LEN, H5L_FLAGS_LEN, & H5O_FLAGS_LEN, H5P_FLAGS_LEN, H5P_FLAGS_INT_LEN, & H5R_FLAGS_LEN, H5S_FLAGS_LEN, H5S_HSIZE_FLAGS_LEN, & - H5T_FLAGS_LEN, H5Z_FLAGS_LEN, H5generic_FLAGS_LEN + H5T_FLAGS_LEN, H5Z_FLAGS_LEN, H5generic_FLAGS_LEN, H5generic_haddr_FLAGS_LEN IMPLICIT NONE INTEGER i_H5D_flags(H5D_FLAGS_LEN) INTEGER(SIZE_T) i_H5D_size_flags(H5D_SIZE_FLAGS_LEN) @@ -135,6 +136,7 @@ CONTAINS INTEGER i_H5T_flags(H5T_FLAGS_LEN) INTEGER i_H5Z_flags(H5Z_FLAGS_LEN) INTEGER i_H5generic_flags(H5generic_FLAGS_LEN) + INTEGER(HADDR_T) i_H5generic_haddr_flags(H5generic_haddr_FLAGS_LEN) END FUNCTION h5init_flags_c END INTERFACE INTERFACE @@ -164,7 +166,8 @@ CONTAINS H5S_hsize_flags, & H5T_flags, & H5Z_flags, & - H5generic_flags) + H5generic_flags,& + H5generic_haddr_flags) error_3 = h5init1_flags_c(H5LIB_flags ) error = error_1 + error_2 + error_3 END SUBROUTINE h5open_f diff --git a/fortran/src/H5f90global.F90 b/fortran/src/H5f90global.F90 index c88327c..947eff4 100644 --- a/fortran/src/H5f90global.F90 +++ b/fortran/src/H5f90global.F90 @@ -316,6 +316,18 @@ MODULE H5GLOBAL EQUIVALENCE(H5generic_flags(7), H5_ITER_DEC_F) EQUIVALENCE(H5generic_flags(8), H5_ITER_NATIVE_F) EQUIVALENCE(H5generic_flags(9), H5_ITER_N_F) + + INTEGER, PARAMETER :: H5generic_haddr_FLAGS_LEN = 1 + INTEGER(HADDR_T) :: H5generic_haddr_flags(H5generic_haddr_FLAGS_LEN) + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: /H5generic_haddr_FLAGS/ + !DEC$endif + COMMON /H5generic_haddr_FLAGS/ H5generic_haddr_flags + + INTEGER(HADDR_T) :: HADDR_UNDEF_F + + EQUIVALENCE(H5generic_haddr_flags(1), HADDR_UNDEF_F) + ! ! H5G flags declaration ! diff --git a/fortran/src/H5f90proto.h b/fortran/src/H5f90proto.h index a07db22..1d08d7e 100644 --- a/fortran/src/H5f90proto.h +++ b/fortran/src/H5f90proto.h @@ -524,10 +524,11 @@ H5_FCDLL int_f h5close_c(void); H5_FCDLL int_f h5init_types_c(hid_t_f *types, hid_t_f *floatingtypes, hid_t_f *integertypes); H5_FCDLL int_f h5close_types_c(hid_t_f *types, int_f *lentypes, hid_t_f *floatingtypes, int_f *floatinglen, hid_t_f *integertypes, int_f *integerlen); H5_FCDLL int_f h5init_flags_c(int_f *h5d_flags, size_t_f *h5d_size_flags, int_f *h5e_flags, hid_t_f *h5e_hid_flags, int_f *h5f_flags, - int_f *h5fd_flags, hid_t_f *h5fd_hid_flags, - int_f *h5g_flags, int_f *h5i_flags, int_f *h5l_flags, int_f *h5o_flags, - hid_t_f *h5p_flags, int_f *h5p_flags_int, int_f *h5r_flags, int_f *h5s_flags, - hsize_t_f *h5s_hsize_flags, int_f *h5t_flags, int_f *h5z_flags, int_f *h5_generic_flags); + int_f *h5fd_flags, hid_t_f *h5fd_hid_flags, + int_f *h5g_flags, int_f *h5i_flags, int_f *h5l_flags, int_f *h5o_flags, + hid_t_f *h5p_flags, int_f *h5p_flags_int, int_f *h5r_flags, int_f *h5s_flags, + hsize_t_f *h5s_hsize_flags, int_f *h5t_flags, int_f *h5z_flags, int_f *h5_generic_flags, + haddr_t_f *h5_haddr_generic_flags); H5_FCDLL int_f h5init1_flags_c(int_f *h5lib_flags); H5_FCDLL int_f h5get_libversion_c(int_f *majnum, int_f *minnum, int_f *relnum); H5_FCDLL int_f h5check_version_c(int_f *majnum, int_f *minnum, int_f *relnum); diff --git a/fortran/test/fortranlib_test.f90 b/fortran/test/fortranlib_test.f90 index 79ff161..7e3159e 100644 --- a/fortran/test/fortranlib_test.f90 +++ b/fortran/test/fortranlib_test.f90 @@ -93,6 +93,8 @@ PROGRAM fortranlibtest ret_total_error = 0 CALL extenddsettest(cleanup, ret_total_error) CALL write_test_status(ret_total_error, ' Extendible dataset test', total_error) + CALL test_userblock_offset(cleanup, ret_total_error) + CALL write_test_status(ret_total_error, ' Dataset offset with user block', total_error) ! write(*,*) ! write(*,*) '=========================================' diff --git a/fortran/test/tH5D.f90 b/fortran/test/tH5D.f90 index b5febb3..c9ba952 100644 --- a/fortran/test/tH5D.f90 +++ b/fortran/test/tH5D.f90 @@ -343,7 +343,7 @@ CONTAINS !Modify dataset creation properties, i.e. enable chunking ! CALL h5pcreate_f(H5P_DATASET_CREATE_F, crp_list, error) - CALL check("h5pcreat_f",error,total_error) + CALL check("h5pcreate_f",error,total_error) CALL h5pset_chunk_f(crp_list, RANK, dims1, error) CALL check("h5pset_chunk_f",error,total_error) @@ -508,5 +508,123 @@ CONTAINS RETURN END SUBROUTINE extenddsettest + +! +! The following subroutine tests h5dget_offset_f functionality +! + + SUBROUTINE test_userblock_offset(cleanup, total_error) + + USE ISO_C_BINDING + + IMPLICIT NONE + LOGICAL, INTENT(IN) :: cleanup + INTEGER, INTENT(OUT) :: total_error + ! + !the dataset is stored in file "offset.h5" + ! + INTEGER, PARAMETER :: dset_dim1=2, dset_dim2=10 + CHARACTER(LEN=6), PARAMETER :: filename = "offset" + CHARACTER(LEN=80) :: fix_filename + + INTEGER(hid_t) :: file, fcpl, dataset, space + INTEGER :: i, j, n, ios + INTEGER(hsize_t), DIMENSION(1:2) :: dims + INTEGER :: f + INTEGER(haddr_t) :: offset + INTEGER, DIMENSION(1:dset_dim1,1:dset_dim2), TARGET :: rdata, data_in + INTEGER :: error + TYPE(C_PTR) :: f_ptr + ! + !Create a new file using default properties. + ! + CALL h5_fixname_f(filename, fix_filename, H5P_DEFAULT_F, error) + IF (error .NE. 0) THEN + WRITE(*,*) "Cannot modify filename" + STOP + ENDIF + + CALL h5pcreate_f(H5P_FILE_CREATE_F, fcpl, error) + CALL check("h5pcreate_f",error,total_error) + + ! Initialize the dataset + n = 0 + DO i = 1, dset_dim1 + DO j = 1, dset_dim2 + n = n + 1 + data_in(i,j) = n + END DO + END DO + CALL h5fcreate_f(fix_filename, H5F_ACC_TRUNC_F, file, error, fcpl) + CALL check("h5fcreate_f",error,total_error) + + ! Create the data space + dims(1:2) = (/dset_dim1,dset_dim2/) + + CALL h5screate_simple_f(2, dims, space, error) + CALL check("h5screate_simple_f",error,total_error) + + ! Create the dataset + CALL h5dcreate_f(file, "dset1", H5T_NATIVE_INTEGER, space, dataset, error) + CALL check("h5dcreate_f", error, total_error) + + ! Test dataset address. Should be undefined. + CALL h5dget_offset_f(dataset, offset, error) + CALL VERIFY("h5dget_offset_f",offset, HADDR_UNDEF_F, total_error) + + ! Write the data to the dataset + f_ptr = C_LOC(data_in(1,1)) + CALL h5dwrite_f(dataset, H5T_NATIVE_INTEGER, f_ptr, error) + CALL check("h5dwrite_f", error, total_error) + + ! Test dataset address in file. Open the same file as a C file, seek + ! the data position as H5Dget_offset points to, read the dataset, and + ! compare it with the data written in. + CALL h5dget_offset_f(dataset, offset, error) + CALL check("h5dget_offset_f", error, total_error) + IF(offset.EQ.HADDR_UNDEF_F)THEN + total_error = total_error + 1 + ENDIF + + CALL h5dclose_f(dataset, error) + CALL check("h5dclose_f", error, total_error) + CALL h5fclose_f(file, error) + CALL check("h5fclose_f", error, total_error) + + IF(total_error.NE.0) RETURN + + OPEN(10,FILE=fix_filename, ACCESS="STREAM", IOSTAT=ios) + IF(ios.NE.0)THEN + WRITE(*,'(A)') "Failed to open file "//TRIM(fix_filename) + total_error = total_error + 1 + RETURN + ENDIF + ! The pos= specifier illustrates that positions are in bytes, + ! starting from byte 1 (as opposed to C, where they start from byte 0) + READ(10, POS=offset+1, IOSTAT=ios) rdata + IF(ios.NE.0)THEN + WRITE(*,'(A)') "Failed to read data from stream I/O " + total_error = total_error + 1 + CLOSE(10) + RETURN + ENDIF + + ! Check that the values read are the same as the values written + DO i = 1, dset_dim1 + DO j = 1, dset_dim2 + CALL VERIFY("h5dget_offset_f",rdata(i,j), data_in(i,j), total_error) + IF(total_error.NE.0)THEN + WRITE(*,'(A)') " Read different values than written." + WRITE(*,'(2(A,I0))') " At index ",i,",",j + CLOSE(10) + RETURN + ENDIF + END DO + END DO + + CLOSE(10) + + END SUBROUTINE test_userblock_offset + END MODULE TH5D -- cgit v0.12 From 767585b70f3e8c70b9558f32dfc5670533a26a4b Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Tue, 25 Aug 2015 19:05:39 -0500 Subject: [svn-r27581] Fixed a bug in the FUNC_ENTER macros. API calls of the form H5xx_* were flagged as H5XX_, which is a non-public API form. Tested on: h5committest --- src/H5private.h | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/src/H5private.h b/src/H5private.h index 65726da..5e968a0 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -1721,9 +1721,24 @@ H5_DLL double H5_trace(const double *calltime, const char *func, const char *typ *------------------------------------------------------------------------- */ -/* `S' is the name of a function which is being tested to check if its */ -/* an API function */ -#define H5_IS_API(S) ('_'!=((const char *)S)[2] && '_'!=((const char *)S)[3] && (!((const char *)S)[4] || '_'!=((const char *)S)[4])) +/* `S' is the name of a function which is being tested to check if it's + * an API function. + * + * BADNESS: + * - Underscore at positions 2 or 3 (0-indexed string). Handles + * H5_ and H5X_. + * - Underscore at position 4 if position 3 is uppercase or a digit. + * Handles H5XY_. + */ +#define H5_IS_API(S) (\ + '_'!=((const char *)S)[2] /* underscore at position 2 */ \ + && '_'!=((const char *)S)[3] /* underscore at position 3 */ \ + && !( /* NOT */ \ + ((const char *)S)[4] /* pos 4 exists */ \ + && (HDisupper(S[3]) || HDisdigit(S[3])) /* pos 3 dig | uc */ \ + && '_'==((const char *)S)[4] /* pos 4 underscore */ \ + )\ +) /* `S' is the name of a function which is being tested to check if it's */ /* a public API function */ -- cgit v0.12 From 2faae30c8db5e5155924e47b7267d04dd73b2152 Mon Sep 17 00:00:00 2001 From: Scot Breitenfeld Date: Wed, 26 Aug 2015 10:13:43 -0500 Subject: [svn-r27585] disabled the test "test_userblock_offset"; it fails for unknown reasons on platypus with pgf90 compiler when reading the streamed file back. --- fortran/test/fortranlib_test.f90 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fortran/test/fortranlib_test.f90 b/fortran/test/fortranlib_test.f90 index 7e3159e..f41d811 100644 --- a/fortran/test/fortranlib_test.f90 +++ b/fortran/test/fortranlib_test.f90 @@ -93,8 +93,9 @@ PROGRAM fortranlibtest ret_total_error = 0 CALL extenddsettest(cleanup, ret_total_error) CALL write_test_status(ret_total_error, ' Extendible dataset test', total_error) - CALL test_userblock_offset(cleanup, ret_total_error) - CALL write_test_status(ret_total_error, ' Dataset offset with user block', total_error) +! MSB--DISABLED TEST-- Fails for unknown reasons on platypus with pgf90 compiler +! CALL test_userblock_offset(cleanup, ret_total_error) +! CALL write_test_status(ret_total_error, ' Dataset offset with user block', total_error) ! write(*,*) ! write(*,*) '=========================================' -- cgit v0.12 From 6635d4c003caf15aadc16b0453d71ca1b0e8ca1f Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 26 Aug 2015 11:48:42 -0500 Subject: [svn-r27586] HDFFV-9497: Add back ALLOW_UNSUPPORTED OPTION. Added new option SKIP_HDF5_FORTRAN_SHARED --- CMakeLists.txt | 41 ++++++++++++++++++++++-------- fortran/examples/CMakeLists.txt | 12 ++++----- fortran/examples/CMakeTests.cmake | 24 +++++++++--------- fortran/src/CMakeLists.txt | 18 +++++++------- fortran/test/CMakeLists.txt | 52 +++++++++++++++++++-------------------- fortran/test/CMakeTests.cmake | 4 +-- hl/fortran/src/CMakeLists.txt | 22 ++++++++--------- hl/fortran/test/CMakeLists.txt | 16 ++++++------ hl/fortran/test/CMakeTests.cmake | 8 +++--- src/CMakeLists.txt | 8 +++++- test/CMakeLists.txt | 40 +++++++++++++++++++++++++++--- 11 files changed, 152 insertions(+), 93 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 799c1da..5a1f68c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -103,6 +103,8 @@ if (HDF5_USE_FOLDERS) endif (HDF5_USE_FOLDERS) option (HDF5_NO_PACKAGES "CPACK - Disable packaging" OFF) mark_as_advanced (HDF5_NO_PACKAGES) +option (ALLOW_UNSUPPORTED "Allow unsupported combinations of configure options" OFF) +mark_as_advanced (ALLOW_UNSUPPORTED) #----------------------------------------------------------------------------- # Set the core names of all the libraries @@ -541,25 +543,34 @@ if (WIN32) option (HDF5_ENABLE_THREADSAFE "Enable thread-safety" OFF) if (HDF5_ENABLE_THREADSAFE) # check for unsupported options - if (H5_BUILT_AS_STATIC_LIB) - message (FATAL_ERROR " **** thread-safety option not supported with static library **** ") - endif (H5_BUILT_AS_STATIC_LIB) + message (STATUS " **** thread-safety option not supported with static library **** ") + message (STATUS " **** thread-safety option will not be used building static library **** ") if (HDF5_ENABLE_PARALLEL) - message (FATAL_ERROR " **** parallel and thread-safety options are not supported **** ") + if (NOT ALLOW_UNSUPPORTED) + message (FATAL_ERROR " **** parallel and thread-safety options are not supported **** ") + else (NOT ALLOW_UNSUPPORTED) + message (STATUS " **** Allowing unsupported parallel and thread-safety options **** ") + endif (NOT ALLOW_UNSUPPORTED) endif (HDF5_ENABLE_PARALLEL) if (HDF5_BUILD_FORTRAN) - message (FATAL_ERROR " **** Fortran and thread-safety options are not supported **** ") + if (NOT ALLOW_UNSUPPORTED) + message (FATAL_ERROR " **** Fortran and thread-safety options are not supported **** ") + else (NOT ALLOW_UNSUPPORTED) + message (STATUS " **** Allowing unsupported Fortran and thread-safety options **** ") + endif (NOT ALLOW_UNSUPPORTED) endif (HDF5_BUILD_FORTRAN) if (HDF5_BUILD_CPP_LIB) - message (FATAL_ERROR " **** C++ and thread-safety options are not supported **** ") + if (NOT ALLOW_UNSUPPORTED) + message (FATAL_ERROR " **** C++ and thread-safety options are not supported **** ") + else (NOT ALLOW_UNSUPPORTED) + message (STATUS " **** Allowing unsupported C++ and thread-safety options **** ") + endif (NOT ALLOW_UNSUPPORTED) endif (HDF5_BUILD_CPP_LIB) - set (H5_HAVE_THREADSAFE 1) if (H5_HAVE_IOEO) message (STATUS " **** Win32 threads requires WINVER>=0x600 (Windows Vista/7/8) **** ") set (H5_HAVE_WIN_THREADS 1) else (H5_HAVE_IOEO) if (NOT H5_HAVE_PTHREAD_H) - set (H5_HAVE_THREADSAFE 0) message (FATAL_ERROR " **** thread-safe option requires Win32 threads or Pthreads **** ") endif (NOT H5_HAVE_PTHREAD_H) endif (H5_HAVE_IOEO) @@ -667,9 +678,15 @@ set (H5_FC_FUNC "H5_FC_FUNC(name,NAME) name ## _") set (H5_FC_FUNC_ "H5_FC_FUNC_(name,NAME) name ## _") if (EXISTS "${HDF5_SOURCE_DIR}/fortran" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/fortran") option (HDF5_BUILD_FORTRAN "Build FORTRAN support" OFF) + option (SKIP_HDF5_FORTRAN_SHARED "Do not build the fortran shared libraries" OFF) if (HDF5_BUILD_FORTRAN) if (BUILD_SHARED_LIBS AND APPLE) - message (FATAL_ERROR " **** Shared FORTRAN libraries are unsupported **** ") + if (NOT ALLOW_UNSUPPORTED) + message (STATUS " **** Shared FORTRAN libraries are unsupported **** ") + set (SKIP_HDF5_FORTRAN_SHARED ON) + else (NOT ALLOW_UNSUPPORTED) + message (STATUS " **** Allowing unsupported Fortran shared libraries **** ") + endif (NOT ALLOW_UNSUPPORTED) endif (BUILD_SHARED_LIBS AND APPLE) option (HDF5_ENABLE_F2003 "Enable FORTRAN 2003 Standard" ON) include (${HDF_RESOURCES_EXT_DIR}/HDFUseFortran.cmake) @@ -703,7 +720,11 @@ if (EXISTS "${HDF5_SOURCE_DIR}/c++" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/c++") if (HDF5_BUILD_CPP_LIB) # check for unsupported options if (HDF5_ENABLE_PARALLEL) - message (FATAL_ERROR " **** Parallel and C++ options are mutually exclusive **** ") + if (NOT ALLOW_UNSUPPORTED) + message (FATAL_ERROR " **** Parallel and C++ options are mutually exclusive **** ") + else (NOT ALLOW_UNSUPPORTED) + message (STATUS " **** Allowing unsupported Parallel and C++ options **** ") + endif (NOT ALLOW_UNSUPPORTED) endif (HDF5_ENABLE_PARALLEL) if (CMAKE_NO_STD_NAMESPACE) set (H5_NO_STD 1) diff --git a/fortran/examples/CMakeLists.txt b/fortran/examples/CMakeLists.txt index f2dc896..aad5f33 100644 --- a/fortran/examples/CMakeLists.txt +++ b/fortran/examples/CMakeLists.txt @@ -52,7 +52,7 @@ foreach (example ${examples}) FOLDER examples/fortran Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/static ) - if (BUILD_SHARED_LIBS) + if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) add_executable (f90_ex_${example}-shared ${HDF5_F90_EXAMPLES_SOURCE_DIR}/${example}.f90) TARGET_NAMING (f90_ex_${example}-shared SHARED) TARGET_FORTRAN_PROPERTIES (f90_ex_${example}-shared SHARED " " " ") @@ -66,7 +66,7 @@ foreach (example ${examples}) FOLDER examples/fortran Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/shared ) - endif (BUILD_SHARED_LIBS) + endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) endforeach (example ${examples}) foreach (example ${F2003_examples}) @@ -83,7 +83,7 @@ foreach (example ${F2003_examples}) FOLDER examples/fortran03 Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY} ) - if (BUILD_SHARED_LIBS) + if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) add_executable (f03_ex_${example}-shared ${HDF5_F90_EXAMPLES_SOURCE_DIR}/${example}.f90) TARGET_NAMING (f03_ex_${example}-shared SHARED) TARGET_FORTRAN_PROPERTIES (f03_ex_${example}-shared SHARED " " " ") @@ -97,7 +97,7 @@ foreach (example ${F2003_examples}) FOLDER examples/fortran03 Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/shared ) - endif (BUILD_SHARED_LIBS) + endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) endforeach (example ${F2003_examples}) if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) @@ -115,7 +115,7 @@ if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) FOLDER examples/fortran Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/static ) - if (BUILD_SHARED_LIBS) + if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) add_executable (f90_ex_ph5example-shared ${HDF5_F90_EXAMPLES_SOURCE_DIR}/ph5example.f90) TARGET_NAMING (f90_ex_ph5example-shared SHARED) TARGET_FORTRAN_PROPERTIES (f90_ex_ph5example-shared SHARED " " " ") @@ -130,7 +130,7 @@ if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) FOLDER examples/fortran Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/shared ) - endif (BUILD_SHARED_LIBS) + endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) endif (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) if (BUILD_TESTING) diff --git a/fortran/examples/CMakeTests.cmake b/fortran/examples/CMakeTests.cmake index 173984c..63e75c2 100644 --- a/fortran/examples/CMakeTests.cmake +++ b/fortran/examples/CMakeTests.cmake @@ -9,12 +9,12 @@ add_test ( NAME f90_ex-clear-objects COMMAND ${CMAKE_COMMAND} - -E remove + -E remove compound.h5 copy1.h5 copy2.h5 dsetf.h5 - extend.h5 + extend.h5 FORTRAN.h5 groupf.h5 groupsf.h5 @@ -28,16 +28,16 @@ set_tests_properties (f90_ex-clear-objects PROPERTIES DEPENDS ${last_test}) endif (NOT "${last_test}" STREQUAL "") set (last_test "f90_ex-clear-objects") - if (BUILD_SHARED_LIBS) + if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) add_test ( NAME f90_ex-shared-clear-objects COMMAND ${CMAKE_COMMAND} - -E remove + -E remove compound.h5 copy1.h5 copy2.h5 dsetf.h5 - extend.h5 + extend.h5 FORTRAN.h5 groupf.h5 groupsf.h5 @@ -51,7 +51,7 @@ set_tests_properties (f90_ex-shared-clear-objects PROPERTIES DEPENDS ${last_test}) endif (NOT "${last_test}" STREQUAL "") set (last_test "f90_ex-shared-clear-objects") - endif (BUILD_SHARED_LIBS) + endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) foreach (example ${examples}) add_test (NAME f90_ex_${example} COMMAND $) @@ -59,13 +59,13 @@ foreach (example ${examples}) set_tests_properties (f90_ex_${example} PROPERTIES DEPENDS ${last_test}) endif (NOT "${last_test}" STREQUAL "") set (last_test "f90_ex_${example}") - if (BUILD_SHARED_LIBS) + if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) add_test (NAME f90_ex-shared_${example} COMMAND $) if (NOT "${last_test}" STREQUAL "") set_tests_properties (f90_ex-shared_${example} PROPERTIES DEPENDS ${last_test}) endif (NOT "${last_test}" STREQUAL "") set (last_test "f90_ex-shared_${example}") - endif (BUILD_SHARED_LIBS) + endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) endforeach (example ${examples}) if (HDF5_ENABLE_F2003) @@ -75,19 +75,19 @@ if (HDF5_ENABLE_F2003) set_tests_properties (f03_ex_${example} PROPERTIES DEPENDS ${last_test}) endif (NOT "${last_test}" STREQUAL "") set (last_test "f03_ex_${example}") - if (BUILD_SHARED_LIBS) + if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) add_test (NAME f03_ex-shared_${example} COMMAND $) if (NOT "${last_test}" STREQUAL "") set_tests_properties (f03_ex-shared_${example} PROPERTIES DEPENDS ${last_test}) endif (NOT "${last_test}" STREQUAL "") set (last_test "f03_ex-shared_${example}") - endif (BUILD_SHARED_LIBS) + endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) endforeach (example ${F2003_examples}) endif (HDF5_ENABLE_F2003) if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) add_test (NAME f90_ex_ph5example COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $) - if (BUILD_SHARED_LIBS) + if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) add_test (NAME f90_ex-shared_ph5example COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $) - endif (BUILD_SHARED_LIBS) + endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) endif (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) diff --git a/fortran/src/CMakeLists.txt b/fortran/src/CMakeLists.txt index 261e52a..857b26d 100644 --- a/fortran/src/CMakeLists.txt +++ b/fortran/src/CMakeLists.txt @@ -62,19 +62,19 @@ set_target_properties (H5_buildiface PROPERTIES Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY} ) -if (BUILD_SHARED_LIBS) +if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) if (WIN32) set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared/\${BUILD_TYPE}) else (WIN32) set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared) endif (WIN32) -else (BUILD_SHARED_LIBS) +else (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) if (WIN32) set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static/\${BUILD_TYPE}) else (WIN32) set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static) endif (WIN32) -endif (BUILD_SHARED_LIBS) +endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) INCLUDE_DIRECTORIES (${HDF5_F90_BINARY_DIR} ${CMAKE_Fortran_MODULE_DIRECTORY} ${MOD_BUILD_DIR}) @@ -133,7 +133,7 @@ set_target_properties (${HDF5_F90_C_LIB_TARGET} PROPERTIES ) set (install_targets ${HDF5_F90_C_LIB_TARGET}) -if (BUILD_SHARED_LIBS) +if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) add_library (${HDF5_F90_C_LIBSH_TARGET} SHARED ${f90CStub_C_SRCS} ${f90CStub_C_HDRS}) TARGET_C_PROPERTIES (${HDF5_F90_C_LIBSH_TARGET} SHARED " " " ") target_link_libraries (${HDF5_F90_C_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} ${LINK_SHARED_LIBS}) @@ -147,7 +147,7 @@ if (BUILD_SHARED_LIBS) INTERFACE_COMPILE_DEFINITIONS H5_BUILT_AS_DYNAMIC_LIB=1 ) set (install_targets ${install_targets} ${HDF5_F90_C_LIBSH_TARGET}) -endif (BUILD_SHARED_LIBS) +endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) set_source_files_properties (${HDF5_F90_BINARY_DIR}/H5_gen.F90 PROPERTIES GENERATED TRUE) @@ -221,7 +221,7 @@ if (WIN32) endif (WIN32) set (install_targets ${install_targets} ${HDF5_F90_LIB_TARGET}) -if (BUILD_SHARED_LIBS) +if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) add_library (${HDF5_F90_LIBSH_TARGET} SHARED ${f90_F_SRCS}) set (SHARED_LINK_FLAGS " ") if (WIN32 AND MSVC) @@ -248,7 +248,7 @@ if (BUILD_SHARED_LIBS) ) endif (WIN32) set (install_targets ${install_targets} ${HDF5_F90_LIBSH_TARGET}) -endif (BUILD_SHARED_LIBS) +endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) #----------------------------------------------------------------------------- # Add file(s) to CMake Install @@ -299,10 +299,10 @@ install ( # Add Target(s) to CMake Install for import into other projects #----------------------------------------------------------------------------- if (HDF5_EXPORTED_TARGETS) - if (BUILD_SHARED_LIBS) + if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) INSTALL_TARGET_PDB (${HDF5_F90_C_LIBSH_TARGET} ${HDF5_INSTALL_BIN_DIR} fortlibraries) #INSTALL_TARGET_PDB (${HDF5_F90_LIBSH_TARGET} ${HDF5_INSTALL_BIN_DIR} fortlibraries) - endif (BUILD_SHARED_LIBS) + endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) install ( TARGETS diff --git a/fortran/test/CMakeLists.txt b/fortran/test/CMakeLists.txt index 19d4975..49b8da8 100644 --- a/fortran/test/CMakeLists.txt +++ b/fortran/test/CMakeLists.txt @@ -22,7 +22,7 @@ set_target_properties (${HDF5_F90_C_TEST_LIB_TARGET} PROPERTIES LINKER_LANGUAGE C INTERFACE_INCLUDE_DIRECTORIES "$/include>" ) -if (BUILD_SHARED_LIBS) +if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) add_library (${HDF5_F90_C_TEST_LIBSH_TARGET} SHARED t.c) TARGET_C_PROPERTIES (${HDF5_F90_C_TEST_LIBSH_TARGET} SHARED " " " ") target_link_libraries (${HDF5_F90_C_TEST_LIBSH_TARGET} @@ -37,13 +37,13 @@ if (BUILD_SHARED_LIBS) INTERFACE_INCLUDE_DIRECTORIES "$/include>" INTERFACE_COMPILE_DEFINITIONS H5_BUILT_AS_DYNAMIC_LIB=1 ) -endif (BUILD_SHARED_LIBS) +endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) set_source_files_properties (tf.F90 ${HDF5_F90_BINARY_DIR}/tf_gen.F90 PROPERTIES LANGUAGE Fortran) add_library (${HDF5_F90_TEST_LIB_TARGET} STATIC tf.F90 ${HDF5_F90_BINARY_DIR}/tf_gen.F90) -if (BUILD_SHARED_LIBS) +if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) add_library (${HDF5_F90_TEST_LIBSH_TARGET} SHARED tf.F90 ${HDF5_F90_BINARY_DIR}/tf_gen.F90) -endif (BUILD_SHARED_LIBS) +endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) TARGET_FORTRAN_PROPERTIES (${HDF5_F90_TEST_LIB_TARGET} STATIC " " " ") target_link_libraries (${HDF5_F90_TEST_LIB_TARGET} @@ -64,7 +64,7 @@ if (WIN32) COMPILE_DEFINITIONS "HDF5F90_WINDOWS" ) endif (WIN32) -if (BUILD_SHARED_LIBS) +if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) set (SHARED_LINK_FLAGS " ") if (WIN32 AND MSVC) set (SHARED_LINK_FLAGS "/DLL") @@ -90,7 +90,7 @@ if (BUILD_SHARED_LIBS) COMPILE_DEFINITIONS "BUILD_HDF5_TEST_DLL;HDF5F90_WINDOWS" ) endif (WIN32) -endif (BUILD_SHARED_LIBS) +endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) #----------------------------------------------------------------------------- # Setup the Fortran auto-detection utilities @@ -150,7 +150,7 @@ add_executable (testhdf5_fortran ) TARGET_NAMING (testhdf5_fortran STATIC) TARGET_FORTRAN_PROPERTIES (testhdf5_fortran STATIC " " " ") -target_link_libraries (testhdf5_fortran +target_link_libraries (testhdf5_fortran ${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} @@ -164,7 +164,7 @@ set_target_properties (testhdf5_fortran PROPERTIES FOLDER test/fortran Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/static ) -if (BUILD_SHARED_LIBS) +if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) add_executable (testhdf5_fortran-shared fortranlib_test.f90 tH5A.f90 @@ -184,7 +184,7 @@ if (BUILD_SHARED_LIBS) ) TARGET_NAMING (testhdf5_fortran-shared SHARED) TARGET_FORTRAN_PROPERTIES (testhdf5_fortran-shared SHARED " " " ") - target_link_libraries (testhdf5_fortran-shared + target_link_libraries (testhdf5_fortran-shared ${HDF5_F90_TEST_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} @@ -198,7 +198,7 @@ if (BUILD_SHARED_LIBS) FOLDER test/fortran Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/shared ) -endif (BUILD_SHARED_LIBS) +endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) #-- Adding test for testhdf5_fortran_1_8 add_executable (testhdf5_fortran_1_8 @@ -211,7 +211,7 @@ add_executable (testhdf5_fortran_1_8 ) TARGET_NAMING (testhdf5_fortran_1_8 STATIC) TARGET_FORTRAN_PROPERTIES (testhdf5_fortran_1_8 STATIC " " " ") -target_link_libraries (testhdf5_fortran_1_8 +target_link_libraries (testhdf5_fortran_1_8 ${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} @@ -225,7 +225,7 @@ set_target_properties (testhdf5_fortran_1_8 PROPERTIES FOLDER test/fortran Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/static ) -if (BUILD_SHARED_LIBS) +if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) add_executable (testhdf5_fortran_1_8-shared fortranlib_test_1_8.f90 tH5O.f90 @@ -236,7 +236,7 @@ if (BUILD_SHARED_LIBS) ) TARGET_NAMING (testhdf5_fortran_1_8-shared SHARED) TARGET_FORTRAN_PROPERTIES (testhdf5_fortran_1_8-shared SHARED " " " ") - target_link_libraries (testhdf5_fortran_1_8-shared + target_link_libraries (testhdf5_fortran_1_8-shared ${HDF5_F90_TEST_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} @@ -250,7 +250,7 @@ if (BUILD_SHARED_LIBS) FOLDER test/fortran Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/shared ) -endif (BUILD_SHARED_LIBS) +endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) #-- Adding test for fortranlib_test_F03 add_executable (fortranlib_test_F03 @@ -265,7 +265,7 @@ add_executable (fortranlib_test_F03 ) TARGET_NAMING (fortranlib_test_F03 STATIC) TARGET_FORTRAN_PROPERTIES (fortranlib_test_F03 STATIC " " " ") -target_link_libraries (fortranlib_test_F03 +target_link_libraries (fortranlib_test_F03 ${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} @@ -279,7 +279,7 @@ set_target_properties (fortranlib_test_F03 PROPERTIES FOLDER test/fortran Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/static ) -if (BUILD_SHARED_LIBS) +if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) add_executable (fortranlib_test_F03-shared fortranlib_test_F03.f90 tH5E_F03.f90 @@ -292,7 +292,7 @@ if (BUILD_SHARED_LIBS) ) TARGET_NAMING (fortranlib_test_F03-shared SHARED) TARGET_FORTRAN_PROPERTIES (fortranlib_test_F03-shared SHARED " " " ") - target_link_libraries (fortranlib_test_F03-shared + target_link_libraries (fortranlib_test_F03-shared ${HDF5_F90_TEST_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} @@ -306,13 +306,13 @@ if (BUILD_SHARED_LIBS) FOLDER test/fortran Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/shared ) -endif (BUILD_SHARED_LIBS) +endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) #-- Adding test for fflush1 add_executable (fflush1 fflush1.f90) TARGET_NAMING (fflush1 STATIC) TARGET_FORTRAN_PROPERTIES (fflush1 STATIC " " " ") -target_link_libraries (fflush1 +target_link_libraries (fflush1 ${HDF5_F90_LIB_TARGET} ${HDF5_F90_TEST_LIB_TARGET} ${HDF5_LIB_TARGET} @@ -326,11 +326,11 @@ set_target_properties (fflush1 PROPERTIES FOLDER test/fortran Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/static ) -if (BUILD_SHARED_LIBS) +if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) add_executable (fflush1-shared fflush1.f90) TARGET_NAMING (fflush1-shared SHARED) TARGET_FORTRAN_PROPERTIES (fflush1-shared SHARED " " " ") - target_link_libraries (fflush1-shared + target_link_libraries (fflush1-shared ${HDF5_F90_LIBSH_TARGET} ${HDF5_F90_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} @@ -344,13 +344,13 @@ if (BUILD_SHARED_LIBS) FOLDER test/fortran Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/shared ) -endif (BUILD_SHARED_LIBS) +endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) #-- Adding test for fflush2 add_executable (fflush2 fflush2.f90) TARGET_NAMING (fflush2 STATIC) TARGET_FORTRAN_PROPERTIES (fflush2 STATIC " " " ") -target_link_libraries (fflush2 +target_link_libraries (fflush2 ${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} @@ -364,11 +364,11 @@ set_target_properties (fflush2 PROPERTIES FOLDER test/fortran Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/static ) -if (BUILD_SHARED_LIBS) +if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) add_executable (fflush2-shared fflush2.f90) TARGET_NAMING (fflush2-shared SHARED) TARGET_FORTRAN_PROPERTIES (fflush2-shared SHARED " " " ") - target_link_libraries (fflush2-shared + target_link_libraries (fflush2-shared ${HDF5_F90_TEST_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} @@ -382,6 +382,6 @@ if (BUILD_SHARED_LIBS) FOLDER test/fortran Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/shared ) -endif (BUILD_SHARED_LIBS) +endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) include (CMakeTests.cmake) diff --git a/fortran/test/CMakeTests.cmake b/fortran/test/CMakeTests.cmake index 94f6b64..154e70c 100644 --- a/fortran/test/CMakeTests.cmake +++ b/fortran/test/CMakeTests.cmake @@ -27,7 +27,7 @@ add_test (NAME FORTRAN_fflush1 COMMAND $) add_test (NAME FORTRAN_fflush2 COMMAND $) set_tests_properties (FORTRAN_fflush2 PROPERTIES DEPENDS FORTRAN_fflush1) -if (BUILD_SHARED_LIBS) +if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) add_test (NAME FORTRAN_testhdf5_fortran-shared COMMAND $) set_tests_properties (FORTRAN_testhdf5_fortran-shared PROPERTIES PASS_REGULAR_EXPRESSION "[ ]*0 error.s") set_tests_properties (FORTRAN_testhdf5_fortran-shared PROPERTIES DEPENDS FORTRAN_testhdf5_fortran) @@ -51,4 +51,4 @@ if (BUILD_SHARED_LIBS) #-- Adding test for fflush2 add_test (NAME FORTRAN_fflush2-shared COMMAND $) set_tests_properties (FORTRAN_fflush2-shared PROPERTIES DEPENDS FORTRAN_fflush1-shared) -endif (BUILD_SHARED_LIBS) +endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) diff --git a/hl/fortran/src/CMakeLists.txt b/hl/fortran/src/CMakeLists.txt index ed2e542..5df4e1d 100644 --- a/hl/fortran/src/CMakeLists.txt +++ b/hl/fortran/src/CMakeLists.txt @@ -36,19 +36,19 @@ set_target_properties (H5HL_buildiface PROPERTIES Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY} ) -if (BUILD_SHARED_LIBS) +if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) if (WIN32) set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared/\${BUILD_TYPE}) else (WIN32) set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared) endif (WIN32) -else (BUILD_SHARED_LIBS) +else (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) if (WIN32) set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static/\${BUILD_TYPE}) else (WIN32) set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static) endif (WIN32) -endif (BUILD_SHARED_LIBS) +endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) #----------------------------------------------------------------------------- # Setup include Directories @@ -87,7 +87,7 @@ set_target_properties (${HDF5_HL_F90_C_LIB_TARGET} PROPERTIES ) set (install_targets ${HDF5_HL_F90_C_LIB_TARGET}) -if (BUILD_SHARED_LIBS) +if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) add_library (${HDF5_HL_F90_C_LIBSH_TARGET} SHARED ${HDF5_HL_F90_C_SRCS} ${HDF5_HL_F90_HEADERS}) TARGET_C_PROPERTIES (${HDF5_HL_F90_C_LIBSH_TARGET} SHARED " " " ") target_link_libraries (${HDF5_HL_F90_C_LIBSH_TARGET} ${HDF5_F90_C_LIBSH_TARGET} ${HDF5_HL_LIBSH_TARGET}) @@ -101,7 +101,7 @@ if (BUILD_SHARED_LIBS) INTERFACE_COMPILE_DEFINITIONS H5_BUILT_AS_DYNAMIC_LIB=1 ) set (install_targets ${install_targets} ${HDF5_HL_F90_C_LIBSH_TARGET}) -endif (BUILD_SHARED_LIBS) +endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) #----------------------------------------------------------------------------- # Fortran Modules @@ -149,13 +149,13 @@ set_target_properties (${HDF5_HL_F90_LIB_TARGET} PROPERTIES Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/static ) if (WIN32) - set_property (TARGET ${HDF5_HL_F90_LIB_TARGET} + set_property (TARGET ${HDF5_HL_F90_LIB_TARGET} APPEND PROPERTY COMPILE_DEFINITIONS "HDF5F90_WINDOWS" ) endif (WIN32) set (install_targets ${install_targets} ${HDF5_HL_F90_LIB_TARGET}) -if (BUILD_SHARED_LIBS) +if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) add_library (${HDF5_HL_F90_LIBSH_TARGET} SHARED ${HDF5_HL_F90_F_SRCS}) set (SHARED_LINK_FLAGS " ") if (WIN32 AND MSVC) @@ -173,12 +173,12 @@ if (BUILD_SHARED_LIBS) Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/shared ) if (WIN32) - set_property (TARGET ${HDF5_HL_F90_LIBSH_TARGET} + set_property (TARGET ${HDF5_HL_F90_LIBSH_TARGET} APPEND PROPERTY COMPILE_DEFINITIONS "BUILD_HDF5_HL_DLL;HDF5F90_WINDOWS" ) endif (WIN32) set (install_targets ${install_targets} ${HDF5_HL_F90_LIBSH_TARGET}) -endif (BUILD_SHARED_LIBS) +endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) #----------------------------------------------------------------------------- # Add file(s) to CMake Install @@ -207,10 +207,10 @@ install ( # Add Target(s) to CMake Install for import into other projects #----------------------------------------------------------------------------- if (HDF5_EXPORTED_TARGETS) - if (BUILD_SHARED_LIBS) + if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) INSTALL_TARGET_PDB (${HDF5_HL_F90_C_LIBSH_TARGET} ${HDF5_INSTALL_BIN_DIR} hlfortlibraries) #INSTALL_TARGET_PDB (${HDF5_HL_F90_LIBSH_TARGET} ${HDF5_INSTALL_BIN_DIR} hlfortlibraries) - endif (BUILD_SHARED_LIBS) + endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) install ( TARGETS diff --git a/hl/fortran/test/CMakeLists.txt b/hl/fortran/test/CMakeLists.txt index a1d1386..fc703dc 100644 --- a/hl/fortran/test/CMakeLists.txt +++ b/hl/fortran/test/CMakeLists.txt @@ -14,7 +14,7 @@ target_link_libraries (hl_f90_tstds ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_TAR target_include_directories (hl_f90_tstds PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/static) set_target_properties (hl_f90_tstds PROPERTIES LINKER_LANGUAGE Fortran) set_target_properties (hl_f90_tstds PROPERTIES FOLDER test/hl/fortran) -if (BUILD_SHARED_LIBS) +if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) add_executable (hl_f90_tstds-shared tstds.F90) TARGET_NAMING (hl_f90_tstds-shared SHARED) TARGET_FORTRAN_PROPERTIES (hl_f90_tstds-shared SHARED " " " ") @@ -25,7 +25,7 @@ if (BUILD_SHARED_LIBS) FOLDER test/hl/fortran Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/shared ) -endif (BUILD_SHARED_LIBS) +endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) #-- Adding test for hl_f90_tstlite add_executable (hl_f90_tstlite tstlite.F90) @@ -35,7 +35,7 @@ target_link_libraries (hl_f90_tstlite ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_T target_include_directories (hl_f90_tstlite PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/static) set_target_properties (hl_f90_tstlite PROPERTIES LINKER_LANGUAGE Fortran) set_target_properties (hl_f90_tstlite PROPERTIES FOLDER test/hl/fortran) -if (BUILD_SHARED_LIBS) +if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) add_executable (hl_f90_tstlite-shared tstlite.F90) TARGET_NAMING (hl_f90_tstlite-shared SHARED) TARGET_FORTRAN_PROPERTIES (hl_f90_tstlite-shared SHARED " " " ") @@ -46,7 +46,7 @@ if (BUILD_SHARED_LIBS) FOLDER test/hl/fortran Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/shared ) -endif (BUILD_SHARED_LIBS) +endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) #-- Adding test for hl_f90_tstimage add_executable (hl_f90_tstimage tstimage.F90) @@ -56,7 +56,7 @@ target_link_libraries (hl_f90_tstimage ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB target_include_directories (hl_f90_tstimage PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/static) set_target_properties (hl_f90_tstimage PROPERTIES LINKER_LANGUAGE Fortran) set_target_properties (hl_f90_tstimage PROPERTIES FOLDER test/hl/fortran) -if (BUILD_SHARED_LIBS) +if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) add_executable (hl_f90_tstimage-shared tstimage.F90) TARGET_NAMING (hl_f90_tstimage-shared SHARED) TARGET_FORTRAN_PROPERTIES (hl_f90_tstimage-shared SHARED " " " ") @@ -67,7 +67,7 @@ if (BUILD_SHARED_LIBS) FOLDER test/hl/fortran Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/shared ) -endif (BUILD_SHARED_LIBS) +endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) #-- Adding test for hl_f90_tsttable add_executable (hl_f90_tsttable tsttable.F90) @@ -77,7 +77,7 @@ target_link_libraries (hl_f90_tsttable ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_ target_include_directories (hl_f90_tsttable PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/static) set_target_properties (hl_f90_tsttable PROPERTIES LINKER_LANGUAGE Fortran) set_target_properties (hl_f90_tsttable PROPERTIES FOLDER test/hl/fortran) -if (BUILD_SHARED_LIBS) +if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) add_executable (hl_f90_tsttable-shared tsttable.F90) TARGET_NAMING (hl_f90_tsttable-shared SHARED) TARGET_FORTRAN_PROPERTIES (hl_f90_tsttable-shared SHARED " " " ") @@ -88,6 +88,6 @@ if (BUILD_SHARED_LIBS) FOLDER test/hl/fortran Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/shared ) -endif (BUILD_SHARED_LIBS) +endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) include (CMakeTests.cmake) diff --git a/hl/fortran/test/CMakeTests.cmake b/hl/fortran/test/CMakeTests.cmake index 38181bf..499e255 100644 --- a/hl/fortran/test/CMakeTests.cmake +++ b/hl/fortran/test/CMakeTests.cmake @@ -9,7 +9,7 @@ add_test ( NAME HL_FORTRAN_test-clear-objects COMMAND ${CMAKE_COMMAND} - -E remove + -E remove dsetf1.h5 dsetf2.h5 dsetf3.h5 @@ -32,11 +32,11 @@ set_tests_properties (HL_FORTRAN_f90_tstimage PROPERTIES DEPENDS HL_FORTRAN_test add_test (NAME HL_FORTRAN_f90_tsttable COMMAND $) set_tests_properties (HL_FORTRAN_f90_tsttable PROPERTIES DEPENDS HL_FORTRAN_test-clear-objects) -if (BUILD_SHARED_LIBS) +if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) add_test ( NAME HL_FORTRAN_test-shared-clear-objects COMMAND ${CMAKE_COMMAND} - -E remove + -E remove dsetf1.h5 dsetf2.h5 dsetf3.h5 @@ -61,4 +61,4 @@ if (BUILD_SHARED_LIBS) add_test (NAME HL_FORTRAN_f90_tsttable-shared COMMAND $) set_tests_properties (HL_FORTRAN_f90_tsttable-shared PROPERTIES DEPENDS HL_FORTRAN_test-shared-clear-objects) -endif (BUILD_SHARED_LIBS) +endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index ee06669..dc6ba0a 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -896,9 +896,15 @@ if (BUILD_SHARED_LIBS) INTERFACE_INCLUDE_DIRECTORIES "$/include>" INTERFACE_COMPILE_DEFINITIONS H5_BUILT_AS_DYNAMIC_LIB=1 ) + if (HDF5_ENABLE_THREADSAFE) + set_property (TARGET ${HDF5_LIBSH_TARGET} + APPEND PROPERTY COMPILE_DEFINITIONS + "H5_HAVE_THREADSAFE" + ) + endif (HDF5_ENABLE_THREADSAFE) if (HDF5_ENABLE_DEBUG_APIS) - set_property (TARGET ${HDF5_LIBSH_TARGET} + set_property (TARGET ${HDF5_LIBSH_TARGET} APPEND PROPERTY COMPILE_DEFINITIONS "H5Z_DEBUG;H5VM_DEBUG;H5T_DEBUG;H5S_DEBUG;H5P_DEBUG;H5O_DEBUG;H5MM_DEBUG;H5MF_DEBUG;H5I_DEBUG;H5HL_DEBUG;H5HG_DEBUG;H5G_DEBUG;H5F_DEBUG;H5E_DEBUG;H5D_DEBUG;H5B_DEBUG;H5AC_DEBUG" ) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index c94b880..2dc8131 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -58,6 +58,12 @@ if (BUILD_SHARED_LIBS) INTERFACE_INCLUDE_DIRECTORIES "$/include>" INTERFACE_COMPILE_DEFINITIONS H5_BUILT_AS_DYNAMIC_LIB=1 ) + if (HDF5_ENABLE_THREADSAFE) + set_property (TARGET ${HDF5_TEST_LIBSH_TARGET} + APPEND PROPERTY COMPILE_DEFINITIONS + "H5_HAVE_THREADSAFE" + ) + endif (HDF5_ENABLE_THREADSAFE) endif (BUILD_SHARED_LIBS) #----------------------------------------------------------------------------- @@ -103,7 +109,7 @@ endif (BUILD_SHARED_LIBS) TARGET ${HDF5_TEST_PLUGIN_LIB_TARGET} POST_BUILD COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different + ARGS -E copy_if_different "$" "${CMAKE_BINARY_DIR}/testdir1/$" ) @@ -134,7 +140,7 @@ endif (BUILD_SHARED_LIBS) TARGET ${HDF5_TEST_PLUGIN_LIB_TARGET} POST_BUILD COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different + ARGS -E copy_if_different "$" "${CMAKE_BINARY_DIR}/testdir2/$" ) @@ -207,7 +213,7 @@ set (H5_TESTS #cache_api #cache_tagging pool - hyperslab + #hyperslab istore bittests dt_arith @@ -307,6 +313,26 @@ if (BUILD_SHARED_LIBS) set_target_properties (cache_tagging-shared PROPERTIES FOLDER test) endif (BUILD_SHARED_LIBS) +#-- Adding test for hyperslab +add_executable (hyperslab ${HDF5_TEST_SOURCE_DIR}/hyperslab.c) +TARGET_NAMING (hyperslab STATIC) +TARGET_C_PROPERTIES (hyperslab STATIC " " " ") +target_link_libraries (hyperslab ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) +set_target_properties (hyperslab PROPERTIES FOLDER test) +if (BUILD_SHARED_LIBS) + add_executable (hyperslab-shared ${HDF5_TEST_SOURCE_DIR}/hyperslab.c) + TARGET_NAMING (hyperslab-shared SHARED) + TARGET_C_PROPERTIES (hyperslab-shared SHARED " " " ") + target_link_libraries (hyperslab-shared ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) + set_target_properties (hyperslab-shared PROPERTIES FOLDER test) + if (HDF5_ENABLE_THREADSAFE) + set_property (TARGET hyperslab-shared} + APPEND PROPERTY COMPILE_DEFINITIONS + "H5_HAVE_THREADSAFE" + ) + endif (HDF5_ENABLE_THREADSAFE) +endif (BUILD_SHARED_LIBS) + #-- Adding test for ttsafe add_executable (ttsafe ${HDF5_TEST_SOURCE_DIR}/ttsafe.c @@ -331,6 +357,12 @@ if (BUILD_SHARED_LIBS) TARGET_C_PROPERTIES (ttsafe-shared SHARED " " " ") target_link_libraries (ttsafe-shared ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) set_target_properties (ttsafe-shared PROPERTIES FOLDER test) + if (HDF5_ENABLE_THREADSAFE) + set_property (TARGET ttsafe-shared + APPEND PROPERTY COMPILE_DEFINITIONS + "H5_HAVE_THREADSAFE" + ) + endif (HDF5_ENABLE_THREADSAFE) endif (BUILD_SHARED_LIBS) #-- Adding test for err_compat @@ -379,7 +411,7 @@ endif (BUILD_SHARED_LIBS) #-- Adding test for libinfo set (GREP_RUNNER ${PROJECT_BINARY_DIR}/GrepRunner.cmake) -file (WRITE ${GREP_RUNNER} +file (WRITE ${GREP_RUNNER} "file (STRINGS \${TEST_PROGRAM} TEST_RESULT REGEX \"SUMMARY OF THE HDF5 CONFIGURATION\") if (\${TEST_RESULT} STREQUAL \"0\") message (FATAL_ERROR \"Failed: The output: \${TEST_RESULT} of \${TEST_PROGRAM} did not contain SUMMARY OF THE HDF5 CONFIGURATION\") -- cgit v0.12 From 606c16e11126bd908e673abefd4f0b7e91562d7f Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Wed, 26 Aug 2015 12:05:57 -0500 Subject: [svn-r27587] Added a new API call (H5is_library_threadsafe) to the library. This call can be used to determine at runtime if the library was built with thread-safety. Fixes HDFFV-9496 Tested on: h5committest --- src/H5.c | 48 +++++++++++++++++++++++++++++++++++++++--------- src/H5public.h | 4 +++- test/ttsafe.c | 43 +++++++++++++++++++++++++++++++++++-------- test/ttsafe.h | 10 +++------- test/ttsafe_error.c | 1 + 5 files changed, 81 insertions(+), 25 deletions(-) diff --git a/src/H5.c b/src/H5.c index 3d4512f..8563545 100644 --- a/src/H5.c +++ b/src/H5.c @@ -21,17 +21,17 @@ /***********/ /* Headers */ /***********/ -#include "H5private.h" /* Generic Functions */ -#include "H5ACprivate.h" /* Metadata cache */ -#include "H5Dprivate.h" /* Datasets */ -#include "H5Eprivate.h" /* Error handling */ -#include "H5FLprivate.h" /* Free lists */ -#include "H5Lprivate.h" /* Links */ +#include "H5private.h" /* Generic Functions */ +#include "H5ACprivate.h" /* Metadata cache */ +#include "H5Dprivate.h" /* Datasets */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5FLprivate.h" /* Free lists */ +#include "H5Lprivate.h" /* Links */ #include "H5MMprivate.h" /* Memory management */ -#include "H5Pprivate.h" /* Property lists */ -#include "H5Tprivate.h" /* Datatypes */ +#include "H5Pprivate.h" /* Property lists */ #include "H5SLprivate.h" /* Skip lists */ - +#include "H5Tprivate.h" /* Datatypes */ +#include "H5TSprivate.h" /* Thread safety */ /****************/ /* Local Macros */ @@ -973,6 +973,36 @@ H5free_memory(void *mem) } /* end H5free_memory() */ +/*------------------------------------------------------------------------- + * Function: H5is_library_threadsafe + * + * Purpose: Checks to see if the library was built with thread-safety + * enabled. + * + * Return: SUCCEED/FAIL + * + *------------------------------------------------------------------------- + */ +herr_t +H5is_library_threadsafe(hbool_t *is_ts) +{ + herr_t ret_value = SUCCEED; + + FUNC_ENTER_API_NOINIT + H5TRACE1("e", "*b", is_ts); + + HDassert(is_ts); + +#ifdef H5_HAVE_THREADSAFE + *is_ts = TRUE; +#else /* H5_HAVE_THREADSAFE */ + *is_ts = FALSE; +#endif /* H5_HAVE_THREADSAFE */ + + FUNC_LEAVE_API(ret_value) +} /* end H5is_library_threadsafe() */ + + #if defined(H5_HAVE_THREADSAFE) && defined(H5_BUILT_AS_DYNAMIC_LIB) \ && defined(H5_HAVE_WIN32_API) && defined(H5_HAVE_WIN_THREADS) /*------------------------------------------------------------------------- diff --git a/src/H5public.h b/src/H5public.h index b9b4dd7..8c7da05 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -331,6 +331,7 @@ H5_DLL herr_t H5get_libversion(unsigned *majnum, unsigned *minnum, unsigned *relnum); H5_DLL herr_t H5check_version(unsigned majnum, unsigned minnum, unsigned relnum); +H5_DLL herr_t H5is_library_threadsafe(hbool_t *is_ts); H5_DLL herr_t H5free_memory(void *mem); H5_DLL void *H5allocate_memory(size_t size, hbool_t clear); H5_DLL void *H5resize_memory(void *mem, size_t size); @@ -338,5 +339,6 @@ H5_DLL void *H5resize_memory(void *mem, size_t size); #ifdef __cplusplus } #endif -#endif +#endif /* _H5public_H */ + diff --git a/test/ttsafe.c b/test/ttsafe.c index d0ab81a..d3c5cfb 100644 --- a/test/ttsafe.c +++ b/test/ttsafe.c @@ -40,13 +40,6 @@ /* ANY new test needs to have a prototype in ttsafe.h */ #include "ttsafe.h" -#ifndef H5_HAVE_THREADSAFE -int main(void) -{ - printf("Test skipped because THREADSAFE not enabled\n"); - return 0; -} -#else #define MAX_NUM_NAME 1000 #define NAME_OFFSET 6 /* offset for "name" */ @@ -66,6 +59,30 @@ num_digits(int num) return u; } +/* Test the H5is_library_threadsafe() function */ +void +tts_is_threadsafe(void) +{ + hbool_t is_ts; + hbool_t should_be; + +#ifdef H5_HAVE_THREADSAFE + is_ts = FALSE; + should_be = TRUE; +#else /* H5_HAVE_THREADSAFE */ + is_ts = TRUE; + should_be = FALSE; +#endif /* H5_HAVE_THREADSAFE */ + + if(H5is_library_threadsafe(&is_ts) != SUCCEED) + TestErrPrintf("H5_is_library_threadsafe() call failed - test failed\n"); + + if(is_ts != should_be) + TestErrPrintf("Thread-safety value incorrect - test failed\n"); + + return; +} + /* Routine to generate attribute names for numeric values */ char *gen_name(int value) { @@ -88,10 +105,13 @@ char *gen_name(int value) int main(int argc, char *argv[]) { + /* Initialize testing framework */ TestInit(argv[0], NULL, NULL); /* Tests are generally arranged from least to most complexity... */ + AddTest("is_threadsafe", tts_is_threadsafe, NULL, "library threadsafe status", NULL); +#ifdef H5_HAVE_THREADSAFE AddTest("dcreate", tts_dcreate, cleanup_dcreate, "multi-dataset creation", NULL); AddTest("error", tts_error, cleanup_error, "per-thread error stacks", NULL); #ifdef H5_HAVE_PTHREAD_H @@ -100,6 +120,12 @@ int main(int argc, char *argv[]) #endif /* H5_HAVE_PTHREAD_H */ AddTest("acreate", tts_acreate, cleanup_acreate, "multi-attribute creation", NULL); +#else /* H5_HAVE_THREADSAFE */ + + printf("Most thread-safety tests skipped because THREADSAFE not enabled\n"); + +#endif /* H5_HAVE_THREADSAFE */ + /* Display testing information */ TestInfo(argv[0]); @@ -118,5 +144,6 @@ int main(int argc, char *argv[]) TestCleanup(); return GetTestNumErrs(); + } /* end main() */ -#endif /*H5_HAVE_THREADSAFE*/ + diff --git a/test/ttsafe.h b/test/ttsafe.h index b4826fc..f2e9e86 100644 --- a/test/ttsafe.h +++ b/test/ttsafe.h @@ -20,8 +20,6 @@ #ifndef TTSAFE_H #define TTSAFE_H -#include - /* * Include required headers. This file tests internal library functions, * so we include the private headers here. @@ -31,16 +29,13 @@ #include "H5Eprivate.h" #include "testhdf5.h" -#ifdef H5_HAVE_THREADSAFE -/* Include pthread library for threadsafe tests */ -#ifdef H5_HAVE_PTHREAD_H -#include -#endif /* H5_HAVE_PTHREAD_H */ /* Prototypes for the support routines */ extern char* gen_name(int); /* Prototypes for the test routines */ +void tts_is_threadsafe(void); +#ifdef H5_HAVE_THREADSAFE void tts_dcreate(void); void tts_error(void); void tts_cancel(void); @@ -54,3 +49,4 @@ void cleanup_acreate(void); #endif /* H5_HAVE_THREADSAFE */ #endif /* TTSAFE_H */ + diff --git a/test/ttsafe_error.c b/test/ttsafe_error.c index e143263..a2f25db 100644 --- a/test/ttsafe_error.c +++ b/test/ttsafe_error.c @@ -231,3 +231,4 @@ void cleanup_error(void) } #endif /*H5_HAVE_THREADSAFE*/ + -- cgit v0.12 From c491cf01bf8ca63cc3c3d8cad1f239975cc344dc Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 27 Aug 2015 08:41:32 -0500 Subject: [svn-r27590] Fix typo --- test/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 2dc8131..f33c2df 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -326,7 +326,7 @@ if (BUILD_SHARED_LIBS) target_link_libraries (hyperslab-shared ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) set_target_properties (hyperslab-shared PROPERTIES FOLDER test) if (HDF5_ENABLE_THREADSAFE) - set_property (TARGET hyperslab-shared} + set_property (TARGET hyperslab-shared APPEND PROPERTY COMPILE_DEFINITIONS "H5_HAVE_THREADSAFE" ) -- cgit v0.12 From 01a1e8f1caa498993f707b692f27bac82ba18470 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 27 Aug 2015 10:36:25 -0500 Subject: [svn-r27591] Threadsafe option implementation has changed and ALLOWUNSUPPORTED option needs to be used with TS to actually use of TS with Fortran and C++. --- CMakeLists.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5a1f68c..c75114e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -554,14 +554,16 @@ if (WIN32) endif (HDF5_ENABLE_PARALLEL) if (HDF5_BUILD_FORTRAN) if (NOT ALLOW_UNSUPPORTED) - message (FATAL_ERROR " **** Fortran and thread-safety options are not supported **** ") + message (STATUS " **** Fortran and thread-safety options are not supported **** ") + message (STATUS " **** thread-safety option will not be used building Fortran library **** ") else (NOT ALLOW_UNSUPPORTED) message (STATUS " **** Allowing unsupported Fortran and thread-safety options **** ") endif (NOT ALLOW_UNSUPPORTED) endif (HDF5_BUILD_FORTRAN) if (HDF5_BUILD_CPP_LIB) if (NOT ALLOW_UNSUPPORTED) - message (FATAL_ERROR " **** C++ and thread-safety options are not supported **** ") + message (STATUS " **** C++ and thread-safety options are not supported **** ") + message (STATUS " **** thread-safety option will not be used building C++ library **** ") else (NOT ALLOW_UNSUPPORTED) message (STATUS " **** Allowing unsupported C++ and thread-safety options **** ") endif (NOT ALLOW_UNSUPPORTED) -- cgit v0.12 From a9c28bac4e6822321c8a7a81784526201a2d6b09 Mon Sep 17 00:00:00 2001 From: Scot Breitenfeld Date: Thu, 27 Aug 2015 11:07:50 -0500 Subject: [svn-r27592] Added dll for H5DGET_OFFSET_F --- fortran/src/hdf5_fortrandll.def.in | 1 + 1 file changed, 1 insertion(+) diff --git a/fortran/src/hdf5_fortrandll.def.in b/fortran/src/hdf5_fortrandll.def.in index e931a97..1333262 100644 --- a/fortran/src/hdf5_fortrandll.def.in +++ b/fortran/src/hdf5_fortrandll.def.in @@ -64,6 +64,7 @@ H5D_mp_H5DFILL_CHAR H5D_mp_H5DFILL_INTEGER H5D_mp_H5DGET_SPACE_STATUS_F H5D_mp_H5DCREATE_ANON_F +H5D_mp_H5DGET_OFFSET_F H5D_mp_H5DGET_SPACE_F H5D_mp_H5DGET_TYPE_F H5D_mp_H5DSET_EXTENT_F -- cgit v0.12 From ccf2bcc6368fc3888c908da99da69c534888053d Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 27 Aug 2015 16:46:50 -0500 Subject: [svn-r27597] Update text files to match 1.8 changes --- release_docs/INSTALL_CMake.txt | 335 +++++---- release_docs/RELEASE.txt | 1242 +++------------------------------ release_docs/USING_CMake_Examples.txt | 45 +- release_docs/USING_HDF5_CMake.txt | 179 ++--- 4 files changed, 362 insertions(+), 1439 deletions(-) diff --git a/release_docs/INSTALL_CMake.txt b/release_docs/INSTALL_CMake.txt index 7a98bef..df6291f 100644 --- a/release_docs/INSTALL_CMake.txt +++ b/release_docs/INSTALL_CMake.txt @@ -4,11 +4,11 @@ ************************************************************************ Table of Contents - + Section I: Preconditions -Section II: Quick Step Building HDF5 Libraries with CMake Script Mode +Section II: Quick Step Building HDF5 Libraries with CMake Script Mode Section III: Quick Step Building HDF5 Libraries with CMake Command Mode -Section IV: Further considerations +Section IV: Further considerations Section V: Options for building HDF5 Libraries with CMake command line Section VI: CMake option defaults for HDF5 Section VII: User Defined Options for HDF5 Libraries with CMake @@ -20,7 +20,7 @@ Section VIII: Options for platform configuration files ======================================================================== I. Preconditions ======================================================================== -Obtaining HDF5 source code +Obtaining HDF5 source code 1. Create a directory for your development; for example, "myhdfstuff". 2. Obtain compressed (*.tar or *.zip) HDF5 source from @@ -29,17 +29,17 @@ Obtaining HDF5 source code Uncompress the file. There should be a hdf5-1.8."X" folder. CMake version - 1. We suggest you obtain the latest CMake from the Kitware web site. + 1. We suggest you obtain the latest CMake from the Kitware web site. The HDF5 1.8."X" product requires a minimum CMake version 3.1.0, - where "X" is the current HDF5 release version. + where "X" is the current HDF5 release version. ======================================================================== II. Quick Step Building HDF5 Libraries with CMake Script Mode ======================================================================== -This short set of instructions is written for users who want to quickly -build the HDF5 C and C++ static libraries and tools with SZIP and ZLIB -compression included. This procedure will use the default settings in +This short set of instructions is written for users who want to quickly +build the HDF5 C and C++ static libraries and tools with SZIP and ZLIB +compression included. This procedure will use the default settings in the config/cmake/cacheinit.cmake file. HDF Group recommends using the ctest script mode to build HDF5. @@ -57,7 +57,7 @@ CMake build script: External compression szip and zlib libraries: SZip.tar.gz ZLib.tar.gz - + Platform configuration files: HDF518config.cmake ----------------------------------------------- @@ -65,18 +65,18 @@ Platform configuration files: To build HDF5 with the SZIP and ZLIB external libraries you will need to: 1. Change to the development directory "myhdfstuff". - + 2. Download the SZip.tar.gz and ZLib.tar.gz to "myhdfstuff". Do not uncompress the files. - + 3. Download the CTestScript.cmake file to "myhdfstuff". - CTestScript.cmake file should not be modified. - + CTestScript.cmake file should not be modified. + 4. Download the platform configuration file, HDF518config.cmake, to "myhdfstuff". Do not modify the file unless you want to change default build environment. (See http://www.hdfgroup.org/HDF5/release/chgcmkbuild.html) - 5. From the "myhdfstuff" directory execute the CTest Script with the + 5. From the "myhdfstuff" directory execute the CTest Script with the following options: On 32-bit Windows with Visual Studio 2012, execute: @@ -90,31 +90,31 @@ To build HDF5 with the SZIP and ZLIB external libraries you will need to: On Linux and Mac, execute: ctest -S HDF518config.cmake -C Release -VV -O hdf5.log - The command above will configure, build, test, and create an install + The command above will configure, build, test, and create an install package in the myhdfstuff folder. It will have the format: HDF5-1.8.NN-. On Unix, will be "Linux". A similar .sh file will also be created. - On Windows, will be "win64" or "win32". If you have an - installer on your system, you will also see a similar file that ends + On Windows, will be "win64" or "win32". If you have an + installer on your system, you will also see a similar file that ends in either .exe (NSIS) or .msi (WiX). - + The -S option uses the script version of ctest. - - The value for the -C option (as shown above, "-C Release") must - match the setting for CTEST_BUILD_CONFIGURATION in the platform + + The value for the -C option (as shown above, "-C Release") must + match the setting for CTEST_BUILD_CONFIGURATION in the platform configuration file. - + The -VV option is for most verbose; use -V for less verbose. - + The "-O hdf5.log" option saves the output to a log file hdf5.log. 6. To install, "X" is the current release version - + On Windows, execute: HDF5-1.8."X"-win32.msi or HDF5-1.8."X"-win64.msi By default this program will install the hdf5 library into the - "C:\Program Files" directory and will create the following + "C:\Program Files" directory and will create the following directory structure: HDF_Group --HDF5 @@ -124,14 +124,14 @@ To build HDF5 with the SZIP and ZLIB external libraries you will need to: ------lib ------cmake - On Linux, change to the install destination directory + On Linux, change to the install destination directory (create it if doesn't exist) and execute: /myhdfstuff/HDF5-1.8."X"-Linux.sh After accepting the license, the script will prompt: By default the HDF5 will be installed in: "/HDF5-1.8."X"-Linux" Do you want to include the subdirectory HDF5-1.8."X"-Linux? - Saying no will install in: "" [Yn]: + Saying no will install in: "" [Yn]: Note that the script will create the following directory structure relative to the install point: HDF_Group @@ -141,10 +141,10 @@ To build HDF5 with the SZIP and ZLIB external libraries you will need to: ------include ------lib ------share - + On Mac you will find HDF5-1.8."X"-Darwin.dmg in the myhdfstuff folder. Click on the dmg file to proceed with installation. After accepting the license, - there will be a folder with the following structure: + there will be a folder with the following structure: HDF_Group --HDF5 ----1.8."X" @@ -152,7 +152,7 @@ To build HDF5 with the SZIP and ZLIB external libraries you will need to: ------include ------lib ------share - + By default the installation will create the bin, include, lib and cmake folders in the /HDF_Group/HDF5/1.8."X" @@ -160,47 +160,47 @@ To build HDF5 with the SZIP and ZLIB external libraries you will need to: ======================================================================== III. Quick Step Building HDF5 C Static Libraries and Tools with CMake ======================================================================== -Notes: This short set of instructions is written for users who want to - quickly build the just the HDF5 C static library and tools from +Notes: This short set of instructions is written for users who want to + quickly build the just the HDF5 C static library and tools from the HDF5 source code package using the CMake command line tools. - + Go through these steps: 1. Change to the development directory "myhdfstuff". 2. Uncompress the HDF5 source file - + 3. Create a folder "build" in the "myhdfstuff" directory. - - 4. Change into the "build" folder. - + + 4. Change into the "build" folder. + 5. Configure the C library, tools and tests with one of the following commands: On Windows 32 bit - cmake -G "Visual Studio 11 2012" -DCMAKE_BUILD_TYPE:STRING=Release -DBUILD_TESTING:BOOL=ON -DHDF5_BUILD_TOOLS:BOOL=ON ..\hdf5-1.8."X" + cmake -G "Visual Studio 11 2012" -DCMAKE_BUILD_TYPE:STRING=Release -DBUILD_SHARED_LIBS:BOOL=OFF -DBUILD_TESTING:BOOL=ON -DHDF5_BUILD_TOOLS:BOOL=ON ..\hdf5-1.8."X" On Windows 64 bit - cmake -G "Visual Studio 11 2012 Win64" -DCMAKE_BUILD_TYPE:STRING=Release -DBUILD_TESTING:BOOL=ON -DHDF5_BUILD_TOOLS:BOOL=ON ..\hdf5-1.8."X" - + cmake -G "Visual Studio 11 2012 Win64" -DCMAKE_BUILD_TYPE:STRING=Release -DBUILD_SHARED_LIBS:BOOL=OFF -DBUILD_TESTING:BOOL=ON -DHDF5_BUILD_TOOLS:BOOL=ON ..\hdf5-1.8."X" + On Linux and Mac - cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE:STRING=Release -DBUILD_TESTING:BOOL=ON -DHDF5_BUILD_TOOLS:BOOL=ON ../hdf5-1.8."X" + cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE:STRING=Release -DBUILD_SHARED_LIBS:BOOL=OFF -DBUILD_TESTING:BOOL=ON -DHDF5_BUILD_TOOLS:BOOL=ON ../hdf5-1.8."X" where "X" is the current release version. - + 6. Build the C library, tools and tests with this command: cmake --build . --config Release - + 7. Test the C library and tools with this command: ctest . -C Release - + 8. Create an install image with this command: cpack -C Release CPackConfig.cmake - - 9. To install + + 9. To install On Windows, execute: HDF5-1.8."X"-win32.msi or HDF5-1.8."X"-win64.msi By default this program will install the hdf5 library into the - "C:\Program Files" directory and will create the following + "C:\Program Files" directory and will create the following directory structure: HDF_Group --HDF5 @@ -210,14 +210,14 @@ Notes: This short set of instructions is written for users who want to ------lib ------cmake - On Linux, change to the install destination directory + On Linux, change to the install destination directory (create if doesn't exist) and execute: /myhdfstuff/build/HDF5-1.8."X"-Linux.sh After accepting the license, the script will prompt: By default the HDF5 will be installed in: "/HDF5-1.8."X"-Linux" Do you want to include the subdirectory HDF5-1.8."X"-Linux? - Saying no will install in: "" [Yn]: + Saying no will install in: "" [Yn]: Note that the script will create the following directory structure relative to the install point: HDF_Group @@ -227,10 +227,10 @@ Notes: This short set of instructions is written for users who want to ------include ------lib ------share - + On Mac you will find HDF5-1.8."X"-Darwin.dmg in the build folder. Click on the dmg file to proceed with installation. After accepting the license, - there will be a folder with the following structure: + there will be a folder with the following structure: HDF_Group --HDF5 ----1.8."X" @@ -241,41 +241,41 @@ Notes: This short set of instructions is written for users who want to ======================================================================== -IV. Further considerations +IV. Further considerations ======================================================================== 1. We suggest you obtain the latest CMake for windows from the Kitware - web site. The HDF5 1.8."X" product requires a minimum CMake version 3.1.0. - + web site. The HDF5 1.8."X" product requires a minimum CMake version 3.1.0. + 2. If you plan to use Zlib or Szip: - A. Download the binary packages and install them in a central location. - For example on Windows, create a folder extlibs and install the + A. Download the binary packages and install them in a central location. + For example on Windows, create a folder extlibs and install the packages there. Add the following CMake options: -DZLIB_LIBRARY:FILEPATH=some_location/lib/zlib.lib -DZLIB_INCLUDE_DIR:PATH=some_location/include -DSZIP_LIBRARY:FILEPATH=some_location/lib/szlib.lib -DSZIP_INCLUDE_DIR:PATH=some_location/include - where "some_location" is the full path to the extlibs folder. + where "some_location" is the full path to the extlibs folder. - B. Use source packages from an SVN server by adding the following CMake + B. Use source packages from an SVN server by adding the following CMake options: HDF5_ALLOW_EXTERNAL_SUPPORT:STRING="SVN" ZLIB_SVN_URL:STRING="http://some_location/zlib/trunk" SZIP_SVN_URL:STRING="http://some_location/szip/trunk" where "some_location" is the URL to the SVN repository. Also set CMAKE_BUILD_TYPE to the configuration type. - - C. Use source packages from a compressed file by adding the following + + C. Use source packages from a compressed file by adding the following CMake options: HDF5_ALLOW_EXTERNAL_SUPPORT:STRING="TGZ" ZLIB_TGZ_NAME:STRING="zlib_src.ext" SZIP_TGZ_NAME:STRING="szip_src.ext" TGZPATH:STRING="some_location" - where "some_location" is the URL or full path to the compressed + where "some_location" is the URL or full path to the compressed file and ext is the type of compression file. Also set CMAKE_BUILD_TYPE to the configuration type during configuration - - 3. If you are building on Apple Darwin platforms, you should add the + + 3. If you are building on Apple Darwin platforms, you should add the following options: Compiler choice - use xcode by setting the ENV variables of CC and CXX Shared fortran is not supported, build static: @@ -283,12 +283,12 @@ IV. Further considerations Additional options: CMAKE_ANSI_CFLAGS:STRING=-fPIC CTEST_USE_LAUNCHERS:BOOL=ON - CMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=OFF - + CMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=OFF + 4. Windows developers should install NSIS or WiX to create an install image with CPack. Visual Studio Express users will not be able to package HDF5 into an install image executable. - + 5. Developers can copy the config/cmake/cacheinit.cmake file and alter the the settings for the developers' environment. Then the only options needed on the command line are those options that are different. Example using HDF @@ -299,31 +299,31 @@ IV. Further considerations Notes: CMake and HDF5 - 1. Using CMake for building and using HDF5 is under active development. - While we have attempted to provide error-free files, please - understand that development with CMake has not been extensively + 1. Using CMake for building and using HDF5 is under active development. + While we have attempted to provide error-free files, please + understand that development with CMake has not been extensively tested outside of HDF. The CMake specific files may change before the next release. - - 2. CMake support for HDF5 development should be usable on any - system where CMake is supported. Please send us any comments on - how CMake support can be improved on any system. Visit the + + 2. CMake support for HDF5 development should be usable on any + system where CMake is supported. Please send us any comments on + how CMake support can be improved on any system. Visit the KitWare site for more information about CMake. - + 3. Build and test results can be submitted to our CDash server, please read the HDF and CDash document at: - www.hdfgroup.org/CDash/HowToSubmit. - + www.hdfgroup.org/CDash/HowToSubmit. + 4. See the appendix at the bottom of this file for examples of using a ctest script for building and testing. Using a ctest script is preferred because of its flexibility. - + Notes: CMake in General - 1. More information about using CMake can be found at the KitWare site at + 1. More information about using CMake can be found at the KitWare site at www.cmake.org. - - 2. CMake uses the command line; however, the visual CMake tool is + + 2. CMake uses the command line; however, the visual CMake tool is available for the configuration step. The steps are similar for all the operating systems supported by CMake. @@ -348,27 +348,27 @@ These five steps are described in detail below. The visual CMake executable is named "cmake-gui.exe" on Windows and should be available in your Start menu. For Linux, UNIX, and Mac users the - executable is named "cmake-gui" and can be found where CMake was - installed. - - Specify the source and build directories. - + executable is named "cmake-gui" and can be found where CMake was + installed. + + Specify the source and build directories. + ***** Make the build and source directories different. ****** - - For example on Windows, if the source is at c:\MyHDFstuff\hdf5, - then use c:\MyHDFstuff\hdf5\build or c:\MyHDFstuff\build\hdf5 as the + + For example on Windows, if the source is at c:\MyHDFstuff\hdf5, + then use c:\MyHDFstuff\hdf5\build or c:\MyHDFstuff\build\hdf5 as the build directory. - + RECOMMENDED: - Users can perform the configuration step without using the visual - cmake-gui program. We use the file cacheinit.cmake in the - config/cmake source folder for our testing. This file enables all of the - basic options and we turn specific options on or off for testing + Users can perform the configuration step without using the visual + cmake-gui program. We use the file cacheinit.cmake in the + config/cmake source folder for our testing. This file enables all of the + basic options and we turn specific options on or off for testing using the following command line within the build directory: - + cmake -C /config/cmake/cacheinit.cmake -G "" [-D] - - Where is + + Where is * MinGW Makefiles * NMake Makefiles * Unix Makefiles @@ -424,128 +424,128 @@ These five steps are described in detail below. 2. Configure the cache settings - 2.1 Visual CMake users, click the Configure button. If this is the first time you are - running cmake-gui in this directory, you will be prompted for the - generator you wish to use (for example on Windows, Visual Studio 11). - CMake will read in the CMakeLists.txt files from the source directory and - display options for the HDF5 project. After the first configure you + 2.1 Visual CMake users, click the Configure button. If this is the first time you are + running cmake-gui in this directory, you will be prompted for the + generator you wish to use (for example on Windows, Visual Studio 11). + CMake will read in the CMakeLists.txt files from the source directory and + display options for the HDF5 project. After the first configure you can adjust the cache settings and/or specify the locations of other programs. - + Any conflicts or new values will be highlighted by the configure - process in red. Once you are happy with all the settings and there are no - more values in red, click the Generate button to produce the appropriate - build files. - - On Windows, if you are using a Visual Studio generator, the solution and + process in red. Once you are happy with all the settings and there are no + more values in red, click the Generate button to produce the appropriate + build files. + + On Windows, if you are using a Visual Studio generator, the solution and project files will be created in the build folder. - + On linux, if you are using the Unix Makefiles generator, the Makefiles will be created in the build folder. 2.2 Preferred command line example on Windows in c:\MyHDFstuff\hdf5\build directory: - + cmake -C ../config/cmake/cacheinit.cmake -G "Visual Studio 11 2012" \ -DHDF5_ENABLE_SZIP_SUPPORT:BOOL=OFF -DHDF5_ENABLE_Z_LIB_SUPPORT:BOOL=OFF \ -DCMAKE_BUILD_TYPE:STRING=Release .. - 2.3 On Windows, if you are using a Visual Studio Express version you must + 2.3 On Windows, if you are using a Visual Studio Express version you must be sure that the following two options are correctly set/unset: - + HDF5_NO_PACKAGES:BOOL=ON HDF5_USE_FOLDERS:BOOL=OFF - + 3. Build HDF5 - - On Windows, you can build HDF5 using either the Visual Studio Environment + + On Windows, you can build HDF5 using either the Visual Studio Environment or the command line. The command line can be used on all platforms; Windows, linux, Unix, and Mac. To build from the command line, navigate to your build directory and execute the following: - - cmake --build . --config {Debug | Release} - + + cmake --build . --config {Debug | Release} + NOTE: "--config {Debug | Release}" may be optional on your platform. We - recommend choosing either Debug or Release on Windows. - - 3.1 If you wish to use the Visual Studio environment, open the solution - file in your build directory. Be sure to select either Debug or + recommend choosing either Debug or Release on Windows. + + 3.1 If you wish to use the Visual Studio environment, open the solution + file in your build directory. Be sure to select either Debug or Release and build the solution. - + 3.2.1 The external libraries (zlib and szip) can be configured to allow building the libraries by downloading from an SVN repository. The option is 'HDF5_ALLOW_EXTERNAL_SUPPORT'; by adding the following configuration option: -DHDF5_ALLOW_EXTERNAL_SUPPORT:STRING="SVN" - + The options to control the SVN URL (config/cmake/cacheinit.cmake file) are: ZLIB_SVN_URL:STRING="http://${svn_url}/zlib/trunk" SZIP_SVN_URL:STRING="http://${svn_url}/szip/trunk" ${svn_url} should be changed to your location. Also define CMAKE_BUILD_TYPE to be the configuration type. - + 3.2.2 Or the external libraries (zlib and szip) can be configured to allow building the libraries by using a compressed file. - The option is 'HDF5_ALLOW_EXTERNAL_SUPPORT' and is enabled by + The option is 'HDF5_ALLOW_EXTERNAL_SUPPORT' and is enabled by adding the following configuration option: -DHDF5_ALLOW_EXTERNAL_SUPPORT:STRING="TGZ" - - The options to control the SVN URL (config/cmake/cacheinit.cmake + + The options to control the SVN URL (config/cmake/cacheinit.cmake file) are: ZLIB_TGZ_NAME:STRING="zlib_src.ext" SZIP_TGZ_NAME:STRING="szip_src.ext" TGZPATH:STRING="some_location" - where "some_location/xxxx_src.ext" is the URL or full path to - the compressed file and where ext is the type of the compression + where "some_location/xxxx_src.ext" is the URL or full path to + the compressed file and where ext is the type of the compression file such as .bz2, .tar, .tar.gz, .tgz, or .zip. Also define CMAKE_BUILD_TYPE to be the configuration type. 4. Test HDF5 To test the build, navigate to your build directory and execute: - + ctest . -C {Debug | Release} - + NOTE: "-C {Debug | Release}" may be optional on your platform. We recommend choosing either Debug or Release to match the build - step on Windows. + step on Windows. 5. Packaging HDF5 (create an install image) - + To package the build into a simple installer using WiX toolset or the NullSoft installer NSIS on Windows, or into compressed files (.tar.gz, .sh, .zip), use the CPack tool. To package the build, navigate to your build directory and execute; - + cpack -C {Debug | Release} CPackConfig.cmake - + NOTE: See note 8 of this document for NSIS information. See note 9 of this document for WiX information. - Also, if you are using a Visual Studio Express version or do not - want to enable the packaging components, set HDF5_NO_PACKAGES + Also, if you are using a Visual Studio Express version or do not + want to enable the packaging components, set HDF5_NO_PACKAGES to ON (on the command line add -DHDF5_NO_PACKAGES:BOOL=ON) - - 6. The files that support building HDF5 with CMake are all the files in the - config/cmake folder, the CMakeLists.txt files in each source folder, and - CTestConfig.cmake. CTestConfig.cmake is specific to the internal testing - performed by The HDF Group. It should be altered for the user's + + 6. The files that support building HDF5 with CMake are all the files in the + config/cmake folder, the CMakeLists.txt files in each source folder, and + CTestConfig.cmake. CTestConfig.cmake is specific to the internal testing + performed by The HDF Group. It should be altered for the user's installation and needs. The cacheinit.cmake file settings are used by - The HDF Group for daily testing. It should be altered/ignored for the user's + The HDF Group for daily testing. It should be altered/ignored for the user's installation and needs. - 7. More information about using CMake can be found at the KitWare site, + 7. More information about using CMake can be found at the KitWare site, www.cmake.org. - + 8. Nullsoft Scriptable Install System - The Nullsoft Scriptable Install System (NSIS) is an open source installation - system. It was created by the WinAmp authors to distribute that application, - but it is now a general-purpose system which anyone might use. NSIS installers - recognize /S for silent installation and /D=dir to specify the - "output directory", which is where the program will be installed. These - options are case-sensitive, so be sure to type them in upper case. + The Nullsoft Scriptable Install System (NSIS) is an open source installation + system. It was created by the WinAmp authors to distribute that application, + but it is now a general-purpose system which anyone might use. NSIS installers + recognize /S for silent installation and /D=dir to specify the + "output directory", which is where the program will be installed. These + options are case-sensitive, so be sure to type them in upper case. 9. WiX Toolset - WiX--the Windows Installer XML toolset--lets developers create installers for + WiX--the Windows Installer XML toolset--lets developers create installers for Windows Installer, the Windows installation engine. See http://wixtoolset.org. @@ -553,14 +553,14 @@ These five steps are described in detail below. VI. CMake Option Defaults for HDF5 ======================================================================== -In the options listed below, there are three columns of information: -Option Name, Option Description, and Option Default. -The config/cmake/cacheinit.cmake file overrides the following values. +In the options listed below, there are three columns of information: +Option Name, Option Description, and Option Default. +The config/cmake/cacheinit.cmake file can override the following values. ---------------- General Build Options --------------------- -BUILD_SHARED_LIBS "Build Shared Libraries" OFF +BUILD_SHARED_LIBS "Build Shared Libraries" ON BUILD_STATIC_EXECS "Build Static Executabless" OFF -BUILD_TESTING "Build HDF5 Unit Testing" OFF +BUILD_TESTING "Build HDF5 Unit Testing" ON ---------------- HDF5 Build Options --------------------- HDF5_BUILD_CPP_LIB "Build HDF5 C++ Library" ON @@ -568,7 +568,7 @@ HDF5_BUILD_EXAMPLES "Build HDF5 Library Examples" ON HDF5_BUILD_FORTRAN "Build FORTRAN support" OFF HDF5_BUILD_HL_LIB "Build HIGH Level HDF5 Library" ON HDF5_BUILD_TOOLS "Build HDF5 Tools" ON -if (HDF5_BUILD_FORTRAN) +if (HDF5_BUILD_FORTRAN) HDF5_ENABLE_F2003 "Enable FORTRAN 2003 Standard" ON ---------------- HDF5 Advanced Options --------------------- @@ -591,14 +591,13 @@ HDF5_STRICT_FORMAT_CHECKS "Whether to perform strict file format checks" HDF5_TEST_VFD "Execute tests with different VFDs" OFF HDF5_USE_16_API_DEFAULT "Use the HDF5 1.6.x API by default" OFF HDF5_USE_FOLDERS "Enable folder grouping of projects in IDEs." OFF -HDF5_WANT_DATA_ACCURACY "IF data accuracy is guaranteed during data conversions" ON HDF5_WANT_DCONV_EXCEPTION "exception handling functions is checked during data conversions" ON HDF5_ENABLE_THREADSAFE "Enable Threadsafety" OFF -if (APPLE) +if (APPLE) HDF5_BUILD_WITH_INSTALL_NAME "Build with library install_name set to the installation path" OFF -if (CMAKE_BUILD_TYPE MATCHES Debug) +if (CMAKE_BUILD_TYPE MATCHES Debug) HDF5_ENABLE_TRACE "Enable API tracing capability" ON -if (HDF5_TEST_VFD) +if (HDF5_TEST_VFD) HDF5_TEST_FHEAP_VFD "Execute fheap test with different VFDs" ON ---------------- External Library Options --------------------- @@ -607,7 +606,7 @@ HDF5_ENABLE_SZIP_SUPPORT "Use SZip Filter" OFF HDF5_ENABLE_Z_LIB_SUPPORT "Enable Zlib Filters" OFF ZLIB_USE_EXTERNAL "Use External Library Building for ZLIB" 0 SZIP_USE_EXTERNAL "Use External Library Building for SZIP" 0 -if (HDF5_ENABLE_SZIP_SUPPORT) +if (HDF5_ENABLE_SZIP_SUPPORT) HDF5_ENABLE_SZIP_ENCODING "Use SZip Encoding" OFF if (WINDOWS) H5_DEFAULT_PLUGINDIR "%ALLUSERSPROFILE%/hdf5/lib/plugin" @@ -624,9 +623,9 @@ VII. User Defined Options for HDF5 Libraries with CMake Support for User Defined macros and options has been added. The file UserMacros.cmake has an example of the technique. In the folder, config/cmake/UserMacros, is an implementation for Windows Visual Studio -users for linking libraries to the static CRT - Windows_MT.cmake. +users for linking libraries to the static CRT - Windows_MT.cmake. -Copy the contents of the file, both macro and option, into the +Copy the contents of the file, both macro and option, into the UserMacros.cmake file. Then enable the option to the CMake configuration, build and test process. @@ -648,7 +647,7 @@ adding an option (${CTEST_SCRIPT_ARG}) to the platform configuration script. ######################################################################### cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR) -set(CTEST_SOURCE_VERSION 1.8.15-pre7) +set(CTEST_SOURCE_VERSION 1.8.16) set(CTEST_SOURCE_NAME hdf5-${CTEST_SOURCE_VERSION}) set(CTEST_BINARY_NAME "build") set(CTEST_DASHBOARD_ROOT "${CTEST_SCRIPT_DIRECTORY}") @@ -709,7 +708,7 @@ endif() ################################################################### set(MODEL "Experimental") ######### Following describes computer ############ -## following is optional to describe build ## +## following is optional to describe build ## set(SITE_BUILDNAME_SUFFIX "STATIC") ################################################################### diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 849a340..fdc1dac 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -5,19 +5,19 @@ HDF5 version 1.9.229 currently under development INTRODUCTION This document describes the differences between HDF5-1.9.0 and -HDF5 1.9.x snapshot, and contains information on the platforms -tested and known problems in HDF5-1.9.x. +HDF5 1.9.x snapshot, and contains information on the platforms +tested and known problems in HDF5-1.9.x. For more details check the HISTORY*.txt files in the HDF5 source. -Links to HDF5 1.9.x source code can be found on The HDF Group's +Links to HDF5 1.9.x source code can be found on The HDF Group's development FTP server at the following location: ftp://ftp.hdfgroup.uiuc.edu/pub/outgoing/hdf5/snapshots -User documentation for the snapshot can be accessed directly at this location: +User documentation for the snapshot can be accessed directly at this location: http://www.hdfgroup.uiuc.edu/HDF5/doc_dev_snapshot/H5_dev/ For more information, see the HDF5 home page: - + http://www.hdfgroup.org/HDF5/ If you have any questions or comments, please send them to the HDF Help Desk: @@ -41,1137 +41,67 @@ New Features Configuration: ------------- - - cmakehdf5: configure options added to enable or disable the building of - different API's and testings. See "cmakehdf5 --help" for details. - (AKC - 2014/12/09 HDFFV-8932) - - Autotools: Automake updated to 1.14.1 (ADB - 2014/04/08) - - CMake: Moved minimum CMake version to 2.8.11 which enables better library - include processing. (ADB - 2014/03/26) - - New configuration option added to change the default plugin path. - configure option is --with-default-plugin=location - cmake option is -DH5_DEFAULT_PLUGINDIR:PATH=location - HDFFV-8513. (ADB 2013/09/04) - - Rename FFLAGS to FCFLAGS in configure (ADB 2013/08/13) - - CMake minimum is now 2.8.10. (ADB 2013/01/14) - - A new tool, cmakehdf5, which is a build command script similar to - buildhdf5 is added and is available in the bin directory. - (AKC - 2012/12/12) - - Fixed AIX Fortran compiler flags to use appropriate settings for - debugging, profiling, optimization situations. HDFFV-8069. (AKC - 2012/09/27) - - Updated to latest autotools and changed all hard *.sh scripts to - configure managed *.sh.in files. Removed overloading of autotools - TESTS variable by examples and tests. Renamed configure.in to - configure.ac. (ADB - 2012/08/23 - HDFFV-8129) - - Added code to display the version information of XL fortran and C++ - in the summary of configure. (AKC - 2012/02/28 - HDFFV-7793) - - Configure now generates Makefiles that build in "silent make mode" - by default in which compile and link lines are significantly - simplified for clarity. To override this and view actual compile and - link lines during building, the --disable-silent-rules flag can be used - at configure time, or the 'make' command can be followed by V=1, to - indicate a "verbose" make. (MAM - 2011/4/14). - - Added mpicc and mpif90 as the default C and Fortran compilers for Linux - systems when --enable-parallel is specified but no $CC or $FC is defined. - (AKC - 2011/2/7) - - Added a new configure option, "--enable-unsupported", which can - be used to stop configure from preventing the use of unsupported - configure option combinations, such as c++ in parallel or parallel - HDF5 with threadsafe. Use at your own risk, as it may result in a - library that won't compile or run as expected! - (MAM - 2010/11/17 - Bug 2061) - - PHDF5 changed to use "mpiexec", instead of mpirun, as the default MPI - applications startup command as defined in the MPI-2 definition, section - 4.1. (AKC - 2010/6/11 - Bug 1921) - - Configure now adds appropriate defines for supporting large (64-bit) - files on all systems, where supported, by default, instead of only linux. - This largefile support is controllable with the --enable-largefile - configure option. This is replacing the linux-specific --enable-linux-lfs - option, which has been removed from configure. - (MAM - 2010/05/05 - 1772/1434) - - Upgraded versions of autotools used to generate configuration suite. - We now use Automake 1.11.1, Autoconf 2.65, and Libtool 2.2.6b. - MAM 2010/04/15. - - Added the xlc-* and mpcc_r-* BASENAME patterns to be recognized as IBM - compilers so that the ibm compiler options can be added properly. This - allows non-system-default compiler command names (e.g. xlc-m.n.k.l) be - recognized. AKC 2009/11/26. - - Configuration suite now uses Automake 1.11 and Autoconf 2.64. - MAM 2009/08/11. - - Changed default Gnu fortran compiler from g95 to gfortran since - gfortran is more likely installed with gcc now. -AKC 2009/07/19- - - Added libtool version numbers to generated c++, fortran, and - hl libraries. MAM 2009/04/19. - - Regenerated Makefile.ins using Automake 1.10.2. MAM 2009/04/19. - - Added a Make target of check-all-install to test the correctness of - installing via the prefix= or $DESTDIR options. AKC - 2009/04/14 - - Configuration suite now uses Libtool 2.2.6a. MAM 2008/10/24 - - - Configuration suite now uses Autoconf 2.61, Automake 1.10.1. - MAM 2008/05/05. - - - The new configure option "--disable-sharedlib-rpath" disables - embedding the '-Wl,-rpath' information into executables when - shared libraries are produced, and instead solely relies on the - information in LD_LIBRARY_PATH. (MAM - 2008/05/15) Library: -------- - - H5F_ACC_DEBUG labeled "deprecated" - - The symbol was originally used to emit some extra debugging - informationi in the multi VFD. The underlying functionality - was removed due to disuse in HDF5 1.8.16 though the symbol - remained defined since it was visible in H5Fpublic.h. - - In this release, the symbol has been labeled deprecated and will - not be defined when H5_NO_DEPRECATED_SYMBOLS is defined. - - (DER - 2015-04-30, HDFFV-1074) - - - The library can load filter libraries dynamically during runtime. Users - can set the search path through environment variable HDF5_PLUGIN_PATH - and call H5Pset_filter to enable a dynamic filter. (SLU - 2013/04/08) - - Added new API functions H5Dscatter and H5Dgather to scatter data to and - and gather data from a selection within a memory buffer. - (NAF - 2013/02/05) - - The library now supports the data conversion from enumeration to numeric - (integer and floating-point number) datatypes. See Issue 8221. - (SLU - 2012/10/23) - - The data sieve buffer size was for all the datasets in the file. It - could waste memory if any dataset size is smaller than the sieve buffer - size. Now the library picks the smaller one between the dataset size - and the sieve buffer size from the file access property. See Issue 7934. - (SLU - 2012/4/2) - - I added a new parameter of object access property list to the function - H5Rdereference (Issue 2763). It's called H5Rdereference2 now. The former - H5Rdereference function has been deprecated to H5Rdereference1. (SLU - - 2011/7/18) - - H5Tcreate now supports string type (fixed-length and variable-length). - (SLU - 2011/05/20) - - Added ability to cache files opened through external links. Added new - public functions H5Pset_elink_file_cache_size(), - H5Pget_elink_file_cache_size(), and H5Fclear_elink_file_cache(). - (NAF - 2011/02/17) - - Removed all old code for Metraowerks compilers, bracketed by - __MWERKS__). Metraowerks compiler is long gone. (AKC - 2010/11/17) - - Added support for threadsafety on windows using the windows threads - library. Use the HDF5_ENABLE_THREADSAFE option in CMake while on a - windows platform to enable this functionality. This is supported on - Windows Vista and newer Windows operating systems. (MAM - 2010/09/10) - - When a mandatory filter failed to write data chunks, the dataset - couldn't close (bug 1260). The fix releases all resources and closes - the dataset but returns a failure. (SLU - 2010/9/8) - - H5Tset_order and H5Tget_order now support all data types. A new byte - order H5T_ORDER_MIXED has been added specifically for compound datatype - and its derived type. Please see bug #1934. (SLU - 2010/8/23) - - Improved performance of the chunk cache by avoiding unnecessary b-tree - lookups of chunks already in cache. (NAF - 2010/06/15) - - Greatly improved performance of extending a dataset with early - allocation. (NAF - 2010/03/24 - 1637) - - Added support for filtering densely stored groups. Many of the API - functions related to filters have been extended to support dense groups - as well as datasets. Pipeline messages can now be stored in a group's - object header. (NAF/QAK - 2009/10/8) - - The embedded library information is displayed by H5check_version() if a - version mismatch is detected. Also changed H5check_version() to - suppress the warning message totally if $HDF5_DISABLE_VERSION_CHECK is 2 - or higher. (Old behavior treated 3 or higher the same as 1, that is - print a warning and allows the program to continue. (AKC - 2009/9/28) - - If a user does not care for the extra library information insert - in the executables, he may turn it off by --disable-embedded-libinfo - during configure. (AKC - 2009/9/15) - - Corrected problem where library would re-write the superblock in a file - opened for R/W access, even when no changes were made to the file. - (QAK - 2009/08/20, Bz#1473) - - Separated "factory" free list class from block free lists. These free - lists are dynamically created and manage blocks of a fixed size. - H5set_free_list_limits() will use the same settings specified for block - free lists for factory free lists. (NAF - 2009/04/08) - - Added support for dense attributes to H5Ocopy. (XCao/NAF - 2009/01/29) - - Added H5Pset_elink_cb and H5Pget_elink_cb functions to support a - user-defined callback function for external link traversal. - (NAF - 2009/01/08) - - Added H5Pset_elink_acc_flags and H5Pget_elink_acc_flags functions to - allow the user to specify the file access flags used to open the target - file of an external link. (NAF - 2009/01/08) - - Added H5Pset_chunk_cache() and H5Pget_chunk_cache() functions to allow - individual rdcc configuration for each dataset. Added - H5Dget_access_plist() function to retrieve a dataset access property - list from a dataset. (NAF - 2008/11/12) - - Added H5Iis_valid() function to check if an id is valid without producing - an error message. (NAF - 2008/11/5) - - Added two new public routines: H5Pget_elink_fapl() and - H5Pset_elink_fapl(). (see bug #1247) (VC - 2008/10/13) - - Improved free space tracking in file to be faster. (QAK - 2008/10/06) - - Added 'mounted' field to H5G_info_t struct. (QAK - 2008/07/15) Parallel Library: ----------------- - - Add H5Pget_mpio_no_collective_cause() function that retrive reasons - why the collective I/O was broken during read/write IO access. - (JKM - 2012/08/30 HDFFV-8143) - - Special Collective IO (IO when some processes do not contribute to the - IO) and Complex Derived Datatype MPI functionalities are no longer - conditionally enabled in the library by configure. They are always - enabled in order to take advantage of performance boosts from these - behaviors. Older MPI implementations that do not allow for these - functionalities can no longer by used by HDF5. (MAM - 2011/07/08). - - Modified parallel tests to run with arbitrary number of processes. The - modified tests are testphdf5 (parallel dataset access), t_chunk_alloc - (chunk allocation), and t_posix_compliant (posix compliance). The rest of - the parallel tests already use in the code the number of processes - available in the communicator. (CMC - 2009/04/28) Fortran Library: ---------------- - - Added parallel routine H5Pget_mpio_actual_io_mode_f (MSB - 2012/09/27) - - - Added for the C API the Fortran wrapper: - h5ocopy_f (MSB - 2012/03/22) - - - HDF5 Fortran library was enhanced to support Fortran 2003 standard. - The following features are available when the HDF5 library is configured - using --enable-fortran --enable-fortran2003 configure flags AND - if fortran compiler is Fortran2003 compliant: - - - Subroutines overloaded with the C_PTR derived type: - h5pget_f - h5pget_fill_value_f - h5pinsert_f - h5pregister_f - h5pset_f - h5pset_fill_value_f - h5rcreate_f - h5rderefrence_f - h5rget_name_f - h5rget_obj_type_f - - Subroutines overloaded with the C_PTR derived type - and simplified signatures: - h5aread_f - h5awrite_f - h5dread_f - h5dwrite_f - - New subroutines - h5dvlen_reclaim_f - h5literate_by_name_f - h5literate_f - h5ovisit_f - h5tconvert_f - - - Subroutines with additional optional parameters: - h5pcreate_class_f - (EIP - 2011/10/14) - - - Added for the C APIs the Fortran wrappers: - h5dget_access_plist_f - h5iis_valid_f - h5pset_chunk_cache_f - h5pget_chunk_cache_f - (MSB - 2009/04/17) - - - C++ Library: ------------ - - New member functions - + Overloaded CommonFG::getObjnameByIdx to take char* for name - + Overloaded CommonFG::getObjTypeByIdx to return type name as a char*. - (BMR - 2010/05/02) - + DataSet::getInMemDataSize() to simplify getting the dataset's - data size in memory. (BMR - 2009/07/26) - - These member functions were added as wrapper for H5Rdereference to - replace the incorrect IdComponent::dereference(). - void H5Object::dereference(H5File& h5file, void* ref) - void H5Object::dereference(H5Object& obj, void* ref) - In addition, these constructors were added to create the associated - objects by way of dereference: - Attribute(H5Object& obj, void* ref); - Attribute(H5File& file, void* ref); - DataSet(H5Object& obj, void* ref); - DataSet(H5File& file, void* ref); - DataType(H5Object& obj, void* ref); - DataType(H5File& file, void* ref); - Group(H5Object& obj, void* ref); - Group(H5File& obj, void* ref); - (BMR - 2008/08/10) - - Tools: ------ - - h5repack: Added ability to use plugin filters. HDFFV-8345 (ADB - 2013/09/04). - - h5dump: Added option -N --any_path, which searches the file for paths that - match the search path. HDFFV-7989 (ADB - 2013/08/12). - - h5dump: Added optional arg 0 to -A, which excludes attributes from display. - HDFFV-8134 (ADB - 2013/08/01). - - h5dump: Fixed displaying compression ratio for unknown or user-defined - filters. HDFFV-8344 (XCAO 2013/03/19) - - h5dump: Changed UNKNOWN_FILTER to USER_DEFINED_FILTER for user defined filter. - HDFFV-8346 (XCAO 2013/03/19) - - h5dump: Added capability for "-a" option to show attributes containing "/" - by using an escape character. For example, for a dataset "/dset" - containing attribute "speed(m/h)", use "h5dump -a "/dset/speed(\/h)" - to show the content of the attribute. See details at HDFFV-7523 - (PC -- 2012/03/12) - - h5dump: Added ability to apply command options across multiple files using a - wildcard in the filename. Example; "h5dump -H -d Dataset1 tarr*.h5". - HDFFV-7876 (ADB - 2012/03/12). - - h5repack: Improved performance for big chunked datasets (size > 128MB) - when used with layout (-l) or compression (-f) option. - It would perform much better prior to the improvement, - especially for cases that chunk dimentions looks like - "1024x5x1" (compare to "1x5x1024"). When bigger numbers - are toward front and smaller number is toward back in chunk - dimentions. HDFFV-7862 (JKM - 2012/03/01) - - h5dump: Added new option --no-compact-subset. This option will not - interpret the '[' character as starting the compact form of - subsetting. This is useful when the "h5dump error: unable to - open dataset "datset_name"" message is output because a dataset - name contains a '[' character. HDFFV-7689 (ADB - 2012/01/31) - - h5dump: Corrected schema location: - - (ADB - 2011/08/10) - - h5diff: Added new level for -v (verbose) option. The new levels are - 1 and 2. So -v1 and -v2 can be specified to view more - information about attributes differences. - Bug#2121 (JKM 2011/3/23) - - h5dump: Added new option --enable-error-stack. This option will display - error stack information in the output stream. This is useful - when the "h5dump: Unable to print data" message is output. - (ADB - 2011/02/24) - - h5diff: Add a new flag --exclude-path. Specified path to an object will - be excluded from comparing the two files or two groups. If group - is specified all the member objects will be excluded. - (JKM - 2010/09/16). - - h5ls: Add new flag --no-dangling-links. (refer to --help for details) - (JKM - 2010/06/15) - - h5ls: Add new flag --follow-symlinks. (refer to --help for details) - (JKM - 2010/05/25) - - h5diff: Add new flag --no-dangling-links. (refer to --help for details) - (JKM - 2010/02/10) - - h5diff: Add new flag --follow-symlinks. (refer to --help for details) - (JKM - 2010/01/25) - - h5diff: fix for displaying garbage value on LE machine for BE data. - (JKM - 2009/11/20) - - h5dump: subsetting now allows default for count. Also trailing ; in short form - can be omitted after last specified value. - (ADB - 2009/09/04) - - h5dump/h5ls: now can display data in region references - using new -R, --region flag. - (ADB - 2009/09/04) - - h5diff: new flag, -c, --compare, list objects that are not comparable. - (PVN - 2009/4/10 - 1368) - - h5diff new flag, -N, --nan, avoids NaNs detection. (PVN - 2009/4/10) - - h5dump correctly specifies XML dtd / schema urls (ADB - 2009/4/3 - 1519) - - h5repack now handles group creation order. (PVN - 2009/4/2 - 1402) - - h5dump: added a printing of the compression ratio of uncompressed and compressed - sizes for cases where compression filters are present. (PVN - 2008/05/01) - - h5dump: added an option to allow a user defined formatting string for printf - regarding floating point numbers. (PVN - 2008/05/06) - - h5dump: support for external links, display the object that the external link - points to. (PVN - 2008/05/12) - - h5repack: add a userblock to an HDF5 file during the repack. (PVN - 2008/08/26) - - h5repack: add 2 options that call H5Pset_alignment in the repacked file. (PVN - 2008/08/29) - - h5ls: added capability to traverse through external links when the -r - (recursive) flag is given. (NAF - 2008/09/16) - - h5ls: added -E option to enable traversal of external links. h5ls will - not traverse external links without this flag being set. - (NAF - 2008/10/06) - - h5diff: added support for long double (PVN - 2008/10/28) - - h5dump: binary output defaults to NATIVE with -b optionally accepting - the form of binary output (NATIVE, FILE, BE, LE). (PVN - 2008/10/30) - - h5diff: return 1 for file differences when both file graphs differ by any object. - Error return code was changed to 2 from -1. (PVN - 2008/10/30) - - h5import: TEXTFPE (scientific format) was deprecated. Use TEXTFP - instead (PVN - 2008/10/30) - - h5repack: When user doesn't specify a chunk size, h5repack now defines a default - chunk size as the same size of the size of the hyperslab used to read the chunks. - The size of the hyperslabs are defined as the size of each dimension or a - predefined constant, whatever is smaller. This assures that the chunk - read fits in the chunk cache. (PVN - 2008/11/21) - - h5diff: h5diff treats two INFINITY values different. Fixed by checking (value==expect) - before call ABS(...) at h5diff_array.c This will make that (INF==INF) is true - (INF is treated as an number instead of NaN) (PC -- 2009/07/28) - - h5diff: add option "--use-system-epsilon" to print difference if (|a-b| > EPSILON) - Change default to use strict equality (PC -- 2009/09/12) - - + + High-Level APIs: ------ - - Table: In version 3.0 of Table, "NROWS" (used to store number of records) was - deprecated (PVN - 2008/11/24) - - - Added Fortran wrappers for Dimension Scale APIs. HDFFV-3797 - h5dsset_scale_f - h5dsattach_scale_f - h5dsdetach_scale_f - h5dsis_attached_f - h5dsis_scale_f - h5dsset_label_f - h5dsget_label_f - h5dsget_scale_name_f - h5dsget_num_scales_f - (EIP for SB - 2011/10/13) - - - New API: h5ltpath_valid (Fortran: h5ltpath_valid_f) which checks - if a path is correct and determines if a link resolves to a valid - object and checks that the link does not dangle. (MSB- 2012/3/15) - - - A new API function H5DOwrite_chunk. It writes a data chunk directly - into a file bypassing hyperslab selection, data conversion, and - filter pipeline. The user must be careful with the function and - clearly understand the I/O process of the library. - (SLU - 2013/2/11) - - Documentation - ------------- + + Documentation + ------------- Support for new platforms, languages and compilers. ======================================= - - Intel V11.1 uses now -O3 optimization in production mode (EIP - 2010/10/08) - - PathScale compilers are recognized and can build the HDF5 library - properly. AKC - 2009/7/28 - - - SunOS 5.11 (emu) 32-bit and 64-bit with Sun C/C++ 5.12 compiler and - Sun Fortran 95 8.6 compiler. (SLU - 2013/04/15) Bug Fixes since HDF5-1.8.0 release ================================== Library ------- - - Incorrect usage of list in CMake COMPILE_DEFINITIONS set_property - - The CMake command, set_property with COMPILE_DEFINITIONS property - needs a quoted semi-colon separated list of values. CMake will - transform the list to a series of -D{value} for the compile. - - (ADB - 2014/12/09, HDFV-9041) - - - H5Z.c: H5Zfilter_avail(H5Z_filter_t id) - Added else block if the call to the internal H5Z_filter_avail(id) does not - fail and returns FALSE. This block calls the H5PL_load(H5PL_TYPE_FILTER, (int)id) - function to attempt to dynamically load the filter plugin. - (ADB - 2014/03/03 HDFFV-8629) - - Added const qualifier to source buffer parameters in H5Dgather and - H5D_scatter_func_t (H5Dscatter callback). (NAF - 2013/7/02) - - Fixed an error involving failure to write fill values to the user's - buffer when reading unallocated chunks from datasets that have a - fill value set to H5D_FILL_VALUE_DEFAULT. A consequence of this - was the reporting of spurious data values in h5dump and h5diff - output. - (HDFFV-8247; JP - 2013/05/03) - - Fixed an error that could occur when calling H5Ocopy within an - H5Literate callback (and possibly other situations). - (NAF - 2012/7/25 - HDFFV-5853) - - Fixed an error that would occur when copying an object with attribute - creation order tracked and indexed. (NAF - 2012/3/28 - HDFFV-7762) - - Fixed a bug in H5Ocopy(): When copying an opened object, call the - object's flush class action to ensure that cached data is flushed - so that H5Ocopy will get the correct data. - (VC - 2012/3/27 - HDFFV-7853) - - When an application tries to write or read many small data chunks and - runs out of memory, the library had a seg fault. The fix is to - return the error stack with proper information. (SLU - 2012/3/23. - Issue 7785) - - H5Pset_data_transform had seg fault in some cases like x*-100. It - works correctly now and handles other cases like 100-x or 2/x. - (SLU - 2012/3/15. Issue 7922) - - Fixed rare corruption bugs that could occur when using the new object - header format. (NAF - 2012/3/15 - HDFFV-7879) - - Creating a dataset in a read-only file caused seg fault when the file - is closed. It's fixed. The attemp to create a dataset will fail - with the error stack indicating the file is read-only. (SLU - - 2012/1/25. Issue 7756) - - Fixed a seg fault that could occur when shrinking a dataset with chunks - larger than 1 MB. (NAF - 2011/11/30 - HDFFV-7833) - - Fixed a bug that could cause file corruption when copying named - datatypes to a file using shared messages. (NAF - 2011/11/14) - - Fixed a bug that could cause H5Oget_info to return the wrong address - after copying a named datatype. (NAF - 2011/11/14) - - The library allowed the conversion of strings between ASCII and UTF8 - (Issue 7582). We have corrected it to report an error under this - situation. (SLU - 2011/11/8) - - The library had seg fault when it tried to shrink the size of compound type - through H5Tset_size immediately after the type was created (Issue - 7618). It's fixed now. (SLU - 2011/10/26) - - Fixed a bug that occurred when using H5Ocopy on a committed datatype - containing an attribute using that committed datatype. - (NAF - 2011/10/13 - Issue 5854) - - #ifdef _WIN32 instances changed to #ifdef H5_HAVE_WIN32_API and added - H5_HAVE_VISUAL_STUDIO checks where necessary. CMake only as configure - never set _WIN32. - - CLANG compiler with the options -fcatch-undefined-behavior and -ftrapv - discovered 3 problems in tests and tools' library (Issue 7674): - 1. In dsets.c, left shifting an unsigned int for 32 bits or more - caused undefined behavior. - 2. In dt_arith.c, the INIT_INTEGER macro definition has an overflow - when the value is negative minimal and is being subtracted one. - 3. In tools/lib/h5tools_str.c, right shifting an int value for 32 bits - or more caused undefined behavior. - All the problems have been corrected. (SLU - 2011/9/2) - - In v1.6 library, there was EOA for the whole MULTI file saved in the - super block. We took it out in v1.8 library because it's meaningless - for the MULTI file. v1.8 library saves the EOA for the metadata file, - instead. But this caused some backward compatibility problem. - v1.8 library couldn't open the file created with v1.6 library. We - fixed the problem by checking the EOA value to detect the file - created with v1.6 library. (SLU - 2011/6/22) - - When a dataset had filters and reading data failed, the error message - didn't say which filter isn't registered. It's fixed now. - (SLU - 2011/6/3) - - The datatype handler created with H5Tencode/decode used to have the - reference count 0 (zero). I have fixed it. It is 1 (one) now. - (SLU - 2011/2/18) - - Fixed a bug that caused big endian machines to generate corrupt files - when using the scale-offset filter with floating point data or - fill values. Note that such datasets will no longer be readable - by any machine after this patch. (NAF - 2010/02/02 - Bug 2131) - - Retrieving a link's name by index in the case where the link is - external and the file that the link refers to doesn't exist will - now fail gracefully rather than cause a segmentation fault. - (MAM - 2010/11/17) - - Modified library to always cache symbol table information. Libraries - version 1.6.3 have a bug which causes them to require this - information for some operations. (NAF - 2010/09/21 - 1864) - - Fixed a bug that could occur when getting information for a new-style - group that was previously opened through a file handle that was - later closed. (NAF - 2010/09/15) - - Added define check in H5public.h if stdint.h is supported by the C++ - compiler. This define is only available on Windows with VS2010 and - using CMake to build the library. (ADB - 2010/09/13 - Bug 1938) - - H5Eset_current_stack now also closes the error stack to be set as the - default. This is to avoid a potential problem (Bug 1799). - (SLU - 2010/9/7) - - Fixed the bug in the filter's public CAN_APPLY function. The return - value should be htri_t not herr_t (Bug #1239). (SLU - 2010/8/5) - - Fixed a bug in the direct I/O driver that could render files with - certain kinds of unaligned data unreadable or corrupt them. - (NAF - 2010/07/28) - - valgrind reported an error of copying data to itself when a new attribute - is written (Bug #1956). I fixed it by taking out the memcpy step in - the attribute code. (SLU - 2010/07/28) - - Fixed a bug that could cause file corruption when using non-default - sizes of addresses and/or lengths. This bug could also cause - uncorrupted files with this property to be unreadable. This bug - was introduced in 1.8.5. (NAF - 2010/07/16 - 1951) - - Fixed a file corruption bug that could happen when shrinking a - compressed dataset. (NAF - 2010/05/20) - - Fixed some memory leaks in VL datatype conversion when strings are - used as fill values. (MAM - 2010/05/12 - BZ# 1826) - - Fixed a bug when copying objects with NULL references with the - H5O_COPY_EXPAND_REFERENCE_FLAG flag set. (NAF - 2010/04/08 - 1815) - - Files can now be concurrently opened more than once using the core file - driver, as long as the backing store is used. (NAF - 2010/03/09) - - Added support for H5O_COPY_EXPAND_EXT_LINK_FLAG to H5Ocopy. External - links will now be expanded if this flag is set. - (NAF - 2010/03/05 - 1733) - - Fixed a bug where the library, when traversing an external link, would - reopen the source file if nothing else worked. (NAF - 2010/03/05) - - Fixed an intermittent bug in the b-tree code which could be triggered - by expanding and shrinking chunked datasets in certain ways. - (NAF - 2010/02/16) - - H5Tdetect_class said a VL string is a string type. But when it's - in a compound type, it said it's a VL type (Bug #1584). I fixed it - to be consistent. It always return string type. (SLU - 2009/12/10) - - Fixed a bug where writing and deleting many global heap objects (i.e. - variable length data) would render the file unreadable. Previously - created files exhibiting this problem should now be readable. - (NAF - 2009/10/27 - 1483) - - Fixed incorrect return value for H5Pget_preserve. (AKC - 2009/10/08 - 1628) - - Fixed an assertion failure that occurred when H5Ocopy was called on a - dataset using a vlen inside a compound. (NAF - 2009/10/02 - 1597) - - Fixed incorrect return value for H5Pget_filter_by_id1/2 in H5Ppublic.h. - (NAF - 2009/09/25 - 1620) - - Fixed a bug where properties weren't being compared with the registered - compare callback. (NAF - 2009/09/25 - 1555) - - Fixed a bug where H5Pget_fitler_by_id would succeed when called for a - filter that wasn't present. (NAF - 2009/06/25 - 1250) - - Fixed an issue with committed compound datatypes containing a vlen. - Also fixed memory leaks involving committed datatypes. - (NAF - 2009/06/10 - 1593) - - Added versioning to H5Z_class_t struct to allow compatibility with 1.6 - API. (NAF - 2009/04/20 - 1533) - - Fixed a problem with using data transforms with non-native types in the - file. (NAF - 2009/04/20 - 1548) - - Added direct.h include file to windows section of H5private.h - to fix _getcwd() warning. (ADB - 2009/04/14 - 1536) - - Fixed a bug that prevented external links from working after calling - H5close(). (NAF - 2009/04/10 - 1539) - - Modified library to write cached symbol table information to the - superblock, to allow library versions 1.3.0 to 1.6.3 to read files - created by this version. (NAF - 2009/04/08 - 1423) - - Changed skip lists to use a deterministic algorithm. The library should - now never call rand() or srand(). (NAF - 2009/04/08 - 503) - - Fixed a bug where H5Lcopy and H5Lmove wouldn't create intermediate - groups when that property was set. (NAF - 2009/04/07 - 1526) - - Fixed a bug that caused files with a user block to grow by the size of - the user block every time they were opened. - (NAF - 2009/03/26 - 1499) - - Fixed a rare problem that could occur with files using the old (pre 1.4) - array datatype. (NAF - 2009/03/23) - - Modified library to be able to open files with corrupt root group symbol - table messages, and correct these errors if they are found. Such - files can only be successfully opened with write access. - (NAF - 2009/03/23 - 1189) - - Removed the long_long #define and replaced all instances with - "long long". This caused problems with third party products. All - currently supported compliers support the type. (ADB - 2009/03/05) - - Fixed various bugs that could prevent the fill value from being written - in certain rare cases. (NAF - 2009/02/26 - 1469) - - Fixed a bug that prevented more than one dataset chunk from being cached - at a time. (NAF - 2009/02/12 - 1015) - - Fixed an assertion failure caused by opening an attribute multiple times - through multiple file handles. (NAF - 2009/02/12 - 1420) - - Fixed a problem that could prevent the user from adding attributes (or - any object header message) in some circumstances. - (NAF - 2009/02/12 - 1427) - - Fixed a bug that could cause problems when an attribute was added to a - committed datatype using the committed datatype's datatype. - (NAF - 2009/02/12) - - Fixed a bug that could cause problems when copying an object with a - shared message in its own object header. (NAF - 2009/01/29) - - Changed H5Tset_order to properly reject H5T_ORDER_NONE for most - datatypes. (NAF - 2009/01/27 - 1443) - - Fixed a bug where H5Tpack wouldn't remove trailing space from an - otherwise packed compound type. (NAF - 2009/01/14) - - Fixed up some old v2 btree assertions that get run in debug mode that - were previously failing on compilation, and removed some of the - more heavily outdated and non-rewritable ones. (MAM - 2008/12/15) - - Fixed a bug that could cause problems when "automatically" unmounting - multiple files. (NAF - 2008/11/17) - - H5Ovisit and H5Ovisit_by_name will now properly terminate when the - callback function returns a positive value on the starting object. - (NAF - 2008/11/03) - - Fixed an error where a null message could be created that was larger - than could be written to the file. (NAF - 2008/10/23) - - Corrected error with family/split/multi VFD not updating driver info - when "latest" version of the file format used. (QAK - 2008/10/14) - - Corrected alignment+threshold errors to work correctly when metadata - aggregation is enabled. (QAK - 2008/10/06) - - Changed H5Fget_obj_count and H5Fget_obj_ids to ignore objects registered - by the library for internal library use. (NAF - 2008/10/06) - - Fixed potential memory leak during compound conversion. - (NAF - 2008/10/06) - - Changed the return value of H5Fget_obj_count from INT to SSIZE_T. Also - changed the return value of H5Fget_obj_ids from HERR_T to SSIZE_T and - the type of the parameter MAX_OBJS from INT to SIZE_T. (SLU - 2008/09/26) - - Fixed an issue that could cause data to be improperly overwritten - during compound type conversion. (NAF - 2008/09/19) - - Fixed pointer alignment violations that could occur during vlen - conversion. (NAF - 2008/09/16) - - Fixed problem where library could cause a segmentation fault when - an invalid location ID was given to H5Giterate(). (QAK - 2008/08/19) - - Fixed improper shutdown when objects have reference count > 1. The - library now tracks reference count due to the application separately - from that due to internal library routines. (NAF - 2008/08/19) - - Fixed assertion failure caused by incorrect array datatype version. - (NAF - 2008/08/08) - - Fixed an issue where mount point traversal would fail when using - multiple handles for the child. (NAF - 2008/08/07) - - Fixed an issue where mount points were inaccessible when using multiple - file handles for the parent. The mount table is now in the shared - file structure (the parent pointer is still in the top structure). - (NAF - 2008/08/07) - - when an attribute was opened twice and data was written with one of the handles, - the file didn't have the data. It happened because each handle had its own - object structure, and the empty one overwrote the data with fill value. This is - fixed by making some attribute information like the data be shared in the - attribute structure. SLU - 2008/07/22 - - Fixed issue where a group could have a file mounted on it twice. - (QAK - 2008/07/15) - - Fixed a Windows-specific issue in the ohdr test which was causing users - in some timezones to get false errors. This a deficiency in the Windows - mktime() function, and has been handled properly. SJW - 2008/06/19 - - Fixed the problem with the searching of target file for H5Lcreate_external(). - The searching pattern will depend on whether the target file's - pathname is an absolute or a relative path. Please see the description - in the RM for H5Lcreate_external(). (VC - 2008/04/08) - - Fixed possible file corruption bug when encoding datatype - descriptions for compound datatypes whose size was between - 256 & 511 bytes and the file was opened with the "use the - latest format" property enabled (with H5Pset_libver_bounds). - (QAK - 2008/03/13) - - Fixed bug in H5Aget_num_attrs() routine to handle invalid location - ID correctly. (QAK - 2008/03/11) - - H5Dset_extent: when shrinking dimensions, some chunks were not deleted. - (PVN - 2009/01/8) - - Added code to maintain a min_clean_fraction in the metadata cache when - in serial mode. (MAM - 2009/01/9) - - Configuration ------------- - - CMake: When CMake commands are executed individually on the command line - and the external filters are being built, the CMAKE_BUILD_TYPE define - must be set to the same value as the configuration - (-DCMAKE_BUILD_TYPE:STRING=Release if using -C Release). This is needed - by the the szip and zlib filter build commands. (ADB - HDFFV-8695) - - CMake: Remove use of XLATE_UTILITY program. (ADB - 2014/03/28 HDFFV-8640) - - CMake: Added missing quotes in setting the CMAKE_EXE_LINKER_FLAGS for the - MPI option. (ADB - 2014/02/27 HDFFV-8674) - - Modified H5detect.c to scan floating point types for padding bits before - analyzing the type further. This should fix problems with gcc 4.8 - (NAF - 2013/09/19 - HDFFV-8523/HDFFV-8500) - - Fixed Makefile issue in which "-Wl," was not properly specified - prior to -rpath when building parallel fortran libraries with - an Intel compiler. (MAM - 2012/03/26) - - Makefiles generated by other packages using h5cc as the compiler - no longer error when 'make' is invoked more than once in order - to 'rebuild' after changes to source. (MAM - 2012/03/26) - - Added --enable-fortran2003 flag to enable Fortran2003 support - in the HDF5 Fortran library. The flag should be used along with the - --enable-fortran flag and takes affect only when Fortran compiler - is Fortran2003 compliant. (EIP - 2011/11/14) - - - In Windows platform, the default VFD, was Windows VFD, is restored back - to the SEC2, aka POSIX, VFD. The Windows VFD is deprecated. HDFFV-7740 - (AKC 2011/09/26) - - Removed config/ibm-aix6.x. All IBM-AIX settings are in one file, - ibm-aix. (AKC - 2011/4/14) - - Shared C libraries are no longer disabled on Mac when Fortran - is enabled. Shared Fortran libraries are still not supported on Mac, - so configure will disable them by default, but this is overridable - with the new --enable-unsupported configure option. The configure - summary has been updated to reflect the fact that the shared-ness of - the C++/Fortran wrapper libraries may not align with the C library. - (MAM - 04/11/2011 - HDFFV-4353). - - Removed recognition of the parallel compilers of LAM(hcc) and - ChMPIon(cmpicc) since we have no access to these two MPI implementations - and cannot verify their correctness. (AKC - 2010/7/14 - Bug 1921) - - Removed the following config files, as we no longer support them: - config/dec-osf*, config/hpux11.00, config/irix5.x, - config/powerpc-ibm-aix4.x config/rs6000-ibm-aix5.x config/unicos* - MAM - 2009/10/08 - - Modified configure and make process to properly preserve user's CFLAGS - (and company) environment variables. Build will now properly use - automake's AM_CFLAGS for any compiler flags set by the configure - process. Configure will no longer modify CFLAGS directly, nor will - setting CFLAGS during make completely replace what configure has set up. - MAM - 2009/10/08 - - Support for TFLOPS, config/intel-osf1, is removed since the TFLOPS - machine has long retired. AKC - 2009/10/06. - - Added $(EXEEXT) extension to H5detect when it's executed in the - src/Makfile to generate H5Tinit.c so it works correctly on platforms - that require the full extension when running executables. - MAM - 2009/10/01 - BZ #1613 - - Configure will now set FC and CXX to "no" when fortran and c++ - are not being compiled, respectively, so configure will not run - some of the compiler tests for these languages when they are not - being used. MAM - 2009/10/01 - - The PathScale compiler (v3.2) was mistaken as gcc v4.2.0 but it fails to - recognize some gcc options. Fixed. (see bug 1301). AKC - 2009/7/28 - - - The --enable-static-exec flag will now properly place the -static flag - on the link line of all installed executables. This will force the - executable to link with static libraries over shared libraries, provided - the static libraries are available. MAM - 2009/08/31 - BZ #1583 - - The --includedir=DIR configuration option now works as intended, and can - be used to specify the location to install C header files. The default - location remains unchanged, residing at ${prefix}/include. - MAM - 2009/03/10 - BZ #1381 - - Configure no longer removes the '-g' flag from CFLAGS when in production - mode if it has been explicitly set in the CFLAGS environment variable - prior to configuration. MAM - 2009/03/09 - BZ #1401. - - Fixed error with 'make check install' failing due to h5dump - needing other tools built first. MAM - 2008/10/24. - - Wpen using shared szip, it is no longer necessary to specify - the path to the shared szip libraries in LD_LIBRARY_PATH. MAM - - 2008/10/24. - - The file libhdf5_fortran.settings is not installed since its content - is included in libhdf5.settings now. AKC - 2008/10/21 - - "make DESTDIR=xxx install" failed to install some tools and files - (e.g., h5cc and fortran modules). Fixed. AKC - 2008/10/8. - - Autotools: An export of LD_LIBRARY_PATH= was - removed from configure and make installcheck was revised to run - scripts installed in share/hdf5_examples to use the installed h5cc, etc. - to compile and run example source files also installed there. Make - installcheck will now fail when a shared szip or other external lib file - cannot be found in the same manner that executables compiled and linked - with h5cc will fail to run when those lib files cannot be found after - install. Make installcheck should pass after setting LD_LIBRARY_PATH to the - szip location. - (LRK - 2014/04/16) Performance ------------- - - Removed program perform/benchpar from the enable-build-all list. The - program will be retired or moved to another location. HDFFV-8156 - (AKC 2012/10/01) - - Retired program perform/mpi-perf. Its purpose has been incorporated - into h5perf before. (AKC 2012/09/20) - - ifdefs added to tests around include unistd.h and function to simulate - getlogin() on Windows. - (ADB - 2011/08/15) - - perf_serial test added to Windows projects and check batch file. - (ADB - 2009/06/11) + Fortran -------- - - Fixed a typo in return value of the nh5dread_f_c function ( was 1 - instead of 0 on success); fixed the return value to make it consistent - with other Fortran functions; cleaned the code from debug statements. - (EIP - 2012/06/23) - - - Fixed problem writing/reading control characters to a dataset; writing - a string containing: alerts, backspace, carriage_return, form_feed, - horizontal_tab, vertical_tab, new_line is now tested and working. - (MSB - 2012/09/01) - - - Corrected the integer type of H5S_UNLIMITED_F to HSIZE_T (MSB - 2012/09/01) - - - Corrected the number of continuation lines in the src files - to be less then 32 lines for F95 compliance. (MSB - 2012/10/01) Tools ----- - - h5repack: h5repack would not attempt to remove UD filters. Added a - check to h5repack for UD filters that checks if the filter can - be dynamically loaded. This will require a change in the library to - add the H5PL_load() to the H5Zfilter_avail(). (ADB - 2014/03/03 HDFFV-8629) - - h5repack: Fixed failure for converting a layout of small chunked dataset - (size < 1K) to contiguous layout. HDFFV-8214 (JKM 2013/03/18) - - h5diff: Fixed to return correct exit code 1 when detect unique extra - attribute. Prior to this fix, h5diff returned exit code 0 indicating - two files are identical. HDFFV-7643 (JKM 2013/02/15) - - h5diff: Improved speed when comparing HDF5 files with lots of - attributes. Much slower performance was identified with release - version from 1.8.7 to 1.8.10 compared to 1.8.6. (JKM 2012/10/19) - - h5repack: "h5repack -f NONE file1.h5 out.h5" command failed if - source file contains chunked dataset and a chunk dim is bigger than - the dataset dim. Another issue is that the command changed max dims - if chunk dim is smaller than the dataset dim. - These issue occurred when dataset size is smaller than 64k (compact - size limit) Fixed both. - HDFFV-8012 (JKM 2012/09/24) - - h5diff: Fixed not to accumulate attribute difference to dataset - difference in verbose mode (-v, -r), which caused incorrect - difference between dataset and group/datatype object if attribute - exist with any differences. This also lead to fix inconsistent - format indicating difference between dataset and group/datatype - object. HDFFV-5919 (JKM 2012/09/05) - - h5diff: Fixed the incorrect result when comparing attribute data - values and the data type has same class but different size. - HDFFV-7942 (JKM 2012/08/15) - - ph5diff: Fixed intermittent hang issue on a certain operation in - parallel mode. It was detected by daily test for comparing - non-comparable objects, but it could have occurred in other - operations depend on machine condition. HDFFV-8003 (JKM 2012/08/01) - - h5diff: Fixed test failure for "make check" due to failure of - copying test files when performed in HDF5 source tree. Also applied - to other tools. - HDFFV-8107 (JKM 2012/08/01) - - h5diff: Fixed the Function COPY_TESTFILES_TO_TESTDIR() of - testh5diff.sh to better report when there is an error in the file - copying. HDFFV-8105 (AKC -2012/07/22) - - h5diff: Fixed not to check and display dangling link status without - --follow-symlinks option. This also improved performance when - comparing lots of external links without the --follow-symlinks - option. HDFFV-7998 (JKM 2012/04/26) - - h5unjam: Fixed sefgault when used -V (show version) option. - HDFFV-8001 (JKM 2012/04/19) - - h5repack: Fixed a failure when change the chunk size of a specified - chunked dataset with unlimited max dims. HDFFV-7993 (JKM 2012/04/11) - - h5diff: Fixed failure for comparing same named object with different - object types in comparing groups. Prior to the fix, h5diff resulted - in error. After the fix, h5diff detects such case as non-comparable - and display messages accordingly. HDFFV-7664 (JKM 2012/03/28) - - h5diff: If unique objects exists only in one file and try to exclude - the unique objects with --exclude-path option, h5diff missed - excluding some objects. - Fixed to exclude objects correctly in such case. - HDFFV-7837 (JKM 2012/03/20) - - h5dump: Added tools library error stack to properly catch error - information generated within the library. - HDFFV-7958 (ADB 2012/03/12) - - h5dump: Dangling links no longer throw error message, change process - when open link fails. - HDFFV-7839 (ADB 2012/03/12) - - h5diff: When two symbolic dangling links are compared with - --follow-symlinks option, the result should be same. It worked for - comparing two files, but didn't work for comparing two objects. - HDFFV-7835 (JKM 2012/03/09) - - h5dump: Refactored code to remove duplicated functions. Split XML - functions from DDL functions. Corrected indentation and formatting - errors. Also fixed subsetting counting overflow (HDFFV-5874). Verified - all tools call tools_init() in main. - HDFFV-7560 (ADB 2012/02/17) - - h5diff: fixed to prevent from displaying error stack message when - comparing the two dangling symlinks with follow-symlinks option. - HDFFV-7836 (JKM 2012/01/13) - - h5repack: fixed memory leak for handling variable length string in - attribute. HDFFV-7840 (JKM 2012/01/06) - - h5ls: fixed segfault when access region reference data in an - attribute. HDFFV-7838 (JKM 2011/12/29) - - h5diff: fixed segfault over non-comparable attribute with different - dimention or rank, along with '-c' option to display details. - HDFFV-7770 (JKM 2011/10/24) - - Fixed h5diff to display all the comparable object and attribute - regardless of non-comparables. HDFFV-7693 (JKM 2011/09/16) - - Fixed h5repack to update values of references(object and region) of - attributes in h5repack for 1) references, 2) ARRAY of references, - 3) VLEN of references, and 4) COMPOUND of references. - (JIRA HDF5 5932) PC -2011/09/14 - - h5diff: fixed segfault over dataset with container types - (array,lven) with multiple nested compound types. - (ex: compound->array->compound, compound->vlen->compound) - HDFFV-7712 JKM (2011/09/01) - - h5repack: added macro to handle failure in H5Dread/write when memory - allocation failed inside the library. (PC -- 2011/08/19) - - Fixed h5jam not to allow specifying an HDF5 formatted file as input - file for -u (user block file) option, because the original HDF5 file - will not be accessible if allows. HDFFV-5941 (JKM 2011/08/15) - - Revised command help pages of h5jam and h5unjam. The descriptions - were not up to date and some were missing. - HDFFV-7515 (JKM 2011/08/15) - - h5repack: h5repack failed to copy dataset if the layout is changed - from chunked with unlimited dims to contiguous. HDFFV-7649 - (PC -- 2011/07/15) - - h5diff: "--delta" option considers two NaN of the same type are - different, which is wrong based on h5diff description in Reference - Manual. HDFFV-7656 (PC -- 2011/07/15) - - Fixed h5diff to display instructive error message and exit with 1 - when mutually exclusive options (-d, -p and --use-system-epsilon) - are used together. HDFFV-7600 (JKM 2011/07/07) - - Fixed h5dump to display the first line of each element into correct - position for multiple dimention array type. - Before this fix, the first line of each element in array were - displayed after the last line of previous element without - moving to the next line (+indentation). - Bug #HDFFV-5878 (JKM 2011/06/15) - - Fixed h5dump to display correct value for H5T_STD_I8LE dataset - on a system (ppc64, linux, Big-Endian, clustering). - Bug #HDFFV-7594 (ABERT & JKM 2011/05/12) - - Fixed h5diff to compare file itself correctly. Previously h5diff - reported either different or not compatible in certain cases even - comparing file itself. This fix also improve performance when - comparing same target objects through verifying the obj&file - addresses before comparing the details in the objects (ex: datasets - or attributes) Bug #HDFFV-5928 (XCAO & JKM 2011/05/06) - - Updated h5dump test case script to prevent entire test failure upon - source directory is read-only. Bug# HDFFV-4342 (JKM 2011/4/12) - - Fixed h5dump displaying incorrect values for H5T_STD_I8BE type data in - attribute on Big-Endian machine. H5T_STD_I8BE is unsigned 8bit type, - so h5dump is supposed to display -2 instead of 254. It worked - correctly on Little-Endian system , but not on Big-Endian system. - Bug #HDFFV-4358 (JKM 2011/04/08) - - Updated to unify option name to '--enable-error-stack' for printing - HDF5 error stack messages for HDF5 tools. h5ls and h5dump for now. - For h5ls, this replaces "-e/--errors" option, which is deprecated. - Bug#2182 (JKM 2011/3/30) - - Fix h5diff for --use-system-epsilon option: the calculation changed - from ( |a - b| / b ) to ( |a - b| ). This was decided for better - performance. Bug#2184 (JKM 2011/3/24) - - Fixed output for H5T_REFERENCE in h5dump. According to the BNF document - the output of a H5T_REFERENCE should be followed by the type; - ::= H5T_REFERENCE { } - ::= H5T_STD_REF_OBJECT | H5T_STD_REF_DSETREG - Previously this was only displayed if the -R option was used. - Bug#1725 (ADB 2011/3/28) - - Fix h5diff issues for #1: h5diff compared attributes correctly only - when two objects have the same number of attributes and attribute - names are identical, #2: didn't display useful information about - attribute difference. Bug#2121 (JKM 2011/3/17) - - Fixed memory leak for h5diff when accessing symbolic links with - --follow-symlink option. Bug#2214 (JKM 2011/3/18) - - Fixed memory leak for h5diff when access variable length string - data. Bug#2216 (JKM 2011/3/18) - - Fixed and improved help page for -a option of h5ls. - Bug#1904 (JKM 2011/3/11) - - Fixed h5dump not to include attribute values in the output file when - h5dump "-y -o output_file" options were used. The problem was introduced - in HDF5 1.8.6 by showing data pointed by region references. (XCAO 2011/3/9) - - Fixed h5copy to be able to copy any object into the same HDF5 file. - Previously h5copy displayed error message when target file is same - as source file. (XCAO 2011/3/8) - - Fixed h5dump for skipping some values for long array type dataset on - Windows. This issue only occurred on Windows due to the different - return behavior from _vsnprintf() funtion. Bug#2161 (JKM 2011/3/3) - - Fixed h5dump for skipping array indices every certain number - when the array type dataset is relatively big. The certain number - varies according to the size of array. Bug#2092 (JKM 2011/2/15). - - Fixed h5diff for the segfault when compares compound datasets - with combination of fixed length string types and vlen string types - in certain orders. bug#2089 (JKM 2010/12/28) - - Improve h5diff performance. 1) use HDmemcmp() before comparing each - elements. 2) replace expensive H5Tequals() calls 3) retrieve datatype - information at dataset level not each element level for compound - datasets - - Fixed h5ls to display nested compound type with curly bracket - when -S (--simple) option is used with -l (--label), so it shows - which member (in curly bracket) belong to which nested compound type - and make the output make sense. bug#1979 (JKM 2010/11/09) - - Fixed h5diff to handle variable-length strings in a compound dataset - correctly. (also variable-length string array in a compound dataset) - Garbage values were displayed when h5diff compared multiple - variable-length strings in a compound type dataset. - Bug#1989 (JKM 2010/10/28) - - Fixed h5copy to fail gracefully when copying object to non-exist - group without -p option. Bug#2040 (JKM 2010/10/18) - - Fixed to compare member objects and groups recursively when two - files or groups are specified to be compared. Bug#1975 - (JKM 2010/9/16) - - Make h5repack be able to convert a layout to COMPACT for small size - dataset as default. bug#1896 (JKM 2010/09/15) - - Change h5ls not to manipulate special characters in object name or - attribute name for smart display. bug#1784 (JKM 2010/06/28) - - Fixed h5ls to return exit code 1 (error) when non-existent file is - specified. bug#1793. (JKM 2010/04/27) - - h5copy failed to copy dangling link when the link is specified - directly. bug#1817. (JKM 2010/04/22) - - h5repack lost attributes from a dataset of reference type. bug#1726. - (JKM 2010/3/25) - - h5repack sets NULL for object reference value for group or - named datatype. bug#1814. (JKM 2010/03/19) - - h5diff: fixed incorrect behavior (hang) in parallel mode when - specify invalid options (ex: -v and -q) (JKM 2010/02/17) - - h5dump/h5ls display buffer resize fixed in tools library. - (ADB - 2009/07/21 - 1520) - - Fixed many problems that could occur when using h5repack with named - datatypes. (NAF - 2009/4/20 - 1516/1466) - - h5dump, h5diff, h5repack were not reading (by hyperslabs) datasets - that have a datatype datum size greater than H5TOOLS_BUFSIZE, a - constant defined as 1024Kb, such as array types with large - dimensions (PVN - 2009/4/1 - 1501) - - h5import: By selecting a compression type, a big endian byte order was being - selected (PVN - 2009/3/11 - 1462) - - zip_perf.c had missing argument on one of the open() calls. Fixed. - (AKC - 2008/12/9) - - h5dump now checks for uniqueness of committed datatypes. - (NAF - 2008/10/15) - - Fixed unnecessary indentation of committed datatypes in h5dump. - (NAF - 2008/10/15) - - Fixed bugs in h5stat:segmemtation fault when printing groups and - print warning message when traversal of objects is unsuccessful. - (see bug #1253) (VC- 2008/10/13) - - Fixed bug in h5ls that prevented relative group listings (like - "h5ls foo.h5/bar") from working correctly (QAK - 2008/06/03) - - Fixed bug in h5diff that prevented datasets & attributes with - variable-length string elements from comparing correctly. - (QAK - 2008/02/28) - - h5import bug on Windows w/binary datasets. fread in windows needs a - binary file to be open with 'rb' instead of 'r' otherwise it - terminates execution if an end of file character is found on the - input file. Besides that the binary file generated needs to be open - with 'wb' , otherwise an end of line character is read twice. - (PVN - 2008/02/19) - - Fixed bug in h5dump that caused binary output to be made only for the first - dataset, when several datasets were requested. (PVN - 2008/04/07) - - h5dump: when doing binary output (-b), the stdout printing of attributes - was done incorrectly. Removed printing of attributes when doing binary - output. PVN - 2008/06/05 - High-Level APIs: ------ - - Fixed problem with H5DSget_scale_name including the NULL terminator in - the size calculation returned by the function. The API does not - include the NULL terminator in the size returned (MSB- 2013/2/10) - - - Fixed problem with H5TBdelete_record destroying all data following the deletion - of a row. (MSB- 2012/7/26) - - - Fixed H5LTget_attribute_string not closing an object identifier when an - error occurs. (MSB- 2012/7/21) - - - Fixed the H5LTdtype_to_text function. It had some memory problems when - dealing with some complicated data types. HDFFVI-7701 (SLU - 2011/10/19) - - - Fixed a bug in H5DSattach_scale, H5DSis_attached and H5DSdetach_scale - caused by using H5Tget_native_type function to determine the native - type for reading REFERENCE_LIST attribute. The bug was exposed - on Mac PPC. - (EIP - 2010/05/22 -1851) - - Fixed a bug in the H5DSdetach_scale function when 0 bytes - were allocated after the last reference to a dim. scale - was removed from the list of references in a VL element of the - DIMENSION_LIST attribute; modified the function to comply - with the Spec: DIMENSION_LIST attribute is deleted now when no - dimension scales left attached. - (EIP - 2010/05/14 -1822) - - Fixed a bug where the H5TB API would forget the order of fields when - added out of offset order. (NAF - 2009/10/27 - 1582) - - H5DSis_attached failed to account for different platform types. Added a - get native type call. (ADB - 2009/9/29 - 1562) - - Dimension scales: The scale index return value in H5DSiterate_scales was not always - incremented. (PVN - 2009/4/8 - 1538) Fortran High-Level APIs: ------ - - Lite: The h5ltget_attribute_string_f used to return the C NULL character in the - returned character buffer. The returned Fortran charactor buffer now does - not return the C NULL character. (MSB - 2012/3/23) - - Lite: The h5ltget_dataset_info_f function (gets information about a dataset) - was not correctly returning the dimension array. (PVN - 2009/3/23) - - Lite: the h5ltread_dataset_string_f and h5ltget_attribute_string_f functions - had memory problems with the g95 fortran compiler. (PVN � 5/13/2009) 1522 - - - - - - Documentation - ------------- - + Documentation + ------------- F90 APIs -------- - - Modified the h5open_f and h5close_f subroutines to not to call H5open - and H5close correspodningly. While the H5open call just adds overhead, - the H5close call called by an Fortran application shuts down the HDF5 - library making it unaccessible to the application. - HDFFV-915 (EIP & SB - 2011/10/13) - C++ APIs -------- - - The constructor PropList::PropList(id) was fixed to act properly - according to the nature of 'id'. When 'id' is a property class id, - a new property list will be created. When 'id' id a property list id, - a copy of the property list will be made. (BMR - 2010/5/9) - - The parameters 'size' and 'bufsize' in CommonFG::getLinkval and - CommonFG::getComment, respectively, now have default values for - user's convenience. (BMR - 2009/10/23) - - NULL pointer accessing was fixed, bugzilla 1061. (BMR - 2009/10/05) - - read/write methods of DataSet and Attribute classes were fixed - to handle string correctly. (BMR - 2009/07/26) - - Fixed bug that caused segfaults in Attribute::read. (BMR - 2008/04/20) - - Fixed bug in PropList::getClassName to use portable HDfree instead - of free. (BMR - 2008/04/20) - - Fixed a design bug which allowed an Attribute object to create/modify - attributes (bugzilla #1068). The API class hierarchy was revised - to address the problem. Classes AbstractDS and Attribute are moved - out of H5Object. Class Attribute now multiply inherits from - IdComponent and AbstractDs and class DataSet from H5Object and - AbstractDs. In addition, the data member IdComponent::id was - moved into subclasses: Attribute, DataSet, DataSpace, DataType, - H5File, Group, and PropList. (BMR - 2008/08/10) - - IdComponent::dereference was incorrect and replaced as described - in "New Features" section. - (BMR - 2008/08/10) Testing ------- - - tools/h5diff/testh5diff.sh is run in every "make check", even after it - has passed in the previous run. It should not run again if there is no - code changes. Fixed. (AKC - 2013/07/19 HDFFV-8392) - - In some Mac system, testlibinfo.sh failed with this error: - Check file ../src/.libs/libhdf5.7.dylib - strings: object: ../src/.libs/libhdf5.7.dylib malformed object \ - (unknown load command 15) - The strings command of Mac inspects library files and older - versions of strings may not know newer library format, resulting - in errors. Fixed by sending the library file as stdin to the strings - coommand to avoid this problem. (AKC - 2013/03/08 HDFFV-8305) - - - Fixed a typo in the ERROR macro in test/testhdf5.h. It segmentation - faulted when used before. (AKC - 2013/02/12 HDFFV-8267) Supported Platforms @@ -1195,17 +125,17 @@ Supported Platforms #1 SMP x86_64 GNU/Linux compilers for 64-bit applications; (koala) Version 4.1.2 20080704 (Red Hat 4.1.2-54) Version 4.8.2 - Intel(R) C, C++, Fortran Compilers for - applications running on Intel(R) 64; + Intel(R) C, C++, Fortran Compilers for + applications running on Intel(R) 64; Version 14.0.2 (Build 20140120) Linux 2.6.32-431.11.2.el6 GNU C (gcc), Fortran (gfortran), C++ (g++) #1 SMP x86_64 GNU/Linux compilers: (platypus) Version 4.4.7 20120313 Version 4.8.2 - PGI C, Fortran, C++ for 64-bit target on + PGI C, Fortran, C++ for 64-bit target on x86-64; - Version 13.7-0 + Version 13.7-0 Intel(R) C (icc), C++ (icpc), Fortran (icc) compilers: Version 14.0.2 (Build 20140120) @@ -1215,7 +145,7 @@ Supported Platforms (ostrich) GNU Fortran (GCC) 4.4.7 20120313 (Red Hat 4.4.7-4) IBM XL C/C++ V13.1 IBM XL Fortran V15.1 - + Linux 2.6.32-220.23.1.1chaos Intel C, C++, Fortran Compilers ch5.x86_64 GNU/Linux Version 12.1.5.339 (LLNL Aztec) @@ -1232,14 +162,14 @@ Supported Platforms Visual Studio 2010 w/ Intel Fortran 14 (cmake) Visual Studio 2012 w/ Intel Fortran 15 (cmake) Visual Studio 2013 w/ Intel Fortran 15 (cmake) - Cygwin(CYGWIN_NT-6.1 1.7.34(0.285/5/3) gcc(4.9.2) compiler and gfortran) + Cygwin(CYGWIN_NT-6.1 2.2.0(0.289/5/3) gcc(4.9.3) compiler and gfortran) (cmake and autotools) Windows 7 x64 Visual Studio 2008 (cmake) Visual Studio 2010 w/ Intel Fortran 14 (cmake) Visual Studio 2012 w/ Intel Fortran 15 (cmake) Visual Studio 2013 w/ Intel Fortran 15 (cmake) - + Windows 8.1 Visual Studio 2012 w/ Intel Fortran 15 (cmake) Visual Studio 2013 w/ Intel Fortran 15 (cmake) @@ -1252,23 +182,23 @@ Supported Platforms Mac OS X Mountain Lion 10.8.1 cc Apple clang version 4.0 from Xcode 4.5.1 (owl) c++ Apple clang version 4.0 from Xcode 4.5.1 - gcc i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 from Xcode 4.5.1 - g++ i686-apple-darwin11-llvm-g++-4.2 (GCC) 4.2.1 from Xcode 4.5.1 - gfortran GNU Fortran (GCC) 4.6.2 + gcc i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 from Xcode 4.5.1 + g++ i686-apple-darwin11-llvm-g++-4.2 (GCC) 4.2.1 from Xcode 4.5.1 + gfortran GNU Fortran (GCC) 4.6.2 Tested Configuration Features Summary ===================================== In the tables below - y = tested + y = tested n = not tested in this release C = Cluster W = Workstation x = not working in this release dna = does not apply ( ) = footnote appears below second table - = testing incomplete on this feature or platform + = testing incomplete on this feature or platform Platform C F90/ F90 C++ zlib SZIP parallel F2003 parallel @@ -1296,30 +226,30 @@ CentOS 6.4 Linux 2.6.32 x86_64 PGI n y/y n y y y Linux 2.6.32-431.11.2.el6.ppc64 n y/n n y y y -Platform Shared Shared Shared Thread- - C libs F90 libs C++ libs safe -Solaris2.11 32-bit y y y y -Solaris2.11 64-bit y y y y +Platform Shared Shared Shared Thread- + C libs F90 libs C++ libs safe +Solaris2.11 32-bit y y y y +Solaris2.11 64-bit y y y y Windows 7 y y y y Windows 7 x64 y y y y Windows 7 Cygwin n n n y Windows 7 x64 Cygwin n n n y Windows 8 y y y y Windows 8 x64 y y y y -Mac OS X Lion 10.7.3 32-bit y n y y -Mac OS X Lion 10.7.3 64-bit y n y y -Mac OS X Mountain Lion 10.8.1 64-bit y n y y +Mac OS X Lion 10.7.3 32-bit y n y y +Mac OS X Lion 10.7.3 64-bit y n y y +Mac OS X Mountain Lion 10.8.1 64-bit y n y y Mac OS X Mavericks 10.9.1 64-bit y n y y -AIX 6.1 32- and 64-bit y n n y -CentOS 5.9 Linux 2.6.18-308 i686 GNU y y y y -CentOS 5.9 Linux 2.6.18-308 i686 Intel y y y n -CentOS 5.9 Linux 2.6.18-308 i686 PGI y y y n -CentOS 5.9 Linux 2.6.18 x86_64 GNU y y y y -CentOS 5.9 Linux 2.6.18 x86_64 Intel y y y n +AIX 6.1 32- and 64-bit y n n y +CentOS 5.9 Linux 2.6.18-308 i686 GNU y y y y +CentOS 5.9 Linux 2.6.18-308 i686 Intel y y y n +CentOS 5.9 Linux 2.6.18-308 i686 PGI y y y n +CentOS 5.9 Linux 2.6.18 x86_64 GNU y y y y +CentOS 5.9 Linux 2.6.18 x86_64 Intel y y y n CentOS 6.4 Linux 2.6.32 x86_64 GNU y y y n CentOS 6.4 Linux 2.6.32 x86_64 Intel y y y n -CentOS 6.4 Linux 2.6.32 x86_64 PGI y y y n -Linux 2.6.32-431.11.2.el6.ppc64 y y y n +CentOS 6.4 Linux 2.6.32 x86_64 PGI y y y n +Linux 2.6.32-431.11.2.el6.ppc64 y y y n Compiler versions for each platform are listed in the preceding "Supported Platforms" table. @@ -1335,7 +265,7 @@ The following platforms are not supported but have been tested for this release. Linux 2.6.18-431.11.2.el6 MPICH mpich 3.1.2 compiled with #1 SMP x86_64 GNU/Linux gcc 4.9.1 and gfortran 4.9.1 - (platypus) g95 (GCC 4.0.3 (g95 0.94!) + (platypus) g95 (GCC 4.0.3 (g95 0.94!) FreeBSD 8.2-STABLE i386 gcc 4.2.1 [FreeBSD] 20070719 (loyalty) gcc 4.6.1 20110422 @@ -1386,7 +316,7 @@ The following platforms are not supported but have been tested for this release. gcc (Ubuntu/Linaro 4.9.1-0ubuntu1) 4.9.1 GNU Fortran (Ubuntu/Linaro 4.9.1-0ubuntu1) 4.9.1 (cmake and autotools) - + Cray Linux Environment (CLE) PrgEnv-pgi/4.0.46 hopper.nersc.gov pgcc 12.5-0 64-bit target on x86-64 Linux -tp shanghai pgf90 12.5-0 64-bit target on x86-64 Linux -tp shanghai @@ -1402,20 +332,20 @@ Known Problems * CLANG compiler with the options -fcatch-undefined-behavior and -ftrapv catches some undefined behavior in the alignment algorithm of the macro DETECT_I - in H5detect.c (Issue 8147). Since the algorithm is trying to detect the alignment - of integers, ideally the flag -fcatch-undefined-behavior shouldn't to be used for - H5detect.c. In the future, we can separate flags for H5detect.c from the rest of + in H5detect.c (Issue 8147). Since the algorithm is trying to detect the alignment + of integers, ideally the flag -fcatch-undefined-behavior shouldn't to be used for + H5detect.c. In the future, we can separate flags for H5detect.c from the rest of the library. (SLU - 2013/10/16) * The 5.9 C++ compiler on Sun failed to compile a C++ test ttypes.cpp. It complains with this message: "/home/hdf5/src/H5Vprivate.h", line 130: Error: __func__ is not defined. - + The reason is that __func__ is a predefined identifier in C99 standard. The HDF5 C library uses it in H5private.h. The test ttypes.cpp includes - H5private.h (H5Tpkg.h<-H5Fprivate.h<-H5Vprivate.h<-H5private.h). Sun's 5.9 + H5private.h (H5Tpkg.h<-H5Fprivate.h<-H5Vprivate.h<-H5private.h). Sun's 5.9 C++ compiler doesn't support __func__, thus fails to compile the C++ test. - But 5.11 C++ compiler does. To check whether your Sun C++ compiler knows this + But 5.11 C++ compiler does. To check whether your Sun C++ compiler knows this identifier, try to compile the following simple C++ program: #include @@ -1433,23 +363,23 @@ Known Problems * The data conversion test dt_arith.c has failures (segmentation fault) from "long double" to other datatypes during hard conversion when the library - is built with the default GCC 4.2.1 on Mac Lion system. It only happens - with optimization (-O3, -O2, and -O1). Some newer versions of GCC do not + is built with the default GCC 4.2.1 on Mac Lion system. It only happens + with optimization (-O3, -O2, and -O1). Some newer versions of GCC do not have this problem. Users should disable optimization or try newer version of GCC. (Issue 8017. SLU - 2012/6/12) * The data conversion test dt_arith.c fails in "long double" to integer conversion on Ubuntu 11.10 (3.0.0.13 kernal) with GCC 4.6.1 if the library is built with optimization -O3 or -O2. The older GCC (4.5) or newer kernal - (3.2.2 on Fedora) doesn't have the problem. Users should lower down the - optimization level (-O1 or -O0) by defining CFLAGS in the command line of + (3.2.2 on Fedora) doesn't have the problem. Users should lower down the + optimization level (-O1 or -O0) by defining CFLAGS in the command line of "configure" like: CFLAGS=-O1 ./configure - It will overwrite the library's default optimization level. (Issue 7829. + It will overwrite the library's default optimization level. (Issue 7829. SLU - 2012/2/7) - + * --with-mpe configure option does not work with Mpich2. AKC - 2011/03/10) * While working on the 1.8.6 release of HDF5, a bug was discovered that can @@ -1472,7 +402,7 @@ Known Problems cause H5Fcreate() with H5F_ACC_EXCL to fail even when the file is not existing. This is due to the MPI_File_open() call failing if the amode has the MPI_MODE_EXCL bit set. (See bug 1468 for details.) AKC - 2009/8/11 - + * Parallel tests failed with 16 processes with data inconsistency at testphdf5 / dataset_readAll. Parallel tests also failed with 32 and 64 processes with collective abort of all ranks at t_posix_compliant / allwrite_allread_blocks @@ -1481,19 +411,19 @@ Known Problems * For SNL, spirit/liberty/thunderbird: The serial tests pass but parallel tests failed with MPI-IO file locking message. AKC - 2007/6/25. * On Intel 64 Linux cluster (RH 4, Linux 2.6.9) with Intel 10.0 compilers use - -mp -O1 compilation flags to build the libraries. Higher level of optimization - causes failures in several HDF5 library tests. + -mp -O1 compilation flags to build the libraries. Higher level of optimization + causes failures in several HDF5 library tests. * For HPUX 11.23 many tools tests failed for 64-bit version when linked to the shared libraries (tested for 1.8.0-beta2) * For SNL, Red Storm: only paralle HDF5 is supported. The serial tests pass and the parallel tests also pass with lots of non-fatal error messages. -* on SUN 5.10 C++ test fails in the "Testing Shared Datatypes with Attributes" test +* on SUN 5.10 C++ test fails in the "Testing Shared Datatypes with Attributes" test * configuring with --enable-debug=all produces compiler errors on most platforms. Users who want to run HDF5 in debug mode should use --enable-debug rather than --enable-debug=all to enable debugging information on most modules. * On Mac OS 10.4, test/dt_arith.c has some errors in conversion from long - double to (unsigned) long long and from (unsigned)long long to long double. + double to (unsigned) long long and from (unsigned)long long to long double. * On Altix SGI with Intel 9.0 testmeta.c would not compile with -O3 optimization flag. * On VAX, Scaleoffset filter isn't supported. The filter cannot be applied to @@ -1506,19 +436,19 @@ Known Problems contribute no IO and the application asks to do IO with collective, we found that when using 4 processors, a simple collective write will be hung sometimes. This can be verified with t_mpi test under testpar. -* The dataset created or rewritten with the v1.6.3 library or after can't - be read with the v1.6.2 library or before when Fletcher32 EDC(filter) is - enabled. There was a bug in the calculating code of the Fletcher32 - checksum in the library before v1.6.3. The checksum value wasn't consistent - between big-endian and little-endian systems. This bug was fixed in - Release 1.6.3. However, after fixing the bug, the checksum value is no - longer the same as before on little-endian system. The library release +* The dataset created or rewritten with the v1.6.3 library or after can't + be read with the v1.6.2 library or before when Fletcher32 EDC(filter) is + enabled. There was a bug in the calculating code of the Fletcher32 + checksum in the library before v1.6.3. The checksum value wasn't consistent + between big-endian and little-endian systems. This bug was fixed in + Release 1.6.3. However, after fixing the bug, the checksum value is no + longer the same as before on little-endian system. The library release after 1.6.4 can still read the dataset created or rewritten with the library of v1.6.2 or before. SLU - 2005/6/30 * For the version 6(6.02 and 6.04) of Portland Group compiler on AMD Opteron processor, there's a bug in the compiler for optimization(-O2). The library - failed in several tests but all related to multi driver. The problem has - been reported to the vendor. + failed in several tests but all related to multi driver. The problem has + been reported to the vendor. * On IBM AIX systems, parallel HDF5 mode will fail some tests with error messages like "INFO: 0031-XXX ...". This is from the command poe. Set the environment variable MP_INFOLEVEL to 0 to minimize the messages @@ -1532,7 +462,7 @@ Known Problems to provide a mean to run poe without the debug socket. * The C++ library's tests fails when compiling with PGI C++ compiler. The - workaround until the problem is correctly handled is to use the + workaround until the problem is correctly handled is to use the flag "--instantiate=local" prior to the configure and build steps, as: setenv CXX "pgCC --instantiate=local" for pgCC 5.02 and higher @@ -1546,9 +476,9 @@ Known Problems * The --enable-static-exec configure flag will only statically link libraries if the static version of that library is present. If only the shared version of a library exists (i.e., most system libraries on Solaris, AIX, and Mac, - for example, only have shared versions), the flag should still result in a - successful compilation, but note that the installed executables will not be - fully static. Thus, the only guarantee on these systems is that the + for example, only have shared versions), the flag should still result in a + successful compilation, but note that the installed executables will not be + fully static. Thus, the only guarantee on these systems is that the executable is statically linked with just the HDF5 library. * With the gcc 2.95.2 compiler, HDF 5 uses the `-ansi' flag during @@ -1556,7 +486,7 @@ Known Problems able to handle the `long long' datatype with the warning: warning: ANSI C does not support `long long' - + This warning is innocuous and can be safely ignored. * Certain platforms give false negatives when testing h5ls: @@ -1574,35 +504,35 @@ Known Problems * On some platforms that use Intel and Absoft compilers to build HDF5 fortran library, compilation may fail for fortranlib_test.f90, fflush1.f90 and fflush2.f90 - complaining about exit subroutine. Comment out the line + complaining about exit subroutine. Comment out the line IF (total_error .ne. 0) CALL exit (total_error) * Information about building with PGI and Intel compilers is available in INSTALL file sections 5.7 and 5.8 * On at least one system, (SDSC DataStar), the scheduler (in this case - LoadLeveler) sends job status updates to standard error when you run + LoadLeveler) sends job status updates to standard error when you run any executable that was compiled with the parallel compilers. - This causes problems when running "make check" on parallel builds, as + This causes problems when running "make check" on parallel builds, as many of the tool tests function by saving the output from test runs, - and comparing it to an exemplar. + and comparing it to an exemplar. The best solution is to reconfigure the target system so it no longer inserts the extra text. However, this may not be practical. - In such cases, one solution is to "setenv HDF5_Make_Ignore yes" prior to - the configure and build. This will cause "make check" to continue after + In such cases, one solution is to "setenv HDF5_Make_Ignore yes" prior to + the configure and build. This will cause "make check" to continue after detecting errors in the tool tests. However, in the case of SDSC DataStar, it also leaves you with some 150 "failed" tests to examine by hand. A second solution is to write a script to run serial tests and filter out the text added by the scheduler. A sample script used on SDSC - DataStar is given below, but you will probably have to customize it - for your installation. + DataStar is given below, but you will probably have to customize it + for your installation. - Observe that the basic idea is to insert the script as the first item - on the command line which executes the the test. The script then + Observe that the basic idea is to insert the script as the first item + on the command line which executes the the test. The script then executes the test and filters out the offending text before passing it on. @@ -1624,11 +554,11 @@ Known Problems exit $RETURN_VALUE You get the HDF make files and test scipts to execute your filter script - by setting the environment variable "RUNSERIAL" to the full path of the - script prior to running configure for parallel builds. Remember to + by setting the environment variable "RUNSERIAL" to the full path of the + script prior to running configure for parallel builds. Remember to "unsetenv RUNSERIAL" before running configure for a serial build. - Note that the RUNSERIAL environment variable exists so that we can + Note that the RUNSERIAL environment variable exists so that we can can prefix serial runs as necessary on the target system. On DataStar, no prefix is necessary. However on an MPICH system, the prefix might have to be set to something like "/usr/local/mpi/bin/mpirun -np 1" to diff --git a/release_docs/USING_CMake_Examples.txt b/release_docs/USING_CMake_Examples.txt index 0956ff1..d52a719 100644 --- a/release_docs/USING_CMake_Examples.txt +++ b/release_docs/USING_CMake_Examples.txt @@ -2,39 +2,34 @@ * Build and Test HDF5 Examples with CMake * ************************************************************************ -Notes: This short instruction is written for users who want to quickly +Notes: This short instruction is written for users who want to quickly test the installation of HDF5 by using the CMake tools to build and test the HDF5 Examples. The following instructions will show the default usage and then present common changes for non-default installations. For more information, see the USING_HDF5_CMake.txt file. - - More information about using CMake can be found at the KitWare + + More information about using CMake can be found at the KitWare site, www.cmake.org. - + CMake uses the command line and these instructions use the script method of the ctest command. ======================================================================== -I. Preconditions +I. Preconditions ======================================================================== 1. We suggest you obtain the latest CMake for windows from the Kitware - web site. The HDF5 1.8.x product requires a minimum CMake version - of 3.1.0. - - 2. You have installed the HDF5 library built with CMake, by executing - the HDF Install Utility (the *.exe file in the binary package for - Windows or the *.sh on Linux). If you are using a Windows platform, - you can obtain a pre-built Windows binary from The HDF Group's website - at www.hdfgroup.org. See Section "III. Common changes to the + web site. The HDF5 1.8.x product requires a minimum CMake version + of 3.1.0. + + 2. You have installed the HDF5 library built with CMake, by executing + the HDF Install Utility (the *.msi file in the binary package for + Windows or the *.sh on Linux). If you are using a Windows platform, + you can obtain a pre-built Windows binary from The HDF Group's website + at www.hdfgroup.org. See Section "III. Common changes to the HDF518_Examples.cmake file", for the line to change the location. - - 3. On Windows, you have installed the 7Zip package. See Section "III. - Common changes to the HDF518_Examples.cmake file", for the line to - change the command. - ======================================================================== @@ -42,16 +37,16 @@ II. Building HDF5 Examples with CMake ======================================================================== Files in the HDF5 install directory: - HDF5Examples-0.1.1-Source.zip (or HDF5Examples-0.1.1-Source.tar.gz) + HDF5Examples-0.1.1-Source folder HDF518_Examples.cmake - + Default installation process: Create a directory to run the examples, i.e. \test_hdf5. - Copy HDF5Examples-0.1.1-Source.zip(.tar.gz) to this directory, uncompress. + Copy HDF5Examples-0.1.1-Source folder to this directory. Copy HDF518_Examples.cmake to this directory. - Edit line 8 of the HDF518_Examples.cmake file and change the INSTALLDIR + Edit line 8 of the HDF518_Examples.cmake file and change the INSTALLDIR to the HDF5 install location. - + Execute from this directory: ctest -S HDF518_Examples.cmake,HDF5Examples-0.1.1-Source -C Release -O test.log @@ -60,7 +55,7 @@ The script will use the examples folder HDF5Examples-0.1.1-Source, It will then configure, build, and execute the examples. All the log files will be found under the build\Testing\Temporary directory, check these for errors. - + The amount of script information can be increased by adding -V to the ctest command. Even more information can be shown by adding -VV instead of -V. @@ -79,5 +74,3 @@ Line 16: comment to NOT build and test Fortran examples with F2003 option. Line 17: uncomment to use a compressed source file. -Line 71: change the CTEST_7Z_COMMAND to a different unzip program. - diff --git a/release_docs/USING_HDF5_CMake.txt b/release_docs/USING_HDF5_CMake.txt index 514cced..5fdb76c 100644 --- a/release_docs/USING_HDF5_CMake.txt +++ b/release_docs/USING_HDF5_CMake.txt @@ -2,60 +2,60 @@ * Build and Install HDF5 Applications with CMake * ************************************************************************ -Notes: This short instruction is written for users who want to quickly - build HDF5 applications using the CMake tools. Users can adapt - these instructions for their own applications. For more information, +Notes: This short instruction is written for users who want to quickly + build HDF5 applications using the CMake tools. Users can adapt + these instructions for their own applications. For more information, see the "Minimum C Project Files for CMake" section. - - More information about using CMake can be found at the KitWare + + More information about using CMake can be found at the KitWare site, www.cmake.org. - - CMake uses the command line; however, the visual CMake tool is + + CMake uses the command line; however, the visual CMake tool is available for the configuration step. The steps are similar for all of the operating systems supported by CMake. - + NOTES: - 1. Using CMake for building and using HDF5 is under active - development. While we have attempted to provide error-free - files, please understand that development with CMake has not - been extensively tested outside of HDF. The CMake specific + 1. Using CMake for building and using HDF5 is under active + development. While we have attempted to provide error-free + files, please understand that development with CMake has not + been extensively tested outside of HDF. The CMake specific files may change before the next release. - - 2. CMake for HDF5 development should be usable on any system - where CMake is supported. Please send us any comments on how - CMake support can be improved on any system. - - 3. See the appendix at the bottom of this file for an example - of using a ctest script for building and testing. See + + 2. CMake for HDF5 development should be usable on any system + where CMake is supported. Please send us any comments on how + CMake support can be improved on any system. + + 3. See the appendix at the bottom of this file for an example + of using a ctest script for building and testing. See INSTALL_CMake.txt for more information. ======================================================================== -I. Preconditions +I. Preconditions ======================================================================== 1. We suggest you obtain the latest CMake for windows from the Kitware - web site. The HDF5 1.8.x product requires a minimum CMake version - of 3.1.0. - - 2. You have installed the HDF5 library built with CMake, by executing - the HDF Install Utility (the *.exe file in the binary package for - Windows). If you are using a Windows platform, you can obtain a - pre-built Windows binary from The HDF Group's website at + web site. The HDF5 1.8.x product requires a minimum CMake version + of 3.1.0. + + 2. You have installed the HDF5 library built with CMake, by executing + the HDF Install Utility (the *.msi file in the binary package for + Windows). If you are using a Windows platform, you can obtain a + pre-built Windows binary from The HDF Group's website at www.hdfgroup.org. - 3. Set the environment variable HDF5_DIR to the installed location of - the config files for HDF5. On Windows: - HDF5_DIR=C:/Program Files/HDF_Group/HDF5/1.8.x/cmake/hdf5 - + 3. Set the environment variable HDF5_DIR to the installed location of + the config files for HDF5. On Windows: + HDF5_DIR=C:/Program Files/HDF_Group/HDF5/1.8.x/cmake + (Note there are no quote characters used on Windows and all platforms use forward slashes) 4. Created separate source and build directories. (CMake commands are executed in the build directory) - 5. Created a CMakeLists.txt file(s) for your source. See Section III + 5. Created a CMakeLists.txt file(s) for your source. See Section III below. @@ -65,6 +65,7 @@ II. Building HDF5 Applications with CMake ======================================================================== Go through these steps to build HDF5 applications with CMake. + (The application must support building with CMake.) 1. Run CMake 2. Configure the cache settings @@ -79,22 +80,22 @@ These steps are described in more detail below. The visual CMake executable is named "cmake-gui.exe" on Windows and should be available in your Start menu. For Linux, UNIX, and Mac users the - executable is named "cmake-gui" and can be found where CMake was - installed. - - Specify the source and build directories. Make the build and source - directories different. For example on Windows, if the source is at - c:\MyHDFstuff\hdf5, then use c:\MyHDFstuff\hdf5\build or - c:\MyHDFstuff\build\hdf5 for the build directory. - + executable is named "cmake-gui" and can be found where CMake was + installed. + + Specify the source and build directories. Make the build and source + directories different. For example on Windows, if the source is at + c:\MyHDFstuff\hdf5, then use c:\MyHDFstuff\hdf5\build or + c:\MyHDFstuff\build\hdf5 for the build directory. + PREFERRED: - Users can perform the configuration step without using the visual - cmake-gui program. The following is an example command line + Users can perform the configuration step without using the visual + cmake-gui program. The following is an example command line configuration step executed within the build directory: - + cmake -G "" [-D] - - Where is + + Where is * MinGW Makefiles * NMake Makefiles * Unix Makefiles @@ -111,63 +112,63 @@ These steps are described in more detail below. 2. Configure the cache settings - 2.1 Visual CMake users, click the Configure button. If this is the first time you are - running cmake-gui in this directory, you will be prompted for the - generator you wish to use (for example on Windows, Visual Studio 10). - CMake will read in the CMakeLists.txt files from the source directory and - display options for the HDF5 project. After the first configure you + 2.1 Visual CMake users, click the Configure button. If this is the first time you are + running cmake-gui in this directory, you will be prompted for the + generator you wish to use (for example on Windows, Visual Studio 10). + CMake will read in the CMakeLists.txt files from the source directory and + display options for the HDF5 project. After the first configure you can adjust the cache settings and/or specify locations of other programs. - + Any conflicts or new values will be highlighted by the configure - process in red. Once you are happy with all the settings and there are no - more values in red, click the Generate button to produce the appropriate - build files. - - On Windows, if you are using a Visual Studio generator, the solution and + process in red. Once you are happy with all the settings and there are no + more values in red, click the Generate button to produce the appropriate + build files. + + On Windows, if you are using a Visual Studio generator, the solution and project files will be created in the build folder. - + On linux, if you are using the Unix Makefiles generator, the Makefiles will be created in the build folder. 2.2 Alternative command line example on Windows in c:\MyHDFstuff\hdf5\build directory: - + cmake -G "Visual Studio 11" -DBUILD_TESTING:BOOL=ON .. 3. Build HDF5 Applications - - On Windows, you can build HDF5 applications using either the Visual Studio Environment + + On Windows, you can build HDF5 applications using either the Visual Studio Environment or the command line. The command line is normally used on linux, Unix, and Mac. To build from the command line, navigate to your build directory and execute the following: - - cmake --build . --config {Debug | Release} - + + cmake --build . --config {Debug | Release} + NOTE: "--config {Debug | Release}" may be optional on your platform. We recommend choosing either Debug or Release on Windows. If you are - using the pre-built binaries from HDF, use Release. - - 3.1 If you wish to use the Visual Studio environment, open the solution - file in your build directory. Be sure to select either Debug or + using the pre-built binaries from HDF, use Release. + + 3.1 If you wish to use the Visual Studio environment, open the solution + file in your build directory. Be sure to select either Debug or Release and build the solution. - + 4. Test HDF5 Applications To test the build, navigate to your build directory and execute: - + ctest . -C {Debug | Release} - + NOTE: "-C {Debug | Release}" may be optional on your platform. We recommend choosing either Debug or Release to match the build - step on Windows. + step on Windows. - 5. The files that support building with CMake are all of the files in the - config/cmake folder, the CMakeLists.txt files in each source folder, and - CTestConfig.cmake. CTestConfig.cmake is specific to the internal testing - performed by The HDF Group. It should be altered for the user's + 5. The files that support building with CMake are all of the files in the + config/cmake folder, the CMakeLists.txt files in each source folder, and + CTestConfig.cmake. CTestConfig.cmake is specific to the internal testing + performed by The HDF Group. It should be altered for the user's installation and needs. The cacheinit.cmake file settings are used by - The HDF Group for daily testing. It should be altered/ignored for the user's - installation and needs. + The HDF Group for daily testing. It should be altered/ignored for the user's + installation and needs. @@ -175,17 +176,17 @@ These steps are described in more detail below. III. Minimum C Project Files for CMake ======================================================================== -Create a CMakeLists.txt file at the source root. Include the +Create a CMakeLists.txt file at the source root. Include the following text in the file: ########################################################## cmake_minimum_required (VERSION 3.1.0) -PROJECT (HDF5MyApp C CXX) +project (HDF5MyApp C CXX) -FIND_PACKAGE (HDF5 NAMES hdf5) -# FIND_PACKAGE (HDF5) # Find non-cmake built HDF5 +find_package (HDF5 NAMES hdf5 COMPONENTS C static) +# find_package (HDF5) # Find non-cmake built HDF5 INCLUDE_DIRECTORIES (${HDF5_INCLUDE_DIR}) -set (LINK_LIBS ${LINK_LIBS} ${HDF5_LIBRARIES}) +set (LINK_LIBS ${LINK_LIBS} ${HDF5_C_STATIC_LIBRARY}) set (example hdf_example) @@ -193,7 +194,7 @@ add_executable (${example} ${PROJECT_SOURCE_DIR}/${example}.c) TARGET_C_PROPERTIES (${example} " " " ") target_link_libraries (${example} ${LINK_LIBS}) -ENABLE_TESTING () +enable_testing () include (CTest) add_test (NAME test_example COMMAND ${example}) @@ -216,8 +217,8 @@ NOTE: these files are available at the HDF web site: http://www.hdfgroup.org/HDF5/release/cmakebuild.html CTestScript.cmake - - HDF518ExamplesWindowsbinaryCMake.cmake + + HDF518_Examples.cmake @@ -226,10 +227,10 @@ ctest ======================================================================== ############################################################################ -# Product specific script, HDF518Example.cmake, that uses the +# Product specific script, HDF518_Examples.cmake, that uses the # CTestScript.cmake file (see Appendix in the CMake.txt). Usage: -# "ctest -S HDF518Example.cmake,hdf518Examples -C Release -O hdf518EX.log" -# where hdf518Examples is the source folder relative to the location of these scripts +# "ctest -S HDF518_Examples.cmake,HDF5Examples-0.1.1-Source -C Release -O test.log" +# where HDF5Examples-0.1.1-Source is the source folder relative to the location of these scripts ############################################################################ cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR) @@ -259,7 +260,7 @@ set(REPOSITORY_URL "http://svn.${hdfgroup_url}/hdf5-examples/trunk/1_8") set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCMAKE_INSTALL_PREFIX:PATH=/usr/local/hdf5Examples-1.8") # location of the installed hdf5 (cmake configuration folder) -set(ENV{HDF5_DIR} "/usr/share/cmake/hdf5") +set(ENV{HDF5_DIR} "/usr/share/cmake") include(${CTEST_SCRIPT_DIRECTORY}/CTestScript.cmake) -- cgit v0.12 From 1252bc4e669306b0e029e26b7283d1685fa2ccbc Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Thu, 27 Aug 2015 17:24:45 -0500 Subject: [svn-r27601] Removed the H5TSprivate.h include from H5.c. It's not needed and causes problems on Windows. Tested on: jam, with and without --enable-threadsafe --- src/H5.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/H5.c b/src/H5.c index 8563545..2e05819 100644 --- a/src/H5.c +++ b/src/H5.c @@ -31,7 +31,6 @@ #include "H5Pprivate.h" /* Property lists */ #include "H5SLprivate.h" /* Skip lists */ #include "H5Tprivate.h" /* Datatypes */ -#include "H5TSprivate.h" /* Thread safety */ /****************/ /* Local Macros */ -- cgit v0.12 From 1847391fc51728811407f3e1586213758c1d0e89 Mon Sep 17 00:00:00 2001 From: Neil Fortner Date: Fri, 28 Aug 2015 14:43:03 -0500 Subject: [svn-r27605] Fix potential memory error when using a dataspace that was created with H5Screate and had its extent set by H5Sextent_copy. Tested: jam, ostrich (h5committest) --- src/H5S.c | 2 +- test/th5s.c | 43 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+), 1 deletion(-) diff --git a/src/H5S.c b/src/H5S.c index 9b37797..efb9d34 100644 --- a/src/H5S.c +++ b/src/H5S.c @@ -190,7 +190,7 @@ H5S_create(H5S_class_t type) FUNC_ENTER_NOAPI(NULL) /* Create a new dataspace */ - if(NULL == (new_ds = H5FL_MALLOC(H5S_t))) + if(NULL == (new_ds = H5FL_CALLOC(H5S_t))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") /* Initialize default dataspace state */ diff --git a/test/th5s.c b/test/th5s.c index 1560ef4..9d08abe 100644 --- a/test/th5s.c +++ b/test/th5s.c @@ -2326,6 +2326,48 @@ test_h5s_extent_copy(void) /**************************************************************** ** +** test_h5s_bug1(): Test Creating dataspace with H5Screate then +* setting extent with H5Sextent_copy. +** +****************************************************************/ +static void +test_h5s_bug1(void) +{ + hid_t space1; /* Dataspace to copy extent to */ + hid_t space2; /* Scalar dataspace */ + hsize_t dims[2] = {10, 10}; /* Dimensions */ + hsize_t start[2] = {0, 0}; /* Hyperslab start */ + htri_t select_valid; /* Whether the dataspace selection is valid */ + herr_t ret; /* Generic error return */ + + /* Create dataspaces */ + space1 = H5Screate(H5S_SIMPLE); + CHECK(space1, FAIL, "H5Screate"); + space2 = H5Screate_simple(2, dims, NULL); + CHECK(space2, FAIL, "H5Screate"); + + /* Copy extent to space1 */ + ret = H5Sextent_copy(space1, space2); + CHECK(ret, FAIL, "H5Sextent_copy"); + + /* Select hyperslab in space1 containing entire extent */ + ret = H5Sselect_hyperslab(space1, H5S_SELECT_SET, start, NULL, dims, NULL); + CHECK(ret, FAIL, "H5Sselect_hyperslab"); + + /* Check that space1's selection is valid */ + select_valid = H5Sselect_valid(space1); + CHECK(select_valid, FAIL, "H5Sselect_valid"); + VERIFY(select_valid, TRUE, "H5Sselect_valid result"); + + /* Close dataspaces */ + ret = H5Sclose(space1); + CHECK(ret, FAIL, "H5Sclose"); + ret = H5Sclose(space2); + CHECK(ret, FAIL, "H5Sclose"); +} /* test_h5s_bug1() */ + +/**************************************************************** +** ** test_h5s(): Main H5S (dataspace) testing routine. ** ****************************************************************/ @@ -2350,6 +2392,7 @@ test_h5s(void) test_h5s_extent_equal(); /* Test extent comparison code */ test_h5s_extent_copy(); /* Test extent copy code */ + test_h5s_bug1(); /* Test bug in offset initialization */ } /* test_h5s() */ -- cgit v0.12 From b68b9d8786f6b9bf4bd52a3b8c87fa64933803b1 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Fri, 28 Aug 2015 20:43:37 -0500 Subject: [svn-r27612] Description: Align w/vds branch: Whitespace cleanup, move common code for opening a dataset into a new routine, misc. style cleanups. Tested on: MacOSX/64 10.10.5 (amazon) w/serial & parallel (h5committest upcoming) --- MANIFEST | 1 - configure.ac | 114 ++++++++++++++++++------------------- src/H5D.c | 44 +++----------- src/H5Ddeprec.c | 46 +++------------ src/H5Dint.c | 70 ++++++++++++++++++++++- src/H5Dpkg.h | 3 +- src/H5Olayout.c | 6 +- src/H5Pdcpl.c | 12 ++-- tools/h5dump/errfiles/tdset-2.err | 13 +++-- tools/h5dump/errfiles/tperror.err | 13 +++-- tools/h5dump/errfiles/tslink-D.err | 19 ++++--- 11 files changed, 180 insertions(+), 161 deletions(-) diff --git a/MANIFEST b/MANIFEST index b18c4ee..44bdc24 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1064,7 +1064,6 @@ ./tools/h5dump/testh5dumpxml.sh.in ./tools/h5dump/binread.c - ./tools/h5import/Makefile.am ./tools/h5import/Makefile.in ./tools/h5import/h5import.h diff --git a/configure.ac b/configure.ac index b441cad..ff8a667 100644 --- a/configure.ac +++ b/configure.ac @@ -187,7 +187,7 @@ AC_SUBST([PAC_C_MAX_REAL_PRECISION]) ## ---------------------------------------------------------------------- ## Some platforms have broken basename, and/or xargs programs. Check ## that it actually does what it's supposed to do. Catch this early -## since configure and scripts relies upon them heavily and there's +## since configure and scripts relies upon them heavily and there's ## no use continuing if it's broken. ## AC_MSG_CHECKING([if basename works]) @@ -335,7 +335,7 @@ AC_ARG_ENABLE([unsupported], [Allow unsupported combinations of configure options])], [ALLOW_UNSUPPORTED=$enableval]) -case "X-$ALLOW_UNSUPPORTED" in +case "X-$ALLOW_UNSUPPORTED" in X-|X-no) AC_MSG_RESULT([no]) ;; @@ -416,7 +416,7 @@ if test "X$HDF_FORTRAN" = "Xyes"; then [cat fortran/src/H5config_f.inc | sed '1d;s%^/\* \(.*\) \*/%\1%;s/#define /#define H5_/;s/#undef /#undef H5_/' >fortran/src/H5config_f.inc.tmp; mv -f fortran/src/H5config_f.inc.tmp fortran/src/H5config_f.inc]) AC_SUBST([FC]) HDF_FORTRAN=yes - + HDF5_INTERFACES="$HDF5_INTERFACES fortran" ## -------------------------------------------------------------------- @@ -441,7 +441,7 @@ if test "X$HDF_FORTRAN" = "Xyes"; then ## -------------------------------------------------------------------- ## Check for a Fortran compiler and how to include modules. - ## + ## AC_PROG_FC([PAC_FC_SEARCH_LIST],) AC_F9X_MODS @@ -631,8 +631,8 @@ if test "X$HDF_CXX" = "Xyes"; then # Checking if C++ can handle namespaces PAC_PROG_CXX_NAMESPACE - - # Checking if C++ has offsetof extension + + # Checking if C++ has offsetof extension PAC_PROG_CXX_OFFSETOF # if C++ can handle static cast @@ -781,7 +781,7 @@ if test "X${HDF_FORTRAN}" = "Xyes" && test "X${enable_shared}" != "Xno"; then H5_FORTRAN_SHARED="yes" ## Disable fortran shared libraries on Mac. (MAM - 03/30/11) - + case "`uname`" in Darwin*) H5_FORTRAN_SHARED="no" @@ -790,7 +790,7 @@ if test "X${HDF_FORTRAN}" = "Xyes" && test "X${enable_shared}" != "Xno"; then esac ## Report results of check(s) - + if test "X${H5_FORTRAN_SHARED}" = "Xno"; then AC_MSG_RESULT([no]) AC_MSG_WARN([$CHECK_WARN]) @@ -826,7 +826,7 @@ LT_INIT([dlopen,win32-dll]) ## ---------------------------------------------------------------------- ## Check if we should install only statically linked executables. ## This check needs to occur after libtool is initialized because -## we check a libtool cache value and may issue a warning based +## we check a libtool cache value and may issue a warning based ## on its result. AC_MSG_CHECKING([if we should install only statically linked executables]) AC_ARG_ENABLE([static_exec], @@ -895,7 +895,7 @@ esac AC_SUBST([AM_MAKEFLAGS]) AM_MAKEFLAGS="" ## Don't run test if MAKE is defined but is the empty string -if test -n "${MAKE-make}"; then +if test -n "${MAKE-make}"; then AC_MSG_CHECKING([whether make will build with undefined variables]) @@ -1047,11 +1047,11 @@ fi ## ---------------------------------------------------------------------- ## Use the macro _AC_SYS_LARGEFILE_MACRO_VALUE to test defines -## that might need to be set for largefile support to behave +## that might need to be set for largefile support to behave ## correctly. This macro is defined in acsite.m4 and overrides ## the version provided by Autoconf (as of v2.65). The custom -## macro additionally adds the appropriate defines to AM_CPPFLAGS -## so that later configure checks have them visible. +## macro additionally adds the appropriate defines to AM_CPPFLAGS +## so that later configure checks have them visible. ## Check for _FILE_OFFSET_BITS _AC_SYS_LARGEFILE_MACRO_VALUE([_FILE_OFFSET_BITS], [64], @@ -1072,16 +1072,16 @@ fi ## case "$host_cpu-$host_vendor-$host_os" in *linux*) - ## Make available various LFS-related routines using the following + ## Make available various LFS-related routines using the following ## _LARGEFILE*_SOURCE macros. AM_CPPFLAGS="-D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE $AM_CPPFLAGS" ## Add POSIX support on Linux systems, so defines ## __USE_POSIX, which is required to get the prototype for fdopen - ## defined correctly in . + ## defined correctly in . ## ## This flag was removed from h5cc as of 2009-10-17 when it was found - ## that the flag broke compiling netCDF-4 code with h5cc, but kept in + ## that the flag broke compiling netCDF-4 code with h5cc, but kept in ## H5_CPPFLAGS because fdopen and HDfdopen fail without it. HDfdopen ## is used only by H5_debug_mask which is used only when debugging in ## H5_init_library (all in H5.c). When the flag was removed this was @@ -1108,7 +1108,7 @@ case "$host_cpu-$host_vendor-$host_os" in ## correctly in ## Linking to the bsd-compat library is required as per the gcc manual: ## http://www.gnu.org/s/libc/manual/html_node/Feature-Test-Macros.html - ## however, we do not do this since it breaks the big test on some + ## however, we do not do this since it breaks the big test on some ## older platforms. H5_CPPFLAGS="-D_BSD_SOURCE $H5_CPPFLAGS" @@ -1119,7 +1119,7 @@ case "$host_cpu-$host_vendor-$host_os" in ;; esac -## Need to add the AM_ and H5_ into CFLAGS/CPPFLAGS to make them visible +## Need to add the AM_ and H5_ into CFLAGS/CPPFLAGS to make them visible ## for configure checks. ## Note: Both will be restored by the end of configure. CPPFLAGS="$H5_CPPFLAGS $AM_CPPFLAGS $CPPFLAGS" @@ -1430,17 +1430,17 @@ case $withval in fi ;; esac - + saved_CPPFLAGS="$CPPFLAGS" saved_AM_CPPFLAGS="$AM_CPPFLAGS" saved_LDFLAGS="$LDFLAGS" saved_AM_LDFLAGS="$AM_LDFLAGS" - + if test -n "$szlib_inc"; then CPPFLAGS="$CPPFLAGS -I$szlib_inc" AM_CPPFLAGS="$AM_CPPFLAGS -I$szlib_inc" fi - + AC_CHECK_HEADERS([szlib.h], [HAVE_SZLIB_H="yes"], [CPPFLAGS="$saved_CPPFLAGS"; AM_CPPFLAGS="$saved_AM_CPPFLAGS"] [unset HAVE_SZLIB]) @@ -1449,7 +1449,7 @@ case $withval in LDFLAGS="$LDFLAGS -L$szlib_lib" AM_LDFLAGS="$AM_LDFLAGS -L$szlib_lib" fi - + if test "x$HAVE_SZLIB" = "xyes" -a "x$HAVE_SZLIB_H" = "xyes"; then AC_CHECK_LIB([sz], [SZ_BufftoBuffCompress],, [LDFLAGS="$saved_LDFLAGS"; AM_LDFLAGS="$saved_AM_LDFLAGS"; unset HAVE_SZLIB]) @@ -1466,7 +1466,7 @@ if test "x$HAVE_SZLIB" = "xyes" -a "x$HAVE_SZLIB_H" = "xyes"; then AC_MSG_CHECKING([for szlib encoder]) ## Set LD_LIBRARY_PATH so encoder test can find the library and run. - ## Also add LL_PATH substitution to Makefiles so they can use the + ## Also add LL_PATH substitution to Makefiles so they can use the ## path as well, for testing examples. if test -z "$LD_LIBRARY_PATH"; then export LD_LIBRARY_PATH="$szlib_lib" @@ -1489,25 +1489,25 @@ if test "x$HAVE_SZLIB" = "xyes" -a "x$HAVE_SZLIB_H" = "xyes"; then ]])] , [hdf5_cv_szlib_can_encode=yes], [hdf5_cv_szlib_can_encode=no],)] ) - - AC_DEFINE([HAVE_FILTER_SZIP], [1], + + AC_DEFINE([HAVE_FILTER_SZIP], [1], [Define if support for szip filter is enabled]) USE_FILTER_SZIP="yes" if test ${hdf5_cv_szlib_can_encode} = "yes"; then AC_MSG_RESULT([yes]) - fi + fi if test ${hdf5_cv_szlib_can_encode} = "no"; then AC_MSG_RESULT([no]) - fi - + fi + ## Add "szip" to external filter list if test ${hdf5_cv_szlib_can_encode} = "yes"; then if test "X$EXTERNAL_FILTERS" != "X"; then EXTERNAL_FILTERS="${EXTERNAL_FILTERS}," fi EXTERNAL_FILTERS="${EXTERNAL_FILTERS}szip(encoder)" - fi + fi if test ${hdf5_cv_szlib_can_encode} = "no"; then if test "X$EXTERNAL_FILTERS" != "X"; then EXTERNAL_FILTERS="${EXTERNAL_FILTERS}," @@ -1560,7 +1560,7 @@ case "X-$THREADSAFE" in AC_MSG_RESULT([no]) ;; X-yes) - THREADSAFE=yes + THREADSAFE=yes AC_MSG_RESULT([yes]) ;; *) @@ -1867,7 +1867,7 @@ for hdf5_cv_printf_ll in l ll L q unknown; do done]) AC_MSG_RESULT([%${hdf5_cv_printf_ll}d and %${hdf5_cv_printf_ll}u]) -AC_DEFINE_UNQUOTED([PRINTF_LL_WIDTH], ["$hdf5_cv_printf_ll"], +AC_DEFINE_UNQUOTED([PRINTF_LL_WIDTH], ["$hdf5_cv_printf_ll"], [Width for printf() for type `long long' or `__int64', use `ll']) @@ -2186,7 +2186,7 @@ if test -n "$PARALLEL"; then fi ## If RUNSERIAL or RUNPARALLEL is the word `none' then replace it with - ## the empty string. This means that no launch commands were requested, + ## the empty string. This means that no launch commands were requested, ## so we will not use any launch commands. if test "X$RUNSERIAL" = "Xnone"; then RUNSERIAL="" @@ -2252,7 +2252,7 @@ if test -n "$PARALLEL"; then fi ;; esac - + if test -n "$mpe_inc"; then saved_CPPFLAGS="$CPPFLAGS" saved_AM_CPPFLAGS="$AM_CPPFLAGS" @@ -2262,7 +2262,7 @@ if test -n "$PARALLEL"; then else AC_CHECK_HEADERS([mpe.h],, [unset MPE]) fi - + if test -n "$mpe_lib"; then saved_LDFLAGS="$LDFLAGS" saved_AM_LDFLAGS="$AM_LDFLAGS" @@ -2347,12 +2347,12 @@ AC_DEFINE_UNQUOTED([DEFAULT_PLUGINDIR], ["$default_plugindir"], ## Decide whether the presence of user's exception handling functions is ## checked and data conversion exceptions are returned. This is mainly ## for the speed optimization of hard conversions. Soft conversions can -## actually benefit little. +## actually benefit little. ## AC_MSG_CHECKING([whether exception handling functions is checked during data conversions]) AC_ARG_ENABLE([dconv-exception], [AS_HELP_STRING([--enable-dconv-exception], - [if exception handling functions is checked during + [if exception handling functions is checked during data conversions [default=yes]])], [DCONV_EXCEPTION=$enableval], [DCONV_EXCEPTION=yes]) @@ -2406,9 +2406,9 @@ esac ## ---------------------------------------------------------------------- ## Set the flag to indicate that the machine is using a special algorithm to convert -## 'long double' to '(unsigned) long' values. (This flag should only be set for -## the IBM Power6 Linux. When the bit sequence of long double is -## 0x4351ccf385ebc8a0bfcc2a3c3d855620, the converted value of (unsigned)long +## 'long double' to '(unsigned) long' values. (This flag should only be set for +## the IBM Power6 Linux. When the bit sequence of long double is +## 0x4351ccf385ebc8a0bfcc2a3c3d855620, the converted value of (unsigned)long ## is 0x004733ce17af227f, not the same as the library's conversion to 0x004733ce17af2282. ## The machine's conversion gets the correct value. We define the macro and disable ## this kind of test until we figure out what algorithm they use. @@ -2429,12 +2429,12 @@ else unsigned char s[16]; unsigned char s2[8]; int ret = 1; - + if(sizeof(long double) == 16 && sizeof(long) == 8) { - /*make sure the long double type has 16 bytes in size and + /*make sure the long double type has 16 bytes in size and * 11 bits of exponent. If it is, - *the bit sequence should be like below. It's not - *a decent way to check but this info isn't available. */ + *the bit sequence should be like below. It's not + *a decent way to check but this info isn't available. */ memcpy(s, &ld, 16); if(s[0]==0x43 && s[1]==0x51 && s[2]==0xcc && s[3]==0xf3 && s[4]==0x85 && s[5]==0xeb && s[6]==0xc8 && s[7]==0xa0 && @@ -2468,8 +2468,8 @@ else if(s2[0]==0x00 && s2[1]==0x47 && s2[2]==0x33 && s2[3]==0xce && s2[4]==0x17 && s2[5]==0xaf && s2[6]==0x22 && s2[7]==0x7f) ret = 0; - } - } + } + } exit(ret); ]])] , [hdf5_cv_ldouble_to_long_special=yes], [hdf5_cv_ldouble_to_long_special=no],)]) @@ -2485,10 +2485,10 @@ fi ## ---------------------------------------------------------------------- ## Set the flag to indicate that the machine is using a special algorithm -## to convert some values of '(unsigned) long' to 'long double' values. -## (This flag should be off for all machines, except for IBM Power6 Linux, -## when the bit sequences are 003fff..., 007fff..., 00ffff..., 01ffff..., -## ..., 7fffff..., the compiler uses a unknown algorithm. We define a +## to convert some values of '(unsigned) long' to 'long double' values. +## (This flag should be off for all machines, except for IBM Power6 Linux, +## when the bit sequences are 003fff..., 007fff..., 00ffff..., 01ffff..., +## ..., 7fffff..., the compiler uses a unknown algorithm. We define a ## macro and skip the test for now until we know about the algorithm. ## AC_MSG_CHECKING([if using special algorithm to convert (unsigned) long to long double values]) @@ -2506,17 +2506,17 @@ else unsigned long ull; unsigned char s[16]; int flag=0, ret=1; - + /*Determine if long double has 16 byte in size, 11 bit exponent, and - *the bias is 0x3ff */ - if(sizeof(long double) == 16) { + *the bias is 0x3ff */ + if(sizeof(long double) == 16) { ld = 1.0L; memcpy(s, &ld, 16); if(s[0]==0x3f && s[1]==0xf0 && s[2]==0x00 && s[3]==0x00 && - s[4]==0x00 && s[5]==0x00 && s[6]==0x00 && s[7]==0x00) - flag = 1; + s[4]==0x00 && s[5]==0x00 && s[6]==0x00 && s[7]==0x00) + flag = 1; } - + if(flag==1 && sizeof(long)==8) { ll = 0x003fffffffffffffL; ld = (long double)ll; @@ -2532,7 +2532,7 @@ else s[8]==0xbf && s[9]==0xf0 && s[10]==0x00 && s[11]==0x00 && s[12]==0x00 && s[13]==0x00 && s[14]==0x00 && s[15]==0x00) ret = 0; - } + } if(flag==1 && sizeof(unsigned long)==8) { ull = 0xffffffffffffffffUL; ld = (long double)ull; @@ -2550,7 +2550,7 @@ else s[8]==0xbf && s[9]==0xf0 && s[10]==0x00 && s[11]==0x00 && s[12]==0x00 && s[13]==0x00 && s[14]==0x00 && s[15]==0x00) ret = 0; - } + } exit(ret); ]])] , [hdf5_cv_long_to_ldouble_special=yes], [hdf5_cv_long_to_ldouble_special=no],)]) diff --git a/src/H5D.c b/src/H5D.c index f06ec9b..6183ec5 100644 --- a/src/H5D.c +++ b/src/H5D.c @@ -323,14 +323,9 @@ hid_t H5Dopen2(hid_t loc_id, const char *name, hid_t dapl_id) { H5D_t *dset = NULL; - H5G_loc_t loc; /* Object location of group */ - H5G_loc_t dset_loc; /* Object location of dataset */ - H5G_name_t path; /* Dataset group hier. path */ - H5O_loc_t oloc; /* Dataset object location */ - H5O_type_t obj_type; /* Type of object at location */ - hbool_t loc_found = FALSE; /* Location at 'name' found */ - hid_t dxpl_id = H5AC_ind_dxpl_id; /* dxpl to use to open datset */ - hid_t ret_value; + H5G_loc_t loc; /* Object location of group */ + hid_t dxpl_id = H5AC_ind_dxpl_id; /* dxpl to use to open datset */ + hid_t ret_value; FUNC_ENTER_API(FAIL) H5TRACE3("i", "i*si", loc_id, name, dapl_id); @@ -348,41 +343,18 @@ H5Dopen2(hid_t loc_id, const char *name, hid_t dapl_id) if(TRUE != H5P_isa_class(dapl_id, H5P_DATASET_ACCESS)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not dataset access property list") - /* Set up dataset location to fill in */ - dset_loc.oloc = &oloc; - dset_loc.path = &path; - H5G_loc_reset(&dset_loc); - - /* Find the dataset object */ - if(H5G_loc_find(&loc, name, &dset_loc, dapl_id, dxpl_id) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_NOTFOUND, FAIL, "not found") - loc_found = TRUE; - - /* Check that the object found is the correct type */ - if(H5O_obj_type(&oloc, &obj_type, dxpl_id) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get object type") - if(obj_type != H5O_TYPE_DATASET) - HGOTO_ERROR(H5E_DATASET, H5E_BADTYPE, FAIL, "not a dataset") - /* Open the dataset */ - if(NULL == (dset = H5D_open(&dset_loc, dapl_id, dxpl_id))) - HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't open dataset") + if(NULL == (dset = H5D__open_name(&loc, name, dapl_id, dxpl_id))) + HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENOBJ, FAIL, "unable to open dataset") /* Register an atom for the dataset */ if((ret_value = H5I_register(H5I_DATASET, dset, TRUE)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "can't register dataset atom") done: - if(ret_value < 0) { - if(dset) { - if(H5D_close(dset) < 0) - HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release dataset") - } /* end if */ - else { - if(loc_found && H5G_loc_free(&dset_loc) < 0) - HDONE_ERROR(H5E_DATASET, H5E_CANTRELEASE, FAIL, "can't free location") - } /* end else */ - } /* end if */ + if(ret_value < 0) + if(dset && H5D_close(dset) < 0) + HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release dataset") FUNC_LEAVE_API(ret_value) } /* end H5Dopen2() */ diff --git a/src/H5Ddeprec.c b/src/H5Ddeprec.c index 3da6b95..cd2bc84 100644 --- a/src/H5Ddeprec.c +++ b/src/H5Ddeprec.c @@ -226,15 +226,10 @@ hid_t H5Dopen1(hid_t loc_id, const char *name) { H5D_t *dset = NULL; - H5G_loc_t loc; /* Object location of group */ - H5G_loc_t dset_loc; /* Object location of dataset */ - H5G_name_t path; /* Dataset group hier. path */ - H5O_loc_t oloc; /* Dataset object location */ - H5O_type_t obj_type; /* Type of object at location */ - hbool_t loc_found = FALSE; /* Location at 'name' found */ - hid_t dapl_id = H5P_DATASET_ACCESS_DEFAULT; /* dapl to use to open dataset */ - hid_t dxpl_id = H5AC_ind_dxpl_id; /* dxpl to use to open datset */ - hid_t ret_value; + H5G_loc_t loc; /* Object location of group */ + hid_t dapl_id = H5P_DATASET_ACCESS_DEFAULT; /* dapl to use to open dataset */ + hid_t dxpl_id = H5AC_ind_dxpl_id; /* dxpl to use to open datset */ + hid_t ret_value; FUNC_ENTER_API(FAIL) H5TRACE2("i", "i*s", loc_id, name); @@ -245,41 +240,18 @@ H5Dopen1(hid_t loc_id, const char *name) if(!name || !*name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name") - /* Set up dataset location to fill in */ - dset_loc.oloc = &oloc; - dset_loc.path = &path; - H5G_loc_reset(&dset_loc); - - /* Find the dataset object */ - if(H5G_loc_find(&loc, name, &dset_loc, H5P_DEFAULT, dxpl_id) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_NOTFOUND, FAIL, "not found") - loc_found = TRUE; - - /* Check that the object found is the correct type */ - if(H5O_obj_type(&oloc, &obj_type, dxpl_id) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get object type") - if(obj_type != H5O_TYPE_DATASET) - HGOTO_ERROR(H5E_DATASET, H5E_BADTYPE, FAIL, "not a dataset") - /* Open the dataset */ - if(NULL == (dset = H5D_open(&dset_loc, dapl_id, dxpl_id))) - HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't open dataset") + if(NULL == (dset = H5D__open_name(&loc, name, dapl_id, dxpl_id))) + HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENOBJ, FAIL, "unable to open dataset") /* Register an atom for the dataset */ if((ret_value = H5I_register(H5I_DATASET, dset, TRUE)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "can't register dataset atom") done: - if(ret_value < 0) { - if(dset != NULL) { - if(H5D_close(dset) < 0) - HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release dataset") - } /* end if */ - else { - if(loc_found && H5G_loc_free(&dset_loc) < 0) - HDONE_ERROR(H5E_SYM, H5E_CANTRELEASE, FAIL, "can't free location") - } /* end else */ - } /* end if */ + if(ret_value < 0) + if(dset && H5D_close(dset) < 0) + HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release dataset") FUNC_LEAVE_API(ret_value) } /* end H5Dopen1() */ diff --git a/src/H5Dint.c b/src/H5Dint.c index 53cd86a..b41e5a8 100644 --- a/src/H5Dint.c +++ b/src/H5Dint.c @@ -1091,7 +1091,7 @@ H5D__create(H5F_t *file, hid_t type_id, const H5S_t *space, hid_t dcpl_id, HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to initialize I/O operations") /* Create the layout information for the new dataset */ - if((new_dset->shared->layout.ops->construct)(file, new_dset) < 0) + if(new_dset->shared->layout.ops->construct && (new_dset->shared->layout.ops->construct)(file, new_dset) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to construct layout information") /* Update the dataset's object header info. */ @@ -1144,6 +1144,69 @@ done: } /* end H5D__create() */ +/*------------------------------------------------------------------------- + * Function: H5D__open_name + * + * Purpose: Opens an existing dataset by name. + * + * Return: Success: Ptr to a new dataset. + * Failure: NULL + * + * Programmer: Neil Fortner + * Friday, March 6, 2015 + * + *------------------------------------------------------------------------- + */ +H5D_t * +H5D__open_name(const H5G_loc_t *loc, const char *name, hid_t dapl_id, + hid_t dxpl_id) +{ + H5D_t *dset = NULL; + H5G_loc_t dset_loc; /* Object location of dataset */ + H5G_name_t path; /* Dataset group hier. path */ + H5O_loc_t oloc; /* Dataset object location */ + H5O_type_t obj_type; /* Type of object at location */ + hbool_t loc_found = FALSE; /* Location at 'name' found */ + H5D_t *ret_value; /* Return value */ + + FUNC_ENTER_PACKAGE + + /* Check args */ + HDassert(loc); + HDassert(name); + + /* Set up dataset location to fill in */ + dset_loc.oloc = &oloc; + dset_loc.path = &path; + H5G_loc_reset(&dset_loc); + + /* Find the dataset object */ + if(H5G_loc_find(loc, name, &dset_loc, dapl_id, dxpl_id) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_NOTFOUND, NULL, "not found") + loc_found = TRUE; + + /* Check that the object found is the correct type */ + if(H5O_obj_type(&oloc, &obj_type, dxpl_id) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, NULL, "can't get object type") + if(obj_type != H5O_TYPE_DATASET) + HGOTO_ERROR(H5E_DATASET, H5E_BADTYPE, NULL, "not a dataset") + + /* Open the dataset */ + if(NULL == (dset = H5D_open(&dset_loc, dapl_id, dxpl_id))) + HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "can't open dataset") + + /* Set return value */ + ret_value = dset; + +done: + if(!ret_value) + if(loc_found && H5G_loc_free(&dset_loc) < 0) + HDONE_ERROR(H5E_DATASET, H5E_CANTRELEASE, NULL, "can't free location") + + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5D__open_name() */ + + /* *------------------------------------------------------------------------- * Function: H5D_open @@ -2206,6 +2269,7 @@ H5D__set_extent(H5D_t *dset, const hsize_t *size, hid_t dxpl_id) { hsize_t curr_dims[H5S_MAX_RANK]; /* Current dimension sizes */ htri_t changed; /* Whether the dataspace changed size */ + size_t u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE_TAG(dxpl_id, dset->oloc.addr, FAIL) @@ -2241,10 +2305,9 @@ H5D__set_extent(H5D_t *dset, const hsize_t *size, hid_t dxpl_id) hbool_t shrink = FALSE; /* Flag to indicate a dimension has shrank */ hbool_t expand = FALSE; /* Flag to indicate a dimension has grown */ hbool_t update_chunks = FALSE; /* Flag to indicate chunk cache update is needed */ - unsigned u; /* Local index variable */ /* Determine if we are shrinking and/or expanding any dimensions */ - for(u = 0; u < dset->shared->ndims; u++) { + for(u = 0; u < (size_t)dset->shared->ndims; u++) { /* Check for various status changes */ if(size[u] < curr_dims[u]) shrink = TRUE; @@ -2815,3 +2878,4 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D_get_type() */ + diff --git a/src/H5Dpkg.h b/src/H5Dpkg.h index 1476229..7aeba5d 100644 --- a/src/H5Dpkg.h +++ b/src/H5Dpkg.h @@ -535,6 +535,8 @@ H5_DLL H5D_t *H5D__create(H5F_t *file, hid_t type_id, const H5S_t *space, H5_DLL H5D_t *H5D__create_named(const H5G_loc_t *loc, const char *name, hid_t type_id, const H5S_t *space, hid_t lcpl_id, hid_t dcpl_id, hid_t dapl_id, hid_t dxpl_id); +H5_DLL H5D_t *H5D__open_name(const H5G_loc_t *loc, const char *name, + hid_t dapl_id, hid_t dxpl_id); H5_DLL herr_t H5D__get_space_status(H5D_t *dset, H5D_space_status_t *allocation, hid_t dxpl_id); H5_DLL herr_t H5D__alloc_storage(const H5D_t *dset, hid_t dxpl_id, H5D_time_alloc_t time_alloc, @@ -605,7 +607,6 @@ H5_DLL herr_t H5D__contig_copy(H5F_t *f_src, const H5O_storage_contig_t *storage H5_DLL herr_t H5D__contig_delete(H5F_t *f, hid_t dxpl_id, const H5O_storage_t *store); - /* Functions that operate on chunked dataset storage */ H5_DLL htri_t H5D__chunk_cacheable(const H5D_io_info_t *io_info, haddr_t caddr, hbool_t write_op); diff --git a/src/H5Olayout.c b/src/H5Olayout.c index 8821694..b499e31 100644 --- a/src/H5Olayout.c +++ b/src/H5Olayout.c @@ -190,7 +190,7 @@ H5O_layout_decode(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED * } /* end if */ else { /* Layout class */ - mesg->type = (H5D_layout_t)*p++; + mesg->type = mesg->storage.type = (H5D_layout_t)*p++; /* Interpret the rest of the message according to the layout class */ switch(mesg->type) { @@ -686,7 +686,7 @@ H5O_layout_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const vo FILE * stream, int indent, int fwidth) { const H5O_layout_t *mesg = (const H5O_layout_t *) _mesg; - unsigned u; + size_t u; FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -709,7 +709,7 @@ H5O_layout_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const vo "Number of dimensions:", (unsigned long)(mesg->u.chunk.ndims)); HDfprintf(stream, "%*s%-*s {", indent, "", fwidth, "Size:"); - for(u = 0; u < mesg->u.chunk.ndims; u++) + for(u = 0; u < (size_t)mesg->u.chunk.ndims; u++) HDfprintf(stream, "%s%lu", u ? ", " : "", (unsigned long)(mesg->u.chunk.dim[u])); HDfprintf(stream, "}\n"); diff --git a/src/H5Pdcpl.c b/src/H5Pdcpl.c index 9bf58e4..fe13ac5 100644 --- a/src/H5Pdcpl.c +++ b/src/H5Pdcpl.c @@ -478,7 +478,7 @@ static herr_t H5P__dcrt_layout_dec(const void **_pp, void *value) { const H5O_layout_t *layout; /* Storage layout */ - H5O_layout_t chunk_layout; /* Layout structure for chunk info */ + H5O_layout_t tmp_layout; /* Temporary local layout structure */ H5D_layout_t type; /* Layout type */ const uint8_t **pp = (const uint8_t **)_pp; herr_t ret_value = SUCCEED; /* Return value */ @@ -518,15 +518,15 @@ H5P__dcrt_layout_dec(const void **_pp, void *value) unsigned u; /* Local index variable */ /* Initialize to default values */ - chunk_layout = H5D_def_layout_chunk_g; + tmp_layout = H5D_def_layout_chunk_g; /* Set rank & dimensions */ - chunk_layout.u.chunk.ndims = (unsigned)ndims; + tmp_layout.u.chunk.ndims = (unsigned)ndims; for(u = 0; u < ndims; u++) - UINT32DECODE(*pp, chunk_layout.u.chunk.dim[u]) + UINT32DECODE(*pp, tmp_layout.u.chunk.dim[u]) /* Point at the newly set up struct */ - layout = &chunk_layout; + layout = &tmp_layout; } /* end else */ } break; @@ -1185,8 +1185,10 @@ H5P__init_def_layout(void) FUNC_ENTER_STATIC_NOERR /* Initialize the default layout info for non-contigous layouts */ + H5D_def_layout_compact_g.storage.type = H5D_COMPACT; H5D_def_layout_compact_g.storage.u.compact = def_store_compact; H5D_def_layout_chunk_g.u.chunk = def_layout_chunk; + H5D_def_layout_chunk_g.storage.type = H5D_CHUNKED; H5D_def_layout_chunk_g.storage.u.chunk = def_store_chunk; /* Note that we've initialized the default values */ diff --git a/tools/h5dump/errfiles/tdset-2.err b/tools/h5dump/errfiles/tdset-2.err index d9b92f3..775351e 100644 --- a/tools/h5dump/errfiles/tdset-2.err +++ b/tools/h5dump/errfiles/tdset-2.err @@ -1,17 +1,20 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): - #000: (file name) line (number) in H5Dopen2(): not found + #000: (file name) line (number) in H5Dopen2(): unable to open dataset + major: Dataset + minor: Can't open object + #001: (file name) line (number) in H5D__open_name(): not found major: Dataset minor: Object not found - #001: (file name) line (number) in H5G_loc_find(): can't find object + #002: (file name) line (number) in H5G_loc_find(): can't find object major: Symbol table minor: Object not found - #002: (file name) line (number) in H5G_traverse(): internal path traversal failed + #003: (file name) line (number) in H5G_traverse(): internal path traversal failed major: Symbol table minor: Object not found - #003: (file name) line (number) in H5G_traverse_real(): traversal operator failed + #004: (file name) line (number) in H5G_traverse_real(): traversal operator failed major: Symbol table minor: Callback failed - #004: (file name) line (number) in H5G_loc_find_cb(): object 'dset3' doesn't exist + #005: (file name) line (number) in H5G_loc_find_cb(): object 'dset3' doesn't exist major: Symbol table minor: Object not found HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): diff --git a/tools/h5dump/errfiles/tperror.err b/tools/h5dump/errfiles/tperror.err index 19a7a73..29f9e7f 100644 --- a/tools/h5dump/errfiles/tperror.err +++ b/tools/h5dump/errfiles/tperror.err @@ -1,17 +1,20 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): - #000: (file name) line (number) in H5Dopen2(): not found + #000: (file name) line (number) in H5Dopen2(): unable to open dataset + major: Dataset + minor: Can't open object + #001: (file name) line (number) in H5D__open_name(): not found major: Dataset minor: Object not found - #001: (file name) line (number) in H5G_loc_find(): can't find object + #002: (file name) line (number) in H5G_loc_find(): can't find object major: Symbol table minor: Object not found - #002: (file name) line (number) in H5G_traverse(): internal path traversal failed + #003: (file name) line (number) in H5G_traverse(): internal path traversal failed major: Symbol table minor: Object not found - #003: (file name) line (number) in H5G_traverse_real(): traversal operator failed + #004: (file name) line (number) in H5G_traverse_real(): traversal operator failed major: Symbol table minor: Callback failed - #004: (file name) line (number) in H5G_loc_find_cb(): object 'bogus' doesn't exist + #005: (file name) line (number) in H5G_loc_find_cb(): object 'bogus' doesn't exist major: Symbol table minor: Object not found HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): diff --git a/tools/h5dump/errfiles/tslink-D.err b/tools/h5dump/errfiles/tslink-D.err index b98e324..924e9cf 100644 --- a/tools/h5dump/errfiles/tslink-D.err +++ b/tools/h5dump/errfiles/tslink-D.err @@ -1,25 +1,28 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): - #000: (file name) line (number) in H5Dopen2(): not found + #000: (file name) line (number) in H5Dopen2(): unable to open dataset + major: Dataset + minor: Can't open object + #001: (file name) line (number) in H5D__open_name(): not found major: Dataset minor: Object not found - #001: (file name) line (number) in H5G_loc_find(): can't find object + #002: (file name) line (number) in H5G_loc_find(): can't find object major: Symbol table minor: Object not found - #002: (file name) line (number) in H5G_traverse(): internal path traversal failed + #003: (file name) line (number) in H5G_traverse(): internal path traversal failed major: Symbol table minor: Object not found - #003: (file name) line (number) in H5G_traverse_real(): special link traversal failed + #004: (file name) line (number) in H5G_traverse_real(): special link traversal failed major: Links minor: Link traversal failure - #004: (file name) line (number) in H5G__traverse_special(): symbolic link traversal failed + #005: (file name) line (number) in H5G__traverse_special(): symbolic link traversal failed major: Links minor: Link traversal failure - #005: (file name) line (number) in H5G_traverse_slink(): unable to follow symbolic link + #006: (file name) line (number) in H5G_traverse_slink(): unable to follow symbolic link major: Symbol table minor: Object not found - #006: (file name) line (number) in H5G_traverse_real(): traversal operator failed + #007: (file name) line (number) in H5G_traverse_real(): traversal operator failed major: Symbol table minor: Callback failed - #007: (file name) line (number) in H5G_traverse_slink_cb(): component not found + #008: (file name) line (number) in H5G_traverse_slink_cb(): component not found major: Symbol table minor: Object not found -- cgit v0.12 From d001bbde049a81e12d521903ae79de1f97ab2039 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Fri, 28 Aug 2015 21:11:57 -0500 Subject: [svn-r27613] Description: Align w/vds branch: Move code for initializing contiguous datasets into layout 'init' callback. Tested on: MacOSX/64 10.10.5 (amazon) w/serial & parallel (h5committest forthcoming) --- src/H5Dchunk.c | 6 +++-- src/H5Dcontig.c | 76 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++- src/H5Dlayout.c | 65 +++--------------------------------------------- src/H5Dpkg.h | 2 -- 4 files changed, 82 insertions(+), 67 deletions(-) diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c index af5123c..f54fa8e 100644 --- a/src/H5Dchunk.c +++ b/src/H5Dchunk.c @@ -192,6 +192,8 @@ typedef struct H5D_chunk_coll_info_t { /* Chunked layout operation callbacks */ static herr_t H5D__chunk_construct(H5F_t *f, H5D_t *dset); +static herr_t H5D__chunk_init(H5F_t *f, hid_t dxpl_id, const H5D_t *dset, + hid_t dapl_id); static herr_t H5D__chunk_io_init(const H5D_io_info_t *io_info, const H5D_type_info_t *type_info, hsize_t nelmts, const H5S_t *file_space, const H5S_t *mem_space, H5D_chunk_map_t *fm); @@ -585,7 +587,7 @@ done: * *------------------------------------------------------------------------- */ -herr_t +static herr_t H5D__chunk_init(H5F_t *f, hid_t dxpl_id, const H5D_t *dset, hid_t dapl_id) { H5D_chk_idx_info_t idx_info; /* Chunked index info */ @@ -593,7 +595,7 @@ H5D__chunk_init(H5F_t *f, hid_t dxpl_id, const H5D_t *dset, hid_t dapl_id) H5P_genplist_t *dapl; /* Data access property list object pointer */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_PACKAGE + FUNC_ENTER_STATIC /* Sanity check */ HDassert(f); diff --git a/src/H5Dcontig.c b/src/H5Dcontig.c index 29ab1ff..fb3ac85 100644 --- a/src/H5Dcontig.c +++ b/src/H5Dcontig.c @@ -96,6 +96,8 @@ typedef struct H5D_contig_writevv_ud_t { /* Layout operation callbacks */ static herr_t H5D__contig_construct(H5F_t *f, H5D_t *dset); +static herr_t H5D__contig_init(H5F_t *f, hid_t dxpl_id, const H5D_t *dset, + hid_t dapl_id); static herr_t H5D__contig_io_init(const H5D_io_info_t *io_info, const H5D_type_info_t *type_info, hsize_t nelmts, const H5S_t *file_space, const H5S_t *mem_space, H5D_chunk_map_t *cm); @@ -119,7 +121,7 @@ static herr_t H5D__contig_write_one(H5D_io_info_t *io_info, hsize_t offset, /* Contiguous storage layout I/O ops */ const H5D_layout_ops_t H5D_LOPS_CONTIG[1] = {{ H5D__contig_construct, - NULL, + H5D__contig_init, H5D__contig_is_space_alloc, H5D__contig_io_init, H5D__contig_read, @@ -451,6 +453,78 @@ done: /*------------------------------------------------------------------------- + * Function: H5D__contig_init + * + * Purpose: Initialize the contiguous info for a dataset. This is + * called when the dataset is initialized. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Quincey Koziol + * Friday, August 28, 2015 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5D__contig_init(H5F_t *f, hid_t dxpl_id, const H5D_t *dset, hid_t dapl_id) +{ + hsize_t tmp_size; /* Temporary holder for raw data size */ + size_t tmp_sieve_buf_size; /* Temporary holder for sieve buffer size */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_STATIC + + /* Sanity check */ + HDassert(f); + HDassert(dset); + + /* Compute the size of the contiguous storage for versions of the + * layout message less than version 3 because versions 1 & 2 would + * truncate the dimension sizes to 32-bits of information. - QAK 5/26/04 + */ + if(dset->shared->layout.version < 3) { + hssize_t snelmts; /* Temporary holder for number of elements in dataspace */ + hsize_t nelmts; /* Number of elements in dataspace */ + size_t dt_size; /* Size of datatype */ + + /* Retrieve the number of elements in the dataspace */ + if((snelmts = H5S_GET_EXTENT_NPOINTS(dset->shared->space)) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "unable to retrieve number of elements in dataspace") + nelmts = (hsize_t)snelmts; + + /* Get the datatype's size */ + if(0 == (dt_size = H5T_GET_SIZE(dset->shared->type))) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "unable to retrieve size of datatype") + + /* Compute the size of the dataset's contiguous storage */ + tmp_size = nelmts * dt_size; + + /* Check for overflow during multiplication */ + if(nelmts != (tmp_size / dt_size)) + HGOTO_ERROR(H5E_DATASET, H5E_OVERFLOW, FAIL, "size of dataset's storage overflowed") + + /* Assign the dataset's contiguous storage size */ + dset->shared->layout.storage.u.contig.size = tmp_size; + } /* end if */ + else + tmp_size = dset->shared->layout.storage.u.contig.size; + + /* Get the sieve buffer size for the file */ + tmp_sieve_buf_size = H5F_SIEVE_BUF_SIZE(dset->oloc.file); + + /* Adjust the sieve buffer size to the smaller one between the dataset size and the buffer size + * from the file access property. (SLU - 2012/3/30) */ + if(tmp_size < tmp_sieve_buf_size) + dset->shared->cache.contig.sieve_buf_size = tmp_size; + else + dset->shared->cache.contig.sieve_buf_size = tmp_sieve_buf_size; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5D__contig_init() */ + + +/*------------------------------------------------------------------------- * Function: H5D__contig_is_space_alloc * * Purpose: Query if space is allocated for layout diff --git a/src/H5Dlayout.c b/src/H5Dlayout.c index 01898f2..e9dfb03 100644 --- a/src/H5Dlayout.c +++ b/src/H5Dlayout.c @@ -382,68 +382,9 @@ H5D__layout_oh_read(H5D_t *dataset, hid_t dxpl_id, hid_t dapl_id, H5P_genplist_t if(H5D_CHUNKED == dataset->shared->layout.type) dataset->shared->layout.u.chunk.ndims++; - switch(dataset->shared->layout.type) { - case H5D_CONTIGUOUS: - { - hsize_t tmp_size; /* Temporary holder for raw data size */ - size_t tmp_sieve_buf_size; /* Temporary holder for sieve buffer size */ - - /* Compute the size of the contiguous storage for versions of the - * layout message less than version 3 because versions 1 & 2 would - * truncate the dimension sizes to 32-bits of information. - QAK 5/26/04 - */ - if(dataset->shared->layout.version < 3) { - hssize_t snelmts; /* Temporary holder for number of elements in dataspace */ - hsize_t nelmts; /* Number of elements in dataspace */ - size_t dt_size; /* Size of datatype */ - - /* Retrieve the number of elements in the dataspace */ - if((snelmts = H5S_GET_EXTENT_NPOINTS(dataset->shared->space)) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "unable to retrieve number of elements in dataspace") - nelmts = (hsize_t)snelmts; - - /* Get the datatype's size */ - if(0 == (dt_size = H5T_GET_SIZE(dataset->shared->type))) - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "unable to retrieve size of datatype") - - /* Compute the size of the dataset's contiguous storage */ - tmp_size = nelmts * dt_size; - - /* Check for overflow during multiplication */ - if(nelmts != (tmp_size / dt_size)) - HGOTO_ERROR(H5E_DATASET, H5E_OVERFLOW, FAIL, "size of dataset's storage overflowed") - - /* Assign the dataset's contiguous storage size */ - dataset->shared->layout.storage.u.contig.size = tmp_size; - } else - tmp_size = dataset->shared->layout.storage.u.contig.size; - - /* Get the sieve buffer size for the file */ - tmp_sieve_buf_size = H5F_SIEVE_BUF_SIZE(dataset->oloc.file); - - /* Adjust the sieve buffer size to the smaller one between the dataset size and the buffer size - * from the file access property. (SLU - 2012/3/30) */ - if(tmp_size < tmp_sieve_buf_size) - dataset->shared->cache.contig.sieve_buf_size = tmp_size; - else - dataset->shared->cache.contig.sieve_buf_size = tmp_sieve_buf_size; - } - break; - - case H5D_CHUNKED: - /* Initialize the chunk cache for the dataset */ - if(H5D__chunk_init(dataset->oloc.file, dxpl_id, dataset, dapl_id) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't initialize chunk cache") - break; - - case H5D_COMPACT: - break; - - case H5D_LAYOUT_ERROR: - case H5D_NLAYOUTS: - default: - HGOTO_ERROR(H5E_DATASET, H5E_UNSUPPORTED, FAIL, "unknown storage method") - } /* end switch */ /*lint !e788 All appropriate cases are covered */ + /* Initialize the layout information for the dataset */ + if(dataset->shared->layout.ops->init && (dataset->shared->layout.ops->init)(dataset->oloc.file, dxpl_id, dataset, dapl_id) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize layout information") done: FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5Dpkg.h b/src/H5Dpkg.h index 7aeba5d..6e9a6a7 100644 --- a/src/H5Dpkg.h +++ b/src/H5Dpkg.h @@ -612,8 +612,6 @@ H5_DLL htri_t H5D__chunk_cacheable(const H5D_io_info_t *io_info, haddr_t caddr, hbool_t write_op); H5_DLL herr_t H5D__chunk_create(const H5D_t *dset /*in,out*/, hid_t dxpl_id); H5_DLL herr_t H5D__chunk_set_info(const H5D_t *dset); -H5_DLL herr_t H5D__chunk_init(H5F_t *f, hid_t dxpl_id, const H5D_t *dset, - hid_t dapl_id); H5_DLL hbool_t H5D__chunk_is_space_alloc(const H5O_storage_t *storage); H5_DLL herr_t H5D__chunk_lookup(const H5D_t *dset, hid_t dxpl_id, const hsize_t *scaled, H5D_chunk_ud_t *udata); -- cgit v0.12 From 1103585dc13cd4aa3bb2a05b6e2232fb1fbd72bd Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Fri, 28 Aug 2015 21:18:41 -0500 Subject: [svn-r27614] Description: Align w/vds branch: Change code in H5O_layout_copy() to use switch for different types of dataset layouts. Tested on: MacOSX/64 10.10.5 (amazon) w/serial & parallel (h5committest forthcoming) --- src/H5Olayout.c | 40 ++++++++++++++++++++++++++++------------ 1 file changed, 28 insertions(+), 12 deletions(-) diff --git a/src/H5Olayout.c b/src/H5Olayout.c index b499e31..b38d2a9 100644 --- a/src/H5Olayout.c +++ b/src/H5Olayout.c @@ -389,19 +389,35 @@ H5O_layout_copy(const void *_mesg, void *_dest) /* copy */ *dest = *mesg; - /* Deep copy the buffer for compact datasets also */ - if(mesg->type == H5D_COMPACT && mesg->storage.u.compact.size > 0) { - /* Allocate memory for the raw data */ - if(NULL == (dest->storage.u.compact.buf = H5MM_malloc(dest->storage.u.compact.size))) - HGOTO_ERROR(H5E_OHDR, H5E_NOSPACE, NULL, "unable to allocate memory for compact dataset") - - /* Copy over the raw data */ - HDmemcpy(dest->storage.u.compact.buf, mesg->storage.u.compact.buf, dest->storage.u.compact.size); - } /* end if */ + /* Special actions for each type of layout */ + switch(mesg->type) { + case H5D_COMPACT: + /* Deep copy the buffer for compact datasets also */ + if(mesg->storage.u.compact.size > 0) { + /* Allocate memory for the raw data */ + if(NULL == (dest->storage.u.compact.buf = H5MM_malloc(dest->storage.u.compact.size))) + HGOTO_ERROR(H5E_OHDR, H5E_NOSPACE, NULL, "unable to allocate memory for compact dataset") + + /* Copy over the raw data */ + HDmemcpy(dest->storage.u.compact.buf, mesg->storage.u.compact.buf, dest->storage.u.compact.size); + } /* end if */ + break; + + case H5D_CONTIGUOUS: + /* Nothing required */ + break; + + case H5D_CHUNKED: + /* Reset the pointer of the chunked storage index but not the address */ + if(dest->storage.u.chunk.ops) + H5D_chunk_idx_reset(&dest->storage.u.chunk, FALSE); + break; - /* Reset the pointer of the chunked storage index but not the address */ - if(dest->type == H5D_CHUNKED && dest->storage.u.chunk.ops) - H5D_chunk_idx_reset(&dest->storage.u.chunk, FALSE); + case H5D_LAYOUT_ERROR: + case H5D_NLAYOUTS: + default: + HGOTO_ERROR(H5E_OHDR, H5E_CANTENCODE, NULL, "Invalid layout class") + } /* end switch */ /* Set return value */ ret_value = dest; -- cgit v0.12 From 097d2de6f8d8790596bbd189a8e01929e353bdd8 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Sat, 29 Aug 2015 00:00:07 -0500 Subject: [svn-r27615] Description: Protect dataset that's closing from being flushed again, if it's the last one holding a file open. Tested on: MacOSX/64 10.10.5 (amazon) w/serial & parallel (h5committest forthcoming) --- src/H5Dint.c | 87 ++++++++++++++++++++++++++++++++---------------------------- src/H5Dpkg.h | 1 + 2 files changed, 48 insertions(+), 40 deletions(-) diff --git a/src/H5Dint.c b/src/H5Dint.c index b41e5a8..20817c3 100644 --- a/src/H5Dint.c +++ b/src/H5Dint.c @@ -1486,7 +1486,7 @@ done: herr_t H5D_close(H5D_t *dataset) { - unsigned free_failed = FALSE; + hbool_t free_failed = FALSE; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -1506,16 +1506,18 @@ H5D_close(H5D_t *dataset) if(H5D__flush_real(dataset, H5AC_dxpl_id) < 0) HDONE_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "unable to flush cached dataset info") - /* Free the data sieve buffer, if it's been allocated */ - if(dataset->shared->cache.contig.sieve_buf) { - HDassert(dataset->shared->layout.type != H5D_COMPACT); /* We should never have a sieve buffer for compact storage */ - - dataset->shared->cache.contig.sieve_buf = (unsigned char *)H5FL_BLK_FREE(sieve_buf,dataset->shared->cache.contig.sieve_buf); - } /* end if */ + /* Set a flag to indicate the dataset is closing, before we start freeing things */ + /* (Avoids problems with flushing datasets twice, when one is holding + * the file open and it iterates through dataset to flush them -QAK) + */ + dataset->shared->closing = TRUE; /* Free cached information for each kind of dataset */ switch(dataset->shared->layout.type) { case H5D_CONTIGUOUS: + /* Free the data sieve buffer, if it's been allocated */ + if(dataset->shared->cache.contig.sieve_buf) + dataset->shared->cache.contig.sieve_buf = (unsigned char *)H5FL_BLK_FREE(sieve_buf,dataset->shared->cache.contig.sieve_buf); break; case H5D_CHUNKED: @@ -1562,8 +1564,9 @@ H5D_close(H5D_t *dataset) * Release datatype, dataspace and creation property list -- there isn't * much we can do if one of these fails, so we just continue. */ - free_failed = (unsigned)(H5I_dec_ref(dataset->shared->type_id) < 0 || H5S_close(dataset->shared->space) < 0 || - H5I_dec_ref(dataset->shared->dcpl_id) < 0); + free_failed = (H5I_dec_ref(dataset->shared->type_id) < 0) || + (H5S_close(dataset->shared->space) < 0) || + (H5I_dec_ref(dataset->shared->dcpl_id) < 0); /* Remove the dataset from the list of opened objects in the file */ if(H5FO_top_decr(dataset->oloc.file, dataset->oloc.addr) < 0) @@ -2459,44 +2462,48 @@ H5D__flush_real(H5D_t *dataset, hid_t dxpl_id) /* Check args */ HDassert(dataset); + HDassert(dataset->shared); + + /* Avoid flushing the dataset (again) if it's closing */ + if(!dataset->shared->closing) { + /* Check for metadata changes that will require updating the object's modification time */ + if(dataset->shared->layout_dirty || dataset->shared->space_dirty) { + unsigned update_flags = H5O_UPDATE_TIME; /* Modification time flag */ + + /* Pin the object header */ + if(NULL == (oh = H5O_pin(&dataset->oloc, dxpl_id))) + HGOTO_ERROR(H5E_DATASET, H5E_CANTPIN, FAIL, "unable to pin dataset object header") + + /* Update the layout on disk, if it's been changed */ + if(dataset->shared->layout_dirty) { + if(H5D__layout_oh_write(dataset, dxpl_id, oh, update_flags) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "unable to update layout/pline/efl info") + dataset->shared->layout_dirty = FALSE; + + /* Reset the "update the modification time" flag, so we only do it once */ + update_flags = 0; + } /* end if */ - /* Check for metadata changes that will require updating the object's modification time */ - if(dataset->shared->layout_dirty || dataset->shared->space_dirty) { - unsigned update_flags = H5O_UPDATE_TIME; /* Modification time flag */ - - /* Pin the object header */ - if(NULL == (oh = H5O_pin(&dataset->oloc, dxpl_id))) - HGOTO_ERROR(H5E_DATASET, H5E_CANTPIN, FAIL, "unable to pin dataset object header") - - /* Update the layout on disk, if it's been changed */ - if(dataset->shared->layout_dirty) { - if(H5D__layout_oh_write(dataset, dxpl_id, oh, update_flags) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "unable to update layout/pline/efl info") - dataset->shared->layout_dirty = FALSE; - - /* Reset the "update the modification time" flag, so we only do it once */ - update_flags = 0; - } /* end if */ + /* Update the dataspace on disk, if it's been changed */ + if(dataset->shared->space_dirty) { + if(H5S_write(dataset->oloc.file, dxpl_id, oh, update_flags, dataset->shared->space) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "unable to update file with new dataspace") + dataset->shared->space_dirty = FALSE; - /* Update the dataspace on disk, if it's been changed */ - if(dataset->shared->space_dirty) { - if(H5S_write(dataset->oloc.file, dxpl_id, oh, update_flags, dataset->shared->space) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "unable to update file with new dataspace") - dataset->shared->space_dirty = FALSE; + /* Reset the "update the modification time" flag, so we only do it once */ + update_flags = 0; + } /* end if */ - /* Reset the "update the modification time" flag, so we only do it once */ - update_flags = 0; + /* _Somebody_ should have update the modification time! */ + HDassert(update_flags == 0); } /* end if */ - /* _Somebody_ should have update the modification time! */ - HDassert(update_flags == 0); + /* Flush cached raw data for each kind of dataset layout */ + if(dataset->shared->layout.ops->flush && + (dataset->shared->layout.ops->flush)(dataset, dxpl_id) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTFLUSH, FAIL, "unable to flush raw data") } /* end if */ - /* Flush cached raw data for each kind of dataset layout */ - if(dataset->shared->layout.ops->flush && - (dataset->shared->layout.ops->flush)(dataset, dxpl_id) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTFLUSH, FAIL, "unable to flush raw data") - done: /* Release pointer to object header */ if(oh != NULL) diff --git a/src/H5Dpkg.h b/src/H5Dpkg.h index 6e9a6a7..11f8918 100644 --- a/src/H5Dpkg.h +++ b/src/H5Dpkg.h @@ -408,6 +408,7 @@ typedef struct H5D_rdcdc_t { */ typedef struct H5D_shared_t { size_t fo_count; /* Reference count */ + hbool_t closing; /* Flag to indicate dataset is closing */ hid_t type_id; /* ID for dataset's datatype */ H5T_t *type; /* Datatype for this dataset */ H5S_t *space; /* Dataspace of this dataset */ -- cgit v0.12 From ed506058832725fe3bf3acbbe7c1e2891499995b Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Sat, 29 Aug 2015 17:10:41 -0500 Subject: [svn-r27618] Description: Align w/vds branch: Remove extraneous sieve buffer flush in chunk flush callback, and move error check out of the middle of retrieving properties for dataset. Tested on: MacOSX/64 10.10.5 (amazon) w/serial & parallel (h5committest forthcoming) --- src/H5Dchunk.c | 4 ---- src/H5Dint.c | 6 ++++-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c index f54fa8e..8584d0a 100644 --- a/src/H5Dchunk.c +++ b/src/H5Dchunk.c @@ -2120,10 +2120,6 @@ H5D__chunk_flush(H5D_t *dset, hid_t dxpl_id) /* Sanity check */ HDassert(dset); - /* Flush any data caught in sieve buffer */ - if(H5D__flush_sieve_buf(dset, dxpl_id) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTFLUSH, FAIL, "unable to flush sieve buffer") - /* Fill the DXPL cache values for later use */ if(H5D__get_dxpl_cache(dxpl_id, &dxpl_cache) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't fill dxpl cache") diff --git a/src/H5Dint.c b/src/H5Dint.c index 20817c3..28bfa59 100644 --- a/src/H5Dint.c +++ b/src/H5Dint.c @@ -1048,12 +1048,14 @@ H5D__create(H5F_t *file, hid_t type_id, const H5S_t *space, hid_t dcpl_id, layout = &new_dset->shared->layout; if(H5P_get(dc_plist, H5D_CRT_LAYOUT_NAME, layout) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't retrieve layout") - if(pline->nused > 0 && H5D_CHUNKED != layout->type) - HGOTO_ERROR(H5E_DATASET, H5E_BADVALUE, NULL, "filters can only be used with chunked layout") fill = &new_dset->shared->dcpl_cache.fill; if(H5P_get(dc_plist, H5D_CRT_FILL_VALUE_NAME, fill) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't retrieve fill value info") + /* Check that chunked layout is used if filters are enabled */ + if(pline->nused > 0 && H5D_CHUNKED != layout->type) + HGOTO_ERROR(H5E_DATASET, H5E_BADVALUE, NULL, "filters can only be used with chunked layout") + /* Check if the alloc_time is the default and error out */ if(fill->alloc_time == H5D_ALLOC_TIME_DEFAULT) HGOTO_ERROR(H5E_DATASET, H5E_BADVALUE, NULL, "invalid space allocation state") -- cgit v0.12 From 74792949c9beb0c090764c5e42f7f6994abf4b3a Mon Sep 17 00:00:00 2001 From: HDF Tester Date: Sun, 30 Aug 2015 19:55:54 -0500 Subject: [svn-r27622] Snapshot version 1.9 release 229 --- README.txt | 2 +- c++/src/Makefile.in | 2 +- c++/src/cpp_doc_config | 2 +- config/lt_vers.am | 2 +- configure | 22 +++++++++++----------- configure.ac | 2 +- fortran/src/Makefile.in | 2 +- hl/c++/src/Makefile.in | 2 +- hl/fortran/src/Makefile.in | 2 +- hl/src/Makefile.in | 2 +- release_docs/RELEASE.txt | 2 +- src/H5public.h | 4 ++-- src/Makefile.in | 2 +- 13 files changed, 24 insertions(+), 24 deletions(-) diff --git a/README.txt b/README.txt index a78bec1..058734f 100644 --- a/README.txt +++ b/README.txt @@ -1,4 +1,4 @@ -HDF5 version 1.9.229 currently under development +HDF5 version 1.9.230 currently under development Please refer to the release_docs/INSTALL file for installation instructions. ------------------------------------------------------------------------------ diff --git a/c++/src/Makefile.in b/c++/src/Makefile.in index e882e8b..81e98dd 100644 --- a/c++/src/Makefile.in +++ b/c++/src/Makefile.in @@ -688,7 +688,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 # After making changes, run bin/reconfigure to update other configure related # files like Makefile.in. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 219 +LT_VERS_REVISION = 220 LT_VERS_AGE = 0 # This is our main target diff --git a/c++/src/cpp_doc_config b/c++/src/cpp_doc_config index 6624fad..73c41eb 100644 --- a/c++/src/cpp_doc_config +++ b/c++/src/cpp_doc_config @@ -38,7 +38,7 @@ PROJECT_NAME = "HDF5 C++ API" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = "1.9.229 currently under development" +PROJECT_NUMBER = "1.9.230 currently under development" # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/config/lt_vers.am b/config/lt_vers.am index 20959db..0a07eb7 100644 --- a/config/lt_vers.am +++ b/config/lt_vers.am @@ -19,7 +19,7 @@ # After making changes, run bin/reconfigure to update other configure related # files like Makefile.in. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 219 +LT_VERS_REVISION = 220 LT_VERS_AGE = 0 ## If the API changes *at all*, increment LT_VERS_INTERFACE and diff --git a/configure b/configure index e9713e2..d243cc5 100755 --- a/configure +++ b/configure @@ -1,7 +1,7 @@ #! /bin/sh # From configure.ac Id: configure.ac 22697 2012-08-19 14:35:47Z hdftest . # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for HDF5 1.9.229. +# Generated by GNU Autoconf 2.69 for HDF5 1.9.230. # # Report bugs to . # @@ -591,8 +591,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='HDF5' PACKAGE_TARNAME='hdf5' -PACKAGE_VERSION='1.9.229' -PACKAGE_STRING='HDF5 1.9.229' +PACKAGE_VERSION='1.9.230' +PACKAGE_STRING='HDF5 1.9.230' PACKAGE_BUGREPORT='help@hdfgroup.org' PACKAGE_URL='' @@ -1479,7 +1479,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures HDF5 1.9.229 to adapt to many kinds of systems. +\`configure' configures HDF5 1.9.230 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1549,7 +1549,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of HDF5 1.9.229:";; + short | recursive ) echo "Configuration of HDF5 1.9.230:";; esac cat <<\_ACEOF @@ -1738,7 +1738,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -HDF5 configure 1.9.229 +HDF5 configure 1.9.230 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2653,7 +2653,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by HDF5 $as_me 1.9.229, which was +It was created by HDF5 $as_me 1.9.230, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3525,7 +3525,7 @@ fi # Define the identity of the package. PACKAGE='hdf5' - VERSION='1.9.229' + VERSION='1.9.230' cat >>confdefs.h <<_ACEOF @@ -29464,7 +29464,7 @@ Usage: $0 [OPTIONS] Report bugs to ." lt_cl_version="\ -HDF5 config.lt 1.9.229 +HDF5 config.lt 1.9.230 configured by $0, generated by GNU Autoconf 2.69. Copyright (C) 2011 Free Software Foundation, Inc. @@ -31560,7 +31560,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by HDF5 $as_me 1.9.229, which was +This file was extended by HDF5 $as_me 1.9.230, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -31626,7 +31626,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -HDF5 config.status 1.9.229 +HDF5 config.status 1.9.230 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/configure.ac b/configure.ac index ff8a667..1337e0e 100644 --- a/configure.ac +++ b/configure.ac @@ -26,7 +26,7 @@ AC_PREREQ([2.69]) ## NOTE: Do not forget to change the version number here when we do a ## release!!! ## -AC_INIT([HDF5], [1.9.229], [help@hdfgroup.org]) +AC_INIT([HDF5], [1.9.230], [help@hdfgroup.org]) AC_CONFIG_SRCDIR([src/H5.c]) AC_CONFIG_HEADER([src/H5config.h]) diff --git a/fortran/src/Makefile.in b/fortran/src/Makefile.in index 563f75f..775ed6a 100644 --- a/fortran/src/Makefile.in +++ b/fortran/src/Makefile.in @@ -725,7 +725,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 # After making changes, run bin/reconfigure to update other configure related # files like Makefile.in. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 219 +LT_VERS_REVISION = 220 LT_VERS_AGE = 0 AM_FCLIBS = $(LIBHDF5) diff --git a/hl/c++/src/Makefile.in b/hl/c++/src/Makefile.in index 4dcf546..a08f20c 100644 --- a/hl/c++/src/Makefile.in +++ b/hl/c++/src/Makefile.in @@ -680,7 +680,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 # After making changes, run bin/reconfigure to update other configure related # files like Makefile.in. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 219 +LT_VERS_REVISION = 220 LT_VERS_AGE = 0 # This is our main target diff --git a/hl/fortran/src/Makefile.in b/hl/fortran/src/Makefile.in index 6ceb7c7..c63733a 100644 --- a/hl/fortran/src/Makefile.in +++ b/hl/fortran/src/Makefile.in @@ -708,7 +708,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 # After making changes, run bin/reconfigure to update other configure related # files like Makefile.in. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 219 +LT_VERS_REVISION = 220 LT_VERS_AGE = 0 # Our main target, the high-level fortran library diff --git a/hl/src/Makefile.in b/hl/src/Makefile.in index dff64ee..264c342 100644 --- a/hl/src/Makefile.in +++ b/hl/src/Makefile.in @@ -679,7 +679,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 # After making changes, run bin/reconfigure to update other configure related # files like Makefile.in. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 219 +LT_VERS_REVISION = 220 LT_VERS_AGE = 0 # This library is our main target. diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index fdc1dac..e281d7d 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -1,4 +1,4 @@ -HDF5 version 1.9.229 currently under development +HDF5 version 1.9.230 currently under development ================================================================================ diff --git a/src/H5public.h b/src/H5public.h index 8c7da05..6d868de 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -94,10 +94,10 @@ extern "C" { /* Version numbers */ #define H5_VERS_MAJOR 1 /* For major interface/format changes */ #define H5_VERS_MINOR 9 /* For minor interface/format changes */ -#define H5_VERS_RELEASE 229 /* For tweaks, bug-fixes, or development */ +#define H5_VERS_RELEASE 230 /* For tweaks, bug-fixes, or development */ #define H5_VERS_SUBRELEASE "" /* For pre-releases like snap0 */ /* Empty string for real releases. */ -#define H5_VERS_INFO "HDF5 library version: 1.9.229" /* Full version string */ +#define H5_VERS_INFO "HDF5 library version: 1.9.230" /* Full version string */ #define H5check() H5check_version(H5_VERS_MAJOR,H5_VERS_MINOR, \ H5_VERS_RELEASE) diff --git a/src/Makefile.in b/src/Makefile.in index e5a991f..397691d 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -741,7 +741,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 # After making changes, run bin/reconfigure to update other configure related # files like Makefile.in. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 219 +LT_VERS_REVISION = 220 LT_VERS_AGE = 0 # Our main target, the HDF5 library -- cgit v0.12 From b920ee876e4854f7e770f21c04126a208fb3b1af Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Mon, 31 Aug 2015 12:42:09 -0500 Subject: [svn-r27623] Added some parallel #ifdefs to H5Ocache.c to quiet compiler warnings. tested on: h5committest --- src/H5Ocache.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/src/H5Ocache.c b/src/H5Ocache.c index 203d0fc..3c64131 100644 --- a/src/H5Ocache.c +++ b/src/H5Ocache.c @@ -636,13 +636,21 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O__cache_clear(const H5F_t *f, void *_thing, hbool_t about_to_destroy) +#ifdef H5_HAVE_PARALLEL +H5O__cache_clear(const H5F_t *f, void *_thing, hbool_t H5_ATTR_UNUSED about_to_destroy) +#else +H5O__cache_clear(const H5F_t H5_ATTR_UNUSED *f, void *_thing, hbool_t H5_ATTR_UNUSED about_to_destroy) +#endif /* H5_HAVE_PARALLEL */ { H5O_t *oh = (H5O_t *)_thing; /* Object header to reset */ unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ +#ifdef H5_HAVE_PARALLEL FUNC_ENTER_STATIC +#else + FUNC_ENTER_STATIC_NOERR +#endif /* H5_HAVE_PARALLEL */ /* Check arguments */ HDassert(oh); @@ -673,7 +681,9 @@ H5O__cache_clear(const H5F_t *f, void *_thing, hbool_t about_to_destroy) oh->ndecode_dirtied = 0; #endif /* NDEBUG */ +#ifdef H5_HAVE_PARALLEL done: +#endif /* H5_HAVE_PARALLEL */ FUNC_LEAVE_NOAPI(ret_value) } /* end H5O__cache_clear() */ @@ -942,14 +952,22 @@ done: *------------------------------------------------------------------------- */ static herr_t +#ifdef H5_HAVE_PARALLEL H5O__cache_chk_clear(const H5F_t *f, void *_thing, hbool_t about_to_destroy) +#else +H5O__cache_chk_clear(const H5F_t H5_ATTR_UNUSED *f, void *_thing, hbool_t H5_ATTR_UNUSED about_to_destroy) +#endif /* H5_HAVE_PARALLEL */ { H5O_chunk_proxy_t *chk_proxy = (H5O_chunk_proxy_t *)_thing; /* Object header chunk to reset */ H5O_t *oh; /* Object header for chunk */ unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ +#ifdef H5_HAVE_PARALLEL FUNC_ENTER_STATIC +#else + FUNC_ENTER_STATIC_NOERR +#endif /* H5_HAVE_PARALLEL */ /* Check arguments */ HDassert(chk_proxy); @@ -971,7 +989,9 @@ H5O__cache_chk_clear(const H5F_t *f, void *_thing, hbool_t about_to_destroy) if(chk_proxy->oh->mesg[u].chunkno == chk_proxy->chunkno) chk_proxy->oh->mesg[u].dirty = FALSE; +#ifdef H5_HAVE_PARALLEL done: +#endif /* H5_HAVE_PARALLEL */ FUNC_LEAVE_NOAPI(ret_value) } /* end H5O__cache_chk_clear() */ -- cgit v0.12 From de1bafd1d81f936c046317720d7a73bcdb41f5e6 Mon Sep 17 00:00:00 2001 From: Larry Knox Date: Mon, 31 Aug 2015 12:50:08 -0500 Subject: [svn-r27624] Update bin/bbrelease to handle changed output of 'svn info' with svn version 1.8. Change to experimental release script bbrelease for buildbot to eliminate extra line in version output. --- bin/bbrelease | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/bbrelease b/bin/bbrelease index fea498a..1e3b88d 100755 --- a/bin/bbrelease +++ b/bin/bbrelease @@ -260,7 +260,7 @@ if [ X$revmode = Xyes ]; then # Copy old version of config/lt_vers.am, since it's hard to # "undo" changes to it. cp config/lt_vers.am $tmpdir - branch=`svn info | grep URL: | awk -F/ '{print $NF}'` + branch=`svn info | grep ^URL: | awk -F/ '{print $NF}'` revision=`svn info | grep "Last Changed Rev:" | awk '{print $4}'` # Set version information to m.n.r-r$revision. # (h5vers does not correctly handle just m.n.r-$today.) -- cgit v0.12 From e6f9fc5f7f58e4c0a9a8541bc5674b440abd658c Mon Sep 17 00:00:00 2001 From: Scot Breitenfeld Date: Mon, 31 Aug 2015 13:49:17 -0500 Subject: [svn-r27625] Added preprocessor commands for PGI compiler. tested: h5committest --- MANIFEST | 60 +- Makefile.in | 1 + c++/Makefile.in | 1 + c++/examples/Makefile.in | 1 + c++/src/Makefile.in | 1 + c++/test/Makefile.in | 1 + config/pgi-fflags | 1 + configure | 8 + configure.ac | 5 +- examples/Makefile.in | 1 + fortran/Makefile.in | 1 + fortran/examples/Makefile.in | 1 + fortran/src/CMakeLists.txt | 2 + fortran/src/H5config_f.inc.cmake | 3 + fortran/src/H5config_f.inc.in | 3 + fortran/src/Makefile.in | 1 + fortran/test/CMakeLists.txt | 120 +- fortran/test/Makefile.am | 16 +- fortran/test/Makefile.in | 186 ++- fortran/test/fflush1.F90 | 157 ++ fortran/test/fflush1.f90 | 157 -- fortran/test/fflush2.F90 | 177 +++ fortran/test/fflush2.f90 | 177 --- fortran/test/fortranlib_test.F90 | 255 ++++ fortran/test/fortranlib_test.f90 | 252 --- fortran/test/fortranlib_test_1_8.F90 | 122 ++ fortran/test/fortranlib_test_1_8.f90 | 122 -- fortran/test/fortranlib_test_F03.F90 | 193 +++ fortran/test/fortranlib_test_F03.f90 | 193 --- fortran/test/tH5A.F90 | 624 ++++++++ fortran/test/tH5A.f90 | 624 -------- fortran/test/tH5A_1_8.F90 | 2779 ++++++++++++++++++++++++++++++++++ fortran/test/tH5A_1_8.f90 | 2779 ---------------------------------- fortran/test/tH5D.F90 | 630 ++++++++ fortran/test/tH5D.f90 | 630 -------- fortran/test/tH5E.F90 | 102 ++ fortran/test/tH5E.f90 | 102 -- fortran/test/tH5E_F03.F90 | 203 +++ fortran/test/tH5E_F03.f90 | 203 --- fortran/test/tH5F.F90 | 782 ++++++++++ fortran/test/tH5F.f90 | 782 ---------- fortran/test/tH5F_F03.F90 | 179 +++ fortran/test/tH5F_F03.f90 | 179 --- fortran/test/tH5G.F90 | 263 ++++ fortran/test/tH5G.f90 | 263 ---- fortran/test/tH5G_1_8.F90 | 2126 ++++++++++++++++++++++++++ fortran/test/tH5G_1_8.f90 | 2126 -------------------------- fortran/test/tH5I.F90 | 321 ++++ fortran/test/tH5I.f90 | 321 ---- fortran/test/tH5L_F03.F90 | 318 ++++ fortran/test/tH5L_F03.f90 | 318 ---- fortran/test/tH5MISC_1_8.F90 | 469 ++++++ fortran/test/tH5MISC_1_8.f90 | 469 ------ fortran/test/tH5O.F90 | 793 ++++++++++ fortran/test/tH5O.f90 | 793 ---------- fortran/test/tH5O_F03.F90 | 555 +++++++ fortran/test/tH5O_F03.f90 | 555 ------- fortran/test/tH5P.F90 | 677 +++++++++ fortran/test/tH5P.f90 | 677 --------- fortran/test/tH5P_F03.F90 | 617 ++++++++ fortran/test/tH5P_F03.f90 | 617 -------- fortran/test/tH5R.F90 | 483 ++++++ fortran/test/tH5R.f90 | 483 ------ fortran/test/tH5S.F90 | 298 ++++ fortran/test/tH5S.f90 | 298 ---- fortran/test/tH5Sselect.F90 | 1993 ++++++++++++++++++++++++ fortran/test/tH5Sselect.f90 | 1993 ------------------------ fortran/test/tH5T.F90 | 1149 ++++++++++++++ fortran/test/tH5T.f90 | 1149 -------------- fortran/test/tH5VL.F90 | 512 +++++++ fortran/test/tH5VL.f90 | 512 ------- fortran/test/tH5Z.F90 | 419 +++++ fortran/test/tH5Z.f90 | 419 ----- fortran/test/tHDF5.F90 | 46 + fortran/test/tHDF5.f90 | 46 - fortran/test/tHDF5_1_8.F90 | 37 + fortran/test/tHDF5_1_8.f90 | 37 - fortran/test/tHDF5_F03.F90 | 39 + fortran/test/tHDF5_F03.f90 | 39 - fortran/testpar/Makefile.in | 1 + hl/Makefile.in | 1 + hl/c++/Makefile.in | 1 + hl/c++/examples/Makefile.in | 1 + hl/c++/src/Makefile.in | 1 + hl/c++/test/Makefile.in | 1 + hl/examples/Makefile.in | 1 + hl/fortran/Makefile.in | 1 + hl/fortran/examples/Makefile.in | 1 + hl/fortran/src/Makefile.in | 1 + hl/fortran/test/Makefile.in | 1 + hl/src/Makefile.in | 1 + hl/test/Makefile.in | 1 + hl/tools/Makefile.in | 1 + hl/tools/gif2h5/Makefile.in | 1 + src/H5config.h.in | 3 + src/Makefile.in | 1 + test/Makefile.in | 1 + testpar/Makefile.in | 1 + tools/Makefile.in | 1 + tools/h5copy/Makefile.in | 1 + tools/h5diff/Makefile.in | 1 + tools/h5dump/Makefile.in | 1 + tools/h5import/Makefile.in | 1 + tools/h5jam/Makefile.in | 1 + tools/h5ls/Makefile.in | 1 + tools/h5repack/Makefile.in | 1 + tools/h5stat/Makefile.in | 1 + tools/lib/Makefile.in | 1 + tools/misc/Makefile.in | 1 + tools/perform/Makefile.in | 1 + 110 files changed, 17566 insertions(+), 17513 deletions(-) create mode 100644 fortran/test/fflush1.F90 delete mode 100644 fortran/test/fflush1.f90 create mode 100644 fortran/test/fflush2.F90 delete mode 100644 fortran/test/fflush2.f90 create mode 100644 fortran/test/fortranlib_test.F90 delete mode 100644 fortran/test/fortranlib_test.f90 create mode 100644 fortran/test/fortranlib_test_1_8.F90 delete mode 100644 fortran/test/fortranlib_test_1_8.f90 create mode 100644 fortran/test/fortranlib_test_F03.F90 delete mode 100644 fortran/test/fortranlib_test_F03.f90 create mode 100644 fortran/test/tH5A.F90 delete mode 100644 fortran/test/tH5A.f90 create mode 100644 fortran/test/tH5A_1_8.F90 delete mode 100644 fortran/test/tH5A_1_8.f90 create mode 100644 fortran/test/tH5D.F90 delete mode 100644 fortran/test/tH5D.f90 create mode 100644 fortran/test/tH5E.F90 delete mode 100644 fortran/test/tH5E.f90 create mode 100644 fortran/test/tH5E_F03.F90 delete mode 100644 fortran/test/tH5E_F03.f90 create mode 100644 fortran/test/tH5F.F90 delete mode 100644 fortran/test/tH5F.f90 create mode 100644 fortran/test/tH5F_F03.F90 delete mode 100644 fortran/test/tH5F_F03.f90 create mode 100644 fortran/test/tH5G.F90 delete mode 100644 fortran/test/tH5G.f90 create mode 100644 fortran/test/tH5G_1_8.F90 delete mode 100644 fortran/test/tH5G_1_8.f90 create mode 100644 fortran/test/tH5I.F90 delete mode 100644 fortran/test/tH5I.f90 create mode 100644 fortran/test/tH5L_F03.F90 delete mode 100644 fortran/test/tH5L_F03.f90 create mode 100644 fortran/test/tH5MISC_1_8.F90 delete mode 100644 fortran/test/tH5MISC_1_8.f90 create mode 100644 fortran/test/tH5O.F90 delete mode 100644 fortran/test/tH5O.f90 create mode 100644 fortran/test/tH5O_F03.F90 delete mode 100644 fortran/test/tH5O_F03.f90 create mode 100644 fortran/test/tH5P.F90 delete mode 100644 fortran/test/tH5P.f90 create mode 100644 fortran/test/tH5P_F03.F90 delete mode 100644 fortran/test/tH5P_F03.f90 create mode 100644 fortran/test/tH5R.F90 delete mode 100644 fortran/test/tH5R.f90 create mode 100644 fortran/test/tH5S.F90 delete mode 100644 fortran/test/tH5S.f90 create mode 100644 fortran/test/tH5Sselect.F90 delete mode 100644 fortran/test/tH5Sselect.f90 create mode 100644 fortran/test/tH5T.F90 delete mode 100644 fortran/test/tH5T.f90 create mode 100644 fortran/test/tH5VL.F90 delete mode 100644 fortran/test/tH5VL.f90 create mode 100644 fortran/test/tH5Z.F90 delete mode 100644 fortran/test/tH5Z.f90 create mode 100644 fortran/test/tHDF5.F90 delete mode 100644 fortran/test/tHDF5.f90 create mode 100644 fortran/test/tHDF5_1_8.F90 delete mode 100644 fortran/test/tHDF5_1_8.f90 create mode 100644 fortran/test/tHDF5_F03.F90 delete mode 100644 fortran/test/tHDF5_F03.f90 diff --git a/MANIFEST b/MANIFEST index 44bdc24..36ea2fe 100644 --- a/MANIFEST +++ b/MANIFEST @@ -237,41 +237,41 @@ ./fortran/test/Makefile.am ./fortran/test/Makefile.in -./fortran/test/fflush1.f90 -./fortran/test/fflush2.f90 -./fortran/test/fortranlib_test.f90 -./fortran/test/fortranlib_test_1_8.f90 -./fortran/test/fortranlib_test_F03.f90 +./fortran/test/fflush1.F90 +./fortran/test/fflush2.F90 +./fortran/test/fortranlib_test.F90 +./fortran/test/fortranlib_test_1_8.F90 +./fortran/test/fortranlib_test_F03.F90 ./fortran/test/H5_test_buildiface.F90 ./fortran/test/t.c ./fortran/test/t.h ./fortran/test/tf.F90 -./fortran/test/tH5A.f90 -./fortran/test/tH5A_1_8.f90 -./fortran/test/tH5D.f90 -./fortran/test/tH5E_F03.f90 -./fortran/test/tH5E.f90 -./fortran/test/tH5F.f90 -./fortran/test/tH5F_F03.f90 -./fortran/test/tH5G.f90 -./fortran/test/tH5G_1_8.f90 -./fortran/test/tH5I.f90 -./fortran/test/tH5L_F03.f90 -./fortran/test/tH5MISC_1_8.f90 -./fortran/test/tH5O.f90 -./fortran/test/tH5O_F03.f90 -./fortran/test/tH5P_F03.f90 -./fortran/test/tH5P.f90 -./fortran/test/tH5R.f90 -./fortran/test/tH5S.f90 -./fortran/test/tH5Sselect.f90 +./fortran/test/tH5A.F90 +./fortran/test/tH5A_1_8.F90 +./fortran/test/tH5D.F90 +./fortran/test/tH5E_F03.F90 +./fortran/test/tH5E.F90 +./fortran/test/tH5F.F90 +./fortran/test/tH5F_F03.F90 +./fortran/test/tH5G.F90 +./fortran/test/tH5G_1_8.F90 +./fortran/test/tH5I.F90 +./fortran/test/tH5L_F03.F90 +./fortran/test/tH5MISC_1_8.F90 +./fortran/test/tH5O.F90 +./fortran/test/tH5O_F03.F90 +./fortran/test/tH5P_F03.F90 +./fortran/test/tH5P.F90 +./fortran/test/tH5R.F90 +./fortran/test/tH5S.F90 +./fortran/test/tH5Sselect.F90 ./fortran/test/tH5T_F03.F90 -./fortran/test/tH5T.f90 -./fortran/test/tH5VL.f90 -./fortran/test/tH5Z.f90 -./fortran/test/tHDF5_1_8.f90 -./fortran/test/tHDF5_F03.f90 -./fortran/test/tHDF5.f90 +./fortran/test/tH5T.F90 +./fortran/test/tH5VL.F90 +./fortran/test/tH5Z.F90 +./fortran/test/tHDF5_1_8.F90 +./fortran/test/tHDF5_F03.F90 +./fortran/test/tHDF5.F90 ./fortran/testpar/Makefile.am ./fortran/testpar/Makefile.in diff --git a/Makefile.in b/Makefile.in index 2e9effd..98fa5aa 100644 --- a/Makefile.in +++ b/Makefile.in @@ -298,6 +298,7 @@ FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ +Fortran_COMPILER_ID = @Fortran_COMPILER_ID@ GREP = @GREP@ H5CONFIG_F_IKIND = @H5CONFIG_F_IKIND@ H5CONFIG_F_NUM_IKIND = @H5CONFIG_F_NUM_IKIND@ diff --git a/c++/Makefile.in b/c++/Makefile.in index 4ff4906..ff18fff 100644 --- a/c++/Makefile.in +++ b/c++/Makefile.in @@ -458,6 +458,7 @@ FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ +Fortran_COMPILER_ID = @Fortran_COMPILER_ID@ GREP = @GREP@ H5CONFIG_F_IKIND = @H5CONFIG_F_IKIND@ H5CONFIG_F_NUM_IKIND = @H5CONFIG_F_NUM_IKIND@ diff --git a/c++/examples/Makefile.in b/c++/examples/Makefile.in index 9691b5e..1d7dcbe 100644 --- a/c++/examples/Makefile.in +++ b/c++/examples/Makefile.in @@ -406,6 +406,7 @@ FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ +Fortran_COMPILER_ID = @Fortran_COMPILER_ID@ GREP = @GREP@ H5CONFIG_F_IKIND = @H5CONFIG_F_IKIND@ H5CONFIG_F_NUM_IKIND = @H5CONFIG_F_NUM_IKIND@ diff --git a/c++/src/Makefile.in b/c++/src/Makefile.in index 81e98dd..70aadaa 100644 --- a/c++/src/Makefile.in +++ b/c++/src/Makefile.in @@ -469,6 +469,7 @@ FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ +Fortran_COMPILER_ID = @Fortran_COMPILER_ID@ GREP = @GREP@ H5CONFIG_F_IKIND = @H5CONFIG_F_IKIND@ H5CONFIG_F_NUM_IKIND = @H5CONFIG_F_NUM_IKIND@ diff --git a/c++/test/Makefile.in b/c++/test/Makefile.in index e487e54..380bd32 100644 --- a/c++/test/Makefile.in +++ b/c++/test/Makefile.in @@ -460,6 +460,7 @@ FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ +Fortran_COMPILER_ID = @Fortran_COMPILER_ID@ GREP = @GREP@ H5CONFIG_F_IKIND = @H5CONFIG_F_IKIND@ H5CONFIG_F_NUM_IKIND = @H5CONFIG_F_NUM_IKIND@ diff --git a/config/pgi-fflags b/config/pgi-fflags index 6cb8930..8e574e4 100644 --- a/config/pgi-fflags +++ b/config/pgi-fflags @@ -69,6 +69,7 @@ if test "X-pgf90" = "X-$f9x_vendor"; then # General FC_BASENAME=pgf90 + Fortran_COMPILER_ID=PGI F9XSUFFIXFLAG="" FSEARCH_DIRS="" # Uncomment the following to add something specific for FCFLAGS. diff --git a/configure b/configure index d243cc5..9d4726f 100755 --- a/configure +++ b/configure @@ -774,6 +774,7 @@ ac_ct_CC LDFLAGS CFLAGS CC +Fortran_COMPILER_ID PAC_C_MAX_REAL_PRECISION UNAME_INFO enable_static @@ -3881,6 +3882,8 @@ $as_echo "done" >&6; } UNAME_INFO=`uname -a` +Fortran_COMPILER_ID=none + ## ---------------------------------------------------------------------- ## Some platforms have broken basename, and/or xargs programs. Check ## that it actually does what it's supposed to do. Catch this early @@ -8263,6 +8266,11 @@ ac_compiler_gnu=$ac_cv_fc_compiler_gnu +cat >>confdefs.h <<_ACEOF +#define Fortran_COMPILER_ID $Fortran_COMPILER_ID +_ACEOF + + ## Setting definition if there is a 16 byte fortran integer if `echo $PAC_FC_ALL_INTEGER_KINDS_SIZEOF | grep '16' >/dev/null`; then HAVE_Fortran_INTEGER_SIZEOF_16="1" diff --git a/configure.ac b/configure.ac index 1337e0e..d170c1d 100644 --- a/configure.ac +++ b/configure.ac @@ -183,6 +183,8 @@ AC_SUBST([enable_shared]) AC_SUBST([enable_static]) AC_SUBST([UNAME_INFO]) UNAME_INFO=`uname -a` AC_SUBST([PAC_C_MAX_REAL_PRECISION]) +AC_SUBST([Fortran_COMPILER_ID]) +Fortran_COMPILER_ID=none ## ---------------------------------------------------------------------- ## Some platforms have broken basename, and/or xargs programs. Check @@ -517,7 +519,8 @@ if test "X$HDF_FORTRAN" = "Xyes"; then AC_SUBST([H5CONFIG_F_RKIND]) AC_SUBST([H5CONFIG_F_RKIND_SIZEOF]) AC_SUBST([H5CONFIG_F_NUM_IKIND]) - AC_SUBST([H5CONFIG_F_IKIND]) + AC_SUBST([H5CONFIG_F_IKIND]) + AC_DEFINE_UNQUOTED([Fortran_COMPILER_ID], $Fortran_COMPILER_ID, [Define Fortran compiler ID]) ## Setting definition if there is a 16 byte fortran integer if `echo $PAC_FC_ALL_INTEGER_KINDS_SIZEOF | grep '16' >/dev/null`; then diff --git a/examples/Makefile.in b/examples/Makefile.in index 94a0b54..e6d2945 100644 --- a/examples/Makefile.in +++ b/examples/Makefile.in @@ -406,6 +406,7 @@ FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ +Fortran_COMPILER_ID = @Fortran_COMPILER_ID@ GREP = @GREP@ H5CONFIG_F_IKIND = @H5CONFIG_F_IKIND@ H5CONFIG_F_NUM_IKIND = @H5CONFIG_F_NUM_IKIND@ diff --git a/fortran/Makefile.in b/fortran/Makefile.in index 5d5d63e..ca2ea6d 100644 --- a/fortran/Makefile.in +++ b/fortran/Makefile.in @@ -462,6 +462,7 @@ FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ +Fortran_COMPILER_ID = @Fortran_COMPILER_ID@ GREP = @GREP@ H5CONFIG_F_IKIND = @H5CONFIG_F_IKIND@ H5CONFIG_F_NUM_IKIND = @H5CONFIG_F_NUM_IKIND@ diff --git a/fortran/examples/Makefile.in b/fortran/examples/Makefile.in index 0ee1461..de02876 100644 --- a/fortran/examples/Makefile.in +++ b/fortran/examples/Makefile.in @@ -411,6 +411,7 @@ FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ +Fortran_COMPILER_ID = @Fortran_COMPILER_ID@ GREP = @GREP@ H5CONFIG_F_IKIND = @H5CONFIG_F_IKIND@ H5CONFIG_F_NUM_IKIND = @H5CONFIG_F_NUM_IKIND@ diff --git a/fortran/src/CMakeLists.txt b/fortran/src/CMakeLists.txt index 857b26d..d97e625 100644 --- a/fortran/src/CMakeLists.txt +++ b/fortran/src/CMakeLists.txt @@ -35,6 +35,8 @@ endif(HAVE_FLOAT128) configure_file (${HDF5_F90_SRC_SOURCE_DIR}/H5config_f.inc.cmake ${CMAKE_BINARY_DIR}/H5config_f.inc @ONLY) configure_file (${HDF5_F90_SRC_SOURCE_DIR}/H5fort_type_defines.h.in ${HDF5_F90_BINARY_DIR}/H5fort_type_defines.h @ONLY) +set (Fortran_COMPILER_ID CMAKE_Fortran_COMPILER_ID) + #----------------------------------------------------------------------------- # Setup the Fortran auto-detection utilities # H5_buildiface.F90 used to generate various KIND interfaces diff --git a/fortran/src/H5config_f.inc.cmake b/fortran/src/H5config_f.inc.cmake index cc36889..f0b3472 100644 --- a/fortran/src/H5config_f.inc.cmake +++ b/fortran/src/H5config_f.inc.cmake @@ -82,3 +82,6 @@ ! valid INTEGER KINDs (need to have a matching C counter-part) #define H5_H5CONFIG_F_IKIND @H5CONFIG_F_IKIND@ + +! Fortran compiler id +#define H5_Fortran_COMPILER_ID @Fortran_COMPILER_ID@ diff --git a/fortran/src/H5config_f.inc.in b/fortran/src/H5config_f.inc.in index 64c3a0c..9f094d2 100644 --- a/fortran/src/H5config_f.inc.in +++ b/fortran/src/H5config_f.inc.in @@ -57,3 +57,6 @@ ! valid INTEGER KINDs (need to have a matching C counter-part) #undef H5CONFIG_F_IKIND +! Fortran compiler name +#undef Fortran_COMPILER_ID + diff --git a/fortran/src/Makefile.in b/fortran/src/Makefile.in index 775ed6a..6acdbde 100644 --- a/fortran/src/Makefile.in +++ b/fortran/src/Makefile.in @@ -506,6 +506,7 @@ FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ +Fortran_COMPILER_ID = @Fortran_COMPILER_ID@ GREP = @GREP@ H5CONFIG_F_IKIND = @H5CONFIG_F_IKIND@ H5CONFIG_F_NUM_IKIND = @H5CONFIG_F_NUM_IKIND@ diff --git a/fortran/test/CMakeLists.txt b/fortran/test/CMakeLists.txt index 49b8da8..692cc4d 100644 --- a/fortran/test/CMakeLists.txt +++ b/fortran/test/CMakeLists.txt @@ -132,21 +132,21 @@ add_custom_command ( #-- Adding test for testhdf5_fortran add_executable (testhdf5_fortran - fortranlib_test.f90 - tH5A.f90 - tH5D.f90 - tH5E.f90 - tH5F.f90 - tH5G.f90 - tH5I.f90 - tH5P.f90 - tH5R.f90 - tH5S.f90 - tH5Sselect.f90 - tH5T.f90 - tH5VL.f90 - tH5Z.f90 - tHDF5.f90 + fortranlib_test.F90 + tH5A.F90 + tH5D.F90 + tH5E.F90 + tH5F.F90 + tH5G.F90 + tH5I.F90 + tH5P.F90 + tH5R.F90 + tH5S.F90 + tH5Sselect.F90 + tH5T.F90 + tH5VL.F90 + tH5Z.F90 + tHDF5.F90 ) TARGET_NAMING (testhdf5_fortran STATIC) TARGET_FORTRAN_PROPERTIES (testhdf5_fortran STATIC " " " ") @@ -166,21 +166,21 @@ set_target_properties (testhdf5_fortran PROPERTIES ) if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) add_executable (testhdf5_fortran-shared - fortranlib_test.f90 - tH5A.f90 - tH5D.f90 - tH5E.f90 - tH5F.f90 - tH5G.f90 - tH5I.f90 - tH5P.f90 - tH5R.f90 - tH5S.f90 - tH5Sselect.f90 - tH5T.f90 - tH5VL.f90 - tH5Z.f90 - tHDF5.f90 + fortranlib_test.F90 + tH5A.F90 + tH5D.F90 + tH5E.F90 + tH5F.F90 + tH5G.F90 + tH5I.F90 + tH5P.F90 + tH5R.F90 + tH5S.F90 + tH5Sselect.F90 + tH5T.F90 + tH5VL.F90 + tH5Z.F90 + tHDF5.F90 ) TARGET_NAMING (testhdf5_fortran-shared SHARED) TARGET_FORTRAN_PROPERTIES (testhdf5_fortran-shared SHARED " " " ") @@ -202,12 +202,12 @@ endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) #-- Adding test for testhdf5_fortran_1_8 add_executable (testhdf5_fortran_1_8 - fortranlib_test_1_8.f90 - tH5O.f90 - tH5A_1_8.f90 - tH5G_1_8.f90 - tH5MISC_1_8.f90 - tHDF5_1_8.f90 + fortranlib_test_1_8.F90 + tH5O.F90 + tH5A_1_8.F90 + tH5G_1_8.F90 + tH5MISC_1_8.F90 + tHDF5_1_8.F90 ) TARGET_NAMING (testhdf5_fortran_1_8 STATIC) TARGET_FORTRAN_PROPERTIES (testhdf5_fortran_1_8 STATIC " " " ") @@ -227,12 +227,12 @@ set_target_properties (testhdf5_fortran_1_8 PROPERTIES ) if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) add_executable (testhdf5_fortran_1_8-shared - fortranlib_test_1_8.f90 - tH5O.f90 - tH5A_1_8.f90 - tH5G_1_8.f90 - tH5MISC_1_8.f90 - tHDF5_1_8.f90 + fortranlib_test_1_8.F90 + tH5O.F90 + tH5A_1_8.F90 + tH5G_1_8.F90 + tH5MISC_1_8.F90 + tHDF5_1_8.F90 ) TARGET_NAMING (testhdf5_fortran_1_8-shared SHARED) TARGET_FORTRAN_PROPERTIES (testhdf5_fortran_1_8-shared SHARED " " " ") @@ -254,14 +254,14 @@ endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) #-- Adding test for fortranlib_test_F03 add_executable (fortranlib_test_F03 - fortranlib_test_F03.f90 - tH5E_F03.f90 - tH5F_F03.f90 - tH5L_F03.f90 - tH5O_F03.f90 - tH5P_F03.f90 + fortranlib_test_F03.F90 + tH5E_F03.F90 + tH5F_F03.F90 + tH5L_F03.F90 + tH5O_F03.F90 + tH5P_F03.F90 tH5T_F03.F90 - tHDF5_F03.f90 + tHDF5_F03.F90 ) TARGET_NAMING (fortranlib_test_F03 STATIC) TARGET_FORTRAN_PROPERTIES (fortranlib_test_F03 STATIC " " " ") @@ -281,14 +281,14 @@ set_target_properties (fortranlib_test_F03 PROPERTIES ) if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) add_executable (fortranlib_test_F03-shared - fortranlib_test_F03.f90 - tH5E_F03.f90 - tH5F_F03.f90 - tH5L_F03.f90 - tH5O_F03.f90 - tH5P_F03.f90 + fortranlib_test_F03.F90 + tH5E_F03.F90 + tH5F_F03.F90 + tH5L_F03.F90 + tH5O_F03.F90 + tH5P_F03.F90 tH5T_F03.F90 - tHDF5_F03.f90 + tHDF5_F03.F90 ) TARGET_NAMING (fortranlib_test_F03-shared SHARED) TARGET_FORTRAN_PROPERTIES (fortranlib_test_F03-shared SHARED " " " ") @@ -309,7 +309,7 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) #-- Adding test for fflush1 -add_executable (fflush1 fflush1.f90) +add_executable (fflush1 fflush1.F90) TARGET_NAMING (fflush1 STATIC) TARGET_FORTRAN_PROPERTIES (fflush1 STATIC " " " ") target_link_libraries (fflush1 @@ -327,7 +327,7 @@ set_target_properties (fflush1 PROPERTIES Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/static ) if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) - add_executable (fflush1-shared fflush1.f90) + add_executable (fflush1-shared fflush1.F90) TARGET_NAMING (fflush1-shared SHARED) TARGET_FORTRAN_PROPERTIES (fflush1-shared SHARED " " " ") target_link_libraries (fflush1-shared @@ -347,7 +347,7 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) #-- Adding test for fflush2 -add_executable (fflush2 fflush2.f90) +add_executable (fflush2 fflush2.F90) TARGET_NAMING (fflush2 STATIC) TARGET_FORTRAN_PROPERTIES (fflush2 STATIC " " " ") target_link_libraries (fflush2 @@ -365,7 +365,7 @@ set_target_properties (fflush2 PROPERTIES Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/static ) if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) - add_executable (fflush2-shared fflush2.f90) + add_executable (fflush2-shared fflush2.F90) TARGET_NAMING (fflush2-shared SHARED) TARGET_FORTRAN_PROPERTIES (fflush2-shared SHARED " " " ") target_link_libraries (fflush2-shared diff --git a/fortran/test/Makefile.am b/fortran/test/Makefile.am index 29c41ec..c12233c 100644 --- a/fortran/test/Makefile.am +++ b/fortran/test/Makefile.am @@ -48,18 +48,18 @@ libh5test_fortran_la_SOURCES = tf_gen.F90 tf.F90 t.c fortranlib_test_FCFLAGS=$(AM_FCFLAGS) fortranlib_test_CFLAGS=$(AM_CFLAGS) -fortranlib_test_SOURCES = tH5F.f90 tH5D.f90 tH5R.f90 tH5S.f90 tH5T.f90 tH5VL.f90 tH5Z.f90 \ - tH5Sselect.f90 tH5P.f90 tH5A.f90 tH5I.f90 tH5G.f90 tH5E.f90 tHDF5.f90 fortranlib_test.f90 +fortranlib_test_SOURCES = tH5F.F90 tH5D.F90 tH5R.F90 tH5S.F90 tH5T.F90 tH5VL.F90 tH5Z.F90 \ + tH5Sselect.F90 tH5P.F90 tH5A.F90 tH5I.F90 tH5G.F90 tH5E.F90 tHDF5.F90 fortranlib_test.F90 -fortranlib_test_1_8_SOURCES = tH5O.f90 tH5A_1_8.f90 tH5G_1_8.f90 tH5MISC_1_8.f90 tHDF5_1_8.f90 \ - fortranlib_test_1_8.f90 +fortranlib_test_1_8_SOURCES = tH5O.F90 tH5A_1_8.F90 tH5G_1_8.F90 tH5MISC_1_8.F90 tHDF5_1_8.F90 \ + fortranlib_test_1_8.F90 -fortranlib_test_F03_SOURCES = tH5E_F03.f90 tH5F_F03.f90 tH5L_F03.f90 \ - tH5O_F03.f90 tH5P_F03.f90 tH5T_F03.F90 tHDF5_F03.f90 fortranlib_test_F03.f90 +fortranlib_test_F03_SOURCES = tH5E_F03.F90 tH5F_F03.F90 tH5L_F03.F90 \ + tH5O_F03.F90 tH5P_F03.F90 tH5T_F03.F90 tHDF5_F03.F90 fortranlib_test_F03.F90 -fflush1_SOURCES=fflush1.f90 -fflush2_SOURCES=fflush2.f90 +fflush1_SOURCES=fflush1.F90 +fflush2_SOURCES=fflush2.F90 # The tests depend on both fortran libraries and both main libraries. LDADD=libh5test_fortran.la $(LIBH5TEST) $(LIBH5F) $(LIBHDF5) diff --git a/fortran/test/Makefile.in b/fortran/test/Makefile.in index e65ed45..d51b42f 100644 --- a/fortran/test/Makefile.in +++ b/fortran/test/Makefile.in @@ -210,13 +210,6 @@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = -FCCOMPILE = $(FC) $(AM_FCFLAGS) $(FCFLAGS) -LTFCCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=FC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=compile $(FC) $(AM_FCFLAGS) $(FCFLAGS) -AM_V_FC = $(am__v_FC_@AM_V@) -am__v_FC_ = $(am__v_FC_@AM_DEFAULT_V@) -am__v_FC_0 = @echo " FC " $@; -am__v_FC_1 = SOURCES = $(libh5test_fortran_la_SOURCES) \ $(H5_test_buildiface_SOURCES) $(fflush1_SOURCES) \ $(fflush2_SOURCES) $(fortranlib_test_SOURCES) \ @@ -525,6 +518,7 @@ FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ +Fortran_COMPILER_ID = @Fortran_COMPILER_ID@ GREP = @GREP@ H5CONFIG_F_IKIND = @H5CONFIG_F_IKIND@ H5CONFIG_F_NUM_IKIND = @H5CONFIG_F_NUM_IKIND@ @@ -752,17 +746,17 @@ libh5test_fortran_la_SOURCES = tf_gen.F90 tf.F90 t.c # Automake will complain about this without the following workaround. fortranlib_test_FCFLAGS = $(AM_FCFLAGS) fortranlib_test_CFLAGS = $(AM_CFLAGS) -fortranlib_test_SOURCES = tH5F.f90 tH5D.f90 tH5R.f90 tH5S.f90 tH5T.f90 tH5VL.f90 tH5Z.f90 \ - tH5Sselect.f90 tH5P.f90 tH5A.f90 tH5I.f90 tH5G.f90 tH5E.f90 tHDF5.f90 fortranlib_test.f90 +fortranlib_test_SOURCES = tH5F.F90 tH5D.F90 tH5R.F90 tH5S.F90 tH5T.F90 tH5VL.F90 tH5Z.F90 \ + tH5Sselect.F90 tH5P.F90 tH5A.F90 tH5I.F90 tH5G.F90 tH5E.F90 tHDF5.F90 fortranlib_test.F90 -fortranlib_test_1_8_SOURCES = tH5O.f90 tH5A_1_8.f90 tH5G_1_8.f90 tH5MISC_1_8.f90 tHDF5_1_8.f90 \ - fortranlib_test_1_8.f90 +fortranlib_test_1_8_SOURCES = tH5O.F90 tH5A_1_8.F90 tH5G_1_8.F90 tH5MISC_1_8.F90 tHDF5_1_8.F90 \ + fortranlib_test_1_8.F90 -fortranlib_test_F03_SOURCES = tH5E_F03.f90 tH5F_F03.f90 tH5L_F03.f90 \ - tH5O_F03.f90 tH5P_F03.f90 tH5T_F03.F90 tHDF5_F03.f90 fortranlib_test_F03.f90 +fortranlib_test_F03_SOURCES = tH5E_F03.F90 tH5F_F03.F90 tH5L_F03.F90 \ + tH5O_F03.F90 tH5P_F03.F90 tH5T_F03.F90 tHDF5_F03.F90 fortranlib_test_F03.F90 -fflush1_SOURCES = fflush1.f90 -fflush2_SOURCES = fflush2.f90 +fflush1_SOURCES = fflush1.F90 +fflush2_SOURCES = fflush2.F90 # The tests depend on both fortran libraries and both main libraries. LDADD = libh5test_fortran.la $(LIBH5TEST) $(LIBH5F) $(LIBHDF5) @@ -907,122 +901,116 @@ distclean-compile: .F90.lo: $(AM_V_PPFC)$(LTPPFCCOMPILE) -c -o $@ $< -.c.o: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< - -.c.obj: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` - -.c.lo: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< +fortranlib_test-tH5F.o: tH5F.F90 + $(AM_V_PPFC)$(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fortranlib_test_FCFLAGS) $(FCFLAGS) -c -o fortranlib_test-tH5F.o `test -f 'tH5F.F90' || echo '$(srcdir)/'`tH5F.F90 -.f90.obj: - $(AM_V_FC)$(FCCOMPILE) -c -o $@ $(FCFLAGS_f90) `$(CYGPATH_W) '$<'` +fortranlib_test-tH5F.obj: tH5F.F90 + $(AM_V_PPFC)$(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fortranlib_test_FCFLAGS) $(FCFLAGS) -c -o fortranlib_test-tH5F.obj `if test -f 'tH5F.F90'; then $(CYGPATH_W) 'tH5F.F90'; else $(CYGPATH_W) '$(srcdir)/tH5F.F90'; fi` -.f90.lo: - $(AM_V_FC)$(LTFCCOMPILE) -c -o $@ $(FCFLAGS_f90) $< +fortranlib_test-tH5D.o: tH5D.F90 + $(AM_V_PPFC)$(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fortranlib_test_FCFLAGS) $(FCFLAGS) -c -o fortranlib_test-tH5D.o `test -f 'tH5D.F90' || echo '$(srcdir)/'`tH5D.F90 -fortranlib_test-tH5F.o: tH5F.f90 - $(AM_V_FC)$(FC) $(fortranlib_test_FCFLAGS) $(FCFLAGS) -c -o fortranlib_test-tH5F.o $(FCFLAGS_f90) `test -f 'tH5F.f90' || echo '$(srcdir)/'`tH5F.f90 +fortranlib_test-tH5D.obj: tH5D.F90 + $(AM_V_PPFC)$(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fortranlib_test_FCFLAGS) $(FCFLAGS) -c -o fortranlib_test-tH5D.obj `if test -f 'tH5D.F90'; then $(CYGPATH_W) 'tH5D.F90'; else $(CYGPATH_W) '$(srcdir)/tH5D.F90'; fi` -fortranlib_test-tH5F.obj: tH5F.f90 - $(AM_V_FC)$(FC) $(fortranlib_test_FCFLAGS) $(FCFLAGS) -c -o fortranlib_test-tH5F.obj $(FCFLAGS_f90) `if test -f 'tH5F.f90'; then $(CYGPATH_W) 'tH5F.f90'; else $(CYGPATH_W) '$(srcdir)/tH5F.f90'; fi` +fortranlib_test-tH5R.o: tH5R.F90 + $(AM_V_PPFC)$(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fortranlib_test_FCFLAGS) $(FCFLAGS) -c -o fortranlib_test-tH5R.o `test -f 'tH5R.F90' || echo '$(srcdir)/'`tH5R.F90 -fortranlib_test-tH5D.o: tH5D.f90 - $(AM_V_FC)$(FC) $(fortranlib_test_FCFLAGS) $(FCFLAGS) -c -o fortranlib_test-tH5D.o $(FCFLAGS_f90) `test -f 'tH5D.f90' || echo '$(srcdir)/'`tH5D.f90 +fortranlib_test-tH5R.obj: tH5R.F90 + $(AM_V_PPFC)$(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fortranlib_test_FCFLAGS) $(FCFLAGS) -c -o fortranlib_test-tH5R.obj `if test -f 'tH5R.F90'; then $(CYGPATH_W) 'tH5R.F90'; else $(CYGPATH_W) '$(srcdir)/tH5R.F90'; fi` -fortranlib_test-tH5D.obj: tH5D.f90 - $(AM_V_FC)$(FC) $(fortranlib_test_FCFLAGS) $(FCFLAGS) -c -o fortranlib_test-tH5D.obj $(FCFLAGS_f90) `if test -f 'tH5D.f90'; then $(CYGPATH_W) 'tH5D.f90'; else $(CYGPATH_W) '$(srcdir)/tH5D.f90'; fi` +fortranlib_test-tH5S.o: tH5S.F90 + $(AM_V_PPFC)$(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fortranlib_test_FCFLAGS) $(FCFLAGS) -c -o fortranlib_test-tH5S.o `test -f 'tH5S.F90' || echo '$(srcdir)/'`tH5S.F90 -fortranlib_test-tH5R.o: tH5R.f90 - $(AM_V_FC)$(FC) $(fortranlib_test_FCFLAGS) $(FCFLAGS) -c -o fortranlib_test-tH5R.o $(FCFLAGS_f90) `test -f 'tH5R.f90' || echo '$(srcdir)/'`tH5R.f90 +fortranlib_test-tH5S.obj: tH5S.F90 + $(AM_V_PPFC)$(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fortranlib_test_FCFLAGS) $(FCFLAGS) -c -o fortranlib_test-tH5S.obj `if test -f 'tH5S.F90'; then $(CYGPATH_W) 'tH5S.F90'; else $(CYGPATH_W) '$(srcdir)/tH5S.F90'; fi` -fortranlib_test-tH5R.obj: tH5R.f90 - $(AM_V_FC)$(FC) $(fortranlib_test_FCFLAGS) $(FCFLAGS) -c -o fortranlib_test-tH5R.obj $(FCFLAGS_f90) `if test -f 'tH5R.f90'; then $(CYGPATH_W) 'tH5R.f90'; else $(CYGPATH_W) '$(srcdir)/tH5R.f90'; fi` +fortranlib_test-tH5T.o: tH5T.F90 + $(AM_V_PPFC)$(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fortranlib_test_FCFLAGS) $(FCFLAGS) -c -o fortranlib_test-tH5T.o `test -f 'tH5T.F90' || echo '$(srcdir)/'`tH5T.F90 -fortranlib_test-tH5S.o: tH5S.f90 - $(AM_V_FC)$(FC) $(fortranlib_test_FCFLAGS) $(FCFLAGS) -c -o fortranlib_test-tH5S.o $(FCFLAGS_f90) `test -f 'tH5S.f90' || echo '$(srcdir)/'`tH5S.f90 +fortranlib_test-tH5T.obj: tH5T.F90 + $(AM_V_PPFC)$(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fortranlib_test_FCFLAGS) $(FCFLAGS) -c -o fortranlib_test-tH5T.obj `if test -f 'tH5T.F90'; then $(CYGPATH_W) 'tH5T.F90'; else $(CYGPATH_W) '$(srcdir)/tH5T.F90'; fi` -fortranlib_test-tH5S.obj: tH5S.f90 - $(AM_V_FC)$(FC) $(fortranlib_test_FCFLAGS) $(FCFLAGS) -c -o fortranlib_test-tH5S.obj $(FCFLAGS_f90) `if test -f 'tH5S.f90'; then $(CYGPATH_W) 'tH5S.f90'; else $(CYGPATH_W) '$(srcdir)/tH5S.f90'; fi` +fortranlib_test-tH5VL.o: tH5VL.F90 + $(AM_V_PPFC)$(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fortranlib_test_FCFLAGS) $(FCFLAGS) -c -o fortranlib_test-tH5VL.o `test -f 'tH5VL.F90' || echo '$(srcdir)/'`tH5VL.F90 -fortranlib_test-tH5T.o: tH5T.f90 - $(AM_V_FC)$(FC) $(fortranlib_test_FCFLAGS) $(FCFLAGS) -c -o fortranlib_test-tH5T.o $(FCFLAGS_f90) `test -f 'tH5T.f90' || echo '$(srcdir)/'`tH5T.f90 +fortranlib_test-tH5VL.obj: tH5VL.F90 + $(AM_V_PPFC)$(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fortranlib_test_FCFLAGS) $(FCFLAGS) -c -o fortranlib_test-tH5VL.obj `if test -f 'tH5VL.F90'; then $(CYGPATH_W) 'tH5VL.F90'; else $(CYGPATH_W) '$(srcdir)/tH5VL.F90'; fi` -fortranlib_test-tH5T.obj: tH5T.f90 - $(AM_V_FC)$(FC) $(fortranlib_test_FCFLAGS) $(FCFLAGS) -c -o fortranlib_test-tH5T.obj $(FCFLAGS_f90) `if test -f 'tH5T.f90'; then $(CYGPATH_W) 'tH5T.f90'; else $(CYGPATH_W) '$(srcdir)/tH5T.f90'; fi` +fortranlib_test-tH5Z.o: tH5Z.F90 + $(AM_V_PPFC)$(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fortranlib_test_FCFLAGS) $(FCFLAGS) -c -o fortranlib_test-tH5Z.o `test -f 'tH5Z.F90' || echo '$(srcdir)/'`tH5Z.F90 -fortranlib_test-tH5VL.o: tH5VL.f90 - $(AM_V_FC)$(FC) $(fortranlib_test_FCFLAGS) $(FCFLAGS) -c -o fortranlib_test-tH5VL.o $(FCFLAGS_f90) `test -f 'tH5VL.f90' || echo '$(srcdir)/'`tH5VL.f90 +fortranlib_test-tH5Z.obj: tH5Z.F90 + $(AM_V_PPFC)$(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fortranlib_test_FCFLAGS) $(FCFLAGS) -c -o fortranlib_test-tH5Z.obj `if test -f 'tH5Z.F90'; then $(CYGPATH_W) 'tH5Z.F90'; else $(CYGPATH_W) '$(srcdir)/tH5Z.F90'; fi` -fortranlib_test-tH5VL.obj: tH5VL.f90 - $(AM_V_FC)$(FC) $(fortranlib_test_FCFLAGS) $(FCFLAGS) -c -o fortranlib_test-tH5VL.obj $(FCFLAGS_f90) `if test -f 'tH5VL.f90'; then $(CYGPATH_W) 'tH5VL.f90'; else $(CYGPATH_W) '$(srcdir)/tH5VL.f90'; fi` +fortranlib_test-tH5Sselect.o: tH5Sselect.F90 + $(AM_V_PPFC)$(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fortranlib_test_FCFLAGS) $(FCFLAGS) -c -o fortranlib_test-tH5Sselect.o `test -f 'tH5Sselect.F90' || echo '$(srcdir)/'`tH5Sselect.F90 -fortranlib_test-tH5Z.o: tH5Z.f90 - $(AM_V_FC)$(FC) $(fortranlib_test_FCFLAGS) $(FCFLAGS) -c -o fortranlib_test-tH5Z.o $(FCFLAGS_f90) `test -f 'tH5Z.f90' || echo '$(srcdir)/'`tH5Z.f90 +fortranlib_test-tH5Sselect.obj: tH5Sselect.F90 + $(AM_V_PPFC)$(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fortranlib_test_FCFLAGS) $(FCFLAGS) -c -o fortranlib_test-tH5Sselect.obj `if test -f 'tH5Sselect.F90'; then $(CYGPATH_W) 'tH5Sselect.F90'; else $(CYGPATH_W) '$(srcdir)/tH5Sselect.F90'; fi` -fortranlib_test-tH5Z.obj: tH5Z.f90 - $(AM_V_FC)$(FC) $(fortranlib_test_FCFLAGS) $(FCFLAGS) -c -o fortranlib_test-tH5Z.obj $(FCFLAGS_f90) `if test -f 'tH5Z.f90'; then $(CYGPATH_W) 'tH5Z.f90'; else $(CYGPATH_W) '$(srcdir)/tH5Z.f90'; fi` +fortranlib_test-tH5P.o: tH5P.F90 + $(AM_V_PPFC)$(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fortranlib_test_FCFLAGS) $(FCFLAGS) -c -o fortranlib_test-tH5P.o `test -f 'tH5P.F90' || echo '$(srcdir)/'`tH5P.F90 -fortranlib_test-tH5Sselect.o: tH5Sselect.f90 - $(AM_V_FC)$(FC) $(fortranlib_test_FCFLAGS) $(FCFLAGS) -c -o fortranlib_test-tH5Sselect.o $(FCFLAGS_f90) `test -f 'tH5Sselect.f90' || echo '$(srcdir)/'`tH5Sselect.f90 +fortranlib_test-tH5P.obj: tH5P.F90 + $(AM_V_PPFC)$(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fortranlib_test_FCFLAGS) $(FCFLAGS) -c -o fortranlib_test-tH5P.obj `if test -f 'tH5P.F90'; then $(CYGPATH_W) 'tH5P.F90'; else $(CYGPATH_W) '$(srcdir)/tH5P.F90'; fi` -fortranlib_test-tH5Sselect.obj: tH5Sselect.f90 - $(AM_V_FC)$(FC) $(fortranlib_test_FCFLAGS) $(FCFLAGS) -c -o fortranlib_test-tH5Sselect.obj $(FCFLAGS_f90) `if test -f 'tH5Sselect.f90'; then $(CYGPATH_W) 'tH5Sselect.f90'; else $(CYGPATH_W) '$(srcdir)/tH5Sselect.f90'; fi` +fortranlib_test-tH5A.o: tH5A.F90 + $(AM_V_PPFC)$(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fortranlib_test_FCFLAGS) $(FCFLAGS) -c -o fortranlib_test-tH5A.o `test -f 'tH5A.F90' || echo '$(srcdir)/'`tH5A.F90 -fortranlib_test-tH5P.o: tH5P.f90 - $(AM_V_FC)$(FC) $(fortranlib_test_FCFLAGS) $(FCFLAGS) -c -o fortranlib_test-tH5P.o $(FCFLAGS_f90) `test -f 'tH5P.f90' || echo '$(srcdir)/'`tH5P.f90 +fortranlib_test-tH5A.obj: tH5A.F90 + $(AM_V_PPFC)$(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fortranlib_test_FCFLAGS) $(FCFLAGS) -c -o fortranlib_test-tH5A.obj `if test -f 'tH5A.F90'; then $(CYGPATH_W) 'tH5A.F90'; else $(CYGPATH_W) '$(srcdir)/tH5A.F90'; fi` -fortranlib_test-tH5P.obj: tH5P.f90 - $(AM_V_FC)$(FC) $(fortranlib_test_FCFLAGS) $(FCFLAGS) -c -o fortranlib_test-tH5P.obj $(FCFLAGS_f90) `if test -f 'tH5P.f90'; then $(CYGPATH_W) 'tH5P.f90'; else $(CYGPATH_W) '$(srcdir)/tH5P.f90'; fi` +fortranlib_test-tH5I.o: tH5I.F90 + $(AM_V_PPFC)$(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fortranlib_test_FCFLAGS) $(FCFLAGS) -c -o fortranlib_test-tH5I.o `test -f 'tH5I.F90' || echo '$(srcdir)/'`tH5I.F90 -fortranlib_test-tH5A.o: tH5A.f90 - $(AM_V_FC)$(FC) $(fortranlib_test_FCFLAGS) $(FCFLAGS) -c -o fortranlib_test-tH5A.o $(FCFLAGS_f90) `test -f 'tH5A.f90' || echo '$(srcdir)/'`tH5A.f90 +fortranlib_test-tH5I.obj: tH5I.F90 + $(AM_V_PPFC)$(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fortranlib_test_FCFLAGS) $(FCFLAGS) -c -o fortranlib_test-tH5I.obj `if test -f 'tH5I.F90'; then $(CYGPATH_W) 'tH5I.F90'; else $(CYGPATH_W) '$(srcdir)/tH5I.F90'; fi` -fortranlib_test-tH5A.obj: tH5A.f90 - $(AM_V_FC)$(FC) $(fortranlib_test_FCFLAGS) $(FCFLAGS) -c -o fortranlib_test-tH5A.obj $(FCFLAGS_f90) `if test -f 'tH5A.f90'; then $(CYGPATH_W) 'tH5A.f90'; else $(CYGPATH_W) '$(srcdir)/tH5A.f90'; fi` +fortranlib_test-tH5G.o: tH5G.F90 + $(AM_V_PPFC)$(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fortranlib_test_FCFLAGS) $(FCFLAGS) -c -o fortranlib_test-tH5G.o `test -f 'tH5G.F90' || echo '$(srcdir)/'`tH5G.F90 -fortranlib_test-tH5I.o: tH5I.f90 - $(AM_V_FC)$(FC) $(fortranlib_test_FCFLAGS) $(FCFLAGS) -c -o fortranlib_test-tH5I.o $(FCFLAGS_f90) `test -f 'tH5I.f90' || echo '$(srcdir)/'`tH5I.f90 +fortranlib_test-tH5G.obj: tH5G.F90 + $(AM_V_PPFC)$(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fortranlib_test_FCFLAGS) $(FCFLAGS) -c -o fortranlib_test-tH5G.obj `if test -f 'tH5G.F90'; then $(CYGPATH_W) 'tH5G.F90'; else $(CYGPATH_W) '$(srcdir)/tH5G.F90'; fi` -fortranlib_test-tH5I.obj: tH5I.f90 - $(AM_V_FC)$(FC) $(fortranlib_test_FCFLAGS) $(FCFLAGS) -c -o fortranlib_test-tH5I.obj $(FCFLAGS_f90) `if test -f 'tH5I.f90'; then $(CYGPATH_W) 'tH5I.f90'; else $(CYGPATH_W) '$(srcdir)/tH5I.f90'; fi` +fortranlib_test-tH5E.o: tH5E.F90 + $(AM_V_PPFC)$(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fortranlib_test_FCFLAGS) $(FCFLAGS) -c -o fortranlib_test-tH5E.o `test -f 'tH5E.F90' || echo '$(srcdir)/'`tH5E.F90 -fortranlib_test-tH5G.o: tH5G.f90 - $(AM_V_FC)$(FC) $(fortranlib_test_FCFLAGS) $(FCFLAGS) -c -o fortranlib_test-tH5G.o $(FCFLAGS_f90) `test -f 'tH5G.f90' || echo '$(srcdir)/'`tH5G.f90 +fortranlib_test-tH5E.obj: tH5E.F90 + $(AM_V_PPFC)$(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fortranlib_test_FCFLAGS) $(FCFLAGS) -c -o fortranlib_test-tH5E.obj `if test -f 'tH5E.F90'; then $(CYGPATH_W) 'tH5E.F90'; else $(CYGPATH_W) '$(srcdir)/tH5E.F90'; fi` -fortranlib_test-tH5G.obj: tH5G.f90 - $(AM_V_FC)$(FC) $(fortranlib_test_FCFLAGS) $(FCFLAGS) -c -o fortranlib_test-tH5G.obj $(FCFLAGS_f90) `if test -f 'tH5G.f90'; then $(CYGPATH_W) 'tH5G.f90'; else $(CYGPATH_W) '$(srcdir)/tH5G.f90'; fi` +fortranlib_test-tHDF5.o: tHDF5.F90 + $(AM_V_PPFC)$(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fortranlib_test_FCFLAGS) $(FCFLAGS) -c -o fortranlib_test-tHDF5.o `test -f 'tHDF5.F90' || echo '$(srcdir)/'`tHDF5.F90 -fortranlib_test-tH5E.o: tH5E.f90 - $(AM_V_FC)$(FC) $(fortranlib_test_FCFLAGS) $(FCFLAGS) -c -o fortranlib_test-tH5E.o $(FCFLAGS_f90) `test -f 'tH5E.f90' || echo '$(srcdir)/'`tH5E.f90 +fortranlib_test-tHDF5.obj: tHDF5.F90 + $(AM_V_PPFC)$(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fortranlib_test_FCFLAGS) $(FCFLAGS) -c -o fortranlib_test-tHDF5.obj `if test -f 'tHDF5.F90'; then $(CYGPATH_W) 'tHDF5.F90'; else $(CYGPATH_W) '$(srcdir)/tHDF5.F90'; fi` -fortranlib_test-tH5E.obj: tH5E.f90 - $(AM_V_FC)$(FC) $(fortranlib_test_FCFLAGS) $(FCFLAGS) -c -o fortranlib_test-tH5E.obj $(FCFLAGS_f90) `if test -f 'tH5E.f90'; then $(CYGPATH_W) 'tH5E.f90'; else $(CYGPATH_W) '$(srcdir)/tH5E.f90'; fi` +fortranlib_test-fortranlib_test.o: fortranlib_test.F90 + $(AM_V_PPFC)$(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fortranlib_test_FCFLAGS) $(FCFLAGS) -c -o fortranlib_test-fortranlib_test.o `test -f 'fortranlib_test.F90' || echo '$(srcdir)/'`fortranlib_test.F90 -fortranlib_test-tHDF5.o: tHDF5.f90 - $(AM_V_FC)$(FC) $(fortranlib_test_FCFLAGS) $(FCFLAGS) -c -o fortranlib_test-tHDF5.o $(FCFLAGS_f90) `test -f 'tHDF5.f90' || echo '$(srcdir)/'`tHDF5.f90 +fortranlib_test-fortranlib_test.obj: fortranlib_test.F90 + $(AM_V_PPFC)$(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fortranlib_test_FCFLAGS) $(FCFLAGS) -c -o fortranlib_test-fortranlib_test.obj `if test -f 'fortranlib_test.F90'; then $(CYGPATH_W) 'fortranlib_test.F90'; else $(CYGPATH_W) '$(srcdir)/fortranlib_test.F90'; fi` -fortranlib_test-tHDF5.obj: tHDF5.f90 - $(AM_V_FC)$(FC) $(fortranlib_test_FCFLAGS) $(FCFLAGS) -c -o fortranlib_test-tHDF5.obj $(FCFLAGS_f90) `if test -f 'tHDF5.f90'; then $(CYGPATH_W) 'tHDF5.f90'; else $(CYGPATH_W) '$(srcdir)/tHDF5.f90'; fi` +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< -fortranlib_test-fortranlib_test.o: fortranlib_test.f90 - $(AM_V_FC)$(FC) $(fortranlib_test_FCFLAGS) $(FCFLAGS) -c -o fortranlib_test-fortranlib_test.o $(FCFLAGS_f90) `test -f 'fortranlib_test.f90' || echo '$(srcdir)/'`fortranlib_test.f90 +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` -fortranlib_test-fortranlib_test.obj: fortranlib_test.f90 - $(AM_V_FC)$(FC) $(fortranlib_test_FCFLAGS) $(FCFLAGS) -c -o fortranlib_test-fortranlib_test.obj $(FCFLAGS_f90) `if test -f 'fortranlib_test.f90'; then $(CYGPATH_W) 'fortranlib_test.f90'; else $(CYGPATH_W) '$(srcdir)/fortranlib_test.f90'; fi` +.c.lo: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo diff --git a/fortran/test/fflush1.F90 b/fortran/test/fflush1.F90 new file mode 100644 index 0000000..ca2550f --- /dev/null +++ b/fortran/test/fflush1.F90 @@ -0,0 +1,157 @@ +!****h* root/fortran/test/fflush1.f90 +! +! NAME +! FFLUSH1EXAMPLE +! +! FUNCTION +! This is the first half of a two-part test that makes sure +! that a file can be read after an application crashes as long +! as the file was flushed first. We simulate by exit the +! the program using stop statement +! +! 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. * +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! +!***** + + PROGRAM FFLUSH1EXAMPLE + + USE HDF5 ! This module contains all necessary modules + USE TH5_MISC + + IMPLICIT NONE + + ! + !the respective filename is "fflush1.h5" + ! + CHARACTER(LEN=7), PARAMETER :: filename = "fflush1" + CHARACTER(LEN=80) :: fix_filename + + ! + !data space rank and dimensions + ! + INTEGER, PARAMETER :: RANK = 2 + INTEGER, PARAMETER :: NX = 4 + INTEGER, PARAMETER :: NY = 5 + + ! + ! File identifiers + ! + INTEGER(HID_T) :: file_id + + ! + ! Group identifier + ! + INTEGER(HID_T) :: gid + + ! + ! dataset identifier + ! + INTEGER(HID_T) :: dset_id + + ! + ! data space identifier + ! + INTEGER(HID_T) :: dataspace + ! + !The dimensions for the dataset. + ! + INTEGER(HSIZE_T), DIMENSION(2) :: dims = (/NX,NY/) + + ! + !flag to check operation success + ! + INTEGER :: error + + ! + !general purpose integer + ! + INTEGER :: i, j, total_error = 0 + + ! + !data buffers + ! + INTEGER, DIMENSION(NX,NY) :: data_in + INTEGER(HSIZE_T), DIMENSION(2) :: data_dims + data_dims(1) = NX + data_dims(2) = NY + + ! + !Initialize FORTRAN predifined datatypes + ! + CALL h5open_f(error) + CALL check("h5open_f",error,total_error) + + ! + !Initialize data_in buffer + ! + do i = 1, NX + do j = 1, NY + data_in(i,j) = (i-1) + (j-1) + end do + end do + + ! + !Create file "fflush1.h5" using default properties. + ! + CALL h5_fixname_f(filename, fix_filename, H5P_DEFAULT_F, error) + if (error .ne. 0) then + write(*,*) "Cannot modify filename" + CALL h5_exit_f (1) + endif + CALL h5fcreate_f(fix_filename, H5F_ACC_TRUNC_F, file_id, error) + CALL check("h5fcreate_f",error,total_error) + + ! + !Create group "/G" inside file "fflush1.h5". + ! + CALL h5gcreate_f(file_id, "/G", gid, error) + CALL check("h5gcreate_f",error,total_error) + + ! + !Create data space for the dataset. + ! + CALL h5screate_simple_f(RANK, dims, dataspace, error) + CALL check("h5screate_simple_f",error,total_error) + + ! + !Create dataset "/D" inside file "fflush1.h5". + ! + CALL h5dcreate_f(file_id, "/D", H5T_NATIVE_INTEGER, dataspace, & + dset_id, error) + CALL check("h5dcreate_f",error,total_error) + + ! + ! Write data_in to the dataset + ! + CALL h5dwrite_f(dset_id, H5T_NATIVE_INTEGER, data_in, data_dims, error) + CALL check("h5dwrite_f",error,total_error) + + ! + !flush and exit without closing the library + ! + CALL H5fflush_f(file_id, H5F_SCOPE_GLOBAL_F, error) + CALL check("h5fflush_f",error,total_error) + + ! if errors detected, exit with non-zero code. + IF (total_error .ne. 0) CALL h5_exit_f (1) + + + STOP + + + END PROGRAM FFLUSH1EXAMPLE + diff --git a/fortran/test/fflush1.f90 b/fortran/test/fflush1.f90 deleted file mode 100644 index ca2550f..0000000 --- a/fortran/test/fflush1.f90 +++ /dev/null @@ -1,157 +0,0 @@ -!****h* root/fortran/test/fflush1.f90 -! -! NAME -! FFLUSH1EXAMPLE -! -! FUNCTION -! This is the first half of a two-part test that makes sure -! that a file can be read after an application crashes as long -! as the file was flushed first. We simulate by exit the -! the program using stop statement -! -! 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. * -! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -! -!***** - - PROGRAM FFLUSH1EXAMPLE - - USE HDF5 ! This module contains all necessary modules - USE TH5_MISC - - IMPLICIT NONE - - ! - !the respective filename is "fflush1.h5" - ! - CHARACTER(LEN=7), PARAMETER :: filename = "fflush1" - CHARACTER(LEN=80) :: fix_filename - - ! - !data space rank and dimensions - ! - INTEGER, PARAMETER :: RANK = 2 - INTEGER, PARAMETER :: NX = 4 - INTEGER, PARAMETER :: NY = 5 - - ! - ! File identifiers - ! - INTEGER(HID_T) :: file_id - - ! - ! Group identifier - ! - INTEGER(HID_T) :: gid - - ! - ! dataset identifier - ! - INTEGER(HID_T) :: dset_id - - ! - ! data space identifier - ! - INTEGER(HID_T) :: dataspace - ! - !The dimensions for the dataset. - ! - INTEGER(HSIZE_T), DIMENSION(2) :: dims = (/NX,NY/) - - ! - !flag to check operation success - ! - INTEGER :: error - - ! - !general purpose integer - ! - INTEGER :: i, j, total_error = 0 - - ! - !data buffers - ! - INTEGER, DIMENSION(NX,NY) :: data_in - INTEGER(HSIZE_T), DIMENSION(2) :: data_dims - data_dims(1) = NX - data_dims(2) = NY - - ! - !Initialize FORTRAN predifined datatypes - ! - CALL h5open_f(error) - CALL check("h5open_f",error,total_error) - - ! - !Initialize data_in buffer - ! - do i = 1, NX - do j = 1, NY - data_in(i,j) = (i-1) + (j-1) - end do - end do - - ! - !Create file "fflush1.h5" using default properties. - ! - CALL h5_fixname_f(filename, fix_filename, H5P_DEFAULT_F, error) - if (error .ne. 0) then - write(*,*) "Cannot modify filename" - CALL h5_exit_f (1) - endif - CALL h5fcreate_f(fix_filename, H5F_ACC_TRUNC_F, file_id, error) - CALL check("h5fcreate_f",error,total_error) - - ! - !Create group "/G" inside file "fflush1.h5". - ! - CALL h5gcreate_f(file_id, "/G", gid, error) - CALL check("h5gcreate_f",error,total_error) - - ! - !Create data space for the dataset. - ! - CALL h5screate_simple_f(RANK, dims, dataspace, error) - CALL check("h5screate_simple_f",error,total_error) - - ! - !Create dataset "/D" inside file "fflush1.h5". - ! - CALL h5dcreate_f(file_id, "/D", H5T_NATIVE_INTEGER, dataspace, & - dset_id, error) - CALL check("h5dcreate_f",error,total_error) - - ! - ! Write data_in to the dataset - ! - CALL h5dwrite_f(dset_id, H5T_NATIVE_INTEGER, data_in, data_dims, error) - CALL check("h5dwrite_f",error,total_error) - - ! - !flush and exit without closing the library - ! - CALL H5fflush_f(file_id, H5F_SCOPE_GLOBAL_F, error) - CALL check("h5fflush_f",error,total_error) - - ! if errors detected, exit with non-zero code. - IF (total_error .ne. 0) CALL h5_exit_f (1) - - - STOP - - - END PROGRAM FFLUSH1EXAMPLE - diff --git a/fortran/test/fflush2.F90 b/fortran/test/fflush2.F90 new file mode 100644 index 0000000..4230832 --- /dev/null +++ b/fortran/test/fflush2.F90 @@ -0,0 +1,177 @@ +!****h* root/fortran/test/fflush2.f90 +! +! NAME +! fflush2.f90 +! +! FUNCTION +! This is the second half of a two-part test that makes sure +! that a file can be read after an application crashes as long +! as the file was flushed first. This half tries to read the +! file created by the first half. +! +! 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. * +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! +!***** + +PROGRAM FFLUSH2EXAMPLE + + USE HDF5 ! This module contains all necessary modules + USE TH5_MISC + + IMPLICIT NONE + + CHARACTER(LEN=7), PARAMETER :: filename = "fflush1" + CHARACTER(LEN=80) :: fix_filename + + ! + !data space rank and dimensions + ! + INTEGER, PARAMETER :: NX = 4 + INTEGER, PARAMETER :: NY = 5 + + ! + ! File identifiers + ! + INTEGER(HID_T) :: file_id + + ! + ! Group identifier + ! + INTEGER(HID_T) :: gid + + ! + ! dataset identifier + ! + INTEGER(HID_T) :: dset_id + + + ! + ! data type identifier + ! + INTEGER(HID_T) :: dtype_id + + ! + !flag to check operation success + ! + INTEGER :: error + + ! + !general purpose integer + ! + INTEGER :: i, j, total_error = 0 + + ! + !data buffers + ! + INTEGER, DIMENSION(NX,NY) :: data_out + INTEGER(HSIZE_T), DIMENSION(2) :: data_dims + data_dims(1) = NX + data_dims(2) = NY + + ! + !Initialize FORTRAN predifined datatypes + ! + CALL h5open_f(error) + CALL check("h5open_f",error,total_error) + + ! + !Open the file. + ! + CALL h5_fixname_f(filename, fix_filename, H5P_DEFAULT_F, error) + IF (error .NE. 0) THEN + WRITE(*,*) "Cannot modify filename" + CALL h5_exit_f (1) + ENDIF + CALL h5fopen_f(fix_filename, H5F_ACC_RDONLY_F, file_id, error) + CALL check("h5fopen_f",error,total_error) + + ! + !Open the dataset + ! + CALL h5dopen_f(file_id, "/D", dset_id, error) + CALL check("h5dopen_f",error,total_error) + + ! + !Get dataset's data type. + ! + CALL h5dget_type_f(dset_id, dtype_id, error) + CALL check("h5dget_type_f",error,total_error) + ! + !Read the dataset. + ! + CALL h5dread_f(dset_id, dtype_id, data_out, data_dims, error) + CALL check("h5dread_f",error,total_error) + + ! + !Print the dataset. + ! + DO i = 1, NX + WRITE(*,*) (data_out(i,j), j = 1, NY) + END DO + ! + !result of the print statement + ! + ! 0, 1, 2, 3, 4 + ! 1, 2, 3, 4, 5 + ! 2, 3, 4, 5, 6 + ! 3, 4, 5, 6, 7 + + ! + !Open the group. + ! + CALL h5gopen_f(file_id, "G", gid, error) + CALL check("h5gopen_f",error,total_error) + + ! + !In case error happens, exit. + ! + IF (error == -1) CALL h5_exit_f (1) + ! + !Close the datatype + ! + CALL h5tclose_f(dtype_id, error) + CALL check("h5tclose_f",error,total_error) + + ! + !Close the dataset. + ! + CALL h5dclose_f(dset_id, error) + CALL check("h5dclose_f",error,total_error) + + ! + !Close the group. + ! + CALL h5gclose_f(gid, error) + CALL check("h5gclose_f",error,total_error) + + ! + !Close the file. + ! + CALL h5fclose_f(file_id, error) + CALL check("h5fclose_f",error,total_error) + + ! + !Close FORTRAN predifined datatypes + ! + CALL h5_cleanup_f(filename, H5P_DEFAULT_F, error) + CALL h5close_f(error) + CALL check("h5close_types_f",error,total_error) + + ! if errors detected, exit with non-zero code. + IF (total_error .ne. 0) CALL h5_exit_f (1) + +END PROGRAM FFLUSH2EXAMPLE diff --git a/fortran/test/fflush2.f90 b/fortran/test/fflush2.f90 deleted file mode 100644 index 4230832..0000000 --- a/fortran/test/fflush2.f90 +++ /dev/null @@ -1,177 +0,0 @@ -!****h* root/fortran/test/fflush2.f90 -! -! NAME -! fflush2.f90 -! -! FUNCTION -! This is the second half of a two-part test that makes sure -! that a file can be read after an application crashes as long -! as the file was flushed first. This half tries to read the -! file created by the first half. -! -! 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. * -! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -! -!***** - -PROGRAM FFLUSH2EXAMPLE - - USE HDF5 ! This module contains all necessary modules - USE TH5_MISC - - IMPLICIT NONE - - CHARACTER(LEN=7), PARAMETER :: filename = "fflush1" - CHARACTER(LEN=80) :: fix_filename - - ! - !data space rank and dimensions - ! - INTEGER, PARAMETER :: NX = 4 - INTEGER, PARAMETER :: NY = 5 - - ! - ! File identifiers - ! - INTEGER(HID_T) :: file_id - - ! - ! Group identifier - ! - INTEGER(HID_T) :: gid - - ! - ! dataset identifier - ! - INTEGER(HID_T) :: dset_id - - - ! - ! data type identifier - ! - INTEGER(HID_T) :: dtype_id - - ! - !flag to check operation success - ! - INTEGER :: error - - ! - !general purpose integer - ! - INTEGER :: i, j, total_error = 0 - - ! - !data buffers - ! - INTEGER, DIMENSION(NX,NY) :: data_out - INTEGER(HSIZE_T), DIMENSION(2) :: data_dims - data_dims(1) = NX - data_dims(2) = NY - - ! - !Initialize FORTRAN predifined datatypes - ! - CALL h5open_f(error) - CALL check("h5open_f",error,total_error) - - ! - !Open the file. - ! - CALL h5_fixname_f(filename, fix_filename, H5P_DEFAULT_F, error) - IF (error .NE. 0) THEN - WRITE(*,*) "Cannot modify filename" - CALL h5_exit_f (1) - ENDIF - CALL h5fopen_f(fix_filename, H5F_ACC_RDONLY_F, file_id, error) - CALL check("h5fopen_f",error,total_error) - - ! - !Open the dataset - ! - CALL h5dopen_f(file_id, "/D", dset_id, error) - CALL check("h5dopen_f",error,total_error) - - ! - !Get dataset's data type. - ! - CALL h5dget_type_f(dset_id, dtype_id, error) - CALL check("h5dget_type_f",error,total_error) - ! - !Read the dataset. - ! - CALL h5dread_f(dset_id, dtype_id, data_out, data_dims, error) - CALL check("h5dread_f",error,total_error) - - ! - !Print the dataset. - ! - DO i = 1, NX - WRITE(*,*) (data_out(i,j), j = 1, NY) - END DO - ! - !result of the print statement - ! - ! 0, 1, 2, 3, 4 - ! 1, 2, 3, 4, 5 - ! 2, 3, 4, 5, 6 - ! 3, 4, 5, 6, 7 - - ! - !Open the group. - ! - CALL h5gopen_f(file_id, "G", gid, error) - CALL check("h5gopen_f",error,total_error) - - ! - !In case error happens, exit. - ! - IF (error == -1) CALL h5_exit_f (1) - ! - !Close the datatype - ! - CALL h5tclose_f(dtype_id, error) - CALL check("h5tclose_f",error,total_error) - - ! - !Close the dataset. - ! - CALL h5dclose_f(dset_id, error) - CALL check("h5dclose_f",error,total_error) - - ! - !Close the group. - ! - CALL h5gclose_f(gid, error) - CALL check("h5gclose_f",error,total_error) - - ! - !Close the file. - ! - CALL h5fclose_f(file_id, error) - CALL check("h5fclose_f",error,total_error) - - ! - !Close FORTRAN predifined datatypes - ! - CALL h5_cleanup_f(filename, H5P_DEFAULT_F, error) - CALL h5close_f(error) - CALL check("h5close_types_f",error,total_error) - - ! if errors detected, exit with non-zero code. - IF (total_error .ne. 0) CALL h5_exit_f (1) - -END PROGRAM FFLUSH2EXAMPLE diff --git a/fortran/test/fortranlib_test.F90 b/fortran/test/fortranlib_test.F90 new file mode 100644 index 0000000..c3e995b --- /dev/null +++ b/fortran/test/fortranlib_test.F90 @@ -0,0 +1,255 @@ +!****h* root/fortran/test/fortranlib_test.f90 +! +! NAME +! fortranlib_test.f90 +! +! FUNCTION +! Basic testing of Fortran API's functionality. +! +! 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. * +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! +!***** + +PROGRAM fortranlibtest + + USE HDF5 + USE THDF5 + + IMPLICIT NONE + INTEGER :: total_error = 0 + INTEGER :: error + INTEGER :: majnum, minnum, relnum + LOGICAL :: szip_flag + INTEGER :: ret_total_error + LOGICAL :: cleanup, status + + CALL h5open_f(error) + + cleanup = .TRUE. + CALL h5_env_nocleanup_f(status) + IF(status) cleanup=.FALSE. + + WRITE(*,*) ' ========================== ' + WRITE(*,*) ' FORTRAN tests ' + WRITE(*,*) ' ========================== ' + CALL h5get_libversion_f(majnum, minnum, relnum, total_error) + IF(total_error .EQ. 0) THEN + + WRITE(*, '(" FORTRANLIB_TEST is linked with HDF5 Library version ")', advance="NO") + WRITE(*, '(I1)', advance="NO") majnum + WRITE(*, '(".")', advance="NO") + WRITE(*, '(I1)', advance="NO") minnum + WRITE(*, '(" release ")', advance="NO") + WRITE(*, '(I3)') relnum + ELSE + total_error = total_error + 1 + ENDIF + WRITE(*,*) + +! CALL h5check_version_f(1,4,4,total_error) +! write(*,*) '=========================================' +! write(*,*) 'Testing FILE Interface ' +! write(*,*) '=========================================' + + ret_total_error = 0 + CALL mountingtest(cleanup, ret_total_error) + CALL write_test_status(ret_total_error, ' Mounting test', total_error) + + ret_total_error = 0 + CALL reopentest(cleanup, ret_total_error) + CALL write_test_status(ret_total_error, ' Reopen test', total_error) + + ret_total_error = 0 + CALL file_close(cleanup, ret_total_error) + CALL write_test_status(ret_total_error, ' File open/close test', total_error) + + ret_total_error = 0 + CALL file_space("file_space",cleanup, ret_total_error) + CALL write_test_status(ret_total_error, ' File free space test', total_error) + +! write(*,*) +! write(*,*) '=========================================' +! write(*,*) 'Testing DATASET Interface ' +! write(*,*) '=========================================' + + ret_total_error = 0 + CALL datasettest(cleanup, ret_total_error) + CALL write_test_status(ret_total_error, ' Dataset test', total_error) + + ret_total_error = 0 + CALL extenddsettest(cleanup, ret_total_error) + CALL write_test_status(ret_total_error, ' Extendible dataset test', total_error) + +! -- DISABLE TEST FOR PGI COMPILER DUE TO COMPILER BUG -- 8/2015 -- HDFFV-9498 +!#if H5_Fortran_COMPILER_ID!=PGI +! CALL test_userblock_offset(cleanup, ret_total_error) +! CALL write_test_status(ret_total_error, ' Dataset offset with user block', total_error) +!#endif + +! write(*,*) +! write(*,*) '=========================================' +! write(*,*) 'Testing DATASPACE Interface ' +! write(*,*) '=========================================' + + ret_total_error = 0 + CALL dataspace_basic_test(cleanup, ret_total_error) + CALL write_test_status(ret_total_error, ' Basic dataspace test', total_error) + +! write(*,*) +! write(*,*) '=========================================' +! write(*,*) 'Testing REFERENCE Interface ' +! write(*,*) '=========================================' + + ret_total_error = 0 + CALL refobjtest(cleanup, ret_total_error) + CALL write_test_status(ret_total_error, ' Reference to object test', total_error) + + ret_total_error = 0 + CALL refregtest(cleanup, ret_total_error) + CALL write_test_status(ret_total_error, ' Reference to dataset region test', total_error) + +! write(*,*) +! write(*,*) '=========================================' +! write(*,*) 'Testing selection functionalities ' +! write(*,*) '=========================================' + + ret_total_error = 0 + CALL test_basic_select(cleanup, ret_total_error) + CALL write_test_status(ret_total_error, ' Basic selection test', total_error) + + + ret_total_error = 0 + CALL test_select_hyperslab( cleanup, ret_total_error) + CALL write_test_status(ret_total_error, ' Hyperslab selection test', total_error) + + ret_total_error = 0 + CALL test_select_element(cleanup, ret_total_error) + CALL write_test_status(ret_total_error, ' Element selection test', total_error) + + ret_total_error = 0 + CALL test_select_point(cleanup, ret_total_error) + CALL write_test_status(ret_total_error, ' Element selection functions test ', total_error) + + ret_total_error = 0 + CALL test_select_combine(ret_total_error) + CALL write_test_status(ret_total_error, ' Selection combinations test ', total_error) + + ret_total_error = 0 + CALL test_select_bounds(ret_total_error) + CALL write_test_status(ret_total_error, ' Selection bounds test ', total_error) + +! write(*,*) +! write(*,*) '=========================================' +! write(*,*) 'Testing DATATYPE interface ' +! write(*,*) '=========================================' + ret_total_error = 0 + CALL basic_data_type_test(ret_total_error) + CALL write_test_status(ret_total_error, ' Basic datatype test', total_error) + + ret_total_error = 0 + CALL compoundtest(cleanup, ret_total_error) + CALL write_test_status(ret_total_error, ' Compound datatype test', total_error) + + ret_total_error = 0 + CALL enumtest(cleanup, ret_total_error) + CALL write_test_status(ret_total_error, ' Enum datatype test', total_error) + + ret_total_error = 0 + CALL test_derived_flt(cleanup, ret_total_error) + CALL write_test_status(ret_total_error, ' Derived float datatype test', total_error) + +! write(*,*) +! write(*,*) '=========================================' +! write(*,*) 'Testing PROPERTY interface ' +! write(*,*) '=========================================' + + ret_total_error = 0 + CALL external_test(cleanup, ret_total_error) + CALL write_test_status(ret_total_error, ' External dataset test', total_error) + + ret_total_error = 0 + CALL multi_file_test(cleanup, ret_total_error) + CALL write_test_status(ret_total_error, ' Multi file driver test', total_error) + + ret_total_error = 0 + CALL test_chunk_cache (cleanup, ret_total_error) + CALL write_test_status(ret_total_error, ' Dataset chunk cache configuration', total_error) + +! write(*,*) +! write(*,*) '=========================================' +! write(*,*) 'Testing ATTRIBUTE interface ' +! write(*,*) '=========================================' + + ret_total_error = 0 + CALL attribute_test(cleanup, ret_total_error) + CALL write_test_status(ret_total_error, ' Attribute test', total_error) + +! write(*,*) +! write(*,*) '=========================================' +! write(*,*) 'Testing IDENTIFIER interface ' +! write(*,*) '=========================================' + + ret_total_error = 0 + CALL identifier_test(cleanup, ret_total_error) + CALL write_test_status(ret_total_error, ' Identifier test', total_error) + + ret_total_error = 0 + CALL filters_test(ret_total_error) + CALL write_test_status(ret_total_error, ' Filters test', total_error) + + ret_total_error = 0 + CALL szip_test(szip_flag, cleanup, ret_total_error) + + IF (.NOT. szip_flag) THEN ! test not available + CALL write_test_status(-1, ' SZIP filter test', total_error) + ELSE + CALL write_test_status(ret_total_error, ' SZIP filter test', total_error) + ENDIF + +! write(*,*) +! write(*,*) '=========================================' +! write(*,*) 'Testing GROUP interface ' +! write(*,*) '=========================================' + + ret_total_error = 0 + CALL group_test(cleanup, ret_total_error) + CALL write_test_status(ret_total_error, ' Group test', total_error) + + ret_total_error = 0 + CALL error_report_test(cleanup, ret_total_error) + CALL write_test_status(ret_total_error, ' Error test', total_error) + + ret_total_error = 0 + CALL vl_test_integer(cleanup, ret_total_error) + CALL vl_test_real(cleanup, ret_total_error) + CALL vl_test_string(cleanup, ret_total_error) + CALL write_test_status(ret_total_error, ' VL test', total_error) + + WRITE(*,*) + + WRITE(*,*) ' ============================================ ' + WRITE(*, fmt = '(19x, 27a)', advance='NO') ' FORTRAN tests completed with ' + WRITE(*, fmt = '(i4)', advance='NO') total_error + WRITE(*, fmt = '(12a)' ) ' error(s) ! ' + WRITE(*,*) ' ============================================ ' + + CALL h5close_f(error) + + ! if errors detected, exit with non-zero code. + IF (total_error .NE. 0) CALL h5_exit_f (1) + +END PROGRAM fortranlibtest diff --git a/fortran/test/fortranlib_test.f90 b/fortran/test/fortranlib_test.f90 deleted file mode 100644 index f41d811..0000000 --- a/fortran/test/fortranlib_test.f90 +++ /dev/null @@ -1,252 +0,0 @@ -!****h* root/fortran/test/fortranlib_test.f90 -! -! NAME -! fortranlib_test.f90 -! -! FUNCTION -! Basic testing of Fortran API's functionality. -! -! 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. * -! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -! -!***** - -PROGRAM fortranlibtest - - USE HDF5 - USE THDF5 - - IMPLICIT NONE - INTEGER :: total_error = 0 - INTEGER :: error - INTEGER :: majnum, minnum, relnum - LOGICAL :: szip_flag - INTEGER :: ret_total_error - LOGICAL :: cleanup, status - - CALL h5open_f(error) - - cleanup = .TRUE. - CALL h5_env_nocleanup_f(status) - IF(status) cleanup=.FALSE. - - WRITE(*,*) ' ========================== ' - WRITE(*,*) ' FORTRAN tests ' - WRITE(*,*) ' ========================== ' - CALL h5get_libversion_f(majnum, minnum, relnum, total_error) - IF(total_error .EQ. 0) THEN - - WRITE(*, '(" FORTRANLIB_TEST is linked with HDF5 Library version ")', advance="NO") - WRITE(*, '(I1)', advance="NO") majnum - WRITE(*, '(".")', advance="NO") - WRITE(*, '(I1)', advance="NO") minnum - WRITE(*, '(" release ")', advance="NO") - WRITE(*, '(I3)') relnum - ELSE - total_error = total_error + 1 - ENDIF - WRITE(*,*) - -! CALL h5check_version_f(1,4,4,total_error) -! write(*,*) '=========================================' -! write(*,*) 'Testing FILE Interface ' -! write(*,*) '=========================================' - - ret_total_error = 0 - CALL mountingtest(cleanup, ret_total_error) - CALL write_test_status(ret_total_error, ' Mounting test', total_error) - - ret_total_error = 0 - CALL reopentest(cleanup, ret_total_error) - CALL write_test_status(ret_total_error, ' Reopen test', total_error) - - ret_total_error = 0 - CALL file_close(cleanup, ret_total_error) - CALL write_test_status(ret_total_error, ' File open/close test', total_error) - - ret_total_error = 0 - CALL file_space("file_space",cleanup, ret_total_error) - CALL write_test_status(ret_total_error, ' File free space test', total_error) - -! write(*,*) -! write(*,*) '=========================================' -! write(*,*) 'Testing DATASET Interface ' -! write(*,*) '=========================================' - - ret_total_error = 0 - CALL datasettest(cleanup, ret_total_error) - CALL write_test_status(ret_total_error, ' Dataset test', total_error) - - ret_total_error = 0 - CALL extenddsettest(cleanup, ret_total_error) - CALL write_test_status(ret_total_error, ' Extendible dataset test', total_error) -! MSB--DISABLED TEST-- Fails for unknown reasons on platypus with pgf90 compiler -! CALL test_userblock_offset(cleanup, ret_total_error) -! CALL write_test_status(ret_total_error, ' Dataset offset with user block', total_error) - -! write(*,*) -! write(*,*) '=========================================' -! write(*,*) 'Testing DATASPACE Interface ' -! write(*,*) '=========================================' - - ret_total_error = 0 - CALL dataspace_basic_test(cleanup, ret_total_error) - CALL write_test_status(ret_total_error, ' Basic dataspace test', total_error) - -! write(*,*) -! write(*,*) '=========================================' -! write(*,*) 'Testing REFERENCE Interface ' -! write(*,*) '=========================================' - - ret_total_error = 0 - CALL refobjtest(cleanup, ret_total_error) - CALL write_test_status(ret_total_error, ' Reference to object test', total_error) - - ret_total_error = 0 - CALL refregtest(cleanup, ret_total_error) - CALL write_test_status(ret_total_error, ' Reference to dataset region test', total_error) - -! write(*,*) -! write(*,*) '=========================================' -! write(*,*) 'Testing selection functionalities ' -! write(*,*) '=========================================' - - ret_total_error = 0 - CALL test_basic_select(cleanup, ret_total_error) - CALL write_test_status(ret_total_error, ' Basic selection test', total_error) - - - ret_total_error = 0 - CALL test_select_hyperslab( cleanup, ret_total_error) - CALL write_test_status(ret_total_error, ' Hyperslab selection test', total_error) - - ret_total_error = 0 - CALL test_select_element(cleanup, ret_total_error) - CALL write_test_status(ret_total_error, ' Element selection test', total_error) - - ret_total_error = 0 - CALL test_select_point(cleanup, ret_total_error) - CALL write_test_status(ret_total_error, ' Element selection functions test ', total_error) - - ret_total_error = 0 - CALL test_select_combine(ret_total_error) - CALL write_test_status(ret_total_error, ' Selection combinations test ', total_error) - - ret_total_error = 0 - CALL test_select_bounds(ret_total_error) - CALL write_test_status(ret_total_error, ' Selection bounds test ', total_error) - -! write(*,*) -! write(*,*) '=========================================' -! write(*,*) 'Testing DATATYPE interface ' -! write(*,*) '=========================================' - ret_total_error = 0 - CALL basic_data_type_test(ret_total_error) - CALL write_test_status(ret_total_error, ' Basic datatype test', total_error) - - ret_total_error = 0 - CALL compoundtest(cleanup, ret_total_error) - CALL write_test_status(ret_total_error, ' Compound datatype test', total_error) - - ret_total_error = 0 - CALL enumtest(cleanup, ret_total_error) - CALL write_test_status(ret_total_error, ' Enum datatype test', total_error) - - ret_total_error = 0 - CALL test_derived_flt(cleanup, ret_total_error) - CALL write_test_status(ret_total_error, ' Derived float datatype test', total_error) - -! write(*,*) -! write(*,*) '=========================================' -! write(*,*) 'Testing PROPERTY interface ' -! write(*,*) '=========================================' - - ret_total_error = 0 - CALL external_test(cleanup, ret_total_error) - CALL write_test_status(ret_total_error, ' External dataset test', total_error) - - ret_total_error = 0 - CALL multi_file_test(cleanup, ret_total_error) - CALL write_test_status(ret_total_error, ' Multi file driver test', total_error) - - ret_total_error = 0 - CALL test_chunk_cache (cleanup, ret_total_error) - CALL write_test_status(ret_total_error, ' Dataset chunk cache configuration', total_error) - -! write(*,*) -! write(*,*) '=========================================' -! write(*,*) 'Testing ATTRIBUTE interface ' -! write(*,*) '=========================================' - - ret_total_error = 0 - CALL attribute_test(cleanup, ret_total_error) - CALL write_test_status(ret_total_error, ' Attribute test', total_error) - -! write(*,*) -! write(*,*) '=========================================' -! write(*,*) 'Testing IDENTIFIER interface ' -! write(*,*) '=========================================' - - ret_total_error = 0 - CALL identifier_test(cleanup, ret_total_error) - CALL write_test_status(ret_total_error, ' Identifier test', total_error) - - ret_total_error = 0 - CALL filters_test(ret_total_error) - CALL write_test_status(ret_total_error, ' Filters test', total_error) - - ret_total_error = 0 - CALL szip_test(szip_flag, cleanup, ret_total_error) - - IF (.NOT. szip_flag) THEN ! test not available - CALL write_test_status(-1, ' SZIP filter test', total_error) - ELSE - CALL write_test_status(ret_total_error, ' SZIP filter test', total_error) - ENDIF - -! write(*,*) -! write(*,*) '=========================================' -! write(*,*) 'Testing GROUP interface ' -! write(*,*) '=========================================' - - ret_total_error = 0 - CALL group_test(cleanup, ret_total_error) - CALL write_test_status(ret_total_error, ' Group test', total_error) - - ret_total_error = 0 - CALL error_report_test(cleanup, ret_total_error) - CALL write_test_status(ret_total_error, ' Error test', total_error) - - ret_total_error = 0 - CALL vl_test_integer(cleanup, ret_total_error) - CALL vl_test_real(cleanup, ret_total_error) - CALL vl_test_string(cleanup, ret_total_error) - CALL write_test_status(ret_total_error, ' VL test', total_error) - - WRITE(*,*) - - WRITE(*,*) ' ============================================ ' - WRITE(*, fmt = '(19x, 27a)', advance='NO') ' FORTRAN tests completed with ' - WRITE(*, fmt = '(i4)', advance='NO') total_error - WRITE(*, fmt = '(12a)' ) ' error(s) ! ' - WRITE(*,*) ' ============================================ ' - - CALL h5close_f(error) - - ! if errors detected, exit with non-zero code. - IF (total_error .NE. 0) CALL h5_exit_f (1) - -END PROGRAM fortranlibtest diff --git a/fortran/test/fortranlib_test_1_8.F90 b/fortran/test/fortranlib_test_1_8.F90 new file mode 100644 index 0000000..320d661 --- /dev/null +++ b/fortran/test/fortranlib_test_1_8.F90 @@ -0,0 +1,122 @@ +!****h* root/fortran/test/fortranlib_test_1_8.f90 +! +! NAME +! fortranlib_test_1_8.f90 +! +! FUNCTION +! Basic testing of Fortran API's introduced in 1.8 release. +! +! 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. * +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! +!***** + +PROGRAM fortranlibtest + + USE HDF5 + USE THDF5_1_8 + USE TH5_MISC + IMPLICIT NONE + INTEGER :: total_error = 0 + INTEGER :: error + INTEGER :: ret_total_error + INTEGER :: majnum, minnum, relnum + LOGICAL :: cleanup, status + + CALL h5open_f(error) + + cleanup = .TRUE. + CALL h5_env_nocleanup_f(status) + IF(status) cleanup=.FALSE. + + WRITE(*,*) ' ========================== ' + WRITE(*,*) ' FORTRAN 1.8 tests ' + WRITE(*,*) ' ========================== ' + CALL h5get_libversion_f(majnum, minnum, relnum, total_error) + IF(total_error .EQ. 0) THEN + WRITE(*, '(" FORTRANLIB_TEST is linked with HDF5 Library version ")', advance="NO") + WRITE(*, '(I1)', advance="NO") majnum + WRITE(*, '(".")', advance="NO") + WRITE(*, '(I1)', advance="NO") minnum + WRITE(*, '(" release ")', advance="NO") + WRITE(*, '(I3)') relnum + ELSE + total_error = total_error + 1 + ENDIF + WRITE(*,*) + + CALL h5eset_auto_f(0, ret_total_error) + IF(ret_total_error.NE.0) & + CALL write_test_status(ret_total_error, & + ' h5eset_auto_f', & + total_error) + + ret_total_error = 0 + CALL attribute_test_1_8(cleanup, ret_total_error) + CALL write_test_status(ret_total_error, & + ' Testing attributes', & + total_error) + + ret_total_error = 0 + CALL group_test(cleanup, ret_total_error) + CALL write_test_status(ret_total_error, & + ' Testing groups', & + total_error) + + ret_total_error = 0 + CALL test_h5o(cleanup, ret_total_error) + CALL write_test_status(ret_total_error, & + ' Testing object interface', & + total_error) + + ret_total_error = 0 + CALL dtransform(cleanup, ret_total_error) + CALL write_test_status(ret_total_error, & + ' Testing data transform', & + total_error) + + ret_total_error = 0 + CALL test_h5s_encode(ret_total_error) + CALL write_test_status(ret_total_error, & + ' Testing dataspace encoding and decoding', & + total_error) + + ret_total_error = 0 + CALL test_scaleoffset(cleanup, ret_total_error ) + CALL write_test_status(ret_total_error, & + ' Testing scaleoffset filter', & + total_error) + + ret_total_error = 0 + CALL test_genprop_basic_class(ret_total_error ) + CALL write_test_status(ret_total_error, & + ' Testing basic generic property list class creation functionality', & + total_error) + + WRITE(*,*) + + WRITE(*,*) ' ============================================ ' + WRITE(*, fmt = '(19x, 27a)', advance='NO') ' FORTRAN tests completed with ' + WRITE(*, fmt = '(i4)', advance='NO') total_error + WRITE(*, fmt = '(12a)' ) ' error(s) ! ' + WRITE(*,*) ' ============================================ ' + + CALL h5close_f(error) + + ! if errors detected, exit with non-zero code. + IF (total_error .NE. 0) CALL h5_exit_f (1) + +END PROGRAM fortranlibtest diff --git a/fortran/test/fortranlib_test_1_8.f90 b/fortran/test/fortranlib_test_1_8.f90 deleted file mode 100644 index 320d661..0000000 --- a/fortran/test/fortranlib_test_1_8.f90 +++ /dev/null @@ -1,122 +0,0 @@ -!****h* root/fortran/test/fortranlib_test_1_8.f90 -! -! NAME -! fortranlib_test_1_8.f90 -! -! FUNCTION -! Basic testing of Fortran API's introduced in 1.8 release. -! -! 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. * -! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -! -!***** - -PROGRAM fortranlibtest - - USE HDF5 - USE THDF5_1_8 - USE TH5_MISC - IMPLICIT NONE - INTEGER :: total_error = 0 - INTEGER :: error - INTEGER :: ret_total_error - INTEGER :: majnum, minnum, relnum - LOGICAL :: cleanup, status - - CALL h5open_f(error) - - cleanup = .TRUE. - CALL h5_env_nocleanup_f(status) - IF(status) cleanup=.FALSE. - - WRITE(*,*) ' ========================== ' - WRITE(*,*) ' FORTRAN 1.8 tests ' - WRITE(*,*) ' ========================== ' - CALL h5get_libversion_f(majnum, minnum, relnum, total_error) - IF(total_error .EQ. 0) THEN - WRITE(*, '(" FORTRANLIB_TEST is linked with HDF5 Library version ")', advance="NO") - WRITE(*, '(I1)', advance="NO") majnum - WRITE(*, '(".")', advance="NO") - WRITE(*, '(I1)', advance="NO") minnum - WRITE(*, '(" release ")', advance="NO") - WRITE(*, '(I3)') relnum - ELSE - total_error = total_error + 1 - ENDIF - WRITE(*,*) - - CALL h5eset_auto_f(0, ret_total_error) - IF(ret_total_error.NE.0) & - CALL write_test_status(ret_total_error, & - ' h5eset_auto_f', & - total_error) - - ret_total_error = 0 - CALL attribute_test_1_8(cleanup, ret_total_error) - CALL write_test_status(ret_total_error, & - ' Testing attributes', & - total_error) - - ret_total_error = 0 - CALL group_test(cleanup, ret_total_error) - CALL write_test_status(ret_total_error, & - ' Testing groups', & - total_error) - - ret_total_error = 0 - CALL test_h5o(cleanup, ret_total_error) - CALL write_test_status(ret_total_error, & - ' Testing object interface', & - total_error) - - ret_total_error = 0 - CALL dtransform(cleanup, ret_total_error) - CALL write_test_status(ret_total_error, & - ' Testing data transform', & - total_error) - - ret_total_error = 0 - CALL test_h5s_encode(ret_total_error) - CALL write_test_status(ret_total_error, & - ' Testing dataspace encoding and decoding', & - total_error) - - ret_total_error = 0 - CALL test_scaleoffset(cleanup, ret_total_error ) - CALL write_test_status(ret_total_error, & - ' Testing scaleoffset filter', & - total_error) - - ret_total_error = 0 - CALL test_genprop_basic_class(ret_total_error ) - CALL write_test_status(ret_total_error, & - ' Testing basic generic property list class creation functionality', & - total_error) - - WRITE(*,*) - - WRITE(*,*) ' ============================================ ' - WRITE(*, fmt = '(19x, 27a)', advance='NO') ' FORTRAN tests completed with ' - WRITE(*, fmt = '(i4)', advance='NO') total_error - WRITE(*, fmt = '(12a)' ) ' error(s) ! ' - WRITE(*,*) ' ============================================ ' - - CALL h5close_f(error) - - ! if errors detected, exit with non-zero code. - IF (total_error .NE. 0) CALL h5_exit_f (1) - -END PROGRAM fortranlibtest diff --git a/fortran/test/fortranlib_test_F03.F90 b/fortran/test/fortranlib_test_F03.F90 new file mode 100644 index 0000000..5b386b9 --- /dev/null +++ b/fortran/test/fortranlib_test_F03.F90 @@ -0,0 +1,193 @@ +!****h* root/fortran/test/fortranlib_test_F03.f90 +! +! NAME +! fortranlib_test_F03.f90 +! +! FUNCTION +! Basic testing of Fortran API's requiring Fortran 2003 +! compliance. +! +! 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. * +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! +!***** + +PROGRAM fortranlibtest_F03 + + USE HDF5 + USE THDF5_F03 + + IMPLICIT NONE + INTEGER :: total_error = 0 + INTEGER :: error + INTEGER :: majnum, minnum, relnum + INTEGER :: ret_total_error + LOGICAL :: cleanup, status + + CALL h5open_f(error) + + cleanup = .TRUE. + CALL h5_env_nocleanup_f(status) + IF(status) cleanup=.FALSE. + + WRITE(*,'(24X,A)') '==============================' + WRITE(*,'(24X,A)') ' FORTRAN 2003 tests ' + WRITE(*,'(24X,A)') '==============================' + CALL h5get_libversion_f(majnum, minnum, relnum, total_error) + IF(total_error .EQ. 0) THEN + WRITE(*, '(" FORTRANLIB_TEST is linked with HDF5 Library version ")', advance="NO") + WRITE(*, '(I1)', advance="NO") majnum + WRITE(*, '(".")', advance="NO") + WRITE(*, '(I1)', advance="NO") minnum + WRITE(*, '(" release ")', advance="NO") + WRITE(*, '(I3)') relnum + ELSE + total_error = total_error + 1 + ENDIF + + ret_total_error = 0 +! PROBLEMS with C +! CALL test_error(ret_total_error) +! CALL write_test_status(ret_total_error, ' Test error API based on data I/O', total_error) + + WRITE(*,*) + + ret_total_error = 0 + CALL test_array_compound_atomic(ret_total_error) + CALL write_test_status(ret_total_error, ' Testing 1-D Array of Compound Datatypes Functionality', total_error) + + ret_total_error = 0 + CALL test_array_compound_array(ret_total_error) + CALL write_test_status(ret_total_error, ' Testing 1-D Array of Compound Array Datatypes Functionality', total_error) + + ret_total_error = 0 + CALL t_array(ret_total_error) + CALL write_test_status(ret_total_error, ' Testing 3-D array by dataset, using C_LOC', total_error) + + ret_total_error = 0 + CALL t_enum(ret_total_error) + CALL write_test_status(ret_total_error, ' Testing writing/reading enum dataset, using C_LOC', total_error) + + ret_total_error = 0 + CALL t_enum_conv(ret_total_error) + CALL write_test_status(ret_total_error, ' Testing enumeration conversions', total_error) + + ret_total_error = 0 + CALL t_bit(ret_total_error) + CALL write_test_status(ret_total_error, ' Testing writing/reading bitfield dataset, using C_LOC', total_error) + + ret_total_error = 0 + CALL t_opaque(ret_total_error) + CALL write_test_status(ret_total_error, ' Testing writing/reading opaque datatypes, using C_LOC', total_error) + + ret_total_error = 0 + CALL t_objref(ret_total_error) + CALL write_test_status(ret_total_error, ' Testing writing/reading object references, using C_LOC', total_error) + + ret_total_error = 0 + CALL t_regref(ret_total_error) + CALL write_test_status(ret_total_error, ' Testing writing/reading region references, using C_LOC', total_error) + + ret_total_error = 0 + CALL t_vlen(ret_total_error) + CALL write_test_status(ret_total_error, ' Testing writing/reading variable-length datatypes, using C_LOC', total_error) + + ret_total_error = 0 + CALL t_vlstring(ret_total_error) + CALL write_test_status(ret_total_error, ' Testing writing/reading variable-string datatypes, using C_LOC', total_error) + + ret_total_error = 0 + CALL t_vlstring_readwrite(ret_total_error) + CALL write_test_status(ret_total_error, ' Testing variable-string write/read, using h5dwrite_f/h5dread_f', total_error) + + ret_total_error = 0 + CALL t_string(ret_total_error) + CALL write_test_status(ret_total_error, ' Testing writing/reading string datatypes, using C_LOC', total_error) + + ret_total_error = 0 + CALL vl_test_special_char(ret_total_error) + CALL write_test_status(ret_total_error, ' Testing string datatypes containing control characters', total_error) + + ret_total_error = 0 + CALL test_create(ret_total_error) + CALL write_test_status(ret_total_error, ' Testing filling functions', total_error) + + ret_total_error = 0 + CALL test_h5kind_to_type(total_error) + CALL write_test_status(ret_total_error, ' Test function h5kind_to_type', total_error) + + ret_total_error = 0 + CALL test_array_bkg(ret_total_error) + CALL write_test_status(ret_total_error, ' Testing Partial I/O of Array Fields in Compound Datatype FunctionalityT', total_error) + + ret_total_error = 0 + CALL test_genprop_class_callback(ret_total_error) + CALL write_test_status(ret_total_error, ' Test basic generic property list callback functionality', total_error) + + ret_total_error = 0 + CALL test_iter_group(ret_total_error) + CALL write_test_status(ret_total_error, ' Testing group iteration functionality', total_error) + + ret_total_error = 0 + CALL test_nbit(ret_total_error) + CALL write_test_status(ret_total_error, ' Testing nbit filter', total_error) + + ret_total_error = 0 + CALL external_test_offset(cleanup, ret_total_error) + CALL write_test_status(ret_total_error, ' Testing external dataset with offset', total_error) + + ret_total_error = 0 + CALL test_h5p_file_image(ret_total_error) + CALL write_test_status(ret_total_error, ' Testing h5pset/get file image', total_error) + +! write(*,*) +! write(*,*) '=========================================' +! write(*,*) 'Testing GROUP interface ' +! write(*,*) '=========================================' + + ret_total_error = 0 + CALL test_h5o_refcount(ret_total_error) + CALL write_test_status(ret_total_error, ' Testing object functions ', total_error) + + ret_total_error = 0 + CALL obj_visit(ret_total_error) + CALL write_test_status(ret_total_error, ' Testing object visiting functions ', total_error) + + ret_total_error = 0 + CALL obj_info(ret_total_error) + CALL write_test_status(ret_total_error, ' Testing object info functions ', total_error) + + ret_total_error = 0 + CALL test_get_file_image(ret_total_error) + CALL write_test_status(ret_total_error, ' Testing get file image ', total_error) + + + WRITE(*,*) + + WRITE(*,*) ' ============================================ ' + WRITE(*, fmt = '(19x, 27a)', advance='NO') ' FORTRAN tests completed with ' + WRITE(*, fmt = '(i4)', advance='NO') total_error + WRITE(*, fmt = '(12a)' ) ' error(s) ! ' + WRITE(*,*) ' ============================================ ' + + CALL h5close_f(error) + + ! if errors detected, exit with non-zero code. + IF (total_error .NE. 0) CALL h5_exit_f(1) + +END PROGRAM fortranlibtest_F03 + + diff --git a/fortran/test/fortranlib_test_F03.f90 b/fortran/test/fortranlib_test_F03.f90 deleted file mode 100644 index 5b386b9..0000000 --- a/fortran/test/fortranlib_test_F03.f90 +++ /dev/null @@ -1,193 +0,0 @@ -!****h* root/fortran/test/fortranlib_test_F03.f90 -! -! NAME -! fortranlib_test_F03.f90 -! -! FUNCTION -! Basic testing of Fortran API's requiring Fortran 2003 -! compliance. -! -! 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. * -! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -! -!***** - -PROGRAM fortranlibtest_F03 - - USE HDF5 - USE THDF5_F03 - - IMPLICIT NONE - INTEGER :: total_error = 0 - INTEGER :: error - INTEGER :: majnum, minnum, relnum - INTEGER :: ret_total_error - LOGICAL :: cleanup, status - - CALL h5open_f(error) - - cleanup = .TRUE. - CALL h5_env_nocleanup_f(status) - IF(status) cleanup=.FALSE. - - WRITE(*,'(24X,A)') '==============================' - WRITE(*,'(24X,A)') ' FORTRAN 2003 tests ' - WRITE(*,'(24X,A)') '==============================' - CALL h5get_libversion_f(majnum, minnum, relnum, total_error) - IF(total_error .EQ. 0) THEN - WRITE(*, '(" FORTRANLIB_TEST is linked with HDF5 Library version ")', advance="NO") - WRITE(*, '(I1)', advance="NO") majnum - WRITE(*, '(".")', advance="NO") - WRITE(*, '(I1)', advance="NO") minnum - WRITE(*, '(" release ")', advance="NO") - WRITE(*, '(I3)') relnum - ELSE - total_error = total_error + 1 - ENDIF - - ret_total_error = 0 -! PROBLEMS with C -! CALL test_error(ret_total_error) -! CALL write_test_status(ret_total_error, ' Test error API based on data I/O', total_error) - - WRITE(*,*) - - ret_total_error = 0 - CALL test_array_compound_atomic(ret_total_error) - CALL write_test_status(ret_total_error, ' Testing 1-D Array of Compound Datatypes Functionality', total_error) - - ret_total_error = 0 - CALL test_array_compound_array(ret_total_error) - CALL write_test_status(ret_total_error, ' Testing 1-D Array of Compound Array Datatypes Functionality', total_error) - - ret_total_error = 0 - CALL t_array(ret_total_error) - CALL write_test_status(ret_total_error, ' Testing 3-D array by dataset, using C_LOC', total_error) - - ret_total_error = 0 - CALL t_enum(ret_total_error) - CALL write_test_status(ret_total_error, ' Testing writing/reading enum dataset, using C_LOC', total_error) - - ret_total_error = 0 - CALL t_enum_conv(ret_total_error) - CALL write_test_status(ret_total_error, ' Testing enumeration conversions', total_error) - - ret_total_error = 0 - CALL t_bit(ret_total_error) - CALL write_test_status(ret_total_error, ' Testing writing/reading bitfield dataset, using C_LOC', total_error) - - ret_total_error = 0 - CALL t_opaque(ret_total_error) - CALL write_test_status(ret_total_error, ' Testing writing/reading opaque datatypes, using C_LOC', total_error) - - ret_total_error = 0 - CALL t_objref(ret_total_error) - CALL write_test_status(ret_total_error, ' Testing writing/reading object references, using C_LOC', total_error) - - ret_total_error = 0 - CALL t_regref(ret_total_error) - CALL write_test_status(ret_total_error, ' Testing writing/reading region references, using C_LOC', total_error) - - ret_total_error = 0 - CALL t_vlen(ret_total_error) - CALL write_test_status(ret_total_error, ' Testing writing/reading variable-length datatypes, using C_LOC', total_error) - - ret_total_error = 0 - CALL t_vlstring(ret_total_error) - CALL write_test_status(ret_total_error, ' Testing writing/reading variable-string datatypes, using C_LOC', total_error) - - ret_total_error = 0 - CALL t_vlstring_readwrite(ret_total_error) - CALL write_test_status(ret_total_error, ' Testing variable-string write/read, using h5dwrite_f/h5dread_f', total_error) - - ret_total_error = 0 - CALL t_string(ret_total_error) - CALL write_test_status(ret_total_error, ' Testing writing/reading string datatypes, using C_LOC', total_error) - - ret_total_error = 0 - CALL vl_test_special_char(ret_total_error) - CALL write_test_status(ret_total_error, ' Testing string datatypes containing control characters', total_error) - - ret_total_error = 0 - CALL test_create(ret_total_error) - CALL write_test_status(ret_total_error, ' Testing filling functions', total_error) - - ret_total_error = 0 - CALL test_h5kind_to_type(total_error) - CALL write_test_status(ret_total_error, ' Test function h5kind_to_type', total_error) - - ret_total_error = 0 - CALL test_array_bkg(ret_total_error) - CALL write_test_status(ret_total_error, ' Testing Partial I/O of Array Fields in Compound Datatype FunctionalityT', total_error) - - ret_total_error = 0 - CALL test_genprop_class_callback(ret_total_error) - CALL write_test_status(ret_total_error, ' Test basic generic property list callback functionality', total_error) - - ret_total_error = 0 - CALL test_iter_group(ret_total_error) - CALL write_test_status(ret_total_error, ' Testing group iteration functionality', total_error) - - ret_total_error = 0 - CALL test_nbit(ret_total_error) - CALL write_test_status(ret_total_error, ' Testing nbit filter', total_error) - - ret_total_error = 0 - CALL external_test_offset(cleanup, ret_total_error) - CALL write_test_status(ret_total_error, ' Testing external dataset with offset', total_error) - - ret_total_error = 0 - CALL test_h5p_file_image(ret_total_error) - CALL write_test_status(ret_total_error, ' Testing h5pset/get file image', total_error) - -! write(*,*) -! write(*,*) '=========================================' -! write(*,*) 'Testing GROUP interface ' -! write(*,*) '=========================================' - - ret_total_error = 0 - CALL test_h5o_refcount(ret_total_error) - CALL write_test_status(ret_total_error, ' Testing object functions ', total_error) - - ret_total_error = 0 - CALL obj_visit(ret_total_error) - CALL write_test_status(ret_total_error, ' Testing object visiting functions ', total_error) - - ret_total_error = 0 - CALL obj_info(ret_total_error) - CALL write_test_status(ret_total_error, ' Testing object info functions ', total_error) - - ret_total_error = 0 - CALL test_get_file_image(ret_total_error) - CALL write_test_status(ret_total_error, ' Testing get file image ', total_error) - - - WRITE(*,*) - - WRITE(*,*) ' ============================================ ' - WRITE(*, fmt = '(19x, 27a)', advance='NO') ' FORTRAN tests completed with ' - WRITE(*, fmt = '(i4)', advance='NO') total_error - WRITE(*, fmt = '(12a)' ) ' error(s) ! ' - WRITE(*,*) ' ============================================ ' - - CALL h5close_f(error) - - ! if errors detected, exit with non-zero code. - IF (total_error .NE. 0) CALL h5_exit_f(1) - -END PROGRAM fortranlibtest_F03 - - diff --git a/fortran/test/tH5A.F90 b/fortran/test/tH5A.F90 new file mode 100644 index 0000000..5b814fa --- /dev/null +++ b/fortran/test/tH5A.F90 @@ -0,0 +1,624 @@ +!****h* root/fortran/test/tH5A.f90 +! +! NAME +! tH5A.f90 +! +! FUNCTION +! Basic testing of Fortran H5A 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. * +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! +! CONTAINS SUBROUTINES +! attribute_test +! +! +!***** +MODULE TH5A + + USE HDF5 ! This module contains all necessary modules + USE TH5_MISC + USE TH5_MISC_GEN + +CONTAINS + SUBROUTINE attribute_test(cleanup, total_error) + +! This subroutine tests following functionalities: +! h5acreate_f, h5awrite_f, h5aclose_f,h5aread_f, h5aopen_name_f, +! h5aget_name_f,h5aget_space_f, h5aget_type_f, +! + IMPLICIT NONE + LOGICAL, INTENT(IN) :: cleanup + INTEGER, INTENT(INOUT) :: total_error + + CHARACTER(LEN=5), PARAMETER :: filename = "atest" !File name + CHARACTER(LEN=80) :: fix_filename + CHARACTER(LEN=9), PARAMETER :: dsetname = "atestdset" !Dataset name + CHARACTER(LEN=11), PARAMETER :: aname = "attr_string" !String Attribute name + CHARACTER(LEN=14), PARAMETER :: aname2 = "attr_character"!Character Attribute name + CHARACTER(LEN=11), PARAMETER :: aname3 = "attr_double" !DOuble Attribute name + CHARACTER(LEN=9), PARAMETER :: aname4 = "attr_real" !Real Attribute name + CHARACTER(LEN=12), PARAMETER :: aname5 = "attr_integer" !Integer Attribute name + CHARACTER(LEN=9), PARAMETER :: aname6 = "attr_null" !Null Attribute name + + ! + !data space rank and dimensions + ! + INTEGER, PARAMETER :: RANK = 2 + INTEGER, PARAMETER :: NX = 4 + INTEGER, PARAMETER :: NY = 5 + + + + INTEGER(HID_T) :: file_id ! File identifier + INTEGER(HID_T) :: dset_id ! Dataset identifier + INTEGER(HID_T) :: dataspace ! Dataspace identifier for dataset + + INTEGER(HID_T) :: attr_id !String Attribute identifier + INTEGER(HID_T) :: attr2_id !Character Attribute identifier + INTEGER(HID_T) :: attr3_id !Double Attribute identifier + INTEGER(HID_T) :: attr4_id !Real Attribute identifier + INTEGER(HID_T) :: attr5_id !Integer Attribute identifier + INTEGER(HID_T) :: attr6_id !Null Attribute identifier + INTEGER(HID_T) :: aspace_id !String Attribute Dataspace identifier + INTEGER(HID_T) :: aspace2_id !Character Attribute Dataspace identifier + INTEGER(HID_T) :: aspace6_id !Null Attribute Dataspace identifier + INTEGER(HID_T) :: atype_id !String Attribute Datatype identifier + INTEGER(HID_T) :: atype2_id !Character Attribute Datatype identifier + INTEGER(HID_T) :: atype3_id !Double Attribute Datatype identifier + INTEGER(HID_T) :: atype4_id !Real Attribute Datatype identifier + INTEGER(HID_T) :: atype5_id !Integer Attribute Datatype identifier + INTEGER(HSIZE_T), DIMENSION(1) :: adims = (/2/) ! Attribute dimension + INTEGER(HSIZE_T), DIMENSION(1) :: adims2 = (/1/) ! Attribute dimension + INTEGER :: arank = 1 ! Attribure rank + INTEGER(SIZE_T) :: attrlen ! Length of the attribute string + + INTEGER(HID_T) :: attr_space !Returned String Attribute Space identifier + INTEGER(HID_T) :: attr2_space !Returned other Attribute Space identifier + INTEGER(HID_T) :: attr_type !Returned Attribute Datatype identifier + INTEGER(HID_T) :: attr2_type !Returned CHARACTER Attribute Datatype identifier + INTEGER(HID_T) :: attr3_type !Returned DOUBLE Attribute Datatype identifier + INTEGER(HID_T) :: attr4_type !Returned REAL Attribute Datatype identifier + INTEGER(HID_T) :: attr5_type !Returned INTEGER Attribute Datatype identifier + INTEGER(HID_T) :: attr6_type !Returned NULL Attribute Datatype identifier + INTEGER :: num_attrs !number of attributes + INTEGER(HSIZE_T) :: attr_storage ! attributes storage requirements .MSB. + CHARACTER(LEN=256) :: attr_name !buffer to put attr_name + INTEGER(SIZE_T) :: name_size = 80 !attribute name length + + CHARACTER(LEN=35), DIMENSION(2) :: attr_data ! String attribute data + CHARACTER(LEN=35), DIMENSION(2) :: aread_data ! Buffer to put read back + ! string attr data + CHARACTER :: attr_character_data = 'A' + REAL(KIND=Fortran_DOUBLE), DIMENSION(1) :: attr_double_data = 3.459D0 + REAL, DIMENSION(1) :: attr_real_data = 4.0 + INTEGER, DIMENSION(1) :: attr_integer_data = 5 + INTEGER(HSIZE_T), DIMENSION(7) :: data_dims + + + CHARACTER :: aread_character_data ! variable to put read back Character attr data + INTEGER, DIMENSION(1) :: aread_integer_data ! variable to put read back integer attr data + INTEGER, DIMENSION(1) :: aread_null_data = 7 ! variable to put read back null attr data + REAL(KIND=Fortran_DOUBLE), DIMENSION(1) :: aread_double_data ! variable to put read back double attr data + REAL, DIMENSION(1) :: aread_real_data ! variable to put read back real attr data + + ! + !general purpose integer + ! + INTEGER :: i, j + INTEGER :: error ! Error flag + + ! + !The dimensions for the dataset. + ! + INTEGER(HSIZE_T), DIMENSION(2) :: dims = (/NX,NY/) + + ! + !data buffers + ! + INTEGER, DIMENSION(NX,NY) :: data_in + + ! + !Initialize data_in buffer + ! + DO i = 1, NX + DO j = 1, NY + data_in(i,j) = (i-1) + (j-1) + END DO + END DO + ! + ! Initialize attribute's data + ! + attr_data(1) = 'Dataset character attribute' + attr_data(2) = 'Some other string here ' + attrlen = LEN(attr_data(1)) + + ! + ! Create the file. + ! + CALL h5_fixname_f(filename, fix_filename, H5P_DEFAULT_F, error) + IF (error .NE. 0) THEN + WRITE(*,*) "Cannot modify file name" + STOP + ENDIF + CALL h5fcreate_f(fix_filename, H5F_ACC_TRUNC_F, file_id, error) + CALL check("h5fcreate_f",error,total_error) + + ! + !Create data space for the dataset. + ! + CALL h5screate_simple_f(RANK, dims, dataspace, error) + CALL check("h5screate_simple_f",error,total_error) + + ! + ! create dataset in the file. + ! + CALL h5dcreate_f(file_id, dsetname, H5T_NATIVE_INTEGER, dataspace, & + dset_id, error) + CALL check("h5dcreate_f",error,total_error) + + ! + ! Write data_in to the dataset + ! + data_dims(1) = NX + data_dims(2) = NY + CALL h5dwrite_f(dset_id, H5T_NATIVE_INTEGER, data_in, data_dims, error) + CALL check("h5dwrite_f",error,total_error) + + ! + ! Create scalar data space for the String attribute. + ! + CALL h5screate_simple_f(arank, adims, aspace_id, error) + CALL check("h5screate_simple_f",error,total_error) + ! + ! Create scalar data space for all other attributes. + ! + CALL h5screate_simple_f(arank, adims2, aspace2_id, error) + CALL check("h5screate_simple_f",error,total_error) + ! + ! Create null data space for null attributes. + ! + CALL h5screate_f(H5S_NULL_F, aspace6_id, error) + CALL check("h5screate_f",error,total_error) + + ! + ! Create datatype for the String attribute. + ! + CALL h5tcopy_f(H5T_NATIVE_CHARACTER, atype_id, error) + CALL check("h5tcopy_f",error,total_error) + + CALL h5tset_size_f(atype_id, attrlen, error) + CALL check("h5tset_size_f",error,total_error) + + ! + ! Create datatype for the Character attribute. + ! + CALL h5tcopy_f(H5T_NATIVE_CHARACTER, atype2_id, error) + CALL check("h5tcopy_f",error,total_error) + ! + ! Create datatype for the Double attribute. + ! + CALL h5tcopy_f(H5T_NATIVE_DOUBLE, atype3_id, error) + CALL check("h5tcopy_f",error,total_error) + ! + ! Create datatype for the Real attribute. + ! + CALL h5tcopy_f(H5T_NATIVE_REAL, atype4_id, error) + CALL check("h5tcopy_f",error,total_error) + ! + ! Create datatype for the Integer attribute. + ! + CALL h5tcopy_f(H5T_NATIVE_INTEGER, atype5_id, error) + CALL check("h5tcopy_f",error,total_error) + + + ! + ! Create dataset String attribute. + ! + CALL h5acreate_f(dset_id, aname, atype_id, aspace_id, & + attr_id, error) + CALL check("h5acreate_f",error,total_error) + + + ! + ! Create dataset CHARACTER attribute. + ! + CALL h5acreate_f(dset_id, aname2, atype2_id, aspace2_id, & + attr2_id, error) + CALL check("h5acreate_f",error,total_error) + + + ! + ! Create dataset DOUBLE attribute. + ! + CALL h5acreate_f(dset_id, aname3, atype3_id, aspace2_id, & + attr3_id, error) + CALL check("h5acreate_f",error,total_error) + ! + ! Create dataset REAL attribute. + ! + CALL h5acreate_f(dset_id, aname4, atype4_id, aspace2_id, & + attr4_id, error) + CALL check("h5acreate_f",error,total_error) + ! + ! Create dataset INTEGER attribute. + ! + CALL h5acreate_f(dset_id, aname5, atype5_id, aspace2_id, & + attr5_id, error) + CALL check("h5acreate_f",error,total_error) + ! + ! Create dataset NULL attribute of INTEGER. + ! + + CALL h5acreate_f(dset_id, aname6, atype5_id, aspace6_id, & + attr6_id, error) + + CALL check("h5acreate_f",error,total_error) + + ! + ! Write the String attribute data. + ! + data_dims(1) = 2 + CALL h5awrite_f(attr_id, atype_id, attr_data, data_dims, error) + CALL check("h5awrite_f",error,total_error) + ! + ! Write the Character attribute data. + ! + CALL h5awrite_f(attr2_id, atype2_id, attr_character_data, data_dims, error) + CALL check("h5awrite_f",error,total_error) + ! + ! Write the DOUBLE attribute data. + ! + data_dims(1) = 1 + CALL h5awrite_f(attr3_id, atype3_id, attr_double_data, data_dims, error) + CALL check("h5awrite_f",error,total_error) + ! + ! Write the Real attribute data. + ! + data_dims(1) = 1 + CALL h5awrite_f(attr4_id, atype4_id, attr_real_data, data_dims, error) + CALL check("h5awrite_f",error,total_error) + + ! + ! Write the Integer attribute data. + ! + data_dims(1) = 1 + CALL h5awrite_f(attr5_id, atype5_id, attr_integer_data, data_dims, error) + CALL check("h5awrite_f",error,total_error) + + ! + ! Write the NULL attribute data(nothing can be written). + ! + CALL h5awrite_f(attr6_id, atype5_id, attr_integer_data, data_dims, error) + CALL check("h5awrite_f",error,total_error) + + ! + ! check the amount of storage that is required for the specified attribute .MSB. + ! + CALL h5aget_storage_size_f(attr_id, attr_storage, error) + CALL check("h5aget_storage_size_f",error,total_error) +! CALL verify("h5aget_storage_size_f",attr_storage,*SizeOf(attr_storage),total_error) + CALL h5aget_storage_size_f(attr2_id, attr_storage, error) + CALL check("h5aget_storage_size_f",error,total_error) +! CALL verify("h5aget_storage_size_f",attr_storage,1,total_error) + CALL h5aget_storage_size_f(attr3_id, attr_storage, error) + CALL check("h5aget_storage_size_f",error,total_error) +! CALL verify("h5aget_storage_size_f",attr_storage,8,total_error) + CALL h5aget_storage_size_f(attr4_id, attr_storage, error) + CALL check("h5aget_storage_size_f",error,total_error) +! CALL verify("h5aget_storage_size_f",attr_storage,4,total_error) + CALL h5aget_storage_size_f(attr5_id, attr_storage, error) + CALL check("h5aget_storage_size_f",error,total_error) +! CALL verify("h5aget_storage_size_f",attr_storage,4,total_error) + CALL h5aget_storage_size_f(attr6_id, attr_storage, error) + CALL check("h5aget_storage_size_f",error,total_error) +! CALL verify("h5aget_storage_size_f",attr_storage,0,total_error) + + + ! + ! Close the attribute. + ! + CALL h5aclose_f(attr_id, error) + CALL check("h5aclose_f",error,total_error) + CALL h5aclose_f(attr2_id, error) + CALL check("h5aclose_f",error,total_error) + CALL h5aclose_f(attr3_id, error) + CALL check("h5aclose_f",error,total_error) + CALL h5aclose_f(attr4_id, error) + CALL check("h5aclose_f",error,total_error) + CALL h5aclose_f(attr5_id, error) + CALL check("h5aclose_f",error,total_error) + CALL h5aclose_f(attr6_id, error) + CALL check("h5aclose_f",error,total_error) + + CALL h5tclose_f(atype_id, error) + CALL check("h5tclose_f",error,total_error) + CALL h5tclose_f(atype2_id, error) + CALL check("h5tclose_f",error,total_error) + CALL h5tclose_f(atype3_id, error) + CALL check("h5tclose_f",error,total_error) + CALL h5tclose_f(atype4_id, error) + CALL check("h5tclose_f",error,total_error) + CALL h5tclose_f(atype5_id, error) + CALL check("h5tclose_f",error,total_error) + + ! + ! Terminate access to the data space. + ! + CALL h5sclose_f(aspace_id, error) + CALL check("h5sclose_f",error,total_error) + CALL h5sclose_f(aspace2_id, error) + CALL check("h5sclose_f",error,total_error) + CALL h5sclose_f(aspace6_id, error) + CALL check("h5sclose_f",error,total_error) + ! + ! Terminate access to the dataset. + ! + CALL h5dclose_f(dset_id, error) + CALL check("h5dclose_f",error,total_error) + ! + ! Terminate access to the file. + ! + CALL h5fclose_f(file_id, error) + CALL check("h5fclose_f",error,total_error) + ! + ! Open file + ! + CALL h5fopen_f(fix_filename, H5F_ACC_RDWR_F, file_id, error) + CALL check("h5open_f",error,total_error) + ! + ! Reopen dataset + ! + CALL h5dopen_f(file_id, dsetname, dset_id, error) + CALL check("h5dopen_f",error,total_error) + ! + !open the String attrbute by name + ! + CALL h5aopen_name_f(dset_id, aname, attr_id, error) + CALL check("h5aopen_name_f",error,total_error) + + ! + !open the CHARACTER attrbute by name + ! + CALL h5aopen_name_f(dset_id, aname2, attr2_id, error) + CALL check("h5aopen_name_f",error,total_error) + ! + !open the DOUBLE attrbute by name + ! + CALL h5aopen_name_f(dset_id, aname3, attr3_id, error) + CALL check("h5aopen_name_f",error,total_error) + ! + !open the REAL attrbute by name + ! + CALL h5aopen_name_f(dset_id, aname4, attr4_id, error) + CALL check("h5aopen_name_f",error,total_error) + + ! + !open the INTEGER attrbute by name + ! + CALL h5aopen_name_f(dset_id, aname5, attr5_id, error) + CALL check("h5aopen_idx_f",error,total_error) + + ! + !open the NULL attrbute by name + ! + CALL h5aopen_name_f(dset_id, aname6, attr6_id, error) + CALL check("h5aopen_idx_f",error,total_error) + + ! + !get the attrbute name + ! + CALL h5aget_name_f(attr5_id, name_size, attr_name, error) + CALL check("h5aget_name_f",error,total_error) + IF (attr_name(1:12) .NE. aname5) THEN + total_error = total_error + 1 + END IF + IF (error .NE. 12) THEN + total_error = total_error + 1 + END IF + + ! + !get the STRING attrbute space + ! + CALL h5aget_space_f(attr_id, attr_space, error) + CALL check("h5aget_space_f",error,total_error) + ! + !get other attrbute space + ! + CALL h5aget_space_f(attr2_id, attr2_space, error) + CALL check("h5aget_space_f",error,total_error) + ! + !get the string attrbute datatype + ! + CALL h5aget_type_f(attr_id, attr_type, error) + CALL check("h5aget_type_f",error,total_error) + ! + !get the character attrbute datatype + ! + CALL h5aget_type_f(attr2_id, attr2_type, error) + CALL check("h5aget_type_f",error,total_error) + ! + !get the double attrbute datatype + ! + CALL h5aget_type_f(attr3_id, attr3_type, error) + CALL check("h5aget_type_f",error,total_error) + ! + !get the real attrbute datatype + ! + CALL h5aget_type_f(attr4_id, attr4_type, error) + CALL check("h5aget_type_f",error,total_error) + + ! + !get the integer attrbute datatype + ! + CALL h5aget_type_f(attr5_id, attr5_type, error) + CALL check("h5aget_type_f",error,total_error) + + ! + !get the null attrbute datatype + ! + CALL h5aget_type_f(attr6_id, attr6_type, error) + CALL check("h5aget_type_f",error,total_error) + + ! + !get number of attributes + ! + CALL h5aget_num_attrs_f(dset_id, num_attrs, error) + CALL check("h5aget_num_attrs_f",error,total_error) + IF (num_attrs .NE. 6) THEN + WRITE(*,*) "got number of attributes wrong", num_attrs + total_error = total_error +1 + END IF + + ! + !set the read back data type's size + ! + CALL h5tcopy_f(H5T_NATIVE_CHARACTER, atype_id, error) + CALL check("h5tcopy_f",error,total_error) + + CALL h5tset_size_f(atype_id, attrlen, error) + CALL check("h5tset_size_f",error,total_error) + ! + !read the string attribute data back to memory + ! + data_dims(1) = 2 + CALL h5aread_f(attr_id, atype_id, aread_data, data_dims, error) + CALL check("h5aread_f",error,total_error) + + IF ( (aread_data(1) .NE. attr_data(1)) .OR. (aread_data(2) .NE. attr_data(2)) ) THEN + WRITE(*,*) "Read back string attrbute is wrong", aread_data(1), aread_data(2) + total_error = total_error + 1 + END IF + + ! + !read the CHARACTER attribute data back to memory + ! + CALL h5aread_f(attr2_id, H5T_NATIVE_CHARACTER, aread_character_data, data_dims, error) + CALL check("h5aread_f",error,total_error) + IF (aread_character_data .NE. 'A' ) THEN + WRITE(*,*) "Read back character attrbute is wrong ",aread_character_data + total_error = total_error + 1 + END IF + ! + !read the double attribute data back to memory + ! + data_dims(1) = 1 + CALL h5aread_f(attr3_id, H5T_NATIVE_DOUBLE, aread_double_data, data_dims, error) + CALL check("h5aread_f",error,total_error) + CALL VERIFY("Read back double attrbute is wrong", aread_double_data(1),3.459_Fortran_DOUBLE,total_error) + + ! + !read the real attribute data back to memory + ! + data_dims(1) = 1 + CALL h5aread_f(attr4_id, H5T_NATIVE_REAL, aread_real_data, data_dims, error) + CALL check("h5aread_f",error,total_error) + CALL VERIFY("Read back real attrbute is wrong", aread_real_data(1),4.0,total_error) + ! + !read the Integer attribute data back to memory + ! + data_dims(1) = 1 + CALL h5aread_f(attr5_id, H5T_NATIVE_INTEGER, aread_integer_data, data_dims, error) + CALL check("h5aread_f",error,total_error) + IF (aread_integer_data(1) .NE. 5 ) THEN + WRITE(*,*) "Read back integer attrbute is wrong ", aread_integer_data + total_error = total_error + 1 + END IF + ! + !read the null attribute data. nothing can be read. + ! + data_dims(1) = 1 + CALL h5aread_f(attr6_id, H5T_NATIVE_INTEGER, aread_null_data, data_dims, error) + CALL check("h5aread_f",error,total_error) + IF (aread_null_data(1) .NE. 7 ) THEN + WRITE(*,*) "Read back null attrbute is wrong ", aread_null_data + total_error = total_error + 1 + END IF + + ! + ! Close the attribute. + ! + CALL h5aclose_f(attr_id, error) + CALL check("h5aclose_f",error,total_error) + CALL h5aclose_f(attr2_id, error) + CALL check("h5aclose_f",error,total_error) + CALL h5aclose_f(attr3_id, error) + CALL check("h5aclose_f",error,total_error) + CALL h5aclose_f(attr4_id, error) + CALL check("h5aclose_f",error,total_error) + CALL h5aclose_f(attr5_id, error) + CALL check("h5aclose_f",error,total_error) + CALL h5aclose_f(attr6_id, error) + CALL check("h5aclose_f",error,total_error) + + ! + ! Delete the attribute from the Dataset. + ! + CALL h5adelete_f(dset_id, aname, error) + CALL check("h5adelete_f",error,total_error) + + ! + !get number of attributes + ! + CALL h5aget_num_attrs_f(dset_id, num_attrs, error) + CALL check("h5aget_num_attrs_f",error,total_error) + IF (num_attrs .NE. 5) THEN + WRITE(*,*) "got number of attributes wrong", num_attrs + total_error = total_error +1 + END IF + + + + CALL h5sclose_f(attr_space, error) + CALL check("h5sclose_f",error,total_error) + CALL h5sclose_f(attr2_space, error) + CALL check("h5sclose_f",error,total_error) + + ! + ! Terminate access to the data type. + ! + CALL h5tclose_f(attr_type, error) + CALL check("h5tclose_f",error,total_error) + CALL h5tclose_f(attr2_type, error) + CALL check("h5tclose_f",error,total_error) + CALL h5tclose_f(attr3_type, error) + CALL check("h5tclose_f",error,total_error) + CALL h5tclose_f(attr4_type, error) + CALL check("h5tclose_f",error,total_error) + CALL h5tclose_f(attr5_type, error) + CALL check("h5tclose_f",error,total_error) + CALL h5tclose_f(attr6_type, error) + CALL check("h5tclose_f",error,total_error) + + ! + ! End access to the dataset and release resources used by it. + ! + CALL h5dclose_f(dset_id, error) + CALL check("h5dclose_f",error,total_error) + + ! + ! Close the file. + ! + CALL h5fclose_f(file_id, error) + CALL check("h5fclose_f",error,total_error) + ! + ! Remove the file + ! + IF (cleanup) CALL h5_cleanup_f(filename, H5P_DEFAULT_F, error) + + RETURN + END SUBROUTINE attribute_test +END MODULE TH5A diff --git a/fortran/test/tH5A.f90 b/fortran/test/tH5A.f90 deleted file mode 100644 index 5b814fa..0000000 --- a/fortran/test/tH5A.f90 +++ /dev/null @@ -1,624 +0,0 @@ -!****h* root/fortran/test/tH5A.f90 -! -! NAME -! tH5A.f90 -! -! FUNCTION -! Basic testing of Fortran H5A 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. * -! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -! -! CONTAINS SUBROUTINES -! attribute_test -! -! -!***** -MODULE TH5A - - USE HDF5 ! This module contains all necessary modules - USE TH5_MISC - USE TH5_MISC_GEN - -CONTAINS - SUBROUTINE attribute_test(cleanup, total_error) - -! This subroutine tests following functionalities: -! h5acreate_f, h5awrite_f, h5aclose_f,h5aread_f, h5aopen_name_f, -! h5aget_name_f,h5aget_space_f, h5aget_type_f, -! - IMPLICIT NONE - LOGICAL, INTENT(IN) :: cleanup - INTEGER, INTENT(INOUT) :: total_error - - CHARACTER(LEN=5), PARAMETER :: filename = "atest" !File name - CHARACTER(LEN=80) :: fix_filename - CHARACTER(LEN=9), PARAMETER :: dsetname = "atestdset" !Dataset name - CHARACTER(LEN=11), PARAMETER :: aname = "attr_string" !String Attribute name - CHARACTER(LEN=14), PARAMETER :: aname2 = "attr_character"!Character Attribute name - CHARACTER(LEN=11), PARAMETER :: aname3 = "attr_double" !DOuble Attribute name - CHARACTER(LEN=9), PARAMETER :: aname4 = "attr_real" !Real Attribute name - CHARACTER(LEN=12), PARAMETER :: aname5 = "attr_integer" !Integer Attribute name - CHARACTER(LEN=9), PARAMETER :: aname6 = "attr_null" !Null Attribute name - - ! - !data space rank and dimensions - ! - INTEGER, PARAMETER :: RANK = 2 - INTEGER, PARAMETER :: NX = 4 - INTEGER, PARAMETER :: NY = 5 - - - - INTEGER(HID_T) :: file_id ! File identifier - INTEGER(HID_T) :: dset_id ! Dataset identifier - INTEGER(HID_T) :: dataspace ! Dataspace identifier for dataset - - INTEGER(HID_T) :: attr_id !String Attribute identifier - INTEGER(HID_T) :: attr2_id !Character Attribute identifier - INTEGER(HID_T) :: attr3_id !Double Attribute identifier - INTEGER(HID_T) :: attr4_id !Real Attribute identifier - INTEGER(HID_T) :: attr5_id !Integer Attribute identifier - INTEGER(HID_T) :: attr6_id !Null Attribute identifier - INTEGER(HID_T) :: aspace_id !String Attribute Dataspace identifier - INTEGER(HID_T) :: aspace2_id !Character Attribute Dataspace identifier - INTEGER(HID_T) :: aspace6_id !Null Attribute Dataspace identifier - INTEGER(HID_T) :: atype_id !String Attribute Datatype identifier - INTEGER(HID_T) :: atype2_id !Character Attribute Datatype identifier - INTEGER(HID_T) :: atype3_id !Double Attribute Datatype identifier - INTEGER(HID_T) :: atype4_id !Real Attribute Datatype identifier - INTEGER(HID_T) :: atype5_id !Integer Attribute Datatype identifier - INTEGER(HSIZE_T), DIMENSION(1) :: adims = (/2/) ! Attribute dimension - INTEGER(HSIZE_T), DIMENSION(1) :: adims2 = (/1/) ! Attribute dimension - INTEGER :: arank = 1 ! Attribure rank - INTEGER(SIZE_T) :: attrlen ! Length of the attribute string - - INTEGER(HID_T) :: attr_space !Returned String Attribute Space identifier - INTEGER(HID_T) :: attr2_space !Returned other Attribute Space identifier - INTEGER(HID_T) :: attr_type !Returned Attribute Datatype identifier - INTEGER(HID_T) :: attr2_type !Returned CHARACTER Attribute Datatype identifier - INTEGER(HID_T) :: attr3_type !Returned DOUBLE Attribute Datatype identifier - INTEGER(HID_T) :: attr4_type !Returned REAL Attribute Datatype identifier - INTEGER(HID_T) :: attr5_type !Returned INTEGER Attribute Datatype identifier - INTEGER(HID_T) :: attr6_type !Returned NULL Attribute Datatype identifier - INTEGER :: num_attrs !number of attributes - INTEGER(HSIZE_T) :: attr_storage ! attributes storage requirements .MSB. - CHARACTER(LEN=256) :: attr_name !buffer to put attr_name - INTEGER(SIZE_T) :: name_size = 80 !attribute name length - - CHARACTER(LEN=35), DIMENSION(2) :: attr_data ! String attribute data - CHARACTER(LEN=35), DIMENSION(2) :: aread_data ! Buffer to put read back - ! string attr data - CHARACTER :: attr_character_data = 'A' - REAL(KIND=Fortran_DOUBLE), DIMENSION(1) :: attr_double_data = 3.459D0 - REAL, DIMENSION(1) :: attr_real_data = 4.0 - INTEGER, DIMENSION(1) :: attr_integer_data = 5 - INTEGER(HSIZE_T), DIMENSION(7) :: data_dims - - - CHARACTER :: aread_character_data ! variable to put read back Character attr data - INTEGER, DIMENSION(1) :: aread_integer_data ! variable to put read back integer attr data - INTEGER, DIMENSION(1) :: aread_null_data = 7 ! variable to put read back null attr data - REAL(KIND=Fortran_DOUBLE), DIMENSION(1) :: aread_double_data ! variable to put read back double attr data - REAL, DIMENSION(1) :: aread_real_data ! variable to put read back real attr data - - ! - !general purpose integer - ! - INTEGER :: i, j - INTEGER :: error ! Error flag - - ! - !The dimensions for the dataset. - ! - INTEGER(HSIZE_T), DIMENSION(2) :: dims = (/NX,NY/) - - ! - !data buffers - ! - INTEGER, DIMENSION(NX,NY) :: data_in - - ! - !Initialize data_in buffer - ! - DO i = 1, NX - DO j = 1, NY - data_in(i,j) = (i-1) + (j-1) - END DO - END DO - ! - ! Initialize attribute's data - ! - attr_data(1) = 'Dataset character attribute' - attr_data(2) = 'Some other string here ' - attrlen = LEN(attr_data(1)) - - ! - ! Create the file. - ! - CALL h5_fixname_f(filename, fix_filename, H5P_DEFAULT_F, error) - IF (error .NE. 0) THEN - WRITE(*,*) "Cannot modify file name" - STOP - ENDIF - CALL h5fcreate_f(fix_filename, H5F_ACC_TRUNC_F, file_id, error) - CALL check("h5fcreate_f",error,total_error) - - ! - !Create data space for the dataset. - ! - CALL h5screate_simple_f(RANK, dims, dataspace, error) - CALL check("h5screate_simple_f",error,total_error) - - ! - ! create dataset in the file. - ! - CALL h5dcreate_f(file_id, dsetname, H5T_NATIVE_INTEGER, dataspace, & - dset_id, error) - CALL check("h5dcreate_f",error,total_error) - - ! - ! Write data_in to the dataset - ! - data_dims(1) = NX - data_dims(2) = NY - CALL h5dwrite_f(dset_id, H5T_NATIVE_INTEGER, data_in, data_dims, error) - CALL check("h5dwrite_f",error,total_error) - - ! - ! Create scalar data space for the String attribute. - ! - CALL h5screate_simple_f(arank, adims, aspace_id, error) - CALL check("h5screate_simple_f",error,total_error) - ! - ! Create scalar data space for all other attributes. - ! - CALL h5screate_simple_f(arank, adims2, aspace2_id, error) - CALL check("h5screate_simple_f",error,total_error) - ! - ! Create null data space for null attributes. - ! - CALL h5screate_f(H5S_NULL_F, aspace6_id, error) - CALL check("h5screate_f",error,total_error) - - ! - ! Create datatype for the String attribute. - ! - CALL h5tcopy_f(H5T_NATIVE_CHARACTER, atype_id, error) - CALL check("h5tcopy_f",error,total_error) - - CALL h5tset_size_f(atype_id, attrlen, error) - CALL check("h5tset_size_f",error,total_error) - - ! - ! Create datatype for the Character attribute. - ! - CALL h5tcopy_f(H5T_NATIVE_CHARACTER, atype2_id, error) - CALL check("h5tcopy_f",error,total_error) - ! - ! Create datatype for the Double attribute. - ! - CALL h5tcopy_f(H5T_NATIVE_DOUBLE, atype3_id, error) - CALL check("h5tcopy_f",error,total_error) - ! - ! Create datatype for the Real attribute. - ! - CALL h5tcopy_f(H5T_NATIVE_REAL, atype4_id, error) - CALL check("h5tcopy_f",error,total_error) - ! - ! Create datatype for the Integer attribute. - ! - CALL h5tcopy_f(H5T_NATIVE_INTEGER, atype5_id, error) - CALL check("h5tcopy_f",error,total_error) - - - ! - ! Create dataset String attribute. - ! - CALL h5acreate_f(dset_id, aname, atype_id, aspace_id, & - attr_id, error) - CALL check("h5acreate_f",error,total_error) - - - ! - ! Create dataset CHARACTER attribute. - ! - CALL h5acreate_f(dset_id, aname2, atype2_id, aspace2_id, & - attr2_id, error) - CALL check("h5acreate_f",error,total_error) - - - ! - ! Create dataset DOUBLE attribute. - ! - CALL h5acreate_f(dset_id, aname3, atype3_id, aspace2_id, & - attr3_id, error) - CALL check("h5acreate_f",error,total_error) - ! - ! Create dataset REAL attribute. - ! - CALL h5acreate_f(dset_id, aname4, atype4_id, aspace2_id, & - attr4_id, error) - CALL check("h5acreate_f",error,total_error) - ! - ! Create dataset INTEGER attribute. - ! - CALL h5acreate_f(dset_id, aname5, atype5_id, aspace2_id, & - attr5_id, error) - CALL check("h5acreate_f",error,total_error) - ! - ! Create dataset NULL attribute of INTEGER. - ! - - CALL h5acreate_f(dset_id, aname6, atype5_id, aspace6_id, & - attr6_id, error) - - CALL check("h5acreate_f",error,total_error) - - ! - ! Write the String attribute data. - ! - data_dims(1) = 2 - CALL h5awrite_f(attr_id, atype_id, attr_data, data_dims, error) - CALL check("h5awrite_f",error,total_error) - ! - ! Write the Character attribute data. - ! - CALL h5awrite_f(attr2_id, atype2_id, attr_character_data, data_dims, error) - CALL check("h5awrite_f",error,total_error) - ! - ! Write the DOUBLE attribute data. - ! - data_dims(1) = 1 - CALL h5awrite_f(attr3_id, atype3_id, attr_double_data, data_dims, error) - CALL check("h5awrite_f",error,total_error) - ! - ! Write the Real attribute data. - ! - data_dims(1) = 1 - CALL h5awrite_f(attr4_id, atype4_id, attr_real_data, data_dims, error) - CALL check("h5awrite_f",error,total_error) - - ! - ! Write the Integer attribute data. - ! - data_dims(1) = 1 - CALL h5awrite_f(attr5_id, atype5_id, attr_integer_data, data_dims, error) - CALL check("h5awrite_f",error,total_error) - - ! - ! Write the NULL attribute data(nothing can be written). - ! - CALL h5awrite_f(attr6_id, atype5_id, attr_integer_data, data_dims, error) - CALL check("h5awrite_f",error,total_error) - - ! - ! check the amount of storage that is required for the specified attribute .MSB. - ! - CALL h5aget_storage_size_f(attr_id, attr_storage, error) - CALL check("h5aget_storage_size_f",error,total_error) -! CALL verify("h5aget_storage_size_f",attr_storage,*SizeOf(attr_storage),total_error) - CALL h5aget_storage_size_f(attr2_id, attr_storage, error) - CALL check("h5aget_storage_size_f",error,total_error) -! CALL verify("h5aget_storage_size_f",attr_storage,1,total_error) - CALL h5aget_storage_size_f(attr3_id, attr_storage, error) - CALL check("h5aget_storage_size_f",error,total_error) -! CALL verify("h5aget_storage_size_f",attr_storage,8,total_error) - CALL h5aget_storage_size_f(attr4_id, attr_storage, error) - CALL check("h5aget_storage_size_f",error,total_error) -! CALL verify("h5aget_storage_size_f",attr_storage,4,total_error) - CALL h5aget_storage_size_f(attr5_id, attr_storage, error) - CALL check("h5aget_storage_size_f",error,total_error) -! CALL verify("h5aget_storage_size_f",attr_storage,4,total_error) - CALL h5aget_storage_size_f(attr6_id, attr_storage, error) - CALL check("h5aget_storage_size_f",error,total_error) -! CALL verify("h5aget_storage_size_f",attr_storage,0,total_error) - - - ! - ! Close the attribute. - ! - CALL h5aclose_f(attr_id, error) - CALL check("h5aclose_f",error,total_error) - CALL h5aclose_f(attr2_id, error) - CALL check("h5aclose_f",error,total_error) - CALL h5aclose_f(attr3_id, error) - CALL check("h5aclose_f",error,total_error) - CALL h5aclose_f(attr4_id, error) - CALL check("h5aclose_f",error,total_error) - CALL h5aclose_f(attr5_id, error) - CALL check("h5aclose_f",error,total_error) - CALL h5aclose_f(attr6_id, error) - CALL check("h5aclose_f",error,total_error) - - CALL h5tclose_f(atype_id, error) - CALL check("h5tclose_f",error,total_error) - CALL h5tclose_f(atype2_id, error) - CALL check("h5tclose_f",error,total_error) - CALL h5tclose_f(atype3_id, error) - CALL check("h5tclose_f",error,total_error) - CALL h5tclose_f(atype4_id, error) - CALL check("h5tclose_f",error,total_error) - CALL h5tclose_f(atype5_id, error) - CALL check("h5tclose_f",error,total_error) - - ! - ! Terminate access to the data space. - ! - CALL h5sclose_f(aspace_id, error) - CALL check("h5sclose_f",error,total_error) - CALL h5sclose_f(aspace2_id, error) - CALL check("h5sclose_f",error,total_error) - CALL h5sclose_f(aspace6_id, error) - CALL check("h5sclose_f",error,total_error) - ! - ! Terminate access to the dataset. - ! - CALL h5dclose_f(dset_id, error) - CALL check("h5dclose_f",error,total_error) - ! - ! Terminate access to the file. - ! - CALL h5fclose_f(file_id, error) - CALL check("h5fclose_f",error,total_error) - ! - ! Open file - ! - CALL h5fopen_f(fix_filename, H5F_ACC_RDWR_F, file_id, error) - CALL check("h5open_f",error,total_error) - ! - ! Reopen dataset - ! - CALL h5dopen_f(file_id, dsetname, dset_id, error) - CALL check("h5dopen_f",error,total_error) - ! - !open the String attrbute by name - ! - CALL h5aopen_name_f(dset_id, aname, attr_id, error) - CALL check("h5aopen_name_f",error,total_error) - - ! - !open the CHARACTER attrbute by name - ! - CALL h5aopen_name_f(dset_id, aname2, attr2_id, error) - CALL check("h5aopen_name_f",error,total_error) - ! - !open the DOUBLE attrbute by name - ! - CALL h5aopen_name_f(dset_id, aname3, attr3_id, error) - CALL check("h5aopen_name_f",error,total_error) - ! - !open the REAL attrbute by name - ! - CALL h5aopen_name_f(dset_id, aname4, attr4_id, error) - CALL check("h5aopen_name_f",error,total_error) - - ! - !open the INTEGER attrbute by name - ! - CALL h5aopen_name_f(dset_id, aname5, attr5_id, error) - CALL check("h5aopen_idx_f",error,total_error) - - ! - !open the NULL attrbute by name - ! - CALL h5aopen_name_f(dset_id, aname6, attr6_id, error) - CALL check("h5aopen_idx_f",error,total_error) - - ! - !get the attrbute name - ! - CALL h5aget_name_f(attr5_id, name_size, attr_name, error) - CALL check("h5aget_name_f",error,total_error) - IF (attr_name(1:12) .NE. aname5) THEN - total_error = total_error + 1 - END IF - IF (error .NE. 12) THEN - total_error = total_error + 1 - END IF - - ! - !get the STRING attrbute space - ! - CALL h5aget_space_f(attr_id, attr_space, error) - CALL check("h5aget_space_f",error,total_error) - ! - !get other attrbute space - ! - CALL h5aget_space_f(attr2_id, attr2_space, error) - CALL check("h5aget_space_f",error,total_error) - ! - !get the string attrbute datatype - ! - CALL h5aget_type_f(attr_id, attr_type, error) - CALL check("h5aget_type_f",error,total_error) - ! - !get the character attrbute datatype - ! - CALL h5aget_type_f(attr2_id, attr2_type, error) - CALL check("h5aget_type_f",error,total_error) - ! - !get the double attrbute datatype - ! - CALL h5aget_type_f(attr3_id, attr3_type, error) - CALL check("h5aget_type_f",error,total_error) - ! - !get the real attrbute datatype - ! - CALL h5aget_type_f(attr4_id, attr4_type, error) - CALL check("h5aget_type_f",error,total_error) - - ! - !get the integer attrbute datatype - ! - CALL h5aget_type_f(attr5_id, attr5_type, error) - CALL check("h5aget_type_f",error,total_error) - - ! - !get the null attrbute datatype - ! - CALL h5aget_type_f(attr6_id, attr6_type, error) - CALL check("h5aget_type_f",error,total_error) - - ! - !get number of attributes - ! - CALL h5aget_num_attrs_f(dset_id, num_attrs, error) - CALL check("h5aget_num_attrs_f",error,total_error) - IF (num_attrs .NE. 6) THEN - WRITE(*,*) "got number of attributes wrong", num_attrs - total_error = total_error +1 - END IF - - ! - !set the read back data type's size - ! - CALL h5tcopy_f(H5T_NATIVE_CHARACTER, atype_id, error) - CALL check("h5tcopy_f",error,total_error) - - CALL h5tset_size_f(atype_id, attrlen, error) - CALL check("h5tset_size_f",error,total_error) - ! - !read the string attribute data back to memory - ! - data_dims(1) = 2 - CALL h5aread_f(attr_id, atype_id, aread_data, data_dims, error) - CALL check("h5aread_f",error,total_error) - - IF ( (aread_data(1) .NE. attr_data(1)) .OR. (aread_data(2) .NE. attr_data(2)) ) THEN - WRITE(*,*) "Read back string attrbute is wrong", aread_data(1), aread_data(2) - total_error = total_error + 1 - END IF - - ! - !read the CHARACTER attribute data back to memory - ! - CALL h5aread_f(attr2_id, H5T_NATIVE_CHARACTER, aread_character_data, data_dims, error) - CALL check("h5aread_f",error,total_error) - IF (aread_character_data .NE. 'A' ) THEN - WRITE(*,*) "Read back character attrbute is wrong ",aread_character_data - total_error = total_error + 1 - END IF - ! - !read the double attribute data back to memory - ! - data_dims(1) = 1 - CALL h5aread_f(attr3_id, H5T_NATIVE_DOUBLE, aread_double_data, data_dims, error) - CALL check("h5aread_f",error,total_error) - CALL VERIFY("Read back double attrbute is wrong", aread_double_data(1),3.459_Fortran_DOUBLE,total_error) - - ! - !read the real attribute data back to memory - ! - data_dims(1) = 1 - CALL h5aread_f(attr4_id, H5T_NATIVE_REAL, aread_real_data, data_dims, error) - CALL check("h5aread_f",error,total_error) - CALL VERIFY("Read back real attrbute is wrong", aread_real_data(1),4.0,total_error) - ! - !read the Integer attribute data back to memory - ! - data_dims(1) = 1 - CALL h5aread_f(attr5_id, H5T_NATIVE_INTEGER, aread_integer_data, data_dims, error) - CALL check("h5aread_f",error,total_error) - IF (aread_integer_data(1) .NE. 5 ) THEN - WRITE(*,*) "Read back integer attrbute is wrong ", aread_integer_data - total_error = total_error + 1 - END IF - ! - !read the null attribute data. nothing can be read. - ! - data_dims(1) = 1 - CALL h5aread_f(attr6_id, H5T_NATIVE_INTEGER, aread_null_data, data_dims, error) - CALL check("h5aread_f",error,total_error) - IF (aread_null_data(1) .NE. 7 ) THEN - WRITE(*,*) "Read back null attrbute is wrong ", aread_null_data - total_error = total_error + 1 - END IF - - ! - ! Close the attribute. - ! - CALL h5aclose_f(attr_id, error) - CALL check("h5aclose_f",error,total_error) - CALL h5aclose_f(attr2_id, error) - CALL check("h5aclose_f",error,total_error) - CALL h5aclose_f(attr3_id, error) - CALL check("h5aclose_f",error,total_error) - CALL h5aclose_f(attr4_id, error) - CALL check("h5aclose_f",error,total_error) - CALL h5aclose_f(attr5_id, error) - CALL check("h5aclose_f",error,total_error) - CALL h5aclose_f(attr6_id, error) - CALL check("h5aclose_f",error,total_error) - - ! - ! Delete the attribute from the Dataset. - ! - CALL h5adelete_f(dset_id, aname, error) - CALL check("h5adelete_f",error,total_error) - - ! - !get number of attributes - ! - CALL h5aget_num_attrs_f(dset_id, num_attrs, error) - CALL check("h5aget_num_attrs_f",error,total_error) - IF (num_attrs .NE. 5) THEN - WRITE(*,*) "got number of attributes wrong", num_attrs - total_error = total_error +1 - END IF - - - - CALL h5sclose_f(attr_space, error) - CALL check("h5sclose_f",error,total_error) - CALL h5sclose_f(attr2_space, error) - CALL check("h5sclose_f",error,total_error) - - ! - ! Terminate access to the data type. - ! - CALL h5tclose_f(attr_type, error) - CALL check("h5tclose_f",error,total_error) - CALL h5tclose_f(attr2_type, error) - CALL check("h5tclose_f",error,total_error) - CALL h5tclose_f(attr3_type, error) - CALL check("h5tclose_f",error,total_error) - CALL h5tclose_f(attr4_type, error) - CALL check("h5tclose_f",error,total_error) - CALL h5tclose_f(attr5_type, error) - CALL check("h5tclose_f",error,total_error) - CALL h5tclose_f(attr6_type, error) - CALL check("h5tclose_f",error,total_error) - - ! - ! End access to the dataset and release resources used by it. - ! - CALL h5dclose_f(dset_id, error) - CALL check("h5dclose_f",error,total_error) - - ! - ! Close the file. - ! - CALL h5fclose_f(file_id, error) - CALL check("h5fclose_f",error,total_error) - ! - ! Remove the file - ! - IF (cleanup) CALL h5_cleanup_f(filename, H5P_DEFAULT_F, error) - - RETURN - END SUBROUTINE attribute_test -END MODULE TH5A diff --git a/fortran/test/tH5A_1_8.F90 b/fortran/test/tH5A_1_8.F90 new file mode 100644 index 0000000..c70e288 --- /dev/null +++ b/fortran/test/tH5A_1_8.F90 @@ -0,0 +1,2779 @@ +!****h* root/fortran/test/tH5A_1_8.f90 +! +! NAME +! tH5A_1_8.f90 +! +! FUNCTION +! Basic testing of Fortran H5A APIs introduced in 1.8. +! +! 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. * +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! +! CONTAINS SUBROUTINES +! attribute_test_1_8, test_attr_corder_create_compact, test_attr_null_space, +! test_attr_create_by_name, test_attr_info_by_idx, attr_info_by_idx_check, +! test_attr_shared_rename, test_attr_delete_by_idx, test_attr_shared_delete, +! test_attr_dense_open, test_attr_dense_verify, test_attr_corder_create_basic, +! test_attr_basic_write, test_attr_many, attr_open_check, +! +!***** +MODULE TH5A_1_8 + + USE HDF5 ! This module contains all necessary modules + USE TH5_MISC + USE TH5_MISC_GEN + +CONTAINS +SUBROUTINE attribute_test_1_8(cleanup, total_error) + +! This subroutine tests following 1.8 functionalities: +! h5acreate_f, h5awrite_f, h5aclose_f,h5aread_f, h5aopen_name_f, +! h5aget_name_f,h5aget_space_f, h5aget_type_f, H5Pset_shared_mesg_nindexes_f, +! H5Pset_shared_mesg_index_f +! + + + IMPLICIT NONE + LOGICAL, INTENT(IN) :: cleanup + INTEGER, INTENT(INOUT) :: total_error + + ! + !general purpose integer + ! + INTEGER :: i, j + INTEGER :: error ! Error flag + + ! NEW STARTS HERE + INTEGER(HID_T) :: fapl = -1, fapl2 = -1 + INTEGER(HID_T) :: fcpl = -1, fcpl2 = -1 + INTEGER(HID_T) :: my_fapl, my_fcpl + LOGICAL, DIMENSION(1:2) :: new_format = (/.TRUE.,.FALSE./) + LOGICAL, DIMENSION(1:2) :: use_shared = (/.TRUE.,.FALSE./) + + INTEGER :: ret_total_error + +! ******************** +! test_attr equivelent +! ******************** + +! WRITE(*,*) "TESTING ATTRIBUTES" + + CALL H5Pcreate_f(H5P_FILE_ACCESS_F,fapl,error) + CALL check("h5Pcreate_f",error,total_error) + CALL h5pcopy_f(fapl, fapl2, error) + CALL check("h5pcopy_f",error,total_error) + + CALL H5Pcreate_f(H5P_FILE_CREATE_F,fcpl,error) + CALL check("h5Pcreate_f",error,total_error) + + CALL h5pcopy_f(fcpl, fcpl2, error) + CALL check("h5pcopy_f",error,total_error) + + CALL H5Pset_shared_mesg_nindexes_f(fcpl2,1,error) + CALL check("H5Pset_shared_mesg_nindexes_f",error, total_error) + + CALL H5Pset_shared_mesg_index_f(fcpl2, 0, H5O_SHMESG_ATTR_FLAG_F, 1, error) + CALL check(" H5Pset_shared_mesg_index_f",error, total_error) + + DO i = 1, 2 + + IF (new_format(i)) THEN + WRITE(*,'(1X,A)') "Testing with new file format:" + my_fapl = fapl2 + ELSE + WRITE(*,'(1X,A)') "Testing with old file format:" + my_fapl = fapl + END IF + ret_total_error = 0 + CALL test_attr_basic_write(my_fapl, ret_total_error) + CALL write_test_status(ret_total_error, & + ' - Tests INT attributes on both datasets and groups', & + total_error) + + IF(new_format(i)) THEN + DO j = 1, 2 + IF (use_shared(j)) THEN + WRITE(*,*) " - Testing with shared attributes:" + my_fcpl = fcpl2 + ELSE + WRITE(*,*) " - Testing without shared attributes:" + my_fcpl = fcpl + END IF + + ret_total_error = 0 + CALL test_attr_dense_open(my_fcpl, my_fapl, ret_total_error) + CALL write_test_status(ret_total_error, & + ' - Testing INT attributes on both datasets and groups', & + total_error) + + ret_total_error = 0 + CALL test_attr_null_space(my_fcpl, my_fapl, ret_total_error) + CALL write_test_status(ret_total_error, & + ' - Testing storing attribute with "null" dataspace', & + total_error) + ret_total_error = 0 + CALL test_attr_many(new_format(i), my_fcpl, my_fapl, ret_total_error) + CALL write_test_status(ret_total_error, & + ' - Testing storing lots of attributes', & + total_error) + + ret_total_error = 0 + CALL test_attr_corder_create_basic(my_fcpl, my_fapl, ret_total_error) + CALL write_test_status(ret_total_error, & + ' - Testing creating objects with attribute creation order', & + total_error) + + ret_total_error = 0 + CALL test_attr_corder_create_compact(my_fcpl, my_fapl, ret_total_error) + CALL write_test_status(ret_total_error, & + ' - Testing compact storage on objects with attribute creation order', & + total_error) + ret_total_error = 0 + CALL test_attr_info_by_idx(new_format(i), my_fcpl, my_fapl, ret_total_error) + CALL write_test_status(ret_total_error, & + ' - Testing querying attribute info by index', & + total_error) + + ret_total_error = 0 + CALL test_attr_delete_by_idx(new_format(i), my_fcpl, my_fapl, ret_total_error) + CALL write_test_status(ret_total_error, & + ' - Testing deleting attribute by index', & + total_error) + + ret_total_error = 0 + CALL test_attr_create_by_name(new_format(i), my_fcpl, my_fapl, ret_total_error) + CALL write_test_status(ret_total_error, & + ' - Testing creating attributes by name', & + total_error) + + ! More complex tests with both "new format" and "shared" attributes + IF( use_shared(j) ) THEN + ret_total_error = 0 + CALL test_attr_shared_rename(my_fcpl, my_fapl, ret_total_error) + CALL write_test_status(ret_total_error,& + ' - Testing renaming shared attributes in "compact" & "dense" storage', & + total_error) + + ret_total_error = 0 + CALL test_attr_shared_delete(my_fcpl, my_fapl, ret_total_error) + CALL write_test_status(ret_total_error,& + ' - Testing deleting shared attributes in "compact" & "dense" storage', & + total_error) + + END IF + END DO + END IF + ENDDO + + CALL H5Pclose_f(fcpl, error) + CALL CHECK("H5Pclose", error,total_error) + CALL H5Pclose_f(fcpl2, error) + CALL CHECK("H5Pclose", error,total_error) + + IF(cleanup) CALL h5_cleanup_f("tattr", H5P_DEFAULT_F, error) + CALL check("h5_cleanup_f", error, total_error) + + + RETURN +END SUBROUTINE attribute_test_1_8 + +SUBROUTINE test_attr_corder_create_compact(fcpl,fapl, total_error) + +!*************************************************************** +!** +!** test_attr_corder_create_compact(): Test basic H5A (attribute) code. +!** Tests compact attribute storage on objects with attribute creation order info +!** +!*************************************************************** + +! Needed for get_info_by_name + + + IMPLICIT NONE + +! - - - arg types - - - + + INTEGER(HID_T), INTENT(IN) :: fcpl + INTEGER(HID_T), INTENT(IN) :: fapl + + CHARACTER(LEN=8) :: FileName = "tattr.h5" + INTEGER(HID_T) :: fid + INTEGER(HID_T) :: dcpl + INTEGER(HID_T) :: sid + + INTEGER :: error + INTEGER, INTENT(INOUT) :: total_error + + CHARACTER(LEN=8) :: DSET1_NAME = "Dataset1" + CHARACTER(LEN=8) :: DSET2_NAME = "Dataset2" + CHARACTER(LEN=8) :: DSET3_NAME = "Dataset3" + INTEGER, PARAMETER :: NUM_DSETS = 3 + + INTEGER :: curr_dset + + INTEGER(HID_T) :: dset1, dset2, dset3 + INTEGER(HID_T) :: my_dataset + + INTEGER :: u + + INTEGER :: max_compact ! Maximum # of links to store in group compactly + INTEGER :: min_dense ! Minimum # of links to store in group "densely" + + CHARACTER(LEN=7) :: attrname + CHARACTER(LEN=2) :: chr2 + INTEGER(HID_T) :: attr !String Attribute identifier + INTEGER(HSIZE_T), DIMENSION(7) :: data_dims + + LOGICAL :: f_corder_valid ! Indicates whether the the creation order data is valid for this attribute + INTEGER :: corder ! Is a positive integer containing the creation order of the attribute + INTEGER :: cset ! Indicates the character set used for the attribute’s name + INTEGER(HSIZE_T) :: data_size ! indicates the size, in the number of characters + + data_dims = 0 + +! WRITE(*,*) " - Testing Compact Storage of Attributes with Creation Order Info" + ! Create file + CALL h5fcreate_f(FileName, H5F_ACC_TRUNC_F, fid, error, fcpl, fapl) + CALL check("h5fcreate_f",error,total_error) + ! Create dataset creation property list + CALL H5Pcreate_f(H5P_DATASET_CREATE_F,dcpl,error) + CALL check("h5Pcreate_f",error,total_error) + + CALL H5Pset_attr_creation_order_f(dcpl, IOR(H5P_CRT_ORDER_TRACKED_F, H5P_CRT_ORDER_INDEXED_F), error) + CALL check("H5Pset_attr_creation_order",error,total_error) + + ! Query the attribute creation properties + CALL H5Pget_attr_phase_change_f(dcpl, max_compact, min_dense, error) + CALL check("H5Pget_attr_phase_change_f",error,total_error) + + CALL h5screate_f(H5S_SCALAR_F, sid, error) + CALL check("h5screate_f",error,total_error) + + CALL h5dcreate_f(fid, DSET1_NAME, H5T_NATIVE_CHARACTER, sid, dset1, error, dcpl_id=dcpl ) + CALL check("h5dcreate_f",error,total_error) + + CALL h5dcreate_f(fid, DSET2_NAME, H5T_NATIVE_CHARACTER, sid, dset2, error, dcpl ) + CALL check("h5dcreate_f",error,total_error) + + CALL h5dcreate_f(fid, DSET3_NAME, H5T_NATIVE_CHARACTER, sid, dset3, error, dcpl_id=dcpl ) + CALL check("h5dcreate_f",error,total_error) + + DO curr_dset = 0,NUM_DSETS-1 + SELECT CASE (curr_dset) + CASE (0) + my_dataset = dset1 + CASE (1) + my_dataset = dset2 + CASE (2) + my_dataset = dset3 + END SELECT + DO u = 0, max_compact - 1 + ! Create attribute + WRITE(chr2,'(I2.2)') u + attrname = 'attr '//chr2 + + CALL h5acreate_f(my_dataset, attrname, H5T_NATIVE_INTEGER, sid, attr, error) + CALL check("h5acreate_f",error,total_error) + + data_dims(1) = 1 + CALL h5awrite_f(attr, H5T_NATIVE_INTEGER, u, data_dims, error) + CALL check("h5awrite_f",error,total_error) + + CALL h5aclose_f(attr, error) + CALL check("h5aclose_f",error,total_error) + + END DO + END DO + + ! Close Datasets + CALL h5dclose_f(dset1, error) + CALL check("h5dclose_f",error,total_error) + CALL h5dclose_f(dset2, error) + CALL check("h5dclose_f",error,total_error) + CALL h5dclose_f(dset3, error) + CALL check("h5dclose_f",error,total_error) + + ! Close file + CALL h5fclose_f(fid, error) + CALL check("h5fclose_f",error,total_error) + + ! Close dataspace + CALL h5sclose_f(sid, error) + CALL check("h5sclose_f",error,total_error) + + ! Close property list + CALL h5pclose_f(dcpl, error) + CALL check("h5pclose_f",error,total_error) + + CALL h5fopen_f(FileName, H5F_ACC_RDWR_F, fid, error, fapl) + CALL check("h5open_f",error,total_error) + + CALL h5dopen_f(fid, DSET1_NAME, dset1, error) + CALL check("h5dopen_f",error,total_error) + CALL h5dopen_f(fid, DSET2_NAME, dset2, error) + CALL check("h5dopen_f",error,total_error) + CALL h5dopen_f(fid, DSET3_NAME, dset3, error) + CALL check("h5dopen_f",error,total_error) + DO curr_dset = 0,NUM_DSETS-1 + SELECT CASE (curr_dset) + CASE (0) + my_dataset = dset1 + CASE (1) + my_dataset = dset2 + CASE (2) + my_dataset = dset3 + CASE DEFAULT + WRITE(*,*) " WARNING: To many data sets! " + END SELECT + DO u = 0,max_compact-1 + WRITE(chr2,'(I2.2)') u + attrname = 'attr '//chr2 + ! Retrieve information for attribute + + CALL H5Aget_info_by_name_f(my_dataset, ".", attrname, & + f_corder_valid, corder, cset, data_size, error, lapl_id = H5P_DEFAULT_F ) !with optional + + CALL check("H5Aget_info_by_name_f", error, total_error) + + ! Verify creation order of attribute + + CALL verify("H5Aget_info_by_name_f", f_corder_valid, .TRUE., total_error) + CALL verify("H5Aget_info_by_name_f", corder, u, total_error) + + + ! Retrieve information for attribute + + CALL H5Aget_info_by_name_f(my_dataset, ".", attrname, & + f_corder_valid, corder, cset, data_size, error) ! without optional + + CALL check("H5Aget_info_by_name_f", error, total_error) + + ! Verify creation order of attribute + + CALL verify("H5Aget_info_by_name_f", f_corder_valid, .TRUE., total_error) + CALL verify("H5Aget_info_by_name_f", corder, u, total_error) + + END DO + END DO + ! Close Datasets + CALL h5dclose_f(dset1, error) + CALL check("h5dclose_f",error,total_error) + CALL h5dclose_f(dset2, error) + CALL check("h5dclose_f",error,total_error) + CALL h5dclose_f(dset3, error) + CALL check("h5dclose_f",error,total_error) + + ! Close file + CALL h5fclose_f(fid, error) + CALL check("h5fclose_f",error,total_error) + +END SUBROUTINE test_attr_corder_create_compact + +SUBROUTINE test_attr_null_space(fcpl, fapl, total_error) +!*************************************************************** +!** +!** test_attr_null_space(): Test basic H5A (attribute) code. +!** Tests storing attribute with "null" dataspace +!** +!*************************************************************** + + + IMPLICIT NONE + + INTEGER(HID_T), INTENT(IN) :: fcpl + INTEGER(HID_T), INTENT(IN) :: fapl + INTEGER, INTENT(INOUT) :: total_error + + CHARACTER(LEN=8) :: FileName = "tattr.h5" + INTEGER(HID_T) :: fid + INTEGER(HID_T) :: sid, null_sid + INTEGER(HID_T) :: dataset + + CHARACTER(LEN=8) :: DSET1_NAME = "Dataset1" + + INTEGER :: error + + INTEGER :: value_scalar + INTEGER, DIMENSION(1) :: value + INTEGER(HID_T) :: attr !String Attribute identifier + INTEGER(HID_T) :: attr_sid + INTEGER(HSIZE_T), DIMENSION(7) :: data_dims + + INTEGER(HSIZE_T) :: storage_size ! attributes storage requirements + + LOGICAL :: f_corder_valid ! Indicates whether the the creation order data is valid for this attribute + INTEGER :: corder ! Is a positive integer containing the creation order of the attribute + INTEGER :: cset ! Indicates the character set used for the attribute’s name + INTEGER(HSIZE_T) :: data_size ! indicates the size, in the number of characters + + LOGICAL :: equal + + ! test: H5Sextent_equal_f + + data_dims = 0 + + ! Create file + CALL h5fcreate_f(FileName, H5F_ACC_TRUNC_F, fid, error, fcpl, fapl) + CALL check("h5fcreate_f",error,total_error) + ! Close file + CALL h5fclose_f(fid, error) + CALL check("h5fclose_f",error,total_error) + + ! Re-open file + CALL h5fopen_f(FileName, H5F_ACC_RDWR_F, fid, error) + CALL check("h5open_f",error,total_error) + ! Create dataspace for dataset attributes + CALL h5screate_f(H5S_SCALAR_F, sid, error) + CALL check("h5screate_f",error,total_error) + ! Create "null" dataspace for attribute + CALL h5screate_f(H5S_NULL_F, null_sid, error) + CALL check("h5screate_f",error,total_error) + ! Create a dataset + CALL h5dcreate_f(fid, DSET1_NAME, H5T_NATIVE_CHARACTER, sid, dataset, error) + CALL check("h5dcreate_f",error,total_error) + ! Add attribute with 'null' dataspace + + ! Create attribute + CALL h5acreate_f(dataset, "null attr", H5T_NATIVE_INTEGER, null_sid, attr, error) + CALL check("h5acreate_f",error,total_error) + + ! Try to read data from the attribute + ! (shouldn't fail, but should leave buffer alone) + value(1) = 103 + data_dims(1) = 1 + CALL h5aread_f(attr, H5T_NATIVE_INTEGER, value, data_dims, error) + CALL check("h5aread_f",error,total_error) + CALL verify("h5aread_f",value(1),103,total_error) + +! Try to read data from the attribute again but +! for a scalar + + value_scalar = 104 + data_dims(1) = 1 + CALL h5aread_f(attr, H5T_NATIVE_INTEGER, value_scalar, data_dims, error) + CALL check("h5aread_f",error,total_error) + CALL verify("h5aread_f",value_scalar,104,total_error) + + CALL h5aget_space_f(attr, attr_sid, error) + CALL check("h5aget_space_f",error,total_error) + + CALL H5Sextent_equal_f(attr_sid, null_sid, equal, error) + CALL check("H5Sextent_equal_f",error,total_error) + CALL verify("H5Sextent_equal_f",equal,.TRUE.,total_error) + + CALL h5aget_storage_size_f(attr, storage_size, error) + CALL check("h5aget_storage_size_f",error,total_error) + CALL verify("h5aget_storage_size_f",INT(storage_size),0,total_error) + + CALL h5aget_info_f(attr, f_corder_valid, corder, cset, data_size, error) + CALL check("h5aget_info_f", error, total_error) + + ! Check the attribute's information + CALL verify("h5aget_info_f.corder",corder,0,total_error) + + CALL verify("h5aget_info_f.cset", cset, H5T_CSET_ASCII_F, total_error) + CALL h5aget_storage_size_f(attr, storage_size, error) + CALL check("h5aget_storage_size_f",error,total_error) + CALL verify("h5aget_info_f.data_size", INT(data_size), INT(storage_size), total_error) + CALL h5aclose_f(attr,error) + CALL check("h5aclose_f",error,total_error) + + CALL H5Sclose_f(attr_sid, error) + CALL check("H5Sclose_f",error,total_error) + + CALL H5Dclose_f(dataset, error) + CALL check("H5Dclose_f", error,total_error) + + + CALL H5Fclose_f(fid, error) + CALL check("H5Fclose_f", error,total_error) + + CALL H5Sclose_f(sid, error) + CALL check("H5Sclose_f", error,total_error) + + CALL H5Sclose_f(null_sid, error) + CALL check("H5Sclose_f", error,total_error) + +END SUBROUTINE test_attr_null_space + + +SUBROUTINE test_attr_create_by_name(new_format,fcpl,fapl, total_error) + +!*************************************************************** +!** +!** test_attr_create_by_name(): Test basic H5A (attribute) code. +!** Tests creating attributes by name +!** +!*************************************************************** + + IMPLICIT NONE + + INTEGER(SIZE_T), PARAMETER :: NAME_BUF_SIZE = 7 + LOGICAL :: new_format + INTEGER(HID_T), INTENT(IN) :: fcpl + INTEGER(HID_T), INTENT(IN) :: fapl + INTEGER, INTENT(INOUT) :: total_error + + INTEGER :: max_compact,min_dense,u + CHARACTER (LEN=NAME_BUF_SIZE) :: attrname + CHARACTER(LEN=8) :: dsetname + + CHARACTER(LEN=8) :: FileName = "tattr.h5" + INTEGER(HID_T) :: fid + INTEGER(HID_T) :: dcpl + INTEGER(HID_T) :: sid + + CHARACTER(LEN=8) :: DSET1_NAME = "Dataset1" + CHARACTER(LEN=8) :: DSET2_NAME = "Dataset2" + CHARACTER(LEN=8) :: DSET3_NAME = "Dataset3" + INTEGER, PARAMETER :: NUM_DSETS = 3 + + INTEGER :: curr_dset + + INTEGER(HID_T) :: dset1, dset2, dset3 + INTEGER(HID_T) :: my_dataset + INTEGER :: error + + INTEGER(HID_T) :: attr !String Attribute identifier + INTEGER(HSIZE_T), DIMENSION(7) :: data_dims + + + CHARACTER(LEN=2) :: chr2 + LOGICAL, DIMENSION(1:2) :: use_index = (/.FALSE.,.TRUE./) + INTEGER :: Input1 + INTEGER :: i + + data_dims = 0 + + + ! Create dataspace for dataset & attributes + CALL h5screate_f(H5S_SCALAR_F, sid, error) + CALL check("h5screate_f",error,total_error) + + ! Create dataset creation property list + CALL H5Pcreate_f(H5P_DATASET_CREATE_F,dcpl,error) + CALL check("h5Pcreate_f",error,total_error) + + ! Query the attribute creation properties + + CALL H5Pget_attr_phase_change_f(dcpl, max_compact, min_dense, error) + CALL check("H5Pget_attr_phase_change_f",error,total_error) + + ! Loop over using index for creation order value + DO i = 1, 2 + ! Print appropriate test message + IF(use_index(i))THEN + WRITE(*,*) " - Testing Creating Attributes By Name w/Creation Order Index" + ELSE + WRITE(*,*) " - Testing Creating Attributes By Name w/o Creation Order Index" + ENDIF + ! Create file + CALL h5fcreate_f(FileName, H5F_ACC_TRUNC_F, fid, error, fcpl, fapl) + CALL check("h5fcreate_f",error,total_error) + + ! Set attribute creation order tracking & indexing for object + IF(new_format)THEN + + IF(use_index(i))THEN + Input1 = H5P_CRT_ORDER_INDEXED_F + ELSE + Input1 = 0 + ENDIF + + CALL H5Pset_attr_creation_order_f(dcpl, IOR(H5P_CRT_ORDER_TRACKED_F, Input1), error) + CALL check("H5Pset_attr_creation_order",error,total_error) + + ENDIF + + ! Create datasets + + CALL h5dcreate_f(fid, DSET1_NAME, H5T_NATIVE_CHARACTER, sid, dset1, error, dcpl_id=dcpl ) + CALL check("h5dcreate_f2",error,total_error) + + CALL h5dcreate_f(fid, DSET2_NAME, H5T_NATIVE_CHARACTER, sid, dset2, error, dcpl_id=dcpl ) + CALL check("h5dcreate_f3",error,total_error) + + CALL h5dcreate_f(fid, DSET3_NAME, H5T_NATIVE_CHARACTER, sid, dset3, error, dcpl_id=dcpl ) + CALL check("h5dcreate_f4",error,total_error) + + + ! Work on all the datasets + + DO curr_dset = 0,NUM_DSETS-1 + SELECT CASE (curr_dset) + CASE (0) + my_dataset = dset1 + dsetname = DSET1_NAME + CASE (1) + my_dataset = dset2 + dsetname = DSET2_NAME + CASE (2) + my_dataset = dset3 + dsetname = DSET3_NAME + ! CASE DEFAULT + ! CALL HDassert(0.AND."Toomanydatasets!") + END SELECT + + + ! Create attributes, up to limit of compact form + + DO u = 0, max_compact - 1 + ! Create attribute + WRITE(chr2,'(I2.2)') u + attrname = 'attr '//chr2 + CALL H5Acreate_by_name_f(fid, dsetname, attrname, H5T_NATIVE_INTEGER, sid, & + attr, error, lapl_id=H5P_DEFAULT_F, acpl_id=H5P_DEFAULT_F, aapl_id=H5P_DEFAULT_F) + CALL check("H5Acreate_by_name_f",error,total_error) + + ! Write data into the attribute + + data_dims(1) = 1 + CALL h5awrite_f(attr, H5T_NATIVE_INTEGER, u, data_dims, error) + CALL check("h5awrite_f",error,total_error) + + ! Close attribute + CALL h5aclose_f(attr, error) + CALL check("h5aclose_f",error,total_error) + + ! Verify information for NEW attribute + CALL attr_info_by_idx_check(my_dataset, attrname, INT(u,HSIZE_T), use_index(i), total_error) + ! CALL check("FAILED IN attr_info_by_idx_check",total_error) + ENDDO + + ! Test opening attributes stored compactly + + CALL attr_open_check(fid, dsetname, my_dataset, u, total_error) + + ENDDO + + + ! Work on all the datasets + DO curr_dset = 0,NUM_DSETS-1 + SELECT CASE (curr_dset) + CASE (0) + my_dataset = dset1 + dsetname = DSET1_NAME + CASE (1) + my_dataset = dset2 + dsetname = DSET2_NAME + CASE (2) + my_dataset = dset3 + dsetname = DSET3_NAME + END SELECT + + ! Create more attributes, to push into dense form + DO u = max_compact, max_compact* 2 - 1 + + WRITE(chr2,'(I2.2)') u + attrname = 'attr '//chr2 + + CALL H5Acreate_by_name_f(fid, dsetname, attrname, H5T_NATIVE_INTEGER, sid, & + attr, error, lapl_id=H5P_DEFAULT_F) + CALL check("H5Acreate_by_name",error,total_error) + + ! Write data into the attribute + data_dims(1) = 1 + CALL h5awrite_f(attr, H5T_NATIVE_INTEGER, u, data_dims, error) + CALL check("h5awrite_f",error,total_error) + + ! Close attribute + CALL h5aclose_f(attr, error) + CALL check("h5aclose_f",error,total_error) + + ENDDO + + ENDDO + + ! Close Datasets + CALL h5dclose_f(dset1, error) + CALL check("h5dclose_f",error,total_error) + CALL h5dclose_f(dset2, error) + CALL check("h5dclose_f",error,total_error) + CALL h5dclose_f(dset3, error) + CALL check("h5dclose_f",error,total_error) + + + ! Close file + CALL h5fclose_f(fid, error) + CALL check("h5fclose_f",error,total_error) + ENDDO + + ! Close property list + CALL h5pclose_f(dcpl, error) + CALL check("h5pclose_f",error,total_error) + + ! Close dataspace + CALL h5sclose_f(sid, error) + CALL check("h5sclose_f",error,total_error) + +END SUBROUTINE test_attr_create_by_name + + +SUBROUTINE test_attr_info_by_idx(new_format, fcpl, fapl, total_error) + +!*************************************************************** +!** +!** test_attr_info_by_idx(): Test basic H5A (attribute) code. +!** Tests querying attribute info by index +!** +!*************************************************************** + + IMPLICIT NONE + + LOGICAL :: new_format + INTEGER(HID_T), INTENT(IN) :: fcpl + INTEGER(HID_T), INTENT(IN) :: fapl + INTEGER, INTENT(INOUT) :: total_error + CHARACTER(LEN=8) :: FileName = "tattr.h5" + INTEGER(HID_T) :: fid + INTEGER(HID_T) :: dcpl + INTEGER(HID_T) :: sid + + CHARACTER(LEN=8) :: DSET1_NAME = "Dataset1" + CHARACTER(LEN=8) :: DSET2_NAME = "Dataset2" + CHARACTER(LEN=8) :: DSET3_NAME = "Dataset3" + INTEGER, PARAMETER :: NUM_DSETS = 3 + + INTEGER :: curr_dset + + INTEGER(HID_T) :: dset1, dset2, dset3 + INTEGER(HID_T) :: my_dataset + INTEGER :: error + + INTEGER(HID_T) :: attr !String Attribute identifier + INTEGER(HSIZE_T), DIMENSION(7) :: data_dims + + LOGICAL :: f_corder_valid ! Indicates whether the the creation order data is valid for this attribute + INTEGER :: corder ! Is a positive integer containing the creation order of the attribute + INTEGER :: cset ! Indicates the character set used for the attribute’s name + INTEGER(HSIZE_T) :: data_size ! indicates the size, in the number of characters + INTEGER(HSIZE_T) :: n + LOGICAL, DIMENSION(1:2) :: use_index = (/.FALSE.,.TRUE./) + + INTEGER :: max_compact ! Maximum # of links to store in group compactly + INTEGER :: min_dense ! Minimum # of links to store in group "densely" + + CHARACTER(LEN=2) :: chr2 + + INTEGER :: i, j + + INTEGER, DIMENSION(1) :: attr_integer_data + CHARACTER(LEN=7) :: attrname + + INTEGER(SIZE_T) :: size + CHARACTER(LEN=80) :: tmpname + + INTEGER :: Input1 + INTEGER(HSIZE_T) :: hzero = 0_HSIZE_T + INTEGER :: minusone = -1 + INTEGER(HSIZE_T) :: htmp + + data_dims = 0 + + ! Create dataspace for dataset & attributes + + CALL h5screate_f(H5S_SCALAR_F, sid, error) + CALL check("h5screate_f",error,total_error) + + + ! Create dataset creation property list + + CALL H5Pcreate_f(H5P_DATASET_CREATE_F,dcpl,error) + CALL check("h5Pcreate_f",error,total_error) + + + ! Query the attribute creation properties + CALL H5Pget_attr_phase_change_f(dcpl, max_compact, min_dense, error) + CALL check("H5Pget_attr_phase_change_f",error,total_error) + + ! Loop over using index for creation order value + + DO i = 1, 2 + + ! Create file + CALL h5fcreate_f(FileName, H5F_ACC_TRUNC_F, fid, error, fcpl, fapl) + CALL check("h5fcreate_f",error,total_error) + + ! Set attribute creation order tracking & indexing for object + IF(new_format)THEN + IF(use_index(i))THEN + Input1 = H5P_CRT_ORDER_INDEXED_F + ELSE + Input1 = 0 + ENDIF + CALL H5Pset_attr_creation_order_f(dcpl, IOR(H5P_CRT_ORDER_TRACKED_F, Input1), error) + CALL check("H5Pset_attr_creation_order",error,total_error) + ENDIF + + ! Create datasets + + CALL h5dcreate_f(fid, DSET1_NAME, H5T_NATIVE_CHARACTER, sid, dset1, error ) + CALL check("h5dcreate_f",error,total_error) + + CALL h5dcreate_f(fid, DSET2_NAME, H5T_NATIVE_CHARACTER, sid, dset2, error ) + CALL check("h5dcreate_f",error,total_error) + + CALL h5dcreate_f(fid, DSET3_NAME, H5T_NATIVE_CHARACTER, sid, dset3, error ) + CALL check("h5dcreate_f",error,total_error) + + ! Work on all the datasets + + DO curr_dset = 0,NUM_DSETS-1 + + SELECT CASE (curr_dset) + CASE (0) + my_dataset = dset1 + CASE (1) + my_dataset = dset2 + CASE (2) + my_dataset = dset3 + END SELECT + + ! Check for query on non-existant attribute + + n = 0 + + ! -- CHECK PASSING AN INTEGER CONSTANT IN DIFFERENT FORMS -- + + ! 1) call by passing an integer with the _hsize_t declaration + + CALL h5aget_info_by_idx_f(my_dataset, ".", H5_INDEX_CRT_ORDER_F, H5_ITER_INC_F, 0_hsize_t, & + f_corder_valid, corder, cset, data_size, error, lapl_id=H5P_DEFAULT_F) + CALL verify("h5aget_info_by_idx_f",error,minusone,total_error) + + ! 2) call by passing an integer with the INT(,hsize_t) declaration + + CALL h5aget_info_by_idx_f(my_dataset, ".", H5_INDEX_CRT_ORDER_F, H5_ITER_INC_F, INT(0,hsize_t), & + f_corder_valid, corder, cset, data_size, error, lapl_id=H5P_DEFAULT_F) + CALL verify("h5aget_info_by_idx_f",error,minusone,total_error) + + + ! 3) call by passing a variable with the attribute hsize_t + + CALL h5aget_info_by_idx_f(my_dataset, ".", H5_INDEX_CRT_ORDER_F, H5_ITER_INC_F, hzero, & + f_corder_valid, corder, cset, data_size, error, lapl_id=H5P_DEFAULT_F) + CALL verify("h5aget_info_by_idx_f",error,minusone,total_error) + + CALL h5aget_name_by_idx_f(my_dataset, ".", H5_INDEX_CRT_ORDER_F, H5_ITER_INC_F, & + hzero, tmpname, error, size, lapl_id=H5P_DEFAULT_F) + CALL verify("h5aget_name_by_idx_f",error,minusone,total_error) + + + ! Create attributes, up to limit of compact form + + DO j = 0, max_compact-1 + ! Create attribute + WRITE(chr2,'(I2.2)') j + attrname = 'attr '//chr2 + + ! check with the optional information create2 specs. + CALL h5acreate_f(my_dataset, attrname, H5T_NATIVE_INTEGER, sid, attr, error, H5P_DEFAULT_F, H5P_DEFAULT_F) + CALL check("h5acreate_f",error,total_error) + + ! Write data into the attribute + + attr_integer_data(1) = j + data_dims(1) = 1 + CALL h5awrite_f(attr, H5T_NATIVE_INTEGER, attr_integer_data, data_dims, error) + CALL check("h5awrite_f",error,total_error) + + ! Close attribute + + CALL h5aclose_f(attr, error) + CALL check("h5aclose_f",error,total_error) + + ! Verify information for new attribute + +!EP CALL attr_info_by_idx_check(my_dataset, attrname, INT(j,HSIZE_T), use_index(i), total_error ) + htmp = j + CALL attr_info_by_idx_check(my_dataset, attrname, htmp, use_index(i), total_error ) + + !CHECK(ret, FAIL, "attr_info_by_idx_check"); + ENDDO + + ENDDO + + + ! Close Datasets + CALL h5dclose_f(dset1, error) + CALL check("h5dclose_f",error,total_error) + CALL h5dclose_f(dset2, error) + CALL check("h5dclose_f",error,total_error) + CALL h5dclose_f(dset3, error) + CALL check("h5dclose_f",error,total_error) + + ! Close file + CALL h5fclose_f(fid, error) + CALL check("h5fclose_f",error,total_error) + + END DO + + ! Close property list + CALL h5pclose_f(dcpl,error) + CALL check("h5pclose_f", error, total_error) + + ! Close dataspace + CALL h5sclose_f(sid, error) + CALL check("h5sclose_f",error,total_error) + +END SUBROUTINE test_attr_info_by_idx + + +SUBROUTINE attr_info_by_idx_check(obj_id, attrname, n, use_index, total_error ) + + IMPLICIT NONE + + INTEGER :: error, total_error + + INTEGER(HID_T) :: obj_id + CHARACTER(LEN=*) :: attrname + INTEGER(HSIZE_T) :: n + LOGICAL :: use_index + LOGICAL :: f_corder_valid ! Indicates whether the the creation order data is valid for this attribute + INTEGER :: corder ! Is a positive integer containing the creation order of the attribute + INTEGER :: cset ! Indicates the character set used for the attribute’s name + INTEGER(HSIZE_T) :: data_size ! indicates the size, in the number of characters + + INTEGER(SIZE_T) :: NAME_BUF_SIZE = 7 + CHARACTER(LEN=7) :: tmpname + INTEGER(HSIZE_T) :: hzero = 0_HSIZE_T + + + ! Verify the information for first attribute, in increasing creation order + CALL h5aget_info_by_idx_f(obj_id, ".", H5_INDEX_CRT_ORDER_F, H5_ITER_INC_F, hzero, & + f_corder_valid, corder, cset, data_size, error) + + CALL check("h5aget_info_by_idx_f",error,total_error) + CALL verify("h5aget_info_by_idx_f",corder,0,total_error) + ! Verify the information for new attribute, in increasing creation order + + CALL h5aget_info_by_idx_f(obj_id, ".", H5_INDEX_CRT_ORDER_F, H5_ITER_INC_F, n, & + f_corder_valid, corder, cset, data_size, error) + + CALL check("h5aget_info_by_idx_f",error,total_error) + CALL verify("h5aget_info_by_idx_f",corder,INT(n),total_error) + + ! Verify the name for new link, in increasing creation order + + ! Try with the correct buffer size + + CALL h5aget_name_by_idx_f(obj_id, ".", H5_INDEX_CRT_ORDER_F, H5_ITER_INC_F, & + n, tmpname, error, NAME_BUF_SIZE) + CALL check("h5aget_name_by_idx_f",error,total_error) + CALL verify("h5aget_name_by_idx_f", INT(NAME_BUF_SIZE), 7, error) + + IF(attrname.NE.tmpname)THEN + error = -1 + ENDIF + CALL verify("h5aget_name_by_idx_f",error,0,total_error) + + ! Don't test "native" order if there is no creation order index, since + ! * there's not a good way to easily predict the attribute's order in the name + ! * index. + ! + IF (use_index) THEN + ! Verify the information for first attribute, in native creation order + CALL h5aget_info_by_idx_f(obj_id, ".", H5_INDEX_CRT_ORDER_F, H5_ITER_NATIVE_F, hzero, & + f_corder_valid, corder, cset, data_size, error) + CALL check("h5aget_info_by_idx_f",error,total_error) + CALL verify("h5aget_info_by_idx_f",corder,0,total_error) + + ! Verify the information for new attribute, in native creation order + CALL h5aget_info_by_idx_f(obj_id, ".", H5_INDEX_CRT_ORDER_F, H5_ITER_NATIVE_F, n, & + f_corder_valid, corder, cset, data_size, error) + CALL check("h5aget_info_by_idx_f",error,total_error) + CALL verify("h5aget_info_by_idx_f",corder,INT(n),total_error) + + ! Verify the name for new link, in increasing native order + CALL h5aget_name_by_idx_f(obj_id, ".", H5_INDEX_CRT_ORDER_F, H5_ITER_NATIVE_F, & + n, tmpname, error) ! check with no optional parameters + CALL check("h5aget_name_by_idx_f",error,total_error) + IF(TRIM(attrname).NE.TRIM(tmpname))THEN + WRITE(*,*) "ERROR: attribute name size wrong!" + error = -1 + ENDIF + CALL verify("h5aget_name_by_idx_f",error,0,total_error) + END IF + + + CALL h5aget_info_by_idx_f(obj_id, ".", H5_INDEX_CRT_ORDER_F, H5_ITER_DEC_F, n, & + f_corder_valid, corder, cset, data_size, error) + CALL check("h5aget_info_by_idx_f",error,total_error) + CALL verify("h5aget_info_by_idx_f",corder,0,total_error) + +!EP CALL h5aget_info_by_idx_f(obj_id, ".", H5_INDEX_CRT_ORDER_F, H5_ITER_DEC_F, 0_HSIZE_T, & + + ! -- CHECK PASSING AN INTEGER CONSTANT IN DIFFERENT FORMS -- + + ! 1) call by passing an integer with the _hsize_t declaration + + CALL h5aget_info_by_idx_f(obj_id, ".", H5_INDEX_CRT_ORDER_F, H5_ITER_DEC_F, 0_HSIZE_T, & + f_corder_valid, corder, cset, data_size, error) + CALL check("h5aget_info_by_idx_f",error,total_error) + CALL verify("h5aget_info_by_idx_f",corder,INT(n),total_error) + + ! 2) call by passing an integer with the INT(,hsize_t) declaration + + CALL h5aget_info_by_idx_f(obj_id, ".", H5_INDEX_CRT_ORDER_F, H5_ITER_DEC_F, INT(0,HSIZE_T), & + f_corder_valid, corder, cset, data_size, error) + CALL check("h5aget_info_by_idx_f",error,total_error) + CALL verify("h5aget_info_by_idx_f",corder,INT(n),total_error) + + ! 3) call by passing a variable with the attribute hsize_t + + CALL h5aget_info_by_idx_f(obj_id, ".", H5_INDEX_CRT_ORDER_F, H5_ITER_DEC_F, hzero, & + f_corder_valid, corder, cset, data_size, error) + CALL check("h5aget_info_by_idx_f",error,total_error) + CALL verify("h5aget_info_by_idx_f",corder,INT(n),total_error) + +!EP CALL h5aget_info_by_idx_f(obj_id, ".", H5_INDEX_NAME_F, H5_ITER_INC_F, 0_HSIZE_T, & + CALL h5aget_info_by_idx_f(obj_id, ".", H5_INDEX_NAME_F, H5_ITER_INC_F, hzero, & + f_corder_valid, corder, cset, data_size, error) + CALL check("h5aget_info_by_idx_f",error,total_error) + CALL verify("h5aget_info_by_idx_f",corder,0,total_error) + CALL h5aget_info_by_idx_f(obj_id, ".", H5_INDEX_NAME_F, H5_ITER_INC_F, n, & + f_corder_valid, corder, cset, data_size, error) + CALL check("h5aget_info_by_idx_f",error,total_error) + CALL verify("h5aget_info_by_idx_f",corder,INT(n),total_error) + + CALL h5aget_info_by_idx_f(obj_id, ".", H5_INDEX_NAME_F, H5_ITER_DEC_F, n, & + f_corder_valid, corder, cset, data_size, error) + CALL check("h5aget_info_by_idx_f",error,total_error) + CALL verify("h5aget_info_by_idx_f",corder,0,total_error) +!EP CALL h5aget_info_by_idx_f(obj_id, ".", H5_INDEX_NAME_F, H5_ITER_DEC_F, 0_HSIZE_T, & + CALL h5aget_info_by_idx_f(obj_id, ".", H5_INDEX_NAME_F, H5_ITER_DEC_F, hzero, & + f_corder_valid, corder, cset, data_size, error) + CALL check("h5aget_info_by_idx_f",error,total_error) + CALL verify("h5aget_info_by_idx_f",corder,INT(n),total_error) + + +END SUBROUTINE attr_info_by_idx_check + + +SUBROUTINE test_attr_shared_rename( fcpl, fapl, total_error) + +!*************************************************************** +!** +!** test_attr_shared_rename(): Test basic H5A (attribute) code. +!** Tests renaming shared attributes in "compact" & "dense" storage +!** +!*************************************************************** + + IMPLICIT NONE + + INTEGER(HID_T), INTENT(IN) :: fcpl + INTEGER(HID_T), INTENT(IN) :: fapl + INTEGER, INTENT(INOUT) :: total_error + + CHARACTER(LEN=8) :: FileName = "tattr.h5" + INTEGER(HID_T) :: fid + INTEGER(HID_T) :: dcpl + INTEGER(HID_T) :: sid, big_sid + + CHARACTER(LEN=8) :: DSET1_NAME = "Dataset1" + CHARACTER(LEN=8) :: DSET2_NAME = "Dataset2" + + + INTEGER(HID_T) :: dataset, dataset2 + + INTEGER :: error + + INTEGER(HID_T) :: attr !String Attribute identifier + INTEGER(HID_T) :: attr_tid + INTEGER(HSIZE_T), DIMENSION(7) :: data_dims + + + INTEGER :: max_compact ! Maximum # of links to store in group compactly + INTEGER :: min_dense ! Minimum # of links to store in group "densely" + + CHARACTER(LEN=2) :: chr2 + + + INTEGER, DIMENSION(1) :: attr_integer_data + CHARACTER(LEN=7) :: attrname + CHARACTER(LEN=11) :: attrname2 + + INTEGER :: u + INTEGER(HID_T) :: my_fcpl + + CHARACTER(LEN=5), PARAMETER :: TYPE1_NAME = "/Type" + + INTEGER :: test_shared + INTEGER(HSIZE_T), DIMENSION(1) :: adims2 = (/1/) ! Attribute dimension + INTEGER :: arank = 1 ! Attribure rank + + ! Initialize "big" attribute data + + ! Create dataspace for dataset + CALL h5screate_f(H5S_SCALAR_F, sid, error) + CALL check("h5screate_f",error,total_error) + + ! Create "big" dataspace for "large" attributes + + CALL h5screate_simple_f(arank, adims2, big_sid, error) + CALL check("h5screate_simple_f",error,total_error) + + ! Loop over type of shared components + DO test_shared = 0, 2 + ! Make copy of file creation property list + CALL H5Pcopy_f(fcpl, my_fcpl, error) + CALL check("H5Pcopy",error,total_error) + + ! Set up datatype for attributes + + CALL H5Tcopy_f(H5T_NATIVE_INTEGER, attr_tid, error) + CALL check("H5Tcopy",error,total_error) + + ! Special setup for each type of shared components + + IF( test_shared .EQ. 0) THEN + ! Make attributes > 500 bytes shared + CALL H5Pset_shared_mesg_nindexes_f(my_fcpl,1,error) + CALL check("H5Pset_shared_mesg_nindexes_f",error, total_error) + CALL H5Pset_shared_mesg_index_f(my_fcpl, 0, H5O_SHMESG_ATTR_FLAG_F, 500,error) + CALL check(" H5Pset_shared_mesg_index_f",error, total_error) + + ELSE + ! Set up copy of file creation property list + CALL H5Pset_shared_mesg_nindexes_f(my_fcpl,3,error) + + ! Make attributes > 500 bytes shared + CALL H5Pset_shared_mesg_index_f(my_fcpl, 0, H5O_SHMESG_ATTR_FLAG_F, 500,error) + ! Make datatypes & dataspaces > 1 byte shared (i.e. all of them :-) + CALL H5Pset_shared_mesg_index_f(my_fcpl, 1, H5O_SHMESG_DTYPE_FLAG_F, 1,error) + CALL H5Pset_shared_mesg_index_f(my_fcpl, 2, H5O_SHMESG_SDSPACE_FLAG_F, 1,error) + ENDIF + + ! Create file + CALL h5fcreate_f(FileName, H5F_ACC_TRUNC_F, fid, error, my_fcpl, fapl) + CALL check("h5fcreate_f",error,total_error) + + ! Close FCPL copy + CALL h5pclose_f(my_fcpl, error) + CALL check("h5pclose_f", error, total_error) + ! Close file + CALL h5fclose_f(fid, error) + CALL check("h5fclose_f",error,total_error) + + ! Re-open file + CALL h5fopen_f(FileName, H5F_ACC_RDWR_F, fid, error,fapl) + CALL check("h5open_f",error,total_error) + + ! Commit datatype to file + IF(test_shared.EQ.2) THEN + CALL H5Tcommit_f(fid, TYPE1_NAME, attr_tid, error, H5P_DEFAULT_F, H5P_DEFAULT_F, H5P_DEFAULT_F) + CALL check("H5Tcommit",error,total_error) + ENDIF + + ! Set up to query the object creation properties + CALL H5Pcreate_f(H5P_DATASET_CREATE_F,dcpl,error) + CALL check("h5Pcreate_f",error,total_error) + + ! Create datasets + CALL h5dcreate_f(fid, DSET1_NAME, H5T_NATIVE_CHARACTER, sid, dataset, error, dcpl_id=dcpl ) + CALL check("h5dcreate_f",error,total_error) + CALL h5dcreate_f(fid, DSET2_NAME, H5T_NATIVE_CHARACTER, sid, dataset2, error, dcpl_id=dcpl ) + CALL check("h5dcreate_f",error,total_error) + + ! Retrieve limits for compact/dense attribute storage + CALL H5Pget_attr_phase_change_f(dcpl, max_compact, min_dense, error) + CALL check("H5Pget_attr_phase_change_f",error,total_error) + + ! Close property list + CALL h5pclose_f(dcpl,error) + CALL check("h5pclose_f", error, total_error) + + ! Add attributes to each dataset, until after converting to dense storage + DO u = 0, (max_compact * 2) - 1 + + ! Create attribute name + WRITE(chr2,'(I2.2)') u + attrname = 'attr '//chr2 + + ! Alternate between creating "small" & "big" attributes + + IF(MOD(u+1,2).EQ.0)THEN + ! Create "small" attribute on first dataset + + CALL h5acreate_f(dataset, attrname, attr_tid, sid, attr, error, H5P_DEFAULT_F, H5P_DEFAULT_F) + CALL check("h5acreate_f",error,total_error) + + ! Write data into the attribute + attr_integer_data(1) = u + 1 + data_dims(1) = 1 + CALL h5awrite_f(attr, attr_tid, attr_integer_data, data_dims, error) + CALL check("h5awrite_f",error,total_error) + ELSE + ! Create "big" attribute on first dataset + + CALL h5acreate_f(dataset, attrname, attr_tid, big_sid, attr, error, H5P_DEFAULT_F, H5P_DEFAULT_F) + CALL check("h5acreate_f",error,total_error) + + ! Write data into the attribute + + data_dims(1) = 1 + attr_integer_data(1) = u + 1 + CALL h5awrite_f(attr, attr_tid, attr_integer_data, data_dims, error) + CALL check("h5awrite_f",error,total_error) + + ENDIF + + ! Close attribute + CALL h5aclose_f(attr, error) + CALL check("h5aclose_f",error,total_error) + + ! Alternate between creating "small" & "big" attributes + IF(MOD(u+1,2).EQ.0)THEN + + ! Create "small" attribute on second dataset + + CALL h5acreate_f(dataset2, attrname, attr_tid, sid, attr, error, H5P_DEFAULT_F, H5P_DEFAULT_F) + CALL check("h5acreate_f",error,total_error) + + ! Write data into the attribute + + attr_integer_data(1) = u + 1 + data_dims(1) = 1 + CALL h5awrite_f(attr, attr_tid, attr_integer_data, data_dims, error) + CALL check("h5awrite_f",error,total_error) + ELSE + + ! Create "big" attribute on second dataset + + CALL h5acreate_f(dataset2, attrname, attr_tid, big_sid, attr, error, H5P_DEFAULT_F, H5P_DEFAULT_F) + CALL check("h5acreate_f",error,total_error) + +! Write data into the attribute + + + attr_integer_data(1) = u + 1 + data_dims(1) = 1 +! CALL h5awrite_f(attr, attr_tid, attr_integer_data, data_dims, error) +! CALL check("h5awrite_f",error,total_error) + + +! Check refcount for attribute + ENDIF + ! Close attribute + CALL h5aclose_f(attr, error) + CALL check("h5aclose_f",error,total_error) + + ! Create new attribute name + + WRITE(chr2,'(I2.2)') u + attrname2 = 'new attr '//chr2 + + + ! Change second dataset's attribute's name + + CALL H5Arename_by_name_f(fid, DSET2_NAME, attrname, attrname2, error, lapl_id=H5P_DEFAULT_F) + CALL check("H5Arename_by_name_f",error,total_error) + + ! Check refcount on attributes now + + ! Check refcount on renamed attribute + + CALL H5Aopen_f(dataset2, attrname2, attr, error, aapl_id=H5P_DEFAULT_F) + CALL check("H5Aopen_f",error,total_error) + + ! Close attribute + CALL h5aclose_f(attr, error) + CALL check("h5aclose_f",error,total_error) + + ! Check refcount on original attribute + CALL H5Aopen_f(dataset, attrname, attr, error) + CALL check("H5Aopen",error,total_error) + + ! Close attribute + CALL h5aclose_f(attr, error) + CALL check("h5aclose_f",error,total_error) + + + ! Change second dataset's attribute's name back to original + + CALL H5Arename_by_name_f(fid, DSET2_NAME, attrname2, attrname, error) + CALL check("H5Arename_by_name_f",error,total_error) + + ! Check refcount on attributes now + + ! Check refcount on renamed attribute + CALL H5Aopen_f(dataset2, attrname, attr, error) + CALL check("H5Aopen",error,total_error) + + ! Close attribute + CALL h5aclose_f(attr, error) + CALL check("h5aclose_f",error,total_error) + + ! Check refcount on original attribute + + ! Check refcount on renamed attribute + CALL H5Aopen_f(dataset, attrname, attr, error) + CALL check("H5Aopen",error,total_error) + + ! Close attribute + CALL h5aclose_f(attr, error) + CALL check("h5aclose_f",error,total_error) + + ENDDO + + ! Close attribute's datatype + CALL h5tclose_f(attr_tid, error) + CALL check("h5tclose_f",error,total_error) + + ! Close attribute's datatype + CALL h5dclose_f(dataset, error) + CALL check("h5dclose_f",error,total_error) + CALL h5dclose_f(dataset2, error) + CALL check("h5dclose_f",error,total_error) + + + ! Unlink datasets with attributes + CALL H5Ldelete_f(fid, DSET1_NAME, error, H5P_DEFAULT_F) + CALL check("HLdelete",error,total_error) + CALL H5Ldelete_f(fid, DSET2_NAME, error) + CALL check("HLdelete",error,total_error) + + ! Unlink committed datatype + IF(test_shared == 2)THEN + CALL H5Ldelete_f(fid, TYPE1_NAME, error) + CALL check("HLdelete_f",error,total_error) + ENDIF + + ! Close file + CALL h5fclose_f(fid, error) + CALL check("h5fclose_f",error,total_error) + + ! Check size of file + !filesize = h5_get_file_size(FILENAME); + !verify(filesize, empty_filesize, "h5_get_file_size"); + ENDDO + + ! Close dataspaces + CALL h5sclose_f(sid, error) + CALL check("h5sclose_f",error,total_error) + CALL h5sclose_f(big_sid, error) + CALL check("h5sclose_f",error,total_error) + +END SUBROUTINE test_attr_shared_rename + + +SUBROUTINE test_attr_delete_by_idx(new_format, fcpl, fapl, total_error) + +!*************************************************************** +!** +!** test_attr_delete_by_idx(): Test basic H5A (attribute) code. +!** Tests deleting attribute by index +!** +!*************************************************************** + + IMPLICIT NONE + + LOGICAL, INTENT(IN) :: new_format + INTEGER(HID_T), INTENT(IN) :: fcpl + INTEGER(HID_T), INTENT(IN) :: fapl + INTEGER, INTENT(INOUT) :: total_error + CHARACTER(LEN=8) :: FileName = "tattr.h5" + INTEGER(HID_T) :: fid ! HDF5 File ID + INTEGER(HID_T) :: dcpl ! Dataset creation property list ID + INTEGER(HID_T) :: sid ! Dataspace ID + + CHARACTER(LEN=8) :: DSET1_NAME = "Dataset1" + CHARACTER(LEN=8) :: DSET2_NAME = "Dataset2" + CHARACTER(LEN=8) :: DSET3_NAME = "Dataset3" + INTEGER, PARAMETER :: NUM_DSETS = 3 + + INTEGER :: curr_dset + + INTEGER(HID_T) :: dset1, dset2, dset3 + INTEGER(HID_T) :: my_dataset + + INTEGER :: error + + INTEGER(HID_T) :: attr !String Attribute identifier + INTEGER(HSIZE_T), DIMENSION(7) :: data_dims + + LOGICAL :: f_corder_valid ! Indicates whether the the creation order data is valid for this attribute + INTEGER :: corder ! Is a positive integer containing the creation order of the attribute + INTEGER :: cset ! Indicates the character set used for the attribute’s name + INTEGER(HSIZE_T) :: data_size ! indicates the size, in the number of characters + LOGICAL, DIMENSION(1:2) :: use_index = (/.FALSE.,.TRUE./) + + INTEGER :: max_compact ! Maximum # of links to store in group compactly + INTEGER :: min_dense ! Minimum # of links to store in group "densely" + + CHARACTER(LEN=2) :: chr2 + + INTEGER :: i + + INTEGER, DIMENSION(1) :: attr_integer_data + CHARACTER(LEN=7) :: attrname + + INTEGER(SIZE_T) :: size + CHARACTER(LEN=8) :: tmpname + + INTEGER :: idx_type + INTEGER :: order + INTEGER :: u ! Local index variable + INTEGER :: Input1 + INTEGER(HSIZE_T) :: hzero = 0_HSIZE_T + INTEGER :: minusone = -1 + + data_dims = 0 + + ! Create dataspace for dataset & attributes + CALL h5screate_f(H5S_SCALAR_F, sid, error) + CALL check("h5screate_f",error,total_error) + + ! Create dataset creation property list + CALL H5Pcreate_f(H5P_DATASET_CREATE_F,dcpl,error) + CALL check("h5Pcreate_f",error,total_error) + + ! Query the attribute creation properties + CALL H5Pget_attr_phase_change_f(dcpl, max_compact, min_dense, error) + CALL check("H5Pget_attr_phase_change_f",error,total_error) + + + ! Loop over operating on different indices on link fields + DO idx_type = H5_INDEX_NAME_F, H5_INDEX_CRT_ORDER_F + + ! Loop over operating in different orders + DO order = H5_ITER_INC_F, H5_ITER_DEC_F + + ! Loop over using index for creation order value + DO i = 1, 2 + + ! Create file + CALL h5fcreate_f(FileName, H5F_ACC_TRUNC_F, fid, error, fcpl, fapl) + CALL check("h5fcreate_f",error,total_error) + + ! Set attribute creation order tracking & indexing for object + IF(new_format)THEN + + IF(use_index(i))THEN + Input1 = H5P_CRT_ORDER_INDEXED_F + ELSE + Input1 = 0 + ENDIF + + CALL H5Pset_attr_creation_order_f(dcpl, IOR(H5P_CRT_ORDER_TRACKED_F, Input1), error) + CALL check("H5Pset_attr_creation_order",error,total_error) + + ENDIF + + ! Create datasets + + CALL h5dcreate_f(fid, DSET1_NAME, H5T_NATIVE_CHARACTER, sid, dset1, error, dcpl ) + CALL check("h5dcreate_f2",error,total_error) + + CALL h5dcreate_f(fid, DSET2_NAME, H5T_NATIVE_CHARACTER, sid, dset2, error, dcpl ) + CALL check("h5dcreate_f3",error,total_error) + + CALL h5dcreate_f(fid, DSET3_NAME, H5T_NATIVE_CHARACTER, sid, dset3, error, dcpl ) + CALL check("h5dcreate_f4",error,total_error) + + ! Work on all the datasets + + DO curr_dset = 0,NUM_DSETS-1 + SELECT CASE (curr_dset) + CASE (0) + my_dataset = dset1 + CASE (1) + my_dataset = dset2 + CASE (2) + my_dataset = dset3 + ! CASE DEFAULT + ! CALL HDassert(0.AND."Toomanydatasets!") + END SELECT + + + ! Check for deleting non-existant attribute +!EP CALL H5Adelete_by_idx_f(my_dataset, '.', idx_type, order, 0_HSIZE_T,error, lapl_id=H5P_DEFAULT_F) + CALL H5Adelete_by_idx_f(my_dataset, '.', idx_type, order, hzero,error, lapl_id=H5P_DEFAULT_F) + CALL verify("H5Adelete_by_idx_f",error,minusone,total_error) + + ! Create attributes, up to limit of compact form + DO u = 0, max_compact - 1 + ! Create attribute + WRITE(chr2,'(I2.2)') u + attrname = 'attr '//chr2 + + CALL h5acreate_f(my_dataset, attrname, H5T_NATIVE_INTEGER, sid, attr, error, H5P_DEFAULT_F, H5P_DEFAULT_F) + CALL check("h5acreate_f",error,total_error) + + ! Write data into the attribute + attr_integer_data(1) = u + data_dims(1) = 1 + CALL h5awrite_f(attr, H5T_NATIVE_INTEGER, attr_integer_data, data_dims, error) + CALL check("h5awrite_f",error,total_error) + + ! Close attribute + CALL h5aclose_f(attr, error) + CALL check("h5aclose_f",error,total_error) + + ! Verify information for new attribute + CALL attr_info_by_idx_check(my_dataset, attrname, INT(u,HSIZE_T), use_index(i), total_error ) + + ENDDO + + ! Check for out of bound deletions + CALL H5Adelete_by_idx_f(my_dataset, ".", idx_type, order, INT(u,HSIZE_T), error, lapl_id=H5P_DEFAULT_F) + CALL verify("H5Adelete_by_idx_f",error,minusone,total_error) + + ENDDO + + + DO curr_dset = 0, NUM_DSETS-1 + SELECT CASE (curr_dset) + CASE (0) + my_dataset = dset1 + CASE (1) + my_dataset = dset2 + CASE (2) + my_dataset = dset3 + ! CASE DEFAULT + ! CALL HDassert(0.AND."Toomanydatasets!") + END SELECT + + ! Delete attributes from compact storage + + DO u = 0, max_compact - 2 + + ! Delete first attribute in appropriate order + + +!EP CALL H5Adelete_by_idx_f(my_dataset, ".", idx_type, order, 0_HSIZE_T, error) + CALL H5Adelete_by_idx_f(my_dataset, ".", idx_type, order, hzero, error) + CALL check("H5Adelete_by_idx_f",error,total_error) + + + ! Verify the attribute information for first attribute in appropriate order + ! HDmemset(&ainfo, 0, sizeof(ainfo)); + +!EP CALL h5aget_info_by_idx_f(my_dataset, ".", idx_type, order, 0_HSIZE_T, & + CALL h5aget_info_by_idx_f(my_dataset, ".", idx_type, order, hzero, & + f_corder_valid, corder, cset, data_size, error) + + IF(new_format)THEN + IF(order.EQ.H5_ITER_INC_F)THEN + CALL verify("H5Aget_info_by_idx_f",corder,u + 1,total_error) + ENDIF + ELSE + CALL verify("H5Aget_info_by_idx_f",corder, max_compact-(u + 2),total_error) + ENDIF + + ! Verify the name for first attribute in appropriate order + + size = 7 ! *CHECK* IF NOT THE SAME SIZE + CALL h5aget_name_by_idx_f(my_dataset, ".", idx_type, order,INT(0,hsize_t), & + tmpname, error, lapl_id=H5P_DEFAULT_F, size=size) + CALL check('h5aget_name_by_idx_f',error,total_error) + IF(order .EQ. H5_ITER_INC_F)THEN + WRITE(chr2,'(I2.2)') u + 1 + attrname = 'attr '//chr2 + ELSE + WRITE(chr2,'(I2.2)') max_compact - (u + 2) + attrname = 'attr '//chr2 + ENDIF + IF(TRIM(attrname).NE.TRIM(tmpname)) error = -1 + CALL verify("h5aget_name_by_idx_f",error,0,total_error) + ENDDO + + ! Delete last attribute + +!EP CALL H5Adelete_by_idx_f(my_dataset, ".", idx_type, order, 0_HSIZE_T, error) + CALL H5Adelete_by_idx_f(my_dataset, ".", idx_type, order, hzero, error) + CALL check("H5Adelete_by_idx_f",error,total_error) + + ENDDO + +! Work on all the datasets + + DO curr_dset = 0,NUM_DSETS-1 + SELECT CASE (curr_dset) + CASE (0) + my_dataset = dset1 + CASE (1) + my_dataset = dset2 + CASE (2) + my_dataset = dset3 + ! CASE DEFAULT + ! CALL HDassert(0.AND."Toomanydatasets!") + END SELECT + + ! Create more attributes, to push into dense form + + DO u = 0, (max_compact * 2) - 1 + + ! Create attribute + WRITE(chr2,'(I2.2)') u + attrname = 'attr '//chr2 + + CALL h5acreate_f(my_dataset, attrname, H5T_NATIVE_INTEGER, sid, attr, error, H5P_DEFAULT_F, H5P_DEFAULT_F) + CALL check("h5acreate_f",error,total_error) + + + ! Write data into the attribute + attr_integer_data(1) = u + data_dims(1) = 1 + CALL h5awrite_f(attr, H5T_NATIVE_INTEGER, attr_integer_data, data_dims, error) + CALL check("h5awrite_f",error,total_error) + + ! Close attribute + CALL h5aclose_f(attr, error) + CALL check("h5aclose_f",error,total_error) + + + ENDDO + ! Check for out of bound deletion + CALL H5Adelete_by_idx_f(my_dataset, ".", idx_type, order, INT(u,HSIZE_T), error) + CALL verify("H5Adelete_by_idx_f",error,minusone,total_error) + ENDDO + + ! Work on all the datasets + + DO curr_dset = 0,NUM_DSETS-1 + SELECT CASE (curr_dset) + CASE (0) + my_dataset = dset1 + CASE (1) + my_dataset = dset2 + CASE (2) + my_dataset = dset3 + END SELECT + + ! Delete attributes from dense storage + + DO u = 0, (max_compact * 2) - 1 - 1 + + ! Delete first attribute in appropriate order + + CALL H5Adelete_by_idx_f(my_dataset, ".", idx_type, order, INT(0,HSIZE_T), error) + CALL check("H5Adelete_by_idx_f",error,total_error) + ! Verify the attribute information for first attribute in appropriate order + + CALL h5aget_info_by_idx_f(my_dataset, ".", idx_type, order, INT(0,HSIZE_T), & + f_corder_valid, corder, cset, data_size, error) + IF(new_format)THEN + IF(order.EQ.H5_ITER_INC_F)THEN + CALL verify("H5Aget_info_by_idx_f",corder,u + 1,total_error) + ENDIF + ELSE + CALL verify("H5Aget_info_by_idx_f",corder, ((max_compact * 2) - (u + 2)), total_error) + ENDIF + + ! Verify the name for first attribute in appropriate order + ! HDmemset(tmpname, 0, (size_t)NAME_BUF_SIZE); + + size = 7 ! *CHECK* if not the correct size + CALL h5aget_name_by_idx_f(my_dataset, ".", idx_type, order,INT(0,hsize_t), & + tmpname, error, size) + + IF(order .EQ. H5_ITER_INC_F)THEN + WRITE(chr2,'(I2.2)') u + 1 + attrname = 'attr '//chr2 + ELSE + WRITE(chr2,'(I2.2)') max_compact * 2 - (u + 2) + attrname = 'attr '//chr2 + ENDIF + IF(TRIM(attrname).NE.TRIM(tmpname)) error = -1 + CALL verify("h5aget_name_by_idx_f",error,0,total_error) + + + ENDDO + ! Delete last attribute + + CALL H5Adelete_by_idx_f(my_dataset, ".", idx_type, order, INT(0,HSIZE_T), error, lapl_id=H5P_DEFAULT_F) + CALL check("H5Adelete_by_idx_f",error,total_error) + + ! Check for deletion on empty attribute storage again + CALL H5Adelete_by_idx_f(my_dataset, ".", idx_type, order, INT(0,HSIZE_T), error) + CALL verify("H5Adelete_by_idx_f",error,minusone,total_error) + ENDDO + + ! Close Datasets + CALL h5dclose_f(dset1, error) + CALL check("h5dclose_f",error,total_error) + CALL h5dclose_f(dset2, error) + CALL check("h5dclose_f",error,total_error) + CALL h5dclose_f(dset3, error) + CALL check("h5dclose_f",error,total_error) + + ! Close file + CALL h5fclose_f(fid, error) + CALL check("h5fclose_f",error,total_error) + ENDDO + ENDDO + ENDDO + + ! Close property list + CALL h5pclose_f(dcpl,error) + CALL check("h5pclose_f", error, total_error) + + ! Close dataspace + CALL h5sclose_f(sid, error) + CALL check("h5sclose_f",error,total_error) + +END SUBROUTINE test_attr_delete_by_idx + +SUBROUTINE test_attr_shared_delete(fcpl, fapl, total_error) + +!*************************************************************** +!** +!** test_attr_shared_delete(): Test basic H5A (attribute) code. +!** Tests deleting shared attributes in "compact" & "dense" storage +!** +!*************************************************************** + + IMPLICIT NONE + + INTEGER(HID_T), INTENT(IN) :: fcpl + INTEGER(HID_T), INTENT(IN) :: fapl + INTEGER, INTENT(INOUT) :: total_error + CHARACTER(LEN=8) :: FileName = "tattr.h5" + INTEGER(HID_T) :: fid + INTEGER(HID_T) :: dcpl + INTEGER(HID_T) :: sid, big_sid + + CHARACTER(LEN=8) :: DSET1_NAME = "Dataset1" + CHARACTER(LEN=8) :: DSET2_NAME = "Dataset2" + + + INTEGER(HID_T) :: dataset, dataset2 + + INTEGER :: error + + INTEGER(HID_T) :: attr !String Attribute identifier + INTEGER(HID_T) :: attr_tid + INTEGER(HSIZE_T), DIMENSION(7) :: data_dims + + + INTEGER :: max_compact ! Maximum # of links to store in group compactly + INTEGER :: min_dense ! Minimum # of links to store in group "densely" + + CHARACTER(LEN=2) :: chr2 + + INTEGER, DIMENSION(1) :: attr_integer_data + CHARACTER(LEN=7) :: attrname + + INTEGER :: u + INTEGER(HID_T) :: my_fcpl + + CHARACTER(LEN=5), PARAMETER :: TYPE1_NAME = "/Type" + + INTEGER :: test_shared + INTEGER(HSIZE_T), DIMENSION(1) :: adims2 = (/1/) ! Attribute dimension + INTEGER :: arank = 1 ! Attribure rank + + ! Output message about test being performed + + ! Initialize "big" attribute DATA + ! Create dataspace for dataset + CALL h5screate_f(H5S_SCALAR_F, sid, error) + CALL check("h5screate_f",error,total_error) + + ! Create "big" dataspace for "large" attributes + + CALL h5screate_simple_f(arank, adims2, big_sid, error) + CALL check("h5screate_simple_f",error,total_error) + + ! Loop over type of shared components + + DO test_shared = 0, 2 + + ! Make copy of file creation property list + + CALL H5Pcopy_f(fcpl, my_fcpl, error) + CALL check("H5Pcopy",error,total_error) + + ! Set up datatype for attributes + + CALL H5Tcopy_f(H5T_NATIVE_INTEGER, attr_tid, error) + CALL check("H5Tcopy",error,total_error) + + ! Special setup for each type of shared components + IF( test_shared .EQ. 0) THEN + ! Make attributes > 500 bytes shared + CALL H5Pset_shared_mesg_nindexes_f(my_fcpl,1,error) + CALL check("H5Pset_shared_mesg_nindexes_f",error, total_error) + CALL H5Pset_shared_mesg_index_f(my_fcpl, 0, H5O_SHMESG_ATTR_FLAG_F, 500,error) + CALL check(" H5Pset_shared_mesg_index_f",error, total_error) + + ELSE + ! Set up copy of file creation property list + CALL H5Pset_shared_mesg_nindexes_f(my_fcpl,3,error) + ! Make attributes > 500 bytes shared + CALL H5Pset_shared_mesg_index_f(my_fcpl, 0, H5O_SHMESG_ATTR_FLAG_F, 500,error) + ! Make datatypes & dataspaces > 1 byte shared (i.e. all of them :-) + CALL H5Pset_shared_mesg_index_f(my_fcpl, 1, H5O_SHMESG_DTYPE_FLAG_F, 1,error) + CALL H5Pset_shared_mesg_index_f(my_fcpl, 2, H5O_SHMESG_SDSPACE_FLAG_F, 1,error) + ENDIF + + ! Create file + CALL h5fcreate_f(FileName, H5F_ACC_TRUNC_F, fid, error, my_fcpl, fapl) + CALL check("h5fcreate_f",error,total_error) + + ! Close FCPL copy + CALL h5pclose_f(my_fcpl, error) + CALL check("h5pclose_f", error, total_error) + ! Close file + CALL h5fclose_f(fid, error) + CALL check("h5fclose_f",error,total_error) + + ! Re-open file + CALL h5fopen_f(FileName, H5F_ACC_RDWR_F, fid, error,fapl) + CALL check("h5open_f",error,total_error) + + ! Commit datatype to file + + IF(test_shared.EQ.2) THEN + CALL H5Tcommit_f(fid, TYPE1_NAME, attr_tid, error, H5P_DEFAULT_F, H5P_DEFAULT_F, H5P_DEFAULT_F) + CALL check("H5Tcommit",error,total_error) + ENDIF + + ! Set up to query the object creation properties + CALL H5Pcreate_f(H5P_DATASET_CREATE_F,dcpl,error) + CALL check("h5Pcreate_f",error,total_error) + + ! Create datasets + + CALL h5dcreate_f(fid, DSET1_NAME, H5T_NATIVE_CHARACTER, sid, dataset, error, dcpl_id=dcpl ) + CALL check("h5dcreate_f",error,total_error) + + CALL h5dcreate_f(fid, DSET2_NAME, H5T_NATIVE_CHARACTER, sid, dataset2, error, dcpl_id=dcpl ) + CALL check("h5dcreate_f",error,total_error) + + ! Retrieve limits for compact/dense attribute storage + CALL H5Pget_attr_phase_change_f(dcpl, max_compact, min_dense, error) + CALL check("H5Pget_attr_phase_change_f",error,total_error) + + ! Close property list + CALL h5pclose_f(dcpl,error) + CALL check("h5pclose_f", error, total_error) + + ! Add attributes to each dataset, until after converting to dense storage + + DO u = 0, (max_compact * 2) - 1 + + ! Create attribute name + WRITE(chr2,'(I2.2)') u + attrname = 'attr '//chr2 + + ! Alternate between creating "small" & "big" attributes + + IF(MOD(u+1,2).EQ.0)THEN + ! Create "small" attribute on first dataset + + CALL h5acreate_f(dataset, attrname, attr_tid, sid, attr, error, H5P_DEFAULT_F, H5P_DEFAULT_F) + CALL check("h5acreate_f",error,total_error) + + ! Write data into the attribute + attr_integer_data(1) = u + 1 + data_dims(1) = 1 + CALL h5awrite_f(attr, attr_tid, attr_integer_data, data_dims, error) + CALL check("h5awrite_f",error,total_error) + ELSE + ! Create "big" attribute on first dataset + + CALL h5acreate_f(dataset, attrname, attr_tid, big_sid, attr, error) + CALL check("h5acreate_f",error,total_error) + + ! Write data into the attribute + + attr_integer_data(1) = u + 1 + data_dims(1) = 1 + CALL h5awrite_f(attr, attr_tid, attr_integer_data, data_dims, error) + CALL check("h5awrite_f",error,total_error) + + ENDIF + + ! Close attribute + CALL h5aclose_f(attr, error) + CALL check("h5aclose_f",error,total_error) + + ! Alternate between creating "small" & "big" attributes + IF(MOD(u+1,2).EQ.0)THEN + + ! Create "small" attribute on second dataset + + CALL h5acreate_f(dataset2, attrname, attr_tid, sid, attr, error) + CALL check("h5acreate_f",error,total_error) + + ! Write data into the attribute + attr_integer_data(1) = u + 1 + data_dims(1) = 1 + CALL h5awrite_f(attr, attr_tid, attr_integer_data, data_dims, error) + CALL check("h5awrite_f",error,total_error) + ELSE + + ! Create "big" attribute on second dataset + + CALL h5acreate_f(dataset2, attrname, attr_tid, big_sid, attr, error, acpl_id=H5P_DEFAULT_F, aapl_id=H5P_DEFAULT_F) + CALL check("h5acreate_f",error,total_error) + +! Write data into the attribute + + + attr_integer_data(1) = u + 1 + data_dims(1) = 1 + CALL h5awrite_f(attr, attr_tid, attr_integer_data, data_dims, error) + CALL check("h5awrite_f",error,total_error) + + ENDIF + ! Close attribute + CALL h5aclose_f(attr, error) + CALL check("h5aclose_f",error,total_error) + + ENDDO + + ! Delete attributes from second dataset + + DO u = 0, max_compact*2-1 + + ! Create attribute name + WRITE(chr2,'(I2.2)') u + attrname = 'attr '//chr2 + + ! Delete second dataset's attribute + CALL H5Adelete_by_name_f(fid, DSET2_NAME, attrname,error,lapl_id=H5P_DEFAULT_F) + CALL check("H5Adelete_by_name", error, total_error) + + CALL h5aopen_f(dataset, attrname, attr, error, aapl_id=H5P_DEFAULT_F) + CALL check("h5aopen_f",error,total_error) + + + ! Close attribute + CALL h5aclose_f(attr, error) + CALL check("h5aclose_f",error,total_error) + ENDDO + + ! Close attribute's datatype + + CALL h5tclose_f(attr_tid, error) + CALL check("h5tclose_f",error,total_error) + + ! Close Datasets + + CALL h5dclose_f(dataset, error) + CALL check("h5dclose_f",error,total_error) + CALL h5dclose_f(dataset2, error) + CALL check("h5dclose_f",error,total_error) + + ! Unlink datasets WITH attributes + + CALL h5ldelete_f(fid, DSET1_NAME, error, H5P_DEFAULT_F) + CALL check("H5Ldelete_f", error, total_error) + CALL h5ldelete_f(fid, DSET2_NAME, error) + CALL check("H5Ldelete_f", error, total_error) + + ! Unlink committed datatype + + IF( test_shared == 2) THEN + CALL h5ldelete_f(fid, TYPE1_NAME, error) + CALL check("H5Ldelete_f", error, total_error) + ENDIF + + + ! Close file + CALL h5fclose_f(fid, error) + CALL check("h5fclose_f",error,total_error) + + ENDDO + + ! Close dataspaces + CALL h5sclose_f(sid, error) + CALL check("h5sclose_f",error,total_error) + CALL h5sclose_f(big_sid, error) + CALL check("h5sclose_f",error,total_error) + +END SUBROUTINE test_attr_shared_delete + + + +SUBROUTINE test_attr_dense_open( fcpl, fapl, total_error) + +!*************************************************************** +!** +!** test_attr_dense_open(): Test basic H5A (attribute) code. +!** Tests opening attributes in "dense" storage +!** +!*************************************************************** + + IMPLICIT NONE + + INTEGER(HID_T), INTENT(IN) :: fcpl + INTEGER(HID_T), INTENT(IN) :: fapl + INTEGER, INTENT(INOUT) :: total_error + CHARACTER(LEN=8) :: FileName = "tattr.h5" + INTEGER(HID_T) :: fid + INTEGER(HID_T) :: dcpl + INTEGER(HID_T) :: sid + + CHARACTER(LEN=8) :: DSET1_NAME = "Dataset1" + + INTEGER :: error + INTEGER(HID_T) :: attr !String Attribute identifier + INTEGER(HSIZE_T), DIMENSION(7) :: data_dims + + + INTEGER :: max_compact ! Maximum # of links to store in group compactly + INTEGER :: min_dense ! Minimum # of links to store in group "densely" + + CHARACTER(LEN=2) :: chr2 + + + CHARACTER(LEN=7) :: attrname + + INTEGER(HID_T) :: dataset + INTEGER :: u + + data_dims = 0 + + + ! Create file + + CALL h5fcreate_f(FileName, H5F_ACC_TRUNC_F, fid, error, fcpl, fapl) + CALL check("h5fcreate_f",error,total_error) + + ! Close file + CALL h5fclose_f(fid, error) + CALL check("h5fclose_f",error,total_error) + + + + ! Re-open file + CALL h5fopen_f(FileName, H5F_ACC_RDWR_F, fid, error, fapl) + CALL check("h5open_f",error,total_error) + + ! Create dataspace for dataset + CALL h5screate_f(H5S_SCALAR_F, sid, error) + CALL check("h5screate_f",error,total_error) + + ! Query the group creation properties + CALL H5Pcreate_f(H5P_DATASET_CREATE_F,dcpl,error) + CALL check("h5Pcreate_f",error,total_error) + + ! Enable creation order tracking on attributes, so creation order tests work + CALL H5Pset_attr_creation_order_f(dcpl, H5P_CRT_ORDER_TRACKED_F, error) + CALL check("H5Pset_attr_creation_order",error,total_error) + + ! Create a dataset + + CALL h5dcreate_f(fid, DSET1_NAME, H5T_NATIVE_CHARACTER, sid, dataset, error, & + lcpl_id=H5P_DEFAULT_F, dcpl_id=dcpl, dapl_id=H5P_DEFAULT_F) + CALL check("h5dcreate_f",error,total_error) + + ! Retrieve limits for compact/dense attribute storage + CALL H5Pget_attr_phase_change_f(dcpl, max_compact, min_dense, error) + CALL check("H5Pget_attr_phase_change_f",error,total_error) + + ! Close property list + CALL h5pclose_f(dcpl, error) + CALL check("h5pclose_f",error,total_error) + + ! Add attributes, until just before converting to dense storage + + DO u = 0, max_compact - 1 + ! Create attribute + WRITE(chr2,'(I2.2)') u + attrname = 'attr '//chr2 + + CALL h5acreate_f(dataset, attrname, H5T_NATIVE_INTEGER, sid, attr, error, aapl_id=H5P_DEFAULT_F) + CALL check("h5acreate_f",error,total_error) + + ! Write data into the attribute + + data_dims(1) = 1 + CALL h5awrite_f(attr, H5T_NATIVE_INTEGER, u, data_dims, error) + CALL check("h5awrite_f",error,total_error) + + ! Close attribute + CALL h5aclose_f(attr, error) + CALL check("h5aclose_f",error,total_error) + + ! Verify attributes written so far + CALL test_attr_dense_verify(dataset, u, total_error) + ENDDO +! +! Add one more attribute, to push into "dense" storage +! Create attribute + + WRITE(chr2,'(I2.2)') u + attrname = 'attr '//chr2 + + CALL h5acreate_f(dataset, attrname, H5T_NATIVE_INTEGER, sid, attr, error, aapl_id=H5P_DEFAULT_F) + CALL check("h5acreate_f",error,total_error) + + ! Write data into the attribute + data_dims(1) = 1 + CALL h5awrite_f(attr, H5T_NATIVE_INTEGER, u, data_dims, error) + CALL check("h5awrite_f",error,total_error) + + ! Close attribute + CALL h5aclose_f(attr, error) + CALL check("h5aclose_f",error,total_error) + + ! Close dataspace + CALL h5sclose_f(sid, error) + CALL check("h5sclose_f",error,total_error) + + ! Verify all the attributes written + ! ret = test_attr_dense_verify(dataset, (u + 1)); + ! CHECK(ret, FAIL, "test_attr_dense_verify"); + + ! CLOSE Dataset + CALL h5dclose_f(dataset, error) + CALL check("h5dclose_f",error,total_error) + + ! Unlink dataset with attributes + CALL h5ldelete_f(fid, DSET1_NAME, error, H5P_DEFAULT_F) + CALL check("H5Ldelete_f", error, total_error) + + ! Close file + CALL h5fclose_f(fid, error) + CALL check("h5fclose_f",error,total_error) + + ! Check size of file + ! filesize = h5_get_file_size(FILENAME); + ! verify(filesize, empty_filesize, "h5_get_file_size") + +END SUBROUTINE test_attr_dense_open + +!*************************************************************** +!** +!** test_attr_dense_verify(): Test basic H5A (attribute) code. +!** Verify attributes on object +!** +!*************************************************************** + +SUBROUTINE test_attr_dense_verify(loc_id, max_attr, total_error) + + IMPLICIT NONE + + INTEGER(HID_T), INTENT(IN) :: loc_id + INTEGER, INTENT(IN) :: max_attr + INTEGER, INTENT(INOUT) :: total_error + + INTEGER(SIZE_T), PARAMETER :: ATTR_NAME_LEN = 8 ! FIX, why if 7 does not work? + + INTEGER :: u + CHARACTER(LEN=2) :: chr2 + CHARACTER(LEN=ATTR_NAME_LEN) :: attrname + CHARACTER(LEN=ATTR_NAME_LEN) :: check_name + INTEGER(HSIZE_T), DIMENSION(7) :: data_dims + + INTEGER(HID_T) :: attr !String Attribute identifier + INTEGER :: error + INTEGER :: value + + data_dims = 0 + + + ! Retrieve the current # of reported errors + ! old_nerrs = GetTestNumErrs(); + + ! Re-open all the attributes by name and verify the data + + DO u = 0, max_attr -1 + + ! Open attribute + WRITE(chr2,'(I2.2)') u + attrname = 'attr '//chr2 + + CALL h5aopen_f(loc_id, attrname, attr, error) + CALL check("h5aopen_f",error,total_error) + + ! Read data from the attribute + +! value = 103 + data_dims(1) = 1 + CALL h5aread_f(attr, H5T_NATIVE_INTEGER, value, data_dims, error) + + CALL CHECK("H5Aread_F", error, total_error) + CALL verify("H5Aread_F", value, u, total_error) + + ! Close attribute + CALL h5aclose_f(attr, error) + CALL check("h5aclose_f",error,total_error) + ENDDO + + ! Re-open all the attributes by index and verify the data + + DO u=0, max_attr-1 + + + ! Open attribute + + CALL H5Aopen_by_idx_f(loc_id, ".", H5_INDEX_CRT_ORDER_F, H5_ITER_INC_F, INT(u,HSIZE_T), & + attr, error, aapl_id=H5P_DEFAULT_F) + + ! Verify Name + + WRITE(chr2,'(I2.2)') u + attrname = 'attr '//chr2 + + CALL H5Aget_name_f(attr, ATTR_NAME_LEN, check_name, error) + CALL check('H5Aget_name',error,total_error) + IF(check_name.NE.attrname) THEN + WRITE(*,*) 'ERROR: attribute name different: attr_name = ',check_name, ', should be ', attrname + total_error = total_error + 1 + ENDIF + ! Read data from the attribute + data_dims(1) = 1 + CALL h5aread_f(attr, H5T_NATIVE_INTEGER, value, data_dims, error) + CALL CHECK("H5Aread_f", error, total_error) + CALL verify("H5Aread_f", value, u, total_error) + + + ! Close attribute + CALL h5aclose_f(attr, error) + CALL check("h5aclose_f",error,total_error) + ENDDO + +END SUBROUTINE test_attr_dense_verify + +!*************************************************************** +!** +!** test_attr_corder_create_empty(): Test basic H5A (attribute) code. +!** Tests basic code to create objects with attribute creation order info +!** +!*************************************************************** + +SUBROUTINE test_attr_corder_create_basic( fcpl, fapl, total_error ) + + IMPLICIT NONE + + INTEGER(HID_T), INTENT(IN) :: fcpl + INTEGER(HID_T), INTENT(IN) :: fapl + INTEGER, INTENT(INOUT) :: total_error + CHARACTER(LEN=8) :: FileName = "tattr.h5" + INTEGER(HID_T) :: fid + INTEGER(HID_T) :: dcpl + INTEGER(HID_T) :: sid + + CHARACTER(LEN=8) :: DSET1_NAME = "Dataset1" + + INTEGER(HID_T) :: dataset + + INTEGER :: error + + INTEGER :: crt_order_flags + INTEGER :: minusone = -1 + + ! Output message about test being performed +! WRITE(*,*) " - Testing Basic Code for Attributes with Creation Order Info" + + ! Create file + CALL h5fcreate_f(FileName, H5F_ACC_TRUNC_F, fid, error, fcpl, fapl) + CALL check("h5fcreate_f",error,total_error) + + ! Create dataset creation property list + CALL H5Pcreate_f(H5P_DATASET_CREATE_F,dcpl,error) + CALL check("h5Pcreate_f",error,total_error) + + ! Get creation order indexing on object + CALL H5Pget_attr_creation_order_f(dcpl, crt_order_flags, error) + CALL check("H5Pget_attr_creation_order_f",error,total_error) + CALL verify("H5Pget_attr_creation_order_f",crt_order_flags , 0, total_error) + + ! Setting invalid combination of a attribute order creation order indexing on should fail + CALL H5Pset_attr_creation_order_f(dcpl, H5P_CRT_ORDER_INDEXED_F, error) + CALL verify("H5Pset_attr_creation_order_f",error , minusone, total_error) + CALL H5Pget_attr_creation_order_f(dcpl, crt_order_flags, error) + CALL check("H5Pget_attr_creation_order_f",error,total_error) + CALL verify("H5Pget_attr_creation_order_f",crt_order_flags , 0, total_error) + + ! Set attribute creation order tracking & indexing for object + CALL h5pset_attr_creation_order_f(dcpl, IOR(H5P_CRT_ORDER_TRACKED_F, H5P_CRT_ORDER_INDEXED_F), error) + CALL check("H5Pset_attr_creation_order_f",error,total_error) + + CALL H5Pget_attr_creation_order_f(dcpl, crt_order_flags, error) + CALL check("H5Pget_attr_creation_order_f",error,total_error) + CALL verify("H5Pget_attr_creation_order_f",crt_order_flags , & + IOR(H5P_CRT_ORDER_TRACKED_F, H5P_CRT_ORDER_INDEXED_F), total_error) + + ! Create dataspace for dataset + CALL h5screate_f(H5S_SCALAR_F, sid, error) + CALL check("h5screate_f",error,total_error) + + ! Create a dataset + CALL h5dcreate_f(fid, DSET1_NAME, H5T_NATIVE_CHARACTER, sid, dataset, error, & + lcpl_id=H5P_DEFAULT_F, dapl_id=H5P_DEFAULT_F, dcpl_id=dcpl) + CALL check("h5dcreate_f",error,total_error) + + ! Close dataspace + CALL h5sclose_f(sid, error) + CALL check("h5sclose_f",error,total_error) + + + ! Close Dataset + CALL h5dclose_f(dataset, error) + CALL check("h5dclose_f",error,total_error) + + ! Close property list + CALL h5pclose_f(dcpl, error) + CALL check("h5pclose_f",error,total_error) + + ! Close file + CALL h5fclose_f(fid, error) + CALL check("h5fclose_f",error,total_error) + + ! Re-open file + CALL h5fopen_f(FileName, H5F_ACC_RDWR_F, fid, error, fapl) + CALL check("h5open_f",error,total_error) + + ! Open dataset created + CALL h5dopen_f(fid, DSET1_NAME, dataset, error, H5P_DEFAULT_F ) + CALL check("h5dopen_f",error,total_error) + + + ! Retrieve dataset creation property list for group + CALL H5Dget_create_plist_f(dataset, dcpl, error) + CALL check("H5Dget_create_plist_f",error,total_error) + + ! Query the attribute creation properties + CALL H5Pget_attr_creation_order_f(dcpl, crt_order_flags, error) + CALL check("H5Pget_attr_creation_order_f",error,total_error) + CALL verify("H5Pget_attr_creation_order_f",crt_order_flags , & + IOR(H5P_CRT_ORDER_TRACKED_F, H5P_CRT_ORDER_INDEXED_F), total_error ) + + ! Close property list + CALL h5pclose_f(dcpl, error) + CALL check("h5pclose_f",error,total_error) + + ! Close Dataset + CALL h5dclose_f(dataset, error) + CALL check("h5dclose_f",error,total_error) + + ! Close file + CALL h5fclose_f(fid, error) + CALL check("h5fclose_f",error,total_error) + + +END SUBROUTINE test_attr_corder_create_basic + +!*************************************************************** +!** +!** test_attr_basic_write(): Test basic H5A (attribute) code. +!** Tests integer attributes on both datasets and groups +!** +!*************************************************************** + +SUBROUTINE test_attr_basic_write(fapl, total_error) + + IMPLICIT NONE + + INTEGER(HID_T), INTENT(IN) :: fapl + INTEGER, INTENT(INOUT) :: total_error + CHARACTER(LEN=8) :: FileName = "tattr.h5" + INTEGER(HID_T) :: fid1 + INTEGER(HID_T) :: sid1, sid2 + + CHARACTER(LEN=8) :: DSET1_NAME = "Dataset1" + + INTEGER(HID_T) :: dataset + INTEGER :: i + INTEGER :: error + + INTEGER(HID_T) :: attr,attr2 !String Attribute identifier + INTEGER(HID_T) :: group + + CHARACTER(LEN=25) :: check_name + CHARACTER(LEN=18) :: chr_exact_size + + CHARACTER(LEN=5), PARAMETER :: ATTR1_NAME="Attr1" + INTEGER, PARAMETER :: ATTR1_RANK = 1 + INTEGER, PARAMETER :: ATTR1_DIM1 = 3 + CHARACTER(LEN=7), PARAMETER :: ATTR1A_NAME ="Attr1_a" + CHARACTER(LEN=18), PARAMETER :: ATTR_TMP_NAME = "Attr1_a-1234567890" + INTEGER, DIMENSION(ATTR1_DIM1) :: attr_data1 + INTEGER, DIMENSION(ATTR1_DIM1) :: attr_data1a + INTEGER, DIMENSION(ATTR1_DIM1) :: read_data1 + INTEGER(HSIZE_T) :: attr_size ! attributes storage requirements .MSB. + INTEGER(HSIZE_T), DIMENSION(1) :: dimsa = (/3/) ! Dataset dimensions + + INTEGER :: rank1 = 2 ! Dataspace1 rank + INTEGER(HSIZE_T), DIMENSION(2) :: dims1 = (/4,6/) ! Dataset dimensions + INTEGER(HSIZE_T), DIMENSION(2) :: maxdims1 = (/4,6/) ! maximum dimensions + + INTEGER(SIZE_T) :: size + +!! Initialize attribute data + attr_data1(1) = 258 + attr_data1(2) = 9987 + attr_data1(3) = -99890 + + attr_data1a(1) = 258 + attr_data1a(2) = 1087 + attr_data1a(3) = -99890 + + + ! Create file + CALL h5fcreate_f(FileName, H5F_ACC_TRUNC_F, fid1, error, H5P_DEFAULT_F, fapl) + CALL check("h5fcreate_f",error,total_error) + + ! Create dataspace for dataset + CALL h5screate_simple_f(rank1, dims1, sid1, error, maxdims1) + CALL check("h5screate_simple_f",error,total_error) + + ! Create a dataset + CALL h5dcreate_f(fid1, DSET1_NAME, H5T_NATIVE_CHARACTER, sid1, dataset, error, H5P_DEFAULT_F, H5P_DEFAULT_F, H5P_DEFAULT_F ) + CALL check("h5dcreate_f",error,total_error) + + ! Create dataspace for attribute + CALL h5screate_simple_f(ATTR1_RANK, dimsa, sid2, error) + CALL check("h5screate_simple_f",error,total_error) + + ! Try to create an attribute on the file (should create an attribute on root group) + CALL h5acreate_f(fid1, ATTR1_NAME, H5T_NATIVE_INTEGER, sid2, attr, error, aapl_id=H5P_DEFAULT_F, acpl_id=H5P_DEFAULT_F) + CALL check("h5acreate_f",error,total_error) + + ! Close attribute + CALL h5aclose_f(attr, error) + CALL check("h5aclose_f",error,total_error) + + ! Open the root group + CALL H5Gopen_f(fid1, "/", group, error, H5P_DEFAULT_F) + CALL check("H5Gopen_f",error,total_error) + + ! Open attribute again + CALL h5aopen_f(group, ATTR1_NAME, attr, error) + CALL check("h5aopen_f",error,total_error) + + ! Close attribute + CALL h5aclose_f(attr, error) + CALL check("h5aclose_f",error,total_error) + + ! Close root group + CALL H5Gclose_f(group, error) + CALL check("h5gclose_f",error,total_error) + + ! Create an attribute for the dataset + CALL h5acreate_f(dataset, ATTR1_NAME, H5T_NATIVE_INTEGER, sid2, attr, error, H5P_DEFAULT_F, H5P_DEFAULT_F) + CALL check("h5acreate_f",error,total_error) + + ! Write attribute information + + CALL h5awrite_f(attr, H5T_NATIVE_INTEGER, attr_data1, dimsa, error) + CALL check("h5awrite_f",error,total_error) + + ! Create an another attribute for the dataset + CALL h5acreate_f(dataset, ATTR1A_NAME, H5T_NATIVE_INTEGER, sid2, attr2, error, H5P_DEFAULT_F, H5P_DEFAULT_F) + CALL check("h5acreate_f",error,total_error) + + ! Write attribute information + CALL h5awrite_f(attr2, H5T_NATIVE_INTEGER, attr_data1a, dimsa, error) + CALL check("h5awrite_f",error,total_error) + + ! Check storage size for attribute + + CALL h5aget_storage_size_f(attr, attr_size, error) + CALL check("h5aget_storage_size_f",error,total_error) +!EP CALL verify("h5aget_storage_size_f", INT(attr_size), 2*HSIZE_T, total_error) + + + ! Read attribute information immediately, without closing attribute + CALL h5aread_f(attr, H5T_NATIVE_INTEGER, read_data1, dimsa, error) + CALL check("h5aread_f",error,total_error) + + ! Verify values read in + DO i = 1, ATTR1_DIM1 + CALL verify('h5aread_f',attr_data1(i),read_data1(i), total_error) + ENDDO + + ! CLOSE attribute + CALL h5aclose_f(attr, error) + CALL check("h5aclose_f",error,total_error) + + ! Close attribute + CALL h5aclose_f(attr2, error) + CALL check("h5aclose_f",error,total_error) + + ! change attribute name + CALL H5Arename_f(dataset, ATTR1_NAME, ATTR_TMP_NAME, error) + CALL check("H5Arename_f", error, total_error) + + ! Open attribute again + + CALL h5aopen_f(dataset, ATTR_TMP_NAME, attr, error) + CALL check("h5aopen_f",error,total_error) + + ! Verify new attribute name + ! Set a deliberately small size + + check_name = ' ' ! need to initialize or does not pass test + + size = 1 + CALL H5Aget_name_f(attr, size, check_name, error) + CALL check('H5Aget_name',error,total_error) + + ! Now enter with the corrected size + IF(error.NE.size)THEN + size = error + CALL H5Aget_name_f(attr, size, check_name, error) + CALL check('H5Aget_name',error,total_error) + ENDIF + + IF(TRIM(ADJUSTL(check_name)).NE.TRIM(ADJUSTL(ATTR_TMP_NAME))) THEN + PRINT*,'.'//TRIM(check_name)//'.',LEN_TRIM(check_name) + PRINT*,'.'//TRIM(ATTR_TMP_NAME)//'.',LEN_TRIM(ATTR_TMP_NAME) + WRITE(*,*) 'ERROR: attribute name different: attr_name ='//TRIM(check_name)//'.' + WRITE(*,*) ' should be ='//TRIM(ATTR_TMP_NAME)//'.' + total_error = total_error + 1 + stop + ENDIF + + ! Try with a string buffer that is exactly the correct size + size = 18 + CALL H5Aget_name_f(attr, size, chr_exact_size, error) + CALL check('H5Aget_name_f',error,total_error) + CALL verify('H5Aget_name_f',chr_exact_size,ATTR_TMP_NAME, total_error) + + ! Close attribute + CALL h5aclose_f(attr, error) + CALL check("h5aclose_f",error,total_error) + + CALL h5sclose_f(sid1, error) + CALL check("h5sclose_f",error,total_error) + CALL h5sclose_f(sid2, error) + CALL check("h5sclose_f",error,total_error) + ! Close Dataset + CALL h5dclose_f(dataset, error) + CALL check("h5dclose_f",error,total_error) + + ! Close file + CALL h5fclose_f(fid1, error) + CALL check("h5fclose_f",error,total_error) + +END SUBROUTINE test_attr_basic_write + +!*************************************************************** +!** +!** test_attr_many(): Test basic H5A (attribute) code. +!** Tests storing lots of attributes +!** +!*************************************************************** + +SUBROUTINE test_attr_many(new_format, fcpl, fapl, total_error) + + IMPLICIT NONE + + LOGICAL, INTENT(IN) :: new_format + INTEGER(HID_T), INTENT(IN) :: fcpl + INTEGER(HID_T), INTENT(IN) :: fapl + INTEGER, INTENT(INOUT) :: total_error + CHARACTER(LEN=8) :: FileName = "tattr.h5" + INTEGER(HID_T) :: fid + INTEGER(HID_T) :: sid + INTEGER(HID_T) :: gid + INTEGER(HID_T) :: aid + INTEGER :: error + + INTEGER(HSIZE_T), DIMENSION(7) :: data_dims + CHARACTER(LEN=5) :: chr5 + + + CHARACTER(LEN=11) :: attrname + CHARACTER(LEN=8), PARAMETER :: GROUP1_NAME="/Group1" + + INTEGER :: u + INTEGER :: nattr + LOGICAL :: exists + INTEGER, DIMENSION(1) :: attr_data1 + + data_dims = 0 + + + ! Create file + CALL h5fcreate_f(FileName, H5F_ACC_TRUNC_F, fid, error, fcpl, fapl) + CALL check("h5fcreate_f",error,total_error) + + ! Create dataspace for attribute + CALL h5screate_f(H5S_SCALAR_F, sid, error) + CALL check("h5screate_f",error,total_error) + + ! Create group for attributes + + CALL H5Gcreate_f(fid, GROUP1_NAME, gid, error) + CALL check("H5Gcreate_f", error, total_error) + + ! Create many attributes + + IF(new_format)THEN + nattr = 250 + ELSE + nattr = 2 + ENDIF + + DO u = 0, nattr - 1 + + WRITE(chr5,'(I5.5)') u + attrname = 'attr '//chr5 + CALL H5Aexists_f( gid, attrname, exists, error) + CALL verify("H5Aexists",exists,.FALSE.,total_error ) + + CALL H5Aexists_by_name_f(fid, GROUP1_NAME, attrname, exists, error, lapl_id = H5P_DEFAULT_F) + CALL verify("H5Aexists_by_name_f",exists,.FALSE.,total_error ) + + CALL h5acreate_f(gid, attrname, H5T_NATIVE_INTEGER, sid, aid, error, H5P_DEFAULT_F, H5P_DEFAULT_F) + CALL check("h5acreate_f",error,total_error) + + CALL H5Aexists_f(gid, attrname, exists, error) + CALL verify("H5Aexists",exists,.TRUE.,total_error ) + + CALL H5Aexists_by_name_f(fid, GROUP1_NAME, attrname, exists, error) + CALL verify("H5Aexists_by_name_f",exists,.TRUE.,total_error ) + + attr_data1(1) = u + data_dims(1) = 1 + + CALL h5awrite_f(aid, H5T_NATIVE_INTEGER, attr_data1, data_dims, error) + CALL check("h5awrite_f",error,total_error) + + CALL h5aclose_f(aid, error) + CALL check("h5aclose_f",error,total_error) + + CALL H5Aexists_f(gid, attrname, exists, error) + CALL verify("H5Aexists",exists,.TRUE.,total_error ) + + CALL H5Aexists_by_name_f(fid, GROUP1_NAME, attrname, exists, error) + CALL verify("H5Aexists_by_name_f",exists,.TRUE.,total_error ) + + ENDDO + + ! Close group + CALL H5Gclose_f(gid, error) + CALL check("h5gclose_f",error,total_error) + + ! Close file + CALL h5fclose_f(fid, error) + CALL check("h5fclose_f",error,total_error) + + ! Close dataspaces + CALL h5sclose_f(sid, error) + CALL check("h5sclose_f",error,total_error) + +END SUBROUTINE test_attr_many + +!------------------------------------------------------------------------- +! * Function: attr_open_check +! * +! * Purpose: Check opening attribute on an object +! * +! * Return: Success: 0 +! * Failure: -1 +! * +! * Programmer: Fortran version (M.S. Breitenfeld) +! * March 21, 2008 +! * +! *------------------------------------------------------------------------- +! + +SUBROUTINE attr_open_check(fid, dsetname, obj_id, max_attrs, total_error ) + + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: fid + CHARACTER(LEN=*), INTENT(IN) :: dsetname + INTEGER(HID_T), INTENT(IN) :: obj_id + INTEGER, INTENT(IN) :: max_attrs + INTEGER, INTENT(INOUT) :: total_error + + INTEGER :: u + CHARACTER (LEN=8) :: attrname + INTEGER :: error + LOGICAL :: f_corder_valid ! Indicates whether the the creation order data is valid for this attribute + INTEGER :: corder ! Is a positive integer containing the creation order of the attribute + INTEGER :: cset ! Indicates the character set used for the attribute’s name + INTEGER(HSIZE_T) :: data_size ! indicates the size, in the number of characters + + INTEGER(HSIZE_T) :: storage_size ! attributes storage requirements + CHARACTER(LEN=2) :: chr2 + INTEGER(HID_T) attr_id + ! Open each attribute on object by index and check that it's the correct one + + DO u = 0, max_attrs-1 + ! Open the attribute + + WRITE(chr2,'(I2.2)') u + attrname = 'attr '//chr2 + + + CALL h5aopen_f(obj_id, attrname, attr_id, error) + CALL check("h5aopen_f",error,total_error) + + + ! Get the attribute's information + + CALL h5aget_info_f(attr_id, f_corder_valid, corder, cset, data_size, error) + CALL check("h5aget_info_f",error,total_error) + + ! Check that the object's attributes are correct + CALL verify("h5aget_info_f.corder",corder,u,total_error) + CALL verify("h5aget_info_f.corder_valid",f_corder_valid,.TRUE.,total_error) + CALL verify("h5aget_info_f.cset", cset, H5T_CSET_ASCII_F, total_error) + CALL h5aget_storage_size_f(attr_id, storage_size, error) + CALL check("h5aget_storage_size_f",error,total_error) + + CALL verify("h5aget_info_f.data_size", INT(data_size), INT(storage_size), total_error) + + + ! Close attribute + CALL h5aclose_f(attr_id, error) + CALL check("h5aclose_f",error,total_error) + + ! Open the attribute + + CALL H5Aopen_by_name_f(obj_id, ".", attrname, attr_id, error, lapl_id=H5P_DEFAULT_F, aapl_id=H5P_DEFAULT_F) + CALL check("H5Aopen_by_name_f", error, total_error) + + CALL h5aget_info_f(attr_id, f_corder_valid, corder, cset, data_size, error) + CALL check("h5aget_info_f",error,total_error) + ! Check the attribute's information + CALL verify("h5aget_info_f",corder,u,total_error) + CALL verify("h5aget_info_f",f_corder_valid,.TRUE.,total_error) + CALL verify("h5aget_info_f", cset, H5T_CSET_ASCII_F, total_error) + CALL h5aget_storage_size_f(attr_id, storage_size, error) + CALL check("h5aget_storage_size_f",error,total_error) + CALL verify("h5aget_info_f", INT(data_size), INT(storage_size), total_error) + + ! Close attribute + CALL h5aclose_f(attr_id, error) + CALL check("h5aclose_f",error,total_error) + + + ! Open the attribute + CALL H5Aopen_by_name_f(fid, dsetname, attrname, attr_id, error) + CALL check("H5Aopen_by_name_f", error, total_error) + + + ! Get the attribute's information + CALL h5aget_info_f(attr_id, f_corder_valid, corder, cset, data_size, error) + CALL check("h5aget_info_f",error,total_error) + + ! Check the attribute's information + CALL verify("h5aget_info_f",corder,u,total_error) + CALL verify("h5aget_info_f",f_corder_valid,.TRUE.,total_error) + CALL verify("h5aget_info_f", cset, H5T_CSET_ASCII_F, total_error) + CALL h5aget_storage_size_f(attr_id, storage_size, error) + CALL check("h5aget_storage_size_f",error,total_error) + CALL verify("h5aget_info_f", INT(data_size), INT(storage_size), total_error) + + ! Close attribute + CALL h5aclose_f(attr_id, error) + CALL check("h5aclose_f",error,total_error) + ENDDO + +END SUBROUTINE attr_open_check +END MODULE TH5A_1_8 diff --git a/fortran/test/tH5A_1_8.f90 b/fortran/test/tH5A_1_8.f90 deleted file mode 100644 index c70e288..0000000 --- a/fortran/test/tH5A_1_8.f90 +++ /dev/null @@ -1,2779 +0,0 @@ -!****h* root/fortran/test/tH5A_1_8.f90 -! -! NAME -! tH5A_1_8.f90 -! -! FUNCTION -! Basic testing of Fortran H5A APIs introduced in 1.8. -! -! 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. * -! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -! -! CONTAINS SUBROUTINES -! attribute_test_1_8, test_attr_corder_create_compact, test_attr_null_space, -! test_attr_create_by_name, test_attr_info_by_idx, attr_info_by_idx_check, -! test_attr_shared_rename, test_attr_delete_by_idx, test_attr_shared_delete, -! test_attr_dense_open, test_attr_dense_verify, test_attr_corder_create_basic, -! test_attr_basic_write, test_attr_many, attr_open_check, -! -!***** -MODULE TH5A_1_8 - - USE HDF5 ! This module contains all necessary modules - USE TH5_MISC - USE TH5_MISC_GEN - -CONTAINS -SUBROUTINE attribute_test_1_8(cleanup, total_error) - -! This subroutine tests following 1.8 functionalities: -! h5acreate_f, h5awrite_f, h5aclose_f,h5aread_f, h5aopen_name_f, -! h5aget_name_f,h5aget_space_f, h5aget_type_f, H5Pset_shared_mesg_nindexes_f, -! H5Pset_shared_mesg_index_f -! - - - IMPLICIT NONE - LOGICAL, INTENT(IN) :: cleanup - INTEGER, INTENT(INOUT) :: total_error - - ! - !general purpose integer - ! - INTEGER :: i, j - INTEGER :: error ! Error flag - - ! NEW STARTS HERE - INTEGER(HID_T) :: fapl = -1, fapl2 = -1 - INTEGER(HID_T) :: fcpl = -1, fcpl2 = -1 - INTEGER(HID_T) :: my_fapl, my_fcpl - LOGICAL, DIMENSION(1:2) :: new_format = (/.TRUE.,.FALSE./) - LOGICAL, DIMENSION(1:2) :: use_shared = (/.TRUE.,.FALSE./) - - INTEGER :: ret_total_error - -! ******************** -! test_attr equivelent -! ******************** - -! WRITE(*,*) "TESTING ATTRIBUTES" - - CALL H5Pcreate_f(H5P_FILE_ACCESS_F,fapl,error) - CALL check("h5Pcreate_f",error,total_error) - CALL h5pcopy_f(fapl, fapl2, error) - CALL check("h5pcopy_f",error,total_error) - - CALL H5Pcreate_f(H5P_FILE_CREATE_F,fcpl,error) - CALL check("h5Pcreate_f",error,total_error) - - CALL h5pcopy_f(fcpl, fcpl2, error) - CALL check("h5pcopy_f",error,total_error) - - CALL H5Pset_shared_mesg_nindexes_f(fcpl2,1,error) - CALL check("H5Pset_shared_mesg_nindexes_f",error, total_error) - - CALL H5Pset_shared_mesg_index_f(fcpl2, 0, H5O_SHMESG_ATTR_FLAG_F, 1, error) - CALL check(" H5Pset_shared_mesg_index_f",error, total_error) - - DO i = 1, 2 - - IF (new_format(i)) THEN - WRITE(*,'(1X,A)') "Testing with new file format:" - my_fapl = fapl2 - ELSE - WRITE(*,'(1X,A)') "Testing with old file format:" - my_fapl = fapl - END IF - ret_total_error = 0 - CALL test_attr_basic_write(my_fapl, ret_total_error) - CALL write_test_status(ret_total_error, & - ' - Tests INT attributes on both datasets and groups', & - total_error) - - IF(new_format(i)) THEN - DO j = 1, 2 - IF (use_shared(j)) THEN - WRITE(*,*) " - Testing with shared attributes:" - my_fcpl = fcpl2 - ELSE - WRITE(*,*) " - Testing without shared attributes:" - my_fcpl = fcpl - END IF - - ret_total_error = 0 - CALL test_attr_dense_open(my_fcpl, my_fapl, ret_total_error) - CALL write_test_status(ret_total_error, & - ' - Testing INT attributes on both datasets and groups', & - total_error) - - ret_total_error = 0 - CALL test_attr_null_space(my_fcpl, my_fapl, ret_total_error) - CALL write_test_status(ret_total_error, & - ' - Testing storing attribute with "null" dataspace', & - total_error) - ret_total_error = 0 - CALL test_attr_many(new_format(i), my_fcpl, my_fapl, ret_total_error) - CALL write_test_status(ret_total_error, & - ' - Testing storing lots of attributes', & - total_error) - - ret_total_error = 0 - CALL test_attr_corder_create_basic(my_fcpl, my_fapl, ret_total_error) - CALL write_test_status(ret_total_error, & - ' - Testing creating objects with attribute creation order', & - total_error) - - ret_total_error = 0 - CALL test_attr_corder_create_compact(my_fcpl, my_fapl, ret_total_error) - CALL write_test_status(ret_total_error, & - ' - Testing compact storage on objects with attribute creation order', & - total_error) - ret_total_error = 0 - CALL test_attr_info_by_idx(new_format(i), my_fcpl, my_fapl, ret_total_error) - CALL write_test_status(ret_total_error, & - ' - Testing querying attribute info by index', & - total_error) - - ret_total_error = 0 - CALL test_attr_delete_by_idx(new_format(i), my_fcpl, my_fapl, ret_total_error) - CALL write_test_status(ret_total_error, & - ' - Testing deleting attribute by index', & - total_error) - - ret_total_error = 0 - CALL test_attr_create_by_name(new_format(i), my_fcpl, my_fapl, ret_total_error) - CALL write_test_status(ret_total_error, & - ' - Testing creating attributes by name', & - total_error) - - ! More complex tests with both "new format" and "shared" attributes - IF( use_shared(j) ) THEN - ret_total_error = 0 - CALL test_attr_shared_rename(my_fcpl, my_fapl, ret_total_error) - CALL write_test_status(ret_total_error,& - ' - Testing renaming shared attributes in "compact" & "dense" storage', & - total_error) - - ret_total_error = 0 - CALL test_attr_shared_delete(my_fcpl, my_fapl, ret_total_error) - CALL write_test_status(ret_total_error,& - ' - Testing deleting shared attributes in "compact" & "dense" storage', & - total_error) - - END IF - END DO - END IF - ENDDO - - CALL H5Pclose_f(fcpl, error) - CALL CHECK("H5Pclose", error,total_error) - CALL H5Pclose_f(fcpl2, error) - CALL CHECK("H5Pclose", error,total_error) - - IF(cleanup) CALL h5_cleanup_f("tattr", H5P_DEFAULT_F, error) - CALL check("h5_cleanup_f", error, total_error) - - - RETURN -END SUBROUTINE attribute_test_1_8 - -SUBROUTINE test_attr_corder_create_compact(fcpl,fapl, total_error) - -!*************************************************************** -!** -!** test_attr_corder_create_compact(): Test basic H5A (attribute) code. -!** Tests compact attribute storage on objects with attribute creation order info -!** -!*************************************************************** - -! Needed for get_info_by_name - - - IMPLICIT NONE - -! - - - arg types - - - - - INTEGER(HID_T), INTENT(IN) :: fcpl - INTEGER(HID_T), INTENT(IN) :: fapl - - CHARACTER(LEN=8) :: FileName = "tattr.h5" - INTEGER(HID_T) :: fid - INTEGER(HID_T) :: dcpl - INTEGER(HID_T) :: sid - - INTEGER :: error - INTEGER, INTENT(INOUT) :: total_error - - CHARACTER(LEN=8) :: DSET1_NAME = "Dataset1" - CHARACTER(LEN=8) :: DSET2_NAME = "Dataset2" - CHARACTER(LEN=8) :: DSET3_NAME = "Dataset3" - INTEGER, PARAMETER :: NUM_DSETS = 3 - - INTEGER :: curr_dset - - INTEGER(HID_T) :: dset1, dset2, dset3 - INTEGER(HID_T) :: my_dataset - - INTEGER :: u - - INTEGER :: max_compact ! Maximum # of links to store in group compactly - INTEGER :: min_dense ! Minimum # of links to store in group "densely" - - CHARACTER(LEN=7) :: attrname - CHARACTER(LEN=2) :: chr2 - INTEGER(HID_T) :: attr !String Attribute identifier - INTEGER(HSIZE_T), DIMENSION(7) :: data_dims - - LOGICAL :: f_corder_valid ! Indicates whether the the creation order data is valid for this attribute - INTEGER :: corder ! Is a positive integer containing the creation order of the attribute - INTEGER :: cset ! Indicates the character set used for the attribute’s name - INTEGER(HSIZE_T) :: data_size ! indicates the size, in the number of characters - - data_dims = 0 - -! WRITE(*,*) " - Testing Compact Storage of Attributes with Creation Order Info" - ! Create file - CALL h5fcreate_f(FileName, H5F_ACC_TRUNC_F, fid, error, fcpl, fapl) - CALL check("h5fcreate_f",error,total_error) - ! Create dataset creation property list - CALL H5Pcreate_f(H5P_DATASET_CREATE_F,dcpl,error) - CALL check("h5Pcreate_f",error,total_error) - - CALL H5Pset_attr_creation_order_f(dcpl, IOR(H5P_CRT_ORDER_TRACKED_F, H5P_CRT_ORDER_INDEXED_F), error) - CALL check("H5Pset_attr_creation_order",error,total_error) - - ! Query the attribute creation properties - CALL H5Pget_attr_phase_change_f(dcpl, max_compact, min_dense, error) - CALL check("H5Pget_attr_phase_change_f",error,total_error) - - CALL h5screate_f(H5S_SCALAR_F, sid, error) - CALL check("h5screate_f",error,total_error) - - CALL h5dcreate_f(fid, DSET1_NAME, H5T_NATIVE_CHARACTER, sid, dset1, error, dcpl_id=dcpl ) - CALL check("h5dcreate_f",error,total_error) - - CALL h5dcreate_f(fid, DSET2_NAME, H5T_NATIVE_CHARACTER, sid, dset2, error, dcpl ) - CALL check("h5dcreate_f",error,total_error) - - CALL h5dcreate_f(fid, DSET3_NAME, H5T_NATIVE_CHARACTER, sid, dset3, error, dcpl_id=dcpl ) - CALL check("h5dcreate_f",error,total_error) - - DO curr_dset = 0,NUM_DSETS-1 - SELECT CASE (curr_dset) - CASE (0) - my_dataset = dset1 - CASE (1) - my_dataset = dset2 - CASE (2) - my_dataset = dset3 - END SELECT - DO u = 0, max_compact - 1 - ! Create attribute - WRITE(chr2,'(I2.2)') u - attrname = 'attr '//chr2 - - CALL h5acreate_f(my_dataset, attrname, H5T_NATIVE_INTEGER, sid, attr, error) - CALL check("h5acreate_f",error,total_error) - - data_dims(1) = 1 - CALL h5awrite_f(attr, H5T_NATIVE_INTEGER, u, data_dims, error) - CALL check("h5awrite_f",error,total_error) - - CALL h5aclose_f(attr, error) - CALL check("h5aclose_f",error,total_error) - - END DO - END DO - - ! Close Datasets - CALL h5dclose_f(dset1, error) - CALL check("h5dclose_f",error,total_error) - CALL h5dclose_f(dset2, error) - CALL check("h5dclose_f",error,total_error) - CALL h5dclose_f(dset3, error) - CALL check("h5dclose_f",error,total_error) - - ! Close file - CALL h5fclose_f(fid, error) - CALL check("h5fclose_f",error,total_error) - - ! Close dataspace - CALL h5sclose_f(sid, error) - CALL check("h5sclose_f",error,total_error) - - ! Close property list - CALL h5pclose_f(dcpl, error) - CALL check("h5pclose_f",error,total_error) - - CALL h5fopen_f(FileName, H5F_ACC_RDWR_F, fid, error, fapl) - CALL check("h5open_f",error,total_error) - - CALL h5dopen_f(fid, DSET1_NAME, dset1, error) - CALL check("h5dopen_f",error,total_error) - CALL h5dopen_f(fid, DSET2_NAME, dset2, error) - CALL check("h5dopen_f",error,total_error) - CALL h5dopen_f(fid, DSET3_NAME, dset3, error) - CALL check("h5dopen_f",error,total_error) - DO curr_dset = 0,NUM_DSETS-1 - SELECT CASE (curr_dset) - CASE (0) - my_dataset = dset1 - CASE (1) - my_dataset = dset2 - CASE (2) - my_dataset = dset3 - CASE DEFAULT - WRITE(*,*) " WARNING: To many data sets! " - END SELECT - DO u = 0,max_compact-1 - WRITE(chr2,'(I2.2)') u - attrname = 'attr '//chr2 - ! Retrieve information for attribute - - CALL H5Aget_info_by_name_f(my_dataset, ".", attrname, & - f_corder_valid, corder, cset, data_size, error, lapl_id = H5P_DEFAULT_F ) !with optional - - CALL check("H5Aget_info_by_name_f", error, total_error) - - ! Verify creation order of attribute - - CALL verify("H5Aget_info_by_name_f", f_corder_valid, .TRUE., total_error) - CALL verify("H5Aget_info_by_name_f", corder, u, total_error) - - - ! Retrieve information for attribute - - CALL H5Aget_info_by_name_f(my_dataset, ".", attrname, & - f_corder_valid, corder, cset, data_size, error) ! without optional - - CALL check("H5Aget_info_by_name_f", error, total_error) - - ! Verify creation order of attribute - - CALL verify("H5Aget_info_by_name_f", f_corder_valid, .TRUE., total_error) - CALL verify("H5Aget_info_by_name_f", corder, u, total_error) - - END DO - END DO - ! Close Datasets - CALL h5dclose_f(dset1, error) - CALL check("h5dclose_f",error,total_error) - CALL h5dclose_f(dset2, error) - CALL check("h5dclose_f",error,total_error) - CALL h5dclose_f(dset3, error) - CALL check("h5dclose_f",error,total_error) - - ! Close file - CALL h5fclose_f(fid, error) - CALL check("h5fclose_f",error,total_error) - -END SUBROUTINE test_attr_corder_create_compact - -SUBROUTINE test_attr_null_space(fcpl, fapl, total_error) -!*************************************************************** -!** -!** test_attr_null_space(): Test basic H5A (attribute) code. -!** Tests storing attribute with "null" dataspace -!** -!*************************************************************** - - - IMPLICIT NONE - - INTEGER(HID_T), INTENT(IN) :: fcpl - INTEGER(HID_T), INTENT(IN) :: fapl - INTEGER, INTENT(INOUT) :: total_error - - CHARACTER(LEN=8) :: FileName = "tattr.h5" - INTEGER(HID_T) :: fid - INTEGER(HID_T) :: sid, null_sid - INTEGER(HID_T) :: dataset - - CHARACTER(LEN=8) :: DSET1_NAME = "Dataset1" - - INTEGER :: error - - INTEGER :: value_scalar - INTEGER, DIMENSION(1) :: value - INTEGER(HID_T) :: attr !String Attribute identifier - INTEGER(HID_T) :: attr_sid - INTEGER(HSIZE_T), DIMENSION(7) :: data_dims - - INTEGER(HSIZE_T) :: storage_size ! attributes storage requirements - - LOGICAL :: f_corder_valid ! Indicates whether the the creation order data is valid for this attribute - INTEGER :: corder ! Is a positive integer containing the creation order of the attribute - INTEGER :: cset ! Indicates the character set used for the attribute’s name - INTEGER(HSIZE_T) :: data_size ! indicates the size, in the number of characters - - LOGICAL :: equal - - ! test: H5Sextent_equal_f - - data_dims = 0 - - ! Create file - CALL h5fcreate_f(FileName, H5F_ACC_TRUNC_F, fid, error, fcpl, fapl) - CALL check("h5fcreate_f",error,total_error) - ! Close file - CALL h5fclose_f(fid, error) - CALL check("h5fclose_f",error,total_error) - - ! Re-open file - CALL h5fopen_f(FileName, H5F_ACC_RDWR_F, fid, error) - CALL check("h5open_f",error,total_error) - ! Create dataspace for dataset attributes - CALL h5screate_f(H5S_SCALAR_F, sid, error) - CALL check("h5screate_f",error,total_error) - ! Create "null" dataspace for attribute - CALL h5screate_f(H5S_NULL_F, null_sid, error) - CALL check("h5screate_f",error,total_error) - ! Create a dataset - CALL h5dcreate_f(fid, DSET1_NAME, H5T_NATIVE_CHARACTER, sid, dataset, error) - CALL check("h5dcreate_f",error,total_error) - ! Add attribute with 'null' dataspace - - ! Create attribute - CALL h5acreate_f(dataset, "null attr", H5T_NATIVE_INTEGER, null_sid, attr, error) - CALL check("h5acreate_f",error,total_error) - - ! Try to read data from the attribute - ! (shouldn't fail, but should leave buffer alone) - value(1) = 103 - data_dims(1) = 1 - CALL h5aread_f(attr, H5T_NATIVE_INTEGER, value, data_dims, error) - CALL check("h5aread_f",error,total_error) - CALL verify("h5aread_f",value(1),103,total_error) - -! Try to read data from the attribute again but -! for a scalar - - value_scalar = 104 - data_dims(1) = 1 - CALL h5aread_f(attr, H5T_NATIVE_INTEGER, value_scalar, data_dims, error) - CALL check("h5aread_f",error,total_error) - CALL verify("h5aread_f",value_scalar,104,total_error) - - CALL h5aget_space_f(attr, attr_sid, error) - CALL check("h5aget_space_f",error,total_error) - - CALL H5Sextent_equal_f(attr_sid, null_sid, equal, error) - CALL check("H5Sextent_equal_f",error,total_error) - CALL verify("H5Sextent_equal_f",equal,.TRUE.,total_error) - - CALL h5aget_storage_size_f(attr, storage_size, error) - CALL check("h5aget_storage_size_f",error,total_error) - CALL verify("h5aget_storage_size_f",INT(storage_size),0,total_error) - - CALL h5aget_info_f(attr, f_corder_valid, corder, cset, data_size, error) - CALL check("h5aget_info_f", error, total_error) - - ! Check the attribute's information - CALL verify("h5aget_info_f.corder",corder,0,total_error) - - CALL verify("h5aget_info_f.cset", cset, H5T_CSET_ASCII_F, total_error) - CALL h5aget_storage_size_f(attr, storage_size, error) - CALL check("h5aget_storage_size_f",error,total_error) - CALL verify("h5aget_info_f.data_size", INT(data_size), INT(storage_size), total_error) - CALL h5aclose_f(attr,error) - CALL check("h5aclose_f",error,total_error) - - CALL H5Sclose_f(attr_sid, error) - CALL check("H5Sclose_f",error,total_error) - - CALL H5Dclose_f(dataset, error) - CALL check("H5Dclose_f", error,total_error) - - - CALL H5Fclose_f(fid, error) - CALL check("H5Fclose_f", error,total_error) - - CALL H5Sclose_f(sid, error) - CALL check("H5Sclose_f", error,total_error) - - CALL H5Sclose_f(null_sid, error) - CALL check("H5Sclose_f", error,total_error) - -END SUBROUTINE test_attr_null_space - - -SUBROUTINE test_attr_create_by_name(new_format,fcpl,fapl, total_error) - -!*************************************************************** -!** -!** test_attr_create_by_name(): Test basic H5A (attribute) code. -!** Tests creating attributes by name -!** -!*************************************************************** - - IMPLICIT NONE - - INTEGER(SIZE_T), PARAMETER :: NAME_BUF_SIZE = 7 - LOGICAL :: new_format - INTEGER(HID_T), INTENT(IN) :: fcpl - INTEGER(HID_T), INTENT(IN) :: fapl - INTEGER, INTENT(INOUT) :: total_error - - INTEGER :: max_compact,min_dense,u - CHARACTER (LEN=NAME_BUF_SIZE) :: attrname - CHARACTER(LEN=8) :: dsetname - - CHARACTER(LEN=8) :: FileName = "tattr.h5" - INTEGER(HID_T) :: fid - INTEGER(HID_T) :: dcpl - INTEGER(HID_T) :: sid - - CHARACTER(LEN=8) :: DSET1_NAME = "Dataset1" - CHARACTER(LEN=8) :: DSET2_NAME = "Dataset2" - CHARACTER(LEN=8) :: DSET3_NAME = "Dataset3" - INTEGER, PARAMETER :: NUM_DSETS = 3 - - INTEGER :: curr_dset - - INTEGER(HID_T) :: dset1, dset2, dset3 - INTEGER(HID_T) :: my_dataset - INTEGER :: error - - INTEGER(HID_T) :: attr !String Attribute identifier - INTEGER(HSIZE_T), DIMENSION(7) :: data_dims - - - CHARACTER(LEN=2) :: chr2 - LOGICAL, DIMENSION(1:2) :: use_index = (/.FALSE.,.TRUE./) - INTEGER :: Input1 - INTEGER :: i - - data_dims = 0 - - - ! Create dataspace for dataset & attributes - CALL h5screate_f(H5S_SCALAR_F, sid, error) - CALL check("h5screate_f",error,total_error) - - ! Create dataset creation property list - CALL H5Pcreate_f(H5P_DATASET_CREATE_F,dcpl,error) - CALL check("h5Pcreate_f",error,total_error) - - ! Query the attribute creation properties - - CALL H5Pget_attr_phase_change_f(dcpl, max_compact, min_dense, error) - CALL check("H5Pget_attr_phase_change_f",error,total_error) - - ! Loop over using index for creation order value - DO i = 1, 2 - ! Print appropriate test message - IF(use_index(i))THEN - WRITE(*,*) " - Testing Creating Attributes By Name w/Creation Order Index" - ELSE - WRITE(*,*) " - Testing Creating Attributes By Name w/o Creation Order Index" - ENDIF - ! Create file - CALL h5fcreate_f(FileName, H5F_ACC_TRUNC_F, fid, error, fcpl, fapl) - CALL check("h5fcreate_f",error,total_error) - - ! Set attribute creation order tracking & indexing for object - IF(new_format)THEN - - IF(use_index(i))THEN - Input1 = H5P_CRT_ORDER_INDEXED_F - ELSE - Input1 = 0 - ENDIF - - CALL H5Pset_attr_creation_order_f(dcpl, IOR(H5P_CRT_ORDER_TRACKED_F, Input1), error) - CALL check("H5Pset_attr_creation_order",error,total_error) - - ENDIF - - ! Create datasets - - CALL h5dcreate_f(fid, DSET1_NAME, H5T_NATIVE_CHARACTER, sid, dset1, error, dcpl_id=dcpl ) - CALL check("h5dcreate_f2",error,total_error) - - CALL h5dcreate_f(fid, DSET2_NAME, H5T_NATIVE_CHARACTER, sid, dset2, error, dcpl_id=dcpl ) - CALL check("h5dcreate_f3",error,total_error) - - CALL h5dcreate_f(fid, DSET3_NAME, H5T_NATIVE_CHARACTER, sid, dset3, error, dcpl_id=dcpl ) - CALL check("h5dcreate_f4",error,total_error) - - - ! Work on all the datasets - - DO curr_dset = 0,NUM_DSETS-1 - SELECT CASE (curr_dset) - CASE (0) - my_dataset = dset1 - dsetname = DSET1_NAME - CASE (1) - my_dataset = dset2 - dsetname = DSET2_NAME - CASE (2) - my_dataset = dset3 - dsetname = DSET3_NAME - ! CASE DEFAULT - ! CALL HDassert(0.AND."Toomanydatasets!") - END SELECT - - - ! Create attributes, up to limit of compact form - - DO u = 0, max_compact - 1 - ! Create attribute - WRITE(chr2,'(I2.2)') u - attrname = 'attr '//chr2 - CALL H5Acreate_by_name_f(fid, dsetname, attrname, H5T_NATIVE_INTEGER, sid, & - attr, error, lapl_id=H5P_DEFAULT_F, acpl_id=H5P_DEFAULT_F, aapl_id=H5P_DEFAULT_F) - CALL check("H5Acreate_by_name_f",error,total_error) - - ! Write data into the attribute - - data_dims(1) = 1 - CALL h5awrite_f(attr, H5T_NATIVE_INTEGER, u, data_dims, error) - CALL check("h5awrite_f",error,total_error) - - ! Close attribute - CALL h5aclose_f(attr, error) - CALL check("h5aclose_f",error,total_error) - - ! Verify information for NEW attribute - CALL attr_info_by_idx_check(my_dataset, attrname, INT(u,HSIZE_T), use_index(i), total_error) - ! CALL check("FAILED IN attr_info_by_idx_check",total_error) - ENDDO - - ! Test opening attributes stored compactly - - CALL attr_open_check(fid, dsetname, my_dataset, u, total_error) - - ENDDO - - - ! Work on all the datasets - DO curr_dset = 0,NUM_DSETS-1 - SELECT CASE (curr_dset) - CASE (0) - my_dataset = dset1 - dsetname = DSET1_NAME - CASE (1) - my_dataset = dset2 - dsetname = DSET2_NAME - CASE (2) - my_dataset = dset3 - dsetname = DSET3_NAME - END SELECT - - ! Create more attributes, to push into dense form - DO u = max_compact, max_compact* 2 - 1 - - WRITE(chr2,'(I2.2)') u - attrname = 'attr '//chr2 - - CALL H5Acreate_by_name_f(fid, dsetname, attrname, H5T_NATIVE_INTEGER, sid, & - attr, error, lapl_id=H5P_DEFAULT_F) - CALL check("H5Acreate_by_name",error,total_error) - - ! Write data into the attribute - data_dims(1) = 1 - CALL h5awrite_f(attr, H5T_NATIVE_INTEGER, u, data_dims, error) - CALL check("h5awrite_f",error,total_error) - - ! Close attribute - CALL h5aclose_f(attr, error) - CALL check("h5aclose_f",error,total_error) - - ENDDO - - ENDDO - - ! Close Datasets - CALL h5dclose_f(dset1, error) - CALL check("h5dclose_f",error,total_error) - CALL h5dclose_f(dset2, error) - CALL check("h5dclose_f",error,total_error) - CALL h5dclose_f(dset3, error) - CALL check("h5dclose_f",error,total_error) - - - ! Close file - CALL h5fclose_f(fid, error) - CALL check("h5fclose_f",error,total_error) - ENDDO - - ! Close property list - CALL h5pclose_f(dcpl, error) - CALL check("h5pclose_f",error,total_error) - - ! Close dataspace - CALL h5sclose_f(sid, error) - CALL check("h5sclose_f",error,total_error) - -END SUBROUTINE test_attr_create_by_name - - -SUBROUTINE test_attr_info_by_idx(new_format, fcpl, fapl, total_error) - -!*************************************************************** -!** -!** test_attr_info_by_idx(): Test basic H5A (attribute) code. -!** Tests querying attribute info by index -!** -!*************************************************************** - - IMPLICIT NONE - - LOGICAL :: new_format - INTEGER(HID_T), INTENT(IN) :: fcpl - INTEGER(HID_T), INTENT(IN) :: fapl - INTEGER, INTENT(INOUT) :: total_error - CHARACTER(LEN=8) :: FileName = "tattr.h5" - INTEGER(HID_T) :: fid - INTEGER(HID_T) :: dcpl - INTEGER(HID_T) :: sid - - CHARACTER(LEN=8) :: DSET1_NAME = "Dataset1" - CHARACTER(LEN=8) :: DSET2_NAME = "Dataset2" - CHARACTER(LEN=8) :: DSET3_NAME = "Dataset3" - INTEGER, PARAMETER :: NUM_DSETS = 3 - - INTEGER :: curr_dset - - INTEGER(HID_T) :: dset1, dset2, dset3 - INTEGER(HID_T) :: my_dataset - INTEGER :: error - - INTEGER(HID_T) :: attr !String Attribute identifier - INTEGER(HSIZE_T), DIMENSION(7) :: data_dims - - LOGICAL :: f_corder_valid ! Indicates whether the the creation order data is valid for this attribute - INTEGER :: corder ! Is a positive integer containing the creation order of the attribute - INTEGER :: cset ! Indicates the character set used for the attribute’s name - INTEGER(HSIZE_T) :: data_size ! indicates the size, in the number of characters - INTEGER(HSIZE_T) :: n - LOGICAL, DIMENSION(1:2) :: use_index = (/.FALSE.,.TRUE./) - - INTEGER :: max_compact ! Maximum # of links to store in group compactly - INTEGER :: min_dense ! Minimum # of links to store in group "densely" - - CHARACTER(LEN=2) :: chr2 - - INTEGER :: i, j - - INTEGER, DIMENSION(1) :: attr_integer_data - CHARACTER(LEN=7) :: attrname - - INTEGER(SIZE_T) :: size - CHARACTER(LEN=80) :: tmpname - - INTEGER :: Input1 - INTEGER(HSIZE_T) :: hzero = 0_HSIZE_T - INTEGER :: minusone = -1 - INTEGER(HSIZE_T) :: htmp - - data_dims = 0 - - ! Create dataspace for dataset & attributes - - CALL h5screate_f(H5S_SCALAR_F, sid, error) - CALL check("h5screate_f",error,total_error) - - - ! Create dataset creation property list - - CALL H5Pcreate_f(H5P_DATASET_CREATE_F,dcpl,error) - CALL check("h5Pcreate_f",error,total_error) - - - ! Query the attribute creation properties - CALL H5Pget_attr_phase_change_f(dcpl, max_compact, min_dense, error) - CALL check("H5Pget_attr_phase_change_f",error,total_error) - - ! Loop over using index for creation order value - - DO i = 1, 2 - - ! Create file - CALL h5fcreate_f(FileName, H5F_ACC_TRUNC_F, fid, error, fcpl, fapl) - CALL check("h5fcreate_f",error,total_error) - - ! Set attribute creation order tracking & indexing for object - IF(new_format)THEN - IF(use_index(i))THEN - Input1 = H5P_CRT_ORDER_INDEXED_F - ELSE - Input1 = 0 - ENDIF - CALL H5Pset_attr_creation_order_f(dcpl, IOR(H5P_CRT_ORDER_TRACKED_F, Input1), error) - CALL check("H5Pset_attr_creation_order",error,total_error) - ENDIF - - ! Create datasets - - CALL h5dcreate_f(fid, DSET1_NAME, H5T_NATIVE_CHARACTER, sid, dset1, error ) - CALL check("h5dcreate_f",error,total_error) - - CALL h5dcreate_f(fid, DSET2_NAME, H5T_NATIVE_CHARACTER, sid, dset2, error ) - CALL check("h5dcreate_f",error,total_error) - - CALL h5dcreate_f(fid, DSET3_NAME, H5T_NATIVE_CHARACTER, sid, dset3, error ) - CALL check("h5dcreate_f",error,total_error) - - ! Work on all the datasets - - DO curr_dset = 0,NUM_DSETS-1 - - SELECT CASE (curr_dset) - CASE (0) - my_dataset = dset1 - CASE (1) - my_dataset = dset2 - CASE (2) - my_dataset = dset3 - END SELECT - - ! Check for query on non-existant attribute - - n = 0 - - ! -- CHECK PASSING AN INTEGER CONSTANT IN DIFFERENT FORMS -- - - ! 1) call by passing an integer with the _hsize_t declaration - - CALL h5aget_info_by_idx_f(my_dataset, ".", H5_INDEX_CRT_ORDER_F, H5_ITER_INC_F, 0_hsize_t, & - f_corder_valid, corder, cset, data_size, error, lapl_id=H5P_DEFAULT_F) - CALL verify("h5aget_info_by_idx_f",error,minusone,total_error) - - ! 2) call by passing an integer with the INT(,hsize_t) declaration - - CALL h5aget_info_by_idx_f(my_dataset, ".", H5_INDEX_CRT_ORDER_F, H5_ITER_INC_F, INT(0,hsize_t), & - f_corder_valid, corder, cset, data_size, error, lapl_id=H5P_DEFAULT_F) - CALL verify("h5aget_info_by_idx_f",error,minusone,total_error) - - - ! 3) call by passing a variable with the attribute hsize_t - - CALL h5aget_info_by_idx_f(my_dataset, ".", H5_INDEX_CRT_ORDER_F, H5_ITER_INC_F, hzero, & - f_corder_valid, corder, cset, data_size, error, lapl_id=H5P_DEFAULT_F) - CALL verify("h5aget_info_by_idx_f",error,minusone,total_error) - - CALL h5aget_name_by_idx_f(my_dataset, ".", H5_INDEX_CRT_ORDER_F, H5_ITER_INC_F, & - hzero, tmpname, error, size, lapl_id=H5P_DEFAULT_F) - CALL verify("h5aget_name_by_idx_f",error,minusone,total_error) - - - ! Create attributes, up to limit of compact form - - DO j = 0, max_compact-1 - ! Create attribute - WRITE(chr2,'(I2.2)') j - attrname = 'attr '//chr2 - - ! check with the optional information create2 specs. - CALL h5acreate_f(my_dataset, attrname, H5T_NATIVE_INTEGER, sid, attr, error, H5P_DEFAULT_F, H5P_DEFAULT_F) - CALL check("h5acreate_f",error,total_error) - - ! Write data into the attribute - - attr_integer_data(1) = j - data_dims(1) = 1 - CALL h5awrite_f(attr, H5T_NATIVE_INTEGER, attr_integer_data, data_dims, error) - CALL check("h5awrite_f",error,total_error) - - ! Close attribute - - CALL h5aclose_f(attr, error) - CALL check("h5aclose_f",error,total_error) - - ! Verify information for new attribute - -!EP CALL attr_info_by_idx_check(my_dataset, attrname, INT(j,HSIZE_T), use_index(i), total_error ) - htmp = j - CALL attr_info_by_idx_check(my_dataset, attrname, htmp, use_index(i), total_error ) - - !CHECK(ret, FAIL, "attr_info_by_idx_check"); - ENDDO - - ENDDO - - - ! Close Datasets - CALL h5dclose_f(dset1, error) - CALL check("h5dclose_f",error,total_error) - CALL h5dclose_f(dset2, error) - CALL check("h5dclose_f",error,total_error) - CALL h5dclose_f(dset3, error) - CALL check("h5dclose_f",error,total_error) - - ! Close file - CALL h5fclose_f(fid, error) - CALL check("h5fclose_f",error,total_error) - - END DO - - ! Close property list - CALL h5pclose_f(dcpl,error) - CALL check("h5pclose_f", error, total_error) - - ! Close dataspace - CALL h5sclose_f(sid, error) - CALL check("h5sclose_f",error,total_error) - -END SUBROUTINE test_attr_info_by_idx - - -SUBROUTINE attr_info_by_idx_check(obj_id, attrname, n, use_index, total_error ) - - IMPLICIT NONE - - INTEGER :: error, total_error - - INTEGER(HID_T) :: obj_id - CHARACTER(LEN=*) :: attrname - INTEGER(HSIZE_T) :: n - LOGICAL :: use_index - LOGICAL :: f_corder_valid ! Indicates whether the the creation order data is valid for this attribute - INTEGER :: corder ! Is a positive integer containing the creation order of the attribute - INTEGER :: cset ! Indicates the character set used for the attribute’s name - INTEGER(HSIZE_T) :: data_size ! indicates the size, in the number of characters - - INTEGER(SIZE_T) :: NAME_BUF_SIZE = 7 - CHARACTER(LEN=7) :: tmpname - INTEGER(HSIZE_T) :: hzero = 0_HSIZE_T - - - ! Verify the information for first attribute, in increasing creation order - CALL h5aget_info_by_idx_f(obj_id, ".", H5_INDEX_CRT_ORDER_F, H5_ITER_INC_F, hzero, & - f_corder_valid, corder, cset, data_size, error) - - CALL check("h5aget_info_by_idx_f",error,total_error) - CALL verify("h5aget_info_by_idx_f",corder,0,total_error) - ! Verify the information for new attribute, in increasing creation order - - CALL h5aget_info_by_idx_f(obj_id, ".", H5_INDEX_CRT_ORDER_F, H5_ITER_INC_F, n, & - f_corder_valid, corder, cset, data_size, error) - - CALL check("h5aget_info_by_idx_f",error,total_error) - CALL verify("h5aget_info_by_idx_f",corder,INT(n),total_error) - - ! Verify the name for new link, in increasing creation order - - ! Try with the correct buffer size - - CALL h5aget_name_by_idx_f(obj_id, ".", H5_INDEX_CRT_ORDER_F, H5_ITER_INC_F, & - n, tmpname, error, NAME_BUF_SIZE) - CALL check("h5aget_name_by_idx_f",error,total_error) - CALL verify("h5aget_name_by_idx_f", INT(NAME_BUF_SIZE), 7, error) - - IF(attrname.NE.tmpname)THEN - error = -1 - ENDIF - CALL verify("h5aget_name_by_idx_f",error,0,total_error) - - ! Don't test "native" order if there is no creation order index, since - ! * there's not a good way to easily predict the attribute's order in the name - ! * index. - ! - IF (use_index) THEN - ! Verify the information for first attribute, in native creation order - CALL h5aget_info_by_idx_f(obj_id, ".", H5_INDEX_CRT_ORDER_F, H5_ITER_NATIVE_F, hzero, & - f_corder_valid, corder, cset, data_size, error) - CALL check("h5aget_info_by_idx_f",error,total_error) - CALL verify("h5aget_info_by_idx_f",corder,0,total_error) - - ! Verify the information for new attribute, in native creation order - CALL h5aget_info_by_idx_f(obj_id, ".", H5_INDEX_CRT_ORDER_F, H5_ITER_NATIVE_F, n, & - f_corder_valid, corder, cset, data_size, error) - CALL check("h5aget_info_by_idx_f",error,total_error) - CALL verify("h5aget_info_by_idx_f",corder,INT(n),total_error) - - ! Verify the name for new link, in increasing native order - CALL h5aget_name_by_idx_f(obj_id, ".", H5_INDEX_CRT_ORDER_F, H5_ITER_NATIVE_F, & - n, tmpname, error) ! check with no optional parameters - CALL check("h5aget_name_by_idx_f",error,total_error) - IF(TRIM(attrname).NE.TRIM(tmpname))THEN - WRITE(*,*) "ERROR: attribute name size wrong!" - error = -1 - ENDIF - CALL verify("h5aget_name_by_idx_f",error,0,total_error) - END IF - - - CALL h5aget_info_by_idx_f(obj_id, ".", H5_INDEX_CRT_ORDER_F, H5_ITER_DEC_F, n, & - f_corder_valid, corder, cset, data_size, error) - CALL check("h5aget_info_by_idx_f",error,total_error) - CALL verify("h5aget_info_by_idx_f",corder,0,total_error) - -!EP CALL h5aget_info_by_idx_f(obj_id, ".", H5_INDEX_CRT_ORDER_F, H5_ITER_DEC_F, 0_HSIZE_T, & - - ! -- CHECK PASSING AN INTEGER CONSTANT IN DIFFERENT FORMS -- - - ! 1) call by passing an integer with the _hsize_t declaration - - CALL h5aget_info_by_idx_f(obj_id, ".", H5_INDEX_CRT_ORDER_F, H5_ITER_DEC_F, 0_HSIZE_T, & - f_corder_valid, corder, cset, data_size, error) - CALL check("h5aget_info_by_idx_f",error,total_error) - CALL verify("h5aget_info_by_idx_f",corder,INT(n),total_error) - - ! 2) call by passing an integer with the INT(,hsize_t) declaration - - CALL h5aget_info_by_idx_f(obj_id, ".", H5_INDEX_CRT_ORDER_F, H5_ITER_DEC_F, INT(0,HSIZE_T), & - f_corder_valid, corder, cset, data_size, error) - CALL check("h5aget_info_by_idx_f",error,total_error) - CALL verify("h5aget_info_by_idx_f",corder,INT(n),total_error) - - ! 3) call by passing a variable with the attribute hsize_t - - CALL h5aget_info_by_idx_f(obj_id, ".", H5_INDEX_CRT_ORDER_F, H5_ITER_DEC_F, hzero, & - f_corder_valid, corder, cset, data_size, error) - CALL check("h5aget_info_by_idx_f",error,total_error) - CALL verify("h5aget_info_by_idx_f",corder,INT(n),total_error) - -!EP CALL h5aget_info_by_idx_f(obj_id, ".", H5_INDEX_NAME_F, H5_ITER_INC_F, 0_HSIZE_T, & - CALL h5aget_info_by_idx_f(obj_id, ".", H5_INDEX_NAME_F, H5_ITER_INC_F, hzero, & - f_corder_valid, corder, cset, data_size, error) - CALL check("h5aget_info_by_idx_f",error,total_error) - CALL verify("h5aget_info_by_idx_f",corder,0,total_error) - CALL h5aget_info_by_idx_f(obj_id, ".", H5_INDEX_NAME_F, H5_ITER_INC_F, n, & - f_corder_valid, corder, cset, data_size, error) - CALL check("h5aget_info_by_idx_f",error,total_error) - CALL verify("h5aget_info_by_idx_f",corder,INT(n),total_error) - - CALL h5aget_info_by_idx_f(obj_id, ".", H5_INDEX_NAME_F, H5_ITER_DEC_F, n, & - f_corder_valid, corder, cset, data_size, error) - CALL check("h5aget_info_by_idx_f",error,total_error) - CALL verify("h5aget_info_by_idx_f",corder,0,total_error) -!EP CALL h5aget_info_by_idx_f(obj_id, ".", H5_INDEX_NAME_F, H5_ITER_DEC_F, 0_HSIZE_T, & - CALL h5aget_info_by_idx_f(obj_id, ".", H5_INDEX_NAME_F, H5_ITER_DEC_F, hzero, & - f_corder_valid, corder, cset, data_size, error) - CALL check("h5aget_info_by_idx_f",error,total_error) - CALL verify("h5aget_info_by_idx_f",corder,INT(n),total_error) - - -END SUBROUTINE attr_info_by_idx_check - - -SUBROUTINE test_attr_shared_rename( fcpl, fapl, total_error) - -!*************************************************************** -!** -!** test_attr_shared_rename(): Test basic H5A (attribute) code. -!** Tests renaming shared attributes in "compact" & "dense" storage -!** -!*************************************************************** - - IMPLICIT NONE - - INTEGER(HID_T), INTENT(IN) :: fcpl - INTEGER(HID_T), INTENT(IN) :: fapl - INTEGER, INTENT(INOUT) :: total_error - - CHARACTER(LEN=8) :: FileName = "tattr.h5" - INTEGER(HID_T) :: fid - INTEGER(HID_T) :: dcpl - INTEGER(HID_T) :: sid, big_sid - - CHARACTER(LEN=8) :: DSET1_NAME = "Dataset1" - CHARACTER(LEN=8) :: DSET2_NAME = "Dataset2" - - - INTEGER(HID_T) :: dataset, dataset2 - - INTEGER :: error - - INTEGER(HID_T) :: attr !String Attribute identifier - INTEGER(HID_T) :: attr_tid - INTEGER(HSIZE_T), DIMENSION(7) :: data_dims - - - INTEGER :: max_compact ! Maximum # of links to store in group compactly - INTEGER :: min_dense ! Minimum # of links to store in group "densely" - - CHARACTER(LEN=2) :: chr2 - - - INTEGER, DIMENSION(1) :: attr_integer_data - CHARACTER(LEN=7) :: attrname - CHARACTER(LEN=11) :: attrname2 - - INTEGER :: u - INTEGER(HID_T) :: my_fcpl - - CHARACTER(LEN=5), PARAMETER :: TYPE1_NAME = "/Type" - - INTEGER :: test_shared - INTEGER(HSIZE_T), DIMENSION(1) :: adims2 = (/1/) ! Attribute dimension - INTEGER :: arank = 1 ! Attribure rank - - ! Initialize "big" attribute data - - ! Create dataspace for dataset - CALL h5screate_f(H5S_SCALAR_F, sid, error) - CALL check("h5screate_f",error,total_error) - - ! Create "big" dataspace for "large" attributes - - CALL h5screate_simple_f(arank, adims2, big_sid, error) - CALL check("h5screate_simple_f",error,total_error) - - ! Loop over type of shared components - DO test_shared = 0, 2 - ! Make copy of file creation property list - CALL H5Pcopy_f(fcpl, my_fcpl, error) - CALL check("H5Pcopy",error,total_error) - - ! Set up datatype for attributes - - CALL H5Tcopy_f(H5T_NATIVE_INTEGER, attr_tid, error) - CALL check("H5Tcopy",error,total_error) - - ! Special setup for each type of shared components - - IF( test_shared .EQ. 0) THEN - ! Make attributes > 500 bytes shared - CALL H5Pset_shared_mesg_nindexes_f(my_fcpl,1,error) - CALL check("H5Pset_shared_mesg_nindexes_f",error, total_error) - CALL H5Pset_shared_mesg_index_f(my_fcpl, 0, H5O_SHMESG_ATTR_FLAG_F, 500,error) - CALL check(" H5Pset_shared_mesg_index_f",error, total_error) - - ELSE - ! Set up copy of file creation property list - CALL H5Pset_shared_mesg_nindexes_f(my_fcpl,3,error) - - ! Make attributes > 500 bytes shared - CALL H5Pset_shared_mesg_index_f(my_fcpl, 0, H5O_SHMESG_ATTR_FLAG_F, 500,error) - ! Make datatypes & dataspaces > 1 byte shared (i.e. all of them :-) - CALL H5Pset_shared_mesg_index_f(my_fcpl, 1, H5O_SHMESG_DTYPE_FLAG_F, 1,error) - CALL H5Pset_shared_mesg_index_f(my_fcpl, 2, H5O_SHMESG_SDSPACE_FLAG_F, 1,error) - ENDIF - - ! Create file - CALL h5fcreate_f(FileName, H5F_ACC_TRUNC_F, fid, error, my_fcpl, fapl) - CALL check("h5fcreate_f",error,total_error) - - ! Close FCPL copy - CALL h5pclose_f(my_fcpl, error) - CALL check("h5pclose_f", error, total_error) - ! Close file - CALL h5fclose_f(fid, error) - CALL check("h5fclose_f",error,total_error) - - ! Re-open file - CALL h5fopen_f(FileName, H5F_ACC_RDWR_F, fid, error,fapl) - CALL check("h5open_f",error,total_error) - - ! Commit datatype to file - IF(test_shared.EQ.2) THEN - CALL H5Tcommit_f(fid, TYPE1_NAME, attr_tid, error, H5P_DEFAULT_F, H5P_DEFAULT_F, H5P_DEFAULT_F) - CALL check("H5Tcommit",error,total_error) - ENDIF - - ! Set up to query the object creation properties - CALL H5Pcreate_f(H5P_DATASET_CREATE_F,dcpl,error) - CALL check("h5Pcreate_f",error,total_error) - - ! Create datasets - CALL h5dcreate_f(fid, DSET1_NAME, H5T_NATIVE_CHARACTER, sid, dataset, error, dcpl_id=dcpl ) - CALL check("h5dcreate_f",error,total_error) - CALL h5dcreate_f(fid, DSET2_NAME, H5T_NATIVE_CHARACTER, sid, dataset2, error, dcpl_id=dcpl ) - CALL check("h5dcreate_f",error,total_error) - - ! Retrieve limits for compact/dense attribute storage - CALL H5Pget_attr_phase_change_f(dcpl, max_compact, min_dense, error) - CALL check("H5Pget_attr_phase_change_f",error,total_error) - - ! Close property list - CALL h5pclose_f(dcpl,error) - CALL check("h5pclose_f", error, total_error) - - ! Add attributes to each dataset, until after converting to dense storage - DO u = 0, (max_compact * 2) - 1 - - ! Create attribute name - WRITE(chr2,'(I2.2)') u - attrname = 'attr '//chr2 - - ! Alternate between creating "small" & "big" attributes - - IF(MOD(u+1,2).EQ.0)THEN - ! Create "small" attribute on first dataset - - CALL h5acreate_f(dataset, attrname, attr_tid, sid, attr, error, H5P_DEFAULT_F, H5P_DEFAULT_F) - CALL check("h5acreate_f",error,total_error) - - ! Write data into the attribute - attr_integer_data(1) = u + 1 - data_dims(1) = 1 - CALL h5awrite_f(attr, attr_tid, attr_integer_data, data_dims, error) - CALL check("h5awrite_f",error,total_error) - ELSE - ! Create "big" attribute on first dataset - - CALL h5acreate_f(dataset, attrname, attr_tid, big_sid, attr, error, H5P_DEFAULT_F, H5P_DEFAULT_F) - CALL check("h5acreate_f",error,total_error) - - ! Write data into the attribute - - data_dims(1) = 1 - attr_integer_data(1) = u + 1 - CALL h5awrite_f(attr, attr_tid, attr_integer_data, data_dims, error) - CALL check("h5awrite_f",error,total_error) - - ENDIF - - ! Close attribute - CALL h5aclose_f(attr, error) - CALL check("h5aclose_f",error,total_error) - - ! Alternate between creating "small" & "big" attributes - IF(MOD(u+1,2).EQ.0)THEN - - ! Create "small" attribute on second dataset - - CALL h5acreate_f(dataset2, attrname, attr_tid, sid, attr, error, H5P_DEFAULT_F, H5P_DEFAULT_F) - CALL check("h5acreate_f",error,total_error) - - ! Write data into the attribute - - attr_integer_data(1) = u + 1 - data_dims(1) = 1 - CALL h5awrite_f(attr, attr_tid, attr_integer_data, data_dims, error) - CALL check("h5awrite_f",error,total_error) - ELSE - - ! Create "big" attribute on second dataset - - CALL h5acreate_f(dataset2, attrname, attr_tid, big_sid, attr, error, H5P_DEFAULT_F, H5P_DEFAULT_F) - CALL check("h5acreate_f",error,total_error) - -! Write data into the attribute - - - attr_integer_data(1) = u + 1 - data_dims(1) = 1 -! CALL h5awrite_f(attr, attr_tid, attr_integer_data, data_dims, error) -! CALL check("h5awrite_f",error,total_error) - - -! Check refcount for attribute - ENDIF - ! Close attribute - CALL h5aclose_f(attr, error) - CALL check("h5aclose_f",error,total_error) - - ! Create new attribute name - - WRITE(chr2,'(I2.2)') u - attrname2 = 'new attr '//chr2 - - - ! Change second dataset's attribute's name - - CALL H5Arename_by_name_f(fid, DSET2_NAME, attrname, attrname2, error, lapl_id=H5P_DEFAULT_F) - CALL check("H5Arename_by_name_f",error,total_error) - - ! Check refcount on attributes now - - ! Check refcount on renamed attribute - - CALL H5Aopen_f(dataset2, attrname2, attr, error, aapl_id=H5P_DEFAULT_F) - CALL check("H5Aopen_f",error,total_error) - - ! Close attribute - CALL h5aclose_f(attr, error) - CALL check("h5aclose_f",error,total_error) - - ! Check refcount on original attribute - CALL H5Aopen_f(dataset, attrname, attr, error) - CALL check("H5Aopen",error,total_error) - - ! Close attribute - CALL h5aclose_f(attr, error) - CALL check("h5aclose_f",error,total_error) - - - ! Change second dataset's attribute's name back to original - - CALL H5Arename_by_name_f(fid, DSET2_NAME, attrname2, attrname, error) - CALL check("H5Arename_by_name_f",error,total_error) - - ! Check refcount on attributes now - - ! Check refcount on renamed attribute - CALL H5Aopen_f(dataset2, attrname, attr, error) - CALL check("H5Aopen",error,total_error) - - ! Close attribute - CALL h5aclose_f(attr, error) - CALL check("h5aclose_f",error,total_error) - - ! Check refcount on original attribute - - ! Check refcount on renamed attribute - CALL H5Aopen_f(dataset, attrname, attr, error) - CALL check("H5Aopen",error,total_error) - - ! Close attribute - CALL h5aclose_f(attr, error) - CALL check("h5aclose_f",error,total_error) - - ENDDO - - ! Close attribute's datatype - CALL h5tclose_f(attr_tid, error) - CALL check("h5tclose_f",error,total_error) - - ! Close attribute's datatype - CALL h5dclose_f(dataset, error) - CALL check("h5dclose_f",error,total_error) - CALL h5dclose_f(dataset2, error) - CALL check("h5dclose_f",error,total_error) - - - ! Unlink datasets with attributes - CALL H5Ldelete_f(fid, DSET1_NAME, error, H5P_DEFAULT_F) - CALL check("HLdelete",error,total_error) - CALL H5Ldelete_f(fid, DSET2_NAME, error) - CALL check("HLdelete",error,total_error) - - ! Unlink committed datatype - IF(test_shared == 2)THEN - CALL H5Ldelete_f(fid, TYPE1_NAME, error) - CALL check("HLdelete_f",error,total_error) - ENDIF - - ! Close file - CALL h5fclose_f(fid, error) - CALL check("h5fclose_f",error,total_error) - - ! Check size of file - !filesize = h5_get_file_size(FILENAME); - !verify(filesize, empty_filesize, "h5_get_file_size"); - ENDDO - - ! Close dataspaces - CALL h5sclose_f(sid, error) - CALL check("h5sclose_f",error,total_error) - CALL h5sclose_f(big_sid, error) - CALL check("h5sclose_f",error,total_error) - -END SUBROUTINE test_attr_shared_rename - - -SUBROUTINE test_attr_delete_by_idx(new_format, fcpl, fapl, total_error) - -!*************************************************************** -!** -!** test_attr_delete_by_idx(): Test basic H5A (attribute) code. -!** Tests deleting attribute by index -!** -!*************************************************************** - - IMPLICIT NONE - - LOGICAL, INTENT(IN) :: new_format - INTEGER(HID_T), INTENT(IN) :: fcpl - INTEGER(HID_T), INTENT(IN) :: fapl - INTEGER, INTENT(INOUT) :: total_error - CHARACTER(LEN=8) :: FileName = "tattr.h5" - INTEGER(HID_T) :: fid ! HDF5 File ID - INTEGER(HID_T) :: dcpl ! Dataset creation property list ID - INTEGER(HID_T) :: sid ! Dataspace ID - - CHARACTER(LEN=8) :: DSET1_NAME = "Dataset1" - CHARACTER(LEN=8) :: DSET2_NAME = "Dataset2" - CHARACTER(LEN=8) :: DSET3_NAME = "Dataset3" - INTEGER, PARAMETER :: NUM_DSETS = 3 - - INTEGER :: curr_dset - - INTEGER(HID_T) :: dset1, dset2, dset3 - INTEGER(HID_T) :: my_dataset - - INTEGER :: error - - INTEGER(HID_T) :: attr !String Attribute identifier - INTEGER(HSIZE_T), DIMENSION(7) :: data_dims - - LOGICAL :: f_corder_valid ! Indicates whether the the creation order data is valid for this attribute - INTEGER :: corder ! Is a positive integer containing the creation order of the attribute - INTEGER :: cset ! Indicates the character set used for the attribute’s name - INTEGER(HSIZE_T) :: data_size ! indicates the size, in the number of characters - LOGICAL, DIMENSION(1:2) :: use_index = (/.FALSE.,.TRUE./) - - INTEGER :: max_compact ! Maximum # of links to store in group compactly - INTEGER :: min_dense ! Minimum # of links to store in group "densely" - - CHARACTER(LEN=2) :: chr2 - - INTEGER :: i - - INTEGER, DIMENSION(1) :: attr_integer_data - CHARACTER(LEN=7) :: attrname - - INTEGER(SIZE_T) :: size - CHARACTER(LEN=8) :: tmpname - - INTEGER :: idx_type - INTEGER :: order - INTEGER :: u ! Local index variable - INTEGER :: Input1 - INTEGER(HSIZE_T) :: hzero = 0_HSIZE_T - INTEGER :: minusone = -1 - - data_dims = 0 - - ! Create dataspace for dataset & attributes - CALL h5screate_f(H5S_SCALAR_F, sid, error) - CALL check("h5screate_f",error,total_error) - - ! Create dataset creation property list - CALL H5Pcreate_f(H5P_DATASET_CREATE_F,dcpl,error) - CALL check("h5Pcreate_f",error,total_error) - - ! Query the attribute creation properties - CALL H5Pget_attr_phase_change_f(dcpl, max_compact, min_dense, error) - CALL check("H5Pget_attr_phase_change_f",error,total_error) - - - ! Loop over operating on different indices on link fields - DO idx_type = H5_INDEX_NAME_F, H5_INDEX_CRT_ORDER_F - - ! Loop over operating in different orders - DO order = H5_ITER_INC_F, H5_ITER_DEC_F - - ! Loop over using index for creation order value - DO i = 1, 2 - - ! Create file - CALL h5fcreate_f(FileName, H5F_ACC_TRUNC_F, fid, error, fcpl, fapl) - CALL check("h5fcreate_f",error,total_error) - - ! Set attribute creation order tracking & indexing for object - IF(new_format)THEN - - IF(use_index(i))THEN - Input1 = H5P_CRT_ORDER_INDEXED_F - ELSE - Input1 = 0 - ENDIF - - CALL H5Pset_attr_creation_order_f(dcpl, IOR(H5P_CRT_ORDER_TRACKED_F, Input1), error) - CALL check("H5Pset_attr_creation_order",error,total_error) - - ENDIF - - ! Create datasets - - CALL h5dcreate_f(fid, DSET1_NAME, H5T_NATIVE_CHARACTER, sid, dset1, error, dcpl ) - CALL check("h5dcreate_f2",error,total_error) - - CALL h5dcreate_f(fid, DSET2_NAME, H5T_NATIVE_CHARACTER, sid, dset2, error, dcpl ) - CALL check("h5dcreate_f3",error,total_error) - - CALL h5dcreate_f(fid, DSET3_NAME, H5T_NATIVE_CHARACTER, sid, dset3, error, dcpl ) - CALL check("h5dcreate_f4",error,total_error) - - ! Work on all the datasets - - DO curr_dset = 0,NUM_DSETS-1 - SELECT CASE (curr_dset) - CASE (0) - my_dataset = dset1 - CASE (1) - my_dataset = dset2 - CASE (2) - my_dataset = dset3 - ! CASE DEFAULT - ! CALL HDassert(0.AND."Toomanydatasets!") - END SELECT - - - ! Check for deleting non-existant attribute -!EP CALL H5Adelete_by_idx_f(my_dataset, '.', idx_type, order, 0_HSIZE_T,error, lapl_id=H5P_DEFAULT_F) - CALL H5Adelete_by_idx_f(my_dataset, '.', idx_type, order, hzero,error, lapl_id=H5P_DEFAULT_F) - CALL verify("H5Adelete_by_idx_f",error,minusone,total_error) - - ! Create attributes, up to limit of compact form - DO u = 0, max_compact - 1 - ! Create attribute - WRITE(chr2,'(I2.2)') u - attrname = 'attr '//chr2 - - CALL h5acreate_f(my_dataset, attrname, H5T_NATIVE_INTEGER, sid, attr, error, H5P_DEFAULT_F, H5P_DEFAULT_F) - CALL check("h5acreate_f",error,total_error) - - ! Write data into the attribute - attr_integer_data(1) = u - data_dims(1) = 1 - CALL h5awrite_f(attr, H5T_NATIVE_INTEGER, attr_integer_data, data_dims, error) - CALL check("h5awrite_f",error,total_error) - - ! Close attribute - CALL h5aclose_f(attr, error) - CALL check("h5aclose_f",error,total_error) - - ! Verify information for new attribute - CALL attr_info_by_idx_check(my_dataset, attrname, INT(u,HSIZE_T), use_index(i), total_error ) - - ENDDO - - ! Check for out of bound deletions - CALL H5Adelete_by_idx_f(my_dataset, ".", idx_type, order, INT(u,HSIZE_T), error, lapl_id=H5P_DEFAULT_F) - CALL verify("H5Adelete_by_idx_f",error,minusone,total_error) - - ENDDO - - - DO curr_dset = 0, NUM_DSETS-1 - SELECT CASE (curr_dset) - CASE (0) - my_dataset = dset1 - CASE (1) - my_dataset = dset2 - CASE (2) - my_dataset = dset3 - ! CASE DEFAULT - ! CALL HDassert(0.AND."Toomanydatasets!") - END SELECT - - ! Delete attributes from compact storage - - DO u = 0, max_compact - 2 - - ! Delete first attribute in appropriate order - - -!EP CALL H5Adelete_by_idx_f(my_dataset, ".", idx_type, order, 0_HSIZE_T, error) - CALL H5Adelete_by_idx_f(my_dataset, ".", idx_type, order, hzero, error) - CALL check("H5Adelete_by_idx_f",error,total_error) - - - ! Verify the attribute information for first attribute in appropriate order - ! HDmemset(&ainfo, 0, sizeof(ainfo)); - -!EP CALL h5aget_info_by_idx_f(my_dataset, ".", idx_type, order, 0_HSIZE_T, & - CALL h5aget_info_by_idx_f(my_dataset, ".", idx_type, order, hzero, & - f_corder_valid, corder, cset, data_size, error) - - IF(new_format)THEN - IF(order.EQ.H5_ITER_INC_F)THEN - CALL verify("H5Aget_info_by_idx_f",corder,u + 1,total_error) - ENDIF - ELSE - CALL verify("H5Aget_info_by_idx_f",corder, max_compact-(u + 2),total_error) - ENDIF - - ! Verify the name for first attribute in appropriate order - - size = 7 ! *CHECK* IF NOT THE SAME SIZE - CALL h5aget_name_by_idx_f(my_dataset, ".", idx_type, order,INT(0,hsize_t), & - tmpname, error, lapl_id=H5P_DEFAULT_F, size=size) - CALL check('h5aget_name_by_idx_f',error,total_error) - IF(order .EQ. H5_ITER_INC_F)THEN - WRITE(chr2,'(I2.2)') u + 1 - attrname = 'attr '//chr2 - ELSE - WRITE(chr2,'(I2.2)') max_compact - (u + 2) - attrname = 'attr '//chr2 - ENDIF - IF(TRIM(attrname).NE.TRIM(tmpname)) error = -1 - CALL verify("h5aget_name_by_idx_f",error,0,total_error) - ENDDO - - ! Delete last attribute - -!EP CALL H5Adelete_by_idx_f(my_dataset, ".", idx_type, order, 0_HSIZE_T, error) - CALL H5Adelete_by_idx_f(my_dataset, ".", idx_type, order, hzero, error) - CALL check("H5Adelete_by_idx_f",error,total_error) - - ENDDO - -! Work on all the datasets - - DO curr_dset = 0,NUM_DSETS-1 - SELECT CASE (curr_dset) - CASE (0) - my_dataset = dset1 - CASE (1) - my_dataset = dset2 - CASE (2) - my_dataset = dset3 - ! CASE DEFAULT - ! CALL HDassert(0.AND."Toomanydatasets!") - END SELECT - - ! Create more attributes, to push into dense form - - DO u = 0, (max_compact * 2) - 1 - - ! Create attribute - WRITE(chr2,'(I2.2)') u - attrname = 'attr '//chr2 - - CALL h5acreate_f(my_dataset, attrname, H5T_NATIVE_INTEGER, sid, attr, error, H5P_DEFAULT_F, H5P_DEFAULT_F) - CALL check("h5acreate_f",error,total_error) - - - ! Write data into the attribute - attr_integer_data(1) = u - data_dims(1) = 1 - CALL h5awrite_f(attr, H5T_NATIVE_INTEGER, attr_integer_data, data_dims, error) - CALL check("h5awrite_f",error,total_error) - - ! Close attribute - CALL h5aclose_f(attr, error) - CALL check("h5aclose_f",error,total_error) - - - ENDDO - ! Check for out of bound deletion - CALL H5Adelete_by_idx_f(my_dataset, ".", idx_type, order, INT(u,HSIZE_T), error) - CALL verify("H5Adelete_by_idx_f",error,minusone,total_error) - ENDDO - - ! Work on all the datasets - - DO curr_dset = 0,NUM_DSETS-1 - SELECT CASE (curr_dset) - CASE (0) - my_dataset = dset1 - CASE (1) - my_dataset = dset2 - CASE (2) - my_dataset = dset3 - END SELECT - - ! Delete attributes from dense storage - - DO u = 0, (max_compact * 2) - 1 - 1 - - ! Delete first attribute in appropriate order - - CALL H5Adelete_by_idx_f(my_dataset, ".", idx_type, order, INT(0,HSIZE_T), error) - CALL check("H5Adelete_by_idx_f",error,total_error) - ! Verify the attribute information for first attribute in appropriate order - - CALL h5aget_info_by_idx_f(my_dataset, ".", idx_type, order, INT(0,HSIZE_T), & - f_corder_valid, corder, cset, data_size, error) - IF(new_format)THEN - IF(order.EQ.H5_ITER_INC_F)THEN - CALL verify("H5Aget_info_by_idx_f",corder,u + 1,total_error) - ENDIF - ELSE - CALL verify("H5Aget_info_by_idx_f",corder, ((max_compact * 2) - (u + 2)), total_error) - ENDIF - - ! Verify the name for first attribute in appropriate order - ! HDmemset(tmpname, 0, (size_t)NAME_BUF_SIZE); - - size = 7 ! *CHECK* if not the correct size - CALL h5aget_name_by_idx_f(my_dataset, ".", idx_type, order,INT(0,hsize_t), & - tmpname, error, size) - - IF(order .EQ. H5_ITER_INC_F)THEN - WRITE(chr2,'(I2.2)') u + 1 - attrname = 'attr '//chr2 - ELSE - WRITE(chr2,'(I2.2)') max_compact * 2 - (u + 2) - attrname = 'attr '//chr2 - ENDIF - IF(TRIM(attrname).NE.TRIM(tmpname)) error = -1 - CALL verify("h5aget_name_by_idx_f",error,0,total_error) - - - ENDDO - ! Delete last attribute - - CALL H5Adelete_by_idx_f(my_dataset, ".", idx_type, order, INT(0,HSIZE_T), error, lapl_id=H5P_DEFAULT_F) - CALL check("H5Adelete_by_idx_f",error,total_error) - - ! Check for deletion on empty attribute storage again - CALL H5Adelete_by_idx_f(my_dataset, ".", idx_type, order, INT(0,HSIZE_T), error) - CALL verify("H5Adelete_by_idx_f",error,minusone,total_error) - ENDDO - - ! Close Datasets - CALL h5dclose_f(dset1, error) - CALL check("h5dclose_f",error,total_error) - CALL h5dclose_f(dset2, error) - CALL check("h5dclose_f",error,total_error) - CALL h5dclose_f(dset3, error) - CALL check("h5dclose_f",error,total_error) - - ! Close file - CALL h5fclose_f(fid, error) - CALL check("h5fclose_f",error,total_error) - ENDDO - ENDDO - ENDDO - - ! Close property list - CALL h5pclose_f(dcpl,error) - CALL check("h5pclose_f", error, total_error) - - ! Close dataspace - CALL h5sclose_f(sid, error) - CALL check("h5sclose_f",error,total_error) - -END SUBROUTINE test_attr_delete_by_idx - -SUBROUTINE test_attr_shared_delete(fcpl, fapl, total_error) - -!*************************************************************** -!** -!** test_attr_shared_delete(): Test basic H5A (attribute) code. -!** Tests deleting shared attributes in "compact" & "dense" storage -!** -!*************************************************************** - - IMPLICIT NONE - - INTEGER(HID_T), INTENT(IN) :: fcpl - INTEGER(HID_T), INTENT(IN) :: fapl - INTEGER, INTENT(INOUT) :: total_error - CHARACTER(LEN=8) :: FileName = "tattr.h5" - INTEGER(HID_T) :: fid - INTEGER(HID_T) :: dcpl - INTEGER(HID_T) :: sid, big_sid - - CHARACTER(LEN=8) :: DSET1_NAME = "Dataset1" - CHARACTER(LEN=8) :: DSET2_NAME = "Dataset2" - - - INTEGER(HID_T) :: dataset, dataset2 - - INTEGER :: error - - INTEGER(HID_T) :: attr !String Attribute identifier - INTEGER(HID_T) :: attr_tid - INTEGER(HSIZE_T), DIMENSION(7) :: data_dims - - - INTEGER :: max_compact ! Maximum # of links to store in group compactly - INTEGER :: min_dense ! Minimum # of links to store in group "densely" - - CHARACTER(LEN=2) :: chr2 - - INTEGER, DIMENSION(1) :: attr_integer_data - CHARACTER(LEN=7) :: attrname - - INTEGER :: u - INTEGER(HID_T) :: my_fcpl - - CHARACTER(LEN=5), PARAMETER :: TYPE1_NAME = "/Type" - - INTEGER :: test_shared - INTEGER(HSIZE_T), DIMENSION(1) :: adims2 = (/1/) ! Attribute dimension - INTEGER :: arank = 1 ! Attribure rank - - ! Output message about test being performed - - ! Initialize "big" attribute DATA - ! Create dataspace for dataset - CALL h5screate_f(H5S_SCALAR_F, sid, error) - CALL check("h5screate_f",error,total_error) - - ! Create "big" dataspace for "large" attributes - - CALL h5screate_simple_f(arank, adims2, big_sid, error) - CALL check("h5screate_simple_f",error,total_error) - - ! Loop over type of shared components - - DO test_shared = 0, 2 - - ! Make copy of file creation property list - - CALL H5Pcopy_f(fcpl, my_fcpl, error) - CALL check("H5Pcopy",error,total_error) - - ! Set up datatype for attributes - - CALL H5Tcopy_f(H5T_NATIVE_INTEGER, attr_tid, error) - CALL check("H5Tcopy",error,total_error) - - ! Special setup for each type of shared components - IF( test_shared .EQ. 0) THEN - ! Make attributes > 500 bytes shared - CALL H5Pset_shared_mesg_nindexes_f(my_fcpl,1,error) - CALL check("H5Pset_shared_mesg_nindexes_f",error, total_error) - CALL H5Pset_shared_mesg_index_f(my_fcpl, 0, H5O_SHMESG_ATTR_FLAG_F, 500,error) - CALL check(" H5Pset_shared_mesg_index_f",error, total_error) - - ELSE - ! Set up copy of file creation property list - CALL H5Pset_shared_mesg_nindexes_f(my_fcpl,3,error) - ! Make attributes > 500 bytes shared - CALL H5Pset_shared_mesg_index_f(my_fcpl, 0, H5O_SHMESG_ATTR_FLAG_F, 500,error) - ! Make datatypes & dataspaces > 1 byte shared (i.e. all of them :-) - CALL H5Pset_shared_mesg_index_f(my_fcpl, 1, H5O_SHMESG_DTYPE_FLAG_F, 1,error) - CALL H5Pset_shared_mesg_index_f(my_fcpl, 2, H5O_SHMESG_SDSPACE_FLAG_F, 1,error) - ENDIF - - ! Create file - CALL h5fcreate_f(FileName, H5F_ACC_TRUNC_F, fid, error, my_fcpl, fapl) - CALL check("h5fcreate_f",error,total_error) - - ! Close FCPL copy - CALL h5pclose_f(my_fcpl, error) - CALL check("h5pclose_f", error, total_error) - ! Close file - CALL h5fclose_f(fid, error) - CALL check("h5fclose_f",error,total_error) - - ! Re-open file - CALL h5fopen_f(FileName, H5F_ACC_RDWR_F, fid, error,fapl) - CALL check("h5open_f",error,total_error) - - ! Commit datatype to file - - IF(test_shared.EQ.2) THEN - CALL H5Tcommit_f(fid, TYPE1_NAME, attr_tid, error, H5P_DEFAULT_F, H5P_DEFAULT_F, H5P_DEFAULT_F) - CALL check("H5Tcommit",error,total_error) - ENDIF - - ! Set up to query the object creation properties - CALL H5Pcreate_f(H5P_DATASET_CREATE_F,dcpl,error) - CALL check("h5Pcreate_f",error,total_error) - - ! Create datasets - - CALL h5dcreate_f(fid, DSET1_NAME, H5T_NATIVE_CHARACTER, sid, dataset, error, dcpl_id=dcpl ) - CALL check("h5dcreate_f",error,total_error) - - CALL h5dcreate_f(fid, DSET2_NAME, H5T_NATIVE_CHARACTER, sid, dataset2, error, dcpl_id=dcpl ) - CALL check("h5dcreate_f",error,total_error) - - ! Retrieve limits for compact/dense attribute storage - CALL H5Pget_attr_phase_change_f(dcpl, max_compact, min_dense, error) - CALL check("H5Pget_attr_phase_change_f",error,total_error) - - ! Close property list - CALL h5pclose_f(dcpl,error) - CALL check("h5pclose_f", error, total_error) - - ! Add attributes to each dataset, until after converting to dense storage - - DO u = 0, (max_compact * 2) - 1 - - ! Create attribute name - WRITE(chr2,'(I2.2)') u - attrname = 'attr '//chr2 - - ! Alternate between creating "small" & "big" attributes - - IF(MOD(u+1,2).EQ.0)THEN - ! Create "small" attribute on first dataset - - CALL h5acreate_f(dataset, attrname, attr_tid, sid, attr, error, H5P_DEFAULT_F, H5P_DEFAULT_F) - CALL check("h5acreate_f",error,total_error) - - ! Write data into the attribute - attr_integer_data(1) = u + 1 - data_dims(1) = 1 - CALL h5awrite_f(attr, attr_tid, attr_integer_data, data_dims, error) - CALL check("h5awrite_f",error,total_error) - ELSE - ! Create "big" attribute on first dataset - - CALL h5acreate_f(dataset, attrname, attr_tid, big_sid, attr, error) - CALL check("h5acreate_f",error,total_error) - - ! Write data into the attribute - - attr_integer_data(1) = u + 1 - data_dims(1) = 1 - CALL h5awrite_f(attr, attr_tid, attr_integer_data, data_dims, error) - CALL check("h5awrite_f",error,total_error) - - ENDIF - - ! Close attribute - CALL h5aclose_f(attr, error) - CALL check("h5aclose_f",error,total_error) - - ! Alternate between creating "small" & "big" attributes - IF(MOD(u+1,2).EQ.0)THEN - - ! Create "small" attribute on second dataset - - CALL h5acreate_f(dataset2, attrname, attr_tid, sid, attr, error) - CALL check("h5acreate_f",error,total_error) - - ! Write data into the attribute - attr_integer_data(1) = u + 1 - data_dims(1) = 1 - CALL h5awrite_f(attr, attr_tid, attr_integer_data, data_dims, error) - CALL check("h5awrite_f",error,total_error) - ELSE - - ! Create "big" attribute on second dataset - - CALL h5acreate_f(dataset2, attrname, attr_tid, big_sid, attr, error, acpl_id=H5P_DEFAULT_F, aapl_id=H5P_DEFAULT_F) - CALL check("h5acreate_f",error,total_error) - -! Write data into the attribute - - - attr_integer_data(1) = u + 1 - data_dims(1) = 1 - CALL h5awrite_f(attr, attr_tid, attr_integer_data, data_dims, error) - CALL check("h5awrite_f",error,total_error) - - ENDIF - ! Close attribute - CALL h5aclose_f(attr, error) - CALL check("h5aclose_f",error,total_error) - - ENDDO - - ! Delete attributes from second dataset - - DO u = 0, max_compact*2-1 - - ! Create attribute name - WRITE(chr2,'(I2.2)') u - attrname = 'attr '//chr2 - - ! Delete second dataset's attribute - CALL H5Adelete_by_name_f(fid, DSET2_NAME, attrname,error,lapl_id=H5P_DEFAULT_F) - CALL check("H5Adelete_by_name", error, total_error) - - CALL h5aopen_f(dataset, attrname, attr, error, aapl_id=H5P_DEFAULT_F) - CALL check("h5aopen_f",error,total_error) - - - ! Close attribute - CALL h5aclose_f(attr, error) - CALL check("h5aclose_f",error,total_error) - ENDDO - - ! Close attribute's datatype - - CALL h5tclose_f(attr_tid, error) - CALL check("h5tclose_f",error,total_error) - - ! Close Datasets - - CALL h5dclose_f(dataset, error) - CALL check("h5dclose_f",error,total_error) - CALL h5dclose_f(dataset2, error) - CALL check("h5dclose_f",error,total_error) - - ! Unlink datasets WITH attributes - - CALL h5ldelete_f(fid, DSET1_NAME, error, H5P_DEFAULT_F) - CALL check("H5Ldelete_f", error, total_error) - CALL h5ldelete_f(fid, DSET2_NAME, error) - CALL check("H5Ldelete_f", error, total_error) - - ! Unlink committed datatype - - IF( test_shared == 2) THEN - CALL h5ldelete_f(fid, TYPE1_NAME, error) - CALL check("H5Ldelete_f", error, total_error) - ENDIF - - - ! Close file - CALL h5fclose_f(fid, error) - CALL check("h5fclose_f",error,total_error) - - ENDDO - - ! Close dataspaces - CALL h5sclose_f(sid, error) - CALL check("h5sclose_f",error,total_error) - CALL h5sclose_f(big_sid, error) - CALL check("h5sclose_f",error,total_error) - -END SUBROUTINE test_attr_shared_delete - - - -SUBROUTINE test_attr_dense_open( fcpl, fapl, total_error) - -!*************************************************************** -!** -!** test_attr_dense_open(): Test basic H5A (attribute) code. -!** Tests opening attributes in "dense" storage -!** -!*************************************************************** - - IMPLICIT NONE - - INTEGER(HID_T), INTENT(IN) :: fcpl - INTEGER(HID_T), INTENT(IN) :: fapl - INTEGER, INTENT(INOUT) :: total_error - CHARACTER(LEN=8) :: FileName = "tattr.h5" - INTEGER(HID_T) :: fid - INTEGER(HID_T) :: dcpl - INTEGER(HID_T) :: sid - - CHARACTER(LEN=8) :: DSET1_NAME = "Dataset1" - - INTEGER :: error - INTEGER(HID_T) :: attr !String Attribute identifier - INTEGER(HSIZE_T), DIMENSION(7) :: data_dims - - - INTEGER :: max_compact ! Maximum # of links to store in group compactly - INTEGER :: min_dense ! Minimum # of links to store in group "densely" - - CHARACTER(LEN=2) :: chr2 - - - CHARACTER(LEN=7) :: attrname - - INTEGER(HID_T) :: dataset - INTEGER :: u - - data_dims = 0 - - - ! Create file - - CALL h5fcreate_f(FileName, H5F_ACC_TRUNC_F, fid, error, fcpl, fapl) - CALL check("h5fcreate_f",error,total_error) - - ! Close file - CALL h5fclose_f(fid, error) - CALL check("h5fclose_f",error,total_error) - - - - ! Re-open file - CALL h5fopen_f(FileName, H5F_ACC_RDWR_F, fid, error, fapl) - CALL check("h5open_f",error,total_error) - - ! Create dataspace for dataset - CALL h5screate_f(H5S_SCALAR_F, sid, error) - CALL check("h5screate_f",error,total_error) - - ! Query the group creation properties - CALL H5Pcreate_f(H5P_DATASET_CREATE_F,dcpl,error) - CALL check("h5Pcreate_f",error,total_error) - - ! Enable creation order tracking on attributes, so creation order tests work - CALL H5Pset_attr_creation_order_f(dcpl, H5P_CRT_ORDER_TRACKED_F, error) - CALL check("H5Pset_attr_creation_order",error,total_error) - - ! Create a dataset - - CALL h5dcreate_f(fid, DSET1_NAME, H5T_NATIVE_CHARACTER, sid, dataset, error, & - lcpl_id=H5P_DEFAULT_F, dcpl_id=dcpl, dapl_id=H5P_DEFAULT_F) - CALL check("h5dcreate_f",error,total_error) - - ! Retrieve limits for compact/dense attribute storage - CALL H5Pget_attr_phase_change_f(dcpl, max_compact, min_dense, error) - CALL check("H5Pget_attr_phase_change_f",error,total_error) - - ! Close property list - CALL h5pclose_f(dcpl, error) - CALL check("h5pclose_f",error,total_error) - - ! Add attributes, until just before converting to dense storage - - DO u = 0, max_compact - 1 - ! Create attribute - WRITE(chr2,'(I2.2)') u - attrname = 'attr '//chr2 - - CALL h5acreate_f(dataset, attrname, H5T_NATIVE_INTEGER, sid, attr, error, aapl_id=H5P_DEFAULT_F) - CALL check("h5acreate_f",error,total_error) - - ! Write data into the attribute - - data_dims(1) = 1 - CALL h5awrite_f(attr, H5T_NATIVE_INTEGER, u, data_dims, error) - CALL check("h5awrite_f",error,total_error) - - ! Close attribute - CALL h5aclose_f(attr, error) - CALL check("h5aclose_f",error,total_error) - - ! Verify attributes written so far - CALL test_attr_dense_verify(dataset, u, total_error) - ENDDO -! -! Add one more attribute, to push into "dense" storage -! Create attribute - - WRITE(chr2,'(I2.2)') u - attrname = 'attr '//chr2 - - CALL h5acreate_f(dataset, attrname, H5T_NATIVE_INTEGER, sid, attr, error, aapl_id=H5P_DEFAULT_F) - CALL check("h5acreate_f",error,total_error) - - ! Write data into the attribute - data_dims(1) = 1 - CALL h5awrite_f(attr, H5T_NATIVE_INTEGER, u, data_dims, error) - CALL check("h5awrite_f",error,total_error) - - ! Close attribute - CALL h5aclose_f(attr, error) - CALL check("h5aclose_f",error,total_error) - - ! Close dataspace - CALL h5sclose_f(sid, error) - CALL check("h5sclose_f",error,total_error) - - ! Verify all the attributes written - ! ret = test_attr_dense_verify(dataset, (u + 1)); - ! CHECK(ret, FAIL, "test_attr_dense_verify"); - - ! CLOSE Dataset - CALL h5dclose_f(dataset, error) - CALL check("h5dclose_f",error,total_error) - - ! Unlink dataset with attributes - CALL h5ldelete_f(fid, DSET1_NAME, error, H5P_DEFAULT_F) - CALL check("H5Ldelete_f", error, total_error) - - ! Close file - CALL h5fclose_f(fid, error) - CALL check("h5fclose_f",error,total_error) - - ! Check size of file - ! filesize = h5_get_file_size(FILENAME); - ! verify(filesize, empty_filesize, "h5_get_file_size") - -END SUBROUTINE test_attr_dense_open - -!*************************************************************** -!** -!** test_attr_dense_verify(): Test basic H5A (attribute) code. -!** Verify attributes on object -!** -!*************************************************************** - -SUBROUTINE test_attr_dense_verify(loc_id, max_attr, total_error) - - IMPLICIT NONE - - INTEGER(HID_T), INTENT(IN) :: loc_id - INTEGER, INTENT(IN) :: max_attr - INTEGER, INTENT(INOUT) :: total_error - - INTEGER(SIZE_T), PARAMETER :: ATTR_NAME_LEN = 8 ! FIX, why if 7 does not work? - - INTEGER :: u - CHARACTER(LEN=2) :: chr2 - CHARACTER(LEN=ATTR_NAME_LEN) :: attrname - CHARACTER(LEN=ATTR_NAME_LEN) :: check_name - INTEGER(HSIZE_T), DIMENSION(7) :: data_dims - - INTEGER(HID_T) :: attr !String Attribute identifier - INTEGER :: error - INTEGER :: value - - data_dims = 0 - - - ! Retrieve the current # of reported errors - ! old_nerrs = GetTestNumErrs(); - - ! Re-open all the attributes by name and verify the data - - DO u = 0, max_attr -1 - - ! Open attribute - WRITE(chr2,'(I2.2)') u - attrname = 'attr '//chr2 - - CALL h5aopen_f(loc_id, attrname, attr, error) - CALL check("h5aopen_f",error,total_error) - - ! Read data from the attribute - -! value = 103 - data_dims(1) = 1 - CALL h5aread_f(attr, H5T_NATIVE_INTEGER, value, data_dims, error) - - CALL CHECK("H5Aread_F", error, total_error) - CALL verify("H5Aread_F", value, u, total_error) - - ! Close attribute - CALL h5aclose_f(attr, error) - CALL check("h5aclose_f",error,total_error) - ENDDO - - ! Re-open all the attributes by index and verify the data - - DO u=0, max_attr-1 - - - ! Open attribute - - CALL H5Aopen_by_idx_f(loc_id, ".", H5_INDEX_CRT_ORDER_F, H5_ITER_INC_F, INT(u,HSIZE_T), & - attr, error, aapl_id=H5P_DEFAULT_F) - - ! Verify Name - - WRITE(chr2,'(I2.2)') u - attrname = 'attr '//chr2 - - CALL H5Aget_name_f(attr, ATTR_NAME_LEN, check_name, error) - CALL check('H5Aget_name',error,total_error) - IF(check_name.NE.attrname) THEN - WRITE(*,*) 'ERROR: attribute name different: attr_name = ',check_name, ', should be ', attrname - total_error = total_error + 1 - ENDIF - ! Read data from the attribute - data_dims(1) = 1 - CALL h5aread_f(attr, H5T_NATIVE_INTEGER, value, data_dims, error) - CALL CHECK("H5Aread_f", error, total_error) - CALL verify("H5Aread_f", value, u, total_error) - - - ! Close attribute - CALL h5aclose_f(attr, error) - CALL check("h5aclose_f",error,total_error) - ENDDO - -END SUBROUTINE test_attr_dense_verify - -!*************************************************************** -!** -!** test_attr_corder_create_empty(): Test basic H5A (attribute) code. -!** Tests basic code to create objects with attribute creation order info -!** -!*************************************************************** - -SUBROUTINE test_attr_corder_create_basic( fcpl, fapl, total_error ) - - IMPLICIT NONE - - INTEGER(HID_T), INTENT(IN) :: fcpl - INTEGER(HID_T), INTENT(IN) :: fapl - INTEGER, INTENT(INOUT) :: total_error - CHARACTER(LEN=8) :: FileName = "tattr.h5" - INTEGER(HID_T) :: fid - INTEGER(HID_T) :: dcpl - INTEGER(HID_T) :: sid - - CHARACTER(LEN=8) :: DSET1_NAME = "Dataset1" - - INTEGER(HID_T) :: dataset - - INTEGER :: error - - INTEGER :: crt_order_flags - INTEGER :: minusone = -1 - - ! Output message about test being performed -! WRITE(*,*) " - Testing Basic Code for Attributes with Creation Order Info" - - ! Create file - CALL h5fcreate_f(FileName, H5F_ACC_TRUNC_F, fid, error, fcpl, fapl) - CALL check("h5fcreate_f",error,total_error) - - ! Create dataset creation property list - CALL H5Pcreate_f(H5P_DATASET_CREATE_F,dcpl,error) - CALL check("h5Pcreate_f",error,total_error) - - ! Get creation order indexing on object - CALL H5Pget_attr_creation_order_f(dcpl, crt_order_flags, error) - CALL check("H5Pget_attr_creation_order_f",error,total_error) - CALL verify("H5Pget_attr_creation_order_f",crt_order_flags , 0, total_error) - - ! Setting invalid combination of a attribute order creation order indexing on should fail - CALL H5Pset_attr_creation_order_f(dcpl, H5P_CRT_ORDER_INDEXED_F, error) - CALL verify("H5Pset_attr_creation_order_f",error , minusone, total_error) - CALL H5Pget_attr_creation_order_f(dcpl, crt_order_flags, error) - CALL check("H5Pget_attr_creation_order_f",error,total_error) - CALL verify("H5Pget_attr_creation_order_f",crt_order_flags , 0, total_error) - - ! Set attribute creation order tracking & indexing for object - CALL h5pset_attr_creation_order_f(dcpl, IOR(H5P_CRT_ORDER_TRACKED_F, H5P_CRT_ORDER_INDEXED_F), error) - CALL check("H5Pset_attr_creation_order_f",error,total_error) - - CALL H5Pget_attr_creation_order_f(dcpl, crt_order_flags, error) - CALL check("H5Pget_attr_creation_order_f",error,total_error) - CALL verify("H5Pget_attr_creation_order_f",crt_order_flags , & - IOR(H5P_CRT_ORDER_TRACKED_F, H5P_CRT_ORDER_INDEXED_F), total_error) - - ! Create dataspace for dataset - CALL h5screate_f(H5S_SCALAR_F, sid, error) - CALL check("h5screate_f",error,total_error) - - ! Create a dataset - CALL h5dcreate_f(fid, DSET1_NAME, H5T_NATIVE_CHARACTER, sid, dataset, error, & - lcpl_id=H5P_DEFAULT_F, dapl_id=H5P_DEFAULT_F, dcpl_id=dcpl) - CALL check("h5dcreate_f",error,total_error) - - ! Close dataspace - CALL h5sclose_f(sid, error) - CALL check("h5sclose_f",error,total_error) - - - ! Close Dataset - CALL h5dclose_f(dataset, error) - CALL check("h5dclose_f",error,total_error) - - ! Close property list - CALL h5pclose_f(dcpl, error) - CALL check("h5pclose_f",error,total_error) - - ! Close file - CALL h5fclose_f(fid, error) - CALL check("h5fclose_f",error,total_error) - - ! Re-open file - CALL h5fopen_f(FileName, H5F_ACC_RDWR_F, fid, error, fapl) - CALL check("h5open_f",error,total_error) - - ! Open dataset created - CALL h5dopen_f(fid, DSET1_NAME, dataset, error, H5P_DEFAULT_F ) - CALL check("h5dopen_f",error,total_error) - - - ! Retrieve dataset creation property list for group - CALL H5Dget_create_plist_f(dataset, dcpl, error) - CALL check("H5Dget_create_plist_f",error,total_error) - - ! Query the attribute creation properties - CALL H5Pget_attr_creation_order_f(dcpl, crt_order_flags, error) - CALL check("H5Pget_attr_creation_order_f",error,total_error) - CALL verify("H5Pget_attr_creation_order_f",crt_order_flags , & - IOR(H5P_CRT_ORDER_TRACKED_F, H5P_CRT_ORDER_INDEXED_F), total_error ) - - ! Close property list - CALL h5pclose_f(dcpl, error) - CALL check("h5pclose_f",error,total_error) - - ! Close Dataset - CALL h5dclose_f(dataset, error) - CALL check("h5dclose_f",error,total_error) - - ! Close file - CALL h5fclose_f(fid, error) - CALL check("h5fclose_f",error,total_error) - - -END SUBROUTINE test_attr_corder_create_basic - -!*************************************************************** -!** -!** test_attr_basic_write(): Test basic H5A (attribute) code. -!** Tests integer attributes on both datasets and groups -!** -!*************************************************************** - -SUBROUTINE test_attr_basic_write(fapl, total_error) - - IMPLICIT NONE - - INTEGER(HID_T), INTENT(IN) :: fapl - INTEGER, INTENT(INOUT) :: total_error - CHARACTER(LEN=8) :: FileName = "tattr.h5" - INTEGER(HID_T) :: fid1 - INTEGER(HID_T) :: sid1, sid2 - - CHARACTER(LEN=8) :: DSET1_NAME = "Dataset1" - - INTEGER(HID_T) :: dataset - INTEGER :: i - INTEGER :: error - - INTEGER(HID_T) :: attr,attr2 !String Attribute identifier - INTEGER(HID_T) :: group - - CHARACTER(LEN=25) :: check_name - CHARACTER(LEN=18) :: chr_exact_size - - CHARACTER(LEN=5), PARAMETER :: ATTR1_NAME="Attr1" - INTEGER, PARAMETER :: ATTR1_RANK = 1 - INTEGER, PARAMETER :: ATTR1_DIM1 = 3 - CHARACTER(LEN=7), PARAMETER :: ATTR1A_NAME ="Attr1_a" - CHARACTER(LEN=18), PARAMETER :: ATTR_TMP_NAME = "Attr1_a-1234567890" - INTEGER, DIMENSION(ATTR1_DIM1) :: attr_data1 - INTEGER, DIMENSION(ATTR1_DIM1) :: attr_data1a - INTEGER, DIMENSION(ATTR1_DIM1) :: read_data1 - INTEGER(HSIZE_T) :: attr_size ! attributes storage requirements .MSB. - INTEGER(HSIZE_T), DIMENSION(1) :: dimsa = (/3/) ! Dataset dimensions - - INTEGER :: rank1 = 2 ! Dataspace1 rank - INTEGER(HSIZE_T), DIMENSION(2) :: dims1 = (/4,6/) ! Dataset dimensions - INTEGER(HSIZE_T), DIMENSION(2) :: maxdims1 = (/4,6/) ! maximum dimensions - - INTEGER(SIZE_T) :: size - -!! Initialize attribute data - attr_data1(1) = 258 - attr_data1(2) = 9987 - attr_data1(3) = -99890 - - attr_data1a(1) = 258 - attr_data1a(2) = 1087 - attr_data1a(3) = -99890 - - - ! Create file - CALL h5fcreate_f(FileName, H5F_ACC_TRUNC_F, fid1, error, H5P_DEFAULT_F, fapl) - CALL check("h5fcreate_f",error,total_error) - - ! Create dataspace for dataset - CALL h5screate_simple_f(rank1, dims1, sid1, error, maxdims1) - CALL check("h5screate_simple_f",error,total_error) - - ! Create a dataset - CALL h5dcreate_f(fid1, DSET1_NAME, H5T_NATIVE_CHARACTER, sid1, dataset, error, H5P_DEFAULT_F, H5P_DEFAULT_F, H5P_DEFAULT_F ) - CALL check("h5dcreate_f",error,total_error) - - ! Create dataspace for attribute - CALL h5screate_simple_f(ATTR1_RANK, dimsa, sid2, error) - CALL check("h5screate_simple_f",error,total_error) - - ! Try to create an attribute on the file (should create an attribute on root group) - CALL h5acreate_f(fid1, ATTR1_NAME, H5T_NATIVE_INTEGER, sid2, attr, error, aapl_id=H5P_DEFAULT_F, acpl_id=H5P_DEFAULT_F) - CALL check("h5acreate_f",error,total_error) - - ! Close attribute - CALL h5aclose_f(attr, error) - CALL check("h5aclose_f",error,total_error) - - ! Open the root group - CALL H5Gopen_f(fid1, "/", group, error, H5P_DEFAULT_F) - CALL check("H5Gopen_f",error,total_error) - - ! Open attribute again - CALL h5aopen_f(group, ATTR1_NAME, attr, error) - CALL check("h5aopen_f",error,total_error) - - ! Close attribute - CALL h5aclose_f(attr, error) - CALL check("h5aclose_f",error,total_error) - - ! Close root group - CALL H5Gclose_f(group, error) - CALL check("h5gclose_f",error,total_error) - - ! Create an attribute for the dataset - CALL h5acreate_f(dataset, ATTR1_NAME, H5T_NATIVE_INTEGER, sid2, attr, error, H5P_DEFAULT_F, H5P_DEFAULT_F) - CALL check("h5acreate_f",error,total_error) - - ! Write attribute information - - CALL h5awrite_f(attr, H5T_NATIVE_INTEGER, attr_data1, dimsa, error) - CALL check("h5awrite_f",error,total_error) - - ! Create an another attribute for the dataset - CALL h5acreate_f(dataset, ATTR1A_NAME, H5T_NATIVE_INTEGER, sid2, attr2, error, H5P_DEFAULT_F, H5P_DEFAULT_F) - CALL check("h5acreate_f",error,total_error) - - ! Write attribute information - CALL h5awrite_f(attr2, H5T_NATIVE_INTEGER, attr_data1a, dimsa, error) - CALL check("h5awrite_f",error,total_error) - - ! Check storage size for attribute - - CALL h5aget_storage_size_f(attr, attr_size, error) - CALL check("h5aget_storage_size_f",error,total_error) -!EP CALL verify("h5aget_storage_size_f", INT(attr_size), 2*HSIZE_T, total_error) - - - ! Read attribute information immediately, without closing attribute - CALL h5aread_f(attr, H5T_NATIVE_INTEGER, read_data1, dimsa, error) - CALL check("h5aread_f",error,total_error) - - ! Verify values read in - DO i = 1, ATTR1_DIM1 - CALL verify('h5aread_f',attr_data1(i),read_data1(i), total_error) - ENDDO - - ! CLOSE attribute - CALL h5aclose_f(attr, error) - CALL check("h5aclose_f",error,total_error) - - ! Close attribute - CALL h5aclose_f(attr2, error) - CALL check("h5aclose_f",error,total_error) - - ! change attribute name - CALL H5Arename_f(dataset, ATTR1_NAME, ATTR_TMP_NAME, error) - CALL check("H5Arename_f", error, total_error) - - ! Open attribute again - - CALL h5aopen_f(dataset, ATTR_TMP_NAME, attr, error) - CALL check("h5aopen_f",error,total_error) - - ! Verify new attribute name - ! Set a deliberately small size - - check_name = ' ' ! need to initialize or does not pass test - - size = 1 - CALL H5Aget_name_f(attr, size, check_name, error) - CALL check('H5Aget_name',error,total_error) - - ! Now enter with the corrected size - IF(error.NE.size)THEN - size = error - CALL H5Aget_name_f(attr, size, check_name, error) - CALL check('H5Aget_name',error,total_error) - ENDIF - - IF(TRIM(ADJUSTL(check_name)).NE.TRIM(ADJUSTL(ATTR_TMP_NAME))) THEN - PRINT*,'.'//TRIM(check_name)//'.',LEN_TRIM(check_name) - PRINT*,'.'//TRIM(ATTR_TMP_NAME)//'.',LEN_TRIM(ATTR_TMP_NAME) - WRITE(*,*) 'ERROR: attribute name different: attr_name ='//TRIM(check_name)//'.' - WRITE(*,*) ' should be ='//TRIM(ATTR_TMP_NAME)//'.' - total_error = total_error + 1 - stop - ENDIF - - ! Try with a string buffer that is exactly the correct size - size = 18 - CALL H5Aget_name_f(attr, size, chr_exact_size, error) - CALL check('H5Aget_name_f',error,total_error) - CALL verify('H5Aget_name_f',chr_exact_size,ATTR_TMP_NAME, total_error) - - ! Close attribute - CALL h5aclose_f(attr, error) - CALL check("h5aclose_f",error,total_error) - - CALL h5sclose_f(sid1, error) - CALL check("h5sclose_f",error,total_error) - CALL h5sclose_f(sid2, error) - CALL check("h5sclose_f",error,total_error) - ! Close Dataset - CALL h5dclose_f(dataset, error) - CALL check("h5dclose_f",error,total_error) - - ! Close file - CALL h5fclose_f(fid1, error) - CALL check("h5fclose_f",error,total_error) - -END SUBROUTINE test_attr_basic_write - -!*************************************************************** -!** -!** test_attr_many(): Test basic H5A (attribute) code. -!** Tests storing lots of attributes -!** -!*************************************************************** - -SUBROUTINE test_attr_many(new_format, fcpl, fapl, total_error) - - IMPLICIT NONE - - LOGICAL, INTENT(IN) :: new_format - INTEGER(HID_T), INTENT(IN) :: fcpl - INTEGER(HID_T), INTENT(IN) :: fapl - INTEGER, INTENT(INOUT) :: total_error - CHARACTER(LEN=8) :: FileName = "tattr.h5" - INTEGER(HID_T) :: fid - INTEGER(HID_T) :: sid - INTEGER(HID_T) :: gid - INTEGER(HID_T) :: aid - INTEGER :: error - - INTEGER(HSIZE_T), DIMENSION(7) :: data_dims - CHARACTER(LEN=5) :: chr5 - - - CHARACTER(LEN=11) :: attrname - CHARACTER(LEN=8), PARAMETER :: GROUP1_NAME="/Group1" - - INTEGER :: u - INTEGER :: nattr - LOGICAL :: exists - INTEGER, DIMENSION(1) :: attr_data1 - - data_dims = 0 - - - ! Create file - CALL h5fcreate_f(FileName, H5F_ACC_TRUNC_F, fid, error, fcpl, fapl) - CALL check("h5fcreate_f",error,total_error) - - ! Create dataspace for attribute - CALL h5screate_f(H5S_SCALAR_F, sid, error) - CALL check("h5screate_f",error,total_error) - - ! Create group for attributes - - CALL H5Gcreate_f(fid, GROUP1_NAME, gid, error) - CALL check("H5Gcreate_f", error, total_error) - - ! Create many attributes - - IF(new_format)THEN - nattr = 250 - ELSE - nattr = 2 - ENDIF - - DO u = 0, nattr - 1 - - WRITE(chr5,'(I5.5)') u - attrname = 'attr '//chr5 - CALL H5Aexists_f( gid, attrname, exists, error) - CALL verify("H5Aexists",exists,.FALSE.,total_error ) - - CALL H5Aexists_by_name_f(fid, GROUP1_NAME, attrname, exists, error, lapl_id = H5P_DEFAULT_F) - CALL verify("H5Aexists_by_name_f",exists,.FALSE.,total_error ) - - CALL h5acreate_f(gid, attrname, H5T_NATIVE_INTEGER, sid, aid, error, H5P_DEFAULT_F, H5P_DEFAULT_F) - CALL check("h5acreate_f",error,total_error) - - CALL H5Aexists_f(gid, attrname, exists, error) - CALL verify("H5Aexists",exists,.TRUE.,total_error ) - - CALL H5Aexists_by_name_f(fid, GROUP1_NAME, attrname, exists, error) - CALL verify("H5Aexists_by_name_f",exists,.TRUE.,total_error ) - - attr_data1(1) = u - data_dims(1) = 1 - - CALL h5awrite_f(aid, H5T_NATIVE_INTEGER, attr_data1, data_dims, error) - CALL check("h5awrite_f",error,total_error) - - CALL h5aclose_f(aid, error) - CALL check("h5aclose_f",error,total_error) - - CALL H5Aexists_f(gid, attrname, exists, error) - CALL verify("H5Aexists",exists,.TRUE.,total_error ) - - CALL H5Aexists_by_name_f(fid, GROUP1_NAME, attrname, exists, error) - CALL verify("H5Aexists_by_name_f",exists,.TRUE.,total_error ) - - ENDDO - - ! Close group - CALL H5Gclose_f(gid, error) - CALL check("h5gclose_f",error,total_error) - - ! Close file - CALL h5fclose_f(fid, error) - CALL check("h5fclose_f",error,total_error) - - ! Close dataspaces - CALL h5sclose_f(sid, error) - CALL check("h5sclose_f",error,total_error) - -END SUBROUTINE test_attr_many - -!------------------------------------------------------------------------- -! * Function: attr_open_check -! * -! * Purpose: Check opening attribute on an object -! * -! * Return: Success: 0 -! * Failure: -1 -! * -! * Programmer: Fortran version (M.S. Breitenfeld) -! * March 21, 2008 -! * -! *------------------------------------------------------------------------- -! - -SUBROUTINE attr_open_check(fid, dsetname, obj_id, max_attrs, total_error ) - - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: fid - CHARACTER(LEN=*), INTENT(IN) :: dsetname - INTEGER(HID_T), INTENT(IN) :: obj_id - INTEGER, INTENT(IN) :: max_attrs - INTEGER, INTENT(INOUT) :: total_error - - INTEGER :: u - CHARACTER (LEN=8) :: attrname - INTEGER :: error - LOGICAL :: f_corder_valid ! Indicates whether the the creation order data is valid for this attribute - INTEGER :: corder ! Is a positive integer containing the creation order of the attribute - INTEGER :: cset ! Indicates the character set used for the attribute’s name - INTEGER(HSIZE_T) :: data_size ! indicates the size, in the number of characters - - INTEGER(HSIZE_T) :: storage_size ! attributes storage requirements - CHARACTER(LEN=2) :: chr2 - INTEGER(HID_T) attr_id - ! Open each attribute on object by index and check that it's the correct one - - DO u = 0, max_attrs-1 - ! Open the attribute - - WRITE(chr2,'(I2.2)') u - attrname = 'attr '//chr2 - - - CALL h5aopen_f(obj_id, attrname, attr_id, error) - CALL check("h5aopen_f",error,total_error) - - - ! Get the attribute's information - - CALL h5aget_info_f(attr_id, f_corder_valid, corder, cset, data_size, error) - CALL check("h5aget_info_f",error,total_error) - - ! Check that the object's attributes are correct - CALL verify("h5aget_info_f.corder",corder,u,total_error) - CALL verify("h5aget_info_f.corder_valid",f_corder_valid,.TRUE.,total_error) - CALL verify("h5aget_info_f.cset", cset, H5T_CSET_ASCII_F, total_error) - CALL h5aget_storage_size_f(attr_id, storage_size, error) - CALL check("h5aget_storage_size_f",error,total_error) - - CALL verify("h5aget_info_f.data_size", INT(data_size), INT(storage_size), total_error) - - - ! Close attribute - CALL h5aclose_f(attr_id, error) - CALL check("h5aclose_f",error,total_error) - - ! Open the attribute - - CALL H5Aopen_by_name_f(obj_id, ".", attrname, attr_id, error, lapl_id=H5P_DEFAULT_F, aapl_id=H5P_DEFAULT_F) - CALL check("H5Aopen_by_name_f", error, total_error) - - CALL h5aget_info_f(attr_id, f_corder_valid, corder, cset, data_size, error) - CALL check("h5aget_info_f",error,total_error) - ! Check the attribute's information - CALL verify("h5aget_info_f",corder,u,total_error) - CALL verify("h5aget_info_f",f_corder_valid,.TRUE.,total_error) - CALL verify("h5aget_info_f", cset, H5T_CSET_ASCII_F, total_error) - CALL h5aget_storage_size_f(attr_id, storage_size, error) - CALL check("h5aget_storage_size_f",error,total_error) - CALL verify("h5aget_info_f", INT(data_size), INT(storage_size), total_error) - - ! Close attribute - CALL h5aclose_f(attr_id, error) - CALL check("h5aclose_f",error,total_error) - - - ! Open the attribute - CALL H5Aopen_by_name_f(fid, dsetname, attrname, attr_id, error) - CALL check("H5Aopen_by_name_f", error, total_error) - - - ! Get the attribute's information - CALL h5aget_info_f(attr_id, f_corder_valid, corder, cset, data_size, error) - CALL check("h5aget_info_f",error,total_error) - - ! Check the attribute's information - CALL verify("h5aget_info_f",corder,u,total_error) - CALL verify("h5aget_info_f",f_corder_valid,.TRUE.,total_error) - CALL verify("h5aget_info_f", cset, H5T_CSET_ASCII_F, total_error) - CALL h5aget_storage_size_f(attr_id, storage_size, error) - CALL check("h5aget_storage_size_f",error,total_error) - CALL verify("h5aget_info_f", INT(data_size), INT(storage_size), total_error) - - ! Close attribute - CALL h5aclose_f(attr_id, error) - CALL check("h5aclose_f",error,total_error) - ENDDO - -END SUBROUTINE attr_open_check -END MODULE TH5A_1_8 diff --git a/fortran/test/tH5D.F90 b/fortran/test/tH5D.F90 new file mode 100644 index 0000000..c9ba952 --- /dev/null +++ b/fortran/test/tH5D.F90 @@ -0,0 +1,630 @@ +!****h* root/fortran/test/tH5D.f90 +! +! NAME +! tH5D.f90 +! +! FUNCTION +! Basic testing of Fortran H5D 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. * +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! +! NOTES +! Tests the H5D APIs functionalities of: +! h5dcreate_f, h5dopen_f, h5dclose_f, h5dget_space_f, h5dget_type_f, +! h5dread_f, and h5dwrite_f, h5dget_space_status_f +! +! +! CONTAINS SUBROUTINES +! datasettest, extenddsettest +! +!***** + +! +MODULE TH5D + + USE HDF5 ! This module contains all necessary modules + USE TH5_MISC + USE TH5_MISC_GEN + +CONTAINS + SUBROUTINE datasettest(cleanup, total_error) + + IMPLICIT NONE + LOGICAL, INTENT(IN) :: cleanup + INTEGER, INTENT(OUT) :: total_error + + CHARACTER(LEN=5), PARAMETER :: filename = "dsetf" ! File name + CHARACTER(LEN=80) :: fix_filename + CHARACTER(LEN=4), PARAMETER :: dsetname = "dset" ! Dataset name + CHARACTER(LEN=9), PARAMETER :: null_dsetname = "null_dset" ! Dataset name + + INTEGER(HID_T) :: file_id ! File identifier + INTEGER(HID_T) :: dset_id ! Dataset identifier + INTEGER(HID_T) :: null_dset ! Null dataset identifier + INTEGER(HID_T) :: dspace_id ! Dataspace identifier + INTEGER(HID_T) :: null_dspace ! Null dataspace identifier + INTEGER(HID_T) :: dtype_id ! Datatype identifier + + INTEGER(HSIZE_T), DIMENSION(2) :: dims = (/4,6/) ! Dataset dimensions + INTEGER :: rank = 2 ! Dataset rank + + INTEGER, DIMENSION(4,6) :: dset_data, data_out ! Data buffers + INTEGER :: error ! Error flag + + INTEGER :: i, j !general purpose integers + INTEGER(HSIZE_T), DIMENSION(2) :: data_dims + INTEGER(HSIZE_T), DIMENSION(1) :: null_data_dim + INTEGER :: null_dset_data = 1 ! null data + INTEGER :: flag ! Space allocation status + + ! + ! Initialize the dset_data array. + ! + DO i = 1, 4 + DO j = 1, 6 + dset_data(i,j) = (i-1)*6 + j; + END DO + END DO + ! + ! Create a new file using default properties. + ! + CALL h5_fixname_f(filename, fix_filename, H5P_DEFAULT_F, error) + IF (error .NE. 0) THEN + WRITE(*,*) "Cannot modify filename" + STOP + ENDIF + CALL h5fcreate_f(fix_filename, H5F_ACC_TRUNC_F, file_id, error) + CALL check("h5fcreate_f", error, total_error) + ! + ! Create the dataspace. + ! + CALL h5screate_simple_f(rank, dims, dspace_id, error) + CALL check("h5screate_simple_f", error, total_error) + ! + ! Create null dataspace. + ! + CALL h5screate_f(H5S_NULL_F, null_dspace, error) + CALL check("h5screate_simple_f", error, total_error) + ! + ! Create the dataset with default properties. + ! + CALL h5dcreate_f(file_id, dsetname, H5T_NATIVE_INTEGER, dspace_id, & + dset_id, error) + CALL check("h5dcreate_f", error, total_error) + ! + ! Create the null dataset. + ! + CALL h5dcreate_f(file_id, null_dsetname, H5T_NATIVE_INTEGER, null_dspace, null_dset, error) + CALL check("h5dcreate_f", error, total_error) + ! + ! Write the dataset. + ! + data_dims(1) = 4 + data_dims(2) = 6 + CALL h5dwrite_f(dset_id, H5T_NATIVE_INTEGER, dset_data, data_dims, error) + CALL check("h5dwrite_f", error, total_error) + ! + ! Write null dataset. Nothing can be written. + ! + null_data_dim(1) = 1 + CALL h5dwrite_f(null_dset, H5T_NATIVE_INTEGER, null_dset_data, null_data_dim, error) + CALL check("h5dwrite_f", error, total_error) + ! + ! End access to the dataset and release resources used by it. + ! + CALL h5dclose_f(dset_id, error) + CALL check("h5dclose_f", error, total_error) + CALL h5dclose_f(null_dset, error) + CALL check("h5dclose_f", error, total_error) + ! + ! Terminate access to the data space. + ! + CALL h5sclose_f(dspace_id, error) + CALL check("h5sclose_f", error, total_error) + CALL h5sclose_f(null_dspace, error) + CALL check("h5sclose_f", error, total_error) + ! + ! Close the file. + ! + CALL h5fclose_f(file_id, error) + CALL check("h5fclose_f", error, total_error) + ! + ! Open the existing file. + ! + CALL h5fopen_f (fix_filename, H5F_ACC_RDWR_F, file_id, error) + CALL check("h5fopen_f", error, total_error) + ! + ! Open the existing dataset. + ! + CALL h5dopen_f(file_id, dsetname, dset_id, error) + CALL check("h5dopen_f", error, total_error) + CALL h5dopen_f(file_id, null_dsetname, null_dset, error) + CALL check("h5dopen_f", error, total_error) + + ! Test whether space has been allocated for a dataset + CALL h5dget_space_status_f(dset_id, flag, error) + CALL check("h5dget_space_status_f",error, total_error) + CALL VERIFY("h5dget_space_status_f", flag, H5D_SPACE_STS_ALLOCATED_F, total_error) + + CALL h5dget_space_status_f(null_dset, flag, error) + CALL check("h5dget_space_status_f",error, total_error) + CALL VERIFY("h5dget_space_status_f", flag, H5D_SPACE_STS_NOT_ALLOCATED_F, total_error) + ! + ! Get the dataset type. + ! + CALL h5dget_type_f(dset_id, dtype_id, error) + CALL check("h5dget_type_f", error, total_error) + ! + ! Get the data space. + ! + CALL h5dget_space_f(dset_id, dspace_id, error) + CALL check("h5dget_space_f", error, total_error) + ! + ! Read the dataset. + ! + CALL h5dread_f(dset_id, H5T_NATIVE_INTEGER, data_out, data_dims, error) + CALL check("h5dread_f", error, total_error) + ! + ! Read the null dataset. Nothing should be read. + ! + CALL h5dread_f(null_dset, H5T_NATIVE_INTEGER, null_dset_data, null_data_dim, error) + CALL check("h5dread_f", error, total_error) + ! + !Compare the data. + ! + DO i = 1, 4 + DO j = 1, 6 + IF (data_out(i,j) .NE. dset_data(i, j)) THEN + WRITE(*, *) "dataset test error occured" + WRITE(*,*) "data read is not the same as the data written" + END IF + END DO + END DO + ! + ! Check if no change to null_dset_data + ! + IF (null_dset_data .NE. 1) THEN + WRITE(*, *) "null dataset test error occured" + END IF + ! + ! End access to the dataset and release resources used by it. + ! + CALL h5dclose_f(dset_id, error) + CALL check("h5dclose_f", error, total_error) + CALL h5dclose_f(null_dset, error) + CALL check("h5dclose_f", error, total_error) + ! + ! Terminate access to the data space. + ! + CALL h5sclose_f(dspace_id, error) + CALL check("h5sclose_f", error, total_error) + + ! + ! Terminate access to the data type. + ! + CALL h5tclose_f(dtype_id, error) + CALL check("h5tclose_f", error, total_error) + ! + ! Close the file. + ! + CALL h5fclose_f(file_id, error) + CALL check("h5fclose_f", error, total_error) + IF(cleanup) CALL h5_cleanup_f(filename, H5P_DEFAULT_F, error) + CALL check("h5_cleanup_f", error, total_error) + + RETURN + END SUBROUTINE datasettest + +! +!the following subroutine tests h5dextend_f functionality +! + + SUBROUTINE extenddsettest(cleanup, total_error) + + IMPLICIT NONE + + LOGICAL, INTENT(IN) :: cleanup + INTEGER, INTENT(OUT) :: total_error + + ! + !the dataset is stored in file "extf.h5" + ! + CHARACTER(LEN=4), PARAMETER :: filename = "extf" + CHARACTER(LEN=80) :: fix_filename + + ! + !dataset name is "ExtendibleArray" + ! + CHARACTER(LEN=15), PARAMETER :: dsetname = "ExtendibleArray" + + ! + !dataset rank is 2 + ! + INTEGER :: RANK = 2 + + INTEGER(HID_T) :: file_id ! File identifier + INTEGER(HID_T) :: dset_id ! Dataset identifier + INTEGER(HID_T) :: dataspace ! Dataspace identifier + INTEGER(HID_T) :: memspace ! memory Dataspace identifier + INTEGER(HID_T) :: crp_list ! dataset creatation property identifier + + ! + !dataset dimensions at creation time + ! + INTEGER(HSIZE_T), DIMENSION(2) :: dims = (/3,3/) + + ! + !data dimensions + ! + INTEGER(HSIZE_T), DIMENSION(2) :: dims1 = (/10,3/) + + ! + !Maximum dimensions + ! + INTEGER(HSIZE_T), DIMENSION(2) :: maxdims + + ! + !data arrays for reading and writing + ! + INTEGER, DIMENSION(10,3) :: data_in, data_out + + ! + !Size of data in the file + ! + INTEGER(HSIZE_T), DIMENSION(2) :: size + + ! + !general purpose integer + ! + INTEGER :: i, j + INTEGER(HSIZE_T) :: ih, jh + + ! + !flag to check operation success + ! + INTEGER :: error + + ! + !Variables used in reading data back + ! + INTEGER(HSIZE_T), DIMENSION(2) :: dimsr, maxdimsr + INTEGER :: rankr + INTEGER(HSIZE_T), DIMENSION(2) :: data_dims + + ! + !data initialization + ! + DO i = 1, 10 + DO j = 1, 3 + data_in(i,j) = 2 + END DO + END DO + + ! + !Initialize FORTRAN predifined datatypes + ! +! CALL h5init_types_f(error) +! CALL check("h5init_types_f",error,total_error) + + ! + !Create a new file using default properties. + ! + CALL h5_fixname_f(filename, fix_filename, H5P_DEFAULT_F, error) + IF (error .NE. 0) THEN + WRITE(*,*) "Cannot modify filename" + STOP + ENDIF + CALL h5fcreate_f(fix_filename, H5F_ACC_TRUNC_F, file_id, error) + CALL check("h5fcreate_f",error,total_error) + + ! + !Create the data space with unlimited dimensions. + ! + maxdims = (/H5S_UNLIMITED_F, H5S_UNLIMITED_F/) + + CALL h5screate_simple_f(RANK, dims, dataspace, error, maxdims) + CALL check("h5screate_simple_f",error,total_error) + + ! + !Modify dataset creation properties, i.e. enable chunking + ! + CALL h5pcreate_f(H5P_DATASET_CREATE_F, crp_list, error) + CALL check("h5pcreate_f",error,total_error) + + CALL h5pset_chunk_f(crp_list, RANK, dims1, error) + CALL check("h5pset_chunk_f",error,total_error) + + ! + !Create a dataset with 3X3 dimensions using cparms creation propertie . + ! + CALL h5dcreate_f(file_id, dsetname, H5T_NATIVE_INTEGER, dataspace, dset_id, error, crp_list ) + CALL check("h5dcreate_f",error,total_error) + + ! + !Extend the dataset. This call assures that dataset is 3 x 3. + ! + SIZE(1) = 3 + SIZE(2) = 3 + CALL h5dextend_f(dset_id, size, error) + CALL check("h5dextend_f",error,total_error) + + + ! + !Extend the dataset. Dataset becomes 10 x 3. + ! + SIZE(1) = 10; + SIZE(2) = 3; + CALL h5dextend_f(dset_id, size, error) + CALL check("h5dextend_f",error,total_error) + + ! + !Write the data of size 10X3 to the extended dataset. + ! + data_dims(1) = 10 + data_dims(2) = 3 + CALL H5dwrite_f(dset_id, H5T_NATIVE_INTEGER, data_in, data_dims, error) + CALL check("h5dwrite_f",error,total_error) + + ! + !Close the dataspace for the dataset. + ! + CALL h5sclose_f(dataspace, error) + CALL check("h5sclose_f",error,total_error) + + ! + !Close the property list. + ! + CALL h5pclose_f(crp_list, error) + CALL check("h5pclose_f",error,total_error) + ! + !Close the dataset. + ! + CALL h5dclose_f(dset_id, error) + CALL check("h5dclose_f",error,total_error) + + ! + !Close the file. + ! + CALL h5fclose_f(file_id, error) + CALL check("h5fclose_f",error,total_error) + + ! + !read the data back + ! + !Open the file. + ! + CALL h5fopen_f (fix_filename, H5F_ACC_RDONLY_F, file_id, error) + CALL check("hfopen_f",error,total_error) + + ! + !Open the dataset. + ! + CALL h5dopen_f(file_id, dsetname, dset_id, error) + CALL check("h5dopen_f",error,total_error) + + ! + !Get dataset's dataspace handle. + ! + CALL h5dget_space_f(dset_id, dataspace, error) + CALL check("h5dget_space_f",error,total_error) + + ! + !Get dataspace's rank. + ! + CALL h5sget_simple_extent_ndims_f(dataspace, rankr, error) + CALL check("h5sget_simple_extent_ndims_f",error,total_error) + IF (rankr .NE. RANK) THEN + WRITE(*,*) "dataset rank error occured" + STOP + END IF + + ! + !Get dataspace's dimensinons. + ! + CALL h5sget_simple_extent_dims_f(dataspace, dimsr, maxdimsr, error) + CALL check("h5sget_simple_extent_dims_f",error,total_error) + IF ((dimsr(1) .NE. dims1(1)) .OR. (dimsr(2) .NE. dims1(2))) THEN + WRITE(*,*) "dataset dimensions error occured" + STOP + END IF + + ! + !Get creation property list. + ! + CALL h5dget_create_plist_f(dset_id, crp_list, error) + CALL check("h5dget_create_plist_f",error,total_error) + + + ! + !create memory dataspace. + ! + CALL h5screate_simple_f(rankr, dimsr, memspace, error) + CALL check("h5screate_simple_f",error,total_error) + + ! + !Read data + ! + CALL H5dread_f(dset_id, H5T_NATIVE_INTEGER, data_out, data_dims, error, memspace, dataspace) + CALL check("h5dread_f",error,total_error) + + + ! + !Compare the data. + ! + DO ih = 1, dims1(1) + DO jh = 1, dims1(2) + IF (data_out(ih,jh) .NE. data_in(ih, jh)) THEN + WRITE(*, *) "extend dataset test error occured" + WRITE(*, *) "read value is not the same as the written values" + END IF + END DO + END DO + + ! + !Close the dataspace for the dataset. + ! + CALL h5sclose_f(dataspace, error) + CALL check("h5sclose_f",error,total_error) + + ! + !Close the memspace for the dataset. + ! + CALL h5sclose_f(memspace, error) + CALL check("h5sclose_f",error,total_error) + + ! + !Close the property list. + ! + CALL h5pclose_f(crp_list, error) + CALL check("h5pclose_f",error,total_error) + + ! + !Close the dataset. + ! + CALL h5dclose_f(dset_id, error) + CALL check("h5dclose_f",error,total_error) + + ! + !Close the file. + ! + CALL h5fclose_f(file_id, error) + CALL check("h5fclose_f",error,total_error) + IF(cleanup) CALL h5_cleanup_f(filename, H5P_DEFAULT_F, error) + CALL check("h5_cleanup_f", error, total_error) + + RETURN + END SUBROUTINE extenddsettest + +! +! The following subroutine tests h5dget_offset_f functionality +! + + SUBROUTINE test_userblock_offset(cleanup, total_error) + + USE ISO_C_BINDING + + IMPLICIT NONE + LOGICAL, INTENT(IN) :: cleanup + INTEGER, INTENT(OUT) :: total_error + ! + !the dataset is stored in file "offset.h5" + ! + INTEGER, PARAMETER :: dset_dim1=2, dset_dim2=10 + CHARACTER(LEN=6), PARAMETER :: filename = "offset" + CHARACTER(LEN=80) :: fix_filename + + INTEGER(hid_t) :: file, fcpl, dataset, space + INTEGER :: i, j, n, ios + INTEGER(hsize_t), DIMENSION(1:2) :: dims + INTEGER :: f + INTEGER(haddr_t) :: offset + INTEGER, DIMENSION(1:dset_dim1,1:dset_dim2), TARGET :: rdata, data_in + INTEGER :: error + TYPE(C_PTR) :: f_ptr + ! + !Create a new file using default properties. + ! + CALL h5_fixname_f(filename, fix_filename, H5P_DEFAULT_F, error) + IF (error .NE. 0) THEN + WRITE(*,*) "Cannot modify filename" + STOP + ENDIF + + CALL h5pcreate_f(H5P_FILE_CREATE_F, fcpl, error) + CALL check("h5pcreate_f",error,total_error) + + ! Initialize the dataset + n = 0 + DO i = 1, dset_dim1 + DO j = 1, dset_dim2 + n = n + 1 + data_in(i,j) = n + END DO + END DO + CALL h5fcreate_f(fix_filename, H5F_ACC_TRUNC_F, file, error, fcpl) + CALL check("h5fcreate_f",error,total_error) + + ! Create the data space + dims(1:2) = (/dset_dim1,dset_dim2/) + + CALL h5screate_simple_f(2, dims, space, error) + CALL check("h5screate_simple_f",error,total_error) + + ! Create the dataset + CALL h5dcreate_f(file, "dset1", H5T_NATIVE_INTEGER, space, dataset, error) + CALL check("h5dcreate_f", error, total_error) + + ! Test dataset address. Should be undefined. + CALL h5dget_offset_f(dataset, offset, error) + CALL VERIFY("h5dget_offset_f",offset, HADDR_UNDEF_F, total_error) + + ! Write the data to the dataset + f_ptr = C_LOC(data_in(1,1)) + CALL h5dwrite_f(dataset, H5T_NATIVE_INTEGER, f_ptr, error) + CALL check("h5dwrite_f", error, total_error) + + ! Test dataset address in file. Open the same file as a C file, seek + ! the data position as H5Dget_offset points to, read the dataset, and + ! compare it with the data written in. + CALL h5dget_offset_f(dataset, offset, error) + CALL check("h5dget_offset_f", error, total_error) + IF(offset.EQ.HADDR_UNDEF_F)THEN + total_error = total_error + 1 + ENDIF + + CALL h5dclose_f(dataset, error) + CALL check("h5dclose_f", error, total_error) + CALL h5fclose_f(file, error) + CALL check("h5fclose_f", error, total_error) + + IF(total_error.NE.0) RETURN + + OPEN(10,FILE=fix_filename, ACCESS="STREAM", IOSTAT=ios) + IF(ios.NE.0)THEN + WRITE(*,'(A)') "Failed to open file "//TRIM(fix_filename) + total_error = total_error + 1 + RETURN + ENDIF + ! The pos= specifier illustrates that positions are in bytes, + ! starting from byte 1 (as opposed to C, where they start from byte 0) + READ(10, POS=offset+1, IOSTAT=ios) rdata + IF(ios.NE.0)THEN + WRITE(*,'(A)') "Failed to read data from stream I/O " + total_error = total_error + 1 + CLOSE(10) + RETURN + ENDIF + + ! Check that the values read are the same as the values written + DO i = 1, dset_dim1 + DO j = 1, dset_dim2 + CALL VERIFY("h5dget_offset_f",rdata(i,j), data_in(i,j), total_error) + IF(total_error.NE.0)THEN + WRITE(*,'(A)') " Read different values than written." + WRITE(*,'(2(A,I0))') " At index ",i,",",j + CLOSE(10) + RETURN + ENDIF + END DO + END DO + + CLOSE(10) + + END SUBROUTINE test_userblock_offset + +END MODULE TH5D + diff --git a/fortran/test/tH5D.f90 b/fortran/test/tH5D.f90 deleted file mode 100644 index c9ba952..0000000 --- a/fortran/test/tH5D.f90 +++ /dev/null @@ -1,630 +0,0 @@ -!****h* root/fortran/test/tH5D.f90 -! -! NAME -! tH5D.f90 -! -! FUNCTION -! Basic testing of Fortran H5D 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. * -! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -! -! NOTES -! Tests the H5D APIs functionalities of: -! h5dcreate_f, h5dopen_f, h5dclose_f, h5dget_space_f, h5dget_type_f, -! h5dread_f, and h5dwrite_f, h5dget_space_status_f -! -! -! CONTAINS SUBROUTINES -! datasettest, extenddsettest -! -!***** - -! -MODULE TH5D - - USE HDF5 ! This module contains all necessary modules - USE TH5_MISC - USE TH5_MISC_GEN - -CONTAINS - SUBROUTINE datasettest(cleanup, total_error) - - IMPLICIT NONE - LOGICAL, INTENT(IN) :: cleanup - INTEGER, INTENT(OUT) :: total_error - - CHARACTER(LEN=5), PARAMETER :: filename = "dsetf" ! File name - CHARACTER(LEN=80) :: fix_filename - CHARACTER(LEN=4), PARAMETER :: dsetname = "dset" ! Dataset name - CHARACTER(LEN=9), PARAMETER :: null_dsetname = "null_dset" ! Dataset name - - INTEGER(HID_T) :: file_id ! File identifier - INTEGER(HID_T) :: dset_id ! Dataset identifier - INTEGER(HID_T) :: null_dset ! Null dataset identifier - INTEGER(HID_T) :: dspace_id ! Dataspace identifier - INTEGER(HID_T) :: null_dspace ! Null dataspace identifier - INTEGER(HID_T) :: dtype_id ! Datatype identifier - - INTEGER(HSIZE_T), DIMENSION(2) :: dims = (/4,6/) ! Dataset dimensions - INTEGER :: rank = 2 ! Dataset rank - - INTEGER, DIMENSION(4,6) :: dset_data, data_out ! Data buffers - INTEGER :: error ! Error flag - - INTEGER :: i, j !general purpose integers - INTEGER(HSIZE_T), DIMENSION(2) :: data_dims - INTEGER(HSIZE_T), DIMENSION(1) :: null_data_dim - INTEGER :: null_dset_data = 1 ! null data - INTEGER :: flag ! Space allocation status - - ! - ! Initialize the dset_data array. - ! - DO i = 1, 4 - DO j = 1, 6 - dset_data(i,j) = (i-1)*6 + j; - END DO - END DO - ! - ! Create a new file using default properties. - ! - CALL h5_fixname_f(filename, fix_filename, H5P_DEFAULT_F, error) - IF (error .NE. 0) THEN - WRITE(*,*) "Cannot modify filename" - STOP - ENDIF - CALL h5fcreate_f(fix_filename, H5F_ACC_TRUNC_F, file_id, error) - CALL check("h5fcreate_f", error, total_error) - ! - ! Create the dataspace. - ! - CALL h5screate_simple_f(rank, dims, dspace_id, error) - CALL check("h5screate_simple_f", error, total_error) - ! - ! Create null dataspace. - ! - CALL h5screate_f(H5S_NULL_F, null_dspace, error) - CALL check("h5screate_simple_f", error, total_error) - ! - ! Create the dataset with default properties. - ! - CALL h5dcreate_f(file_id, dsetname, H5T_NATIVE_INTEGER, dspace_id, & - dset_id, error) - CALL check("h5dcreate_f", error, total_error) - ! - ! Create the null dataset. - ! - CALL h5dcreate_f(file_id, null_dsetname, H5T_NATIVE_INTEGER, null_dspace, null_dset, error) - CALL check("h5dcreate_f", error, total_error) - ! - ! Write the dataset. - ! - data_dims(1) = 4 - data_dims(2) = 6 - CALL h5dwrite_f(dset_id, H5T_NATIVE_INTEGER, dset_data, data_dims, error) - CALL check("h5dwrite_f", error, total_error) - ! - ! Write null dataset. Nothing can be written. - ! - null_data_dim(1) = 1 - CALL h5dwrite_f(null_dset, H5T_NATIVE_INTEGER, null_dset_data, null_data_dim, error) - CALL check("h5dwrite_f", error, total_error) - ! - ! End access to the dataset and release resources used by it. - ! - CALL h5dclose_f(dset_id, error) - CALL check("h5dclose_f", error, total_error) - CALL h5dclose_f(null_dset, error) - CALL check("h5dclose_f", error, total_error) - ! - ! Terminate access to the data space. - ! - CALL h5sclose_f(dspace_id, error) - CALL check("h5sclose_f", error, total_error) - CALL h5sclose_f(null_dspace, error) - CALL check("h5sclose_f", error, total_error) - ! - ! Close the file. - ! - CALL h5fclose_f(file_id, error) - CALL check("h5fclose_f", error, total_error) - ! - ! Open the existing file. - ! - CALL h5fopen_f (fix_filename, H5F_ACC_RDWR_F, file_id, error) - CALL check("h5fopen_f", error, total_error) - ! - ! Open the existing dataset. - ! - CALL h5dopen_f(file_id, dsetname, dset_id, error) - CALL check("h5dopen_f", error, total_error) - CALL h5dopen_f(file_id, null_dsetname, null_dset, error) - CALL check("h5dopen_f", error, total_error) - - ! Test whether space has been allocated for a dataset - CALL h5dget_space_status_f(dset_id, flag, error) - CALL check("h5dget_space_status_f",error, total_error) - CALL VERIFY("h5dget_space_status_f", flag, H5D_SPACE_STS_ALLOCATED_F, total_error) - - CALL h5dget_space_status_f(null_dset, flag, error) - CALL check("h5dget_space_status_f",error, total_error) - CALL VERIFY("h5dget_space_status_f", flag, H5D_SPACE_STS_NOT_ALLOCATED_F, total_error) - ! - ! Get the dataset type. - ! - CALL h5dget_type_f(dset_id, dtype_id, error) - CALL check("h5dget_type_f", error, total_error) - ! - ! Get the data space. - ! - CALL h5dget_space_f(dset_id, dspace_id, error) - CALL check("h5dget_space_f", error, total_error) - ! - ! Read the dataset. - ! - CALL h5dread_f(dset_id, H5T_NATIVE_INTEGER, data_out, data_dims, error) - CALL check("h5dread_f", error, total_error) - ! - ! Read the null dataset. Nothing should be read. - ! - CALL h5dread_f(null_dset, H5T_NATIVE_INTEGER, null_dset_data, null_data_dim, error) - CALL check("h5dread_f", error, total_error) - ! - !Compare the data. - ! - DO i = 1, 4 - DO j = 1, 6 - IF (data_out(i,j) .NE. dset_data(i, j)) THEN - WRITE(*, *) "dataset test error occured" - WRITE(*,*) "data read is not the same as the data written" - END IF - END DO - END DO - ! - ! Check if no change to null_dset_data - ! - IF (null_dset_data .NE. 1) THEN - WRITE(*, *) "null dataset test error occured" - END IF - ! - ! End access to the dataset and release resources used by it. - ! - CALL h5dclose_f(dset_id, error) - CALL check("h5dclose_f", error, total_error) - CALL h5dclose_f(null_dset, error) - CALL check("h5dclose_f", error, total_error) - ! - ! Terminate access to the data space. - ! - CALL h5sclose_f(dspace_id, error) - CALL check("h5sclose_f", error, total_error) - - ! - ! Terminate access to the data type. - ! - CALL h5tclose_f(dtype_id, error) - CALL check("h5tclose_f", error, total_error) - ! - ! Close the file. - ! - CALL h5fclose_f(file_id, error) - CALL check("h5fclose_f", error, total_error) - IF(cleanup) CALL h5_cleanup_f(filename, H5P_DEFAULT_F, error) - CALL check("h5_cleanup_f", error, total_error) - - RETURN - END SUBROUTINE datasettest - -! -!the following subroutine tests h5dextend_f functionality -! - - SUBROUTINE extenddsettest(cleanup, total_error) - - IMPLICIT NONE - - LOGICAL, INTENT(IN) :: cleanup - INTEGER, INTENT(OUT) :: total_error - - ! - !the dataset is stored in file "extf.h5" - ! - CHARACTER(LEN=4), PARAMETER :: filename = "extf" - CHARACTER(LEN=80) :: fix_filename - - ! - !dataset name is "ExtendibleArray" - ! - CHARACTER(LEN=15), PARAMETER :: dsetname = "ExtendibleArray" - - ! - !dataset rank is 2 - ! - INTEGER :: RANK = 2 - - INTEGER(HID_T) :: file_id ! File identifier - INTEGER(HID_T) :: dset_id ! Dataset identifier - INTEGER(HID_T) :: dataspace ! Dataspace identifier - INTEGER(HID_T) :: memspace ! memory Dataspace identifier - INTEGER(HID_T) :: crp_list ! dataset creatation property identifier - - ! - !dataset dimensions at creation time - ! - INTEGER(HSIZE_T), DIMENSION(2) :: dims = (/3,3/) - - ! - !data dimensions - ! - INTEGER(HSIZE_T), DIMENSION(2) :: dims1 = (/10,3/) - - ! - !Maximum dimensions - ! - INTEGER(HSIZE_T), DIMENSION(2) :: maxdims - - ! - !data arrays for reading and writing - ! - INTEGER, DIMENSION(10,3) :: data_in, data_out - - ! - !Size of data in the file - ! - INTEGER(HSIZE_T), DIMENSION(2) :: size - - ! - !general purpose integer - ! - INTEGER :: i, j - INTEGER(HSIZE_T) :: ih, jh - - ! - !flag to check operation success - ! - INTEGER :: error - - ! - !Variables used in reading data back - ! - INTEGER(HSIZE_T), DIMENSION(2) :: dimsr, maxdimsr - INTEGER :: rankr - INTEGER(HSIZE_T), DIMENSION(2) :: data_dims - - ! - !data initialization - ! - DO i = 1, 10 - DO j = 1, 3 - data_in(i,j) = 2 - END DO - END DO - - ! - !Initialize FORTRAN predifined datatypes - ! -! CALL h5init_types_f(error) -! CALL check("h5init_types_f",error,total_error) - - ! - !Create a new file using default properties. - ! - CALL h5_fixname_f(filename, fix_filename, H5P_DEFAULT_F, error) - IF (error .NE. 0) THEN - WRITE(*,*) "Cannot modify filename" - STOP - ENDIF - CALL h5fcreate_f(fix_filename, H5F_ACC_TRUNC_F, file_id, error) - CALL check("h5fcreate_f",error,total_error) - - ! - !Create the data space with unlimited dimensions. - ! - maxdims = (/H5S_UNLIMITED_F, H5S_UNLIMITED_F/) - - CALL h5screate_simple_f(RANK, dims, dataspace, error, maxdims) - CALL check("h5screate_simple_f",error,total_error) - - ! - !Modify dataset creation properties, i.e. enable chunking - ! - CALL h5pcreate_f(H5P_DATASET_CREATE_F, crp_list, error) - CALL check("h5pcreate_f",error,total_error) - - CALL h5pset_chunk_f(crp_list, RANK, dims1, error) - CALL check("h5pset_chunk_f",error,total_error) - - ! - !Create a dataset with 3X3 dimensions using cparms creation propertie . - ! - CALL h5dcreate_f(file_id, dsetname, H5T_NATIVE_INTEGER, dataspace, dset_id, error, crp_list ) - CALL check("h5dcreate_f",error,total_error) - - ! - !Extend the dataset. This call assures that dataset is 3 x 3. - ! - SIZE(1) = 3 - SIZE(2) = 3 - CALL h5dextend_f(dset_id, size, error) - CALL check("h5dextend_f",error,total_error) - - - ! - !Extend the dataset. Dataset becomes 10 x 3. - ! - SIZE(1) = 10; - SIZE(2) = 3; - CALL h5dextend_f(dset_id, size, error) - CALL check("h5dextend_f",error,total_error) - - ! - !Write the data of size 10X3 to the extended dataset. - ! - data_dims(1) = 10 - data_dims(2) = 3 - CALL H5dwrite_f(dset_id, H5T_NATIVE_INTEGER, data_in, data_dims, error) - CALL check("h5dwrite_f",error,total_error) - - ! - !Close the dataspace for the dataset. - ! - CALL h5sclose_f(dataspace, error) - CALL check("h5sclose_f",error,total_error) - - ! - !Close the property list. - ! - CALL h5pclose_f(crp_list, error) - CALL check("h5pclose_f",error,total_error) - ! - !Close the dataset. - ! - CALL h5dclose_f(dset_id, error) - CALL check("h5dclose_f",error,total_error) - - ! - !Close the file. - ! - CALL h5fclose_f(file_id, error) - CALL check("h5fclose_f",error,total_error) - - ! - !read the data back - ! - !Open the file. - ! - CALL h5fopen_f (fix_filename, H5F_ACC_RDONLY_F, file_id, error) - CALL check("hfopen_f",error,total_error) - - ! - !Open the dataset. - ! - CALL h5dopen_f(file_id, dsetname, dset_id, error) - CALL check("h5dopen_f",error,total_error) - - ! - !Get dataset's dataspace handle. - ! - CALL h5dget_space_f(dset_id, dataspace, error) - CALL check("h5dget_space_f",error,total_error) - - ! - !Get dataspace's rank. - ! - CALL h5sget_simple_extent_ndims_f(dataspace, rankr, error) - CALL check("h5sget_simple_extent_ndims_f",error,total_error) - IF (rankr .NE. RANK) THEN - WRITE(*,*) "dataset rank error occured" - STOP - END IF - - ! - !Get dataspace's dimensinons. - ! - CALL h5sget_simple_extent_dims_f(dataspace, dimsr, maxdimsr, error) - CALL check("h5sget_simple_extent_dims_f",error,total_error) - IF ((dimsr(1) .NE. dims1(1)) .OR. (dimsr(2) .NE. dims1(2))) THEN - WRITE(*,*) "dataset dimensions error occured" - STOP - END IF - - ! - !Get creation property list. - ! - CALL h5dget_create_plist_f(dset_id, crp_list, error) - CALL check("h5dget_create_plist_f",error,total_error) - - - ! - !create memory dataspace. - ! - CALL h5screate_simple_f(rankr, dimsr, memspace, error) - CALL check("h5screate_simple_f",error,total_error) - - ! - !Read data - ! - CALL H5dread_f(dset_id, H5T_NATIVE_INTEGER, data_out, data_dims, error, memspace, dataspace) - CALL check("h5dread_f",error,total_error) - - - ! - !Compare the data. - ! - DO ih = 1, dims1(1) - DO jh = 1, dims1(2) - IF (data_out(ih,jh) .NE. data_in(ih, jh)) THEN - WRITE(*, *) "extend dataset test error occured" - WRITE(*, *) "read value is not the same as the written values" - END IF - END DO - END DO - - ! - !Close the dataspace for the dataset. - ! - CALL h5sclose_f(dataspace, error) - CALL check("h5sclose_f",error,total_error) - - ! - !Close the memspace for the dataset. - ! - CALL h5sclose_f(memspace, error) - CALL check("h5sclose_f",error,total_error) - - ! - !Close the property list. - ! - CALL h5pclose_f(crp_list, error) - CALL check("h5pclose_f",error,total_error) - - ! - !Close the dataset. - ! - CALL h5dclose_f(dset_id, error) - CALL check("h5dclose_f",error,total_error) - - ! - !Close the file. - ! - CALL h5fclose_f(file_id, error) - CALL check("h5fclose_f",error,total_error) - IF(cleanup) CALL h5_cleanup_f(filename, H5P_DEFAULT_F, error) - CALL check("h5_cleanup_f", error, total_error) - - RETURN - END SUBROUTINE extenddsettest - -! -! The following subroutine tests h5dget_offset_f functionality -! - - SUBROUTINE test_userblock_offset(cleanup, total_error) - - USE ISO_C_BINDING - - IMPLICIT NONE - LOGICAL, INTENT(IN) :: cleanup - INTEGER, INTENT(OUT) :: total_error - ! - !the dataset is stored in file "offset.h5" - ! - INTEGER, PARAMETER :: dset_dim1=2, dset_dim2=10 - CHARACTER(LEN=6), PARAMETER :: filename = "offset" - CHARACTER(LEN=80) :: fix_filename - - INTEGER(hid_t) :: file, fcpl, dataset, space - INTEGER :: i, j, n, ios - INTEGER(hsize_t), DIMENSION(1:2) :: dims - INTEGER :: f - INTEGER(haddr_t) :: offset - INTEGER, DIMENSION(1:dset_dim1,1:dset_dim2), TARGET :: rdata, data_in - INTEGER :: error - TYPE(C_PTR) :: f_ptr - ! - !Create a new file using default properties. - ! - CALL h5_fixname_f(filename, fix_filename, H5P_DEFAULT_F, error) - IF (error .NE. 0) THEN - WRITE(*,*) "Cannot modify filename" - STOP - ENDIF - - CALL h5pcreate_f(H5P_FILE_CREATE_F, fcpl, error) - CALL check("h5pcreate_f",error,total_error) - - ! Initialize the dataset - n = 0 - DO i = 1, dset_dim1 - DO j = 1, dset_dim2 - n = n + 1 - data_in(i,j) = n - END DO - END DO - CALL h5fcreate_f(fix_filename, H5F_ACC_TRUNC_F, file, error, fcpl) - CALL check("h5fcreate_f",error,total_error) - - ! Create the data space - dims(1:2) = (/dset_dim1,dset_dim2/) - - CALL h5screate_simple_f(2, dims, space, error) - CALL check("h5screate_simple_f",error,total_error) - - ! Create the dataset - CALL h5dcreate_f(file, "dset1", H5T_NATIVE_INTEGER, space, dataset, error) - CALL check("h5dcreate_f", error, total_error) - - ! Test dataset address. Should be undefined. - CALL h5dget_offset_f(dataset, offset, error) - CALL VERIFY("h5dget_offset_f",offset, HADDR_UNDEF_F, total_error) - - ! Write the data to the dataset - f_ptr = C_LOC(data_in(1,1)) - CALL h5dwrite_f(dataset, H5T_NATIVE_INTEGER, f_ptr, error) - CALL check("h5dwrite_f", error, total_error) - - ! Test dataset address in file. Open the same file as a C file, seek - ! the data position as H5Dget_offset points to, read the dataset, and - ! compare it with the data written in. - CALL h5dget_offset_f(dataset, offset, error) - CALL check("h5dget_offset_f", error, total_error) - IF(offset.EQ.HADDR_UNDEF_F)THEN - total_error = total_error + 1 - ENDIF - - CALL h5dclose_f(dataset, error) - CALL check("h5dclose_f", error, total_error) - CALL h5fclose_f(file, error) - CALL check("h5fclose_f", error, total_error) - - IF(total_error.NE.0) RETURN - - OPEN(10,FILE=fix_filename, ACCESS="STREAM", IOSTAT=ios) - IF(ios.NE.0)THEN - WRITE(*,'(A)') "Failed to open file "//TRIM(fix_filename) - total_error = total_error + 1 - RETURN - ENDIF - ! The pos= specifier illustrates that positions are in bytes, - ! starting from byte 1 (as opposed to C, where they start from byte 0) - READ(10, POS=offset+1, IOSTAT=ios) rdata - IF(ios.NE.0)THEN - WRITE(*,'(A)') "Failed to read data from stream I/O " - total_error = total_error + 1 - CLOSE(10) - RETURN - ENDIF - - ! Check that the values read are the same as the values written - DO i = 1, dset_dim1 - DO j = 1, dset_dim2 - CALL VERIFY("h5dget_offset_f",rdata(i,j), data_in(i,j), total_error) - IF(total_error.NE.0)THEN - WRITE(*,'(A)') " Read different values than written." - WRITE(*,'(2(A,I0))') " At index ",i,",",j - CLOSE(10) - RETURN - ENDIF - END DO - END DO - - CLOSE(10) - - END SUBROUTINE test_userblock_offset - -END MODULE TH5D - diff --git a/fortran/test/tH5E.F90 b/fortran/test/tH5E.F90 new file mode 100644 index 0000000..10ecaf6 --- /dev/null +++ b/fortran/test/tH5E.F90 @@ -0,0 +1,102 @@ +!****h* root/fortran/test/tH5E.f90 +! +! NAME +! tH5E.f90 +! +! FUNCTION +! Basic testing of Fortran H5E 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. * +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! +! NOTES +! Tests the H5D APIs functionalities of: +! h5eprint_f +! +! CONTAINS SUBROUTINES +! error_report_test +! +!***** +! +MODULE TH5E + +CONTAINS + + SUBROUTINE error_report_test(cleanup, total_error) + +! This subroutine tests following functionalities: h5eprint_f + + USE HDF5 ! This module contains all necessary modules + USE TH5_MISC + + IMPLICIT NONE + LOGICAL, INTENT(IN) :: cleanup + INTEGER, INTENT(INOUT) :: total_error + + CHARACTER(LEN=6), PARAMETER :: filename = "etestf" ! File name + CHARACTER(LEN=80) :: fix_filename + CHARACTER(LEN=8), PARAMETER :: err_filename = "err_file"! Error output file + CHARACTER(LEN=80) :: fix_err_filename + + + + INTEGER(HID_T) :: file_id ! File identifier + INTEGER(HID_T) :: grp_id ! Group identifier + INTEGER :: error, tmp_error, err_flag + + err_flag = 0 + CALL h5eset_auto_f(err_flag, error) + CALL check("h5eprint_f",error, total_error) + ! + ! Create a new file using default properties. + ! + CALL h5_fixname_f(filename, fix_filename, H5P_DEFAULT_F, error) + if (error .ne. 0) then + write(*,*) "Cannot modify filename" + stop + endif + CALL h5fcreate_f(fix_filename, H5F_ACC_TRUNC_F, file_id, error) + CALL check("h5fcreate_f",error,total_error) + + ! + ! Try to open non-existing group in the file. + ! Error message should go to the err_file_name file. + ! + CALL h5gopen_f(file_id, "Doesnotexist1", grp_id, tmp_error) + CALL h5_fixname_f(err_filename, fix_err_filename, H5P_DEFAULT_F, error) + if (error .ne. 0) then + write(*,*) "Cannot modify filename" + stop + endif + CALL h5eprint_f(error, fix_err_filename) + CALL h5gopen_f(file_id, "Doesnotexist2", grp_id, tmp_error) + CALL h5eprint_f(error, fix_err_filename) + + ! + ! Close the file. + ! + CALL h5fclose_f(file_id, error) + CALL check("h5fclose_f",error,total_error) + + if(cleanup) CALL h5_cleanup_f(filename, H5P_DEFAULT_F, error) + CALL check("h5_cleanup_f", error, total_error) + if(cleanup) CALL h5_cleanup_f(err_filename, H5P_DEFAULT_F, error) + CALL check("h5_cleanup_f", error, total_error) + RETURN + END SUBROUTINE error_report_test + +END MODULE TH5E + diff --git a/fortran/test/tH5E.f90 b/fortran/test/tH5E.f90 deleted file mode 100644 index 10ecaf6..0000000 --- a/fortran/test/tH5E.f90 +++ /dev/null @@ -1,102 +0,0 @@ -!****h* root/fortran/test/tH5E.f90 -! -! NAME -! tH5E.f90 -! -! FUNCTION -! Basic testing of Fortran H5E 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. * -! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -! -! NOTES -! Tests the H5D APIs functionalities of: -! h5eprint_f -! -! CONTAINS SUBROUTINES -! error_report_test -! -!***** -! -MODULE TH5E - -CONTAINS - - SUBROUTINE error_report_test(cleanup, total_error) - -! This subroutine tests following functionalities: h5eprint_f - - USE HDF5 ! This module contains all necessary modules - USE TH5_MISC - - IMPLICIT NONE - LOGICAL, INTENT(IN) :: cleanup - INTEGER, INTENT(INOUT) :: total_error - - CHARACTER(LEN=6), PARAMETER :: filename = "etestf" ! File name - CHARACTER(LEN=80) :: fix_filename - CHARACTER(LEN=8), PARAMETER :: err_filename = "err_file"! Error output file - CHARACTER(LEN=80) :: fix_err_filename - - - - INTEGER(HID_T) :: file_id ! File identifier - INTEGER(HID_T) :: grp_id ! Group identifier - INTEGER :: error, tmp_error, err_flag - - err_flag = 0 - CALL h5eset_auto_f(err_flag, error) - CALL check("h5eprint_f",error, total_error) - ! - ! Create a new file using default properties. - ! - CALL h5_fixname_f(filename, fix_filename, H5P_DEFAULT_F, error) - if (error .ne. 0) then - write(*,*) "Cannot modify filename" - stop - endif - CALL h5fcreate_f(fix_filename, H5F_ACC_TRUNC_F, file_id, error) - CALL check("h5fcreate_f",error,total_error) - - ! - ! Try to open non-existing group in the file. - ! Error message should go to the err_file_name file. - ! - CALL h5gopen_f(file_id, "Doesnotexist1", grp_id, tmp_error) - CALL h5_fixname_f(err_filename, fix_err_filename, H5P_DEFAULT_F, error) - if (error .ne. 0) then - write(*,*) "Cannot modify filename" - stop - endif - CALL h5eprint_f(error, fix_err_filename) - CALL h5gopen_f(file_id, "Doesnotexist2", grp_id, tmp_error) - CALL h5eprint_f(error, fix_err_filename) - - ! - ! Close the file. - ! - CALL h5fclose_f(file_id, error) - CALL check("h5fclose_f",error,total_error) - - if(cleanup) CALL h5_cleanup_f(filename, H5P_DEFAULT_F, error) - CALL check("h5_cleanup_f", error, total_error) - if(cleanup) CALL h5_cleanup_f(err_filename, H5P_DEFAULT_F, error) - CALL check("h5_cleanup_f", error, total_error) - RETURN - END SUBROUTINE error_report_test - -END MODULE TH5E - diff --git a/fortran/test/tH5E_F03.F90 b/fortran/test/tH5E_F03.F90 new file mode 100644 index 0000000..63e70a3 --- /dev/null +++ b/fortran/test/tH5E_F03.F90 @@ -0,0 +1,203 @@ +!****h* root/fortran/test/tH5E_F03.f90 +! +! NAME +! tH5E_F03.f90 +! +! FUNCTION +! Test FORTRAN HDF5 H5E APIs which are dependent on FORTRAN 2003 +! features. +! +! 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. * +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! +! USES +! liter_cb_mod +! +! CONTAINS SUBROUTINES +! test_error +! +!***** + +! ***************************************** +! *** H 5 E T E S T S +! ***************************************** +MODULE test_my_hdf5_error_handler + + USE HDF5 + USE TH5_MISC + USE TH5_MISC_GEN + +CONTAINS + +!*************************************************************** +!** +!** my_hdf5_error_handler: Custom error callback routine. +!** +!*************************************************************** + + INTEGER FUNCTION my_hdf5_error_handler(estack_id, data_inout) bind(C) + + ! This error function handle works with only version 2 error stack + + IMPLICIT NONE + + ! estack_id is always passed from C as: H5E_DEFAULT + INTEGER(HID_T) :: estack_id + ! data that was registered with H5Eset_auto_f + INTEGER :: data_inout + + PRINT*, " " + PRINT*, " Subtest: H5Eset_auto_f custom error message with callback, WITH DATA" + PRINT*, " -This message should be written to standard out- " + PRINT*, " Data Values Passed In =", data_inout + PRINT*, " " + + data_inout = 10*data_inout + + my_hdf5_error_handler = 1 ! this is not used by the C routine + + END FUNCTION my_hdf5_error_handler + + INTEGER FUNCTION my_hdf5_error_handler_nodata(estack_id, data_inout) bind(C) + + ! This error function handle works with only version 2 error stack + + IMPLICIT NONE + + ! estack_id is always passed from C as: H5E_DEFAULT + INTEGER(HID_T) :: estack_id + ! data that was registered with H5Eset_auto_f + TYPE(C_PTR) :: data_inout + + PRINT*, " " + PRINT*, " Subtest: H5Eset_auto_f custom error message with callback, NO DATA" + PRINT*, " -This message should be written to standard out- " + PRINT*, " " + + my_hdf5_error_handler_nodata = 1 ! this is not used by the C routine + + END FUNCTION my_hdf5_error_handler_nodata + +END MODULE test_my_hdf5_error_handler + + + +MODULE TH5E_F03 + +CONTAINS + +SUBROUTINE test_error(total_error) + + USE ISO_C_BINDING + USE test_my_hdf5_error_handler + + IMPLICIT NONE + + INTEGER(hid_t), PARAMETER :: FAKE_ID = -1 + INTEGER :: total_error + INTEGER(hid_t) :: file + INTEGER(hid_t) :: dataset, space + INTEGER(hsize_t), DIMENSION(1:2) :: dims + INTEGER :: error + INTEGER, DIMENSION(:), POINTER :: ptr_data + INTEGER, TARGET :: my_hdf5_error_handler_data + TYPE(C_PTR) :: f_ptr + TYPE(C_FUNPTR) :: func + + TYPE(C_PTR), TARGET :: f_ptr1 + + INTEGER, DIMENSION(1:1) :: array_shape + + my_hdf5_error_handler_data = 99 + CALL h5fcreate_f("terror.h5", H5F_ACC_TRUNC_F, file, error) + CALL check("h5fcreate_f", error, total_error) + + ! Create the data space + dims(1) = 10 + dims(2) = 20 + CALL H5Screate_simple_f(2, dims, space, error) + CALL check("h5screate_simple_f", error, total_error) + + ! ** SET THE CUSTOMIZED PRINTING OF ERROR STACK ** + + ! set the customized error handling routine + func = c_funloc(my_hdf5_error_handler) + + ! set the data sent to the customized routine + f_ptr = c_loc(my_hdf5_error_handler_data) + + ! turn on automatic printing, and use a custom error routine with input data + CALL H5Eset_auto_f(1, error, H5E_DEFAULT_F, func, f_ptr) + + ! Create the erring dataset + CALL h5dcreate_f(FAKE_ID,"a_dataset",H5T_NATIVE_INTEGER, space, dataset, error) + CALL verify("h5dcreate_f", error, -1, total_error) + +!!$ CALL verify("H5Eset_auto_f",my_hdf5_error_handler_data(1),10, total_error) +!!$ CALL verify("H5Eset_auto_f",my_hdf5_error_handler_data(2),20, total_error) + +!!$ ! Test enabling and disabling default printing +!!$ +!!$ CALL H5Eget_auto_f(H5E_DEFAULT_F, func1, f_ptr1, error) +!!$ CALL verify("H5Eget_auto_f", error, 0, total_error) + + ! PRINT*,c_associated(f_ptr1) + + ALLOCATE(ptr_data(1:2)) + ptr_data = 0 + array_shape(1) = 2 + CALL C_F_POINTER(f_ptr1, ptr_data, array_shape) + + ! ptr_data => f_ptr1(1) + + ! PRINT*,ptr_data(1) + +!!$ if(old_data != NULL) +!!$ TEST_ERROR; +!!$#ifdef H5_USE_16_API +!!$ if (old_func != (H5E_auto_t)H5Eprint) +!!$ TEST_ERROR; +!!$#else H5_USE_16_API +!!$ if (old_func != (H5E_auto2_t)H5Eprint2) +!!$ TEST_ERROR; +!!$#endif H5_USE_16_API + + + ! set the customized error handling routine + func = c_funloc(my_hdf5_error_handler_nodata) + ! set the data sent to the customized routine as null + f_ptr = C_NULL_PTR + ! turn on automatic printing, and use a custom error routine with no input data + CALL H5Eset_auto_f(1, error, H5E_DEFAULT_F, func, f_ptr) + + CALL h5dcreate_f(FAKE_ID,"a_dataset",H5T_NATIVE_INTEGER, space, dataset, error) + CALL verify("h5dcreate_f", error, -1, total_error) + + + ! turn on automatic printing with h5eprint_f which prints an error stack in the default manner. + + ! func = c_funloc(h5eprint_f) + ! CALL H5Eset_auto_f(0, error, H5E_DEFAULT_F, func, C_NULL_PTR) + + CALL H5Eset_auto_f(0, error) + CALL h5dcreate_f(FAKE_ID,"a_dataset",H5T_NATIVE_INTEGER, space, dataset, error) + + CALL H5Eset_auto_f(1, error) + CALL h5dcreate_f(FAKE_ID,"a_dataset",H5T_NATIVE_INTEGER, space, dataset, error) + +END SUBROUTINE test_error + +END MODULE TH5E_F03 diff --git a/fortran/test/tH5E_F03.f90 b/fortran/test/tH5E_F03.f90 deleted file mode 100644 index 63e70a3..0000000 --- a/fortran/test/tH5E_F03.f90 +++ /dev/null @@ -1,203 +0,0 @@ -!****h* root/fortran/test/tH5E_F03.f90 -! -! NAME -! tH5E_F03.f90 -! -! FUNCTION -! Test FORTRAN HDF5 H5E APIs which are dependent on FORTRAN 2003 -! features. -! -! 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. * -! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -! -! USES -! liter_cb_mod -! -! CONTAINS SUBROUTINES -! test_error -! -!***** - -! ***************************************** -! *** H 5 E T E S T S -! ***************************************** -MODULE test_my_hdf5_error_handler - - USE HDF5 - USE TH5_MISC - USE TH5_MISC_GEN - -CONTAINS - -!*************************************************************** -!** -!** my_hdf5_error_handler: Custom error callback routine. -!** -!*************************************************************** - - INTEGER FUNCTION my_hdf5_error_handler(estack_id, data_inout) bind(C) - - ! This error function handle works with only version 2 error stack - - IMPLICIT NONE - - ! estack_id is always passed from C as: H5E_DEFAULT - INTEGER(HID_T) :: estack_id - ! data that was registered with H5Eset_auto_f - INTEGER :: data_inout - - PRINT*, " " - PRINT*, " Subtest: H5Eset_auto_f custom error message with callback, WITH DATA" - PRINT*, " -This message should be written to standard out- " - PRINT*, " Data Values Passed In =", data_inout - PRINT*, " " - - data_inout = 10*data_inout - - my_hdf5_error_handler = 1 ! this is not used by the C routine - - END FUNCTION my_hdf5_error_handler - - INTEGER FUNCTION my_hdf5_error_handler_nodata(estack_id, data_inout) bind(C) - - ! This error function handle works with only version 2 error stack - - IMPLICIT NONE - - ! estack_id is always passed from C as: H5E_DEFAULT - INTEGER(HID_T) :: estack_id - ! data that was registered with H5Eset_auto_f - TYPE(C_PTR) :: data_inout - - PRINT*, " " - PRINT*, " Subtest: H5Eset_auto_f custom error message with callback, NO DATA" - PRINT*, " -This message should be written to standard out- " - PRINT*, " " - - my_hdf5_error_handler_nodata = 1 ! this is not used by the C routine - - END FUNCTION my_hdf5_error_handler_nodata - -END MODULE test_my_hdf5_error_handler - - - -MODULE TH5E_F03 - -CONTAINS - -SUBROUTINE test_error(total_error) - - USE ISO_C_BINDING - USE test_my_hdf5_error_handler - - IMPLICIT NONE - - INTEGER(hid_t), PARAMETER :: FAKE_ID = -1 - INTEGER :: total_error - INTEGER(hid_t) :: file - INTEGER(hid_t) :: dataset, space - INTEGER(hsize_t), DIMENSION(1:2) :: dims - INTEGER :: error - INTEGER, DIMENSION(:), POINTER :: ptr_data - INTEGER, TARGET :: my_hdf5_error_handler_data - TYPE(C_PTR) :: f_ptr - TYPE(C_FUNPTR) :: func - - TYPE(C_PTR), TARGET :: f_ptr1 - - INTEGER, DIMENSION(1:1) :: array_shape - - my_hdf5_error_handler_data = 99 - CALL h5fcreate_f("terror.h5", H5F_ACC_TRUNC_F, file, error) - CALL check("h5fcreate_f", error, total_error) - - ! Create the data space - dims(1) = 10 - dims(2) = 20 - CALL H5Screate_simple_f(2, dims, space, error) - CALL check("h5screate_simple_f", error, total_error) - - ! ** SET THE CUSTOMIZED PRINTING OF ERROR STACK ** - - ! set the customized error handling routine - func = c_funloc(my_hdf5_error_handler) - - ! set the data sent to the customized routine - f_ptr = c_loc(my_hdf5_error_handler_data) - - ! turn on automatic printing, and use a custom error routine with input data - CALL H5Eset_auto_f(1, error, H5E_DEFAULT_F, func, f_ptr) - - ! Create the erring dataset - CALL h5dcreate_f(FAKE_ID,"a_dataset",H5T_NATIVE_INTEGER, space, dataset, error) - CALL verify("h5dcreate_f", error, -1, total_error) - -!!$ CALL verify("H5Eset_auto_f",my_hdf5_error_handler_data(1),10, total_error) -!!$ CALL verify("H5Eset_auto_f",my_hdf5_error_handler_data(2),20, total_error) - -!!$ ! Test enabling and disabling default printing -!!$ -!!$ CALL H5Eget_auto_f(H5E_DEFAULT_F, func1, f_ptr1, error) -!!$ CALL verify("H5Eget_auto_f", error, 0, total_error) - - ! PRINT*,c_associated(f_ptr1) - - ALLOCATE(ptr_data(1:2)) - ptr_data = 0 - array_shape(1) = 2 - CALL C_F_POINTER(f_ptr1, ptr_data, array_shape) - - ! ptr_data => f_ptr1(1) - - ! PRINT*,ptr_data(1) - -!!$ if(old_data != NULL) -!!$ TEST_ERROR; -!!$#ifdef H5_USE_16_API -!!$ if (old_func != (H5E_auto_t)H5Eprint) -!!$ TEST_ERROR; -!!$#else H5_USE_16_API -!!$ if (old_func != (H5E_auto2_t)H5Eprint2) -!!$ TEST_ERROR; -!!$#endif H5_USE_16_API - - - ! set the customized error handling routine - func = c_funloc(my_hdf5_error_handler_nodata) - ! set the data sent to the customized routine as null - f_ptr = C_NULL_PTR - ! turn on automatic printing, and use a custom error routine with no input data - CALL H5Eset_auto_f(1, error, H5E_DEFAULT_F, func, f_ptr) - - CALL h5dcreate_f(FAKE_ID,"a_dataset",H5T_NATIVE_INTEGER, space, dataset, error) - CALL verify("h5dcreate_f", error, -1, total_error) - - - ! turn on automatic printing with h5eprint_f which prints an error stack in the default manner. - - ! func = c_funloc(h5eprint_f) - ! CALL H5Eset_auto_f(0, error, H5E_DEFAULT_F, func, C_NULL_PTR) - - CALL H5Eset_auto_f(0, error) - CALL h5dcreate_f(FAKE_ID,"a_dataset",H5T_NATIVE_INTEGER, space, dataset, error) - - CALL H5Eset_auto_f(1, error) - CALL h5dcreate_f(FAKE_ID,"a_dataset",H5T_NATIVE_INTEGER, space, dataset, error) - -END SUBROUTINE test_error - -END MODULE TH5E_F03 diff --git a/fortran/test/tH5F.F90 b/fortran/test/tH5F.F90 new file mode 100644 index 0000000..0b3c275 --- /dev/null +++ b/fortran/test/tH5F.F90 @@ -0,0 +1,782 @@ +!***rh* root/fortran/test/tH5F.f90 +! +! NAME +! tH5F.f90 +! +! FUNCTION +! Basic testing of Fortran H5F 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. * +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! +! CONTAINS SUBROUTINES +! mountingtest, reopentest, plisttest, file_close, file_space +! +!***** +! +! In the mountingtest subroutine we create one file with a group in it, +! and another file with a dataset. Mounting is used to +! access the dataset from the second file as a member of a group +! in the first file. + + + +MODULE TH5F + +CONTAINS + + SUBROUTINE mountingtest(cleanup, total_error) + USE HDF5 ! This module contains all necessary modules + USE TH5_MISC + IMPLICIT NONE + LOGICAL, INTENT(IN) :: cleanup + INTEGER, INTENT(INOUT) :: total_error + + ! + !the respective filename is "mount1.h5" and "mount2.h5" + ! + CHARACTER(LEN=6) :: filename1 + CHARACTER(LEN=6) :: filename2 + CHARACTER(LEN=80) :: fix_filename1 + CHARACTER(LEN=80) :: fix_filename2 + + ! + !data space rank and dimensions + ! + INTEGER, PARAMETER :: RANK = 2 + INTEGER, PARAMETER :: NX = 4 + INTEGER, PARAMETER :: NY = 5 + + ! + ! File identifiers + ! + INTEGER(HID_T) :: file1_id, file2_id + + ! + ! Group identifier + ! + INTEGER(HID_T) :: gid + + ! + ! dataset identifier + ! + INTEGER(HID_T) :: dset_id + + ! + ! data space identifier + ! + INTEGER(HID_T) :: dataspace + + ! + ! data type identifier + ! + INTEGER(HID_T) :: dtype_id + + ! + !The dimensions for the dataset. + ! + INTEGER(HSIZE_T), DIMENSION(2) :: dims = (/NX,NY/) + + ! + !return value for testing whether a file is in hdf5 format + ! + LOGICAL :: status + + ! + !flag to check operation success + ! + INTEGER :: error + + ! + !general purpose integer + ! + INTEGER :: i, j + + ! + !data buffers + ! + INTEGER, DIMENSION(NX,NY) :: data_in, data_out + + INTEGER(HSIZE_T), DIMENSION(2) :: data_dims + filename1 = "mount1" + filename2 = "mount2" + + do i = 1,80 + fix_filename1(i:i) = " " + fix_filename2(i:i) = " " + enddo + ! + !Initialize data_in buffer + ! + do j = 1, NY + do i = 1, NX + data_in(i,j) = (i-1) + (j-1) + end do + end do + + ! + ! Fix names of the files + ! + CALL h5_fixname_f(filename1, fix_filename1, H5P_DEFAULT_F, error) + if(error .ne. 0) stop + CALL h5_fixname_f(filename2, fix_filename2, H5P_DEFAULT_F, error) + if(error .ne. 0) stop + + ! + !Create first file "mount1.h5" using default properties. + ! + CALL h5fcreate_f(fix_filename1, H5F_ACC_TRUNC_F, file1_id, error) + CALL check("h5fcreate_f",error,total_error) + + ! + !Create group "/G" inside file "mount1.h5". + ! + CALL h5gcreate_f(file1_id, "/G", gid, error) + CALL check("h5gcreate_f",error,total_error) + ! + !close file and group identifiers. + ! + CALL h5gclose_f(gid, error) + CALL check("h5gclose_f",error,total_error) + CALL h5fclose_f(file1_id, error) + CALL check("h5fclose_f",error,total_error) + + ! + !Create second file "mount2.h5" using default properties. + ! + CALL h5fcreate_f(fix_filename2, H5F_ACC_TRUNC_F, file2_id, error) + CALL check("h5fcreate_f",error,total_error) + + ! + !Create data space for the dataset. + ! + CALL h5screate_simple_f(RANK, dims, dataspace, error) + CALL check("h5screate_simple_f",error,total_error) + + ! + !Create dataset "/D" inside file "mount2.h5". + ! + CALL h5dcreate_f(file2_id, "/D", H5T_NATIVE_INTEGER, dataspace, & + dset_id, error) + CALL check("h5dcreate_f",error,total_error) + + ! + ! Write data_in to the dataset + ! + data_dims(1) = NX + data_dims(2) = NY + CALL h5dwrite_f(dset_id, H5T_NATIVE_INTEGER, data_in, data_dims, error) + CALL check("h5dwrite_f",error,total_error) + + ! + !close file, dataset and dataspace identifiers. + ! + CALL h5sclose_f(dataspace, error) + CALL check("h5sclose_f",error,total_error) + CALL h5dclose_f(dset_id, error) + CALL check("h5dclose_f",error,total_error) + CALL h5fclose_f(file2_id, error) + CALL check("h5fclose_f",error,total_error) + + ! + !test whether files are in hdf5 format + ! + CALL h5fis_hdf5_f(fix_filename1, status, error) + CALL check("h5fis_hdf5_f",error,total_error) + IF ( .NOT. status ) THEN + write(*,*) "File ", fix_filename1, " is not in hdf5 format" + stop + END IF + + CALL h5fis_hdf5_f(fix_filename2, status, error) + CALL check("h5fis_hdf5_f",error,total_error) + IF ( .NOT. status ) THEN + write(*,*) "File ", fix_filename2, " is not in hdf5 format" + stop + END IF + + ! + !reopen both files. + ! + CALL h5fopen_f (fix_filename1, H5F_ACC_RDWR_F, file1_id, error) + CALL check("hfopen_f",error,total_error) + CALL h5fopen_f (fix_filename2, H5F_ACC_RDWR_F, file2_id, error) + CALL check("h5fopen_f",error,total_error) + + ! + !mount the second file under the first file's "/G" group. + ! + CALL h5fmount_f (file1_id, "/G", file2_id, error) + CALL check("h5fmount_f",error,total_error) + + + ! + !Access dataset D in the first file under /G/D name. + ! + CALL h5dopen_f(file1_id, "/G/D", dset_id, error) + CALL check("h5dopen_f",error,total_error) + + ! + !Get dataset's data type. + ! + CALL h5dget_type_f(dset_id, dtype_id, error) + CALL check("h5dget_type_f",error,total_error) + + ! + !Read the dataset. + ! + CALL h5dread_f(dset_id, dtype_id, data_out, data_dims, error) + CALL check("h5dread_f",error,total_error) + + ! + !Compare the data. + ! + do i = 1, NX + do j = 1, NY + IF (data_out(i,j) .NE. data_in(i, j)) THEN + END IF + end do + end do + + + ! + !Close dset_id and dtype_id. + ! + CALL h5dclose_f(dset_id, error) + CALL check("h5dclose_f",error,total_error) + CALL h5tclose_f(dtype_id, error) + CALL check("h5tclose_f",error,total_error) + + ! + !unmount the second file. + ! + CALL h5funmount_f(file1_id, "/G", error); + CALL check("h5funmount_f",error,total_error) + + ! + !Close both files. + ! + CALL h5fclose_f(file1_id, error) + CALL check("h5fclose_f",error,total_error) + CALL h5fclose_f(file2_id, error) + CALL check("h5fclose_f",error,total_error) + + if(cleanup) CALL h5_cleanup_f(filename1, H5P_DEFAULT_F, error) + CALL check("h5_cleanup_f", error, total_error) + if(cleanup) CALL h5_cleanup_f(filename2, H5P_DEFAULT_F, error) + CALL check("h5_cleanup_f", error, total_error) + RETURN + END SUBROUTINE mountingtest + +! +! The following subroutine tests h5freopen_f. +! It creates the file which has name "reopen.h5" and +! the "/dset" dataset inside the file. +! writes the data to the file, close the dataset. +! Reopen the file based upon the file_id, open the +! dataset use the reopen_id then reads the +! dataset back to memory to test whether the data +! read is identical to the data written +! + + SUBROUTINE reopentest(cleanup, total_error) + USE HDF5 ! This module contains all necessary modules + USE TH5_MISC + IMPLICIT NONE + LOGICAL, INTENT(IN) :: cleanup + INTEGER, INTENT(INOUT) :: total_error + + ! + CHARACTER(LEN=6), PARAMETER :: filename = "reopen" + CHARACTER(LEN=80) :: fix_filename + + INTEGER(HID_T) :: file_id, reopen_id ! File identifiers + INTEGER(HID_T) :: dset_id ! Dataset identifier + + ! + !dataset name is "dset" + ! + CHARACTER(LEN=4), PARAMETER :: dsetname = "dset" + + ! + !data space rank and dimensions + ! + INTEGER, PARAMETER :: RANK = 2 + INTEGER, PARAMETER :: NX = 4 + INTEGER, PARAMETER :: NY = 6 + + ! + ! data space identifier + ! + INTEGER(HID_T) :: dataspace + + ! + !The dimensions for the dataset. + ! + INTEGER(HSIZE_T), DIMENSION(2) :: dims = (/NX,NY/) + + ! + !flag to check operation success + ! + INTEGER :: error + + ! + !general purpose integer + ! + INTEGER :: i, j + + ! + !array to store data + ! + INTEGER, DIMENSION(4,6) :: dset_data, data_out + INTEGER(HSIZE_T), DIMENSION(2) :: data_dims + INTEGER(HSIZE_T) :: file_size + CHARACTER(LEN=80) :: file_name + INTEGER(SIZE_T) :: name_size + + ! + !initialize the dset_data array which will be written to the "/dset" + ! + do j = 1, NY + do i = 1, NX + dset_data(i,j) = (i-1)*6 + j; + end do + end do + + ! + !Initialize FORTRAN predifined datatypes + ! +! CALL h5init_types_f(error) +! CALL check("h5init_types_f",error,total_error) + + + ! + !Create file "reopen.h5" using default properties. + ! + CALL h5_fixname_f(filename, fix_filename, H5P_DEFAULT_F, error) + if (error .ne. 0) then + write(*,*) "Cannot modify filename" + stop + endif + CALL h5fcreate_f(fix_filename, H5F_ACC_TRUNC_F, file_id, error) + CALL check("h5fcreate_f",error,total_error) + + ! + !Create data space for the dataset. + ! + CALL h5screate_simple_f(RANK, dims, dataspace, error) + CALL check("h5screate_simple_f",error,total_error) + + ! + !Create dataset "/dset" inside the file . + ! + CALL h5dcreate_f(file_id, dsetname, H5T_NATIVE_INTEGER, dataspace, & + dset_id, error) + CALL check("h5dcreate_f",error,total_error) + + ! + !Write the dataset. + ! + data_dims(1) = NX + data_dims(2) = NY + CALL h5dwrite_f(dset_id, H5T_NATIVE_INTEGER, dset_data, data_dims, error) + CALL check("h5dwrite_f",error,total_error) + + ! + !close the dataset. + ! + CALL h5dclose_f(dset_id, error) + CALL check("h5dclose_f",error,total_error) + + ! + !close the dataspace. + ! + CALL h5sclose_f(dataspace, error) + CALL check("h5sclose_f",error,total_error) + + ! + !Reopen file dsetf.h5. + ! + CALL h5freopen_f(file_id, reopen_id, error) + CALL check("h5freopen_f",error,total_error) + ! + !Check file size + ! + CALL h5fget_filesize_f(file_id, file_size, error) + CALL check("h5fget_filesize_f",error,total_error) + + ! + !Open the dataset based on the reopen_id. + ! + CALL h5dopen_f(reopen_id, dsetname, dset_id, error) + CALL check("h5dopen_f",error,total_error) + ! + !Get file name from the dataset identifier + ! + CALL h5fget_name_f(dset_id, file_name, name_size, error) + CALL check("h5fget_name_f",error,total_error) + IF(file_name(1:name_size) .NE. fix_filename(1:name_size)) THEN + write(*,*) "file name obtained from the dataset id is incorrect" + END IF + + ! + !Read the dataset. + ! + CALL h5dread_f(dset_id, H5T_NATIVE_INTEGER, data_out, data_dims, error) + CALL check("h5dread_f",error,total_error) + + ! + !Compare the data. + ! + do i = 1, NX + do j = 1, NY + IF (data_out(i,j) .NE. dset_data(i, j)) THEN + write(*, *) "reopen test error occured" + END IF + end do + end do + + + ! + !Close the dataset. + ! + CALL h5dclose_f(dset_id, error) + CALL check("h5dclose_f",error,total_error) + + ! + !Close the file identifiers. + ! + CALL h5fclose_f(file_id, error) + CALL check("h5fclose_f",error,total_error) + CALL h5fclose_f(reopen_id, error) + CALL check("h5fclose_f",error,total_error) + + + if(cleanup) CALL h5_cleanup_f(filename, H5P_DEFAULT_F, error) + CALL check("h5_cleanup_f", error, total_error) + RETURN + + END SUBROUTINE reopentest + +! +! The following example demonstrates how to get creation property list, +! and access property list. +! We first create a file using the default creation and access property +! list. Then, the file was closed and reopened. We then get the +! creation and access property lists of the first file. The second file is +! created using the got property lists + + SUBROUTINE plisttest(cleanup, total_error) + USE HDF5 ! This module contains all necessary modules + USE TH5_MISC + IMPLICIT NONE + LOGICAL, INTENT(IN) :: cleanup + INTEGER, INTENT(INOUT) :: total_error + + ! + !file names are "plist1.h5" and "plist2.h5" + ! + CHARACTER(LEN=6), PARAMETER :: filename1 = "plist1" + CHARACTER(LEN=80) :: fix_filename1 + CHARACTER(LEN=6), PARAMETER :: filename2 = "plist2" + CHARACTER(LEN=80) :: fix_filename2 + + INTEGER(HID_T) :: file1_id, file2_id ! File identifiers + INTEGER(HID_T) :: prop_id ! File creation property list identifier + INTEGER(HID_T) :: access_id ! File Access property list identifier + + !flag to check operation success + INTEGER :: error + + ! + !Create a file1 using default properties. + ! + CALL h5_fixname_f(filename1, fix_filename1, H5P_DEFAULT_F, error) + if (error .ne. 0) then + write(*,*) "Cannot modify file name" + stop + endif + CALL h5fcreate_f(fix_filename1, H5F_ACC_TRUNC_F, file1_id, error) + CALL check("h5fcreate_f",error,total_error) + + ! + !Terminate access to the file. + ! + CALL h5fclose_f(file1_id, error) + CALL check("h5fclose_f",error,total_error) + + ! + !Open an existing file. + ! + CALL h5fopen_f (fix_filename1, H5F_ACC_RDWR_F, file1_id, error) + CALL check("h5fopen_f",error,total_error) + + ! + !get the creation property list. + ! + CALL h5fget_create_plist_f(file1_id, prop_id, error) + CALL check("h5fget_create_plist_f",error,total_error) + + ! + !get the access property list. + ! + CALL h5fget_access_plist_f(file1_id, access_id, error) + CALL check("h5fget_access_plist_f",error,total_error) + + ! + !based on the creation property list id and access property list id + !create a new file + ! + CALL h5_fixname_f(filename2, fix_filename2, H5P_DEFAULT_F, error) + if (error .ne. 0) then + write(*,*) "Cannot modify file name" + stop + endif + CALL h5fcreate_f(fix_filename2, H5F_ACC_TRUNC_F, file2_id, error, & + prop_id, access_id) + CALL check("h5create_f",error,total_error) + + ! + !Close all the property lists. + ! + CALL h5pclose_f(prop_id, error) + CALL check("h5pclose_f",error,total_error) + CALL h5pclose_f(access_id, error) + CALL check("h5pclose_f",error,total_error) + + ! + !Terminate access to the files. + ! + CALL h5fclose_f(file1_id, error) + CALL check("h5fclose_f",error,total_error) + + CALL h5fclose_f(file2_id, error) + CALL check("h5fclose_f",error,total_error) + + if(cleanup) CALL h5_cleanup_f(filename1, H5P_DEFAULT_F, error) + CALL check("h5_cleanup_f", error, total_error) + if(cleanup) CALL h5_cleanup_f(filename2, H5P_DEFAULT_F, error) + CALL check("h5_cleanup_f", error, total_error) + RETURN + + END SUBROUTINE plisttest + + +! +! The following subroutine tests h5pget(set)_fclose_degree_f +! + + SUBROUTINE file_close(cleanup, total_error) + USE HDF5 ! This module contains all necessary modules + USE TH5_MISC + IMPLICIT NONE + LOGICAL, INTENT(IN) :: cleanup + INTEGER, INTENT(INOUT) :: total_error + INTEGER :: error + + ! + CHARACTER(LEN=10), PARAMETER :: filename = "file_close" + CHARACTER(LEN=80) :: fix_filename + + INTEGER(HID_T) :: fid, fid_d, fid1, fid2, fid3 ! File identifiers + INTEGER(HID_T) :: fapl, fapl1, fapl2, fapl3 ! File access identifiers + INTEGER(HID_T) :: fid_d_fapl, fid1_fapl ! File access identifiers + LOGICAL :: flag + INTEGER(SIZE_T) :: obj_count, obj_countf + INTEGER(HID_T), ALLOCATABLE, DIMENSION(:) :: obj_ids + INTEGER :: i + + CALL h5eset_auto_f(0, error) + + CALL h5_fixname_f(filename, fix_filename, H5P_DEFAULT_F, error) + if (error .ne. 0) then + write(*,*) "Cannot modify filename" + stop + endif + CALL h5fcreate_f(fix_filename, H5F_ACC_TRUNC_F, fid, error) + CALL check("h5fcreate_f",error,total_error) + + CALL h5pcreate_f(H5P_FILE_ACCESS_F, fapl, error) + CALL check("h5pcreate_f",error,total_error) + CALL h5pset_fclose_degree_f(fapl, H5F_CLOSE_DEFAULT_F, error) + CALL check("h5pset_fclose_degree_f",error,total_error) + + + CALL h5pcreate_f(H5P_FILE_ACCESS_F, fapl1, error) + CALL check("h5pcreate_f",error,total_error) + CALL h5pset_fclose_degree_f(fapl1, H5F_CLOSE_WEAK_F, error) + CALL check("h5pset_fclose_degree_f",error,total_error) + + + CALL h5pcreate_f(H5P_FILE_ACCESS_F, fapl2, error) + CALL check("h5pcreate_f",error,total_error) + CALL h5pset_fclose_degree_f(fapl2, H5F_CLOSE_SEMI_F, error) + CALL check("h5pset_fclose_degree_f",error,total_error) + + CALL h5pcreate_f(H5P_FILE_ACCESS_F, fapl3, error) + CALL check("h5pcreate_f",error,total_error) + CALL h5pset_fclose_degree_f(fapl3, H5F_CLOSE_STRONG_F, error) + CALL check("h5pset_fclose_degree_f",error,total_error) + + CALL h5fopen_f(fix_filename, H5F_ACC_RDWR_F, fid1, error, access_prp=fapl1) + CALL check("h5fopen_f",error,total_error) + CALL h5fopen_f(fix_filename, H5F_ACC_RDWR_F, fid_d, error, access_prp=fapl) + CALL check("h5fopen_f",error,total_error) + CALL h5fget_access_plist_f(fid1, fid1_fapl, error) + CALL check("h5fget_access_plist_f",error,total_error) + CALL h5fget_access_plist_f(fid_d, fid_d_fapl, error) + CALL check("h5fget_access_plist_f",error,total_error) + + CALL h5pequal_f(fid_d_fapl, fid1_fapl, flag, error) + CALL check("h5pequal_f",error,total_error) + if (.NOT. flag) then + write(*,*) " File access lists should be equal, error " + total_error=total_error + 1 + endif + CALL h5fopen_f(fix_filename, H5F_ACC_RDWR_F, fid2, error, access_prp=fapl2) + if( error .ne. -1) then + total_error = total_error + 1 + write(*,*) " Open with H5F_CLOSE_SEMI should fail " + endif + CALL h5fopen_f(fix_filename, H5F_ACC_RDWR_F, fid3, error, access_prp=fapl3) + if( error .ne. -1) then + total_error = total_error + 1 + write(*,*) " Open with H5F_CLOSE_STRONG should fail " + endif + + CALL h5fget_obj_count_f(fid1, H5F_OBJ_ALL_F, obj_count, error) + CALL check("h5fget_obj_count_f",error,total_error) + if(error .eq.0 .and. obj_count .ne. 3) then + total_error = total_error + 1 + write(*,*) "Wrong number of open objects reported, error" + endif + CALL h5fget_obj_count_f(fid1, H5F_OBJ_FILE_F, obj_countf, error) + CALL check("h5fget_obj_count_f",error,total_error) + if(error .eq.0 .and. obj_countf .ne. 3) then + total_error = total_error + 1 + write(*,*) "Wrong number of open objects reported, error" + endif + allocate(obj_ids(obj_countf), stat = error) + CALL h5fget_obj_ids_f(fid, H5F_OBJ_FILE_F, obj_countf, obj_ids, error) + CALL check("h5fget_obj_ids_f",error,total_error) + if(error .eq. 0) then + do i = 1, obj_countf + CALL h5fclose_f(obj_ids(i), error) + CALL check("h5fclose_f",error,total_error) + enddo + endif + + CALL h5fclose_f(fid, error) + if(error .eq. 0) then + total_error = total_error + 1 + write(*,*) "File should be closed at this point, error" + endif + CALL h5fclose_f(fid1, error) + if(error .eq. 0) then + total_error = total_error + 1 + write(*,*) "File should be closed at this point, error" + endif + CALL h5fclose_f(fid_d, error) + if(error .eq. 0) then + total_error = total_error + 1 + write(*,*) "File should be closed at this point, error" + endif + + if(cleanup) then + CALL h5_cleanup_f(filename, H5P_DEFAULT_F, error) + CALL check("h5_cleanup_f", error, total_error) + endif + deallocate(obj_ids) + RETURN + + END SUBROUTINE file_close + +! +! The following subroutine tests h5fget_freespace_f +! + + SUBROUTINE file_space(filename, cleanup, total_error) + USE HDF5 ! This module contains all necessary modules + USE TH5_MISC + IMPLICIT NONE + CHARACTER(*), INTENT(IN) :: filename + LOGICAL, INTENT(IN) :: cleanup + INTEGER, INTENT(INOUT) :: total_error + INTEGER :: error + ! + CHARACTER(LEN=3), PARAMETER :: grpname = "grp" + CHARACTER(LEN=80) :: fix_filename + + INTEGER(HID_T) :: fid ! File identifiers + INTEGER(HSSIZE_T) :: free_space + INTEGER(HID_T) :: group_id ! Group identifier + + CALL h5eset_auto_f(0, error) + + CALL h5_fixname_f(filename, fix_filename, H5P_DEFAULT_F, error) + if (error .ne. 0) then + write(*,*) "Cannot modify filename" + stop + endif + CALL h5fcreate_f(fix_filename, H5F_ACC_TRUNC_F, fid, error) + CALL check("h5fcreate_f",error,total_error) + + CALL h5fget_freespace_f(fid, free_space, error) + CALL check("h5fget_freespace_f",error,total_error) + if(error .eq.0 .and. free_space .ne. 0) then + total_error = total_error + 1 + write(*,*) "1: Wrong amount of free space reported, ", free_space + endif + + ! Create group in the file. + CALL h5gcreate_f(fid, grpname, group_id, error) + CALL check("h5gcreate_f",error,total_error) + + ! Close group + CALL h5gclose_f(group_id, error) + CALL check("h5gclose_f", error, total_error) + + ! Check the free space now + CALL h5fget_freespace_f(fid, free_space, error) + CALL check("h5fget_freespace_f",error,total_error) + if(error .eq.0 .and. free_space .ne. 0) then + total_error = total_error + 1 + write(*,*) "2: Wrong amount of free space reported, ", free_space + endif + + !Unlink the group + CALL h5gunlink_f(fid, grpname, error) + CALL check("h5gunlink_f", error, total_error) + + ! Check the free space now + CALL h5fget_freespace_f(fid, free_space, error) + CALL check("h5fget_freespace_f",error,total_error) + if(error .eq.0 .and. free_space .ne. 0) then + total_error = total_error + 1 + write(*,*) "3: Wrong amount of free space reported, ", free_space + endif + + CALL h5fclose_f(fid, error) + CALL check("h5fclose_f",error,total_error) + + if(cleanup) CALL h5_cleanup_f(filename, H5P_DEFAULT_F, error) + CALL check("h5_cleanup_f", error, total_error) + RETURN + + END SUBROUTINE file_space + + +END MODULE TH5F diff --git a/fortran/test/tH5F.f90 b/fortran/test/tH5F.f90 deleted file mode 100644 index 0b3c275..0000000 --- a/fortran/test/tH5F.f90 +++ /dev/null @@ -1,782 +0,0 @@ -!***rh* root/fortran/test/tH5F.f90 -! -! NAME -! tH5F.f90 -! -! FUNCTION -! Basic testing of Fortran H5F 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. * -! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -! -! CONTAINS SUBROUTINES -! mountingtest, reopentest, plisttest, file_close, file_space -! -!***** -! -! In the mountingtest subroutine we create one file with a group in it, -! and another file with a dataset. Mounting is used to -! access the dataset from the second file as a member of a group -! in the first file. - - - -MODULE TH5F - -CONTAINS - - SUBROUTINE mountingtest(cleanup, total_error) - USE HDF5 ! This module contains all necessary modules - USE TH5_MISC - IMPLICIT NONE - LOGICAL, INTENT(IN) :: cleanup - INTEGER, INTENT(INOUT) :: total_error - - ! - !the respective filename is "mount1.h5" and "mount2.h5" - ! - CHARACTER(LEN=6) :: filename1 - CHARACTER(LEN=6) :: filename2 - CHARACTER(LEN=80) :: fix_filename1 - CHARACTER(LEN=80) :: fix_filename2 - - ! - !data space rank and dimensions - ! - INTEGER, PARAMETER :: RANK = 2 - INTEGER, PARAMETER :: NX = 4 - INTEGER, PARAMETER :: NY = 5 - - ! - ! File identifiers - ! - INTEGER(HID_T) :: file1_id, file2_id - - ! - ! Group identifier - ! - INTEGER(HID_T) :: gid - - ! - ! dataset identifier - ! - INTEGER(HID_T) :: dset_id - - ! - ! data space identifier - ! - INTEGER(HID_T) :: dataspace - - ! - ! data type identifier - ! - INTEGER(HID_T) :: dtype_id - - ! - !The dimensions for the dataset. - ! - INTEGER(HSIZE_T), DIMENSION(2) :: dims = (/NX,NY/) - - ! - !return value for testing whether a file is in hdf5 format - ! - LOGICAL :: status - - ! - !flag to check operation success - ! - INTEGER :: error - - ! - !general purpose integer - ! - INTEGER :: i, j - - ! - !data buffers - ! - INTEGER, DIMENSION(NX,NY) :: data_in, data_out - - INTEGER(HSIZE_T), DIMENSION(2) :: data_dims - filename1 = "mount1" - filename2 = "mount2" - - do i = 1,80 - fix_filename1(i:i) = " " - fix_filename2(i:i) = " " - enddo - ! - !Initialize data_in buffer - ! - do j = 1, NY - do i = 1, NX - data_in(i,j) = (i-1) + (j-1) - end do - end do - - ! - ! Fix names of the files - ! - CALL h5_fixname_f(filename1, fix_filename1, H5P_DEFAULT_F, error) - if(error .ne. 0) stop - CALL h5_fixname_f(filename2, fix_filename2, H5P_DEFAULT_F, error) - if(error .ne. 0) stop - - ! - !Create first file "mount1.h5" using default properties. - ! - CALL h5fcreate_f(fix_filename1, H5F_ACC_TRUNC_F, file1_id, error) - CALL check("h5fcreate_f",error,total_error) - - ! - !Create group "/G" inside file "mount1.h5". - ! - CALL h5gcreate_f(file1_id, "/G", gid, error) - CALL check("h5gcreate_f",error,total_error) - ! - !close file and group identifiers. - ! - CALL h5gclose_f(gid, error) - CALL check("h5gclose_f",error,total_error) - CALL h5fclose_f(file1_id, error) - CALL check("h5fclose_f",error,total_error) - - ! - !Create second file "mount2.h5" using default properties. - ! - CALL h5fcreate_f(fix_filename2, H5F_ACC_TRUNC_F, file2_id, error) - CALL check("h5fcreate_f",error,total_error) - - ! - !Create data space for the dataset. - ! - CALL h5screate_simple_f(RANK, dims, dataspace, error) - CALL check("h5screate_simple_f",error,total_error) - - ! - !Create dataset "/D" inside file "mount2.h5". - ! - CALL h5dcreate_f(file2_id, "/D", H5T_NATIVE_INTEGER, dataspace, & - dset_id, error) - CALL check("h5dcreate_f",error,total_error) - - ! - ! Write data_in to the dataset - ! - data_dims(1) = NX - data_dims(2) = NY - CALL h5dwrite_f(dset_id, H5T_NATIVE_INTEGER, data_in, data_dims, error) - CALL check("h5dwrite_f",error,total_error) - - ! - !close file, dataset and dataspace identifiers. - ! - CALL h5sclose_f(dataspace, error) - CALL check("h5sclose_f",error,total_error) - CALL h5dclose_f(dset_id, error) - CALL check("h5dclose_f",error,total_error) - CALL h5fclose_f(file2_id, error) - CALL check("h5fclose_f",error,total_error) - - ! - !test whether files are in hdf5 format - ! - CALL h5fis_hdf5_f(fix_filename1, status, error) - CALL check("h5fis_hdf5_f",error,total_error) - IF ( .NOT. status ) THEN - write(*,*) "File ", fix_filename1, " is not in hdf5 format" - stop - END IF - - CALL h5fis_hdf5_f(fix_filename2, status, error) - CALL check("h5fis_hdf5_f",error,total_error) - IF ( .NOT. status ) THEN - write(*,*) "File ", fix_filename2, " is not in hdf5 format" - stop - END IF - - ! - !reopen both files. - ! - CALL h5fopen_f (fix_filename1, H5F_ACC_RDWR_F, file1_id, error) - CALL check("hfopen_f",error,total_error) - CALL h5fopen_f (fix_filename2, H5F_ACC_RDWR_F, file2_id, error) - CALL check("h5fopen_f",error,total_error) - - ! - !mount the second file under the first file's "/G" group. - ! - CALL h5fmount_f (file1_id, "/G", file2_id, error) - CALL check("h5fmount_f",error,total_error) - - - ! - !Access dataset D in the first file under /G/D name. - ! - CALL h5dopen_f(file1_id, "/G/D", dset_id, error) - CALL check("h5dopen_f",error,total_error) - - ! - !Get dataset's data type. - ! - CALL h5dget_type_f(dset_id, dtype_id, error) - CALL check("h5dget_type_f",error,total_error) - - ! - !Read the dataset. - ! - CALL h5dread_f(dset_id, dtype_id, data_out, data_dims, error) - CALL check("h5dread_f",error,total_error) - - ! - !Compare the data. - ! - do i = 1, NX - do j = 1, NY - IF (data_out(i,j) .NE. data_in(i, j)) THEN - END IF - end do - end do - - - ! - !Close dset_id and dtype_id. - ! - CALL h5dclose_f(dset_id, error) - CALL check("h5dclose_f",error,total_error) - CALL h5tclose_f(dtype_id, error) - CALL check("h5tclose_f",error,total_error) - - ! - !unmount the second file. - ! - CALL h5funmount_f(file1_id, "/G", error); - CALL check("h5funmount_f",error,total_error) - - ! - !Close both files. - ! - CALL h5fclose_f(file1_id, error) - CALL check("h5fclose_f",error,total_error) - CALL h5fclose_f(file2_id, error) - CALL check("h5fclose_f",error,total_error) - - if(cleanup) CALL h5_cleanup_f(filename1, H5P_DEFAULT_F, error) - CALL check("h5_cleanup_f", error, total_error) - if(cleanup) CALL h5_cleanup_f(filename2, H5P_DEFAULT_F, error) - CALL check("h5_cleanup_f", error, total_error) - RETURN - END SUBROUTINE mountingtest - -! -! The following subroutine tests h5freopen_f. -! It creates the file which has name "reopen.h5" and -! the "/dset" dataset inside the file. -! writes the data to the file, close the dataset. -! Reopen the file based upon the file_id, open the -! dataset use the reopen_id then reads the -! dataset back to memory to test whether the data -! read is identical to the data written -! - - SUBROUTINE reopentest(cleanup, total_error) - USE HDF5 ! This module contains all necessary modules - USE TH5_MISC - IMPLICIT NONE - LOGICAL, INTENT(IN) :: cleanup - INTEGER, INTENT(INOUT) :: total_error - - ! - CHARACTER(LEN=6), PARAMETER :: filename = "reopen" - CHARACTER(LEN=80) :: fix_filename - - INTEGER(HID_T) :: file_id, reopen_id ! File identifiers - INTEGER(HID_T) :: dset_id ! Dataset identifier - - ! - !dataset name is "dset" - ! - CHARACTER(LEN=4), PARAMETER :: dsetname = "dset" - - ! - !data space rank and dimensions - ! - INTEGER, PARAMETER :: RANK = 2 - INTEGER, PARAMETER :: NX = 4 - INTEGER, PARAMETER :: NY = 6 - - ! - ! data space identifier - ! - INTEGER(HID_T) :: dataspace - - ! - !The dimensions for the dataset. - ! - INTEGER(HSIZE_T), DIMENSION(2) :: dims = (/NX,NY/) - - ! - !flag to check operation success - ! - INTEGER :: error - - ! - !general purpose integer - ! - INTEGER :: i, j - - ! - !array to store data - ! - INTEGER, DIMENSION(4,6) :: dset_data, data_out - INTEGER(HSIZE_T), DIMENSION(2) :: data_dims - INTEGER(HSIZE_T) :: file_size - CHARACTER(LEN=80) :: file_name - INTEGER(SIZE_T) :: name_size - - ! - !initialize the dset_data array which will be written to the "/dset" - ! - do j = 1, NY - do i = 1, NX - dset_data(i,j) = (i-1)*6 + j; - end do - end do - - ! - !Initialize FORTRAN predifined datatypes - ! -! CALL h5init_types_f(error) -! CALL check("h5init_types_f",error,total_error) - - - ! - !Create file "reopen.h5" using default properties. - ! - CALL h5_fixname_f(filename, fix_filename, H5P_DEFAULT_F, error) - if (error .ne. 0) then - write(*,*) "Cannot modify filename" - stop - endif - CALL h5fcreate_f(fix_filename, H5F_ACC_TRUNC_F, file_id, error) - CALL check("h5fcreate_f",error,total_error) - - ! - !Create data space for the dataset. - ! - CALL h5screate_simple_f(RANK, dims, dataspace, error) - CALL check("h5screate_simple_f",error,total_error) - - ! - !Create dataset "/dset" inside the file . - ! - CALL h5dcreate_f(file_id, dsetname, H5T_NATIVE_INTEGER, dataspace, & - dset_id, error) - CALL check("h5dcreate_f",error,total_error) - - ! - !Write the dataset. - ! - data_dims(1) = NX - data_dims(2) = NY - CALL h5dwrite_f(dset_id, H5T_NATIVE_INTEGER, dset_data, data_dims, error) - CALL check("h5dwrite_f",error,total_error) - - ! - !close the dataset. - ! - CALL h5dclose_f(dset_id, error) - CALL check("h5dclose_f",error,total_error) - - ! - !close the dataspace. - ! - CALL h5sclose_f(dataspace, error) - CALL check("h5sclose_f",error,total_error) - - ! - !Reopen file dsetf.h5. - ! - CALL h5freopen_f(file_id, reopen_id, error) - CALL check("h5freopen_f",error,total_error) - ! - !Check file size - ! - CALL h5fget_filesize_f(file_id, file_size, error) - CALL check("h5fget_filesize_f",error,total_error) - - ! - !Open the dataset based on the reopen_id. - ! - CALL h5dopen_f(reopen_id, dsetname, dset_id, error) - CALL check("h5dopen_f",error,total_error) - ! - !Get file name from the dataset identifier - ! - CALL h5fget_name_f(dset_id, file_name, name_size, error) - CALL check("h5fget_name_f",error,total_error) - IF(file_name(1:name_size) .NE. fix_filename(1:name_size)) THEN - write(*,*) "file name obtained from the dataset id is incorrect" - END IF - - ! - !Read the dataset. - ! - CALL h5dread_f(dset_id, H5T_NATIVE_INTEGER, data_out, data_dims, error) - CALL check("h5dread_f",error,total_error) - - ! - !Compare the data. - ! - do i = 1, NX - do j = 1, NY - IF (data_out(i,j) .NE. dset_data(i, j)) THEN - write(*, *) "reopen test error occured" - END IF - end do - end do - - - ! - !Close the dataset. - ! - CALL h5dclose_f(dset_id, error) - CALL check("h5dclose_f",error,total_error) - - ! - !Close the file identifiers. - ! - CALL h5fclose_f(file_id, error) - CALL check("h5fclose_f",error,total_error) - CALL h5fclose_f(reopen_id, error) - CALL check("h5fclose_f",error,total_error) - - - if(cleanup) CALL h5_cleanup_f(filename, H5P_DEFAULT_F, error) - CALL check("h5_cleanup_f", error, total_error) - RETURN - - END SUBROUTINE reopentest - -! -! The following example demonstrates how to get creation property list, -! and access property list. -! We first create a file using the default creation and access property -! list. Then, the file was closed and reopened. We then get the -! creation and access property lists of the first file. The second file is -! created using the got property lists - - SUBROUTINE plisttest(cleanup, total_error) - USE HDF5 ! This module contains all necessary modules - USE TH5_MISC - IMPLICIT NONE - LOGICAL, INTENT(IN) :: cleanup - INTEGER, INTENT(INOUT) :: total_error - - ! - !file names are "plist1.h5" and "plist2.h5" - ! - CHARACTER(LEN=6), PARAMETER :: filename1 = "plist1" - CHARACTER(LEN=80) :: fix_filename1 - CHARACTER(LEN=6), PARAMETER :: filename2 = "plist2" - CHARACTER(LEN=80) :: fix_filename2 - - INTEGER(HID_T) :: file1_id, file2_id ! File identifiers - INTEGER(HID_T) :: prop_id ! File creation property list identifier - INTEGER(HID_T) :: access_id ! File Access property list identifier - - !flag to check operation success - INTEGER :: error - - ! - !Create a file1 using default properties. - ! - CALL h5_fixname_f(filename1, fix_filename1, H5P_DEFAULT_F, error) - if (error .ne. 0) then - write(*,*) "Cannot modify file name" - stop - endif - CALL h5fcreate_f(fix_filename1, H5F_ACC_TRUNC_F, file1_id, error) - CALL check("h5fcreate_f",error,total_error) - - ! - !Terminate access to the file. - ! - CALL h5fclose_f(file1_id, error) - CALL check("h5fclose_f",error,total_error) - - ! - !Open an existing file. - ! - CALL h5fopen_f (fix_filename1, H5F_ACC_RDWR_F, file1_id, error) - CALL check("h5fopen_f",error,total_error) - - ! - !get the creation property list. - ! - CALL h5fget_create_plist_f(file1_id, prop_id, error) - CALL check("h5fget_create_plist_f",error,total_error) - - ! - !get the access property list. - ! - CALL h5fget_access_plist_f(file1_id, access_id, error) - CALL check("h5fget_access_plist_f",error,total_error) - - ! - !based on the creation property list id and access property list id - !create a new file - ! - CALL h5_fixname_f(filename2, fix_filename2, H5P_DEFAULT_F, error) - if (error .ne. 0) then - write(*,*) "Cannot modify file name" - stop - endif - CALL h5fcreate_f(fix_filename2, H5F_ACC_TRUNC_F, file2_id, error, & - prop_id, access_id) - CALL check("h5create_f",error,total_error) - - ! - !Close all the property lists. - ! - CALL h5pclose_f(prop_id, error) - CALL check("h5pclose_f",error,total_error) - CALL h5pclose_f(access_id, error) - CALL check("h5pclose_f",error,total_error) - - ! - !Terminate access to the files. - ! - CALL h5fclose_f(file1_id, error) - CALL check("h5fclose_f",error,total_error) - - CALL h5fclose_f(file2_id, error) - CALL check("h5fclose_f",error,total_error) - - if(cleanup) CALL h5_cleanup_f(filename1, H5P_DEFAULT_F, error) - CALL check("h5_cleanup_f", error, total_error) - if(cleanup) CALL h5_cleanup_f(filename2, H5P_DEFAULT_F, error) - CALL check("h5_cleanup_f", error, total_error) - RETURN - - END SUBROUTINE plisttest - - -! -! The following subroutine tests h5pget(set)_fclose_degree_f -! - - SUBROUTINE file_close(cleanup, total_error) - USE HDF5 ! This module contains all necessary modules - USE TH5_MISC - IMPLICIT NONE - LOGICAL, INTENT(IN) :: cleanup - INTEGER, INTENT(INOUT) :: total_error - INTEGER :: error - - ! - CHARACTER(LEN=10), PARAMETER :: filename = "file_close" - CHARACTER(LEN=80) :: fix_filename - - INTEGER(HID_T) :: fid, fid_d, fid1, fid2, fid3 ! File identifiers - INTEGER(HID_T) :: fapl, fapl1, fapl2, fapl3 ! File access identifiers - INTEGER(HID_T) :: fid_d_fapl, fid1_fapl ! File access identifiers - LOGICAL :: flag - INTEGER(SIZE_T) :: obj_count, obj_countf - INTEGER(HID_T), ALLOCATABLE, DIMENSION(:) :: obj_ids - INTEGER :: i - - CALL h5eset_auto_f(0, error) - - CALL h5_fixname_f(filename, fix_filename, H5P_DEFAULT_F, error) - if (error .ne. 0) then - write(*,*) "Cannot modify filename" - stop - endif - CALL h5fcreate_f(fix_filename, H5F_ACC_TRUNC_F, fid, error) - CALL check("h5fcreate_f",error,total_error) - - CALL h5pcreate_f(H5P_FILE_ACCESS_F, fapl, error) - CALL check("h5pcreate_f",error,total_error) - CALL h5pset_fclose_degree_f(fapl, H5F_CLOSE_DEFAULT_F, error) - CALL check("h5pset_fclose_degree_f",error,total_error) - - - CALL h5pcreate_f(H5P_FILE_ACCESS_F, fapl1, error) - CALL check("h5pcreate_f",error,total_error) - CALL h5pset_fclose_degree_f(fapl1, H5F_CLOSE_WEAK_F, error) - CALL check("h5pset_fclose_degree_f",error,total_error) - - - CALL h5pcreate_f(H5P_FILE_ACCESS_F, fapl2, error) - CALL check("h5pcreate_f",error,total_error) - CALL h5pset_fclose_degree_f(fapl2, H5F_CLOSE_SEMI_F, error) - CALL check("h5pset_fclose_degree_f",error,total_error) - - CALL h5pcreate_f(H5P_FILE_ACCESS_F, fapl3, error) - CALL check("h5pcreate_f",error,total_error) - CALL h5pset_fclose_degree_f(fapl3, H5F_CLOSE_STRONG_F, error) - CALL check("h5pset_fclose_degree_f",error,total_error) - - CALL h5fopen_f(fix_filename, H5F_ACC_RDWR_F, fid1, error, access_prp=fapl1) - CALL check("h5fopen_f",error,total_error) - CALL h5fopen_f(fix_filename, H5F_ACC_RDWR_F, fid_d, error, access_prp=fapl) - CALL check("h5fopen_f",error,total_error) - CALL h5fget_access_plist_f(fid1, fid1_fapl, error) - CALL check("h5fget_access_plist_f",error,total_error) - CALL h5fget_access_plist_f(fid_d, fid_d_fapl, error) - CALL check("h5fget_access_plist_f",error,total_error) - - CALL h5pequal_f(fid_d_fapl, fid1_fapl, flag, error) - CALL check("h5pequal_f",error,total_error) - if (.NOT. flag) then - write(*,*) " File access lists should be equal, error " - total_error=total_error + 1 - endif - CALL h5fopen_f(fix_filename, H5F_ACC_RDWR_F, fid2, error, access_prp=fapl2) - if( error .ne. -1) then - total_error = total_error + 1 - write(*,*) " Open with H5F_CLOSE_SEMI should fail " - endif - CALL h5fopen_f(fix_filename, H5F_ACC_RDWR_F, fid3, error, access_prp=fapl3) - if( error .ne. -1) then - total_error = total_error + 1 - write(*,*) " Open with H5F_CLOSE_STRONG should fail " - endif - - CALL h5fget_obj_count_f(fid1, H5F_OBJ_ALL_F, obj_count, error) - CALL check("h5fget_obj_count_f",error,total_error) - if(error .eq.0 .and. obj_count .ne. 3) then - total_error = total_error + 1 - write(*,*) "Wrong number of open objects reported, error" - endif - CALL h5fget_obj_count_f(fid1, H5F_OBJ_FILE_F, obj_countf, error) - CALL check("h5fget_obj_count_f",error,total_error) - if(error .eq.0 .and. obj_countf .ne. 3) then - total_error = total_error + 1 - write(*,*) "Wrong number of open objects reported, error" - endif - allocate(obj_ids(obj_countf), stat = error) - CALL h5fget_obj_ids_f(fid, H5F_OBJ_FILE_F, obj_countf, obj_ids, error) - CALL check("h5fget_obj_ids_f",error,total_error) - if(error .eq. 0) then - do i = 1, obj_countf - CALL h5fclose_f(obj_ids(i), error) - CALL check("h5fclose_f",error,total_error) - enddo - endif - - CALL h5fclose_f(fid, error) - if(error .eq. 0) then - total_error = total_error + 1 - write(*,*) "File should be closed at this point, error" - endif - CALL h5fclose_f(fid1, error) - if(error .eq. 0) then - total_error = total_error + 1 - write(*,*) "File should be closed at this point, error" - endif - CALL h5fclose_f(fid_d, error) - if(error .eq. 0) then - total_error = total_error + 1 - write(*,*) "File should be closed at this point, error" - endif - - if(cleanup) then - CALL h5_cleanup_f(filename, H5P_DEFAULT_F, error) - CALL check("h5_cleanup_f", error, total_error) - endif - deallocate(obj_ids) - RETURN - - END SUBROUTINE file_close - -! -! The following subroutine tests h5fget_freespace_f -! - - SUBROUTINE file_space(filename, cleanup, total_error) - USE HDF5 ! This module contains all necessary modules - USE TH5_MISC - IMPLICIT NONE - CHARACTER(*), INTENT(IN) :: filename - LOGICAL, INTENT(IN) :: cleanup - INTEGER, INTENT(INOUT) :: total_error - INTEGER :: error - ! - CHARACTER(LEN=3), PARAMETER :: grpname = "grp" - CHARACTER(LEN=80) :: fix_filename - - INTEGER(HID_T) :: fid ! File identifiers - INTEGER(HSSIZE_T) :: free_space - INTEGER(HID_T) :: group_id ! Group identifier - - CALL h5eset_auto_f(0, error) - - CALL h5_fixname_f(filename, fix_filename, H5P_DEFAULT_F, error) - if (error .ne. 0) then - write(*,*) "Cannot modify filename" - stop - endif - CALL h5fcreate_f(fix_filename, H5F_ACC_TRUNC_F, fid, error) - CALL check("h5fcreate_f",error,total_error) - - CALL h5fget_freespace_f(fid, free_space, error) - CALL check("h5fget_freespace_f",error,total_error) - if(error .eq.0 .and. free_space .ne. 0) then - total_error = total_error + 1 - write(*,*) "1: Wrong amount of free space reported, ", free_space - endif - - ! Create group in the file. - CALL h5gcreate_f(fid, grpname, group_id, error) - CALL check("h5gcreate_f",error,total_error) - - ! Close group - CALL h5gclose_f(group_id, error) - CALL check("h5gclose_f", error, total_error) - - ! Check the free space now - CALL h5fget_freespace_f(fid, free_space, error) - CALL check("h5fget_freespace_f",error,total_error) - if(error .eq.0 .and. free_space .ne. 0) then - total_error = total_error + 1 - write(*,*) "2: Wrong amount of free space reported, ", free_space - endif - - !Unlink the group - CALL h5gunlink_f(fid, grpname, error) - CALL check("h5gunlink_f", error, total_error) - - ! Check the free space now - CALL h5fget_freespace_f(fid, free_space, error) - CALL check("h5fget_freespace_f",error,total_error) - if(error .eq.0 .and. free_space .ne. 0) then - total_error = total_error + 1 - write(*,*) "3: Wrong amount of free space reported, ", free_space - endif - - CALL h5fclose_f(fid, error) - CALL check("h5fclose_f",error,total_error) - - if(cleanup) CALL h5_cleanup_f(filename, H5P_DEFAULT_F, error) - CALL check("h5_cleanup_f", error, total_error) - RETURN - - END SUBROUTINE file_space - - -END MODULE TH5F diff --git a/fortran/test/tH5F_F03.F90 b/fortran/test/tH5F_F03.F90 new file mode 100644 index 0000000..9e23d19 --- /dev/null +++ b/fortran/test/tH5F_F03.F90 @@ -0,0 +1,179 @@ +!****h* root/fortran/test/tH5F_F03.f90 +! +! NAME +! tH5F_F03.f90 +! +! FUNCTION +! Test FORTRAN HDF5 H5F APIs which are dependent on FORTRAN 2003 +! features. +! +! 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. * +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! +! NOTES +! Tests the H5F APIs functionalities of: +! h5fget_file_image_f +! +! CONTAINS SUBROUTINES +! test_get_file_image +! +!***** + +! ***************************************** +! *** H 5 F T E S T S +! ***************************************** + +MODULE TH5F_F03 + + USE HDF5 + USE TH5_MISC + USE TH5_MISC_GEN + USE ISO_C_BINDING + +CONTAINS + +SUBROUTINE test_get_file_image(total_error) + ! + ! Tests the wrapper for h5fget_file_image + ! + IMPLICIT NONE + + INTEGER, INTENT(INOUT) :: total_error ! returns error + + CHARACTER(kind=c_char), ALLOCATABLE, DIMENSION(:), TARGET :: file_image_ptr ! Image from file + CHARACTER(kind=c_char), ALLOCATABLE, DIMENSION(:), TARGET :: image_ptr ! Image from h5fget_file_image_f + + INTEGER, DIMENSION(1:100), TARGET :: data ! Write data + INTEGER :: i, file_sz + INTEGER(hid_t) :: file_id = -1 ! File identifier + INTEGER(hid_t) :: dset_id = -1 ! Dataset identifier + INTEGER(hid_t) :: space_id = -1 ! Dataspace identifier + INTEGER(hsize_t), DIMENSION(1:2) :: dims ! Dataset dimensions + INTEGER(size_t) :: itmp_a, itmp_b ! General purpose integers + INTEGER(size_t) :: image_size ! Size of image + TYPE(C_PTR) :: f_ptr ! Pointer + INTEGER(hid_t) :: fapl ! File access property + INTEGER :: error ! Error flag + + ! Create new properties for file access + CALL h5pcreate_f(H5P_FILE_ACCESS_F, fapl, error) + CALL check("h5pcreate_f", error, total_error) + + ! Set standard I/O driver + CALL h5pset_fapl_stdio_f(fapl, error) + CALL check("h5pset_fapl_stdio_f", error, total_error) + + ! Create the file + CALL h5fcreate_f("tget_file_image.h5", H5F_ACC_TRUNC_F, file_id, error, H5P_DEFAULT_F, fapl) + CALL check("h5fcreate_f", error, total_error) + + ! Set up data space for new data set + dims(1:2) = (/10,10/) + + CALL h5screate_simple_f(2, dims, space_id, error) + CALL check("h5screate_simple_f", error, total_error) + + ! Create a dataset + CALL h5dcreate_f(file_id, "dset 0", H5T_NATIVE_INTEGER, space_id, dset_id, error) + CALL check("h5dcreate_f", error, total_error) + + ! Write some data to the data set + DO i = 1, 100 + data(i) = i + ENDDO + + f_ptr = C_LOC(data(1)) + CALL h5dwrite_f(dset_id, H5T_NATIVE_INTEGER, f_ptr, error) + CALL check("h5dwrite_f",error, total_error) + + ! Flush the file + CALL h5fflush_f(file_id, H5F_SCOPE_GLOBAL_F, error) + CALL check("h5fflush_f",error, total_error) + + ! Open the test file using standard I/O calls + OPEN(UNIT=10,FILE='tget_file_image.h5', ACCESS='STREAM') + ! Get the size of the test file + ! + ! Since we use the eoa to calculate the image size, the file size + ! may be larger. This is OK, as long as (in this specialized instance) + ! the remainder of the file is all '\0's. + ! + ! With latest mods to truncate call in core file drive, + ! file size should match image size; get the file size + INQUIRE(UNIT=10, SIZE=file_sz) + CLOSE(UNIT=10) + + ! I. Get buffer size needed to hold the buffer + + ! A. Preferred way to get the size + f_ptr = C_NULL_PTR + CALL h5fget_file_image_f(file_id, f_ptr, INT(0, size_t), error, image_size) + CALL check("h5fget_file_image_f",error, total_error) + CALL verify("h5fget_file_image_f", file_sz, INT(image_size), total_error) + + ! B. f_ptr set to point to an incorrect buffer, should pass anyway + f_ptr = C_LOC(data(1)) + itmp_a = 1 + CALL h5fget_file_image_f(file_id, f_ptr, itmp_a, error, image_size) + CALL check("h5fget_file_image_f",error, total_error) + CALL verify("h5fget_file_image_f", INT(itmp_a), 1, total_error) ! Routine should not change the value + CALL verify("h5fget_file_image_f", file_sz, INT(image_size), total_error) + + ! Allocate a buffer of the appropriate size + ALLOCATE(image_ptr(1:image_size)) + + ! Load the image of the file into the buffer + f_ptr = C_LOC(image_ptr(1)(1:1)) + CALL h5fget_file_image_f(file_id, f_ptr, image_size, error) + CALL check("h5fget_file_image_f",error, total_error) + + ! Close dset and space + CALL h5dclose_f(dset_id, error) + CALL check("h5dclose_f", error, total_error) + CALL h5sclose_f(space_id, error) + CALL check("h5sclose_f", error, total_error) + ! Close the test file + CALL h5fclose_f(file_id, error) + CALL check("h5fclose_f",error, total_error) + + ! Allocate a buffer for the test file image + ALLOCATE(file_image_ptr(1:image_size)) + + ! Open the test file using standard I/O calls + OPEN(UNIT=10,FILE='tget_file_image.h5', FORM='UNFORMATTED', ACCESS='STREAM') + + ! Read the test file from disk into the buffer + DO i = 1, image_size + READ(10) file_image_ptr(i) + ENDDO + + CLOSE(10) + + ! verify the file and the image contain the same data + DO i = 1, image_size + ! convert one byte to an unsigned integer + IF( ICHAR(file_image_ptr(i)) .NE. ICHAR(image_ptr(i)))THEN + total_error = total_error + 1 + EXIT + ENDIF + ENDDO + + ! release resources + DEALLOCATE(file_image_ptr,image_ptr) + +END SUBROUTINE test_get_file_image + +END MODULE TH5F_F03 diff --git a/fortran/test/tH5F_F03.f90 b/fortran/test/tH5F_F03.f90 deleted file mode 100644 index 9e23d19..0000000 --- a/fortran/test/tH5F_F03.f90 +++ /dev/null @@ -1,179 +0,0 @@ -!****h* root/fortran/test/tH5F_F03.f90 -! -! NAME -! tH5F_F03.f90 -! -! FUNCTION -! Test FORTRAN HDF5 H5F APIs which are dependent on FORTRAN 2003 -! features. -! -! 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. * -! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -! -! NOTES -! Tests the H5F APIs functionalities of: -! h5fget_file_image_f -! -! CONTAINS SUBROUTINES -! test_get_file_image -! -!***** - -! ***************************************** -! *** H 5 F T E S T S -! ***************************************** - -MODULE TH5F_F03 - - USE HDF5 - USE TH5_MISC - USE TH5_MISC_GEN - USE ISO_C_BINDING - -CONTAINS - -SUBROUTINE test_get_file_image(total_error) - ! - ! Tests the wrapper for h5fget_file_image - ! - IMPLICIT NONE - - INTEGER, INTENT(INOUT) :: total_error ! returns error - - CHARACTER(kind=c_char), ALLOCATABLE, DIMENSION(:), TARGET :: file_image_ptr ! Image from file - CHARACTER(kind=c_char), ALLOCATABLE, DIMENSION(:), TARGET :: image_ptr ! Image from h5fget_file_image_f - - INTEGER, DIMENSION(1:100), TARGET :: data ! Write data - INTEGER :: i, file_sz - INTEGER(hid_t) :: file_id = -1 ! File identifier - INTEGER(hid_t) :: dset_id = -1 ! Dataset identifier - INTEGER(hid_t) :: space_id = -1 ! Dataspace identifier - INTEGER(hsize_t), DIMENSION(1:2) :: dims ! Dataset dimensions - INTEGER(size_t) :: itmp_a, itmp_b ! General purpose integers - INTEGER(size_t) :: image_size ! Size of image - TYPE(C_PTR) :: f_ptr ! Pointer - INTEGER(hid_t) :: fapl ! File access property - INTEGER :: error ! Error flag - - ! Create new properties for file access - CALL h5pcreate_f(H5P_FILE_ACCESS_F, fapl, error) - CALL check("h5pcreate_f", error, total_error) - - ! Set standard I/O driver - CALL h5pset_fapl_stdio_f(fapl, error) - CALL check("h5pset_fapl_stdio_f", error, total_error) - - ! Create the file - CALL h5fcreate_f("tget_file_image.h5", H5F_ACC_TRUNC_F, file_id, error, H5P_DEFAULT_F, fapl) - CALL check("h5fcreate_f", error, total_error) - - ! Set up data space for new data set - dims(1:2) = (/10,10/) - - CALL h5screate_simple_f(2, dims, space_id, error) - CALL check("h5screate_simple_f", error, total_error) - - ! Create a dataset - CALL h5dcreate_f(file_id, "dset 0", H5T_NATIVE_INTEGER, space_id, dset_id, error) - CALL check("h5dcreate_f", error, total_error) - - ! Write some data to the data set - DO i = 1, 100 - data(i) = i - ENDDO - - f_ptr = C_LOC(data(1)) - CALL h5dwrite_f(dset_id, H5T_NATIVE_INTEGER, f_ptr, error) - CALL check("h5dwrite_f",error, total_error) - - ! Flush the file - CALL h5fflush_f(file_id, H5F_SCOPE_GLOBAL_F, error) - CALL check("h5fflush_f",error, total_error) - - ! Open the test file using standard I/O calls - OPEN(UNIT=10,FILE='tget_file_image.h5', ACCESS='STREAM') - ! Get the size of the test file - ! - ! Since we use the eoa to calculate the image size, the file size - ! may be larger. This is OK, as long as (in this specialized instance) - ! the remainder of the file is all '\0's. - ! - ! With latest mods to truncate call in core file drive, - ! file size should match image size; get the file size - INQUIRE(UNIT=10, SIZE=file_sz) - CLOSE(UNIT=10) - - ! I. Get buffer size needed to hold the buffer - - ! A. Preferred way to get the size - f_ptr = C_NULL_PTR - CALL h5fget_file_image_f(file_id, f_ptr, INT(0, size_t), error, image_size) - CALL check("h5fget_file_image_f",error, total_error) - CALL verify("h5fget_file_image_f", file_sz, INT(image_size), total_error) - - ! B. f_ptr set to point to an incorrect buffer, should pass anyway - f_ptr = C_LOC(data(1)) - itmp_a = 1 - CALL h5fget_file_image_f(file_id, f_ptr, itmp_a, error, image_size) - CALL check("h5fget_file_image_f",error, total_error) - CALL verify("h5fget_file_image_f", INT(itmp_a), 1, total_error) ! Routine should not change the value - CALL verify("h5fget_file_image_f", file_sz, INT(image_size), total_error) - - ! Allocate a buffer of the appropriate size - ALLOCATE(image_ptr(1:image_size)) - - ! Load the image of the file into the buffer - f_ptr = C_LOC(image_ptr(1)(1:1)) - CALL h5fget_file_image_f(file_id, f_ptr, image_size, error) - CALL check("h5fget_file_image_f",error, total_error) - - ! Close dset and space - CALL h5dclose_f(dset_id, error) - CALL check("h5dclose_f", error, total_error) - CALL h5sclose_f(space_id, error) - CALL check("h5sclose_f", error, total_error) - ! Close the test file - CALL h5fclose_f(file_id, error) - CALL check("h5fclose_f",error, total_error) - - ! Allocate a buffer for the test file image - ALLOCATE(file_image_ptr(1:image_size)) - - ! Open the test file using standard I/O calls - OPEN(UNIT=10,FILE='tget_file_image.h5', FORM='UNFORMATTED', ACCESS='STREAM') - - ! Read the test file from disk into the buffer - DO i = 1, image_size - READ(10) file_image_ptr(i) - ENDDO - - CLOSE(10) - - ! verify the file and the image contain the same data - DO i = 1, image_size - ! convert one byte to an unsigned integer - IF( ICHAR(file_image_ptr(i)) .NE. ICHAR(image_ptr(i)))THEN - total_error = total_error + 1 - EXIT - ENDIF - ENDDO - - ! release resources - DEALLOCATE(file_image_ptr,image_ptr) - -END SUBROUTINE test_get_file_image - -END MODULE TH5F_F03 diff --git a/fortran/test/tH5G.F90 b/fortran/test/tH5G.F90 new file mode 100644 index 0000000..2ba174c --- /dev/null +++ b/fortran/test/tH5G.F90 @@ -0,0 +1,263 @@ +!****h* root/fortran/test/tH5G.f90 +! +! NAME +! tH5G.f90 +! +! FUNCTION +! Basic testing of Fortran H5G 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. * +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! +! CONTAINS SUBROUTINES +! group_test +! +!***** + +MODULE TH5G + +CONTAINS + + SUBROUTINE group_test(cleanup, total_error) + +! This subroutine tests following functionalities: +! h5gcreate_f, h5gopen_f, h5gclose_f, (?)h5gget_obj_info_idx_f, h5gn_members_f +! h5glink(2)_f, h5gunlink_f, h5gmove(2)_f, h5gget_linkval_f, h5gset_comment_f, +! h5gget_comment_f + + USE HDF5 ! This module contains all necessary modules + USE TH5_MISC + + IMPLICIT NONE + LOGICAL, INTENT(IN) :: cleanup + INTEGER, INTENT(INOUT) :: total_error + + CHARACTER(LEN=5), PARAMETER :: filename = "gtest" !File name + CHARACTER(LEN=80) :: fix_filename + CHARACTER(LEN=33), PARAMETER :: comment = "Testing the group functionalities" + ! comment for this file + CHARACTER(LEN=7), PARAMETER :: groupname1 = "MyGroup" ! Group name + CHARACTER(LEN=16), PARAMETER :: groupname2 = "/MyGroup/Group_A" + CHARACTER(LEN=9), PARAMETER :: linkname1 = "hardlink1" + CHARACTER(LEN=9), PARAMETER :: linkname2 = "hardlink2" + CHARACTER(LEN=9), PARAMETER :: linkname3 = "softlink1" + CHARACTER(LEN=9), PARAMETER :: linkname4 = "softlink2" + CHARACTER(LEN=12), PARAMETER :: linkname5 = "newsoftlink2" + + CHARACTER(LEN=13), PARAMETER :: dsetname1 = "MyGroup/dset1" ! Dataset name + CHARACTER(LEN=5), PARAMETER :: dsetname2 = "dset2" ! dataset name + + INTEGER(HID_T) :: file_id ! File identifier + INTEGER(HID_T) :: group1_id ! Group identifier + INTEGER(HID_T) :: group2_id ! Group identifier + INTEGER(HID_T) :: dset1_id ! Dataset identifier + INTEGER(HID_T) :: dset2_id ! Dataset identifier + INTEGER(HID_T) :: dsetnew_id ! Dataset identifier + INTEGER(HID_T) :: dspace_id ! Data space identifier + + INTEGER, DIMENSION(1) :: dset1_data = 34 ! Data value + INTEGER, DIMENSION(1) :: dset2_data = 98 ! Data value + INTEGER(HSIZE_T), DIMENSION(1) :: dims = 1 ! Datasets dimensions + INTEGER :: rank = 1 ! Datasets rank + INTEGER :: error ! Error flag + INTEGER(SIZE_T) :: namesize = 100 !size for symbolic object + CHARACTER(LEN=100) :: name !name to put symbolic object + CHARACTER(LEN=100) :: commentout !comment to the file + INTEGER :: nmembers + INTEGER(HSIZE_T), DIMENSION(2) :: data_dims + ! + ! Create the file. + ! + CALL h5_fixname_f(filename, fix_filename, H5P_DEFAULT_F, error) + if (error .ne. 0) then + write(*,*) "Cannot modify filename" + stop + endif + CALL h5fcreate_f(fix_filename, H5F_ACC_TRUNC_F, file_id, error) + CALL check("h5fcreate_f",error,total_error) + + ! + ! Create a group named "/MyGroup" in the file. + ! + CALL h5gcreate_f(file_id, groupname1, group1_id, error) + CALL check("h5gcreate_f",error,total_error) + + ! + ! Create a group named "/MyGroup/Group_A" in the file. + ! + CALL h5gcreate_f(file_id, groupname2, group2_id, error) + CALL check("h5gcreate_f",error,total_error) + ! + !Create data space for the dataset. + ! + CALL h5screate_simple_f(rank, dims, dspace_id, error) + CALL check("h5screate_simple_f",error,total_error) + ! + ! create dataset in the file. + ! + CALL h5dcreate_f(file_id, dsetname1, H5T_NATIVE_INTEGER, dspace_id, & + dset1_id, error) + CALL check("h5dcreate_f",error,total_error) + + ! + ! Write data_in to dataset1 + ! + data_dims(1) = 1 + CALL h5dwrite_f(dset1_id, H5T_NATIVE_INTEGER, dset1_data, data_dims, error) + CALL check("h5dwrite_f",error,total_error) + + ! + ! create dataset2 in the Group_A. + ! + CALL h5dcreate_f(group2_id, dsetname2, H5T_NATIVE_INTEGER, dspace_id, & + dset2_id, error) + CALL check("h5dcreate_f",error,total_error) + + ! + ! Write data_in to dataset2 + ! + CALL h5dwrite_f(dset2_id, H5T_NATIVE_INTEGER, dset2_data, data_dims, error) + CALL check("h5dwrite_f",error,total_error) + + ! + !Create a hard link to the group1 + ! + CALL h5glink_f(file_id, H5G_LINK_HARD_F, groupname1, linkname1, error) + CALL check("h5glink_f",error,total_error) + ! + !Create a hard link to the group2 + ! + CALL h5glink2_f(file_id, groupname2, H5G_LINK_HARD_F, file_id, linkname2, error) + CALL check("h5glink2_f",error,total_error) + ! + !Create a soft link to dataset11 + ! + CALL h5glink_f(file_id, H5G_LINK_SOFT_F, dsetname1, linkname3, error) + CALL check("h5glink_f",error,total_error) + ! + !Create a soft link to dataset2 + ! + CALL h5glink_f(file_id, H5G_LINK_SOFT_F, dsetname2, linkname4, error) + CALL check("h5glink_f",error,total_error) + ! + !close group1 + ! + CALL h5gclose_f(group1_id, error) + CALL check("h5gclose_f", error, total_error) + ! + !reopen group1 + ! + CALL h5gopen_f(file_id, groupname1, group1_id, error) + CALL check("h5gopen_f", error, total_error) + ! + !get obj info of group1 + ! +! CALL h5gget_obj_info_idx_f(file_id, linkname1, 2, name, obj_type, error) +! CALL check("h5gget_obj_info_idx_f", error, total_error) +! XXX: Fix problems with H5G_LINK_F! - QAK +! if (obj_type .ne. H5G_LINK_F) then +! write(*,*) "got object ", name, " type error ", obj_type +! total_error = total_error +1 +! end if + ! + !Get number of members in the group + ! + CALL h5gn_members_f(file_id, groupname1, nmembers, error) + CALL check("h5gn_members_f",error,total_error) + if (nmembers .ne. 2) then + write(*,*) "got nmembers ", nmembers, " is wrong" + total_error = total_error +1 + end if + ! + !Get the name of a symbolic name + ! + CALL h5gget_linkval_f(file_id, linkname3, namesize, name, error) + CALL check("h5gget_linkval_f",error,total_error) + if ( name(1:13) .ne. dsetname1) then + write(*,*) "got symbolic name ", name, " is wrong" + total_error = total_error +1 + end if + ! + !move softlink2 to newsoftlink2 + ! + CALL h5gmove_f(file_id, linkname4, linkname5, error) + CALL check("h5gmove_f",error,total_error) + ! + !Get the name of the moved symbolic name + ! + CALL h5gget_linkval_f(file_id, linkname5, namesize, name, error) + CALL check("h5gget_linkval_f",error,total_error) + if ( name(1:5) .ne. dsetname2) then + write(*,*) "got symbolic name ", name, " is wrong" + total_error = total_error +1 + end if + + ! + !Unlink the moved symbolic link + ! + CALL h5gunlink_f(file_id, linkname5, error) + CALL check("h5gunlink_f", error, total_error) + + + ! + !set the comment of dataset1 to comment + ! + CALL h5gset_comment_f(file_id, dsetname1, comment, error) + CALL check("h5gset_comment_f", error, total_error) + ! + !get the comment of dataset1 + ! + CALL h5gget_comment_f(file_id, dsetname1,namesize, commentout, error) + CALL check("h5gget_comment_f", error, total_error) + if ( commentout(1:33) .ne. comment) then + write(*,*) "got comment ", commentout, " is wrong" + total_error = total_error +1 + end if + ! + ! Move dataset1 to gourp2_id location + ! + CALL h5dclose_f(dset1_id, error) + CALL check("h5dclose_f", error, total_error) + + CALL h5gmove2_f(file_id, dsetname1, group2_id, "dset1", error) + CALL check("h5gmove2_f", error, total_error) + ! + ! Open dataset from the new location + ! + Call h5dopen_f(file_id, "/MyGroup/Group_A/dset1" , dsetnew_id, error) + CALL check("h5dopen_f",error, total_error) + ! + !release all the resources + ! + CALL h5fclose_f(file_id, error) + CALL check("h5fclose_f", error, total_error) + CALL h5gclose_f(group1_id, error) + CALL check("h5gclose_f", error, total_error) + CALL h5gclose_f(group2_id, error) + CALL check("h5gclose_f", error, total_error) + CALL h5dclose_f(dset2_id, error) + CALL check("h5dclose_f", error, total_error) + CALL h5dclose_f(dsetnew_id, error) + CALL check("h5dclose_f", error, total_error) + CALL h5sclose_f(dspace_id, error) + CALL check("h5sclose_f", error, total_error) + + + if(cleanup) CALL h5_cleanup_f(filename, H5P_DEFAULT_F, error) + CALL check("h5_cleanup_f", error, total_error) + END SUBROUTINE group_test + +END MODULE TH5G diff --git a/fortran/test/tH5G.f90 b/fortran/test/tH5G.f90 deleted file mode 100644 index 2ba174c..0000000 --- a/fortran/test/tH5G.f90 +++ /dev/null @@ -1,263 +0,0 @@ -!****h* root/fortran/test/tH5G.f90 -! -! NAME -! tH5G.f90 -! -! FUNCTION -! Basic testing of Fortran H5G 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. * -! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -! -! CONTAINS SUBROUTINES -! group_test -! -!***** - -MODULE TH5G - -CONTAINS - - SUBROUTINE group_test(cleanup, total_error) - -! This subroutine tests following functionalities: -! h5gcreate_f, h5gopen_f, h5gclose_f, (?)h5gget_obj_info_idx_f, h5gn_members_f -! h5glink(2)_f, h5gunlink_f, h5gmove(2)_f, h5gget_linkval_f, h5gset_comment_f, -! h5gget_comment_f - - USE HDF5 ! This module contains all necessary modules - USE TH5_MISC - - IMPLICIT NONE - LOGICAL, INTENT(IN) :: cleanup - INTEGER, INTENT(INOUT) :: total_error - - CHARACTER(LEN=5), PARAMETER :: filename = "gtest" !File name - CHARACTER(LEN=80) :: fix_filename - CHARACTER(LEN=33), PARAMETER :: comment = "Testing the group functionalities" - ! comment for this file - CHARACTER(LEN=7), PARAMETER :: groupname1 = "MyGroup" ! Group name - CHARACTER(LEN=16), PARAMETER :: groupname2 = "/MyGroup/Group_A" - CHARACTER(LEN=9), PARAMETER :: linkname1 = "hardlink1" - CHARACTER(LEN=9), PARAMETER :: linkname2 = "hardlink2" - CHARACTER(LEN=9), PARAMETER :: linkname3 = "softlink1" - CHARACTER(LEN=9), PARAMETER :: linkname4 = "softlink2" - CHARACTER(LEN=12), PARAMETER :: linkname5 = "newsoftlink2" - - CHARACTER(LEN=13), PARAMETER :: dsetname1 = "MyGroup/dset1" ! Dataset name - CHARACTER(LEN=5), PARAMETER :: dsetname2 = "dset2" ! dataset name - - INTEGER(HID_T) :: file_id ! File identifier - INTEGER(HID_T) :: group1_id ! Group identifier - INTEGER(HID_T) :: group2_id ! Group identifier - INTEGER(HID_T) :: dset1_id ! Dataset identifier - INTEGER(HID_T) :: dset2_id ! Dataset identifier - INTEGER(HID_T) :: dsetnew_id ! Dataset identifier - INTEGER(HID_T) :: dspace_id ! Data space identifier - - INTEGER, DIMENSION(1) :: dset1_data = 34 ! Data value - INTEGER, DIMENSION(1) :: dset2_data = 98 ! Data value - INTEGER(HSIZE_T), DIMENSION(1) :: dims = 1 ! Datasets dimensions - INTEGER :: rank = 1 ! Datasets rank - INTEGER :: error ! Error flag - INTEGER(SIZE_T) :: namesize = 100 !size for symbolic object - CHARACTER(LEN=100) :: name !name to put symbolic object - CHARACTER(LEN=100) :: commentout !comment to the file - INTEGER :: nmembers - INTEGER(HSIZE_T), DIMENSION(2) :: data_dims - ! - ! Create the file. - ! - CALL h5_fixname_f(filename, fix_filename, H5P_DEFAULT_F, error) - if (error .ne. 0) then - write(*,*) "Cannot modify filename" - stop - endif - CALL h5fcreate_f(fix_filename, H5F_ACC_TRUNC_F, file_id, error) - CALL check("h5fcreate_f",error,total_error) - - ! - ! Create a group named "/MyGroup" in the file. - ! - CALL h5gcreate_f(file_id, groupname1, group1_id, error) - CALL check("h5gcreate_f",error,total_error) - - ! - ! Create a group named "/MyGroup/Group_A" in the file. - ! - CALL h5gcreate_f(file_id, groupname2, group2_id, error) - CALL check("h5gcreate_f",error,total_error) - ! - !Create data space for the dataset. - ! - CALL h5screate_simple_f(rank, dims, dspace_id, error) - CALL check("h5screate_simple_f",error,total_error) - ! - ! create dataset in the file. - ! - CALL h5dcreate_f(file_id, dsetname1, H5T_NATIVE_INTEGER, dspace_id, & - dset1_id, error) - CALL check("h5dcreate_f",error,total_error) - - ! - ! Write data_in to dataset1 - ! - data_dims(1) = 1 - CALL h5dwrite_f(dset1_id, H5T_NATIVE_INTEGER, dset1_data, data_dims, error) - CALL check("h5dwrite_f",error,total_error) - - ! - ! create dataset2 in the Group_A. - ! - CALL h5dcreate_f(group2_id, dsetname2, H5T_NATIVE_INTEGER, dspace_id, & - dset2_id, error) - CALL check("h5dcreate_f",error,total_error) - - ! - ! Write data_in to dataset2 - ! - CALL h5dwrite_f(dset2_id, H5T_NATIVE_INTEGER, dset2_data, data_dims, error) - CALL check("h5dwrite_f",error,total_error) - - ! - !Create a hard link to the group1 - ! - CALL h5glink_f(file_id, H5G_LINK_HARD_F, groupname1, linkname1, error) - CALL check("h5glink_f",error,total_error) - ! - !Create a hard link to the group2 - ! - CALL h5glink2_f(file_id, groupname2, H5G_LINK_HARD_F, file_id, linkname2, error) - CALL check("h5glink2_f",error,total_error) - ! - !Create a soft link to dataset11 - ! - CALL h5glink_f(file_id, H5G_LINK_SOFT_F, dsetname1, linkname3, error) - CALL check("h5glink_f",error,total_error) - ! - !Create a soft link to dataset2 - ! - CALL h5glink_f(file_id, H5G_LINK_SOFT_F, dsetname2, linkname4, error) - CALL check("h5glink_f",error,total_error) - ! - !close group1 - ! - CALL h5gclose_f(group1_id, error) - CALL check("h5gclose_f", error, total_error) - ! - !reopen group1 - ! - CALL h5gopen_f(file_id, groupname1, group1_id, error) - CALL check("h5gopen_f", error, total_error) - ! - !get obj info of group1 - ! -! CALL h5gget_obj_info_idx_f(file_id, linkname1, 2, name, obj_type, error) -! CALL check("h5gget_obj_info_idx_f", error, total_error) -! XXX: Fix problems with H5G_LINK_F! - QAK -! if (obj_type .ne. H5G_LINK_F) then -! write(*,*) "got object ", name, " type error ", obj_type -! total_error = total_error +1 -! end if - ! - !Get number of members in the group - ! - CALL h5gn_members_f(file_id, groupname1, nmembers, error) - CALL check("h5gn_members_f",error,total_error) - if (nmembers .ne. 2) then - write(*,*) "got nmembers ", nmembers, " is wrong" - total_error = total_error +1 - end if - ! - !Get the name of a symbolic name - ! - CALL h5gget_linkval_f(file_id, linkname3, namesize, name, error) - CALL check("h5gget_linkval_f",error,total_error) - if ( name(1:13) .ne. dsetname1) then - write(*,*) "got symbolic name ", name, " is wrong" - total_error = total_error +1 - end if - ! - !move softlink2 to newsoftlink2 - ! - CALL h5gmove_f(file_id, linkname4, linkname5, error) - CALL check("h5gmove_f",error,total_error) - ! - !Get the name of the moved symbolic name - ! - CALL h5gget_linkval_f(file_id, linkname5, namesize, name, error) - CALL check("h5gget_linkval_f",error,total_error) - if ( name(1:5) .ne. dsetname2) then - write(*,*) "got symbolic name ", name, " is wrong" - total_error = total_error +1 - end if - - ! - !Unlink the moved symbolic link - ! - CALL h5gunlink_f(file_id, linkname5, error) - CALL check("h5gunlink_f", error, total_error) - - - ! - !set the comment of dataset1 to comment - ! - CALL h5gset_comment_f(file_id, dsetname1, comment, error) - CALL check("h5gset_comment_f", error, total_error) - ! - !get the comment of dataset1 - ! - CALL h5gget_comment_f(file_id, dsetname1,namesize, commentout, error) - CALL check("h5gget_comment_f", error, total_error) - if ( commentout(1:33) .ne. comment) then - write(*,*) "got comment ", commentout, " is wrong" - total_error = total_error +1 - end if - ! - ! Move dataset1 to gourp2_id location - ! - CALL h5dclose_f(dset1_id, error) - CALL check("h5dclose_f", error, total_error) - - CALL h5gmove2_f(file_id, dsetname1, group2_id, "dset1", error) - CALL check("h5gmove2_f", error, total_error) - ! - ! Open dataset from the new location - ! - Call h5dopen_f(file_id, "/MyGroup/Group_A/dset1" , dsetnew_id, error) - CALL check("h5dopen_f",error, total_error) - ! - !release all the resources - ! - CALL h5fclose_f(file_id, error) - CALL check("h5fclose_f", error, total_error) - CALL h5gclose_f(group1_id, error) - CALL check("h5gclose_f", error, total_error) - CALL h5gclose_f(group2_id, error) - CALL check("h5gclose_f", error, total_error) - CALL h5dclose_f(dset2_id, error) - CALL check("h5dclose_f", error, total_error) - CALL h5dclose_f(dsetnew_id, error) - CALL check("h5dclose_f", error, total_error) - CALL h5sclose_f(dspace_id, error) - CALL check("h5sclose_f", error, total_error) - - - if(cleanup) CALL h5_cleanup_f(filename, H5P_DEFAULT_F, error) - CALL check("h5_cleanup_f", error, total_error) - END SUBROUTINE group_test - -END MODULE TH5G diff --git a/fortran/test/tH5G_1_8.F90 b/fortran/test/tH5G_1_8.F90 new file mode 100644 index 0000000..ddc3736 --- /dev/null +++ b/fortran/test/tH5G_1_8.F90 @@ -0,0 +1,2126 @@ +!****h* root/fortran/test/tH5G_1_8.f90 +! +! NAME +! tH5G_1_8.f90 +! +! FUNCTION +! Basic testing of Fortran H5G APIs introduced in 1.8. +! +! 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. * +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! +! CONTAINS SUBROUTINES +! group_test, group_info, timestamps, mklinks, test_move_preserves, lifecycle +! cklinks, delete_by_idx, link_info_by_idx_check, test_lcpl, objcopy, +! lapl_nlinks +! +!***** + +MODULE TH5G_1_8 + + USE HDF5 + USE TH5_MISC + USE TH5_MISC_GEN + +CONTAINS + +SUBROUTINE group_test(cleanup, total_error) + + IMPLICIT NONE + LOGICAL, INTENT(IN) :: cleanup + INTEGER, INTENT(INOUT) :: total_error + + INTEGER(HID_T) :: fapl, fapl2, my_fapl ! File access property lists + + INTEGER :: error, ret_total_error + +! WRITE(*,*) "TESTING GROUPS" + CALL H5Pcreate_f(H5P_FILE_ACCESS_F, fapl, error) + CALL check("H5Pcreate_f",error, total_error) + + ! Copy the file access property list + CALL H5Pcopy_f(fapl, fapl2, error) + CALL check("H5Pcopy_f",error, total_error) + + ! Set the "use the latest version of the format" bounds for creating objects in the file + CALL H5Pset_libver_bounds_f(fapl2, H5F_LIBVER_LATEST_F, H5F_LIBVER_LATEST_F, error) + CALL check("H5Pset_libver_bounds_f",error, total_error) + + ! Check for FAPL to USE + my_fapl = fapl2 + + ret_total_error = 0 + CALL mklinks(fapl2, ret_total_error) + CALL write_test_status(ret_total_error, & + ' Testing building a file with assorted links', & + total_error) + + ret_total_error = 0 + CALL cklinks(fapl2, ret_total_error) + CALL write_test_status(ret_total_error, & + ' Testing links are correct and building assorted links', & + total_error) + + ret_total_error = 0 + CALL group_info(cleanup, fapl2, ret_total_error) + CALL write_test_status(ret_total_error, & + ' Testing create group with creation order indices, test querying group info', & + total_error) + +! CALL ud_hard_links(fapl2,total_error) + ret_total_error = 0 + CALL timestamps(cleanup, fapl2, ret_total_error) + CALL write_test_status(ret_total_error, & + ' Testing disabling tracking timestamps for an object', & + total_error) + + ret_total_error = 0 + CALL test_move_preserves(fapl2, ret_total_error) + CALL write_test_status(ret_total_error, & + ' Testing moving and renaming links preserves their properties', & + total_error) + + ret_total_error = 0 + CALL delete_by_idx(cleanup,fapl2,ret_total_error) + CALL write_test_status(ret_total_error, & + ' Testing deleting links by index', & + total_error) + + ret_total_error = 0 + CALL test_lcpl(cleanup, fapl, ret_total_error) + CALL write_test_status(ret_total_error, & + ' Testing link creation property lists', & + total_error) + + ret_total_error = 0 + CALL objcopy(fapl, ret_total_error) + CALL write_test_status(ret_total_error, & + ' Testing object copy', & + total_error) + + ret_total_error = 0 + CALL lifecycle(cleanup, fapl2, ret_total_error) + CALL write_test_status(ret_total_error, & + ' Testing adding links to a group follow proper "lifecycle"', & + total_error) + + IF(cleanup) CALL h5_cleanup_f("TestLinks", H5P_DEFAULT_F, error) + CALL check("h5_cleanup_f", error, total_error) + + +END SUBROUTINE group_test + +!------------------------------------------------------------------------- +! * Function: group_info +! * +! * Purpose: Create a group with creation order indices and test querying +! * group info. +! * +! * Return: Success: 0 +! * Failure: -1 +! * +! * Programmer: Adapted from C test routines by +! * M.S. Breitenfeld +! * February 18, 2008 +! * +! *------------------------------------------------------------------------- +! + +SUBROUTINE group_info(cleanup, fapl, total_error) + + IMPLICIT NONE + INTEGER, INTENT(INOUT) :: total_error + INTEGER(HID_T), INTENT(IN) :: fapl + + INTEGER(HID_T) :: gcpl_id ! Group creation property list ID + + INTEGER :: max_compact ! Maximum # of links to store in group compactly + INTEGER :: min_dense ! Minimum # of links to store in group "densely" + + INTEGER :: idx_type ! Type of index to operate on + INTEGER :: order, iorder ! Order within in the index + LOGICAL, DIMENSION(1:2) :: use_index = (/.FALSE.,.TRUE./) ! Use index on creation order values + CHARACTER(LEN=6), PARAMETER :: prefix = 'links0' + CHARACTER(LEN=9), PARAMETER :: filename = prefix//'.h5' ! File name + INTEGER :: Input1 + INTEGER(HID_T) :: group_id ! Group ID + INTEGER(HID_T) :: soft_group_id ! Group ID for soft links + + INTEGER :: i ! Local index variables + INTEGER :: storage_type ! Type of storage for links in group: + ! H5G_STORAGE_TYPE_COMPACT: Compact storage + ! H5G_STORAGE_TYPE_DENSE: Indexed storage + ! H5G_STORAGE_TYPE_SYMBOL_TABLE: Symbol tables, the original HDF5 structure + INTEGER :: nlinks ! Number of links in group + INTEGER :: max_corder ! Current maximum creation order value for group + + INTEGER :: u,v ! Local index variables + CHARACTER(LEN=2) :: chr2 + INTEGER(HID_T) :: group_id2, group_id3 ! Group IDs + CHARACTER(LEN=7) :: objname ! Object name + CHARACTER(LEN=7) :: objname2 ! Object name + CHARACTER(LEN=19) :: valname ! Link value + CHARACTER(LEN=12), PARAMETER :: CORDER_GROUP_NAME = "corder_group" + CHARACTER(LEN=17), PARAMETER :: CORDER_SOFT_GROUP_NAME = "corder_soft_group" + INTEGER(HID_T) :: file_id ! File ID + INTEGER :: error ! Generic return value + LOGICAL :: mounted + LOGICAL :: cleanup + + ! Create group creation property list + CALL H5Pcreate_f(H5P_GROUP_CREATE_F, gcpl_id, error ) + CALL check("H5Pcreate_f", error, total_error) + + ! Query the group creation properties + CALL H5Pget_link_phase_change_f(gcpl_id, max_compact, min_dense, error) + CALL check("H5Pget_link_phase_change_f", error, total_error) + + ! Loop over operating on different indices on link fields + DO idx_type = H5_INDEX_NAME_F, H5_INDEX_CRT_ORDER_F + ! Loop over operating in different orders + DO iorder = H5_ITER_INC_F, H5_ITER_NATIVE_F + ! Loop over using index for creation order value + DO i = 1, 2 + ! Print appropriate test message + IF(idx_type == H5_INDEX_CRT_ORDER_F)THEN + IF(iorder == H5_ITER_INC_F)THEN + order = H5_ITER_INC_F +!!$ IF(use_index(i))THEN +!!$ WRITE(*,'(5x,A)')"query group info by creation order index in increasing order w/creation order index" +!!$ ELSE +!!$ WRITE(*,'(5x,A)')"query group info by creation order index in increasing order w/o creation order index" +!!$ ENDIF + ELSE IF (iorder == H5_ITER_DEC_F) THEN + order = H5_ITER_DEC_F +!!$ IF(use_index(i))THEN +!!$ WRITE(*,'(5x,A)')"query group info by creation order index in decreasing order w/creation order index" +!!$ ELSE +!!$ WRITE(*,'(5x,A)')"query group info by creation order index in decreasing order w/o creation order index" +!!$ ENDIF + ELSE + order = H5_ITER_NATIVE_F +!!$ IF(use_index(i))THEN +!!$ WRITE(*,'(5x,A)')"query group info by creation order index in native order w/creation order index" +!!$ ELSE +!!$ WRITE(*,'(5x,A)')"query group info by creation order index in native order w/o creation order index" +!!$ ENDIF + ENDIF + ELSE + IF(iorder == H5_ITER_INC_F)THEN + order = H5_ITER_INC_F +!!$ IF(use_index(i))THEN +!!$ WRITE(*,'(5x,A)')"query group info by creation order index in increasing order w/creation order index" +!!$ ELSE +!!$ WRITE(*,'(5x,A)')"query group info by creation order index in increasing order w/o creation order index" +!!$ ENDIF + ELSE IF (iorder == H5_ITER_DEC_F) THEN + order = H5_ITER_DEC_F +!!$ IF(use_index(i))THEN +!!$ WRITE(*,'(5x,A)')"query group info by creation order index in decreasing order w/creation order index" +!!$ ELSE +!!$ WRITE(*,'(5x,A)')"query group info by creation order index in decreasing order w/o creation order index" +!!$ ENDIF + ELSE + order = H5_ITER_NATIVE_F +!!$ IF(use_index(i))THEN +!!$ WRITE(*,'(5x,A)')"query group info by creation order index in native order w/creation order index" +!!$ ELSE +!!$ WRITE(*,'(5x,A)')"query group info by creation order index in native order w/o creation order index" +!!$ ENDIF + ENDIF + END IF + + ! Create file + CALL H5Fcreate_f(filename, H5F_ACC_TRUNC_F, file_id, error, H5P_DEFAULT_F, fapl) + CALL check("H5Fcreate_f", error, total_error) + + ! Set creation order tracking & indexing on group + IF(use_index(i))THEN + Input1 = H5P_CRT_ORDER_INDEXED_F + ELSE + Input1 = 0 + ENDIF + CALL H5Pset_link_creation_order_f(gcpl_id, IOR(H5P_CRT_ORDER_TRACKED_F, Input1), error) + CALL check("H5Pset_link_creation_order_f", error, total_error) + + ! Create group with creation order tracking on + CALL H5Gcreate_f(file_id, CORDER_GROUP_NAME, group_id, error, gcpl_id=gcpl_id) + CALL check("H5Gcreate_f", error, total_error) + + ! Create group with creation order tracking on for soft links + CALL H5Gcreate_f(file_id, CORDER_SOFT_GROUP_NAME, soft_group_id, error, & + OBJECT_NAMELEN_DEFAULT_F, H5P_DEFAULT_F, gcpl_id) + CALL check("H5Gcreate_f", error, total_error) + + ! Check for out of bound query by index on empty group, should fail + CALL H5Gget_info_by_idx_f(group_id, ".", H5_INDEX_NAME_F, order, INT(0,HSIZE_T), & + storage_type, nlinks, max_corder, error) + CALL verify("H5Gget_info_by_idx_f", error, -1, total_error) + + ! Create several links, up to limit of compact form + DO u = 0, max_compact-1 + + ! Make name for link + WRITE(chr2,'(I2.2)') u + objname = 'fill '//chr2 + + ! Create hard link, with group object + CALL H5Gcreate_f(group_id, objname, group_id2, error, OBJECT_NAMELEN_DEFAULT_F, H5P_DEFAULT_F, gcpl_id) + CALL check("H5Gcreate_f", error, total_error) + + ! Retrieve group's information + CALL H5Gget_info_f(group_id2, storage_type, nlinks, max_corder, error, mounted) + CALL check("H5Gget_info_f", error, total_error) + + ! Check (new/empty) group's information + CALL verify("H5Gget_info_f", storage_type, H5G_STORAGE_TYPE_COMPACT_F, total_error) + CALL verify("H5Gget_info_f", max_corder, 0, total_error) + CALL verify("H5Gget_info_f", nlinks, 0, total_error) + CALL verify("H5Gget_info_f.mounted", mounted,.FALSE.,total_error) + + ! Retrieve group's information + CALL H5Gget_info_by_name_f(group_id, objname, storage_type, nlinks, max_corder, error, mounted=mounted) + CALL check("H5Gget_info_by_name_f", error, total_error) + + ! Check (new/empty) group's information + CALL verify("H5Gget_info_by_name_f", storage_type, H5G_STORAGE_TYPE_COMPACT_F, total_error) + CALL verify("H5Gget_info_by_name_f", max_corder, 0, total_error) + CALL verify("H5Gget_info_by_name_f", nlinks, 0, total_error) + CALL verify("H5Gget_info_by_name_f.mounted", mounted,.FALSE.,total_error) + + ! Retrieve group's information + CALL H5Gget_info_by_name_f(group_id2, ".", storage_type, nlinks, max_corder, error) + CALL check("H5Gget_info_by_name", error, total_error) + + ! Check (new/empty) group's information + CALL verify("H5Gget_info_by_name_f", storage_type, H5G_STORAGE_TYPE_COMPACT_F, total_error) + CALL verify("H5Gget_info_by_name_f", max_corder, 0, total_error) + CALL verify("H5Gget_info_by_name_f", nlinks, 0, total_error) + + ! Create objects in new group created + DO v = 0, u + ! Make name for link + WRITE(chr2,'(I2.2)') v + objname2 = 'fill '//chr2 + + ! Create hard link, with group object + CALL H5Gcreate_f(group_id2, objname2, group_id3, error ) + CALL check("H5Gcreate_f", error, total_error) + + ! Close group created + CALL H5Gclose_f(group_id3, error) + CALL check("H5Gclose_f", error, total_error) + ENDDO + + ! Retrieve group's information + CALL H5Gget_info_f(group_id2, storage_type, nlinks, max_corder, error) + CALL check("H5Gget_info_f", error, total_error) + + ! Check (new) group's information + CALL verify("H5Gget_info_f", storage_type, H5G_STORAGE_TYPE_COMPACT_F, total_error) + CALL verify("H5Gget_info_f", max_corder, u+1, total_error) + CALL verify("H5Gget_info_f", nlinks, u+1, total_error) + + ! Retrieve group's information + CALL H5Gget_info_by_name_f(group_id, objname, storage_type, nlinks, max_corder, error) + CALL check("H5Gget_info_by_name_f", error, total_error) + + ! Check (new) group's information + CALL verify("H5Gget_info_by_name_f", storage_type, H5G_STORAGE_TYPE_COMPACT_F, total_error) + CALL verify("H5Gget_info_by_name_f",max_corder, u+1, total_error) + CALL verify("H5Gget_info_by_name_f", nlinks, u+1, total_error) + + ! Retrieve group's information + CALL H5Gget_info_by_name_f(group_id2, ".", storage_type, nlinks, max_corder, error) + CALL check("H5Gget_info_by_name_f", error, total_error) + + ! Check (new) group's information + CALL verify("H5Gget_info_by_name_f", storage_type, H5G_STORAGE_TYPE_COMPACT_F, total_error) + CALL verify("H5Gget_info_by_name_f", max_corder, u+1, total_error) + CALL verify("H5Gget_info_by_name_f", nlinks, u+1, total_error) + + ! Retrieve group's information + IF(order.NE.H5_ITER_NATIVE_F)THEN + IF(order.EQ.H5_ITER_INC_F) THEN + CALL H5Gget_info_by_idx_f(group_id, ".", idx_type, order, INT(u,HSIZE_T), & + storage_type, nlinks, max_corder, error,lapl_id=H5P_DEFAULT_F, mounted=mounted) + CALL check("H5Gget_info_by_idx_f", error, total_error) + CALL verify("H5Gget_info_by_idx_f", mounted,.FALSE.,total_error) + ELSE + CALL H5Gget_info_by_idx_f(group_id, ".", idx_type, order, INT(0,HSIZE_T), & + storage_type, nlinks, max_corder, error, mounted=mounted) + CALL verify("H5Gget_info_by_idx_f", mounted,.FALSE.,total_error) + CALL check("H5Gget_info_by_idx_f", error, total_error) + ENDIF + ! Check (new) group's information + CALL verify("H5Gget_info_by_idx_f", storage_type, H5G_STORAGE_TYPE_COMPACT_F, total_error) + CALL verify("H5Gget_info_by_idx_f", max_corder, u+1, total_error) + CALL verify("H5Gget_info_by_idx_f", nlinks, u+1, total_error) + ENDIF + ! Close group created + CALL H5Gclose_f(group_id2, error) + CALL check("H5Gclose_f", error, total_error) + + ! Retrieve main group's information + CALL H5Gget_info_f(group_id, storage_type, nlinks, max_corder, error) + CALL check("H5Gget_info_f", error, total_error) + + ! Check main group's information + CALL verify("H5Gget_info_f", storage_type, H5G_STORAGE_TYPE_COMPACT_F, total_error) + CALL verify("H5Gget_info_f", max_corder, u+1, total_error) + CALL verify("H5Gget_info_f", nlinks, u+1, total_error) + + ! Retrieve main group's information, by name + CALL H5Gget_info_by_name_f(file_id, CORDER_GROUP_NAME, storage_type, nlinks, max_corder, error) + CALL check("H5Gget_info_by_name_f", error, total_error) + + ! Check main group's information + CALL verify("H5Gget_info_by_name_f", storage_type, H5G_STORAGE_TYPE_COMPACT_F, total_error) + CALL verify("H5Gget_info_by_name_f", max_corder, u+1, total_error) + CALL verify("H5Gget_info_by_name_f", nlinks, u+1, total_error) + + ! Retrieve main group's information, by name + CALL H5Gget_info_by_name_f(group_id, ".", storage_type, nlinks, max_corder, error, H5P_DEFAULT_F) + CALL check("H5Gget_info_by_name_f", error, total_error) + + ! Check main group's information + CALL verify("H5Gget_info_by_name_f", storage_type, H5G_STORAGE_TYPE_COMPACT_F, total_error) + CALL verify("H5Gget_info_by_name_f", max_corder, u+1, total_error) + CALL verify("H5Gget_info_by_name_f", nlinks, u+1, total_error) + + ! Create soft link in another group, to objects in main group + valname = CORDER_GROUP_NAME//objname + + CALL H5Lcreate_soft_f(valname, soft_group_id, objname, error, H5P_DEFAULT_F, H5P_DEFAULT_F) + + ! Retrieve soft link group's information, by name + CALL H5Gget_info_f(soft_group_id, storage_type, nlinks, max_corder, error) + CALL check("H5Gget_info_f", error, total_error) + + ! Check soft link group's information + CALL verify("H5Gget_info_f", storage_type, H5G_STORAGE_TYPE_COMPACT_F, total_error) + CALL verify("H5Gget_info_f", max_corder, u+1, total_error) + CALL verify("H5Gget_info_f", nlinks, u+1, total_error) + ENDDO + + ! Close the groups + + CALL H5Gclose_f(group_id, error) + CALL check("H5Gclose_f", error, total_error) + CALL H5Gclose_f(soft_group_id, error) + CALL check("H5Gclose_f", error, total_error) + + ! Close the file + CALL H5Fclose_f(file_id, error) + CALL check("H5Fclose_f", error, total_error) + ENDDO + ENDDO + ENDDO + + ! Free resources + CALL H5Pclose_f(gcpl_id, error) + CALL check("H5Pclose_f", error, total_error) + + IF(cleanup) CALL h5_cleanup_f(prefix, H5P_DEFAULT_F, error) + CALL check("h5_cleanup_f", error, total_error) + + + END SUBROUTINE group_info + +!------------------------------------------------------------------------- +! * Function: timestamps +! * +! * Purpose: Verify that disabling tracking timestamps for an object +! * works correctly +! * +! * +! * Programmer: M.S. Breitenfeld +! * February 20, 2008 +! * +! *------------------------------------------------------------------------- +! + + SUBROUTINE timestamps(cleanup, fapl, total_error) + + IMPLICIT NONE + INTEGER, INTENT(INOUT) :: total_error + INTEGER(HID_T), INTENT(IN) :: fapl + + INTEGER(HID_T) :: file_id ! File ID + INTEGER(HID_T) :: group_id ! Group ID + INTEGER(HID_T) :: group_id2 ! Group ID + INTEGER(HID_T) :: gcpl_id ! Group creation property list ID + INTEGER(HID_T) :: gcpl_id2 ! Group creation property list ID + + CHARACTER(LEN=6), PARAMETER :: prefix = 'links9' + CHARACTER(LEN=9), PARAMETER :: filename = prefix//'.h5' ! File name + ! Timestamp macros + CHARACTER(LEN=10), PARAMETER :: TIMESTAMP_GROUP_1="timestamp1" + CHARACTER(LEN=10), PARAMETER :: TIMESTAMP_GROUP_2="timestamp2" + LOGICAL :: track_times + LOGICAL :: cleanup + + INTEGER :: error + + ! Print test message +! WRITE(*,*) "timestamps on objects" + + ! Create group creation property list + CALL H5Pcreate_f(H5P_GROUP_CREATE_F, gcpl_id, error ) + CALL check("H5Pcreate_f", error, total_error) + + ! Query the object timestamp setting + CALL H5Pget_obj_track_times_f(gcpl_id, track_times, error) + CALL check("H5Pget_obj_track_times_f", error, total_error) + + ! Check default timestamp information + CALL verify("H5Pget_obj_track_times",track_times,.TRUE.,total_error) + + ! Set a non-default object timestamp setting + CALL H5Pset_obj_track_times_f(gcpl_id, .FALSE., error) + CALL check("H5Pset_obj_track_times_f", error, total_error) + + ! Query the object timestamp setting + CALL H5Pget_obj_track_times_f(gcpl_id, track_times, error) + CALL check("H5Pget_obj_track_times_f", error, total_error) + + ! Check default timestamp information + CALL verify("H5Pget_obj_track_times",track_times,.FALSE.,total_error) + + ! Create file + !h5_fixname(FILENAME[0], fapl, filename, sizeof filename); + + CALL H5Fcreate_f(filename, H5F_ACC_TRUNC_F, file_id, error, H5P_DEFAULT_F, fapl) + CALL check("h5fcreate_f",error,total_error) + + ! Create group with non-default object timestamp setting + CALL h5gcreate_f(file_id, TIMESTAMP_GROUP_1, group_id, error, & + OBJECT_NAMELEN_DEFAULT_F, H5P_DEFAULT_F, gcpl_id, H5P_DEFAULT_F) + CALL check("h5fcreate_f",error,total_error) + + ! Close the group creation property list + CALL H5Pclose_f(gcpl_id, error) + CALL check("H5Pclose_f", error, total_error) + + ! Create group with default object timestamp setting + CALL h5gcreate_f(file_id, TIMESTAMP_GROUP_2, group_id2, error, & + OBJECT_NAMELEN_DEFAULT_F, H5P_DEFAULT_F, H5P_DEFAULT_F, H5P_DEFAULT_F) + CALL check("h5fcreate_f",error,total_error) + + ! Retrieve the new groups' creation properties + CALL H5Gget_create_plist_f(group_id, gcpl_id, error) + CALL check("H5Gget_create_plist", error, total_error) + CALL H5Gget_create_plist_f(group_id2, gcpl_id2, error) + CALL check("H5Gget_create_plist", error, total_error) + + ! Query & verify the object timestamp settings + CALL H5Pget_obj_track_times_f(gcpl_id, track_times, error) + CALL check("H5Pget_obj_track_times_f", error, total_error) + CALL verify("H5Pget_obj_track_times1",track_times,.FALSE.,total_error) + CALL H5Pget_obj_track_times_f(gcpl_id2, track_times, error) + CALL check("H5Pget_obj_track_times_f", error, total_error) + CALL verify("H5Pget_obj_track_times2",track_times,.TRUE.,total_error) + +! Query the object information for each group +! if(H5Oget_info(group_id, &oinfo) < 0) TEST_ERROR +! if(H5Oget_info(group_id2, &oinfo2) < 0) TEST_ERROR + +!!$ Sanity check object information for each group +!!$ if(oinfo.atime != 0) TEST_ERROR +!!$ if(oinfo.mtime != 0) TEST_ERROR +!!$ if(oinfo.ctime != 0) TEST_ERROR +!!$ if(oinfo.btime != 0) TEST_ERROR +!!$ if(oinfo.atime == oinfo2.atime) TEST_ERROR +!!$ if(oinfo.mtime == oinfo2.mtime) TEST_ERROR +!!$ if(oinfo.ctime == oinfo2.ctime) TEST_ERROR +!!$ if(oinfo.btime == oinfo2.btime) TEST_ERROR +!!$ if((oinfo.hdr.flags & H5O_HDR_STORE_TIMES) != 0) TEST_ERROR +!!$ if((oinfo2.hdr.flags & H5O_HDR_STORE_TIMES) == 0) TEST_ERROR +!!$ if(oinfo.hdr.space.total >= oinfo2.hdr.space.total) TEST_ERROR +!!$ if(oinfo.hdr.space.meta >= oinfo2.hdr.space.meta) TEST_ERROR + + ! Close the property lists + CALL H5Pclose_f(gcpl_id, error) + CALL check("H5Pclose_f", error, total_error) + CALL H5Pclose_f(gcpl_id2, error) + CALL check("H5Pclose_f", error, total_error) + + ! Close the groups + CALL H5Gclose_f(group_id, error) + CALL check("H5Gclose_f", error, total_error) + CALL H5Gclose_f(group_id2, error) + CALL check("H5Gclose_f", error, total_error) + + ! Close the file + CALL H5Fclose_f(file_id, error) + CALL check("H5Fclose_f", error, total_error) + + ! Re-open the file + + CALL h5fopen_f(FileName, H5F_ACC_RDONLY_F, file_id, error, H5P_DEFAULT_F) + CALL check("h5fopen_f",error,total_error) + + ! Open groups + CALL H5Gopen_f(file_id, TIMESTAMP_GROUP_1, group_id, error) ! with no optional param. + CALL check("H5Gopen_f", error, total_error) + CALL H5Gopen_f(file_id, TIMESTAMP_GROUP_2, group_id2, error, H5P_DEFAULT_F) ! with optional param. + CALL check("H5Gopen_f", error, total_error) + + ! Retrieve the new groups' creation properties + CALL H5Gget_create_plist_f(group_id, gcpl_id, error) + CALL check("H5Gget_create_plist", error, total_error) + CALL H5Gget_create_plist_f(group_id2, gcpl_id2, error) + CALL check("H5Gget_create_plist", error, total_error) + + ! Query & verify the object timestamp settings + + CALL H5Pget_obj_track_times_f(gcpl_id, track_times, error) + CALL check("H5Pget_obj_track_times_f", error, total_error) + CALL verify("H5Pget_obj_track_times1",track_times,.FALSE.,total_error) + CALL H5Pget_obj_track_times_f(gcpl_id2, track_times, error) + CALL check("H5Pget_obj_track_times_f", error, total_error) + CALL verify("H5Pget_obj_track_times2",track_times,.TRUE.,total_error) +!!$ +!!$ Query the object information for each group +!!$ if(H5Oget_info(group_id, &oinfo) < 0) TEST_ERROR +!!$ if(H5Oget_info(group_id2, &oinfo2) < 0) TEST_ERROR +!!$ +!!$ Sanity check object information for each group +!!$ if(oinfo.atime != 0) TEST_ERROR +!!$ if(oinfo.mtime != 0) TEST_ERROR +!!$ if(oinfo.ctime != 0) TEST_ERROR +!!$ if(oinfo.btime != 0) TEST_ERROR +!!$ if(oinfo.atime == oinfo2.atime) TEST_ERROR +!!$ if(oinfo.mtime == oinfo2.mtime) TEST_ERROR +!!$ if(oinfo.ctime == oinfo2.ctime) TEST_ERROR +!!$ if(oinfo.btime == oinfo2.btime) TEST_ERROR +!!$ if((oinfo.hdr.flags & H5O_HDR_STORE_TIMES) != 0) TEST_ERROR +!!$ if((oinfo2.hdr.flags & H5O_HDR_STORE_TIMES) == 0) TEST_ERROR +!!$ if(oinfo.hdr.space.total >= oinfo2.hdr.space.total) TEST_ERROR +!!$ if(oinfo.hdr.space.meta >= oinfo2.hdr.space.meta) TEST_ERROR + + ! Close the property lists + CALL H5Pclose_f(gcpl_id, error) + CALL check("H5Pclose_f", error, total_error) + CALL H5Pclose_f(gcpl_id2, error) + CALL check("H5Pclose_f", error, total_error) + + ! Close the groups + CALL H5Gclose_f(group_id, error) + CALL check("H5Gclose_f", error, total_error) + CALL H5Gclose_f(group_id2, error) + CALL check("H5Gclose_f", error, total_error) + + ! Close the file + CALL H5Fclose_f(file_id, error) + CALL check("H5Fclose_f", error, total_error) + + IF(cleanup) CALL h5_cleanup_f(prefix, H5P_DEFAULT_F, error) + CALL check("h5_cleanup_f", error, total_error) + + END SUBROUTINE timestamps + +!------------------------------------------------------------------------- +! * Function: mklinks +! * +! * Purpose: Build a file with assorted links. +! * +! * +! * Programmer: Adapted from C test by: +! * M.S. Breitenfeld +! * +! * Modifications: +! * +! *------------------------------------------------------------------------- +! + + SUBROUTINE mklinks(fapl, total_error) + + IMPLICIT NONE + INTEGER, INTENT(INOUT) :: total_error + INTEGER(HID_T), INTENT(IN) :: fapl + + INTEGER(HID_T) :: file, scalar, grp, d1 + CHARACTER(LEN=12), PARAMETER :: filename ='TestLinks.h5' + INTEGER(HSIZE_T), DIMENSION(1) :: adims2 = (/1/) ! Attribute dimension + INTEGER :: arank = 1 ! Attribure rank + INTEGER :: error + + INTEGER :: cset ! Indicates the character set used for the link’s name. + INTEGER :: corder ! Specifies the link’s creation order position. + LOGICAL :: f_corder_valid ! Indicates whether the value in corder is valid. + INTEGER :: link_type ! Specifies the link class: + ! H5L_TYPE_HARD_F - Hard link + ! H5L_TYPE_SOFT_F - Soft link + ! H5L_TYPE_EXTERNAL_F - External link + ! H5L_TYPE_ERROR _F - Error + INTEGER(HADDR_T) :: address ! If the link is a hard link, address specifies the file address that the link points to + INTEGER(SIZE_T) :: val_size ! If the link is a symbolic link, val_size will be the length of the link value + + +! WRITE(*,*) "link creation (w/new group format)" + + ! Create a file + CALL h5fcreate_f(FileName, H5F_ACC_TRUNC_F, file, error, H5P_DEFAULT_F, fapl) + CALL check("mklinks.h5fcreate_f",error,total_error) + CALL h5screate_simple_f(arank, adims2, scalar, error) + CALL check("mklinks.h5screate_simple_f",error,total_error) + + ! Create a group + CALL H5Gcreate_f(file, "grp1", grp, error) + CALL check("H5Gcreate_f", error, total_error) + CALL H5Gclose_f(grp, error) + CALL check("h5gclose_f",error,total_error) + + ! Create a dataset + CALL h5dcreate_f(file, "d1", H5T_NATIVE_INTEGER, scalar, d1, error) + CALL check("h5dcreate_f",error,total_error) + CALL h5dclose_f(d1, error) + CALL check("h5dclose_f",error,total_error) + + ! Create a hard link + CALL H5Lcreate_hard_f(file, "d1", INT(H5L_SAME_LOC_F,HID_T), "grp1/hard", error) + CALL check("H5Lcreate_hard_f", error, total_error) + + ! Create a symbolic link + CALL H5Lcreate_soft_f("/d1", file, "grp1/soft",error) + CALL check("H5Lcreate_soft_f", error, total_error) + + CALL H5Lget_info_f(file, "grp1/soft", & + cset, corder, f_corder_valid, link_type, address, val_size, & + error, H5P_DEFAULT_F) + CALL check("H5Lget_info_f",error,total_error) + +! CALL verify("H5Lget_info_by_idx_f11", f_corder_valid, .TRUE., total_error) + + CALL verify("H5Lget_info_by_idx_f", H5L_TYPE_SOFT_F, link_type, total_error) + CALL verify("H5Lget_info_by_idx_f", cset, H5T_CSET_ASCII_F, total_error) + ! should be '/d1' + NULL character = 4 + CALL verify("H5Lget_info_by_idx_f", INT(val_size), 4, total_error) + + ! Create a symbolic link to something that doesn't exist + + CALL H5Lcreate_soft_f("foobar", file, "grp1/dangle",error) + + ! Create a recursive symbolic link + CALL H5Lcreate_soft_f("/grp1/recursive", file, "/grp1/recursive",error) + + ! Close + CALL h5sclose_f(scalar, error) + CALL check("h5sclose_f",error,total_error) + CALL h5fclose_f(file, error) + CALL check("h5fclose_f",error,total_error) + + END SUBROUTINE mklinks + +!------------------------------------------------------------------------- +! * Function: test_move_preserves +! * +! * Purpose: Tests that moving and renaming links preserves their +! * properties. +! * +! * Programmer: M.S. Breitenfeld +! * March 3, 2008 +! * +! * Modifications: +! * +! *------------------------------------------------------------------------- +! + + SUBROUTINE test_move_preserves(fapl_id, total_error) + + IMPLICIT NONE + INTEGER, INTENT(INOUT) :: total_error + INTEGER(HID_T), INTENT(IN) :: fapl_id + + INTEGER(HID_T):: file_id + INTEGER(HID_T):: group_id + INTEGER(HID_T):: fcpl_id ! Group creation property list ID + INTEGER(HID_T):: lcpl_id + !H5O_info_t oinfo; + !H5L_info_t linfo; + INTEGER :: old_cset + INTEGER :: old_corder + !H5T_cset_t old_cset; + !int64_t old_corder; Creation order value of link + !time_t old_modification_time; + !time_t curr_time; + !unsigned crt_order_flags; Status of creation order info for GCPL + !char filename[1024]; + + INTEGER :: crt_order_flags ! Status of creation order info for GCPL + CHARACTER(LEN=12), PARAMETER :: filename = 'TestLinks.h5' + + INTEGER :: cset ! Indicates the character set used for the link’s name. + INTEGER :: corder ! Specifies the link’s creation order position. + LOGICAL :: f_corder_valid ! Indicates whether the value in corder is valid. + INTEGER :: link_type ! Specifies the link class: + ! H5L_TYPE_HARD_F - Hard link + ! H5L_TYPE_SOFT_F - Soft link + ! H5L_TYPE_EXTERNAL_F - External link + ! H5L_TYPE_ERROR _F - Error + INTEGER(HADDR_T) :: address ! If the link is a hard link, address specifies the file address that the link points to + INTEGER(SIZE_T) :: val_size ! If the link is a symbolic link, val_size will be the length of the link value + + INTEGER :: error + +! WRITE(*,*) "moving and copying links preserves their properties (w/new group format)" + + ! Create a file creation property list with creation order stored for links + ! * in the root group + ! + + CALL H5Pcreate_f(H5P_FILE_CREATE_F, fcpl_id, error) + CALL check("H5Pcreate_f",error, total_error) + + CALL H5Pget_link_creation_order_f(fcpl_id, crt_order_flags, error) + CALL check("H5Pget_link_creation_order_f",error, total_error) + CALL verify("H5Pget_link_creation_order_f",crt_order_flags,0, total_error) + + CALL H5Pset_link_creation_order_f(fcpl_id, H5P_CRT_ORDER_TRACKED_F, error) + CALL check("H5Pset_link_creation_order_f", error, total_error) + + CALL H5Pget_link_creation_order_f(fcpl_id, crt_order_flags, error) + CALL check("H5Pget_link_creation_order_f",error, total_error) + CALL verify("H5Pget_link_creation_order_f",crt_order_flags, H5P_CRT_ORDER_TRACKED_F, total_error) + + ! Create file + ! (with creation order tracking for the root group) + + CALL h5fcreate_f(FileName, H5F_ACC_TRUNC_F, file_id, error, fcpl_id, fapl_id) + CALL check("h5fcreate_f",error,total_error) + + ! Create a link creation property list with the UTF-8 character encoding + CALL H5Pcreate_f(H5P_LINK_CREATE_F, lcpl_id, error) + CALL check("H5Pcreate_f",error, total_error) + + CALL H5Pset_char_encoding_f(lcpl_id, H5T_CSET_UTF8_F, error) + CALL check("H5Pset_char_encoding_f",error, total_error) + + ! Create a group with that lcpl + CALL H5Gcreate_f(file_id, "group", group_id, error,lcpl_id=lcpl_id, gcpl_id=H5P_DEFAULT_F, gapl_id=H5P_DEFAULT_F) + CALL check("H5Gcreate_f", error, total_error) + CALL H5Gclose_f(group_id, error) + CALL check("H5Gclose_f", error, total_error) + + ! Get the group's link's information + CALL H5Lget_info_f(file_id, "group", & + cset, corder, f_corder_valid, link_type, address, val_size, & + error, H5P_DEFAULT_F) + CALL check("H5Lget_info_f",error,total_error) + +! if(H5Oget_info_by_name(file_id, "group", &oinfo, H5P_DEFAULT) < 0) TEST_ERROR + + old_cset = cset + CALL verify("H5Lget_info_f",old_cset,H5T_CSET_UTF8_F,total_error) + CALL verify("H5Lget_info_f",f_corder_valid,.TRUE.,total_error) + old_corder = corder; + CALL verify("H5Lget_info_f",old_corder,0,total_error) + +! old_modification_time = oinfo.mtime; + +! If this test happens too quickly, the times will all be the same. Make sure the time changes. +! curr_time = HDtime(NULL); +! while(HDtime(NULL) <= curr_time) +! ; + +! Close the file and reopen it + CALL H5Fclose_f(file_id, error) + CALL check("H5Fclose_f", error, total_error) + +!!$ if((file_id = H5Fopen(filename, H5F_ACC_RDWR, fapl_id)) < 0) TEST_ERROR +!!$ +!!$ Get the link's character set & modification time . They should be unchanged +!!$ if(H5Lget_info(file_id, "group", &linfo, H5P_DEFAULT) < 0) TEST_ERROR +!!$ if(H5Oget_info_by_name(file_id, "group", &oinfo, H5P_DEFAULT) < 0) TEST_ERROR +!!$ if(old_modification_time != oinfo.mtime) TEST_ERROR +!!$ if(old_cset != linfo.cset) TEST_ERROR +!!$ if(linfo.corder_valid != TRUE) TEST_ERROR +!!$ if(old_corder != linfo.corder) TEST_ERROR +!!$ +!!$ Create a new link to the group. It should have a different creation order value but the same modification time +!!$ if(H5Lcreate_hard(file_id, "group", file_id, "group2", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR +!!$ if(H5Oget_info_by_name(file_id, "group2", &oinfo, H5P_DEFAULT) < 0) TEST_ERROR +!!$ if(old_modification_time != oinfo.mtime) TEST_ERROR +!!$ if(H5Lget_info(file_id, "group2", &linfo, H5P_DEFAULT) < 0) TEST_ERROR +!!$ if(old_corder == linfo.corder) TEST_ERROR +!!$ if(linfo.corder_valid != TRUE) TEST_ERROR +!!$ if(linfo.corder != 1) TEST_ERROR +!!$ if(linfo.cset != H5T_CSET_ASCII) TEST_ERROR +!!$ +!!$ Copy the first link to a UTF-8 name. +!!$ * Its creation order value should be different, but modification time +!!$ * should not change. +!!$ +!!$ if(H5Lcopy(file_id, "group", file_id, "group_copied", lcpl_id, H5P_DEFAULT) < 0) TEST_ERROR +!!$ if(H5Oget_info_by_name(file_id, "group_copied", &oinfo, H5P_DEFAULT) < 0) TEST_ERROR +!!$ if(old_modification_time != oinfo.mtime) TEST_ERROR +!!$ if(H5Lget_info(file_id, "group_copied", &linfo, H5P_DEFAULT) < 0) TEST_ERROR +!!$ if(linfo.corder_valid != TRUE) TEST_ERROR +!!$ if(linfo.corder != 2) TEST_ERROR +!!$ +!!$ Check that its character encoding is UTF-8 +!!$ if(linfo.cset != H5T_CSET_UTF8) TEST_ERROR +!!$ +!!$ Move the link with the default property list. +!!$ if(H5Lmove(file_id, "group_copied", file_id, "group_copied2", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR +!!$ if(H5Oget_info_by_name(file_id, "group_copied2", &oinfo, H5P_DEFAULT) < 0) TEST_ERROR +!!$ if(old_modification_time != oinfo.mtime) TEST_ERROR +!!$ if(H5Lget_info(file_id, "group_copied2", &linfo, H5P_DEFAULT) < 0) TEST_ERROR +!!$ if(linfo.corder_valid != TRUE) TEST_ERROR +!!$ if(linfo.corder != 3) TEST_ERROR +!!$ +!!$ Check that its character encoding is not UTF-8 +!!$ if(linfo.cset == H5T_CSET_UTF8) TEST_ERROR +!!$ +!!$ Check that the original link is unchanged +!!$ if(H5Oget_info_by_name(file_id, "group", &oinfo, H5P_DEFAULT) < 0) TEST_ERROR +!!$ if(old_modification_time != oinfo.mtime) TEST_ERROR +!!$ if(H5Lget_info(file_id, "group", &linfo, H5P_DEFAULT) < 0) TEST_ERROR +!!$ if(linfo.corder_valid != TRUE) TEST_ERROR +!!$ if(old_corder != linfo.corder) TEST_ERROR +!!$ if(linfo.cset != H5T_CSET_UTF8) TEST_ERROR +!!$ +!!$ Move the first link to a UTF-8 name. +!!$ * Its creation order value will change, but modification time should not +!!$ * change. +!!$ if(H5Lmove(file_id, "group", file_id, "group_moved", lcpl_id, H5P_DEFAULT) < 0) TEST_ERROR +!!$ if(H5Oget_info_by_name(file_id, "group_moved", &oinfo, H5P_DEFAULT) < 0) TEST_ERROR +!!$ if(old_modification_time != oinfo.mtime) TEST_ERROR +!!$ if(H5Lget_info(file_id, "group_moved", &linfo, H5P_DEFAULT) < 0) TEST_ERROR +!!$ if(linfo.corder_valid != TRUE) TEST_ERROR +!!$ if(linfo.corder != 4) TEST_ERROR +!!$ +!!$ Check that its character encoding is UTF-8 +!!$ if(linfo.cset != H5T_CSET_UTF8) TEST_ERROR +!!$ +!!$ Move the link again using the default property list. +!!$ if(H5Lmove(file_id, "group_moved", file_id, "group_moved_again", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR +!!$ if(H5Oget_info_by_name(file_id, "group_moved_again", &oinfo, H5P_DEFAULT) < 0) TEST_ERROR +!!$ if(old_modification_time != oinfo.mtime) TEST_ERROR +!!$ if(H5Lget_info(file_id, "group_moved_again", &linfo, H5P_DEFAULT) < 0) TEST_ERROR +!!$ if(linfo.corder_valid != TRUE) TEST_ERROR +!!$ if(linfo.corder != 5) TEST_ERROR +!!$ +!!$ Check that its character encoding is not UTF-8 +!!$ if(linfo.cset == H5T_CSET_UTF8) TEST_ERROR + + ! Close open IDs + CALL H5Pclose_f(fcpl_id, error) + CALL check("H5Pclose_f", error, total_error) + CALL H5Pclose_f(lcpl_id, error) + CALL check("H5Pclose_f", error, total_error) + + ! if(H5Fclose(file_id) < 0) TEST_ERROR + + END SUBROUTINE test_move_preserves + +!------------------------------------------------------------------------- +! * Function: lifecycle +! * +! * Purpose: Test that adding links to a group follow proper "lifecycle" +! * of empty->compact->symbol table->compact->empty. (As group +! * is created, links are added, then links removed) +! * +! * Return: Success: 0 +! * +! * Failure: -1 +! * +! * Programmer: Quincey Koziol +! * Monday, October 17, 2005 +! * +! *------------------------------------------------------------------------- +! +SUBROUTINE lifecycle(cleanup, fapl2, total_error) + + IMPLICIT NONE + INTEGER, INTENT(INOUT) :: total_error + INTEGER(HID_T), INTENT(IN) :: fapl2 + INTEGER :: error + + INTEGER, PARAMETER :: NAME_BUF_SIZE =7 + + INTEGER(HID_T) :: fid ! File ID + INTEGER(HID_T) :: gid ! Group ID + INTEGER(HID_T) :: gcpl ! Group creation property list ID + INTEGER(size_t) :: lheap_size_hint ! Local heap size hint + INTEGER :: max_compact ! Maximum # of links to store in group compactly + INTEGER :: min_dense ! Minimum # of links to store in group "densely" + INTEGER :: est_num_entries ! Estimated # of entries in group + INTEGER :: est_name_len ! Estimated length of entry name + CHARACTER(LEN=NAME_BUF_SIZE) :: filename = 'fixx.h5' + INTEGER(SIZE_T) :: LIFECYCLE_LOCAL_HEAP_SIZE_HINT = 256 + INTEGER :: LIFECYCLE_MAX_COMPACT = 4 + INTEGER :: LIFECYCLE_MIN_DENSE = 3 + INTEGER :: LIFECYCLE_EST_NUM_ENTRIES = 4 + INTEGER :: LIFECYCLE_EST_NAME_LEN=8 + CHARACTER(LEN=3) :: LIFECYCLE_TOP_GROUP="top" +! These value are taken from H5Gprivate.h + INTEGER :: H5G_CRT_GINFO_MAX_COMPACT = 8 + INTEGER :: H5G_CRT_GINFO_MIN_DENSE = 6 + INTEGER :: H5G_CRT_GINFO_EST_NUM_ENTRIES = 4 + INTEGER :: H5G_CRT_GINFO_EST_NAME_LEN = 8 + logical :: cleanup + +! WRITE(*,*) 'group lifecycle' + + ! Create file + CALL H5Fcreate_f(filename, H5F_ACC_TRUNC_F, fid, error, access_prp=fapl2) + CALL check("H5Fcreate_f",error,total_error) + + ! Close file + CALL H5Fclose_f(fid,error) + CALL check("H5Fclose_f",error,total_error) + + ! Get size of file as empty + ! if((empty_size = h5_get_file_size(filename)) < 0) TEST_ERROR + + ! Re-open file + + CALL H5Fopen_f(filename, H5F_ACC_RDWR_F, fid, error,access_prp=fapl2) + CALL check("H5Fopen_f",error,total_error) + + + ! Set up group creation property list + CALL H5Pcreate_f(H5P_GROUP_CREATE_F,gcpl,error) + CALL check("H5Pcreate_f",error,total_error) + + + ! Query default group creation property settings + CALL H5Pget_local_heap_size_hint_f(gcpl, lheap_size_hint, error) + CALL check("H5Pget_local_heap_size_hint_f",error,total_error) + CALL verify("H5Pget_local_heap_size_hint_f", INT(lheap_size_hint),0,total_error) + + CALL H5Pget_link_phase_change_f(gcpl, max_compact, min_dense, error) + CALL check("H5Pget_link_phase_change_f", error, total_error) + CALL verify("H5Pget_link_phase_change_f", max_compact, H5G_CRT_GINFO_MAX_COMPACT,total_error) + CALL verify("H5Pget_link_phase_change_f", min_dense, H5G_CRT_GINFO_MIN_DENSE,total_error) + + + CALL H5Pget_est_link_info_f(gcpl, est_num_entries, est_name_len, error) + CALL check("H5Pget_est_link_info_f", error, total_error) + CALL verify("H5Pget_est_link_info_f", est_num_entries, H5G_CRT_GINFO_EST_NUM_ENTRIES,total_error) + CALL verify("H5Pget_est_link_info_f", est_name_len, H5G_CRT_GINFO_EST_NAME_LEN,total_error) + + + ! Set GCPL parameters + + CALL H5Pset_local_heap_size_hint_f(gcpl, LIFECYCLE_LOCAL_HEAP_SIZE_HINT, error) + CALL check("H5Pset_local_heap_size_hint_f", error, total_error) + CALL H5Pset_link_phase_change_f(gcpl, LIFECYCLE_MAX_COMPACT, LIFECYCLE_MIN_DENSE, error) + CALL check("H5Pset_link_phase_change_f", error, total_error) + CALL H5Pset_est_link_info_f(gcpl, LIFECYCLE_EST_NUM_ENTRIES, LIFECYCLE_EST_NAME_LEN, error) + CALL check("H5Pset_est_link_info_f", error, total_error) + + ! Create group for testing lifecycle + + CALL H5Gcreate_f(fid, LIFECYCLE_TOP_GROUP, gid, error, gcpl_id=gcpl) + CALL check("H5Gcreate_f", error, total_error) + + ! Query group creation property settings + + CALL H5Pget_local_heap_size_hint_f(gcpl, lheap_size_hint, error) + CALL check("H5Pget_local_heap_size_hint_f",error,total_error) + CALL verify("H5Pget_local_heap_size_hint_f", INT(lheap_size_hint),INT(LIFECYCLE_LOCAL_HEAP_SIZE_HINT),total_error) + + CALL H5Pget_link_phase_change_f(gcpl, max_compact, min_dense, error) + CALL check("H5Pget_link_phase_change_f", error, total_error) + CALL verify("H5Pget_link_phase_change_f", max_compact, LIFECYCLE_MAX_COMPACT,total_error) + CALL verify("H5Pget_link_phase_change_f", min_dense, LIFECYCLE_MIN_DENSE,total_error) + + CALL H5Pget_est_link_info_f(gcpl, est_num_entries, est_name_len, error) + CALL check("H5Pget_est_link_info_f", error, total_error) + CALL verify("H5Pget_est_link_info_f", est_num_entries, LIFECYCLE_EST_NUM_ENTRIES,total_error) + CALL verify("H5Pget_est_link_info_f", est_name_len, LIFECYCLE_EST_NAME_LEN,total_error) + + + + ! Close top group + CALL H5Gclose_f(gid, error) + CALL check("H5Gclose_f", error, total_error) + + ! Unlink top group + + CALL H5Ldelete_f(fid, LIFECYCLE_TOP_GROUP, error) + CALL check("H5Ldelete_f", error, total_error) + + ! Close GCPL + CALL H5Pclose_f(gcpl, error) + CALL check("H5Pclose_f", error, total_error) + + ! Close file + CALL H5Fclose_f(fid,error) + CALL check("H5Fclose_f",error,total_error) + + IF(cleanup) CALL h5_cleanup_f("fixx", H5P_DEFAULT_F, error) + CALL check("h5_cleanup_f", error, total_error) + + END SUBROUTINE lifecycle + +!------------------------------------------------------------------------- +! * Function: cklinks +! * +! * Purpose: Open the file created in the first step and check that the +! * links look correct. +! * +! * Return: Success: 0 +! * +! * Failure: -1 +! * +! * Programmer: M.S. Breitenfeld +! * April 14, 2008 +! * +! * Modifications: Modified original C code +! * +! *------------------------------------------------------------------------- +! + + + SUBROUTINE cklinks(fapl, total_error) + + IMPLICIT NONE + INTEGER, INTENT(INOUT) :: total_error + INTEGER(HID_T), INTENT(IN) :: fapl + INTEGER :: error + + INTEGER(HID_T) :: file +! H5O_info_t oinfo1, oinfo2; +! H5L_info_t linfo2; + + CHARACTER(LEN=12), PARAMETER :: filename ='TestLinks.h5' + +! TYPE(C_PTR) :: linkval + + LOGICAL :: Lexists + + ! Open the file + CALL H5Fopen_f(filename, H5F_ACC_RDONLY_F, file, error,access_prp=fapl) + CALL check("H5Fopen_f",error,total_error) + + + ! Hard link +!!$ IF(H5Oget_info_by_name(file, "d1", &oinfo1, H5P_DEFAULT) < 0) FAIL_STACK_ERROR +!!$ IF(H5Oget_info_by_name(file, "grp1/hard", &oinfo2, H5P_DEFAULT) < 0) FAIL_STACK_ERROR +!!$ IF(H5O_TYPE_DATASET != oinfo2.type) { +!!$ H5_FAILED(); +!!$ printf(" %d: Unexpected object type should have been a dataset\n", __LINE__); +!!$ TEST_ERROR +!!$ } end if +!!$ if(H5F_addr_ne(oinfo1.addr, oinfo2.addr)) { +!!$ H5_FAILED(); +!!$ puts(" Hard link test failed. Link seems not to point to the "); +!!$ puts(" expected file location."); +!!$ TEST_ERROR +!!$ } end if + + + CALL H5Lexists_f(file,"d1",Lexists, error) + CALL verify("H5Lexists", Lexists,.TRUE.,total_error) + + CALL H5Lexists_f(file,"grp1/hard",Lexists, error) + CALL verify("H5Lexists", Lexists,.TRUE.,total_error) + + ! Cleanup + CALL H5Fclose_f(file,error) + CALL check("H5Fclose_f",error,total_error) + +END SUBROUTINE cklinks + + +!------------------------------------------------------------------------- +! * Function: delete_by_idx +! * +! * Purpose: Create a group with creation order indices and test deleting +! * links by index. +! * +! * Return: Total error +! * +! * C Programmer: Quincey Koziol +! * Tuesday, November 14, 2006 +! * +! * Adapted to FORTRAN: M.S. Breitenfeld +! * March 3, 2008 +! * +! *------------------------------------------------------------------------- +! +SUBROUTINE delete_by_idx(cleanup, fapl, total_error) + + IMPLICIT NONE + INTEGER, INTENT(INOUT) :: total_error + INTEGER(HID_T), INTENT(IN) :: fapl + + INTEGER(HID_T) :: file_id ! File ID + INTEGER(HID_T) :: group_id ! Group ID + INTEGER(HID_T) :: gcpl_id ! Group creation property list ID + + INTEGER :: idx_type ! Type of index to operate on + LOGICAL, DIMENSION(1:2) :: use_index = (/.FALSE.,.TRUE./) + ! Use index on creation order values + INTEGER :: max_compact ! Maximum # of links to store in group compactly + INTEGER :: min_dense ! Minimum # of links to store in group "densely" + + CHARACTER(LEN=7) :: objname ! Object name + CHARACTER(LEN=8) :: filename = 'file0.h5' ! File name + CHARACTER(LEN=12), PARAMETER :: CORDER_GROUP_NAME = "corder_group" + + LOGICAL :: f_corder_valid ! Indicates whether the creation order data is valid for this attribute + INTEGER :: corder ! Is a positive integer containing the creation order of the attribute + INTEGER :: cset ! Indicates the character set used for the attribute’s name + INTEGER(SIZE_T) :: val_size + INTEGER :: link_type + INTEGER(HADDR_T) :: address + + INTEGER :: u ! Local index variable + INTEGER :: Input1, i + INTEGER(HID_T) :: group_id2 + INTEGER(HID_T) :: grp + INTEGER :: iorder ! Order within in the index + CHARACTER(LEN=2) :: chr2 + INTEGER :: error + INTEGER :: id_type + ! + ! + ! + CHARACTER(LEN=80) :: fix_filename1 + CHARACTER(LEN=80) :: fix_filename2 + INTEGER(HSIZE_T) :: htmp + + LOGICAL :: cleanup + + DO i = 1, 80 + fix_filename1(i:i) = " " + fix_filename2(i:i) = " " + ENDDO + + ! Loop over operating on different indices on link fields + DO idx_type = H5_INDEX_NAME_F, H5_INDEX_CRT_ORDER_F + ! Loop over operating in different orders + DO iorder = H5_ITER_INC_F, H5_ITER_DEC_F + ! Loop over using index for creation order value + DO i = 1, 2 + ! Print appropriate test message +!!$ IF(idx_type == H5_INDEX_CRT_ORDER_F)THEN +!!$ IF(iorder == H5_ITER_INC_F)THEN +!!$ IF(use_index(i))THEN +!!$ WRITE(*,'(5x,A)')"deleting links by creation order index in increasing order w/creation order index" +!!$ ELSE +!!$ WRITE(*,'(5x,A)')"deleting links by creation order index in increasing order w/o creation order index" +!!$ ENDIF +!!$ ELSE +!!$ IF(use_index(i))THEN +!!$ WRITE(*,'(5x,A)')"deleting links by creation order index in decreasing order w/creation order index" +!!$ ELSE +!!$ WRITE(*,'(5x,A)')"deleting links by creation order index in decreasing order w/o creation order index" +!!$ ENDIF +!!$ ENDIF +!!$ ELSE +!!$ IF(iorder == H5_ITER_INC_F)THEN +!!$ IF(use_index(i))THEN +!!$ WRITE(*,'(5x,A)')"deleting links by name index in increasing order w/creation order index" +!!$ ELSE +!!$ WRITE(*,'(5x,A)')"deleting links by name index in increasing order w/o creation order index" +!!$ ENDIF +!!$ ELSE +!!$ IF(use_index(i))THEN +!!$ WRITE(*,'(5x,A)')"deleting links by name index in decreasing order w/creation order index" +!!$ ELSE +!!$ WRITE(*,'(5x,A)')"deleting links by name index in decreasing order w/o creation order index" +!!$ ENDIF +!!$ ENDIF +!!$ ENDIF + + ! Create file + CALL H5Fcreate_f(filename, H5F_ACC_TRUNC_F, file_id, error, access_prp=fapl) + CALL check("delete_by_idx.H5Fcreate_f", error, total_error) + + ! Create group creation property list + CALL H5Pcreate_f(H5P_GROUP_CREATE_F, gcpl_id, error ) + CALL check("delete_by_idx.H5Pcreate_f", error, total_error) + + ! Set creation order tracking & indexing on group + IF(use_index(i))THEN + Input1 = H5P_CRT_ORDER_INDEXED_F + ELSE + Input1 = 0 + ENDIF + + CALL H5Pset_link_creation_order_f(gcpl_id, IOR(H5P_CRT_ORDER_TRACKED_F, Input1), error) + CALL check("delete_by_idx.H5Pset_link_creation_order_f", error, total_error) + + ! Create group with creation order tracking on + CALL H5Gcreate_f(file_id, CORDER_GROUP_NAME, group_id, error, gcpl_id=gcpl_id) + CALL check("delete_by_idx.H5Gcreate_f", error, total_error) + + ! Query the group creation properties + CALL H5Pget_link_phase_change_f(gcpl_id, max_compact, min_dense, error) + CALL check("delete_by_idx.H5Pget_link_phase_change_f", error, total_error) + + + ! Delete links from one end + + ! Check for deletion on empty group + CALL H5Ldelete_by_idx_f(group_id, ".", idx_type, iorder, INT(0,HSIZE_T), error) + CALL verify("delete_by_idx.H5Ldelete_by_idx_f", error, -1, total_error) ! test should fail (error = -1) + ! Create several links, up to limit of compact form + DO u = 0, max_compact-1 + ! Make name for link + WRITE(chr2,'(I2.2)') u + objname = 'fill '//chr2 + + ! Create hard link, with group object + CALL H5Gcreate_f(group_id, objname, group_id2, error) + CALL check("delete_by_idx.H5Gcreate_f", error, total_error) + CALL H5Gclose_f(group_id2, error) + CALL check("delete_by_idx.H5Gclose_f", error, total_error) + + ! Verify link information for new link + CALL link_info_by_idx_check(group_id, objname, u, & + .TRUE., use_index(i), total_error) + ENDDO + + ! Verify state of group (compact) + ! IF(H5G_has_links_test(group_id, NULL) != TRUE) TEST_ERROR + + ! Check for out of bound deletion + htmp =9 +!EP CALL H5Ldelete_by_idx_f(group_id, ".", idx_type, iorder, INT(u,HSIZE_T), error) + CALL H5Ldelete_by_idx_f(group_id, ".", idx_type, iorder, htmp, error) + CALL verify("H5Ldelete_by_idx_f", error, -1, total_error) ! test should fail (error = -1) + + + ! Delete links from compact group + + DO u = 0, (max_compact - 1) -1 + ! Delete first link in appropriate order + CALL H5Ldelete_by_idx_f(group_id, ".", idx_type, iorder, INT(0,HSIZE_T), error) + CALL check("H5Ldelete_by_idx_f", error, total_error) + ! Verify the link information for first link in appropriate order + ! HDmemset(&linfo, 0, sizeof(linfo)); + + CALL H5Lget_info_by_idx_f(group_id, ".", idx_type, iorder, INT(0,HSIZE_T), & + link_type, f_corder_valid, corder, cset, address, val_size, error) + + CALL H5Oopen_by_addr_f(group_id, address, grp, error) + CALL check("H5Oopen_by_addr_f", error, total_error) + + CALL H5Iget_type_f(grp, id_type, error) + CALL check("H5Iget_type_f", error, total_error) + + CALL verify("H5Iget_type_f", id_type, H5I_GROUP_F, total_error) + + CALL H5Gclose_f(grp, error) + CALL check("H5Gclose_f", error, total_error) + + CALL verify("H5Lget_info_by_idx_f", f_corder_valid, .TRUE., total_error) + + CALL verify("H5Lget_info_by_idx_f", H5L_TYPE_HARD_F, link_type, total_error) + IF(iorder.EQ.H5_ITER_INC_F)THEN + CALL verify("H5Lget_info_by_idx_f", corder, u+1, total_error) + ELSE + CALL verify("H5Lget_info_by_idx_f", corder, (max_compact - (u + 2)), total_error) + ENDIF + + CALL verify("H5Lget_info_by_idx_f",cset, H5T_CSET_ASCII_F, total_error) + + + + ! Verify the name for first link in appropriate order + ! HDmemset(tmpname, 0, (size_t)NAME_BUF_SIZE); +!!$ size_tmp = 20 +!!$ CALL H5Lget_name_by_idx_f(group_id, ".", idx_type, order, INT(0,HSIZE_T), size_tmp, tmpname, error) +!!$ CALL check("delete_by_idx.H5Lget_name_by_idx_f", error, total_error) +!!$ +!!$ IF(order .EQ. H5_ITER_INC_F)THEN +!!$ WRITE(chr2,'(I2.2)') u + 1 +!!$ ELSE +!!$ WRITE(chr2,'(I2.2)') (max_compact - (u + 2)) +!!$ ENDIF +!!$ objname = 'fill '//chr2 +!!$ PRINT*,objname, tmpname +!!$ CALL verify("delete_by_idx.H5Lget_name_by_idx_f", objname, tmpname, total_error) + ENDDO + + ! Close the group + CALL H5Gclose_f(group_id, error) + CALL check("delete_by_idx.H5Gclose_f", error, total_error) + + ! Close the group creation property list + CALL H5Pclose_f(gcpl_id, error) + CALL check("delete_by_idx.H5Gclose_f", error, total_error) + + ! Close the file + CALL H5Fclose_f(file_id, error) + CALL check("delete_by_idx.H5Gclose_f", error, total_error) + + IF(cleanup) CALL h5_cleanup_f("file0", H5P_DEFAULT_F, error) + CALL check("h5_cleanup_f", error, total_error) + + ENDDO + ENDDO + ENDDO + + +END SUBROUTINE delete_by_idx + + + +!------------------------------------------------------------------------- +! * Function: link_info_by_idx_check +! * +! * Purpose: Support routine for link_info_by_idx, to verify the link +! * info is correct for a link +! * +! * Note: This routine assumes that the links have been inserted in the +! * group in alphabetical order. +! * +! * Return: Success: 0 +! * Failure: -1 +! * +! * Programmer: Quincey Koziol +! * Tuesday, November 7, 2006 +! * +! *------------------------------------------------------------------------- +! +SUBROUTINE link_info_by_idx_check(group_id, linkname, n, & + hard_link, use_index, total_error) + + IMPLICIT NONE + INTEGER, INTENT(INOUT) :: total_error + INTEGER(HID_T), INTENT(IN) :: group_id + CHARACTER(LEN=*), INTENT(IN) :: linkname + INTEGER, INTENT(IN) :: n + LOGICAL, INTENT(IN) :: hard_link + LOGICAL, INTENT(IN) :: use_index + + LOGICAL :: f_corder_valid ! Indicates whether the creation order data is valid for this attribute + INTEGER :: corder ! Is a positive integer containing the creation order of the attribute + INTEGER :: cset ! Indicates the character set used for the attribute’s name + INTEGER :: link_type + INTEGER(HADDR_T) :: address + INTEGER(SIZE_T) :: val_size ! Indicates the size, in the number of characters, of the attribute + + CHARACTER(LEN=7) :: tmpname ! Temporary link name + CHARACTER(LEN=3) :: tmpname_small ! to small temporary link name + CHARACTER(LEN=10) :: tmpname_big ! to big temporary link name + + CHARACTER(LEN=7) :: valname ! Link value name + CHARACTER(LEN=2) :: chr2 + INTEGER(SIZE_T) :: size_tmp + INTEGER :: error + + ! Make link value for increasing/native order queries + + WRITE(chr2,'(I2.2)') n + valname = 'valn.'//chr2 + + ! Verify the link information for first link, in increasing creation order + ! HDmemset(&linfo, 0, sizeof(linfo)); + CALL H5Lget_info_by_idx_f(group_id, ".", H5_INDEX_CRT_ORDER_F, H5_ITER_INC_F, INT(0,HSIZE_T), & + link_type, f_corder_valid, corder, cset, address, val_size, error) + CALL check("H5Lget_info_by_idx_f", error, total_error) + CALL verify("H5Lget_info_by_idx_f", corder, 0, total_error) + + ! Verify the link information for new link, in increasing creation order + ! HDmemset(&linfo, 0, sizeof(linfo)); + CALL H5Lget_info_by_idx_f(group_id, ".", H5_INDEX_CRT_ORDER_F, H5_ITER_INC_F, INT(n,HSIZE_T), & + link_type, f_corder_valid, corder, cset, address, val_size, error) + CALL check("H5Lget_info_by_idx_f", error, total_error) + CALL verify("H5Lget_info_by_idx_f", corder, n, total_error) + + ! Verify value for new soft link, in increasing creation order +!!$ IF(hard_link)THEN +!!$ ! HDmemset(tmpval, 0, (size_t)NAME_BUF_SIZE); +!!$ +!!$ CALL H5Lget_val_by_idx_f(group_id, ".", H5_INDEX_CRT_ORDER_F, H5_ITER_INC_F, n, tmpval, INT(7,SIZE_T),error) +!!$ CALL check("H5Lget_val_by_idx",error,total_error) +!!$ +!!$! IF(HDstrcmp(valname, tmpval)) TEST_ERROR +!!$ ENDIF + + ! Verify the name for new link, in increasing creation order + ! HDmemset(tmpname, 0, (size_t)NAME_BUF_SIZE); + + ! The actual size of tmpname should be 7 + + CALL H5Lget_name_by_idx_f(group_id, ".", H5_INDEX_CRT_ORDER_F, H5_ITER_INC_F, INT(n,HSIZE_T), tmpname_small, error, size_tmp) + CALL check("link_info_by_idx_check.H5Lget_name_by_idx_f", error, total_error) + CALL verify("link_info_by_idx_check.H5Lget_name_by_idx_f", & + linkname(1:LEN(tmpname_small)), tmpname_small(1:LEN(tmpname_small)), total_error) + CALL verify("link_info_by_idx_check.H5Lget_name_by_idx_f", INT(size_tmp), 7, total_error) + ! try it with the correct size + CALL H5Lget_name_by_idx_f(group_id, ".", H5_INDEX_CRT_ORDER_F, H5_ITER_INC_F, INT(n,HSIZE_T), tmpname, error, size=size_tmp) + CALL check("link_info_by_idx_check.H5Lget_name_by_idx_f", error, total_error) + CALL verify("link_info_by_idx_check.H5Lget_name_by_idx_f", & + linkname(1:LEN(tmpname)), tmpname(1:LEN(tmpname)), total_error) + CALL verify("link_info_by_idx_check.H5Lget_name_by_idx_f", INT(size_tmp), 7, total_error) + + CALL H5Lget_name_by_idx_f(group_id, ".", H5_INDEX_CRT_ORDER_F, H5_ITER_INC_F, INT(n,HSIZE_T), tmpname_big, error, size_tmp) + CALL check("link_info_by_idx_check.H5Lget_name_by_idx_f", error, total_error) + CALL verify("link_info_by_idx_check.H5Lget_name_by_idx_f", & + linkname(1:7), tmpname_big(1:7), total_error) + CALL verify("link_info_by_idx_check.H5Lget_name_by_idx_f", INT(size_tmp), 7, total_error) + + ! Try with a buffer set to small + + + END SUBROUTINE link_info_by_idx_check + + +!------------------------------------------------------------------------- +! * Function: test_lcpl +! * +! * Purpose: Tests Link Creation Property Lists +! * +! * Return: Success: 0 +! * Failure: number of errors +! * +! * Programmer: M.S. Breitenfeld +! * Modified C routine +! * March 12, 2008 +! * +! * Modifications: +! * +! *------------------------------------------------------------------------- +! + + SUBROUTINE test_lcpl(cleanup, fapl, total_error) + + IMPLICIT NONE + INTEGER, INTENT(INOUT) :: total_error + INTEGER(HID_T), INTENT(IN) :: fapl + LOGICAL :: cleanup + + INTEGER(HID_T) :: file_id + INTEGER(HID_T) :: group_id + INTEGER(HID_T) :: space_id, data_space + INTEGER(HID_T) :: dset_id + INTEGER(HID_T) :: type_id + INTEGER(HID_T) :: lcpl_id + + INTEGER :: cset ! Indicates the character set used for the link’s name. + INTEGER :: corder ! Specifies the link’s creation order position. + LOGICAL :: f_corder_valid ! Indicates whether the value in corder is valid. + INTEGER :: link_type ! Specifies the link class: + ! H5L_TYPE_HARD_F - Hard link + ! H5L_TYPE_SOFT_F - Soft link + ! H5L_TYPE_EXTERNAL_F - External link + ! H5L_TYPE_ERROR _F - Error + INTEGER(HADDR_T) :: address ! If the link is a hard link, address specifies the file address that the link points to + INTEGER(SIZE_T) :: val_size ! If the link is a symbolic link, val_size will be the length of the link value + + CHARACTER(LEN=1024) :: filename = 'tempfile.h5' + INTEGER, PARAMETER :: TEST6_DIM1 = 8, TEST6_DIM2 = 7 + INTEGER(HSIZE_T), DIMENSION(1:2), PARAMETER :: dims = (/TEST6_DIM1,TEST6_DIM2/) + + INTEGER :: encoding + INTEGER :: error + LOGICAL :: Lexists + INTEGER(HSIZE_T), DIMENSION(1:2), PARAMETER :: extend_dim = (/TEST6_DIM1-2,TEST6_DIM2-3/) + INTEGER(HSIZE_T), DIMENSION(1:2) :: dimsout, maxdimsout ! dimensions + + INTEGER :: i + INTEGER :: tmp1, tmp2 + INTEGER(HID_T) :: crp_list + +! WRITE(*,*) "link creation property lists (w/new group format)" + + + ! Actually, intermediate group creation is tested elsewhere (tmisc). + ! * Here we only need to test the character encoding property + + ! Create file + ! h5_fixname(FILENAME[0], fapl, filename, sizeof filename); + + CALL H5Fcreate_f(filename, H5F_ACC_TRUNC_F, file_id, error, H5P_DEFAULT_F, fapl) + CALL check("H5Fcreate_f", error, total_error) + + + ! Create and link a group with the default LCPL + + CALL H5Gcreate_f(file_id, "/group", group_id, error) + CALL check("H5Gcreate_f", error, total_error) + + + ! Check that its character encoding is the default + + CALL H5Lget_info_f(file_id, "group", & + cset, corder, f_corder_valid, link_type, address, val_size, & + error, H5P_DEFAULT_F) + +! File-wide default character encoding can not yet be set via the file +! * creation property list and is always ASCII. +!#define H5F_DEFAULT_CSET H5T_CSET_ASCII -- FROM H5Fprivate.h -- + + CALL verify("H5Lget_info_f",cset, H5T_CSET_ASCII_F,total_error) + + ! Create and commit a datatype with the default LCPL + CALL h5tcopy_f(H5T_NATIVE_INTEGER, type_id, error) + CALL check("h5tcopy_f",error,total_error) + CALL h5tcommit_f(file_id, "/type", type_id, error) + CALL check("h5tcommit_f", error, total_error) + CALL h5tclose_f(type_id, error) + CALL check("h5tclose_f", error, total_error) + + + ! Check that its character encoding is the default + CALL H5Lget_info_f(file_id, "type", & + cset, corder, f_corder_valid, link_type, address, val_size, & + error) + CALL check("h5tclose_f", error, total_error) + +! File-wide default character encoding can not yet be set via the file +! * creation property list and is always ASCII. +!#define H5F_DEFAULT_CSET H5T_CSET_ASCII -- FROM H5Fprivate.h -- + + CALL verify("H5Lget_info_f",cset, H5T_CSET_ASCII_F,total_error) + + ! Create a dataspace + CALL h5screate_simple_f(2, dims, space_id, error) + CALL check("h5screate_simple_f",error,total_error) + CALL h5pcreate_f(H5P_DATASET_CREATE_F, crp_list, error) + CALL h5pset_chunk_f(crp_list, 2, dims, error) + CALL h5pcreate_f(H5P_DATASET_CREATE_F, crp_list, error) + CALL h5pset_chunk_f(crp_list, 2, dims, error) + CALL h5pcreate_f(H5P_DATASET_CREATE_F, crp_list, error) + CALL h5pset_chunk_f(crp_list, 2, dims, error) + + ! Create a dataset using the default LCPL + CALL h5dcreate_f(file_id, "/dataset", H5T_NATIVE_INTEGER, space_id, dset_id, error, crp_list) + CALL check("h5dcreate_f", error, total_error) + + CALL h5dclose_f(dset_id, error) + CALL check("h5dclose_f", error, total_error) + + ! Reopen + + CALL H5Dopen_f(file_id, "/dataset", dset_id, error) + CALL check("h5dopen_f", error, total_error) + + ! Extend the dataset + CALL H5Dset_extent_f(dset_id, extend_dim, error) + CALL check("H5Dset_extent_f", error, total_error) + ! Verify the dataspaces + ! + !Get dataset's dataspace handle. + ! + CALL h5dget_space_f(dset_id, data_space, error) + CALL check("h5dget_space_f",error,total_error) + + CALL h5sget_simple_extent_dims_f(data_space, dimsout, maxdimsout, error) + CALL check("h5sget_simple_extent_dims_f",error, total_error) + + DO i = 1, 2 + tmp1 = INT(dimsout(i)) + tmp2 = INT(extend_dim(i)) + CALL verify("H5Sget_simple_extent_dims", tmp1, tmp2, total_error) + tmp1 = INT(maxdimsout(i)) + tmp2 = INT(dims(i)) + CALL verify("H5Sget_simple_extent_dims", tmp1, tmp2, total_error) + ENDDO + + ! close data set + + CALL h5dclose_f(dset_id, error) + CALL check("h5dclose_f", error, total_error) + + ! Check that its character encoding is the default + CALL H5Lget_info_f(file_id, "dataset", & + cset, corder, f_corder_valid, link_type, address, val_size, & + error) + CALL check("H5Lget_info_f", error, total_error) + +! File-wide default character encoding can not yet be set via the file +! * creation property list and is always ASCII. +!#define H5F_DEFAULT_CSET H5T_CSET_ASCII -- FROM H5Fprivate.h -- + + CALL verify("h5tclose_f",cset, H5T_CSET_ASCII_F,total_error) + + ! Create a link creation property list with the UTF-8 character encoding + CALL H5Pcreate_f(H5P_LINK_CREATE_F,lcpl_id,error) + CALL check("h5Pcreate_f",error,total_error) + CALL H5Pset_char_encoding_f(lcpl_id, H5T_CSET_UTF8_F, error) + CALL check("H5Pset_char_encoding_f",error, total_error) + + ! Create and link a group with the new LCPL + CALL H5Gcreate_f(file_id, "/group2", group_id, error,lcpl_id=lcpl_id) + CALL check("H5Gcreate_f", error, total_error) + CALL H5Gclose_f(group_id, error) + CALL check("H5Gclose_f", error, total_error) + + + ! Check that its character encoding is UTF-8 + CALL H5Lget_info_f(file_id, "group2", & + cset, corder, f_corder_valid, link_type, address, val_size, & + error) + CALL check("H5Lget_info_f", error, total_error) + CALL verify("H5Lget_info_f",cset, H5T_CSET_UTF8_F,total_error) + + + ! Create and commit a datatype with the new LCPL + + CALL h5tcopy_f(H5T_NATIVE_INTEGER, type_id, error) + CALL check("h5tcopy_f",error,total_error) + CALL h5tcommit_f(file_id, "/type2", type_id, error, lcpl_id=lcpl_id) + CALL check("h5tcommit_f", error, total_error) + CALL h5tclose_f(type_id, error) + CALL check("h5tclose_f", error, total_error) + + + ! Check that its character encoding is UTF-8 + CALL H5Lget_info_f(file_id, "type2", & + cset, corder, f_corder_valid, link_type, address, val_size, & + error) + CALL check("H5Lget_info_f", error, total_error) + CALL verify("H5Lget_info_f",cset, H5T_CSET_UTF8_F,total_error) + + ! Create a dataset using the new LCPL + CALL h5dcreate_f(file_id, "/dataset2", H5T_NATIVE_INTEGER, space_id, dset_id, error,lcpl_id=lcpl_id) + CALL check("h5dcreate_f", error, total_error) + + CALL h5dclose_f(dset_id, error) + CALL check("h5dclose_f", error, total_error) + + CALL H5Pget_char_encoding_f(lcpl_id, encoding, error) + CALL check("H5Pget_char_encoding_f", error, total_error) + CALL verify("H5Pget_char_encoding_f", encoding, H5T_CSET_UTF8_F, total_error) + + ! Check that its character encoding is UTF-8 + CALL H5Lget_info_f(file_id, "dataset2", & + cset, corder, f_corder_valid, link_type, address, val_size, & + error) + CALL check("H5Lget_info_f", error, total_error) + CALL verify("H5Lget_info_f2",cset, H5T_CSET_UTF8_F,total_error) + + ! Create a new link to the dataset with a different character encoding. + CALL H5Pclose_f(lcpl_id, error) + CALL check("H5Pclose_f", error, total_error) + + CALL H5Pcreate_f(H5P_LINK_CREATE_F,lcpl_id,error) + CALL check("h5Pcreate_f",error,total_error) + CALL H5Pset_char_encoding_f(lcpl_id, H5T_CSET_ASCII_F, error) + CALL check("H5Pset_char_encoding_f",error, total_error) + CALL H5Lcreate_hard_f(file_id, "/dataset2", file_id, "/dataset2_link", error, lcpl_id) + CALL check("H5Lcreate_hard_f",error, total_error) + + CALL H5Lexists_f(file_id,"/dataset2_link",Lexists, error) + CALL check("H5Lexists",error, total_error) + CALL verify("H5Lexists", Lexists,.TRUE.,total_error) + + ! Check that its character encoding is ASCII + CALL H5Lget_info_f(file_id, "/dataset2_link", & + cset, corder, f_corder_valid, link_type, address, val_size, & + error) + CALL check("H5Lget_info_f", error, total_error) + CALL verify("H5Lget_info_f",cset, H5T_CSET_ASCII_F,total_error) + + ! Check that the first link's encoding hasn't changed + + CALL H5Lget_info_f(file_id, "/dataset2", & + cset, corder, f_corder_valid, link_type, address, val_size, & + error) + CALL check("H5Lget_info_f", error, total_error) + CALL verify("H5Lget_info_f3",cset, H5T_CSET_UTF8_F,total_error) + + + ! Make sure that LCPLs work properly for other API calls: + ! H5Lcreate_soft + + CALL H5Pset_char_encoding_f(lcpl_id, H5T_CSET_UTF8_F, error) + CALL check("H5Pset_char_encoding_f",error, total_error) + CALL H5Lcreate_soft_f("dataset2", file_id, "slink_to_dset2",error,lcpl_id) + CALL check("H5Lcreate_soft_f", error, total_error) + + CALL H5Lget_info_f(file_id, "slink_to_dset2", & + cset, corder, f_corder_valid, link_type, address, val_size, & + error) + CALL check("H5Lget_info_f", error, total_error) + CALL verify("H5Lget_info_f",cset, H5T_CSET_UTF8_F,total_error) + + + ! H5Lmove + CALL H5Pset_char_encoding_f(lcpl_id, H5T_CSET_ASCII_F, error) + CALL check("H5Pset_char_encoding_f",error, total_error) + + CALL H5Lmove_f(file_id, "slink_to_dset2", file_id, "moved_slink", error, lcpl_id, H5P_DEFAULT_F) + CALL check("H5Lmove_f",error, total_error) + + CALL H5Lget_info_f(file_id, "moved_slink", & + cset, corder, f_corder_valid, link_type, address, val_size, & + error) + CALL check("H5Lget_info_f", error, total_error) + CALL verify("H5Lget_info_f",cset, H5T_CSET_ASCII_F,total_error) + + + ! H5Lcopy + + CALL H5Pset_char_encoding_f(lcpl_id, H5T_CSET_UTF8_F, error) + CALL check("H5Pset_char_encoding_f",error, total_error) + + CALL H5Lcopy_f(file_id, "moved_slink", file_id, "copied_slink", error, lcpl_id) + + CALL H5Lget_info_f(file_id, "copied_slink", & + cset, corder, f_corder_valid, link_type, address, val_size, & + error) + CALL check("H5Lget_info_f", error, total_error) + CALL verify("H5Lget_info_f",cset, H5T_CSET_UTF8_F,total_error) + + + ! H5Lcreate_external + + CALL H5Lcreate_external_f("filename", "path", file_id, "extlink", error, lcpl_id) + CALL check("H5Lcreate_external_f", error, total_error) + + CALL H5Lget_info_f(file_id, "extlink", & + cset, corder, f_corder_valid, link_type, address, val_size, & + error) + CALL check("H5Lget_info_f", error, total_error) + CALL verify("H5Lget_info_f",cset, H5T_CSET_UTF8_F,total_error) + + + ! Close open IDs + + CALL H5Pclose_f(lcpl_id, error) + CALL check("H5Pclose_f", error, total_error) + CALL H5Sclose_f(space_id, error) + CALL check("h5Sclose_f",error,total_error) + CALL H5Fclose_f(file_id, error) + CALL check("H5Fclose_f", error, total_error) + + IF(cleanup) CALL h5_cleanup_f("tempfile", H5P_DEFAULT_F, error) + CALL check("h5_cleanup_f", error, total_error) + + +END SUBROUTINE test_lcpl + +SUBROUTINE objcopy(fapl, total_error) + + IMPLICIT NONE + INTEGER, INTENT(INOUT) :: total_error + INTEGER(HID_T), INTENT(IN) :: fapl + + INTEGER(HID_T) :: fapl2, pid + + INTEGER :: flag, cpy_flags + + INTEGER :: error + + flag = H5O_COPY_SHALLOW_HIERARCHY_F + +! Copy the file access property list + CALL H5Pcopy_f(fapl, fapl2, error) + CALL check("H5Pcopy_f", error, total_error) + +! Set the "use the latest version of the format" bounds for creating objects in the file + CALL H5Pset_libver_bounds_f(fapl2, H5F_LIBVER_LATEST_F, H5F_LIBVER_LATEST_F, error) + + ! create property to pass copy options + CALL h5pcreate_f(H5P_OBJECT_COPY_F, pid, error) + CALL check("h5pcreate_f",error, total_error) + + ! set options for object copy + CALL H5Pset_copy_object_f(pid, flag, error) + CALL check("H5Pset_copy_object_f",error, total_error) + + ! Verify object copy flags + CALL H5Pget_copy_object_f(pid, cpy_flags, error) + CALL check("H5Pget_copy_object_f",error, total_error) + CALL verify("H5Pget_copy_object_f", cpy_flags, flag, total_error) + +!!$ +!!$ CALL test_copy_option(fcpl_src, fcpl_dst, my_fapl, H5O_COPY_WITHOUT_ATTR_FLAG, +!!$ FALSE, "H5Ocopy(): without attributes"); + + CALL lapl_nlinks(fapl2, total_error) + +END SUBROUTINE objcopy + + +!------------------------------------------------------------------------- +! * Function: lapl_nlinks +! * +! * Purpose: Check that the maximum number of soft links can be adjusted +! * by the user using the Link Access Property List. +! * +! * Return: Success: 0 +! * +! * Failure: -1 +! * +! * Programmer: James Laird +! * Tuesday, June 6, 2006 +! * +! * Modifications: +! * +! *------------------------------------------------------------------------- +! + +SUBROUTINE lapl_nlinks( fapl, total_error) + + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: fapl + INTEGER, INTENT(INOUT) :: total_error + + INTEGER :: error + + INTEGER(HID_T) :: fid = (-1) ! File ID + INTEGER(HID_T) :: gid = (-1), gid2 = (-1) ! Group IDs + INTEGER(HID_T) :: plist = (-1) ! lapl ID + INTEGER(HID_T) :: tid = (-1) ! Other IDs + INTEGER(HID_T) :: gapl = (-1), dapl = (-1), tapl = (-1) ! Other property lists + + CHARACTER(LEN=7) :: objname ! Object name + INTEGER(size_t) :: name_len ! Length of object name + CHARACTER(LEN=12) :: filename = 'TestLinks.h5' + INTEGER(size_t) :: nlinks ! nlinks for H5Pset_nlinks + INTEGER(size_t) :: buf_size = 7 + +! WRITE(*,*) "adjusting nlinks with LAPL (w/new group format)" + + + ! Create file + CALL h5fcreate_f(FileName, H5F_ACC_TRUNC_F, fid, error, access_prp=fapl) + CALL check(" lapl_nlinks.h5fcreate_f",error,total_error) + + ! Create group with short name in file (used as target for links) + CALL H5Gcreate_f(fid, "final", gid, error) + CALL check(" lapl_nlinks.H5Gcreate_f", error, total_error) + + ! Create chain of soft links to existing object (limited) + CALL H5Lcreate_soft_f("final", fid, "soft1", error) + CALL H5Lcreate_soft_f("soft1", fid, "soft2", error) + CALL H5Lcreate_soft_f("soft2", fid, "soft3", error) + CALL H5Lcreate_soft_f("soft3", fid, "soft4", error) + CALL H5Lcreate_soft_f("soft4", fid, "soft5", error) + CALL H5Lcreate_soft_f("soft5", fid, "soft6", error) + CALL H5Lcreate_soft_f("soft6", fid, "soft7", error) + CALL H5Lcreate_soft_f("soft7", fid, "soft8", error) + CALL H5Lcreate_soft_f("soft8", fid, "soft9", error) + CALL H5Lcreate_soft_f("soft9", fid, "soft10", error) + CALL H5Lcreate_soft_f("soft10", fid, "soft11", error) + CALL H5Lcreate_soft_f("soft11", fid, "soft12", error) + CALL H5Lcreate_soft_f("soft12", fid, "soft13", error) + CALL H5Lcreate_soft_f("soft13", fid, "soft14", error) + CALL H5Lcreate_soft_f("soft14", fid, "soft15", error) + CALL H5Lcreate_soft_f("soft15", fid, "soft16", error) + CALL H5Lcreate_soft_f("soft16", fid, "soft17", error) + + ! Close objects + CALL H5Gclose_f(gid, error) + CALL check("h5gclose_f",error,total_error) + CALL h5fclose_f(fid, error) + CALL check("h5fclose_f",error,total_error) + + ! Open file + + CALL h5fopen_f(FileName, H5F_ACC_RDWR_F, fid, error, fapl) + CALL check("h5open_f",error,total_error) + + ! Create LAPL with higher-than-usual nlinks value + ! Create a non-default lapl with udata set to point to the first group + + CALL H5Pcreate_f(H5P_LINK_ACCESS_F,plist,error) + CALL check("h5Pcreate_f",error,total_error) + nlinks = 20 + CALL H5Pset_nlinks_f(plist, nlinks, error) + CALL check("H5Pset_nlinks_f",error,total_error) + ! Ensure that nlinks was set successfully + nlinks = 0 + CALL H5Pget_nlinks_f(plist, nlinks, error) + CALL check("H5Pset_nlinks_f",error,total_error) + CALL verify("H5Pset_nlinks_f",INT(nlinks), 20, total_error) + + + ! Open object through what is normally too many soft links using + ! * new property list + + CALL H5Oopen_f(fid,"soft17",gid,error,plist) + CALL check("H5Oopen_f",error,total_error) + + ! Check name + CALL h5iget_name_f(gid, objname, buf_size, name_len, error) + CALL check("h5iget_name_f",error,total_error) + CALL verify("h5iget_name_f", TRIM(objname),"/soft17", total_error) + ! Create group using soft link + CALL H5Gcreate_f(gid, "new_soft", gid2, error) + CALL check("H5Gcreate_f", error, total_error) + + ! Close groups + CALL H5Gclose_f(gid2, error) + CALL check("H5Gclose_f", error, total_error) + CALL H5Gclose_f(gid, error) + CALL check("H5Gclose_f", error, total_error) + + + ! Set nlinks to a smaller number + nlinks = 4 + CALL H5Pset_nlinks_f(plist, nlinks, error) + CALL check("H5Pset_nlinks_f", error, total_error) + + ! Ensure that nlinks was set successfully + nlinks = 0 + + CALL H5Pget_nlinks_f(plist, nlinks, error) + CALL check("H5Pget_nlinks_f",error,total_error) + CALL verify("H5Pget_nlinks_f", INT(nlinks), 4, total_error) + + ! Try opening through what is now too many soft links + + CALL H5Oopen_f(fid,"soft5",gid,error,plist) + CALL verify("H5Oopen_f", error, -1, total_error) ! should fail + + ! Open object through lesser soft link + CALL H5Oopen_f(fid,"soft4",gid,error,plist) + CALL check("H5Oopen_",error,total_error) + + ! Check name + CALL h5iget_name_f(gid, objname, buf_size, name_len, error) + CALL check("h5iget_name_f",error,total_error) + CALL verify("h5iget_name_f", TRIM(objname),"/soft4", total_error) + + ! Test other functions that should use a LAPL + nlinks = 20 + CALL H5Pset_nlinks_f(plist, nlinks, error) + CALL check("H5Pset_nlinks_f", error, total_error) + + ! Try copying and moving when both src and dst contain many soft links + ! * using a non-default LAPL + ! + CALL H5Lcopy_f(fid, "soft17", fid, "soft17/newer_soft", error, H5P_DEFAULT_F, plist) + CALL check("H5Lcopy_f",error,total_error) + + CALL H5Lmove_f(fid, "soft17/newer_soft", fid, "soft17/newest_soft", error, lapl_id=plist) + CALL check("H5Lmove_f",error, total_error) + + ! H5Olink + CALL H5Olink_f(gid, fid, "soft17/link_to_group", error, H5P_DEFAULT_F, plist) + CALL check("H5Olink_f", error, total_error) + + ! H5Lcreate_hard and H5Lcreate_soft + CALL H5Lcreate_hard_f(fid, "soft17", fid, "soft17/link2_to_group", error, H5P_DEFAULT_F, plist) + CALL check("H5Lcreate_hard_f", error, total_error) + + + CALL H5Lcreate_soft_f("/soft4", fid, "soft17/soft_link",error, H5P_DEFAULT_F, plist) + CALL check("H5Lcreate_soft_f", error, total_error) + + ! H5Ldelete + CALL h5ldelete_f(fid, "soft17/soft_link", error, plist) + CALL check("H5Ldelete_f", error, total_error) + +!!$ H5Lget_val and H5Lget_info +!!$ if(H5Lget_val(fid, "soft17", NULL, (size_t)0, plist) < 0) TEST_ERROR +!!$ if(H5Lget_info(fid, "soft17", NULL, plist) < 0) TEST_ERROR +!!$ + + ! H5Lcreate_external and H5Lcreate_ud + CALL H5Lcreate_external_f("filename", "path", fid, "soft17/extlink", error, H5P_DEFAULT_F, plist) + CALL check("H5Lcreate_external_f", error, total_error) + +!!$ if(H5Lregister(UD_rereg_class) < 0) TEST_ERROR +!!$ if(H5Lcreate_ud(fid, "soft17/udlink", UD_HARD_TYPE, NULL, (size_t)0, H5P_DEFAULT, plist) < 0) TEST_ERROR +!!$ + ! Close plist + CALL h5pclose_f(plist, error) + CALL check("h5pclose_f", error, total_error) + + ! Create a datatype and dataset as targets inside the group + CALL h5tcopy_f(H5T_NATIVE_INTEGER, tid, error) + CALL check("h5tcopy_f",error,total_error) + CALL h5tcommit_f(gid, "datatype", tid, error) + CALL check("h5tcommit_f", error, total_error) + CALL h5tclose_f(tid, error) + CALL check("h5tclose_f", error, total_error) + +!!$ +!!$ dims[0] = 2; +!!$ dims[1] = 2; +!!$ if((sid = H5Screate_simple(2, dims, NULL)) < 0) TEST_ERROR +!!$ if((did = H5Dcreate2(gid, "dataset", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR +!!$ if(H5Dclose(did) < 0) TEST_ERROR +!!$ + ! Close group + CALL h5gclose_f(gid, error) + CALL check("h5gclose_f",error,total_error) + +!!$ +!!$ Try to open the objects using too many symlinks with default *APLs +!!$ H5E_BEGIN_TRY { +!!$ if((gid = H5Gopen2(fid, "soft17", H5P_DEFAULT)) >= 0) +!!$ FAIL_PUTS_ERROR(" Should have failed for too many nested links.") +!!$ if((tid = H5Topen2(fid, "soft17/datatype", H5P_DEFAULT)) >= 0) +!!$ FAIL_PUTS_ERROR(" Should have failed for too many nested links.") +!!$ if((did = H5Dopen2(fid, "soft17/dataset", H5P_DEFAULT)) >= 0) +!!$ FAIL_PUTS_ERROR(" Should have failed for too many nested links.") +!!$ } H5E_END_TRY +!!$ + ! Create property lists with nlinks set + + CALL H5Pcreate_f(H5P_GROUP_ACCESS_F,gapl,error) + CALL check("h5Pcreate_f",error,total_error) + CALL H5Pcreate_f(H5P_DATATYPE_ACCESS_F,tapl,error) + CALL check("h5Pcreate_f",error,total_error) + CALL H5Pcreate_f(H5P_DATASET_ACCESS_F,dapl,error) + CALL check("h5Pcreate_f",error,total_error) + + + nlinks = 20 + CALL H5Pset_nlinks_f(gapl, nlinks, error) + CALL check("H5Pset_nlinks_f", error, total_error) + CALL H5Pset_nlinks_f(tapl, nlinks, error) + CALL check("H5Pset_nlinks_f", error, total_error) + CALL H5Pset_nlinks_f(dapl, nlinks, error) + CALL check("H5Pset_nlinks_f", error, total_error) + + ! We should now be able to use these property lists to open each kind + ! * of object. + ! + + CALL H5Gopen_f(fid, "soft17", gid, error, gapl) + CALL check("H5Gopen_f",error,total_error) + + CALL H5Topen_f(fid, "soft17/datatype", tid, error, tapl) + CALL check("H5Gopen_f",error,total_error) + +!!$ if((did = H5Dopen2(fid, "soft17/dataset", dapl)) < 0) TEST_ERROR + + ! Close objects + + CALL h5gclose_f(gid, error) + CALL check("h5gclose_f",error,total_error) + CALL h5tclose_f(tid, error) + CALL check("h5tclose_f", error, total_error) + +!!$ if(H5Dclose(did) < 0) TEST_ERROR +!!$ + ! Close plists + + CALL h5pclose_f(gapl, error) + CALL check("h5pclose_f", error, total_error) + CALL h5pclose_f(tapl, error) + CALL check("h5pclose_f", error, total_error) + +!!$ if(H5Pclose(dapl) < 0) TEST_ERROR +!!$ +!!$ Unregister UD hard link class +!!$ if(H5Lunregister(UD_HARD_TYPE) < 0) TEST_ERROR +!!$ + + ! Close file + CALL H5Fclose_f(fid, error) + CALL check("H5Fclose_f", error, total_error) + +END SUBROUTINE lapl_nlinks + +END MODULE TH5G_1_8 diff --git a/fortran/test/tH5G_1_8.f90 b/fortran/test/tH5G_1_8.f90 deleted file mode 100644 index ddc3736..0000000 --- a/fortran/test/tH5G_1_8.f90 +++ /dev/null @@ -1,2126 +0,0 @@ -!****h* root/fortran/test/tH5G_1_8.f90 -! -! NAME -! tH5G_1_8.f90 -! -! FUNCTION -! Basic testing of Fortran H5G APIs introduced in 1.8. -! -! 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. * -! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -! -! CONTAINS SUBROUTINES -! group_test, group_info, timestamps, mklinks, test_move_preserves, lifecycle -! cklinks, delete_by_idx, link_info_by_idx_check, test_lcpl, objcopy, -! lapl_nlinks -! -!***** - -MODULE TH5G_1_8 - - USE HDF5 - USE TH5_MISC - USE TH5_MISC_GEN - -CONTAINS - -SUBROUTINE group_test(cleanup, total_error) - - IMPLICIT NONE - LOGICAL, INTENT(IN) :: cleanup - INTEGER, INTENT(INOUT) :: total_error - - INTEGER(HID_T) :: fapl, fapl2, my_fapl ! File access property lists - - INTEGER :: error, ret_total_error - -! WRITE(*,*) "TESTING GROUPS" - CALL H5Pcreate_f(H5P_FILE_ACCESS_F, fapl, error) - CALL check("H5Pcreate_f",error, total_error) - - ! Copy the file access property list - CALL H5Pcopy_f(fapl, fapl2, error) - CALL check("H5Pcopy_f",error, total_error) - - ! Set the "use the latest version of the format" bounds for creating objects in the file - CALL H5Pset_libver_bounds_f(fapl2, H5F_LIBVER_LATEST_F, H5F_LIBVER_LATEST_F, error) - CALL check("H5Pset_libver_bounds_f",error, total_error) - - ! Check for FAPL to USE - my_fapl = fapl2 - - ret_total_error = 0 - CALL mklinks(fapl2, ret_total_error) - CALL write_test_status(ret_total_error, & - ' Testing building a file with assorted links', & - total_error) - - ret_total_error = 0 - CALL cklinks(fapl2, ret_total_error) - CALL write_test_status(ret_total_error, & - ' Testing links are correct and building assorted links', & - total_error) - - ret_total_error = 0 - CALL group_info(cleanup, fapl2, ret_total_error) - CALL write_test_status(ret_total_error, & - ' Testing create group with creation order indices, test querying group info', & - total_error) - -! CALL ud_hard_links(fapl2,total_error) - ret_total_error = 0 - CALL timestamps(cleanup, fapl2, ret_total_error) - CALL write_test_status(ret_total_error, & - ' Testing disabling tracking timestamps for an object', & - total_error) - - ret_total_error = 0 - CALL test_move_preserves(fapl2, ret_total_error) - CALL write_test_status(ret_total_error, & - ' Testing moving and renaming links preserves their properties', & - total_error) - - ret_total_error = 0 - CALL delete_by_idx(cleanup,fapl2,ret_total_error) - CALL write_test_status(ret_total_error, & - ' Testing deleting links by index', & - total_error) - - ret_total_error = 0 - CALL test_lcpl(cleanup, fapl, ret_total_error) - CALL write_test_status(ret_total_error, & - ' Testing link creation property lists', & - total_error) - - ret_total_error = 0 - CALL objcopy(fapl, ret_total_error) - CALL write_test_status(ret_total_error, & - ' Testing object copy', & - total_error) - - ret_total_error = 0 - CALL lifecycle(cleanup, fapl2, ret_total_error) - CALL write_test_status(ret_total_error, & - ' Testing adding links to a group follow proper "lifecycle"', & - total_error) - - IF(cleanup) CALL h5_cleanup_f("TestLinks", H5P_DEFAULT_F, error) - CALL check("h5_cleanup_f", error, total_error) - - -END SUBROUTINE group_test - -!------------------------------------------------------------------------- -! * Function: group_info -! * -! * Purpose: Create a group with creation order indices and test querying -! * group info. -! * -! * Return: Success: 0 -! * Failure: -1 -! * -! * Programmer: Adapted from C test routines by -! * M.S. Breitenfeld -! * February 18, 2008 -! * -! *------------------------------------------------------------------------- -! - -SUBROUTINE group_info(cleanup, fapl, total_error) - - IMPLICIT NONE - INTEGER, INTENT(INOUT) :: total_error - INTEGER(HID_T), INTENT(IN) :: fapl - - INTEGER(HID_T) :: gcpl_id ! Group creation property list ID - - INTEGER :: max_compact ! Maximum # of links to store in group compactly - INTEGER :: min_dense ! Minimum # of links to store in group "densely" - - INTEGER :: idx_type ! Type of index to operate on - INTEGER :: order, iorder ! Order within in the index - LOGICAL, DIMENSION(1:2) :: use_index = (/.FALSE.,.TRUE./) ! Use index on creation order values - CHARACTER(LEN=6), PARAMETER :: prefix = 'links0' - CHARACTER(LEN=9), PARAMETER :: filename = prefix//'.h5' ! File name - INTEGER :: Input1 - INTEGER(HID_T) :: group_id ! Group ID - INTEGER(HID_T) :: soft_group_id ! Group ID for soft links - - INTEGER :: i ! Local index variables - INTEGER :: storage_type ! Type of storage for links in group: - ! H5G_STORAGE_TYPE_COMPACT: Compact storage - ! H5G_STORAGE_TYPE_DENSE: Indexed storage - ! H5G_STORAGE_TYPE_SYMBOL_TABLE: Symbol tables, the original HDF5 structure - INTEGER :: nlinks ! Number of links in group - INTEGER :: max_corder ! Current maximum creation order value for group - - INTEGER :: u,v ! Local index variables - CHARACTER(LEN=2) :: chr2 - INTEGER(HID_T) :: group_id2, group_id3 ! Group IDs - CHARACTER(LEN=7) :: objname ! Object name - CHARACTER(LEN=7) :: objname2 ! Object name - CHARACTER(LEN=19) :: valname ! Link value - CHARACTER(LEN=12), PARAMETER :: CORDER_GROUP_NAME = "corder_group" - CHARACTER(LEN=17), PARAMETER :: CORDER_SOFT_GROUP_NAME = "corder_soft_group" - INTEGER(HID_T) :: file_id ! File ID - INTEGER :: error ! Generic return value - LOGICAL :: mounted - LOGICAL :: cleanup - - ! Create group creation property list - CALL H5Pcreate_f(H5P_GROUP_CREATE_F, gcpl_id, error ) - CALL check("H5Pcreate_f", error, total_error) - - ! Query the group creation properties - CALL H5Pget_link_phase_change_f(gcpl_id, max_compact, min_dense, error) - CALL check("H5Pget_link_phase_change_f", error, total_error) - - ! Loop over operating on different indices on link fields - DO idx_type = H5_INDEX_NAME_F, H5_INDEX_CRT_ORDER_F - ! Loop over operating in different orders - DO iorder = H5_ITER_INC_F, H5_ITER_NATIVE_F - ! Loop over using index for creation order value - DO i = 1, 2 - ! Print appropriate test message - IF(idx_type == H5_INDEX_CRT_ORDER_F)THEN - IF(iorder == H5_ITER_INC_F)THEN - order = H5_ITER_INC_F -!!$ IF(use_index(i))THEN -!!$ WRITE(*,'(5x,A)')"query group info by creation order index in increasing order w/creation order index" -!!$ ELSE -!!$ WRITE(*,'(5x,A)')"query group info by creation order index in increasing order w/o creation order index" -!!$ ENDIF - ELSE IF (iorder == H5_ITER_DEC_F) THEN - order = H5_ITER_DEC_F -!!$ IF(use_index(i))THEN -!!$ WRITE(*,'(5x,A)')"query group info by creation order index in decreasing order w/creation order index" -!!$ ELSE -!!$ WRITE(*,'(5x,A)')"query group info by creation order index in decreasing order w/o creation order index" -!!$ ENDIF - ELSE - order = H5_ITER_NATIVE_F -!!$ IF(use_index(i))THEN -!!$ WRITE(*,'(5x,A)')"query group info by creation order index in native order w/creation order index" -!!$ ELSE -!!$ WRITE(*,'(5x,A)')"query group info by creation order index in native order w/o creation order index" -!!$ ENDIF - ENDIF - ELSE - IF(iorder == H5_ITER_INC_F)THEN - order = H5_ITER_INC_F -!!$ IF(use_index(i))THEN -!!$ WRITE(*,'(5x,A)')"query group info by creation order index in increasing order w/creation order index" -!!$ ELSE -!!$ WRITE(*,'(5x,A)')"query group info by creation order index in increasing order w/o creation order index" -!!$ ENDIF - ELSE IF (iorder == H5_ITER_DEC_F) THEN - order = H5_ITER_DEC_F -!!$ IF(use_index(i))THEN -!!$ WRITE(*,'(5x,A)')"query group info by creation order index in decreasing order w/creation order index" -!!$ ELSE -!!$ WRITE(*,'(5x,A)')"query group info by creation order index in decreasing order w/o creation order index" -!!$ ENDIF - ELSE - order = H5_ITER_NATIVE_F -!!$ IF(use_index(i))THEN -!!$ WRITE(*,'(5x,A)')"query group info by creation order index in native order w/creation order index" -!!$ ELSE -!!$ WRITE(*,'(5x,A)')"query group info by creation order index in native order w/o creation order index" -!!$ ENDIF - ENDIF - END IF - - ! Create file - CALL H5Fcreate_f(filename, H5F_ACC_TRUNC_F, file_id, error, H5P_DEFAULT_F, fapl) - CALL check("H5Fcreate_f", error, total_error) - - ! Set creation order tracking & indexing on group - IF(use_index(i))THEN - Input1 = H5P_CRT_ORDER_INDEXED_F - ELSE - Input1 = 0 - ENDIF - CALL H5Pset_link_creation_order_f(gcpl_id, IOR(H5P_CRT_ORDER_TRACKED_F, Input1), error) - CALL check("H5Pset_link_creation_order_f", error, total_error) - - ! Create group with creation order tracking on - CALL H5Gcreate_f(file_id, CORDER_GROUP_NAME, group_id, error, gcpl_id=gcpl_id) - CALL check("H5Gcreate_f", error, total_error) - - ! Create group with creation order tracking on for soft links - CALL H5Gcreate_f(file_id, CORDER_SOFT_GROUP_NAME, soft_group_id, error, & - OBJECT_NAMELEN_DEFAULT_F, H5P_DEFAULT_F, gcpl_id) - CALL check("H5Gcreate_f", error, total_error) - - ! Check for out of bound query by index on empty group, should fail - CALL H5Gget_info_by_idx_f(group_id, ".", H5_INDEX_NAME_F, order, INT(0,HSIZE_T), & - storage_type, nlinks, max_corder, error) - CALL verify("H5Gget_info_by_idx_f", error, -1, total_error) - - ! Create several links, up to limit of compact form - DO u = 0, max_compact-1 - - ! Make name for link - WRITE(chr2,'(I2.2)') u - objname = 'fill '//chr2 - - ! Create hard link, with group object - CALL H5Gcreate_f(group_id, objname, group_id2, error, OBJECT_NAMELEN_DEFAULT_F, H5P_DEFAULT_F, gcpl_id) - CALL check("H5Gcreate_f", error, total_error) - - ! Retrieve group's information - CALL H5Gget_info_f(group_id2, storage_type, nlinks, max_corder, error, mounted) - CALL check("H5Gget_info_f", error, total_error) - - ! Check (new/empty) group's information - CALL verify("H5Gget_info_f", storage_type, H5G_STORAGE_TYPE_COMPACT_F, total_error) - CALL verify("H5Gget_info_f", max_corder, 0, total_error) - CALL verify("H5Gget_info_f", nlinks, 0, total_error) - CALL verify("H5Gget_info_f.mounted", mounted,.FALSE.,total_error) - - ! Retrieve group's information - CALL H5Gget_info_by_name_f(group_id, objname, storage_type, nlinks, max_corder, error, mounted=mounted) - CALL check("H5Gget_info_by_name_f", error, total_error) - - ! Check (new/empty) group's information - CALL verify("H5Gget_info_by_name_f", storage_type, H5G_STORAGE_TYPE_COMPACT_F, total_error) - CALL verify("H5Gget_info_by_name_f", max_corder, 0, total_error) - CALL verify("H5Gget_info_by_name_f", nlinks, 0, total_error) - CALL verify("H5Gget_info_by_name_f.mounted", mounted,.FALSE.,total_error) - - ! Retrieve group's information - CALL H5Gget_info_by_name_f(group_id2, ".", storage_type, nlinks, max_corder, error) - CALL check("H5Gget_info_by_name", error, total_error) - - ! Check (new/empty) group's information - CALL verify("H5Gget_info_by_name_f", storage_type, H5G_STORAGE_TYPE_COMPACT_F, total_error) - CALL verify("H5Gget_info_by_name_f", max_corder, 0, total_error) - CALL verify("H5Gget_info_by_name_f", nlinks, 0, total_error) - - ! Create objects in new group created - DO v = 0, u - ! Make name for link - WRITE(chr2,'(I2.2)') v - objname2 = 'fill '//chr2 - - ! Create hard link, with group object - CALL H5Gcreate_f(group_id2, objname2, group_id3, error ) - CALL check("H5Gcreate_f", error, total_error) - - ! Close group created - CALL H5Gclose_f(group_id3, error) - CALL check("H5Gclose_f", error, total_error) - ENDDO - - ! Retrieve group's information - CALL H5Gget_info_f(group_id2, storage_type, nlinks, max_corder, error) - CALL check("H5Gget_info_f", error, total_error) - - ! Check (new) group's information - CALL verify("H5Gget_info_f", storage_type, H5G_STORAGE_TYPE_COMPACT_F, total_error) - CALL verify("H5Gget_info_f", max_corder, u+1, total_error) - CALL verify("H5Gget_info_f", nlinks, u+1, total_error) - - ! Retrieve group's information - CALL H5Gget_info_by_name_f(group_id, objname, storage_type, nlinks, max_corder, error) - CALL check("H5Gget_info_by_name_f", error, total_error) - - ! Check (new) group's information - CALL verify("H5Gget_info_by_name_f", storage_type, H5G_STORAGE_TYPE_COMPACT_F, total_error) - CALL verify("H5Gget_info_by_name_f",max_corder, u+1, total_error) - CALL verify("H5Gget_info_by_name_f", nlinks, u+1, total_error) - - ! Retrieve group's information - CALL H5Gget_info_by_name_f(group_id2, ".", storage_type, nlinks, max_corder, error) - CALL check("H5Gget_info_by_name_f", error, total_error) - - ! Check (new) group's information - CALL verify("H5Gget_info_by_name_f", storage_type, H5G_STORAGE_TYPE_COMPACT_F, total_error) - CALL verify("H5Gget_info_by_name_f", max_corder, u+1, total_error) - CALL verify("H5Gget_info_by_name_f", nlinks, u+1, total_error) - - ! Retrieve group's information - IF(order.NE.H5_ITER_NATIVE_F)THEN - IF(order.EQ.H5_ITER_INC_F) THEN - CALL H5Gget_info_by_idx_f(group_id, ".", idx_type, order, INT(u,HSIZE_T), & - storage_type, nlinks, max_corder, error,lapl_id=H5P_DEFAULT_F, mounted=mounted) - CALL check("H5Gget_info_by_idx_f", error, total_error) - CALL verify("H5Gget_info_by_idx_f", mounted,.FALSE.,total_error) - ELSE - CALL H5Gget_info_by_idx_f(group_id, ".", idx_type, order, INT(0,HSIZE_T), & - storage_type, nlinks, max_corder, error, mounted=mounted) - CALL verify("H5Gget_info_by_idx_f", mounted,.FALSE.,total_error) - CALL check("H5Gget_info_by_idx_f", error, total_error) - ENDIF - ! Check (new) group's information - CALL verify("H5Gget_info_by_idx_f", storage_type, H5G_STORAGE_TYPE_COMPACT_F, total_error) - CALL verify("H5Gget_info_by_idx_f", max_corder, u+1, total_error) - CALL verify("H5Gget_info_by_idx_f", nlinks, u+1, total_error) - ENDIF - ! Close group created - CALL H5Gclose_f(group_id2, error) - CALL check("H5Gclose_f", error, total_error) - - ! Retrieve main group's information - CALL H5Gget_info_f(group_id, storage_type, nlinks, max_corder, error) - CALL check("H5Gget_info_f", error, total_error) - - ! Check main group's information - CALL verify("H5Gget_info_f", storage_type, H5G_STORAGE_TYPE_COMPACT_F, total_error) - CALL verify("H5Gget_info_f", max_corder, u+1, total_error) - CALL verify("H5Gget_info_f", nlinks, u+1, total_error) - - ! Retrieve main group's information, by name - CALL H5Gget_info_by_name_f(file_id, CORDER_GROUP_NAME, storage_type, nlinks, max_corder, error) - CALL check("H5Gget_info_by_name_f", error, total_error) - - ! Check main group's information - CALL verify("H5Gget_info_by_name_f", storage_type, H5G_STORAGE_TYPE_COMPACT_F, total_error) - CALL verify("H5Gget_info_by_name_f", max_corder, u+1, total_error) - CALL verify("H5Gget_info_by_name_f", nlinks, u+1, total_error) - - ! Retrieve main group's information, by name - CALL H5Gget_info_by_name_f(group_id, ".", storage_type, nlinks, max_corder, error, H5P_DEFAULT_F) - CALL check("H5Gget_info_by_name_f", error, total_error) - - ! Check main group's information - CALL verify("H5Gget_info_by_name_f", storage_type, H5G_STORAGE_TYPE_COMPACT_F, total_error) - CALL verify("H5Gget_info_by_name_f", max_corder, u+1, total_error) - CALL verify("H5Gget_info_by_name_f", nlinks, u+1, total_error) - - ! Create soft link in another group, to objects in main group - valname = CORDER_GROUP_NAME//objname - - CALL H5Lcreate_soft_f(valname, soft_group_id, objname, error, H5P_DEFAULT_F, H5P_DEFAULT_F) - - ! Retrieve soft link group's information, by name - CALL H5Gget_info_f(soft_group_id, storage_type, nlinks, max_corder, error) - CALL check("H5Gget_info_f", error, total_error) - - ! Check soft link group's information - CALL verify("H5Gget_info_f", storage_type, H5G_STORAGE_TYPE_COMPACT_F, total_error) - CALL verify("H5Gget_info_f", max_corder, u+1, total_error) - CALL verify("H5Gget_info_f", nlinks, u+1, total_error) - ENDDO - - ! Close the groups - - CALL H5Gclose_f(group_id, error) - CALL check("H5Gclose_f", error, total_error) - CALL H5Gclose_f(soft_group_id, error) - CALL check("H5Gclose_f", error, total_error) - - ! Close the file - CALL H5Fclose_f(file_id, error) - CALL check("H5Fclose_f", error, total_error) - ENDDO - ENDDO - ENDDO - - ! Free resources - CALL H5Pclose_f(gcpl_id, error) - CALL check("H5Pclose_f", error, total_error) - - IF(cleanup) CALL h5_cleanup_f(prefix, H5P_DEFAULT_F, error) - CALL check("h5_cleanup_f", error, total_error) - - - END SUBROUTINE group_info - -!------------------------------------------------------------------------- -! * Function: timestamps -! * -! * Purpose: Verify that disabling tracking timestamps for an object -! * works correctly -! * -! * -! * Programmer: M.S. Breitenfeld -! * February 20, 2008 -! * -! *------------------------------------------------------------------------- -! - - SUBROUTINE timestamps(cleanup, fapl, total_error) - - IMPLICIT NONE - INTEGER, INTENT(INOUT) :: total_error - INTEGER(HID_T), INTENT(IN) :: fapl - - INTEGER(HID_T) :: file_id ! File ID - INTEGER(HID_T) :: group_id ! Group ID - INTEGER(HID_T) :: group_id2 ! Group ID - INTEGER(HID_T) :: gcpl_id ! Group creation property list ID - INTEGER(HID_T) :: gcpl_id2 ! Group creation property list ID - - CHARACTER(LEN=6), PARAMETER :: prefix = 'links9' - CHARACTER(LEN=9), PARAMETER :: filename = prefix//'.h5' ! File name - ! Timestamp macros - CHARACTER(LEN=10), PARAMETER :: TIMESTAMP_GROUP_1="timestamp1" - CHARACTER(LEN=10), PARAMETER :: TIMESTAMP_GROUP_2="timestamp2" - LOGICAL :: track_times - LOGICAL :: cleanup - - INTEGER :: error - - ! Print test message -! WRITE(*,*) "timestamps on objects" - - ! Create group creation property list - CALL H5Pcreate_f(H5P_GROUP_CREATE_F, gcpl_id, error ) - CALL check("H5Pcreate_f", error, total_error) - - ! Query the object timestamp setting - CALL H5Pget_obj_track_times_f(gcpl_id, track_times, error) - CALL check("H5Pget_obj_track_times_f", error, total_error) - - ! Check default timestamp information - CALL verify("H5Pget_obj_track_times",track_times,.TRUE.,total_error) - - ! Set a non-default object timestamp setting - CALL H5Pset_obj_track_times_f(gcpl_id, .FALSE., error) - CALL check("H5Pset_obj_track_times_f", error, total_error) - - ! Query the object timestamp setting - CALL H5Pget_obj_track_times_f(gcpl_id, track_times, error) - CALL check("H5Pget_obj_track_times_f", error, total_error) - - ! Check default timestamp information - CALL verify("H5Pget_obj_track_times",track_times,.FALSE.,total_error) - - ! Create file - !h5_fixname(FILENAME[0], fapl, filename, sizeof filename); - - CALL H5Fcreate_f(filename, H5F_ACC_TRUNC_F, file_id, error, H5P_DEFAULT_F, fapl) - CALL check("h5fcreate_f",error,total_error) - - ! Create group with non-default object timestamp setting - CALL h5gcreate_f(file_id, TIMESTAMP_GROUP_1, group_id, error, & - OBJECT_NAMELEN_DEFAULT_F, H5P_DEFAULT_F, gcpl_id, H5P_DEFAULT_F) - CALL check("h5fcreate_f",error,total_error) - - ! Close the group creation property list - CALL H5Pclose_f(gcpl_id, error) - CALL check("H5Pclose_f", error, total_error) - - ! Create group with default object timestamp setting - CALL h5gcreate_f(file_id, TIMESTAMP_GROUP_2, group_id2, error, & - OBJECT_NAMELEN_DEFAULT_F, H5P_DEFAULT_F, H5P_DEFAULT_F, H5P_DEFAULT_F) - CALL check("h5fcreate_f",error,total_error) - - ! Retrieve the new groups' creation properties - CALL H5Gget_create_plist_f(group_id, gcpl_id, error) - CALL check("H5Gget_create_plist", error, total_error) - CALL H5Gget_create_plist_f(group_id2, gcpl_id2, error) - CALL check("H5Gget_create_plist", error, total_error) - - ! Query & verify the object timestamp settings - CALL H5Pget_obj_track_times_f(gcpl_id, track_times, error) - CALL check("H5Pget_obj_track_times_f", error, total_error) - CALL verify("H5Pget_obj_track_times1",track_times,.FALSE.,total_error) - CALL H5Pget_obj_track_times_f(gcpl_id2, track_times, error) - CALL check("H5Pget_obj_track_times_f", error, total_error) - CALL verify("H5Pget_obj_track_times2",track_times,.TRUE.,total_error) - -! Query the object information for each group -! if(H5Oget_info(group_id, &oinfo) < 0) TEST_ERROR -! if(H5Oget_info(group_id2, &oinfo2) < 0) TEST_ERROR - -!!$ Sanity check object information for each group -!!$ if(oinfo.atime != 0) TEST_ERROR -!!$ if(oinfo.mtime != 0) TEST_ERROR -!!$ if(oinfo.ctime != 0) TEST_ERROR -!!$ if(oinfo.btime != 0) TEST_ERROR -!!$ if(oinfo.atime == oinfo2.atime) TEST_ERROR -!!$ if(oinfo.mtime == oinfo2.mtime) TEST_ERROR -!!$ if(oinfo.ctime == oinfo2.ctime) TEST_ERROR -!!$ if(oinfo.btime == oinfo2.btime) TEST_ERROR -!!$ if((oinfo.hdr.flags & H5O_HDR_STORE_TIMES) != 0) TEST_ERROR -!!$ if((oinfo2.hdr.flags & H5O_HDR_STORE_TIMES) == 0) TEST_ERROR -!!$ if(oinfo.hdr.space.total >= oinfo2.hdr.space.total) TEST_ERROR -!!$ if(oinfo.hdr.space.meta >= oinfo2.hdr.space.meta) TEST_ERROR - - ! Close the property lists - CALL H5Pclose_f(gcpl_id, error) - CALL check("H5Pclose_f", error, total_error) - CALL H5Pclose_f(gcpl_id2, error) - CALL check("H5Pclose_f", error, total_error) - - ! Close the groups - CALL H5Gclose_f(group_id, error) - CALL check("H5Gclose_f", error, total_error) - CALL H5Gclose_f(group_id2, error) - CALL check("H5Gclose_f", error, total_error) - - ! Close the file - CALL H5Fclose_f(file_id, error) - CALL check("H5Fclose_f", error, total_error) - - ! Re-open the file - - CALL h5fopen_f(FileName, H5F_ACC_RDONLY_F, file_id, error, H5P_DEFAULT_F) - CALL check("h5fopen_f",error,total_error) - - ! Open groups - CALL H5Gopen_f(file_id, TIMESTAMP_GROUP_1, group_id, error) ! with no optional param. - CALL check("H5Gopen_f", error, total_error) - CALL H5Gopen_f(file_id, TIMESTAMP_GROUP_2, group_id2, error, H5P_DEFAULT_F) ! with optional param. - CALL check("H5Gopen_f", error, total_error) - - ! Retrieve the new groups' creation properties - CALL H5Gget_create_plist_f(group_id, gcpl_id, error) - CALL check("H5Gget_create_plist", error, total_error) - CALL H5Gget_create_plist_f(group_id2, gcpl_id2, error) - CALL check("H5Gget_create_plist", error, total_error) - - ! Query & verify the object timestamp settings - - CALL H5Pget_obj_track_times_f(gcpl_id, track_times, error) - CALL check("H5Pget_obj_track_times_f", error, total_error) - CALL verify("H5Pget_obj_track_times1",track_times,.FALSE.,total_error) - CALL H5Pget_obj_track_times_f(gcpl_id2, track_times, error) - CALL check("H5Pget_obj_track_times_f", error, total_error) - CALL verify("H5Pget_obj_track_times2",track_times,.TRUE.,total_error) -!!$ -!!$ Query the object information for each group -!!$ if(H5Oget_info(group_id, &oinfo) < 0) TEST_ERROR -!!$ if(H5Oget_info(group_id2, &oinfo2) < 0) TEST_ERROR -!!$ -!!$ Sanity check object information for each group -!!$ if(oinfo.atime != 0) TEST_ERROR -!!$ if(oinfo.mtime != 0) TEST_ERROR -!!$ if(oinfo.ctime != 0) TEST_ERROR -!!$ if(oinfo.btime != 0) TEST_ERROR -!!$ if(oinfo.atime == oinfo2.atime) TEST_ERROR -!!$ if(oinfo.mtime == oinfo2.mtime) TEST_ERROR -!!$ if(oinfo.ctime == oinfo2.ctime) TEST_ERROR -!!$ if(oinfo.btime == oinfo2.btime) TEST_ERROR -!!$ if((oinfo.hdr.flags & H5O_HDR_STORE_TIMES) != 0) TEST_ERROR -!!$ if((oinfo2.hdr.flags & H5O_HDR_STORE_TIMES) == 0) TEST_ERROR -!!$ if(oinfo.hdr.space.total >= oinfo2.hdr.space.total) TEST_ERROR -!!$ if(oinfo.hdr.space.meta >= oinfo2.hdr.space.meta) TEST_ERROR - - ! Close the property lists - CALL H5Pclose_f(gcpl_id, error) - CALL check("H5Pclose_f", error, total_error) - CALL H5Pclose_f(gcpl_id2, error) - CALL check("H5Pclose_f", error, total_error) - - ! Close the groups - CALL H5Gclose_f(group_id, error) - CALL check("H5Gclose_f", error, total_error) - CALL H5Gclose_f(group_id2, error) - CALL check("H5Gclose_f", error, total_error) - - ! Close the file - CALL H5Fclose_f(file_id, error) - CALL check("H5Fclose_f", error, total_error) - - IF(cleanup) CALL h5_cleanup_f(prefix, H5P_DEFAULT_F, error) - CALL check("h5_cleanup_f", error, total_error) - - END SUBROUTINE timestamps - -!------------------------------------------------------------------------- -! * Function: mklinks -! * -! * Purpose: Build a file with assorted links. -! * -! * -! * Programmer: Adapted from C test by: -! * M.S. Breitenfeld -! * -! * Modifications: -! * -! *------------------------------------------------------------------------- -! - - SUBROUTINE mklinks(fapl, total_error) - - IMPLICIT NONE - INTEGER, INTENT(INOUT) :: total_error - INTEGER(HID_T), INTENT(IN) :: fapl - - INTEGER(HID_T) :: file, scalar, grp, d1 - CHARACTER(LEN=12), PARAMETER :: filename ='TestLinks.h5' - INTEGER(HSIZE_T), DIMENSION(1) :: adims2 = (/1/) ! Attribute dimension - INTEGER :: arank = 1 ! Attribure rank - INTEGER :: error - - INTEGER :: cset ! Indicates the character set used for the link’s name. - INTEGER :: corder ! Specifies the link’s creation order position. - LOGICAL :: f_corder_valid ! Indicates whether the value in corder is valid. - INTEGER :: link_type ! Specifies the link class: - ! H5L_TYPE_HARD_F - Hard link - ! H5L_TYPE_SOFT_F - Soft link - ! H5L_TYPE_EXTERNAL_F - External link - ! H5L_TYPE_ERROR _F - Error - INTEGER(HADDR_T) :: address ! If the link is a hard link, address specifies the file address that the link points to - INTEGER(SIZE_T) :: val_size ! If the link is a symbolic link, val_size will be the length of the link value - - -! WRITE(*,*) "link creation (w/new group format)" - - ! Create a file - CALL h5fcreate_f(FileName, H5F_ACC_TRUNC_F, file, error, H5P_DEFAULT_F, fapl) - CALL check("mklinks.h5fcreate_f",error,total_error) - CALL h5screate_simple_f(arank, adims2, scalar, error) - CALL check("mklinks.h5screate_simple_f",error,total_error) - - ! Create a group - CALL H5Gcreate_f(file, "grp1", grp, error) - CALL check("H5Gcreate_f", error, total_error) - CALL H5Gclose_f(grp, error) - CALL check("h5gclose_f",error,total_error) - - ! Create a dataset - CALL h5dcreate_f(file, "d1", H5T_NATIVE_INTEGER, scalar, d1, error) - CALL check("h5dcreate_f",error,total_error) - CALL h5dclose_f(d1, error) - CALL check("h5dclose_f",error,total_error) - - ! Create a hard link - CALL H5Lcreate_hard_f(file, "d1", INT(H5L_SAME_LOC_F,HID_T), "grp1/hard", error) - CALL check("H5Lcreate_hard_f", error, total_error) - - ! Create a symbolic link - CALL H5Lcreate_soft_f("/d1", file, "grp1/soft",error) - CALL check("H5Lcreate_soft_f", error, total_error) - - CALL H5Lget_info_f(file, "grp1/soft", & - cset, corder, f_corder_valid, link_type, address, val_size, & - error, H5P_DEFAULT_F) - CALL check("H5Lget_info_f",error,total_error) - -! CALL verify("H5Lget_info_by_idx_f11", f_corder_valid, .TRUE., total_error) - - CALL verify("H5Lget_info_by_idx_f", H5L_TYPE_SOFT_F, link_type, total_error) - CALL verify("H5Lget_info_by_idx_f", cset, H5T_CSET_ASCII_F, total_error) - ! should be '/d1' + NULL character = 4 - CALL verify("H5Lget_info_by_idx_f", INT(val_size), 4, total_error) - - ! Create a symbolic link to something that doesn't exist - - CALL H5Lcreate_soft_f("foobar", file, "grp1/dangle",error) - - ! Create a recursive symbolic link - CALL H5Lcreate_soft_f("/grp1/recursive", file, "/grp1/recursive",error) - - ! Close - CALL h5sclose_f(scalar, error) - CALL check("h5sclose_f",error,total_error) - CALL h5fclose_f(file, error) - CALL check("h5fclose_f",error,total_error) - - END SUBROUTINE mklinks - -!------------------------------------------------------------------------- -! * Function: test_move_preserves -! * -! * Purpose: Tests that moving and renaming links preserves their -! * properties. -! * -! * Programmer: M.S. Breitenfeld -! * March 3, 2008 -! * -! * Modifications: -! * -! *------------------------------------------------------------------------- -! - - SUBROUTINE test_move_preserves(fapl_id, total_error) - - IMPLICIT NONE - INTEGER, INTENT(INOUT) :: total_error - INTEGER(HID_T), INTENT(IN) :: fapl_id - - INTEGER(HID_T):: file_id - INTEGER(HID_T):: group_id - INTEGER(HID_T):: fcpl_id ! Group creation property list ID - INTEGER(HID_T):: lcpl_id - !H5O_info_t oinfo; - !H5L_info_t linfo; - INTEGER :: old_cset - INTEGER :: old_corder - !H5T_cset_t old_cset; - !int64_t old_corder; Creation order value of link - !time_t old_modification_time; - !time_t curr_time; - !unsigned crt_order_flags; Status of creation order info for GCPL - !char filename[1024]; - - INTEGER :: crt_order_flags ! Status of creation order info for GCPL - CHARACTER(LEN=12), PARAMETER :: filename = 'TestLinks.h5' - - INTEGER :: cset ! Indicates the character set used for the link’s name. - INTEGER :: corder ! Specifies the link’s creation order position. - LOGICAL :: f_corder_valid ! Indicates whether the value in corder is valid. - INTEGER :: link_type ! Specifies the link class: - ! H5L_TYPE_HARD_F - Hard link - ! H5L_TYPE_SOFT_F - Soft link - ! H5L_TYPE_EXTERNAL_F - External link - ! H5L_TYPE_ERROR _F - Error - INTEGER(HADDR_T) :: address ! If the link is a hard link, address specifies the file address that the link points to - INTEGER(SIZE_T) :: val_size ! If the link is a symbolic link, val_size will be the length of the link value - - INTEGER :: error - -! WRITE(*,*) "moving and copying links preserves their properties (w/new group format)" - - ! Create a file creation property list with creation order stored for links - ! * in the root group - ! - - CALL H5Pcreate_f(H5P_FILE_CREATE_F, fcpl_id, error) - CALL check("H5Pcreate_f",error, total_error) - - CALL H5Pget_link_creation_order_f(fcpl_id, crt_order_flags, error) - CALL check("H5Pget_link_creation_order_f",error, total_error) - CALL verify("H5Pget_link_creation_order_f",crt_order_flags,0, total_error) - - CALL H5Pset_link_creation_order_f(fcpl_id, H5P_CRT_ORDER_TRACKED_F, error) - CALL check("H5Pset_link_creation_order_f", error, total_error) - - CALL H5Pget_link_creation_order_f(fcpl_id, crt_order_flags, error) - CALL check("H5Pget_link_creation_order_f",error, total_error) - CALL verify("H5Pget_link_creation_order_f",crt_order_flags, H5P_CRT_ORDER_TRACKED_F, total_error) - - ! Create file - ! (with creation order tracking for the root group) - - CALL h5fcreate_f(FileName, H5F_ACC_TRUNC_F, file_id, error, fcpl_id, fapl_id) - CALL check("h5fcreate_f",error,total_error) - - ! Create a link creation property list with the UTF-8 character encoding - CALL H5Pcreate_f(H5P_LINK_CREATE_F, lcpl_id, error) - CALL check("H5Pcreate_f",error, total_error) - - CALL H5Pset_char_encoding_f(lcpl_id, H5T_CSET_UTF8_F, error) - CALL check("H5Pset_char_encoding_f",error, total_error) - - ! Create a group with that lcpl - CALL H5Gcreate_f(file_id, "group", group_id, error,lcpl_id=lcpl_id, gcpl_id=H5P_DEFAULT_F, gapl_id=H5P_DEFAULT_F) - CALL check("H5Gcreate_f", error, total_error) - CALL H5Gclose_f(group_id, error) - CALL check("H5Gclose_f", error, total_error) - - ! Get the group's link's information - CALL H5Lget_info_f(file_id, "group", & - cset, corder, f_corder_valid, link_type, address, val_size, & - error, H5P_DEFAULT_F) - CALL check("H5Lget_info_f",error,total_error) - -! if(H5Oget_info_by_name(file_id, "group", &oinfo, H5P_DEFAULT) < 0) TEST_ERROR - - old_cset = cset - CALL verify("H5Lget_info_f",old_cset,H5T_CSET_UTF8_F,total_error) - CALL verify("H5Lget_info_f",f_corder_valid,.TRUE.,total_error) - old_corder = corder; - CALL verify("H5Lget_info_f",old_corder,0,total_error) - -! old_modification_time = oinfo.mtime; - -! If this test happens too quickly, the times will all be the same. Make sure the time changes. -! curr_time = HDtime(NULL); -! while(HDtime(NULL) <= curr_time) -! ; - -! Close the file and reopen it - CALL H5Fclose_f(file_id, error) - CALL check("H5Fclose_f", error, total_error) - -!!$ if((file_id = H5Fopen(filename, H5F_ACC_RDWR, fapl_id)) < 0) TEST_ERROR -!!$ -!!$ Get the link's character set & modification time . They should be unchanged -!!$ if(H5Lget_info(file_id, "group", &linfo, H5P_DEFAULT) < 0) TEST_ERROR -!!$ if(H5Oget_info_by_name(file_id, "group", &oinfo, H5P_DEFAULT) < 0) TEST_ERROR -!!$ if(old_modification_time != oinfo.mtime) TEST_ERROR -!!$ if(old_cset != linfo.cset) TEST_ERROR -!!$ if(linfo.corder_valid != TRUE) TEST_ERROR -!!$ if(old_corder != linfo.corder) TEST_ERROR -!!$ -!!$ Create a new link to the group. It should have a different creation order value but the same modification time -!!$ if(H5Lcreate_hard(file_id, "group", file_id, "group2", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR -!!$ if(H5Oget_info_by_name(file_id, "group2", &oinfo, H5P_DEFAULT) < 0) TEST_ERROR -!!$ if(old_modification_time != oinfo.mtime) TEST_ERROR -!!$ if(H5Lget_info(file_id, "group2", &linfo, H5P_DEFAULT) < 0) TEST_ERROR -!!$ if(old_corder == linfo.corder) TEST_ERROR -!!$ if(linfo.corder_valid != TRUE) TEST_ERROR -!!$ if(linfo.corder != 1) TEST_ERROR -!!$ if(linfo.cset != H5T_CSET_ASCII) TEST_ERROR -!!$ -!!$ Copy the first link to a UTF-8 name. -!!$ * Its creation order value should be different, but modification time -!!$ * should not change. -!!$ -!!$ if(H5Lcopy(file_id, "group", file_id, "group_copied", lcpl_id, H5P_DEFAULT) < 0) TEST_ERROR -!!$ if(H5Oget_info_by_name(file_id, "group_copied", &oinfo, H5P_DEFAULT) < 0) TEST_ERROR -!!$ if(old_modification_time != oinfo.mtime) TEST_ERROR -!!$ if(H5Lget_info(file_id, "group_copied", &linfo, H5P_DEFAULT) < 0) TEST_ERROR -!!$ if(linfo.corder_valid != TRUE) TEST_ERROR -!!$ if(linfo.corder != 2) TEST_ERROR -!!$ -!!$ Check that its character encoding is UTF-8 -!!$ if(linfo.cset != H5T_CSET_UTF8) TEST_ERROR -!!$ -!!$ Move the link with the default property list. -!!$ if(H5Lmove(file_id, "group_copied", file_id, "group_copied2", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR -!!$ if(H5Oget_info_by_name(file_id, "group_copied2", &oinfo, H5P_DEFAULT) < 0) TEST_ERROR -!!$ if(old_modification_time != oinfo.mtime) TEST_ERROR -!!$ if(H5Lget_info(file_id, "group_copied2", &linfo, H5P_DEFAULT) < 0) TEST_ERROR -!!$ if(linfo.corder_valid != TRUE) TEST_ERROR -!!$ if(linfo.corder != 3) TEST_ERROR -!!$ -!!$ Check that its character encoding is not UTF-8 -!!$ if(linfo.cset == H5T_CSET_UTF8) TEST_ERROR -!!$ -!!$ Check that the original link is unchanged -!!$ if(H5Oget_info_by_name(file_id, "group", &oinfo, H5P_DEFAULT) < 0) TEST_ERROR -!!$ if(old_modification_time != oinfo.mtime) TEST_ERROR -!!$ if(H5Lget_info(file_id, "group", &linfo, H5P_DEFAULT) < 0) TEST_ERROR -!!$ if(linfo.corder_valid != TRUE) TEST_ERROR -!!$ if(old_corder != linfo.corder) TEST_ERROR -!!$ if(linfo.cset != H5T_CSET_UTF8) TEST_ERROR -!!$ -!!$ Move the first link to a UTF-8 name. -!!$ * Its creation order value will change, but modification time should not -!!$ * change. -!!$ if(H5Lmove(file_id, "group", file_id, "group_moved", lcpl_id, H5P_DEFAULT) < 0) TEST_ERROR -!!$ if(H5Oget_info_by_name(file_id, "group_moved", &oinfo, H5P_DEFAULT) < 0) TEST_ERROR -!!$ if(old_modification_time != oinfo.mtime) TEST_ERROR -!!$ if(H5Lget_info(file_id, "group_moved", &linfo, H5P_DEFAULT) < 0) TEST_ERROR -!!$ if(linfo.corder_valid != TRUE) TEST_ERROR -!!$ if(linfo.corder != 4) TEST_ERROR -!!$ -!!$ Check that its character encoding is UTF-8 -!!$ if(linfo.cset != H5T_CSET_UTF8) TEST_ERROR -!!$ -!!$ Move the link again using the default property list. -!!$ if(H5Lmove(file_id, "group_moved", file_id, "group_moved_again", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR -!!$ if(H5Oget_info_by_name(file_id, "group_moved_again", &oinfo, H5P_DEFAULT) < 0) TEST_ERROR -!!$ if(old_modification_time != oinfo.mtime) TEST_ERROR -!!$ if(H5Lget_info(file_id, "group_moved_again", &linfo, H5P_DEFAULT) < 0) TEST_ERROR -!!$ if(linfo.corder_valid != TRUE) TEST_ERROR -!!$ if(linfo.corder != 5) TEST_ERROR -!!$ -!!$ Check that its character encoding is not UTF-8 -!!$ if(linfo.cset == H5T_CSET_UTF8) TEST_ERROR - - ! Close open IDs - CALL H5Pclose_f(fcpl_id, error) - CALL check("H5Pclose_f", error, total_error) - CALL H5Pclose_f(lcpl_id, error) - CALL check("H5Pclose_f", error, total_error) - - ! if(H5Fclose(file_id) < 0) TEST_ERROR - - END SUBROUTINE test_move_preserves - -!------------------------------------------------------------------------- -! * Function: lifecycle -! * -! * Purpose: Test that adding links to a group follow proper "lifecycle" -! * of empty->compact->symbol table->compact->empty. (As group -! * is created, links are added, then links removed) -! * -! * Return: Success: 0 -! * -! * Failure: -1 -! * -! * Programmer: Quincey Koziol -! * Monday, October 17, 2005 -! * -! *------------------------------------------------------------------------- -! -SUBROUTINE lifecycle(cleanup, fapl2, total_error) - - IMPLICIT NONE - INTEGER, INTENT(INOUT) :: total_error - INTEGER(HID_T), INTENT(IN) :: fapl2 - INTEGER :: error - - INTEGER, PARAMETER :: NAME_BUF_SIZE =7 - - INTEGER(HID_T) :: fid ! File ID - INTEGER(HID_T) :: gid ! Group ID - INTEGER(HID_T) :: gcpl ! Group creation property list ID - INTEGER(size_t) :: lheap_size_hint ! Local heap size hint - INTEGER :: max_compact ! Maximum # of links to store in group compactly - INTEGER :: min_dense ! Minimum # of links to store in group "densely" - INTEGER :: est_num_entries ! Estimated # of entries in group - INTEGER :: est_name_len ! Estimated length of entry name - CHARACTER(LEN=NAME_BUF_SIZE) :: filename = 'fixx.h5' - INTEGER(SIZE_T) :: LIFECYCLE_LOCAL_HEAP_SIZE_HINT = 256 - INTEGER :: LIFECYCLE_MAX_COMPACT = 4 - INTEGER :: LIFECYCLE_MIN_DENSE = 3 - INTEGER :: LIFECYCLE_EST_NUM_ENTRIES = 4 - INTEGER :: LIFECYCLE_EST_NAME_LEN=8 - CHARACTER(LEN=3) :: LIFECYCLE_TOP_GROUP="top" -! These value are taken from H5Gprivate.h - INTEGER :: H5G_CRT_GINFO_MAX_COMPACT = 8 - INTEGER :: H5G_CRT_GINFO_MIN_DENSE = 6 - INTEGER :: H5G_CRT_GINFO_EST_NUM_ENTRIES = 4 - INTEGER :: H5G_CRT_GINFO_EST_NAME_LEN = 8 - logical :: cleanup - -! WRITE(*,*) 'group lifecycle' - - ! Create file - CALL H5Fcreate_f(filename, H5F_ACC_TRUNC_F, fid, error, access_prp=fapl2) - CALL check("H5Fcreate_f",error,total_error) - - ! Close file - CALL H5Fclose_f(fid,error) - CALL check("H5Fclose_f",error,total_error) - - ! Get size of file as empty - ! if((empty_size = h5_get_file_size(filename)) < 0) TEST_ERROR - - ! Re-open file - - CALL H5Fopen_f(filename, H5F_ACC_RDWR_F, fid, error,access_prp=fapl2) - CALL check("H5Fopen_f",error,total_error) - - - ! Set up group creation property list - CALL H5Pcreate_f(H5P_GROUP_CREATE_F,gcpl,error) - CALL check("H5Pcreate_f",error,total_error) - - - ! Query default group creation property settings - CALL H5Pget_local_heap_size_hint_f(gcpl, lheap_size_hint, error) - CALL check("H5Pget_local_heap_size_hint_f",error,total_error) - CALL verify("H5Pget_local_heap_size_hint_f", INT(lheap_size_hint),0,total_error) - - CALL H5Pget_link_phase_change_f(gcpl, max_compact, min_dense, error) - CALL check("H5Pget_link_phase_change_f", error, total_error) - CALL verify("H5Pget_link_phase_change_f", max_compact, H5G_CRT_GINFO_MAX_COMPACT,total_error) - CALL verify("H5Pget_link_phase_change_f", min_dense, H5G_CRT_GINFO_MIN_DENSE,total_error) - - - CALL H5Pget_est_link_info_f(gcpl, est_num_entries, est_name_len, error) - CALL check("H5Pget_est_link_info_f", error, total_error) - CALL verify("H5Pget_est_link_info_f", est_num_entries, H5G_CRT_GINFO_EST_NUM_ENTRIES,total_error) - CALL verify("H5Pget_est_link_info_f", est_name_len, H5G_CRT_GINFO_EST_NAME_LEN,total_error) - - - ! Set GCPL parameters - - CALL H5Pset_local_heap_size_hint_f(gcpl, LIFECYCLE_LOCAL_HEAP_SIZE_HINT, error) - CALL check("H5Pset_local_heap_size_hint_f", error, total_error) - CALL H5Pset_link_phase_change_f(gcpl, LIFECYCLE_MAX_COMPACT, LIFECYCLE_MIN_DENSE, error) - CALL check("H5Pset_link_phase_change_f", error, total_error) - CALL H5Pset_est_link_info_f(gcpl, LIFECYCLE_EST_NUM_ENTRIES, LIFECYCLE_EST_NAME_LEN, error) - CALL check("H5Pset_est_link_info_f", error, total_error) - - ! Create group for testing lifecycle - - CALL H5Gcreate_f(fid, LIFECYCLE_TOP_GROUP, gid, error, gcpl_id=gcpl) - CALL check("H5Gcreate_f", error, total_error) - - ! Query group creation property settings - - CALL H5Pget_local_heap_size_hint_f(gcpl, lheap_size_hint, error) - CALL check("H5Pget_local_heap_size_hint_f",error,total_error) - CALL verify("H5Pget_local_heap_size_hint_f", INT(lheap_size_hint),INT(LIFECYCLE_LOCAL_HEAP_SIZE_HINT),total_error) - - CALL H5Pget_link_phase_change_f(gcpl, max_compact, min_dense, error) - CALL check("H5Pget_link_phase_change_f", error, total_error) - CALL verify("H5Pget_link_phase_change_f", max_compact, LIFECYCLE_MAX_COMPACT,total_error) - CALL verify("H5Pget_link_phase_change_f", min_dense, LIFECYCLE_MIN_DENSE,total_error) - - CALL H5Pget_est_link_info_f(gcpl, est_num_entries, est_name_len, error) - CALL check("H5Pget_est_link_info_f", error, total_error) - CALL verify("H5Pget_est_link_info_f", est_num_entries, LIFECYCLE_EST_NUM_ENTRIES,total_error) - CALL verify("H5Pget_est_link_info_f", est_name_len, LIFECYCLE_EST_NAME_LEN,total_error) - - - - ! Close top group - CALL H5Gclose_f(gid, error) - CALL check("H5Gclose_f", error, total_error) - - ! Unlink top group - - CALL H5Ldelete_f(fid, LIFECYCLE_TOP_GROUP, error) - CALL check("H5Ldelete_f", error, total_error) - - ! Close GCPL - CALL H5Pclose_f(gcpl, error) - CALL check("H5Pclose_f", error, total_error) - - ! Close file - CALL H5Fclose_f(fid,error) - CALL check("H5Fclose_f",error,total_error) - - IF(cleanup) CALL h5_cleanup_f("fixx", H5P_DEFAULT_F, error) - CALL check("h5_cleanup_f", error, total_error) - - END SUBROUTINE lifecycle - -!------------------------------------------------------------------------- -! * Function: cklinks -! * -! * Purpose: Open the file created in the first step and check that the -! * links look correct. -! * -! * Return: Success: 0 -! * -! * Failure: -1 -! * -! * Programmer: M.S. Breitenfeld -! * April 14, 2008 -! * -! * Modifications: Modified original C code -! * -! *------------------------------------------------------------------------- -! - - - SUBROUTINE cklinks(fapl, total_error) - - IMPLICIT NONE - INTEGER, INTENT(INOUT) :: total_error - INTEGER(HID_T), INTENT(IN) :: fapl - INTEGER :: error - - INTEGER(HID_T) :: file -! H5O_info_t oinfo1, oinfo2; -! H5L_info_t linfo2; - - CHARACTER(LEN=12), PARAMETER :: filename ='TestLinks.h5' - -! TYPE(C_PTR) :: linkval - - LOGICAL :: Lexists - - ! Open the file - CALL H5Fopen_f(filename, H5F_ACC_RDONLY_F, file, error,access_prp=fapl) - CALL check("H5Fopen_f",error,total_error) - - - ! Hard link -!!$ IF(H5Oget_info_by_name(file, "d1", &oinfo1, H5P_DEFAULT) < 0) FAIL_STACK_ERROR -!!$ IF(H5Oget_info_by_name(file, "grp1/hard", &oinfo2, H5P_DEFAULT) < 0) FAIL_STACK_ERROR -!!$ IF(H5O_TYPE_DATASET != oinfo2.type) { -!!$ H5_FAILED(); -!!$ printf(" %d: Unexpected object type should have been a dataset\n", __LINE__); -!!$ TEST_ERROR -!!$ } end if -!!$ if(H5F_addr_ne(oinfo1.addr, oinfo2.addr)) { -!!$ H5_FAILED(); -!!$ puts(" Hard link test failed. Link seems not to point to the "); -!!$ puts(" expected file location."); -!!$ TEST_ERROR -!!$ } end if - - - CALL H5Lexists_f(file,"d1",Lexists, error) - CALL verify("H5Lexists", Lexists,.TRUE.,total_error) - - CALL H5Lexists_f(file,"grp1/hard",Lexists, error) - CALL verify("H5Lexists", Lexists,.TRUE.,total_error) - - ! Cleanup - CALL H5Fclose_f(file,error) - CALL check("H5Fclose_f",error,total_error) - -END SUBROUTINE cklinks - - -!------------------------------------------------------------------------- -! * Function: delete_by_idx -! * -! * Purpose: Create a group with creation order indices and test deleting -! * links by index. -! * -! * Return: Total error -! * -! * C Programmer: Quincey Koziol -! * Tuesday, November 14, 2006 -! * -! * Adapted to FORTRAN: M.S. Breitenfeld -! * March 3, 2008 -! * -! *------------------------------------------------------------------------- -! -SUBROUTINE delete_by_idx(cleanup, fapl, total_error) - - IMPLICIT NONE - INTEGER, INTENT(INOUT) :: total_error - INTEGER(HID_T), INTENT(IN) :: fapl - - INTEGER(HID_T) :: file_id ! File ID - INTEGER(HID_T) :: group_id ! Group ID - INTEGER(HID_T) :: gcpl_id ! Group creation property list ID - - INTEGER :: idx_type ! Type of index to operate on - LOGICAL, DIMENSION(1:2) :: use_index = (/.FALSE.,.TRUE./) - ! Use index on creation order values - INTEGER :: max_compact ! Maximum # of links to store in group compactly - INTEGER :: min_dense ! Minimum # of links to store in group "densely" - - CHARACTER(LEN=7) :: objname ! Object name - CHARACTER(LEN=8) :: filename = 'file0.h5' ! File name - CHARACTER(LEN=12), PARAMETER :: CORDER_GROUP_NAME = "corder_group" - - LOGICAL :: f_corder_valid ! Indicates whether the creation order data is valid for this attribute - INTEGER :: corder ! Is a positive integer containing the creation order of the attribute - INTEGER :: cset ! Indicates the character set used for the attribute’s name - INTEGER(SIZE_T) :: val_size - INTEGER :: link_type - INTEGER(HADDR_T) :: address - - INTEGER :: u ! Local index variable - INTEGER :: Input1, i - INTEGER(HID_T) :: group_id2 - INTEGER(HID_T) :: grp - INTEGER :: iorder ! Order within in the index - CHARACTER(LEN=2) :: chr2 - INTEGER :: error - INTEGER :: id_type - ! - ! - ! - CHARACTER(LEN=80) :: fix_filename1 - CHARACTER(LEN=80) :: fix_filename2 - INTEGER(HSIZE_T) :: htmp - - LOGICAL :: cleanup - - DO i = 1, 80 - fix_filename1(i:i) = " " - fix_filename2(i:i) = " " - ENDDO - - ! Loop over operating on different indices on link fields - DO idx_type = H5_INDEX_NAME_F, H5_INDEX_CRT_ORDER_F - ! Loop over operating in different orders - DO iorder = H5_ITER_INC_F, H5_ITER_DEC_F - ! Loop over using index for creation order value - DO i = 1, 2 - ! Print appropriate test message -!!$ IF(idx_type == H5_INDEX_CRT_ORDER_F)THEN -!!$ IF(iorder == H5_ITER_INC_F)THEN -!!$ IF(use_index(i))THEN -!!$ WRITE(*,'(5x,A)')"deleting links by creation order index in increasing order w/creation order index" -!!$ ELSE -!!$ WRITE(*,'(5x,A)')"deleting links by creation order index in increasing order w/o creation order index" -!!$ ENDIF -!!$ ELSE -!!$ IF(use_index(i))THEN -!!$ WRITE(*,'(5x,A)')"deleting links by creation order index in decreasing order w/creation order index" -!!$ ELSE -!!$ WRITE(*,'(5x,A)')"deleting links by creation order index in decreasing order w/o creation order index" -!!$ ENDIF -!!$ ENDIF -!!$ ELSE -!!$ IF(iorder == H5_ITER_INC_F)THEN -!!$ IF(use_index(i))THEN -!!$ WRITE(*,'(5x,A)')"deleting links by name index in increasing order w/creation order index" -!!$ ELSE -!!$ WRITE(*,'(5x,A)')"deleting links by name index in increasing order w/o creation order index" -!!$ ENDIF -!!$ ELSE -!!$ IF(use_index(i))THEN -!!$ WRITE(*,'(5x,A)')"deleting links by name index in decreasing order w/creation order index" -!!$ ELSE -!!$ WRITE(*,'(5x,A)')"deleting links by name index in decreasing order w/o creation order index" -!!$ ENDIF -!!$ ENDIF -!!$ ENDIF - - ! Create file - CALL H5Fcreate_f(filename, H5F_ACC_TRUNC_F, file_id, error, access_prp=fapl) - CALL check("delete_by_idx.H5Fcreate_f", error, total_error) - - ! Create group creation property list - CALL H5Pcreate_f(H5P_GROUP_CREATE_F, gcpl_id, error ) - CALL check("delete_by_idx.H5Pcreate_f", error, total_error) - - ! Set creation order tracking & indexing on group - IF(use_index(i))THEN - Input1 = H5P_CRT_ORDER_INDEXED_F - ELSE - Input1 = 0 - ENDIF - - CALL H5Pset_link_creation_order_f(gcpl_id, IOR(H5P_CRT_ORDER_TRACKED_F, Input1), error) - CALL check("delete_by_idx.H5Pset_link_creation_order_f", error, total_error) - - ! Create group with creation order tracking on - CALL H5Gcreate_f(file_id, CORDER_GROUP_NAME, group_id, error, gcpl_id=gcpl_id) - CALL check("delete_by_idx.H5Gcreate_f", error, total_error) - - ! Query the group creation properties - CALL H5Pget_link_phase_change_f(gcpl_id, max_compact, min_dense, error) - CALL check("delete_by_idx.H5Pget_link_phase_change_f", error, total_error) - - - ! Delete links from one end - - ! Check for deletion on empty group - CALL H5Ldelete_by_idx_f(group_id, ".", idx_type, iorder, INT(0,HSIZE_T), error) - CALL verify("delete_by_idx.H5Ldelete_by_idx_f", error, -1, total_error) ! test should fail (error = -1) - ! Create several links, up to limit of compact form - DO u = 0, max_compact-1 - ! Make name for link - WRITE(chr2,'(I2.2)') u - objname = 'fill '//chr2 - - ! Create hard link, with group object - CALL H5Gcreate_f(group_id, objname, group_id2, error) - CALL check("delete_by_idx.H5Gcreate_f", error, total_error) - CALL H5Gclose_f(group_id2, error) - CALL check("delete_by_idx.H5Gclose_f", error, total_error) - - ! Verify link information for new link - CALL link_info_by_idx_check(group_id, objname, u, & - .TRUE., use_index(i), total_error) - ENDDO - - ! Verify state of group (compact) - ! IF(H5G_has_links_test(group_id, NULL) != TRUE) TEST_ERROR - - ! Check for out of bound deletion - htmp =9 -!EP CALL H5Ldelete_by_idx_f(group_id, ".", idx_type, iorder, INT(u,HSIZE_T), error) - CALL H5Ldelete_by_idx_f(group_id, ".", idx_type, iorder, htmp, error) - CALL verify("H5Ldelete_by_idx_f", error, -1, total_error) ! test should fail (error = -1) - - - ! Delete links from compact group - - DO u = 0, (max_compact - 1) -1 - ! Delete first link in appropriate order - CALL H5Ldelete_by_idx_f(group_id, ".", idx_type, iorder, INT(0,HSIZE_T), error) - CALL check("H5Ldelete_by_idx_f", error, total_error) - ! Verify the link information for first link in appropriate order - ! HDmemset(&linfo, 0, sizeof(linfo)); - - CALL H5Lget_info_by_idx_f(group_id, ".", idx_type, iorder, INT(0,HSIZE_T), & - link_type, f_corder_valid, corder, cset, address, val_size, error) - - CALL H5Oopen_by_addr_f(group_id, address, grp, error) - CALL check("H5Oopen_by_addr_f", error, total_error) - - CALL H5Iget_type_f(grp, id_type, error) - CALL check("H5Iget_type_f", error, total_error) - - CALL verify("H5Iget_type_f", id_type, H5I_GROUP_F, total_error) - - CALL H5Gclose_f(grp, error) - CALL check("H5Gclose_f", error, total_error) - - CALL verify("H5Lget_info_by_idx_f", f_corder_valid, .TRUE., total_error) - - CALL verify("H5Lget_info_by_idx_f", H5L_TYPE_HARD_F, link_type, total_error) - IF(iorder.EQ.H5_ITER_INC_F)THEN - CALL verify("H5Lget_info_by_idx_f", corder, u+1, total_error) - ELSE - CALL verify("H5Lget_info_by_idx_f", corder, (max_compact - (u + 2)), total_error) - ENDIF - - CALL verify("H5Lget_info_by_idx_f",cset, H5T_CSET_ASCII_F, total_error) - - - - ! Verify the name for first link in appropriate order - ! HDmemset(tmpname, 0, (size_t)NAME_BUF_SIZE); -!!$ size_tmp = 20 -!!$ CALL H5Lget_name_by_idx_f(group_id, ".", idx_type, order, INT(0,HSIZE_T), size_tmp, tmpname, error) -!!$ CALL check("delete_by_idx.H5Lget_name_by_idx_f", error, total_error) -!!$ -!!$ IF(order .EQ. H5_ITER_INC_F)THEN -!!$ WRITE(chr2,'(I2.2)') u + 1 -!!$ ELSE -!!$ WRITE(chr2,'(I2.2)') (max_compact - (u + 2)) -!!$ ENDIF -!!$ objname = 'fill '//chr2 -!!$ PRINT*,objname, tmpname -!!$ CALL verify("delete_by_idx.H5Lget_name_by_idx_f", objname, tmpname, total_error) - ENDDO - - ! Close the group - CALL H5Gclose_f(group_id, error) - CALL check("delete_by_idx.H5Gclose_f", error, total_error) - - ! Close the group creation property list - CALL H5Pclose_f(gcpl_id, error) - CALL check("delete_by_idx.H5Gclose_f", error, total_error) - - ! Close the file - CALL H5Fclose_f(file_id, error) - CALL check("delete_by_idx.H5Gclose_f", error, total_error) - - IF(cleanup) CALL h5_cleanup_f("file0", H5P_DEFAULT_F, error) - CALL check("h5_cleanup_f", error, total_error) - - ENDDO - ENDDO - ENDDO - - -END SUBROUTINE delete_by_idx - - - -!------------------------------------------------------------------------- -! * Function: link_info_by_idx_check -! * -! * Purpose: Support routine for link_info_by_idx, to verify the link -! * info is correct for a link -! * -! * Note: This routine assumes that the links have been inserted in the -! * group in alphabetical order. -! * -! * Return: Success: 0 -! * Failure: -1 -! * -! * Programmer: Quincey Koziol -! * Tuesday, November 7, 2006 -! * -! *------------------------------------------------------------------------- -! -SUBROUTINE link_info_by_idx_check(group_id, linkname, n, & - hard_link, use_index, total_error) - - IMPLICIT NONE - INTEGER, INTENT(INOUT) :: total_error - INTEGER(HID_T), INTENT(IN) :: group_id - CHARACTER(LEN=*), INTENT(IN) :: linkname - INTEGER, INTENT(IN) :: n - LOGICAL, INTENT(IN) :: hard_link - LOGICAL, INTENT(IN) :: use_index - - LOGICAL :: f_corder_valid ! Indicates whether the creation order data is valid for this attribute - INTEGER :: corder ! Is a positive integer containing the creation order of the attribute - INTEGER :: cset ! Indicates the character set used for the attribute’s name - INTEGER :: link_type - INTEGER(HADDR_T) :: address - INTEGER(SIZE_T) :: val_size ! Indicates the size, in the number of characters, of the attribute - - CHARACTER(LEN=7) :: tmpname ! Temporary link name - CHARACTER(LEN=3) :: tmpname_small ! to small temporary link name - CHARACTER(LEN=10) :: tmpname_big ! to big temporary link name - - CHARACTER(LEN=7) :: valname ! Link value name - CHARACTER(LEN=2) :: chr2 - INTEGER(SIZE_T) :: size_tmp - INTEGER :: error - - ! Make link value for increasing/native order queries - - WRITE(chr2,'(I2.2)') n - valname = 'valn.'//chr2 - - ! Verify the link information for first link, in increasing creation order - ! HDmemset(&linfo, 0, sizeof(linfo)); - CALL H5Lget_info_by_idx_f(group_id, ".", H5_INDEX_CRT_ORDER_F, H5_ITER_INC_F, INT(0,HSIZE_T), & - link_type, f_corder_valid, corder, cset, address, val_size, error) - CALL check("H5Lget_info_by_idx_f", error, total_error) - CALL verify("H5Lget_info_by_idx_f", corder, 0, total_error) - - ! Verify the link information for new link, in increasing creation order - ! HDmemset(&linfo, 0, sizeof(linfo)); - CALL H5Lget_info_by_idx_f(group_id, ".", H5_INDEX_CRT_ORDER_F, H5_ITER_INC_F, INT(n,HSIZE_T), & - link_type, f_corder_valid, corder, cset, address, val_size, error) - CALL check("H5Lget_info_by_idx_f", error, total_error) - CALL verify("H5Lget_info_by_idx_f", corder, n, total_error) - - ! Verify value for new soft link, in increasing creation order -!!$ IF(hard_link)THEN -!!$ ! HDmemset(tmpval, 0, (size_t)NAME_BUF_SIZE); -!!$ -!!$ CALL H5Lget_val_by_idx_f(group_id, ".", H5_INDEX_CRT_ORDER_F, H5_ITER_INC_F, n, tmpval, INT(7,SIZE_T),error) -!!$ CALL check("H5Lget_val_by_idx",error,total_error) -!!$ -!!$! IF(HDstrcmp(valname, tmpval)) TEST_ERROR -!!$ ENDIF - - ! Verify the name for new link, in increasing creation order - ! HDmemset(tmpname, 0, (size_t)NAME_BUF_SIZE); - - ! The actual size of tmpname should be 7 - - CALL H5Lget_name_by_idx_f(group_id, ".", H5_INDEX_CRT_ORDER_F, H5_ITER_INC_F, INT(n,HSIZE_T), tmpname_small, error, size_tmp) - CALL check("link_info_by_idx_check.H5Lget_name_by_idx_f", error, total_error) - CALL verify("link_info_by_idx_check.H5Lget_name_by_idx_f", & - linkname(1:LEN(tmpname_small)), tmpname_small(1:LEN(tmpname_small)), total_error) - CALL verify("link_info_by_idx_check.H5Lget_name_by_idx_f", INT(size_tmp), 7, total_error) - ! try it with the correct size - CALL H5Lget_name_by_idx_f(group_id, ".", H5_INDEX_CRT_ORDER_F, H5_ITER_INC_F, INT(n,HSIZE_T), tmpname, error, size=size_tmp) - CALL check("link_info_by_idx_check.H5Lget_name_by_idx_f", error, total_error) - CALL verify("link_info_by_idx_check.H5Lget_name_by_idx_f", & - linkname(1:LEN(tmpname)), tmpname(1:LEN(tmpname)), total_error) - CALL verify("link_info_by_idx_check.H5Lget_name_by_idx_f", INT(size_tmp), 7, total_error) - - CALL H5Lget_name_by_idx_f(group_id, ".", H5_INDEX_CRT_ORDER_F, H5_ITER_INC_F, INT(n,HSIZE_T), tmpname_big, error, size_tmp) - CALL check("link_info_by_idx_check.H5Lget_name_by_idx_f", error, total_error) - CALL verify("link_info_by_idx_check.H5Lget_name_by_idx_f", & - linkname(1:7), tmpname_big(1:7), total_error) - CALL verify("link_info_by_idx_check.H5Lget_name_by_idx_f", INT(size_tmp), 7, total_error) - - ! Try with a buffer set to small - - - END SUBROUTINE link_info_by_idx_check - - -!------------------------------------------------------------------------- -! * Function: test_lcpl -! * -! * Purpose: Tests Link Creation Property Lists -! * -! * Return: Success: 0 -! * Failure: number of errors -! * -! * Programmer: M.S. Breitenfeld -! * Modified C routine -! * March 12, 2008 -! * -! * Modifications: -! * -! *------------------------------------------------------------------------- -! - - SUBROUTINE test_lcpl(cleanup, fapl, total_error) - - IMPLICIT NONE - INTEGER, INTENT(INOUT) :: total_error - INTEGER(HID_T), INTENT(IN) :: fapl - LOGICAL :: cleanup - - INTEGER(HID_T) :: file_id - INTEGER(HID_T) :: group_id - INTEGER(HID_T) :: space_id, data_space - INTEGER(HID_T) :: dset_id - INTEGER(HID_T) :: type_id - INTEGER(HID_T) :: lcpl_id - - INTEGER :: cset ! Indicates the character set used for the link’s name. - INTEGER :: corder ! Specifies the link’s creation order position. - LOGICAL :: f_corder_valid ! Indicates whether the value in corder is valid. - INTEGER :: link_type ! Specifies the link class: - ! H5L_TYPE_HARD_F - Hard link - ! H5L_TYPE_SOFT_F - Soft link - ! H5L_TYPE_EXTERNAL_F - External link - ! H5L_TYPE_ERROR _F - Error - INTEGER(HADDR_T) :: address ! If the link is a hard link, address specifies the file address that the link points to - INTEGER(SIZE_T) :: val_size ! If the link is a symbolic link, val_size will be the length of the link value - - CHARACTER(LEN=1024) :: filename = 'tempfile.h5' - INTEGER, PARAMETER :: TEST6_DIM1 = 8, TEST6_DIM2 = 7 - INTEGER(HSIZE_T), DIMENSION(1:2), PARAMETER :: dims = (/TEST6_DIM1,TEST6_DIM2/) - - INTEGER :: encoding - INTEGER :: error - LOGICAL :: Lexists - INTEGER(HSIZE_T), DIMENSION(1:2), PARAMETER :: extend_dim = (/TEST6_DIM1-2,TEST6_DIM2-3/) - INTEGER(HSIZE_T), DIMENSION(1:2) :: dimsout, maxdimsout ! dimensions - - INTEGER :: i - INTEGER :: tmp1, tmp2 - INTEGER(HID_T) :: crp_list - -! WRITE(*,*) "link creation property lists (w/new group format)" - - - ! Actually, intermediate group creation is tested elsewhere (tmisc). - ! * Here we only need to test the character encoding property - - ! Create file - ! h5_fixname(FILENAME[0], fapl, filename, sizeof filename); - - CALL H5Fcreate_f(filename, H5F_ACC_TRUNC_F, file_id, error, H5P_DEFAULT_F, fapl) - CALL check("H5Fcreate_f", error, total_error) - - - ! Create and link a group with the default LCPL - - CALL H5Gcreate_f(file_id, "/group", group_id, error) - CALL check("H5Gcreate_f", error, total_error) - - - ! Check that its character encoding is the default - - CALL H5Lget_info_f(file_id, "group", & - cset, corder, f_corder_valid, link_type, address, val_size, & - error, H5P_DEFAULT_F) - -! File-wide default character encoding can not yet be set via the file -! * creation property list and is always ASCII. -!#define H5F_DEFAULT_CSET H5T_CSET_ASCII -- FROM H5Fprivate.h -- - - CALL verify("H5Lget_info_f",cset, H5T_CSET_ASCII_F,total_error) - - ! Create and commit a datatype with the default LCPL - CALL h5tcopy_f(H5T_NATIVE_INTEGER, type_id, error) - CALL check("h5tcopy_f",error,total_error) - CALL h5tcommit_f(file_id, "/type", type_id, error) - CALL check("h5tcommit_f", error, total_error) - CALL h5tclose_f(type_id, error) - CALL check("h5tclose_f", error, total_error) - - - ! Check that its character encoding is the default - CALL H5Lget_info_f(file_id, "type", & - cset, corder, f_corder_valid, link_type, address, val_size, & - error) - CALL check("h5tclose_f", error, total_error) - -! File-wide default character encoding can not yet be set via the file -! * creation property list and is always ASCII. -!#define H5F_DEFAULT_CSET H5T_CSET_ASCII -- FROM H5Fprivate.h -- - - CALL verify("H5Lget_info_f",cset, H5T_CSET_ASCII_F,total_error) - - ! Create a dataspace - CALL h5screate_simple_f(2, dims, space_id, error) - CALL check("h5screate_simple_f",error,total_error) - CALL h5pcreate_f(H5P_DATASET_CREATE_F, crp_list, error) - CALL h5pset_chunk_f(crp_list, 2, dims, error) - CALL h5pcreate_f(H5P_DATASET_CREATE_F, crp_list, error) - CALL h5pset_chunk_f(crp_list, 2, dims, error) - CALL h5pcreate_f(H5P_DATASET_CREATE_F, crp_list, error) - CALL h5pset_chunk_f(crp_list, 2, dims, error) - - ! Create a dataset using the default LCPL - CALL h5dcreate_f(file_id, "/dataset", H5T_NATIVE_INTEGER, space_id, dset_id, error, crp_list) - CALL check("h5dcreate_f", error, total_error) - - CALL h5dclose_f(dset_id, error) - CALL check("h5dclose_f", error, total_error) - - ! Reopen - - CALL H5Dopen_f(file_id, "/dataset", dset_id, error) - CALL check("h5dopen_f", error, total_error) - - ! Extend the dataset - CALL H5Dset_extent_f(dset_id, extend_dim, error) - CALL check("H5Dset_extent_f", error, total_error) - ! Verify the dataspaces - ! - !Get dataset's dataspace handle. - ! - CALL h5dget_space_f(dset_id, data_space, error) - CALL check("h5dget_space_f",error,total_error) - - CALL h5sget_simple_extent_dims_f(data_space, dimsout, maxdimsout, error) - CALL check("h5sget_simple_extent_dims_f",error, total_error) - - DO i = 1, 2 - tmp1 = INT(dimsout(i)) - tmp2 = INT(extend_dim(i)) - CALL verify("H5Sget_simple_extent_dims", tmp1, tmp2, total_error) - tmp1 = INT(maxdimsout(i)) - tmp2 = INT(dims(i)) - CALL verify("H5Sget_simple_extent_dims", tmp1, tmp2, total_error) - ENDDO - - ! close data set - - CALL h5dclose_f(dset_id, error) - CALL check("h5dclose_f", error, total_error) - - ! Check that its character encoding is the default - CALL H5Lget_info_f(file_id, "dataset", & - cset, corder, f_corder_valid, link_type, address, val_size, & - error) - CALL check("H5Lget_info_f", error, total_error) - -! File-wide default character encoding can not yet be set via the file -! * creation property list and is always ASCII. -!#define H5F_DEFAULT_CSET H5T_CSET_ASCII -- FROM H5Fprivate.h -- - - CALL verify("h5tclose_f",cset, H5T_CSET_ASCII_F,total_error) - - ! Create a link creation property list with the UTF-8 character encoding - CALL H5Pcreate_f(H5P_LINK_CREATE_F,lcpl_id,error) - CALL check("h5Pcreate_f",error,total_error) - CALL H5Pset_char_encoding_f(lcpl_id, H5T_CSET_UTF8_F, error) - CALL check("H5Pset_char_encoding_f",error, total_error) - - ! Create and link a group with the new LCPL - CALL H5Gcreate_f(file_id, "/group2", group_id, error,lcpl_id=lcpl_id) - CALL check("H5Gcreate_f", error, total_error) - CALL H5Gclose_f(group_id, error) - CALL check("H5Gclose_f", error, total_error) - - - ! Check that its character encoding is UTF-8 - CALL H5Lget_info_f(file_id, "group2", & - cset, corder, f_corder_valid, link_type, address, val_size, & - error) - CALL check("H5Lget_info_f", error, total_error) - CALL verify("H5Lget_info_f",cset, H5T_CSET_UTF8_F,total_error) - - - ! Create and commit a datatype with the new LCPL - - CALL h5tcopy_f(H5T_NATIVE_INTEGER, type_id, error) - CALL check("h5tcopy_f",error,total_error) - CALL h5tcommit_f(file_id, "/type2", type_id, error, lcpl_id=lcpl_id) - CALL check("h5tcommit_f", error, total_error) - CALL h5tclose_f(type_id, error) - CALL check("h5tclose_f", error, total_error) - - - ! Check that its character encoding is UTF-8 - CALL H5Lget_info_f(file_id, "type2", & - cset, corder, f_corder_valid, link_type, address, val_size, & - error) - CALL check("H5Lget_info_f", error, total_error) - CALL verify("H5Lget_info_f",cset, H5T_CSET_UTF8_F,total_error) - - ! Create a dataset using the new LCPL - CALL h5dcreate_f(file_id, "/dataset2", H5T_NATIVE_INTEGER, space_id, dset_id, error,lcpl_id=lcpl_id) - CALL check("h5dcreate_f", error, total_error) - - CALL h5dclose_f(dset_id, error) - CALL check("h5dclose_f", error, total_error) - - CALL H5Pget_char_encoding_f(lcpl_id, encoding, error) - CALL check("H5Pget_char_encoding_f", error, total_error) - CALL verify("H5Pget_char_encoding_f", encoding, H5T_CSET_UTF8_F, total_error) - - ! Check that its character encoding is UTF-8 - CALL H5Lget_info_f(file_id, "dataset2", & - cset, corder, f_corder_valid, link_type, address, val_size, & - error) - CALL check("H5Lget_info_f", error, total_error) - CALL verify("H5Lget_info_f2",cset, H5T_CSET_UTF8_F,total_error) - - ! Create a new link to the dataset with a different character encoding. - CALL H5Pclose_f(lcpl_id, error) - CALL check("H5Pclose_f", error, total_error) - - CALL H5Pcreate_f(H5P_LINK_CREATE_F,lcpl_id,error) - CALL check("h5Pcreate_f",error,total_error) - CALL H5Pset_char_encoding_f(lcpl_id, H5T_CSET_ASCII_F, error) - CALL check("H5Pset_char_encoding_f",error, total_error) - CALL H5Lcreate_hard_f(file_id, "/dataset2", file_id, "/dataset2_link", error, lcpl_id) - CALL check("H5Lcreate_hard_f",error, total_error) - - CALL H5Lexists_f(file_id,"/dataset2_link",Lexists, error) - CALL check("H5Lexists",error, total_error) - CALL verify("H5Lexists", Lexists,.TRUE.,total_error) - - ! Check that its character encoding is ASCII - CALL H5Lget_info_f(file_id, "/dataset2_link", & - cset, corder, f_corder_valid, link_type, address, val_size, & - error) - CALL check("H5Lget_info_f", error, total_error) - CALL verify("H5Lget_info_f",cset, H5T_CSET_ASCII_F,total_error) - - ! Check that the first link's encoding hasn't changed - - CALL H5Lget_info_f(file_id, "/dataset2", & - cset, corder, f_corder_valid, link_type, address, val_size, & - error) - CALL check("H5Lget_info_f", error, total_error) - CALL verify("H5Lget_info_f3",cset, H5T_CSET_UTF8_F,total_error) - - - ! Make sure that LCPLs work properly for other API calls: - ! H5Lcreate_soft - - CALL H5Pset_char_encoding_f(lcpl_id, H5T_CSET_UTF8_F, error) - CALL check("H5Pset_char_encoding_f",error, total_error) - CALL H5Lcreate_soft_f("dataset2", file_id, "slink_to_dset2",error,lcpl_id) - CALL check("H5Lcreate_soft_f", error, total_error) - - CALL H5Lget_info_f(file_id, "slink_to_dset2", & - cset, corder, f_corder_valid, link_type, address, val_size, & - error) - CALL check("H5Lget_info_f", error, total_error) - CALL verify("H5Lget_info_f",cset, H5T_CSET_UTF8_F,total_error) - - - ! H5Lmove - CALL H5Pset_char_encoding_f(lcpl_id, H5T_CSET_ASCII_F, error) - CALL check("H5Pset_char_encoding_f",error, total_error) - - CALL H5Lmove_f(file_id, "slink_to_dset2", file_id, "moved_slink", error, lcpl_id, H5P_DEFAULT_F) - CALL check("H5Lmove_f",error, total_error) - - CALL H5Lget_info_f(file_id, "moved_slink", & - cset, corder, f_corder_valid, link_type, address, val_size, & - error) - CALL check("H5Lget_info_f", error, total_error) - CALL verify("H5Lget_info_f",cset, H5T_CSET_ASCII_F,total_error) - - - ! H5Lcopy - - CALL H5Pset_char_encoding_f(lcpl_id, H5T_CSET_UTF8_F, error) - CALL check("H5Pset_char_encoding_f",error, total_error) - - CALL H5Lcopy_f(file_id, "moved_slink", file_id, "copied_slink", error, lcpl_id) - - CALL H5Lget_info_f(file_id, "copied_slink", & - cset, corder, f_corder_valid, link_type, address, val_size, & - error) - CALL check("H5Lget_info_f", error, total_error) - CALL verify("H5Lget_info_f",cset, H5T_CSET_UTF8_F,total_error) - - - ! H5Lcreate_external - - CALL H5Lcreate_external_f("filename", "path", file_id, "extlink", error, lcpl_id) - CALL check("H5Lcreate_external_f", error, total_error) - - CALL H5Lget_info_f(file_id, "extlink", & - cset, corder, f_corder_valid, link_type, address, val_size, & - error) - CALL check("H5Lget_info_f", error, total_error) - CALL verify("H5Lget_info_f",cset, H5T_CSET_UTF8_F,total_error) - - - ! Close open IDs - - CALL H5Pclose_f(lcpl_id, error) - CALL check("H5Pclose_f", error, total_error) - CALL H5Sclose_f(space_id, error) - CALL check("h5Sclose_f",error,total_error) - CALL H5Fclose_f(file_id, error) - CALL check("H5Fclose_f", error, total_error) - - IF(cleanup) CALL h5_cleanup_f("tempfile", H5P_DEFAULT_F, error) - CALL check("h5_cleanup_f", error, total_error) - - -END SUBROUTINE test_lcpl - -SUBROUTINE objcopy(fapl, total_error) - - IMPLICIT NONE - INTEGER, INTENT(INOUT) :: total_error - INTEGER(HID_T), INTENT(IN) :: fapl - - INTEGER(HID_T) :: fapl2, pid - - INTEGER :: flag, cpy_flags - - INTEGER :: error - - flag = H5O_COPY_SHALLOW_HIERARCHY_F - -! Copy the file access property list - CALL H5Pcopy_f(fapl, fapl2, error) - CALL check("H5Pcopy_f", error, total_error) - -! Set the "use the latest version of the format" bounds for creating objects in the file - CALL H5Pset_libver_bounds_f(fapl2, H5F_LIBVER_LATEST_F, H5F_LIBVER_LATEST_F, error) - - ! create property to pass copy options - CALL h5pcreate_f(H5P_OBJECT_COPY_F, pid, error) - CALL check("h5pcreate_f",error, total_error) - - ! set options for object copy - CALL H5Pset_copy_object_f(pid, flag, error) - CALL check("H5Pset_copy_object_f",error, total_error) - - ! Verify object copy flags - CALL H5Pget_copy_object_f(pid, cpy_flags, error) - CALL check("H5Pget_copy_object_f",error, total_error) - CALL verify("H5Pget_copy_object_f", cpy_flags, flag, total_error) - -!!$ -!!$ CALL test_copy_option(fcpl_src, fcpl_dst, my_fapl, H5O_COPY_WITHOUT_ATTR_FLAG, -!!$ FALSE, "H5Ocopy(): without attributes"); - - CALL lapl_nlinks(fapl2, total_error) - -END SUBROUTINE objcopy - - -!------------------------------------------------------------------------- -! * Function: lapl_nlinks -! * -! * Purpose: Check that the maximum number of soft links can be adjusted -! * by the user using the Link Access Property List. -! * -! * Return: Success: 0 -! * -! * Failure: -1 -! * -! * Programmer: James Laird -! * Tuesday, June 6, 2006 -! * -! * Modifications: -! * -! *------------------------------------------------------------------------- -! - -SUBROUTINE lapl_nlinks( fapl, total_error) - - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: fapl - INTEGER, INTENT(INOUT) :: total_error - - INTEGER :: error - - INTEGER(HID_T) :: fid = (-1) ! File ID - INTEGER(HID_T) :: gid = (-1), gid2 = (-1) ! Group IDs - INTEGER(HID_T) :: plist = (-1) ! lapl ID - INTEGER(HID_T) :: tid = (-1) ! Other IDs - INTEGER(HID_T) :: gapl = (-1), dapl = (-1), tapl = (-1) ! Other property lists - - CHARACTER(LEN=7) :: objname ! Object name - INTEGER(size_t) :: name_len ! Length of object name - CHARACTER(LEN=12) :: filename = 'TestLinks.h5' - INTEGER(size_t) :: nlinks ! nlinks for H5Pset_nlinks - INTEGER(size_t) :: buf_size = 7 - -! WRITE(*,*) "adjusting nlinks with LAPL (w/new group format)" - - - ! Create file - CALL h5fcreate_f(FileName, H5F_ACC_TRUNC_F, fid, error, access_prp=fapl) - CALL check(" lapl_nlinks.h5fcreate_f",error,total_error) - - ! Create group with short name in file (used as target for links) - CALL H5Gcreate_f(fid, "final", gid, error) - CALL check(" lapl_nlinks.H5Gcreate_f", error, total_error) - - ! Create chain of soft links to existing object (limited) - CALL H5Lcreate_soft_f("final", fid, "soft1", error) - CALL H5Lcreate_soft_f("soft1", fid, "soft2", error) - CALL H5Lcreate_soft_f("soft2", fid, "soft3", error) - CALL H5Lcreate_soft_f("soft3", fid, "soft4", error) - CALL H5Lcreate_soft_f("soft4", fid, "soft5", error) - CALL H5Lcreate_soft_f("soft5", fid, "soft6", error) - CALL H5Lcreate_soft_f("soft6", fid, "soft7", error) - CALL H5Lcreate_soft_f("soft7", fid, "soft8", error) - CALL H5Lcreate_soft_f("soft8", fid, "soft9", error) - CALL H5Lcreate_soft_f("soft9", fid, "soft10", error) - CALL H5Lcreate_soft_f("soft10", fid, "soft11", error) - CALL H5Lcreate_soft_f("soft11", fid, "soft12", error) - CALL H5Lcreate_soft_f("soft12", fid, "soft13", error) - CALL H5Lcreate_soft_f("soft13", fid, "soft14", error) - CALL H5Lcreate_soft_f("soft14", fid, "soft15", error) - CALL H5Lcreate_soft_f("soft15", fid, "soft16", error) - CALL H5Lcreate_soft_f("soft16", fid, "soft17", error) - - ! Close objects - CALL H5Gclose_f(gid, error) - CALL check("h5gclose_f",error,total_error) - CALL h5fclose_f(fid, error) - CALL check("h5fclose_f",error,total_error) - - ! Open file - - CALL h5fopen_f(FileName, H5F_ACC_RDWR_F, fid, error, fapl) - CALL check("h5open_f",error,total_error) - - ! Create LAPL with higher-than-usual nlinks value - ! Create a non-default lapl with udata set to point to the first group - - CALL H5Pcreate_f(H5P_LINK_ACCESS_F,plist,error) - CALL check("h5Pcreate_f",error,total_error) - nlinks = 20 - CALL H5Pset_nlinks_f(plist, nlinks, error) - CALL check("H5Pset_nlinks_f",error,total_error) - ! Ensure that nlinks was set successfully - nlinks = 0 - CALL H5Pget_nlinks_f(plist, nlinks, error) - CALL check("H5Pset_nlinks_f",error,total_error) - CALL verify("H5Pset_nlinks_f",INT(nlinks), 20, total_error) - - - ! Open object through what is normally too many soft links using - ! * new property list - - CALL H5Oopen_f(fid,"soft17",gid,error,plist) - CALL check("H5Oopen_f",error,total_error) - - ! Check name - CALL h5iget_name_f(gid, objname, buf_size, name_len, error) - CALL check("h5iget_name_f",error,total_error) - CALL verify("h5iget_name_f", TRIM(objname),"/soft17", total_error) - ! Create group using soft link - CALL H5Gcreate_f(gid, "new_soft", gid2, error) - CALL check("H5Gcreate_f", error, total_error) - - ! Close groups - CALL H5Gclose_f(gid2, error) - CALL check("H5Gclose_f", error, total_error) - CALL H5Gclose_f(gid, error) - CALL check("H5Gclose_f", error, total_error) - - - ! Set nlinks to a smaller number - nlinks = 4 - CALL H5Pset_nlinks_f(plist, nlinks, error) - CALL check("H5Pset_nlinks_f", error, total_error) - - ! Ensure that nlinks was set successfully - nlinks = 0 - - CALL H5Pget_nlinks_f(plist, nlinks, error) - CALL check("H5Pget_nlinks_f",error,total_error) - CALL verify("H5Pget_nlinks_f", INT(nlinks), 4, total_error) - - ! Try opening through what is now too many soft links - - CALL H5Oopen_f(fid,"soft5",gid,error,plist) - CALL verify("H5Oopen_f", error, -1, total_error) ! should fail - - ! Open object through lesser soft link - CALL H5Oopen_f(fid,"soft4",gid,error,plist) - CALL check("H5Oopen_",error,total_error) - - ! Check name - CALL h5iget_name_f(gid, objname, buf_size, name_len, error) - CALL check("h5iget_name_f",error,total_error) - CALL verify("h5iget_name_f", TRIM(objname),"/soft4", total_error) - - ! Test other functions that should use a LAPL - nlinks = 20 - CALL H5Pset_nlinks_f(plist, nlinks, error) - CALL check("H5Pset_nlinks_f", error, total_error) - - ! Try copying and moving when both src and dst contain many soft links - ! * using a non-default LAPL - ! - CALL H5Lcopy_f(fid, "soft17", fid, "soft17/newer_soft", error, H5P_DEFAULT_F, plist) - CALL check("H5Lcopy_f",error,total_error) - - CALL H5Lmove_f(fid, "soft17/newer_soft", fid, "soft17/newest_soft", error, lapl_id=plist) - CALL check("H5Lmove_f",error, total_error) - - ! H5Olink - CALL H5Olink_f(gid, fid, "soft17/link_to_group", error, H5P_DEFAULT_F, plist) - CALL check("H5Olink_f", error, total_error) - - ! H5Lcreate_hard and H5Lcreate_soft - CALL H5Lcreate_hard_f(fid, "soft17", fid, "soft17/link2_to_group", error, H5P_DEFAULT_F, plist) - CALL check("H5Lcreate_hard_f", error, total_error) - - - CALL H5Lcreate_soft_f("/soft4", fid, "soft17/soft_link",error, H5P_DEFAULT_F, plist) - CALL check("H5Lcreate_soft_f", error, total_error) - - ! H5Ldelete - CALL h5ldelete_f(fid, "soft17/soft_link", error, plist) - CALL check("H5Ldelete_f", error, total_error) - -!!$ H5Lget_val and H5Lget_info -!!$ if(H5Lget_val(fid, "soft17", NULL, (size_t)0, plist) < 0) TEST_ERROR -!!$ if(H5Lget_info(fid, "soft17", NULL, plist) < 0) TEST_ERROR -!!$ - - ! H5Lcreate_external and H5Lcreate_ud - CALL H5Lcreate_external_f("filename", "path", fid, "soft17/extlink", error, H5P_DEFAULT_F, plist) - CALL check("H5Lcreate_external_f", error, total_error) - -!!$ if(H5Lregister(UD_rereg_class) < 0) TEST_ERROR -!!$ if(H5Lcreate_ud(fid, "soft17/udlink", UD_HARD_TYPE, NULL, (size_t)0, H5P_DEFAULT, plist) < 0) TEST_ERROR -!!$ - ! Close plist - CALL h5pclose_f(plist, error) - CALL check("h5pclose_f", error, total_error) - - ! Create a datatype and dataset as targets inside the group - CALL h5tcopy_f(H5T_NATIVE_INTEGER, tid, error) - CALL check("h5tcopy_f",error,total_error) - CALL h5tcommit_f(gid, "datatype", tid, error) - CALL check("h5tcommit_f", error, total_error) - CALL h5tclose_f(tid, error) - CALL check("h5tclose_f", error, total_error) - -!!$ -!!$ dims[0] = 2; -!!$ dims[1] = 2; -!!$ if((sid = H5Screate_simple(2, dims, NULL)) < 0) TEST_ERROR -!!$ if((did = H5Dcreate2(gid, "dataset", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR -!!$ if(H5Dclose(did) < 0) TEST_ERROR -!!$ - ! Close group - CALL h5gclose_f(gid, error) - CALL check("h5gclose_f",error,total_error) - -!!$ -!!$ Try to open the objects using too many symlinks with default *APLs -!!$ H5E_BEGIN_TRY { -!!$ if((gid = H5Gopen2(fid, "soft17", H5P_DEFAULT)) >= 0) -!!$ FAIL_PUTS_ERROR(" Should have failed for too many nested links.") -!!$ if((tid = H5Topen2(fid, "soft17/datatype", H5P_DEFAULT)) >= 0) -!!$ FAIL_PUTS_ERROR(" Should have failed for too many nested links.") -!!$ if((did = H5Dopen2(fid, "soft17/dataset", H5P_DEFAULT)) >= 0) -!!$ FAIL_PUTS_ERROR(" Should have failed for too many nested links.") -!!$ } H5E_END_TRY -!!$ - ! Create property lists with nlinks set - - CALL H5Pcreate_f(H5P_GROUP_ACCESS_F,gapl,error) - CALL check("h5Pcreate_f",error,total_error) - CALL H5Pcreate_f(H5P_DATATYPE_ACCESS_F,tapl,error) - CALL check("h5Pcreate_f",error,total_error) - CALL H5Pcreate_f(H5P_DATASET_ACCESS_F,dapl,error) - CALL check("h5Pcreate_f",error,total_error) - - - nlinks = 20 - CALL H5Pset_nlinks_f(gapl, nlinks, error) - CALL check("H5Pset_nlinks_f", error, total_error) - CALL H5Pset_nlinks_f(tapl, nlinks, error) - CALL check("H5Pset_nlinks_f", error, total_error) - CALL H5Pset_nlinks_f(dapl, nlinks, error) - CALL check("H5Pset_nlinks_f", error, total_error) - - ! We should now be able to use these property lists to open each kind - ! * of object. - ! - - CALL H5Gopen_f(fid, "soft17", gid, error, gapl) - CALL check("H5Gopen_f",error,total_error) - - CALL H5Topen_f(fid, "soft17/datatype", tid, error, tapl) - CALL check("H5Gopen_f",error,total_error) - -!!$ if((did = H5Dopen2(fid, "soft17/dataset", dapl)) < 0) TEST_ERROR - - ! Close objects - - CALL h5gclose_f(gid, error) - CALL check("h5gclose_f",error,total_error) - CALL h5tclose_f(tid, error) - CALL check("h5tclose_f", error, total_error) - -!!$ if(H5Dclose(did) < 0) TEST_ERROR -!!$ - ! Close plists - - CALL h5pclose_f(gapl, error) - CALL check("h5pclose_f", error, total_error) - CALL h5pclose_f(tapl, error) - CALL check("h5pclose_f", error, total_error) - -!!$ if(H5Pclose(dapl) < 0) TEST_ERROR -!!$ -!!$ Unregister UD hard link class -!!$ if(H5Lunregister(UD_HARD_TYPE) < 0) TEST_ERROR -!!$ - - ! Close file - CALL H5Fclose_f(fid, error) - CALL check("H5Fclose_f", error, total_error) - -END SUBROUTINE lapl_nlinks - -END MODULE TH5G_1_8 diff --git a/fortran/test/tH5I.F90 b/fortran/test/tH5I.F90 new file mode 100644 index 0000000..97c48c6 --- /dev/null +++ b/fortran/test/tH5I.F90 @@ -0,0 +1,321 @@ +!****h* root/fortran/test/tH5I.f90 +! +! NAME +! tH5I.f90 +! +! FUNCTION +! Basic testing of Fortran H5I 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. * +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! +! CONTAINS SUBROUTINES +! identifier_test +! +!***** +MODULE TH5I + + USE HDF5 ! This module contains all necessary modules + USE TH5_MISC + USE TH5_MISC_GEN + +CONTAINS + + SUBROUTINE identifier_test(cleanup, total_error) + +! This subroutine tests following functionalities: h5iget_type_f + + + IMPLICIT NONE + LOGICAL, INTENT(IN) :: cleanup + INTEGER, INTENT(INOUT) :: total_error + + CHARACTER(LEN=6), PARAMETER :: filename = "itestf" ! File name + CHARACTER(LEN=80) :: fix_filename + CHARACTER(LEN=10), PARAMETER :: dsetname = "/itestdset" ! Dataset name + CHARACTER(LEN=10), PARAMETER :: groupname = "itestgroup"! group name + CHARACTER(LEN=10), PARAMETER :: aname = "itestattr"! group name + + + + INTEGER(HID_T) :: file_id ! File identifier + INTEGER(HID_T) :: new_file_id ! File identifier + INTEGER(HID_T) :: group_id ! group identifier + INTEGER(HID_T) :: dset_id ! Dataset identifier + INTEGER(HID_T) :: dspace_id ! Dataspace identifier + INTEGER(HID_T) :: attr_id ! Datatype attribute identifier + INTEGER(HID_T) :: aspace_id ! attribute data space identifier + INTEGER(HID_T) :: atype_id ! attribute data type identifier + + + INTEGER, DIMENSION(1) :: dset_data = 0 ! Data value + + INTEGER(HSIZE_T), DIMENSION(1) :: dims = 1 ! Datasets dimensions + INTEGER(HSIZE_T), DIMENSION(1) :: adims = 1 ! Attribute dimensions + + INTEGER, DIMENSION(1) :: attr_data = 12 + INTEGER :: rank = 1 ! Datasets rank + INTEGER :: arank = 1 ! Attribute rank + + INTEGER :: type !object identifier + INTEGER :: error ! Error flag + INTEGER(HSIZE_T), DIMENSION(2) :: data_dims + CHARACTER(LEN=80) name_buf + CHARACTER(LEN=280) name_buf1 + INTEGER(SIZE_T) buf_size + INTEGER(SIZE_T) name_size + INTEGER :: ref_count ! Reference count for IDs + + + INTEGER(hid_t) :: dtype ! datatype id + LOGICAL :: tri_ret ! value + + ! + ! Tests the function H5Iis_valid_f + ! + ! check that the ID is not valid + dtype = -1 + CALL H5Iis_valid_f(dtype, tri_ret, error) + CALL check("H5Iis_valid_f", error, total_error) + CALL verify("H5Iis_valid_f", tri_ret, .FALSE., total_error) + + ! Create a datatype id + CALL H5Tcopy_f(H5T_NATIVE_INTEGER,dtype,error) + CALL check("H5Tcopy_f", error, total_error) + + ! Check that the ID is valid + CALL H5Iis_valid_f(dtype, tri_ret, error) + CALL check("H5Iis_valid_f", error, total_error) + CALL verify("H5Tequal_f", tri_ret, .TRUE., total_error) + + CALL H5Tclose_f(dtype, error) + CALL check("H5Tclose_f", error, total_error) + + ! + ! Create a new file using default properties. + ! + CALL h5_fixname_f(filename, fix_filename, H5P_DEFAULT_F, error) + if (error .ne. 0) then + write(*,*) "Cannot modify filename" + stop + endif + CALL h5fcreate_f(fix_filename, H5F_ACC_TRUNC_F, file_id, error) + CALL check("h5fcreate_f",error,total_error) + + ! + ! Create a group named "/MyGroup" in the file. + ! + CALL h5gcreate_f(file_id, groupname, group_id, error) + CALL check("h5gcreate_f",error,total_error) + + ! + !Create data space for the dataset. + ! + CALL h5screate_simple_f(rank, dims, dspace_id, error) + CALL check("h5screate_simple_f",error,total_error) + + ! + ! create dataset in the file. + ! + CALL h5dcreate_f(file_id, dsetname, H5T_NATIVE_INTEGER, dspace_id, & + dset_id, error) + CALL check("h5dcreate_f",error,total_error) + ! + ! Get dataset name from dataset identifier + ! + buf_size = 80 + CALL h5iget_name_f(dset_id, name_buf, buf_size, name_size, error) + CALL check("h5iget_name_f",error,total_error) + if (name_size .ne. len(dsetname)) then + write(*,*) "h5iget_name returned wrong name size" + total_error = total_error + 1 + else + if (name_buf(1:name_size) .ne. dsetname) then + write(*,*) "h5iget_name returned wrong name" + total_error = total_error + 1 + endif + endif + + ! + ! Get file identifier from dataset identifier and then get file name + ! + CALL h5iget_file_id_f(dset_id, new_file_id, error) + CALL check("h5iget_file_id_f",error,total_error) + name_size = 280 + CALL h5fget_name_f(new_file_id, name_buf1, name_size, error) + CALL check("h5fget_name_f",error,total_error) + if (name_buf1(1:name_size) .ne. fix_filename(1:name_size)) then + write(*,*) "h5fget_name returned wrong file name" + total_error = total_error + 1 + endif + + ! + ! Write data_in to the dataset + ! + data_dims(1) = 1 + CALL h5dwrite_f(dset_id, H5T_NATIVE_INTEGER, dset_data, data_dims, error) + CALL check("h5dwrite_f",error,total_error) + + ! + ! Create scalar data space for dataset attribute. + ! + CALL h5screate_simple_f(arank, adims, aspace_id, error) + CALL check("h5screate_simple_f",error,total_error) + + ! + ! Create datatype for the Integer attribute. + ! + CALL h5tcopy_f(H5T_NATIVE_INTEGER, atype_id, error) + CALL check("h5tcopy_f",error,total_error) + + ! + ! Create dataset INTEGER attribute. + ! + CALL h5acreate_f(dset_id, aname, atype_id, aspace_id, attr_id, error) + CALL check("h5acreate_f",error,total_error) + + ! + ! Write the Integer attribute data. + ! + CALL h5awrite_f(attr_id, atype_id, attr_data, data_dims, error) + CALL check("h5awrite_f",error,total_error) + + ! + !Get the file identifier + ! + CALL h5iget_type_f(file_id, type, error) + CALL check("h5iget_type_f",error,total_error) + CALL verify("get file identifier wrong",type,H5I_FILE_F,total_error) + + ! + !Get the group identifier + ! + CALL h5iget_type_f(group_id, type, error) + CALL check("h5iget_type_f",error,total_error) + CALL verify("get group identifier wrong",type,H5I_GROUP_F,total_error) + + ! + !Get the datatype identifier + ! + CALL h5iget_type_f(atype_id, type, error) + CALL check("h5iget_type_f",error,total_error) + CALL verify("get datatype identifier wrong",type,H5I_DATATYPE_F,total_error) + + ! + !Get the dataspace identifier + ! + CALL h5iget_type_f(aspace_id, type, error) + CALL check("h5iget_type_f",error,total_error) + CALL verify("get dataspace identifier wrong",type,H5I_DATASPACE_F,total_error) + + ! + !Get the dataset identifier + ! + CALL h5iget_type_f(dset_id, type, error) + CALL check("h5iget_type_f",error,total_error) + CALL verify("get dataset identifier wrong",type,H5I_DATASET_F,total_error) + + ! + !Get the attribute identifier + ! + CALL h5iget_type_f(attr_id, type, error) + CALL check("h5iget_type_f",error,total_error) + CALL verify("get attribute identifier wrong",type,H5I_ATTR_F,total_error) + + ! + ! Close the attribute. + ! + CALL h5aclose_f(attr_id, error) + CALL check("h5aclose_f",error,total_error) + ! + ! Close the dataspace. + ! + CALL h5sclose_f(aspace_id, error) + CALL check("h5sclose_f",error,total_error) + CALL h5sclose_f(dspace_id, error) + CALL check("h5sclose_f",error,total_error) + ! + ! Close the dataype. + ! + CALL h5tclose_f(atype_id, error) + CALL check("h5tclose_f",error,total_error) + + ! + ! Close the dataset. + ! + CALL h5dclose_f(dset_id, error) + CALL check("h5dclose_f",error,total_error) + + ! + ! Close the group. + ! + CALL h5gclose_f(group_id, error) + CALL check("h5gclose_f",error,total_error) + + ! + ! Close the file. + ! + CALL h5fclose_f(file_id, error) + CALL check("h5fclose_f",error,total_error) + CALL h5fclose_f(new_file_id, error) + CALL check("h5fclose_f",error,total_error) + + ! + ! Basic Test of increment/decrement ID functions + ! + + ! Create a file + CALL h5fcreate_f(fix_filename, H5F_ACC_TRUNC_F, file_id, error) + CALL check("h5fcreate_f",error,total_error) + + ! Get the reference count for the file ID + CALL h5iget_ref_f(file_id, ref_count, error) + CALL check("h5iget_ref_f",error,total_error) + CALL verify("get file ref count wrong",ref_count,1,total_error) + + ! Increment the reference count for the file ID + CALL h5iinc_ref_f(file_id, ref_count, error) + CALL check("h5iinc_ref_f",error,total_error) + CALL verify("get file ref count wrong",ref_count,2,total_error) + + ! Close the file normally. + CALL h5fclose_f(file_id, error) + CALL check("h5fclose_f",error,total_error) + + ! Get the reference count for the file ID + CALL h5iget_ref_f(file_id, ref_count, error) + CALL check("h5iget_ref_f",error,total_error) + CALL verify("get file ref count wrong",ref_count,1,total_error) + + ! Close the file by decrementing the reference count + CALL h5idec_ref_f(file_id, ref_count, error) + CALL check("h5idec_ref_f",error,total_error) + CALL verify("get file ref count wrong",ref_count,0,total_error) + ! Try closing the file again (should fail) + CALL h5eset_auto_f(0, error) + CALL h5fclose_f(file_id, error) + CALL verify("file close should fail",error,-1,total_error) + ! Clear the error stack from the file close failure + CALL h5eset_auto_f(1, error) + CALL h5eclear_f(error) + + if(cleanup) CALL h5_cleanup_f(filename, H5P_DEFAULT_F, error) + CALL check("h5_cleanup_f", error, total_error) + + RETURN + END SUBROUTINE identifier_test + +END MODULE TH5I diff --git a/fortran/test/tH5I.f90 b/fortran/test/tH5I.f90 deleted file mode 100644 index 97c48c6..0000000 --- a/fortran/test/tH5I.f90 +++ /dev/null @@ -1,321 +0,0 @@ -!****h* root/fortran/test/tH5I.f90 -! -! NAME -! tH5I.f90 -! -! FUNCTION -! Basic testing of Fortran H5I 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. * -! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -! -! CONTAINS SUBROUTINES -! identifier_test -! -!***** -MODULE TH5I - - USE HDF5 ! This module contains all necessary modules - USE TH5_MISC - USE TH5_MISC_GEN - -CONTAINS - - SUBROUTINE identifier_test(cleanup, total_error) - -! This subroutine tests following functionalities: h5iget_type_f - - - IMPLICIT NONE - LOGICAL, INTENT(IN) :: cleanup - INTEGER, INTENT(INOUT) :: total_error - - CHARACTER(LEN=6), PARAMETER :: filename = "itestf" ! File name - CHARACTER(LEN=80) :: fix_filename - CHARACTER(LEN=10), PARAMETER :: dsetname = "/itestdset" ! Dataset name - CHARACTER(LEN=10), PARAMETER :: groupname = "itestgroup"! group name - CHARACTER(LEN=10), PARAMETER :: aname = "itestattr"! group name - - - - INTEGER(HID_T) :: file_id ! File identifier - INTEGER(HID_T) :: new_file_id ! File identifier - INTEGER(HID_T) :: group_id ! group identifier - INTEGER(HID_T) :: dset_id ! Dataset identifier - INTEGER(HID_T) :: dspace_id ! Dataspace identifier - INTEGER(HID_T) :: attr_id ! Datatype attribute identifier - INTEGER(HID_T) :: aspace_id ! attribute data space identifier - INTEGER(HID_T) :: atype_id ! attribute data type identifier - - - INTEGER, DIMENSION(1) :: dset_data = 0 ! Data value - - INTEGER(HSIZE_T), DIMENSION(1) :: dims = 1 ! Datasets dimensions - INTEGER(HSIZE_T), DIMENSION(1) :: adims = 1 ! Attribute dimensions - - INTEGER, DIMENSION(1) :: attr_data = 12 - INTEGER :: rank = 1 ! Datasets rank - INTEGER :: arank = 1 ! Attribute rank - - INTEGER :: type !object identifier - INTEGER :: error ! Error flag - INTEGER(HSIZE_T), DIMENSION(2) :: data_dims - CHARACTER(LEN=80) name_buf - CHARACTER(LEN=280) name_buf1 - INTEGER(SIZE_T) buf_size - INTEGER(SIZE_T) name_size - INTEGER :: ref_count ! Reference count for IDs - - - INTEGER(hid_t) :: dtype ! datatype id - LOGICAL :: tri_ret ! value - - ! - ! Tests the function H5Iis_valid_f - ! - ! check that the ID is not valid - dtype = -1 - CALL H5Iis_valid_f(dtype, tri_ret, error) - CALL check("H5Iis_valid_f", error, total_error) - CALL verify("H5Iis_valid_f", tri_ret, .FALSE., total_error) - - ! Create a datatype id - CALL H5Tcopy_f(H5T_NATIVE_INTEGER,dtype,error) - CALL check("H5Tcopy_f", error, total_error) - - ! Check that the ID is valid - CALL H5Iis_valid_f(dtype, tri_ret, error) - CALL check("H5Iis_valid_f", error, total_error) - CALL verify("H5Tequal_f", tri_ret, .TRUE., total_error) - - CALL H5Tclose_f(dtype, error) - CALL check("H5Tclose_f", error, total_error) - - ! - ! Create a new file using default properties. - ! - CALL h5_fixname_f(filename, fix_filename, H5P_DEFAULT_F, error) - if (error .ne. 0) then - write(*,*) "Cannot modify filename" - stop - endif - CALL h5fcreate_f(fix_filename, H5F_ACC_TRUNC_F, file_id, error) - CALL check("h5fcreate_f",error,total_error) - - ! - ! Create a group named "/MyGroup" in the file. - ! - CALL h5gcreate_f(file_id, groupname, group_id, error) - CALL check("h5gcreate_f",error,total_error) - - ! - !Create data space for the dataset. - ! - CALL h5screate_simple_f(rank, dims, dspace_id, error) - CALL check("h5screate_simple_f",error,total_error) - - ! - ! create dataset in the file. - ! - CALL h5dcreate_f(file_id, dsetname, H5T_NATIVE_INTEGER, dspace_id, & - dset_id, error) - CALL check("h5dcreate_f",error,total_error) - ! - ! Get dataset name from dataset identifier - ! - buf_size = 80 - CALL h5iget_name_f(dset_id, name_buf, buf_size, name_size, error) - CALL check("h5iget_name_f",error,total_error) - if (name_size .ne. len(dsetname)) then - write(*,*) "h5iget_name returned wrong name size" - total_error = total_error + 1 - else - if (name_buf(1:name_size) .ne. dsetname) then - write(*,*) "h5iget_name returned wrong name" - total_error = total_error + 1 - endif - endif - - ! - ! Get file identifier from dataset identifier and then get file name - ! - CALL h5iget_file_id_f(dset_id, new_file_id, error) - CALL check("h5iget_file_id_f",error,total_error) - name_size = 280 - CALL h5fget_name_f(new_file_id, name_buf1, name_size, error) - CALL check("h5fget_name_f",error,total_error) - if (name_buf1(1:name_size) .ne. fix_filename(1:name_size)) then - write(*,*) "h5fget_name returned wrong file name" - total_error = total_error + 1 - endif - - ! - ! Write data_in to the dataset - ! - data_dims(1) = 1 - CALL h5dwrite_f(dset_id, H5T_NATIVE_INTEGER, dset_data, data_dims, error) - CALL check("h5dwrite_f",error,total_error) - - ! - ! Create scalar data space for dataset attribute. - ! - CALL h5screate_simple_f(arank, adims, aspace_id, error) - CALL check("h5screate_simple_f",error,total_error) - - ! - ! Create datatype for the Integer attribute. - ! - CALL h5tcopy_f(H5T_NATIVE_INTEGER, atype_id, error) - CALL check("h5tcopy_f",error,total_error) - - ! - ! Create dataset INTEGER attribute. - ! - CALL h5acreate_f(dset_id, aname, atype_id, aspace_id, attr_id, error) - CALL check("h5acreate_f",error,total_error) - - ! - ! Write the Integer attribute data. - ! - CALL h5awrite_f(attr_id, atype_id, attr_data, data_dims, error) - CALL check("h5awrite_f",error,total_error) - - ! - !Get the file identifier - ! - CALL h5iget_type_f(file_id, type, error) - CALL check("h5iget_type_f",error,total_error) - CALL verify("get file identifier wrong",type,H5I_FILE_F,total_error) - - ! - !Get the group identifier - ! - CALL h5iget_type_f(group_id, type, error) - CALL check("h5iget_type_f",error,total_error) - CALL verify("get group identifier wrong",type,H5I_GROUP_F,total_error) - - ! - !Get the datatype identifier - ! - CALL h5iget_type_f(atype_id, type, error) - CALL check("h5iget_type_f",error,total_error) - CALL verify("get datatype identifier wrong",type,H5I_DATATYPE_F,total_error) - - ! - !Get the dataspace identifier - ! - CALL h5iget_type_f(aspace_id, type, error) - CALL check("h5iget_type_f",error,total_error) - CALL verify("get dataspace identifier wrong",type,H5I_DATASPACE_F,total_error) - - ! - !Get the dataset identifier - ! - CALL h5iget_type_f(dset_id, type, error) - CALL check("h5iget_type_f",error,total_error) - CALL verify("get dataset identifier wrong",type,H5I_DATASET_F,total_error) - - ! - !Get the attribute identifier - ! - CALL h5iget_type_f(attr_id, type, error) - CALL check("h5iget_type_f",error,total_error) - CALL verify("get attribute identifier wrong",type,H5I_ATTR_F,total_error) - - ! - ! Close the attribute. - ! - CALL h5aclose_f(attr_id, error) - CALL check("h5aclose_f",error,total_error) - ! - ! Close the dataspace. - ! - CALL h5sclose_f(aspace_id, error) - CALL check("h5sclose_f",error,total_error) - CALL h5sclose_f(dspace_id, error) - CALL check("h5sclose_f",error,total_error) - ! - ! Close the dataype. - ! - CALL h5tclose_f(atype_id, error) - CALL check("h5tclose_f",error,total_error) - - ! - ! Close the dataset. - ! - CALL h5dclose_f(dset_id, error) - CALL check("h5dclose_f",error,total_error) - - ! - ! Close the group. - ! - CALL h5gclose_f(group_id, error) - CALL check("h5gclose_f",error,total_error) - - ! - ! Close the file. - ! - CALL h5fclose_f(file_id, error) - CALL check("h5fclose_f",error,total_error) - CALL h5fclose_f(new_file_id, error) - CALL check("h5fclose_f",error,total_error) - - ! - ! Basic Test of increment/decrement ID functions - ! - - ! Create a file - CALL h5fcreate_f(fix_filename, H5F_ACC_TRUNC_F, file_id, error) - CALL check("h5fcreate_f",error,total_error) - - ! Get the reference count for the file ID - CALL h5iget_ref_f(file_id, ref_count, error) - CALL check("h5iget_ref_f",error,total_error) - CALL verify("get file ref count wrong",ref_count,1,total_error) - - ! Increment the reference count for the file ID - CALL h5iinc_ref_f(file_id, ref_count, error) - CALL check("h5iinc_ref_f",error,total_error) - CALL verify("get file ref count wrong",ref_count,2,total_error) - - ! Close the file normally. - CALL h5fclose_f(file_id, error) - CALL check("h5fclose_f",error,total_error) - - ! Get the reference count for the file ID - CALL h5iget_ref_f(file_id, ref_count, error) - CALL check("h5iget_ref_f",error,total_error) - CALL verify("get file ref count wrong",ref_count,1,total_error) - - ! Close the file by decrementing the reference count - CALL h5idec_ref_f(file_id, ref_count, error) - CALL check("h5idec_ref_f",error,total_error) - CALL verify("get file ref count wrong",ref_count,0,total_error) - ! Try closing the file again (should fail) - CALL h5eset_auto_f(0, error) - CALL h5fclose_f(file_id, error) - CALL verify("file close should fail",error,-1,total_error) - ! Clear the error stack from the file close failure - CALL h5eset_auto_f(1, error) - CALL h5eclear_f(error) - - if(cleanup) CALL h5_cleanup_f(filename, H5P_DEFAULT_F, error) - CALL check("h5_cleanup_f", error, total_error) - - RETURN - END SUBROUTINE identifier_test - -END MODULE TH5I diff --git a/fortran/test/tH5L_F03.F90 b/fortran/test/tH5L_F03.F90 new file mode 100644 index 0000000..40afdbc --- /dev/null +++ b/fortran/test/tH5L_F03.F90 @@ -0,0 +1,318 @@ +!****h* root/fortran/test/tH5L_F03.f90 +! +! NAME +! tH5L_F03.f90 +! +! FUNCTION +! Test FORTRAN HDF5 H5L APIs which are dependent on FORTRAN 2003 +! features. +! +! 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. * +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! +! USES +! liter_cb_mod +! +! CONTAINS SUBROUTINES +! test_iter_group +! +!***** +MODULE liter_cb_mod + + USE HDF5 + USE TH5_MISC + USE TH5_MISC_GEN + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + + TYPE iter_enum + INTEGER RET_ZERO + INTEGER RET_TWO + INTEGER RET_CHANGE + INTEGER RET_CHANGE2 + END TYPE iter_enum + + ! Custom group iteration callback data + TYPE, bind(c) :: iter_info + CHARACTER(KIND=C_CHAR), DIMENSION(1:10) :: name ! The name of the object + INTEGER(c_int) :: TYPE ! The TYPE of the object + INTEGER(c_int) :: command ! The TYPE of RETURN value + END TYPE iter_info + +CONTAINS + +!*************************************************************** +!** +!** liter_cb(): Custom link iteration callback routine. +!** +!*************************************************************** + + INTEGER(KIND=C_INT) FUNCTION liter_cb(group, name, link_info, op_data) bind(C) + + IMPLICIT NONE + + INTEGER(HID_T), VALUE :: group + CHARACTER(LEN=1), DIMENSION(1:10) :: name + + + TYPE (H5L_info_t) :: link_info + + TYPE(iter_info) :: op_data + + INTEGER, SAVE :: count + INTEGER, SAVE :: count2 + +!!$ +!!$ iter_info *info = (iter_info *)op_data; +!!$ static int count = 0; +!!$ static int count2 = 0; + + op_data%name(1:10) = name(1:10) + + SELECT CASE (op_data%command) + + CASE(0) + liter_cb = 0 + CASE(2) + liter_cb = 2 + CASE(3) + count = count + 1 + IF(count.GT.10) THEN + liter_cb = 1 + ELSE + liter_cb = 0 + ENDIF + CASE(4) + count2 = count2 + 1 + IF(count2.GT.10) THEN + liter_cb = 1 + ELSE + liter_cb = 0 + ENDIF + END SELECT + + END FUNCTION liter_cb +END MODULE liter_cb_mod + +MODULE TH5L_F03 + +CONTAINS + +! ***************************************** +! *** H 5 L T E S T S +! ***************************************** + + +!*************************************************************** +!** +!** test_iter_group(): Test group iteration functionality +!** +!*************************************************************** +SUBROUTINE test_iter_group(total_error) + + USE liter_cb_mod + IMPLICIT NONE + + INTEGER, INTENT(INOUT) :: total_error + INTEGER(HID_T) :: fapl + INTEGER(HID_T) :: file ! File ID + INTEGER(hid_t) :: dataset ! Dataset ID + INTEGER(hid_t) :: datatype ! Common datatype ID + INTEGER(hid_t) :: filespace ! Common dataspace ID + INTEGER(hid_t) :: grp ! Group ID + INTEGER i,j ! counting variable + INTEGER(hsize_t) idx ! Index in the group + CHARACTER(LEN=11) :: DATAFILE = "titerate.h5" + INTEGER, PARAMETER :: ndatasets = 50 + CHARACTER(LEN=10) :: name ! temporary name buffer + CHARACTER(LEN=10), DIMENSION(1:ndatasets+2) :: lnames ! Names of the links created + + TYPE(iter_info), TARGET :: info + + INTEGER :: error + INTEGER :: ret_value + TYPE(C_FUNPTR) :: f1 + TYPE(C_PTR) :: f2 + CHARACTER(LEN=2) :: ichr2 + CHARACTER(LEN=10) :: ichr10 + + ! Get the default FAPL + CALL H5Pcreate_f(H5P_FILE_ACCESS_F, fapl, error) + CALL check("h5pcreate_f", error, total_error) + + ! Set the "use the latest version of the format" bounds for creating objects in the file + CALL H5Pset_libver_bounds_f(fapl, H5F_LIBVER_LATEST_F, H5F_LIBVER_LATEST_F, error) + CALL check("H5Pset_libver_bounds_f",error, total_error) + + ! Create the test file with the datasets + CALL h5fcreate_f(DATAFILE, H5F_ACC_TRUNC_F, file, error, H5P_DEFAULT_F, fapl) + CALL check("h5fcreate_f", error, total_error) + + ! Test iterating over empty group + idx = 0 + info%command = 0 + f1 = C_FUNLOC(liter_cb) + f2 = C_LOC(info) + + + CALL H5Literate_f(file, H5_INDEX_NAME_F, H5_ITER_INC_F, idx, f1, f2, ret_value, error) + CALL check("H5Literate_f", error, total_error) + + CALL H5Tcopy_f(H5T_NATIVE_INTEGER, datatype, error) + CALL check("H5Tcopy_f", error, total_error) + + CALL H5Screate_f(H5S_SCALAR_F, filespace, error) + CALL check("H5Screate_f", error, total_error) + + DO i = 1, ndatasets + WRITE(ichr2, '(I2.2)') i + + name = 'Dataset '//ichr2 + + CALL h5dcreate_f(file, name, datatype, filespace, dataset, error) + CALL check("H5dcreate_f", error, total_error) + + lnames(i) = name + + CALL h5dclose_f(dataset,error) + CALL check("H5dclose_f", error, total_error) + + ENDDO + + ! Create a group and named datatype under root group for testing + + CALL H5Gcreate_f(file, "grp0000000", grp, error) + CALL check("H5Gcreate_f", error, total_error) + + lnames(ndatasets+2) = "grp0000000" + +!!$ +!!$ lnames[NDATASETS] = HDstrdup("grp"); +!!$ CHECK(lnames[NDATASETS], NULL, "strdup"); +!!$ + + CALL H5Tcommit_f(file, "dtype00000", datatype, error) + CALL check("H5Tcommit_f", error, total_error) + + lnames(ndatasets+1) = "dtype00000" + + ! Close everything up + + CALL H5Tclose_f(datatype, error) + CALL check("H5Tclose_f", error, total_error) + + CALL H5Gclose_f(grp, error) + CALL check("H5Gclose_f", error, total_error) + + CALL H5Sclose_f(filespace, error) + CALL check("H5Sclose_f", error, total_error) + + CALL H5Fclose_f(file, error) + CALL check("H5Fclose_f", error, total_error) + + ! Iterate through the datasets in the root group in various ways + CALL H5Fopen_f(DATAFILE, H5F_ACC_RDONLY_F, file, error, access_prp=fapl) + CALL check("h5fopen_f", error, total_error) + + ! Test all objects in group, when callback always returns 0 + info%command = 0 + idx = 0 + CALL H5Literate_f(file, H5_INDEX_NAME_F, H5_ITER_INC_F, idx, f1, f2, ret_value, error) + IF(ret_value.GT.0)THEN + PRINT*,"ERROR: Group iteration function didn't return zero correctly!" + CALL verify("H5Literate_f", error, -1, total_error) + ENDIF + + ! Test all objects in group, when callback always returns 1 + ! This also tests the "restarting" ability, because the index changes + + info%command = 2 + idx = 0 + i = 0 + f1 = C_FUNLOC(liter_cb) + f2 = C_LOC(info) + DO + CALL H5Literate_f(file, H5_INDEX_NAME_F, H5_ITER_INC_F, idx, f1, f2, ret_value, error) + IF(error.LT.0) EXIT + ! Verify return value from iterator gets propagated correctly + CALL verify("H5Literate", ret_value, 2, total_error) + ! Increment the number of times "2" is returned + i = i + 1 + ! Verify that the index is the correct value + CALL verify("H5Literate", INT(idx), INT(i), total_error) + IF(idx .GT.ndatasets+2)THEN + PRINT*,"ERROR: Group iteration function walked too far!" + ENDIF + + ! Verify the correct name is retrieved + DO j = 1, 10 + ichr10(j:j) = info%name(j)(1:1) + ENDDO + CALL verify("H5Literate_f", ichr10, lnames(INT(idx)), total_error) + IF(i.EQ.52)EXIT ! prints out error message otherwise (for gcc/gfortran/g95) not intel (why) -FIXME- scot + END DO + + ! put check if did not walk far enough -scot FIXME + + IF(i .NE. (NDATASETS + 2)) THEN + CALL verify("H5Literate_f", i, INT(NDATASETS + 2), total_error) + PRINT*,"ERROR: Group iteration function didn't perform multiple iterations correctly" + ENDIF + + ! Test all objects in group, when callback changes return value + ! This also tests the "restarting" ability, because the index changes + + info%command = 3 + idx = 0 + i = 0 + + f1 = C_FUNLOC(liter_cb) + f2 = C_LOC(info) + DO + + CALL H5Literate_f(file, H5_INDEX_NAME_F, H5_ITER_INC_F, idx, f1, f2, ret_value, error) + IF(error.LT.0) EXIT + CALL verify("H5Literate_f", ret_value, 1, total_error) + + ! Increment the number of times "1" is returned + i = i + 1 + + ! Verify that the index is the correct value + CALL verify("H5Literate_f", INT(idx), INT(i+10), total_error) + + IF(idx .GT.ndatasets+2)THEN + PRINT*,"Group iteration function walked too far!" + ENDIF + + DO j = 1, 10 + ichr10(j:j) = info%name(j)(1:1) + ENDDO + ! Verify that the correct name is retrieved + CALL verify("H5Literate_f", ichr10, lnames(INT(idx)), total_error) + IF(i.EQ.42)EXIT ! prints out error message otherwise (for gcc/gfortran/g95) not intel (why) -FIX- scot + ENDDO + + IF(i .NE. 42 .OR. idx .NE. 52)THEN + PRINT*,"ERROR: Group iteration function didn't perform multiple iterations correctly!" + CALL check("H5Literate_f",-1,total_error) + ENDIF + + CALL H5Fclose_f(file, error) + CALL check("H5Fclose_f", error, total_error) + +END SUBROUTINE test_iter_group + +END MODULE TH5L_F03 diff --git a/fortran/test/tH5L_F03.f90 b/fortran/test/tH5L_F03.f90 deleted file mode 100644 index 40afdbc..0000000 --- a/fortran/test/tH5L_F03.f90 +++ /dev/null @@ -1,318 +0,0 @@ -!****h* root/fortran/test/tH5L_F03.f90 -! -! NAME -! tH5L_F03.f90 -! -! FUNCTION -! Test FORTRAN HDF5 H5L APIs which are dependent on FORTRAN 2003 -! features. -! -! 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. * -! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -! -! USES -! liter_cb_mod -! -! CONTAINS SUBROUTINES -! test_iter_group -! -!***** -MODULE liter_cb_mod - - USE HDF5 - USE TH5_MISC - USE TH5_MISC_GEN - USE, INTRINSIC :: ISO_C_BINDING - IMPLICIT NONE - - TYPE iter_enum - INTEGER RET_ZERO - INTEGER RET_TWO - INTEGER RET_CHANGE - INTEGER RET_CHANGE2 - END TYPE iter_enum - - ! Custom group iteration callback data - TYPE, bind(c) :: iter_info - CHARACTER(KIND=C_CHAR), DIMENSION(1:10) :: name ! The name of the object - INTEGER(c_int) :: TYPE ! The TYPE of the object - INTEGER(c_int) :: command ! The TYPE of RETURN value - END TYPE iter_info - -CONTAINS - -!*************************************************************** -!** -!** liter_cb(): Custom link iteration callback routine. -!** -!*************************************************************** - - INTEGER(KIND=C_INT) FUNCTION liter_cb(group, name, link_info, op_data) bind(C) - - IMPLICIT NONE - - INTEGER(HID_T), VALUE :: group - CHARACTER(LEN=1), DIMENSION(1:10) :: name - - - TYPE (H5L_info_t) :: link_info - - TYPE(iter_info) :: op_data - - INTEGER, SAVE :: count - INTEGER, SAVE :: count2 - -!!$ -!!$ iter_info *info = (iter_info *)op_data; -!!$ static int count = 0; -!!$ static int count2 = 0; - - op_data%name(1:10) = name(1:10) - - SELECT CASE (op_data%command) - - CASE(0) - liter_cb = 0 - CASE(2) - liter_cb = 2 - CASE(3) - count = count + 1 - IF(count.GT.10) THEN - liter_cb = 1 - ELSE - liter_cb = 0 - ENDIF - CASE(4) - count2 = count2 + 1 - IF(count2.GT.10) THEN - liter_cb = 1 - ELSE - liter_cb = 0 - ENDIF - END SELECT - - END FUNCTION liter_cb -END MODULE liter_cb_mod - -MODULE TH5L_F03 - -CONTAINS - -! ***************************************** -! *** H 5 L T E S T S -! ***************************************** - - -!*************************************************************** -!** -!** test_iter_group(): Test group iteration functionality -!** -!*************************************************************** -SUBROUTINE test_iter_group(total_error) - - USE liter_cb_mod - IMPLICIT NONE - - INTEGER, INTENT(INOUT) :: total_error - INTEGER(HID_T) :: fapl - INTEGER(HID_T) :: file ! File ID - INTEGER(hid_t) :: dataset ! Dataset ID - INTEGER(hid_t) :: datatype ! Common datatype ID - INTEGER(hid_t) :: filespace ! Common dataspace ID - INTEGER(hid_t) :: grp ! Group ID - INTEGER i,j ! counting variable - INTEGER(hsize_t) idx ! Index in the group - CHARACTER(LEN=11) :: DATAFILE = "titerate.h5" - INTEGER, PARAMETER :: ndatasets = 50 - CHARACTER(LEN=10) :: name ! temporary name buffer - CHARACTER(LEN=10), DIMENSION(1:ndatasets+2) :: lnames ! Names of the links created - - TYPE(iter_info), TARGET :: info - - INTEGER :: error - INTEGER :: ret_value - TYPE(C_FUNPTR) :: f1 - TYPE(C_PTR) :: f2 - CHARACTER(LEN=2) :: ichr2 - CHARACTER(LEN=10) :: ichr10 - - ! Get the default FAPL - CALL H5Pcreate_f(H5P_FILE_ACCESS_F, fapl, error) - CALL check("h5pcreate_f", error, total_error) - - ! Set the "use the latest version of the format" bounds for creating objects in the file - CALL H5Pset_libver_bounds_f(fapl, H5F_LIBVER_LATEST_F, H5F_LIBVER_LATEST_F, error) - CALL check("H5Pset_libver_bounds_f",error, total_error) - - ! Create the test file with the datasets - CALL h5fcreate_f(DATAFILE, H5F_ACC_TRUNC_F, file, error, H5P_DEFAULT_F, fapl) - CALL check("h5fcreate_f", error, total_error) - - ! Test iterating over empty group - idx = 0 - info%command = 0 - f1 = C_FUNLOC(liter_cb) - f2 = C_LOC(info) - - - CALL H5Literate_f(file, H5_INDEX_NAME_F, H5_ITER_INC_F, idx, f1, f2, ret_value, error) - CALL check("H5Literate_f", error, total_error) - - CALL H5Tcopy_f(H5T_NATIVE_INTEGER, datatype, error) - CALL check("H5Tcopy_f", error, total_error) - - CALL H5Screate_f(H5S_SCALAR_F, filespace, error) - CALL check("H5Screate_f", error, total_error) - - DO i = 1, ndatasets - WRITE(ichr2, '(I2.2)') i - - name = 'Dataset '//ichr2 - - CALL h5dcreate_f(file, name, datatype, filespace, dataset, error) - CALL check("H5dcreate_f", error, total_error) - - lnames(i) = name - - CALL h5dclose_f(dataset,error) - CALL check("H5dclose_f", error, total_error) - - ENDDO - - ! Create a group and named datatype under root group for testing - - CALL H5Gcreate_f(file, "grp0000000", grp, error) - CALL check("H5Gcreate_f", error, total_error) - - lnames(ndatasets+2) = "grp0000000" - -!!$ -!!$ lnames[NDATASETS] = HDstrdup("grp"); -!!$ CHECK(lnames[NDATASETS], NULL, "strdup"); -!!$ - - CALL H5Tcommit_f(file, "dtype00000", datatype, error) - CALL check("H5Tcommit_f", error, total_error) - - lnames(ndatasets+1) = "dtype00000" - - ! Close everything up - - CALL H5Tclose_f(datatype, error) - CALL check("H5Tclose_f", error, total_error) - - CALL H5Gclose_f(grp, error) - CALL check("H5Gclose_f", error, total_error) - - CALL H5Sclose_f(filespace, error) - CALL check("H5Sclose_f", error, total_error) - - CALL H5Fclose_f(file, error) - CALL check("H5Fclose_f", error, total_error) - - ! Iterate through the datasets in the root group in various ways - CALL H5Fopen_f(DATAFILE, H5F_ACC_RDONLY_F, file, error, access_prp=fapl) - CALL check("h5fopen_f", error, total_error) - - ! Test all objects in group, when callback always returns 0 - info%command = 0 - idx = 0 - CALL H5Literate_f(file, H5_INDEX_NAME_F, H5_ITER_INC_F, idx, f1, f2, ret_value, error) - IF(ret_value.GT.0)THEN - PRINT*,"ERROR: Group iteration function didn't return zero correctly!" - CALL verify("H5Literate_f", error, -1, total_error) - ENDIF - - ! Test all objects in group, when callback always returns 1 - ! This also tests the "restarting" ability, because the index changes - - info%command = 2 - idx = 0 - i = 0 - f1 = C_FUNLOC(liter_cb) - f2 = C_LOC(info) - DO - CALL H5Literate_f(file, H5_INDEX_NAME_F, H5_ITER_INC_F, idx, f1, f2, ret_value, error) - IF(error.LT.0) EXIT - ! Verify return value from iterator gets propagated correctly - CALL verify("H5Literate", ret_value, 2, total_error) - ! Increment the number of times "2" is returned - i = i + 1 - ! Verify that the index is the correct value - CALL verify("H5Literate", INT(idx), INT(i), total_error) - IF(idx .GT.ndatasets+2)THEN - PRINT*,"ERROR: Group iteration function walked too far!" - ENDIF - - ! Verify the correct name is retrieved - DO j = 1, 10 - ichr10(j:j) = info%name(j)(1:1) - ENDDO - CALL verify("H5Literate_f", ichr10, lnames(INT(idx)), total_error) - IF(i.EQ.52)EXIT ! prints out error message otherwise (for gcc/gfortran/g95) not intel (why) -FIXME- scot - END DO - - ! put check if did not walk far enough -scot FIXME - - IF(i .NE. (NDATASETS + 2)) THEN - CALL verify("H5Literate_f", i, INT(NDATASETS + 2), total_error) - PRINT*,"ERROR: Group iteration function didn't perform multiple iterations correctly" - ENDIF - - ! Test all objects in group, when callback changes return value - ! This also tests the "restarting" ability, because the index changes - - info%command = 3 - idx = 0 - i = 0 - - f1 = C_FUNLOC(liter_cb) - f2 = C_LOC(info) - DO - - CALL H5Literate_f(file, H5_INDEX_NAME_F, H5_ITER_INC_F, idx, f1, f2, ret_value, error) - IF(error.LT.0) EXIT - CALL verify("H5Literate_f", ret_value, 1, total_error) - - ! Increment the number of times "1" is returned - i = i + 1 - - ! Verify that the index is the correct value - CALL verify("H5Literate_f", INT(idx), INT(i+10), total_error) - - IF(idx .GT.ndatasets+2)THEN - PRINT*,"Group iteration function walked too far!" - ENDIF - - DO j = 1, 10 - ichr10(j:j) = info%name(j)(1:1) - ENDDO - ! Verify that the correct name is retrieved - CALL verify("H5Literate_f", ichr10, lnames(INT(idx)), total_error) - IF(i.EQ.42)EXIT ! prints out error message otherwise (for gcc/gfortran/g95) not intel (why) -FIX- scot - ENDDO - - IF(i .NE. 42 .OR. idx .NE. 52)THEN - PRINT*,"ERROR: Group iteration function didn't perform multiple iterations correctly!" - CALL check("H5Literate_f",-1,total_error) - ENDIF - - CALL H5Fclose_f(file, error) - CALL check("H5Fclose_f", error, total_error) - -END SUBROUTINE test_iter_group - -END MODULE TH5L_F03 diff --git a/fortran/test/tH5MISC_1_8.F90 b/fortran/test/tH5MISC_1_8.F90 new file mode 100644 index 0000000..ba3f095 --- /dev/null +++ b/fortran/test/tH5MISC_1_8.F90 @@ -0,0 +1,469 @@ +!****h* root/fortran/test/tH5MISC_1_8.f90 +! +! NAME +! tH5MISC_1_8.f90 +! +! FUNCTION +! Basic testing of Fortran API's introduced in 1.8 release. +! +! 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. * +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! +!***** +MODULE TH5MISC_1_8 + + USE HDF5 ! This module contains all necessary modules + USE TH5_MISC + USE TH5_MISC_GEN + +CONTAINS + +SUBROUTINE dtransform(cleanup, total_error) + + IMPLICIT NONE + LOGICAL, INTENT(IN) :: cleanup + INTEGER, INTENT(INOUT) :: total_error + + INTEGER(HID_T) :: dxpl_id_c_to_f + INTEGER(HID_T) :: file_id + + CHARACTER(LEN=15), PARAMETER :: c_to_f = "(9/5.0)*x + 123" + INTEGER :: error + CHARACTER(LEN=15) :: ptrgetTest + CHARACTER(LEN=7) :: ptrgetTest_small + CHARACTER(LEN=30) :: ptrgetTest_big + + INTEGER(SIZE_T) :: size + + CALL H5Fcreate_f("dtransform.h5", H5F_ACC_TRUNC_F, file_id, error) + CALL check("dtransform.H5Fcreate_f", error, total_error) + + CALL H5Pcreate_f(H5P_DATASET_XFER_F, dxpl_id_c_to_f, error) + CALL check("dtransform.H5Pcreate_f", error, total_error) + + CALL H5Pset_data_transform_f(dxpl_id_c_to_f, c_to_f, error) + CALL check("dtransform.H5Pset_data_transform_f", error, total_error) + + CALL H5Pget_data_transform_f(dxpl_id_c_to_f, ptrgetTest, error, size=size) + CALL check("dtransform.H5Pget_data_transform_f", error, total_error) + CALL verify("dtransform.H5Pget_data_transform_f", c_to_f, ptrgetTest, total_error) + CALL verify("dtransform.H5Pget_data_transform_f", INT(size),15, total_error) + +! check case when receiving buffer to small + + CALL H5Pget_data_transform_f(dxpl_id_c_to_f, ptrgetTest_small, error, size=size) + CALL check("dtransform.H5Pget_data_transform_f", error, total_error) + CALL verify("dtransform.H5Pget_data_transform_f", c_to_f(1:7), ptrgetTest_small, total_error) + CALL verify("dtransform.H5Pget_data_transform_f", INT(size),15, total_error) + +! check case when receiving buffer to big + + CALL H5Pget_data_transform_f(dxpl_id_c_to_f, ptrgetTest_big, error, size=size) + CALL check("dtransform.H5Pget_data_transform_f", error, total_error) + CALL verify("dtransform.H5Pget_data_transform_f", c_to_f(1:15), ptrgetTest_big(1:15), total_error) + CALL verify("dtransform.H5Pget_data_transform_f", INT(size), 15, total_error) + + CALL H5Fclose_f(file_id, error) + CALL check("H5Fclose_f", error, total_error) + + IF(cleanup) CALL h5_cleanup_f("dtransform", H5P_DEFAULT_F, error) + CALL check("h5_cleanup_f", error, total_error) + +END SUBROUTINE dtransform + + +!*************************************************************** +!** +!** test_genprop_basic_class(): Test basic generic property list code. +!** Tests creating new generic classes. +!** +!*************************************************************** + +SUBROUTINE test_genprop_basic_class(total_error) + + IMPLICIT NONE + INTEGER, INTENT(INOUT) :: total_error + + INTEGER(HID_T) :: cid1 ! Generic Property class ID + INTEGER(HID_T) :: cid2 ! Generic Property class ID + + CHARACTER(LEN=7) :: CLASS1_NAME = "Class 1" + CHARACTER(LEN=7) :: name ! Name of class + CHARACTER(LEN=10) :: name_big ! Name of class bigger buffer + CHARACTER(LEN=4) :: name_small ! Name of class smaller buffer + INTEGER :: error + INTEGER :: size + LOGICAL :: flag + + ! Output message about test being performed + + !WRITE(*,*) "Testing Basic Generic Property List Class Creation Functionality" + + ! Try some bogus value for class identifier; function should fail gracefully + + cid1 = 456 + CALL H5Pget_class_name_f(cid1, name, size, error) + CALL verify("H5Pget_class_name", error, -1, error) + + ! Create a new generic class, derived from the root of the class hierarchy + CALL H5Pcreate_class_f(H5P_ROOT_F, CLASS1_NAME, cid1, error) + CALL check("H5Pcreate_class", error, total_error) + + ! Check class name + CALL H5Pget_class_name_f(cid1, name, size, error) + CALL check("H5Pget_class_name", error, total_error) + CALL verify("H5Pget_class_name", size,7,error) + CALL verify("H5Pget_class_name", name, CLASS1_NAME, error) + IF(error.NE.0)THEN + WRITE(*,*) 'Class names do not match! name=',name, 'CLASS1_NAME=',CLASS1_NAME + total_error = total_error + 1 + ENDIF + + ! Check class name smaller buffer + CALL H5Pget_class_name_f(cid1, name_small, size, error) + CALL check("H5Pget_class_name", error, total_error) + CALL verify("H5Pget_class_name", size,7,error) + CALL verify("H5Pget_class_name", name_small(1:4), CLASS1_NAME(1:4), error) + IF(error.NE.0)THEN + WRITE(*,*) 'Class names do not match! name=',name_small(1:4), 'CLASS1_NAME=',CLASS1_NAME(1:4) + total_error = total_error + 1 + ENDIF + + ! Check class name bigger buffer + CALL H5Pget_class_name_f(cid1, name_big, size, error) + CALL check("H5Pget_class_name", error, total_error) + CALL verify("H5Pget_class_name", size,7,error) + CALL verify("H5Pget_class_name", TRIM(name_big), TRIM(CLASS1_NAME), error) + IF(error.NE.0)THEN + WRITE(*,*) 'Class names do not match! name=',TRIM(name_small), 'CLASS1_NAME=',TRIM(CLASS1_NAME) + total_error = total_error + 1 + ENDIF + + ! Check class parent + CALL H5Pget_class_parent_f(cid1, cid2, error) + CALL check("H5Pget_class_parent_f", error, total_error) + + ! Verify class parent correct + CALL H5Pequal_f(cid2, H5P_ROOT_F, flag, error) + CALL check("H5Pequal_f", error, total_error) + CALL verify("H5Pequal_f", flag, .TRUE., total_error) + + + ! Make certain false postives aren't being returned + CALL H5Pequal_f(cid2, H5P_FILE_CREATE_F, flag, error) + CALL check("H5Pequal_f", error, total_error) + CALL verify("H5Pequal_f", flag, .FALSE., total_error) + + ! Close parent class + CALL H5Pclose_class_f(cid2, error) + CALL check("H5Pclose_class_f", error, total_error) + + + ! Close class + CALL H5Pclose_class_f(cid1, error) + CALL check("H5Pclose_class_f", error, total_error) + +END SUBROUTINE test_genprop_basic_class + +SUBROUTINE test_h5s_encode(total_error) + +!*************************************************************** +!** +!** test_h5s_encode(): Test H5S (dataspace) encoding and decoding. +!** +!*************************************************************** + + IMPLICIT NONE + INTEGER, INTENT(INOUT) :: total_error + + INTEGER(hid_t) :: sid1, sid3! Dataspace ID + INTEGER(hid_t) :: decoded_sid1, decoded_sid3 + INTEGER :: rank ! LOGICAL rank of dataspace + INTEGER(size_t) :: sbuf_size=0, scalar_size=0 + +! Make sure the size is large + CHARACTER(LEN=288) :: sbuf + CHARACTER(LEN=288) :: scalar_buf + + INTEGER(hsize_t) :: n ! Number of dataspace elements + + INTEGER(hsize_t), DIMENSION(1:3) :: start = (/0, 0, 0/) + INTEGER(hsize_t), DIMENSION(1:3) :: stride = (/2, 5, 3/) + INTEGER(hsize_t), DIMENSION(1:3) :: count = (/2, 2, 2/) + INTEGER(hsize_t), DIMENSION(1:3) :: BLOCK = (/1, 3, 1/) + + INTEGER :: space_type + ! + ! Dataset dimensions + ! + INTEGER, PARAMETER :: SPACE1_DIM1= 3, SPACE1_DIM2=15, SPACE1_DIM3=13 + + INTEGER(HSIZE_T), DIMENSION(1:3) :: dims1 = (/SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3/) + INTEGER :: SPACE1_RANK = 3 + INTEGER :: error + + !------------------------------------------------------------------------- + ! * Test encoding and decoding of simple dataspace and hyperslab selection. + ! *------------------------------------------------------------------------- + ! + + CALL H5Screate_simple_f(SPACE1_RANK, dims1, sid1, error) + CALL check("H5Screate_simple", error, total_error) + + CALL h5sselect_hyperslab_f(sid1, H5S_SELECT_SET_F, & + start, count, error, stride=stride, BLOCK=BLOCK) + CALL check("h5sselect_hyperslab_f", error, total_error) + + + ! Encode simple data space in a buffer + + ! First find the buffer size + CALL H5Sencode_f(sid1, sbuf, sbuf_size, error) + CALL check("H5Sencode", error, total_error) + + + ! Try decoding bogus buffer + + CALL H5Sdecode_f(sbuf, decoded_sid1, error) + CALL verify("H5Sdecode", error, -1, total_error) + + CALL H5Sencode_f(sid1, sbuf, sbuf_size, error) + CALL check("H5Sencode", error, total_error) + + ! Decode from the dataspace buffer and return an object handle + CALL H5Sdecode_f(sbuf, decoded_sid1, error) + CALL check("H5Sdecode", error, total_error) + + + ! Verify the decoded dataspace + CALL h5sget_simple_extent_npoints_f(decoded_sid1, n, error) + CALL check("h5sget_simple_extent_npoints_f", error, total_error) + CALL verify("h5sget_simple_extent_npoints_f", INT(n), INT(SPACE1_DIM1 * SPACE1_DIM2 * SPACE1_DIM3), & + total_error) + + ! + !Close the dataspace for the dataset. + ! + CALL h5sclose_f(sid1, error) + CALL check("h5sclose_f", error, total_error) + + CALL h5sclose_f(decoded_sid1, error) + CALL check("h5sclose_f", error, total_error) + + ! ------------------------------------------------------------------------- + ! * Test encoding and decoding of scalar dataspace. + ! *------------------------------------------------------------------------- + ! + ! Create scalar dataspace + + CALL H5Screate_f(H5S_SCALAR_F, sid3, error) + CALL check("H5Screate_f",error, total_error) + + ! Encode scalar data space in a buffer + + ! First find the buffer size + CALL H5Sencode_f(sid3, scalar_buf, scalar_size, error) + CALL check("H5Sencode_f", error, total_error) + + ! encode + + CALL H5Sencode_f(sid3, scalar_buf, scalar_size, error) + CALL check("H5Sencode_f", error, total_error) + + + ! Decode from the dataspace buffer and return an object handle + + CALL H5Sdecode_f(scalar_buf, decoded_sid3, error) + CALL check("H5Sdecode_f", error, total_error) + + + ! Verify extent type + + CALL H5Sget_simple_extent_type_f(decoded_sid3, space_type, error) + CALL check("H5Sget_simple_extent_type_f", error, total_error) + CALL verify("H5Sget_simple_extent_type_f", space_type, H5S_SCALAR_F, total_error) + + ! Verify decoded dataspace + CALL h5sget_simple_extent_npoints_f(decoded_sid3, n, error) + CALL check("h5sget_simple_extent_npoints_f", error, total_error) + CALL verify("h5sget_simple_extent_npoints_f", INT(n), 1, total_error) + + CALL H5Sget_simple_extent_ndims_f(decoded_sid3, rank, error) + CALL CHECK("H5Sget_simple_extent_ndims_f", error, total_error) + CALL verify("H5Sget_simple_extent_ndims_f", rank, 0, total_error ) + + CALL h5sclose_f(sid3, error) + CALL check("h5sclose_f", error, total_error) + + CALL h5sclose_f(decoded_sid3, error) + CALL check("h5sclose_f", error, total_error) + +END SUBROUTINE test_h5s_encode + +!------------------------------------------------------------------------- +! Function: test_scaleoffset +! +! Purpose: Tests the integer datatype for scaleoffset filter +! with fill value set +! +! Return: Success: 0 +! Failure: >0 +! +! Programmer: M. Scot Breitenfeld +! Decemeber 11, 2010 +! +! Modifications: +! +!------------------------------------------------------------------------- +! + +SUBROUTINE test_scaleoffset(cleanup, total_error ) + + IMPLICIT NONE + LOGICAL, INTENT(IN) :: cleanup + INTEGER, INTENT(INOUT) :: total_error + INTEGER(hid_t) :: file + + INTEGER(hid_t) :: dataset, datatype, space, mspace, dc + INTEGER(hsize_t), DIMENSION(1:2) :: dims = (/2, 5/) + INTEGER(hsize_t), DIMENSION(1:2) :: chunk_dim = (/2, 5/) + INTEGER, DIMENSION(1:2,1:5) :: orig_data + INTEGER, DIMENSION(1:2,1:5) :: new_data + INTEGER(hsize_t), DIMENSION(1:2) :: start ! Start of hyperslab + INTEGER(hsize_t), DIMENSION(1:2) :: stride ! Stride of hyperslab + INTEGER(hsize_t), DIMENSION(1:2) :: count ! BLOCK count + INTEGER(hsize_t), DIMENSION(1:2) :: BLOCK ! BLOCK sizes + INTEGER :: fillval + INTEGER(size_t) :: j + REAL :: x + INTEGER :: error + LOGICAL :: status + + ! check to see if filter is available + CALL H5Zfilter_avail_f(H5Z_FILTER_SCALEOFFSET_F, status, error) + IF(.NOT.status)THEN ! We don't have H5Z_FILTER_SCALEOFFSET_F filter + total_error = -1 ! so return + RETURN + ENDIF + + CALL H5Fcreate_f("h5scaleoffset.h5", H5F_ACC_TRUNC_F, file, error) + CALL check("H5Fcreate_f", error, total_error) + + CALL H5Tcopy_f(H5T_NATIVE_INTEGER, datatype, error) + CALL CHECK(" H5Tcopy_f", error, total_error) + + ! Set order of dataset datatype + CALL H5Tset_order_f(datatype, H5T_ORDER_BE_F, error) + CALL CHECK(" H5Tset_order_f", error, total_error) + + ! Create the data space for the dataset + CALL H5Screate_simple_f(2, dims, space, error) + CALL CHECK(" H5Screate_simple_f", error, total_error) + + ! Create the dataset property list + CALL H5Pcreate_f(H5P_DATASET_CREATE_F, dc, error) + CALL CHECK(" H5Pcreate_f", error, total_error) + + ! Set fill value + fillval = 10000 + CALL H5Pset_fill_value_f(dc, H5T_NATIVE_INTEGER, fillval, error) + CALL CHECK(" H5Pset_fill_value_f", error, total_error) + + ! Set up to use scaleoffset filter, let library calculate minbits + CALL H5Pset_chunk_f(dc, 2, chunk_dim, error) + CALL CHECK(" H5Pset_chunk_f", error, total_error) + + CALL H5Pset_scaleoffset_f(dc, H5Z_SO_INT_F, H5Z_SO_INT_MINBITS_DEFAULT_F, error) + CALL CHECK(" H5Pset_scaleoffset_f", error, total_error) + + ! Create the dataset + CALL H5Dcreate_f(file, "scaleoffset_int", datatype, & + space, dataset, error, dc) + CALL CHECK(" H5Dcreate_f", error, total_error) + + ! Create the memory data space + CALL H5Screate_simple_f(2, dims, mspace, error) + CALL CHECK(" H5Screate_simple_f", error, total_error) + + ! Select hyperslab for data to write, using 1x5 blocks, + ! (1,1) stride and (1,1) count starting at the position (0,0) + + start(1:2) = (/0,0/) + stride(1:2) = (/1,1/) + COUNT(1:2) = (/1,1/) + BLOCK(1:2) = (/1,5/) + + CALL H5Sselect_hyperslab_f(mspace, H5S_SELECT_SET_F, start, & + count, error, stride, BLOCK) + CALL CHECK(" H5Sselect_hyperslab_f", error, total_error) + + CALL RANDOM_SEED() + ! Initialize data of hyperslab + DO j = 1, INT(dims(2)) + CALL RANDOM_NUMBER(x) + orig_data(1,j) = INT(x*10000.) + IF(MOD(j,2_size_t).EQ.0)THEN + orig_data(1,j) = - orig_data(1,j) + ENDIF + ENDDO + + !---------------------------------------------------------------------- + ! STEP 1: Test scaleoffset by setting up a chunked dataset and writing + ! to it. + !---------------------------------------------------------------------- + + ! Only data in the hyperslab will be written, other value should be fill value + CALL H5Dwrite_f(dataset, H5T_NATIVE_INTEGER, orig_data, dims, error, mspace, mspace, H5P_DEFAULT_F) + CALL CHECK(" H5Dwrite_f", error, total_error) + + !---------------------------------------------------------------------- + ! STEP 2: Try to read the data we just wrote. + !---------------------------------------------------------------------- + + ! Read the dataset back + + CALL H5Dread_f(dataset, H5T_NATIVE_INTEGER, new_data, dims, error, mspace, mspace, H5P_DEFAULT_F) + CALL CHECK(" H5Dread_f", error, total_error) + + ! Check that the values read are the same as the values written + DO j = 1, INT(dims(2)) + IF(new_data(1,j) .NE. orig_data(1,j))THEN + total_error = total_error + 1 + WRITE(*,'(" Read different values than written.")') + WRITE(*,'(" At index ", 2(1X,I0))') 1, j + EXIT + ENDIF + ENDDO + !---------------------------------------------------------------------- + ! Cleanup + !---------------------------------------------------------------------- + CALL H5Tclose_f(datatype, error) + CALL CHECK(" H5Tclose_f", error, total_error) + CALL H5Pclose_f(dc, error) + CALL CHECK(" H5Pclose_f", error, total_error) + CALL H5Sclose_f(space, error) + CALL CHECK(" H5Sclose_f", error, total_error) + CALL H5Dclose_f(dataset, error) + CALL CHECK(" H5Dclose_f", error, total_error) + CALL H5Fclose_f(file, error) + CALL CHECK(" H5Fclose_f", error, total_error) + + IF(cleanup) CALL h5_cleanup_f("h5scaleoffset", H5P_DEFAULT_F, error) + CALL check("h5_cleanup_f", error, total_error) + +END SUBROUTINE test_scaleoffset + +END MODULE TH5MISC_1_8 diff --git a/fortran/test/tH5MISC_1_8.f90 b/fortran/test/tH5MISC_1_8.f90 deleted file mode 100644 index ba3f095..0000000 --- a/fortran/test/tH5MISC_1_8.f90 +++ /dev/null @@ -1,469 +0,0 @@ -!****h* root/fortran/test/tH5MISC_1_8.f90 -! -! NAME -! tH5MISC_1_8.f90 -! -! FUNCTION -! Basic testing of Fortran API's introduced in 1.8 release. -! -! 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. * -! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -! -!***** -MODULE TH5MISC_1_8 - - USE HDF5 ! This module contains all necessary modules - USE TH5_MISC - USE TH5_MISC_GEN - -CONTAINS - -SUBROUTINE dtransform(cleanup, total_error) - - IMPLICIT NONE - LOGICAL, INTENT(IN) :: cleanup - INTEGER, INTENT(INOUT) :: total_error - - INTEGER(HID_T) :: dxpl_id_c_to_f - INTEGER(HID_T) :: file_id - - CHARACTER(LEN=15), PARAMETER :: c_to_f = "(9/5.0)*x + 123" - INTEGER :: error - CHARACTER(LEN=15) :: ptrgetTest - CHARACTER(LEN=7) :: ptrgetTest_small - CHARACTER(LEN=30) :: ptrgetTest_big - - INTEGER(SIZE_T) :: size - - CALL H5Fcreate_f("dtransform.h5", H5F_ACC_TRUNC_F, file_id, error) - CALL check("dtransform.H5Fcreate_f", error, total_error) - - CALL H5Pcreate_f(H5P_DATASET_XFER_F, dxpl_id_c_to_f, error) - CALL check("dtransform.H5Pcreate_f", error, total_error) - - CALL H5Pset_data_transform_f(dxpl_id_c_to_f, c_to_f, error) - CALL check("dtransform.H5Pset_data_transform_f", error, total_error) - - CALL H5Pget_data_transform_f(dxpl_id_c_to_f, ptrgetTest, error, size=size) - CALL check("dtransform.H5Pget_data_transform_f", error, total_error) - CALL verify("dtransform.H5Pget_data_transform_f", c_to_f, ptrgetTest, total_error) - CALL verify("dtransform.H5Pget_data_transform_f", INT(size),15, total_error) - -! check case when receiving buffer to small - - CALL H5Pget_data_transform_f(dxpl_id_c_to_f, ptrgetTest_small, error, size=size) - CALL check("dtransform.H5Pget_data_transform_f", error, total_error) - CALL verify("dtransform.H5Pget_data_transform_f", c_to_f(1:7), ptrgetTest_small, total_error) - CALL verify("dtransform.H5Pget_data_transform_f", INT(size),15, total_error) - -! check case when receiving buffer to big - - CALL H5Pget_data_transform_f(dxpl_id_c_to_f, ptrgetTest_big, error, size=size) - CALL check("dtransform.H5Pget_data_transform_f", error, total_error) - CALL verify("dtransform.H5Pget_data_transform_f", c_to_f(1:15), ptrgetTest_big(1:15), total_error) - CALL verify("dtransform.H5Pget_data_transform_f", INT(size), 15, total_error) - - CALL H5Fclose_f(file_id, error) - CALL check("H5Fclose_f", error, total_error) - - IF(cleanup) CALL h5_cleanup_f("dtransform", H5P_DEFAULT_F, error) - CALL check("h5_cleanup_f", error, total_error) - -END SUBROUTINE dtransform - - -!*************************************************************** -!** -!** test_genprop_basic_class(): Test basic generic property list code. -!** Tests creating new generic classes. -!** -!*************************************************************** - -SUBROUTINE test_genprop_basic_class(total_error) - - IMPLICIT NONE - INTEGER, INTENT(INOUT) :: total_error - - INTEGER(HID_T) :: cid1 ! Generic Property class ID - INTEGER(HID_T) :: cid2 ! Generic Property class ID - - CHARACTER(LEN=7) :: CLASS1_NAME = "Class 1" - CHARACTER(LEN=7) :: name ! Name of class - CHARACTER(LEN=10) :: name_big ! Name of class bigger buffer - CHARACTER(LEN=4) :: name_small ! Name of class smaller buffer - INTEGER :: error - INTEGER :: size - LOGICAL :: flag - - ! Output message about test being performed - - !WRITE(*,*) "Testing Basic Generic Property List Class Creation Functionality" - - ! Try some bogus value for class identifier; function should fail gracefully - - cid1 = 456 - CALL H5Pget_class_name_f(cid1, name, size, error) - CALL verify("H5Pget_class_name", error, -1, error) - - ! Create a new generic class, derived from the root of the class hierarchy - CALL H5Pcreate_class_f(H5P_ROOT_F, CLASS1_NAME, cid1, error) - CALL check("H5Pcreate_class", error, total_error) - - ! Check class name - CALL H5Pget_class_name_f(cid1, name, size, error) - CALL check("H5Pget_class_name", error, total_error) - CALL verify("H5Pget_class_name", size,7,error) - CALL verify("H5Pget_class_name", name, CLASS1_NAME, error) - IF(error.NE.0)THEN - WRITE(*,*) 'Class names do not match! name=',name, 'CLASS1_NAME=',CLASS1_NAME - total_error = total_error + 1 - ENDIF - - ! Check class name smaller buffer - CALL H5Pget_class_name_f(cid1, name_small, size, error) - CALL check("H5Pget_class_name", error, total_error) - CALL verify("H5Pget_class_name", size,7,error) - CALL verify("H5Pget_class_name", name_small(1:4), CLASS1_NAME(1:4), error) - IF(error.NE.0)THEN - WRITE(*,*) 'Class names do not match! name=',name_small(1:4), 'CLASS1_NAME=',CLASS1_NAME(1:4) - total_error = total_error + 1 - ENDIF - - ! Check class name bigger buffer - CALL H5Pget_class_name_f(cid1, name_big, size, error) - CALL check("H5Pget_class_name", error, total_error) - CALL verify("H5Pget_class_name", size,7,error) - CALL verify("H5Pget_class_name", TRIM(name_big), TRIM(CLASS1_NAME), error) - IF(error.NE.0)THEN - WRITE(*,*) 'Class names do not match! name=',TRIM(name_small), 'CLASS1_NAME=',TRIM(CLASS1_NAME) - total_error = total_error + 1 - ENDIF - - ! Check class parent - CALL H5Pget_class_parent_f(cid1, cid2, error) - CALL check("H5Pget_class_parent_f", error, total_error) - - ! Verify class parent correct - CALL H5Pequal_f(cid2, H5P_ROOT_F, flag, error) - CALL check("H5Pequal_f", error, total_error) - CALL verify("H5Pequal_f", flag, .TRUE., total_error) - - - ! Make certain false postives aren't being returned - CALL H5Pequal_f(cid2, H5P_FILE_CREATE_F, flag, error) - CALL check("H5Pequal_f", error, total_error) - CALL verify("H5Pequal_f", flag, .FALSE., total_error) - - ! Close parent class - CALL H5Pclose_class_f(cid2, error) - CALL check("H5Pclose_class_f", error, total_error) - - - ! Close class - CALL H5Pclose_class_f(cid1, error) - CALL check("H5Pclose_class_f", error, total_error) - -END SUBROUTINE test_genprop_basic_class - -SUBROUTINE test_h5s_encode(total_error) - -!*************************************************************** -!** -!** test_h5s_encode(): Test H5S (dataspace) encoding and decoding. -!** -!*************************************************************** - - IMPLICIT NONE - INTEGER, INTENT(INOUT) :: total_error - - INTEGER(hid_t) :: sid1, sid3! Dataspace ID - INTEGER(hid_t) :: decoded_sid1, decoded_sid3 - INTEGER :: rank ! LOGICAL rank of dataspace - INTEGER(size_t) :: sbuf_size=0, scalar_size=0 - -! Make sure the size is large - CHARACTER(LEN=288) :: sbuf - CHARACTER(LEN=288) :: scalar_buf - - INTEGER(hsize_t) :: n ! Number of dataspace elements - - INTEGER(hsize_t), DIMENSION(1:3) :: start = (/0, 0, 0/) - INTEGER(hsize_t), DIMENSION(1:3) :: stride = (/2, 5, 3/) - INTEGER(hsize_t), DIMENSION(1:3) :: count = (/2, 2, 2/) - INTEGER(hsize_t), DIMENSION(1:3) :: BLOCK = (/1, 3, 1/) - - INTEGER :: space_type - ! - ! Dataset dimensions - ! - INTEGER, PARAMETER :: SPACE1_DIM1= 3, SPACE1_DIM2=15, SPACE1_DIM3=13 - - INTEGER(HSIZE_T), DIMENSION(1:3) :: dims1 = (/SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3/) - INTEGER :: SPACE1_RANK = 3 - INTEGER :: error - - !------------------------------------------------------------------------- - ! * Test encoding and decoding of simple dataspace and hyperslab selection. - ! *------------------------------------------------------------------------- - ! - - CALL H5Screate_simple_f(SPACE1_RANK, dims1, sid1, error) - CALL check("H5Screate_simple", error, total_error) - - CALL h5sselect_hyperslab_f(sid1, H5S_SELECT_SET_F, & - start, count, error, stride=stride, BLOCK=BLOCK) - CALL check("h5sselect_hyperslab_f", error, total_error) - - - ! Encode simple data space in a buffer - - ! First find the buffer size - CALL H5Sencode_f(sid1, sbuf, sbuf_size, error) - CALL check("H5Sencode", error, total_error) - - - ! Try decoding bogus buffer - - CALL H5Sdecode_f(sbuf, decoded_sid1, error) - CALL verify("H5Sdecode", error, -1, total_error) - - CALL H5Sencode_f(sid1, sbuf, sbuf_size, error) - CALL check("H5Sencode", error, total_error) - - ! Decode from the dataspace buffer and return an object handle - CALL H5Sdecode_f(sbuf, decoded_sid1, error) - CALL check("H5Sdecode", error, total_error) - - - ! Verify the decoded dataspace - CALL h5sget_simple_extent_npoints_f(decoded_sid1, n, error) - CALL check("h5sget_simple_extent_npoints_f", error, total_error) - CALL verify("h5sget_simple_extent_npoints_f", INT(n), INT(SPACE1_DIM1 * SPACE1_DIM2 * SPACE1_DIM3), & - total_error) - - ! - !Close the dataspace for the dataset. - ! - CALL h5sclose_f(sid1, error) - CALL check("h5sclose_f", error, total_error) - - CALL h5sclose_f(decoded_sid1, error) - CALL check("h5sclose_f", error, total_error) - - ! ------------------------------------------------------------------------- - ! * Test encoding and decoding of scalar dataspace. - ! *------------------------------------------------------------------------- - ! - ! Create scalar dataspace - - CALL H5Screate_f(H5S_SCALAR_F, sid3, error) - CALL check("H5Screate_f",error, total_error) - - ! Encode scalar data space in a buffer - - ! First find the buffer size - CALL H5Sencode_f(sid3, scalar_buf, scalar_size, error) - CALL check("H5Sencode_f", error, total_error) - - ! encode - - CALL H5Sencode_f(sid3, scalar_buf, scalar_size, error) - CALL check("H5Sencode_f", error, total_error) - - - ! Decode from the dataspace buffer and return an object handle - - CALL H5Sdecode_f(scalar_buf, decoded_sid3, error) - CALL check("H5Sdecode_f", error, total_error) - - - ! Verify extent type - - CALL H5Sget_simple_extent_type_f(decoded_sid3, space_type, error) - CALL check("H5Sget_simple_extent_type_f", error, total_error) - CALL verify("H5Sget_simple_extent_type_f", space_type, H5S_SCALAR_F, total_error) - - ! Verify decoded dataspace - CALL h5sget_simple_extent_npoints_f(decoded_sid3, n, error) - CALL check("h5sget_simple_extent_npoints_f", error, total_error) - CALL verify("h5sget_simple_extent_npoints_f", INT(n), 1, total_error) - - CALL H5Sget_simple_extent_ndims_f(decoded_sid3, rank, error) - CALL CHECK("H5Sget_simple_extent_ndims_f", error, total_error) - CALL verify("H5Sget_simple_extent_ndims_f", rank, 0, total_error ) - - CALL h5sclose_f(sid3, error) - CALL check("h5sclose_f", error, total_error) - - CALL h5sclose_f(decoded_sid3, error) - CALL check("h5sclose_f", error, total_error) - -END SUBROUTINE test_h5s_encode - -!------------------------------------------------------------------------- -! Function: test_scaleoffset -! -! Purpose: Tests the integer datatype for scaleoffset filter -! with fill value set -! -! Return: Success: 0 -! Failure: >0 -! -! Programmer: M. Scot Breitenfeld -! Decemeber 11, 2010 -! -! Modifications: -! -!------------------------------------------------------------------------- -! - -SUBROUTINE test_scaleoffset(cleanup, total_error ) - - IMPLICIT NONE - LOGICAL, INTENT(IN) :: cleanup - INTEGER, INTENT(INOUT) :: total_error - INTEGER(hid_t) :: file - - INTEGER(hid_t) :: dataset, datatype, space, mspace, dc - INTEGER(hsize_t), DIMENSION(1:2) :: dims = (/2, 5/) - INTEGER(hsize_t), DIMENSION(1:2) :: chunk_dim = (/2, 5/) - INTEGER, DIMENSION(1:2,1:5) :: orig_data - INTEGER, DIMENSION(1:2,1:5) :: new_data - INTEGER(hsize_t), DIMENSION(1:2) :: start ! Start of hyperslab - INTEGER(hsize_t), DIMENSION(1:2) :: stride ! Stride of hyperslab - INTEGER(hsize_t), DIMENSION(1:2) :: count ! BLOCK count - INTEGER(hsize_t), DIMENSION(1:2) :: BLOCK ! BLOCK sizes - INTEGER :: fillval - INTEGER(size_t) :: j - REAL :: x - INTEGER :: error - LOGICAL :: status - - ! check to see if filter is available - CALL H5Zfilter_avail_f(H5Z_FILTER_SCALEOFFSET_F, status, error) - IF(.NOT.status)THEN ! We don't have H5Z_FILTER_SCALEOFFSET_F filter - total_error = -1 ! so return - RETURN - ENDIF - - CALL H5Fcreate_f("h5scaleoffset.h5", H5F_ACC_TRUNC_F, file, error) - CALL check("H5Fcreate_f", error, total_error) - - CALL H5Tcopy_f(H5T_NATIVE_INTEGER, datatype, error) - CALL CHECK(" H5Tcopy_f", error, total_error) - - ! Set order of dataset datatype - CALL H5Tset_order_f(datatype, H5T_ORDER_BE_F, error) - CALL CHECK(" H5Tset_order_f", error, total_error) - - ! Create the data space for the dataset - CALL H5Screate_simple_f(2, dims, space, error) - CALL CHECK(" H5Screate_simple_f", error, total_error) - - ! Create the dataset property list - CALL H5Pcreate_f(H5P_DATASET_CREATE_F, dc, error) - CALL CHECK(" H5Pcreate_f", error, total_error) - - ! Set fill value - fillval = 10000 - CALL H5Pset_fill_value_f(dc, H5T_NATIVE_INTEGER, fillval, error) - CALL CHECK(" H5Pset_fill_value_f", error, total_error) - - ! Set up to use scaleoffset filter, let library calculate minbits - CALL H5Pset_chunk_f(dc, 2, chunk_dim, error) - CALL CHECK(" H5Pset_chunk_f", error, total_error) - - CALL H5Pset_scaleoffset_f(dc, H5Z_SO_INT_F, H5Z_SO_INT_MINBITS_DEFAULT_F, error) - CALL CHECK(" H5Pset_scaleoffset_f", error, total_error) - - ! Create the dataset - CALL H5Dcreate_f(file, "scaleoffset_int", datatype, & - space, dataset, error, dc) - CALL CHECK(" H5Dcreate_f", error, total_error) - - ! Create the memory data space - CALL H5Screate_simple_f(2, dims, mspace, error) - CALL CHECK(" H5Screate_simple_f", error, total_error) - - ! Select hyperslab for data to write, using 1x5 blocks, - ! (1,1) stride and (1,1) count starting at the position (0,0) - - start(1:2) = (/0,0/) - stride(1:2) = (/1,1/) - COUNT(1:2) = (/1,1/) - BLOCK(1:2) = (/1,5/) - - CALL H5Sselect_hyperslab_f(mspace, H5S_SELECT_SET_F, start, & - count, error, stride, BLOCK) - CALL CHECK(" H5Sselect_hyperslab_f", error, total_error) - - CALL RANDOM_SEED() - ! Initialize data of hyperslab - DO j = 1, INT(dims(2)) - CALL RANDOM_NUMBER(x) - orig_data(1,j) = INT(x*10000.) - IF(MOD(j,2_size_t).EQ.0)THEN - orig_data(1,j) = - orig_data(1,j) - ENDIF - ENDDO - - !---------------------------------------------------------------------- - ! STEP 1: Test scaleoffset by setting up a chunked dataset and writing - ! to it. - !---------------------------------------------------------------------- - - ! Only data in the hyperslab will be written, other value should be fill value - CALL H5Dwrite_f(dataset, H5T_NATIVE_INTEGER, orig_data, dims, error, mspace, mspace, H5P_DEFAULT_F) - CALL CHECK(" H5Dwrite_f", error, total_error) - - !---------------------------------------------------------------------- - ! STEP 2: Try to read the data we just wrote. - !---------------------------------------------------------------------- - - ! Read the dataset back - - CALL H5Dread_f(dataset, H5T_NATIVE_INTEGER, new_data, dims, error, mspace, mspace, H5P_DEFAULT_F) - CALL CHECK(" H5Dread_f", error, total_error) - - ! Check that the values read are the same as the values written - DO j = 1, INT(dims(2)) - IF(new_data(1,j) .NE. orig_data(1,j))THEN - total_error = total_error + 1 - WRITE(*,'(" Read different values than written.")') - WRITE(*,'(" At index ", 2(1X,I0))') 1, j - EXIT - ENDIF - ENDDO - !---------------------------------------------------------------------- - ! Cleanup - !---------------------------------------------------------------------- - CALL H5Tclose_f(datatype, error) - CALL CHECK(" H5Tclose_f", error, total_error) - CALL H5Pclose_f(dc, error) - CALL CHECK(" H5Pclose_f", error, total_error) - CALL H5Sclose_f(space, error) - CALL CHECK(" H5Sclose_f", error, total_error) - CALL H5Dclose_f(dataset, error) - CALL CHECK(" H5Dclose_f", error, total_error) - CALL H5Fclose_f(file, error) - CALL CHECK(" H5Fclose_f", error, total_error) - - IF(cleanup) CALL h5_cleanup_f("h5scaleoffset", H5P_DEFAULT_F, error) - CALL check("h5_cleanup_f", error, total_error) - -END SUBROUTINE test_scaleoffset - -END MODULE TH5MISC_1_8 diff --git a/fortran/test/tH5O.F90 b/fortran/test/tH5O.F90 new file mode 100644 index 0000000..51e1d64 --- /dev/null +++ b/fortran/test/tH5O.F90 @@ -0,0 +1,793 @@ +!****h* root/fortran/test/tH5O.f90 +! +! NAME +! tH5O.f90 +! +! FUNCTION +! Basic testing of Fortran H5O 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. * +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! +! CONTAINS SUBROUTINES +! test_h5o, test_h5o_link, test_h5o_plist +! +!***** +MODULE TH5O + + USE HDF5 ! This module contains all necessary modules + USE TH5_MISC + USE TH5_MISC_GEN + +CONTAINS + +SUBROUTINE test_h5o(cleanup, total_error) + + IMPLICIT NONE + LOGICAL, INTENT(IN) :: cleanup + INTEGER, INTENT(INOUT) :: total_error + INTEGER :: error + + CALL test_h5o_plist(total_error) ! Test object creation properties + CALL test_h5o_link(total_error) ! Test object link routine + + IF(cleanup) CALL h5_cleanup_f("TestFile", H5P_DEFAULT_F, error) + CALL check("h5_cleanup_f", error, total_error) + IF(cleanup) CALL h5_cleanup_f("test", H5P_DEFAULT_F, error) + CALL check("h5_cleanup_f", error, total_error) + +END SUBROUTINE test_h5o + +!*************************************************************** +!** +!** test_h5o_link: Test creating link to object +!** +!*************************************************************** + +SUBROUTINE test_h5o_link(total_error) + + IMPLICIT NONE + INTEGER, INTENT(INOUT) :: total_error + + INTEGER(HID_T) :: file_id + INTEGER(HID_T) :: group_id + INTEGER(HID_T) :: space_id + INTEGER(HID_T) :: dset_id + INTEGER(HID_T) :: type_id + INTEGER(HID_T) :: fapl_id + INTEGER(HID_T) :: lcpl_id + INTEGER(HID_T) :: ocpypl_id + CHARACTER(LEN=11), PARAMETER :: TEST_FILENAME = 'TestFile.h5' + INTEGER, PARAMETER :: TEST6_DIM1 = 2, TEST6_DIM2 = 5 +!EP INTEGER(HSIZE_T), DIMENSION(1:2), PARAMETER :: dims = (/TEST6_DIM1,TEST6_DIM2/) + INTEGER(HSIZE_T), DIMENSION(1:2) :: dims = (/TEST6_DIM1,TEST6_DIM2/) +!EP INTEGER, DIMENSION(1:TEST6_DIM1,1:TEST6_DIM2) :: wdata, rdata + INTEGER, DIMENSION(TEST6_DIM1,TEST6_DIM2) :: wdata, rdata + + INTEGER, PARAMETER :: TRUE = 1 + + LOGICAL :: committed ! Whether the named datatype is committed + + INTEGER :: i, j + INTEGER :: error ! Value returned from API calls + + CHARACTER(LEN=14) :: NAME_DATATYPE_SIMPLE="H5T_NATIVE_INT" + CHARACTER(LEN=16) :: NAME_DATATYPE_SIMPLE2="H5T_NATIVE_INT-2" + INTEGER(HID_T) :: tid, tid2 + LOGICAL :: flag + + ! Data for tested h5ocopy_f + CHARACTER(LEN=3) , PARAMETER :: dataset = "DS1" + INTEGER , PARAMETER :: dim0 = 4 + + INTEGER(HSIZE_T), DIMENSION(1:1) :: dims2 = (/dim0/) ! size read/write buffer + INTEGER , DIMENSION(1:dim0) :: wdata2 ! Write buffer + LOGICAL :: link_exists + CHARACTER(LEN=8) :: chr_exact + CHARACTER(LEN=10) :: chr_lg + INTEGER(size_t) :: nlinks + INTEGER(HID_T) :: plist = -1 + + CHARACTER(LEN=20) :: dset_comment = "dataset comment" + CHARACTER(LEN=13) :: grp_comment = "group comment" + CHARACTER(LEN=10) :: comment_sm ! to small comment sized buffer + CHARACTER(LEN=15) :: comment ! exact comment sized buffer + CHARACTER(LEN=20) :: comment_lg ! large comment sized buffer + INTEGER(HSSIZE_T) :: comment_size + INTEGER(SIZE_T) :: comment_size2 + + ! Initialize the raw data + DO i = 1, TEST6_DIM1 + DO j = 1, TEST6_DIM2 + wdata(i,j) = i*j + ENDDO + ENDDO + + ! Create the dataspace + CALL h5screate_simple_f(2, dims, space_id, error) + CALL check("h5screate_simple_f",error,total_error) + + ! Create LCPL with intermediate group creation flag set + CALL H5Pcreate_f(H5P_LINK_CREATE_F, lcpl_id, error) + CALL check("h5Pcreate_f",error,total_error) + + CALL H5Pset_create_inter_group_f(lcpl_id, TRUE, error) + CALL check("H5Pset_create_inter_group_f",error,total_error) + + ! Loop over using new group format + ! for(new_format = FALSE; new_format <= TRUE; new_format++) { + + ! Make a FAPL that uses the "use the latest version of the format" bounds + CALL H5Pcreate_f(H5P_FILE_ACCESS_F,fapl_id,error) + CALL check("h5Pcreate_f",error,total_error) + + ! Set the "use the latest version of the format" bounds for creating objects in the file + + CALL H5Pset_libver_bounds_f(fapl_id, H5F_LIBVER_LATEST_F, H5F_LIBVER_LATEST_F, error) + CALL check("H5Pset_libver_bounds_f",error, total_error) + + ! Create a new HDF5 file + CALL H5Fcreate_f(TEST_FILENAME, H5F_ACC_TRUNC_F, file_id, error, H5P_DEFAULT_F, fapl_id) + CALL check("H5Fcreate_f", error, total_error) + + ! Close the FAPL + CALL h5pclose_f(fapl_id, error) + CALL check("h5pclose_f",error,total_error) + + ! Create and commit a datatype with no name + CALL H5Tcopy_f( H5T_NATIVE_INTEGER, type_id, error) + CALL check("H5Tcopy_F",error,total_error) + + CALL H5Tcommit_anon_f(file_id, type_id, error) ! using no optional parameters + CALL check("H5Tcommit_anon_F",error,total_error) + + CALL H5Tcommitted_f(type_id, committed, error) + CALL check("H5Tcommitted_f",error,total_error) + CALL verify("H5Tcommitted_f", committed, .TRUE., total_error) + + ! Create a dataset with no name using the committed datatype + CALL H5Dcreate_anon_f(file_id, type_id, space_id, dset_id, error ) ! using no optional parameters + CALL check("H5Dcreate_anon_f",error,total_error) + ! + ! Verify that we can write to and read from the dataset + ! + ! Write the data to the dataset + +!EP CALL h5dwrite_f(dset_id, H5T_NATIVE_INTEGER, wdata, dims, error, & +!EP mem_space_id=H5S_ALL_F, file_space_id=H5S_ALL_F, xfer_prp = H5P_DEFAULT_F) + CALL h5dwrite_f(dset_id, H5T_NATIVE_INTEGER, wdata, dims, error) + CALL check("h5dwrite_f", error, total_error) + + ! Read the data back +!EP CALL h5dread_f(dset_id, H5T_NATIVE_INTEGER, rdata, dims, error, & +!EP mem_space_id=H5S_ALL_F, file_space_id=H5S_ALL_F, xfer_prp = H5P_DEFAULT_F) + CALL h5dread_f(dset_id, H5T_NATIVE_INTEGER, rdata, dims, error) + CALL check("h5dread_f", error, total_error) + + ! Verify the data + DO i = 1, TEST6_DIM1 + DO j = 1, TEST6_DIM2 + CALL verify("H5Dread_f",wdata(i,j),rdata(i,j),total_error) + wdata(i,j) = i*j + ENDDO + ENDDO + + ! Create a group with no name + + CALL H5Gcreate_anon_f(file_id, group_id, error) + CALL check("H5Gcreate_anon", error, total_error) + + ! Link nameless datatype into nameless group + CALL H5Olink_f(type_id, group_id, "datatype", error, H5P_DEFAULT_F) + CALL check("H5Olink_f", error, total_error) + + ! Link nameless dataset into nameless group with intermediate group + CALL H5Olink_f(dset_id, group_id, "inter_group/dataset", error, lcpl_id, H5P_DEFAULT_F) + CALL check("H5Olink_f", error, total_error) + + ! Close IDs for dataset and datatype + CALL h5dclose_f(dset_id, error) + CALL check("h5dclose_f", error, total_error) + CALL h5tclose_f(type_id, error) + CALL check("h5tclose_f", error, total_error) + + ! Re-open datatype using new link + CALL H5Topen_f(group_id, "datatype", type_id, error) + CALL check("h5topen_f", error, total_error) + + ! Link nameless group to root group and close the group ID + CALL H5Olink_f(group_id, file_id, "/group", error) + CALL check("H5Olink_f", error, total_error) + + CALL h5gclose_f(group_id, error) + CALL check("h5gclose_f",error,total_error) + + ! Open dataset through root group and verify its data + CALL H5Dopen_f(file_id, "/group/inter_group/dataset", dset_id, error) + CALL check("test_lcpl.h5dopen_f", error, total_error) + + ! Read data from dataset +!EP CALL h5dread_f(dset_id, H5T_NATIVE_INTEGER, rdata, dims, error, & +!EP H5S_ALL_F, H5S_ALL_F, xfer_prp = H5P_DEFAULT_F) + CALL h5dread_f(dset_id, H5T_NATIVE_INTEGER, rdata, dims, error) + CALL check("h5dread_f", error, total_error) + + ! Verify the data + DO i = 1, TEST6_DIM1 + DO j = 1, TEST6_DIM2 + CALL verify("H5Dread",wdata(i,j),rdata(i,j),total_error) + ENDDO + ENDDO + ! Close open IDs + + CALL h5dclose_f(dset_id, error) + CALL check("h5dclose_f",error,total_error) + CALL h5tclose_f(type_id, error) + CALL check("h5tclose_f",error,total_error) + + ! Close remaining IDs + CALL h5sclose_f(space_id, error) + CALL check("h5sclose_f",error,total_error) + CALL h5pclose_f(lcpl_id,error) + CALL check("h5pclose_f", error, total_error) + + ! ********************* + ! CHECK H5OCOPY_F + ! ********************* + + DO i = 1, dim0 + wdata2(i) = i-1 + ENDDO + ! + ! Create dataspace. Setting size to be the current size. + ! + CALL h5screate_simple_f(1, dims2, space_id, error) + CALL check("h5screate_simple_f", error, total_error) + ! + ! Create intermediate groups + ! + CALL h5gcreate_f(file_id,"/G1",group_id,error) + CALL check("h5gcreate_f", error, total_error) + CALL h5gcreate_f(file_id,"/G1/G2",group_id,error) + CALL check("h5gcreate_f", error, total_error) + CALL h5gcreate_f(file_id,"/G1/G2/G3",group_id,error) + CALL check("h5gcreate_f", error, total_error) + + ! Try putting a comment on the group /G1/G2/G3 by name + CALL h5oset_comment_by_name_f(file_id, "/G1/G2/G3", grp_comment, error) + CALL check("h5oset_comment_by_name_f", error, total_error) + + comment_lg = ' ' + + CALL h5oget_comment_by_name_f(file_id, "/G1/G2/G3", comment_lg, error) + CALL check("h5oget_comment_by_name_f", error, total_error) + + IF(comment_lg(1:13).NE.grp_comment)THEN + CALL check("h5oget_comment_by_name_f", -1, total_error) + ENDIF + IF(comment_lg(14:20).NE.' ')THEN ! make sure no NULL terminator + CALL check("h5oget_comment_by_name_f", -1, total_error) + ENDIF + + ! Try putting a comment on the group /G1/G2/G3 by name with trailing blanks + + CALL h5oset_comment_by_name_f(file_id, "/G1/G2/G3"//' ', grp_comment, error) + CALL check("h5oset_comment_by_name_f", error, total_error) + + comment_lg = ' ' + + CALL h5oget_comment_by_name_f(file_id, "/G1/G2/G3"//' ', comment_lg, error) + CALL check("h5oget_comment_by_name_f", error, total_error) + + IF(comment_lg(1:13).NE.grp_comment)THEN + CALL check("h5oget_comment_by_name_f", -1, total_error) + ENDIF + IF(comment_lg(14:20).NE.' ')THEN ! make sure no NULL terminator + CALL check("h5oget_comment_by_name_f", -1, total_error) + ENDIF + + ! + ! Create the dataset + ! + CALL h5dcreate_f(group_id, dataset, H5T_STD_I32LE, space_id, dset_id, error) + CALL check("h5dcreate_f", error, total_error) + + ! Putting a comment on the dataset + CALL h5oset_comment_f(dset_id, dset_comment, error) + CALL check("h5oset_comment_f", error, total_error) + + ! Try reading into a buffer that is the correct size + + CALL h5oget_comment_f(dset_id, comment, error) + CALL check("h5oget_comment_f", error, total_error) + + IF(comment(1:15).NE.dset_comment(1:15))THEN + CALL check("h5oget_comment_f", -1, total_error) + ENDIF + + ! Try reading into a buffer that is to small + + CALL h5oget_comment_f(dset_id, comment_sm, error) + CALL check("h5oget_comment_f", error, total_error) + + IF(comment_sm(1:10).NE.dset_comment(1:10))THEN + CALL check("h5oget_comment_f", -1, total_error) + ENDIF + + ! Try reading into a buffer that is larger then needed + + comment_lg = ' ' + + CALL h5oget_comment_f(dset_id, comment_lg, error) + CALL check("h5oget_comment_f", error, total_error) + + IF(comment_lg(1:15).NE.dset_comment)THEN + CALL check("h5oget_comment_f", -1, total_error) + ENDIF + IF(comment_lg(16:20).NE.' ')THEN ! make sure no NULL terminator + CALL check("h5oget_comment_f", -1, total_error) + ENDIF + ! + ! Check optional parameter + ! + CALL h5oget_comment_f(dset_id, comment_lg, error, comment_size) + CALL check("h5oget_comment_f", error, total_error) + + IF( comment_size.NE.15)THEN + CALL check("h5oget_comment_f", -1, total_error) + ENDIF + + ! CHECK h5oget_comment_by_name_f + + ! Try reading into a buffer that is the correct size + + CALL h5oget_comment_by_name_f(dset_id, ".", comment, error) + CALL check("h5oget_comment_by_name_f", error, total_error) + + IF(comment(1:15).NE.dset_comment(1:15))THEN + CALL check("h5oget_comment_by_name_f", -1, total_error) + ENDIF + + ! Try with trailing blanks in the name + + CALL h5oget_comment_by_name_f(dset_id, ". ", comment, error) + CALL check("h5oget_comment_by_name_f", error, total_error) + + IF(comment(1:15).NE.dset_comment(1:15))THEN + CALL check("h5oget_comment_by_name_f", -1, total_error) + ENDIF + + ! + ! Check optional parameter + ! + CALL h5oget_comment_by_name_f(dset_id, ". ", comment_lg, error, comment_size2) + CALL check("h5oget_comment_by_name_f", error, total_error) + + IF( comment_size2.NE.15)THEN + CALL check("h5oget_comment_by_name_f", -1, total_error) + ENDIF + + ! + ! Write the data to the dataset. + ! + CALL h5dwrite_f(dset_id, H5T_NATIVE_INTEGER, wdata2, dims2, error) + CALL check("h5dwrite_f", error, total_error) + + ! ************************* + ! CHECK H5OEXISTS_BY_NAME_F + ! ************************* + + ! Create a soft link to /G1 + CALL h5lcreate_soft_f("/G1", file_id, "/G1_LINK", error) + CALL check("h5lcreate_soft_f", error, total_error) + + + ! Create a soft link to /G1000, does not exist + CALL h5lcreate_soft_f("/G1000", file_id, "/G1_FALSE", error) + CALL check("h5lcreate_soft_f", error, total_error) + + ! Create a soft link to /G1_LINK + CALL h5lcreate_soft_f("/G1_FALSE", file_id, "/G2_FALSE", error) + CALL check("h5lcreate_soft_f", error, total_error) + + ! See if the link exists + CALL h5oexists_by_name_f(file_id,"/G1_LINK", link_exists, error) + CALL check("h5oexists_by_name_f", error, total_error) + + ! Object should exist + IF(.NOT.link_exists)THEN + CALL check("h5oexists_by_name_f", -1, total_error) + ENDIF + + chr_exact = "/G1_LINK" + ! See if the link exists + CALL h5oexists_by_name_f(file_id,chr_exact, link_exists, error, H5P_DEFAULT_F) + CALL check("h5oexists_by_name_f", error, total_error) + + ! Object should exist + IF(.NOT.link_exists)THEN + CALL check("h5oexists_by_name_f", -1, total_error) + ENDIF + + chr_lg = "/G1_LINK" + ! See if the link exists + CALL h5oexists_by_name_f(file_id,chr_lg, link_exists, error, H5P_DEFAULT_F) + CALL check("h5oexists_by_name_f", error, total_error) + + ! Object should exist + IF(.NOT.link_exists)THEN + CALL check("h5oexists_by_name_f", -1, total_error) + ENDIF + + chr_lg = "/G1_LINK " + ! See if the link exists + CALL h5oexists_by_name_f(file_id,chr_lg, link_exists, error, H5P_DEFAULT_F) + CALL check("h5oexists_by_name_f", error, total_error) + + ! Object should exist + IF(.NOT.link_exists)THEN + CALL check("h5oexists_by_name_f", -1, total_error) + ENDIF + + ! See if the link exists + CALL h5oexists_by_name_f(file_id,"/G1_FALSE", link_exists, error) + CALL check("h5oexists_by_name_f", error, total_error) + + ! Object should not exist + IF(link_exists)THEN + CALL check("h5oexists_by_name_f", -1, total_error) + ENDIF + + ! Check optional parameter + + CALL h5pcreate_f(H5P_LINK_ACCESS_F,plist,error) + CALL check("h5pcreate_f",error,total_error) + + nlinks = 2 + CALL h5pset_nlinks_f(plist, nlinks, error) + CALL check("h5pset_nlinks_f", error, total_error) + ! Ensure that nlinks was set successfully + nlinks = 0 + CALL h5pget_nlinks_f(plist, nlinks, error) + CALL check("h5pget_nlinks_f",error,total_error) + CALL verify("h5pget_nlinks_f", INT(nlinks), 2, total_error) + + ! See if the link exists + CALL h5oexists_by_name_f(file_id,"/G1_LINK", link_exists, error, plist) + CALL check("h5oexists_by_name_f", error, total_error) + + ! Object should exist + IF(.not.link_exists)THEN + CALL check("h5oexists_by_name_f", -1, total_error) + ENDIF + ! + ! Close and release resources. + ! + CALL h5dclose_f(dset_id , error) + CALL check(" h5dclose_f", error, total_error) + CALL h5sclose_f(space_id, error) + CALL check("h5sclose_f", error, total_error) + CALL h5gclose_f(group_id, error) + CALL check("h5gclose_f", error, total_error) + + ! Test opening an object by index, note + CALL h5oopen_by_idx_f(file_id, "/G1/G2/G3", H5_INDEX_NAME_F, H5_ITER_INC_F, 0_hsize_t, group_id, error) + CALL check("h5oopen_by_idx_f", error, total_error) + + CALL h5oclose_f(group_id, error) + CALL check("h5gclose_f", error, total_error) + + ! + ! create property to pass copy options + ! + CALL h5pcreate_f(H5P_LINK_CREATE_F, lcpl_id, error) + CALL check("h5Pcreate_f", error, total_error) + + CALL h5pset_create_inter_group_f(lcpl_id, TRUE, error) + CALL check("H5Pset_create_inter_group_f", error, total_error) + ! + ! Check optional parameter lcpl_id, this would fail if lcpl_id was not specified + ! + CALL h5ocopy_f(file_id, "/G1/G2/G3/DS1", file_id, "/G1/G_cp1/DS2", error, lcpl_id=lcpl_id) + CALL check("h5ocopy_f -- W/ OPTION: lcpl_id", error ,total_error) + + CALL h5pclose_f(lcpl_id, error) + CALL check("h5pclose_f",error,total_error) + + CALL h5pcreate_f(H5P_OBJECT_COPY_F, ocpypl_id, error) + CALL check("h5Pcreate_f",error,total_error) + + CALL h5pset_copy_object_f(ocpypl_id, H5O_COPY_SHALLOW_HIERARCHY_F, error) + CALL check("H5Pset_copy_object_f",error,total_error) + + CALL h5ocopy_f(file_id, "/G1/G2", file_id, "/G1/G_cp2", error, ocpypl_id=ocpypl_id) + CALL check("h5ocopy_f",error,total_error) + + ! Makes sure the "DS1" dataset was not copied since we set a + ! flag to copy only immediate members of a group. + ! Therefore, this should fail. + CALL h5dopen_f(file_id, "/G1/G_cp2/DS1", dset_id, error) + IF(error.EQ.0)THEN + CALL check("h5ocopy_f -- W/ OPTION: ocpypl_id", -1, total_error) + ENDIF + + CALL h5pclose_f(ocpypl_id, error) + CALL check("h5pclose_f",error,total_error) + + ! create datatype + CALL h5tcopy_f(H5T_NATIVE_INTEGER, tid, error) + CALL check("h5tcopy_f", error, total_error) + + ! create named datatype + CALL h5tcommit_f(file_id, NAME_DATATYPE_SIMPLE, tid, error) + CALL check("h5tcommit_f", error, total_error) + + ! close the datatype + CALL h5tclose_f(tid, error) + CALL check("h5tclose_f",error, total_error) + + CALL h5ocopy_f(file_id, NAME_DATATYPE_SIMPLE, file_id, NAME_DATATYPE_SIMPLE2, error) + CALL check("h5ocopy_f",error,total_error) + + ! open the datatype for copy + CALL h5topen_f(file_id, NAME_DATATYPE_SIMPLE, tid, error) + CALL check("h5topen_f",error,total_error) + + ! open the copied datatype + CALL h5topen_f(file_id, NAME_DATATYPE_SIMPLE2, tid2, error) + CALL check("h5topen_f",error,total_error) + + ! Compare the datatypes + CALL h5tequal_f(tid, tid2, flag, error) + IF(.NOT.flag)THEN + CALL check("h5ocopy_f FAILED", -1, total_error) + ENDIF + + ! close the destination datatype + CALL h5tclose_f(tid, error) + CALL check("h5tclose_f",error,total_error) + + ! close the destination datatype + CALL h5tclose_f(tid2, error) + CALL check("h5tclose_f",error,total_error) + + CALL h5fclose_f(file_id, error) + CALL check("h5fclose_f",error,total_error) + +END SUBROUTINE test_h5o_link + +!*************************************************************** +!** +!** test_h5o_plist(): Test object creation properties +!** +!*************************************************************** + +SUBROUTINE test_h5o_plist(total_error) + + IMPLICIT NONE + INTEGER, INTENT(INOUT) :: total_error + + INTEGER(hid_t) :: fid ! HDF5 File ID + INTEGER(hid_t) :: grp, dset, dtype, dspace ! Object identifiers + INTEGER(hid_t) :: fapl ! File access property list + INTEGER(hid_t) :: gcpl, dcpl, tcpl ! Object creation properties + INTEGER :: def_max_compact, def_min_dense ! Default phase change parameters + INTEGER :: max_compact, min_dense ! Actual phase change parameters + INTEGER :: error ! Value returned from API calls + CHARACTER(LEN=7), PARAMETER :: TEST_FILENAME = 'test.h5' + + +! PRINT*,'Testing object creation properties' + + ! Make a FAPL that uses the "use the latest version of the format" flag + CALL H5Pcreate_f(H5P_FILE_ACCESS_F, fapl, error) + CALL check("H5Pcreate_f", error, total_error) + + ! Set the "use the latest version of the format" bounds for creating objects in the file + CALL H5Pset_libver_bounds_f(fapl, H5F_LIBVER_LATEST_F, H5F_LIBVER_LATEST_F, error) + CALL check("H5Pcreate_f", error, total_error) + + ! Create a new HDF5 file + CALL H5Fcreate_f(TEST_FILENAME, H5F_ACC_TRUNC_F, fid, error, access_prp=fapl) + CALL check("H5Fcreate_f", error, total_error) + + ! Create group, dataset & named datatype creation property lists + CALL H5Pcreate_f(H5P_GROUP_CREATE_F, gcpl, error) + CALL check("H5Pcreate_f", error, total_error) + CALL H5Pcreate_f(H5P_DATASET_CREATE_F, dcpl, error) + CALL check("H5Pcreate_f", error, total_error) + CALL H5Pcreate_f(H5P_DATATYPE_CREATE_F, tcpl, error) + CALL check("H5Pcreate_f", error, total_error) + + ! Retrieve default attribute phase change values + CALL H5Pget_attr_phase_change_f(gcpl, def_max_compact, def_min_dense, error) + CALL check("H5Pget_attr_phase_change_f", error, total_error) + + ! Set non-default attribute phase change values on each creation property list + CALL H5Pset_attr_phase_change_f(gcpl, def_max_compact+1, def_min_dense-1, error) + CALL check("H5Pget_attr_phase_change_f", error, total_error) + CALL H5Pset_attr_phase_change_f(dcpl, def_max_compact+1, def_min_dense-1, error) + CALL check("H5Pget_attr_phase_change_f", error, total_error) + CALL H5Pset_attr_phase_change_f(tcpl, def_max_compact+1, def_min_dense-1, error) + CALL check("H5Pget_attr_phase_change_f", error, total_error) + + ! Retrieve attribute phase change values on each creation property list and verify + CALL H5Pget_attr_phase_change_f(gcpl, max_compact, min_dense, error) + CALL check("H5Pget_attr_phase_change_f", error, total_error) + CALL verify("H5Pget_attr_phase_change_f", max_compact, (def_max_compact + 1), total_error) + CALL verify("H5Pget_attr_phase_change_f", min_dense, (def_min_dense - 1), total_error) + + CALL H5Pget_attr_phase_change_f(dcpl, max_compact, min_dense, error) + CALL check("H5Pget_attr_phase_change_f", error, total_error) + CALL verify("H5Pget_attr_phase_change_f", max_compact, (def_max_compact + 1), total_error) + CALL verify("H5Pget_attr_phase_change_f", min_dense, (def_min_dense - 1), total_error) + + CALL H5Pget_attr_phase_change_f(tcpl, max_compact, min_dense, error) + CALL check("H5Pget_attr_phase_change_f", error, total_error) + CALL verify("H5Pget_attr_phase_change_f", max_compact, (def_max_compact + 1), total_error) + CALL verify("H5Pget_attr_phase_change_f", min_dense, (def_min_dense - 1), total_error) + + ! Create a group, dataset, and committed datatype within the file, + ! using the respective type of creation property lists. + ! + + ! Create the group anonymously and link it in + CALL H5Gcreate_anon_f(fid, grp, error, gcpl_id=gcpl) + CALL check("H5Gcreate_anon_f", error, total_error) + + CALL H5Olink_f(grp, fid, "group", error) + CALL check("H5Olink_f", error, total_error) + + ! Commit the type inside the group anonymously and link it in + CALL h5tcopy_f(H5T_NATIVE_INTEGER, dtype, error) + CALL check("h5tcopy_f", error, total_error) + + CALL H5Tcommit_anon_f(fid, dtype, error, tcpl_id=tcpl) + CALL check("H5Tcommit_anon_f",error,total_error) + + CALL H5Olink_f(dtype, fid, "datatype", error) + CALL check("H5Olink_f", error, total_error) + + ! Create the dataspace for the dataset. + CALL h5screate_f(H5S_SCALAR_F, dspace, error) + CALL check("h5screate_f",error,total_error) + + ! Create the dataset anonymously and link it in + CALL H5Dcreate_anon_f(fid, H5T_NATIVE_INTEGER, dspace, dset, error, dcpl ) + CALL check("H5Dcreate_anon_f",error,total_error) + + CALL H5Olink_f(dset, fid, "dataset", error) + CALL check("H5Olink_f", error, total_error) + + CALL h5sclose_f(dspace, error) + CALL check("h5sclose_f",error,total_error) + + ! Close current creation property lists + CALL h5pclose_f(gcpl,error) + CALL check("h5pclose_f", error, total_error) + CALL h5pclose_f(dcpl,error) + CALL check("h5pclose_f", error, total_error) + CALL h5pclose_f(tcpl,error) + CALL check("h5pclose_f", error, total_error) + + ! Retrieve each object's creation property list + CALL H5Gget_create_plist_f(grp, gcpl, error) + CALL check("H5Gget_create_plist", error, total_error) + + CALL H5Tget_create_plist_f(dtype, tcpl, error) + CALL check("H5Tget_create_plist_f", error, total_error) + + CALL H5Dget_create_plist_f(dset, dcpl, error) + CALL check("H5Dget_create_plist_f", error, total_error) + + ! Retrieve attribute phase change values on each creation property list and verify + CALL H5Pget_attr_phase_change_f(gcpl, max_compact, min_dense, error) + CALL check("H5Pget_attr_phase_change_f", error, total_error) + CALL verify("H5Pget_attr_phase_change_f", max_compact, (def_max_compact + 1), total_error) + CALL verify("H5Pget_attr_phase_change_f", min_dense, (def_min_dense - 1), total_error) + + CALL H5Pget_attr_phase_change_f(dcpl, max_compact, min_dense, error) + CALL check("H5Pget_attr_phase_change_f", error, total_error) + CALL verify("H5Pget_attr_phase_change_f", max_compact, (def_max_compact + 1), total_error) + CALL verify("H5Pget_attr_phase_change_f", min_dense, (def_min_dense - 1), total_error) + + CALL H5Pget_attr_phase_change_f(tcpl, max_compact, min_dense, error) + CALL check("H5Pget_attr_phase_change_f", error, total_error) + CALL verify("H5Pget_attr_phase_change_f", max_compact, (def_max_compact + 1), total_error) + CALL verify("H5Pget_attr_phase_change_f", min_dense, (def_min_dense - 1), total_error) + + ! Close current objects + CALL h5pclose_f(gcpl,error) + CALL check("h5pclose_f", error, total_error) + CALL h5pclose_f(dcpl,error) + CALL check("h5pclose_f", error, total_error) + CALL h5pclose_f(tcpl,error) + CALL check("h5pclose_f", error, total_error) + + CALL h5gclose_f(grp, error) + CALL check("h5gclose_f",error,total_error) + + CALL h5tclose_f(dtype, error) + CALL check("h5tclose_f",error,total_error) + CALL h5dclose_f(dset, error) + CALL check("h5dclose_f",error,total_error) + CALL h5fclose_f(fid, error) + CALL check("h5fclose_f",error,total_error) + ! Re-open the file and check that the object creation properties persist + CALL h5fopen_f(TEST_FILENAME, H5F_ACC_RDONLY_F, fid, error, access_prp=fapl) + CALL check("H5fopen_f",error,total_error) + + ! Re-open objects + CALL H5Gopen_f(fid, "group", grp, error) + CALL check("h5gopen_f", error, total_error) + + CALL H5Topen_f(fid, "datatype", dtype,error) + CALL check("h5topen_f", error, total_error) + + CALL H5Dopen_f(fid, "dataset", dset, error) + CALL check("h5dopen_f", error, total_error) + + ! Retrieve each object's creation property list + CALL H5Gget_create_plist_f(grp, gcpl, error) + CALL check("H5Gget_create_plist", error, total_error) + + CALL H5Tget_create_plist_f(dtype, tcpl, error) + CALL check("H5Tget_create_plist_f", error, total_error) + + CALL H5Dget_create_plist_f(dset, dcpl, error) + CALL check("H5Dget_create_plist_f", error, total_error) + + ! Retrieve attribute phase change values on each creation property list and verify + CALL H5Pget_attr_phase_change_f(gcpl, max_compact, min_dense, error) + CALL check("H5Pget_attr_phase_change_f", error, total_error) + CALL verify("H5Pget_attr_phase_change_f", max_compact, (def_max_compact + 1), total_error) + CALL verify("H5Pget_attr_phase_change_f", min_dense, (def_min_dense - 1), total_error) + + CALL H5Pget_attr_phase_change_f(dcpl, max_compact, min_dense, error) + CALL check("H5Pget_attr_phase_change_f", error, total_error) + CALL verify("H5Pget_attr_phase_change_f", max_compact, (def_max_compact + 1), total_error) + CALL verify("H5Pget_attr_phase_change_f", min_dense, (def_min_dense - 1), total_error) + + CALL H5Pget_attr_phase_change_f(tcpl, max_compact, min_dense, error) + CALL check("H5Pget_attr_phase_change_f", error, total_error) + CALL verify("H5Pget_attr_phase_change_f", max_compact, (def_max_compact + 1), total_error) + CALL verify("H5Pget_attr_phase_change_f", min_dense, (def_min_dense - 1), total_error) + + ! Close current objects + CALL h5pclose_f(gcpl,error) + CALL check("h5pclose_f", error, total_error) + CALL h5pclose_f(dcpl,error) + CALL check("h5pclose_f", error, total_error) + CALL h5pclose_f(tcpl,error) + CALL check("h5pclose_f", error, total_error) + + CALL h5gclose_f(grp, error) + CALL check("h5gclose_f",error,total_error) + + CALL h5tclose_f(dtype, error) + CALL check("h5tclose_f",error,total_error) + CALL h5dclose_f(dset, error) + CALL check("h5dclose_f",error,total_error) + CALL h5fclose_f(fid, error) + CALL check("h5fclose_f",error,total_error) + + ! Close the FAPL + CALL H5Pclose_f(fapl, error) + CALL check("H5Pclose_f", error, total_error) + +END SUBROUTINE test_h5o_plist + +END MODULE TH5O diff --git a/fortran/test/tH5O.f90 b/fortran/test/tH5O.f90 deleted file mode 100644 index 51e1d64..0000000 --- a/fortran/test/tH5O.f90 +++ /dev/null @@ -1,793 +0,0 @@ -!****h* root/fortran/test/tH5O.f90 -! -! NAME -! tH5O.f90 -! -! FUNCTION -! Basic testing of Fortran H5O 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. * -! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -! -! CONTAINS SUBROUTINES -! test_h5o, test_h5o_link, test_h5o_plist -! -!***** -MODULE TH5O - - USE HDF5 ! This module contains all necessary modules - USE TH5_MISC - USE TH5_MISC_GEN - -CONTAINS - -SUBROUTINE test_h5o(cleanup, total_error) - - IMPLICIT NONE - LOGICAL, INTENT(IN) :: cleanup - INTEGER, INTENT(INOUT) :: total_error - INTEGER :: error - - CALL test_h5o_plist(total_error) ! Test object creation properties - CALL test_h5o_link(total_error) ! Test object link routine - - IF(cleanup) CALL h5_cleanup_f("TestFile", H5P_DEFAULT_F, error) - CALL check("h5_cleanup_f", error, total_error) - IF(cleanup) CALL h5_cleanup_f("test", H5P_DEFAULT_F, error) - CALL check("h5_cleanup_f", error, total_error) - -END SUBROUTINE test_h5o - -!*************************************************************** -!** -!** test_h5o_link: Test creating link to object -!** -!*************************************************************** - -SUBROUTINE test_h5o_link(total_error) - - IMPLICIT NONE - INTEGER, INTENT(INOUT) :: total_error - - INTEGER(HID_T) :: file_id - INTEGER(HID_T) :: group_id - INTEGER(HID_T) :: space_id - INTEGER(HID_T) :: dset_id - INTEGER(HID_T) :: type_id - INTEGER(HID_T) :: fapl_id - INTEGER(HID_T) :: lcpl_id - INTEGER(HID_T) :: ocpypl_id - CHARACTER(LEN=11), PARAMETER :: TEST_FILENAME = 'TestFile.h5' - INTEGER, PARAMETER :: TEST6_DIM1 = 2, TEST6_DIM2 = 5 -!EP INTEGER(HSIZE_T), DIMENSION(1:2), PARAMETER :: dims = (/TEST6_DIM1,TEST6_DIM2/) - INTEGER(HSIZE_T), DIMENSION(1:2) :: dims = (/TEST6_DIM1,TEST6_DIM2/) -!EP INTEGER, DIMENSION(1:TEST6_DIM1,1:TEST6_DIM2) :: wdata, rdata - INTEGER, DIMENSION(TEST6_DIM1,TEST6_DIM2) :: wdata, rdata - - INTEGER, PARAMETER :: TRUE = 1 - - LOGICAL :: committed ! Whether the named datatype is committed - - INTEGER :: i, j - INTEGER :: error ! Value returned from API calls - - CHARACTER(LEN=14) :: NAME_DATATYPE_SIMPLE="H5T_NATIVE_INT" - CHARACTER(LEN=16) :: NAME_DATATYPE_SIMPLE2="H5T_NATIVE_INT-2" - INTEGER(HID_T) :: tid, tid2 - LOGICAL :: flag - - ! Data for tested h5ocopy_f - CHARACTER(LEN=3) , PARAMETER :: dataset = "DS1" - INTEGER , PARAMETER :: dim0 = 4 - - INTEGER(HSIZE_T), DIMENSION(1:1) :: dims2 = (/dim0/) ! size read/write buffer - INTEGER , DIMENSION(1:dim0) :: wdata2 ! Write buffer - LOGICAL :: link_exists - CHARACTER(LEN=8) :: chr_exact - CHARACTER(LEN=10) :: chr_lg - INTEGER(size_t) :: nlinks - INTEGER(HID_T) :: plist = -1 - - CHARACTER(LEN=20) :: dset_comment = "dataset comment" - CHARACTER(LEN=13) :: grp_comment = "group comment" - CHARACTER(LEN=10) :: comment_sm ! to small comment sized buffer - CHARACTER(LEN=15) :: comment ! exact comment sized buffer - CHARACTER(LEN=20) :: comment_lg ! large comment sized buffer - INTEGER(HSSIZE_T) :: comment_size - INTEGER(SIZE_T) :: comment_size2 - - ! Initialize the raw data - DO i = 1, TEST6_DIM1 - DO j = 1, TEST6_DIM2 - wdata(i,j) = i*j - ENDDO - ENDDO - - ! Create the dataspace - CALL h5screate_simple_f(2, dims, space_id, error) - CALL check("h5screate_simple_f",error,total_error) - - ! Create LCPL with intermediate group creation flag set - CALL H5Pcreate_f(H5P_LINK_CREATE_F, lcpl_id, error) - CALL check("h5Pcreate_f",error,total_error) - - CALL H5Pset_create_inter_group_f(lcpl_id, TRUE, error) - CALL check("H5Pset_create_inter_group_f",error,total_error) - - ! Loop over using new group format - ! for(new_format = FALSE; new_format <= TRUE; new_format++) { - - ! Make a FAPL that uses the "use the latest version of the format" bounds - CALL H5Pcreate_f(H5P_FILE_ACCESS_F,fapl_id,error) - CALL check("h5Pcreate_f",error,total_error) - - ! Set the "use the latest version of the format" bounds for creating objects in the file - - CALL H5Pset_libver_bounds_f(fapl_id, H5F_LIBVER_LATEST_F, H5F_LIBVER_LATEST_F, error) - CALL check("H5Pset_libver_bounds_f",error, total_error) - - ! Create a new HDF5 file - CALL H5Fcreate_f(TEST_FILENAME, H5F_ACC_TRUNC_F, file_id, error, H5P_DEFAULT_F, fapl_id) - CALL check("H5Fcreate_f", error, total_error) - - ! Close the FAPL - CALL h5pclose_f(fapl_id, error) - CALL check("h5pclose_f",error,total_error) - - ! Create and commit a datatype with no name - CALL H5Tcopy_f( H5T_NATIVE_INTEGER, type_id, error) - CALL check("H5Tcopy_F",error,total_error) - - CALL H5Tcommit_anon_f(file_id, type_id, error) ! using no optional parameters - CALL check("H5Tcommit_anon_F",error,total_error) - - CALL H5Tcommitted_f(type_id, committed, error) - CALL check("H5Tcommitted_f",error,total_error) - CALL verify("H5Tcommitted_f", committed, .TRUE., total_error) - - ! Create a dataset with no name using the committed datatype - CALL H5Dcreate_anon_f(file_id, type_id, space_id, dset_id, error ) ! using no optional parameters - CALL check("H5Dcreate_anon_f",error,total_error) - ! - ! Verify that we can write to and read from the dataset - ! - ! Write the data to the dataset - -!EP CALL h5dwrite_f(dset_id, H5T_NATIVE_INTEGER, wdata, dims, error, & -!EP mem_space_id=H5S_ALL_F, file_space_id=H5S_ALL_F, xfer_prp = H5P_DEFAULT_F) - CALL h5dwrite_f(dset_id, H5T_NATIVE_INTEGER, wdata, dims, error) - CALL check("h5dwrite_f", error, total_error) - - ! Read the data back -!EP CALL h5dread_f(dset_id, H5T_NATIVE_INTEGER, rdata, dims, error, & -!EP mem_space_id=H5S_ALL_F, file_space_id=H5S_ALL_F, xfer_prp = H5P_DEFAULT_F) - CALL h5dread_f(dset_id, H5T_NATIVE_INTEGER, rdata, dims, error) - CALL check("h5dread_f", error, total_error) - - ! Verify the data - DO i = 1, TEST6_DIM1 - DO j = 1, TEST6_DIM2 - CALL verify("H5Dread_f",wdata(i,j),rdata(i,j),total_error) - wdata(i,j) = i*j - ENDDO - ENDDO - - ! Create a group with no name - - CALL H5Gcreate_anon_f(file_id, group_id, error) - CALL check("H5Gcreate_anon", error, total_error) - - ! Link nameless datatype into nameless group - CALL H5Olink_f(type_id, group_id, "datatype", error, H5P_DEFAULT_F) - CALL check("H5Olink_f", error, total_error) - - ! Link nameless dataset into nameless group with intermediate group - CALL H5Olink_f(dset_id, group_id, "inter_group/dataset", error, lcpl_id, H5P_DEFAULT_F) - CALL check("H5Olink_f", error, total_error) - - ! Close IDs for dataset and datatype - CALL h5dclose_f(dset_id, error) - CALL check("h5dclose_f", error, total_error) - CALL h5tclose_f(type_id, error) - CALL check("h5tclose_f", error, total_error) - - ! Re-open datatype using new link - CALL H5Topen_f(group_id, "datatype", type_id, error) - CALL check("h5topen_f", error, total_error) - - ! Link nameless group to root group and close the group ID - CALL H5Olink_f(group_id, file_id, "/group", error) - CALL check("H5Olink_f", error, total_error) - - CALL h5gclose_f(group_id, error) - CALL check("h5gclose_f",error,total_error) - - ! Open dataset through root group and verify its data - CALL H5Dopen_f(file_id, "/group/inter_group/dataset", dset_id, error) - CALL check("test_lcpl.h5dopen_f", error, total_error) - - ! Read data from dataset -!EP CALL h5dread_f(dset_id, H5T_NATIVE_INTEGER, rdata, dims, error, & -!EP H5S_ALL_F, H5S_ALL_F, xfer_prp = H5P_DEFAULT_F) - CALL h5dread_f(dset_id, H5T_NATIVE_INTEGER, rdata, dims, error) - CALL check("h5dread_f", error, total_error) - - ! Verify the data - DO i = 1, TEST6_DIM1 - DO j = 1, TEST6_DIM2 - CALL verify("H5Dread",wdata(i,j),rdata(i,j),total_error) - ENDDO - ENDDO - ! Close open IDs - - CALL h5dclose_f(dset_id, error) - CALL check("h5dclose_f",error,total_error) - CALL h5tclose_f(type_id, error) - CALL check("h5tclose_f",error,total_error) - - ! Close remaining IDs - CALL h5sclose_f(space_id, error) - CALL check("h5sclose_f",error,total_error) - CALL h5pclose_f(lcpl_id,error) - CALL check("h5pclose_f", error, total_error) - - ! ********************* - ! CHECK H5OCOPY_F - ! ********************* - - DO i = 1, dim0 - wdata2(i) = i-1 - ENDDO - ! - ! Create dataspace. Setting size to be the current size. - ! - CALL h5screate_simple_f(1, dims2, space_id, error) - CALL check("h5screate_simple_f", error, total_error) - ! - ! Create intermediate groups - ! - CALL h5gcreate_f(file_id,"/G1",group_id,error) - CALL check("h5gcreate_f", error, total_error) - CALL h5gcreate_f(file_id,"/G1/G2",group_id,error) - CALL check("h5gcreate_f", error, total_error) - CALL h5gcreate_f(file_id,"/G1/G2/G3",group_id,error) - CALL check("h5gcreate_f", error, total_error) - - ! Try putting a comment on the group /G1/G2/G3 by name - CALL h5oset_comment_by_name_f(file_id, "/G1/G2/G3", grp_comment, error) - CALL check("h5oset_comment_by_name_f", error, total_error) - - comment_lg = ' ' - - CALL h5oget_comment_by_name_f(file_id, "/G1/G2/G3", comment_lg, error) - CALL check("h5oget_comment_by_name_f", error, total_error) - - IF(comment_lg(1:13).NE.grp_comment)THEN - CALL check("h5oget_comment_by_name_f", -1, total_error) - ENDIF - IF(comment_lg(14:20).NE.' ')THEN ! make sure no NULL terminator - CALL check("h5oget_comment_by_name_f", -1, total_error) - ENDIF - - ! Try putting a comment on the group /G1/G2/G3 by name with trailing blanks - - CALL h5oset_comment_by_name_f(file_id, "/G1/G2/G3"//' ', grp_comment, error) - CALL check("h5oset_comment_by_name_f", error, total_error) - - comment_lg = ' ' - - CALL h5oget_comment_by_name_f(file_id, "/G1/G2/G3"//' ', comment_lg, error) - CALL check("h5oget_comment_by_name_f", error, total_error) - - IF(comment_lg(1:13).NE.grp_comment)THEN - CALL check("h5oget_comment_by_name_f", -1, total_error) - ENDIF - IF(comment_lg(14:20).NE.' ')THEN ! make sure no NULL terminator - CALL check("h5oget_comment_by_name_f", -1, total_error) - ENDIF - - ! - ! Create the dataset - ! - CALL h5dcreate_f(group_id, dataset, H5T_STD_I32LE, space_id, dset_id, error) - CALL check("h5dcreate_f", error, total_error) - - ! Putting a comment on the dataset - CALL h5oset_comment_f(dset_id, dset_comment, error) - CALL check("h5oset_comment_f", error, total_error) - - ! Try reading into a buffer that is the correct size - - CALL h5oget_comment_f(dset_id, comment, error) - CALL check("h5oget_comment_f", error, total_error) - - IF(comment(1:15).NE.dset_comment(1:15))THEN - CALL check("h5oget_comment_f", -1, total_error) - ENDIF - - ! Try reading into a buffer that is to small - - CALL h5oget_comment_f(dset_id, comment_sm, error) - CALL check("h5oget_comment_f", error, total_error) - - IF(comment_sm(1:10).NE.dset_comment(1:10))THEN - CALL check("h5oget_comment_f", -1, total_error) - ENDIF - - ! Try reading into a buffer that is larger then needed - - comment_lg = ' ' - - CALL h5oget_comment_f(dset_id, comment_lg, error) - CALL check("h5oget_comment_f", error, total_error) - - IF(comment_lg(1:15).NE.dset_comment)THEN - CALL check("h5oget_comment_f", -1, total_error) - ENDIF - IF(comment_lg(16:20).NE.' ')THEN ! make sure no NULL terminator - CALL check("h5oget_comment_f", -1, total_error) - ENDIF - ! - ! Check optional parameter - ! - CALL h5oget_comment_f(dset_id, comment_lg, error, comment_size) - CALL check("h5oget_comment_f", error, total_error) - - IF( comment_size.NE.15)THEN - CALL check("h5oget_comment_f", -1, total_error) - ENDIF - - ! CHECK h5oget_comment_by_name_f - - ! Try reading into a buffer that is the correct size - - CALL h5oget_comment_by_name_f(dset_id, ".", comment, error) - CALL check("h5oget_comment_by_name_f", error, total_error) - - IF(comment(1:15).NE.dset_comment(1:15))THEN - CALL check("h5oget_comment_by_name_f", -1, total_error) - ENDIF - - ! Try with trailing blanks in the name - - CALL h5oget_comment_by_name_f(dset_id, ". ", comment, error) - CALL check("h5oget_comment_by_name_f", error, total_error) - - IF(comment(1:15).NE.dset_comment(1:15))THEN - CALL check("h5oget_comment_by_name_f", -1, total_error) - ENDIF - - ! - ! Check optional parameter - ! - CALL h5oget_comment_by_name_f(dset_id, ". ", comment_lg, error, comment_size2) - CALL check("h5oget_comment_by_name_f", error, total_error) - - IF( comment_size2.NE.15)THEN - CALL check("h5oget_comment_by_name_f", -1, total_error) - ENDIF - - ! - ! Write the data to the dataset. - ! - CALL h5dwrite_f(dset_id, H5T_NATIVE_INTEGER, wdata2, dims2, error) - CALL check("h5dwrite_f", error, total_error) - - ! ************************* - ! CHECK H5OEXISTS_BY_NAME_F - ! ************************* - - ! Create a soft link to /G1 - CALL h5lcreate_soft_f("/G1", file_id, "/G1_LINK", error) - CALL check("h5lcreate_soft_f", error, total_error) - - - ! Create a soft link to /G1000, does not exist - CALL h5lcreate_soft_f("/G1000", file_id, "/G1_FALSE", error) - CALL check("h5lcreate_soft_f", error, total_error) - - ! Create a soft link to /G1_LINK - CALL h5lcreate_soft_f("/G1_FALSE", file_id, "/G2_FALSE", error) - CALL check("h5lcreate_soft_f", error, total_error) - - ! See if the link exists - CALL h5oexists_by_name_f(file_id,"/G1_LINK", link_exists, error) - CALL check("h5oexists_by_name_f", error, total_error) - - ! Object should exist - IF(.NOT.link_exists)THEN - CALL check("h5oexists_by_name_f", -1, total_error) - ENDIF - - chr_exact = "/G1_LINK" - ! See if the link exists - CALL h5oexists_by_name_f(file_id,chr_exact, link_exists, error, H5P_DEFAULT_F) - CALL check("h5oexists_by_name_f", error, total_error) - - ! Object should exist - IF(.NOT.link_exists)THEN - CALL check("h5oexists_by_name_f", -1, total_error) - ENDIF - - chr_lg = "/G1_LINK" - ! See if the link exists - CALL h5oexists_by_name_f(file_id,chr_lg, link_exists, error, H5P_DEFAULT_F) - CALL check("h5oexists_by_name_f", error, total_error) - - ! Object should exist - IF(.NOT.link_exists)THEN - CALL check("h5oexists_by_name_f", -1, total_error) - ENDIF - - chr_lg = "/G1_LINK " - ! See if the link exists - CALL h5oexists_by_name_f(file_id,chr_lg, link_exists, error, H5P_DEFAULT_F) - CALL check("h5oexists_by_name_f", error, total_error) - - ! Object should exist - IF(.NOT.link_exists)THEN - CALL check("h5oexists_by_name_f", -1, total_error) - ENDIF - - ! See if the link exists - CALL h5oexists_by_name_f(file_id,"/G1_FALSE", link_exists, error) - CALL check("h5oexists_by_name_f", error, total_error) - - ! Object should not exist - IF(link_exists)THEN - CALL check("h5oexists_by_name_f", -1, total_error) - ENDIF - - ! Check optional parameter - - CALL h5pcreate_f(H5P_LINK_ACCESS_F,plist,error) - CALL check("h5pcreate_f",error,total_error) - - nlinks = 2 - CALL h5pset_nlinks_f(plist, nlinks, error) - CALL check("h5pset_nlinks_f", error, total_error) - ! Ensure that nlinks was set successfully - nlinks = 0 - CALL h5pget_nlinks_f(plist, nlinks, error) - CALL check("h5pget_nlinks_f",error,total_error) - CALL verify("h5pget_nlinks_f", INT(nlinks), 2, total_error) - - ! See if the link exists - CALL h5oexists_by_name_f(file_id,"/G1_LINK", link_exists, error, plist) - CALL check("h5oexists_by_name_f", error, total_error) - - ! Object should exist - IF(.not.link_exists)THEN - CALL check("h5oexists_by_name_f", -1, total_error) - ENDIF - ! - ! Close and release resources. - ! - CALL h5dclose_f(dset_id , error) - CALL check(" h5dclose_f", error, total_error) - CALL h5sclose_f(space_id, error) - CALL check("h5sclose_f", error, total_error) - CALL h5gclose_f(group_id, error) - CALL check("h5gclose_f", error, total_error) - - ! Test opening an object by index, note - CALL h5oopen_by_idx_f(file_id, "/G1/G2/G3", H5_INDEX_NAME_F, H5_ITER_INC_F, 0_hsize_t, group_id, error) - CALL check("h5oopen_by_idx_f", error, total_error) - - CALL h5oclose_f(group_id, error) - CALL check("h5gclose_f", error, total_error) - - ! - ! create property to pass copy options - ! - CALL h5pcreate_f(H5P_LINK_CREATE_F, lcpl_id, error) - CALL check("h5Pcreate_f", error, total_error) - - CALL h5pset_create_inter_group_f(lcpl_id, TRUE, error) - CALL check("H5Pset_create_inter_group_f", error, total_error) - ! - ! Check optional parameter lcpl_id, this would fail if lcpl_id was not specified - ! - CALL h5ocopy_f(file_id, "/G1/G2/G3/DS1", file_id, "/G1/G_cp1/DS2", error, lcpl_id=lcpl_id) - CALL check("h5ocopy_f -- W/ OPTION: lcpl_id", error ,total_error) - - CALL h5pclose_f(lcpl_id, error) - CALL check("h5pclose_f",error,total_error) - - CALL h5pcreate_f(H5P_OBJECT_COPY_F, ocpypl_id, error) - CALL check("h5Pcreate_f",error,total_error) - - CALL h5pset_copy_object_f(ocpypl_id, H5O_COPY_SHALLOW_HIERARCHY_F, error) - CALL check("H5Pset_copy_object_f",error,total_error) - - CALL h5ocopy_f(file_id, "/G1/G2", file_id, "/G1/G_cp2", error, ocpypl_id=ocpypl_id) - CALL check("h5ocopy_f",error,total_error) - - ! Makes sure the "DS1" dataset was not copied since we set a - ! flag to copy only immediate members of a group. - ! Therefore, this should fail. - CALL h5dopen_f(file_id, "/G1/G_cp2/DS1", dset_id, error) - IF(error.EQ.0)THEN - CALL check("h5ocopy_f -- W/ OPTION: ocpypl_id", -1, total_error) - ENDIF - - CALL h5pclose_f(ocpypl_id, error) - CALL check("h5pclose_f",error,total_error) - - ! create datatype - CALL h5tcopy_f(H5T_NATIVE_INTEGER, tid, error) - CALL check("h5tcopy_f", error, total_error) - - ! create named datatype - CALL h5tcommit_f(file_id, NAME_DATATYPE_SIMPLE, tid, error) - CALL check("h5tcommit_f", error, total_error) - - ! close the datatype - CALL h5tclose_f(tid, error) - CALL check("h5tclose_f",error, total_error) - - CALL h5ocopy_f(file_id, NAME_DATATYPE_SIMPLE, file_id, NAME_DATATYPE_SIMPLE2, error) - CALL check("h5ocopy_f",error,total_error) - - ! open the datatype for copy - CALL h5topen_f(file_id, NAME_DATATYPE_SIMPLE, tid, error) - CALL check("h5topen_f",error,total_error) - - ! open the copied datatype - CALL h5topen_f(file_id, NAME_DATATYPE_SIMPLE2, tid2, error) - CALL check("h5topen_f",error,total_error) - - ! Compare the datatypes - CALL h5tequal_f(tid, tid2, flag, error) - IF(.NOT.flag)THEN - CALL check("h5ocopy_f FAILED", -1, total_error) - ENDIF - - ! close the destination datatype - CALL h5tclose_f(tid, error) - CALL check("h5tclose_f",error,total_error) - - ! close the destination datatype - CALL h5tclose_f(tid2, error) - CALL check("h5tclose_f",error,total_error) - - CALL h5fclose_f(file_id, error) - CALL check("h5fclose_f",error,total_error) - -END SUBROUTINE test_h5o_link - -!*************************************************************** -!** -!** test_h5o_plist(): Test object creation properties -!** -!*************************************************************** - -SUBROUTINE test_h5o_plist(total_error) - - IMPLICIT NONE - INTEGER, INTENT(INOUT) :: total_error - - INTEGER(hid_t) :: fid ! HDF5 File ID - INTEGER(hid_t) :: grp, dset, dtype, dspace ! Object identifiers - INTEGER(hid_t) :: fapl ! File access property list - INTEGER(hid_t) :: gcpl, dcpl, tcpl ! Object creation properties - INTEGER :: def_max_compact, def_min_dense ! Default phase change parameters - INTEGER :: max_compact, min_dense ! Actual phase change parameters - INTEGER :: error ! Value returned from API calls - CHARACTER(LEN=7), PARAMETER :: TEST_FILENAME = 'test.h5' - - -! PRINT*,'Testing object creation properties' - - ! Make a FAPL that uses the "use the latest version of the format" flag - CALL H5Pcreate_f(H5P_FILE_ACCESS_F, fapl, error) - CALL check("H5Pcreate_f", error, total_error) - - ! Set the "use the latest version of the format" bounds for creating objects in the file - CALL H5Pset_libver_bounds_f(fapl, H5F_LIBVER_LATEST_F, H5F_LIBVER_LATEST_F, error) - CALL check("H5Pcreate_f", error, total_error) - - ! Create a new HDF5 file - CALL H5Fcreate_f(TEST_FILENAME, H5F_ACC_TRUNC_F, fid, error, access_prp=fapl) - CALL check("H5Fcreate_f", error, total_error) - - ! Create group, dataset & named datatype creation property lists - CALL H5Pcreate_f(H5P_GROUP_CREATE_F, gcpl, error) - CALL check("H5Pcreate_f", error, total_error) - CALL H5Pcreate_f(H5P_DATASET_CREATE_F, dcpl, error) - CALL check("H5Pcreate_f", error, total_error) - CALL H5Pcreate_f(H5P_DATATYPE_CREATE_F, tcpl, error) - CALL check("H5Pcreate_f", error, total_error) - - ! Retrieve default attribute phase change values - CALL H5Pget_attr_phase_change_f(gcpl, def_max_compact, def_min_dense, error) - CALL check("H5Pget_attr_phase_change_f", error, total_error) - - ! Set non-default attribute phase change values on each creation property list - CALL H5Pset_attr_phase_change_f(gcpl, def_max_compact+1, def_min_dense-1, error) - CALL check("H5Pget_attr_phase_change_f", error, total_error) - CALL H5Pset_attr_phase_change_f(dcpl, def_max_compact+1, def_min_dense-1, error) - CALL check("H5Pget_attr_phase_change_f", error, total_error) - CALL H5Pset_attr_phase_change_f(tcpl, def_max_compact+1, def_min_dense-1, error) - CALL check("H5Pget_attr_phase_change_f", error, total_error) - - ! Retrieve attribute phase change values on each creation property list and verify - CALL H5Pget_attr_phase_change_f(gcpl, max_compact, min_dense, error) - CALL check("H5Pget_attr_phase_change_f", error, total_error) - CALL verify("H5Pget_attr_phase_change_f", max_compact, (def_max_compact + 1), total_error) - CALL verify("H5Pget_attr_phase_change_f", min_dense, (def_min_dense - 1), total_error) - - CALL H5Pget_attr_phase_change_f(dcpl, max_compact, min_dense, error) - CALL check("H5Pget_attr_phase_change_f", error, total_error) - CALL verify("H5Pget_attr_phase_change_f", max_compact, (def_max_compact + 1), total_error) - CALL verify("H5Pget_attr_phase_change_f", min_dense, (def_min_dense - 1), total_error) - - CALL H5Pget_attr_phase_change_f(tcpl, max_compact, min_dense, error) - CALL check("H5Pget_attr_phase_change_f", error, total_error) - CALL verify("H5Pget_attr_phase_change_f", max_compact, (def_max_compact + 1), total_error) - CALL verify("H5Pget_attr_phase_change_f", min_dense, (def_min_dense - 1), total_error) - - ! Create a group, dataset, and committed datatype within the file, - ! using the respective type of creation property lists. - ! - - ! Create the group anonymously and link it in - CALL H5Gcreate_anon_f(fid, grp, error, gcpl_id=gcpl) - CALL check("H5Gcreate_anon_f", error, total_error) - - CALL H5Olink_f(grp, fid, "group", error) - CALL check("H5Olink_f", error, total_error) - - ! Commit the type inside the group anonymously and link it in - CALL h5tcopy_f(H5T_NATIVE_INTEGER, dtype, error) - CALL check("h5tcopy_f", error, total_error) - - CALL H5Tcommit_anon_f(fid, dtype, error, tcpl_id=tcpl) - CALL check("H5Tcommit_anon_f",error,total_error) - - CALL H5Olink_f(dtype, fid, "datatype", error) - CALL check("H5Olink_f", error, total_error) - - ! Create the dataspace for the dataset. - CALL h5screate_f(H5S_SCALAR_F, dspace, error) - CALL check("h5screate_f",error,total_error) - - ! Create the dataset anonymously and link it in - CALL H5Dcreate_anon_f(fid, H5T_NATIVE_INTEGER, dspace, dset, error, dcpl ) - CALL check("H5Dcreate_anon_f",error,total_error) - - CALL H5Olink_f(dset, fid, "dataset", error) - CALL check("H5Olink_f", error, total_error) - - CALL h5sclose_f(dspace, error) - CALL check("h5sclose_f",error,total_error) - - ! Close current creation property lists - CALL h5pclose_f(gcpl,error) - CALL check("h5pclose_f", error, total_error) - CALL h5pclose_f(dcpl,error) - CALL check("h5pclose_f", error, total_error) - CALL h5pclose_f(tcpl,error) - CALL check("h5pclose_f", error, total_error) - - ! Retrieve each object's creation property list - CALL H5Gget_create_plist_f(grp, gcpl, error) - CALL check("H5Gget_create_plist", error, total_error) - - CALL H5Tget_create_plist_f(dtype, tcpl, error) - CALL check("H5Tget_create_plist_f", error, total_error) - - CALL H5Dget_create_plist_f(dset, dcpl, error) - CALL check("H5Dget_create_plist_f", error, total_error) - - ! Retrieve attribute phase change values on each creation property list and verify - CALL H5Pget_attr_phase_change_f(gcpl, max_compact, min_dense, error) - CALL check("H5Pget_attr_phase_change_f", error, total_error) - CALL verify("H5Pget_attr_phase_change_f", max_compact, (def_max_compact + 1), total_error) - CALL verify("H5Pget_attr_phase_change_f", min_dense, (def_min_dense - 1), total_error) - - CALL H5Pget_attr_phase_change_f(dcpl, max_compact, min_dense, error) - CALL check("H5Pget_attr_phase_change_f", error, total_error) - CALL verify("H5Pget_attr_phase_change_f", max_compact, (def_max_compact + 1), total_error) - CALL verify("H5Pget_attr_phase_change_f", min_dense, (def_min_dense - 1), total_error) - - CALL H5Pget_attr_phase_change_f(tcpl, max_compact, min_dense, error) - CALL check("H5Pget_attr_phase_change_f", error, total_error) - CALL verify("H5Pget_attr_phase_change_f", max_compact, (def_max_compact + 1), total_error) - CALL verify("H5Pget_attr_phase_change_f", min_dense, (def_min_dense - 1), total_error) - - ! Close current objects - CALL h5pclose_f(gcpl,error) - CALL check("h5pclose_f", error, total_error) - CALL h5pclose_f(dcpl,error) - CALL check("h5pclose_f", error, total_error) - CALL h5pclose_f(tcpl,error) - CALL check("h5pclose_f", error, total_error) - - CALL h5gclose_f(grp, error) - CALL check("h5gclose_f",error,total_error) - - CALL h5tclose_f(dtype, error) - CALL check("h5tclose_f",error,total_error) - CALL h5dclose_f(dset, error) - CALL check("h5dclose_f",error,total_error) - CALL h5fclose_f(fid, error) - CALL check("h5fclose_f",error,total_error) - ! Re-open the file and check that the object creation properties persist - CALL h5fopen_f(TEST_FILENAME, H5F_ACC_RDONLY_F, fid, error, access_prp=fapl) - CALL check("H5fopen_f",error,total_error) - - ! Re-open objects - CALL H5Gopen_f(fid, "group", grp, error) - CALL check("h5gopen_f", error, total_error) - - CALL H5Topen_f(fid, "datatype", dtype,error) - CALL check("h5topen_f", error, total_error) - - CALL H5Dopen_f(fid, "dataset", dset, error) - CALL check("h5dopen_f", error, total_error) - - ! Retrieve each object's creation property list - CALL H5Gget_create_plist_f(grp, gcpl, error) - CALL check("H5Gget_create_plist", error, total_error) - - CALL H5Tget_create_plist_f(dtype, tcpl, error) - CALL check("H5Tget_create_plist_f", error, total_error) - - CALL H5Dget_create_plist_f(dset, dcpl, error) - CALL check("H5Dget_create_plist_f", error, total_error) - - ! Retrieve attribute phase change values on each creation property list and verify - CALL H5Pget_attr_phase_change_f(gcpl, max_compact, min_dense, error) - CALL check("H5Pget_attr_phase_change_f", error, total_error) - CALL verify("H5Pget_attr_phase_change_f", max_compact, (def_max_compact + 1), total_error) - CALL verify("H5Pget_attr_phase_change_f", min_dense, (def_min_dense - 1), total_error) - - CALL H5Pget_attr_phase_change_f(dcpl, max_compact, min_dense, error) - CALL check("H5Pget_attr_phase_change_f", error, total_error) - CALL verify("H5Pget_attr_phase_change_f", max_compact, (def_max_compact + 1), total_error) - CALL verify("H5Pget_attr_phase_change_f", min_dense, (def_min_dense - 1), total_error) - - CALL H5Pget_attr_phase_change_f(tcpl, max_compact, min_dense, error) - CALL check("H5Pget_attr_phase_change_f", error, total_error) - CALL verify("H5Pget_attr_phase_change_f", max_compact, (def_max_compact + 1), total_error) - CALL verify("H5Pget_attr_phase_change_f", min_dense, (def_min_dense - 1), total_error) - - ! Close current objects - CALL h5pclose_f(gcpl,error) - CALL check("h5pclose_f", error, total_error) - CALL h5pclose_f(dcpl,error) - CALL check("h5pclose_f", error, total_error) - CALL h5pclose_f(tcpl,error) - CALL check("h5pclose_f", error, total_error) - - CALL h5gclose_f(grp, error) - CALL check("h5gclose_f",error,total_error) - - CALL h5tclose_f(dtype, error) - CALL check("h5tclose_f",error,total_error) - CALL h5dclose_f(dset, error) - CALL check("h5dclose_f",error,total_error) - CALL h5fclose_f(fid, error) - CALL check("h5fclose_f",error,total_error) - - ! Close the FAPL - CALL H5Pclose_f(fapl, error) - CALL check("H5Pclose_f", error, total_error) - -END SUBROUTINE test_h5o_plist - -END MODULE TH5O diff --git a/fortran/test/tH5O_F03.F90 b/fortran/test/tH5O_F03.F90 new file mode 100644 index 0000000..834308b --- /dev/null +++ b/fortran/test/tH5O_F03.F90 @@ -0,0 +1,555 @@ +!****h* root/fortran/test/tH5O_F03.f90 +! +! NAME +! tH5O_F03.f90 +! +! FUNCTION +! Test FORTRAN HDF5 H5O APIs which are dependent on FORTRAN 2003 +! features. +! +! 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. * +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! +!***** + +! ***************************************** +! *** H 5 O T E S T S +! ***************************************** +MODULE visit_cb + + USE HDF5 + USE, INTRINSIC :: ISO_C_BINDING + + IMPLICIT NONE + + INTEGER, PARAMETER :: info_size = 9 + + !------------------------------------------------------------------------- + ! Function: visit_obj_cb + ! + ! Purpose: Callback routine for visiting objects in a file + ! + ! Return: Success: 0 + ! Failure: -1 + ! + ! Programmer: M.S. Breitenfeld + ! July 12, 2012 + ! Adopted from C test. + ! + !------------------------------------------------------------------------- + ! + ! Object visit structs + TYPE, bind(c) :: obj_visit_t + CHARACTER(KIND=C_CHAR), DIMENSION(1:180) :: path ! Path to object + INTEGER :: type_obj ! type of object + END TYPE obj_visit_t + + TYPE, bind(c) :: ovisit_ud_t + INTEGER :: idx ! Index in object visit structure + TYPE(obj_visit_t), DIMENSION(1:info_size) :: info ! Pointer to the object visit structure to use + END TYPE ovisit_ud_t + +CONTAINS + + INTEGER FUNCTION visit_obj_cb( group_id, name, oinfo, op_data) bind(C) + + IMPLICIT NONE + + INTEGER(HID_T), VALUE :: group_id + CHARACTER(LEN=1), DIMENSION(1:180) :: name + TYPE(h5o_info_t) :: oinfo + TYPE(ovisit_ud_t) :: op_data + + INTEGER :: len, i + INTEGER :: idx + + visit_obj_cb = 0 + + ! Since the name is generated in C and passed to a Fortran string, it + ! will be NULL terminated, so we need to find the end of the string. + + len = 1 + DO len = 1, 180 + IF(name(len) .EQ. C_NULL_CHAR) EXIT + ENDDO + + len = len - 1 + + ! Check for correct object information + + idx = op_data%idx + + DO i = 1, len + IF(op_data%info(idx)%path(i)(1:1) .NE. name(i)(1:1))THEN + visit_obj_cb = -1 + RETURN + ENDIF + + IF(op_data%info(idx)%type_obj .NE. oinfo%type)THEN + visit_obj_cb = -1 + RETURN + ENDIF + + ENDDO + + ! Advance to next location in expected output + op_data%idx = op_data%idx + 1 + + END FUNCTION visit_obj_cb + +END MODULE visit_cb + + +MODULE TH5O_F03 + +CONTAINS +!*************************************************************** +!** +!** test_h5o_refcount(): Test H5O refcounting functions. +!** +!*************************************************************** + +SUBROUTINE test_h5o_refcount(total_error) + + USE HDF5 + USE TH5_MISC + USE ISO_C_BINDING + IMPLICIT NONE + + INTEGER, INTENT(INOUT) :: total_error + + CHARACTER(LEN=11), PARAMETER :: FILENAME = "th5o_ref.h5" + INTEGER, PARAMETER :: DIM0 = 5 + INTEGER, PARAMETER :: DIM1 = 10 + INTEGER(hid_t) :: fid ! HDF5 File ID + INTEGER(hid_t) :: grp, dset, dtype, dspace ! Object identifiers + TYPE(h5o_info_t) :: oinfo ! Object info struct + INTEGER(hsize_t), DIMENSION(1:2) :: dims + INTEGER :: error ! Value returned from API calls + + ! Create a new HDF5 file + CALL h5fcreate_f(FILENAME,H5F_ACC_TRUNC_F,fid,error) + CALL check("h5fcreate_f", error, total_error) + + ! Create a group, dataset, and committed datatype within the file + ! Create the group + CALL h5gcreate_f(fid, "group", grp, error) + CALL check("h5gcreate_f",error, total_error) + + ! Commit the type inside the group + CALL h5tcopy_f(H5T_NATIVE_INTEGER, dtype, error) + CALL check("H5Tcopy_f",error, total_error) + CALL h5tcommit_f(fid, "datatype", dtype, error) + CALL check("h5tcommit_f", error, total_error) + + ! Create the data space for the dataset. + dims(1) = DIM0 + dims(2) = DIM1 + + CALL h5screate_simple_f(2, dims, dspace, error) + CALL check("h5screate_simple_f", error, total_error) + + ! Create the dataset. + CALL h5dcreate_f(fid, "dataset", H5T_NATIVE_INTEGER, dspace, dset, error) + CALL check("h5dcreate_f", error, total_error) + CALL h5sclose_f(dspace, error) + CALL check("h5sclose_f", error, total_error) + + ! Get ref counts for each object. They should all be 1, since each object has a hard link. + CALL h5oget_info_by_name_f(fid, "group", oinfo, error) + CALL check("h5oget_info_by_name_f", error, total_error) + IF(oinfo%rc.NE.1)THEN + CALL check("h5oget_info_by_name_f", -1, total_error) + ENDIF + CALL h5oget_info_by_name_f(fid, "datatype", oinfo, error) + CALL check("h5oget_info_by_name_f", error, total_error) + IF(oinfo%rc.NE.1)THEN + CALL check("h5oget_info_by_name_f", -1, total_error) + ENDIF + CALL h5oget_info_by_name_f(fid, "dataset", oinfo, error) + CALL check("h5oget_info_by_name_f", error, total_error) + IF(oinfo%rc.NE.1)THEN + CALL check("h5oget_info_by_name_f", -1, total_error) + ENDIF + + ! Check h5oget_info + CALL h5oget_info_f(grp, oinfo, error) + CALL check("h5oget_info_f", error, total_error) + IF(oinfo%rc.NE.1)THEN + CALL check("h5oget_info_f", -1, total_error) + ENDIF + IF(oinfo%type.NE.H5O_TYPE_GROUP_F)THEN + CALL check("h5oget_info_f", -1, total_error) + ENDIF + + ! Increment each object's reference count. + CALL h5oincr_refcount_f(grp, error) + CALL check("h5oincr_refcount_f", error, total_error) + CALL h5oincr_refcount_f(dtype, error) + CALL check("h5oincr_refcount_f", error, total_error) + CALL h5oincr_refcount_f(dset, error) + CALL check("h5oincr_refcount_f", error, total_error) + + ! Get ref counts for each object. They should all be 2 now. + CALL h5oget_info_by_name_f(fid, "group", oinfo, error) + CALL check("h5oget_info_by_name_f", error, total_error) + IF(oinfo%rc.NE.2)THEN + CALL check("h5oget_info_by_name_f", -1, total_error) + ENDIF + CALL h5oget_info_by_name_f(fid, "datatype", oinfo, error) + CALL check("h5oget_info_by_name_f", error, total_error) + IF(oinfo%rc.NE.2)THEN + CALL check("h5oget_info_by_name_f", -1, total_error) + ENDIF + CALL h5oget_info_by_name_f(fid, "dataset", oinfo, error) + CALL check("h5oget_info_by_name_f", error, total_error) + IF(oinfo%rc.NE.2)THEN + CALL check("h5oget_info_by_name_f", -1, total_error) + ENDIF + + ! Decrement the reference counts and check that they decrease back to 1. + CALL h5odecr_refcount_f(grp, error) + CALL check("h5oincr_refcount_f", error, total_error) + CALL h5odecr_refcount_f(dtype, error) + CALL check("h5oincr_refcount_f", error, total_error) + CALL h5odecr_refcount_f(dset, error) + CALL check("h5oincr_refcount_f", error, total_error) + + CALL h5oget_info_by_name_f(fid, "group", oinfo, error) + CALL check("h5oget_info_by_name_f", error, total_error) + IF(oinfo%rc.NE.1)THEN + CALL check("h5oget_info_by_name_f", -1, total_error) + ENDIF + CALL h5oget_info_by_name_f(fid, "datatype", oinfo, error) + CALL check("h5oget_info_by_name_f", error, total_error) + IF(oinfo%rc.NE.1)THEN + CALL check("h5oget_info_by_name_f", -1, total_error) + ENDIF + CALL h5oget_info_by_name_f(fid, "dataset", oinfo, error) + CALL check("h5oget_info_by_name_f", error, total_error) + IF(oinfo%rc.NE.1)THEN + CALL check("h5oget_info_by_name_f", -1, total_error) + ENDIF + + CALL h5gclose_f(grp, error) + CALL check("h5gclose_f",error, total_error) + CALL h5tclose_f(dtype, error) + CALL check("h5tclose_f",error, total_error) + CALL h5dclose_f(dset, error) + CALL check("h5dclose_f",error, total_error) + CALL h5fclose_f(fid, error) + CALL check("h5fclose_f",error, total_error) + +END SUBROUTINE test_h5o_refcount + +!**************************************************************** +!** +!** test_h5o_refcount(): Test H5O visit functions. +!** +!**************************************************************** + +SUBROUTINE obj_visit(total_error) + + USE HDF5 + USE TH5_MISC + + USE visit_cb + USE ISO_C_BINDING + IMPLICIT NONE + + INTEGER, INTENT(INOUT) :: total_error + + TYPE(ovisit_ud_t), TARGET :: udata ! User-data for visiting + INTEGER(hid_t) :: fid = -1 + TYPE(C_PTR) :: f_ptr + TYPE(C_FUNPTR) :: fun_ptr + CHARACTER(LEN=180) :: object_name + INTEGER :: ret_val + INTEGER :: error + + ! Construct "interesting" file to visit + CALL build_visit_file(fid) + + ! Inialize udata for testing purposes + udata%info(1)%path(1:1) ="." + udata%info(1)%type_obj = H5O_TYPE_GROUP_F + udata%info(2)%path(1:12) = & + (/"D","a","t","a","s","e","t","_","z","e","r","o"/) + udata%info(2)%type_obj =H5O_TYPE_DATASET_F + udata%info(3)%path(1:6) = & + (/"G","r","o","u","p","1"/) + udata%info(3)%type_obj = H5O_TYPE_GROUP_F + udata%info(4)%path(1:18) =& + (/"G","r","o","u","p","1","/","D","a","t","a","s","e","t","_","o","n","e"/) + udata%info(4)%type_obj = H5O_TYPE_DATASET_F + udata%info(5)%path(1:13) =& + (/"G","r","o","u","p","1","/","G","r","o","u","p","2"/) + udata%info(5)%type_obj = H5O_TYPE_GROUP_F + udata%info(6)%path(1:25) =& + (/"G","r","o","u","p","1","/","G","r","o","u","p","2","/","D","a","t","a","s","e","t","_","t","w","o"/) + udata%info(6)%type_obj = H5O_TYPE_DATASET_F + udata%info(7)%path(1:22) =& + (/"G","r","o","u","p","1","/","G","r","o","u","p","2","/","T","y","p","e","_","t","w","o"/) + udata%info(7)%type_obj = H5O_TYPE_NAMED_DATATYPE_F + udata%info(8)%path(1:15) =& + (/"G","r","o","u","p","1","/","T","y","p","e","_","o","n","e"/) + udata%info(8)%type_obj = H5O_TYPE_NAMED_DATATYPE_F + udata%info(9)%path(1:9) =& + (/"T","y","p","e","_","z","e","r","o"/) + udata%info(9)%type_obj = H5O_TYPE_NAMED_DATATYPE_F + + ! Visit all the objects reachable from the root group (with file ID) + udata%idx = 1 + + fun_ptr = C_FUNLOC(visit_obj_cb) + f_ptr = C_LOC(udata) + + ! Test h5ovisit_f + CALL h5ovisit_f(fid, H5_INDEX_NAME_F, H5_ITER_INC_F, fun_ptr, f_ptr, ret_val, error) + CALL check("h5ovisit_f", error, total_error) + IF(ret_val.LT.0)THEN + CALL check("h5ovisit_f", -1, total_error) + ENDIF + + ! Test h5ovisit_by_name_f + + object_name = "/" + udata%idx = 1 + + CALL h5ovisit_by_name_f(fid, object_name, H5_INDEX_NAME_F, H5_ITER_INC_F, fun_ptr, f_ptr, ret_val, error) + CALL check("h5ovisit_by_name_f", error, total_error) + IF(ret_val.LT.0)THEN + CALL check("h5ovisit_by_name_f", -1, total_error) + ENDIF + + CALL h5fclose_f(fid, error) + CALL check("h5fclose_f",error, total_error) + +END SUBROUTINE obj_visit + +!**************************************************************** +!** +!** test_h5o_refcount(): Test H5O info functions. +!** +!**************************************************************** + +SUBROUTINE obj_info(total_error) + + USE HDF5 + USE TH5_MISC + USE ISO_C_BINDING + IMPLICIT NONE + + INTEGER, INTENT(INOUT) :: total_error + + INTEGER(hid_t) :: fid = -1 ! File ID + INTEGER(hid_t) :: gid = -1, gid2 = -1 ! Group IDs + INTEGER(hid_t) :: did ! Dataset ID + INTEGER(hid_t) :: sid ! Dataspace ID + TYPE(hobj_ref_t_f), TARGET :: wref ! Reference to write + TYPE(hobj_ref_t_f), TARGET :: rref ! Reference to read + TYPE(H5O_info_t) :: oinfo ! Object info struct + INTEGER :: error + TYPE(C_PTR) :: f_ptr + + CHARACTER(LEN=6) :: GROUPNAME = "/group" + CHARACTER(LEN=6) :: GROUPNAME2 = "group2" + CHARACTER(LEN=6) :: GROUPNAME3 = "group3" + CHARACTER(LEN=5) :: DSETNAME = "/dset" + CHARACTER(LEN=5) :: DSETNAME2 = "dset2" + + ! Create file with a group and a dataset containing an object reference to the group + CALL h5fcreate_f("get_info.h5", H5F_ACC_TRUNC_F, fid, error) + CALL check("h5fcreate_f",error, total_error) + + ! Create dataspace to use for dataset + CALL h5screate_f(H5S_SCALAR_F, sid, error) + CALL check("h5screate_f",error,total_error) + + ! Create group to refer to + CALL h5gcreate_f(fid, GROUPNAME, gid, error) + CALL check("h5gcreate_f",error,total_error) + + ! Create nested groups + CALL h5gcreate_f(gid, GROUPNAME2, gid2, error) + CALL check("h5gcreate_f",error,total_error) + CALL h5gclose_f(gid2, error) + CALL check("h5gclose_f",error,total_error) + + CALL h5gcreate_f(gid, GROUPNAME3, gid2, error) + CALL check("h5gcreate_f",error,total_error) + CALL h5gclose_f(gid2, error) + CALL check("h5gclose_f",error,total_error) + + ! Create bottom dataset + CALL h5dcreate_f(gid, DSETNAME2, H5T_NATIVE_INTEGER, sid, did, error) + CALL check("h5dcreate_f",error, total_error) + + CALL h5dclose_f(did, error) + CALL check("h5dclose_f", error, total_error) + + CALL h5gclose_f(gid, error) + CALL check("h5gclose_f",error,total_error) + + ! Create dataset + CALL h5dcreate_f(fid, DSETNAME, H5T_STD_REF_OBJ, sid, did, error) + CALL check("h5dcreate_f",error, total_error) + + f_ptr = C_LOC(wref) + + ! Create reference to group + CALL h5rcreate_f(fid, GROUPNAME, H5R_OBJECT_F, f_ptr, error) + CALL check("h5rcreate_f",error, total_error) + + ! Write reference to disk + CALL h5dwrite_f(did, H5T_STD_REF_OBJ, f_ptr, error) + CALL check("h5dwrite_f",error, total_error) + + ! Close objects + CALL h5dclose_f(did, error) + CALL check("h5dclose_f", error, total_error) + CALL h5sclose_f(sid, error) + CALL check("h5sclose_f", error, total_error) + CALL h5fclose_f(fid, error) + CALL check("h5fclose_f", error, total_error) + + ! Re-open file + CALL h5fopen_f("get_info.h5", H5F_ACC_RDWR_F, fid, error) + CALL check("h5fopen_f", error, total_error) + + ! Re-open dataset + CALL h5dopen_f(fid, DSETNAME, did, error) + CALL check("h5dopen_f", error, total_error) + + ! Read in the reference + + f_ptr = C_LOC(rref) + + CALL h5dread_f(did, H5T_STD_REF_OBJ, f_ptr, error) + CALL check("H5Dread_f",error, total_error) + + ! Dereference to get the group + + CALL h5rdereference_f(did, H5R_OBJECT_F, f_ptr, gid, error) + CALL check("h5rdereference_f", error, total_error) + + CALL h5oget_info_by_idx_f(gid, ".", H5_INDEX_NAME_F, H5_ITER_INC_F, 0_hsize_t, oinfo, error) + CALL check("h5oget_info_by_idx_f", error, total_error) + + IF(oinfo%rc.NE.1)THEN + CALL check("h5oget_info_by_idx_f", -1, total_error) + ENDIF + + IF(oinfo%type.NE.H5O_TYPE_DATASET_F)THEN + CALL check("h5oget_info_by_idx_f", -1, total_error) + ENDIF + + ! Close objects + CALL h5dclose_f(did, error) + CALL check("h5dclose_f", error, total_error) + CALL h5gclose_f(gid, error) + CALL check("h5sclose_f", error, total_error) + CALL h5fclose_f(fid, error) + CALL check("h5fclose_f", error, total_error) + +END SUBROUTINE obj_info + +!------------------------------------------------------------------------- +! Function: build_visit_file +! +! Purpose: Build an "interesting" file to use for visiting links & objects +! +! Programmer: M. Scot Breitenfeld +! July 12, 2012 +! NOTE: Adapted from C test. +! +!------------------------------------------------------------------------- +! + +SUBROUTINE build_visit_file(fid) + + USE HDF5 + USE TH5_MISC + IMPLICIT NONE + + INTEGER(hid_t) :: fid ! File ID + INTEGER(hid_t) :: gid = -1, gid2 = -1 ! Group IDs + INTEGER(hid_t) :: sid = -1 ! Dataspace ID + INTEGER(hid_t) :: did = -1 ! Dataset ID + INTEGER(hid_t) :: tid = -1 ! Datatype ID + CHARACTER(LEN=20) :: filename = 'visit.h5' + INTEGER :: error + + ! Create file for visiting + CALL H5Fcreate_f(filename, H5F_ACC_TRUNC_F, fid, error) + + ! Create group + CALL H5Gcreate_f(fid, "/Group1", gid, error) + + ! Create nested group + CALL H5Gcreate_f(gid, "Group2", gid2, error) + + ! Close groups + CALL h5gclose_f(gid2, error) + CALL h5gclose_f(gid, error) + + ! Create soft links to groups created + CALL H5Lcreate_soft_f("/Group1", fid, "/soft_one", error) + CALL H5Lcreate_soft_f("/Group1/Group2", fid, "/soft_two", error) + + ! Create dangling soft link + CALL H5Lcreate_soft_f("nowhere", fid, "/soft_dangle", error) + + ! Create hard links to all groups + CALL H5Lcreate_hard_f(fid, "/", fid, "hard_zero", error) + CALL H5Lcreate_hard_f(fid, "/Group1", fid, "hard_one", error) + CALL H5Lcreate_hard_f(fid, "/Group1/Group2", fid, "hard_two", error) + + ! Create loops w/hard links + CALL H5Lcreate_hard_f(fid, "/Group1", fid, "/Group1/hard_one", error) + CALL H5Lcreate_hard_f(fid, "/", fid, "/Group1/Group2/hard_zero", error) + + ! Create dataset in each group + CALL H5Screate_f(H5S_SCALAR_F, sid, error) + + CALL H5Dcreate_f(fid, "/Dataset_zero", H5T_NATIVE_INTEGER, sid, did, error) + CALL H5Dclose_f(did, error) + + CALL H5Dcreate_f(fid, "/Group1/Dataset_one", H5T_NATIVE_INTEGER, sid, did, error) + CALL H5Dclose_f(did, error) + + CALL H5Dcreate_f(fid, "/Group1/Group2/Dataset_two", H5T_NATIVE_INTEGER, sid, did, error) + CALL H5Dclose_f(did, error) + + CALL H5Sclose_f(sid, error) + + ! Create named datatype in each group + CALL H5Tcopy_f(H5T_NATIVE_INTEGER, tid, error) + + CALL H5Tcommit_f(fid, "/Type_zero", tid, error) + CALL H5Tclose_f(tid, error) + + CALL H5Tcopy_f(H5T_NATIVE_INTEGER, tid, error) + CALL H5Tcommit_f(fid, "/Group1/Type_one", tid, error) + CALL H5Tclose_f(tid, error) + + CALL H5Tcopy_f(H5T_NATIVE_INTEGER, tid, error) + CALL H5Tcommit_f(fid, "/Group1/Group2/Type_two", tid, error) + CALL H5Tclose_f(tid, error) + +END SUBROUTINE build_visit_file + +END MODULE TH5O_F03 diff --git a/fortran/test/tH5O_F03.f90 b/fortran/test/tH5O_F03.f90 deleted file mode 100644 index 834308b..0000000 --- a/fortran/test/tH5O_F03.f90 +++ /dev/null @@ -1,555 +0,0 @@ -!****h* root/fortran/test/tH5O_F03.f90 -! -! NAME -! tH5O_F03.f90 -! -! FUNCTION -! Test FORTRAN HDF5 H5O APIs which are dependent on FORTRAN 2003 -! features. -! -! 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. * -! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -! -!***** - -! ***************************************** -! *** H 5 O T E S T S -! ***************************************** -MODULE visit_cb - - USE HDF5 - USE, INTRINSIC :: ISO_C_BINDING - - IMPLICIT NONE - - INTEGER, PARAMETER :: info_size = 9 - - !------------------------------------------------------------------------- - ! Function: visit_obj_cb - ! - ! Purpose: Callback routine for visiting objects in a file - ! - ! Return: Success: 0 - ! Failure: -1 - ! - ! Programmer: M.S. Breitenfeld - ! July 12, 2012 - ! Adopted from C test. - ! - !------------------------------------------------------------------------- - ! - ! Object visit structs - TYPE, bind(c) :: obj_visit_t - CHARACTER(KIND=C_CHAR), DIMENSION(1:180) :: path ! Path to object - INTEGER :: type_obj ! type of object - END TYPE obj_visit_t - - TYPE, bind(c) :: ovisit_ud_t - INTEGER :: idx ! Index in object visit structure - TYPE(obj_visit_t), DIMENSION(1:info_size) :: info ! Pointer to the object visit structure to use - END TYPE ovisit_ud_t - -CONTAINS - - INTEGER FUNCTION visit_obj_cb( group_id, name, oinfo, op_data) bind(C) - - IMPLICIT NONE - - INTEGER(HID_T), VALUE :: group_id - CHARACTER(LEN=1), DIMENSION(1:180) :: name - TYPE(h5o_info_t) :: oinfo - TYPE(ovisit_ud_t) :: op_data - - INTEGER :: len, i - INTEGER :: idx - - visit_obj_cb = 0 - - ! Since the name is generated in C and passed to a Fortran string, it - ! will be NULL terminated, so we need to find the end of the string. - - len = 1 - DO len = 1, 180 - IF(name(len) .EQ. C_NULL_CHAR) EXIT - ENDDO - - len = len - 1 - - ! Check for correct object information - - idx = op_data%idx - - DO i = 1, len - IF(op_data%info(idx)%path(i)(1:1) .NE. name(i)(1:1))THEN - visit_obj_cb = -1 - RETURN - ENDIF - - IF(op_data%info(idx)%type_obj .NE. oinfo%type)THEN - visit_obj_cb = -1 - RETURN - ENDIF - - ENDDO - - ! Advance to next location in expected output - op_data%idx = op_data%idx + 1 - - END FUNCTION visit_obj_cb - -END MODULE visit_cb - - -MODULE TH5O_F03 - -CONTAINS -!*************************************************************** -!** -!** test_h5o_refcount(): Test H5O refcounting functions. -!** -!*************************************************************** - -SUBROUTINE test_h5o_refcount(total_error) - - USE HDF5 - USE TH5_MISC - USE ISO_C_BINDING - IMPLICIT NONE - - INTEGER, INTENT(INOUT) :: total_error - - CHARACTER(LEN=11), PARAMETER :: FILENAME = "th5o_ref.h5" - INTEGER, PARAMETER :: DIM0 = 5 - INTEGER, PARAMETER :: DIM1 = 10 - INTEGER(hid_t) :: fid ! HDF5 File ID - INTEGER(hid_t) :: grp, dset, dtype, dspace ! Object identifiers - TYPE(h5o_info_t) :: oinfo ! Object info struct - INTEGER(hsize_t), DIMENSION(1:2) :: dims - INTEGER :: error ! Value returned from API calls - - ! Create a new HDF5 file - CALL h5fcreate_f(FILENAME,H5F_ACC_TRUNC_F,fid,error) - CALL check("h5fcreate_f", error, total_error) - - ! Create a group, dataset, and committed datatype within the file - ! Create the group - CALL h5gcreate_f(fid, "group", grp, error) - CALL check("h5gcreate_f",error, total_error) - - ! Commit the type inside the group - CALL h5tcopy_f(H5T_NATIVE_INTEGER, dtype, error) - CALL check("H5Tcopy_f",error, total_error) - CALL h5tcommit_f(fid, "datatype", dtype, error) - CALL check("h5tcommit_f", error, total_error) - - ! Create the data space for the dataset. - dims(1) = DIM0 - dims(2) = DIM1 - - CALL h5screate_simple_f(2, dims, dspace, error) - CALL check("h5screate_simple_f", error, total_error) - - ! Create the dataset. - CALL h5dcreate_f(fid, "dataset", H5T_NATIVE_INTEGER, dspace, dset, error) - CALL check("h5dcreate_f", error, total_error) - CALL h5sclose_f(dspace, error) - CALL check("h5sclose_f", error, total_error) - - ! Get ref counts for each object. They should all be 1, since each object has a hard link. - CALL h5oget_info_by_name_f(fid, "group", oinfo, error) - CALL check("h5oget_info_by_name_f", error, total_error) - IF(oinfo%rc.NE.1)THEN - CALL check("h5oget_info_by_name_f", -1, total_error) - ENDIF - CALL h5oget_info_by_name_f(fid, "datatype", oinfo, error) - CALL check("h5oget_info_by_name_f", error, total_error) - IF(oinfo%rc.NE.1)THEN - CALL check("h5oget_info_by_name_f", -1, total_error) - ENDIF - CALL h5oget_info_by_name_f(fid, "dataset", oinfo, error) - CALL check("h5oget_info_by_name_f", error, total_error) - IF(oinfo%rc.NE.1)THEN - CALL check("h5oget_info_by_name_f", -1, total_error) - ENDIF - - ! Check h5oget_info - CALL h5oget_info_f(grp, oinfo, error) - CALL check("h5oget_info_f", error, total_error) - IF(oinfo%rc.NE.1)THEN - CALL check("h5oget_info_f", -1, total_error) - ENDIF - IF(oinfo%type.NE.H5O_TYPE_GROUP_F)THEN - CALL check("h5oget_info_f", -1, total_error) - ENDIF - - ! Increment each object's reference count. - CALL h5oincr_refcount_f(grp, error) - CALL check("h5oincr_refcount_f", error, total_error) - CALL h5oincr_refcount_f(dtype, error) - CALL check("h5oincr_refcount_f", error, total_error) - CALL h5oincr_refcount_f(dset, error) - CALL check("h5oincr_refcount_f", error, total_error) - - ! Get ref counts for each object. They should all be 2 now. - CALL h5oget_info_by_name_f(fid, "group", oinfo, error) - CALL check("h5oget_info_by_name_f", error, total_error) - IF(oinfo%rc.NE.2)THEN - CALL check("h5oget_info_by_name_f", -1, total_error) - ENDIF - CALL h5oget_info_by_name_f(fid, "datatype", oinfo, error) - CALL check("h5oget_info_by_name_f", error, total_error) - IF(oinfo%rc.NE.2)THEN - CALL check("h5oget_info_by_name_f", -1, total_error) - ENDIF - CALL h5oget_info_by_name_f(fid, "dataset", oinfo, error) - CALL check("h5oget_info_by_name_f", error, total_error) - IF(oinfo%rc.NE.2)THEN - CALL check("h5oget_info_by_name_f", -1, total_error) - ENDIF - - ! Decrement the reference counts and check that they decrease back to 1. - CALL h5odecr_refcount_f(grp, error) - CALL check("h5oincr_refcount_f", error, total_error) - CALL h5odecr_refcount_f(dtype, error) - CALL check("h5oincr_refcount_f", error, total_error) - CALL h5odecr_refcount_f(dset, error) - CALL check("h5oincr_refcount_f", error, total_error) - - CALL h5oget_info_by_name_f(fid, "group", oinfo, error) - CALL check("h5oget_info_by_name_f", error, total_error) - IF(oinfo%rc.NE.1)THEN - CALL check("h5oget_info_by_name_f", -1, total_error) - ENDIF - CALL h5oget_info_by_name_f(fid, "datatype", oinfo, error) - CALL check("h5oget_info_by_name_f", error, total_error) - IF(oinfo%rc.NE.1)THEN - CALL check("h5oget_info_by_name_f", -1, total_error) - ENDIF - CALL h5oget_info_by_name_f(fid, "dataset", oinfo, error) - CALL check("h5oget_info_by_name_f", error, total_error) - IF(oinfo%rc.NE.1)THEN - CALL check("h5oget_info_by_name_f", -1, total_error) - ENDIF - - CALL h5gclose_f(grp, error) - CALL check("h5gclose_f",error, total_error) - CALL h5tclose_f(dtype, error) - CALL check("h5tclose_f",error, total_error) - CALL h5dclose_f(dset, error) - CALL check("h5dclose_f",error, total_error) - CALL h5fclose_f(fid, error) - CALL check("h5fclose_f",error, total_error) - -END SUBROUTINE test_h5o_refcount - -!**************************************************************** -!** -!** test_h5o_refcount(): Test H5O visit functions. -!** -!**************************************************************** - -SUBROUTINE obj_visit(total_error) - - USE HDF5 - USE TH5_MISC - - USE visit_cb - USE ISO_C_BINDING - IMPLICIT NONE - - INTEGER, INTENT(INOUT) :: total_error - - TYPE(ovisit_ud_t), TARGET :: udata ! User-data for visiting - INTEGER(hid_t) :: fid = -1 - TYPE(C_PTR) :: f_ptr - TYPE(C_FUNPTR) :: fun_ptr - CHARACTER(LEN=180) :: object_name - INTEGER :: ret_val - INTEGER :: error - - ! Construct "interesting" file to visit - CALL build_visit_file(fid) - - ! Inialize udata for testing purposes - udata%info(1)%path(1:1) ="." - udata%info(1)%type_obj = H5O_TYPE_GROUP_F - udata%info(2)%path(1:12) = & - (/"D","a","t","a","s","e","t","_","z","e","r","o"/) - udata%info(2)%type_obj =H5O_TYPE_DATASET_F - udata%info(3)%path(1:6) = & - (/"G","r","o","u","p","1"/) - udata%info(3)%type_obj = H5O_TYPE_GROUP_F - udata%info(4)%path(1:18) =& - (/"G","r","o","u","p","1","/","D","a","t","a","s","e","t","_","o","n","e"/) - udata%info(4)%type_obj = H5O_TYPE_DATASET_F - udata%info(5)%path(1:13) =& - (/"G","r","o","u","p","1","/","G","r","o","u","p","2"/) - udata%info(5)%type_obj = H5O_TYPE_GROUP_F - udata%info(6)%path(1:25) =& - (/"G","r","o","u","p","1","/","G","r","o","u","p","2","/","D","a","t","a","s","e","t","_","t","w","o"/) - udata%info(6)%type_obj = H5O_TYPE_DATASET_F - udata%info(7)%path(1:22) =& - (/"G","r","o","u","p","1","/","G","r","o","u","p","2","/","T","y","p","e","_","t","w","o"/) - udata%info(7)%type_obj = H5O_TYPE_NAMED_DATATYPE_F - udata%info(8)%path(1:15) =& - (/"G","r","o","u","p","1","/","T","y","p","e","_","o","n","e"/) - udata%info(8)%type_obj = H5O_TYPE_NAMED_DATATYPE_F - udata%info(9)%path(1:9) =& - (/"T","y","p","e","_","z","e","r","o"/) - udata%info(9)%type_obj = H5O_TYPE_NAMED_DATATYPE_F - - ! Visit all the objects reachable from the root group (with file ID) - udata%idx = 1 - - fun_ptr = C_FUNLOC(visit_obj_cb) - f_ptr = C_LOC(udata) - - ! Test h5ovisit_f - CALL h5ovisit_f(fid, H5_INDEX_NAME_F, H5_ITER_INC_F, fun_ptr, f_ptr, ret_val, error) - CALL check("h5ovisit_f", error, total_error) - IF(ret_val.LT.0)THEN - CALL check("h5ovisit_f", -1, total_error) - ENDIF - - ! Test h5ovisit_by_name_f - - object_name = "/" - udata%idx = 1 - - CALL h5ovisit_by_name_f(fid, object_name, H5_INDEX_NAME_F, H5_ITER_INC_F, fun_ptr, f_ptr, ret_val, error) - CALL check("h5ovisit_by_name_f", error, total_error) - IF(ret_val.LT.0)THEN - CALL check("h5ovisit_by_name_f", -1, total_error) - ENDIF - - CALL h5fclose_f(fid, error) - CALL check("h5fclose_f",error, total_error) - -END SUBROUTINE obj_visit - -!**************************************************************** -!** -!** test_h5o_refcount(): Test H5O info functions. -!** -!**************************************************************** - -SUBROUTINE obj_info(total_error) - - USE HDF5 - USE TH5_MISC - USE ISO_C_BINDING - IMPLICIT NONE - - INTEGER, INTENT(INOUT) :: total_error - - INTEGER(hid_t) :: fid = -1 ! File ID - INTEGER(hid_t) :: gid = -1, gid2 = -1 ! Group IDs - INTEGER(hid_t) :: did ! Dataset ID - INTEGER(hid_t) :: sid ! Dataspace ID - TYPE(hobj_ref_t_f), TARGET :: wref ! Reference to write - TYPE(hobj_ref_t_f), TARGET :: rref ! Reference to read - TYPE(H5O_info_t) :: oinfo ! Object info struct - INTEGER :: error - TYPE(C_PTR) :: f_ptr - - CHARACTER(LEN=6) :: GROUPNAME = "/group" - CHARACTER(LEN=6) :: GROUPNAME2 = "group2" - CHARACTER(LEN=6) :: GROUPNAME3 = "group3" - CHARACTER(LEN=5) :: DSETNAME = "/dset" - CHARACTER(LEN=5) :: DSETNAME2 = "dset2" - - ! Create file with a group and a dataset containing an object reference to the group - CALL h5fcreate_f("get_info.h5", H5F_ACC_TRUNC_F, fid, error) - CALL check("h5fcreate_f",error, total_error) - - ! Create dataspace to use for dataset - CALL h5screate_f(H5S_SCALAR_F, sid, error) - CALL check("h5screate_f",error,total_error) - - ! Create group to refer to - CALL h5gcreate_f(fid, GROUPNAME, gid, error) - CALL check("h5gcreate_f",error,total_error) - - ! Create nested groups - CALL h5gcreate_f(gid, GROUPNAME2, gid2, error) - CALL check("h5gcreate_f",error,total_error) - CALL h5gclose_f(gid2, error) - CALL check("h5gclose_f",error,total_error) - - CALL h5gcreate_f(gid, GROUPNAME3, gid2, error) - CALL check("h5gcreate_f",error,total_error) - CALL h5gclose_f(gid2, error) - CALL check("h5gclose_f",error,total_error) - - ! Create bottom dataset - CALL h5dcreate_f(gid, DSETNAME2, H5T_NATIVE_INTEGER, sid, did, error) - CALL check("h5dcreate_f",error, total_error) - - CALL h5dclose_f(did, error) - CALL check("h5dclose_f", error, total_error) - - CALL h5gclose_f(gid, error) - CALL check("h5gclose_f",error,total_error) - - ! Create dataset - CALL h5dcreate_f(fid, DSETNAME, H5T_STD_REF_OBJ, sid, did, error) - CALL check("h5dcreate_f",error, total_error) - - f_ptr = C_LOC(wref) - - ! Create reference to group - CALL h5rcreate_f(fid, GROUPNAME, H5R_OBJECT_F, f_ptr, error) - CALL check("h5rcreate_f",error, total_error) - - ! Write reference to disk - CALL h5dwrite_f(did, H5T_STD_REF_OBJ, f_ptr, error) - CALL check("h5dwrite_f",error, total_error) - - ! Close objects - CALL h5dclose_f(did, error) - CALL check("h5dclose_f", error, total_error) - CALL h5sclose_f(sid, error) - CALL check("h5sclose_f", error, total_error) - CALL h5fclose_f(fid, error) - CALL check("h5fclose_f", error, total_error) - - ! Re-open file - CALL h5fopen_f("get_info.h5", H5F_ACC_RDWR_F, fid, error) - CALL check("h5fopen_f", error, total_error) - - ! Re-open dataset - CALL h5dopen_f(fid, DSETNAME, did, error) - CALL check("h5dopen_f", error, total_error) - - ! Read in the reference - - f_ptr = C_LOC(rref) - - CALL h5dread_f(did, H5T_STD_REF_OBJ, f_ptr, error) - CALL check("H5Dread_f",error, total_error) - - ! Dereference to get the group - - CALL h5rdereference_f(did, H5R_OBJECT_F, f_ptr, gid, error) - CALL check("h5rdereference_f", error, total_error) - - CALL h5oget_info_by_idx_f(gid, ".", H5_INDEX_NAME_F, H5_ITER_INC_F, 0_hsize_t, oinfo, error) - CALL check("h5oget_info_by_idx_f", error, total_error) - - IF(oinfo%rc.NE.1)THEN - CALL check("h5oget_info_by_idx_f", -1, total_error) - ENDIF - - IF(oinfo%type.NE.H5O_TYPE_DATASET_F)THEN - CALL check("h5oget_info_by_idx_f", -1, total_error) - ENDIF - - ! Close objects - CALL h5dclose_f(did, error) - CALL check("h5dclose_f", error, total_error) - CALL h5gclose_f(gid, error) - CALL check("h5sclose_f", error, total_error) - CALL h5fclose_f(fid, error) - CALL check("h5fclose_f", error, total_error) - -END SUBROUTINE obj_info - -!------------------------------------------------------------------------- -! Function: build_visit_file -! -! Purpose: Build an "interesting" file to use for visiting links & objects -! -! Programmer: M. Scot Breitenfeld -! July 12, 2012 -! NOTE: Adapted from C test. -! -!------------------------------------------------------------------------- -! - -SUBROUTINE build_visit_file(fid) - - USE HDF5 - USE TH5_MISC - IMPLICIT NONE - - INTEGER(hid_t) :: fid ! File ID - INTEGER(hid_t) :: gid = -1, gid2 = -1 ! Group IDs - INTEGER(hid_t) :: sid = -1 ! Dataspace ID - INTEGER(hid_t) :: did = -1 ! Dataset ID - INTEGER(hid_t) :: tid = -1 ! Datatype ID - CHARACTER(LEN=20) :: filename = 'visit.h5' - INTEGER :: error - - ! Create file for visiting - CALL H5Fcreate_f(filename, H5F_ACC_TRUNC_F, fid, error) - - ! Create group - CALL H5Gcreate_f(fid, "/Group1", gid, error) - - ! Create nested group - CALL H5Gcreate_f(gid, "Group2", gid2, error) - - ! Close groups - CALL h5gclose_f(gid2, error) - CALL h5gclose_f(gid, error) - - ! Create soft links to groups created - CALL H5Lcreate_soft_f("/Group1", fid, "/soft_one", error) - CALL H5Lcreate_soft_f("/Group1/Group2", fid, "/soft_two", error) - - ! Create dangling soft link - CALL H5Lcreate_soft_f("nowhere", fid, "/soft_dangle", error) - - ! Create hard links to all groups - CALL H5Lcreate_hard_f(fid, "/", fid, "hard_zero", error) - CALL H5Lcreate_hard_f(fid, "/Group1", fid, "hard_one", error) - CALL H5Lcreate_hard_f(fid, "/Group1/Group2", fid, "hard_two", error) - - ! Create loops w/hard links - CALL H5Lcreate_hard_f(fid, "/Group1", fid, "/Group1/hard_one", error) - CALL H5Lcreate_hard_f(fid, "/", fid, "/Group1/Group2/hard_zero", error) - - ! Create dataset in each group - CALL H5Screate_f(H5S_SCALAR_F, sid, error) - - CALL H5Dcreate_f(fid, "/Dataset_zero", H5T_NATIVE_INTEGER, sid, did, error) - CALL H5Dclose_f(did, error) - - CALL H5Dcreate_f(fid, "/Group1/Dataset_one", H5T_NATIVE_INTEGER, sid, did, error) - CALL H5Dclose_f(did, error) - - CALL H5Dcreate_f(fid, "/Group1/Group2/Dataset_two", H5T_NATIVE_INTEGER, sid, did, error) - CALL H5Dclose_f(did, error) - - CALL H5Sclose_f(sid, error) - - ! Create named datatype in each group - CALL H5Tcopy_f(H5T_NATIVE_INTEGER, tid, error) - - CALL H5Tcommit_f(fid, "/Type_zero", tid, error) - CALL H5Tclose_f(tid, error) - - CALL H5Tcopy_f(H5T_NATIVE_INTEGER, tid, error) - CALL H5Tcommit_f(fid, "/Group1/Type_one", tid, error) - CALL H5Tclose_f(tid, error) - - CALL H5Tcopy_f(H5T_NATIVE_INTEGER, tid, error) - CALL H5Tcommit_f(fid, "/Group1/Group2/Type_two", tid, error) - CALL H5Tclose_f(tid, error) - -END SUBROUTINE build_visit_file - -END MODULE TH5O_F03 diff --git a/fortran/test/tH5P.F90 b/fortran/test/tH5P.F90 new file mode 100644 index 0000000..39d8c1e --- /dev/null +++ b/fortran/test/tH5P.F90 @@ -0,0 +1,677 @@ +!****h* root/fortran/test/tH5P.f90 +! +! NAME +! tH5P.f90 +! +! FUNCTION +! Basic testing of Fortran 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. * +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! +! CONTAINS SUBROUTINES +! external_test, multi_file_test +! +!***** +MODULE TH5P + USE HDF5 ! This module contains all necessary modules + USE TH5_MISC + USE TH5_MISC_GEN + +CONTAINS + +SUBROUTINE external_test(cleanup, total_error) + +! This subroutine tests following functionalities: +! h5pset_external_f, h5pget_external_count_f, +! h5pget_external_f + + + IMPLICIT NONE + LOGICAL, INTENT(IN) :: cleanup + INTEGER, INTENT(INOUT) :: total_error + + CHARACTER(LEN=8), PARAMETER :: filename = "external" + CHARACTER(LEN=80) :: fix_filename + INTEGER(HID_T) :: file_id + INTEGER(HID_T) :: plist_id + INTEGER(HID_T) :: space_id + INTEGER(HID_T) :: dataset_id + INTEGER(HSIZE_T), DIMENSION(1) :: cur_size !data space current size + INTEGER(HSIZE_T), DIMENSION(1) :: max_size !data space maximum size + CHARACTER(LEN=256) :: name !external file name + INTEGER(OFF_T) :: file_offset !external file offset + INTEGER(HSIZE_T) :: file_size !sizeof external file segment + INTEGER :: error !error code + INTEGER(SIZE_T) :: int_size !size of integer + INTEGER(HSIZE_T) :: file_bytes !Number of bytes reserved + !in the file for the data + INTEGER :: RANK = 1 !dataset rank + INTEGER :: count !number of external files for the + !specified dataset + INTEGER(SIZE_T) :: namesize + INTEGER(HSIZE_T) :: size, buf_size + INTEGER :: idx + + buf_size = 4*1024*1024 + + ! + !Create file "external.h5" using default properties. + ! + CALL h5_fixname_f(filename, fix_filename, H5P_DEFAULT_F, error) + IF (error .NE. 0) THEN + STOP "Cannot modify filename" + ENDIF + CALL h5fcreate_f(fix_filename, H5F_ACC_TRUNC_F, file_id, error) + CALL check("h5fcreate_f",error,total_error) + + CALL h5pcreate_f(H5P_DATASET_XFER_F, plist_id, error) + CALL check("h5pcreate_f", error, total_error) + CALL h5pset_buffer_f(plist_id, buf_size, error) + CALL check("h5pset_buffer_f", error, total_error) + CALL h5pget_buffer_f(plist_id, size, error) + CALL check("h5pget_buffer_f", error, total_error) + IF (size .NE.buf_size) THEN + total_error = total_error + 1 + WRITE(*,*) "h5pget_buffer_f returned wrong size, error" + ENDIF + CALL h5pclose_f(plist_id, error) + CALL check("h5pclose_f", error, total_error) + + CALL h5pcreate_f(H5P_DATASET_CREATE_F, plist_id, error) + CALL check("h5pcreate_f",error,total_error) + cur_size(1) =100 + max_size(1) = 100 + CALL h5tget_size_f(H5T_NATIVE_INTEGER, int_size, error) + CALL check("h5tget_size_f",error,total_error) + file_size = int_size * max_size(1) + CALL h5pset_external_f(plist_id, "ext1.data", INT(0,off_t), file_size, error) + CALL check("h5pset_external_f",error,total_error) + CALL h5screate_simple_f(RANK, cur_size, space_id, error, max_size) + CALL check("h5screate_simple_f", error, total_error) + CALL h5dcreate_f(file_id, "dset1", H5T_NATIVE_INTEGER, space_id, & + dataset_id, error, plist_id) + CALL check("h5dcreate_f", error, total_error) + + CALL h5dclose_f(dataset_id, error) + CALL check("h5dclose_f", error, total_error) + CALL h5pclose_f(plist_id, error) + CALL check("h5pclose_f", error, total_error) + CALL h5sclose_f(space_id, error) + CALL check("h5sclose_f", error, total_error) + CALL h5fclose_f(file_id, error) + + CALL h5fopen_f(fix_filename, H5F_ACC_RDWR_F, file_id, error) + CALL h5dopen_f(file_id, "dset1", dataset_id, error) + CALL check("h5dopen_f",error,total_error) + + ! Read dataset creation information + CALL h5dget_create_plist_f(dataset_id, plist_id, error) + CALL check("h5dget_create_plist_f",error,total_error) + CALL h5pget_external_count_f(plist_id, count, error) + CALL check("h5pget_external_count_f",error,total_error) + IF(count .NE. 1 ) THEN + WRITE (*,*) "got external_count is not correct" + total_error = total_error + 1 + END IF + namesize = 10 + idx = 0 + CALL h5pget_external_f(plist_id, idx, namesize, name, file_offset, & + file_bytes, error) + CALL check("h5pget_external_f",error,total_error) + IF(file_offset .NE. 0 ) THEN + WRITE (*,*) "got external file offset is not correct" + total_error = total_error + 1 + END IF + IF(file_bytes .NE. file_size ) THEN + WRITE (*,*) "got external file size is not correct" + total_error = total_error + 1 + END IF + + CALL h5dclose_f(dataset_id, error) + CALL check("h5dclose_f", error, total_error) + CALL h5pclose_f(plist_id, error) + CALL check("h5pclose_f", error, total_error) + CALL h5fclose_f(file_id, error) + CALL check("h5fclose_f", error, total_error) + + IF(cleanup) CALL h5_cleanup_f(filename, H5P_DEFAULT_F, error) + CALL check("h5_cleanup_f", error, total_error) + RETURN +END SUBROUTINE external_test + +SUBROUTINE multi_file_test(cleanup, total_error) + + IMPLICIT NONE + LOGICAL, INTENT(IN) :: cleanup + INTEGER, INTENT(INOUT) :: total_error + + CHARACTER(LEN=9), PARAMETER :: filename = "multidset" ! File name + CHARACTER(LEN=80) :: fix_filename + CHARACTER(LEN=4), PARAMETER :: dsetname = "dset" ! Dataset name + + INTEGER(HID_T) :: file_id ! File identifier + INTEGER(HID_T) :: dset_id ! Dataset identifier + INTEGER(HID_T) :: dspace_id ! Dataspace identifier + INTEGER(HID_T) :: dtype_id ! Datatype identifier + INTEGER(HID_T) :: fapl, fapl_1 ! File access property list identifier + INTEGER, DIMENSION(0:H5FD_MEM_NTYPES_F-1) :: memb_map, memb_map_out + INTEGER(HID_T), DIMENSION(0:H5FD_MEM_NTYPES_F-1) :: memb_fapl, memb_fapl_out + CHARACTER(LEN=20), DIMENSION(0:H5FD_MEM_NTYPES_F-1) :: memb_name, memb_name_out + REAL, DIMENSION(0:H5FD_MEM_NTYPES_F-1) :: memb_addr, memb_addr_out + !INTEGER(HADDR_T), DIMENSION(0:H5FD_MEM_NTYPES_F) :: memb_addr + LOGICAL :: relax = .TRUE. + LOGICAL :: relax_out = .TRUE. + + INTEGER(HSIZE_T), DIMENSION(2) :: dims = (/4,6/) ! Dataset dimensions + INTEGER :: rank = 2 ! Dataset rank + + INTEGER, DIMENSION(4,6) :: dset_data, data_out ! Data buffers + INTEGER :: error ! Error flag + INTEGER(HID_T) :: driver + INTEGER :: i, j !general purpose integers + INTEGER(HSIZE_T), DIMENSION(2) :: data_dims + INTEGER :: mdc_nelmts + INTEGER(SIZE_T) :: rdcc_nelmts + INTEGER(SIZE_T) :: rdcc_nbytes + REAL :: rdcc_w0 + memb_fapl = H5P_DEFAULT_F + memb_map = H5FD_MEM_SUPER_F + memb_addr = 0. + memb_map(H5FD_MEM_SUPER_F) = H5FD_MEM_SUPER_F + memb_addr(H5FD_MEM_SUPER_F) = 0. + memb_map(H5FD_MEM_BTREE_F) = H5FD_MEM_BTREE_F + memb_addr(H5FD_MEM_BTREE_F) = 0.1 + memb_map(H5FD_MEM_DRAW_F) = H5FD_MEM_DRAW_F + memb_addr(H5FD_MEM_DRAW_F) = 0.5 + memb_map(H5FD_MEM_GHEAP_F) = H5FD_MEM_GHEAP_F + memb_addr(H5FD_MEM_GHEAP_F) = 0.2 + memb_map(H5FD_MEM_LHEAP_F) = H5FD_MEM_LHEAP_F + memb_addr(H5FD_MEM_LHEAP_F) = 0.3 + memb_map(H5FD_MEM_OHDR_F) = H5FD_MEM_OHDR_F + memb_addr(H5FD_MEM_OHDR_F) = 0.4 + + memb_name = ' ' + memb_name(H5FD_MEM_SUPER_F) = '%s-s.h5' + memb_name(H5FD_MEM_BTREE_F) = '%s-b.h5' + memb_name(H5FD_MEM_DRAW_F) = '%s-r.h5' + memb_name(H5FD_MEM_GHEAP_F) = '%s-g.h5' + memb_name(H5FD_MEM_LHEAP_F) = '%s-l.h5' + memb_name(H5FD_MEM_OHDR_F) = '%s-o.h5' + + ! + ! Initialize the dset_data array. + ! + DO i = 1, 4 + DO j = 1, 6 + dset_data(i,j) = (i-1)*6 + j + END DO + END DO + + ! + ! Create a new file using default properties. + ! + CALL h5_fixname_f(filename, fix_filename, H5P_DEFAULT_F, error) + IF (error .NE. 0) THEN + WRITE(*,*) "Cannot modify filename" + STOP + ENDIF + CALL h5pcreate_f(H5P_FILE_ACCESS_F, fapl, error) + CALL check("h5pcreate_f", error, total_error) + CALL h5pset_fapl_multi_f(fapl, memb_map, memb_fapl, memb_name, memb_addr, relax, error) + CALL check("h5pset_fapl_multi_f", error, total_error) + CALL h5pget_fapl_multi_f(fapl, memb_map_out, memb_fapl_out, memb_name_out, & + memb_addr_out, relax_out, error) + CALL check("h5pget_fapl_multi_f", error, total_error) + CALL h5pget_driver_f(fapl, driver, error) + CALL check("h5pget_driver_f",error, total_error) + IF(driver .NE. H5FD_MULTI_F) THEN + WRITE(*,*) "Wrong value for driver" + ENDIF + ! + ! Let's check h5pget(set)cache_f APIs here for now + ! + CALL h5pget_cache_f(fapl, mdc_nelmts, rdcc_nelmts, rdcc_nbytes, & + rdcc_w0, error) + CALL check("h5pget_cache_f", error, total_error) + + ! + ! Set cache to some number + ! + rdcc_nbytes = 1024*1024 + CALL h5pset_cache_f(fapl, mdc_nelmts, rdcc_nelmts, rdcc_nbytes, & + rdcc_w0, error) + CALL check("h5pset_cache_f", error, total_error) + CALL h5fcreate_f(fix_filename, H5F_ACC_TRUNC_F, file_id, error, access_prp = fapl) + CALL check("h5fcreate_f", error, total_error) + IF(error .NE. 0) THEN + WRITE(*,*) "Cannot create file using multi-file driver... Exiting...." + total_error = 1 + CALL h5pclose_f(fapl, error) + RETURN + ENDIF + ! + ! Create the dataspace. + ! + CALL h5screate_simple_f(rank, dims, dspace_id, error) + CALL check("h5screate_simple_f", error, total_error) + ! + ! Create the dataset with default properties. + ! + CALL h5dcreate_f(file_id, dsetname, H5T_NATIVE_INTEGER, dspace_id, & + dset_id, error) + CALL check("h5dcreate_f", error, total_error) + ! + ! Write the dataset. + ! + data_dims(1) = 4 + data_dims(2) = 6 + CALL h5dwrite_f(dset_id, H5T_NATIVE_INTEGER, dset_data, data_dims, error) + CALL check("h5dwrite_f", error, total_error) + ! + ! End access to the dataset and release resources used by it. + ! + CALL h5dclose_f(dset_id, error) + CALL check("h5dclose_f", error, total_error) + + ! + ! Terminate access to the data space. + ! + CALL h5sclose_f(dspace_id, error) + CALL check("h5sclose_f", error, total_error) + + ! + ! Close the file. + ! + CALL h5fclose_f(file_id, error) + CALL check("h5fclose_f", error, total_error) + CALL h5pclose_f(fapl, error) + CALL check("h5pclose_f", error, total_error) + ! + ! Open the existing file. + ! + CALL h5pcreate_f(H5P_FILE_ACCESS_F, fapl, error) + CALL check("h5pcreate_f", error, total_error) + CALL h5pset_fapl_multi_f(fapl, memb_map, memb_fapl, memb_name, memb_addr, relax, error) + CALL check("h5pset_fapl_multi_f", error, total_error) + CALL h5fopen_f (fix_filename, H5F_ACC_RDWR_F, file_id, error, access_prp = fapl) + CALL check("h5fopen_f", error, total_error) + ! + CALL h5fget_access_plist_f(file_id, fapl_1, error) + CALL check("h5fget_access_plist_f", error, total_error) + !It doesn't work on Windows. + !CALL h5pget_fapl_multi_f(fapl_1, memb_map_out, memb_fapl_out, memb_name_out, & + ! memb_addr_out, relax_out, error) + ! write(*,*) memb_map_out + ! write(*,*) memb_fapl_out + ! write(*,*) memb_name_out + ! write(*,*) memb_addr_out + ! CALL check("h5pget_fapl_multi_f", error, total_error) + + ! + ! Open the existing dataset. + ! + CALL h5dopen_f(file_id, dsetname, dset_id, error) + CALL check("h5dopen_f", error, total_error) + + ! + ! Get the dataset type. + ! + CALL h5dget_type_f(dset_id, dtype_id, error) + CALL check("h5dget_type_f", error, total_error) + + ! + ! Get the data space. + ! + CALL h5dget_space_f(dset_id, dspace_id, error) + CALL check("h5dget_space_f", error, total_error) + + ! + ! Read the dataset. + ! + CALL h5dread_f(dset_id, H5T_NATIVE_INTEGER, data_out, data_dims, error) + CALL check("h5dread_f", error, total_error) + + ! + !Compare the data. + ! + DO i = 1, 4 + DO j = 1, 6 + IF (data_out(i,j) .NE. dset_data(i, j)) THEN + WRITE(*, *) "dataset test error occured" + WRITE(*,*) "data read is not the same as the data writen" + END IF + END DO + END DO + + ! + ! End access to the dataset and release resources used by it. + ! + CALL h5dclose_f(dset_id, error) + CALL check("h5dclose_f", error, total_error) + + ! + ! Terminate access to the data space. + ! + CALL h5sclose_f(dspace_id, error) + CALL check("h5sclose_f", error, total_error) + + ! + ! Terminate access to the data type. + ! + CALL h5tclose_f(dtype_id, error) + CALL check("h5tclose_f", error, total_error) + ! + ! Close the file. + ! + CALL h5fclose_f(file_id, error) + CALL check("h5fclose_f", error, total_error) + CALL h5pclose_f(fapl, error) + CALL check("h5pclose_f", error, total_error) + CALL h5pclose_f(fapl_1, error) + CALL check("h5pclose_f", error, total_error) + IF(cleanup) CALL h5_cleanup_f(filename, H5P_DEFAULT_F, error) + CALL check("h5_cleanup_f", error, total_error) + + IF(cleanup) CALL h5_cleanup_f(filename//'.h5-b', H5P_DEFAULT_F, error) + CALL check("h5_cleanup_f", error, total_error) + IF(cleanup) CALL h5_cleanup_f(filename//'.h5-g', H5P_DEFAULT_F, error) + CALL check("h5_cleanup_f", error, total_error) + IF(cleanup) CALL h5_cleanup_f(filename//'.h5-l', H5P_DEFAULT_F, error) + CALL check("h5_cleanup_f", error, total_error) + IF(cleanup) CALL h5_cleanup_f(filename//'.h5-o', H5P_DEFAULT_F, error) + CALL check("h5_cleanup_f", error, total_error) + IF(cleanup) CALL h5_cleanup_f(filename//'.h5-r', H5P_DEFAULT_F, error) + CALL check("h5_cleanup_f", error, total_error) + IF(cleanup) CALL h5_cleanup_f(filename//'.h5-s', H5P_DEFAULT_F, error) + CALL check("h5_cleanup_f", error, total_error) + + RETURN +END SUBROUTINE multi_file_test + +!------------------------------------------------------------------------- +! Function: test_chunk_cache +! +! Purpose: Tests APIs: +! H5P_H5PSET_CHUNK_CACHE_F +! H5P_H5PGET_CHUNK_CACHE_F +! H5D_H5DGET_ACCESS_PLIST_F +! +! Return: Success: 0 +! Failure: -1 +! +! C Programmer: Neil Fortner +! Wednesday, October 29, 2008 +! +! FORTRAN Programmer: M. Scot Breitenfeld +! April 16, 2009 +!------------------------------------------------------------------------- +! +SUBROUTINE test_chunk_cache(cleanup, total_error) + + IMPLICIT NONE + LOGICAL, INTENT(IN) :: cleanup + INTEGER, INTENT(INOUT) :: total_error + + CHARACTER(LEN=14), PARAMETER :: filename="chunk_cache" + CHARACTER(LEN=80) :: fix_filename + INTEGER(hid_t) :: fid = -1 ! File ID + INTEGER(hid_t) :: fapl_local = -1 ! Local fapl + INTEGER(hid_t) :: fapl_def = -1 ! Default fapl + INTEGER(hid_t) :: dcpl = -1 ! Dataset creation property list ID + INTEGER(hid_t) :: dapl1 = -1 ! Dataset access property list ID + INTEGER(hid_t) :: dapl2 = -1 ! Dataset access property list ID + INTEGER(hid_t) :: sid = -1 ! Dataspace ID + INTEGER(hid_t) :: dsid = -1 ! Dataset ID + INTEGER(hsize_t), DIMENSION(1:1) :: chunk_dim, NDIM = (/100/) ! Dataset and chunk dimensions + INTEGER(size_t) :: nslots_1, nslots_2, nslots_3, nslots_4 ! rdcc number of elements + INTEGER(size_t) :: nbytes_1, nbytes_2, nbytes_3, nbytes_4 ! rdcc number of bytes + INTEGER :: mdc_nelmts + INTEGER(size_t) ::nlinks ! Number of link traversals + REAL :: w0_1, w0_2, w0_3, w0_4 ! rdcc preemption policy + INTEGER :: error + INTEGER(size_t) rdcc_nelmts + INTEGER(size_t) rdcc_nbytes + REAL :: rdcc_w0 + + CALL h5_fixname_f(filename, fix_filename, H5P_DEFAULT_F, error) + IF (error .NE. 0) THEN + WRITE(*,*) "Cannot modify filename" + STOP + ENDIF + + ! Create a default fapl and dapl + CALL H5Pcreate_f(H5P_FILE_ACCESS_F, fapl_def, error) + CALL check("H5Pcreate_f", error, total_error) + CALL H5Pcreate_f(H5P_DATASET_ACCESS_F, dapl1, error) + CALL check("H5Pcreate_f", error, total_error) + + ! Verify that H5Pget_chunk_cache(dapl) returns the same values as are in + ! the default fapl. + ! + CALL H5Pget_cache_f(fapl_def, mdc_nelmts, nslots_1, nbytes_1, w0_1, error) + CALL check("H5Pget_cache_f", error, total_error) + CALL H5Pget_chunk_cache_f(dapl1, nslots_4, nbytes_4, w0_4, error) + CALL check("H5Pget_chunk_cache_f", error, total_error) + CALL verify("H5Pget_chunk_cache_f", nslots_1, nslots_4, total_error) + CALL verify("H5Pget_chunk_cache_f", nbytes_1, nbytes_4, total_error) + CALL verify("H5Pget_chunk_cache_f", w0_1, w0_4, total_error) + + ! Set a lapl property on dapl1 (to verify inheritance) + CALL H5Pset_nlinks_f(dapl1, 134_size_t , error) + CALL check("H5Pset_nlinks_f", error, total_error) + CALL H5Pget_nlinks_f(dapl1, nlinks, error) + CALL check("H5Pget_nlinks_f", error, total_error) + CALL verify("H5Pget_nlinks_f", INT(nlinks), 134, total_error) + + + CALL h5pcreate_f(H5P_FILE_ACCESS_F, fapl_local, error) + CALL check("h5pcreate_f", error, total_error) + ! Turn off the chunk cache, so all the chunks are immediately written to disk + CALL H5Pget_cache_f(fapl_local, mdc_nelmts, rdcc_nelmts, rdcc_nbytes, rdcc_w0, error) + CALL check("H5Pget_cache_f", error, total_error) + rdcc_nbytes = 0 + CALL H5Pset_cache_f(fapl_local, mdc_nelmts, rdcc_nelmts, rdcc_nbytes, rdcc_w0, error) + CALL check("H5Pset_cache_f", error, total_error) + + ! Set new rdcc settings on fapl! + nslots_2 = nslots_1 * 2 + nbytes_2 = nbytes_1 * 2 + w0_2 = w0_1 / 2. + + CALL H5Pset_cache_f(fapl_local, 0, nslots_2, nbytes_2, w0_2, error) + CALL check("H5Pset_cache_f", error, total_error) + + ! Create file + CALL H5Fcreate_f(fix_filename, H5F_ACC_TRUNC_F, fid, error, H5P_DEFAULT_F, fapl_local) + CALL check("H5Fcreate_f", error, total_error) + + ! Create dataset creation property list + CALL H5Pcreate_f(H5P_DATASET_CREATE_F, dcpl, error) + CALL check("H5Pcreate_f", error, total_error) + + ! Set chunking + chunk_dim(1) = 10 + CALL H5Pset_chunk_f(dcpl, 1, chunk_dim, error) + CALL check("H5Pset_chunk_f", error, total_error) + + ! Create 1-D dataspace + ndim(1) = 100 + CALL H5Screate_simple_f(1, ndim, sid, error) + CALL check("H5Pcreate_f", error, total_error) + + ! Create dataset with default dapl + CALL H5Dcreate_f(fid, "dset", H5T_NATIVE_INTEGER, sid, dsid, error, dcpl, H5P_DEFAULT_F, dapl1) + CALL check("H5Pcreate_f", error, total_error) + + ! Retrieve dapl from dataset, verify cache values are the same as on fapl_local + CALL H5Dget_access_plist_f(dsid, dapl2, error) + CALL check("H5Dget_access_plist_f", error, total_error) + CALL H5Pget_chunk_cache_f(dapl2, nslots_4, nbytes_4, w0_4, error) + CALL check("H5Pget_chunk_cache_f", error, total_error) + CALL verify("H5Pget_chunk_cache_f", INT(nslots_2), INT(nslots_4), total_error) + CALL verify("H5Pget_chunk_cache_f", INT(nbytes_2), INT(nbytes_4), total_error) + CALL verify("H5Pget_chunk_cache_f", w0_2, w0_4, total_error) + CALL H5Pclose_f(dapl2,error) + CALL check("H5Pclose_f", error, total_error) + + ! Set new values on dapl1. nbytes will be set to default, so the file + ! property will override this setting + + nslots_3 = nslots_2 * 2 + nbytes_3 = H5D_CHUNK_CACHE_NBYTES_DFLT_F + w0_3 = w0_2 / 2 + + CALL H5Pset_chunk_cache_f(dapl1, nslots_3, nbytes_3, w0_3, error) + CALL check("H5Pset_chunk_cache_f", error, total_error) + + ! Close dataset, reopen with dapl1. Note the use of a dapl with H5Oopen + CALL H5Dclose_f(dsid, error) + CALL H5Oopen_f(fid, "dset", dsid, error, dapl1) + + ! Retrieve dapl from dataset, verfiy cache values are the same as on dapl1 + ! + ! Note we rely on the knowledge that H5Pget_chunk_cache retrieves these + ! values directly from the dataset structure, and not from a copy of the + ! dapl used to open the dataset (which is not preserved). + ! + CALL H5Dget_access_plist_f(dsid, dapl2, error) + CALL check("H5Dget_access_plist_f", error, total_error) + CALL H5Pget_chunk_cache_f(dapl2, nslots_4, nbytes_4, w0_4, error) + CALL check("H5Pget_chunk_cache_f", error, total_error) + CALL verify("H5Pget_chunk_cache_f", INT(nslots_3), INT(nslots_4), total_error) + CALL verify("H5Pget_chunk_cache_f", INT(nbytes_2), INT(nbytes_4), total_error) + CALL verify("H5Pget_chunk_cache_f", w0_3, w0_4, total_error) + CALL H5Pclose_f(dapl2,error) + CALL check("H5Pclose_f", error, total_error) + + ! Close dataset, reopen with H5P_DEFAULT as dapl + CALL H5Dclose_f(dsid, error) + CALL check("H5Dclose_f", error, total_error) + CALL H5Oopen_f(fid, "dset", dsid, error) + CALL check("H5Oopen_f", error, total_error) + + ! Retrieve dapl from dataset, verfiy cache values are the same as on fapl_local + + CALL H5Dget_access_plist_f(dsid, dapl2, error) + CALL check("H5Dget_access_plist_f", error, total_error) + CALL H5Pget_chunk_cache_f(dapl2, nslots_4, nbytes_4, w0_4, error) + CALL check("H5Pget_chunk_cache_f", error, total_error) + CALL verify("H5Pget_chunk_cache_f", INT(nslots_2), INT(nslots_4), total_error) + CALL verify("H5Pget_chunk_cache_f", INT(nbytes_2), INT(nbytes_4), total_error) + CALL verify("H5Pget_chunk_cache_f", w0_2, w0_4, total_error) + CALL H5Pclose_f(dapl2,error) + CALL check("H5Pclose_f", error, total_error) + + ! Similary, test use of H5Dcreate2 with H5P_DEFAULT + CALL H5Dclose_f(dsid, error) + CALL check("H5Dclose_f", error, total_error) + + CALL H5Dcreate_f(fid, "dset2", H5T_NATIVE_INTEGER, sid, dsid, error, dcpl, H5P_DEFAULT_F, H5P_DEFAULT_F) + CALL check("H5Pcreate_f", error, total_error) + + CALL H5Dget_access_plist_f(dsid, dapl2, error) + CALL check("H5Dget_access_plist_f", error, total_error) + + CALL H5Pget_chunk_cache_f(dapl2, nslots_4, nbytes_4, w0_4, error) + CALL check("H5Pget_chunk_cache_f", error, total_error) + CALL verify("H5Pget_chunk_cache_f", INT(nslots_2), INT(nslots_4), total_error) + CALL verify("H5Pget_chunk_cache_f", INT(nbytes_2), INT(nbytes_4), total_error) + CALL verify("H5Pget_chunk_cache_f", w0_2, w0_4, total_error) + ! Don't close dapl2, we will use it in the next section + + ! Modify cache values on fapl_local + nbytes_3 = nbytes_2 * 2 + + CALL H5Pset_cache_f(fapl_local, 0, nslots_3, nbytes_3, w0_3, error) + CALL check("H5Pset_cache_f", error, total_error) + + ! Close and reopen file with new fapl_local + + CALL H5Dclose_f(dsid, error) + CALL check("H5Dclose_f", error, total_error) + CALL H5Fclose_f(fid,error) + CALL check("h5fclose_f", error, total_error) + + CALL H5Fopen_f (fix_filename, H5F_ACC_RDWR_F, fid, error, fapl_local) + CALL check("h5fopen_f", error, total_error) + + ! Verify that dapl2 retrieved earlier (using values from the old fapl) + ! sets its values in the new file (test use of H5Dopen2 with a dapl) + ! + + CALL h5dopen_f (fid, "dset", dsid, error, dapl2) + CALL check("h5dopen_f", error, total_error) + + CALL H5Pclose_f(dapl2,error) + CALL check("H5Pclose_f", error, total_error) ! Close dapl2, to avoid id leak + + CALL H5Dget_access_plist_f(dsid, dapl2, error) + CALL check("H5Dget_access_plist_f", error, total_error) + CALL H5Pget_chunk_cache_f(dapl2, nslots_4, nbytes_4, w0_4, error) + CALL check("H5Pget_chunk_cache_f", error, total_error) + CALL verify("H5Pget_chunk_cache_f", INT(nslots_2), INT(nslots_4), total_error) + CALL verify("H5Pget_chunk_cache_f", INT(nbytes_2), INT(nbytes_4), total_error) + CALL verify("H5Pget_chunk_cache_f", w0_2, w0_4, total_error) + + ! Test H5D_CHUNK_CACHE_NSLOTS_DEFAULT and H5D_CHUNK_CACHE_W0_DEFAULT + nslots_2 = H5D_CHUNK_CACHE_NSLOTS_DFLT_F + w0_2 = H5D_CHUNK_CACHE_W0_DFLT_F + + CALL H5Pset_chunk_cache_f(dapl2, nslots_2, nbytes_2, w0_2, error) + CALL check("H5Pset_chunk_cache_f", error, total_error) + + CALL H5Dclose_f(dsid, error) + CALL check("H5Dclose_f", error, total_error) + CALL h5dopen_f (fid, "dset", dsid, error, dapl2) + CALL check("h5dopen_f", error, total_error) + + CALL H5Pclose_f(dapl2,error) + CALL check("H5Pclose_f", error, total_error) + + CALL H5Dget_access_plist_f(dsid, dapl2, error) + CALL check("H5Dget_access_plist_f", error, total_error) + CALL H5Pget_chunk_cache_f(dapl2, nslots_4, nbytes_4, w0_4, error) + CALL check("H5Pget_chunk_cache_f", error, total_error) + CALL verify("H5Pget_chunk_cache_f", INT(nslots_3), INT(nslots_4), total_error) + CALL verify("H5Pget_chunk_cache_f", INT(nbytes_2), INT(nbytes_4), total_error) + CALL verify("H5Pget_chunk_cache_f", w0_3, w0_4, total_error) + +! Close + + CALL H5Dclose_f(dsid, error) + CALL check("H5Dclose_f", error, total_error) + CALL H5Sclose_f(sid,error) + CALL check("H5Sclose_f", error, total_error) + CALL H5Pclose_f(fapl_local,error) + CALL check("H5Pclose_f", error, total_error) + CALL H5Pclose_f(fapl_def,error) + CALL check("H5Pclose_f", error, total_error) + CALL H5Pclose_f(dapl1,error) + CALL check("H5Pclose_f", error, total_error) + CALL H5Pclose_f(dapl2,error) + CALL check("H5Pclose_f", error, total_error) + CALL H5Pclose_f(dcpl,error) + CALL check("H5Pclose_f", error, total_error) + CALL H5Fclose_f(fid,error) + CALL check("H5Fclose_f", error, total_error) + + IF(cleanup) CALL h5_cleanup_f(filename, H5P_DEFAULT_F, error) + CALL check("h5_cleanup_f", error, total_error) + +END SUBROUTINE test_chunk_cache + +END MODULE TH5P diff --git a/fortran/test/tH5P.f90 b/fortran/test/tH5P.f90 deleted file mode 100644 index 39d8c1e..0000000 --- a/fortran/test/tH5P.f90 +++ /dev/null @@ -1,677 +0,0 @@ -!****h* root/fortran/test/tH5P.f90 -! -! NAME -! tH5P.f90 -! -! FUNCTION -! Basic testing of Fortran 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. * -! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -! -! CONTAINS SUBROUTINES -! external_test, multi_file_test -! -!***** -MODULE TH5P - USE HDF5 ! This module contains all necessary modules - USE TH5_MISC - USE TH5_MISC_GEN - -CONTAINS - -SUBROUTINE external_test(cleanup, total_error) - -! This subroutine tests following functionalities: -! h5pset_external_f, h5pget_external_count_f, -! h5pget_external_f - - - IMPLICIT NONE - LOGICAL, INTENT(IN) :: cleanup - INTEGER, INTENT(INOUT) :: total_error - - CHARACTER(LEN=8), PARAMETER :: filename = "external" - CHARACTER(LEN=80) :: fix_filename - INTEGER(HID_T) :: file_id - INTEGER(HID_T) :: plist_id - INTEGER(HID_T) :: space_id - INTEGER(HID_T) :: dataset_id - INTEGER(HSIZE_T), DIMENSION(1) :: cur_size !data space current size - INTEGER(HSIZE_T), DIMENSION(1) :: max_size !data space maximum size - CHARACTER(LEN=256) :: name !external file name - INTEGER(OFF_T) :: file_offset !external file offset - INTEGER(HSIZE_T) :: file_size !sizeof external file segment - INTEGER :: error !error code - INTEGER(SIZE_T) :: int_size !size of integer - INTEGER(HSIZE_T) :: file_bytes !Number of bytes reserved - !in the file for the data - INTEGER :: RANK = 1 !dataset rank - INTEGER :: count !number of external files for the - !specified dataset - INTEGER(SIZE_T) :: namesize - INTEGER(HSIZE_T) :: size, buf_size - INTEGER :: idx - - buf_size = 4*1024*1024 - - ! - !Create file "external.h5" using default properties. - ! - CALL h5_fixname_f(filename, fix_filename, H5P_DEFAULT_F, error) - IF (error .NE. 0) THEN - STOP "Cannot modify filename" - ENDIF - CALL h5fcreate_f(fix_filename, H5F_ACC_TRUNC_F, file_id, error) - CALL check("h5fcreate_f",error,total_error) - - CALL h5pcreate_f(H5P_DATASET_XFER_F, plist_id, error) - CALL check("h5pcreate_f", error, total_error) - CALL h5pset_buffer_f(plist_id, buf_size, error) - CALL check("h5pset_buffer_f", error, total_error) - CALL h5pget_buffer_f(plist_id, size, error) - CALL check("h5pget_buffer_f", error, total_error) - IF (size .NE.buf_size) THEN - total_error = total_error + 1 - WRITE(*,*) "h5pget_buffer_f returned wrong size, error" - ENDIF - CALL h5pclose_f(plist_id, error) - CALL check("h5pclose_f", error, total_error) - - CALL h5pcreate_f(H5P_DATASET_CREATE_F, plist_id, error) - CALL check("h5pcreate_f",error,total_error) - cur_size(1) =100 - max_size(1) = 100 - CALL h5tget_size_f(H5T_NATIVE_INTEGER, int_size, error) - CALL check("h5tget_size_f",error,total_error) - file_size = int_size * max_size(1) - CALL h5pset_external_f(plist_id, "ext1.data", INT(0,off_t), file_size, error) - CALL check("h5pset_external_f",error,total_error) - CALL h5screate_simple_f(RANK, cur_size, space_id, error, max_size) - CALL check("h5screate_simple_f", error, total_error) - CALL h5dcreate_f(file_id, "dset1", H5T_NATIVE_INTEGER, space_id, & - dataset_id, error, plist_id) - CALL check("h5dcreate_f", error, total_error) - - CALL h5dclose_f(dataset_id, error) - CALL check("h5dclose_f", error, total_error) - CALL h5pclose_f(plist_id, error) - CALL check("h5pclose_f", error, total_error) - CALL h5sclose_f(space_id, error) - CALL check("h5sclose_f", error, total_error) - CALL h5fclose_f(file_id, error) - - CALL h5fopen_f(fix_filename, H5F_ACC_RDWR_F, file_id, error) - CALL h5dopen_f(file_id, "dset1", dataset_id, error) - CALL check("h5dopen_f",error,total_error) - - ! Read dataset creation information - CALL h5dget_create_plist_f(dataset_id, plist_id, error) - CALL check("h5dget_create_plist_f",error,total_error) - CALL h5pget_external_count_f(plist_id, count, error) - CALL check("h5pget_external_count_f",error,total_error) - IF(count .NE. 1 ) THEN - WRITE (*,*) "got external_count is not correct" - total_error = total_error + 1 - END IF - namesize = 10 - idx = 0 - CALL h5pget_external_f(plist_id, idx, namesize, name, file_offset, & - file_bytes, error) - CALL check("h5pget_external_f",error,total_error) - IF(file_offset .NE. 0 ) THEN - WRITE (*,*) "got external file offset is not correct" - total_error = total_error + 1 - END IF - IF(file_bytes .NE. file_size ) THEN - WRITE (*,*) "got external file size is not correct" - total_error = total_error + 1 - END IF - - CALL h5dclose_f(dataset_id, error) - CALL check("h5dclose_f", error, total_error) - CALL h5pclose_f(plist_id, error) - CALL check("h5pclose_f", error, total_error) - CALL h5fclose_f(file_id, error) - CALL check("h5fclose_f", error, total_error) - - IF(cleanup) CALL h5_cleanup_f(filename, H5P_DEFAULT_F, error) - CALL check("h5_cleanup_f", error, total_error) - RETURN -END SUBROUTINE external_test - -SUBROUTINE multi_file_test(cleanup, total_error) - - IMPLICIT NONE - LOGICAL, INTENT(IN) :: cleanup - INTEGER, INTENT(INOUT) :: total_error - - CHARACTER(LEN=9), PARAMETER :: filename = "multidset" ! File name - CHARACTER(LEN=80) :: fix_filename - CHARACTER(LEN=4), PARAMETER :: dsetname = "dset" ! Dataset name - - INTEGER(HID_T) :: file_id ! File identifier - INTEGER(HID_T) :: dset_id ! Dataset identifier - INTEGER(HID_T) :: dspace_id ! Dataspace identifier - INTEGER(HID_T) :: dtype_id ! Datatype identifier - INTEGER(HID_T) :: fapl, fapl_1 ! File access property list identifier - INTEGER, DIMENSION(0:H5FD_MEM_NTYPES_F-1) :: memb_map, memb_map_out - INTEGER(HID_T), DIMENSION(0:H5FD_MEM_NTYPES_F-1) :: memb_fapl, memb_fapl_out - CHARACTER(LEN=20), DIMENSION(0:H5FD_MEM_NTYPES_F-1) :: memb_name, memb_name_out - REAL, DIMENSION(0:H5FD_MEM_NTYPES_F-1) :: memb_addr, memb_addr_out - !INTEGER(HADDR_T), DIMENSION(0:H5FD_MEM_NTYPES_F) :: memb_addr - LOGICAL :: relax = .TRUE. - LOGICAL :: relax_out = .TRUE. - - INTEGER(HSIZE_T), DIMENSION(2) :: dims = (/4,6/) ! Dataset dimensions - INTEGER :: rank = 2 ! Dataset rank - - INTEGER, DIMENSION(4,6) :: dset_data, data_out ! Data buffers - INTEGER :: error ! Error flag - INTEGER(HID_T) :: driver - INTEGER :: i, j !general purpose integers - INTEGER(HSIZE_T), DIMENSION(2) :: data_dims - INTEGER :: mdc_nelmts - INTEGER(SIZE_T) :: rdcc_nelmts - INTEGER(SIZE_T) :: rdcc_nbytes - REAL :: rdcc_w0 - memb_fapl = H5P_DEFAULT_F - memb_map = H5FD_MEM_SUPER_F - memb_addr = 0. - memb_map(H5FD_MEM_SUPER_F) = H5FD_MEM_SUPER_F - memb_addr(H5FD_MEM_SUPER_F) = 0. - memb_map(H5FD_MEM_BTREE_F) = H5FD_MEM_BTREE_F - memb_addr(H5FD_MEM_BTREE_F) = 0.1 - memb_map(H5FD_MEM_DRAW_F) = H5FD_MEM_DRAW_F - memb_addr(H5FD_MEM_DRAW_F) = 0.5 - memb_map(H5FD_MEM_GHEAP_F) = H5FD_MEM_GHEAP_F - memb_addr(H5FD_MEM_GHEAP_F) = 0.2 - memb_map(H5FD_MEM_LHEAP_F) = H5FD_MEM_LHEAP_F - memb_addr(H5FD_MEM_LHEAP_F) = 0.3 - memb_map(H5FD_MEM_OHDR_F) = H5FD_MEM_OHDR_F - memb_addr(H5FD_MEM_OHDR_F) = 0.4 - - memb_name = ' ' - memb_name(H5FD_MEM_SUPER_F) = '%s-s.h5' - memb_name(H5FD_MEM_BTREE_F) = '%s-b.h5' - memb_name(H5FD_MEM_DRAW_F) = '%s-r.h5' - memb_name(H5FD_MEM_GHEAP_F) = '%s-g.h5' - memb_name(H5FD_MEM_LHEAP_F) = '%s-l.h5' - memb_name(H5FD_MEM_OHDR_F) = '%s-o.h5' - - ! - ! Initialize the dset_data array. - ! - DO i = 1, 4 - DO j = 1, 6 - dset_data(i,j) = (i-1)*6 + j - END DO - END DO - - ! - ! Create a new file using default properties. - ! - CALL h5_fixname_f(filename, fix_filename, H5P_DEFAULT_F, error) - IF (error .NE. 0) THEN - WRITE(*,*) "Cannot modify filename" - STOP - ENDIF - CALL h5pcreate_f(H5P_FILE_ACCESS_F, fapl, error) - CALL check("h5pcreate_f", error, total_error) - CALL h5pset_fapl_multi_f(fapl, memb_map, memb_fapl, memb_name, memb_addr, relax, error) - CALL check("h5pset_fapl_multi_f", error, total_error) - CALL h5pget_fapl_multi_f(fapl, memb_map_out, memb_fapl_out, memb_name_out, & - memb_addr_out, relax_out, error) - CALL check("h5pget_fapl_multi_f", error, total_error) - CALL h5pget_driver_f(fapl, driver, error) - CALL check("h5pget_driver_f",error, total_error) - IF(driver .NE. H5FD_MULTI_F) THEN - WRITE(*,*) "Wrong value for driver" - ENDIF - ! - ! Let's check h5pget(set)cache_f APIs here for now - ! - CALL h5pget_cache_f(fapl, mdc_nelmts, rdcc_nelmts, rdcc_nbytes, & - rdcc_w0, error) - CALL check("h5pget_cache_f", error, total_error) - - ! - ! Set cache to some number - ! - rdcc_nbytes = 1024*1024 - CALL h5pset_cache_f(fapl, mdc_nelmts, rdcc_nelmts, rdcc_nbytes, & - rdcc_w0, error) - CALL check("h5pset_cache_f", error, total_error) - CALL h5fcreate_f(fix_filename, H5F_ACC_TRUNC_F, file_id, error, access_prp = fapl) - CALL check("h5fcreate_f", error, total_error) - IF(error .NE. 0) THEN - WRITE(*,*) "Cannot create file using multi-file driver... Exiting...." - total_error = 1 - CALL h5pclose_f(fapl, error) - RETURN - ENDIF - ! - ! Create the dataspace. - ! - CALL h5screate_simple_f(rank, dims, dspace_id, error) - CALL check("h5screate_simple_f", error, total_error) - ! - ! Create the dataset with default properties. - ! - CALL h5dcreate_f(file_id, dsetname, H5T_NATIVE_INTEGER, dspace_id, & - dset_id, error) - CALL check("h5dcreate_f", error, total_error) - ! - ! Write the dataset. - ! - data_dims(1) = 4 - data_dims(2) = 6 - CALL h5dwrite_f(dset_id, H5T_NATIVE_INTEGER, dset_data, data_dims, error) - CALL check("h5dwrite_f", error, total_error) - ! - ! End access to the dataset and release resources used by it. - ! - CALL h5dclose_f(dset_id, error) - CALL check("h5dclose_f", error, total_error) - - ! - ! Terminate access to the data space. - ! - CALL h5sclose_f(dspace_id, error) - CALL check("h5sclose_f", error, total_error) - - ! - ! Close the file. - ! - CALL h5fclose_f(file_id, error) - CALL check("h5fclose_f", error, total_error) - CALL h5pclose_f(fapl, error) - CALL check("h5pclose_f", error, total_error) - ! - ! Open the existing file. - ! - CALL h5pcreate_f(H5P_FILE_ACCESS_F, fapl, error) - CALL check("h5pcreate_f", error, total_error) - CALL h5pset_fapl_multi_f(fapl, memb_map, memb_fapl, memb_name, memb_addr, relax, error) - CALL check("h5pset_fapl_multi_f", error, total_error) - CALL h5fopen_f (fix_filename, H5F_ACC_RDWR_F, file_id, error, access_prp = fapl) - CALL check("h5fopen_f", error, total_error) - ! - CALL h5fget_access_plist_f(file_id, fapl_1, error) - CALL check("h5fget_access_plist_f", error, total_error) - !It doesn't work on Windows. - !CALL h5pget_fapl_multi_f(fapl_1, memb_map_out, memb_fapl_out, memb_name_out, & - ! memb_addr_out, relax_out, error) - ! write(*,*) memb_map_out - ! write(*,*) memb_fapl_out - ! write(*,*) memb_name_out - ! write(*,*) memb_addr_out - ! CALL check("h5pget_fapl_multi_f", error, total_error) - - ! - ! Open the existing dataset. - ! - CALL h5dopen_f(file_id, dsetname, dset_id, error) - CALL check("h5dopen_f", error, total_error) - - ! - ! Get the dataset type. - ! - CALL h5dget_type_f(dset_id, dtype_id, error) - CALL check("h5dget_type_f", error, total_error) - - ! - ! Get the data space. - ! - CALL h5dget_space_f(dset_id, dspace_id, error) - CALL check("h5dget_space_f", error, total_error) - - ! - ! Read the dataset. - ! - CALL h5dread_f(dset_id, H5T_NATIVE_INTEGER, data_out, data_dims, error) - CALL check("h5dread_f", error, total_error) - - ! - !Compare the data. - ! - DO i = 1, 4 - DO j = 1, 6 - IF (data_out(i,j) .NE. dset_data(i, j)) THEN - WRITE(*, *) "dataset test error occured" - WRITE(*,*) "data read is not the same as the data writen" - END IF - END DO - END DO - - ! - ! End access to the dataset and release resources used by it. - ! - CALL h5dclose_f(dset_id, error) - CALL check("h5dclose_f", error, total_error) - - ! - ! Terminate access to the data space. - ! - CALL h5sclose_f(dspace_id, error) - CALL check("h5sclose_f", error, total_error) - - ! - ! Terminate access to the data type. - ! - CALL h5tclose_f(dtype_id, error) - CALL check("h5tclose_f", error, total_error) - ! - ! Close the file. - ! - CALL h5fclose_f(file_id, error) - CALL check("h5fclose_f", error, total_error) - CALL h5pclose_f(fapl, error) - CALL check("h5pclose_f", error, total_error) - CALL h5pclose_f(fapl_1, error) - CALL check("h5pclose_f", error, total_error) - IF(cleanup) CALL h5_cleanup_f(filename, H5P_DEFAULT_F, error) - CALL check("h5_cleanup_f", error, total_error) - - IF(cleanup) CALL h5_cleanup_f(filename//'.h5-b', H5P_DEFAULT_F, error) - CALL check("h5_cleanup_f", error, total_error) - IF(cleanup) CALL h5_cleanup_f(filename//'.h5-g', H5P_DEFAULT_F, error) - CALL check("h5_cleanup_f", error, total_error) - IF(cleanup) CALL h5_cleanup_f(filename//'.h5-l', H5P_DEFAULT_F, error) - CALL check("h5_cleanup_f", error, total_error) - IF(cleanup) CALL h5_cleanup_f(filename//'.h5-o', H5P_DEFAULT_F, error) - CALL check("h5_cleanup_f", error, total_error) - IF(cleanup) CALL h5_cleanup_f(filename//'.h5-r', H5P_DEFAULT_F, error) - CALL check("h5_cleanup_f", error, total_error) - IF(cleanup) CALL h5_cleanup_f(filename//'.h5-s', H5P_DEFAULT_F, error) - CALL check("h5_cleanup_f", error, total_error) - - RETURN -END SUBROUTINE multi_file_test - -!------------------------------------------------------------------------- -! Function: test_chunk_cache -! -! Purpose: Tests APIs: -! H5P_H5PSET_CHUNK_CACHE_F -! H5P_H5PGET_CHUNK_CACHE_F -! H5D_H5DGET_ACCESS_PLIST_F -! -! Return: Success: 0 -! Failure: -1 -! -! C Programmer: Neil Fortner -! Wednesday, October 29, 2008 -! -! FORTRAN Programmer: M. Scot Breitenfeld -! April 16, 2009 -!------------------------------------------------------------------------- -! -SUBROUTINE test_chunk_cache(cleanup, total_error) - - IMPLICIT NONE - LOGICAL, INTENT(IN) :: cleanup - INTEGER, INTENT(INOUT) :: total_error - - CHARACTER(LEN=14), PARAMETER :: filename="chunk_cache" - CHARACTER(LEN=80) :: fix_filename - INTEGER(hid_t) :: fid = -1 ! File ID - INTEGER(hid_t) :: fapl_local = -1 ! Local fapl - INTEGER(hid_t) :: fapl_def = -1 ! Default fapl - INTEGER(hid_t) :: dcpl = -1 ! Dataset creation property list ID - INTEGER(hid_t) :: dapl1 = -1 ! Dataset access property list ID - INTEGER(hid_t) :: dapl2 = -1 ! Dataset access property list ID - INTEGER(hid_t) :: sid = -1 ! Dataspace ID - INTEGER(hid_t) :: dsid = -1 ! Dataset ID - INTEGER(hsize_t), DIMENSION(1:1) :: chunk_dim, NDIM = (/100/) ! Dataset and chunk dimensions - INTEGER(size_t) :: nslots_1, nslots_2, nslots_3, nslots_4 ! rdcc number of elements - INTEGER(size_t) :: nbytes_1, nbytes_2, nbytes_3, nbytes_4 ! rdcc number of bytes - INTEGER :: mdc_nelmts - INTEGER(size_t) ::nlinks ! Number of link traversals - REAL :: w0_1, w0_2, w0_3, w0_4 ! rdcc preemption policy - INTEGER :: error - INTEGER(size_t) rdcc_nelmts - INTEGER(size_t) rdcc_nbytes - REAL :: rdcc_w0 - - CALL h5_fixname_f(filename, fix_filename, H5P_DEFAULT_F, error) - IF (error .NE. 0) THEN - WRITE(*,*) "Cannot modify filename" - STOP - ENDIF - - ! Create a default fapl and dapl - CALL H5Pcreate_f(H5P_FILE_ACCESS_F, fapl_def, error) - CALL check("H5Pcreate_f", error, total_error) - CALL H5Pcreate_f(H5P_DATASET_ACCESS_F, dapl1, error) - CALL check("H5Pcreate_f", error, total_error) - - ! Verify that H5Pget_chunk_cache(dapl) returns the same values as are in - ! the default fapl. - ! - CALL H5Pget_cache_f(fapl_def, mdc_nelmts, nslots_1, nbytes_1, w0_1, error) - CALL check("H5Pget_cache_f", error, total_error) - CALL H5Pget_chunk_cache_f(dapl1, nslots_4, nbytes_4, w0_4, error) - CALL check("H5Pget_chunk_cache_f", error, total_error) - CALL verify("H5Pget_chunk_cache_f", nslots_1, nslots_4, total_error) - CALL verify("H5Pget_chunk_cache_f", nbytes_1, nbytes_4, total_error) - CALL verify("H5Pget_chunk_cache_f", w0_1, w0_4, total_error) - - ! Set a lapl property on dapl1 (to verify inheritance) - CALL H5Pset_nlinks_f(dapl1, 134_size_t , error) - CALL check("H5Pset_nlinks_f", error, total_error) - CALL H5Pget_nlinks_f(dapl1, nlinks, error) - CALL check("H5Pget_nlinks_f", error, total_error) - CALL verify("H5Pget_nlinks_f", INT(nlinks), 134, total_error) - - - CALL h5pcreate_f(H5P_FILE_ACCESS_F, fapl_local, error) - CALL check("h5pcreate_f", error, total_error) - ! Turn off the chunk cache, so all the chunks are immediately written to disk - CALL H5Pget_cache_f(fapl_local, mdc_nelmts, rdcc_nelmts, rdcc_nbytes, rdcc_w0, error) - CALL check("H5Pget_cache_f", error, total_error) - rdcc_nbytes = 0 - CALL H5Pset_cache_f(fapl_local, mdc_nelmts, rdcc_nelmts, rdcc_nbytes, rdcc_w0, error) - CALL check("H5Pset_cache_f", error, total_error) - - ! Set new rdcc settings on fapl! - nslots_2 = nslots_1 * 2 - nbytes_2 = nbytes_1 * 2 - w0_2 = w0_1 / 2. - - CALL H5Pset_cache_f(fapl_local, 0, nslots_2, nbytes_2, w0_2, error) - CALL check("H5Pset_cache_f", error, total_error) - - ! Create file - CALL H5Fcreate_f(fix_filename, H5F_ACC_TRUNC_F, fid, error, H5P_DEFAULT_F, fapl_local) - CALL check("H5Fcreate_f", error, total_error) - - ! Create dataset creation property list - CALL H5Pcreate_f(H5P_DATASET_CREATE_F, dcpl, error) - CALL check("H5Pcreate_f", error, total_error) - - ! Set chunking - chunk_dim(1) = 10 - CALL H5Pset_chunk_f(dcpl, 1, chunk_dim, error) - CALL check("H5Pset_chunk_f", error, total_error) - - ! Create 1-D dataspace - ndim(1) = 100 - CALL H5Screate_simple_f(1, ndim, sid, error) - CALL check("H5Pcreate_f", error, total_error) - - ! Create dataset with default dapl - CALL H5Dcreate_f(fid, "dset", H5T_NATIVE_INTEGER, sid, dsid, error, dcpl, H5P_DEFAULT_F, dapl1) - CALL check("H5Pcreate_f", error, total_error) - - ! Retrieve dapl from dataset, verify cache values are the same as on fapl_local - CALL H5Dget_access_plist_f(dsid, dapl2, error) - CALL check("H5Dget_access_plist_f", error, total_error) - CALL H5Pget_chunk_cache_f(dapl2, nslots_4, nbytes_4, w0_4, error) - CALL check("H5Pget_chunk_cache_f", error, total_error) - CALL verify("H5Pget_chunk_cache_f", INT(nslots_2), INT(nslots_4), total_error) - CALL verify("H5Pget_chunk_cache_f", INT(nbytes_2), INT(nbytes_4), total_error) - CALL verify("H5Pget_chunk_cache_f", w0_2, w0_4, total_error) - CALL H5Pclose_f(dapl2,error) - CALL check("H5Pclose_f", error, total_error) - - ! Set new values on dapl1. nbytes will be set to default, so the file - ! property will override this setting - - nslots_3 = nslots_2 * 2 - nbytes_3 = H5D_CHUNK_CACHE_NBYTES_DFLT_F - w0_3 = w0_2 / 2 - - CALL H5Pset_chunk_cache_f(dapl1, nslots_3, nbytes_3, w0_3, error) - CALL check("H5Pset_chunk_cache_f", error, total_error) - - ! Close dataset, reopen with dapl1. Note the use of a dapl with H5Oopen - CALL H5Dclose_f(dsid, error) - CALL H5Oopen_f(fid, "dset", dsid, error, dapl1) - - ! Retrieve dapl from dataset, verfiy cache values are the same as on dapl1 - ! - ! Note we rely on the knowledge that H5Pget_chunk_cache retrieves these - ! values directly from the dataset structure, and not from a copy of the - ! dapl used to open the dataset (which is not preserved). - ! - CALL H5Dget_access_plist_f(dsid, dapl2, error) - CALL check("H5Dget_access_plist_f", error, total_error) - CALL H5Pget_chunk_cache_f(dapl2, nslots_4, nbytes_4, w0_4, error) - CALL check("H5Pget_chunk_cache_f", error, total_error) - CALL verify("H5Pget_chunk_cache_f", INT(nslots_3), INT(nslots_4), total_error) - CALL verify("H5Pget_chunk_cache_f", INT(nbytes_2), INT(nbytes_4), total_error) - CALL verify("H5Pget_chunk_cache_f", w0_3, w0_4, total_error) - CALL H5Pclose_f(dapl2,error) - CALL check("H5Pclose_f", error, total_error) - - ! Close dataset, reopen with H5P_DEFAULT as dapl - CALL H5Dclose_f(dsid, error) - CALL check("H5Dclose_f", error, total_error) - CALL H5Oopen_f(fid, "dset", dsid, error) - CALL check("H5Oopen_f", error, total_error) - - ! Retrieve dapl from dataset, verfiy cache values are the same as on fapl_local - - CALL H5Dget_access_plist_f(dsid, dapl2, error) - CALL check("H5Dget_access_plist_f", error, total_error) - CALL H5Pget_chunk_cache_f(dapl2, nslots_4, nbytes_4, w0_4, error) - CALL check("H5Pget_chunk_cache_f", error, total_error) - CALL verify("H5Pget_chunk_cache_f", INT(nslots_2), INT(nslots_4), total_error) - CALL verify("H5Pget_chunk_cache_f", INT(nbytes_2), INT(nbytes_4), total_error) - CALL verify("H5Pget_chunk_cache_f", w0_2, w0_4, total_error) - CALL H5Pclose_f(dapl2,error) - CALL check("H5Pclose_f", error, total_error) - - ! Similary, test use of H5Dcreate2 with H5P_DEFAULT - CALL H5Dclose_f(dsid, error) - CALL check("H5Dclose_f", error, total_error) - - CALL H5Dcreate_f(fid, "dset2", H5T_NATIVE_INTEGER, sid, dsid, error, dcpl, H5P_DEFAULT_F, H5P_DEFAULT_F) - CALL check("H5Pcreate_f", error, total_error) - - CALL H5Dget_access_plist_f(dsid, dapl2, error) - CALL check("H5Dget_access_plist_f", error, total_error) - - CALL H5Pget_chunk_cache_f(dapl2, nslots_4, nbytes_4, w0_4, error) - CALL check("H5Pget_chunk_cache_f", error, total_error) - CALL verify("H5Pget_chunk_cache_f", INT(nslots_2), INT(nslots_4), total_error) - CALL verify("H5Pget_chunk_cache_f", INT(nbytes_2), INT(nbytes_4), total_error) - CALL verify("H5Pget_chunk_cache_f", w0_2, w0_4, total_error) - ! Don't close dapl2, we will use it in the next section - - ! Modify cache values on fapl_local - nbytes_3 = nbytes_2 * 2 - - CALL H5Pset_cache_f(fapl_local, 0, nslots_3, nbytes_3, w0_3, error) - CALL check("H5Pset_cache_f", error, total_error) - - ! Close and reopen file with new fapl_local - - CALL H5Dclose_f(dsid, error) - CALL check("H5Dclose_f", error, total_error) - CALL H5Fclose_f(fid,error) - CALL check("h5fclose_f", error, total_error) - - CALL H5Fopen_f (fix_filename, H5F_ACC_RDWR_F, fid, error, fapl_local) - CALL check("h5fopen_f", error, total_error) - - ! Verify that dapl2 retrieved earlier (using values from the old fapl) - ! sets its values in the new file (test use of H5Dopen2 with a dapl) - ! - - CALL h5dopen_f (fid, "dset", dsid, error, dapl2) - CALL check("h5dopen_f", error, total_error) - - CALL H5Pclose_f(dapl2,error) - CALL check("H5Pclose_f", error, total_error) ! Close dapl2, to avoid id leak - - CALL H5Dget_access_plist_f(dsid, dapl2, error) - CALL check("H5Dget_access_plist_f", error, total_error) - CALL H5Pget_chunk_cache_f(dapl2, nslots_4, nbytes_4, w0_4, error) - CALL check("H5Pget_chunk_cache_f", error, total_error) - CALL verify("H5Pget_chunk_cache_f", INT(nslots_2), INT(nslots_4), total_error) - CALL verify("H5Pget_chunk_cache_f", INT(nbytes_2), INT(nbytes_4), total_error) - CALL verify("H5Pget_chunk_cache_f", w0_2, w0_4, total_error) - - ! Test H5D_CHUNK_CACHE_NSLOTS_DEFAULT and H5D_CHUNK_CACHE_W0_DEFAULT - nslots_2 = H5D_CHUNK_CACHE_NSLOTS_DFLT_F - w0_2 = H5D_CHUNK_CACHE_W0_DFLT_F - - CALL H5Pset_chunk_cache_f(dapl2, nslots_2, nbytes_2, w0_2, error) - CALL check("H5Pset_chunk_cache_f", error, total_error) - - CALL H5Dclose_f(dsid, error) - CALL check("H5Dclose_f", error, total_error) - CALL h5dopen_f (fid, "dset", dsid, error, dapl2) - CALL check("h5dopen_f", error, total_error) - - CALL H5Pclose_f(dapl2,error) - CALL check("H5Pclose_f", error, total_error) - - CALL H5Dget_access_plist_f(dsid, dapl2, error) - CALL check("H5Dget_access_plist_f", error, total_error) - CALL H5Pget_chunk_cache_f(dapl2, nslots_4, nbytes_4, w0_4, error) - CALL check("H5Pget_chunk_cache_f", error, total_error) - CALL verify("H5Pget_chunk_cache_f", INT(nslots_3), INT(nslots_4), total_error) - CALL verify("H5Pget_chunk_cache_f", INT(nbytes_2), INT(nbytes_4), total_error) - CALL verify("H5Pget_chunk_cache_f", w0_3, w0_4, total_error) - -! Close - - CALL H5Dclose_f(dsid, error) - CALL check("H5Dclose_f", error, total_error) - CALL H5Sclose_f(sid,error) - CALL check("H5Sclose_f", error, total_error) - CALL H5Pclose_f(fapl_local,error) - CALL check("H5Pclose_f", error, total_error) - CALL H5Pclose_f(fapl_def,error) - CALL check("H5Pclose_f", error, total_error) - CALL H5Pclose_f(dapl1,error) - CALL check("H5Pclose_f", error, total_error) - CALL H5Pclose_f(dapl2,error) - CALL check("H5Pclose_f", error, total_error) - CALL H5Pclose_f(dcpl,error) - CALL check("H5Pclose_f", error, total_error) - CALL H5Fclose_f(fid,error) - CALL check("H5Fclose_f", error, total_error) - - IF(cleanup) CALL h5_cleanup_f(filename, H5P_DEFAULT_F, error) - CALL check("h5_cleanup_f", error, total_error) - -END SUBROUTINE test_chunk_cache - -END MODULE TH5P diff --git a/fortran/test/tH5P_F03.F90 b/fortran/test/tH5P_F03.F90 new file mode 100644 index 0000000..ec9fef2 --- /dev/null +++ b/fortran/test/tH5P_F03.F90 @@ -0,0 +1,617 @@ +!****h* root/fortran/test/tH5P_F03.f90 +! +! NAME +! tH5P_F03.f90 +! +! FUNCTION +! Test FORTRAN HDF5 H5P APIs which are dependent on FORTRAN 2003 +! features. +! +! 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. * +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! +! USES +! test_genprop_cls_cb1_mod +! +! CONTAINS SUBROUTINES +! test_create, test_genprop_class_callback +! +!***** + +! ***************************************** +! *** H 5 P T E S T S +! ***************************************** +MODULE test_genprop_cls_cb1_mod + + ! Callback subroutine for test_genprop_class_callback + ! and the function H5Pcreate_class_f. + + USE HDF5 + USE ISO_C_BINDING + IMPLICIT NONE + + TYPE, BIND(C) :: cop_cb_struct_ ! Struct for iterations + INTEGER :: count + INTEGER(HID_T) :: id + END TYPE cop_cb_struct_ + +CONTAINS + + INTEGER FUNCTION test_genprop_cls_cb1_f(list_id, create_data ) bind(C) + + IMPLICIT NONE + + INTEGER(HID_T), INTENT(IN), VALUE :: list_id + + TYPE(cop_cb_struct_) :: create_data + + create_data%count = create_data%count + 1 + create_data%id = list_id + + test_genprop_cls_cb1_f = 0 + + END FUNCTION test_genprop_cls_cb1_f + +END MODULE test_genprop_cls_cb1_mod + +MODULE TH5P_F03 + + USE HDF5 + USE TH5_MISC + USE TH5_MISC_GEN + USE ISO_C_BINDING + +CONTAINS + +!------------------------------------------------------------------------- +! * Function: test_create +! * +! * Purpose: Tests H5Pset_fill_value_f and H5Pget_fill_value_f +! * +! * Return: Success: 0 +! * +! * Failure: number of errors +! * +! * Programmer: M. Scot Breitenfeld +! * June 24, 2008 +! * +! * Modifications: +! * +! *------------------------------------------------------------------------- +! + +SUBROUTINE test_create(total_error) + + IMPLICIT NONE + + INTEGER, INTENT(INOUT) :: total_error + INTEGER(HID_T) :: fapl + + INTEGER(hid_t) :: file=-1, space=-1, dcpl=-1, comp_type_id=-1 + INTEGER(hid_t) :: dset9=-1 + INTEGER(hsize_t), DIMENSION(1:5), PARAMETER :: cur_size = (/2, 8, 8, 4, 2/) + INTEGER(hsize_t), DIMENSION(1:5), PARAMETER :: ch_size= (/1, 1, 1, 4, 1/) + CHARACTER(LEN=14) :: filename ='test_create.h5' + + TYPE(comp_datatype), TARGET :: rd_c, fill_ctype + INTEGER :: error + INTEGER(SIZE_T) :: h5off + TYPE(C_PTR) :: f_ptr + LOGICAL :: differ1, differ2 + CHARACTER(LEN=1) :: cfill + INTEGER :: ifill + REAL :: rfill + REAL(KIND=dp) :: dpfill + + ! + ! * Create a file. + ! + CALL h5fcreate_f(filename,H5F_ACC_TRUNC_F,file,error) + CALL check("h5fcreate_f", error, total_error) + + CALL h5screate_simple_f(5, cur_size, space, error, cur_size) + CALL check("h5screate_simple_f", error, total_error) + + CALL H5Pcreate_f(H5P_DATASET_CREATE_F, dcpl, error) + CALL check("H5Pcreate_f", error, total_error) + + CALL h5pset_chunk_f(dcpl, 5, ch_size, error) + CALL check("h5pset_chunk_f",error, total_error) + + ! Create a compound datatype + CALL h5tcreate_f(H5T_COMPOUND_F, H5_SIZEOF(fill_ctype), comp_type_id, error) + CALL check("h5tcreate_f", error, total_error) + h5off = H5OFFSETOF(C_LOC(fill_ctype), C_LOC(fill_ctype%a)) + CALL h5tinsert_f(comp_type_id, "a", h5off , H5T_NATIVE_REAL, error) + CALL check("h5tinsert_f", error, total_error) + CALL h5tinsert_f(comp_type_id, "x", H5OFFSETOF(C_LOC(fill_ctype), C_LOC(fill_ctype%x)), H5T_NATIVE_INTEGER, error) + CALL check("h5tinsert_f", error, total_error) + CALL h5tinsert_f(comp_type_id, "y", H5OFFSETOF(C_LOC(fill_ctype), C_LOC(fill_ctype%y)), H5T_NATIVE_DOUBLE, error) + CALL check("h5tinsert_f", error, total_error) + CALL h5tinsert_f(comp_type_id, "z", & + H5OFFSETOF(C_LOC(fill_ctype), C_LOC(fill_ctype%z)), H5T_NATIVE_CHARACTER, error) + CALL check("h5tinsert_f", error, total_error) + + + CALL H5Pset_alloc_time_f(dcpl, H5D_ALLOC_TIME_LATE_F,error) + CALL check("H5Pset_alloc_time_f",error, total_error) + + CALL H5Pset_fill_time_f(dcpl, H5D_FILL_TIME_ALLOC_F, error) + CALL check("H5Pset_fill_time_f",error, total_error) + + ! Compound datatype test + + f_ptr = C_LOC(fill_ctype) + + CALL H5Pget_fill_value_f(dcpl, comp_type_id, f_ptr, error) + CALL check("H5Pget_fill_value_f",error, total_error) + + fill_ctype%y = 4444.D0 + fill_ctype%z = 'S' + fill_ctype%a = 5555. + fill_ctype%x = 55 + + f_ptr = C_LOC(fill_ctype) + + ! Test various fill values + CALL H5Pset_fill_value_f(dcpl, H5T_NATIVE_CHARACTER, 'X', error) + CALL check("H5Pset_fill_value_f",error, total_error) + CALL h5pget_fill_value_f(dcpl, H5T_NATIVE_CHARACTER, cfill, error) + CALL check("H5Pget_fill_value_f",error, total_error) + IF(cfill.NE.'X')THEN + PRINT*,"***ERROR: Returned wrong fill value (character)" + total_error = total_error + 1 + ENDIF + CALL H5Pset_fill_value_f(dcpl, H5T_NATIVE_INTEGER, 9, error) + CALL check("H5Pset_fill_value_f",error, total_error) + CALL h5pget_fill_value_f(dcpl, H5T_NATIVE_INTEGER, ifill, error) + CALL check("H5Pget_fill_value_f",error, total_error) + IF(ifill.NE.9)THEN + PRINT*,"***ERROR: Returned wrong fill value (integer)" + total_error = total_error + 1 + ENDIF + CALL H5Pset_fill_value_f(dcpl, H5T_NATIVE_DOUBLE, 1.0_dp, error) + CALL check("H5Pset_fill_value_f",error, total_error) + CALL h5pget_fill_value_f(dcpl, H5T_NATIVE_DOUBLE, dpfill, error) + CALL check("H5Pget_fill_value_f",error, total_error) + CALL VERIFY("***ERROR: Returned wrong fill value (double)", dpfill, 1.0_dp, total_error) + CALL H5Pset_fill_value_f(dcpl, H5T_NATIVE_REAL, 2.0, error) + CALL check("H5Pset_fill_value_f",error, total_error) + CALL h5pget_fill_value_f(dcpl, H5T_NATIVE_REAL, rfill, error) + CALL check("H5Pget_fill_value_f",error, total_error) + CALL VERIFY("***ERROR: Returned wrong fill value (real)", rfill, 2.0, total_error) + + ! For the actual compound type + CALL H5Pset_fill_value_f(dcpl, comp_type_id, f_ptr, error) + CALL check("H5Pget_fill_value_f",error, total_error) + + CALL h5dcreate_f(file,"dset9", comp_type_id, space, dset9, error, dcpl_id=dcpl) + CALL check("h5dcreate_f", error, total_error) + + CALL h5dclose_f(dset9, error) + CALL check("h5dclose_f", error, total_error) + + CALL h5fclose_f(file,error) + CALL check("h5fclose_f", error, total_error) + + ! Open the file and get the dataset fill value from each dataset + CALL H5Pcreate_f(H5P_FILE_ACCESS_F, fapl, error) + CALL check("H5Pcreate_f",error, total_error) + + CALL H5Pset_libver_bounds_f(fapl, H5F_LIBVER_LATEST_F, H5F_LIBVER_LATEST_F, error) + CALL check("H5Pset_libver_bounds_f",error, total_error) + + CALL h5fopen_f (FILENAME, H5F_ACC_RDONLY_F, file, error, fapl) + CALL check("h5fopen_f", error, total_error) + + ! Compound datatype test + CALL h5dopen_f(file, "dset9", dset9, error) + CALL check("h5dopen_f", error, total_error) + + CALL H5Dget_create_plist_f(dset9, dcpl, error) + CALL check("H5Dget_create_plist_f", error, total_error) + + f_ptr = C_LOC(rd_c) + + CALL H5Pget_fill_value_f(dcpl, comp_type_id, f_ptr, error) + CALL check("H5Pget_fill_value_f", error, total_error) + CALL verify("***ERROR: Returned wrong fill value", rd_c%a, fill_ctype%a, total_error) + CALL verify("***ERROR: Returned wrong fill value", rd_c%y, fill_ctype%y, total_error) + + IF( rd_c%x .NE. fill_ctype%x .OR. & + rd_c%z .NE. fill_ctype%z )THEN + + PRINT*,"***ERROR: Returned wrong fill value" + total_error = total_error + 1 + + ENDIF + + CALL h5dclose_f(dset9, error) + CALL check("h5dclose_f", error, total_error) + + CALL H5Pclose_f(dcpl, error) + CALL check("H5Pclose_f", error, total_error) + + CALL h5fclose_f(file,error) + CALL check("h5fclose_f", error, total_error) + +END SUBROUTINE test_create + + +SUBROUTINE test_genprop_class_callback(total_error) + + ! + ! + ! test_genprop_class_callback(): Test basic generic property list code. + ! Tests callbacks for property lists in a generic class. + ! + ! FORTRAN TESTS: + ! Tests function H5Pcreate_class_f with callback. + ! + ! + + USE test_genprop_cls_cb1_mod + IMPLICIT NONE + + INTEGER, INTENT(INOUT) :: total_error + + INTEGER(hid_t) :: cid1, cid2 ! Generic Property class ID + INTEGER(hid_t) :: lid1, lid2 ! Generic Property list ID + INTEGER(size_t) :: nprops ! Number of properties in class + + TYPE(cop_cb_struct_), TARGET :: crt_cb_struct, cls_cb_struct + INTEGER :: CLASS1_NAME_SIZE = 7 ! length of class string + CHARACTER(LEN=7) :: CLASS1_NAME = "Class 1", CLASS1_NAME_BUF + TYPE(C_FUNPTR) :: f1, f5 + TYPE(C_PTR) :: f2, f6 + + CHARACTER(LEN=10) :: PROP1_NAME = "Property 1" + INTEGER(SIZE_T) :: PROP1_SIZE = 10 + CHARACTER(LEN=10) :: PROP2_NAME = "Property 2" + INTEGER(SIZE_T) :: PROP2_SIZE = 10 + CHARACTER(LEN=10) :: PROP3_NAME = "Property 3" + INTEGER(SIZE_T) :: PROP3_SIZE = 10 + CHARACTER(LEN=10) :: PROP4_NAME = "Property 4" + INTEGER(SIZE_T) :: PROP4_SIZE = 10 + INTEGER :: PROP1_DEF_VALUE = 10 + INTEGER :: PROP2_DEF_VALUE = 10 + INTEGER :: PROP3_DEF_VALUE = 10 + INTEGER :: PROP4_DEF_VALUE = 10 + + INTEGER :: error ! Generic RETURN value + LOGICAL :: flag ! for tests + + f1 = C_FUNLOC(test_genprop_cls_cb1_f) + f5 = C_FUNLOC(test_genprop_cls_cb1_f) + + f2 = C_LOC(crt_cb_struct) + f6 = C_LOC(cls_cb_struct) + + ! Create a new generic class, derived from the root of the class hierarchy + CALL h5pcreate_class_f(h5p_ROOT_F, CLASS1_NAME, cid1, error, f1, f2, c_null_funptr, c_null_ptr, f5, f6) + CALL check("h5pcreate_class_f", error, total_error) + + ! Insert first property into class (with no callbacks) + CALL h5pregister_f(cid1, PROP1_NAME, PROP1_SIZE, PROP1_DEF_VALUE, error) + CALL check("h5pregister_f", error, total_error) + ! Insert second property into class (with no callbacks) + CALL h5pregister_f(cid1, PROP2_NAME, PROP2_SIZE, PROP2_DEF_VALUE, error) + CALL check("h5pregister_f", error, total_error) + ! Insert third property into class (with no callbacks) + CALL h5pregister_f(cid1, PROP3_NAME, PROP3_SIZE, PROP3_DEF_VALUE, error) + CALL check("h5pregister_f", error, total_error) + + ! Insert fourth property into class (with no callbacks) + CALL h5pregister_f(cid1, PROP4_NAME, PROP4_SIZE, PROP4_DEF_VALUE, error) + CALL check("h5pregister_f", error, total_error) + + ! Check the number of properties in class + CALL h5pget_nprops_f(cid1, nprops, error) + CALL check("h5pget_nprops_f", error, total_error) + CALL verify("h5pget_nprops_f", INT(nprops), 4, total_error) + + ! Initialize class callback structs + + crt_cb_struct%count = 0 + crt_cb_struct%id = -1 + cls_cb_struct%count = 0 + cls_cb_struct%id = -1 + + ! Create a property list from the class + CALL h5pcreate_f(cid1, lid1, error) + CALL check("h5pcreate_f", error, total_error) + + ! Get the list's class + CALL H5Pget_class_f(lid1, cid2, error) + CALL check("H5Pget_class_f", error, total_error) + + ! Check that the list's class is correct + CALL H5Pequal_f(cid2, cid1, flag, error) + CALL check("H5Pequal_f", error, total_error) + CALL verify("H5Pequal_f", flag, .TRUE., total_error) + + ! Check the class name + CALL H5Pget_class_name_f(cid2, CLASS1_NAME_BUF, CLASS1_NAME_SIZE, error) + CALL check("H5Pget_class_name_f", error, total_error) + CALL verify("H5Pget_class_name_f", CLASS1_NAME_BUF, CLASS1_NAME, error) + IF(error.NE.0)THEN + WRITE(*,*) 'Class names do not match! name=',CLASS1_NAME_BUF, 'CLASS1_NAME=',CLASS1_NAME + total_error = total_error + 1 + ENDIF + ! Close class + CALL h5pclose_class_f(cid2, error) + CALL check("h5pclose_class_f", error, total_error) + + ! Verify that the creation callback occurred + CALL verify("h5pcreate_f", crt_cb_struct%count, 1, total_error) + CALL verify("h5pcreate_f", crt_cb_struct%id, lid1, total_error) + + ! Check the number of properties in list + CALL h5pget_nprops_f(lid1,nprops, error) + CALL check("h5pget_nprops_f", error, total_error) + CALL verify("h5pget_nprops_f", INT(nprops), 4, total_error) + + ! Create another property list from the class + CALL h5pcreate_f(cid1, lid2, error) + CALL check("h5pcreate_f", error, total_error) + + ! Verify that the creation callback occurred + CALL verify("h5pcreate_f", crt_cb_struct%count, 2, total_error) + CALL verify("h5pcreate_f", crt_cb_struct%id, lid2, total_error) + + ! Check the number of properties in list + CALL h5pget_nprops_f(lid2,nprops, error) + CALL check("h5pget_nprops_f", error, total_error) + CALL verify("h5pget_nprops_f", INT(nprops), 4, total_error) + + ! Close first list + CALL h5pclose_f(lid1, error); + CALL check("h5pclose_f", error, total_error) + + ! Verify that the close callback occurred + CALL verify("h5pcreate_f", cls_cb_struct%count, 1, total_error) + CALL verify("h5pcreate_f", cls_cb_struct%id, lid1, total_error) + + ! Close second list + CALL h5pclose_f(lid2, error); + CALL check("h5pclose_f", error, total_error) + + ! Verify that the close callback occurred + CALL verify("h5pcreate_f", cls_cb_struct%count, 2, total_error) + CALL verify("h5pcreate_f", cls_cb_struct%id, lid2, total_error) + + ! Close class + CALL h5pclose_class_f(cid1, error) + CALL check("h5pclose_class_f", error, total_error) + +END SUBROUTINE test_genprop_class_callback + +!------------------------------------------------------------------------- +! Function: test_h5p_file_image +! +! Purpose: Tests APIs: +! h5pget_file_image_f and h5pset_file_image_f +! +! Return: Success: 0 +! Failure: -1 +! +! FORTRAN Programmer: M. Scot Breitenfeld +! April 1, 2014 +!------------------------------------------------------------------------- + +SUBROUTINE test_h5p_file_image(total_error) + + USE, INTRINSIC :: iso_c_binding + IMPLICIT NONE + INTEGER, INTENT(INOUT) :: total_error + INTEGER(hid_t) :: fapl_1 = -1 + INTEGER, PARAMETER :: count = 10 + INTEGER, DIMENSION(1:count), TARGET :: buffer + INTEGER, DIMENSION(1:count), TARGET :: temp + INTEGER :: i + INTEGER(size_t) :: size + INTEGER(size_t) :: temp_size + INTEGER :: error ! error return value + TYPE(C_PTR) :: f_ptr + TYPE(C_PTR), DIMENSION(1:count) :: f_ptr1 + TYPE(C_PTR), DIMENSION(1:1) :: f_ptr2 + + INTEGER(HSIZE_T) :: sizeof_buffer + + ! Initialize file image buffer + DO i = 1, count + buffer(i) = i*10 + ENDDO + + ! Create fapl + CALL h5pcreate_f(H5P_FILE_ACCESS_F, fapl_1, error) + CALL check("h5pcreate_f", error, total_error) + + ! Test with NULL ptr + f_ptr2(1) = C_NULL_PTR + temp_size = 1 + CALL h5pget_file_image_f(fapl_1, f_ptr2, temp_size, error) + CALL check("h5pget_file_image_f", error, total_error) + CALL verify("h5pget_file_image_f", INT(temp_size), 0, total_error) + + ! Set file image + f_ptr = C_LOC(buffer(1)) + size = H5_SIZEOF(buffer(1))*count + + CALL h5pset_file_image_f(fapl_1, f_ptr, size, error) + CALL check("h5pset_file_image_f", error, total_error) + + ! Get the same data back + DO i = 1, count + f_ptr1(i) = C_LOC(temp(i)) + ENDDO + + temp_size = 0 + CALL h5pget_file_image_f(fapl_1, f_ptr1, temp_size, error) + CALL check("h5pget_file_image_f", error, total_error) + + ! Check that sizes are the same, and that the buffers are identical but separate + CALL verify("h5pget_file_image_f", INT(temp_size), INT(size), total_error) + + ! Verify the image data is correct + DO i = 1, count + CALL verify("h5pget_file_image_f", temp(i), buffer(i), total_error) + ENDDO + +END SUBROUTINE test_h5p_file_image + +!------------------------------------------------------------------------- +! Function: external_test_offset +! +! Purpose: Tests APIs: +! h5pset_external_f (with offsets not equal to zero), h5pget_external_f +! +! Return: Success: 0 +! Failure: -1 +! +! FORTRAN Programmer: M. Scot Breitenfeld +! January 10, 2012 +!------------------------------------------------------------------------- +! +SUBROUTINE external_test_offset(cleanup,total_error) + + IMPLICIT NONE + INTEGER, INTENT(INOUT) :: total_error + LOGICAL, INTENT(IN) :: cleanup + + INTEGER(hid_t) :: fapl=-1 ! file access property list + INTEGER(hid_t) :: file=-1 ! file to write to + INTEGER(hid_t) :: dcpl=-1 ! dataset creation properties + INTEGER(hid_t) :: space=-1 ! data space + INTEGER(hid_t) :: dset=-1 ! dataset + INTEGER(hid_t) :: grp=-1 ! group to emit diagnostics + INTEGER(size_t) :: i, j ! miscellaneous counters + CHARACTER(LEN=180) :: filename ! file names + INTEGER, DIMENSION(1:25) :: part + INTEGER, DIMENSION(1:100), TARGET :: whole ! raw data buffers + INTEGER(hsize_t), DIMENSION(1:1) :: cur_size ! current data space size + INTEGER(hid_t) :: hs_space ! hyperslab data space + INTEGER(hsize_t), DIMENSION(1:1) :: hs_start = (/30/) ! hyperslab starting offset + INTEGER(hsize_t), DIMENSION(1:1) :: hs_count = (/25/) ! hyperslab size + CHARACTER(LEN=1) :: ichr1 ! character conversion holder + INTEGER :: error ! error status + TYPE(C_PTR) :: f_ptr ! fortran pointer + INTEGER(HSIZE_T) :: sizeof_part + + CHARACTER(LEN=1,KIND=C_CHAR), DIMENSION(1:30) :: temparray + + temparray(1:30)(1:1) = '0' ! 1 byte character + + ! Write the data to external files directly + DO i = 1, 4 + DO j = 1, 25 + part(j) = (i-1)*25+(j-1) + ENDDO + WRITE(ichr1,'(I1.1)') i + filename = "extern_"//ichr1//"a.raw" + OPEN(10, FILE=filename, ACCESS='STREAM', form='UNFORMATTED') + + WRITE(10) temparray(1:(i-1)*10) + WRITE(10) part + CLOSE(10) + ENDDO + ! + ! Create the file and an initial group. + CALL h5pcreate_f(H5P_FILE_ACCESS_F, fapl, error) + CALL h5fcreate_f('extren_raw.h5', H5F_ACC_TRUNC_F, file, error, access_prp=fapl) + CALL check("h5fcreate_f",error,total_error) + + CALL h5gcreate_f(file, "emit-diagnostics", grp, error) + CALL check("h5gcreate_f",error, total_error) + + ! Create the dataset + + sizeof_part = INT(H5_SIZEOF(part(1))*25, hsize_t) + + CALL h5pcreate_f(H5P_DATASET_CREATE_F, dcpl, error) + CALL check("h5pcreate_f", error, total_error) + CALL h5pset_external_f(dcpl, "extern_1a.raw", INT(0,off_t), sizeof_part, error) + CALL check("h5pset_external_f",error,total_error) + CALL h5pset_external_f(dcpl, "extern_2a.raw", INT(10,off_t), sizeof_part, error) + CALL check("h5pset_external_f",error,total_error) + CALL h5pset_external_f(dcpl, "extern_3a.raw", INT(20,off_t), sizeof_part, error) + CALL check("h5pset_external_f",error,total_error) + CALL h5pset_external_f(dcpl, "extern_4a.raw", INT(30,off_t), sizeof_part, error) + CALL check("h5pset_external_f",error,total_error) + + cur_size(1) = 100 + CALL h5screate_simple_f(1, cur_size, space, error) + CALL check("h5screate_simple_f", error, total_error) + CALL h5dcreate_f(file, "dset1", H5T_NATIVE_INTEGER, space, dset,error,dcpl_id=dcpl) + CALL check("h5dcreate_f", error, total_error) + + ! + ! Read the entire dataset and compare with the original + whole(:) = 0 + f_ptr = C_LOC(whole(1)) + CALL h5dread_f(dset, H5T_NATIVE_INTEGER, f_ptr, error, mem_space_id=space, file_space_id=space) + CALL check("h5dread_f", error, total_error) + + DO i = 1, 100 + IF(whole(i) .NE. i-1)THEN + WRITE(*,*) "Incorrect value(s) read." + total_error = total_error + 1 + EXIT + ENDIF + ENDDO + ! + ! Read the middle of the dataset + CALL h5scopy_f(space, hs_space, error) + CALL check("h5scopy_f", error, total_error) + CALL h5sselect_hyperslab_f(hs_space, H5S_SELECT_SET_F, hs_start, hs_count, error) + CALL check("h5sselect_hyperslab_f", error, total_error) + + whole(:) = 0 + f_ptr = C_LOC(whole(1)) + CALL h5dread_f(dset, H5T_NATIVE_INTEGER, f_ptr, error, mem_space_id=hs_space, file_space_id=hs_space) + CALL check("h5dread_f", error, total_error) + + CALL h5sclose_f(hs_space, error) + CALL check("h5sclose_f", error, total_error) + DO i = INT(hs_start(1))+1, INT(hs_start(1)+hs_count(1)) + IF(whole(i) .NE. i-1)THEN + WRITE(*,*) "Incorrect value(s) read." + total_error = total_error + 1 + EXIT + ENDIF + ENDDO + + CALL h5dclose_f(dset, error) + CALL check("h5dclose_f", error, total_error) + CALL h5pclose_f(dcpl, error) + CALL check("h5pclose_f", error, total_error) + CALL h5sclose_f(space, error) + CALL check("h5sclose_f", error, total_error) + CALL h5fclose_f(file, error) + CALL check("h5fclose_f", error, total_error) + + ! cleanup + DO i = 1, 4 + WRITE(ichr1,'(I1.1)') i + filename = "extern_"//ichr1//"a.raw" + CALL h5_cleanup_f(filename, H5P_DEFAULT_F, error) + CALL check("h5_cleanup_f", error, total_error) + ENDDO + IF(cleanup) CALL h5_cleanup_f("extren_raw.h5", H5P_DEFAULT_F, error) + CALL check("h5_cleanup_f", error, total_error) + +END SUBROUTINE external_test_offset +END MODULE TH5P_F03 diff --git a/fortran/test/tH5P_F03.f90 b/fortran/test/tH5P_F03.f90 deleted file mode 100644 index ec9fef2..0000000 --- a/fortran/test/tH5P_F03.f90 +++ /dev/null @@ -1,617 +0,0 @@ -!****h* root/fortran/test/tH5P_F03.f90 -! -! NAME -! tH5P_F03.f90 -! -! FUNCTION -! Test FORTRAN HDF5 H5P APIs which are dependent on FORTRAN 2003 -! features. -! -! 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. * -! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -! -! USES -! test_genprop_cls_cb1_mod -! -! CONTAINS SUBROUTINES -! test_create, test_genprop_class_callback -! -!***** - -! ***************************************** -! *** H 5 P T E S T S -! ***************************************** -MODULE test_genprop_cls_cb1_mod - - ! Callback subroutine for test_genprop_class_callback - ! and the function H5Pcreate_class_f. - - USE HDF5 - USE ISO_C_BINDING - IMPLICIT NONE - - TYPE, BIND(C) :: cop_cb_struct_ ! Struct for iterations - INTEGER :: count - INTEGER(HID_T) :: id - END TYPE cop_cb_struct_ - -CONTAINS - - INTEGER FUNCTION test_genprop_cls_cb1_f(list_id, create_data ) bind(C) - - IMPLICIT NONE - - INTEGER(HID_T), INTENT(IN), VALUE :: list_id - - TYPE(cop_cb_struct_) :: create_data - - create_data%count = create_data%count + 1 - create_data%id = list_id - - test_genprop_cls_cb1_f = 0 - - END FUNCTION test_genprop_cls_cb1_f - -END MODULE test_genprop_cls_cb1_mod - -MODULE TH5P_F03 - - USE HDF5 - USE TH5_MISC - USE TH5_MISC_GEN - USE ISO_C_BINDING - -CONTAINS - -!------------------------------------------------------------------------- -! * Function: test_create -! * -! * Purpose: Tests H5Pset_fill_value_f and H5Pget_fill_value_f -! * -! * Return: Success: 0 -! * -! * Failure: number of errors -! * -! * Programmer: M. Scot Breitenfeld -! * June 24, 2008 -! * -! * Modifications: -! * -! *------------------------------------------------------------------------- -! - -SUBROUTINE test_create(total_error) - - IMPLICIT NONE - - INTEGER, INTENT(INOUT) :: total_error - INTEGER(HID_T) :: fapl - - INTEGER(hid_t) :: file=-1, space=-1, dcpl=-1, comp_type_id=-1 - INTEGER(hid_t) :: dset9=-1 - INTEGER(hsize_t), DIMENSION(1:5), PARAMETER :: cur_size = (/2, 8, 8, 4, 2/) - INTEGER(hsize_t), DIMENSION(1:5), PARAMETER :: ch_size= (/1, 1, 1, 4, 1/) - CHARACTER(LEN=14) :: filename ='test_create.h5' - - TYPE(comp_datatype), TARGET :: rd_c, fill_ctype - INTEGER :: error - INTEGER(SIZE_T) :: h5off - TYPE(C_PTR) :: f_ptr - LOGICAL :: differ1, differ2 - CHARACTER(LEN=1) :: cfill - INTEGER :: ifill - REAL :: rfill - REAL(KIND=dp) :: dpfill - - ! - ! * Create a file. - ! - CALL h5fcreate_f(filename,H5F_ACC_TRUNC_F,file,error) - CALL check("h5fcreate_f", error, total_error) - - CALL h5screate_simple_f(5, cur_size, space, error, cur_size) - CALL check("h5screate_simple_f", error, total_error) - - CALL H5Pcreate_f(H5P_DATASET_CREATE_F, dcpl, error) - CALL check("H5Pcreate_f", error, total_error) - - CALL h5pset_chunk_f(dcpl, 5, ch_size, error) - CALL check("h5pset_chunk_f",error, total_error) - - ! Create a compound datatype - CALL h5tcreate_f(H5T_COMPOUND_F, H5_SIZEOF(fill_ctype), comp_type_id, error) - CALL check("h5tcreate_f", error, total_error) - h5off = H5OFFSETOF(C_LOC(fill_ctype), C_LOC(fill_ctype%a)) - CALL h5tinsert_f(comp_type_id, "a", h5off , H5T_NATIVE_REAL, error) - CALL check("h5tinsert_f", error, total_error) - CALL h5tinsert_f(comp_type_id, "x", H5OFFSETOF(C_LOC(fill_ctype), C_LOC(fill_ctype%x)), H5T_NATIVE_INTEGER, error) - CALL check("h5tinsert_f", error, total_error) - CALL h5tinsert_f(comp_type_id, "y", H5OFFSETOF(C_LOC(fill_ctype), C_LOC(fill_ctype%y)), H5T_NATIVE_DOUBLE, error) - CALL check("h5tinsert_f", error, total_error) - CALL h5tinsert_f(comp_type_id, "z", & - H5OFFSETOF(C_LOC(fill_ctype), C_LOC(fill_ctype%z)), H5T_NATIVE_CHARACTER, error) - CALL check("h5tinsert_f", error, total_error) - - - CALL H5Pset_alloc_time_f(dcpl, H5D_ALLOC_TIME_LATE_F,error) - CALL check("H5Pset_alloc_time_f",error, total_error) - - CALL H5Pset_fill_time_f(dcpl, H5D_FILL_TIME_ALLOC_F, error) - CALL check("H5Pset_fill_time_f",error, total_error) - - ! Compound datatype test - - f_ptr = C_LOC(fill_ctype) - - CALL H5Pget_fill_value_f(dcpl, comp_type_id, f_ptr, error) - CALL check("H5Pget_fill_value_f",error, total_error) - - fill_ctype%y = 4444.D0 - fill_ctype%z = 'S' - fill_ctype%a = 5555. - fill_ctype%x = 55 - - f_ptr = C_LOC(fill_ctype) - - ! Test various fill values - CALL H5Pset_fill_value_f(dcpl, H5T_NATIVE_CHARACTER, 'X', error) - CALL check("H5Pset_fill_value_f",error, total_error) - CALL h5pget_fill_value_f(dcpl, H5T_NATIVE_CHARACTER, cfill, error) - CALL check("H5Pget_fill_value_f",error, total_error) - IF(cfill.NE.'X')THEN - PRINT*,"***ERROR: Returned wrong fill value (character)" - total_error = total_error + 1 - ENDIF - CALL H5Pset_fill_value_f(dcpl, H5T_NATIVE_INTEGER, 9, error) - CALL check("H5Pset_fill_value_f",error, total_error) - CALL h5pget_fill_value_f(dcpl, H5T_NATIVE_INTEGER, ifill, error) - CALL check("H5Pget_fill_value_f",error, total_error) - IF(ifill.NE.9)THEN - PRINT*,"***ERROR: Returned wrong fill value (integer)" - total_error = total_error + 1 - ENDIF - CALL H5Pset_fill_value_f(dcpl, H5T_NATIVE_DOUBLE, 1.0_dp, error) - CALL check("H5Pset_fill_value_f",error, total_error) - CALL h5pget_fill_value_f(dcpl, H5T_NATIVE_DOUBLE, dpfill, error) - CALL check("H5Pget_fill_value_f",error, total_error) - CALL VERIFY("***ERROR: Returned wrong fill value (double)", dpfill, 1.0_dp, total_error) - CALL H5Pset_fill_value_f(dcpl, H5T_NATIVE_REAL, 2.0, error) - CALL check("H5Pset_fill_value_f",error, total_error) - CALL h5pget_fill_value_f(dcpl, H5T_NATIVE_REAL, rfill, error) - CALL check("H5Pget_fill_value_f",error, total_error) - CALL VERIFY("***ERROR: Returned wrong fill value (real)", rfill, 2.0, total_error) - - ! For the actual compound type - CALL H5Pset_fill_value_f(dcpl, comp_type_id, f_ptr, error) - CALL check("H5Pget_fill_value_f",error, total_error) - - CALL h5dcreate_f(file,"dset9", comp_type_id, space, dset9, error, dcpl_id=dcpl) - CALL check("h5dcreate_f", error, total_error) - - CALL h5dclose_f(dset9, error) - CALL check("h5dclose_f", error, total_error) - - CALL h5fclose_f(file,error) - CALL check("h5fclose_f", error, total_error) - - ! Open the file and get the dataset fill value from each dataset - CALL H5Pcreate_f(H5P_FILE_ACCESS_F, fapl, error) - CALL check("H5Pcreate_f",error, total_error) - - CALL H5Pset_libver_bounds_f(fapl, H5F_LIBVER_LATEST_F, H5F_LIBVER_LATEST_F, error) - CALL check("H5Pset_libver_bounds_f",error, total_error) - - CALL h5fopen_f (FILENAME, H5F_ACC_RDONLY_F, file, error, fapl) - CALL check("h5fopen_f", error, total_error) - - ! Compound datatype test - CALL h5dopen_f(file, "dset9", dset9, error) - CALL check("h5dopen_f", error, total_error) - - CALL H5Dget_create_plist_f(dset9, dcpl, error) - CALL check("H5Dget_create_plist_f", error, total_error) - - f_ptr = C_LOC(rd_c) - - CALL H5Pget_fill_value_f(dcpl, comp_type_id, f_ptr, error) - CALL check("H5Pget_fill_value_f", error, total_error) - CALL verify("***ERROR: Returned wrong fill value", rd_c%a, fill_ctype%a, total_error) - CALL verify("***ERROR: Returned wrong fill value", rd_c%y, fill_ctype%y, total_error) - - IF( rd_c%x .NE. fill_ctype%x .OR. & - rd_c%z .NE. fill_ctype%z )THEN - - PRINT*,"***ERROR: Returned wrong fill value" - total_error = total_error + 1 - - ENDIF - - CALL h5dclose_f(dset9, error) - CALL check("h5dclose_f", error, total_error) - - CALL H5Pclose_f(dcpl, error) - CALL check("H5Pclose_f", error, total_error) - - CALL h5fclose_f(file,error) - CALL check("h5fclose_f", error, total_error) - -END SUBROUTINE test_create - - -SUBROUTINE test_genprop_class_callback(total_error) - - ! - ! - ! test_genprop_class_callback(): Test basic generic property list code. - ! Tests callbacks for property lists in a generic class. - ! - ! FORTRAN TESTS: - ! Tests function H5Pcreate_class_f with callback. - ! - ! - - USE test_genprop_cls_cb1_mod - IMPLICIT NONE - - INTEGER, INTENT(INOUT) :: total_error - - INTEGER(hid_t) :: cid1, cid2 ! Generic Property class ID - INTEGER(hid_t) :: lid1, lid2 ! Generic Property list ID - INTEGER(size_t) :: nprops ! Number of properties in class - - TYPE(cop_cb_struct_), TARGET :: crt_cb_struct, cls_cb_struct - INTEGER :: CLASS1_NAME_SIZE = 7 ! length of class string - CHARACTER(LEN=7) :: CLASS1_NAME = "Class 1", CLASS1_NAME_BUF - TYPE(C_FUNPTR) :: f1, f5 - TYPE(C_PTR) :: f2, f6 - - CHARACTER(LEN=10) :: PROP1_NAME = "Property 1" - INTEGER(SIZE_T) :: PROP1_SIZE = 10 - CHARACTER(LEN=10) :: PROP2_NAME = "Property 2" - INTEGER(SIZE_T) :: PROP2_SIZE = 10 - CHARACTER(LEN=10) :: PROP3_NAME = "Property 3" - INTEGER(SIZE_T) :: PROP3_SIZE = 10 - CHARACTER(LEN=10) :: PROP4_NAME = "Property 4" - INTEGER(SIZE_T) :: PROP4_SIZE = 10 - INTEGER :: PROP1_DEF_VALUE = 10 - INTEGER :: PROP2_DEF_VALUE = 10 - INTEGER :: PROP3_DEF_VALUE = 10 - INTEGER :: PROP4_DEF_VALUE = 10 - - INTEGER :: error ! Generic RETURN value - LOGICAL :: flag ! for tests - - f1 = C_FUNLOC(test_genprop_cls_cb1_f) - f5 = C_FUNLOC(test_genprop_cls_cb1_f) - - f2 = C_LOC(crt_cb_struct) - f6 = C_LOC(cls_cb_struct) - - ! Create a new generic class, derived from the root of the class hierarchy - CALL h5pcreate_class_f(h5p_ROOT_F, CLASS1_NAME, cid1, error, f1, f2, c_null_funptr, c_null_ptr, f5, f6) - CALL check("h5pcreate_class_f", error, total_error) - - ! Insert first property into class (with no callbacks) - CALL h5pregister_f(cid1, PROP1_NAME, PROP1_SIZE, PROP1_DEF_VALUE, error) - CALL check("h5pregister_f", error, total_error) - ! Insert second property into class (with no callbacks) - CALL h5pregister_f(cid1, PROP2_NAME, PROP2_SIZE, PROP2_DEF_VALUE, error) - CALL check("h5pregister_f", error, total_error) - ! Insert third property into class (with no callbacks) - CALL h5pregister_f(cid1, PROP3_NAME, PROP3_SIZE, PROP3_DEF_VALUE, error) - CALL check("h5pregister_f", error, total_error) - - ! Insert fourth property into class (with no callbacks) - CALL h5pregister_f(cid1, PROP4_NAME, PROP4_SIZE, PROP4_DEF_VALUE, error) - CALL check("h5pregister_f", error, total_error) - - ! Check the number of properties in class - CALL h5pget_nprops_f(cid1, nprops, error) - CALL check("h5pget_nprops_f", error, total_error) - CALL verify("h5pget_nprops_f", INT(nprops), 4, total_error) - - ! Initialize class callback structs - - crt_cb_struct%count = 0 - crt_cb_struct%id = -1 - cls_cb_struct%count = 0 - cls_cb_struct%id = -1 - - ! Create a property list from the class - CALL h5pcreate_f(cid1, lid1, error) - CALL check("h5pcreate_f", error, total_error) - - ! Get the list's class - CALL H5Pget_class_f(lid1, cid2, error) - CALL check("H5Pget_class_f", error, total_error) - - ! Check that the list's class is correct - CALL H5Pequal_f(cid2, cid1, flag, error) - CALL check("H5Pequal_f", error, total_error) - CALL verify("H5Pequal_f", flag, .TRUE., total_error) - - ! Check the class name - CALL H5Pget_class_name_f(cid2, CLASS1_NAME_BUF, CLASS1_NAME_SIZE, error) - CALL check("H5Pget_class_name_f", error, total_error) - CALL verify("H5Pget_class_name_f", CLASS1_NAME_BUF, CLASS1_NAME, error) - IF(error.NE.0)THEN - WRITE(*,*) 'Class names do not match! name=',CLASS1_NAME_BUF, 'CLASS1_NAME=',CLASS1_NAME - total_error = total_error + 1 - ENDIF - ! Close class - CALL h5pclose_class_f(cid2, error) - CALL check("h5pclose_class_f", error, total_error) - - ! Verify that the creation callback occurred - CALL verify("h5pcreate_f", crt_cb_struct%count, 1, total_error) - CALL verify("h5pcreate_f", crt_cb_struct%id, lid1, total_error) - - ! Check the number of properties in list - CALL h5pget_nprops_f(lid1,nprops, error) - CALL check("h5pget_nprops_f", error, total_error) - CALL verify("h5pget_nprops_f", INT(nprops), 4, total_error) - - ! Create another property list from the class - CALL h5pcreate_f(cid1, lid2, error) - CALL check("h5pcreate_f", error, total_error) - - ! Verify that the creation callback occurred - CALL verify("h5pcreate_f", crt_cb_struct%count, 2, total_error) - CALL verify("h5pcreate_f", crt_cb_struct%id, lid2, total_error) - - ! Check the number of properties in list - CALL h5pget_nprops_f(lid2,nprops, error) - CALL check("h5pget_nprops_f", error, total_error) - CALL verify("h5pget_nprops_f", INT(nprops), 4, total_error) - - ! Close first list - CALL h5pclose_f(lid1, error); - CALL check("h5pclose_f", error, total_error) - - ! Verify that the close callback occurred - CALL verify("h5pcreate_f", cls_cb_struct%count, 1, total_error) - CALL verify("h5pcreate_f", cls_cb_struct%id, lid1, total_error) - - ! Close second list - CALL h5pclose_f(lid2, error); - CALL check("h5pclose_f", error, total_error) - - ! Verify that the close callback occurred - CALL verify("h5pcreate_f", cls_cb_struct%count, 2, total_error) - CALL verify("h5pcreate_f", cls_cb_struct%id, lid2, total_error) - - ! Close class - CALL h5pclose_class_f(cid1, error) - CALL check("h5pclose_class_f", error, total_error) - -END SUBROUTINE test_genprop_class_callback - -!------------------------------------------------------------------------- -! Function: test_h5p_file_image -! -! Purpose: Tests APIs: -! h5pget_file_image_f and h5pset_file_image_f -! -! Return: Success: 0 -! Failure: -1 -! -! FORTRAN Programmer: M. Scot Breitenfeld -! April 1, 2014 -!------------------------------------------------------------------------- - -SUBROUTINE test_h5p_file_image(total_error) - - USE, INTRINSIC :: iso_c_binding - IMPLICIT NONE - INTEGER, INTENT(INOUT) :: total_error - INTEGER(hid_t) :: fapl_1 = -1 - INTEGER, PARAMETER :: count = 10 - INTEGER, DIMENSION(1:count), TARGET :: buffer - INTEGER, DIMENSION(1:count), TARGET :: temp - INTEGER :: i - INTEGER(size_t) :: size - INTEGER(size_t) :: temp_size - INTEGER :: error ! error return value - TYPE(C_PTR) :: f_ptr - TYPE(C_PTR), DIMENSION(1:count) :: f_ptr1 - TYPE(C_PTR), DIMENSION(1:1) :: f_ptr2 - - INTEGER(HSIZE_T) :: sizeof_buffer - - ! Initialize file image buffer - DO i = 1, count - buffer(i) = i*10 - ENDDO - - ! Create fapl - CALL h5pcreate_f(H5P_FILE_ACCESS_F, fapl_1, error) - CALL check("h5pcreate_f", error, total_error) - - ! Test with NULL ptr - f_ptr2(1) = C_NULL_PTR - temp_size = 1 - CALL h5pget_file_image_f(fapl_1, f_ptr2, temp_size, error) - CALL check("h5pget_file_image_f", error, total_error) - CALL verify("h5pget_file_image_f", INT(temp_size), 0, total_error) - - ! Set file image - f_ptr = C_LOC(buffer(1)) - size = H5_SIZEOF(buffer(1))*count - - CALL h5pset_file_image_f(fapl_1, f_ptr, size, error) - CALL check("h5pset_file_image_f", error, total_error) - - ! Get the same data back - DO i = 1, count - f_ptr1(i) = C_LOC(temp(i)) - ENDDO - - temp_size = 0 - CALL h5pget_file_image_f(fapl_1, f_ptr1, temp_size, error) - CALL check("h5pget_file_image_f", error, total_error) - - ! Check that sizes are the same, and that the buffers are identical but separate - CALL verify("h5pget_file_image_f", INT(temp_size), INT(size), total_error) - - ! Verify the image data is correct - DO i = 1, count - CALL verify("h5pget_file_image_f", temp(i), buffer(i), total_error) - ENDDO - -END SUBROUTINE test_h5p_file_image - -!------------------------------------------------------------------------- -! Function: external_test_offset -! -! Purpose: Tests APIs: -! h5pset_external_f (with offsets not equal to zero), h5pget_external_f -! -! Return: Success: 0 -! Failure: -1 -! -! FORTRAN Programmer: M. Scot Breitenfeld -! January 10, 2012 -!------------------------------------------------------------------------- -! -SUBROUTINE external_test_offset(cleanup,total_error) - - IMPLICIT NONE - INTEGER, INTENT(INOUT) :: total_error - LOGICAL, INTENT(IN) :: cleanup - - INTEGER(hid_t) :: fapl=-1 ! file access property list - INTEGER(hid_t) :: file=-1 ! file to write to - INTEGER(hid_t) :: dcpl=-1 ! dataset creation properties - INTEGER(hid_t) :: space=-1 ! data space - INTEGER(hid_t) :: dset=-1 ! dataset - INTEGER(hid_t) :: grp=-1 ! group to emit diagnostics - INTEGER(size_t) :: i, j ! miscellaneous counters - CHARACTER(LEN=180) :: filename ! file names - INTEGER, DIMENSION(1:25) :: part - INTEGER, DIMENSION(1:100), TARGET :: whole ! raw data buffers - INTEGER(hsize_t), DIMENSION(1:1) :: cur_size ! current data space size - INTEGER(hid_t) :: hs_space ! hyperslab data space - INTEGER(hsize_t), DIMENSION(1:1) :: hs_start = (/30/) ! hyperslab starting offset - INTEGER(hsize_t), DIMENSION(1:1) :: hs_count = (/25/) ! hyperslab size - CHARACTER(LEN=1) :: ichr1 ! character conversion holder - INTEGER :: error ! error status - TYPE(C_PTR) :: f_ptr ! fortran pointer - INTEGER(HSIZE_T) :: sizeof_part - - CHARACTER(LEN=1,KIND=C_CHAR), DIMENSION(1:30) :: temparray - - temparray(1:30)(1:1) = '0' ! 1 byte character - - ! Write the data to external files directly - DO i = 1, 4 - DO j = 1, 25 - part(j) = (i-1)*25+(j-1) - ENDDO - WRITE(ichr1,'(I1.1)') i - filename = "extern_"//ichr1//"a.raw" - OPEN(10, FILE=filename, ACCESS='STREAM', form='UNFORMATTED') - - WRITE(10) temparray(1:(i-1)*10) - WRITE(10) part - CLOSE(10) - ENDDO - ! - ! Create the file and an initial group. - CALL h5pcreate_f(H5P_FILE_ACCESS_F, fapl, error) - CALL h5fcreate_f('extren_raw.h5', H5F_ACC_TRUNC_F, file, error, access_prp=fapl) - CALL check("h5fcreate_f",error,total_error) - - CALL h5gcreate_f(file, "emit-diagnostics", grp, error) - CALL check("h5gcreate_f",error, total_error) - - ! Create the dataset - - sizeof_part = INT(H5_SIZEOF(part(1))*25, hsize_t) - - CALL h5pcreate_f(H5P_DATASET_CREATE_F, dcpl, error) - CALL check("h5pcreate_f", error, total_error) - CALL h5pset_external_f(dcpl, "extern_1a.raw", INT(0,off_t), sizeof_part, error) - CALL check("h5pset_external_f",error,total_error) - CALL h5pset_external_f(dcpl, "extern_2a.raw", INT(10,off_t), sizeof_part, error) - CALL check("h5pset_external_f",error,total_error) - CALL h5pset_external_f(dcpl, "extern_3a.raw", INT(20,off_t), sizeof_part, error) - CALL check("h5pset_external_f",error,total_error) - CALL h5pset_external_f(dcpl, "extern_4a.raw", INT(30,off_t), sizeof_part, error) - CALL check("h5pset_external_f",error,total_error) - - cur_size(1) = 100 - CALL h5screate_simple_f(1, cur_size, space, error) - CALL check("h5screate_simple_f", error, total_error) - CALL h5dcreate_f(file, "dset1", H5T_NATIVE_INTEGER, space, dset,error,dcpl_id=dcpl) - CALL check("h5dcreate_f", error, total_error) - - ! - ! Read the entire dataset and compare with the original - whole(:) = 0 - f_ptr = C_LOC(whole(1)) - CALL h5dread_f(dset, H5T_NATIVE_INTEGER, f_ptr, error, mem_space_id=space, file_space_id=space) - CALL check("h5dread_f", error, total_error) - - DO i = 1, 100 - IF(whole(i) .NE. i-1)THEN - WRITE(*,*) "Incorrect value(s) read." - total_error = total_error + 1 - EXIT - ENDIF - ENDDO - ! - ! Read the middle of the dataset - CALL h5scopy_f(space, hs_space, error) - CALL check("h5scopy_f", error, total_error) - CALL h5sselect_hyperslab_f(hs_space, H5S_SELECT_SET_F, hs_start, hs_count, error) - CALL check("h5sselect_hyperslab_f", error, total_error) - - whole(:) = 0 - f_ptr = C_LOC(whole(1)) - CALL h5dread_f(dset, H5T_NATIVE_INTEGER, f_ptr, error, mem_space_id=hs_space, file_space_id=hs_space) - CALL check("h5dread_f", error, total_error) - - CALL h5sclose_f(hs_space, error) - CALL check("h5sclose_f", error, total_error) - DO i = INT(hs_start(1))+1, INT(hs_start(1)+hs_count(1)) - IF(whole(i) .NE. i-1)THEN - WRITE(*,*) "Incorrect value(s) read." - total_error = total_error + 1 - EXIT - ENDIF - ENDDO - - CALL h5dclose_f(dset, error) - CALL check("h5dclose_f", error, total_error) - CALL h5pclose_f(dcpl, error) - CALL check("h5pclose_f", error, total_error) - CALL h5sclose_f(space, error) - CALL check("h5sclose_f", error, total_error) - CALL h5fclose_f(file, error) - CALL check("h5fclose_f", error, total_error) - - ! cleanup - DO i = 1, 4 - WRITE(ichr1,'(I1.1)') i - filename = "extern_"//ichr1//"a.raw" - CALL h5_cleanup_f(filename, H5P_DEFAULT_F, error) - CALL check("h5_cleanup_f", error, total_error) - ENDDO - IF(cleanup) CALL h5_cleanup_f("extren_raw.h5", H5P_DEFAULT_F, error) - CALL check("h5_cleanup_f", error, total_error) - -END SUBROUTINE external_test_offset -END MODULE TH5P_F03 diff --git a/fortran/test/tH5R.F90 b/fortran/test/tH5R.F90 new file mode 100644 index 0000000..ef392b4 --- /dev/null +++ b/fortran/test/tH5R.F90 @@ -0,0 +1,483 @@ +!****h* root/fortran/test/tH5R.f90 +! +! NAME +! tH5R.f90 +! +! FUNCTION +! Basic testing of Fortran H5R, Reference Interface, 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. * +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! +! NOTES +! Tests h5rcreate_f, h5rdereference_f, h5rget_name_f +! and H5Rget_object_type functions +! +! CONTAINS SUBROUTINES +! refobjtest, refregtest +! +!***** +! +MODULE TH5R + + USE HDF5 + USE TH5_MISC + USE TH5_MISC_GEN + +CONTAINS + +SUBROUTINE refobjtest(cleanup, total_error) + IMPLICIT NONE + LOGICAL, INTENT(IN) :: cleanup + INTEGER, INTENT(INOUT) :: total_error + + CHARACTER(LEN=9), PARAMETER :: filename = "reference" + CHARACTER(LEN=80) :: fix_filename + CHARACTER(LEN=8), PARAMETER :: dsetnamei = "INTEGERS" + CHARACTER(LEN=17), PARAMETER :: dsetnamer = "OBJECT_REFERENCES" + CHARACTER(LEN=6), PARAMETER :: groupname1 = "GROUP1" + CHARACTER(LEN=6), PARAMETER :: groupname2 = "GROUP2" + + INTEGER(HID_T) :: file_id ! File identifier + INTEGER(HID_T) :: grp1_id ! Group identifier + INTEGER(HID_T) :: grp2_id ! Group identifier + INTEGER(HID_T) :: dset1_id ! Dataset identifier + INTEGER(HID_T) :: dsetr_id ! Dataset identifier + INTEGER(HID_T) :: type_id ! Type identifier + INTEGER(HID_T) :: space_id ! Dataspace identifier + INTEGER(HID_T) :: spacer_id ! Dataspace identifier + INTEGER :: error, obj_type + INTEGER(HSIZE_T), DIMENSION(1) :: dims = (/5/) + INTEGER(HSIZE_T), DIMENSION(1) :: dimsr= (/4/) + INTEGER(HSIZE_T), DIMENSION(1) :: my_maxdims = (/5/) + INTEGER :: rank = 1 + INTEGER :: rankr = 1 + TYPE(hobj_ref_t_f), DIMENSION(4) :: ref + TYPE(hobj_ref_t_f), DIMENSION(4) :: ref_out + INTEGER(HSIZE_T), DIMENSION(1) :: ref_dim + INTEGER, DIMENSION(5) :: DATA = (/1, 2, 3, 4, 5/) + INTEGER(HSIZE_T), DIMENSION(2) :: data_dims + + CHARACTER(LEN=7) :: buf ! buffer to hold the region name + CHARACTER(LEN=16) :: buf_big ! buffer bigger then needed + INTEGER(SIZE_T) :: buf_size ! returned size of the region buffer name + + ! + !Create a new file with Default file access and + !file creation properties . + ! + CALL h5_fixname_f(filename, fix_filename, H5P_DEFAULT_F, error) + IF (error .NE. 0) THEN + WRITE(*,*) "Cannot modify filename" + STOP + ENDIF + CALL h5fcreate_f(fix_filename, H5F_ACC_TRUNC_F, file_id, error) + CALL check("h5fcreate_f",error,total_error) + + + ! + ! Create a group inside the file + ! + CALL h5gcreate_f(file_id, groupname1, grp1_id, error) + CALL check("h5gcreate_f",error,total_error) + + ! + ! Create a group inside the group GROUP1 + ! + CALL h5gcreate_f(grp1_id, groupname2, grp2_id, error) + CALL check("h5gcreate_f",error,total_error) + + ! + ! Create dataspaces for datasets + ! + CALL h5screate_simple_f(rank, dims, space_id, error, maxdims=my_maxdims) + CALL check("h5screate_simple_f",error,total_error) + CALL h5screate_simple_f(rankr, dimsr, spacer_id, error) + CALL check("h5screate_simple_f",error,total_error) + + ! + ! Create integer dataset + ! + CALL h5dcreate_f(file_id, dsetnamei, H5T_NATIVE_INTEGER, space_id, & + dset1_id, error) + CALL check("h5dcreate_f",error,total_error) + ! + ! Create dataset to store references to the objects + ! + CALL h5dcreate_f(file_id, dsetnamer, H5T_STD_REF_OBJ, spacer_id, & + dsetr_id, error) + CALL check("h5dcreate_f",error,total_error) + ! + ! Create a datatype and store in the file + ! + CALL h5tcopy_f(H5T_NATIVE_REAL, type_id, error) + CALL check("h5tcopy_f",error,total_error) + CALL h5tcommit_f(file_id, "MyType", type_id, error) + CALL check("h5tcommit_f",error,total_error) + ! + ! Close dataspaces, groups and integer dataset + ! + CALL h5sclose_f(space_id, error) + CALL check("h5sclose_f",error,total_error) + CALL h5sclose_f(spacer_id, error) + CALL check("h5sclose_f",error,total_error) + CALL h5dclose_f(dset1_id, error) + CALL check("h5dclose_f",error,total_error) + CALL h5tclose_f(type_id, error) + CALL check("h5tclose_f",error,total_error) + CALL h5gclose_f(grp1_id, error) + CALL check("h5gclose_f",error,total_error) + CALL h5gclose_f(grp2_id, error) + CALL check("h5gclose_f",error,total_error) + + ! + ! Craete references to two groups, integer dataset and shared datatype + ! and write it to the dataset in the file + ! + CALL h5rcreate_f(file_id, groupname1, ref(1), error) + CALL check("h5rcreate_f",error,total_error) + CALL h5rcreate_f(file_id, "/GROUP1/GROUP2", ref(2), error) + CALL check("h5rcreate_f",error,total_error) + CALL h5rcreate_f(file_id, dsetnamei, ref(3), error) + CALL check("h5rcreate_f",error,total_error) + CALL h5rcreate_f(file_id, "MyType", ref(4), error) + CALL check("h5rcreate_f",error,total_error) + ref_dim(1) = SIZE(ref) + CALL h5dwrite_f(dsetr_id, H5T_STD_REF_OBJ, ref, ref_dim, error) + CALL check("h5dwrite_f",error,total_error) + + ! getting path to normal dataset in root group + + CALL H5Rget_name_f(dsetr_id, ref(1), buf, error, buf_size ) + CALL check("H5Rget_name_f", error, total_error) + + + CALL verify("H5Rget_name_f", INT(buf_size),7, total_error) + CALL verify("H5Rget_name_f", buf, "/GROUP1", total_error) + + ! with buffer bigger then needed + + CALL H5Rget_name_f(dsetr_id, ref(1), buf_big, error, buf_size ) + CALL check("H5Rget_name_f", error, total_error) + CALL verify("H5Rget_name_f", INT(buf_size),7,total_error) + CALL verify("H5Rget_name_f", TRIM(buf_big), "/GROUP1", total_error) + + ! getting path to dataset in /Group1 + + CALL H5Rget_name_f(dsetr_id, ref(2), buf_big, error, buf_size ) + CALL check("H5Rget_name_f", error, total_error) + CALL verify("H5Rget_name_f", INT(buf_size),14,total_error) + CALL verify("H5Rget_name_f", TRIM(buf_big), "/GROUP1/GROUP2", total_error) + + ! + !Close the dataset + ! + CALL h5dclose_f(dsetr_id, error) + CALL check("h5dclose_f",error,total_error) + + ! + ! Reopen the dataset with object references + ! + CALL h5dopen_f(file_id, dsetnamer,dsetr_id,error) + CALL check("h5dopen_f",error,total_error) + ref_dim(1) = SIZE(ref_out) + CALL h5dread_f(dsetr_id, H5T_STD_REF_OBJ, ref_out, ref_dim, error) + CALL check("h5dread_f",error,total_error) + + ! + !get the third reference's type and Dereference it + ! + CALL h5rget_object_type_f(dsetr_id, ref(3), obj_type, error) + CALL check("h5rget_object_type_f",error,total_error) + IF (obj_type == H5G_DATASET_F) THEN + CALL h5rdereference_f(dsetr_id, ref(3), dset1_id, error) + CALL check("h5rdereference_f",error,total_error) + + data_dims(1) = 5 + CALL h5dwrite_f(dset1_id, H5T_NATIVE_INTEGER, DATA, data_dims, error) + CALL check("h5dwrite_f",error,total_error) + END IF + + ! + !get the fourth reference's type and Dereference it + ! + CALL h5rget_object_type_f(dsetr_id, ref(4), obj_type, error) + CALL check("h5rget_object_type_f",error,total_error) + IF (obj_type == H5G_TYPE_F) THEN + CALL h5rdereference_f(dsetr_id, ref(4), type_id, error) + CALL check("h5rdereference_f",error,total_error) + END IF + + ! + ! Close all objects. + ! + CALL h5dclose_f(dset1_id, error) + CALL check("h5dclose_f",error,total_error) + CALL h5tclose_f(type_id, error) + CALL check("h5tclose_f",error,total_error) + + CALL h5dclose_f(dsetr_id, error) + CALL check("h5dclose_f",error,total_error) + CALL h5fclose_f(file_id, error) + CALL check("h5fclose_f",error,total_error) + + IF(cleanup) CALL h5_cleanup_f(filename, H5P_DEFAULT_F, error) + CALL check("h5_cleanup_f", error, total_error) + RETURN + +END SUBROUTINE refobjtest +! +! The following subroutine tests h5rget_region_f, h5rcreate_f, h5rget_name_f, +! and h5rdereference_f functionalities +! +SUBROUTINE refregtest(cleanup, total_error) + + IMPLICIT NONE + LOGICAL, INTENT(IN) :: cleanup + INTEGER, INTENT(INOUT) :: total_error + + CHARACTER(LEN=6), PARAMETER :: filename = "Refreg" + CHARACTER(LEN=80) :: fix_filename + CHARACTER(LEN=6), PARAMETER :: dsetnamev = "MATRIX" + CHARACTER(LEN=17), PARAMETER :: dsetnamer = "REGION_REFERENCES" + + CHARACTER(LEN=7) :: buf ! buffer to hold the region name + CHARACTER(LEN=11) :: buf_big ! buffer bigger then needed + CHARACTER(LEN=4) :: buf_small ! buffer smaller then needed + INTEGER(SIZE_T) :: buf_size ! returned size of the region buffer name + INTEGER(HID_T) :: file_id ! File identifier + INTEGER(HID_T) :: space_id ! Dataspace identifier + INTEGER(HID_T) :: spacer_id ! Dataspace identifier + INTEGER(HID_T) :: dsetv_id ! Dataset identifier + INTEGER(HID_T) :: dsetr_id ! Dataset identifier + INTEGER :: error +! TYPE(hdset_reg_ref_t_f) , DIMENSION(1:2), TARGET :: ref + TYPE(hdset_reg_ref_t_f) , DIMENSION(1:2) :: ref + TYPE(hdset_reg_ref_t_f) , DIMENSION(1:2) :: ref_out + INTEGER(HSIZE_T), DIMENSION(2) :: ref_dim = (/0,0/) + INTEGER(HSIZE_T), DIMENSION(2) :: data_dims ! = (/0,0/) + INTEGER(HSIZE_T), DIMENSION(2) :: dims = (/2,9/) ! Datasets dimensions + INTEGER(HSIZE_T), DIMENSION(1) :: dimsr = (/2/) ! + INTEGER(HSIZE_T), DIMENSION(2) :: start ! = (/0,0/) + INTEGER(HSIZE_T), DIMENSION(2) :: count ! = (/0,0/) + + INTEGER :: rankr = 1 + INTEGER :: rank = 2 +! INTEGER , DIMENSION(2,9), TARGET :: DATA + INTEGER , DIMENSION(2,9) :: DATA + INTEGER , DIMENSION(2,9) :: data_out = 0 + INTEGER(HSIZE_T) , DIMENSION(2,3) :: coord + INTEGER(SIZE_T) ::num_points = 3 ! Number of selected points +! type(c_ptr) :: f_ptr + coord = RESHAPE((/1,1,2,7,1,9/), (/2,3/)) ! Coordinates of selected points + DATA = RESHAPE ((/1,1,1,2,2,2,3,3,3,4,4,4,5,5,5,6,6,6/), (/2,9/)) + + ref_out(1)%ref = 0 + ref_out(2)%ref = 0 + + ! + ! Initialize FORTRAN predefined datatypes. + ! + ! CALL h5init_types_f(error) + ! CALL check("h5init_types_f", error, total_error) + ! + ! Create a new file. + ! + CALL h5_fixname_f(filename, fix_filename, H5P_DEFAULT_F, error) + IF (error .NE. 0) THEN + WRITE(*,*) "Cannot modify filename" + STOP + ENDIF + CALL h5fcreate_f(fix_filename, H5F_ACC_TRUNC_F, file_id, error) + ! Default file access and file creation + ! properties are used. + CALL check("h5fcreate_f", error, total_error) + ! + ! Create dataspaces: + ! + ! for dataset with references to dataset regions + ! + CALL h5screate_simple_f(rankr, dimsr, spacer_id, error) + CALL check("h5screate_simple_f", error, total_error) + ! + ! for integer dataset + ! + CALL h5screate_simple_f(rank, dims, space_id, error) + CALL check("h5screate_simple_f", error, total_error) + ! + ! Create and write datasets: + ! + ! Integer dataset + ! + CALL h5dcreate_f(file_id, dsetnamev, H5T_NATIVE_INTEGER, space_id, & + dsetv_id, error) + CALL check("h5dcreate_f", error, total_error) + data_dims(1) = 2 + data_dims(2) = 9 + +! f_ptr = c_loc(data) +! CALL h5dwrite_f(dsetv_id, H5T_NATIVE_INTEGER, f_ptr, error) + + CALL h5dwrite_f(dsetv_id, H5T_NATIVE_INTEGER, DATA, data_dims, error) + CALL check("h5dwrite_f", error, total_error) + + CALL h5dclose_f(dsetv_id, error) + CALL check("h5dclose_f", error, total_error) + + ! + ! Dataset with references + ! + CALL h5dcreate_f(file_id, dsetnamer, H5T_STD_REF_DSETREG, spacer_id, & + dsetr_id, error) + CALL check("h5dcreate_f", error, total_error) + ! + ! Create a reference to the hyperslab selection. + ! + start(1) = 0 + start(2) = 3 + COUNT(1) = 2 + COUNT(2) = 3 + CALL h5sselect_hyperslab_f(space_id, H5S_SELECT_SET_F, & + start, count, error) + CALL check("h5sselect_hyperslab_f", error, total_error) + ref(1)%ref(:) = 0 +! f_ptr = C_LOC(ref(1)) +! CALL h5rcreate_f(file_id, dsetnamev, 1, space_id, f_ptr, error) + CALL h5rcreate_f(file_id, dsetnamev, space_id, ref(1), error) + CALL check("h5rcreate_f", error, total_error) + + ! + ! Create a reference to elements selection. + ! + CALL h5sselect_none_f(space_id, error) + CALL check("h5sselect_none_f", error, total_error) + CALL h5sselect_elements_f(space_id, H5S_SELECT_SET_F, rank, num_points,& + coord, error) + CALL check("h5sselect_elements_f", error, total_error) + ref(2)%ref(:) = 0 + CALL h5rcreate_f(file_id, dsetnamev, space_id, ref(2), error) + CALL check("h5rcreate_f", error, total_error) + ! + ! Write dataset with the references. + ! + ref_dim(1) = SIZE(ref) + CALL h5dwrite_f(dsetr_id, H5T_STD_REF_DSETREG, ref, ref_dim, error) + CALL check("h5dwrite_f", error, total_error) + ! + ! Close all objects. + ! + CALL h5sclose_f(space_id, error) + CALL check("h5sclose_f", error, total_error) + CALL h5sclose_f(spacer_id, error) + CALL check("h5sclose_f", error, total_error) + CALL h5dclose_f(dsetr_id, error) + CALL check("h5dclose_f", error, total_error) + CALL h5fclose_f(file_id, error) + CALL check("h5fclose_f", error, total_error) + + ! + ! Reopen the file to test selections. + ! + CALL h5fopen_f (fix_filename, H5F_ACC_RDWR_F, file_id, error) + CALL check("h5fopen_f", error, total_error) + CALL h5dopen_f(file_id, dsetnamer, dsetr_id, error) + CALL check("h5dopen_f", error, total_error) + ! + ! Read references to the dataset regions. + ! + ref_dim(1) = SIZE(ref_out) + CALL h5dread_f(dsetr_id, H5T_STD_REF_DSETREG, ref_out, ref_dim, error) + CALL check("h5dread_f", error, total_error) + + ! Get name of the dataset the first region reference points to using H5Rget_name_f + CALL H5Rget_name_f(dsetr_id, ref_out(1), buf, error, buf_size ) + CALL check("H5Rget_name_f", error, total_error) + CALL verify("H5Rget_name_f", INT(buf_size),7,total_error) + CALL verify("H5Rget_name_f", buf, "/MATRIX", total_error) + + ! Get name of the dataset the first region reference points to using H5Rget_name_f + ! buffer bigger then needed + CALL H5Rget_name_f(dsetr_id, ref_out(1), buf_big, error, buf_size ) + CALL check("H5Rget_name_f", error, total_error) + CALL verify("H5Rget_name_f", INT(buf_size),7,total_error) + CALL verify("H5Rget_name_f", TRIM(buf_big), "/MATRIX", total_error) + + + ! Get name of the dataset the first region reference points to using H5Rget_name_f + ! buffer smaller then needed + CALL H5Rget_name_f(dsetr_id, ref_out(1), buf_small, error, buf_size ) + CALL check("H5Rget_name_f", error, total_error) + CALL verify("H5Rget_name_f", INT(buf_size),7,total_error) + CALL verify("H5Rget_name_f", TRIM(buf_small), "/MAT", total_error) + ! + ! Dereference the first reference. + ! + CALL H5rdereference_f(dsetr_id, ref_out(1), dsetv_id, error) + CALL check("h5rdereference_f", error, total_error) + CALL H5rget_region_f(dsetr_id, ref_out(1), space_id, error) + CALL check("h5rget_region_f", error, total_error) + + ! Get name of the dataset the second region reference points to using H5Rget_name_f + CALL H5Rget_name_f(dsetr_id, ref_out(2), buf, error) ! no optional size + CALL check("H5Rget_name_f", error, total_error) + CALL verify("H5Rget_name_f", TRIM(buf), "/MATRIX", total_error) + ! + ! Read selected data from the dataset. + ! + data_dims(1) = 2 + data_dims(2) = 9 + CALL h5dread_f(dsetv_id, H5T_NATIVE_INTEGER, data_out, data_dims, error, & + mem_space_id = space_id, file_space_id = space_id) + CALL check("h5dread_f", error, total_error) + CALL h5sclose_f(space_id, error) + CALL check("h5sclose_f", error, total_error) + CALL h5dclose_f(dsetv_id, error) + CALL check("h5dclose_f", error, total_error) + data_out = 0 + ! + ! Dereference the second reference. + ! + CALL H5rdereference_f(dsetr_id, ref_out(2), dsetv_id, error) + CALL check("h5rdereference_f", error, total_error) + + CALL H5rget_region_f(dsetr_id, ref_out(2), space_id, error) + CALL check("h5rget_region_f", error, total_error) + ! + ! Read selected data from the dataset. + ! + CALL h5dread_f(dsetv_id, H5T_NATIVE_INTEGER, data_out, data_dims, error, & + mem_space_id = space_id, file_space_id = space_id) + CALL check("h5dread_f", error, total_error) + ! + ! Close all objects + ! + CALL h5sclose_f(space_id, error) + CALL check("h5sclose_f", error, total_error) + CALL h5dclose_f(dsetv_id, error) + CALL check("h5dclose_f", error, total_error) + CALL h5dclose_f(dsetr_id, error) + CALL check("h5dclose_f", error, total_error) + CALL h5fclose_f(file_id, error) + CALL check("h5fclose_f", error, total_error) + + + IF(cleanup) CALL h5_cleanup_f(filename, H5P_DEFAULT_F, error) + CALL check("h5_cleanup_f", error, total_error) + RETURN + +END SUBROUTINE refregtest + +END MODULE TH5R diff --git a/fortran/test/tH5R.f90 b/fortran/test/tH5R.f90 deleted file mode 100644 index ef392b4..0000000 --- a/fortran/test/tH5R.f90 +++ /dev/null @@ -1,483 +0,0 @@ -!****h* root/fortran/test/tH5R.f90 -! -! NAME -! tH5R.f90 -! -! FUNCTION -! Basic testing of Fortran H5R, Reference Interface, 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. * -! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -! -! NOTES -! Tests h5rcreate_f, h5rdereference_f, h5rget_name_f -! and H5Rget_object_type functions -! -! CONTAINS SUBROUTINES -! refobjtest, refregtest -! -!***** -! -MODULE TH5R - - USE HDF5 - USE TH5_MISC - USE TH5_MISC_GEN - -CONTAINS - -SUBROUTINE refobjtest(cleanup, total_error) - IMPLICIT NONE - LOGICAL, INTENT(IN) :: cleanup - INTEGER, INTENT(INOUT) :: total_error - - CHARACTER(LEN=9), PARAMETER :: filename = "reference" - CHARACTER(LEN=80) :: fix_filename - CHARACTER(LEN=8), PARAMETER :: dsetnamei = "INTEGERS" - CHARACTER(LEN=17), PARAMETER :: dsetnamer = "OBJECT_REFERENCES" - CHARACTER(LEN=6), PARAMETER :: groupname1 = "GROUP1" - CHARACTER(LEN=6), PARAMETER :: groupname2 = "GROUP2" - - INTEGER(HID_T) :: file_id ! File identifier - INTEGER(HID_T) :: grp1_id ! Group identifier - INTEGER(HID_T) :: grp2_id ! Group identifier - INTEGER(HID_T) :: dset1_id ! Dataset identifier - INTEGER(HID_T) :: dsetr_id ! Dataset identifier - INTEGER(HID_T) :: type_id ! Type identifier - INTEGER(HID_T) :: space_id ! Dataspace identifier - INTEGER(HID_T) :: spacer_id ! Dataspace identifier - INTEGER :: error, obj_type - INTEGER(HSIZE_T), DIMENSION(1) :: dims = (/5/) - INTEGER(HSIZE_T), DIMENSION(1) :: dimsr= (/4/) - INTEGER(HSIZE_T), DIMENSION(1) :: my_maxdims = (/5/) - INTEGER :: rank = 1 - INTEGER :: rankr = 1 - TYPE(hobj_ref_t_f), DIMENSION(4) :: ref - TYPE(hobj_ref_t_f), DIMENSION(4) :: ref_out - INTEGER(HSIZE_T), DIMENSION(1) :: ref_dim - INTEGER, DIMENSION(5) :: DATA = (/1, 2, 3, 4, 5/) - INTEGER(HSIZE_T), DIMENSION(2) :: data_dims - - CHARACTER(LEN=7) :: buf ! buffer to hold the region name - CHARACTER(LEN=16) :: buf_big ! buffer bigger then needed - INTEGER(SIZE_T) :: buf_size ! returned size of the region buffer name - - ! - !Create a new file with Default file access and - !file creation properties . - ! - CALL h5_fixname_f(filename, fix_filename, H5P_DEFAULT_F, error) - IF (error .NE. 0) THEN - WRITE(*,*) "Cannot modify filename" - STOP - ENDIF - CALL h5fcreate_f(fix_filename, H5F_ACC_TRUNC_F, file_id, error) - CALL check("h5fcreate_f",error,total_error) - - - ! - ! Create a group inside the file - ! - CALL h5gcreate_f(file_id, groupname1, grp1_id, error) - CALL check("h5gcreate_f",error,total_error) - - ! - ! Create a group inside the group GROUP1 - ! - CALL h5gcreate_f(grp1_id, groupname2, grp2_id, error) - CALL check("h5gcreate_f",error,total_error) - - ! - ! Create dataspaces for datasets - ! - CALL h5screate_simple_f(rank, dims, space_id, error, maxdims=my_maxdims) - CALL check("h5screate_simple_f",error,total_error) - CALL h5screate_simple_f(rankr, dimsr, spacer_id, error) - CALL check("h5screate_simple_f",error,total_error) - - ! - ! Create integer dataset - ! - CALL h5dcreate_f(file_id, dsetnamei, H5T_NATIVE_INTEGER, space_id, & - dset1_id, error) - CALL check("h5dcreate_f",error,total_error) - ! - ! Create dataset to store references to the objects - ! - CALL h5dcreate_f(file_id, dsetnamer, H5T_STD_REF_OBJ, spacer_id, & - dsetr_id, error) - CALL check("h5dcreate_f",error,total_error) - ! - ! Create a datatype and store in the file - ! - CALL h5tcopy_f(H5T_NATIVE_REAL, type_id, error) - CALL check("h5tcopy_f",error,total_error) - CALL h5tcommit_f(file_id, "MyType", type_id, error) - CALL check("h5tcommit_f",error,total_error) - ! - ! Close dataspaces, groups and integer dataset - ! - CALL h5sclose_f(space_id, error) - CALL check("h5sclose_f",error,total_error) - CALL h5sclose_f(spacer_id, error) - CALL check("h5sclose_f",error,total_error) - CALL h5dclose_f(dset1_id, error) - CALL check("h5dclose_f",error,total_error) - CALL h5tclose_f(type_id, error) - CALL check("h5tclose_f",error,total_error) - CALL h5gclose_f(grp1_id, error) - CALL check("h5gclose_f",error,total_error) - CALL h5gclose_f(grp2_id, error) - CALL check("h5gclose_f",error,total_error) - - ! - ! Craete references to two groups, integer dataset and shared datatype - ! and write it to the dataset in the file - ! - CALL h5rcreate_f(file_id, groupname1, ref(1), error) - CALL check("h5rcreate_f",error,total_error) - CALL h5rcreate_f(file_id, "/GROUP1/GROUP2", ref(2), error) - CALL check("h5rcreate_f",error,total_error) - CALL h5rcreate_f(file_id, dsetnamei, ref(3), error) - CALL check("h5rcreate_f",error,total_error) - CALL h5rcreate_f(file_id, "MyType", ref(4), error) - CALL check("h5rcreate_f",error,total_error) - ref_dim(1) = SIZE(ref) - CALL h5dwrite_f(dsetr_id, H5T_STD_REF_OBJ, ref, ref_dim, error) - CALL check("h5dwrite_f",error,total_error) - - ! getting path to normal dataset in root group - - CALL H5Rget_name_f(dsetr_id, ref(1), buf, error, buf_size ) - CALL check("H5Rget_name_f", error, total_error) - - - CALL verify("H5Rget_name_f", INT(buf_size),7, total_error) - CALL verify("H5Rget_name_f", buf, "/GROUP1", total_error) - - ! with buffer bigger then needed - - CALL H5Rget_name_f(dsetr_id, ref(1), buf_big, error, buf_size ) - CALL check("H5Rget_name_f", error, total_error) - CALL verify("H5Rget_name_f", INT(buf_size),7,total_error) - CALL verify("H5Rget_name_f", TRIM(buf_big), "/GROUP1", total_error) - - ! getting path to dataset in /Group1 - - CALL H5Rget_name_f(dsetr_id, ref(2), buf_big, error, buf_size ) - CALL check("H5Rget_name_f", error, total_error) - CALL verify("H5Rget_name_f", INT(buf_size),14,total_error) - CALL verify("H5Rget_name_f", TRIM(buf_big), "/GROUP1/GROUP2", total_error) - - ! - !Close the dataset - ! - CALL h5dclose_f(dsetr_id, error) - CALL check("h5dclose_f",error,total_error) - - ! - ! Reopen the dataset with object references - ! - CALL h5dopen_f(file_id, dsetnamer,dsetr_id,error) - CALL check("h5dopen_f",error,total_error) - ref_dim(1) = SIZE(ref_out) - CALL h5dread_f(dsetr_id, H5T_STD_REF_OBJ, ref_out, ref_dim, error) - CALL check("h5dread_f",error,total_error) - - ! - !get the third reference's type and Dereference it - ! - CALL h5rget_object_type_f(dsetr_id, ref(3), obj_type, error) - CALL check("h5rget_object_type_f",error,total_error) - IF (obj_type == H5G_DATASET_F) THEN - CALL h5rdereference_f(dsetr_id, ref(3), dset1_id, error) - CALL check("h5rdereference_f",error,total_error) - - data_dims(1) = 5 - CALL h5dwrite_f(dset1_id, H5T_NATIVE_INTEGER, DATA, data_dims, error) - CALL check("h5dwrite_f",error,total_error) - END IF - - ! - !get the fourth reference's type and Dereference it - ! - CALL h5rget_object_type_f(dsetr_id, ref(4), obj_type, error) - CALL check("h5rget_object_type_f",error,total_error) - IF (obj_type == H5G_TYPE_F) THEN - CALL h5rdereference_f(dsetr_id, ref(4), type_id, error) - CALL check("h5rdereference_f",error,total_error) - END IF - - ! - ! Close all objects. - ! - CALL h5dclose_f(dset1_id, error) - CALL check("h5dclose_f",error,total_error) - CALL h5tclose_f(type_id, error) - CALL check("h5tclose_f",error,total_error) - - CALL h5dclose_f(dsetr_id, error) - CALL check("h5dclose_f",error,total_error) - CALL h5fclose_f(file_id, error) - CALL check("h5fclose_f",error,total_error) - - IF(cleanup) CALL h5_cleanup_f(filename, H5P_DEFAULT_F, error) - CALL check("h5_cleanup_f", error, total_error) - RETURN - -END SUBROUTINE refobjtest -! -! The following subroutine tests h5rget_region_f, h5rcreate_f, h5rget_name_f, -! and h5rdereference_f functionalities -! -SUBROUTINE refregtest(cleanup, total_error) - - IMPLICIT NONE - LOGICAL, INTENT(IN) :: cleanup - INTEGER, INTENT(INOUT) :: total_error - - CHARACTER(LEN=6), PARAMETER :: filename = "Refreg" - CHARACTER(LEN=80) :: fix_filename - CHARACTER(LEN=6), PARAMETER :: dsetnamev = "MATRIX" - CHARACTER(LEN=17), PARAMETER :: dsetnamer = "REGION_REFERENCES" - - CHARACTER(LEN=7) :: buf ! buffer to hold the region name - CHARACTER(LEN=11) :: buf_big ! buffer bigger then needed - CHARACTER(LEN=4) :: buf_small ! buffer smaller then needed - INTEGER(SIZE_T) :: buf_size ! returned size of the region buffer name - INTEGER(HID_T) :: file_id ! File identifier - INTEGER(HID_T) :: space_id ! Dataspace identifier - INTEGER(HID_T) :: spacer_id ! Dataspace identifier - INTEGER(HID_T) :: dsetv_id ! Dataset identifier - INTEGER(HID_T) :: dsetr_id ! Dataset identifier - INTEGER :: error -! TYPE(hdset_reg_ref_t_f) , DIMENSION(1:2), TARGET :: ref - TYPE(hdset_reg_ref_t_f) , DIMENSION(1:2) :: ref - TYPE(hdset_reg_ref_t_f) , DIMENSION(1:2) :: ref_out - INTEGER(HSIZE_T), DIMENSION(2) :: ref_dim = (/0,0/) - INTEGER(HSIZE_T), DIMENSION(2) :: data_dims ! = (/0,0/) - INTEGER(HSIZE_T), DIMENSION(2) :: dims = (/2,9/) ! Datasets dimensions - INTEGER(HSIZE_T), DIMENSION(1) :: dimsr = (/2/) ! - INTEGER(HSIZE_T), DIMENSION(2) :: start ! = (/0,0/) - INTEGER(HSIZE_T), DIMENSION(2) :: count ! = (/0,0/) - - INTEGER :: rankr = 1 - INTEGER :: rank = 2 -! INTEGER , DIMENSION(2,9), TARGET :: DATA - INTEGER , DIMENSION(2,9) :: DATA - INTEGER , DIMENSION(2,9) :: data_out = 0 - INTEGER(HSIZE_T) , DIMENSION(2,3) :: coord - INTEGER(SIZE_T) ::num_points = 3 ! Number of selected points -! type(c_ptr) :: f_ptr - coord = RESHAPE((/1,1,2,7,1,9/), (/2,3/)) ! Coordinates of selected points - DATA = RESHAPE ((/1,1,1,2,2,2,3,3,3,4,4,4,5,5,5,6,6,6/), (/2,9/)) - - ref_out(1)%ref = 0 - ref_out(2)%ref = 0 - - ! - ! Initialize FORTRAN predefined datatypes. - ! - ! CALL h5init_types_f(error) - ! CALL check("h5init_types_f", error, total_error) - ! - ! Create a new file. - ! - CALL h5_fixname_f(filename, fix_filename, H5P_DEFAULT_F, error) - IF (error .NE. 0) THEN - WRITE(*,*) "Cannot modify filename" - STOP - ENDIF - CALL h5fcreate_f(fix_filename, H5F_ACC_TRUNC_F, file_id, error) - ! Default file access and file creation - ! properties are used. - CALL check("h5fcreate_f", error, total_error) - ! - ! Create dataspaces: - ! - ! for dataset with references to dataset regions - ! - CALL h5screate_simple_f(rankr, dimsr, spacer_id, error) - CALL check("h5screate_simple_f", error, total_error) - ! - ! for integer dataset - ! - CALL h5screate_simple_f(rank, dims, space_id, error) - CALL check("h5screate_simple_f", error, total_error) - ! - ! Create and write datasets: - ! - ! Integer dataset - ! - CALL h5dcreate_f(file_id, dsetnamev, H5T_NATIVE_INTEGER, space_id, & - dsetv_id, error) - CALL check("h5dcreate_f", error, total_error) - data_dims(1) = 2 - data_dims(2) = 9 - -! f_ptr = c_loc(data) -! CALL h5dwrite_f(dsetv_id, H5T_NATIVE_INTEGER, f_ptr, error) - - CALL h5dwrite_f(dsetv_id, H5T_NATIVE_INTEGER, DATA, data_dims, error) - CALL check("h5dwrite_f", error, total_error) - - CALL h5dclose_f(dsetv_id, error) - CALL check("h5dclose_f", error, total_error) - - ! - ! Dataset with references - ! - CALL h5dcreate_f(file_id, dsetnamer, H5T_STD_REF_DSETREG, spacer_id, & - dsetr_id, error) - CALL check("h5dcreate_f", error, total_error) - ! - ! Create a reference to the hyperslab selection. - ! - start(1) = 0 - start(2) = 3 - COUNT(1) = 2 - COUNT(2) = 3 - CALL h5sselect_hyperslab_f(space_id, H5S_SELECT_SET_F, & - start, count, error) - CALL check("h5sselect_hyperslab_f", error, total_error) - ref(1)%ref(:) = 0 -! f_ptr = C_LOC(ref(1)) -! CALL h5rcreate_f(file_id, dsetnamev, 1, space_id, f_ptr, error) - CALL h5rcreate_f(file_id, dsetnamev, space_id, ref(1), error) - CALL check("h5rcreate_f", error, total_error) - - ! - ! Create a reference to elements selection. - ! - CALL h5sselect_none_f(space_id, error) - CALL check("h5sselect_none_f", error, total_error) - CALL h5sselect_elements_f(space_id, H5S_SELECT_SET_F, rank, num_points,& - coord, error) - CALL check("h5sselect_elements_f", error, total_error) - ref(2)%ref(:) = 0 - CALL h5rcreate_f(file_id, dsetnamev, space_id, ref(2), error) - CALL check("h5rcreate_f", error, total_error) - ! - ! Write dataset with the references. - ! - ref_dim(1) = SIZE(ref) - CALL h5dwrite_f(dsetr_id, H5T_STD_REF_DSETREG, ref, ref_dim, error) - CALL check("h5dwrite_f", error, total_error) - ! - ! Close all objects. - ! - CALL h5sclose_f(space_id, error) - CALL check("h5sclose_f", error, total_error) - CALL h5sclose_f(spacer_id, error) - CALL check("h5sclose_f", error, total_error) - CALL h5dclose_f(dsetr_id, error) - CALL check("h5dclose_f", error, total_error) - CALL h5fclose_f(file_id, error) - CALL check("h5fclose_f", error, total_error) - - ! - ! Reopen the file to test selections. - ! - CALL h5fopen_f (fix_filename, H5F_ACC_RDWR_F, file_id, error) - CALL check("h5fopen_f", error, total_error) - CALL h5dopen_f(file_id, dsetnamer, dsetr_id, error) - CALL check("h5dopen_f", error, total_error) - ! - ! Read references to the dataset regions. - ! - ref_dim(1) = SIZE(ref_out) - CALL h5dread_f(dsetr_id, H5T_STD_REF_DSETREG, ref_out, ref_dim, error) - CALL check("h5dread_f", error, total_error) - - ! Get name of the dataset the first region reference points to using H5Rget_name_f - CALL H5Rget_name_f(dsetr_id, ref_out(1), buf, error, buf_size ) - CALL check("H5Rget_name_f", error, total_error) - CALL verify("H5Rget_name_f", INT(buf_size),7,total_error) - CALL verify("H5Rget_name_f", buf, "/MATRIX", total_error) - - ! Get name of the dataset the first region reference points to using H5Rget_name_f - ! buffer bigger then needed - CALL H5Rget_name_f(dsetr_id, ref_out(1), buf_big, error, buf_size ) - CALL check("H5Rget_name_f", error, total_error) - CALL verify("H5Rget_name_f", INT(buf_size),7,total_error) - CALL verify("H5Rget_name_f", TRIM(buf_big), "/MATRIX", total_error) - - - ! Get name of the dataset the first region reference points to using H5Rget_name_f - ! buffer smaller then needed - CALL H5Rget_name_f(dsetr_id, ref_out(1), buf_small, error, buf_size ) - CALL check("H5Rget_name_f", error, total_error) - CALL verify("H5Rget_name_f", INT(buf_size),7,total_error) - CALL verify("H5Rget_name_f", TRIM(buf_small), "/MAT", total_error) - ! - ! Dereference the first reference. - ! - CALL H5rdereference_f(dsetr_id, ref_out(1), dsetv_id, error) - CALL check("h5rdereference_f", error, total_error) - CALL H5rget_region_f(dsetr_id, ref_out(1), space_id, error) - CALL check("h5rget_region_f", error, total_error) - - ! Get name of the dataset the second region reference points to using H5Rget_name_f - CALL H5Rget_name_f(dsetr_id, ref_out(2), buf, error) ! no optional size - CALL check("H5Rget_name_f", error, total_error) - CALL verify("H5Rget_name_f", TRIM(buf), "/MATRIX", total_error) - ! - ! Read selected data from the dataset. - ! - data_dims(1) = 2 - data_dims(2) = 9 - CALL h5dread_f(dsetv_id, H5T_NATIVE_INTEGER, data_out, data_dims, error, & - mem_space_id = space_id, file_space_id = space_id) - CALL check("h5dread_f", error, total_error) - CALL h5sclose_f(space_id, error) - CALL check("h5sclose_f", error, total_error) - CALL h5dclose_f(dsetv_id, error) - CALL check("h5dclose_f", error, total_error) - data_out = 0 - ! - ! Dereference the second reference. - ! - CALL H5rdereference_f(dsetr_id, ref_out(2), dsetv_id, error) - CALL check("h5rdereference_f", error, total_error) - - CALL H5rget_region_f(dsetr_id, ref_out(2), space_id, error) - CALL check("h5rget_region_f", error, total_error) - ! - ! Read selected data from the dataset. - ! - CALL h5dread_f(dsetv_id, H5T_NATIVE_INTEGER, data_out, data_dims, error, & - mem_space_id = space_id, file_space_id = space_id) - CALL check("h5dread_f", error, total_error) - ! - ! Close all objects - ! - CALL h5sclose_f(space_id, error) - CALL check("h5sclose_f", error, total_error) - CALL h5dclose_f(dsetv_id, error) - CALL check("h5dclose_f", error, total_error) - CALL h5dclose_f(dsetr_id, error) - CALL check("h5dclose_f", error, total_error) - CALL h5fclose_f(file_id, error) - CALL check("h5fclose_f", error, total_error) - - - IF(cleanup) CALL h5_cleanup_f(filename, H5P_DEFAULT_F, error) - CALL check("h5_cleanup_f", error, total_error) - RETURN - -END SUBROUTINE refregtest - -END MODULE TH5R diff --git a/fortran/test/tH5S.F90 b/fortran/test/tH5S.F90 new file mode 100644 index 0000000..7223772 --- /dev/null +++ b/fortran/test/tH5S.F90 @@ -0,0 +1,298 @@ +!****h* root/fortran/test/tH5S.f90 +! +! NAME +! tH5S.f90 +! +! FUNCTION +! Basic testing of Fortran H5S, Dataspace Interface, 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. * +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! +! NOTES +! Tests the following functionalities: +! h5screate_f, h5scopy_f, h5screate_simple_f, h5sis_simple_f, +! h5sget_simple_extent_dims_f,h5sget_simple_extent_ndims_f +! h5sget_simple_extent_npoints_f, h5sget_simple_extent_type_f, +! h5sextent_copy_f, h5sset_extent_simple_f, h5sset_extent_none_f +! +! CONTAINS SUBROUTINES +! dataspace_basic_test +! +!***** +MODULE TH5S + + USE HDF5 ! This module contains all necessary modules + USE TH5_MISC + USE TH5_MISC_GEN + +CONTAINS + + SUBROUTINE dataspace_basic_test(cleanup, total_error) + + + IMPLICIT NONE + LOGICAL, INTENT(IN) :: cleanup + INTEGER, INTENT(INOUT) :: total_error + + CHARACTER(LEN=10), PARAMETER :: filename1 = "basicspace" ! File1 name + CHARACTER(LEN=9), PARAMETER :: filename2 = "copyspace" ! File2 name + CHARACTER(LEN=80) :: fix_filename1 + CHARACTER(LEN=80) :: fix_filename2 + CHARACTER(LEN=9), PARAMETER :: dsetname = "basicdset" ! Dataset name + + INTEGER(HID_T) :: file1_id, file2_id ! File identifiers + INTEGER(HID_T) :: dset1_id, dset2_id ! Dataset identifiers + INTEGER(HID_T) :: space1_id, space2_id ! Dataspace identifiers + + INTEGER(HSIZE_T), DIMENSION(2) :: dims1 = (/4,6/) ! Dataset dimensions + INTEGER(HSIZE_T), DIMENSION(2) :: maxdims1 = (/4,6/) ! maximum dimensions + INTEGER(HSIZE_T), DIMENSION(2) :: dims2 = (/6,6/) ! Dataset dimensions + INTEGER(HSIZE_T), DIMENSION(2) :: maxdims2 = (/6,6/) ! maximum dimensions + INTEGER(HSIZE_T), DIMENSION(2) :: dimsout, maxdimsout ! dimensions + INTEGER(HSIZE_T) :: npoints !number of elements in the dataspace + + INTEGER :: rank1 = 2 ! Dataspace1 rank + INTEGER :: rank2 = 2 ! Dataspace2 rank + INTEGER :: classtype ! Dataspace class type + + INTEGER, DIMENSION(4,6) :: data1_in, data1_out ! Data input buffers + INTEGER, DIMENSION(6,6) :: data2_in, data2_out ! Data output buffers + INTEGER :: error ! Error flag + + LOGICAL :: flag !flag to test datyspace is simple or not + INTEGER :: i, j !general purpose integers + INTEGER(HSIZE_T), DIMENSION(2) :: data_dims + + ! + ! Initialize the dset_data array. + ! + do i = 1, 4 + do j = 1, 6 + data1_in(i,j) = (i-1)*6 + j; + end do + end do + + do i = 1, 6 + do j = 1, 6 + data2_in(i,j) = i*6 + j; + end do + end do + + ! + ! Initialize FORTRAN predefined datatypes. + ! +! CALL h5init_types_f(error) +! CALL check("h5init_types_f", error, total_error) + + ! + ! Create new files using default properties. + ! + CALL h5_fixname_f(filename1, fix_filename1, H5P_DEFAULT_F, error) + if (error .ne. 0) then + write(*,*) "Cannot modify filename" + stop + endif + CALL h5fcreate_f(fix_filename1, H5F_ACC_TRUNC_F, file1_id, error) + CALL check("h5fcreate_f", error, total_error) + + CALL h5_fixname_f(filename2, fix_filename2, H5P_DEFAULT_F, error) + if (error .ne. 0) then + write(*,*) "Cannot modify filename" + stop + endif + CALL h5fcreate_f(fix_filename2, H5F_ACC_TRUNC_F, file2_id, error) + CALL check("h5fcreate_f", error, total_error) + + ! + ! Create dataspace for file1. + ! + CALL h5screate_simple_f(rank1, dims1, space1_id, error, maxdims1) + CALL check("h5screate_simple_f", error, total_error) + ! + ! Copy space1_id to space2_id. + ! + CALL h5scopy_f(space1_id, space2_id, error) + CALL check("h5scopy_f", error, total_error) + + ! + !Check whether copied space is simple. + ! + CALL h5sis_simple_f(space2_id, flag, error) + CALL check("h5sissimple_f", error, total_error) + IF (.NOT. flag) write(*,*) "dataspace is not simple type" + + ! + !set the copied space to none. + ! + CALL h5sset_extent_none_f(space2_id, error) + CALL check("h5sset_extent_none_f", error, total_error) + + ! + !copy the extent of space1_id to space2_id. + ! + CALL h5sextent_copy_f(space2_id, space1_id, error) + CALL check("h5sextent_copy_f", error, total_error) + + ! + !get the copied space's dimensions. + ! + CALL h5sget_simple_extent_dims_f(space2_id, dimsout, maxdimsout, error) + CALL check("h5sget_simple_extent_dims_f", error, total_error) + IF ((dimsout(1) .NE. dims1(1)) .OR. (dimsout(2) .NE. dims1(2)) ) THEN + write(*,*)"error occured, copied dims not same" + END IF + + ! + !get the copied space's rank. + ! + CALL h5sget_simple_extent_ndims_f(space2_id, rank2, error) + CALL check("h5sget_simple_extent_ndims_f", error, total_error) + IF (rank2 .NE. rank1) write(*,*)"error occured, copied ranks not same" + + ! + !get the copied space's number of elements. + ! + CALL h5sget_simple_extent_npoints_f(space2_id, npoints, error) + CALL check("h5sget_simple_extent_npoints_f", error, total_error) + IF (npoints .NE. 24) write(*,*)"error occured, number of elements not correct" + + + ! + !get the copied space's class type. + ! + CALL h5sget_simple_extent_type_f(space2_id, classtype, error) + CALL check("h5sget_simple_extent_type_f", error, total_error) + IF (classtype .NE. 1) write(*,*)"class type not H5S_SIMPLE_f" + + ! + !set the copied space to none before extend the dimensions. + ! + CALL h5sset_extent_none_f(space2_id, error) + CALL check("h5sset_extent_none_f", error, total_error) + + ! + !set the copied space to dim2 size. + ! + CALL h5sset_extent_simple_f(space2_id, rank2, dims2, maxdims2, error) + CALL check("h5sset_extent_simple_f", error, total_error) + + ! + !get the copied space's dimensions. + ! + CALL h5sget_simple_extent_dims_f(space2_id, dimsout, maxdimsout, error) + CALL check("h5sget_simple_extent_dims_f", error, total_error) + IF ((dimsout(1) .NE. dims2(1)) .OR. (dimsout(2) .NE. dims2(2)) ) THEN + write(*,*)"error occured, copied dims not same" + END IF + + ! + ! Create the datasets with default properties in two files. + ! + CALL h5dcreate_f(file1_id, dsetname, H5T_NATIVE_INTEGER, space1_id, & + dset1_id, error) + CALL check("h5dcreate_f", error, total_error) + + CALL h5dcreate_f(file2_id, dsetname, H5T_NATIVE_INTEGER, space2_id, & + dset2_id, error) + CALL check("h5dcreate_f", error, total_error) + + ! + ! Write the datasets. + ! + data_dims(1) = 4 + data_dims(2) = 6 + CALL h5dwrite_f(dset1_id, H5T_NATIVE_INTEGER, data1_in, data_dims, error) + CALL check("h5dwrite_f", error, total_error) + + data_dims(1) = 6 + data_dims(2) = 6 + CALL h5dwrite_f(dset2_id, H5T_NATIVE_INTEGER, data2_in, data_dims, error) + CALL check("h5dwrite_f", error, total_error) + + ! + ! Read the first dataset. + ! + data_dims(1) = 4 + data_dims(2) = 6 + CALL h5dread_f(dset1_id, H5T_NATIVE_INTEGER, data1_out, data_dims, error) + CALL check("h5dread_f", error, total_error) + + ! + !Compare the data. + ! + do i = 1, 4 + do j = 1, 6 + IF (data1_out(i,j) .NE. data1_in(i, j)) THEN + write(*, *) "dataset test error occured" + write(*,*) "data read is not the same as the data writen" + END IF + end do + end do + + + ! + ! Read the second dataset. + ! + data_dims(1) = 6 + data_dims(2) = 6 + CALL h5dread_f(dset2_id, H5T_NATIVE_INTEGER, data2_out, data_dims, error) + CALL check("h5dread_f", error, total_error) + + ! + !Compare the data. + ! + do i = 1, 6 + do j = 1, 6 + IF (data2_out(i,j) .NE. data2_in(i, j)) THEN + write(*, *) "dataset test error occured" + write(*,*) "data read is not the same as the data writen" + END IF + end do + end do + + ! + !Close the datasets. + ! + CALL h5dclose_f(dset1_id, error) + CALL check("h5dclose_f", error, total_error) + CALL h5dclose_f(dset2_id, error) + CALL check("h5dclose_f", error, total_error) + + ! + ! Terminate access to the data spaces. + ! + CALL h5sclose_f(space1_id, error) + CALL check("h5sclose_f", error, total_error) + CALL h5sclose_f(space2_id, error) + CALL check("h5sclose_f", error, total_error) + ! + ! Close the files. + ! + CALL h5fclose_f(file1_id, error) + CALL check("h5fclose_f", error, total_error) + CALL h5fclose_f(file2_id, error) + CALL check("h5fclose_f", error, total_error) + + + if(cleanup) CALL h5_cleanup_f(filename1, H5P_DEFAULT_F, error) + CALL check("h5_cleanup_f", error, total_error) + if(cleanup) CALL h5_cleanup_f(filename2, H5P_DEFAULT_F, error) + CALL check("h5_cleanup_f", error, total_error) + RETURN + END SUBROUTINE dataspace_basic_test + +END MODULE TH5S diff --git a/fortran/test/tH5S.f90 b/fortran/test/tH5S.f90 deleted file mode 100644 index 7223772..0000000 --- a/fortran/test/tH5S.f90 +++ /dev/null @@ -1,298 +0,0 @@ -!****h* root/fortran/test/tH5S.f90 -! -! NAME -! tH5S.f90 -! -! FUNCTION -! Basic testing of Fortran H5S, Dataspace Interface, 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. * -! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -! -! NOTES -! Tests the following functionalities: -! h5screate_f, h5scopy_f, h5screate_simple_f, h5sis_simple_f, -! h5sget_simple_extent_dims_f,h5sget_simple_extent_ndims_f -! h5sget_simple_extent_npoints_f, h5sget_simple_extent_type_f, -! h5sextent_copy_f, h5sset_extent_simple_f, h5sset_extent_none_f -! -! CONTAINS SUBROUTINES -! dataspace_basic_test -! -!***** -MODULE TH5S - - USE HDF5 ! This module contains all necessary modules - USE TH5_MISC - USE TH5_MISC_GEN - -CONTAINS - - SUBROUTINE dataspace_basic_test(cleanup, total_error) - - - IMPLICIT NONE - LOGICAL, INTENT(IN) :: cleanup - INTEGER, INTENT(INOUT) :: total_error - - CHARACTER(LEN=10), PARAMETER :: filename1 = "basicspace" ! File1 name - CHARACTER(LEN=9), PARAMETER :: filename2 = "copyspace" ! File2 name - CHARACTER(LEN=80) :: fix_filename1 - CHARACTER(LEN=80) :: fix_filename2 - CHARACTER(LEN=9), PARAMETER :: dsetname = "basicdset" ! Dataset name - - INTEGER(HID_T) :: file1_id, file2_id ! File identifiers - INTEGER(HID_T) :: dset1_id, dset2_id ! Dataset identifiers - INTEGER(HID_T) :: space1_id, space2_id ! Dataspace identifiers - - INTEGER(HSIZE_T), DIMENSION(2) :: dims1 = (/4,6/) ! Dataset dimensions - INTEGER(HSIZE_T), DIMENSION(2) :: maxdims1 = (/4,6/) ! maximum dimensions - INTEGER(HSIZE_T), DIMENSION(2) :: dims2 = (/6,6/) ! Dataset dimensions - INTEGER(HSIZE_T), DIMENSION(2) :: maxdims2 = (/6,6/) ! maximum dimensions - INTEGER(HSIZE_T), DIMENSION(2) :: dimsout, maxdimsout ! dimensions - INTEGER(HSIZE_T) :: npoints !number of elements in the dataspace - - INTEGER :: rank1 = 2 ! Dataspace1 rank - INTEGER :: rank2 = 2 ! Dataspace2 rank - INTEGER :: classtype ! Dataspace class type - - INTEGER, DIMENSION(4,6) :: data1_in, data1_out ! Data input buffers - INTEGER, DIMENSION(6,6) :: data2_in, data2_out ! Data output buffers - INTEGER :: error ! Error flag - - LOGICAL :: flag !flag to test datyspace is simple or not - INTEGER :: i, j !general purpose integers - INTEGER(HSIZE_T), DIMENSION(2) :: data_dims - - ! - ! Initialize the dset_data array. - ! - do i = 1, 4 - do j = 1, 6 - data1_in(i,j) = (i-1)*6 + j; - end do - end do - - do i = 1, 6 - do j = 1, 6 - data2_in(i,j) = i*6 + j; - end do - end do - - ! - ! Initialize FORTRAN predefined datatypes. - ! -! CALL h5init_types_f(error) -! CALL check("h5init_types_f", error, total_error) - - ! - ! Create new files using default properties. - ! - CALL h5_fixname_f(filename1, fix_filename1, H5P_DEFAULT_F, error) - if (error .ne. 0) then - write(*,*) "Cannot modify filename" - stop - endif - CALL h5fcreate_f(fix_filename1, H5F_ACC_TRUNC_F, file1_id, error) - CALL check("h5fcreate_f", error, total_error) - - CALL h5_fixname_f(filename2, fix_filename2, H5P_DEFAULT_F, error) - if (error .ne. 0) then - write(*,*) "Cannot modify filename" - stop - endif - CALL h5fcreate_f(fix_filename2, H5F_ACC_TRUNC_F, file2_id, error) - CALL check("h5fcreate_f", error, total_error) - - ! - ! Create dataspace for file1. - ! - CALL h5screate_simple_f(rank1, dims1, space1_id, error, maxdims1) - CALL check("h5screate_simple_f", error, total_error) - ! - ! Copy space1_id to space2_id. - ! - CALL h5scopy_f(space1_id, space2_id, error) - CALL check("h5scopy_f", error, total_error) - - ! - !Check whether copied space is simple. - ! - CALL h5sis_simple_f(space2_id, flag, error) - CALL check("h5sissimple_f", error, total_error) - IF (.NOT. flag) write(*,*) "dataspace is not simple type" - - ! - !set the copied space to none. - ! - CALL h5sset_extent_none_f(space2_id, error) - CALL check("h5sset_extent_none_f", error, total_error) - - ! - !copy the extent of space1_id to space2_id. - ! - CALL h5sextent_copy_f(space2_id, space1_id, error) - CALL check("h5sextent_copy_f", error, total_error) - - ! - !get the copied space's dimensions. - ! - CALL h5sget_simple_extent_dims_f(space2_id, dimsout, maxdimsout, error) - CALL check("h5sget_simple_extent_dims_f", error, total_error) - IF ((dimsout(1) .NE. dims1(1)) .OR. (dimsout(2) .NE. dims1(2)) ) THEN - write(*,*)"error occured, copied dims not same" - END IF - - ! - !get the copied space's rank. - ! - CALL h5sget_simple_extent_ndims_f(space2_id, rank2, error) - CALL check("h5sget_simple_extent_ndims_f", error, total_error) - IF (rank2 .NE. rank1) write(*,*)"error occured, copied ranks not same" - - ! - !get the copied space's number of elements. - ! - CALL h5sget_simple_extent_npoints_f(space2_id, npoints, error) - CALL check("h5sget_simple_extent_npoints_f", error, total_error) - IF (npoints .NE. 24) write(*,*)"error occured, number of elements not correct" - - - ! - !get the copied space's class type. - ! - CALL h5sget_simple_extent_type_f(space2_id, classtype, error) - CALL check("h5sget_simple_extent_type_f", error, total_error) - IF (classtype .NE. 1) write(*,*)"class type not H5S_SIMPLE_f" - - ! - !set the copied space to none before extend the dimensions. - ! - CALL h5sset_extent_none_f(space2_id, error) - CALL check("h5sset_extent_none_f", error, total_error) - - ! - !set the copied space to dim2 size. - ! - CALL h5sset_extent_simple_f(space2_id, rank2, dims2, maxdims2, error) - CALL check("h5sset_extent_simple_f", error, total_error) - - ! - !get the copied space's dimensions. - ! - CALL h5sget_simple_extent_dims_f(space2_id, dimsout, maxdimsout, error) - CALL check("h5sget_simple_extent_dims_f", error, total_error) - IF ((dimsout(1) .NE. dims2(1)) .OR. (dimsout(2) .NE. dims2(2)) ) THEN - write(*,*)"error occured, copied dims not same" - END IF - - ! - ! Create the datasets with default properties in two files. - ! - CALL h5dcreate_f(file1_id, dsetname, H5T_NATIVE_INTEGER, space1_id, & - dset1_id, error) - CALL check("h5dcreate_f", error, total_error) - - CALL h5dcreate_f(file2_id, dsetname, H5T_NATIVE_INTEGER, space2_id, & - dset2_id, error) - CALL check("h5dcreate_f", error, total_error) - - ! - ! Write the datasets. - ! - data_dims(1) = 4 - data_dims(2) = 6 - CALL h5dwrite_f(dset1_id, H5T_NATIVE_INTEGER, data1_in, data_dims, error) - CALL check("h5dwrite_f", error, total_error) - - data_dims(1) = 6 - data_dims(2) = 6 - CALL h5dwrite_f(dset2_id, H5T_NATIVE_INTEGER, data2_in, data_dims, error) - CALL check("h5dwrite_f", error, total_error) - - ! - ! Read the first dataset. - ! - data_dims(1) = 4 - data_dims(2) = 6 - CALL h5dread_f(dset1_id, H5T_NATIVE_INTEGER, data1_out, data_dims, error) - CALL check("h5dread_f", error, total_error) - - ! - !Compare the data. - ! - do i = 1, 4 - do j = 1, 6 - IF (data1_out(i,j) .NE. data1_in(i, j)) THEN - write(*, *) "dataset test error occured" - write(*,*) "data read is not the same as the data writen" - END IF - end do - end do - - - ! - ! Read the second dataset. - ! - data_dims(1) = 6 - data_dims(2) = 6 - CALL h5dread_f(dset2_id, H5T_NATIVE_INTEGER, data2_out, data_dims, error) - CALL check("h5dread_f", error, total_error) - - ! - !Compare the data. - ! - do i = 1, 6 - do j = 1, 6 - IF (data2_out(i,j) .NE. data2_in(i, j)) THEN - write(*, *) "dataset test error occured" - write(*,*) "data read is not the same as the data writen" - END IF - end do - end do - - ! - !Close the datasets. - ! - CALL h5dclose_f(dset1_id, error) - CALL check("h5dclose_f", error, total_error) - CALL h5dclose_f(dset2_id, error) - CALL check("h5dclose_f", error, total_error) - - ! - ! Terminate access to the data spaces. - ! - CALL h5sclose_f(space1_id, error) - CALL check("h5sclose_f", error, total_error) - CALL h5sclose_f(space2_id, error) - CALL check("h5sclose_f", error, total_error) - ! - ! Close the files. - ! - CALL h5fclose_f(file1_id, error) - CALL check("h5fclose_f", error, total_error) - CALL h5fclose_f(file2_id, error) - CALL check("h5fclose_f", error, total_error) - - - if(cleanup) CALL h5_cleanup_f(filename1, H5P_DEFAULT_F, error) - CALL check("h5_cleanup_f", error, total_error) - if(cleanup) CALL h5_cleanup_f(filename2, H5P_DEFAULT_F, error) - CALL check("h5_cleanup_f", error, total_error) - RETURN - END SUBROUTINE dataspace_basic_test - -END MODULE TH5S diff --git a/fortran/test/tH5Sselect.F90 b/fortran/test/tH5Sselect.F90 new file mode 100644 index 0000000..aeb80e9 --- /dev/null +++ b/fortran/test/tH5Sselect.F90 @@ -0,0 +1,1993 @@ +!****h* root/fortran/test/tH5Sselect.f90 +! +! NAME +! tH5Sselect.f90 +! +! FUNCTION +! Basic testing of Fortran H5S, Selection-related Dataspace Interface, 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. * +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! +! NOTES +! Tests the following functionalities: +! h5sget_select_npoints_f, h5sselect_elements_f, h5sselect_all_f, +! h5sselect_none_f, h5sselect_valid_f, h5sselect_hyperslab_f, +! h5sget_select_bounds_f, h5sget_select_elem_pointlist_f, +! h5sget_select_elem_npoints_f, h5sget_select_hyper_blocklist_f, +! h5sget_select_hyper_nblocks_f, h5sget_select_npoints_f +! +! CONTAINS SUBROUTINES +! test_select_hyperslab, test_select_element, test_basic_select, +! test_select_point, test_select_combine, test_select_bounds +! +! +!***** +MODULE TH5SSELECT + + USE HDF5 ! This module contains all necessary modules + USE TH5_MISC + USE TH5_MISC_GEN + +CONTAINS + + SUBROUTINE test_select_hyperslab(cleanup, total_error) + + IMPLICIT NONE + LOGICAL, INTENT(IN) :: cleanup + INTEGER, INTENT(INOUT) :: total_error + + CHARACTER(LEN=7), PARAMETER :: filename = "tselect" + CHARACTER(LEN=80) :: fix_filename + + ! + !dataset name is "IntArray" + ! + CHARACTER(LEN=8), PARAMETER :: dsetname = "IntArray" + + INTEGER(HID_T) :: file_id ! File identifier + INTEGER(HID_T) :: dset_id ! Dataset identifier + INTEGER(HID_T) :: dataspace ! Dataspace identifier + INTEGER(HID_T) :: memspace ! memspace identifier + + ! + !Memory space dimensions + ! + INTEGER(HSIZE_T), DIMENSION(3) :: dimsm = (/7,7,3/) + + + ! + !Dataset dimensions + ! + INTEGER(HSIZE_T), DIMENSION(2) :: dimsf = (/5,6/) + + ! + !Size of the hyperslab in the file + ! + INTEGER(HSIZE_T), DIMENSION(2) :: count = (/3,4/) + + ! + !hyperslab offset in the file + ! + INTEGER(HSIZE_T), DIMENSION(2) :: offset = (/1,2/) + + ! + !Size of the hyperslab in memory + ! + INTEGER(HSIZE_T), DIMENSION(3) :: count_out = (/3,4,1/) + + ! + !hyperslab offset in memory + ! + INTEGER(HSIZE_T), DIMENSION(3) :: offset_out = (/3,0,0/) + + ! + !data to write + ! + INTEGER, DIMENSION(5,6) :: data + + ! + !output buffer + ! + INTEGER, DIMENSION(7,7,3) :: data_out + + + ! + !dataset space rank + ! + INTEGER :: dsetrank = 2 + + ! + !memspace rank + ! + INTEGER :: memrank = 3 + + + + + ! + !general purpose integer + ! + INTEGER :: i, j + + ! + !flag to check operation success + ! + INTEGER :: error + INTEGER(HSIZE_T), DIMENSION(3) :: data_dims + + + ! + !This writes data to the HDF5 file. + ! + + ! + !data initialization + ! + do i = 1, 5 + do j = 1, 6 + data(i,j) = (i-1) + (j-1); + end do + end do + ! + ! 0, 1, 2, 3, 4, 5 + ! 1, 2, 3, 4, 5, 6 + ! 2, 3, 4, 5, 6, 7 + ! 3, 4, 5, 6, 7, 8 + ! 4, 5, 6, 7, 8, 9 + ! + + ! + !Initialize FORTRAN predifined datatypes + ! +! CALL h5init_types_f(error) +! CALL check("h5init_types_f", error, total_error) + + ! + !Create a new file using default properties. + ! + CALL h5_fixname_f(filename, fix_filename, H5P_DEFAULT_F, error) + if (error .ne. 0) then + write(*,*) "Cannot modify filename" + stop + endif + CALL h5fcreate_f(fix_filename, H5F_ACC_TRUNC_F, file_id, error) + CALL check("h5fcreate_f", error, total_error) + + ! + !Create the data space for the dataset. + ! + CALL h5screate_simple_f(dsetrank, dimsf, dataspace, error) + CALL check("h5screate_simple_f", error, total_error) + + ! + ! Create the dataset with default properties + ! + CALL h5dcreate_f(file_id, dsetname, H5T_STD_I32BE, dataspace, & + dset_id, error) + CALL check("h5dcreate_f", error, total_error) + + ! + ! Write the dataset + ! + data_dims(1) = 5 + data_dims(2) = 6 + CALL h5dwrite_f(dset_id, H5T_NATIVE_INTEGER, data, data_dims, error) + CALL check("h5dwrite_f", error, total_error) + + ! + !Close the dataspace for the dataset. + ! + CALL h5sclose_f(dataspace, error) + CALL check("h5sclose_f", error, total_error) + + ! + !Close the dataset. + ! + CALL h5dclose_f(dset_id, error) + CALL check("h5dclose_f", error, total_error) + + ! + !Close the file. + ! + CALL h5fclose_f(file_id, error) + CALL check("h5fclose_f", error, total_error) + + ! + !This reads the hyperslab from the sds.h5 file just + !created, into a 2-dimensional plane of the 3-dimensional array. + ! + + ! + !initialize data_out array + ! + ! do i = 1, 7 + ! do j = 1, 7 + ! do k = 1,3 + ! data_out(i,j,k) = 0; + ! end do + ! end do + ! end do + + ! + !Open the file. + ! + CALL h5fopen_f (fix_filename, H5F_ACC_RDONLY_F, file_id, error) + CALL check("h5fopen_f", error, total_error) + + ! + !Open the dataset. + ! + CALL h5dopen_f(file_id, dsetname, dset_id, error) + CALL check("h5dopen_f", error, total_error) + + ! + !Get dataset's dataspace handle. + ! + CALL h5dget_space_f(dset_id, dataspace, error) + CALL check("h5dget_space_f", error, total_error) + + ! + !Select hyperslab in the dataset. + ! + CALL h5sselect_hyperslab_f(dataspace, H5S_SELECT_SET_F, & + offset, count, error) + CALL check("h5sselect_hyperslab_f", error, total_error) + ! + !create memory dataspace. + ! + CALL h5screate_simple_f(memrank, dimsm, memspace, error) + CALL check("h5screate_simple_f", error, total_error) + + ! + !Select hyperslab in memory. + ! + CALL h5sselect_hyperslab_f(memspace, H5S_SELECT_SET_F, & + offset_out, count_out, error) + CALL check("h5sselect_hyperslab_f", error, total_error) + + ! + !Read data from hyperslab in the file into the hyperslab in + !memory and display. + ! + data_dims(1) = 7 + data_dims(2) = 7 + data_dims(3) = 3 + CALL h5dread_f(dset_id, H5T_NATIVE_INTEGER, data_out, data_dims, error, & + memspace, dataspace) + CALL check("h5dread_f", error, total_error) + + ! + !Display data_out array + ! + !do i = 1, 7 + ! print *, (data_out(i,j,1), j = 1,7) + !end do + + ! 0 0 0 0 0 0 0 + ! 0 0 0 0 0 0 0 + ! 0 0 0 0 0 0 0 + ! 3 4 5 6 0 0 0 + ! 4 5 6 7 0 0 0 + ! 5 6 7 8 0 0 0 + ! 0 0 0 0 0 0 0 + ! + + ! + !Close the dataspace for the dataset. + ! + CALL h5sclose_f(dataspace, error) + CALL check("h5sclose_f", error, total_error) + + ! + !Close the memoryspace. + ! + CALL h5sclose_f(memspace, error) + CALL check("h5sclose_f", error, total_error) + + ! + !Close the dataset. + ! + CALL h5dclose_f(dset_id, error) + CALL check("h5dclose_f", error, total_error) + + ! + !Close the file. + ! + CALL h5fclose_f(file_id, error) + CALL check("h5fclose_f", error, total_error) + + + if(cleanup) CALL h5_cleanup_f(filename, H5P_DEFAULT_F, error) + CALL check("h5_cleanup_f", error, total_error) + RETURN + + END SUBROUTINE test_select_hyperslab + + ! + !Subroutine to test element selection + ! + + SUBROUTINE test_select_element(cleanup, total_error) + + USE HDF5 ! This module contains all necessary modules + USE TH5_MISC + + IMPLICIT NONE + LOGICAL, INTENT(IN) :: cleanup + INTEGER, INTENT(INOUT) :: total_error + + ! + !the dataset1 is stored in file "copy1.h5" + ! + CHARACTER(LEN=13), PARAMETER :: filename1 = "tselect_copy1" + CHARACTER(LEN=80) :: fix_filename1 + + ! + !the dataset2 is stored in file "copy2.h5" + ! + CHARACTER(LEN=13), PARAMETER :: filename2 = "tselect_copy2" + CHARACTER(LEN=80) :: fix_filename2 + ! + !dataset1 name is "Copy1" + ! + CHARACTER(LEN=8), PARAMETER :: dsetname1 = "Copy1" + + ! + !dataset2 name is "Copy2" + ! + CHARACTER(LEN=8), PARAMETER :: dsetname2 = "Copy2" + + ! + !dataset rank + ! + INTEGER, PARAMETER :: RANK = 2 + + ! + !number of points selected + ! + INTEGER(SIZE_T), PARAMETER :: NUMP = 2 + + INTEGER(HID_T) :: file1_id ! File1 identifier + INTEGER(HID_T) :: file2_id ! File2 identifier + INTEGER(HID_T) :: dset1_id ! Dataset1 identifier + INTEGER(HID_T) :: dset2_id ! Dataset2 identifier + INTEGER(HID_T) :: dataspace1 ! Dataspace identifier + INTEGER(HID_T) :: dataspace2 ! Dataspace identifier + INTEGER(HID_T) :: memspace ! memspace identifier + + ! + !Memory space dimensions + ! + INTEGER(HSIZE_T), DIMENSION(1) :: dimsm = (/2/) + + ! + !Dataset dimensions + ! + INTEGER(HSIZE_T), DIMENSION(2) :: dimsf = (/3,4/) + + ! + !Points positions in the file + ! + INTEGER(HSIZE_T), DIMENSION(RANK,NUMP) :: coord + + ! + !data buffers + ! + INTEGER, DIMENSION(3,4) :: buf1, buf2, bufnew + + ! + !value to write + ! + INTEGER, DIMENSION(2) :: val = (/53, 59/) + + ! + !memory rank + ! + INTEGER :: memrank = 1 + + ! + !general purpose integer + ! + INTEGER :: i, j + + ! + !flag to check operation success + ! + INTEGER :: error + INTEGER(HSIZE_T), DIMENSION(3) :: data_dims + + + ! + !Create two files containing identical datasets. Write 0's to one + !and 1's to the other. + ! + + ! + !data initialization + ! + do i = 1, 3 + do j = 1, 4 + buf1(i,j) = 0; + end do + end do + + do i = 1, 3 + do j = 1, 4 + buf2(i,j) = 1; + end do + end do + + ! + !Initialize FORTRAN predifined datatypes + ! +! CALL h5init_types_f(error) +! CALL check("h5init_types_f", error, total_error) + + ! + !Create file1, file2 using default properties. + ! + CALL h5_fixname_f(filename1, fix_filename1, H5P_DEFAULT_F, error) + if (error .ne. 0) then + write(*,*) "Cannot modify filename" + stop + endif + CALL h5fcreate_f(fix_filename1, H5F_ACC_TRUNC_F, file1_id, error) + CALL check("h5fcreate_f", error, total_error) + + CALL h5_fixname_f(filename2, fix_filename2, H5P_DEFAULT_F, error) + if (error .ne. 0) then + write(*,*) "Cannot modify filename" + stop + endif + CALL h5fcreate_f(fix_filename2, H5F_ACC_TRUNC_F, file2_id, error) + CALL check("h5fcreate_f", error, total_error) + + ! + !Create the data space for the datasets. + ! + CALL h5screate_simple_f(RANK, dimsf, dataspace1, error) + CALL check("h5screate_simple_f", error, total_error) + + CALL h5screate_simple_f(RANK, dimsf, dataspace2, error) + CALL check("h5screate_simple_f", error, total_error) + + ! + ! Create the datasets with default properties + ! + CALL h5dcreate_f(file1_id, dsetname1, H5T_NATIVE_INTEGER, dataspace1, & + dset1_id, error) + CALL check("h5dcreate_f", error, total_error) + + CALL h5dcreate_f(file2_id, dsetname2, H5T_NATIVE_INTEGER, dataspace2, & + dset2_id, error) + CALL check("h5dcreate_f", error, total_error) + + ! + ! Write the datasets + ! + data_dims(1) = 3 + data_dims(2) = 4 + CALL h5dwrite_f(dset1_id, H5T_NATIVE_INTEGER, buf1, data_dims, error) + CALL check("h5dwrite_f", error, total_error) + + CALL h5dwrite_f(dset2_id, H5T_NATIVE_INTEGER, buf2, data_dims, error) + CALL check("h5dwrite_f", error, total_error) + + ! + !Close the dataspace for the datasets. + ! + CALL h5sclose_f(dataspace1, error) + CALL check("h5sclose_f", error, total_error) + + CALL h5sclose_f(dataspace2, error) + CALL check("h5sclose_f", error, total_error) + + ! + !Close the datasets. + ! + CALL h5dclose_f(dset1_id, error) + CALL check("h5dclose_f", error, total_error) + + CALL h5dclose_f(dset2_id, error) + CALL check("h5dclose_f", error, total_error) + + ! + !Close the files. + ! + CALL h5fclose_f(file1_id, error) + CALL check("h5fclose_f", error, total_error) + + CALL h5fclose_f(file2_id, error) + CALL check("h5fclose_f", error, total_error) + + ! + !Open the two files. Select two points in one file, write values to + !those point locations, then do H5Scopy and write the values to the + !other file. Close files. + ! + + ! + !Open the files. + ! + CALL h5fopen_f (fix_filename1, H5F_ACC_RDWR_F, file1_id, error) + CALL check("h5fopen_f", error, total_error) + + CALL h5fopen_f (fix_filename2, H5F_ACC_RDWR_F, file2_id, error) + CALL check("h5fopen_f", error, total_error) + + ! + !Open the datasets. + ! + CALL h5dopen_f(file1_id, dsetname1, dset1_id, error) + CALL check("h5dopen_f", error, total_error) + + CALL h5dopen_f(file2_id, dsetname2, dset2_id, error) + CALL check("h5dopen_f", error, total_error) + + ! + !Get dataset1's dataspace handle. + ! + CALL h5dget_space_f(dset1_id, dataspace1, error) + CALL check("h5dget_space_f", error, total_error) + + ! + !create memory dataspace. + ! + CALL h5screate_simple_f(memrank, dimsm, memspace, error) + CALL check("h5screate_simple_f", error, total_error) + + ! + !Set the selected point positions.Because Fortran array index starts + ! from 1, so add one to the actual select points in C + ! + coord(1,1) = 1 + coord(2,1) = 2 + coord(1,2) = 1 + coord(2,2) = 4 + + ! + !Select the elements in file space + ! + CALL h5sselect_elements_f(dataspace1, H5S_SELECT_SET_F, RANK, NUMP,& + coord, error) + CALL check("h5sselect_elements_f", error, total_error) + + ! + !Write value into the selected points in dataset1 + ! + data_dims(1) = 2 + CALL H5dwrite_f(dset1_id, H5T_NATIVE_INTEGER, val, data_dims, error, & + mem_space_id=memspace, file_space_id=dataspace1) + CALL check("h5dwrite_f", error, total_error) + + ! + !Copy the daspace1 into dataspace2 + ! + CALL h5scopy_f(dataspace1, dataspace2, error) + CALL check("h5scopy_f", error, total_error) + + ! + !Write value into the selected points in dataset2 + ! + CALL H5dwrite_f(dset2_id, H5T_NATIVE_INTEGER, val, data_dims, error, & + mem_space_id=memspace, file_space_id=dataspace2) + CALL check("h5dwrite_f", error, total_error) + + ! + !Close the dataspace for the datasets. + ! + CALL h5sclose_f(dataspace1, error) + CALL check("h5sclose_f", error, total_error) + + CALL h5sclose_f(dataspace2, error) + CALL check("h5sclose_f", error, total_error) + + ! + !Close the memoryspace. + ! + CALL h5sclose_f(memspace, error) + CALL check("h5sclose_f", error, total_error) + + ! + !Close the datasets. + ! + CALL h5dclose_f(dset1_id, error) + CALL check("h5dclose_f", error, total_error) + + CALL h5dclose_f(dset2_id, error) + CALL check("h5dclose_f", error, total_error) + + ! + !Close the files. + ! + CALL h5fclose_f(file1_id, error) + CALL check("h5fclose_f", error, total_error) + + CALL h5fclose_f(file2_id, error) + CALL check("h5fclose_f", error, total_error) + + ! + !Open both files and print the contents of the datasets. + ! + + ! + !Open the files. + ! + CALL h5fopen_f (fix_filename1, H5F_ACC_RDWR_F, file1_id, error) + CALL check("h5fopen_f", error, total_error) + + CALL h5fopen_f (fix_filename2, H5F_ACC_RDWR_F, file2_id, error) + CALL check("h5fopen_f", error, total_error) + + ! + !Open the datasets. + ! + CALL h5dopen_f(file1_id, dsetname1, dset1_id, error) + CALL check("h5dopen_f", error, total_error) + + CALL h5dopen_f(file2_id, dsetname2, dset2_id, error) + CALL check("h5dopen_f", error, total_error) + + ! + !Read dataset1. + ! + data_dims(1) = 3 + data_dims(2) = 4 + CALL h5dread_f(dset1_id, H5T_NATIVE_INTEGER, bufnew, data_dims, error) + CALL check("h5dread_f", error, total_error) + + ! + !Display the data read from dataset "Copy1" + ! + !write(*,*) "The data in dataset Copy1 is: " + !do i = 1, 3 + ! print *, (bufnew(i,j), j = 1,4) + !end do + + ! + !Read dataset2. + ! + CALL h5dread_f(dset2_id, H5T_NATIVE_INTEGER, bufnew, data_dims, error) + CALL check("h5dread_f", error, total_error) + + ! + !Display the data read from dataset "Copy2" + ! + !write(*,*) "The data in dataset Copy2 is: " + !do i = 1, 3 + ! print *, (bufnew(i,j), j = 1,4) + !end do + + ! + !Close the datasets. + ! + CALL h5dclose_f(dset1_id, error) + CALL check("h5dclose_f", error, total_error) + + CALL h5dclose_f(dset2_id, error) + CALL check("h5dclose_f", error, total_error) + + ! + !Close the files. + ! + CALL h5fclose_f(file1_id, error) + CALL check("h5fclose_f", error, total_error) + + CALL h5fclose_f(file2_id, error) + CALL check("h5fclose_f", error, total_error) + + + if(cleanup) CALL h5_cleanup_f(filename1, H5P_DEFAULT_F, error) + CALL check("h5_cleanup_f", error, total_error) + if(cleanup) CALL h5_cleanup_f(filename2, H5P_DEFAULT_F, error) + CALL check("h5_cleanup_f", error, total_error) + RETURN + END SUBROUTINE test_select_element + + + SUBROUTINE test_basic_select(cleanup, total_error) + + IMPLICIT NONE + LOGICAL, INTENT(IN) :: cleanup + INTEGER, INTENT(INOUT) :: total_error + + ! + !the dataset is stored in file "testselect.h5" + ! + CHARACTER(LEN=10), PARAMETER :: filename = "testselect" + CHARACTER(LEN=80) :: fix_filename + + ! + !dataspace rank + ! + INTEGER, PARAMETER :: RANK = 2 + + ! + !select NUMP_POINTS points from the file + ! + INTEGER(SIZE_T), PARAMETER :: NUMPS = 10 + + ! + !dataset name is "testselect" + ! + CHARACTER(LEN=10), PARAMETER :: dsetname = "testselect" + + INTEGER(HID_T) :: file_id ! File identifier + INTEGER(HID_T) :: dset_id ! Dataset identifier + INTEGER(HID_T) :: dataspace ! Dataspace identifier + + ! + !Dataset dimensions + ! + INTEGER(HSIZE_T), DIMENSION(2) :: dimsf = (/5,6/) + + ! + !Size of the hyperslab in the file + ! + INTEGER(HSIZE_T), DIMENSION(2) :: count = (/2,2/) + + ! + !hyperslab offset in the file + ! + INTEGER(HSIZE_T), DIMENSION(2) :: offset = (/0,0/) + + ! + !start block for getting the selected hyperslab + ! + INTEGER(HSIZE_T) :: startblock = 0 + + ! + !start point for getting the selected elements + ! + INTEGER(HSIZE_T) :: startpoint = 0 + + ! + !Stride of the hyperslab in the file + ! + INTEGER(HSIZE_T), DIMENSION(2) :: stride = (/3,3/) + + ! + !BLock size of the hyperslab in the file + ! + INTEGER(HSIZE_T), DIMENSION(2) :: block = (/2,2/) + + ! + !array to give selected points' coordinations + ! + INTEGER(HSIZE_T), DIMENSION(RANK, NUMPS) :: coord + + + ! + !Number of hyperslabs selected in the current dataspace + ! + INTEGER(HSSIZE_T) :: num_blocks + + ! + !allocatable array for putting a list of hyperslabs + !selected in the current file dataspace + ! + INTEGER(HSIZE_T), ALLOCATABLE, DIMENSION(:) :: blocklist + + ! + !Number of points selected in the current dataspace + ! + INTEGER(HSSIZE_T) :: num_points + INTEGER(HSIZE_T) :: num1_points + + ! + !allocatable array for putting a list of points + !selected in the current file dataspace + ! + INTEGER(HSIZE_T), ALLOCATABLE, DIMENSION(:) :: pointlist + + ! + !start and end bounds in the current dataspace selection + ! + INTEGER(HSIZE_T), DIMENSION(RANK) :: startout, endout + + ! + !data to write + ! + INTEGER, DIMENSION(5,6) :: data + + ! + !flag to check operation success + ! + INTEGER :: error + INTEGER(HSIZE_T), DIMENSION(3) :: data_dims + + ! + !initialize the coord array to give the selected points' position + ! + coord(1,1) = 1 + coord(2,1) = 1 + coord(1,2) = 1 + coord(2,2) = 3 + coord(1,3) = 1 + coord(2,3) = 5 + coord(1,4) = 3 + coord(2,4) = 1 + coord(1,5) = 3 + coord(2,5) = 3 + coord(1,6) = 3 + coord(2,6) = 5 + coord(1,7) = 4 + coord(2,7) = 3 + coord(1,8) = 4 + coord(2,8) = 1 + coord(1,9) = 5 + coord(2,9) = 3 + coord(1,10) = 5 + coord(2,10) = 5 + + ! + !Create a new file using default properties. + ! + CALL h5_fixname_f(filename, fix_filename, H5P_DEFAULT_F, error) + if (error .ne. 0) then + write(*,*) "Cannot modify filename" + stop + endif + CALL h5fcreate_f(fix_filename, H5F_ACC_TRUNC_F, file_id, error) + CALL check("h5fcreate_f", error, total_error) + + ! + !Create the data space for the dataset. + ! + CALL h5screate_simple_f(RANK, dimsf, dataspace, error) + CALL check("h5screate_simple_f", error, total_error) + + ! + ! Create the dataset with default properties + ! + CALL h5dcreate_f(file_id, dsetname, H5T_STD_I32BE, dataspace, & + dset_id, error) + CALL check("h5dcreate_f", error, total_error) + + ! + ! Write the dataset + ! + data_dims(1) = 5 + data_dims(2) = 6 + CALL h5dwrite_f(dset_id, H5T_NATIVE_INTEGER, data, data_dims, error) + CALL check("h5dwrite_f", error, total_error) + + ! + !Close the dataspace for the dataset. + ! + CALL h5sclose_f(dataspace, error) + CALL check("h5sclose_f", error, total_error) + + ! + !Close the dataset. + ! + CALL h5dclose_f(dset_id, error) + CALL check("h5dclose_f", error, total_error) + + ! + !Close the file. + ! + CALL h5fclose_f(file_id, error) + CALL check("h5fclose_f", error, total_error) + + ! + !Open the file. + ! + CALL h5fopen_f (fix_filename, H5F_ACC_RDONLY_F, file_id, error) + CALL check("h5fopen_f", error, total_error) + + ! + !Open the dataset. + ! + CALL h5dopen_f(file_id, dsetname, dset_id, error) + CALL check("h5dopen_f", error, total_error) + + ! + !Get dataset's dataspace handle. + ! + CALL h5dget_space_f(dset_id, dataspace, error) + CALL check("h5dget_space_f", error, total_error) + + ! + !Select hyperslab in the dataset. + ! + CALL h5sselect_hyperslab_f(dataspace, H5S_SELECT_SET_F, & + offset, count, error, stride, block) + CALL check("h5sselect_hyperslab_f", error, total_error) + + ! + !get the number of hyperslab blocks in the current dataspac selection + ! + CALL h5sget_select_hyper_nblocks_f(dataspace, num_blocks, error) + CALL check("h5sget_select_hyper_nblocks_f", error, total_error) + IF (num_blocks .NE. 4) write (*,*) "error occured with num_blocks" + !write(*,*) num_blocks + !result of num_blocks is 4 + + ! + !allocate the blocklist array + ! + ALLOCATE(blocklist(num_blocks*RANK*2), STAT= error) + if(error .NE. 0) then + STOP + endif + + ! + !get the list of hyperslabs selected in the current dataspac selection + ! + CALL h5sget_select_hyper_blocklist_f(dataspace, startblock, & + num_blocks, blocklist, error) + CALL check("h5sget_select_hyper_blocklist_f", error, total_error) +! write(*,*) (blocklist(i), i =1, num_blocks*RANK*2) + !result of blocklist selected is: + !1, 1, 2, 2, 4, 1, 5, 2, 1, 4, 2, 5, 4, 4, 5, 5 + + ! + !deallocate the blocklist array + ! + DEALLOCATE(blocklist) + + ! + !get the selection bounds in the current dataspac selection + ! + CALL h5sget_select_bounds_f(dataspace, startout, endout, error) + CALL check("h5sget_select_bounds_f", error, total_error) + IF ( (startout(1) .ne. 1) .or. (startout(2) .ne. 1) ) THEN + write(*,*) "error occured to select_bounds's start position" + END IF + + IF ( (endout(1) .ne. 5) .or. (endout(2) .ne. 5) ) THEN + write(*,*) "error occured to select_bounds's end position" + END IF + !write(*,*) (startout(i), i = 1, RANK) + !result of startout is 0, 0 + + !write(*,*) (endout(i), i = 1, RANK) + !result of endout is 5, 5 + + ! + !allocate the pointlist array + ! +! ALLOCATE(pointlist(num_blocks*RANK), STAT= error) + ALLOCATE(pointlist(20), STAT= error) + if(error .NE. 0) then + STOP + endif + + ! + !Select the elements in file space + ! + CALL h5sselect_elements_f(dataspace, H5S_SELECT_SET_F, RANK, NUMPS,& + coord, error) + CALL check("h5sselect_elements_f", error, total_error) + + ! + !Get the number of selected elements + ! + CALL h5sget_select_elem_npoints_f(dataspace, num_points, error) + CALL check("h5sget_select_elem_npoints_f", error, total_error) + IF (num_points .NE. 10) write(*,*) "error occured with num_points" + !write(*,*) num_points + ! result of num_points is 10 + + ! + !Get the list of selected elements + ! + num1_points = num_points + CALL h5sget_select_elem_pointlist_f(dataspace, startpoint, & + num1_points, pointlist, error) + CALL check("h5sget_select_elem_pointlist_f", error, total_error) + !write(*,*) (pointlist(i), i =1, num1_points*RANK) + !result of pintlist is: + !1, 1, 3, 1, 5, 1, 1, 3, 3, 3, 5, 3, 3, + !4, 1, 4, 3, 5, 5, 5 + + ! + !deallocate the pointlist array + ! + DEALLOCATE(pointlist) + + ! + !Close the dataspace for the dataset. + ! + CALL h5sclose_f(dataspace, error) + CALL check("h5sclose_f", error, total_error) + + ! + !Close the dataset. + ! + CALL h5dclose_f(dset_id, error) + CALL check("h5dclose_f", error, total_error) + + ! + !Close the file. + ! + CALL h5fclose_f(file_id, error) + CALL check("h5fclose_f", error, total_error) + + + if(cleanup) CALL h5_cleanup_f(filename, H5P_DEFAULT_F, error) + CALL check("h5_cleanup_f", error, total_error) + + RETURN + END SUBROUTINE test_basic_select + +!*************************************************************** +!** +!** test_select_point(): Test basic H5S (dataspace) selection code. +!** Tests element selections between dataspaces of various sizes +!** and dimensionalities. +!** +!*************************************************************** + +SUBROUTINE test_select_point(cleanup, total_error) + + IMPLICIT NONE + LOGICAL, INTENT(IN) :: cleanup + INTEGER, INTENT(INOUT) :: total_error + INTEGER(HID_T) :: xfer_plist + + INTEGER, PARAMETER :: SPACE1_DIM1=3 + INTEGER, PARAMETER :: SPACE1_DIM2=15 + INTEGER, PARAMETER :: SPACE1_DIM3=13 + INTEGER, PARAMETER :: SPACE2_DIM1=30 + INTEGER, PARAMETER :: SPACE2_DIM2=26 + INTEGER, PARAMETER :: SPACE3_DIM1=15 + INTEGER, PARAMETER :: SPACE3_DIM2=26 + + INTEGER, PARAMETER :: SPACE1_RANK=3 + INTEGER, PARAMETER :: SPACE2_RANK=2 + INTEGER, PARAMETER :: SPACE3_RANK=2 + + ! Element selection information + INTEGER, PARAMETER :: POINT1_NPOINTS=10 + INTEGER(hid_t) ::fid1 ! HDF5 File IDs + INTEGER(hid_t) ::dataset ! Dataset ID + INTEGER(hid_t) ::sid1,sid2 ! Dataspace ID + INTEGER(hsize_t), DIMENSION(1:3) :: dims1 = (/SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3/) + INTEGER(hsize_t), DIMENSION(1:2) :: dims2 = (/SPACE2_DIM1, SPACE2_DIM2/) + INTEGER(hsize_t), DIMENSION(1:2) :: dims3 = (/SPACE3_DIM1, SPACE3_DIM2/) + + INTEGER(hsize_t), DIMENSION(1:SPACE1_RANK,1:POINT1_NPOINTS) :: coord1 ! Coordinates for point selection + INTEGER(hsize_t), DIMENSION(1:SPACE1_RANK,1:POINT1_NPOINTS) :: temp_coord1 ! Coordinates for point selection + INTEGER(hsize_t), DIMENSION(1:SPACE2_RANK,1:POINT1_NPOINTS) :: coord2 ! Coordinates for point selection + INTEGER(hsize_t), DIMENSION(1:SPACE2_RANK,1:POINT1_NPOINTS) :: temp_coord2 ! Coordinates for point selection + INTEGER(hsize_t), DIMENSION(1:SPACE3_RANK,1:POINT1_NPOINTS) :: coord3 ! Coordinates for point selection + INTEGER(hsize_t), DIMENSION(1:SPACE3_RANK,1:POINT1_NPOINTS) :: temp_coord3 ! Coordinates for point selection + INTEGER(hssize_t) :: npoints + +!!$ uint8_t *wbuf, buffer to write to disk +!!$ *rbuf, buffer read from disk +!!$ *tbuf; temporary buffer pointer + INTEGER :: i,j; ! Counters +! struct pnt_iter pi; Custom Pointer iterator struct + INTEGER :: error ! Generic return value + CHARACTER(LEN=9) :: filename = 'h5s_hyper' + CHARACTER(LEN=80) :: fix_filename + CHARACTER(LEN=1), DIMENSION(1:SPACE2_DIM1,1:SPACE2_DIM2) :: wbuf + + CALL h5_fixname_f(filename, fix_filename, H5P_DEFAULT_F, error) + IF (error .NE. 0) THEN + WRITE(*,*) "Cannot modify filename" + STOP + ENDIF + xfer_plist = H5P_DEFAULT_F +! MESSAGE(5, ("Testing Element Selection Functions\n")); + + ! Allocate write & read buffers +!!$ wbuf = HDmalloc(sizeof(uint8_t) * SPACE2_DIM1 * SPACE2_DIM2); +!!$ rbuf = HDcalloc(sizeof(uint8_t), (size_t)(SPACE3_DIM1 * SPACE3_DIM2)); +!!$ + ! Initialize WRITE buffer + + DO i = 1, SPACE2_DIM1 + DO j = 1, SPACE2_DIM2 + wbuf(i,j) = 'a' + ENDDO + ENDDO + +!!$ for(i=0, tbuf=wbuf; i set offset -> set precision -> set size. + ! * All these properties must be set before the type can function. Other + ! * properties can be set anytime. Derived type size cannot be expanded + ! * bigger than original size but can be decreased. There should be no + ! * holes among the significant bits. Exponent bias usually is set + ! * 2^(n-1)-1, where n is the exponent size. + ! *----------------------------------------------------------------------- + + CALL H5Tset_fields_f(tid1, INT(44,size_t), INT(34,size_t), INT(10,size_t), & + INT(3,size_t), INT(31,size_t), error) + CALL check("H5Tset_fields_f",error,total_error) + + CALL H5Tset_offset_f(tid1, INT(3,size_t), error) + CALL check("H5Tset_offset_f",error,total_error) + + CALL H5Tset_precision_f(tid1, INT(42,size_t), error) + CALL check("H5Tset_precision_f",error,total_error) + + CALL H5Tset_size_f(tid1, INT(7,size_t), error) + CALL check("H5Tset_size_f",error,total_error) + + CALL H5Tset_ebias_f(tid1, INT(511,size_t), error) + CALL check("H5Tset_ebias_f",error,total_error) + + CALL H5Tset_pad_f(tid1, H5T_PAD_ZERO_F, H5T_PAD_ZERO_F, error) + CALL check("H5Tset_pad_f",error,total_error) + + CALL h5tcommit_f(file, "new float type 1", tid1, error) + CALL check("h5tcommit_f", error, total_error) + + CALL h5tclose_f(tid1, error) + CALL check("h5tclose_f", error, total_error) + + CALL H5Topen_f(file, "new float type 1", tid1, error) + CALL check("H5Topen_f", error, total_error) + + CALL H5Tget_fields_f(tid1, spos, epos, esize, mpos, msize, error) + CALL check("H5Tget_fields_f", error, total_error) + + IF(spos.NE.44 .OR. epos.NE.34 .OR. esize.NE.10 .OR. mpos.NE.3 .OR. msize.NE.31)THEN + CALL verify("H5Tget_fields_f", -1, 0, total_error) + ENDIF + + CALL H5Tget_precision_f(tid1, precision1, error) + CALL check("H5Tget_precision_f", error, total_error) + CALL verify("H5Tget_precision_f", INT(precision1), 42, total_error) + + CALL H5Tget_offset_f(tid1, offset1, error) + CALL check("H5Tget_offset_f", error, total_error) + CALL verify("H5Tget_offset_f", INT(offset1), 3, total_error) + + CALL H5Tget_size_f(tid1, size1, error) + CALL check("H5Tget_size_f", error, total_error) + CALL verify("H5Tget_size_f", INT(size1), 7, total_error) + + CALL H5Tget_ebias_f(tid1, ebias1, error) + CALL check("H5Tget_ebias_f", error, total_error) + CALL verify("H5Tget_ebias_f", INT(ebias1), 511, total_error) + + !-------------------------------------------------------------------------- + ! * 2nd floating-point type + ! * size=3 byte, precision=24 bits, offset=0 bits, mantissa size=16 bits, + ! * mantissa position=0, exponent size=7 bits, exponent position=16, exponent + ! * bias=63. It can be illustrated in little-endian order as + ! * + ! * 2 1 0 + ! * SEEEEEEE MMMMMMMM MMMMMMMM + ! *-------------------------------------------------------------------------- + + CALL H5Tset_fields_f(tid2, INT(23,size_t), INT(16,size_t), INT(7,size_t), & + INT(0,size_t), INT(16,size_t), error) + CALL check("H5Tset_fields_f",error,total_error) + + CALL H5Tset_offset_f(tid2, INT(0,size_t), error) + CALL check("H5Tset_offset_f",error,total_error) + + CALL H5Tset_precision_f(tid2, INT(24,size_t), error) + CALL check("H5Tset_precision_f",error,total_error) + + CALL H5Tset_size_f(tid2, INT(3,size_t), error) + CALL check("H5Tset_size_f",error,total_error) + + CALL H5Tset_ebias_f(tid2, INT(63,size_t), error) + CALL check("H5Tset_ebias_f",error,total_error) + + CALL H5Tset_pad_f(tid2, H5T_PAD_ZERO_F, H5T_PAD_ZERO_F, error) + CALL check("H5Tset_pad_f",error,total_error) + + CALL h5tcommit_f(file, "new float type 2", tid2, error) + CALL check("h5tcommit_f", error, total_error) + + CALL h5tclose_f(tid2, error) + CALL check("h5tclose_f", error, total_error) + + CALL H5Topen_f(file, "new float type 2", tid2, error) + CALL check("H5Topen_f", error, total_error) + + CALL H5Tget_fields_f(tid2, spos, epos, esize, mpos, msize, error) + CALL check("H5Tget_fields_f", error, total_error) + + IF(spos.NE.23 .OR. epos.NE.16 .OR. esize.NE.7 .OR. mpos.NE.0 .OR. msize.NE.16)THEN + CALL verify("H5Tget_fields_f", -1, 0, total_error) + ENDIF + + CALL H5Tget_precision_f(tid2, precision2, error) + CALL check("H5Tget_precision_f", error, total_error) + CALL verify("H5Tget_precision_f", INT(precision2), 24, total_error) + + CALL H5Tget_offset_f(tid2, offset2, error) + CALL check("H5Tget_offset_f", error, total_error) + CALL verify("H5Tget_offset_f", INT(offset2), 0, total_error) + + CALL H5Tget_size_f(tid2, size2, error) + CALL check("H5Tget_size_f", error, total_error) + CALL verify("H5Tget_size_f", INT(size2), 3, total_error) + + CALL H5Tget_ebias_f(tid2, ebias2, error) + CALL check("H5Tget_ebias_f", error, total_error) + CALL verify("H5Tget_ebias_f", INT(ebias2), 63, total_error) + + CALL h5tclose_f(tid1, error) + CALL check("h5tclose_f", error, total_error) + + CALL h5tclose_f(tid2, error) + CALL check("h5tclose_f", error, total_error) + + CALL H5Pclose_f(dxpl_id, error) + CALL check("H5Pclose_f", error, total_error) + + CALL h5fclose_f(file,error) + CALL check("h5fclose_f", error, total_error) + + IF(cleanup) CALL h5_cleanup_f(filename, H5P_DEFAULT_F, error) + CALL check("h5_cleanup_f", error, total_error) + +END SUBROUTINE test_derived_flt + +END MODULE TH5T diff --git a/fortran/test/tH5T.f90 b/fortran/test/tH5T.f90 deleted file mode 100644 index efbceea..0000000 --- a/fortran/test/tH5T.f90 +++ /dev/null @@ -1,1149 +0,0 @@ -!****h* root/fortran/test/tH5T.f90 -! -! NAME -! tH5T.f90 -! -! FUNCTION -! Basic testing of Fortran H5T 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. * -! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -! -! CONTAINS SUBROUTINES -! compoundtest, basic_data_type_test, enumtest, test_derived_flt -! -!***** - -MODULE TH5T - - USE HDF5 - USE TH5_MISC - USE TH5_MISC_GEN - -CONTAINS - - SUBROUTINE compoundtest(cleanup, total_error) -! -! This program creates a dataset that is one dimensional array of -! structures { -! character*2 -! integer -! double precision -! real -! } -! Data is written and read back by fields. -! -! The following H5T interface functions are tested: -! h5tcopy_f, h5tset(get)_size_f, h5tcreate_f, h5tinsert_f, h5tclose_f, -! h5tget_class_f, h5tget_member_name_f, h5tget_member_offset_f, h5tget_member_type_f, -! h5tequal_f, h5tinsert_array_f, h5tcommit_f, h5tencode_f, h5tdecode_f - - - IMPLICIT NONE - LOGICAL, INTENT(IN) :: cleanup - INTEGER, INTENT(OUT) :: total_error - - CHARACTER(LEN=8), PARAMETER :: filename = "compound" ! File name - CHARACTER(LEN=80) :: fix_filename - CHARACTER(LEN=8), PARAMETER :: dsetname = "Compound" ! Dataset name - INTEGER, PARAMETER :: dimsize = 6 ! Size of the dataset - INTEGER, PARAMETER :: COMP_NUM_MEMBERS = 4 ! Number of members in the compound datatype - - INTEGER(HID_T) :: file_id ! File identifier - INTEGER(HID_T) :: dset_id ! Dataset identifier - INTEGER(HID_T) :: dspace_id ! Dataspace identifier - INTEGER(HID_T) :: dtype_id ! Compound datatype identifier - INTEGER(HID_T) :: dtarray_id ! Compound datatype identifier - INTEGER(HID_T) :: arrayt_id ! Array datatype identifier - INTEGER(HID_T) :: dt1_id ! Memory datatype identifier (for character field) - INTEGER(HID_T) :: dt2_id ! Memory datatype identifier (for integer field) - INTEGER(HID_T) :: dt3_id ! Memory datatype identifier (for double precision field) - INTEGER(HID_T) :: dt4_id ! Memory datatype identifier (for real field) - INTEGER(HID_T) :: dt5_id ! Memory datatype identifier - INTEGER(HID_T) :: membtype_id ! Datatype identifier - INTEGER(HID_T) :: plist_id ! Dataset trasfer property - - - INTEGER(HSIZE_T), DIMENSION(1) :: dims = (/dimsize/) ! Dataset dimensions - INTEGER :: rank = 1 ! Dataset rank - - INTEGER :: error ! Error flag - INTEGER(SIZE_T) :: type_size ! Size of the datatype - INTEGER(SIZE_T) :: type_sizec ! Size of the character datatype - INTEGER(SIZE_T) :: type_sizei ! Size of the integer datatype - INTEGER(SIZE_T) :: type_sized ! Size of the double precision datatype - INTEGER(SIZE_T) :: type_sizer ! Size of the real datatype - INTEGER(SIZE_T) :: offset ! Member's offset - INTEGER(SIZE_T) :: offset_out ! Member's offset - CHARACTER(LEN=2), DIMENSION(dimsize) :: char_member - CHARACTER(LEN=2), DIMENSION(dimsize) :: char_member_out ! Buffer to read data out - INTEGER, DIMENSION(dimsize) :: int_member - INTEGER, DIMENSION(dimsize) :: int_member_out - REAL(KIND=Fortran_DOUBLE), DIMENSION(dimsize) :: double_member - REAL(KIND=Fortran_DOUBLE), DIMENSION(dimsize) :: double_member_out - REAL, DIMENSION(dimsize) :: real_member - REAL, DIMENSION(dimsize) :: real_member_out - INTEGER :: i - INTEGER :: class ! Datatype class - 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 - INTEGER(HSIZE_T), DIMENSION(3) :: array_dims=(/2,3,4/) - INTEGER :: array_dims_range = 3 - INTEGER :: elements = 24 ! number of elements in the array_dims array. - INTEGER(SIZE_T) :: sizechar - INTEGER(HSIZE_T), DIMENSION(1) :: data_dims - LOGICAL :: flag = .TRUE. - - CHARACTER(LEN=1024) :: cmpd_buf - INTEGER(SIZE_T) :: cmpd_buf_size=0 - 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. - ! - do i = 1, dimsize - char_member(i)(1:1) = char(65+i) - char_member(i)(2:2) = char(65+i) - char_member_out(i)(1:1) = char(65) - char_member_out(i)(2:2) = char(65) - int_member(i) = i - int_member_out(i) = 0 - double_member(i) = 2.* i - double_member_out(i) = 0. - real_member(i) = 3. * i - real_member_out(i) = 0. - enddo - - ! - ! Set dataset transfer property to preserve partially initialized fields - ! during write/read to/from dataset with compound datatype. - ! - CALL h5pcreate_f(H5P_DATASET_XFER_F, plist_id, error) - CALL check("h5pcreate_f", error, total_error) - CALL h5pset_preserve_f(plist_id, flag, error) - CALL check("h5pset_preserve_f", error, total_error) - ! - ! Create a new file using default properties. - ! - CALL h5_fixname_f(filename, fix_filename, H5P_DEFAULT_F, error) - if (error .ne. 0) then - write(*,*) "Cannot modify filename" - stop - endif - CALL h5fcreate_f(fix_filename, H5F_ACC_TRUNC_F, file_id, error) - CALL check("h5fcreate_f", error, total_error) - - ! - ! Create the dataspace. - ! - CALL h5screate_simple_f(rank, dims, dspace_id, error) - CALL check("h5screate_simple_f", error, total_error) - ! - ! Create compound datatype. - ! - ! First calculate total size by calculating sizes of each member - ! - CALL h5tcopy_f(H5T_NATIVE_CHARACTER, dt5_id, error) - CALL check("h5tcopy_f", error, total_error) - sizechar = 2 - CALL h5tset_size_f(dt5_id, sizechar, error) - CALL check("h5tset_size_f", error, total_error) - CALL h5tget_size_f(dt5_id, type_sizec, error) - CALL check("h5tget_size_f", error, total_error) - CALL h5tget_size_f(H5T_NATIVE_INTEGER, type_sizei, error) - CALL check("h5tget_size_f", error, total_error) - CALL h5tget_size_f(H5T_NATIVE_DOUBLE, type_sized, error) - CALL check("h5tget_size_f", error, total_error) - CALL h5tget_size_f(H5T_NATIVE_REAL, type_sizer, error) - CALL check("h5tget_size_f", error, total_error) - !write(*,*) "get sizes", type_sizec, type_sizei, type_sizer, type_sized - type_size = type_sizec + type_sizei + type_sized + type_sizer - CALL h5tcreate_f(H5T_COMPOUND_F, type_size, dtype_id, error) - CALL check("h5tcreate_f", error, total_error) - ! - ! Insert memebers - ! - ! CHARACTER*2 memeber - ! - offset = 0 - CALL h5tinsert_f(dtype_id, "char_field", offset, dt5_id, error) - CALL check("h5tinsert_f", error, total_error) - ! - ! INTEGER member - ! - offset = offset + type_sizec ! Offset of the second memeber is 2 - CALL h5tinsert_f(dtype_id, "integer_field", offset, H5T_NATIVE_INTEGER, error) - CALL check("h5tinsert_f", error, total_error) - ! - ! DOUBLE PRECISION member - ! - offset = offset + type_sizei ! Offset of the third memeber is 6 - CALL h5tinsert_f(dtype_id, "double_field", offset, H5T_NATIVE_DOUBLE, error) - CALL check("h5tinsert_f", error, total_error) - ! - ! REAL member - ! - offset = offset + type_sized ! Offset of the last member is 14 - CALL h5tinsert_f(dtype_id, "real_field", offset, H5T_NATIVE_REAL, error) - CALL check("h5tinsert_f", error, total_error) - ! - ! Create the dataset with compound datatype. - ! - CALL h5dcreate_f(file_id, dsetname, dtype_id, dspace_id, & - dset_id, error) - CALL check("h5dcreate_f", error, total_error) - ! - ! Create memory types. We have to create a compound datatype - ! for each member we want to write. - ! - CALL h5tcreate_f(H5T_COMPOUND_F, type_sizec, dt1_id, error) - CALL check("h5tcreate_f", error, total_error) - offset = 0 - CALL h5tinsert_f(dt1_id, "char_field", offset, dt5_id, error) - CALL check("h5tinsert_f", error, total_error) - ! - CALL h5tcreate_f(H5T_COMPOUND_F, type_sizei, dt2_id, error) - CALL check("h5tcreate_f", error, total_error) - offset = 0 - CALL h5tinsert_f(dt2_id, "integer_field", offset, H5T_NATIVE_INTEGER, error) - CALL check("h5tinsert_f", error, total_error) - ! - CALL h5tcreate_f(H5T_COMPOUND_F, type_sized, dt3_id, error) - CALL check("h5tcreate_f", error, total_error) - offset = 0 - CALL h5tinsert_f(dt3_id, "double_field", offset, H5T_NATIVE_DOUBLE, error) - CALL check("h5tinsert_f", error, total_error) - ! - CALL h5tcreate_f(H5T_COMPOUND_F, type_sizer, dt4_id, error) - CALL check("h5tcreate_f", error, total_error) - offset = 0 - CALL h5tinsert_f(dt4_id, "real_field", offset, H5T_NATIVE_REAL, error) - CALL check("h5tinsert_f", error, total_error) - ! - ! Write data by fields in the datatype. Fields order is not important. - ! - CALL h5dwrite_f(dset_id, dt4_id, real_member, data_dims, error, xfer_prp = plist_id) - CALL check("h5dwrite_f", error, total_error) - CALL h5dwrite_f(dset_id, dt1_id, char_member, data_dims, error, xfer_prp = plist_id) - CALL check("h5dwrite_f", error, total_error) - CALL h5dwrite_f(dset_id, dt3_id, double_member, data_dims, error, xfer_prp = plist_id) - CALL check("h5dwrite_f", error, total_error) - CALL h5dwrite_f(dset_id, dt2_id, int_member, data_dims, error, xfer_prp = plist_id) - CALL check("h5dwrite_f", error, total_error) - - ! - ! End access to the dataset and release resources used by it. - ! - CALL h5dclose_f(dset_id, error) - CALL check("h5dclose_f", error, total_error) - - ! - ! Terminate access to the data space. - ! - CALL h5sclose_f(dspace_id, error) - CALL check("h5sclose_f", error, total_error) - ! - ! Terminate access to the datatype - ! - CALL h5tclose_f(dtype_id, error) - CALL check("h5tclose_f", error, total_error) - CALL h5tclose_f(dt1_id, error) - CALL check("h5tclose_f", error, total_error) - CALL h5tclose_f(dt2_id, error) - CALL check("h5tclose_f", error, total_error) - CALL h5tclose_f(dt3_id, error) - CALL check("h5tclose_f", error, total_error) - CALL h5tclose_f(dt4_id, error) - CALL check("h5tclose_f", error, total_error) - ! - ! Create and store compound datatype with the character and - ! array members. - ! - type_size = type_sizec + elements*type_sizer ! Size of compound datatype - CALL h5tcreate_f(H5T_COMPOUND_F, type_size, dtarray_id, error) - CALL check("h5tcreate_f", error, total_error) - offset = 0 - CALL h5tinsert_f(dtarray_id, "char_field", offset, H5T_NATIVE_CHARACTER, error) - CALL check("h5tinsert_f", error, total_error) - offset = type_sizec - CALL h5tarray_create_f(H5T_NATIVE_REAL, array_dims_range, array_dims, arrayt_id, error) - CALL check("h5tarray_create_f", error, total_error) - CALL h5tinsert_f(dtarray_id,"array_field", offset, arrayt_id, error) - CALL check("h5tinsert_f", error, total_error) - CALL h5tcommit_f(file_id, "Compound_with_array_member", dtarray_id, error) - CALL check("h5tcommit_f", error, total_error) - CALL h5tclose_f(arrayt_id, error) - CALL check("h5tclose_f", error, total_error) - CALL h5tclose_f(dtarray_id, error) - CALL check("h5tclose_f", error, total_error) - - ! - ! Close the file. - ! - CALL h5fclose_f(file_id, error) - CALL check("h5fclose_f", error, total_error) - - ! - ! Open the file. - ! - CALL h5fopen_f (fix_filename, H5F_ACC_RDWR_F, file_id, error) - CALL check("h5fopen_f", error, total_error) - ! - ! Open the dataset. - ! - CALL h5dopen_f(file_id, dsetname, dset_id, error) - CALL check("h5dopen_f", error, total_error) - ! - ! Get datatype of the open dataset. - ! Check it class, number of members, and member's names. - ! - CALL h5dget_type_f(dset_id, dtype_id, error) - CALL check("h5dget_type_f", error, total_error) - CALL h5tget_class_f(dtype_id, class, error) - CALL check("h5dget_class_f", error, total_error) - if (class .ne. H5T_COMPOUND_F) then - write(*,*) " Wrong class type returned" - total_error = total_error + 1 - endif - CALL h5tget_nmembers_f(dtype_id, num_members, error) - CALL check("h5dget_nmembers_f", error, total_error) - if (num_members .ne. COMP_NUM_MEMBERS ) then - write(*,*) " Wrong number of members returned" - total_error = total_error + 1 - 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") - if(offset_out .ne. 0) then - write(*,*) "Offset of the char member is incorrect" - total_error = total_error + 1 - endif - CALL h5tget_member_type_f(dtype_id, i-1, membtype_id, error) - CALL check("h5tget_member_type_f", error, total_error) - CALL h5tequal_f(membtype_id, dt5_id, flag, error) - CALL check("h5tequal_f", error, total_error) - if(.not. flag) then - write(*,*) "Wrong member type returned for character member" - total_error = total_error + 1 - endif - CALL h5tget_member_class_f(dtype_id, i-1, class, error) - CALL check("h5tget_member_class_f",error, total_error) - if (class .ne. H5T_STRING_F) then - write(*,*) "Wrong class returned for character member" - total_error = total_error + 1 - endif - CASE("integer_field") - if(offset_out .ne. type_sizec) then - write(*,*) "Offset of the integer member is incorrect" - total_error = total_error + 1 - endif - CALL h5tget_member_type_f(dtype_id, i-1, membtype_id, error) - CALL check("h5tget_member_type_f", error, total_error) - CALL h5tequal_f(membtype_id, H5T_NATIVE_INTEGER, flag, error) - CALL check("h5tequal_f", error, total_error) - if(.not. flag) then - write(*,*) "Wrong member type returned for integer memebr" - total_error = total_error + 1 - endif - CALL h5tget_member_class_f(dtype_id, i-1, class, error) - CALL check("h5tget_member_class_f",error, total_error) - if (class .ne. H5T_INTEGER_F) then - write(*,*) "Wrong class returned for INTEGER member" - total_error = total_error + 1 - endif - CASE("double_field") - if(offset_out .ne. (type_sizec+type_sizei)) then - write(*,*) "Offset of the double precision member is incorrect" - total_error = total_error + 1 - endif - CALL h5tget_member_type_f(dtype_id, i-1, membtype_id, error) - CALL check("h5tget_member_type_f", error, total_error) - CALL h5tequal_f(membtype_id, H5T_NATIVE_DOUBLE, flag, error) - CALL check("h5tequal_f", error, total_error) - if(.not. flag) then - write(*,*) "Wrong member type returned for double precision memebr" - total_error = total_error + 1 - endif - CALL h5tget_member_class_f(dtype_id, i-1, class, error) - CALL check("h5tget_member_class_f",error, total_error) - if (class .ne. H5T_FLOAT_F) then - write(*,*) "Wrong class returned for double precision member" - total_error = total_error + 1 - endif - CASE("real_field") - if(offset_out .ne. (type_sizec+type_sizei+type_sized)) then - write(*,*) "Offset of the real member is incorrect" - total_error = total_error + 1 - endif - CALL h5tget_member_type_f(dtype_id, i-1, membtype_id, error) - CALL check("h5tget_member_type_f", error, total_error) - CALL h5tequal_f(membtype_id, H5T_NATIVE_REAL, flag, error) - CALL check("h5tequal_f", error, total_error) - if(.not. flag) then - write(*,*) "Wrong member type returned for real memebr" - total_error = total_error + 1 - endif - CALL h5tget_member_class_f(dtype_id, i-1, class, error) - CALL check("h5tget_member_class_f",error, total_error) - if (class .ne. H5T_FLOAT_F) then - write(*,*) "Wrong class returned for real member" - total_error = total_error + 1 - endif - CASE DEFAULT - write(*,*) "Wrong member's name" - total_error = total_error + 1 - - END SELECT CHECK_NAME - - enddo - ! - ! Create memory datatype to read character member of the compound datatype. - ! - CALL h5tcopy_f(H5T_NATIVE_CHARACTER, dt2_id, error) - CALL check("h5tcopy_f", error, total_error) - sizechar = 2 - CALL h5tset_size_f(dt2_id, sizechar, error) - CALL check("h5tset_size_f", error, total_error) - CALL h5tget_size_f(dt2_id, type_size, error) - CALL check("h5tget_size_f", error, total_error) - CALL h5tcreate_f(H5T_COMPOUND_F, type_size, dt1_id, error) - CALL check("h5tcreate_f", error, total_error) - offset = 0 - CALL h5tinsert_f(dt1_id, "char_field", offset, dt2_id, error) - CALL check("h5tinsert_f", error, total_error) - ! - ! Read part of the dataset - ! - CALL h5dread_f(dset_id, dt1_id, char_member_out, data_dims, error) - CALL check("h5dread_f", error, total_error) - do i = 1, dimsize - if (char_member_out(i) .ne. char_member(i)) then - write(*,*) " Wrong character data is read back " - total_error = total_error + 1 - endif - enddo - ! - CALL h5tcreate_f(H5T_COMPOUND_F, type_sizei, dt5_id, error) - CALL check("h5tcreate_f", error, total_error) - offset = 0 - CALL h5tinsert_f(dt5_id, "integer_field", offset, H5T_NATIVE_INTEGER, error) - CALL check("h5tinsert_f", error, total_error) - ! - ! Read part of the dataset - ! - CALL h5dread_f(dset_id, dt5_id, int_member_out, data_dims, error) - CALL check("h5dread_f", error, total_error) - do i = 1, dimsize - if (int_member_out(i) .ne. int_member(i)) then - write(*,*) " Wrong integer data is read back " - total_error = total_error + 1 - endif - enddo - ! - ! - CALL h5tcreate_f(H5T_COMPOUND_F, type_sized, dt3_id, error) - CALL check("h5tcreate_f", error, total_error) - offset = 0 - CALL h5tinsert_f(dt3_id, "double_field", offset, H5T_NATIVE_DOUBLE, error) - CALL check("h5tinsert_f", error, total_error) - ! - ! Read part of the dataset - ! - CALL h5dread_f(dset_id, dt3_id, double_member_out, data_dims, error) - CALL check("h5dread_f", error, total_error) - DO i = 1, dimsize - CALL VERIFY("h5dread_f:Wrong double precision data is read back", double_member_out(i), double_member(i), total_error) - ENDDO - ! - ! - CALL h5tcreate_f(H5T_COMPOUND_F, type_sizer, dt4_id, error) - CALL check("h5tcreate_f", error, total_error) - offset = 0 - CALL h5tinsert_f(dt4_id, "real_field", offset, H5T_NATIVE_REAL, error) - CALL check("h5tinsert_f", error, total_error) - ! - ! Read part of the dataset - ! - CALL h5dread_f(dset_id, dt4_id, real_member_out, data_dims, error) - CALL check("h5dread_f", error, total_error) - DO i = 1, dimsize - CALL VERIFY("h5dread_f:Wrong double precision data is read back", real_member_out(i), real_member(i), total_error) - ENDDO - ! - ! *----------------------------------------------------------------------- - ! * Test encoding and decoding compound datatypes - ! *----------------------------------------------------------------------- - ! - ! Encode compound type in a buffer - ! -- First find the buffer size - - CALL H5Tencode_f(dtype_id, cmpd_buf, cmpd_buf_size, error) - CALL check("H5Tencode_f", error, total_error) - - ! Try decoding bogus buffer - - CALL H5Tdecode_f(cmpd_buf, decoded_tid1, error) - CALL verify("H5Tdecode_f", error, -1, total_error) - - CALL H5Tencode_f(dtype_id, cmpd_buf, cmpd_buf_size, error) - CALL check("H5Tencode_f", error, total_error) - - ! Decode from the compound buffer and return an object handle - CALL H5Tdecode_f(cmpd_buf, decoded_tid1, error) - CALL check("H5Tdecode_f", error, total_error) - - ! Verify that the datatype was copied exactly - - CALL H5Tequal_f(decoded_tid1, dtype_id, flag, error) - CALL check("H5Tequal_f", error, total_error) - CALL verify("H5Tequal_f", flag, .TRUE., total_error) - ! - ! Close all open objects. - ! - CALL h5dclose_f(dset_id, error) - CALL check("h5dclose_f", error, total_error) - CALL h5tclose_f(dt1_id, error) - CALL check("h5tclose_f", error, total_error) - CALL h5tclose_f(dt2_id, error) - CALL check("h5tclose_f", error, total_error) - CALL h5tclose_f(dt3_id, error) - CALL check("h5tclose_f", error, total_error) - CALL h5tclose_f(dt4_id, error) - CALL check("h5tclose_f", error, total_error) - CALL h5tclose_f(dt5_id, error) - CALL check("h5tclose_f", error, total_error) - CALL h5fclose_f(file_id, error) - CALL check("h5fclose_f", error, total_error) - - IF(cleanup) CALL h5_cleanup_f(filename, H5P_DEFAULT_F, error) - CALL check("h5_cleanup_f", error, total_error) - RETURN - END SUBROUTINE compoundtest - - - - - SUBROUTINE basic_data_type_test(total_error) - -! This subroutine tests following functionalities: -! H5tget_precision_f, H5tset_precision_f, H5tget_offset_f -! H5tset_offset_f, H5tget_pad_f, H5tset_pad_f, H5tget_sign_f, -! H5tset_sign_f, H5tget_ebias_f,H5tset_ebias_f, H5tget_norm_f, -! H5tset_norm_f, H5tget_inpad_f, H5tset_inpad_f, H5tget_cset_f, -! H5tset_cset_f, H5tget_strpad_f, H5tset_strpad_f - - IMPLICIT NONE - INTEGER, INTENT(OUT) :: total_error - - INTEGER(HID_T) :: dtype1_id, dtype2_id, dtype3_id, dtype4_id, dtype5_id - ! datatype identifiers - INTEGER(SIZE_T) :: precision ! Datatype precision - INTEGER(SIZE_T) :: setprecision ! Datatype precision - INTEGER(SIZE_T) :: offset ! Datatype offset - INTEGER(SIZE_T) :: setoffset ! Datatype offset - INTEGER :: lsbpad !padding type of the least significant bit - INTEGER :: msbpad !padding type of the most significant bit - INTEGER :: sign !sign type for an integer type - INTEGER(SIZE_T) :: ebias1 !Datatype exponent bias of a floating-point type - INTEGER(SIZE_T) :: ebias2 !Datatype exponent bias of a floating-point type - INTEGER(SIZE_T) :: setebias - INTEGER :: norm !mantissa normalization of a floating-point datatype - INTEGER :: inpad !padding type for unused bits in floating-point datatypes. - INTEGER :: cset !character set type of a string datatype - INTEGER :: strpad !string padding method for a string datatype - INTEGER :: error !error flag - - - ! - ! Create a datatype - ! - CALL h5tcopy_f(H5T_STD_U16BE, dtype1_id, error) - CALL check("h5tcopy_f",error,total_error) - ! - !datatype type_id should be modifiable after h5tcopy_f - ! - setprecision = 12 - CALL h5tset_precision_f(dtype1_id, setprecision, error) - CALL check("h5set_precision_f",error,total_error) - CALL h5tget_precision_f(dtype1_id,precision, error) - CALL check("h5get_precision_f",error,total_error) - if(precision .ne. 12) then - write (*,*) "got precision is not correct" - total_error = total_error + 1 - end if - - CALL h5tcopy_f(H5T_STD_I32LE, dtype2_id, error) - CALL check("h5tcopy_f",error,total_error) - setprecision = 12 - CALL h5tset_precision_f(dtype2_id, setprecision, error) - CALL check("h5set_precision_f",error,total_error) - - setoffset = 2 - CALL h5tset_offset_f(dtype1_id, setoffset, error) - CALL check("h5set_offset_f",error,total_error) - setoffset = 10 - CALL h5tset_offset_f(dtype2_id, setoffset, error) - CALL check("h5set_offset_f",error,total_error) - CALL h5tget_offset_f(dtype2_id,offset, error) - CALL check("h5get_offset_f",error,total_error) - if(offset .ne. 10) then - write (*,*) "got offset is not correct" - total_error = total_error + 1 - end if - - CALL h5tset_pad_f(dtype2_id,H5T_PAD_ONE_F, H5T_PAD_ONE_F, error) - CALL check("h5set_pad_f",error,total_error) - CALL h5tget_pad_f(dtype2_id,lsbpad,msbpad, error) - CALL check("h5get_pad_f",error,total_error) - if((lsbpad .ne. H5T_PAD_ONE_F) .and. (msbpad .ne. H5T_PAD_ONE_F)) then - write (*,*) "got pad is not correct" - total_error = total_error + 1 - end if - -! CALL h5tset_sign_f(dtype2_id,H5T_SGN_2_F, error) -! CALL check("h5set_sign_f",error,total_error) -! CALL h5tget_sign_f(dtype2_id,sign, error) - CALL h5tget_sign_f(H5T_NATIVE_INTEGER, sign, error) - CALL check("h5tget_sign_f",error,total_error) - if(sign .ne. H5T_SGN_2_F ) then - write (*,*) "got sign is not correct" - total_error = total_error + 1 - end if - - CALL h5tcopy_f(H5T_IEEE_F64BE, dtype3_id, error) - CALL check("h5tcopy_f",error,total_error) - CALL h5tcopy_f(H5T_IEEE_F32LE, dtype4_id, error) - CALL check("h5tcopy_f",error,total_error) - - setebias = 257 - CALL h5tset_ebias_f(dtype3_id, setebias, error) - CALL check("h5tset_ebias_f",error,total_error) - setebias = 1 - CALL h5tset_ebias_f(dtype4_id, setebias, error) - CALL check("h5tset_ebias_f",error,total_error) - CALL h5tget_ebias_f(dtype3_id, ebias1, error) - CALL check("h5tget_ebias_f",error,total_error) - if(ebias1 .ne. 257 ) then - write (*,*) "got ebias is not correct" - total_error = total_error + 1 - end if - CALL h5tget_ebias_f(dtype4_id, ebias2, error) - CALL check("h5tget_ebias_f",error,total_error) - if(ebias2 .ne. 1 ) then - write (*,*) "got ebias is not correct" - total_error = total_error + 1 - end if - - !attention: - !It seems that I can't use H5T_NORM_IMPLIED_F to set the norm value - !because I got error for the get_norm function -! CALL h5tset_norm_f(dtype3_id,H5T_NORM_IMPLIED_F , error) -! CALL check("h5tset_norm_f",error,total_error) -! CALL h5tget_norm_f(dtype3_id, norm, error) -! CALL check("h5tget_norm_f",error,total_error) -! if(norm .ne. H5T_NORM_IMPLIED_F ) then -! write (*,*) "got norm is not correct" -! total_error = total_error + 1 -! end if - CALL h5tset_norm_f(dtype3_id, H5T_NORM_MSBSET_F , error) - CALL check("h5tset_norm_f",error,total_error) - CALL h5tget_norm_f(dtype3_id, norm, error) - CALL check("h5tget_norm_f",error,total_error) - if(norm .ne. H5T_NORM_MSBSET_F ) then - write (*,*) "got norm is not correct" - total_error = total_error + 1 - end if - - CALL h5tset_norm_f(dtype3_id, H5T_NORM_NONE_F , error) - CALL check("h5tset_norm_f",error,total_error) - CALL h5tget_norm_f(dtype3_id, norm, error) - CALL check("h5tget_norm_f",error,total_error) - if(norm .ne. H5T_NORM_NONE_F ) then - write (*,*) "got norm is not correct" - total_error = total_error + 1 - end if - - CALL h5tset_inpad_f(dtype3_id, H5T_PAD_ZERO_F , error) - CALL check("h5tset_inpad_f",error,total_error) - CALL h5tget_inpad_f(dtype3_id, inpad , error) - CALL check("h5tget_inpad_f",error,total_error) - if(inpad .ne. H5T_PAD_ZERO_F ) then - write (*,*) "got inpad is not correct" - total_error = total_error + 1 - end if - - CALL h5tset_inpad_f(dtype3_id,H5T_PAD_ONE_F , error) - CALL check("h5tset_inpad_f",error,total_error) - CALL h5tget_inpad_f(dtype3_id, inpad , error) - CALL check("h5tget_inpad_f",error,total_error) - if(inpad .ne. H5T_PAD_ONE_F ) then - write (*,*) "got inpad is not correct" - total_error = total_error + 1 - end if - - CALL h5tset_inpad_f(dtype3_id,H5T_PAD_BACKGROUND_F , error) - CALL check("h5tset_inpad_f",error,total_error) - CALL h5tget_inpad_f(dtype3_id, inpad , error) - CALL check("h5tget_inpad_f",error,total_error) - if(inpad .ne. H5T_PAD_BACKGROUND_F ) then - write (*,*) "got inpad is not correct" - total_error = total_error + 1 - end if - -! we should not apply h5tset_cset_f to non_character data typemake - -! CALL h5tset_cset_f(dtype4_id, H5T_CSET_ASCII_F, error) -! CALL check("h5tset_cset_f",error,total_error) -! CALL h5tget_cset_f(dtype4_id, cset, error) -! CALL check("h5tget_cset_f",error,total_error) -! if(cset .ne. H5T_CSET_ASCII_F ) then -! write (*,*) "got cset is not correct" -! total_error = total_error + 1 -! end if - - CALL h5tcopy_f(H5T_NATIVE_CHARACTER, dtype5_id, error) - CALL check("h5tcopy_f",error,total_error) - CALL h5tset_cset_f(dtype5_id, H5T_CSET_ASCII_F, error) - CALL check("h5tset_cset_f",error,total_error) - CALL h5tget_cset_f(dtype5_id, cset, error) - CALL check("h5tget_cset_f",error,total_error) - if(cset .ne. H5T_CSET_ASCII_F ) then - write (*,*) "got cset is not correct" - total_error = total_error + 1 - end if - CALL h5tset_strpad_f(dtype5_id, H5T_STR_NULLPAD_F, error) - CALL check("h5tset_strpad_f",error,total_error) - CALL h5tget_strpad_f(dtype5_id, strpad, error) - CALL check("h5tget_strpad_f",error,total_error) - if(strpad .ne. H5T_STR_NULLPAD_F ) then - write (*,*) "got strpad is not correct" - total_error = total_error + 1 - end if - - CALL h5tset_strpad_f(dtype5_id, H5T_STR_SPACEPAD_F, error) - CALL check("h5tset_strpad_f",error,total_error) - CALL h5tget_strpad_f(dtype5_id, strpad, error) - CALL check("h5tget_strpad_f",error,total_error) - if(strpad .ne. H5T_STR_SPACEPAD_F ) then - write (*,*) "got strpad is not correct" - total_error = total_error + 1 - end if - - CALL h5tclose_f(dtype1_id, error) - CALL check("h5tclose_f", error, total_error) - CALL h5tclose_f(dtype2_id, error) - CALL check("h5tclose_f", error, total_error) - CALL h5tclose_f(dtype3_id, error) - CALL check("h5tclose_f", error, total_error) - CALL h5tclose_f(dtype4_id, error) - CALL check("h5tclose_f", error, total_error) - CALL h5tclose_f(dtype5_id, error) - CALL check("h5tclose_f", error, total_error) - - - RETURN - END SUBROUTINE basic_data_type_test - - SUBROUTINE enumtest(cleanup, total_error) - - USE HDF5 - USE TH5_MISC - IMPLICIT NONE - - LOGICAL, INTENT(IN) :: cleanup - INTEGER, INTENT(OUT) :: total_error - CHARACTER(LEN=4), PARAMETER :: filename="enum" - CHARACTER(LEN=80) :: fix_filename - CHARACTER(LEN=8), PARAMETER :: dsetname="enumdset" - CHARACTER(LEN=4) :: true ="TRUE" - CHARACTER(LEN=5) :: false="FALSE" - CHARACTER(LEN=5) :: mem_name - - INTEGER(HID_T) :: file_id - INTEGER(HID_T) :: dset_id - INTEGER(HID_T) :: dspace_id - INTEGER(HID_T) :: dtype_id, dtype, native_type - INTEGER :: error - INTEGER :: value - INTEGER(HSIZE_T), DIMENSION(1) :: dsize - INTEGER(SIZE_T) :: buf_size - INTEGER, DIMENSION(2) :: data - INTEGER(HSIZE_T), DIMENSION(7) :: dims - INTEGER :: order1, order2 -! INTEGER(SIZE_T) :: type_size1, type_size2 - INTEGER :: class - - dims(1) = 2 - dsize(1) = 2 - data(1) = 1 - data(2) = 0 - ! - ! Create a new file using default properties. - ! - CALL h5_fixname_f(filename, fix_filename, H5P_DEFAULT_F, error) - IF (error .NE. 0) THEN - WRITE(*,*) "Cannot modify filename" - STOP - ENDIF - CALL h5fcreate_f(fix_filename,H5F_ACC_TRUNC_F,file_id,error) - CALL check("h5fcreate_f", error, total_error) - ! - ! Create enumeration datatype with tow values - ! - CALL h5tenum_create_f(H5T_NATIVE_INTEGER,dtype_id,error) - CALL check("h5tenum_create_f", error, total_error) - CALL h5tenum_insert_f(dtype_id,true,DATA(1),error) - CALL check("h5tenum_insert_f", error, total_error) - CALL h5tenum_insert_f(dtype_id,false,DATA(2),error) - CALL check("h5tenum_insert_f", error, total_error) - ! - ! Create write and close a dataset with enum datatype - ! - CALL h5screate_simple_f(1,dsize,dspace_id,error) - CALL check("h5screate_simple_f", error, total_error) - CALL h5dcreate_f(file_id,dsetname,dtype_id,dspace_id,dset_id,error) - CALL check("h5dcreate_f", error, total_error) - CALL h5dwrite_f(dset_id,dtype_id,DATA,dims,error) - CALL check("h5dwrite_f", error, total_error) - - CALL H5Dget_type_f(dset_id, dtype, error) - CALL check("H5Dget_type_f", error, total_error) - - CALL H5Tget_native_type_f(dtype, H5T_DIR_ASCEND_F, native_type, error) - CALL check("H5Tget_native_type_f",error, total_error) - - ! Verify the datatype retrieved and converted - CALL H5Tget_order_f(native_type, order1, error) - CALL check("H5Tget_order_f",error, total_error) - CALL H5Tget_order_f(H5T_NATIVE_INTEGER, order2, error) - CALL check("H5Tget_order_f",error, total_error) - CALL verify("H5Tget_native_type_f",order1, order2, total_error) - - ! this test depends on whether -i8 was specified - -!!$ CALL H5Tget_size_f(native_type, type_size1, error) -!!$ CALL check("H5Tget_size_f",error, total_error) -!!$ CALL H5Tget_size_f(H5T_STD_I32BE, type_size2, error) -!!$ CALL check("H5Tget_size_f",error, total_error) -!!$ CALL verify("H5Tget_native_type_f", INT(type_size1), INT(type_size2), total_error) - - CALL H5Tget_class_f(native_type, class, error) - CALL check("H5Tget_class_f",error, total_error) - CALL verify("H5Tget_native_type_f", INT(class), INT(H5T_ENUM_F), total_error) - - CALL h5dclose_f(dset_id,error) - CALL check("h5dclose_f", error, total_error) - CALL h5sclose_f(dspace_id,error) - CALL check("h5sclose_f", error, total_error) - ! - ! Get value of "TRUE" - ! - CALL h5tenum_valueof_f(dtype_id, "TRUE", value, error) - CALL check("h5tenum_valueof_f", error, total_error) - IF (value .NE. 1) THEN - WRITE(*,*) " Value of TRUE is not 1, error" - total_error = total_error + 1 - ENDIF - ! - ! Get name of 0 - ! - value = 0 - buf_size = 5 - CALL h5tenum_nameof_f(dtype_id, value, buf_size, mem_name, error) - CALL check("h5tenum_nameof_f", error, total_error) - IF (mem_name .NE. "FALSE") THEN - WRITE(*,*) " Wrong name for 0 value" - total_error = total_error + 1 - ENDIF - - CALL h5tclose_f(dtype_id,error) - CALL check("h5tclose_f", error, total_error) - CALL h5fclose_f(file_id,error) - CALL check("h5fclose_f", error, total_error) - - IF(cleanup) CALL h5_cleanup_f(filename, H5P_DEFAULT_F, error) - CALL check("h5_cleanup_f", error, total_error) - - RETURN - END SUBROUTINE enumtest - -!------------------------------------------------------------------------- -! * Function: test_derived_flt -! * -! * Purpose: Tests user-define and query functions of floating-point types. -! * test h5tget/set_fields_f. -! * -! * Return: Success: 0 -! * -! * Failure: number of errors -! * -! * Fortran Programmer: M.S. Breitenfeld -! * September 9, 2008 -! * -! * Modifications: -! * -! *------------------------------------------------------------------------- -! - -SUBROUTINE test_derived_flt(cleanup, total_error) - - - IMPLICIT NONE - LOGICAL, INTENT(IN) :: cleanup - INTEGER, INTENT(OUT) :: total_error - INTEGER(hid_t) :: file=-1, tid1=-1, tid2=-1 - INTEGER(hid_t) :: dxpl_id=-1 - INTEGER(size_t) :: spos, epos, esize, mpos, msize - - CHARACTER(LEN=15), PARAMETER :: filename="h5t_derived_flt" - CHARACTER(LEN=80) :: fix_filename - - INTEGER(SIZE_T) :: precision1, offset1, ebias1, size1 - INTEGER(SIZE_T) :: precision2, offset2, ebias2, size2 - - INTEGER :: error - - ! Create File - CALL h5_fixname_f(filename, fix_filename, H5P_DEFAULT_F, error) - IF (error .NE. 0) THEN - WRITE(*,*) "Cannot modify filename" - STOP - ENDIF - - CALL h5fcreate_f(fix_filename,H5F_ACC_TRUNC_F,file,error) - CALL check("h5fcreate_f", error, total_error) - - CALL h5pcreate_f(H5P_DATASET_XFER_F, dxpl_id, error) - CALL check("h5pcreate_f", error, total_error) - - CALL h5tcopy_f(H5T_IEEE_F64LE, tid1, error) - CALL check("h5tcopy_f",error,total_error) - - CALL h5tcopy_f(H5T_IEEE_F32LE, tid2, error) - CALL check("h5tcopy_f",error,total_error) - - !------------------------------------------------------------------------ - ! * 1st floating-point type - ! * size=7 byte, precision=42 bits, offset=3 bits, mantissa size=31 bits, - ! * mantissa position=3, exponent size=10 bits, exponent position=34, - ! * exponent bias=511. It can be illustrated in little-endian order as - ! * - ! * 6 5 4 3 2 1 0 - ! * ???????? ???SEEEE EEEEEEMM MMMMMMMM MMMMMMMM MMMMMMMM MMMMM??? - ! * - ! * To create a new floating-point type, the following properties must be - ! * set in the order of - ! * set fields -> set offset -> set precision -> set size. - ! * All these properties must be set before the type can function. Other - ! * properties can be set anytime. Derived type size cannot be expanded - ! * bigger than original size but can be decreased. There should be no - ! * holes among the significant bits. Exponent bias usually is set - ! * 2^(n-1)-1, where n is the exponent size. - ! *----------------------------------------------------------------------- - - CALL H5Tset_fields_f(tid1, INT(44,size_t), INT(34,size_t), INT(10,size_t), & - INT(3,size_t), INT(31,size_t), error) - CALL check("H5Tset_fields_f",error,total_error) - - CALL H5Tset_offset_f(tid1, INT(3,size_t), error) - CALL check("H5Tset_offset_f",error,total_error) - - CALL H5Tset_precision_f(tid1, INT(42,size_t), error) - CALL check("H5Tset_precision_f",error,total_error) - - CALL H5Tset_size_f(tid1, INT(7,size_t), error) - CALL check("H5Tset_size_f",error,total_error) - - CALL H5Tset_ebias_f(tid1, INT(511,size_t), error) - CALL check("H5Tset_ebias_f",error,total_error) - - CALL H5Tset_pad_f(tid1, H5T_PAD_ZERO_F, H5T_PAD_ZERO_F, error) - CALL check("H5Tset_pad_f",error,total_error) - - CALL h5tcommit_f(file, "new float type 1", tid1, error) - CALL check("h5tcommit_f", error, total_error) - - CALL h5tclose_f(tid1, error) - CALL check("h5tclose_f", error, total_error) - - CALL H5Topen_f(file, "new float type 1", tid1, error) - CALL check("H5Topen_f", error, total_error) - - CALL H5Tget_fields_f(tid1, spos, epos, esize, mpos, msize, error) - CALL check("H5Tget_fields_f", error, total_error) - - IF(spos.NE.44 .OR. epos.NE.34 .OR. esize.NE.10 .OR. mpos.NE.3 .OR. msize.NE.31)THEN - CALL verify("H5Tget_fields_f", -1, 0, total_error) - ENDIF - - CALL H5Tget_precision_f(tid1, precision1, error) - CALL check("H5Tget_precision_f", error, total_error) - CALL verify("H5Tget_precision_f", INT(precision1), 42, total_error) - - CALL H5Tget_offset_f(tid1, offset1, error) - CALL check("H5Tget_offset_f", error, total_error) - CALL verify("H5Tget_offset_f", INT(offset1), 3, total_error) - - CALL H5Tget_size_f(tid1, size1, error) - CALL check("H5Tget_size_f", error, total_error) - CALL verify("H5Tget_size_f", INT(size1), 7, total_error) - - CALL H5Tget_ebias_f(tid1, ebias1, error) - CALL check("H5Tget_ebias_f", error, total_error) - CALL verify("H5Tget_ebias_f", INT(ebias1), 511, total_error) - - !-------------------------------------------------------------------------- - ! * 2nd floating-point type - ! * size=3 byte, precision=24 bits, offset=0 bits, mantissa size=16 bits, - ! * mantissa position=0, exponent size=7 bits, exponent position=16, exponent - ! * bias=63. It can be illustrated in little-endian order as - ! * - ! * 2 1 0 - ! * SEEEEEEE MMMMMMMM MMMMMMMM - ! *-------------------------------------------------------------------------- - - CALL H5Tset_fields_f(tid2, INT(23,size_t), INT(16,size_t), INT(7,size_t), & - INT(0,size_t), INT(16,size_t), error) - CALL check("H5Tset_fields_f",error,total_error) - - CALL H5Tset_offset_f(tid2, INT(0,size_t), error) - CALL check("H5Tset_offset_f",error,total_error) - - CALL H5Tset_precision_f(tid2, INT(24,size_t), error) - CALL check("H5Tset_precision_f",error,total_error) - - CALL H5Tset_size_f(tid2, INT(3,size_t), error) - CALL check("H5Tset_size_f",error,total_error) - - CALL H5Tset_ebias_f(tid2, INT(63,size_t), error) - CALL check("H5Tset_ebias_f",error,total_error) - - CALL H5Tset_pad_f(tid2, H5T_PAD_ZERO_F, H5T_PAD_ZERO_F, error) - CALL check("H5Tset_pad_f",error,total_error) - - CALL h5tcommit_f(file, "new float type 2", tid2, error) - CALL check("h5tcommit_f", error, total_error) - - CALL h5tclose_f(tid2, error) - CALL check("h5tclose_f", error, total_error) - - CALL H5Topen_f(file, "new float type 2", tid2, error) - CALL check("H5Topen_f", error, total_error) - - CALL H5Tget_fields_f(tid2, spos, epos, esize, mpos, msize, error) - CALL check("H5Tget_fields_f", error, total_error) - - IF(spos.NE.23 .OR. epos.NE.16 .OR. esize.NE.7 .OR. mpos.NE.0 .OR. msize.NE.16)THEN - CALL verify("H5Tget_fields_f", -1, 0, total_error) - ENDIF - - CALL H5Tget_precision_f(tid2, precision2, error) - CALL check("H5Tget_precision_f", error, total_error) - CALL verify("H5Tget_precision_f", INT(precision2), 24, total_error) - - CALL H5Tget_offset_f(tid2, offset2, error) - CALL check("H5Tget_offset_f", error, total_error) - CALL verify("H5Tget_offset_f", INT(offset2), 0, total_error) - - CALL H5Tget_size_f(tid2, size2, error) - CALL check("H5Tget_size_f", error, total_error) - CALL verify("H5Tget_size_f", INT(size2), 3, total_error) - - CALL H5Tget_ebias_f(tid2, ebias2, error) - CALL check("H5Tget_ebias_f", error, total_error) - CALL verify("H5Tget_ebias_f", INT(ebias2), 63, total_error) - - CALL h5tclose_f(tid1, error) - CALL check("h5tclose_f", error, total_error) - - CALL h5tclose_f(tid2, error) - CALL check("h5tclose_f", error, total_error) - - CALL H5Pclose_f(dxpl_id, error) - CALL check("H5Pclose_f", error, total_error) - - CALL h5fclose_f(file,error) - CALL check("h5fclose_f", error, total_error) - - IF(cleanup) CALL h5_cleanup_f(filename, H5P_DEFAULT_F, error) - CALL check("h5_cleanup_f", error, total_error) - -END SUBROUTINE test_derived_flt - -END MODULE TH5T diff --git a/fortran/test/tH5VL.F90 b/fortran/test/tH5VL.F90 new file mode 100644 index 0000000..834fbde --- /dev/null +++ b/fortran/test/tH5VL.F90 @@ -0,0 +1,512 @@ +!****h* root/fortran/test/tH5VL.f90 +! +! NAME +! tH5VL.f90 +! +! FUNCTION +! Basic testing of Fortran Variable_length datatypes 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. * +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! +! CONTAINS SUBROUTINES +! vl_test_integer, vl_test_real, vl_test_string +! +!***** + +MODULE TH5VL + USE HDF5 ! This module contains all necessary modules + USE TH5_MISC + USE TH5_MISC_GEN + +CONTAINS + + SUBROUTINE vl_test_integer(cleanup, total_error) + + IMPLICIT NONE + LOGICAL, INTENT(IN) :: cleanup + INTEGER, INTENT(OUT) :: total_error + + CHARACTER(LEN=7), PARAMETER :: filename = "VLtypes" ! File name + CHARACTER(LEN=80) :: fix_filename + CHARACTER(LEN=5), PARAMETER :: dsetname = "VLint" ! Dataset name + + INTEGER(HID_T) :: file_id ! File identifier + INTEGER(HID_T) :: dset_id ! Dataset identifier + INTEGER(HID_T) :: dspace_id ! Dataspace identifier + INTEGER(HID_T) :: vltype_id ! Datatype identifier + + + INTEGER(HSIZE_T), DIMENSION(1) :: dims = (/6/) ! Dataset dimensions + INTEGER(SIZE_T), DIMENSION(6) :: len ! Elements lengths + INTEGER(SIZE_T), DIMENSION(6) :: len_out + INTEGER :: rank = 1 ! Dataset rank + + INTEGER, DIMENSION(5,6) :: vl_int_data ! Data buffers + INTEGER, DIMENSION(5,6) :: vl_int_data_out ! Data buffers + INTEGER :: error ! Error flag + + INTEGER :: i, j !general purpose integers + INTEGER(HSIZE_T) :: ih, jh !general purpose integers + INTEGER(HSIZE_T), DIMENSION(2) :: data_dims = (/5,6/) + INTEGER(SIZE_T) max_len + + ! + ! Initialize the vl_int_data array. + ! + do i = 1, 6 + do j = 1, 5 + vl_int_data(j,i) = -100 + end do + end do + + do i = 2, 6 + do j = 1, i-1 + vl_int_data(j,i) = i-1 + end do + end do + + do i = 1,6 + len(i) = i-1 + end do + + + ! + ! Create a new file using default properties. + ! + CALL h5_fixname_f(filename, fix_filename, H5P_DEFAULT_F, error) + if (error .ne. 0) then + write(*,*) "Cannot modify filename" + stop + endif + CALL h5fcreate_f(fix_filename, H5F_ACC_TRUNC_F, file_id, error) + CALL check("h5fcreate_f", error, total_error) + + + ! + ! Create the dataspace. + ! + CALL h5screate_simple_f(rank, dims, dspace_id, error) + CALL check("h5screate_simple_f", error, total_error) + + + ! + ! Create the dataset with default properties. + ! + CALL h5tvlen_create_f(H5T_NATIVE_INTEGER, vltype_id, error) + CALL check("h5dvlen_create_f", error, total_error) + + CALL h5dcreate_f(file_id, dsetname, vltype_id, dspace_id, & + dset_id, error) + CALL check("h5dcreate_f", error, total_error) + + ! + ! Write the dataset. + ! + CALL h5dwrite_vl_f(dset_id, vltype_id, vl_int_data, data_dims, len, error) + CALL check("h5dwrite_int_f", error, total_error) + + + + ! + ! End access to the dataset and release resources used by it. + ! + CALL h5dclose_f(dset_id, error) + CALL check("h5dclose_f", error, total_error) + + ! + ! Close the file. + ! + CALL h5fclose_f(file_id, error) + CALL check("h5fclose_f", error, total_error) + + ! + ! Open the existing file. + ! + CALL h5fopen_f (fix_filename, H5F_ACC_RDWR_F, file_id, error) + CALL check("h5fopen_f", error, total_error) + + ! + ! Open the existing dataset. + ! + CALL h5dopen_f(file_id, dsetname, dset_id, error) + CALL check("h5dopen_f", error, total_error) + + CALL h5dvlen_get_max_len_f(dset_id, vltype_id, dspace_id, max_len, error) + CALL check("h5dvlen_get_max_len_f", error, total_error) + if(max_len .ne. data_dims(1)) then + total_error = total_error + 1 + write(*,*) "Wrong number of elemets returned by h5dvlen_get_max_len_f" + endif + ! + ! Read the dataset. + ! + CALL h5dread_vl_f(dset_id, vltype_id, vl_int_data_out, data_dims, len_out, & + error, mem_space_id = dspace_id, file_space_id = dspace_id) + CALL check("h5dread_int_f", error, total_error) + do ih = 1, data_dims(2) + do jh = 1, len_out(ih) + if(vl_int_data(jh,ih) .ne. vl_int_data_out(jh,ih)) then + total_error = total_error + 1 + write(*,*) "h5dread_vl_f returned incorrect data" + endif + enddo + if (len(ih) .ne. len_out(ih)) then + total_error = total_error + 1 + write(*,*) "h5dread_vl_f returned incorrect data" + endif + enddo + + ! + CALL h5dclose_f(dset_id, error) + CALL check("h5dclose_f", error, total_error) + + CALL h5tclose_f(vltype_id, error) + CALL check("h5tclose_f", error, total_error) + + ! + ! Terminate access to the data space. + ! + CALL h5sclose_f(dspace_id, error) + CALL check("h5sclose_f", error, total_error) + + ! + ! Close the file. + ! + CALL h5fclose_f(file_id, error) + CALL check("h5fclose_f", error, total_error) + if(cleanup) CALL h5_cleanup_f(filename, H5P_DEFAULT_F, error) + CALL check("h5_cleanup_f", error, total_error) + + RETURN + END SUBROUTINE vl_test_integer + + SUBROUTINE vl_test_real(cleanup, total_error) + + IMPLICIT NONE + LOGICAL, INTENT(IN) :: cleanup + INTEGER, INTENT(OUT) :: total_error + + CHARACTER(LEN=8), PARAMETER :: filename = "VLtypesR" ! File name + CHARACTER(LEN=80) :: fix_filename + CHARACTER(LEN=6), PARAMETER :: dsetname = "VLreal" ! Dataset name + + INTEGER(HID_T) :: file_id ! File identifier + INTEGER(HID_T) :: dset_id ! Dataset identifier + INTEGER(HID_T) :: dspace_id ! Dataspace identifier + INTEGER(HID_T) :: vltype_id ! Datatype identifier + + + INTEGER(HSIZE_T), DIMENSION(1) :: dims = (/6/) ! Dataset dimensions + INTEGER(SIZE_T), DIMENSION(6) :: len ! Elements lengths + INTEGER(SIZE_T), DIMENSION(6) :: len_out + INTEGER :: rank = 1 ! Dataset rank + + REAL, DIMENSION(5,6) :: vl_real_data ! Data buffers + REAL, DIMENSION(5,6) :: vl_real_data_out ! Data buffers + INTEGER :: error ! Error flag + + INTEGER :: i, j !general purpose integers + INTEGER(HSIZE_T) :: ih, jh !general purpose integers + INTEGER(HSIZE_T), DIMENSION(2) :: data_dims = (/5,6/) + INTEGER(SIZE_T) max_len + INTEGER(HID_T) :: vl_type_id + LOGICAL :: vl_flag + + ! + ! Initialize the vl_int_data array. + ! + do i = 1, 6 + do j = 1, 5 + vl_real_data(j,i) = -100. + end do + end do + + do i = 2, 6 + do j = 1, i-1 + vl_real_data(j,i) = i-1 + end do + end do + + do i = 1,6 + len(i) = i-1 + end do + + + ! + ! Create a new file using default properties. + ! + CALL h5_fixname_f(filename, fix_filename, H5P_DEFAULT_F, error) + if (error .ne. 0) then + write(*,*) "Cannot modify filename" + stop + endif + CALL h5fcreate_f(fix_filename, H5F_ACC_TRUNC_F, file_id, error) + CALL check("h5fcreate_f", error, total_error) + + + ! + ! Create the dataspace. + ! + CALL h5screate_simple_f(rank, dims, dspace_id, error) + CALL check("h5screate_simple_f", error, total_error) + + + ! + ! Create the dataset with default properties. + ! + CALL h5tvlen_create_f(H5T_NATIVE_REAL, vltype_id, error) + CALL check("h5dvlen_create_f", error, total_error) + + CALL h5dcreate_f(file_id, dsetname, vltype_id, dspace_id, & + dset_id, error) + CALL check("h5dcreate_f", error, total_error) + CALL h5dget_type_f(dset_id, vl_type_id, error) + CALL check("h5dget_type_f", error, total_error) + CALL h5tis_variable_str_f( vl_type_id, vl_flag, error) + CALL check("h5tis_variable_str_f", error, total_error) + if( vl_flag ) then + write(*,*) "type is wrong" + total_error = total_error + 1 + endif + + + ! + ! Write the dataset. + ! + CALL h5dwrite_vl_f(dset_id, vltype_id, vl_real_data, data_dims, len, error) + CALL check("h5dwrite_vl_real_f", error, total_error) + + + ! + ! End access to the dataset and release resources used by it. + ! + CALL h5dclose_f(dset_id, error) + CALL check("h5dclose_f", error, total_error) + + ! + ! Close the file. + ! + CALL h5fclose_f(file_id, error) + CALL check("h5fclose_f", error, total_error) + + ! + ! Open the existing file. + ! + CALL h5fopen_f (fix_filename, H5F_ACC_RDWR_F, file_id, error) + CALL check("h5fopen_f", error, total_error) + + ! + ! Open the existing dataset. + ! + CALL h5dopen_f(file_id, dsetname, dset_id, error) + CALL check("h5dopen_f", error, total_error) + + CALL h5dvlen_get_max_len_f(dset_id, vltype_id, dspace_id, max_len, error) + CALL check("h5dvlen_get_max_len_f", error, total_error) + if(max_len .ne. data_dims(1)) then + total_error = total_error + 1 + write(*,*) "Wrong number of elemets returned by h5dvlen_get_max_len_f" + endif + ! + ! Read the dataset. + ! + CALL h5dread_vl_f(dset_id, vltype_id, vl_real_data_out, data_dims, len_out, & + error, mem_space_id = dspace_id, file_space_id = dspace_id) + CALL check("h5dread_real_f", error, total_error) + DO ih = 1, data_dims(2) + DO jh = 1, len_out(ih) + CALL VERIFY("h5dread_vl_f returned incorrect data",vl_real_data(jh,ih),vl_real_data_out(jh,ih), total_error) + ENDDO + IF (LEN(ih) .NE. len_out(ih)) THEN + total_error = total_error + 1 + WRITE(*,*) "h5dread_vl_f returned incorrect data" + ENDIF + ENDDO + + + ! + CALL h5dclose_f(dset_id, error) + CALL check("h5dclose_f", error, total_error) + + CALL h5tclose_f(vltype_id, error) + CALL check("h5tclose_f", error, total_error) + + ! + ! Terminate access to the data space. + ! + CALL h5sclose_f(dspace_id, error) + CALL check("h5sclose_f", error, total_error) + + ! + ! Close the file. + ! + CALL h5fclose_f(file_id, error) + CALL check("h5fclose_f", error, total_error) + if(cleanup) CALL h5_cleanup_f(filename, H5P_DEFAULT_F, error) + CALL check("h5_cleanup_f", error, total_error) + + RETURN + END SUBROUTINE vl_test_real + + SUBROUTINE vl_test_string(cleanup, total_error) + + IMPLICIT NONE + LOGICAL, INTENT(IN) :: cleanup + INTEGER, INTENT(OUT) :: total_error + + CHARACTER(LEN=8), PARAMETER :: filename = "VLtypesS" ! File name + CHARACTER(LEN=80) :: fix_filename + CHARACTER(LEN=9), PARAMETER :: dsetname = "VLstrings" ! Dataset name + + INTEGER(HID_T) :: file_id ! File identifier + INTEGER(HID_T) :: dset_id ! Dataset identifier + INTEGER(HID_T) :: dspace_id ! Dataspace identifier + + + INTEGER(HSIZE_T), DIMENSION(1) :: dims = (/4/) ! Dataset dimensions + INTEGER(SIZE_T), DIMENSION(4) :: str_len ! Elements lengths + INTEGER(SIZE_T), DIMENSION(4) :: str_len_out + INTEGER :: rank = 1 ! Dataset rank + + CHARACTER(LEN=10), DIMENSION(4) :: string_data ! Array of strings + CHARACTER(LEN=10), DIMENSION(4) :: string_data_out ! Data buffers + INTEGER :: error ! Error flag + + INTEGER(HSIZE_T) :: ih !general purpose integers + INTEGER(HSIZE_T), DIMENSION(2) :: data_dims = (/10,4/) + INTEGER(HID_T) :: vl_type_id + LOGICAL :: vl_flag + + ! + ! Initialize the string_data array. + ! + string_data(1) = 'This is ' + str_len(1) = 8 + string_data(2) = 'a fortran ' + str_len(2) = 10 + string_data(3) = 'strings ' + str_len(3) = 8 + string_data(4) = 'test. ' + str_len(4) = 5 + + + ! + ! Create a new file using default properties. + ! + CALL h5_fixname_f(filename, fix_filename, H5P_DEFAULT_F, error) + if (error .ne. 0) then + write(*,*) "Cannot modify filename" + stop + endif + CALL h5fcreate_f(fix_filename, H5F_ACC_TRUNC_F, file_id, error) + CALL check("h5fcreate_f", error, total_error) + + + ! + ! Create the dataspace. + ! + CALL h5screate_simple_f(rank, dims, dspace_id, error) + CALL check("h5screate_simple_f", error, total_error) + + + ! + ! Create the dataset with default properties. + ! + CALL h5dcreate_f(file_id, dsetname, H5T_STRING, dspace_id, & + dset_id, error) + CALL check("h5dcreate_f", error, total_error) + ! + ! Check that dataset has a string datatype + ! + CALL h5dget_type_f(dset_id, vl_type_id, error) + CALL check("h5dget_type_f", error, total_error) + CALL h5tis_variable_str_f( vl_type_id, vl_flag, error) + CALL check("h5tis_variable_str_f", error, total_error) + if( .NOT. vl_flag ) then + write(*,*) "type is wrong" + total_error = total_error + 1 + endif + + ! + ! Write the dataset. + ! + CALL h5dwrite_vl_f(dset_id, H5T_STRING, string_data, data_dims, str_len, error) + CALL check("h5dwrite_string_f", error, total_error) + + + ! + ! End access to the dataset and release resources used by it. + ! + CALL h5dclose_f(dset_id, error) + CALL check("h5dclose_f", error, total_error) + + ! + ! Close the file. + ! + CALL h5fclose_f(file_id, error) + CALL check("h5fclose_f", error, total_error) + + ! + ! Open the existing file. + ! + CALL h5fopen_f (fix_filename, H5F_ACC_RDWR_F, file_id, error) + CALL check("h5fopen_f", error, total_error) + + ! + ! Open the existing dataset. + ! + CALL h5dopen_f(file_id, dsetname, dset_id, error) + CALL check("h5dopen_f", error, total_error) + ! + ! Read the dataset. + ! + CALL h5dread_vl_f(dset_id, H5T_STRING, string_data_out, data_dims, & + str_len_out, error) + CALL check("h5dread_string_f", error, total_error) + do 100 ih = 1, data_dims(2) + if(str_len(ih) .ne. str_len_out(ih)) then + total_error=total_error + 1 + write(*,*) 'Returned string length is incorrect' + goto 100 + endif + if(string_data(1)(1:str_len(ih)) .ne. string_data_out(1)(1:str_len(ih))) then + write(*,*) ' Returned string is wrong' + total_error = total_error + 1 + endif +100 continue + + ! + CALL h5dclose_f(dset_id, error) + CALL check("h5dclose_f", error, total_error) + + ! + ! Terminate access to the data space. + ! + CALL h5sclose_f(dspace_id, error) + CALL check("h5sclose_f", error, total_error) + + ! + ! Close the file. + ! + CALL h5fclose_f(file_id, error) + CALL check("h5fclose_f", error, total_error) + if(cleanup) CALL h5_cleanup_f(filename, H5P_DEFAULT_F, error) + CALL check("h5_cleanup_f", error, total_error) + + RETURN + END SUBROUTINE vl_test_string +END MODULE TH5VL diff --git a/fortran/test/tH5VL.f90 b/fortran/test/tH5VL.f90 deleted file mode 100644 index 834fbde..0000000 --- a/fortran/test/tH5VL.f90 +++ /dev/null @@ -1,512 +0,0 @@ -!****h* root/fortran/test/tH5VL.f90 -! -! NAME -! tH5VL.f90 -! -! FUNCTION -! Basic testing of Fortran Variable_length datatypes 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. * -! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -! -! CONTAINS SUBROUTINES -! vl_test_integer, vl_test_real, vl_test_string -! -!***** - -MODULE TH5VL - USE HDF5 ! This module contains all necessary modules - USE TH5_MISC - USE TH5_MISC_GEN - -CONTAINS - - SUBROUTINE vl_test_integer(cleanup, total_error) - - IMPLICIT NONE - LOGICAL, INTENT(IN) :: cleanup - INTEGER, INTENT(OUT) :: total_error - - CHARACTER(LEN=7), PARAMETER :: filename = "VLtypes" ! File name - CHARACTER(LEN=80) :: fix_filename - CHARACTER(LEN=5), PARAMETER :: dsetname = "VLint" ! Dataset name - - INTEGER(HID_T) :: file_id ! File identifier - INTEGER(HID_T) :: dset_id ! Dataset identifier - INTEGER(HID_T) :: dspace_id ! Dataspace identifier - INTEGER(HID_T) :: vltype_id ! Datatype identifier - - - INTEGER(HSIZE_T), DIMENSION(1) :: dims = (/6/) ! Dataset dimensions - INTEGER(SIZE_T), DIMENSION(6) :: len ! Elements lengths - INTEGER(SIZE_T), DIMENSION(6) :: len_out - INTEGER :: rank = 1 ! Dataset rank - - INTEGER, DIMENSION(5,6) :: vl_int_data ! Data buffers - INTEGER, DIMENSION(5,6) :: vl_int_data_out ! Data buffers - INTEGER :: error ! Error flag - - INTEGER :: i, j !general purpose integers - INTEGER(HSIZE_T) :: ih, jh !general purpose integers - INTEGER(HSIZE_T), DIMENSION(2) :: data_dims = (/5,6/) - INTEGER(SIZE_T) max_len - - ! - ! Initialize the vl_int_data array. - ! - do i = 1, 6 - do j = 1, 5 - vl_int_data(j,i) = -100 - end do - end do - - do i = 2, 6 - do j = 1, i-1 - vl_int_data(j,i) = i-1 - end do - end do - - do i = 1,6 - len(i) = i-1 - end do - - - ! - ! Create a new file using default properties. - ! - CALL h5_fixname_f(filename, fix_filename, H5P_DEFAULT_F, error) - if (error .ne. 0) then - write(*,*) "Cannot modify filename" - stop - endif - CALL h5fcreate_f(fix_filename, H5F_ACC_TRUNC_F, file_id, error) - CALL check("h5fcreate_f", error, total_error) - - - ! - ! Create the dataspace. - ! - CALL h5screate_simple_f(rank, dims, dspace_id, error) - CALL check("h5screate_simple_f", error, total_error) - - - ! - ! Create the dataset with default properties. - ! - CALL h5tvlen_create_f(H5T_NATIVE_INTEGER, vltype_id, error) - CALL check("h5dvlen_create_f", error, total_error) - - CALL h5dcreate_f(file_id, dsetname, vltype_id, dspace_id, & - dset_id, error) - CALL check("h5dcreate_f", error, total_error) - - ! - ! Write the dataset. - ! - CALL h5dwrite_vl_f(dset_id, vltype_id, vl_int_data, data_dims, len, error) - CALL check("h5dwrite_int_f", error, total_error) - - - - ! - ! End access to the dataset and release resources used by it. - ! - CALL h5dclose_f(dset_id, error) - CALL check("h5dclose_f", error, total_error) - - ! - ! Close the file. - ! - CALL h5fclose_f(file_id, error) - CALL check("h5fclose_f", error, total_error) - - ! - ! Open the existing file. - ! - CALL h5fopen_f (fix_filename, H5F_ACC_RDWR_F, file_id, error) - CALL check("h5fopen_f", error, total_error) - - ! - ! Open the existing dataset. - ! - CALL h5dopen_f(file_id, dsetname, dset_id, error) - CALL check("h5dopen_f", error, total_error) - - CALL h5dvlen_get_max_len_f(dset_id, vltype_id, dspace_id, max_len, error) - CALL check("h5dvlen_get_max_len_f", error, total_error) - if(max_len .ne. data_dims(1)) then - total_error = total_error + 1 - write(*,*) "Wrong number of elemets returned by h5dvlen_get_max_len_f" - endif - ! - ! Read the dataset. - ! - CALL h5dread_vl_f(dset_id, vltype_id, vl_int_data_out, data_dims, len_out, & - error, mem_space_id = dspace_id, file_space_id = dspace_id) - CALL check("h5dread_int_f", error, total_error) - do ih = 1, data_dims(2) - do jh = 1, len_out(ih) - if(vl_int_data(jh,ih) .ne. vl_int_data_out(jh,ih)) then - total_error = total_error + 1 - write(*,*) "h5dread_vl_f returned incorrect data" - endif - enddo - if (len(ih) .ne. len_out(ih)) then - total_error = total_error + 1 - write(*,*) "h5dread_vl_f returned incorrect data" - endif - enddo - - ! - CALL h5dclose_f(dset_id, error) - CALL check("h5dclose_f", error, total_error) - - CALL h5tclose_f(vltype_id, error) - CALL check("h5tclose_f", error, total_error) - - ! - ! Terminate access to the data space. - ! - CALL h5sclose_f(dspace_id, error) - CALL check("h5sclose_f", error, total_error) - - ! - ! Close the file. - ! - CALL h5fclose_f(file_id, error) - CALL check("h5fclose_f", error, total_error) - if(cleanup) CALL h5_cleanup_f(filename, H5P_DEFAULT_F, error) - CALL check("h5_cleanup_f", error, total_error) - - RETURN - END SUBROUTINE vl_test_integer - - SUBROUTINE vl_test_real(cleanup, total_error) - - IMPLICIT NONE - LOGICAL, INTENT(IN) :: cleanup - INTEGER, INTENT(OUT) :: total_error - - CHARACTER(LEN=8), PARAMETER :: filename = "VLtypesR" ! File name - CHARACTER(LEN=80) :: fix_filename - CHARACTER(LEN=6), PARAMETER :: dsetname = "VLreal" ! Dataset name - - INTEGER(HID_T) :: file_id ! File identifier - INTEGER(HID_T) :: dset_id ! Dataset identifier - INTEGER(HID_T) :: dspace_id ! Dataspace identifier - INTEGER(HID_T) :: vltype_id ! Datatype identifier - - - INTEGER(HSIZE_T), DIMENSION(1) :: dims = (/6/) ! Dataset dimensions - INTEGER(SIZE_T), DIMENSION(6) :: len ! Elements lengths - INTEGER(SIZE_T), DIMENSION(6) :: len_out - INTEGER :: rank = 1 ! Dataset rank - - REAL, DIMENSION(5,6) :: vl_real_data ! Data buffers - REAL, DIMENSION(5,6) :: vl_real_data_out ! Data buffers - INTEGER :: error ! Error flag - - INTEGER :: i, j !general purpose integers - INTEGER(HSIZE_T) :: ih, jh !general purpose integers - INTEGER(HSIZE_T), DIMENSION(2) :: data_dims = (/5,6/) - INTEGER(SIZE_T) max_len - INTEGER(HID_T) :: vl_type_id - LOGICAL :: vl_flag - - ! - ! Initialize the vl_int_data array. - ! - do i = 1, 6 - do j = 1, 5 - vl_real_data(j,i) = -100. - end do - end do - - do i = 2, 6 - do j = 1, i-1 - vl_real_data(j,i) = i-1 - end do - end do - - do i = 1,6 - len(i) = i-1 - end do - - - ! - ! Create a new file using default properties. - ! - CALL h5_fixname_f(filename, fix_filename, H5P_DEFAULT_F, error) - if (error .ne. 0) then - write(*,*) "Cannot modify filename" - stop - endif - CALL h5fcreate_f(fix_filename, H5F_ACC_TRUNC_F, file_id, error) - CALL check("h5fcreate_f", error, total_error) - - - ! - ! Create the dataspace. - ! - CALL h5screate_simple_f(rank, dims, dspace_id, error) - CALL check("h5screate_simple_f", error, total_error) - - - ! - ! Create the dataset with default properties. - ! - CALL h5tvlen_create_f(H5T_NATIVE_REAL, vltype_id, error) - CALL check("h5dvlen_create_f", error, total_error) - - CALL h5dcreate_f(file_id, dsetname, vltype_id, dspace_id, & - dset_id, error) - CALL check("h5dcreate_f", error, total_error) - CALL h5dget_type_f(dset_id, vl_type_id, error) - CALL check("h5dget_type_f", error, total_error) - CALL h5tis_variable_str_f( vl_type_id, vl_flag, error) - CALL check("h5tis_variable_str_f", error, total_error) - if( vl_flag ) then - write(*,*) "type is wrong" - total_error = total_error + 1 - endif - - - ! - ! Write the dataset. - ! - CALL h5dwrite_vl_f(dset_id, vltype_id, vl_real_data, data_dims, len, error) - CALL check("h5dwrite_vl_real_f", error, total_error) - - - ! - ! End access to the dataset and release resources used by it. - ! - CALL h5dclose_f(dset_id, error) - CALL check("h5dclose_f", error, total_error) - - ! - ! Close the file. - ! - CALL h5fclose_f(file_id, error) - CALL check("h5fclose_f", error, total_error) - - ! - ! Open the existing file. - ! - CALL h5fopen_f (fix_filename, H5F_ACC_RDWR_F, file_id, error) - CALL check("h5fopen_f", error, total_error) - - ! - ! Open the existing dataset. - ! - CALL h5dopen_f(file_id, dsetname, dset_id, error) - CALL check("h5dopen_f", error, total_error) - - CALL h5dvlen_get_max_len_f(dset_id, vltype_id, dspace_id, max_len, error) - CALL check("h5dvlen_get_max_len_f", error, total_error) - if(max_len .ne. data_dims(1)) then - total_error = total_error + 1 - write(*,*) "Wrong number of elemets returned by h5dvlen_get_max_len_f" - endif - ! - ! Read the dataset. - ! - CALL h5dread_vl_f(dset_id, vltype_id, vl_real_data_out, data_dims, len_out, & - error, mem_space_id = dspace_id, file_space_id = dspace_id) - CALL check("h5dread_real_f", error, total_error) - DO ih = 1, data_dims(2) - DO jh = 1, len_out(ih) - CALL VERIFY("h5dread_vl_f returned incorrect data",vl_real_data(jh,ih),vl_real_data_out(jh,ih), total_error) - ENDDO - IF (LEN(ih) .NE. len_out(ih)) THEN - total_error = total_error + 1 - WRITE(*,*) "h5dread_vl_f returned incorrect data" - ENDIF - ENDDO - - - ! - CALL h5dclose_f(dset_id, error) - CALL check("h5dclose_f", error, total_error) - - CALL h5tclose_f(vltype_id, error) - CALL check("h5tclose_f", error, total_error) - - ! - ! Terminate access to the data space. - ! - CALL h5sclose_f(dspace_id, error) - CALL check("h5sclose_f", error, total_error) - - ! - ! Close the file. - ! - CALL h5fclose_f(file_id, error) - CALL check("h5fclose_f", error, total_error) - if(cleanup) CALL h5_cleanup_f(filename, H5P_DEFAULT_F, error) - CALL check("h5_cleanup_f", error, total_error) - - RETURN - END SUBROUTINE vl_test_real - - SUBROUTINE vl_test_string(cleanup, total_error) - - IMPLICIT NONE - LOGICAL, INTENT(IN) :: cleanup - INTEGER, INTENT(OUT) :: total_error - - CHARACTER(LEN=8), PARAMETER :: filename = "VLtypesS" ! File name - CHARACTER(LEN=80) :: fix_filename - CHARACTER(LEN=9), PARAMETER :: dsetname = "VLstrings" ! Dataset name - - INTEGER(HID_T) :: file_id ! File identifier - INTEGER(HID_T) :: dset_id ! Dataset identifier - INTEGER(HID_T) :: dspace_id ! Dataspace identifier - - - INTEGER(HSIZE_T), DIMENSION(1) :: dims = (/4/) ! Dataset dimensions - INTEGER(SIZE_T), DIMENSION(4) :: str_len ! Elements lengths - INTEGER(SIZE_T), DIMENSION(4) :: str_len_out - INTEGER :: rank = 1 ! Dataset rank - - CHARACTER(LEN=10), DIMENSION(4) :: string_data ! Array of strings - CHARACTER(LEN=10), DIMENSION(4) :: string_data_out ! Data buffers - INTEGER :: error ! Error flag - - INTEGER(HSIZE_T) :: ih !general purpose integers - INTEGER(HSIZE_T), DIMENSION(2) :: data_dims = (/10,4/) - INTEGER(HID_T) :: vl_type_id - LOGICAL :: vl_flag - - ! - ! Initialize the string_data array. - ! - string_data(1) = 'This is ' - str_len(1) = 8 - string_data(2) = 'a fortran ' - str_len(2) = 10 - string_data(3) = 'strings ' - str_len(3) = 8 - string_data(4) = 'test. ' - str_len(4) = 5 - - - ! - ! Create a new file using default properties. - ! - CALL h5_fixname_f(filename, fix_filename, H5P_DEFAULT_F, error) - if (error .ne. 0) then - write(*,*) "Cannot modify filename" - stop - endif - CALL h5fcreate_f(fix_filename, H5F_ACC_TRUNC_F, file_id, error) - CALL check("h5fcreate_f", error, total_error) - - - ! - ! Create the dataspace. - ! - CALL h5screate_simple_f(rank, dims, dspace_id, error) - CALL check("h5screate_simple_f", error, total_error) - - - ! - ! Create the dataset with default properties. - ! - CALL h5dcreate_f(file_id, dsetname, H5T_STRING, dspace_id, & - dset_id, error) - CALL check("h5dcreate_f", error, total_error) - ! - ! Check that dataset has a string datatype - ! - CALL h5dget_type_f(dset_id, vl_type_id, error) - CALL check("h5dget_type_f", error, total_error) - CALL h5tis_variable_str_f( vl_type_id, vl_flag, error) - CALL check("h5tis_variable_str_f", error, total_error) - if( .NOT. vl_flag ) then - write(*,*) "type is wrong" - total_error = total_error + 1 - endif - - ! - ! Write the dataset. - ! - CALL h5dwrite_vl_f(dset_id, H5T_STRING, string_data, data_dims, str_len, error) - CALL check("h5dwrite_string_f", error, total_error) - - - ! - ! End access to the dataset and release resources used by it. - ! - CALL h5dclose_f(dset_id, error) - CALL check("h5dclose_f", error, total_error) - - ! - ! Close the file. - ! - CALL h5fclose_f(file_id, error) - CALL check("h5fclose_f", error, total_error) - - ! - ! Open the existing file. - ! - CALL h5fopen_f (fix_filename, H5F_ACC_RDWR_F, file_id, error) - CALL check("h5fopen_f", error, total_error) - - ! - ! Open the existing dataset. - ! - CALL h5dopen_f(file_id, dsetname, dset_id, error) - CALL check("h5dopen_f", error, total_error) - ! - ! Read the dataset. - ! - CALL h5dread_vl_f(dset_id, H5T_STRING, string_data_out, data_dims, & - str_len_out, error) - CALL check("h5dread_string_f", error, total_error) - do 100 ih = 1, data_dims(2) - if(str_len(ih) .ne. str_len_out(ih)) then - total_error=total_error + 1 - write(*,*) 'Returned string length is incorrect' - goto 100 - endif - if(string_data(1)(1:str_len(ih)) .ne. string_data_out(1)(1:str_len(ih))) then - write(*,*) ' Returned string is wrong' - total_error = total_error + 1 - endif -100 continue - - ! - CALL h5dclose_f(dset_id, error) - CALL check("h5dclose_f", error, total_error) - - ! - ! Terminate access to the data space. - ! - CALL h5sclose_f(dspace_id, error) - CALL check("h5sclose_f", error, total_error) - - ! - ! Close the file. - ! - CALL h5fclose_f(file_id, error) - CALL check("h5fclose_f", error, total_error) - if(cleanup) CALL h5_cleanup_f(filename, H5P_DEFAULT_F, error) - CALL check("h5_cleanup_f", error, total_error) - - RETURN - END SUBROUTINE vl_test_string -END MODULE TH5VL diff --git a/fortran/test/tH5Z.F90 b/fortran/test/tH5Z.F90 new file mode 100644 index 0000000..4201960 --- /dev/null +++ b/fortran/test/tH5Z.F90 @@ -0,0 +1,419 @@ +!****h* root/fortran/test/tH5Z.f90 +! +! NAME +! tH5Z.f90 +! +! FUNCTION +! Basic testing of Fortran H5Z szip 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. * +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! +! CONTAINS SUBROUTINES +! filters_test, szip_test +! +!***** +MODULE TH5Z + +CONTAINS + + SUBROUTINE filters_test(total_error) + +! This subroutine tests following functionalities: h5zfilter_avail_f, h5zunregister_f + + USE HDF5 ! This module contains all necessary modules + USE TH5_MISC + + IMPLICIT NONE + INTEGER, INTENT(OUT) :: total_error + LOGICAL :: status + INTEGER(HID_T) :: crtpr_id, xfer_id + INTEGER :: nfilters + INTEGER :: error + INTEGER(HSIZE_T) :: ch_dims(2) + INTEGER :: RANK = 2 + INTEGER :: dlevel = 6 + INTEGER :: edc_flag + + ch_dims(1) = 10 + ch_dims(2) = 3 +! +! Deflate filter +! + CALL h5zfilter_avail_f(H5Z_FILTER_DEFLATE_F, status, error) + CALL check("h5zfilter_avail_f", error, total_error) + if(status) then + CALL h5pcreate_f(H5P_DATASET_CREATE_F, crtpr_id, error) + CALL check("h5pcreate_f", error, total_error) + CALL h5pset_chunk_f(crtpr_id, RANK, ch_dims, error) + CALL check("h5pset_chunk_f",error, total_error) + CALL h5pset_deflate_f(crtpr_id, dlevel, error) + CALL check("h5pset_deflate_f", error, total_error) + CALL h5pclose_f(crtpr_id,error) + CALL check("h5pclose_f", error, total_error) + endif + +! +! Shuffle filter +! + CALL h5zfilter_avail_f(H5Z_FILTER_SHUFFLE_F, status, error) + CALL check("h5zfilter_avail_f", error, total_error) + if(status) then + CALL h5pcreate_f(H5P_DATASET_CREATE_F, crtpr_id, error) + CALL check("h5pcreate_f", error, total_error) + CALL h5pset_chunk_f(crtpr_id, RANK, ch_dims, error) + CALL check("h5pset_chunk_f",error, total_error) + CALL h5pset_shuffle_f(crtpr_id, error) + CALL check("h5pset_shuffle_f", error, total_error) + CALL h5pclose_f(crtpr_id,error) + CALL check("h5pclose_f", error, total_error) + endif + +! +! Checksum filter +! + CALL h5zfilter_avail_f(H5Z_FILTER_FLETCHER32_F, status, error) + CALL check("h5zfilter_avail_f", error, total_error) + if(status) then + CALL h5pcreate_f(H5P_DATASET_CREATE_F, crtpr_id, error) + CALL check("h5pcreate_f", error, total_error) + CALL h5pset_chunk_f(crtpr_id, RANK, ch_dims, error) + CALL check("h5pset_chunk_f",error, total_error) + CALL h5pset_fletcher32_f(crtpr_id, error) + CALL check("h5pset_fletcher32_f", error, total_error) + CALL h5pclose_f(crtpr_id,error) + CALL check("h5pclose_f", error, total_error) + CALL h5pcreate_f(H5P_DATASET_XFER_F, xfer_id, error) + CALL check("h5pcreate_f", error, total_error) + CALL h5pset_edc_check_f( xfer_id, H5Z_DISABLE_EDC_F, error) + CALL check("h5pset_edc_check_f", error, total_error) + CALL h5pget_edc_check_f( xfer_id, edc_flag, error) + CALL check("h5pget_edc_check_f", error, total_error) + if (edc_flag .ne. H5Z_DISABLE_EDC_F) then + write(*,*) "EDC status is wrong" + total_error = total_error + 1 + endif + CALL h5pclose_f(xfer_id, error) + CALL check("h5pclose_f", error, total_error) + + endif + +! +! Verify h5premove_filter_f +! + CALL h5zfilter_avail_f(H5Z_FILTER_FLETCHER32_F, status, error) + CALL check("h5zfilter_avail_f", error, total_error) + if(status) then + CALL h5zfilter_avail_f(H5Z_FILTER_SHUFFLE_F, status, error) + CALL check("h5zfilter_avail_f", error, total_error) + if(status) then + CALL h5pcreate_f(H5P_DATASET_CREATE_F, crtpr_id, error) + CALL check("h5pcreate_f", error, total_error) + CALL h5pset_fletcher32_f(crtpr_id, error) + CALL check("h5pset_fletcher32_f", error, total_error) + CALL h5pset_shuffle_f(crtpr_id, error) + CALL check("h5pset_shuffle_f", error, total_error) + CALL h5pget_nfilters_f(crtpr_id, nfilters, error) + CALL check("h5pget_nfilters_f", error, total_error) + + ! Verify the correct number of filters + if (nfilters .ne. 2) then + write(*,*) "number of filters is wrong" + total_error = total_error + 1 + endif + + ! Delete a single filter + CALL h5premove_filter_f(crtpr_id, H5Z_FILTER_SHUFFLE_F, error) + CALL check("h5pset_shuffle_f", error, total_error) + + ! Verify the correct number of filters now + CALL h5pget_nfilters_f(crtpr_id, nfilters, error) + CALL check("h5pget_nfilters_f", error, total_error) + if (nfilters .ne. 1) then + write(*,*) "number of filters is wrong" + total_error = total_error + 1 + endif + + ! Delete all filters + CALL h5premove_filter_f(crtpr_id, H5Z_FILTER_ALL_F, error) + CALL check("h5premove_filter_f", error, total_error) + + ! Verify the correct number of filters now + CALL h5pget_nfilters_f(crtpr_id, nfilters, error) + CALL check("h5pget_nfilters_f", error, total_error) + if (nfilters .ne. 0) then + write(*,*) "number of filters is wrong" + total_error = total_error + 1 + endif + CALL h5pclose_f(crtpr_id,error) + CALL check("h5pclose_f", error, total_error) + endif + endif + + RETURN + END SUBROUTINE filters_test + + SUBROUTINE szip_test(szip_flag, cleanup, total_error) + USE HDF5 ! This module contains all necessary modules + USE TH5_MISC + + IMPLICIT NONE + LOGICAL, INTENT(OUT) :: szip_flag + LOGICAL, INTENT(IN) :: cleanup + INTEGER, INTENT(OUT) :: total_error + + + CHARACTER(LEN=4), PARAMETER :: filename = "szip" ! File name + CHARACTER(LEN=80) :: fix_filename + CHARACTER(LEN=4), PARAMETER :: dsetname = "dset" ! Dataset name + INTEGER, PARAMETER :: N = 1024 + INTEGER, PARAMETER :: NN = 64 + INTEGER, PARAMETER :: M = 512 + INTEGER, PARAMETER :: MM = 32 + + INTEGER(HID_T) :: file_id ! File identifier + INTEGER(HID_T) :: dset_id ! Dataset identifier + INTEGER(HID_T) :: dspace_id ! Dataspace identifier + INTEGER(HID_T) :: dtype_id ! Datatype identifier + + + INTEGER(HSIZE_T), DIMENSION(2) :: dims = (/N,M/) ! Dataset dimensions + INTEGER(HSIZE_T), DIMENSION(2) :: chunk_dims = (/NN, MM/) + INTEGER :: rank = 2 ! Dataset rank + + INTEGER, DIMENSION(N,M) :: dset_data, data_out ! Data buffers + INTEGER :: error ! Error flag + INTEGER :: num_errors = 0 ! Number of data errors + + INTEGER :: i, j !general purpose integers + INTEGER(HSIZE_T), DIMENSION(2) :: data_dims + INTEGER(HID_T) :: crp_list + INTEGER :: options_mask, pix_per_block + LOGICAL :: flag + CHARACTER(LEN=4) filter_name + + INTEGER :: filter_flag = -1 + INTEGER(SIZE_T) :: cd_nelemnts = 4 + INTEGER(SIZE_T) :: filter_name_len = 4 + INTEGER, DIMENSION(4) :: cd_values + INTEGER :: config_flag = 0 ! for h5zget_filter_info_f + INTEGER :: config_flag_both = 0 ! for h5zget_filter_info_f + + ! + ! Verify that SZIP exists and has an encoder + ! + CALL h5zfilter_avail_f(H5Z_FILTER_SZIP_F, szip_flag, error) + CALL check("h5zfilter_avail", error, total_error) + + ! Quit if failed + if (error .ne. 0) return + + ! Skip if no SZIP available + if (.NOT. szip_flag)then + return + + else !SZIP available + + ! Continue + CALL h5zget_filter_info_f(H5Z_FILTER_SZIP_F, config_flag, error) + CALL check("h5zget_filter_info_f", error, total_error) + ! Quit if failed + if (error .ne. 0) return + ! + ! Make sure h5zget_filter_info_f returns the right flag + ! + config_flag_both=IOR(H5Z_FILTER_ENCODE_ENABLED_F,H5Z_FILTER_DECODE_ENABLED_F) + if( szip_flag ) then + if (config_flag .NE. config_flag_both) then + if(config_flag .NE. H5Z_FILTER_DECODE_ENABLED_F) then + error = -1 + CALL check("h5zget_filter_info_f config_flag", error, total_error) + endif + endif + endif + + ! Continue only when encoder is available + if ( IAND(config_flag, H5Z_FILTER_ENCODE_ENABLED_F) .EQ. 0 ) return + + options_mask = H5_SZIP_NN_OM_F + pix_per_block = 32 + ! + ! Initialize the dset_data array. + ! + do i = 1, N + do j = 1, M + dset_data(i,j) = (i-1)*6 + j; + end do + end do + + + ! + ! Create a new file using default properties. + ! + CALL h5_fixname_f(filename, fix_filename, H5P_DEFAULT_F, error) + if (error .ne. 0) then + write(*,*) "Cannot modify filename" + stop + endif + CALL h5fcreate_f(fix_filename, H5F_ACC_TRUNC_F, file_id, error) + CALL check("h5fcreate_f", error, total_error) + + + ! + ! Create the dataspace. + ! + CALL h5screate_simple_f(rank, dims, dspace_id, error) + CALL check("h5screate_simple_f", error, total_error) + + CALL h5pcreate_f(H5P_DATASET_CREATE_F, crp_list, error) + CALL check("h5pcreat_f",error,total_error) + + CALL h5pset_chunk_f(crp_list, rank, chunk_dims, error) + CALL check("h5pset_chunk_f",error,total_error) + CALL h5pset_szip_f(crp_list, options_mask, pix_per_block, error) + CALL check("h5pset_szip_f",error,total_error) + CALL h5pall_filters_avail_f(crp_list, flag, error) + CALL check("h5pall_filters_avail_f",error,total_error) + if (.NOT. flag) then + CALL h5pclose_f(crp_list, error) + CALL h5sclose_f(dspace_id, error) + CALL h5fclose_f(file_id, error) + szip_flag = .FALSE. + total_error = -1 + return + endif + + CALL h5pget_filter_by_id_f(crp_list, H5Z_FILTER_SZIP_F, filter_flag, & + + cd_nelemnts, cd_values,& + + filter_name_len, filter_name, error) + CALL check("h5pget_filter_by_id_f",error,total_error) + ! + ! Create the dataset with default properties. + ! + CALL h5dcreate_f(file_id, dsetname, H5T_NATIVE_INTEGER, dspace_id, & + dset_id, error, crp_list) + CALL check("h5dcreate_f", error, total_error) + + ! + ! Write the dataset. + ! + data_dims(1) = N + data_dims(2) = M + CALL h5dwrite_f(dset_id, H5T_NATIVE_INTEGER, dset_data, data_dims, error) + CALL check("h5dwrite_f", error, total_error) + + + ! + ! End access to the dataset and release resources used by it. + ! + CALL h5dclose_f(dset_id, error) + CALL check("h5dclose_f", error, total_error) + + ! + ! Terminate access to the data space. + ! + CALL h5sclose_f(dspace_id, error) + CALL check("h5sclose_f", error, total_error) + + ! + ! Close the file. + ! + CALL h5pclose_f(crp_list, error) + CALL h5fclose_f(file_id, error) + CALL check("h5fclose_f", error, total_error) + + ! + ! Open the existing file. + ! + CALL h5fopen_f (fix_filename, H5F_ACC_RDWR_F, file_id, error) + CALL check("h5fopen_f", error, total_error) + + ! + ! Open the existing dataset. + ! + CALL h5dopen_f(file_id, dsetname, dset_id, error) + CALL check("h5dopen_f", error, total_error) + CALL check("h5pget_filter_by_id_f",error,total_error) + + ! + ! Get the dataset type. + ! + CALL h5dget_type_f(dset_id, dtype_id, error) + CALL check("h5dget_type_f", error, total_error) + + ! + ! Get the data space. + ! + CALL h5dget_space_f(dset_id, dspace_id, error) + CALL check("h5dget_space_f", error, total_error) + + ! + ! Read the dataset. + ! + CALL h5dread_f (dset_id, H5T_NATIVE_INTEGER, data_out, data_dims, error) + CALL check("h5dread_f", error, total_error) + + ! + !Compare the data. + ! + do i = 1, N + do j = 1, M + IF (data_out(i,j) .NE. dset_data(i, j)) THEN + write(*, *) "dataset test error occured" + write(*,*) "data read is not the same as the data written" + num_errors = num_errors + 1 + IF (num_errors .GE. 512) THEN + write(*, *) "maximum data errors reached" + goto 100 + END IF + END IF + end do + end do +100 IF (num_errors .GT. 0) THEN + total_error=total_error + 1 + END IF + + ! + ! End access to the dataset and release resources used by it. + ! + CALL h5dclose_f(dset_id, error) + CALL check("h5dclose_f", error, total_error) + + ! + ! Terminate access to the data space. + ! + CALL h5sclose_f(dspace_id, error) + CALL check("h5sclose_f", error, total_error) + + ! + ! Terminate access to the data type. + ! + CALL h5tclose_f(dtype_id, error) + CALL check("h5tclose_f", error, total_error) + ! + ! Close the file. + ! + CALL h5fclose_f(file_id, error) + CALL check("h5fclose_f", error, total_error) + if(cleanup) CALL h5_cleanup_f(filename, H5P_DEFAULT_F, error) + CALL check("h5_cleanup_f", error, total_error) + endif ! SZIP available + + RETURN + END SUBROUTINE szip_test +END MODULE TH5Z diff --git a/fortran/test/tH5Z.f90 b/fortran/test/tH5Z.f90 deleted file mode 100644 index 4201960..0000000 --- a/fortran/test/tH5Z.f90 +++ /dev/null @@ -1,419 +0,0 @@ -!****h* root/fortran/test/tH5Z.f90 -! -! NAME -! tH5Z.f90 -! -! FUNCTION -! Basic testing of Fortran H5Z szip 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. * -! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -! -! CONTAINS SUBROUTINES -! filters_test, szip_test -! -!***** -MODULE TH5Z - -CONTAINS - - SUBROUTINE filters_test(total_error) - -! This subroutine tests following functionalities: h5zfilter_avail_f, h5zunregister_f - - USE HDF5 ! This module contains all necessary modules - USE TH5_MISC - - IMPLICIT NONE - INTEGER, INTENT(OUT) :: total_error - LOGICAL :: status - INTEGER(HID_T) :: crtpr_id, xfer_id - INTEGER :: nfilters - INTEGER :: error - INTEGER(HSIZE_T) :: ch_dims(2) - INTEGER :: RANK = 2 - INTEGER :: dlevel = 6 - INTEGER :: edc_flag - - ch_dims(1) = 10 - ch_dims(2) = 3 -! -! Deflate filter -! - CALL h5zfilter_avail_f(H5Z_FILTER_DEFLATE_F, status, error) - CALL check("h5zfilter_avail_f", error, total_error) - if(status) then - CALL h5pcreate_f(H5P_DATASET_CREATE_F, crtpr_id, error) - CALL check("h5pcreate_f", error, total_error) - CALL h5pset_chunk_f(crtpr_id, RANK, ch_dims, error) - CALL check("h5pset_chunk_f",error, total_error) - CALL h5pset_deflate_f(crtpr_id, dlevel, error) - CALL check("h5pset_deflate_f", error, total_error) - CALL h5pclose_f(crtpr_id,error) - CALL check("h5pclose_f", error, total_error) - endif - -! -! Shuffle filter -! - CALL h5zfilter_avail_f(H5Z_FILTER_SHUFFLE_F, status, error) - CALL check("h5zfilter_avail_f", error, total_error) - if(status) then - CALL h5pcreate_f(H5P_DATASET_CREATE_F, crtpr_id, error) - CALL check("h5pcreate_f", error, total_error) - CALL h5pset_chunk_f(crtpr_id, RANK, ch_dims, error) - CALL check("h5pset_chunk_f",error, total_error) - CALL h5pset_shuffle_f(crtpr_id, error) - CALL check("h5pset_shuffle_f", error, total_error) - CALL h5pclose_f(crtpr_id,error) - CALL check("h5pclose_f", error, total_error) - endif - -! -! Checksum filter -! - CALL h5zfilter_avail_f(H5Z_FILTER_FLETCHER32_F, status, error) - CALL check("h5zfilter_avail_f", error, total_error) - if(status) then - CALL h5pcreate_f(H5P_DATASET_CREATE_F, crtpr_id, error) - CALL check("h5pcreate_f", error, total_error) - CALL h5pset_chunk_f(crtpr_id, RANK, ch_dims, error) - CALL check("h5pset_chunk_f",error, total_error) - CALL h5pset_fletcher32_f(crtpr_id, error) - CALL check("h5pset_fletcher32_f", error, total_error) - CALL h5pclose_f(crtpr_id,error) - CALL check("h5pclose_f", error, total_error) - CALL h5pcreate_f(H5P_DATASET_XFER_F, xfer_id, error) - CALL check("h5pcreate_f", error, total_error) - CALL h5pset_edc_check_f( xfer_id, H5Z_DISABLE_EDC_F, error) - CALL check("h5pset_edc_check_f", error, total_error) - CALL h5pget_edc_check_f( xfer_id, edc_flag, error) - CALL check("h5pget_edc_check_f", error, total_error) - if (edc_flag .ne. H5Z_DISABLE_EDC_F) then - write(*,*) "EDC status is wrong" - total_error = total_error + 1 - endif - CALL h5pclose_f(xfer_id, error) - CALL check("h5pclose_f", error, total_error) - - endif - -! -! Verify h5premove_filter_f -! - CALL h5zfilter_avail_f(H5Z_FILTER_FLETCHER32_F, status, error) - CALL check("h5zfilter_avail_f", error, total_error) - if(status) then - CALL h5zfilter_avail_f(H5Z_FILTER_SHUFFLE_F, status, error) - CALL check("h5zfilter_avail_f", error, total_error) - if(status) then - CALL h5pcreate_f(H5P_DATASET_CREATE_F, crtpr_id, error) - CALL check("h5pcreate_f", error, total_error) - CALL h5pset_fletcher32_f(crtpr_id, error) - CALL check("h5pset_fletcher32_f", error, total_error) - CALL h5pset_shuffle_f(crtpr_id, error) - CALL check("h5pset_shuffle_f", error, total_error) - CALL h5pget_nfilters_f(crtpr_id, nfilters, error) - CALL check("h5pget_nfilters_f", error, total_error) - - ! Verify the correct number of filters - if (nfilters .ne. 2) then - write(*,*) "number of filters is wrong" - total_error = total_error + 1 - endif - - ! Delete a single filter - CALL h5premove_filter_f(crtpr_id, H5Z_FILTER_SHUFFLE_F, error) - CALL check("h5pset_shuffle_f", error, total_error) - - ! Verify the correct number of filters now - CALL h5pget_nfilters_f(crtpr_id, nfilters, error) - CALL check("h5pget_nfilters_f", error, total_error) - if (nfilters .ne. 1) then - write(*,*) "number of filters is wrong" - total_error = total_error + 1 - endif - - ! Delete all filters - CALL h5premove_filter_f(crtpr_id, H5Z_FILTER_ALL_F, error) - CALL check("h5premove_filter_f", error, total_error) - - ! Verify the correct number of filters now - CALL h5pget_nfilters_f(crtpr_id, nfilters, error) - CALL check("h5pget_nfilters_f", error, total_error) - if (nfilters .ne. 0) then - write(*,*) "number of filters is wrong" - total_error = total_error + 1 - endif - CALL h5pclose_f(crtpr_id,error) - CALL check("h5pclose_f", error, total_error) - endif - endif - - RETURN - END SUBROUTINE filters_test - - SUBROUTINE szip_test(szip_flag, cleanup, total_error) - USE HDF5 ! This module contains all necessary modules - USE TH5_MISC - - IMPLICIT NONE - LOGICAL, INTENT(OUT) :: szip_flag - LOGICAL, INTENT(IN) :: cleanup - INTEGER, INTENT(OUT) :: total_error - - - CHARACTER(LEN=4), PARAMETER :: filename = "szip" ! File name - CHARACTER(LEN=80) :: fix_filename - CHARACTER(LEN=4), PARAMETER :: dsetname = "dset" ! Dataset name - INTEGER, PARAMETER :: N = 1024 - INTEGER, PARAMETER :: NN = 64 - INTEGER, PARAMETER :: M = 512 - INTEGER, PARAMETER :: MM = 32 - - INTEGER(HID_T) :: file_id ! File identifier - INTEGER(HID_T) :: dset_id ! Dataset identifier - INTEGER(HID_T) :: dspace_id ! Dataspace identifier - INTEGER(HID_T) :: dtype_id ! Datatype identifier - - - INTEGER(HSIZE_T), DIMENSION(2) :: dims = (/N,M/) ! Dataset dimensions - INTEGER(HSIZE_T), DIMENSION(2) :: chunk_dims = (/NN, MM/) - INTEGER :: rank = 2 ! Dataset rank - - INTEGER, DIMENSION(N,M) :: dset_data, data_out ! Data buffers - INTEGER :: error ! Error flag - INTEGER :: num_errors = 0 ! Number of data errors - - INTEGER :: i, j !general purpose integers - INTEGER(HSIZE_T), DIMENSION(2) :: data_dims - INTEGER(HID_T) :: crp_list - INTEGER :: options_mask, pix_per_block - LOGICAL :: flag - CHARACTER(LEN=4) filter_name - - INTEGER :: filter_flag = -1 - INTEGER(SIZE_T) :: cd_nelemnts = 4 - INTEGER(SIZE_T) :: filter_name_len = 4 - INTEGER, DIMENSION(4) :: cd_values - INTEGER :: config_flag = 0 ! for h5zget_filter_info_f - INTEGER :: config_flag_both = 0 ! for h5zget_filter_info_f - - ! - ! Verify that SZIP exists and has an encoder - ! - CALL h5zfilter_avail_f(H5Z_FILTER_SZIP_F, szip_flag, error) - CALL check("h5zfilter_avail", error, total_error) - - ! Quit if failed - if (error .ne. 0) return - - ! Skip if no SZIP available - if (.NOT. szip_flag)then - return - - else !SZIP available - - ! Continue - CALL h5zget_filter_info_f(H5Z_FILTER_SZIP_F, config_flag, error) - CALL check("h5zget_filter_info_f", error, total_error) - ! Quit if failed - if (error .ne. 0) return - ! - ! Make sure h5zget_filter_info_f returns the right flag - ! - config_flag_both=IOR(H5Z_FILTER_ENCODE_ENABLED_F,H5Z_FILTER_DECODE_ENABLED_F) - if( szip_flag ) then - if (config_flag .NE. config_flag_both) then - if(config_flag .NE. H5Z_FILTER_DECODE_ENABLED_F) then - error = -1 - CALL check("h5zget_filter_info_f config_flag", error, total_error) - endif - endif - endif - - ! Continue only when encoder is available - if ( IAND(config_flag, H5Z_FILTER_ENCODE_ENABLED_F) .EQ. 0 ) return - - options_mask = H5_SZIP_NN_OM_F - pix_per_block = 32 - ! - ! Initialize the dset_data array. - ! - do i = 1, N - do j = 1, M - dset_data(i,j) = (i-1)*6 + j; - end do - end do - - - ! - ! Create a new file using default properties. - ! - CALL h5_fixname_f(filename, fix_filename, H5P_DEFAULT_F, error) - if (error .ne. 0) then - write(*,*) "Cannot modify filename" - stop - endif - CALL h5fcreate_f(fix_filename, H5F_ACC_TRUNC_F, file_id, error) - CALL check("h5fcreate_f", error, total_error) - - - ! - ! Create the dataspace. - ! - CALL h5screate_simple_f(rank, dims, dspace_id, error) - CALL check("h5screate_simple_f", error, total_error) - - CALL h5pcreate_f(H5P_DATASET_CREATE_F, crp_list, error) - CALL check("h5pcreat_f",error,total_error) - - CALL h5pset_chunk_f(crp_list, rank, chunk_dims, error) - CALL check("h5pset_chunk_f",error,total_error) - CALL h5pset_szip_f(crp_list, options_mask, pix_per_block, error) - CALL check("h5pset_szip_f",error,total_error) - CALL h5pall_filters_avail_f(crp_list, flag, error) - CALL check("h5pall_filters_avail_f",error,total_error) - if (.NOT. flag) then - CALL h5pclose_f(crp_list, error) - CALL h5sclose_f(dspace_id, error) - CALL h5fclose_f(file_id, error) - szip_flag = .FALSE. - total_error = -1 - return - endif - - CALL h5pget_filter_by_id_f(crp_list, H5Z_FILTER_SZIP_F, filter_flag, & - - cd_nelemnts, cd_values,& - - filter_name_len, filter_name, error) - CALL check("h5pget_filter_by_id_f",error,total_error) - ! - ! Create the dataset with default properties. - ! - CALL h5dcreate_f(file_id, dsetname, H5T_NATIVE_INTEGER, dspace_id, & - dset_id, error, crp_list) - CALL check("h5dcreate_f", error, total_error) - - ! - ! Write the dataset. - ! - data_dims(1) = N - data_dims(2) = M - CALL h5dwrite_f(dset_id, H5T_NATIVE_INTEGER, dset_data, data_dims, error) - CALL check("h5dwrite_f", error, total_error) - - - ! - ! End access to the dataset and release resources used by it. - ! - CALL h5dclose_f(dset_id, error) - CALL check("h5dclose_f", error, total_error) - - ! - ! Terminate access to the data space. - ! - CALL h5sclose_f(dspace_id, error) - CALL check("h5sclose_f", error, total_error) - - ! - ! Close the file. - ! - CALL h5pclose_f(crp_list, error) - CALL h5fclose_f(file_id, error) - CALL check("h5fclose_f", error, total_error) - - ! - ! Open the existing file. - ! - CALL h5fopen_f (fix_filename, H5F_ACC_RDWR_F, file_id, error) - CALL check("h5fopen_f", error, total_error) - - ! - ! Open the existing dataset. - ! - CALL h5dopen_f(file_id, dsetname, dset_id, error) - CALL check("h5dopen_f", error, total_error) - CALL check("h5pget_filter_by_id_f",error,total_error) - - ! - ! Get the dataset type. - ! - CALL h5dget_type_f(dset_id, dtype_id, error) - CALL check("h5dget_type_f", error, total_error) - - ! - ! Get the data space. - ! - CALL h5dget_space_f(dset_id, dspace_id, error) - CALL check("h5dget_space_f", error, total_error) - - ! - ! Read the dataset. - ! - CALL h5dread_f (dset_id, H5T_NATIVE_INTEGER, data_out, data_dims, error) - CALL check("h5dread_f", error, total_error) - - ! - !Compare the data. - ! - do i = 1, N - do j = 1, M - IF (data_out(i,j) .NE. dset_data(i, j)) THEN - write(*, *) "dataset test error occured" - write(*,*) "data read is not the same as the data written" - num_errors = num_errors + 1 - IF (num_errors .GE. 512) THEN - write(*, *) "maximum data errors reached" - goto 100 - END IF - END IF - end do - end do -100 IF (num_errors .GT. 0) THEN - total_error=total_error + 1 - END IF - - ! - ! End access to the dataset and release resources used by it. - ! - CALL h5dclose_f(dset_id, error) - CALL check("h5dclose_f", error, total_error) - - ! - ! Terminate access to the data space. - ! - CALL h5sclose_f(dspace_id, error) - CALL check("h5sclose_f", error, total_error) - - ! - ! Terminate access to the data type. - ! - CALL h5tclose_f(dtype_id, error) - CALL check("h5tclose_f", error, total_error) - ! - ! Close the file. - ! - CALL h5fclose_f(file_id, error) - CALL check("h5fclose_f", error, total_error) - if(cleanup) CALL h5_cleanup_f(filename, H5P_DEFAULT_F, error) - CALL check("h5_cleanup_f", error, total_error) - endif ! SZIP available - - RETURN - END SUBROUTINE szip_test -END MODULE TH5Z diff --git a/fortran/test/tHDF5.F90 b/fortran/test/tHDF5.F90 new file mode 100644 index 0000000..d12bb25 --- /dev/null +++ b/fortran/test/tHDF5.F90 @@ -0,0 +1,46 @@ +!****h* ROBODoc/HDF5 +! +! NAME +! MODULE THDF5 +! +! FILE +! src/fortran/test/tHDF5.f90 +! +! PURPOSE +! This is the test module used for testing the Fortran90 HDF library 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. * +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! +!***** + +MODULE THDF5 + USE TH5_MISC + USE TH5_MISC_GEN + USE TH5A + USE TH5D + USE TH5E + USE TH5F + USE TH5G + USE TH5I + USE TH5P + USE TH5R + USE TH5S + USE TH5SSELECT + USE TH5T + USE TH5VL + USE TH5Z +END MODULE THDF5 diff --git a/fortran/test/tHDF5.f90 b/fortran/test/tHDF5.f90 deleted file mode 100644 index d12bb25..0000000 --- a/fortran/test/tHDF5.f90 +++ /dev/null @@ -1,46 +0,0 @@ -!****h* ROBODoc/HDF5 -! -! NAME -! MODULE THDF5 -! -! FILE -! src/fortran/test/tHDF5.f90 -! -! PURPOSE -! This is the test module used for testing the Fortran90 HDF library 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. * -! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -! -!***** - -MODULE THDF5 - USE TH5_MISC - USE TH5_MISC_GEN - USE TH5A - USE TH5D - USE TH5E - USE TH5F - USE TH5G - USE TH5I - USE TH5P - USE TH5R - USE TH5S - USE TH5SSELECT - USE TH5T - USE TH5VL - USE TH5Z -END MODULE THDF5 diff --git a/fortran/test/tHDF5_1_8.F90 b/fortran/test/tHDF5_1_8.F90 new file mode 100644 index 0000000..9d1c3ec --- /dev/null +++ b/fortran/test/tHDF5_1_8.F90 @@ -0,0 +1,37 @@ +!****h* ROBODoc/HDF5 +! +! NAME +! MODULE THDF5_1_8 +! +! FILE +! src/fortran/test/tHDF5_1_8.f90 +! +! PURPOSE +! This is the test module used for testing the Fortran90 HDF library +! 1.8.* 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. * +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! +!***** + +MODULE THDF5_1_8 + USE TH5_MISC + USE TH5MISC_1_8 + USE TH5A_1_8 + USE TH5G_1_8 + USE TH5O +END MODULE THDF5_1_8 diff --git a/fortran/test/tHDF5_1_8.f90 b/fortran/test/tHDF5_1_8.f90 deleted file mode 100644 index 9d1c3ec..0000000 --- a/fortran/test/tHDF5_1_8.f90 +++ /dev/null @@ -1,37 +0,0 @@ -!****h* ROBODoc/HDF5 -! -! NAME -! MODULE THDF5_1_8 -! -! FILE -! src/fortran/test/tHDF5_1_8.f90 -! -! PURPOSE -! This is the test module used for testing the Fortran90 HDF library -! 1.8.* 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. * -! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -! -!***** - -MODULE THDF5_1_8 - USE TH5_MISC - USE TH5MISC_1_8 - USE TH5A_1_8 - USE TH5G_1_8 - USE TH5O -END MODULE THDF5_1_8 diff --git a/fortran/test/tHDF5_F03.F90 b/fortran/test/tHDF5_F03.F90 new file mode 100644 index 0000000..3dbec11 --- /dev/null +++ b/fortran/test/tHDF5_F03.F90 @@ -0,0 +1,39 @@ +!****h* ROBODoc/HDF5 +! +! NAME +! MODULE THDF5_F03 +! +! FILE +! src/fortran/test/tHDF5_F03.f90 +! +! PURPOSE +! This is the test module used for testing the Fortran2003 HDF +! library 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. * +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! +!***** + +MODULE THDF5_F03 + USE TH5_MISC + USE TH5E_F03 + USE TH5F_F03 + USE TH5L_F03 + USE TH5O_F03 + USE TH5P_F03 + USE TH5T_F03 +END MODULE THDF5_F03 diff --git a/fortran/test/tHDF5_F03.f90 b/fortran/test/tHDF5_F03.f90 deleted file mode 100644 index 3dbec11..0000000 --- a/fortran/test/tHDF5_F03.f90 +++ /dev/null @@ -1,39 +0,0 @@ -!****h* ROBODoc/HDF5 -! -! NAME -! MODULE THDF5_F03 -! -! FILE -! src/fortran/test/tHDF5_F03.f90 -! -! PURPOSE -! This is the test module used for testing the Fortran2003 HDF -! library 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. * -! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -! -!***** - -MODULE THDF5_F03 - USE TH5_MISC - USE TH5E_F03 - USE TH5F_F03 - USE TH5L_F03 - USE TH5O_F03 - USE TH5P_F03 - USE TH5T_F03 -END MODULE THDF5_F03 diff --git a/fortran/testpar/Makefile.in b/fortran/testpar/Makefile.in index 9ee38d5..8f4b815 100644 --- a/fortran/testpar/Makefile.in +++ b/fortran/testpar/Makefile.in @@ -463,6 +463,7 @@ FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ +Fortran_COMPILER_ID = @Fortran_COMPILER_ID@ GREP = @GREP@ H5CONFIG_F_IKIND = @H5CONFIG_F_IKIND@ H5CONFIG_F_NUM_IKIND = @H5CONFIG_F_NUM_IKIND@ diff --git a/hl/Makefile.in b/hl/Makefile.in index f1e178d..b2309d8 100644 --- a/hl/Makefile.in +++ b/hl/Makefile.in @@ -462,6 +462,7 @@ FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ +Fortran_COMPILER_ID = @Fortran_COMPILER_ID@ GREP = @GREP@ H5CONFIG_F_IKIND = @H5CONFIG_F_IKIND@ H5CONFIG_F_NUM_IKIND = @H5CONFIG_F_NUM_IKIND@ diff --git a/hl/c++/Makefile.in b/hl/c++/Makefile.in index 7f71fc3..82177b4 100644 --- a/hl/c++/Makefile.in +++ b/hl/c++/Makefile.in @@ -458,6 +458,7 @@ FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ +Fortran_COMPILER_ID = @Fortran_COMPILER_ID@ GREP = @GREP@ H5CONFIG_F_IKIND = @H5CONFIG_F_IKIND@ H5CONFIG_F_NUM_IKIND = @H5CONFIG_F_NUM_IKIND@ diff --git a/hl/c++/examples/Makefile.in b/hl/c++/examples/Makefile.in index fc3237a..00c53d8 100644 --- a/hl/c++/examples/Makefile.in +++ b/hl/c++/examples/Makefile.in @@ -405,6 +405,7 @@ FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ +Fortran_COMPILER_ID = @Fortran_COMPILER_ID@ GREP = @GREP@ H5CONFIG_F_IKIND = @H5CONFIG_F_IKIND@ H5CONFIG_F_NUM_IKIND = @H5CONFIG_F_NUM_IKIND@ diff --git a/hl/c++/src/Makefile.in b/hl/c++/src/Makefile.in index a08f20c..905e821 100644 --- a/hl/c++/src/Makefile.in +++ b/hl/c++/src/Makefile.in @@ -461,6 +461,7 @@ FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ +Fortran_COMPILER_ID = @Fortran_COMPILER_ID@ GREP = @GREP@ H5CONFIG_F_IKIND = @H5CONFIG_F_IKIND@ H5CONFIG_F_NUM_IKIND = @H5CONFIG_F_NUM_IKIND@ diff --git a/hl/c++/test/Makefile.in b/hl/c++/test/Makefile.in index c22eff8..1fab9a5 100644 --- a/hl/c++/test/Makefile.in +++ b/hl/c++/test/Makefile.in @@ -458,6 +458,7 @@ FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ +Fortran_COMPILER_ID = @Fortran_COMPILER_ID@ GREP = @GREP@ H5CONFIG_F_IKIND = @H5CONFIG_F_IKIND@ H5CONFIG_F_NUM_IKIND = @H5CONFIG_F_NUM_IKIND@ diff --git a/hl/examples/Makefile.in b/hl/examples/Makefile.in index 1061124..b9ede6f 100644 --- a/hl/examples/Makefile.in +++ b/hl/examples/Makefile.in @@ -405,6 +405,7 @@ FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ +Fortran_COMPILER_ID = @Fortran_COMPILER_ID@ GREP = @GREP@ H5CONFIG_F_IKIND = @H5CONFIG_F_IKIND@ H5CONFIG_F_NUM_IKIND = @H5CONFIG_F_NUM_IKIND@ diff --git a/hl/fortran/Makefile.in b/hl/fortran/Makefile.in index bd2ac82..304a3b6 100644 --- a/hl/fortran/Makefile.in +++ b/hl/fortran/Makefile.in @@ -462,6 +462,7 @@ FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ +Fortran_COMPILER_ID = @Fortran_COMPILER_ID@ GREP = @GREP@ H5CONFIG_F_IKIND = @H5CONFIG_F_IKIND@ H5CONFIG_F_NUM_IKIND = @H5CONFIG_F_NUM_IKIND@ diff --git a/hl/fortran/examples/Makefile.in b/hl/fortran/examples/Makefile.in index c992e8a..21ff588 100644 --- a/hl/fortran/examples/Makefile.in +++ b/hl/fortran/examples/Makefile.in @@ -410,6 +410,7 @@ FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ +Fortran_COMPILER_ID = @Fortran_COMPILER_ID@ GREP = @GREP@ H5CONFIG_F_IKIND = @H5CONFIG_F_IKIND@ H5CONFIG_F_NUM_IKIND = @H5CONFIG_F_NUM_IKIND@ diff --git a/hl/fortran/src/Makefile.in b/hl/fortran/src/Makefile.in index c63733a..c1c0721 100644 --- a/hl/fortran/src/Makefile.in +++ b/hl/fortran/src/Makefile.in @@ -489,6 +489,7 @@ FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ +Fortran_COMPILER_ID = @Fortran_COMPILER_ID@ GREP = @GREP@ H5CONFIG_F_IKIND = @H5CONFIG_F_IKIND@ H5CONFIG_F_NUM_IKIND = @H5CONFIG_F_NUM_IKIND@ diff --git a/hl/fortran/test/Makefile.in b/hl/fortran/test/Makefile.in index da46790..117faf2 100644 --- a/hl/fortran/test/Makefile.in +++ b/hl/fortran/test/Makefile.in @@ -472,6 +472,7 @@ FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ +Fortran_COMPILER_ID = @Fortran_COMPILER_ID@ GREP = @GREP@ H5CONFIG_F_IKIND = @H5CONFIG_F_IKIND@ H5CONFIG_F_NUM_IKIND = @H5CONFIG_F_NUM_IKIND@ diff --git a/hl/src/Makefile.in b/hl/src/Makefile.in index 264c342..3bab6a9 100644 --- a/hl/src/Makefile.in +++ b/hl/src/Makefile.in @@ -460,6 +460,7 @@ FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ +Fortran_COMPILER_ID = @Fortran_COMPILER_ID@ GREP = @GREP@ H5CONFIG_F_IKIND = @H5CONFIG_F_IKIND@ H5CONFIG_F_NUM_IKIND = @H5CONFIG_F_NUM_IKIND@ diff --git a/hl/test/Makefile.in b/hl/test/Makefile.in index f55bc3a..325a426 100644 --- a/hl/test/Makefile.in +++ b/hl/test/Makefile.in @@ -497,6 +497,7 @@ FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ +Fortran_COMPILER_ID = @Fortran_COMPILER_ID@ GREP = @GREP@ H5CONFIG_F_IKIND = @H5CONFIG_F_IKIND@ H5CONFIG_F_NUM_IKIND = @H5CONFIG_F_NUM_IKIND@ diff --git a/hl/tools/Makefile.in b/hl/tools/Makefile.in index d42f55c..0e06376 100644 --- a/hl/tools/Makefile.in +++ b/hl/tools/Makefile.in @@ -459,6 +459,7 @@ FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ +Fortran_COMPILER_ID = @Fortran_COMPILER_ID@ GREP = @GREP@ H5CONFIG_F_IKIND = @H5CONFIG_F_IKIND@ H5CONFIG_F_NUM_IKIND = @H5CONFIG_F_NUM_IKIND@ diff --git a/hl/tools/gif2h5/Makefile.in b/hl/tools/gif2h5/Makefile.in index 5dda20f..b41fcb3 100644 --- a/hl/tools/gif2h5/Makefile.in +++ b/hl/tools/gif2h5/Makefile.in @@ -473,6 +473,7 @@ FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ +Fortran_COMPILER_ID = @Fortran_COMPILER_ID@ GREP = @GREP@ H5CONFIG_F_IKIND = @H5CONFIG_F_IKIND@ H5CONFIG_F_NUM_IKIND = @H5CONFIG_F_NUM_IKIND@ diff --git a/src/H5config.h.in b/src/H5config.h.in index ad8dcf9..252ec04 100644 --- a/src/H5config.h.in +++ b/src/H5config.h.in @@ -48,6 +48,9 @@ /* Determine the size of C long double */ #undef FORTRAN_SIZEOF_LONG_DOUBLE +/* Define Fortran compiler ID */ +#undef Fortran_COMPILER_ID + /* Define valid Fortran INTEGER KINDs */ #undef H5CONFIG_F_IKIND diff --git a/src/Makefile.in b/src/Makefile.in index 397691d..39fb99f 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -522,6 +522,7 @@ FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ +Fortran_COMPILER_ID = @Fortran_COMPILER_ID@ GREP = @GREP@ H5CONFIG_F_IKIND = @H5CONFIG_F_IKIND@ H5CONFIG_F_NUM_IKIND = @H5CONFIG_F_NUM_IKIND@ diff --git a/test/Makefile.in b/test/Makefile.in index e8877d7..a1060dd 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -865,6 +865,7 @@ FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ +Fortran_COMPILER_ID = @Fortran_COMPILER_ID@ GREP = @GREP@ H5CONFIG_F_IKIND = @H5CONFIG_F_IKIND@ H5CONFIG_F_NUM_IKIND = @H5CONFIG_F_NUM_IKIND@ diff --git a/testpar/Makefile.in b/testpar/Makefile.in index e70d05e..223247a 100644 --- a/testpar/Makefile.in +++ b/testpar/Makefile.in @@ -492,6 +492,7 @@ FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ +Fortran_COMPILER_ID = @Fortran_COMPILER_ID@ GREP = @GREP@ H5CONFIG_F_IKIND = @H5CONFIG_F_IKIND@ H5CONFIG_F_NUM_IKIND = @H5CONFIG_F_NUM_IKIND@ diff --git a/tools/Makefile.in b/tools/Makefile.in index f7121e6..50153ae 100644 --- a/tools/Makefile.in +++ b/tools/Makefile.in @@ -459,6 +459,7 @@ FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ +Fortran_COMPILER_ID = @Fortran_COMPILER_ID@ GREP = @GREP@ H5CONFIG_F_IKIND = @H5CONFIG_F_IKIND@ H5CONFIG_F_NUM_IKIND = @H5CONFIG_F_NUM_IKIND@ diff --git a/tools/h5copy/Makefile.in b/tools/h5copy/Makefile.in index 57c0a38..3900396 100644 --- a/tools/h5copy/Makefile.in +++ b/tools/h5copy/Makefile.in @@ -467,6 +467,7 @@ FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ +Fortran_COMPILER_ID = @Fortran_COMPILER_ID@ GREP = @GREP@ H5CONFIG_F_IKIND = @H5CONFIG_F_IKIND@ H5CONFIG_F_NUM_IKIND = @H5CONFIG_F_NUM_IKIND@ diff --git a/tools/h5diff/Makefile.in b/tools/h5diff/Makefile.in index 638afd6..ebfb680 100644 --- a/tools/h5diff/Makefile.in +++ b/tools/h5diff/Makefile.in @@ -474,6 +474,7 @@ FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ +Fortran_COMPILER_ID = @Fortran_COMPILER_ID@ GREP = @GREP@ H5CONFIG_F_IKIND = @H5CONFIG_F_IKIND@ H5CONFIG_F_NUM_IKIND = @H5CONFIG_F_NUM_IKIND@ diff --git a/tools/h5dump/Makefile.in b/tools/h5dump/Makefile.in index cfb268c..208e4e0 100644 --- a/tools/h5dump/Makefile.in +++ b/tools/h5dump/Makefile.in @@ -473,6 +473,7 @@ FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ +Fortran_COMPILER_ID = @Fortran_COMPILER_ID@ GREP = @GREP@ H5CONFIG_F_IKIND = @H5CONFIG_F_IKIND@ H5CONFIG_F_NUM_IKIND = @H5CONFIG_F_NUM_IKIND@ diff --git a/tools/h5import/Makefile.in b/tools/h5import/Makefile.in index 3185d72..938f3d9 100644 --- a/tools/h5import/Makefile.in +++ b/tools/h5import/Makefile.in @@ -467,6 +467,7 @@ FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ +Fortran_COMPILER_ID = @Fortran_COMPILER_ID@ GREP = @GREP@ H5CONFIG_F_IKIND = @H5CONFIG_F_IKIND@ H5CONFIG_F_NUM_IKIND = @H5CONFIG_F_NUM_IKIND@ diff --git a/tools/h5jam/Makefile.in b/tools/h5jam/Makefile.in index 8e5f994..9452a9b 100644 --- a/tools/h5jam/Makefile.in +++ b/tools/h5jam/Makefile.in @@ -479,6 +479,7 @@ FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ +Fortran_COMPILER_ID = @Fortran_COMPILER_ID@ GREP = @GREP@ H5CONFIG_F_IKIND = @H5CONFIG_F_IKIND@ H5CONFIG_F_NUM_IKIND = @H5CONFIG_F_NUM_IKIND@ diff --git a/tools/h5ls/Makefile.in b/tools/h5ls/Makefile.in index b23d07f..73bef6c 100644 --- a/tools/h5ls/Makefile.in +++ b/tools/h5ls/Makefile.in @@ -459,6 +459,7 @@ FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ +Fortran_COMPILER_ID = @Fortran_COMPILER_ID@ GREP = @GREP@ H5CONFIG_F_IKIND = @H5CONFIG_F_IKIND@ H5CONFIG_F_NUM_IKIND = @H5CONFIG_F_NUM_IKIND@ diff --git a/tools/h5repack/Makefile.in b/tools/h5repack/Makefile.in index 6868523..02be99d 100644 --- a/tools/h5repack/Makefile.in +++ b/tools/h5repack/Makefile.in @@ -491,6 +491,7 @@ FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ +Fortran_COMPILER_ID = @Fortran_COMPILER_ID@ GREP = @GREP@ H5CONFIG_F_IKIND = @H5CONFIG_F_IKIND@ H5CONFIG_F_NUM_IKIND = @H5CONFIG_F_NUM_IKIND@ diff --git a/tools/h5stat/Makefile.in b/tools/h5stat/Makefile.in index a03b765..e0d095d 100644 --- a/tools/h5stat/Makefile.in +++ b/tools/h5stat/Makefile.in @@ -469,6 +469,7 @@ FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ +Fortran_COMPILER_ID = @Fortran_COMPILER_ID@ GREP = @GREP@ H5CONFIG_F_IKIND = @H5CONFIG_F_IKIND@ H5CONFIG_F_NUM_IKIND = @H5CONFIG_F_NUM_IKIND@ diff --git a/tools/lib/Makefile.in b/tools/lib/Makefile.in index ab7940e..ba26950 100644 --- a/tools/lib/Makefile.in +++ b/tools/lib/Makefile.in @@ -456,6 +456,7 @@ FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ +Fortran_COMPILER_ID = @Fortran_COMPILER_ID@ GREP = @GREP@ H5CONFIG_F_IKIND = @H5CONFIG_F_IKIND@ H5CONFIG_F_NUM_IKIND = @H5CONFIG_F_NUM_IKIND@ diff --git a/tools/misc/Makefile.in b/tools/misc/Makefile.in index 3e6b688..4b6c31c 100644 --- a/tools/misc/Makefile.in +++ b/tools/misc/Makefile.in @@ -494,6 +494,7 @@ FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ +Fortran_COMPILER_ID = @Fortran_COMPILER_ID@ GREP = @GREP@ H5CONFIG_F_IKIND = @H5CONFIG_F_IKIND@ H5CONFIG_F_NUM_IKIND = @H5CONFIG_F_NUM_IKIND@ diff --git a/tools/perform/Makefile.in b/tools/perform/Makefile.in index 292a65b..dbac43e 100644 --- a/tools/perform/Makefile.in +++ b/tools/perform/Makefile.in @@ -498,6 +498,7 @@ FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ +Fortran_COMPILER_ID = @Fortran_COMPILER_ID@ GREP = @GREP@ H5CONFIG_F_IKIND = @H5CONFIG_F_IKIND@ H5CONFIG_F_NUM_IKIND = @H5CONFIG_F_NUM_IKIND@ -- cgit v0.12 From c226e58005f54b29dc9fc5f762f7aa6382e790ff Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Mon, 31 Aug 2015 14:04:23 -0500 Subject: [svn-r27626] Various minor warning fixes before major SWMR and VDS merges. gcc 4.9.2 was used to create the warning list - implicit casts - shadowed variables - various enum issues - other minor fixes (comments, unused macros, etc.) Tested on: h5committest --- src/H5FDstdio.c | 42 ++++---- src/H5Fsuper.c | 10 +- src/H5PL.c | 2 + src/H5Tfixed.c | 16 +-- src/H5Topaque.c | 20 ++-- src/H5Tpad.c | 18 ++-- src/H5Tprecis.c | 32 ++++-- src/H5Tstrpad.c | 16 +-- src/H5Tvisit.c | 13 +++ src/H5Tvlen.c | 26 ++++- src/H5Znbit.c | 123 +++++++++++++++++++--- src/H5Zscaleoffset.c | 2 + src/H5Ztrans.c | 201 +++++++++++++++++++---------------- test/dsets.c | 2 +- test/earray.c | 4 +- test/farray.c | 8 +- test/fheap.c | 12 +-- test/fillval.c | 2 +- test/gen_udlinks.c | 4 + test/tattr.c | 12 +-- test/tfile.c | 110 ++++++++++--------- test/tgenprop.c | 82 +++++++-------- test/th5s.c | 2 +- test/tmisc.c | 42 ++++---- test/ttst.c | 6 +- test/tvltypes.c | 52 +++++---- tools/h5diff/h5diffgentest.c | 10 +- tools/h5dump/h5dump.c | 4 +- tools/h5dump/h5dump.h | 19 ++-- tools/h5dump/h5dump_ddl.c | 17 +++ tools/h5dump/h5dump_xml.c | 245 ++++++++++++++++++++++++++----------------- tools/h5jam/h5jamgentest.c | 2 +- tools/h5ls/h5ls.c | 5 +- tools/lib/h5diff_array.c | 40 +++---- tools/lib/h5diff_dset.c | 47 ++++----- tools/lib/h5diff_util.c | 49 ++++++--- tools/lib/h5tools.c | 16 ++- tools/lib/h5tools_dump.c | 8 +- tools/lib/h5tools_ref.c | 4 +- tools/lib/h5tools_str.c | 14 ++- tools/lib/h5tools_type.c | 193 +++++++++++++++++----------------- tools/lib/h5tools_utils.c | 3 + tools/lib/io_timer.c | 12 ++- tools/misc/h5debug.c | 12 ++- tools/misc/h5mkgrp.c | 2 +- tools/misc/h5repart.c | 10 +- tools/perform/chunk.c | 6 +- tools/perform/overhead.c | 2 +- tools/perform/sio_engine.c | 2 +- tools/perform/sio_perf.c | 20 ++-- 50 files changed, 948 insertions(+), 653 deletions(-) diff --git a/src/H5FDstdio.c b/src/H5FDstdio.c index 65b75a3..686e1fc 100644 --- a/src/H5FDstdio.c +++ b/src/H5FDstdio.c @@ -43,17 +43,7 @@ #include #include -/* This is not defined in the Windows header files */ -#ifndef F_OK -#define F_OK 00 -#endif - -#endif - -#ifdef MAX -#undef MAX -#endif /* MAX */ -#define MAX(X,Y) ((X)>(Y)?(X):(Y)) +#endif /* H5_HAVE_WIN32_API */ /* The driver identification number, initialized at runtime */ static hid_t H5FD_STDIO_g = 0; @@ -331,7 +321,7 @@ H5Pset_fapl_stdio(hid_t fapl_id) *------------------------------------------------------------------------- */ static H5FD_t * -H5FD_stdio_open( const char *name, unsigned flags, hid_t fapl_id, +H5FD_stdio_open( const char *name, unsigned flags, hid_t /*UNUSED*/ fapl_id, haddr_t maxaddr) { FILE *f = NULL; @@ -556,7 +546,7 @@ H5FD_stdio_cmp(const H5FD_t *_f1, const H5FD_t *_f2) *------------------------------------------------------------------------- */ static herr_t -H5FD_stdio_query(const H5FD_t *_f, unsigned long *flags /* out */) +H5FD_stdio_query(const H5FD_t *_f, unsigned long /*OUT*/ *flags) { /* Quiet the compiler */ _f=_f; @@ -593,7 +583,7 @@ H5FD_stdio_query(const H5FD_t *_f, unsigned long *flags /* out */) *------------------------------------------------------------------------- */ static haddr_t -H5FD_stdio_alloc(H5FD_t *_file, H5FD_mem_t /*H5_ATTR_UNUSED*/ type, hid_t /*H5_ATTR_UNUSED*/ dxpl_id, hsize_t size) +H5FD_stdio_alloc(H5FD_t *_file, H5FD_mem_t /*UNUSED*/ type, hid_t /*UNUSED*/ dxpl_id, hsize_t size) { H5FD_stdio_t *file = (H5FD_stdio_t*)_file; haddr_t addr; @@ -638,7 +628,7 @@ H5FD_stdio_alloc(H5FD_t *_file, H5FD_mem_t /*H5_ATTR_UNUSED*/ type, hid_t /*H5_A *------------------------------------------------------------------------- */ static haddr_t -H5FD_stdio_get_eoa(const H5FD_t *_file, H5FD_mem_t /*H5_ATTR_UNUSED*/ type) +H5FD_stdio_get_eoa(const H5FD_t *_file, H5FD_mem_t /*UNUSED*/ type) { const H5FD_stdio_t *file = (const H5FD_stdio_t *)_file; @@ -669,7 +659,7 @@ H5FD_stdio_get_eoa(const H5FD_t *_file, H5FD_mem_t /*H5_ATTR_UNUSED*/ type) *------------------------------------------------------------------------- */ static herr_t -H5FD_stdio_set_eoa(H5FD_t *_file, H5FD_mem_t /*H5_ATTR_UNUSED*/ type, haddr_t addr) +H5FD_stdio_set_eoa(H5FD_t *_file, H5FD_mem_t /*UNUSED*/ type, haddr_t addr) { H5FD_stdio_t *file = (H5FD_stdio_t*)_file; @@ -704,10 +694,13 @@ H5FD_stdio_set_eoa(H5FD_t *_file, H5FD_mem_t /*H5_ATTR_UNUSED*/ type, haddr_t ad *------------------------------------------------------------------------- */ static haddr_t -H5FD_stdio_get_eof(const H5FD_t *_file, H5FD_mem_t /*H5_ATTR_UNUSED*/ type) +H5FD_stdio_get_eof(const H5FD_t *_file, H5FD_mem_t /*UNUSED*/ type) { const H5FD_stdio_t *file = (const H5FD_stdio_t *)_file; + /* Quiet the compiler */ + type = type; + /* Clear the error stack */ H5Eclear2(H5E_DEFAULT); @@ -728,7 +721,7 @@ H5FD_stdio_get_eof(const H5FD_t *_file, H5FD_mem_t /*H5_ATTR_UNUSED*/ type) *------------------------------------------------------------------------- */ static herr_t -H5FD_stdio_get_handle(H5FD_t *_file, hid_t fapl, void** file_handle) +H5FD_stdio_get_handle(H5FD_t *_file, hid_t /*UNUSED*/ fapl, void **file_handle) { H5FD_stdio_t *file = (H5FD_stdio_t *)_file; static const char *func = "H5FD_stdio_get_handle"; /* Function Name for error reporting */ @@ -766,8 +759,8 @@ H5FD_stdio_get_handle(H5FD_t *_file, hid_t fapl, void** file_handle) *------------------------------------------------------------------------- */ static herr_t -H5FD_stdio_read(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t size, - void *buf/*out*/) +H5FD_stdio_read(H5FD_t *_file, H5FD_mem_t /*UNUSED*/ type, hid_t /*UNUSED*/ dxpl_id, + haddr_t addr, size_t size, void /*OUT*/ *buf) { H5FD_stdio_t *file = (H5FD_stdio_t*)_file; static const char *func = "H5FD_stdio_read"; /* Function Name for error reporting */ @@ -871,8 +864,8 @@ H5FD_stdio_read(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, siz *------------------------------------------------------------------------- */ static herr_t -H5FD_stdio_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, - size_t size, const void *buf) +H5FD_stdio_write(H5FD_t *_file, H5FD_mem_t /*UNUSED*/ type, hid_t /*UNUSED*/ dxpl_id, + haddr_t addr, size_t size, const void *buf) { H5FD_stdio_t *file = (H5FD_stdio_t*)_file; static const char *func = "H5FD_stdio_write"; /* Function Name for error reporting */ @@ -961,7 +954,7 @@ H5FD_stdio_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, *------------------------------------------------------------------------- */ static herr_t -H5FD_stdio_flush(H5FD_t *_file, hid_t dxpl_id, unsigned closing) +H5FD_stdio_flush(H5FD_t *_file, hid_t /*UNUSED*/ dxpl_id, unsigned closing) { H5FD_stdio_t *file = (H5FD_stdio_t*)_file; static const char *func = "H5FD_stdio_flush"; /* Function Name for error reporting */ @@ -1006,7 +999,8 @@ H5FD_stdio_flush(H5FD_t *_file, hid_t dxpl_id, unsigned closing) *------------------------------------------------------------------------- */ static herr_t -H5FD_stdio_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing) +H5FD_stdio_truncate(H5FD_t *_file, hid_t /*UNUSED*/ dxpl_id, + hbool_t /*UNUSED*/ closing) { H5FD_stdio_t *file = (H5FD_stdio_t*)_file; static const char *func = "H5FD_stdio_truncate"; /* Function Name for error reporting */ diff --git a/src/H5Fsuper.c b/src/H5Fsuper.c index e83330d..ce3f2ea 100644 --- a/src/H5Fsuper.c +++ b/src/H5Fsuper.c @@ -914,20 +914,20 @@ H5F__super_init(H5F_t *f, hid_t dxpl_id) /* Check for driver info to store */ if(driver_size > 0) { - H5O_drvinfo_t drvinfo; /* Driver info */ + H5O_drvinfo_t info; /* Driver info */ uint8_t dbuf[H5F_MAX_DRVINFOBLOCK_SIZE]; /* Driver info block encoding buffer */ /* Sanity check */ HDassert(driver_size <= H5F_MAX_DRVINFOBLOCK_SIZE); /* Encode driver-specific data */ - if(H5FD_sb_encode(f->shared->lf, drvinfo.name, dbuf) < 0) + if(H5FD_sb_encode(f->shared->lf, info.name, dbuf) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "unable to encode driver information") /* Write driver info information to the superblock extension */ - drvinfo.len = driver_size; - drvinfo.buf = dbuf; - if(H5O_msg_create(&ext_loc, H5O_DRVINFO_ID, H5O_MSG_FLAG_DONTSHARE, H5O_UPDATE_TIME, &drvinfo, dxpl_id) < 0) + info.len = driver_size; + info.buf = dbuf; + if(H5O_msg_create(&ext_loc, H5O_DRVINFO_ID, H5O_MSG_FLAG_DONTSHARE, H5O_UPDATE_TIME, &info, dxpl_id) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "unable to update driver info header message") } /* end if */ diff --git a/src/H5PL.c b/src/H5PL.c index f4cd3e7..bfe79aa 100644 --- a/src/H5PL.c +++ b/src/H5PL.c @@ -329,6 +329,8 @@ H5PL_load(H5PL_type_t type, int id) if((H5PL_plugin_g & H5PL_FILTER_PLUGIN) == 0) HGOTO_ERROR(H5E_PLUGIN, H5E_CANTLOAD, NULL, "required dynamically loaded plugin filter '%d' is not available", id) break; + case H5PL_TYPE_ERROR: + case H5PL_TYPE_NONE: default: HGOTO_ERROR(H5E_PLUGIN, H5E_CANTLOAD, NULL, "required dynamically loaded plugin '%d' is not valid", id) } diff --git a/src/H5Tfixed.c b/src/H5Tfixed.c index b2401d4..daa7886 100644 --- a/src/H5Tfixed.c +++ b/src/H5Tfixed.c @@ -79,8 +79,8 @@ H5Tget_sign(hid_t type_id) H5TRACE1("Ts", "i", type_id); /* Check args */ - if (NULL == (dt = H5I_object_verify(type_id,H5I_DATATYPE))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5T_SGN_ERROR, "not an integer datatype") + if (NULL == (dt = (H5T_t *)H5I_object_verify(type_id,H5I_DATATYPE))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5T_SGN_ERROR, "not an integer datatype") ret_value = H5T_get_sign(dt); @@ -158,18 +158,18 @@ H5Tset_sign(hid_t type_id, H5T_sign_t sign) H5TRACE2("e", "iTs", type_id, sign); /* Check args */ - if (NULL == (dt = H5I_object_verify(type_id,H5I_DATATYPE))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an integer datatype") + if (NULL == (dt = (H5T_t *)H5I_object_verify(type_id,H5I_DATATYPE))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an integer datatype") if (H5T_STATE_TRANSIENT!=dt->shared->state) - HGOTO_ERROR(H5E_ARGS, H5E_CANTINIT, FAIL, "datatype is read-only") + HGOTO_ERROR(H5E_ARGS, H5E_CANTINIT, FAIL, "datatype is read-only") if (sign < H5T_SGN_NONE || sign >= H5T_NSGN) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "illegal sign type") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "illegal sign type") if (H5T_ENUM==dt->shared->type && dt->shared->u.enumer.nmembs>0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "operation not allowed after members are defined") + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "operation not allowed after members are defined") while (dt->shared->parent) dt = dt->shared->parent; /*defer to parent*/ if (H5T_INTEGER!=dt->shared->type) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "operation not defined for datatype class") + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "operation not defined for datatype class") /* Commit */ dt->shared->u.atomic.u.i.sign = sign; diff --git a/src/H5Topaque.c b/src/H5Topaque.c index e93bf65..f37d14b 100644 --- a/src/H5Topaque.c +++ b/src/H5Topaque.c @@ -77,18 +77,18 @@ H5Tset_tag(hid_t type_id, const char *tag) H5TRACE2("e", "i*s", type_id, tag); /* Check args */ - if (NULL == (dt = H5I_object_verify(type_id,H5I_DATATYPE))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type") + if (NULL == (dt = (H5T_t *)H5I_object_verify(type_id,H5I_DATATYPE))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type") if (H5T_STATE_TRANSIENT!=dt->shared->state) - HGOTO_ERROR(H5E_ARGS, H5E_CANTINIT, FAIL, "data type is read-only") + HGOTO_ERROR(H5E_ARGS, H5E_CANTINIT, FAIL, "data type is read-only") while (dt->shared->parent) dt = dt->shared->parent; /*defer to parent*/ if (H5T_OPAQUE!=dt->shared->type) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an opaque data type") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an opaque data type") if (!tag) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no tag") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no tag") if (HDstrlen(tag) >= H5T_OPAQUE_TAG_MAX) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "tag too long") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "tag too long") /* Commit */ H5MM_xfree(dt->shared->u.opaque.tag); @@ -124,16 +124,16 @@ H5Tget_tag(hid_t type_id) H5TRACE1("*s", "i", type_id); /* Check args */ - if (NULL == (dt = H5I_object_verify(type_id,H5I_DATATYPE))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a data type") + if (NULL == (dt = (H5T_t *)H5I_object_verify(type_id,H5I_DATATYPE))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a data type") while (dt->shared->parent) dt = dt->shared->parent; /*defer to parent*/ if (H5T_OPAQUE != dt->shared->type) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "operation not defined for data type class") + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "operation not defined for data type class") /* result */ if (NULL==(ret_value=H5MM_strdup(dt->shared->u.opaque.tag))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") done: FUNC_LEAVE_API(ret_value) diff --git a/src/H5Tpad.c b/src/H5Tpad.c index 88a5e13..38de494 100644 --- a/src/H5Tpad.c +++ b/src/H5Tpad.c @@ -80,12 +80,12 @@ H5Tget_pad(hid_t type_id, H5T_pad_t *lsb/*out*/, H5T_pad_t *msb/*out*/) H5TRACE3("e", "ixx", type_id, lsb, msb); /* Check args */ - if (NULL == (dt = H5I_object_verify(type_id,H5I_DATATYPE))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type") + if (NULL == (dt = (H5T_t *)H5I_object_verify(type_id,H5I_DATATYPE))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type") while (dt->shared->parent) dt = dt->shared->parent; /*defer to parent*/ if (!H5T_IS_ATOMIC(dt->shared)) - HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "operation not defined for specified data type") + HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "operation not defined for specified data type") /* Get values */ if (lsb) @@ -124,18 +124,18 @@ H5Tset_pad(hid_t type_id, H5T_pad_t lsb, H5T_pad_t msb) H5TRACE3("e", "iTpTp", type_id, lsb, msb); /* Check args */ - if (NULL == (dt = H5I_object_verify(type_id,H5I_DATATYPE))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type") + if (NULL == (dt = (H5T_t *)H5I_object_verify(type_id,H5I_DATATYPE))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type") if (H5T_STATE_TRANSIENT!=dt->shared->state) - HGOTO_ERROR(H5E_ARGS, H5E_CANTINIT, FAIL, "data type is read-only") + HGOTO_ERROR(H5E_ARGS, H5E_CANTINIT, FAIL, "data type is read-only") if (lsb < H5T_PAD_ZERO || lsb >= H5T_NPAD || msb < H5T_PAD_ZERO || msb >= H5T_NPAD) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid pad type") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid pad type") if (H5T_ENUM==dt->shared->type && dt->shared->u.enumer.nmembs>0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "operation not allowed after members are defined") + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "operation not allowed after members are defined") while (dt->shared->parent) dt = dt->shared->parent; /*defer to parent*/ if (!H5T_IS_ATOMIC(dt->shared)) - HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "operation not defined for specified data type") + HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "operation not defined for specified data type") /* Commit */ dt->shared->u.atomic.lsb_pad = lsb; diff --git a/src/H5Tprecis.c b/src/H5Tprecis.c index b3975af..73a4e32 100644 --- a/src/H5Tprecis.c +++ b/src/H5Tprecis.c @@ -87,12 +87,12 @@ H5Tget_precision(hid_t type_id) H5TRACE1("z", "i", type_id); /* Check args */ - if (NULL == (dt = H5I_object_verify(type_id,H5I_DATATYPE))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, 0, "not a datatype") + if (NULL == (dt = (H5T_t *)H5I_object_verify(type_id,H5I_DATATYPE))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, 0, "not a datatype") /* Get precision */ if((ret_value = H5T_get_precision(dt)) == 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, 0, "cant't get precision for specified datatype") + HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, 0, "cant't get precision for specified datatype") done: FUNC_LEAVE_API(ret_value) @@ -176,22 +176,22 @@ H5Tset_precision(hid_t type_id, size_t prec) H5TRACE2("e", "iz", type_id, prec); /* Check args */ - if (NULL == (dt = H5I_object_verify(type_id,H5I_DATATYPE))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") + if (NULL == (dt = (H5T_t *)H5I_object_verify(type_id,H5I_DATATYPE))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") if (H5T_STATE_TRANSIENT!=dt->shared->state) - HGOTO_ERROR(H5E_ARGS, H5E_CANTSET, FAIL, "datatype is read-only") + HGOTO_ERROR(H5E_ARGS, H5E_CANTSET, FAIL, "datatype is read-only") if (prec == 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "precision must be positive") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "precision must be positive") if (H5T_ENUM==dt->shared->type && dt->shared->u.enumer.nmembs>0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "operation not allowed after members are defined") + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "operation not allowed after members are defined") if (H5T_STRING==dt->shared->type) HGOTO_ERROR(H5E_ARGS, H5E_UNSUPPORTED, FAIL, "precision for this type is read-only") if (H5T_COMPOUND==dt->shared->type || H5T_OPAQUE==dt->shared->type) - HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "operation not defined for specified datatype") + HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "operation not defined for specified datatype") /* Do the work */ if (H5T_set_precision(dt, prec)<0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "unable to set precision") + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "unable to set precision") done: FUNC_LEAVE_API(ret_value) @@ -283,9 +283,19 @@ H5T_set_precision(const H5T_t *dt, size_t prec) dt->shared->u.atomic.u.f.mpos + dt->shared->u.atomic.u.f.msize > prec+offset) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "adjust sign, mantissa, and exponent fields first") break; + + case H5T_NO_CLASS: + case H5T_STRING: + case H5T_OPAQUE: + case H5T_COMPOUND: + case H5T_REFERENCE: + case H5T_ENUM: + case H5T_VLEN: + case H5T_ARRAY: + case H5T_NCLASSES: default: HGOTO_ERROR(H5E_ARGS, H5E_UNSUPPORTED, FAIL, "operation not defined for datatype class") - } /* end switch */ /*lint !e788 All appropriate cases are covered */ + } /* end switch */ /* Commit */ dt->shared->size = size; diff --git a/src/H5Tstrpad.c b/src/H5Tstrpad.c index e8ac4f5..c71827b 100644 --- a/src/H5Tstrpad.c +++ b/src/H5Tstrpad.c @@ -83,12 +83,12 @@ H5Tget_strpad(hid_t type_id) H5TRACE1("Tz", "i", type_id); /* Check args */ - if (NULL == (dt = H5I_object_verify(type_id,H5I_DATATYPE))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5T_STR_ERROR, "not a datatype") + if (NULL == (dt = (H5T_t *)H5I_object_verify(type_id,H5I_DATATYPE))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5T_STR_ERROR, "not a datatype") while (dt->shared->parent && !H5T_IS_STRING(dt->shared)) dt = dt->shared->parent; /*defer to parent*/ if (!H5T_IS_STRING(dt->shared)) - HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, H5T_STR_ERROR, "operation not defined for datatype class") + HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, H5T_STR_ERROR, "operation not defined for datatype class") /* result */ if(H5T_IS_FIXED_STRING(dt->shared)) @@ -140,16 +140,16 @@ H5Tset_strpad(hid_t type_id, H5T_str_t strpad) H5TRACE2("e", "iTz", type_id, strpad); /* Check args */ - if (NULL == (dt = H5I_object_verify(type_id,H5I_DATATYPE))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") + if (NULL == (dt = (H5T_t *)H5I_object_verify(type_id,H5I_DATATYPE))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") if (H5T_STATE_TRANSIENT!=dt->shared->state) - HGOTO_ERROR(H5E_ARGS, H5E_CANTINIT, FAIL, "datatype is read-only") + HGOTO_ERROR(H5E_ARGS, H5E_CANTINIT, FAIL, "datatype is read-only") if (strpad < H5T_STR_NULLTERM || strpad >= H5T_NSTR) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "illegal string pad type") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "illegal string pad type") while (dt->shared->parent && !H5T_IS_STRING(dt->shared)) dt = dt->shared->parent; /*defer to parent*/ if (!H5T_IS_STRING(dt->shared)) - HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "operation not defined for datatype class") + HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "operation not defined for datatype class") /* Commit */ if(H5T_IS_FIXED_STRING(dt->shared)) diff --git a/src/H5Tvisit.c b/src/H5Tvisit.c index 68cabda..4ede3f3 100644 --- a/src/H5Tvisit.c +++ b/src/H5Tvisit.c @@ -136,6 +136,19 @@ H5T__visit(H5T_t *dt, unsigned visit_flags, H5T_operator_t op, void *op_value) HGOTO_ERROR(H5E_DATATYPE, H5E_BADITER, FAIL, "can't visit parent datatype") break; + case H5T_NO_CLASS: + case H5T_NCLASSES: + /* Not real values */ + HGOTO_ERROR(H5E_ARGS, H5E_UNSUPPORTED, FAIL, "operation not defined for datatype class") + break; + + case H5T_INTEGER: + case H5T_FLOAT: + case H5T_TIME: + case H5T_STRING: + case H5T_BITFIELD: + case H5T_OPAQUE: + case H5T_REFERENCE: default: /* Visit "simple" datatypes here */ if(visit_flags & H5T_VISIT_SIMPLE) diff --git a/src/H5Tvlen.c b/src/H5Tvlen.c index 4ee3d0d..64337b8 100644 --- a/src/H5Tvlen.c +++ b/src/H5Tvlen.c @@ -113,7 +113,7 @@ H5Tvlen_create(hid_t base_id) H5TRACE1("i", "i", base_id); /* Check args */ - if(NULL == (base = H5I_object_verify(base_id, H5I_DATATYPE))) + if(NULL == (base = (H5T_t *)H5I_object_verify(base_id, H5I_DATATYPE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an valid base datatype") /* Create up VL datatype */ @@ -288,6 +288,8 @@ H5T__vlen_set_loc(const H5T_t *dt, H5F_t *f, H5T_loc_t loc) */ break; + case H5T_LOC_MAXLOC: + /* MAXLOC is invalid */ default: HGOTO_ERROR(H5E_DATATYPE, H5E_BADRANGE, FAIL, "invalid VL datatype location") } /* end switch */ /*lint !e788 All appropriate cases are covered */ @@ -716,11 +718,11 @@ H5T_vlen_str_mem_write(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, co /* Use the user's memory allocation routine if one is defined */ if(vl_alloc_info->alloc_func!=NULL) { - if(NULL==(t=(vl_alloc_info->alloc_func)((seq_len+1)*base_size,vl_alloc_info->alloc_info))) + if(NULL==(t = (char *)(vl_alloc_info->alloc_func)((seq_len+1)*base_size,vl_alloc_info->alloc_info))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for VL data") } /* end if */ else { /* Default to system malloc */ - if(NULL==(t=H5MM_malloc((seq_len+1)*base_size))) + if(NULL==(t = (char *)H5MM_malloc((seq_len+1)*base_size))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for VL data") } /* end else */ @@ -1119,8 +1121,24 @@ H5T_vlen_reclaim_recurse(void *elem, const H5T_t *dt, H5MM_free_t free_func, voi } /* end else */ break; + /* Don't do anything for simple types */ + case H5T_INTEGER: + case H5T_FLOAT: + case H5T_TIME: + case H5T_STRING: + case H5T_BITFIELD: + case H5T_OPAQUE: + case H5T_REFERENCE: + case H5T_ENUM: + break; + + /* Should never have these values */ + case H5T_NO_CLASS: + case H5T_NCLASSES: default: + HGOTO_ERROR(H5E_DATATYPE, H5E_BADRANGE, FAIL, "invalid VL datatype class") break; + } /* end switch */ /*lint !e788 All appropriate cases are covered */ done: @@ -1167,7 +1185,7 @@ H5T_vlen_reclaim(void *elem, hid_t type_id, unsigned H5_ATTR_UNUSED ndim, const HDassert(H5I_DATATYPE == H5I_get_type(type_id)); /* Check args */ - if(NULL == (dt = H5I_object_verify(type_id, H5I_DATATYPE))) + if(NULL == (dt = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") /* Pull the free function and free info pointer out of the op_data and call the recurse datatype free function */ diff --git a/src/H5Znbit.c b/src/H5Znbit.c index 38610b6..479cd6c 100644 --- a/src/H5Znbit.c +++ b/src/H5Znbit.c @@ -266,9 +266,23 @@ H5Z_calc_parms_array(const H5T_t *type) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "nbit cannot compute parameters for datatype") break; - default: /* Other datatype class: nbit does no compression */ + case H5T_TIME: + case H5T_STRING: + case H5T_BITFIELD: + case H5T_OPAQUE: + case H5T_REFERENCE: + case H5T_ENUM: + case H5T_VLEN: + /* Other datatype classes: nbit does no compression */ H5Z_calc_parms_nooptype(); break; + + case H5T_NO_CLASS: + case H5T_NCLASSES: + default: + /* Badness */ + HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "nbit received bad datatype") + break; } /* end switch */ done: @@ -351,9 +365,23 @@ H5Z_calc_parms_compound(const H5T_t *type) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "nbit cannot compute parameters for datatype") break; - default: /* Other datatype class: nbit does no compression */ + case H5T_TIME: + case H5T_STRING: + case H5T_BITFIELD: + case H5T_OPAQUE: + case H5T_REFERENCE: + case H5T_ENUM: + case H5T_VLEN: + /* Other datatype classes: nbit does no compression */ H5Z_calc_parms_nooptype(); break; + + case H5T_NO_CLASS: + case H5T_NCLASSES: + default: + /* Badness */ + HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "nbit received bad datatype") + break; } /* end switch */ /* Close member datatype */ @@ -444,7 +472,7 @@ H5Z_set_parms_atomic(const H5T_t *type, unsigned cd_values[]) /* Get datatype's size */ if((dtype_size = H5T_get_size(type)) == 0) - HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "bad datatype size") + HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "bad datatype size") /* Set "local" parameter for datatype size */ cd_values[cd_values_index++] = dtype_size; @@ -463,6 +491,10 @@ H5Z_set_parms_atomic(const H5T_t *type, unsigned cd_values[]) cd_values[cd_values_index++] = H5Z_NBIT_ORDER_BE; break; + case H5T_ORDER_VAX: + case H5T_ORDER_MIXED: + case H5T_ORDER_ERROR: + case H5T_ORDER_NONE: default: HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "bad datatype endianness order") } /* end switch */ @@ -561,7 +593,7 @@ H5Z_set_parms_array(const H5T_t *type, unsigned cd_values[]) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "nbit cannot set parameters for datatype") break; - default: /* other datatype that nbit does no compression */ + case H5T_VLEN: /* Check if base datatype is a variable-length string */ if((is_vlstring = H5T_is_variable_str(dtype_base)) < 0) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "cannot determine if datatype is a variable-length string") @@ -573,6 +605,23 @@ H5Z_set_parms_array(const H5T_t *type, unsigned cd_values[]) if(H5Z_set_parms_nooptype(dtype_base, cd_values) == FAIL) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "nbit cannot set parameters for datatype") break; + + case H5T_TIME: + case H5T_STRING: + case H5T_BITFIELD: + case H5T_OPAQUE: + case H5T_REFERENCE: + case H5T_ENUM: + if(H5Z_set_parms_nooptype(dtype_base, cd_values) == FAIL) + HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "nbit cannot set parameters for datatype") + break; + + case H5T_NO_CLASS: + case H5T_NCLASSES: + default: + /* Badness */ + HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "nbit received bad datatype") + break; } /* end switch */ done: @@ -666,16 +715,16 @@ H5Z_set_parms_compound(const H5T_t *type, unsigned cd_values[]) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "nbit cannot set parameters for datatype") break; - default: /* other datatype that nbit does no compression */ + case H5T_VLEN: /* Check if datatype is a variable-length string */ if((is_vlstring = H5T_is_variable_str(dtype_member)) < 0) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "cannot determine if datatype is a variable-length string") /* Because for some no-op datatype (VL datatype and VL string datatype), its - * size can not be retrieved correctly by using function call H5T_get_size, - * special handling is needed for getting the size. Here the difference between + * size can not be retrieved correctly by using function call H5T_get_size, + * special handling is needed for getting the size. Here the difference between * adjacent member offset is used (if alignment is present, the result can be - * larger, but it does not affect the nbit filter's correctness). + * larger, but it does not affect the nbit filter's correctness). */ if(dtype_member_class == H5T_VLEN || is_vlstring) { /* Set datatype class code */ @@ -688,9 +737,25 @@ H5Z_set_parms_compound(const H5T_t *type, unsigned cd_values[]) /* Set "local" parameter for datatype size */ cd_values[cd_values_index++] = dtype_next_member_offset - dtype_member_offset; - } else - if(H5Z_set_parms_nooptype(dtype_member, cd_values)==FAIL) - HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "nbit cannot set parameters for datatype") + } + break; + + case H5T_TIME: + case H5T_STRING: + case H5T_BITFIELD: + case H5T_OPAQUE: + case H5T_REFERENCE: + case H5T_ENUM: + /* other datatype that nbit does no compression */ + if(H5Z_set_parms_nooptype(dtype_member, cd_values) == FAIL) + HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "nbit cannot set parameters for datatype") + break; + + case H5T_NO_CLASS: + case H5T_NCLASSES: + default: + /* Badness */ + HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "nbit was passed bad datatype") break; } /* end switch */ @@ -770,8 +835,22 @@ H5Z_set_local_nbit(hid_t dcpl_id, hid_t type_id, hid_t space_id) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "nbit cannot compute parameters for datatype") break; - default: /* no need to calculate other datatypes at top level */ - break; + case H5T_TIME: + case H5T_STRING: + case H5T_BITFIELD: + case H5T_OPAQUE: + case H5T_REFERENCE: + case H5T_ENUM: + case H5T_VLEN: + /* No need to calculate other datatypes at top level */ + break; + + case H5T_NO_CLASS: + case H5T_NCLASSES: + default: + /* Badness */ + HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "nbit received bad datatype") + break; } /* end switch */ /* Check if the number of parameters exceed what cd_values[] can store */ @@ -826,8 +905,22 @@ H5Z_set_local_nbit(hid_t dcpl_id, hid_t type_id, hid_t space_id) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "nbit cannot set parameters for datatype") break; - default: /* no need to set parameters for other datatypes at top level */ - break; + case H5T_TIME: + case H5T_STRING: + case H5T_BITFIELD: + case H5T_OPAQUE: + case H5T_REFERENCE: + case H5T_ENUM: + case H5T_VLEN: + /* No need to set parameters for other datatypes at top level */ + break; + + case H5T_NO_CLASS: + case H5T_NCLASSES: + default: + /* Badness */ + HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "nbit received bad datatype") + break; } /* end switch */ /* Check if calculation of parameters matches with setting of parameters */ diff --git a/src/H5Zscaleoffset.c b/src/H5Zscaleoffset.c index 673b9e0..46dd3c1 100644 --- a/src/H5Zscaleoffset.c +++ b/src/H5Zscaleoffset.c @@ -977,6 +977,7 @@ H5Z_set_local_scaleoffset(hid_t dcpl_id, hid_t type_id, hid_t space_id) case H5T_ORDER_ERROR: case H5T_ORDER_VAX: + case H5T_ORDER_MIXED: case H5T_ORDER_NONE: default: HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "bad datatype endianness order") @@ -1075,6 +1076,7 @@ H5Z_filter_scaleoffset(unsigned flags, size_t cd_nelmts, const unsigned cd_value case H5T_ORDER_ERROR: case H5T_ORDER_VAX: + case H5T_ORDER_MIXED: case H5T_ORDER_NONE: default: HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, 0, "bad H5T_NATIVE_INT endianness order") diff --git a/src/H5Ztrans.c b/src/H5Ztrans.c index 7a94487..db61cc5 100644 --- a/src/H5Ztrans.c +++ b/src/H5Ztrans.c @@ -731,11 +731,20 @@ H5Z_parse_term(H5Z_token *current, H5Z_datval_ptrs* dat_val_pointers) case H5Z_XFORM_END: HGOTO_DONE(term) - default: + case H5Z_XFORM_INTEGER: + case H5Z_XFORM_FLOAT: + case H5Z_XFORM_SYMBOL: + case H5Z_XFORM_PLUS: + case H5Z_XFORM_MINUS: + case H5Z_XFORM_LPAREN: H5Z_unget_token(current); HGOTO_DONE(term) - } - } + + case H5Z_XFORM_ERROR: + default: + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "bad transform type passed to data transform expression") + } /* end switch */ + } /* end for */ done: FUNC_LEAVE_NOAPI(ret_value) @@ -773,112 +782,115 @@ H5Z_parse_factor(H5Z_token *current, H5Z_datval_ptrs* dat_val_pointers) current = H5Z_get_token(current); switch (current->tok_type) { - case H5Z_XFORM_INTEGER: - factor = H5Z_new_node(H5Z_XFORM_INTEGER); - - if (!factor) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "Unable to allocate new node") - sscanf(current->tok_begin, "%ld", &factor->value.int_val); - break; + case H5Z_XFORM_INTEGER: + factor = H5Z_new_node(H5Z_XFORM_INTEGER); - case H5Z_XFORM_FLOAT: - factor = H5Z_new_node(H5Z_XFORM_FLOAT); + if (!factor) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "Unable to allocate new node") + sscanf(current->tok_begin, "%ld", &factor->value.int_val); + break; - if (!factor) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "Unable to allocate new node") - sscanf(current->tok_begin, "%lf", &factor->value.float_val); - break; + case H5Z_XFORM_FLOAT: + factor = H5Z_new_node(H5Z_XFORM_FLOAT); - case H5Z_XFORM_SYMBOL: - factor = H5Z_new_node(H5Z_XFORM_SYMBOL); + if (!factor) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "Unable to allocate new node") + sscanf(current->tok_begin, "%lf", &factor->value.float_val); + break; - if (!factor) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "Unable to allocate new node") + case H5Z_XFORM_SYMBOL: + factor = H5Z_new_node(H5Z_XFORM_SYMBOL); - factor->value.dat_val = &(dat_val_pointers->ptr_dat_val[dat_val_pointers->num_ptrs]); - dat_val_pointers->num_ptrs++; - break; + if (!factor) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "Unable to allocate new node") - case H5Z_XFORM_LPAREN: - factor = H5Z_parse_expression(current, dat_val_pointers); + factor->value.dat_val = &(dat_val_pointers->ptr_dat_val[dat_val_pointers->num_ptrs]); + dat_val_pointers->num_ptrs++; + break; - if (!factor) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "Unable to allocate new node") + case H5Z_XFORM_LPAREN: + factor = H5Z_parse_expression(current, dat_val_pointers); - current = H5Z_get_token(current); + if (!factor) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "Unable to allocate new node") - if (current->tok_type != H5Z_XFORM_RPAREN) { - H5Z_xform_destroy_parse_tree(factor); - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "Syntax error in data transform expression") - } - break; + current = H5Z_get_token(current); - case H5Z_XFORM_RPAREN: - /* We shouldn't see a ) right now */ - H5Z_xform_destroy_parse_tree(factor); - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "Syntax error: unexpected ')' ") + if (current->tok_type != H5Z_XFORM_RPAREN) { + H5Z_xform_destroy_parse_tree(factor); + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "Syntax error in data transform expression") + } + break; - case H5Z_XFORM_PLUS: - /* unary + */ - new_node = H5Z_parse_factor(current, dat_val_pointers); + case H5Z_XFORM_RPAREN: + /* We shouldn't see a ) right now */ + H5Z_xform_destroy_parse_tree(factor); + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "Syntax error: unexpected ')' ") + + case H5Z_XFORM_PLUS: + /* unary + */ + new_node = H5Z_parse_factor(current, dat_val_pointers); + + if (new_node) { + if (new_node->type != H5Z_XFORM_INTEGER && new_node->type != H5Z_XFORM_FLOAT && + new_node->type != H5Z_XFORM_SYMBOL) { + H5Z_xform_destroy_parse_tree(new_node); + H5Z_xform_destroy_parse_tree(factor); + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "Error parsing data transform expression") + } - if (new_node) { - if (new_node->type != H5Z_XFORM_INTEGER && new_node->type != H5Z_XFORM_FLOAT && - new_node->type != H5Z_XFORM_SYMBOL) { - H5Z_xform_destroy_parse_tree(new_node); - H5Z_xform_destroy_parse_tree(factor); - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "Error parsing data transform expression") - } + factor = new_node; + new_node = H5Z_new_node(H5Z_XFORM_PLUS); - factor = new_node; - new_node = H5Z_new_node(H5Z_XFORM_PLUS); + if (!new_node) { + H5Z_xform_destroy_parse_tree(factor); + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "Error parsing data transform expression") + } - if (!new_node) { + new_node->rchild = factor; + factor = new_node; + } else { H5Z_xform_destroy_parse_tree(factor); HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "Error parsing data transform expression") } + break; - new_node->rchild = factor; - factor = new_node; - } else { - H5Z_xform_destroy_parse_tree(factor); - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "Error parsing data transform expression") - } - break; + case H5Z_XFORM_MINUS: + /* unary - */ + new_node = H5Z_parse_factor(current, dat_val_pointers); - case H5Z_XFORM_MINUS: - /* unary - */ - new_node = H5Z_parse_factor(current, dat_val_pointers); + if (new_node) { + if (new_node->type != H5Z_XFORM_INTEGER && new_node->type != H5Z_XFORM_FLOAT && + new_node->type != H5Z_XFORM_SYMBOL) { + H5Z_xform_destroy_parse_tree(new_node); + H5Z_xform_destroy_parse_tree(factor); + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "Error parsing data transform expression") + } - if (new_node) { - if (new_node->type != H5Z_XFORM_INTEGER && new_node->type != H5Z_XFORM_FLOAT && - new_node->type != H5Z_XFORM_SYMBOL) { - H5Z_xform_destroy_parse_tree(new_node); - H5Z_xform_destroy_parse_tree(factor); - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "Error parsing data transform expression") - } + factor = new_node; + new_node = H5Z_new_node(H5Z_XFORM_MINUS); - factor = new_node; - new_node = H5Z_new_node(H5Z_XFORM_MINUS); + if (!new_node) { + H5Z_xform_destroy_parse_tree(factor); + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "Error parsing data transform expression") + } - if (!new_node) { + new_node->rchild = factor; + factor = new_node; + } else { H5Z_xform_destroy_parse_tree(factor); HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "Error parsing data transform expression") } + break; - new_node->rchild = factor; - factor = new_node; - } else { - H5Z_xform_destroy_parse_tree(factor); - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "Error parsing data transform expression") - } - break; - - case H5Z_XFORM_END: - break; + case H5Z_XFORM_END: + break; - default: - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "Invalid token while parsing data transform expression") + case H5Z_XFORM_MULT: + case H5Z_XFORM_DIVIDE: + case H5Z_XFORM_ERROR: + default: + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "Invalid token while parsing data transform expression") } @@ -1091,23 +1103,30 @@ H5Z_xform_eval_full(H5Z_node *tree, const size_t array_size, const hid_t array_ switch (tree->type) { case H5Z_XFORM_PLUS: - H5Z_XFORM_TYPE_OP(resl, resr, array_type, +, array_size) - break; + H5Z_XFORM_TYPE_OP(resl, resr, array_type, +, array_size) + break; case H5Z_XFORM_MINUS: - H5Z_XFORM_TYPE_OP(resl, resr, array_type, -, array_size) - break; + H5Z_XFORM_TYPE_OP(resl, resr, array_type, -, array_size) + break; case H5Z_XFORM_MULT: - H5Z_XFORM_TYPE_OP(resl, resr, array_type, *, array_size) - break; + H5Z_XFORM_TYPE_OP(resl, resr, array_type, *, array_size) + break; case H5Z_XFORM_DIVIDE: - H5Z_XFORM_TYPE_OP(resl, resr, array_type, /, array_size) - break; + H5Z_XFORM_TYPE_OP(resl, resr, array_type, /, array_size) + break; + case H5Z_XFORM_ERROR: + case H5Z_XFORM_INTEGER: + case H5Z_XFORM_FLOAT: + case H5Z_XFORM_SYMBOL: + case H5Z_XFORM_LPAREN: + case H5Z_XFORM_RPAREN: + case H5Z_XFORM_END: default: - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Invalid expression tree") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Invalid expression tree") } /* end switch */ /* The result stores a pointer to the new data */ diff --git a/test/dsets.c b/test/dsets.c index e6b2ee4..136fec2 100644 --- a/test/dsets.c +++ b/test/dsets.c @@ -7567,7 +7567,7 @@ test_chunk_expand(hid_t fapl) if(TRUE != H5Zfilter_avail(H5Z_FILTER_EXPAND)) FAIL_STACK_ERROR /* Loop over storage allocation time */ - for(alloc_time = H5D_ALLOC_TIME_EARLY; alloc_time <= H5D_ALLOC_TIME_INCR; alloc_time++) { + for(alloc_time = H5D_ALLOC_TIME_EARLY; alloc_time <= H5D_ALLOC_TIME_INCR; H5_INC_ENUM(H5D_alloc_time_t, alloc_time)) { /* Create file */ if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR diff --git a/test/earray.c b/test/earray.c index feaa15e..b510992 100644 --- a/test/earray.c +++ b/test/earray.c @@ -2894,7 +2894,7 @@ main(void) init_cparam(&cparam); /* Iterate over the testing parameters */ - for(curr_test = EARRAY_TEST_NORMAL; curr_test < EARRAY_TEST_NTESTS; curr_test++) { + for(curr_test = EARRAY_TEST_NORMAL; curr_test < EARRAY_TEST_NTESTS; H5_INC_ENUM(earray_test_type_t, curr_test)) { /* Initialize the testing parameters */ init_tparam(&tparam, &cparam); @@ -2926,7 +2926,7 @@ main(void) nerrors += test_flush_depend(fapl, &cparam, &tparam); /* Iterate over the type of capacity tests */ - for(curr_iter = EARRAY_ITER_FW; curr_iter < EARRAY_ITER_NITERS; curr_iter++) { + for(curr_iter = EARRAY_ITER_FW; curr_iter < EARRAY_ITER_NITERS; H5_INC_ENUM(earray_iter_type_t, curr_iter)) { hsize_t sblk; /* Super block index */ hsize_t dblk; /* Data block index */ hsize_t nelmts; /* # of elements to test */ diff --git a/test/farray.c b/test/farray.c index 4c18916..43b63c6 100644 --- a/test/farray.c +++ b/test/farray.c @@ -1554,11 +1554,11 @@ main(void) } /* Iterate over the testing parameters */ - for(curr_test = FARRAY_TEST_NORMAL; curr_test < FARRAY_TEST_NTESTS; curr_test++) { + for(curr_test = FARRAY_TEST_NORMAL; curr_test < FARRAY_TEST_NTESTS; H5_INC_ENUM(farray_test_type_t, curr_test)) { /* Initialize the testing parameters */ - HDmemset(&tparam, 0, sizeof(tparam)); - tparam.nelmts = TEST_NELMTS; + HDmemset(&tparam, 0, sizeof(tparam)); + tparam.nelmts = TEST_NELMTS; /* Set appropriate testing parameters for each test */ switch(curr_test) { @@ -1589,7 +1589,7 @@ main(void) nerrors += test_delete_open(fapl, &cparam, &tparam); /* Iterate over the type of capacity tests */ - for(curr_iter = FARRAY_ITER_FW; curr_iter < FARRAY_ITER_NITERS; curr_iter++) { + for(curr_iter = FARRAY_ITER_FW; curr_iter < FARRAY_ITER_NITERS; H5_INC_ENUM(farray_iter_type_t, curr_iter)) { /* Set appropriate parameters for each type of iteration */ switch(curr_iter) { diff --git a/test/fheap.c b/test/fheap.c index c300028..bb30e05 100644 --- a/test/fheap.c +++ b/test/fheap.c @@ -16380,7 +16380,7 @@ main(void) /* Iterate over the testing parameters */ #ifndef QAK - for(curr_test = FHEAP_TEST_NORMAL; curr_test < FHEAP_TEST_NTESTS; curr_test++) { + for(curr_test = FHEAP_TEST_NORMAL; curr_test < FHEAP_TEST_NTESTS; H5_INC_ENUM(fheap_test_type_t, curr_test)) { #else /* QAK */ HDfprintf(stderr, "Uncomment test loop!\n"); curr_test = FHEAP_TEST_NORMAL; @@ -16430,7 +16430,7 @@ HDfprintf(stderr, "Uncomment tests!\n"); #ifndef QAK2 /* Filling with different sized objects */ - for(fill = FHEAP_TEST_FILL_LARGE; fill < FHEAP_TEST_FILL_N; fill++) { + for(fill = FHEAP_TEST_FILL_LARGE; fill < FHEAP_TEST_FILL_N; H5_INC_ENUM(fheap_test_fill_t, fill)) { #else /* QAK2 */ HDfprintf(stderr, "Uncomment test loop!\n"); fill = FHEAP_TEST_FILL_LARGE; @@ -16542,9 +16542,9 @@ HDfprintf(stderr, "Uncomment tests!\n"); fheap_test_del_drain_t drain_half; /* Deletion draining */ /* More complex removal patterns */ - for(del_dir = FHEAP_DEL_FORWARD; del_dir < FHEAP_DEL_NDIRS; del_dir++) { + for(del_dir = FHEAP_DEL_FORWARD; del_dir < FHEAP_DEL_NDIRS; H5_INC_ENUM(fheap_test_del_dir_t, del_dir)) { tparam.del_dir = del_dir; - for(drain_half = FHEAP_DEL_DRAIN_ALL; drain_half < FHEAP_DEL_DRAIN_N; drain_half++) { + for(drain_half = FHEAP_DEL_DRAIN_ALL; drain_half < FHEAP_DEL_DRAIN_N; H5_INC_ENUM(fheap_test_del_drain_t, drain_half)) { tparam.drain_half = drain_half; #else /* QAK2 */ HDfprintf(stderr, "Uncomment test loops!\n"); @@ -16683,7 +16683,7 @@ HDfprintf(stderr, "Uncomment tests!\n"); } /* end switch */ /* Try several different methods of deleting objects */ - for(del_dir = FHEAP_DEL_FORWARD; del_dir < FHEAP_DEL_NDIRS; del_dir++) { + for(del_dir = FHEAP_DEL_FORWARD; del_dir < FHEAP_DEL_NDIRS; H5_INC_ENUM(fheap_test_del_dir_t, del_dir)) { tparam.del_dir = del_dir; /* Test 'huge' object insert & delete */ @@ -16726,7 +16726,7 @@ HDfprintf(stderr, "Uncomment tests!\n"); { fheap_test_del_dir_t del_dir; /* Deletion direction */ - for(del_dir = FHEAP_DEL_FORWARD; del_dir < FHEAP_DEL_NDIRS; del_dir++) { + for(del_dir = FHEAP_DEL_FORWARD; del_dir < FHEAP_DEL_NDIRS; H5_INC_ENUM(fheap_test_del_dir_t, del_dir)) { tparam.del_dir = del_dir; /* Controlled tests */ diff --git a/test/fillval.c b/test/fillval.c index c791504..b7b2ff5 100644 --- a/test/fillval.c +++ b/test/fillval.c @@ -845,7 +845,7 @@ test_rdwr_cases(hid_t file, hid_t dcpl, const char *dname, void *_fillval, if(datatype==H5T_INTEGER) { /*check for overflow*/ HDassert((nelmts * sizeof(int)) == (hsize_t)((size_t)(nelmts * sizeof(int)))); - buf = HDmalloc((size_t)(nelmts * sizeof(int))); + buf = (int *)HDmalloc((size_t)(nelmts * sizeof(int))); if(H5Dread(dset1, H5T_NATIVE_INT, mspace, fspace, H5P_DEFAULT, buf) < 0) goto error; diff --git a/test/gen_udlinks.c b/test/gen_udlinks.c index a1312d2..fc044da 100644 --- a/test/gen_udlinks.c +++ b/test/gen_udlinks.c @@ -57,6 +57,10 @@ main (void) strcpy(filename1, NAME_BE_1); strcpy(filename2, NAME_BE_2); break; + case H5T_ORDER_ERROR: + case H5T_ORDER_VAX: + case H5T_ORDER_MIXED: + case H5T_ORDER_NONE: default: goto error; } diff --git a/test/tattr.c b/test/tattr.c index 137c7c9..6642cf1 100644 --- a/test/tattr.c +++ b/test/tattr.c @@ -5919,9 +5919,9 @@ test_attr_delete_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Pget_attr_phase_change"); /* Loop over operating on different indices on link fields */ - for(idx_type = H5_INDEX_NAME; idx_type <=H5_INDEX_CRT_ORDER; idx_type++) { + for(idx_type = H5_INDEX_NAME; idx_type <= H5_INDEX_CRT_ORDER; H5_INC_ENUM(H5_index_t, idx_type)) { /* Loop over operating in different orders */ - for(order = H5_ITER_INC; order <=H5_ITER_DEC; order++) { + for(order = H5_ITER_INC; order <= H5_ITER_DEC; H5_INC_ENUM(H5_iter_order_t, order)) { /* Loop over using index for creation order value */ for(use_index = FALSE; use_index <= TRUE; use_index++) { /* Print appropriate test message */ @@ -6868,9 +6868,9 @@ test_attr_iterate2(hbool_t new_format, hid_t fcpl, hid_t fapl) iter_info.visited = visited; /* Loop over operating on different indices on link fields */ - for(idx_type = H5_INDEX_NAME; idx_type <=H5_INDEX_CRT_ORDER; idx_type++) { + for(idx_type = H5_INDEX_NAME; idx_type <= H5_INDEX_CRT_ORDER; H5_INC_ENUM(H5_index_t, idx_type)) { /* Loop over operating in different orders */ - for(order = H5_ITER_INC; order <=H5_ITER_DEC; order++) { + for(order = H5_ITER_INC; order <= H5_ITER_DEC; H5_INC_ENUM(H5_iter_order_t, order)) { /* Loop over using index for creation order value */ for(use_index = FALSE; use_index <= TRUE; use_index++) { /* Print appropriate test message */ @@ -7223,9 +7223,9 @@ test_attr_open_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Pget_attr_phase_change"); /* Loop over operating on different indices on link fields */ - for(idx_type = H5_INDEX_NAME; idx_type <=H5_INDEX_CRT_ORDER; idx_type++) { + for(idx_type = H5_INDEX_NAME; idx_type <= H5_INDEX_CRT_ORDER; H5_INC_ENUM(H5_index_t, idx_type)) { /* Loop over operating in different orders */ - for(order = H5_ITER_INC; order <=H5_ITER_DEC; order++) { + for(order = H5_ITER_INC; order <= H5_ITER_DEC; H5_INC_ENUM(H5_iter_order_t, order)) { /* Loop over using index for creation order value */ for(use_index = FALSE; use_index <= TRUE; use_index++) { /* Print appropriate test message */ diff --git a/test/tfile.c b/test/tfile.c index 4913a15..33c947f 100644 --- a/test/tfile.c +++ b/test/tfile.c @@ -827,7 +827,9 @@ test_file_close(void) ret = H5Gclose(group_id3); CHECK(ret, FAIL, "H5Gclose"); break; - default: + + case H5F_CLOSE_DEFAULT: + default: CHECK(fc_degree, H5F_CLOSE_DEFAULT, "H5Pget_fclose_degree"); break; } @@ -1314,6 +1316,19 @@ test_obj_count_and_id(hid_t fid1, hid_t fid2, hid_t did, hid_t gid1, VERIFY(oid_list[i], did, "H5Fget_obj_ids"); break; + case H5I_UNINIT: + case H5I_BADID: + case H5I_DATATYPE: + case H5I_DATASPACE: + case H5I_ATTR: + case H5I_REFERENCE: + case H5I_VFL: + case H5I_GENPROP_CLS: + case H5I_GENPROP_LST: + case H5I_ERROR_CLASS: + case H5I_ERROR_MSG: + case H5I_ERROR_STACK: + case H5I_NTYPES: default: ERROR("H5Fget_obj_ids"); } /* end switch */ @@ -3079,67 +3094,68 @@ test_filespace_info(void) my_fapl = fapl; } /* end else */ - /* Test with different sized free space section threshold */ - for(fs_size = 0; fs_size <= TEST_THRESHOLD10; fs_size++) { + /* Test with different sized free space section threshold */ + for(fs_size = 0; fs_size <= TEST_THRESHOLD10; fs_size++) { - /* Test with different file space handling strategies */ - for(fs_type = 0; fs_type < H5F_FILE_SPACE_NTYPES; H5_INC_ENUM(H5F_file_space_type_t, fs_type)) { + /* Test with different file space handling strategies */ + for(fs_type = H5F_FILE_SPACE_DEFAULT; fs_type < H5F_FILE_SPACE_NTYPES; H5_INC_ENUM(H5F_file_space_type_t, fs_type)) { - /* Get a copy of the default file creation property */ - fcpl1 = H5Pcopy(fcpl); - CHECK(fcpl1, FAIL, "H5Pcopy"); + /* Get a copy of the default file creation property */ + fcpl1 = H5Pcopy(fcpl); + CHECK(fcpl1, FAIL, "H5Pcopy"); - /* Set file space strategy and free space section threshold */ - ret = H5Pset_file_space(fcpl1, fs_type, fs_size); - CHECK(ret, FAIL, "H5Pget_file_space"); + /* Set file space strategy and free space section threshold */ + ret = H5Pset_file_space(fcpl1, fs_type, fs_size); + CHECK(ret, FAIL, "H5Pget_file_space"); - /* Get the file space info from the creation property */ - ret = H5Pget_file_space(fcpl1, &strategy, &threshold); - CHECK(ret, FAIL, "H5Pget_file_space"); + /* Get the file space info from the creation property */ + ret = H5Pget_file_space(fcpl1, &strategy, &threshold); + CHECK(ret, FAIL, "H5Pget_file_space"); - /* A 0 value for strategy retains existing strategy in use */ - VERIFY(strategy, (H5F_file_space_type_t)(fs_type ? fs_type : def_type), "H5Pget_file_space"); - /* A 0 value for threshold retains existing threshold in use */ - VERIFY(threshold, (hsize_t)(fs_size ? fs_size : def_size), "H5Pget_file_space"); + /* A 0 value for strategy retains existing strategy in use */ + VERIFY(strategy, (H5F_file_space_type_t)(fs_type ? fs_type : def_type), "H5Pget_file_space"); + /* A 0 value for threshold retains existing threshold in use */ + VERIFY(threshold, (hsize_t)(fs_size ? fs_size : def_size), "H5Pget_file_space"); - /* Create the file with the specified file space info */ - fid1 = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl1, my_fapl); - CHECK(ret, FAIL, "H5Fcreate"); + /* Create the file with the specified file space info */ + fid1 = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl1, my_fapl); + CHECK(ret, FAIL, "H5Fcreate"); - /* Close the file */ - ret = H5Fclose(fid1); - CHECK(ret, FAIL, "H5Fclose"); + /* Close the file */ + ret = H5Fclose(fid1); + CHECK(ret, FAIL, "H5Fclose"); - /* Re-open the file */ - fid2 = H5Fopen(filename, H5F_ACC_RDWR, my_fapl); - CHECK(ret, FAIL, "H5Fopen"); + /* Re-open the file */ + fid2 = H5Fopen(filename, H5F_ACC_RDWR, my_fapl); + CHECK(ret, FAIL, "H5Fopen"); - /* Get the file's creation property */ - fcpl2 = H5Fget_create_plist(fid2); - CHECK(fcpl2, FAIL, "H5Fget_create_plist"); + /* Get the file's creation property */ + fcpl2 = H5Fget_create_plist(fid2); + CHECK(fcpl2, FAIL, "H5Fget_create_plist"); - strategy = threshold = 0; + strategy = H5F_FILE_SPACE_DEFAULT; + threshold = 0; - /* Get the file space info from the creation property list */ - ret = H5Pget_file_space(fcpl2, &strategy, &threshold); - CHECK(ret, FAIL, "H5Pget_file_space"); + /* Get the file space info from the creation property list */ + ret = H5Pget_file_space(fcpl2, &strategy, &threshold); + CHECK(ret, FAIL, "H5Pget_file_space"); - VERIFY(strategy, (H5F_file_space_type_t)(fs_type ? fs_type : def_type), "H5Pget_file_space"); - VERIFY(threshold, (hsize_t)(fs_size ? fs_size : def_size), "H5Pget_file_space"); + VERIFY(strategy, (H5F_file_space_type_t)(fs_type ? fs_type : def_type), "H5Pget_file_space"); + VERIFY(threshold, (hsize_t)(fs_size ? fs_size : def_size), "H5Pget_file_space"); - /* Close the file */ - ret = H5Fclose(fid2); - CHECK(ret, FAIL, "H5Fclose"); + /* Close the file */ + ret = H5Fclose(fid2); + CHECK(ret, FAIL, "H5Fclose"); - /* Release file-creation template */ - ret = H5Pclose(fcpl1); - CHECK(ret, FAIL, "H5Pclose"); - ret = H5Pclose(fcpl2); - CHECK(ret, FAIL, "H5Pclose"); - } /* end for file space strategy type */ - } /* end for free space threshold */ + /* Release file-creation template */ + ret = H5Pclose(fcpl1); + CHECK(ret, FAIL, "H5Pclose"); + ret = H5Pclose(fcpl2); + CHECK(ret, FAIL, "H5Pclose"); + } /* end for file space strategy type */ + } /* end for free space threshold */ - h5_cleanup(FILESPACE_NAME, my_fapl); + h5_cleanup(FILESPACE_NAME, my_fapl); } /* end for new/old format */ diff --git a/test/tgenprop.c b/test/tgenprop.c index 10cae6d..fda4161 100644 --- a/test/tgenprop.c +++ b/test/tgenprop.c @@ -61,6 +61,18 @@ double prop4_def=1.41F; /* Property 4 default value */ #define PROP4_SIZE sizeof(prop4_def) #define PROP4_DEF_VALUE (&prop4_def) +/* Structs used during iteration */ +typedef struct iter_data_t { + int iter_count; + char **names; +} iter_data_t; + +typedef struct count_data_t { + int count; + hid_t id; +} count_data_t; + + /**************************************************************** ** ** test_genprop_basic_class(): Test basic generic property list code. @@ -284,17 +296,12 @@ test_genprop_basic_class_prop(void) ** ****************************************************************/ static int -test_genprop_iter1(hid_t id, const char *name, void *iter_data) +test_genprop_iter1(hid_t H5_ATTR_UNUSED id, const char *name, + void *iter_data) { - struct { /* Struct for iterations */ - int iter_count; - const char **names; - } *iter_struct = iter_data; - - /* Shut compiler up */ - id = id; + iter_data_t *idata = (iter_data_t *)iter_data; - return(HDstrcmp(name,iter_struct->names[iter_struct->iter_count++])); + return HDstrcmp(name,idata->names[idata->iter_count++]); } /**************************************************************** @@ -373,43 +380,34 @@ test_genprop_class_iter(void) static herr_t test_genprop_cls_crt_cb1(hid_t list_id, void *create_data) { - struct { /* Struct for iterations */ - int count; - hid_t id; - } *count_struct=create_data; + count_data_t *cdata = (count_data_t *)create_data; - count_struct->count++; - count_struct->id=list_id; + cdata->count++; + cdata->id = list_id; - return(SUCCEED); + return SUCCEED; } static herr_t test_genprop_cls_cpy_cb1(hid_t new_list_id, hid_t H5_ATTR_UNUSED old_list_id, void *copy_data) { - struct { /* Struct for iterations */ - int count; - hid_t id; - } *count_struct=copy_data; + count_data_t *cdata = (count_data_t *)copy_data; - count_struct->count++; - count_struct->id=new_list_id; + cdata->count++; + cdata->id = new_list_id; - return(SUCCEED); + return SUCCEED; } static herr_t test_genprop_cls_cls_cb1(hid_t list_id, void *create_data) { - struct { /* Struct for iterations */ - int count; - hid_t id; - } *count_struct=create_data; + count_data_t *cdata = (count_data_t *)create_data; - count_struct->count++; - count_struct->id=list_id; + cdata->count++; + cdata->id = list_id; - return(SUCCEED); + return SUCCEED; } /**************************************************************** @@ -843,17 +841,12 @@ test_genprop_basic_list_prop(void) ** ****************************************************************/ static int -test_genprop_iter2(hid_t id, const char *name, void *iter_data) +test_genprop_iter2(hid_t H5_ATTR_UNUSED id, const char *name, + void *iter_data) { - struct { /* Struct for iterations */ - int iter_count; - const char **names; - } *iter_struct=iter_data; - - /* Shut compiler up */ - id=id; + iter_data_t *idata = (iter_data_t *)iter_data; - return(HDstrcmp(name,iter_struct->names[iter_struct->iter_count++])); + return HDstrcmp(name,idata->names[idata->iter_count++]); } /**************************************************************** @@ -995,15 +988,12 @@ prop_cb_info prop3_cb_info; /* Callback statistics for property #3 */ static herr_t test_genprop_cls_cpy_cb2(hid_t new_list_id, hid_t H5_ATTR_UNUSED old_list_id, void *create_data) { - struct { /* Struct for iterations */ - int count; - hid_t id; - } *count_struct=create_data; + count_data_t *cdata = (count_data_t *)create_data; - count_struct->count++; - count_struct->id=new_list_id; + cdata->count++; + cdata->id = new_list_id; - return(SUCCEED); + return SUCCEED; } /**************************************************************** diff --git a/test/th5s.c b/test/th5s.c index 9d08abe..a478803 100644 --- a/test/th5s.c +++ b/test/th5s.c @@ -565,7 +565,7 @@ test_h5s_zero_dim(void) wdata_real[i][j][k] = i + j + k; /* Test with different space allocation times */ - for(alloc_time = H5D_ALLOC_TIME_EARLY; alloc_time <= H5D_ALLOC_TIME_INCR; alloc_time++) { + for(alloc_time = H5D_ALLOC_TIME_EARLY; alloc_time <= H5D_ALLOC_TIME_INCR; H5_INC_ENUM(H5D_alloc_time_t, alloc_time)) { /* Make sure we can create the space with the dimension size 0 (starting from v1.8.7). * The dimension doesn't need to be unlimited. */ diff --git a/test/tmisc.c b/test/tmisc.c index 11c6de7..6a68857 100644 --- a/test/tmisc.c +++ b/test/tmisc.c @@ -713,7 +713,7 @@ create_struct3(void) misc5_struct3_hndl *str3hndl; /* New 'struct3' created */ herr_t ret; /* For error checking */ - str3hndl = HDmalloc(sizeof(misc5_struct3_hndl)); + str3hndl = (misc5_struct3_hndl *)HDmalloc(sizeof(misc5_struct3_hndl)); CHECK(str3hndl,NULL,"malloc"); str3hndl->st3h_base = H5Tcreate(H5T_COMPOUND, sizeof(misc5_struct3)); @@ -722,10 +722,10 @@ create_struct3(void) ret = H5Tinsert(str3hndl->st3h_base, "st3_el1", HOFFSET( misc5_struct3, st3_el1), H5T_NATIVE_INT); CHECK(ret,FAIL,"H5Tinsert"); - str3hndl->st3h_id=H5Tvlen_create(str3hndl->st3h_base); + str3hndl->st3h_id = H5Tvlen_create(str3hndl->st3h_base); CHECK(str3hndl->st3h_id,FAIL,"H5Tvlen_create"); - return(str3hndl); + return str3hndl; } static void @@ -733,10 +733,10 @@ delete_struct3(misc5_struct3_hndl *str3hndl) { herr_t ret; /* For error checking */ - ret=H5Tclose(str3hndl->st3h_id); + ret = H5Tclose(str3hndl->st3h_id); CHECK(ret,FAIL,"H5Tclose"); - ret=H5Tclose(str3hndl->st3h_base); + ret = H5Tclose(str3hndl->st3h_base); CHECK(ret,FAIL,"H5Tclose"); HDfree(str3hndl); @@ -756,7 +756,7 @@ create_struct2(void) misc5_struct2_hndl *str2hndl; /* New 'struct2' created */ herr_t ret; /* For error checking */ - str2hndl = HDmalloc(sizeof(misc5_struct2_hndl)); + str2hndl = (misc5_struct2_hndl *)HDmalloc(sizeof(misc5_struct2_hndl)); CHECK(str2hndl, NULL, "malloc"); str2hndl->st2h_base = H5Tcreate(H5T_COMPOUND, sizeof(misc5_struct2)); @@ -765,16 +765,16 @@ create_struct2(void) ret = H5Tinsert(str2hndl->st2h_base, "st2_el1", HOFFSET(misc5_struct2, st2_el1), H5T_NATIVE_INT); CHECK(ret, FAIL, "H5Tinsert"); - str2hndl->st2h_st3hndl=create_struct3(); + str2hndl->st2h_st3hndl = create_struct3(); CHECK(str2hndl->st2h_st3hndl,NULL,"create_struct3"); - ret=H5Tinsert(str2hndl->st2h_base, "st2_el2", HOFFSET(misc5_struct2, st2_el2), str2hndl->st2h_st3hndl->st3h_id); + ret = H5Tinsert(str2hndl->st2h_base, "st2_el2", HOFFSET(misc5_struct2, st2_el2), str2hndl->st2h_st3hndl->st3h_id); CHECK(ret,FAIL,"H5Tinsert"); - str2hndl->st2h_id= H5Tvlen_create(str2hndl->st2h_base); + str2hndl->st2h_id = H5Tvlen_create(str2hndl->st2h_base); CHECK(str2hndl->st2h_id,FAIL,"H5Tvlen_create"); - return(str2hndl); + return str2hndl; } static void @@ -798,10 +798,10 @@ set_struct2(misc5_struct2 *buf) { unsigned i; /* Local index variable */ - buf->st2_el1=MISC5_DBGELVAL2; - buf->st2_el2.len=MISC5_DBGNELM3; + buf->st2_el1 = MISC5_DBGELVAL2; + buf->st2_el2.len = MISC5_DBGNELM3; - buf->st2_el2.p=HDmalloc((buf->st2_el2.len)*sizeof(misc5_struct3)); + buf->st2_el2.p = HDmalloc((buf->st2_el2.len)*sizeof(misc5_struct3)); CHECK(buf->st2_el2.p,NULL,"malloc"); for(i=0; i<(buf->st2_el2.len); i++) @@ -822,7 +822,7 @@ create_struct1(void) misc5_struct1_hndl *str1hndl; /* New 'struct1' created */ herr_t ret; /* For error checking */ - str1hndl = HDmalloc(sizeof(misc5_struct1_hndl)); + str1hndl = (misc5_struct1_hndl *)HDmalloc(sizeof(misc5_struct1_hndl)); CHECK(str1hndl, NULL, "malloc"); str1hndl->st1h_base = H5Tcreate(H5T_COMPOUND, sizeof(misc5_struct1)); @@ -834,13 +834,13 @@ create_struct1(void) str1hndl->st1h_st2hndl=create_struct2(); CHECK(str1hndl->st1h_st2hndl,NULL,"create_struct2"); - ret=H5Tinsert(str1hndl->st1h_base, "st1_el2", HOFFSET(misc5_struct1, st1_el2), str1hndl->st1h_st2hndl->st2h_id); + ret = H5Tinsert(str1hndl->st1h_base, "st1_el2", HOFFSET(misc5_struct1, st1_el2), str1hndl->st1h_st2hndl->st2h_id); CHECK(ret,FAIL,"H5Tinsert"); - str1hndl->st1h_id=H5Tvlen_create(str1hndl->st1h_base); + str1hndl->st1h_id = H5Tvlen_create(str1hndl->st1h_base); CHECK(str1hndl->st1h_id,FAIL,"H5Tvlen_create"); - return(str1hndl); + return str1hndl; } static void @@ -848,12 +848,12 @@ delete_struct1(misc5_struct1_hndl *str1hndl) { herr_t ret; /* For error checking */ - ret=H5Tclose(str1hndl->st1h_id); + ret = H5Tclose(str1hndl->st1h_id); CHECK(ret,FAIL,"H5Tclose"); delete_struct2(str1hndl->st1h_st2hndl); - ret=H5Tclose(str1hndl->st1h_base); + ret = H5Tclose(str1hndl->st1h_base); CHECK(ret,FAIL,"H5Tclose"); HDfree(str1hndl); @@ -1243,10 +1243,10 @@ test_misc8(void) MESSAGE(5, ("Testing dataset storage sizes\n")); /* Allocate space for the data to write & read */ - wdata=HDmalloc(sizeof(int)*MISC8_DIM0*MISC8_DIM1); + wdata = (int *)HDmalloc(sizeof(int) * MISC8_DIM0 * MISC8_DIM1); CHECK(wdata,NULL,"malloc"); #ifdef VERIFY_DATA - rdata=HDmalloc(sizeof(int)*MISC8_DIM0*MISC8_DIM1); + rdata = (int *)HDmalloc(sizeof(int) * MISC8_DIM0 * MISC8_DIM1); CHECK(rdata,NULL,"malloc"); #endif /* VERIFY_DATA */ diff --git a/test/ttst.c b/test/ttst.c index 4ffe4cd..b869b63 100644 --- a/test/ttst.c +++ b/test/ttst.c @@ -95,13 +95,13 @@ test_tst_init(void) } /* end for */ /* Allocate space for the array of unique words */ - uniq_words=HDmalloc(sizeof(char *)*num_uniq_words); + uniq_words = (char **)HDmalloc(sizeof(char *)*num_uniq_words); /* Allocate space for the array of randomized order unique words also */ - rand_uniq_words=HDmalloc(sizeof(char *)*num_uniq_words); + rand_uniq_words = (char **)HDmalloc(sizeof(char *)*num_uniq_words); /* Allocate space for the array of sorted order unique words also */ - sort_uniq_words=HDmalloc(sizeof(char *)*num_uniq_words); + sort_uniq_words = (char **)HDmalloc(sizeof(char *)*num_uniq_words); /* Insert unique words from test set into unique word set */ w=0; diff --git a/test/tvltypes.c b/test/tvltypes.c index d1a4235..b7bbaee 100644 --- a/test/tvltypes.c +++ b/test/tvltypes.c @@ -1021,7 +1021,7 @@ test_vltypes_compound_vlen_vlen(void) wdata[i].f=(float)((i*20)/3.0F); wdata[i].v.p=HDmalloc((i+L1_INCM)*sizeof(hvl_t)); wdata[i].v.len=i+L1_INCM; - for(t1=(wdata[i].v).p,j=0; j<(i+L1_INCM); j++, t1++) { + for(t1=(hvl_t *)((wdata[i].v).p),j=0; j<(i+L1_INCM); j++, t1++) { t1->p=HDmalloc((j+L2_INCM)*sizeof(unsigned int)); t1->len=j+L2_INCM; for(k=0; klen != t2->len) { TestErrPrintf("%d: VL data length don't match!, i=%d, j=%d, t1->len=%d, t2->len=%d\n",__LINE__,(int)i,(int)j,(int)t1->len,(int)t2->len); continue; @@ -1161,13 +1161,13 @@ static void test_vltypes_compound_vlstr(void) { typedef enum { - red, - blue, - green + red, + blue, + green } e1; typedef struct { char *string; - e1 color; + e1 color; } s2; typedef struct { /* Struct that the compound type are composed of */ hvl_t v; @@ -1199,12 +1199,12 @@ test_vltypes_compound_vlstr(void) for(i=0; istring = (char*)HDmalloc(strlen(str)*sizeof(char)+1); + for(t1=(s2 *)((wdata[i].v).p), j=0; j<(i+L3_INCM); j++, t1++) { + strcat(str, "m"); + t1->string = (char*)HDmalloc(strlen(str)*sizeof(char)+1); strcpy(t1->string, str); - /*t1->color = red;*/ - t1->color = blue; + /*t1->color = red;*/ + t1->color = blue; } } /* end for */ @@ -1342,7 +1342,7 @@ test_vltypes_compound_vlstr(void) continue; } /* end if */ - for(t1=wdata[i].v.p, t2=rdata[i].v.p, j=0; jstring, t2->string) ) { TestErrPrintf("VL data values don't match!, t1->string=%s, t2->string=%s\n",t1->string, t2->string); continue; @@ -1400,7 +1400,7 @@ test_vltypes_compound_vlstr(void) continue; } /* end if */ - for(t1=wdata2[i].v.p, t2=rdata2[i].v.p, j=0; jstring, t2->string) ) { TestErrPrintf("VL data values don't match!, t1->string=%s, t2->string=%s\n",t1->string, t2->string); continue; @@ -1871,7 +1871,7 @@ test_vltypes_vlen_vlen_atomic(void) return; } /* end if */ wdata[i].len=i+1; - for(t1=wdata[i].p,j=0; j<(i+1); j++, t1++) { + for(t1=(hvl_t *)(wdata[i].p),j=0; j<(i+1); j++, t1++) { t1->p=HDmalloc((j+1)*sizeof(unsigned int)); if(t1->p==NULL) { TestErrPrintf("Cannot allocate memory for VL data! i=%u, j=%u\n",i,j); @@ -1977,7 +1977,7 @@ test_vltypes_vlen_vlen_atomic(void) TestErrPrintf("%d: VL data length don't match!, wdata[%d].len=%d, rdata[%d].len=%d\n",__LINE__,(int)i,(int)wdata[i].len,(int)i,(int)rdata[i].len); continue; } /* end if */ - for(t1=wdata[i].p, t2=rdata[i].p, j=0; jlen!=t2->len) { TestErrPrintf("%d: VL data length don't match!, i=%d, j=%d, t1->len=%d, t2->len=%d\n",__LINE__,(int)i,(int)j,(int)t1->len,(int)t2->len); continue; @@ -2062,7 +2062,7 @@ rewrite_longer_vltypes_vlen_vlen_atomic(void) return; } /* end if */ wdata[i].len = i + increment; - for(t1 = wdata[i].p, j = 0; j < (i + increment); j++, t1++) { + for(t1 = (hvl_t *)(wdata[i].p), j = 0; j < (i + increment); j++, t1++) { t1->p = HDmalloc((j + 1) * sizeof(unsigned int)); if(t1->p == NULL) { TestErrPrintf("Cannot allocate memory for VL data! i=%u, j=%u\n", i, j); @@ -2157,7 +2157,7 @@ rewrite_longer_vltypes_vlen_vlen_atomic(void) TestErrPrintf("%d: VL data length don't match!, wdata[%d].len=%d, rdata[%d].len=%d\n",__LINE__,(int)i,(int)wdata[i].len,(int)i,(int)rdata[i].len); continue; } /* end if */ - for(t1=wdata[i].p, t2=rdata[i].p, j=0; jlen!=t2->len) { TestErrPrintf("%d: VL data length don't match!, i=%d, j=%d, t1->len=%d, t2->len=%d\n",__LINE__,(int)i,(int)j,(int)t1->len,(int)t2->len); continue; @@ -2238,7 +2238,7 @@ rewrite_shorter_vltypes_vlen_vlen_atomic(void) return; } /* end if */ wdata[i].len=i+increment; - for(t1=wdata[i].p,j=0; j<(i+increment); j++, t1++) { + for(t1=(hvl_t *)(wdata[i].p),j=0; j<(i+increment); j++, t1++) { t1->p=HDmalloc((j+1)*sizeof(unsigned int)); if(t1->p==NULL) { TestErrPrintf("Cannot allocate memory for VL data! i=%u, j=%u\n",i,j); @@ -2333,7 +2333,7 @@ rewrite_shorter_vltypes_vlen_vlen_atomic(void) TestErrPrintf("%d: VL data length don't match!, wdata[%d].len=%d, rdata[%d].len=%d\n",__LINE__,(int)i,(int)wdata[i].len,(int)i,(int)rdata[i].len); continue; } /* end if */ - for(t1=wdata[i].p, t2=rdata[i].p, j=0; jlen!=t2->len) { TestErrPrintf("%d: VL data length don't match!, i=%d, j=%d, t1->len=%d, t2->len=%d\n",__LINE__,(int)i,(int)j,(int)t1->len,(int)t2->len); continue; @@ -2496,7 +2496,7 @@ test_vltypes_fill_value(void) /* Allocate space for the buffer to read data */ - rbuf = HDmalloc(SPACE4_DIM_LARGE * sizeof(dtype1_struct)); + rbuf = (dtype1_struct *)HDmalloc(SPACE4_DIM_LARGE * sizeof(dtype1_struct)); CHECK(rbuf, NULL, "HDmalloc"); @@ -2538,7 +2538,7 @@ test_vltypes_fill_value(void) CHECK(file_id, FAIL, "H5Fcreate"); /* Create datasets with different storage layouts */ - for(layout = H5D_COMPACT; layout <= H5D_CHUNKED; layout++) { + for(layout = H5D_COMPACT; layout <= H5D_CHUNKED; H5_INC_ENUM(H5D_layout_t, layout)) { unsigned compress_loop; /* # of times to run loop, for testing compressed chunked dataset */ unsigned test_loop; /* Loop over datasets */ @@ -2597,6 +2597,8 @@ test_vltypes_fill_value(void) } break; + case H5D_LAYOUT_ERROR: + case H5D_NLAYOUTS: default: assert(0 && "Unknown layout type!"); break; @@ -2648,7 +2650,7 @@ test_vltypes_fill_value(void) CHECK(file_id, FAIL, "H5Fopen"); /* Read empty datasets with different storage layouts */ - for(layout = H5D_COMPACT; layout <= H5D_CHUNKED; layout++) { + for(layout = H5D_COMPACT; layout <= H5D_CHUNKED; H5_INC_ENUM(H5D_layout_t, layout)) { unsigned compress_loop; /* # of times to run loop, for testing compressed chunked dataset */ unsigned test_loop; /* Loop over datasets */ @@ -2698,6 +2700,8 @@ test_vltypes_fill_value(void) dset_elmts = SPACE4_DIM_LARGE; break; + case H5D_LAYOUT_ERROR: + case H5D_NLAYOUTS: default: assert(0 && "Unknown layout type!"); break; @@ -2843,7 +2847,7 @@ test_vltypes_fill_value(void) CHECK(file_id, FAIL, "H5Fopen"); /* Write one element & fill values to datasets with different storage layouts */ - for(layout = H5D_COMPACT; layout <= H5D_CHUNKED; layout++) { + for(layout = H5D_COMPACT; layout <= H5D_CHUNKED; H5_INC_ENUM(H5D_layout_t, layout)) { unsigned compress_loop; /* # of times to run loop, for testing compressed chunked dataset */ unsigned test_loop; /* Loop over datasets */ @@ -2893,6 +2897,8 @@ test_vltypes_fill_value(void) dset_elmts = SPACE4_DIM_LARGE; break; + case H5D_LAYOUT_ERROR: + case H5D_NLAYOUTS: default: assert(0 && "Unknown layout type!"); break; diff --git a/tools/h5diff/h5diffgentest.c b/tools/h5diff/h5diffgentest.c index cfaffe6..a871709 100644 --- a/tools/h5diff/h5diffgentest.c +++ b/tools/h5diff/h5diffgentest.c @@ -5023,10 +5023,10 @@ static void test_data_nocomparables (const char * fname, int make_diffs) /* attr2 - non-compatible : same rank, different dimention */ - write_attr(did2,1, attr2_dim_ptr,"attr2", H5T_NATIVE_INT, data3); + write_attr(did2,1,(hsize_t *)attr2_dim_ptr,"attr2", H5T_NATIVE_INT, data3); /* attr3 - non-compatible : different rank */ - write_attr(did2, rank_attr,attr3_dim_ptr,"attr3", H5T_NATIVE_INT, attr_data_ptr3); + write_attr(did2, rank_attr,(hsize_t *)attr3_dim_ptr,"attr3", H5T_NATIVE_INT, attr_data_ptr3); /* attr4 - compatible : different data values */ write_attr(did2,1,dims1_1,"attr4", H5T_NATIVE_INT, attr_data_ptr4); @@ -6551,7 +6551,7 @@ void write_dset_in(hid_t loc_id, /* allocate and initialize array data to write */ size = ( H5TOOLS_MALLOCSIZE / sizeof(double) + 1 ) * sizeof(double); - dbuf = HDmalloc( size ); + dbuf = (double *)HDmalloc( size ); for( j = 0; j < H5TOOLS_MALLOCSIZE / sizeof(double) + 1; j++) dbuf[j] = j; @@ -7018,10 +7018,10 @@ void gen_datareg(hid_t fid, int i; /* allocate the buffer for write the references */ - rbuf = HDcalloc((size_t)2, sizeof(hdset_reg_ref_t)); + rbuf = (hdset_reg_ref_t *)HDcalloc((size_t)2, sizeof(hdset_reg_ref_t)); /* allocate the buffer for write the data dataset */ - buf = HDmalloc(10 * 10 * sizeof(int)); + buf = (int *)HDmalloc(10 * 10 * sizeof(int)); for(i = 0; i < 10 * 10; i++) buf[i] = i; diff --git a/tools/h5dump/h5dump.c b/tools/h5dump/h5dump.c index 3c60bb0..68889c9 100644 --- a/tools/h5dump/h5dump.c +++ b/tools/h5dump/h5dump.c @@ -389,10 +389,10 @@ table_list_add(hid_t oid, unsigned long file_no) /* Allocate space if necessary */ if(table_list.nused == table_list.nalloc) { - void *tmp_ptr; + h5dump_table_items_t *tmp_ptr; table_list.nalloc = MAX(1, table_list.nalloc * 2); - if(NULL == (tmp_ptr = HDrealloc(table_list.tables, table_list.nalloc * sizeof(table_list.tables[0])))) + if(NULL == (tmp_ptr = (h5dump_table_items_t *)HDrealloc(table_list.tables, table_list.nalloc * sizeof(table_list.tables[0])))) return -1; table_list.tables = tmp_ptr; } /* end if */ diff --git a/tools/h5dump/h5dump.h b/tools/h5dump/h5dump.h index 7bfead7..2b1fb04 100644 --- a/tools/h5dump/h5dump.h +++ b/tools/h5dump/h5dump.h @@ -38,16 +38,17 @@ typedef struct dump_functions_t { } dump_functions; /* List of table structures. There is one table structure for each file */ +typedef struct h5dump_table_items_t { + unsigned long fileno; /* File number that these tables refer to */ + hid_t oid; /* ID of an object in this file, held open so fileno is consistent */ + table_t *group_table; /* Table of groups */ + table_t *dset_table; /* Table of datasets */ + table_t *type_table; /* Table of datatypes */ +} h5dump_table_items_t; typedef struct h5dump_table_list_t { - size_t nalloc; - size_t nused; - struct { - unsigned long fileno; /* File number that these tables refer to */ - hid_t oid; /* ID of an object in this file, held open so fileno is consistent */ - table_t *group_table; /* Table of groups */ - table_t *dset_table; /* Table of datasets */ - table_t *type_table; /* Table of datatypes */ - } *tables; + size_t nalloc; + size_t nused; + h5dump_table_items_t *tables; } h5dump_table_list_t; h5dump_table_list_t table_list = {0, 0, NULL}; diff --git a/tools/h5dump/h5dump_ddl.c b/tools/h5dump/h5dump_ddl.c index 3822251..0cd0847 100644 --- a/tools/h5dump/h5dump_ddl.c +++ b/tools/h5dump/h5dump_ddl.c @@ -377,6 +377,8 @@ dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void H5_ATTR } break; + case H5O_TYPE_UNKNOWN: + case H5O_TYPE_NTYPES: default: error_msg("unknown object \"%s\"\n", name); h5tools_setstatus(EXIT_FAILURE); @@ -509,6 +511,11 @@ dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void H5_ATTR HDfree(targbuf); break; + case H5L_TYPE_ERROR: + case H5L_TYPE_MAX: + HDassert(0); + /* fall through */ + case H5L_TYPE_HARD: default: ctx.need_prefix = TRUE; h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); @@ -1054,7 +1061,10 @@ dump_dataset(hid_t did, const char *name, struct subset_t *sset) } break; + case H5T_NO_CLASS: + case H5T_NCLASSES: default: + HDassert(0); break; } /* end switch */ } /* for(i=0;iextlinkend, h5tools_dump_header_format->extlinkblockend); break; + case H5L_TYPE_ERROR: + case H5L_TYPE_MAX: + HDassert(0); + /* fall through */ + H5L_TYPE_HARD: default: begin_obj(h5tools_dump_header_format->udlinkbegin, links, h5tools_dump_header_format->udlinkblockbegin); PRINTVALSTREAM(rawoutstream, "\n"); @@ -2094,6 +2109,8 @@ dump_extlink(hid_t group, const char *linkname, const char *objname) case H5O_TYPE_NAMED_DATATYPE: handle_datatypes(group, linkname, NULL, 0, objname); break; + case H5O_TYPE_UNKNOWN: + case H5O_TYPE_NTYPES: default: h5tools_setstatus(EXIT_FAILURE); } diff --git a/tools/h5dump/h5dump_xml.c b/tools/h5dump/h5dump_xml.c index 4f8d250..e872114 100644 --- a/tools/h5dump/h5dump_xml.c +++ b/tools/h5dump/h5dump_xml.c @@ -359,6 +359,8 @@ xml_dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void H5_ } break; + case H5O_TYPE_UNKNOWN: + case H5O_TYPE_NTYPES: default: error_msg("unknown object \"%s\"\n", name); h5tools_setstatus(EXIT_FAILURE); @@ -521,42 +523,48 @@ xml_dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void H5_ HDfree(targbuf); break; + case H5L_TYPE_ERROR: + case H5L_TYPE_MAX: + HDassert(0); + /* fall through */ + case H5L_TYPE_HARD: default: - { - char linkxid[100]; - char parentxid[100]; - char *t_name = xml_escape_the_name(name); - char *t_prefix = xml_escape_the_name(HDstrcmp(prefix,"") ? prefix : "/"); - char *t_obj_path = xml_escape_the_name(obj_path); + { + char linkxid[100]; + char parentxid[100]; + char *t_name = xml_escape_the_name(name); + char *t_prefix = xml_escape_the_name(HDstrcmp(prefix,"") ? prefix : "/"); + char *t_obj_path = xml_escape_the_name(obj_path); - /* Create OBJ-XIDs for the parent and object */ - xml_name_to_XID(t_obj_path, linkxid, (int)sizeof(linkxid), 1); - xml_name_to_XID(prefix, parentxid, (int)sizeof(parentxid), 1); + /* Create OBJ-XIDs for the parent and object */ + xml_name_to_XID(t_obj_path, linkxid, (int)sizeof(linkxid), 1); + xml_name_to_XID(prefix, parentxid, (int)sizeof(parentxid), 1); - ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); - /* Render the element */ - h5tools_str_reset(&buffer); - h5tools_str_append(&buffer, "<%sUserDefined LinkName=\"%s\" " - "OBJ-XID=\"%s\" " - "H5SourcePath=\"%s\" " - "LinkClass=\"%d\" " - "Parents=\"%s\" H5ParentPaths=\"%s\" />", - xmlnsprefix, - t_name, /* LinkName */ - linkxid, /* OBJ-XID */ - t_obj_path, /* H5SourcePath */ - linfo->type, /* LinkClass */ - parentxid, /* Parents */ - t_prefix); /* H5ParentPaths */ - h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); - - HDfree(t_prefix); - HDfree(t_name); - HDfree(t_obj_path); - } + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "<%sUserDefined LinkName=\"%s\" " + "OBJ-XID=\"%s\" " + "H5SourcePath=\"%s\" " + "LinkClass=\"%d\" " + "Parents=\"%s\" H5ParentPaths=\"%s\" />", + xmlnsprefix, + t_name, /* LinkName */ + linkxid, /* OBJ-XID */ + t_obj_path, /* H5SourcePath */ + linfo->type, /* LinkClass */ + parentxid, /* Parents */ + t_prefix); /* H5ParentPaths */ + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); + + HDfree(t_prefix); + HDfree(t_name); + HDfree(t_obj_path); + } break; + } /* end switch */ } /* end else */ @@ -969,29 +977,36 @@ xml_print_datatype(hid_t type, unsigned in_group) h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sIntegerType ByteOrder=\"",xmlnsprefix); switch (ord) { - case H5T_ORDER_LE: - h5tools_str_append(&buffer, "LE"); - break; - case H5T_ORDER_BE: - h5tools_str_append(&buffer, "BE"); - break; - case H5T_ORDER_VAX: - default: - h5tools_str_append(&buffer, "ERROR_UNKNOWN"); - } + case H5T_ORDER_LE: + h5tools_str_append(&buffer, "LE"); + break; + case H5T_ORDER_BE: + h5tools_str_append(&buffer, "BE"); + break; + case H5T_ORDER_VAX: + case H5T_ORDER_MIXED: + case H5T_ORDER_NONE: + case H5T_ORDER_ERROR: + default: + h5tools_str_append(&buffer, "ERROR_UNKNOWN"); + break; + } /* end switch */ h5tools_str_append(&buffer, "\" Sign=\""); switch (sgn) { - case H5T_SGN_NONE: - h5tools_str_append(&buffer, "false"); - break; - case H5T_SGN_2: - h5tools_str_append(&buffer, "true"); - break; - default: - h5tools_str_append(&buffer, "ERROR_UNKNOWN"); - } + case H5T_SGN_NONE: + h5tools_str_append(&buffer, "false"); + break; + case H5T_SGN_2: + h5tools_str_append(&buffer, "true"); + break; + case H5T_SGN_ERROR: + case H5T_NSGN: + default: + h5tools_str_append(&buffer, "ERROR_UNKNOWN"); + break; + } /* end switch */ h5tools_str_append(&buffer, "\" Size=\""); sz = H5Tget_size(type); @@ -1033,18 +1048,21 @@ xml_print_datatype(hid_t type, unsigned in_group) h5tools_str_append(&buffer, "<%sFloatType ByteOrder=\"",xmlnsprefix); switch (ord) { - case H5T_ORDER_LE: - h5tools_str_append(&buffer, "LE"); - break; - case H5T_ORDER_BE: - h5tools_str_append(&buffer, "BE"); - break; - case H5T_ORDER_VAX: - h5tools_str_append(&buffer, "VAX"); - break; - default: - h5tools_str_append(&buffer, "ERROR_UNKNOWN"); - } + case H5T_ORDER_LE: + h5tools_str_append(&buffer, "LE"); + break; + case H5T_ORDER_BE: + h5tools_str_append(&buffer, "BE"); + break; + case H5T_ORDER_VAX: + h5tools_str_append(&buffer, "VAX"); + break; + case H5T_ORDER_MIXED: + case H5T_ORDER_NONE: + case H5T_ORDER_ERROR: + default: + h5tools_str_append(&buffer, "ERROR_UNKNOWN"); + } /* end switch */ h5tools_str_append(&buffer, "\" Size=\""); sz = H5Tget_size(type); @@ -1172,16 +1190,19 @@ xml_print_datatype(hid_t type, unsigned in_group) h5tools_str_append(&buffer, "<%sBitfieldType ByteOrder=\"",xmlnsprefix); switch (ord) { - case H5T_ORDER_LE: - h5tools_str_append(&buffer, "LE"); - break; - case H5T_ORDER_BE: - h5tools_str_append(&buffer, "BE"); - break; - case H5T_ORDER_VAX: - default: - h5tools_str_append(&buffer, "ERROR_UNKNOWN"); - } + case H5T_ORDER_LE: + h5tools_str_append(&buffer, "LE"); + break; + case H5T_ORDER_BE: + h5tools_str_append(&buffer, "BE"); + break; + case H5T_ORDER_VAX: + case H5T_ORDER_MIXED: + case H5T_ORDER_NONE: + case H5T_ORDER_ERROR: + default: + h5tools_str_append(&buffer, "ERROR_UNKNOWN"); + } /* end switch */ size = H5Tget_size(type); h5tools_str_append(&buffer, "\" Size=\"%lu\"/>", (unsigned long)size); @@ -1516,6 +1537,10 @@ xml_print_datatype(hid_t type, unsigned in_group) H5Tclose(super); break; + case H5T_NO_CLASS: + case H5T_NCLASSES: + HDassert(0); + /* fall through */ default: ctx.need_prefix = TRUE; h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); @@ -1813,6 +1838,7 @@ xml_dump_dataspace(hid_t space) break; #endif /* TMP */ + case H5S_NULL: case H5S_NO_CLASS: default: ctx.need_prefix = TRUE; @@ -2246,6 +2272,10 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED dump_function_table->dump_data_function(attr_id, ATTRIBUTE_DATA, NULL, 0); break; + case H5T_NO_CLASS: + case H5T_NCLASSES: + HDassert(0); + /* fall through */ default: ctx.need_prefix = TRUE; h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); @@ -3701,6 +3731,12 @@ xml_dump_fill_value(hid_t dcpl, hid_t type) h5tools_str_append(&buffer, "<%sNoData />", xmlnsprefix); h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); break; + case H5T_NO_CLASS: + case H5T_NCLASSES: + HDassert(0); + /* fall through */ + case H5T_STRING: + case H5T_REFERENCE: default: ctx.need_prefix = TRUE; h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); @@ -4004,37 +4040,43 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s H5Pget_fill_time(dcpl, &ft); h5tools_str_append(&buffer, "FillTime=\""); switch (ft) { - case H5D_FILL_TIME_ALLOC: - h5tools_str_append(&buffer, "FillOnAlloc"); - break; - case H5D_FILL_TIME_NEVER: - h5tools_str_append(&buffer, "FillNever"); - break; - case H5D_FILL_TIME_IFSET: - h5tools_str_append(&buffer, "FillIfSet"); - break; - default: - h5tools_str_append(&buffer, "?"); - break; - } + case H5D_FILL_TIME_ALLOC: + h5tools_str_append(&buffer, "FillOnAlloc"); + break; + case H5D_FILL_TIME_NEVER: + h5tools_str_append(&buffer, "FillNever"); + break; + case H5D_FILL_TIME_IFSET: + h5tools_str_append(&buffer, "FillIfSet"); + break; + case H5D_FILL_TIME_ERROR: + HDassert(0); + /* fall through */ + default: + h5tools_str_append(&buffer, "?"); + break; + } /* end switch */ h5tools_str_append(&buffer, "\" "); H5Pget_alloc_time(dcpl, &at); h5tools_str_append(&buffer, "AllocationTime=\""); switch (at) { - case H5D_ALLOC_TIME_EARLY: - h5tools_str_append(&buffer, "Early"); - break; - case H5D_ALLOC_TIME_INCR: - h5tools_str_append(&buffer, "Incremental"); - break; - case H5D_ALLOC_TIME_LATE: - h5tools_str_append(&buffer, "Late"); - break; - case H5D_ALLOC_TIME_DEFAULT: - default: - h5tools_str_append(&buffer, "?"); - break; - } + case H5D_ALLOC_TIME_EARLY: + h5tools_str_append(&buffer, "Early"); + break; + case H5D_ALLOC_TIME_INCR: + h5tools_str_append(&buffer, "Incremental"); + break; + case H5D_ALLOC_TIME_LATE: + h5tools_str_append(&buffer, "Late"); + break; + case H5D_ALLOC_TIME_DEFAULT: + case H5D_ALLOC_TIME_ERROR: + HDassert(0); + /* fall through */ + default: + h5tools_str_append(&buffer, "?"); + break; + } /* end switch */ h5tools_str_append(&buffer, "\""); h5tools_str_append(&buffer, ">"); h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); @@ -4255,6 +4297,11 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s ctx.indent_level--; dump_indent -= COL; break; + case H5T_NO_CLASS: + case H5T_NCLASSES: + HDassert(0); + /* fall through */ + default: ctx.need_prefix = TRUE; h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); diff --git a/tools/h5jam/h5jamgentest.c b/tools/h5jam/h5jamgentest.c index 5f24566..ef45372 100644 --- a/tools/h5jam/h5jamgentest.c +++ b/tools/h5jam/h5jamgentest.c @@ -308,7 +308,7 @@ create_textfile(const char *name, size_t size) fd = HDcreat(name,0777); HDassert(fd >= 0); - buf = HDcalloc(size, (size_t)1); + buf = (char *)HDcalloc(size, (size_t)1); HDassert(buf); /* fill buf with pattern */ diff --git a/tools/h5ls/h5ls.c b/tools/h5ls/h5ls.c index fe128fa..fe146c1 100644 --- a/tools/h5ls/h5ls.c +++ b/tools/h5ls/h5ls.c @@ -1759,7 +1759,6 @@ dataset_list2(hid_t dset, const char H5_ATTR_UNUSED *name) size_t cd_nelmts; /* filter client number of values */ size_t cd_num; /* filter client data counter */ char f_name[256]; /* filter/file name */ - char dset_name[256]; /* filter/file name */ char s[64]; /* temporary string buffer */ off_t f_offset; /* offset in external file */ hsize_t f_size; /* bytes used in external file */ @@ -1847,7 +1846,11 @@ dataset_list2(hid_t dset, const char H5_ATTR_UNUSED *name) h5tools_str_append(&buffer, "\n"); } /* end if */ break; + + case H5D_LAYOUT_ERROR: + case H5D_NLAYOUTS: default: + HDassert(0); break; } /* Print total raw storage size */ diff --git a/tools/lib/h5diff_array.c b/tools/lib/h5diff_array.c index 71ada53..d592528 100644 --- a/tools/lib/h5diff_array.c +++ b/tools/lib/h5diff_array.c @@ -102,29 +102,29 @@ static hbool_t not_comparable; -#define PER(A,B) { \ - per = -1; \ - not_comparable = FALSE; \ - both_zero = FALSE; \ - if(0 == (A) && 0 == (B)) \ - both_zero = TRUE; \ - if(0 != (A)) \ - per = (double)ABS((double)((B) - (A)) / (double)(A)); \ - else \ - not_comparable = TRUE; \ +#define PER(A,B) { \ + per = -1; \ + not_comparable = FALSE; \ + both_zero = FALSE; \ + if(H5_DBL_ABS_EQUAL(0,A) && H5_DBL_ABS_EQUAL(0,B)) \ + both_zero = TRUE; \ + if(!H5_DBL_ABS_EQUAL(0,A)) \ + per = (double)ABS((double)((B) - (A)) / (double)(A)); \ + else \ + not_comparable = TRUE; \ } -#define PER_UNSIGN(TYPE,A,B) { \ - per = -1; \ - not_comparable = FALSE; \ - both_zero = FALSE; \ - if((A) == 0 && (B) == 0) \ - both_zero = TRUE; \ - if((A) != 0) \ - per = ABS((double)((TYPE)((B) - (A))) / (double)(A)) ; \ - else \ - not_comparable = TRUE; \ +#define PER_UNSIGN(TYPE,A,B) { \ + per = -1; \ + not_comparable = FALSE; \ + both_zero = FALSE; \ + if(H5_DBL_ABS_EQUAL(0,A) && H5_DBL_ABS_EQUAL(0,B)) \ + both_zero = TRUE; \ + if(!H5_DBL_ABS_EQUAL(0,A)) \ + per = ABS((double)((TYPE)((B) - (A))) / (double)(A)) ; \ + else \ + not_comparable = TRUE; \ } diff --git a/tools/lib/h5diff_dset.c b/tools/lib/h5diff_dset.c index d7c5639..b8dd0e8 100644 --- a/tools/lib/h5diff_dset.c +++ b/tools/lib/h5diff_dset.c @@ -687,31 +687,30 @@ int diff_can_type( hid_t f_tid1, /* file data type */ HDassert(tclass1==tclass2); switch (tclass1) { - case H5T_INTEGER: - case H5T_FLOAT: - case H5T_COMPOUND: - case H5T_STRING: - case H5T_ARRAY: - case H5T_BITFIELD: - case H5T_OPAQUE: - case H5T_ENUM: - case H5T_VLEN: - case H5T_REFERENCE: - - break; - - default: /*H5T_TIME */ - + case H5T_TIME: + if ( (options->m_verbose||options->m_list_not_cmp) && obj1_name && obj2_name) { + parallel_print("Not comparable: <%s> and <%s> are of class %s\n", + obj1_name,obj2_name,get_class(tclass2) ); + } /* end if */ + can_compare = 0; + options->not_cmp = 1; + return can_compare; - if ( (options->m_verbose||options->m_list_not_cmp) && obj1_name && obj2_name) - { - parallel_print("Not comparable: <%s> and <%s> are of class %s\n", - obj1_name,obj2_name,get_class(tclass2) ); - } - can_compare = 0; - options->not_cmp = 1; - return can_compare; - } + case H5T_INTEGER: + case H5T_FLOAT: + case H5T_COMPOUND: + case H5T_STRING: + case H5T_ARRAY: + case H5T_BITFIELD: + case H5T_OPAQUE: + case H5T_ENUM: + case H5T_VLEN: + case H5T_REFERENCE: + case H5T_NO_CLASS: + case H5T_NCLASSES: + default: + break; + } /* end switch */ /*------------------------------------------------------------------------- * check for equal file datatype; warning only diff --git a/tools/lib/h5diff_util.c b/tools/lib/h5diff_util.c index aefd641..14fbcaa 100644 --- a/tools/lib/h5diff_util.c +++ b/tools/lib/h5diff_util.c @@ -78,8 +78,6 @@ void print_type(hid_t type) { switch (H5Tget_class(type)) { - default: - return; case H5T_INTEGER: if (H5Tequal(type, H5T_STD_I8BE)) { parallel_print("H5T_STD_I8BE"); @@ -160,7 +158,21 @@ void print_type(hid_t type) } break; - }/*switch*/ + case H5T_TIME: + case H5T_STRING: + case H5T_BITFIELD: + case H5T_OPAQUE: + case H5T_COMPOUND: + case H5T_REFERENCE: + case H5T_ENUM: + case H5T_VLEN: + case H5T_ARRAY: + case H5T_NO_CLASS: + case H5T_NCLASSES: + default: + return; + + } /* end switch */ } /*------------------------------------------------------------------------- @@ -219,6 +231,7 @@ get_type(h5trav_type_t type) return("H5G_LINK"); case H5TRAV_TYPE_UDLINK: return("H5G_UDLINK"); + case H5TRAV_TYPE_UNKNOWN: default: return("unknown type"); } @@ -242,13 +255,18 @@ get_sign(H5T_sign_t sign) { switch (sign) { - default: - return("H5T_SGN_ERROR"); - case H5T_SGN_NONE: - return("H5T_SGN_NONE"); - case H5T_SGN_2: - return("H5T_SGN_2"); - } + case H5T_SGN_NONE: + return "H5T_SGN_NONE"; + case H5T_SGN_2: + return "H5T_SGN_2"; + case H5T_SGN_ERROR: + return "H5T_SGN_ERROR"; + case H5T_NSGN: + return "H5T_NSGN"; + default: + HDassert(0); + return "unknown sign value"; + } /* end switch */ } @@ -268,8 +286,6 @@ get_class(H5T_class_t tclass) { switch (tclass) { - default: - return("Invalid class"); case H5T_TIME: return("H5T_TIME"); case H5T_INTEGER: @@ -292,8 +308,13 @@ get_class(H5T_class_t tclass) return("H5T_VLEN"); case H5T_ARRAY: return("H5T_ARRAY"); - } -} + case H5T_NO_CLASS: + case H5T_NCLASSES: + default: + HDassert(0); + return("Invalid class"); + } /* end switch */ +} /* end get_class() */ /*------------------------------------------------------------------------- * Function: print_found diff --git a/tools/lib/h5tools.c b/tools/lib/h5tools.c index c820aff..274b398 100644 --- a/tools/lib/h5tools.c +++ b/tools/lib/h5tools.c @@ -1498,14 +1498,24 @@ render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem, hsize_t } } break; - default: + + case H5T_TIME: + case H5T_BITFIELD: + case H5T_OPAQUE: for (block_index = 0; block_index < block_nelmts; block_index++) { mem = ((unsigned char*)_mem) + block_index * size; if (size != HDfwrite(mem, sizeof(char), size, stream)) H5E_THROW(FAIL, H5E_tools_min_id_g, "fwrite failed"); - } + } /* end for */ break; - } + + case H5T_NO_CLASS: + case H5T_NCLASSES: + default: + /* Badness */ + H5E_THROW(FAIL, H5E_tools_min_id_g, "bad type class"); + break; + } /* end switch */ CATCH return ret_value; diff --git a/tools/lib/h5tools_dump.c b/tools/lib/h5tools_dump.c index 26cac47..6388273 100644 --- a/tools/lib/h5tools_dump.c +++ b/tools/lib/h5tools_dump.c @@ -2476,6 +2476,8 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_ break; + case H5T_NO_CLASS: + case H5T_NCLASSES: default: h5tools_str_append(buffer, "unknown datatype"); break; @@ -2903,7 +2905,6 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, off_t offset; /* offset of external file */ char f_name[256]; /* filter name */ char name[256]; /* external or virtual file name */ - char dsetname[256]; /* virtual datset name */ hsize_t chsize[64]; /* chunk size in elements */ hsize_t size; /* size of external file */ hsize_t storage_size; @@ -3080,6 +3081,8 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, } } break; + case H5D_LAYOUT_ERROR: + case H5D_NLAYOUTS: default: h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s", "Unknown layout"); @@ -3305,6 +3308,7 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, case H5D_FILL_TIME_IFSET: h5tools_str_append(&buffer, "%s", "H5D_FILL_TIME_IFSET"); break; + case H5D_FILL_TIME_ERROR: default: HDassert(0); break; @@ -3362,6 +3366,8 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, case H5D_ALLOC_TIME_LATE: h5tools_str_append(&buffer, "%s", "H5D_ALLOC_TIME_LATE"); break; + case H5D_ALLOC_TIME_ERROR: + case H5D_ALLOC_TIME_DEFAULT: default: HDassert(0); break; diff --git a/tools/lib/h5tools_ref.c b/tools/lib/h5tools_ref.c index 0bb7d77..60666f1 100644 --- a/tools/lib/h5tools_ref.c +++ b/tools/lib/h5tools_ref.c @@ -218,7 +218,7 @@ ref_path_table_put(const char *path, haddr_t objno) HDassert(ref_path_table); HDassert(path); - if((new_node = HDmalloc(sizeof(ref_path_node_t))) == NULL) + if((new_node = (ref_path_node_t *)HDmalloc(sizeof(ref_path_node_t))) == NULL) return(-1); new_node->objno = objno; @@ -300,7 +300,7 @@ lookup_ref_path(haddr_t ref) if(ref_path_table == NULL) init_ref_path_table(); - node = H5SL_search(ref_path_table, &ref); + node = (ref_path_node_t *)H5SL_search(ref_path_table, &ref); return(node ? node->path : NULL); } diff --git a/tools/lib/h5tools_str.c b/tools/lib/h5tools_str.c index b61ed34..88308ed 100644 --- a/tools/lib/h5tools_str.c +++ b/tools/lib/h5tools_str.c @@ -1058,6 +1058,8 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai h5tools_str_append(str, H5_TOOLS_DATATYPE); break; + case H5O_TYPE_UNKNOWN: + case H5O_TYPE_NTYPES: default: h5tools_str_append(str, "%u-", (unsigned) oi.type); break; @@ -1187,7 +1189,9 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai } break; - default: + case H5T_TIME: + case H5T_BITFIELD: + case H5T_OPAQUE: { /* All other types get printed as hexadecimal */ size_t i; @@ -1200,6 +1204,12 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai } } break; + + case H5T_NO_CLASS: + case H5T_NCLASSES: + default: + h5tools_str_append(str, "invalid datatype"); + break; } /* end switch */ } return h5tools_str_fmt(str, start, OPT(info->elmt_fmt, "%s")); @@ -1394,7 +1404,7 @@ h5tools_str_replace ( const char *string, const char *substr, const char *replac head = newstr; while ( (tok = HDstrstr ( head, substr ))){ oldstr = newstr; - newstr = HDmalloc ( HDstrlen ( oldstr ) - HDstrlen ( substr ) + HDstrlen ( replacement ) + 1 ); + newstr = (char *)HDmalloc( HDstrlen( oldstr ) - HDstrlen( substr ) + HDstrlen( replacement ) + 1 ); if ( newstr == NULL ){ HDfree (oldstr); diff --git a/tools/lib/h5tools_type.c b/tools/lib/h5tools_type.c index d68d3c5..8a56d29 100644 --- a/tools/lib/h5tools_type.c +++ b/tools/lib/h5tools_type.c @@ -13,6 +13,7 @@ * access to either file, you may request a copy from help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +#include "H5private.h" #include "h5tools.h" /*------------------------------------------------------------------------- @@ -75,54 +76,54 @@ h5tools_get_little_endian_type(hid_t tid) size = H5Tget_size(tid); sign = H5Tget_sign(tid); - switch( type_class ) - { - case H5T_INTEGER: - { - if ( size == 1 && sign == H5T_SGN_2) - p_type=H5Tcopy(H5T_STD_I8LE); - else if ( size == 2 && sign == H5T_SGN_2) - p_type=H5Tcopy(H5T_STD_I16LE); - else if ( size == 4 && sign == H5T_SGN_2) - p_type=H5Tcopy(H5T_STD_I32LE); - else if ( size == 8 && sign == H5T_SGN_2) - p_type=H5Tcopy(H5T_STD_I64LE); - else if ( size == 1 && sign == H5T_SGN_NONE) - p_type=H5Tcopy(H5T_STD_U8LE); - else if ( size == 2 && sign == H5T_SGN_NONE) - p_type=H5Tcopy(H5T_STD_U16LE); - else if ( size == 4 && sign == H5T_SGN_NONE) - p_type=H5Tcopy(H5T_STD_U32LE); - else if ( size == 8 && sign == H5T_SGN_NONE) - p_type=H5Tcopy(H5T_STD_U64LE); - } - break; - - case H5T_FLOAT: - if ( size == 4) - p_type=H5Tcopy(H5T_IEEE_F32LE); - else if ( size == 8) - p_type=H5Tcopy(H5T_IEEE_F64LE); - break; - - case H5T_TIME: - case H5T_BITFIELD: - case H5T_OPAQUE: - case H5T_STRING: - case H5T_COMPOUND: - case H5T_REFERENCE: - case H5T_ENUM: - case H5T_VLEN: - case H5T_ARRAY: - break; - - default: - break; - - } - - return(p_type); -} + switch(type_class) { + case H5T_INTEGER: + if ( size == 1 && sign == H5T_SGN_2) + p_type=H5Tcopy(H5T_STD_I8LE); + else if ( size == 2 && sign == H5T_SGN_2) + p_type=H5Tcopy(H5T_STD_I16LE); + else if ( size == 4 && sign == H5T_SGN_2) + p_type=H5Tcopy(H5T_STD_I32LE); + else if ( size == 8 && sign == H5T_SGN_2) + p_type=H5Tcopy(H5T_STD_I64LE); + else if ( size == 1 && sign == H5T_SGN_NONE) + p_type=H5Tcopy(H5T_STD_U8LE); + else if ( size == 2 && sign == H5T_SGN_NONE) + p_type=H5Tcopy(H5T_STD_U16LE); + else if ( size == 4 && sign == H5T_SGN_NONE) + p_type=H5Tcopy(H5T_STD_U32LE); + else if ( size == 8 && sign == H5T_SGN_NONE) + p_type=H5Tcopy(H5T_STD_U64LE); + break; + + case H5T_FLOAT: + if ( size == 4) + p_type=H5Tcopy(H5T_IEEE_F32LE); + else if ( size == 8) + p_type=H5Tcopy(H5T_IEEE_F64LE); + break; + + case H5T_TIME: + case H5T_BITFIELD: + case H5T_OPAQUE: + case H5T_STRING: + case H5T_COMPOUND: + case H5T_REFERENCE: + case H5T_ENUM: + case H5T_VLEN: + case H5T_ARRAY: + break; + + case H5T_NO_CLASS: + case H5T_NCLASSES: + default: + HDassert(0); + break; + + } /* end switch */ + + return p_type; +} /* end h5tools_get_little_endian_type() */ /*------------------------------------------------------------------------- @@ -152,53 +153,51 @@ h5tools_get_big_endian_type(hid_t tid) size = H5Tget_size(tid); sign = H5Tget_sign(tid); - switch( type_class ) - { - case H5T_INTEGER: - { - if ( size == 1 && sign == H5T_SGN_2) - p_type=H5Tcopy(H5T_STD_I8BE); - else if ( size == 2 && sign == H5T_SGN_2) - p_type=H5Tcopy(H5T_STD_I16BE); - else if ( size == 4 && sign == H5T_SGN_2) - p_type=H5Tcopy(H5T_STD_I32BE); - else if ( size == 8 && sign == H5T_SGN_2) - p_type=H5Tcopy(H5T_STD_I64BE); - else if ( size == 1 && sign == H5T_SGN_NONE) - p_type=H5Tcopy(H5T_STD_U8BE); - else if ( size == 2 && sign == H5T_SGN_NONE) - p_type=H5Tcopy(H5T_STD_U16BE); - else if ( size == 4 && sign == H5T_SGN_NONE) - p_type=H5Tcopy(H5T_STD_U32BE); - else if ( size == 8 && sign == H5T_SGN_NONE) - p_type=H5Tcopy(H5T_STD_U64BE); - } - break; - - case H5T_FLOAT: - if ( size == 4) - p_type=H5Tcopy(H5T_IEEE_F32BE); - else if ( size == 8) - p_type=H5Tcopy(H5T_IEEE_F64BE); - break; - - case H5T_TIME: - case H5T_BITFIELD: - case H5T_OPAQUE: - case H5T_STRING: - case H5T_COMPOUND: - case H5T_REFERENCE: - case H5T_ENUM: - case H5T_VLEN: - case H5T_ARRAY: - break; - - default: - break; - - } - - - return(p_type); -} + switch(type_class) { + case H5T_INTEGER: + if ( size == 1 && sign == H5T_SGN_2) + p_type=H5Tcopy(H5T_STD_I8BE); + else if ( size == 2 && sign == H5T_SGN_2) + p_type=H5Tcopy(H5T_STD_I16BE); + else if ( size == 4 && sign == H5T_SGN_2) + p_type=H5Tcopy(H5T_STD_I32BE); + else if ( size == 8 && sign == H5T_SGN_2) + p_type=H5Tcopy(H5T_STD_I64BE); + else if ( size == 1 && sign == H5T_SGN_NONE) + p_type=H5Tcopy(H5T_STD_U8BE); + else if ( size == 2 && sign == H5T_SGN_NONE) + p_type=H5Tcopy(H5T_STD_U16BE); + else if ( size == 4 && sign == H5T_SGN_NONE) + p_type=H5Tcopy(H5T_STD_U32BE); + else if ( size == 8 && sign == H5T_SGN_NONE) + p_type=H5Tcopy(H5T_STD_U64BE); + break; + + case H5T_FLOAT: + if ( size == 4) + p_type=H5Tcopy(H5T_IEEE_F32BE); + else if ( size == 8) + p_type=H5Tcopy(H5T_IEEE_F64BE); + break; + + case H5T_TIME: + case H5T_BITFIELD: + case H5T_OPAQUE: + case H5T_STRING: + case H5T_COMPOUND: + case H5T_REFERENCE: + case H5T_ENUM: + case H5T_VLEN: + case H5T_ARRAY: + break; + + case H5T_NO_CLASS: + case H5T_NCLASSES: + default: + HDassert(0); + break; + } /* end switch */ + + return p_type; +} /* end h5tools_get_big_endian_type() */ diff --git a/tools/lib/h5tools_utils.c b/tools/lib/h5tools_utils.c index fc8cf1d..a09a003 100644 --- a/tools/lib/h5tools_utils.c +++ b/tools/lib/h5tools_utils.c @@ -612,7 +612,10 @@ find_objs_cb(const char *name, const H5O_info_t *oinfo, const char *already_seen } /* end if */ break; + case H5O_TYPE_UNKNOWN: + case H5O_TYPE_NTYPES: default: + HDassert(0); break; } /* end switch */ diff --git a/tools/lib/io_timer.c b/tools/lib/io_timer.c index b8d44de..b85133d 100644 --- a/tools/lib/io_timer.c +++ b/tools/lib/io_timer.c @@ -169,6 +169,10 @@ set_time(io_time_t *pt, timer_type t, int start_stop) pt->total_time[HDF5_FILE_READ_CLOSE] += pt->mpi_timer[t] - pt->mpi_timer[HDF5_FINE_READ_FIXED_DIMS]; } break; +#else + case MPI_CLOCK: + HDfprintf(stderr, "MPI clock set in serial library\n"); + return NULL; #endif /* H5_HAVE_PARALLEL */ case SYS_CLOCK: if (start_stop == TSTART) { @@ -197,11 +201,11 @@ set_time(io_time_t *pt, timer_type t, int start_stop) } break; + default: - HDfprintf(stderr, "Unknown time clock type (%d)\n", pt->type); - return (NULL); - break; - } + HDfprintf(stderr, "Unknown time clock type (%d)\n", pt->type); + return NULL; + } /* end switch */ #if 0 /* this does not belong here. Need fix in h5perf code when set_time() is called. -AKC- */ diff --git a/tools/misc/h5debug.c b/tools/misc/h5debug.c index be6d089..3789723 100644 --- a/tools/misc/h5debug.c +++ b/tools/misc/h5debug.c @@ -121,8 +121,9 @@ get_H5B2_class(const uint8_t *sig) cls = H5A_BT2_CORDER; break; + case H5B2_NUM_BTREE_ID: default: - HDfprintf(stderr, "Unknown B-tree subtype %u\n", (unsigned)(subtype)); + HDfprintf(stderr, "Unknown v2 B-tree subtype %u\n", (unsigned)(subtype)); HDexit(4); } /* end switch */ @@ -156,8 +157,9 @@ get_H5EA_class(const uint8_t *sig) cls = H5EA_CLS_TEST; break; + case H5EA_NUM_CLS_ID: default: - HDfprintf(stderr, "Unknown array class %u\n", (unsigned)(clsid)); + HDfprintf(stderr, "Unknown extensible array class %u\n", (unsigned)(clsid)); HDexit(4); } /* end switch */ @@ -191,8 +193,9 @@ get_H5FA_class(const uint8_t *sig) cls = H5FA_CLS_TEST; break; + case H5FA_NUM_CLS_ID: default: - HDfprintf(stderr, "Unknown array class %u\n", (unsigned)(clsid)); + HDfprintf(stderr, "Unknown fixed array class %u\n", (unsigned)(clsid)); HDexit(4); } /* end switch */ @@ -382,8 +385,9 @@ main(int argc, char *argv[]) status = H5D_btree_debug(f, H5P_DATASET_XFER_DEFAULT, addr, stdout, 0, VCOL, ndims, dim); break; + case H5B_NUM_BTREE_ID: default: - HDfprintf(stderr, "Unknown B-tree subtype %u\n", (unsigned)(subtype)); + HDfprintf(stderr, "Unknown v1 B-tree subtype %u\n", (unsigned)(subtype)); HDexit(4); } diff --git a/tools/misc/h5mkgrp.c b/tools/misc/h5mkgrp.c index 8dee706..1c1bba1 100644 --- a/tools/misc/h5mkgrp.c +++ b/tools/misc/h5mkgrp.c @@ -181,7 +181,7 @@ parse_command_line(int argc, const char *argv[], param_t *parms) /* Allocate space for the group name pointers */ parms->ngroups = (argc - opt_ind); - parms->groups = HDmalloc(parms->ngroups * sizeof(char *)); + parms->groups = (char **)HDmalloc(parms->ngroups * sizeof(char *)); /* Retrieve the group names */ curr_group = 0; diff --git a/tools/misc/h5repart.c b/tools/misc/h5repart.c index ffd52e8..f58af3a 100644 --- a/tools/misc/h5repart.c +++ b/tools/misc/h5repart.c @@ -261,13 +261,13 @@ main (int argc, char *argv[]) src_is_family = strcmp (src_name, src_gen_name); if ((src=HDopen(src_name, O_RDONLY,0))<0) { - perror (src_name); - exit (EXIT_FAILURE); + perror (src_name); + exit (EXIT_FAILURE); } if (HDfstat(src, &sb)<0) { - perror ("fstat"); - exit (EXIT_FAILURE); + perror ("fstat"); + exit (EXIT_FAILURE); } src_size = src_act_size = sb.st_size; if (verbose) fprintf (stderr, "< %s\n", src_name); @@ -290,7 +290,7 @@ main (int argc, char *argv[]) if (argno=0); /* The data */ - buf = calloc(1, SQUARE (DS_SIZE*CH_SIZE)); + buf = (signed char *)calloc(1, SQUARE (DS_SIZE*CH_SIZE)); H5Dwrite(dset, H5T_NATIVE_SCHAR, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf); free(buf); @@ -194,7 +194,7 @@ static double test_rowmaj (int op, size_t cache_size, size_t io_size) { hid_t file, dset, mem_space, file_space; - signed char *buf = calloc (1, (size_t)(SQUARE(io_size))); + signed char *buf = (signed char *)calloc (1, (size_t)(SQUARE(io_size))); hsize_t i, j, hs_size[2]; hsize_t hs_offset[2]; int mdc_nelmts; @@ -273,7 +273,7 @@ test_diag (int op, size_t cache_size, size_t io_size, size_t offset) hsize_t i, hs_size[2]; hsize_t nio = 0; hsize_t hs_offset[2]; - signed char *buf = calloc (1, (size_t)(SQUARE (io_size))); + signed char *buf = (signed char *)calloc(1, (size_t)(SQUARE (io_size))); int mdc_nelmts; size_t rdcc_nelmts; double w0; diff --git a/tools/perform/overhead.c b/tools/perform/overhead.c index 0288ffa..feabd3a 100644 --- a/tools/perform/overhead.c +++ b/tools/perform/overhead.c @@ -224,7 +224,7 @@ test(fill_t fill_style, const double splits[], if ((fd=HDopen(FILE_NAME_1, O_RDONLY, 0666)) < 0) goto error; if(FILL_RANDOM==fill_style) - had = calloc((size_t)cur_size[0], sizeof(int)); + had = (int *)calloc((size_t)cur_size[0], sizeof(int)); for (i=1; i<=cur_size[0]; i++) { diff --git a/tools/perform/sio_engine.c b/tools/perform/sio_engine.c index 3b28ea7..5622810 100644 --- a/tools/perform/sio_engine.c +++ b/tools/perform/sio_engine.c @@ -181,7 +181,7 @@ do_sio(parameters param) } /* Allocate transfer buffer */ - if ((buffer = malloc(linear_buf_size)) == NULL){ + if ((buffer = (char *)malloc(linear_buf_size)) == NULL){ HDfprintf(stderr, "malloc for transfer buffer size (%zu) failed\n", linear_buf_size); GOTOERROR(FAIL); } diff --git a/tools/perform/sio_perf.c b/tools/perform/sio_perf.c index 7d75a2d..34d8552 100644 --- a/tools/perform/sio_perf.c +++ b/tools/perform/sio_perf.c @@ -481,16 +481,16 @@ run_test(iotype iot, parameters parms, struct options *opts) /* allocate space for tables minmax and that it is sufficient */ /* to initialize all elements to zeros by calloc. */ - write_sys_mm_table = calloc((size_t)parms.num_iters , sizeof(minmax)); - write_mm_table = calloc((size_t)parms.num_iters , sizeof(minmax)); - write_gross_mm_table = calloc((size_t)parms.num_iters , sizeof(minmax)); - write_raw_mm_table = calloc((size_t)parms.num_iters , sizeof(minmax)); + write_sys_mm_table = (minmax *)calloc((size_t)parms.num_iters , sizeof(minmax)); + write_mm_table = (minmax *)calloc((size_t)parms.num_iters , sizeof(minmax)); + write_gross_mm_table = (minmax *)calloc((size_t)parms.num_iters , sizeof(minmax)); + write_raw_mm_table = (minmax *)calloc((size_t)parms.num_iters , sizeof(minmax)); if (!parms.h5_write_only) { - read_sys_mm_table = calloc((size_t)parms.num_iters , sizeof(minmax)); - read_mm_table = calloc((size_t)parms.num_iters , sizeof(minmax)); - read_gross_mm_table = calloc((size_t)parms.num_iters , sizeof(minmax)); - read_raw_mm_table = calloc((size_t)parms.num_iters , sizeof(minmax)); + read_sys_mm_table = (minmax *)calloc((size_t)parms.num_iters , sizeof(minmax)); + read_mm_table = (minmax *)calloc((size_t)parms.num_iters , sizeof(minmax)); + read_gross_mm_table = (minmax *)calloc((size_t)parms.num_iters , sizeof(minmax)); + read_raw_mm_table = (minmax *)calloc((size_t)parms.num_iters , sizeof(minmax)); } /* Do IO iteration times, collecting statistics each time */ @@ -1443,6 +1443,10 @@ void debug_start_stop_time(io_time_t *pt, timer_type t, int start_stop) case HDF5_RAW_READ_FIXED_DIMS: msg = "Raw Read"; break; + case HDF5_FILE_READ_OPEN: + case HDF5_FILE_READ_CLOSE: + case HDF5_FILE_WRITE_OPEN: + case HDF5_FILE_WRITE_CLOSE: default: msg = "Unknown Timer"; break; -- cgit v0.12 From 81ca9e4c79a125cfcea9e426e1e91d94cdf6a2aa Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 31 Aug 2015 15:08:56 -0500 Subject: [svn-r27627] Change hardcoded HDF5TESTEXPRESS value to use a CMake variable HDF_TEST_EXPRESS. --- CMakeLists.txt | 25 +++++++++++++++---------- config/cmake/cacheinit.cmake | 2 ++ test/CMakeTests.cmake | 14 ++++++++------ 3 files changed, 25 insertions(+), 16 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c75114e..cd3e1c9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -614,8 +614,23 @@ if (BUILD_TESTING) CACHE INTEGER "Timeout in seconds for each test (default 1200=20minutes)" ) + + option (HDF5_TEST_VFD "Execute tests with different VFDs" OFF) + mark_as_advanced (HDF5_TEST_VFD) + if (HDF5_TEST_VFD) + option (HDF5_TEST_FHEAP_VFD "Execute tests with different VFDs" ON) + mark_as_advanced (HDF5_TEST_FHEAP_VFD) + endif (HDF5_TEST_VFD) + + option (HDF_TEST_EXPRESS "Control testing framework (0-3)" "0") + mark_as_advanced (HDF_TEST_EXPRESS) + + include (${HDF5_SOURCE_DIR}/CTestConfig.cmake) + configure_file (${HDF_RESOURCES_DIR}/CTestCustom.cmake ${HDF5_BINARY_DIR}/CTestCustom.ctest @ONLY) + enable_testing () include (CTest) + if (NOT HDF5_EXTERNALLY_CONFIGURED) if (EXISTS "${HDF5_SOURCE_DIR}/test" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/test") add_subdirectory (${HDF5_SOURCE_DIR}/tools/lib ${PROJECT_BINARY_DIR}/tools/lib) @@ -627,16 +642,6 @@ if (BUILD_TESTING) endif (EXISTS "${HDF5_SOURCE_DIR}/testpar" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/testpar") endif (H5_HAVE_PARALLEL) endif (NOT HDF5_EXTERNALLY_CONFIGURED) - - option (HDF5_TEST_VFD "Execute tests with different VFDs" OFF) - mark_as_advanced (HDF5_TEST_VFD) - if (HDF5_TEST_VFD) - option (HDF5_TEST_FHEAP_VFD "Execute tests with different VFDs" ON) - mark_as_advanced (HDF5_TEST_FHEAP_VFD) - endif (HDF5_TEST_VFD) - - include (${HDF5_SOURCE_DIR}/CTestConfig.cmake) - configure_file (${HDF_RESOURCES_DIR}/CTestCustom.cmake ${HDF5_BINARY_DIR}/CTestCustom.ctest @ONLY) endif (BUILD_TESTING) #----------------------------------------------------------------------------- diff --git a/config/cmake/cacheinit.cmake b/config/cmake/cacheinit.cmake index cca6e98..4bef99f 100644 --- a/config/cmake/cacheinit.cmake +++ b/config/cmake/cacheinit.cmake @@ -46,6 +46,8 @@ set (HDF5_USE_18_API_DEFAULT OFF CACHE BOOL "Use the HDF5 1.8.x API by default" set (HDF5_ENABLE_THREADSAFE OFF CACHE BOOL "(WINDOWS)Enable Threadsafety" FORCE) +set (HDF_TEST_EXPRESS "2" CACHE STRING "Control testing framework (0-3)" FORCE) + set (HDF5_PACKAGE_EXTLIBS OFF CACHE BOOL "(WINDOWS)CPACK - include external libraries" FORCE) set (HDF5_NO_PACKAGES OFF CACHE BOOL "CPACK - Disable packaging" FORCE) diff --git a/test/CMakeTests.cmake b/test/CMakeTests.cmake index 5fe51ed..0efa2ae 100644 --- a/test/CMakeTests.cmake +++ b/test/CMakeTests.cmake @@ -562,9 +562,10 @@ if (NOT CYGWIN) add_test (NAME H5TEST-cache COMMAND $) set_tests_properties (H5TEST-cache PROPERTIES DEPENDS H5TEST-clear-cache-objects - ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST;HDF5TestExpress=2" + ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST;HDF5TestExpress=${HDF_TEST_EXPRESS}" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST ) + set_tests_properties (H5TEST-cache PROPERTIES TIMEOUT 2400) endif (NOT CYGWIN) #-- Adding test for cache_api @@ -725,9 +726,10 @@ if (BUILD_SHARED_LIBS) add_test (NAME H5TEST-shared-cache COMMAND $) set_tests_properties (H5TEST-shared-cache PROPERTIES DEPENDS H5TEST-shared-clear-cache-objects - ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST-shared;HDF5TestExpress=2" + ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST-shared;HDF5TestExpress=${HDF_TEST_EXPRESS}" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST-shared ) + set_tests_properties (H5TEST-cache PROPERTIES TIMEOUT 2400) endif (NOT CYGWIN) #-- Adding test for cache_api @@ -1052,7 +1054,7 @@ if (HDF5_TEST_VFD) -P "${HDF_RESOURCES_DIR}/vfdTest.cmake" ) set_tests_properties (VFD-${vfdname}-${vfdtest} PROPERTIES - ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname};HDF5TestExpress=2" + ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname};HDF5TestExpress=${HDF_TEST_EXPRESS}" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname} ) if (BUILD_SHARED_LIBS) @@ -1068,7 +1070,7 @@ if (HDF5_TEST_VFD) -P "${HDF_RESOURCES_DIR}/vfdTest.cmake" ) set_tests_properties (VFD-${vfdname}-${vfdtest}-shared PROPERTIES - ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}-shared;HDF5TestExpress=2" + ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}-shared;HDF5TestExpress=${HDF_TEST_EXPRESS}" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname}-shared ) endif (BUILD_SHARED_LIBS) @@ -1136,7 +1138,7 @@ if (HDF5_TEST_VFD) ) set_tests_properties (VFD-${vfdname}-fheap PROPERTIES TIMEOUT 1800 - ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname};HDF5TestExpress=2" + ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname};HDF5TestExpress=${HDF_TEST_EXPRESS}" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname} ) if (BUILD_SHARED_LIBS) @@ -1153,7 +1155,7 @@ if (HDF5_TEST_VFD) ) set_tests_properties (VFD-${vfdname}-fheap-shared PROPERTIES TIMEOUT 1800 - ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}-shared;HDF5TestExpress=2" + ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}-shared;HDF5TestExpress=${HDF_TEST_EXPRESS}" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname}-shared ) endif (BUILD_SHARED_LIBS) -- cgit v0.12 From a90e09889d575b26648f642d3bc85639df165dc9 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Mon, 31 Aug 2015 16:43:02 -0500 Subject: [svn-r27631] Description: Make error values from hyperslab operations clearer. Tested on: MacOSX/64 10.10.5 (amazon) w/serial & parallel (Too minor to require h5committest) --- src/H5Edefin.h | 1 + src/H5Einit.h | 5 +++ src/H5Epubgen.h | 2 ++ src/H5Eterm.h | 3 +- src/H5Shyper.c | 96 ++++++++++++++++++++++++++++----------------------------- src/H5err.txt | 1 + 6 files changed, 59 insertions(+), 49 deletions(-) diff --git a/src/H5Edefin.h b/src/H5Edefin.h index 183f72c..066c35d 100644 --- a/src/H5Edefin.h +++ b/src/H5Edefin.h @@ -194,6 +194,7 @@ hid_t H5E_CANTSELECT_g = FAIL; /* Can't select hyperslab */ hid_t H5E_CANTNEXT_g = FAIL; /* Can't move to next iterator location */ hid_t H5E_BADSELECT_g = FAIL; /* Invalid selection */ hid_t H5E_CANTCOMPARE_g = FAIL; /* Can't compare objects */ +hid_t H5E_CANTAPPEND_g = FAIL; /* Can't append object */ /* Argument errors */ hid_t H5E_UNINITIALIZED_g = FAIL; /* Information is uinitialized */ diff --git a/src/H5Einit.h b/src/H5Einit.h index 9724748..35049b2 100644 --- a/src/H5Einit.h +++ b/src/H5Einit.h @@ -740,6 +740,11 @@ if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't compare objects"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") if((H5E_CANTCOMPARE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") +assert(H5E_CANTAPPEND_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't append object"))==NULL) + HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") +if((H5E_CANTAPPEND_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) + HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") /* Argument errors */ assert(H5E_UNINITIALIZED_g==(-1)); diff --git a/src/H5Epubgen.h b/src/H5Epubgen.h index e79106f..8b60079 100644 --- a/src/H5Epubgen.h +++ b/src/H5Epubgen.h @@ -328,12 +328,14 @@ H5_DLLVAR hid_t H5E_CANTRECV_g; /* Can't receive data */ #define H5E_CANTNEXT (H5OPEN H5E_CANTNEXT_g) #define H5E_BADSELECT (H5OPEN H5E_BADSELECT_g) #define H5E_CANTCOMPARE (H5OPEN H5E_CANTCOMPARE_g) +#define H5E_CANTAPPEND (H5OPEN H5E_CANTAPPEND_g) H5_DLLVAR hid_t H5E_CANTCLIP_g; /* Can't clip hyperslab region */ H5_DLLVAR hid_t H5E_CANTCOUNT_g; /* Can't count elements */ H5_DLLVAR hid_t H5E_CANTSELECT_g; /* Can't select hyperslab */ H5_DLLVAR hid_t H5E_CANTNEXT_g; /* Can't move to next iterator location */ H5_DLLVAR hid_t H5E_BADSELECT_g; /* Invalid selection */ H5_DLLVAR hid_t H5E_CANTCOMPARE_g; /* Can't compare objects */ +H5_DLLVAR hid_t H5E_CANTAPPEND_g; /* Can't append object */ /* Argument errors */ #define H5E_UNINITIALIZED (H5OPEN H5E_UNINITIALIZED_g) diff --git a/src/H5Eterm.h b/src/H5Eterm.h index 5db503c..bf39a6b 100644 --- a/src/H5Eterm.h +++ b/src/H5Eterm.h @@ -195,7 +195,8 @@ H5E_CANTCOUNT_g= H5E_CANTSELECT_g= H5E_CANTNEXT_g= H5E_BADSELECT_g= -H5E_CANTCOMPARE_g= +H5E_CANTCOMPARE_g= +H5E_CANTAPPEND_g= /* Argument errors */ H5E_UNINITIALIZED_g= diff --git a/src/H5Shyper.c b/src/H5Shyper.c index 51b5ab6..a2eb804 100644 --- a/src/H5Shyper.c +++ b/src/H5Shyper.c @@ -4833,7 +4833,7 @@ H5S_hyper_clip_spans (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s /* Merge/add span 'a' with/to a_not_b list */ if(H5S_hyper_append_span(&last_a_not_b,a_not_b,span_a->low,span_a->high,span_a->down,NULL)==FAIL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span") + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTAPPEND, FAIL, "can't allocate hyperslab span") /* Advance span 'a', leave span 'b' */ H5S_hyper_recover_span(&recover_a,&span_a,span_a->next); @@ -4848,7 +4848,7 @@ H5S_hyper_clip_spans (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s /* Merge/add lower part of span 'a' with/to a_not_b list */ if(H5S_hyper_append_span(&last_a_not_b,a_not_b,span_a->low,span_b->low-1,span_a->down,NULL)==FAIL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span") + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTAPPEND, FAIL, "can't allocate hyperslab span") /* Check for overlaps between upper part of span 'a' and lower part of span 'b' */ @@ -4859,7 +4859,7 @@ H5S_hyper_clip_spans (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s if(span_a->down==NULL) { /* Merge/add overlapped part with/to a_and_b list */ if(H5S_hyper_append_span(&last_a_and_b,a_and_b,span_b->low,span_a->high,NULL,NULL)==FAIL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span") + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTAPPEND, FAIL, "can't allocate hyperslab span") } /* end if */ /* If there are down spans, check for the overlap in them and add to each appropriate list */ else { @@ -4876,7 +4876,7 @@ H5S_hyper_clip_spans (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s if(down_a_not_b!=NULL) { /* Merge/add overlapped part with/to a_not_b list */ if(H5S_hyper_append_span(&last_a_not_b,a_not_b,span_b->low,span_a->high,down_a_not_b,NULL)==FAIL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span") + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTAPPEND, FAIL, "can't allocate hyperslab span") /* Release the down span tree generated */ H5S_hyper_free_span_info(down_a_not_b); @@ -4886,7 +4886,7 @@ H5S_hyper_clip_spans (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s if(down_a_and_b!=NULL) { /* Merge/add overlapped part with/to a_and_b list */ if(H5S_hyper_append_span(&last_a_and_b,a_and_b,span_b->low,span_a->high,down_a_and_b,NULL)==FAIL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span") + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTAPPEND, FAIL, "can't allocate hyperslab span") /* Release the down span tree generated */ H5S_hyper_free_span_info(down_a_and_b); @@ -4896,7 +4896,7 @@ H5S_hyper_clip_spans (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s if(down_b_not_a!=NULL) { /* Merge/add overlapped part with/to b_not_a list */ if(H5S_hyper_append_span(&last_b_not_a,b_not_a,span_b->low,span_a->high,down_b_not_a,NULL)==FAIL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span") + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTAPPEND, FAIL, "can't allocate hyperslab span") /* Release the down span tree generated */ H5S_hyper_free_span_info(down_b_not_a); @@ -4935,7 +4935,7 @@ H5S_hyper_clip_spans (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s /* Merge/add lower part of span 'a' with/to a_not_b list */ if(H5S_hyper_append_span(&last_a_not_b,a_not_b,span_a->low,span_b->low-1,span_a->down,NULL)==FAIL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span") + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTAPPEND, FAIL, "can't allocate hyperslab span") /* Check for overlaps between middle part of span 'a' and span 'b' */ @@ -4946,7 +4946,7 @@ H5S_hyper_clip_spans (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s if(span_a->down==NULL) { /* Merge/add overlapped part with/to a_and_b list */ if(H5S_hyper_append_span(&last_a_and_b,a_and_b,span_b->low,span_b->high,NULL,NULL)==FAIL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span") + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTAPPEND, FAIL, "can't allocate hyperslab span") } /* end if */ /* If there are down spans, check for the overlap in them and add to each appropriate list */ else { @@ -4963,7 +4963,7 @@ H5S_hyper_clip_spans (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s if(down_a_not_b!=NULL) { /* Merge/add overlapped part with/to a_not_b list */ if(H5S_hyper_append_span(&last_a_not_b,a_not_b,span_b->low,span_b->high,down_a_not_b,NULL)==FAIL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span") + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTAPPEND, FAIL, "can't allocate hyperslab span") /* Release the down span tree generated */ H5S_hyper_free_span_info(down_a_not_b); @@ -4973,7 +4973,7 @@ H5S_hyper_clip_spans (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s if(down_a_and_b!=NULL) { /* Merge/add overlapped part with/to a_and_b list */ if(H5S_hyper_append_span(&last_a_and_b,a_and_b,span_b->low,span_b->high,down_a_and_b,NULL)==FAIL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span") + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTAPPEND, FAIL, "can't allocate hyperslab span") /* Release the down span tree generated */ H5S_hyper_free_span_info(down_a_and_b); @@ -4983,7 +4983,7 @@ H5S_hyper_clip_spans (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s if(down_b_not_a!=NULL) { /* Merge/add overlapped part with/to b_not_a list */ if(H5S_hyper_append_span(&last_b_not_a,b_not_a,span_b->low,span_b->high,down_b_not_a,NULL)==FAIL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span") + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTAPPEND, FAIL, "can't allocate hyperslab span") /* Release the down span tree generated */ H5S_hyper_free_span_info(down_b_not_a); @@ -5014,7 +5014,7 @@ H5S_hyper_clip_spans (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s if(span_a->low>span_b->low) { /* Merge/add lower part of span 'b' with/to b_not_a list */ if(H5S_hyper_append_span(&last_b_not_a,b_not_a,span_b->low,span_a->low-1,span_b->down,NULL)==FAIL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span") + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTAPPEND, FAIL, "can't allocate hyperslab span") } /* end if */ else { /* Keep going, nothing to split off */ @@ -5029,7 +5029,7 @@ H5S_hyper_clip_spans (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s if(span_a->down==NULL) { /* Merge/add overlapped part with/to a_and_b list */ if(H5S_hyper_append_span(&last_a_and_b,a_and_b,span_a->low,span_a->high,NULL,NULL)==FAIL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span") + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTAPPEND, FAIL, "can't allocate hyperslab span") } /* end if */ /* If there are down spans, check for the overlap in them and add to each appropriate list */ else { @@ -5046,7 +5046,7 @@ H5S_hyper_clip_spans (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s if(down_a_not_b!=NULL) { /* Merge/add overlapped part with/to a_not_b list */ if(H5S_hyper_append_span(&last_a_not_b,a_not_b,span_a->low,span_a->high,down_a_not_b,NULL)==FAIL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span") + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTAPPEND, FAIL, "can't allocate hyperslab span") /* Release the down span tree generated */ H5S_hyper_free_span_info(down_a_not_b); @@ -5056,7 +5056,7 @@ H5S_hyper_clip_spans (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s if(down_a_and_b!=NULL) { /* Merge/add overlapped part with/to a_and_b list */ if(H5S_hyper_append_span(&last_a_and_b,a_and_b,span_a->low,span_a->high,down_a_and_b,NULL)==FAIL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span") + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTAPPEND, FAIL, "can't allocate hyperslab span") /* Release the down span tree generated */ H5S_hyper_free_span_info(down_a_and_b); @@ -5066,7 +5066,7 @@ H5S_hyper_clip_spans (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s if(down_b_not_a!=NULL) { /* Merge/add overlapped part with/to b_not_a list */ if(H5S_hyper_append_span(&last_b_not_a,b_not_a,span_a->low,span_a->high,down_b_not_a,NULL)==FAIL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span") + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTAPPEND, FAIL, "can't allocate hyperslab span") /* Release the down span tree generated */ H5S_hyper_free_span_info(down_b_not_a); @@ -5106,7 +5106,7 @@ H5S_hyper_clip_spans (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s /* Merge/add lower part of span 'b' with/to b_not_a list */ if(H5S_hyper_append_span(&last_b_not_a,b_not_a,span_b->low,span_a->low-1,span_b->down,NULL)==FAIL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span") + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTAPPEND, FAIL, "can't allocate hyperslab span") } /* end if */ else { /* Keep going, nothing to split off */ @@ -5121,7 +5121,7 @@ H5S_hyper_clip_spans (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s if(span_a->down==NULL) { /* Merge/add overlapped part with/to a_and_b list */ if(H5S_hyper_append_span(&last_a_and_b,a_and_b,span_a->low,span_b->high,NULL,NULL)==FAIL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span") + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTAPPEND, FAIL, "can't allocate hyperslab span") } /* end if */ /* If there are down spans, check for the overlap in them and add to each appropriate list */ else { @@ -5138,7 +5138,7 @@ H5S_hyper_clip_spans (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s if(down_a_not_b!=NULL) { /* Merge/add overlapped part with/to a_not_b list */ if(H5S_hyper_append_span(&last_a_not_b,a_not_b,span_a->low,span_b->high,down_a_not_b,NULL)==FAIL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span") + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTAPPEND, FAIL, "can't allocate hyperslab span") /* Release the down span tree generated */ H5S_hyper_free_span_info(down_a_not_b); @@ -5148,7 +5148,7 @@ H5S_hyper_clip_spans (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s if(down_a_and_b!=NULL) { /* Merge/add overlapped part with/to a_and_b list */ if(H5S_hyper_append_span(&last_a_and_b,a_and_b,span_a->low,span_b->high,down_a_and_b,NULL)==FAIL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span") + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTAPPEND, FAIL, "can't allocate hyperslab span") /* Release the down span tree generated */ H5S_hyper_free_span_info(down_a_and_b); @@ -5158,7 +5158,7 @@ H5S_hyper_clip_spans (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s if(down_b_not_a!=NULL) { /* Merge/add overlapped part with/to b_not_a list */ if(H5S_hyper_append_span(&last_b_not_a,b_not_a,span_a->low,span_b->high,down_b_not_a,NULL)==FAIL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span") + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTAPPEND, FAIL, "can't allocate hyperslab span") /* Release the down span tree generated */ H5S_hyper_free_span_info(down_b_not_a); @@ -5187,7 +5187,7 @@ H5S_hyper_clip_spans (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s /* Merge/add span 'b' with/to b_not_a list */ if(H5S_hyper_append_span(&last_b_not_a,b_not_a,span_b->low,span_b->high,span_b->down,NULL)==FAIL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span") + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTAPPEND, FAIL, "can't allocate hyperslab span") /* Advance span 'b', leave span 'a' */ H5S_hyper_recover_span(&recover_b,&span_b,span_b->next); @@ -5201,7 +5201,7 @@ H5S_hyper_clip_spans (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s /* Merge/add span 'a' with/to a_not_b list */ if(H5S_hyper_append_span(&last_a_not_b,a_not_b,span_a->low,span_a->high,span_a->down,NULL)==FAIL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span") + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTAPPEND, FAIL, "can't allocate hyperslab span") /* Advance to the next 'a' span */ H5S_hyper_recover_span(&recover_a,&span_a,span_a->next); @@ -5214,7 +5214,7 @@ H5S_hyper_clip_spans (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s /* Merge/add span 'b' with/to b_not_a list */ if(H5S_hyper_append_span(&last_b_not_a,b_not_a,span_b->low,span_b->high,span_b->down,NULL)==FAIL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span") + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTAPPEND, FAIL, "can't allocate hyperslab span") /* Advance to the next 'b' span */ H5S_hyper_recover_span(&recover_b,&span_b,span_b->next); @@ -5296,7 +5296,7 @@ H5S_hyper_merge_spans_helper (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_inf if(span_a->highlow) { /* Merge/add span 'a' with/to the merged spans */ if(H5S_hyper_append_span(&prev_span_merge,&merged_spans,span_a->low,span_a->high,span_a->down,NULL)==FAIL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span") + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTAPPEND, NULL, "can't allocate hyperslab span") /* Advance span 'a' */ H5S_hyper_recover_span(&recover_a,&span_a,span_a->next); @@ -5311,19 +5311,19 @@ H5S_hyper_merge_spans_helper (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_inf if(H5S_hyper_cmp_spans(span_a->down,span_b->down)==TRUE) { /* Merge/add copy of span 'a' with/to merged spans */ if(H5S_hyper_append_span(&prev_span_merge,&merged_spans,span_a->low,span_a->high,span_a->down,NULL)==FAIL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span") + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTAPPEND, NULL, "can't allocate hyperslab span") } /* end if */ else { /* Merge/add lower part of span 'a' with/to merged spans */ if(H5S_hyper_append_span(&prev_span_merge,&merged_spans,span_a->low,span_b->low-1,span_a->down,NULL)==FAIL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span") + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTAPPEND, NULL, "can't allocate hyperslab span") /* Get merged span tree for overlapped section */ tmp_spans=H5S_hyper_merge_spans_helper(span_a->down,span_b->down); /* Merge/add overlapped section to merged spans */ if(H5S_hyper_append_span(&prev_span_merge,&merged_spans,span_b->low,span_a->high,tmp_spans,NULL)==FAIL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span") + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTAPPEND, NULL, "can't allocate hyperslab span") /* Release merged span tree for overlapped section */ H5S_hyper_free_span_info(tmp_spans); @@ -5360,19 +5360,19 @@ H5S_hyper_merge_spans_helper (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_inf if(H5S_hyper_cmp_spans(span_a->down,span_b->down)==TRUE) { /* Merge/add copy of lower & middle parts of span 'a' to merged spans */ if(H5S_hyper_append_span(&prev_span_merge,&merged_spans,span_a->low,span_b->high,span_a->down,NULL)==FAIL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span") + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTAPPEND, NULL, "can't allocate hyperslab span") } /* end if */ else { /* Merge/add lower part of span 'a' to merged spans */ if(H5S_hyper_append_span(&prev_span_merge,&merged_spans,span_a->low,span_b->low-1,span_a->down,NULL)==FAIL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span") + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTAPPEND, NULL, "can't allocate hyperslab span") /* Get merged span tree for overlapped section */ tmp_spans=H5S_hyper_merge_spans_helper(span_a->down,span_b->down); /* Merge/add overlapped section to merged spans */ if(H5S_hyper_append_span(&prev_span_merge,&merged_spans,span_b->low,span_b->high,tmp_spans,NULL)==FAIL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span") + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTAPPEND, NULL, "can't allocate hyperslab span") /* Release merged span tree for overlapped section */ H5S_hyper_free_span_info(tmp_spans); @@ -5400,14 +5400,14 @@ H5S_hyper_merge_spans_helper (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_inf if(H5S_hyper_cmp_spans(span_a->down,span_b->down)==TRUE) { /* Merge/add copy of lower & middle parts of span 'b' to merged spans */ if(H5S_hyper_append_span(&prev_span_merge,&merged_spans,span_b->low,span_a->high,span_a->down,NULL)==FAIL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span") + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTAPPEND, NULL, "can't allocate hyperslab span") } /* end if */ else { /* Check if there is a lower part of span 'b' */ if(span_a->low>span_b->low) { /* Merge/add lower part of span 'b' to merged spans */ if(H5S_hyper_append_span(&prev_span_merge,&merged_spans,span_b->low,span_a->low-1,span_b->down,NULL)==FAIL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span") + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTAPPEND, NULL, "can't allocate hyperslab span") } /* end if */ else { /* No lower part of span 'b' , keep going... */ @@ -5418,7 +5418,7 @@ H5S_hyper_merge_spans_helper (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_inf /* Merge/add overlapped section to merged spans */ if(H5S_hyper_append_span(&prev_span_merge,&merged_spans,span_a->low,span_a->high,tmp_spans,NULL)==FAIL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span") + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTAPPEND, NULL, "can't allocate hyperslab span") /* Release merged span tree for overlapped section */ H5S_hyper_free_span_info(tmp_spans); @@ -5455,14 +5455,14 @@ H5S_hyper_merge_spans_helper (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_inf if(H5S_hyper_cmp_spans(span_a->down,span_b->down)==TRUE) { /* Merge/add copy of span 'b' to merged spans if so */ if(H5S_hyper_append_span(&prev_span_merge,&merged_spans,span_b->low,span_b->high,span_b->down,NULL)==FAIL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span") + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTAPPEND, NULL, "can't allocate hyperslab span") } /* end if */ else { /* Check if there is a lower part of span 'b' */ if(span_a->low>span_b->low) { /* Merge/add lower part of span 'b' to merged spans */ if(H5S_hyper_append_span(&prev_span_merge,&merged_spans,span_b->low,span_a->low-1,span_b->down,NULL)==FAIL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span") + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTAPPEND, NULL, "can't allocate hyperslab span") } /* end if */ else { /* No lower part of span 'b' , keep going... */ @@ -5473,7 +5473,7 @@ H5S_hyper_merge_spans_helper (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_inf /* Merge/add overlapped section to merged spans */ if(H5S_hyper_append_span(&prev_span_merge,&merged_spans,span_a->low,span_b->high,tmp_spans,NULL)==FAIL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span") + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTAPPEND, NULL, "can't allocate hyperslab span") /* Release merged span tree for overlapped section */ H5S_hyper_free_span_info(tmp_spans); @@ -5499,7 +5499,7 @@ H5S_hyper_merge_spans_helper (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_inf else { /* Merge/add span 'b' with the merged spans */ if(H5S_hyper_append_span(&prev_span_merge,&merged_spans,span_b->low,span_b->high,span_b->down,NULL)==FAIL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span") + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTAPPEND, NULL, "can't allocate hyperslab span") /* Advance span 'b' */ H5S_hyper_recover_span(&recover_b,&span_b,span_b->next); @@ -5511,7 +5511,7 @@ H5S_hyper_merge_spans_helper (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_inf while(span_a!=NULL) { /* Merge/add all 'a' spans into the merged spans */ if(H5S_hyper_append_span(&prev_span_merge,&merged_spans,span_a->low,span_a->high,span_a->down,NULL)==FAIL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span") + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTAPPEND, NULL, "can't allocate hyperslab span") /* Advance to next 'a' span, until all processed */ H5S_hyper_recover_span(&recover_a,&span_a,span_a->next); @@ -5523,7 +5523,7 @@ H5S_hyper_merge_spans_helper (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_inf while(span_b!=NULL) { /* Merge/add all 'b' spans into the merged spans */ if(H5S_hyper_append_span(&prev_span_merge,&merged_spans,span_b->low,span_b->high,span_b->down,NULL)==FAIL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span") + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTAPPEND, NULL, "can't allocate hyperslab span") /* Advance to next 'b' span, until all processed */ H5S_hyper_recover_span(&recover_b,&span_b,span_b->next); @@ -7099,8 +7099,8 @@ H5S_select_hyperslab (H5S_t *space, H5S_seloper_t op, HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDELETE, FAIL, "can't release hyperslab") /* Allocate space for the hyperslab selection information */ - if((space->select.sel_info.hslab=H5FL_MALLOC(H5S_hyper_sel_t))==NULL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab info") + if(NULL == (space->select.sel_info.hslab = H5FL_MALLOC(H5S_hyper_sel_t))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab info") /* Save the diminfo */ space->select.num_elem=1; @@ -7119,18 +7119,18 @@ H5S_select_hyperslab (H5S_t *space, H5S_seloper_t op, } /* end for */ /* Indicate that the dimension information is valid */ - space->select.sel_info.hslab->diminfo_valid=TRUE; + space->select.sel_info.hslab->diminfo_valid = TRUE; /* Indicate that there's no slab information */ - space->select.sel_info.hslab->span_lst=NULL; + space->select.sel_info.hslab->span_lst = NULL; } /* end if */ else if(op>=H5S_SELECT_OR && op<=H5S_SELECT_NOTA) { /* Sanity check */ HDassert(H5S_GET_SELECT_TYPE(space) == H5S_SEL_HYPERSLABS); /* Check if there's no hyperslab span information currently */ - if(space->select.sel_info.hslab->span_lst==NULL) - if(H5S_hyper_generate_spans(space)<0) + if(NULL == space->select.sel_info.hslab->span_lst) + if(H5S_hyper_generate_spans(space) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_UNINITIALIZED, FAIL, "dataspace does not have span tree") /* Add in the new hyperslab information */ @@ -7144,7 +7144,7 @@ H5S_select_hyperslab (H5S_t *space, H5S_seloper_t op, HGOTO_ERROR(H5E_ARGS, H5E_UNSUPPORTED, FAIL, "invalid selection operation") /* Set selection type */ - space->select.type=H5S_sel_hyper; + space->select.type = H5S_sel_hyper; done: FUNC_LEAVE_NOAPI(ret_value) @@ -8794,7 +8794,7 @@ H5S_hyper_get_seq_list(const H5S_t *space, unsigned H5_ATTR_UNUSED flags, H5S_se /* Make certain that we don't write too many */ actual_elem = MIN3(leftover, (size_t)iter->elmt_left, maxelem); - /* initialize row sizes for each dimension */ + /* Initialize row sizes for each dimension */ elem_size = iter->elmt_size; for(i = (int)fast_dim, acc = elem_size; i >= 0; i--) { slab[i] = acc; diff --git a/src/H5err.txt b/src/H5err.txt index 5a38cdf..e0ebf5e 100644 --- a/src/H5err.txt +++ b/src/H5err.txt @@ -217,6 +217,7 @@ MINOR, DSPACE, H5E_CANTSELECT, Can't select hyperslab MINOR, DSPACE, H5E_CANTNEXT, Can't move to next iterator location MINOR, DSPACE, H5E_BADSELECT, Invalid selection MINOR, DSPACE, H5E_CANTCOMPARE, Can't compare objects +MINOR, DSPACE, H5E_CANTAPPEND, Can't append object # Property list errors MINOR, PLIST, H5E_CANTGET, Can't get value -- cgit v0.12 From 137f153ba2c3b147a0f79f24c4fe3dc3949bfb56 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Tue, 1 Sep 2015 01:30:21 -0500 Subject: [svn-r27641] Merge of r27616 from autotools_rework Replaced AC_CONFIG_HEADER (obsolete macro) with AC_CONFIG_HEADERS followed by bin/reconfigure (which changed nothing at this time). Fixes HDFFV-9284 Tested on: jam --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index d170c1d..63170b7 100644 --- a/configure.ac +++ b/configure.ac @@ -29,7 +29,7 @@ AC_PREREQ([2.69]) AC_INIT([HDF5], [1.9.230], [help@hdfgroup.org]) AC_CONFIG_SRCDIR([src/H5.c]) -AC_CONFIG_HEADER([src/H5config.h]) +AC_CONFIG_HEADERS([src/H5config.h]) AC_CONFIG_AUX_DIR([bin]) AC_CONFIG_MACRO_DIR([m4]) -- cgit v0.12 From bb8c64169b3f018d38b761db501c0931f8418dc7 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Tue, 1 Sep 2015 01:34:14 -0500 Subject: [svn-r27642] Removed comments from MANIFEST regarding distributing the gen_* files in test/. These files will remain distributable since they are needed if a user specifies --enable-build-all. Fixes HDFFV-8236 Tested on: jam (bin/chkmanifest only) --- MANIFEST | 2 -- 1 file changed, 2 deletions(-) diff --git a/MANIFEST b/MANIFEST index 36ea2fe..d557809 100644 --- a/MANIFEST +++ b/MANIFEST @@ -877,7 +877,6 @@ ./test/filter_fail.c ./test/flush1.c ./test/flush2.c -# ====distribute this for now. See HDFFV-8236==== ./test/gen_bad_ohdr.c ./test/gen_bad_compound.c ./test/gen_bogus.c @@ -901,7 +900,6 @@ ./test/gen_sizes_lheap.c ./test/gen_specmetaread.c ./test/gen_udlinks.c -# ====end distribute this for now. See HDFFV-8236==== ./test/getname.c ./test/gheap.c ./test/group_old.h5 -- cgit v0.12 From 17f5ee36247d6a73f8b92318c9fa0a03381ea1e7 Mon Sep 17 00:00:00 2001 From: Scot Breitenfeld Date: Tue, 1 Sep 2015 09:00:14 -0500 Subject: [svn-r27647] Added compiler check for PGI and CMake version. CMake must be > v3.3 to compile with PGI due to CMake bug in earlier versions. --- CMakeLists.txt | 13 +++++++++++++ fortran/test/fortranlib_test.F90 | 2 ++ 2 files changed, 15 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index cd3e1c9..0c1556e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,19 @@ cmake_minimum_required (VERSION 3.1.0) PROJECT (HDF5 C CXX) +if (HDF5_BUILD_FORTRAN) + include (${CMAKE_ROOT}/Modules/CMakeDetermineFortranCompiler.cmake) + if (${CMAKE_Fortran_COMPILER_ID}) + enable_language(Fortran) + endif () + +# Building with PGI requires CMake 3.3 or greater because previous versions +# of CMake add the wrong compiler flag for the PGI Fortran compiler. + if ("${CMAKE_Fortran_COMPILER_ID}" MATCHES "PGI" AND "${CMAKE_VERSION}" VERSION_LESS "3.3") + message (FATAL_ERROR " **** PGI FORTRAN REQUIRES CMAKE VERSION 3.3 OR GREATER **** ") + endif () +endif () + #----------------------------------------------------------------------------- # Instructions for use : Normal Build # diff --git a/fortran/test/fortranlib_test.F90 b/fortran/test/fortranlib_test.F90 index c3e995b..2f88c45 100644 --- a/fortran/test/fortranlib_test.F90 +++ b/fortran/test/fortranlib_test.F90 @@ -24,6 +24,8 @@ ! !***** +!#include + PROGRAM fortranlibtest USE HDF5 -- cgit v0.12 From f72ed2d8dc73528f68d18635c6a488309ae470a4 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 1 Sep 2015 09:56:39 -0500 Subject: [svn-r27648] Fortran executables depend on modules created by test library, add command to explictly enforce the building of the library before building executables. --- fortran/test/CMakeLists.txt | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/fortran/test/CMakeLists.txt b/fortran/test/CMakeLists.txt index 692cc4d..18d067d 100644 --- a/fortran/test/CMakeLists.txt +++ b/fortran/test/CMakeLists.txt @@ -164,6 +164,8 @@ set_target_properties (testhdf5_fortran PROPERTIES FOLDER test/fortran Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/static ) +add_dependencies (testhdf5_fortran ${HDF5_F90_TEST_LIB_TARGET}) + if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) add_executable (testhdf5_fortran-shared fortranlib_test.F90 @@ -198,6 +200,7 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) FOLDER test/fortran Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/shared ) + add_dependencies (testhdf5_fortran-shared ${HDF5_F90_TEST_LIBSH_TARGET}) endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) #-- Adding test for testhdf5_fortran_1_8 @@ -225,6 +228,8 @@ set_target_properties (testhdf5_fortran_1_8 PROPERTIES FOLDER test/fortran Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/static ) +add_dependencies (testhdf5_fortran_1_8 ${HDF5_F90_TEST_LIB_TARGET}) + if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) add_executable (testhdf5_fortran_1_8-shared fortranlib_test_1_8.F90 @@ -250,6 +255,7 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) FOLDER test/fortran Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/shared ) + add_dependencies (testhdf5_fortran_1_8-shared ${HDF5_F90_TEST_LIBSH_TARGET}) endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) #-- Adding test for fortranlib_test_F03 @@ -279,6 +285,8 @@ set_target_properties (fortranlib_test_F03 PROPERTIES FOLDER test/fortran Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/static ) +add_dependencies (fortranlib_test_F03 ${HDF5_F90_TEST_LIB_TARGET}) + if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) add_executable (fortranlib_test_F03-shared fortranlib_test_F03.F90 @@ -305,7 +313,8 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) LINKER_LANGUAGE Fortran FOLDER test/fortran Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/shared -) + ) + add_dependencies (fortranlib_test_F03-shared ${HDF5_F90_TEST_LIBSH_TARGET}) endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) #-- Adding test for fflush1 @@ -326,6 +335,8 @@ set_target_properties (fflush1 PROPERTIES FOLDER test/fortran Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/static ) +add_dependencies (fflush1 ${HDF5_F90_TEST_LIB_TARGET}) + if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) add_executable (fflush1-shared fflush1.F90) TARGET_NAMING (fflush1-shared SHARED) @@ -344,6 +355,7 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) FOLDER test/fortran Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/shared ) + add_dependencies (fflush1-shared ${HDF5_F90_TEST_LIBSH_TARGET}) endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) #-- Adding test for fflush2 @@ -364,6 +376,8 @@ set_target_properties (fflush2 PROPERTIES FOLDER test/fortran Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/static ) +add_dependencies (fflush2 ${HDF5_F90_TEST_LIB_TARGET}) + if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) add_executable (fflush2-shared fflush2.F90) TARGET_NAMING (fflush2-shared SHARED) @@ -382,6 +396,7 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) FOLDER test/fortran Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/shared ) + add_dependencies (fflush2-shared ${HDF5_F90_TEST_LIBSH_TARGET}) endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) include (CMakeTests.cmake) -- cgit v0.12 From 099618ad484523038052838255f716bb9fd320d6 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Tue, 1 Sep 2015 11:12:53 -0500 Subject: [svn-r27653] Merge of r27645 from the autotools branch. Updates to older special config files in configure.ac: - solaris2.x renamed to solaris. There are recent changes to this file but the "2.x" is misleading since the changes are applied to all versions. - Removed support for OSF 4.x/5.x (Digital and Tru64 Unix). We no longer have the config files for these. Tested on: h5committest --- MANIFEST | 2 +- config/solaris | 159 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ config/solaris2.x | 159 ------------------------------------------------------ configure | 10 +--- configure.ac | 10 +--- 5 files changed, 164 insertions(+), 176 deletions(-) create mode 100644 config/solaris delete mode 100644 config/solaris2.x diff --git a/MANIFEST b/MANIFEST index d557809..6490071 100644 --- a/MANIFEST +++ b/MANIFEST @@ -113,7 +113,7 @@ ./config/pgi-fflags ./config/pgi-flags ./config/powerpc-ibm-aix5.x -./config/solaris2.x +./config/solaris ./config/x86_64-pc-cygwin ./config/site-specific/BlankForm diff --git a/config/solaris b/config/solaris new file mode 100644 index 0000000..310c373 --- /dev/null +++ b/config/solaris @@ -0,0 +1,159 @@ +# -*- shell-script -*- +# +# 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. + + +# This file is part of the HDF5 build script. It is processed shortly +# after configure starts and defines, among other things, flags for +# the various compile modes. +# +# See BlankForm in this directory for details + +# The default compiler is `sunpro cc' +if test "X-" = "X-$CC"; then + CC=cc + CC_BASENAME=cc +fi + +# Try gcc compiler flags +. $srcdir/config/gnu-flags + +# Try solaris native compiler flags +if test "X-" = "X-$cc_flags_set"; then + H5_CFLAGS="$H5_CFLAGS -erroff=%none -DBSD_COMP" + # -g produces rather slow code. "-g -O" produces much faster code with some + # loss of debugger functions such as not able to print local variables. + DEBUG_CFLAGS="-g -O" + DEBUG_CPPFLAGS= + PROD_CFLAGS="-O -s" + PROD_CPPFLAGS= + PROFILE_CFLAGS=-xpg + PROFILE_CPPFLAGS= + cc_flags_set=yes +# Special linking flag is needed to build with Fortran on Solaris 5.9 + system_version="`uname -r`" + case "$system_version" in + 5.9*) + # Need the xopenmp flag to build the Fortran library + if test X-$enable_fortran = X-yes; then + AM_LDFLAGS="$AM_LDFLAGS -xopenmp=stubs" + fi + ;; + esac + + # Turn off optimization flag for SUNpro compiler versions 4.x which + # have an optimization bug. Version 5.0 works. + ($CC -V 2>&1) | grep -s 'cc: .* C 4\.' >/dev/null 2>&1 \ + && PROD_CFLAGS="`echo $PROD_CFLAGS | sed -e 's/-O//'`" +fi + +LIBS="$LIBS" + +# The default Fortran 90 compiler + +if test "X-" = "X-$FC"; then + FC=f90 +fi + +if test "X-" = "X-$f9x_flags_set"; then + F9XSUFFIXFLAG="" + FSEARCH_DIRS="" + H5_FCFLAGS="$H5_FCFLAGS" + # -g produces rather slow code. "-g -O" produces much faster code with some + # loss of debugger functions such as not able to print local variables. + DEBUG_FCFLAGS="-g -O" + PROD_FCFLAGS="-O2" + PROFILE_FCFLAGS="" + f9x_flags_set=yes +fi + +# The default C++ compiler + +# The default compiler is `sunpro cc' +if test -z "$CXX"; then + CXX=CC + CXX_BASENAME=CC +fi + +# Try gcc compiler flags +#. $srcdir/config/gnu-flags + +cxx_version="`$CXX -V 2>&1 |grep 'WorkShop' |\ + sed 's/.*WorkShop.*C++ \([0-9\.]*\).*/\1/'`" + +cxx_vers_major=`echo $cxx_version | cut -f1 -d.` +cxx_vers_minor=`echo $cxx_version | cut -f2 -d.` +cxx_vers_patch=`echo $cxx_version | cut -f3 -d.` + +# Specify the "-features=tmplife" if the compiler can handle this... +if test -n "$cxx_version"; then + if test $cxx_vers_major -ge 5 -a $cxx_vers_minor -ge 3 -o $cxx_vers_major -gt 5; then + H5_CXXFLAGS="$H5_CXXFLAGS -features=tmplife" + fi +fi + +# Try solaris native compiler flags +if test -z "$cxx_flags_set"; then + H5_CXXFLAGS="$H5_CXXFLAGS -instances=static" + H5_CPPFLAGS="$H5_CPPFLAGS -LANG:std" + # -g produces rather slow code. "-g -O" produces much faster code with some + # loss of debugger functions such as not able to print local variables. + DEBUG_CXXFLAGS="-g -O" + DEBUG_CPPFLAGS= + PROD_CXXFLAGS="-O -s" + PROD_CPPFLAGS= + PROFILE_CXXFLAGS=-xpg + PROFILE_CPPFLAGS= + cxx_flags_set=yes +fi + +# compiler version strings +case $CC in + *cc*) + cc_version_info=`$CC $CFLAGS $H5_CFLAGS -V 2>&1 | grep 'Sun' |\ + sed 's/.*\(Sun .*\)/\1 /'` + ;; + + *) + echo "No match to get cc_version_info for $CC" + ;; +esac +echo "C compiler '$CC' is $cc_version_info" + +case $FC in + # The PGI and Intel compilers are automatically detected below + *f90*) + fc_version_info=`$FC $FCFLAGS $H5_FCFLAGS -V 2>&1 | grep 'Sun' |\ + sed 's/.*\(Sun .*\)/\1 /'` + ;; + + *) + echo "No match to get fc_version_info for $FC" + ;; +esac +echo "Fortran compiler '$FC' is $fc_version_info" + +# get c++ version info +case $CXX in + *CC*) + cxx_version_info=`$CXX $CXXFLAGS $H5_CXXFLAGS -V 2>&1 | grep 'Sun' |\ + sed 's/.*\(Sun .*\)/\1 /'` + ;; + + *) + echo "No match to get cxx_version_info for $CXX" + ;; +esac + + diff --git a/config/solaris2.x b/config/solaris2.x deleted file mode 100644 index 310c373..0000000 --- a/config/solaris2.x +++ /dev/null @@ -1,159 +0,0 @@ -# -*- shell-script -*- -# -# 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. - - -# This file is part of the HDF5 build script. It is processed shortly -# after configure starts and defines, among other things, flags for -# the various compile modes. -# -# See BlankForm in this directory for details - -# The default compiler is `sunpro cc' -if test "X-" = "X-$CC"; then - CC=cc - CC_BASENAME=cc -fi - -# Try gcc compiler flags -. $srcdir/config/gnu-flags - -# Try solaris native compiler flags -if test "X-" = "X-$cc_flags_set"; then - H5_CFLAGS="$H5_CFLAGS -erroff=%none -DBSD_COMP" - # -g produces rather slow code. "-g -O" produces much faster code with some - # loss of debugger functions such as not able to print local variables. - DEBUG_CFLAGS="-g -O" - DEBUG_CPPFLAGS= - PROD_CFLAGS="-O -s" - PROD_CPPFLAGS= - PROFILE_CFLAGS=-xpg - PROFILE_CPPFLAGS= - cc_flags_set=yes -# Special linking flag is needed to build with Fortran on Solaris 5.9 - system_version="`uname -r`" - case "$system_version" in - 5.9*) - # Need the xopenmp flag to build the Fortran library - if test X-$enable_fortran = X-yes; then - AM_LDFLAGS="$AM_LDFLAGS -xopenmp=stubs" - fi - ;; - esac - - # Turn off optimization flag for SUNpro compiler versions 4.x which - # have an optimization bug. Version 5.0 works. - ($CC -V 2>&1) | grep -s 'cc: .* C 4\.' >/dev/null 2>&1 \ - && PROD_CFLAGS="`echo $PROD_CFLAGS | sed -e 's/-O//'`" -fi - -LIBS="$LIBS" - -# The default Fortran 90 compiler - -if test "X-" = "X-$FC"; then - FC=f90 -fi - -if test "X-" = "X-$f9x_flags_set"; then - F9XSUFFIXFLAG="" - FSEARCH_DIRS="" - H5_FCFLAGS="$H5_FCFLAGS" - # -g produces rather slow code. "-g -O" produces much faster code with some - # loss of debugger functions such as not able to print local variables. - DEBUG_FCFLAGS="-g -O" - PROD_FCFLAGS="-O2" - PROFILE_FCFLAGS="" - f9x_flags_set=yes -fi - -# The default C++ compiler - -# The default compiler is `sunpro cc' -if test -z "$CXX"; then - CXX=CC - CXX_BASENAME=CC -fi - -# Try gcc compiler flags -#. $srcdir/config/gnu-flags - -cxx_version="`$CXX -V 2>&1 |grep 'WorkShop' |\ - sed 's/.*WorkShop.*C++ \([0-9\.]*\).*/\1/'`" - -cxx_vers_major=`echo $cxx_version | cut -f1 -d.` -cxx_vers_minor=`echo $cxx_version | cut -f2 -d.` -cxx_vers_patch=`echo $cxx_version | cut -f3 -d.` - -# Specify the "-features=tmplife" if the compiler can handle this... -if test -n "$cxx_version"; then - if test $cxx_vers_major -ge 5 -a $cxx_vers_minor -ge 3 -o $cxx_vers_major -gt 5; then - H5_CXXFLAGS="$H5_CXXFLAGS -features=tmplife" - fi -fi - -# Try solaris native compiler flags -if test -z "$cxx_flags_set"; then - H5_CXXFLAGS="$H5_CXXFLAGS -instances=static" - H5_CPPFLAGS="$H5_CPPFLAGS -LANG:std" - # -g produces rather slow code. "-g -O" produces much faster code with some - # loss of debugger functions such as not able to print local variables. - DEBUG_CXXFLAGS="-g -O" - DEBUG_CPPFLAGS= - PROD_CXXFLAGS="-O -s" - PROD_CPPFLAGS= - PROFILE_CXXFLAGS=-xpg - PROFILE_CPPFLAGS= - cxx_flags_set=yes -fi - -# compiler version strings -case $CC in - *cc*) - cc_version_info=`$CC $CFLAGS $H5_CFLAGS -V 2>&1 | grep 'Sun' |\ - sed 's/.*\(Sun .*\)/\1 /'` - ;; - - *) - echo "No match to get cc_version_info for $CC" - ;; -esac -echo "C compiler '$CC' is $cc_version_info" - -case $FC in - # The PGI and Intel compilers are automatically detected below - *f90*) - fc_version_info=`$FC $FCFLAGS $H5_FCFLAGS -V 2>&1 | grep 'Sun' |\ - sed 's/.*\(Sun .*\)/\1 /'` - ;; - - *) - echo "No match to get fc_version_info for $FC" - ;; -esac -echo "Fortran compiler '$FC' is $fc_version_info" - -# get c++ version info -case $CXX in - *CC*) - cxx_version_info=`$CXX $CXXFLAGS $H5_CXXFLAGS -V 2>&1 | grep 'Sun' |\ - sed 's/.*\(Sun .*\)/\1 /'` - ;; - - *) - echo "No match to get cxx_version_info for $CXX" - ;; -esac - - diff --git a/configure b/configure index 9d4726f..6c8b0ff 100755 --- a/configure +++ b/configure @@ -3956,14 +3956,8 @@ case $host_os in freebsd*) host_os_novers=freebsd ;; - osf4.*) - host_os_novers=osf4.x - ;; - osf5.*) - host_os_novers=osf5.x - ;; - solaris2.*) - host_os_novers=solaris2.x + solaris*) + host_os_novers=solaris ;; *) host_os_novers=$host_os diff --git a/configure.ac b/configure.ac index 63170b7..3d4c4a4 100644 --- a/configure.ac +++ b/configure.ac @@ -246,14 +246,8 @@ case $host_os in freebsd*) host_os_novers=freebsd ;; - osf4.*) - host_os_novers=osf4.x - ;; - osf5.*) - host_os_novers=osf5.x - ;; - solaris2.*) - host_os_novers=solaris2.x + solaris*) + host_os_novers=solaris ;; *) host_os_novers=$host_os -- cgit v0.12 From e5dbc90ad2646aaf0ca3e30dce659a70291345d9 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 1 Sep 2015 13:35:16 -0500 Subject: [svn-r27656] HDFFV-9515: repack failed with 5 digit filter ids because a local variable in the parse routine was not large enough. Tested: local linux and windows --- tools/h5repack/h5repack_parse.c | 956 ++++++++++++++++++++-------------------- 1 file changed, 478 insertions(+), 478 deletions(-) diff --git a/tools/h5repack/h5repack_parse.c b/tools/h5repack/h5repack_parse.c index 8a297a7..1d71c13 100644 --- a/tools/h5repack/h5repack_parse.c +++ b/tools/h5repack/h5repack_parse.c @@ -47,473 +47,473 @@ obj_list_t* parse_filter(const char *str, - int *n_objs, - filter_info_t *filt, - pack_opt_t *options, - int *is_glb) + int *n_objs, + filter_info_t *filt, + pack_opt_t *options, + int *is_glb) { - unsigned i, u; - char c; - size_t len=HDstrlen(str); - int j, m, n, k, l, p, r, q, end_obj=-1, no_param=0; - char sobj[MAX_NC_NAME]; - char scomp[10]; - char stype[5]; - char smask[3]; - obj_list_t* obj_list=NULL; - unsigned pixels_per_block; - - - /* initialize compression info */ - HDmemset(filt,0,sizeof(filter_info_t)); - *is_glb = 0; - - /* check for the end of object list and number of objects */ - for ( i = 0, n = 0; i < len; i++) - { - c = str[i]; - if ( c==':' ) - { - end_obj=i; - } - if ( c==',' ) - { - n++; - } - } - - if (end_obj==-1) /* missing : */ - { - /* apply to all objects */ - options->all_filter=1; - *is_glb = 1; - } - - n++; - obj_list = (obj_list_t*) HDmalloc(n*sizeof(obj_list_t)); - if (obj_list==NULL) - { - error_msg("could not allocate object list\n"); - return NULL; - } - *n_objs=n; - - /* get object list */ - for ( j = 0, k = 0, n = 0; j < end_obj; j++, k++) - { - c = str[j]; - sobj[k] = c; - if ( c==',' || j==end_obj-1) - { - if ( c==',') sobj[k]='\0'; else sobj[k+1]='\0'; - HDstrcpy(obj_list[n].obj,sobj); - HDmemset(sobj,0,sizeof(sobj)); - n++; - k=-1; - } - } - /* nothing after : */ - if (end_obj+1==(int)len) - { - if (obj_list) HDfree(obj_list); - error_msg("input Error: Invalid compression type in <%s>\n",str); - HDexit(EXIT_FAILURE); - } - - - /* get filter additional parameters */ - m=0; - for ( i=end_obj+1, k=0, j=0; i - * pixels per block is a even number in 2-32 and coding method is 'EC' or 'NN' - * example SZIP=8,NN - *------------------------------------------------------------------------- - */ - if (HDstrcmp(scomp,"SZIP")==0) - { - l=-1; /* mask index check */ - for ( m=0,u=i+1; u\n",str); - HDexit(EXIT_FAILURE); - } - if (l==-1) - stype[m]=c; - else - { - smask[l]=c; - l++; - if (l==2) - { - smask[l]='\0'; - i=len-1; /* end */ - (*n_objs)--; /* we counted an extra ',' */ - if (HDstrcmp(smask,"NN")==0) - filt->cd_values[j++]=H5_SZIP_NN_OPTION_MASK; - else if (HDstrcmp(smask,"EC")==0) - filt->cd_values[j++]=H5_SZIP_EC_OPTION_MASK; - else - { - error_msg("szip mask must be 'NN' or 'EC' \n"); - HDexit(EXIT_FAILURE); - } - - - } - } - - } /* u */ - } /*if */ - - /*------------------------------------------------------------------------- - * H5Z_FILTER_SCALEOFFSET - * scaleoffset has the format SOFF= - * scale_type can be - * integer datatype, H5Z_SO_INT (IN) - * float datatype using D-scaling method, H5Z_SO_FLOAT_DSCALE (DS) - * float datatype using E-scaling method, H5Z_SO_FLOAT_ESCALE (ES) , not yet implemented - * for integer datatypes, scale_factor denotes Minimum Bits - * for float datatypes, scale_factor denotes decimal scale factor - * examples - * SOFF=31,IN - * SOFF=3,DF - *------------------------------------------------------------------------- - */ - - else if (HDstrcmp(scomp,"SOFF")==0) - { - l=-1; /* mask index check */ - for ( m=0,u=i+1; u\n",str); - HDexit(EXIT_FAILURE); - } - if (l==-1) - stype[m]=c; - else - { - smask[l]=c; - l++; - if (l==2) - { - smask[l]='\0'; - i=len-1; /* end */ - (*n_objs)--; /* we counted an extra ',' */ - if (HDstrcmp(smask,"IN")==0) - filt->cd_values[j++]=H5Z_SO_INT; - else if (HDstrcmp(smask,"DS")==H5Z_SO_FLOAT_DSCALE) - filt->cd_values[j++]=H5Z_SO_FLOAT_DSCALE; - else - { - error_msg("scale type must be 'IN' or 'DS' \n"); - HDexit(EXIT_FAILURE); - } - - } - } - - } /* u */ - } /*if */ - /*------------------------------------------------------------------------- - * User Defined - * has the format UD= - * BZIP2 example - * UD=307,1,9 - *------------------------------------------------------------------------- - */ - - else if (HDstrcmp(scomp,"UD")==0) - { - l=-1; /* filter number index check */ - p=-1; /* CD_VAL count check */ - r=-1; /* CD_VAL check */ - for ( m=0,q=0,u=i+1; ufiltn=atoi(stype); - l=0; - } - else if (p==-1) - { - filt->cd_nelmts=atoi(stype); - p=0; - } - else - r=0; - q=0; - u++; /* skip ',' */ - } - c = str[u]; - if (!isdigit(c) && l==-1) - { - if (obj_list) HDfree(obj_list); - error_msg("filter number parameter is not a digit in <%s>\n",str); - HDexit(EXIT_FAILURE); - } - stype[q]=c; - if (l==0 && p==0) - { - if (r==0) - filt->cd_values[j++]=atoi(stype); - } - - } /* u */ - - stype[q]='\0'; - } /*if */ - - - /*------------------------------------------------------------------------- - * all other filters - *------------------------------------------------------------------------- - */ - - else - { - /* here we could have 1 or 2 digits */ - for ( m=0,u=i+1; u\n",str); - HDexit(EXIT_FAILURE); - } - stype[m]=c; - } /* u */ - - stype[m]='\0'; - } /*if */ - - - - filt->cd_values[j++]=atoi(stype); - i+=m; /* jump */ - } - else if (i==len-1) - { /*no more parameters */ - scomp[k+1]='\0'; - no_param=1; - } - - /*------------------------------------------------------------------------- - * translate from string to filter symbol - *------------------------------------------------------------------------- - */ - - /*------------------------------------------------------------------------- - * H5Z_FILTER_NONE - *------------------------------------------------------------------------- - */ - if (HDstrcmp(scomp,"NONE")==0) - { - filt->filtn=H5Z_FILTER_NONE; - filt->cd_nelmts = 0; - } - - /*------------------------------------------------------------------------- - * H5Z_FILTER_DEFLATE - *------------------------------------------------------------------------- - */ - else if (HDstrcmp(scomp,"GZIP")==0) - { - filt->filtn=H5Z_FILTER_DEFLATE; - filt->cd_nelmts = 1; - if (no_param) - { /*no more parameters, GZIP must have parameter */ - if (obj_list) HDfree(obj_list); - error_msg("missing compression parameter in <%s>\n",str); - HDexit(EXIT_FAILURE); - } - } - - /*------------------------------------------------------------------------- - * H5Z_FILTER_SZIP - *------------------------------------------------------------------------- - */ - else if (HDstrcmp(scomp,"SZIP")==0) - { - filt->filtn=H5Z_FILTER_SZIP; - filt->cd_nelmts = 2; - if (no_param) - { /*no more parameters, SZIP must have parameter */ - if (obj_list) HDfree(obj_list); - error_msg("missing compression parameter in <%s>\n",str); - HDexit(EXIT_FAILURE); - } - } - - /*------------------------------------------------------------------------- - * H5Z_FILTER_SHUFFLE - *------------------------------------------------------------------------- - */ - else if (HDstrcmp(scomp,"SHUF")==0) - { - filt->filtn=H5Z_FILTER_SHUFFLE; - filt->cd_nelmts = 0; - if (m>0) - { /*shuffle does not have parameter */ - if (obj_list) HDfree(obj_list); - error_msg("extra parameter in SHUF <%s>\n",str); - HDexit(EXIT_FAILURE); - } - } - /*------------------------------------------------------------------------- - * H5Z_FILTER_FLETCHER32 - *------------------------------------------------------------------------- - */ - else if (HDstrcmp(scomp,"FLET")==0) - { - filt->filtn=H5Z_FILTER_FLETCHER32; - filt->cd_nelmts = 0; - if (m>0) - { /*shuffle does not have parameter */ - if (obj_list) HDfree(obj_list); - error_msg("extra parameter in FLET <%s>\n",str); - HDexit(EXIT_FAILURE); - } - } - /*------------------------------------------------------------------------- - * H5Z_FILTER_NBIT - *------------------------------------------------------------------------- - */ - else if (HDstrcmp(scomp,"NBIT")==0) - { - filt->filtn=H5Z_FILTER_NBIT; - filt->cd_nelmts = 0; - if (m>0) - { /*nbit does not have parameter */ - if (obj_list) HDfree(obj_list); - error_msg("extra parameter in NBIT <%s>\n",str); - HDexit(EXIT_FAILURE); - } - } - /*------------------------------------------------------------------------- - * H5Z_FILTER_SCALEOFFSET - *------------------------------------------------------------------------- - */ - else if (HDstrcmp(scomp,"SOFF")==0) - { - filt->filtn=H5Z_FILTER_SCALEOFFSET; - filt->cd_nelmts = 2; - if (no_param) - { /*no more parameters, SOFF must have parameter */ - if (obj_list) HDfree(obj_list); - error_msg("missing compression parameter in <%s>\n",str); - HDexit(EXIT_FAILURE); - } - } - /*------------------------------------------------------------------------- - * User Defined Filter - *------------------------------------------------------------------------- - */ - else if (HDstrcmp(scomp,"UD")==0) - { - if (filt->cd_nelmts != j) - { /* parameters does not match count */ - if (obj_list) HDfree(obj_list); - error_msg("incorrect number of compression parameters in <%s>\n",str); - HDexit(EXIT_FAILURE); - } - } - else { - if (obj_list) HDfree(obj_list); - error_msg("invalid filter type in <%s>\n",str); - HDexit(EXIT_FAILURE); - } - } - } /*i*/ - - /*------------------------------------------------------------------------- - * check valid parameters - *------------------------------------------------------------------------- - */ - - switch (filt->filtn) - { - - /*------------------------------------------------------------------------- - * H5Z_FILTER_DEFLATE - *------------------------------------------------------------------------- - */ - - case H5Z_FILTER_DEFLATE: - if (filt->cd_values[0]>9 ) - { - if (obj_list) HDfree(obj_list); - error_msg("invalid compression parameter in <%s>\n",str); - HDexit(EXIT_FAILURE); - } - break; - - /*------------------------------------------------------------------------- - * H5Z_FILTER_SZIP - *------------------------------------------------------------------------- - */ - - case H5Z_FILTER_SZIP: - pixels_per_block=filt->cd_values[0]; - if ((pixels_per_block%2)==1) - { - if (obj_list) HDfree(obj_list); - error_msg("pixels_per_block is not even in <%s>\n",str); - HDexit(EXIT_FAILURE); - } - if (pixels_per_block>H5_SZIP_MAX_PIXELS_PER_BLOCK) - { - if (obj_list) HDfree(obj_list); - error_msg("pixels_per_block is too large in <%s>\n",str); - HDexit(EXIT_FAILURE); - } - if ( (HDstrcmp(smask,"NN")!=0) && (HDstrcmp(smask,"EC")!=0) ) - { - if (obj_list) HDfree(obj_list); - error_msg("szip mask must be 'NN' or 'EC' \n"); - HDexit(EXIT_FAILURE); - } - break; - default: - break; - - - }; - - return obj_list; + unsigned i, u; + char c; + size_t len=HDstrlen(str); + int j, m, n, k, l, p, r, q, end_obj=-1, no_param=0; + char sobj[MAX_NC_NAME]; + char scomp[10]; + char stype[6]; + char smask[3]; + obj_list_t* obj_list=NULL; + unsigned pixels_per_block; + + + /* initialize compression info */ + HDmemset(filt,0,sizeof(filter_info_t)); + *is_glb = 0; + + /* check for the end of object list and number of objects */ + for ( i = 0, n = 0; i < len; i++) + { + c = str[i]; + if ( c==':' ) + { + end_obj=i; + } + if ( c==',' ) + { + n++; + } + } + + if (end_obj==-1) /* missing : */ + { + /* apply to all objects */ + options->all_filter=1; + *is_glb = 1; + } + + n++; + obj_list = (obj_list_t*) HDmalloc(n*sizeof(obj_list_t)); + if (obj_list==NULL) + { + error_msg("could not allocate object list\n"); + return NULL; + } + *n_objs=n; + + /* get object list */ + for ( j = 0, k = 0, n = 0; j < end_obj; j++, k++) + { + c = str[j]; + sobj[k] = c; + if ( c==',' || j==end_obj-1) + { + if ( c==',') sobj[k]='\0'; else sobj[k+1]='\0'; + HDstrcpy(obj_list[n].obj,sobj); + HDmemset(sobj,0,sizeof(sobj)); + n++; + k=-1; + } + } + /* nothing after : */ + if (end_obj+1==(int)len) + { + if (obj_list) HDfree(obj_list); + error_msg("input Error: Invalid compression type in <%s>\n",str); + HDexit(EXIT_FAILURE); + } + + + /* get filter additional parameters */ + m=0; + for ( i=end_obj+1, k=0, j=0; i + * pixels per block is a even number in 2-32 and coding method is 'EC' or 'NN' + * example SZIP=8,NN + *------------------------------------------------------------------------- + */ + if (HDstrcmp(scomp,"SZIP")==0) + { + l=-1; /* mask index check */ + for ( m=0,u=i+1; u\n",str); + HDexit(EXIT_FAILURE); + } + if (l==-1) + stype[m]=c; + else + { + smask[l]=c; + l++; + if (l==2) + { + smask[l]='\0'; + i=len-1; /* end */ + (*n_objs)--; /* we counted an extra ',' */ + if (HDstrcmp(smask,"NN")==0) + filt->cd_values[j++]=H5_SZIP_NN_OPTION_MASK; + else if (HDstrcmp(smask,"EC")==0) + filt->cd_values[j++]=H5_SZIP_EC_OPTION_MASK; + else + { + error_msg("szip mask must be 'NN' or 'EC' \n"); + HDexit(EXIT_FAILURE); + } + + + } + } + + } /* u */ + } /*if */ + + /*------------------------------------------------------------------------- + * H5Z_FILTER_SCALEOFFSET + * scaleoffset has the format SOFF= + * scale_type can be + * integer datatype, H5Z_SO_INT (IN) + * float datatype using D-scaling method, H5Z_SO_FLOAT_DSCALE (DS) + * float datatype using E-scaling method, H5Z_SO_FLOAT_ESCALE (ES) , not yet implemented + * for integer datatypes, scale_factor denotes Minimum Bits + * for float datatypes, scale_factor denotes decimal scale factor + * examples + * SOFF=31,IN + * SOFF=3,DF + *------------------------------------------------------------------------- + */ + + else if (HDstrcmp(scomp,"SOFF")==0) + { + l=-1; /* mask index check */ + for ( m=0,u=i+1; u\n",str); + HDexit(EXIT_FAILURE); + } + if (l==-1) + stype[m]=c; + else + { + smask[l]=c; + l++; + if (l==2) + { + smask[l]='\0'; + i=len-1; /* end */ + (*n_objs)--; /* we counted an extra ',' */ + if (HDstrcmp(smask,"IN")==0) + filt->cd_values[j++]=H5Z_SO_INT; + else if (HDstrcmp(smask,"DS")==H5Z_SO_FLOAT_DSCALE) + filt->cd_values[j++]=H5Z_SO_FLOAT_DSCALE; + else + { + error_msg("scale type must be 'IN' or 'DS' \n"); + HDexit(EXIT_FAILURE); + } + + } + } + + } /* u */ + } /*if */ + /*------------------------------------------------------------------------- + * User Defined + * has the format UD= + * BZIP2 example + * UD=307,1,9 + *------------------------------------------------------------------------- + */ + + else if (HDstrcmp(scomp,"UD")==0) + { + l=-1; /* filter number index check */ + p=-1; /* CD_VAL count check */ + r=-1; /* CD_VAL check */ + for ( m=0,q=0,u=i+1; ufiltn=atoi(stype); + l=0; + } + else if (p==-1) + { + filt->cd_nelmts=atoi(stype); + p=0; + } + else + r=0; + q=0; + u++; /* skip ',' */ + } + c = str[u]; + if (!isdigit(c) && l==-1) + { + if (obj_list) HDfree(obj_list); + error_msg("filter number parameter is not a digit in <%s>\n",str); + HDexit(EXIT_FAILURE); + } + stype[q]=c; + if (l==0 && p==0) + { + if (r==0) + filt->cd_values[j++]=atoi(stype); + } + + } /* u */ + + stype[q]='\0'; + } /*if */ + + + /*------------------------------------------------------------------------- + * all other filters + *------------------------------------------------------------------------- + */ + + else + { + /* here we could have 1 or 2 digits */ + for ( m=0,u=i+1; u\n",str); + HDexit(EXIT_FAILURE); + } + stype[m]=c; + } /* u */ + + stype[m]='\0'; + } /*if */ + + + + filt->cd_values[j++]=atoi(stype); + i+=m; /* jump */ + } + else if (i==len-1) + { /*no more parameters */ + scomp[k+1]='\0'; + no_param=1; + } + + /*------------------------------------------------------------------------- + * translate from string to filter symbol + *------------------------------------------------------------------------- + */ + + /*------------------------------------------------------------------------- + * H5Z_FILTER_NONE + *------------------------------------------------------------------------- + */ + if (HDstrcmp(scomp,"NONE")==0) + { + filt->filtn=H5Z_FILTER_NONE; + filt->cd_nelmts = 0; + } + + /*------------------------------------------------------------------------- + * H5Z_FILTER_DEFLATE + *------------------------------------------------------------------------- + */ + else if (HDstrcmp(scomp,"GZIP")==0) + { + filt->filtn=H5Z_FILTER_DEFLATE; + filt->cd_nelmts = 1; + if (no_param) + { /*no more parameters, GZIP must have parameter */ + if (obj_list) HDfree(obj_list); + error_msg("missing compression parameter in <%s>\n",str); + HDexit(EXIT_FAILURE); + } + } + + /*------------------------------------------------------------------------- + * H5Z_FILTER_SZIP + *------------------------------------------------------------------------- + */ + else if (HDstrcmp(scomp,"SZIP")==0) + { + filt->filtn=H5Z_FILTER_SZIP; + filt->cd_nelmts = 2; + if (no_param) + { /*no more parameters, SZIP must have parameter */ + if (obj_list) HDfree(obj_list); + error_msg("missing compression parameter in <%s>\n",str); + HDexit(EXIT_FAILURE); + } + } + + /*------------------------------------------------------------------------- + * H5Z_FILTER_SHUFFLE + *------------------------------------------------------------------------- + */ + else if (HDstrcmp(scomp,"SHUF")==0) + { + filt->filtn=H5Z_FILTER_SHUFFLE; + filt->cd_nelmts = 0; + if (m>0) + { /*shuffle does not have parameter */ + if (obj_list) HDfree(obj_list); + error_msg("extra parameter in SHUF <%s>\n",str); + HDexit(EXIT_FAILURE); + } + } + /*------------------------------------------------------------------------- + * H5Z_FILTER_FLETCHER32 + *------------------------------------------------------------------------- + */ + else if (HDstrcmp(scomp,"FLET")==0) + { + filt->filtn=H5Z_FILTER_FLETCHER32; + filt->cd_nelmts = 0; + if (m>0) + { /*shuffle does not have parameter */ + if (obj_list) HDfree(obj_list); + error_msg("extra parameter in FLET <%s>\n",str); + HDexit(EXIT_FAILURE); + } + } + /*------------------------------------------------------------------------- + * H5Z_FILTER_NBIT + *------------------------------------------------------------------------- + */ + else if (HDstrcmp(scomp,"NBIT")==0) + { + filt->filtn=H5Z_FILTER_NBIT; + filt->cd_nelmts = 0; + if (m>0) + { /*nbit does not have parameter */ + if (obj_list) HDfree(obj_list); + error_msg("extra parameter in NBIT <%s>\n",str); + HDexit(EXIT_FAILURE); + } + } + /*------------------------------------------------------------------------- + * H5Z_FILTER_SCALEOFFSET + *------------------------------------------------------------------------- + */ + else if (HDstrcmp(scomp,"SOFF")==0) + { + filt->filtn=H5Z_FILTER_SCALEOFFSET; + filt->cd_nelmts = 2; + if (no_param) + { /*no more parameters, SOFF must have parameter */ + if (obj_list) HDfree(obj_list); + error_msg("missing compression parameter in <%s>\n",str); + HDexit(EXIT_FAILURE); + } + } + /*------------------------------------------------------------------------- + * User Defined Filter + *------------------------------------------------------------------------- + */ + else if (HDstrcmp(scomp,"UD")==0) + { + if (filt->cd_nelmts != j) + { /* parameters does not match count */ + if (obj_list) HDfree(obj_list); + error_msg("incorrect number of compression parameters in <%s>\n",str); + HDexit(EXIT_FAILURE); + } + } + else { + if (obj_list) HDfree(obj_list); + error_msg("invalid filter type in <%s>\n",str); + HDexit(EXIT_FAILURE); + } + } + } /*i*/ + + /*------------------------------------------------------------------------- + * check valid parameters + *------------------------------------------------------------------------- + */ + + switch (filt->filtn) + { + + /*------------------------------------------------------------------------- + * H5Z_FILTER_DEFLATE + *------------------------------------------------------------------------- + */ + + case H5Z_FILTER_DEFLATE: + if (filt->cd_values[0]>9 ) + { + if (obj_list) HDfree(obj_list); + error_msg("invalid compression parameter in <%s>\n",str); + HDexit(EXIT_FAILURE); + } + break; + + /*------------------------------------------------------------------------- + * H5Z_FILTER_SZIP + *------------------------------------------------------------------------- + */ + + case H5Z_FILTER_SZIP: + pixels_per_block=filt->cd_values[0]; + if ((pixels_per_block%2)==1) + { + if (obj_list) HDfree(obj_list); + error_msg("pixels_per_block is not even in <%s>\n",str); + HDexit(EXIT_FAILURE); + } + if (pixels_per_block>H5_SZIP_MAX_PIXELS_PER_BLOCK) + { + if (obj_list) HDfree(obj_list); + error_msg("pixels_per_block is too large in <%s>\n",str); + HDexit(EXIT_FAILURE); + } + if ( (HDstrcmp(smask,"NN")!=0) && (HDstrcmp(smask,"EC")!=0) ) + { + if (obj_list) HDfree(obj_list); + error_msg("szip mask must be 'NN' or 'EC' \n"); + HDexit(EXIT_FAILURE); + } + break; + default: + break; + + + }; + + return obj_list; } @@ -540,9 +540,9 @@ obj_list_t* parse_filter(const char *str, *------------------------------------------------------------------------- */ obj_list_t* parse_layout(const char *str, - int *n_objs, - pack_info_t *pack, /* info about layout needed */ - pack_opt_t *options) + int *n_objs, + pack_info_t *pack, /* info about layout needed */ + pack_opt_t *options) { obj_list_t* obj_list=NULL; unsigned i; @@ -636,10 +636,10 @@ obj_list_t* parse_layout(const char *str, if ( pack->layout==H5D_CHUNKED ) { - /*------------------------------------------------------------------------- - * get chunk info - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * get chunk info + *------------------------------------------------------------------------- + */ k=0; if (j>(int)len) @@ -656,11 +656,11 @@ obj_list_t* parse_layout(const char *str, k++; /*increment sdim index */ if (!isdigit(c) && c!='x' - && c!='N' && c!='O' && c!='N' && c!='E' - ){ + && c!='N' && c!='O' && c!='N' && c!='E' + ){ if (obj_list) HDfree(obj_list); error_msg("in parse layout, <%s> Not a valid character in <%s>\n", - sdim,str); + sdim,str); HDexit(EXIT_FAILURE); } @@ -673,7 +673,7 @@ obj_list_t* parse_layout(const char *str, if (pack->chunk.chunk_lengths[c_index]==0) { if (obj_list) HDfree(obj_list); error_msg("in parse layout, <%s> conversion to number in <%s>\n", - sdim,str); + sdim,str); HDexit(EXIT_FAILURE); } c_index++; @@ -691,7 +691,7 @@ obj_list_t* parse_layout(const char *str, if (pack->chunk.chunk_lengths[c_index]==0){ if (obj_list) HDfree(obj_list); error_msg("in parse layout, <%s> conversion to number in <%s>\n", - sdim,str); + sdim,str); HDexit(EXIT_FAILURE); } pack->chunk.rank=c_index+1; -- cgit v0.12 From 5d311b35baf5a147c44bedf66d387762c88185bd Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 1 Sep 2015 16:43:50 -0500 Subject: [svn-r27661] Always use static mod files. --- fortran/src/CMakeLists.txt | 10 ++-------- hl/fortran/src/CMakeLists.txt | 10 ++-------- 2 files changed, 4 insertions(+), 16 deletions(-) diff --git a/fortran/src/CMakeLists.txt b/fortran/src/CMakeLists.txt index d97e625..6c4893b 100644 --- a/fortran/src/CMakeLists.txt +++ b/fortran/src/CMakeLists.txt @@ -64,19 +64,13 @@ set_target_properties (H5_buildiface PROPERTIES Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY} ) -if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) - if (WIN32) - set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared/\${BUILD_TYPE}) - else (WIN32) - set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared) - endif (WIN32) -else (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +if (NOT SKIP_HDF5_FORTRAN_SHARED) if (WIN32) set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static/\${BUILD_TYPE}) else (WIN32) set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static) endif (WIN32) -endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +endif (NOT SKIP_HDF5_FORTRAN_SHARED) INCLUDE_DIRECTORIES (${HDF5_F90_BINARY_DIR} ${CMAKE_Fortran_MODULE_DIRECTORY} ${MOD_BUILD_DIR}) diff --git a/hl/fortran/src/CMakeLists.txt b/hl/fortran/src/CMakeLists.txt index 5df4e1d..4047a97 100644 --- a/hl/fortran/src/CMakeLists.txt +++ b/hl/fortran/src/CMakeLists.txt @@ -36,19 +36,13 @@ set_target_properties (H5HL_buildiface PROPERTIES Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY} ) -if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) - if (WIN32) - set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared/\${BUILD_TYPE}) - else (WIN32) - set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared) - endif (WIN32) -else (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +if (NOT SKIP_HDF5_FORTRAN_SHARED) if (WIN32) set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static/\${BUILD_TYPE}) else (WIN32) set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static) endif (WIN32) -endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +endif (NOT SKIP_HDF5_FORTRAN_SHARED) #----------------------------------------------------------------------------- # Setup include Directories -- cgit v0.12 From 33a2e52c6e0910560058e1ebfd80e6224a6a527e Mon Sep 17 00:00:00 2001 From: Scot Breitenfeld Date: Wed, 2 Sep 2015 11:33:12 -0500 Subject: [svn-r27663] Removed the lines: # Source files are used for both the library and fortranlib_test. # Automake will complain about this without the following workaround. fortranlib_test_FCFLAGS=$(AM_FCFLAGS) fortranlib_test_CFLAGS=$(AM_CFLAGS) because they caused Fortran build rules (.f90.o, .F90.o) to be ignored, causing the CPP flags to be passed to the Fortran compiler, causing the xlf compiler to fail. Tested: ostrich (xlf), h5committest --- fortran/test/Makefile.am | 5 --- fortran/test/Makefile.in | 115 +++-------------------------------------------- 2 files changed, 6 insertions(+), 114 deletions(-) diff --git a/fortran/test/Makefile.am b/fortran/test/Makefile.am index c12233c..60f9f53 100644 --- a/fortran/test/Makefile.am +++ b/fortran/test/Makefile.am @@ -43,11 +43,6 @@ check_PROGRAMS=$(TEST_PROG) libh5test_fortran_la_SOURCES = tf_gen.F90 tf.F90 t.c -# Source files are used for both the library and fortranlib_test. -# Automake will complain about this without the following workaround. -fortranlib_test_FCFLAGS=$(AM_FCFLAGS) -fortranlib_test_CFLAGS=$(AM_CFLAGS) - fortranlib_test_SOURCES = tH5F.F90 tH5D.F90 tH5R.F90 tH5S.F90 tH5T.F90 tH5VL.F90 tH5Z.F90 \ tH5Sselect.F90 tH5P.F90 tH5A.F90 tH5I.F90 tH5G.F90 tH5E.F90 tHDF5.F90 fortranlib_test.F90 diff --git a/fortran/test/Makefile.in b/fortran/test/Makefile.in index d51b42f..38aacf2 100644 --- a/fortran/test/Makefile.in +++ b/fortran/test/Makefile.in @@ -132,23 +132,15 @@ fflush2_OBJECTS = $(am_fflush2_OBJECTS) fflush2_LDADD = $(LDADD) fflush2_DEPENDENCIES = libh5test_fortran.la $(LIBH5TEST) $(LIBH5F) \ $(LIBHDF5) -am_fortranlib_test_OBJECTS = fortranlib_test-tH5F.$(OBJEXT) \ - fortranlib_test-tH5D.$(OBJEXT) fortranlib_test-tH5R.$(OBJEXT) \ - fortranlib_test-tH5S.$(OBJEXT) fortranlib_test-tH5T.$(OBJEXT) \ - fortranlib_test-tH5VL.$(OBJEXT) fortranlib_test-tH5Z.$(OBJEXT) \ - fortranlib_test-tH5Sselect.$(OBJEXT) \ - fortranlib_test-tH5P.$(OBJEXT) fortranlib_test-tH5A.$(OBJEXT) \ - fortranlib_test-tH5I.$(OBJEXT) fortranlib_test-tH5G.$(OBJEXT) \ - fortranlib_test-tH5E.$(OBJEXT) fortranlib_test-tHDF5.$(OBJEXT) \ - fortranlib_test-fortranlib_test.$(OBJEXT) +am_fortranlib_test_OBJECTS = tH5F.$(OBJEXT) tH5D.$(OBJEXT) \ + tH5R.$(OBJEXT) tH5S.$(OBJEXT) tH5T.$(OBJEXT) tH5VL.$(OBJEXT) \ + tH5Z.$(OBJEXT) tH5Sselect.$(OBJEXT) tH5P.$(OBJEXT) \ + tH5A.$(OBJEXT) tH5I.$(OBJEXT) tH5G.$(OBJEXT) tH5E.$(OBJEXT) \ + tHDF5.$(OBJEXT) fortranlib_test.$(OBJEXT) fortranlib_test_OBJECTS = $(am_fortranlib_test_OBJECTS) fortranlib_test_LDADD = $(LDADD) fortranlib_test_DEPENDENCIES = libh5test_fortran.la $(LIBH5TEST) \ $(LIBH5F) $(LIBHDF5) -fortranlib_test_LINK = $(LIBTOOL) $(AM_V_lt) --tag=FC \ - $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(FCLD) \ - $(fortranlib_test_FCFLAGS) $(FCFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ - -o $@ am_fortranlib_test_1_8_OBJECTS = tH5O.$(OBJEXT) tH5A_1_8.$(OBJEXT) \ tH5G_1_8.$(OBJEXT) tH5MISC_1_8.$(OBJEXT) tHDF5_1_8.$(OBJEXT) \ fortranlib_test_1_8.$(OBJEXT) @@ -741,11 +733,6 @@ noinst_LTLIBRARIES = libh5test_fortran.la # Our main targets, the tests themselves TEST_PROG = fortranlib_test fflush1 fflush2 fortranlib_test_1_8 fortranlib_test_F03 libh5test_fortran_la_SOURCES = tf_gen.F90 tf.F90 t.c - -# Source files are used for both the library and fortranlib_test. -# Automake will complain about this without the following workaround. -fortranlib_test_FCFLAGS = $(AM_FCFLAGS) -fortranlib_test_CFLAGS = $(AM_CFLAGS) fortranlib_test_SOURCES = tH5F.F90 tH5D.F90 tH5R.F90 tH5S.F90 tH5T.F90 tH5VL.F90 tH5Z.F90 \ tH5Sselect.F90 tH5P.F90 tH5A.F90 tH5I.F90 tH5G.F90 tH5E.F90 tHDF5.F90 fortranlib_test.F90 @@ -877,7 +864,7 @@ fflush2$(EXEEXT): $(fflush2_OBJECTS) $(fflush2_DEPENDENCIES) $(EXTRA_fflush2_DEP fortranlib_test$(EXEEXT): $(fortranlib_test_OBJECTS) $(fortranlib_test_DEPENDENCIES) $(EXTRA_fortranlib_test_DEPENDENCIES) @rm -f fortranlib_test$(EXEEXT) - $(AM_V_FCLD)$(fortranlib_test_LINK) $(fortranlib_test_OBJECTS) $(fortranlib_test_LDADD) $(LIBS) + $(AM_V_FCLD)$(FCLINK) $(fortranlib_test_OBJECTS) $(fortranlib_test_LDADD) $(LIBS) fortranlib_test_1_8$(EXEEXT): $(fortranlib_test_1_8_OBJECTS) $(fortranlib_test_1_8_DEPENDENCIES) $(EXTRA_fortranlib_test_1_8_DEPENDENCIES) @rm -f fortranlib_test_1_8$(EXEEXT) @@ -901,96 +888,6 @@ distclean-compile: .F90.lo: $(AM_V_PPFC)$(LTPPFCCOMPILE) -c -o $@ $< -fortranlib_test-tH5F.o: tH5F.F90 - $(AM_V_PPFC)$(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fortranlib_test_FCFLAGS) $(FCFLAGS) -c -o fortranlib_test-tH5F.o `test -f 'tH5F.F90' || echo '$(srcdir)/'`tH5F.F90 - -fortranlib_test-tH5F.obj: tH5F.F90 - $(AM_V_PPFC)$(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fortranlib_test_FCFLAGS) $(FCFLAGS) -c -o fortranlib_test-tH5F.obj `if test -f 'tH5F.F90'; then $(CYGPATH_W) 'tH5F.F90'; else $(CYGPATH_W) '$(srcdir)/tH5F.F90'; fi` - -fortranlib_test-tH5D.o: tH5D.F90 - $(AM_V_PPFC)$(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fortranlib_test_FCFLAGS) $(FCFLAGS) -c -o fortranlib_test-tH5D.o `test -f 'tH5D.F90' || echo '$(srcdir)/'`tH5D.F90 - -fortranlib_test-tH5D.obj: tH5D.F90 - $(AM_V_PPFC)$(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fortranlib_test_FCFLAGS) $(FCFLAGS) -c -o fortranlib_test-tH5D.obj `if test -f 'tH5D.F90'; then $(CYGPATH_W) 'tH5D.F90'; else $(CYGPATH_W) '$(srcdir)/tH5D.F90'; fi` - -fortranlib_test-tH5R.o: tH5R.F90 - $(AM_V_PPFC)$(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fortranlib_test_FCFLAGS) $(FCFLAGS) -c -o fortranlib_test-tH5R.o `test -f 'tH5R.F90' || echo '$(srcdir)/'`tH5R.F90 - -fortranlib_test-tH5R.obj: tH5R.F90 - $(AM_V_PPFC)$(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fortranlib_test_FCFLAGS) $(FCFLAGS) -c -o fortranlib_test-tH5R.obj `if test -f 'tH5R.F90'; then $(CYGPATH_W) 'tH5R.F90'; else $(CYGPATH_W) '$(srcdir)/tH5R.F90'; fi` - -fortranlib_test-tH5S.o: tH5S.F90 - $(AM_V_PPFC)$(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fortranlib_test_FCFLAGS) $(FCFLAGS) -c -o fortranlib_test-tH5S.o `test -f 'tH5S.F90' || echo '$(srcdir)/'`tH5S.F90 - -fortranlib_test-tH5S.obj: tH5S.F90 - $(AM_V_PPFC)$(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fortranlib_test_FCFLAGS) $(FCFLAGS) -c -o fortranlib_test-tH5S.obj `if test -f 'tH5S.F90'; then $(CYGPATH_W) 'tH5S.F90'; else $(CYGPATH_W) '$(srcdir)/tH5S.F90'; fi` - -fortranlib_test-tH5T.o: tH5T.F90 - $(AM_V_PPFC)$(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fortranlib_test_FCFLAGS) $(FCFLAGS) -c -o fortranlib_test-tH5T.o `test -f 'tH5T.F90' || echo '$(srcdir)/'`tH5T.F90 - -fortranlib_test-tH5T.obj: tH5T.F90 - $(AM_V_PPFC)$(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fortranlib_test_FCFLAGS) $(FCFLAGS) -c -o fortranlib_test-tH5T.obj `if test -f 'tH5T.F90'; then $(CYGPATH_W) 'tH5T.F90'; else $(CYGPATH_W) '$(srcdir)/tH5T.F90'; fi` - -fortranlib_test-tH5VL.o: tH5VL.F90 - $(AM_V_PPFC)$(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fortranlib_test_FCFLAGS) $(FCFLAGS) -c -o fortranlib_test-tH5VL.o `test -f 'tH5VL.F90' || echo '$(srcdir)/'`tH5VL.F90 - -fortranlib_test-tH5VL.obj: tH5VL.F90 - $(AM_V_PPFC)$(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fortranlib_test_FCFLAGS) $(FCFLAGS) -c -o fortranlib_test-tH5VL.obj `if test -f 'tH5VL.F90'; then $(CYGPATH_W) 'tH5VL.F90'; else $(CYGPATH_W) '$(srcdir)/tH5VL.F90'; fi` - -fortranlib_test-tH5Z.o: tH5Z.F90 - $(AM_V_PPFC)$(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fortranlib_test_FCFLAGS) $(FCFLAGS) -c -o fortranlib_test-tH5Z.o `test -f 'tH5Z.F90' || echo '$(srcdir)/'`tH5Z.F90 - -fortranlib_test-tH5Z.obj: tH5Z.F90 - $(AM_V_PPFC)$(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fortranlib_test_FCFLAGS) $(FCFLAGS) -c -o fortranlib_test-tH5Z.obj `if test -f 'tH5Z.F90'; then $(CYGPATH_W) 'tH5Z.F90'; else $(CYGPATH_W) '$(srcdir)/tH5Z.F90'; fi` - -fortranlib_test-tH5Sselect.o: tH5Sselect.F90 - $(AM_V_PPFC)$(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fortranlib_test_FCFLAGS) $(FCFLAGS) -c -o fortranlib_test-tH5Sselect.o `test -f 'tH5Sselect.F90' || echo '$(srcdir)/'`tH5Sselect.F90 - -fortranlib_test-tH5Sselect.obj: tH5Sselect.F90 - $(AM_V_PPFC)$(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fortranlib_test_FCFLAGS) $(FCFLAGS) -c -o fortranlib_test-tH5Sselect.obj `if test -f 'tH5Sselect.F90'; then $(CYGPATH_W) 'tH5Sselect.F90'; else $(CYGPATH_W) '$(srcdir)/tH5Sselect.F90'; fi` - -fortranlib_test-tH5P.o: tH5P.F90 - $(AM_V_PPFC)$(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fortranlib_test_FCFLAGS) $(FCFLAGS) -c -o fortranlib_test-tH5P.o `test -f 'tH5P.F90' || echo '$(srcdir)/'`tH5P.F90 - -fortranlib_test-tH5P.obj: tH5P.F90 - $(AM_V_PPFC)$(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fortranlib_test_FCFLAGS) $(FCFLAGS) -c -o fortranlib_test-tH5P.obj `if test -f 'tH5P.F90'; then $(CYGPATH_W) 'tH5P.F90'; else $(CYGPATH_W) '$(srcdir)/tH5P.F90'; fi` - -fortranlib_test-tH5A.o: tH5A.F90 - $(AM_V_PPFC)$(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fortranlib_test_FCFLAGS) $(FCFLAGS) -c -o fortranlib_test-tH5A.o `test -f 'tH5A.F90' || echo '$(srcdir)/'`tH5A.F90 - -fortranlib_test-tH5A.obj: tH5A.F90 - $(AM_V_PPFC)$(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fortranlib_test_FCFLAGS) $(FCFLAGS) -c -o fortranlib_test-tH5A.obj `if test -f 'tH5A.F90'; then $(CYGPATH_W) 'tH5A.F90'; else $(CYGPATH_W) '$(srcdir)/tH5A.F90'; fi` - -fortranlib_test-tH5I.o: tH5I.F90 - $(AM_V_PPFC)$(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fortranlib_test_FCFLAGS) $(FCFLAGS) -c -o fortranlib_test-tH5I.o `test -f 'tH5I.F90' || echo '$(srcdir)/'`tH5I.F90 - -fortranlib_test-tH5I.obj: tH5I.F90 - $(AM_V_PPFC)$(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fortranlib_test_FCFLAGS) $(FCFLAGS) -c -o fortranlib_test-tH5I.obj `if test -f 'tH5I.F90'; then $(CYGPATH_W) 'tH5I.F90'; else $(CYGPATH_W) '$(srcdir)/tH5I.F90'; fi` - -fortranlib_test-tH5G.o: tH5G.F90 - $(AM_V_PPFC)$(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fortranlib_test_FCFLAGS) $(FCFLAGS) -c -o fortranlib_test-tH5G.o `test -f 'tH5G.F90' || echo '$(srcdir)/'`tH5G.F90 - -fortranlib_test-tH5G.obj: tH5G.F90 - $(AM_V_PPFC)$(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fortranlib_test_FCFLAGS) $(FCFLAGS) -c -o fortranlib_test-tH5G.obj `if test -f 'tH5G.F90'; then $(CYGPATH_W) 'tH5G.F90'; else $(CYGPATH_W) '$(srcdir)/tH5G.F90'; fi` - -fortranlib_test-tH5E.o: tH5E.F90 - $(AM_V_PPFC)$(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fortranlib_test_FCFLAGS) $(FCFLAGS) -c -o fortranlib_test-tH5E.o `test -f 'tH5E.F90' || echo '$(srcdir)/'`tH5E.F90 - -fortranlib_test-tH5E.obj: tH5E.F90 - $(AM_V_PPFC)$(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fortranlib_test_FCFLAGS) $(FCFLAGS) -c -o fortranlib_test-tH5E.obj `if test -f 'tH5E.F90'; then $(CYGPATH_W) 'tH5E.F90'; else $(CYGPATH_W) '$(srcdir)/tH5E.F90'; fi` - -fortranlib_test-tHDF5.o: tHDF5.F90 - $(AM_V_PPFC)$(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fortranlib_test_FCFLAGS) $(FCFLAGS) -c -o fortranlib_test-tHDF5.o `test -f 'tHDF5.F90' || echo '$(srcdir)/'`tHDF5.F90 - -fortranlib_test-tHDF5.obj: tHDF5.F90 - $(AM_V_PPFC)$(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fortranlib_test_FCFLAGS) $(FCFLAGS) -c -o fortranlib_test-tHDF5.obj `if test -f 'tHDF5.F90'; then $(CYGPATH_W) 'tHDF5.F90'; else $(CYGPATH_W) '$(srcdir)/tHDF5.F90'; fi` - -fortranlib_test-fortranlib_test.o: fortranlib_test.F90 - $(AM_V_PPFC)$(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fortranlib_test_FCFLAGS) $(FCFLAGS) -c -o fortranlib_test-fortranlib_test.o `test -f 'fortranlib_test.F90' || echo '$(srcdir)/'`fortranlib_test.F90 - -fortranlib_test-fortranlib_test.obj: fortranlib_test.F90 - $(AM_V_PPFC)$(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fortranlib_test_FCFLAGS) $(FCFLAGS) -c -o fortranlib_test-fortranlib_test.obj `if test -f 'fortranlib_test.F90'; then $(CYGPATH_W) 'fortranlib_test.F90'; else $(CYGPATH_W) '$(srcdir)/fortranlib_test.F90'; fi` - .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -- cgit v0.12 From 7860f3f5b679f5e85a0929ab3c390dde8e126807 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 3 Sep 2015 09:48:18 -0500 Subject: [svn-r27668] Increase timeout for objcopy --- test/CMakeTests.cmake | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/CMakeTests.cmake b/test/CMakeTests.cmake index 0efa2ae..d666601 100644 --- a/test/CMakeTests.cmake +++ b/test/CMakeTests.cmake @@ -451,6 +451,7 @@ set_tests_properties (H5TEST-flush2 PROPERTIES DEPENDS H5TEST-flush1) set_tests_properties (H5TEST-fheap PROPERTIES TIMEOUT 1800) set_tests_properties (H5TEST-testmeta PROPERTIES TIMEOUT 1800) set_tests_properties (H5TEST-big PROPERTIES TIMEOUT 1800) +set_tests_properties (H5TEST-objcopy PROPERTIES TIMEOUT 2400) if (BUILD_SHARED_LIBS) # Remove any output file left over from previous test run @@ -541,6 +542,7 @@ if (BUILD_SHARED_LIBS) set_tests_properties (H5TEST-shared-fheap PROPERTIES TIMEOUT 1800) set_tests_properties (H5TEST-shared-testmeta PROPERTIES TIMEOUT 1800) set_tests_properties (H5TEST-shared-big PROPERTIES TIMEOUT 1800) + set_tests_properties (H5TEST-shared-objcopy PROPERTIES TIMEOUT 2400) endif (BUILD_SHARED_LIBS) ############################################################################## -- cgit v0.12 From 0cca701dc20ea14ccf5004d7663bfcff45a354e1 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 3 Sep 2015 13:27:44 -0500 Subject: [svn-r27670] Remove SYMBOLS option - includes default checks. Pulled from master. --- config/cmake_ext_mod/HDFUseFortran.cmake | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/config/cmake_ext_mod/HDFUseFortran.cmake b/config/cmake_ext_mod/HDFUseFortran.cmake index c1df8cf..275f2ea 100644 --- a/config/cmake_ext_mod/HDFUseFortran.cmake +++ b/config/cmake_ext_mod/HDFUseFortran.cmake @@ -3,7 +3,7 @@ # #------------------------------------------------------------------------------- ENABLE_LANGUAGE (Fortran) - + #----------------------------------------------------------------------------- # Detect name mangling convention used between Fortran and C #----------------------------------------------------------------------------- @@ -12,7 +12,6 @@ FortranCInterface_HEADER ( ${CMAKE_BINARY_DIR}/FCMangle.h MACRO_NAMESPACE "H5_FC_" SYMBOL_NAMESPACE "H5_FC_" - SYMBOLS mysub mymod:my_sub ) file (STRINGS ${CMAKE_BINARY_DIR}/FCMangle.h CONTENTS REGEX "H5_FC_GLOBAL\\(.*,.*\\) +(.*)") @@ -161,7 +160,7 @@ CHECK_FORTRAN_FEATURE(iso_c_binding IMPLICIT NONE TYPE(C_PTR) :: ptr TYPE(C_FUNPTR) :: funptr - INTEGER(C_INT64_T) :: c_int64_type + INTEGER(C_INT64_T) :: c_int64_type CHARACTER(LEN=80, KIND=c_char), TARGET :: ichr ptr = C_LOC(ichr(1:1)) END PROGRAM -- cgit v0.12 From 6b1b8869d1a82260e91909d67cad6f8fe2530f70 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 3 Sep 2015 13:28:47 -0500 Subject: [svn-r27671] Move fortran id check to fortran section --- CMakeLists.txt | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0c1556e..96d5772 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,19 +1,6 @@ cmake_minimum_required (VERSION 3.1.0) PROJECT (HDF5 C CXX) -if (HDF5_BUILD_FORTRAN) - include (${CMAKE_ROOT}/Modules/CMakeDetermineFortranCompiler.cmake) - if (${CMAKE_Fortran_COMPILER_ID}) - enable_language(Fortran) - endif () - -# Building with PGI requires CMake 3.3 or greater because previous versions -# of CMake add the wrong compiler flag for the PGI Fortran compiler. - if ("${CMAKE_Fortran_COMPILER_ID}" MATCHES "PGI" AND "${CMAKE_VERSION}" VERSION_LESS "3.3") - message (FATAL_ERROR " **** PGI FORTRAN REQUIRES CMAKE VERSION 3.3 OR GREATER **** ") - endif () -endif () - #----------------------------------------------------------------------------- # Instructions for use : Normal Build # @@ -638,12 +625,12 @@ if (BUILD_TESTING) option (HDF_TEST_EXPRESS "Control testing framework (0-3)" "0") mark_as_advanced (HDF_TEST_EXPRESS) - include (${HDF5_SOURCE_DIR}/CTestConfig.cmake) - configure_file (${HDF_RESOURCES_DIR}/CTestCustom.cmake ${HDF5_BINARY_DIR}/CTestCustom.ctest @ONLY) - enable_testing () include (CTest) + include (${HDF5_SOURCE_DIR}/CTestConfig.cmake) + configure_file (${HDF_RESOURCES_DIR}/CTestCustom.cmake ${HDF5_BINARY_DIR}/CTestCustom.ctest @ONLY) + if (NOT HDF5_EXTERNALLY_CONFIGURED) if (EXISTS "${HDF5_SOURCE_DIR}/test" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/test") add_subdirectory (${HDF5_SOURCE_DIR}/tools/lib ${PROJECT_BINARY_DIR}/tools/lib) @@ -709,8 +696,18 @@ if (EXISTS "${HDF5_SOURCE_DIR}/fortran" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/for endif (NOT ALLOW_UNSUPPORTED) endif (BUILD_SHARED_LIBS AND APPLE) option (HDF5_ENABLE_F2003 "Enable FORTRAN 2003 Standard" ON) + include (${HDF_RESOURCES_EXT_DIR}/HDFUseFortran.cmake) + + message (STATUS "Fortran compiler ID is ${CMAKE_Fortran_COMPILER_ID}") + # Building with PGI requires CMake 3.3 or greater because previous versions + # of CMake add the wrong compiler flag for the PGI Fortran compiler. + if ("${CMAKE_Fortran_COMPILER_ID}" MATCHES "PGI" AND "${CMAKE_VERSION}" VERSION_LESS "3.3") + message (FATAL_ERROR " **** PGI FORTRAN REQUIRES CMAKE VERSION 3.3 OR GREATER **** ") + endif () + include (${HDF_RESOURCES_DIR}/HDF5UseFortran.cmake) + if (HDF5_ENABLE_F2003) if (NOT FORTRAN_HAVE_ISO_C_BINDING) set (HDF5_ENABLE_F2003 OFF) -- cgit v0.12 From cbf5bb6b7855c8b5a699a30177abf2c76228e8a5 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 3 Sep 2015 16:45:17 -0500 Subject: [svn-r27674] Attempt to fix race condition on windows --- fortran/test/CMakeLists.txt | 72 +++++++++++++++++++++++++++------------------ 1 file changed, 44 insertions(+), 28 deletions(-) diff --git a/fortran/test/CMakeLists.txt b/fortran/test/CMakeLists.txt index 18d067d..d2a30ef 100644 --- a/fortran/test/CMakeLists.txt +++ b/fortran/test/CMakeLists.txt @@ -7,6 +7,42 @@ PROJECT (HDF5_FORTRAN_TESTS C CXX Fortran) INCLUDE_DIRECTORIES (${HDF5_F90_BINARY_DIR} ${HDF5_F90_SRC_DIR}/src) #----------------------------------------------------------------------------- +# Setup the Fortran auto-detection utilities +# H5_test_buildiface.F90 used to generate various KIND test interfaces +#----------------------------------------------------------------------------- + +add_executable (H5_test_buildiface + ${HDF5_F90_SRC_DIR}/test/H5_test_buildiface.F90 + ) + +if (WIN32 AND MSVC) + if (BUILD_SHARED_LIBS) + set_target_properties (H5_test_buildiface + PROPERTIES + COMPILE_FLAGS "/MT" + ) + endif (BUILD_SHARED_LIBS) + set_target_properties (H5_test_buildiface + PROPERTIES + LINK_FLAGS "/SUBSYSTEM:CONSOLE" + ) +endif (WIN32 AND MSVC) +set_target_properties (H5_test_buildiface PROPERTIES + LINKER_LANGUAGE Fortran + Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY} +) + +if (NOT SKIP_HDF5_FORTRAN_SHARED) + if (WIN32) + set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static/\${BUILD_TYPE}) + else (WIN32) + set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static) + endif (WIN32) +endif (NOT SKIP_HDF5_FORTRAN_SHARED) + +INCLUDE_DIRECTORIES (${CMAKE_Fortran_MODULE_DIRECTORY} ${MOD_BUILD_DIR}) + +#----------------------------------------------------------------------------- # Add Test Lib #----------------------------------------------------------------------------- add_library (${HDF5_F90_C_TEST_LIB_TARGET} STATIC t.c) @@ -92,36 +128,16 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) endif (WIN32) endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) -#----------------------------------------------------------------------------- -# Setup the Fortran auto-detection utilities -# H5_test_buildiface.F90 used to generate various KIND test interfaces -#----------------------------------------------------------------------------- - -add_executable (H5_test_buildiface - ${HDF5_F90_SRC_DIR}/test/H5_test_buildiface.F90 - ) - -if (WIN32 AND MSVC) - if (BUILD_SHARED_LIBS) - set_target_properties (H5_test_buildiface - PROPERTIES - COMPILE_FLAGS "/MT" - ) - endif (BUILD_SHARED_LIBS) - set_target_properties (H5_test_buildiface - PROPERTIES - LINK_FLAGS "/SUBSYSTEM:CONSOLE" - ) -endif (WIN32 AND MSVC) -set_target_properties (H5_test_buildiface PROPERTIES - LINKER_LANGUAGE Fortran - Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY} -) - set (CMD $) -add_custom_command ( - OUTPUT ${HDF5_F90_BINARY_DIR}/tf_gen.F90 +#add_custom_command ( +# OUTPUT ${HDF5_F90_BINARY_DIR}/tf_gen.F90 +# COMMAND ${CMD} +# WORKING_DIRECTORY ${HDF5_F90_BINARY_DIR} +# DEPENDS H5_test_buildiface +#) +add_custom_target (H5testgen ALL COMMAND ${CMD} +#v3.2 BYPRODUCT ${HDF5_F90_BINARY_DIR}/tf_gen.F90 WORKING_DIRECTORY ${HDF5_F90_BINARY_DIR} DEPENDS H5_test_buildiface ) -- cgit v0.12 From bea85e0705d200de16d8e1affad5d2abb6954b6e Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Fri, 4 Sep 2015 03:20:26 -0500 Subject: [svn-r27675] Removed library checks for nsl and socket from the autotools configure on Solaris. The nsl and socket libraries are no longer used by the library. Fixes HDFFV-9118. Tested on: h5committest (CMake fortran fails due to an unrelated error) jam w/ CMake --- config/cmake/H5pubconf.h.in | 6 -- config/cmake_ext_mod/ConfigureChecks.cmake | 7 +- configure | 110 ----------------------------- configure.ac | 6 -- src/H5config.h.in | 6 -- 5 files changed, 1 insertion(+), 134 deletions(-) diff --git a/config/cmake/H5pubconf.h.in b/config/cmake/H5pubconf.h.in index 37bcfbf..0faf92e 100644 --- a/config/cmake/H5pubconf.h.in +++ b/config/cmake/H5pubconf.h.in @@ -185,15 +185,9 @@ /* Define to 1 if you have the `mpe' library (-lmpe). */ #cmakedefine H5_HAVE_LIBMPE @H5_HAVE_LIBMPE@ -/* Define to 1 if you have the `nsl' library (-lnsl). */ -#cmakedefine H5_HAVE_LIBNSL @H5_HAVE_LIBNSL@ - /* Define to 1 if you have the `pthread' library (-lpthread). */ #cmakedefine H5_HAVE_LIBPTHREAD @H5_HAVE_LIBPTHREAD@ -/* Define to 1 if you have the `socket' library (-lsocket). */ -#cmakedefine H5_HAVE_LIBSOCKET @H5_HAVE_LIBSOCKET@ - /* Define to 1 if you have the `sz' library (-lsz). */ #cmakedefine H5_HAVE_LIBSZ @H5_HAVE_LIBSZ@ diff --git a/config/cmake_ext_mod/ConfigureChecks.cmake b/config/cmake_ext_mod/ConfigureChecks.cmake index e058b10..6885187 100644 --- a/config/cmake_ext_mod/ConfigureChecks.cmake +++ b/config/cmake_ext_mod/ConfigureChecks.cmake @@ -117,13 +117,8 @@ if (NOT WINDOWS) CHECK_LIBRARY_EXISTS_CONCAT ("wsock32" gethostbyname ${HDF_PREFIX}_HAVE_LIBWSOCK32) endif (NOT WINDOWS) +# UCB (BSD) compatibility library CHECK_LIBRARY_EXISTS_CONCAT ("ucb" gethostname ${HDF_PREFIX}_HAVE_LIBUCB) -CHECK_LIBRARY_EXISTS_CONCAT ("socket" connect ${HDF_PREFIX}_HAVE_LIBSOCKET) -CHECK_LIBRARY_EXISTS ("c" gethostbyname "" NOT_NEED_LIBNSL) - -if (NOT NOT_NEED_LIBNSL) - CHECK_LIBRARY_EXISTS_CONCAT ("nsl" gethostbyname ${HDF_PREFIX}_HAVE_LIBNSL) -endif (NOT NOT_NEED_LIBNSL) # For other tests to use the same libraries set (CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${LINK_LIBS}) diff --git a/configure b/configure index 6c8b0ff..5139e01 100755 --- a/configure +++ b/configure @@ -23034,116 +23034,6 @@ _ACEOF fi -if test "`uname`" = "SunOS" -o "`uname -sr`" = "HP-UX B.11.00"; then - ## ...for Solaris - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for socket in -lsocket" >&5 -$as_echo_n "checking for socket in -lsocket... " >&6; } -if ${ac_cv_lib_socket_socket+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lsocket $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char socket (); -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus - extern "C" -# endif - int FC_DUMMY_MAIN() { return 1; } -#endif -#endif -int -main () -{ -return socket (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_socket_socket=yes -else - ac_cv_lib_socket_socket=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_socket" >&5 -$as_echo "$ac_cv_lib_socket_socket" >&6; } -if test "x$ac_cv_lib_socket_socket" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBSOCKET 1 -_ACEOF - - LIBS="-lsocket $LIBS" - -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for xdr_int in -lnsl" >&5 -$as_echo_n "checking for xdr_int in -lnsl... " >&6; } -if ${ac_cv_lib_nsl_xdr_int+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lnsl $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char xdr_int (); -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus - extern "C" -# endif - int FC_DUMMY_MAIN() { return 1; } -#endif -#endif -int -main () -{ -return xdr_int (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_nsl_xdr_int=yes -else - ac_cv_lib_nsl_xdr_int=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_xdr_int" >&5 -$as_echo "$ac_cv_lib_nsl_xdr_int" >&6; } -if test "x$ac_cv_lib_nsl_xdr_int" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBNSL 1 -_ACEOF - - LIBS="-lnsl $LIBS" - -fi - -fi - ## ---------------------------------------------------------------------- ## Check for system header files. ## diff --git a/configure.ac b/configure.ac index 3d4c4a4..811cb44 100644 --- a/configure.ac +++ b/configure.ac @@ -961,12 +961,6 @@ esac AC_CHECK_LIB([m], [ceil]) AC_CHECK_LIB([dl], [dlopen]) -if test "`uname`" = "SunOS" -o "`uname -sr`" = "HP-UX B.11.00"; then - ## ...for Solaris - AC_CHECK_LIB([socket], [socket]) - AC_CHECK_LIB([nsl], [xdr_int]) -fi - ## ---------------------------------------------------------------------- ## Check for system header files. ## diff --git a/src/H5config.h.in b/src/H5config.h.in index 252ec04..9ac2327 100644 --- a/src/H5config.h.in +++ b/src/H5config.h.in @@ -203,15 +203,9 @@ /* Define to 1 if you have the `mpe' library (-lmpe). */ #undef HAVE_LIBMPE -/* Define to 1 if you have the `nsl' library (-lnsl). */ -#undef HAVE_LIBNSL - /* Define to 1 if you have the `pthread' library (-lpthread). */ #undef HAVE_LIBPTHREAD -/* Define to 1 if you have the `socket' library (-lsocket). */ -#undef HAVE_LIBSOCKET - /* Define to 1 if you have the `sz' library (-lsz). */ #undef HAVE_LIBSZ -- cgit v0.12 From 4906383c0f4f7e9fba5b085e6902a864b352c5e4 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 4 Sep 2015 08:55:29 -0500 Subject: [svn-r27676] Fix dependencies of generated file --- fortran/test/CMakeLists.txt | 37 ++++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/fortran/test/CMakeLists.txt b/fortran/test/CMakeLists.txt index d2a30ef..0cbd17f 100644 --- a/fortran/test/CMakeLists.txt +++ b/fortran/test/CMakeLists.txt @@ -75,10 +75,27 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) ) endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) -set_source_files_properties (tf.F90 ${HDF5_F90_BINARY_DIR}/tf_gen.F90 PROPERTIES LANGUAGE Fortran) -add_library (${HDF5_F90_TEST_LIB_TARGET} STATIC tf.F90 ${HDF5_F90_BINARY_DIR}/tf_gen.F90) +set (HDF5_F90_TF_SRCS + # generated files + ${HDF5_F90_BINARY_DIR}/tf_gen.F90 +) +set_source_files_properties ( + ${HDF5_F90_BINARY_DIR}/tf_gen.F90 + PROPERTIES GENERATED TRUE +) +set_source_files_properties (tf.F90 ${HDF5_F90_BINARY_DIR}/${HDF5_F90_TF_SRCS} PROPERTIES LANGUAGE Fortran) + +set (CMD $) +add_custom_target (H5testgen ALL + COMMAND ${CMD} +#v3.2 BYPRODUCT ${HDF5_F90_BINARY_DIR}/tf_gen.F90 + WORKING_DIRECTORY ${HDF5_F90_BINARY_DIR} + DEPENDS H5_test_buildiface +) + +add_library (${HDF5_F90_TEST_LIB_TARGET} STATIC tf.F90 ${HDF5_F90_TF_SRCS}) if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) - add_library (${HDF5_F90_TEST_LIBSH_TARGET} SHARED tf.F90 ${HDF5_F90_BINARY_DIR}/tf_gen.F90) + add_library (${HDF5_F90_TEST_LIBSH_TARGET} SHARED tf.F90 ${HDF5_F90_TF_SRCS}) endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) TARGET_FORTRAN_PROPERTIES (${HDF5_F90_TEST_LIB_TARGET} STATIC " " " ") @@ -128,20 +145,6 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) endif (WIN32) endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) -set (CMD $) -#add_custom_command ( -# OUTPUT ${HDF5_F90_BINARY_DIR}/tf_gen.F90 -# COMMAND ${CMD} -# WORKING_DIRECTORY ${HDF5_F90_BINARY_DIR} -# DEPENDS H5_test_buildiface -#) -add_custom_target (H5testgen ALL - COMMAND ${CMD} -#v3.2 BYPRODUCT ${HDF5_F90_BINARY_DIR}/tf_gen.F90 - WORKING_DIRECTORY ${HDF5_F90_BINARY_DIR} - DEPENDS H5_test_buildiface -) - #----------------------------------------------------------------------------- # Add Tests #----------------------------------------------------------------------------- -- cgit v0.12 From 210b5d8441de4a3754e609b0872ae860cda6a78a Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Sat, 5 Sep 2015 08:51:10 -0500 Subject: [svn-r27682] Restored commented-out _POSIX_C_SOURCE line in configure.ac. Tested on: h5committest --- configure | 2 +- configure.ac | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 5139e01..723d2f5 100755 --- a/configure +++ b/configure @@ -23673,7 +23673,7 @@ case "$host_cpu-$host_vendor-$host_os" in ## ## POSIX feature information can be found in the gcc manual at: ## http://www.gnu.org/s/libc/manual/html_node/Feature-Test-Macros.html -##SCOT H5_CPPFLAGS="-D_POSIX_C_SOURCE=200112L $H5_CPPFLAGS" + H5_CPPFLAGS="-D_POSIX_C_SOURCE=200112L $H5_CPPFLAGS" ## Need to add this so that O_DIRECT is visible for the direct ## VFD on Linux systems. diff --git a/configure.ac b/configure.ac index 811cb44..32afb44 100644 --- a/configure.ac +++ b/configure.ac @@ -1087,7 +1087,7 @@ case "$host_cpu-$host_vendor-$host_os" in ## ## POSIX feature information can be found in the gcc manual at: ## http://www.gnu.org/s/libc/manual/html_node/Feature-Test-Macros.html -##SCOT H5_CPPFLAGS="-D_POSIX_C_SOURCE=200112L $H5_CPPFLAGS" + H5_CPPFLAGS="-D_POSIX_C_SOURCE=200112L $H5_CPPFLAGS" ## Need to add this so that O_DIRECT is visible for the direct ## VFD on Linux systems. -- cgit v0.12 From 5903fc723b190f251d6c6d2f931efaa7e974acdc Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Sat, 5 Sep 2015 23:26:47 -0500 Subject: [svn-r27686] Merge of r27684 from autotools_rework Removed _BSD_SOURCE and _DEFAULT_SOURCE from the autotools C flags. They are no longer needed by the library. Fixes HDFFV-9079. Tested on: h5committest --- configure | 15 --------------- configure.ac | 15 --------------- 2 files changed, 30 deletions(-) diff --git a/configure b/configure index 723d2f5..ab339fc 100755 --- a/configure +++ b/configure @@ -23678,21 +23678,6 @@ case "$host_cpu-$host_vendor-$host_os" in ## Need to add this so that O_DIRECT is visible for the direct ## VFD on Linux systems. H5_CPPFLAGS="-D_GNU_SOURCE $H5_CPPFLAGS" - - ## Also add BSD support on Linux systems, so defines - ## __USE_BSD, which is required to get the prototype for strdup - ## defined correctly in and snprintf & vsnprintf defined - ## correctly in - ## Linking to the bsd-compat library is required as per the gcc manual: - ## http://www.gnu.org/s/libc/manual/html_node/Feature-Test-Macros.html - ## however, we do not do this since it breaks the big test on some - ## older platforms. - H5_CPPFLAGS="-D_BSD_SOURCE $H5_CPPFLAGS" - - ## _BSD_SOURCE is deprecated as of glibc 2.20, in favor of _DEFAULT_SOURCE. - ## To avoid warnings, we define _DEFAULT_SOURCE in addition to _BSD_SOURCE, - ## which should work for all versions of glibc. - H5_CPPFLAGS="-D_DEFAULT_SOURCE $H5_CPPFLAGS" ;; esac diff --git a/configure.ac b/configure.ac index 32afb44..d9df594 100644 --- a/configure.ac +++ b/configure.ac @@ -1092,21 +1092,6 @@ case "$host_cpu-$host_vendor-$host_os" in ## Need to add this so that O_DIRECT is visible for the direct ## VFD on Linux systems. H5_CPPFLAGS="-D_GNU_SOURCE $H5_CPPFLAGS" - - ## Also add BSD support on Linux systems, so defines - ## __USE_BSD, which is required to get the prototype for strdup - ## defined correctly in and snprintf & vsnprintf defined - ## correctly in - ## Linking to the bsd-compat library is required as per the gcc manual: - ## http://www.gnu.org/s/libc/manual/html_node/Feature-Test-Macros.html - ## however, we do not do this since it breaks the big test on some - ## older platforms. - H5_CPPFLAGS="-D_BSD_SOURCE $H5_CPPFLAGS" - - ## _BSD_SOURCE is deprecated as of glibc 2.20, in favor of _DEFAULT_SOURCE. - ## To avoid warnings, we define _DEFAULT_SOURCE in addition to _BSD_SOURCE, - ## which should work for all versions of glibc. - H5_CPPFLAGS="-D_DEFAULT_SOURCE $H5_CPPFLAGS" ;; esac -- cgit v0.12 From 34be1d1aed91b56337eefe4cb76ee66b3e3dc0c4 Mon Sep 17 00:00:00 2001 From: HDF Tester Date: Sun, 6 Sep 2015 19:31:40 -0500 Subject: [svn-r27690] Snapshot version 1.9 release 230 --- README.txt | 2 +- c++/src/Makefile.in | 2 +- c++/src/cpp_doc_config | 2 +- config/lt_vers.am | 2 +- configure | 22 +++++++++++----------- configure.ac | 2 +- fortran/src/Makefile.in | 2 +- hl/c++/src/Makefile.in | 2 +- hl/fortran/src/Makefile.in | 2 +- hl/src/Makefile.in | 2 +- release_docs/RELEASE.txt | 2 +- src/H5public.h | 4 ++-- src/Makefile.in | 2 +- 13 files changed, 24 insertions(+), 24 deletions(-) diff --git a/README.txt b/README.txt index 058734f..2bcb781 100644 --- a/README.txt +++ b/README.txt @@ -1,4 +1,4 @@ -HDF5 version 1.9.230 currently under development +HDF5 version 1.9.231 currently under development Please refer to the release_docs/INSTALL file for installation instructions. ------------------------------------------------------------------------------ diff --git a/c++/src/Makefile.in b/c++/src/Makefile.in index 70aadaa..8eeb1bb 100644 --- a/c++/src/Makefile.in +++ b/c++/src/Makefile.in @@ -689,7 +689,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 # After making changes, run bin/reconfigure to update other configure related # files like Makefile.in. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 220 +LT_VERS_REVISION = 221 LT_VERS_AGE = 0 # This is our main target diff --git a/c++/src/cpp_doc_config b/c++/src/cpp_doc_config index 73c41eb..b7754ce 100644 --- a/c++/src/cpp_doc_config +++ b/c++/src/cpp_doc_config @@ -38,7 +38,7 @@ PROJECT_NAME = "HDF5 C++ API" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = "1.9.230 currently under development" +PROJECT_NUMBER = "1.9.231 currently under development" # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/config/lt_vers.am b/config/lt_vers.am index 0a07eb7..21395cf 100644 --- a/config/lt_vers.am +++ b/config/lt_vers.am @@ -19,7 +19,7 @@ # After making changes, run bin/reconfigure to update other configure related # files like Makefile.in. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 220 +LT_VERS_REVISION = 221 LT_VERS_AGE = 0 ## If the API changes *at all*, increment LT_VERS_INTERFACE and diff --git a/configure b/configure index ab339fc..f029b0b 100755 --- a/configure +++ b/configure @@ -1,7 +1,7 @@ #! /bin/sh # From configure.ac Id: configure.ac 22697 2012-08-19 14:35:47Z hdftest . # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for HDF5 1.9.230. +# Generated by GNU Autoconf 2.69 for HDF5 1.9.231. # # Report bugs to . # @@ -591,8 +591,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='HDF5' PACKAGE_TARNAME='hdf5' -PACKAGE_VERSION='1.9.230' -PACKAGE_STRING='HDF5 1.9.230' +PACKAGE_VERSION='1.9.231' +PACKAGE_STRING='HDF5 1.9.231' PACKAGE_BUGREPORT='help@hdfgroup.org' PACKAGE_URL='' @@ -1480,7 +1480,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures HDF5 1.9.230 to adapt to many kinds of systems. +\`configure' configures HDF5 1.9.231 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1550,7 +1550,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of HDF5 1.9.230:";; + short | recursive ) echo "Configuration of HDF5 1.9.231:";; esac cat <<\_ACEOF @@ -1739,7 +1739,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -HDF5 configure 1.9.230 +HDF5 configure 1.9.231 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2654,7 +2654,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by HDF5 $as_me 1.9.230, which was +It was created by HDF5 $as_me 1.9.231, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3526,7 +3526,7 @@ fi # Define the identity of the package. PACKAGE='hdf5' - VERSION='1.9.230' + VERSION='1.9.231' cat >>confdefs.h <<_ACEOF @@ -29341,7 +29341,7 @@ Usage: $0 [OPTIONS] Report bugs to ." lt_cl_version="\ -HDF5 config.lt 1.9.230 +HDF5 config.lt 1.9.231 configured by $0, generated by GNU Autoconf 2.69. Copyright (C) 2011 Free Software Foundation, Inc. @@ -31437,7 +31437,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by HDF5 $as_me 1.9.230, which was +This file was extended by HDF5 $as_me 1.9.231, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -31503,7 +31503,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -HDF5 config.status 1.9.230 +HDF5 config.status 1.9.231 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/configure.ac b/configure.ac index d9df594..df14cec 100644 --- a/configure.ac +++ b/configure.ac @@ -26,7 +26,7 @@ AC_PREREQ([2.69]) ## NOTE: Do not forget to change the version number here when we do a ## release!!! ## -AC_INIT([HDF5], [1.9.230], [help@hdfgroup.org]) +AC_INIT([HDF5], [1.9.231], [help@hdfgroup.org]) AC_CONFIG_SRCDIR([src/H5.c]) AC_CONFIG_HEADERS([src/H5config.h]) diff --git a/fortran/src/Makefile.in b/fortran/src/Makefile.in index 6acdbde..957a76d 100644 --- a/fortran/src/Makefile.in +++ b/fortran/src/Makefile.in @@ -726,7 +726,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 # After making changes, run bin/reconfigure to update other configure related # files like Makefile.in. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 220 +LT_VERS_REVISION = 221 LT_VERS_AGE = 0 AM_FCLIBS = $(LIBHDF5) diff --git a/hl/c++/src/Makefile.in b/hl/c++/src/Makefile.in index 905e821..84694ac 100644 --- a/hl/c++/src/Makefile.in +++ b/hl/c++/src/Makefile.in @@ -681,7 +681,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 # After making changes, run bin/reconfigure to update other configure related # files like Makefile.in. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 220 +LT_VERS_REVISION = 221 LT_VERS_AGE = 0 # This is our main target diff --git a/hl/fortran/src/Makefile.in b/hl/fortran/src/Makefile.in index c1c0721..85e5d42 100644 --- a/hl/fortran/src/Makefile.in +++ b/hl/fortran/src/Makefile.in @@ -709,7 +709,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 # After making changes, run bin/reconfigure to update other configure related # files like Makefile.in. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 220 +LT_VERS_REVISION = 221 LT_VERS_AGE = 0 # Our main target, the high-level fortran library diff --git a/hl/src/Makefile.in b/hl/src/Makefile.in index 3bab6a9..4624a08 100644 --- a/hl/src/Makefile.in +++ b/hl/src/Makefile.in @@ -680,7 +680,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 # After making changes, run bin/reconfigure to update other configure related # files like Makefile.in. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 220 +LT_VERS_REVISION = 221 LT_VERS_AGE = 0 # This library is our main target. diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index e281d7d..d1eba9b 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -1,4 +1,4 @@ -HDF5 version 1.9.230 currently under development +HDF5 version 1.9.231 currently under development ================================================================================ diff --git a/src/H5public.h b/src/H5public.h index 6d868de..816e50a 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -94,10 +94,10 @@ extern "C" { /* Version numbers */ #define H5_VERS_MAJOR 1 /* For major interface/format changes */ #define H5_VERS_MINOR 9 /* For minor interface/format changes */ -#define H5_VERS_RELEASE 230 /* For tweaks, bug-fixes, or development */ +#define H5_VERS_RELEASE 231 /* For tweaks, bug-fixes, or development */ #define H5_VERS_SUBRELEASE "" /* For pre-releases like snap0 */ /* Empty string for real releases. */ -#define H5_VERS_INFO "HDF5 library version: 1.9.230" /* Full version string */ +#define H5_VERS_INFO "HDF5 library version: 1.9.231" /* Full version string */ #define H5check() H5check_version(H5_VERS_MAJOR,H5_VERS_MINOR, \ H5_VERS_RELEASE) diff --git a/src/Makefile.in b/src/Makefile.in index 39fb99f..0ee50a8 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -742,7 +742,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 # After making changes, run bin/reconfigure to update other configure related # files like Makefile.in. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 220 +LT_VERS_REVISION = 221 LT_VERS_AGE = 0 # Our main target, the HDF5 library -- cgit v0.12 From 4c8902cdf0dee80c05f20a953e96c5a70c95d2f5 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Mon, 7 Sep 2015 18:44:41 -0500 Subject: [svn-r27692] Changed the autotools files so that the high-level library is unsupported when building the thread-safe library. Configure will quit with an error when --disable-hl or --enable-unsupported is not used with --enable-threadsafe. Fixes HDFFV-8719 Tested on: h5committest configure w/ various combinations of --enable-threadsafe, --disable-hl, and --enable-unsupported --- configure | 16 +++++++++++++--- configure.ac | 14 ++++++++++++-- 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/configure b/configure index f029b0b..35f86f3 100755 --- a/configure +++ b/configure @@ -1581,9 +1581,8 @@ Optional Features: --disable-sharedlib-rpath Disable use of the '=Wl,-rpath' linker option --enable-production Determines how to run the compiler. - --enable-threadsafe Enable thread-safe capability. This will disable the - high-level library. You can override this behavior - by specifying --enable-hl and --enable-unsupported. + --enable-threadsafe Enable thread-safe capability. Not compatible with + the high-level library, Fortran, or C++ wrappers. [default=no] --enable-debug=all Turn on debugging in all packages. One may also specify a comma-separated list of package names @@ -25846,6 +25845,17 @@ fi ## with the thread-safety option because the lock is not hoisted ## into the higher-level API calls. +## --enable-threadsafe is incompatible with --enable-hl unless +## --enable-unsupported has been specified on the configure line. +## +## Note that the high-level library is enabled by default so most +## users will have to add --disable-hl to the configure options. +if test "X${ALLOW_UNSUPPORTED}" != "Xyes"; then + if test "X${HDF5_HL}" = "Xyes" -a "X${enable_threadsafe}" = "Xyes"; then + as_fn_error $? "The thread-safe library is incompatible with the high-level library. --disable-hl can be used to prevent building the high-level library (recommended). Alternatively, --enable-unsupported will allow building the high-level library, though this configuration is not supported by The HDF Group." "$LINENO" 5 + fi +fi + ## The --enable-threadsafe flag is not compatible with --enable-cxx. ## If the user tried to specify both flags, throw an error, unless ## they also provided the --enable-unsupported flag. diff --git a/configure.ac b/configure.ac index df14cec..a4f1457 100644 --- a/configure.ac +++ b/configure.ac @@ -1504,8 +1504,7 @@ AC_CACHE_SAVE AC_MSG_CHECKING([for thread safe support]) AC_ARG_ENABLE([threadsafe], [AS_HELP_STRING([--enable-threadsafe], - [Enable thread-safe capability. This will disable the high-level library. - You can override this behavior by specifying --enable-hl and --enable-unsupported. + [Enable thread-safe capability. Not compatible with the high-level library, Fortran, or C++ wrappers. [default=no]])], [THREADSAFE=$enableval]) @@ -1513,6 +1512,17 @@ AC_ARG_ENABLE([threadsafe], ## with the thread-safety option because the lock is not hoisted ## into the higher-level API calls. +## --enable-threadsafe is incompatible with --enable-hl unless +## --enable-unsupported has been specified on the configure line. +## +## Note that the high-level library is enabled by default so most +## users will have to add --disable-hl to the configure options. +if test "X${ALLOW_UNSUPPORTED}" != "Xyes"; then + if test "X${HDF5_HL}" = "Xyes" -a "X${enable_threadsafe}" = "Xyes"; then + AC_MSG_ERROR([The thread-safe library is incompatible with the high-level library. --disable-hl can be used to prevent building the high-level library (recommended). Alternatively, --enable-unsupported will allow building the high-level library, though this configuration is not supported by The HDF Group.]) + fi +fi + ## The --enable-threadsafe flag is not compatible with --enable-cxx. ## If the user tried to specify both flags, throw an error, unless ## they also provided the --enable-unsupported flag. -- cgit v0.12 From fadb57f7040ca5753c4293190413c446591107d1 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Tue, 8 Sep 2015 15:03:41 -0500 Subject: [svn-r27699] Removed some configure checks for obsolete Unix variants. The H5pubconf.h.in file that CMake uses was also updated. Tested on: h5committest --- config/cmake/H5pubconf.h.in | 12 -------- configure | 68 ++++++++------------------------------------- configure.ac | 35 ++++++++--------------- src/H5config.h.in | 12 -------- 4 files changed, 22 insertions(+), 105 deletions(-) diff --git a/config/cmake/H5pubconf.h.in b/config/cmake/H5pubconf.h.in index 0faf92e..fd3a1d6 100644 --- a/config/cmake/H5pubconf.h.in +++ b/config/cmake/H5pubconf.h.in @@ -157,9 +157,6 @@ /* Define to 1 if you have the `gettimeofday' function. */ #cmakedefine H5_HAVE_GETTIMEOFDAY @H5_HAVE_GETTIMEOFDAY@ -/* Define to 1 if you have the `get_fpc_csr' function. */ -#cmakedefine H5_HAVE_GET_FPC_CSR @H5_HAVE_GET_FPC_CSR@ - /* Define if library will contain instrumentation to detect correct optimization operation */ #cmakedefine H5_HAVE_INSTRUMENTED_LIBRARY @H5_HAVE_INSTRUMENTED_LIBRARY@ @@ -305,15 +302,9 @@ /* Define to 1 if you have the `system' function. */ #cmakedefine H5_HAVE_SYSTEM @H5_HAVE_SYSTEM@ -/* Define to 1 if you have the header file. */ -#cmakedefine H5_HAVE_SYS_FPU_H @H5_HAVE_SYS_FPU_H@ - /* Define to 1 if you have the header file. */ #cmakedefine H5_HAVE_SYS_IOCTL_H @H5_HAVE_SYS_IOCTL_H@ -/* Define to 1 if you have the header file. */ -#cmakedefine H5_HAVE_SYS_PROC_H @H5_HAVE_SYS_PROC_H@ - /* Define to 1 if you have the header file. */ #cmakedefine H5_HAVE_SYS_RESOURCE_H @H5_HAVE_SYS_RESOURCE_H@ @@ -323,9 +314,6 @@ /* Define to 1 if you have the header file. */ #cmakedefine H5_HAVE_SYS_STAT_H @H5_HAVE_SYS_STAT_H@ -/* Define to 1 if you have the header file. */ -#cmakedefine H5_HAVE_SYS_SYSINFO_H @H5_HAVE_SYS_SYSINFO_H@ - /* Define to 1 if you have the header file. */ #cmakedefine H5_HAVE_SYS_TIMEB_H @H5_HAVE_SYS_TIMEB_H@ diff --git a/configure b/configure index 35f86f3..c563592 100755 --- a/configure +++ b/configure @@ -3711,11 +3711,16 @@ ac_config_commands="$ac_config_commands pubconf" ## configure is currently running by using the --host=foo flag. ## For machines on which HDF5 is often configured, it can be convenient ## to specify the name of the machine rather than its canonical type. -case $host_alias in - redstorm) - host_alias=x86_64-redstorm-linux-gnu - ;; -esac +## +## There are currently no hosts, but if there were they would be +## listed by hostname and the alias would point to a file in +## the config directory: +## +##case $host_alias in +## ) +## host_alias= +## ;; +##esac # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || @@ -23384,57 +23389,6 @@ done ;; esac -case "$host" in - alpha*-dec*-osf*) - ## The and are needed on the DEC - ## Alpha to turn off UAC fixing. We do *not* attempt to - ## locate these files on other systems because there are too - ## many problems with including them. - for ac_header in sys/sysinfo.h sys/proc.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - ;; - mips*-sgi*) - ## The is needed on the SGI machines to turn off - ## denormalized floating-point values going to zero. We do *not* - ## attempt to locate these files on other systems because there - ## may be problems with including them. - for ac_header in sys/fpu.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "sys/fpu.h" "ac_cv_header_sys_fpu_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_fpu_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_SYS_FPU_H 1 -_ACEOF - -fi - -done - - for ac_func in get_fpc_csr -do : - ac_fn_c_check_func "$LINENO" "get_fpc_csr" "ac_cv_func_get_fpc_csr" -if test "x$ac_cv_func_get_fpc_csr" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_GET_FPC_CSR 1 -_ACEOF - -fi -done - - ;; -esac - ## ---------------------------------------------------------------------- ## Some platforms require that all symbols are resolved when a library ## is linked. We can use the -no-undefined flag to tell libtool that @@ -26244,7 +26198,7 @@ fi ## ---------------------------------------------------------------------- ## Check for MONOTONIC_TIMER support (used in clock_gettime). This has -## to be done after any POSIX/BSD defines to ensure that the test gets +## to be done after any POSIX defines to ensure that the test gets ## the correct POSIX level on linux. ac_fn_c_check_decl "$LINENO" "CLOCK_MONOTONIC" "ac_cv_have_decl_CLOCK_MONOTONIC" "#include " diff --git a/configure.ac b/configure.ac index a4f1457..c341df5 100644 --- a/configure.ac +++ b/configure.ac @@ -86,11 +86,16 @@ AC_CONFIG_COMMANDS([pubconf], [ ## configure is currently running by using the --host=foo flag. ## For machines on which HDF5 is often configured, it can be convenient ## to specify the name of the machine rather than its canonical type. -case $host_alias in - redstorm) - host_alias=x86_64-redstorm-linux-gnu - ;; -esac +## +## There are currently no hosts, but if there were they would be +## listed by hostname and the alias would point to a file in +## the config directory: +## +##case $host_alias in +## ) +## host_alias= +## ;; +##esac AC_CANONICAL_HOST AC_SUBST([CPPFLAGS]) @@ -997,24 +1002,6 @@ case "`uname`" in ;; esac -case "$host" in - alpha*-dec*-osf*) - ## The and are needed on the DEC - ## Alpha to turn off UAC fixing. We do *not* attempt to - ## locate these files on other systems because there are too - ## many problems with including them. - AC_CHECK_HEADERS([sys/sysinfo.h sys/proc.h]) - ;; - mips*-sgi*) - ## The is needed on the SGI machines to turn off - ## denormalized floating-point values going to zero. We do *not* - ## attempt to locate these files on other systems because there - ## may be problems with including them. - AC_CHECK_HEADERS([sys/fpu.h]) - AC_CHECK_FUNCS([get_fpc_csr]) - ;; -esac - ## ---------------------------------------------------------------------- ## Some platforms require that all symbols are resolved when a library ## is linked. We can use the -no-undefined flag to tell libtool that @@ -1665,7 +1652,7 @@ fi ## ---------------------------------------------------------------------- ## Check for MONOTONIC_TIMER support (used in clock_gettime). This has -## to be done after any POSIX/BSD defines to ensure that the test gets +## to be done after any POSIX defines to ensure that the test gets ## the correct POSIX level on linux. AC_CHECK_DECL([CLOCK_MONOTONIC],[have_clock_monotonic="yes"],[have_clock_monotonic="no"],[[#include ]]) diff --git a/src/H5config.h.in b/src/H5config.h.in index 9ac2327..9363813 100644 --- a/src/H5config.h.in +++ b/src/H5config.h.in @@ -172,9 +172,6 @@ /* Define to 1 if you have the `gettimeofday' function. */ #undef HAVE_GETTIMEOFDAY -/* Define to 1 if you have the `get_fpc_csr' function. */ -#undef HAVE_GET_FPC_CSR - /* Define if the compiler understands inline */ #undef HAVE_INLINE @@ -320,15 +317,9 @@ /* Define to 1 if you have the `system' function. */ #undef HAVE_SYSTEM -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_FPU_H - /* Define to 1 if you have the header file. */ #undef HAVE_SYS_IOCTL_H -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_PROC_H - /* Define to 1 if you have the header file. */ #undef HAVE_SYS_RESOURCE_H @@ -338,9 +329,6 @@ /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_SYSINFO_H - /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TIMEB_H -- cgit v0.12 From 776b41a62a329222db2fd43a550139c5d3cc80fa Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 8 Sep 2015 16:43:37 -0500 Subject: [svn-r27703] Publish both static and shared mod files in binaries. Tested: local linux --- fortran/src/CMakeLists.txt | 48 +++++++++++++++++++++++++++++++++++++------ hl/fortran/src/CMakeLists.txt | 34 +++++++++++++++++++++++++----- 2 files changed, 71 insertions(+), 11 deletions(-) diff --git a/fortran/src/CMakeLists.txt b/fortran/src/CMakeLists.txt index 6c4893b..dc884d5 100644 --- a/fortran/src/CMakeLists.txt +++ b/fortran/src/CMakeLists.txt @@ -64,15 +64,20 @@ set_target_properties (H5_buildiface PROPERTIES Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY} ) -if (NOT SKIP_HDF5_FORTRAN_SHARED) +if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) if (WIN32) - set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static/\${BUILD_TYPE}) + set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared/\${BUILD_TYPE}) else (WIN32) - set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static) + set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared) endif (WIN32) -endif (NOT SKIP_HDF5_FORTRAN_SHARED) +endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +if (WIN32) + set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static/\${BUILD_TYPE}) +else (WIN32) + set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static) +endif (WIN32) -INCLUDE_DIRECTORIES (${HDF5_F90_BINARY_DIR} ${CMAKE_Fortran_MODULE_DIRECTORY} ${MOD_BUILD_DIR}) +INCLUDE_DIRECTORIES (${HDF5_F90_BINARY_DIR} ${CMAKE_Fortran_MODULE_DIRECTORY}) #----------------------------------------------------------------------------- add_executable (H5match_types @@ -286,11 +291,42 @@ install ( FILES ${mod_files} DESTINATION - ${HDF5_INSTALL_INCLUDE_DIR} + ${HDF5_INSTALL_INCLUDE_DIR}/static COMPONENT fortheaders ) +if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) + set (modsh_files + ${MODSH_BUILD_DIR}/h5fortran_types.mod + ${MODSH_BUILD_DIR}/hdf5.mod + ${MODSH_BUILD_DIR}/h5global.mod + ${MODSH_BUILD_DIR}/h5a.mod + ${MODSH_BUILD_DIR}/h5d.mod + ${MODSH_BUILD_DIR}/h5e.mod + ${MODSH_BUILD_DIR}/h5f.mod + ${MODSH_BUILD_DIR}/h5g.mod + ${MODSH_BUILD_DIR}/h5i.mod + ${MODSH_BUILD_DIR}/h5l.mod + ${MODSH_BUILD_DIR}/h5lib.mod + ${MODSH_BUILD_DIR}/h5o.mod + ${MODSH_BUILD_DIR}/h5p.mod + ${MODSH_BUILD_DIR}/h5r.mod + ${MODSH_BUILD_DIR}/h5s.mod + ${MODSH_BUILD_DIR}/h5t.mod + ${MODSH_BUILD_DIR}/h5z.mod + ${MODSH_BUILD_DIR}/h5_gen.mod + ) + install ( + FILES + ${modsh_files} + DESTINATION + ${HDF5_INSTALL_INCLUDE_DIR}/shared + COMPONENT + fortheaders + ) +endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) + #----------------------------------------------------------------------------- # Add Target(s) to CMake Install for import into other projects #----------------------------------------------------------------------------- diff --git a/hl/fortran/src/CMakeLists.txt b/hl/fortran/src/CMakeLists.txt index 4047a97..ead21be 100644 --- a/hl/fortran/src/CMakeLists.txt +++ b/hl/fortran/src/CMakeLists.txt @@ -36,13 +36,18 @@ set_target_properties (H5HL_buildiface PROPERTIES Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY} ) -if (NOT SKIP_HDF5_FORTRAN_SHARED) +if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) if (WIN32) - set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static/\${BUILD_TYPE}) + set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared/\${BUILD_TYPE}) else (WIN32) - set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static) + set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared) endif (WIN32) -endif (NOT SKIP_HDF5_FORTRAN_SHARED) +endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +if (WIN32) + set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static/\${BUILD_TYPE}) +else (WIN32) + set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static) +endif (WIN32) #----------------------------------------------------------------------------- # Setup include Directories @@ -192,11 +197,30 @@ install ( FILES ${mod_files} DESTINATION - ${HDF5_INSTALL_INCLUDE_DIR} + ${HDF5_INSTALL_INCLUDE_DIR}/static COMPONENT fortheaders ) +if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) + set (modsh_files + ${MODSH_BUILD_DIR}/h5ds.mod + ${MODSH_BUILD_DIR}/h5tb.mod + ${MODSH_BUILD_DIR}/h5tb_const.mod + ${MODSH_BUILD_DIR}/h5lt.mod + ${MODSH_BUILD_DIR}/h5lt_const.mod + ${MODSH_BUILD_DIR}/h5im.mod + ) + install ( + FILES + ${modsh_files} + DESTINATION + ${HDF5_INSTALL_INCLUDE_DIR}/shared + COMPONENT + fortheaders + ) +endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) + #----------------------------------------------------------------------------- # Add Target(s) to CMake Install for import into other projects #----------------------------------------------------------------------------- -- cgit v0.12 From 2132f544596c2e12e86cebf4c1cc6b1d38ffa80d Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Wed, 9 Sep 2015 00:26:45 -0500 Subject: [svn-r27707] Description: Misc. minor cleanups in preparation for merging "metadata rings" branch to trunk. Tested on: MacOSX/64 10.10.5 (amazon) w/serial (Too minor to require h5committest) --- src/H5C.c | 248 +++++++++++++++++++++----------------------------------- src/H5FScache.c | 2 +- src/H5Fsuper.c | 2 +- src/H5Pdxpl.c | 2 +- 4 files changed, 97 insertions(+), 157 deletions(-) diff --git a/src/H5C.c b/src/H5C.c index c478173..b360e9d 100644 --- a/src/H5C.c +++ b/src/H5C.c @@ -1009,13 +1009,6 @@ done: * all unprotected entries should be flushed before the * function returns failure. * - * The primary_dxpl_id and secondary_dxpl_id parameters - * specify the dxpl_ids used on the first write occasioned - * by the flush (primary_dxpl_id), and on all subsequent - * writes (secondary_dxpl_id). This is useful in the metadata - * cache, but may not be needed elsewhere. If so, just use the - * same dxpl_id for both parameters. - * * Return: Non-negative on success/Negative on failure or if there was * a request to flush all items and something was protected. * @@ -1072,17 +1065,13 @@ H5C_flush_cache(H5F_t *f, hid_t dxpl_id, unsigned flags) HDassert( cache_ptr->slist_ptr ); #if H5C_DO_EXTREME_SANITY_CHECKS - if ( ( H5C_validate_protected_entry_list(cache_ptr) < 0 ) || - ( H5C_validate_pinned_entry_list(cache_ptr) < 0 ) || - ( H5C_validate_lru_list(cache_ptr) < 0 ) ) { - - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ - "an extreme sanity check failed on entry.\n"); - } + if((H5C_validate_protected_entry_list(cache_ptr) < 0) || + (H5C_validate_pinned_entry_list(cache_ptr) < 0) || + (H5C_validate_lru_list(cache_ptr) < 0)) + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on entry.\n"); #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ ignore_protected = ( (flags & H5C__FLUSH_IGNORE_PROTECTED_FLAG) != 0 ); - destroy = ( (flags & H5C__FLUSH_INVALIDATE_FLAG) != 0 ); /* note that flush_marked_entries is set to FALSE if destroy is TRUE */ @@ -1092,12 +1081,11 @@ H5C_flush_cache(H5F_t *f, hid_t dxpl_id, unsigned flags) ); HDassert( ! ( destroy && ignore_protected ) ); - HDassert( ! ( cache_ptr->flush_in_progress ) ); cache_ptr->flush_in_progress = TRUE; - if ( destroy ) { + if(destroy) { if(H5C_flush_invalidate_cache(f, dxpl_id, flags) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "flush invalidate failed.") } else { @@ -1433,11 +1421,9 @@ H5C_flush_cache(H5F_t *f, hid_t dxpl_id, unsigned flags) } done: - cache_ptr->flush_in_progress = FALSE; FUNC_LEAVE_NOAPI(ret_value) - } /* H5C_flush_cache() */ @@ -2928,7 +2914,7 @@ H5C_protect(H5F_t * f, ( H5C_validate_pinned_entry_list(cache_ptr) < 0 ) || ( H5C_validate_lru_list(cache_ptr) < 0 ) ) { - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, NULL, \ "an extreme sanity check failed on entry.\n"); } #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ @@ -6892,11 +6878,9 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5C_flush_invalidate_cache(const H5F_t * f, - hid_t dxpl_id, - unsigned flags) +H5C_flush_invalidate_cache(const H5F_t * f, hid_t dxpl_id, unsigned flags) { - H5C_t * cache_ptr = f->shared->cache; + H5C_t * cache_ptr; hbool_t restart_slist_scan; int32_t protected_entries = 0; int32_t i; @@ -6921,10 +6905,12 @@ H5C_flush_invalidate_cache(const H5F_t * f, FUNC_ENTER_NOAPI(FAIL) - HDassert( f ); - HDassert( cache_ptr ); - HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); - HDassert( cache_ptr->slist_ptr ); + HDassert(f); + HDassert(f->shared); + cache_ptr = f->shared->cache; + HDassert(cache_ptr); + HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); + HDassert(cache_ptr->slist_ptr); /* Filter out the flags that are not relevant to the flush/invalidate. * At present, only the H5C__FLUSH_CLEAR_ONLY_FLAG is kept. @@ -7034,37 +7020,26 @@ H5C_flush_invalidate_cache(const H5F_t * f, cache_ptr->slist_change_in_serialize = FALSE; /* this done, start the scan of the slist */ - restart_slist_scan = TRUE; - - while ( ( restart_slist_scan ) || ( node_ptr != NULL ) ) - { - if ( restart_slist_scan ) - { + while(restart_slist_scan || (node_ptr != NULL)) { + if(restart_slist_scan) { restart_slist_scan = FALSE; /* Start at beginning of skip list */ node_ptr = H5SL_first(cache_ptr->slist_ptr); - - if ( node_ptr == NULL ) - { + if(node_ptr == NULL) /* the slist is empty -- break out of inner loop */ break; - } - HDassert( node_ptr != NULL ); /* Get cache entry for this node */ next_entry_ptr = (H5C_cache_entry_t *)H5SL_item(node_ptr); + if ( NULL == next_entry_ptr ) + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "next_entry_ptr == NULL ?!?!") - if(NULL == next_entry_ptr) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ - "next_entry_ptr == NULL ?!?!") - - HDassert( next_entry_ptr->magic == \ - H5C__H5C_CACHE_ENTRY_T_MAGIC ); - HDassert( next_entry_ptr->is_dirty ); - HDassert( next_entry_ptr->in_slist ); - } + HDassert(next_entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); + HDassert(next_entry_ptr->is_dirty); + HDassert(next_entry_ptr->in_slist); + } /* end if */ entry_ptr = next_entry_ptr; @@ -7079,27 +7054,25 @@ H5C_flush_invalidate_cache(const H5F_t * f, * slist if we find them. However, best we do some extra * sanity checking just in case. */ - - HDassert( entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC ); - HDassert( entry_ptr->in_slist ); - HDassert( entry_ptr->is_dirty ); + HDassert(entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); + HDassert(entry_ptr->in_slist); + HDassert(entry_ptr->is_dirty); /* increment node pointer now, before we delete its target * from the slist. */ - node_ptr = H5SL_next(node_ptr); - if ( node_ptr != NULL ) { + if(node_ptr != NULL) { next_entry_ptr = (H5C_cache_entry_t *)H5SL_item(node_ptr); - if ( NULL == next_entry_ptr ) + if(NULL == next_entry_ptr) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "next_entry_ptr == NULL ?!?!") - HDassert( next_entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC ); - HDassert( next_entry_ptr->is_dirty ); - HDassert( next_entry_ptr->in_slist ); - HDassert( entry_ptr != next_entry_ptr ); - } else { + HDassert(next_entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); + HDassert(next_entry_ptr->is_dirty); + HDassert(next_entry_ptr->in_slist); + HDassert(entry_ptr != next_entry_ptr); + } /* end if */ + else next_entry_ptr = NULL; - } /* Note that we now remove nodes from the slist as we flush * the associated entries, instead of leaving them there @@ -7111,30 +7084,26 @@ H5C_flush_invalidate_cache(const H5F_t * f, * flush, we must keep the slist in cannonical form at all * times. */ - - HDassert( entry_ptr != NULL ); - HDassert( entry_ptr->in_slist ); + HDassert(entry_ptr != NULL); + HDassert(entry_ptr->in_slist); if ( ( ! entry_ptr->flush_me_last ) || ( ( entry_ptr->flush_me_last ) && ( cache_ptr->num_last_entries >= cache_ptr->slist_len ) ) ) { - - if ( entry_ptr->is_protected ) { - + if(entry_ptr->is_protected) { /* we have major problems -- but lets flush * everything we can before we flag an error. */ protected_entries++; - - } else if ( entry_ptr->is_pinned ) { + } else if(entry_ptr->is_pinned) { /* Test to see if we are can flush the entry now. * If we can, go ahead and flush, but don't tell * H5C__flush_single_entry() to destroy the entry * as pinned entries can't be evicted. */ - if(entry_ptr->flush_dep_height == curr_flush_dep_height ) { + if(entry_ptr->flush_dep_height == curr_flush_dep_height) { #if H5C_DO_SANITY_CHECKS /* update flushed_slist_len & flushed_slist_size * before the flush. Note that the entry will @@ -7151,7 +7120,6 @@ H5C_flush_invalidate_cache(const H5F_t * f, if(H5C__flush_single_entry(f, dxpl_id, entry_ptr, H5C__NO_FLAGS_SET, entry_size_change_ptr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "dirty pinned entry flush failed.") - #if H5C_DO_SANITY_CHECKS /* entry size may have changed during the flush. * Update flushed_slist_size to account for this. @@ -7160,10 +7128,8 @@ H5C_flush_invalidate_cache(const H5F_t * f, #endif /* H5C_DO_SANITY_CHECKS */ flushed_during_dep_loop = TRUE; - - if ( ( cache_ptr->slist_change_in_serialize ) || - ( cache_ptr->slist_change_in_pre_serialize ) ) - { + if((cache_ptr->slist_change_in_serialize) || + (cache_ptr->slist_change_in_pre_serialize)) { /* The slist has been modified by something * other than the simple removal of the * of the flushed entry after the flush. @@ -7172,18 +7138,17 @@ H5C_flush_invalidate_cache(const H5F_t * f, * scan through the slist, so restart it. */ restart_slist_scan = TRUE; - cache_ptr->slist_change_in_pre_serialize - = FALSE; + cache_ptr->slist_change_in_pre_serialize = FALSE; cache_ptr->slist_change_in_serialize = FALSE; H5C__UPDATE_STATS_FOR_SLIST_SCAN_RESTART(cache_ptr); - } + } /* end if */ } /* end if */ else if(entry_ptr->flush_dep_height < curr_flush_dep_height) /* This shouldn't happen -- if it does, just scream and die. */ - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "dirty entry below current flush dep. height.") + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "dirty entry below current flush dep. height.") } /* end if */ else { - if(entry_ptr->flush_dep_height == curr_flush_dep_height ){ + if(entry_ptr->flush_dep_height == curr_flush_dep_height) { #if H5C_DO_SANITY_CHECKS /* update flushed_slist_len & flushed_slist_size * before the flush. Note that the entry will @@ -7198,9 +7163,10 @@ H5C_flush_invalidate_cache(const H5F_t * f, entry_size_change = 0; #endif /* H5C_DO_SANITY_CHECKS */ - if(H5C__flush_single_entry(f, dxpl_id, entry_ptr, (cooked_flags | H5C__FLUSH_INVALIDATE_FLAG | H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG), entry_size_change_ptr) < 0) + if(H5C__flush_single_entry(f, dxpl_id, entry_ptr, + (cooked_flags | H5C__FLUSH_INVALIDATE_FLAG | H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG), + entry_size_change_ptr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "dirty entry flush destroy failed.") - #if H5C_DO_SANITY_CHECKS /* entry size may have changed during the flush. * Update flushed_slist_size to account for this. @@ -7210,9 +7176,8 @@ H5C_flush_invalidate_cache(const H5F_t * f, flushed_during_dep_loop = TRUE; - if ((cache_ptr->slist_change_in_serialize) || - (cache_ptr->slist_change_in_pre_serialize)) - { + if((cache_ptr->slist_change_in_serialize) || + (cache_ptr->slist_change_in_pre_serialize)) { /* The slist has been modified by something * other than the simple removal of the * of the flushed entry after the flush. @@ -7221,15 +7186,14 @@ H5C_flush_invalidate_cache(const H5F_t * f, * scan through the slist, so restart it. */ restart_slist_scan = TRUE; - cache_ptr->slist_change_in_pre_serialize - = FALSE; + cache_ptr->slist_change_in_pre_serialize = FALSE; cache_ptr->slist_change_in_serialize = FALSE; H5C__UPDATE_STATS_FOR_SLIST_SCAN_RESTART(cache_ptr) - } + } /* end if */ } /* end if */ else if(entry_ptr->flush_dep_height < curr_flush_dep_height) /* This shouldn't happen -- if it does, just scream and die. */ - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "dirty entry below current flush dep. height.") + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "dirty entry below current flush dep. height.") } /* end else */ } /* end if */ } /* end while loop scanning skip list */ @@ -7244,13 +7208,12 @@ H5C_flush_invalidate_cache(const H5F_t * f, * out from under us. */ - if ( node_ptr == NULL ) { - - HDassert( (flushed_slist_len + cache_ptr->slist_len) == - (initial_slist_len + cache_ptr->slist_len_increase) ); - HDassert( (flushed_slist_size + (int64_t)cache_ptr->slist_size) == - ((int64_t)initial_slist_size + cache_ptr->slist_size_increase) ); - } + if(node_ptr == NULL) { + HDassert((flushed_slist_len + cache_ptr->slist_len) == + (initial_slist_len + cache_ptr->slist_len_increase)); + HDassert((flushed_slist_size + (int64_t)cache_ptr->slist_size) == + ((int64_t)initial_slist_size + cache_ptr->slist_size_increase)); + } /* end if */ #endif /* H5C_DO_SANITY_CHECKS */ /* Since we are doing a destroy, we must make a pass through @@ -7264,42 +7227,36 @@ H5C_flush_invalidate_cache(const H5F_t * f, * * Writes to disk are possible here. */ - for ( i = 0; i < H5C__HASH_TABLE_LEN; i++ ) - { + for(i = 0; i < H5C__HASH_TABLE_LEN; i++) { next_entry_ptr = cache_ptr->index[i]; - while ( next_entry_ptr != NULL ) - { + while(next_entry_ptr != NULL) { entry_ptr = next_entry_ptr; - HDassert( entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC ); + HDassert(entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); next_entry_ptr = entry_ptr->ht_next; - HDassert ( ( next_entry_ptr == NULL ) || - ( next_entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC ) ); + HDassert((next_entry_ptr == NULL) || + (next_entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC)); if ( ( ! entry_ptr->flush_me_last ) || ( ( entry_ptr->flush_me_last ) && ( cache_ptr->num_last_entries >= cache_ptr->slist_len ) ) ) { - if ( entry_ptr->is_protected ) { - + if(entry_ptr->is_protected) { /* we have major problems -- but lets flush and * destroy everything we can before we flag an * error. */ protected_entries++; - - if ( ! entry_ptr->in_slist ) { - - HDassert( !(entry_ptr->is_dirty) ); - } - } else if ( ! ( entry_ptr->is_pinned ) ) { + if(!entry_ptr->in_slist) + HDassert(!(entry_ptr->is_dirty)); + } else if(!(entry_ptr->is_pinned)) { /* Test to see if we are can flush the entry now. * If we can, go ahead and flush. */ - if(entry_ptr->flush_dep_height == curr_flush_dep_height ){ + if(entry_ptr->flush_dep_height == curr_flush_dep_height) { /* if *entry_ptr is dirty, it is possible * that one or more other entries may be * either removed from the cache, loaded @@ -7330,21 +7287,20 @@ H5C_flush_invalidate_cache(const H5F_t * f, if(H5C__flush_single_entry(f, dxpl_id, entry_ptr, (cooked_flags | H5C__FLUSH_INVALIDATE_FLAG | H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG), NULL) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Entry flush destroy failed.") - if ( entry_was_dirty ) { - + if(entry_was_dirty) { /* update stats for hash bucket scan * restart here. * -- JRM */ next_entry_ptr = cache_ptr->index[i]; H5C__UPDATE_STATS_FOR_HASH_BUCKET_SCAN_RESTART(cache_ptr) - } + } /* end if */ flushed_during_dep_loop = TRUE; } /* end if */ else if(entry_ptr->flush_dep_height < curr_flush_dep_height) /* This shouldn't happen -- if it does, just scream and die. */ - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "dirty entry below current flush dep. height.") + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "dirty entry below current flush dep. height.") } /* end if */ } /* end if */ /* We can't do anything if the entry is pinned. The @@ -7371,16 +7327,11 @@ H5C_flush_invalidate_cache(const H5F_t * f, * in case I am wrong. * -- JRM */ - if ( ( next_entry_ptr != NULL ) && - ( next_entry_ptr->magic != - H5C__H5C_CACHE_ENTRY_T_MAGIC ) ) { - + if((next_entry_ptr != NULL) && (next_entry_ptr->magic != H5C__H5C_CACHE_ENTRY_T_MAGIC)) /* Something horrible has happened to * *next_entry_ptr -- scream and die. */ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ - "next_entry_ptr->magic is invalid?!?!?.") - } + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "next_entry_ptr->magic is invalid?!?!?.") } /* end while loop scanning hash table bin */ } /* end for loop scanning hash table */ @@ -7407,52 +7358,41 @@ H5C_flush_invalidate_cache(const H5F_t * f, /* The number of pinned entries is positive, and it is not * declining. Scream and die. */ - - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, \ - "Pinned entry count not decreasing, cur_pel_len = %d, old_pel_len = %d", (int)cur_pel_len, (int)old_pel_len) - + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Pinned entry count not decreasing, cur_pel_len = %d, old_pel_len = %d", (int)cur_pel_len, (int)old_pel_len) } else if ( ( cur_pel_len == 0 ) && ( old_pel_len == 0 ) ) { - /* increment the pass count */ passes++; } - if ( passes >= H5C__MAX_PASSES_ON_FLUSH ) { - + if(passes >= H5C__MAX_PASSES_ON_FLUSH) /* we have exceeded the maximum number of passes through the * cache to flush and destroy all entries. Scream and die. */ - - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, \ - "Maximum passes on flush exceeded.") - } + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Maximum passes on flush exceeded.") } /* main while loop */ /* Invariants, after destroying all entries in the hash table */ - HDassert( cache_ptr->index_size == 0 ); - HDassert( cache_ptr->clean_index_size == 0 ); - HDassert( cache_ptr->dirty_index_size == 0 ); - HDassert( cache_ptr->slist_len == 0 ); - HDassert( cache_ptr->slist_size == 0 ); - HDassert( cache_ptr->pel_len == 0 ); - HDassert( cache_ptr->pel_size == 0 ); - HDassert( cache_ptr->pl_len == 0 ); - HDassert( cache_ptr->pl_size == 0 ); - HDassert( cache_ptr->LRU_list_len == 0 ); - HDassert( cache_ptr->LRU_list_size == 0 ); - + HDassert(cache_ptr->index_size == 0); + HDassert(cache_ptr->clean_index_size == 0); + HDassert(cache_ptr->dirty_index_size == 0); + HDassert(cache_ptr->slist_len == 0); + HDassert(cache_ptr->slist_size == 0); + HDassert(cache_ptr->pel_len == 0); + HDassert(cache_ptr->pel_size == 0); + HDassert(cache_ptr->pl_len == 0); + HDassert(cache_ptr->pl_size == 0); + HDassert(cache_ptr->LRU_list_len == 0); + HDassert(cache_ptr->LRU_list_size == 0); - HDassert( protected_entries <= cache_ptr->pl_len ); - if ( protected_entries > 0 ) { + HDassert(protected_entries <= cache_ptr->pl_len); - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, \ - "Cache has protected entries.") + if(protected_entries > 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Cache has protected entries.") - } else if ( cur_pel_len > 0 ) { + else if(cur_pel_len > 0) { - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, \ - "Can't unpin all pinned entries.") + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't unpin all pinned entries.") } @@ -7630,7 +7570,7 @@ H5C__flush_single_entry(const H5F_t *f, hid_t dxpl_id, H5C_cache_entry_t *entry_ unsigned coll_meta; /* Collective metadata write flag */ /* Get the dataset transfer property list */ - if(NULL == (dxpl = H5I_object(dxpl_id))) + if(NULL == (dxpl = (H5P_genplist_t *)H5I_object(dxpl_id))) HGOTO_ERROR(H5E_CACHE, H5E_BADTYPE, FAIL, "not a dataset transfer property list") /* Get the collective metadata write property */ diff --git a/src/H5FScache.c b/src/H5FScache.c index 25a9c5e..9accfc4 100644 --- a/src/H5FScache.c +++ b/src/H5FScache.c @@ -343,7 +343,7 @@ H5FS__cache_hdr_image_len(const void *_thing, size_t *image_len, /*------------------------------------------------------------------------- - * Function: H5FS__cache_hdf_pre_serialize + * Function: H5FS__cache_hdr_pre_serialize * * Purpose: The free space manager header contains the address, size, and * allocation size of the free space manager section info. However, diff --git a/src/H5Fsuper.c b/src/H5Fsuper.c index ce3f2ea..2262ccd 100644 --- a/src/H5Fsuper.c +++ b/src/H5Fsuper.c @@ -222,7 +222,7 @@ H5F_super_ext_close(H5F_t *f, H5O_loc_t *ext_ptr, hid_t dxpl_id, /* Decrement refcount on superblock extension's object header in memory */ if(H5O_dec_rc_by_loc(ext_ptr, dxpl_id) < 0) - HDONE_ERROR(H5E_FILE, H5E_CANTDEC, FAIL, "unable to decrement refcount on superblock extension") + HGOTO_ERROR(H5E_FILE, H5E_CANTDEC, FAIL, "unable to decrement refcount on superblock extension"); } /* end if */ /* Twiddle the number of open objects to avoid closing the file. */ diff --git a/src/H5Pdxpl.c b/src/H5Pdxpl.c index b5bc720..cea94e3 100644 --- a/src/H5Pdxpl.c +++ b/src/H5Pdxpl.c @@ -34,7 +34,7 @@ /* Headers */ /***********/ #include "H5private.h" /* Generic Functions */ -#include "H5ACprivate.h" /* Cache */ +#include "H5ACprivate.h" /* Cache */ #include "H5Dprivate.h" /* Datasets */ #include "H5Eprivate.h" /* Error handling */ #include "H5Iprivate.h" /* IDs */ -- cgit v0.12 From 26baf1a805b27e2ca34edf313a85f4a6d4081da1 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Wed, 9 Sep 2015 01:33:03 -0500 Subject: [svn-r27710] Description: Bring the "metadata rings" code from its branch (mdc_rings_v2) to the trunk. (This change will support the page buffering feature) Tested on: MacOSX/64 10.10.5 (amazon) w/serial & parallel (h5committest forthcoming) --- src/H5AC.c | 110 ++++ src/H5ACprivate.h | 18 + src/H5C.c | 1348 +++++++++++++++++++++++++++++--------------------- src/H5Cpkg.h | 455 ++++++++++++----- src/H5Cprivate.h | 77 +++ src/H5FScache.c | 16 + src/H5Fsuper.c | 74 ++- src/H5Fsuper_cache.c | 10 + src/H5MF.c | 80 +++ src/H5Pdxpl.c | 12 + src/H5SM.c | 25 + test/cache_common.c | 4 +- testpar/t_cache.c | 2 +- 13 files changed, 1540 insertions(+), 691 deletions(-) diff --git a/src/H5AC.c b/src/H5AC.c index a94a727..525f78b 100644 --- a/src/H5AC.c +++ b/src/H5AC.c @@ -2321,3 +2321,113 @@ H5AC_retag_copied_metadata(const H5F_t *f, haddr_t metadata_tag) FUNC_LEAVE_NOAPI(SUCCEED) } /* H5AC_retag_copied_metadata */ + +/*------------------------------------------------------------------------- + * Function: H5AC_get_entry_ring + * + * Purpose: Given a file address, retrieve the ring for an entry at that + * address. + * + * On error, the value of *ring is not modified. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Quincey Koziol + * 9/8/15 + * + *------------------------------------------------------------------------- + */ +herr_t +H5AC_get_entry_ring(const H5F_t *f, haddr_t addr, H5AC_ring_t *ring) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* Sanity check */ + HDassert(f); + HDassert(H5F_addr_defined(addr)); + HDassert(ring); + + /* Retrieve the ring value for the entry at address */ + if(H5C_get_entry_ring(f, addr, ring) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, FAIL, "Can't retrieve ring for entry") + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* H5AC_get_entry_ring() */ + + +/*------------------------------------------------------------------------- + * Function: H5AC_set_ring + * + * Purpose: Routine to set the ring on a DXPL (for passing through + * to the metadata cache). + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Quincey Koziol + * Tuesday, September 8, 2015 + * + *------------------------------------------------------------------------- + */ +herr_t +H5AC_set_ring(hid_t dxpl_id, H5AC_ring_t ring, H5P_genplist_t **dxpl, + H5AC_ring_t *orig_ring) +{ + herr_t ret_value = SUCCEED; /* return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* Sanity checks */ + HDassert(dxpl); + HDassert(orig_ring); + + /* Set the ring type in the DXPL */ + if(NULL == ((*dxpl) = (H5P_genplist_t *)H5I_object_verify(dxpl_id, H5I_GENPROP_LST))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list") + if((H5P_get((*dxpl), H5AC_RING_NAME, orig_ring)) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "unable to get original ring value") + if((H5P_set((*dxpl), H5AC_RING_NAME, &ring)) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "unable to set ring value") + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5AC_set_ring() */ + + +/*------------------------------------------------------------------------- + * Function: H5AC_reset_ring + * + * Purpose: Routine to reset the original ring on a DXPL (after passing + * through to the metadata cache). + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Quincey Koziol + * Tuesday, September 8, 2015 + * + *------------------------------------------------------------------------- + */ +herr_t +H5AC_reset_ring(H5P_genplist_t *dxpl, H5AC_ring_t orig_ring) +{ + herr_t ret_value = SUCCEED; /* return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* Reset the ring in the DXPL, if it's been changed */ + if(orig_ring) { + /* Sanity check */ + HDassert(dxpl); + + if((H5P_set(dxpl, H5AC_RING_NAME, &orig_ring)) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "unable to set property value") + } /* end if */ + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5AC_reset_ring() */ + diff --git a/src/H5ACprivate.h b/src/H5ACprivate.h index 584ce9d..fded15c 100644 --- a/src/H5ACprivate.h +++ b/src/H5ACprivate.h @@ -132,6 +132,15 @@ typedef enum { #define H5AC__SERIALIZE_MOVED_FLAG H5C__SERIALIZE_MOVED_FLAG #define H5AC__SERIALIZE_COMPRESSED_FLAG H5C__SERIALIZE_COMPRESSED_FLAG +/* Aliases for the "ring" type and values */ +typedef H5C_ring_t H5AC_ring_t; +#define H5AC_RING_INV H5C_RING_UNDEFINED +#define H5AC_RING_US H5C_RING_USER +#define H5AC_RING_FSM H5C_RING_FSM +#define H5AC_RING_SBE H5C_RING_SBE +#define H5AC_RING_SB H5C_RING_SB +#define H5AC_RING_NTYPES H5C_RING_NTYPES + /* Aliases for 'notify action' type & values */ typedef H5C_notify_action_t H5AC_notify_action_t; #define H5AC_NOTIFY_ACTION_AFTER_INSERT H5C_NOTIFY_ACTION_AFTER_INSERT @@ -185,6 +194,8 @@ typedef H5C_t H5AC_t; #define H5AC_METADATA_TAG_SIZE sizeof(haddr_t) #define H5AC_METADATA_TAG_DEF H5AC__INVALID_TAG +#define H5AC_RING_NAME "H5AC_ring_type" + /* Dataset transfer property list for flush calls */ /* (Collective set, "block before metadata write" set and "library internal" set) */ /* (Global variable declaration, definition is in H5AC.c) */ @@ -350,9 +361,16 @@ H5_DLL herr_t H5AC_set_cache_auto_resize_config(H5AC_t *cache_ptr, H5_DLL herr_t H5AC_validate_config(H5AC_cache_config_t *config_ptr); H5_DLL herr_t H5AC_close_trace_file(H5AC_t *cache_ptr); H5_DLL herr_t H5AC_open_trace_file(H5AC_t *cache_ptr, const char *trace_file_name); + +/* Tag & Ring routines */ H5_DLL herr_t H5AC_tag(hid_t dxpl_id, haddr_t metadata_tag, haddr_t *prev_tag); H5_DLL herr_t H5AC_retag_copied_metadata(const H5F_t *f, haddr_t metadata_tag); H5_DLL herr_t H5AC_ignore_tags(const H5F_t *f); +H5_DLL herr_t H5AC_get_entry_ring(const H5F_t *f, haddr_t addr, H5AC_ring_t *ring); +H5_DLL herr_t H5AC_set_ring(hid_t dxpl_id, H5AC_ring_t ring, H5P_genplist_t **dxpl, + H5AC_ring_t *orig_ring); +H5_DLL herr_t H5AC_reset_ring(H5P_genplist_t *dxpl, H5AC_ring_t orig_ring); + #ifdef H5_HAVE_PARALLEL H5_DLL herr_t H5AC_add_candidate(H5AC_t * cache_ptr, haddr_t addr); diff --git a/src/H5C.c b/src/H5C.c index b360e9d..cd04f7e 100644 --- a/src/H5C.c +++ b/src/H5C.c @@ -147,6 +147,12 @@ static herr_t H5C_flush_invalidate_cache(const H5F_t * f, hid_t dxpl_id, unsigned flags); +static herr_t H5C_flush_invalidate_ring(const H5F_t * f, hid_t dxpl_id, + H5C_ring_t ring, unsigned flags); + +static herr_t H5C_flush_ring(H5F_t *f, hid_t dxpl_id, H5C_ring_t ring, + unsigned flags); + static void * H5C_load_entry(H5F_t * f, hid_t dxpl_id, const H5C_class_t * type, @@ -496,6 +502,16 @@ H5C_create(size_t max_cache_size, cache_ptr->clean_index_size = (size_t)0; cache_ptr->dirty_index_size = (size_t)0; + for(i = 0; i < H5C_RING_NTYPES; i++) { + cache_ptr->index_ring_len[i] = 0; + cache_ptr->index_ring_size[i] = (size_t)0; + cache_ptr->clean_index_ring_size[i] = (size_t)0; + cache_ptr->dirty_index_ring_size[i] = (size_t)0; + + cache_ptr->slist_ring_len[i] = 0; + cache_ptr->slist_ring_size[i] = (size_t)0; + } /* end for */ + /* Tagging Field Initializations */ cache_ptr->ignore_tags = FALSE; @@ -510,10 +526,8 @@ H5C_create(size_t max_cache_size, cache_ptr->slist_size_increase = 0; #endif /* H5C_DO_SANITY_CHECKS */ - for ( i = 0; i < H5C__HASH_TABLE_LEN; i++ ) - { + for(i = 0; i < H5C__HASH_TABLE_LEN; i++) (cache_ptr->index)[i] = NULL; - } cache_ptr->entries_removed_counter = 0; cache_ptr->last_entry_removed_ptr = NULL; @@ -1029,40 +1043,70 @@ done: * * JRM -- 12/13/14 * + * Modified function to support rings. Basic idea is that + * every entry in the cache is assigned to a ring. Entries + * in the outermost ring are flushed first, followed by + * those in the next outermost ring, and so on until the + * innermost ring is flushed. See header comment on + * H5C_ring_t in H5Cprivate.h for a more detailed + * discussion. + * + * JRM -- 8/30/15 + * *------------------------------------------------------------------------- */ herr_t H5C_flush_cache(H5F_t *f, hid_t dxpl_id, unsigned flags) { - H5C_t * cache_ptr = f->shared->cache; - herr_t ret_value = SUCCEED; - hbool_t destroy; - hbool_t flushed_entries_last_pass; - hbool_t flush_marked_entries; - hbool_t ignore_protected; - hbool_t tried_to_flush_protected_entry = FALSE; - hbool_t restart_slist_scan; - int32_t passes = 0; - int32_t protected_entries = 0; - H5SL_node_t * node_ptr = NULL; - H5C_cache_entry_t * entry_ptr = NULL; - H5C_cache_entry_t * next_entry_ptr = NULL; #if H5C_DO_SANITY_CHECKS - int64_t flushed_entries_count = 0; - int64_t flushed_entries_size = 0; - int64_t initial_slist_len = 0; - size_t initial_slist_size = 0; - int64_t entry_size_change; - int64_t * entry_size_change_ptr = &entry_size_change; -#else /* H5C_DO_SANITY_CHECKS */ - int64_t * entry_size_change_ptr = NULL; + int i; + int32_t index_len = 0; + size_t index_size = (size_t)0; + size_t clean_index_size = (size_t)0; + size_t dirty_index_size = (size_t)0; + size_t slist_size = (size_t)0; + int32_t slist_len = 0; #endif /* H5C_DO_SANITY_CHECKS */ + H5C_ring_t ring; + H5C_t * cache_ptr; + hbool_t destroy; + hbool_t ignore_protected; + herr_t ret_value = SUCCEED; FUNC_ENTER_NOAPI(FAIL) - HDassert( cache_ptr ); - HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); - HDassert( cache_ptr->slist_ptr ); + HDassert(f); + HDassert(f->shared); + cache_ptr = f->shared->cache; + HDassert(cache_ptr); + HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); + HDassert(cache_ptr->slist_ptr); + +#if H5C_DO_SANITY_CHECKS + HDassert(cache_ptr->index_ring_len[H5C_RING_UNDEFINED] == 0); + HDassert(cache_ptr->index_ring_size[H5C_RING_UNDEFINED] == (size_t)0); + HDassert(cache_ptr->clean_index_ring_size[H5C_RING_UNDEFINED] == (size_t)0); + HDassert(cache_ptr->dirty_index_ring_size[H5C_RING_UNDEFINED] == (size_t)0); + HDassert(cache_ptr->slist_ring_len[H5C_RING_UNDEFINED] == 0); + HDassert(cache_ptr->slist_ring_size[H5C_RING_UNDEFINED] == (size_t)0); + + for(i = H5C_RING_USER; i < H5C_RING_NTYPES; i++) { + index_len += cache_ptr->index_ring_len[i]; + index_size += cache_ptr->index_ring_size[i]; + clean_index_size += cache_ptr->clean_index_ring_size[i]; + dirty_index_size += cache_ptr->dirty_index_ring_size[i]; + + slist_len += cache_ptr->slist_ring_len[i]; + slist_size += cache_ptr->slist_ring_size[i]; + } /* end for */ + + HDassert(cache_ptr->index_len == index_len); + HDassert(cache_ptr->index_size == index_size); + HDassert(cache_ptr->clean_index_size == clean_index_size); + HDassert(cache_ptr->dirty_index_size == dirty_index_size); + HDassert(cache_ptr->slist_len == slist_len); + HDassert(cache_ptr->slist_size == slist_size); +#endif /* H5C_DO_SANITY_CHECKS */ #if H5C_DO_EXTREME_SANITY_CHECKS if((H5C_validate_protected_entry_list(cache_ptr) < 0) || @@ -1073,13 +1117,6 @@ H5C_flush_cache(H5F_t *f, hid_t dxpl_id, unsigned flags) ignore_protected = ( (flags & H5C__FLUSH_IGNORE_PROTECTED_FLAG) != 0 ); destroy = ( (flags & H5C__FLUSH_INVALIDATE_FLAG) != 0 ); - - /* note that flush_marked_entries is set to FALSE if destroy is TRUE */ - flush_marked_entries = ( ( (flags & H5C__FLUSH_MARKED_ENTRIES_FLAG) != 0 ) - && - ( ! destroy ) - ); - HDassert( ! ( destroy && ignore_protected ) ); HDassert( ! ( cache_ptr->flush_in_progress ) ); @@ -1088,337 +1125,18 @@ H5C_flush_cache(H5F_t *f, hid_t dxpl_id, unsigned flags) if(destroy) { if(H5C_flush_invalidate_cache(f, dxpl_id, flags) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "flush invalidate failed.") - } else { - /* When we are only flushing marked entries, the slist will usually - * still contain entries when we have flushed everything we should. - * Thus we track whether we have flushed any entries in the last - * pass, and terminate if we haven't. - */ - - flushed_entries_last_pass = TRUE; - - /* set the cache_ptr->slist_change_in_pre_serialize and - * cache_ptr->slist_change_in_serialize to false. - * - * These flags are set to TRUE by H5C__flush_single_entry if the - * slist is modified by a pre_serialize or serialize call respectively. - * H5C_flush_cache uses these flags to detect any modifications - * to the slist that might corrupt the scan of the slist -- and - * restart the scan in this event. + } /* end if */ + else { + /* flush each ring, starting from the outermost ring and + * working inward. */ - cache_ptr->slist_change_in_pre_serialize = FALSE; - cache_ptr->slist_change_in_serialize = FALSE; - - while ( ( passes < H5C__MAX_PASSES_ON_FLUSH ) && - ( cache_ptr->slist_len != 0 ) && - ( protected_entries == 0 ) && - ( flushed_entries_last_pass ) ) - { - unsigned curr_flush_dep_height = 0; - unsigned flush_dep_passes = 0; - - flushed_entries_last_pass = FALSE; - - /* Loop over all flush dependency heights of entries */ - while((curr_flush_dep_height <= H5C__NUM_FLUSH_DEP_HEIGHTS) && - (cache_ptr->slist_len != 0) && - (flush_dep_passes < H5C__MAX_PASSES_ON_FLUSH) ) - { - hbool_t flushed_during_dep_loop = FALSE; - -#if H5C_DO_SANITY_CHECKS - /* For sanity checking, try to verify that the skip list has - * the expected size and number of entries at the end of each - * internal while loop (see below). - * - * Doing this get a bit tricky, as depending on flags, we may - * or may not flush all the entries in the slist. - * - * To make things more entertaining, with the advent of the - * fractal heap, the entry serialize callback can cause entries - * to be dirtied, resized, and/or moved. Also, the - * pre_serialize callback can result in an entry being - * removed from the cache via the take ownership flag. - * - * To deal with this, we first make note of the initial - * skip list length and size: - */ - initial_slist_len = cache_ptr->slist_len; - initial_slist_size = cache_ptr->slist_size; - - /* We then zero counters that we use to track the number - * and total size of entries flushed: - */ - flushed_entries_count = 0; - flushed_entries_size = 0; - - /* As mentioned above, there is the possibility that - * entries will be dirtied, resized, flushed, or removed - * from the cache via the take ownership flag during - * our pass through the skip list. To capture the number - * of entries added, and the skip list size delta, - * zero the slist_len_increase and slist_size_increase of - * the cache's instance of H5C_t. These fields will be - * updated elsewhere to account for slist insertions and/or - * dirty entry size changes. - */ - cache_ptr->slist_len_increase = 0; - cache_ptr->slist_size_increase = 0; - - /* at the end of the loop, use these values to compute the - * expected slist length and size and compare this with the - * value recorded in the cache's instance of H5C_t. - */ -#endif /* H5C_DO_SANITY_CHECKS */ - - restart_slist_scan = TRUE; - - while ( ( restart_slist_scan ) || ( node_ptr != NULL ) ) - { - if ( restart_slist_scan ) - { - restart_slist_scan = FALSE; - - /* Start at beginning of skip list */ - node_ptr = H5SL_first(cache_ptr->slist_ptr); - - if ( node_ptr == NULL ) - { - /* the slist is empty -- break out of inner loop */ - break; - } - HDassert( node_ptr != NULL ); - - /* Get cache entry for this node */ - next_entry_ptr = - (H5C_cache_entry_t *)H5SL_item(node_ptr); - - if(NULL == next_entry_ptr) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ - "next_entry_ptr == NULL ?!?!") - - HDassert( next_entry_ptr->magic == \ - H5C__H5C_CACHE_ENTRY_T_MAGIC ); - HDassert( next_entry_ptr->is_dirty ); - HDassert( next_entry_ptr->in_slist ); - } - - entry_ptr = next_entry_ptr; - - /* With the advent of the fractal heap, the free space - * manager, and the version 3 cache, it is possible - * that the pre-serialize or serialize callback will - * dirty, resize, or take ownership of other entries - * in the cache. - * - * To deal with this, I have inserted code to detect any - * change in the skip list not directly under the control - * of this function. If such modifications are detected, - * we must re-start the scan of the skip list to avoid - * the possibility that the target of the next_entry_ptr - * may have been flushed or deleted from the cache. - * - * To verify that all such possibilities have been dealt - * with, we do a bit of extra sanity checking on - * entry_ptr. - */ - HDassert(entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); - HDassert(entry_ptr->in_slist); - HDassert(entry_ptr->is_dirty); - - /* increment node pointer now, before we delete its target - * from the slist. - */ - node_ptr = H5SL_next(node_ptr); - - if ( node_ptr != NULL ) { - next_entry_ptr = (H5C_cache_entry_t *)H5SL_item(node_ptr); - if ( NULL == next_entry_ptr ) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "next_entry_ptr == NULL ?!?!") - HDassert( next_entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC ); - HDassert( next_entry_ptr->is_dirty ); - HDassert( next_entry_ptr->in_slist ); - HDassert( entry_ptr != next_entry_ptr ); - } else { - next_entry_ptr = NULL; - } - - HDassert( entry_ptr != NULL ); - HDassert( entry_ptr->in_slist ); - - if ( ( ( ! flush_marked_entries ) || - ( entry_ptr->flush_marker ) ) && - ( ( ! entry_ptr->flush_me_last ) || - ( ( entry_ptr->flush_me_last ) && - ( cache_ptr->num_last_entries >= - cache_ptr->slist_len ) ) ) ) { - - if ( entry_ptr->is_protected ) { - - /* we probably have major problems -- but lets - * flush everything we can before we decide - * whether to flag an error. - */ - tried_to_flush_protected_entry = TRUE; - protected_entries++; - - } else if ( entry_ptr->is_pinned ) { - /* Test to see if we are can flush the entry now. - * If we can, go ahead and flush. Note that we - * aren't trying to do a destroy here, so that - * is not an issue. - */ - if(entry_ptr->flush_dep_height == curr_flush_dep_height ) { -#if H5C_DO_SANITY_CHECKS - flushed_entries_count++; - flushed_entries_size += (int64_t)entry_ptr->size; - entry_size_change = 0; -#endif /* H5C_DO_SANITY_CHECKS */ - if(H5C__flush_single_entry(f, dxpl_id, entry_ptr, flags, entry_size_change_ptr) < 0 ) - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "dirty pinned entry flush failed.") - -#if H5C_DO_SANITY_CHECKS - /* it is possible that the entry size changed - * during flush -- update flushed_entries_size - * to account for this. - */ - flushed_entries_size += entry_size_change; -#endif /* H5C_DO_SANITY_CHECKS */ - - flushed_during_dep_loop = TRUE; - - if ((cache_ptr->slist_change_in_serialize) || - (cache_ptr->slist_change_in_pre_serialize)) - { - /* The slist has been modified by something - * other than the simple removal of the - * of the flushed entry after the flush. - * - * This has the potential to corrupt the - * scan through the slist, so restart it. - */ - restart_slist_scan = TRUE; - cache_ptr->slist_change_in_pre_serialize - = FALSE; - cache_ptr->slist_change_in_serialize - = FALSE; - - H5C__UPDATE_STATS_FOR_SLIST_SCAN_RESTART(cache_ptr) - } - } /* end if */ - else if(entry_ptr->flush_dep_height < curr_flush_dep_height) - /* This shouldn't happen -- if it does, just scream and die. */ - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "dirty entry below current flush dep. height.") - } /* end if */ - else { - /* Test to see if we are can flush the entry now. - * If we can, go ahead and flush. Note that we - * aren't trying to do a destroy here, so that - * is not an issue. - */ - if(entry_ptr->flush_dep_height == curr_flush_dep_height ) { -#if H5C_DO_SANITY_CHECKS - flushed_entries_count++; - flushed_entries_size += (int64_t)entry_ptr->size; - entry_size_change = 0; -#endif /* H5C_DO_SANITY_CHECKS */ - if(H5C__flush_single_entry(f, dxpl_id, entry_ptr, flags, entry_size_change_ptr) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't flush entry.") - -#if H5C_DO_SANITY_CHECKS - /* it is possible that the entry size changed - * during flush -- update flushed_entries_size - * to account for this. - */ - flushed_entries_size += entry_size_change; -#endif /* H5C_DO_SANITY_CHECKS */ - - flushed_during_dep_loop = TRUE; - - if ((cache_ptr->slist_change_in_serialize) || - (cache_ptr->slist_change_in_pre_serialize)) - { - /* The slist has been modified by something - * other than the simple removal of the - * of the flushed entry after the flush. - * - * This has the potential to corrupt the - * scan through the slist, so restart it. - */ - restart_slist_scan = TRUE; - cache_ptr->slist_change_in_pre_serialize - = FALSE; - cache_ptr->slist_change_in_serialize - = FALSE; - - H5C__UPDATE_STATS_FOR_SLIST_SCAN_RESTART(cache_ptr) - } - } /* end if */ - else if(entry_ptr->flush_dep_height < curr_flush_dep_height) - /* This shouldn't happen -- if it does, just scream and die. */ - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "dirty entry below current flush dep. height.") - } /* end else */ - } /* end if */ - } /* while ( ( restart_slist_scan ) || ( node_ptr != NULL ) ) */ - - /* Check for incrementing flush dependency height */ - if(flushed_during_dep_loop) { - /* If we flushed an entry at this flush dependency height - * start over at the bottom level of the flush dependencies - */ - curr_flush_dep_height = 0; - - /* Make certain we don't get stuck in an infinite loop */ - flush_dep_passes++; - - /* Set flag for outer loop */ - flushed_entries_last_pass = TRUE; - } /* end if */ - else - curr_flush_dep_height++; - - } /* while ( curr_flush_dep_height <= H5C__NUM_FLUSH_DEP_HEIGHTS) */ - - passes++; - -#if H5C_DO_SANITY_CHECKS - /* Verify that the slist size and length are as expected. */ - - HDassert( (initial_slist_len + cache_ptr->slist_len_increase - - flushed_entries_count) == cache_ptr->slist_len ); - HDassert( (size_t)((int64_t)initial_slist_size + - cache_ptr->slist_size_increase - - flushed_entries_size) == cache_ptr->slist_size ); -#endif /* H5C_DO_SANITY_CHECKS */ - - } /* while */ - - HDassert( protected_entries <= cache_ptr->pl_len ); - - if ( ( ( cache_ptr->pl_len > 0 ) && ( !ignore_protected ) ) - || - ( tried_to_flush_protected_entry ) ) { - - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, \ - "cache has protected items") - } - - if ( ( cache_ptr->slist_len != 0 ) && - ( passes >= H5C__MAX_PASSES_ON_FLUSH ) ) { - - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, \ - "flush pass limit exceeded.") - } - -#if H5C_DO_SANITY_CHECKS - if ( ! flush_marked_entries ) { - - HDassert( cache_ptr->slist_len == 0 ); - HDassert( cache_ptr->slist_size == 0 ); - } -#endif /* H5C_DO_SANITY_CHECKS */ - - } + ring = H5C_RING_USER; + while(ring < H5C_RING_NTYPES) { + if(H5C_flush_ring(f, dxpl_id, ring, flags) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "flush ring failed.") + ring++; + } /* end while */ + } /* end else */ done: cache_ptr->flush_in_progress = FALSE; @@ -2031,7 +1749,8 @@ H5C_insert_entry(H5F_t * f, unsigned int flags) { H5C_t * cache_ptr; - herr_t result; + H5P_genplist_t *dxpl; + H5AC_ring_t ring = H5C_RING_UNDEFINED; hbool_t insert_pinned; hbool_t flush_last; #ifdef H5_HAVE_PARALLEL @@ -2078,6 +1797,14 @@ H5C_insert_entry(H5F_t * f, flush_collectively = ( (flags & H5C__FLUSH_COLLECTIVELY_FLAG) != 0 ); #endif /* H5_HAVE_PARALLEL */ + /* Get the dataset transfer property list */ + if(NULL == (dxpl = (H5P_genplist_t *)H5I_object_verify(dxpl_id, H5I_GENPROP_LST))) + HGOTO_ERROR(H5E_CACHE, H5E_BADTYPE, FAIL, "not a property list") + + /* Get the ring type from the DXPL */ + if((H5P_get(dxpl, H5AC_RING_NAME, &ring)) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, FAIL, "unable to query ring value") + entry_ptr = (H5C_cache_entry_t *)thing; /* verify that the new entry isn't already in the hash table -- scream @@ -2155,6 +1882,8 @@ H5C_insert_entry(H5F_t * f, entry_ptr->flush_in_progress = FALSE; entry_ptr->destroy_in_progress = FALSE; + entry_ptr->ring = ring; + /* Initialize flush dependency height fields */ entry_ptr->flush_dep_parent = NULL; for(u = 0; u < H5C__NUM_FLUSH_DEP_HEIGHTS; u++) @@ -2175,13 +1904,8 @@ H5C_insert_entry(H5F_t * f, if ( ( cache_ptr->flash_size_increase_possible ) && ( entry_ptr->size > cache_ptr->flash_size_increase_threshold ) ) { - result = H5C__flash_increase_cache_size(cache_ptr, 0, entry_ptr->size); - - if ( result < 0 ) { - - HGOTO_ERROR(H5E_CACHE, H5E_CANTINS, FAIL, \ - "H5C__flash_increase_cache_size failed.") - } + if(H5C__flash_increase_cache_size(cache_ptr, 0, entry_ptr->size) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTINS, FAIL, "H5C__flash_increase_cache_size failed.") } if(cache_ptr->index_size >= cache_ptr->max_cache_size) @@ -2198,33 +1922,20 @@ H5C_insert_entry(H5F_t * f, size_t space_needed; - if ( empty_space <= entry_ptr->size ) { - + if(empty_space <= entry_ptr->size) cache_ptr->cache_full = TRUE; - } - - if ( cache_ptr->check_write_permitted != NULL ) { - - result = (cache_ptr->check_write_permitted)(f, &write_permitted); - - if ( result < 0 ) { - - HGOTO_ERROR(H5E_CACHE, H5E_CANTINS, FAIL, \ - "Can't get write_permitted") - } - } else { + if(cache_ptr->check_write_permitted != NULL) { + if((cache_ptr->check_write_permitted)(f, &write_permitted) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTINS, FAIL, "Can't get write_permitted") + } /* end if */ + else write_permitted = cache_ptr->write_permitted; - } - - HDassert( entry_ptr->size <= H5C_MAX_ENTRY_SIZE ); + HDassert(entry_ptr->size <= H5C_MAX_ENTRY_SIZE); space_needed = entry_ptr->size; - - if ( space_needed > cache_ptr->max_cache_size ) { - + if(space_needed > cache_ptr->max_cache_size) space_needed = cache_ptr->max_cache_size; - } /* Note that space_needed is just the amount of space that * needed to insert the new entry without exceeding the cache @@ -2251,16 +1962,8 @@ H5C_insert_entry(H5F_t * f, * no point in worrying about the third. */ - result = H5C_make_space_in_cache(f, - dxpl_id, - space_needed, - write_permitted); - - if ( result < 0 ) { - - HGOTO_ERROR(H5E_CACHE, H5E_CANTINS, FAIL, \ - "H5C_make_space_in_cache failed.") - } + if(H5C_make_space_in_cache(f, dxpl_id, space_needed, write_permitted) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTINS, FAIL, "H5C_make_space_in_cache failed.") } H5C__INSERT_IN_INDEX(cache_ptr, entry_ptr, FAIL) @@ -2882,6 +2585,8 @@ H5C_protect(H5F_t * f, unsigned flags) { H5C_t * cache_ptr; + H5P_genplist_t *dxpl; + H5AC_ring_t ring = H5C_RING_UNDEFINED; hbool_t hit; hbool_t have_write_permitted = FALSE; hbool_t read_only = FALSE; @@ -2890,7 +2595,6 @@ H5C_protect(H5F_t * f, hbool_t flush_collectively; #endif /* H5_HAVE_PARALLEL */ hbool_t write_permitted; - herr_t result; size_t empty_space; void * thing; H5C_cache_entry_t * entry_ptr; @@ -2925,10 +2629,20 @@ H5C_protect(H5F_t * f, flush_collectively = ( (flags & H5C__FLUSH_COLLECTIVELY_FLAG) != 0 ); #endif /* H5_HAVE_PARALLEL */ + /* Get the dataset transfer property list */ + if(NULL == (dxpl = (H5P_genplist_t *)H5I_object_verify(dxpl_id, H5I_GENPROP_LST))) + HGOTO_ERROR(H5E_CACHE, H5E_BADTYPE, NULL, "not a property list") + + /* Get the ring type from the DXPL */ + if((H5P_get(dxpl, H5AC_RING_NAME, &ring)) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, NULL, "unable to query ring value") + /* first check to see if the target is in cache */ H5C__SEARCH_INDEX(cache_ptr, addr, entry_ptr, NULL) if ( entry_ptr != NULL ) { + if(entry_ptr->ring != ring) + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, NULL, "ring type mismatch occured for cache entry\n"); /* Check for trying to load the wrong type of entry from an address */ if(entry_ptr->type != type) @@ -2936,7 +2650,6 @@ H5C_protect(H5F_t * f, #if H5C_DO_TAGGING_SANITY_CHECKS { - H5P_genplist_t *dxpl; /* dataset transfer property list */ haddr_t tag = HADDR_UNDEF; /* The entry is already in the cache, but make sure that the tag value @@ -2945,21 +2658,15 @@ H5C_protect(H5F_t * f, and it would have received a legal tag value after getting loaded from disk. */ - /* Get the dataset transfer property list */ - if(NULL == (dxpl = (H5P_genplist_t *)H5I_object_verify(dxpl_id, H5I_GENPROP_LST))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a property list"); - /* Get the tag from the DXPL */ - if( (H5P_get(dxpl, "H5AC_metadata_tag", &tag)) < 0 ) + if((H5P_get(dxpl, "H5AC_metadata_tag", &tag)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "unable to query property value"); /* Verify tag value */ - if (cache_ptr->ignore_tags != TRUE) { - + if(cache_ptr->ignore_tags != TRUE) { /* Verify legal tag value */ - if ( (H5C_verify_tag(entry_ptr->type->id, tag)) < 0 ) + if((H5C_verify_tag(entry_ptr->type->id, tag)) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, NULL, "tag verification failed"); - } /* end if */ } #endif @@ -2982,6 +2689,8 @@ H5C_protect(H5F_t * f, entry_ptr = (H5C_cache_entry_t *)thing; + entry_ptr->ring = ring; + /* Apply tag to newly protected entry */ if(H5C_tag_entry(cache_ptr, entry_ptr, dxpl_id) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTTAG, NULL, "Cannot tag metadata entry") @@ -2992,14 +2701,8 @@ H5C_protect(H5F_t * f, if ( ( cache_ptr->flash_size_increase_possible ) && ( entry_ptr->size > cache_ptr->flash_size_increase_threshold ) ) { - result = H5C__flash_increase_cache_size(cache_ptr, 0, - entry_ptr->size); - - if ( result < 0 ) { - - HGOTO_ERROR(H5E_CACHE, H5E_CANTPROTECT, NULL, \ - "H5C__flash_increase_cache_size failed.") - } + if(H5C__flash_increase_cache_size(cache_ptr, 0, entry_ptr->size) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTPROTECT, NULL, "H5C__flash_increase_cache_size failed.") } if(cache_ptr->index_size >= cache_ptr->max_cache_size) @@ -3025,20 +2728,11 @@ H5C_protect(H5F_t * f, if(empty_space <= entry_ptr->size) cache_ptr->cache_full = TRUE; - if ( cache_ptr->check_write_permitted != NULL ) { - - result = (cache_ptr->check_write_permitted)(f, &write_permitted); - - if ( result < 0 ) { - - HGOTO_ERROR(H5E_CACHE, H5E_CANTPROTECT, NULL, \ - "Can't get write_permitted 1") - - } else { - + if(cache_ptr->check_write_permitted != NULL) { + if((cache_ptr->check_write_permitted)(f, &write_permitted) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTPROTECT, NULL, "Can't get write_permitted 1") + else have_write_permitted = TRUE; - - } } else { write_permitted = cache_ptr->write_permitted; @@ -3085,16 +2779,8 @@ H5C_protect(H5F_t * f, * see no point in worrying about the fourth. */ - result = H5C_make_space_in_cache(f, - dxpl_id, - space_needed, - write_permitted); - - if ( result < 0 ) { - - HGOTO_ERROR(H5E_CACHE, H5E_CANTPROTECT, NULL, \ - "H5C_make_space_in_cache failed 1.") - } + if(H5C_make_space_in_cache(f, dxpl_id, space_needed, write_permitted) < 0 ) + HGOTO_ERROR(H5E_CACHE, H5E_CANTPROTECT, NULL, "H5C_make_space_in_cache failed 1.") } /* Insert the entry in the hash table. It can't be dirty yet, so @@ -3188,19 +2874,10 @@ H5C_protect(H5F_t * f, if ( ! have_write_permitted ) { if ( cache_ptr->check_write_permitted != NULL ) { - - result = (cache_ptr->check_write_permitted)(f, &write_permitted); - - if ( result < 0 ) { - - HGOTO_ERROR(H5E_CACHE, H5E_CANTPROTECT, NULL, \ - "Can't get write_permitted 2") - - } else { - + if((cache_ptr->check_write_permitted)(f, &write_permitted) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTPROTECT, NULL, "Can't get write_permitted 2") + else have_write_permitted = TRUE; - - } } else { write_permitted = cache_ptr->write_permitted; @@ -3214,14 +2891,8 @@ H5C_protect(H5F_t * f, ( cache_ptr->cache_accesses >= (cache_ptr->resize_ctl).epoch_length ) ) { - result = H5C__auto_adjust_cache_size(f, - dxpl_id, - write_permitted); - if ( result != SUCCEED ) { - - HGOTO_ERROR(H5E_CACHE, H5E_CANTPROTECT, NULL, \ - "Cache auto-resize failed.") - } + if(H5C__auto_adjust_cache_size(f, dxpl_id, write_permitted) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTPROTECT, NULL, "Cache auto-resize failed.") } if ( cache_ptr->size_decreased ) { @@ -3250,16 +2921,8 @@ H5C_protect(H5F_t * f, if(cache_ptr->index_size > cache_ptr->max_cache_size) cache_ptr->cache_full = TRUE; - result = H5C_make_space_in_cache(f, - dxpl_id, - (size_t)0, - write_permitted); - - if ( result < 0 ) { - - HGOTO_ERROR(H5E_CACHE, H5E_CANTPROTECT, NULL, \ - "H5C_make_space_in_cache failed 2.") - } + if(H5C_make_space_in_cache(f, dxpl_id, (size_t)0, write_permitted) < 0 ) + HGOTO_ERROR(H5E_CACHE, H5E_CANTPROTECT, NULL, "H5C_make_space_in_cache failed 2.") } } } @@ -5380,6 +5043,7 @@ H5C_create_flush_dependency(void * parent_thing, void * child_thing) HDassert(H5F_addr_defined(child_entry->addr)); HDassert(child_entry->flush_dep_height <= H5C__NUM_FLUSH_DEP_HEIGHTS); cache_ptr = parent_entry->cache_ptr; + HDassert(parent_entry->ring == child_entry->ring); HDassert(cache_ptr); HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); HDassert(cache_ptr == child_entry->cache_ptr); @@ -6846,61 +6510,13 @@ done: * Programmer: John Mainzer * 3/24/065 * - * Changes: Modified function to test for slist chamges in - * pre_serialize and serialize callbacks, and re-start - * scans through the slist when such changes occur. - * - * This has been a potential problem for some time, - * and there has been code in this function to deal - * with elements of this issue. However the shift - * to the V3 cache in combination with the activities - * of some of the cache clients (in particular the - * free space manager and the fractal heap) have - * made this re-work necessary in H5C_flush_cache. - * - * At present, this issue doesn't seem to be causing problems - * in H5C_flush_invalidate_cache(). However, it seems - * prudent to port the H5C_flush_cache changes to this - * function as well. - * - * JRM -- 12/14/14 - * - * Added code to track entry size change during flush single - * entry. This didn't used to be a problem, as the entry - * was largely removed from the cache data structures before - * the flush proper. However, re-entrant calls to the cache - * in the parallel case required a re-factoring of the - * H5C__flush_single_entry() function to keep entries fully - * in the cache until after the pre-serialize and serialize - * calls. - * JRM -- 12/25/14 - * *------------------------------------------------------------------------- */ static herr_t H5C_flush_invalidate_cache(const H5F_t * f, hid_t dxpl_id, unsigned flags) { H5C_t * cache_ptr; - hbool_t restart_slist_scan; - int32_t protected_entries = 0; - int32_t i; - int32_t cur_pel_len; - int32_t old_pel_len; - int32_t passes = 0; - unsigned cooked_flags; - H5SL_node_t * node_ptr = NULL; - H5C_cache_entry_t * entry_ptr = NULL; - H5C_cache_entry_t * next_entry_ptr = NULL; -#if H5C_DO_SANITY_CHECKS - int64_t flushed_slist_len = 0; - int64_t initial_slist_len = 0; - int64_t flushed_slist_size = 0; - size_t initial_slist_size = 0; - int64_t entry_size_change; - int64_t * entry_size_change_ptr = &entry_size_change; -#else /* H5C_DO_SANITY_CHECKS */ - int64_t * entry_size_change_ptr = NULL; -#endif /* H5C_DO_SANITY_CHECKS */ + H5C_ring_t ring; herr_t ret_value = SUCCEED; FUNC_ENTER_NOAPI(FAIL) @@ -6912,22 +6528,163 @@ H5C_flush_invalidate_cache(const H5F_t * f, hid_t dxpl_id, unsigned flags) HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); HDassert(cache_ptr->slist_ptr); - /* Filter out the flags that are not relevant to the flush/invalidate. - * At present, only the H5C__FLUSH_CLEAR_ONLY_FLAG is kept. - */ - cooked_flags = flags & H5C__FLUSH_CLEAR_ONLY_FLAG; +#if H5C_DO_SANITY_CHECKS +{ + int32_t i; + int32_t index_len = 0; + int32_t slist_len = 0; + size_t index_size = (size_t)0; + size_t clean_index_size = (size_t)0; + size_t dirty_index_size = (size_t)0; + size_t slist_size = (size_t)0; + + HDassert(cache_ptr->index_ring_len[H5C_RING_UNDEFINED] == 0); + HDassert(cache_ptr->index_ring_size[H5C_RING_UNDEFINED] == (size_t)0); + HDassert(cache_ptr->clean_index_ring_size[H5C_RING_UNDEFINED] == (size_t)0); + HDassert(cache_ptr->dirty_index_ring_size[H5C_RING_UNDEFINED] == (size_t)0); + HDassert(cache_ptr->slist_ring_len[H5C_RING_UNDEFINED] == 0); + HDassert(cache_ptr->slist_ring_size[H5C_RING_UNDEFINED] == (size_t)0); + + for(i = H5C_RING_USER; i < H5C_RING_NTYPES; i++) { + index_len += cache_ptr->index_ring_len[i]; + index_size += cache_ptr->index_ring_size[i]; + clean_index_size += cache_ptr->clean_index_ring_size[i]; + dirty_index_size += cache_ptr->dirty_index_ring_size[i]; + + slist_len += cache_ptr->slist_ring_len[i]; + slist_size += cache_ptr->slist_ring_size[i]; + } /* end for */ - /* remove ageout markers if present */ - if(cache_ptr->epoch_markers_active > 0) + HDassert(cache_ptr->index_len == index_len); + HDassert(cache_ptr->index_size == index_size); + HDassert(cache_ptr->clean_index_size == clean_index_size); + HDassert(cache_ptr->dirty_index_size == dirty_index_size); + HDassert(cache_ptr->slist_len == slist_len); + HDassert(cache_ptr->slist_size == slist_size); +} +#endif /* H5C_DO_SANITY_CHECKS */ + + /* remove ageout markers if present */ + if(cache_ptr->epoch_markers_active > 0) if(H5C__autoadjust__ageout__remove_all_markers(cache_ptr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "error removing all epoch markers.") + /* flush invalidate each ring, starting from the outermost ring and + * working inward. + */ + ring = H5C_RING_USER; + while(ring < H5C_RING_NTYPES) { + if(H5C_flush_invalidate_ring(f, dxpl_id, ring, flags) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "flush invalidate ring failed.") + ring++; + } /* end while */ + + /* Invariants, after destroying all entries in the hash table */ + HDassert(cache_ptr->index_size == 0); + HDassert(cache_ptr->clean_index_size == 0); + HDassert(cache_ptr->dirty_index_size == 0); + HDassert(cache_ptr->slist_len == 0); + HDassert(cache_ptr->slist_size == 0); + HDassert(cache_ptr->pel_len == 0); + HDassert(cache_ptr->pel_size == 0); + HDassert(cache_ptr->pl_len == 0); + HDassert(cache_ptr->pl_size == 0); + HDassert(cache_ptr->LRU_list_len == 0); + HDassert(cache_ptr->LRU_list_size == 0); + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* H5C_flush_invalidate_cache() */ + + +/*------------------------------------------------------------------------- + * Function: H5C_flush_invalidate_ring + * + * Purpose: Flush and destroy the entries contained in the target + * cache and ring. + * + * If the ring contains protected entries, the function will + * fail, as protected entries cannot be either flushed or + * destroyed. However all unprotected entries should be + * flushed and destroyed before the function returns failure. + * + * While pinned entries can usually be flushed, they cannot + * be destroyed. However, they should be unpinned when all + * the entries that reference them have been destroyed (thus + * reduding the pinned entry's reference count to 0, allowing + * it to be unpinned). + * + * If pinned entries are present, the function makes repeated + * passes through the cache, flushing all dirty entries + * (including the pinned dirty entries where permitted) and + * destroying all unpinned entries. This process is repeated + * until either the cache is empty, or the number of pinned + * entries stops decreasing on each pass. + * + * If flush dependencies appear in the target ring, the + * function makes repeated passes through the cache flushing + * entries in flush dependency order. + * + * Return: Non-negative on success/Negative on failure or if there was + * a request to flush all items and something was protected. + * + * Programmer: John Mainzer + * 9/1/15 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5C_flush_invalidate_ring(const H5F_t * f, hid_t dxpl_id, H5C_ring_t ring, + unsigned flags) +{ + H5C_t * cache_ptr; + hbool_t restart_slist_scan; + int32_t protected_entries = 0; + int32_t i; + int32_t cur_ring_pel_len; + int32_t old_ring_pel_len; + int32_t passes = 0; + unsigned cooked_flags; + H5SL_node_t * node_ptr = NULL; + H5C_cache_entry_t * entry_ptr = NULL; + H5C_cache_entry_t * next_entry_ptr = NULL; +#if H5C_DO_SANITY_CHECKS + int64_t flushed_slist_len = 0; + int64_t initial_slist_len = 0; + int64_t flushed_slist_size = 0; + size_t initial_slist_size = 0; + int64_t entry_size_change; + int64_t * entry_size_change_ptr = &entry_size_change; +#else /* H5C_DO_SANITY_CHECKS */ + int64_t * entry_size_change_ptr = NULL; +#endif /* H5C_DO_SANITY_CHECKS */ + herr_t ret_value = SUCCEED; + + FUNC_ENTER_NOAPI(FAIL) + + HDassert(f); + HDassert(f->shared); + cache_ptr = f->shared->cache; + HDassert(cache_ptr); + HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); + HDassert(cache_ptr->slist_ptr); + HDassert(ring > H5C_RING_UNDEFINED); + HDassert(ring < H5C_RING_NTYPES); + + HDassert(cache_ptr->epoch_markers_active == 0); + + /* Filter out the flags that are not relevant to the flush/invalidate. + * At present, only the H5C__FLUSH_CLEAR_ONLY_FLAG is kept. + */ + cooked_flags = flags & H5C__FLUSH_CLEAR_ONLY_FLAG; + + /* The flush proceedure here is a bit strange. * * In the outer while loop we make at least one pass through the - * cache, and then repeat until either all the pinned entries - * unpin themselves, or until the number of pinned entries stops - * declining. In this later case, we scream and die. + * cache, and then repeat until either all the pinned entries in + * the ring unpin themselves, or until the number of pinned entries + * in the ring stops declining. In this later case, we scream and die. * * Since the fractal heap can dirty, resize, and/or move entries * in is flush callback, it is possible that the cache will still @@ -6953,19 +6710,27 @@ H5C_flush_invalidate_cache(const H5F_t * f, hid_t dxpl_id, unsigned flags) * to increasing address order, but there are no guarantees. */ - cur_pel_len = cache_ptr->pel_len; - old_pel_len = cache_ptr->pel_len; + /* compute the number of pinned entries in this ring */ + entry_ptr = cache_ptr->pel_head_ptr; + cur_ring_pel_len = 0; + while(entry_ptr != NULL) { + HDassert(entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); + HDassert(entry_ptr->ring >= ring); + if(entry_ptr->ring == ring) + cur_ring_pel_len++; - while ( cache_ptr->index_len > 0 ) - { + entry_ptr = entry_ptr->next; + } /* end while */ + + old_ring_pel_len = cur_ring_pel_len; + while(cache_ptr->index_ring_len[ring] > 0) { unsigned curr_flush_dep_height = 0; unsigned flush_dep_passes = 0; /* Loop over all flush dependency heights of entries */ while((curr_flush_dep_height <= H5C__NUM_FLUSH_DEP_HEIGHTS) && - (cache_ptr->index_len > 0 ) && - (flush_dep_passes < H5C__MAX_PASSES_ON_FLUSH) ) - { + (cache_ptr->index_ring_len[ring] > 0) && + (flush_dep_passes < H5C__MAX_PASSES_ON_FLUSH)) { hbool_t flushed_during_dep_loop = FALSE; /* first, try to flush-destroy any dirty entries. Do this by @@ -7039,6 +6804,7 @@ H5C_flush_invalidate_cache(const H5F_t * f, hid_t dxpl_id, unsigned flags) HDassert(next_entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); HDassert(next_entry_ptr->is_dirty); HDassert(next_entry_ptr->in_slist); + HDassert(next_entry_ptr->ring >= ring); } /* end if */ entry_ptr = next_entry_ptr; @@ -7057,6 +6823,7 @@ H5C_flush_invalidate_cache(const H5F_t * f, hid_t dxpl_id, unsigned flags) HDassert(entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); HDassert(entry_ptr->in_slist); HDassert(entry_ptr->is_dirty); + HDassert(entry_ptr->ring >= ring); /* increment node pointer now, before we delete its target * from the slist. @@ -7069,6 +6836,7 @@ H5C_flush_invalidate_cache(const H5F_t * f, hid_t dxpl_id, unsigned flags) HDassert(next_entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); HDassert(next_entry_ptr->is_dirty); HDassert(next_entry_ptr->in_slist); + HDassert(next_entry_ptr->ring >= ring); HDassert(entry_ptr != next_entry_ptr); } /* end if */ else @@ -7087,10 +6855,10 @@ H5C_flush_invalidate_cache(const H5F_t * f, hid_t dxpl_id, unsigned flags) HDassert(entry_ptr != NULL); HDassert(entry_ptr->in_slist); - if ( ( ! entry_ptr->flush_me_last ) || - ( ( entry_ptr->flush_me_last ) && - ( cache_ptr->num_last_entries >= - cache_ptr->slist_len ) ) ) { + if(((!entry_ptr->flush_me_last) || + ((entry_ptr->flush_me_last) && + (cache_ptr->num_last_entries >= cache_ptr->slist_len))) && + (entry_ptr->ring == ring)) { if(entry_ptr->is_protected) { /* we have major problems -- but lets flush * everything we can before we flag an error. @@ -7233,15 +7001,16 @@ H5C_flush_invalidate_cache(const H5F_t * f, hid_t dxpl_id, unsigned flags) while(next_entry_ptr != NULL) { entry_ptr = next_entry_ptr; HDassert(entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); + HDassert(entry_ptr->ring >= ring); next_entry_ptr = entry_ptr->ht_next; HDassert((next_entry_ptr == NULL) || (next_entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC)); - if ( ( ! entry_ptr->flush_me_last ) || - ( ( entry_ptr->flush_me_last ) && - ( cache_ptr->num_last_entries >= - cache_ptr->slist_len ) ) ) { + if(((!entry_ptr->flush_me_last) || + ((entry_ptr->flush_me_last) && + (cache_ptr->num_last_entries >= cache_ptr->slist_len))) && + (entry_ptr->ring == ring)) { if(entry_ptr->is_protected) { /* we have major problems -- but lets flush and @@ -7284,7 +7053,9 @@ H5C_flush_invalidate_cache(const H5F_t * f, hid_t dxpl_id, unsigned flags) entry_was_dirty = entry_ptr->is_dirty; - if(H5C__flush_single_entry(f, dxpl_id, entry_ptr, (cooked_flags | H5C__FLUSH_INVALIDATE_FLAG | H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG), NULL) < 0) + if(H5C__flush_single_entry(f, dxpl_id, entry_ptr, + (cooked_flags | H5C__FLUSH_INVALIDATE_FLAG | H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG), + NULL) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Entry flush destroy failed.") if(entry_was_dirty) { @@ -7350,16 +7121,25 @@ H5C_flush_invalidate_cache(const H5F_t * f, hid_t dxpl_id, unsigned flags) } /* end while loop over flush dependency heights */ - old_pel_len = cur_pel_len; - cur_pel_len = cache_ptr->pel_len; + old_ring_pel_len = cur_ring_pel_len; + entry_ptr = cache_ptr->pel_head_ptr; + cur_ring_pel_len = 0; + while(entry_ptr != NULL) { + HDassert(entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); + HDassert(entry_ptr->ring >= ring); + + if(entry_ptr->ring == ring) + cur_ring_pel_len++; - if ( ( cur_pel_len > 0 ) && ( cur_pel_len >= old_pel_len ) ) { + entry_ptr = entry_ptr->next; + } /* end while */ - /* The number of pinned entries is positive, and it is not - * declining. Scream and die. + if((cur_ring_pel_len > 0) && (cur_ring_pel_len >= old_ring_pel_len)) { + /* The number of pinned entries in the ring is positive, and + * it is not declining. Scream and die. */ - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Pinned entry count not decreasing, cur_pel_len = %d, old_pel_len = %d", (int)cur_pel_len, (int)old_pel_len) - } else if ( ( cur_pel_len == 0 ) && ( old_pel_len == 0 ) ) { + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Pinned entry count not decreasing, cur_ring_pel_len = %d, old_ring_pel_len = %d, ring = %d", (int)cur_ring_pel_len, (int)old_ring_pel_len, (int)ring) + } else if((cur_ring_pel_len == 0) && (old_ring_pel_len == 0)) { /* increment the pass count */ passes++; } @@ -7371,36 +7151,409 @@ H5C_flush_invalidate_cache(const H5F_t * f, hid_t dxpl_id, unsigned flags) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Maximum passes on flush exceeded.") } /* main while loop */ - /* Invariants, after destroying all entries in the hash table */ - HDassert(cache_ptr->index_size == 0); - HDassert(cache_ptr->clean_index_size == 0); - HDassert(cache_ptr->dirty_index_size == 0); - HDassert(cache_ptr->slist_len == 0); - HDassert(cache_ptr->slist_size == 0); - HDassert(cache_ptr->pel_len == 0); - HDassert(cache_ptr->pel_size == 0); - HDassert(cache_ptr->pl_len == 0); - HDassert(cache_ptr->pl_size == 0); - HDassert(cache_ptr->LRU_list_len == 0); - HDassert(cache_ptr->LRU_list_size == 0); + /* Invariants, after destroying all entries in the ring */ + for(i = (int)H5C_RING_UNDEFINED; i <= (int)ring; i++) { + HDassert(cache_ptr->index_ring_len[i] == 0); + HDassert(cache_ptr->index_ring_size[i] == (size_t)0); + HDassert(cache_ptr->clean_index_ring_size[i] == (size_t)0); + HDassert(cache_ptr->dirty_index_ring_size[i] == (size_t)0); + HDassert(cache_ptr->slist_ring_len[i] == 0); + HDassert(cache_ptr->slist_ring_size[i] == (size_t)0); + } /* end for */ HDassert(protected_entries <= cache_ptr->pl_len); if(protected_entries > 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Cache has protected entries.") + else if(cur_ring_pel_len > 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't unpin all pinned entries in ring.") + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* H5C_flush_invalidate_ring() */ + + +/*------------------------------------------------------------------------- + * Function: H5C_flush_ring + * + * Purpose: Flush the entries contained in the specified cache and + * ring. All entries in rings outside the specified ring + * must have been flushed on entry. + * + * If the cache contains protected entries in the specified + * ring, the function will fail, as protected entries cannot + * be flushed. However all unprotected entries in the target + * ring should be flushed before the function returns failure. + * + * If flush dependencies appear in the target ring, the + * function makes repeated passes through the slist flushing + * entries in flush dependency order. + * + * Return: Non-negative on success/Negative on failure or if there was + * a request to flush all items and something was protected. + * + * Programmer: John Mainzer + * 9/1/15 + * + *------------------------------------------------------------------------- + */ +herr_t +H5C_flush_ring(H5F_t *f, hid_t dxpl_id, H5C_ring_t ring, unsigned flags) +{ + H5C_t * cache_ptr = f->shared->cache; + hbool_t flushed_entries_last_pass; + hbool_t flush_marked_entries; + hbool_t ignore_protected; + hbool_t tried_to_flush_protected_entry = FALSE; + hbool_t restart_slist_scan; + int32_t passes = 0; + int32_t protected_entries = 0; + H5SL_node_t * node_ptr = NULL; + H5C_cache_entry_t * entry_ptr = NULL; + H5C_cache_entry_t * next_entry_ptr = NULL; +#if H5C_DO_SANITY_CHECKS + int64_t flushed_entries_count = 0; + int64_t flushed_entries_size = 0; + int64_t initial_slist_len = 0; + size_t initial_slist_size = 0; + int64_t entry_size_change; + int64_t * entry_size_change_ptr = &entry_size_change; +#else /* H5C_DO_SANITY_CHECKS */ + int64_t * entry_size_change_ptr = NULL; +#endif /* H5C_DO_SANITY_CHECKS */ + int i; + herr_t ret_value = SUCCEED; - else if(cur_pel_len > 0) { + FUNC_ENTER_NOAPI(FAIL) - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't unpin all pinned entries.") + HDassert(cache_ptr); + HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); + HDassert(cache_ptr->slist_ptr); + HDassert((flags & H5C__FLUSH_INVALIDATE_FLAG) == 0); + HDassert(ring > H5C_RING_UNDEFINED); + HDassert(ring < H5C_RING_NTYPES); - } +#if H5C_DO_EXTREME_SANITY_CHECKS + if((H5C_validate_protected_entry_list(cache_ptr) < 0) || + (H5C_validate_pinned_entry_list(cache_ptr) < 0 || + (H5C_validate_lru_list(cache_ptr) < 0)) { + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on entry.\n"); +#endif /* H5C_DO_EXTREME_SANITY_CHECKS */ -done: + ignore_protected = ( (flags & H5C__FLUSH_IGNORE_PROTECTED_FLAG) != 0 ); + flush_marked_entries = ( (flags & H5C__FLUSH_MARKED_ENTRIES_FLAG) != 0 ); - FUNC_LEAVE_NOAPI(ret_value) + if(!flush_marked_entries) + for(i = (int)H5C_RING_UNDEFINED; i < (int)ring; i++) + HDassert(cache_ptr->slist_ring_len[i] == 0); -} /* H5C_flush_invalidate_cache() */ + HDassert(cache_ptr->flush_in_progress); + + /* When we are only flushing marked entries, the slist will usually + * still contain entries when we have flushed everything we should. + * Thus we track whether we have flushed any entries in the last + * pass, and terminate if we haven't. + */ + flushed_entries_last_pass = TRUE; + + /* set the cache_ptr->slist_change_in_pre_serialize and + * cache_ptr->slist_change_in_serialize to false. + * + * These flags are set to TRUE by H5C__flush_single_entry if the + * slist is modified by a pre_serialize or serialize call respectively. + * H5C_flush_cache uses these flags to detect any modifications + * to the slist that might corrupt the scan of the slist -- and + * restart the scan in this event. + */ + cache_ptr->slist_change_in_pre_serialize = FALSE; + cache_ptr->slist_change_in_serialize = FALSE; + + while((passes < H5C__MAX_PASSES_ON_FLUSH) && + (cache_ptr->slist_ring_len[ring] > 0) && + (protected_entries == 0) && + (flushed_entries_last_pass)) { + unsigned curr_flush_dep_height = 0; + unsigned flush_dep_passes = 0; + + flushed_entries_last_pass = FALSE; + + /* Loop over all flush dependency heights of entries */ + while((curr_flush_dep_height <= H5C__NUM_FLUSH_DEP_HEIGHTS) && + (cache_ptr->slist_ring_len[ring] > 0) && + (flush_dep_passes < H5C__MAX_PASSES_ON_FLUSH)) { + hbool_t flushed_during_dep_loop = FALSE; + +#if H5C_DO_SANITY_CHECKS + /* For sanity checking, try to verify that the skip list has + * the expected size and number of entries at the end of each + * internal while loop (see below). + * + * Doing this get a bit tricky, as depending on flags, we may + * or may not flush all the entries in the slist. + * + * To make things more entertaining, with the advent of the + * fractal heap, the entry serialize callback can cause entries + * to be dirtied, resized, and/or moved. Also, the + * pre_serialize callback can result in an entry being + * removed from the cache via the take ownership flag. + * + * To deal with this, we first make note of the initial + * skip list length and size: + */ + initial_slist_len = cache_ptr->slist_len; + initial_slist_size = cache_ptr->slist_size; + + /* We then zero counters that we use to track the number + * and total size of entries flushed: + */ + flushed_entries_count = 0; + flushed_entries_size = 0; + + /* As mentioned above, there is the possibility that + * entries will be dirtied, resized, flushed, or removed + * from the cache via the take ownership flag during + * our pass through the skip list. To capture the number + * of entries added, and the skip list size delta, + * zero the slist_len_increase and slist_size_increase of + * the cache's instance of H5C_t. These fields will be + * updated elsewhere to account for slist insertions and/or + * dirty entry size changes. + */ + cache_ptr->slist_len_increase = 0; + cache_ptr->slist_size_increase = 0; + + /* at the end of the loop, use these values to compute the + * expected slist length and size and compare this with the + * value recorded in the cache's instance of H5C_t. + */ +#endif /* H5C_DO_SANITY_CHECKS */ + + restart_slist_scan = TRUE; + + while((restart_slist_scan ) || (node_ptr != NULL)) { + if(restart_slist_scan) { + restart_slist_scan = FALSE; + + /* Start at beginning of skip list */ + node_ptr = H5SL_first(cache_ptr->slist_ptr); + + if(node_ptr == NULL) + /* the slist is empty -- break out of inner loop */ + break; + + /* Get cache entry for this node */ + next_entry_ptr = (H5C_cache_entry_t *)H5SL_item(node_ptr); + + if(NULL == next_entry_ptr) + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "next_entry_ptr == NULL ?!?!") + + HDassert(next_entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); + HDassert(next_entry_ptr->is_dirty); + HDassert(next_entry_ptr->in_slist); + } /* end if */ + + entry_ptr = next_entry_ptr; + + /* With the advent of the fractal heap, the free space + * manager, and the version 3 cache, it is possible + * that the pre-serialize or serialize callback will + * dirty, resize, or take ownership of other entries + * in the cache. + * + * To deal with this, I have inserted code to detect any + * change in the skip list not directly under the control + * of this function. If such modifications are detected, + * we must re-start the scan of the skip list to avoid + * the possibility that the target of the next_entry_ptr + * may have been flushed or deleted from the cache. + * + * To verify that all such possibilities have been dealt + * with, we do a bit of extra sanity checking on + * entry_ptr. + */ + HDassert(entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); + HDassert(entry_ptr->in_slist); + HDassert(entry_ptr->is_dirty); + HDassert(entry_ptr->ring >= ring); + + /* increment node pointer now, before we delete its target + * from the slist. + */ + node_ptr = H5SL_next(node_ptr); + if(node_ptr != NULL) { + next_entry_ptr = (H5C_cache_entry_t *)H5SL_item(node_ptr); + if(NULL == next_entry_ptr) + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "next_entry_ptr == NULL ?!?!") + + HDassert(next_entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); + HDassert(next_entry_ptr->is_dirty); + HDassert(next_entry_ptr->in_slist); + HDassert(next_entry_ptr->ring >= ring); + HDassert(entry_ptr != next_entry_ptr); + } /* end if */ + else + next_entry_ptr = NULL; + + HDassert(entry_ptr != NULL); + HDassert(entry_ptr->in_slist); + + if(((!flush_marked_entries) || (entry_ptr->flush_marker)) && + ((!entry_ptr->flush_me_last) || + ((entry_ptr->flush_me_last) && + (cache_ptr->num_last_entries >= cache_ptr->slist_len))) && + (entry_ptr->ring == ring)) { + if(entry_ptr->is_protected) { + /* we probably have major problems -- but lets + * flush everything we can before we decide + * whether to flag an error. + */ + tried_to_flush_protected_entry = TRUE; + protected_entries++; + } /* end if */ + else if(entry_ptr->is_pinned) { + + /* Test to see if we are can flush the entry now. + * If we can, go ahead and flush. Note that we + * aren't trying to do a destroy here, so that + * is not an issue. + */ + if(entry_ptr->flush_dep_height == curr_flush_dep_height) { +#if H5C_DO_SANITY_CHECKS + flushed_entries_count++; + flushed_entries_size += (int64_t)entry_ptr->size; + entry_size_change = 0; +#endif /* H5C_DO_SANITY_CHECKS */ + + if(H5C__flush_single_entry(f, dxpl_id, entry_ptr, flags, entry_size_change_ptr) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "dirty pinned entry flush failed.") + +#if H5C_DO_SANITY_CHECKS + /* it is possible that the entry size changed + * during flush -- update flushed_entries_size + * to account for this. + */ + flushed_entries_size += entry_size_change; +#endif /* H5C_DO_SANITY_CHECKS */ + + flushed_during_dep_loop = TRUE; + + if((cache_ptr->slist_change_in_serialize) || + (cache_ptr->slist_change_in_pre_serialize)) { + /* The slist has been modified by something + * other than the simple removal of the + * of the flushed entry after the flush. + * + * This has the potential to corrupt the + * scan through the slist, so restart it. + */ + restart_slist_scan = TRUE; + cache_ptr->slist_change_in_pre_serialize = FALSE; + cache_ptr->slist_change_in_serialize = FALSE; + + H5C__UPDATE_STATS_FOR_SLIST_SCAN_RESTART(cache_ptr) + } /* end if */ + } /* end if */ + else if(entry_ptr->flush_dep_height < curr_flush_dep_height) + /* This shouldn't happen -- if it does, just scream and die. */ + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "dirty entry below current flush dep. height.") + } /* end else-if */ + else { + /* Test to see if we are can flush the entry now. + * If we can, go ahead and flush. Note that we + * aren't trying to do a destroy here, so that + * is not an issue. + */ + if(entry_ptr->flush_dep_height == curr_flush_dep_height) { +#if H5C_DO_SANITY_CHECKS + flushed_entries_count++; + flushed_entries_size += (int64_t)entry_ptr->size; + entry_size_change = 0; +#endif /* H5C_DO_SANITY_CHECKS */ + if(H5C__flush_single_entry(f, dxpl_id, entry_ptr, flags, entry_size_change_ptr) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't flush entry.") + +#if H5C_DO_SANITY_CHECKS + /* it is possible that the entry size changed + * during flush -- update flushed_entries_size + * to account for this. + */ + flushed_entries_size += entry_size_change; +#endif /* H5C_DO_SANITY_CHECKS */ + + flushed_during_dep_loop = TRUE; + + if((cache_ptr->slist_change_in_serialize) || + (cache_ptr->slist_change_in_pre_serialize)) { + /* The slist has been modified by something + * other than the simple removal of the + * of the flushed entry after the flush. + * + * This has the potential to corrupt the + * scan through the slist, so restart it. + */ + restart_slist_scan = TRUE; + cache_ptr->slist_change_in_pre_serialize = FALSE; + cache_ptr->slist_change_in_serialize = FALSE; + + H5C__UPDATE_STATS_FOR_SLIST_SCAN_RESTART(cache_ptr) + } /* end if */ + } /* end if */ + else if(entry_ptr->flush_dep_height < curr_flush_dep_height) + /* This shouldn't happen -- if it does, just scream and die. */ + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "dirty entry below current flush dep. height.") + } /* end else */ + } /* end if */ + } /* while ( ( restart_slist_scan ) || ( node_ptr != NULL ) ) */ + + /* Check for incrementing flush dependency height */ + if(flushed_during_dep_loop) { + + /* If we flushed an entry at this flush dependency height + * start over at the bottom level of the flush dependencies + */ + curr_flush_dep_height = 0; + + /* Make certain we don't get stuck in an infinite loop */ + flush_dep_passes++; + + /* Set flag for outer loop */ + flushed_entries_last_pass = TRUE; + } /* end if */ + else + curr_flush_dep_height++; + } /* while ( curr_flush_dep_height <= H5C__NUM_FLUSH_DEP_HEIGHTS) */ + + passes++; + +#if H5C_DO_SANITY_CHECKS + /* Verify that the slist size and length are as expected. */ + HDassert((initial_slist_len + cache_ptr->slist_len_increase - + flushed_entries_count) == cache_ptr->slist_len); + HDassert((size_t)((int64_t)initial_slist_size + + cache_ptr->slist_size_increase - + flushed_entries_size) == cache_ptr->slist_size); +#endif /* H5C_DO_SANITY_CHECKS */ + } /* while */ + + HDassert(protected_entries <= cache_ptr->pl_len); + + if(((cache_ptr->pl_len > 0) && (!ignore_protected)) || (tried_to_flush_protected_entry)) + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "cache has protected items") + + if((cache_ptr->slist_len != 0) && (passes >= H5C__MAX_PASSES_ON_FLUSH)) + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "flush pass limit exceeded.") + +#if H5C_DO_SANITY_CHECKS + if(!flush_marked_entries) { + HDassert(cache_ptr->slist_ring_len[ring] == 0); + HDassert(cache_ptr->slist_ring_size[ring] == 0); + } /* end if */ +#endif /* H5C_DO_SANITY_CHECKS */ + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* H5C_flush_ring() */ /*------------------------------------------------------------------------- @@ -7490,6 +7643,7 @@ H5C__flush_single_entry(const H5F_t *f, hid_t dxpl_id, H5C_cache_entry_t *entry_ HDassert(cache_ptr); HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); HDassert(entry_ptr); + HDassert(entry_ptr->ring != H5C_RING_UNDEFINED); /* If defined, initialize *entry_size_change_ptr to 0 */ if(entry_size_change_ptr != NULL) @@ -8498,6 +8652,8 @@ H5C_load_entry(H5F_t * f, entry->flush_in_progress = FALSE; entry->destroy_in_progress = FALSE; + entry->ring = H5C_RING_UNDEFINED; + /* Initialize flush dependency height fields */ entry->flush_dep_parent = NULL; for(u = 0; u < H5C__NUM_FLUSH_DEP_HEIGHTS; u++) @@ -9865,3 +10021,47 @@ H5C_retag_copied_metadata(H5C_t * cache_ptr, haddr_t metadata_tag) FUNC_LEAVE_NOAPI_VOID } /* H5C_retag_copied_metadata */ + +/*------------------------------------------------------------------------- + * Function: H5C_get_entry_ring + * + * Purpose: Given a file address, retrieve the ring for an entry at that + * address. + * + * On error, the value of *ring is not modified. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Quincey Koziol + * 9/8/15 + * + *------------------------------------------------------------------------- + */ +herr_t +H5C_get_entry_ring(const H5F_t *f, haddr_t addr, H5C_ring_t *ring) +{ + H5C_t *cache_ptr; /* Pointer to cache */ + H5C_cache_entry_t *entry_ptr; /* Pointer to cache entry at address */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* Sanity checks */ + HDassert(f); + HDassert(f->shared); + cache_ptr = f->shared->cache; + HDassert(cache_ptr); + HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); + HDassert(H5F_addr_defined(addr)); + + /* Locate the entry at the address */ + H5C__SEARCH_INDEX(cache_ptr, addr, entry_ptr, FAIL) + HDassert(entry_ptr); + + /* Return the ring value */ + *ring = entry_ptr->ring; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* H5C_get_entry_ring() */ + diff --git a/src/H5Cpkg.h b/src/H5Cpkg.h index 7d9d0f9..ea965fd 100644 --- a/src/H5Cpkg.h +++ b/src/H5Cpkg.h @@ -824,6 +824,12 @@ if ( ( (entry_ptr) == NULL ) || \ * * JRM -- 11/5/08 * + * - Updated existing index macros and sanity check macros to maintain + * the index_ring_len, index_ring_size, clean_index_ring_size, and + * dirty_index_ring_size fields of H5C_t. + * + * JRM -- 9/1/15 + * ***********************************************************************/ /* H5C__HASH_TABLE_LEN is defined in H5Cpkg.h. It mut be a power of two. */ @@ -848,7 +854,17 @@ if ( ( (cache_ptr) == NULL ) || \ ((cache_ptr)->clean_index_size + \ (cache_ptr)->dirty_index_size) ) || \ ( (cache_ptr)->index_size < ((cache_ptr)->clean_index_size) ) || \ - ( (cache_ptr)->index_size < ((cache_ptr)->dirty_index_size) ) ) { \ + ( (cache_ptr)->index_size < ((cache_ptr)->dirty_index_size) ) || \ + ( (entry_ptr)->ring <= H5C_RING_UNDEFINED ) || \ + ( (entry_ptr)->ring >= H5C_RING_NTYPES ) || \ + ( (cache_ptr)->index_ring_len[(entry_ptr)->ring] > \ + (cache_ptr)->index_len ) || \ + ( (cache_ptr)->index_ring_size[(entry_ptr)->ring] > \ + (cache_ptr)->index_size ) || \ + ( (cache_ptr)->index_ring_size[(entry_ptr)->ring] != \ + ((cache_ptr)->clean_index_ring_size[(entry_ptr)->ring] + \ + (cache_ptr)->dirty_index_ring_size[(entry_ptr)->ring]) ) ) { \ + HDassert(FALSE); \ HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, fail_val, \ "Pre HT insert SC failed") \ } @@ -860,7 +876,16 @@ if ( ( (cache_ptr) == NULL ) || \ ((cache_ptr)->clean_index_size + \ (cache_ptr)->dirty_index_size) ) || \ ( (cache_ptr)->index_size < ((cache_ptr)->clean_index_size) ) || \ - ( (cache_ptr)->index_size < ((cache_ptr)->dirty_index_size) ) ) { \ + ( (cache_ptr)->index_size < ((cache_ptr)->dirty_index_size) ) || \ + ( (cache_ptr)->index_ring_len[(entry_ptr)->ring] == 0 ) || \ + ( (cache_ptr)->index_ring_len[(entry_ptr)->ring] > \ + (cache_ptr)->index_len ) || \ + ( (cache_ptr)->index_ring_size[(entry_ptr)->ring] > \ + (cache_ptr)->index_size ) || \ + ( (cache_ptr)->index_ring_size[(entry_ptr)->ring] != \ + ((cache_ptr)->clean_index_ring_size[(entry_ptr)->ring] + \ + (cache_ptr)->dirty_index_ring_size[(entry_ptr)->ring]) ) ) { \ + HDassert(FALSE); \ HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, fail_val, \ "Post HT insert SC failed") \ } @@ -887,7 +912,20 @@ if ( ( (cache_ptr) == NULL ) || \ ((cache_ptr)->clean_index_size + \ (cache_ptr)->dirty_index_size) ) || \ ( (cache_ptr)->index_size < ((cache_ptr)->clean_index_size) ) || \ - ( (cache_ptr)->index_size < ((cache_ptr)->dirty_index_size) ) ) { \ + ( (cache_ptr)->index_size < ((cache_ptr)->dirty_index_size) ) || \ + ( (entry_ptr)->ring <= H5C_RING_UNDEFINED ) || \ + ( (entry_ptr)->ring >= H5C_RING_NTYPES ) || \ + ( (cache_ptr)->index_ring_len[(entry_ptr)->ring] <= 0 ) || \ + ( (cache_ptr)->index_ring_len[(entry_ptr)->ring] > \ + (cache_ptr)->index_len ) || \ + ( (cache_ptr)->index_ring_size[(entry_ptr)->ring] < \ + (entry_ptr)->size ) || \ + ( (cache_ptr)->index_ring_size[(entry_ptr)->ring] > \ + (cache_ptr)->index_size ) || \ + ( (cache_ptr)->index_ring_size[(entry_ptr)->ring] != \ + ((cache_ptr)->clean_index_ring_size[(entry_ptr)->ring] + \ + (cache_ptr)->dirty_index_ring_size[(entry_ptr)->ring]) ) ) { \ + HDassert(FALSE); \ HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Pre HT remove SC failed") \ } @@ -903,7 +941,15 @@ if ( ( (cache_ptr) == NULL ) || \ ((cache_ptr)->clean_index_size + \ (cache_ptr)->dirty_index_size) ) || \ ( (cache_ptr)->index_size < ((cache_ptr)->clean_index_size) ) || \ - ( (cache_ptr)->index_size < ((cache_ptr)->dirty_index_size) ) ) { \ + ( (cache_ptr)->index_size < ((cache_ptr)->dirty_index_size) ) || \ + ( (cache_ptr)->index_ring_len[(entry_ptr)->ring] > \ + (cache_ptr)->index_len ) || \ + ( (cache_ptr)->index_ring_size[(entry_ptr)->ring] > \ + (cache_ptr)->index_size ) || \ + ( (cache_ptr)->index_ring_size[(entry_ptr)->ring] != \ + ((cache_ptr)->clean_index_ring_size[(entry_ptr)->ring] + \ + (cache_ptr)->dirty_index_ring_size[(entry_ptr)->ring]) ) ) { \ + HDassert(FALSE); \ HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Post HT remove SC failed") \ } @@ -971,7 +1017,18 @@ if ( ( (cache_ptr) == NULL ) || \ ( (cache_ptr)->clean_index_size < (old_size) ) ) && \ ( ( (was_clean) ) || \ ( (cache_ptr)->dirty_index_size < (old_size) ) ) ) || \ - ( (entry_ptr) == NULL ) ) { \ + ( (entry_ptr) == NULL ) || \ + ( (entry_ptr)->ring <= H5C_RING_UNDEFINED ) || \ + ( (entry_ptr)->ring >= H5C_RING_NTYPES ) || \ + ( (cache_ptr)->index_ring_len[(entry_ptr)->ring] <= 0 ) || \ + ( (cache_ptr)->index_ring_len[(entry_ptr)->ring] > \ + (cache_ptr)->index_len ) || \ + ( (cache_ptr)->index_ring_size[(entry_ptr)->ring] > \ + (cache_ptr)->index_size ) || \ + ( (cache_ptr)->index_ring_size[(entry_ptr)->ring] != \ + ((cache_ptr)->clean_index_ring_size[(entry_ptr)->ring] + \ + (cache_ptr)->dirty_index_ring_size[(entry_ptr)->ring]) ) ) { \ + HDassert(FALSE); \ HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ "Pre HT entry size change SC failed") \ } @@ -992,7 +1049,15 @@ if ( ( (cache_ptr) == NULL ) || \ ( ( ((entry_ptr)->is_dirty) ) || \ ( (cache_ptr)->clean_index_size < (new_size) ) ) ) || \ ( ( (cache_ptr)->index_len == 1 ) && \ - ( (cache_ptr)->index_size != (new_size) ) ) ) { \ + ( (cache_ptr)->index_size != (new_size) ) ) || \ + ( (cache_ptr)->index_ring_len[(entry_ptr)->ring] > \ + (cache_ptr)->index_len ) || \ + ( (cache_ptr)->index_ring_size[(entry_ptr)->ring] > \ + (cache_ptr)->index_size ) || \ + ( (cache_ptr)->index_ring_size[(entry_ptr)->ring] != \ + ((cache_ptr)->clean_index_ring_size[(entry_ptr)->ring] + \ + (cache_ptr)->dirty_index_ring_size[(entry_ptr)->ring]) ) ) { \ + HDassert(FALSE); \ HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ "Post HT entry size change SC failed") \ } @@ -1009,7 +1074,18 @@ if ( \ ( (cache_ptr)->index_size != \ ((cache_ptr)->clean_index_size + (cache_ptr)->dirty_index_size) ) || \ ( (cache_ptr)->index_size < ((cache_ptr)->clean_index_size) ) || \ - ( (cache_ptr)->index_size < ((cache_ptr)->dirty_index_size) ) ) { \ + ( (cache_ptr)->index_size < ((cache_ptr)->dirty_index_size) ) || \ + ( (entry_ptr)->ring <= H5C_RING_UNDEFINED ) || \ + ( (entry_ptr)->ring >= H5C_RING_NTYPES ) || \ + ( (cache_ptr)->index_ring_len[(entry_ptr)->ring] <= 0 ) || \ + ( (cache_ptr)->index_ring_len[(entry_ptr)->ring] > \ + (cache_ptr)->index_len ) || \ + ( (cache_ptr)->index_ring_size[(entry_ptr)->ring] > \ + (cache_ptr)->index_size ) || \ + ( (cache_ptr)->index_ring_size[(entry_ptr)->ring] != \ + ((cache_ptr)->clean_index_ring_size[(entry_ptr)->ring] + \ + (cache_ptr)->dirty_index_ring_size[(entry_ptr)->ring]) ) ) { \ + HDassert(FALSE); \ HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ "Pre HT update for entry clean SC failed") \ } @@ -1026,7 +1102,18 @@ if ( \ ( (cache_ptr)->index_size != \ ((cache_ptr)->clean_index_size + (cache_ptr)->dirty_index_size) ) || \ ( (cache_ptr)->index_size < ((cache_ptr)->clean_index_size) ) || \ - ( (cache_ptr)->index_size < ((cache_ptr)->dirty_index_size) ) ) { \ + ( (cache_ptr)->index_size < ((cache_ptr)->dirty_index_size) ) || \ + ( (entry_ptr)->ring <= H5C_RING_UNDEFINED ) || \ + ( (entry_ptr)->ring >= H5C_RING_NTYPES ) || \ + ( (cache_ptr)->index_ring_len[(entry_ptr)->ring] <= 0 ) || \ + ( (cache_ptr)->index_ring_len[(entry_ptr)->ring] > \ + (cache_ptr)->index_len ) || \ + ( (cache_ptr)->index_ring_size[(entry_ptr)->ring] > \ + (cache_ptr)->index_size ) || \ + ( (cache_ptr)->index_ring_size[(entry_ptr)->ring] != \ + ((cache_ptr)->clean_index_ring_size[(entry_ptr)->ring] + \ + (cache_ptr)->dirty_index_ring_size[(entry_ptr)->ring]) ) ) { \ + HDassert(FALSE); \ HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ "Pre HT update for entry dirty SC failed") \ } @@ -1035,7 +1122,15 @@ if ( \ if ( ( (cache_ptr)->index_size != \ ((cache_ptr)->clean_index_size + (cache_ptr)->dirty_index_size) ) || \ ( (cache_ptr)->index_size < ((cache_ptr)->clean_index_size) ) || \ - ( (cache_ptr)->index_size < ((cache_ptr)->dirty_index_size) ) ) { \ + ( (cache_ptr)->index_size < ((cache_ptr)->dirty_index_size) ) || \ + ( (cache_ptr)->index_ring_len[(entry_ptr)->ring] > \ + (cache_ptr)->index_len ) || \ + ( (cache_ptr)->index_ring_size[(entry_ptr)->ring] > \ + (cache_ptr)->index_size ) || \ + ( (cache_ptr)->index_ring_size[(entry_ptr)->ring] != \ + ((cache_ptr)->clean_index_ring_size[(entry_ptr)->ring] + \ + (cache_ptr)->dirty_index_ring_size[(entry_ptr)->ring]) ) ) { \ + HDassert(FALSE); \ HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ "Post HT update for entry clean SC failed") \ } @@ -1044,7 +1139,15 @@ if ( ( (cache_ptr)->index_size != \ if ( ( (cache_ptr)->index_size != \ ((cache_ptr)->clean_index_size + (cache_ptr)->dirty_index_size) ) || \ ( (cache_ptr)->index_size < ((cache_ptr)->clean_index_size) ) || \ - ( (cache_ptr)->index_size < ((cache_ptr)->dirty_index_size) ) ) { \ + ( (cache_ptr)->index_size < ((cache_ptr)->dirty_index_size) ) || \ + ( (cache_ptr)->index_ring_len[(entry_ptr)->ring] > \ + (cache_ptr)->index_len ) || \ + ( (cache_ptr)->index_ring_size[(entry_ptr)->ring] > \ + (cache_ptr)->index_size ) || \ + ( (cache_ptr)->index_ring_size[(entry_ptr)->ring] != \ + ((cache_ptr)->clean_index_ring_size[(entry_ptr)->ring] + \ + (cache_ptr)->dirty_index_ring_size[(entry_ptr)->ring]) ) ) { \ + HDassert(FALSE); \ HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ "Post HT update for entry dirty SC failed") \ } @@ -1070,30 +1173,38 @@ if ( ( (cache_ptr)->index_size != \ #endif /* H5C_DO_SANITY_CHECKS */ -#define H5C__INSERT_IN_INDEX(cache_ptr, entry_ptr, fail_val) \ -{ \ - int k; \ - H5C__PRE_HT_INSERT_SC(cache_ptr, entry_ptr, fail_val) \ - k = H5C__HASH_FCN((entry_ptr)->addr); \ - if ( ((cache_ptr)->index)[k] == NULL ) \ - ((cache_ptr)->index)[k] = (entry_ptr); \ - else { \ - (entry_ptr)->ht_next = ((cache_ptr)->index)[k]; \ - (entry_ptr)->ht_next->ht_prev = (entry_ptr); \ - ((cache_ptr)->index)[k] = (entry_ptr); \ - } \ - (cache_ptr)->index_len++; \ - (cache_ptr)->index_size += (entry_ptr)->size; \ - if ( (entry_ptr)->is_dirty ) \ - (cache_ptr)->dirty_index_size += (entry_ptr)->size; \ - else \ - (cache_ptr)->clean_index_size += (entry_ptr)->size; \ - if ((entry_ptr)->flush_me_last) { \ - (cache_ptr)->num_last_entries++; \ - HDassert((cache_ptr)->num_last_entries <= 2); \ - } \ - H5C__UPDATE_STATS_FOR_HT_INSERTION(cache_ptr) \ - H5C__POST_HT_INSERT_SC(cache_ptr, fail_val) \ +#define H5C__INSERT_IN_INDEX(cache_ptr, entry_ptr, fail_val) \ +{ \ + int k; \ + H5C__PRE_HT_INSERT_SC(cache_ptr, entry_ptr, fail_val) \ + k = H5C__HASH_FCN((entry_ptr)->addr); \ + if ( ((cache_ptr)->index)[k] == NULL ) \ + ((cache_ptr)->index)[k] = (entry_ptr); \ + else { \ + (entry_ptr)->ht_next = ((cache_ptr)->index)[k]; \ + (entry_ptr)->ht_next->ht_prev = (entry_ptr); \ + ((cache_ptr)->index)[k] = (entry_ptr); \ + } \ + (cache_ptr)->index_len++; \ + (cache_ptr)->index_size += (entry_ptr)->size; \ + ((cache_ptr)->index_ring_len[entry_ptr->ring])++; \ + ((cache_ptr)->index_ring_size[entry_ptr->ring]) \ + += (entry_ptr)->size; \ + if ( (entry_ptr)->is_dirty ) { \ + (cache_ptr)->dirty_index_size += (entry_ptr)->size; \ + ((cache_ptr)->dirty_index_ring_size[entry_ptr->ring]) \ + += (entry_ptr)->size; \ + } else { \ + (cache_ptr)->clean_index_size += (entry_ptr)->size; \ + ((cache_ptr)->clean_index_ring_size[entry_ptr->ring]) \ + += (entry_ptr)->size; \ + } \ + if ((entry_ptr)->flush_me_last) { \ + (cache_ptr)->num_last_entries++; \ + HDassert((cache_ptr)->num_last_entries <= 2); \ + } \ + H5C__UPDATE_STATS_FOR_HT_INSERTION(cache_ptr) \ + H5C__POST_HT_INSERT_SC(cache_ptr, fail_val) \ } #define H5C__DELETE_FROM_INDEX(cache_ptr, entry_ptr) \ @@ -1111,10 +1222,18 @@ if ( ( (cache_ptr)->index_size != \ (entry_ptr)->ht_prev = NULL; \ (cache_ptr)->index_len--; \ (cache_ptr)->index_size -= (entry_ptr)->size; \ - if ( (entry_ptr)->is_dirty ) \ + ((cache_ptr)->index_ring_len[entry_ptr->ring])--; \ + ((cache_ptr)->index_ring_size[entry_ptr->ring]) \ + -= (entry_ptr)->size; \ + if ( (entry_ptr)->is_dirty ) { \ (cache_ptr)->dirty_index_size -= (entry_ptr)->size; \ - else \ + ((cache_ptr)->dirty_index_ring_size[entry_ptr->ring]) \ + -= (entry_ptr)->size; \ + } else { \ (cache_ptr)->clean_index_size -= (entry_ptr)->size; \ + ((cache_ptr)->clean_index_ring_size[entry_ptr->ring]) \ + -= (entry_ptr)->size; \ + } \ if ((entry_ptr)->flush_me_last) { \ (cache_ptr)->num_last_entries--; \ HDassert((cache_ptr)->num_last_entries <= 1); \ @@ -1182,7 +1301,11 @@ if ( ( (cache_ptr)->index_size != \ { \ H5C__PRE_HT_UPDATE_FOR_ENTRY_CLEAN_SC(cache_ptr, entry_ptr); \ (cache_ptr)->dirty_index_size -= (entry_ptr)->size; \ + ((cache_ptr)->dirty_index_ring_size[entry_ptr->ring]) \ + -= (entry_ptr)->size; \ (cache_ptr)->clean_index_size += (entry_ptr)->size; \ + ((cache_ptr)->clean_index_ring_size[entry_ptr->ring]) \ + += (entry_ptr)->size; \ H5C__POST_HT_UPDATE_FOR_ENTRY_CLEAN_SC(cache_ptr, entry_ptr); \ } @@ -1190,27 +1313,39 @@ if ( ( (cache_ptr)->index_size != \ { \ H5C__PRE_HT_UPDATE_FOR_ENTRY_DIRTY_SC(cache_ptr, entry_ptr); \ (cache_ptr)->clean_index_size -= (entry_ptr)->size; \ + ((cache_ptr)->clean_index_ring_size[entry_ptr->ring]) \ + -= (entry_ptr)->size; \ (cache_ptr)->dirty_index_size += (entry_ptr)->size; \ + ((cache_ptr)->dirty_index_ring_size[entry_ptr->ring]) \ + += (entry_ptr)->size; \ H5C__POST_HT_UPDATE_FOR_ENTRY_DIRTY_SC(cache_ptr, entry_ptr); \ } -#define H5C__UPDATE_INDEX_FOR_SIZE_CHANGE(cache_ptr, old_size, new_size, \ - entry_ptr, was_clean) \ -{ \ - H5C__PRE_HT_ENTRY_SIZE_CHANGE_SC(cache_ptr, old_size, new_size, \ - entry_ptr, was_clean) \ - (cache_ptr)->index_size -= (old_size); \ - (cache_ptr)->index_size += (new_size); \ - if ( was_clean ) \ - (cache_ptr)->clean_index_size -= (old_size); \ - else \ - (cache_ptr)->dirty_index_size -= (old_size); \ - if ( (entry_ptr)->is_dirty ) \ - (cache_ptr)->dirty_index_size += (new_size); \ - else \ - (cache_ptr)->clean_index_size += (new_size); \ - H5C__POST_HT_ENTRY_SIZE_CHANGE_SC(cache_ptr, old_size, new_size, \ - entry_ptr) \ +#define H5C__UPDATE_INDEX_FOR_SIZE_CHANGE(cache_ptr, old_size, new_size, \ + entry_ptr, was_clean) \ +{ \ + H5C__PRE_HT_ENTRY_SIZE_CHANGE_SC(cache_ptr, old_size, new_size, \ + entry_ptr, was_clean) \ + (cache_ptr)->index_size -= (old_size); \ + (cache_ptr)->index_size += (new_size); \ + ((cache_ptr)->index_ring_size[entry_ptr->ring]) -= (old_size); \ + ((cache_ptr)->index_ring_size[entry_ptr->ring]) += (new_size); \ + if ( was_clean ) { \ + (cache_ptr)->clean_index_size -= (old_size); \ + ((cache_ptr)->clean_index_ring_size[entry_ptr->ring])-= (old_size); \ + } else { \ + (cache_ptr)->dirty_index_size -= (old_size); \ + ((cache_ptr)->dirty_index_ring_size[entry_ptr->ring])-= (old_size); \ + } \ + if ( (entry_ptr)->is_dirty ) { \ + (cache_ptr)->dirty_index_size += (new_size); \ + ((cache_ptr)->dirty_index_ring_size[entry_ptr->ring])+= (new_size); \ + } else { \ + (cache_ptr)->clean_index_size += (new_size); \ + ((cache_ptr)->clean_index_ring_size[entry_ptr->ring])+= (new_size); \ + } \ + H5C__POST_HT_ENTRY_SIZE_CHANGE_SC(cache_ptr, old_size, new_size, \ + entry_ptr) \ } @@ -1275,6 +1410,10 @@ if ( ( (cache_ptr)->index_size != \ * Added code to set cache_ptr->slist_changed to TRUE * when an entry is inserted in the slist. * + * JRM -- 9/1/15 + * Added code to maintain the cache_ptr->slist_ring_len + * and cache_ptr->slist_ring_size arrays. + * *------------------------------------------------------------------------- */ @@ -1296,6 +1435,12 @@ if ( ( (cache_ptr)->index_size != \ HDassert( H5F_addr_defined((entry_ptr)->addr) ); \ HDassert( !((entry_ptr)->in_slist) ); \ HDassert( !ENTRY_IN_SLIST((cache_ptr), (entry_ptr)) ); \ + HDassert( (entry_ptr)->ring > H5C_RING_UNDEFINED ); \ + HDassert( (entry_ptr)->ring < H5C_RING_NTYPES ); \ + HDassert( (cache_ptr)->slist_ring_len[(entry_ptr)->ring] <= \ + (cache_ptr)->slist_len ); \ + HDassert( (cache_ptr)->slist_ring_size[(entry_ptr)->ring] <= \ + (cache_ptr)->slist_size ); \ \ if(H5SL_insert((cache_ptr)->slist_ptr, entry_ptr, &(entry_ptr)->addr) < 0) \ HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, (fail_val), \ @@ -1305,6 +1450,8 @@ if ( ( (cache_ptr)->index_size != \ (cache_ptr)->slist_changed = TRUE; \ (cache_ptr)->slist_len++; \ (cache_ptr)->slist_size += (entry_ptr)->size; \ + ((cache_ptr)->slist_ring_len[(entry_ptr)->ring])++; \ + ((cache_ptr)->slist_ring_size[(entry_ptr)->ring]) += (entry_ptr)->size; \ (cache_ptr)->slist_len_increase++; \ (cache_ptr)->slist_size_increase += (int64_t)((entry_ptr)->size); \ \ @@ -1324,6 +1471,12 @@ if ( ( (cache_ptr)->index_size != \ HDassert( H5F_addr_defined((entry_ptr)->addr) ); \ HDassert( !((entry_ptr)->in_slist) ); \ HDassert( !ENTRY_IN_SLIST((cache_ptr), (entry_ptr)) ); \ + HDassert( (entry_ptr)->ring > H5C_RING_UNDEFINED ); \ + HDassert( (entry_ptr)->ring < H5C_RING_NTYPES ); \ + HDassert( (cache_ptr)->slist_ring_len[(entry_ptr)->ring] <= \ + (cache_ptr)->slist_len ); \ + HDassert( (cache_ptr)->slist_ring_size[(entry_ptr)->ring] <= \ + (cache_ptr)->slist_size ); \ \ if(H5SL_insert((cache_ptr)->slist_ptr, entry_ptr, &(entry_ptr)->addr) < 0) \ HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, (fail_val), \ @@ -1333,6 +1486,8 @@ if ( ( (cache_ptr)->index_size != \ (cache_ptr)->slist_changed = TRUE; \ (cache_ptr)->slist_len++; \ (cache_ptr)->slist_size += (entry_ptr)->size; \ + ((cache_ptr)->slist_ring_len[(entry_ptr)->ring])++; \ + ((cache_ptr)->slist_ring_size[(entry_ptr)->ring]) += (entry_ptr)->size; \ \ HDassert( (cache_ptr)->slist_len > 0 ); \ HDassert( (cache_ptr)->slist_size > 0 ); \ @@ -1375,32 +1530,46 @@ if ( ( (cache_ptr)->index_size != \ * Added code to set cache_ptr->slist_changed to TRUE * when an entry is removed from the slist. * + * JRM -- 9/1/15 + * Added code to maintain the cache_ptr->slist_ring_len + * and cache_ptr->slist_ring_size arrays. + * *------------------------------------------------------------------------- */ -#define H5C__REMOVE_ENTRY_FROM_SLIST(cache_ptr, entry_ptr) \ -{ \ - HDassert( (cache_ptr) ); \ - HDassert( (cache_ptr)->magic == H5C__H5C_T_MAGIC ); \ - HDassert( (entry_ptr) ); \ - HDassert( !((entry_ptr)->is_protected) ); \ - HDassert( !((entry_ptr)->is_read_only) ); \ - HDassert( ((entry_ptr)->ro_ref_count) == 0 ); \ - HDassert( (entry_ptr)->size > 0 ); \ - HDassert( (entry_ptr)->in_slist ); \ - HDassert( (cache_ptr)->slist_ptr ); \ - \ - if ( H5SL_remove((cache_ptr)->slist_ptr, &(entry_ptr)->addr) \ - != (entry_ptr) ) \ - HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, \ - "Can't delete entry from skip list.") \ - \ - HDassert( (cache_ptr)->slist_len > 0 ); \ - (cache_ptr)->slist_changed = TRUE; \ - (cache_ptr)->slist_len--; \ - HDassert( (cache_ptr)->slist_size >= (entry_ptr)->size ); \ - (cache_ptr)->slist_size -= (entry_ptr)->size; \ - (entry_ptr)->in_slist = FALSE; \ +#define H5C__REMOVE_ENTRY_FROM_SLIST(cache_ptr, entry_ptr) \ +{ \ + HDassert( (cache_ptr) ); \ + HDassert( (cache_ptr)->magic == H5C__H5C_T_MAGIC ); \ + HDassert( (entry_ptr) ); \ + HDassert( !((entry_ptr)->is_protected) ); \ + HDassert( !((entry_ptr)->is_read_only) ); \ + HDassert( ((entry_ptr)->ro_ref_count) == 0 ); \ + HDassert( (entry_ptr)->size > 0 ); \ + HDassert( (entry_ptr)->in_slist ); \ + HDassert( (cache_ptr)->slist_ptr ); \ + HDassert( (entry_ptr)->ring > H5C_RING_UNDEFINED ); \ + HDassert( (entry_ptr)->ring < H5C_RING_NTYPES ); \ + HDassert( (cache_ptr)->slist_ring_len[(entry_ptr)->ring] <= \ + (cache_ptr)->slist_len ); \ + HDassert( (cache_ptr)->slist_ring_size[(entry_ptr)->ring] <= \ + (cache_ptr)->slist_size ); \ + \ + if ( H5SL_remove((cache_ptr)->slist_ptr, &(entry_ptr)->addr) \ + != (entry_ptr) ) \ + HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, \ + "Can't delete entry from skip list.") \ + \ + HDassert( (cache_ptr)->slist_len > 0 ); \ + (cache_ptr)->slist_changed = TRUE; \ + (cache_ptr)->slist_len--; \ + HDassert( (cache_ptr)->slist_size >= (entry_ptr)->size ); \ + (cache_ptr)->slist_size -= (entry_ptr)->size; \ + ((cache_ptr)->slist_ring_len[(entry_ptr)->ring])--; \ + HDassert( (cache_ptr)->slist_ring_size[(entry_ptr->ring)] >= \ + (entry_ptr)->size ); \ + ((cache_ptr)->slist_ring_size[(entry_ptr)->ring]) -= (entry_ptr)->size; \ + (entry_ptr)->in_slist = FALSE; \ } /* H5C__REMOVE_ENTRY_FROM_SLIST */ @@ -1432,52 +1601,76 @@ if ( ( (cache_ptr)->index_size != \ * in this case, as the structure of the slist is not * modified. * + * JRM -- 9/1/15 + * Added code to maintain the cache_ptr->slist_ring_len + * and cache_ptr->slist_ring_size arrays. + * *------------------------------------------------------------------------- */ #if H5C_DO_SANITY_CHECKS -#define H5C__UPDATE_SLIST_FOR_SIZE_CHANGE(cache_ptr, old_size, new_size) \ -{ \ - HDassert( (cache_ptr) ); \ - HDassert( (cache_ptr)->magic == H5C__H5C_T_MAGIC ); \ - HDassert( (old_size) > 0 ); \ - HDassert( (new_size) > 0 ); \ - HDassert( (old_size) <= (cache_ptr)->slist_size ); \ - HDassert( (cache_ptr)->slist_len > 0 ); \ - HDassert( ((cache_ptr)->slist_len > 1) || \ - ( (cache_ptr)->slist_size == (old_size) ) ); \ - \ - (cache_ptr)->slist_size -= (old_size); \ - (cache_ptr)->slist_size += (new_size); \ - \ - (cache_ptr)->slist_size_increase -= (int64_t)(old_size); \ - (cache_ptr)->slist_size_increase += (int64_t)(new_size); \ - \ - HDassert( (new_size) <= (cache_ptr)->slist_size ); \ - HDassert( ( (cache_ptr)->slist_len > 1 ) || \ - ( (cache_ptr)->slist_size == (new_size) ) ); \ +#define H5C__UPDATE_SLIST_FOR_SIZE_CHANGE(cache_ptr, old_size, new_size) \ +{ \ + HDassert( (cache_ptr) ); \ + HDassert( (cache_ptr)->magic == H5C__H5C_T_MAGIC ); \ + HDassert( (old_size) > 0 ); \ + HDassert( (new_size) > 0 ); \ + HDassert( (old_size) <= (cache_ptr)->slist_size ); \ + HDassert( (cache_ptr)->slist_len > 0 ); \ + HDassert( ((cache_ptr)->slist_len > 1) || \ + ( (cache_ptr)->slist_size == (old_size) ) ); \ + HDassert( (entry_ptr)->ring > H5C_RING_UNDEFINED ); \ + HDassert( (entry_ptr)->ring < H5C_RING_NTYPES ); \ + HDassert( (cache_ptr)->slist_ring_len[(entry_ptr)->ring] <= \ + (cache_ptr)->slist_len ); \ + HDassert( (cache_ptr)->slist_ring_size[(entry_ptr)->ring] <= \ + (cache_ptr)->slist_size ); \ + \ + (cache_ptr)->slist_size -= (old_size); \ + (cache_ptr)->slist_size += (new_size); \ + \ + HDassert( (cache_ptr)->slist_ring_size[(entry_ptr->ring)] >=(old_size) ); \ + ((cache_ptr)->slist_ring_size[(entry_ptr)->ring]) -= (old_size); \ + ((cache_ptr)->slist_ring_size[(entry_ptr)->ring]) += (new_size); \ + \ + (cache_ptr)->slist_size_increase -= (int64_t)(old_size); \ + (cache_ptr)->slist_size_increase += (int64_t)(new_size); \ + \ + HDassert( (new_size) <= (cache_ptr)->slist_size ); \ + HDassert( ( (cache_ptr)->slist_len > 1 ) || \ + ( (cache_ptr)->slist_size == (new_size) ) ); \ } /* H5C__UPDATE_SLIST_FOR_SIZE_CHANGE */ #else /* H5C_DO_SANITY_CHECKS */ -#define H5C__UPDATE_SLIST_FOR_SIZE_CHANGE(cache_ptr, old_size, new_size) \ -{ \ - HDassert( (cache_ptr) ); \ - HDassert( (cache_ptr)->magic == H5C__H5C_T_MAGIC ); \ - HDassert( (old_size) > 0 ); \ - HDassert( (new_size) > 0 ); \ - HDassert( (old_size) <= (cache_ptr)->slist_size ); \ - HDassert( (cache_ptr)->slist_len > 0 ); \ - HDassert( ((cache_ptr)->slist_len > 1) || \ - ( (cache_ptr)->slist_size == (old_size) ) ); \ - \ - (cache_ptr)->slist_size -= (old_size); \ - (cache_ptr)->slist_size += (new_size); \ - \ - HDassert( (new_size) <= (cache_ptr)->slist_size ); \ - HDassert( ( (cache_ptr)->slist_len > 1 ) || \ - ( (cache_ptr)->slist_size == (new_size) ) ); \ +#define H5C__UPDATE_SLIST_FOR_SIZE_CHANGE(cache_ptr, old_size, new_size) \ +{ \ + HDassert( (cache_ptr) ); \ + HDassert( (cache_ptr)->magic == H5C__H5C_T_MAGIC ); \ + HDassert( (old_size) > 0 ); \ + HDassert( (new_size) > 0 ); \ + HDassert( (old_size) <= (cache_ptr)->slist_size ); \ + HDassert( (cache_ptr)->slist_len > 0 ); \ + HDassert( ((cache_ptr)->slist_len > 1) || \ + ( (cache_ptr)->slist_size == (old_size) ) ); \ + HDassert( (entry_ptr)->ring > H5C_RING_UNDEFINED ); \ + HDassert( (entry_ptr)->ring < H5C_RING_NTYPES ); \ + HDassert( (cache_ptr)->slist_ring_len[(entry_ptr)->ring] <= \ + (cache_ptr)->slist_len ); \ + HDassert( (cache_ptr)->slist_ring_size[(entry_ptr)->ring] <= \ + (cache_ptr)->slist_size ); \ + \ + (cache_ptr)->slist_size -= (old_size); \ + (cache_ptr)->slist_size += (new_size); \ + \ + HDassert( (cache_ptr)->slist_ring_size[(entry_ptr->ring)] >=(old_size) ); \ + ((cache_ptr)->slist_ring_size[(entry_ptr)->ring]) -= (old_size); \ + ((cache_ptr)->slist_ring_size[(entry_ptr)->ring]) += (new_size); \ + \ + HDassert( (new_size) <= (cache_ptr)->slist_size ); \ + HDassert( ( (cache_ptr)->slist_len > 1 ) || \ + ( (cache_ptr)->slist_size == (new_size) ) ); \ } /* H5C__UPDATE_SLIST_FOR_SIZE_CHANGE */ #endif /* H5C_DO_SANITY_CHECKS */ @@ -2854,6 +3047,16 @@ if ( ( (cache_ptr)->index_size != \ * index_size by three should yield a conservative estimate * of the cache's memory footprint. * + * index_ring_len: Array of integer of length H5C_RING_NTYPES used to + * maintain a count of entries in the index by ring. Note + * that the sum of all the cells in this array must equal + * the value stored in index_len above. + * + * index_ring_size: Array of size_t of length H5C_RING_NTYPES used to + * maintain the sum of the sizes of all entries in the index + * by ring. Note that the sum of all cells in this array must + * equal the value stored in index_size above. + * * clean_index_size: Number of bytes of clean entries currently stored in * the hash table. Note that the index_size field (above) * is also the sum of the sizes of all entries in the cache. @@ -2868,12 +3071,22 @@ if ( ( (cache_ptr)->index_size != \ * clean_index_size plus the amount of empty space (if any) * in the cache. * + * clean_index_ring_size: Array of size_t of length H5C_RING_NTYPES used to + * maintain the sum of the sizes of all clean entries in the + * index by ring. Note that the sum of all cells in this array + * must equal the value stored in clean_index_size above. + * * dirty_index_size: Number of bytes of dirty entries currently stored in * the hash table. Note that the index_size field (above) * is also the sum of the sizes of all entries in the cache. * Thus we should have the invariant that clean_index_size + * dirty_index_size == index_size. * + * dirty_index_ring_size: Array of size_t of length H5C_RING_NTYPES used to + * maintain the sum of the sizes of all dirty entries in the + * index by ring. Note that the sum of all cells in this array + * must equal the value stored in dirty_index_size above. + * * index: Array of pointer to H5C_cache_entry_t of size * H5C__HASH_TABLE_LEN. At present, this value is a power * of two, not the usual prime number. @@ -2962,6 +3175,16 @@ if ( ( (cache_ptr)->index_size != \ * skip list used to maintain a sorted list of * dirty entries in the cache. * + * slist_ring_len: Array of integer of length H5C_RING_NTYPES used to + * maintain a count of entries in the slist by ring. Note + * that the sum of all the cells in this array must equal + * the value stored in slist_len above. + * + * slist_ring_size: Array of size_t of length H5C_RING_NTYPES used to + * maintain the sum of the sizes of all entries in the + * slist by ring. Note that the sum of all cells in this + * array must equal the value stored in slist_size above. + * * slist_ptr: pointer to the instance of H5SL_t used maintain a sorted * list of dirty entries in the cache. This sorted list has * two uses: @@ -3602,8 +3825,12 @@ struct H5C_t { /* Fields for maintaining [hash table] index of entries */ int32_t index_len; size_t index_size; + int32_t index_ring_len[H5C_RING_NTYPES]; + size_t index_ring_size[H5C_RING_NTYPES]; size_t clean_index_size; + size_t clean_index_ring_size[H5C_RING_NTYPES]; size_t dirty_index_size; + size_t dirty_index_ring_size[H5C_RING_NTYPES]; H5C_cache_entry_t * (index[H5C__HASH_TABLE_LEN]); /* Fields to detect entries removed during scans */ @@ -3619,6 +3846,8 @@ struct H5C_t { hbool_t slist_change_in_serialize; int32_t slist_len; size_t slist_size; + int32_t slist_ring_len[H5C_RING_NTYPES]; + size_t slist_ring_size[H5C_RING_NTYPES]; H5SL_t * slist_ptr; int32_t num_last_entries; #if H5C_DO_SANITY_CHECKS diff --git a/src/H5Cprivate.h b/src/H5Cprivate.h index 3cd74c1..2a3efc9 100644 --- a/src/H5Cprivate.h +++ b/src/H5Cprivate.h @@ -1115,6 +1115,60 @@ typedef herr_t (*H5C_log_flush_func_t)(H5C_t *cache_ptr, haddr_t addr, /**************************************************************************** * + * H5C_ring_t & associated #defines + * + * The metadata cache uses the concept of rings to order the flushes of + * classes of entries. In this arrangement, each entry in the cache is + * assigned to a ring, and on flush, the members of the outermost ring + * are flushed first, followed by the next outermost, and so on with the + * members of the innermost ring being flushed last. + * + * Note that flush dependencies are used to order flushes within rings. + * + * Note also that at the conceptual level, rings are argueably superfluous, + * as a similar effect could be obtained via the flush dependency mechanism. + * However, this would require all entries in the cache to participate in a + * flush dependency -- with the implied setup and takedown overhead and + * added complexity. Further, the flush ordering between rings need only + * be enforced on flush operations, and thus the use of flush dependencies + * instead would apply unecessary constraints on flushes under normal + * operating circumstances. + * + * As of this writing, all metadata entries pretaining to data sets and + * groups must be flushed first, and are thus assigned to the outermost + * ring. + * + * Free space managers managing file space must be flushed next, + * and are assigned to the second outermost ring. + * + * The object header and associated chunks used to implement superblock + * extension messages must be flushed next, and are thus assigned to + * the third outermost ring. + * + * The superblock proper must be flushed last, and is thus assigned to + * the innermost ring. + * + * The H5C_ring_t and the associated #defines below are used to define + * the rings. Each entry must be assigned to the appropriate ring on + * insertion or protect. + * + * Note that H5C_ring_t was originally an enumerated type. It was + * converted to an integer and a set of #defines for convenience in + * debugging. + */ + +#define H5C_RING_UNDEFINED 0 /* shouldn't appear in the cache */ +#define H5C_RING_USER 1 /* outermost ring */ +#define H5C_RING_FSM 2 +#define H5C_RING_SBE 4 /* temporarily merged with H5C_RING_SB */ +#define H5C_RING_SB 4 /* innermost ring */ +#define H5C_RING_NTYPES 5 + +typedef int H5C_ring_t; + + +/**************************************************************************** + * * structure H5C_cache_entry_t * * Instances of the H5C_cache_entry_t structure are used to store cache @@ -1376,6 +1430,25 @@ typedef herr_t (*H5C_log_flush_func_t)(H5C_t *cache_ptr, haddr_t addr, * is in the process of being flushed and destroyed. * * + * Fields supporting rings for flush ordering: + * + * All entries in the metadata cache are assigned to a ring. On cache + * flush, all entries in the outermost ring are flushed first, followed + * by all members of the next outermost ring, and so on until the + * innermost ring is flushed. Note that this ordering is ONLY applied + * in flush and serialize calls. Rings are ignored during normal operations + * in which entries are flushed as directed by the replacement policy. + * + * See the header comment on H5C_ring_t above for further details. + * + * Note that flush dependencies (see below) are used to order flushes + * within rings. Unlike rings, flush dependencies are applied to ALL + * writes, not just those triggered by flush or serialize calls. + * + * ring: Instance of H5C_ring_t indicating the ring to which this + * entry is assigned. + * + * * Fields supporting the 'flush dependency' feature: * * Entries in the cache may have a 'flush dependency' on another entry in the @@ -1543,6 +1616,9 @@ typedef struct H5C_cache_entry_t { hbool_t flush_in_progress; hbool_t destroy_in_progress; + /* fields supporting rings for purposes of flush ordering */ + H5C_ring_t ring; + /* fields supporting the 'flush dependency' feature: */ struct H5C_cache_entry_t * flush_dep_parent; uint64_t child_flush_dep_height_rc[H5C__NUM_FLUSH_DEP_HEIGHTS]; @@ -1917,6 +1993,7 @@ H5_DLL herr_t H5C_validate_resize_config(H5C_auto_size_ctl_t *config_ptr, unsigned int tests); H5_DLL herr_t H5C_ignore_tags(H5C_t *cache_ptr); H5_DLL void H5C_retag_copied_metadata(H5C_t *cache_ptr, haddr_t metadata_tag); +H5_DLL herr_t H5C_get_entry_ring(const H5F_t *f, haddr_t addr, H5C_ring_t *ring); #ifdef H5_HAVE_PARALLEL H5_DLL herr_t H5C_apply_candidate_list(H5F_t *f, hid_t dxpl_id, diff --git a/src/H5FScache.c b/src/H5FScache.c index 9accfc4..455a96e 100644 --- a/src/H5FScache.c +++ b/src/H5FScache.c @@ -376,6 +376,8 @@ H5FS__cache_hdr_pre_serialize(const H5F_t *f, hid_t dxpl_id, void *_thing, unsigned *flags) { H5FS_t *fspace = (H5FS_t *)_thing; /* Pointer to the object */ + H5P_genplist_t *dxpl = NULL; /* DXPL for setting ring */ + H5AC_ring_t orig_ring = H5AC_RING_INV; /* Original ring value */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC_TAG(dxpl_id, H5AC__FREESPACE_TAG, FAIL) @@ -391,6 +393,16 @@ H5FS__cache_hdr_pre_serialize(const H5F_t *f, hid_t dxpl_id, void *_thing, HDassert(flags); if(fspace->sinfo) { + H5AC_ring_t ring; + + /* Retrieve the ring type for the header */ + if(H5AC_get_entry_ring(f, addr, &ring) < 0) + HGOTO_ERROR(H5E_FSPACE, H5E_CANTGET, FAIL, "unable to get property value"); + + /* Set the ring type for the section info in the DXPL */ + if(H5AC_set_ring(dxpl_id, ring, &dxpl, &orig_ring) < 0) + HGOTO_ERROR(H5E_FSPACE, H5E_CANTSET, FAIL, "unable to set ring value") + /* This implies that the header "owns" the section info. * * Unfortunately, the comments in the code are not clear as to @@ -596,6 +608,10 @@ H5FS__cache_hdr_pre_serialize(const H5F_t *f, hid_t dxpl_id, void *_thing, *flags = 0; done: + /* Reset the ring in the DXPL */ + if(H5AC_reset_ring(dxpl, orig_ring) < 0) + HDONE_ERROR(H5E_FSPACE, H5E_CANTSET, FAIL, "unable to set property value") + FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) } /* end H5FS__cache_hdr_pre_serialize() */ diff --git a/src/H5Fsuper.c b/src/H5Fsuper.c index 2262ccd..d353d4f 100644 --- a/src/H5Fsuper.c +++ b/src/H5Fsuper.c @@ -206,6 +206,8 @@ herr_t H5F_super_ext_close(H5F_t *f, H5O_loc_t *ext_ptr, hid_t dxpl_id, hbool_t was_created) { + H5P_genplist_t *dxpl = NULL; /* DXPL for setting ring */ + H5AC_ring_t orig_ring = H5AC_RING_INV; /* Original ring value */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -216,6 +218,10 @@ H5F_super_ext_close(H5F_t *f, H5O_loc_t *ext_ptr, hid_t dxpl_id, /* Check if extension was created */ if(was_created) { + /* Set the ring type in the DXPL */ + if(H5AC_set_ring(dxpl_id, H5AC_RING_SBE, &dxpl, &orig_ring) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "unable to set ring value") + /* Increment link count on superblock extension's object header */ if(H5O_link(ext_ptr, 1, dxpl_id) < 0) HGOTO_ERROR(H5E_FILE, H5E_LINKCOUNT, FAIL, "unable to increment hard link count") @@ -232,6 +238,10 @@ H5F_super_ext_close(H5F_t *f, H5O_loc_t *ext_ptr, hid_t dxpl_id, f->nopen_objs--; done: + /* Reset the ring in the DXPL */ + if(H5AC_reset_ring(dxpl, orig_ring) < 0) + HDONE_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "unable to set property value") + FUNC_LEAVE_NOAPI(ret_value) } /* H5F_super_ext_close() */ @@ -256,7 +266,8 @@ done: herr_t H5F__super_read(H5F_t *f, hid_t dxpl_id) { - H5P_genplist_t *dxpl; /* DXPL object */ + H5P_genplist_t *dxpl = NULL; /* DXPL object */ + H5AC_ring_t ring, orig_ring = H5AC_RING_INV; H5F_super_t * sblock = NULL; /* Superblock structure */ H5F_superblock_cache_ud_t udata; /* User data for cache callbacks */ H5P_genplist_t *c_plist; /* File creation property list */ @@ -276,6 +287,8 @@ H5F__super_read(H5F_t *f, hid_t dxpl_id) /* Get the DXPL plist object for DXPL ID */ if(NULL == (dxpl = (H5P_genplist_t *)H5I_object(dxpl_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get property list") + if((H5P_get(dxpl, H5AC_RING_NAME, &orig_ring)) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "unable to get property value"); /* Find the superblock */ if(H5FD_locate_signature(f->shared->lf, dxpl, &super_addr) < 0) @@ -320,6 +333,11 @@ H5F__super_read(H5F_t *f, hid_t dxpl_id) udata.stored_eof = HADDR_UNDEF; udata.drvrinfo_removed = FALSE; + /* Set the ring type in the DXPL */ + ring = H5AC_RING_SB; + if((H5P_set(dxpl, H5AC_RING_NAME, &ring)) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "unable to set property value"); + /* Look up the superblock */ if(NULL == (sblock = (H5F_super_t *)H5AC_protect(f, dxpl_id, H5AC_SUPERBLOCK, (haddr_t)0, &udata, rw_flags))) HGOTO_ERROR(H5E_FILE, H5E_CANTPROTECT, FAIL, "unable to load superblock") @@ -419,6 +437,11 @@ H5F__super_read(H5F_t *f, hid_t dxpl_id) * allocated so that it knows how to allocate additional memory. */ + /* Set the ring type in the DXPL */ + ring = H5AC_RING_SBE; + if((H5P_set(dxpl, H5AC_RING_NAME, &ring)) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "unable to set property value"); + /* Decode the optional driver information block */ if(H5F_addr_defined(sblock->driver_addr)) { H5O_drvinfo_t *drvinfo; /* Driver info */ @@ -647,6 +670,10 @@ H5F__super_read(H5F_t *f, hid_t dxpl_id) f->shared->sblock = sblock; done: + /* Reset the ring in the DXPL */ + if(H5AC_reset_ring(dxpl, orig_ring) < 0) + HDONE_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "unable to set property value") + /* Release the superblock */ if(sblock && H5AC_unprotect(f, dxpl_id, H5AC_SUPERBLOCK, (haddr_t)0, sblock, sblock_flags) < 0) HDONE_ERROR(H5E_FILE, H5E_CANTUNPROTECT, FAIL, "unable to close superblock") @@ -705,6 +732,8 @@ H5F__super_init(H5F_t *f, hid_t dxpl_id) H5O_drvinfo_t *drvinfo = NULL; /* Driver info */ hbool_t drvinfo_in_cache = FALSE; /* Whether the driver info block has been inserted into the metadata cache */ H5P_genplist_t *plist; /* File creation property list */ + H5P_genplist_t *dxpl = NULL; + H5AC_ring_t ring, orig_ring = H5AC_RING_INV; hsize_t userblock_size; /* Size of userblock, in bytes */ hsize_t superblock_size; /* Size of superblock, in bytes */ size_t driver_size; /* Size of driver info block (bytes) */ @@ -830,6 +859,10 @@ H5F__super_init(H5F_t *f, hid_t dxpl_id) if(H5F__set_eoa(f, H5FD_MEM_SUPER, superblock_size) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "unable to set EOA value for superblock") + /* Set the ring type in the DXPL */ + if(H5AC_set_ring(dxpl_id, H5AC_RING_SB, &dxpl, &orig_ring) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "unable to set ring value") + /* Insert superblock into cache, pinned */ if(H5AC_insert_entry(f, dxpl_id, H5AC_SUPERBLOCK, (haddr_t)0, sblock, H5AC__PIN_ENTRY_FLAG | H5AC__FLUSH_LAST_FLAG | H5AC__FLUSH_COLLECTIVELY_FLAG) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTINS, FAIL, "can't add superblock to cache") @@ -875,6 +908,11 @@ H5F__super_init(H5F_t *f, hid_t dxpl_id) else need_ext = FALSE; + /* Set the ring type in the DXPL */ + ring = H5AC_RING_SBE; + if((H5P_set(dxpl, H5AC_RING_NAME, &ring)) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "unable to set property value") + /* Create the superblock extension for "extra" superblock data, if necessary. */ if(need_ext) { /* The superblock extension isn't actually a group, but the @@ -976,6 +1014,10 @@ H5F__super_init(H5F_t *f, hid_t dxpl_id) } /* end if */ done: + /* Reset the ring in the DXPL */ + if(H5AC_reset_ring(dxpl, orig_ring) < 0) + HDONE_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "unable to set property value") + /* Close superblock extension, if it was created */ if(ext_created && H5F_super_ext_close(f, &ext_loc, dxpl_id, ext_created) < 0) HDONE_ERROR(H5E_FILE, H5E_CANTRELEASE, FAIL, "unable to close file's superblock extension") @@ -1114,6 +1156,8 @@ H5F__super_free(H5F_super_t *sblock) herr_t H5F__super_size(H5F_t *f, hid_t dxpl_id, hsize_t *super_size, hsize_t *super_ext_size) { + H5P_genplist_t *dxpl = NULL; /* DXPL for setting ring */ + H5AC_ring_t orig_ring = H5AC_RING_INV; /* Original ring value */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -1138,6 +1182,10 @@ H5F__super_size(H5F_t *f, hid_t dxpl_id, hsize_t *super_size, hsize_t *super_ext ext_loc.file = f; ext_loc.addr = f->shared->sblock->ext_addr; + /* Set the ring type in the DXPL */ + if(H5AC_set_ring(dxpl_id, H5AC_RING_SBE, &dxpl, &orig_ring) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "unable to set ring value") + /* Get object header info for superblock extension */ if(H5O_get_hdr_info(&ext_loc, dxpl_id, &hdr_info) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to retrieve superblock extension info") @@ -1151,6 +1199,10 @@ H5F__super_size(H5F_t *f, hid_t dxpl_id, hsize_t *super_size, hsize_t *super_ext } /* end if */ done: + /* Reset the ring in the DXPL */ + if(H5AC_reset_ring(dxpl, orig_ring) < 0) + HDONE_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "unable to set property value") + FUNC_LEAVE_NOAPI(ret_value) } /* H5F__super_size() */ @@ -1169,6 +1221,8 @@ done: herr_t H5F_super_ext_write_msg(H5F_t *f, hid_t dxpl_id, void *mesg, unsigned id, hbool_t may_create) { + H5P_genplist_t *dxpl = NULL; /* DXPL for setting ring */ + H5AC_ring_t orig_ring = H5AC_RING_INV; /* Original ring value */ hbool_t ext_created = FALSE; /* Whether superblock extension was created */ hbool_t ext_opened = FALSE; /* Whether superblock extension was opened */ H5O_loc_t ext_loc; /* "Object location" for superblock extension */ @@ -1182,6 +1236,10 @@ H5F_super_ext_write_msg(H5F_t *f, hid_t dxpl_id, void *mesg, unsigned id, hbool_ HDassert(f->shared); HDassert(f->shared->sblock); + /* Set the ring type in the DXPL */ + if(H5AC_set_ring(dxpl_id, H5AC_RING_SBE, &dxpl, &orig_ring) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "unable to set ring value") + /* Open/create the superblock extension object header */ if(H5F_addr_defined(f->shared->sblock->ext_addr)) { if(H5F_super_ext_open(f, f->shared->sblock->ext_addr, &ext_loc) < 0) @@ -1219,6 +1277,10 @@ H5F_super_ext_write_msg(H5F_t *f, hid_t dxpl_id, void *mesg, unsigned id, hbool_ } /* end else */ done: + /* Reset the ring in the DXPL */ + if(H5AC_reset_ring(dxpl, orig_ring) < 0) + HDONE_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "unable to set property value") + /* Close the superblock extension, if it was opened */ if(ext_opened && H5F_super_ext_close(f, &ext_loc, dxpl_id, ext_created) < 0) HDONE_ERROR(H5E_FILE, H5E_CANTRELEASE, FAIL, "unable to close file's superblock extension") @@ -1245,6 +1307,8 @@ done: herr_t H5F_super_ext_remove_msg(H5F_t *f, hid_t dxpl_id, unsigned id) { + H5P_genplist_t *dxpl = NULL; /* DXPL for setting ring */ + H5AC_ring_t orig_ring = H5AC_RING_INV; /* Original ring value */ H5O_loc_t ext_loc; /* "Object location" for superblock extension */ hbool_t ext_opened = FALSE; /* Whether the superblock extension was opened */ int null_count = 0; /* # of null messages */ @@ -1256,6 +1320,10 @@ H5F_super_ext_remove_msg(H5F_t *f, hid_t dxpl_id, unsigned id) /* Make sure that the superblock extension object header exists */ HDassert(H5F_addr_defined(f->shared->sblock->ext_addr)); + /* Set the ring type in the DXPL */ + if(H5AC_set_ring(dxpl_id, H5AC_RING_SBE, &dxpl, &orig_ring) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "unable to set ring value") + /* Open superblock extension object header */ if(H5F_super_ext_open(f, f->shared->sblock->ext_addr, &ext_loc) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTRELEASE, FAIL, "error in starting file's superblock extension") @@ -1289,6 +1357,10 @@ H5F_super_ext_remove_msg(H5F_t *f, hid_t dxpl_id, unsigned id) } /* end if */ done: + /* Reset the ring in the DXPL */ + if(H5AC_reset_ring(dxpl, orig_ring) < 0) + HDONE_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "unable to set property value") + /* Close superblock extension object header, if opened */ if(ext_opened && H5F_super_ext_close(f, &ext_loc, dxpl_id, FALSE) < 0) HDONE_ERROR(H5E_FILE, H5E_CANTRELEASE, FAIL, "unable to close file's superblock extension") diff --git a/src/H5Fsuper_cache.c b/src/H5Fsuper_cache.c index ac1f840..477f58f 100644 --- a/src/H5Fsuper_cache.c +++ b/src/H5Fsuper_cache.c @@ -515,6 +515,8 @@ H5F__cache_superblock_pre_serialize(const H5F_t *f, hid_t dxpl_id, size_t H5_ATTR_UNUSED *new_len, size_t H5_ATTR_UNUSED *new_compressed_len, unsigned H5_ATTR_UNUSED *flags) { + H5P_genplist_t *dxpl = NULL; /* DXPL for setting ring */ + H5AC_ring_t orig_ring = H5AC_RING_INV; /* Original ring value */ H5F_super_t *sblock = (H5F_super_t *)_thing; /* Pointer to the super block */ herr_t ret_value = SUCCEED; /* Return value */ @@ -562,6 +564,10 @@ H5F__cache_superblock_pre_serialize(const H5F_t *f, hid_t dxpl_id, if(H5FD_sb_encode(f->shared->lf, drvinfo.name, dbuf) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "unable to encode driver information") + /* Set the ring type in the DXPL */ + if(H5AC_set_ring(dxpl_id, H5AC_RING_SBE, &dxpl, &orig_ring) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "unable to set ring value") + /* Write driver info information to the superblock extension */ drvinfo.len = driver_size; drvinfo.buf = dbuf; @@ -577,6 +583,10 @@ H5F__cache_superblock_pre_serialize(const H5F_t *f, hid_t dxpl_id, } /* end if */ done: + /* Reset the ring in the DXPL */ + if(H5AC_reset_ring(dxpl, orig_ring) < 0) + HDONE_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "unable to set property value") + FUNC_LEAVE_NOAPI(ret_value) } /* end H5FS_cache_superblock_pre_serialize() */ diff --git a/src/H5MF.c b/src/H5MF.c index 0c98654..8a227d7 100644 --- a/src/H5MF.c +++ b/src/H5MF.c @@ -237,6 +237,8 @@ H5MF_alloc_open(H5F_t *f, hid_t dxpl_id, H5FD_mem_t type) { const H5FS_section_class_t *classes[] = { /* Free space section classes implemented for file */ H5MF_FSPACE_SECT_CLS_SIMPLE}; + H5P_genplist_t *dxpl = NULL; /* DXPL for setting ring */ + H5AC_ring_t orig_ring = H5AC_RING_INV; /* Original ring value */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -250,6 +252,10 @@ H5MF_alloc_open(H5F_t *f, hid_t dxpl_id, H5FD_mem_t type) HDassert(H5F_addr_defined(f->shared->fs_addr[type])); HDassert(f->shared->fs_state[type] == H5F_FS_STATE_CLOSED); + /* Set the ring type in the DXPL */ + if(H5AC_set_ring(dxpl_id, H5AC_RING_FSM, &dxpl, &orig_ring) < 0) + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSET, FAIL, "unable to set ring value") + /* Open an existing free space structure for the file */ if(NULL == (f->shared->fs_man[type] = H5FS_open(f, dxpl_id, f->shared->fs_addr[type], NELMTS(classes), classes, f, f->shared->alignment, f->shared->threshold))) @@ -260,6 +266,10 @@ H5MF_alloc_open(H5F_t *f, hid_t dxpl_id, H5FD_mem_t type) f->shared->fs_state[type] = H5F_FS_STATE_OPEN; done: + /* Reset the ring in the DXPL */ + if(H5AC_reset_ring(dxpl, orig_ring) < 0) + HDONE_ERROR(H5E_RESOURCE, H5E_CANTSET, FAIL, "unable to set property value") + FUNC_LEAVE_NOAPI(ret_value) } /* end H5MF_alloc_open() */ @@ -423,6 +433,8 @@ done: haddr_t H5MF_alloc(H5F_t *f, H5FD_mem_t alloc_type, hid_t dxpl_id, hsize_t size) { + H5P_genplist_t *dxpl = NULL; /* DXPL for setting ring */ + H5AC_ring_t orig_ring = H5AC_RING_INV; /* Original ring value */ H5FD_mem_t fs_type; /* Free space type (mapped from allocation type) */ haddr_t ret_value; /* Return value */ @@ -440,6 +452,10 @@ HDfprintf(stderr, "%s: alloc_type = %u, size = %Hu\n", FUNC, (unsigned)alloc_typ /* Get free space type from allocation type */ fs_type = H5MF_ALLOC_TO_FS_TYPE(f, alloc_type); + /* Set the ring type in the DXPL */ + if(H5AC_set_ring(dxpl_id, H5AC_RING_FSM, &dxpl, &orig_ring) < 0) + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSET, HADDR_UNDEF, "unable to set ring value") + /* Check if we are using the free space manager for this file */ if(H5F_HAVE_FREE_SPACE_MANAGER(f)) { /* Check if the free space manager for the file has been initialized */ @@ -512,6 +528,10 @@ HDfprintf(stderr, "%s: Check 2.0\n", FUNC); HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, HADDR_UNDEF, "allocation failed from aggr/vfd") done: + /* Reset the ring in the DXPL */ + if(H5AC_reset_ring(dxpl, orig_ring) < 0) + HDONE_ERROR(H5E_RESOURCE, H5E_CANTSET, HADDR_UNDEF, "unable to set property value") + #ifdef H5MF_ALLOC_DEBUG HDfprintf(stderr, "%s: Leaving: ret_value = %a, size = %Hu\n", FUNC, ret_value, size); #endif /* H5MF_ALLOC_DEBUG */ @@ -604,6 +624,8 @@ H5MF_xfree(const H5F_t *f, H5FD_mem_t alloc_type, hid_t dxpl_id, haddr_t addr, H5F_io_info_t fio_info; /* I/O info for operation */ H5MF_free_section_t *node = NULL; /* Free space section pointer */ H5MF_sect_ud_t udata; /* User data for callback */ + H5P_genplist_t *dxpl = NULL; /* DXPL for setting ring */ + H5AC_ring_t orig_ring = H5AC_RING_INV; /* Original ring value */ H5FD_mem_t fs_type; /* Free space type (mapped from allocation type) */ herr_t ret_value = SUCCEED; /* Return value */ @@ -622,6 +644,10 @@ HDfprintf(stderr, "%s: Entering - alloc_type = %u, addr = %a, size = %Hu\n", FUN if(H5F_addr_le(f->shared->tmp_addr, addr)) HGOTO_ERROR(H5E_RESOURCE, H5E_BADRANGE, FAIL, "attempting to free temporary file space") + /* Set the ring type in the DXPL */ + if(H5AC_set_ring(dxpl_id, H5AC_RING_FSM, &dxpl, &orig_ring) < 0) + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSET, FAIL, "unable to set ring value") + /* Set up I/O info for operation */ fio_info.f = f; if(NULL == (fio_info.dxpl = (H5P_genplist_t *)H5I_object(dxpl_id))) @@ -729,6 +755,10 @@ HDfprintf(stderr, "%s: After H5FS_sect_add()\n", FUNC); } /* end else */ done: + /* Reset the ring in the DXPL */ + if(H5AC_reset_ring(dxpl, orig_ring) < 0) + HDONE_ERROR(H5E_RESOURCE, H5E_CANTSET, FAIL, "unable to set property value") + /* Release section node, if allocated and not added to section list or merged */ if(node) if(H5MF_sect_simple_free((H5FS_section_info_t *)node) < 0) @@ -762,6 +792,8 @@ htri_t H5MF_try_extend(H5F_t *f, hid_t dxpl_id, H5FD_mem_t alloc_type, haddr_t addr, hsize_t size, hsize_t extra_requested) { + H5P_genplist_t *dxpl = NULL; /* DXPL for setting ring */ + H5AC_ring_t orig_ring = H5AC_RING_INV; /* Original ring value */ haddr_t end; /* End of block to extend */ H5FD_mem_t map_type; /* Mapped type */ htri_t ret_value; /* Return value */ @@ -781,6 +813,10 @@ HDfprintf(stderr, "%s: Entering: alloc_type = %u, addr = %a, size = %Hu, extra_r /* Compute end of block to extend */ end = addr + size; + /* Set the ring type in the DXPL */ + if(H5AC_set_ring(dxpl_id, H5AC_RING_FSM, &dxpl, &orig_ring) < 0) + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSET, FAIL, "unable to set ring value") + /* Check if the block is exactly at the end of the file */ if((ret_value = H5FD_try_extend(f->shared->lf, map_type, f, end, extra_requested)) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTEXTEND, FAIL, "error extending file") @@ -810,6 +846,10 @@ HDfprintf(stderr, "%s: Entering: alloc_type = %u, addr = %a, size = %Hu, extra_r } /* end if */ done: + /* Reset the ring in the DXPL */ + if(H5AC_reset_ring(dxpl, orig_ring) < 0) + HDONE_ERROR(H5E_RESOURCE, H5E_CANTSET, FAIL, "unable to set property value") + #ifdef H5MF_ALLOC_DEBUG HDfprintf(stderr, "%s: Leaving: ret_value = %t\n", FUNC, ret_value); #endif /* H5MF_ALLOC_DEBUG */ @@ -842,6 +882,8 @@ H5MF_sects_dump(f, dxpl_id, stderr); herr_t H5MF_get_freespace(H5F_t *f, hid_t dxpl_id, hsize_t *tot_space, hsize_t *meta_size) { + H5P_genplist_t *dxpl = NULL; /* DXPL for setting ring */ + H5AC_ring_t orig_ring = H5AC_RING_INV; /* Original ring value */ haddr_t eoa; /* End of allocated space in the file */ haddr_t ma_addr = HADDR_UNDEF; /* Base "metadata aggregator" address */ hsize_t ma_size = 0; /* Size of "metadata aggregator" */ @@ -865,6 +907,10 @@ H5MF_get_freespace(H5F_t *f, hid_t dxpl_id, hsize_t *tot_space, hsize_t *meta_si if(HADDR_UNDEF == (eoa = H5F_get_eoa(f, H5FD_MEM_DEFAULT))) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGET, FAIL, "driver get_eoa request failed") + /* Set the ring type in the DXPL */ + if(H5AC_set_ring(dxpl_id, H5AC_RING_FSM, &dxpl, &orig_ring) < 0) + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSET, FAIL, "unable to set ring value") + /* Retrieve metadata aggregator info, if available */ if(H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGET, FAIL, "can't query metadata aggregator stats") @@ -953,6 +999,10 @@ H5MF_get_freespace(H5F_t *f, hid_t dxpl_id, hsize_t *tot_space, hsize_t *meta_si *meta_size = tot_meta_size; done: + /* Reset the ring in the DXPL */ + if(H5AC_reset_ring(dxpl, orig_ring) < 0) + HDONE_ERROR(H5E_RESOURCE, H5E_CANTSET, FAIL, "unable to set property value") + FUNC_LEAVE_NOAPI(ret_value) } /* end H5MF_get_freespace() */ @@ -977,6 +1027,8 @@ H5MF_try_shrink(H5F_t *f, H5FD_mem_t alloc_type, hid_t dxpl_id, haddr_t addr, { H5MF_free_section_t *node = NULL; /* Free space section pointer */ H5MF_sect_ud_t udata; /* User data for callback */ + H5P_genplist_t *dxpl = NULL; /* DXPL for setting ring */ + H5AC_ring_t orig_ring = H5AC_RING_INV; /* Original ring value */ htri_t ret_value; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -991,6 +1043,10 @@ HDfprintf(stderr, "%s: Entering - alloc_type = %u, addr = %a, size = %Hu\n", FUN HDassert(H5F_addr_defined(addr)); HDassert(size > 0); + /* Set the ring type in the DXPL */ + if(H5AC_set_ring(dxpl_id, H5AC_RING_FSM, &dxpl, &orig_ring) < 0) + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSET, FAIL, "unable to set ring value") + /* Create free space section for block */ if(NULL == (node = H5MF_sect_simple_new(addr, size))) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, FAIL, "can't initialize free space section") @@ -1012,6 +1068,10 @@ HDfprintf(stderr, "%s: Entering - alloc_type = %u, addr = %a, size = %Hu\n", FUN } /* end if */ done: + /* Reset the ring in the DXPL */ + if(H5AC_reset_ring(dxpl, orig_ring) < 0) + HDONE_ERROR(H5E_RESOURCE, H5E_CANTSET, FAIL, "unable to set property value") + /* Free section node allocated */ if(node && H5MF_sect_simple_free((H5FS_section_info_t *)node) < 0) HDONE_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, FAIL, "can't free simple section node") @@ -1104,6 +1164,8 @@ done: herr_t H5MF_close(H5F_t *f, hid_t dxpl_id) { + H5P_genplist_t *dxpl = NULL; /* DXPL for setting ring */ + H5AC_ring_t orig_ring = H5AC_RING_INV; /* Original ring value */ H5FD_mem_t type; /* Memory type for iteration */ herr_t ret_value = SUCCEED; /* Return value */ @@ -1118,6 +1180,10 @@ HDfprintf(stderr, "%s: Entering\n", FUNC); HDassert(f->shared->lf); HDassert(f->shared->sblock); + /* Set the ring type in the DXPL */ + if(H5AC_set_ring(dxpl_id, H5AC_RING_FSM, &dxpl, &orig_ring) < 0) + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSET, FAIL, "unable to set ring value") + /* Free the space in aggregators */ /* (for space not at EOF, it may be put into free space managers) */ if(H5MF_free_aggrs(f, dxpl_id) < 0) @@ -1280,6 +1346,10 @@ HDfprintf(stderr, "%s: Before deleting free space manager\n", FUNC); HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSHRINK, FAIL, "can't shrink eoa") done: + /* Reset the ring in the DXPL */ + if(H5AC_reset_ring(dxpl, orig_ring) < 0) + HDONE_ERROR(H5E_RESOURCE, H5E_CANTSET, FAIL, "unable to set property value") + #ifdef H5MF_ALLOC_DEBUG HDfprintf(stderr, "%s: Leaving\n", FUNC); #endif /* H5MF_ALLOC_DEBUG */ @@ -1337,6 +1407,8 @@ H5MF_get_free_sections(H5F_t *f, hid_t dxpl_id, H5FD_mem_t type, size_t nsects, { size_t total_sects = 0; /* total number of sections */ H5MF_sect_iter_ud_t sect_udata; /* User data for callback */ + H5P_genplist_t *dxpl = NULL; /* DXPL for setting ring */ + H5AC_ring_t orig_ring = H5AC_RING_INV; /* Original ring value */ H5FD_mem_t start_type, end_type; /* Memory types to iterate over */ H5FD_mem_t ty; /* Memory type for iteration */ ssize_t ret_value; /* Return value */ @@ -1363,6 +1435,10 @@ H5MF_get_free_sections(H5F_t *f, hid_t dxpl_id, H5FD_mem_t type, size_t nsects, sect_udata.sect_count = nsects; sect_udata.sect_idx = 0; + /* Set the ring type in the DXPL */ + if(H5AC_set_ring(dxpl_id, H5AC_RING_FSM, &dxpl, &orig_ring) < 0) + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSET, FAIL, "unable to set ring value") + /* Iterate over memory types, retrieving the number of sections of each type */ for(ty = start_type; ty < end_type; H5_INC_ENUM(H5FD_mem_t, ty)) { hbool_t fs_started = FALSE; @@ -1406,6 +1482,10 @@ H5MF_get_free_sections(H5F_t *f, hid_t dxpl_id, H5FD_mem_t type, size_t nsects, ret_value = (ssize_t)total_sects; done: + /* Reset the ring in the DXPL */ + if(H5AC_reset_ring(dxpl, orig_ring) < 0) + HDONE_ERROR(H5E_RESOURCE, H5E_CANTSET, FAIL, "unable to set property value") + FUNC_LEAVE_NOAPI(ret_value) } /* H5MF_get_free_sections() */ diff --git a/src/H5Pdxpl.c b/src/H5Pdxpl.c index cea94e3..980b001 100644 --- a/src/H5Pdxpl.c +++ b/src/H5Pdxpl.c @@ -167,6 +167,11 @@ #define H5D_XFER_DIRECT_CHUNK_WRITE_OFFSET_DEF NULL #define H5D_XFER_DIRECT_CHUNK_WRITE_DATASIZE_SIZE sizeof(uint32_t) #define H5D_XFER_DIRECT_CHUNK_WRITE_DATASIZE_DEF 0 +/* Ring type - private property */ +#define H5AC_XFER_RING_SIZE sizeof(unsigned) +#define H5AC_XFER_RING_DEF H5AC_RING_US +#define H5AC_XFER_RING_ENC H5P__encode_unsigned +#define H5AC_XFER_RING_DEC H5P__decode_unsigned /******************/ /* Local Typedefs */ @@ -271,6 +276,7 @@ static const hbool_t H5D_def_direct_chunk_flag_g = H5D_XFER_DIRECT_CHUNK_WRITE_F static const uint32_t H5D_def_direct_chunk_filters_g = H5D_XFER_DIRECT_CHUNK_WRITE_FILTERS_DEF; /* Default value for the filters of direct chunk write */ static const hsize_t *H5D_def_direct_chunk_offset_g = H5D_XFER_DIRECT_CHUNK_WRITE_OFFSET_DEF; /* Default value for the offset of direct chunk write */ static const uint32_t H5D_def_direct_chunk_datasize_g = H5D_XFER_DIRECT_CHUNK_WRITE_DATASIZE_DEF; /* Default value for the datasize of direct chunk write */ +static const H5AC_ring_t H5D_ring_g = H5AC_XFER_RING_DEF; /* Default value for the cache entry ring type */ /*------------------------------------------------------------------------- @@ -465,6 +471,12 @@ H5P__dxfr_reg_prop(H5P_genclass_t *pclass) NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") + /* Register the data transform property */ + if(H5P_register_real(pclass, H5AC_RING_NAME, H5AC_XFER_RING_SIZE, &H5D_ring_g, + NULL, NULL, NULL, H5AC_XFER_RING_ENC, H5AC_XFER_RING_DEC, + NULL, NULL, NULL, NULL) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") + done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__dxfr_reg_prop() */ diff --git a/src/H5SM.c b/src/H5SM.c index 1fc3b85..0ed4fbf 100644 --- a/src/H5SM.c +++ b/src/H5SM.c @@ -122,6 +122,8 @@ H5SM_init(H5F_t *f, H5P_genplist_t * fc_plist, const H5O_loc_t *ext_loc, hid_t d { H5O_shmesg_table_t sohm_table; /* SOHM message for superblock extension */ H5SM_master_table_t *table = NULL; /* SOHM master table for file */ + H5P_genplist_t *dxpl = NULL; /* DXPL for setting ring */ + H5AC_ring_t ring, orig_ring = H5AC_RING_INV; /* Original ring value */ haddr_t table_addr = HADDR_UNDEF; /* Address of SOHM master table in file */ unsigned list_max, btree_min; /* Phase change limits for SOHM indices */ unsigned index_type_flags[H5O_SHMESG_MAX_NINDEXES]; /* Messages types stored in each index */ @@ -136,6 +138,10 @@ H5SM_init(H5F_t *f, H5P_genplist_t * fc_plist, const H5O_loc_t *ext_loc, hid_t d /* File should not already have a SOHM table */ HDassert(!H5F_addr_defined(H5F_SOHM_ADDR(f))); + /* Set the ring type in the DXPL */ + if(H5AC_set_ring(dxpl_id, H5AC_RING_US, &dxpl, &orig_ring) < 0) + HGOTO_ERROR(H5E_SOHM, H5E_CANTSET, FAIL, "unable to set ring value") + /* Initialize master table */ if(NULL == (table = H5FL_MALLOC(H5SM_master_table_t))) HGOTO_ERROR(H5E_SOHM, H5E_CANTALLOC, FAIL, "memory allocation failed for SOHM table") @@ -220,6 +226,11 @@ H5SM_init(H5F_t *f, H5P_genplist_t * fc_plist, const H5O_loc_t *ext_loc, hid_t d if(type_flags_used & H5O_SHMESG_ATTR_FLAG) H5F_SET_STORE_MSG_CRT_IDX(f, TRUE); + /* Set the ring type to superblock extension */ + ring = H5AC_RING_SBE; + if((H5P_set(dxpl, H5AC_RING_NAME, &ring)) < 0) + HGOTO_ERROR(H5E_SOHM, H5E_CANTSET, FAIL, "unable to set property value") + /* Write shared message information to the superblock extension */ sohm_table.addr = H5F_SOHM_ADDR(f); sohm_table.version = H5F_SOHM_VERS(f); @@ -228,6 +239,10 @@ H5SM_init(H5F_t *f, H5P_genplist_t * fc_plist, const H5O_loc_t *ext_loc, hid_t d HGOTO_ERROR(H5E_SOHM, H5E_CANTINIT, FAIL, "unable to update SOHM header message") done: + /* Reset the ring in the DXPL */ + if(H5AC_reset_ring(dxpl, orig_ring) < 0) + HDONE_ERROR(H5E_SOHM, H5E_CANTSET, FAIL, "unable to set property value") + if(ret_value < 0) { if(table_addr != HADDR_UNDEF) H5MF_xfree(f, H5FD_MEM_SOHM_TABLE, dxpl_id, table_addr, (hsize_t)table->table_size); @@ -1929,6 +1944,8 @@ H5SM_get_info(const H5O_loc_t *ext_loc, H5P_genplist_t *fc_plist, hid_t dxpl_id) H5F_t *f = ext_loc->file; /* File pointer (convenience variable) */ H5O_shmesg_table_t sohm_table; /* SOHM message from superblock extension */ H5SM_master_table_t *table = NULL; /* SOHM master table */ + H5P_genplist_t *dxpl = NULL; /* DXPL for setting ring */ + H5AC_ring_t orig_ring = H5AC_RING_INV; /* Original ring value */ unsigned tmp_sohm_nindexes; /* Number of shared messages indexes in the table */ htri_t status; /* Status for message existing */ herr_t ret_value = SUCCEED; /* Return value */ @@ -1969,6 +1986,10 @@ H5SM_get_info(const H5O_loc_t *ext_loc, H5P_genplist_t *fc_plist, hid_t dxpl_id) /* Set up user data for callback */ cache_udata.f = f; + /* Set the ring type in the DXPL */ + if(H5AC_set_ring(dxpl_id, H5AC_RING_US, &dxpl, &orig_ring) < 0) + HGOTO_ERROR(H5E_SOHM, H5E_CANTSET, FAIL, "unable to set ring value") + /* Read the rest of the SOHM table information from the cache */ if(NULL == (table = (H5SM_master_table_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), &cache_udata, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_SOHM, H5E_CANTPROTECT, FAIL, "unable to load SOHM master table") @@ -2020,6 +2041,10 @@ H5SM_get_info(const H5O_loc_t *ext_loc, H5P_genplist_t *fc_plist, hid_t dxpl_id) } /* end else */ done: + /* Reset the ring in the DXPL */ + if(H5AC_reset_ring(dxpl, orig_ring) < 0) + HDONE_ERROR(H5E_SOHM, H5E_CANTSET, FAIL, "unable to set property value") + /* Release the master SOHM table if we took it out of the cache */ if(table && H5AC_unprotect(f, dxpl_id, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), table, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_SOHM, H5E_CANTUNPROTECT, FAIL, "unable to close SOHM master table") diff --git a/test/cache_common.c b/test/cache_common.c index f3da908..a3287cf 100644 --- a/test/cache_common.c +++ b/test/cache_common.c @@ -3061,7 +3061,7 @@ setup_cache(size_t max_cache_size, if ( pass ) { /* allocate space for test entries */ - actual_base_addr = H5MF_alloc(file_ptr, H5FD_MEM_DEFAULT, H5P_DEFAULT, + actual_base_addr = H5MF_alloc(file_ptr, H5FD_MEM_DEFAULT, H5P_DATASET_XFER_DEFAULT, (hsize_t)(ADDR_SPACE_SIZE + BASE_ADDR)); if ( actual_base_addr == HADDR_UNDEF ) { @@ -3171,7 +3171,7 @@ takedown_cache(H5F_t * file_ptr, HDassert ( file_ptr ); } - H5MF_xfree(file_ptr, H5FD_MEM_DEFAULT, H5P_DEFAULT, saved_actual_base_addr, + H5MF_xfree(file_ptr, H5FD_MEM_DEFAULT, H5P_DATASET_XFER_DEFAULT, saved_actual_base_addr, (hsize_t)(ADDR_SPACE_SIZE + BASE_ADDR)); saved_actual_base_addr = HADDR_UNDEF; } diff --git a/testpar/t_cache.c b/testpar/t_cache.c index bb1ccc6..42788f4 100644 --- a/testpar/t_cache.c +++ b/testpar/t_cache.c @@ -4202,7 +4202,7 @@ setup_cache_for_test(hid_t * fid_ptr, */ if ( success ) { /* allocate space for test entries */ - actual_base_addr = H5MF_alloc(file_ptr, H5FD_MEM_DEFAULT, H5P_DEFAULT, + actual_base_addr = H5MF_alloc(file_ptr, H5FD_MEM_DEFAULT, H5P_DATASET_XFER_DEFAULT, (hsize_t)(max_addr + BASE_ADDR)); if ( actual_base_addr == HADDR_UNDEF ) { -- cgit v0.12 From 129334f04be0ce39a21ffc06738224a5fd5c6bec Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 9 Sep 2015 09:58:44 -0500 Subject: [svn-r27716] Publish both static and shared mod files in binaries. --- config/cmake/hdf5-config.cmake.in | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/config/cmake/hdf5-config.cmake.in b/config/cmake/hdf5-config.cmake.in index adeec55..3577e40 100644 --- a/config/cmake/hdf5-config.cmake.in +++ b/config/cmake/hdf5-config.cmake.in @@ -48,10 +48,6 @@ set (${HDF5_PACKAGE_NAME}_INCLUDE_DIR "@PACKAGE_INCLUDE_INSTALL_DIR@" "${${HDF5_ set (${HDF5_PACKAGE_NAME}_SHARE_DIR "@PACKAGE_SHARE_INSTALL_DIR@") set_and_check (${HDF5_PACKAGE_NAME}_BUILD_DIR "@PACKAGE_CURRENT_BUILD_DIR@") -if (${HDF5_PACKAGE_NAME}_BUILD_FORTRAN) - set (${HDF5_PACKAGE_NAME}_INCLUDE_DIR_FORTRAN "@PACKAGE_INCLUDE_INSTALL_DIR@") -endif () - if (${HDF5_PACKAGE_NAME}_BUILD_CPP_LIB) set (${HDF5_PACKAGE_NAME}_INCLUDE_DIR_CPP "@PACKAGE_INCLUDE_INSTALL_DIR@") endif () @@ -103,9 +99,17 @@ foreach (comp IN LISTS ${HDF5_PACKAGE_NAME}_FIND_COMPONENTS) if (${comp} STREQUAL "shared") list (REMOVE_ITEM ${HDF5_PACKAGE_NAME}_FIND_COMPONENTS ${comp}) set (${HDF5_PACKAGE_NAME}_LIB_TYPE ${${HDF5_PACKAGE_NAME}_LIB_TYPE} ${comp}) + + if (${HDF5_PACKAGE_NAME}_BUILD_FORTRAN) + set (${HDF5_PACKAGE_NAME}_INCLUDE_DIR_FORTRAN "@PACKAGE_INCLUDE_INSTALL_DIR@/shared") + endif () elseif (${comp} STREQUAL "static") list (REMOVE_ITEM ${HDF5_PACKAGE_NAME}_FIND_COMPONENTS ${comp}) set (${HDF5_PACKAGE_NAME}_LIB_TYPE ${${HDF5_PACKAGE_NAME}_LIB_TYPE} ${comp}) + + if (${HDF5_PACKAGE_NAME}_BUILD_FORTRAN) + set (${HDF5_PACKAGE_NAME}_INCLUDE_DIR_FORTRAN "@PACKAGE_INCLUDE_INSTALL_DIR@/static") + endif () endif () endforeach () foreach (libtype IN LISTS ${HDF5_PACKAGE_NAME}_LIB_TYPE) @@ -128,12 +132,12 @@ foreach (libtype IN LISTS ${HDF5_PACKAGE_NAME}_LIB_TYPE) set (hdf5_comp2 "hdf5_hl_f90cstub") set (hdf5_comp "hdf5_hl_fortran") endif () - list (FIND ${HDF5_PACKAGE_NAME}_EXPORT_LIBRARIES "${hdf5_comp}-${libtype}" HAVE_COMP) - if (${HAVE_COMP} LESS 0) + list (FIND ${HDF5_PACKAGE_NAME}_EXPORT_LIBRARIES "${hdf5_comp}-${libtype}" HAVE_COMP) + if (${HAVE_COMP} LESS 0) set (${HDF5_PACKAGE_NAME}_${libtype}_${comp}_FOUND 0) else () if (hdf5_comp2) - list (FIND ${HDF5_PACKAGE_NAME}_EXPORT_LIBRARIES "${hdf5_comp2}-${libtype}" HAVE_COMP2) + list (FIND ${HDF5_PACKAGE_NAME}_EXPORT_LIBRARIES "${hdf5_comp2}-${libtype}" HAVE_COMP2) if (${HAVE_COMP2} LESS 0) set (${HDF5_PACKAGE_NAME}_${libtype}_${comp}_FOUND 0) else () -- cgit v0.12 From d9d02bf84713181b8d2cbafdbc65e83fca70e237 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 9 Sep 2015 10:15:43 -0500 Subject: [svn-r27720] Merge changes from master --- config/cmake_ext_mod/HDFMacros.cmake | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/config/cmake_ext_mod/HDFMacros.cmake b/config/cmake_ext_mod/HDFMacros.cmake index d3ac36b..b2c4997 100644 --- a/config/cmake_ext_mod/HDFMacros.cmake +++ b/config/cmake_ext_mod/HDFMacros.cmake @@ -20,7 +20,7 @@ endmacro (IDE_GENERATED_PROPERTIES) macro (IDE_SOURCE_PROPERTIES SOURCE_PATH HEADERS SOURCES) # install (FILES ${HEADERS} # DESTINATION include/R3D/${NAME} - # COMPONENT Headers + # COMPONENT Headers # ) string (REPLACE "/" "\\\\" source_group_path ${SOURCE_PATH} ) @@ -90,7 +90,7 @@ macro (HDF_SET_LIB_OPTIONS libtarget libname libtype) set (LIB_DEBUG_NAME "${libname}_debug") endif (WIN32) endif (${libtype} MATCHES "SHARED") - + set_target_properties (${libtarget} PROPERTIES OUTPUT_NAME_DEBUG ${LIB_DEBUG_NAME} @@ -98,7 +98,7 @@ macro (HDF_SET_LIB_OPTIONS libtarget libname libtype) OUTPUT_NAME_MINSIZEREL ${LIB_RELEASE_NAME} OUTPUT_NAME_RELWITHDEBINFO ${LIB_RELEASE_NAME} ) - + #----- Use MSVC Naming conventions for Shared Libraries if (MINGW AND ${libtype} MATCHES "SHARED") set_target_properties (${libtarget} @@ -176,7 +176,7 @@ macro (TARGET_C_PROPERTIES wintarget libtype addcompileflags addlinkflags) PROPERTIES COMPILE_FLAGS "${addcompileflags}" LINK_FLAGS "${addlinkflags}" - ) + ) endif (MSVC) endmacro (TARGET_C_PROPERTIES) @@ -187,7 +187,7 @@ macro (TARGET_MSVC_PROPERTIES wintarget libtype addcompileflags addlinkflags) PROPERTIES COMPILE_FLAGS "${addcompileflags}" LINK_FLAGS "${addlinkflags}" - ) + ) endif (MSVC) endmacro (TARGET_MSVC_PROPERTIES) @@ -206,13 +206,13 @@ macro (TARGET_FORTRAN_WIN_PROPERTIES forttarget libtype addcompileflags addlinkf PROPERTIES COMPILE_FLAGS "/dll ${addcompileflags}" LINK_FLAGS "/SUBSYSTEM:CONSOLE ${addlinkflags}" - ) + ) else (${libtype} MATCHES "SHARED") set_target_properties (${forttarget} PROPERTIES COMPILE_FLAGS "${addcompileflags}" LINK_FLAGS "/SUBSYSTEM:CONSOLE ${addlinkflags}" - ) + ) endif (${libtype} MATCHES "SHARED") endif (MSVC) endmacro (TARGET_FORTRAN_WIN_PROPERTIES) @@ -235,6 +235,8 @@ macro (HDF_README_PROPERTIES target_fortran) set (BINARY_PLATFORM "${BINARY_PLATFORM} 7") elseif (${CMAKE_SYSTEM_VERSION} MATCHES "6.2") set (BINARY_PLATFORM "${BINARY_PLATFORM} 8") + elseif (${CMAKE_SYSTEM_VERSION} MATCHES "6.3") + set (BINARY_PLATFORM "${BINARY_PLATFORM} 10") endif (${CMAKE_SYSTEM_VERSION} MATCHES "6.1") set (BINARY_PLATFORM "${BINARY_PLATFORM} ${MSVC_C_ARCHITECTURE_ID}") if (${CMAKE_C_COMPILER_VERSION} MATCHES "16.*") @@ -245,6 +247,8 @@ macro (HDF_README_PROPERTIES target_fortran) set (BINARY_PLATFORM "${BINARY_PLATFORM}, using VISUAL STUDIO 2012") elseif (${CMAKE_C_COMPILER_VERSION} MATCHES "18.*") set (BINARY_PLATFORM "${BINARY_PLATFORM}, using VISUAL STUDIO 2013") + elseif (${CMAKE_C_COMPILER_VERSION} MATCHES "19.*") + set (BINARY_PLATFORM "${BINARY_PLATFORM}, using VISUAL STUDIO 2015") else (${CMAKE_C_COMPILER_VERSION} MATCHES "16.*") set (BINARY_PLATFORM "${BINARY_PLATFORM}, using VISUAL STUDIO ${CMAKE_C_COMPILER_VERSION}") endif (${CMAKE_C_COMPILER_VERSION} MATCHES "16.*") @@ -269,9 +273,9 @@ macro (HDF_README_PROPERTIES target_fortran) else (BUILD_SHARED_LIBS) set (LIB_TYPE "Static") endif (BUILD_SHARED_LIBS) - + configure_file ( - ${HDF_RESOURCES_DIR}/README.txt.cmake.in + ${HDF_RESOURCES_DIR}/README.txt.cmake.in ${CMAKE_BINARY_DIR}/README.txt @ONLY ) endmacro (HDF_README_PROPERTIES) -- cgit v0.12 From 9ac201d01a1fe4e990ca9ab4277eb1245f3bfb0d Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Wed, 9 Sep 2015 12:24:12 -0500 Subject: [svn-r27722] Updated the gnu config to cover gcc 5.2*. Tested on: jam w/ gcc 5.2.0 --- config/gnu-flags | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/gnu-flags b/config/gnu-flags index 5f10519..e7f8f14 100644 --- a/config/gnu-flags +++ b/config/gnu-flags @@ -144,7 +144,7 @@ case "$cc_vendor-$cc_version" in # Closer to the gcc 5.2 release, we should check for additional flags to # include and break it out into it's own section, like the other versions # below. -QAK - gcc-5.1*) + gcc-5*) # Append warning flags # Don't use the '-Wtraditional' flag, we're way past having K&R C code # H5_CFLAGS="$H5_CFLAGS -Wtraditional" -- cgit v0.12 From 08ce739cdaf85496fe23388ed00bfe3e78309f31 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Wed, 9 Sep 2015 16:04:14 -0500 Subject: [svn-r27728] Merge of r27713 from revise_chunks Added -qflag=w:w to config/ibm-flags. This will suppress informational messages on AIX, suppressing thousands of "__attribute__ is non-portable" messages in the AIX nightly test output. Tested on: Nothing. I have no access to an AIX machine. --- config/ibm-flags | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/ibm-flags b/config/ibm-flags index a1dfa2a..89a6ae9 100644 --- a/config/ibm-flags +++ b/config/ibm-flags @@ -57,7 +57,7 @@ if test "XL" = "$cc_vendor"; then enable_shared="${enable_shared:-no}" # Make sure this is applied to other API compile options such as C++. AM_CFLAGS="$AM_CFLAGS" - H5_CFLAGS="-qlanglvl=stdc99 $H5_CFLAGS" + H5_CFLAGS="-qlanglvl=stdc99 -qflag=w:w $H5_CFLAGS" DEBUG_CFLAGS="-g -qfullpath" DEBUG_CPPFLAGS= # -O causes test/dtypes to fail badly. Turn it off for now. -- cgit v0.12 From 897b7308f5c236ee90c3237c7b85f69bee283c68 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Wed, 9 Sep 2015 21:05:35 -0500 Subject: [svn-r27731] Removed the obsolete config/powerpc-ibm-aix5.x file. Tested on: Nothing. I have no access to an AIX machine. --- config/powerpc-ibm-aix5.x | 21 --------------------- 1 file changed, 21 deletions(-) delete mode 100644 config/powerpc-ibm-aix5.x diff --git a/config/powerpc-ibm-aix5.x b/config/powerpc-ibm-aix5.x deleted file mode 100644 index 50a4e8c..0000000 --- a/config/powerpc-ibm-aix5.x +++ /dev/null @@ -1,21 +0,0 @@ -# -*- shell-script -*- -# -# Copyright by The HDF Group. -# 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. - -# Configuration file for building on the IBM POWER AIX platforms. -# This file is part of the HDF5 build script. It is processed shortly -# after configure starts and defines, among other things, flags for -# the various compile modes. - -# Use the generic ibm-aix. -. $srcdir/config/ibm-aix -- cgit v0.12 From 27f9e67d1ee3805c8a5ec2a039bbc593d287cb48 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Wed, 9 Sep 2015 21:57:38 -0500 Subject: [svn-r27734] Fixed MANIFEST Tested on: bin/chkmanifest --- MANIFEST | 1 - 1 file changed, 1 deletion(-) diff --git a/MANIFEST b/MANIFEST index 6490071..0a66695 100644 --- a/MANIFEST +++ b/MANIFEST @@ -112,7 +112,6 @@ ./config/Makefile.am.blank ./config/pgi-fflags ./config/pgi-flags -./config/powerpc-ibm-aix5.x ./config/solaris ./config/x86_64-pc-cygwin -- cgit v0.12 From 8e3464d2d015facff227ac7719a963a1523968ae Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 10 Sep 2015 09:18:54 -0500 Subject: [svn-r27747] Correct name of target --- test/CMakeTests.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/CMakeTests.cmake b/test/CMakeTests.cmake index d666601..10f4ccf 100644 --- a/test/CMakeTests.cmake +++ b/test/CMakeTests.cmake @@ -731,7 +731,7 @@ if (BUILD_SHARED_LIBS) ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST-shared;HDF5TestExpress=${HDF_TEST_EXPRESS}" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST-shared ) - set_tests_properties (H5TEST-cache PROPERTIES TIMEOUT 2400) + set_tests_properties (H5TEST-shared-cache PROPERTIES TIMEOUT 2400) endif (NOT CYGWIN) #-- Adding test for cache_api -- cgit v0.12 From 95e0bd109f4c9c3d2cd5046c8eb43640845a98fe Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Thu, 10 Sep 2015 15:36:08 -0500 Subject: [svn-r27752] Merge of r27751 from 1.8 branch Added a comment to config/ibm-flags that describes the purpose of the -qflag=w:w compiler flag. Tested on: N/A (no access to AIX, comment only) --- config/ibm-flags | 3 +++ 1 file changed, 3 insertions(+) diff --git a/config/ibm-flags b/config/ibm-flags index 89a6ae9..462372d 100644 --- a/config/ibm-flags +++ b/config/ibm-flags @@ -57,6 +57,9 @@ if test "XL" = "$cc_vendor"; then enable_shared="${enable_shared:-no}" # Make sure this is applied to other API compile options such as C++. AM_CFLAGS="$AM_CFLAGS" + # -qflag=w:w makes the lowest level of reported compile issues to be "warning" + # instead of "information". This suppresses a very large number of messages + # concerning the portability of __inline__. H5_CFLAGS="-qlanglvl=stdc99 -qflag=w:w $H5_CFLAGS" DEBUG_CFLAGS="-g -qfullpath" DEBUG_CPPFLAGS= -- cgit v0.12 From 54d0a3694785431dee7a46cab56694cf6ba9bde2 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Thu, 10 Sep 2015 15:39:44 -0500 Subject: [svn-r27753] Removed duplicated attribute macro checks. Moved canonical attribute macro checks from src/H5api_adapt.h to H5private.h, which is where they belong anyway. Tested on: h5committest (manually inspected for attribute warnings) --- src/H5api_adpt.h | 22 ---------------------- src/H5private.h | 17 ++++++++++++++--- 2 files changed, 14 insertions(+), 25 deletions(-) diff --git a/src/H5api_adpt.h b/src/H5api_adpt.h index ab7287c..910bef9 100644 --- a/src/H5api_adpt.h +++ b/src/H5api_adpt.h @@ -21,28 +21,6 @@ #ifndef H5API_ADPT_H #define H5API_ADPT_H -/* - * Does the compiler support the __attribute__(()) syntax? It's no - * big deal if we don't. - * - * Note that Solaris Studio supports attribute, but does not support the - * attributes we use. - */ -#ifdef __cplusplus -# define H5_ATTR_FORMAT(X,Y,Z) /*void*/ -# define H5_ATTR_UNUSED /*void*/ -# define H5_ATTR_NORETURN /*void*/ -#else /* __cplusplus */ -#if defined(H5_HAVE_ATTRIBUTE) && !defined(__SUNPRO_C) -# define H5_ATTR_FORMAT(X,Y,Z) __attribute__((format(X, Y, Z))) -# define H5_ATTR_UNUSED __attribute__((unused)) -# define H5_ATTR_NORETURN __attribute__((noreturn)) -#else -# define H5_ATTR_FORMAT(X,Y,Z) /*void*/ -# define H5_ATTR_UNUSED /*void*/ -# define H5_ATTR_NORETURN /*void*/ -#endif -#endif /* __cplusplus */ /* This will only be defined if HDF5 was built with CMake */ #ifdef H5_BUILT_AS_DYNAMIC_LIB diff --git a/src/H5private.h b/src/H5private.h index 5e968a0..738d4ff 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -288,12 +288,23 @@ /* * Does the compiler support the __attribute__(()) syntax? It's no * big deal if we don't. + * + * Note that Solaris Studio supports attribute, but does not support the + * attributes we use. */ #ifdef __cplusplus -# define __attribute__(X) /*void*/ +# define H5_ATTR_FORMAT(X,Y,Z) /*void*/ +# define H5_ATTR_UNUSED /*void*/ +# define H5_ATTR_NORETURN /*void*/ #else /* __cplusplus */ -#ifndef H5_HAVE_ATTRIBUTE -# define __attribute__(X) /*void*/ +#if defined(H5_HAVE_ATTRIBUTE) && !defined(__SUNPRO_C) +# define H5_ATTR_FORMAT(X,Y,Z) __attribute__((format(X, Y, Z))) +# define H5_ATTR_UNUSED __attribute__((unused)) +# define H5_ATTR_NORETURN __attribute__((noreturn)) +#else +# define H5_ATTR_FORMAT(X,Y,Z) /*void*/ +# define H5_ATTR_UNUSED /*void*/ +# define H5_ATTR_NORETURN /*void*/ #endif #endif /* __cplusplus */ -- cgit v0.12 From 672e6bd8a9e666df50f54531a95cdff8dfd4f5c1 Mon Sep 17 00:00:00 2001 From: Scot Breitenfeld Date: Thu, 10 Sep 2015 16:18:17 -0500 Subject: [svn-r27754] HDFFV-548:H5LT patches for F90 Lite API in 1.8.0 Beta tested: h5committest --- hl/fortran/src/H5HL_buildiface.F90 | 179 ++++- hl/fortran/src/H5LTff.F90 | 34 - hl/fortran/test/tstlite.F90 | 1273 +++++++++++++++++++++--------------- 3 files changed, 910 insertions(+), 576 deletions(-) diff --git a/hl/fortran/src/H5HL_buildiface.F90 b/hl/fortran/src/H5HL_buildiface.F90 index 0e85e27..9dd879c 100644 --- a/hl/fortran/src/H5HL_buildiface.F90 +++ b/hl/fortran/src/H5HL_buildiface.F90 @@ -83,13 +83,13 @@ PROGRAM H5HL_buildiface /) ! 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)) ', & - ' f_ptr = C_LOC(buf(1,1)) ', & - ' f_ptr = C_LOC(buf(1,1,1)) ', & - ' f_ptr = C_LOC(buf(1,1,1,1)) ', & - ' f_ptr = C_LOC(buf(1,1,1,1,1)) ', & - ' f_ptr = C_LOC(buf(1,1,1,1,1,1)) ', & + ' f_ptr = C_LOC(buf )', & + ' f_ptr = C_LOC(buf(1) )', & + ' f_ptr = C_LOC(buf(1,1) )', & + ' f_ptr = C_LOC(buf(1,1,1) )', & + ' f_ptr = C_LOC(buf(1,1,1,1) )', & + ' f_ptr = C_LOC(buf(1,1,1,1,1) )', & + ' f_ptr = C_LOC(buf(1,1,1,1,1,1) )', & ' f_ptr = C_LOC(buf(1,1,1,1,1,1,1))' & /) @@ -154,6 +154,13 @@ PROGRAM H5HL_buildiface WRITE(11,'(A)') " MODULE PROCEDURE h5ltmake_dataset_real_kind_"//TRIM(ADJUSTL(chr2))//'_rank'//chr_rank(k) ENDDO END DO + DO i = 1, num_ikinds + j = ikind(i) + WRITE(chr2,'(I2)') j + DO k = 1, 8 + WRITE(11,'(A)') " MODULE PROCEDURE h5ltmake_dataset_integer_kind_"//TRIM(ADJUSTL(chr2))//'_rank'//chr_rank(k) + ENDDO + END DO WRITE(11,'(A)') " END INTERFACE" ! h5ltread_dataset_f @@ -165,6 +172,35 @@ PROGRAM H5HL_buildiface WRITE(11,'(A)') " MODULE PROCEDURE h5ltread_dataset_real_kind_"//TRIM(ADJUSTL(chr2))//'_rank'//chr_rank(k) ENDDO END DO + DO i = 1, num_ikinds + j = ikind(i) + WRITE(chr2,'(I2)') j + DO k = 1, 8 + WRITE(11,'(A)') " MODULE PROCEDURE h5ltread_dataset_integer_kind_"//TRIM(ADJUSTL(chr2))//'_rank'//chr_rank(k) + ENDDO + END DO + WRITE(11,'(A)') " END INTERFACE" + +! h5ltread_dataset_int_f + WRITE(11,'(A)') " INTERFACE h5ltread_dataset_int_f" + DO i = 1, num_ikinds + j = ikind(i) + WRITE(chr2,'(I2)') j + DO k = 1, 8 + WRITE(11,'(A)') " MODULE PROCEDURE h5ltread_dataset_int_kind_"//TRIM(ADJUSTL(chr2))//'_rank'//chr_rank(k) + ENDDO + END DO + WRITE(11,'(A)') " END INTERFACE" + +! h5ltmake_dataset_int_f + WRITE(11,'(A)') " INTERFACE h5ltmake_dataset_int_f" + DO i = 1, num_ikinds + j = ikind(i) + WRITE(chr2,'(I2)') j + DO k = 1, 8 + WRITE(11,'(A)') " MODULE PROCEDURE h5ltmake_dataset_int_kind_"//TRIM(ADJUSTL(chr2))//'_rank'//chr_rank(k) + ENDDO + END DO WRITE(11,'(A)') " END INTERFACE" ! h5ltmake_dataset_float_f @@ -346,7 +382,6 @@ PROGRAM H5HL_buildiface k = rkind(i) WRITE(chr2,'(I2)') k DO j = 1, 8 - ! DLL definitions for windows WRITE(11,'(A)') '!DEC$if defined(BUILD_HDF5_HL_DLL)' WRITE(11,'(A)') '!DEC$attributes dllexport :: h5ltmake_dataset_double_kind_'//TRIM(ADJUSTL(chr2))//'_rank'//chr_rank(j) @@ -402,6 +437,134 @@ PROGRAM H5HL_buildiface ENDDO ENDDO +! h5ltmake_dataset_f + DO i = 1, num_ikinds + k = ikind(i) + WRITE(chr2,'(I2)') k + DO j = 1, 8 + +! DLL definitions for windows + WRITE(11,'(A)') '!DEC$if defined(BUILD_HDF5_HL_DLL)' + WRITE(11,'(A)') '!DEC$attributes dllexport :: h5ltmake_dataset_integer_kind_'//TRIM(ADJUSTL(chr2))//'_rank'//chr_rank(j) + WRITE(11,'(A)') '!DEC$endif' + +! Subroutine API + WRITE(11,'(A)') ' SUBROUTINE h5ltmake_dataset_integer_kind_'//TRIM(ADJUSTL(chr2))& + &//'_rank'//chr_rank(j)//'(loc_id,dset_name,rank,dims,type_id,buf,errcode)' + WRITE(11,'(A)') ' IMPLICIT NONE' + WRITE(11,'(A)') ' INTEGER(hid_t) , INTENT(IN) :: loc_id' + WRITE(11,'(A)') ' CHARACTER(LEN=*), INTENT(IN) :: dset_name' + WRITE(11,'(A)') ' INTEGER, INTENT(IN) :: rank' + WRITE(11,'(A)') ' INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims' + WRITE(11,'(A)') ' INTEGER(hid_t), INTENT(in) :: type_id' + WRITE(11,'(A)') ' INTEGER(KIND='//TRIM(ADJUSTL(chr2))//'),INTENT(IN)'//TRIM(rank_dim_line(j))//', TARGET :: buf' + WRITE(11,'(A)') ' INTEGER :: errcode ' + WRITE(11,'(A)') ' TYPE(C_PTR) :: f_ptr' + WRITE(11,'(A)') ' INTEGER(size_t) :: namelen' + + WRITE(11,'(A)') f_ptr_line(j) + WRITE(11,'(A)') ' namelen = LEN(dset_name)' + WRITE(11,'(A)') ' errcode = h5ltmake_dataset_c(loc_id, namelen, dset_name, rank, dims, type_id, f_ptr)' + WRITE(11,'(A)') ' END SUBROUTINE h5ltmake_dataset_integer_kind_'//TRIM(ADJUSTL(chr2))//'_rank'//chr_rank(j) + ENDDO + ENDDO + +! h5ltmake_dataset_int_f + DO i = 1, num_ikinds + k = ikind(i) + WRITE(chr2,'(I2)') k + DO j = 1, 8 + +! DLL definitions for windows + WRITE(11,'(A)') '!DEC$if defined(BUILD_HDF5_HL_DLL)' + WRITE(11,'(A)') '!DEC$attributes dllexport :: h5ltmake_dataset_int_kind_'//TRIM(ADJUSTL(chr2))//'_rank'//chr_rank(j) + WRITE(11,'(A)') '!DEC$endif' + +! Subroutine API + WRITE(11,'(A)') ' SUBROUTINE h5ltmake_dataset_int_kind_'//TRIM(ADJUSTL(chr2))& + &//'_rank'//chr_rank(j)//'(loc_id,dset_name,rank,dims,buf,errcode)' + WRITE(11,'(A)') ' IMPLICIT NONE' + WRITE(11,'(A)') ' INTEGER(hid_t) , INTENT(IN) :: loc_id' + WRITE(11,'(A)') ' CHARACTER(LEN=*), INTENT(IN) :: dset_name' + WRITE(11,'(A)') ' INTEGER, INTENT(IN) :: rank' + WRITE(11,'(A)') ' INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims' + WRITE(11,'(A)') ' INTEGER(KIND='//TRIM(ADJUSTL(chr2))//'),INTENT(IN)'//TRIM(rank_dim_line(j))//', TARGET :: buf' + WRITE(11,'(A)') ' INTEGER :: errcode ' + WRITE(11,'(A)') ' TYPE(C_PTR) :: f_ptr' + WRITE(11,'(A)') ' INTEGER(size_t) :: namelen' + WRITE(11,'(A)') ' INTEGER(hid_t) :: type_id' + + WRITE(11,'(A)') f_ptr_line(j) + WRITE(11,'(A)') ' namelen = LEN(dset_name)' + WRITE(11,'(A)') ' type_id = h5kind_to_type(KIND('//f_ptr_line(j)(19:36)//'), H5_INTEGER_KIND)' + WRITE(11,'(A)') ' errcode = h5ltmake_dataset_c(loc_id, namelen, dset_name, rank, dims, type_id, f_ptr)' + WRITE(11,'(A)') ' END SUBROUTINE h5ltmake_dataset_int_kind_'//TRIM(ADJUSTL(chr2))//'_rank'//chr_rank(j) + ENDDO + ENDDO + +! h5ltread_dataset_f + DO i = 1, num_ikinds + k = ikind(i) + WRITE(chr2,'(I2)') k + DO j = 1, 8 + +! DLL definitions for windows + WRITE(11,'(A)') '!DEC$if defined(BUILD_HDF5_HL_DLL)' + WRITE(11,'(A)') '!DEC$attributes dllexport :: h5ltread_dataset_integer_kind_'//TRIM(ADJUSTL(chr2))//'_rank'//chr_rank(j) + WRITE(11,'(A)') '!DEC$endif' + +! Subroutine API + WRITE(11,'(A)') ' SUBROUTINE h5ltread_dataset_integer_kind_'//TRIM(ADJUSTL(chr2))& + &//'_rank'//chr_rank(j)//'(loc_id,dset_name, type_id, buf,dims,errcode)' + WRITE(11,'(A)') ' IMPLICIT NONE' + WRITE(11,'(A)') ' INTEGER(hid_t) , INTENT(IN) :: loc_id' + WRITE(11,'(A)') ' CHARACTER(LEN=*), INTENT(IN) :: dset_name' + WRITE(11,'(A)') ' INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims' + WRITE(11,'(A)') ' INTEGER(hid_t), INTENT(in) :: type_id' + WRITE(11,'(A)') ' INTEGER(KIND='//TRIM(ADJUSTL(chr2))//'),INTENT(IN)'//TRIM(rank_dim_line(j))//', TARGET :: buf' + WRITE(11,'(A)') ' INTEGER :: errcode ' + WRITE(11,'(A)') ' TYPE(C_PTR) :: f_ptr' + WRITE(11,'(A)') ' INTEGER(size_t) :: namelen' + + WRITE(11,'(A)') f_ptr_line(j) + WRITE(11,'(A)') ' namelen = LEN(dset_name)' + WRITE(11,'(A)') ' errcode = h5ltread_dataset_c(loc_id, namelen, dset_name, type_id, f_ptr)' + WRITE(11,'(A)') ' END SUBROUTINE h5ltread_dataset_integer_kind_'//TRIM(ADJUSTL(chr2))//'_rank'//chr_rank(j) + ENDDO + ENDDO + +! h5ltread_dataset_int_f + DO i = 1, num_ikinds + k = ikind(i) + WRITE(chr2,'(I2)') k + DO j = 1, 8 + +! DLL definitions for windows + WRITE(11,'(A)') '!DEC$if defined(BUILD_HDF5_HL_DLL)' + WRITE(11,'(A)') '!DEC$attributes dllexport :: h5ltread_dataset_int_kind_'//TRIM(ADJUSTL(chr2))//'_rank'//chr_rank(j) + WRITE(11,'(A)') '!DEC$endif' + +! Subroutine API + WRITE(11,'(A)') ' SUBROUTINE h5ltread_dataset_int_kind_'//TRIM(ADJUSTL(chr2))& + &//'_rank'//chr_rank(j)//'(loc_id,dset_name, buf,dims,errcode)' + WRITE(11,'(A)') ' IMPLICIT NONE' + WRITE(11,'(A)') ' INTEGER(hid_t) , INTENT(IN) :: loc_id' + WRITE(11,'(A)') ' CHARACTER(LEN=*), INTENT(IN) :: dset_name' + WRITE(11,'(A)') ' INTEGER(hsize_t), DIMENSION(*), INTENT(in) :: dims' + WRITE(11,'(A)') ' INTEGER(KIND='//TRIM(ADJUSTL(chr2))//'),INTENT(IN)'//TRIM(rank_dim_line(j))//', TARGET :: buf' + WRITE(11,'(A)') ' INTEGER :: errcode ' + WRITE(11,'(A)') ' TYPE(C_PTR) :: f_ptr' + WRITE(11,'(A)') ' INTEGER(size_t) :: namelen' + WRITE(11,'(A)') ' INTEGER(hid_t) :: type_id' + + WRITE(11,'(A)') f_ptr_line(j) + WRITE(11,'(A)') ' namelen = LEN(dset_name)' + WRITE(11,'(A)') ' type_id = h5kind_to_type(KIND('//f_ptr_line(j)(19:36)//'), H5_INTEGER_KIND)' + WRITE(11,'(A)') ' errcode = h5ltread_dataset_c(loc_id, namelen, dset_name, type_id, f_ptr)' + WRITE(11,'(A)') ' END SUBROUTINE h5ltread_dataset_int_kind_'//TRIM(ADJUSTL(chr2))//'_rank'//chr_rank(j) + ENDDO + ENDDO + WRITE(11,'(A)') 'END MODULE H5LT' ! change this to be generic MSB CLOSE(11) diff --git a/hl/fortran/src/H5LTff.F90 b/hl/fortran/src/H5LTff.F90 index ffc7ab5..d36d92c 100644 --- a/hl/fortran/src/H5LTff.F90 +++ b/hl/fortran/src/H5LTff.F90 @@ -38,47 +38,13 @@ MODULE H5LT_CONST USE hdf5 INTERFACE h5ltmake_dataset_f - MODULE PROCEDURE h5ltmake_dataset_f_int1 - MODULE PROCEDURE h5ltmake_dataset_f_int2 - MODULE PROCEDURE h5ltmake_dataset_f_int3 - MODULE PROCEDURE h5ltmake_dataset_f_int4 - MODULE PROCEDURE h5ltmake_dataset_f_int5 - MODULE PROCEDURE h5ltmake_dataset_f_int6 - MODULE PROCEDURE h5ltmake_dataset_f_int7 MODULE PROCEDURE h5ltmake_dataset_f_ptr END INTERFACE INTERFACE h5ltread_dataset_f - MODULE PROCEDURE h5ltread_dataset_f_int1 - MODULE PROCEDURE h5ltread_dataset_f_int2 - MODULE PROCEDURE h5ltread_dataset_f_int3 - MODULE PROCEDURE h5ltread_dataset_f_int4 - MODULE PROCEDURE h5ltread_dataset_f_int5 - MODULE PROCEDURE h5ltread_dataset_f_int6 - MODULE PROCEDURE h5ltread_dataset_f_int7 MODULE PROCEDURE h5ltread_dataset_f_ptr END INTERFACE - INTERFACE h5ltmake_dataset_int_f - MODULE PROCEDURE h5ltmake_dataset_int_f_1 - MODULE PROCEDURE h5ltmake_dataset_int_f_2 - MODULE PROCEDURE h5ltmake_dataset_int_f_3 - MODULE PROCEDURE h5ltmake_dataset_int_f_4 - MODULE PROCEDURE h5ltmake_dataset_int_f_5 - MODULE PROCEDURE h5ltmake_dataset_int_f_6 - MODULE PROCEDURE h5ltmake_dataset_int_f_7 - END INTERFACE - - INTERFACE h5ltread_dataset_int_f - MODULE PROCEDURE h5ltread_dataset_int_f_1 - MODULE PROCEDURE h5ltread_dataset_int_f_2 - MODULE PROCEDURE h5ltread_dataset_int_f_3 - MODULE PROCEDURE h5ltread_dataset_int_f_4 - MODULE PROCEDURE h5ltread_dataset_int_f_5 - MODULE PROCEDURE h5ltread_dataset_int_f_6 - MODULE PROCEDURE h5ltread_dataset_int_f_7 - END INTERFACE - INTERFACE INTEGER FUNCTION h5ltmake_dataset_c(loc_id,namelen,dset_name,rank,dims,type_id,buf) & BIND(C,NAME='h5ltmake_dataset_c') diff --git a/hl/fortran/test/tstlite.F90 b/hl/fortran/test/tstlite.F90 index 0eb005b..0ba7815 100644 --- a/hl/fortran/test/tstlite.F90 +++ b/hl/fortran/test/tstlite.F90 @@ -19,7 +19,7 @@ #include PROGRAM lite_test - + CALL test_dataset1D() CALL test_dataset2D() CALL test_dataset3D() @@ -38,149 +38,148 @@ END PROGRAM lite_test !------------------------------------------------------------------------- SUBROUTINE test_dataset1D() + + USE, INTRINSIC :: ISO_C_BINDING + USE H5LT ! module of H5LT + USE HDF5 ! module of HDF5 library + + IMPLICIT NONE + + INTEGER, PARAMETER :: DIM1 = 4 ! Dimension of array + CHARACTER(len=9), PARAMETER :: filename = "dsetf1.h5"! File name + CHARACTER(LEN=5), PARAMETER :: dsetname1 = "dset1" ! Dataset name + CHARACTER(LEN=5), PARAMETER :: dsetname2 = "dset2" ! Dataset name + CHARACTER(LEN=5), PARAMETER :: dsetname3 = "dset3" ! Dataset name + INTEGER(HID_T) :: file_id ! File identifier + INTEGER(HSIZE_T), DIMENSION(1) :: dims = (/DIM1/) ! Dataset dimensions + INTEGER :: rank = 1 ! Dataset rank + INTEGER, DIMENSION(DIM1) :: buf1 ! Data buffer + INTEGER, DIMENSION(DIM1) :: bufr1 ! Data buffer + REAL, DIMENSION(DIM1) :: buf2 ! Data buffer + REAL, DIMENSION(DIM1) :: bufr2 ! Data buffer + DOUBLE PRECISION, DIMENSION(DIM1), TARGET :: buf3 ! Data buffer + DOUBLE PRECISION, DIMENSION(DIM1), TARGET :: bufr3 ! Data buffer + INTEGER :: errcode ! Error flag + INTEGER :: i ! general purpose integer + TYPE(C_PTR) :: f_ptr + integer(HID_T) :: mytype -USE, INTRINSIC :: ISO_C_BINDING -USE H5LT ! module of H5LT -USE HDF5 ! module of HDF5 library - -IMPLICIT NONE - -INTEGER, PARAMETER :: DIM1 = 4; ! Dimension of array -CHARACTER(len=9), PARAMETER :: filename = "dsetf1.h5"! File name -CHARACTER(LEN=5), PARAMETER :: dsetname1 = "dset1" ! Dataset name -CHARACTER(LEN=5), PARAMETER :: dsetname2 = "dset2" ! Dataset name -CHARACTER(LEN=5), PARAMETER :: dsetname3 = "dset3" ! Dataset name -INTEGER(HID_T) :: file_id ! File identifier -INTEGER(HSIZE_T), DIMENSION(1) :: dims = (/DIM1/) ! Dataset dimensions -INTEGER :: rank = 1 ! Dataset rank -INTEGER, DIMENSION(DIM1) :: buf1 ! Data buffer -INTEGER, DIMENSION(DIM1) :: bufr1 ! Data buffer -REAL, DIMENSION(DIM1) :: buf2 ! Data buffer -REAL, DIMENSION(DIM1) :: bufr2 ! Data buffer -DOUBLE PRECISION, DIMENSION(DIM1), TARGET :: buf3 ! Data buffer -DOUBLE PRECISION, DIMENSION(DIM1), TARGET :: bufr3 ! Data buffer -INTEGER :: errcode ! Error flag -INTEGER :: i ! general purpose integer -TYPE(C_PTR) :: f_ptr -integer(HID_T) :: mytype - -CALL test_begin(' Make/Read datasets (1D) ') - -! -! Initialize the data array. -! -DO i = 1, DIM1 - buf1(i) = i; - buf2(i) = i; - buf3(i) = i; -END DO + CALL test_begin(' Make/Read datasets (1D) ') -! -! Initialize FORTRAN predefined datatypes. -! -CALL h5open_f(errcode) + ! + ! Initialize the data array. + ! + DO i = 1, DIM1 + buf1(i) = i + buf2(i) = i + buf3(i) = i + END DO -! -! Create a new file using default properties. -! -CALL h5fcreate_f(filename, H5F_ACC_TRUNC_F, file_id, errcode) + ! + ! Initialize FORTRAN predefined datatypes. + ! + CALL h5open_f(errcode) -!------------------------------------------------------------------------- -! H5T_NATIVE_INTEGER -!------------------------------------------------------------------------- + ! + ! Create a new file using default properties. + ! + CALL h5fcreate_f(filename, H5F_ACC_TRUNC_F, file_id, errcode) -! -! write dataset. -! -CALL h5ltmake_dataset_f(file_id, dsetname1, rank, dims, H5T_NATIVE_INTEGER, buf1, errcode) + !------------------------------------------------------------------------- + ! H5T_NATIVE_INTEGER + !------------------------------------------------------------------------- -! -! read dataset. -! -CALL h5ltread_dataset_f(file_id, dsetname1, H5T_NATIVE_INTEGER, bufr1, dims, errcode) + ! + ! write dataset. + ! + CALL h5ltmake_dataset_f(file_id, dsetname1, rank, dims, H5T_NATIVE_INTEGER, buf1, errcode) + ! + ! read dataset. + ! + CALL h5ltread_dataset_f(file_id, dsetname1, H5T_NATIVE_INTEGER, bufr1, dims, errcode) -! -! compare read and write buffers. -! -DO i = 1, DIM1 - IF ( buf1(i) .NE. bufr1(i) ) THEN - PRINT *, 'read buffer differs from write buffer (I)' - PRINT *, bufr1(i), ' and ', buf1(i) - STOP - ENDIF -END DO + ! + ! compare read and write buffers. + ! + DO i = 1, DIM1 + IF ( buf1(i) .NE. bufr1(i) ) THEN + PRINT *, 'read buffer differs from write buffer (I)' + PRINT *, bufr1(i), ' and ', buf1(i) + STOP + ENDIF + END DO -!------------------------------------------------------------------------- -! H5T_NATIVE_REAL -!------------------------------------------------------------------------- + !------------------------------------------------------------------------- + ! H5T_NATIVE_REAL + !------------------------------------------------------------------------- -! -! write dataset. -! -CALL h5ltmake_dataset_f(file_id, dsetname2, rank, dims, H5T_NATIVE_REAL, buf2, errcode) + ! + ! write dataset. + ! + CALL h5ltmake_dataset_f(file_id, dsetname2, rank, dims, H5T_NATIVE_REAL, buf2, errcode) -! -! read dataset. -! -CALL h5ltread_dataset_f(file_id, dsetname2, H5T_NATIVE_REAL, bufr2, dims, errcode) + ! + ! read dataset. + ! + CALL h5ltread_dataset_f(file_id, dsetname2, H5T_NATIVE_REAL, bufr2, dims, errcode) -! -! compare read and write buffers. -! -DO i = 1, DIM1 - IF ( buf2(i) .NE. bufr2(i) ) THEN - PRINT *, 'read buffer differs from write buffer (R)' - PRINT *, bufr2(i), ' and ', buf2(i) - STOP - ENDIF -END DO + ! + ! compare read and write buffers. + ! + DO i = 1, DIM1 + IF ( buf2(i) .NE. bufr2(i) ) THEN + PRINT *, 'read buffer differs from write buffer (R)' + PRINT *, bufr2(i), ' and ', buf2(i) + STOP + ENDIF + END DO -!------------------------------------------------------------------------- -! H5T_NATIVE_DOUBLE -!------------------------------------------------------------------------- + !------------------------------------------------------------------------- + ! H5T_NATIVE_DOUBLE + !------------------------------------------------------------------------- -! -! write dataset. -! -f_ptr = C_LOC(buf3(1)) -mytype = h5kind_to_type(KIND(buf3(1)), H5_REAL_KIND) -CALL h5ltmake_dataset_f(file_id, dsetname3, rank, dims, & - mytype, f_ptr, errcode) -!CALL h5ltmake_dataset_f(file_id, dsetname3, rank, dims, H5T_NATIVE_DOUBLE, buf3, errcode) -! h5kind_to_type(KIND(buf3(1)), H5_REAL_KIND) -! -! read dataset. -! -f_ptr = C_LOC(bufr3(1)) -CALL h5ltread_dataset_f(file_id, dsetname3, & - h5kind_to_type(KIND(bufr3(1)), H5_REAL_KIND), f_ptr, errcode) -!CALL h5ltread_dataset_f(file_id, dsetname3, H5T_NATIVE_DOUBLE, bufr3, dims, errcode) + ! + ! write dataset. + ! + f_ptr = C_LOC(buf3(1)) + mytype = h5kind_to_type(KIND(buf3(1)), H5_REAL_KIND) + CALL h5ltmake_dataset_f(file_id, dsetname3, rank, dims, & + mytype, f_ptr, errcode) + !CALL h5ltmake_dataset_f(file_id, dsetname3, rank, dims, H5T_NATIVE_DOUBLE, buf3, errcode) + ! h5kind_to_type(KIND(buf3(1)), H5_REAL_KIND) + ! + ! read dataset. + ! + f_ptr = C_LOC(bufr3(1)) + CALL h5ltread_dataset_f(file_id, dsetname3, & + h5kind_to_type(KIND(bufr3(1)), H5_REAL_KIND), f_ptr, errcode) + !CALL h5ltread_dataset_f(file_id, dsetname3, H5T_NATIVE_DOUBLE, bufr3, dims, errcode) -! -! compare read and write buffers. -! -DO i = 1, DIM1 - IF ( buf3(i) .NE. bufr3(i) ) THEN - PRINT *, 'read buffer differs from write buffer (D)' - PRINT *, bufr3(i), ' and ', buf3(i) - STOP - ENDIF -END DO + ! + ! compare read and write buffers. + ! + DO i = 1, DIM1 + IF ( buf3(i) .NE. bufr3(i) ) THEN + PRINT *, 'read buffer differs from write buffer (D)' + PRINT *, bufr3(i), ' and ', buf3(i) + STOP + ENDIF + END DO -! -! Close the file. -! -CALL h5fclose_f(file_id, errcode) + ! + ! Close the file. + ! + CALL h5fclose_f(file_id, errcode) -! -! Close FORTRAN predefined datatypes. -! -CALL h5close_f(errcode) + ! + ! Close FORTRAN predefined datatypes. + ! + CALL h5close_f(errcode) -CALL passed() -! -! end function. -! + CALL passed() + ! + ! end function. + ! END SUBROUTINE test_dataset1D !------------------------------------------------------------------------- @@ -189,194 +188,193 @@ END SUBROUTINE test_dataset1D SUBROUTINE test_dataset2D() -USE, INTRINSIC :: ISO_C_BINDING -USE H5LT ! module of H5LT -USE HDF5 ! module of HDF5 library - -IMPLICIT NONE - - -INTEGER(HSIZE_T), PARAMETER :: DIM1 = 4; ! columns -INTEGER(HSIZE_T), PARAMETER :: DIM2 = 6; ! rows -CHARACTER(len=9), PARAMETER :: filename = "dsetf2.h5"! File name -CHARACTER(LEN=5), PARAMETER :: dsetname1 = "dset1" ! Dataset name -CHARACTER(LEN=5), PARAMETER :: dsetname2 = "dset2" ! Dataset name -CHARACTER(LEN=5), PARAMETER :: dsetname3 = "dset3" ! Dataset name -CHARACTER(LEN=5), PARAMETER :: dsetname4 = "dset4" ! Dataset name -INTEGER(HID_T) :: file_id ! File identifier -INTEGER(HSIZE_T), DIMENSION(2) :: dims = (/4,6/) ! Dataset dimensions -INTEGER :: rank = 2 ! Dataset rank -INTEGER, DIMENSION(DIM1*DIM2) :: buf ! Data buffer -INTEGER, DIMENSION(DIM1*DIM2) :: bufr ! Data buffer -INTEGER, DIMENSION(DIM1,DIM2) :: buf2 ! Data buffer -INTEGER, DIMENSION(DIM1,DIM2) :: buf2r ! Data buffer -REAL, DIMENSION(DIM1,DIM2), TARGET :: buf3 ! Data buffer -REAL, DIMENSION(DIM1,DIM2), TARGET :: buf3r ! Data buffer -DOUBLE PRECISION, DIMENSION(DIM1,DIM2), TARGET :: buf4 ! Data buffer -DOUBLE PRECISION, DIMENSION(DIM1,DIM2), TARGET :: buf4r ! Data buffer -INTEGER :: errcode ! Error flag -INTEGER(HSIZE_T) :: i, j, n ! general purpose integers -TYPE(C_PTR) :: f_ptr - -CALL test_begin(' Make/Read datasets (2D) ') + USE, INTRINSIC :: ISO_C_BINDING + USE H5LT ! module of H5LT + USE HDF5 ! module of HDF5 library + IMPLICIT NONE -! -! Initialize the data arrays. -! -n=1 -DO i = 1, DIM1*DIM2 - buf(i) = INT(n) - n = n + 1 -END DO -DO i = 1, dims(1) - DO j = 1, dims(2) - buf2(i,j) = INT((i-1)*dims(2) + j) - buf3(i,j) = INT((i-1)*dims(2) + j) - buf4(i,j) = INT((i-1)*dims(2) + j) - END DO -END DO + INTEGER(HSIZE_T), PARAMETER :: DIM1 = 4 ! columns + INTEGER(HSIZE_T), PARAMETER :: DIM2 = 6 ! rows + CHARACTER(len=9), PARAMETER :: filename = "dsetf2.h5"! File name + CHARACTER(LEN=5), PARAMETER :: dsetname1 = "dset1" ! Dataset name + CHARACTER(LEN=5), PARAMETER :: dsetname2 = "dset2" ! Dataset name + CHARACTER(LEN=5), PARAMETER :: dsetname3 = "dset3" ! Dataset name + CHARACTER(LEN=5), PARAMETER :: dsetname4 = "dset4" ! Dataset name + INTEGER(HID_T) :: file_id ! File identifier + INTEGER(HSIZE_T), DIMENSION(2) :: dims = (/4,6/) ! Dataset dimensions + INTEGER :: rank = 2 ! Dataset rank + INTEGER, DIMENSION(DIM1*DIM2) :: buf ! Data buffer + INTEGER, DIMENSION(DIM1*DIM2) :: bufr ! Data buffer + INTEGER, DIMENSION(DIM1,DIM2) :: buf2 ! Data buffer + INTEGER, DIMENSION(DIM1,DIM2) :: buf2r ! Data buffer + REAL, DIMENSION(DIM1,DIM2), TARGET :: buf3 ! Data buffer + REAL, DIMENSION(DIM1,DIM2), TARGET :: buf3r ! Data buffer + DOUBLE PRECISION, DIMENSION(DIM1,DIM2), TARGET :: buf4 ! Data buffer + DOUBLE PRECISION, DIMENSION(DIM1,DIM2), TARGET :: buf4r ! Data buffer + INTEGER :: errcode ! Error flag + INTEGER(HSIZE_T) :: i, j, n ! general purpose integers + TYPE(C_PTR) :: f_ptr + CALL test_begin(' Make/Read datasets (2D) ') -! -! Initialize FORTRAN predefined datatypes. -! -CALL h5open_f(errcode) -! -! Create a new file using default properties. -! -CALL h5fcreate_f(filename, H5F_ACC_TRUNC_F, file_id, errcode) + ! + ! Initialize the data arrays. + ! + n=1 + DO i = 1, DIM1*DIM2 + buf(i) = INT(n) + n = n + 1 + END DO -!------------------------------------------------------------------------- -! H5T_NATIVE_INT 1D buffer -!------------------------------------------------------------------------- + DO i = 1, dims(1) + DO j = 1, dims(2) + buf2(i,j) = INT((i-1)*dims(2) + j) + buf3(i,j) = INT((i-1)*dims(2) + j) + buf4(i,j) = INT((i-1)*dims(2) + j) + END DO + END DO -! -! write dataset. -! -CALL h5ltmake_dataset_f(file_id, dsetname1, rank, dims, H5T_NATIVE_INTEGER, buf, errcode) + ! + ! Initialize FORTRAN predefined datatypes. + ! + CALL h5open_f(errcode) -! -! read dataset. -! -CALL h5ltread_dataset_f(file_id, dsetname1, H5T_NATIVE_INTEGER, bufr, dims, errcode) + ! + ! Create a new file using default properties. + ! + CALL h5fcreate_f(filename, H5F_ACC_TRUNC_F, file_id, errcode) -! -! compare read and write buffers. -! -DO i = 1, DIM1*DIM2 - IF ( buf(i) .NE. bufr(i) ) THEN - PRINT *, 'read buffer differs from write buffer' - PRINT *, bufr(i), ' and ', buf(i) - STOP - ENDIF -END DO + !------------------------------------------------------------------------- + ! H5T_NATIVE_INT 1D buffer + !------------------------------------------------------------------------- -!------------------------------------------------------------------------- -! H5T_NATIVE_INT 2D buffer -!------------------------------------------------------------------------- + ! + ! write dataset. + ! + CALL h5ltmake_dataset_f(file_id, dsetname1, rank, dims, H5T_NATIVE_INTEGER, buf, errcode) -! -! write dataset. -! -CALL h5ltmake_dataset_f(file_id, dsetname2, rank, dims, H5T_NATIVE_INTEGER, buf2, errcode) + ! + ! read dataset. + ! + CALL h5ltread_dataset_f(file_id, dsetname1, H5T_NATIVE_INTEGER, bufr, dims, errcode) -! -! read dataset. -! -CALL h5ltread_dataset_f(file_id, dsetname2, H5T_NATIVE_INTEGER, buf2r, dims, errcode) + ! + ! compare read and write buffers. + ! + DO i = 1, DIM1*DIM2 + IF ( buf(i) .NE. bufr(i) ) THEN + PRINT *, 'read buffer differs from write buffer' + PRINT *, bufr(i), ' and ', buf(i) + STOP + ENDIF + END DO -! -! compare read and write buffers. -! -DO i = 1, dims(1) - DO j = 1, dims(2) - IF ( buf2(i,j) .NE. buf2r(i,j) ) THEN - PRINT *, 'read buffer differs from write buffer' - PRINT *, buf2r(i,j), ' and ', buf2(i,j) - STOP - ENDIF - END DO -END DO + !------------------------------------------------------------------------- + ! H5T_NATIVE_INT 2D buffer + !------------------------------------------------------------------------- -!------------------------------------------------------------------------- -! H5T_NATIVE_REAL -!------------------------------------------------------------------------- + ! + ! write dataset. + ! + CALL h5ltmake_dataset_f(file_id, dsetname2, rank, dims, H5T_NATIVE_INTEGER, buf2, errcode) -! -! write dataset. -! -f_ptr = C_LOC(buf3(1,1)) -CALL h5ltmake_dataset_f(file_id, dsetname3, rank, dims, H5T_NATIVE_REAL, f_ptr, errcode) -!CALL h5ltmake_dataset_f(file_id, dsetname3, rank, dims, H5T_NATIVE_REAL, buf3, errcode) + ! + ! read dataset. + ! + CALL h5ltread_dataset_f(file_id, dsetname2, H5T_NATIVE_INTEGER, buf2r, dims, errcode) -! -! read dataset. -! -f_ptr = C_LOC(buf3r(1,1)) -CALL h5ltread_dataset_f(file_id, dsetname3, H5T_NATIVE_REAL, f_ptr, errcode) -!CALL h5ltread_dataset_f(file_id, dsetname3, H5T_NATIVE_REAL, buf3r, dims, errcode) + ! + ! compare read and write buffers. + ! + DO i = 1, dims(1) + DO j = 1, dims(2) + IF ( buf2(i,j) .NE. buf2r(i,j) ) THEN + PRINT *, 'read buffer differs from write buffer' + PRINT *, buf2r(i,j), ' and ', buf2(i,j) + STOP + ENDIF + END DO + END DO -! -! compare read and write buffers. -! -DO i = 1, dims(1) - DO j = 1, dims(2) - IF ( buf3(i,j) .NE. buf3r(i,j) ) THEN - PRINT *, 'read buffer differs from write buffer' - PRINT *, buf3r(i,j), ' and ', buf3(i,j) - STOP - ENDIF - END DO -END DO + !------------------------------------------------------------------------- + ! H5T_NATIVE_REAL + !------------------------------------------------------------------------- -!------------------------------------------------------------------------- -! H5T_NATIVE_DOUBLE -!------------------------------------------------------------------------- + ! + ! write dataset. + ! + f_ptr = C_LOC(buf3(1,1)) + CALL h5ltmake_dataset_f(file_id, dsetname3, rank, dims, H5T_NATIVE_REAL, f_ptr, errcode) + !CALL h5ltmake_dataset_f(file_id, dsetname3, rank, dims, H5T_NATIVE_REAL, buf3, errcode) -! -! write dataset. -! -f_ptr = C_LOC(buf4(1,1)) -CALL h5ltmake_dataset_f(file_id, dsetname4, rank, dims, H5T_NATIVE_DOUBLE, f_ptr, errcode) -!CALL h5ltmake_dataset_f(file_id, dsetname4, rank, dims, H5T_NATIVE_DOUBLE, buf4, errcode) + ! + ! read dataset. + ! + f_ptr = C_LOC(buf3r(1,1)) + CALL h5ltread_dataset_f(file_id, dsetname3, H5T_NATIVE_REAL, f_ptr, errcode) + !CALL h5ltread_dataset_f(file_id, dsetname3, H5T_NATIVE_REAL, buf3r, dims, errcode) -! -! read dataset. -f_ptr = C_LOC(buf4r(1,1)) -CALL h5ltread_dataset_f(file_id, dsetname4, H5T_NATIVE_DOUBLE, f_ptr, errcode) + ! + ! compare read and write buffers. + ! + DO i = 1, dims(1) + DO j = 1, dims(2) + IF ( buf3(i,j) .NE. buf3r(i,j) ) THEN + PRINT *, 'read buffer differs from write buffer' + PRINT *, buf3r(i,j), ' and ', buf3(i,j) + STOP + ENDIF + END DO + END DO -!CALL h5ltread_dataset_f(file_id, dsetname4, H5T_NATIVE_DOUBLE, buf4r, dims, errcode) + !------------------------------------------------------------------------- + ! H5T_NATIVE_DOUBLE + !------------------------------------------------------------------------- -! -! compare read and write buffers. -! -DO i = 1, dims(1) - DO j = 1, dims(2) - IF ( buf4(i,j) .NE. buf4r(i,j) ) THEN - PRINT *, 'read buffer differs from write buffer' - PRINT *, buf4r(i,j), ' and ', buf4(i,j) - STOP - ENDIF - END DO -END DO + ! + ! write dataset. + ! + f_ptr = C_LOC(buf4(1,1)) + CALL h5ltmake_dataset_f(file_id, dsetname4, rank, dims, H5T_NATIVE_DOUBLE, f_ptr, errcode) + !CALL h5ltmake_dataset_f(file_id, dsetname4, rank, dims, H5T_NATIVE_DOUBLE, buf4, errcode) -! -! Close the file. -! -CALL h5fclose_f(file_id, errcode) + ! + ! read dataset. + f_ptr = C_LOC(buf4r(1,1)) + CALL h5ltread_dataset_f(file_id, dsetname4, H5T_NATIVE_DOUBLE, f_ptr, errcode) -! -! Close FORTRAN predefined datatypes. -! -CALL h5close_f(errcode) + !CALL h5ltread_dataset_f(file_id, dsetname4, H5T_NATIVE_DOUBLE, buf4r, dims, errcode) -CALL passed() -! -! end function. -! + ! + ! compare read and write buffers. + ! + DO i = 1, dims(1) + DO j = 1, dims(2) + IF ( buf4(i,j) .NE. buf4r(i,j) ) THEN + PRINT *, 'read buffer differs from write buffer' + PRINT *, buf4r(i,j), ' and ', buf4(i,j) + STOP + ENDIF + END DO + END DO + + ! + ! Close the file. + ! + CALL h5fclose_f(file_id, errcode) + + ! + ! Close FORTRAN predefined datatypes. + ! + CALL h5close_f(errcode) + + CALL passed() + ! + ! end function. + ! END SUBROUTINE test_dataset2D @@ -386,215 +384,313 @@ END SUBROUTINE test_dataset2D SUBROUTINE test_dataset3D() -USE, INTRINSIC :: ISO_C_BINDING -USE H5LT ! module of H5LT -USE HDF5 ! module of HDF5 library - -IMPLICIT NONE - -INTEGER, PARAMETER :: DIM1 = 6 ! columns -INTEGER, PARAMETER :: DIM2 = 4 ! rows -INTEGER, PARAMETER :: DIM3 = 2 ! layers -CHARACTER(len=9), PARAMETER :: filename = "dsetf3.h5" ! File name -CHARACTER(LEN=5), PARAMETER :: dsetname1 = "dset1" ! Dataset name -CHARACTER(LEN=5), PARAMETER :: dsetname2 = "dset2" ! Dataset name -CHARACTER(LEN=5), PARAMETER :: dsetname3 = "dset3" ! Dataset name -CHARACTER(LEN=5), PARAMETER :: dsetname4 = "dset4" ! Dataset name -INTEGER(HID_T) :: file_id ! File identifier -INTEGER(HSIZE_T), DIMENSION(3) :: dims = (/DIM1,DIM2,DIM3/) ! Dataset dimensions -INTEGER(HSIZE_T), DIMENSION(3) :: dimsr ! Dataset dimensions -INTEGER, DIMENSION(DIM1*DIM2*DIM3) :: buf ! Data buffer -INTEGER, DIMENSION(DIM1*DIM2*DIM3) :: bufr ! Data buffer -INTEGER, DIMENSION(DIM1,DIM2,DIM3) :: buf2 ! Data buffer -INTEGER, DIMENSION(DIM1,DIM2,DIM3) :: buf2r ! Data buffer -REAL, DIMENSION(DIM1,DIM2,DIM3), TARGET :: buf3 ! Data buffer -REAL, DIMENSION(DIM1,DIM2,DIM3), TARGET :: buf3r ! Data buffer -DOUBLE PRECISION, DIMENSION(DIM1,DIM2,DIM3), TARGET :: buf4 ! Data buffer -DOUBLE PRECISION, DIMENSION(DIM1,DIM2,DIM3), TARGET :: buf4r ! Data buffer -INTEGER :: rank = 3 ! Dataset rank -INTEGER :: errcode ! Error flag -INTEGER(HSIZE_T) :: i, j, k, n ! general purpose integers -INTEGER :: type_class -INTEGER(SIZE_T) :: type_size -TYPE(C_PTR) :: f_ptr -CALL test_begin(' Make/Read datasets (3D) ') + USE, INTRINSIC :: ISO_C_BINDING + USE H5LT ! module of H5LT + USE HDF5 ! module of HDF5 library + IMPLICIT NONE -! -! Initialize the data array. -! -n=1 -DO i = 1, DIM1*DIM2*DIM3 - buf(i) = INT(n) - n = n + 1 -END DO - -n = 1 -DO i = 1, dims(1) - DO j = 1, dims(2) - DO k = 1, dims(3) - buf2(i,j,k) = INT(n) - buf3(i,j,k) = INT(n) - buf4(i,j,k) = INT(n) - n = n + 1 - END DO - END DO -END DO + INTEGER, PARAMETER :: DIM1 = 6 ! columns + INTEGER, PARAMETER :: DIM2 = 4 ! rows + INTEGER, PARAMETER :: DIM3 = 2 ! layers + CHARACTER(len=9), PARAMETER :: filename = "dsetf3.h5" ! File name + CHARACTER(LEN=5), PARAMETER :: dsetname1 = "dset1" ! Dataset name + CHARACTER(LEN=5), PARAMETER :: dsetname2 = "dset2" ! Dataset name + CHARACTER(LEN=5), PARAMETER :: dsetname3 = "dset3" ! Dataset name + CHARACTER(LEN=5), PARAMETER :: dsetname4 = "dset4" ! Dataset name + INTEGER(HID_T) :: file_id ! File identifier + INTEGER(HSIZE_T), DIMENSION(3) :: dims = (/DIM1,DIM2,DIM3/) ! Dataset dimensions + INTEGER(HSIZE_T), DIMENSION(3) :: dimsr ! Dataset dimensions + INTEGER, DIMENSION(DIM1*DIM2*DIM3) :: buf ! Data buffer + INTEGER, DIMENSION(DIM1*DIM2*DIM3) :: bufr ! Data buffer + INTEGER, DIMENSION(DIM1,DIM2,DIM3) :: buf2 ! Data buffer + INTEGER, DIMENSION(DIM1,DIM2,DIM3) :: buf2r ! Data buffer + REAL, DIMENSION(DIM1,DIM2,DIM3), TARGET :: buf3 ! Data buffer + REAL, DIMENSION(DIM1,DIM2,DIM3), TARGET :: buf3r ! Data buffer + DOUBLE PRECISION, DIMENSION(DIM1,DIM2,DIM3), TARGET :: buf4 ! Data buffer + DOUBLE PRECISION, DIMENSION(DIM1,DIM2,DIM3), TARGET :: buf4r ! Data buffer + INTEGER :: rank = 3 ! Dataset rank + INTEGER :: errcode ! Error flag + INTEGER(HSIZE_T) :: i, j, k, n ! general purpose integers + INTEGER :: type_class + INTEGER(SIZE_T) :: type_size + TYPE(C_PTR) :: f_ptr +#if H5_HAVE_Fortran_INTEGER_SIZEOF_16!=0 + INTEGER, PARAMETER :: int_kind_32 = SELECTED_INT_KIND(36) !should map to INTEGER*16 on most modern processors + INTEGER(int_kind_32), DIMENSION(DIM1,DIM2,DIM3), TARGET :: dset_data_i32, data_out_i32 + INTEGER(HID_T) :: dset_id32 ! Dataset identifier + CHARACTER(LEN=7), PARAMETER :: dsetname16a = "dset16a" ! Dataset name + CHARACTER(LEN=7), PARAMETER :: dsetname16b = "dset16b" ! Dataset name + CHARACTER(LEN=7), PARAMETER :: dsetname16c = "dset16c" ! Dataset name + INTEGER(HID_T) :: type_id +#endif -! -! Initialize FORTRAN predefined datatypes. -! -CALL h5open_f(errcode) + CALL test_begin(' Make/Read datasets (3D) ') + + + ! + ! Initialize the data array. + ! + n=1 + DO i = 1, DIM1*DIM2*DIM3 + buf(i) = INT(n) + n = n + 1 + END DO + + n = 1 + DO i = 1, dims(1) + DO j = 1, dims(2) + DO k = 1, dims(3) + buf2(i,j,k) = INT(n) + buf3(i,j,k) = INT(n) + buf4(i,j,k) = INT(n) +#if H5_HAVE_Fortran_INTEGER_SIZEOF_16!=0 + dset_data_i32(i,j,k) = HUGE(1_int_kind_32)-INT(n,int_kind_32) +#endif + n = n + 1 + END DO + END DO + END DO + + ! + ! Initialize FORTRAN predefined datatypes. + ! + CALL h5open_f(errcode) + + ! + ! Create a new file using default properties. + ! + CALL h5fcreate_f(filename, H5F_ACC_TRUNC_F, file_id, errcode) + + !------------------------------------------------------------------------- + ! H5T_NATIVE_INT 1D buffer + !------------------------------------------------------------------------- + + ! + ! write dataset. + ! + CALL h5ltmake_dataset_f(file_id, dsetname1, rank, dims, H5T_NATIVE_INTEGER, buf, errcode) + + ! + ! read dataset. + ! + CALL h5ltread_dataset_f(file_id, dsetname1, H5T_NATIVE_INTEGER, bufr, dims, errcode) + + ! + ! compare read and write buffers. + ! + DO i = 1, DIM1*DIM2*DIM3 + IF ( buf(i) .NE. bufr(i) ) THEN + PRINT *, 'read buffer differs from write buffer' + PRINT *, bufr(i), ' and ', buf(i) + STOP + ENDIF + END DO + + !------------------------------------------------------------------------- + ! H5T_NATIVE_INT 3D buffer + !------------------------------------------------------------------------- + + ! + ! write dataset. + ! + CALL h5ltmake_dataset_f(file_id, dsetname2, rank, dims, H5T_NATIVE_INTEGER, buf2, errcode) + + ! + ! read dataset. + ! + CALL h5ltread_dataset_f(file_id, dsetname2, H5T_NATIVE_INTEGER, buf2r, dims, errcode) -! -! Create a new file using default properties. -! -CALL h5fcreate_f(filename, H5F_ACC_TRUNC_F, file_id, errcode) + ! + ! compare read and write buffers. + ! + DO i = 1, dims(1) + DO j = 1, dims(2) + DO k = 1, dims(3) + IF ( buf2(i,j,k) .NE. buf2r(i,j,k) ) THEN + PRINT *, 'read buffer differs from write buffer' + PRINT *, buf2r(i,j,k), ' and ', buf2(i,j,k) + STOP + ENDIF + END DO + END DO + END DO -!------------------------------------------------------------------------- -! H5T_NATIVE_INT 1D buffer -!------------------------------------------------------------------------- + !------------------------------------------------------------------------- + ! H5T_NATIVE_REAL + !------------------------------------------------------------------------- -! -! write dataset. -! -CALL h5ltmake_dataset_f(file_id, dsetname1, rank, dims, H5T_NATIVE_INTEGER, buf, errcode) + ! + ! write dataset. + ! + f_ptr = C_LOC(buf3(1,1,1)) + CALL h5ltmake_dataset_f(file_id, dsetname3, rank, dims, H5T_NATIVE_REAL, f_ptr, errcode) + !CALL h5ltmake_dataset_f(file_id, dsetname3, rank, dims, H5T_NATIVE_REAL, buf3, errcode) -! -! read dataset. -! -CALL h5ltread_dataset_f(file_id, dsetname1, H5T_NATIVE_INTEGER, bufr, dims, errcode) + ! + ! read dataset. + ! + f_ptr = C_LOC(buf3r(1,1,1)) + CALL h5ltread_dataset_f(file_id, dsetname3, H5T_NATIVE_REAL, f_ptr, errcode) + !CALL h5ltread_dataset_f(file_id, dsetname3, H5T_NATIVE_REAL, buf3r, dims, errcode) -! -! compare read and write buffers. -! -DO i = 1, DIM1*DIM2*DIM3 - IF ( buf(i) .NE. bufr(i) ) THEN - PRINT *, 'read buffer differs from write buffer' - PRINT *, bufr(i), ' and ', buf(i) - STOP - ENDIF -END DO + ! + ! compare read and write buffers. + ! + DO i = 1, dims(1) + DO j = 1, dims(2) + DO k = 1, dims(3) + IF ( buf3(i,j,k) .NE. buf3r(i,j,k) ) THEN + PRINT *, 'read buffer differs from write buffer' + PRINT *, buf3r(i,j,k), ' and ', buf3(i,j,k) + STOP + ENDIF + END DO + END DO + END DO -!------------------------------------------------------------------------- -! H5T_NATIVE_INT 3D buffer -!------------------------------------------------------------------------- + !------------------------------------------------------------------------- + ! H5T_NATIVE_DOUBLE + !------------------------------------------------------------------------- -! -! write dataset. -! -CALL h5ltmake_dataset_f(file_id, dsetname2, rank, dims, H5T_NATIVE_INTEGER, buf2, errcode) + ! + ! write dataset. + ! + f_ptr = C_LOC(buf4(1,1,1)) + CALL h5ltmake_dataset_f(file_id, dsetname4, rank, dims, H5T_NATIVE_DOUBLE, f_ptr, errcode) -! -! read dataset. -! -CALL h5ltread_dataset_f(file_id, dsetname2, H5T_NATIVE_INTEGER, buf2r, dims, errcode) + ! + ! read dataset. + ! + f_ptr = C_LOC(buf4r(1,1,1)) + CALL h5ltread_dataset_f(file_id, dsetname4, H5T_NATIVE_DOUBLE, f_ptr, errcode) -! -! compare read and write buffers. -! -DO i = 1, dims(1) - DO j = 1, dims(2) - DO k = 1, dims(3) - IF ( buf2(i,j,k) .NE. buf2r(i,j,k) ) THEN - PRINT *, 'read buffer differs from write buffer' - PRINT *, buf2r(i,j,k), ' and ', buf2(i,j,k) - STOP - ENDIF - END DO - END DO -END DO + ! + ! compare read and write buffers. + ! + DO i = 1, dims(1) + DO j = 1, dims(2) + DO k = 1, dims(3) + IF ( buf4(i,j,k) .NE. buf4r(i,j,k) ) THEN + PRINT *, 'read buffer differs from write buffer' + PRINT *, buf4r(i,j,k), ' and ', buf4(i,j,k) + STOP + ENDIF + END DO + END DO + END DO -!------------------------------------------------------------------------- -! H5T_NATIVE_REAL -!------------------------------------------------------------------------- + CALL h5ltget_dataset_info_f(file_id,dsetname4,dimsr,type_class,type_size,errcode ) -! -! write dataset. -! -f_ptr = C_LOC(buf3(1,1,1)) -CALL h5ltmake_dataset_f(file_id, dsetname3, rank, dims, H5T_NATIVE_REAL, f_ptr, errcode) -!CALL h5ltmake_dataset_f(file_id, dsetname3, rank, dims, H5T_NATIVE_REAL, buf3, errcode) + ! + ! compare dimensions + ! + DO i = 1, rank + IF ( dimsr(i) .NE. dims(i) ) THEN + PRINT *, 'dimensions differ ' + STOP + ENDIF + END DO -! -! read dataset. -! -f_ptr = C_LOC(buf3r(1,1,1)) -CALL h5ltread_dataset_f(file_id, dsetname3, H5T_NATIVE_REAL, f_ptr, errcode) -!CALL h5ltread_dataset_f(file_id, dsetname3, H5T_NATIVE_REAL, buf3r, dims, errcode) + !------------------------------------------------------------------------- + ! CHECKING NON-NATIVE INTEGER TYPES + !------------------------------------------------------------------------- -! -! compare read and write buffers. -! -DO i = 1, dims(1) - DO j = 1, dims(2) - DO k = 1, dims(3) - IF ( buf3(i,j,k) .NE. buf3r(i,j,k) ) THEN - PRINT *, 'read buffer differs from write buffer' - PRINT *, buf3r(i,j,k), ' and ', buf3(i,j,k) - STOP - ENDIF - END DO - END DO -END DO +#if H5_HAVE_Fortran_INTEGER_SIZEOF_16!=0 + ! (A) CHECKING INTEGER*16 + ! + ! (i.a) write dataset using F2003 interface + ! + type_id = H5kind_to_type(KIND(dset_data_i32(1,1,1)), H5_INTEGER_KIND) + f_ptr = C_LOC(dset_data_i32(1,1,1)) + CALL h5ltmake_dataset_f(file_id, dsetname16a, rank, dims, type_id, f_ptr, errcode) + ! + ! (i.b) read dataset using F2003 interface + ! + f_ptr = C_LOC(data_out_i32(1,1,1)) + CALL h5ltread_dataset_f(file_id, dsetname16a, type_id, f_ptr, errcode) -!------------------------------------------------------------------------- -! H5T_NATIVE_DOUBLE -!------------------------------------------------------------------------- + ! + ! compare read and write buffers. + ! + DO i = 1, dims(1) + DO j = 1, dims(2) + DO k = 1, dims(3) + IF ( dset_data_i32(i,j,k) .NE. data_out_i32(i,j,k) ) THEN + PRINT *, 'read buffer differs from write buffer' + PRINT *, dset_data_i32(i,j,k), ' and ', data_out_i32(i,j,k) + STOP + ENDIF + END DO + END DO + ENDDO -! -! write dataset. -! -f_ptr = C_LOC(buf4(1,1,1)) -CALL h5ltmake_dataset_f(file_id, dsetname4, rank, dims, H5T_NATIVE_DOUBLE, f_ptr, errcode) + ! + ! (ii.a) write dataset using F90 interface + ! + type_id = H5kind_to_type(KIND(dset_data_i32(1,1,1)), H5_INTEGER_KIND) + CALL h5ltmake_dataset_f(file_id, dsetname16b, rank, dims, type_id, dset_data_i32, errcode) + ! + ! (ii.b) read dataset using F90 interface + ! + CALL h5ltread_dataset_f(file_id, dsetname16b, type_id, data_out_i32, dims, errcode) -! -! read dataset. -! -f_ptr = C_LOC(buf4r(1,1,1)) -CALL h5ltread_dataset_f(file_id, dsetname4, H5T_NATIVE_DOUBLE, f_ptr, errcode) + ! + ! compare read and write buffers. + ! + DO i = 1, dims(1) + DO j = 1, dims(2) + DO k = 1, dims(3) + IF ( dset_data_i32(i,j,k) .NE. data_out_i32(i,j,k) ) THEN + PRINT *, 'read buffer differs from write buffer' + PRINT *, dset_data_i32(i,j,k), ' and ', data_out_i32(i,j,k) + STOP + ENDIF + END DO + END DO + ENDDO -! -! compare read and write buffers. -! -DO i = 1, dims(1) - DO j = 1, dims(2) - DO k = 1, dims(3) - IF ( buf4(i,j,k) .NE. buf4r(i,j,k) ) THEN - PRINT *, 'read buffer differs from write buffer' - PRINT *, buf4r(i,j,k), ' and ', buf4(i,j,k) - STOP - ENDIF - END DO - END DO -END DO + ! + ! (iii.a) write dataset using F90 H5LTmake_dataset_int_f interface + ! + CALL h5ltmake_dataset_int_f(file_id, dsetname16c, rank, dims, dset_data_i32, errcode) -CALL h5ltget_dataset_info_f(file_id,dsetname4,dimsr,type_class,type_size,errcode ) + ! + ! (iii.b) read dataset using F90 H5LTmake_dataset_int_f interface + ! + CALL h5ltread_dataset_int_f(file_id, dsetname16c, data_out_i32, dims, errcode) -! -! compare dimensions -! -DO i = 1, rank - IF ( dimsr(i) .NE. dims(i) ) THEN - PRINT *, 'dimensions differ ' - STOP - ENDIF -END DO + ! + ! compare read and write buffers. + ! + DO i = 1, dims(1) + DO j = 1, dims(2) + DO k = 1, dims(3) + IF ( dset_data_i32(i,j,k) .NE. data_out_i32(i,j,k) ) THEN + PRINT *, 'read buffer differs from write buffer' + PRINT *, dset_data_i32(i,j,k), ' and ', data_out_i32(i,j,k) + STOP + ENDIF + END DO + END DO + ENDDO -! -! Close the file. -! -CALL h5fclose_f(file_id, errcode) +#endif -! -! Close FORTRAN predefined datatypes. -! -CALL h5close_f(errcode) + ! + ! Close the file. + ! + CALL h5fclose_f(file_id, errcode) -CALL passed() -! -! end function. -! + ! + ! Close FORTRAN predefined datatypes. + ! + CALL h5close_f(errcode) + + CALL passed() + ! + ! end function. + ! END SUBROUTINE test_dataset3D !------------------------------------------------------------------------- @@ -623,6 +719,7 @@ SUBROUTINE test_datasetND(rank) CHARACTER(LEN=5), PARAMETER :: dsetname2 = "dset2" ! Dataset name CHARACTER(LEN=5), PARAMETER :: dsetname3 = "dset3" ! Dataset name CHARACTER(LEN=5), PARAMETER :: dsetname4 = "dset4" ! Dataset name + CHARACTER(LEN=5), PARAMETER :: dsetname5 = "dset5" ! Dataset name INTEGER(HID_T) :: file_id ! File identifier INTEGER(HSIZE_T), DIMENSION(7) :: dims INTEGER(HSIZE_T), DIMENSION(7) :: dimsr ! Dataset dimensions @@ -650,29 +747,41 @@ SUBROUTINE test_datasetND(rank) DOUBLE PRECISION, ALLOCATABLE, DIMENSION(:,:,:,:,:,:), TARGET :: dbufr_6 ! Data buffer DOUBLE PRECISION, ALLOCATABLE, DIMENSION(:,:,:,:,:,:,:), TARGET :: dbuf_7 ! Data buffer DOUBLE PRECISION, ALLOCATABLE, DIMENSION(:,:,:,:,:,:,:), TARGET :: dbufr_7 ! Data buffer - INTEGER :: errcode ! Error flag - INTEGER(HSIZE_T) :: i, j, k, l, m, n, o, nn ! general purpose integers + CHARACTER(LEN=5), ALLOCATABLE, DIMENSION(:,:,:,:), TARGET :: cbuf_4 ! Data buffer + CHARACTER(LEN=5), ALLOCATABLE, DIMENSION(:,:,:,:), TARGET :: cbufr_4 ! Data buffer + CHARACTER(LEN=5), ALLOCATABLE, DIMENSION(:,:,:,:,:), TARGET :: cbuf_5 ! Data buffer + CHARACTER(LEN=5), ALLOCATABLE, DIMENSION(:,:,:,:,:), TARGET :: cbufr_5 ! Data buffer + CHARACTER(LEN=5), ALLOCATABLE, DIMENSION(:,:,:,:,:,:), TARGET :: cbuf_6 ! Data buffer + CHARACTER(LEN=5), ALLOCATABLE, DIMENSION(:,:,:,:,:,:), TARGET :: cbufr_6 ! Data buffer + CHARACTER(LEN=5), ALLOCATABLE, DIMENSION(:,:,:,:,:,:,:), TARGET :: cbuf_7 ! Data buffer + CHARACTER(LEN=5), ALLOCATABLE, DIMENSION(:,:,:,:,:,:,:), TARGET :: cbufr_7 ! Data buffer + INTEGER :: errcode ! Error flag + INTEGER(HSIZE_T) :: i, j, k, l, m, n, o, nn ! general purpose integers INTEGER :: type_class INTEGER(SIZE_T) :: type_size CHARACTER(LEN=1) :: ichr1 + CHARACTER(LEN=3) :: ichr3 TYPE(C_PTR) :: f_ptr + INTEGER(HID_T) :: type_id WRITE(ichr1,'(I1.1)') rank CALL test_begin(' Make/Read datasets ('//ichr1//'D) ') -! -! Initialize the data array. -! + ! + ! Initialize the data array. + ! IF(rank.EQ.4)THEN - + ALLOCATE(ibuf_4 (1:DIM1,1:DIM2,1:DIM3,1:DIM4)) ALLOCATE(ibufr_4(1:DIM1,1:DIM2,1:DIM3,1:DIM4)) ALLOCATE(rbuf_4 (1:DIM1,1:DIM2,1:DIM3,1:DIM4)) ALLOCATE(rbufr_4(1:DIM1,1:DIM2,1:DIM3,1:DIM4)) ALLOCATE(dbuf_4 (1:DIM1,1:DIM2,1:DIM3,1:DIM4)) ALLOCATE(dbufr_4(1:DIM1,1:DIM2,1:DIM3,1:DIM4)) + ALLOCATE(cbuf_4 (1:DIM1,1:DIM2,1:DIM3,1:DIM4)) + ALLOCATE(cbufr_4(1:DIM1,1:DIM2,1:DIM3,1:DIM4)) dims(1:7) = (/DIM1,DIM2,DIM3,DIM4,0,0,0/) - + nn = 1 DO i = 1, DIM1 DO j = 1, DIM2 @@ -681,12 +790,14 @@ SUBROUTINE test_datasetND(rank) ibuf_4(i,j,k,l) = INT(nn) rbuf_4(i,j,k,l) = INT(nn) dbuf_4(i,j,k,l) = INT(nn) + WRITE(cbuf_4(i,j,k,l),'(I5.5)') nn nn = nn + 1 END DO END DO END DO + ENDDO - + ELSE IF(rank.EQ.5)THEN ALLOCATE(ibuf_5 (1:DIM1,1:DIM2,1:DIM3,1:DIM4,1:DIM5)) @@ -695,9 +806,11 @@ SUBROUTINE test_datasetND(rank) ALLOCATE(rbufr_5(1:DIM1,1:DIM2,1:DIM3,1:DIM4,1:DIM5)) ALLOCATE(dbuf_5 (1:DIM1,1:DIM2,1:DIM3,1:DIM4,1:DIM5)) ALLOCATE(dbufr_5(1:DIM1,1:DIM2,1:DIM3,1:DIM4,1:DIM5)) + ALLOCATE(cbuf_5 (1:DIM1,1:DIM2,1:DIM3,1:DIM4,1:DIM5)) + ALLOCATE(cbufr_5(1:DIM1,1:DIM2,1:DIM3,1:DIM4,1:DIM5)) dims(1:7) = (/DIM1,DIM2,DIM3,DIM4,DIM5,0,0/) - + nn = 1 DO i = 1, DIM1 DO j = 1, DIM2 @@ -707,6 +820,7 @@ SUBROUTINE test_datasetND(rank) ibuf_5(i,j,k,l,m) = INT(nn) rbuf_5(i,j,k,l,m) = INT(nn) dbuf_5(i,j,k,l,m) = INT(nn) + WRITE(cbuf_5(i,j,k,l,m),'(I5.5)') nn nn = nn + 1 END DO END DO @@ -722,9 +836,11 @@ SUBROUTINE test_datasetND(rank) ALLOCATE(rbufr_6(1:DIM1,1:DIM2,1:DIM3,1:DIM4,1:DIM5,1:DIM6)) ALLOCATE(dbuf_6 (1:DIM1,1:DIM2,1:DIM3,1:DIM4,1:DIM5,1:DIM6)) ALLOCATE(dbufr_6(1:DIM1,1:DIM2,1:DIM3,1:DIM4,1:DIM5,1:DIM6)) + ALLOCATE(cbuf_6 (1:DIM1,1:DIM2,1:DIM3,1:DIM4,1:DIM5,1:DIM6)) + ALLOCATE(cbufr_6(1:DIM1,1:DIM2,1:DIM3,1:DIM4,1:DIM5,1:DIM6)) dims(1:7) = (/DIM1,DIM2,DIM3,DIM4,DIM5,DIM6,0/) - + nn = 1 DO i = 1, DIM1 DO j = 1, DIM2 @@ -735,6 +851,7 @@ SUBROUTINE test_datasetND(rank) ibuf_6(i,j,k,l,m,n) = INT(nn) rbuf_6(i,j,k,l,m,n) = INT(nn) dbuf_6(i,j,k,l,m,n) = INT(nn) + WRITE(cbuf_6(i,j,k,l,m,n),'(I5.5)') nn nn = nn + 1 END DO END DO @@ -742,18 +859,20 @@ SUBROUTINE test_datasetND(rank) ENDDO ENDDO ENDDO - + ELSE IF(rank.EQ.7)THEN - + ALLOCATE(ibuf_7 (1:DIM1,1:DIM2,1:DIM3,1:DIM4,1:DIM5,1:DIM6,1:DIM7)) ALLOCATE(ibufr_7(1:DIM1,1:DIM2,1:DIM3,1:DIM4,1:DIM5,1:DIM6,1:DIM7)) ALLOCATE(rbuf_7 (1:DIM1,1:DIM2,1:DIM3,1:DIM4,1:DIM5,1:DIM6,1:DIM7)) ALLOCATE(rbufr_7(1:DIM1,1:DIM2,1:DIM3,1:DIM4,1:DIM5,1:DIM6,1:DIM7)) ALLOCATE(dbuf_7 (1:DIM1,1:DIM2,1:DIM3,1:DIM4,1:DIM5,1:DIM6,1:DIM7)) ALLOCATE(dbufr_7(1:DIM1,1:DIM2,1:DIM3,1:DIM4,1:DIM5,1:DIM6,1:DIM7)) + ALLOCATE(cbuf_7 (1:DIM1,1:DIM2,1:DIM3,1:DIM4,1:DIM5,1:DIM6,1:DIM7)) + ALLOCATE(cbufr_7(1:DIM1,1:DIM2,1:DIM3,1:DIM4,1:DIM5,1:DIM6,1:DIM7)) dims(1:7) = (/DIM1,DIM2,DIM3,DIM4,DIM5,DIM6,DIM7/) - + nn = 1 DO i = 1, DIM1 DO j = 1, DIM2 @@ -765,6 +884,7 @@ SUBROUTINE test_datasetND(rank) ibuf_7(i,j,k,l,m,n,o) = INT(nn) rbuf_7(i,j,k,l,m,n,o) = INT(nn) dbuf_7(i,j,k,l,m,n,o) = INT(nn) + WRITE(cbuf_7(i,j,k,l,m,n,o),'(I5.5)') nn nn = nn + 1 END DO END DO @@ -803,7 +923,7 @@ SUBROUTINE test_datasetND(rank) ELSE IF(rank.EQ.7)THEN CALL h5ltmake_dataset_f(file_id, dsetname2, rank, dims(1:rank), H5T_NATIVE_INTEGER, ibuf_7, errcode) ENDIF - + ! ! read dataset. @@ -874,7 +994,7 @@ SUBROUTINE test_datasetND(rank) IF(rank.EQ.4)THEN f_ptr = C_LOC(rbuf_4(1,1,1,1)) CALL h5ltmake_dataset_f(file_id, dsetname3, rank, dims(1:rank), H5T_NATIVE_REAL, f_ptr, errcode) - ! CALL h5ltmake_dataset_f(file_id, dsetname3, rank, dims(1:rank), H5T_NATIVE_REAL, rbuf_4, errcode) + ! CALL h5ltmake_dataset_f(file_id, dsetname3, rank, dims(1:rank), H5T_NATIVE_REAL, rbuf_4, errcode) ELSE IF(rank.EQ.5)THEN f_ptr = C_LOC(rbuf_5(1,1,1,1,1)) CALL h5ltmake_dataset_f(file_id, dsetname3, rank, dims(1:rank), H5T_NATIVE_REAL, f_ptr, errcode) @@ -887,7 +1007,7 @@ SUBROUTINE test_datasetND(rank) CALL h5ltmake_dataset_f(file_id, dsetname3, rank, dims(1:rank), H5T_NATIVE_REAL, f_ptr, errcode) !CALL h5ltmake_dataset_f(file_id, dsetname3, rank, dims(1:rank), H5T_NATIVE_REAL, rbuf_7, errcode) ENDIF - + ! ! read dataset. @@ -972,7 +1092,6 @@ SUBROUTINE test_datasetND(rank) f_ptr = C_LOC(dbuf_7(1,1,1,1,1,1,1)) CALL h5ltmake_dataset_f(file_id, dsetname4, rank, dims(1:rank), H5T_NATIVE_DOUBLE, f_ptr, errcode) ENDIF - ! ! read dataset. @@ -1037,8 +1156,97 @@ SUBROUTINE test_datasetND(rank) ENDDO ENDDO + !------------------------------------------------------------------------- + ! H5T_NATIVE_CHARACTER ND buffer + !------------------------------------------------------------------------- + + CALL H5Tcopy_f(H5T_FORTRAN_S1, type_id, errcode) + CALL H5Tset_size_f(type_id, 5_SIZE_T, errcode) + ! + ! write dataset. + ! + IF(rank.EQ.4)THEN + f_ptr = C_LOC(cbuf_4(1,1,1,1)(1:1)) + CALL h5ltmake_dataset_f(file_id, dsetname5, rank, dims(1:rank), type_id, f_ptr, errcode) + ELSE IF(rank.EQ.5)THEN + f_ptr = C_LOC(cbuf_5(1,1,1,1,1)(1:1)) + CALL h5ltmake_dataset_f(file_id, dsetname5, rank, dims(1:rank), type_id, f_ptr, errcode) + ELSE IF(rank.EQ.6)THEN + f_ptr = C_LOC(cbuf_6(1,1,1,1,1,1)(1:1)) + CALL h5ltmake_dataset_f(file_id, dsetname5, rank, dims(1:rank), type_id, f_ptr, errcode) + ELSE IF(rank.EQ.7)THEN + f_ptr = C_LOC(cbuf_7(1,1,1,1,1,1,1)(1:1)) + CALL h5ltmake_dataset_f(file_id, dsetname5, rank, dims(1:rank), type_id, f_ptr, errcode) + ENDIF + + ! + ! read dataset. + ! + IF(rank.EQ.4)THEN + f_ptr = C_LOC(cbufr_4(1,1,1,1)(1:1)) + CALL h5ltread_dataset_f(file_id, dsetname5, type_id, f_ptr, errcode) + ELSE IF(rank.EQ.5)THEN + f_ptr = C_LOC(cbufr_5(1,1,1,1,1)(1:1)) + CALL h5ltread_dataset_f(file_id, dsetname5, type_id, f_ptr, errcode) + ELSE IF(rank.EQ.6)THEN + f_ptr = C_LOC(cbufr_6(1,1,1,1,1,1)(1:1)) + CALL h5ltread_dataset_f(file_id, dsetname5, type_id, f_ptr, errcode) + ELSE IF(rank.EQ.7)THEN + f_ptr = C_LOC(cbufr_7(1,1,1,1,1,1,1)(1:1)) + CALL h5ltread_dataset_f(file_id, dsetname5, type_id, f_ptr, errcode) + ENDIF + + + ! + ! compare read and write buffers. + ! + DO i = 1, dims(1) + DO j = 1, dims(2) + DO k = 1, dims(3) + DO l = 1, dims(4) + IF(rank.EQ.4)THEN + IF ( cbuf_4(i,j,k,l) .NE. cbufr_4(i,j,k,l) ) THEN + PRINT *, 'read buffer differs from write buffer (character)' + PRINT *, cbuf_4(i,j,k,l), ' and ', cbufr_4(i,j,k,l) + STOP + ENDIF + ENDIF + DO m = 1, dims(5) + IF(rank.EQ.5)THEN + IF ( cbuf_5(i,j,k,l,m) .NE. cbufr_5(i,j,k,l,m) ) THEN + PRINT *, 'read buffer differs from write buffer (character)' + PRINT *, cbuf_5(i,j,k,l,m), ' and ', cbufr_5(i,j,k,l,m) + STOP + ENDIF + ENDIF + DO n = 1, dims(6) + IF(rank.EQ.6)THEN + IF ( cbuf_6(i,j,k,l,m,n) .NE. cbufr_6(i,j,k,l,m,n) ) THEN + PRINT *, 'read buffer differs from write buffer (character)' + PRINT *, cbuf_6(i,j,k,l,m,n), ' and ', cbufr_6(i,j,k,l,m,n) + STOP + ENDIF + ENDIF + DO o = 1, dims(7) + IF(rank.EQ.7)THEN + IF ( cbuf_7(i,j,k,l,m,n,o) .NE. cbufr_7(i,j,k,l,m,n,o) ) THEN + PRINT *, 'read buffer differs from write buffer (character)' + PRINT *, cbuf_7(i,j,k,l,m,n,o), ' and ', cbufr_7(i,j,k,l,m,n,o) + STOP + ENDIF + ENDIF + ENDDO + ENDDO + ENDDO + ENDDO + ENDDO + ENDDO + ENDDO + CALL h5ltget_dataset_info_f(file_id,dsetname4,dimsr,type_class,type_size,errcode ) + CALL h5tclose_f(type_id,errcode) + ! ! compare dimensions ! @@ -1062,13 +1270,13 @@ SUBROUTINE test_datasetND(rank) ! DEALLOCATE RESOURCES IF(rank.EQ.4)THEN - DEALLOCATE(ibuf_4, ibufr_4, rbuf_4, rbufr_4, dbuf_4, dbufr_4) + DEALLOCATE(ibuf_4, ibufr_4, rbuf_4, rbufr_4, dbuf_4, dbufr_4, cbuf_4, cbufr_4) ELSE IF(rank.EQ.5)THEN - DEALLOCATE(ibuf_5, ibufr_5, rbuf_5, rbufr_5, dbuf_5, dbufr_5) + DEALLOCATE(ibuf_5, ibufr_5, rbuf_5, rbufr_5, dbuf_5, dbufr_5, cbuf_5, cbufr_5) ELSE IF(rank.EQ.6)THEN - DEALLOCATE(ibuf_6, ibufr_6, rbuf_6, rbufr_6, dbuf_6, dbufr_6) + DEALLOCATE(ibuf_6, ibufr_6, rbuf_6, rbufr_6, dbuf_6, dbufr_6, cbuf_6, cbufr_6) ELSE IF(rank.EQ.7)THEN - DEALLOCATE(ibuf_7, ibufr_7, rbuf_7, rbufr_7, dbuf_7, dbufr_7) + DEALLOCATE(ibuf_7, ibufr_7, rbuf_7, rbufr_7, dbuf_7, dbufr_7, cbuf_7, cbufr_7) ENDIF CALL passed() @@ -1078,7 +1286,6 @@ SUBROUTINE test_datasetND(rank) END SUBROUTINE test_datasetND - !------------------------------------------------------------------------- ! test_datasets !------------------------------------------------------------------------- @@ -1094,7 +1301,7 @@ SUBROUTINE test_datasets() CHARACTER(len=9), PARAMETER :: filename = "dsetf4.h5"! File name INTEGER(HID_T) :: file_id ! File identifier INTEGER :: errcode ! Error flag - INTEGER, PARAMETER :: DIM1 = 10 ! Dimension of array + INTEGER, PARAMETER :: DIM1 = 10 ! Dimension of array CHARACTER(LEN=5), PARAMETER :: dsetname1 = "dset1" ! Dataset name CHARACTER(LEN=5), PARAMETER :: dsetname2 = "dset2" ! Dataset name CHARACTER(LEN=5), PARAMETER :: dsetname3 = "dset3" ! Dataset name @@ -1108,10 +1315,10 @@ SUBROUTINE test_datasets() CHARACTER(LEN=8) :: buf1r ! Data buffer INTEGER, DIMENSION(DIM1) :: buf2 ! Data buffer INTEGER, DIMENSION(DIM1) :: bufr2 ! Data buffer - REAL, DIMENSION(DIM1), TARGET :: buf3 ! Data buffer - REAL, DIMENSION(DIM1) , TARGET :: bufr3 ! Data buffer - DOUBLE PRECISION, DIMENSION(DIM1), TARGET :: buf4 ! Data buffer - DOUBLE PRECISION, DIMENSION(DIM1), TARGET :: bufr4 ! Data buffer + REAL, DIMENSION(DIM1), TARGET :: buf3 ! Data buffer + REAL, DIMENSION(DIM1) , TARGET :: bufr3 ! Data buffer + DOUBLE PRECISION, DIMENSION(DIM1), TARGET :: buf4 ! Data buffer + DOUBLE PRECISION, DIMENSION(DIM1), TARGET :: bufr4 ! Data buffer INTEGER :: i, n ! general purpose integer INTEGER :: has ! general purpose integer INTEGER :: type_class @@ -1289,7 +1496,7 @@ SUBROUTINE test_datasets() IF(errcode.LT.0.OR..NOT.path_valid)THEN PRINT *, 'error in h5ltpath_valid_f' STOP - ENDIF + ENDIF ! Should fail, dataset does not exist CALL h5ltpath_valid_f(file_id, "/"//dsetname2//"junk", .TRUE., path_valid, errcode) @@ -1306,14 +1513,14 @@ SUBROUTINE test_datasets() ! Create a dangling soft link CALL h5lcreate_soft_f("/G2", file_id, "/G3", errcode) - + ! Should pass, does not check for dangled link CALL h5ltpath_valid_f(file_id, "/G3", .FALSE., path_valid, errcode) IF(.NOT.path_valid)THEN PRINT *, 'error in h5ltpath_valid_f' STOP ENDIF - + ! Should fail, dangled link CALL h5ltpath_valid_f(file_id, "/G2", .TRUE., path_valid, errcode) IF(path_valid)THEN @@ -1336,7 +1543,6 @@ SUBROUTINE test_datasets() STOP ENDIF - !------------------------------------------------------------------------- ! test h5ltfind_dataset_f function !------------------------------------------------------------------------- @@ -1352,7 +1558,6 @@ SUBROUTINE test_datasets() ! test h5ltget_dataset_info_f function !------------------------------------------------------------------------- - CALL h5ltget_dataset_info_f(file_id,dsetname4,dimsr,type_class,type_size,errcode ) ! @@ -1402,7 +1607,7 @@ SUBROUTINE test_attributes() CHARACTER(len=9), PARAMETER :: filename = "dsetf5.h5"! File name CHARACTER(len=9), PARAMETER :: filename1 ="tattr.h5" ! C written attribute file INTEGER(HID_T) :: file_id ! File identifier -! INTEGER(HID_T) :: file_id1 + ! INTEGER(HID_T) :: file_id1 INTEGER, PARAMETER :: DIM1 = 10 ! Dimension of array CHARACTER(LEN=5), PARAMETER :: attrname1 = "attr1" ! Attribute name CHARACTER(LEN=5), PARAMETER :: attrname2 = "attr2" ! Attribute name @@ -1413,8 +1618,8 @@ SUBROUTINE test_attributes() CHARACTER(LEN=16), PARAMETER :: buf_c = "string attribute" CHARACTER(LEN=8) :: bufr1 ! Data buffer CHARACTER(LEN=10) :: bufr1_lg ! Data buffer -! CHARACTER(LEN=16) :: bufr_c ! Data buffer -! CHARACTER(LEN=18) :: bufr_c_lg ! Data buffer + ! CHARACTER(LEN=16) :: bufr_c ! Data buffer + ! CHARACTER(LEN=18) :: bufr_c_lg ! Data buffer INTEGER, DIMENSION(DIM1) :: buf2 ! Data buffer INTEGER, DIMENSION(DIM1) :: bufr2 ! Data buffer REAL, DIMENSION(DIM1), target :: buf3 ! Data buffer @@ -1547,41 +1752,41 @@ SUBROUTINE test_attributes() IF(SizeOf_buf_type.LT.16)THEN ! MSB can't handle 16 byte reals - CALL test_begin(' Set/Get attributes double ') + CALL test_begin(' Set/Get attributes double ') - ! - ! write attribute. - ! - f_ptr = C_LOC(buf4(1)) - CALL h5ltset_attribute_f(file_id,dsetname1,attrname4,f_ptr,"real", SizeOf_buf_type, size, errcode) + ! + ! write attribute. + ! + f_ptr = C_LOC(buf4(1)) + CALL h5ltset_attribute_f(file_id,dsetname1,attrname4,f_ptr,"real", SizeOf_buf_type, size, errcode) -! CALL h5ltset_attribute_double_f(file_id,dsetname1,attrname4,buf4, size, errcode) + ! CALL h5ltset_attribute_double_f(file_id,dsetname1,attrname4,buf4, size, errcode) - ! - ! read attribute. - ! + ! + ! read attribute. + ! #ifdef H5_FORTRAN_HAVE_STORAGE_SIZE - SizeOf_buf_type = STORAGE_SIZE(bufr4(1), c_size_t)/STORAGE_SIZE(c_char_'a',c_size_t) + SizeOf_buf_type = STORAGE_SIZE(bufr4(1), c_size_t)/STORAGE_SIZE(c_char_'a',c_size_t) #else - SizeOf_buf_type = SIZEOF(bufr4(1)) + SizeOf_buf_type = SIZEOF(bufr4(1)) #endif - f_ptr = C_LOC(bufr4(1)) - CALL h5ltget_attribute_f(file_id,dsetname1,attrname4,f_ptr,"REAL",SizeOf_buf_type,errcode) - - ! - ! compare read and write buffers. - ! - DO i = 1, DIM1 - IF ( buf4(i) .NE. bufr4(i) ) THEN - PRINT *, 'read buffer differs from write buffer' - PRINT *, bufr4(i), ' and ', buf4(i) - STOP - ENDIF - END DO + f_ptr = C_LOC(bufr4(1)) + CALL h5ltget_attribute_f(file_id,dsetname1,attrname4,f_ptr,"REAL",SizeOf_buf_type,errcode) - CALL passed() + ! + ! compare read and write buffers. + ! + DO i = 1, DIM1 + IF ( buf4(i) .NE. bufr4(i) ) THEN + PRINT *, 'read buffer differs from write buffer' + PRINT *, bufr4(i), ' and ', buf4(i) + STOP + ENDIF + END DO + + CALL passed() ENDIF -- cgit v0.12 From 1ac1dfb40fc603fdb5448a64eb46786f7c621185 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Thu, 10 Sep 2015 22:03:41 -0500 Subject: [svn-r27755] Changed direct VFD default to OFF in CMake to match Autotools. Tested on: jam w/ CMake --- config/cmake/ConfigureChecks.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/cmake/ConfigureChecks.cmake b/config/cmake/ConfigureChecks.cmake index b9f18a9..8bd6f45 100644 --- a/config/cmake/ConfigureChecks.cmake +++ b/config/cmake/ConfigureChecks.cmake @@ -126,7 +126,7 @@ endif (NOT WINDOWS) # Check if Direct I/O driver works #----------------------------------------------------------------------------- if (NOT WINDOWS) - option (HDF5_ENABLE_DIRECT_VFD "Build the Direct I/O Virtual File Driver" ON) + option (HDF5_ENABLE_DIRECT_VFD "Build the Direct I/O Virtual File Driver" OFF) if (HDF5_ENABLE_DIRECT_VFD) set (msg "Performing TEST_DIRECT_VFD_WORKS") set (MACRO_CHECK_FUNCTION_DEFINITIONS "-DTEST_DIRECT_VFD_WORKS -D_GNU_SOURCE ${CMAKE_REQUIRED_FLAGS}") -- cgit v0.12 From f16361d5f1dc70c344d8143270aa4aeaa867f244 Mon Sep 17 00:00:00 2001 From: HDF Tester Date: Sun, 13 Sep 2015 19:43:47 -0500 Subject: [svn-r27767] Snapshot version 1.9 release 231 --- README.txt | 2 +- c++/src/Makefile.in | 2 +- c++/src/cpp_doc_config | 2 +- config/lt_vers.am | 2 +- configure | 22 +++++++++++----------- configure.ac | 2 +- fortran/src/Makefile.in | 2 +- hl/c++/src/Makefile.in | 2 +- hl/fortran/src/Makefile.in | 2 +- hl/src/Makefile.in | 2 +- release_docs/RELEASE.txt | 2 +- src/H5public.h | 4 ++-- src/Makefile.in | 2 +- 13 files changed, 24 insertions(+), 24 deletions(-) diff --git a/README.txt b/README.txt index 2bcb781..7333a85 100644 --- a/README.txt +++ b/README.txt @@ -1,4 +1,4 @@ -HDF5 version 1.9.231 currently under development +HDF5 version 1.9.232 currently under development Please refer to the release_docs/INSTALL file for installation instructions. ------------------------------------------------------------------------------ diff --git a/c++/src/Makefile.in b/c++/src/Makefile.in index 8eeb1bb..98e31e8 100644 --- a/c++/src/Makefile.in +++ b/c++/src/Makefile.in @@ -689,7 +689,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 # After making changes, run bin/reconfigure to update other configure related # files like Makefile.in. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 221 +LT_VERS_REVISION = 222 LT_VERS_AGE = 0 # This is our main target diff --git a/c++/src/cpp_doc_config b/c++/src/cpp_doc_config index b7754ce..c020531 100644 --- a/c++/src/cpp_doc_config +++ b/c++/src/cpp_doc_config @@ -38,7 +38,7 @@ PROJECT_NAME = "HDF5 C++ API" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = "1.9.231 currently under development" +PROJECT_NUMBER = "1.9.232 currently under development" # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/config/lt_vers.am b/config/lt_vers.am index 21395cf..36de8fe 100644 --- a/config/lt_vers.am +++ b/config/lt_vers.am @@ -19,7 +19,7 @@ # After making changes, run bin/reconfigure to update other configure related # files like Makefile.in. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 221 +LT_VERS_REVISION = 222 LT_VERS_AGE = 0 ## If the API changes *at all*, increment LT_VERS_INTERFACE and diff --git a/configure b/configure index c563592..1bbbdf6 100755 --- a/configure +++ b/configure @@ -1,7 +1,7 @@ #! /bin/sh # From configure.ac Id: configure.ac 22697 2012-08-19 14:35:47Z hdftest . # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for HDF5 1.9.231. +# Generated by GNU Autoconf 2.69 for HDF5 1.9.232. # # Report bugs to . # @@ -591,8 +591,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='HDF5' PACKAGE_TARNAME='hdf5' -PACKAGE_VERSION='1.9.231' -PACKAGE_STRING='HDF5 1.9.231' +PACKAGE_VERSION='1.9.232' +PACKAGE_STRING='HDF5 1.9.232' PACKAGE_BUGREPORT='help@hdfgroup.org' PACKAGE_URL='' @@ -1480,7 +1480,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures HDF5 1.9.231 to adapt to many kinds of systems. +\`configure' configures HDF5 1.9.232 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1550,7 +1550,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of HDF5 1.9.231:";; + short | recursive ) echo "Configuration of HDF5 1.9.232:";; esac cat <<\_ACEOF @@ -1738,7 +1738,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -HDF5 configure 1.9.231 +HDF5 configure 1.9.232 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2653,7 +2653,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by HDF5 $as_me 1.9.231, which was +It was created by HDF5 $as_me 1.9.232, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3525,7 +3525,7 @@ fi # Define the identity of the package. PACKAGE='hdf5' - VERSION='1.9.231' + VERSION='1.9.232' cat >>confdefs.h <<_ACEOF @@ -29305,7 +29305,7 @@ Usage: $0 [OPTIONS] Report bugs to ." lt_cl_version="\ -HDF5 config.lt 1.9.231 +HDF5 config.lt 1.9.232 configured by $0, generated by GNU Autoconf 2.69. Copyright (C) 2011 Free Software Foundation, Inc. @@ -31401,7 +31401,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by HDF5 $as_me 1.9.231, which was +This file was extended by HDF5 $as_me 1.9.232, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -31467,7 +31467,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -HDF5 config.status 1.9.231 +HDF5 config.status 1.9.232 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/configure.ac b/configure.ac index c341df5..a8e5960 100644 --- a/configure.ac +++ b/configure.ac @@ -26,7 +26,7 @@ AC_PREREQ([2.69]) ## NOTE: Do not forget to change the version number here when we do a ## release!!! ## -AC_INIT([HDF5], [1.9.231], [help@hdfgroup.org]) +AC_INIT([HDF5], [1.9.232], [help@hdfgroup.org]) AC_CONFIG_SRCDIR([src/H5.c]) AC_CONFIG_HEADERS([src/H5config.h]) diff --git a/fortran/src/Makefile.in b/fortran/src/Makefile.in index 957a76d..7d78565 100644 --- a/fortran/src/Makefile.in +++ b/fortran/src/Makefile.in @@ -726,7 +726,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 # After making changes, run bin/reconfigure to update other configure related # files like Makefile.in. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 221 +LT_VERS_REVISION = 222 LT_VERS_AGE = 0 AM_FCLIBS = $(LIBHDF5) diff --git a/hl/c++/src/Makefile.in b/hl/c++/src/Makefile.in index 84694ac..385b720 100644 --- a/hl/c++/src/Makefile.in +++ b/hl/c++/src/Makefile.in @@ -681,7 +681,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 # After making changes, run bin/reconfigure to update other configure related # files like Makefile.in. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 221 +LT_VERS_REVISION = 222 LT_VERS_AGE = 0 # This is our main target diff --git a/hl/fortran/src/Makefile.in b/hl/fortran/src/Makefile.in index 85e5d42..4fada70 100644 --- a/hl/fortran/src/Makefile.in +++ b/hl/fortran/src/Makefile.in @@ -709,7 +709,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 # After making changes, run bin/reconfigure to update other configure related # files like Makefile.in. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 221 +LT_VERS_REVISION = 222 LT_VERS_AGE = 0 # Our main target, the high-level fortran library diff --git a/hl/src/Makefile.in b/hl/src/Makefile.in index 4624a08..32e9f20 100644 --- a/hl/src/Makefile.in +++ b/hl/src/Makefile.in @@ -680,7 +680,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 # After making changes, run bin/reconfigure to update other configure related # files like Makefile.in. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 221 +LT_VERS_REVISION = 222 LT_VERS_AGE = 0 # This library is our main target. diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index d1eba9b..9be3053 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -1,4 +1,4 @@ -HDF5 version 1.9.231 currently under development +HDF5 version 1.9.232 currently under development ================================================================================ diff --git a/src/H5public.h b/src/H5public.h index 816e50a..e1fdd9e 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -94,10 +94,10 @@ extern "C" { /* Version numbers */ #define H5_VERS_MAJOR 1 /* For major interface/format changes */ #define H5_VERS_MINOR 9 /* For minor interface/format changes */ -#define H5_VERS_RELEASE 231 /* For tweaks, bug-fixes, or development */ +#define H5_VERS_RELEASE 232 /* For tweaks, bug-fixes, or development */ #define H5_VERS_SUBRELEASE "" /* For pre-releases like snap0 */ /* Empty string for real releases. */ -#define H5_VERS_INFO "HDF5 library version: 1.9.231" /* Full version string */ +#define H5_VERS_INFO "HDF5 library version: 1.9.232" /* Full version string */ #define H5check() H5check_version(H5_VERS_MAJOR,H5_VERS_MINOR, \ H5_VERS_RELEASE) diff --git a/src/Makefile.in b/src/Makefile.in index 0ee50a8..7cf8ec3 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -742,7 +742,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 # After making changes, run bin/reconfigure to update other configure related # files like Makefile.in. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 221 +LT_VERS_REVISION = 222 LT_VERS_AGE = 0 # Our main target, the HDF5 library -- cgit v0.12 From 102337449220dfc29be1cce29147704b9c760832 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Sun, 13 Sep 2015 22:58:59 -0500 Subject: [svn-r27768] Description: Complete revamp of package initialization/shutdown mechanism in the library. Each package now has a single init/term routine. This new way should avoid packages being re-initialized during library shutdown and is also be _much_ more proactive about giving feedback for resource leaks internal to the library. Introduces a new "module" header file for packages in the library (e.g src/H5Fmodule.h) which sets up some necessary package configuration macros for the FUNC_ENTER/LEAVE macros. (The VFL drivers have their own slightly modified version of this header, src/H5FDdrvr_module.h) Also cleaned up a bunch of resources leaks all across the library and tests, along with addressing many warnings, as I encountered them. Tested on: MacOSX/64 10.10.5 (amazon) w/serial & parallel Linux/64 3.10.x (kituo) w/serial & parallel Linux/64 2.6.x (ostrich) w/serial --- MANIFEST | 31 ++ c++/test/testhdf5.cpp | 1 + c++/test/tlinks.cpp | 4 +- c++/test/ttypes.cpp | 2 +- fortran/test/tH5P_F03.F90 | 3 + src/H5.c | 51 ++- src/H5A.c | 120 +++--- src/H5AC.c | 55 ++- src/H5ACmodule.h | 35 ++ src/H5ACmpio.c | 33 +- src/H5ACpkg.h | 2 +- src/H5Abtree2.c | 6 +- src/H5Adense.c | 8 +- src/H5Adeprec.c | 52 +-- src/H5Aint.c | 70 ++-- src/H5Amodule.h | 35 ++ src/H5Apkg.h | 4 +- src/H5Atest.c | 4 +- src/H5B.c | 13 +- src/H5B2.c | 10 +- src/H5B2cache.c | 8 +- src/H5B2dbg.c | 3 +- src/H5B2hdr.c | 9 +- src/H5B2int.c | 7 +- src/H5B2module.h | 36 ++ src/H5B2pkg.h | 2 +- src/H5B2stat.c | 2 +- src/H5B2test.c | 6 +- src/H5Bcache.c | 4 +- src/H5Bdbg.c | 2 +- src/H5Bmodule.h | 35 ++ src/H5Bpkg.h | 2 +- src/H5C.c | 12 +- src/H5CS.c | 167 ++++---- src/H5CSprivate.h | 22 +- src/H5Cmodule.h | 35 ++ src/H5Cmpio.c | 4 +- src/H5Cpkg.h | 2 +- src/H5D.c | 53 +-- src/H5Dbtree.c | 12 +- src/H5Dchunk.c | 10 +- src/H5Dcompact.c | 6 +- src/H5Dcontig.c | 11 +- src/H5Ddbg.c | 25 +- src/H5Ddeprec.c | 50 +-- src/H5Defl.c | 6 +- src/H5Dfill.c | 3 +- src/H5Dint.c | 113 ++++-- src/H5Dio.c | 2 +- src/H5Dlayout.c | 4 +- src/H5Dmodule.h | 35 ++ src/H5Dmpio.c | 2 +- src/H5Doh.c | 18 +- src/H5Dpkg.h | 4 +- src/H5Dscatgath.c | 2 +- src/H5Dselect.c | 2 +- src/H5Dtest.c | 2 +- src/H5E.c | 140 ++++--- src/H5EA.c | 5 +- src/H5EAcache.c | 2 +- src/H5EAdbg.c | 2 +- src/H5EAdblkpage.c | 2 +- src/H5EAdblock.c | 2 +- src/H5EAhdr.c | 2 +- src/H5EAiblock.c | 2 +- src/H5EAint.c | 2 +- src/H5EAmodule.h | 35 ++ src/H5EApkg.h | 12 +- src/H5EAsblock.c | 2 +- src/H5EAstat.c | 2 +- src/H5EAtest.c | 2 +- src/H5Edeprec.c | 50 +-- src/H5Eint.c | 28 +- src/H5Emodule.h | 36 ++ src/H5Epkg.h | 2 +- src/H5F.c | 70 +--- src/H5FA.c | 5 +- src/H5FAcache.c | 2 +- src/H5FAdbg.c | 2 +- src/H5FAdblkpage.c | 2 +- src/H5FAdblock.c | 2 +- src/H5FAhdr.c | 2 +- src/H5FAmodule.h | 35 ++ src/H5FApkg.h | 12 +- src/H5FAstat.c | 2 +- src/H5FAtest.c | 2 +- src/H5FD.c | 76 ++-- src/H5FDcore.c | 243 ++++++------ src/H5FDdirect.c | 19 +- src/H5FDdrvr_module.h | 35 ++ src/H5FDfamily.c | 22 +- src/H5FDint.c | 31 +- src/H5FDlog.c | 21 +- src/H5FDmodule.h | 35 ++ src/H5FDmpio.c | 14 +- src/H5FDpkg.h | 3 +- src/H5FDsec2.c | 15 +- src/H5FDspace.c | 33 +- src/H5FL.c | 687 ++++++++++++++++---------------- src/H5FLmodule.h | 35 ++ src/H5FO.c | 2 +- src/H5FS.c | 13 +- src/H5FScache.c | 10 +- src/H5FSdbg.c | 4 +- src/H5FSmodule.h | 35 ++ src/H5FSpkg.h | 2 +- src/H5FSsection.c | 6 +- src/H5FSstat.c | 4 +- src/H5FStest.c | 4 +- src/H5Faccum.c | 2 +- src/H5Fcwfs.c | 14 +- src/H5Fdbg.c | 4 +- src/H5Fdeprec.c | 50 +-- src/H5Fefc.c | 4 +- src/H5Ffake.c | 29 +- src/H5Fint.c | 39 +- src/H5Fio.c | 2 +- src/H5Fmodule.h | 35 ++ src/H5Fmount.c | 29 +- src/H5Fmpi.c | 2 +- src/H5Fpkg.h | 4 +- src/H5Fprivate.h | 6 +- src/H5Fquery.c | 4 +- src/H5Fsfile.c | 2 +- src/H5Fsuper.c | 27 +- src/H5Fsuper_cache.c | 8 +- src/H5Ftest.c | 8 +- src/H5G.c | 117 +++--- src/H5Gbtree2.c | 6 +- src/H5Gcache.c | 4 +- src/H5Gcompact.c | 12 +- src/H5Gdense.c | 12 +- src/H5Gdeprec.c | 54 +-- src/H5Gent.c | 2 +- src/H5Gint.c | 45 +-- src/H5Glink.c | 6 +- src/H5Gloc.c | 6 +- src/H5Gmodule.h | 35 ++ src/H5Gname.c | 12 +- src/H5Gnode.c | 4 +- src/H5Gobj.c | 10 +- src/H5Goh.c | 14 +- src/H5Gpkg.h | 4 +- src/H5Gprivate.h | 6 +- src/H5Groot.c | 4 +- src/H5Gstab.c | 10 +- src/H5Gtest.c | 2 +- src/H5Gtraverse.c | 2 +- src/H5HF.c | 10 +- src/H5HFbtree2.c | 8 +- src/H5HFcache.c | 8 +- src/H5HFdbg.c | 2 +- src/H5HFdblock.c | 5 +- src/H5HFdtable.c | 9 +- src/H5HFhdr.c | 9 +- src/H5HFhuge.c | 4 +- src/H5HFiblock.c | 5 +- src/H5HFiter.c | 3 +- src/H5HFman.c | 3 +- src/H5HFmodule.h | 35 ++ src/H5HFpkg.h | 2 +- src/H5HFsection.c | 27 +- src/H5HFspace.c | 5 +- src/H5HFstat.c | 3 +- src/H5HFtest.c | 15 +- src/H5HFtiny.c | 2 +- src/H5HG.c | 13 +- src/H5HGcache.c | 4 +- src/H5HGdbg.c | 2 +- src/H5HGmodule.h | 35 ++ src/H5HGpkg.h | 2 +- src/H5HGprivate.h | 6 +- src/H5HGquery.c | 2 +- src/H5HL.c | 15 +- src/H5HLcache.c | 6 +- src/H5HLdbg.c | 3 +- src/H5HLint.c | 32 +- src/H5HLmodule.h | 35 ++ src/H5HLpkg.h | 2 +- src/H5I.c | 144 +++---- src/H5Imodule.h | 35 ++ src/H5Ipkg.h | 2 +- src/H5Itest.c | 4 +- src/H5L.c | 45 ++- src/H5Lexternal.c | 90 +++-- src/H5Lmodule.h | 36 ++ src/H5Lpkg.h | 2 +- src/H5MF.c | 17 +- src/H5MFaggr.c | 10 +- src/H5MFdbg.c | 4 +- src/H5MFmodule.h | 35 ++ src/H5MFpkg.h | 2 +- src/H5MFsection.c | 14 +- src/H5MP.c | 11 +- src/H5MPmodule.h | 35 ++ src/H5MPpkg.h | 2 +- src/H5MPtest.c | 2 +- src/H5O.c | 81 ++-- src/H5Oainfo.c | 13 +- src/H5Oalloc.c | 11 +- src/H5Oattr.c | 16 +- src/H5Oattribute.c | 17 +- src/H5Obogus.c | 3 +- src/H5Obtreek.c | 7 +- src/H5Ocache.c | 6 +- src/H5Ochunk.c | 5 +- src/H5Ocont.c | 7 +- src/H5Ocopy.c | 3 +- src/H5Odbg.c | 7 +- src/H5Odrvinfo.c | 9 +- src/H5Odtype.c | 44 ++- src/H5Oefl.c | 14 +- src/H5Ofill.c | 13 +- src/H5Ofsinfo.c | 13 +- src/H5Oginfo.c | 9 +- src/H5Olayout.c | 15 +- src/H5Olinfo.c | 19 +- src/H5Olink.c | 19 +- src/H5Omessage.c | 45 +-- src/H5Omodule.h | 35 ++ src/H5Omtime.c | 11 +- src/H5Oname.c | 13 +- src/H5Onull.c | 3 +- src/H5Opkg.h | 2 +- src/H5Opline.c | 11 +- src/H5Oprivate.h | 6 +- src/H5Orefcount.c | 13 +- src/H5Osdspace.c | 12 +- src/H5Oshared.c | 6 +- src/H5Oshared.h | 6 +- src/H5Oshmesg.c | 11 +- src/H5Ostab.c | 19 +- src/H5Otest.c | 12 +- src/H5Ounknown.c | 3 +- src/H5P.c | 53 +-- src/H5PL.c | 168 ++++---- src/H5PLmodule.h | 36 ++ src/H5Pacpl.c | 4 +- src/H5Pdapl.c | 3 +- src/H5Pdcpl.c | 6 +- src/H5Pdeprec.c | 50 +-- src/H5Pdxpl.c | 3 +- src/H5Pencdec.c | 34 +- src/H5Pfapl.c | 3 +- src/H5Pfcpl.c | 3 +- src/H5Pfmpl.c | 3 +- src/H5Pgcpl.c | 4 +- src/H5Pint.c | 231 ++++++----- src/H5Plapl.c | 4 +- src/H5Plcpl.c | 3 +- src/H5Pmodule.h | 35 ++ src/H5Pocpl.c | 5 +- src/H5Pocpypl.c | 3 +- src/H5Ppkg.h | 4 +- src/H5Pprivate.h | 6 +- src/H5Pstrcpl.c | 4 +- src/H5Ptest.c | 10 +- src/H5R.c | 126 +++--- src/H5Rdeprec.c | 50 +-- src/H5Rmodule.h | 36 ++ src/H5Rpkg.h | 4 +- src/H5S.c | 129 ++++-- src/H5SL.c | 155 ++++---- src/H5SLmodule.h | 35 ++ src/H5SM.c | 16 +- src/H5SMbtree2.c | 6 +- src/H5SMcache.c | 6 +- src/H5SMmessage.c | 4 +- src/H5SMmodule.h | 35 ++ src/H5SMpkg.h | 2 +- src/H5SMtest.c | 2 +- src/H5Sall.c | 2 +- src/H5Sdbg.c | 2 +- src/H5Shyper.c | 33 +- src/H5Smodule.h | 35 ++ src/H5Smpio.c | 2 +- src/H5Snone.c | 2 +- src/H5Spkg.h | 2 +- src/H5Spoint.c | 10 +- src/H5Sprivate.h | 6 +- src/H5Sselect.c | 48 +-- src/H5Stest.c | 6 +- src/H5T.c | 498 ++++++++++++------------ src/H5TS.c | 5 +- src/H5Tarray.c | 31 +- src/H5Tbit.c | 4 +- src/H5Tcommit.c | 41 +- src/H5Tcompound.c | 27 +- src/H5Tconv.c | 7 +- src/H5Tcset.c | 27 +- src/H5Tdbg.c | 2 +- src/H5Tdeprec.c | 50 +-- src/H5Tenum.c | 30 +- src/H5Tfields.c | 31 +- src/H5Tfixed.c | 29 +- src/H5Tfloat.c | 26 +- src/H5Tmodule.h | 35 ++ src/H5Tnative.c | 34 +- src/H5Toffset.c | 28 +- src/H5Toh.c | 12 +- src/H5Topaque.c | 26 +- src/H5Torder.c | 26 +- src/H5Tpad.c | 26 +- src/H5Tpkg.h | 4 +- src/H5Tprecis.c | 28 +- src/H5Tprivate.h | 7 +- src/H5Tstrpad.c | 26 +- src/H5Tvisit.c | 2 +- src/H5Tvlen.c | 32 +- src/H5Z.c | 117 +++--- src/H5Zdeflate.c | 4 +- src/H5Zfletcher32.c | 6 +- src/H5Zmodule.h | 35 ++ src/H5Znbit.c | 2 +- src/H5Zpkg.h | 2 +- src/H5Zscaleoffset.c | 4 +- src/H5Zshuffle.c | 4 +- src/H5Zszip.c | 2 +- src/H5Ztrans.c | 18 +- src/H5detect.c | 10 +- src/H5private.h | 692 ++++++++++++++++++--------------- src/H5trace.c | 2 +- src/Makefile.am | 4 +- test/accum.c | 2 +- test/app_ref.c | 4 + test/big.c | 6 +- test/bittests.c | 2 +- test/btree2.c | 2 +- test/cache_common.h | 4 +- test/cache_tagging.c | 10 + test/cmpd_dset.c | 2 +- test/dsets.c | 2 +- test/dt_arith.c | 68 +++- test/dtypes.c | 93 ++++- test/earray.c | 2 +- test/efc.c | 4 +- test/err_compat.c | 3 +- test/error_test.c | 2 +- test/farray.c | 2 +- test/fheap.c | 2 +- test/file_image.c | 24 +- test/flush2.c | 32 +- test/freespace.c | 6 +- test/getname.c | 4 +- test/h5test.c | 84 +++- test/h5test.h | 2 + test/istore.c | 2 +- test/links.c | 2 +- test/links_env.c | 2 +- test/mf.c | 32 +- test/objcopy.c | 4 +- test/ohdr.c | 4 +- test/plugin.c | 2 +- test/pool.c | 2 +- test/stab.c | 2 +- test/tattr.c | 6 +- test/tfile.c | 14 +- test/tgenprop.c | 2 +- test/tid.c | 2 +- test/tmisc.c | 2 +- test/tselect.c | 2 +- test/tsohm.c | 6 +- test/unlink.c | 2 +- test/vfd.c | 380 +++++++++--------- testpar/t_cache.c | 6 +- testpar/t_mpi.c | 2 +- testpar/t_pflush2.c | 4 +- testpar/t_shapesame.c | 5 +- testpar/testphdf5.c | 2 +- tools/h5dump/errfiles/tall-1.err | 4 +- tools/h5dump/errfiles/tall-2A.err | 4 +- tools/h5dump/errfiles/tall-2A0.err | 4 +- tools/h5dump/errfiles/tall-2B.err | 4 +- tools/h5dump/errfiles/textlink.err | 8 +- tools/h5dump/errfiles/textlinkfar.err | 22 +- tools/h5dump/errfiles/textlinksrc.err | 22 +- tools/h5dump/errfiles/torderlinks1.err | 4 +- tools/h5dump/errfiles/torderlinks2.err | 4 +- tools/h5repack/h5repacktst.c | 4 +- tools/misc/h5debug.c | 26 +- tools/misc/talign.c | 3 + tools/perform/perf_meta.c | 2 +- 382 files changed, 4932 insertions(+), 4500 deletions(-) create mode 100644 src/H5ACmodule.h create mode 100644 src/H5Amodule.h create mode 100644 src/H5B2module.h create mode 100644 src/H5Bmodule.h create mode 100644 src/H5Cmodule.h create mode 100644 src/H5Dmodule.h create mode 100644 src/H5EAmodule.h create mode 100644 src/H5Emodule.h create mode 100644 src/H5FAmodule.h create mode 100644 src/H5FDdrvr_module.h create mode 100644 src/H5FDmodule.h create mode 100644 src/H5FLmodule.h create mode 100644 src/H5FSmodule.h create mode 100644 src/H5Fmodule.h create mode 100644 src/H5Gmodule.h create mode 100644 src/H5HFmodule.h create mode 100644 src/H5HGmodule.h create mode 100644 src/H5HLmodule.h create mode 100644 src/H5Imodule.h create mode 100644 src/H5Lmodule.h create mode 100644 src/H5MFmodule.h create mode 100644 src/H5MPmodule.h create mode 100644 src/H5Omodule.h create mode 100644 src/H5PLmodule.h create mode 100644 src/H5Pmodule.h create mode 100644 src/H5Rmodule.h create mode 100644 src/H5SLmodule.h create mode 100644 src/H5SMmodule.h create mode 100644 src/H5Smodule.h create mode 100644 src/H5Tmodule.h create mode 100644 src/H5Zmodule.h diff --git a/MANIFEST b/MANIFEST index 0a66695..749821f 100644 --- a/MANIFEST +++ b/MANIFEST @@ -453,11 +453,13 @@ ./src/H5Adense.c ./src/H5Adeprec.c ./src/H5Aint.c +./src/H5Amodule.h ./src/H5Atest.c ./src/H5Apkg.h ./src/H5Aprivate.h ./src/H5Apublic.h ./src/H5AC.c +./src/H5ACmodule.h ./src/H5ACmpio.c ./src/H5ACpkg.h ./src/H5ACprivate.h @@ -465,6 +467,7 @@ ./src/H5B.c ./src/H5Bcache.c ./src/H5Bdbg.c +./src/H5Bmodule.h ./src/H5Bpkg.h ./src/H5Bprivate.h ./src/H5Bpublic.h @@ -473,12 +476,14 @@ ./src/H5B2dbg.c ./src/H5B2hdr.c ./src/H5B2int.c +./src/H5B2module.h ./src/H5B2pkg.h ./src/H5B2private.h ./src/H5B2public.h ./src/H5B2stat.c ./src/H5B2test.c ./src/H5C.c +./src/H5Cmodule.h ./src/H5Cmpio.c ./src/H5Cpkg.h ./src/H5Cprivate.h @@ -497,6 +502,7 @@ ./src/H5Dint.c ./src/H5Dio.c ./src/H5Dlayout.c +./src/H5Dmodule.h ./src/H5Dmpio.c ./src/H5Doh.c ./src/H5Dpkg.h @@ -510,6 +516,7 @@ ./src/H5Edeprec.c ./src/H5Einit.h ./src/H5Eint.c +./src/H5Emodule.h ./src/H5Epkg.h ./src/H5Eprivate.h ./src/H5Epubgen.h @@ -523,6 +530,7 @@ ./src/H5EAhdr.c ./src/H5EAiblock.c ./src/H5EAint.c +./src/H5EAmodule.h ./src/H5EApkg.h ./src/H5EAprivate.h ./src/H5EAsblock.c @@ -537,6 +545,7 @@ ./src/H5Ffake.c ./src/H5Fint.c ./src/H5Fio.c +./src/H5Fmodule.h ./src/H5Fmount.c ./src/H5Fmpi.c ./src/H5Fquery.c @@ -553,6 +562,7 @@ ./src/H5FAdblkpage.c ./src/H5FAdblock.c ./src/H5FAhdr.c +./src/H5FAmodule.h ./src/H5FApkg.h ./src/H5FAprivate.h ./src/H5FAstat.c @@ -562,11 +572,13 @@ ./src/H5FDcore.h ./src/H5FDdirect.c ./src/H5FDdirect.h +./src/H5FDdrvr_module.h ./src/H5FDfamily.c ./src/H5FDfamily.h ./src/H5FDint.c ./src/H5FDlog.c ./src/H5FDlog.h +./src/H5FDmodule.h ./src/H5FDmpi.c ./src/H5FDmpi.h ./src/H5FDmpio.c @@ -584,12 +596,14 @@ ./src/H5FDwindows.c ./src/H5FDwindows.h ./src/H5FL.c +./src/H5FLmodule.h ./src/H5FLprivate.h ./src/H5FO.c ./src/H5FOprivate.h ./src/H5FS.c ./src/H5FScache.c ./src/H5FSdbg.c +./src/H5FSmodule.h ./src/H5FStest.c ./src/H5FSstat.c ./src/H5FSpkg.h @@ -606,6 +620,7 @@ ./src/H5Gint.c ./src/H5Glink.c ./src/H5Gloc.c +./src/H5Gmodule.h ./src/H5Gname.c ./src/H5Gnode.c ./src/H5Gobj.c @@ -628,6 +643,7 @@ ./src/H5HFiblock.c ./src/H5HFiter.c ./src/H5HFman.c +./src/H5HFmodule.h ./src/H5HFpkg.h ./src/H5HFprivate.h ./src/H5HFpublic.h @@ -639,6 +655,7 @@ ./src/H5HG.c ./src/H5HGcache.c ./src/H5HGdbg.c +./src/H5HGmodule.h ./src/H5HGpkg.h ./src/H5HGprivate.h ./src/H5HGpublic.h @@ -647,24 +664,28 @@ ./src/H5HLcache.c ./src/H5HLdbg.c ./src/H5HLint.c +./src/H5HLmodule.h ./src/H5HLpkg.h ./src/H5HLprivate.h ./src/H5HLpublic.h ./src/H5HP.c ./src/H5HPprivate.h ./src/H5I.c +./src/H5Imodule.h ./src/H5Ipkg.h ./src/H5Iprivate.h ./src/H5Ipublic.h ./src/H5Itest.c ./src/H5L.c ./src/H5Lexternal.c +./src/H5Lmodule.h ./src/H5Lpkg.h ./src/H5Lprivate.h ./src/H5Lpublic.h ./src/H5MF.c ./src/H5MFaggr.c ./src/H5MFdbg.c +./src/H5MFmodule.h ./src/H5MFsection.c ./src/H5MFpkg.h ./src/H5MFprivate.h @@ -672,6 +693,7 @@ ./src/H5MMprivate.h ./src/H5MMpublic.h ./src/H5MP.c +./src/H5MPmodule.h ./src/H5MPpkg.h ./src/H5MPprivate.h ./src/H5MPtest.c @@ -697,6 +719,7 @@ ./src/H5Olinfo.c ./src/H5Olink.c ./src/H5Omessage.c +./src/H5Omodule.h ./src/H5Omtime.c ./src/H5Oname.c ./src/H5Onull.c @@ -726,6 +749,7 @@ ./src/H5Pint.c ./src/H5Plapl.c ./src/H5Plcpl.c +./src/H5Pmodule.h ./src/H5Pocpl.c ./src/H5Pocpypl.c ./src/H5Ppkg.h @@ -734,11 +758,13 @@ ./src/H5Pstrcpl.c ./src/H5Ptest.c ./src/H5PL.c +./src/H5PLmodule.h ./src/H5PLprivate.h ./src/H5PLpublic.h ./src/H5PLextern.h ./src/H5R.c ./src/H5Rdeprec.c +./src/H5Rmodule.h ./src/H5Rpkg.h ./src/H5Rprivate.h ./src/H5Rpublic.h @@ -750,6 +776,7 @@ ./src/H5Sall.c ./src/H5Sdbg.c ./src/H5Shyper.c +./src/H5Smodule.h ./src/H5Smpio.c ./src/H5Snone.c ./src/H5Spkg.h @@ -759,11 +786,13 @@ ./src/H5Sselect.c ./src/H5Stest.c ./src/H5SL.c +./src/H5SLmodule.h ./src/H5SLprivate.h ./src/H5SM.c ./src/H5SMbtree2.c ./src/H5SMcache.c ./src/H5SMmessage.c +./src/H5SMmodule.h ./src/H5SMpkg.h ./src/H5SMprivate.h ./src/H5SMtest.c @@ -782,6 +811,7 @@ ./src/H5Tfields.c ./src/H5Tfixed.c ./src/H5Tfloat.c +./src/H5Tmodule.h ./src/H5Tnative.c ./src/H5Toffset.c ./src/H5Topaque.c @@ -804,6 +834,7 @@ ./src/H5Z.c ./src/H5Zdeflate.c ./src/H5Zfletcher32.c +./src/H5Zmodule.h ./src/H5Znbit.c ./src/H5Zpkg.h ./src/H5Zprivate.h diff --git a/c++/test/testhdf5.cpp b/c++/test/testhdf5.cpp index 19b4f0d..59b16cf 100644 --- a/c++/test/testhdf5.cpp +++ b/c++/test/testhdf5.cpp @@ -134,3 +134,4 @@ Comment out tests that are not done yet */ return (GetTestNumErrs()); } + diff --git a/c++/test/tlinks.cpp b/c++/test/tlinks.cpp index 33d10ea..572f649 100644 --- a/c++/test/tlinks.cpp +++ b/c++/test/tlinks.cpp @@ -47,7 +47,7 @@ * This file needs to access private information from the H5G package. * This file also needs to access the group testing code. */ -//#define H5G_PACKAGE +//#define H5G_FRIEND //#define H5G_TESTING //#include "h5test.h" @@ -622,7 +622,7 @@ void test_links() /* Close 2nd FAPL */ H5Pclose(fapl2_id); - h5_cleanup(FILENAME, fapl_id); + h5_clean_files(FILENAME, fapl_id); /* Test that external links can be used after a library reset. MUST be * called last so the reset doesn't interfere with the property lists. This diff --git a/c++/test/ttypes.cpp b/c++/test/ttypes.cpp index 2e64051..aae5d86 100644 --- a/c++/test/ttypes.cpp +++ b/c++/test/ttypes.cpp @@ -57,7 +57,7 @@ /* Alignment test stuff */ #ifdef TEST_ALIGNMENT -#define H5T_PACKAGE +#define H5T_FRIEND #include "H5Tpkg.h" #endif #define SET_ALIGNMENT(TYPE,VAL) \ diff --git a/fortran/test/tH5P_F03.F90 b/fortran/test/tH5P_F03.F90 index ec9fef2..8982fc2 100644 --- a/fortran/test/tH5P_F03.F90 +++ b/fortran/test/tH5P_F03.F90 @@ -221,6 +221,9 @@ SUBROUTINE test_create(total_error) CALL h5dopen_f(file, "dset9", dset9, error) CALL check("h5dopen_f", error, total_error) + CALL H5Pclose_f(dcpl, error) + CALL check("H5Pclose_f", error, total_error) + CALL H5Dget_create_plist_f(dset9, dcpl, error) CALL check("H5Dget_create_plist_f", error, total_error) diff --git a/src/H5.c b/src/H5.c index 2e05819..29098bc 100644 --- a/src/H5.c +++ b/src/H5.c @@ -74,6 +74,7 @@ hbool_t H5_api_entered_g = FALSE; H5_api_t H5_g; #else hbool_t H5_libinit_g = FALSE; /* Library hasn't been initialized */ +hbool_t H5_libterm_g = FALSE; /* Library isn't being shutdown */ #endif #ifdef H5_HAVE_MPE @@ -261,6 +262,9 @@ H5_term_library(void) if(!(H5_INIT_GLOBAL)) goto done; + /* Indicate that the library is being shut down */ + H5_TERM_GLOBAL = TRUE; + /* Check if we should display error output */ (void)H5Eget_auto2(H5E_DEFAULT, &func, NULL); @@ -270,7 +274,7 @@ H5_term_library(void) * way that would necessitate some cleanup work in the other interface. */ #define DOWN(F) \ - (((n = H5##F##_term_interface()) && (at + 8) < sizeof loop)? \ + (((n = H5##F##_term_package()) && (at + 8) < sizeof loop)? \ (sprintf(loop + at, "%s%s", (at ? "," : ""), #F), \ at += HDstrlen(loop + at), \ n): \ @@ -281,20 +285,46 @@ H5_term_library(void) do { pending = 0; + /* Try to organize these so the "higher" level components get shut * down before "lower" level components that they might rely on. -QAK */ - pending += DOWN(R); - pending += DOWN(D); pending += DOWN(L); - pending += DOWN(G); - pending += DOWN(A); - pending += DOWN(S); - pending += DOWN(T); + + /* Close the "top" of various interfaces (IDs, etc) but don't shut + * down the whole interface yet, so that the object header messages + * get serialized correctly for entries in the metadata cache and the + * symbol table entry in the superblock gets serialized correctly, etc. + * all of which is performed in the 'F' shutdown. + */ + pending += DOWN(A_top); + pending += DOWN(D_top); + pending += DOWN(G_top); + pending += DOWN(R_top); + pending += DOWN(S_top); + pending += DOWN(T_top); + /* Don't shut down the file code until objects in files are shut down */ if(pending == 0) pending += DOWN(F); + /* Wait to shut down the "bottom" of various interfaces until the + * files are closed, so pieces of the file can be serialized + * correctly. + */ + if(pending == 0) { + /* Shut down the "bottom" of the attribute, dataset, group, + * reference, dataspace, and datatype interfaces, fully closing + * out the interfaces now. + */ + pending += DOWN(A); + pending += DOWN(D); + pending += DOWN(G); + pending += DOWN(R); + pending += DOWN(S); + pending += DOWN(T); + } /* end if */ + /* Don't shut down "low-level" components until "high-level" components * have successfully shut down. This prevents property lists and IDs * from being closed "out from underneath" of the high-level objects @@ -318,7 +348,7 @@ H5_term_library(void) /* Don't shut down the free list code until _everything_ else is down */ if(pending == 0) pending += DOWN(FL); - } + } /* end if */ } while(pending && ntries++ < 100); if(pending) { @@ -362,12 +392,17 @@ H5_term_library(void) (void)H5MM_free(tmp_open_stream); } /* end while */ + /* Reset flag indicating that the library is being shut down */ + H5_TERM_GLOBAL = FALSE; + /* Mark library as closed */ H5_INIT_GLOBAL = FALSE; + done: #ifdef H5_HAVE_THREADSAFE H5_API_UNLOCK #endif /* H5_HAVE_THREADSAFE */ + return; } /* end H5_term_library() */ diff --git a/src/H5A.c b/src/H5A.c index 4afdefe..440fc31 100644 --- a/src/H5A.c +++ b/src/H5A.c @@ -17,11 +17,8 @@ /* Module Setup */ /****************/ -#define H5A_PACKAGE /*suppress error about including H5Apkg */ -#define H5O_PACKAGE /*suppress error about including H5Opkg */ - -/* Interface initialization */ -#define H5_INTERFACE_INIT_FUNC H5A__init_interface +#include "H5Amodule.h" /* This source code file is part of the H5A module */ +#define H5O_FRIEND /*suppress error about including H5Opkg */ /***********/ @@ -37,6 +34,7 @@ #include "H5Sprivate.h" /* Dataspace functions */ #include "H5SMprivate.h" /* Shared Object Header Messages */ + /****************/ /* Local Macros */ /****************/ @@ -68,6 +66,9 @@ typedef struct H5A_iter_cb1 { /* Package Variables */ /*********************/ +/* Package initialization variable */ +hbool_t H5_PKG_INIT_VAR = FALSE; + /*****************************/ /* Library Private Variables */ @@ -95,39 +96,16 @@ static const H5I_class_t H5I_ATTR_CLS[1] = {{ (H5I_free_t)H5A_close /* Callback routine for closing objects of this class */ }}; +/* Flag indicating "top" of interface has been initialized */ +static hbool_t H5A_top_package_initialize_s = FALSE; - -/*------------------------------------------------------------------------- - * Function: H5A_init - * - * Purpose: Initialize the interface from some other package. - * - * Return: Success: non-negative - * Failure: negative - * - * Programmer: Quincey Koziol - * Monday, November 27, 2006 - * - *------------------------------------------------------------------------- - */ -herr_t -H5A_init(void) -{ - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(FAIL) - /* FUNC_ENTER() does all the work */ - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5A_init() */ /*-------------------------------------------------------------------------- NAME - H5A__init_interface -- Initialize interface-specific information + H5A__init_package -- Initialize interface-specific information USAGE - herr_t H5A__init_interface() + herr_t H5A__init_package() RETURNS Non-negative on success/Negative on failure @@ -135,12 +113,12 @@ DESCRIPTION Initializes any interface-specific data or routines. --------------------------------------------------------------------------*/ -static herr_t -H5A__init_interface(void) +herr_t +H5A__init_package(void) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_STATIC + FUNC_ENTER_PACKAGE /* * Create attribute ID type. @@ -148,21 +126,25 @@ H5A__init_interface(void) if(H5I_register_type(H5I_ATTR_CLS) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTINIT, FAIL, "unable to initialize interface") + /* Mark "top" of interface as initialized, too */ + H5A_top_package_initialize_s = TRUE; + done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5A__init_interface() */ +} /* end H5A__init_package() */ /*-------------------------------------------------------------------------- NAME - H5A_term_interface + H5A_top_term_package PURPOSE Terminate various H5A objects USAGE - void H5A_term_interface() + void H5A_top_term_package() RETURNS DESCRIPTION - Release any other resources allocated. + Release IDs for the atom group, deferring full interface shutdown + until later (in H5A_term_package). GLOBAL VARIABLES COMMENTS, BUGS, ASSUMPTIONS Can't report errors... @@ -170,32 +152,68 @@ done: REVISION LOG --------------------------------------------------------------------------*/ int -H5A_term_interface(void) +H5A_top_term_package(void) { int n = 0; FUNC_ENTER_NOAPI_NOINIT_NOERR - if(H5_interface_initialize_g) { + if(H5A_top_package_initialize_s) { if(H5I_nmembers(H5I_ATTR) > 0) { (void)H5I_clear_type(H5I_ATTR, FALSE, FALSE); n++; /*H5I*/ } /* end if */ - else { - /* Close deprecated interface */ - n += H5A__term_deprec_interface(); - /* Destroy the attribute object id group */ - (void)H5I_dec_type_ref(H5I_ATTR); - n++; /*H5I*/ + /* Mark closed */ + if(0 == n) + H5A_top_package_initialize_s = FALSE; + } /* end if */ + + FUNC_LEAVE_NOAPI(n) +} /* H5A_top_term_package() */ + + +/*-------------------------------------------------------------------------- + NAME + H5A_term_package + PURPOSE + Terminate various H5A objects + USAGE + void H5A_term_package() + RETURNS + DESCRIPTION + Release any other resources allocated. + GLOBAL VARIABLES + COMMENTS, BUGS, ASSUMPTIONS + Can't report errors... + + Finishes shutting down the interface, after H5A_top_term_package() + is called + EXAMPLES + REVISION LOG +--------------------------------------------------------------------------*/ +int +H5A_term_package(void) +{ + int n = 0; + + FUNC_ENTER_NOAPI_NOINIT_NOERR + + if(H5_PKG_INIT_VAR) { + /* Sanity checks */ + HDassert(0 == H5I_nmembers(H5I_ATTR)); + HDassert(FALSE == H5A_top_package_initialize_s); + + /* Destroy the attribute object id group */ + n += (H5I_dec_type_ref(H5I_ATTR) > 0); - /* Mark closed */ - H5_interface_initialize_g = 0; - } /* end else */ + /* Mark closed */ + if(0 == n) + H5_PKG_INIT_VAR = FALSE; } /* end if */ FUNC_LEAVE_NOAPI(n) -} /* H5A_term_interface() */ +} /* H5A_term_package() */ /*-------------------------------------------------------------------------- diff --git a/src/H5AC.c b/src/H5AC.c index 525f78b..6cf77c2 100644 --- a/src/H5AC.c +++ b/src/H5AC.c @@ -31,11 +31,9 @@ /* Module Setup */ /****************/ -#define H5AC_PACKAGE /*suppress error about including H5ACpkg */ -#define H5F_PACKAGE /*suppress error about including H5Fpkg */ +#include "H5ACmodule.h" /* This source code file is part of the H5AC module */ +#define H5F_FRIEND /*suppress error about including H5Fpkg */ -/* Interface initialization */ -#define H5_INTERFACE_INIT_FUNC H5AC_init_interface /***********/ /* Headers */ @@ -74,6 +72,9 @@ static herr_t H5AC__ext_config_2_int_config(H5AC_cache_config_t *ext_conf_ptr, /* Package Variables */ /*********************/ +/* Package initialization variable */ +hbool_t H5_PKG_INIT_VAR = FALSE; + /*****************************/ /* Library Private Variables */ @@ -135,7 +136,6 @@ static const char *H5AC_entry_type_names[H5AC_NTYPES] = * Purpose: Initialize the interface from some other layer. * * Return: Success: non-negative - * * Failure: negative * * Programmer: Quincey Koziol @@ -146,7 +146,7 @@ static const char *H5AC_entry_type_names[H5AC_NTYPES] = herr_t H5AC_init(void) { - herr_t ret_value=SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) /* FUNC_ENTER() does all the work */ @@ -157,7 +157,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5AC_init_interface + * Function: H5AC__init_package * * Purpose: Initialize interface-specific information * @@ -168,8 +168,8 @@ done: * *------------------------------------------------------------------------- */ -static herr_t -H5AC_init_interface(void) +herr_t +H5AC__init_package(void) { #ifdef H5_HAVE_PARALLEL H5P_genplist_t *xfer_plist; /* Dataset transfer property list object */ @@ -177,7 +177,7 @@ H5AC_init_interface(void) #endif /* H5_HAVE_PARALLEL */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE #ifdef H5_HAVE_PARALLEL /* Sanity check */ @@ -224,17 +224,16 @@ H5AC_init_interface(void) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5AC_init_interface() */ +} /* end H5AC__init_package() */ /*------------------------------------------------------------------------- - * Function: H5AC_term_interface + * Function: H5AC_term_package * * Purpose: Terminate this interface. * * Return: Success: Positive if anything was done that might * affect other interfaces; zero otherwise. - * * Failure: Negative. * * Programmer: Quincey Koziol @@ -243,13 +242,13 @@ done: *------------------------------------------------------------------------- */ int -H5AC_term_interface(void) +H5AC_term_package(void) { int n = 0; FUNC_ENTER_NOAPI_NOINIT_NOERR - if(H5_interface_initialize_g) { + if(H5_PKG_INIT_VAR) { #ifdef H5_HAVE_PARALLEL if(H5AC_dxpl_id > 0 || H5AC_ind_dxpl_id > 0) { /* Indicate more work to do */ @@ -258,30 +257,20 @@ H5AC_term_interface(void) /* Close H5AC dxpl */ if(H5I_dec_ref(H5AC_dxpl_id) < 0 || H5I_dec_ref(H5AC_ind_dxpl_id) < 0) H5E_clear_stack(NULL); /*ignore error*/ - else { - /* Reset static IDs */ - H5AC_dxpl_id = (-1); - H5AC_ind_dxpl_id = (-1); - - /* Reset interface initialization flag */ - H5_interface_initialize_g = 0; - } /* end else */ } /* end if */ - else { -#endif /* H5_HAVE_PARALLEL */ - /* Reset static IDs */ - H5AC_dxpl_id = (-1); - H5AC_ind_dxpl_id = (-1); -#ifdef H5_HAVE_PARALLEL - } /* end else */ #endif /* H5_HAVE_PARALLEL */ + + /* Reset static IDs */ + H5AC_dxpl_id = (-1); + H5AC_ind_dxpl_id = (-1); /* Reset interface initialization flag */ - H5_interface_initialize_g = 0; + if(0 == n) + H5_PKG_INIT_VAR = FALSE; } /* end if */ FUNC_LEAVE_NOAPI(n) -} /* end H5AC_term_interface() */ +} /* end H5AC_term_package() */ /*------------------------------------------------------------------------- @@ -1066,7 +1055,7 @@ H5AC_protect(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr, size_t trace_entry_size = 0; FILE * trace_file_ptr = NULL; #endif /* H5AC__TRACE_FILE_ENABLED */ - void * ret_value; /* Return value */ + void * ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI(NULL) diff --git a/src/H5ACmodule.h b/src/H5ACmodule.h new file mode 100644 index 0000000..a8dba59 --- /dev/null +++ b/src/H5ACmodule.h @@ -0,0 +1,35 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* + * Programmer: Quincey Koziol + * Saturday, September 12, 2015 + * + * Purpose: This file contains declarations which define macros for the + * H5AC package. Including this header means that the source file + * is part of the H5AC package. + */ +#ifndef _H5ACmodule_H +#define _H5ACmodule_H + +/* Define the proper control macros for the generic FUNC_ENTER/LEAVE and error + * reporting macros. + */ +#define H5AC_MODULE +#define H5_MY_PKG H5AC +#define H5_MY_PKG_ERR H5E_CACHE +#define H5_MY_PKG_INIT YES + +#endif /* _H5ACmodule_H */ + diff --git a/src/H5ACmpio.c b/src/H5ACmpio.c index 6c2b924..fdad19a 100644 --- a/src/H5ACmpio.c +++ b/src/H5ACmpio.c @@ -29,11 +29,9 @@ /* Module Setup */ /****************/ -#define H5AC_PACKAGE /*suppress error about including H5ACpkg */ -#define H5F_PACKAGE /*suppress error about including H5Fpkg */ +#include "H5ACmodule.h" /* This source code file is part of the H5AC module */ +#define H5F_FRIEND /*suppress error about including H5Fpkg */ -/* Interface initialization */ -#define H5_INTERFACE_INIT_FUNC H5AC__init_mpio_interface /***********/ /* Headers */ @@ -135,33 +133,6 @@ H5FL_DEFINE(H5AC_aux_t); H5FL_DEFINE_STATIC(H5AC_slist_entry_t); -/*------------------------------------------------------------------------- - * Function: H5AC__init_mpio_interface - * - * Purpose: Initialize interface-specific information - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Quincey Koziol - * 6/20/15 - * - *------------------------------------------------------------------------- - */ -static herr_t -H5AC__init_mpio_interface(void) -{ - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_STATIC - - /* Funnel all work to H5AC_init() */ - if(H5AC_init() < 0) - HGOTO_ERROR(H5E_FUNC, H5E_CANTINIT, FAIL, "interface initialization failed") - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* H5AC__init_mpio_interface() */ - /*------------------------------------------------------------------------- * Function: H5AC__set_sync_point_done_callback diff --git a/src/H5ACpkg.h b/src/H5ACpkg.h index 74bf079..050e21c 100644 --- a/src/H5ACpkg.h +++ b/src/H5ACpkg.h @@ -28,7 +28,7 @@ * */ -#ifndef H5AC_PACKAGE +#if !(defined H5AC_FRIEND || defined H5AC_MODULE) #error "Do not include this file outside the H5AC package!" #endif diff --git a/src/H5Abtree2.c b/src/H5Abtree2.c index 5e29d3f..28e49a6 100644 --- a/src/H5Abtree2.c +++ b/src/H5Abtree2.c @@ -28,7 +28,7 @@ /* Module Setup */ /****************/ -#define H5A_PACKAGE /*suppress error about including H5Apkg */ +#include "H5Amodule.h" /* This source code file is part of the H5A module */ /***********/ @@ -247,7 +247,7 @@ H5A__dense_btree2_name_compare(const void *_bt2_udata, const void *_bt2_rec) { const H5A_bt2_ud_common_t *bt2_udata = (const H5A_bt2_ud_common_t *)_bt2_udata; const H5A_dense_bt2_name_rec_t *bt2_rec = (const H5A_dense_bt2_name_rec_t *)_bt2_rec; - herr_t ret_value; /* Return value */ + herr_t ret_value = FAIL; /* Return value */ FUNC_ENTER_STATIC_NOERR @@ -438,7 +438,7 @@ H5A__dense_btree2_corder_compare(const void *_bt2_udata, const void *_bt2_rec) { const H5A_bt2_ud_common_t *bt2_udata = (const H5A_bt2_ud_common_t *)_bt2_udata; const H5A_dense_bt2_corder_rec_t *bt2_rec = (const H5A_dense_bt2_corder_rec_t *)_bt2_rec; - herr_t ret_value; /* Return value */ + herr_t ret_value = FAIL; /* Return value */ FUNC_ENTER_STATIC_NOERR diff --git a/src/H5Adense.c b/src/H5Adense.c index 6d18249..3dc3a42 100644 --- a/src/H5Adense.c +++ b/src/H5Adense.c @@ -29,8 +29,8 @@ /* Module Setup */ /****************/ -#define H5A_PACKAGE /*suppress error about including H5Apkg */ -#define H5O_PACKAGE /*suppress error about including H5Opkg */ +#include "H5Amodule.h" /* This source code file is part of the H5A module */ +#define H5O_FRIEND /*suppress error about including H5Opkg */ /***********/ @@ -1149,7 +1149,7 @@ H5A_dense_iterate(H5F_t *f, hid_t dxpl_id, hid_t loc_id, const H5O_ainfo_t *ainf H5A_attr_table_t atable = {0, NULL}; /* Table of attributes */ H5B2_t *bt2 = NULL; /* v2 B-tree handle for index */ haddr_t bt2_addr; /* Address of v2 B-tree to use for lookup */ - herr_t ret_value; /* Return value */ + herr_t ret_value = FAIL; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -1701,7 +1701,7 @@ H5A_dense_exists(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, const char * htri_t attr_sharable; /* Flag indicating attributes are sharable */ htri_t ret_value = TRUE; /* Return value */ - FUNC_ENTER_NOAPI(NULL) + FUNC_ENTER_NOAPI(FAIL) /* * Check arguments. diff --git a/src/H5Adeprec.c b/src/H5Adeprec.c index ccc7659..ae0f041 100644 --- a/src/H5Adeprec.c +++ b/src/H5Adeprec.c @@ -31,11 +31,8 @@ /* Module Setup */ /****************/ -#define H5A_PACKAGE /*suppress error about including H5Apkg */ -#define H5O_PACKAGE /*suppress error about including H5Opkg */ - -/* Interface initialization */ -#define H5_INTERFACE_INIT_FUNC H5A__init_deprec_interface +#include "H5Amodule.h" /* This source code file is part of the H5A module */ +#define H5O_FRIEND /*suppress error about including H5Opkg */ /***********/ @@ -84,51 +81,6 @@ /*******************/ - -/*-------------------------------------------------------------------------- -NAME - H5A__init_deprec_interface -- Initialize interface-specific information -USAGE - herr_t H5A__init_deprec_interface() -RETURNS - Non-negative on success/Negative on failure -DESCRIPTION - Initializes any interface-specific data or routines. (Just calls - H5A_init() currently). - ---------------------------------------------------------------------------*/ -static herr_t -H5A__init_deprec_interface(void) -{ - FUNC_ENTER_STATIC_NOERR - - FUNC_LEAVE_NOAPI(H5A_init()) -} /* H5A__init_deprec_interface() */ - - -/*-------------------------------------------------------------------------- -NAME - H5A__term_deprec_interface -- Terminate interface -USAGE - herr_t H5A__term_deprec_interface() -RETURNS - Non-negative on success/Negative on failure -DESCRIPTION - Terminates interface. (Just resets H5_interface_initialize_g - currently). - ---------------------------------------------------------------------------*/ -herr_t -H5A__term_deprec_interface(void) -{ - FUNC_ENTER_PACKAGE_NOERR - - /* Mark closed */ - H5_interface_initialize_g = 0; - - FUNC_LEAVE_NOAPI(0) -} /* H5A__term_deprec_interface() */ - #ifndef H5_NO_DEPRECATED_SYMBOLS /*-------------------------------------------------------------------------- diff --git a/src/H5Aint.c b/src/H5Aint.c index 91bbc24..193e8f4 100644 --- a/src/H5Aint.c +++ b/src/H5Aint.c @@ -28,8 +28,8 @@ /* Module Setup */ /****************/ -#define H5A_PACKAGE /*suppress error about including H5Apkg */ -#define H5O_PACKAGE /*suppress error about including H5Opkg */ +#include "H5Amodule.h" /* This source code file is part of the H5A module */ +#define H5O_FRIEND /*suppress error about including H5Opkg */ /***********/ @@ -142,11 +142,11 @@ H5A_t * H5A_create(const H5G_loc_t *loc, const char *name, const H5T_t *type, const H5S_t *space, hid_t acpl_id, hid_t dxpl_id) { - H5A_t *attr = NULL; /* Attribute created */ - hssize_t snelmts; /* elements in attribute */ - size_t nelmts; /* elements in attribute */ - htri_t tri_ret; /* htri_t return value */ - H5A_t *ret_value; /* Return value */ + H5A_t *attr = NULL; /* Attribute created */ + hssize_t snelmts; /* elements in attribute */ + size_t nelmts; /* elements in attribute */ + htri_t exists; /* Whether attribute exists */ + H5A_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_TAG(dxpl_id, loc->oloc->addr, NULL) @@ -161,9 +161,9 @@ H5A_create(const H5G_loc_t *loc, const char *name, const H5T_t *type, * name, but it's going to be hard to unwind all the special cases on * failure, so just check first, for now - QAK) */ - if((tri_ret = H5O_attr_exists(loc->oloc, name, H5AC_ind_dxpl_id)) < 0) + if((exists = H5O_attr_exists(loc->oloc, name, H5AC_ind_dxpl_id)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_NOTFOUND, NULL, "error checking attributes") - else if(tri_ret > 0) + else if(exists > 0) HGOTO_ERROR(H5E_ATTR, H5E_ALREADYEXISTS, NULL, "attribute already exists") /* Check if the dataspace has an extent set (or is NULL) */ @@ -360,7 +360,7 @@ H5A_open_by_idx(const H5G_loc_t *loc, const char *obj_name, H5_index_t idx_type, H5O_loc_t obj_oloc; /* Opened object object location */ hbool_t loc_found = FALSE; /* Entry at 'obj_name' found */ H5A_t *attr = NULL; /* Attribute from object header */ - H5A_t *ret_value; /* Return value */ + H5A_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -424,7 +424,7 @@ H5A_open_by_name(const H5G_loc_t *loc, const char *obj_name, const char *attr_na H5O_loc_t obj_oloc; /* Opened object object location */ hbool_t loc_found = FALSE; /* Entry at 'obj_name' found */ H5A_t *attr = NULL; /* Attribute from object header */ - H5A_t *ret_value; /* Return value */ + H5A_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI(NULL) @@ -705,7 +705,7 @@ ssize_t H5A__get_name(H5A_t *attr, size_t buf_size, char *buf) { size_t copy_len, nbytes; - ssize_t ret_value; + ssize_t ret_value = -1; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -849,7 +849,8 @@ H5A_get_create_plist(H5A_t* attr) H5P_genplist_t *plist; /* Default property list */ hid_t new_plist_id; /* ID of ACPL to return */ H5P_genplist_t *new_plist; /* ACPL to return */ - hid_t ret_value; + hid_t ret_value = H5I_INVALID_HID; /* Return value */ + FUNC_ENTER_NOAPI_NOINIT if(NULL == (plist = (H5P_genplist_t *)H5I_object(H5P_LST_ATTRIBUTE_CREATE_ID_g))) @@ -888,7 +889,9 @@ done: herr_t H5A__get_info(const H5A_t *attr, H5A_info_t *ainfo) { - FUNC_ENTER_NOAPI_NOERR + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) /* Check args */ HDassert(attr); @@ -906,7 +909,8 @@ H5A__get_info(const H5A_t *attr, H5A_info_t *ainfo) ainfo->corder = attr->shared->crt_idx; } /* end else */ - FUNC_LEAVE_NOAPI(SUCCEED) +done: + FUNC_LEAVE_NOAPI(ret_value) } /* end H5A__get_info() */ @@ -1099,15 +1103,16 @@ done: H5O_loc_t * H5A_oloc(H5A_t *attr) { - H5O_loc_t *ret_value; /* Return value */ + H5O_loc_t *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOERR + FUNC_ENTER_NOAPI(NULL) HDassert(attr); /* Set return value */ ret_value = &(attr->oloc); +done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5A_oloc() */ @@ -1130,15 +1135,16 @@ H5A_oloc(H5A_t *attr) H5G_name_t * H5A_nameof(H5A_t *attr) { - H5G_name_t *ret_value; /* Return value */ + H5G_name_t *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOERR + FUNC_ENTER_NOAPI(NULL) HDassert(attr); /* Set return value */ - ret_value=&(attr->path); + ret_value = &(attr->path); +done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5A_nameof() */ @@ -1159,15 +1165,16 @@ H5A_nameof(H5A_t *attr) H5T_t * H5A_type(const H5A_t *attr) { - H5T_t *ret_value; /* Return value */ + H5T_t *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOERR + FUNC_ENTER_NOAPI(NULL) HDassert(attr); /* Set return value */ ret_value = attr->shared->dt; +done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5A_type() */ @@ -1193,7 +1200,7 @@ H5A_exists_by_name(H5G_loc_t loc, const char *obj_name, const char *attr_name, H5G_name_t obj_path; /* Opened object group hier. path */ H5O_loc_t obj_oloc; /* Opened object object location */ hbool_t loc_found = FALSE; /* Entry at 'obj_name' found */ - htri_t ret_value; /* Return value */ + htri_t ret_value = FAIL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -1552,7 +1559,7 @@ H5A__attr_cmp_name_dec(const void *attr1, const void *attr2) static int H5A__attr_cmp_corder_inc(const void *attr1, const void *attr2) { - int ret_value; /* Return value */ + int ret_value = 0; /* Return value */ FUNC_ENTER_STATIC_NOERR @@ -1587,7 +1594,7 @@ H5A__attr_cmp_corder_inc(const void *attr1, const void *attr2) static int H5A__attr_cmp_corder_dec(const void *attr1, const void *attr2) { - int ret_value; /* Return value */ + int ret_value = 0; /* Return value */ FUNC_ENTER_STATIC_NOERR @@ -1790,8 +1797,8 @@ done: htri_t H5A_get_ainfo(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5O_ainfo_t *ainfo) { - H5B2_t *bt2_name = NULL; /* v2 B-tree handle for name index */ - htri_t ret_value; /* Return value */ + H5B2_t *bt2_name = NULL; /* v2 B-tree handle for name index */ + htri_t ret_value = FAIL; /* Return value */ FUNC_ENTER_NOAPI_TAG(dxpl_id, oh->cache_info.addr, FAIL) @@ -1857,8 +1864,9 @@ H5A_set_version(const H5F_t *f, H5A_t *attr) { hbool_t type_shared, space_shared; /* Flags to indicate that shared messages are used for this attribute */ hbool_t use_latest_format; /* Flag indicating the newest file format should be used */ + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOERR + FUNC_ENTER_NOAPI(FAIL) /* check arguments */ HDassert(f); @@ -1888,7 +1896,8 @@ H5A_set_version(const H5F_t *f, H5A_t *attr) else attr->shared->version = H5O_ATTR_VERSION_1; /* Write out basic version */ - FUNC_LEAVE_NOAPI(SUCCEED) +done: + FUNC_LEAVE_NOAPI(ret_value) } /* end H5A_set_version() */ @@ -1925,8 +1934,7 @@ H5A_attr_copy_file(const H5A_t *attr_src, H5F_t *file_dst, hbool_t *recompute_si void *buf = NULL; /* Buffer for copying data */ void *reclaim_buf = NULL; /* Buffer for reclaiming data */ hid_t buf_sid = -1; /* ID for buffer dataspace */ - - H5A_t *ret_value; /* Return value */ + H5A_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT diff --git a/src/H5Amodule.h b/src/H5Amodule.h new file mode 100644 index 0000000..e347fe1 --- /dev/null +++ b/src/H5Amodule.h @@ -0,0 +1,35 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* + * Programmer: Quincey Koziol + * Saturday, September 12, 2015 + * + * Purpose: This file contains declarations which define macros for the + * H5A package. Including this header means that the source file + * is part of the H5A package. + */ +#ifndef _H5Amodule_H +#define _H5Amodule_H + +/* Define the proper control macros for the generic FUNC_ENTER/LEAVE and error + * reporting macros. + */ +#define H5A_MODULE +#define H5_MY_PKG H5A +#define H5_MY_PKG_ERR H5E_ATTR +#define H5_MY_PKG_INIT YES + +#endif /* _H5Amodule_H */ + diff --git a/src/H5Apkg.h b/src/H5Apkg.h index d3fcd53..b815d11 100644 --- a/src/H5Apkg.h +++ b/src/H5Apkg.h @@ -21,7 +21,7 @@ * the H5A package. Source files outside the H5A package should * include H5Aprivate.h instead. */ -#ifndef H5A_PACKAGE +#if !(defined H5A_FRIEND || defined H5A_MODULE) #error "Do not include this file outside the H5A package!" #endif @@ -184,8 +184,6 @@ H5_DLLVAR const H5B2_class_t H5A_BT2_CORDER[1]; /******************************/ /* Function prototypes for H5A package scope */ -H5_DLL herr_t H5A_init(void); -H5_DLL herr_t H5A__term_deprec_interface(void); H5_DLL H5A_t *H5A_create(const H5G_loc_t *loc, const char *name, const H5T_t *type, const H5S_t *space, hid_t acpl_id, hid_t dxpl_id); H5_DLL H5A_t *H5A_open_by_name(const H5G_loc_t *loc, const char *obj_name, diff --git a/src/H5Atest.c b/src/H5Atest.c index 19b5547..d57bbe1 100644 --- a/src/H5Atest.c +++ b/src/H5Atest.c @@ -28,7 +28,7 @@ /* Module Setup */ /****************/ -#define H5A_PACKAGE /*suppress error about including H5Apkg */ +#include "H5Amodule.h" /* This source code file is part of the H5A module */ #define H5A_TESTING /*suppress warning about H5A testing funcs*/ @@ -95,7 +95,7 @@ htri_t H5A_is_shared_test(hid_t attr_id) { H5A_t *attr; /* Attribute object for ID */ - htri_t ret_value; /* Return value */ + htri_t ret_value = FAIL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT diff --git a/src/H5B.c b/src/H5B.c index b1f3388..48be703 100644 --- a/src/H5B.c +++ b/src/H5B.c @@ -97,7 +97,7 @@ /* Module Setup */ /****************/ -#define H5B_PACKAGE /*suppress error about including H5Bpkg */ +#include "H5Bmodule.h" /* This source code file is part of the H5B module */ /***********/ @@ -166,6 +166,9 @@ static H5B_t * H5B__copy(const H5B_t *old_bt); /* Package Variables */ /*********************/ +/* Package initialization variable */ +hbool_t H5_PKG_INIT_VAR = FALSE; + /* Declare a free list to manage the haddr_t sequence information */ H5FL_SEQ_DEFINE(haddr_t); @@ -309,7 +312,7 @@ H5B_find(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, void *u H5B_cache_ud_t cache_udata; /* User-data for metadata cache callback */ unsigned idx = 0, lt = 0, rt; /* Final, left & right key indices */ int cmp = 1; /* Key comparison value */ - htri_t ret_value; /* Return value */ + htri_t ret_value = FAIL; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -1203,7 +1206,7 @@ herr_t H5B_iterate(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, H5B_operator_t op, void *udata) { - herr_t ret_value; /* Return value */ + herr_t ret_value = FAIL; /* Return value */ FUNC_ENTER_NOAPI_NOERR @@ -1700,7 +1703,7 @@ H5B_shared_new(const H5F_t *f, const H5B_class_t *type, size_t sizeof_rkey) { H5B_shared_t *shared = NULL; /* New shared B-tree struct */ size_t u; /* Local index variable */ - H5B_shared_t *ret_value; /* Return value */ + H5B_shared_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI(NULL) @@ -1808,7 +1811,7 @@ H5B__copy(const H5B_t *old_bt) { H5B_t *new_node = NULL; H5B_shared_t *shared; /* Pointer to shared B-tree info */ - H5B_t *ret_value; + H5B_t *ret_value = NULL; /* Return value */ FUNC_ENTER_STATIC diff --git a/src/H5B2.c b/src/H5B2.c index 7b5aa16..7eb88c4 100644 --- a/src/H5B2.c +++ b/src/H5B2.c @@ -33,7 +33,8 @@ /* Module Setup */ /****************/ -#define H5B2_PACKAGE /*suppress error about including H5B2pkg */ +#include "H5B2module.h" /* This source code file is part of the H5B2 module */ + /***********/ /* Headers */ @@ -67,6 +68,9 @@ /* Package Variables */ /*********************/ +/* Package initialization variable */ +hbool_t H5_PKG_INIT_VAR = FALSE; + /* v2 B-tree client ID to class mapping */ /* Remember to add client ID to H5B2_subid_t in H5B2private.h when adding a new @@ -132,7 +136,7 @@ H5B2_create(H5F_t *f, hid_t dxpl_id, const H5B2_create_t *cparam, void *ctx_udat H5B2_hdr_t *hdr = NULL; /* Pointer to the B-tree header */ H5B2_hdr_cache_ud_t cache_udata; /* User-data for callback */ haddr_t hdr_addr; /* B-tree header address */ - H5B2_t *ret_value; /* Return value */ + H5B2_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI(NULL) @@ -206,7 +210,7 @@ H5B2_open(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *ctx_udata) H5B2_t *bt2 = NULL; /* Pointer to the B-tree */ H5B2_hdr_t *hdr = NULL; /* Pointer to the B-tree header */ H5B2_hdr_cache_ud_t cache_udata; /* User-data for callback */ - H5B2_t *ret_value; /* Return value */ + H5B2_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT diff --git a/src/H5B2cache.c b/src/H5B2cache.c index 9e43ff8..421e24b 100644 --- a/src/H5B2cache.c +++ b/src/H5B2cache.c @@ -28,7 +28,7 @@ /* Module Setup */ /****************/ -#define H5B2_PACKAGE /*suppress error about including H5B2pkg */ +#include "H5B2module.h" /* This source code file is part of the H5B2 module */ /***********/ @@ -216,7 +216,7 @@ H5B2__cache_hdr_deserialize(const void *_image, size_t H5_ATTR_UNUSED len, uint32_t stored_chksum; /* Stored metadata checksum value */ uint32_t computed_chksum; /* Computed metadata checksum value */ const uint8_t *image = (const uint8_t *)_image; /* Pointer into raw data buffer */ - H5B2_hdr_t *ret_value; /* Return value */ + H5B2_hdr_t *ret_value = NULL; /* Return value */ FUNC_ENTER_STATIC @@ -490,7 +490,7 @@ H5B2__cache_int_deserialize(const void *_image, size_t H5_ATTR_UNUSED len, uint32_t stored_chksum; /* Stored metadata checksum value */ uint32_t computed_chksum; /* Computed metadata checksum value */ unsigned u; /* Local index variable */ - H5B2_internal_t *ret_value; /* Return value */ + H5B2_internal_t *ret_value = NULL; /* Return value */ FUNC_ENTER_STATIC @@ -798,7 +798,7 @@ H5B2__cache_leaf_deserialize(const void *_image, size_t H5_ATTR_UNUSED len, uint32_t stored_chksum; /* Stored metadata checksum value */ uint32_t computed_chksum; /* Computed metadata checksum value */ unsigned u; /* Local index variable */ - H5B2_leaf_t *ret_value; /* Return value */ + H5B2_leaf_t *ret_value = NULL; /* Return value */ FUNC_ENTER_STATIC diff --git a/src/H5B2dbg.c b/src/H5B2dbg.c index d3b5014..f723d10 100644 --- a/src/H5B2dbg.c +++ b/src/H5B2dbg.c @@ -28,7 +28,8 @@ /* Module Setup */ /****************/ -#define H5B2_PACKAGE /*suppress error about including H5B2pkg */ +#include "H5B2module.h" /* This source code file is part of the H5B2 module */ + /***********/ /* Headers */ diff --git a/src/H5B2hdr.c b/src/H5B2hdr.c index d873cf6..16d8467 100644 --- a/src/H5B2hdr.c +++ b/src/H5B2hdr.c @@ -28,7 +28,8 @@ /* Module Setup */ /****************/ -#define H5B2_PACKAGE /*suppress error about including H5B2pkg */ +#include "H5B2module.h" /* This source code file is part of the H5B2 module */ + /***********/ /* Headers */ @@ -239,7 +240,7 @@ H5B2_hdr_t * H5B2__hdr_alloc(H5F_t *f) { H5B2_hdr_t *hdr = NULL; /* v2 B-tree header */ - H5B2_hdr_t *ret_value; /* Return value */ + H5B2_hdr_t *ret_value = NULL; /* Return value */ FUNC_ENTER_PACKAGE @@ -285,8 +286,8 @@ haddr_t H5B2__hdr_create(H5F_t *f, hid_t dxpl_id, const H5B2_create_t *cparam, void *ctx_udata) { - H5B2_hdr_t *hdr = NULL; /* The new v2 B-tree header information */ - haddr_t ret_value; /* Return value */ + H5B2_hdr_t *hdr = NULL; /* The new v2 B-tree header information */ + haddr_t ret_value = HADDR_UNDEF; /* Return value */ FUNC_ENTER_PACKAGE diff --git a/src/H5B2int.c b/src/H5B2int.c index 0f884c2..f412260 100644 --- a/src/H5B2int.c +++ b/src/H5B2int.c @@ -28,7 +28,8 @@ /* Module Setup */ /****************/ -#define H5B2_PACKAGE /*suppress error about including H5B2pkg */ +#include "H5B2module.h" /* This source code file is part of the H5B2 module */ + /***********/ /* Headers */ @@ -1837,7 +1838,7 @@ H5B2__protect_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, haddr_t addr, uint16_t nrec, unsigned flags) { H5B2_leaf_cache_ud_t udata; /* User-data for callback */ - H5B2_leaf_t *ret_value; /* Return value */ + H5B2_leaf_t *ret_value = NULL; /* Return value */ FUNC_ENTER_PACKAGE @@ -1959,7 +1960,7 @@ H5B2__protect_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, haddr_t addr, uint16_t nrec, uint16_t depth, unsigned flags) { H5B2_internal_cache_ud_t udata; /* User data to pass through to cache 'deserialize' callback */ - H5B2_internal_t *ret_value; /* Return value */ + H5B2_internal_t *ret_value = NULL; /* Return value */ FUNC_ENTER_PACKAGE diff --git a/src/H5B2module.h b/src/H5B2module.h new file mode 100644 index 0000000..0fc30a5 --- /dev/null +++ b/src/H5B2module.h @@ -0,0 +1,36 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* + * Programmer: Quincey Koziol + * Saturday, September 12, 2015 + * + * Purpose: This file contains declarations which define macros for the + * H5B2 package. Including this header means that the source file + * is part of the H5B2 package. + */ +#ifndef _H5B2module_H +#define _H5B2module_H + +/* Define the proper control macros for the generic FUNC_ENTER/LEAVE and error + * reporting macros. + */ +#define H5B2_MODULE +#define H5_MY_PKG H5B2 +#define H5_MY_PKG_ERR H5E_BTREE +#define H5_MY_PKG_INIT NO + +#endif /* _H5B2module_H */ + + diff --git a/src/H5B2pkg.h b/src/H5B2pkg.h index b13c58d..d661efa 100644 --- a/src/H5B2pkg.h +++ b/src/H5B2pkg.h @@ -21,7 +21,7 @@ * the H5B2 package. Source files outside the H5B2 package should * include H5B2private.h instead. */ -#ifndef H5B2_PACKAGE +#if !(defined H5B2_FRIEND || defined H5B2_MODULE) #error "Do not include this file outside the H5B2 package!" #endif diff --git a/src/H5B2stat.c b/src/H5B2stat.c index bdb4a1f..10c692e 100644 --- a/src/H5B2stat.c +++ b/src/H5B2stat.c @@ -24,7 +24,7 @@ /* Module Setup */ /****************/ -#define H5B2_PACKAGE /* Suppress error about including H5B2pkg */ +#include "H5B2module.h" /* This source code file is part of the H5B2 module */ /***********/ diff --git a/src/H5B2test.c b/src/H5B2test.c index 31cf8e1..8ed364e 100644 --- a/src/H5B2test.c +++ b/src/H5B2test.c @@ -25,7 +25,7 @@ /* Module Setup */ /****************/ -#define H5B2_PACKAGE /*suppress error about including H5B2pkg */ +#include "H5B2module.h" /* This source code file is part of the H5B2 module */ #define H5B2_TESTING /*suppress warning about H5B2 testing funcs*/ @@ -120,7 +120,7 @@ H5B2__test_crt_context(void *_f) { H5F_t *f = (H5F_t *)_f; /* User data for building callback context */ H5B2_test_ctx_t *ctx; /* Callback context structure */ - void *ret_value; /* Return value */ + void *ret_value = NULL; /* Return value */ FUNC_ENTER_STATIC @@ -469,7 +469,7 @@ int H5B2_get_node_depth_test(H5B2_t *bt2, hid_t dxpl_id, void *udata) { H5B2_node_info_test_t ninfo; /* Node information */ - int ret_value; /* Return information */ + int ret_value = -1; /* Return information */ FUNC_ENTER_NOAPI(FAIL) diff --git a/src/H5Bcache.c b/src/H5Bcache.c index d071712..d08f1bc 100644 --- a/src/H5Bcache.c +++ b/src/H5Bcache.c @@ -28,7 +28,7 @@ /* Module Setup */ /****************/ -#define H5B_PACKAGE /*suppress error about including H5Bpkg */ +#include "H5Bmodule.h" /* This source code file is part of the H5B module */ /***********/ @@ -151,7 +151,7 @@ H5B__deserialize(const void *_image, size_t H5_ATTR_UNUSED len, void *_udata, const uint8_t *image = (const uint8_t *)_image; /* Pointer into image buffer */ uint8_t *native; /* Pointer to native keys */ unsigned u; /* Local index variable */ - H5B_t *ret_value; /* Return value */ + H5B_t *ret_value = NULL; /* Return value */ FUNC_ENTER_STATIC diff --git a/src/H5Bdbg.c b/src/H5Bdbg.c index e6d54dc..d92a24b 100644 --- a/src/H5Bdbg.c +++ b/src/H5Bdbg.c @@ -28,7 +28,7 @@ /* Module Setup */ /****************/ -#define H5B_PACKAGE /*suppress error about including H5Bpkg */ +#include "H5Bmodule.h" /* This source code file is part of the H5B module */ /***********/ diff --git a/src/H5Bmodule.h b/src/H5Bmodule.h new file mode 100644 index 0000000..6800b26 --- /dev/null +++ b/src/H5Bmodule.h @@ -0,0 +1,35 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* + * Programmer: Quincey Koziol + * Saturday, September 12, 2015 + * + * Purpose: This file contains declarations which define macros for the + * H5B package. Including this header means that the source file + * is part of the H5B package. + */ +#ifndef _H5Bmodule_H +#define _H5Bmodule_H + +/* Define the proper control macros for the generic FUNC_ENTER/LEAVE and error + * reporting macros. + */ +#define H5B_MODULE +#define H5_MY_PKG H5B +#define H5_MY_PKG_ERR H5E_BTREE +#define H5_MY_PKG_INIT NO + +#endif /* _H5Bmodule_H */ + diff --git a/src/H5Bpkg.h b/src/H5Bpkg.h index 374fcb5..e645626 100644 --- a/src/H5Bpkg.h +++ b/src/H5Bpkg.h @@ -21,7 +21,7 @@ * the H5B package. Source files outside the H5B package should * include H5Bprivate.h instead. */ -#ifndef H5B_PACKAGE +#if !(defined H5B_FRIEND || defined H5B_MODULE) #error "Do not include this file outside the H5B package!" #endif diff --git a/src/H5C.c b/src/H5C.c index cd04f7e..2a4b4cf 100644 --- a/src/H5C.c +++ b/src/H5C.c @@ -74,8 +74,8 @@ /* Module Setup */ /****************/ -#define H5C_PACKAGE /*suppress error about including H5Cpkg */ -#define H5F_PACKAGE /*suppress error about including H5Fpkg */ +#include "H5Cmodule.h" /* This source code file is part of the H5C module */ +#define H5F_FRIEND /*suppress error about including H5Fpkg */ /***********/ @@ -107,6 +107,7 @@ #define H5C_IMAGE_EXTRA_SPACE 0 #endif /* H5C_DO_MEMORY_SANITY_CHECKS */ + /******************/ /* Local Typedefs */ /******************/ @@ -203,6 +204,9 @@ herr_t H5C_dump_cache_skip_list(H5C_t * cache_ptr, char * calling_fcn); /* Package Variables */ /*********************/ +/* Package initialization variable */ +hbool_t H5_PKG_INIT_VAR = FALSE; + /*****************************/ /* Library Private Variables */ @@ -2598,7 +2602,7 @@ H5C_protect(H5F_t * f, size_t empty_space; void * thing; H5C_cache_entry_t * entry_ptr; - void * ret_value; /* Return value */ + void * ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI(NULL) @@ -8291,7 +8295,7 @@ H5C_load_entry(H5F_t * f, H5C_cache_entry_t * entry; /* Alias for thing loaded, as cache entry */ size_t len; /* Size of image in file */ unsigned u; /* Local index variable */ - void * ret_value; /* Return value */ + void * ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT diff --git a/src/H5CS.c b/src/H5CS.c index 29182ce..f1d3a8b 100644 --- a/src/H5CS.c +++ b/src/H5CS.c @@ -30,10 +30,19 @@ #include "H5private.h" /* Generic Functions */ #include "H5CSprivate.h" /* Function stack */ -#include "H5MMprivate.h" /* Memory management */ +#include "H5Eprivate.h" /* Error handling */ #ifdef H5_HAVE_CODESTACK +#define H5CS_MIN_NSLOTS 16 /* Minimum number of records in an function stack */ + +/* A function stack */ +typedef struct H5CS_t { + unsigned nused; /* Number of records currently used in stack */ + unsigned nalloc; /* Number of records current allocated for stack */ + const char **rec; /* Array of function records */ +} H5CS_t; + #ifdef H5_HAVE_THREADSAFE /* * The per-thread function stack. pthread_once() initializes a special @@ -44,8 +53,8 @@ * In order for this macro to work, H5CS_get_my_stack() must be preceeded * by "H5CS_t *fstack =". */ -static H5CS_t *H5CS_get_stack(void); -#define H5CS_get_my_stack() H5CS_get_stack() +static H5CS_t *H5CS__get_stack(void); +#define H5CS_get_my_stack() H5CS__get_stack() #else /* H5_HAVE_THREADSAFE */ /* * The function stack. Eventually we'll have some sort of global table so each @@ -58,7 +67,7 @@ H5CS_t H5CS_stack_g[1]; #ifdef H5_HAVE_THREADSAFE /*------------------------------------------------------------------------- - * Function: H5CS_get_stack + * Function: H5CS__get_stack * * Purpose: Support function for H5CS_get_my_stack() to initialize and * acquire per-thread function stack. @@ -70,19 +79,17 @@ H5CS_t H5CS_stack_g[1]; * Programmer: Quincey Koziol * February 6, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ static H5CS_t * -H5CS_get_stack(void) +H5CS__get_stack(void) { H5CS_t *fstack; - FUNC_ENTER_NOAPI_NOERR_NOFS + FUNC_ENTER_STATIC_NOERR_NOFS fstack = H5TS_get_thread_local_value(H5TS_funcstk_key_g); - if (!fstack) { + if(!fstack) { /* No associated value with current thread - create one */ #ifdef H5_HAVE_WIN_THREADS fstack = (H5CS_t *)LocalAlloc(LPTR, sizeof(H5CS_t)); /* Win32 has to use LocalAlloc to match the LocalFree in DllMain */ @@ -92,17 +99,19 @@ H5CS_get_stack(void) HDassert(fstack); /* Set the thread-specific info */ - fstack->nused=0; + fstack->nused = 0; + fstack->nalloc = 0; + fstack->rec = NULL; /* (It's not necessary to release this in this API, it is * released by the "key destructor" set up in the H5TS * routines. See calls to pthread_key_create() in H5TS.c -QAK) */ H5TS_set_thread_local_value(H5TS_funcstk_key_g, (void *)fstack); - } + } /* end if */ - FUNC_LEAVE_NOAPI_NOFS(fstack); -} /* end H5CS_get_stack() */ + FUNC_LEAVE_NOAPI_NOFS(fstack) +} /* end H5CS__get_stack() */ #endif /* H5_HAVE_THREADSAFE */ @@ -133,59 +142,28 @@ H5CS_print_stack(const H5CS_t *fstack, FILE *stream) HDassert(fstack); /* Default to outputting information to stderr */ - if (!stream) + if(!stream) stream = stderr; - HDfprintf (stream, "HDF5-DIAG: Function stack from %s ", H5_lib_vers_info_g); + HDfprintf(stream, "HDF5-DIAG: Function stack from %s ", H5_lib_vers_info_g); /* try show the process or thread id in multiple processes cases*/ #ifdef H5_HAVE_THREADSAFE - HDfprintf (stream, "thread %lu.", HDpthread_self_ulong()); + HDfprintf(stream, "thread %lu.", HDpthread_self_ulong()); #else /* H5_HAVE_THREADSAFE */ - HDfprintf (stream, "thread 0."); + HDfprintf(stream, "thread 0."); #endif /* H5_HAVE_THREADSAFE */ - if (fstack && fstack->nused>0) - HDfprintf (stream, " Back trace follows."); - HDfputc ('\n', stream); + if(fstack && fstack->nused>0) + HDfprintf(stream, " Back trace follows."); + HDfputc('\n', stream); - for (i=fstack->nused-1; i>=0; --i) - HDfprintf(stream, "%*s#%03d: Routine: %s\n", indent, "", i, fstack->slot[i]); + for(i = fstack->nused - 1; i >= 0; --i) + HDfprintf(stream, "%*s#%03d: Routine: %s\n", indent, "", i, fstack->rec[i]); - FUNC_LEAVE_NOAPI_NOFS(SUCCEED); + FUNC_LEAVE_NOAPI_NOFS(SUCCEED) } /* end H5CS_print_stack() */ /*------------------------------------------------------------------------- - * Function: H5CS_print - * - * Purpose: Prints the default function stack in some default way. - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Quincey Koziol - * Thursday, February 6, 2003 - * - * Modifications: - * - *------------------------------------------------------------------------- - */ -herr_t -H5CS_print(FILE *stream) -{ - H5CS_t *fstack = H5CS_get_my_stack (); /* Get the correct function stack */ - - /* Don't push this function on the function stack... :-) */ - FUNC_ENTER_NOAPI_NOERR_NOFS - - /* Sanity check */ - HDassert(fstack); - - H5CS_print_stack(fstack, stream); - - FUNC_LEAVE_NOAPI_NOFS(SUCCEED); -} /* end H5CS_print() */ - - -/*------------------------------------------------------------------------- * Function: H5CS_push * * Purpose: Pushes a new record onto function stack for the current @@ -196,30 +174,37 @@ H5CS_print(FILE *stream) * Programmer: Quincey Koziol * Thursday, February 6, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5CS_push(const char *func_name) { - H5CS_t *fstack = H5CS_get_my_stack (); + H5CS_t *fstack = H5CS_get_my_stack(); /* Current function stack for library */ /* Don't push this function on the function stack... :-) */ FUNC_ENTER_NOAPI_NOERR_NOFS /* Sanity check */ HDassert(fstack); + HDassert(fstack->nused <= fstack->nalloc); HDassert(func_name); - /* - * Push the function if there's room. Otherwise just increment count - */ - if (fstack->nusedslot[fstack->nused] = func_name; + /* Check if we need to expand the stack of records */ + if(fstack->nused == fstack->nalloc) { + size_t na = MAX((fstack->nalloc * 2), H5CS_MIN_NSLOTS); + const char **x = (const char **)HDrealloc(fstack->rec, na * sizeof(const char *)); + + /* (Avoid returning an error from this routine, currently -QAK) */ + HDassert(x); + fstack->rec = x; + fstack->nalloc = na; + } /* end if */ + + /* Push the function name */ + fstack->rec[fstack->nused] = func_name; fstack->nused++; - FUNC_LEAVE_NOAPI_NOFS(SUCCEED); + FUNC_LEAVE_NOAPI_NOFS(SUCCEED) } /* end H5CS_push() */ @@ -240,14 +225,14 @@ H5CS_push(const char *func_name) herr_t H5CS_pop(void) { - H5CS_t *fstack = H5CS_get_my_stack (); + H5CS_t *fstack = H5CS_get_my_stack(); /* Don't push this function on the function stack... :-) */ FUNC_ENTER_NOAPI_NOERR_NOFS /* Sanity check */ HDassert(fstack); - HDassert(fstack->nused>0); + HDassert(fstack->nused > 0); /* Pop the function. */ fstack->nused--; @@ -266,43 +251,52 @@ H5CS_pop(void) * Programmer: Quincey Koziol * Tuesday, August 9, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ -herr_t -H5CS_copy_stack(H5CS_t *new_stack) +H5CS_t * +H5CS_copy_stack(void) { - H5CS_t *old_stack = H5CS_get_my_stack (); + H5CS_t *old_stack = H5CS_get_my_stack(); /* Existing function stack for library */ + H5CS_t *new_stack; /* New function stack, for copy */ unsigned u; /* Local index variable */ + H5CS_t *ret_value = NULL; /* Return value */ /* Don't push this function on the function stack... :-) */ - FUNC_ENTER_NOAPI_NOERR_NOFS + FUNC_ENTER_NOAPI_NOFS /* Sanity check */ HDassert(old_stack); + /* Allocate a new stack */ + /* (Don't use library allocate code, since this code stack supports it) */ + if(NULL == (new_stack = HDcalloc(1, sizeof(H5CS_t)))) + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, NULL, "can't allocate function stack") + if(NULL == (new_stack->rec = HDcalloc(old_stack->nused, sizeof(const char *)))) + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, NULL, "can't allocate function stack records") + /* Copy old stack to new one, duplicating the strings */ for(u = 0; u < old_stack->nused; u++) - new_stack->slot[u] = H5MM_strdup(old_stack->slot[u]); - new_stack->nused = old_stack->nused; + new_stack->rec[u] = HDstrdup(old_stack->rec[u]); + new_stack->nused = new_stack->nalloc = old_stack->nused; - FUNC_LEAVE_NOAPI_NOFS(SUCCEED); + /* Set the return value */ + ret_value = new_stack; + +done: + FUNC_LEAVE_NOAPI_NOFS(ret_value) } /* end H5CS_copy_stack() */ /*------------------------------------------------------------------------- * Function: H5CS_close_stack * - * Purpose: Closes a copy of a stack + * Purpose: Closes and frees a copy of a stack * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol * Tuesday, August 9, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t @@ -316,11 +310,20 @@ H5CS_close_stack(H5CS_t *stack) /* Sanity check */ HDassert(stack); - /* Free strings on stack */ - for(u = 0; u < stack->nused; u++) - stack->slot[u] = H5MM_xfree((void *)stack->slot[u]); - - FUNC_LEAVE_NOAPI_NOFS(SUCCEED); + /* Free stack */ + for(u = 0; u < stack->nused; u++) { + if(stack->rec[u]) + HDfree((void *)stack->rec[u]); + stack->rec[u] = NULL; + } /* end for */ + if(stack->rec) { + HDfree(stack->rec); + stack->rec = NULL; + } /* end if */ + if(stack) + HDfree(stack); + + FUNC_LEAVE_NOAPI_NOFS(SUCCEED) } /* end H5CS_close_stack() */ #endif /* H5_HAVE_CODESTACK */ diff --git a/src/H5CSprivate.h b/src/H5CSprivate.h index 13f3b66..ab7f993 100644 --- a/src/H5CSprivate.h +++ b/src/H5CSprivate.h @@ -26,19 +26,13 @@ /* Private headers needed by this file */ #include "H5private.h" -#define H5CS_NSLOTS 48 /*number of slots in an function stack */ - -/* A function stack */ -typedef struct H5CS_t { - unsigned nused; /*num slots currently used in stack */ - const char *slot[H5CS_NSLOTS]; /*array of function records */ -} H5CS_t; - -H5_DLL herr_t H5CS_push (const char *func_name); -H5_DLL herr_t H5CS_pop (void); -H5_DLL herr_t H5CS_print (FILE *stream); -H5_DLL herr_t H5CS_print_stack (const H5CS_t *stack, FILE *stream); -H5_DLL herr_t H5CS_copy_stack (H5CS_t *stack); -H5_DLL herr_t H5CS_close_stack (H5CS_t *stack); +/* Forward declarations for structure fields */ +struct H5CS_t; +H5_DLL herr_t H5CS_push(const char *func_name); +H5_DLL herr_t H5CS_pop(void); +H5_DLL herr_t H5CS_print_stack(const struct H5CS_t *stack, FILE *stream); +H5_DLL struct H5CS_t *H5CS_copy_stack(void); +H5_DLL herr_t H5CS_close_stack(struct H5CS_t *stack); #endif /* _H5CSprivate_H */ + diff --git a/src/H5Cmodule.h b/src/H5Cmodule.h new file mode 100644 index 0000000..2c39eab --- /dev/null +++ b/src/H5Cmodule.h @@ -0,0 +1,35 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* + * Programmer: Quincey Koziol + * Saturday, September 12, 2015 + * + * Purpose: This file contains declarations which define macros for the + * H5C package. Including this header means that the source file + * is part of the H5C package. + */ +#ifndef _H5Cmodule_H +#define _H5Cmodule_H + +/* Define the proper control macros for the generic FUNC_ENTER/LEAVE and error + * reporting macros. + */ +#define H5C_MODULE +#define H5_MY_PKG H5C +#define H5_MY_PKG_ERR H5E_CACHE +#define H5_MY_PKG_INIT NO + +#endif /* _H5Cmodule_H */ + diff --git a/src/H5Cmpio.c b/src/H5Cmpio.c index ec34285..6b63ad5 100644 --- a/src/H5Cmpio.c +++ b/src/H5Cmpio.c @@ -29,8 +29,8 @@ /* Module Setup */ /****************/ -#define H5C_PACKAGE /*suppress error about including H5Cpkg */ -#define H5F_PACKAGE /*suppress error about including H5Fpkg */ +#include "H5Cmodule.h" /* This source code file is part of the H5C module */ +#define H5F_FRIEND /*suppress error about including H5Fpkg */ /***********/ diff --git a/src/H5Cpkg.h b/src/H5Cpkg.h index ea965fd..6c8996d 100644 --- a/src/H5Cpkg.h +++ b/src/H5Cpkg.h @@ -28,7 +28,7 @@ * reason why this file was created. */ -#ifndef H5C_PACKAGE +#if !(defined H5C_FRIEND || defined H5C_MODULE) #error "Do not include this file outside the H5C package!" #endif diff --git a/src/H5D.c b/src/H5D.c index 6183ec5..1ffee94 100644 --- a/src/H5D.c +++ b/src/H5D.c @@ -17,10 +17,7 @@ /* Module Setup */ /****************/ -#define H5D_PACKAGE /*suppress error about including H5Dpkg */ - -/* Interface initialization */ -#define H5_INTERFACE_INIT_FUNC H5D__init_pub_interface +#include "H5Dmodule.h" /* This source code file is part of the H5D module */ /***********/ @@ -52,6 +49,9 @@ /* Package Variables */ /*********************/ +/* Package initialization variable */ +hbool_t H5_PKG_INIT_VAR = FALSE; + /* Declare extern the free list to manage blocks of VL data */ H5FL_BLK_EXTERN(vlen_vl_buf); @@ -73,51 +73,6 @@ H5FL_BLK_EXTERN(type_conv); -/*-------------------------------------------------------------------------- -NAME - H5D__init_pub_interface -- Initialize interface-specific information -USAGE - herr_t H5D__init_pub_interface() -RETURNS - Non-negative on success/Negative on failure -DESCRIPTION - Initializes any interface-specific data or routines. (Just calls - H5D_init() currently). - ---------------------------------------------------------------------------*/ -static herr_t -H5D__init_pub_interface(void) -{ - FUNC_ENTER_STATIC_NOERR - - FUNC_LEAVE_NOAPI(H5D_init()) -} /* H5D__init_pub_interface() */ - - -/*-------------------------------------------------------------------------- -NAME - H5D__term_pub_interface -- Terminate interface -USAGE - herr_t H5D__term_pub_interface() -RETURNS - Non-negative on success/Negative on failure -DESCRIPTION - Terminates interface. (Just resets H5_interface_initialize_g - currently). - ---------------------------------------------------------------------------*/ -herr_t -H5D__term_pub_interface(void) -{ - FUNC_ENTER_PACKAGE_NOERR - - /* Mark closed */ - H5_interface_initialize_g = 0; - - FUNC_LEAVE_NOAPI(0) -} /* H5D__term_pub_interface() */ - - /*------------------------------------------------------------------------- * Function: H5Dcreate2 * diff --git a/src/H5Dbtree.c b/src/H5Dbtree.c index a4009a9..762c252 100644 --- a/src/H5Dbtree.c +++ b/src/H5Dbtree.c @@ -26,7 +26,7 @@ /* Module Setup */ /****************/ -#define H5D_PACKAGE /*suppress error about including H5Dpkg */ +#include "H5Dmodule.h" /* This source code file is part of the H5D module */ /***********/ @@ -331,7 +331,7 @@ H5D__btree_cmp2(void *_lt_key, void *_udata, void *_rt_key) H5D_btree_key_t *lt_key = (H5D_btree_key_t *) _lt_key; H5D_btree_key_t *rt_key = (H5D_btree_key_t *) _rt_key; H5D_chunk_common_ud_t *udata = (H5D_chunk_common_ud_t *) _udata; - int ret_value; + int ret_value = -1; /* Return value */ FUNC_ENTER_STATIC_NOERR @@ -553,7 +553,7 @@ H5D__btree_insert(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, haddr_t addr, void *_l H5D_chunk_ud_t *udata = (H5D_chunk_ud_t *) _udata; int cmp; unsigned u; - H5B_ins_t ret_value; + H5B_ins_t ret_value = H5B_INS_ERROR; /* Return value */ FUNC_ENTER_STATIC @@ -969,7 +969,7 @@ done: static hbool_t H5D__btree_idx_is_space_alloc(const H5O_storage_chunk_t *storage) { - hbool_t ret_value; /* Return value */ + hbool_t ret_value = FALSE; /* Return value */ FUNC_ENTER_STATIC_NOERR @@ -1085,7 +1085,7 @@ H5D__btree_idx_iterate_cb(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, H5D_btree_it_ud_t *udata = (H5D_btree_it_ud_t *)_udata; /* User data */ const H5D_btree_key_t *lt_key = (const H5D_btree_key_t *)_lt_key; /* B-tree key for chunk */ H5D_chunk_rec_t chunk_rec; /* Generic chunk record for callback */ - int ret_value; /* Return value */ + int ret_value = -1; /* Return value */ FUNC_ENTER_STATIC_NOERR @@ -1127,7 +1127,7 @@ H5D__btree_idx_iterate(const H5D_chk_idx_info_t *idx_info, H5D_chunk_cb_func_t chunk_cb, void *chunk_udata) { H5D_btree_it_ud_t udata; /* User data for B-tree iterator callback */ - int ret_value; /* Return value */ + int ret_value = -1; /* Return value */ FUNC_ENTER_STATIC_NOERR diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c index 8584d0a..03548b9 100644 --- a/src/H5Dchunk.c +++ b/src/H5Dchunk.c @@ -44,7 +44,7 @@ /* Module Setup */ /****************/ -#define H5D_PACKAGE /*suppress error about including H5Dpkg */ +#include "H5Dmodule.h" /* This source code file is part of the H5D module */ /***********/ @@ -683,7 +683,7 @@ done: hbool_t H5D__chunk_is_space_alloc(const H5O_storage_t *storage) { - hbool_t ret_value; /* Return value */ + hbool_t ret_value = FALSE; /* Return value */ FUNC_ENTER_PACKAGE_NOERR @@ -2401,7 +2401,7 @@ H5D__chunk_hash_val(const H5D_shared_t *shared, const hsize_t *scaled) { hsize_t val; /* Intermediate value */ unsigned ndims = shared->ndims; /* Rank of dataset */ - unsigned ret; /* Value to return */ + unsigned ret = 0; /* Value to return */ FUNC_ENTER_STATIC_NOERR @@ -2894,7 +2894,7 @@ H5D__chunk_lock(const H5D_io_info_t *io_info, H5D_chunk_ud_t *udata, H5D_rdcc_ent_t *ent; /*cache entry */ size_t chunk_size; /*size of a chunk */ void *chunk = NULL; /*the file chunk */ - void *ret_value; /*return value */ + void *ret_value = NULL; /* Return value */ FUNC_ENTER_PACKAGE @@ -5364,7 +5364,7 @@ H5D__nonexistent_readvv(const H5D_io_info_t *io_info, size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_len_arr[], hsize_t mem_off_arr[]) { H5D_chunk_readvv_ud_t udata; /* User data for H5VM_opvv() operator */ - ssize_t ret_value; /* Return value */ + ssize_t ret_value = -1; /* Return value */ FUNC_ENTER_STATIC diff --git a/src/H5Dcompact.c b/src/H5Dcompact.c index acb4541..b738698 100644 --- a/src/H5Dcompact.c +++ b/src/H5Dcompact.c @@ -25,7 +25,7 @@ /* Module Setup */ /****************/ -#define H5D_PACKAGE /*suppress error about including H5Dpkg */ +#include "H5Dmodule.h" /* This source code file is part of the H5D module */ /***********/ @@ -285,7 +285,7 @@ H5D__compact_readvv(const H5D_io_info_t *io_info, size_t dset_max_nseq, size_t *dset_curr_seq, size_t dset_size_arr[], hsize_t dset_offset_arr[], size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_size_arr[], hsize_t mem_offset_arr[]) { - ssize_t ret_value; /* Return value */ + ssize_t ret_value = -1; /* Return value */ FUNC_ENTER_STATIC @@ -326,7 +326,7 @@ H5D__compact_writevv(const H5D_io_info_t *io_info, size_t dset_max_nseq, size_t *dset_curr_seq, size_t dset_size_arr[], hsize_t dset_offset_arr[], size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_size_arr[], hsize_t mem_offset_arr[]) { - ssize_t ret_value; /* Return value */ + ssize_t ret_value = -1; /* Return value */ FUNC_ENTER_STATIC diff --git a/src/H5Dcontig.c b/src/H5Dcontig.c index fb3ac85..00a9098 100644 --- a/src/H5Dcontig.c +++ b/src/H5Dcontig.c @@ -27,7 +27,7 @@ /* Module Setup */ /****************/ -#define H5D_PACKAGE /*suppress error about including H5Dpkg */ +#include "H5Dmodule.h" /* This source code file is part of the H5D module */ /***********/ @@ -466,7 +466,8 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D__contig_init(H5F_t *f, hid_t dxpl_id, const H5D_t *dset, hid_t dapl_id) +H5D__contig_init(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, const H5D_t *dset, + hid_t H5_ATTR_UNUSED dapl_id) { hsize_t tmp_size; /* Temporary holder for raw data size */ size_t tmp_sieve_buf_size; /* Temporary holder for sieve buffer size */ @@ -539,7 +540,7 @@ done: hbool_t H5D__contig_is_space_alloc(const H5O_storage_t *storage) { - hbool_t ret_value; /* Return value */ + hbool_t ret_value = FALSE; /* Return value */ FUNC_ENTER_PACKAGE_NOERR @@ -917,7 +918,7 @@ H5D__contig_readvv(const H5D_io_info_t *io_info, size_t dset_max_nseq, size_t *dset_curr_seq, size_t dset_len_arr[], hsize_t dset_off_arr[], size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_len_arr[], hsize_t mem_off_arr[]) { - ssize_t ret_value; /* Return value */ + ssize_t ret_value = -1; /* Return value */ FUNC_ENTER_STATIC @@ -1244,7 +1245,7 @@ H5D__contig_writevv(const H5D_io_info_t *io_info, size_t dset_max_nseq, size_t *dset_curr_seq, size_t dset_len_arr[], hsize_t dset_off_arr[], size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_len_arr[], hsize_t mem_off_arr[]) { - ssize_t ret_value; /* Return value (Size of sequence in bytes) */ + ssize_t ret_value = -1; /* Return value (Size of sequence in bytes) */ FUNC_ENTER_STATIC diff --git a/src/H5Ddbg.c b/src/H5Ddbg.c index 4e934f2..34e0ae9 100644 --- a/src/H5Ddbg.c +++ b/src/H5Ddbg.c @@ -17,10 +17,7 @@ /* Module Setup */ /****************/ -#define H5D_PACKAGE /*suppress error about including H5Dpkg */ - -/* Interface initialization */ -#define H5_INTERFACE_INIT_FUNC H5D__init_dbg_interface +#include "H5Dmodule.h" /* This source code file is part of the H5D module */ /***********/ @@ -61,26 +58,6 @@ /* Local Variables */ /*******************/ - -/*-------------------------------------------------------------------------- -NAME - H5D__init_dbg_interface -- Initialize interface-specific information -USAGE - herr_t H5D__init_dbg_interface() -RETURNS - Non-negative on success/Negative on failure -DESCRIPTION - Initializes any interface-specific data or routines. (Just calls - H5D_init() currently). - ---------------------------------------------------------------------------*/ -static herr_t -H5D__init_dbg_interface(void) -{ - FUNC_ENTER_STATIC_NOERR - - FUNC_LEAVE_NOAPI(H5D_init()) -} /* H5D__init_dbg_interface() */ /*------------------------------------------------------------------------- diff --git a/src/H5Ddeprec.c b/src/H5Ddeprec.c index cd2bc84..5a2b355 100644 --- a/src/H5Ddeprec.c +++ b/src/H5Ddeprec.c @@ -31,10 +31,7 @@ /* Module Setup */ /****************/ -#define H5D_PACKAGE /*suppress error about including H5Dpkg */ - -/* Interface initialization */ -#define H5_INTERFACE_INIT_FUNC H5D__init_deprec_interface +#include "H5Dmodule.h" /* This source code file is part of the H5D module */ /***********/ @@ -85,51 +82,6 @@ static herr_t H5D__extend(H5D_t *dataset, const hsize_t *size, hid_t dxpl_id); /*******************/ - -/*-------------------------------------------------------------------------- -NAME - H5D__init_deprec_interface -- Initialize interface-specific information -USAGE - herr_t H5D__init_deprec_interface() -RETURNS - Non-negative on success/Negative on failure -DESCRIPTION - Initializes any interface-specific data or routines. (Just calls - H5D_init() currently). - ---------------------------------------------------------------------------*/ -static herr_t -H5D__init_deprec_interface(void) -{ - FUNC_ENTER_STATIC_NOERR - - FUNC_LEAVE_NOAPI(H5D_init()) -} /* H5D__init_deprec_interface() */ - - -/*-------------------------------------------------------------------------- -NAME - H5D__term_deprec_interface -- Terminate interface -USAGE - herr_t H5D__term_deprec_interface() -RETURNS - Non-negative on success/Negative on failure -DESCRIPTION - Terminates interface. (Just resets H5_interface_initialize_g - currently). - ---------------------------------------------------------------------------*/ -herr_t -H5D__term_deprec_interface(void) -{ - FUNC_ENTER_PACKAGE_NOERR - - /* Mark closed */ - H5_interface_initialize_g = 0; - - FUNC_LEAVE_NOAPI(0) -} /* H5D__term_deprec_interface() */ - #ifndef H5_NO_DEPRECATED_SYMBOLS /*------------------------------------------------------------------------- diff --git a/src/H5Defl.c b/src/H5Defl.c index 9e5872a..7d13fab 100644 --- a/src/H5Defl.c +++ b/src/H5Defl.c @@ -22,7 +22,7 @@ /* Module Setup */ /****************/ -#define H5D_PACKAGE /*suppress error about including H5Dpkg */ +#include "H5Dmodule.h" /* This source code file is part of the H5D module */ /***********/ @@ -455,7 +455,7 @@ H5D__efl_readvv(const H5D_io_info_t *io_info, size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_len_arr[], hsize_t mem_off_arr[]) { H5D_efl_readvv_ud_t udata; /* User data for H5VM_opvv() operator */ - ssize_t ret_value; /* Return value (Total size of sequence in bytes) */ + ssize_t ret_value = -1; /* Return value (Total size of sequence in bytes) */ FUNC_ENTER_STATIC @@ -535,7 +535,7 @@ H5D__efl_writevv(const H5D_io_info_t *io_info, size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_len_arr[], hsize_t mem_off_arr[]) { H5D_efl_writevv_ud_t udata; /* User data for H5VM_opvv() operator */ - ssize_t ret_value; /* Return value (Total size of sequence in bytes) */ + ssize_t ret_value = -1; /* Return value (Total size of sequence in bytes) */ FUNC_ENTER_STATIC diff --git a/src/H5Dfill.c b/src/H5Dfill.c index 484c362..947a177 100644 --- a/src/H5Dfill.c +++ b/src/H5Dfill.c @@ -28,7 +28,8 @@ /* Module Setup */ /****************/ -#define H5D_PACKAGE /*suppress error about including H5Dpkg */ +#include "H5Dmodule.h" /* This source code file is part of the H5D module */ + /***********/ /* Headers */ diff --git a/src/H5Dint.c b/src/H5Dint.c index 28bfa59..fa92da0 100644 --- a/src/H5Dint.c +++ b/src/H5Dint.c @@ -17,10 +17,7 @@ /* Module Setup */ /****************/ -#define H5D_PACKAGE /*suppress error about including H5Dpkg */ - -/* Interface initialization */ -#define H5_INTERFACE_INIT_FUNC H5D__init_interface +#include "H5Dmodule.h" /* This source code file is part of the H5D module */ /***********/ @@ -118,6 +115,9 @@ static const H5I_class_t H5I_DATASET_CLS[1] = {{ (H5I_free_t)H5D_close /* Callback routine for closing objects of this class */ }}; +/* Flag indicating "top" of interface has been initialized */ +static hbool_t H5D_top_package_initialize_s = FALSE; + /*------------------------------------------------------------------------- @@ -149,9 +149,9 @@ done: /*-------------------------------------------------------------------------- NAME - H5D__init_interface -- Initialize interface-specific information + H5D__init_package -- Initialize interface-specific information USAGE - herr_t H5D__init_interface() + herr_t H5D__init_package() RETURNS Non-negative on success/Negative on failure @@ -162,13 +162,13 @@ NOTES a deadlock in the library when the library is attempting to terminate -QAK --------------------------------------------------------------------------*/ -static herr_t -H5D__init_interface(void) +herr_t +H5D__init_package(void) { - H5P_genplist_t *def_dcpl; /* Default Dataset Creation Property list */ - herr_t ret_value = SUCCEED; /* Return value */ + H5P_genplist_t *def_dcpl; /* Default Dataset Creation Property list */ + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_STATIC + FUNC_ENTER_PACKAGE /* Initialize the atom group for the dataset IDs */ if(H5I_register_type(H5I_DATASET_CLS) < 0) @@ -202,34 +202,36 @@ H5D__init_interface(void) if(H5D__get_dxpl_cache_real(H5P_DATASET_XFER_DEFAULT, &H5D_def_dxpl_cache) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't retrieve default DXPL info") + /* Mark "top" of interface as initialized, too */ + H5D_top_package_initialize_s = TRUE; + done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D__init_interface() */ +} /* end H5D__init_package() */ /*------------------------------------------------------------------------- - * Function: H5D_term_interface + * Function: H5D_top_term_package * - * Purpose: Terminate this interface. + * Purpose: Close the "top" of the interface, releasing IDs, etc. * * Return: Success: Positive if anything was done that might * affect other interfaces; zero otherwise. - * * Failure: Negative. * - * Programmer: Robb Matzke - * Friday, November 20, 1998 + * Programmer: Quincey Koziol + * Sunday, September 13, 2015 * *------------------------------------------------------------------------- */ int -H5D_term_interface(void) +H5D_top_term_package(void) { int n = 0; FUNC_ENTER_NOAPI_NOINIT_NOERR - if(H5_interface_initialize_g) { + if(H5D_top_package_initialize_s) { if(H5I_nmembers(H5I_DATASET) > 0) { /* The dataset API uses the "force" flag set to true because it * is using the "file objects" (H5FO) API functions to track open @@ -256,24 +258,55 @@ H5D_term_interface(void) (void)H5I_clear_type(H5I_DATASET, TRUE, FALSE); n++; /*H5I*/ } /* end if */ - else { - /* Close public interface */ - n += H5D__term_pub_interface(); - /* Close deprecated interface */ - n += H5D__term_deprec_interface(); + /* Mark closed */ + if(0 == n) + H5D_top_package_initialize_s = FALSE; + } /* end if */ + + FUNC_LEAVE_NOAPI(n) +} /* end H5D_top_term_package() */ - /* Destroy the dataset object id group */ - (void)H5I_dec_type_ref(H5I_DATASET); - n++; /*H5I*/ + +/*------------------------------------------------------------------------- + * Function: H5D_term_package + * + * Purpose: Terminate this interface. + * + * Note: Finishes shutting down the interface, after + * H5D_top_term_package() is called + * + * Return: Success: Positive if anything was done that might + * affect other interfaces; zero otherwise. + * Failure: Negative. + * + * Programmer: Robb Matzke + * Friday, November 20, 1998 + * + *------------------------------------------------------------------------- + */ +int +H5D_term_package(void) +{ + int n = 0; + + FUNC_ENTER_NOAPI_NOINIT_NOERR + + if(H5_PKG_INIT_VAR) { + /* Sanity checks */ + HDassert(0 == H5I_nmembers(H5I_DATASET)); + HDassert(FALSE == H5D_top_package_initialize_s); + + /* Destroy the dataset object id group */ + n += (H5I_dec_type_ref(H5I_DATASET) > 0); - /* Mark closed */ - H5_interface_initialize_g = 0; - } /* end else */ + /* Mark closed */ + if(0 == n) + H5_PKG_INIT_VAR = FALSE; } /* end if */ FUNC_LEAVE_NOAPI(n) -} /* end H5D_term_interface() */ +} /* end H5D_term_package() */ /*-------------------------------------------------------------------------- @@ -424,7 +457,7 @@ H5D__create_named(const H5G_loc_t *loc, const char *name, hid_t type_id, { H5O_obj_create_t ocrt_info; /* Information for object creation */ H5D_obj_create_t dcrt_info; /* Information for dataset creation */ - H5D_t *ret_value; /* Return value */ + H5D_t *ret_value = NULL; /* Return value */ FUNC_ENTER_PACKAGE @@ -549,7 +582,7 @@ H5D__new(hid_t dcpl_id, hbool_t creating, hbool_t vl_type) { H5D_shared_t *new_dset = NULL; /* New dataset object */ H5P_genplist_t *plist; /* Property list created */ - H5D_shared_t *ret_value; /* Return value */ + H5D_shared_t *ret_value = NULL; /* Return value */ FUNC_ENTER_STATIC @@ -972,7 +1005,7 @@ H5D__create(H5F_t *file, hid_t type_id, const H5S_t *space, hid_t dcpl_id, hbool_t has_vl_type = FALSE; /* Flag to indicate a VL-type for dataset */ hbool_t layout_init = FALSE; /* Flag to indicate that chunk information was initialized */ H5G_loc_t dset_loc; /* Dataset location */ - H5D_t *ret_value; /* Return value */ + H5D_t *ret_value = NULL; /* Return value */ FUNC_ENTER_PACKAGE @@ -1169,7 +1202,7 @@ H5D__open_name(const H5G_loc_t *loc, const char *name, hid_t dapl_id, H5O_loc_t oloc; /* Dataset object location */ H5O_type_t obj_type; /* Type of object at location */ hbool_t loc_found = FALSE; /* Location at 'name' found */ - H5D_t *ret_value; /* Return value */ + H5D_t *ret_value = NULL; /* Return value */ FUNC_ENTER_PACKAGE @@ -1229,7 +1262,7 @@ H5D_open(const H5G_loc_t *loc, hid_t dapl_id, hid_t dxpl_id) { H5D_shared_t *shared_fo = NULL; H5D_t *dataset = NULL; - H5D_t *ret_value; /* Return value */ + H5D_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI(NULL) @@ -2050,7 +2083,7 @@ herr_t H5D__iterate(void *buf, hid_t type_id, const H5S_t *space, H5D_operator_t op, void *operator_data) { - herr_t ret_value; + herr_t ret_value = FAIL; /* Return value */ FUNC_ENTER_PACKAGE_NOERR @@ -2087,7 +2120,7 @@ H5D_vlen_reclaim(hid_t type_id, H5S_t *space, hid_t plist_id, void *buf) { H5T_vlen_alloc_info_t _vl_alloc_info; /* VL allocation info buffer */ H5T_vlen_alloc_info_t *vl_alloc_info = &_vl_alloc_info; /* VL allocation info */ - herr_t ret_value; + herr_t ret_value = FAIL; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -2128,7 +2161,7 @@ void * H5D__vlen_get_buf_size_alloc(size_t size, void *info) { H5D_vlen_bufsize_t *vlen_bufsize = (H5D_vlen_bufsize_t *)info; - void *ret_value; /* Return value */ + void *ret_value = NULL; /* Return value */ FUNC_ENTER_PACKAGE_NOERR @@ -2647,7 +2680,7 @@ H5D_get_create_plist(H5D_t *dset) H5P_genplist_t *new_plist; /* Copy of dataset's DCPL */ H5O_fill_t copied_fill; /* Fill value to tweak */ hid_t new_dcpl_id = FAIL; - hid_t ret_value; /* Return value */ + hid_t ret_value = H5I_INVALID_HID; /* Return value */ FUNC_ENTER_NOAPI(FAIL) diff --git a/src/H5Dio.c b/src/H5Dio.c index f9e8f37..d85632a 100644 --- a/src/H5Dio.c +++ b/src/H5Dio.c @@ -17,7 +17,7 @@ /* Module Setup */ /****************/ -#define H5D_PACKAGE /*suppress error about including H5Dpkg */ +#include "H5Dmodule.h" /* This source code file is part of the H5D module */ /***********/ diff --git a/src/H5Dlayout.c b/src/H5Dlayout.c index e9dfb03..ae73ca5 100644 --- a/src/H5Dlayout.c +++ b/src/H5Dlayout.c @@ -17,7 +17,7 @@ /* Module Setup */ /****************/ -#define H5D_PACKAGE /*suppress error about including H5Dpkg */ +#include "H5Dmodule.h" /* This source code file is part of the H5D module */ /***********/ @@ -133,7 +133,7 @@ done: size_t H5D__layout_meta_size(const H5F_t *f, const H5O_layout_t *layout, hbool_t include_compact_data) { - size_t ret_value; + size_t ret_value = 0; /* Return value */ FUNC_ENTER_PACKAGE diff --git a/src/H5Dmodule.h b/src/H5Dmodule.h new file mode 100644 index 0000000..9b0c411 --- /dev/null +++ b/src/H5Dmodule.h @@ -0,0 +1,35 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* + * Programmer: Quincey Koziol + * Saturday, September 12, 2015 + * + * Purpose: This file contains declarations which define macros for the + * H5D package. Including this header means that the source file + * is part of the H5D package. + */ +#ifndef _H5Dmodule_H +#define _H5Dmodule_H + +/* Define the proper control macros for the generic FUNC_ENTER/LEAVE and error + * reporting macros. + */ +#define H5D_MODULE +#define H5_MY_PKG H5D +#define H5_MY_PKG_ERR H5E_DATASET +#define H5_MY_PKG_INIT YES + +#endif /* _H5Dmodule_H */ + diff --git a/src/H5Dmpio.c b/src/H5Dmpio.c index 289e12b..01c2e5d 100644 --- a/src/H5Dmpio.c +++ b/src/H5Dmpio.c @@ -27,7 +27,7 @@ /* Module Setup */ /****************/ -#define H5D_PACKAGE /* suppress error about including H5Dpkg */ +#include "H5Dmodule.h" /* This source code file is part of the H5D module */ /***********/ diff --git a/src/H5Doh.c b/src/H5Doh.c index abf76d0..057c904 100644 --- a/src/H5Doh.c +++ b/src/H5Doh.c @@ -17,8 +17,8 @@ /* Module Setup */ /****************/ -#define H5D_PACKAGE /*suppress error about including H5Dpkg */ -#define H5O_PACKAGE /*suppress error about including H5Opkg */ +#include "H5Dmodule.h" /* This source code file is part of the H5D module */ +#define H5O_FRIEND /*suppress error about including H5Opkg */ /***********/ @@ -108,7 +108,7 @@ H5FL_DEFINE(H5D_copy_file_ud_t); static void * H5O__dset_get_copy_file_udata(void) { - void *ret_value; /* Return value */ + void *ret_value = NULL; /* Return value */ FUNC_ENTER_STATIC @@ -223,10 +223,10 @@ done: static hid_t H5O__dset_open(const H5G_loc_t *obj_loc, hid_t lapl_id, hid_t dxpl_id, hbool_t app_ref) { - H5D_t *dset = NULL; /* Dataset opened */ - htri_t isdapl; /* lapl_id is a dapl */ - hid_t dapl_id; /* dapl to use to open this dataset */ - hid_t ret_value; /* Return value */ + H5D_t *dset = NULL; /* Dataset opened */ + htri_t isdapl; /* lapl_id is a dapl */ + hid_t dapl_id; /* dapl to use to open this dataset */ + hid_t ret_value = H5I_INVALID_HID; /* Return value */ FUNC_ENTER_STATIC @@ -279,7 +279,7 @@ H5O__dset_create(H5F_t *f, void *_crt_info, H5G_loc_t *obj_loc, hid_t dxpl_id) { H5D_obj_create_t *crt_info = (H5D_obj_create_t *)_crt_info; /* Dataset creation parameters */ H5D_t *dset = NULL; /* New dataset created */ - void *ret_value; /* Return value */ + void *ret_value = NULL; /* Return value */ FUNC_ENTER_STATIC @@ -327,7 +327,7 @@ static H5O_loc_t * H5O__dset_get_oloc(hid_t obj_id) { H5D_t *dset; /* Dataset opened */ - H5O_loc_t *ret_value; /* Return value */ + H5O_loc_t *ret_value = NULL; /* Return value */ FUNC_ENTER_STATIC diff --git a/src/H5Dpkg.h b/src/H5Dpkg.h index 11f8918..a9b1111 100644 --- a/src/H5Dpkg.h +++ b/src/H5Dpkg.h @@ -21,7 +21,7 @@ * the H5D package. Source files outside the H5D package should * include H5Dprivate.h instead. */ -#ifndef H5D_PACKAGE +#if !(defined H5D_FRIEND || defined H5D_MODULE) #error "Do not include this file outside the H5D package!" #endif @@ -529,8 +529,6 @@ H5_DLLVAR const H5D_chunk_ops_t H5D_COPS_BTREE[1]; /* Package Private Prototypes */ /******************************/ -H5_DLL herr_t H5D__term_pub_interface(void); -H5_DLL herr_t H5D__term_deprec_interface(void); H5_DLL H5D_t *H5D__create(H5F_t *file, hid_t type_id, const H5S_t *space, hid_t dcpl_id, hid_t dapl_id, hid_t dxpl_id); H5_DLL H5D_t *H5D__create_named(const H5G_loc_t *loc, const char *name, diff --git a/src/H5Dscatgath.c b/src/H5Dscatgath.c index 4b0846f..9902b7b 100644 --- a/src/H5Dscatgath.c +++ b/src/H5Dscatgath.c @@ -17,7 +17,7 @@ /* Module Setup */ /****************/ -#define H5D_PACKAGE /*suppress error about including H5Dpkg */ +#include "H5Dmodule.h" /* This source code file is part of the H5D module */ /***********/ diff --git a/src/H5Dselect.c b/src/H5Dselect.c index 38f8bc4..ce6073c 100644 --- a/src/H5Dselect.c +++ b/src/H5Dselect.c @@ -23,7 +23,7 @@ /* Module Setup */ /****************/ -#define H5D_PACKAGE /*suppress error about including H5Dpkg */ +#include "H5Dmodule.h" /* This source code file is part of the H5D module */ /***********/ diff --git a/src/H5Dtest.c b/src/H5Dtest.c index eef3c91..fd8ff71 100644 --- a/src/H5Dtest.c +++ b/src/H5Dtest.c @@ -23,7 +23,7 @@ /* Module Setup */ /****************/ -#define H5D_PACKAGE /*suppress error about including H5Dpkg */ +#include "H5Dmodule.h" /* This source code file is part of the H5D module */ #define H5D_TESTING /*suppress warning about H5D testing funcs*/ diff --git a/src/H5E.c b/src/H5E.c index c3c7685..4374f1d 100644 --- a/src/H5E.c +++ b/src/H5E.c @@ -45,10 +45,7 @@ /* Module Setup */ /****************/ -#define H5E_PACKAGE /*suppress error about including H5Epkg */ - -/* Interface initialization */ -#define H5_INTERFACE_INIT_FUNC H5E_init_interface +#include "H5Emodule.h" /* This source code file is part of the H5E module */ /***********/ @@ -83,6 +80,7 @@ /* Local Prototypes */ /********************/ /* Static function declarations */ +static herr_t H5E_set_default_auto(H5E_t *stk); static H5E_cls_t *H5E_register_class(const char *cls_name, const char *lib_name, const char *version); static herr_t H5E_unregister_class(H5E_cls_t *cls); @@ -100,6 +98,9 @@ static ssize_t H5E_get_num(const H5E_t *err_stack); /* Package Variables */ /*********************/ +/* Package initialization variable */ +hbool_t H5_PKG_INIT_VAR = FALSE; + /*****************************/ /* Library Private Variables */ @@ -173,45 +174,7 @@ done: /*-------------------------------------------------------------------------- - * Function: H5E_set_default_auto - * - * Purpose: Initialize "automatic" error stack reporting info to library - * default - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Quincey Koziol - * Thursday, November 1, 2007 - * - *-------------------------------------------------------------------------- - */ -static herr_t -H5E_set_default_auto(H5E_t *stk) -{ - FUNC_ENTER_NOAPI_NOINIT_NOERR - -#ifndef H5_NO_DEPRECATED_SYMBOLS -#ifdef H5_USE_16_API_DEFAULT - stk->auto_op.vers = 1; -#else /* H5_USE_16_API */ - stk->auto_op.vers = 2; -#endif /* H5_USE_16_API_DEFAULT */ - - stk->auto_op.func1 = stk->auto_op.func1_default = (H5E_auto1_t)H5Eprint1; - stk->auto_op.func2 = stk->auto_op.func2_default = (H5E_auto2_t)H5Eprint2; - stk->auto_op.is_default = TRUE; -#else /* H5_NO_DEPRECATED_SYMBOLS */ - stk->auto_op.func2 = (H5E_auto2_t)H5Eprint2; -#endif /* H5_NO_DEPRECATED_SYMBOLS */ - - stk->auto_data = NULL; - - FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5E_set_default_auto() */ - - -/*-------------------------------------------------------------------------- - * Function: H5E_init_interface + * Function: H5E__init_package * * Purpose: Initialize interface-specific information * @@ -222,15 +185,15 @@ H5E_set_default_auto(H5E_t *stk) * *-------------------------------------------------------------------------- */ -static herr_t -H5E_init_interface(void) +herr_t +H5E__init_package(void) { H5E_cls_t *cls; /* Pointer to error class */ H5E_msg_t *msg; /* Pointer to new error message */ char lib_vers[128]; /* Buffer to constructu library version within */ - herr_t ret_value = SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* Initialize the atom group for the error class IDs */ if(H5I_register_type(H5I_ERRCLS_CLS) < 0) @@ -262,11 +225,11 @@ H5E_init_interface(void) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5E_init_interface() */ +} /* end H5E__init_package() */ /*------------------------------------------------------------------------- - * Function: H5E_term_interface + * Function: H5E_term_package * * Purpose: Terminates the H5E interface * @@ -281,13 +244,13 @@ done: *------------------------------------------------------------------------- */ int -H5E_term_interface(void) +H5E_term_package(void) { int n = 0; FUNC_ENTER_NOAPI_NOINIT_NOERR - if(H5_interface_initialize_g) { + if(H5_PKG_INIT_VAR) { int64_t ncls, nmsg, nstk; /* Check if there are any open error stacks, classes or messages */ @@ -323,22 +286,57 @@ H5E_term_interface(void) n++; /*H5I*/ } /* end if */ else { - /* Close deprecated interface */ - n += H5E__term_deprec_interface(); - /* Destroy the error class, message, and stack id groups */ - (void)H5I_dec_type_ref(H5I_ERROR_STACK); - (void)H5I_dec_type_ref(H5I_ERROR_CLASS); - (void)H5I_dec_type_ref(H5I_ERROR_MSG); - n++; /*H5I*/ + n += (H5I_dec_type_ref(H5I_ERROR_STACK) > 0); + n += (H5I_dec_type_ref(H5I_ERROR_CLASS) > 0); + n += (H5I_dec_type_ref(H5I_ERROR_MSG) > 0); /* Mark closed */ - H5_interface_initialize_g = 0; + if(0 == n) + H5_PKG_INIT_VAR = FALSE; } /* end else */ } /* end if */ FUNC_LEAVE_NOAPI(n) -} /* end H5E_term_interface() */ +} /* end H5E_term_package() */ + + +/*-------------------------------------------------------------------------- + * Function: H5E_set_default_auto + * + * Purpose: Initialize "automatic" error stack reporting info to library + * default + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Quincey Koziol + * Thursday, November 1, 2007 + * + *-------------------------------------------------------------------------- + */ +static herr_t +H5E_set_default_auto(H5E_t *stk) +{ + FUNC_ENTER_NOAPI_NOINIT_NOERR + +#ifndef H5_NO_DEPRECATED_SYMBOLS +#ifdef H5_USE_16_API_DEFAULT + stk->auto_op.vers = 1; +#else /* H5_USE_16_API */ + stk->auto_op.vers = 2; +#endif /* H5_USE_16_API_DEFAULT */ + + stk->auto_op.func1 = stk->auto_op.func1_default = (H5E_auto1_t)H5Eprint1; + stk->auto_op.func2 = stk->auto_op.func2_default = (H5E_auto2_t)H5Eprint2; + stk->auto_op.is_default = TRUE; +#else /* H5_NO_DEPRECATED_SYMBOLS */ + stk->auto_op.func2 = (H5E_auto2_t)H5Eprint2; +#endif /* H5_NO_DEPRECATED_SYMBOLS */ + + stk->auto_data = NULL; + + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5E_set_default_auto() */ #ifdef H5_HAVE_THREADSAFE @@ -360,7 +358,7 @@ H5E_term_interface(void) H5E_t * H5E_get_stack(void) { - H5E_t *estack; + H5E_t *estack = NULL; FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -371,7 +369,7 @@ H5E_get_stack(void) #ifdef H5_HAVE_WIN_THREADS estack = (H5E_t *)LocalAlloc(LPTR, sizeof(H5E_t)); /* Win32 has to use LocalAlloc to match the LocalFree in DllMain */ #else - estack = (H5E_t *)H5FL_MALLOC(H5E_t); + estack = (H5E_t *)HDmalloc(sizeof(H5E_t)); #endif /* H5_HAVE_WIN_THREADS */ HDassert(estack); @@ -475,8 +473,8 @@ done: static H5E_cls_t * H5E_register_class(const char *cls_name, const char *lib_name, const char *version) { - H5E_cls_t *cls = NULL; /* Pointer to error class */ - H5E_cls_t *ret_value; /* Return value */ + H5E_cls_t *cls = NULL; /* Pointer to error class */ + H5E_cls_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -631,7 +629,7 @@ done: static ssize_t H5E_get_class_name(const H5E_cls_t *cls, char *name, size_t size) { - ssize_t len; /* Length of error class's name */ + ssize_t len = 0; /* Length of error class's name */ FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -812,8 +810,8 @@ done: static H5E_msg_t * H5E_create_msg(H5E_cls_t *cls, H5E_type_t msg_type, const char *msg_str) { - H5E_msg_t *msg = NULL; /* Pointer to new error message */ - H5E_msg_t *ret_value; /* Return value */ + H5E_msg_t *msg = NULL; /* Pointer to new error message */ + H5E_msg_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -967,10 +965,10 @@ done: static H5E_t * H5E_get_current_stack(void) { - H5E_t *current_stack; /* Pointer to the current error stack */ - H5E_t *estack_copy=NULL; /* Pointer to new error stack to return */ - unsigned u; /* Local index variable */ - H5E_t *ret_value; /* Return value */ + H5E_t *current_stack; /* Pointer to the current error stack */ + H5E_t *estack_copy = NULL; /* Pointer to new error stack to return */ + unsigned u; /* Local index variable */ + H5E_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT diff --git a/src/H5EA.c b/src/H5EA.c index d96f9c2..be60301 100644 --- a/src/H5EA.c +++ b/src/H5EA.c @@ -33,7 +33,7 @@ /* Module Declaration */ /**********************/ -#define H5EA_MODULE +#include "H5EAmodule.h" /* This source code file is part of the H5EA module */ /***********************/ @@ -79,6 +79,9 @@ typedef herr_t (*H5EA__unprotect_func_t)(void *thing, hid_t dxpl_id, /* Package Variables */ /*********************/ +/* Package initialization variable */ +hbool_t H5_PKG_INIT_VAR = FALSE; + /* Extensible array client ID to class mapping */ /* Remember to add client ID to H5EA_cls_id_t in H5EAprivate.h when adding a new diff --git a/src/H5EAcache.c b/src/H5EAcache.c index 8a05282..e9c93d4 100644 --- a/src/H5EAcache.c +++ b/src/H5EAcache.c @@ -28,7 +28,7 @@ /* Module Declaration */ /**********************/ -#define H5EA_MODULE +#include "H5EAmodule.h" /* This source code file is part of the H5EA module */ /***********************/ diff --git a/src/H5EAdbg.c b/src/H5EAdbg.c index 9c3ce6d..ef45881 100644 --- a/src/H5EAdbg.c +++ b/src/H5EAdbg.c @@ -28,7 +28,7 @@ /* Module Declaration */ /**********************/ -#define H5EA_MODULE +#include "H5EAmodule.h" /* This source code file is part of the H5EA module */ /***********************/ diff --git a/src/H5EAdblkpage.c b/src/H5EAdblkpage.c index 5d188c2..15bad43 100644 --- a/src/H5EAdblkpage.c +++ b/src/H5EAdblkpage.c @@ -28,7 +28,7 @@ /* Module Declaration */ /**********************/ -#define H5EA_MODULE +#include "H5EAmodule.h" /* This source code file is part of the H5EA module */ /***********************/ diff --git a/src/H5EAdblock.c b/src/H5EAdblock.c index 24be87a..cd20bba 100644 --- a/src/H5EAdblock.c +++ b/src/H5EAdblock.c @@ -28,7 +28,7 @@ /* Module Declaration */ /**********************/ -#define H5EA_MODULE +#include "H5EAmodule.h" /* This source code file is part of the H5EA module */ /***********************/ diff --git a/src/H5EAhdr.c b/src/H5EAhdr.c index e30bbac..eff4b54 100644 --- a/src/H5EAhdr.c +++ b/src/H5EAhdr.c @@ -28,7 +28,7 @@ /* Module Declaration */ /**********************/ -#define H5EA_MODULE +#include "H5EAmodule.h" /* This source code file is part of the H5EA module */ /***********************/ diff --git a/src/H5EAiblock.c b/src/H5EAiblock.c index 364b443..3f49d0d 100644 --- a/src/H5EAiblock.c +++ b/src/H5EAiblock.c @@ -28,7 +28,7 @@ /* Module Declaration */ /**********************/ -#define H5EA_MODULE +#include "H5EAmodule.h" /* This source code file is part of the H5EA module */ /***********************/ diff --git a/src/H5EAint.c b/src/H5EAint.c index 12a9cda..9f910d0 100644 --- a/src/H5EAint.c +++ b/src/H5EAint.c @@ -28,7 +28,7 @@ /* Module Declaration */ /**********************/ -#define H5EA_MODULE +#include "H5EAmodule.h" /* This source code file is part of the H5EA module */ /***********************/ diff --git a/src/H5EAmodule.h b/src/H5EAmodule.h new file mode 100644 index 0000000..405b232 --- /dev/null +++ b/src/H5EAmodule.h @@ -0,0 +1,35 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* + * Programmer: Quincey Koziol + * Saturday, September 12, 2015 + * + * Purpose: This file contains declarations which define macros for the + * H5EA package. Including this header means that the source file + * is part of the H5EA package. + */ +#ifndef _H5EAmodule_H +#define _H5EAmodule_H + +/* Define the proper control macros for the generic FUNC_ENTER/LEAVE and error + * reporting macros. + */ +#define H5EA_MODULE +#define H5_MY_PKG H5EA +#define H5_MY_PKG_ERR H5E_EARRAY +#define H5_MY_PKG_INIT NO + +#endif /* _H5EAmodule_H */ + diff --git a/src/H5EApkg.h b/src/H5EApkg.h index d328c05..3af1b2c 100644 --- a/src/H5EApkg.h +++ b/src/H5EApkg.h @@ -21,7 +21,7 @@ * the H5EA package. Source files outside the H5EA package should * include H5EAprivate.h instead. */ -#if !(defined(H5EA_PACKAGE) | defined(H5EA_MODULE)) +#if !(defined(H5EA_FRIEND) | defined(H5EA_MODULE)) #error "Do not include this file outside the H5EA package!" #endif @@ -39,16 +39,6 @@ /* Package Private Macros */ /**************************/ -/* If this package header is being included in one of the H5EA modules, define - * the proper control macros for the generic FUNC_ENTER/LEAVE and error - * reporting macros. - */ -#ifdef H5EA_MODULE -#define H5_MY_PKG H5EA -#define H5_MY_PKG_ERR H5E_EARRAY -#define H5_MY_PKG_INIT NO -#endif /* H5EA_MODULE */ - /* Fill value for extensible array test class */ #ifdef H5EA_TESTING #define H5EA_TEST_FILL ((uint64_t)ULLONG_MAX) diff --git a/src/H5EAsblock.c b/src/H5EAsblock.c index 33f34c9..7753f0e 100644 --- a/src/H5EAsblock.c +++ b/src/H5EAsblock.c @@ -28,7 +28,7 @@ /* Module Declaration */ /**********************/ -#define H5EA_MODULE +#include "H5EAmodule.h" /* This source code file is part of the H5EA module */ /***********************/ diff --git a/src/H5EAstat.c b/src/H5EAstat.c index 8a26e34..0c27681 100644 --- a/src/H5EAstat.c +++ b/src/H5EAstat.c @@ -28,7 +28,7 @@ /* Module Declaration */ /**********************/ -#define H5EA_MODULE +#include "H5EAmodule.h" /* This source code file is part of the H5EA module */ /***********************/ diff --git a/src/H5EAtest.c b/src/H5EAtest.c index b3942ca..905aa7f 100644 --- a/src/H5EAtest.c +++ b/src/H5EAtest.c @@ -24,7 +24,7 @@ /* Module Declaration */ /**********************/ -#define H5EA_MODULE +#include "H5EAmodule.h" /* This source code file is part of the H5EA module */ #define H5EA_TESTING diff --git a/src/H5Edeprec.c b/src/H5Edeprec.c index 6a83745..1a13c01 100644 --- a/src/H5Edeprec.c +++ b/src/H5Edeprec.c @@ -31,10 +31,7 @@ /* Module Setup */ /****************/ -#define H5E_PACKAGE /*suppress error about including H5Epkg */ - -/* Interface initialization */ -#define H5_INTERFACE_INIT_FUNC H5E__init_deprec_interface +#include "H5Emodule.h" /* This source code file is part of the H5E module */ /***********/ @@ -82,51 +79,6 @@ /*******************/ - -/*-------------------------------------------------------------------------- -NAME - H5E__init_deprec_interface -- Initialize interface-specific information -USAGE - herr_t H5E__init_deprec_interface() -RETURNS - Non-negative on success/Negative on failure -DESCRIPTION - Initializes any interface-specific data or routines. (Just calls - H5E_init() currently). - ---------------------------------------------------------------------------*/ -static herr_t -H5E__init_deprec_interface(void) -{ - FUNC_ENTER_STATIC_NOERR - - FUNC_LEAVE_NOAPI(H5E_init()) -} /* H5E__init_deprec_interface() */ - - -/*-------------------------------------------------------------------------- -NAME - H5E__term_deprec_interface -- Terminate interface -USAGE - herr_t H5E__term_deprec_interface() -RETURNS - Non-negative on success/Negative on failure -DESCRIPTION - Terminates interface. (Just resets H5_interface_initialize_g - currently). - ---------------------------------------------------------------------------*/ -herr_t -H5E__term_deprec_interface(void) -{ - FUNC_ENTER_PACKAGE_NOERR - - /* Mark closed */ - H5_interface_initialize_g = 0; - - FUNC_LEAVE_NOAPI(0) -} /* H5E__term_deprec_interface() */ - #ifndef H5_NO_DEPRECATED_SYMBOLS /*------------------------------------------------------------------------- diff --git a/src/H5Eint.c b/src/H5Eint.c index 07d1e46..6e84a09 100644 --- a/src/H5Eint.c +++ b/src/H5Eint.c @@ -28,10 +28,7 @@ /* Module Setup */ /****************/ -#define H5E_PACKAGE /*suppress error about including H5Epkg */ - -/* Interface initialization */ -#define H5_INTERFACE_INIT_FUNC H5E_init_int_interface +#include "H5Emodule.h" /* This source code file is part of the H5E module */ /***********/ @@ -117,27 +114,6 @@ int H5E_mpi_error_str_len; -/*-------------------------------------------------------------------------- -NAME - H5E_init_int_interface -- Initialize interface-specific information -USAGE - herr_t H5E_init_int_interface() -RETURNS - Non-negative on success/Negative on failure -DESCRIPTION - Initializes any interface-specific data or routines. (Just calls - H5E_init() currently). - ---------------------------------------------------------------------------*/ -static herr_t -H5E_init_int_interface(void) -{ - FUNC_ENTER_NOAPI_NOINIT_NOERR - - FUNC_LEAVE_NOAPI(H5E_init()) -} /* H5E_init_int_interface() */ - - /*------------------------------------------------------------------------- * Function: H5E_get_msg * @@ -154,7 +130,7 @@ H5E_init_int_interface(void) ssize_t H5E_get_msg(const H5E_msg_t *msg, H5E_type_t *type, char *msg_str, size_t size) { - ssize_t len; /* Length of error message */ + ssize_t len = -1; /* Length of error message */ FUNC_ENTER_NOAPI_NOINIT_NOERR diff --git a/src/H5Emodule.h b/src/H5Emodule.h new file mode 100644 index 0000000..d624409 --- /dev/null +++ b/src/H5Emodule.h @@ -0,0 +1,36 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* + * Programmer: Quincey Koziol + * Saturday, September 12, 2015 + * + * Purpose: This file contains declarations which define macros for the + * H5E package. Including this header means that the source file + * is part of the H5E package. + */ +#ifndef _H5Emodule_H +#define _H5Emodule_H + +/* Define the proper control macros for the generic FUNC_ENTER/LEAVE and error + * reporting macros. + */ +#define H5E_MODULE +#define H5_MY_PKG H5E +#define H5_MY_PKG_ERR H5E_ERROR +#define H5_MY_PKG_INIT YES + +#endif /* _H5Emodule_H */ + + diff --git a/src/H5Epkg.h b/src/H5Epkg.h index bfaaf9d..3af653a 100644 --- a/src/H5Epkg.h +++ b/src/H5Epkg.h @@ -21,7 +21,7 @@ * the H5E package. Source files outside the H5E package should * include H5Eprivate.h instead. */ -#ifndef H5E_PACKAGE +#if !(defined H5E_FRIEND || defined H5E_MODULE) #error "Do not include this file outside the H5E package!" #endif diff --git a/src/H5F.c b/src/H5F.c index d3b9fc8..041bd35 100644 --- a/src/H5F.c +++ b/src/H5F.c @@ -17,10 +17,7 @@ /* Module Setup */ /****************/ -#define H5F_PACKAGE /*suppress error about including H5Fpkg */ - -/* Interface initialization */ -#define H5_INTERFACE_INIT_FUNC H5F__init_pub_interface +#include "H5Fmodule.h" /* This source code file is part of the H5F module */ /***********/ @@ -66,6 +63,9 @@ /* Package Variables */ /*********************/ +/* Package initialization variable */ +hbool_t H5_PKG_INIT_VAR = FALSE; + /*****************************/ /* Library Private Variables */ @@ -88,21 +88,21 @@ static const H5I_class_t H5I_FILE_CLS[1] = {{ /*-------------------------------------------------------------------------- NAME - H5F__init_pub_interface -- Initialize interface-specific information + H5F__init_package -- Initialize interface-specific information USAGE - herr_t H5F__init_pub_interface() + herr_t H5F__init_package() RETURNS Non-negative on success/Negative on failure DESCRIPTION - Initializes any interface-specific data or routines. (Just calls - H5F_init() currently). + Initializes any interface-specific data or routines. --------------------------------------------------------------------------*/ -static herr_t -H5F__init_pub_interface(void) +herr_t +H5F__init_package(void) { - herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_STATIC + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_PACKAGE /* * Initialize the atom group for the file IDs. @@ -110,40 +110,13 @@ H5F__init_pub_interface(void) if(H5I_register_type(H5I_FILE_CLS) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "unable to initialize interface") - ret_value = H5F_init(); -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* H5F__init_pub_interface() */ - - -/*------------------------------------------------------------------------- - * Function: H5F_init - * - * Purpose: Initialize the interface from some other layer. - * - * Return: Success: non-negative - * Failure: negative - * - * Programmer: Robb Matzke - * Wednesday, December 16, 1998 - * - *------------------------------------------------------------------------- - */ -herr_t -H5F_init(void) -{ - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(FAIL) - /* FUNC_ENTER() does all the work */ - done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5F_init() */ +} /* H5F__init_package() */ /*------------------------------------------------------------------------- - * Function: H5F_term_interface + * Function: H5F_term_package * * Purpose: Terminate this interface: free all memory and reset global * variables to their initial values. Release all ID groups @@ -161,13 +134,13 @@ done: *------------------------------------------------------------------------- */ int -H5F_term_interface(void) +H5F_term_package(void) { int n = 0; FUNC_ENTER_NOAPI_NOINIT_NOERR - if(H5_interface_initialize_g) { + if(H5_PKG_INIT_VAR) { if(H5I_nmembers(H5I_FILE) > 0) { (void)H5I_clear_type(H5I_FILE, FALSE, FALSE); n++; /*H5I*/ @@ -176,20 +149,17 @@ H5F_term_interface(void) /* Make certain we've cleaned up all the shared file objects */ H5F_sfile_assert_num(0); - /* Close deprecated interface */ - n += H5F__term_deprec_interface(); - /* Destroy the file object id group */ - (void)H5I_dec_type_ref(H5I_FILE); - n++; /*H5I*/ + n += (H5I_dec_type_ref(H5I_FILE) > 0); /* Mark closed */ - H5_interface_initialize_g = 0; + if(0 == n) + H5_PKG_INIT_VAR = FALSE; } /* end else */ } /* end if */ FUNC_LEAVE_NOAPI(n) -} /* end H5F_term_interface() */ +} /* end H5F_term_package() */ /*------------------------------------------------------------------------- diff --git a/src/H5FA.c b/src/H5FA.c index bfb2a00..b0d13ec 100644 --- a/src/H5FA.c +++ b/src/H5FA.c @@ -29,7 +29,7 @@ /* Module Declaration */ /**********************/ -#define H5FA_MODULE +#include "H5FAmodule.h" /* This source code file is part of the H5FA module */ /***********************/ /* Other Packages Used */ @@ -70,6 +70,9 @@ /* Package Variables */ /*********************/ +/* Package initialization variable */ +hbool_t H5_PKG_INIT_VAR = FALSE; + /* Fixed array client ID to class mapping */ /* Remember to add client ID to H5FA_cls_id_t in H5FAprivate.h when adding a new diff --git a/src/H5FAcache.c b/src/H5FAcache.c index b95da40..f3396be 100644 --- a/src/H5FAcache.c +++ b/src/H5FAcache.c @@ -28,7 +28,7 @@ /* Module Declaration */ /**********************/ -#define H5FA_MODULE +#include "H5FAmodule.h" /* This source code file is part of the H5FA module */ /***********************/ diff --git a/src/H5FAdbg.c b/src/H5FAdbg.c index 6a84fc9..2f8fda2 100644 --- a/src/H5FAdbg.c +++ b/src/H5FAdbg.c @@ -26,7 +26,7 @@ /* Module Declaration */ /**********************/ -#define H5FA_MODULE +#include "H5FAmodule.h" /* This source code file is part of the H5FA module */ /***********************/ diff --git a/src/H5FAdblkpage.c b/src/H5FAdblkpage.c index e1ea3ac..00eb398 100644 --- a/src/H5FAdblkpage.c +++ b/src/H5FAdblkpage.c @@ -26,7 +26,7 @@ /* Module Declaration */ /**********************/ -#define H5FA_MODULE +#include "H5FAmodule.h" /* This source code file is part of the H5FA module */ /***********************/ diff --git a/src/H5FAdblock.c b/src/H5FAdblock.c index 42dafeb..71b618c 100644 --- a/src/H5FAdblock.c +++ b/src/H5FAdblock.c @@ -26,7 +26,7 @@ /* Module Declaration */ /**********************/ -#define H5FA_MODULE +#include "H5FAmodule.h" /* This source code file is part of the H5FA module */ /***********************/ diff --git a/src/H5FAhdr.c b/src/H5FAhdr.c index 9083a52..49d22f3 100644 --- a/src/H5FAhdr.c +++ b/src/H5FAhdr.c @@ -26,7 +26,7 @@ /* Module Declaration */ /**********************/ -#define H5FA_MODULE +#include "H5FAmodule.h" /* This source code file is part of the H5FA module */ /***********************/ diff --git a/src/H5FAmodule.h b/src/H5FAmodule.h new file mode 100644 index 0000000..e46b071 --- /dev/null +++ b/src/H5FAmodule.h @@ -0,0 +1,35 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* + * Programmer: Quincey Koziol + * Saturday, September 12, 2015 + * + * Purpose: This file contains declarations which define macros for the + * H5FA package. Including this header means that the source file + * is part of the H5FA package. + */ +#ifndef _H5FAmodule_H +#define _H5FAmodule_H + +/* Define the proper control macros for the generic FUNC_ENTER/LEAVE and error + * reporting macros. + */ +#define H5FA_MODULE +#define H5_MY_PKG H5FA +#define H5_MY_PKG_ERR H5E_FARRAY +#define H5_MY_PKG_INIT NO + +#endif /* _H5FAmodule_H */ + diff --git a/src/H5FApkg.h b/src/H5FApkg.h index bed9c83..ddf3a07 100644 --- a/src/H5FApkg.h +++ b/src/H5FApkg.h @@ -20,7 +20,7 @@ * the H5FA package. Source files outside the H5FA package should * include H5FAprivate.h instead. */ -#if !(defined(H5FA_PACKAGE) | defined(H5FA_MODULE)) +#if !(defined(H5FA_FRIEND) | defined(H5FA_MODULE)) #error "Do not include this file outside the H5FA package!" #endif @@ -43,16 +43,6 @@ /* #define H5FA_DEBUG */ -/* If this package header is being included in one of the H5FA modules, define - * the proper control macros for the generic FUNC_ENTER/LEAVE and error - * reporting macros. - */ -#ifdef H5FA_MODULE -#define H5_MY_PKG H5FA -#define H5_MY_PKG_ERR H5E_FARRAY -#define H5_MY_PKG_INIT NO -#endif /* H5FA_MODULE */ - /* Fill value for fixed array test class */ #ifdef H5FA_TESTING #define H5FA_TEST_FILL ((uint64_t)ULLONG_MAX) diff --git a/src/H5FAstat.c b/src/H5FAstat.c index bed6c6e..4ded4c1 100644 --- a/src/H5FAstat.c +++ b/src/H5FAstat.c @@ -26,7 +26,7 @@ /* Module Declaration */ /**********************/ -#define H5FA_MODULE +#include "H5FAmodule.h" /* This source code file is part of the H5FA module */ /***********************/ diff --git a/src/H5FAtest.c b/src/H5FAtest.c index acb2d06..528f550 100644 --- a/src/H5FAtest.c +++ b/src/H5FAtest.c @@ -24,7 +24,7 @@ /* Module Declaration */ /**********************/ -#define H5FA_MODULE +#include "H5FAmodule.h" /* This source code file is part of the H5FA module */ #define H5FA_TESTING diff --git a/src/H5FD.c b/src/H5FD.c index c4ee11f..bb2d729 100644 --- a/src/H5FD.c +++ b/src/H5FD.c @@ -28,11 +28,8 @@ /* Module Setup */ /****************/ -#define H5F_PACKAGE /*suppress error about including H5Fpkg */ -#define H5FD_PACKAGE /*suppress error about including H5FDpkg */ - -/* Interface initialization */ -#define H5_INTERFACE_INIT_FUNC H5FD_init_interface +#define H5F_FRIEND /*suppress error about including H5Fpkg */ +#include "H5FDmodule.h" /* This source code file is part of the H5FD module */ /***********/ @@ -78,6 +75,9 @@ static int H5FD_driver_query(const H5FD_class_t *driver, unsigned long *flags/*o /* Package Variables */ /*********************/ +/* Package initialization variable */ +hbool_t H5_PKG_INIT_VAR = FALSE; + /*****************************/ /* Library Private Variables */ @@ -113,53 +113,24 @@ static const H5I_class_t H5I_VFL_CLS[1] = {{ /*------------------------------------------------------------------------- - * Function: H5FD_init - * - * Purpose: Initialize the interface from some other package. - * - * Return: Success: non-negative - * Failure: negative - * - * Programmer: Quincey Koziol - * Thursday, January 3, 2007 - * - *------------------------------------------------------------------------- - */ -herr_t -H5FD_init(void) -{ - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(FAIL) - /* FUNC_ENTER() does all the work */ - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_init() */ - - -/*------------------------------------------------------------------------- - * Function: H5FD_init_interface + * Function: H5FD__init_package * * Purpose: Initialize the virtual file layer. * * Return: Success: Non-negative - * * Failure: Negative * * Programmer: Robb Matzke * Monday, July 26, 1999 * - * Modifications: - * *------------------------------------------------------------------------- */ -static herr_t -H5FD_init_interface(void) +herr_t +H5FD__init_package(void) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE if(H5I_register_type(H5I_VFL_CLS) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "unable to initialize interface") @@ -169,11 +140,11 @@ H5FD_init_interface(void) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_init_interface() */ +} /* end H5FD__init_package() */ /*------------------------------------------------------------------------- - * Function: H5FD_term_interface + * Function: H5FD_term_package * * Purpose: Terminate this interface: free all memory and reset global * variables to their initial values. Release all ID groups @@ -182,40 +153,37 @@ done: * Return: Success: Positive if anything was done that might * have affected other interfaces; zero * otherwise. - * * Failure: Never fails. * * Programmer: Robb Matzke * Friday, February 19, 1999 * - * Modifications: - * *------------------------------------------------------------------------- */ int -H5FD_term_interface(void) +H5FD_term_package(void) { int n = 0; FUNC_ENTER_NOAPI_NOINIT_NOERR - if(H5_interface_initialize_g) { + if(H5_PKG_INIT_VAR) { if(H5I_nmembers(H5I_VFL) > 0) { (void)H5I_clear_type(H5I_VFL, FALSE, FALSE); n++; /*H5I*/ } /* end if */ else { /* Destroy the VFL driver id group */ - (void)H5I_dec_type_ref(H5I_VFL); - n++; /*H5I*/ + n += (H5I_dec_type_ref(H5I_VFL) > 0); /* Mark closed */ - H5_interface_initialize_g = 0; + if(0 == n) + H5_PKG_INIT_VAR = FALSE; } /* end else */ } /* end if */ FUNC_LEAVE_NOAPI(n) -} /* end H5FD_term_interface() */ +} /* end H5FD_term_package() */ /*------------------------------------------------------------------------- @@ -223,7 +191,7 @@ H5FD_term_interface(void) * * Purpose: Frees a file driver class struct and returns an indication of * success. This function is used as the free callback for the - * virtual file layer object identifiers (cf H5FD_init_interface). + * virtual file layer object identifiers (cf H5FD__init_package). * * Return: Success: Non-negative * @@ -350,7 +318,7 @@ H5FD_register(const void *_cls, size_t size, hbool_t app_ref) const H5FD_class_t *cls = (const H5FD_class_t *)_cls; H5FD_class_t *saved = NULL; H5FD_mem_t type; - hid_t ret_value; + hid_t ret_value = H5I_INVALID_HID; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -974,7 +942,7 @@ H5FD_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr) H5P_genplist_t *plist; /* Property list pointer */ unsigned long driver_flags = 0; /* File-inspecific driver feature flags */ H5FD_file_image_info_t file_image_info; /* Initial file image */ - H5FD_t *ret_value; /* Return value */ + H5FD_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI(NULL) @@ -1189,7 +1157,7 @@ done: int H5FD_cmp(const H5FD_t *f1, const H5FD_t *f2) { - int ret_value; + int ret_value = -1; /* Return value */ FUNC_ENTER_NOAPI(-1) /*return value is arbitrary*/ @@ -1602,7 +1570,7 @@ done: haddr_t H5FD_get_maxaddr(const H5FD_t *file) { - haddr_t ret_value; /* Return value */ + haddr_t ret_value = HADDR_UNDEF; /* Return value */ FUNC_ENTER_NOAPI(HADDR_UNDEF) diff --git a/src/H5FDcore.c b/src/H5FDcore.c index e553f6b..ac5d7ed 100644 --- a/src/H5FDcore.c +++ b/src/H5FDcore.c @@ -22,8 +22,7 @@ * access to small, temporary hdf5 files. */ -/* Interface initialization */ -#define H5_INTERFACE_INIT_FUNC H5FD_core_init_interface +#include "H5FDdrvr_module.h" /* This source code file is part of the H5FD driver module */ #include "H5private.h" /* Generic Functions */ #include "H5Eprivate.h" /* Error handling */ @@ -122,57 +121,57 @@ typedef struct H5FD_core_fapl_t { (size_t)((A)+(Z))<(size_t)(A)) /* Prototypes */ -static herr_t H5FD_core_add_dirty_region(H5FD_core_t *file, haddr_t start, haddr_t end); -static herr_t H5FD_core_destroy_dirty_list(H5FD_core_t *file); -static herr_t H5FD_core_write_to_bstore(H5FD_core_t *file, haddr_t addr, size_t size); -static herr_t H5FD_core_term(void); -static void *H5FD_core_fapl_get(H5FD_t *_file); -static H5FD_t *H5FD_core_open(const char *name, unsigned flags, hid_t fapl_id, +static herr_t H5FD__core_add_dirty_region(H5FD_core_t *file, haddr_t start, haddr_t end); +static herr_t H5FD__core_destroy_dirty_list(H5FD_core_t *file); +static herr_t H5FD__core_write_to_bstore(H5FD_core_t *file, haddr_t addr, size_t size); +static herr_t H5FD__core_term(void); +static void *H5FD__core_fapl_get(H5FD_t *_file); +static H5FD_t *H5FD__core_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr); -static herr_t H5FD_core_close(H5FD_t *_file); -static int H5FD_core_cmp(const H5FD_t *_f1, const H5FD_t *_f2); -static herr_t H5FD_core_query(const H5FD_t *_f1, unsigned long *flags); -static haddr_t H5FD_core_get_eoa(const H5FD_t *_file, H5FD_mem_t type); -static herr_t H5FD_core_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr); -static haddr_t H5FD_core_get_eof(const H5FD_t *_file, H5FD_mem_t type); -static herr_t H5FD_core_get_handle(H5FD_t *_file, hid_t fapl, void** file_handle); -static herr_t H5FD_core_read(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr, +static herr_t H5FD__core_close(H5FD_t *_file); +static int H5FD__core_cmp(const H5FD_t *_f1, const H5FD_t *_f2); +static herr_t H5FD__core_query(const H5FD_t *_f1, unsigned long *flags); +static haddr_t H5FD__core_get_eoa(const H5FD_t *_file, H5FD_mem_t type); +static herr_t H5FD__core_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr); +static haddr_t H5FD__core_get_eof(const H5FD_t *_file, H5FD_mem_t type); +static herr_t H5FD__core_get_handle(H5FD_t *_file, hid_t fapl, void** file_handle); +static herr_t H5FD__core_read(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr, size_t size, void *buf); -static herr_t H5FD_core_write(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr, +static herr_t H5FD__core_write(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr, size_t size, const void *buf); -static herr_t H5FD_core_flush(H5FD_t *_file, hid_t dxpl_id, unsigned closing); -static herr_t H5FD_core_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing); +static herr_t H5FD__core_flush(H5FD_t *_file, hid_t dxpl_id, unsigned closing); +static herr_t H5FD__core_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing); static const H5FD_class_t H5FD_core_g = { "core", /* name */ MAXADDR, /* maxaddr */ H5F_CLOSE_WEAK, /* fc_degree */ - H5FD_core_term, /* terminate */ + H5FD__core_term, /* terminate */ NULL, /* sb_size */ NULL, /* sb_encode */ NULL, /* sb_decode */ sizeof(H5FD_core_fapl_t), /* fapl_size */ - H5FD_core_fapl_get, /* fapl_get */ + H5FD__core_fapl_get, /* fapl_get */ NULL, /* fapl_copy */ NULL, /* fapl_free */ 0, /* dxpl_size */ NULL, /* dxpl_copy */ NULL, /* dxpl_free */ - H5FD_core_open, /* open */ - H5FD_core_close, /* close */ - H5FD_core_cmp, /* cmp */ - H5FD_core_query, /* query */ + H5FD__core_open, /* open */ + H5FD__core_close, /* close */ + H5FD__core_cmp, /* cmp */ + H5FD__core_query, /* query */ NULL, /* get_type_map */ NULL, /* alloc */ NULL, /* free */ - H5FD_core_get_eoa, /* get_eoa */ - H5FD_core_set_eoa, /* set_eoa */ - H5FD_core_get_eof, /* get_eof */ - H5FD_core_get_handle, /* get_handle */ - H5FD_core_read, /* read */ - H5FD_core_write, /* write */ - H5FD_core_flush, /* flush */ - H5FD_core_truncate, /* truncate */ + H5FD__core_get_eoa, /* get_eoa */ + H5FD__core_set_eoa, /* set_eoa */ + H5FD__core_get_eof, /* get_eof */ + H5FD__core_get_handle, /* get_handle */ + H5FD__core_read, /* read */ + H5FD__core_write, /* write */ + H5FD__core_flush, /* flush */ + H5FD__core_truncate, /* truncate */ NULL, /* lock */ NULL, /* unlock */ H5FD_FLMAP_DICHOTOMY /* fl_map */ @@ -183,7 +182,7 @@ H5FL_DEFINE(H5FD_core_region_t); /*------------------------------------------------------------------------- - * Function: H5FD_core_add_dirty_region + * Function: H5FD__core_add_dirty_region * * Purpose: Add a new dirty region to the list for later flushing * to the backing store. @@ -193,7 +192,7 @@ H5FL_DEFINE(H5FD_core_region_t); *------------------------------------------------------------------------- */ static herr_t -H5FD_core_add_dirty_region(H5FD_core_t *file, haddr_t start, haddr_t end) +H5FD__core_add_dirty_region(H5FD_core_t *file, haddr_t start, haddr_t end) { H5FD_core_region_t *b_item = NULL; H5FD_core_region_t *a_item = NULL; @@ -206,7 +205,7 @@ H5FD_core_add_dirty_region(H5FD_core_t *file, haddr_t start, haddr_t end) hbool_t was_adjusted = FALSE; #endif - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert(file); HDassert(file->dirty_list); @@ -310,11 +309,11 @@ if(was_adjusted) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_core_add_dirty_region() */ +} /* end H5FD__core_add_dirty_region() */ /*------------------------------------------------------------------------- - * Function: H5FD_core_destroy_dirty_list + * Function: H5FD__core_destroy_dirty_list * * Purpose: Completely destroy the dirty list. * @@ -323,11 +322,11 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_core_destroy_dirty_list(H5FD_core_t *file) +H5FD__core_destroy_dirty_list(H5FD_core_t *file) { herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert(file); @@ -352,11 +351,11 @@ if(count != 0) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_core_destroy_dirty_list() */ +} /* end H5FD__core_destroy_dirty_list() */ /*------------------------------------------------------------------------- - * Function: H5FD_core_write_to_bstore + * Function: H5FD__core_write_to_bstore * * Purpose: Write data to the backing store. * @@ -364,7 +363,8 @@ done: * *------------------------------------------------------------------------- */ -static herr_t H5FD_core_write_to_bstore(H5FD_core_t *file, haddr_t addr, size_t size) +static herr_t +H5FD__core_write_to_bstore(H5FD_core_t *file, haddr_t addr, size_t size) { unsigned char *ptr = file->mem + addr; /* mutable pointer into the * buffer (can't change mem) @@ -420,12 +420,11 @@ fprintf(stderr, "bytes wrote: %lu\n", bytes_wrote); done: FUNC_LEAVE_NOAPI(ret_value) - -} /* end H5FD_core_write_to_bstore() */ +} /* end H5FD__core_write_to_bstore() */ /*------------------------------------------------------------------------- - * Function: H5FD_core_init_interface + * Function: H5FD__init_package * * Purpose: Initializes any interface-specific data or routines. * @@ -434,7 +433,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_core_init_interface(void) +H5FD__init_package(void) { herr_t ret_value = SUCCEED; @@ -445,7 +444,7 @@ H5FD_core_init_interface(void) done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5FD_core_init_interface() */ +} /* H5FD__init_package() */ /*------------------------------------------------------------------------- @@ -465,23 +464,23 @@ done: hid_t H5FD_core_init(void) { - hid_t ret_value = H5FD_CORE_g; /* Return value */ + hid_t ret_value = H5I_INVALID_HID; /* Return value */ FUNC_ENTER_NOAPI(FAIL) if(H5I_VFL != H5I_get_type(H5FD_CORE_g)) - H5FD_CORE_g = H5FD_register(&H5FD_core_g,sizeof(H5FD_class_t),FALSE); + H5FD_CORE_g = H5FD_register(&H5FD_core_g, sizeof(H5FD_class_t), FALSE); /* Set return value */ ret_value = H5FD_CORE_g; done: FUNC_LEAVE_NOAPI(ret_value) -} +} /* end H5FD_core_init() */ /*--------------------------------------------------------------------------- - * Function: H5FD_core_term + * Function: H5FD__core_term * * Purpose: Shut down the VFD * @@ -493,15 +492,15 @@ done: *--------------------------------------------------------------------------- */ static herr_t -H5FD_core_term(void) +H5FD__core_term(void) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Reset VFL ID */ H5FD_CORE_g = 0; FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5FD_core_term() */ +} /* end H5FD__core_term() */ /*------------------------------------------------------------------------- @@ -539,7 +538,7 @@ H5Pset_fapl_core(hid_t fapl_id, size_t increment, hbool_t backing_store) done: FUNC_LEAVE_API(ret_value) -} +} /* end H5Pset_fapl_core() */ /*------------------------------------------------------------------------- @@ -578,16 +577,15 @@ H5Pget_fapl_core(hid_t fapl_id, size_t *increment /*out*/, hbool_t *backing_stor done: FUNC_LEAVE_API(ret_value) -} +} /* end H5Pget_fapl_core() */ /*------------------------------------------------------------------------- - * Function: H5FD_core_fapl_get + * Function: H5FD__core_fapl_get * * Purpose: Returns a copy of the file access properties. * * Return: Success: Ptr to new file access properties. - * * Failure: NULL * * Programmer: Robb Matzke @@ -596,13 +594,13 @@ done: *------------------------------------------------------------------------- */ static void * -H5FD_core_fapl_get(H5FD_t *_file) +H5FD__core_fapl_get(H5FD_t *_file) { H5FD_core_t *file = (H5FD_core_t*)_file; H5FD_core_fapl_t *fa; - void *ret_value; /* Return value */ + void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC if(NULL == (fa = (H5FD_core_fapl_t *)H5MM_calloc(sizeof(H5FD_core_fapl_t)))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") @@ -615,18 +613,17 @@ H5FD_core_fapl_get(H5FD_t *_file) done: FUNC_LEAVE_NOAPI(ret_value) -} +} /* end H5FD__core_fapl_get() */ /*------------------------------------------------------------------------- - * Function: H5FD_core_open + * Function: H5FD___core_open * * Purpose: Create memory as an HDF5 file. * * Return: Success: A pointer to a new file data structure. The * public fields will be initialized by the * caller, which is always H5FD_open(). - * * Failure: NULL * * Programmer: Robb Matzke @@ -635,7 +632,7 @@ done: *------------------------------------------------------------------------- */ static H5FD_t * -H5FD_core_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr) +H5FD__core_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr) { int o_flags; H5FD_core_t *file = NULL; @@ -647,9 +644,9 @@ H5FD_core_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr) h5_stat_t sb; int fd = -1; H5FD_file_image_info_t file_image_info; - H5FD_t *ret_value; + H5FD_t *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check arguments */ if(!name || !*name) @@ -864,11 +861,11 @@ done: } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_core_open() */ +} /* end H5FD__core_open() */ /*------------------------------------------------------------------------- - * Function: H5FD_core_close + * Function: H5FD__core_close * * Purpose: Closes the file. * @@ -880,20 +877,20 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_core_close(H5FD_t *_file) +H5FD__core_close(H5FD_t *_file) { H5FD_core_t *file = (H5FD_core_t*)_file; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Flush any changed buffers */ - if(H5FD_core_flush(_file, (hid_t)-1, TRUE) < 0) + if(H5FD__core_flush(_file, (hid_t)-1, TRUE) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTFLUSH, FAIL, "unable to flush core vfd backing store") /* Destroy the dirty region list */ if(file->dirty_list) - if(H5FD_core_destroy_dirty_list(file) != SUCCEED) + if(H5FD__core_destroy_dirty_list(file) != SUCCEED) HGOTO_ERROR(H5E_VFL, H5E_CANTFREE, FAIL, "unable to free core vfd dirty region list") /* Release resources */ @@ -915,11 +912,11 @@ H5FD_core_close(H5FD_t *_file) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_core_close() */ +} /* end H5FD__core_close() */ /*------------------------------------------------------------------------- - * Function: H5FD_core_cmp + * Function: H5FD__core_cmp * * Purpose: Compares two files belonging to this driver by name. If one * file doesn't have a name then it is less than the other file. @@ -927,7 +924,6 @@ done: * address. * * Return: Success: A value like strcmp() - * * Failure: never fails (arguments were checked by the * caller). * @@ -937,13 +933,13 @@ done: *------------------------------------------------------------------------- */ static int -H5FD_core_cmp(const H5FD_t *_f1, const H5FD_t *_f2) +H5FD__core_cmp(const H5FD_t *_f1, const H5FD_t *_f2) { const H5FD_core_t *f1 = (const H5FD_core_t*)_f1; const H5FD_core_t *f2 = (const H5FD_core_t*)_f2; int ret_value = 0; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR if(f1->fd >= 0 && f2->fd >= 0) { /* Compare low level file information for backing store */ @@ -994,11 +990,11 @@ H5FD_core_cmp(const H5FD_t *_f1, const H5FD_t *_f2) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_core_cmp() */ +} /* end H5FD__core_cmp() */ /*------------------------------------------------------------------------- - * Function: H5FD_core_query + * Function: H5FD__core_query * * Purpose: Set the flags that this VFL driver is capable of supporting. * (listed in H5FDpublic.h) @@ -1011,11 +1007,11 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_core_query(const H5FD_t * _file, unsigned long *flags /* out */) +H5FD__core_query(const H5FD_t * _file, unsigned long *flags /* out */) { const H5FD_core_t *file = (const H5FD_core_t*)_file; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Set the VFL feature flags that this driver supports */ if(flags) { @@ -1033,11 +1029,11 @@ H5FD_core_query(const H5FD_t * _file, unsigned long *flags /* out */) } /* end if */ FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5FD_core_query() */ +} /* end H5FD__core_query() */ /*------------------------------------------------------------------------- - * Function: H5FD_core_get_eoa + * Function: H5FD__core_get_eoa * * Purpose: Gets the end-of-address marker for the file. The EOA marker * is the first address past the last byte allocated in the @@ -1051,18 +1047,18 @@ H5FD_core_query(const H5FD_t * _file, unsigned long *flags /* out */) *------------------------------------------------------------------------- */ static haddr_t -H5FD_core_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type) +H5FD__core_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type) { const H5FD_core_t *file = (const H5FD_core_t*)_file; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR FUNC_LEAVE_NOAPI(file->eoa) -} +} /* end H5FD__core_get_eoa() */ /*------------------------------------------------------------------------- - * Function: H5FD_core_set_eoa + * Function: H5FD__core_set_eoa * * Purpose: Set the end-of-address marker for the file. This function is * called shortly after an existing HDF5 file is opened in order @@ -1076,12 +1072,12 @@ H5FD_core_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type) *------------------------------------------------------------------------- */ static herr_t -H5FD_core_set_eoa(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, haddr_t addr) +H5FD__core_set_eoa(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, haddr_t addr) { H5FD_core_t *file = (H5FD_core_t*)_file; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC if(ADDR_OVERFLOW(addr)) HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, FAIL, "address overflow") @@ -1090,11 +1086,11 @@ H5FD_core_set_eoa(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, haddr_t addr) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_core_set_eoa() */ +} /* end H5FD__core_set_eoa() */ /*------------------------------------------------------------------------- - * Function: H5FD_core_get_eof + * Function: H5FD__core_get_eof * * Purpose: Returns the end-of-file marker, which is the greater of * either the size of the underlying memory or the HDF5 @@ -1110,18 +1106,18 @@ done: *------------------------------------------------------------------------- */ static haddr_t -H5FD_core_get_eof(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type) +H5FD__core_get_eof(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type) { const H5FD_core_t *file = (const H5FD_core_t*)_file; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR FUNC_LEAVE_NOAPI(file->eof) -} +} /* end H5FD__core_get_eof() */ /*------------------------------------------------------------------------- - * Function: H5FD_core_get_handle + * Function: H5FD__core_get_handle * * Purpose: Gets the file handle of CORE file driver. * @@ -1133,12 +1129,12 @@ H5FD_core_get_eof(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type) *------------------------------------------------------------------------- */ static herr_t -H5FD_core_get_handle(H5FD_t *_file, hid_t fapl, void** file_handle) +H5FD__core_get_handle(H5FD_t *_file, hid_t fapl, void** file_handle) { H5FD_core_t *file = (H5FD_core_t *)_file; /* core VFD info */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check args */ if(!file_handle) @@ -1177,11 +1173,11 @@ H5FD_core_get_handle(H5FD_t *_file, hid_t fapl, void** file_handle) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_core_get_handle() */ +} /* end H5FD__core_get_handle() */ /*------------------------------------------------------------------------- - * Function: H5FD_core_read + * Function: H5FD__core_read * * Purpose: Reads SIZE bytes of data from FILE beginning at address ADDR * into buffer BUF according to data transfer properties in @@ -1189,7 +1185,6 @@ done: * * Return: Success: SUCCEED. Result is stored in caller-supplied * buffer BUF. - * * Failure: FAIL, Contents of buffer BUF are undefined. * * Programmer: Robb Matzke @@ -1198,13 +1193,13 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_core_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNUSED dxpl_id, haddr_t addr, +H5FD__core_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNUSED dxpl_id, haddr_t addr, size_t size, void *buf/*out*/) { H5FD_core_t *file = (H5FD_core_t*)_file; - herr_t ret_value=SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert(file && file->pub.cls); HDassert(buf); @@ -1240,11 +1235,11 @@ H5FD_core_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNUS done: FUNC_LEAVE_NOAPI(ret_value) -} +} /* end H5FD__core_read() */ /*------------------------------------------------------------------------- - * Function: H5FD_core_write + * Function: H5FD__core_write * * Purpose: Writes SIZE bytes of data to FILE beginning at address ADDR * from buffer BUF according to data transfer properties in @@ -1258,13 +1253,13 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_core_write(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNUSED dxpl_id, haddr_t addr, +H5FD__core_write(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNUSED dxpl_id, haddr_t addr, size_t size, const void *buf) { H5FD_core_t *file = (H5FD_core_t*)_file; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert(file && file->pub.cls); HDassert(buf); @@ -1310,7 +1305,8 @@ H5FD_core_write(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNU if(file->dirty_list) { haddr_t start = addr; haddr_t end = addr + (haddr_t)size - 1; - if(H5FD_core_add_dirty_region(file, start, end) != SUCCEED) + + if(H5FD__core_add_dirty_region(file, start, end) != SUCCEED) HGOTO_ERROR(H5E_VFL, H5E_CANTINSERT, FAIL, "unable to add core VFD dirty region during write call - addresses: start=%llu end=%llu", start, end) } @@ -1322,11 +1318,11 @@ H5FD_core_write(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNU done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_core_write() */ +} /* end H5FD__core_write() */ /*------------------------------------------------------------------------- - * Function: H5FD_core_flush + * Function: H5FD__core_flush * * Purpose: Flushes the file to backing store if there is any and if the * dirty flag is set. @@ -1339,12 +1335,12 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_core_flush(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, unsigned H5_ATTR_UNUSED closing) +H5FD__core_flush(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, unsigned H5_ATTR_UNUSED closing) { H5FD_core_t *file = (H5FD_core_t*)_file; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Write to backing store */ if (file->dirty && file->fd >= 0 && file->backing_store) { @@ -1371,7 +1367,7 @@ H5FD_core_flush(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, unsigned H5_ATTR_UN #ifdef DER fprintf(stderr, "(%llu, %llu : %lu)\n", item->start, item->end, size); #endif - if(H5FD_core_write_to_bstore(file, item->start, size) != SUCCEED) + if(H5FD__core_write_to_bstore(file, item->start, size) != SUCCEED) HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, FAIL, "unable to write to backing store") } /* end if */ @@ -1385,24 +1381,23 @@ if(file->eoa > file->eof) fprintf(stderr, "*** EOA BADNESS ***\n"); fprintf(stderr, "\n"); #endif - } + } /* end if */ /* Otherwise, write the entire file out at once */ else { - if(H5FD_core_write_to_bstore(file, (haddr_t)0, (size_t)file->eof) != SUCCEED) + if(H5FD__core_write_to_bstore(file, (haddr_t)0, (size_t)file->eof) != SUCCEED) HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, FAIL, "unable to write to backing store") - - } /* end while */ + } /* end else */ file->dirty = FALSE; } done: FUNC_LEAVE_NOAPI(ret_value) -} +} /* end H5FD__core_flush() */ /*------------------------------------------------------------------------- - * Function: H5FD_core_truncate + * Function: H5FD__core_truncate * * Purpose: Makes sure that the true file size is the same (or larger) * than the end-of-address. @@ -1437,13 +1432,13 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_core_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t closing) +H5FD__core_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t closing) { H5FD_core_t *file = (H5FD_core_t*)_file; size_t new_eof; /* New size of memory buffer */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert(file); @@ -1523,5 +1518,5 @@ fprintf(stderr, "OLD: Truncated to: %llu\n", file->eoa); done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_core_truncate() */ +} /* end H5FD__core_truncate() */ diff --git a/src/H5FDdirect.c b/src/H5FDdirect.c index f4ee910..82241a1 100644 --- a/src/H5FDdirect.c +++ b/src/H5FDdirect.c @@ -22,12 +22,8 @@ * buffer. The main system support this feature is Linux. */ -/* Interface initialization */ -#define H5_INTERFACE_INIT_FUNC H5FD_direct_init_interface +#include "H5FDdrvr_module.h" /* This source code file is part of the H5FD driver module */ -/* For system function posix_memalign - Commented it out because copper isn't able to compile - * this file. */ -/* #define _XOPEN_SOURCE 600 */ #include "H5private.h" /* Generic Functions */ #include "H5Eprivate.h" /* Error handling */ @@ -182,10 +178,9 @@ H5FL_DEFINE_STATIC(H5FD_direct_t); /*-------------------------------------------------------------------------- NAME - H5FD_direct_init_interface -- Initialize interface-specific information + H5FD__init_package -- Initialize interface-specific information USAGE - herr_t H5FD_direct_init_interface() - + herr_t H5FD__init_package() RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -194,18 +189,18 @@ DESCRIPTION --------------------------------------------------------------------------*/ static herr_t -H5FD_direct_init_interface(void) +H5FD__init_package(void) { herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC if(H5FD_direct_init() < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "unable to initialize direct VFD") done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5FD_direct_init_interface() */ +} /* H5FD__init_package() */ /*------------------------------------------------------------------------- @@ -236,7 +231,7 @@ H5FD_direct_init(void) H5FD_DIRECT_g = H5FD_register(&H5FD_direct_g,sizeof(H5FD_class_t),FALSE); /* Set return value */ - ret_value=H5FD_DIRECT_g; + ret_value = H5FD_DIRECT_g; done: FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5FDdrvr_module.h b/src/H5FDdrvr_module.h new file mode 100644 index 0000000..8bb83a1 --- /dev/null +++ b/src/H5FDdrvr_module.h @@ -0,0 +1,35 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* + * Programmer: Quincey Koziol + * Saturday, September 12, 2015 + * + * Purpose: This file contains declarations which define macros for the + * H5FD driver package. Including this header means that the source file + * is part of the H5FD driver package. + */ +#ifndef _H5FDdrvr_module_H +#define _H5FDdrvr_module_H + +/* Define the proper control macros for the generic FUNC_ENTER/LEAVE and error + * reporting macros. + */ +#define H5_MY_PKG H5FD +#define H5_MY_PKG_ERR H5E_FILE +#define H5_MY_PKG_INIT YES +#define H5_PKG_SINGLE_SOURCE + +#endif /* _H5FDdrvr_module_H */ + diff --git a/src/H5FDfamily.c b/src/H5FDfamily.c index 9edbc72..a08e2ae 100644 --- a/src/H5FDfamily.c +++ b/src/H5FDfamily.c @@ -34,8 +34,7 @@ * */ -/* Interface initialization */ -#define H5_INTERFACE_INIT_FUNC H5FD_family_init_interface +#include "H5FDdrvr_module.h" /* This source code file is part of the H5FD driver module */ #include "H5private.h" /* Generic Functions */ @@ -147,10 +146,9 @@ static const H5FD_class_t H5FD_family_g = { /*-------------------------------------------------------------------------- NAME - H5FD_family_init_interface -- Initialize interface-specific information + H5FD__init_package -- Initialize interface-specific information USAGE - herr_t H5FD_family_init_interface() - + herr_t H5FD__init_package() RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -159,18 +157,18 @@ DESCRIPTION --------------------------------------------------------------------------*/ static herr_t -H5FD_family_init_interface(void) +H5FD__init_package(void) { herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC if(H5FD_family_init() < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "unable to initialize family VFD") done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5FD_family_init_interface() */ +} /* H5FD__init_package() */ /*------------------------------------------------------------------------- @@ -368,7 +366,7 @@ H5FD_family_fapl_get(H5FD_t *_file) H5FD_family_t *file = (H5FD_family_t*)_file; H5FD_family_fapl_t *fa = NULL; H5P_genplist_t *plist; /* Property list pointer */ - void *ret_value; /* Return value */ + void *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -414,7 +412,7 @@ H5FD_family_fapl_copy(const void *_old_fa) const H5FD_family_fapl_t *old_fa = (const H5FD_family_fapl_t*)_old_fa; H5FD_family_fapl_t *new_fa = NULL; H5P_genplist_t *plist; /* Property list pointer */ - void *ret_value; /* Return value */ + void *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -1048,7 +1046,7 @@ H5FD_family_get_eof(const H5FD_t *_file, H5FD_mem_t type) const H5FD_family_t *file = (const H5FD_family_t*)_file; haddr_t eof=0; int i; /* Local index variable */ - haddr_t ret_value; /* Return value */ + haddr_t ret_value = HADDR_UNDEF; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -1102,7 +1100,7 @@ H5FD_family_get_handle(H5FD_t *_file, hid_t fapl, void** file_handle) H5P_genplist_t *plist; hsize_t offset; int memb; - herr_t ret_value; + herr_t ret_value = FAIL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT diff --git a/src/H5FDint.c b/src/H5FDint.c index 13bc68a..e7cb2c0 100644 --- a/src/H5FDint.c +++ b/src/H5FDint.c @@ -28,10 +28,7 @@ /* Module Setup */ /****************/ -#define H5FD_PACKAGE /*suppress error about including H5FDpkg */ - -/* Interface initialization */ -#define H5_INTERFACE_INIT_FUNC H5FD_int_init_interface +#include "H5FDmodule.h" /* This source code file is part of the H5FD module */ /***********/ @@ -80,28 +77,6 @@ -/*-------------------------------------------------------------------------- -NAME - H5FD_int_init_interface -- Initialize interface-specific information -USAGE - herr_t H5FD_int_init_interface() - -RETURNS - Non-negative on success/Negative on failure -DESCRIPTION - Initializes any interface-specific data or routines. (Just calls - H5FD_init_iterface currently). - ---------------------------------------------------------------------------*/ -static herr_t -H5FD_int_init_interface(void) -{ - FUNC_ENTER_NOAPI_NOINIT_NOERR - - FUNC_LEAVE_NOAPI(H5FD_init()) -} /* H5FD_int_init_interface() */ - - /*------------------------------------------------------------------------- * Function: H5FD_locate_signature * @@ -325,7 +300,7 @@ done: haddr_t H5FD_get_eoa(const H5FD_t *file, H5FD_mem_t type) { - haddr_t ret_value; + haddr_t ret_value = HADDR_UNDEF; /* Return value */ FUNC_ENTER_NOAPI(HADDR_UNDEF) @@ -367,7 +342,7 @@ done: haddr_t H5FD_get_eof(const H5FD_t *file, H5FD_mem_t type) { - haddr_t ret_value; + haddr_t ret_value = HADDR_UNDEF; /* Return value */ FUNC_ENTER_NOAPI(HADDR_UNDEF) diff --git a/src/H5FDlog.c b/src/H5FDlog.c index e8695c5..4987c16 100644 --- a/src/H5FDlog.c +++ b/src/H5FDlog.c @@ -26,8 +26,7 @@ * With custom modifications... */ -/* Interface initialization */ -#define H5_INTERFACE_INIT_FUNC H5FD_log_init_interface +#include "H5FDdrvr_module.h" /* This source code file is part of the H5FD driver module */ #include "H5private.h" /* Generic Functions */ @@ -221,7 +220,7 @@ H5FL_DEFINE_STATIC(H5FD_log_t); /*------------------------------------------------------------------------- - * Function: H5FD_log_init_interface + * Function: H5FD__init_package * * Purpose: Initializes any interface-specific data or routines. * @@ -230,18 +229,18 @@ H5FL_DEFINE_STATIC(H5FD_log_t); *------------------------------------------------------------------------- */ static herr_t -H5FD_log_init_interface(void) +H5FD__init_package(void) { herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC if(H5FD_log_init() < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "unable to initialize log VFD") done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5FD_log_init_interface() */ +} /* H5FD__init_package() */ /*------------------------------------------------------------------------- @@ -261,7 +260,7 @@ done: hid_t H5FD_log_init(void) { - hid_t ret_value; /* Return value */ + hid_t ret_value = H5I_INVALID_HID; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -361,7 +360,7 @@ static void * H5FD_log_fapl_get(H5FD_t *_file) { H5FD_log_t *file = (H5FD_log_t *)_file; - void *ret_value; /* Return value */ + void *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -390,7 +389,7 @@ H5FD_log_fapl_copy(const void *_old_fa) { const H5FD_log_fapl_t *old_fa = (const H5FD_log_fapl_t*)_old_fa; H5FD_log_fapl_t *new_fa = NULL; /* New FAPL info */ - void *ret_value; /* Return value */ + void *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -483,7 +482,7 @@ H5FD_log_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr) struct timeval stat_timeval_diff; #endif /* H5_HAVE_GETTIMEOFDAY */ h5_stat_t sb; - H5FD_t *ret_value; /* Return value */ + H5FD_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -922,7 +921,7 @@ H5FD_log_alloc(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, hsi { H5FD_log_t *file = (H5FD_log_t *)_file; haddr_t addr; - haddr_t ret_value; /* Return value */ + haddr_t ret_value = HADDR_UNDEF; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_NOERR diff --git a/src/H5FDmodule.h b/src/H5FDmodule.h new file mode 100644 index 0000000..6358e86 --- /dev/null +++ b/src/H5FDmodule.h @@ -0,0 +1,35 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* + * Programmer: Quincey Koziol + * Saturday, September 12, 2015 + * + * Purpose: This file contains declarations which define macros for the + * H5FD package. Including this header means that the source file + * is part of the H5FD package. + */ +#ifndef _H5FDmodule_H +#define _H5FDmodule_H + +/* Define the proper control macros for the generic FUNC_ENTER/LEAVE and error + * reporting macros. + */ +#define H5FD_MODULE +#define H5_MY_PKG H5FD +#define H5_MY_PKG_ERR H5E_VFL +#define H5_MY_PKG_INIT YES + +#endif /* _H5FDmodule_H */ + diff --git a/src/H5FDmpio.c b/src/H5FDmpio.c index 5f36d2a..5c3bf05 100644 --- a/src/H5FDmpio.c +++ b/src/H5FDmpio.c @@ -21,8 +21,7 @@ * */ -/* Interface initialization */ -#define H5_INTERFACE_INIT_FUNC H5FD_mpio_init_interface +#include "H5FDdrvr_module.h" /* This source code file is part of the H5FD driver module */ #include "H5private.h" /* Generic Functions */ @@ -167,10 +166,9 @@ static int H5FD_mpio_Debug[256] = /*-------------------------------------------------------------------------- NAME - H5FD_mpio_init_interface -- Initialize interface-specific information + H5FD__init_package -- Initialize interface-specific information USAGE - herr_t H5FD_mpio_init_interface() - + herr_t H5FD__init_package() RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -179,18 +177,18 @@ DESCRIPTION --------------------------------------------------------------------------*/ static herr_t -H5FD_mpio_init_interface(void) +H5FD__init_package(void) { herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC if(H5FD_mpio_init() < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "unable to initialize mpio VFD") done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5FD_mpio_init_interface() */ +} /* H5FD__init_package() */ /*------------------------------------------------------------------------- diff --git a/src/H5FDpkg.h b/src/H5FDpkg.h index 7c0988e..ef33cf1 100644 --- a/src/H5FDpkg.h +++ b/src/H5FDpkg.h @@ -21,7 +21,7 @@ * the H5FD package. Source files outside the H5FD package should * include H5FDprivate.h instead. */ -#ifndef H5FD_PACKAGE +#if !(defined H5FD_FRIEND || defined H5FD_MODULE) #error "Do not include this file outside the H5FD package!" #endif @@ -52,7 +52,6 @@ /******************************/ /* Package Private Prototypes */ /******************************/ -H5_DLL herr_t H5FD_init(void); H5_DLL haddr_t H5FD_alloc_real(H5FD_t *file, hid_t dxpl_id, H5FD_mem_t type, hsize_t size, haddr_t *align_addr, hsize_t *align_size); H5_DLL herr_t H5FD_free_real(H5FD_t *file, hid_t dxpl_id, H5FD_mem_t type, diff --git a/src/H5FDsec2.c b/src/H5FDsec2.c index 10e2a66..34527df 100644 --- a/src/H5FDsec2.c +++ b/src/H5FDsec2.c @@ -25,8 +25,7 @@ * application to the same file). */ -/* Interface initialization */ -#define H5_INTERFACE_INIT_FUNC H5FD_sec2_init_interface +#include "H5FDdrvr_module.h" /* This source code file is part of the H5FD driver module */ #include "H5private.h" /* Generic Functions */ @@ -179,7 +178,7 @@ H5FL_DEFINE_STATIC(H5FD_sec2_t); /*------------------------------------------------------------------------- - * Function: H5FD_sec2_init_interface + * Function: H5FD__init_package * * Purpose: Initializes any interface-specific data or routines. * @@ -188,18 +187,18 @@ H5FL_DEFINE_STATIC(H5FD_sec2_t); *------------------------------------------------------------------------- */ static herr_t -H5FD_sec2_init_interface(void) +H5FD__init_package(void) { herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC if(H5FD_sec2_init() < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "unable to initialize sec2 VFD") done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5FD_sec2_init_interface() */ +} /* H5FD__init_package() */ /*------------------------------------------------------------------------- @@ -219,7 +218,7 @@ done: hid_t H5FD_sec2_init(void) { - hid_t ret_value; /* Return value */ + hid_t ret_value = H5I_INVALID_HID; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -316,7 +315,7 @@ H5FD_sec2_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr) struct _BY_HANDLE_FILE_INFORMATION fileinfo; #endif h5_stat_t sb; - H5FD_t *ret_value; /* Return value */ + H5FD_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT diff --git a/src/H5FDspace.c b/src/H5FDspace.c index deb2153..edc83e6 100644 --- a/src/H5FDspace.c +++ b/src/H5FDspace.c @@ -28,10 +28,7 @@ /* Module Setup */ /****************/ -#define H5FD_PACKAGE /*suppress error about including H5FDpkg */ - -/* Interface initialization */ -#define H5_INTERFACE_INIT_FUNC H5FD_space_init_interface +#include "H5FDmodule.h" /* This source code file is part of the H5FD module */ /***********/ @@ -86,28 +83,6 @@ H5FL_DEFINE(H5FD_free_t); -/*-------------------------------------------------------------------------- -NAME - H5FD_space_init_interface -- Initialize interface-specific information -USAGE - herr_t H5FD_space_init_interface() - -RETURNS - Non-negative on success/Negative on failure -DESCRIPTION - Initializes any interface-specific data or routines. (Just calls - H5FD_init_iterface currently). - ---------------------------------------------------------------------------*/ -static herr_t -H5FD_space_init_interface(void) -{ - FUNC_ENTER_NOAPI_NOINIT_NOERR - - FUNC_LEAVE_NOAPI(H5FD_init()) -} /* H5FD_space_init_interface() */ - - /*------------------------------------------------------------------------- * Function: H5FD_extend * @@ -129,7 +104,7 @@ H5FD_extend(H5FD_t *file, H5FD_mem_t type, hbool_t new_block, hsize_t size, hadd hsize_t orig_size = size; /* Original allocation size */ haddr_t eoa; /* Address of end-of-allocated space */ hsize_t extra; /* Extra space to allocate, to align request */ - haddr_t ret_value; /* Return value */ + haddr_t ret_value = HADDR_UNDEF; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -197,7 +172,7 @@ done: haddr_t H5FD_alloc_real(H5FD_t *file, hid_t dxpl_id, H5FD_mem_t type, hsize_t size, haddr_t *frag_addr, hsize_t *frag_size) { - haddr_t ret_value; /* Return value */ + haddr_t ret_value = HADDR_UNDEF; /* Return value */ FUNC_ENTER_NOAPI(HADDR_UNDEF) #ifdef H5FD_ALLOC_DEBUG @@ -253,7 +228,7 @@ haddr_t H5FD_alloc(H5FD_t *file, hid_t dxpl_id, H5FD_mem_t type, H5F_t *f, hsize_t size, haddr_t *frag_addr, hsize_t *frag_size) { - haddr_t ret_value; /* Return value */ + haddr_t ret_value = HADDR_UNDEF; /* Return value */ FUNC_ENTER_NOAPI(HADDR_UNDEF) diff --git a/src/H5FL.c b/src/H5FL.c index aec92ff..2b8b11b 100644 --- a/src/H5FL.c +++ b/src/H5FL.c @@ -27,8 +27,7 @@ * move frequently accessed free lists to the head of the queue. */ -/* Interface initialization */ -#define H5_INTERFACE_INIT_FUNC H5FL_init_interface +#include "H5FLmodule.h" /* This source code file is part of the H5FL module */ /* #define H5FL_DEBUG */ @@ -117,6 +116,9 @@ struct H5FL_fac_node_t { struct H5FL_fac_node_t *next; /* Pointer to next block in free list */ }; +/* Package initialization variable */ +hbool_t H5_PKG_INIT_VAR = FALSE; + /* The head of the list of factory things to garbage collect */ static H5FL_fac_gc_list_t H5FL_fac_gc_head={0,NULL}; @@ -130,14 +132,18 @@ static H5FL_track_t *H5FL_out_head_g = NULL; #endif /* H5FL_TRACK */ /* Forward declarations of local static functions */ -static herr_t H5FL_reg_gc(void); -static herr_t H5FL_reg_gc_list(H5FL_reg_head_t *head); -static herr_t H5FL_arr_gc(void); -static herr_t H5FL_arr_gc_list(H5FL_arr_head_t *head); -static herr_t H5FL_blk_gc(void); -static herr_t H5FL_blk_gc_list(H5FL_blk_head_t *head); -static herr_t H5FL_fac_gc(void); -static herr_t H5FL_fac_gc_list(H5FL_fac_head_t *head); +static herr_t H5FL__reg_gc(void); +static herr_t H5FL__reg_gc_list(H5FL_reg_head_t *head); +static int H5FL__reg_term(void); +static herr_t H5FL__arr_gc(void); +static herr_t H5FL__arr_gc_list(H5FL_arr_head_t *head); +static int H5FL__arr_term(void); +static herr_t H5FL__blk_gc(void); +static herr_t H5FL__blk_gc_list(H5FL_blk_head_t *head); +static int H5FL__blk_term(void); +static herr_t H5FL__fac_gc(void); +static herr_t H5FL__fac_gc_list(H5FL_fac_head_t *head); +static int H5FL__fac_term_all(void); /* Declare a free list to manage the H5FL_blk_node_t struct */ H5FL_DEFINE(H5FL_blk_node_t); @@ -150,26 +156,66 @@ H5FL_DEFINE(H5FL_fac_head_t); /*-------------------------------------------------------------------------- -NAME - H5FL_init_interface -- Initialize interface-specific information -USAGE - herr_t H5FL_init_interface() - -RETURNS - Non-negative on success/Negative on failure -DESCRIPTION - Initializes any interface-specific data or routines. - + NAME + H5FL_term_package + PURPOSE + Terminate various H5FL objects + USAGE + void H5FL_term_package() + RETURNS + Success: Positive if any action might have caused a change in some + other interface; zero otherwise. + Failure: Negative + DESCRIPTION + Release any resources allocated. + GLOBAL VARIABLES + COMMENTS, BUGS, ASSUMPTIONS + Can't report errors... + EXAMPLES + REVISION LOG --------------------------------------------------------------------------*/ -static herr_t -H5FL_init_interface(void) +int +H5FL_term_package(void) { + int n = 0; + FUNC_ENTER_NOAPI_NOINIT_NOERR - /* Nothing currently... */ + if(H5_PKG_INIT_VAR) { + /* Garbage collect any nodes on the free lists */ + (void)H5FL_garbage_coll(); - FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5FL_init_interface() */ + /* Shut down the various kinds of free lists */ + n += H5FL__reg_term(); + n += H5FL__fac_term_all(); + n += H5FL__arr_term(); + n += H5FL__blk_term(); + + /* Mark interface closed */ + if(0 == n) + H5_PKG_INIT_VAR = FALSE; + } /* end if */ + +#ifdef H5FL_TRACK + /* If we haven't freed all the allocated memory, dump out the list now */ + if(n > 0 && H5FL_out_head_g) { + H5FL_track_t *trk = H5FL_out_head_g; + + /* Dump information about all the outstanding allocations */ + while(trk != NULL) { + /* Print information about the outstanding block */ + HDfprintf(stderr,"%s: Outstanding allocation:\n", "H5FL_term_package"); + HDfprintf(stderr,"\tFile: %s, Function: %s, Line: %d\n", trk->file, trk->func, trk->line); + H5CS_print_stack(trk->stack, stderr); + + /* Advance to next node */ + trk = trk->next; + } /* end while */ + } /* end if */ +#endif /* H5FL_TRACK */ + + FUNC_LEAVE_NOAPI(n) +} /* end H5FL_term_package() */ /*------------------------------------------------------------------------- @@ -191,7 +237,7 @@ H5FL_init_interface(void) static void * H5FL_malloc(size_t mem_size) { - void *ret_value; /* return value*/ + void *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -297,7 +343,6 @@ H5FL_reg_free(H5FL_reg_head_t *head, void *obj) /* Free tracking information about the allocation location */ H5CS_close_stack(trk->stack); - trk->stack = H5MM_xfree(trk->stack); trk->file = H5MM_xfree(trk->file); trk->func = H5MM_xfree(trk->func); @@ -337,12 +382,12 @@ H5FL_reg_free(H5FL_reg_head_t *head, void *obj) /* Check for exceeding free list memory use limits */ /* First check this particular list */ if(head->onlist * head->size > H5FL_reg_lst_mem_lim) - if(H5FL_reg_gc_list(head)<0) + if(H5FL__reg_gc_list(head) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGC, NULL, "garbage collection failed during free") /* Then check the global amount memory on regular free lists */ if(H5FL_reg_gc_head.mem_freed>H5FL_reg_glb_mem_lim) - if(H5FL_reg_gc()<0) + if(H5FL__reg_gc() < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGC, NULL, "garbage collection failed during free") done: @@ -368,7 +413,7 @@ done: void * H5FL_reg_malloc(H5FL_reg_head_t *head H5FL_TRACK_PARAMS) { - void *ret_value; /* Pointer to object to return */ + void *ret_value = NULL; /* Pointer to object to return */ FUNC_ENTER_NOAPI(NULL) @@ -405,8 +450,8 @@ H5FL_reg_malloc(H5FL_reg_head_t *head H5FL_TRACK_PARAMS) #ifdef H5FL_TRACK /* Copy allocation location information */ - ((H5FL_track_t *)ret_value)->stack = H5MM_calloc(sizeof(H5CS_t)); - H5CS_copy_stack(((H5FL_track_t *)ret_value)->stack); + ((H5FL_track_t *)ret_value)->stack = H5CS_copy_stack(); + HDassert(((H5FL_track_t *)ret_value)->stack); ((H5FL_track_t *)ret_value)->file = H5MM_strdup(call_file); ((H5FL_track_t *)ret_value)->func = H5MM_strdup(call_func); ((H5FL_track_t *)ret_value)->line = call_line; @@ -445,7 +490,7 @@ done: void * H5FL_reg_calloc(H5FL_reg_head_t *head H5FL_TRACK_PARAMS) { - void *ret_value; /* Pointer to object to return */ + void *ret_value = NULL; /* Pointer to object to return */ FUNC_ENTER_NOAPI(NULL) @@ -466,7 +511,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5FL_reg_gc_list + * Function: H5FL__reg_gc_list * * Purpose: Garbage collect on a particular object free list * @@ -476,26 +521,25 @@ done: * Programmer: Quincey Koziol * Tuesday, July 25, 2000 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t -H5FL_reg_gc_list(H5FL_reg_head_t *head) +H5FL__reg_gc_list(H5FL_reg_head_t *head) { H5FL_reg_node_t *free_list; /* Pointer to nodes in free list being garbage collected */ - void *tmp; /* Temporary node pointer */ size_t total_mem; /* Total memory used on list */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Calculate the total memory used on this list */ - total_mem=head->onlist*head->size; + total_mem = head->onlist * head->size; /* For each free list being garbage collected, walk through the nodes and free them */ - free_list=head->list; - while(free_list!=NULL) { - tmp=free_list->next; + free_list = head->list; + while(free_list != NULL) { + void *tmp; /* Temporary node pointer */ + + tmp = free_list->next; /* Decrement the count of nodes allocated and free the node */ head->allocated--; @@ -506,18 +550,18 @@ H5FL_reg_gc_list(H5FL_reg_head_t *head) } /* end while */ /* Indicate no free nodes on the free list */ - head->list=NULL; - head->onlist=0; + head->list = NULL; + head->onlist = 0; /* Decrement global count of free memory on "regular" lists */ - H5FL_reg_gc_head.mem_freed-=total_mem; + H5FL_reg_gc_head.mem_freed -= total_mem; FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5FL_reg_gc_list() */ +} /* end H5FL__reg_gc_list() */ /*------------------------------------------------------------------------- - * Function: H5FL_reg_gc + * Function: H5FL__reg_gc * * Purpose: Garbage collect on all the object free lists * @@ -534,30 +578,30 @@ H5FL_reg_gc_list(H5FL_reg_head_t *head) *------------------------------------------------------------------------- */ static herr_t -H5FL_reg_gc(void) +H5FL__reg_gc(void) { H5FL_reg_gc_node_t *gc_node; /* Pointer into the list of things to garbage collect */ - herr_t ret_value=SUCCEED; /* return value*/ + herr_t ret_value = SUCCEED; /* return value*/ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Walk through all the free lists, free()'ing the nodes */ - gc_node=H5FL_reg_gc_head.first; - while(gc_node!=NULL) { + gc_node = H5FL_reg_gc_head.first; + while(gc_node != NULL) { /* Release the free nodes on the list */ - if(H5FL_reg_gc_list(gc_node->list)<0) + if(H5FL__reg_gc_list(gc_node->list) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGC, FAIL, "garbage collection of list failed") /* Go on to the next free list to garbage collect */ - gc_node=gc_node->next; + gc_node = gc_node->next; } /* end while */ /* Double check that all the memory on the free lists is recycled */ - HDassert(H5FL_reg_gc_head.mem_freed==0); + HDassert(H5FL_reg_gc_head.mem_freed == 0); done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FL_reg_gc() */ +} /* end H5FL__reg_gc() */ /*-------------------------------------------------------------------------- @@ -566,7 +610,7 @@ done: PURPOSE Terminate various H5FL object free lists USAGE - int H5FL_term() + int H5FL_reg_term() RETURNS Success: Positive if any action might have caused a change in some other interface; zero otherwise. @@ -586,50 +630,46 @@ done: again to reclaim this layer's memory. --------------------------------------------------------------------------*/ static int -H5FL_reg_term(void) +H5FL__reg_term(void) { H5FL_reg_gc_node_t *left; /* pointer to garbage collection lists with work left */ - H5FL_reg_gc_node_t *tmp; /* Temporary pointer to a garbage collection node */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR + + /* Free the nodes on the garbage collection list, keeping nodes with allocations outstanding */ + left = NULL; + while(H5FL_reg_gc_head.first != NULL) { + H5FL_reg_gc_node_t *tmp; /* Temporary pointer to a garbage collection node */ - if (H5_interface_initialize_g) { - /* Free the nodes on the garbage collection list, keeping nodes with allocations outstanding */ - left=NULL; - while(H5FL_reg_gc_head.first!=NULL) { - tmp=H5FL_reg_gc_head.first->next; + /* Get a copy of the next node */ + tmp = H5FL_reg_gc_head.first->next; #ifdef H5FL_DEBUG - printf("H5FL_reg_term: head->name=%s, head->allocated=%d\n", H5FL_reg_gc_head.first->list->name,(int)H5FL_reg_gc_head.first->list->allocated); +printf("%s: head->name = %s, head->allocated = %d\n", FUNC, H5FL_reg_gc_head.first->list->name, (int)H5FL_reg_gc_head.first->list->allocated); #endif /* H5FL_DEBUG */ - /* Check if the list has allocations outstanding */ - if(H5FL_reg_gc_head.first->list->allocated>0) { - /* Add free list to the list of nodes with allocations open still */ - H5FL_reg_gc_head.first->next=left; - left=H5FL_reg_gc_head.first; - } /* end if */ - /* No allocations left open for list, get rid of it */ - else { - /* Reset the "initialized" flag, in case we restart this list somehow (I don't know how..) */ - H5FL_reg_gc_head.first->list->init=0; + /* Check if the list has allocations outstanding */ + if(H5FL_reg_gc_head.first->list->allocated > 0) { + /* Add free list to the list of nodes with allocations open still */ + H5FL_reg_gc_head.first->next = left; + left = H5FL_reg_gc_head.first; + } /* end if */ + /* No allocations left open for list, get rid of it */ + else { + /* Reset the "initialized" flag, in case we restart this list somehow (I don't know how..) */ + H5FL_reg_gc_head.first->list->init = 0; - /* Free the node from the garbage collection list */ - H5MM_xfree(H5FL_reg_gc_head.first); - } /* end else */ + /* Free the node from the garbage collection list */ + H5MM_xfree(H5FL_reg_gc_head.first); + } /* end else */ - H5FL_reg_gc_head.first=tmp; - } /* end while */ + H5FL_reg_gc_head.first = tmp; + } /* end while */ - /* Point to the list of nodes left with allocations open, if any */ - H5FL_reg_gc_head.first=left; - if (!left) - H5_interface_initialize_g = 0; /*this layer has reached its initial state*/ - } + /* Point to the list of nodes left with allocations open, if any */ + H5FL_reg_gc_head.first = left; - /* Terminating this layer never affects other layers; rather, other layers affect - * the termination of this layer. */ - FUNC_LEAVE_NOAPI(0) -} /* end H5FL_reg_term() */ + FUNC_LEAVE_NOAPI(H5FL_reg_gc_head.first != NULL ? 1 : 0) +} /* end H5FL__reg_term() */ /*------------------------------------------------------------------------- @@ -654,7 +694,7 @@ H5FL_reg_term(void) static H5FL_blk_node_t * H5FL_blk_find_list(H5FL_blk_node_t **head, size_t size) { - H5FL_blk_node_t *temp; /* Temp. pointer to node in the native list */ + H5FL_blk_node_t *temp = NULL; /* Temp. pointer to node in the native list */ FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -716,7 +756,7 @@ static H5FL_blk_node_t * H5FL_blk_create_list(H5FL_blk_node_t **head, size_t size) { H5FL_blk_node_t *temp; /* Temp. pointer to node in the list */ - H5FL_blk_node_t *ret_value; + H5FL_blk_node_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -809,21 +849,20 @@ done: htri_t H5FL_blk_free_block_avail(H5FL_blk_head_t *head, size_t size) { - H5FL_blk_node_t *free_list; /* The free list of nodes of correct size */ - htri_t ret_value; /* Return value */ + H5FL_blk_node_t *free_list; /* The free list of nodes of correct size */ + htri_t ret_value = FAIL; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_NOAPI_NOERR /* Double check parameters */ HDassert(head); /* check if there is a free list for blocks of this size */ /* and if there are any blocks available on the list */ - if((free_list=H5FL_blk_find_list(&(head->head),size))!=NULL && free_list->list!=NULL) - ret_value=TRUE; + if((free_list = H5FL_blk_find_list(&(head->head), size)) != NULL && free_list->list != NULL) + ret_value = TRUE; else - ret_value=FALSE; -done: + ret_value = FALSE; FUNC_LEAVE_NOAPI(ret_value) } /* end H5FL_blk_free_block_avail() */ @@ -849,9 +888,9 @@ done: void * H5FL_blk_malloc(H5FL_blk_head_t *head, size_t size H5FL_TRACK_PARAMS) { - H5FL_blk_node_t *free_list; /* The free list of nodes of correct size */ - H5FL_blk_list_t *temp; /* Temp. ptr to the new native list allocated */ - void *ret_value; /* Pointer to the block to return to the user */ + H5FL_blk_node_t *free_list; /* The free list of nodes of correct size */ + H5FL_blk_list_t *temp; /* Temp. ptr to the new native list allocated */ + void *ret_value = NULL; /* Pointer to the block to return to the user */ FUNC_ENTER_NOAPI(NULL) @@ -897,8 +936,8 @@ H5FL_blk_malloc(H5FL_blk_head_t *head, size_t size H5FL_TRACK_PARAMS) #ifdef H5FL_TRACK /* Copy allocation location information */ - ((H5FL_track_t *)ret_value)->stack = H5MM_calloc(sizeof(H5CS_t)); - H5CS_copy_stack(((H5FL_track_t *)ret_value)->stack); + ((H5FL_track_t *)ret_value)->stack = H5CS_copy_stack(); + HDassert(((H5FL_track_t *)ret_value)->stack); ((H5FL_track_t *)ret_value)->file = H5MM_strdup(call_file); ((H5FL_track_t *)ret_value)->func = H5MM_strdup(call_func); ((H5FL_track_t *)ret_value)->line = call_line; @@ -941,7 +980,7 @@ done: void * H5FL_blk_calloc(H5FL_blk_head_t *head, size_t size H5FL_TRACK_PARAMS) { - void *ret_value; /* Pointer to the block to return to the user */ + void *ret_value = NULL; /* Pointer to the block to return to the user */ FUNC_ENTER_NOAPI(NULL) @@ -1001,7 +1040,6 @@ H5FL_blk_free(H5FL_blk_head_t *head, void *block) /* Free tracking information about the allocation location */ H5CS_close_stack(trk->stack); - trk->stack = H5MM_xfree(trk->stack); trk->file = H5MM_xfree(trk->file); trk->func = H5MM_xfree(trk->func); @@ -1044,20 +1082,20 @@ H5FL_blk_free(H5FL_blk_head_t *head, void *block) /* Increment the number of blocks on free list */ head->onlist++; - head->list_mem+=free_size; + head->list_mem += free_size; /* Increment the amount of "block" freed memory globally */ - H5FL_blk_gc_head.mem_freed+=free_size; + H5FL_blk_gc_head.mem_freed += free_size; /* Check for exceeding free list memory use limits */ /* First check this particular list */ - if(head->list_mem>H5FL_blk_lst_mem_lim) - if(H5FL_blk_gc_list(head)<0) + if(head->list_mem > H5FL_blk_lst_mem_lim) + if(H5FL__blk_gc_list(head) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGC, NULL, "garbage collection failed during free") /* Then check the global amount memory on block free lists */ - if(H5FL_blk_gc_head.mem_freed>H5FL_blk_glb_mem_lim) - if(H5FL_blk_gc()<0) + if(H5FL_blk_gc_head.mem_freed > H5FL_blk_glb_mem_lim) + if(H5FL__blk_gc() < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGC, NULL, "garbage collection failed during free") done: @@ -1121,7 +1159,8 @@ H5FL_blk_realloc(H5FL_blk_head_t *head, void *block, size_t new_size H5FL_TRACK_ trk->func = H5MM_xfree(trk->func); /* Store new tracking information */ - H5CS_copy_stack(trk->stack); + trk->stack = H5CS_copy_stack(); + HDassert(trk->stack); trk->file = H5MM_strdup(call_file); trk->func = H5MM_strdup(call_func); trk->line = call_line; @@ -1140,7 +1179,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5FL_blk_gc_list + * Function: H5FL__blk_gc_list * * Purpose: Garbage collect a priority queue * @@ -1150,34 +1189,33 @@ done: * Programmer: Quincey Koziol * Thursday, March 23, 2000 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t -H5FL_blk_gc_list(H5FL_blk_head_t *head) +H5FL__blk_gc_list(H5FL_blk_head_t *head) { - H5FL_blk_list_t *list; /* The free list of native nodes of a particular size */ - void *next; /* Temp. ptr to the free list list node */ - void *temp; /* Temp. ptr to the free list page node */ - - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Loop through all the nodes in the block free list queue */ - while(head->head!=NULL) { - temp=head->head->next; + while(head->head != NULL) { + H5FL_blk_list_t *list; /* The free list of native nodes of a particular size */ + void *temp; /* Temp. ptr to the free list page node */ + + temp = head->head->next; /* Loop through all the blocks in the free list, freeing them */ - list=head->head->list; - while(list!=NULL) { - next=list->next; + list = head->head->list; + while(list != NULL) { + void *next; /* Temp. ptr to the free list list node */ + + next = list->next; /* Decrement the number of blocks & memory allocated from this PQ */ head->allocated--; - head->list_mem-=head->head->size; + head->list_mem -= head->head->size; /* Decrement global count of free memory on "block" lists */ - H5FL_blk_gc_head.mem_freed-=head->head->size; + H5FL_blk_gc_head.mem_freed -= head->head->size; /* Free the block */ H5MM_free(list); @@ -1200,11 +1238,11 @@ H5FL_blk_gc_list(H5FL_blk_head_t *head) HDassert(0 == head->list_mem); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5FL_blk_gc_list() */ +} /* end H5FL__blk_gc_list() */ /*------------------------------------------------------------------------- - * Function: H5FL_blk_gc + * Function: H5FL__blk_gc * * Purpose: Garbage collect on all the priority queues * @@ -1214,44 +1252,42 @@ H5FL_blk_gc_list(H5FL_blk_head_t *head) * Programmer: Quincey Koziol * Saturday, March 25, 2000 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t -H5FL_blk_gc(void) +H5FL__blk_gc(void) { H5FL_blk_gc_node_t *gc_node; /* Pointer into the list of things to garbage collect */ - herr_t ret_value=SUCCEED; /* return value*/ + herr_t ret_value = SUCCEED; /* return value*/ FUNC_ENTER_NOAPI_NOINIT /* Walk through all the free lists, free()'ing the nodes */ - gc_node=H5FL_blk_gc_head.first; - while(gc_node!=NULL) { + gc_node = H5FL_blk_gc_head.first; + while(gc_node != NULL) { /* For each free list being garbage collected, walk through the nodes and free them */ - if(H5FL_blk_gc_list(gc_node->pq)<0) + if(H5FL__blk_gc_list(gc_node->pq) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGC, FAIL, "garbage collection of list failed") /* Go on to the next free list to garbage collect */ - gc_node=gc_node->next; + gc_node = gc_node->next; } /* end while */ /* Double check that all the memory on the free lists are recycled */ - HDassert(H5FL_blk_gc_head.mem_freed==0); + HDassert(H5FL_blk_gc_head.mem_freed == 0); done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FL_blk_gc() */ +} /* end H5FL__blk_gc() */ /*-------------------------------------------------------------------------- NAME - H5FL_blk_term + H5FL__blk_term PURPOSE Terminate various H5FL_blk objects USAGE - void H5FL_blk_term() + void H5FL__blk_term() RETURNS Success: Positive if any action might have caused a change in some other interface; zero otherwise. @@ -1265,45 +1301,46 @@ done: REVISION LOG --------------------------------------------------------------------------*/ static int -H5FL_blk_term(void) +H5FL__blk_term(void) { H5FL_blk_gc_node_t *left; /* pointer to garbage collection lists with work left */ - H5FL_blk_gc_node_t *tmp; /* Temporary pointer to a garbage collection node */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Free the nodes on the garbage collection list, keeping nodes with allocations outstanding */ - left=NULL; - while(H5FL_blk_gc_head.first!=NULL) { - tmp=H5FL_blk_gc_head.first->next; + left = NULL; + while(H5FL_blk_gc_head.first != NULL) { + H5FL_blk_gc_node_t *tmp; /* Temporary pointer to a garbage collection node */ + + tmp = H5FL_blk_gc_head.first->next; #ifdef H5FL_DEBUG -printf("H5FL_blk_term: head->name=%s, head->allocated=%d\n", H5FL_blk_gc_head.first->pq->name,(int)H5FL_blk_gc_head.first->pq->allocated); +printf("%s: head->name = %s, head->allocated = %d\n", FUNC, H5FL_blk_gc_head.first->pq->name, (int)H5FL_blk_gc_head.first->pq->allocated); #endif /* H5FL_DEBUG */ /* Check if the list has allocations outstanding */ - if(H5FL_blk_gc_head.first->pq->allocated>0) { + if(H5FL_blk_gc_head.first->pq->allocated > 0) { /* Add free list to the list of nodes with allocations open still */ - H5FL_blk_gc_head.first->next=left; - left=H5FL_blk_gc_head.first; + H5FL_blk_gc_head.first->next = left; + left = H5FL_blk_gc_head.first; } /* end if */ /* No allocations left open for list, get rid of it */ else { /* Reset the "initialized" flag, in case we restart this list somehow (I don't know how..) */ - H5FL_blk_gc_head.first->pq->init=0; + H5FL_blk_gc_head.first->pq->init = 0; /* Free the node from the garbage collection list */ H5MM_free(H5FL_blk_gc_head.first); } /* end else */ - H5FL_blk_gc_head.first=tmp; + H5FL_blk_gc_head.first = tmp; } /* end while */ /* Point to the list of nodes left with allocations open, if any */ - H5FL_blk_gc_head.first=left; + H5FL_blk_gc_head.first = left; - FUNC_LEAVE_NOAPI(H5FL_blk_gc_head.first!=NULL ? 1 : 0) -} /* end H5FL_blk_term() */ + FUNC_LEAVE_NOAPI(H5FL_blk_gc_head.first != NULL ? 1 : 0) +} /* end H5FL__blk_term() */ /*------------------------------------------------------------------------- @@ -1422,13 +1459,13 @@ H5FL_arr_free(H5FL_arr_head_t *head, void *obj) /* Check for exceeding free list memory use limits */ /* First check this particular list */ - if(head->list_mem>H5FL_arr_lst_mem_lim) - if(H5FL_arr_gc_list(head)<0) + if(head->list_mem > H5FL_arr_lst_mem_lim) + if(H5FL__arr_gc_list(head) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGC, NULL, "garbage collection failed during free") /* Then check the global amount memory on array free lists */ - if(H5FL_arr_gc_head.mem_freed>H5FL_arr_glb_mem_lim) - if(H5FL_arr_gc()<0) + if(H5FL_arr_gc_head.mem_freed > H5FL_arr_glb_mem_lim) + if(H5FL__arr_gc() < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGC, NULL, "garbage collection failed during free") done: @@ -1455,8 +1492,8 @@ void * H5FL_arr_malloc(H5FL_arr_head_t *head, size_t elem) { H5FL_arr_list_t *new_obj; /* Pointer to the new free list node allocated */ - void *ret_value; /* Pointer to object to return */ - size_t mem_size; /* Size of memory block being recycled */ + size_t mem_size; /* Size of memory block being recycled */ + void *ret_value = NULL; /* Pointer to the block to return */ FUNC_ENTER_NOAPI(NULL) @@ -1529,7 +1566,7 @@ done: void * H5FL_arr_calloc(H5FL_arr_head_t *head, size_t elem) { - void *ret_value; /* Pointer to object to return */ + void *ret_value = NULL; /* Pointer to the block to return */ FUNC_ENTER_NOAPI(NULL) @@ -1567,51 +1604,50 @@ done: void * H5FL_arr_realloc(H5FL_arr_head_t *head, void * obj, size_t new_elem) { - void *ret_value; /* Pointer to object to return */ + void *ret_value = NULL; /* Pointer to the block to return */ - FUNC_ENTER_NOAPI(NULL) + FUNC_ENTER_NOAPI_NOERR /* Double check parameters */ HDassert(head); HDassert(new_elem); /* Check if we are really allocating the object */ - if(obj==NULL) - ret_value=H5FL_arr_malloc(head,new_elem); + if(obj == NULL) + ret_value = H5FL_arr_malloc(head, new_elem); else { H5FL_arr_list_t *temp; /* Temp. ptr to the new free list node allocated */ /* Sanity check that the number of elements is supported */ - HDassert((int)new_elem<=head->maxelem); + HDassert((int)new_elem <= head->maxelem); /* Get the pointer to the info header in front of the block to free */ - temp=(H5FL_arr_list_t *)((unsigned char *)obj-sizeof(H5FL_arr_list_t)); /*lint !e826 Pointer-to-pointer cast is appropriate here */ + temp = (H5FL_arr_list_t *)((unsigned char *)obj - sizeof(H5FL_arr_list_t)); /*lint !e826 Pointer-to-pointer cast is appropriate here */ /* Check if the size is really changing */ - if(temp->nelem!=new_elem) { + if(temp->nelem != new_elem) { size_t blk_size; /* Size of block */ /* Get the new array of objects */ - ret_value=H5FL_arr_malloc(head,new_elem); + ret_value = H5FL_arr_malloc(head, new_elem); /* Copy the appropriate amount of elements */ - blk_size = head->list_arr[ MIN(temp->nelem, new_elem) ].size; - HDmemcpy(ret_value,obj,blk_size); + blk_size = head->list_arr[MIN(temp->nelem, new_elem)].size; + HDmemcpy(ret_value, obj, blk_size); /* Free the old block */ - H5FL_arr_free(head,obj); + H5FL_arr_free(head, obj); } /* end if */ else - ret_value=obj; + ret_value = obj; } /* end else */ -done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5FL_arr_realloc() */ /*------------------------------------------------------------------------- - * Function: H5FL_arr_gc_list + * Function: H5FL__arr_gc_list * * Purpose: Garbage collect on an array object free list * @@ -1621,29 +1657,29 @@ done: * Programmer: Quincey Koziol * Tuesday, July 25, 2000 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t -H5FL_arr_gc_list(H5FL_arr_head_t *head) +H5FL__arr_gc_list(H5FL_arr_head_t *head) { - H5FL_arr_list_t *arr_free_list; /* Pointer to nodes in free list being garbage collected */ - void *tmp; /* Temporary node pointer */ unsigned u; /* Counter for array of free lists */ - size_t total_mem; /* Total memory used on list */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Walk through the array of free lists */ - for(u=0; u<(unsigned)head->maxelem; u++) { - if(head->list_arr[u].onlist>0) { + for(u = 0; u < (unsigned)head->maxelem; u++) { + if(head->list_arr[u].onlist > 0) { + H5FL_arr_list_t *arr_free_list; /* Pointer to nodes in free list being garbage collected */ + size_t total_mem; /* Total memory used on list */ + /* Calculate the total memory used on this list */ - total_mem=head->list_arr[u].onlist*head->list_arr[u].size; + total_mem = head->list_arr[u].onlist * head->list_arr[u].size; /* For each free list being garbage collected, walk through the nodes and free them */ - arr_free_list=head->list_arr[u].list; - while(arr_free_list!=NULL) { + arr_free_list = head->list_arr[u].list; + while(arr_free_list != NULL) { + void *tmp; /* Temporary node pointer */ + tmp = arr_free_list->next; /* Decrement the count of nodes allocated and free the node */ @@ -1658,22 +1694,22 @@ H5FL_arr_gc_list(H5FL_arr_head_t *head) head->list_arr[u].onlist = 0; /* Decrement count of free memory on this "array" list */ - head->list_mem-=total_mem; + head->list_mem -= total_mem; /* Decrement global count of free memory on "array" lists */ - H5FL_arr_gc_head.mem_freed-=total_mem; + H5FL_arr_gc_head.mem_freed -= total_mem; } /* end if */ } /* end for */ /* Double check that all the memory on this list is recycled */ - HDassert(head->list_mem==0); + HDassert(head->list_mem == 0); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5FL_arr_gc_list() */ +} /* end H5FL__arr_gc_list() */ /*------------------------------------------------------------------------- - * Function: H5FL_arr_gc + * Function: H5FL__arr_gc * * Purpose: Garbage collect on all the array object free lists * @@ -1683,44 +1719,42 @@ H5FL_arr_gc_list(H5FL_arr_head_t *head) * Programmer: Quincey Koziol * Saturday, March 25, 2000 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t -H5FL_arr_gc(void) +H5FL__arr_gc(void) { H5FL_gc_arr_node_t *gc_arr_node; /* Pointer into the list of things to garbage collect */ - herr_t ret_value=SUCCEED; /* return value*/ + herr_t ret_value = SUCCEED; /* return value*/ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Walk through all the free lists, free()'ing the nodes */ - gc_arr_node=H5FL_arr_gc_head.first; - while(gc_arr_node!=NULL) { + gc_arr_node = H5FL_arr_gc_head.first; + while(gc_arr_node != NULL) { /* Release the free nodes on the list */ - if(H5FL_arr_gc_list(gc_arr_node->list)<0) + if(H5FL__arr_gc_list(gc_arr_node->list) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGC, FAIL, "garbage collection of list failed") /* Go on to the next free list to garbage collect */ - gc_arr_node=gc_arr_node->next; + gc_arr_node = gc_arr_node->next; } /* end while */ /* Double check that all the memory on the free lists are recycled */ - HDassert(H5FL_arr_gc_head.mem_freed==0); + HDassert(H5FL_arr_gc_head.mem_freed == 0); done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FL_arr_gc() */ +} /* end H5FL__arr_gc() */ /*-------------------------------------------------------------------------- NAME - H5FL_arr_term + H5FL__arr_term PURPOSE Terminate various H5FL array object free lists USAGE - int H5FL_arr_term() + int H5FL__arr_term() RETURNS Success: Positive if any action might have caused a change in some other interface; zero otherwise. @@ -1734,26 +1768,27 @@ done: REVISION LOG --------------------------------------------------------------------------*/ static int -H5FL_arr_term(void) +H5FL__arr_term(void) { H5FL_gc_arr_node_t *left; /* pointer to garbage collection lists with work left */ - H5FL_gc_arr_node_t *tmp; /* Temporary pointer to a garbage collection node */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Free the nodes on the garbage collection list, keeping nodes with allocations outstanding */ - left=NULL; - while(H5FL_arr_gc_head.first!=NULL) { - tmp=H5FL_arr_gc_head.first->next; + left = NULL; + while(H5FL_arr_gc_head.first != NULL) { + H5FL_gc_arr_node_t *tmp; /* Temporary pointer to a garbage collection node */ + + tmp = H5FL_arr_gc_head.first->next; /* Check if the list has allocations outstanding */ #ifdef H5FL_DEBUG -printf("H5FL_arr_term: head->name=%s, head->allocated=%d\n", H5FL_arr_gc_head.first->list->name,(int)H5FL_arr_gc_head.first->list->allocated); +printf("%s: head->name = %s, head->allocated = %d\n", FUNC, H5FL_arr_gc_head.first->list->name, (int)H5FL_arr_gc_head.first->list->allocated); #endif /* H5FL_DEBUG */ - if(H5FL_arr_gc_head.first->list->allocated>0) { + if(H5FL_arr_gc_head.first->list->allocated > 0) { /* Add free list to the list of nodes with allocations open still */ - H5FL_arr_gc_head.first->next=left; - left=H5FL_arr_gc_head.first; + H5FL_arr_gc_head.first->next = left; + left = H5FL_arr_gc_head.first; } /* end if */ /* No allocations left open for list, get rid of it */ else { @@ -1761,20 +1796,20 @@ printf("H5FL_arr_term: head->name=%s, head->allocated=%d\n", H5FL_arr_gc_head.fi H5MM_xfree(H5FL_arr_gc_head.first->list->list_arr); /* Reset the "initialized" flag, in case we restart this list somehow (I don't know how..) */ - H5FL_arr_gc_head.first->list->init=0; + H5FL_arr_gc_head.first->list->init = 0; /* Free the node from the garbage collection list */ H5MM_free(H5FL_arr_gc_head.first); } /* end else */ - H5FL_arr_gc_head.first=tmp; + H5FL_arr_gc_head.first = tmp; } /* end while */ /* Point to the list of nodes left with allocations open, if any */ - H5FL_arr_gc_head.first=left; + H5FL_arr_gc_head.first = left; - FUNC_LEAVE_NOAPI(H5FL_arr_gc_head.first!=NULL ? 1 : 0) -} /* end H5FL_arr_term() */ + FUNC_LEAVE_NOAPI(H5FL_arr_gc_head.first != NULL ? 1 : 0) +} /* end H5FL__arr_term() */ /*------------------------------------------------------------------------- @@ -1831,18 +1866,17 @@ H5FL_seq_free(H5FL_seq_head_t *head, void *obj) void * H5FL_seq_malloc(H5FL_seq_head_t *head, size_t elem H5FL_TRACK_PARAMS) { - void *ret_value; /* Pointer to object to return */ + void *ret_value = NULL; /* Pointer to the block to return */ - FUNC_ENTER_NOAPI(NULL) + FUNC_ENTER_NOAPI_NOERR /* Double check parameters */ HDassert(head); HDassert(elem); /* Use block routine */ - ret_value=H5FL_blk_malloc(&(head->queue),head->size*elem H5FL_TRACK_INFO_INT); + ret_value = H5FL_blk_malloc(&(head->queue), head->size * elem H5FL_TRACK_INFO_INT); -done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5FL_seq_malloc() */ @@ -1865,18 +1899,17 @@ done: void * H5FL_seq_calloc(H5FL_seq_head_t *head, size_t elem H5FL_TRACK_PARAMS) { - void *ret_value; /* Pointer to object to return */ + void *ret_value = NULL; /* Pointer to the block to return */ - FUNC_ENTER_NOAPI(NULL) + FUNC_ENTER_NOAPI_NOERR /* Double check parameters */ HDassert(head); HDassert(elem); /* Use block routine */ - ret_value=H5FL_blk_calloc(&(head->queue),head->size*elem H5FL_TRACK_INFO_INT); + ret_value = H5FL_blk_calloc(&(head->queue), head->size * elem H5FL_TRACK_INFO_INT); -done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5FL_seq_calloc() */ @@ -1899,18 +1932,17 @@ done: void * H5FL_seq_realloc(H5FL_seq_head_t *head, void * obj, size_t new_elem H5FL_TRACK_PARAMS) { - void *ret_value; /* Pointer to object to return */ + void *ret_value = NULL; /* Pointer to the block to return */ - FUNC_ENTER_NOAPI(NULL) + FUNC_ENTER_NOAPI_NOERR /* Double check parameters */ HDassert(head); HDassert(new_elem); /* Use block routine */ - ret_value=H5FL_blk_realloc(&(head->queue),obj,head->size*new_elem H5FL_TRACK_INFO_INT); + ret_value = H5FL_blk_realloc(&(head->queue), obj, head->size * new_elem H5FL_TRACK_INFO_INT); -done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5FL_seq_realloc() */ @@ -1936,9 +1968,9 @@ done: H5FL_fac_head_t * H5FL_fac_init(size_t size) { - H5FL_fac_gc_node_t *new_node = NULL; /* Pointer to the node for the new list to garbage collect */ - H5FL_fac_head_t *factory = NULL; /* Pointer to new block factory */ - H5FL_fac_head_t *ret_value; /* Return value */ + H5FL_fac_gc_node_t *new_node = NULL; /* Pointer to the node for the new list to garbage collect */ + H5FL_fac_head_t *factory = NULL; /* Pointer to new block factory */ + H5FL_fac_head_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI(NULL) @@ -2013,7 +2045,7 @@ done: void * H5FL_fac_free(H5FL_fac_head_t *head, void *obj) { - void *ret_value=NULL; /* Return value */ + void *ret_value = NULL; /* Return value */ /* NOINIT OK here because this must be called after H5FL_fac_init -NAF */ FUNC_ENTER_NOAPI_NOINIT @@ -2028,7 +2060,6 @@ H5FL_fac_free(H5FL_fac_head_t *head, void *obj) /* Free tracking information about the allocation location */ H5CS_close_stack(trk->stack); - trk->stack = H5MM_xfree(trk->stack); trk->file = H5MM_xfree(trk->file); trk->func = H5MM_xfree(trk->func); @@ -2054,26 +2085,26 @@ H5FL_fac_free(H5FL_fac_head_t *head, void *obj) HDassert(head->init); /* Link into the free list */ - ((H5FL_fac_node_t *)obj)->next=head->list; + ((H5FL_fac_node_t *)obj)->next = head->list; /* Point free list at the node freed */ - head->list=(H5FL_fac_node_t *)obj; + head->list = (H5FL_fac_node_t *)obj; /* Increment the number of blocks on free list */ head->onlist++; /* Increment the amount of "factory" freed memory globally */ - H5FL_fac_gc_head.mem_freed+=head->size; + H5FL_fac_gc_head.mem_freed += head->size; /* Check for exceeding free list memory use limits */ /* First check this particular list */ if(head->onlist * head->size > H5FL_fac_lst_mem_lim) - if(H5FL_fac_gc_list(head)<0) + if(H5FL__fac_gc_list(head) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGC, NULL, "garbage collection failed during free") /* Then check the global amount memory on factory free lists */ if(H5FL_fac_gc_head.mem_freed > H5FL_fac_glb_mem_lim) - if(H5FL_fac_gc()<0) + if(H5FL__fac_gc() < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGC, NULL, "garbage collection failed during free") done: @@ -2102,7 +2133,7 @@ done: void * H5FL_fac_malloc(H5FL_fac_head_t *head H5FL_TRACK_PARAMS) { - void *ret_value; /* Pointer to object to return */ + void *ret_value = NULL; /* Pointer to the block to return */ /* NOINIT OK here because this must be called after H5FL_fac_init -NAF */ FUNC_ENTER_NOAPI_NOINIT @@ -2136,8 +2167,8 @@ H5FL_fac_malloc(H5FL_fac_head_t *head H5FL_TRACK_PARAMS) #ifdef H5FL_TRACK /* Copy allocation location information */ - ((H5FL_track_t *)ret_value)->stack = H5MM_calloc(sizeof(H5CS_t)); - H5CS_copy_stack(((H5FL_track_t *)ret_value)->stack); + ((H5FL_track_t *)ret_value)->stack = H5CS_copy_stack(); + HDassert(((H5FL_track_t *)ret_value)->stack); ((H5FL_track_t *)ret_value)->file = H5MM_strdup(call_file); ((H5FL_track_t *)ret_value)->func = H5MM_strdup(call_func); ((H5FL_track_t *)ret_value)->line = call_line; @@ -2179,7 +2210,7 @@ done: void * H5FL_fac_calloc(H5FL_fac_head_t *head H5FL_TRACK_PARAMS) { - void *ret_value; /* Pointer to object to return */ + void *ret_value = NULL; /* Pointer to the block to return */ /* NOINIT OK here because this must be called after H5FL_fac_init -NAF */ FUNC_ENTER_NOAPI_NOINIT @@ -2198,9 +2229,10 @@ H5FL_fac_calloc(H5FL_fac_head_t *head H5FL_TRACK_PARAMS) done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5FL_fac_calloc() */ + /*------------------------------------------------------------------------- - * Function: H5FL_fac_gc_list + * Function: H5FL__fac_gc_list * * Purpose: Garbage collect on a particular factory free list * @@ -2210,26 +2242,25 @@ done: * Programmer: Neil Fortner * Friday, December 19, 2008 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t -H5FL_fac_gc_list(H5FL_fac_head_t *head) +H5FL__fac_gc_list(H5FL_fac_head_t *head) { H5FL_fac_node_t *free_list; /* Pointer to nodes in free list being garbage collected */ - void *tmp; /* Temporary node pointer */ size_t total_mem; /* Total memory used on list */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Calculate the total memory used on this list */ - total_mem=head->onlist*head->size; + total_mem = head->onlist * head->size; /* For each free list being garbage collected, walk through the nodes and free them */ - free_list=head->list; - while(free_list!=NULL) { - tmp=free_list->next; + free_list = head->list; + while(free_list != NULL) { + void *tmp; /* Temporary node pointer */ + + tmp = free_list->next; /* Decrement the count of nodes allocated and free the node */ head->allocated--; @@ -2240,18 +2271,18 @@ H5FL_fac_gc_list(H5FL_fac_head_t *head) } /* end while */ /* Indicate no free nodes on the free list */ - head->list=NULL; - head->onlist=0; + head->list = NULL; + head->onlist = 0; /* Decrement global count of free memory on "factory" lists */ - H5FL_fac_gc_head.mem_freed-=total_mem; + H5FL_fac_gc_head.mem_freed -= total_mem; FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5FL_fac_gc_list() */ +} /* end H5FL__fac_gc_list() */ /*------------------------------------------------------------------------- - * Function: H5FL_fac_gc + * Function: H5FL__fac_gc * * Purpose: Garbage collect on all the factory free lists * @@ -2261,35 +2292,33 @@ H5FL_fac_gc_list(H5FL_fac_head_t *head) * Programmer: Neil Fortner * Friday, December 19, 2008 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t -H5FL_fac_gc(void) +H5FL__fac_gc(void) { H5FL_fac_gc_node_t *gc_node; /* Pointer into the list of things to garbage collect */ - herr_t ret_value=SUCCEED; /* return value*/ + herr_t ret_value = SUCCEED; /* return value*/ FUNC_ENTER_NOAPI_NOINIT /* Walk through all the free lists, free()'ing the nodes */ - gc_node=H5FL_fac_gc_head.first; - while(gc_node!=NULL) { + gc_node = H5FL_fac_gc_head.first; + while(gc_node != NULL) { /* Release the free nodes on the list */ - if(H5FL_fac_gc_list(gc_node->list)<0) + if(H5FL__fac_gc_list(gc_node->list) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGC, FAIL, "garbage collection of list failed") /* Go on to the next free list to garbage collect */ - gc_node=gc_node->next; + gc_node = gc_node->next; } /* end while */ /* Double check that all the memory on the free lists is recycled */ - HDassert(H5FL_fac_gc_head.mem_freed==0); + HDassert(H5FL_fac_gc_head.mem_freed == 0); done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FL_fac_gc() */ +} /* end H5FL__fac_gc() */ /*------------------------------------------------------------------------- @@ -2323,11 +2352,11 @@ H5FL_fac_term(H5FL_fac_head_t *factory) HDassert(factory); /* Garbage collect all the blocks in the factory's free list */ - if(H5FL_fac_gc_list(factory)<0) + if(H5FL__fac_gc_list(factory) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGC, FAIL, "garbage collection of factory failed") /* Verify that all the blocks have been freed */ - if(factory->allocated>0) + if(factory->allocated > 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, FAIL, "factory still has objects allocated") /* Unlink block free list for factory from global free list */ @@ -2358,7 +2387,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5FL_fac_term_all + * Function: H5FL__fac_term_all * * Purpose: Terminate all block factories * @@ -2368,23 +2397,21 @@ done: * Programmer: Neil Fortner * Friday, December 19, 2008 * - * Modifications: - * *------------------------------------------------------------------------- */ static int -H5FL_fac_term_all(void) +H5FL__fac_term_all(void) { - H5FL_fac_gc_node_t *tmp; /* Temporary pointer to a garbage collection node */ - - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Free the nodes on the garbage collection list */ while(H5FL_fac_gc_head.first != NULL) { - tmp=H5FL_fac_gc_head.first->next; + H5FL_fac_gc_node_t *tmp; /* Temporary pointer to a garbage collection node */ + + tmp = H5FL_fac_gc_head.first->next; #ifdef H5FL_DEBUG -printf("H5FL_fac_term: head->size=%d, head->allocated=%d\n", (int)H5FL_fac_gc_head.first->list->size,(int)H5FL_fac_gc_head.first->list->allocated); +printf("%s: head->size = %d, head->allocated = %d\n", FUNC, (int)H5FL_fac_gc_head.first->list->size, (int)H5FL_fac_gc_head.first->list->allocated); #endif /* H5FL_DEBUG */ /* The list cannot have any allocations outstanding */ @@ -2400,7 +2427,7 @@ printf("H5FL_fac_term: head->size=%d, head->allocated=%d\n", (int)H5FL_fac_gc_he } /* end while */ FUNC_LEAVE_NOAPI(0) -} /* end H5FL_fac_term_all() */ +} /* end H5FL__fac_term_all() */ /*------------------------------------------------------------------------- @@ -2426,20 +2453,20 @@ H5FL_garbage_coll(void) FUNC_ENTER_NOAPI(FAIL) /* Garbage collect the free lists for array objects */ - if(H5FL_arr_gc()<0) + if(H5FL__arr_gc() < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGC, FAIL, "can't garbage collect array objects") /* Garbage collect free lists for blocks */ - if(H5FL_blk_gc()<0) + if(H5FL__blk_gc() < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGC, FAIL, "can't garbage collect block objects") /* Garbage collect the free lists for regular objects */ - if(H5FL_reg_gc()<0) + if(H5FL__reg_gc() < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGC, FAIL, "can't garbage collect regular objects") /* Garbage collect the free lists for factory objects */ - if(H5FL_fac_gc()<0) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGC, FAIL, "can't garbage collect regular objects") + if(H5FL__fac_gc() < 0) + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGC, FAIL, "can't garbage collect factory objects") done: FUNC_LEAVE_NOAPI(ret_value) @@ -2482,82 +2509,28 @@ H5FL_set_free_list_limits(int reg_global_lim, int reg_list_lim, int arr_global_l int arr_list_lim, int blk_global_lim, int blk_list_lim, int fac_global_lim, int fac_list_lim) { - herr_t ret_value = SUCCEED; + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_NOAPI_NOERR /* Set the limit variables */ /* limit on all regular free lists */ - H5FL_reg_glb_mem_lim=(reg_global_lim==-1 ? UINT_MAX : (size_t)reg_global_lim); + H5FL_reg_glb_mem_lim = (reg_global_lim == -1 ? UINT_MAX : (size_t)reg_global_lim); /* limit on each regular free list */ - H5FL_reg_lst_mem_lim=(reg_list_lim==-1 ? UINT_MAX : (size_t)reg_list_lim); + H5FL_reg_lst_mem_lim = (reg_list_lim == -1 ? UINT_MAX : (size_t)reg_list_lim); /* limit on all array free lists */ - H5FL_arr_glb_mem_lim=(arr_global_lim==-1 ? UINT_MAX : (size_t)arr_global_lim); + H5FL_arr_glb_mem_lim = (arr_global_lim == -1 ? UINT_MAX : (size_t)arr_global_lim); /* limit on each array free list */ - H5FL_arr_lst_mem_lim=(arr_list_lim==-1 ? UINT_MAX : (size_t)arr_list_lim); + H5FL_arr_lst_mem_lim = (arr_list_lim == -1 ? UINT_MAX : (size_t)arr_list_lim); /* limit on all block free lists */ - H5FL_blk_glb_mem_lim=(blk_global_lim==-1 ? UINT_MAX : (size_t)blk_global_lim); + H5FL_blk_glb_mem_lim = (blk_global_lim == -1 ? UINT_MAX : (size_t)blk_global_lim); /* limit on each block free list */ - H5FL_blk_lst_mem_lim=(blk_list_lim==-1 ? UINT_MAX : (size_t)blk_list_lim); + H5FL_blk_lst_mem_lim = (blk_list_lim == -1 ? UINT_MAX : (size_t)blk_list_lim); /* limit on all factory free lists */ - H5FL_fac_glb_mem_lim=(fac_global_lim==-1 ? UINT_MAX : (size_t)fac_global_lim); + H5FL_fac_glb_mem_lim = (fac_global_lim == -1 ? UINT_MAX : (size_t)fac_global_lim); /* limit on each factory free list */ - H5FL_fac_lst_mem_lim=(fac_list_lim==-1 ? UINT_MAX : (size_t)fac_list_lim); + H5FL_fac_lst_mem_lim = (fac_list_lim == -1 ? UINT_MAX : (size_t)fac_list_lim); -done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5FL_set_free_list_limits() */ - -/*-------------------------------------------------------------------------- - NAME - H5FL_term_interface - PURPOSE - Terminate various H5FL objects - USAGE - void H5FL_term_interface() - RETURNS - Success: Positive if any action might have caused a change in some - other interface; zero otherwise. - Failure: Negative - DESCRIPTION - Release any resources allocated. - GLOBAL VARIABLES - COMMENTS, BUGS, ASSUMPTIONS - Can't report errors... - EXAMPLES - REVISION LOG ---------------------------------------------------------------------------*/ -int -H5FL_term_interface(void) -{ - int ret_value=0; - - FUNC_ENTER_NOAPI_NOINIT_NOERR - - /* Garbage collect any nodes on the free lists */ - (void)H5FL_garbage_coll(); - - ret_value=H5FL_reg_term()+H5FL_fac_term_all()+H5FL_arr_term()+H5FL_blk_term(); - -#ifdef H5FL_TRACK - /* If we haven't freed all the allocated memory, dump out the list now */ - if(ret_value > 0 && H5FL_out_head_g) { - H5FL_track_t *trk = H5FL_out_head_g; - - /* Dump information about all the outstanding allocations */ - while(trk != NULL) { - /* Print information about the outstanding block */ - HDfprintf(stderr,"%s: Outstanding allocation:\n", "H5FL_term_interface"); - HDfprintf(stderr,"\tFile: %s, Function: %s, Line: %d\n", trk->file, trk->func, trk->line); - H5CS_print_stack(trk->stack, stderr); - - /* Advance to next node */ - trk = trk->next; - } /* end while */ - } /* end if */ -#endif /* H5FL_TRACK */ - - FUNC_LEAVE_NOAPI(ret_value) -} - diff --git a/src/H5FLmodule.h b/src/H5FLmodule.h new file mode 100644 index 0000000..cfa585c --- /dev/null +++ b/src/H5FLmodule.h @@ -0,0 +1,35 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* + * Programmer: Quincey Koziol + * Saturday, September 12, 2015 + * + * Purpose: This file contains declarations which define macros for the + * H5FL package. Including this header means that the source file + * is part of the H5FL package. + */ +#ifndef _H5FLmodule_H +#define _H5FLmodule_H + +/* Define the proper control macros for the generic FUNC_ENTER/LEAVE and error + * reporting macros. + */ +#define H5FL_MODULE +#define H5_MY_PKG H5FL +#define H5_MY_PKG_ERR H5E_RESOURCE +#define H5_MY_PKG_INIT NO + +#endif /* _H5FLmodule_H */ + diff --git a/src/H5FO.c b/src/H5FO.c index a6c47cb..a77e268 100644 --- a/src/H5FO.c +++ b/src/H5FO.c @@ -21,7 +21,7 @@ * */ -#define H5F_PACKAGE /*suppress error about including H5Fpkg */ +#define H5F_FRIEND /*suppress error about including H5Fpkg */ #include "H5Eprivate.h" /* Error handling */ diff --git a/src/H5FS.c b/src/H5FS.c index 182ac05..8e5985f 100644 --- a/src/H5FS.c +++ b/src/H5FS.c @@ -27,7 +27,8 @@ /* Module Setup */ /****************/ -#define H5FS_PACKAGE /*suppress error about including H5FSpkg */ +#include "H5FSmodule.h" /* This source code file is part of the H5FS module */ + /***********/ /* Headers */ @@ -38,6 +39,7 @@ #include "H5FSpkg.h" /* File free space */ #include "H5MFprivate.h" /* File memory management */ + /****************/ /* Local Macros */ /****************/ @@ -66,6 +68,9 @@ static herr_t H5FS_sinfo_free_node_cb(void *item, void *key, void *op_data); /* Package Variables */ /*********************/ +/* Package initialization variable */ +hbool_t H5_PKG_INIT_VAR = FALSE; + /* Declare a free list to manage the H5FS_section_class_t sequence information */ H5FL_SEQ_DEFINE(H5FS_section_class_t); @@ -107,7 +112,7 @@ H5FS_create(H5F_t *f, hid_t dxpl_id, haddr_t *fs_addr, const H5FS_create_t *fs_c uint16_t nclasses, const H5FS_section_class_t *classes[], void *cls_init_udata, hsize_t alignment, hsize_t threshold) { H5FS_t *fspace = NULL; /* New free space structure */ - H5FS_t *ret_value; /* Return value */ + H5FS_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_TAG(dxpl_id, H5AC__FREESPACE_TAG, NULL) #ifdef H5FS_DEBUG @@ -196,7 +201,7 @@ H5FS_open(H5F_t *f, hid_t dxpl_id, haddr_t fs_addr, uint16_t nclasses, { H5FS_t *fspace = NULL; /* New free space structure */ H5FS_hdr_cache_ud_t cache_udata; /* User-data for metadata cache callback */ - H5FS_t *ret_value; /* Return value */ + H5FS_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_TAG(dxpl_id, H5AC__FREESPACE_TAG, NULL) #ifdef H5FS_DEBUG @@ -602,7 +607,7 @@ H5FS__new(const H5F_t *f, uint16_t nclasses, const H5FS_section_class_t *classes { H5FS_t *fspace = NULL; /* Free space manager */ size_t u; /* Local index variable */ - H5FS_t *ret_value; /* Return value */ + H5FS_t *ret_value = NULL; /* Return value */ FUNC_ENTER_PACKAGE diff --git a/src/H5FScache.c b/src/H5FScache.c index 455a96e..25a16e0 100644 --- a/src/H5FScache.c +++ b/src/H5FScache.c @@ -28,7 +28,8 @@ /* Module Setup */ /****************/ -#define H5FS_PACKAGE /*suppress error about including H5FSpkg */ +#include "H5FSmodule.h" /* This source code file is part of the H5FS module */ + /***********/ /* Headers */ @@ -41,6 +42,7 @@ #include "H5VMprivate.h" /* Vectors and arrays */ #include "H5WBprivate.h" /* Wrapped Buffers */ + /****************/ /* Local Macros */ /****************/ @@ -210,7 +212,7 @@ H5FS__cache_hdr_deserialize(const void *_image, size_t len, void *_udata, uint32_t stored_chksum; /* Stored metadata checksum value */ uint32_t computed_chksum; /* Computed metadata checksum value */ unsigned nclasses; /* Number of section classes */ - H5FS_t *ret_value; /* Return value */ + H5FS_t *ret_value = NULL; /* Return value */ FUNC_ENTER_STATIC @@ -840,8 +842,8 @@ H5FS__cache_sinfo_deserialize(const void *_image, size_t len, void *_udata, size_t old_sect_size; /* Old section size */ const uint8_t *image = (const uint8_t *)_image; /* Pointer into raw data buffer */ uint32_t stored_chksum; /* Stored metadata checksum */ - uint32_t computed_chksum; /* Computed metadata checksum */ - void * ret_value; /* Return value */ + uint32_t computed_chksum; /* Computed metadata checksum */ + void * ret_value = NULL; /* Return value */ FUNC_ENTER_STATIC diff --git a/src/H5FSdbg.c b/src/H5FSdbg.c index de66ebd..7303b73 100644 --- a/src/H5FSdbg.c +++ b/src/H5FSdbg.c @@ -28,10 +28,11 @@ /* Module Setup */ /****************/ -#define H5FS_PACKAGE /*suppress error about including H5FSpkg */ +#include "H5FSmodule.h" /* This source code file is part of the H5FS module */ #define H5HF_DEBUGGING /* Need access to fractal heap debugging routines */ #define H5MF_DEBUGGING /* Need access to file space debugging routines */ + /***********/ /* Headers */ /***********/ @@ -41,6 +42,7 @@ #include "H5HFprivate.h" /* Fractal heaps */ #include "H5MFprivate.h" /* File memory management */ + /****************/ /* Local Macros */ /****************/ diff --git a/src/H5FSmodule.h b/src/H5FSmodule.h new file mode 100644 index 0000000..b435b79 --- /dev/null +++ b/src/H5FSmodule.h @@ -0,0 +1,35 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* + * Programmer: Quincey Koziol + * Saturday, September 12, 2015 + * + * Purpose: This file contains declarations which define macros for the + * H5FS package. Including this header means that the source file + * is part of the H5FS package. + */ +#ifndef _H5FSmodule_H +#define _H5FSmodule_H + +/* Define the proper control macros for the generic FUNC_ENTER/LEAVE and error + * reporting macros. + */ +#define H5FS_MODULE +#define H5_MY_PKG H5FS +#define H5_MY_PKG_ERR H5E_FSPACE +#define H5_MY_PKG_INIT NO + +#endif /* _H5FSmodule_H */ + diff --git a/src/H5FSpkg.h b/src/H5FSpkg.h index 2c1eba7..b0df9e6 100644 --- a/src/H5FSpkg.h +++ b/src/H5FSpkg.h @@ -21,7 +21,7 @@ * the H5FS package. Source files outside the H5FS package should * include H5FSprivate.h instead. */ -#ifndef H5FS_PACKAGE +#if !(defined H5FS_FRIEND || defined H5FS_MODULE) #error "Do not include this file outside the H5FS package!" #endif diff --git a/src/H5FSsection.c b/src/H5FSsection.c index 0b47f51..d447160 100644 --- a/src/H5FSsection.c +++ b/src/H5FSsection.c @@ -25,7 +25,7 @@ /* Module Setup */ /****************/ -#define H5FS_PACKAGE /*suppress error about including H5FSpkg */ +#include "H5FSmodule.h" /* This source code file is part of the H5FS module */ /***********/ @@ -126,8 +126,8 @@ H5FL_DEFINE(H5FS_sinfo_t); H5FS_sinfo_t * H5FS_sinfo_new(H5F_t *f, H5FS_t *fspace) { - H5FS_sinfo_t *sinfo = NULL; /* Section information struct created */ - H5FS_sinfo_t *ret_value; /* Return value */ + H5FS_sinfo_t *sinfo = NULL; /* Section information struct created */ + H5FS_sinfo_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT diff --git a/src/H5FSstat.c b/src/H5FSstat.c index 66c5495..390eb9f 100644 --- a/src/H5FSstat.c +++ b/src/H5FSstat.c @@ -22,7 +22,8 @@ /* Module Setup */ /****************/ -#define H5FS_PACKAGE /*suppress error about including H5FSpkg */ +#include "H5FSmodule.h" /* This source code file is part of the H5FS module */ + /***********/ /* Headers */ @@ -31,6 +32,7 @@ #include "H5Eprivate.h" /* Error handling */ #include "H5FSpkg.h" /* Free-space manager */ + /****************/ /* Local Macros */ /****************/ diff --git a/src/H5FStest.c b/src/H5FStest.c index 63ba94c..f96ee75 100644 --- a/src/H5FStest.c +++ b/src/H5FStest.c @@ -22,9 +22,10 @@ /* Module Setup */ /****************/ -#define H5FS_PACKAGE /*suppress error about including H5FSpkg */ +#include "H5FSmodule.h" /* This source code file is part of the H5FS module */ #define H5FS_TESTING /*suppress warning about H5FS testing funcs */ + /***********/ /* Headers */ /***********/ @@ -32,6 +33,7 @@ #include "H5Eprivate.h" /* Error handling */ #include "H5FSpkg.h" /* Free-space manager */ + /****************/ /* Local Macros */ /****************/ diff --git a/src/H5Faccum.c b/src/H5Faccum.c index 99f83bd..53f51ad 100644 --- a/src/H5Faccum.c +++ b/src/H5Faccum.c @@ -30,7 +30,7 @@ /* Module Setup */ /****************/ -#define H5F_PACKAGE /*suppress error about including H5Fpkg */ +#include "H5Fmodule.h" /* This source code file is part of the H5F module */ /***********/ diff --git a/src/H5Fcwfs.c b/src/H5Fcwfs.c index 36f0a93..32c73b0 100644 --- a/src/H5Fcwfs.c +++ b/src/H5Fcwfs.c @@ -35,7 +35,7 @@ /* Module Setup */ /****************/ -#define H5F_PACKAGE /*suppress error about including H5Fpkg */ +#include "H5Fmodule.h" /* This source code file is part of the H5F module */ /***********/ @@ -260,8 +260,9 @@ herr_t H5F_cwfs_advance_heap(H5F_t *f, H5HG_heap_t *heap, hbool_t add_heap) { unsigned u; /* Local index variable */ + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOERR + FUNC_ENTER_NOAPI(FAIL) /* Check args */ HDassert(f); @@ -281,7 +282,8 @@ H5F_cwfs_advance_heap(H5F_t *f, H5HG_heap_t *heap, hbool_t add_heap) f->shared->cwfs[f->shared->ncwfs - 1] = heap; } /* end if */ - FUNC_LEAVE_NOAPI(SUCCEED) +done: + FUNC_LEAVE_NOAPI(ret_value) } /* H5F_cwfs_advance_heap() */ @@ -302,8 +304,9 @@ herr_t H5F_cwfs_remove_heap(H5F_file_t *shared, H5HG_heap_t *heap) { unsigned u; /* Local index variable */ + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOERR + FUNC_ENTER_NOAPI(FAIL) /* Check args */ HDassert(shared); @@ -318,6 +321,7 @@ H5F_cwfs_remove_heap(H5F_file_t *shared, H5HG_heap_t *heap) } /* end if */ } /* end for */ - FUNC_LEAVE_NOAPI(SUCCEED) +done: + FUNC_LEAVE_NOAPI(ret_value) } /* H5F_cwfs_remove_heap() */ diff --git a/src/H5Fdbg.c b/src/H5Fdbg.c index 93da900..11accc6 100644 --- a/src/H5Fdbg.c +++ b/src/H5Fdbg.c @@ -19,8 +19,8 @@ * Purpose: File object debugging functions. */ -#define H5F_PACKAGE /*suppress error about including H5Fpkg */ -#define H5G_PACKAGE /*suppress error about including H5Gpkg */ +#include "H5Fmodule.h" /* This source code file is part of the H5F module */ +#define H5G_FRIEND /*suppress error about including H5Gpkg */ #include "H5private.h" /* Generic Functions */ diff --git a/src/H5Fdeprec.c b/src/H5Fdeprec.c index 7e2ea17..d16e2d4 100644 --- a/src/H5Fdeprec.c +++ b/src/H5Fdeprec.c @@ -31,10 +31,7 @@ /* Module Setup */ /****************/ -#define H5F_PACKAGE /*suppress error about including H5Fpkg */ - -/* Interface initialization */ -#define H5_INTERFACE_INIT_FUNC H5F__init_deprec_interface +#include "H5Fmodule.h" /* This source code file is part of the H5F module */ /***********/ @@ -82,51 +79,6 @@ /*******************/ - -/*-------------------------------------------------------------------------- -NAME - H5F__init_deprec_interface -- Initialize interface-specific information -USAGE - herr_t H5F__init_deprec_interface() -RETURNS - Non-negative on success/Negative on failure -DESCRIPTION - Initializes any interface-specific data or routines. (Just calls - H5F_init() currently). - ---------------------------------------------------------------------------*/ -static herr_t -H5F__init_deprec_interface(void) -{ - FUNC_ENTER_STATIC_NOERR - - FUNC_LEAVE_NOAPI(H5F_init()) -} /* H5F__init_deprec_interface() */ - - -/*-------------------------------------------------------------------------- -NAME - H5F__term_deprec_interface -- Terminate interface -USAGE - herr_t H5F__term_deprec_interface() -RETURNS - Non-negative on success/Negative on failure -DESCRIPTION - Terminates interface. (Just resets H5_interface_initialize_g - currently). - ---------------------------------------------------------------------------*/ -herr_t -H5F__term_deprec_interface(void) -{ - FUNC_ENTER_PACKAGE_NOERR - - /* Mark closed */ - H5_interface_initialize_g = 0; - - FUNC_LEAVE_NOAPI(0) -} /* H5F__term_deprec_interface() */ - #ifndef H5_NO_DEPRECATED_SYMBOLS /*------------------------------------------------------------------------- diff --git a/src/H5Fefc.c b/src/H5Fefc.c index 9916002..831b737 100644 --- a/src/H5Fefc.c +++ b/src/H5Fefc.c @@ -26,7 +26,7 @@ *------------------------------------------------------------------------- */ -#define H5F_PACKAGE /*suppress error about including H5Fpkg */ +#include "H5Fmodule.h" /* This source code file is part of the H5F module */ /* Packages needed by this file... */ @@ -92,7 +92,7 @@ H5F_efc_t * H5F_efc_create(unsigned max_nfiles) { H5F_efc_t *efc = NULL; /* EFC object */ - H5F_efc_t *ret_value; /* Return value */ + H5F_efc_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI(NULL) diff --git a/src/H5Ffake.c b/src/H5Ffake.c index af048bc..e191003 100644 --- a/src/H5Ffake.c +++ b/src/H5Ffake.c @@ -13,10 +13,7 @@ * access to either file, you may request a copy from help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#define H5F_PACKAGE /*suppress error about including H5Fpkg */ - -/* Interface initialization */ -#define H5_INTERFACE_INIT_FUNC H5F_init_fake_interface +#include "H5Fmodule.h" /* This source code file is part of the H5F module */ /* Packages needed by this file... */ @@ -27,28 +24,6 @@ /* PRIVATE PROTOTYPES */ -/*-------------------------------------------------------------------------- -NAME - H5F_init_fake_interface -- Initialize interface-specific information -USAGE - herr_t H5F_init_fake_interface() - -RETURNS - Non-negative on success/Negative on failure -DESCRIPTION - Initializes any interface-specific data or routines. (Just calls - H5F_init() currently). - ---------------------------------------------------------------------------*/ -static herr_t -H5F_init_fake_interface(void) -{ - FUNC_ENTER_NOAPI_NOINIT_NOERR - - FUNC_LEAVE_NOAPI(H5F_init()) -} /* H5F_init_fake_interface() */ - - /*------------------------------------------------------------------------- * Function: H5F_fake_alloc * @@ -70,7 +45,7 @@ H5F_t * H5F_fake_alloc(uint8_t sizeof_size) { H5F_t *f = NULL; /* Pointer to fake file struct */ - H5F_t *ret_value; /* Return value */ + H5F_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI(NULL) diff --git a/src/H5Fint.c b/src/H5Fint.c index 0e77349..209eadd 100644 --- a/src/H5Fint.c +++ b/src/H5Fint.c @@ -17,10 +17,7 @@ /* Module Setup */ /****************/ -#define H5F_PACKAGE /*suppress error about including H5Fpkg */ - -/* Interface initialization */ -#define H5_INTERFACE_INIT_FUNC H5F_init_interface +#include "H5Fmodule.h" /* This source code file is part of the H5F module */ /***********/ @@ -103,30 +100,6 @@ H5FL_DEFINE(H5F_file_t); /*------------------------------------------------------------------------- - * Function: H5F_init_interface - * - * Purpose: Initialize interface-specific information. - * - * Return: Success: non-negative - * Failure: negative - * - * Programmer: Robb Matzke - * Friday, November 20, 1998 - * - *------------------------------------------------------------------------- - */ -static herr_t -H5F_init_interface(void) -{ - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI_NOINIT_NOERR - - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5F_init_interface() */ - - -/*------------------------------------------------------------------------- * Function: H5F_get_access_plist * * Purpose: Returns a copy of the file access property list of the @@ -533,7 +506,7 @@ H5F_is_hdf5(const char *name) { H5FD_t *file = NULL; /* Low-level file struct */ haddr_t sig_addr; /* Addess of hdf5 file signature */ - htri_t ret_value; /* Return value */ + htri_t ret_value = FAIL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -581,7 +554,7 @@ done: H5F_t * H5F_new(H5F_file_t *shared, unsigned flags, hid_t fcpl_id, hid_t fapl_id, H5FD_t *lf) { - H5F_t *f = NULL, *ret_value; + H5F_t *f = NULL, *ret_value = NULL; FUNC_ENTER_NOAPI_NOINIT @@ -955,7 +928,7 @@ H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id, H5FD_class_t *drvr; /*file driver class info */ H5P_genplist_t *a_plist; /*file access property list */ H5F_close_degree_t fc_degree; /*file close degree */ - H5F_t *ret_value; /*actual return value */ + H5F_t *ret_value = NULL; /*actual return value */ FUNC_ENTER_NOAPI(NULL) @@ -1454,7 +1427,7 @@ done: hid_t H5F_get_id(H5F_t *file, hbool_t app_ref) { - hid_t ret_value; + hid_t ret_value = H5I_INVALID_HID; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -1978,7 +1951,7 @@ H5F_get_file_image(H5F_t *file, void *buf_ptr, size_t buf_len) { H5FD_t *fd_ptr; /* file driver */ haddr_t eoa; /* End of file address */ - ssize_t ret_value; /* Return value */ + ssize_t ret_value = -1; /* Return value */ FUNC_ENTER_NOAPI_NOINIT diff --git a/src/H5Fio.c b/src/H5Fio.c index 763bd69..04c4055 100644 --- a/src/H5Fio.c +++ b/src/H5Fio.c @@ -28,7 +28,7 @@ /* Module Setup */ /****************/ -#define H5F_PACKAGE /*suppress error about including H5Fpkg */ +#include "H5Fmodule.h" /* This source code file is part of the H5F module */ /***********/ diff --git a/src/H5Fmodule.h b/src/H5Fmodule.h new file mode 100644 index 0000000..4bb2506 --- /dev/null +++ b/src/H5Fmodule.h @@ -0,0 +1,35 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* + * Programmer: Quincey Koziol + * Saturday, September 12, 2015 + * + * Purpose: This file contains declarations which define macros for the + * H5F package. Including this header means that the source file + * is part of the H5F package. + */ +#ifndef _H5Fmodule_H +#define _H5Fmodule_H + +/* Define the proper control macros for the generic FUNC_ENTER/LEAVE and error + * reporting macros. + */ +#define H5F_MODULE +#define H5_MY_PKG H5F +#define H5_MY_PKG_ERR H5E_FILE +#define H5_MY_PKG_INIT YES + +#endif /* _H5Fmodule_H */ + diff --git a/src/H5Fmount.c b/src/H5Fmount.c index 643eba5..99fa4f2 100644 --- a/src/H5Fmount.c +++ b/src/H5Fmount.c @@ -13,10 +13,7 @@ * access to either file, you may request a copy from help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#define H5F_PACKAGE /*suppress error about including H5Fpkg */ - -/* Interface initialization */ -#define H5_INTERFACE_INIT_FUNC H5F_init_mount_interface +#include "H5Fmodule.h" /* This source code file is part of the H5F module */ /* Packages needed by this file... */ @@ -36,28 +33,6 @@ static herr_t H5F_unmount(H5G_loc_t *loc, const char *name, hid_t dxpl_id); static void H5F_mount_count_ids_recurse(H5F_t *f, unsigned *nopen_files, unsigned *nopen_objs); -/*-------------------------------------------------------------------------- -NAME - H5F_init_mount_interface -- Initialize interface-specific information -USAGE - herr_t H5F_init_mount_interface() - -RETURNS - Non-negative on success/Negative on failure -DESCRIPTION - Initializes any interface-specific data or routines. (Just calls - H5F_init() currently). - ---------------------------------------------------------------------------*/ -static herr_t -H5F_init_mount_interface(void) -{ - FUNC_ENTER_NOAPI_NOINIT_NOERR - - FUNC_LEAVE_NOAPI(H5F_init()) -} /* H5F_init_mount_interface() */ - - /*------------------------------------------------------------------------- * Function: H5F_close_mounts * @@ -439,7 +414,7 @@ done: hbool_t H5F_is_mount(const H5F_t *file) { - hbool_t ret_value; /* Return value */ + hbool_t ret_value = FALSE; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_NOERR diff --git a/src/H5Fmpi.c b/src/H5Fmpi.c index 39b8dfa..fe2a774 100644 --- a/src/H5Fmpi.c +++ b/src/H5Fmpi.c @@ -28,7 +28,7 @@ /* Module Setup */ /****************/ -#define H5F_PACKAGE /*suppress error about including H5Fpkg */ +#include "H5Fmodule.h" /* This source code file is part of the H5F module */ /***********/ diff --git a/src/H5Fpkg.h b/src/H5Fpkg.h index 175fa88..2255085 100644 --- a/src/H5Fpkg.h +++ b/src/H5Fpkg.h @@ -21,7 +21,7 @@ * the H5F package. Source files outside the H5F package should * include H5Fprivate.h instead. */ -#ifndef H5F_PACKAGE +#if !(defined H5F_FRIEND || defined H5F_MODULE) #error "Do not include this file outside the H5F package!" #endif @@ -333,8 +333,6 @@ H5_DLLVAR const H5AC_class_t H5AC_DRVRINFO[1]; /******************************/ /* General routines */ -H5_DLL herr_t H5F_init(void); -H5_DLL herr_t H5F__term_deprec_interface(void); H5F_t *H5F_new(H5F_file_t *shared, unsigned flags, hid_t fcpl_id, hid_t fapl_id, H5FD_t *lf); herr_t H5F_dest(H5F_t *f, hid_t dxpl_id, hbool_t flush); diff --git a/src/H5Fprivate.h b/src/H5Fprivate.h index 36d7429..86602fd 100644 --- a/src/H5Fprivate.h +++ b/src/H5Fprivate.h @@ -270,7 +270,7 @@ ((O1) >= (O2) && (O1) < ((O2) + (L2)))) /* If the module using this macro is allowed access to the private variables, access them directly */ -#ifdef H5F_PACKAGE +#ifdef H5F_MODULE #define H5F_INTENT(F) ((F)->shared->flags) #define H5F_OPEN_NAME(F) ((F)->open_name) #define H5F_ACTUAL_NAME(F) ((F)->actual_name) @@ -312,7 +312,7 @@ #define H5F_SET_GRP_BTREE_SHARED(F, RC) (((F)->shared->grp_btree_shared = (RC)) ? SUCCEED : FAIL) #define H5F_USE_TMP_SPACE(F) ((F)->shared->use_tmp_space) #define H5F_IS_TMP_ADDR(F, ADDR) (H5F_addr_le((F)->shared->tmp_addr, (ADDR))) -#else /* H5F_PACKAGE */ +#else /* H5F_MODULE */ #define H5F_INTENT(F) (H5F_get_intent(F)) #define H5F_OPEN_NAME(F) (H5F_get_open_name(F)) #define H5F_ACTUAL_NAME(F) (H5F_get_actual_name(F)) @@ -354,7 +354,7 @@ #define H5F_SET_GRP_BTREE_SHARED(F, RC) (H5F_set_grp_btree_shared((F), (RC))) #define H5F_USE_TMP_SPACE(F) (H5F_use_tmp_space(F)) #define H5F_IS_TMP_ADDR(F, ADDR) (H5F_is_tmp_addr((F), (ADDR))) -#endif /* H5F_PACKAGE */ +#endif /* H5F_MODULE */ /* Macros to encode/decode offset/length's for storing in the file */ diff --git a/src/H5Fquery.c b/src/H5Fquery.c index 6290614..05667ac 100644 --- a/src/H5Fquery.c +++ b/src/H5Fquery.c @@ -28,7 +28,7 @@ /* Module Setup */ /****************/ -#define H5F_PACKAGE /*suppress error about including H5Fpkg */ +#include "H5Fmodule.h" /* This source code file is part of the H5F module */ /***********/ @@ -968,7 +968,7 @@ done: haddr_t H5F_get_eoa(const H5F_t *f, H5FD_mem_t type) { - haddr_t ret_value; + haddr_t ret_value = HADDR_UNDEF; /* Return value */ FUNC_ENTER_NOAPI(HADDR_UNDEF) diff --git a/src/H5Fsfile.c b/src/H5Fsfile.c index a1c6976..4fb9cd9 100644 --- a/src/H5Fsfile.c +++ b/src/H5Fsfile.c @@ -13,7 +13,7 @@ * access to either file, you may request a copy from help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#define H5F_PACKAGE /*suppress error about including H5Fpkg */ +#include "H5Fmodule.h" /* This source code file is part of the H5F module */ /* Packages needed by this file... */ #include "H5private.h" /* Generic Functions */ diff --git a/src/H5Fsuper.c b/src/H5Fsuper.c index d353d4f..50f6b06 100644 --- a/src/H5Fsuper.c +++ b/src/H5Fsuper.c @@ -17,10 +17,7 @@ /* Module Setup */ /****************/ -#define H5F_PACKAGE /*suppress error about including H5Fpkg */ - -/* Interface initialization */ -#define H5_INTERFACE_INIT_FUNC H5F_init_super_interface +#include "H5Fmodule.h" /* This source code file is part of the H5F module */ /***********/ @@ -77,28 +74,6 @@ H5FL_DEFINE(H5F_super_t); -/*-------------------------------------------------------------------------- -NAME - H5F_init_super_interface -- Initialize interface-specific information -USAGE - herr_t H5F_init_super_interface() - -RETURNS - Non-negative on success/Negative on failure -DESCRIPTION - Initializes any interface-specific data or routines. (Just calls - H5F_init() currently). - ---------------------------------------------------------------------------*/ -static herr_t -H5F_init_super_interface(void) -{ - FUNC_ENTER_NOAPI_NOINIT_NOERR - - FUNC_LEAVE_NOAPI(H5F_init()) -} /* H5F_init_super_interface() */ - - /*------------------------------------------------------------------------- * Function: H5F_super_ext_create * diff --git a/src/H5Fsuper_cache.c b/src/H5Fsuper_cache.c index 477f58f..c2c7bc9 100644 --- a/src/H5Fsuper_cache.c +++ b/src/H5Fsuper_cache.c @@ -28,8 +28,8 @@ /* Module Setup */ /****************/ -#define H5F_PACKAGE /*suppress error about including H5Fpkg */ -#define H5G_PACKAGE /*suppress error about including H5Gpkg */ +#include "H5Fmodule.h" /* This source code file is part of the H5F module */ +#define H5G_FRIEND /*suppress error about including H5Gpkg */ /***********/ @@ -199,7 +199,7 @@ H5F__cache_superblock_deserialize(const void *_image, size_t len, void *_udata, unsigned super_vers; /* Superblock version */ uint8_t sizeof_addr; /* Size of offsets in the file (in bytes) */ uint8_t sizeof_size; /* Size of lengths in the file (in bytes) */ - H5F_super_t *ret_value; /* Return value */ + H5F_super_t *ret_value = NULL; /* Return value */ FUNC_ENTER_STATIC @@ -824,7 +824,7 @@ H5F__cache_drvrinfo_deserialize(const void *_image, size_t len, void *_udata, const uint8_t *image = (const uint8_t *)_image; /* Pointer into raw data buffer */ char drv_name[9]; /* Name of driver */ unsigned drv_vers; /* Version of driver info block */ - H5O_drvinfo_t *ret_value; /* Return value */ + H5O_drvinfo_t *ret_value = NULL; /* Return value */ FUNC_ENTER_STATIC diff --git a/src/H5Ftest.c b/src/H5Ftest.c index 73b00a6..b741e0d 100644 --- a/src/H5Ftest.c +++ b/src/H5Ftest.c @@ -28,12 +28,12 @@ /* Module Setup */ /****************/ -#define H5F_PACKAGE /*suppress error about including H5Fpkg */ +#include "H5Fmodule.h" /* This source code file is part of the H5F module */ #define H5F_TESTING /*suppress warning about H5F testing funcs*/ -#define H5SM_PACKAGE /*suppress error about including H5SMpkg */ -#define H5SM_TESTING /*suppress warning about H5SM testing funcs*/ -#define H5G_PACKAGE /*suppress error about including H5Gpkg */ +#define H5G_FRIEND /*suppress error about including H5Gpkg */ #define H5G_TESTING /*suppress warning about H5G testing funcs*/ +#define H5SM_FRIEND /*suppress error about including H5SMpkg */ +#define H5SM_TESTING /*suppress warning about H5SM testing funcs*/ /***********/ diff --git a/src/H5G.c b/src/H5G.c index 8fd65b8..089dc50 100644 --- a/src/H5G.c +++ b/src/H5G.c @@ -79,10 +79,7 @@ /* Module Setup */ /****************/ -#define H5G_PACKAGE /*suppress error about including H5Gpkg */ - -/* Interface initialization */ -#define H5_INTERFACE_INIT_FUNC H5G_init_interface +#include "H5Gmodule.h" /* This source code file is part of the H5G module */ /***********/ @@ -120,6 +117,9 @@ /* Package Variables */ /*********************/ +/* Package initialization variable */ +hbool_t H5_PKG_INIT_VAR = FALSE; + /*****************************/ /* Library Private Variables */ @@ -138,36 +138,13 @@ static const H5I_class_t H5I_GROUP_CLS[1] = {{ (H5I_free_t)H5G_close /* Callback routine for closing objects of this class */ }}; +/* Flag indicating "top" of interface has been initialized */ +static hbool_t H5G_top_package_initialize_s = FALSE; - -/*------------------------------------------------------------------------- - * Function: H5G__init - * - * Purpose: Initialize the interface from some other package. - * - * Return: Success: non-negative - * Failure: negative - * - * Programmer: Quincey Koziol - * Saturday, November 11, 2006 - * - *------------------------------------------------------------------------- - */ -herr_t -H5G__init(void) -{ - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(FAIL) - /* FUNC_ENTER() does all the work */ - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G__init() */ /*------------------------------------------------------------------------- - * Function: H5G_init_interface + * Function: H5G__init_package * * Purpose: Initializes the H5G interface. * @@ -177,7 +154,7 @@ done: * Monday, January 5, 1998 * * Notes: The group creation properties are registered in the property - * list interface initialization routine (H5P_init_interface) + * list interface initialization routine (H5P_init_package) * so that the file creation property class can inherit from it * correctly. (Which allows the file creation property list to * control the group creation properties of the root group of @@ -185,64 +162,100 @@ done: * *------------------------------------------------------------------------- */ -static herr_t -H5G_init_interface(void) +herr_t +H5G__init_package(void) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* Initialize the atom group for the group IDs */ if(H5I_register_type(H5I_GROUP_CLS) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to initialize interface") + /* Mark "top" of interface as initialized, too */ + H5G_top_package_initialize_s = TRUE; + done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_init_interface() */ +} /* end H5G__init_package() */ /*------------------------------------------------------------------------- - * Function: H5G_term_interface + * Function: H5G_top_term_package * - * Purpose: Terminates the H5G interface + * Purpose: Close the "top" of the interface, releasing IDs, etc. * * Return: Success: Positive if anything is done that might * affect other interfaces; zero otherwise. - * * Failure: Negative. * - * Programmer: Robb Matzke - * Monday, January 5, 1998 + * Programmer: Quincey Koziol + * Sunday, September 13, 2015 * *------------------------------------------------------------------------- */ int -H5G_term_interface(void) +H5G_top_term_package(void) { int n = 0; FUNC_ENTER_NOAPI_NOINIT_NOERR - if(H5_interface_initialize_g) { + if(H5G_top_package_initialize_s) { if(H5I_nmembers(H5I_GROUP) > 0) { (void)H5I_clear_type(H5I_GROUP, FALSE, FALSE); n++; /*H5I*/ } /* end if */ - else { - /* Close deprecated interface */ - n += H5G__term_deprec_interface(); - /* Destroy the group object id group */ - (void)H5I_dec_type_ref(H5I_GROUP); - n++; /*H5I*/ + /* Mark closed */ + if(0 == n) + H5G_top_package_initialize_s = FALSE; + } /* end if */ + + FUNC_LEAVE_NOAPI(n) +} /* end H5G_top_term_package() */ + + +/*------------------------------------------------------------------------- + * Function: H5G_term_package + * + * Purpose: Terminates the H5G interface + * + * Note: Finishes shutting down the interface, after + * H5G_top_term_package() is called + * + * Return: Success: Positive if anything is done that might + * affect other interfaces; zero otherwise. + * Failure: Negative. + * + * Programmer: Robb Matzke + * Monday, January 5, 1998 + * + *------------------------------------------------------------------------- + */ +int +H5G_term_package(void) +{ + int n = 0; + + FUNC_ENTER_NOAPI_NOINIT_NOERR + + if(H5_PKG_INIT_VAR) { + /* Sanity checks */ + HDassert(0 == H5I_nmembers(H5I_GROUP)); + HDassert(FALSE == H5G_top_package_initialize_s); + + /* Destroy the group object id group */ + n += (H5I_dec_type_ref(H5I_GROUP) > 0); - /* Mark closed */ - H5_interface_initialize_g = 0; - } /* end else */ + /* Mark closed */ + if(0 == n) + H5_PKG_INIT_VAR = FALSE; } /* end if */ FUNC_LEAVE_NOAPI(n) -} /* end H5G_term_interface() */ +} /* end H5G_term_package() */ /*------------------------------------------------------------------------- diff --git a/src/H5Gbtree2.c b/src/H5Gbtree2.c index 31db886..104e6b3 100644 --- a/src/H5Gbtree2.c +++ b/src/H5Gbtree2.c @@ -28,7 +28,7 @@ /* Module Setup */ /****************/ -#define H5G_PACKAGE /*suppress error about including H5Gpkg */ +#include "H5Gmodule.h" /* This source code file is part of the H5G module */ /***********/ @@ -232,7 +232,7 @@ H5G_dense_btree2_name_compare(const void *_bt2_udata, const void *_bt2_rec) { const H5G_bt2_ud_common_t *bt2_udata = (const H5G_bt2_ud_common_t *)_bt2_udata; const H5G_dense_bt2_name_rec_t *bt2_rec = (const H5G_dense_bt2_name_rec_t *)_bt2_rec; - herr_t ret_value; /* Return value */ + herr_t ret_value = FAIL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -420,7 +420,7 @@ H5G_dense_btree2_corder_compare(const void *_bt2_udata, const void *_bt2_rec) { const H5G_bt2_ud_common_t *bt2_udata = (const H5G_bt2_ud_common_t *)_bt2_udata; const H5G_dense_bt2_corder_rec_t *bt2_rec = (const H5G_dense_bt2_corder_rec_t *)_bt2_rec; - herr_t ret_value; /* Return value */ + herr_t ret_value = FAIL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_NOERR diff --git a/src/H5Gcache.c b/src/H5Gcache.c index f765b41..e7d44b5 100644 --- a/src/H5Gcache.c +++ b/src/H5Gcache.c @@ -28,7 +28,7 @@ /* Module Setup */ /****************/ -#define H5G_PACKAGE /*suppress error about including H5Gpkg */ +#include "H5Gmodule.h" /* This source code file is part of the H5G module */ /***********/ @@ -178,7 +178,7 @@ H5G__cache_node_deserialize(const void *_image, size_t len, void *_udata, H5F_t *f = (H5F_t *)_udata; /* User data for callback */ H5G_node_t *sym = NULL; /* Symbol table node created */ const uint8_t *image = (const uint8_t *)_image; /* Pointer to image to deserialize */ - void * ret_value; /* Return value */ + void *ret_value = NULL; /* Return value */ FUNC_ENTER_STATIC diff --git a/src/H5Gcompact.c b/src/H5Gcompact.c index 89e79cc..41ca4f5 100644 --- a/src/H5Gcompact.c +++ b/src/H5Gcompact.c @@ -23,7 +23,7 @@ * *------------------------------------------------------------------------- */ -#define H5G_PACKAGE /*suppress error about including H5Gpkg */ +#include "H5Gmodule.h" /* This source code file is part of the H5G module */ /* Packages needed by this file... */ @@ -224,8 +224,8 @@ H5G__compact_get_name_by_idx(const H5O_loc_t *oloc, hid_t dxpl_id, const H5O_linfo_t *linfo, H5_index_t idx_type, H5_iter_order_t order, hsize_t idx, char* name, size_t size) { - H5G_link_table_t ltable = {0, NULL}; /* Link table */ - ssize_t ret_value; /* Return value */ + H5G_link_table_t ltable = {0, NULL}; /* Link table */ + ssize_t ret_value = -1; /* Return value */ FUNC_ENTER_PACKAGE @@ -411,7 +411,7 @@ H5G__compact_iterate(const H5O_loc_t *oloc, hid_t dxpl_id, const H5O_linfo_t *li H5G_lib_iterate_t op, void *op_data) { H5G_link_table_t ltable = {0, NULL}; /* Link table */ - herr_t ret_value; /* Return value */ + herr_t ret_value = FAIL; /* Return value */ FUNC_ENTER_PACKAGE @@ -503,7 +503,7 @@ H5G__compact_lookup(const H5O_loc_t *oloc, const char *name, H5O_link_t *lnk, { H5G_iter_lkp_t udata; /* User data for iteration callback */ H5O_mesg_operator_t op; /* Message operator */ - htri_t ret_value; /* Return value */ + htri_t ret_value = FAIL; /* Return value */ FUNC_ENTER_PACKAGE @@ -598,7 +598,7 @@ H5G__compact_get_type_by_idx(H5O_loc_t *oloc, hid_t dxpl_id, const H5O_linfo_t * hsize_t idx) { H5G_link_table_t ltable = {0, NULL}; /* Link table */ - H5G_obj_t ret_value; /* Return value */ + H5G_obj_t ret_value = H5G_UNKNOWN; /* Return value */ FUNC_ENTER_PACKAGE diff --git a/src/H5Gdense.c b/src/H5Gdense.c index 285355f..ab0547b 100644 --- a/src/H5Gdense.c +++ b/src/H5Gdense.c @@ -29,7 +29,7 @@ /* Module Setup */ /****************/ -#define H5G_PACKAGE /*suppress error about including H5Gpkg */ +#include "H5Gmodule.h" /* This source code file is part of the H5G module */ /***********/ /* Headers */ @@ -540,7 +540,7 @@ H5G__dense_lookup(H5F_t *f, hid_t dxpl_id, const H5O_linfo_t *linfo, H5G_bt2_ud_common_t udata; /* User data for v2 B-tree link lookup */ H5HF_t *fheap = NULL; /* Fractal heap handle */ H5B2_t *bt2_name = NULL; /* v2 B-tree handle for name index */ - htri_t ret_value; /* Return value */ + htri_t ret_value = FAIL; /* Return value */ FUNC_ENTER_PACKAGE @@ -991,7 +991,7 @@ H5G__dense_iterate(H5F_t *f, hid_t dxpl_id, const H5O_linfo_t *linfo, H5G_link_table_t ltable = {0, NULL}; /* Table of links */ H5B2_t *bt2 = NULL; /* v2 B-tree handle for index */ haddr_t bt2_addr; /* Address of v2 B-tree to use for lookup */ - herr_t ret_value; /* Return value */ + herr_t ret_value = FAIL; /* Return value */ FUNC_ENTER_PACKAGE @@ -1197,7 +1197,7 @@ H5G__dense_get_name_by_idx(H5F_t *f, hid_t dxpl_id, H5O_linfo_t *linfo, H5G_link_table_t ltable = {0, NULL}; /* Table of links */ H5B2_t *bt2 = NULL; /* v2 B-tree handle for index */ haddr_t bt2_addr; /* Address of v2 B-tree to use for lookup */ - ssize_t ret_value; /* Return value */ + ssize_t ret_value = -1; /* Return value */ FUNC_ENTER_PACKAGE @@ -1836,8 +1836,8 @@ H5G_obj_t H5G__dense_get_type_by_idx(H5F_t *f, hid_t dxpl_id, H5O_linfo_t *linfo, hsize_t idx) { - H5G_link_table_t ltable = {0, NULL}; /* Table of links */ - H5G_obj_t ret_value; /* Return value */ + H5G_link_table_t ltable = {0, NULL}; /* Table of links */ + H5G_obj_t ret_value = H5G_UNKNOWN; /* Return value */ FUNC_ENTER_PACKAGE diff --git a/src/H5Gdeprec.c b/src/H5Gdeprec.c index 4e3572e..e0bc78e 100644 --- a/src/H5Gdeprec.c +++ b/src/H5Gdeprec.c @@ -31,10 +31,7 @@ /* Module Setup */ /****************/ -#define H5G_PACKAGE /*suppress error about including H5Gpkg */ - -/* Interface initialization */ -#define H5_INTERFACE_INIT_FUNC H5G__init_deprec_interface +#include "H5Gmodule.h" /* This source code file is part of the H5G module */ /***********/ @@ -106,51 +103,6 @@ static H5G_obj_t H5G_obj_get_type_by_idx(H5O_loc_t *oloc, hsize_t idx, /*******************/ - -/*-------------------------------------------------------------------------- -NAME - H5G__init_deprec_interface -- Initialize interface-specific information -USAGE - herr_t H5G__init_deprec_interface() -RETURNS - Non-negative on success/Negative on failure -DESCRIPTION - Initializes any interface-specific data or routines. (Just calls - H5G__init() currently). - ---------------------------------------------------------------------------*/ -static herr_t -H5G__init_deprec_interface(void) -{ - FUNC_ENTER_STATIC_NOERR - - FUNC_LEAVE_NOAPI(H5G__init()) -} /* H5G__init_deprec_interface() */ - - -/*-------------------------------------------------------------------------- -NAME - H5G__term_deprec_interface -- Terminate interface -USAGE - herr_t H5G__term_deprec_interface() -RETURNS - Non-negative on success/Negative on failure -DESCRIPTION - Terminates interface. (Just resets H5_interface_initialize_g - currently). - ---------------------------------------------------------------------------*/ -herr_t -H5G__term_deprec_interface(void) -{ - FUNC_ENTER_PACKAGE_NOERR - - /* Mark closed */ - H5_interface_initialize_g = 0; - - FUNC_LEAVE_NOAPI(0) -} /* H5G__term_deprec_interface() */ - #ifndef H5_NO_DEPRECATED_SYMBOLS /*------------------------------------------------------------------------- @@ -168,7 +120,7 @@ H5G__term_deprec_interface(void) H5G_obj_t H5G_map_obj_type(H5O_type_t obj_type) { - H5G_obj_t ret_value; /* Return value */ + H5G_obj_t ret_value = H5G_UNKNOWN; /* Return value */ /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -1164,7 +1116,7 @@ H5G_obj_get_type_by_idx(H5O_loc_t *oloc, hsize_t idx, hid_t dxpl_id) { H5O_linfo_t linfo; /* Link info message */ htri_t linfo_exists; /* Whether the link info message exists */ - H5G_obj_t ret_value; /* Return value */ + H5G_obj_t ret_value = H5G_UNKNOWN; /* Return value */ FUNC_ENTER_NOAPI_TAG(dxpl_id, oloc->addr, H5G_UNKNOWN) diff --git a/src/H5Gent.c b/src/H5Gent.c index 3809933..8df8414 100644 --- a/src/H5Gent.c +++ b/src/H5Gent.c @@ -22,7 +22,7 @@ /* Module Setup */ /****************/ -#define H5G_PACKAGE /*suppress error about including H5Gpkg */ +#include "H5Gmodule.h" /* This source code file is part of the H5G module */ /***********/ diff --git a/src/H5Gint.c b/src/H5Gint.c index 04b21a5..ea8288c 100644 --- a/src/H5Gint.c +++ b/src/H5Gint.c @@ -28,10 +28,7 @@ /* Module Setup */ /****************/ -#define H5G_PACKAGE /*suppress error about including H5Gpkg */ - -/* Interface initialization */ -#define H5_INTERFACE_INIT_FUNC H5G_init_int_interface +#include "H5Gmodule.h" /* This source code file is part of the H5G module */ /***********/ @@ -119,34 +116,6 @@ H5FL_DEFINE(H5_obj_t); -/*-------------------------------------------------------------------------- -NAME - H5G_init_int_interface -- Initialize interface-specific information -USAGE - herr_t H5G_init_int_interface() -RETURNS - Non-negative on success/Negative on failure -DESCRIPTION - Initializes any interface-specific data or routines. (Just calls - H5G__init() currently). - ---------------------------------------------------------------------------*/ -static herr_t -H5G_init_int_interface(void) -{ - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI_NOINIT - - /* Funnel all work to H5G__init() */ - if(H5G__init() < 0) - HGOTO_ERROR(H5E_FUNC, H5E_CANTINIT, FAIL, "interface initialization failed") - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* H5G_init_int_interface() */ - - /*------------------------------------------------------------------------- * Function: H5G__create_named * @@ -167,7 +136,7 @@ H5G__create_named(const H5G_loc_t *loc, const char *name, hid_t lcpl_id, { H5O_obj_create_t ocrt_info; /* Information for object creation */ H5G_obj_create_t gcrt_info; /* Information for group creation */ - H5G_t *ret_value; /* Return value */ + H5G_t *ret_value = NULL; /* Return value */ FUNC_ENTER_PACKAGE @@ -225,7 +194,7 @@ H5G__create(H5F_t *file, H5G_obj_create_t *gcrt_info, hid_t dxpl_id) { H5G_t *grp = NULL; /*new group */ unsigned oloc_init = 0; /* Flag to indicate that the group object location was created successfully */ - H5G_t *ret_value; /* Return value */ + H5G_t *ret_value = NULL; /* Return value */ FUNC_ENTER_PACKAGE @@ -302,7 +271,7 @@ H5G__open_name(const H5G_loc_t *loc, const char *name, hid_t gapl_id, H5O_loc_t grp_oloc; /* Opened object object location */ hbool_t loc_found = FALSE; /* Location at 'name' found */ H5O_type_t obj_type; /* Type of object at location */ - H5G_t *ret_value; /* Return value */ + H5G_t *ret_value = NULL; /* Return value */ FUNC_ENTER_PACKAGE @@ -363,7 +332,7 @@ H5G_open(const H5G_loc_t *loc, hid_t dxpl_id) { H5G_t *grp = NULL; /* Group opened */ H5G_shared_t *shared_fo; /* Shared group object */ - H5G_t *ret_value; /* Return value */ + H5G_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI(NULL) @@ -814,7 +783,7 @@ H5G_iterate(hid_t loc_id, const char *group_name, hid_t gid = -1; /* ID of group to iterate over */ H5G_t *grp = NULL; /* Pointer to group data structure to iterate over */ H5G_iter_appcall_ud_t udata; /* User data for callback */ - herr_t ret_value; /* Return value */ + herr_t ret_value = FAIL; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -1084,7 +1053,7 @@ H5G_visit(hid_t loc_id, const char *group_name, H5_index_t idx_type, H5G_loc_t loc; /* Location of group passed in */ H5G_loc_t start_loc; /* Location of starting group */ unsigned rc; /* Reference count of object */ - herr_t ret_value; /* Return value */ + herr_t ret_value = FAIL; /* Return value */ /* Portably clear udata struct (before FUNC_ENTER) */ HDmemset(&udata, 0, sizeof(udata)); diff --git a/src/H5Glink.c b/src/H5Glink.c index 8b258b5..5a195c8 100644 --- a/src/H5Glink.c +++ b/src/H5Glink.c @@ -28,7 +28,7 @@ /* Module Setup */ /****************/ -#define H5G_PACKAGE /*suppress error about including H5Gpkg */ +#include "H5Gmodule.h" /* This source code file is part of the H5G module */ /***********/ @@ -159,7 +159,7 @@ H5G_link_cmp_name_dec(const void *lnk1, const void *lnk2) static int H5G_link_cmp_corder_inc(const void *lnk1, const void *lnk2) { - int ret_value; /* Return value */ + int ret_value = -1; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -194,7 +194,7 @@ H5G_link_cmp_corder_inc(const void *lnk1, const void *lnk2) static int H5G_link_cmp_corder_dec(const void *lnk1, const void *lnk2) { - int ret_value; /* Return value */ + int ret_value = -1; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_NOERR diff --git a/src/H5Gloc.c b/src/H5Gloc.c index 677cc25..eb8cd78 100644 --- a/src/H5Gloc.c +++ b/src/H5Gloc.c @@ -28,7 +28,7 @@ /* Module Setup */ /****************/ -#define H5G_PACKAGE /*suppress error about including H5Gpkg */ +#include "H5Gmodule.h" /* This source code file is part of the H5G module */ /***********/ @@ -649,7 +649,7 @@ htri_t H5G_loc_exists(const H5G_loc_t *loc, const char *name, hid_t lapl_id, hid_t dxpl_id) { H5G_loc_exists_t udata; /* User data for traversal callback */ - htri_t ret_value; /* Return value */ + htri_t ret_value = FAIL; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -913,7 +913,7 @@ H5G_loc_get_comment(H5G_loc_t *loc, const char *name, char *comment/*out*/, size_t bufsize, hid_t lapl_id, hid_t dxpl_id) { H5G_loc_gc_t udata; /* User data for traversal callback */ - ssize_t ret_value; /* Return value */ + ssize_t ret_value = -1; /* Return value */ FUNC_ENTER_NOAPI(FAIL) diff --git a/src/H5Gmodule.h b/src/H5Gmodule.h new file mode 100644 index 0000000..52ac067 --- /dev/null +++ b/src/H5Gmodule.h @@ -0,0 +1,35 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* + * Programmer: Quincey Koziol + * Saturday, September 12, 2015 + * + * Purpose: This file contains declarations which define macros for the + * H5G package. Including this header means that the source file + * is part of the H5G package. + */ +#ifndef _H5Gmodule_H +#define _H5Gmodule_H + +/* Define the proper control macros for the generic FUNC_ENTER/LEAVE and error + * reporting macros. + */ +#define H5G_MODULE +#define H5_MY_PKG H5G +#define H5_MY_PKG_ERR H5E_SYM +#define H5_MY_PKG_INIT YES + +#endif /* _H5Gmodule_H */ + diff --git a/src/H5Gname.c b/src/H5Gname.c index bbeddb6..aff9d31 100644 --- a/src/H5Gname.c +++ b/src/H5Gname.c @@ -28,7 +28,7 @@ /* Module Setup */ /****************/ -#define H5G_PACKAGE /*suppress error about including H5Gpkg */ +#include "H5Gmodule.h" /* This source code file is part of the H5G module */ /***********/ @@ -166,7 +166,7 @@ H5G_normalize(const char *name) char *norm; /* Pointer to the normalized string */ size_t s,d; /* Positions within the strings */ unsigned last_slash; /* Flag to indicate last character was a slash */ - char *ret_value; /* Return value */ + char *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -297,7 +297,7 @@ H5G_build_fullpath(const char *prefix, const char *name) size_t path_len; /* Length of the path */ size_t name_len; /* Length of the name */ unsigned need_sep; /* Flag to indicate if separator is needed */ - H5RS_str_t *ret_value; /* Return value */ + H5RS_str_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -354,7 +354,7 @@ H5RS_str_t * H5G_build_fullpath_refstr_str(H5RS_str_t *prefix_r, const char *name) { const char *prefix; /* Pointer to raw string for path */ - H5RS_str_t *ret_value; + H5RS_str_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -565,7 +565,7 @@ H5G_get_name(const H5G_loc_t *loc, char *name/*out*/, size_t size, hbool_t *cached, hid_t lapl_id, hid_t dxpl_id) { ssize_t len = 0; /* Length of object's name */ - ssize_t ret_value; /* Return value */ + ssize_t ret_value = -1; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -1292,7 +1292,7 @@ H5G_get_name_by_addr(hid_t file, hid_t lapl_id, hid_t dxpl_id, const H5O_loc_t * H5G_loc_t root_loc; /* Root group's location */ hbool_t found_obj = FALSE; /* If we found the object */ herr_t status; /* Status from iteration */ - ssize_t ret_value; /* Return value */ + ssize_t ret_value = -1; /* Return value */ /* Portably clear udata struct (before FUNC_ENTER) */ HDmemset(&udata, 0, sizeof(udata)); diff --git a/src/H5Gnode.c b/src/H5Gnode.c index cbb9a8e..e25a17e 100644 --- a/src/H5Gnode.c +++ b/src/H5Gnode.c @@ -31,7 +31,7 @@ /* Module Setup */ /****************/ -#define H5G_PACKAGE /*suppress error about including H5Gpkg */ +#include "H5Gmodule.h" /* This source code file is part of the H5G module */ /***********/ @@ -404,7 +404,7 @@ H5G_node_cmp2(void *_lt_key, void *_udata, void *_rt_key) H5G_node_key_t *rt_key = (H5G_node_key_t *) _rt_key; const char *s1, *s2; const char *base; /* Base of heap */ - int ret_value; + int ret_value = -1; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_NOERR diff --git a/src/H5Gobj.c b/src/H5Gobj.c index c1f05b7..d0a8210 100644 --- a/src/H5Gobj.c +++ b/src/H5Gobj.c @@ -28,7 +28,7 @@ /* Module Setup */ /****************/ -#define H5G_PACKAGE /*suppress error about including H5Gpkg */ +#include "H5Gmodule.h" /* This source code file is part of the H5G module */ /***********/ @@ -320,8 +320,8 @@ done: htri_t H5G__obj_get_linfo(const H5O_loc_t *grp_oloc, H5O_linfo_t *linfo, hid_t dxpl_id) { - H5B2_t *bt2_name = NULL; /* v2 B-tree handle for name index */ - htri_t ret_value; /* Return value */ + H5B2_t *bt2_name = NULL; /* v2 B-tree handle for name index */ + htri_t ret_value = FAIL; /* Return value */ FUNC_ENTER_PACKAGE_TAG(dxpl_id, grp_oloc->addr, FAIL) @@ -666,7 +666,7 @@ H5G__obj_iterate(const H5O_loc_t *grp_oloc, { H5O_linfo_t linfo; /* Link info message */ htri_t linfo_exists; /* Whether the link info message exists */ - herr_t ret_value; /* Return value */ + herr_t ret_value = FAIL; /* Return value */ FUNC_ENTER_PACKAGE_TAG(dxpl_id, grp_oloc->addr, FAIL) @@ -813,7 +813,7 @@ H5G_obj_get_name_by_idx(const H5O_loc_t *oloc, H5_index_t idx_type, { H5O_linfo_t linfo; /* Link info message */ htri_t linfo_exists; /* Whether the link info message exists */ - ssize_t ret_value; /* Return value */ + ssize_t ret_value = -1; /* Return value */ FUNC_ENTER_NOAPI_TAG(dxpl_id, oloc->addr, FAIL) diff --git a/src/H5Goh.c b/src/H5Goh.c index 1a0f112..c516713 100644 --- a/src/H5Goh.c +++ b/src/H5Goh.c @@ -17,8 +17,8 @@ /* Module Setup */ /****************/ -#define H5O_PACKAGE /*suppress error about including H5Opkg */ -#define H5G_PACKAGE /*suppress error about including H5Gpkg */ +#include "H5Gmodule.h" /* This source code file is part of the H5G module */ +#define H5O_FRIEND /*suppress error about including H5Opkg */ /***********/ @@ -107,7 +107,7 @@ H5FL_DEFINE(H5G_copy_file_ud_t); static void * H5O_group_get_copy_file_udata(void) { - void *ret_value; /* Return value */ + void *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -177,7 +177,7 @@ H5O_group_isa(struct H5O_t *oh) { htri_t stab_exists; /* Whether the 'stab' message is in the object header */ htri_t linfo_exists; /* Whether the 'linfo' message is in the object header */ - htri_t ret_value; /* Return value */ + htri_t ret_value = FAIL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -213,7 +213,7 @@ static hid_t H5O_group_open(const H5G_loc_t *obj_loc, hid_t H5_ATTR_UNUSED lapl_id, hid_t dxpl_id, hbool_t app_ref) { H5G_t *grp = NULL; /* Group opened */ - hid_t ret_value; /* Return value */ + hid_t ret_value = H5I_INVALID_HID; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -254,7 +254,7 @@ H5O_group_create(H5F_t *f, void *_crt_info, H5G_loc_t *obj_loc, hid_t dxpl_id) { H5G_obj_create_t *crt_info = (H5G_obj_create_t *)_crt_info; /* Group creation parameters */ H5G_t *grp = NULL; /* New group created */ - void *ret_value; /* Return value */ + void *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -302,7 +302,7 @@ static H5O_loc_t * H5O_group_get_oloc(hid_t obj_id) { H5G_t *grp; /* Group opened */ - H5O_loc_t *ret_value; /* Return value */ + H5O_loc_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT diff --git a/src/H5Gpkg.h b/src/H5Gpkg.h index 7346b41..1457e62 100644 --- a/src/H5Gpkg.h +++ b/src/H5Gpkg.h @@ -21,7 +21,7 @@ * only within the H5G package. Source files outside the * H5G package should include H5Gprivate.h instead. */ -#ifndef H5G_PACKAGE +#if !(defined H5G_FRIEND || defined H5G_MODULE) #error "Do not include this file outside the H5G package!" #endif @@ -351,8 +351,6 @@ H5_DLL herr_t H5G__traverse_special(const H5G_loc_t *grp_loc, /* * Utility functions */ -H5_DLL herr_t H5G__init(void); -H5_DLL herr_t H5G__term_deprec_interface(void); H5_DLL const char *H5G__component(const char *name, size_t *size_p); /* diff --git a/src/H5Gprivate.h b/src/H5Gprivate.h index 130c742..baf4209 100644 --- a/src/H5Gprivate.h +++ b/src/H5Gprivate.h @@ -101,11 +101,11 @@ } /* If the module using this macro is allowed access to the private variables, access them directly */ -#ifdef H5G_PACKAGE +#ifdef H5G_MODULE #define H5G_MOUNTED(G) ((G)->shared->mounted) -#else /* H5G_PACKAGE */ +#else /* H5G_MODULE */ #define H5G_MOUNTED(G) (H5G_mounted(G)) -#endif /* H5G_PACKAGE */ +#endif /* H5G_MODULE */ /* * During name lookups (see H5G_traverse()) we sometimes want information about diff --git a/src/H5Groot.c b/src/H5Groot.c index 5ec9d3a..ba25f31 100644 --- a/src/H5Groot.c +++ b/src/H5Groot.c @@ -28,8 +28,8 @@ /* Module Setup */ /****************/ -#define H5F_PACKAGE /*suppress error about including H5Fpkg */ -#define H5G_PACKAGE /*suppress error about including H5Gpkg */ +#define H5F_FRIEND /*suppress error about including H5Fpkg */ +#include "H5Gmodule.h" /* This source code file is part of the H5G module */ /***********/ diff --git a/src/H5Gstab.c b/src/H5Gstab.c index 08188ae..7f4b8df 100644 --- a/src/H5Gstab.c +++ b/src/H5Gstab.c @@ -22,7 +22,7 @@ /* Module Setup */ /****************/ -#define H5G_PACKAGE /*suppress error about including H5Gpkg */ +#include "H5Gmodule.h" /* This source code file is part of the H5G module */ /***********/ @@ -533,7 +533,7 @@ H5G__stab_iterate(const H5O_loc_t *oloc, hid_t dxpl_id, H5_iter_order_t order, H5HL_t *heap = NULL; /* Local heap for group */ H5O_stab_t stab; /* Info about symbol table */ H5G_link_table_t ltable = {0, NULL}; /* Link table */ - herr_t ret_value; /* Return value */ + herr_t ret_value = FAIL; /* Return value */ FUNC_ENTER_PACKAGE_TAG(dxpl_id, oloc->addr, FAIL) @@ -751,7 +751,7 @@ H5G__stab_get_name_by_idx(const H5O_loc_t *oloc, H5_iter_order_t order, hsize_t H5O_stab_t stab; /* Info about local heap & B-tree */ H5G_bt_it_gnbi_t udata; /* Iteration information */ hbool_t udata_valid = FALSE; /* Whether iteration information is valid */ - ssize_t ret_value; /* Return value */ + ssize_t ret_value = -1; /* Return value */ /* Portably clear udata struct (before FUNC_ENTER) */ HDmemset(&udata, 0, sizeof(udata)); @@ -874,7 +874,7 @@ H5G__stab_lookup(const H5O_loc_t *grp_oloc, const char *name, H5O_link_t *lnk, H5G_bt_lkp_t bt_udata; /* Data to pass through B-tree */ H5G_stab_fnd_ud_t udata; /* 'User data' to give to callback */ H5O_stab_t stab; /* Symbol table message */ - htri_t ret_value; /* Return value */ + htri_t ret_value = FAIL; /* Return value */ FUNC_ENTER_PACKAGE @@ -1191,7 +1191,7 @@ H5G__stab_get_type_by_idx(H5O_loc_t *oloc, hsize_t idx, hid_t dxpl_id) { H5O_stab_t stab; /* Info about local heap & B-tree */ H5G_bt_it_gtbi_t udata; /* User data for B-tree callback */ - H5G_obj_t ret_value; /* Return value */ + H5G_obj_t ret_value = H5G_UNKNOWN; /* Return value */ FUNC_ENTER_PACKAGE_TAG(dxpl_id, oloc->addr, H5G_UNKNOWN) diff --git a/src/H5Gtest.c b/src/H5Gtest.c index 1c0adea..a8796fb 100644 --- a/src/H5Gtest.c +++ b/src/H5Gtest.c @@ -23,7 +23,7 @@ /* Module Setup */ /****************/ -#define H5G_PACKAGE /*suppress error about including H5Gpkg */ +#include "H5Gmodule.h" /* This source code file is part of the H5G module */ #define H5G_TESTING /*suppress warning about H5G testing funcs*/ diff --git a/src/H5Gtraverse.c b/src/H5Gtraverse.c index 1c654bb..5121f45 100644 --- a/src/H5Gtraverse.c +++ b/src/H5Gtraverse.c @@ -28,7 +28,7 @@ /* Module Setup */ /****************/ -#define H5G_PACKAGE /*suppress error about including H5Gpkg */ +#include "H5Gmodule.h" /* This source code file is part of the H5G module */ /***********/ diff --git a/src/H5HF.c b/src/H5HF.c index 4a0ad07..efd57ae 100644 --- a/src/H5HF.c +++ b/src/H5HF.c @@ -33,7 +33,8 @@ /* Module Setup */ /****************/ -#define H5HF_PACKAGE /*suppress error about including H5HFpkg */ +#include "H5HFmodule.h" /* This source code file is part of the H5HF module */ + /***********/ /* Headers */ @@ -68,6 +69,9 @@ /* Package Variables */ /*********************/ +/* Package initialization variable */ +hbool_t H5_PKG_INIT_VAR = FALSE; + /*****************************/ /* Library Private Variables */ @@ -153,7 +157,7 @@ H5HF_create(H5F_t *f, hid_t dxpl_id, const H5HF_create_t *cparam) H5HF_t *fh = NULL; /* Pointer to new fractal heap */ H5HF_hdr_t *hdr = NULL; /* The fractal heap header information */ haddr_t fh_addr; /* Heap header address */ - H5HF_t *ret_value; /* Return value */ + H5HF_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI(NULL) @@ -220,7 +224,7 @@ H5HF_open(H5F_t *f, hid_t dxpl_id, haddr_t fh_addr) { H5HF_t *fh = NULL; /* Pointer to new fractal heap */ H5HF_hdr_t *hdr = NULL; /* The fractal heap header information */ - H5HF_t *ret_value; /* Return value */ + H5HF_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI(NULL) diff --git a/src/H5HFbtree2.c b/src/H5HFbtree2.c index cb1ec77..2f3d0e4 100644 --- a/src/H5HFbtree2.c +++ b/src/H5HFbtree2.c @@ -28,7 +28,7 @@ /* Module Setup */ /****************/ -#define H5HF_PACKAGE /*suppress error about including H5HFpkg */ +#include "H5HFmodule.h" /* This source code file is part of the H5HF module */ /***********/ @@ -196,7 +196,7 @@ H5HF_huge_bt2_crt_context(void *_f) { H5F_t *f = (H5F_t *)_f; /* User data for building callback context */ H5HF_huge_bt2_ctx_t *ctx; /* Callback context structure */ - void *ret_value; /* Return value */ + void *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -762,7 +762,7 @@ H5HF_huge_bt2_dir_compare(const void *_rec1, const void *_rec2) { const H5HF_huge_bt2_dir_rec_t *rec1 = (const H5HF_huge_bt2_dir_rec_t *)_rec1; const H5HF_huge_bt2_dir_rec_t *rec2 = (const H5HF_huge_bt2_dir_rec_t *)_rec2; - herr_t ret_value; /* Return value */ + herr_t ret_value = FAIL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -985,7 +985,7 @@ H5HF_huge_bt2_filt_dir_compare(const void *_rec1, const void *_rec2) { const H5HF_huge_bt2_filt_dir_rec_t *rec1 = (const H5HF_huge_bt2_filt_dir_rec_t *)_rec1; const H5HF_huge_bt2_filt_dir_rec_t *rec2 = (const H5HF_huge_bt2_filt_dir_rec_t *)_rec2; - herr_t ret_value; /* Return value */ + herr_t ret_value = FAIL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_NOERR diff --git a/src/H5HFcache.c b/src/H5HFcache.c index ec8d9a6..88973a5 100644 --- a/src/H5HFcache.c +++ b/src/H5HFcache.c @@ -28,7 +28,7 @@ /* Module Setup */ /****************/ -#define H5HF_PACKAGE /*suppress error about including H5HFpkg */ +#include "H5HFmodule.h" /* This source code file is part of the H5HF module */ /***********/ @@ -401,7 +401,7 @@ H5HF__cache_hdr_deserialize(const void *_image, size_t len, void *_udata, uint32_t stored_chksum; /* Stored metadata checksum value */ uint32_t computed_chksum; /* Computed metadata checksum value */ uint8_t heap_flags; /* Status flags for heap */ - void * ret_value; /* Return value */ + void * ret_value = NULL; /* Return value */ FUNC_ENTER_STATIC @@ -905,7 +905,7 @@ H5HF__cache_iblock_deserialize(const void *_image, size_t len, void *_udata, uint32_t stored_chksum; /* Stored metadata checksum value */ uint32_t computed_chksum; /* Computed metadata checksum value */ unsigned u; /* Local index variable */ - void * ret_value; /* Return value */ + void * ret_value = NULL; /* Return value */ FUNC_ENTER_STATIC @@ -1590,7 +1590,7 @@ H5HF__cache_dblock_deserialize(const void *_image, size_t len, void *_udata, H5HF_direct_t *dblock = NULL; /* Direct block info */ const uint8_t *image; /* Pointer into raw data buffer */ haddr_t heap_addr; /* Address of heap header in the file */ - void * ret_value; /* Return value */ + void * ret_value = NULL; /* Return value */ FUNC_ENTER_STATIC diff --git a/src/H5HFdbg.c b/src/H5HFdbg.c index 736b98d..40191e5 100644 --- a/src/H5HFdbg.c +++ b/src/H5HFdbg.c @@ -28,7 +28,7 @@ /* Module Setup */ /****************/ -#define H5HF_PACKAGE /*suppress error about including H5HFpkg */ +#include "H5HFmodule.h" /* This source code file is part of the H5HF module */ #define H5HF_DEBUGGING /* Need access to fractal heap debugging routines */ /***********/ diff --git a/src/H5HFdblock.c b/src/H5HFdblock.c index 5dd5b0c..9461fc0 100644 --- a/src/H5HFdblock.c +++ b/src/H5HFdblock.c @@ -28,7 +28,8 @@ /* Module Setup */ /****************/ -#define H5HF_PACKAGE /*suppress error about including H5HFpkg */ +#include "H5HFmodule.h" /* This source code file is part of the H5HF module */ + /***********/ /* Headers */ @@ -447,7 +448,7 @@ H5HF_man_dblock_protect(H5HF_hdr_t *hdr, hid_t dxpl_id, haddr_t dblock_addr, { H5HF_direct_t *dblock; /* Direct block from cache */ H5HF_dblock_cache_ud_t udata; /* parent and other infor for deserializing direct block */ - H5HF_direct_t *ret_value; /* Return value */ + H5HF_direct_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT diff --git a/src/H5HFdtable.c b/src/H5HFdtable.c index c523396..3ceb6f5 100644 --- a/src/H5HFdtable.c +++ b/src/H5HFdtable.c @@ -28,7 +28,8 @@ /* Module Setup */ /****************/ -#define H5HF_PACKAGE /*suppress error about including H5HFpkg */ +#include "H5HFmodule.h" /* This source code file is part of the H5HF module */ + /***********/ /* Headers */ @@ -240,7 +241,7 @@ H5HF_dtable_dest(H5HF_dtable_t *dtable) unsigned H5HF_dtable_size_to_row(const H5HF_dtable_t *dtable, size_t block_size) { - unsigned row; /* Row where block will fit */ + unsigned row = 0; /* Row where block will fit */ FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -274,7 +275,7 @@ H5HF_dtable_size_to_row(const H5HF_dtable_t *dtable, size_t block_size) unsigned H5HF_dtable_size_to_rows(const H5HF_dtable_t *dtable, hsize_t size) { - unsigned rows; /* # of rows required for indirect block */ + unsigned rows = 0; /* # of rows required for indirect block */ FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -310,7 +311,7 @@ H5HF_dtable_span_size(const H5HF_dtable_t *dtable, unsigned start_row, unsigned end_row; /* Row for last block covered */ unsigned end_col; /* Column for last block covered */ unsigned end_entry; /* Entry for last block covered */ - hsize_t acc_span_size; /* Accumulated span size */ + hsize_t acc_span_size = 0; /* Accumulated span size */ FUNC_ENTER_NOAPI_NOINIT_NOERR diff --git a/src/H5HFhdr.c b/src/H5HFhdr.c index 340940f..6560756 100644 --- a/src/H5HFhdr.c +++ b/src/H5HFhdr.c @@ -28,7 +28,8 @@ /* Module Setup */ /****************/ -#define H5HF_PACKAGE /*suppress error about including H5HFpkg */ +#include "H5HFmodule.h" /* This source code file is part of the H5HF module */ + /***********/ /* Headers */ @@ -110,7 +111,7 @@ H5HF_hdr_t * H5HF_hdr_alloc(H5F_t *f) { H5HF_hdr_t *hdr = NULL; /* Shared fractal heap header */ - H5HF_hdr_t *ret_value; /* Return value */ + H5HF_hdr_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -342,7 +343,7 @@ H5HF_hdr_create(H5F_t *f, hid_t dxpl_id, const H5HF_create_t *cparam) { H5HF_hdr_t *hdr = NULL; /* The new fractal heap header information */ size_t dblock_overhead; /* Direct block's overhead */ - haddr_t ret_value; /* Return value */ + haddr_t ret_value = HADDR_UNDEF; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -533,7 +534,7 @@ H5HF_hdr_protect(H5F_t *f, hid_t dxpl_id, haddr_t addr, unsigned flags) { H5HF_hdr_cache_ud_t cache_udata; /* User-data for callback */ H5HF_hdr_t *hdr; /* Fractal heap header */ - H5HF_hdr_t *ret_value; /* Return value */ + H5HF_hdr_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT diff --git a/src/H5HFhuge.c b/src/H5HFhuge.c index 04cd425..888af48 100644 --- a/src/H5HFhuge.c +++ b/src/H5HFhuge.c @@ -28,7 +28,7 @@ /* Module Setup */ /****************/ -#define H5HF_PACKAGE /*suppress error about including H5HFpkg */ +#include "H5HFmodule.h" /* This source code file is part of the H5HF module */ /***********/ @@ -261,7 +261,7 @@ static hsize_t H5HF_huge_new_id(H5HF_hdr_t *hdr) { hsize_t new_id; /* New object's ID */ - hsize_t ret_value; /* Return value */ + hsize_t ret_value = 0; /* Return value */ FUNC_ENTER_NOAPI_NOINIT diff --git a/src/H5HFiblock.c b/src/H5HFiblock.c index 547aaf0..29f4662 100644 --- a/src/H5HFiblock.c +++ b/src/H5HFiblock.c @@ -28,7 +28,8 @@ /* Module Setup */ /****************/ -#define H5HF_PACKAGE /*suppress error about including H5HFpkg */ +#include "H5HFmodule.h" /* This source code file is part of the H5HF module */ + /***********/ /* Headers */ @@ -1171,7 +1172,7 @@ H5HF_man_iblock_protect(H5HF_hdr_t *hdr, hid_t dxpl_id, haddr_t iblock_addr, H5HF_parent_t par_info; /* Parent info for loading block */ H5HF_indirect_t *iblock = NULL; /* Indirect block from cache */ hbool_t should_protect = FALSE; /* Whether we should protect the indirect block or not */ - H5HF_indirect_t *ret_value; /* Return value */ + H5HF_indirect_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT diff --git a/src/H5HFiter.c b/src/H5HFiter.c index 262a9ee..55a8532 100644 --- a/src/H5HFiter.c +++ b/src/H5HFiter.c @@ -28,7 +28,8 @@ /* Module Setup */ /****************/ -#define H5HF_PACKAGE /*suppress error about including H5HFpkg */ +#include "H5HFmodule.h" /* This source code file is part of the H5HF module */ + /***********/ /* Headers */ diff --git a/src/H5HFman.c b/src/H5HFman.c index cfbcd87..cff4395 100644 --- a/src/H5HFman.c +++ b/src/H5HFman.c @@ -28,7 +28,8 @@ /* Module Setup */ /****************/ -#define H5HF_PACKAGE /*suppress error about including H5HFpkg */ +#include "H5HFmodule.h" /* This source code file is part of the H5HF module */ + /***********/ /* Headers */ diff --git a/src/H5HFmodule.h b/src/H5HFmodule.h new file mode 100644 index 0000000..e3274ce --- /dev/null +++ b/src/H5HFmodule.h @@ -0,0 +1,35 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* + * Programmer: Quincey Koziol + * Saturday, September 12, 2015 + * + * Purpose: This file contains declarations which define macros for the + * H5HF package. Including this header means that the source file + * is part of the H5HF package. + */ +#ifndef _H5HFmodule_H +#define _H5HFmodule_H + +/* Define the proper control macros for the generic FUNC_ENTER/LEAVE and error + * reporting macros. + */ +#define H5HF_MODULE +#define H5_MY_PKG H5HF +#define H5_MY_PKG_ERR H5E_HEAP +#define H5_MY_PKG_INIT NO + +#endif /* _H5HFmodule_H */ + diff --git a/src/H5HFpkg.h b/src/H5HFpkg.h index 685c83a..7a6794e 100644 --- a/src/H5HFpkg.h +++ b/src/H5HFpkg.h @@ -21,7 +21,7 @@ * the H5HF package. Source files outside the H5HF package should * include H5HFprivate.h instead. */ -#ifndef H5HF_PACKAGE +#if !(defined H5HF_FRIEND || defined H5HF_MODULE) #error "Do not include this file outside the H5HF package!" #endif diff --git a/src/H5HFsection.c b/src/H5HFsection.c index c997119..070bc3e 100644 --- a/src/H5HFsection.c +++ b/src/H5HFsection.c @@ -25,7 +25,8 @@ /* Module Setup */ /****************/ -#define H5HF_PACKAGE /*suppress error about including H5HFpkg */ +#include "H5HFmodule.h" /* This source code file is part of the H5HF module */ + /***********/ /* Headers */ @@ -407,8 +408,8 @@ static H5HF_free_section_t * H5HF_sect_node_new(unsigned sect_type, haddr_t sect_addr, hsize_t sect_size, H5FS_section_state_t sect_state) { - H5HF_free_section_t *new_sect; /* New section */ - H5HF_free_section_t *ret_value; /* Return value */ + H5HF_free_section_t *new_sect; /* New section */ + H5HF_free_section_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -489,7 +490,7 @@ H5HF_sect_single_new(hsize_t sect_off, size_t sect_size, H5HF_indirect_t *parent, unsigned par_entry) { H5HF_free_section_t *sect = NULL; /* 'Single' free space section to add */ - H5HF_free_section_t *ret_value; /* Return value */ + H5HF_free_section_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -866,7 +867,7 @@ H5HF_sect_single_deserialize(const H5FS_section_class_t H5_ATTR_UNUSED *cls, hsize_t sect_size, unsigned H5_ATTR_UNUSED *des_flags) { H5HF_free_section_t *new_sect; /* New section */ - H5FS_section_info_t *ret_value; /* Return value */ + H5FS_section_info_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -1261,7 +1262,7 @@ H5HF_sect_row_create(haddr_t sect_off, hsize_t sect_size, hbool_t is_first, unsigned row, unsigned col, unsigned nentries, H5HF_free_section_t *under_sect) { H5HF_free_section_t *sect = NULL; /* 'Row' section created */ - H5HF_free_section_t *ret_value; /* Return value */ + H5HF_free_section_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -1513,7 +1514,7 @@ done: H5HF_indirect_t * H5HF_sect_row_get_iblock(H5HF_free_section_t *sect) { - H5HF_indirect_t *ret_value; /* Return value */ + H5HF_indirect_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -1675,7 +1676,7 @@ H5HF_sect_row_deserialize(const H5FS_section_class_t *cls, hid_t dxpl_id, unsigned *des_flags) { H5HF_hdr_t *hdr; /* Fractal heap header */ - H5FS_section_info_t *ret_value; /* Return value */ + H5FS_section_info_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -2102,7 +2103,7 @@ H5HF_sect_row_debug(const H5FS_section_info_t *_sect, static hsize_t H5HF_sect_indirect_iblock_off(const H5HF_free_section_t *sect) { - hsize_t ret_value; /* Return value */ + hsize_t ret_value = 0; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -2133,7 +2134,7 @@ H5HF_sect_indirect_iblock_off(const H5HF_free_section_t *sect) static H5HF_free_section_t * H5HF_sect_indirect_top(H5HF_free_section_t *sect) { - H5HF_free_section_t *ret_value; /* Return value */ + H5HF_free_section_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -2242,7 +2243,7 @@ H5HF_sect_indirect_new(H5HF_hdr_t *hdr, haddr_t sect_off, hsize_t sect_size, unsigned nentries) { H5HF_free_section_t *sect = NULL; /* 'Indirect' free space section to add */ - H5HF_free_section_t *ret_value; /* Return value */ + H5HF_free_section_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -2313,7 +2314,7 @@ H5HF_sect_indirect_for_row(H5HF_hdr_t *hdr, H5HF_indirect_t *iblock, H5HF_free_section_t *row_sect) { H5HF_free_section_t *sect = NULL; /* 'Indirect' free space section to add */ - H5HF_free_section_t *ret_value; /* Return value */ + H5HF_free_section_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -3945,7 +3946,7 @@ H5HF_sect_indirect_deserialize(H5HF_hdr_t *hdr, hid_t dxpl_id, unsigned end_entry; /* End entry in indirect block */ unsigned end_row; /* End row in indirect block */ unsigned end_col; /* End column in indirect block */ - H5FS_section_info_t *ret_value; /* Return value */ + H5FS_section_info_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT diff --git a/src/H5HFspace.c b/src/H5HFspace.c index 7fb0dd4..20057e4 100644 --- a/src/H5HFspace.c +++ b/src/H5HFspace.c @@ -28,7 +28,8 @@ /* Module Setup */ /****************/ -#define H5HF_PACKAGE /*suppress error about including H5HFpkg */ +#include "H5HFmodule.h" /* This source code file is part of the H5HF module */ + /***********/ /* Headers */ @@ -216,7 +217,7 @@ htri_t H5HF_space_find(H5HF_hdr_t *hdr, hid_t dxpl_id, hsize_t request, H5HF_free_section_t **node) { htri_t node_found = FALSE; /* Whether an existing free list node was found */ - htri_t ret_value; /* Return value */ + htri_t ret_value = FAIL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT diff --git a/src/H5HFstat.c b/src/H5HFstat.c index b0e1987..303b1f4 100644 --- a/src/H5HFstat.c +++ b/src/H5HFstat.c @@ -24,7 +24,8 @@ /* Module Setup */ /****************/ -#define H5HF_PACKAGE /*suppress error about including H5HFpkg */ +#include "H5HFmodule.h" /* This source code file is part of the H5HF module */ + /***********/ /* Headers */ diff --git a/src/H5HFtest.c b/src/H5HFtest.c index c2e9cb0..4ec7149 100644 --- a/src/H5HFtest.c +++ b/src/H5HFtest.c @@ -24,9 +24,10 @@ /* Module Setup */ /****************/ -#define H5HF_PACKAGE /*suppress error about including H5HFpkg */ +#include "H5HFmodule.h" /* This source code file is part of the H5HF module */ #define H5HF_TESTING /*suppress warning about H5HF testing funcs*/ + /***********/ /* Headers */ /***********/ @@ -244,7 +245,7 @@ done: unsigned H5HF_get_max_root_rows(const H5HF_t *fh) { - unsigned ret_value; /* Return value */ + unsigned ret_value = 0; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -275,7 +276,7 @@ H5HF_get_max_root_rows(const H5HF_t *fh) unsigned H5HF_get_dtable_width_test(const H5HF_t *fh) { - unsigned ret_value; /* Return value */ + unsigned ret_value = 0; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -306,7 +307,7 @@ H5HF_get_dtable_width_test(const H5HF_t *fh) unsigned H5HF_get_dtable_max_drows_test(const H5HF_t *fh) { - unsigned ret_value; /* Return value */ + unsigned ret_value = 0; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -341,7 +342,7 @@ H5HF_get_dtable_max_drows_test(const H5HF_t *fh) unsigned H5HF_get_iblock_max_drows_test(const H5HF_t *fh, unsigned pos) { - unsigned ret_value; /* Return value */ + unsigned ret_value = 0; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -374,7 +375,7 @@ H5HF_get_iblock_max_drows_test(const H5HF_t *fh, unsigned pos) hsize_t H5HF_get_dblock_size_test(const H5HF_t *fh, unsigned row) { - hsize_t ret_value; /* Return value */ + hsize_t ret_value = 0; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -406,7 +407,7 @@ H5HF_get_dblock_size_test(const H5HF_t *fh, unsigned row) hsize_t H5HF_get_dblock_free_test(const H5HF_t *fh, unsigned row) { - hsize_t ret_value; /* Return value */ + hsize_t ret_value = 0; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_NOERR diff --git a/src/H5HFtiny.c b/src/H5HFtiny.c index 27ab443..8c321bc 100644 --- a/src/H5HFtiny.c +++ b/src/H5HFtiny.c @@ -28,7 +28,7 @@ /* Module Setup */ /****************/ -#define H5HF_PACKAGE /* suppress error about including H5HFpkg */ +#include "H5HFmodule.h" /* This source code file is part of the H5HF module */ /***********/ diff --git a/src/H5HG.c b/src/H5HG.c index 46b535d..bc9d5e3 100644 --- a/src/H5HG.c +++ b/src/H5HG.c @@ -41,7 +41,7 @@ /* Module Setup */ /****************/ -#define H5HG_PACKAGE /*suppress error about including H5HGpkg */ +#include "H5HGmodule.h" /* This source code file is part of the H5HG module */ /***********/ @@ -91,6 +91,9 @@ static haddr_t H5HG_create(H5F_t *f, hid_t dxpl_id, size_t size); /* Package Variables */ /*********************/ +/* Package initialization variable */ +hbool_t H5_PKG_INIT_VAR = FALSE; + /* Declare a free list to manage the H5HG_heap_t struct */ H5FL_DEFINE(H5HG_heap_t); @@ -249,7 +252,7 @@ H5HG_heap_t * H5HG_protect(H5F_t *f, hid_t dxpl_id, haddr_t addr, unsigned flags) { H5HG_heap_t *heap; /* Global heap */ - H5HG_heap_t *ret_value; /* Return value */ + H5HG_heap_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -299,7 +302,7 @@ H5HG_alloc(H5F_t *f, H5HG_heap_t *heap, size_t size, unsigned *heap_flags_ptr) size_t idx; uint8_t *p; size_t need = H5HG_SIZEOF_OBJHDR(f) + H5HG_ALIGN(size); - size_t ret_value; /* Return value */ + size_t ret_value = 0; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -612,7 +615,7 @@ H5HG_read(H5F_t *f, hid_t dxpl_id, H5HG_t *hobj, void *object/*out*/, size_t size; /* Size of the heap object */ uint8_t *p; /* Pointer to object in heap buffer */ void *orig_object = object; /* Keep a copy of the original object pointer */ - void *ret_value; /* Return value */ + void *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_TAG(dxpl_id, H5AC__GLOBALHEAP_TAG, NULL) @@ -684,7 +687,7 @@ H5HG_link(H5F_t *f, hid_t dxpl_id, const H5HG_t *hobj, int adjust) { H5HG_heap_t *heap = NULL; unsigned heap_flags = H5AC__NO_FLAGS_SET; - int ret_value; /* Return value */ + int ret_value = -1; /* Return value */ FUNC_ENTER_NOAPI_TAG(dxpl_id, H5AC__GLOBALHEAP_TAG, FAIL) diff --git a/src/H5HGcache.c b/src/H5HGcache.c index 5c6bee1..c1eb8d9 100644 --- a/src/H5HGcache.c +++ b/src/H5HGcache.c @@ -28,7 +28,7 @@ /* Module Setup */ /****************/ -#define H5HG_PACKAGE /*suppress error about including H5HGpkg */ +#include "H5HGmodule.h" /* This source code file is part of the H5HG module */ /***********/ @@ -161,7 +161,7 @@ H5HG__cache_heap_deserialize(const void *_image, size_t len, void *_udata, H5F_t *f = (H5F_t *)_udata; /* File pointer -- obtained from user data */ H5HG_heap_t *heap = NULL; /* New global heap */ uint8_t *image; /* Pointer to image to decode */ - void *ret_value; /* Return value */ + void *ret_value = NULL; /* Return value */ FUNC_ENTER_STATIC diff --git a/src/H5HGdbg.c b/src/H5HGdbg.c index c79aac8..6013de5 100644 --- a/src/H5HGdbg.c +++ b/src/H5HGdbg.c @@ -23,7 +23,7 @@ /* Module Setup */ /****************/ -#define H5HG_PACKAGE /*suppress error about including H5HGpkg */ +#include "H5HGmodule.h" /* This source code file is part of the H5HG module */ /***********/ diff --git a/src/H5HGmodule.h b/src/H5HGmodule.h new file mode 100644 index 0000000..aa34f29 --- /dev/null +++ b/src/H5HGmodule.h @@ -0,0 +1,35 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* + * Programmer: Quincey Koziol + * Saturday, September 12, 2015 + * + * Purpose: This file contains declarations which define macros for the + * H5HG package. Including this header means that the source file + * is part of the H5HG package. + */ +#ifndef _H5HGmodule_H +#define _H5HGmodule_H + +/* Define the proper control macros for the generic FUNC_ENTER/LEAVE and error + * reporting macros. + */ +#define H5HG_MODULE +#define H5_MY_PKG H5HG +#define H5_MY_PKG_ERR H5E_HEAP +#define H5_MY_PKG_INIT NO + +#endif /* _H5HGmodule_H */ + diff --git a/src/H5HGpkg.h b/src/H5HGpkg.h index 9137e7b..ffbf7c6 100644 --- a/src/H5HGpkg.h +++ b/src/H5HGpkg.h @@ -21,7 +21,7 @@ * only within the H5HG package. Source files outside the * H5HG package should include H5HGprivate.h instead. */ -#ifndef H5HG_PACKAGE +#if !(defined H5HG_FRIEND || defined H5HG_MODULE) #error "Do not include this file outside the H5HG package!" #endif diff --git a/src/H5HGprivate.h b/src/H5HGprivate.h index 3765c47..b090d4c 100644 --- a/src/H5HGprivate.h +++ b/src/H5HGprivate.h @@ -44,15 +44,15 @@ typedef struct H5HG_heap_t H5HG_heap_t; #define H5HG_MAXSIZE 65536 /* If the module using this macro is allowed access to the private variables, access them directly */ -#ifdef H5HG_PACKAGE +#ifdef H5HG_MODULE #define H5HG_ADDR(H) ((H)->addr) #define H5HG_SIZE(H) ((H)->size) #define H5HG_FREE_SIZE(H) ((H)->obj[0].size) -#else /* H5HG_PACKAGE */ +#else /* H5HG_MODULE */ #define H5HG_ADDR(H) (H5HG_get_addr(H)) #define H5HG_SIZE(H) (H5HG_get_size(H)) #define H5HG_FREE_SIZE(H) (H5HG_get_free_size(H)) -#endif /* H5HG_PACKAGE */ +#endif /* H5HG_MODULE */ /* Main global heap routines */ diff --git a/src/H5HGquery.c b/src/H5HGquery.c index a1b3777..d07edcc 100644 --- a/src/H5HGquery.c +++ b/src/H5HGquery.c @@ -25,7 +25,7 @@ /* Module Setup */ /****************/ -#define H5HG_PACKAGE /*suppress error about including H5HGpkg */ +#include "H5HGmodule.h" /* This source code file is part of the H5HG module */ /***********/ diff --git a/src/H5HL.c b/src/H5HL.c index 49af528..7631e8c 100644 --- a/src/H5HL.c +++ b/src/H5HL.c @@ -29,7 +29,7 @@ /* Module Setup */ /****************/ -#define H5HL_PACKAGE /* Suppress error about including H5HLpkg */ +#include "H5HLmodule.h" /* This source code file is part of the H5HL module */ /***********/ @@ -71,6 +71,9 @@ static herr_t H5HL_minimize_heap_space(H5F_t *f, hid_t dxpl_id, H5HL_t *heap); /* Package Variables */ /*********************/ +/* Package initialization variable */ +hbool_t H5_PKG_INIT_VAR = FALSE; + /* Declare a free list to manage the H5HL_free_t struct */ H5FL_DEFINE(H5HL_free_t); @@ -115,7 +118,7 @@ H5HL_create(H5F_t *f, hid_t dxpl_id, size_t size_hint, haddr_t *addr_p/*out*/) { H5HL_t *heap = NULL; /* Heap created */ H5HL_prfx_t *prfx = NULL; /* Heap prefix */ - hsize_t total_size; /* Total heap size on disk */ + hsize_t total_size = 0; /* Total heap size on disk */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -446,10 +449,10 @@ H5HL_protect(H5F_t *f, hid_t dxpl_id, haddr_t addr, unsigned flags) H5HL_cache_prfx_ud_t prfx_udata; /* User data for protecting local heap prefix */ H5HL_prfx_t *prfx = NULL; /* Local heap prefix */ H5HL_dblk_t *dblk = NULL; /* Local heap data block */ - H5HL_t *heap; /* Heap data structure */ + H5HL_t *heap = NULL; /* Heap data structure */ unsigned prfx_cache_flags = H5AC__NO_FLAGS_SET; /* Cache flags for unprotecting prefix entry */ unsigned dblk_cache_flags = H5AC__NO_FLAGS_SET; /* Cache flags for unprotecting data block entry */ - H5HL_t *ret_value; /* Return value */ + H5HL_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI(NULL) @@ -700,7 +703,7 @@ H5HL_insert(H5F_t *f, hid_t dxpl_id, H5HL_t *heap, size_t buf_size, const void * size_t offset = 0; size_t need_size; hbool_t found; - size_t ret_value; /* Return value */ + size_t ret_value = 0; /* Return value */ FUNC_ENTER_NOAPI(UFAIL) @@ -1062,7 +1065,7 @@ done: herr_t H5HL_delete(H5F_t *f, hid_t dxpl_id, haddr_t addr) { - H5HL_t *heap; /* Local heap to delete */ + H5HL_t *heap = NULL; /* Local heap to delete */ H5HL_cache_prfx_ud_t prfx_udata; /* User data for protecting local heap prefix */ H5HL_prfx_t *prfx = NULL; /* Local heap prefix */ H5HL_dblk_t *dblk = NULL; /* Local heap data block */ diff --git a/src/H5HLcache.c b/src/H5HLcache.c index 2054e34..42fe1c7 100644 --- a/src/H5HLcache.c +++ b/src/H5HLcache.c @@ -28,7 +28,7 @@ /* Module Setup */ /****************/ -#define H5HL_PACKAGE /* Suppress error about including H5HLpkg */ +#include "H5HLmodule.h" /* This source code file is part of the H5HL module */ /***********/ @@ -311,7 +311,7 @@ H5HL__cache_prefix_deserialize(const void *_image, size_t len, void *_udata, H5HL_prfx_t *prfx = NULL; /* Heap prefix deserialized */ const uint8_t *image = (const uint8_t *)_image; /* Pointer into decoding buffer */ H5HL_cache_prfx_ud_t *udata = (H5HL_cache_prfx_ud_t *)_udata; /* User data for callback */ - void *ret_value; /* Return value */ + void *ret_value = NULL; /* Return value */ FUNC_ENTER_STATIC @@ -682,7 +682,7 @@ H5HL__cache_datablock_deserialize(const void *image, size_t len, void *_udata, { H5HL_dblk_t *dblk = NULL; /* Local heap data block deserialized */ H5HL_cache_dblk_ud_t *udata = (H5HL_cache_dblk_ud_t *)_udata; /* User data for callback */ - void * ret_value; /* Return value */ + void *ret_value = NULL; /* Return value */ FUNC_ENTER_STATIC diff --git a/src/H5HLdbg.c b/src/H5HLdbg.c index edddd65..3620511 100644 --- a/src/H5HLdbg.c +++ b/src/H5HLdbg.c @@ -18,7 +18,8 @@ * * Purpose: Local Heap object debugging functions. */ -#define H5HL_PACKAGE /* Suppress error about including H5HLpkg */ + +#include "H5HLmodule.h" /* This source code file is part of the H5HL module */ #include "H5private.h" /* Generic Functions */ diff --git a/src/H5HLint.c b/src/H5HLint.c index d5238eb..bbf579d 100644 --- a/src/H5HLint.c +++ b/src/H5HLint.c @@ -28,7 +28,7 @@ /* Module Setup */ /****************/ -#define H5HL_PACKAGE /* Suppress error about including H5HLpkg */ +#include "H5HLmodule.h" /* This source code file is part of the H5HL module */ /***********/ @@ -102,7 +102,7 @@ H5HL_t * H5HL_new(size_t sizeof_size, size_t sizeof_addr, size_t prfx_size) { H5HL_t *heap = NULL; /* New local heap */ - H5HL_t *ret_value; /* Return value */ + H5HL_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI(NULL) @@ -129,7 +129,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5HL_inc_rc + * Function: H5HL__inc_rc * * Purpose: Increment ref. count on heap * @@ -143,9 +143,9 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5HL_inc_rc(H5HL_t *heap) +H5HL__inc_rc(H5HL_t *heap) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* check arguments */ HDassert(heap); @@ -154,11 +154,11 @@ H5HL_inc_rc(H5HL_t *heap) heap->rc++; FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5HL_inc_rc() */ +} /* end H5HL__inc_rc() */ /*------------------------------------------------------------------------- - * Function: H5HL_dec_rc + * Function: H5HL__dec_rc * * Purpose: Decrement ref. count on heap * @@ -172,9 +172,9 @@ H5HL_inc_rc(H5HL_t *heap) *------------------------------------------------------------------------- */ static herr_t -H5HL_dec_rc(H5HL_t *heap) +H5HL__dec_rc(H5HL_t *heap) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* check arguments */ HDassert(heap); @@ -187,7 +187,7 @@ H5HL_dec_rc(H5HL_t *heap) H5HL_dest(heap); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5HL_dec_rc() */ +} /* end H5HL__dec_rc() */ /*------------------------------------------------------------------------- @@ -250,7 +250,7 @@ H5HL_prfx_t * H5HL_prfx_new(H5HL_t *heap) { H5HL_prfx_t *prfx = NULL; /* New local heap prefix */ - H5HL_prfx_t *ret_value; /* Return value */ + H5HL_prfx_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI(NULL) @@ -262,7 +262,7 @@ H5HL_prfx_new(H5HL_t *heap) HGOTO_ERROR(H5E_HEAP, H5E_CANTALLOC, NULL, "memory allocation failed") /* Increment ref. count on heap data structure */ - if(H5HL_inc_rc(heap) < 0) + if(H5HL__inc_rc(heap) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, NULL, "can't increment heap ref. count") /* Link the heap & the prefix */ @@ -307,7 +307,7 @@ H5HL_prfx_dest(H5HL_prfx_t *prfx) prfx->heap->prfx = NULL; /* Decrement ref. count on heap data structure */ - if(H5HL_dec_rc(prfx->heap) < 0) + if(H5HL__dec_rc(prfx->heap) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDEC, FAIL, "can't decrement heap ref. count") /* Unlink heap from prefix */ @@ -340,7 +340,7 @@ H5HL_dblk_t * H5HL_dblk_new(H5HL_t *heap) { H5HL_dblk_t *dblk = NULL; /* New local heap data block */ - H5HL_dblk_t *ret_value; /* Return value */ + H5HL_dblk_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI(NULL) @@ -352,7 +352,7 @@ H5HL_dblk_new(H5HL_t *heap) HGOTO_ERROR(H5E_HEAP, H5E_CANTALLOC, NULL, "memory allocation failed") /* Increment ref. count on heap data structure */ - if(H5HL_inc_rc(heap) < 0) + if(H5HL__inc_rc(heap) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, NULL, "can't increment heap ref. count") /* Link the heap & the data block */ @@ -401,7 +401,7 @@ H5HL_dblk_dest(H5HL_dblk_t *dblk) HGOTO_ERROR(H5E_HEAP, H5E_CANTUNPIN, FAIL, "can't unpin local heap prefix") /* Decrement ref. count on heap data structure */ - if(H5HL_dec_rc(dblk->heap) < 0) + if(H5HL__dec_rc(dblk->heap) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDEC, FAIL, "can't decrement heap ref. count") /* Unlink heap from data block */ diff --git a/src/H5HLmodule.h b/src/H5HLmodule.h new file mode 100644 index 0000000..b38c077 --- /dev/null +++ b/src/H5HLmodule.h @@ -0,0 +1,35 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* + * Programmer: Quincey Koziol + * Saturday, September 12, 2015 + * + * Purpose: This file contains declarations which define macros for the + * H5HL package. Including this header means that the source file + * is part of the H5HL package. + */ +#ifndef _H5HLmodule_H +#define _H5HLmodule_H + +/* Define the proper control macros for the generic FUNC_ENTER/LEAVE and error + * reporting macros. + */ +#define H5HL_MODULE +#define H5_MY_PKG H5HL +#define H5_MY_PKG_ERR H5E_HEAP +#define H5_MY_PKG_INIT NO + +#endif /* _H5HLmodule_H */ + diff --git a/src/H5HLpkg.h b/src/H5HLpkg.h index 75c9959..6e35add 100644 --- a/src/H5HLpkg.h +++ b/src/H5HLpkg.h @@ -21,7 +21,7 @@ * only within the H5HL package. Source files outside the * H5HL package should include H5HLprivate.h instead. */ -#ifndef H5HL_PACKAGE +#if !(defined H5HL_FRIEND || defined H5HL_MODULE) #error "Do not include this file outside the H5HL package!" #endif diff --git a/src/H5I.c b/src/H5I.c index 605fc9b..15db6d6 100644 --- a/src/H5I.c +++ b/src/H5I.c @@ -35,10 +35,7 @@ * 5/18/04 - Expanded to allow registration of new types at run-time */ -#define H5I_PACKAGE /*suppress error about including H5Ipkg */ - -/* Interface initialization */ -#define H5_INTERFACE_INIT_FUNC H5I_init_interface +#include "H5Imodule.h" /* This source code file is part of the H5I module */ #include "H5private.h" /* Generic Functions */ @@ -55,7 +52,7 @@ #ifndef H5I_DEBUG_OUTPUT #include "H5Gprivate.h" /* Groups */ #else /* H5I_DEBUG_OUTPUT */ -#define H5G_PACKAGE /*suppress error message about including H5Gpkg.h */ +#define H5G_FRIEND /*suppress error about including H5Gpkg */ #include "H5Gpkg.h" /* Groups */ #include "H5Dprivate.h" /* Datasets */ #include "H5Tprivate.h" /* Datatypes */ @@ -106,6 +103,9 @@ typedef struct { hbool_t app_ref; /* Whether this is an appl. ref. call */ } H5I_clear_type_ud_t; +/* Package initialization variable */ +hbool_t H5_PKG_INIT_VAR = FALSE; + /*-------------------- Locally scoped variables -----------------------------*/ /* Array of pointers to atomic types */ @@ -141,29 +141,8 @@ static herr_t H5I__debug(H5I_type_t type); #endif /* H5I_DEBUG_OUTPUT */ -/*-------------------------------------------------------------------------- -NAME - H5I_init_interface -- Initialize interface-specific information -USAGE - herr_t H5I_init_interface() - -RETURNS - Non-negative on success/Negative on failure -DESCRIPTION - Initializes any interface-specific data or routines. - ---------------------------------------------------------------------------*/ -static herr_t -H5I_init_interface(void) -{ - FUNC_ENTER_NOAPI_NOINIT_NOERR - - FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5I_init_interface() */ - - /*------------------------------------------------------------------------- - * Function: H5I_term_interface + * Function: H5I_term_package * * Purpose: Terminate the H5I interface: release all memory, reset all * global variables to initial values. This only happens if all @@ -179,20 +158,20 @@ H5I_init_interface(void) *------------------------------------------------------------------------- */ int -H5I_term_interface(void) +H5I_term_package(void) { - H5I_id_type_t *type_ptr; - H5I_type_t type; - int n = 0; + int n = 0; FUNC_ENTER_NOAPI_NOINIT_NOERR - if(H5_interface_initialize_g) { + if(H5_PKG_INIT_VAR) { + H5I_id_type_t *type_ptr; /* Pointer to ID type */ + H5I_type_t type; /* Type of ID */ + /* How many types are still being used? */ - for(type = (H5I_type_t)0; type < H5I_next_type; H5_INC_ENUM(H5I_type_t, type)) { + for(type = (H5I_type_t)0; type < H5I_next_type; H5_INC_ENUM(H5I_type_t, type)) if((type_ptr = H5I_id_type_list_g[type]) && type_ptr->ids) n++; - } /* end for */ /* If no types are used then clean up */ if(0 == n) { @@ -202,16 +181,18 @@ H5I_term_interface(void) HDassert(NULL == type_ptr->ids); type_ptr = H5FL_FREE(H5I_id_type_t, type_ptr); H5I_id_type_list_g[type] = NULL; + n++; } /* end if */ } /* end for */ - } /* end if */ - /* Mark interface closed */ - H5_interface_initialize_g = 0; + /* Mark interface closed */ + if(0 == n) + H5_PKG_INIT_VAR = FALSE; + } /* end if */ } /* end if */ FUNC_LEAVE_NOAPI(n) -} /* end H5I_term_interface() */ +} /* end H5I_term_package() */ /*------------------------------------------------------------------------- @@ -238,9 +219,9 @@ H5I_term_interface(void) H5I_type_t H5Iregister_type(size_t hash_size, unsigned reserved, H5I_free_t free_func) { - H5I_class_t *cls = NULL; /* New ID class */ - H5I_type_t new_type; /* New ID type value */ - H5I_type_t ret_value; /* Return value */ + H5I_class_t *cls = NULL; /* New ID class */ + H5I_type_t new_type; /* New ID type value */ + H5I_type_t ret_value = H5I_BADID; /* Return value */ FUNC_ENTER_API(H5I_BADID) H5TRACE3("It", "zIux", hash_size, reserved, free_func); @@ -290,10 +271,9 @@ H5Iregister_type(size_t hash_size, unsigned reserved, H5I_free_t free_func) done: /* Clean up on error */ - if(ret_value < 0) { + if(ret_value < 0) if(cls) cls = H5FL_FREE(H5I_class_t, cls); - } /* end if */ FUNC_LEAVE_API(ret_value) } /* end H5Iregister_type() */ @@ -467,8 +447,8 @@ done: int64_t H5I_nmembers(H5I_type_t type) { - H5I_id_type_t *type_ptr = NULL; - int64_t ret_value; + H5I_id_type_t *type_ptr; /* Pointer to the ID type */ + int64_t ret_value = 0; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -504,7 +484,7 @@ done: herr_t H5Iclear_type(H5I_type_t type, hbool_t force) { - herr_t ret_value; /* Return value */ + herr_t ret_value = FAIL; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE2("e", "Itb", type, force); @@ -625,7 +605,6 @@ H5I__clear_type_cb(void *_id, void H5_ATTR_UNUSED *key, void *_udata) } /* end if */ } /* end if */ - FUNC_LEAVE_NOAPI(ret_value) } /* end H5I__clear_type_cb() */ @@ -649,7 +628,7 @@ H5I__clear_type_cb(void *_id, void H5_ATTR_UNUSED *key, void *_udata) herr_t H5Idestroy_type(H5I_type_t type) { - herr_t ret_value; /* Return value */ + herr_t ret_value = FAIL; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE1("e", "It", type); @@ -731,7 +710,7 @@ done: hid_t H5Iregister(H5I_type_t type, const void *object) { - hid_t ret_value; /* Return value */ + hid_t ret_value = H5I_INVALID_HID; /* Return value */ FUNC_ENTER_API(H5I_INVALID_HID) H5TRACE2("i", "It*x", type, object); @@ -826,8 +805,8 @@ done: void * H5I_subst(hid_t id, const void *new_object) { - H5I_id_info_t *id_ptr; /* Ptr to the atom */ - void *ret_value; /* Return value */ + H5I_id_info_t *id_ptr; /* Pointer to the atom */ + void *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI(NULL) @@ -866,7 +845,7 @@ H5I_object(hid_t id) H5I_id_info_t *id_ptr; /*ptr to the new atom */ void *ret_value = NULL; /*return value */ - FUNC_ENTER_NOAPI(NULL) + FUNC_ENTER_NOAPI_NOERR /* General lookup of the ID */ if(NULL != (id_ptr = H5I__find_id(id))) { @@ -875,7 +854,6 @@ H5I_object(hid_t id) ret_value = (void *)id_ptr->obj_ptr; } /* end if */ -done: FUNC_LEAVE_NOAPI(ret_value) } /* end if */ @@ -900,7 +878,7 @@ done: void * H5Iobject_verify(hid_t id, H5I_type_t id_type) { - void * ret_value; /* Return value */ + void *ret_value = NULL; /* Return value */ FUNC_ENTER_API(NULL) H5TRACE2("*x", "iIt", id, id_type); @@ -939,7 +917,7 @@ H5I_object_verify(hid_t id, H5I_type_t id_type) H5I_id_info_t *id_ptr = NULL; /*ptr to the new atom */ void *ret_value = NULL; /*return value */ - FUNC_ENTER_NOAPI(NULL) + FUNC_ENTER_NOAPI_NOERR HDassert(id_type >= 1 && id_type < H5I_next_type); @@ -950,7 +928,6 @@ H5I_object_verify(hid_t id, H5I_type_t id_type) ret_value = (void *)id_ptr->obj_ptr; } /* end if */ -done: FUNC_LEAVE_NOAPI(ret_value) } /* H5I_object_verify() */ @@ -974,16 +951,15 @@ done: H5I_type_t H5I_get_type(hid_t id) { - H5I_type_t ret_value = H5I_BADID; + H5I_type_t ret_value = H5I_BADID; /* Return value */ - FUNC_ENTER_NOAPI(H5I_BADID) + FUNC_ENTER_NOAPI_NOERR if(id > 0) ret_value = H5I_TYPE(id); HDassert(ret_value >= H5I_BADID && ret_value < H5I_next_type); -done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5I_get_type() */ @@ -1006,7 +982,7 @@ done: H5I_type_t H5Iget_type(hid_t id) { - H5I_type_t ret_value = H5I_BADID; /* Return value */ + H5I_type_t ret_value = H5I_BADID; /* Return value */ FUNC_ENTER_API(H5I_BADID) H5TRACE1("It", "i", id); @@ -1041,7 +1017,7 @@ done: void * H5Iremove_verify(hid_t id, H5I_type_t id_type) { - void * ret_value; /* Return value */ + void *ret_value = NULL; /* Return value */ FUNC_ENTER_API(NULL) H5TRACE2("*x", "iIt", id, id_type); @@ -1108,8 +1084,8 @@ H5I__remove_verify(hid_t id, H5I_type_t id_type) static void * H5I__remove_common(H5I_id_type_t *type_ptr, hid_t id) { - H5I_id_info_t *curr_id; /*ptr to the current atom */ - void * ret_value; /*return value */ + H5I_id_info_t *curr_id; /* Pointer to the current atom */ + void *ret_value = NULL; /* Return value */ FUNC_ENTER_STATIC @@ -1149,9 +1125,9 @@ done: void * H5I_remove(hid_t id) { - H5I_id_type_t *type_ptr; /*ptr to the atomic type */ - H5I_type_t type; /*atom's atomic type */ - void * ret_value; /*return value */ + H5I_id_type_t *type_ptr; /* Pointer to the atomic type */ + H5I_type_t type; /* Atom's atomic type */ + void * ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI(NULL) @@ -1190,7 +1166,7 @@ done: int H5Idec_ref(hid_t id) { - int ret_value; /* Return value */ + int ret_value = 0; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE1("Is", "i", id); @@ -1228,8 +1204,8 @@ done: int H5I_dec_ref(hid_t id) { - H5I_id_info_t *id_ptr; /*ptr to the new ID */ - int ret_value; /* Return value */ + H5I_id_info_t *id_ptr; /* Pointer to the new ID */ + int ret_value = 0; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -1298,8 +1274,8 @@ done: int H5I_dec_app_ref(hid_t id) { - H5I_id_info_t *id_ptr; /*ptr to the new ID */ - int ret_value; /* Return value */ + H5I_id_info_t *id_ptr; /* Pointer to the new ID */ + int ret_value = 0; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -1346,7 +1322,7 @@ done: int H5I_dec_app_ref_always_close(hid_t id) { - int ret_value; /* Return value */ + int ret_value = 0; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -1424,8 +1400,8 @@ done: int H5I_inc_ref(hid_t id, hbool_t app_ref) { - H5I_id_info_t *id_ptr; /*ptr to the ID */ - int ret_value; /* Return value */ + H5I_id_info_t *id_ptr; /* Pointer to the ID */ + int ret_value = 0; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -1499,8 +1475,8 @@ done: int H5I_get_ref(hid_t id, hbool_t app_ref) { - H5I_id_info_t *id_ptr; /*ptr to the ID */ - int ret_value; /* Return value */ + H5I_id_info_t *id_ptr; /* Pointer to the ID */ + int ret_value = 0; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -1574,8 +1550,8 @@ done: static int H5I__inc_type_ref(H5I_type_t type) { - H5I_id_type_t *type_ptr; /* ptr to the type */ - int ret_value; /* Return value */ + H5I_id_type_t *type_ptr; /* Pointer to the type */ + int ret_value = -1; /* Return value */ FUNC_ENTER_STATIC @@ -1658,8 +1634,8 @@ done: herr_t H5I_dec_type_ref(H5I_type_t type) { - H5I_id_type_t *type_ptr; /* Pointer to the ID type */ - herr_t ret_value; /* Return value */ + H5I_id_type_t *type_ptr; /* Pointer to the ID type */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -1747,7 +1723,7 @@ static int H5I__get_type_ref(H5I_type_t type) { H5I_id_type_t *type_ptr; /*ptr to the type */ - int ret_value; /* Return value */ + int ret_value = -1; /* Return value */ FUNC_ENTER_STATIC @@ -1825,7 +1801,7 @@ static int H5I__search_cb(void *obj, hid_t id, void *_udata) { H5I_search_ud_t *udata = (H5I_search_ud_t *)_udata; /* User data for callback */ - int ret_value; /* Callback return value */ + int ret_value = -1; /* Callback return value */ FUNC_ENTER_STATIC_NOERR @@ -2013,7 +1989,7 @@ H5I__find_id(hid_t id) { H5I_type_t type; /*ID's type */ H5I_id_type_t *type_ptr; /*ptr to the type */ - H5I_id_info_t *ret_value; /*return value */ + H5I_id_info_t *ret_value = NULL; /* Return value */ FUNC_ENTER_STATIC_NOERR @@ -2130,7 +2106,7 @@ hid_t H5I_get_file_id(hid_t obj_id, hbool_t app_ref) { H5I_type_t type; /* ID type */ - hid_t ret_value; /* Return value */ + hid_t ret_value = H5I_INVALID_HID; /* Return value */ FUNC_ENTER_NOAPI_NOINIT diff --git a/src/H5Imodule.h b/src/H5Imodule.h new file mode 100644 index 0000000..19cc9a4 --- /dev/null +++ b/src/H5Imodule.h @@ -0,0 +1,35 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* + * Programmer: Quincey Koziol + * Saturday, September 12, 2015 + * + * Purpose: This file contains declarations which define macros for the + * H5I package. Including this header means that the source file + * is part of the H5I package. + */ +#ifndef _H5Imodule_H +#define _H5Imodule_H + +/* Define the proper control macros for the generic FUNC_ENTER/LEAVE and error + * reporting macros. + */ +#define H5I_MODULE +#define H5_MY_PKG H5I +#define H5_MY_PKG_ERR H5E_ATOM +#define H5_MY_PKG_INIT NO + +#endif /* _H5Imodule_H */ + diff --git a/src/H5Ipkg.h b/src/H5Ipkg.h index 1666b76..0a6ae8c 100644 --- a/src/H5Ipkg.h +++ b/src/H5Ipkg.h @@ -21,7 +21,7 @@ * the H5I package. Source files outside the H5I package should * include H5Iprivate.h instead. */ -#ifndef H5I_PACKAGE +#if !(defined H5I_FRIEND || defined H5I_MODULE) #error "Do not include this file outside the H5I package!" #endif diff --git a/src/H5Itest.c b/src/H5Itest.c index 5236e8d..9d451c6 100644 --- a/src/H5Itest.c +++ b/src/H5Itest.c @@ -23,7 +23,7 @@ /* Module Setup */ /****************/ -#define H5I_PACKAGE /*suppress error about including H5Ipkg */ +#include "H5Imodule.h" /* This source code file is part of the H5I module */ #define H5I_TESTING /*suppress warning about H5I testing funcs*/ @@ -80,7 +80,7 @@ ssize_t H5I_get_name_test(hid_t id, char *name/*out*/, size_t size, hbool_t *cached) { H5G_loc_t loc; /* Object location */ - ssize_t ret_value; /* Return value */ + ssize_t ret_value = -1; /* Return value */ FUNC_ENTER_NOAPI(FAIL) diff --git a/src/H5L.c b/src/H5L.c index 73d363e..a1f3b6e 100644 --- a/src/H5L.c +++ b/src/H5L.c @@ -17,10 +17,8 @@ /* Module Setup */ /****************/ -#define H5L_PACKAGE /*suppress error about including H5Lpkg */ +#include "H5Lmodule.h" /* This source code file is part of the H5L module */ -/* Interface initialization */ -#define H5_INTERFACE_INIT_FUNC H5L_init_interface /***********/ /* Headers */ @@ -191,6 +189,9 @@ static herr_t H5L_get_name_by_idx_cb(H5G_loc_t *grp_loc/*in*/, /* Package Variables */ /*********************/ +/* Package initialization variable */ +hbool_t H5_PKG_INIT_VAR = FALSE; + /*****************************/ /* Library Private Variables */ @@ -235,7 +236,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5L_init_interface + * Function: H5L__init_package * * Purpose: Initialize information specific to H5L interface. * @@ -246,12 +247,12 @@ done: * *------------------------------------------------------------------------- */ -static herr_t -H5L_init_interface(void) +herr_t +H5L__init_package(void) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* Initialize user-defined link classes */ if(H5L_register_external() < 0) @@ -259,13 +260,13 @@ H5L_init_interface(void) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5L_init_interface() */ +} /* end H5L_init_package() */ /*------------------------------------------------------------------------- - * Function: H5L_term_interface + * Function: H5L_term_package * - * Purpose: Terminate any resources allocated in H5L_init_interface. + * Purpose: Terminate any resources allocated in H5L__init_package. * * Return: Non-negative on success/Negative on failure * @@ -275,21 +276,27 @@ done: *------------------------------------------------------------------------- */ int -H5L_term_interface(void) +H5L_term_package(void) { int n = 0; FUNC_ENTER_NOAPI_NOINIT_NOERR - /* Free the table of link types */ - H5L_table_g = (H5L_class_t *)H5MM_xfree(H5L_table_g); - H5L_table_used_g = H5L_table_alloc_g = 0; + if(H5_PKG_INIT_VAR) { + /* Free the table of link types */ + if(H5L_table_g) { + H5L_table_g = (H5L_class_t *)H5MM_xfree(H5L_table_g); + H5L_table_used_g = H5L_table_alloc_g = 0; + n++; + } /* end if */ - /* Mark the interface as uninitialized */ - H5_interface_initialize_g = 0; + /* Mark the interface as uninitialized */ + if(0 == n) + H5_PKG_INIT_VAR = FALSE; + } /* end if */ FUNC_LEAVE_NOAPI(n) -} /* H5L_term_interface() */ +} /* H5L_term_package() */ /*------------------------------------------------------------------------- @@ -2756,7 +2763,7 @@ static htri_t H5L_exists(const H5G_loc_t *loc, const char *name, hid_t lapl_id, hid_t dxpl_id) { hbool_t exists = FALSE; /* Whether the link exists in the group */ - htri_t ret_value; /* Return value */ + htri_t ret_value = FAIL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -2913,7 +2920,7 @@ done: hid_t H5L_get_default_lcpl(void) { - hid_t ret_value; /* Return value */ + hid_t ret_value = H5I_INVALID_HID; /* Return value */ FUNC_ENTER_NOAPI(FAIL) diff --git a/src/H5Lexternal.c b/src/H5Lexternal.c index 08d401e..f3e7796 100644 --- a/src/H5Lexternal.c +++ b/src/H5Lexternal.c @@ -13,12 +13,17 @@ * access to either file, you may request a copy from help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#define H5G_PACKAGE /*suppress error about including H5Gpkg */ -#define H5L_PACKAGE /*suppress error about including H5Lpkg */ +/****************/ +/* Module Setup */ +/****************/ -/* Interface initialization */ -#define H5_INTERFACE_INIT_FUNC H5L_init_extern_interface +#define H5G_FRIEND /*suppress error about including H5Gpkg */ +#include "H5Lmodule.h" /* This source code file is part of the H5L module */ + +/***********/ +/* Headers */ +/***********/ #include "H5private.h" /* Generic Functions */ #include "H5ACprivate.h" /* Metadata cache */ #include "H5Eprivate.h" /* Error handling */ @@ -29,13 +34,52 @@ #include "H5Opublic.h" /* File objects */ #include "H5Pprivate.h" /* Property lists */ + +/****************/ +/* Local Macros */ +/****************/ + +/* Version of external link format */ +#define H5L_EXT_VERSION 0 + +/* Valid flags for external links */ +#define H5L_EXT_FLAGS_ALL 0 + +/* Size of local link name buffer for traversing external links */ +#define H5L_EXT_TRAVERSE_BUF_SIZE 256 + + +/******************/ +/* Local Typedefs */ +/******************/ + + +/********************/ +/* Local Prototypes */ +/********************/ + static hid_t H5L_extern_traverse(const char H5_ATTR_UNUSED *link_name, hid_t cur_group, const void *udata, size_t H5_ATTR_UNUSED udata_size, hid_t lapl_id); static ssize_t H5L_extern_query(const char H5_ATTR_UNUSED * link_name, const void *udata, size_t udata_size, void * buf /*out*/, size_t buf_size); + +/*********************/ +/* Package Variables */ +/*********************/ + + +/*****************************/ +/* Library Private Variables */ +/*****************************/ + + +/*******************/ +/* Local Variables */ +/*******************/ + /* Default External Link link class */ -const H5L_class_t H5L_EXTERN_LINK_CLASS[1] = {{ +static const H5L_class_t H5L_EXTERN_LINK_CLASS[1] = {{ H5L_LINK_CLASS_T_VERS, /* H5L_class_t version */ H5L_TYPE_EXTERNAL, /* Link type id number */ "external", /* Link name for debugging */ @@ -47,41 +91,9 @@ const H5L_class_t H5L_EXTERN_LINK_CLASS[1] = {{ H5L_extern_query /* Query callback */ }}; -/* Version of external link format */ -#define H5L_EXT_VERSION 0 - -/* Valid flags for external links */ -#define H5L_EXT_FLAGS_ALL 0 - -/* Size of local link name buffer for traversing external links */ -#define H5L_EXT_TRAVERSE_BUF_SIZE 256 /*-------------------------------------------------------------------------- -NAME - H5L_init_extern_interface -- Initialize interface-specific information -USAGE - herr_t H5L_init_extern_interface() - -RETURNS - Non-negative on success/Negative on failure - -DESCRIPTION - Initializes any interface-specific data or routines. (Just calls - H5L_init() currently). - ---------------------------------------------------------------------------*/ -static herr_t -H5L_init_extern_interface(void) -{ - FUNC_ENTER_NOAPI_NOINIT_NOERR - - FUNC_LEAVE_NOAPI(H5L_init()) -} /* H5L_init_extern_interface() */ - - - -/*-------------------------------------------------------------------------- * Function: H5L_getenv_prefix_name -- * * Purpose: Get the first pathname in the list of pathnames stored in ENV_PREFIX, @@ -210,7 +222,7 @@ H5L_extern_traverse(const char H5_ATTR_UNUSED *link_name, hid_t cur_group, char *actual_file_name = NULL; /* Parent file's actual name */ H5P_genplist_t *fa_plist; /* File access property list pointer */ H5F_close_degree_t fc_degree = H5F_CLOSE_WEAK; /* File close degree for target file */ - hid_t ret_value; /* Return value */ + hid_t ret_value = H5I_INVALID_HID; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -279,7 +291,7 @@ H5L_extern_traverse(const char H5_ATTR_UNUSED *link_name, hid_t cur_group, /* Check if we need to allocate larger buffer */ if((size_t)group_name_len > sizeof(local_group_name)) { if(NULL == (parent_group_name = (char *)H5MM_malloc((size_t)group_name_len))) - HGOTO_ERROR(H5E_LINK, H5E_CANTALLOC, FAIL, "can't allocate buffer to hold group name, group_name_len = %Zu", group_name_len) + HGOTO_ERROR(H5E_LINK, H5E_CANTALLOC, FAIL, "can't allocate buffer to hold group name, group_name_len = %zu", group_name_len) } /* end if */ else parent_group_name = local_group_name; diff --git a/src/H5Lmodule.h b/src/H5Lmodule.h new file mode 100644 index 0000000..e665c81 --- /dev/null +++ b/src/H5Lmodule.h @@ -0,0 +1,36 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* + * Programmer: Quincey Koziol + * Saturday, September 12, 2015 + * + * Purpose: This file contains declarations which define macros for the + * H5L package. Including this header means that the source file + * is part of the H5L package. + */ +#ifndef _H5Lmodule_H +#define _H5Lmodule_H + +/* Define the proper control macros for the generic FUNC_ENTER/LEAVE and error + * reporting macros. + */ +#define H5L_MODULE +#define H5_MY_PKG H5L +#define H5_MY_PKG_ERR H5E_LINK +#define H5_MY_PKG_INIT YES + +#endif /* _H5Lmodule_H */ + + diff --git a/src/H5Lpkg.h b/src/H5Lpkg.h index 2e931f5..bb8534b 100644 --- a/src/H5Lpkg.h +++ b/src/H5Lpkg.h @@ -21,7 +21,7 @@ * only within the H5L package. Source files outside the * H5L package should include H5Lprivate.h instead. */ -#ifndef H5L_PACKAGE +#if !(defined H5L_FRIEND || defined H5L_MODULE) #error "Do not include this file outside the H5L package!" #endif diff --git a/src/H5MF.c b/src/H5MF.c index 8a227d7..52ea82a 100644 --- a/src/H5MF.c +++ b/src/H5MF.c @@ -28,8 +28,8 @@ /* Module Setup */ /****************/ -#define H5F_PACKAGE /*suppress error about including H5Fpkg */ -#define H5MF_PACKAGE /*suppress error about including H5MFpkg */ +#define H5F_FRIEND /*suppress error about including H5Fpkg */ +#include "H5MFmodule.h" /* This source code file is part of the H5MF module */ /***********/ @@ -92,6 +92,9 @@ static herr_t H5MF_alloc_close(H5F_t *f, hid_t dxpl_id, H5FD_mem_t type); /* Package Variables */ /*********************/ +/* Package initialization variable */ +hbool_t H5_PKG_INIT_VAR = FALSE; + /*****************************/ /* Library Private Variables */ @@ -436,7 +439,7 @@ H5MF_alloc(H5F_t *f, H5FD_mem_t alloc_type, hid_t dxpl_id, hsize_t size) H5P_genplist_t *dxpl = NULL; /* DXPL for setting ring */ H5AC_ring_t orig_ring = H5AC_RING_INV; /* Original ring value */ H5FD_mem_t fs_type; /* Free space type (mapped from allocation type) */ - haddr_t ret_value; /* Return value */ + haddr_t ret_value = HADDR_UNDEF; /* Return value */ FUNC_ENTER_NOAPI(HADDR_UNDEF) #ifdef H5MF_ALLOC_DEBUG @@ -571,7 +574,7 @@ haddr_t H5MF_alloc_tmp(H5F_t *f, hsize_t size) { haddr_t eoa; /* End of allocated space in the file */ - haddr_t ret_value; /* Return value */ + haddr_t ret_value = HADDR_UNDEF; /* Return value */ FUNC_ENTER_NOAPI(HADDR_UNDEF) #ifdef H5MF_ALLOC_DEBUG @@ -796,7 +799,7 @@ H5MF_try_extend(H5F_t *f, hid_t dxpl_id, H5FD_mem_t alloc_type, haddr_t addr, H5AC_ring_t orig_ring = H5AC_RING_INV; /* Original ring value */ haddr_t end; /* End of block to extend */ H5FD_mem_t map_type; /* Mapped type */ - htri_t ret_value; /* Return value */ + htri_t ret_value = FAIL; /* Return value */ FUNC_ENTER_NOAPI(FAIL) #ifdef H5MF_ALLOC_DEBUG @@ -1029,7 +1032,7 @@ H5MF_try_shrink(H5F_t *f, H5FD_mem_t alloc_type, hid_t dxpl_id, haddr_t addr, H5MF_sect_ud_t udata; /* User data for callback */ H5P_genplist_t *dxpl = NULL; /* DXPL for setting ring */ H5AC_ring_t orig_ring = H5AC_RING_INV; /* Original ring value */ - htri_t ret_value; /* Return value */ + htri_t ret_value = FAIL; /* Return value */ FUNC_ENTER_NOAPI(FAIL) #ifdef H5MF_ALLOC_DEBUG @@ -1411,7 +1414,7 @@ H5MF_get_free_sections(H5F_t *f, hid_t dxpl_id, H5FD_mem_t type, size_t nsects, H5AC_ring_t orig_ring = H5AC_RING_INV; /* Original ring value */ H5FD_mem_t start_type, end_type; /* Memory types to iterate over */ H5FD_mem_t ty; /* Memory type for iteration */ - ssize_t ret_value; /* Return value */ + ssize_t ret_value = -1; /* Return value */ FUNC_ENTER_NOAPI(FAIL) diff --git a/src/H5MFaggr.c b/src/H5MFaggr.c index c5a7b49..40f3ac0 100644 --- a/src/H5MFaggr.c +++ b/src/H5MFaggr.c @@ -25,8 +25,8 @@ /* Module Setup */ /****************/ -#define H5F_PACKAGE /*suppress error about including H5Fpkg */ -#define H5MF_PACKAGE /*suppress error about including H5MFpkg */ +#define H5F_FRIEND /*suppress error about including H5Fpkg */ +#include "H5MFmodule.h" /* This source code file is part of the H5MF module */ /***********/ @@ -97,7 +97,7 @@ static herr_t H5MF_aggr_free(H5F_t *f, hid_t dxpl_id, H5FD_mem_t type, haddr_t H5MF_aggr_vfd_alloc(H5F_t *f, H5FD_mem_t alloc_type, hid_t dxpl_id, hsize_t size) { - haddr_t ret_value; /* Return value */ + haddr_t ret_value = HADDR_UNDEF; /* Return value */ FUNC_ENTER_NOAPI(HADDR_UNDEF) #ifdef H5MF_ALLOC_DEBUG @@ -158,7 +158,7 @@ H5MF_aggr_alloc(H5F_t *f, hid_t dxpl_id, H5F_blk_aggr_t *aggr, haddr_t eoa_frag_addr = HADDR_UNDEF; /* Address of fragment at EOA */ hsize_t eoa_frag_size = 0; /* Size of fragment at EOA */ haddr_t eoa = HADDR_UNDEF; /* Initial EOA for the file */ - haddr_t ret_value; /* Return value */ + haddr_t ret_value = HADDR_UNDEF; /* Return value */ FUNC_ENTER_NOAPI(HADDR_UNDEF) #ifdef H5MF_AGGR_DEBUG @@ -871,7 +871,7 @@ H5MF_aggrs_try_shrink_eoa(H5F_t *f, hid_t dxpl_id) { htri_t ma_status; /* Whether the metadata aggregator can shrink the EOA */ htri_t sda_status; /* Whether the small data aggregator can shrink the EOA */ - htri_t ret_value; /* Return value */ + htri_t ret_value = FAIL; /* Return value */ FUNC_ENTER_NOAPI(FAIL) diff --git a/src/H5MFdbg.c b/src/H5MFdbg.c index 3a664ef..59da9e8 100644 --- a/src/H5MFdbg.c +++ b/src/H5MFdbg.c @@ -28,8 +28,8 @@ /* Module Setup */ /****************/ -#define H5F_PACKAGE /*suppress error about including H5Fpkg */ -#define H5MF_PACKAGE /*suppress error about including H5MFpkg */ +#define H5F_FRIEND /*suppress error about including H5Fpkg */ +#include "H5MFmodule.h" /* This source code file is part of the H5MF module */ #define H5MF_DEBUGGING /* Need access to file space debugging routines */ diff --git a/src/H5MFmodule.h b/src/H5MFmodule.h new file mode 100644 index 0000000..6e5f8ad --- /dev/null +++ b/src/H5MFmodule.h @@ -0,0 +1,35 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* + * Programmer: Quincey Koziol + * Saturday, September 12, 2015 + * + * Purpose: This file contains declarations which define macros for the + * H5MF package. Including this header means that the source file + * is part of the H5MF package. + */ +#ifndef _H5MFmodule_H +#define _H5MFmodule_H + +/* Define the proper control macros for the generic FUNC_ENTER/LEAVE and error + * reporting macros. + */ +#define H5MF_MODULE +#define H5_MY_PKG H5MF +#define H5_MY_PKG_ERR H5E_RESOURCE +#define H5_MY_PKG_INIT NO + +#endif /* _H5MFmodule_H */ + diff --git a/src/H5MFpkg.h b/src/H5MFpkg.h index 2071a0a..1a62710 100644 --- a/src/H5MFpkg.h +++ b/src/H5MFpkg.h @@ -21,7 +21,7 @@ * the H5MF package. Source files outside the H5MF package should * include H5MFprivate.h instead. */ -#ifndef H5MF_PACKAGE +#if !(defined H5MF_FRIEND || defined H5MF_MODULE) #error "Do not include this file outside the H5MF package!" #endif diff --git a/src/H5MFsection.c b/src/H5MFsection.c index 20b9984..f333356 100644 --- a/src/H5MFsection.c +++ b/src/H5MFsection.c @@ -25,8 +25,8 @@ /* Module Setup */ /****************/ -#define H5F_PACKAGE /*suppress error about including H5Fpkg */ -#define H5MF_PACKAGE /*suppress error about including H5MFpkg */ +#define H5F_FRIEND /*suppress error about including H5Fpkg */ +#include "H5MFmodule.h" /* This source code file is part of the H5MF module */ /***********/ @@ -132,7 +132,7 @@ H5MF_free_section_t * H5MF_sect_simple_new(haddr_t sect_off, hsize_t sect_size) { H5MF_free_section_t *sect = NULL; /* 'Simple' free space section to add */ - H5MF_free_section_t *ret_value; /* Return value */ + H5MF_free_section_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -178,7 +178,7 @@ H5MF_sect_simple_deserialize(const H5FS_section_class_t H5_ATTR_UNUSED *cls, hsize_t sect_size, unsigned H5_ATTR_UNUSED *des_flags) { H5MF_free_section_t *sect; /* New section */ - H5FS_section_info_t *ret_value; /* Return value */ + H5FS_section_info_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -219,7 +219,7 @@ H5MF_sect_simple_can_merge(const H5FS_section_info_t *_sect1, { const H5MF_free_section_t *sect1 = (const H5MF_free_section_t *)_sect1; /* File free section */ const H5MF_free_section_t *sect2 = (const H5MF_free_section_t *)_sect2; /* File free section */ - htri_t ret_value; /* Return value */ + htri_t ret_value = FAIL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -300,7 +300,7 @@ H5MF_sect_simple_can_shrink(const H5FS_section_info_t *_sect, void *_udata) H5MF_sect_ud_t *udata = (H5MF_sect_ud_t *)_udata; /* User data for callback */ haddr_t eoa; /* End of address space in the file */ haddr_t end; /* End of section to extend */ - htri_t ret_value; /* Return value */ + htri_t ret_value = FAIL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -519,7 +519,7 @@ H5MF_sect_simple_valid(const H5FS_section_class_t H5_ATTR_UNUSED *cls, static H5FS_section_info_t * H5MF_sect_simple_split(H5FS_section_info_t *sect, hsize_t frag_size) { - H5MF_free_section_t *ret_value; /* Return value */ + H5MF_free_section_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT diff --git a/src/H5MP.c b/src/H5MP.c index 4820b76..50fc598 100644 --- a/src/H5MP.c +++ b/src/H5MP.c @@ -29,7 +29,7 @@ *------------------------------------------------------------------------- */ -#define H5MP_PACKAGE /*suppress error about including H5MPpkg */ +#include "H5MPmodule.h" /* This source code file is part of the H5MP module */ /* Private headers */ #include "H5private.h" /* Generic Functions */ @@ -63,6 +63,9 @@ /* Package Variable Definitions */ /********************************/ +/* Package initialization variable */ +hbool_t H5_PKG_INIT_VAR = FALSE; + /********************/ /* Static Variables */ @@ -90,7 +93,7 @@ H5MP_pool_t * H5MP_create(size_t page_size, unsigned flags) { H5MP_pool_t *mp = NULL; /* New memory pool header */ - H5MP_pool_t *ret_value; /* Return value */ + H5MP_pool_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI(NULL) @@ -141,7 +144,7 @@ H5MP_new_page(H5MP_pool_t *mp, size_t page_size) { H5MP_page_t *new_page; /* New page created */ H5MP_page_blk_t *first_blk; /* Pointer to first block in page */ - H5MP_page_t *ret_value; /* Return value */ + H5MP_page_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -212,7 +215,7 @@ H5MP_malloc (H5MP_pool_t *mp, size_t request) H5MP_page_t *alloc_page = NULL; /* Page to allocate space from */ H5MP_page_blk_t *alloc_free; /* Pointer to free space in page */ size_t needed; /* Size requested, plus block header and alignment */ - void *ret_value; /* Return value */ + void *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI(NULL) diff --git a/src/H5MPmodule.h b/src/H5MPmodule.h new file mode 100644 index 0000000..ca6c405 --- /dev/null +++ b/src/H5MPmodule.h @@ -0,0 +1,35 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* + * Programmer: Quincey Koziol + * Saturday, September 12, 2015 + * + * Purpose: This file contains declarations which define macros for the + * H5MP package. Including this header means that the source file + * is part of the H5MP package. + */ +#ifndef _H5MPmodule_H +#define _H5MPmodule_H + +/* Define the proper control macros for the generic FUNC_ENTER/LEAVE and error + * reporting macros. + */ +#define H5MP_MODULE +#define H5_MY_PKG H5MP +#define H5_MY_PKG_ERR H5E_RESOURCE +#define H5_MY_PKG_INIT NO + +#endif /* _H5MPmodule_H */ + diff --git a/src/H5MPpkg.h b/src/H5MPpkg.h index 5a0b1f8..e724146 100644 --- a/src/H5MPpkg.h +++ b/src/H5MPpkg.h @@ -21,7 +21,7 @@ * the H5MP package. Source files outside the H5MP package should * include H5MPprivate.h instead. */ -#ifndef H5MP_PACKAGE +#if !(defined H5MP_FRIEND || defined H5MP_MODULE) #error "Do not include this file outside the H5MP package!" #endif diff --git a/src/H5MPtest.c b/src/H5MPtest.c index ccbd140..3f218db 100644 --- a/src/H5MPtest.c +++ b/src/H5MPtest.c @@ -19,7 +19,7 @@ * Purpose: Memory pool testing functions. */ -#define H5MP_PACKAGE /*suppress error about including H5MPpkg */ +#include "H5MPmodule.h" /* This source code file is part of the H5MP module */ #define H5MP_TESTING /*include H5MP testing funcs*/ /* Private headers */ diff --git a/src/H5O.c b/src/H5O.c index 6b9852b..6478f34 100644 --- a/src/H5O.c +++ b/src/H5O.c @@ -28,10 +28,8 @@ /* Module Setup */ /****************/ -#define H5O_PACKAGE /*suppress error about including H5Opkg */ +#include "H5Omodule.h" /* This source code file is part of the H5O module */ -/* Interface initialization */ -#define H5_INTERFACE_INIT_FUNC H5O_init_interface /***********/ /* Headers */ @@ -94,6 +92,9 @@ static const H5O_obj_class_t *H5O_obj_class_real(H5O_t *oh); /* Package Variables */ /*********************/ +/* Package initialization variable */ +hbool_t H5_PKG_INIT_VAR = FALSE; + /* Header message ID to class mapping */ /* Remember to increment H5O_MSG_TYPES in H5Opkg.h when adding a new @@ -178,7 +179,7 @@ static const H5O_obj_class_t *const H5O_obj_class_g[] = { /*------------------------------------------------------------------------- - * Function: H5O_init_interface + * Function: H5O__init_package * * Purpose: Initialize information specific to H5O interface. * @@ -187,16 +188,12 @@ static const H5O_obj_class_t *const H5O_obj_class_g[] = { * Programmer: Quincey Koziol * Thursday, January 18, 2007 * - * Changes: JRM -- 12/12/07 - * Added santity check verifying that H5O_msg_class_g - * is big enough. - * *------------------------------------------------------------------------- */ -static herr_t -H5O_init_interface(void) +herr_t +H5O__init_package(void) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_PACKAGE_NOERR /* H5O interface sanity checks */ HDcompile_assert(H5O_MSG_TYPES == NELMTS(H5O_msg_class_g)); @@ -205,7 +202,7 @@ H5O_init_interface(void) HDcompile_assert(H5O_UNKNOWN_ID < H5O_MSG_TYPES); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_init_interface() */ +} /* end H5O__init_package() */ /*------------------------------------------------------------------------- @@ -247,7 +244,7 @@ H5Oopen(hid_t loc_id, const char *name, hid_t lapl_id) /* Open the object */ if((ret_value = H5O_open_name(&loc, name, lapl_id, TRUE)) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open object") + HGOTO_ERROR(H5E_OHDR, H5E_CANTOPENOBJ, FAIL, "unable to open object") done: FUNC_LEAVE_API(ret_value) @@ -313,18 +310,18 @@ H5Oopen_by_idx(hid_t loc_id, const char *group_name, H5_index_t idx_type, /* Find the object's location, according to the order in the index */ if(H5G_loc_find_by_idx(&loc, group_name, idx_type, order, n, &obj_loc/*out*/, lapl_id, H5AC_ind_dxpl_id) < 0) - HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "group not found") + HGOTO_ERROR(H5E_OHDR, H5E_NOTFOUND, FAIL, "group not found") loc_found = TRUE; /* Open the object */ if((ret_value = H5O_open_by_loc(&obj_loc, lapl_id, H5AC_ind_dxpl_id, TRUE)) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open object") + HGOTO_ERROR(H5E_OHDR, H5E_CANTOPENOBJ, FAIL, "unable to open object") done: /* Release the object location if we failed after copying it */ if(ret_value < 0 && loc_found) if(H5G_loc_free(&obj_loc) < 0) - HDONE_ERROR(H5E_SYM, H5E_CANTRELEASE, FAIL, "can't free location") + HDONE_ERROR(H5E_OHDR, H5E_CANTRELEASE, FAIL, "can't free location") FUNC_LEAVE_API(ret_value) } /* end H5Oopen_by_idx() */ @@ -394,7 +391,7 @@ H5Oopen_by_addr(hid_t loc_id, haddr_t addr) /* Open the object */ if((ret_value = H5O_open_by_loc(&obj_loc, lapl_id, H5AC_ind_dxpl_id, TRUE)) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open object") + HGOTO_ERROR(H5E_OHDR, H5E_CANTOPENOBJ, FAIL, "unable to open object") done: @@ -453,7 +450,7 @@ H5Olink(hid_t obj_id, hid_t new_loc_id, const char *new_name, hid_t lcpl_id, /* Link to the object */ if(H5L_link(&new_loc, new_name, &obj_loc, lcpl_id, lapl_id, H5AC_dxpl_id) < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "unable to create link") + HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "unable to create link") done: FUNC_LEAVE_API(ret_value) @@ -614,7 +611,7 @@ H5Oget_info(hid_t loc_id, H5O_info_t *oinfo) /* Retrieve the object's information */ if(H5G_loc_info(&loc, ".", TRUE, oinfo/*out*/, H5P_LINK_ACCESS_DEFAULT, H5AC_ind_dxpl_id) < 0) - HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "object not found") + HGOTO_ERROR(H5E_OHDR, H5E_NOTFOUND, FAIL, "object not found") done: FUNC_LEAVE_API(ret_value) @@ -658,7 +655,7 @@ H5Oget_info_by_name(hid_t loc_id, const char *name, H5O_info_t *oinfo, hid_t lap /* Retrieve the object's information */ if(H5G_loc_info(&loc, name, TRUE, oinfo/*out*/, lapl_id, H5AC_ind_dxpl_id) < 0) - HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "object not found") + HGOTO_ERROR(H5E_OHDR, H5E_NOTFOUND, FAIL, "object not found") done: FUNC_LEAVE_API(ret_value) @@ -718,17 +715,17 @@ H5Oget_info_by_idx(hid_t loc_id, const char *group_name, H5_index_t idx_type, /* Find the object's location, according to the order in the index */ if(H5G_loc_find_by_idx(&loc, group_name, idx_type, order, n, &obj_loc/*out*/, lapl_id, H5AC_ind_dxpl_id) < 0) - HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "group not found") + HGOTO_ERROR(H5E_OHDR, H5E_NOTFOUND, FAIL, "group not found") loc_found = TRUE; /* Retrieve the object's information */ if(H5O_get_info(obj_loc.oloc, H5AC_ind_dxpl_id, TRUE, oinfo) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't retrieve object info") + HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't retrieve object info") done: /* Release the object location */ if(loc_found && H5G_loc_free(&obj_loc) < 0) - HDONE_ERROR(H5E_SYM, H5E_CANTRELEASE, FAIL, "can't free location") + HDONE_ERROR(H5E_OHDR, H5E_CANTRELEASE, FAIL, "can't free location") FUNC_LEAVE_API(ret_value) } /* end H5Oget_info_by_idx() */ @@ -766,7 +763,7 @@ H5Oset_comment(hid_t obj_id, const char *comment) /* (Re)set the object's comment */ if(H5G_loc_set_comment(&loc, ".", comment, H5P_LINK_ACCESS_DEFAULT, H5AC_ind_dxpl_id) < 0) - HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "object not found") + HGOTO_ERROR(H5E_OHDR, H5E_NOTFOUND, FAIL, "object not found") done: FUNC_LEAVE_API(ret_value) @@ -813,7 +810,7 @@ H5Oset_comment_by_name(hid_t loc_id, const char *name, const char *comment, /* (Re)set the object's comment */ if(H5G_loc_set_comment(&loc, name, comment, lapl_id, H5AC_ind_dxpl_id) < 0) - HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "object not found") + HGOTO_ERROR(H5E_OHDR, H5E_NOTFOUND, FAIL, "object not found") done: FUNC_LEAVE_API(ret_value) @@ -851,7 +848,7 @@ H5Oget_comment(hid_t obj_id, char *comment, size_t bufsize) /* Retrieve the object's comment */ if((ret_value = H5G_loc_get_comment(&loc, ".", comment/*out*/, bufsize, H5P_LINK_ACCESS_DEFAULT, H5AC_ind_dxpl_id)) < 0) - HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "object not found") + HGOTO_ERROR(H5E_OHDR, H5E_NOTFOUND, FAIL, "object not found") done: FUNC_LEAVE_API(ret_value) @@ -897,7 +894,7 @@ H5Oget_comment_by_name(hid_t loc_id, const char *name, char *comment, size_t buf /* Retrieve the object's comment */ if((ret_value = H5G_loc_get_comment(&loc, name, comment/*out*/, bufsize, lapl_id, H5AC_ind_dxpl_id)) < 0) - HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "object not found") + HGOTO_ERROR(H5E_OHDR, H5E_NOTFOUND, FAIL, "object not found") done: FUNC_LEAVE_API(ret_value) @@ -955,7 +952,7 @@ H5Ovisit(hid_t obj_id, H5_index_t idx_type, H5_iter_order_t order, /* Call internal object visitation routine */ if((ret_value = H5O_visit(obj_id, ".", idx_type, order, op, op_data, H5P_LINK_ACCESS_DEFAULT, H5AC_ind_dxpl_id)) < 0) - HGOTO_ERROR(H5E_SYM, H5E_BADITER, FAIL, "object visitation failed") + HGOTO_ERROR(H5E_OHDR, H5E_BADITER, FAIL, "object visitation failed") done: FUNC_LEAVE_API(ret_value) @@ -1021,7 +1018,7 @@ H5Ovisit_by_name(hid_t loc_id, const char *obj_name, H5_index_t idx_type, /* Call internal object visitation routine */ if((ret_value = H5O_visit(loc_id, obj_name, idx_type, order, op, op_data, lapl_id, H5AC_ind_dxpl_id)) < 0) - HGOTO_ERROR(H5E_SYM, H5E_BADITER, FAIL, "object visitation failed") + HGOTO_ERROR(H5E_OHDR, H5E_BADITER, FAIL, "object visitation failed") done: FUNC_LEAVE_API(ret_value) @@ -1365,17 +1362,17 @@ H5O_open_name(H5G_loc_t *loc, const char *name, hid_t lapl_id, hbool_t app_ref) /* Find the object's location */ if(H5G_loc_find(loc, name, &obj_loc/*out*/, lapl_id, dxpl_id) < 0) - HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "object not found") + HGOTO_ERROR(H5E_OHDR, H5E_NOTFOUND, FAIL, "object not found") loc_found = TRUE; /* Open the object */ if((ret_value = H5O_open_by_loc(&obj_loc, lapl_id, dxpl_id, app_ref)) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open object") + HGOTO_ERROR(H5E_OHDR, H5E_CANTOPENOBJ, FAIL, "unable to open object") done: if(ret_value < 0 && loc_found) if(H5G_loc_free(&obj_loc) < 0) - HDONE_ERROR(H5E_SYM, H5E_CANTRELEASE, FAIL, "can't free location") + HDONE_ERROR(H5E_OHDR, H5E_CANTRELEASE, FAIL, "can't free location") FUNC_LEAVE_NOAPI(ret_value) } /* end H5O_open_name() */ @@ -1398,7 +1395,7 @@ hid_t H5O_open_by_loc(const H5G_loc_t *obj_loc, hid_t lapl_id, hid_t dxpl_id, hbool_t app_ref) { const H5O_obj_class_t *obj_class; /* Class of object for location */ - hid_t ret_value; /* Return value */ + hid_t ret_value = H5I_INVALID_HID; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -1494,7 +1491,7 @@ int H5O_link_oh(H5F_t *f, int adjust, hid_t dxpl_id, H5O_t *oh, hbool_t *deleted) { haddr_t addr = H5O_OH_GET_ADDR(oh); /* Object header address */ - int ret_value; /* Return value */ + int ret_value = -1; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -1610,7 +1607,7 @@ H5O_link(const H5O_loc_t *loc, int adjust, hid_t dxpl_id) { H5O_t *oh = NULL; hbool_t deleted = FALSE; /* Whether the object was deleted */ - int ret_value; /* Return value */ + int ret_value = -1; /* Return value */ FUNC_ENTER_NOAPI_TAG(dxpl_id, loc->addr, FAIL) @@ -1661,7 +1658,7 @@ H5O_protect(const H5O_loc_t *loc, hid_t dxpl_id, unsigned prot_flags) H5O_cache_ud_t udata; /* User data for protecting object header */ H5O_cont_msgs_t cont_msg_info; /* Continuation message info */ unsigned file_intent; /* R/W intent on file */ - H5O_t *ret_value; /* Return value */ + H5O_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_TAG(dxpl_id, loc->addr, NULL) @@ -1880,8 +1877,8 @@ done: H5O_t * H5O_pin(const H5O_loc_t *loc, hid_t dxpl_id) { - H5O_t *oh = NULL; /* Object header */ - H5O_t *ret_value; /* Return value */ + H5O_t *oh = NULL; /* Object header */ + H5O_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI(NULL) @@ -2375,7 +2372,7 @@ const H5O_obj_class_t * H5O_obj_class(const H5O_loc_t *loc, hid_t dxpl_id) { H5O_t *oh = NULL; /* Object header for location */ - const H5O_obj_class_t *ret_value; /* Return value */ + const H5O_obj_class_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_TAG(dxpl_id, loc->addr, NULL) @@ -2412,7 +2409,7 @@ static const H5O_obj_class_t * H5O_obj_class_real(H5O_t *oh) { size_t i; /* Local index variable */ - const H5O_obj_class_t *ret_value; /* Return value */ + const H5O_obj_class_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI(NULL) @@ -2454,7 +2451,7 @@ done: H5O_loc_t * H5O_get_loc(hid_t object_id) { - H5O_loc_t *ret_value; /* Return value */ + H5O_loc_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -3274,7 +3271,7 @@ H5O_visit(hid_t loc_id, const char *obj_name, H5_index_t idx_type, hbool_t loc_found = FALSE; /* Entry at 'name' found */ H5O_info_t oinfo; /* Object info struct */ hid_t obj_id = (-1); /* ID of object */ - herr_t ret_value; /* Return value */ + herr_t ret_value = FAIL; /* Return value */ FUNC_ENTER_NOAPI(FAIL) diff --git a/src/H5Oainfo.c b/src/H5Oainfo.c index 4949b23..c5f692d 100644 --- a/src/H5Oainfo.c +++ b/src/H5Oainfo.c @@ -24,8 +24,9 @@ *------------------------------------------------------------------------- */ -#define H5A_PACKAGE /*suppress error about including H5Apkg */ -#define H5O_PACKAGE /*suppress error about including H5Opkg */ +#define H5A_FRIEND /*suppress error about including H5Apkg */ +#include "H5Omodule.h" /* This source code file is part of the H5O module */ + #include "H5private.h" /* Generic Functions */ #include "H5Apkg.h" /* Attributes */ @@ -110,7 +111,7 @@ H5O_ainfo_decode(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED *o { H5O_ainfo_t *ainfo = NULL; /* Attribute info */ unsigned char flags; /* Flags for encoding attribute info */ - void *ret_value; /* Return value */ + void *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -239,7 +240,7 @@ H5O_ainfo_copy(const void *_mesg, void *_dest) { const H5O_ainfo_t *ainfo = (const H5O_ainfo_t *)_mesg; H5O_ainfo_t *dest = (H5O_ainfo_t *) _dest; - void *ret_value; /* Return value */ + void *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -279,7 +280,7 @@ static size_t H5O_ainfo_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const void *_mesg) { const H5O_ainfo_t *ainfo = (const H5O_ainfo_t *)_mesg; - size_t ret_value; /* Return value */ + size_t ret_value = 0; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -408,7 +409,7 @@ H5O_ainfo_copy_file(H5F_t *file_src, void *mesg_src, H5F_t *file_dst, { H5O_ainfo_t *ainfo_src = (H5O_ainfo_t *)mesg_src; H5O_ainfo_t *ainfo_dst = NULL; - void *ret_value; /* Return value */ + void *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT diff --git a/src/H5Oalloc.c b/src/H5Oalloc.c index e9d4f85..3d930f0 100644 --- a/src/H5Oalloc.c +++ b/src/H5Oalloc.c @@ -28,7 +28,8 @@ /* Module Setup */ /****************/ -#define H5O_PACKAGE /*suppress error about including H5Opkg */ +#include "H5Omodule.h" /* This source code file is part of the H5O module */ + /***********/ /* Headers */ @@ -515,7 +516,7 @@ H5O_alloc_extend_chunk(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned chunkno, uint8_t *old_image; /* Old address of chunk's image in memory */ size_t old_size; /* Old size of chunk */ htri_t was_extended; /* If chunk can be extended */ - size_t extend_msg; /* Index of null message to extend */ + size_t extend_msg = 0; /* Index of null message to extend */ hbool_t extended_msg = FALSE; /* Whether an existing message was extended */ uint8_t new_size_flags = 0; /* New chunk #0 size flags */ hbool_t adjust_size_flags = FALSE; /* Whether to adjust the chunk #0 size flags */ @@ -1458,7 +1459,7 @@ H5O_move_msgs_forward(H5F_t *f, hid_t dxpl_id, H5O_t *oh) hbool_t curr_chk_dirtied = FALSE; /* Flags for unprotecting curr chunk */ hbool_t packed_msg; /* Flag to indicate that messages were packed */ hbool_t did_packing = FALSE; /* Whether any messages were packed */ - htri_t ret_value; /* Return value */ + htri_t ret_value = FAIL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -1742,7 +1743,7 @@ H5O_merge_null(H5F_t *f, hid_t dxpl_id, H5O_t *oh) { hbool_t merged_msg; /* Flag to indicate that messages were merged */ hbool_t did_merging = FALSE; /* Whether any messages were merged */ - htri_t ret_value; /* Return value */ + htri_t ret_value = FAIL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -1877,7 +1878,7 @@ H5O_remove_empty_chunks(H5F_t *f, hid_t dxpl_id, H5O_t *oh) { hbool_t deleted_chunk; /* Whether to a chunk was deleted */ hbool_t did_deleting = FALSE; /* Whether any chunks were deleted */ - htri_t ret_value; /* Return value */ + htri_t ret_value = FAIL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT diff --git a/src/H5Oattr.c b/src/H5Oattr.c index fd7fcda..9cbcdc4 100644 --- a/src/H5Oattr.c +++ b/src/H5Oattr.c @@ -13,9 +13,9 @@ * access to either file, you may request a copy from help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#define H5A_PACKAGE /*prevent warning from including H5Apkg */ -#define H5O_PACKAGE /*suppress error about including H5Opkg */ -#define H5S_PACKAGE /*suppress error about including H5Spkg */ +#define H5A_FRIEND /*suppress error about including H5Apkg */ +#include "H5Omodule.h" /* This source code file is part of the H5O module */ +#define H5S_FRIEND /*suppress error about including H5Spkg */ #include "H5private.h" /* Generic Functions */ @@ -129,7 +129,7 @@ H5O_attr_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned H5_ATTR_UNUSED H5S_extent_t *extent; /*extent dimensionality information */ size_t name_len; /*attribute name length */ unsigned flags = 0; /* Attribute flags */ - H5A_t *ret_value; /* Return value */ + H5A_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -380,7 +380,7 @@ done: static void * H5O_attr_copy(const void *_src, void *_dst) { - void *ret_value; /* Return value */ + void *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -496,10 +496,6 @@ H5O_attr_reset(void H5_ATTR_UNUSED *_mesg) * Programmer: Quincey Koziol * Thursday, November 18, 2004 * - * Modification:Raymond Lu - * 4 June 2008 - * Let this function call H5A_close in turn. - * *------------------------------------------------------------------------- */ static herr_t @@ -652,7 +648,7 @@ H5O_attr_copy_file(H5F_t *file_src, const H5O_msg_class_t H5_ATTR_UNUSED *mesg_t void *native_src, H5F_t *file_dst, hbool_t *recompute_size, H5O_copy_t *cpy_info, void H5_ATTR_UNUSED *udata, hid_t dxpl_id) { - void *ret_value; /* Return value */ + void *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT diff --git a/src/H5Oattribute.c b/src/H5Oattribute.c index 52f414b..9b494a1 100644 --- a/src/H5Oattribute.c +++ b/src/H5Oattribute.c @@ -28,8 +28,9 @@ /* Module Setup */ /****************/ -#define H5A_PACKAGE /*suppress error about including H5Apkg */ -#define H5O_PACKAGE /*suppress error about including H5Opkg */ +#define H5A_FRIEND /*suppress error about including H5Apkg */ +#include "H5Omodule.h" /* This source code file is part of the H5O module */ + /***********/ /* Headers */ @@ -474,7 +475,7 @@ H5O_attr_open_by_name(const H5O_loc_t *loc, const char *name, hid_t dxpl_id) H5A_t *exist_attr = NULL; /* Existing opened attribute object */ H5A_t *opened_attr = NULL; /* Newly opened attribute object */ htri_t found_open_attr = FALSE; /* Whether opened object is found */ - H5A_t *ret_value; /* Return value */ + H5A_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_TAG(dxpl_id, loc->addr, NULL) @@ -616,7 +617,7 @@ H5O_attr_open_by_idx(const H5O_loc_t *loc, H5_index_t idx_type, H5A_t *exist_attr = NULL; /* Existing opened attribute object */ H5A_t *opened_attr = NULL; /* Newly opened attribute object */ htri_t found_open_attr = FALSE; /* Whether opened object is found */ - H5A_t *ret_value; /* Return value */ + H5A_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -1272,7 +1273,7 @@ H5O_attr_iterate_real(hid_t loc_id, const H5O_loc_t *loc, hid_t dxpl_id, H5O_t *oh = NULL; /* Pointer to actual object header */ H5O_ainfo_t ainfo; /* Attribute information for object */ H5A_attr_table_t atable = {0, NULL}; /* Table of attributes */ - herr_t ret_value; /* Return value */ + herr_t ret_value = FAIL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_TAG(dxpl_id, loc->addr, FAIL) @@ -1357,7 +1358,7 @@ H5O_attr_iterate(hid_t loc_id, hid_t dxpl_id, hsize_t *last_attr, const H5A_attr_iter_op_t *attr_op, void *op_data) { H5G_loc_t loc; /* Object location */ - herr_t ret_value; /* Return value */ + herr_t ret_value = FAIL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -1837,7 +1838,7 @@ H5O_attr_exists(const H5O_loc_t *loc, const char *name, hid_t dxpl_id) { H5O_t *oh = NULL; /* Pointer to actual object header */ H5O_ainfo_t ainfo; /* Attribute information for object */ - htri_t ret_value; /* Return value */ + htri_t ret_value = FAIL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_TAG(dxpl_id, loc->addr, FAIL) @@ -1992,7 +1993,7 @@ H5O_attr_count(const H5O_loc_t *loc, hid_t dxpl_id) { H5O_t *oh = NULL; /* Pointer to actual object header */ hsize_t nattrs; /* Number of attributes */ - int ret_value; /* Return value */ + int ret_value = -1; /* Return value */ FUNC_ENTER_NOAPI_NOINIT diff --git a/src/H5Obogus.c b/src/H5Obogus.c index b368ab6..de205f6 100644 --- a/src/H5Obogus.c +++ b/src/H5Obogus.c @@ -28,7 +28,8 @@ *------------------------------------------------------------------------- */ -#define H5O_PACKAGE /*suppress error about including H5Opkg */ +#include "H5Omodule.h" /* This source code file is part of the H5O module */ + #include "H5private.h" /* Generic Functions */ #include "H5Eprivate.h" /* Error handling */ diff --git a/src/H5Obtreek.c b/src/H5Obtreek.c index 802f23a..ac6fe37 100644 --- a/src/H5Obtreek.c +++ b/src/H5Obtreek.c @@ -21,7 +21,8 @@ * information in the superblock extension. */ -#define H5O_PACKAGE /*suppress error about including H5Opkg */ +#include "H5Omodule.h" /* This source code file is part of the H5O module */ + #include "H5private.h" /* Generic Functions */ #include "H5Eprivate.h" /* Error handling */ @@ -83,7 +84,7 @@ H5O_btreek_decode(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, const uint8_t *p) { H5O_btreek_t *mesg; /* Native message */ - void *ret_value; /* Return value */ + void *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -165,7 +166,7 @@ H5O_btreek_copy(const void *_mesg, void *_dest) { const H5O_btreek_t *mesg = (const H5O_btreek_t *)_mesg; H5O_btreek_t *dest = (H5O_btreek_t *)_dest; - void *ret_value; + void *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT diff --git a/src/H5Ocache.c b/src/H5Ocache.c index 3c64131..945d12e 100644 --- a/src/H5Ocache.c +++ b/src/H5Ocache.c @@ -28,7 +28,7 @@ /* Module Setup */ /****************/ -#define H5O_PACKAGE /*suppress error about including H5Opkg */ +#include "H5Omodule.h" /* This source code file is part of the H5O module */ /***********/ @@ -741,9 +741,9 @@ static void * H5O__cache_chk_deserialize(const void *image, size_t len, void *_udata, hbool_t *dirty) { - H5O_chunk_proxy_t *chk_proxy = NULL; /* Chunk proxy object */ + H5O_chunk_proxy_t *chk_proxy = NULL; /* Chunk proxy object */ H5O_chk_cache_ud_t *udata = (H5O_chk_cache_ud_t *)_udata; /* User data for callback */ - void * ret_value; /* Return value */ + void *ret_value = NULL; /* Return value */ FUNC_ENTER_STATIC diff --git a/src/H5Ochunk.c b/src/H5Ochunk.c index bb82ad1..8abe660 100644 --- a/src/H5Ochunk.c +++ b/src/H5Ochunk.c @@ -28,7 +28,8 @@ /* Module Setup */ /****************/ -#define H5O_PACKAGE /*suppress error about including H5Opkg */ +#include "H5Omodule.h" /* This source code file is part of the H5O module */ + /***********/ /* Headers */ @@ -149,7 +150,7 @@ H5O_chunk_proxy_t * H5O_chunk_protect(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned idx) { H5O_chunk_proxy_t *chk_proxy = NULL; /* Proxy for protected chunk */ - H5O_chunk_proxy_t *ret_value; /* Return value */ + H5O_chunk_proxy_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_TAG(dxpl_id, oh->cache_info.addr, NULL) diff --git a/src/H5Ocont.c b/src/H5Ocont.c index a139654..63002c5 100644 --- a/src/H5Ocont.c +++ b/src/H5Ocont.c @@ -27,7 +27,8 @@ *------------------------------------------------------------------------- */ -#define H5O_PACKAGE /*suppress error about including H5Opkg */ +#include "H5Omodule.h" /* This source code file is part of the H5O module */ + #include "H5private.h" /* Generic Functions */ #include "H5Eprivate.h" /* Error handling */ @@ -94,7 +95,7 @@ H5O_cont_decode(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED *op unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, const uint8_t *p) { H5O_cont_t *cont = NULL; - void *ret_value; + void *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -174,7 +175,7 @@ H5O_cont_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, con static size_t H5O_cont_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const void H5_ATTR_UNUSED *_mesg) { - size_t ret_value; /* Return value */ + size_t ret_value = 0; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_NOERR diff --git a/src/H5Ocopy.c b/src/H5Ocopy.c index 66322da..0b512f6 100644 --- a/src/H5Ocopy.c +++ b/src/H5Ocopy.c @@ -28,7 +28,8 @@ /* Module Setup */ /****************/ -#define H5O_PACKAGE /*suppress error about including H5Opkg */ +#include "H5Omodule.h" /* This source code file is part of the H5O module */ + /***********/ /* Headers */ diff --git a/src/H5Odbg.c b/src/H5Odbg.c index bd789c5..d9d4b8b 100644 --- a/src/H5Odbg.c +++ b/src/H5Odbg.c @@ -28,7 +28,8 @@ /* Module Setup */ /****************/ -#define H5O_PACKAGE /*suppress error about including H5Opkg */ +#include "H5Omodule.h" /* This source code file is part of the H5O module */ + /***********/ /* Headers */ @@ -247,8 +248,8 @@ H5O_assert(const H5O_t *oh) herr_t H5O_debug_id(unsigned type_id, H5F_t *f, hid_t dxpl_id, const void *mesg, FILE *stream, int indent, int fwidth) { - const H5O_msg_class_t *type; /* Actual H5O class type for the ID */ - herr_t ret_value; /* Return value */ + const H5O_msg_class_t *type; /* Actual H5O class type for the ID */ + herr_t ret_value = FAIL; /* Return value */ FUNC_ENTER_NOAPI(FAIL) diff --git a/src/H5Odrvinfo.c b/src/H5Odrvinfo.c index 73cb7cc..2fdf494 100644 --- a/src/H5Odrvinfo.c +++ b/src/H5Odrvinfo.c @@ -21,7 +21,8 @@ * in the superblock extension. */ -#define H5O_PACKAGE /*suppress error about including H5Opkg */ +#include "H5Omodule.h" /* This source code file is part of the H5O module */ + #include "H5private.h" /* Generic Functions */ #include "H5Eprivate.h" /* Error handling */ @@ -84,7 +85,7 @@ H5O_drvinfo_decode(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, const uint8_t *p) { H5O_drvinfo_t *mesg; /* Native message */ - void *ret_value; /* Return value */ + void *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -181,7 +182,7 @@ H5O_drvinfo_copy(const void *_mesg, void *_dest) { const H5O_drvinfo_t *mesg = (const H5O_drvinfo_t *)_mesg; H5O_drvinfo_t *dest = (H5O_drvinfo_t *)_dest; - void *ret_value; + void *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -228,7 +229,7 @@ static size_t H5O_drvinfo_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, const void *_mesg) { const H5O_drvinfo_t *mesg = (const H5O_drvinfo_t *)_mesg; - size_t ret_value; + size_t ret_value = 0; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_NOERR diff --git a/src/H5Odtype.c b/src/H5Odtype.c index 622a18e..cee6e1e 100644 --- a/src/H5Odtype.c +++ b/src/H5Odtype.c @@ -13,8 +13,9 @@ * access to either file, you may request a copy from help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#define H5O_PACKAGE /*suppress error about including H5Opkg */ -#define H5T_PACKAGE /*prevent warning from including H5Tpkg */ +#include "H5Omodule.h" /* This source code file is part of the H5O module */ +#define H5T_FRIEND /*prevent warning from including H5Tpkg */ + #include "H5private.h" /* Generic Functions */ #include "H5Dprivate.h" /* Datasets */ @@ -35,7 +36,7 @@ static void *H5O_dtype_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, static void *H5O_dtype_copy(const void *_mesg, void *_dest); static size_t H5O_dtype_size(const H5F_t *f, const void *_mesg); static herr_t H5O_dtype_reset(void *_mesg); -static herr_t H5O_dtype_free(void *_mesg); +static herr_t H5O__dtype_free(void *_mesg); static herr_t H5O_dtype_set_share(void *_mesg, const H5O_shared_t *sh); static htri_t H5O_dtype_can_share(const void *_mesg); static herr_t H5O_dtype_pre_copy_file(H5F_t *file_src, const void *mesg_src, @@ -101,7 +102,7 @@ const H5O_msg_class_t H5O_MSG_DTYPE[1] = {{ H5O_dtype_copy, /* copy the native value */ H5O_dtype_shared_size, /* size of raw message */ H5O_dtype_reset, /* reset method */ - H5O_dtype_free, /* free method */ + H5O__dtype_free, /* free method */ H5O_dtype_shared_delete, /* file delete method */ H5O_dtype_shared_link, /* link method */ H5O_dtype_set_share, /* set share method */ @@ -1093,7 +1094,7 @@ H5O_dtype_decode(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED *o unsigned *ioflags/*in,out*/, const uint8_t *p) { H5T_t *dt = NULL; - void *ret_value; /* Return value */ + void *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -1175,9 +1176,9 @@ done: static void * H5O_dtype_copy(const void *_src, void *_dst) { - const H5T_t *src = (const H5T_t *) _src; - H5T_t *dst; - void *ret_value; /* Return value */ + const H5T_t *src = (const H5T_t *) _src; + H5T_t *dst; + void *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -1224,7 +1225,7 @@ H5O_dtype_size(const H5F_t *f, const void *_mesg) { const H5T_t *dt = (const H5T_t *)_mesg; unsigned u; /* Local index variable */ - size_t ret_value; + size_t ret_value = 0; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -1369,31 +1370,34 @@ H5O_dtype_reset(void *_mesg) /*------------------------------------------------------------------------- - * Function: H5O_dtype_free + * Function: H5O__dtype_free * - * Purpose: Free's the message + * Purpose: Frees the message * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol * Thursday, March 30, 2000 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t -H5O_dtype_free(void *mesg) +H5O__dtype_free(void *mesg) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + herr_t ret_value = SUCCEED; /* Return value */ + FUNC_ENTER_STATIC + + /* Sanity check */ HDassert(mesg); - ((H5T_t *) mesg)->shared = H5FL_FREE(H5T_shared_t, ((H5T_t *) mesg)->shared); - mesg = H5FL_FREE(H5T_t, mesg); + /* Release the datatype */ + if(H5T_close((H5T_t *)mesg) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTFREE, FAIL, "unable to free datatype") - FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_dtype_free() */ +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5O__dtype_free() */ /*------------------------------------------------------------------------- @@ -1562,7 +1566,7 @@ H5O_dtype_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const H5O_msg_class_t *mesg_ H5O_copy_t H5_ATTR_UNUSED *cpy_info, void H5_ATTR_UNUSED *udata, hid_t H5_ATTR_UNUSED dxpl_id) { H5T_t *dst_mesg; /* Destination datatype */ - void *ret_value; /* Return value */ + void *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT diff --git a/src/H5Oefl.c b/src/H5Oefl.c index a7ce31a..34c0e9f 100644 --- a/src/H5Oefl.c +++ b/src/H5Oefl.c @@ -18,7 +18,7 @@ * Tuesday, November 25, 1997 */ -#define H5O_PACKAGE /*suppress error about including H5Opkg */ +#include "H5Omodule.h" /* This source code file is part of the H5O module */ #include "H5private.h" /* Generic Functions */ @@ -96,8 +96,8 @@ H5O_efl_decode(H5F_t *f, hid_t dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh, int version; const char *s = NULL; H5HL_t *heap; - size_t u; /* Local index variable */ - void *ret_value; /* Return value */ + size_t u; /* Local index variable */ + void *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -258,8 +258,8 @@ H5O_efl_copy(const void *_mesg, void *_dest) { const H5O_efl_t *mesg = (const H5O_efl_t *) _mesg; H5O_efl_t *dest = (H5O_efl_t *) _dest; - size_t u; /* Local index variable */ - void *ret_value; /* Return value */ + size_t u; /* Local index variable */ + void *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -460,9 +460,9 @@ H5O_efl_copy_file(H5F_t H5_ATTR_UNUSED *file_src, void *mesg_src, H5F_t *file_ds { H5O_efl_t *efl_src = (H5O_efl_t *) mesg_src; H5O_efl_t *efl_dst = NULL; - H5HL_t *heap = NULL; /* Pointer to local heap for EFL file names */ + H5HL_t *heap = NULL; /* Pointer to local heap for EFL file names */ size_t idx, size, name_offset, heap_size; - void *ret_value; /* Return value */ + void *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_TAG(dxpl_id, H5AC__COPIED_TAG, NULL) diff --git a/src/H5Ofill.c b/src/H5Ofill.c index 3bd1e84..ebcb5d3 100644 --- a/src/H5Ofill.c +++ b/src/H5Ofill.c @@ -20,7 +20,8 @@ * uninitialized data points of a dataset. */ -#define H5O_PACKAGE /*suppress error about including H5Opkg */ +#include "H5Omodule.h" /* This source code file is part of the H5O module */ + #include "H5private.h" /* Generic Functions */ #include "H5Dprivate.h" /* Datasets */ @@ -188,7 +189,7 @@ H5O_fill_new_decode(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, const uint8_t *p) { H5O_fill_t *fill = NULL; - void *ret_value; + void *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -301,8 +302,8 @@ static void * H5O_fill_old_decode(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, const uint8_t *p) { - H5O_fill_t *fill = NULL; /* Decoded fill value message */ - void *ret_value; /* Return value */ + H5O_fill_t *fill = NULL; /* Decoded fill value message */ + void *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -494,7 +495,7 @@ H5O_fill_copy(const void *_src, void *_dst) { const H5O_fill_t *src = (const H5O_fill_t *)_src; H5O_fill_t *dst = (H5O_fill_t *)_dst; - void *ret_value; + void *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -611,7 +612,7 @@ static size_t H5O_fill_new_size(const H5F_t H5_ATTR_UNUSED *f, const void *_fill) { const H5O_fill_t *fill = (const H5O_fill_t *)_fill; - size_t ret_value; + size_t ret_value = 0; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_NOERR diff --git a/src/H5Ofsinfo.c b/src/H5Ofsinfo.c index 180ebe8..1712857 100644 --- a/src/H5Ofsinfo.c +++ b/src/H5Ofsinfo.c @@ -24,7 +24,8 @@ *------------------------------------------------------------------------- */ -#define H5O_PACKAGE /* suppress error about including H5Opkg */ +#include "H5Omodule.h" /* This source code file is part of the H5O module */ + #include "H5private.h" /* Generic Functions */ #include "H5Eprivate.h" /* Error handling */ @@ -89,7 +90,7 @@ H5O_fsinfo_decode(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED * { H5O_fsinfo_t *fsinfo = NULL; /* free-space manager info */ H5FD_mem_t type; /* Memory type for iteration */ - void *ret_value; /* Return value */ + void *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -183,9 +184,9 @@ H5O_fsinfo_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, c static void * H5O_fsinfo_copy(const void *_mesg, void *_dest) { - const H5O_fsinfo_t *fsinfo = (const H5O_fsinfo_t *)_mesg; - H5O_fsinfo_t *dest = (H5O_fsinfo_t *) _dest; - void *ret_value; /* Return value */ + const H5O_fsinfo_t *fsinfo = (const H5O_fsinfo_t *)_mesg; + H5O_fsinfo_t *dest = (H5O_fsinfo_t *) _dest; + void *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -224,7 +225,7 @@ H5O_fsinfo_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const voi { const H5O_fsinfo_t *fsinfo = (const H5O_fsinfo_t *)_mesg; size_t fs_addr_size = 0; - size_t ret_value; /* Return value */ + size_t ret_value = 0; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_NOERR diff --git a/src/H5Oginfo.c b/src/H5Oginfo.c index 5519021..9cd0dc1 100644 --- a/src/H5Oginfo.c +++ b/src/H5Oginfo.c @@ -24,7 +24,8 @@ *------------------------------------------------------------------------- */ -#define H5O_PACKAGE /*suppress error about including H5Opkg */ +#include "H5Omodule.h" /* This source code file is part of the H5O module */ + #include "H5private.h" /* Generic Functions */ #include "H5Eprivate.h" /* Error handling */ @@ -100,7 +101,7 @@ H5O_ginfo_decode(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5 { H5O_ginfo_t *ginfo = NULL; /* Pointer to group information message */ unsigned char flags; /* Flags for encoding group info */ - void *ret_value; /* Return value */ + void *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -224,7 +225,7 @@ H5O_ginfo_copy(const void *_mesg, void *_dest) { const H5O_ginfo_t *ginfo = (const H5O_ginfo_t *)_mesg; H5O_ginfo_t *dest = (H5O_ginfo_t *)_dest; - void *ret_value; /* Return value */ + void *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -265,7 +266,7 @@ static size_t H5O_ginfo_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, const void *_mesg) { const H5O_ginfo_t *ginfo = (const H5O_ginfo_t *)_mesg; - size_t ret_value; /* Return value */ + size_t ret_value = 0; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_NOERR diff --git a/src/H5Olayout.c b/src/H5Olayout.c index b38d2a9..cc8a7dd 100644 --- a/src/H5Olayout.c +++ b/src/H5Olayout.c @@ -19,8 +19,9 @@ * Purpose: Messages related to data layout. */ -#define H5D_PACKAGE /*suppress error about including H5Dpkg */ -#define H5O_PACKAGE /*suppress error about including H5Opkg */ +#define H5D_FRIEND /*suppress error about including H5Dpkg */ +#include "H5Omodule.h" /* This source code file is part of the H5O module */ + #include "H5private.h" /* Generic Functions */ #include "H5Dpkg.h" /* Dataset functions */ @@ -101,7 +102,7 @@ H5O_layout_decode(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED * { H5O_layout_t *mesg = NULL; unsigned u; - void *ret_value; /* Return value */ + void *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -375,7 +376,7 @@ H5O_layout_copy(const void *_mesg, void *_dest) { const H5O_layout_t *mesg = (const H5O_layout_t *) _mesg; H5O_layout_t *dest = (H5O_layout_t *) _dest; - void *ret_value; /* Return value */ + void *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -451,7 +452,7 @@ static size_t H5O_layout_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const void *_mesg) { const H5O_layout_t *mesg = (const H5O_layout_t *) _mesg; - size_t ret_value; + size_t ret_value = 0; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -609,8 +610,8 @@ H5O_layout_copy_file(H5F_t *file_src, void *mesg_src, H5F_t *file_dst, H5D_copy_file_ud_t *udata = (H5D_copy_file_ud_t *)_udata; /* Dataset copying user data */ H5O_layout_t *layout_src = (H5O_layout_t *) mesg_src; H5O_layout_t *layout_dst = NULL; - hbool_t copied = FALSE; /* Whether the data was copied */ - void *ret_value; /* Return value */ + hbool_t copied = FALSE; /* Whether the data was copied */ + void *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT diff --git a/src/H5Olinfo.c b/src/H5Olinfo.c index a0b6e4a..62e63d4 100644 --- a/src/H5Olinfo.c +++ b/src/H5Olinfo.c @@ -24,9 +24,10 @@ *------------------------------------------------------------------------- */ -#define H5G_PACKAGE /*suppress error about including H5Gpkg */ -#define H5L_PACKAGE /*suppress error about including H5Lpkg */ -#define H5O_PACKAGE /*suppress error about including H5Opkg */ +#define H5G_FRIEND /*suppress error about including H5Gpkg */ +#define H5L_FRIEND /*suppress error about including H5Lpkg */ +#include "H5Omodule.h" /* This source code file is part of the H5O module */ + #include "H5private.h" /* Generic Functions */ #include "H5Eprivate.h" /* Error handling */ @@ -119,7 +120,7 @@ H5O_linfo_decode(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED *o { H5O_linfo_t *linfo = NULL; /* Link info */ unsigned char index_flags; /* Flags for encoding link index info */ - void *ret_value; /* Return value */ + void *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -249,7 +250,7 @@ H5O_linfo_copy(const void *_mesg, void *_dest) { const H5O_linfo_t *linfo = (const H5O_linfo_t *)_mesg; H5O_linfo_t *dest = (H5O_linfo_t *) _dest; - void *ret_value; /* Return value */ + void *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -289,7 +290,7 @@ static size_t H5O_linfo_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const void *_mesg) { const H5O_linfo_t *linfo = (const H5O_linfo_t *)_mesg; - size_t ret_value; /* Return value */ + size_t ret_value = 0; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -383,10 +384,10 @@ H5O_linfo_copy_file(H5F_t H5_ATTR_UNUSED *file_src, void *native_src, H5F_t *fil hbool_t H5_ATTR_UNUSED *recompute_size, unsigned H5_ATTR_UNUSED *mesg_flags, H5O_copy_t *cpy_info, void *_udata, hid_t dxpl_id) { - H5O_linfo_t *linfo_src = (H5O_linfo_t *) native_src; - H5O_linfo_t *linfo_dst = NULL; + H5O_linfo_t *linfo_src = (H5O_linfo_t *) native_src; + H5O_linfo_t *linfo_dst = NULL; H5G_copy_file_ud_t *udata = (H5G_copy_file_ud_t *) _udata; - void *ret_value; /* Return value */ + void *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_TAG(dxpl_id, H5AC__COPIED_TAG, NULL) diff --git a/src/H5Olink.c b/src/H5Olink.c index 7e70196..fd4ee88 100644 --- a/src/H5Olink.c +++ b/src/H5Olink.c @@ -24,9 +24,10 @@ *------------------------------------------------------------------------- */ -#define H5G_PACKAGE /*suppress error about including H5Gpkg */ -#define H5L_PACKAGE /*suppress error about including H5Lpkg */ -#define H5O_PACKAGE /*suppress error about including H5Opkg */ +#define H5G_FRIEND /*suppress error about including H5Gpkg */ +#define H5L_FRIEND /*suppress error about including H5Lpkg */ +#include "H5Omodule.h" /* This source code file is part of the H5O module */ + #include "H5private.h" /* Generic Functions */ #include "H5Eprivate.h" /* Error handling */ @@ -124,7 +125,7 @@ H5O_link_decode(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED *op H5O_link_t *lnk = NULL; /* Pointer to link message */ size_t len = 0; /* Length of a string in the message */ unsigned char link_flags; /* Flags for encoding link info */ - void *ret_value; /* Return value */ + void *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -411,7 +412,7 @@ H5O_link_copy(const void *_mesg, void *_dest) { const H5O_link_t *lnk = (const H5O_link_t *) _mesg; H5O_link_t *dest = (H5O_link_t *) _dest; - void *ret_value; /* Return value */ + void *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -478,9 +479,9 @@ static size_t H5O_link_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const void *_mesg) { const H5O_link_t *lnk = (const H5O_link_t *)_mesg; - uint64_t name_len; /* Length of name */ - size_t name_size; /* Size of encoded name length */ - size_t ret_value; /* Return value */ + uint64_t name_len; /* Length of name */ + size_t name_size; /* Size of encoded name length */ + size_t ret_value = 0; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -727,7 +728,7 @@ H5O_link_copy_file(H5F_t H5_ATTR_UNUSED *file_src, void *native_src, H5F_t H5_AT H5O_copy_t H5_ATTR_UNUSED *cpy_info, void H5_ATTR_UNUSED *udata, hid_t H5_ATTR_UNUSED dxpl_id) { H5O_link_t *link_src = (H5O_link_t *)native_src; - void *ret_value; /* Return value */ + void *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT diff --git a/src/H5Omessage.c b/src/H5Omessage.c index c2756ea..d42896c 100644 --- a/src/H5Omessage.c +++ b/src/H5Omessage.c @@ -28,7 +28,8 @@ /* Module Setup */ /****************/ -#define H5O_PACKAGE /*suppress error about including H5Opkg */ +#include "H5Omodule.h" /* This source code file is part of the H5O module */ + /***********/ /* Headers */ @@ -465,7 +466,7 @@ H5O_msg_read(const H5O_loc_t *loc, unsigned type_id, void *mesg, hid_t dxpl_id) { H5O_t *oh = NULL; /* Object header to use */ - void *ret_value; /* Return value */ + void *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_TAG(dxpl_id, loc->addr, NULL) @@ -652,7 +653,7 @@ void * H5O_msg_free(unsigned type_id, void *mesg) { const H5O_msg_class_t *type; /* Actual H5O class type for the ID */ - void * ret_value; /* Return value */ + void *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -749,7 +750,7 @@ void * H5O_msg_copy(unsigned type_id, const void *mesg, void *dst) { const H5O_msg_class_t *type; /* Actual H5O class type for the ID */ - void *ret_value; /* Return value */ + void *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI(NULL) @@ -789,7 +790,7 @@ H5O_msg_count(const H5O_loc_t *loc, unsigned type_id, hid_t dxpl_id) H5O_t *oh = NULL; /* Object header to operate on */ const H5O_msg_class_t *type; /* Actual H5O class type for the ID */ unsigned msg_count; /* Message count */ - int ret_value; /* Return value */ + int ret_value = FAIL; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -836,7 +837,7 @@ unsigned H5O_msg_count_real(const H5O_t *oh, const H5O_msg_class_t *type) { unsigned u; /* Local index variable */ - unsigned ret_value; /* Return value */ + unsigned ret_value = 0; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -875,7 +876,7 @@ htri_t H5O_msg_exists(const H5O_loc_t *loc, unsigned type_id, hid_t dxpl_id) { H5O_t *oh = NULL; /* Object header for location */ - htri_t ret_value; /* Return value */ + htri_t ret_value = FAIL; /* Return value */ FUNC_ENTER_NOAPI_TAG(dxpl_id, loc->addr, FAIL) @@ -966,8 +967,8 @@ H5O_msg_remove(const H5O_loc_t *loc, unsigned type_id, int sequence, hbool_t adj hid_t dxpl_id) { H5O_t *oh = NULL; /* Pointer to actual object header */ - const H5O_msg_class_t *type; /* Actual H5O class type for the ID */ - herr_t ret_value; /* Return value */ + const H5O_msg_class_t *type; /* Actual H5O class type for the ID */ + herr_t ret_value = FAIL; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -1018,8 +1019,8 @@ H5O_msg_remove_op(const H5O_loc_t *loc, unsigned type_id, int sequence, H5O_operator_t op, void *op_data, hbool_t adj_link, hid_t dxpl_id) { H5O_t *oh = NULL; /* Pointer to actual object header */ - const H5O_msg_class_t *type; /* Actual H5O class type for the ID */ - herr_t ret_value; /* Return value */ + const H5O_msg_class_t *type; /* Actual H5O class type for the ID */ + herr_t ret_value = FAIL; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -1210,7 +1211,7 @@ H5O_msg_iterate(const H5O_loc_t *loc, unsigned type_id, { H5O_t *oh = NULL; /* Pointer to actual object header */ const H5O_msg_class_t *type; /* Actual H5O class type for the ID */ - herr_t ret_value; /* Return value */ + herr_t ret_value = FAIL; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -1359,7 +1360,7 @@ H5O_msg_raw_size(const H5F_t *f, unsigned type_id, hbool_t disable_shared, const void *mesg) { const H5O_msg_class_t *type; /* Actual H5O class type for the ID */ - size_t ret_value; /* Return value */ + size_t ret_value = 0; /* Return value */ FUNC_ENTER_NOAPI(0) @@ -1404,7 +1405,7 @@ H5O_msg_size_f(const H5F_t *f, hid_t ocpl_id, unsigned type_id, const H5O_msg_class_t *type; /* Actual H5O class type for the ID */ H5P_genplist_t *ocpl; /* Object Creation Property list */ uint8_t oh_flags; /* Object header status flags */ - size_t ret_value; /* Return value */ + size_t ret_value = 0; /* Return value */ FUNC_ENTER_NOAPI(0) @@ -1466,7 +1467,7 @@ H5O_msg_size_oh(const H5F_t *f, const H5O_t *oh, unsigned type_id, const void *mesg, size_t extra_raw) { const H5O_msg_class_t *type; /* Actual H5O class type for the ID */ - size_t ret_value; /* Return value */ + size_t ret_value = 0; /* Return value */ FUNC_ENTER_NOAPI(0) @@ -1517,7 +1518,7 @@ htri_t H5O_msg_can_share(unsigned type_id, const void *mesg) { const H5O_msg_class_t *type; /* Actual H5O class type for the ID */ - htri_t ret_value; + htri_t ret_value = FAIL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -1564,7 +1565,7 @@ htri_t H5O_msg_can_share_in_ohdr(unsigned type_id) { const H5O_msg_class_t *type; /* Actual H5O class type for the ID */ - htri_t ret_value; + htri_t ret_value = FAIL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -1602,7 +1603,7 @@ htri_t H5O_msg_is_shared(unsigned type_id, const void *mesg) { const H5O_msg_class_t *type; /* Actual H5O class type for the ID */ - htri_t ret_value; + htri_t ret_value = FAIL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -1816,8 +1817,8 @@ H5O_msg_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned type_id, const unsigned char *buf) { const H5O_msg_class_t *type; /* Actual H5O class type for the ID */ - void *ret_value; /* Return value */ unsigned ioflags = 0; /* Flags for decode routine */ + void *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI(NULL) @@ -1859,7 +1860,7 @@ H5O_msg_copy_file(const H5O_msg_class_t *type, H5F_t *file_src, void *native_src, H5F_t *file_dst, hbool_t *recompute_size, unsigned *mesg_flags, H5O_copy_t *cpy_info, void *udata, hid_t dxpl_id) { - void *ret_value; + void *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -2047,7 +2048,7 @@ H5O_msg_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned type_id, const H5O_msg_class_t *type; /* Actual H5O class type for the ID */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(NULL) + FUNC_ENTER_NOAPI(FAIL) /* check args */ HDassert(f); @@ -2276,7 +2277,7 @@ H5O_msg_get_chunkno(const H5O_loc_t *loc, unsigned type_id, hid_t dxpl_id) const H5O_msg_class_t *type; /* Actual H5O class type for the ID */ H5O_mesg_t *idx_msg; /* Pointer to message to modify */ unsigned idx; /* Index of message to modify */ - int ret_value; /* Return value */ + int ret_value = -1; /* Return value */ FUNC_ENTER_NOAPI(FAIL) diff --git a/src/H5Omodule.h b/src/H5Omodule.h new file mode 100644 index 0000000..a8f1301 --- /dev/null +++ b/src/H5Omodule.h @@ -0,0 +1,35 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* + * Programmer: Quincey Koziol + * Saturday, September 12, 2015 + * + * Purpose: This file contains declarations which define macros for the + * H5O package. Including this header means that the source file + * is part of the H5O package. + */ +#ifndef _H5Omodule_H +#define _H5Omodule_H + +/* Define the proper control macros for the generic FUNC_ENTER/LEAVE and error + * reporting macros. + */ +#define H5O_MODULE +#define H5_MY_PKG H5O +#define H5_MY_PKG_ERR H5E_OHDR +#define H5_MY_PKG_INIT YES + +#endif /* _H5Omodule_H */ + diff --git a/src/H5Omtime.c b/src/H5Omtime.c index 63ba152..622d57d 100644 --- a/src/H5Omtime.c +++ b/src/H5Omtime.c @@ -19,7 +19,8 @@ * Purpose: The object modification time message. */ -#define H5O_PACKAGE /*suppress error about including H5Opkg */ +#include "H5Omodule.h" /* This source code file is part of the H5O module */ + #include "H5private.h" /* Generic Functions */ #include "H5Eprivate.h" /* Error handling */ @@ -126,8 +127,8 @@ H5O_mtime_new_decode(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_ unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, const uint8_t *p) { time_t *mesg; - uint32_t tmp_time; /* Temporary copy of the time */ - void *ret_value; /* Return value */ + uint32_t tmp_time; /* Temporary copy of the time */ + void *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -184,7 +185,7 @@ H5O_mtime_decode(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5 time_t *mesg, the_time; int i; struct tm tm; - void *ret_value; /* Return value */ + void *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -352,7 +353,7 @@ H5O_mtime_copy(const void *_mesg, void *_dest) { const time_t *mesg = (const time_t *) _mesg; time_t *dest = (time_t *) _dest; - void *ret_value; /* Return value */ + void *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT diff --git a/src/H5Oname.c b/src/H5Oname.c index 2cd9e72..6c4f76f 100644 --- a/src/H5Oname.c +++ b/src/H5Oname.c @@ -24,7 +24,8 @@ *------------------------------------------------------------------------- */ -#define H5O_PACKAGE /*suppress error about including H5Opkg */ +#include "H5Omodule.h" /* This source code file is part of the H5O module */ + #include "H5private.h" /* Generic Functions */ #include "H5Eprivate.h" /* Error handling */ @@ -88,7 +89,7 @@ H5O_name_decode(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, const uint8_t *p) { H5O_name_t *mesg; - void *ret_value; /* Return value */ + void *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -170,9 +171,9 @@ H5O_name_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, static void * H5O_name_copy(const void *_mesg, void *_dest) { - const H5O_name_t *mesg = (const H5O_name_t *) _mesg; - H5O_name_t *dest = (H5O_name_t *) _dest; - void *ret_value; /* Return value */ + const H5O_name_t *mesg = (const H5O_name_t *) _mesg; + H5O_name_t *dest = (H5O_name_t *) _dest; + void *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -223,7 +224,7 @@ static size_t H5O_name_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, const void *_mesg) { const H5O_name_t *mesg = (const H5O_name_t *) _mesg; - size_t ret_value; + size_t ret_value = 0; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_NOERR diff --git a/src/H5Onull.c b/src/H5Onull.c index a6c6524..258f695 100644 --- a/src/H5Onull.c +++ b/src/H5Onull.c @@ -24,7 +24,8 @@ *------------------------------------------------------------------------- */ -#define H5O_PACKAGE /*suppress error about including H5Opkg */ +#include "H5Omodule.h" /* This source code file is part of the H5O module */ + #include "H5private.h" /* Generic Functions */ #include "H5Opkg.h" /* Object headers */ diff --git a/src/H5Opkg.h b/src/H5Opkg.h index 1f8a1cd..ddcdb10 100644 --- a/src/H5Opkg.h +++ b/src/H5Opkg.h @@ -13,7 +13,7 @@ * access to either file, you may request a copy from help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#ifndef H5O_PACKAGE +#if !(defined H5O_FRIEND || defined H5O_MODULE) #error "Do not include this file outside the H5O package!" #endif diff --git a/src/H5Opline.c b/src/H5Opline.c index b79a73c..95a82b5 100644 --- a/src/H5Opline.c +++ b/src/H5Opline.c @@ -20,8 +20,9 @@ * Purpose: Data filter pipeline message. */ -#define H5O_PACKAGE /*suppress error about including H5Opkg */ -#define H5Z_PACKAGE /*suppress error about including H5Zpkg */ +#include "H5Omodule.h" /* This source code file is part of the H5O module */ +#define H5Z_FRIEND /*suppress error about including H5Zpkg */ + #include "H5private.h" /* Generic Functions */ #include "H5Dprivate.h" /* Datasets */ @@ -116,7 +117,7 @@ H5O_pline_decode(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5 H5Z_filter_info_t *filter; /* Filter to decode */ size_t name_length; /* Length of filter name */ size_t i; /* Local index variable */ - void *ret_value; /* Return value */ + void *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -344,7 +345,7 @@ H5O_pline_copy(const void *_src, void *_dst/*out*/) const H5O_pline_t *src = (const H5O_pline_t *)_src; /* Source pipeline message */ H5O_pline_t *dst = (H5O_pline_t *)_dst; /* Destination pipeline message */ size_t i; /* Local index variable */ - H5O_pline_t *ret_value; /* Return value */ + H5O_pline_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -434,7 +435,7 @@ H5O_pline_size(const H5F_t H5_ATTR_UNUSED *f, const void *mesg) { const H5O_pline_t *pline = (const H5O_pline_t*)mesg; /* Pipeline message */ size_t i; /* Local index variable */ - size_t ret_value; /* Return value */ + size_t ret_value = 0; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_NOERR diff --git a/src/H5Oprivate.h b/src/H5Oprivate.h index dbe74f7..b6667e9 100644 --- a/src/H5Oprivate.h +++ b/src/H5Oprivate.h @@ -109,11 +109,11 @@ typedef struct H5O_t H5O_t; #define H5O_CPY_MCDT_SEARCH_CB_NAME "committed dtype list search" /* Callback function when the search for a matching committed datatype is complete */ /* If the module using this macro is allowed access to the private variables, access them directly */ -#ifdef H5O_PACKAGE +#ifdef H5O_MODULE #define H5O_OH_GET_ADDR(O) ((O)->chunk[0].addr) -#else /* H5O_PACKAGE */ +#else /* H5O_MODULE */ #define H5O_OH_GET_ADDR(O) (H5O_get_oh_addr(O)) -#endif /* H5O_PACKAGE */ +#endif /* H5O_MODULE */ /* Set the fields in a shared message structure */ #define H5O_UPDATE_SHARED(SH_MESG, SH_TYPE, F, MSG_TYPE, CRT_IDX, OH_ADDR) \ diff --git a/src/H5Orefcount.c b/src/H5Orefcount.c index f5c7e25..ff7dfee 100644 --- a/src/H5Orefcount.c +++ b/src/H5Orefcount.c @@ -24,7 +24,8 @@ *------------------------------------------------------------------------- */ -#define H5O_PACKAGE /*suppress error about including H5Opkg */ +#include "H5Omodule.h" /* This source code file is part of the H5O module */ + #include "H5private.h" /* Generic Functions */ #include "H5Eprivate.h" /* Error handling */ @@ -93,8 +94,8 @@ static void * H5O_refcount_decode(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, const uint8_t *p) { - H5O_refcount_t *refcount = NULL; /* Reference count */ - void *ret_value; /* Return value */ + H5O_refcount_t *refcount = NULL; /* Reference count */ + void *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -177,9 +178,9 @@ H5O_refcount_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shar static void * H5O_refcount_copy(const void *_mesg, void *_dest) { - const H5O_refcount_t *refcount = (const H5O_refcount_t *)_mesg; - H5O_refcount_t *dest = (H5O_refcount_t *) _dest; - void *ret_value; /* Return value */ + const H5O_refcount_t *refcount = (const H5O_refcount_t *)_mesg; + H5O_refcount_t *dest = (H5O_refcount_t *) _dest; + void *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT diff --git a/src/H5Osdspace.c b/src/H5Osdspace.c index 8d357c2..0f3eb5d 100644 --- a/src/H5Osdspace.c +++ b/src/H5Osdspace.c @@ -13,8 +13,8 @@ * access to either file, you may request a copy from help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#define H5O_PACKAGE /*suppress error about including H5Opkg */ -#define H5S_PACKAGE /*prevent warning from including H5Spkg.h */ +#include "H5Omodule.h" /* This source code file is part of the H5O module */ +#define H5S_FRIEND /*prevent warning from including H5Spkg.h */ #include "H5private.h" /* Generic Functions */ #include "H5Dprivate.h" /* Datasets */ @@ -115,9 +115,9 @@ H5O_sdspace_decode(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, const uint8_t *p) { H5S_extent_t *sdim = NULL;/* New extent dimensionality structure */ - void *ret_value; - unsigned i; /* local counting variable */ unsigned flags, version; + unsigned i; /* Local counting variable */ + void *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -302,7 +302,7 @@ H5O_sdspace_copy(const void *_mesg, void *_dest) { const H5S_extent_t *mesg = (const H5S_extent_t *)_mesg; H5S_extent_t *dest = (H5S_extent_t *)_dest; - void *ret_value; /* Return value */ + void *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -352,7 +352,7 @@ static size_t H5O_sdspace_size(const H5F_t *f, const void *_mesg) { const H5S_extent_t *space = (const H5S_extent_t *)_mesg; - size_t ret_value; + size_t ret_value = 0; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_NOERR diff --git a/src/H5Oshared.c b/src/H5Oshared.c index c5c088a..25baa88 100644 --- a/src/H5Oshared.c +++ b/src/H5Oshared.c @@ -30,7 +30,7 @@ /* Module Setup */ /****************/ -#define H5O_PACKAGE /*suppress error about including H5Opkg */ +#include "H5Omodule.h" /* This source code file is part of the H5O module */ /***********/ @@ -313,7 +313,7 @@ H5O_shared_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned *ioflags, { H5O_shared_t sh_mesg; /* Shared message info */ unsigned version; /* Shared message version */ - void *ret_value; /* Return value */ + void *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -477,7 +477,7 @@ H5O_set_shared(H5O_shared_t *dst, const H5O_shared_t *src) size_t H5O_shared_size(const H5F_t *f, const H5O_shared_t *sh_mesg) { - size_t ret_value; /* Return value */ + size_t ret_value = 0; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_NOERR diff --git a/src/H5Oshared.h b/src/H5Oshared.h index 2ac2a98..e8d620a 100644 --- a/src/H5Oshared.h +++ b/src/H5Oshared.h @@ -51,7 +51,7 @@ static H5_INLINE void * H5O_SHARED_DECODE(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned mesg_flags, unsigned *ioflags, const uint8_t *p) { - void *ret_value; /* Return value */ + void *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -166,7 +166,7 @@ static H5_INLINE size_t H5O_SHARED_SIZE(const H5F_t *f, hbool_t disable_shared, const void *_mesg) { const H5O_shared_t *sh_mesg = (const H5O_shared_t *)_mesg; /* Pointer to shared message portion of actual message */ - size_t ret_value; /* Return value */ + size_t ret_value = 0; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -324,7 +324,7 @@ H5O_SHARED_COPY_FILE(H5F_t *file_src, void *_native_src, H5F_t *file_dst, void *udata, hid_t dxpl_id) { void *dst_mesg = NULL; /* Destination message */ - void *ret_value; /* Return value */ + void *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT diff --git a/src/H5Oshmesg.c b/src/H5Oshmesg.c index deb10ab..a506ce2 100644 --- a/src/H5Oshmesg.c +++ b/src/H5Oshmesg.c @@ -21,7 +21,8 @@ * information in the superblock extension. */ -#define H5O_PACKAGE /*suppress error about including H5Opkg */ +#include "H5Omodule.h" /* This source code file is part of the H5O module */ + #include "H5private.h" /* Generic Functions */ #include "H5Eprivate.h" /* Error handling */ @@ -79,8 +80,8 @@ static void * H5O_shmesg_decode(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, const uint8_t *p) { - H5O_shmesg_table_t *mesg; /* Native message */ - void *ret_value; /* Return value */ + H5O_shmesg_table_t *mesg; /* Native message */ + void *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -156,7 +157,7 @@ H5O_shmesg_copy(const void *_mesg, void *_dest) { const H5O_shmesg_table_t *mesg = (const H5O_shmesg_table_t *)_mesg; H5O_shmesg_table_t *dest = (H5O_shmesg_table_t *)_dest; - void *ret_value; + void *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -194,7 +195,7 @@ done: static size_t H5O_shmesg_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const void H5_ATTR_UNUSED *_mesg) { - size_t ret_value; + size_t ret_value = 0; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_NOERR diff --git a/src/H5Ostab.c b/src/H5Ostab.c index 133a3e2..bb39e58 100644 --- a/src/H5Ostab.c +++ b/src/H5Ostab.c @@ -24,8 +24,9 @@ *------------------------------------------------------------------------- */ -#define H5G_PACKAGE /*suppress error about including H5Gpkg */ -#define H5O_PACKAGE /*suppress error about including H5Opkg */ +#define H5G_FRIEND /*suppress error about including H5Gpkg */ +#include "H5Omodule.h" /* This source code file is part of the H5O module */ + #include "H5private.h" /* Generic Functions */ #include "H5Eprivate.h" /* Error handling */ @@ -101,7 +102,7 @@ H5O_stab_decode(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED *op unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, const uint8_t *p) { H5O_stab_t *stab = NULL; - void *ret_value; /* Return value */ + void *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -180,9 +181,9 @@ H5O_stab_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, con static void * H5O_stab_copy(const void *_mesg, void *_dest) { - const H5O_stab_t *stab = (const H5O_stab_t *) _mesg; - H5O_stab_t *dest = (H5O_stab_t *) _dest; - void *ret_value; /* Return value */ + const H5O_stab_t *stab = (const H5O_stab_t *) _mesg; + H5O_stab_t *dest = (H5O_stab_t *) _dest; + void *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -222,7 +223,7 @@ done: static size_t H5O_stab_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const void H5_ATTR_UNUSED *_mesg) { - size_t ret_value; /* Return value */ + size_t ret_value = 0; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -314,8 +315,8 @@ H5O_stab_copy_file(H5F_t *file_src, void *native_src, H5F_t *file_dst, H5O_stab_t *stab_src = (H5O_stab_t *) native_src; H5O_stab_t *stab_dst = NULL; H5G_copy_file_ud_t *udata = (H5G_copy_file_ud_t *)_udata; - size_t size_hint; /* Local heap initial size */ - void *ret_value; /* Return value */ + size_t size_hint; /* Local heap initial size */ + void *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT diff --git a/src/H5Otest.c b/src/H5Otest.c index e7312ee..b5f728a 100644 --- a/src/H5Otest.c +++ b/src/H5Otest.c @@ -23,8 +23,8 @@ /* Module Setup */ /****************/ -#define H5A_PACKAGE /*suppress error about including H5Apkg */ -#define H5O_PACKAGE /*suppress error about including H5Opkg */ +#define H5A_FRIEND /*suppress error about including H5Apkg */ +#include "H5Omodule.h" /* This source code file is part of the H5O module */ #define H5O_TESTING /*suppress warning about H5O testing funcs*/ @@ -99,7 +99,7 @@ H5O_is_attr_dense_test(hid_t oid) H5O_t *oh = NULL; /* Object header */ H5O_ainfo_t ainfo; /* Attribute information for object */ H5O_loc_t *loc; /* Pointer to object's location */ - htri_t ret_value; /* Return value */ + htri_t ret_value = FAIL; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -159,12 +159,12 @@ htri_t H5O_is_attr_empty_test(hid_t oid) { H5O_t *oh = NULL; /* Object header */ - H5B2_t *bt2_name = NULL; /* v2 B-tree handle for name index */ + H5B2_t *bt2_name = NULL; /* v2 B-tree handle for name index */ H5O_ainfo_t ainfo; /* Attribute information for object */ htri_t ainfo_exists = FALSE; /* Whether the attribute info exists in the file */ - H5O_loc_t *loc; /* Pointer to object's location */ + H5O_loc_t *loc; /* Pointer to object's location */ hsize_t nattrs; /* Number of attributes */ - htri_t ret_value; /* Return value */ + htri_t ret_value = FAIL; /* Return value */ FUNC_ENTER_NOAPI(FAIL) diff --git a/src/H5Ounknown.c b/src/H5Ounknown.c index 548f74d..546e839 100644 --- a/src/H5Ounknown.c +++ b/src/H5Ounknown.c @@ -24,7 +24,8 @@ *------------------------------------------------------------------------- */ -#define H5O_PACKAGE /*suppress error about including H5Opkg */ +#include "H5Omodule.h" /* This source code file is part of the H5O module */ + #include "H5private.h" /* Generic Functions */ #include "H5Eprivate.h" /* Error handling */ diff --git a/src/H5P.c b/src/H5P.c index ff230ed..b58271c 100644 --- a/src/H5P.c +++ b/src/H5P.c @@ -22,10 +22,7 @@ /* Module Setup */ /****************/ -#define H5P_PACKAGE /*suppress error about including H5Ppkg */ - -/* Interface initialization */ -#define H5_INTERFACE_INIT_FUNC H5P__init_pub_interface +#include "H5Pmodule.h" /* This source code file is part of the H5P module */ /***********/ @@ -62,6 +59,9 @@ typedef struct { /* Package Variables */ /*********************/ +/* Package initialization variable */ +hbool_t H5_PKG_INIT_VAR = FALSE; + /*****************************/ /* Library Private Variables */ @@ -74,51 +74,6 @@ typedef struct { /*-------------------------------------------------------------------------- -NAME - H5P__init_pub_interface -- Initialize interface-specific information -USAGE - herr_t H5P__init_pub_interface() -RETURNS - Non-negative on success/Negative on failure -DESCRIPTION - Initializes any interface-specific data or routines. (Just calls - H5P_init() currently). - ---------------------------------------------------------------------------*/ -static herr_t -H5P__init_pub_interface(void) -{ - FUNC_ENTER_STATIC_NOERR - - FUNC_LEAVE_NOAPI(H5P_init()) -} /* H5P__init_pub_interface() */ - - -/*-------------------------------------------------------------------------- -NAME - H5P__term_pub_interface -- Terminate interface -USAGE - herr_t H5P__term_pub_interface() -RETURNS - Non-negative on success/Negative on failure -DESCRIPTION - Terminates interface. (Just resets H5_interface_initialize_g - currently). - ---------------------------------------------------------------------------*/ -herr_t -H5P__term_pub_interface(void) -{ - FUNC_ENTER_PACKAGE_NOERR - - /* Mark closed */ - H5_interface_initialize_g = 0; - - FUNC_LEAVE_NOAPI(0) -} /* H5P__term_pub_interface() */ - - -/*-------------------------------------------------------------------------- NAME H5Pcopy PURPOSE diff --git a/src/H5PL.c b/src/H5PL.c index bfe79aa..4c35c09 100644 --- a/src/H5PL.c +++ b/src/H5PL.c @@ -16,8 +16,7 @@ /* Module Setup */ /****************/ -/* Interface initialization */ -#define H5_INTERFACE_INIT_FUNC H5PL__init_interface +#include "H5PLmodule.h" /* This source code file is part of the H5PL module */ /***********/ @@ -52,7 +51,6 @@ * If you do not do this, people will be unable to incorporate our * source code into their own CMake builds if they define UNICODE. */ - #ifdef H5_HAVE_WIN32_API #define H5PL_PATH_SEPARATOR ";" @@ -103,6 +101,7 @@ typedef const void *(*H5PL_get_plugin_info_t)(void); /* Special symbol to indicate no plugin loading */ #define H5PL_NO_PLUGIN "::" + /******************/ /* Local Typedefs */ /******************/ @@ -130,6 +129,9 @@ static herr_t H5PL__close(H5PL_HANDLE handle); /* Package Variables */ /*********************/ +/* Package initialization variable */ +hbool_t H5_PKG_INIT_VAR = FALSE; + /*****************************/ /* Library Private Variables */ @@ -153,36 +155,94 @@ static hbool_t H5PL_path_found_g = FALSE; /* Enable all plugin libraries */ static unsigned int H5PL_plugin_g = H5PL_ALL_PLUGIN; + /*-------------------------------------------------------------------------- NAME - H5PL__init_interface -- Initialize interface-specific information + H5PL__init_package -- Initialize interface-specific information USAGE - herr_t H5PL__init_interface() + herr_t H5PL__init_package() RETURNS Non-negative on success/Negative on failure DESCRIPTION Initializes any interface-specific data or routines. --------------------------------------------------------------------------*/ -static herr_t -H5PL__init_interface(void) +herr_t +H5PL__init_package(void) { char *preload_path; - FUNC_ENTER_STATIC_NOERR + FUNC_ENTER_PACKAGE_NOERR /* Retrieve pathnames from HDF5_PLUGIN_PRELOAD if the user sets it * to tell the library to load plugin libraries without search. */ - if(NULL != (preload_path = HDgetenv("HDF5_PLUGIN_PRELOAD"))) { + if(NULL != (preload_path = HDgetenv("HDF5_PLUGIN_PRELOAD"))) /* Special symbal "::" means no plugin during data reading. */ if(!HDstrcmp(preload_path, H5PL_NO_PLUGIN)) H5PL_plugin_g = 0; - } /* end if */ FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5PL__init_interface() */ +} /* end H5PL__init_package() */ + + +/*------------------------------------------------------------------------- + * Function: H5PL_term_package + * + * Purpose: Terminate the H5PL interface: release all memory, reset all + * global variables to initial values. This only happens if all + * types have been destroyed from other interfaces. + * + * Return: Success: Positive if any action was taken that might + * affect some other interface; zero otherwise. + * Failure: Negative. + * + * Programmer: Raymond Lu + * 20 February 2013 + * + *------------------------------------------------------------------------- + */ +int +H5PL_term_package(void) +{ + int n = 0; + + FUNC_ENTER_NOAPI_NOINIT_NOERR + + if(H5_PKG_INIT_VAR) { + size_t u; /* Local index variable */ + + /* Close opened dynamic libraries */ + if(H5PL_table_g) { + for(u = 0; u < H5PL_table_used_g; u++) + H5PL__close((H5PL_table_g[u]).handle); + + /* Free the table of dynamic libraries */ + H5PL_table_g = (H5PL_table_t *)H5MM_xfree(H5PL_table_g); + H5PL_table_used_g = H5PL_table_alloc_g = 0; + + n++; + } /* end if */ + + /* Free the table of search paths */ + if(H5PL_num_paths_g > 0) { + for(u = 0; u < H5PL_num_paths_g; u++) + if(H5PL_path_table_g[u]) + H5PL_path_table_g[u] = (char *)H5MM_xfree(H5PL_path_table_g[u]); + H5PL_num_paths_g = 0; + H5PL_path_found_g = FALSE; + + n++; + } /* end if */ + + /* Mark the interface as uninitialized */ + if(0 == n) + H5_PKG_INIT_VAR = FALSE; + } /* end if */ + + FUNC_LEAVE_NOAPI(n) +} /* end H5PL_term_package() */ /*------------------------------------------------------------------------- @@ -209,21 +269,24 @@ H5PLset_loading_state(unsigned int plugin_type) { char *preload_path; herr_t ret_value = SUCCEED; /* Return value */ + FUNC_ENTER_API(FAIL) H5TRACE1("e", "Iu", plugin_type); + /* change the bit value of the requested plugin type(s) */ H5PL_plugin_g = plugin_type; + /* check if special ENV variable is set and disable all plugin types */ - if(NULL != (preload_path = HDgetenv("HDF5_PLUGIN_PRELOAD"))) { + if(NULL != (preload_path = HDgetenv("HDF5_PLUGIN_PRELOAD"))) /* Special symbol "::" means no plugin during data reading. */ if(!HDstrcmp(preload_path, H5PL_NO_PLUGIN)) H5PL_plugin_g = 0; - } + done: FUNC_LEAVE_API(ret_value) } /* end H5PLset_loading_state() */ - + /*------------------------------------------------------------------------- * Function: H5PLget_loading_state * @@ -240,66 +303,17 @@ herr_t H5PLget_loading_state(unsigned int *plugin_type) { herr_t ret_value = SUCCEED; /* Return value */ + FUNC_ENTER_API(FAIL) H5TRACE1("e", "*Iu", plugin_type); if(plugin_type) *plugin_type = H5PL_plugin_g; - done: + +done: FUNC_LEAVE_API(ret_value) } /* end H5PLget_loading_state() */ - - -/*------------------------------------------------------------------------- - * Function: H5PL_term_interface - * - * Purpose: Terminate the H5PL interface: release all memory, reset all - * global variables to initial values. This only happens if all - * types have been destroyed from other interfaces. - * - * Return: Success: Positive if any action was taken that might - * affect some other interface; zero otherwise. - * - * Failure: Negative. - * - * Programmer: Raymond Lu - * 20 February 2013 - * - *------------------------------------------------------------------------- - */ -int -H5PL_term_interface(void) -{ - int i = 0; - - FUNC_ENTER_NOAPI_NOINIT_NOERR - - if(H5_interface_initialize_g) { - size_t u; /* Local index variable */ - - /* Close opened dynamic libraries */ - for(u = 0; u < H5PL_table_used_g; u++) - H5PL__close((H5PL_table_g[u]).handle); - - /* Free the table of dynamic libraries */ - H5PL_table_g = (H5PL_table_t *)H5MM_xfree(H5PL_table_g); - H5PL_table_used_g = H5PL_table_alloc_g = 0; - - /* Free the table of search paths */ - for(u = 0; u < H5PL_num_paths_g; u++) - if(H5PL_path_table_g[u]) - H5PL_path_table_g[u] = (char *)H5MM_xfree(H5PL_path_table_g[u]); - H5PL_num_paths_g = 0; - H5PL_path_found_g = FALSE; - - H5_interface_initialize_g = 0; - i = 1; - } /* end if */ - - FUNC_LEAVE_NOAPI(i) -} /* end H5PL_term_interface() */ - /*------------------------------------------------------------------------- * Function: H5PL_load @@ -324,16 +338,17 @@ H5PL_load(H5PL_type_t type, int id) FUNC_ENTER_NOAPI(NULL) - switch (type) { - case H5PL_TYPE_FILTER: - if((H5PL_plugin_g & H5PL_FILTER_PLUGIN) == 0) - HGOTO_ERROR(H5E_PLUGIN, H5E_CANTLOAD, NULL, "required dynamically loaded plugin filter '%d' is not available", id) - break; - case H5PL_TYPE_ERROR: - case H5PL_TYPE_NONE: - default: - HGOTO_ERROR(H5E_PLUGIN, H5E_CANTLOAD, NULL, "required dynamically loaded plugin '%d' is not valid", id) - } + switch(type) { + case H5PL_TYPE_FILTER: + if((H5PL_plugin_g & H5PL_FILTER_PLUGIN) == 0) + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTLOAD, NULL, "required dynamically loaded plugin filter '%d' is not available", id) + break; + + case H5PL_TYPE_ERROR: + case H5PL_TYPE_NONE: + default: + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTLOAD, NULL, "required dynamically loaded plugin '%d' is not valid", id) + } /* end switch */ /* Initialize the location paths for dynamic libraries, if they aren't * already set up. @@ -726,3 +741,4 @@ H5PL__close(H5PL_HANDLE handle) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5PL__close() */ + diff --git a/src/H5PLmodule.h b/src/H5PLmodule.h new file mode 100644 index 0000000..0339737 --- /dev/null +++ b/src/H5PLmodule.h @@ -0,0 +1,36 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* + * Programmer: Quincey Koziol + * Saturday, September 12, 2015 + * + * Purpose: This file contains declarations which define macros for the + * H5PL package. Including this header means that the source file + * is part of the H5PL package. + */ +#ifndef _H5PLmodule_H +#define _H5PLmodule_H + +/* Define the proper control macros for the generic FUNC_ENTER/LEAVE and error + * reporting macros. + */ +#define H5PL_MODULE +#define H5_MY_PKG H5PL +#define H5_MY_PKG_ERR H5E_PLUGIN +#define H5_MY_PKG_INIT YES + +#endif /* _H5PLmodule_H */ + + diff --git a/src/H5Pacpl.c b/src/H5Pacpl.c index 0a0641c..bfed332 100644 --- a/src/H5Pacpl.c +++ b/src/H5Pacpl.c @@ -27,7 +27,9 @@ /****************/ /* Module Setup */ /****************/ -#define H5P_PACKAGE /*suppress error about including H5Ppkg */ + +#include "H5Pmodule.h" /* This source code file is part of the H5P module */ + /***********/ /* Headers */ diff --git a/src/H5Pdapl.c b/src/H5Pdapl.c index 93d16bb..833f3f0 100644 --- a/src/H5Pdapl.c +++ b/src/H5Pdapl.c @@ -27,7 +27,8 @@ /****************/ /* Module Setup */ /****************/ -#define H5P_PACKAGE /*suppress error about including H5Ppkg */ + +#include "H5Pmodule.h" /* This source code file is part of the H5P module */ /***********/ diff --git a/src/H5Pdcpl.c b/src/H5Pdcpl.c index fe13ac5..8c40c97 100644 --- a/src/H5Pdcpl.c +++ b/src/H5Pdcpl.c @@ -27,8 +27,8 @@ /****************/ /* Module Setup */ /****************/ -#define H5P_PACKAGE /*suppress error about including H5Ppkg */ -#define H5Z_PACKAGE /*suppress error about including H5Zpkg */ + +#include "H5Pmodule.h" /* This source code file is part of the H5P module */ /***********/ @@ -43,7 +43,7 @@ #include "H5MMprivate.h" /* Memory management */ #include "H5Ppkg.h" /* Property lists */ #include "H5Tprivate.h" /* Datatypes */ -#include "H5Zpkg.h" /* Data filters */ +#include "H5Zprivate.h" /* Data filters */ /****************/ diff --git a/src/H5Pdeprec.c b/src/H5Pdeprec.c index e4e91ac..ecf2bea 100644 --- a/src/H5Pdeprec.c +++ b/src/H5Pdeprec.c @@ -31,10 +31,7 @@ /* Module Setup */ /****************/ -#define H5P_PACKAGE /*suppress error about including H5Ppkg */ - -/* Interface initialization */ -#define H5_INTERFACE_INIT_FUNC H5P__init_deprec_interface +#include "H5Pmodule.h" /* This source code file is part of the H5P module */ /***********/ @@ -82,51 +79,6 @@ /*******************/ - -/*-------------------------------------------------------------------------- -NAME - H5P__init_deprec_interface -- Initialize interface-specific information -USAGE - herr_t H5P__init_deprec_interface() -RETURNS - Non-negative on success/Negative on failure -DESCRIPTION - Initializes any interface-specific data or routines. (Just calls - H5P_init() currently). - ---------------------------------------------------------------------------*/ -static herr_t -H5P__init_deprec_interface(void) -{ - FUNC_ENTER_STATIC_NOERR - - FUNC_LEAVE_NOAPI(H5P_init()) -} /* H5P__init_deprec_interface() */ - - -/*-------------------------------------------------------------------------- -NAME - H5P__term_deprec_interface -- Terminate interface -USAGE - herr_t H5P__term_deprec_interface() -RETURNS - Non-negative on success/Negative on failure -DESCRIPTION - Terminates interface. (Just resets H5_interface_initialize_g - currently). - ---------------------------------------------------------------------------*/ -herr_t -H5P__term_deprec_interface(void) -{ - FUNC_ENTER_PACKAGE_NOERR - - /* Mark closed */ - H5_interface_initialize_g = 0; - - FUNC_LEAVE_NOAPI(0) -} /* H5P__term_deprec_interface() */ - #ifndef H5_NO_DEPRECATED_SYMBOLS /*-------------------------------------------------------------------------- diff --git a/src/H5Pdxpl.c b/src/H5Pdxpl.c index 980b001..33423f1 100644 --- a/src/H5Pdxpl.c +++ b/src/H5Pdxpl.c @@ -27,7 +27,8 @@ /****************/ /* Module Setup */ /****************/ -#define H5P_PACKAGE /*suppress error about including H5Ppkg */ + +#include "H5Pmodule.h" /* This source code file is part of the H5P module */ /***********/ diff --git a/src/H5Pencdec.c b/src/H5Pencdec.c index bd0a260..3ed150b 100644 --- a/src/H5Pencdec.c +++ b/src/H5Pencdec.c @@ -22,12 +22,7 @@ /* Module Setup */ /****************/ -#define H5P_PACKAGE /*suppress error about including H5Ppkg */ - -#ifdef NOT_YET -/* Interface initialization */ -#define H5_INTERFACE_INIT_FUNC H5P_init_encdec_interface -#endif /* NOT_YET */ +#include "H5Pmodule.h" /* This source code file is part of the H5P module */ /***********/ @@ -82,29 +77,6 @@ typedef struct { /*******************/ -#ifdef NOT_YET - -/*-------------------------------------------------------------------------- -NAME - H5P_init_encdec_interface -- Initialize interface-specific information -USAGE - herr_t H5P_init_encdec_interface() -RETURNS - Non-negative on success/Negative on failure -DESCRIPTION - Initializes any interface-specific data or routines. (Just calls - H5P_init() currently). - ---------------------------------------------------------------------------*/ -static herr_t -H5P_init_encdec_interface(void) -{ - FUNC_ENTER_NOAPI_NOINIT_NOERR - - FUNC_LEAVE_NOAPI(H5P_init()) -} /* H5P_init_encdec_interface() */ -#endif /* NOT_YET */ - /*------------------------------------------------------------------------- * Function: H5P__encode_size_t @@ -737,7 +709,7 @@ H5P__decode(const void *buf) hid_t plist_id = -1; /* ID of new property list */ size_t value_buf_size = 0; /* Size of current value buffer */ uint8_t vers; /* Version of encoded property list */ - hid_t ret_value; /* Return value */ + hid_t ret_value = H5I_INVALID_HID; /* Return value */ FUNC_ENTER_PACKAGE @@ -793,7 +765,7 @@ H5P__decode(const void *buf) HGOTO_ERROR(H5E_PLIST, H5E_CANTDECODE, FAIL, "property decoding routine failed, property: '%s'", name) } /* end if */ else - HGOTO_ERROR(H5E_PLIST, H5E_NOTFOUND, FAIL, "no decode callback for property: '%s', name") + HGOTO_ERROR(H5E_PLIST, H5E_NOTFOUND, FAIL, "no decode callback for property: '%s'", name) /* Set the value for the property */ if(H5P_set(plist, name, value_buf) < 0) diff --git a/src/H5Pfapl.c b/src/H5Pfapl.c index 6b3d4ac..835a63c 100644 --- a/src/H5Pfapl.c +++ b/src/H5Pfapl.c @@ -27,7 +27,8 @@ /****************/ /* Module Setup */ /****************/ -#define H5P_PACKAGE /*suppress error about including H5Ppkg */ + +#include "H5Pmodule.h" /* This source code file is part of the H5P module */ /***********/ diff --git a/src/H5Pfcpl.c b/src/H5Pfcpl.c index 5fc93fd..d451982 100644 --- a/src/H5Pfcpl.c +++ b/src/H5Pfcpl.c @@ -27,7 +27,8 @@ /****************/ /* Module Setup */ /****************/ -#define H5P_PACKAGE /*suppress error about including H5Ppkg */ + +#include "H5Pmodule.h" /* This source code file is part of the H5P module */ /***********/ diff --git a/src/H5Pfmpl.c b/src/H5Pfmpl.c index 875f101..de9fa3b 100644 --- a/src/H5Pfmpl.c +++ b/src/H5Pfmpl.c @@ -27,7 +27,8 @@ /****************/ /* Module Setup */ /****************/ -#define H5P_PACKAGE /*suppress error about including H5Ppkg */ + +#include "H5Pmodule.h" /* This source code file is part of the H5P module */ /***********/ diff --git a/src/H5Pgcpl.c b/src/H5Pgcpl.c index 1e3a278..f84fa7b 100644 --- a/src/H5Pgcpl.c +++ b/src/H5Pgcpl.c @@ -27,7 +27,9 @@ /****************/ /* Module Setup */ /****************/ -#define H5P_PACKAGE /*suppress error about including H5Ppkg */ + +#include "H5Pmodule.h" /* This source code file is part of the H5P module */ + /***********/ /* Headers */ diff --git a/src/H5Pint.c b/src/H5Pint.c index e25b686..226e4a4 100644 --- a/src/H5Pint.c +++ b/src/H5Pint.c @@ -22,10 +22,7 @@ /* Module Setup */ /****************/ -#define H5P_PACKAGE /*suppress error about including H5Ppkg */ - -/* Interface initialization */ -#define H5_INTERFACE_INIT_FUNC H5P_init_interface +#include "H5Pmodule.h" /* This source code file is part of the H5P module */ /***********/ @@ -96,7 +93,7 @@ static int H5P_cmp_prop(const H5P_genprop_t *prop1, const H5P_genprop_t *prop2); /* * Predefined property list classes. These are initialized at runtime by - * H5P_init_interface() in this source file. + * H5P__init_package() in this source file. */ hid_t H5P_CLS_ROOT_ID_g = FAIL; H5P_genclass_t *H5P_CLS_ROOT_g = NULL; @@ -135,7 +132,7 @@ H5P_genclass_t *H5P_CLS_STRING_CREATE_g = NULL; /* * Predefined property lists for each predefined class. These are initialized - * at runtime by H5P_init_interface() in this source file. + * at runtime by H5P__init_package() in this source file. */ hid_t H5P_LST_FILE_CREATE_ID_g = FAIL; hid_t H5P_LST_FILE_ACCESS_ID_g = FAIL; @@ -312,89 +309,17 @@ static const H5I_class_t H5I_GENPROPLST_CLS[1] = {{ -/*-------------------------------------------------------------------------- - NAME - H5P_do_prop_cb1 - PURPOSE - Internal routine to call a property list callback routine and update - the property list accordingly. - USAGE - herr_t H5P_do_prop_cb1(slist,prop,cb) - H5SL_t *slist; IN/OUT: Skip list to hold changed properties - H5P_genprop_t *prop; IN: Property to call callback for - H5P_prp_cb1_t *cb; IN: Callback routine to call - RETURNS - Returns non-negative on success, negative on failure. - DESCRIPTION - Calls the callback routine passed in. If the callback routine changes - the property value, then the property is duplicated and added to skip list. - - GLOBAL VARIABLES - COMMENTS, BUGS, ASSUMPTIONS - EXAMPLES - REVISION LOG ---------------------------------------------------------------------------*/ -static herr_t -H5P_do_prop_cb1(H5SL_t *slist, H5P_genprop_t *prop, H5P_prp_cb1_t cb) -{ - void *tmp_value=NULL; /* Temporary value buffer */ - H5P_genprop_t *pcopy=NULL; /* Copy of property to insert into skip list */ - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI_NOINIT - - /* Allocate space for a temporary copy of the property value */ - if(NULL == (tmp_value = H5MM_malloc(prop->size))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for temporary property value") - HDmemcpy(tmp_value,prop->value,prop->size); - - /* Call "type 1" callback ('create', 'copy' or 'close') */ - if(cb(prop->name,prop->size,tmp_value) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTINIT, FAIL,"Property callback failed") - - /* Check if the property value changed */ - if((prop->cmp)(tmp_value,prop->value,prop->size)) { - /* Make a copy of the class's property */ - if((pcopy=H5P_dup_prop(prop,H5P_PROP_WITHIN_LIST)) == NULL) - HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, FAIL,"Can't copy property") - - /* Copy the changed value into the new property */ - HDmemcpy(pcopy->value,tmp_value,prop->size); - - /* Insert the changed property into the property list */ - if(H5P_add_prop(slist,pcopy) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL,"Can't insert property into skip list") - } /* end if */ - -done: - /* Release the temporary value buffer */ - if(tmp_value!=NULL) - H5MM_xfree(tmp_value); - - /* Cleanup on failure */ - if(ret_value<0) { - if(pcopy!=NULL) - H5P_free_prop(pcopy); - } /* end if */ - - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5P_do_prop_cb1() */ - - /*------------------------------------------------------------------------- * Function: H5P_init * * Purpose: Initialize the interface from some other layer. * * Return: Success: non-negative - * * Failure: negative * * Programmer: Quincey Koziol * Saturday, March 4, 2000 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t @@ -412,22 +337,22 @@ done: /*-------------------------------------------------------------------------- NAME - H5P_init_interface -- Initialize interface-specific information + H5P__init_package -- Initialize interface-specific information USAGE - herr_t H5P_init_interface() + herr_t H5P__init_package() RETURNS Non-negative on success/Negative on failure DESCRIPTION Initializes any interface-specific data or routines. --------------------------------------------------------------------------*/ -static herr_t -H5P_init_interface(void) +herr_t +H5P__init_package(void) { size_t tot_init; /* Total # of classes initialized */ size_t pass_init; /* # of classes initialized in each pass */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Initialize the Generic Property class & object groups. @@ -490,16 +415,16 @@ H5P_init_interface(void) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5P_init_interface() */ +} /* end H5P__init_package() */ /*-------------------------------------------------------------------------- NAME - H5P_term_interface + H5P_term_package PURPOSE Terminate various H5P objects USAGE - void H5P_term_interface() + void H5P_term_package() RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -511,13 +436,13 @@ done: REVISION LOG --------------------------------------------------------------------------*/ int -H5P_term_interface(void) +H5P_term_package(void) { int n = 0; FUNC_ENTER_NOAPI_NOINIT_NOERR - if(H5_interface_initialize_g) { + if(H5_PKG_INIT_VAR) { int64_t nlist, nclass; /* Destroy HDF5 library property classes & lists */ @@ -597,25 +522,87 @@ H5P_term_interface(void) n++; /*H5I*/ } else { - /* Close public interface */ - n += H5P__term_pub_interface(); - - /* Close deprecated interface */ - n += H5P__term_deprec_interface(); - /* Destroy the property list and class id groups */ - (void)H5I_dec_type_ref(H5I_GENPROP_LST); - n++; /*H5I*/ - (void)H5I_dec_type_ref(H5I_GENPROP_CLS); - n++; /*H5I*/ + n += (H5I_dec_type_ref(H5I_GENPROP_LST) > 0); + n += (H5I_dec_type_ref(H5I_GENPROP_CLS) > 0); /* Mark closed */ - H5_interface_initialize_g = 0; + if(0 == n) + H5_PKG_INIT_VAR = FALSE; } /* end else */ } /* end if */ FUNC_LEAVE_NOAPI(n) -} /* end H5P_term_interface() */ +} /* end H5P_term_package() */ + + +/*-------------------------------------------------------------------------- + NAME + H5P_do_prop_cb1 + PURPOSE + Internal routine to call a property list callback routine and update + the property list accordingly. + USAGE + herr_t H5P_do_prop_cb1(slist,prop,cb) + H5SL_t *slist; IN/OUT: Skip list to hold changed properties + H5P_genprop_t *prop; IN: Property to call callback for + H5P_prp_cb1_t *cb; IN: Callback routine to call + RETURNS + Returns non-negative on success, negative on failure. + DESCRIPTION + Calls the callback routine passed in. If the callback routine changes + the property value, then the property is duplicated and added to skip list. + + GLOBAL VARIABLES + COMMENTS, BUGS, ASSUMPTIONS + EXAMPLES + REVISION LOG +--------------------------------------------------------------------------*/ +static herr_t +H5P_do_prop_cb1(H5SL_t *slist, H5P_genprop_t *prop, H5P_prp_cb1_t cb) +{ + void *tmp_value=NULL; /* Temporary value buffer */ + H5P_genprop_t *pcopy=NULL; /* Copy of property to insert into skip list */ + herr_t ret_value=SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI_NOINIT + + /* Allocate space for a temporary copy of the property value */ + if(NULL == (tmp_value = H5MM_malloc(prop->size))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for temporary property value") + HDmemcpy(tmp_value,prop->value,prop->size); + + /* Call "type 1" callback ('create', 'copy' or 'close') */ + if(cb(prop->name,prop->size,tmp_value) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTINIT, FAIL,"Property callback failed") + + /* Check if the property value changed */ + if((prop->cmp)(tmp_value,prop->value,prop->size)) { + /* Make a copy of the class's property */ + if((pcopy=H5P_dup_prop(prop,H5P_PROP_WITHIN_LIST)) == NULL) + HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, FAIL,"Can't copy property") + + /* Copy the changed value into the new property */ + HDmemcpy(pcopy->value,tmp_value,prop->size); + + /* Insert the changed property into the property list */ + if(H5P_add_prop(slist,pcopy) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL,"Can't insert property into skip list") + } /* end if */ + +done: + /* Release the temporary value buffer */ + if(tmp_value!=NULL) + H5MM_xfree(tmp_value); + + /* Cleanup on failure */ + if(ret_value<0) { + if(pcopy!=NULL) + H5P_free_prop(pcopy); + } /* end if */ + + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5P_do_prop_cb1() */ /*-------------------------------------------------------------------------- @@ -934,7 +921,7 @@ static H5P_genprop_t * H5P_dup_prop(H5P_genprop_t *oprop, H5P_prop_within_t type) { H5P_genprop_t *prop = NULL; /* Pointer to new property copied */ - H5P_genprop_t *ret_value; /* Return value */ + H5P_genprop_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -1050,8 +1037,8 @@ H5P_create_prop(const char *name, size_t size, H5P_prop_within_t type, H5P_prp_copy_func_t prp_copy, H5P_prp_compare_func_t prp_cmp, H5P_prp_close_func_t prp_close) { - H5P_genprop_t *prop = NULL; /* Pointer to new property copied */ - H5P_genprop_t *ret_value; /* Return value */ + H5P_genprop_t *prop = NULL; /* Pointer to new property copied */ + H5P_genprop_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -1171,7 +1158,7 @@ done: H5P_genprop_t * H5P__find_prop_plist(const H5P_genplist_t *plist, const char *name) { - H5P_genprop_t *ret_value; /* Property pointer return value */ + H5P_genprop_t *ret_value = NULL; /* Return value */ FUNC_ENTER_PACKAGE @@ -1231,7 +1218,7 @@ done: static H5P_genprop_t * H5P_find_prop_pclass(H5P_genclass_t *pclass, const char *name) { - H5P_genprop_t *ret_value; /* Property pointer return value */ + H5P_genprop_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -1541,8 +1528,8 @@ H5P_create_class(H5P_genclass_t *par_class, const char *name, H5P_plist_type_t t H5P_cls_copy_func_t cls_copy, void *copy_data, H5P_cls_close_func_t cls_close, void *close_data) { - H5P_genclass_t *pclass=NULL; /* Property list class created */ - H5P_genclass_t *ret_value; /* return value */ + H5P_genclass_t *pclass = NULL; /* Property list class created */ + H5P_genclass_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI(NULL) @@ -1636,10 +1623,10 @@ static H5P_genplist_t * H5P_create(H5P_genclass_t *pclass) { H5P_genclass_t *tclass; /* Temporary class pointer */ - H5P_genplist_t *plist=NULL; /* New property list created */ + H5P_genplist_t *plist = NULL; /* New property list created */ H5P_genprop_t *tmp; /* Temporary pointer to parent class properties */ - H5SL_t *seen=NULL; /* Skip list to hold names of properties already seen */ - H5P_genplist_t *ret_value; /* Return value */ + H5SL_t *seen = NULL; /* Skip list to hold names of properties already seen */ + H5P_genplist_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -1775,10 +1762,10 @@ done: hid_t H5P_create_id(H5P_genclass_t *pclass, hbool_t app_ref) { - H5P_genclass_t *tclass; /* Temporary class pointer */ - H5P_genplist_t *plist = NULL; /* Property list created */ - hid_t plist_id = FAIL; /* Property list ID */ - hid_t ret_value; /* return value */ + H5P_genclass_t *tclass; /* Temporary class pointer */ + H5P_genplist_t *plist = NULL; /* Property list created */ + hid_t plist_id = FAIL; /* Property list ID */ + hid_t ret_value = H5I_INVALID_HID; /* return value */ FUNC_ENTER_NOAPI(FAIL) @@ -3383,7 +3370,7 @@ done: htri_t H5P_class_isa(const H5P_genclass_t *pclass1, const H5P_genclass_t *pclass2) { - htri_t ret_value; + htri_t ret_value = FAIL; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -3436,7 +3423,7 @@ H5P_isa_class(hid_t plist_id, hid_t pclass_id) { H5P_genplist_t *plist; /* Property list to query */ H5P_genclass_t *pclass; /* Property list class */ - htri_t ret_value; /* return value */ + htri_t ret_value = FAIL; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -3486,7 +3473,7 @@ done: H5P_genplist_t * H5P_object_verify(hid_t plist_id, hid_t pclass_id) { - H5P_genplist_t *ret_value; /* return value */ + H5P_genplist_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI(NULL) @@ -4759,7 +4746,7 @@ done: char * H5P_get_class_name(H5P_genclass_t *pclass) { - char *ret_value; /* return value */ + char *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI(NULL) @@ -4797,7 +4784,7 @@ done: char * H5P_get_class_path(H5P_genclass_t *pclass) { - char *ret_value; /* return value */ + char *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -4863,7 +4850,7 @@ H5P_open_class_path(const char *path) char *delimit; /* Pointer to path delimiter during traversal */ H5P_genclass_t *curr_class; /* Pointer to class during path traversal */ H5P_check_class_t check_info; /* Structure to hold the information for checking duplicate names */ - H5P_genclass_t *ret_value; /* Return value */ + H5P_genclass_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -4943,7 +4930,7 @@ done: H5P_genclass_t * H5P_get_class_parent(const H5P_genclass_t *pclass) { - H5P_genclass_t *ret_value; /* return value */ + H5P_genclass_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -5010,7 +4997,7 @@ H5P__new_plist_of_type(H5P_plist_type_t type) { H5P_genclass_t *pclass; /* Class of property list to create */ hid_t class_id; /* ID of class to create */ - hid_t ret_value; /* Return value */ + hid_t ret_value = H5I_INVALID_HID; /* Return value */ FUNC_ENTER_PACKAGE diff --git a/src/H5Plapl.c b/src/H5Plapl.c index e3b3c4f..443e068 100644 --- a/src/H5Plapl.c +++ b/src/H5Plapl.c @@ -27,7 +27,9 @@ /****************/ /* Module Setup */ /****************/ -#define H5P_PACKAGE /*suppress error about including H5Ppkg */ + +#include "H5Pmodule.h" /* This source code file is part of the H5P module */ + /***********/ /* Headers */ diff --git a/src/H5Plcpl.c b/src/H5Plcpl.c index cde2035..f6e7793 100644 --- a/src/H5Plcpl.c +++ b/src/H5Plcpl.c @@ -27,7 +27,8 @@ /****************/ /* Module Setup */ /****************/ -#define H5P_PACKAGE /*suppress error about including H5Ppkg */ + +#include "H5Pmodule.h" /* This source code file is part of the H5P module */ /***********/ diff --git a/src/H5Pmodule.h b/src/H5Pmodule.h new file mode 100644 index 0000000..ddf7c0f --- /dev/null +++ b/src/H5Pmodule.h @@ -0,0 +1,35 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* + * Programmer: Quincey Koziol + * Saturday, September 12, 2015 + * + * Purpose: This file contains declarations which define macros for the + * H5P package. Including this header means that the source file + * is part of the H5P package. + */ +#ifndef _H5Pmodule_H +#define _H5Pmodule_H + +/* Define the proper control macros for the generic FUNC_ENTER/LEAVE and error + * reporting macros. + */ +#define H5P_MODULE +#define H5_MY_PKG H5P +#define H5_MY_PKG_ERR H5E_PLIST +#define H5_MY_PKG_INIT YES + +#endif /* _H5Pmodule_H */ + diff --git a/src/H5Pocpl.c b/src/H5Pocpl.c index 2740aad..08eba3d 100644 --- a/src/H5Pocpl.c +++ b/src/H5Pocpl.c @@ -27,8 +27,9 @@ /****************/ /* Module Setup */ /****************/ -#define H5O_PACKAGE /*suppress error about including H5Opkg */ -#define H5P_PACKAGE /*suppress error about including H5Ppkg */ + +#define H5O_FRIEND /*suppress error about including H5Opkg */ +#include "H5Pmodule.h" /* This source code file is part of the H5P module */ /***********/ diff --git a/src/H5Pocpypl.c b/src/H5Pocpypl.c index 45ba778..08db49f 100644 --- a/src/H5Pocpypl.c +++ b/src/H5Pocpypl.c @@ -27,7 +27,8 @@ /****************/ /* Module Setup */ /****************/ -#define H5P_PACKAGE /*suppress error about including H5Ppkg */ + +#include "H5Pmodule.h" /* This source code file is part of the H5P module */ /***********/ diff --git a/src/H5Ppkg.h b/src/H5Ppkg.h index 2942a4d..105baf7 100644 --- a/src/H5Ppkg.h +++ b/src/H5Ppkg.h @@ -21,7 +21,7 @@ * the H5P package. Source files outside the H5P package should * include H5Pprivate.h instead. */ -#ifndef H5P_PACKAGE +#if !(defined H5P_FRIEND || defined H5P_MODULE) #error "Do not include this file outside the H5P package!" #endif @@ -158,8 +158,6 @@ struct H5Z_filter_info_t; /******************************/ /* Private functions, not part of the publicly documented API */ -H5_DLL herr_t H5P__term_pub_interface(void); -H5_DLL herr_t H5P__term_deprec_interface(void); H5_DLL H5P_genclass_t *H5P_create_class(H5P_genclass_t *par_class, const char *name, H5P_plist_type_t type, H5P_cls_create_func_t cls_create, void *create_data, diff --git a/src/H5Pprivate.h b/src/H5Pprivate.h index 7233818..db89bea 100644 --- a/src/H5Pprivate.h +++ b/src/H5Pprivate.h @@ -33,13 +33,13 @@ #define H5P_STRCRT_CHAR_ENCODING_NAME "character_encoding" /* Character set encoding for string */ /* If the module using this macro is allowed access to the private variables, access them directly */ -#ifdef H5P_PACKAGE +#ifdef H5P_MODULE #define H5P_PLIST_ID(P) ((P)->plist_id) #define H5P_CLASS(P) ((P)->pclass) -#else /* H5F_PACKAGE */ +#else /* H5P_MODULE */ #define H5P_PLIST_ID(P) (H5P_get_plist_id(P)) #define H5P_CLASS(P) (H5P_get_class(P)) -#endif /* H5P_PACKAGE */ +#endif /* H5P_MODULE */ /****************************/ diff --git a/src/H5Pstrcpl.c b/src/H5Pstrcpl.c index 3ba625e..5a09cd7 100644 --- a/src/H5Pstrcpl.c +++ b/src/H5Pstrcpl.c @@ -27,7 +27,9 @@ /****************/ /* Module Setup */ /****************/ -#define H5P_PACKAGE /*suppress error about including H5Ppkg */ + +#include "H5Pmodule.h" /* This source code file is part of the H5P module */ + /***********/ /* Headers */ diff --git a/src/H5Ptest.c b/src/H5Ptest.c index b36da6a..6dd52f9 100644 --- a/src/H5Ptest.c +++ b/src/H5Ptest.c @@ -19,7 +19,7 @@ * Purpose: Generic Property Testing Functions */ -#define H5P_PACKAGE /*suppress error about including H5Ppkg */ +#include "H5Pmodule.h" /* This source code file is part of the H5P module */ #define H5P_TESTING /*suppress warning about H5P testing funcs*/ @@ -60,8 +60,8 @@ char * H5P_get_class_path_test(hid_t pclass_id) { - H5P_genclass_t *pclass; /* Property class to query */ - char *ret_value; /* return value */ + H5P_genclass_t *pclass; /* Property class to query */ + char *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI(NULL) @@ -101,8 +101,8 @@ done: hid_t H5P_open_class_path_test(const char *path) { - H5P_genclass_t *pclass=NULL;/* Property class to query */ - hid_t ret_value; /* Return value */ + H5P_genclass_t *pclass = NULL; /* Property class to query */ + hid_t ret_value = H5I_INVALID_HID; /* Return value */ FUNC_ENTER_NOAPI(FAIL) diff --git a/src/H5R.c b/src/H5R.c index d96f5e6..61b45e1 100644 --- a/src/H5R.c +++ b/src/H5R.c @@ -17,10 +17,7 @@ /* Module Setup */ /****************/ -#define H5R_PACKAGE /*suppress error about including H5Rpkg */ - -/* Interface initialization */ -#define H5_INTERFACE_INIT_FUNC H5R_init_interface +#include "H5Rmodule.h" /* This source code file is part of the H5R module */ /***********/ @@ -63,6 +60,9 @@ static ssize_t H5R_get_name(H5F_t *file, hid_t lapl_id, hid_t dxpl_id, hid_t id, /* Package Variables */ /*********************/ +/* Package initialization variable */ +hbool_t H5_PKG_INIT_VAR = FALSE; + /*****************************/ /* Library Private Variables */ @@ -81,39 +81,16 @@ static const H5I_class_t H5I_REFERENCE_CLS[1] = {{ NULL /* Callback routine for closing objects of this class */ }}; +/* Flag indicating "top" of interface has been initialized */ +static hbool_t H5R_top_package_initialize_s = FALSE; - -/*------------------------------------------------------------------------- - * Function: H5R_init - * - * Purpose: Initialize the interface from some other package. - * - * Return: Success: non-negative - * Failure: negative - * - * Programmer: Quincey Koziol - * Thursday, September 13, 2007 - * - *------------------------------------------------------------------------- - */ -herr_t -H5R_init(void) -{ - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(FAIL) - /* FUNC_ENTER() does all the work */ - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5R_init() */ /*-------------------------------------------------------------------------- NAME - H5R_init_interface -- Initialize interface-specific information + H5R__init_package -- Initialize interface-specific information USAGE - herr_t H5R_init_interface() + herr_t H5R__init_package() RETURNS Non-negative on success/Negative on failure @@ -121,33 +98,37 @@ DESCRIPTION Initializes any interface-specific data or routines. --------------------------------------------------------------------------*/ -static herr_t -H5R_init_interface(void) +herr_t +H5R__init_package(void) { - herr_t ret_value=SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT /* Initialize the atom group for the file IDs */ if(H5I_register_type(H5I_REFERENCE_CLS) < 0) - HGOTO_ERROR(H5E_REFERENCE, H5E_CANTINIT, FAIL, "unable to initialize interface"); + HGOTO_ERROR(H5E_REFERENCE, H5E_CANTINIT, FAIL, "unable to initialize interface") + + /* Mark "top" of interface as initialized, too */ + H5R_top_package_initialize_s = TRUE; done: FUNC_LEAVE_NOAPI(ret_value) -} +} /* end H5R__init_package() */ /*-------------------------------------------------------------------------- NAME - H5R_term_interface + H5R_top_term_package PURPOSE Terminate various H5R objects USAGE - void H5R_term_interface() + void H5R_top_term_package() RETURNS void DESCRIPTION - Release the atom group and any other resources allocated. + Release IDs for the atom group, deferring full interface shutdown + until later (in H5R_term_package). GLOBAL VARIABLES COMMENTS, BUGS, ASSUMPTIONS Can't report errors... @@ -155,32 +136,69 @@ done: REVISION LOG --------------------------------------------------------------------------*/ int -H5R_term_interface(void) +H5R_top_term_package(void) { int n = 0; FUNC_ENTER_NOAPI_NOINIT_NOERR - if (H5_interface_initialize_g) { + if(H5R_top_package_initialize_s) { if(H5I_nmembers(H5I_REFERENCE) > 0) { (void)H5I_clear_type(H5I_REFERENCE, FALSE, FALSE); n++; /*H5I*/ } /* end if */ - else { - /* Close deprecated interface */ - n += H5R__term_deprec_interface(); - /* Destroy the reference id group */ - (void)H5I_dec_type_ref(H5I_REFERENCE); - n++; /*H5I*/ + /* Mark closed */ + if(0 == n) + H5R_top_package_initialize_s = FALSE; + } /* end if */ + + FUNC_LEAVE_NOAPI(n) +} /* end H5R_top_term_package() */ + + +/*-------------------------------------------------------------------------- + NAME + H5R_term_package + PURPOSE + Terminate various H5R objects + USAGE + void H5R_term_package() + RETURNS + void + DESCRIPTION + Release the atom group and any other resources allocated. + GLOBAL VARIABLES + COMMENTS, BUGS, ASSUMPTIONS + Can't report errors... + + Finishes shutting down the interface, after H5R_top_term_package() + is called + EXAMPLES + REVISION LOG +--------------------------------------------------------------------------*/ +int +H5R_term_package(void) +{ + int n = 0; + + FUNC_ENTER_NOAPI_NOINIT_NOERR + + if(H5_PKG_INIT_VAR) { + /* Sanity checks */ + HDassert(0 == H5I_nmembers(H5I_REFERENCE)); + HDassert(FALSE == H5R_top_package_initialize_s); + + /* Destroy the reference id group */ + n += (H5I_dec_type_ref(H5I_REFERENCE) > 0); - /* Mark closed */ - H5_interface_initialize_g = 0; - } /* end else */ + /* Mark closed */ + if(0 == n) + H5_PKG_INIT_VAR = FALSE; } /* end if */ FUNC_LEAVE_NOAPI(n) -} /* end H5R_term_interface() */ +} /* end H5R_term_package() */ /*-------------------------------------------------------------------------- @@ -424,7 +442,7 @@ H5R_dereference(H5F_t *file, hid_t oapl_id, hid_t dxpl_id, H5R_type_t ref_type, H5G_loc_t loc; /* Group location */ unsigned rc; /* Reference count of object */ H5O_type_t obj_type; /* Type of object */ - hid_t ret_value; /* Return value */ + hid_t ret_value = H5I_INVALID_HID; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -902,9 +920,9 @@ static ssize_t H5R_get_name(H5F_t *f, hid_t lapl_id, hid_t dxpl_id, hid_t id, H5R_type_t ref_type, const void *_ref, char *name, size_t size) { - hid_t file_id = (-1); /* ID for file that the reference is in */ + hid_t file_id = H5I_INVALID_HID; /* ID for file that the reference is in */ H5O_loc_t oloc; /* Object location describing object for reference */ - ssize_t ret_value; /* Return value */ + ssize_t ret_value = -1; /* Return value */ FUNC_ENTER_NOAPI_NOINIT diff --git a/src/H5Rdeprec.c b/src/H5Rdeprec.c index 9877f42..b8133b2 100644 --- a/src/H5Rdeprec.c +++ b/src/H5Rdeprec.c @@ -31,10 +31,7 @@ /* Module Setup */ /****************/ -#define H5R_PACKAGE /*suppress error about including H5Rpkg */ - -/* Interface initialization */ -#define H5_INTERFACE_INIT_FUNC H5R__init_deprec_interface +#include "H5Rmodule.h" /* This source code file is part of the H5R module */ /***********/ @@ -84,51 +81,6 @@ /*******************/ - -/*-------------------------------------------------------------------------- -NAME - H5R__init_deprec_interface -- Initialize interface-specific information -USAGE - herr_t H5R__init_deprec_interface() -RETURNS - Non-negative on success/Negative on failure -DESCRIPTION - Initializes any interface-specific data or routines. (Just calls - H5R_init() currently). - ---------------------------------------------------------------------------*/ -static herr_t -H5R__init_deprec_interface(void) -{ - FUNC_ENTER_STATIC_NOERR - - FUNC_LEAVE_NOAPI(H5R_init()) -} /* H5R__init_deprec_interface() */ - - -/*-------------------------------------------------------------------------- -NAME - H5R__term_deprec_interface -- Terminate interface -USAGE - herr_t H5R__term_deprec_interface() -RETURNS - Non-negative on success/Negative on failure -DESCRIPTION - Terminates interface. (Just resets H5_interface_initialize_g - currently). - ---------------------------------------------------------------------------*/ -herr_t -H5R__term_deprec_interface(void) -{ - FUNC_ENTER_PACKAGE_NOERR - - /* Mark closed */ - H5_interface_initialize_g = 0; - - FUNC_LEAVE_NOAPI(0) -} /* H5R__term_deprec_interface() */ - #ifndef H5_NO_DEPRECATED_SYMBOLS /*-------------------------------------------------------------------------- diff --git a/src/H5Rmodule.h b/src/H5Rmodule.h new file mode 100644 index 0000000..6799483 --- /dev/null +++ b/src/H5Rmodule.h @@ -0,0 +1,36 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* + * Programmer: Quincey Koziol + * Saturday, September 12, 2015 + * + * Purpose: This file contains declarations which define macros for the + * H5R package. Including this header means that the source file + * is part of the H5R package. + */ +#ifndef _H5Rmodule_H +#define _H5Rmodule_H + +/* Define the proper control macros for the generic FUNC_ENTER/LEAVE and error + * reporting macros. + */ +#define H5R_MODULE +#define H5_MY_PKG H5R +#define H5_MY_PKG_ERR H5E_REFERENCE +#define H5_MY_PKG_INIT YES + +#endif /* _H5Rmodule_H */ + + diff --git a/src/H5Rpkg.h b/src/H5Rpkg.h index fd16754..8ed8d65 100644 --- a/src/H5Rpkg.h +++ b/src/H5Rpkg.h @@ -21,7 +21,7 @@ * only within the H5R package. Source files outside the * H5R package should include H5Rprivate.h instead. */ -#ifndef H5R_PACKAGE +#if !(defined H5R_FRIEND || defined H5R_MODULE) #error "Do not include this file outside the H5R package!" #endif @@ -54,8 +54,6 @@ /******************************/ /* General functions */ -H5_DLL herr_t H5R_init(void); -H5_DLL herr_t H5R__term_deprec_interface(void); H5_DLL herr_t H5R_get_obj_type(H5F_t *file, hid_t dxpl_id, H5R_type_t ref_type, const void *_ref, H5O_type_t *obj_type); H5_DLL hid_t H5R_dereference(H5F_t *file, hid_t dapl_id, hid_t dxpl_id, H5R_type_t ref_type, diff --git a/src/H5S.c b/src/H5S.c index efb9d34..8850369 100644 --- a/src/H5S.c +++ b/src/H5S.c @@ -17,10 +17,7 @@ /* Module Setup */ /****************/ -#define H5S_PACKAGE /*suppress error about including H5Spkg */ - -/* Interface initialization */ -#define H5_INTERFACE_INIT_FUNC H5S_init_interface +#include "H5Smodule.h" /* This source code file is part of the H5S module */ /***********/ @@ -63,6 +60,9 @@ static H5S_t *H5S_decode(const unsigned char *buf); /* Package Variables */ /*********************/ +/* Package initialization variable */ +hbool_t H5_PKG_INIT_VAR = FALSE; + /*****************************/ /* Library Private Variables */ @@ -80,7 +80,7 @@ H5FL_DEFINE(H5S_extent_t); H5FL_DEFINE(H5S_t); /* Declare a free list to manage the array's of hsize_t's */ -H5FL_ARR_DEFINE(hsize_t,H5S_MAX_RANK); +H5FL_ARR_DEFINE(hsize_t, H5S_MAX_RANK); /* Dataspace ID class */ static const H5I_class_t H5I_DATASPACE_CLS[1] = {{ @@ -90,47 +90,52 @@ static const H5I_class_t H5I_DATASPACE_CLS[1] = {{ (H5I_free_t)H5S_close /* Callback routine for closing objects of this class */ }}; +/* Flag indicating "top" of interface has been initialized */ +static hbool_t H5S_top_package_initialize_s = FALSE; + /*-------------------------------------------------------------------------- NAME - H5S_init_interface -- Initialize interface-specific information + H5S__init_package -- Initialize interface-specific information USAGE - herr_t H5S_init_interface() - + herr_t H5S__init_package() RETURNS Non-negative on success/Negative on failure DESCRIPTION Initializes any interface-specific data or routines. - --------------------------------------------------------------------------*/ -static herr_t -H5S_init_interface(void) +herr_t +H5S__init_package(void) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* Initialize the atom group for the file IDs */ if(H5I_register_type(H5I_DATASPACE_CLS) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "unable to initialize interface") + /* Mark "top" of interface as initialized, too */ + H5S_top_package_initialize_s = TRUE; + done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5S_init_interface() */ +} /* end H5S__init_package() */ /*-------------------------------------------------------------------------- NAME - H5S_term_interface + H5S_top_term_package PURPOSE Terminate various H5S objects USAGE - void H5S_term_interface() + void H5S_top_term_package() RETURNS Non-negative on success/Negative on failure DESCRIPTION - Release the atom group and any other resources allocated. + Release IDs for the atom group, deferring full interface shutdown + until later (in H5S_term_package). GLOBAL VARIABLES COMMENTS, BUGS, ASSUMPTIONS Can't report errors... @@ -138,29 +143,69 @@ done: REVISION LOG --------------------------------------------------------------------------*/ int -H5S_term_interface(void) +H5S_top_term_package(void) { int n = 0; FUNC_ENTER_NOAPI_NOINIT_NOERR - if(H5_interface_initialize_g) { + if(H5S_top_package_initialize_s) { if(H5I_nmembers(H5I_DATASPACE) > 0) { (void)H5I_clear_type(H5I_DATASPACE, FALSE, FALSE); n++; /*H5I*/ } /* end if */ - else { - /* Destroy the dataspace object id group */ - (void)H5I_dec_type_ref(H5I_DATASPACE); - n++; /*H5I*/ - /* Shut down interface */ - H5_interface_initialize_g = 0; - } /* end else */ + /* Mark "top" of interface as closed */ + if(0 == n) + H5S_top_package_initialize_s = FALSE; } /* end if */ FUNC_LEAVE_NOAPI(n) -} /* end H5S_term_interface() */ +} /* end H5S_top_term_package() */ + + +/*-------------------------------------------------------------------------- + NAME + H5S_term_package + PURPOSE + Terminate various H5S objects + USAGE + void H5S_term_package() + RETURNS + Non-negative on success/Negative on failure + DESCRIPTION + Release the atom group and any other resources allocated. + GLOBAL VARIABLES + COMMENTS, BUGS, ASSUMPTIONS + Can't report errors... + + Finishes shutting down the interface, after H5S_top_term_package() + is called + EXAMPLES + REVISION LOG +--------------------------------------------------------------------------*/ +int +H5S_term_package(void) +{ + int n = 0; + + FUNC_ENTER_NOAPI_NOINIT_NOERR + + if(H5_PKG_INIT_VAR) { + /* Sanity checks */ + HDassert(0 == H5I_nmembers(H5I_DATASPACE)); + HDassert(FALSE == H5S_top_package_initialize_s); + + /* Destroy the dataspace object id group */ + n += (H5I_dec_type_ref(H5I_DATASPACE) > 0); + + /* Mark interface as closed */ + if(0 == n) + H5_PKG_INIT_VAR = FALSE; + } /* end if */ + + FUNC_LEAVE_NOAPI(n) +} /* end H5S_term_package() */ /*-------------------------------------------------------------------------- @@ -185,7 +230,7 @@ H5S_t * H5S_create(H5S_class_t type) { H5S_t *new_ds = NULL; /* New dataspace created */ - H5S_t *ret_value; /* Return value */ + H5S_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI(NULL) @@ -588,8 +633,8 @@ done: H5S_t * H5S_copy(const H5S_t *src, hbool_t share_selection, hbool_t copy_max) { - H5S_t *dst = NULL; - H5S_t *ret_value; /* Return value */ + H5S_t *dst = NULL; + H5S_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI(NULL) @@ -640,7 +685,7 @@ done: hssize_t H5S_get_simple_extent_npoints(const H5S_t *ds) { - hssize_t ret_value; + hssize_t ret_value = -1; /* Return value */ FUNC_ENTER_NOAPI(-1) @@ -716,8 +761,8 @@ done: hsize_t H5S_get_npoints_max(const H5S_t *ds) { - hsize_t ret_value; unsigned u; + hsize_t ret_value = 0; /* Return value */ FUNC_ENTER_NOAPI(0) @@ -821,7 +866,7 @@ done: int H5S_get_simple_extent_ndims(const H5S_t *ds) { - int ret_value; /* Return value */ + int ret_value = -1; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -906,8 +951,8 @@ done: int H5S_extent_get_dims(const H5S_extent_t *ext, hsize_t dims[], hsize_t max_dims[]) { - int i; /* Local index variable */ - int ret_value; /* Return value */ + int i; /* Local index variable */ + int ret_value = -1; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -965,7 +1010,7 @@ done: int H5S_get_simple_extent_dims(const H5S_t *ds, hsize_t dims[], hsize_t max_dims[]) { - int ret_value; /* Return value */ + int ret_value = -1; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -1073,8 +1118,8 @@ done: H5S_t * H5S_read(const H5O_loc_t *loc, hid_t dxpl_id) { - H5S_t *ds = NULL; /* Dataspace to return */ - H5S_t *ret_value; /* Return value */ + H5S_t *ds = NULL; /* Dataspace to return */ + H5S_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI(NULL) @@ -1121,7 +1166,7 @@ done: static htri_t H5S_is_simple(const H5S_t *sdim) { - htri_t ret_value; + htri_t ret_value = FAIL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -1426,7 +1471,7 @@ H5S_t * H5S_create_simple(unsigned rank, const hsize_t dims[/*rank*/], const hsize_t maxdims[/*rank*/]) { - H5S_t *ret_value; /* Return value */ + H5S_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI(NULL) @@ -1623,7 +1668,7 @@ H5S_decode(const unsigned char *buf) size_t extent_size; /* size of the extent message*/ H5F_t *f = NULL; /* Fake file structure*/ uint8_t sizeof_size; /* 'Size of sizes' for file */ - H5S_t *ret_value; + H5S_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -1705,7 +1750,7 @@ done: H5S_class_t H5S_get_simple_extent_type(const H5S_t *space) { - H5S_class_t ret_value; + H5S_class_t ret_value = H5S_NO_CLASS; /* Return value */ FUNC_ENTER_NOAPI(H5S_NO_CLASS) @@ -1903,7 +1948,7 @@ done: hbool_t H5S_has_extent(const H5S_t *ds) { - hbool_t ret_value; + hbool_t ret_value = FALSE; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_NOERR diff --git a/src/H5SL.c b/src/H5SL.c index d766066..1cd64ec 100644 --- a/src/H5SL.c +++ b/src/H5SL.c @@ -59,16 +59,15 @@ * */ -/* Interface initialization */ -#define H5_INTERFACE_INIT_FUNC H5SL_init_interface +#include "H5SLmodule.h" /* This source code file is part of the H5SL module */ /* Private headers needed */ #include "H5private.h" /* Generic Functions */ #include "H5Eprivate.h" /* Error handling */ #include "H5FLprivate.h" /* Free Lists */ +#include "H5MMprivate.h" /* Memory management */ #include "H5SLprivate.h" /* Skip list routines */ -#include "H5MMprivate.h" /* Memory management */ /* Local Macros */ @@ -576,6 +575,9 @@ static H5SL_node_t *H5SL_insert_common(H5SL_t *slist, void *item, const void *ke static herr_t H5SL_release_common(H5SL_t *slist, H5SL_operator_t op, void *op_data); static herr_t H5SL_close_common(H5SL_t *slist, H5SL_operator_t op, void *op_data); +/* Package initialization variable */ +hbool_t H5_PKG_INIT_VAR = FALSE; + /* Declare a free list to manage the H5SL_t struct */ H5FL_DEFINE_STATIC(H5SL_t); @@ -590,12 +592,11 @@ static size_t H5SL_fac_nalloc_g; /*-------------------------------------------------------------------------- NAME - H5SL_init_interface + H5SL__init_package PURPOSE Initialize interface-specific information USAGE - herr_t H5SL_init_interface() - + herr_t H5SL__init_package() RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -605,10 +606,10 @@ static size_t H5SL_fac_nalloc_g; EXAMPLES REVISION LOG --------------------------------------------------------------------------*/ -static herr_t -H5SL_init_interface(void) +herr_t +H5SL__init_package(void) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_PACKAGE_NOERR /* Allocate space for array of factories */ H5SL_fac_g = (H5FL_fac_head_t **)H5MM_malloc(sizeof(H5FL_fac_head_t *)); @@ -621,7 +622,64 @@ H5SL_init_interface(void) H5SL_fac_nused_g = 1; FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5SL_init_interface() */ +} /* end H5SL__init_package() */ + + +/*-------------------------------------------------------------------------- + NAME + H5SL_term_package + PURPOSE + Terminate all the H5FL factories used in this package, and clear memory + USAGE + int H5SL_term_package() + RETURNS + Success: Positive if any action might have caused a change in some + other interface; zero otherwise. + Failure: Negative + DESCRIPTION + Release any resources allocated. + GLOBAL VARIABLES + COMMENTS, BUGS, ASSUMPTIONS + Can't report errors... + EXAMPLES + REVISION LOG +--------------------------------------------------------------------------*/ +int H5SL_term_package(void) +{ + int n = 0; + + FUNC_ENTER_NOAPI_NOINIT_NOERR + + if(H5_PKG_INIT_VAR) { + /* Terminate all the factories */ + if(H5SL_fac_nused_g > 0) { + size_t i; + herr_t ret; + + for(i = 0; i < H5SL_fac_nused_g; i++) { + ret = H5FL_fac_term(H5SL_fac_g[i]); + HDassert(ret >= 0); + } /* end if */ + H5SL_fac_nused_g = 0; + + n++; + } /* end if */ + + /* Free the list of factories */ + if(H5SL_fac_g) { + H5SL_fac_g = (H5FL_fac_head_t **)H5MM_xfree((void *)H5SL_fac_g); + H5SL_fac_nalloc_g = 0; + + n++; + } /* end if */ + + /* Mark the interface as uninitialized */ + if(0 == n) + H5_PKG_INIT_VAR = FALSE; + } /* end if */ + + FUNC_LEAVE_NOAPI(n) +} /* H5SL_term_package() */ /*-------------------------------------------------------------------------- @@ -649,7 +707,7 @@ H5SL_init_interface(void) static H5SL_node_t * H5SL_new_node(void *item, const void *key, uint32_t hashval) { - H5SL_node_t *ret_value; /* New skip list node */ + H5SL_node_t *ret_value = NULL; /* New skip list node */ FUNC_ENTER_NOAPI_NOINIT @@ -938,7 +996,7 @@ H5SL_create(H5SL_type_t type, H5SL_cmp_t cmp) { H5SL_t *new_slist = NULL; /* Pointer to new skip list object created */ H5SL_node_t *header; /* Pointer to skip list header node */ - H5SL_t *ret_value; /* Return value */ + H5SL_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI(NULL) @@ -1097,7 +1155,7 @@ done: H5SL_node_t * H5SL_add(H5SL_t *slist, void *item, const void *key) { - H5SL_node_t *ret_value; /* Return value */ + H5SL_node_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -1425,9 +1483,9 @@ done: void * H5SL_less(H5SL_t *slist, const void *key) { - H5SL_node_t *x; /* Current node to examine */ - uint32_t hashval = 0; /* Hash value for key */ - void *ret_value; /* Return value */ + H5SL_node_t *x; /* Current node to examine */ + uint32_t hashval = 0; /* Hash value for key */ + void *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -1534,9 +1592,9 @@ done: void * H5SL_greater(H5SL_t *slist, const void *key) { - H5SL_node_t *x; /* Current node to examine */ - uint32_t hashval = 0; /* Hash value for key */ - void *ret_value; /* Return value */ + H5SL_node_t *x; /* Current node to examine */ + uint32_t hashval = 0; /* Hash value for key */ + void *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -1726,9 +1784,9 @@ done: H5SL_node_t * H5SL_below(H5SL_t *slist, const void *key) { - H5SL_node_t *x; /* Current node to examine */ - uint32_t hashval = 0; /* Hash value for key */ - H5SL_node_t *ret_value; /* Return value */ + H5SL_node_t *x; /* Current node to examine */ + uint32_t hashval = 0; /* Hash value for key */ + H5SL_node_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -1832,9 +1890,9 @@ done: H5SL_node_t * H5SL_above(H5SL_t *slist, const void *key) { - H5SL_node_t *x; /* Current node to examine */ - uint32_t hashval = 0; /* Hash value for key */ - H5SL_node_t *ret_value; /* Return value */ + H5SL_node_t *x; /* Current node to examine */ + uint32_t hashval = 0; /* Hash value for key */ + H5SL_node_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -2509,50 +2567,3 @@ H5SL_close(H5SL_t *slist) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5SL_close() */ - -/*-------------------------------------------------------------------------- - NAME - H5SL_term_interface - PURPOSE - Terminate all the H5FL factories used in this package, and clear memory - USAGE - int H5SL_term_interface() - RETURNS - Success: Positive if any action might have caused a change in some - other interface; zero otherwise. - Failure: Negative - DESCRIPTION - Release any resources allocated. - GLOBAL VARIABLES - COMMENTS, BUGS, ASSUMPTIONS - Can't report errors... - EXAMPLES - REVISION LOG ---------------------------------------------------------------------------*/ -int H5SL_term_interface(void) -{ - size_t i; - herr_t ret; - int n = H5_interface_initialize_g ? 1 : 0; - - FUNC_ENTER_NOAPI_NOINIT_NOERR - - if(n) { - /* Terminate all the factories */ - for(i=0; i= 0); - } - H5SL_fac_nused_g = 0; - - /* Free the list of factories */ - H5SL_fac_g = (H5FL_fac_head_t **)H5MM_xfree((void *)H5SL_fac_g); - H5SL_fac_nalloc_g = 0; - - /* Mark the interface as uninitialized */ - H5_interface_initialize_g = 0; - } /* end if */ - - FUNC_LEAVE_NOAPI(n) -} /* H5SL_term_interface() */ - diff --git a/src/H5SLmodule.h b/src/H5SLmodule.h new file mode 100644 index 0000000..d5bfbc2 --- /dev/null +++ b/src/H5SLmodule.h @@ -0,0 +1,35 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* + * Programmer: Quincey Koziol + * Saturday, September 12, 2015 + * + * Purpose: This file contains declarations which define macros for the + * H5SL package. Including this header means that the source file + * is part of the H5SL package. + */ +#ifndef _H5SLmodule_H +#define _H5SLmodule_H + +/* Define the proper control macros for the generic FUNC_ENTER/LEAVE and error + * reporting macros. + */ +#define H5SL_MODULE +#define H5_MY_PKG H5SL +#define H5_MY_PKG_ERR H5E_SLIST +#define H5_MY_PKG_INIT YES + +#endif /* _H5SLmodule_H */ + diff --git a/src/H5SM.c b/src/H5SM.c index 0ed4fbf..e25d780 100644 --- a/src/H5SM.c +++ b/src/H5SM.c @@ -17,8 +17,9 @@ /* Module Setup */ /****************/ -#define H5O_PACKAGE /*suppress error about including H5Opkg */ -#define H5SM_PACKAGE /*suppress error about including H5SMpkg */ +#define H5O_FRIEND /*suppress error about including H5Opkg */ +#include "H5SMmodule.h" /* This source code file is part of the H5SM module */ + /***********/ /* Headers */ @@ -84,6 +85,9 @@ static herr_t H5SM_read_mesg(H5F_t *f, const H5SM_sohm_t *mesg, H5HF_t *fheap, /* Package Variables */ /*********************/ +/* Package initialization variable */ +hbool_t H5_PKG_INIT_VAR = FALSE; + H5FL_DEFINE(H5SM_master_table_t); H5FL_ARR_DEFINE(H5SM_index_header_t, H5O_SHMESG_MAX_NINDEXES); H5FL_DEFINE(H5SM_list_t); @@ -642,7 +646,7 @@ H5SM_create_list(H5F_t *f, H5SM_index_header_t *header, hid_t dxpl_id) hsize_t x; /* Counter variable */ size_t num_entries; /* Number of messages to create in list */ haddr_t addr = HADDR_UNDEF; /* Address of the list on disk */ - haddr_t ret_value; + haddr_t ret_value = HADDR_UNDEF; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_TAG(dxpl_id, H5AC__SOHM_TAG, HADDR_UNDEF) @@ -885,7 +889,7 @@ done: static htri_t H5SM_can_share_common(const H5F_t *f, unsigned type_id, const void *mesg) { - htri_t ret_value; /* Return value */ + htri_t ret_value = FAIL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -1617,8 +1621,8 @@ done: static size_t H5SM_find_in_list(const H5SM_list_t *list, const H5SM_mesg_key_t *key, size_t *empty_pos) { - size_t x; - size_t ret_value; + size_t x; + size_t ret_value = 0; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_NOERR diff --git a/src/H5SMbtree2.c b/src/H5SMbtree2.c index 7706cbd..e24dbb7 100644 --- a/src/H5SMbtree2.c +++ b/src/H5SMbtree2.c @@ -17,8 +17,8 @@ /* Module Setup */ /****************/ -#define H5O_PACKAGE /*suppress error about including H5Opkg */ -#define H5SM_PACKAGE /*suppress error about including H5SMpkg */ +#define H5O_FRIEND /*suppress error about including H5Opkg */ +#include "H5SMmodule.h" /* This source code file is part of the H5SM module */ /***********/ @@ -97,7 +97,7 @@ H5SM_bt2_crt_context(void *_f) { H5F_t *f = (H5F_t *)_f; /* User data for building callback context */ H5SM_bt2_ctx_t *ctx; /* Callback context structure */ - void *ret_value; /* Return value */ + void *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT diff --git a/src/H5SMcache.c b/src/H5SMcache.c index 293088c..1bdd95a 100644 --- a/src/H5SMcache.c +++ b/src/H5SMcache.c @@ -28,7 +28,7 @@ /* Module Setup */ /****************/ -#define H5SM_PACKAGE /*suppress error about including H5SMpkg */ +#include "H5SMmodule.h" /* This source code file is part of the H5SM module */ /***********/ @@ -186,7 +186,7 @@ H5SM__cache_table_deserialize(const void *_image, size_t len, void *_udata, uint32_t stored_chksum; /* Stored metadata checksum value */ uint32_t computed_chksum; /* Computed metadata checksum value */ size_t u; /* Counter variable for index headers */ - void * ret_value; /* Return value */ + void *ret_value = NULL; /* Return value */ FUNC_ENTER_STATIC @@ -510,7 +510,7 @@ H5SM__cache_list_deserialize(const void *_image, size_t len, void *_udata, uint32_t stored_chksum; /* Stored metadata checksum value */ uint32_t computed_chksum; /* Computed metadata checksum value */ size_t u; /* Counter variable for messages in list */ - void * ret_value; /* Return value */ + void *ret_value = NULL; /* Return value */ FUNC_ENTER_STATIC diff --git a/src/H5SMmessage.c b/src/H5SMmessage.c index d2dff47..5dbe5cf 100644 --- a/src/H5SMmessage.c +++ b/src/H5SMmessage.c @@ -17,8 +17,8 @@ /* Module Setup */ /****************/ -#define H5O_PACKAGE /*suppress error about including H5Opkg */ -#define H5SM_PACKAGE /*suppress error about including H5SMpkg */ +#define H5O_FRIEND /*suppress error about including H5Opkg */ +#include "H5SMmodule.h" /* This source code file is part of the H5SM module */ /***********/ diff --git a/src/H5SMmodule.h b/src/H5SMmodule.h new file mode 100644 index 0000000..b6991b6 --- /dev/null +++ b/src/H5SMmodule.h @@ -0,0 +1,35 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* + * Programmer: Quincey Koziol + * Saturday, September 12, 2015 + * + * Purpose: This file contains declarations which define macros for the + * H5SM package. Including this header means that the source file + * is part of the H5SM package. + */ +#ifndef _H5SMmodule_H +#define _H5SMmodule_H + +/* Define the proper control macros for the generic FUNC_ENTER/LEAVE and error + * reporting macros. + */ +#define H5SM_MODULE +#define H5_MY_PKG H5SM +#define H5_MY_PKG_ERR H5E_SOHM +#define H5_MY_PKG_INIT NO + +#endif /* _H5SMmodule_H */ + diff --git a/src/H5SMpkg.h b/src/H5SMpkg.h index 68dc484..ac2ba1b 100644 --- a/src/H5SMpkg.h +++ b/src/H5SMpkg.h @@ -21,7 +21,7 @@ * the H5SM shared object header messages package. Source files * outside the H5SM package should include H5SMprivate.h instead. */ -#ifndef H5SM_PACKAGE +#if !(defined H5SM_FRIEND || defined H5SM_MODULE) #error "Do not include this file outside the H5SM package!" #endif diff --git a/src/H5SMtest.c b/src/H5SMtest.c index c4e02bc..798203d 100644 --- a/src/H5SMtest.c +++ b/src/H5SMtest.c @@ -17,7 +17,7 @@ /* Module Setup */ /****************/ -#define H5SM_PACKAGE /*suppress error about including H5SMpkg */ +#include "H5SMmodule.h" /* This source code file is part of the H5SM module */ #define H5SM_TESTING /*suppress warning about H5SM testing funcs*/ diff --git a/src/H5Sall.c b/src/H5Sall.c index 7eab8b3..c373fd1 100644 --- a/src/H5Sall.c +++ b/src/H5Sall.c @@ -20,7 +20,7 @@ * Purpose: "All" selection data space I/O functions. */ -#define H5S_PACKAGE /*suppress error about including H5Spkg */ +#include "H5Smodule.h" /* This source code file is part of the H5S module */ #include "H5private.h" /* Generic Functions */ diff --git a/src/H5Sdbg.c b/src/H5Sdbg.c index 0cbe4f2..b69604c 100644 --- a/src/H5Sdbg.c +++ b/src/H5Sdbg.c @@ -28,7 +28,7 @@ /* Module Setup */ /****************/ -#define H5S_PACKAGE /*suppress error about including H5Spkg */ +#include "H5Smodule.h" /* This source code file is part of the H5S module */ /***********/ diff --git a/src/H5Shyper.c b/src/H5Shyper.c index a2eb804..12e23fa 100644 --- a/src/H5Shyper.c +++ b/src/H5Shyper.c @@ -20,7 +20,7 @@ * Purpose: Hyperslab selection data space I/O functions. */ -#define H5S_PACKAGE /*suppress error about including H5Spkg */ +#include "H5Smodule.h" /* This source code file is part of the H5S module */ #include "H5private.h" /* Generic Functions */ @@ -1093,7 +1093,7 @@ H5S_hyper_iter_release (H5S_sel_iter_t *iter) static H5S_hyper_span_t * H5S_hyper_new_span(hsize_t low, hsize_t high, H5S_hyper_span_info_t *down, H5S_hyper_span_t *next) { - H5S_hyper_span_t *ret_value; + H5S_hyper_span_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -1288,7 +1288,7 @@ H5S_hyper_copy_span_helper (H5S_hyper_span_info_t *spans) H5S_hyper_span_t *new_span; /* Temporary hyperslab span */ H5S_hyper_span_t *prev_span; /* Previous hyperslab span */ H5S_hyper_span_info_t *new_down; /* New down span tree */ - H5S_hyper_span_info_t *ret_value; + H5S_hyper_span_info_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -1374,7 +1374,7 @@ done: static H5S_hyper_span_info_t * H5S_hyper_copy_span(H5S_hyper_span_info_t *spans) { - H5S_hyper_span_info_t *ret_value; + H5S_hyper_span_info_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -1753,9 +1753,9 @@ static htri_t H5S_hyper_is_valid (const H5S_t *space) { unsigned u; /* Counter */ - htri_t ret_value=TRUE; /* return value */ + htri_t ret_value = TRUE; /* return value */ - FUNC_ENTER_NOAPI_NOERR + FUNC_ENTER_NOAPI(FAIL) HDassert(space); @@ -1858,7 +1858,7 @@ H5S_hyper_span_nblocks(H5S_hyper_span_info_t *spans) static hsize_t H5S_get_select_hyper_nblocks(H5S_t *space) { - hsize_t ret_value; /* return value */ + hsize_t ret_value = 0; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -1940,9 +1940,9 @@ done: static hssize_t H5S_hyper_serial_size(const H5S_t *space) { - unsigned u; /* Counter */ hsize_t block_count; /* block counter for regular hyperslabs */ - hssize_t ret_value; /* return value */ + unsigned u; /* Counter */ + hssize_t ret_value = -1; /* return value */ FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -2890,7 +2890,7 @@ H5S_hyper_is_contiguous(const H5S_t *space) unsigned u; /* index variable */ htri_t ret_value = FALSE; /* Return value */ - FUNC_ENTER_NOAPI_NOERR + FUNC_ENTER_NOAPI(FAIL) HDassert(space); @@ -3045,6 +3045,7 @@ H5S_hyper_is_contiguous(const H5S_t *space) ret_value=TRUE; } /* end else */ +done: FUNC_LEAVE_NOAPI(ret_value) } /* H5S_hyper_is_contiguous() */ @@ -3075,7 +3076,7 @@ H5S_hyper_is_single(const H5S_t *space) unsigned u; /* index variable */ htri_t ret_value=TRUE; /* return value */ - FUNC_ENTER_NOAPI_NOERR + FUNC_ENTER_NOAPI(FAIL) HDassert(space); @@ -3140,7 +3141,7 @@ done: static htri_t H5S_hyper_is_regular(const H5S_t *space) { - htri_t ret_value; /* return value */ + htri_t ret_value = FAIL; /* return value */ FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -5259,7 +5260,7 @@ H5S_hyper_merge_spans_helper (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_inf H5S_hyper_span_t *span_b; /* Pointer to current span 'b' working on */ H5S_hyper_span_t *prev_span_merge; /* Pointer to previous merged span */ unsigned recover_a, recover_b; /* Flags to indicate when to recover temporary spans */ - H5S_hyper_span_info_t *ret_value; + H5S_hyper_span_info_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -5627,7 +5628,7 @@ static hsize_t H5S_hyper_spans_nelem (H5S_hyper_span_info_t *spans) { H5S_hyper_span_t *span; /* Hyperslab span */ - hsize_t ret_value; + hsize_t ret_value = 0; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -5689,7 +5690,7 @@ H5S_hyper_make_spans(unsigned rank, const hsize_t *start, const hsize_t *stride, hsize_t stride_iter; /* Iterator over the stride values */ int i; /* Counters */ unsigned u; /* Counters */ - H5S_hyper_span_info_t *ret_value; /* Return value */ + H5S_hyper_span_info_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -8720,7 +8721,7 @@ H5S_hyper_get_seq_list(const H5S_t *space, unsigned H5_ATTR_UNUSED flags, H5S_se size_t maxseq, size_t maxelem, size_t *nseq, size_t *nelem, hsize_t *off, size_t *len) { - herr_t ret_value; /* return value */ + herr_t ret_value = FAIL; /* return value */ FUNC_ENTER_NOAPI_NOINIT_NOERR diff --git a/src/H5Smodule.h b/src/H5Smodule.h new file mode 100644 index 0000000..d4d94f2 --- /dev/null +++ b/src/H5Smodule.h @@ -0,0 +1,35 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* + * Programmer: Quincey Koziol + * Saturday, September 12, 2015 + * + * Purpose: This file contains declarations which define macros for the + * H5S package. Including this header means that the source file + * is part of the H5S package. + */ +#ifndef _H5Smodule_H +#define _H5Smodule_H + +/* Define the proper control macros for the generic FUNC_ENTER/LEAVE and error + * reporting macros. + */ +#define H5S_MODULE +#define H5_MY_PKG H5S +#define H5_MY_PKG_ERR H5E_DATASPACE +#define H5_MY_PKG_INIT YES + +#endif /* _H5Smodule_H */ + diff --git a/src/H5Smpio.c b/src/H5Smpio.c index c2190b4..1f97bc8 100644 --- a/src/H5Smpio.c +++ b/src/H5Smpio.c @@ -22,7 +22,7 @@ * I didn't make them portable. */ -#define H5S_PACKAGE /*suppress error about including H5Spkg */ +#include "H5Smodule.h" /* This source code file is part of the H5S module */ #include "H5private.h" /* Generic Functions */ diff --git a/src/H5Snone.c b/src/H5Snone.c index a67880e..6a4474d 100644 --- a/src/H5Snone.c +++ b/src/H5Snone.c @@ -20,7 +20,7 @@ * Purpose: "None" selection data space I/O functions. */ -#define H5S_PACKAGE /*suppress error about including H5Spkg */ +#include "H5Smodule.h" /* This source code file is part of the H5S module */ #include "H5private.h" diff --git a/src/H5Spkg.h b/src/H5Spkg.h index 5f84717..8213919 100644 --- a/src/H5Spkg.h +++ b/src/H5Spkg.h @@ -21,7 +21,7 @@ * the H5S package. Source files outside the H5S package should * include H5Sprivate.h instead. */ -#ifndef H5S_PACKAGE +#if !(defined H5S_FRIEND || defined H5S_MODULE) #error "Do not include this file outside the H5S package!" #endif diff --git a/src/H5Spoint.c b/src/H5Spoint.c index 20a60bb..d225ab2 100644 --- a/src/H5Spoint.c +++ b/src/H5Spoint.c @@ -20,7 +20,7 @@ * Purpose: Point selection data space I/O functions. */ -#define H5S_PACKAGE /*suppress error about including H5Spkg */ +#include "H5Smodule.h" /* This source code file is part of the H5S module */ #include "H5private.h" /* Generic Functions */ @@ -774,7 +774,7 @@ static hssize_t H5S_point_serial_size (const H5S_t *space) { H5S_pnt_node_t *curr; /* Point information nodes */ - hssize_t ret_value; /* return value */ + hssize_t ret_value = -1; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -1208,7 +1208,7 @@ done: static htri_t H5S_point_is_contiguous(const H5S_t *space) { - htri_t ret_value; /* return value */ + htri_t ret_value = FAIL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -1245,7 +1245,7 @@ H5S_point_is_contiguous(const H5S_t *space) static htri_t H5S_point_is_single(const H5S_t *space) { - htri_t ret_value; /* return value */ + htri_t ret_value = FAIL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -1285,7 +1285,7 @@ H5S_point_is_single(const H5S_t *space) static htri_t H5S_point_is_regular(const H5S_t *space) { - htri_t ret_value; /* return value */ + htri_t ret_value = FAIL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_NOERR diff --git a/src/H5Sprivate.h b/src/H5Sprivate.h index 7b7b8c6..54c70f0 100644 --- a/src/H5Sprivate.h +++ b/src/H5Sprivate.h @@ -116,7 +116,7 @@ typedef struct H5S_sel_iter_t { } H5S_sel_iter_t; /* If the module using this macro is allowed access to the private variables, access them directly */ -#ifdef H5S_PACKAGE +#ifdef H5S_MODULE #define H5S_GET_EXTENT_TYPE(S) ((S)->extent.type) #define H5S_GET_EXTENT_NDIMS(S) ((S)->extent.rank) #define H5S_GET_EXTENT_NPOINTS(S) ((S)->extent.nelem) @@ -142,7 +142,7 @@ typedef struct H5S_sel_iter_t { #define H5S_SELECT_ITER_NEXT(ITER,NELEM)((*(ITER)->type->iter_next)(ITER,NELEM)) #define H5S_SELECT_ITER_NEXT_BLOCK(ITER) ((*(ITER)->type->iter_next_block)(ITER)) #define H5S_SELECT_ITER_RELEASE(ITER) ((*(ITER)->type->iter_release)(ITER)) -#else /* H5S_PACKAGE */ +#else /* H5S_MODULE */ #define H5S_GET_EXTENT_TYPE(S) (H5S_get_simple_extent_type(S)) #define H5S_GET_EXTENT_NDIMS(S) (H5S_get_simple_extent_ndims(S)) #define H5S_GET_EXTENT_NPOINTS(S) (H5S_get_simple_extent_npoints(S)) @@ -168,7 +168,7 @@ typedef struct H5S_sel_iter_t { #define H5S_SELECT_ITER_NEXT(ITER,NELEM)(H5S_select_iter_next(ITER,NELEM)) #define H5S_SELECT_ITER_NEXT_BLOCK(ITER) (H5S_select_iter_next_block(ITER)) #define H5S_SELECT_ITER_RELEASE(ITER) (H5S_select_iter_release(ITER)) -#endif /* H5S_PACKAGE */ +#endif /* H5S_MODULE */ /* Handle these two callbacks in a special way, since they have prologs that need to be executed */ #define H5S_SELECT_COPY(DST,SRC,SHARE) (H5S_select_copy(DST,SRC,SHARE)) #define H5S_SELECT_DESERIALIZE(S,BUF) (H5S_select_deserialize(S,BUF)) diff --git a/src/H5Sselect.c b/src/H5Sselect.c index e04ae16..3f0bc4f 100644 --- a/src/H5Sselect.c +++ b/src/H5Sselect.c @@ -19,7 +19,7 @@ * Purpose: Dataspace selection functions. */ -#define H5S_PACKAGE /*suppress error about including H5Spkg */ +#include "H5Smodule.h" /* This source code file is part of the H5S module */ #include "H5private.h" /* Generic Functions */ @@ -107,7 +107,7 @@ H5S_select_offset(H5S_t *space, const hssize_t *offset) herr_t H5S_select_copy (H5S_t *dst, const H5S_t *src, hbool_t share_selection) { - herr_t ret_value; /* return value */ + herr_t ret_value = FAIL; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -148,7 +148,7 @@ done: herr_t H5S_select_release(H5S_t *ds) { - herr_t ret_value; /* Return value */ + herr_t ret_value = FAIL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -185,7 +185,7 @@ H5S_select_get_seq_list(const H5S_t *space, unsigned flags, H5S_sel_iter_t *iter, size_t maxseq, size_t maxbytes, size_t *nseq, size_t *nbytes, hsize_t *off, size_t *len) { - herr_t ret_value; /* Return value */ + herr_t ret_value = FAIL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -220,7 +220,7 @@ H5S_select_get_seq_list(const H5S_t *space, unsigned flags, hssize_t H5S_select_serial_size(const H5S_t *space) { - hssize_t ret_value; /* Return value */ + hssize_t ret_value = -1; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -411,7 +411,7 @@ done: htri_t H5S_select_valid(const H5S_t *space) { - htri_t ret_value; /* Return value */ + htri_t ret_value = FAIL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -452,10 +452,10 @@ H5S_select_valid(const H5S_t *space) herr_t H5S_select_deserialize (H5S_t **space, const uint8_t **p) { - H5S_t *tmp_space; /* Pointer to actual dataspace to use, either - *space or a newly allocated one */ - uint32_t sel_type; /* Pointer to the selection type */ - herr_t ret_value=FAIL; /* return value */ + H5S_t *tmp_space = NULL; /* Pointer to actual dataspace to use, either + *space or a newly allocated one */ + uint32_t sel_type; /* Pointer to the selection type */ + herr_t ret_value = FAIL; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -611,7 +611,7 @@ done: herr_t H5S_get_select_bounds(const H5S_t *space, hsize_t *start, hsize_t *end) { - herr_t ret_value; /* return value */ + herr_t ret_value = FAIL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -652,7 +652,7 @@ H5S_get_select_bounds(const H5S_t *space, hsize_t *start, hsize_t *end) herr_t H5S_get_select_offset(const H5S_t *space, hsize_t *offset) { - herr_t ret_value; /* return value */ + herr_t ret_value = FAIL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -690,7 +690,7 @@ H5S_get_select_offset(const H5S_t *space, hsize_t *offset) htri_t H5S_select_is_contiguous(const H5S_t *space) { - herr_t ret_value; /* return value */ + herr_t ret_value = FAIL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -727,7 +727,7 @@ H5S_select_is_contiguous(const H5S_t *space) htri_t H5S_select_is_single(const H5S_t *space) { - herr_t ret_value; /* return value */ + herr_t ret_value = FAIL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -764,7 +764,7 @@ H5S_select_is_single(const H5S_t *space) htri_t H5S_select_is_regular(const H5S_t *space) { - herr_t ret_value; /* return value */ + herr_t ret_value = FAIL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -801,7 +801,7 @@ H5S_select_is_regular(const H5S_t *space) herr_t H5S_select_adjust_u(H5S_t *space, const hsize_t *offset) { - herr_t ret_value; /* return value */ + herr_t ret_value = FAIL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -839,7 +839,7 @@ H5S_select_adjust_u(H5S_t *space, const hsize_t *offset) herr_t H5S_select_project_scalar(const H5S_t *space, hsize_t *offset) { - herr_t ret_value; /* Return value */ + herr_t ret_value = FAIL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -879,7 +879,7 @@ H5S_select_project_scalar(const H5S_t *space, hsize_t *offset) herr_t H5S_select_project_simple(const H5S_t *space, H5S_t *new_space, hsize_t *offset) { - herr_t ret_value; /* Return value */ + herr_t ret_value = FAIL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -914,7 +914,7 @@ H5S_select_project_simple(const H5S_t *space, H5S_t *new_space, hsize_t *offset) herr_t H5S_select_iter_init(H5S_sel_iter_t *sel_iter, const H5S_t *space, size_t elmt_size) { - herr_t ret_value; /* Return value */ + herr_t ret_value = FAIL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -969,7 +969,7 @@ H5S_select_iter_init(H5S_sel_iter_t *sel_iter, const H5S_t *space, size_t elmt_s herr_t H5S_select_iter_coords(const H5S_sel_iter_t *sel_iter, hsize_t *coords) { - herr_t ret_value; /* return value */ + herr_t ret_value = FAIL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -1051,7 +1051,7 @@ H5S_select_iter_block(const H5S_sel_iter_t *iter, hsize_t *start, hsize_t *end) hsize_t H5S_select_iter_nelmts(const H5S_sel_iter_t *sel_iter) { - hsize_t ret_value; /* return value */ + hsize_t ret_value = 0; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -1130,7 +1130,7 @@ H5S_select_iter_has_next_block(const H5S_sel_iter_t *iter) herr_t H5S_select_iter_next(H5S_sel_iter_t *iter, size_t nelem) { - herr_t ret_value; /* return value */ + herr_t ret_value = FAIL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -1213,7 +1213,7 @@ H5S_select_iter_next_block(H5S_sel_iter_t *iter) herr_t H5S_select_iter_release(H5S_sel_iter_t *sel_iter) { - herr_t ret_value; /* return value */ + herr_t ret_value = FAIL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -1430,7 +1430,7 @@ done: H5S_sel_type H5S_get_select_type(const H5S_t *space) { - H5S_sel_type ret_value; /* Return value */ + H5S_sel_type ret_value = H5S_SEL_ERROR; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_NOERR diff --git a/src/H5Stest.c b/src/H5Stest.c index 62a4179..e1f4b61 100644 --- a/src/H5Stest.c +++ b/src/H5Stest.c @@ -19,7 +19,7 @@ * Purpose: Dataspace selection testing functions. */ -#define H5S_PACKAGE /*suppress error about including H5Spkg */ +#include "H5Smodule.h" /* This source code file is part of the H5S module */ #define H5S_TESTING /*suppress warning about H5S testing funcs*/ @@ -54,7 +54,7 @@ H5S_select_shape_same_test(hid_t sid1, hid_t sid2) { H5S_t *space1; /* Pointer to 1st dataspace */ H5S_t *space2; /* Pointer to 2nd dataspace */ - htri_t ret_value; /* Return value */ + htri_t ret_value = FAIL; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -95,7 +95,7 @@ htri_t H5S_get_rebuild_status_test(hid_t space_id) { H5S_t *space; /* Pointer to 1st dataspace */ - htri_t ret_value; /* Return value */ + htri_t ret_value = FAIL; /* Return value */ FUNC_ENTER_NOAPI(FAIL) diff --git a/src/H5T.c b/src/H5T.c index 5f6c8e3..e1051f2 100644 --- a/src/H5T.c +++ b/src/H5T.c @@ -1,4 +1,3 @@ - /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * * Copyright by the Board of Trustees of the University of Illinois. * @@ -25,10 +24,7 @@ /* Module Setup */ /****************/ -#define H5T_PACKAGE /*suppress error about including H5Tpkg */ - -/* Interface initialization */ -#define H5_INTERFACE_INIT_FUNC H5T_init_interface +#include "H5Tmodule.h" /* This source code file is part of the H5T module */ /***********/ @@ -304,12 +300,15 @@ H5T_order_t H5T_native_order_g = H5T_ORDER_ERROR; /* Package Variables */ /*********************/ +/* Package initialization variable */ +hbool_t H5_PKG_INIT_VAR = FALSE; + /* * Predefined data types. These are initialized at runtime in H5Tinit.c and - * by H5T_init_interface() in this source file. + * by H5T__init_package() in this source file. * * If more of these are added, the new ones must be added to the list of - * types to reset in H5T_term_interface(). + * types to reset in H5T_term_package(). */ hid_t H5T_IEEE_F32BE_g = FAIL; hid_t H5T_IEEE_F32LE_g = FAIL; @@ -529,6 +528,9 @@ static const H5I_class_t H5I_DATATYPE_CLS[1] = {{ (H5I_free_t)H5T_close /* Callback routine for closing objects of this class */ }}; +/* Flag indicating "top" of interface has been initialized */ +static hbool_t H5T_top_package_initialize_s = FALSE; + /*------------------------------------------------------------------------- @@ -537,48 +539,42 @@ static const H5I_class_t H5I_DATATYPE_CLS[1] = {{ * Purpose: Initialize the interface from some other package. * * Return: Success: non-negative - * * Failure: negative * * Programmer: Robb Matzke * Wednesday, December 16, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T_init(void) { - herr_t ret_value=SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) /* FUNC_ENTER() does all the work */ done: FUNC_LEAVE_NOAPI(ret_value) -} +} /* end H5T_init() */ /*------------------------------------------------------------------------- - * Function: H5T_init_inf + * Function: H5T__init_inf * * Purpose: Initialize the +/- Infinity floating-poing values for type * conversion. * * Return: Success: non-negative - * * Failure: negative * * Programmer: Quincey Koziol * Saturday, November 22, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t -H5T_init_inf(void) +H5T__init_inf(void) { H5T_t *dst_p; /* Datatype type operate on */ H5T_atomic_t *dst; /* Datatype's atomic info */ @@ -587,7 +583,7 @@ H5T_init_inf(void) size_t u; /* Local index value */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Get the float datatype */ if(NULL == (dst_p = (H5T_t *)H5I_object(H5T_NATIVE_FLOAT_g))) @@ -673,63 +669,22 @@ H5T_init_inf(void) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5T_init_inf() */ - - -/*------------------------------------------------------------------------- - * Function: H5T_init_hw - * - * Purpose: Perform hardware specific [floating-point] initialization - * - * Return: Success: non-negative - * Failure: negative - * - * Programmer: Quincey Koziol - * Monday, November 24, 2003 - * - *------------------------------------------------------------------------- - */ -static herr_t -H5T_init_hw(void) -{ -#ifdef H5_HAVE_GET_FPC_CSR - union fpc_csr csr; /* Union to hold results of floating-point status register query */ -#endif /* H5_HAVE_GET_FPC_CSR */ - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI_NOINIT_NOERR - -#ifdef H5_HAVE_GET_FPC_CSR - /* [This code is specific to SGI machines] */ - - /* Get the floating-point status register */ - csr.fc_word = get_fpc_csr(); - - /* If the "flush denormalized values to zero" flag is set, unset it */ - if(csr.fc_struct.flush) { - csr.fc_struct.flush = 0; - set_fpc_csr(csr.fc_word); - } /* end if */ -#endif /* H5_HAVE_GET_FPC_CSR */ - - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5T_init_hw() */ +} /* end H5T__init_inf() */ /*-------------------------------------------------------------------------- NAME - H5T_init_interface -- Initialize interface-specific information + H5T__init_package -- Initialize interface-specific information USAGE - herr_t H5T_init_interface() - + herr__t H5T_init_package() RETURNS Non-negative on success/Negative on failure DESCRIPTION Initializes any interface-specific data or routines. --------------------------------------------------------------------------*/ -static herr_t -H5T_init_interface(void) +herr_t +H5T__init_package(void) { H5T_t *native_schar=NULL; /* Datatype structure for native signed char */ H5T_t *native_uchar=NULL; /* Datatype structure for native unsigned char */ @@ -777,17 +732,13 @@ H5T_init_interface(void) /* Make certain there aren't too many classes of datatypes defined */ /* Only 16 (numbered 0-15) are supported in the current file format */ - HDassert(H5T_NCLASSES < 16); - - /* Perform any necessary hardware initializations */ - if(H5T_init_hw() < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to initialize interface") + HDcompile_assert(H5T_NCLASSES < 16); /* * Initialize pre-defined native datatypes from code generated during * the library configuration by H5detect. */ - if(H5TN_init_interface() < 0) + if(H5T__init_native() < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to initialize interface") /* Get the atomic datatype structures needed by the initialization code below */ @@ -1004,7 +955,7 @@ H5T_init_interface(void) /* One-byte character string */ H5T_INIT_TYPE(CSTRING, H5T_C_S1_g, ALLOC, -, SET, 1) - string=dt; /* Keep type for later */ + string = dt; /* Keep type for later */ /*------------------------------------------------------------ * The `Fortran' architecture @@ -1021,7 +972,7 @@ H5T_init_interface(void) /* Object reference (i.e. object header address in file) */ H5T_INIT_TYPE(OBJREF, H5T_STD_REF_OBJ_g, ALLOC, -, SET, H5R_OBJ_REF_BUF_SIZE) - objref=dt; /* Keep type for later */ + objref = dt; /* Keep type for later */ /* Dataset Region reference (i.e. selection inside a dataset) */ H5T_INIT_TYPE(REGREF, H5T_STD_REF_DSETREG_g, ALLOC, -, SET, H5R_DSET_REG_REF_BUF_SIZE) @@ -1294,13 +1245,13 @@ H5T_init_interface(void) status |= H5T_register(H5T_PERS_HARD, "no-op", native_int, native_int, H5T__conv_noop, H5AC_ind_dxpl_id, FALSE); /* Initialize the +/- Infinity values for floating-point types */ - status |= H5T_init_inf(); + status |= H5T__init_inf(); - if (status<0) + if(status < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to register conversion function(s)") /* Register datatype creation property class properties here. See similar - * code in H5D_init_interface(), etc. for example. + * code in H5D__init_package(), etc. for example. */ /* Only register the default property list if it hasn't been created yet */ @@ -1313,6 +1264,9 @@ H5T_init_interface(void) HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "can't insert property into class") } /* end if */ + /* Mark "top" of interface as initialized, too */ + H5T_top_package_initialize_s = TRUE; + done: /* General cleanup */ if(compound != NULL) @@ -1338,11 +1292,11 @@ done: } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5T_init_interface() */ +} /* end H5T__init_package() */ /*------------------------------------------------------------------------- - * Function: H5T_unlock_cb + * Function: H5T__unlock_cb * * Purpose: Clear the immutable flag for a datatype. This function is * called when the library is closing in order to unlock all @@ -1356,198 +1310,252 @@ done: *------------------------------------------------------------------------- */ static int -H5T_unlock_cb(void *_dt, hid_t H5_ATTR_UNUSED id, void H5_ATTR_UNUSED *key) +H5T__unlock_cb(void *_dt, hid_t H5_ATTR_UNUSED id, void *_udata) { H5T_t *dt = (H5T_t *)_dt; + int *n = (int *)_udata; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR + + HDassert(dt && dt->shared); - HDassert (dt && dt->shared); - if (H5T_STATE_IMMUTABLE==dt->shared->state) + if(H5T_STATE_IMMUTABLE==dt->shared->state) { dt->shared->state = H5T_STATE_RDONLY; + (*n)++; + } /* end if */ + FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5T_unlock_cb() */ +} /* end H5T__unlock_cb() */ /*------------------------------------------------------------------------- - * Function: H5T_term_interface + * Function: H5T_top_term_package * - * Purpose: Close this interface. + * Purpose: Close the "top" of the interface, releasing IDs, etc. * * Return: Success: Positive if any action might have caused a - * change in some other interface; zero - * otherwise. - * + * change in some other interface; zero otherwise. * Failure: Negative * - * Programmer: Robb Matzke - * Friday, November 20, 1998 + * Programmer: Quincey Koziol + * Thursday, September 10, 2015 * *------------------------------------------------------------------------- */ int -H5T_term_interface(void) +H5T_top_term_package(void) { int n = 0; FUNC_ENTER_NOAPI_NOINIT_NOERR - if(H5_interface_initialize_g) { - int i, nprint = 0; - + if(H5T_top_package_initialize_s) { /* Unregister all conversion functions */ - for(i = 0; i < H5T_g.npaths; i++) { - H5T_path_t *path; - - path = H5T_g.path[i]; - HDassert(path); - if(path->func) { - H5T__print_stats(path, &nprint/*in,out*/); - path->cdata.command = H5T_CONV_FREE; - if((path->func)((hid_t)FAIL, (hid_t)FAIL, &(path->cdata), (size_t)0, - (size_t)0, (size_t)0, NULL, NULL,H5AC_ind_dxpl_id) < 0) { + if(H5T_g.path) { + int i, nprint = 0; + + for(i = 0; i < H5T_g.npaths; i++) { + H5T_path_t *path; + + path = H5T_g.path[i]; + HDassert(path); + if(path->func) { + H5T__print_stats(path, &nprint/*in,out*/); + path->cdata.command = H5T_CONV_FREE; + if((path->func)((hid_t)FAIL, (hid_t)FAIL, &(path->cdata), (size_t)0, + (size_t)0, (size_t)0, NULL, NULL,H5AC_ind_dxpl_id) < 0) { #ifdef H5T_DEBUG - if (H5DEBUG(T)) { - fprintf(H5DEBUG(T), "H5T: conversion function " - "0x%08lx failed to free private data for " - "%s (ignored)\n", - (unsigned long)(path->func), path->name); - } /* end if */ + if (H5DEBUG(T)) { + fprintf(H5DEBUG(T), "H5T: conversion function " + "0x%08lx failed to free private data for " + "%s (ignored)\n", + (unsigned long)(path->func), path->name); + } /* end if */ #endif - H5E_clear_stack(NULL); /*ignore the error*/ - } /* end if */ - } /* end if */ + H5E_clear_stack(NULL); /*ignore the error*/ + } /* end if */ + } /* end if */ - if(path->src) - H5T_close(path->src); - if(path->dst) - H5T_close(path->dst); - path = H5FL_FREE(H5T_path_t, path); - H5T_g.path[i] = NULL; - } /* end for */ + if(path->src) + H5T_close(path->src); + if(path->dst) + H5T_close(path->dst); + path = H5FL_FREE(H5T_path_t, path); + H5T_g.path[i] = NULL; + } /* end for */ + + /* Clear conversion tables */ + H5T_g.path = (H5T_path_t **)H5MM_xfree(H5T_g.path); + H5T_g.npaths = 0; + H5T_g.apaths = 0; + H5T_g.soft = (H5T_soft_t *)H5MM_xfree(H5T_g.soft); + H5T_g.nsoft = 0; + H5T_g.asoft = 0; - /* Clear conversion tables */ - H5T_g.path = (H5T_path_t **)H5MM_xfree(H5T_g.path); - H5T_g.npaths = 0; - H5T_g.apaths = 0; - H5T_g.soft = (H5T_soft_t *)H5MM_xfree(H5T_g.soft); - H5T_g.nsoft = 0; - H5T_g.asoft = 0; + n++; + } /* end if */ /* Unlock all datatypes, then free them */ /* note that we are ignoring the return value from H5I_iterate() */ - H5I_iterate(H5I_DATATYPE, H5T_unlock_cb, NULL, FALSE); + /* Also note that we are incrementing 'n' in the callback */ + H5I_iterate(H5I_DATATYPE, H5T__unlock_cb, &n, FALSE); - /* Close deprecated interface */ - n += H5T__term_deprec_interface(); - - /* Destroy the datatype object id group */ - (void)H5I_dec_type_ref(H5I_DATATYPE); - n++; /*H5I*/ + /* Release all datatype IDs */ + if(H5I_nmembers(H5I_DATATYPE) > 0) { + (void)H5I_clear_type(H5I_DATATYPE, FALSE, FALSE); + n++; /*H5I*/ + } /* end if */ /* Reset all the datatype IDs */ - H5T_IEEE_F32BE_g = FAIL; - H5T_IEEE_F32LE_g = FAIL; - H5T_IEEE_F64BE_g = FAIL; - H5T_IEEE_F64LE_g = FAIL; - - H5T_STD_I8BE_g = FAIL; - H5T_STD_I8LE_g = FAIL; - H5T_STD_I16BE_g = FAIL; - H5T_STD_I16LE_g = FAIL; - H5T_STD_I32BE_g = FAIL; - H5T_STD_I32LE_g = FAIL; - H5T_STD_I64BE_g = FAIL; - H5T_STD_I64LE_g = FAIL; - H5T_STD_U8BE_g = FAIL; - H5T_STD_U8LE_g = FAIL; - H5T_STD_U16BE_g = FAIL; - H5T_STD_U16LE_g = FAIL; - H5T_STD_U32BE_g = FAIL; - H5T_STD_U32LE_g = FAIL; - H5T_STD_U64BE_g = FAIL; - H5T_STD_U64LE_g = FAIL; - H5T_STD_B8BE_g = FAIL; - H5T_STD_B8LE_g = FAIL; - H5T_STD_B16BE_g = FAIL; - H5T_STD_B16LE_g = FAIL; - H5T_STD_B32BE_g = FAIL; - H5T_STD_B32LE_g = FAIL; - H5T_STD_B64BE_g = FAIL; - H5T_STD_B64LE_g = FAIL; - H5T_STD_REF_OBJ_g = FAIL; - H5T_STD_REF_DSETREG_g = FAIL; - - H5T_UNIX_D32BE_g = FAIL; - H5T_UNIX_D32LE_g = FAIL; - H5T_UNIX_D64BE_g = FAIL; - H5T_UNIX_D64LE_g = FAIL; - - H5T_C_S1_g = FAIL; - - H5T_FORTRAN_S1_g = FAIL; - - H5T_NATIVE_SCHAR_g = FAIL; - H5T_NATIVE_UCHAR_g = FAIL; - H5T_NATIVE_SHORT_g = FAIL; - H5T_NATIVE_USHORT_g = FAIL; - H5T_NATIVE_INT_g = FAIL; - H5T_NATIVE_UINT_g = FAIL; - H5T_NATIVE_LONG_g = FAIL; - H5T_NATIVE_ULONG_g = FAIL; - H5T_NATIVE_LLONG_g = FAIL; - H5T_NATIVE_ULLONG_g = FAIL; - H5T_NATIVE_FLOAT_g = FAIL; - H5T_NATIVE_DOUBLE_g = FAIL; + if(H5T_IEEE_F32BE_g > 0) { + H5T_IEEE_F32BE_g = FAIL; + H5T_IEEE_F32LE_g = FAIL; + H5T_IEEE_F64BE_g = FAIL; + H5T_IEEE_F64LE_g = FAIL; + + H5T_STD_I8BE_g = FAIL; + H5T_STD_I8LE_g = FAIL; + H5T_STD_I16BE_g = FAIL; + H5T_STD_I16LE_g = FAIL; + H5T_STD_I32BE_g = FAIL; + H5T_STD_I32LE_g = FAIL; + H5T_STD_I64BE_g = FAIL; + H5T_STD_I64LE_g = FAIL; + H5T_STD_U8BE_g = FAIL; + H5T_STD_U8LE_g = FAIL; + H5T_STD_U16BE_g = FAIL; + H5T_STD_U16LE_g = FAIL; + H5T_STD_U32BE_g = FAIL; + H5T_STD_U32LE_g = FAIL; + H5T_STD_U64BE_g = FAIL; + H5T_STD_U64LE_g = FAIL; + H5T_STD_B8BE_g = FAIL; + H5T_STD_B8LE_g = FAIL; + H5T_STD_B16BE_g = FAIL; + H5T_STD_B16LE_g = FAIL; + H5T_STD_B32BE_g = FAIL; + H5T_STD_B32LE_g = FAIL; + H5T_STD_B64BE_g = FAIL; + H5T_STD_B64LE_g = FAIL; + H5T_STD_REF_OBJ_g = FAIL; + H5T_STD_REF_DSETREG_g = FAIL; + + H5T_UNIX_D32BE_g = FAIL; + H5T_UNIX_D32LE_g = FAIL; + H5T_UNIX_D64BE_g = FAIL; + H5T_UNIX_D64LE_g = FAIL; + + H5T_C_S1_g = FAIL; + + H5T_FORTRAN_S1_g = FAIL; + + H5T_NATIVE_SCHAR_g = FAIL; + H5T_NATIVE_UCHAR_g = FAIL; + H5T_NATIVE_SHORT_g = FAIL; + H5T_NATIVE_USHORT_g = FAIL; + H5T_NATIVE_INT_g = FAIL; + H5T_NATIVE_UINT_g = FAIL; + H5T_NATIVE_LONG_g = FAIL; + H5T_NATIVE_ULONG_g = FAIL; + H5T_NATIVE_LLONG_g = FAIL; + H5T_NATIVE_ULLONG_g = FAIL; + H5T_NATIVE_FLOAT_g = FAIL; + H5T_NATIVE_DOUBLE_g = FAIL; #if H5_SIZEOF_LONG_DOUBLE !=0 - H5T_NATIVE_LDOUBLE_g = FAIL; + H5T_NATIVE_LDOUBLE_g = FAIL; #endif - H5T_NATIVE_B8_g = FAIL; - H5T_NATIVE_B16_g = FAIL; - H5T_NATIVE_B32_g = FAIL; - H5T_NATIVE_B64_g = FAIL; - H5T_NATIVE_OPAQUE_g = FAIL; - H5T_NATIVE_HADDR_g = FAIL; - H5T_NATIVE_HSIZE_g = FAIL; - H5T_NATIVE_HSSIZE_g = FAIL; - H5T_NATIVE_HERR_g = FAIL; - H5T_NATIVE_HBOOL_g = FAIL; - - H5T_NATIVE_INT8_g = FAIL; - H5T_NATIVE_UINT8_g = FAIL; - H5T_NATIVE_INT_LEAST8_g = FAIL; - H5T_NATIVE_UINT_LEAST8_g = FAIL; - H5T_NATIVE_INT_FAST8_g = FAIL; - H5T_NATIVE_UINT_FAST8_g = FAIL; - - H5T_NATIVE_INT16_g = FAIL; - H5T_NATIVE_UINT16_g = FAIL; - H5T_NATIVE_INT_LEAST16_g = FAIL; - H5T_NATIVE_UINT_LEAST16_g = FAIL; - H5T_NATIVE_INT_FAST16_g = FAIL; - H5T_NATIVE_UINT_FAST16_g = FAIL; - - H5T_NATIVE_INT32_g = FAIL; - H5T_NATIVE_UINT32_g = FAIL; - H5T_NATIVE_INT_LEAST32_g = FAIL; - H5T_NATIVE_UINT_LEAST32_g = FAIL; - H5T_NATIVE_INT_FAST32_g = FAIL; - H5T_NATIVE_UINT_FAST32_g = FAIL; - - H5T_NATIVE_INT64_g = FAIL; - H5T_NATIVE_UINT64_g = FAIL; - H5T_NATIVE_INT_LEAST64_g = FAIL; - H5T_NATIVE_UINT_LEAST64_g = FAIL; - H5T_NATIVE_INT_FAST64_g = FAIL; - H5T_NATIVE_UINT_FAST64_g = FAIL; + H5T_NATIVE_B8_g = FAIL; + H5T_NATIVE_B16_g = FAIL; + H5T_NATIVE_B32_g = FAIL; + H5T_NATIVE_B64_g = FAIL; + H5T_NATIVE_OPAQUE_g = FAIL; + H5T_NATIVE_HADDR_g = FAIL; + H5T_NATIVE_HSIZE_g = FAIL; + H5T_NATIVE_HSSIZE_g = FAIL; + H5T_NATIVE_HERR_g = FAIL; + H5T_NATIVE_HBOOL_g = FAIL; + + H5T_NATIVE_INT8_g = FAIL; + H5T_NATIVE_UINT8_g = FAIL; + H5T_NATIVE_INT_LEAST8_g = FAIL; + H5T_NATIVE_UINT_LEAST8_g = FAIL; + H5T_NATIVE_INT_FAST8_g = FAIL; + H5T_NATIVE_UINT_FAST8_g = FAIL; + + H5T_NATIVE_INT16_g = FAIL; + H5T_NATIVE_UINT16_g = FAIL; + H5T_NATIVE_INT_LEAST16_g = FAIL; + H5T_NATIVE_UINT_LEAST16_g = FAIL; + H5T_NATIVE_INT_FAST16_g = FAIL; + H5T_NATIVE_UINT_FAST16_g = FAIL; + + H5T_NATIVE_INT32_g = FAIL; + H5T_NATIVE_UINT32_g = FAIL; + H5T_NATIVE_INT_LEAST32_g = FAIL; + H5T_NATIVE_UINT_LEAST32_g = FAIL; + H5T_NATIVE_INT_FAST32_g = FAIL; + H5T_NATIVE_UINT_FAST32_g = FAIL; + + H5T_NATIVE_INT64_g = FAIL; + H5T_NATIVE_UINT64_g = FAIL; + H5T_NATIVE_INT_LEAST64_g = FAIL; + H5T_NATIVE_UINT_LEAST64_g = FAIL; + H5T_NATIVE_INT_FAST64_g = FAIL; + H5T_NATIVE_UINT_FAST64_g = FAIL; + + n++; + } /* end if */ + + /* Mark "top" of interface as closed */ + if(0 == n) + H5T_top_package_initialize_s = FALSE; + } /* end if */ + + FUNC_LEAVE_NOAPI(n) +} /* end H5T_top_term_package() */ + + +/*------------------------------------------------------------------------- + * Function: H5T_term_package + * + * Purpose: Close this interface. + * + * Note: Finishes shutting down the interface, after + * H5T_top_term_package() is called + * + * Return: Success: Positive if any action might have caused a + * change in some other interface; zero + * otherwise. + * Failure: Negative + * + * Programmer: Robb Matzke + * Friday, November 20, 1998 + * + *------------------------------------------------------------------------- + */ +int +H5T_term_package(void) +{ + int n = 0; + + FUNC_ENTER_NOAPI_NOINIT_NOERR + + if(H5_PKG_INIT_VAR) { + /* Sanity check */ + HDassert(0 == H5I_nmembers(H5I_DATATYPE)); + HDassert(FALSE == H5T_top_package_initialize_s); + + /* Destroy the datatype object id group */ + n += (H5I_dec_type_ref(H5I_DATATYPE) > 0); /* Mark interface as closed */ - H5_interface_initialize_g = 0; + if(0 == n) + H5_PKG_INIT_VAR = FALSE; } /* end if */ FUNC_LEAVE_NOAPI(n) -} /* end H5T_term_interface() */ +} /* end H5T_term_package() */ /*------------------------------------------------------------------------- @@ -1865,7 +1873,7 @@ done: H5T_class_t H5T_get_class(const H5T_t *dt, htri_t internal) { - H5T_class_t ret_value; + H5T_class_t ret_value = H5T_NO_CLASS; /* Return value */ FUNC_ENTER_NOAPI(H5T_NO_CLASS) @@ -2912,8 +2920,8 @@ done: H5T_t * H5T_decode(const unsigned char *buf) { - H5F_t *f = NULL; /* Fake file structure*/ - H5T_t *ret_value; /* Return value */ + H5F_t *f = NULL; /* Fake file structure*/ + H5T_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -3116,7 +3124,7 @@ H5T_copy(H5T_t *old_dt, H5T_copy_t method) H5T_shared_t *reopened_fo = NULL; unsigned i; char *s; - H5T_t *ret_value; + H5T_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI(NULL) @@ -3445,7 +3453,7 @@ H5T_t * H5T__alloc(void) { H5T_t *dt = NULL; /* Pointer to datatype allocated */ - H5T_t *ret_value; /* Return value */ + H5T_t *ret_value = NULL; /* Return value */ FUNC_ENTER_PACKAGE @@ -3532,21 +3540,23 @@ H5T__free(H5T_t *dt) switch(dt->shared->type) { case H5T_COMPOUND: for(i = 0; i < dt->shared->u.compnd.nmembs; i++) { - H5MM_xfree(dt->shared->u.compnd.memb[i].name); + dt->shared->u.compnd.memb[i].name = (char *)H5MM_xfree(dt->shared->u.compnd.memb[i].name); H5T_close(dt->shared->u.compnd.memb[i].type); } /* end for */ - H5MM_xfree(dt->shared->u.compnd.memb); + dt->shared->u.compnd.memb = (H5T_cmemb_t *)H5MM_xfree(dt->shared->u.compnd.memb); + dt->shared->u.compnd.nmembs = 0; break; case H5T_ENUM: for(i = 0; i < dt->shared->u.enumer.nmembs; i++) - H5MM_xfree(dt->shared->u.enumer.name[i]); - H5MM_xfree(dt->shared->u.enumer.name); - H5MM_xfree(dt->shared->u.enumer.value); + dt->shared->u.enumer.name[i] = (char *)H5MM_xfree(dt->shared->u.enumer.name[i]); + dt->shared->u.enumer.name = (char **)H5MM_xfree(dt->shared->u.enumer.name); + dt->shared->u.enumer.value = (uint8_t *)H5MM_xfree(dt->shared->u.enumer.value); + dt->shared->u.enumer.nmembs = 0; break; case H5T_OPAQUE: - H5MM_xfree(dt->shared->u.opaque.tag); + dt->shared->u.opaque.tag = (char *)H5MM_xfree(dt->shared->u.opaque.tag); break; case H5T_NO_CLASS: @@ -3562,11 +3572,13 @@ H5T__free(H5T_t *dt) default: break; } /* end switch */ + dt->shared->type = H5T_NO_CLASS; /* Close the parent */ HDassert(dt->shared->parent != dt); if(dt->shared->parent && H5T_close(dt->shared->parent) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCLOSEOBJ, FAIL, "unable to close parent data type") + dt->shared->parent = NULL; done: FUNC_LEAVE_NOAPI(ret_value) @@ -3641,7 +3653,7 @@ H5T_close(H5T_t *dt) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTRELEASE, FAIL, "problem attempting to free location") } /* end if */ - /* Free the group hier. path since we're not calling H5T__free*/ + /* Free the group hier. path since we're not calling H5T__free() */ H5G_name_free(&(dt->path)); } /* end else */ @@ -4375,7 +4387,7 @@ done: * function like H5Tregister() is calling this function to * register a new hard conversion function, IS_API is TRUE * and the old path is replaced. If a private function like - * H5T_init_interface() is trying to register hard conversions, + * H5T__init_package() is trying to register hard conversions, * IS_API is FALSE and the old hard path is not replaced. * Tuesday, Sept 13, 2005 * @@ -4394,7 +4406,7 @@ H5T_path_find(const H5T_t *src, const H5T_t *dst, const char *name, hid_t src_id = -1, dst_id = -1; /*src and dst type identifiers */ int i; /*counter */ int nprint = 0; /*lines of output printed */ - H5T_path_t *ret_value; /*return value */ + H5T_path_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI(NULL) @@ -4753,7 +4765,7 @@ static htri_t H5T_compiler_conv(H5T_t *src, H5T_t *dst) { H5T_path_t *path; - htri_t ret_value; + htri_t ret_value = FAIL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -5045,7 +5057,7 @@ done: htri_t H5T_is_sensible(const H5T_t *dt) { - htri_t ret_value; + htri_t ret_value = FAIL; /* Return value */ FUNC_ENTER_NOAPI(FAIL) diff --git a/src/H5TS.c b/src/H5TS.c index d4b90db..987bead 100644 --- a/src/H5TS.c +++ b/src/H5TS.c @@ -62,7 +62,7 @@ static void H5TS_key_destructor(void *key_val) { /* Use HDfree here instead of H5MM_xfree(), to avoid calling the H5CS routines */ - if(key_val!=NULL) + if(key_val != NULL) HDfree(key_val); } @@ -91,7 +91,8 @@ H5TS_key_destructor(void *key_val) void H5TS_pthread_first_thread_init(void) { - H5_g.H5_libinit_g = FALSE; + H5_g.H5_libinit_g = FALSE; /* Library hasn't been initialized */ + H5_g.H5_libterm_g = FALSE; /* Library isn't being shutdown */ #ifdef H5_HAVE_WIN32_API # ifdef PTW32_STATIC_LIB diff --git a/src/H5Tarray.c b/src/H5Tarray.c index 752f2aa..4b2c7cf 100644 --- a/src/H5Tarray.c +++ b/src/H5Tarray.c @@ -22,10 +22,7 @@ /* Module Setup */ /****************/ -#define H5T_PACKAGE /*suppress error about including H5Tpkg */ - -/* Interface initialization */ -#define H5_INTERFACE_INIT_FUNC H5T_init_array_interface +#include "H5Tmodule.h" /* This source code file is part of the H5T module */ /***********/ @@ -78,28 +75,6 @@ -/*-------------------------------------------------------------------------- -NAME - H5T_init_array_interface -- Initialize interface-specific information -USAGE - herr_t H5T_init_array_interface() - -RETURNS - Non-negative on success/Negative on failure -DESCRIPTION - Initializes any interface-specific data or routines. (Just calls - H5T_init_iterface currently). - ---------------------------------------------------------------------------*/ -static herr_t -H5T_init_array_interface(void) -{ - FUNC_ENTER_NOAPI_NOINIT_NOERR - - FUNC_LEAVE_NOAPI(H5T_init()) -} /* H5T_init_array_interface() */ - - /*------------------------------------------------------------------------- * Function: H5Tarray_create2 * @@ -179,8 +154,8 @@ done: H5T_t * H5T__array_create(H5T_t *base, unsigned ndims, const hsize_t dim[/* ndims */]) { - H5T_t *ret_value; /* new array data type */ - unsigned u; /* local index variable */ + unsigned u; /* Local index variable */ + H5T_t *ret_value = NULL; /* New array data type */ FUNC_ENTER_PACKAGE diff --git a/src/H5Tbit.c b/src/H5Tbit.c index 5322959..8c53066 100644 --- a/src/H5Tbit.c +++ b/src/H5Tbit.c @@ -19,7 +19,7 @@ * the bytes are in little-endian order. */ -#define H5T_PACKAGE /*suppress error about including H5Tpkg */ +#include "H5Tmodule.h" /* This source code file is part of the H5T module */ #include "H5private.h" /*generic functions */ @@ -261,7 +261,7 @@ H5T__bit_get_d(uint8_t *buf, size_t offset, size_t size) { uint64_t val = 0; size_t i, hs; - uint64_t ret_value; /* Return value */ + uint64_t ret_value = 0; /* Return value */ FUNC_ENTER_PACKAGE_NOERR diff --git a/src/H5Tcommit.c b/src/H5Tcommit.c index 024cc83..5ff1c73 100644 --- a/src/H5Tcommit.c +++ b/src/H5Tcommit.c @@ -22,10 +22,7 @@ /* Module Setup */ /****************/ -#define H5T_PACKAGE /*suppress error about including H5Tpkg */ - -/* Interface initialization */ -#define H5_INTERFACE_INIT_FUNC H5T_init_commit_interface +#include "H5Tmodule.h" /* This source code file is part of the H5T module */ /***********/ @@ -83,28 +80,6 @@ static H5T_t *H5T_open_oid(const H5G_loc_t *loc, hid_t dxpl_id); -/*-------------------------------------------------------------------------- -NAME - H5T_init_commit_interface -- Initialize interface-specific information -USAGE - herr_t H5T_init_commit_interface() - -RETURNS - Non-negative on success/Negative on failure -DESCRIPTION - Initializes any interface-specific data or routines. (Just calls - H5T_init_iterface currently). - ---------------------------------------------------------------------------*/ -static herr_t -H5T_init_commit_interface(void) -{ - FUNC_ENTER_NOAPI_NOINIT_NOERR - - FUNC_LEAVE_NOAPI(H5T_init()) -} /* H5T_init_commit_interface() */ - - /*------------------------------------------------------------------------- * Function: H5Tcommit2 * @@ -184,10 +159,10 @@ herr_t H5T__commit_named(const H5G_loc_t *loc, const char *name, H5T_t *dt, hid_t lcpl_id, hid_t tcpl_id, hid_t tapl_id, hid_t dxpl_id) { - H5O_obj_create_t ocrt_info; /* Information for object creation */ - H5T_obj_create_t tcrt_info; /* Information for named datatype creation */ - H5T_state_t old_state = H5T_STATE_TRANSIENT; /* The state of the datatype before H5T__commit. */ - herr_t ret_value = SUCCEED; /* Return value */ + H5O_obj_create_t ocrt_info; /* Information for object creation */ + H5T_obj_create_t tcrt_info; /* Information for named datatype creation */ + H5T_state_t old_state; /* The state of the datatype before H5T__commit. */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -518,7 +493,7 @@ H5T_committed(const H5T_t *type) int H5T_link(const H5T_t *type, int adjust, hid_t dxpl_id) { - int ret_value; /* Return value */ + int ret_value = -1; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -705,7 +680,7 @@ H5T_open(const H5G_loc_t *loc, hid_t dxpl_id) { H5T_shared_t *shared_fo = NULL; H5T_t *dt = NULL; - H5T_t *ret_value; + H5T_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI(NULL) @@ -821,7 +796,7 @@ static H5T_t * H5T_open_oid(const H5G_loc_t *loc, hid_t dxpl_id) { H5T_t *dt = NULL; /* Datatype from the file */ - H5T_t *ret_value; /* Return value */ + H5T_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT diff --git a/src/H5Tcompound.c b/src/H5Tcompound.c index b377b29..1342770 100644 --- a/src/H5Tcompound.c +++ b/src/H5Tcompound.c @@ -22,10 +22,7 @@ /* Module Setup */ /****************/ -#define H5T_PACKAGE /*suppress error about including H5Tpkg */ - -/* Interface initialization */ -#define H5_INTERFACE_INIT_FUNC H5T_init_compound_interface +#include "H5Tmodule.h" /* This source code file is part of the H5T module */ /***********/ @@ -80,26 +77,6 @@ static htri_t H5T_is_packed(const H5T_t *dt); -/*-------------------------------------------------------------------------- -NAME - H5T_init_compound_interface -- Initialize interface-specific information -USAGE - herr_t H5T_init_compound_interface() -RETURNS - Non-negative on success/Negative on failure -DESCRIPTION - Initializes any interface-specific data or routines. (Just calls - H5T_init() currently). ---------------------------------------------------------------------------*/ -static herr_t -H5T_init_compound_interface(void) -{ - FUNC_ENTER_NOAPI_NOINIT_NOERR - - FUNC_LEAVE_NOAPI(H5T_init()) -} /* H5T_init_compound_interface() */ - - /*------------------------------------------------------------------------- * Function: H5Tget_member_offset * @@ -282,7 +259,7 @@ done: H5T_t * H5T_get_member_type(const H5T_t *dt, unsigned membno, H5T_copy_t method) { - H5T_t *ret_value; /* Return value */ + H5T_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI(NULL) diff --git a/src/H5Tconv.c b/src/H5Tconv.c index 6847e68..8b96d22 100644 --- a/src/H5Tconv.c +++ b/src/H5Tconv.c @@ -21,7 +21,8 @@ /* Module Setup */ /****************/ -#define H5T_PACKAGE /*suppress error about including H5Tpkg */ +#include "H5Tmodule.h" /* This source code file is part of the H5T module */ + /***********/ /* Headers */ @@ -2111,7 +2112,7 @@ done: H5T_subset_info_t * H5T__conv_struct_subset(const H5T_cdata_t *cdata) { - H5T_conv_struct_t *priv; + H5T_conv_struct_t *priv = NULL; FUNC_ENTER_PACKAGE_NOERR @@ -2925,7 +2926,7 @@ H5T__conv_enum(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, /* Use O(log N) lookup */ unsigned lt = 0; unsigned rt = src->shared->u.enumer.nmembs; - unsigned md; + unsigned md = 0; int cmp; while(lt < rt) { diff --git a/src/H5Tcset.c b/src/H5Tcset.c index 33fb32a..95658ed 100644 --- a/src/H5Tcset.c +++ b/src/H5Tcset.c @@ -18,10 +18,7 @@ * the character set (cset) for the H5T interface. */ -#define H5T_PACKAGE /*suppress error about including H5Tpkg */ - -/* Interface initialization */ -#define H5_INTERFACE_INIT_FUNC H5T_init_cset_interface +#include "H5Tmodule.h" /* This source code file is part of the H5T module */ #include "H5private.h" /*generic functions */ @@ -30,28 +27,6 @@ #include "H5Tpkg.h" /*data-type functions */ -/*-------------------------------------------------------------------------- -NAME - H5T_init_cset_interface -- Initialize interface-specific information -USAGE - herr_t H5T_init_cset_interface() - -RETURNS - Non-negative on success/Negative on failure -DESCRIPTION - Initializes any interface-specific data or routines. (Just calls - H5T_init_iterface currently). - ---------------------------------------------------------------------------*/ -static herr_t -H5T_init_cset_interface(void) -{ - FUNC_ENTER_NOAPI_NOINIT_NOERR - - FUNC_LEAVE_NOAPI(H5T_init()) -} /* H5T_init_cset_interface() */ - - /*------------------------------------------------------------------------- * Function: H5Tget_cset * diff --git a/src/H5Tdbg.c b/src/H5Tdbg.c index 717fc17..8a10cc6 100644 --- a/src/H5Tdbg.c +++ b/src/H5Tdbg.c @@ -28,7 +28,7 @@ /* Module Setup */ /****************/ -#define H5T_PACKAGE /*suppress error about including H5Tpkg */ +#include "H5Tmodule.h" /* This source code file is part of the H5T module */ /***********/ diff --git a/src/H5Tdeprec.c b/src/H5Tdeprec.c index f1586bd..cd4de1d 100644 --- a/src/H5Tdeprec.c +++ b/src/H5Tdeprec.c @@ -31,10 +31,7 @@ /* Module Setup */ /****************/ -#define H5T_PACKAGE /*suppress error about including H5Tpkg */ - -/* Interface initialization */ -#define H5_INTERFACE_INIT_FUNC H5T__init_deprec_interface +#include "H5Tmodule.h" /* This source code file is part of the H5T module */ /***********/ @@ -84,51 +81,6 @@ /*******************/ - -/*-------------------------------------------------------------------------- -NAME - H5T__init_deprec_interface -- Initialize interface-specific information -USAGE - herr_t H5T__init_deprec_interface() -RETURNS - Non-negative on success/Negative on failure -DESCRIPTION - Initializes any interface-specific data or routines. (Just calls - H5T_init() currently). - ---------------------------------------------------------------------------*/ -static herr_t -H5T__init_deprec_interface(void) -{ - FUNC_ENTER_STATIC_NOERR - - FUNC_LEAVE_NOAPI(H5T_init()) -} /* H5T__init_deprec_interface() */ - - -/*-------------------------------------------------------------------------- -NAME - H5T__term_deprec_interface -- Terminate interface -USAGE - herr_t H5T__term_deprec_interface() -RETURNS - Non-negative on success/Negative on failure -DESCRIPTION - Terminates interface. (Just resets H5_interface_initialize_g - currently). - ---------------------------------------------------------------------------*/ -herr_t -H5T__term_deprec_interface(void) -{ - FUNC_ENTER_PACKAGE_NOERR - - /* Mark closed */ - H5_interface_initialize_g = 0; - - FUNC_LEAVE_NOAPI(0) -} /* H5T__term_deprec_interface() */ - #ifndef H5_NO_DEPRECATED_SYMBOLS /*------------------------------------------------------------------------- diff --git a/src/H5Tenum.c b/src/H5Tenum.c index 2b7563b..e80d748 100644 --- a/src/H5Tenum.c +++ b/src/H5Tenum.c @@ -18,10 +18,7 @@ * in the H5T interface. */ -#define H5T_PACKAGE /*suppress error about including H5Tpkg */ - -/* Interface initialization */ -#define H5_INTERFACE_INIT_FUNC H5T_init_enum_interface +#include "H5Tmodule.h" /* This source code file is part of the H5T module */ #include "H5private.h" /*generic functions */ @@ -36,27 +33,6 @@ static char *H5T_enum_nameof(const H5T_t *dt, const void *value, char *name/*out static herr_t H5T_enum_valueof(const H5T_t *dt, const char *name, void *value/*out*/); - -/*-------------------------------------------------------------------------- -NAME - H5T_init_enum_interface -- Initialize interface-specific information -USAGE - herr_t H5T_init_enum_interface() - -RETURNS - Non-negative on success/Negative on failure -DESCRIPTION - Initializes any interface-specific data or routines. (Just calls - H5T_init_iterface currently). - ---------------------------------------------------------------------------*/ -static herr_t -H5T_init_enum_interface(void) -{ - FUNC_ENTER_NOAPI_NOINIT_NOERR - - FUNC_LEAVE_NOAPI(H5T_init()) -} /* H5T_init_enum_interface() */ /*------------------------------------------------------------------------- @@ -123,7 +99,7 @@ done: H5T_t * H5T__enum_create(const H5T_t *parent) { - H5T_t *ret_value; /*new enumeration data type */ + H5T_t *ret_value = NULL; /* New enumeration data type */ FUNC_ENTER_PACKAGE @@ -416,7 +392,7 @@ H5T_enum_nameof(const H5T_t *dt, const void *value, char *name/*out*/, size_t si unsigned lt, md = 0, rt; /* Indices for binary search */ int cmp = (-1); /* Comparison result */ hbool_t alloc_name = FALSE; /* Whether name has been allocated */ - char *ret_value; /* Return value */ + char *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT diff --git a/src/H5Tfields.c b/src/H5Tfields.c index fb186fb..8818a73 100644 --- a/src/H5Tfields.c +++ b/src/H5Tfields.c @@ -18,10 +18,7 @@ * enumerated & compound datatypes in the H5T interface. */ -#define H5T_PACKAGE /*suppress error about including H5Tpkg */ - -/* Interface initialization */ -#define H5_INTERFACE_INIT_FUNC H5T_init_fields_interface +#include "H5Tmodule.h" /* This source code file is part of the H5T module */ #include "H5private.h" /*generic functions */ @@ -31,28 +28,6 @@ #include "H5Tpkg.h" /*data-type functions */ -/*-------------------------------------------------------------------------- -NAME - H5T_init_fields_interface -- Initialize interface-specific information -USAGE - herr_t H5T_init_fields_interface() - -RETURNS - Non-negative on success/Negative on failure -DESCRIPTION - Initializes any interface-specific data or routines. (Just calls - H5T_init_iterface currently). - ---------------------------------------------------------------------------*/ -static herr_t -H5T_init_fields_interface(void) -{ - FUNC_ENTER_NOAPI_NOINIT_NOERR - - FUNC_LEAVE_NOAPI(H5T_init()) -} /* H5T_init_fields_interface() */ - - /*------------------------------------------------------------------------- * Function: H5Tget_nmembers * @@ -117,7 +92,7 @@ done: int H5T_get_nmembers(const H5T_t *dt) { - int ret_value; + int ret_value = -1; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -199,7 +174,7 @@ done: char * H5T__get_member_name(H5T_t const *dt, unsigned membno) { - char *ret_value; + char *ret_value = NULL; /* Return value */ FUNC_ENTER_PACKAGE diff --git a/src/H5Tfixed.c b/src/H5Tfixed.c index daa7886..62b8e79 100644 --- a/src/H5Tfixed.c +++ b/src/H5Tfixed.c @@ -18,10 +18,7 @@ * integer) datatypes in the H5T interface. */ -#define H5T_PACKAGE /*suppress error about including H5Tpkg */ - -/* Interface initialization */ -#define H5_INTERFACE_INIT_FUNC H5T_init_fixed_interface +#include "H5Tmodule.h" /* This source code file is part of the H5T module */ #include "H5private.h" /*generic functions */ @@ -30,28 +27,6 @@ #include "H5Tpkg.h" /*data-type functions */ -/*-------------------------------------------------------------------------- -NAME - H5T_init_fixed_interface -- Initialize interface-specific information -USAGE - herr_t H5T_init_fixed_interface() - -RETURNS - Non-negative on success/Negative on failure -DESCRIPTION - Initializes any interface-specific data or routines. (Just calls - H5T_init_iterface currently). - ---------------------------------------------------------------------------*/ -static herr_t -H5T_init_fixed_interface(void) -{ - FUNC_ENTER_NOAPI_NOINIT_NOERR - - FUNC_LEAVE_NOAPI(H5T_init()) -} /* H5T_init_fixed_interface() */ - - /*------------------------------------------------------------------------- * Function: H5Tget_sign * @@ -109,7 +84,7 @@ done: H5T_sign_t H5T_get_sign(H5T_t const *dt) { - H5T_sign_t ret_value; + H5T_sign_t ret_value = H5T_SGN_ERROR; /* Return value */ FUNC_ENTER_NOAPI(H5T_SGN_ERROR) diff --git a/src/H5Tfloat.c b/src/H5Tfloat.c index fff413d..b8b1c07 100644 --- a/src/H5Tfloat.c +++ b/src/H5Tfloat.c @@ -18,10 +18,7 @@ * datatypes in the H5T interface. */ -#define H5T_PACKAGE /*suppress error about including H5Tpkg */ - -/* Interface initialization */ -#define H5_INTERFACE_INIT_FUNC H5T_init_float_interface +#include "H5Tmodule.h" /* This source code file is part of the H5T module */ #include "H5private.h" /*generic functions */ @@ -29,27 +26,6 @@ #include "H5Iprivate.h" /*ID functions */ #include "H5Tpkg.h" /*data-type functions */ - -/*-------------------------------------------------------------------------- -NAME - H5T_init_float_interface -- Initialize interface-specific information -USAGE - herr_t H5T_init_float_interface() - -RETURNS - Non-negative on success/Negative on failure -DESCRIPTION - Initializes any interface-specific data or routines. (Just calls - H5T_init_iterface currently). - ---------------------------------------------------------------------------*/ -static herr_t -H5T_init_float_interface(void) -{ - FUNC_ENTER_NOAPI_NOINIT_NOERR - - FUNC_LEAVE_NOAPI(H5T_init()) -} /* H5T_init_float_interface() */ /*------------------------------------------------------------------------- diff --git a/src/H5Tmodule.h b/src/H5Tmodule.h new file mode 100644 index 0000000..bfaab5e6 --- /dev/null +++ b/src/H5Tmodule.h @@ -0,0 +1,35 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* + * Programmer: Quincey Koziol + * Saturday, September 12, 2015 + * + * Purpose: This file contains declarations which define macros for the + * H5T package. Including this header means that the source file + * is part of the H5T package. + */ +#ifndef _H5Tmodule_H +#define _H5Tmodule_H + +/* Define the proper control macros for the generic FUNC_ENTER/LEAVE and error + * reporting macros. + */ +#define H5T_MODULE +#define H5_MY_PKG H5T +#define H5_MY_PKG_ERR H5E_DATATYPE +#define H5_MY_PKG_INIT YES + +#endif /* _H5Tmodule_H */ + diff --git a/src/H5Tnative.c b/src/H5Tnative.c index bf6ba08..229fe94 100644 --- a/src/H5Tnative.c +++ b/src/H5Tnative.c @@ -18,10 +18,7 @@ * a "native" datatype for the H5T interface. */ -#define H5T_PACKAGE /*suppress error about including H5Tpkg */ - -/* Interface initialization */ -#define H5_INTERFACE_INIT_FUNC H5T_init_native_interface +#include "H5Tmodule.h" /* This source code file is part of the H5T module */ #include "H5private.h" /* Generic Functions */ @@ -43,27 +40,6 @@ static H5T_t* H5T_get_native_bitfield(size_t prec, H5T_direction_t direction, static herr_t H5T_cmp_offset(size_t *comp_size, size_t *offset, size_t elem_size, size_t nelems, size_t align, size_t *struct_align); - -/*-------------------------------------------------------------------------- -NAME - H5T_init_native_interface -- Initialize interface-specific information -USAGE - herr_t H5T_init_native_interface() - -RETURNS - Non-negative on success/Negative on failure -DESCRIPTION - Initializes any interface-specific data or routines. (Just calls - H5T_init_iterface currently). - ---------------------------------------------------------------------------*/ -static herr_t -H5T_init_native_interface(void) -{ - FUNC_ENTER_NOAPI_NOINIT_NOERR - - FUNC_LEAVE_NOAPI(H5T_init()) -} /* H5T_init_native_interface() */ /*------------------------------------------------------------------------- @@ -168,7 +144,7 @@ H5T_get_native_type(H5T_t *dtype, H5T_direction_t direction, size_t *struct_alig int snmemb; /* Number of members in compound & enum types */ unsigned nmemb = 0; /* Number of members in compound & enum types */ unsigned u; /* Local index variable */ - H5T_t *ret_value; /* Return value */ + H5T_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI(NULL) @@ -571,7 +547,7 @@ H5T_get_native_integer(size_t prec, H5T_sign_t sign, H5T_direction_t direction, H5T_NATIVE_INT_MATCH_LLONG, H5T_NATIVE_INT_MATCH_UNKNOWN } match = H5T_NATIVE_INT_MATCH_UNKNOWN; - H5T_t *ret_value; /* Return value */ + H5T_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI(NULL) @@ -711,7 +687,7 @@ H5T_get_native_float(size_t size, H5T_direction_t direction, size_t *struct_alig #endif H5T_NATIVE_FLOAT_MATCH_UNKNOWN } match=H5T_NATIVE_FLOAT_MATCH_UNKNOWN; - H5T_t *ret_value; /* Return value */ + H5T_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI(NULL) @@ -829,7 +805,7 @@ H5T_get_native_bitfield(size_t prec, H5T_direction_t direction, size_t *struct_a hid_t tid=(-1); /* Datatype ID of appropriate native datatype */ size_t align=0; /* Alignment necessary for native datatype */ size_t native_size=0; /* Datatype size of the native type */ - H5T_t *ret_value; /* Return value */ + H5T_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI(NULL) diff --git a/src/H5Toffset.c b/src/H5Toffset.c index ea4b3b5..cc45d8e 100644 --- a/src/H5Toffset.c +++ b/src/H5Toffset.c @@ -18,10 +18,7 @@ * the datatype offset for the H5T interface. */ -#define H5T_PACKAGE /*suppress error about including H5Tpkg */ - -/* Interface initialization */ -#define H5_INTERFACE_INIT_FUNC H5T_init_offset_interface +#include "H5Tmodule.h" /* This source code file is part of the H5T module */ #include "H5private.h" /* Generic Functions */ @@ -32,27 +29,6 @@ /* Static local functions */ static herr_t H5T_set_offset(const H5T_t *dt, size_t offset); - -/*-------------------------------------------------------------------------- -NAME - H5T_init_offset_interface -- Initialize interface-specific information -USAGE - herr_t H5T_init_offset_interface() - -RETURNS - Non-negative on success/Negative on failure -DESCRIPTION - Initializes any interface-specific data or routines. (Just calls - H5T_init_iterface currently). - ---------------------------------------------------------------------------*/ -static herr_t -H5T_init_offset_interface(void) -{ - FUNC_ENTER_NOAPI_NOINIT_NOERR - - FUNC_LEAVE_NOAPI(H5T_init()) -} /* H5T_init_offset_interface() */ /*------------------------------------------------------------------------- @@ -138,7 +114,7 @@ done: int H5T_get_offset(const H5T_t *dt) { - int ret_value; + int ret_value = -1; /* Return value */ FUNC_ENTER_NOAPI(-1) diff --git a/src/H5Toh.c b/src/H5Toh.c index abf8a51..9c8ad80 100644 --- a/src/H5Toh.c +++ b/src/H5Toh.c @@ -17,8 +17,8 @@ /* Module Setup */ /****************/ -#define H5O_PACKAGE /*suppress error about including H5Opkg */ -#define H5T_PACKAGE /*suppress error about including H5Tpkg */ +#define H5O_FRIEND /*suppress error about including H5Opkg */ +#include "H5Tmodule.h" /* This source code file is part of the H5T module */ /***********/ @@ -102,7 +102,7 @@ const H5O_obj_class_t H5O_OBJ_DATATYPE[1] = {{ static htri_t H5O_dtype_isa(struct H5O_t *oh) { - htri_t ret_value; /* Return value */ + htri_t ret_value = FAIL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -133,7 +133,7 @@ static hid_t H5O_dtype_open(const H5G_loc_t *obj_loc, hid_t H5_ATTR_UNUSED lapl_id, hid_t dxpl_id, hbool_t app_ref) { H5T_t *type = NULL; /* Datatype opened */ - hid_t ret_value; /* Return value */ + hid_t ret_value = H5I_INVALID_HID; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -173,7 +173,7 @@ static void * H5O_dtype_create(H5F_t *f, void *_crt_info, H5G_loc_t *obj_loc, hid_t dxpl_id) { H5T_obj_create_t *crt_info = (H5T_obj_create_t *)_crt_info; /* Named datatype creation parameters */ - void *ret_value; /* Return value */ + void *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -217,7 +217,7 @@ static H5O_loc_t * H5O_dtype_get_oloc(hid_t obj_id) { H5T_t *type; /* Datatype opened */ - H5O_loc_t *ret_value; /* Return value */ + H5O_loc_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT diff --git a/src/H5Topaque.c b/src/H5Topaque.c index f37d14b..9cc22c9 100644 --- a/src/H5Topaque.c +++ b/src/H5Topaque.c @@ -18,10 +18,7 @@ * datatypes in the H5T interface. */ -#define H5T_PACKAGE /*suppress error about including H5Tpkg */ - -/* Interface initialization */ -#define H5_INTERFACE_INIT_FUNC H5T_init_opaque_interface +#include "H5Tmodule.h" /* This source code file is part of the H5T module */ #include "H5private.h" /* Generic Functions */ @@ -30,27 +27,6 @@ #include "H5MMprivate.h" /* Memory management */ #include "H5Tpkg.h" /* Datatypes */ - -/*-------------------------------------------------------------------------- -NAME - H5T_init_opaque_interface -- Initialize interface-specific information -USAGE - herr_t H5T_init_opaque_interface() - -RETURNS - Non-negative on success/Negative on failure -DESCRIPTION - Initializes any interface-specific data or routines. (Just calls - H5T_init_iterface currently). - ---------------------------------------------------------------------------*/ -static herr_t -H5T_init_opaque_interface(void) -{ - FUNC_ENTER_NOAPI_NOINIT_NOERR - - FUNC_LEAVE_NOAPI(H5T_init()) -} /* H5T_init_opaque_interface() */ /*------------------------------------------------------------------------- diff --git a/src/H5Torder.c b/src/H5Torder.c index 35be454..6c9c55c 100644 --- a/src/H5Torder.c +++ b/src/H5Torder.c @@ -22,10 +22,7 @@ /* Module Setup */ /****************/ -#define H5T_PACKAGE /*suppress error about including H5Tpkg */ - -/* Interface initialization */ -#define H5_INTERFACE_INIT_FUNC H5T_init_order_interface +#include "H5Tmodule.h" /* This source code file is part of the H5T module */ /***********/ @@ -79,27 +76,6 @@ static herr_t H5T_set_order(H5T_t *dtype, H5T_order_t order); -/*-------------------------------------------------------------------------- -NAME - H5T_init_order_interface -- Initialize interface-specific information -USAGE - herr_t H5T_init_order_interface() -RETURNS - Non-negative on success/Negative on failure -DESCRIPTION - Initializes any interface-specific data or routines. (Just calls - H5T_init_iterface currently). - ---------------------------------------------------------------------------*/ -static herr_t -H5T_init_order_interface(void) -{ - FUNC_ENTER_NOAPI_NOINIT_NOERR - - FUNC_LEAVE_NOAPI(H5T_init()) -} /* H5T_init_order_interface() */ - - /*------------------------------------------------------------------------- * Function: H5Tget_order * diff --git a/src/H5Tpad.c b/src/H5Tpad.c index 38de494..e636a84 100644 --- a/src/H5Tpad.c +++ b/src/H5Tpad.c @@ -18,10 +18,7 @@ * the datatype padding for the H5T interface. */ -#define H5T_PACKAGE /*suppress error about including H5Tpkg */ - -/* Interface initialization */ -#define H5_INTERFACE_INIT_FUNC H5T_init_pad_interface +#include "H5Tmodule.h" /* This source code file is part of the H5T module */ #include "H5private.h" /* Generic Functions */ @@ -29,27 +26,6 @@ #include "H5Iprivate.h" /* IDs */ #include "H5Tpkg.h" /* Datatypes */ - -/*-------------------------------------------------------------------------- -NAME - H5T_init_pad_interface -- Initialize interface-specific information -USAGE - herr_t H5T_init_pad_interface() - -RETURNS - Non-negative on success/Negative on failure -DESCRIPTION - Initializes any interface-specific data or routines. (Just calls - H5T_init_iterface currently). - ---------------------------------------------------------------------------*/ -static herr_t -H5T_init_pad_interface(void) -{ - FUNC_ENTER_NOAPI_NOINIT_NOERR - - FUNC_LEAVE_NOAPI(H5T_init()) -} /* H5T_init_pad_interface() */ /*------------------------------------------------------------------------- diff --git a/src/H5Tpkg.h b/src/H5Tpkg.h index 0b0cd61..0bd1e06 100644 --- a/src/H5Tpkg.h +++ b/src/H5Tpkg.h @@ -21,7 +21,7 @@ * the H5T package. Source files outside the H5T package should * include H5Tprivate.h instead. */ -#ifndef H5T_PACKAGE +#if !(defined H5T_FRIEND || defined H5T_MODULE) #error "Do not include this file outside the H5T package!" #endif @@ -424,7 +424,7 @@ H5FL_EXTERN(H5T_t); H5FL_EXTERN(H5T_shared_t); /* Common functions */ -H5_DLL herr_t H5T__term_deprec_interface(void); +H5_DLL herr_t H5T__init_native(void); H5_DLL H5T_t *H5T__create(H5T_class_t type, size_t size); H5_DLL herr_t H5T__commit(H5F_t *file, H5T_t *type, hid_t tcpl_id, hid_t dxpl_id); H5_DLL herr_t H5T__commit_named(const H5G_loc_t *loc, const char *name, diff --git a/src/H5Tprecis.c b/src/H5Tprecis.c index 73a4e32..be85491 100644 --- a/src/H5Tprecis.c +++ b/src/H5Tprecis.c @@ -18,10 +18,7 @@ * the datatype precision for the H5T interface. */ -#define H5T_PACKAGE /*suppress error about including H5Tpkg */ - -/* Interface initialization */ -#define H5_INTERFACE_INIT_FUNC H5T_init_precis_interface +#include "H5Tmodule.h" /* This source code file is part of the H5T module */ #include "H5private.h" /* Generic Functions */ @@ -32,27 +29,6 @@ /* Static local functions */ static herr_t H5T_set_precision(const H5T_t *dt, size_t prec); - -/*-------------------------------------------------------------------------- -NAME - H5T_init_precis_interface -- Initialize interface-specific information -USAGE - herr_t H5T_init_precis_interface() - -RETURNS - Non-negative on success/Negative on failure -DESCRIPTION - Initializes any interface-specific data or routines. (Just calls - H5T_init_iterface currently). - ---------------------------------------------------------------------------*/ -static herr_t -H5T_init_precis_interface(void) -{ - FUNC_ENTER_NOAPI_NOINIT_NOERR - - FUNC_LEAVE_NOAPI(H5T_init()) -} /* H5T_init_precis_interface() */ /*------------------------------------------------------------------------- @@ -119,7 +95,7 @@ done: size_t H5T_get_precision(const H5T_t *dt) { - size_t ret_value; + size_t ret_value = 0; /* Return value */ FUNC_ENTER_NOAPI(0) diff --git a/src/H5Tprivate.h b/src/H5Tprivate.h index 558afaf..93fe599 100644 --- a/src/H5Tprivate.h +++ b/src/H5Tprivate.h @@ -34,17 +34,17 @@ #define H5T_ELEM_BUF_SIZE 256 /* If the module using this macro is allowed access to the private variables, access them directly */ -#ifdef H5T_PACKAGE +#ifdef H5T_MODULE #define H5T_GET_SIZE(T) ((T)->shared->size) #define H5T_GET_SHARED(T) ((T)->shared) #define H5T_GET_MEMBER_OFFSET(T, I) ((T)->u.compnd.memb[I].offset) #define H5T_GET_MEMBER_SIZE(T, I) ((T)->u.compnd.memb[I].shared->size) -#else /* H5T_PACKAGE */ +#else /* H5T_MODULE */ #define H5T_GET_SIZE(T) (H5T_get_size(T)) #define H5T_GET_SHARED(T) (H5T_get_shared(T)) #define H5T_GET_MEMBER_OFFSET(T, I) (H5T_get_member_offset((T), (I))) #define H5T_GET_MEMBER_SIZE(T, I) (H5T_get_member_size((T), (I))) -#endif /* H5T_PACKAGE */ +#endif /* H5T_MODULE */ /* Forward references of package typedefs (declared in H5Tpkg.h) */ typedef struct H5T_t H5T_t; @@ -104,7 +104,6 @@ struct H5O_t; H5_DLLVAR H5T_order_t H5T_native_order_g; /* Private functions */ -H5_DLL herr_t H5TN_init_interface(void); H5_DLL herr_t H5T_init(void); H5_DLL H5T_t *H5T_copy(H5T_t *old_dt, H5T_copy_t method); H5_DLL herr_t H5T_lock(H5T_t *dt, hbool_t immutable); diff --git a/src/H5Tstrpad.c b/src/H5Tstrpad.c index c71827b..2cd1db4 100644 --- a/src/H5Tstrpad.c +++ b/src/H5Tstrpad.c @@ -18,10 +18,7 @@ * the datatype string padding for the H5T interface. */ -#define H5T_PACKAGE /*suppress error about including H5Tpkg */ - -/* Interface initialization */ -#define H5_INTERFACE_INIT_FUNC H5T_init_strpad_interface +#include "H5Tmodule.h" /* This source code file is part of the H5T module */ #include "H5private.h" /* Generic Functions */ @@ -29,27 +26,6 @@ #include "H5Iprivate.h" /* IDs */ #include "H5Tpkg.h" /* Datatypes */ - -/*-------------------------------------------------------------------------- -NAME - H5T_init_strpad_interface -- Initialize interface-specific information -USAGE - herr_t H5T_init_strpad_interface() - -RETURNS - Non-negative on success/Negative on failure -DESCRIPTION - Initializes any interface-specific data or routines. (Just calls - H5T_init_iterface currently). - ---------------------------------------------------------------------------*/ -static herr_t -H5T_init_strpad_interface(void) -{ - FUNC_ENTER_NOAPI_NOINIT_NOERR - - FUNC_LEAVE_NOAPI(H5T_init()) -} /* H5T_init_strpad_interface() */ /*------------------------------------------------------------------------- diff --git a/src/H5Tvisit.c b/src/H5Tvisit.c index 4ede3f3..d732fb3 100644 --- a/src/H5Tvisit.c +++ b/src/H5Tvisit.c @@ -35,7 +35,7 @@ /* Module Setup */ /****************/ -#define H5T_PACKAGE /*suppress error about including H5Tpkg */ +#include "H5Tmodule.h" /* This source code file is part of the H5T module */ /***********/ diff --git a/src/H5Tvlen.c b/src/H5Tvlen.c index 64337b8..26346d6 100644 --- a/src/H5Tvlen.c +++ b/src/H5Tvlen.c @@ -18,10 +18,7 @@ * datatypes in the H5T interface. */ -#define H5T_PACKAGE /*suppress error about including H5Tpkg */ - -/* Interface initialization */ -#define H5_INTERFACE_INIT_FUNC H5T_init_vlen_interface +#include "H5Tmodule.h" /* This source code file is part of the H5T module */ #include "H5private.h" /* Generic Functions */ @@ -64,27 +61,6 @@ static H5T_vlen_alloc_info_t H5T_vlen_def_vl_alloc_info ={ H5D_VLEN_FREE_INFO }; - -/*-------------------------------------------------------------------------- -NAME - H5T_init_vlen_interface -- Initialize interface-specific information -USAGE - herr_t H5T_init_vlen_interface() - -RETURNS - Non-negative on success/Negative on failure -DESCRIPTION - Initializes any interface-specific data or routines. (Just calls - H5T_init_iterface currently). - ---------------------------------------------------------------------------*/ -static herr_t -H5T_init_vlen_interface(void) -{ - FUNC_ENTER_NOAPI_NOINIT_NOERR - - FUNC_LEAVE_NOAPI(H5T_init()) -} /* H5T_init_vlen_interface() */ /*------------------------------------------------------------------------- @@ -147,8 +123,8 @@ done: H5T_t * H5T__vlen_create(const H5T_t *base) { - H5T_t *dt = NULL; /*new VL datatype */ - H5T_t *ret_value; /*return value */ + H5T_t *dt = NULL; /* New VL datatype */ + H5T_t *ret_value = NULL; /* Return value */ FUNC_ENTER_PACKAGE @@ -781,7 +757,7 @@ static ssize_t H5T_vlen_disk_getlen(const void *_vl) { const uint8_t *vl=(const uint8_t *)_vl; /* Pointer to the disk VL information */ - size_t seq_len; /* Sequence length */ + size_t seq_len = 0; /* Sequence length */ FUNC_ENTER_NOAPI_NOINIT_NOERR diff --git a/src/H5Z.c b/src/H5Z.c index 01f5216..a47c6ca 100644 --- a/src/H5Z.c +++ b/src/H5Z.c @@ -13,10 +13,7 @@ * access to either file, you may request a copy from help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#define H5Z_PACKAGE /*suppress error about including H5Zpkg */ - -/* Interface initialization */ -#define H5_INTERFACE_INIT_FUNC H5Z_init_interface +#include "H5Zmodule.h" /* This source code file is part of the H5Z module */ #include "H5private.h" /* Generic Functions */ @@ -57,6 +54,9 @@ typedef enum { H5Z_PRELUDE_SET_LOCAL /* Call "set local" callback */ } H5Z_prelude_type_t; +/* Package initialization variable */ +hbool_t H5_PKG_INIT_VAR = FALSE; + /* Local variables */ static size_t H5Z_table_alloc_g = 0; static size_t H5Z_table_used_g = 0; @@ -73,7 +73,7 @@ static int H5Z__flush_file_cb(void *obj_ptr, hid_t obj_id, void *key); /*------------------------------------------------------------------------- - * Function: H5Z_init_interface + * Function: H5Z__init_package * * Purpose: Initializes the data filter layer. * @@ -82,45 +82,43 @@ static int H5Z__flush_file_cb(void *obj_ptr, hid_t obj_id, void *key); * Programmer: Robb Matzke * Thursday, April 16, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ -static herr_t -H5Z_init_interface (void) +herr_t +H5Z__init_package(void) { - herr_t ret_value=SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* Internal filters */ - if (H5Z_register (H5Z_SHUFFLE)<0) - HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register shuffle filter") - if (H5Z_register (H5Z_FLETCHER32)<0) - HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register fletcher32 filter") - if (H5Z_register (H5Z_NBIT)<0) - HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register nbit filter") - if (H5Z_register (H5Z_SCALEOFFSET)<0) - HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register scaleoffset filter") + if(H5Z_register(H5Z_SHUFFLE) < 0) + HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register shuffle filter") + if(H5Z_register(H5Z_FLETCHER32) < 0) + HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register fletcher32 filter") + if(H5Z_register(H5Z_NBIT) < 0) + HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register nbit filter") + if(H5Z_register(H5Z_SCALEOFFSET) < 0) + HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register scaleoffset filter") /* External filters */ #ifdef H5_HAVE_FILTER_DEFLATE - if (H5Z_register (H5Z_DEFLATE)<0) + if(H5Z_register(H5Z_DEFLATE) < 0) HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register deflate filter") #endif /* H5_HAVE_FILTER_DEFLATE */ #ifdef H5_HAVE_FILTER_SZIP H5Z_SZIP->encoder_present = SZ_encoder_enabled(); - if (H5Z_register (H5Z_SZIP)<0) + if(H5Z_register(H5Z_SZIP) < 0) HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register szip filter") #endif /* H5_HAVE_FILTER_SZIP */ done: FUNC_LEAVE_NOAPI(ret_value) -} +} /* end H5Z__init_package() */ /*------------------------------------------------------------------------- - * Function: H5Z_term_interface + * Function: H5Z_term_package * * Purpose: Terminate the H5Z layer. * @@ -129,44 +127,44 @@ done: * Programmer: Robb Matzke * Thursday, April 16, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ int -H5Z_term_interface(void) +H5Z_term_package(void) { -#ifdef H5Z_DEBUG - size_t i; - int dir, nprint=0; - char comment[16], bandwidth[32]; -#endif + int n = 0; + + FUNC_ENTER_NOAPI_NOINIT_NOERR - if(H5_interface_initialize_g) { + if(H5_PKG_INIT_VAR) { #ifdef H5Z_DEBUG - if (H5DEBUG(Z)) { - for (i=0; i", comment, H5Z_stat_table_g[i].stats[dir].total, @@ -187,21 +185,28 @@ H5Z_term_interface(void) H5Z_stat_table_g[i].stats[dir].timer.stime, H5Z_stat_table_g[i].stats[dir].timer.etime, bandwidth); - } - } - } + } /* end for */ + } /* end for */ + } /* end if */ #endif /* H5Z_DEBUG */ /* Free the table of filters */ - H5Z_table_g = (H5Z_class2_t *)H5MM_xfree(H5Z_table_g); + if(H5Z_table_g) { + H5Z_table_g = (H5Z_class2_t *)H5MM_xfree(H5Z_table_g); #ifdef H5Z_DEBUG - H5Z_stat_table_g = (H5Z_stats_t *)H5MM_xfree(H5Z_stat_table_g); + H5Z_stat_table_g = (H5Z_stats_t *)H5MM_xfree(H5Z_stat_table_g); #endif /* H5Z_DEBUG */ - H5Z_table_used_g = H5Z_table_alloc_g = 0; - H5_interface_initialize_g = 0; + H5Z_table_used_g = H5Z_table_alloc_g = 0; + + n++; + } /* end if */ + + /* Mark interface as closed */ + if(0 == n) + H5_PKG_INIT_VAR = FALSE; } /* end if */ - return(0); -} /* end H5Z_term_interface() */ + FUNC_LEAVE_NOAPI(n) +} /* end H5Z_term_package() */ /*------------------------------------------------------------------------- @@ -1445,8 +1450,8 @@ done: H5Z_filter_info_t * H5Z_filter_info(const H5O_pline_t *pline, H5Z_filter_t filter) { - size_t idx; /* Index of filter in pipeline */ - H5Z_filter_info_t *ret_value; /* Return value */ + size_t idx; /* Index of filter in pipeline */ + H5Z_filter_info_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI(NULL) diff --git a/src/H5Zdeflate.c b/src/H5Zdeflate.c index 06d9866..15aac27 100644 --- a/src/H5Zdeflate.c +++ b/src/H5Zdeflate.c @@ -18,7 +18,7 @@ * Friday, August 27, 1999 */ -#define H5Z_PACKAGE /*suppress error about including H5Zpkg */ +#include "H5Zmodule.h" /* This source code file is part of the H5Z module */ #include "H5private.h" /* Generic Functions */ @@ -77,7 +77,7 @@ H5Z_filter_deflate (unsigned flags, size_t cd_nelmts, { void *outbuf = NULL; /* Pointer to new buffer */ int status; /* Status from zlib operation */ - size_t ret_value; /* Return value */ + size_t ret_value = 0; /* Return value */ FUNC_ENTER_NOAPI(0) diff --git a/src/H5Zfletcher32.c b/src/H5Zfletcher32.c index 1877ddd..690d7a2 100644 --- a/src/H5Zfletcher32.c +++ b/src/H5Zfletcher32.c @@ -14,11 +14,11 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Raymond Lu + * Programmer: Raymond Lu * Jan 3, 2003 */ -#define H5Z_PACKAGE /*suppress error about including H5Zpkg */ +#include "H5Zmodule.h" /* This source code file is part of the H5Z module */ #include "H5private.h" /* Generic Functions */ @@ -81,7 +81,7 @@ H5Z_filter_fletcher32 (unsigned flags, size_t H5_ATTR_UNUSED cd_nelmts, const un uint32_t reversed_fletcher; /* Possible wrong checksum value */ uint8_t c[4]; uint8_t tmp; - size_t ret_value; /* Return value */ + size_t ret_value = 0; /* Return value */ FUNC_ENTER_NOAPI(0) diff --git a/src/H5Zmodule.h b/src/H5Zmodule.h new file mode 100644 index 0000000..fa0ef8f --- /dev/null +++ b/src/H5Zmodule.h @@ -0,0 +1,35 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* + * Programmer: Quincey Koziol + * Saturday, September 12, 2015 + * + * Purpose: This file contains declarations which define macros for the + * H5Z package. Including this header means that the source file + * is part of the H5Z package. + */ +#ifndef _H5Zmodule_H +#define _H5Zmodule_H + +/* Define the proper control macros for the generic FUNC_ENTER/LEAVE and error + * reporting macros. + */ +#define H5Z_MODULE +#define H5_MY_PKG H5Z +#define H5_MY_PKG_ERR H5E_PLINE +#define H5_MY_PKG_INIT YES + +#endif /* _H5Zmodule_H */ + diff --git a/src/H5Znbit.c b/src/H5Znbit.c index 479cd6c..e2fb300 100644 --- a/src/H5Znbit.c +++ b/src/H5Znbit.c @@ -13,7 +13,7 @@ * access to either file, you may request a copy from help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#define H5Z_PACKAGE /*suppress error about including H5Zpkg */ +#include "H5Zmodule.h" /* This source code file is part of the H5Z module */ #include "H5private.h" /* Generic Functions */ #include "H5Eprivate.h" /* Error handling */ diff --git a/src/H5Zpkg.h b/src/H5Zpkg.h index e2cec89..aa2ffe2 100644 --- a/src/H5Zpkg.h +++ b/src/H5Zpkg.h @@ -13,7 +13,7 @@ * access to either file, you may request a copy from help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#ifndef H5Z_PACKAGE +#if !(defined H5Z_FRIEND || defined H5Z_MODULE) #error "Do not include this file outside the H5Z package!" #endif diff --git a/src/H5Zscaleoffset.c b/src/H5Zscaleoffset.c index 46dd3c1..7de0060 100644 --- a/src/H5Zscaleoffset.c +++ b/src/H5Zscaleoffset.c @@ -13,7 +13,7 @@ * access to either file, you may request a copy from help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#define H5Z_PACKAGE /*suppress error about including H5Zpkg */ +#include "H5Zmodule.h" /* This source code file is part of the H5Z module */ #include "H5private.h" /* Generic Functions */ #include "H5ACprivate.h" /* Metadata cache */ @@ -746,7 +746,7 @@ static enum H5Z_scaleoffset_t H5Z_scaleoffset_get_type(unsigned dtype_class, unsigned dtype_size, unsigned dtype_sign) { enum H5Z_scaleoffset_t type = t_bad; /* integer type */ - enum H5Z_scaleoffset_t ret_value; /* return value */ + enum H5Z_scaleoffset_t ret_value = t_bad; /* Return value */ FUNC_ENTER_NOAPI_NOINIT diff --git a/src/H5Zshuffle.c b/src/H5Zshuffle.c index 654a7d5..3fa6c8d 100644 --- a/src/H5Zshuffle.c +++ b/src/H5Zshuffle.c @@ -13,7 +13,7 @@ * access to either file, you may request a copy from help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#define H5Z_PACKAGE /*suppress error about including H5Zpkg */ +#include "H5Zmodule.h" /* This source code file is part of the H5Z module */ #include "H5private.h" /* Generic Functions */ @@ -135,7 +135,7 @@ H5Z_filter_shuffle(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], size_t j; /* Local index variable */ #endif /* NO_DUFFS_DEVICE */ size_t leftover; /* Extra bytes at end of buffer */ - size_t ret_value; /* Return value */ + size_t ret_value = 0; /* Return value */ FUNC_ENTER_NOAPI(0) diff --git a/src/H5Zszip.c b/src/H5Zszip.c index f0d08d8..2c2ed07 100644 --- a/src/H5Zszip.c +++ b/src/H5Zszip.c @@ -13,7 +13,7 @@ * access to either file, you may request a copy from help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#define H5Z_PACKAGE /*suppress error about including H5Zpkg */ +#include "H5Zmodule.h" /* This source code file is part of the H5Z module */ #include "H5private.h" /* Generic Functions */ diff --git a/src/H5Ztrans.c b/src/H5Ztrans.c index db61cc5..3aed993 100644 --- a/src/H5Ztrans.c +++ b/src/H5Ztrans.c @@ -13,7 +13,7 @@ * access to either file, you may request a copy from help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#define H5Z_PACKAGE /*suppress error about including H5Zpkg */ +#include "H5Zmodule.h" /* This source code file is part of the H5Z module */ #include "H5private.h" /* Generic Functions */ @@ -542,7 +542,7 @@ static void * H5Z_xform_parse(const char *expression, H5Z_datval_ptrs* dat_val_pointers) { H5Z_token tok; - void* ret_value; + void *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI(NULL) @@ -581,7 +581,7 @@ static H5Z_node * H5Z_parse_expression(H5Z_token *current, H5Z_datval_ptrs* dat_val_pointers) { H5Z_node *expr; - H5Z_node *ret_value; /* Return value */ + H5Z_node *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -675,7 +675,7 @@ static H5Z_node * H5Z_parse_term(H5Z_token *current, H5Z_datval_ptrs* dat_val_pointers) { H5Z_node *term = NULL; - H5Z_node *ret_value; + H5Z_node *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -775,7 +775,7 @@ H5Z_parse_factor(H5Z_token *current, H5Z_datval_ptrs* dat_val_pointers) { H5Z_node *factor=NULL; H5Z_node *new_node; - H5Z_node *ret_value; + H5Z_node *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -917,7 +917,7 @@ done: static H5Z_node * H5Z_new_node(H5Z_token_type type) { - H5Z_node *ret_value; + H5Z_node *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -1477,10 +1477,10 @@ H5Z_do_op(H5Z_node* tree) H5Z_data_xform_t * H5Z_xform_create(const char *expr) { - H5Z_data_xform_t *data_xform_prop=NULL; - H5Z_data_xform_t *ret_value; + H5Z_data_xform_t *data_xform_prop = NULL; unsigned int i; unsigned int count = 0; + H5Z_data_xform_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI(NULL) @@ -1696,7 +1696,7 @@ done: hbool_t H5Z_xform_noop(const H5Z_data_xform_t *data_xform_prop) { - hbool_t ret_value; + hbool_t ret_value = FALSE; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_NOERR diff --git a/src/H5detect.c b/src/H5detect.c index 5daf883..ee02c52 100644 --- a/src/H5detect.c +++ b/src/H5detect.c @@ -608,7 +608,7 @@ print_results(int nd, detected_t *d, int na, malign_t *misc_align) /* Module Setup */\n\ /****************/\n\ \n\ -#define H5T_PACKAGE /*suppress error about including H5Tpkg.h*/\n\ +#include \"H5Tmodule.h\" /* This source code file is part of the H5T module */\n\ \n\ \n\ /***********/\n\ @@ -667,7 +667,7 @@ print_results(int nd, detected_t *d, int na, malign_t *misc_align) printf("\n\ \n\ /*-------------------------------------------------------------------------\n\ - * Function: H5TN_init_interface\n\ + * Function: H5T__init_native\n\ *\n\ * Purpose: Initialize pre-defined native datatypes from code generated\n\ * during the library configuration by H5detect.\n\ @@ -681,12 +681,12 @@ print_results(int nd, detected_t *d, int na, malign_t *misc_align) *-------------------------------------------------------------------------\n\ */\n\ herr_t\n\ -H5TN_init_interface(void)\n\ +H5T__init_native(void)\n\ {\n\ H5T_t *dt = NULL;\n\ herr_t ret_value = SUCCEED;\n\ \n\ - FUNC_ENTER_NOAPI(FAIL)\n"); + FUNC_ENTER_PACKAGE\n"); for(i = 0; i < nd; i++) { /* The native endianess of this machine */ @@ -809,7 +809,7 @@ done:\n\ } /* end if */\n\ } /* end if */\n\ \n\ - FUNC_LEAVE_NOAPI(ret_value);\n} /* end H5TN_init_interface() */\n"); + FUNC_LEAVE_NOAPI(ret_value);\n} /* end H5T__init_native() */\n"); /* Print the ALIGNMENT and signal-handling status as comments */ printf("\n" diff --git a/src/H5private.h b/src/H5private.h index 738d4ff..56061bf 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -1463,6 +1463,16 @@ extern char *strdup(const char *s); #define HDpthread_self_ulong() ((unsigned long)pthread_self()) #endif /* HDpthread_self_ulong */ +/* Macro for "stringizing" an integer in the C preprocessor (use H5_TOSTRING) */ +/* (use H5_TOSTRING, H5_STRINGIZE is just part of the implementation) */ +#define H5_STRINGIZE(x) #x +#define H5_TOSTRING(x) H5_STRINGIZE(x) + +/* Macro for "glueing" together items, for re-scanning macros */ +#define H5_GLUE(x,y) x##y +#define H5_GLUE3(x,y,z) x##y##z +#define H5_GLUE4(w,x,y,z) w##x##y##z + /* * A macro for detecting over/under-flow when casting between types */ @@ -1782,10 +1792,12 @@ extern char H5_lib_vers_info_g[]; typedef struct H5_api_struct { H5TS_mutex_t init_lock; /* API entrance mutex */ hbool_t H5_libinit_g; /* Has the library been initialized? */ + hbool_t H5_libterm_g; /* Is the library being shutdown? */ } H5_api_t; /* Macros for accessing the global variables */ -#define H5_INIT_GLOBAL H5_g.H5_libinit_g +#define H5_INIT_GLOBAL (H5_g.H5_libinit_g) +#define H5_TERM_GLOBAL (H5_g.H5_libterm_g) /* Macro for first thread initialization */ #ifdef H5_HAVE_WIN_THREADS @@ -1824,9 +1836,11 @@ extern H5_api_t H5_g; /* extern global variables */ extern hbool_t H5_libinit_g; /* Has the library been initialized? */ +extern hbool_t H5_libterm_g; /* Is the library being shutdown? */ /* Macros for accessing the global variables */ -#define H5_INIT_GLOBAL H5_libinit_g +#define H5_INIT_GLOBAL (H5_libinit_g) +#define H5_TERM_GLOBAL (H5_libterm_g) #endif /* H5_HAVE_THREADSAFE */ @@ -1846,101 +1860,110 @@ extern hbool_t H5_libinit_g; /* Has the library been initialized? */ extern hbool_t H5_MPEinit_g; /* Has the MPE Library been initialized? */ #endif -/* Macros for defining interface initialization routines */ -#ifdef H5_INTERFACE_INIT_FUNC -static int H5_interface_initialize_g = 0; -static herr_t H5_INTERFACE_INIT_FUNC(void); -#define H5_INTERFACE_INIT(err) \ - /* Initialize this interface or bust */ \ - if (!H5_interface_initialize_g) { \ - H5_interface_initialize_g = 1; \ - if (H5_INTERFACE_INIT_FUNC()<0) { \ - H5_interface_initialize_g = 0; \ - HGOTO_ERROR (H5E_FUNC, H5E_CANTINIT, err, \ - "interface initialization failed") \ - } \ - } -#else /* H5_INTERFACE_INIT_FUNC */ -#define H5_INTERFACE_INIT(err) -#endif /* H5_INTERFACE_INIT_FUNC */ +/* Macros for referencing package initialization symbols */ +#define H5_PACKAGE_INIT_VAR(x) H5_GLUE(x, _init_g) +#define H5_PACKAGE_INIT_FUNC(x) H5_GLUE(x, __init_package) + +/* Macros for defining package initialization routines */ +#ifdef H5_MY_PKG +#define H5_PKG_INIT_VAR H5_PACKAGE_INIT_VAR(H5_MY_PKG) +#define H5_PKG_INIT_FUNC H5_PACKAGE_INIT_FUNC(H5_MY_PKG) +#define H5_PACKAGE_YES_INIT(err) \ + /* Initialize this interface or bust */ \ + if(!H5_PKG_INIT_VAR && !H5_TERM_GLOBAL) { \ + H5_PKG_INIT_VAR = TRUE; \ + if(H5_PKG_INIT_FUNC() < 0) { \ + H5_PKG_INIT_VAR = FALSE; \ + HGOTO_ERROR(H5E_FUNC, H5E_CANTINIT, err, "interface initialization failed") \ + } \ + } +#define H5_PACKAGE_NO_INIT(err) \ + /* Initialize this interface or bust */ \ + if(!H5_PKG_INIT_VAR && !H5_TERM_GLOBAL) \ + H5_PKG_INIT_VAR = TRUE; +#define H5_PACKAGE_INIT(pkg_init, err) H5_GLUE3(H5_PACKAGE_, pkg_init, _INIT)(err) +#else /* H5_MY_PKG */ +#define H5_PKG_INIT_VAR (TRUE) +#define H5_PACKAGE_INIT(pkg_init, err) +#endif /* H5_MY_PKG */ #ifndef NDEBUG -#define FUNC_ENTER_CHECK_NAME(asrt) \ - { \ - static hbool_t func_check = FALSE; \ +#define FUNC_ENTER_CHECK_NAME(asrt) \ + { \ + static hbool_t func_check = FALSE; \ \ - if(!func_check) { \ - /* Check function naming status */ \ - HDassert(asrt); \ + if(!func_check) { \ + /* Check function naming status */ \ + HDassert(asrt); \ \ - /* Don't check again */ \ - func_check = TRUE; \ - } /* end if */ \ + /* Don't check again */ \ + func_check = TRUE; \ + } /* end if */ \ } /* end scope */ #else /* NDEBUG */ #define FUNC_ENTER_CHECK_NAME(asrt) #endif /* NDEBUG */ -#define FUNC_ENTER_COMMON(asrt) \ - hbool_t err_occurred = FALSE; \ +#define FUNC_ENTER_COMMON(asrt) \ + hbool_t err_occurred = FALSE; \ + \ FUNC_ENTER_CHECK_NAME(asrt); -#define FUNC_ENTER_COMMON_NOERR(asrt) \ +#define FUNC_ENTER_COMMON_NOERR(asrt) \ FUNC_ENTER_CHECK_NAME(asrt); /* Threadsafety initialization code for API routines */ #define FUNC_ENTER_API_THREADSAFE \ - /* Initialize the thread-safe code */ \ + /* Initialize the thread-safe code */ \ H5_FIRST_THREAD_INIT \ - \ - /* Grab the mutex for the library */ \ + \ + /* Grab the mutex for the library */ \ H5_API_UNSET_CANCEL \ H5_API_LOCK /* Local variables for API routines */ #define FUNC_ENTER_API_VARS \ - MPE_LOG_VARS \ + MPE_LOG_VARS \ H5TRACE_DECL -#define FUNC_ENTER_API_COMMON \ +#define FUNC_ENTER_API_COMMON \ FUNC_ENTER_API_VARS \ - FUNC_ENTER_COMMON(H5_IS_API(FUNC)); \ + FUNC_ENTER_COMMON(H5_IS_API(FUNC)); \ FUNC_ENTER_API_THREADSAFE; -#define FUNC_ENTER_API_INIT(err) \ - /* Initialize the library */ \ - if(!(H5_INIT_GLOBAL)) { \ - H5_INIT_GLOBAL = TRUE; \ - if(H5_init_library() < 0) \ - HGOTO_ERROR(H5E_FUNC, H5E_CANTINIT, err, \ - "library initialization failed") \ - } \ +#define FUNC_ENTER_API_INIT(err) \ + /* Initialize the library */ \ + if(!H5_INIT_GLOBAL && !H5_TERM_GLOBAL) { \ + H5_INIT_GLOBAL = TRUE; \ + if(H5_init_library() < 0) \ + HGOTO_ERROR(H5E_FUNC, H5E_CANTINIT, err, "library initialization failed") \ + } /* end if */ \ \ - /* Initialize the interface, if appropriate */ \ - H5_INTERFACE_INIT(err) \ + /* Initialize the package, if appropriate */ \ + H5_PACKAGE_INIT(H5_MY_PKG_INIT, err) \ \ - /* Push the name of this function on the function stack */ \ - H5_PUSH_FUNC \ + /* Push the name of this function on the function stack */ \ + H5_PUSH_FUNC \ \ - BEGIN_MPE_LOG + BEGIN_MPE_LOG /* Use this macro for all "normal" API functions */ -#define FUNC_ENTER_API(err) {{ \ +#define FUNC_ENTER_API(err) {{ \ FUNC_ENTER_API_COMMON \ - FUNC_ENTER_API_INIT(err); \ - /* Clear thread error stack entering public functions */ \ - H5E_clear_stack(NULL); \ + FUNC_ENTER_API_INIT(err); \ + /* Clear thread error stack entering public functions */ \ + H5E_clear_stack(NULL); \ { /* * Use this macro for API functions that shouldn't clear the error stack * like H5Eprint and H5Ewalk. */ -#define FUNC_ENTER_API_NOCLEAR(err) {{ \ +#define FUNC_ENTER_API_NOCLEAR(err) {{ \ FUNC_ENTER_API_COMMON \ - FUNC_ENTER_API_INIT(err); \ + FUNC_ENTER_API_INIT(err); \ { /* @@ -1949,7 +1972,7 @@ static herr_t H5_INTERFACE_INIT_FUNC(void); * are: H5check_version, etc. * */ -#define FUNC_ENTER_API_NOINIT {{ \ +#define FUNC_ENTER_API_NOINIT {{ \ FUNC_ENTER_API_COMMON \ H5_PUSH_FUNC \ BEGIN_MPE_LOG \ @@ -1962,38 +1985,120 @@ static herr_t H5_INTERFACE_INIT_FUNC(void); * are: H5close, H5check_version, etc. * */ -#define FUNC_ENTER_API_NOINIT_NOERR_NOFS {{ \ +#define FUNC_ENTER_API_NOINIT_NOERR_NOFS {{ \ FUNC_ENTER_API_VARS \ - FUNC_ENTER_COMMON_NOERR(H5_IS_API(FUNC)); \ - FUNC_ENTER_API_THREADSAFE; \ + FUNC_ENTER_COMMON_NOERR(H5_IS_API(FUNC)); \ + FUNC_ENTER_API_THREADSAFE; \ BEGIN_MPE_LOG \ { /* Note: this macro only works when there's _no_ interface initialization routine for the module */ -#define FUNC_ENTER_NOAPI_INIT(err) \ - /* Initialize the interface, if appropriate */ \ - H5_INTERFACE_INIT(err) \ +#define FUNC_ENTER_NOAPI_INIT(err) \ + /* Initialize the package, if appropriate */ \ + H5_PACKAGE_INIT(H5_MY_PKG_INIT, err) \ \ - /* Push the name of this function on the function stack */ \ - H5_PUSH_FUNC + /* Push the name of this function on the function stack */ \ + H5_PUSH_FUNC /* Use this macro for all "normal" non-API functions */ -#define FUNC_ENTER_NOAPI(err) { \ - FUNC_ENTER_COMMON(!H5_IS_API(FUNC)); \ - FUNC_ENTER_NOAPI_INIT(err) \ - { +#define FUNC_ENTER_NOAPI(err) { \ + FUNC_ENTER_COMMON(!H5_IS_API(FUNC)); \ + FUNC_ENTER_NOAPI_INIT(err) \ + if(H5_PKG_INIT_VAR || !H5_TERM_GLOBAL) { + +/* Use this macro for all non-API functions, which propagate errors, but don't issue them */ +#define FUNC_ENTER_NOAPI_NOERR { \ + FUNC_ENTER_COMMON_NOERR(!H5_IS_API(FUNC)); \ + FUNC_ENTER_NOAPI_INIT(-) \ + if(H5_PKG_INIT_VAR || !H5_TERM_GLOBAL) { + +/* + * Use this macro for non-API functions which fall into these categories: + * - static functions, since they must be called from a function in the + * interface, the library and interface must already be + * initialized. + * - functions which are called during library shutdown, since we don't + * want to re-initialize the library. + */ +#define FUNC_ENTER_NOAPI_NOINIT { \ + FUNC_ENTER_COMMON(!H5_IS_API(FUNC)); \ + H5_PUSH_FUNC \ + if(H5_PKG_INIT_VAR || !H5_TERM_GLOBAL) { + +/* + * Use this macro for non-API functions which fall into these categories: + * - static functions, since they must be called from a function in the + * interface, the library and interface must already be + * initialized. + * - functions which are called during library shutdown, since we don't + * want to re-initialize the library. + * - functions that propagate, but don't issue errors + */ +#define FUNC_ENTER_NOAPI_NOINIT_NOERR { \ + FUNC_ENTER_COMMON_NOERR(!H5_IS_API(FUNC)); \ + H5_PUSH_FUNC \ + if(H5_PKG_INIT_VAR || !H5_TERM_GLOBAL) { + +/* + * Use this macro for non-API functions which fall into these categories: + * - functions which shouldn't push their name on the function stack + * (so far, just the H5CS routines themselves) + * + */ +#define FUNC_ENTER_NOAPI_NOFS { \ + FUNC_ENTER_COMMON(!H5_IS_API(FUNC)); \ + \ + /* Initialize the package, if appropriate */ \ + H5_PACKAGE_INIT(H5_MY_PKG_INIT, err) \ + if(H5_PKG_INIT_VAR || !H5_TERM_GLOBAL) { + +/* + * Use this macro for non-API functions which fall into these categories: + * - functions which shouldn't push their name on the function stack + * (so far, just the H5CS routines themselves) + * + * This macro is used for functions which fit the above categories _and_ + * also don't use the 'FUNC' variable (i.e. don't push errors on the error stack) + * + */ +#define FUNC_ENTER_NOAPI_NOERR_NOFS { \ + FUNC_ENTER_COMMON_NOERR(!H5_IS_API(FUNC)); \ + if(H5_PKG_INIT_VAR || !H5_TERM_GLOBAL) { + +/* Use the following two macros as replacements for the FUNC_ENTER_NOAPI + * and FUNC_ENTER_NOAPI_NOINIT macros when the function needs to set + * up a metadata tag. */ +#define FUNC_ENTER_NOAPI_TAG(dxpl_id, tag, err) { \ + haddr_t prev_tag = HADDR_UNDEF; \ + hid_t tag_dxpl_id = dxpl_id; \ + \ + FUNC_ENTER_COMMON(!H5_IS_API(FUNC)); \ + if(H5AC_tag(tag_dxpl_id, tag, &prev_tag)<0) \ + HGOTO_ERROR(H5_MY_PKG_ERR, H5E_CANTTAG, err, "unable to apply metadata tag") \ + FUNC_ENTER_NOAPI_INIT(err) \ + if(H5_PKG_INIT_VAR || !H5_TERM_GLOBAL) { + +#define FUNC_ENTER_NOAPI_NOINIT_TAG(dxpl_id, tag, err) { \ + haddr_t prev_tag = HADDR_UNDEF; \ + hid_t tag_dxpl_id = dxpl_id; \ + \ + FUNC_ENTER_COMMON(!H5_IS_API(FUNC)); \ + if(H5AC_tag(tag_dxpl_id, tag, &prev_tag)<0) \ + HGOTO_ERROR(H5_MY_PKG_ERR, H5E_CANTTAG, err, "unable to apply metadata tag") \ + H5_PUSH_FUNC \ + if(H5_PKG_INIT_VAR || !H5_TERM_GLOBAL) { /* Use this macro for all "normal" package-level functions */ #define FUNC_ENTER_PACKAGE { \ FUNC_ENTER_COMMON(H5_IS_PKG(FUNC)); \ H5_PUSH_FUNC \ - { + if(H5_PKG_INIT_VAR || !H5_TERM_GLOBAL) { /* Use this macro for package-level functions which propgate errors, but don't issue them */ #define FUNC_ENTER_PACKAGE_NOERR { \ FUNC_ENTER_COMMON_NOERR(H5_IS_PKG(FUNC)); \ H5_PUSH_FUNC \ - { + if(H5_PKG_INIT_VAR || !H5_TERM_GLOBAL) { /* Use the following macro as replacement for the FUNC_ENTER_PACKAGE * macro when the function needs to set up a metadata tag. */ @@ -2003,21 +2108,27 @@ static herr_t H5_INTERFACE_INIT_FUNC(void); \ FUNC_ENTER_COMMON(H5_IS_PKG(FUNC)); \ if(H5AC_tag(tag_dxpl_id, tag, &prev_tag) < 0) \ - HGOTO_ERROR(H5E_CACHE, H5E_CANTTAG, err, "unable to apply metadata tag") \ + HGOTO_ERROR(H5_MY_PKG_ERR, H5E_CANTTAG, err, "unable to apply metadata tag") \ H5_PUSH_FUNC \ - { + if(H5_PKG_INIT_VAR || !H5_TERM_GLOBAL) { /* Use this macro for all "normal" staticly-scoped functions */ #define FUNC_ENTER_STATIC { \ FUNC_ENTER_COMMON(H5_IS_PKG(FUNC)); \ H5_PUSH_FUNC \ - { + if(H5_PKG_INIT_VAR || !H5_TERM_GLOBAL) { /* Use this macro for staticly-scoped functions which propgate errors, but don't issue them */ #define FUNC_ENTER_STATIC_NOERR { \ FUNC_ENTER_COMMON_NOERR(H5_IS_PKG(FUNC)); \ H5_PUSH_FUNC \ - { + if(H5_PKG_INIT_VAR || !H5_TERM_GLOBAL) { + +/* Use this macro for staticly-scoped functions which propgate errors, but don't issue them */ +/* And that shouldn't push their name on the function stack */ +#define FUNC_ENTER_STATIC_NOERR_NOFS { \ + FUNC_ENTER_COMMON_NOERR(H5_IS_PKG(FUNC)); \ + if(H5_PKG_INIT_VAR || !H5_TERM_GLOBAL) { /* Use the following macro as replacement for the FUNC_ENTER_STATIC * macro when the function needs to set up a metadata tag. */ @@ -2027,76 +2138,9 @@ static herr_t H5_INTERFACE_INIT_FUNC(void); \ FUNC_ENTER_COMMON(H5_IS_PKG(FUNC)); \ if(H5AC_tag(tag_dxpl_id, tag, &prev_tag) < 0) \ - HGOTO_ERROR(H5E_CACHE, H5E_CANTTAG, err, "unable to apply metadata tag") \ + HGOTO_ERROR(H5_MY_PKG_ERR, H5E_CANTTAG, err, "unable to apply metadata tag") \ H5_PUSH_FUNC \ - { - -/* Use this macro for all non-API functions, which propagate errors, but don't issue them */ -#define FUNC_ENTER_NOAPI_NOERR { \ - FUNC_ENTER_COMMON_NOERR(!H5_IS_API(FUNC)); \ - FUNC_ENTER_NOAPI_INIT(-) \ - { - -/* - * Use this macro for non-API functions which fall into these categories: - * - static functions, since they must be called from a function in the - * interface, the library and interface must already be - * initialized. - * - functions which are called during library shutdown, since we don't - * want to re-initialize the library. - */ -#define FUNC_ENTER_NOAPI_NOINIT { \ - FUNC_ENTER_COMMON(!H5_IS_API(FUNC)); \ - H5_PUSH_FUNC \ - { - -/* - * Use this macro for non-API functions which fall into these categories: - * - static functions, since they must be called from a function in the - * interface, the library and interface must already be - * initialized. - * - functions which are called during library shutdown, since we don't - * want to re-initialize the library. - * - functions that propagate, but don't issue errors - */ -#define FUNC_ENTER_NOAPI_NOINIT_NOERR { \ - FUNC_ENTER_COMMON_NOERR(!H5_IS_API(FUNC)); \ - H5_PUSH_FUNC \ - { - -/* - * Use this macro for non-API functions which fall into these categories: - * - functions which shouldn't push their name on the function stack - * (so far, just the H5CS routines themselves) - * - * This macro is used for functions which fit the above categories _and_ - * also don't use the 'FUNC' variable (i.e. don't push errors on the error stack) - * - */ -#define FUNC_ENTER_NOAPI_NOERR_NOFS { \ - FUNC_ENTER_COMMON_NOERR(!H5_IS_API(FUNC)); \ - { - -/* Use the following two macros as replacements for the FUNC_ENTER_NOAPI - * and FUNC_ENTER_NOAPI_NOINIT macros when the function needs to set - * up a metadata tag. */ -#define FUNC_ENTER_NOAPI_TAG(dxpl_id, tag, err) { \ - haddr_t prev_tag = HADDR_UNDEF; \ - hid_t tag_dxpl_id = dxpl_id; \ - FUNC_ENTER_COMMON(!H5_IS_API(FUNC)); \ - if(H5AC_tag(tag_dxpl_id, tag, &prev_tag)<0) \ - HGOTO_ERROR(H5E_CACHE, H5E_CANTTAG, err, "unable to apply metadata tag") \ - FUNC_ENTER_NOAPI_INIT(err) \ - { - -#define FUNC_ENTER_NOAPI_NOINIT_TAG(dxpl_id, tag, err) { \ - haddr_t prev_tag = HADDR_UNDEF; \ - hid_t tag_dxpl_id = dxpl_id; \ - FUNC_ENTER_COMMON(!H5_IS_API(FUNC)); \ - if(H5AC_tag(tag_dxpl_id, tag, &prev_tag)<0) \ - HGOTO_ERROR(H5E_CACHE, H5E_CANTTAG, err, "unable to apply metadata tag") \ - H5_PUSH_FUNC \ - { + if(H5_PKG_INIT_VAR || !H5_TERM_GLOBAL) { /*------------------------------------------------------------------------- @@ -2113,35 +2157,39 @@ static herr_t H5_INTERFACE_INIT_FUNC(void); H5_API_SET_CANCEL #define FUNC_LEAVE_API(ret_value) \ - FINISH_MPE_LOG \ - H5TRACE_RETURN(ret_value); \ - H5_POP_FUNC \ - if(err_occurred) \ - (void)H5E_dump_api_stack(TRUE); \ - FUNC_LEAVE_API_THREADSAFE \ - return(ret_value); \ + ; \ } /*end scope from end of FUNC_ENTER*/ \ + FINISH_MPE_LOG \ + H5TRACE_RETURN(ret_value); \ + H5_POP_FUNC \ + if(err_occurred) \ + (void)H5E_dump_api_stack(TRUE); \ + FUNC_LEAVE_API_THREADSAFE \ + return(ret_value); \ }} /*end scope from beginning of FUNC_ENTER*/ /* Use this macro to match the FUNC_ENTER_API_NOFS macro */ #define FUNC_LEAVE_API_NOFS(ret_value) \ - FINISH_MPE_LOG \ - H5TRACE_RETURN(ret_value); \ - FUNC_LEAVE_API_THREADSAFE \ - return(ret_value); \ + ; \ } /*end scope from end of FUNC_ENTER*/ \ + FINISH_MPE_LOG \ + H5TRACE_RETURN(ret_value); \ + FUNC_LEAVE_API_THREADSAFE \ + return(ret_value); \ }} /*end scope from beginning of FUNC_ENTER*/ #define FUNC_LEAVE_NOAPI(ret_value) \ - H5_POP_FUNC \ - return(ret_value); \ + ; \ } /*end scope from end of FUNC_ENTER*/ \ + H5_POP_FUNC \ + return(ret_value); \ } /*end scope from beginning of FUNC_ENTER*/ #define FUNC_LEAVE_NOAPI_VOID \ - H5_POP_FUNC \ - return; \ + ; \ } /*end scope from end of FUNC_ENTER*/ \ + H5_POP_FUNC \ + return; \ } /*end scope from beginning of FUNC_ENTER*/ /* @@ -2150,135 +2198,146 @@ static herr_t H5_INTERFACE_INIT_FUNC(void); * (so far, just the H5CS routines themselves) */ #define FUNC_LEAVE_NOAPI_NOFS(ret_value) \ - return(ret_value); \ + ; \ } /*end scope from end of FUNC_ENTER*/ \ + return(ret_value); \ } /*end scope from beginning of FUNC_ENTER*/ /* Use this macro when exiting a function that set up a metadata tag */ -#define FUNC_LEAVE_NOAPI_TAG(ret_value, err) \ - if(H5AC_tag(tag_dxpl_id, prev_tag, NULL)<0) \ - HDONE_ERROR(H5E_CACHE, H5E_CANTTAG, err, "unable to apply metadata tag") \ - H5_POP_FUNC \ - return(ret_value); \ - } /*end scope from end of FUNC_ENTER*/ \ +#define FUNC_LEAVE_NOAPI_TAG(ret_value, err) \ + ; \ + } /*end scope from end of FUNC_ENTER*/ \ + if(H5AC_tag(tag_dxpl_id, prev_tag, NULL) < 0) \ + HDONE_ERROR(H5E_CACHE, H5E_CANTTAG, err, "unable to apply metadata tag") \ + H5_POP_FUNC \ + return(ret_value); \ } /*end scope from beginning of FUNC_ENTER*/ + /****************************************/ /* Revisions to FUNC_ENTER/LEAVE Macros */ /****************************************/ -/* Macros for referencing package initialization symbols */ -#define H5_PACKAGE_INIT_VAR(x) H5_GLUE3(H5_, x, _init_g) -#define H5_PACKAGE_INIT_FUNC(x) H5_GLUE(x, __pkg_init) - /* Macros to check if a package is initialized */ -#define H5_CHECK_PACKAGE_INIT_REG_YES(asrt) HDassert(H5_PACKAGE_INIT_VAR(pkg)); +#define H5_CHECK_PACKAGE_INIT_REG_YES(asrt) HDassert(H5_PACKAGE_INIT_VAR(pkg)); #define H5_CHECK_PACKAGE_INIT_REG_NO(asrt) #define H5_CHECK_PACKAGE_INIT_INIT_YES(asrt) #define H5_CHECK_PACKAGE_INIT_INIT_NO(asrt) +#define H5_CHECK_PACKAGE_INIT(pkg, pkg_init, init) H5_GLUE4(H5_CHECK_PACKAGE_INIT_, init, _, pkg_init)(pkg) /* Macros to initialize package, if a package initialization routine is defined */ -#define H5_PKG_YES_INIT(pkg) \ - if(!H5_PACKAGE_INIT_VAR(pkg)) { \ - if(H5_GLUE(pkg, _pkg_init)() < 0) { \ - /* (Can't use H5E_THROW here) */ \ +#define H5_PKG_YES_INIT(pkg) \ + if(!H5_PACKAGE_INIT_VAR(pkg) && !H5_TERM_GLOBAL) { \ + H5_PACKAGE_INIT_VAR(pkg) = TRUE; \ + if(H5_PACKAGE_INIT_FUNC(pkg)() < 0) { \ + H5_PACKAGE_INIT_VAR(pkg) = FALSE; \ + /* (Can't use H5E_THROW here) */ \ H5E_PRINTF(H5E_CANTINIT, "interface initialization failed"); \ - ret_value = fail_value; \ - goto func_init_failed; \ - } /* end if */ \ + ret_value = fail_value; \ + goto func_init_failed; \ + } /* end if */ \ } /* end if */ -#define H5_PKG_NO_INIT(pkg) - -/* Macros to declare package initialization symbols, if a package initialization routine is defined */ -#define H5_PKG_YES_INIT_VAR(pkg) extern hbool_t H5_PACKAGE_INIT_VAR(H5_MY_PKG); -#define H5_PKG_NO_INIT_VAR(pkg) -#define H5_PKG_YES_INIT_FUNC(pkg) extern herr_t H5_PACKAGE_INIT_FUNC(pkg)(void); -#define H5_PKG_NO_INIT_FUNC(pkg) +#define H5_PKG_NO_INIT(pkg) \ + if(!H5_PACKAGE_INIT_VAR(pkg) && !H5_TERM_GLOBAL) \ + H5_PACKAGE_INIT_VAR(pkg) = TRUE; +#define H5_PKG_INIT(pkg_init, pkg) H5_GLUE3(H5_PKG_, pkg_init, _INIT)(pkg) + +/* Macros to declare package initialization function, if a package initialization routine is defined */ +#ifdef H5_PKG_SINGLE_SOURCE +#define H5_PKG_DECLARE_YES_FUNC(pkg) static herr_t H5_PACKAGE_INIT_FUNC(pkg)(void); +#else /* H5_PKG_SINGLE_SOURCE */ +#define H5_PKG_DECLARE_YES_FUNC(pkg) extern herr_t H5_PACKAGE_INIT_FUNC(pkg)(void); +#endif /* H5_PKG_SINGLE_SOURCE */ +#define H5_PKG_DECLARE_NO_FUNC(pkg) /* Declare package initialization symbols (if in a package) */ -#define H5_DECLARE_PKG_VAR(pkg_init, pkg) H5_GLUE3(H5_PKG_, pkg_init, _INIT_VAR)(pkg) -#define H5_DECLARE_PKG_FUNC(pkg_init, pkg) H5_GLUE3(H5_PKG_, pkg_init, _INIT_FUNC)(pkg) +#ifdef H5_PKG_SINGLE_SOURCE +#define H5_PKG_DECLARE_VAR(pkg) static hbool_t H5_PACKAGE_INIT_VAR(pkg); +#else /* H5_PKG_SINGLE_SOURCE */ +#define H5_PKG_DECLARE_VAR(pkg) extern hbool_t H5_PACKAGE_INIT_VAR(pkg); +#endif /* H5_PKG_SINGLE_SOURCE */ +#define H5_PKG_DECLARE_FUNC(pkg_init, pkg) H5_GLUE3(H5_PKG_DECLARE_, pkg_init, _FUNC)(pkg) #ifdef H5_MY_PKG -H5_DECLARE_PKG_VAR(H5_MY_PKG_INIT, H5_MY_PKG) -H5_DECLARE_PKG_FUNC(H5_MY_PKG_INIT, H5_MY_PKG) +H5_PKG_DECLARE_VAR(H5_MY_PKG) +H5_PKG_DECLARE_FUNC(H5_MY_PKG_INIT, H5_MY_PKG) #endif /* H5_MY_PKG */ /* API re-entrance variable */ extern hbool_t H5_api_entered_g; /* Has library already been entered through API? */ /* Macros for entering different scopes of routines */ -#define H5_PACKAGE_ENTER(pkg, pkg_init, init) \ - FUNC_ENTER_CHECK_NAME(H5_IS_PKG(FUNC)) \ +#define H5_PACKAGE_ENTER(pkg, pkg_init, init) \ + FUNC_ENTER_CHECK_NAME(H5_IS_PKG(FUNC)) \ \ - /* The library should be initialized already */ \ - HDassert(H5_INIT_GLOBAL); \ + /* The library should be initialized already */ \ + HDassert(H5_INIT_GLOBAL); \ \ - /* This interface should be initialized already */ \ - /* (except for package initialization routines :-) */ \ - H5_GLUE4(H5_CHECK_PACKAGE_INIT_, init, _, pkg_init)(pkg) \ + /* This interface should be initialized already */ \ + /* (except for package initialization routines :-) */ \ + H5_CHECK_PACKAGE_INIT(pkg, pkg_init, init) \ \ - /* Push the name of this function on the function stack */ \ - H5_PUSH_FUNC \ + /* Push the name of this function on the function stack */ \ + H5_PUSH_FUNC \ \ - /* Enter scope for this type of function */ \ + /* Enter scope for this type of function */ \ { -#define H5_PRIVATE_ENTER(pkg, pkg_init) \ - FUNC_ENTER_CHECK_NAME(H5_IS_PRIV(FUNC)) \ +#define H5_PRIVATE_ENTER(pkg, pkg_init) \ + FUNC_ENTER_CHECK_NAME(H5_IS_PRIV(FUNC)) \ \ - /* The library should be initialized already */ \ - HDassert(H5_INIT_GLOBAL); \ + /* The library should be initialized already */ \ + HDassert(H5_INIT_GLOBAL); \ \ - /* Initialize this interface if desired */ \ - H5_GLUE3(H5_PKG_, pkg_init, _INIT)(pkg) \ + /* Initialize this interface if desired */ \ + H5_PKG_INIT(pkg_init, pkg) \ \ - /* Push the name of this function on the function stack */ \ - H5_PUSH_FUNC \ + /* Push the name of this function on the function stack */ \ + H5_PUSH_FUNC \ \ - /* Enter scope for this type of function */ \ + /* Enter scope for this type of function */ \ {{ -#define H5_PUBLIC_ENTER(pkg, pkg_init) \ - FUNC_ENTER_API_VARS \ +#define H5_PUBLIC_ENTER(pkg, pkg_init) \ + FUNC_ENTER_API_VARS \ FUNC_ENTER_API_THREADSAFE; \ - FUNC_ENTER_CHECK_NAME(H5_IS_PUB(FUNC)) \ + FUNC_ENTER_CHECK_NAME(H5_IS_PUB(FUNC)) \ \ - /* Clear thread error stack when entering public functions */ \ - H5E_clear_stack(NULL); \ + /* Clear thread error stack when entering public functions */ \ + H5E_clear_stack(NULL); \ \ - /* Initialize the library or bust */ \ - if(!(H5_INIT_GLOBAL)) { \ + /* Initialize the library or bust */ \ + if(!H5_INIT_GLOBAL && !H5_TERM_GLOBAL) { \ H5_INIT_GLOBAL = TRUE; \ - if(H5_init_library() < 0) { \ - /* (Can't use H5E_THROW here) */ \ + if(H5_init_library() < 0) { \ + /* (Can't use H5E_THROW here) */ \ H5E_PRINTF(H5E_CANTINIT, "interface initialization failed"); \ - ret_value = fail_value; \ - goto func_init_failed; \ - } /* end if */ \ - } /* end if */ \ + ret_value = fail_value; \ + goto func_init_failed; \ + } /* end if */ \ + } /* end if */ \ \ - /* Initialize this interface if desired */ \ - H5_GLUE3(H5_PKG_, pkg_init, _INIT)(pkg) \ + /* Initialize this interface if desired */ \ + H5_PKG_INIT(pkg_init, pkg) \ \ - /* Check for re-entering API routine */ \ - HDassert(!H5_api_entered_g); \ - H5_api_entered_g = TRUE; \ + /* Check for re-entering API routine */ \ + HDassert(!H5_api_entered_g); \ + H5_api_entered_g = TRUE; \ \ - /* Start logging MPI's MPE information */ \ - BEGIN_MPE_LOG \ + /* Start logging MPI's MPE information */ \ + BEGIN_MPE_LOG \ \ - /* Push the name of this function on the function stack */ \ - H5_PUSH_FUNC \ + /* Push the name of this function on the function stack */ \ + H5_PUSH_FUNC \ \ - /* Enter scope for this type of function */ \ + /* Enter scope for this type of function */ \ {{{ /* Macros for substituting the package name */ -#define FUNC_ENT_STATIC H5_PACKAGE_ENTER(H5_MY_PKG, H5_MY_PKG_INIT, REG) -#define FUNC_ENT_PKGINIT H5_PACKAGE_ENTER(H5_MY_PKG, H5_MY_PKG_INIT, INIT) -#define FUNC_ENT_PKG H5_PACKAGE_ENTER(H5_MY_PKG, H5_MY_PKG_INIT, REG) -#define FUNC_ENT_PRIV H5_PRIVATE_ENTER(H5_MY_PKG, H5_MY_PKG_INIT) -#define FUNC_ENT_PUB H5_PUBLIC_ENTER(H5_MY_PKG, H5_MY_PKG_INIT) +#define FUNC_ENT_STATIC(pkg, pkg_init) H5_PACKAGE_ENTER(pkg, pkg_init, REG) +#define FUNC_ENT_PKGINIT(pkg, pkg_init) H5_PACKAGE_ENTER(pkg, pkg_init, INIT) +#define FUNC_ENT_PKG(pkg, pkg_init) H5_PACKAGE_ENTER(pkg, pkg_init, REG) +#define FUNC_ENT_PRIV(pkg, pkg_init) H5_PRIVATE_ENTER(pkg, pkg_init) +#define FUNC_ENT_PUB(pkg, pkg_init) H5_PUBLIC_ENTER(pkg, pkg_init) /* Macros for substituting a function prefix */ #define FUNC_PREFIX_STATIC static @@ -2288,23 +2347,23 @@ extern hbool_t H5_api_entered_g; /* Has library already been entered through #define FUNC_PREFIX_PUB /* Macros for declaring error variables */ -#define FUNC_ERR_VAR_ERR(ret_typ, err) \ - hbool_t past_catch = FALSE; \ +#define FUNC_ERR_VAR_ERR(ret_typ, err) \ + hbool_t past_catch = FALSE; \ ret_typ fail_value = err; -#define FUNC_ERR_VAR_ERRCATCH(ret_typ, err) \ +#define FUNC_ERR_VAR_ERRCATCH(ret_typ, err) \ hbool_t past_catch = FALSE; #define FUNC_ERR_VAR_NOERR(ret_typ, err) /* Use this macro when entering all functions */ -#define BEGIN_FUNC(scope, use_err, ret_typ, ret_init, err, func) \ -H5_GLUE(FUNC_PREFIX_, scope) \ -ret_typ \ -func \ -/* Open function */ \ -{ \ - ret_typ ret_value = ret_init; \ - H5_GLUE(FUNC_ERR_VAR_, use_err)(ret_typ, err) \ - H5_GLUE(FUNC_ENT_, scope) +#define BEGIN_FUNC(scope, use_err, ret_typ, ret_init, err, func) \ +H5_GLUE(FUNC_PREFIX_, scope) \ +ret_typ \ +func \ +/* Open function */ \ +{ \ + ret_typ ret_value = ret_init; \ + H5_GLUE(FUNC_ERR_VAR_, use_err)(ret_typ, err) \ + H5_GLUE(FUNC_ENT_, scope)(H5_MY_PKG, H5_MY_PKG_INIT) /* Macros for label when a function initialization can fail */ #define H5_PRIV_YES_FUNC_INIT_FAILED func_init_failed: @@ -2312,73 +2371,73 @@ func \ #define H5_PRIV_FUNC_INIT_FAILED(pkg_init) H5_GLUE3(H5_PRIV_, pkg_init, _FUNC_INIT_FAILED) /* Macros for leaving different scopes of routines */ -#define FUNC_LEAVE_PKGINIT \ - /* Leave scope for this type of function */ \ - } \ +#define FUNC_LEAVE_PKGINIT \ + /* Leave scope for this type of function */ \ + } \ \ - /* Pop the name of this function off the function stack */ \ + /* Pop the name of this function off the function stack */ \ H5_POP_FUNC -#define FUNC_LEAVE_STATIC \ - /* Leave scope for this type of function */ \ - } \ +#define FUNC_LEAVE_STATIC \ + /* Leave scope for this type of function */ \ + } \ \ - /* Pop the name of this function off the function stack */ \ + /* Pop the name of this function off the function stack */ \ H5_POP_FUNC -#define FUNC_LEAVE_PKG \ - /* Leave scope for this type of function */ \ - } \ +#define FUNC_LEAVE_PKG \ + /* Leave scope for this type of function */ \ + } \ \ - /* Pop the name of this function off the function stack */ \ + /* Pop the name of this function off the function stack */ \ H5_POP_FUNC -#define FUNC_LEAVE_PRIV \ - /* Leave scope for this type of function */ \ - }} \ +#define FUNC_LEAVE_PRIV \ + /* Leave scope for this type of function */ \ + }} \ \ - /* Label for errors during FUNC_ENTER */ \ - H5_PRIV_FUNC_INIT_FAILED(H5_MY_PKG_INIT) \ + /* Label for errors during FUNC_ENTER */ \ + H5_PRIV_FUNC_INIT_FAILED(H5_MY_PKG_INIT) \ \ - /* Pop the name of this function off the function stack */ \ + /* Pop the name of this function off the function stack */ \ H5_POP_FUNC -#define FUNC_LEAVE_PUB \ - /* Leave scope for this type of function */ \ - }}} \ +#define FUNC_LEAVE_PUB \ + /* Leave scope for this type of function */ \ + }}} \ \ - /* Label for errors during FUNC_ENTER */ \ -func_init_failed: \ + /* Label for errors during FUNC_ENTER */ \ +func_init_failed: \ \ - /* Dump error stack if an error occurred during API routine */ \ - if(ret_value == fail_value) \ - (void)H5E_dump_api_stack(TRUE); \ + /* Dump error stack if an error occurred during API routine */ \ + if(ret_value == fail_value) \ + (void)H5E_dump_api_stack(TRUE); \ \ - /* Finish the API tracing info */ \ - H5TRACE_RETURN(ret_value); \ + /* Finish the API tracing info */ \ + H5TRACE_RETURN(ret_value); \ \ - /* Pop the name of this function off the function stack */ \ - H5_POP_FUNC \ + /* Pop the name of this function off the function stack */ \ + H5_POP_FUNC \ \ - /* Finish the MPE tracing info */ \ - FINISH_MPE_LOG \ + /* Finish the MPE tracing info */ \ + FINISH_MPE_LOG \ \ - /* Check for leaving API routine */ \ - HDassert(H5_api_entered_g); \ - H5_api_entered_g = FALSE; \ + /* Check for leaving API routine */ \ + HDassert(H5_api_entered_g); \ + H5_api_entered_g = FALSE; \ \ - /* Release thread-safety semaphore */ \ + /* Release thread-safety semaphore */ \ FUNC_LEAVE_API_THREADSAFE /* Use this macro when leaving all functions */ -#define END_FUNC(scope) \ - /* Scope-specific function conclusion */ \ - H5_GLUE(FUNC_LEAVE_, scope) \ +#define END_FUNC(scope) \ + /* Scope-specific function conclusion */ \ + H5_GLUE(FUNC_LEAVE_, scope) \ \ - /* Leave routine */ \ - return(ret_value); \ + /* Leave routine */ \ + return(ret_value); \ \ - /* Close Function */ \ + /* Close Function */ \ } /* Macro to begin/end tagging (when FUNC_ENTER_*TAG macros are insufficient). @@ -2387,23 +2446,13 @@ func_init_failed: \ haddr_t prv_tag = HADDR_UNDEF; \ hid_t my_dxpl_id = dxpl; \ if(H5AC_tag(my_dxpl_id, tag, &prv_tag) < 0) \ - HGOTO_ERROR(H5E_CACHE, H5E_CANTTAG, err, "unable to apply metadata tag") + HGOTO_ERROR(H5_MY_PKG_ERR, H5E_CANTTAG, err, "unable to apply metadata tag") #define H5_END_TAG(err) \ if(H5AC_tag(my_dxpl_id, prv_tag, NULL) <0) \ - HGOTO_ERROR(H5E_CACHE, H5E_CANTTAG, err, "unable to apply metadata tag") \ + HGOTO_ERROR(H5_MY_PKG_ERR, H5E_CANTTAG, err, "unable to apply metadata tag") \ } -/* Macro for "stringizing" an integer in the C preprocessor (use H5_TOSTRING) */ -/* (use H5_TOSTRING, H5_STRINGIZE is just part of the implementation) */ -#define H5_STRINGIZE(x) #x -#define H5_TOSTRING(x) H5_STRINGIZE(x) - -/* Macro for "glueing" together items, for re-scanning macros */ -#define H5_GLUE(x,y) x##y -#define H5_GLUE3(x,y,z) x##y##z -#define H5_GLUE4(w,x,y,z) w##x##y##z - /* Compile-time "assert" macro */ #define HDcompile_assert(e) ((void)sizeof(char[ !!(e) ? 1 : -1])) /* Variants that are correct, but generate compile-time warnings in some circumstances: @@ -2416,21 +2465,30 @@ H5_DLL herr_t H5_init_library(void); H5_DLL void H5_term_library(void); /* Functions to terminate interfaces */ -H5_DLL int H5A_term_interface(void); -H5_DLL int H5AC_term_interface(void); -H5_DLL int H5D_term_interface(void); -H5_DLL int H5E_term_interface(void); -H5_DLL int H5F_term_interface(void); -H5_DLL int H5FS_term_interface(void); -H5_DLL int H5G_term_interface(void); -H5_DLL int H5I_term_interface(void); -H5_DLL int H5L_term_interface(void); -H5_DLL int H5P_term_interface(void); -H5_DLL int H5PL_term_interface(void); -H5_DLL int H5R_term_interface(void); -H5_DLL int H5S_term_interface(void); -H5_DLL int H5T_term_interface(void); -H5_DLL int H5Z_term_interface(void); +H5_DLL int H5A_term_package(void); +H5_DLL int H5A_top_term_package(void); +H5_DLL int H5AC_term_package(void); +H5_DLL int H5D_term_package(void); +H5_DLL int H5D_top_term_package(void); +H5_DLL int H5E_term_package(void); +H5_DLL int H5F_term_package(void); +H5_DLL int H5FD_term_package(void); +H5_DLL int H5FL_term_package(void); +H5_DLL int H5FS_term_package(void); +H5_DLL int H5G_term_package(void); +H5_DLL int H5G_top_term_package(void); +H5_DLL int H5I_term_package(void); +H5_DLL int H5L_term_package(void); +H5_DLL int H5P_term_package(void); +H5_DLL int H5PL_term_package(void); +H5_DLL int H5R_term_package(void); +H5_DLL int H5R_top_term_package(void); +H5_DLL int H5S_term_package(void); +H5_DLL int H5S_top_term_package(void); +H5_DLL int H5SL_term_package(void); +H5_DLL int H5T_term_package(void); +H5_DLL int H5T_top_term_package(void); +H5_DLL int H5Z_term_package(void); /* Checksum functions */ H5_DLL uint32_t H5_checksum_fletcher32(const void *data, size_t len); diff --git a/src/H5trace.c b/src/H5trace.c index e6a091c..428d2b2 100644 --- a/src/H5trace.c +++ b/src/H5trace.c @@ -27,7 +27,7 @@ /****************/ /* Module Setup */ /****************/ -#define H5I_PACKAGE /*suppress error about including H5Ipkg */ +#define H5I_FRIEND /*suppress error about including H5Ipkg */ /***********/ diff --git a/src/Makefile.am b/src/Makefile.am index b6c4dad..ca4e061 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -107,8 +107,8 @@ libhdf5_la_SOURCES= H5.c H5checksum.c H5dbg.c H5system.c H5timer.c H5trace.c \ H5Topaque.c \ H5Torder.c \ H5Tpad.c H5Tprecis.c H5Tstrpad.c H5Tvisit.c H5Tvlen.c H5TS.c H5VM.c H5WB.c H5Z.c \ - H5Zdeflate.c H5Zfletcher32.c H5Znbit.c H5Zshuffle.c H5Zszip.c \ - H5Zscaleoffset.c H5Ztrans.c + H5Zdeflate.c H5Zfletcher32.c H5Znbit.c H5Zshuffle.c \ + H5Zscaleoffset.c H5Zszip.c H5Ztrans.c # Public headers diff --git a/test/accum.c b/test/accum.c index a924517..268b7e1 100644 --- a/test/accum.c +++ b/test/accum.c @@ -17,7 +17,7 @@ */ #include "h5test.h" -#define H5F_PACKAGE +#define H5F_FRIEND /*suppress error about including H5Fpkg */ #include "H5Fpkg.h" #include "H5FDprivate.h" #include "H5Iprivate.h" diff --git a/test/app_ref.c b/test/app_ref.c index 3052df7..4b72bcb 100644 --- a/test/app_ref.c +++ b/test/app_ref.c @@ -185,6 +185,10 @@ main (void) PASSED(); + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); + + /* Clean up any file(s) created */ h5_reset(); fapl = H5Pcreate (H5P_FILE_ACCESS); h5_cleanup (FILENAME, fapl); diff --git a/test/big.c b/test/big.c index db03c99..53b4337 100644 --- a/test/big.c +++ b/test/big.c @@ -618,7 +618,7 @@ test_sec2(hid_t fapl) quit: /* End with normal return code */ /* Clean up the test file */ - if(h5_cleanup(FILENAME, fapl)) + if(h5_clean_files(FILENAME, fapl)) HDremove(DNAME); return 0; @@ -655,7 +655,7 @@ test_stdio(hid_t fapl) quit: /* End with normal return code */ /* Clean up the test file */ - if(h5_cleanup(FILENAME, fapl)) + if(h5_clean_files(FILENAME, fapl)) HDremove(DNAME); HDfflush(stdout); return 0; @@ -716,7 +716,7 @@ test_family(hid_t fapl) quit: /* End with normal return code */ /* Clean up the test file */ - if(h5_cleanup(FILENAME, fapl)) + if(h5_clean_files(FILENAME, fapl)) HDremove(DNAME); return 0; diff --git a/test/bittests.c b/test/bittests.c index c527bb8..c4dfe4c 100644 --- a/test/bittests.c +++ b/test/bittests.c @@ -21,7 +21,7 @@ */ #include "h5test.h" -#define H5T_PACKAGE +#define H5T_FRIEND /*suppress error about including H5Tpkg */ #include "H5Tpkg.h" #define NTESTS 100000 diff --git a/test/btree2.c b/test/btree2.c index d8abc84..caad849 100644 --- a/test/btree2.c +++ b/test/btree2.c @@ -22,7 +22,7 @@ * This file needs to access private datatypes from the H5B2 package. * This file also needs to access the v2 B-tree testing code. */ -#define H5B2_PACKAGE +#define H5B2_FRIEND /*suppress error about including H5B2pkg */ #define H5B2_TESTING #include "H5B2pkg.h" diff --git a/test/cache_common.h b/test/cache_common.h index 737c53f..9e8c5ba 100644 --- a/test/cache_common.h +++ b/test/cache_common.h @@ -22,8 +22,8 @@ #ifndef _CACHE_COMMON_H #define _CACHE_COMMON_H -#define H5C_PACKAGE /*suppress error about including H5Cpkg */ -#define H5F_PACKAGE /*suppress error about including H5Fpkg */ +#define H5C_FRIEND /*suppress error about including H5Cpkg */ +#define H5F_FRIEND /*suppress error about including H5Fpkg */ /* Include library header files */ #include "H5ACprivate.h" diff --git a/test/cache_tagging.c b/test/cache_tagging.c index 84c9b34..2d22b5b 100644 --- a/test/cache_tagging.c +++ b/test/cache_tagging.c @@ -1113,6 +1113,7 @@ check_dense_attribute_tags(void) /* Create dataset */ if ( (did = H5Dcreate2(fid, DATASETNAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0 ) TEST_ERROR; + if ( H5Pclose(dcpl) < 0 ) TEST_ERROR; /* get dataset object header */ if ( get_new_object_header_tag(fid, &d_tag) < 0 ) TEST_ERROR; @@ -2025,6 +2026,7 @@ check_dataset_creation_tags(hid_t fcpl, int type) /* Create Dataset */ if (( did = H5Dcreate2(fid, DATASETNAME, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0 ) TEST_ERROR; + if ( H5Pclose(dcpl) < 0 ) TEST_ERROR; /* =================================== */ /* Verification of Metadata Tag Values */ @@ -2159,6 +2161,7 @@ check_dataset_creation_earlyalloc_tags(hid_t fcpl, int type) if ( (sid = H5Screate_simple(2, dims1, maxdims)) < 0 ) TEST_ERROR; if (( did = H5Dcreate2(fid, DATASETNAME2, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0 ) TEST_ERROR; + if ( H5Pclose(dcpl) < 0 ) TEST_ERROR; /* =================================== */ /* Verification of Metadata Tag Values */ @@ -2287,6 +2290,7 @@ check_dataset_open_tags(hid_t fcpl, int type) /* Create Dataset */ if (( did = H5Dcreate2(fid, DATASETNAME, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0 ) TEST_ERROR; + if ( H5Pclose(dcpl) < 0 ) TEST_ERROR; /* Retrieve tag associated with this dataset */ if ( get_new_object_header_tag(fid, &d_tag) < 0 ) TEST_ERROR; @@ -2419,6 +2423,7 @@ check_dataset_write_tags(hid_t fcpl, int type) /* Create Dataset */ if (( did = H5Dcreate2(fid, DATASETNAME, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0 ) TEST_ERROR; + if ( H5Pclose(dcpl) < 0 ) TEST_ERROR; /* Retrieve tag associated with this dataset */ if ( get_new_object_header_tag(fid, &d_tag) < 0 ) TEST_ERROR; @@ -2709,6 +2714,7 @@ check_dataset_read_tags(hid_t fcpl, int type) /* Create Dataset */ if (( did = H5Dcreate2(fid, DATASETNAME, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0 ) TEST_ERROR; + if ( H5Pclose(dcpl) < 0 ) TEST_ERROR; /* Retrieve tag associated with this dataset */ if ( get_new_object_header_tag(fid, &d_tag) < 0 ) TEST_ERROR; @@ -2847,6 +2853,7 @@ check_dataset_size_retrieval(hid_t fcpl, int type) /* Create Dataset */ if (( did = H5Dcreate2(fid, DATASETNAME, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0 ) TEST_ERROR; + if ( H5Pclose(dcpl) < 0 ) TEST_ERROR; /* Retrieve tag associated with this dataset */ if ( get_new_object_header_tag(fid, &d_tag) < 0 ) TEST_ERROR; @@ -2986,6 +2993,7 @@ check_dataset_extend_tags(hid_t fcpl, int type) /* Create Dataset */ if (( did = H5Dcreate2(fid, DATASETNAME, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0 ) TEST_ERROR; + if ( H5Pclose(dcpl) < 0 ) TEST_ERROR; /* Retrieve tag associated with this dataset */ if ( get_new_object_header_tag(fid, &d_tag) < 0 ) TEST_ERROR; @@ -3367,6 +3375,7 @@ check_link_removal_tags(hid_t fcpl, int type) /* Create Dataset */ if (( did = H5Dcreate2(fid, DATASETNAME, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0 ) TEST_ERROR; + if ( H5Pclose(dcpl) < 0 ) TEST_ERROR; /* Retrieve tag associated with this dataset */ if ( get_new_object_header_tag(fid, &d_tag) < 0 ) TEST_ERROR; @@ -3526,6 +3535,7 @@ check_link_getname_tags(hid_t fcpl, int type) /* Create Dataset */ if (( did = H5Dcreate2(fid, DATASETNAME, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0 ) TEST_ERROR; + if ( H5Pclose(dcpl) < 0 ) TEST_ERROR; /* Retrieve tag associated with this dataset */ if ( get_new_object_header_tag(fid, &d_tag) < 0 ) TEST_ERROR; diff --git a/test/cmpd_dset.c b/test/cmpd_dset.c index 5c591f8..22bf3a2 100644 --- a/test/cmpd_dset.c +++ b/test/cmpd_dset.c @@ -21,7 +21,7 @@ /* See H5private.h for how to include headers */ #undef NDEBUG -#define H5T_PACKAGE +#define H5T_FRIEND /*suppress error about including H5Tpkg */ #include "H5Tpkg.h" /*to turn off hardware conversions*/ #include "H5Iprivate.h" diff --git a/test/dsets.c b/test/dsets.c index 136fec2..4d20023 100644 --- a/test/dsets.c +++ b/test/dsets.c @@ -26,7 +26,7 @@ /* * This file needs to access private information from the H5Z package. */ -#define H5Z_PACKAGE +#define H5Z_FRIEND #include "h5test.h" diff --git a/test/dt_arith.c b/test/dt_arith.c index eb201d0..102f217 100644 --- a/test/dt_arith.c +++ b/test/dt_arith.c @@ -45,7 +45,7 @@ /* Alignment test stuff */ #ifdef TEST_ALIGNMENT -#define H5T_PACKAGE +#define H5T_FRIEND /*suppress error about including H5Tpkg */ #include "H5Tpkg.h" #endif #define SET_ALIGNMENT(TYPE,VAL) \ @@ -645,11 +645,18 @@ test_hard_query(void) } PASSED(); + + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); + reset_hdf5(); return 0; - error: +error: + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); + reset_hdf5(); return 1; } @@ -871,7 +878,11 @@ error: if(saved_buf2) HDfree(saved_buf2); + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); + reset_hdf5(); /*print statistics*/ + return MAX((int)fails_this_test, 1); } @@ -1290,6 +1301,10 @@ test_derived_flt(void) } /* end if */ PASSED(); + + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); + reset_hdf5(); /*print statistics*/ return 0; @@ -1305,7 +1320,12 @@ test_derived_flt(void) H5Pclose (dxpl_id); H5Fclose (file); } H5E_END_TRY; + + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); + reset_hdf5(); /*print statistics*/ + return MAX((int)fails_this_test, 1); } @@ -1592,6 +1612,10 @@ test_derived_integer(void) HDfree(saved_buf); PASSED(); + + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); + reset_hdf5(); /*print statistics*/ return 0; @@ -1606,7 +1630,12 @@ test_derived_integer(void) H5Pclose (dxpl_id); H5Fclose (file); } H5E_END_TRY; + + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); + reset_hdf5(); /*print statistics*/ + return MAX((int)fails_this_test, 1); } @@ -2601,7 +2630,12 @@ done: if (saved) aligned_free(saved); if (aligned) HDfree(aligned); HDfflush(stdout); + + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); + reset_hdf5(); /*print statistics*/ + return (int)fails_all_tests; error: @@ -2609,7 +2643,12 @@ error: if (saved) aligned_free(saved); if (aligned) HDfree(aligned); HDfflush(stdout); + + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); + reset_hdf5(); /*print statistics*/ + return MAX((int)fails_all_tests, 1); } @@ -3307,6 +3346,9 @@ done: HDassert(0 && "Should not reach this point!"); return 1; #else + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); + reset_hdf5(); /* If the source is normalized values, treat the failures as error; @@ -3330,7 +3372,11 @@ error: HDassert(0 && "Should not reach this point!"); return 1; #else + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); + reset_hdf5(); + if(run_test==TEST_NOOP || run_test==TEST_NORMAL) return MAX((int)fails_all_tests, 1); else if(run_test==TEST_DENORM || run_test==TEST_SPECIAL) @@ -4504,6 +4550,9 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) if (saved) aligned_free(saved); if (aligned) HDfree(aligned); HDfflush(stdout); + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); + reset_hdf5(); /*print statistics*/ /* If the source is normalized floating values, treat the failures as error; @@ -4518,6 +4567,10 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) if (saved) aligned_free(saved); if (aligned) HDfree(aligned); HDfflush(stdout); + + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); + reset_hdf5(); /*print statistics*/ if(run_test==TEST_NORMAL) @@ -5164,6 +5217,10 @@ main(void) *---------------------------------------------------------------------- */ without_hardware_g = TRUE; + + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); + reset_hdf5(); /* Test software floating-point conversion functions */ @@ -5179,8 +5236,14 @@ main(void) /* Test software integer-float conversion functions */ nerrors += run_int_fp_conv("soft"); + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); + reset_hdf5(); + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); + if (nerrors) { printf("***** %lu FAILURE%s! *****\n", nerrors, 1==nerrors?"":"S"); @@ -5189,3 +5252,4 @@ main(void) printf("All data type tests passed.\n"); return 0; } + diff --git a/test/dtypes.c b/test/dtypes.c index 88bbce0..6fe455d 100644 --- a/test/dtypes.c +++ b/test/dtypes.c @@ -47,7 +47,7 @@ /* Alignment test stuff */ #ifdef TEST_ALIGNMENT -#define H5T_PACKAGE +#define H5T_FRIEND /*suppress error about including H5Tpkg */ #include "H5Tpkg.h" #endif #define SET_ALIGNMENT(TYPE,VAL) \ @@ -769,11 +769,20 @@ test_compound_2(void) CHECK_NMEMBS(nmembs , st, dt) PASSED(); + + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); + reset_hdf5(); + return 0; - error: +error: + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); + reset_hdf5(); + return 1; } @@ -888,11 +897,19 @@ test_compound_3(void) CHECK_NMEMBS(nmembs, st, dt) PASSED(); + + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); + reset_hdf5(); return 0; - error: +error: + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); + reset_hdf5(); + return 1; } @@ -1015,11 +1032,19 @@ test_compound_4(void) CHECK_NMEMBS(nmembs, st, dt) PASSED(); + + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); + reset_hdf5(); return 0; - error: +error: + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); + reset_hdf5(); + return 1; } @@ -1226,11 +1251,19 @@ test_compound_6(void) CHECK_NMEMBS(nmembs, st, dt) PASSED(); + + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); + reset_hdf5(); return 0; - error: +error: + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); + reset_hdf5(); + return 1; } @@ -1365,11 +1398,19 @@ test_compound_7(void) } /* end if */ PASSED(); + + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); + reset_hdf5(); return 0; - error: +error: + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); + reset_hdf5(); + return 1; } @@ -4229,6 +4270,10 @@ test_conv_str_1(void) HDfree(buf); PASSED(); + + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); + reset_hdf5(); return 0; @@ -4241,7 +4286,11 @@ error: if(buf) HDfree(buf); + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); + reset_hdf5(); + return 1; } @@ -4304,7 +4353,11 @@ error: if(buf) HDfree(buf); + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); + reset_hdf5(); + return ret_value; } @@ -4418,7 +4471,11 @@ error: if(tag) H5free_memory(tag); /* Technically allocated by API call */ + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); + reset_hdf5(); + return ret_value; /* Number of errors */ } @@ -4490,7 +4547,11 @@ error: if(buf) HDfree(buf); + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); + reset_hdf5(); + return ret_value; } @@ -4657,13 +4718,22 @@ test_conv_bitfield(void) H5Tclose(st); H5Tclose(dt); PASSED(); + + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); + reset_hdf5(); return 0; - error: +error: H5Tclose(st); H5Tclose(dt); + + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); + reset_hdf5(); + return 1; } @@ -4781,14 +4851,18 @@ test_bitfield_funcs(void) retval = 0; - error: - +error: if (retval == -1) retval = 1; H5free_memory(tag); H5Tclose(ntype); H5Tclose(type); if (retval == 0) PASSED(); + + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); + reset_hdf5(); + return retval; } @@ -7293,6 +7367,7 @@ main(void) #ifndef H5_NO_DEPRECATED_SYMBOLS nerrors += test_deprec(fapl); #endif /* H5_NO_DEPRECATED_SYMBOLS */ + h5_cleanup(FILENAME, fapl); /*must happen before first reset*/ reset_hdf5(); diff --git a/test/earray.c b/test/earray.c index b510992..368ee42 100644 --- a/test/earray.c +++ b/test/earray.c @@ -22,7 +22,7 @@ * This file needs to access private datatypes from the H5EA package. * This file also needs to access the extensible array testing code. */ -#define H5EA_PACKAGE +#define H5EA_FRIEND /*suppress error about including H5EApkg */ #define H5EA_TESTING #include "H5EApkg.h" /* Extensible Arrays */ diff --git a/test/efc.c b/test/efc.c index ff4f738..a8d77e0 100644 --- a/test/efc.c +++ b/test/efc.c @@ -18,7 +18,7 @@ #include "h5test.h" -#define H5F_PACKAGE +#define H5F_FRIEND /*suppress error about including H5Fpkg */ #include "H5Fpkg.h" #include "H5Iprivate.h" @@ -3200,7 +3200,7 @@ main(void) puts("All external file cache tests passed."); - h5_cleanup(FILENAME, fapl_id); + h5_clean_files(FILENAME, fapl_id); return 0; diff --git a/test/err_compat.c b/test/err_compat.c index 576433e..7779ddc 100644 --- a/test/err_compat.c +++ b/test/err_compat.c @@ -500,7 +500,7 @@ main(void) } if(H5Fclose(file) < 0) TEST_ERROR ; - h5_cleanup(FILENAME, fapl); + h5_clean_files(FILENAME, fapl); printf("All error API tests passed.\n"); return 0; @@ -510,3 +510,4 @@ main(void) return 1; } #endif /* H5_NO_DEPRECATED_SYMBOLS */ + diff --git a/test/error_test.c b/test/error_test.c index e712d86..4e4c0ef 100644 --- a/test/error_test.c +++ b/test/error_test.c @@ -756,7 +756,7 @@ main(void) if(test_filter_error(filename) < 0) TEST_ERROR; - h5_cleanup(FILENAME, fapl); + h5_clean_files(FILENAME, fapl); HDfprintf(stderr, "\nAll error API tests passed.\n"); return 0; diff --git a/test/farray.c b/test/farray.c index 43b63c6..e3e59da 100644 --- a/test/farray.c +++ b/test/farray.c @@ -22,7 +22,7 @@ * This file needs to access private datatypes from the H5FA package. * This file also needs to access the fixed array testing code. */ -#define H5FA_PACKAGE +#define H5FA_FRIEND /*suppress error about including H5FApkg */ #define H5FA_TESTING #include "H5FApkg.h" /* Fixed Arrays */ diff --git a/test/fheap.c b/test/fheap.c index bb30e05..25784a9 100644 --- a/test/fheap.c +++ b/test/fheap.c @@ -22,7 +22,7 @@ * This file needs to access private datatypes from the H5HF package. * This file also needs to access the fractal heap testing code. */ -#define H5HF_PACKAGE +#define H5HF_FRIEND /*suppress error about including H5HFpkg */ #define H5HF_TESTING #include "H5HFpkg.h" /* Fractal heaps */ diff --git a/test/file_image.c b/test/file_image.c index b1b9d47..42199cb 100644 --- a/test/file_image.c +++ b/test/file_image.c @@ -643,7 +643,7 @@ test_core(void) if(H5Fclose(file) < 0) FAIL_STACK_ERROR /* Release resources */ - h5_cleanup(FILENAME, fapl); + h5_clean_files(FILENAME, fapl); HDfree(udata); HDfree(file_image); HDremove(copied_filename); @@ -890,8 +890,8 @@ test_get_file_image(const char * test_banner, VERIFY(err == SUCCEED, "H5Pclose(core_fapl_id) failed."); /* tidy up */ - result = h5_cleanup(FILENAME2, fapl); - VERIFY(result != 0, "h5_cleanup() failed."); + result = h5_clean_files(FILENAME2, fapl); + VERIFY(result != 0, "h5_clean_files() failed."); /* discard the image buffer if it exists */ if(image_ptr != NULL) @@ -1039,8 +1039,8 @@ test_get_file_image_error_rejection(void) VERIFY(err == SUCCEED, "H5Fclose(file_id) failed."); /* tidy up */ - result = h5_cleanup(FILENAME2, fapl_id); - VERIFY(result != 0, "h5_cleanup(1) failed."); + result = h5_clean_files(FILENAME2, fapl_id); + VERIFY(result != 0, "h5_clean_files(1) failed."); /* discard the image buffer if it exists */ if(image_ptr != NULL) @@ -1145,8 +1145,8 @@ test_get_file_image_error_rejection(void) VERIFY(err == SUCCEED, "H5Fclose(2) failed."); /* tidy up */ - result = h5_cleanup(FILENAME2, fapl_id); - VERIFY(result != 0, "h5_cleanup(2 failed."); + result = h5_clean_files(FILENAME2, fapl_id); + VERIFY(result != 0, "h5_clean_files(2 failed."); /************************** Test #3 **********************************/ /* set up a split file driver test file, and try to get its image @@ -1208,8 +1208,8 @@ test_get_file_image_error_rejection(void) VERIFY(err == SUCCEED, "H5Fclose(2) failed."); /* tidy up */ - result = h5_cleanup(FILENAME2, fapl_id); - VERIFY(result != 0, "h5_cleanup(2 failed."); + result = h5_clean_files(FILENAME2, fapl_id); + VERIFY(result != 0, "h5_clean_files(2 failed."); /************************** Test #4 **********************************/ /* set up a family file driver test file, and try to get its image @@ -1269,8 +1269,8 @@ test_get_file_image_error_rejection(void) VERIFY(err == SUCCEED, "H5Fclose(2) failed."); /* tidy up */ - result = h5_cleanup(FILENAME2, fapl_id); - VERIFY(result != 0, "h5_cleanup(2 failed."); + result = h5_clean_files(FILENAME2, fapl_id); + VERIFY(result != 0, "h5_clean_files(2 failed."); PASSED(); @@ -1340,6 +1340,8 @@ main(void) errors += test_get_file_image_error_rejection(); + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); if(errors) { printf("***** %d File Image TEST%s FAILED! *****\n", diff --git a/test/flush2.c b/test/flush2.c index 0ee299e..e86d646 100644 --- a/test/flush2.c +++ b/test/flush2.c @@ -107,7 +107,7 @@ error: static int check_file(char* filename, hid_t fapl, int flag) { - hid_t file, groups, grp; + hid_t file = -1, groups = -1; char name[1024]; int i; @@ -117,6 +117,7 @@ check_file(char* filename, hid_t fapl, int flag) /* Open some groups */ if((groups = H5Gopen2(file, "some_groups", H5P_DEFAULT)) < 0) goto error; for(i = 0; i < 100; i++) { + hid_t grp; sprintf(name, "grp%02u", (unsigned)i); if((grp = H5Gopen2(groups, name, H5P_DEFAULT)) < 0) goto error; if(H5Gclose(grp) < 0) goto error; @@ -132,6 +133,11 @@ check_file(char* filename, hid_t fapl, int flag) return 0; error: + H5E_BEGIN_TRY { + H5Gclose(groups); + H5Fclose(file); + } H5E_END_TRY; + return 1; } /* end check_file() */ @@ -184,14 +190,13 @@ main(void) h5_fixname(FILENAME[1], fapl, name, sizeof name); if(check_file(name, fapl, FALSE)) PASSED() - else - { + else { #if defined H5_HAVE_WIN32_API && !defined (hdf5_EXPORTS) - SKIPPED(); - puts(" DLL will flush the file even when calling _exit, skip this test temporarily"); + SKIPPED(); + puts(" DLL will flush the file even when calling _exit, skip this test temporarily"); #else - H5_FAILED() - goto error; + H5_FAILED() + goto error; #endif } H5Eset_auto2(H5E_DEFAULT, func, NULL); @@ -205,17 +210,16 @@ main(void) h5_fixname(FILENAME[2], fapl, name, sizeof name); if(check_file(name, fapl, TRUE)) PASSED() - else - { + else { #if defined H5_HAVE_WIN32_API && !defined (hdf5_EXPORTS) - SKIPPED(); - puts(" DLL will flush the file even when calling _exit, skip this test temporarily"); + SKIPPED(); + puts(" DLL will flush the file even when calling _exit, skip this test temporarily"); #else - H5_FAILED() - goto error; + H5_FAILED() + goto error; #endif - } + H5Eset_auto2(H5E_DEFAULT, func, NULL); h5_cleanup(FILENAME, fapl); diff --git a/test/freespace.c b/test/freespace.c index 1338ae7..1b87974 100644 --- a/test/freespace.c +++ b/test/freespace.c @@ -17,13 +17,13 @@ */ #include "h5test.h" -#define H5FS_PACKAGE +#define H5FS_FRIEND /*suppress error about including H5FSpkg */ #define H5FS_TESTING #include "H5FSpkg.h" /* Free space manager */ /* Other private headers that this test requires */ -#define H5F_PACKAGE +#define H5F_FRIEND /*suppress error about including H5Fpkg */ #include "H5Fpkg.h" #include "H5Iprivate.h" #include "H5VMprivate.h" @@ -2841,6 +2841,8 @@ main(void) if(env_h5_drvr == NULL) env_h5_drvr = "nomatch"; + h5_reset(); + fapl = h5_fileaccess(); /* make sure alignment is not set for tests to succeed */ diff --git a/test/getname.c b/test/getname.c index e1bbc6b..2700b49 100644 --- a/test/getname.c +++ b/test/getname.c @@ -20,8 +20,8 @@ * Purpose: Tests the "ID to name" functionality */ -#define H5G_PACKAGE /*suppress error about including H5Gpkg */ -#define H5I_PACKAGE /*suppress error about including H5Ipkg */ +#define H5G_FRIEND /*suppress error about including H5Gpkg */ +#define H5I_FRIEND /*suppress error about including H5Ipkg */ /* Define these macros to indicate that the testing APIs should be available */ #define H5G_TESTING diff --git a/test/h5test.c b/test/h5test.c index fefacda..51ec2ca 100644 --- a/test/h5test.c +++ b/test/h5test.c @@ -28,7 +28,7 @@ #include "H5srcdir.h" /* Necessary for h5_verify_cached_stabs() */ -#define H5G_PACKAGE +#define H5G_FRIEND /*suppress error about including H5Gpkg */ #define H5G_TESTING #include "H5Gpkg.h" @@ -91,6 +91,9 @@ MPI_Info h5_io_info_g=MPI_INFO_NULL;/* MPI INFO object for IO */ */ static const char *multi_letters = "msbrglo"; +/* Previous error reporting function */ +static H5E_auto2_t err_func = NULL; + static herr_t h5_errors(hid_t estack, void *client_data); static char * h5_fixname_real(const char *base_name, hid_t fapl, const char *suffix, char *fullname, size_t size); @@ -120,9 +123,9 @@ h5_errors(hid_t estack, void H5_ATTR_UNUSED *client_data) return 0; } - + /*------------------------------------------------------------------------- - * Function: h5_cleanup + * Function: h5_clean_files * * Purpose: Cleanup temporary test files. * base_name contains the list of test file names. @@ -130,13 +133,13 @@ h5_errors(hid_t estack, void H5_ATTR_UNUSED *client_data) * * Return: Non-zero if cleanup actions were performed; zero otherwise. * - * Programmer: Albert Cheng - * May 28, 1998 + * Programmer: Quincey Koziol + * September 13, 2015 * *------------------------------------------------------------------------- */ int -h5_cleanup(const char *base_name[], hid_t fapl) +h5_clean_files(const char *base_name[], hid_t fapl) { int retval = 0; @@ -189,8 +192,61 @@ h5_cleanup(const char *base_name[], hid_t fapl) retval = 1; } /* end if */ + /* Close the FAPL used to access the file */ H5Pclose(fapl); + return retval; +} /* end h5_clean_files() */ + + +/*------------------------------------------------------------------------- + * Function: h5_cleanup + * + * Purpose: Cleanup temporary test files. + * base_name contains the list of test file names. + * The file access property list is also closed. + * + * Return: Non-zero if cleanup actions were performed; zero otherwise. + * + * Programmer: Albert Cheng + * May 28, 1998 + * + *------------------------------------------------------------------------- + */ +int +h5_cleanup(const char *base_name[], hid_t fapl) +{ + int retval = 0; + + /* Clean up the files and the FAPL */ + retval = h5_clean_files(base_name, fapl); + + /* Restore the original error reporting routine */ + h5_restore_err(); + + return retval; +} /* end h5_cleanup() */ + + +/*------------------------------------------------------------------------- + * Function: h5_restore_err + * + * Purpose: Restore the default error handler. + * + * Return: N/A + * + * Programmer: Quincey Koziol + * Sept 10, 2015 + * + *------------------------------------------------------------------------- + */ +void +h5_restore_err(void) +{ + /* Restore the original error reporting routine */ + HDassert(err_func != NULL); + H5Eset_auto2(H5E_DEFAULT, err_func, NULL); + err_func = NULL; } @@ -212,6 +268,10 @@ h5_reset(void) HDfflush(stdout); HDfflush(stderr); H5close(); + + /* Save current error stack reporting routine and redirect to our local one */ + HDassert(err_func == NULL); + H5Eget_auto2(H5E_DEFAULT, &err_func, NULL); H5Eset_auto2(H5E_DEFAULT, h5_errors, NULL); /* @@ -233,12 +293,12 @@ h5_reset(void) */ sprintf(filename, "/tmp/h5emit-%05d.h5", HDgetpid()); H5E_BEGIN_TRY { - hid_t file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, - H5P_DEFAULT); - hid_t grp = H5Gcreate2(file, "emit", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - H5Gclose(grp); - H5Fclose(file); - HDunlink(filename); + hid_t file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, + H5P_DEFAULT); + hid_t grp = H5Gcreate2(file, "emit", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + H5Gclose(grp); + H5Fclose(file); + HDunlink(filename); } H5E_END_TRY; } #endif /* OLD_WAY */ diff --git a/test/h5test.h b/test/h5test.h index 5b203c6..615ca4f 100644 --- a/test/h5test.h +++ b/test/h5test.h @@ -123,6 +123,7 @@ extern "C" { #endif /* Generally useful testing routines */ +H5TEST_DLL int h5_clean_files(const char *base_name[], hid_t fapl); H5TEST_DLL int h5_cleanup(const char *base_name[], hid_t fapl); H5TEST_DLL char *h5_fixname(const char *base_name, hid_t fapl, char *fullname, size_t size); H5TEST_DLL char *h5_fixname_no_suffix(const char *base_name, hid_t fapl, char *fullname, size_t size); @@ -130,6 +131,7 @@ H5TEST_DLL hid_t h5_fileaccess(void); H5TEST_DLL void h5_no_hwconv(void); H5TEST_DLL const char *h5_rmprefix(const char *filename); H5TEST_DLL void h5_reset(void); +H5TEST_DLL void h5_restore_err(void); H5TEST_DLL void h5_show_hostname(void); H5TEST_DLL h5_stat_size_t h5_get_file_size(const char *filename, hid_t fapl); H5TEST_DLL int print_func(const char *format, ...); diff --git a/test/istore.c b/test/istore.c index d088fe8..ec7542a 100644 --- a/test/istore.c +++ b/test/istore.c @@ -19,7 +19,7 @@ * Purpose: Tests various aspects of indexed raw data storage. */ -#define H5F_PACKAGE /*suppress error about including H5Fpkg */ +#define H5F_FRIEND /*suppress error about including H5Fpkg */ #include "h5test.h" #include "H5private.h" diff --git a/test/links.c b/test/links.c index ef71be7..ce3b658 100644 --- a/test/links.c +++ b/test/links.c @@ -24,7 +24,7 @@ * This file needs to access private information from the H5G package. * This file also needs to access the group testing code. */ -#define H5G_PACKAGE +#define H5G_FRIEND /*suppress error about including H5Gpkg */ #define H5G_TESTING #include "h5test.h" diff --git a/test/links_env.c b/test/links_env.c index 6e47667..b3fec38 100644 --- a/test/links_env.c +++ b/test/links_env.c @@ -17,7 +17,7 @@ * Purpose: Tests hard, soft (symbolic) & external links. */ -#define H5G_PACKAGE +#define H5G_FRIEND /*suppress error about including H5Gpkg */ #define H5G_TESTING #include "h5test.h" diff --git a/test/mf.c b/test/mf.c index 67ebc4e..7e476aa 100644 --- a/test/mf.c +++ b/test/mf.c @@ -24,13 +24,13 @@ #include "h5test.h" -#define H5MF_PACKAGE +#define H5MF_FRIEND /*suppress error about including H5MFpkg */ #include "H5MFpkg.h" -#define H5FS_PACKAGE +#define H5FS_FRIEND /*suppress error about including H5FSpkg */ #include "H5FSpkg.h" -#define H5F_PACKAGE +#define H5F_FRIEND /*suppress error about including H5Fpkg */ #define H5F_TESTING #include "H5Fpkg.h" @@ -6843,7 +6843,7 @@ test_mf_fs_drivers(hid_t fapl) ret += test_mf_fs_gone(fapl_new, fcpl); ret += test_mf_fs_persist(fapl_new, fcpl); - h5_cleanup(FILENAME, fapl_new); + h5_clean_files(FILENAME, fapl_new); /* STDIO */ @@ -6857,7 +6857,7 @@ test_mf_fs_drivers(hid_t fapl) ret += test_mf_fs_gone(fapl_new, fcpl); ret += test_mf_fs_persist(fapl_new, fcpl); - h5_cleanup(FILENAME, fapl_new); + h5_clean_files(FILENAME, fapl_new); /* CORE */ HDputs("Testing free-space managers with core driver"); @@ -6871,7 +6871,7 @@ test_mf_fs_drivers(hid_t fapl) ret += test_mf_fs_gone(fapl_new, fcpl); ret += test_mf_fs_persist(fapl_new, fcpl); - h5_cleanup(FILENAME, fapl_new); + h5_clean_files(FILENAME, fapl_new); /* FAMILY */ HDputs("Testing free-space managers with family driver"); @@ -6883,7 +6883,7 @@ test_mf_fs_drivers(hid_t fapl) ret += test_mf_fs_persist(fapl_new, fcpl); - h5_cleanup(FILENAME, fapl_new); + h5_clean_files(FILENAME, fapl_new); /* SPLIT */ HDputs("Testing free-space managers with split driver"); @@ -6896,7 +6896,7 @@ test_mf_fs_drivers(hid_t fapl) ret += test_mf_fs_persist(fapl_new, fcpl); ret += test_mf_fs_split(fapl_new, fcpl); - h5_cleanup(FILENAME, fapl_new); + h5_clean_files(FILENAME, fapl_new); /* MULTI */ HDputs("Testing free-space managers with multi driver"); @@ -6910,7 +6910,7 @@ test_mf_fs_drivers(hid_t fapl) ret += test_mf_fs_multi(fapl_new, fcpl); - h5_cleanup(FILENAME, fapl_new); + h5_clean_files(FILENAME, fapl_new); } /* end for new_format */ @@ -7262,7 +7262,7 @@ test_filespace_drivers(hid_t fapl) ret += test_filespace_strategy_threshold(fapl_new); ret += test_filespace_gone(fapl_new); - h5_cleanup(FILENAME, fapl_new); + h5_clean_files(FILENAME, fapl_new); /* STDIO */ HDputs("Testing file space management with stdio driver"); @@ -7275,7 +7275,7 @@ test_filespace_drivers(hid_t fapl) ret += test_filespace_strategy_threshold(fapl_new); ret += test_filespace_gone(fapl_new); - h5_cleanup(FILENAME, fapl_new); + h5_clean_files(FILENAME, fapl_new); /* CORE */ HDputs("Testing file space management with core driver"); @@ -7289,7 +7289,7 @@ test_filespace_drivers(hid_t fapl) ret += test_filespace_strategy_threshold(fapl_new); ret += test_filespace_gone(fapl_new); - h5_cleanup(FILENAME, fapl_new); + h5_clean_files(FILENAME, fapl_new); /* FAMILY */ HDputs("Testing file space managers with family driver"); @@ -7302,7 +7302,7 @@ test_filespace_drivers(hid_t fapl) ret += test_filespace_strategy_threshold(fapl_new); ret += test_filespace_gone(fapl_new); - h5_cleanup(FILENAME, fapl_new); + h5_clean_files(FILENAME, fapl_new); /* SPLIT */ @@ -7316,7 +7316,7 @@ test_filespace_drivers(hid_t fapl) ret += test_filespace_strategy_threshold(fapl_new); ret += test_filespace_gone(fapl_new); - h5_cleanup(FILENAME, fapl_new); + h5_clean_files(FILENAME, fapl_new); /* MULTI */ HDputs("Testing file space managers with multi driver"); @@ -7331,7 +7331,7 @@ test_filespace_drivers(hid_t fapl) ret += test_filespace_strategy_threshold(fapl_new); ret += test_filespace_gone(fapl_new); - h5_cleanup(FILENAME, fapl_new); + h5_clean_files(FILENAME, fapl_new); } /* end for new_format */ @@ -7456,6 +7456,8 @@ main(void) if(env_h5_drvr == NULL) env_h5_drvr = "nomatch"; + h5_reset(); + fapl = h5_fileaccess(); /* Make a copy of the FAPL before adjusting the alignment */ diff --git a/test/objcopy.c b/test/objcopy.c index a73beb3..6607f4e 100644 --- a/test/objcopy.c +++ b/test/objcopy.c @@ -28,7 +28,7 @@ * This file needs to access private information from the H5S package. * This file also needs to access the dataspace testing code. */ -#define H5S_PACKAGE +#define H5S_FRIEND /*suppress error about including H5Spkg */ #define H5S_TESTING #include "H5Spkg.h" /* Dataspaces */ @@ -36,7 +36,7 @@ * This file needs to access private information from the H5P package. * This file also needs to access the property list testing code. */ -#define H5P_PACKAGE +#define H5P_FRIEND /*suppress error about including H5Ppkg */ #define H5P_TESTING #include "H5Ppkg.h" /* Property Lists */ diff --git a/test/ohdr.c b/test/ohdr.c index 45f2238..e178729 100644 --- a/test/ohdr.c +++ b/test/ohdr.c @@ -24,14 +24,14 @@ * This file needs to access private datatypes from the H5O package. * This file also needs to access the object header testing code. */ -#define H5O_PACKAGE +#define H5O_FRIEND /*suppress error about including H5Opkg */ #define H5O_TESTING #include "H5Opkg.h" /* * This file needs to access private datatypes from the H5G package. */ -#define H5G_PACKAGE +#define H5G_FRIEND /*suppress error about including H5Gpkg */ #include "H5Gpkg.h" const char *FILENAME[] = { diff --git a/test/plugin.c b/test/plugin.c index 74a8f4b..07b20ea 100644 --- a/test/plugin.c +++ b/test/plugin.c @@ -26,7 +26,7 @@ /* * This file needs to access private datatypes from the H5Z package. */ -#define H5Z_PACKAGE +#define H5Z_FRIEND #include "H5Zpkg.h" /* Filters for HDF5 internal test */ diff --git a/test/pool.c b/test/pool.c index 916d45e..83c862b 100644 --- a/test/pool.c +++ b/test/pool.c @@ -22,7 +22,7 @@ * This file needs to access private datatypes from the H5MP package. * This file also needs to access the memory pool testing code. */ -#define H5MP_PACKAGE +#define H5MP_FRIEND /*suppress error about including H5MPpkg */ #define H5MP_TESTING #include "H5MPpkg.h" /* Memory Pools */ diff --git a/test/stab.c b/test/stab.c index 95e9722..7db1feb 100644 --- a/test/stab.c +++ b/test/stab.c @@ -18,7 +18,7 @@ * Tuesday, November 24, 1998 */ -#define H5G_PACKAGE /*suppress error about including H5Gpkg */ +#define H5G_FRIEND /*suppress error about including H5Gpkg */ /* Define this macro to indicate that the testing APIs should be available */ #define H5G_TESTING diff --git a/test/tattr.c b/test/tattr.c index 6642cf1..7e64c13 100644 --- a/test/tattr.c +++ b/test/tattr.c @@ -29,7 +29,7 @@ * This file needs to access private information from the H5O package. * This file also needs to access the object header testing code. */ -#define H5O_PACKAGE +#define H5O_FRIEND /*suppress error about including H5Opkg */ #define H5O_TESTING #include "H5Opkg.h" /* Object headers */ @@ -37,7 +37,7 @@ * This file needs to access private information from the H5A package. * This file also needs to access the attribute testing code. */ -#define H5A_PACKAGE +#define H5A_FRIEND /*suppress error about including H5Apkg */ #define H5A_TESTING #include "H5Apkg.h" /* Attributes */ @@ -45,7 +45,7 @@ * This file needs to access private information from the H5F package. * This file also needs to access the file testing code. */ -#define H5F_PACKAGE +#define H5F_FRIEND /*suppress error about including H5Fpkg */ #define H5F_TESTING #include "H5Fpkg.h" /* File access */ diff --git a/test/tfile.c b/test/tfile.c index 33c947f..8c4adb4 100644 --- a/test/tfile.c +++ b/test/tfile.c @@ -32,7 +32,7 @@ * This file needs to access private information from the H5F package. * This file also needs to access the file testing code. */ -#define H5F_PACKAGE +#define H5F_FRIEND /*suppress error about including H5Fpkg */ #define H5F_TESTING #include "H5Fpkg.h" /* File access */ @@ -2960,7 +2960,7 @@ test_filespace_sects(void) test_free_sections(fapl_sec2, filename); /* close fapl_sec2 and remove the file */ - h5_cleanup(FILENAME, fapl_sec2); + h5_clean_files(FILENAME, fapl_sec2); /* SPLIT */ @@ -2979,7 +2979,7 @@ test_filespace_sects(void) test_free_sections(fapl_split, filename); /* close fapl and remove the file */ - h5_cleanup(FILENAME, fapl_split); + h5_clean_files(FILENAME, fapl_split); /* STDIO */ @@ -2998,7 +2998,7 @@ test_filespace_sects(void) test_free_sections(fapl_stdio, filename); /* close fapl and remove the file */ - h5_cleanup(FILENAME, fapl_stdio); + h5_clean_files(FILENAME, fapl_stdio); /* CORE */ MESSAGE(5, ("Testing File free space information for a core file\n")); @@ -3016,7 +3016,7 @@ test_filespace_sects(void) test_free_sections(fapl_core, filename); /* close fapl_ and remove the file */ - h5_cleanup(FILENAME, fapl_core); + h5_clean_files(FILENAME, fapl_core); /* FAMILY */ @@ -3035,7 +3035,7 @@ test_filespace_sects(void) test_free_sections(fapl_family, filename); /* close fapl and remove the file */ - h5_cleanup(FILENAME, fapl_family); + h5_clean_files(FILENAME, fapl_family); } /* end test_filespace_sects() */ @@ -3155,7 +3155,7 @@ test_filespace_info(void) } /* end for file space strategy type */ } /* end for free space threshold */ - h5_cleanup(FILESPACE_NAME, my_fapl); + h5_clean_files(FILESPACE_NAME, my_fapl); } /* end for new/old format */ diff --git a/test/tgenprop.c b/test/tgenprop.c index fda4161..f35505f 100644 --- a/test/tgenprop.c +++ b/test/tgenprop.c @@ -21,7 +21,7 @@ * *************************************************************/ -#define H5P_PACKAGE /*suppress error about including H5Ppkg */ +#define H5P_FRIEND /*suppress error about including H5Ppkg */ /* Define this macro to indicate that the testing APIs should be available */ #define H5P_TESTING diff --git a/test/tid.c b/test/tid.c index 68cebf3..6570b1c 100644 --- a/test/tid.c +++ b/test/tid.c @@ -19,7 +19,7 @@ #include "hdf5.h" /* Include H5Ipkg.h to calculate max number of groups */ -#define H5I_PACKAGE +#define H5I_FRIEND /*suppress error about including H5Ipkg */ #include "H5Ipkg.h" /* Test basic functionality of registering and deleting types and IDs */ diff --git a/test/tmisc.c b/test/tmisc.c index 6a68857..2980ec2 100644 --- a/test/tmisc.c +++ b/test/tmisc.c @@ -23,7 +23,7 @@ * *************************************************************/ -#define H5D_PACKAGE /*suppress error about including H5Dpkg */ +#define H5D_FRIEND /*suppress error about including H5Dpkg */ /* Define this macro to indicate that the testing APIs should be available */ #define H5D_TESTING diff --git a/test/tselect.c b/test/tselect.c index bdcdb2b..d6b1e8f 100644 --- a/test/tselect.c +++ b/test/tselect.c @@ -21,7 +21,7 @@ * *************************************************************/ -#define H5S_PACKAGE /*suppress error about including H5Spkg */ +#define H5S_FRIEND /*suppress error about including H5Spkg */ /* Define this macro to indicate that the testing APIs should be available */ #define H5S_TESTING diff --git a/test/tsohm.c b/test/tsohm.c index e22940f..b3ffac7 100644 --- a/test/tsohm.c +++ b/test/tsohm.c @@ -27,7 +27,7 @@ * This file needs to access private information from the H5F package. * This file also needs to access the file testing code. */ -#define H5F_PACKAGE +#define H5F_FRIEND /*suppress error about including H5Fpkg */ #define H5F_TESTING #include "H5Fpkg.h" /* File access */ @@ -1279,7 +1279,7 @@ static void size2_verify_plist1(hid_t plist) CHECK_I(ret, "H5Pget_fill_value"); ret = memcmp(&fill1, &fill1_correct, sizeof(fill1_correct)); - VERIFY(ret, 0, memcmp); + VERIFY(ret, 0, "memcmp"); ret = H5Tclose(dtype1_id); CHECK_I(ret, "H5Tclose"); @@ -1350,7 +1350,7 @@ static void size2_verify_plist2(hid_t plist) CHECK_I(ret, "H5Pget_fill_value"); ret = HDmemcmp(&fill2, &fill2_correct, (size_t)DTYPE2_SIZE); - VERIFY(ret, 0, memcmp); + VERIFY(ret, 0, "memcmp"); ret = H5Tclose(dtype2_id); CHECK_I(ret, "H5Tclose"); diff --git a/test/unlink.c b/test/unlink.c index 993a7ec..c091281 100644 --- a/test/unlink.c +++ b/test/unlink.c @@ -20,7 +20,7 @@ * Purpose: Test unlinking operations. */ -#define H5G_PACKAGE /*suppress error about including H5Gpkg */ +#define H5G_FRIEND /*suppress error about including H5Gpkg */ /* Define this macro to indicate that the testing APIs should be available */ #define H5G_TESTING diff --git a/test/vfd.c b/test/vfd.c index 4ece2ba..708474c 100644 --- a/test/vfd.c +++ b/test/vfd.c @@ -80,15 +80,17 @@ const char *FILENAME[] = { static herr_t test_sec2(void) { - hid_t file = -1; - hid_t fapl = -1; - hid_t access_fapl = -1; + hid_t file = -1; + hid_t fapl = -1; + hid_t access_fapl = -1; char filename[1024]; int *fhandle = NULL; hsize_t file_size = 0; TESTING("SEC2 file driver"); + h5_reset(); + /* Set property list and file name for SEC2 driver. */ fapl = h5_fileaccess(); if(H5Pset_fapl_sec2(fapl) < 0) @@ -141,107 +143,103 @@ error: return -1; } - /*------------------------------------------------------------------------- - * Function: test_direct + * Function: test_core * - * Purpose: Tests the file handle interface for DIRECT I/O driver + * Purpose: Tests the file handle interface for CORE driver * * Return: Success: 0 * Failure: -1 * * Programmer: Raymond Lu - * Wednesday, 20 September 2006 + * Tuesday, Sept 24, 2002 * *------------------------------------------------------------------------- */ static herr_t -test_direct(void) +test_core(void) { -#ifdef H5_HAVE_DIRECT hid_t file=(-1), fapl, access_fapl = -1; - hid_t dset1=-1, dset2=-1, space1=-1, space2=-1; char filename[1024]; - int *fhandle=NULL; + void *fhandle=NULL; hsize_t file_size; - hsize_t dims1[2], dims2[1]; - size_t mbound; - size_t fbsize; - size_t cbsize; + hbool_t use_write_tracking; + size_t write_tracking_page_size; int *points = NULL, *check = NULL, *p1, *p2; - int wdata2[DSET2_DIM] = {11,12,13,14}; - int rdata2[DSET2_DIM]; + hid_t dset1=-1, space1=-1; + hsize_t dims1[2]; int i, j, n; -#endif /*H5_HAVE_DIRECT*/ - TESTING("DIRECT I/O file driver"); + TESTING("CORE file driver"); -#ifndef H5_HAVE_DIRECT - SKIPPED(); - return 0; -#else /*H5_HAVE_DIRECT*/ + h5_reset(); - /* Set property list and file name for Direct driver. Set memory alignment boundary - * and file block size to 512 which is the minimum for Linux 2.6. */ + /* Set property list and file name for CORE driver */ fapl = h5_fileaccess(); - if(H5Pset_fapl_direct(fapl, MBOUNDARY, FBSIZE, CBSIZE) < 0) - TEST_ERROR; - h5_fixname(FILENAME[5], fapl, filename, sizeof filename); - - /* Verify the file access properties */ - if(H5Pget_fapl_direct(fapl, &mbound, &fbsize, &cbsize) < 0) + if(H5Pset_fapl_core(fapl, (size_t)CORE_INCREMENT, TRUE) < 0) TEST_ERROR; - if(mbound != MBOUNDARY || fbsize != FBSIZE || cbsize != CBSIZE) + if(H5Pset_core_write_tracking(fapl, TRUE, CORE_PAGE_SIZE) < 0) TEST_ERROR; + h5_fixname(FILENAME[1], fapl, filename, sizeof filename); - if(H5Pset_alignment(fapl, (hsize_t)THRESHOLD, (hsize_t)FBSIZE) < 0) + if((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR; - H5E_BEGIN_TRY { - file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); - } H5E_END_TRY; - if(file<0) { - H5Pclose (fapl); - SKIPPED(); - printf(" Probably the file system doesn't support Direct I/O\n"); - return 0; - } - /* Retrieve the access property list... */ if ((access_fapl = H5Fget_access_plist(file)) < 0) TEST_ERROR; /* Check that the driver is correct */ - if(H5FD_DIRECT != H5Pget_driver(access_fapl)) + if(H5FD_CORE != H5Pget_driver(access_fapl)) + TEST_ERROR; + + /* Check that the backing store write tracking info was saved */ + if(H5Pget_core_write_tracking(fapl, &use_write_tracking, &write_tracking_page_size) < 0) + TEST_ERROR; + if(TRUE != use_write_tracking) + TEST_ERROR; + if(CORE_PAGE_SIZE != write_tracking_page_size) TEST_ERROR; /* ...and close the property list */ if (H5Pclose(access_fapl) < 0) TEST_ERROR; - /* Check file handle API */ - if(H5Fget_vfd_handle(file, H5P_DEFAULT, (void **)&fhandle) < 0) - TEST_ERROR; - if(*fhandle<0) + if(H5Fget_vfd_handle(file, H5P_DEFAULT, &fhandle) < 0) TEST_ERROR; + if(fhandle==NULL) + { + printf("fhandle==NULL\n"); + TEST_ERROR; + } /* Check file size API */ if(H5Fget_filesize(file, &file_size) < 0) TEST_ERROR; - /* There is no guarantee of the number of metadata allocations, but it's - * 4 currently and the size of the file should be between 3 & 4 file buffer - * sizes.. + /* There is no garantee the size of metadata in file is constant. + * Just try to check if it's reasonable. Why is this 4KB? */ - if(file_size < (FBSIZE * 3) || file_size >= (FBSIZE * 4)) + if(file_size<2*KB || file_size>6*KB) TEST_ERROR; - /* Allocate aligned memory for data set 1. For data set 1, everything is aligned including - * memory address, size of data, and file address. */ - if(0 != HDposix_memalign(&points, (size_t)FBSIZE, (size_t)(DSET1_DIM1 * DSET1_DIM2 * sizeof(int)))) + if(H5Fclose(file) < 0) TEST_ERROR; - if(0 != HDposix_memalign(&check, (size_t)FBSIZE, (size_t)(DSET1_DIM1 * DSET1_DIM2 * sizeof(int)))) + + + /* Open the file with backing store off for read and write. + * Changes won't be saved in file. */ + if(H5Pset_fapl_core(fapl, (size_t)CORE_INCREMENT, FALSE) < 0) + TEST_ERROR; + + if((file=H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) + TEST_ERROR; + + /* Allocate memory for data set. */ + if(NULL == (points = (int *)HDmalloc(DSET1_DIM1 * DSET1_DIM2 * sizeof(int)))) + TEST_ERROR; + if(NULL == (check = (int *)HDmalloc(DSET1_DIM1 * DSET1_DIM2 * sizeof(int)))) TEST_ERROR; /* Initialize the dset1 */ @@ -284,47 +282,70 @@ test_direct(void) printf(" Read different values than written in data set 1.\n"); printf(" At index %d,%d\n", i, j); TEST_ERROR; - } /* end if */ + } /* end if */ - /* Create the data space2. For data set 2, memory address and data size are not aligned. */ - dims2[0] = DSET2_DIM; - if((space2 = H5Screate_simple(1, dims2, NULL)) < 0) + if(H5Dclose(dset1) < 0) TEST_ERROR; - /* Create the dset2 */ - if((dset2 = H5Dcreate2(file, DSET2_NAME, H5T_NATIVE_INT, space2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + if(H5Fclose(file) < 0) + TEST_ERROR; + + /* Open the file with backing store on for read and write. + * Changes will be saved in file. */ + if(H5Pset_fapl_core(fapl, (size_t)CORE_INCREMENT, TRUE) < 0) + TEST_ERROR; + + if((file = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) + TEST_ERROR; + + /* Create the dset1 */ + if((dset1 = H5Dcreate2(file, DSET1_NAME, H5T_NATIVE_INT, space1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR; /* Write the data to the dset1 */ - if(H5Dwrite(dset2, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata2) < 0) + if(H5Dwrite(dset1, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, points) < 0) TEST_ERROR; - if(H5Dclose(dset2) < 0) + if(H5Dclose(dset1) < 0) TEST_ERROR; - if((dset2 = H5Dopen2(file, DSET2_NAME, H5P_DEFAULT)) < 0) + if((dset1 = H5Dopen2(file, DSET1_NAME, H5P_DEFAULT)) < 0) + TEST_ERROR; + + /* Reallocate memory for reading buffer. */ + HDassert(check); + HDfree(check); + if(NULL == (check = (int *)HDmalloc(DSET1_DIM1 * DSET1_DIM2 * sizeof(int)))) TEST_ERROR; /* Read the data back from dset1 */ - if(H5Dread(dset2, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata2) < 0) + if(H5Dread(dset1, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, check) < 0) TEST_ERROR; /* Check that the values read are the same as the values written */ - for(i = 0; i < DSET2_DIM; i++) - if(wdata2[i] != rdata2[i]) { - H5_FAILED(); - printf(" Read different values than written in data set 2.\n"); - printf(" At index %d\n", i); - TEST_ERROR; - } /* end if */ + p1 = points; + p2 = check; + for(i = 0; i < DSET1_DIM1; i++) + for(j = 0; j < DSET1_DIM2; j++) + if(*p1++ != *p2++) { + H5_FAILED(); + printf(" Read different values than written in data set 1.\n"); + printf(" At index %d,%d\n", i, j); + TEST_ERROR; + } /* end if */ - if(H5Sclose(space1) < 0) + /* Check file size API */ + if(H5Fget_filesize(file, &file_size) < 0) TEST_ERROR; - if(H5Dclose(dset1) < 0) + + /* There is no garantee the size of metadata in file is constant. + * Just try to check if it's reasonable. */ + if(file_size<64*KB || file_size>256*KB) TEST_ERROR; - if(H5Sclose(space2) < 0) + + if(H5Sclose(space1) < 0) TEST_ERROR; - if(H5Dclose(dset2) < 0) + if(H5Dclose(dset1) < 0) TEST_ERROR; if(H5Fclose(file) < 0) TEST_ERROR; @@ -334,16 +355,13 @@ test_direct(void) HDfree(check); h5_cleanup(FILENAME, fapl); + PASSED(); return 0; error: H5E_BEGIN_TRY { H5Pclose(fapl); - H5Sclose(space1); - H5Dclose(dset1); - H5Sclose(space2); - H5Dclose(dset2); H5Fclose(file); } H5E_END_TRY; @@ -353,104 +371,110 @@ error: HDfree(check); return -1; -#endif /*H5_HAVE_DIRECT*/ } /*------------------------------------------------------------------------- - * Function: test_core + * Function: test_direct * - * Purpose: Tests the file handle interface for CORE driver + * Purpose: Tests the file handle interface for DIRECT I/O driver * * Return: Success: 0 * Failure: -1 * * Programmer: Raymond Lu - * Tuesday, Sept 24, 2002 + * Wednesday, 20 September 2006 * *------------------------------------------------------------------------- */ static herr_t -test_core(void) +test_direct(void) { +#ifdef H5_HAVE_DIRECT hid_t file=(-1), fapl, access_fapl = -1; + hid_t dset1=-1, dset2=-1, space1=-1, space2=-1; char filename[1024]; - void *fhandle=NULL; + int *fhandle=NULL; hsize_t file_size; - hbool_t use_write_tracking; - size_t write_tracking_page_size; + hsize_t dims1[2], dims2[1]; + size_t mbound; + size_t fbsize; + size_t cbsize; int *points = NULL, *check = NULL, *p1, *p2; - hid_t dset1=-1, space1=-1; - hsize_t dims1[2]; + int wdata2[DSET2_DIM] = {11,12,13,14}; + int rdata2[DSET2_DIM]; int i, j, n; +#endif /*H5_HAVE_DIRECT*/ - TESTING("CORE file driver"); + TESTING("DIRECT I/O file driver"); - /* Set property list and file name for CORE driver */ +#ifndef H5_HAVE_DIRECT + SKIPPED(); + return 0; +#else /*H5_HAVE_DIRECT*/ + + h5_reset(); + + /* Set property list and file name for Direct driver. Set memory alignment boundary + * and file block size to 512 which is the minimum for Linux 2.6. */ fapl = h5_fileaccess(); - if(H5Pset_fapl_core(fapl, (size_t)CORE_INCREMENT, TRUE) < 0) + if(H5Pset_fapl_direct(fapl, MBOUNDARY, FBSIZE, CBSIZE) < 0) TEST_ERROR; - if(H5Pset_core_write_tracking(fapl, TRUE, CORE_PAGE_SIZE) < 0) + h5_fixname(FILENAME[5], fapl, filename, sizeof filename); + + /* Verify the file access properties */ + if(H5Pget_fapl_direct(fapl, &mbound, &fbsize, &cbsize) < 0) + TEST_ERROR; + if(mbound != MBOUNDARY || fbsize != FBSIZE || cbsize != CBSIZE) TEST_ERROR; - h5_fixname(FILENAME[1], fapl, filename, sizeof filename); - if((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) + if(H5Pset_alignment(fapl, (hsize_t)THRESHOLD, (hsize_t)FBSIZE) < 0) TEST_ERROR; + H5E_BEGIN_TRY { + file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); + } H5E_END_TRY; + if(file<0) { + H5Pclose (fapl); + SKIPPED(); + printf(" Probably the file system doesn't support Direct I/O\n"); + return 0; + } + /* Retrieve the access property list... */ if ((access_fapl = H5Fget_access_plist(file)) < 0) TEST_ERROR; /* Check that the driver is correct */ - if(H5FD_CORE != H5Pget_driver(access_fapl)) - TEST_ERROR; - - /* Check that the backing store write tracking info was saved */ - if(H5Pget_core_write_tracking(fapl, &use_write_tracking, &write_tracking_page_size) < 0) - TEST_ERROR; - if(TRUE != use_write_tracking) - TEST_ERROR; - if(CORE_PAGE_SIZE != write_tracking_page_size) + if(H5FD_DIRECT != H5Pget_driver(access_fapl)) TEST_ERROR; /* ...and close the property list */ if (H5Pclose(access_fapl) < 0) TEST_ERROR; - if(H5Fget_vfd_handle(file, H5P_DEFAULT, &fhandle) < 0) + /* Check file handle API */ + if(H5Fget_vfd_handle(file, H5P_DEFAULT, (void **)&fhandle) < 0) + TEST_ERROR; + if(*fhandle<0) TEST_ERROR; - if(fhandle==NULL) - { - printf("fhandle==NULL\n"); - TEST_ERROR; - } /* Check file size API */ if(H5Fget_filesize(file, &file_size) < 0) TEST_ERROR; - /* There is no garantee the size of metadata in file is constant. - * Just try to check if it's reasonable. Why is this 4KB? + /* There is no guarantee of the number of metadata allocations, but it's + * 4 currently and the size of the file should be between 3 & 4 file buffer + * sizes.. */ - if(file_size<2*KB || file_size>6*KB) - TEST_ERROR; - - if(H5Fclose(file) < 0) - TEST_ERROR; - - - /* Open the file with backing store off for read and write. - * Changes won't be saved in file. */ - if(H5Pset_fapl_core(fapl, (size_t)CORE_INCREMENT, FALSE) < 0) - TEST_ERROR; - - if((file=H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) + if(file_size < (FBSIZE * 3) || file_size >= (FBSIZE * 4)) TEST_ERROR; - /* Allocate memory for data set. */ - if(NULL == (points = (int *)HDmalloc(DSET1_DIM1 * DSET1_DIM2 * sizeof(int)))) + /* Allocate aligned memory for data set 1. For data set 1, everything is aligned including + * memory address, size of data, and file address. */ + if(0 != HDposix_memalign(&points, (size_t)FBSIZE, (size_t)(DSET1_DIM1 * DSET1_DIM2 * sizeof(int)))) TEST_ERROR; - if(NULL == (check = (int *)HDmalloc(DSET1_DIM1 * DSET1_DIM2 * sizeof(int)))) + if(0 != HDposix_memalign(&check, (size_t)FBSIZE, (size_t)(DSET1_DIM1 * DSET1_DIM2 * sizeof(int)))) TEST_ERROR; /* Initialize the dset1 */ @@ -493,71 +517,48 @@ test_core(void) printf(" Read different values than written in data set 1.\n"); printf(" At index %d,%d\n", i, j); TEST_ERROR; - } /* end if */ - - if(H5Dclose(dset1) < 0) - TEST_ERROR; - - if(H5Fclose(file) < 0) - TEST_ERROR; - - /* Open the file with backing store on for read and write. - * Changes will be saved in file. */ - if(H5Pset_fapl_core(fapl, (size_t)CORE_INCREMENT, TRUE) < 0) - TEST_ERROR; + } /* end if */ - if((file = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) + /* Create the data space2. For data set 2, memory address and data size are not aligned. */ + dims2[0] = DSET2_DIM; + if((space2 = H5Screate_simple(1, dims2, NULL)) < 0) TEST_ERROR; - /* Create the dset1 */ - if((dset1 = H5Dcreate2(file, DSET1_NAME, H5T_NATIVE_INT, space1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + /* Create the dset2 */ + if((dset2 = H5Dcreate2(file, DSET2_NAME, H5T_NATIVE_INT, space2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR; /* Write the data to the dset1 */ - if(H5Dwrite(dset1, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, points) < 0) - TEST_ERROR; - - if(H5Dclose(dset1) < 0) + if(H5Dwrite(dset2, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata2) < 0) TEST_ERROR; - if((dset1 = H5Dopen2(file, DSET1_NAME, H5P_DEFAULT)) < 0) + if(H5Dclose(dset2) < 0) TEST_ERROR; - /* Reallocate memory for reading buffer. */ - HDassert(check); - HDfree(check); - if(NULL == (check = (int *)HDmalloc(DSET1_DIM1 * DSET1_DIM2 * sizeof(int)))) + if((dset2 = H5Dopen2(file, DSET2_NAME, H5P_DEFAULT)) < 0) TEST_ERROR; /* Read the data back from dset1 */ - if(H5Dread(dset1, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, check) < 0) + if(H5Dread(dset2, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata2) < 0) TEST_ERROR; /* Check that the values read are the same as the values written */ - p1 = points; - p2 = check; - for(i = 0; i < DSET1_DIM1; i++) - for(j = 0; j < DSET1_DIM2; j++) - if(*p1++ != *p2++) { - H5_FAILED(); - printf(" Read different values than written in data set 1.\n"); - printf(" At index %d,%d\n", i, j); - TEST_ERROR; - } /* end if */ - - /* Check file size API */ - if(H5Fget_filesize(file, &file_size) < 0) - TEST_ERROR; - - /* There is no garantee the size of metadata in file is constant. - * Just try to check if it's reasonable. */ - if(file_size<64*KB || file_size>256*KB) - TEST_ERROR; + for(i = 0; i < DSET2_DIM; i++) + if(wdata2[i] != rdata2[i]) { + H5_FAILED(); + printf(" Read different values than written in data set 2.\n"); + printf(" At index %d\n", i); + TEST_ERROR; + } /* end if */ if(H5Sclose(space1) < 0) TEST_ERROR; if(H5Dclose(dset1) < 0) TEST_ERROR; + if(H5Sclose(space2) < 0) + TEST_ERROR; + if(H5Dclose(dset2) < 0) + TEST_ERROR; if(H5Fclose(file) < 0) TEST_ERROR; HDassert(points); @@ -566,13 +567,16 @@ test_core(void) HDfree(check); h5_cleanup(FILENAME, fapl); - PASSED(); return 0; error: H5E_BEGIN_TRY { H5Pclose(fapl); + H5Sclose(space1); + H5Dclose(dset1); + H5Sclose(space2); + H5Dclose(dset2); H5Fclose(file); } H5E_END_TRY; @@ -582,6 +586,7 @@ error: HDfree(check); return -1; +#endif /*H5_HAVE_DIRECT*/ } @@ -685,6 +690,8 @@ test_family(void) TESTING("FAMILY file driver"); + h5_reset(); + /* Set property list and file name for FAMILY driver */ fapl = h5_fileaccess(); @@ -846,6 +853,8 @@ test_family_compat(void) TESTING("FAMILY file driver backward compatibility"); + h5_reset(); + /* Set property list and file name for FAMILY driver */ fapl = h5_fileaccess(); @@ -982,6 +991,9 @@ test_multi(void) int buf[MULTI_SIZE][MULTI_SIZE]; TESTING("MULTI file driver"); + + h5_reset(); + /* Set file access property list for MULTI driver */ fapl = h5_fileaccess(); @@ -1194,6 +1206,8 @@ test_multi_compat(void) TESTING("MULTI file driver backward compatibility"); + h5_reset(); + /* Set file access property list for MULTI driver */ fapl = h5_fileaccess(); @@ -1349,6 +1363,8 @@ test_log(void) TESTING("LOG file driver"); + h5_reset(); + /* Set property list and file name for log driver. */ fapl = h5_fileaccess(); if(H5Pset_fapl_log(fapl, LOG_FILENAME, flags, buf_size) < 0) @@ -1428,6 +1444,8 @@ test_stdio(void) TESTING("STDIO file driver"); + h5_reset(); + /* Set property list and file name for STDIO driver. */ fapl = h5_fileaccess(); if(H5Pset_fapl_stdio(fapl) < 0) @@ -1518,6 +1536,8 @@ test_windows(void) #else /* H5_HAVE_WINDOWS */ + h5_reset(); + /* Set property list and file name for WINDOWS driver. */ fapl = h5_fileaccess(); if(H5Pset_fapl_windows(fapl) < 0) @@ -1592,25 +1612,23 @@ main(void) { int nerrors = 0; - h5_reset(); - printf("Testing basic Virtual File Driver functionality.\n"); nerrors += test_sec2() < 0 ? 1 : 0; nerrors += test_core() < 0 ? 1 : 0; + nerrors += test_direct() < 0 ? 1 : 0; nerrors += test_family() < 0 ? 1 : 0; nerrors += test_family_compat() < 0 ? 1 : 0; nerrors += test_multi() < 0 ? 1 : 0; nerrors += test_multi_compat() < 0 ? 1 : 0; - nerrors += test_direct() < 0 ? 1 : 0; nerrors += test_log() < 0 ? 1 : 0; nerrors += test_stdio() < 0 ? 1 : 0; nerrors += test_windows() < 0 ? 1 : 0; if(nerrors) { - printf("***** %d Virtual File Driver TEST%s FAILED! *****\n", - nerrors, nerrors > 1 ? "S" : ""); - return 1; + printf("***** %d Virtual File Driver TEST%s FAILED! *****\n", + nerrors, nerrors > 1 ? "S" : ""); + return 1; } printf("All Virtual File Driver tests passed.\n"); diff --git a/testpar/t_cache.c b/testpar/t_cache.c index 42788f4..b848827 100644 --- a/testpar/t_cache.c +++ b/testpar/t_cache.c @@ -21,9 +21,9 @@ #include "h5test.h" #include "testpar.h" -#define H5AC_PACKAGE /*suppress error about including H5ACpkg */ -#define H5C_PACKAGE /*suppress error about including H5Cpkg */ -#define H5F_PACKAGE /*suppress error about including H5Fpkg */ +#define H5AC_FRIEND /*suppress error about including H5ACpkg */ +#define H5C_FRIEND /*suppress error about including H5Cpkg */ +#define H5F_FRIEND /*suppress error about including H5Fpkg */ #include "H5ACpkg.h" #include "H5Cpkg.h" diff --git a/testpar/t_mpi.c b/testpar/t_mpi.c index 873b952..feea137 100644 --- a/testpar/t_mpi.c +++ b/testpar/t_mpi.c @@ -1235,7 +1235,7 @@ finish: /* turn off alarm */ ALARM_OFF; - h5_cleanup(FILENAME, fapl); + h5_clean_files(FILENAME, fapl); H5close(); /* MPI_Finalize must be called AFTER H5close which may use MPI calls */ diff --git a/testpar/t_pflush2.c b/testpar/t_pflush2.c index 03f7c82..f9f8459 100644 --- a/testpar/t_pflush2.c +++ b/testpar/t_pflush2.c @@ -200,8 +200,8 @@ main(int argc, char* argv[]) H5Eset_auto2(H5E_DEFAULT, func, NULL); - h5_cleanup(&FILENAME[0], fapl1); - h5_cleanup(&FILENAME[1], fapl2); + h5_clean_files(&FILENAME[0], fapl1); + h5_clean_files(&FILENAME[1], fapl2); } else { diff --git a/testpar/t_shapesame.c b/testpar/t_shapesame.c index 9088470..8722ee2 100644 --- a/testpar/t_shapesame.c +++ b/testpar/t_shapesame.c @@ -18,7 +18,7 @@ same shape by H5Sselect_shape_same(). */ -#define H5S_PACKAGE /*suppress error about including H5Spkg */ +#define H5S_FRIEND /*suppress error about including H5Spkg */ /* Define this macro to indicate that the testing APIs should be available */ #define H5S_TESTING @@ -5123,7 +5123,7 @@ int main(int argc, char **argv) TestSummary(); /* Clean up test files */ - h5_cleanup(FILENAME, fapl); + h5_clean_files(FILENAME, fapl); nerrors += GetTestNumErrs(); @@ -5148,3 +5148,4 @@ int main(int argc, char **argv) /* cannot just return (nerrors) because exit code is limited to 1byte */ return(nerrors!=0); } + diff --git a/testpar/testphdf5.c b/testpar/testphdf5.c index c3da73f..f1ec507 100644 --- a/testpar/testphdf5.c +++ b/testpar/testphdf5.c @@ -563,7 +563,7 @@ int main(int argc, char **argv) TestSummary(); /* Clean up test files */ - h5_cleanup(FILENAME, fapl); + h5_clean_files(FILENAME, fapl); nerrors += GetTestNumErrs(); diff --git a/tools/h5dump/errfiles/tall-1.err b/tools/h5dump/errfiles/tall-1.err index ba691d0..ab9dbe3 100644 --- a/tools/h5dump/errfiles/tall-1.err +++ b/tools/h5dump/errfiles/tall-1.err @@ -1,9 +1,9 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #000: (file name) line (number) in H5Oopen(): unable to open object - major: Symbol table + major: Object header minor: Can't open object #001: (file name) line (number) in H5O_open_name(): object not found - major: Symbol table + major: Object header minor: Object not found #002: (file name) line (number) in H5G_loc_find(): can't find object major: Symbol table diff --git a/tools/h5dump/errfiles/tall-2A.err b/tools/h5dump/errfiles/tall-2A.err index ba691d0..ab9dbe3 100644 --- a/tools/h5dump/errfiles/tall-2A.err +++ b/tools/h5dump/errfiles/tall-2A.err @@ -1,9 +1,9 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #000: (file name) line (number) in H5Oopen(): unable to open object - major: Symbol table + major: Object header minor: Can't open object #001: (file name) line (number) in H5O_open_name(): object not found - major: Symbol table + major: Object header minor: Object not found #002: (file name) line (number) in H5G_loc_find(): can't find object major: Symbol table diff --git a/tools/h5dump/errfiles/tall-2A0.err b/tools/h5dump/errfiles/tall-2A0.err index ba691d0..ab9dbe3 100644 --- a/tools/h5dump/errfiles/tall-2A0.err +++ b/tools/h5dump/errfiles/tall-2A0.err @@ -1,9 +1,9 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #000: (file name) line (number) in H5Oopen(): unable to open object - major: Symbol table + major: Object header minor: Can't open object #001: (file name) line (number) in H5O_open_name(): object not found - major: Symbol table + major: Object header minor: Object not found #002: (file name) line (number) in H5G_loc_find(): can't find object major: Symbol table diff --git a/tools/h5dump/errfiles/tall-2B.err b/tools/h5dump/errfiles/tall-2B.err index ba691d0..ab9dbe3 100644 --- a/tools/h5dump/errfiles/tall-2B.err +++ b/tools/h5dump/errfiles/tall-2B.err @@ -1,9 +1,9 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #000: (file name) line (number) in H5Oopen(): unable to open object - major: Symbol table + major: Object header minor: Can't open object #001: (file name) line (number) in H5O_open_name(): object not found - major: Symbol table + major: Object header minor: Object not found #002: (file name) line (number) in H5G_loc_find(): can't find object major: Symbol table diff --git a/tools/h5dump/errfiles/textlink.err b/tools/h5dump/errfiles/textlink.err index 03c0550..95556db 100644 --- a/tools/h5dump/errfiles/textlink.err +++ b/tools/h5dump/errfiles/textlink.err @@ -1,9 +1,9 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #000: (file name) line (number) in H5Oopen(): unable to open object - major: Symbol table + major: Object header minor: Can't open object #001: (file name) line (number) in H5O_open_name(): object not found - major: Symbol table + major: Object header minor: Object not found #002: (file name) line (number) in H5G_loc_find(): can't find object major: Symbol table @@ -25,10 +25,10 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): minor: Unable to open file HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #000: (file name) line (number) in H5Oopen(): unable to open object - major: Symbol table + major: Object header minor: Can't open object #001: (file name) line (number) in H5O_open_name(): object not found - major: Symbol table + major: Object header minor: Object not found #002: (file name) line (number) in H5G_loc_find(): can't find object major: Symbol table diff --git a/tools/h5dump/errfiles/textlinkfar.err b/tools/h5dump/errfiles/textlinkfar.err index 969e17c..5aa7f87 100644 --- a/tools/h5dump/errfiles/textlinkfar.err +++ b/tools/h5dump/errfiles/textlinkfar.err @@ -1,9 +1,9 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #000: (file name) line (number) in H5Oopen(): unable to open object - major: Symbol table + major: Object header minor: Can't open object #001: (file name) line (number) in H5O_open_name(): object not found - major: Symbol table + major: Object header minor: Object not found #002: (file name) line (number) in H5G_loc_find(): can't find object major: Symbol table @@ -24,7 +24,7 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): major: Symbol table minor: Can't open object #008: (file name) line (number) in H5O_open_name(): object not found - major: Symbol table + major: Object header minor: Object not found #009: (file name) line (number) in H5G_loc_find(): can't find object major: Symbol table @@ -67,7 +67,7 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): major: Symbol table minor: Can't open object #006: (file name) line (number) in H5O_open_name(): object not found - major: Symbol table + major: Object header minor: Object not found #007: (file name) line (number) in H5G_loc_find(): can't find object major: Symbol table @@ -88,7 +88,7 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): major: Symbol table minor: Can't open object #013: (file name) line (number) in H5O_open_name(): object not found - major: Symbol table + major: Object header minor: Object not found #014: (file name) line (number) in H5G_loc_find(): can't find object major: Symbol table @@ -109,7 +109,7 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): major: Symbol table minor: Can't open object #020: (file name) line (number) in H5O_open_name(): object not found - major: Symbol table + major: Object header minor: Object not found #021: (file name) line (number) in H5G_loc_find(): can't find object major: Symbol table @@ -130,7 +130,7 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): major: Symbol table minor: Can't open object #027: (file name) line (number) in H5O_open_name(): object not found - major: Symbol table + major: Object header minor: Object not found #028: (file name) line (number) in H5G_loc_find(): can't find object major: Symbol table @@ -164,7 +164,7 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): major: Symbol table minor: Can't open object #006: (file name) line (number) in H5O_open_name(): object not found - major: Symbol table + major: Object header minor: Object not found #007: (file name) line (number) in H5G_loc_find(): can't find object major: Symbol table @@ -185,7 +185,7 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): major: Symbol table minor: Can't open object #013: (file name) line (number) in H5O_open_name(): object not found - major: Symbol table + major: Object header minor: Object not found #014: (file name) line (number) in H5G_loc_find(): can't find object major: Symbol table @@ -206,7 +206,7 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): major: Symbol table minor: Can't open object #020: (file name) line (number) in H5O_open_name(): object not found - major: Symbol table + major: Object header minor: Object not found #021: (file name) line (number) in H5G_loc_find(): can't find object major: Symbol table @@ -227,7 +227,7 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): major: Symbol table minor: Can't open object #027: (file name) line (number) in H5O_open_name(): object not found - major: Symbol table + major: Object header minor: Object not found #028: (file name) line (number) in H5G_loc_find(): can't find object major: Symbol table diff --git a/tools/h5dump/errfiles/textlinksrc.err b/tools/h5dump/errfiles/textlinksrc.err index 969e17c..5aa7f87 100644 --- a/tools/h5dump/errfiles/textlinksrc.err +++ b/tools/h5dump/errfiles/textlinksrc.err @@ -1,9 +1,9 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #000: (file name) line (number) in H5Oopen(): unable to open object - major: Symbol table + major: Object header minor: Can't open object #001: (file name) line (number) in H5O_open_name(): object not found - major: Symbol table + major: Object header minor: Object not found #002: (file name) line (number) in H5G_loc_find(): can't find object major: Symbol table @@ -24,7 +24,7 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): major: Symbol table minor: Can't open object #008: (file name) line (number) in H5O_open_name(): object not found - major: Symbol table + major: Object header minor: Object not found #009: (file name) line (number) in H5G_loc_find(): can't find object major: Symbol table @@ -67,7 +67,7 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): major: Symbol table minor: Can't open object #006: (file name) line (number) in H5O_open_name(): object not found - major: Symbol table + major: Object header minor: Object not found #007: (file name) line (number) in H5G_loc_find(): can't find object major: Symbol table @@ -88,7 +88,7 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): major: Symbol table minor: Can't open object #013: (file name) line (number) in H5O_open_name(): object not found - major: Symbol table + major: Object header minor: Object not found #014: (file name) line (number) in H5G_loc_find(): can't find object major: Symbol table @@ -109,7 +109,7 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): major: Symbol table minor: Can't open object #020: (file name) line (number) in H5O_open_name(): object not found - major: Symbol table + major: Object header minor: Object not found #021: (file name) line (number) in H5G_loc_find(): can't find object major: Symbol table @@ -130,7 +130,7 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): major: Symbol table minor: Can't open object #027: (file name) line (number) in H5O_open_name(): object not found - major: Symbol table + major: Object header minor: Object not found #028: (file name) line (number) in H5G_loc_find(): can't find object major: Symbol table @@ -164,7 +164,7 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): major: Symbol table minor: Can't open object #006: (file name) line (number) in H5O_open_name(): object not found - major: Symbol table + major: Object header minor: Object not found #007: (file name) line (number) in H5G_loc_find(): can't find object major: Symbol table @@ -185,7 +185,7 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): major: Symbol table minor: Can't open object #013: (file name) line (number) in H5O_open_name(): object not found - major: Symbol table + major: Object header minor: Object not found #014: (file name) line (number) in H5G_loc_find(): can't find object major: Symbol table @@ -206,7 +206,7 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): major: Symbol table minor: Can't open object #020: (file name) line (number) in H5O_open_name(): object not found - major: Symbol table + major: Object header minor: Object not found #021: (file name) line (number) in H5G_loc_find(): can't find object major: Symbol table @@ -227,7 +227,7 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): major: Symbol table minor: Can't open object #027: (file name) line (number) in H5O_open_name(): object not found - major: Symbol table + major: Object header minor: Object not found #028: (file name) line (number) in H5G_loc_find(): can't find object major: Symbol table diff --git a/tools/h5dump/errfiles/torderlinks1.err b/tools/h5dump/errfiles/torderlinks1.err index 780c7e6..e665f03 100644 --- a/tools/h5dump/errfiles/torderlinks1.err +++ b/tools/h5dump/errfiles/torderlinks1.err @@ -1,9 +1,9 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #000: (file name) line (number) in H5Oopen(): unable to open object - major: Symbol table + major: Object header minor: Can't open object #001: (file name) line (number) in H5O_open_name(): object not found - major: Symbol table + major: Object header minor: Object not found #002: (file name) line (number) in H5G_loc_find(): can't find object major: Symbol table diff --git a/tools/h5dump/errfiles/torderlinks2.err b/tools/h5dump/errfiles/torderlinks2.err index 780c7e6..e665f03 100644 --- a/tools/h5dump/errfiles/torderlinks2.err +++ b/tools/h5dump/errfiles/torderlinks2.err @@ -1,9 +1,9 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #000: (file name) line (number) in H5Oopen(): unable to open object - major: Symbol table + major: Object header minor: Can't open object #001: (file name) line (number) in H5O_open_name(): object not found - major: Symbol table + major: Object header minor: Object not found #002: (file name) line (number) in H5G_loc_find(): can't find object major: Symbol table diff --git a/tools/h5repack/h5repacktst.c b/tools/h5repack/h5repacktst.c index 46d895c..3959300 100644 --- a/tools/h5repack/h5repacktst.c +++ b/tools/h5repack/h5repacktst.c @@ -1547,10 +1547,8 @@ int main (void) { hid_t fapl; - /* setup */ - h5_reset(); fapl = h5_fileaccess(); - h5_cleanup(H5REPACK_FILENAMES, fapl); + h5_clean_files(H5REPACK_FILENAMES, fapl); } diff --git a/tools/misc/h5debug.c b/tools/misc/h5debug.c index 3789723..480450d 100644 --- a/tools/misc/h5debug.c +++ b/tools/misc/h5debug.c @@ -23,19 +23,19 @@ * *------------------------------------------------------------------------- */ -#define H5A_PACKAGE /*suppress error about including H5Apkg */ -#define H5B2_PACKAGE /*suppress error about including H5B2pkg */ -#define H5B2_TESTING /*suppress warning about H5B2 testing funcs*/ -#define H5D_PACKAGE /*suppress error about including H5Dpkg */ -#define H5EA_PACKAGE /*suppress error about including H5EApkg */ -#define H5EA_TESTING /*suppress warning about H5EA testing funcs*/ -#define H5FA_PACKAGE /*suppress error about including H5FApkg */ -#define H5FA_TESTING /*suppress warning about H5FA testing funcs*/ -#define H5F_PACKAGE /*suppress error about including H5Fpkg */ -#define H5G_PACKAGE /*suppress error about including H5Gpkg */ -#define H5HF_PACKAGE /*suppress error about including H5HFpkg */ -#define H5O_PACKAGE /*suppress error about including H5Opkg */ -#define H5SM_PACKAGE /*suppress error about including H5SMpkg */ +#define H5A_FRIEND /*suppress error about including H5Apkg */ +#define H5B2_FRIEND /*suppress error about including H5B2pkg */ +#define H5B2_TESTING /*suppress warning about H5B2 testing funcs*/ +#define H5D_FRIEND /*suppress error about including H5Dpkg */ +#define H5EA_FRIEND /*suppress error about including H5EApkg */ +#define H5EA_TESTING /*suppress warning about H5EA testing funcs*/ +#define H5FA_FRIEND /*suppress error about including H5FApkg */ +#define H5FA_TESTING /*suppress warning about H5FA testing funcs*/ +#define H5F_FRIEND /*suppress error about including H5Fpkg */ +#define H5G_FRIEND /*suppress error about including H5Gpkg */ +#define H5HF_FRIEND /*suppress error about including H5HFpkg */ +#define H5O_FRIEND /*suppress error about including H5Opkg */ +#define H5SM_FRIEND /*suppress error about including H5SMpkg */ #include "H5private.h" /* Generic Functions */ #include "H5Apkg.h" /* Attributes */ diff --git a/tools/misc/talign.c b/tools/misc/talign.c index 2d0a9d1..1a26a28 100644 --- a/tools/misc/talign.c +++ b/tools/misc/talign.c @@ -137,6 +137,7 @@ int main(void) H5Dread(set, fix, spc, H5S_ALL, H5P_DEFAULT, data); fptr = (float *)(data + H5Tget_member_offset(fix, 1)); + H5Dclose(set); out: if(error < 0) { @@ -194,7 +195,9 @@ out: if(data) HDfree(data); H5Sclose(spc); + H5Tclose(cs6); H5Tclose(cmp); + H5Tclose(fix); H5Tclose(cmp1); H5Tclose(cmp2); H5Tclose(cmp3); diff --git a/tools/perform/perf_meta.c b/tools/perform/perf_meta.c index b52871e..2c3a19c 100644 --- a/tools/perform/perf_meta.c +++ b/tools/perform/perf_meta.c @@ -821,7 +821,7 @@ main(int argc, char **argv) if (H5Sclose(space) < 0) goto error; if (H5Sclose(small_space) < 0) goto error; - h5_cleanup(FILENAME, fapl); + h5_clean_files(FILENAME, fapl); #ifdef H5_HAVE_PARALLEL if(facc_type == FACC_MPIO) -- cgit v0.12 From 050dd023870ac6858eaf55c20c7ffd46e97b1454 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Mon, 14 Sep 2015 11:21:31 -0500 Subject: [svn-r27771] Description: Merge in part of Neil's property list fixes: Fix a minor memory leak, add some sanity checks, clean up the code a little, and verify that encoding/ decoding default versions of the property lists works correctly. Tested on: MacOSX/64 10.10.5 (amazon) w/serial (Too minor to require h5committest) --- src/H5Pdapl.c | 2 +- src/H5Pocpl.c | 3 ++ src/H5Pocpypl.c | 8 ++++ test/enc_dec_plist.c | 121 ++++++++++++++++++++++++++++++++++++++++++++++----- 4 files changed, 121 insertions(+), 13 deletions(-) diff --git a/src/H5Pdapl.c b/src/H5Pdapl.c index 833f3f0..7b5108a 100644 --- a/src/H5Pdapl.c +++ b/src/H5Pdapl.c @@ -283,5 +283,5 @@ H5Pget_chunk_cache(hid_t dapl_id, size_t *rdcc_nslots, size_t *rdcc_nbytes, doub done: FUNC_LEAVE_API(ret_value) -} +} /* end H5Pget_chunk_cache */ diff --git a/src/H5Pocpl.c b/src/H5Pocpl.c index 08eba3d..1975283 100644 --- a/src/H5Pocpl.c +++ b/src/H5Pocpl.c @@ -1640,6 +1640,9 @@ H5P__ocrt_pipeline_dec(const void **_pp, void *_value) /* Add the filter to the I/O pipeline */ if(H5Z_append(pline, filter.id, filter.flags, filter.cd_nelmts, filter.cd_values) < 0) HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to add filter to pipeline") + + /* Free cd_values, if it was allocated */ + filter.cd_values = (unsigned *)H5MM_xfree(filter.cd_values); } /* end for */ done: diff --git a/src/H5Pocpypl.c b/src/H5Pocpypl.c index 08db49f..4a47dbc 100644 --- a/src/H5Pocpypl.c +++ b/src/H5Pocpypl.c @@ -296,6 +296,9 @@ H5P__ocpy_merge_comm_dt_list_dec(const void **_pp, void *_value) HDassert(pp); HDassert(*pp); HDassert(dt_list); + + /* Start off with NULL (default value) */ + *dt_list = NULL; /* Decode the string sequence */ len = HDstrlen(*(const char **)pp); @@ -440,6 +443,9 @@ H5P__ocpy_merge_comm_dt_list_cmp(const void *_dt_list1, const void *_dt_list2, /* Walk through the lists, comparing each path. For the lists to be the * same, the paths must be in the same order. */ while(dt_list1 && dt_list2) { + HDassert(dt_list1->path); + HDassert(dt_list2->path); + /* Compare paths */ ret_value = HDstrcmp(dt_list1->path, dt_list2->path); if(ret_value != 0) HGOTO_DONE(ret_value) @@ -602,6 +608,8 @@ H5Padd_merge_committed_dtype_path(hid_t plist_id, const char *path) /* Check parameters */ if(!path) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no path specified") + if(path[0] == '\0') + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "path is empty string") /* Get the plist structure */ if(NULL == (plist = H5P_object_verify(plist_id, H5P_OBJECT_COPY))) diff --git a/test/enc_dec_plist.c b/test/enc_dec_plist.c index 4832767..4f0147e 100644 --- a/test/enc_dec_plist.c +++ b/test/enc_dec_plist.c @@ -122,10 +122,18 @@ main(void) printf("Encode/Decode DCPLs\n"); /******* ENCODE/DECODE DCPLS *****/ - TESTING("DCPL Encoding/Decoding"); + TESTING("Default DCPL Encoding/Decoding"); if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) FAIL_STACK_ERROR + /* Test encoding & decoding default property list */ + if(test_encode_decode(dcpl) < 0) + FAIL_PUTS_ERROR("Default DCPL encoding/decoding failed\n") + + PASSED(); + + TESTING("DCPL Encoding/Decoding"); + if((H5Pset_chunk(dcpl, 2, chunk_size)) < 0) FAIL_STACK_ERROR @@ -161,10 +169,18 @@ main(void) /******* ENCODE/DECODE DAPLS *****/ - TESTING("DAPL Encoding/Decoding"); + TESTING("Default DAPL Encoding/Decoding"); if((dapl = H5Pcreate(H5P_DATASET_ACCESS)) < 0) FAIL_STACK_ERROR + /* Test encoding & decoding default property list */ + if(test_encode_decode(dapl) < 0) + FAIL_PUTS_ERROR("Default DAPL encoding/decoding failed\n") + + PASSED(); + + TESTING("DAPL Encoding/Decoding"); + if((H5Pset_chunk_cache(dapl, nslots, nbytes, w0)) < 0) FAIL_STACK_ERROR @@ -180,10 +196,18 @@ main(void) /******* ENCODE/DECODE OCPLS *****/ - TESTING("OCPL Encoding/Decoding"); + TESTING("Default OCPL Encoding/Decoding"); if((ocpl = H5Pcreate(H5P_OBJECT_CREATE)) < 0) FAIL_STACK_ERROR + /* Test encoding & decoding default property list */ + if(test_encode_decode(ocpl) < 0) + FAIL_PUTS_ERROR("Default OCPL encoding/decoding failed\n") + + PASSED(); + + TESTING("OCPL Encoding/Decoding"); + if((H5Pset_attr_creation_order(ocpl, (H5P_CRT_ORDER_TRACKED | H5P_CRT_ORDER_INDEXED))) < 0) FAIL_STACK_ERROR @@ -205,9 +229,18 @@ main(void) /******* ENCODE/DECODE DXPLS *****/ - TESTING("DXPL Encoding/Decoding"); + TESTING("Default DXPL Encoding/Decoding"); if((dxpl = H5Pcreate(H5P_DATASET_XFER)) < 0) FAIL_STACK_ERROR + + /* Test encoding & decoding default property list */ + if(test_encode_decode(dxpl) < 0) + FAIL_PUTS_ERROR("Default DXPL encoding/decoding failed\n") + + PASSED(); + + TESTING("DXPL Encoding/Decoding"); + if((H5Pset_btree_ratios(dxpl, 0.2f, 0.6f, 0.2f)) < 0) FAIL_STACK_ERROR if((H5Pset_hyper_vector_size(dxpl, 5)) < 0) @@ -241,10 +274,18 @@ main(void) /******* ENCODE/DECODE GCPLS *****/ - TESTING("GCPL Encoding/Decoding"); + TESTING("Default GCPL Encoding/Decoding"); if((gcpl = H5Pcreate(H5P_GROUP_CREATE)) < 0) FAIL_STACK_ERROR + /* Test encoding & decoding default property list */ + if(test_encode_decode(gcpl) < 0) + FAIL_PUTS_ERROR("Default GCPL encoding/decoding failed\n") + + PASSED(); + + TESTING("GCPL Encoding/Decoding"); + if((H5Pset_local_heap_size_hint(gcpl, 256)) < 0) FAIL_STACK_ERROR @@ -273,10 +314,18 @@ main(void) /******* ENCODE/DECODE LCPLS *****/ - TESTING("LCPL Encoding/Decoding"); + TESTING("Default LCPL Encoding/Decoding"); if((lcpl = H5Pcreate(H5P_LINK_CREATE)) < 0) FAIL_STACK_ERROR + /* Test encoding & decoding default property list */ + if(test_encode_decode(lcpl) < 0) + FAIL_PUTS_ERROR("Default LCPL encoding/decoding failed\n") + + PASSED(); + + TESTING("LCPL Encoding/Decoding"); + if((H5Pset_create_intermediate_group(lcpl, TRUE)) < 0) FAIL_STACK_ERROR @@ -292,10 +341,18 @@ main(void) /******* ENCODE/DECODE LAPLS *****/ - TESTING("LAPL Encoding/Decoding"); + TESTING("Default LAPL Encoding/Decoding"); if((lapl = H5Pcreate(H5P_LINK_ACCESS)) < 0) FAIL_STACK_ERROR + /* Test encoding & decoding default property list */ + if(test_encode_decode(lapl) < 0) + FAIL_PUTS_ERROR("Default LAPL encoding/decoding failed\n") + + PASSED(); + + TESTING("LAPL Encoding/Decoding"); + if((H5Pset_nlinks(lapl, (size_t)134)) < 0) FAIL_STACK_ERROR @@ -330,10 +387,18 @@ main(void) /******* ENCODE/DECODE OCPYPLS *****/ - TESTING("OCPYPL Encoding/Decoding"); + TESTING("Default OCPYPL Encoding/Decoding"); if((ocpypl = H5Pcreate(H5P_OBJECT_COPY)) < 0) FAIL_STACK_ERROR + /* Test encoding & decoding default property list */ + if(test_encode_decode(ocpypl) < 0) + FAIL_PUTS_ERROR("Default OCPYPL encoding/decoding failed\n") + + PASSED(); + + TESTING("OCPYPL Encoding/Decoding"); + if((H5Pset_copy_object(ocpypl, H5O_COPY_EXPAND_EXT_LINK_FLAG)) < 0) FAIL_STACK_ERROR @@ -354,10 +419,18 @@ main(void) /******* ENCODE/DECODE FAPLS *****/ - TESTING("FAPL Encoding/Decoding"); + TESTING("Default FAPL Encoding/Decoding"); if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) FAIL_STACK_ERROR + /* Test encoding & decoding default property list */ + if(test_encode_decode(fapl) < 0) + FAIL_PUTS_ERROR("Default FAPL encoding/decoding failed\n") + + PASSED(); + + TESTING("FAPL Encoding/Decoding"); + if((H5Pset_family_offset(fapl, 1024)) < 0) FAIL_STACK_ERROR if((H5Pset_meta_block_size(fapl, 2098452)) < 0) @@ -397,11 +470,19 @@ main(void) /******* ENCODE/DECODE FCPLS *****/ - TESTING("FCPL Encoding/Decoding"); + TESTING("Default FCPL Encoding/Decoding"); if((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) FAIL_STACK_ERROR + /* Test encoding & decoding default property list */ + if(test_encode_decode(fcpl) < 0) + FAIL_PUTS_ERROR("Default FCPL encoding/decoding failed\n") + + PASSED(); + + TESTING("FCPL Encoding/Decoding"); + if((H5Pset_userblock(fcpl, 1024) < 0)) FAIL_STACK_ERROR @@ -435,11 +516,19 @@ main(void) /******* ENCODE/DECODE STRCPLS *****/ - TESTING("STRCPL Encoding/Decoding"); + TESTING("Default STRCPL Encoding/Decoding"); if((strcpl = H5Pcreate(H5P_STRING_CREATE)) < 0) FAIL_STACK_ERROR + /* Test encoding & decoding default property list */ + if(test_encode_decode(strcpl) < 0) + FAIL_PUTS_ERROR("Default STRCPL encoding/decoding failed\n") + + PASSED(); + + TESTING("STRCPL Encoding/Decoding"); + if((H5Pset_char_encoding(strcpl, H5T_CSET_UTF8) < 0)) FAIL_STACK_ERROR @@ -455,11 +544,19 @@ main(void) /******* ENCODE/DECODE ACPLS *****/ - TESTING("ACPL Encoding/Decoding"); + TESTING("Default ACPL Encoding/Decoding"); if((acpl = H5Pcreate(H5P_ATTRIBUTE_CREATE)) < 0) FAIL_STACK_ERROR + /* Test encoding & decoding default property list */ + if(test_encode_decode(acpl) < 0) + FAIL_PUTS_ERROR("Default ACPL encoding/decoding failed\n") + + PASSED(); + + TESTING("ACPL Encoding/Decoding"); + if((H5Pset_char_encoding(acpl, H5T_CSET_UTF8) < 0)) FAIL_STACK_ERROR -- cgit v0.12 From 02ce7e7386298576c49d240669314910c3d0c6d1 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Mon, 14 Sep 2015 11:39:09 -0500 Subject: [svn-r27772] Description: Clean up warnings, address HDFFV-9524 Tested on: MacOSX/64 10.10.5 (amazon) w/serial (Too minor to require h5committest) --- test/tmisc.c | 47 ++++++++++++++++++++++++++++++----------------- 1 file changed, 30 insertions(+), 17 deletions(-) diff --git a/test/tmisc.c b/test/tmisc.c index 2980ec2..88a2a44 100644 --- a/test/tmisc.c +++ b/test/tmisc.c @@ -1254,7 +1254,7 @@ test_misc8(void) tdata=wdata; for(u=0; u Date: Mon, 14 Sep 2015 14:27:31 -0500 Subject: [svn-r27773] Description: Correct typos in fix. Tested on: Linux 2.6/32 (jam) w/gcc --- test/tmisc.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/test/tmisc.c b/test/tmisc.c index 88a2a44..fa0f150 100644 --- a/test/tmisc.c +++ b/test/tmisc.c @@ -2713,8 +2713,8 @@ test_misc16(void) /* (Note that these are supposed to stress the code, so are a little weird) */ HDmemcpy(wdata[0], "1234567", MISC16_STR_SIZE); HDmemcpy(wdata[1], "1234567\0", MISC16_STR_SIZE); - HDmemcpy(wdata[1], "12345678", MISC16_STR_SIZE); - HDmemcpy(wdata[1], "\0\0\0\0\0\0\0\0", MISC16_STR_SIZE); + HDmemcpy(wdata[2], "12345678", MISC16_STR_SIZE); + HDmemcpy(wdata[3], "\0\0\0\0\0\0\0\0", MISC16_STR_SIZE); /* Create the file */ file = H5Fcreate(MISC16_FILE, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); @@ -2749,11 +2749,11 @@ test_misc16(void) /* Compare data read in */ for(i = 0; i < MISC16_SPACE_DIM; i++) { if(HDstrlen(wdata[i]) != HDstrlen(rdata[i])) { - TestErrPrintf("VL data length don't match!, strlen(wdata[%d])=%d, strlen(rdata[%d])=%d\n",(int)i,(int)strlen(wdata[i]),(int)i,(int)strlen(rdata[i])); + TestErrPrintf("Line %u: VL data length don't match!, strlen(wdata[%d])=%d, strlen(rdata[%d])=%d\n",(unsigned)__LINE__, (int)i,(int)strlen(wdata[i]),(int)i,(int)strlen(rdata[i])); continue; } /* end if */ if(HDstrcmp(wdata[i], rdata[i]) != 0 ) { - TestErrPrintf("VL data values don't match!, wdata[%d]=%s, rdata[%d]=%s\n",(int)i,wdata[i],(int)i,rdata[i]); + TestErrPrintf("Line %u: VL data values don't match!, wdata[%d]=%s, rdata[%d]=%s\n",(unsigned)__LINE__, (int)i,wdata[i],(int)i,rdata[i]); continue; } /* end if */ } /* end for */ @@ -2798,8 +2798,8 @@ test_misc17(void) /* (Note that these are supposed to stress the code, so are a little weird) */ HDmemcpy(wdata[0], "1234567", MISC17_SPACE_DIM2); HDmemcpy(wdata[1], "1234567\0", MISC17_SPACE_DIM2); - HDmemcpy(wdata[1], "12345678", MISC17_SPACE_DIM2); - HDmemcpy(wdata[1], "\0\0\0\0\0\0\0\0", MISC17_SPACE_DIM2); + HDmemcpy(wdata[2], "12345678", MISC17_SPACE_DIM2); + HDmemcpy(wdata[3], "\0\0\0\0\0\0\0\0", MISC17_SPACE_DIM2); /* Create the file */ file = H5Fcreate(MISC17_FILE, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); @@ -2831,11 +2831,11 @@ test_misc17(void) /* Compare data in the way of strings. */ for(i = 0; i < MISC17_SPACE_DIM1; i++) { if(HDstrlen(wdata[i]) != HDstrlen(rdata[i])) { - TestErrPrintf("VL data length don't match!, strlen(wdata[%d])=%d, strlen(rdata[%d])=%d\n",(int)i,(int)strlen(wdata[i]),(int)i,(int)strlen(rdata[i])); + TestErrPrintf("Line %u: VL data length don't match!, strlen(wdata[%d])=%d, strlen(rdata[%d])=%d\n",(unsigned)__LINE__, (int)i,(int)strlen(wdata[i]),(int)i,(int)strlen(rdata[i])); continue; } /* end if */ if(HDstrcmp(wdata[i], rdata[i]) != 0 ) { - TestErrPrintf("VL data values don't match!, wdata[%d]=%s, rdata[%d]=%s\n",(int)i,wdata[i],(int)i,rdata[i]); + TestErrPrintf("Line %u: VL data values don't match!, wdata[%d]=%s, rdata[%d]=%s\n",(unsigned)__LINE__, (int)i,wdata[i],(int)i,rdata[i]); continue; } /* end if */ } /* end for */ -- cgit v0.12 From b2f94f9faf805035e4d0e9cb76007204c8250e58 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Mon, 14 Sep 2015 14:53:47 -0500 Subject: [svn-r27774] Description: Correct test reset code in plugin code and fix typo in testing script. Tested on: Linux 2.6/32 (jam) w/serial --- test/plugin.c | 6 ++++++ test/test_plugin.sh.in | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/test/plugin.c b/test/plugin.c index 07b20ea..e34c691 100644 --- a/test/plugin.c +++ b/test/plugin.c @@ -768,6 +768,9 @@ main(void) if(H5Pclose(fapl2) < 0) TEST_ERROR if(H5Pclose(fapl) < 0) TEST_ERROR + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); + puts("\nTesting reading data with with dynamic plugin filters:"); /* Close the library so that all loaded plugin libraries are unloaded */ @@ -784,6 +787,9 @@ main(void) /* Open the groups with filters */ nerrors += (test_groups_with_filters(file) < 0 ? 1 : 0); + /* Restore the default error handler (set in h5_reset()) */ + h5_restore_err(); + /* Close the library so that all loaded plugin libraries are unloaded */ h5_reset(); fapl = h5_fileaccess(); diff --git a/test/test_plugin.sh.in b/test/test_plugin.sh.in index a6d8c50..43e76c4 100644 --- a/test/test_plugin.sh.in +++ b/test/test_plugin.sh.in @@ -36,7 +36,7 @@ case $(uname) in *) PLUGIN_LIB1="$FROM_DIR/libdynlib1.* $FROM_DIR/libdynlib3.*" PLUGIN_LIB2="$FROM_DIR/libdynlib2.*" - :: + ;; esac PLUGIN_LIBDIR1=testdir1 PLUGIN_LIBDIR2=testdir2 -- cgit v0.12